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.bb5b5d...

138 lines
1.0 MiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[210,5,7,8,13,16],{"+NIl":function(at,Ne,F){(function(q){q(F("VrN/"))})(function(q){"use strict";q.defineMode("stex",function(G,R){"use strict";function K(w,p){w.cmdState.push(p)}function O(w){return w.cmdState.length>0?w.cmdState[w.cmdState.length-1]:null}function L(w){var p=w.cmdState.pop();p&&p.closeBracket()}function U(w){for(var p=w.cmdState,y=p.length-1;y>=0;y--){var f=p[y];if(f.name=="DEFAULT")continue;return f}return{styleIdentifier:function(){return null}}}function I(w,p,y){return function(){this.name=w,this.bracketNo=0,this.style=p,this.styles=y,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var T={};T.importmodule=I("importmodule","tag",["string","builtin"]),T.documentclass=I("documentclass","tag",["","atom"]),T.usepackage=I("usepackage","tag",["atom"]),T.begin=I("begin","tag",["atom"]),T.end=I("end","tag",["atom"]),T.label=I("label","tag",["atom"]),T.ref=I("ref","tag",["atom"]),T.eqref=I("eqref","tag",["atom"]),T.cite=I("cite","tag",["atom"]),T.bibitem=I("bibitem","tag",["atom"]),T.Bibitem=I("Bibitem","tag",["atom"]),T.RBibitem=I("RBibitem","tag",["atom"]),T.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function P(w,p){w.f=p}function b(w,p){var y;if(w.match(/^\\[a-zA-Z@]+/)){var f=w.current().slice(1);return y=T.hasOwnProperty(f)?T[f]:T.DEFAULT,y=new y,K(p,y),P(p,k),y.style}if(w.match(/^\\[$&%#{}_]/))return"tag";if(w.match(/^\\[,;!\/\\]/))return"tag";if(w.match("\\["))return P(p,function(c,d){return g(c,d,"\\]")}),"keyword";if(w.match("\\("))return P(p,function(c,d){return g(c,d,"\\)")}),"keyword";if(w.match("$$"))return P(p,function(c,d){return g(c,d,"$$")}),"keyword";if(w.match("$"))return P(p,function(c,d){return g(c,d,"$")}),"keyword";var s=w.next();if(s=="%")return w.skipToEnd(),"comment";if(s=="}"||s=="]"){if(y=O(p),y)y.closeBracket(s),P(p,k);else return"error";return"bracket"}else return s=="{"||s=="["?(y=T.DEFAULT,y=new y,K(p,y),"bracket"):/\d/.test(s)?(w.eatWhile(/[\w.%]/),"atom"):(w.eatWhile(/[\w\-_]/),y=U(p),y.name=="begin"&&(y.argument=w.current()),y.styleIdentifier())}function g(w,p,y){if(w.eatSpace())return null;if(y&&w.match(y))return P(p,b),"keyword";if(w.match(/^\\[a-zA-Z@]+/))return"tag";if(w.match(/^[a-zA-Z]+/))return"variable-2";if(w.match(/^\\[$&%#{}_]/))return"tag";if(w.match(/^\\[,;!\/]/))return"tag";if(w.match(/^[\^_&]/))return"tag";if(w.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(w.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var f=w.next();return f=="{"||f=="}"||f=="["||f=="]"||f=="("||f==")"?"bracket":f=="%"?(w.skipToEnd(),"comment"):"error"}function k(w,p){var y=w.peek(),f;return y=="{"||y=="["?(f=O(p),f.openBracket(y),w.eat(y),P(p,b),"bracket"):/[ \t\r]/.test(y)?(w.eat(y),null):(P(p,b),L(p),b(w,p))}return{startState:function(){var w=R.inMathMode?function(p,y){return g(p,y)}:b;return{cmdState:[],f:w}},copyState:function(w){return{cmdState:w.cmdState.slice(),f:w.f}},token:function(w,p){return p.f(w,p)},blankLine:function(w){w.f=b,w.cmdState.length=0},lineComment:"%"}}),q.defineMIME("text/x-stex","stex"),q.defineMIME("text/x-latex","stex")})},"+ua5":function(at,Ne,F){},"+vTd":function(at,Ne,F){at.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(at,Ne,F){at.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"}},"19Vz":function(at,Ne,F){(function(q){q(F("VrN/"))})(function(q){q.defineOption("placeholder","",function(I,T,P){var b=P&&P!=q.Init;if(T&&!b)I.on("blur",O),I.on("change",L),I.on("swapDoc",L),q.on(I.getInputField(),"compositionupdate",I.state.placeholderCompose=function(){K(I)}),L(I);else if(!T&&b){I.off("blur",O),I.off("change",L),I.off("swapDoc",L),q.off(I.getInputField(),"compositionupdate",I.state.placeholderCompose),G(I);var g=I.getWrapperElement();g.className=g.className.replace(" CodeMirror-empty","")}T&&!I.hasFocus()&&O(I)});function G(I){I.state.placeholder&&(I.state.placeholder.parentNode.removeChild(I.state.placeholder),I.state.placeholder=null)}function R(I){G(I);var T=I.state.placeholder=document.createElement("pre");T.style.cssText="height: 0; overflow: visible",T.style.direction=I.getOption("direction"),T.className="CodeMirror-placeholder CodeMirror-line-like";var P=I.getOption("placeholder");typeof P=="string"&&(P=document.createTextNode(P)),T.appendChild(P),I.display.lineSpace.insertBefore(T,I.display.lineSpace.firstChild)}function K(I){setTimeout(function(){var T=!1,P=I.getInputField();P.nodeName=="TEXTAREA"?T=!P.value:I.lineCount()==1&&(T=!/[^\u200b]/.test(P.querySelector(".CodeMirror-line").textContent)),T?R(I):G(I)},20)}function O(I){U(I)&&R(I)}function L(I){var T=I.getWrapperElement(),P=U(I);T.className=T.className.replace(" CodeMirror-empty","")+(P?" CodeMirror-empty":""),P?R(I):G(I)}function U(I){return I.lineCount()===1&&I.getLine(0)===""}})},"1ZF9":function(at,Ne,F){at.exports=F.p+"static/Authorize.cc9c212f.png"},"1eCo":function(at,Ne,F){(function(q){q(F("VrN/"))})(function(q){"use strict";var G={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},R={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};q.defineMode("xml",function(K,O){var L=K.indentUnit,U={},I=O.htmlMode?G:R;for(var T in I)U[T]=I[T];for(var T in O)U[T]=O[T];var P,b;function g(i,E){function v(B){return E.tokenize=B,B(i,E)}var _=i.next();if(_=="<")return i.eat("!")?i.eat("[")?i.match("CDATA[")?v(p("atom","]]>")):null:i.match("--")?v(p("comment","-->")):i.match("DOCTYPE",!0,!0)?(i.eatWhile(/[\w\._\-]/),v(y(1))):null:i.eat("?")?(i.eatWhile(/[\w\._\-]/),E.tokenize=p("meta","?>"),"meta"):(P=i.eat("/")?"closeTag":"openTag",E.tokenize=k,"tag bracket");if(_=="&"){var D;return i.eat("#")?i.eat("x")?D=i.eatWhile(/[a-fA-F\d]/)&&i.eat(";"):D=i.eatWhile(/[\d]/)&&i.eat(";"):D=i.eatWhile(/[\w\.\-:]/)&&i.eat(";"),D?"atom":"error"}else return i.eatWhile(/[^&<]/),null}g.isInText=!0;function k(i,E){var v=i.next();if(v==">"||v=="/"&&i.eat(">"))return E.tokenize=g,P=v==">"?"endTag":"selfcloseTag","tag bracket";if(v=="=")return P="equals",null;if(v=="<"){E.tokenize=g,E.state=d,E.tagName=E.tagStart=null;var _=E.tokenize(i,E);return _?_+" tag error":"tag error"}else return/[\'\"]/.test(v)?(E.tokenize=w(v),E.stringStartCol=i.column(),E.tokenize(i,E)):(i.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function w(i){var E=function(v,_){for(;!v.eol();)if(v.next()==i){_.tokenize=k;break}return"string"};return E.isInAttribute=!0,E}function p(i,E){return function(v,_){for(;!v.eol();){if(v.match(E)){_.tokenize=g;break}v.next()}return i}}function y(i){return function(E,v){for(var _;(_=E.next())!=null;){if(_=="<")return v.tokenize=y(i+1),v.tokenize(E,v);if(_==">")if(i==1){v.tokenize=g;break}else return v.tokenize=y(i-1),v.tokenize(E,v)}return"meta"}}function f(i,E,v){this.prev=i.context,this.tagName=E,this.indent=i.indented,this.startOfLine=v,(U.doNotIndent.hasOwnProperty(E)||i.context&&i.context.noIndent)&&(this.noIndent=!0)}function s(i){i.context&&(i.context=i.context.prev)}function c(i,E){for(var v;;){if(!i.context)return;if(v=i.context.tagName,!U.contextGrabbers.hasOwnProperty(v)||!U.contextGrabbers[v].hasOwnProperty(E))return;s(i)}}function d(i,E,v){return i=="openTag"?(v.tagStart=E.column(),S):i=="closeTag"?C:d}function S(i,E,v){return i=="word"?(v.tagName=E.current(),b="tag",x):U.allowMissingTagName&&i=="endTag"?(b="tag bracket",x(i,E,v)):(b="error",S)}function C(i,E,v){if(i=="word"){var _=E.current();return v.context&&v.context.tagName!=_&&U.implicitlyClosed.hasOwnProperty(v.context.tagName)&&s(v),v.context&&v.context.tagName==_||U.matchClosing===!1?(b="tag",m):(b="tag error",A)}else return U.allowMissingTagName&&i=="endTag"?(b="tag bracket",m(i,E,v)):(b="error",A)}function m(i,E,v){return i!="endTag"?(b="error",m):(s(v),d)}function A(i,E,v){return b="error",m(i,E,v)}function x(i,E,v){if(i=="word")return b="attribute",u;if(i=="endTag"||i=="selfcloseTag"){var _=v.tagName,D=v.tagStart;return v.tagName=v.tagStart=null,i=="selfcloseTag"||U.autoSelfClosers.hasOwnProperty(_)?c(v,_):(c(v,_),v.context=new f(v,_,D==v.indented)),d}return b="error",x}function u(i,E,v){return i=="equals"?l:(U.allowMissing||(b="error"),x(i,E,v))}function l(i,E,v){return i=="string"?a:i=="word"&&U.allowUnquoted?(b="string",x):(b="error",x(i,E,v))}function a(i,E,v){return i=="string"?a:x(i,E,v)}return{startState:function(i){var E={tokenize:g,state:d,indented:i||0,tagName:null,tagStart:null,context:null};return i!=null&&(E.baseIndent=i),E},token:function(i,E){if(!E.tagName&&i.sol()&&(E.indented=i.indentation()),i.eatSpace())return null;P=null;var v=E.tokenize(i,E);return(v||P)&&v!="comment"&&(b=null,E.state=E.state(P||v,i,E),b&&(v=b=="error"?v+" error":b)),v},indent:function(i,E,v){var _=i.context;if(i.tokenize.isInAttribute)return i.tagStart==i.indented?i.stringStartCol+1:i.indented+L;if(_&&_.noIndent)return q.Pass;if(i.tokenize!=k&&i.tokenize!=g)return v?v.match(/^(\s*)/)[0].length:0;if(i.tagName)return U.multilineTagIndentPastTag!==!1?i.tagStart+i.tagName.length+2:i.tagStart+L*(U.multilineTagIndentFactor||1);if(U.alignCDATA&&/<!\[CDATA\[/.test(E))return 0;var D=E&&/^<(\/)?([\w_:\.-]*)/.exec(E);if(D&&D[1])for(;_;)if(_.tagName==D[2]){_=_.prev;break}else if(U.implicitlyClosed.hasOwnProperty(_.tagName))_=_.prev;else break;else if(D)for(;_;){var B=U.contextGrabbers[_.tagName];if(B&&B.hasOwnProperty(D[2]))_=_.prev;else break}for(;_&&_.prev&&!_.startOfLine;)_=_.prev;return _?_.indent+L:i.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:U.htmlMode?"html":"xml",helperType:U.htmlMode?"html":"xml",skipAttribute:function(i){i.state==l&&(i.state=x)},xmlCurrentTag:function(i){return i.tagName?{name:i.tagName,close:i.type=="closeTag"}:null},xmlCurrentContext:function(i){for(var E=[],v=i.context;v;v=v.prev)v.tagName&&E.push(v.tagName);return E.reverse()}}}),q.defineMIME("text/xml","xml"),q.defineMIME("application/xml","xml"),q.mimeModes.hasOwnProperty("text/html")||q.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"1vnw":function(at,Ne,F){at.exports={list:"list___1dAFk",btns:"btns___1YCLO",name:"name___2XX_F",folderWrapper:"folderWrapper___3sKHr",folderIcon:"folderIcon___Rov4k"}},"55Ip":function(at,Ne,F){"use strict";F.d(Ne,"a",function(){return c});var q=F("Ty5D"),G=F("dI71"),R=F("cDcd"),K=F.n(R),O=F("YS25"),L=F("17x9"),U=F.n(L),I=F("wx14"),T=F("zLVn"),P=F("9R94"),b=function(l){Object(G.a)(a,l);function a(){for(var E,v=arguments.length,_=new Array(v),D=0;D<v;D++)_[D]=arguments[D];return E=l.call.apply(l,[this].concat(_))||this,E.history=Object(O.a)(E.props),E}var i=a.prototype;return i.render=function(){return K.a.createElement(q.c,{history:this.history,children:this.props.children})},a}(K.a.Component),g=function(l){Object(G.a)(a,l);function a(){for(var E,v=arguments.length,_=new Array(v),D=0;D<v;D++)_[D]=arguments[D];return E=l.call.apply(l,[this].concat(_))||this,E.history=Object(O.b)(E.props),E}var i=a.prototype;return i.render=function(){return K.a.createElement(q.c,{history:this.history,children:this.props.children})},a}(K.a.Component),k=function(a,i){return typeof a=="function"?a(i):a},w=function(a,i){return typeof a=="string"?Object(O.c)(a,null,null,i):a},p=function(a){return a},y=K.a.forwardRef;typeof y=="undefined"&&(y=p);function f(l){return!!(l.metaKey||l.altKey||l.ctrlKey||l.shiftKey)}var s=y(function(l,a){var i=l.innerRef,E=l.navigate,v=l.onClick,_=Object(T.a)(l,["innerRef","navigate","onClick"]),D=_.target,B=Object(I.a)({},_,{onClick:function(W){try{v&&v(W)}catch(h){throw W.preventDefault(),h}!W.defaultPrevented&&W.button===0&&(!D||D==="_self")&&!f(W)&&(W.preventDefault(),E())}});return p!==y?B.ref=a||i:B.ref=i,K.a.createElement("a",B)}),c=y(function(l,a){var i=l.component,E=i===void 0?s:i,v=l.replace,_=l.to,D=l.innerRef,B=Object(T.a)(l,["component","replace","to","innerRef"]);return K.a.createElement(q.e.Consumer,null,function(j){j||Object(P.a)(!1);var W=j.history,h=w(k(_,j.location),j.location),N=h?W.createHref(h):"",H=Object(I.a)({},B,{href:N,navigate:function(){var Y=k(_,j.location),re=v?W.replace:W.push;re(Y)}});return p!==y?H.ref=a||D:H.innerRef=D,K.a.createElement(E,H)})});if(!1)var d,S;var C=function(a){return a},m=K.a.forwardRef;typeof m=="undefined"&&(m=C);function A(){for(var l=arguments.length,a=new Array(l),i=0;i<l;i++)a[i]=arguments[i];return a.filter(function(E){return E}).join(" ")}var x=m(function(l,a){var i=l["aria-current"],E=i===void 0?"page":i,v=l.activeClassName,_=v===void 0?"active":v,D=l.activeStyle,B=l.className,j=l.exact,W=l.isActive,h=l.location,N=l.sensitive,H=l.strict,X=l.style,Y=l.to,re=l.innerRef,he=Object(T.a)(l,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return K.a.createElement(q.e.Consumer,null,function(de){de||Object(P.a)(!1);var ne=h||de.location,ae=w(k(Y,ne),ne),le=ae.pathname,ee=le&&le.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),ie=ee?Object(q.f)(ne.pathname,{path:ee,exact:j,sensitive:N,strict:H}):null,ve=!!(W?W(ie,ne):ie),Pe=ve?A(B,_):B,Ie=ve?Object(I.a)({},X,{},D):X,we=Object(I.a)({"aria-current":ve&&E||null,className:Pe,style:Ie,to:ae},he);return C!==m?we.ref=a||re:we.innerRef=re,K.a.createElement(c,we)})});if(!1)var u},"6+eU":function(at,Ne,F){"use strict";F.d(Ne,"a",function(){return m});var q=F("wx14"),G=F("rePB"),R=F("VTBJ"),K=F("1OyB"),O=F("vuIU"),L=F("Ji7U"),U=F("LK+K"),I=F("cDcd"),T=F.n(I),P=F("TSYQ"),b=F.n(P),g=function(x){var u,l="".concat(x.rootPrefixCls,"-item"),a=b()(l,"".concat(l,"-").concat(x.page),(u={},Object(G.a)(u,"".concat(l,"-active"),x.active),Object(G.a)(u,x.className,!!x.className),Object(G.a)(u,"".concat(l,"-disabled"),!x.page),u)),i=function(){x.onClick(x.page)},E=function(_){x.onKeyPress(_,x.onClick,x.page)};return T.a.createElement("li",{title:x.showTitle?x.page:null,className:a,onClick:i,onKeyPress:E,tabIndex:"0"},x.itemRender(x.page,"page",T.a.createElement("a",{rel:"nofollow"},x.page)))},k=g,w={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},p=function(A){Object(L.a)(u,A);var x=Object(U.a)(u);function u(){var l;Object(K.a)(this,u);for(var a=arguments.length,i=new Array(a),E=0;E<a;E++)i[E]=arguments[E];return l=x.call.apply(x,[this].concat(i)),l.state={goInputText:""},l.buildOptionText=function(v){return"".concat(v," ").concat(l.props.locale.items_per_page)},l.changeSize=function(v){l.props.changeSize(Number(v))},l.handleChange=function(v){l.setState({goInputText:v.target.value})},l.handleBlur=function(v){var _=l.props,D=_.goButton,B=_.quickGo,j=_.rootPrefixCls,W=l.state.goInputText;if(D||W==="")return;if(v.relatedTarget&&(v.relatedTarget.className.indexOf("".concat(j,"-prev"))>=0||v.relatedTarget.className.indexOf("".concat(j,"-next"))>=0))return;l.setState({goInputText:""}),B(l.getValidValue())},l.go=function(v){var _=l.state.goInputText;if(_==="")return;(v.keyCode===w.ENTER||v.type==="click")&&(l.setState({goInputText:""}),l.props.quickGo(l.getValidValue()))},l}return Object(O.a)(u,[{key:"getValidValue",value:function(){var a=this.state,i=a.goInputText,E=a.current;return!i||isNaN(i)?E:Number(i)}},{key:"getPageSizeOptions",value:function(){var a=this.props,i=a.pageSize,E=a.pageSizeOptions;return E.some(function(v){return v.toString()===i.toString()})?E:E.concat([i.toString()]).sort(function(v,_){var D=isNaN(Number(v))?0:Number(v),B=isNaN(Number(_))?0:Number(_);return D-B})}},{key:"render",value:function(){var a=this,i=this.props,E=i.pageSize,v=i.locale,_=i.rootPrefixCls,D=i.changeSize,B=i.quickGo,j=i.goButton,W=i.selectComponentClass,h=i.buildOptionText,N=i.selectPrefixCls,H=i.disabled,X=this.state.goInputText,Y="".concat(_,"-options"),re=W,he=null,de=null,ne=null;if(!D&&!B)return null;var ae=this.getPageSizeOptions();if(D&&re){var le=ae.map(function(ee,ie){return T.a.createElement(re.Option,{key:ie,value:ee.toString()},(h||a.buildOptionText)(ee))});he=T.a.createElement(re,{disabled:H,prefixCls:N,showSearch:!1,className:"".concat(Y,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(E||ae[0]).toString(),onChange:this.changeSize,getPopupContainer:function(ie){return ie.parentNode}},le)}return B&&(j&&(ne=typeof j=="boolean"?T.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:H,className:"".concat(Y,"-quick-jumper-button")},v.jump_to_confirm):T.a.createElement("span",{onClick:this.go,onKeyUp:this.go},j)),de=T.a.createElement("div",{className:"".concat(Y,"-quick-jumper")},v.jump_to,T.a.createElement("input",{disabled:H,type:"text",value:X,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),v.page,ne)),T.a.createElement("li",{className:"".concat(Y)},he,de)}}]),u}(T.a.Component);p.defaultProps={pageSizeOptions:["10","20","50","100"]};var y=p,f=F("N2Kk");function s(){}function c(A){return typeof A=="number"&&isFinite(A)&&Math.floor(A)===A}function d(A,x,u){return u}function S(A,x,u){var l=typeof A=="undefined"?x.pageSize:A;return Math.floor((u.total-1)/l)+1}var C=function(A){Object(L.a)(u,A);var x=Object(U.a)(u);function u(l){var a;Object(K.a)(this,u),a=x.call(this,l),a.getJumpPrevPage=function(){return Math.max(1,a.state.current-(a.props.showLessItems?3:5))},a.getJumpNextPage=function(){return Math.min(S(void 0,a.state,a.props),a.state.current+(a.props.showLessItems?3:5))},a.getItemIcon=function(D,B){var j=a.props.prefixCls,W=D||T.a.createElement("button",{type:"button","aria-label":B,className:"".concat(j,"-item-link")});return typeof D=="function"&&(W=T.a.createElement(D,Object(R.a)({},a.props))),W},a.savePaginationNode=function(D){a.paginationNode=D},a.isValid=function(D){return c(D)&&D!==a.state.current},a.shouldDisplayQuickJumper=function(){var D=a.props,B=D.showQuickJumper,j=D.pageSize,W=D.total;return W<=j?!1:B},a.handleKeyDown=function(D){(D.keyCode===w.ARROW_UP||D.keyCode===w.ARROW_DOWN)&&D.preventDefault()},a.handleKeyUp=function(D){var B=a.getValidValue(D),j=a.state.currentInputValue;B!==j&&a.setState({currentInputValue:B}),D.keyCode===w.ENTER?a.handleChange(B):D.keyCode===w.ARROW_UP?a.handleChange(B-1):D.keyCode===w.ARROW_DOWN&&a.handleChange(B+1)},a.changePageSize=function(D){var B=a.state.current,j=S(D,a.state,a.props);B=B>j?j:B,j===0&&(B=a.state.current),typeof D=="number"&&("pageSize"in a.props||a.setState({pageSize:D}),"current"in a.props||a.setState({current:B,currentInputValue:B})),a.props.onShowSizeChange(B,D),"onChange"in a.props&&a.props.onChange&&a.props.onChange(B,D)},a.handleChange=function(D){var B=a.props.disabled,j=D;if(a.isValid(j)&&!B){var W=S(void 0,a.state,a.props);j>W?j=W:j<1&&(j=1),"current"in a.props||a.setState({current:j,currentInputValue:j});var h=a.state.pageSize;return a.props.onChange(j,h),j}return a.state.current},a.prev=function(){a.hasPrev()&&a.handleChange(a.state.current-1)},a.next=function(){a.hasNext()&&a.handleChange(a.state.current+1)},a.jumpPrev=function(){a.handleChange(a.getJumpPrevPage())},a.jumpNext=function(){a.handleChange(a.getJumpNextPage())},a.hasPrev=function(){return a.state.current>1},a.hasNext=function(){return a.state.current<S(void 0,a.state,a.props)},a.runIfEnter=function(D,B){if(D.key==="Enter"||D.charCode===13){for(var j=arguments.length,W=new Array(j>2?j-2:0),h=2;h<j;h++)W[h-2]=arguments[h];B.apply(void 0,W)}},a.runIfEnterPrev=function(D){a.runIfEnter(D,a.prev)},a.runIfEnterNext=function(D){a.runIfEnter(D,a.next)},a.runIfEnterJumpPrev=function(D){a.runIfEnter(D,a.jumpPrev)},a.runIfEnterJumpNext=function(D){a.runIfEnter(D,a.jumpNext)},a.handleGoTO=function(D){(D.keyCode===w.ENTER||D.type==="click")&&a.handleChange(a.state.currentInputValue)};var i=l.onChange!==s,E="current"in l;E&&!i&&console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");var v=l.defaultCurrent;"current"in l&&(v=l.current);var _=l.defaultPageSize;return"pageSize"in l&&(_=l.pageSize),v=Math.min(v,S(_,void 0,l)),a.state={current:v,currentInputValue:v,pageSize:_},a}return Object(O.a)(u,[{key:"componentDidUpdate",value:function(a,i){var E=this.props.prefixCls;if(i.current!==this.state.current&&this.paginationNode){var v=this.paginationNode.querySelector(".".concat(E,"-item-").concat(i.current));v&&document.activeElement===v&&v.blur()}}},{key:"getValidValue",value:function(a){var i=a.target.value,E=S(void 0,this.state,this.props),v=this.state.currentInputValue,_;return i===""?_=i:isNaN(Number(i))?_=v:i>=E?_=E:_=Number(i),_}},{key:"getShowSizeChanger",value:function(){var a=this.props,i=a.showSizeChanger,E=a.total,v=a.totalBoundaryShowSizeChanger;return typeof i!="undefined"?i:E>v}},{key:"renderPrev",value:function(a){var i=this.props,E=i.prevIcon,v=i.itemRender,_=v(a,"prev",this.getItemIcon(E,"prev page")),D=!this.hasPrev();return Object(I.isValidElement)(_)?Object(I.cloneElement)(_,{disabled:D}):_}},{key:"renderNext",value:function(a){var i=this.props,E=i.nextIcon,v=i.itemRender,_=v(a,"next",this.getItemIcon(E,"next page")),D=!this.hasNext();return Object(I.isValidElement)(_)?Object(I.cloneElement)(_,{disabled:D}):_}},{key:"render",value:function(){var a=this,i=this.props,E=i.prefixCls,v=i.className,_=i.style,D=i.disabled,B=i.hideOnSinglePage,j=i.total,W=i.locale,h=i.showQuickJumper,N=i.showLessItems,H=i.showTitle,X=i.showTotal,Y=i.simple,re=i.itemRender,he=i.showPrevNextJumpers,de=i.jumpPrevIcon,ne=i.jumpNextIcon,ae=i.selectComponentClass,le=i.selectPrefixCls,ee=i.pageSizeOptions,ie=this.state,ve=ie.current,Pe=ie.pageSize,Ie=ie.currentInputValue;if(B===!0&&j<=Pe)return null;var we=S(void 0,this.state,this.props),ke=[],De=null,Le=null,Ve=null,ze=null,Je=null,Ye=h&&h.goButton,Ge=N?1:2,ht=ve-1>0?ve-1:0,ot=ve+1<we?ve+1:we,st=Object.keys(this.props).reduce(function(te,oe){return(oe.substr(0,5)==="data-"||oe.substr(0,5)==="aria-"||oe==="role")&&(te[oe]=a.props[oe]),te},{});if(Y)return Ye&&(typeof Ye=="boolean"?Je=T.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},W.jump_to_confirm):Je=T.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},Ye),Je=T.a.createElement("li",{title:H?"".concat(W.jump_to).concat(ve,"/").concat(we):null,className:"".concat(E,"-simple-pager")},Je)),T.a.createElement("ul",Object(q.a)({className:b()(E,"".concat(E,"-simple"),Object(G.a)({},"".concat(E,"-disabled"),D),v),style:_,ref:this.savePaginationNode},st),T.a.createElement("li",{title:H?W.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:b()("".concat(E,"-prev"),Object(G.a)({},"".concat(E,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(ht)),T.a.createElement("li",{title:H?"".concat(ve,"/").concat(we):null,className:"".concat(E,"-simple-pager")},T.a.createElement("input",{type:"text",value:Ie,disabled:D,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),T.a.createElement("span",{className:"".concat(E,"-slash")},"/"),we),T.a.createElement("li",{title:H?W.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:b()("".concat(E,"-next"),Object(G.a)({},"".concat(E,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(ot)),Je);if(we<=3+Ge*2){var qe={locale:W,rootPrefixCls:E,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:H,itemRender:re};we||ke.push(T.a.createElement(k,Object(q.a)({},qe,{key:"noPager",page:we,className:"".concat(E,"-disabled")})));for(var vt=1;vt<=we;vt+=1){var pt=ve===vt;ke.push(T.a.createElement(k,Object(q.a)({},qe,{key:vt,page:vt,active:pt})))}}else{var gt=N?W.prev_3:W.prev_5,Be=N?W.next_3:W.next_5;he&&(De=T.a.createElement("li",{title:H?gt:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:b()("".concat(E,"-jump-prev"),Object(G.a)({},"".concat(E,"-jump-prev-custom-icon"),!!de))},re(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(de,"prev page"))),Le=T.a.createElement("li",{title:H?Be:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:b()("".concat(E,"-jump-next"),Object(G.a)({},"".concat(E,"-jump-next-custom-icon"),!!ne))},re(this.getJumpNextPage(),"jump-next",this.getItemIcon(ne,"next page")))),ze=T.a.createElement(k,{locale:W,last:!0,rootPrefixCls:E,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:we,page:we,active:!1,showTitle:H,itemRender:re}),Ve=T.a.createElement(k,{locale:W,rootPrefixCls:E,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:H,itemRender:re});var Ct=Math.max(1,ve-Ge),yt=Math.min(ve+Ge,we);ve-1<=Ge&&(yt=1+Ge*2),we-ve<=Ge&&(Ct=we-Ge*2);for(var He=Ct;He<=yt;He+=1){var rt=ve===He;ke.push(T.a.createElement(k,{locale:W,rootPrefixCls:E,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:He,page:He,active:rt,showTitle:H,itemRender:re}))}ve-1>=Ge*2&&ve!==1+2&&(ke[0]=Object(I.cloneElement)(ke[0],{className:"".concat(E,"-item-after-jump-prev")}),ke.unshift(De)),we-ve>=Ge*2&&ve!==we-2&&(ke[ke.length-1]=Object(I.cloneElement)(ke[ke.length-1],{className:"".concat(E,"-item-before-jump-next")}),ke.push(Le)),Ct!==1&&ke.unshift(Ve),yt!==we&&ke.push(ze)}var me=null;X&&(me=T.a.createElement("li",{className:"".concat(E,"-total-text")},X(j,[j===0?0:(ve-1)*Pe+1,ve*Pe>j?j:ve*Pe])));var se=!this.hasPrev()||!we,be=!this.hasNext()||!we;return T.a.createElement("ul",Object(q.a)({className:b()(E,v,Object(G.a)({},"".concat(E,"-disabled"),D)),style:_,unselectable:"unselectable",ref:this.savePaginationNode},st),me,T.a.createElement("li",{title:H?W.prev_page:null,onClick:this.prev,tabIndex:se?null:0,onKeyPress:this.runIfEnterPrev,className:b()("".concat(E,"-prev"),Object(G.a)({},"".concat(E,"-disabled"),se)),"aria-disabled":se},this.renderPrev(ht)),ke,T.a.createElement("li",{title:H?W.next_page:null,onClick:this.next,tabIndex:be?null:0,onKeyPress:this.runIfEnterNext,className:b()("".concat(E,"-next"),Object(G.a)({},"".concat(E,"-disabled"),be)),"aria-disabled":be},this.renderNext(ot)),T.a.createElement(y,{disabled:D,locale:W,rootPrefixCls:E,selectComponentClass:ae,selectPrefixCls:le,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:ve,pageSize:Pe,pageSizeOptions:ee,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:Ye}))}}],[{key:"getDerivedStateFromProps",value:function(a,i){var E={};if("current"in a&&(E.current=a.current,a.current!==i.current&&(E.currentInputValue=E.current)),"pageSize"in a&&a.pageSize!==i.pageSize){var v=i.current,_=S(a.pageSize,i,a);v=v>_?_:v,"current"in a||(E.current=v,E.currentInputValue=v),E.pageSize=a.pageSize}return E}}]),u}(T.a.Component);C.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:s,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:s,locale:f.a,style:{},itemRender:d,totalBoundaryShowSizeChanger:50};var m=C},"7Cbv":function(at,Ne,F){"use strict";var q=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),G=new Uint8Array(16);function R(){if(!q)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return q(G)}var K=/^(?:[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 O(k){return typeof k=="string"&&K.test(k)}for(var L=O,U=[],I=0;I<256;++I)U.push((I+256).toString(16).substr(1));function T(k){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,p=(U[k[w+0]]+U[k[w+1]]+U[k[w+2]]+U[k[w+3]]+"-"+U[k[w+4]]+U[k[w+5]]+"-"+U[k[w+6]]+U[k[w+7]]+"-"+U[k[w+8]]+U[k[w+9]]+"-"+U[k[w+10]]+U[k[w+11]]+U[k[w+12]]+U[k[w+13]]+U[k[w+14]]+U[k[w+15]]).toLowerCase();if(!L(p))throw TypeError("Stringified UUID is invalid");return p}var P=T;function b(k,w,p){k=k||{};var y=k.random||(k.rng||R)();if(y[6]=y[6]&15|64,y[8]=y[8]&63|128,w){p=p||0;for(var f=0;f<16;++f)w[p+f]=y[f];return w}return P(y)}var g=Ne.a=b},"7ahc":function(at,Ne,F){"use strict";F.d(Ne,"a",function(){return S});var q=F("k1fw"),G=F("0Owb"),R=F("+L6B"),K=F("2/Rp"),O=F("y8nQ"),L=F("Vl3Y"),U=F("tJVT"),I=F("OaEy"),T=F("2fM7"),P=F("cDcd"),b=F.n(P),g=F("VrN/"),k=F.n(g),w=F("p77/"),p=F.n(w),y=F("c5Ni"),f=F.n(y),s=T.a.Option,c={labelCol:{span:4},wrapperCol:{span:20}},d={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"]};Ne.b=function(C){var m=C.callback,A=C.onCancel,x=Object(P.useState)("python"),u=Object(U.a)(x,2),l=u[0],a=u[1];function i(v){a(d[v][1])}function E(v){m(v)}return b.a.createElement(L.a,Object(G.a)({},c,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:E}),b.a.createElement(L.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},b.a.createElement(T.a,{onChange:i},Object.keys(d).map(function(v){return b.a.createElement(s,{key:v,value:v},d[v][0])}))),b.a.createElement(L.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},b.a.createElement(S,{mode:l})),b.a.createElement("div",{className:"flex-container flex-end"},b.a.createElement(K.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),b.a.createElement(K.a,{type:"ghost",onClick:A},"\u53D6\u6D88")))};function S(C){var m=C.value,A=C.onChange,x=C.mode,u=C.options,l=u===void 0?{}:u,a=Object(P.useRef)(),i=Object(P.useState)(),E=Object(U.a)(i,2),v=E[0],_=E[1];return Object(P.useEffect)(function(){if(v){function D(B){var j=B.getValue();A&&A(j)}return v.on("change",D),function(){v.off("change",D)}}},[v,A]),Object(P.useEffect)(function(){v&&v.setOption("mode",x)},[v,x]),Object(P.useEffect)(function(){v&&((m!==v.getValue()||m==="")&&setTimeout(function(){v.setValue(m||" ")},300))},[v,m]),Object(P.useEffect)(function(){if(a.current&&!v){var D=k.a.fromTextArea(a.current,Object(q.a)({mode:x,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},l));_(D)}},[a.current,v]),b.a.createElement("div",{className:"my-codemirror-container"},b.a.createElement("textarea",{ref:a}))}},"815F":function(at,Ne,F){"use strict";F.d(Ne,"e",function(){return U}),F.d(Ne,"c",function(){return T}),F.d(Ne,"d",function(){return P}),F.d(Ne,"a",function(){return g}),F.d(Ne,"f",function(){return k}),F.d(Ne,"b",function(){return w});var q=F("KQm4"),G=F("VTBJ"),R=F("Ff2n"),K=F("Zm9Q"),O=F("Kwbf"),L=F("OZM5");function U(p,y){return p!=null?p:y}function I(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],y=new Map;function f(s){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(s||[]).forEach(function(d){var S=d.key,C=d.children;Object(O.a)(S!=null,"Tree node must have a certain key: [".concat(c).concat(S,"]"));var m=String(S);Object(O.a)(!y.has(m)||S===null||S===void 0,"Same 'key' exist in the Tree: ".concat(m)),y.set(m,!0),f(C,"".concat(c).concat(m," > "))})}f(p)}function T(p){function y(f){var s=Object(K.a)(f);return s.map(function(c){if(!Object(L.i)(c))return Object(O.a)(!c,"Tree/TreeNode can only accept TreeNode as children."),null;var d=c.key,S=c.props,C=S.children,m=Object(R.a)(S,["children"]),A=Object(G.a)({key:d},m),x=y(C);return x.length&&(A.children=x),A}).filter(function(c){return c})}return y(p)}function P(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],f=new Set(y===!0?[]:y),s=[];function c(d){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return d.map(function(C,m){var A=Object(L.h)(S?S.pos:"0",m),x=U(C.key,A),u=Object(G.a)(Object(G.a)({},C),{},{parent:S,pos:A,children:null,data:C,isStart:[].concat(Object(q.a)(S?S.isStart:[]),[m===0]),isEnd:[].concat(Object(q.a)(S?S.isEnd:[]),[m===d.length-1])});return s.push(u),y===!0||f.has(x)?u.children=c(C.children||[],u):u.children=[],u})}return c(p),s}function b(p,y,f){var s;f?typeof f=="string"?s=function(S){return S[f]}:typeof f=="function"&&(s=function(S){return f(S)}):s=function(S,C){return U(S.key,C)};function c(d,S,C){var m=d?d.children:p,A=d?Object(L.h)(C.pos,S):"0";if(d){var x=s(d,A),u={node:d,index:S,pos:A,key:x,parentPos:C.node?C.pos:null,level:C.level+1};y(u)}m&&m.forEach(function(l,a){c(l,a,{node:d,pos:A,level:C?C.level+1:-1})})}c(null)}function g(p){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},f=y.initWrapper,s=y.processEntity,c=y.onProcessFinished,d=arguments.length>2?arguments[2]:void 0,S={},C={},m={posEntities:S,keyEntities:C};return f&&(m=f(m)||m),b(p,function(A){var x=A.node,u=A.index,l=A.pos,a=A.key,i=A.parentPos,E=A.level,v={node:x,index:u,key:a,pos:l,level:E},_=U(a,l);S[l]=v,C[_]=v,v.parent=S[i],v.parent&&(v.parent.children=v.parent.children||[],v.parent.children.push(v)),s&&s(v,m)},d),c&&c(m),m}function k(p,y){var f=y.expandedKeys,s=y.selectedKeys,c=y.loadedKeys,d=y.loadingKeys,S=y.checkedKeys,C=y.halfCheckedKeys,m=y.dragOverNodeKey,A=y.dropPosition,x=y.keyEntities,u=x[p],l={eventKey:p,expanded:f.indexOf(p)!==-1,selected:s.indexOf(p)!==-1,loaded:c.indexOf(p)!==-1,loading:d.indexOf(p)!==-1,checked:S.indexOf(p)!==-1,halfChecked:C.indexOf(p)!==-1,pos:String(u?u.pos:""),dragOver:m===p&&A===0,dragOverGapTop:m===p&&A===-1,dragOverGapBottom:m===p&&A===1};return l}function w(p){var y=p.data,f=p.expanded,s=p.selected,c=p.checked,d=p.loaded,S=p.loading,C=p.halfChecked,m=p.dragOver,A=p.dragOverGapTop,x=p.dragOverGapBottom,u=p.pos,l=p.active,a=Object(G.a)(Object(G.a)({},y),{},{expanded:f,selected:s,checked:c,loaded:d,loading:S,halfChecked:C,dragOver:m,dragOverGapTop:A,dragOverGapBottom:x,pos:u,active:l});return"props"in a||Object.defineProperty(a,"props",{get:function(){return Object(O.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),p}}),a}},"8EBN":function(at,Ne,F){(function(q){q(F("VrN/"))})(function(q){"use strict";q.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 G=0;G<q.modeInfo.length;G++){var R=q.modeInfo[G];R.mimes&&(R.mime=R.mimes[0])}q.findModeByMIME=function(K){K=K.toLowerCase();for(var O=0;O<q.modeInfo.length;O++){var L=q.modeInfo[O];if(L.mime==K)return L;if(L.mimes){for(var U=0;U<L.mimes.length;U++)if(L.mimes[U]==K)return L}}if(/\+xml$/.test(K))return q.findModeByMIME("application/xml");if(/\+json$/.test(K))return q.findModeByMIME("application/json")},q.findModeByExtension=function(K){K=K.toLowerCase();for(var O=0;O<q.modeInfo.length;O++){var L=q.modeInfo[O];if(L.ext){for(var U=0;U<L.ext.length;U++)if(L.ext[U]==K)return L}}},q.findModeByFileName=function(K){for(var O=0;O<q.modeInfo.length;O++){var L=q.modeInfo[O];if(L.file&&L.file.test(K))return L}var U=K.lastIndexOf("."),I=U>-1&&K.substring(U+1,K.length);if(I)return q.findModeByExtension(I)},q.findModeByName=function(K){K=K.toLowerCase();for(var O=0;O<q.modeInfo.length;O++){var L=q.modeInfo[O];if(L.name.toLowerCase()==K)return L;if(L.alias){for(var U=0;U<L.alias.length;U++)if(L.alias[U].toLowerCase()==K)return L}}}})},"8hTe":function(at,Ne,F){at.exports={button:"button___1wy9m"}},"9Bee":function(at,Ne,F){"use strict";var q=F("DYRE"),G=F("zeV3"),R=F("+L6B"),K=F("2/Rp"),O=F("k1fw"),L=F("tJVT"),U=F("cDcd"),I=F.n(U),T=F("vg9a"),P=F("DlQD"),b=F.n(P),g=F("rUJ1");function k(ne,ae){var le=ne.match(/^(\s+)(?:```)/);if(le===null)return ae;var ee=le[1];return ae.split(`
`).map(function(ie){var ve=ie.match(/^\s+/);if(ve===null)return ie;var Pe=Object(L.a)(ve,1),Ie=Pe[0];return Ie.length>=ee.length?ie.slice(ee.length):ie}).join(`
`)}var w=[],p=["<ul>"],y=new b.a.Renderer,f=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function s(){w.length=0,p=["<ul>"]}var c={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function d(ne,ae,le,ee){if(ae>=ne.length||ne[ae].level<=le)return ae;var ie=ne[ae];ee.push("<li><a href='#"+ie.anchor+"'>"+ie.text+"</a>"),ae++;var ve=[];return ae=d(ne,ae,ie.level,ve),ve.length>0&&(ee.push("<ul>"),ve.forEach(function(Pe){ee.push(Pe)}),ee.push("</ul>")),ee.push("</li>"),ae=d(ne,ae,le,ee),ae}function S(){return d(w,0,0,p),p.push("</ul>"),p.join("")}var C={heading:function(ae){var le=f.exec(ae);if(le)return{type:"heading",raw:le[0],depth:le[1].length,text:le[2]}},fences:function(ae){var le=this.rules.block.fences.exec(ae);if(le){var ee=le[0],ie=k(ee,le[3]||""),ve=le[2]?le[2].trim():le[2];if(["latex","katex","math"].indexOf(ve)>=0){var Pe=x(),Ie=ie;ie=Pe,u[Pe]={type:"block",expression:Ie}}return{type:"code",raw:ee,lang:ve,text:ie}}}},m=/(?:\${2})([^\n`]+?)(?:\${2})/gi,A=0,x=function(){return"__special_katext_id_".concat(A++,"__")},u={};function l(){return u}function a(){A=0,u={}}function i(ne){return ne=ne.replace(m,function(ae,le){var ee=x();return u[ee]={type:"inline",expression:le},ee}),ne}var E=y.listitem;y.listitem=function(ne){return E(i(ne))};var v=y.paragraph;y.paragraph=function(ne){return v(i(ne))};var _=y.tablecell;y.tablecell=function(ne,ae){return _(i(ne),ae)},y.code=function(ne,ae,le){var ee=(ae||"").match(/\S*/)[0];return ee?["latex","katex","math"].indexOf(ee)>=0?"<p class='editormd-tex'>".concat(ne,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(ae,'">').concat(le?ne:Object(g.escape)(ne,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(le?ne:Object(g.escape)(ne,!0))+"</code></pre>"},y.heading=function(ne,ae,le){var ee=this.options.headerPrefix+le.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return w.push({anchor:ee,level:ae,text:ne}),"<h"+ae+' id="'+ee+'">'+ne+"</h"+ae+">"},b.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),b.a.use({tokenizer:C,renderer:y});var D=b.a,B=F("SJMd"),j=F("ulZh"),W=F.n(j),h=F("m3rI"),N=F("Oy/b"),H=F("p5ED"),X=F("8hTe"),Y=F.n(X),re=/<pre[^>]*>/g;function he(ne){var ae=document.createElement("div");return ae.innerHTML=ne,ae.childNodes.length===0?"":ae.childNodes[0].nodeValue}var de=Ne.a=function(ne){var ae=ne.value,le=ae===void 0?"":ae,ee=ne.edit,ie=ee===void 0?!1:ee,ve=ne.className,Pe=ne.showTextOnly,Ie=ne.showLines,we=ne.replaces,ke=ne.zoomImg,De=ne.hasMask,Le=ne.style,Ve=Le===void 0?{}:Le,ze=ne.stylesPrev,Je=ze===void 0?{}:ze,Ye=String(le),Ge=Object(U.useRef)(),ht=Object(U.useRef)(),ot=Object(U.useState)(""),st=Object(L.a)(ot,2),qe=st[0],vt=st[1],pt=Object(U.useState)("office"),gt=Object(L.a)(pt,2),Be=gt[0],Ct=gt[1],yt=Object(U.useMemo)(function(){try{var be=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,te=/\"\/api\/attachments\/|\"\/attachments\/download\//g,oe=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Ye=Ye.replace(be,"("+h.a.API_SERVER+"/api/attachments/").replace(te,'"'+h.a.API_SERVER+"/api/attachments/").replace(oe,'"'+h.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(Xe){}var ce=D(Ye),_e=l();if(Ye.match(/\[TOC\]/)&&(ce=ce.replace("<p>[TOC]</p>",S()),s()),ce=ce.replace(/(__special_katext_id_\d+__)/g,function(Xe,Ze){var _t=_e[Ze],It=_t.type,$e=_t.expression;return Object(N.renderToString)(he($e)||"",{displayMode:It==="block",throwOnError:!1,output:"html"})}),ce=ce.replace(/▁/g,"\u2581\u2581\u2581"),a(),Pe){var je=document.createElement("div");return je.innerHTML=ce,je.innerText}return setTimeout(function(){return me()},500),ce},[Ye]),He=Object(U.useRef)();c.WebkitLineClamp=Ie,Ie&&(Ve=Object(O.a)(Object(O.a)({},Ve),c));function rt(be){var te=be.target;if(te.tagName.toUpperCase()==="IMG"){if(ke){var oe=te.getAttribute("src");vt(oe),Ct("image")}}else if(te.tagName.toUpperCase()==="A"){var ce=te.getAttribute("href");if(ce.indexOf("office")>-1)be.preventDefault(),vt(ce),Ct("office");else if(ce.indexOf("application/pdf")>-1)be.preventDefault(),vt(ce),Ct("pdf");else if(ce.indexOf("text/html")>-1)be.preventDefault(),vt(ce),Ct("html");else if(ce.startsWith("#")){be.preventDefault();var _e=document.getElementById(ce.replace("#",""));_e&&_e.scrollIntoView(!0)}}}var me=function(){var te,oe=(te=He.current)===null||te===void 0?void 0:te.querySelectorAll("video");oe==null||oe.forEach(function(ce){if(ce.oncontextmenu=function(){return!1},ce.src.indexOf(".m3u8")>-1&&!ce.canPlayType("application/vnd.apple.mpegurl")){if(W.a.isSupported()){var _e=new W.a;_e.loadSource(ce.src),_e.attachMedia(ce)}}})};Object(U.useEffect)(function(){if(He.current&&yt&&(yt.match(re)&&window.PR.prettyPrint()),He.current)return He.current.addEventListener("click",rt),function(){He.current.removeEventListener("click",rt),a(),s()}},[yt,He.current,rt]);var se=function(te){if(!ie)return;te.target.nodeName==="IMG"?(Ge.current.style.display="flex",Ge.current.style.width=te.target.clientWidth+"px",Ge.current.style.height=te.target.clientHeight+"px",Ge.current.style.top=te.target.offsetTop+"px",Ge.current.style.left=te.target.offsetLeft+"px",ht.current.src=te.target.getAttribute("src")):Ge.current.style.display="none"};return I.a.createElement("div",{style:{position:"relative"}},I.a.createElement("div",{ref:He,style:Object(O.a)({},Ve),className:"".concat(ve||""," markdown-body ").concat(Y.a.mdBody),onMouseOver:se,dangerouslySetInnerHTML:{__html:yt}}),I.a.createElement("div",{ref:Ge,className:Y.a.button},I.a.createElement(G.a,null,I.a.createElement(K.a,{onClick:function(){return openCrop()}},"\u88C1\u526A"),I.a.createElement(K.a,{onClick:function(){return openEditor()}},"\u7F16\u8F91"))),I.a.createElement("img",{ref:ht,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1,top:"-10000px"}}),I.a.createElement(H.a,{close:!0,data:qe,type:qe!=null&&qe.length?Be:"",style:Object(O.a)({},Je),onClose:function(){return vt("")}}))}},"9VGf":function(at,Ne,F){"use strict";F.d(Ne,"a",function(){return R});var q=F("cDcd"),G=F.n(q);function R(K,O){var L=Object(q.useRef)();Object(q.useEffect)(function(){L.current=K}),Object(q.useEffect)(function(){function U(){L.current()}if(O!==null){var I=setInterval(U,O);return function(){return clearInterval(I)}}},[O])}},"A60/":function(at,Ne,F){at.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(at,Ne,F){"use strict";F.d(Ne,"a",function(){return L});var q=F("MNnm"),G="rc-util-key";function R(U){if(U.attachTo)return U.attachTo;var I=document.querySelector("head");return I||document.body}function K(U){var I,T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(q.a)())return null;var P=document.createElement("style");if((I=T.csp)===null||I===void 0?void 0:I.nonce){var b;P.nonce=(b=T.csp)===null||b===void 0?void 0:b.nonce}P.innerHTML=U;var g=R(T),k=g.firstChild;return T.prepend&&g.prepend?g.prepend(P):T.prepend&&k?g.insertBefore(P,k):g.appendChild(P),P}var O=new Map;function L(U,I){var T=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},P=R(T);if(!O.has(P)){var b=K("",T),g=b.parentNode;O.set(P,g),g.removeChild(b)}var k=Array.from(O.get(P).children).find(function(s){return s.tagName==="STYLE"&&s[G]===I});if(k){var w,p;if(((w=T.csp)===null||w===void 0?void 0:w.nonce)&&k.nonce!==((p=T.csp)===null||p===void 0?void 0:p.nonce)){var y;k.nonce=(y=T.csp)===null||y===void 0?void 0:y.nonce}return k.innerHTML!==U&&(k.innerHTML=U),k}var f=K(U,T);return f[G]=I,f}},Bd2K:function(at,Ne,F){(function(q){q(F("VrN/"),F("osHv"))})(function(q){q.defineOption("autoCloseTags",!1,function(T,P,b){if(b!=q.Init&&b&&T.removeKeyMap("autoCloseTags"),!P)return;var g={name:"autoCloseTags"};(typeof P!="object"||P.whenClosing!==!1)&&(g["'/'"]=function(k){return L(k)}),(typeof P!="object"||P.whenOpening!==!1)&&(g["'>'"]=function(k){return K(k)}),T.addKeyMap(g)});var G=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],R=["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 K(T){if(T.getOption("disableInput"))return q.Pass;for(var P=T.listSelections(),b=[],g=T.getOption("autoCloseTags"),k=0;k<P.length;k++){if(!P[k].empty())return q.Pass;var w=P[k].head,p=T.getTokenAt(w),y=q.innerMode(T.getMode(),p.state),f=y.state,s=y.mode.xmlCurrentTag&&y.mode.xmlCurrentTag(f),c=s&&s.name;if(!c)return q.Pass;var d=y.mode.configuration=="html",S=typeof g=="object"&&g.dontCloseTags||d&&G,C=typeof g=="object"&&g.indentTags||d&&R;p.end>w.ch&&(c=c.slice(0,c.length-p.end+w.ch));var m=c.toLowerCase();if(!c||p.type=="string"&&(p.end!=w.ch||!/[\"\']/.test(p.string.charAt(p.string.length-1))||p.string.length==1)||p.type=="tag"&&s.close||p.string.indexOf("/")==w.ch-p.start-1||S&&U(S,m)>-1||I(T,y.mode.xmlCurrentContext&&y.mode.xmlCurrentContext(f)||[],c,w,!0))return q.Pass;var A=typeof g=="object"&&g.emptyTags;if(A&&U(A,c)>-1){b[k]={text:"/>",newPos:q.Pos(w.line,w.ch+2)};continue}var x=C&&U(C,m)>-1;b[k]={indent:x,text:">"+(x?`
`:"")+"</"+c+">",newPos:x?q.Pos(w.line+1,0):q.Pos(w.line,w.ch+1)}}for(var u=typeof g=="object"&&g.dontIndentOnAutoClose,k=P.length-1;k>=0;k--){var l=b[k];T.replaceRange(l.text,P[k].head,P[k].anchor,"+insert");var a=T.listSelections().slice(0);a[k]={head:l.newPos,anchor:l.newPos},T.setSelections(a),!u&&l.indent&&(T.indentLine(l.newPos.line,null,!0),T.indentLine(l.newPos.line+1,null,!0))}}function O(T,P){for(var b=T.listSelections(),g=[],k=P?"/":"</",w=T.getOption("autoCloseTags"),p=typeof w=="object"&&w.dontIndentOnSlash,y=0;y<b.length;y++){if(!b[y].empty())return q.Pass;var f=b[y].head,s=T.getTokenAt(f),c=q.innerMode(T.getMode(),s.state),d=c.state;if(P&&(s.type=="string"||s.string.charAt(0)!="<"||s.start!=f.ch-1))return q.Pass;var S,C=c.mode.name!="xml"&&T.getMode().name=="htmlmixed";if(C&&c.mode.name=="javascript")S=k+"script";else if(C&&c.mode.name=="css")S=k+"style";else{var m=c.mode.xmlCurrentContext&&c.mode.xmlCurrentContext(d);if(!m||m.length&&I(T,m,m[m.length-1],f))return q.Pass;S=k+m[m.length-1]}T.getLine(f.line).charAt(s.end)!=">"&&(S+=">"),g[y]=S}if(T.replaceSelections(g),b=T.listSelections(),!p)for(var y=0;y<b.length;y++)(y==b.length-1||b[y].head.line<b[y+1].head.line)&&T.indentLine(b[y].head.line)}function L(T){return T.getOption("disableInput")?q.Pass:O(T,!0)}q.commands.closeTag=function(T){return O(T)};function U(T,P){if(T.indexOf)return T.indexOf(P);for(var b=0,g=T.length;b<g;++b)if(T[b]==P)return b;return-1}function I(T,P,b,g,k){if(!q.scanForClosingTag)return!1;var w=Math.min(T.lastLine()+1,g.line+500),p=q.scanForClosingTag(T,g,null,w);if(!p||p.tag!=b)return!1;for(var y=k?1:0,f=P.length-1;f>=0&&P[f]==b;f--)++y;g=p.to;for(var f=1;f<y;f++){var s=q.scanForClosingTag(T,g,null,w);if(!s||s.tag!=b)return!1;g=s.to}return!0}})},BdwD:function(at,Ne,F){"use strict";var q=F("+L6B"),G=F("2/Rp"),R=F("0Owb"),K=F("k1fw"),O=F("cDcd"),L=F.n(O),U=F("FOrL"),I=F.n(U),T=function(b){var g=b.buttonProps,k=g===void 0?{}:g,w=b.styles,p=w===void 0?{}:w,y=b.customText,f=b.ButtonText,s=b.ButtonClick,c=b.Buttonclass,d=b.ButtonTwo;return L.a.createElement("section",{className:"tc animated fadeIn",style:Object(K.a)(Object(K.a)({},{color:"#999",margin:"200px auto"}),p)},L.a.createElement("img",{src:I.a}),L.a.createElement("p",{className:"mt20 font14"},y||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),f&&L.a.createElement(G.a,Object(R.a)({className:c,onClick:s},k),f),d&&d)};Ne.a=T},BjJ7:function(at,Ne,F){"use strict";F.d(Ne,"d",function(){return G}),F.d(Ne,"c",function(){return R}),F.d(Ne,"e",function(){return K}),F.d(Ne,"b",function(){return O}),F.d(Ne,"a",function(){return U});var q=F("m3rI");function G(I){var T=!0;if(I.length>0){for(var P=0;P<I.length;P++)if(I[P].compile_success==0||!I[P].compile_success){T=!1;break}}else T=!1;return T}function R(I){for(var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",P=[],b=0;b<I.length;b++){var g=I[b],k=T?"".concat(T,"/").concat(g.name):"".concat(g.name);P.push({title:g.name,isLeaf:!(g.type==="tree"),key:k})}return P}function K(I,T,P){for(var b=0;b<I.length;b++){var g=I[b];if(g.key===T){g.children=P;break}g.children&&K(g.children,T,P)}return I}function O(I,T,P){var b;return function(){var g=this,k=arguments,w=function(){b=null,P||I.apply(g,k)},p=P&&!b;clearTimeout(b),b=setTimeout(w,T),p&&I.apply(g,k)}}var L=!0,U=q.a.API_SERVER},"C+DQ":function(at,Ne,F){},D1Df:function(at,Ne,F){"use strict";function q(_){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?q=function(B){return typeof B}:q=function(B){return B&&typeof Symbol=="function"&&B.constructor===Symbol&&B!==Symbol.prototype?"symbol":typeof B},q(_)}function G(){return G=Object.assign||function(_){for(var D=1;D<arguments.length;D++){var B=arguments[D];for(var j in B)Object.prototype.hasOwnProperty.call(B,j)&&(_[j]=B[j])}return _},G.apply(this,arguments)}function R(_,D){var B=Object.keys(_);if(Object.getOwnPropertySymbols){var j=Object.getOwnPropertySymbols(_);D&&(j=j.filter(function(W){return Object.getOwnPropertyDescriptor(_,W).enumerable})),B.push.apply(B,j)}return B}function K(_){for(var D=1;D<arguments.length;D++){var B=arguments[D]!=null?arguments[D]:{};D%2?R(B,!0).forEach(function(j){p(_,j,B[j])}):Object.getOwnPropertyDescriptors?Object.defineProperties(_,Object.getOwnPropertyDescriptors(B)):R(B).forEach(function(j){Object.defineProperty(_,j,Object.getOwnPropertyDescriptor(B,j))})}return _}function O(_,D){if(_==null)return{};var B=L(_,D),j,W;if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(_);for(W=0;W<h.length;W++){if(j=h[W],D.indexOf(j)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(_,j))continue;B[j]=_[j]}}return B}function L(_,D){if(_==null)return{};var B={},j=Object.keys(_),W,h;for(h=0;h<j.length;h++){if(W=j[h],D.indexOf(W)>=0)continue;B[W]=_[W]}return B}function U(_,D){if(!(_ instanceof D))throw new TypeError("Cannot call a class as a function")}function I(_,D){for(var B=0;B<D.length;B++){var j=D[B];j.enumerable=j.enumerable||!1,j.configurable=!0,"value"in j&&(j.writable=!0),Object.defineProperty(_,j.key,j)}}function T(_,D,B){return D&&I(_.prototype,D),B&&I(_,B),_}function P(_,D){return D&&(q(D)==="object"||typeof D=="function")?D:g(_)}function b(_){return b=Object.setPrototypeOf?Object.getPrototypeOf:function(B){return B.__proto__||Object.getPrototypeOf(B)},b(_)}function g(_){if(_===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _}function k(_,D){if(typeof D!="function"&&D!==null)throw new TypeError("Super expression must either be null or a function");_.prototype=Object.create(D&&D.prototype,{constructor:{value:_,writable:!0,configurable:!0}}),D&&w(_,D)}function w(_,D){return w=Object.setPrototypeOf||function(j,W){return j.__proto__=W,j},w(_,D)}function p(_,D,B){return D in _?Object.defineProperty(_,D,{value:B,enumerable:!0,configurable:!0,writable:!0}):_[D]=B,_}var y=F("cDcd"),f=F("17x9"),s=F("H38U"),c=F("aRTE");function d(_){for(var D="",B=0;B<_.length;B++){var j=_.charCodeAt(B);j<128?D+=String.fromCharCode(j):j<2048?(D+=String.fromCharCode(192|j>>6),D+=String.fromCharCode(128|j&63)):j<55296||j>=57344?(D+=String.fromCharCode(224|j>>12),D+=String.fromCharCode(128|j>>6&63),D+=String.fromCharCode(128|j&63)):(B++,j=65536+((j&1023)<<10|_.charCodeAt(B)&1023),D+=String.fromCharCode(240|j>>18),D+=String.fromCharCode(128|j>>12&63),D+=String.fromCharCode(128|j>>6&63),D+=String.fromCharCode(128|j&63))}return D}var S={size:128,level:"L",bgColor:"#FFFFFF",fgColor:"#000000",includeMargin:!1},C={},m=4,A=.1;function x(_){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,B=[];return _.forEach(function(j,W){var h=null;j.forEach(function(N,H){if(!N&&h!==null){B.push("M".concat(h+D," ").concat(W+D,"h").concat(H-h,"v1H").concat(h+D,"z")),h=null;return}if(H===j.length-1){if(!N)return;h===null?B.push("M".concat(H+D,",").concat(W+D," h1v1H").concat(H+D,"z")):B.push("M".concat(h+D,",").concat(W+D," h").concat(H+1-h,"v1H").concat(h+D,"z"));return}N&&h===null&&(h=H)})}),B.join("")}function u(_,D){return _.slice().map(function(B,j){return j<D.y||j>=D.y+D.h?B:B.map(function(W,h){return h<D.x||h>=D.x+D.w?W:!1})})}function l(_,D){var B=_.imageSettings,j=_.size,W=_.includeMargin;if(B==null)return null;var h=W?m:0,N=D.length+h*2,H=Math.floor(j*A),X=N/j,Y=(B.width||H)*X,re=(B.height||H)*X,he=B.x==null?D.length/2-Y/2:B.x*X,de=B.y==null?D.length/2-re/2:B.y*X,ne=null;if(B.excavate){var ae=Math.floor(he),le=Math.floor(de),ee=Math.ceil(Y+he-ae),ie=Math.ceil(re+de-le);ne={x:ae,y:le,w:ee,h:ie}}return{x:he,y:de,h:re,w:Y,excavation:ne}}var a=function(){try{new Path2D().addPath(new Path2D)}catch(_){return!1}return!0}(),i=function(_){k(D,_);function D(){var B,j;U(this,D);for(var W=arguments.length,h=new Array(W),N=0;N<W;N++)h[N]=arguments[N];return j=P(this,(B=b(D)).call.apply(B,[this].concat(h))),p(g(j),"_canvas",void 0),p(g(j),"_image",void 0),p(g(j),"state",{imgLoaded:!1}),p(g(j),"handleImageLoad",function(){j.setState({imgLoaded:!0})}),j}return T(D,[{key:"componentDidMount",value:function(){this.update()}},{key:"componentDidUpdate",value:function(){this.update()}},{key:"update",value:function(){var j=this.props,W=j.value,h=j.size,N=j.level,H=j.bgColor,X=j.fgColor,Y=j.includeMargin,re=j.imageSettings,he=new s(-1,c[N]);if(he.addData(d(W)),he.make(),this._canvas!=null){var de=this._canvas,ne=de.getContext("2d");if(!ne)return;var ae=he.modules;if(ae===null)return;var le=Y?m:0,ee=ae.length+le*2,ie=l(this.props,ae);re!=null&&ie!=null&&(ie.excavation!=null&&(ae=u(ae,ie.excavation)));var ve=window.devicePixelRatio||1;de.height=de.width=h*ve;var Pe=h/ee*ve;ne.scale(Pe,Pe),ne.fillStyle=H,ne.fillRect(0,0,ee,ee),ne.fillStyle=X,a?ne.fill(new Path2D(x(ae,le))):ae.forEach(function(Ie,we){Ie.forEach(function(ke,De){ke&&ne.fillRect(De+le,we+le,1,1)})}),this.state.imgLoaded&&this._image&&ie!=null&&ne.drawImage(this._image,ie.x+le,ie.y+le,ie.w,ie.h)}}},{key:"render",value:function(){var j=this,W=this.props,h=W.value,N=W.size,H=W.level,X=W.bgColor,Y=W.fgColor,re=W.style,he=W.includeMargin,de=W.imageSettings,ne=O(W,["value","size","level","bgColor","fgColor","style","includeMargin","imageSettings"]),ae=K({height:N,width:N},re),le=null,ee=de&&de.src;return de!=null&&ee!=null&&(le=y.createElement("img",{src:ee,style:{display:"none"},onLoad:this.handleImageLoad,ref:function(ve){return j._image=ve}})),y.createElement(y.Fragment,null,y.createElement("canvas",G({style:ae,height:N,width:N,ref:function(ve){return j._canvas=ve}},ne)),le)}}]),D}(y.PureComponent);p(i,"defaultProps",S);var E=function(_){k(D,_);function D(){return U(this,D),P(this,b(D).apply(this,arguments))}return T(D,[{key:"render",value:function(){var j=this.props,W=j.value,h=j.size,N=j.level,H=j.bgColor,X=j.fgColor,Y=j.includeMargin,re=j.imageSettings,he=O(j,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]),de=new s(-1,c[N]);de.addData(d(W)),de.make();var ne=de.modules;if(ne===null)return null;var ae=Y?m:0,le=ne.length+ae*2,ee=l(this.props,ne),ie=null;re!=null&&ee!=null&&(ee.excavation!=null&&(ne=u(ne,ee.excavation)),ie=y.createElement("image",{xlinkHref:re.src,height:ee.h,width:ee.w,x:ee.x+ae,y:ee.y+ae,preserveAspectRatio:"none"}));var ve=x(ne,ae);return y.createElement("svg",G({shapeRendering:"crispEdges",height:h,width:h,viewBox:"0 0 ".concat(le," ").concat(le)},he),y.createElement("path",{fill:H,d:"M0,0 h".concat(le,"v").concat(le,"H0z")}),y.createElement("path",{fill:X,d:ve}),ie)}}]),D}(y.PureComponent);p(E,"defaultProps",S);var v=function(D){var B=D.renderAs,j=O(D,["renderAs"]),W=B==="svg"?E:i;return y.createElement(W,j)};v.defaultProps=K({renderAs:"canvas"},S),at.exports=v},DlQD:function(at,Ne,F){(function(q,G){at.exports=G()})(this,function(){"use strict";function q(me,se){for(var be=0;be<se.length;be++){var te=se[be];te.enumerable=te.enumerable||!1,te.configurable=!0,"value"in te&&(te.writable=!0),Object.defineProperty(me,te.key,te)}}function G(me,se,be){return se&&q(me.prototype,se),be&&q(me,be),me}function R(me,se){if(!me)return;if(typeof me=="string")return K(me,se);var be=Object.prototype.toString.call(me).slice(8,-1);if(be==="Object"&&me.constructor&&(be=me.constructor.name),be==="Map"||be==="Set")return Array.from(me);if(be==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(be))return K(me,se)}function K(me,se){(se==null||se>me.length)&&(se=me.length);for(var be=0,te=new Array(se);be<se;be++)te[be]=me[be];return te}function O(me,se){var be;if(typeof Symbol=="undefined"||me[Symbol.iterator]==null){if(Array.isArray(me)||(be=R(me))||se&&me&&typeof me.length=="number"){be&&(me=be);var te=0;return function(){return te>=me.length?{done:!0}:{done:!1,value:me[te++]}}}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 be=me[Symbol.iterator](),be.next.bind(be)}function L(me,se){return se={exports:{}},me(se,se.exports),se.exports}var U=L(function(me){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 be(te){me.exports.defaults=te}me.exports={defaults:se(),getDefaults:se,changeDefaults:be}}),I=U.defaults,T=U.getDefaults,P=U.changeDefaults,b=/[&<>"']/,g=/[&<>"']/g,k=/[<>"']|&(?!#?\w+;)/,w=/[<>"']|&(?!#?\w+;)/g,p={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},y=function(se){return p[se]};function f(me,se){if(se){if(b.test(me))return me.replace(g,y)}else if(k.test(me))return me.replace(w,y);return me}var s=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function c(me){return me.replace(s,function(se,be){return be=be.toLowerCase(),be==="colon"?":":be.charAt(0)==="#"?be.charAt(1)==="x"?String.fromCharCode(parseInt(be.substring(2),16)):String.fromCharCode(+be.substring(1)):""})}var d=/(^|[^\[])\^/g;function S(me,se){me=me.source||me,se=se||"";var be={replace:function(oe,ce){return ce=ce.source||ce,ce=ce.replace(d,"$1"),me=me.replace(oe,ce),be},getRegex:function(){return new RegExp(me,se)}};return be}var C=/[^\w:]/g,m=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function A(me,se,be){if(me){var te;try{te=decodeURIComponent(c(be)).replace(C,"").toLowerCase()}catch(oe){return null}if(te.indexOf("javascript:")===0||te.indexOf("vbscript:")===0||te.indexOf("data:")===0)return null}se&&!m.test(be)&&(be=i(se,be));try{be=encodeURI(be).replace(/%25/g,"%")}catch(oe){return null}return be}var x={},u=/^[^:]+:\/*[^/]*$/,l=/^([^:]+:)[\s\S]*$/,a=/^([^:]+:\/*[^/]*)[\s\S]*$/;function i(me,se){x[" "+me]||(u.test(me)?x[" "+me]=me+"/":x[" "+me]=D(me,"/",!0)),me=x[" "+me];var be=me.indexOf(":")===-1;return se.substring(0,2)==="//"?be?se:me.replace(l,"$1")+se:se.charAt(0)==="/"?be?se:me.replace(a,"$1")+se:me+se}var E={exec:function(){}};function v(me){for(var se=1,be,te;se<arguments.length;se++){be=arguments[se];for(te in be)Object.prototype.hasOwnProperty.call(be,te)&&(me[te]=be[te])}return me}function _(me,se){var be=me.replace(/\|/g,function(ce,_e,je){for(var Xe=!1,Ze=_e;--Ze>=0&&je[Ze]==="\\";)Xe=!Xe;return Xe?"|":" |"}),te=be.split(/ \|/),oe=0;if(te.length>se)te.splice(se);else for(;te.length<se;)te.push("");for(;oe<te.length;oe++)te[oe]=te[oe].trim().replace(/\\\|/g,"|");return te}function D(me,se,be){var te=me.length;if(te===0)return"";for(var oe=0;oe<te;){var ce=me.charAt(te-oe-1);if(ce===se&&!be)oe++;else if(ce!==se&&be)oe++;else break}return me.substr(0,te-oe)}function B(me,se){if(me.indexOf(se[1])===-1)return-1;for(var be=me.length,te=0,oe=0;oe<be;oe++)if(me[oe]==="\\")oe++;else if(me[oe]===se[0])te++;else if(me[oe]===se[1]&&(te--,te<0))return oe;return-1}function j(me){me&&me.sanitize&&!me.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 W={escape:f,unescape:c,edit:S,cleanUrl:A,resolveUrl:i,noopTest:E,merge:v,splitCells:_,rtrim:D,findClosingBracket:B,checkSanitizeDeprecation:j},h=U.defaults,N=W.rtrim,H=W.splitCells,X=W.escape,Y=W.findClosingBracket;function re(me,se,be){var te=se.href,oe=se.title?X(se.title):null,ce=me[1].replace(/\\([\[\]])/g,"$1");return me[0].charAt(0)!=="!"?{type:"link",raw:be,href:te,title:oe,text:ce}:{type:"image",raw:be,href:te,title:oe,text:X(ce)}}function he(me,se){var be=me.match(/^(\s+)(?:```)/);if(be===null)return se;var te=be[1];return se.split(`
`).map(function(oe){var ce=oe.match(/^\s+/);if(ce===null)return oe;var _e=ce[0];return _e.length>=te.length?oe.slice(te.length):oe}).join(`
`)}var de=function(){function me(be){this.options=be||h}var se=me.prototype;return se.space=function(te){var oe=this.rules.block.newline.exec(te);if(oe)return oe[0].length>1?{type:"space",raw:oe[0]}:{raw:`
`}},se.code=function(te,oe){var ce=this.rules.block.code.exec(te);if(ce){var _e=oe[oe.length-1];if(_e&&_e.type==="paragraph")return{raw:ce[0],text:ce[0].trimRight()};var je=ce[0].replace(/^ {4}/gm,"");return{type:"code",raw:ce[0],codeBlockStyle:"indented",text:this.options.pedantic?je:N(je,`
`)}}},se.fences=function(te){var oe=this.rules.block.fences.exec(te);if(oe){var ce=oe[0],_e=he(ce,oe[3]||"");return{type:"code",raw:ce,lang:oe[2]?oe[2].trim():oe[2],text:_e}}},se.heading=function(te){var oe=this.rules.block.heading.exec(te);if(oe)return{type:"heading",raw:oe[0],depth:oe[1].length,text:oe[2]}},se.nptable=function(te){var oe=this.rules.block.nptable.exec(te);if(oe){var ce={type:"table",header:H(oe[1].replace(/^ *| *\| *$/g,"")),align:oe[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:oe[3]?oe[3].replace(/\n$/,"").split(`
`):[],raw:oe[0]};if(ce.header.length===ce.align.length){var _e=ce.align.length,je;for(je=0;je<_e;je++)/^ *-+: *$/.test(ce.align[je])?ce.align[je]="right":/^ *:-+: *$/.test(ce.align[je])?ce.align[je]="center":/^ *:-+ *$/.test(ce.align[je])?ce.align[je]="left":ce.align[je]=null;for(_e=ce.cells.length,je=0;je<_e;je++)ce.cells[je]=H(ce.cells[je],ce.header.length);return ce}}},se.hr=function(te){var oe=this.rules.block.hr.exec(te);if(oe)return{type:"hr",raw:oe[0]}},se.blockquote=function(te){var oe=this.rules.block.blockquote.exec(te);if(oe){var ce=oe[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:oe[0],text:ce}}},se.list=function(te){var oe=this.rules.block.list.exec(te);if(oe){for(var ce=oe[0],_e=oe[2],je=_e.length>1,Xe=_e[_e.length-1]===")",Ze={type:"list",raw:ce,ordered:je,start:je?+_e.slice(0,-1):"",loose:!1,items:[]},_t=oe[0].match(this.rules.block.item),It=!1,$e,Qt,Bt,Pt,mn,xn,er,Qn=_t.length,nn=0;nn<Qn;nn++)$e=_t[nn],ce=$e,Qt=$e.length,$e=$e.replace(/^ *([*+-]|\d+[.)]) */,""),~$e.indexOf(`
`)&&(Qt-=$e.length,$e=this.options.pedantic?$e.replace(/^ {1,4}/gm,""):$e.replace(new RegExp("^ {1,"+Qt+"}","gm"),"")),nn!==Qn-1&&(Bt=this.rules.block.bullet.exec(_t[nn+1])[0],(je?Bt.length===1||!Xe&&Bt[Bt.length-1]===")":Bt.length>1||this.options.smartLists&&Bt!==_e)&&(Pt=_t.slice(nn+1).join(`
`),Ze.raw=Ze.raw.substring(0,Ze.raw.length-Pt.length),nn=Qn-1)),mn=It||/\n\n(?!\s*$)/.test($e),nn!==Qn-1&&(It=$e.charAt($e.length-1)===`
`,mn||(mn=It)),mn&&(Ze.loose=!0),xn=/^\[[ xX]\] /.test($e),er=void 0,xn&&(er=$e[1]!==" ",$e=$e.replace(/^\[[ xX]\] +/,"")),Ze.items.push({type:"list_item",raw:ce,task:xn,checked:er,loose:mn,text:$e});return Ze}},se.html=function(te){var oe=this.rules.block.html.exec(te);if(oe)return{type:this.options.sanitize?"paragraph":"html",raw:oe[0],pre:!this.options.sanitizer&&(oe[1]==="pre"||oe[1]==="script"||oe[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(oe[0]):X(oe[0]):oe[0]}},se.def=function(te){var oe=this.rules.block.def.exec(te);if(oe){oe[3]&&(oe[3]=oe[3].substring(1,oe[3].length-1));var ce=oe[1].toLowerCase().replace(/\s+/g," ");return{tag:ce,raw:oe[0],href:oe[2],title:oe[3]}}},se.table=function(te){var oe=this.rules.block.table.exec(te);if(oe){var ce={type:"table",header:H(oe[1].replace(/^ *| *\| *$/g,"")),align:oe[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:oe[3]?oe[3].replace(/\n$/,"").split(`
`):[]};if(ce.header.length===ce.align.length){ce.raw=oe[0];var _e=ce.align.length,je;for(je=0;je<_e;je++)/^ *-+: *$/.test(ce.align[je])?ce.align[je]="right":/^ *:-+: *$/.test(ce.align[je])?ce.align[je]="center":/^ *:-+ *$/.test(ce.align[je])?ce.align[je]="left":ce.align[je]=null;for(_e=ce.cells.length,je=0;je<_e;je++)ce.cells[je]=H(ce.cells[je].replace(/^ *\| *| *\| *$/g,""),ce.header.length);return ce}}},se.lheading=function(te){var oe=this.rules.block.lheading.exec(te);if(oe)return{type:"heading",raw:oe[0],depth:oe[2].charAt(0)==="="?1:2,text:oe[1]}},se.paragraph=function(te){var oe=this.rules.block.paragraph.exec(te);if(oe)return{type:"paragraph",raw:oe[0],text:oe[1].charAt(oe[1].length-1)===`
`?oe[1].slice(0,-1):oe[1]}},se.text=function(te,oe){var ce=this.rules.block.text.exec(te);if(ce){var _e=oe[oe.length-1];return _e&&_e.type==="text"?{raw:ce[0],text:ce[0]}:{type:"text",raw:ce[0],text:ce[0]}}},se.escape=function(te){var oe=this.rules.inline.escape.exec(te);if(oe)return{type:"escape",raw:oe[0],text:X(oe[1])}},se.tag=function(te,oe,ce){var _e=this.rules.inline.tag.exec(te);if(_e)return!oe&&/^<a /i.test(_e[0])?oe=!0:oe&&/^<\/a>/i.test(_e[0])&&(oe=!1),!ce&&/^<(pre|code|kbd|script)(\s|>)/i.test(_e[0])?ce=!0:ce&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(_e[0])&&(ce=!1),{type:this.options.sanitize?"text":"html",raw:_e[0],inLink:oe,inRawBlock:ce,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(_e[0]):X(_e[0]):_e[0]}},se.link=function(te){var oe=this.rules.inline.link.exec(te);if(oe){var ce=Y(oe[2],"()");if(ce>-1){var _e=oe[0].indexOf("!")===0?5:4,je=_e+oe[1].length+ce;oe[2]=oe[2].substring(0,ce),oe[0]=oe[0].substring(0,je).trim(),oe[3]=""}var Xe=oe[2],Ze="";if(this.options.pedantic){var _t=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Xe);_t?(Xe=_t[1],Ze=_t[3]):Ze=""}else Ze=oe[3]?oe[3].slice(1,-1):"";Xe=Xe.trim().replace(/^<([\s\S]*)>$/,"$1");var It=re(oe,{href:Xe&&Xe.replace(this.rules.inline._escapes,"$1"),title:Ze&&Ze.replace(this.rules.inline._escapes,"$1")},oe[0]);return It}},se.reflink=function(te,oe){var ce;if((ce=this.rules.inline.reflink.exec(te))||(ce=this.rules.inline.nolink.exec(te))){var _e=(ce[2]||ce[1]).replace(/\s+/g," ");if(_e=oe[_e.toLowerCase()],!_e||!_e.href){var je=ce[0].charAt(0);return{type:"text",raw:je,text:je}}var Xe=re(ce,_e,ce[0]);return Xe}},se.strong=function(te,oe,ce){ce===void 0&&(ce="");var _e=this.rules.inline.strong.start.exec(te);if(_e&&(!_e[1]||_e[1]&&(ce===""||this.rules.inline.punctuation.exec(ce)))){oe=oe.slice(-1*te.length);var je=_e[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;je.lastIndex=0;for(var Xe;(_e=je.exec(oe))!=null;)if(Xe=this.rules.inline.strong.middle.exec(oe.slice(0,_e.index+3)),Xe)return{type:"strong",raw:te.slice(0,Xe[0].length),text:te.slice(2,Xe[0].length-2)}}},se.em=function(te,oe,ce){ce===void 0&&(ce="");var _e=this.rules.inline.em.start.exec(te);if(_e&&(!_e[1]||_e[1]&&(ce===""||this.rules.inline.punctuation.exec(ce)))){oe=oe.slice(-1*te.length);var je=_e[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;je.lastIndex=0;for(var Xe;(_e=je.exec(oe))!=null;)if(Xe=this.rules.inline.em.middle.exec(oe.slice(0,_e.index+2)),Xe)return{type:"em",raw:te.slice(0,Xe[0].length),text:te.slice(1,Xe[0].length-1)}}},se.codespan=function(te){var oe=this.rules.inline.code.exec(te);if(oe){var ce=oe[2].replace(/\n/g," "),_e=/[^ ]/.test(ce),je=ce.startsWith(" ")&&ce.endsWith(" ");return _e&&je&&(ce=ce.substring(1,ce.length-1)),ce=X(ce,!0),{type:"codespan",raw:oe[0],text:ce}}},se.br=function(te){var oe=this.rules.inline.br.exec(te);if(oe)return{type:"br",raw:oe[0]}},se.del=function(te){var oe=this.rules.inline.del.exec(te);if(oe)return{type:"del",raw:oe[0],text:oe[1]}},se.autolink=function(te,oe){var ce=this.rules.inline.autolink.exec(te);if(ce){var _e,je;return ce[2]==="@"?(_e=X(this.options.mangle?oe(ce[1]):ce[1]),je="mailto:"+_e):(_e=X(ce[1]),je=_e),{type:"link",raw:ce[0],text:_e,href:je,tokens:[{type:"text",raw:_e,text:_e}]}}},se.url=function(te,oe){var ce;if(ce=this.rules.inline.url.exec(te)){var _e,je;if(ce[2]==="@")_e=X(this.options.mangle?oe(ce[0]):ce[0]),je="mailto:"+_e;else{var Xe;do Xe=ce[0],ce[0]=this.rules.inline._backpedal.exec(ce[0])[0];while(Xe!==ce[0]);_e=X(ce[0]),ce[1]==="www."?je="http://"+_e:je=_e}return{type:"link",raw:ce[0],text:_e,href:je,tokens:[{type:"text",raw:_e,text:_e}]}}},se.inlineText=function(te,oe,ce){var _e=this.rules.inline.text.exec(te);if(_e){var je;return oe?je=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(_e[0]):X(_e[0]):_e[0]:je=X(this.options.smartypants?ce(_e[0]):_e[0]),{type:"text",raw:_e[0],text:je}}},me}(),ne=W.noopTest,ae=W.edit,le=W.merge,ee={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:ne,table:ne,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};ee._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,ee._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ee.def=ae(ee.def).replace("label",ee._label).replace("title",ee._title).getRegex(),ee.bullet=/(?:[*+-]|\d{1,9}[.)])/,ee.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,ee.item=ae(ee.item,"gm").replace(/bull/g,ee.bullet).getRegex(),ee.list=ae(ee.list).replace(/bull/g,ee.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ee.def.source+")").getRegex(),ee._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",ee._comment=/<!--(?!-?>)[\s\S]*?-->/,ee.html=ae(ee.html,"i").replace("comment",ee._comment).replace("tag",ee._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ee.paragraph=ae(ee._paragraph).replace("hr",ee.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",ee._tag).getRegex(),ee.blockquote=ae(ee.blockquote).replace("paragraph",ee.paragraph).getRegex(),ee.normal=le({},ee),ee.gfm=le({},ee.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*|$)"}),ee.gfm.nptable=ae(ee.gfm.nptable).replace("hr",ee.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",ee._tag).getRegex(),ee.gfm.table=ae(ee.gfm.table).replace("hr",ee.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",ee._tag).getRegex(),ee.pedantic=le({},ee.normal,{html:ae(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ee._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:ne,paragraph:ae(ee.normal._paragraph).replace("hr",ee.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",ee.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ie={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:ne,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:ne,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};ie._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",ie.punctuation=ae(ie.punctuation).replace(/punctuation/g,ie._punctuation).getRegex(),ie._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",ie._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",ie.em.start=ae(ie.em.start).replace(/punctuation/g,ie._punctuation).getRegex(),ie.em.middle=ae(ie.em.middle).replace(/punctuation/g,ie._punctuation).replace(/overlapSkip/g,ie._overlapSkip).getRegex(),ie.em.endAst=ae(ie.em.endAst,"g").replace(/punctuation/g,ie._punctuation).getRegex(),ie.em.endUnd=ae(ie.em.endUnd,"g").replace(/punctuation/g,ie._punctuation).getRegex(),ie.strong.start=ae(ie.strong.start).replace(/punctuation/g,ie._punctuation).getRegex(),ie.strong.middle=ae(ie.strong.middle).replace(/punctuation/g,ie._punctuation).replace(/blockSkip/g,ie._blockSkip).getRegex(),ie.strong.endAst=ae(ie.strong.endAst,"g").replace(/punctuation/g,ie._punctuation).getRegex(),ie.strong.endUnd=ae(ie.strong.endUnd,"g").replace(/punctuation/g,ie._punctuation).getRegex(),ie.blockSkip=ae(ie._blockSkip,"g").getRegex(),ie.overlapSkip=ae(ie._overlapSkip,"g").getRegex(),ie._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ie._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ie._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])?)+(?![-_])/,ie.autolink=ae(ie.autolink).replace("scheme",ie._scheme).replace("email",ie._email).getRegex(),ie._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ie.tag=ae(ie.tag).replace("comment",ee._comment).replace("attribute",ie._attribute).getRegex(),ie._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ie._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,ie._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ie.link=ae(ie.link).replace("label",ie._label).replace("href",ie._href).replace("title",ie._title).getRegex(),ie.reflink=ae(ie.reflink).replace("label",ie._label).getRegex(),ie.reflinkSearch=ae(ie.reflinkSearch,"g").replace("reflink",ie.reflink).replace("nolink",ie.nolink).getRegex(),ie.normal=le({},ie),ie.pedantic=le({},ie.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:ae(/^!?\[(label)\]\((.*?)\)/).replace("label",ie._label).getRegex(),reflink:ae(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ie._label).getRegex()}),ie.gfm=le({},ie.normal,{escape:ae(ie.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),ie.gfm.url=ae(ie.gfm.url,"i").replace("email",ie.gfm._extended_email).getRegex(),ie.breaks=le({},ie.gfm,{br:ae(ie.br).replace("{2,}","*").getRegex(),text:ae(ie.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var ve={block:ee,inline:ie},Pe=U.defaults,Ie=ve.block,we=ve.inline;function ke(me){return me.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 De(me){var se="",be,te,oe=me.length;for(be=0;be<oe;be++)te=me.charCodeAt(be),Math.random()>.5&&(te="x"+te.toString(16)),se+="&#"+te+";";return se}var Le=function(){function me(be){this.tokens=[],this.tokens.links=Object.create(null),this.options=be||Pe,this.options.tokenizer=this.options.tokenizer||new de,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var te={block:Ie.normal,inline:we.normal};this.options.pedantic?(te.block=Ie.pedantic,te.inline=we.pedantic):this.options.gfm&&(te.block=Ie.gfm,this.options.breaks?te.inline=we.breaks:te.inline=we.gfm),this.tokenizer.rules=te}me.lex=function(te,oe){var ce=new me(oe);return ce.lex(te)};var se=me.prototype;return se.lex=function(te){return te=te.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(te,this.tokens,!0),this.inline(this.tokens),this.tokens},se.blockTokens=function(te,oe,ce){oe===void 0&&(oe=[]),ce===void 0&&(ce=!0),te=te.replace(/^ +$/gm,"");for(var _e,je,Xe,Ze;te;){if(_e=this.tokenizer.space(te)){te=te.substring(_e.raw.length),_e.type&&oe.push(_e);continue}if(_e=this.tokenizer.code(te,oe)){te=te.substring(_e.raw.length),_e.type?oe.push(_e):(Ze=oe[oe.length-1],Ze.raw+=`
`+_e.raw,Ze.text+=`
`+_e.text);continue}if(_e=this.tokenizer.fences(te)){te=te.substring(_e.raw.length),oe.push(_e);continue}if(_e=this.tokenizer.heading(te)){te=te.substring(_e.raw.length),oe.push(_e);continue}if(_e=this.tokenizer.nptable(te)){te=te.substring(_e.raw.length),oe.push(_e);continue}if(_e=this.tokenizer.hr(te)){te=te.substring(_e.raw.length),oe.push(_e);continue}if(_e=this.tokenizer.blockquote(te)){te=te.substring(_e.raw.length),_e.tokens=this.blockTokens(_e.text,[],ce),oe.push(_e);continue}if(_e=this.tokenizer.list(te)){for(te=te.substring(_e.raw.length),Xe=_e.items.length,je=0;je<Xe;je++)_e.items[je].tokens=this.blockTokens(_e.items[je].text,[],!1);oe.push(_e);continue}if(_e=this.tokenizer.html(te)){te=te.substring(_e.raw.length),oe.push(_e);continue}if(ce&&(_e=this.tokenizer.def(te))){te=te.substring(_e.raw.length),this.tokens.links[_e.tag]||(this.tokens.links[_e.tag]={href:_e.href,title:_e.title});continue}if(_e=this.tokenizer.table(te)){te=te.substring(_e.raw.length),oe.push(_e);continue}if(_e=this.tokenizer.lheading(te)){te=te.substring(_e.raw.length),oe.push(_e);continue}if(ce&&(_e=this.tokenizer.paragraph(te))){te=te.substring(_e.raw.length),oe.push(_e);continue}if(_e=this.tokenizer.text(te,oe)){te=te.substring(_e.raw.length),_e.type?oe.push(_e):(Ze=oe[oe.length-1],Ze.raw+=`
`+_e.raw,Ze.text+=`
`+_e.text);continue}if(te){var _t="Infinite loop on byte: "+te.charCodeAt(0);if(this.options.silent){console.error(_t);break}else throw new Error(_t)}}return oe},se.inline=function(te){var oe,ce,_e,je,Xe,Ze,_t=te.length;for(oe=0;oe<_t;oe++){Ze=te[oe];switch(Ze.type){case"paragraph":case"text":case"heading":{Ze.tokens=[],this.inlineTokens(Ze.text,Ze.tokens);break}case"table":{for(Ze.tokens={header:[],cells:[]},je=Ze.header.length,ce=0;ce<je;ce++)Ze.tokens.header[ce]=[],this.inlineTokens(Ze.header[ce],Ze.tokens.header[ce]);for(je=Ze.cells.length,ce=0;ce<je;ce++)for(Xe=Ze.cells[ce],Ze.tokens.cells[ce]=[],_e=0;_e<Xe.length;_e++)Ze.tokens.cells[ce][_e]=[],this.inlineTokens(Xe[_e],Ze.tokens.cells[ce][_e]);break}case"blockquote":{this.inline(Ze.tokens);break}case"list":{for(je=Ze.items.length,ce=0;ce<je;ce++)this.inline(Ze.items[ce].tokens);break}}}return te},se.inlineTokens=function(te,oe,ce,_e,je){oe===void 0&&(oe=[]),ce===void 0&&(ce=!1),_e===void 0&&(_e=!1),je===void 0&&(je="");var Xe,Ze=te,_t;if(this.tokens.links){var It=Object.keys(this.tokens.links);if(It.length>0)for(;(_t=this.tokenizer.rules.inline.reflinkSearch.exec(Ze))!=null;)It.includes(_t[0].slice(_t[0].lastIndexOf("[")+1,-1))&&(Ze=Ze.slice(0,_t.index)+"["+"a".repeat(_t[0].length-2)+"]"+Ze.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(_t=this.tokenizer.rules.inline.blockSkip.exec(Ze))!=null;)Ze=Ze.slice(0,_t.index)+"["+"a".repeat(_t[0].length-2)+"]"+Ze.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;te;){if(Xe=this.tokenizer.escape(te)){te=te.substring(Xe.raw.length),oe.push(Xe);continue}if(Xe=this.tokenizer.tag(te,ce,_e)){te=te.substring(Xe.raw.length),ce=Xe.inLink,_e=Xe.inRawBlock,oe.push(Xe);continue}if(Xe=this.tokenizer.link(te)){te=te.substring(Xe.raw.length),Xe.type==="link"&&(Xe.tokens=this.inlineTokens(Xe.text,[],!0,_e)),oe.push(Xe);continue}if(Xe=this.tokenizer.reflink(te,this.tokens.links)){te=te.substring(Xe.raw.length),Xe.type==="link"&&(Xe.tokens=this.inlineTokens(Xe.text,[],!0,_e)),oe.push(Xe);continue}if(Xe=this.tokenizer.strong(te,Ze,je)){te=te.substring(Xe.raw.length),Xe.tokens=this.inlineTokens(Xe.text,[],ce,_e),oe.push(Xe);continue}if(Xe=this.tokenizer.em(te,Ze,je)){te=te.substring(Xe.raw.length),Xe.tokens=this.inlineTokens(Xe.text,[],ce,_e),oe.push(Xe);continue}if(Xe=this.tokenizer.codespan(te)){te=te.substring(Xe.raw.length),oe.push(Xe);continue}if(Xe=this.tokenizer.br(te)){te=te.substring(Xe.raw.length),oe.push(Xe);continue}if(Xe=this.tokenizer.del(te)){te=te.substring(Xe.raw.length),Xe.tokens=this.inlineTokens(Xe.text,[],ce,_e),oe.push(Xe);continue}if(Xe=this.tokenizer.autolink(te,De)){te=te.substring(Xe.raw.length),oe.push(Xe);continue}if(!ce&&(Xe=this.tokenizer.url(te,De))){te=te.substring(Xe.raw.length),oe.push(Xe);continue}if(Xe=this.tokenizer.inlineText(te,_e,ke)){te=te.substring(Xe.raw.length),je=Xe.raw.slice(-1),oe.push(Xe);continue}if(te){var $e="Infinite loop on byte: "+te.charCodeAt(0);if(this.options.silent){console.error($e);break}else throw new Error($e)}}return oe},G(me,null,[{key:"rules",get:function(){return{block:Ie,inline:we}}}]),me}(),Ve=U.defaults,ze=W.cleanUrl,Je=W.escape,Ye=function(){function me(be){this.options=be||Ve}var se=me.prototype;return se.code=function(te,oe,ce){var _e=(oe||"").match(/\S*/)[0];if(this.options.highlight){var je=this.options.highlight(te,_e);je!=null&&je!==te&&(ce=!0,te=je)}return _e?'<pre><code class="'+this.options.langPrefix+Je(_e,!0)+'">'+(ce?te:Je(te,!0))+`</code></pre>
`:"<pre><code>"+(ce?te:Je(te,!0))+`</code></pre>
`},se.blockquote=function(te){return`<blockquote>
`+te+`</blockquote>
`},se.html=function(te){return te},se.heading=function(te,oe,ce,_e){return this.options.headerIds?"<h"+oe+' id="'+this.options.headerPrefix+_e.slug(ce)+'">'+te+"</h"+oe+`>
`:"<h"+oe+">"+te+"</h"+oe+`>
`},se.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},se.list=function(te,oe,ce){var _e=oe?"ol":"ul",je=oe&&ce!==1?' start="'+ce+'"':"";return"<"+_e+je+`>
`+te+"</"+_e+`>
`},se.listitem=function(te){return"<li>"+te+`</li>
`},se.checkbox=function(te){return"<input "+(te?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},se.paragraph=function(te){return"<p>"+te+`</p>
`},se.table=function(te,oe){return oe&&(oe="<tbody>"+oe+"</tbody>"),`<table>
<thead>
`+te+`</thead>
`+oe+`</table>
`},se.tablerow=function(te){return`<tr>
`+te+`</tr>
`},se.tablecell=function(te,oe){var ce=oe.header?"th":"td",_e=oe.align?"<"+ce+' align="'+oe.align+'">':"<"+ce+">";return _e+te+"</"+ce+`>
`},se.strong=function(te){return"<strong>"+te+"</strong>"},se.em=function(te){return"<em>"+te+"</em>"},se.codespan=function(te){return"<code>"+te+"</code>"},se.br=function(){return this.options.xhtml?"<br/>":"<br>"},se.del=function(te){return"<del>"+te+"</del>"},se.link=function(te,oe,ce){if(te=ze(this.options.sanitize,this.options.baseUrl,te),te===null)return ce;var _e='<a href="'+Je(te)+'"';return oe&&(_e+=' title="'+oe+'"'),_e+=">"+ce+"</a>",_e},se.image=function(te,oe,ce){if(te=ze(this.options.sanitize,this.options.baseUrl,te),te===null)return ce;var _e='<img src="'+te+'" alt="'+ce+'"';return oe&&(_e+=' title="'+oe+'"'),_e+=this.options.xhtml?"/>":">",_e},se.text=function(te){return te},me}(),Ge=function(){function me(){}var se=me.prototype;return se.strong=function(te){return te},se.em=function(te){return te},se.codespan=function(te){return te},se.del=function(te){return te},se.html=function(te){return te},se.text=function(te){return te},se.link=function(te,oe,ce){return""+ce},se.image=function(te,oe,ce){return""+ce},se.br=function(){return""},me}(),ht=function(){function me(){this.seen={}}var se=me.prototype;return se.slug=function(te){var oe=te.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(oe)){var ce=oe;do this.seen[ce]++,oe=ce+"-"+this.seen[ce];while(this.seen.hasOwnProperty(oe))}return this.seen[oe]=0,oe},me}(),ot=U.defaults,st=W.unescape,qe=function(){function me(be){this.options=be||ot,this.options.renderer=this.options.renderer||new Ye,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ge,this.slugger=new ht}me.parse=function(te,oe){var ce=new me(oe);return ce.parse(te)};var se=me.prototype;return se.parse=function(te,oe){oe===void 0&&(oe=!0);var ce="",_e,je,Xe,Ze,_t,It,$e,Qt,Bt,Pt,mn,xn,er,Qn,nn,ur,hr,vr,ca=te.length;for(_e=0;_e<ca;_e++){Pt=te[_e];switch(Pt.type){case"space":continue;case"hr":{ce+=this.renderer.hr();continue}case"heading":{ce+=this.renderer.heading(this.parseInline(Pt.tokens),Pt.depth,st(this.parseInline(Pt.tokens,this.textRenderer)),this.slugger);continue}case"code":{ce+=this.renderer.code(Pt.text,Pt.lang,Pt.escaped);continue}case"table":{for(Qt="",$e="",Ze=Pt.header.length,je=0;je<Ze;je++)$e+=this.renderer.tablecell(this.parseInline(Pt.tokens.header[je]),{header:!0,align:Pt.align[je]});for(Qt+=this.renderer.tablerow($e),Bt="",Ze=Pt.cells.length,je=0;je<Ze;je++){for(It=Pt.tokens.cells[je],$e="",_t=It.length,Xe=0;Xe<_t;Xe++)$e+=this.renderer.tablecell(this.parseInline(It[Xe]),{header:!1,align:Pt.align[Xe]});Bt+=this.renderer.tablerow($e)}ce+=this.renderer.table(Qt,Bt);continue}case"blockquote":{Bt=this.parse(Pt.tokens),ce+=this.renderer.blockquote(Bt);continue}case"list":{for(mn=Pt.ordered,xn=Pt.start,er=Pt.loose,Ze=Pt.items.length,Bt="",je=0;je<Ze;je++)nn=Pt.items[je],ur=nn.checked,hr=nn.task,Qn="",nn.task&&(vr=this.renderer.checkbox(ur),er?nn.tokens.length>0&&nn.tokens[0].type==="text"?(nn.tokens[0].text=vr+" "+nn.tokens[0].text,nn.tokens[0].tokens&&nn.tokens[0].tokens.length>0&&nn.tokens[0].tokens[0].type==="text"&&(nn.tokens[0].tokens[0].text=vr+" "+nn.tokens[0].tokens[0].text)):nn.tokens.unshift({type:"text",text:vr}):Qn+=vr),Qn+=this.parse(nn.tokens,er),Bt+=this.renderer.listitem(Qn,hr,ur);ce+=this.renderer.list(Bt,mn,xn);continue}case"html":{ce+=this.renderer.html(Pt.text);continue}case"paragraph":{ce+=this.renderer.paragraph(this.parseInline(Pt.tokens));continue}case"text":{for(Bt=Pt.tokens?this.parseInline(Pt.tokens):Pt.text;_e+1<ca&&te[_e+1].type==="text";)Pt=te[++_e],Bt+=`
`+(Pt.tokens?this.parseInline(Pt.tokens):Pt.text);ce+=oe?this.renderer.paragraph(Bt):Bt;continue}default:{var mr='Token with "'+Pt.type+'" type was not found.';if(this.options.silent){console.error(mr);return}else throw new Error(mr)}}}return ce},se.parseInline=function(te,oe){oe=oe||this.renderer;var ce="",_e,je,Xe=te.length;for(_e=0;_e<Xe;_e++){je=te[_e];switch(je.type){case"escape":{ce+=oe.text(je.text);break}case"html":{ce+=oe.html(je.text);break}case"link":{ce+=oe.link(je.href,je.title,this.parseInline(je.tokens,oe));break}case"image":{ce+=oe.image(je.href,je.title,je.text);break}case"strong":{ce+=oe.strong(this.parseInline(je.tokens,oe));break}case"em":{ce+=oe.em(this.parseInline(je.tokens,oe));break}case"codespan":{ce+=oe.codespan(je.text);break}case"br":{ce+=oe.br();break}case"del":{ce+=oe.del(this.parseInline(je.tokens,oe));break}case"text":{ce+=oe.text(je.text);break}default:{var Ze='Token with "'+je.type+'" type was not found.';if(this.options.silent){console.error(Ze);return}else throw new Error(Ze)}}}return ce},me}(),vt=W.merge,pt=W.checkSanitizeDeprecation,gt=W.escape,Be=U.getDefaults,Ct=U.changeDefaults,yt=U.defaults;function He(me,se,be){if(typeof me=="undefined"||me===null)throw new Error("marked(): input parameter is undefined or null");if(typeof me!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(me)+", string expected");if(typeof se=="function"&&(be=se,se=null),se=vt({},He.defaults,se||{}),pt(se),be){var te=se.highlight,oe;try{oe=Le.lex(me,se)}catch(Xe){return be(Xe)}var ce=function(Ze){var _t;if(!Ze)try{_t=qe.parse(oe,se)}catch(It){Ze=It}return se.highlight=te,Ze?be(Ze):be(null,_t)};if(!te||te.length<3)return ce();if(delete se.highlight,!oe.length)return ce();var _e=0;He.walkTokens(oe,function(Xe){Xe.type==="code"&&(_e++,setTimeout(function(){te(Xe.text,Xe.lang,function(Ze,_t){if(Ze)return ce(Ze);_t!=null&&_t!==Xe.text&&(Xe.text=_t,Xe.escaped=!0),_e--,_e===0&&ce()})},0))}),_e===0&&ce();return}try{var je=Le.lex(me,se);return se.walkTokens&&He.walkTokens(je,se.walkTokens),qe.parse(je,se)}catch(Xe){if(Xe.message+=`
Please report this to https://github.com/markedjs/marked.`,se.silent)return"<p>An error occurred:</p><pre>"+gt(Xe.message+"",!0)+"</pre>";throw Xe}}He.options=He.setOptions=function(me){return vt(He.defaults,me),Ct(He.defaults),He},He.getDefaults=Be,He.defaults=yt,He.use=function(me){var se=vt({},me);if(me.renderer&&function(){var te=He.defaults.renderer||new Ye,oe=function(je){var Xe=te[je];te[je]=function(){for(var Ze=arguments.length,_t=new Array(Ze),It=0;It<Ze;It++)_t[It]=arguments[It];var $e=me.renderer[je].apply(te,_t);return $e===!1&&($e=Xe.apply(te,_t)),$e}};for(var ce in me.renderer)oe(ce);se.renderer=te}(),me.tokenizer&&function(){var te=He.defaults.tokenizer||new de,oe=function(je){var Xe=te[je];te[je]=function(){for(var Ze=arguments.length,_t=new Array(Ze),It=0;It<Ze;It++)_t[It]=arguments[It];var $e=me.tokenizer[je].apply(te,_t);return $e===!1&&($e=Xe.apply(te,_t)),$e}};for(var ce in me.tokenizer)oe(ce);se.tokenizer=te}(),me.walkTokens){var be=He.defaults.walkTokens;se.walkTokens=function(te){me.walkTokens(te),be&&be(te)}}He.setOptions(se)},He.walkTokens=function(me,se){for(var be=O(me),te;!(te=be()).done;){var oe=te.value;se(oe);switch(oe.type){case"table":{for(var ce=O(oe.tokens.header),_e;!(_e=ce()).done;){var je=_e.value;He.walkTokens(je,se)}for(var Xe=O(oe.tokens.cells),Ze;!(Ze=Xe()).done;)for(var _t=Ze.value,It=O(_t),$e;!($e=It()).done;){var Qt=$e.value;He.walkTokens(Qt,se)}break}case"list":{He.walkTokens(oe.items,se);break}default:oe.tokens&&He.walkTokens(oe.tokens,se)}}},He.Parser=qe,He.parser=qe.parse,He.Renderer=Ye,He.TextRenderer=Ge,He.Lexer=Le,He.lexer=Le.lex,He.Tokenizer=de,He.Slugger=ht,He.parse=He;var rt=He;return rt})},EJTS:function(at,Ne,F){"use strict";F.d(Ne,"a",function(){return C});var q=F("qVdP"),G=F("jsC+"),R=F("lUTK"),K=F("BvKs"),O=F("sRBo"),L=F("kaz8"),U=F("oBTY"),I=F("7Kak"),T=F("9yH6"),P=F("tJVT"),b=F("cDcd"),g=F.n(b),k=F("9Bee"),w=F("+vTd"),p=F.n(w),y=F("xKgJ"),f=F("Is5a"),s=F.n(f),c=["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"],d=["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"],S=function(A){var x,u=A.data,l=A.selectIds,a=A.onSelectCheckBox,i=a===void 0?function(){}:a,E=A.showCheckbox,v=E===void 0?!0:E,_=Object(b.useState)(!1),D=Object(P.a)(_,2),B=D[0],j=D[1],W=function(){if(u.item_type==="JUDGMENT")return g.a.createElement("div",{className:p.a.judgmentContent},u.choices.map(function(he,de){return g.a.createElement(T.a,{key:de,disabled:!0},he.choice_text)}));if(u.item_type==="PROGRAM"){var Y;return g.a.createElement("div",{className:p.a.programContent},g.a.createElement(k.a,{value:(Y=u.program_attr)===null||Y===void 0?void 0:Y.description}))}if(u.item_type==="COMBINATION"){var re;return g.a.createElement("div",{className:p.a.combinationContent},u==null||((re=u.sub_item_banks)===null||re===void 0)?void 0:re.map(function(he,de){var ne,ae="(\u9898\u76EE".concat(de+1,"-\u5355\u9009\u9898) ");return g.a.createElement(b.Fragment,null,g.a.createElement("div",{style:{marginTop:10,marginBottom:10}},g.a.createElement(k.a,{value:ae+he.name})),he.choices.map(function(le,ee){return g.a.createElement("div",{key:ee,className:p.a.otherContentItem},g.a.createElement("p",null,c[ee]),g.a.createElement(k.a,{className:p.a.otehrContentHtml,value:le.choice_text}))}),g.a.createElement("div",{className:p.a.con},g.a.createElement("b",{className:"c-grey-333 font14"}," \u7B54\u6848\uFF1A",d==null?void 0:d[he==null||((ne=he.choices)===null||ne===void 0)?void 0:ne.findIndex(function(le){return le==null?void 0:le.is_answer})]," "),g.a.createElement("div",null,g.a.createElement("span",null,"\u89E3\u6790\uFF1A"),g.a.createElement(k.a,{className:p.a.parseAnswerHtml,value:he.analysis||"\u6682\u65E0\u89E3\u6790"}))))}))}return g.a.createElement("div",{className:p.a.otherContent},u.choices.map(function(he,de){return g.a.createElement("div",{key:de,className:p.a.otherContentItem},g.a.createElement("p",null,c[de]),g.a.createElement(k.a,{className:p.a.otehrContentHtml,value:he.choice_text}))}))},h=function(){var Y;return g.a.createElement("div",null,(Y=u.standard_answer)===null||Y===void 0?void 0:Y.map(function(re,he){return g.a.createElement(k.a,{key:he,className:p.a.answerHtml,value:"\u7B54\u6848\uFF08\u586B\u7A7A".concat(re.position,"\uFF09\uFF1A").concat(re.answer_text.join("\u3001"))})}))},N=function(){var Y,re,he,de={SUBJECTIVE:(Y=u.answer_texts)===null||Y===void 0?void 0:Y[0],JUDGMENT:(re=u.choices)===null||re===void 0||((he=re.find(function(Pe){return Pe.is_answer}))===null||he===void 0)?void 0:he.choice_text},ne=u.choices.map(function(Pe){return Pe.is_answer}).findIndex(function(Pe){return Pe}),ae=ne>-1?d[ne]:"",le="";u.choices.map(function(Pe,Ie){Pe.is_answer&&(le+=d[Ie])});var ee=de[u.item_type],ie={SINGLE:g.a.createElement(k.a,{className:p.a.answerHtml,value:"\u7B54\u6848\uFF1A".concat(ae||"\u65E0")}),MULTIPLE:g.a.createElement(k.a,{className:p.a.answerHtml,value:"\u7B54\u6848\uFF1A".concat(le||"\u65E0")}),COMPLETION:h()},ve=g.a.createElement(k.a,{className:p.a.answerHtml,value:"\u7B54\u6848\uFF1A".concat(ee||"\u65E0")});return ie[u.item_type]||ve},H=function(Y){var re=Object(U.a)(l);Y.target.checked?re.push(u.id):re=re.filter(function(he){return he!==u.id}),i(re)};return g.a.createElement("div",{className:p.a.itemWrap},g.a.createElement("div",{className:p.a.list},v&&g.a.createElement(L.a,{className:"mr10",onChange:H,checked:l.includes(u.id)}),g.a.createElement("div",{className:p.a.title},g.a.createElement(k.a,{key:1,showLines:1,showTextOnly:!0,className:p.a.topicTitleContent,value:u.name})),g.a.createElement("div",{className:p.a.line},g.a.createElement("b",{className:p.a.b1}),g.a.createElement("b",{className:p.a.b2})),g.a.createElement("div",{onClick:function(){return j(!B)},className:p.a.tr},B?"\u6536\u8D77":"\u5C55\u5F00",g.a.createElement("i",{style:{transform:B?"scale(0.5) rotate(-180deg)":"scale(0.5) rotate(0deg)"},className:"iconfont icon-zhankai4"}))),g.a.createElement("aside",{style:B?{display:"block"}:{display:"none"},className:p.a.itemDetail},g.a.createElement("div",{style:{marginBottom:44}},g.a.createElement(k.a,{key:2,className:p.a.topicTitleContent,value:u.name}),g.a.createElement("div",{className:"".concat(p.a.row," mt15")},W()),g.a.createElement("div",{className:p.a.row},g.a.createElement("div",{className:p.a.updateTimeRow},g.a.createElement("div",{className:p.a.updateTimeWrap},u.item_type==="PROGRAM"&&g.a.createElement("p",{className:p.a.programLanguage},"\u7F16\u7A0B\u8BED\u8A00\uFF1A",(x=u.program_attr)===null||x===void 0?void 0:x.language))))),u.item_type!=="PROGRAM"&&u.item_type!=="COMBINATION"&&g.a.createElement("div",{className:p.a.answerWrapper},g.a.createElement("img",{src:s.a,alt:"",className:p.a.decoration}),g.a.createElement("div",{className:p.a.answer},N()),g.a.createElement("div",{className:p.a.parse},g.a.createElement("div",{className:p.a.parseText},"\u89E3\u6790\uFF1A"),g.a.createElement("div",{className:p.a.parseAnswer},u.analysis?g.a.createElement(k.a,{className:p.a.parseAnswerHtml,value:u.analysis}):"\u6682\u65E0\u89E3\u6790")))))},C=function(A){var x,u,l,a,i,E,v,_,D,B,j,W,h,N,H,X,Y=A.isProblemset,re=A.data,he=A.user,de=A.activeTabsKey,ne=A.onPublicReview,ae=ne===void 0?function(){}:ne,le=A.onStartExperience,ee=le===void 0?function(){}:le,ie=A.onSetPrivate,ve=ie===void 0?function(){}:ie,Pe=A.onCorrection,Ie=Pe===void 0?function(){}:Pe,we=A.onCollect,ke=we===void 0?function(){}:we,De=A.onSetPublic,Le=De===void 0?function(){}:De,Ve=A.onDelete,ze=Ve===void 0?function(){}:Ve,Je=A.onCancel,Ye=Je===void 0?function(){}:Je,Ge=A.onSelect,ht=Ge===void 0?function(){}:Ge,ot=A.onMoveTo,st=ot===void 0?function(){}:ot,qe=A.onSetShare,vt=qe===void 0?function(){}:qe,pt=A.onCancelShare,gt=pt===void 0?function(){}:pt,Be=A.onPublish,Ct=Be===void 0?function(){}:Be,yt=A.onCancelPublish,He=yt===void 0?function(){}:yt,rt=re.item_type==="PROGRAM"?"/problems/".concat((x=re.program_attr)===null||x===void 0?void 0:x.identifier,"/edit"):"/problemset/edit/".concat(re.id),me=de==="0"&&!re.public&&!re.apply&&(re.item_type==="PROGRAM"&&((u=re.program_attr)===null||u===void 0?void 0:u.status)!==0||re.item_type!=="PROGRAM"),se=g.a.createElement(K.a,{forceSubMenuRender:!0,className:p.a.menu},de==="0"&&!re.public&&g.a.createElement(K.a.Item,{key:"-1"},g.a.createElement("a",{className:p.a.actionLink,target:"_blank",href:rt},"\u7F16\u8F91")),(de==="0"||de==="3")&&re.item_type==="PROGRAM"&&((l=re.program_attr)===null||l===void 0?void 0:l.status)!==0&&!re.public&&((a=re.author)===null||a===void 0?void 0:a.login)===((i=he.userInfo)===null||i===void 0?void 0:i.login)&&g.a.createElement(K.a.Item,{key:"0"},g.a.createElement("a",{className:p.a.actionLink,onClick:function(){var ce;return He(re==null||((ce=re.program_attr)===null||ce===void 0)?void 0:ce.identifier)}},"\u64A4\u9500\u53D1\u5E03")),de==="0"&&g.a.createElement(K.a.Item,{key:"1"},g.a.createElement("a",{className:p.a.actionLink,onClick:function(){return st(re.id)}},"\u79FB\u52A8\u5230")),de==="0"&&!(re!=null&&re.is_share)&&g.a.createElement(K.a.Item,{key:"3"},g.a.createElement("a",{className:p.a.actionLink,onClick:function(){return vt(re.id)}},"\u5171\u4EAB")),(de==="0"&&(re==null?void 0:re.is_share)||de==="3"&&((E=re.author)===null||E===void 0?void 0:E.login)===((v=he.userInfo)===null||v===void 0?void 0:v.login))&&g.a.createElement(K.a.Item,{key:"3"},g.a.createElement("a",{className:p.a.actionLink,onClick:function(){return gt(re.id)}},"\u64A4\u9500\u5171\u4EAB")),me&&g.a.createElement(K.a.Item,{key:"4"},g.a.createElement("a",{className:p.a.actionLink,onClick:function(){return Le(re.id)}},"\u516C\u5F00")),de==="0"&&!re.public&&re.apply&&(re.item_type==="PROGRAM"&&re.program_attr.status!==0||re.item_type!=="PROGRAM")&&g.a.createElement(K.a.Item,{key:"5"},g.a.createElement("a",{className:p.a.reviewFlag,onClick:ae},"\u5BA1\u6838\u4E2D")),(de==="0"||de==="1")&&re.public&&((_=re.author)===null||_===void 0?void 0:_.login)===((D=he.userInfo)===null||D===void 0?void 0:D.login)&&g.a.createElement(K.a.Item,{key:"6"},g.a.createElement("a",{className:p.a.actionLink,onClick:function(){return ve(re.id)}},"\u64A4\u9500\u516C\u5F00")),de==="2"&&g.a.createElement(K.a.Item,{key:"7"},g.a.createElement("a",{className:p.a.actionLink,onClick:function(){return ke(re.id,re.is_collected)}},"\u53D6\u6D88\u6536\u85CF")),(de==="0"||de==="3")&&re.item_type==="PROGRAM"&&((B=re.program_attr)===null||B===void 0?void 0:B.status)===0&&!re.public&&((j=re.author)===null||j===void 0?void 0:j.login)===((W=he.userInfo)===null||W===void 0?void 0:W.login)&&g.a.createElement(K.a.Item,{key:"8"},g.a.createElement("a",{className:p.a.actionLink,onClick:function(){var ce;return Ct(re==null||((ce=re.program_attr)===null||ce===void 0)?void 0:ce.identifier)}},"\u53D1\u5E03")),(de==="1"||de==="3")&&!Object(y.o)()&&!Object(y.m)()&&((h=re.author)===null||h===void 0?void 0:h.login)!==((N=he.userInfo)===null||N===void 0?void 0:N.login)&&g.a.createElement(K.a.Item,{key:"9"},g.a.createElement("a",{className:p.a.actionLink,onClick:function(){return ke(re.id,re.is_collected)}},re.is_collected?"\u53D6\u6D88\u6536\u85CF":"\u6536\u85CF")),de!=="0"&&!Object(y.o)()&&!Object(y.m)()&&g.a.createElement(K.a.Item,{key:"10"},g.a.createElement("a",{className:p.a.actionLink,onClick:function(){return Ie(re.id)}},"\u7EA0\u9519")),(de==="0"&&!re.public||de==="1"&&Object(y.o)()&&((H=re.author)===null||H===void 0?void 0:H.login)!==((X=he.userInfo)===null||X===void 0?void 0:X.login))&&g.a.createElement(K.a.Item,{key:"11"},g.a.createElement("a",{className:p.a.actionLink,onClick:function(){return ze(re.id)}},"\u5220\u9664"))),be=g.a.createElement(K.a,{forceSubMenuRender:!0,className:p.a.menu},g.a.createElement(K.a.Item,{key:"10"},g.a.createElement("a",{className:p.a.actionLink,onClick:function(){return Ie(re.id)}},"\u7EA0\u9519"))),te=de!=="0"&&!Object(y.o)()&&!Object(y.m)();return g.a.createElement(g.a.Fragment,null,Y?g.a.createElement(g.a.Fragment,null,re.item_type!=="SUBJECTIVE"&&re.item_type!=="COMBINATION"&&g.a.createElement("span",{className:p.a.textBtn,style:{cursor:"pointer"},onClick:function(){return ee(re)}},"\u4F53\u9A8C"),g.a.createElement(G.a,{overlay:se},g.a.createElement("span",{style:{cursor:"default"},onClick:function(ce){return ce.preventDefault()}},g.a.createElement("span",{className:p.a.textBtn},"\u66F4\u591A")))):te?g.a.createElement(G.a,{className:"ml40",overlay:be},g.a.createElement("span",{style:{cursor:"default"},onClick:function(ce){return ce.preventDefault()}},g.a.createElement("span",null,"\u66F4\u591A"))):g.a.createElement("span",null))};Ne.b=S},ELLl:function(at,Ne,F){(function(q){q(F("VrN/"))})(function(q){var G={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},R=q.Pos;q.defineOption("autoCloseBrackets",!1,function(p,y,f){f&&f!=q.Init&&(p.removeKeyMap(O),p.state.closeBrackets=null),y&&(L(K(y,"pairs")),p.state.closeBrackets=y,p.addKeyMap(O))});function K(p,y){return y=="pairs"&&typeof p=="string"?p:typeof p=="object"&&p[y]!=null?p[y]:G[y]}var O={Backspace:T,Enter:P};function L(p){for(var y=0;y<p.length;y++){var f=p.charAt(y),s="'"+f+"'";O[s]||(O[s]=U(f))}}L(G.pairs+"`");function U(p){return function(y){return g(y,p)}}function I(p){var y=p.state.closeBrackets;if(!y||y.override)return y;var f=p.getModeAt(p.getCursor());return f.closeBrackets||y}function T(p){var y=I(p);if(!y||p.getOption("disableInput"))return q.Pass;for(var f=K(y,"pairs"),s=p.listSelections(),c=0;c<s.length;c++){if(!s[c].empty())return q.Pass;var d=k(p,s[c].head);if(!d||f.indexOf(d)%2!=0)return q.Pass}for(var c=s.length-1;c>=0;c--){var S=s[c].head;p.replaceRange("",R(S.line,S.ch-1),R(S.line,S.ch+1),"+delete")}}function P(p){var y=I(p),f=y&&K(y,"explode");if(!f||p.getOption("disableInput"))return q.Pass;for(var s=p.listSelections(),c=0;c<s.length;c++){if(!s[c].empty())return q.Pass;var d=k(p,s[c].head);if(!d||f.indexOf(d)%2!=0)return q.Pass}p.operation(function(){var S=p.lineSeparator()||`
`;p.replaceSelection(S+S,null),p.execCommand("goCharLeft"),s=p.listSelections();for(var C=0;C<s.length;C++){var m=s[C].head.line;p.indentLine(m,null,!0),p.indentLine(m+1,null,!0)}})}function b(p){var y=q.cmpPos(p.anchor,p.head)>0;return{anchor:new R(p.anchor.line,p.anchor.ch+(y?-1:1)),head:new R(p.head.line,p.head.ch+(y?1:-1))}}function g(p,y){var f=I(p);if(!f||p.getOption("disableInput"))return q.Pass;var s=K(f,"pairs"),c=s.indexOf(y);if(c==-1)return q.Pass;for(var d=K(f,"closeBefore"),S=K(f,"triples"),C=s.charAt(c+1)==y,m=p.listSelections(),A=c%2==0,x,u=0;u<m.length;u++){var l=m[u],a=l.head,i,E=p.getRange(a,R(a.line,a.ch+1));if(A&&!l.empty())i="surround";else if((C||!A)&&E==y)C&&w(p,a)?i="both":S.indexOf(y)>=0&&p.getRange(a,R(a.line,a.ch+3))==y+y+y?i="skipThree":i="skip";else if(C&&a.ch>1&&S.indexOf(y)>=0&&p.getRange(R(a.line,a.ch-2),a)==y+y){if(a.ch>2&&/\bstring/.test(p.getTokenTypeAt(R(a.line,a.ch-2))))return q.Pass;i="addFour"}else if(C){var v=a.ch==0?" ":p.getRange(R(a.line,a.ch-1),a);if(!q.isWordChar(E)&&v!=y&&!q.isWordChar(v))i="both";else return q.Pass}else if(A&&(E.length===0||/\s/.test(E)||d.indexOf(E)>-1))i="both";else return q.Pass;if(!x)x=i;else if(x!=i)return q.Pass}var _=c%2?s.charAt(c-1):y,D=c%2?y:s.charAt(c+1);p.operation(function(){if(x=="skip")p.execCommand("goCharRight");else if(x=="skipThree")for(var B=0;B<3;B++)p.execCommand("goCharRight");else if(x=="surround"){for(var j=p.getSelections(),B=0;B<j.length;B++)j[B]=_+j[B]+D;p.replaceSelections(j,"around"),j=p.listSelections().slice();for(var B=0;B<j.length;B++)j[B]=b(j[B]);p.setSelections(j)}else x=="both"?(p.replaceSelection(_+D,null),p.triggerElectric(_+D),p.execCommand("goCharLeft")):x=="addFour"&&(p.replaceSelection(_+_+_+_,"before"),p.execCommand("goCharRight"))})}function k(p,y){var f=p.getRange(R(y.line,y.ch-1),R(y.line,y.ch+1));return f.length==2?f:null}function w(p,y){var f=p.getTokenAt(R(y.line,y.ch+1));return/\bstring/.test(f.type)&&f.start==y.ch&&(y.ch==0||!/\bstring/.test(p.getTokenTypeAt(y)))}})},FOrL:function(at,Ne,F){at.exports=F.p+"static/nodata.a6b3f948.png"},H38U:function(at,Ne,F){var q=F("f4xo"),G=F("rcnY"),R=F("wU8J"),K=F("Iq15"),O=F("dWSS");function L(I,T){this.typeNumber=I,this.errorCorrectLevel=T,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}var U=L.prototype;U.addData=function(I){var T=new q(I);this.dataList.push(T),this.dataCache=null},U.isDark=function(I,T){if(I<0||this.moduleCount<=I||T<0||this.moduleCount<=T)throw new Error(I+","+T);return this.modules[I][T]},U.getModuleCount=function(){return this.moduleCount},U.make=function(){if(this.typeNumber<1){var I=1;for(I=1;I<40;I++){for(var T=G.getRSBlocks(I,this.errorCorrectLevel),P=new R,b=0,g=0;g<T.length;g++)b+=T[g].dataCount;for(var g=0;g<this.dataList.length;g++){var k=this.dataList[g];P.put(k.mode,4),P.put(k.getLength(),K.getLengthInBits(k.mode,I)),k.write(P)}if(P.getLengthInBits()<=b*8)break}this.typeNumber=I}this.makeImpl(!1,this.getBestMaskPattern())},U.makeImpl=function(I,T){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var P=0;P<this.moduleCount;P++){this.modules[P]=new Array(this.moduleCount);for(var b=0;b<this.moduleCount;b++)this.modules[P][b]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(I,T),this.typeNumber>=7&&this.setupTypeNumber(I),this.dataCache==null&&(this.dataCache=L.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,T)},U.setupPositionProbePattern=function(I,T){for(var P=-1;P<=7;P++){if(I+P<=-1||this.moduleCount<=I+P)continue;for(var b=-1;b<=7;b++){if(T+b<=-1||this.moduleCount<=T+b)continue;0<=P&&P<=6&&(b==0||b==6)||0<=b&&b<=6&&(P==0||P==6)||2<=P&&P<=4&&2<=b&&b<=4?this.modules[I+P][T+b]=!0:this.modules[I+P][T+b]=!1}}},U.getBestMaskPattern=function(){for(var I=0,T=0,P=0;P<8;P++){this.makeImpl(!0,P);var b=K.getLostPoint(this);(P==0||I>b)&&(I=b,T=P)}return T},U.createMovieClip=function(I,T,P){var b=I.createEmptyMovieClip(T,P),g=1;this.make();for(var k=0;k<this.modules.length;k++)for(var w=k*g,p=0;p<this.modules[k].length;p++){var y=p*g,f=this.modules[k][p];f&&(b.beginFill(0,100),b.moveTo(y,w),b.lineTo(y+g,w),b.lineTo(y+g,w+g),b.lineTo(y,w+g),b.endFill())}return b},U.setupTimingPattern=function(){for(var I=8;I<this.moduleCount-8;I++){if(this.modules[I][6]!=null)continue;this.modules[I][6]=I%2==0}for(var T=8;T<this.moduleCount-8;T++){if(this.modules[6][T]!=null)continue;this.modules[6][T]=T%2==0}},U.setupPositionAdjustPattern=function(){for(var I=K.getPatternPosition(this.typeNumber),T=0;T<I.length;T++)for(var P=0;P<I.length;P++){var b=I[T],g=I[P];if(this.modules[b][g]!=null)continue;for(var k=-2;k<=2;k++)for(var w=-2;w<=2;w++)k==-2||k==2||w==-2||w==2||k==0&&w==0?this.modules[b+k][g+w]=!0:this.modules[b+k][g+w]=!1}},U.setupTypeNumber=function(I){for(var T=K.getBCHTypeNumber(this.typeNumber),P=0;P<18;P++){var b=!I&&(T>>P&1)==1;this.modules[Math.floor(P/3)][P%3+this.moduleCount-8-3]=b}for(var P=0;P<18;P++){var b=!I&&(T>>P&1)==1;this.modules[P%3+this.moduleCount-8-3][Math.floor(P/3)]=b}},U.setupTypeInfo=function(I,T){for(var P=this.errorCorrectLevel<<3|T,b=K.getBCHTypeInfo(P),g=0;g<15;g++){var k=!I&&(b>>g&1)==1;g<6?this.modules[g][8]=k:g<8?this.modules[g+1][8]=k:this.modules[this.moduleCount-15+g][8]=k}for(var g=0;g<15;g++){var k=!I&&(b>>g&1)==1;g<8?this.modules[8][this.moduleCount-g-1]=k:g<9?this.modules[8][15-g-1+1]=k:this.modules[8][15-g-1]=k}this.modules[this.moduleCount-8][8]=!I},U.mapData=function(I,T){for(var P=-1,b=this.moduleCount-1,g=7,k=0,w=this.moduleCount-1;w>0;w-=2)for(w==6&&w--;;){for(var p=0;p<2;p++)if(this.modules[b][w-p]==null){var y=!1;k<I.length&&(y=(I[k]>>>g&1)==1);var f=K.getMask(T,b,w-p);f&&(y=!y),this.modules[b][w-p]=y,g--,g==-1&&(k++,g=7)}if(b+=P,b<0||this.moduleCount<=b){b-=P,P=-P;break}}},L.PAD0=236,L.PAD1=17,L.createData=function(I,T,P){for(var b=G.getRSBlocks(I,T),g=new R,k=0;k<P.length;k++){var w=P[k];g.put(w.mode,4),g.put(w.getLength(),K.getLengthInBits(w.mode,I)),w.write(g)}for(var p=0,k=0;k<b.length;k++)p+=b[k].dataCount;if(g.getLengthInBits()>p*8)throw new Error("code length overflow. ("+g.getLengthInBits()+">"+p*8+")");for(g.getLengthInBits()+4<=p*8&&g.put(0,4);g.getLengthInBits()%8!=0;)g.putBit(!1);for(;!(g.getLengthInBits()>=p*8);){if(g.put(L.PAD0,8),g.getLengthInBits()>=p*8)break;g.put(L.PAD1,8)}return L.createBytes(g,b)},L.createBytes=function(I,T){for(var P=0,b=0,g=0,k=new Array(T.length),w=new Array(T.length),p=0;p<T.length;p++){var y=T[p].dataCount,f=T[p].totalCount-y;b=Math.max(b,y),g=Math.max(g,f),k[p]=new Array(y);for(var s=0;s<k[p].length;s++)k[p][s]=255&I.buffer[s+P];P+=y;var c=K.getErrorCorrectPolynomial(f),d=new O(k[p],c.getLength()-1),S=d.mod(c);w[p]=new Array(c.getLength()-1);for(var s=0;s<w[p].length;s++){var C=s+S.getLength()-w[p].length;w[p][s]=C>=0?S.get(C):0}}for(var m=0,s=0;s<T.length;s++)m+=T[s].totalCount;for(var A=new Array(m),x=0,s=0;s<b;s++)for(var p=0;p<T.length;p++)s<k[p].length&&(A[x++]=k[p][s]);for(var s=0;s<g;s++)for(var p=0;p<T.length;p++)s<w[p].length&&(A[x++]=w[p][s]);return A},at.exports=L},HmJG:function(at,Ne,F){},IPdS:function(at,Ne,F){at.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"}},Iq15:function(at,Ne,F){var q=F("nVVt"),G=F("dWSS"),R=F("dQei"),K={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},O={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1<<10|1<<8|1<<5|1<<4|1<<2|1<<1|1<<0,G18:1<<12|1<<11|1<<10|1<<9|1<<8|1<<5|1<<2|1<<0,G15_MASK:1<<14|1<<12|1<<10|1<<4|1<<1,getBCHTypeInfo:function(L){for(var U=L<<10;O.getBCHDigit(U)-O.getBCHDigit(O.G15)>=0;)U^=O.G15<<O.getBCHDigit(U)-O.getBCHDigit(O.G15);return(L<<10|U)^O.G15_MASK},getBCHTypeNumber:function(L){for(var U=L<<12;O.getBCHDigit(U)-O.getBCHDigit(O.G18)>=0;)U^=O.G18<<O.getBCHDigit(U)-O.getBCHDigit(O.G18);return L<<12|U},getBCHDigit:function(L){for(var U=0;L!=0;)U++,L>>>=1;return U},getPatternPosition:function(L){return O.PATTERN_POSITION_TABLE[L-1]},getMask:function(L,U,I){switch(L){case K.PATTERN000:return(U+I)%2==0;case K.PATTERN001:return U%2==0;case K.PATTERN010:return I%3==0;case K.PATTERN011:return(U+I)%3==0;case K.PATTERN100:return(Math.floor(U/2)+Math.floor(I/3))%2==0;case K.PATTERN101:return U*I%2+U*I%3==0;case K.PATTERN110:return(U*I%2+U*I%3)%2==0;case K.PATTERN111:return(U*I%3+(U+I)%2)%2==0;default:throw new Error("bad maskPattern:"+L)}},getErrorCorrectPolynomial:function(L){for(var U=new G([1],0),I=0;I<L;I++)U=U.multiply(new G([1,R.gexp(I)],0));return U},getLengthInBits:function(L,U){if(1<=U&&U<10)switch(L){case q.MODE_NUMBER:return 10;case q.MODE_ALPHA_NUM:return 9;case q.MODE_8BIT_BYTE:return 8;case q.MODE_KANJI:return 8;default:throw new Error("mode:"+L)}else if(U<27)switch(L){case q.MODE_NUMBER:return 12;case q.MODE_ALPHA_NUM:return 11;case q.MODE_8BIT_BYTE:return 16;case q.MODE_KANJI:return 10;default:throw new Error("mode:"+L)}else if(U<41)switch(L){case q.MODE_NUMBER:return 14;case q.MODE_ALPHA_NUM:return 13;case q.MODE_8BIT_BYTE:return 16;case q.MODE_KANJI:return 12;default:throw new Error("mode:"+L)}else throw new Error("type:"+U)},getLostPoint:function(L){for(var U=L.getModuleCount(),I=0,T=0;T<U;T++)for(var P=0;P<U;P++){for(var b=0,g=L.isDark(T,P),k=-1;k<=1;k++){if(T+k<0||U<=T+k)continue;for(var w=-1;w<=1;w++){if(P+w<0||U<=P+w)continue;if(k==0&&w==0)continue;g==L.isDark(T+k,P+w)&&b++}}b>5&&(I+=3+b-5)}for(var T=0;T<U-1;T++)for(var P=0;P<U-1;P++){var p=0;L.isDark(T,P)&&p++,L.isDark(T+1,P)&&p++,L.isDark(T,P+1)&&p++,L.isDark(T+1,P+1)&&p++,(p==0||p==4)&&(I+=3)}for(var T=0;T<U;T++)for(var P=0;P<U-6;P++)L.isDark(T,P)&&!L.isDark(T,P+1)&&L.isDark(T,P+2)&&L.isDark(T,P+3)&&L.isDark(T,P+4)&&!L.isDark(T,P+5)&&L.isDark(T,P+6)&&(I+=40);for(var P=0;P<U;P++)for(var T=0;T<U-6;T++)L.isDark(T,P)&&!L.isDark(T+1,P)&&L.isDark(T+2,P)&&L.isDark(T+3,P)&&L.isDark(T+4,P)&&!L.isDark(T+5,P)&&L.isDark(T+6,P)&&(I+=40);for(var y=0,P=0;P<U;P++)for(var T=0;T<U;T++)L.isDark(T,P)&&y++;var f=Math.abs(100*y/U/U-50)/5;return I+=f*10,I}};at.exports=O},Is5a:function(at,Ne){at.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(at,Ne){at.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAgCAYAAACcuBHKAAAACXBIWXMAAAsSAAALEgHS3X78AAAAAXNSR0IArs4c6QAAAhNJREFUWEftlztLA0EQx/97Z2LAF1ooKhZaCClsVARFLAQbbQTBVFY2NjZiI4KFINjo51DBD2BhI4IQfKAIikJAg48oKD4Kk3usbDabXHSTu1yCucJp5pL5z+zvZm4XllBKVZTZSBriaLIV9HMdBIOoJE22XHEaA8U+zMc19B2HbfV5BByCAeAzDMPB4rJiCt0uBoZDHI5uIv4xUczbFJQbqOFdJNVz6Nm64xB7wVtQf0tBhUohJol7VHX1c4jddr0UNV3VIMoGh9hpKB+EakazIer7gc5FwN/o6qUcJyWegKsV4PUgmZINEVwGfHXyWoQAlALMy0zEmHdi2htwsWSBeFnNjIPVYOuIWuJZrG0XtwOQ5PNOPC+U75tIjyM27wGIu1kdFZXyRupxJGPMMxPPQp8vbo3l0fNxMAhmpgYovt8+15yF3u47EPEceg4RnfHAOG6mPQARmSoeQvUDRsLpYLJ0fBylgBAAAoZ5mTGdFVj1p07M65CzThhxQM2xi6QLOtPzTlyOO4Nw1Wz7pN8QugZU+ACZT54Tlhj7bdXJ4j81LN9qupYax/lY6pxIAIpklmaO/+1fUq4Q9VKed+JsxAPjOB32AMTJkAcgjgY8ABHu/YfI3DtU4+/vHWwDG+o9hwh39+HrYR8Uitut7yqPwESgeTBzIWYg75FNEK3NVcFCk6gvitqOELtMZyAKLVJC/TfVWC6c92hknAAAAABJRU5ErkJggg=="},JUtD:function(at,Ne,F){"use strict";F.r(Ne);var q=F("14J3"),G=F("BMrR"),R=F("DjyN"),K=F("NUBc"),O=F("qVdP"),L=F("jsC+"),U=F("T2oS"),I=F("W9HT"),T=F("+L6B"),P=F("2/Rp"),b=F("sPJy"),g=F("bE4q"),k=F("5Dmo"),w=F("3S7+"),p=F("lUTK"),y=F("BvKs"),f=F("sRBo"),s=F("kaz8"),c=F("miYZ"),d=F("tsqr"),S=F("7Kak"),C=F("9yH6"),m=F("2qtc"),A=F("kLXV"),x=F("oBTY"),u=F("k1fw"),l=F("9og8"),a=F("tJVT"),i=F("PpiC"),E=F("5NDa"),v=F("5rEg"),_=F("Znn+"),D=F("ZTPi"),B=F("WmNS"),j=F.n(B),W=F("cDcd"),h=F.n(W),N=F("9kvl"),H=F("55Ip"),X=F("iris"),Y=F("jcZT"),re=F("BdwD"),he=F("iNYN"),de=F.n(he),ne=function(lt){var Rt=lt.problemset,Tt=lt.globalSetting,Ot=lt.loading,pn=lt.dispatch,bn=Object(i.a)(lt,["problemset","globalSetting","loading","dispatch"]);return h.a.createElement(A.a,{centered:!0,keyboard:!1,closable:!1,destroyOnClose:!0,visible:Rt.actionTabs.key==="Problemset-PublicReview",title:"\u63D0\u793A",okText:"\u77E5\u9053\u5566",cancelText:"",width:"442px",onOk:function(){pn({type:"problemset/setActionTabs",payload:{}})},onCancel:function(){pn({type:"problemset/setActionTabs",payload:{}})}},h.a.createElement("div",{className:de.a.modalContent},"\u516C\u5F00\u7533\u8BF7\u5DF2\u63D0\u4EA4\uFF0C\u8BF7\u7B49\u5F85\u7BA1\u7406\u5458\u7684\u5BA1\u6838"),h.a.createElement("div",{className:de.a.modalContent},"\u6211\u4EEC\u5C06\u57281-2\u4E2A\u5DE5\u4F5C\u65E5\u5185\u5B8C\u6210\u5BA1\u6838"))},ae=Object(N.a)(function(Wt){var lt=Wt.problemset,Rt=Wt.loading,Tt=Wt.globalSetting;return{problemset:lt,globalSetting:Tt,loading:Rt.effects}})(ne),le=F("xlxt"),ee=F.n(le),ie=F("P/tu"),ve=F("mgmH"),Pe=function(lt){var Rt=lt.problemset,Tt=lt.dispatch,Ot=Object(W.useState)([]),pn=Object(a.a)(Ot,2),bn=pn[0],$t=pn[1],Zt=function(){Tt({type:"problemset/setActionTabs",payload:{}})};Object(W.useEffect)(function(){if(Rt.actionTabs.key==="\u5BFC\u51FA\u8BD5\u9898"){var fn,Xt;$t([(fn=Rt.actionTabs)===null||fn===void 0||((Xt=fn.params)===null||Xt===void 0)?void 0:Xt.group_id])}},[Rt.actionTabs.key]);var wn=function(){if(bn.length===0){d.b.warn("\u8BF7\u9009\u62E9\u6587\u4EF6\u5939");return}Object(ve.k)({group_id:bn[0]}),Zt()};return h.a.createElement(A.a,{centered:!0,title:"\u5BFC\u51FA\u8BD5\u9898",visible:Rt.actionTabs.key==="\u5BFC\u51FA\u8BD5\u9898",width:718,destroyOnClose:!0,wrapClassName:ee.a.customModal,onCancel:Zt,onOk:wn},h.a.createElement("aside",{className:ee.a.exportModal},h.a.createElement(ie.a,{value:bn,onChange:function(Xt){return $t(Xt)}})))},Ie=Object(N.a)(function(Wt){var lt=Wt.problemset;return{problemset:lt}})(Pe),we=F("i8i3"),ke=F.n(we),De=F("WCUW"),Le=F("Ty5D"),Ve=function(lt){var Rt,Tt,Ot=lt.problemset,pn=lt.dispatch,bn=lt.onOk,$t=Object(Le.i)(),Zt=Object(W.useState)([]),wn=Object(a.a)(Zt,2),fn=wn[0],Xt=wn[1],En=Object(W.useState)(1),Vn=Object(a.a)(En,2),$n=Vn[0],Jt=Vn[1],un=Object(W.useState)([]),Zn=Object(a.a)(un,2),Hn=Zn[0],an=Zn[1],hn=Object(W.useState)([]),Cn=Object(a.a)(hn,2),Nt=Cn[0],Lt=Cn[1],jt=Object(W.useState)(!0),Ae=Object(a.a)(jt,2),Ht=Ae[0],Tn=Ae[1],nr=Object(W.useState)(!1),Gt=Object(a.a)(nr,2),Xr=Gt[0],Pa=Gt[1],zr=Object(W.useState)(!1),dn=Object(a.a)(zr,2),St=dn[0],rr=dn[1];Object(W.useEffect)(function(){if(Ot.actionTabs.key==="\u5171\u4EAB\u8BD5\u9898"){var br,Sr;vn(),an([(br=Ot.actionTabs)===null||br===void 0||((Sr=br.params)===null||Sr===void 0)?void 0:Sr.group_id])}},[Ot.actionTabs.key]);var vn=function(){var br=Object(l.a)(j.a.mark(function Sr(){var Ir,Sa,Nr;return j.a.wrap(function(Mt){for(;;)switch(Mt.prev=Mt.next){case 0:return Tn(!0),Mt.next=3,Object(De.y)({type:0,page:1,per_page:10,order_by:"new"});case 3:Ir=Mt.sent,Ir!=null&&Ir.item_banks_group&&(Sa={id:-1,item_banks_count:(Ir==null?void 0:Ir.no_group_count)||0,name:{name:"\u672A\u52A0\u5165\u5206\u7EC4"}},Nr=[Sa].concat((Ir==null?void 0:Ir.item_banks_group)||[]),Xt(Nr)),Tn(!1);case 6:case"end":return Mt.stop()}},Sr)}));return function(){return br.apply(this,arguments)}}(),Rn=function(){pn({type:"problemset/setActionTabs",payload:{}})},yr=function(){var br=Object(l.a)(j.a.mark(function Sr(){var Ir;return j.a.wrap(function(Nr){for(;;)switch(Nr.prev=Nr.next){case 0:if(!(Hn.length===0)){Nr.next=3;break}return d.b.warn("\u8BF7\u9009\u62E9\u9700\u8981\u7684\u6587\u4EF6\u5939"),Nr.abrupt("return");case 3:if(!($n===1)){Nr.next=6;break}return Jt(2),Nr.abrupt("return");case 6:return Pa(!0),Nr.next=9,Object(De.l)({item_banks_group_ids:Hn,clazz:"ItemBank",group_ids:Nt});case 9:Ir=Nr.sent,(Ir==null?void 0:Ir.status)===0&&(bn(),Rn()),Pa(!1);case 12:case"end":return Nr.stop()}},Sr)}));return function(){return br.apply(this,arguments)}}(),kr=function(Sr){an(Sr),rr(Sr.length===fn.length)};return h.a.createElement(A.a,{centered:!0,afterClose:function(){Lt([]),Jt(1),rr(!1),Xt([])},title:"\u5171\u4EAB\u8BD5\u9898".concat($n,"/2"),visible:Ot.actionTabs.key==="\u5171\u4EAB\u8BD5\u9898",footer:null,width:718,destroyOnClose:!0,wrapClassName:ke.a.customModal,onCancel:Rn},h.a.createElement("aside",{className:ke.a.shareModal},h.a.createElement(I.a,{spinning:Ht},h.a.createElement("div",{className:ke.a.content},$n===1&&h.a.createElement("div",{className:ke.a.group},h.a.createElement(ie.a,{value:Hn,onChange:function(Sr){return an(Sr)}})),$n===2&&h.a.createElement("div",{className:ke.a.teachGroup},h.a.createElement("p",null,"\u5171\u4EAB\u81F3\u6559\u7814\u56E2\u961F"),h.a.createElement(s.a.Group,{value:Nt,onChange:function(Sr){return Lt(Sr)}},Ot==null||((Rt=Ot.teachGroupData)===null||Rt===void 0||((Tt=Rt.groups)===null||Tt===void 0))?void 0:Tt.map(function(br){return h.a.createElement(s.a,{key:br.group_id,value:br.group_id},br==null?void 0:br.name)})))),h.a.createElement("div",{className:ke.a.footer},h.a.createElement(P.a,{onClick:Rn},"\u53D6\u6D88"),h.a.createElement(P.a,{loading:Xr,onClick:yr,type:"primary"},$n===1?"\u4E0B\u4E00\u6B65":"\u786E\u8BA4\u5171\u4EAB")))))},ze=Object(N.a)(function(Wt){var lt=Wt.problemset;return{problemset:lt}})(Ve),Je=function(lt){var Rt=lt.problemset,Tt=lt.globalSetting,Ot=lt.loading,pn=lt.dispatch,bn=lt.onReloadData,$t=bn===void 0?function(){}:bn,Zt=Object(i.a)(lt,["problemset","globalSetting","loading","dispatch","onReloadData"]),wn=Object(W.useRef)(!1),fn=Object(W.useState)(!1),Xt=Object(a.a)(fn,2),En=Xt[0],Vn=Xt[1];Object(W.useEffect)(function(){Rt.actionTabs.key==="Problemset-SetPrivate"?window.localStorage.getItem("problemset-set-private-hint-flag")==="1"?$n():Vn(!0):Vn(!1)},[Rt.actionTabs.key]);var $n=function(){var Jt=Object(l.a)(j.a.mark(function un(){var Zn;return j.a.wrap(function(an){for(;;)switch(an.prev=an.next){case 0:return wn.current&&window.localStorage.setItem("problemset-set-private-hint-flag","1"),an.next=3,pn({type:"problemset/setPrivate",payload:Rt.actionTabs.params});case 3:Zn=an.sent,pn({type:"problemset/setActionTabs",payload:{}}),wn.current=!1,Zn.status===0&&$t();case 7:case"end":return an.stop()}},un)}));return function(){return Jt.apply(this,arguments)}}();return h.a.createElement(A.a,{centered:!0,keyboard:!1,closable:!1,destroyOnClose:!0,visible:En,title:"\u64A4\u9500\u516C\u5F00\u544A\u77E5",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",confirmLoading:Ot["problemset/setPrivate"],width:"442px",onOk:$n,onCancel:function(){pn({type:"problemset/setActionTabs",payload:{}}),wn.current=!1}},h.a.createElement("div",{className:de.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"),h.a.createElement("div",{className:de.a.modalContentLeft},"\u786E\u8BA4\u64A4\u9500\u516C\u5F00\u56DE\u5230\u81EA\u6709\u72B6\u6001\u5417\uFF1F"),h.a.createElement("div",null,h.a.createElement(s.a,{className:"mt10",defaultChecked:!1,onChange:function(un){return wn.current=un.target.checked}},"\u4E0D\u518D\u63D0\u793A")))},Ye=Object(N.a)(function(Wt){var lt=Wt.problemset,Rt=Wt.loading,Tt=Wt.globalSetting;return{problemset:lt,globalSetting:Tt,loading:Rt.effects}})(Je),Ge=function(lt){var Rt=lt.problemset,Tt=lt.globalSetting,Ot=lt.loading,pn=lt.dispatch,bn=lt.onReloadData,$t=bn===void 0?function(){}:bn,Zt=Object(i.a)(lt,["problemset","globalSetting","loading","dispatch","onReloadData"]),wn=function(){var fn=Object(l.a)(j.a.mark(function Xt(){var En;return j.a.wrap(function($n){for(;;)switch($n.prev=$n.next){case 0:return $n.next=2,pn({type:"problemset/handleDelete",payload:Rt.actionTabs.params});case 2:En=$n.sent,pn({type:"problemset/setActionTabs",payload:{}}),En.status===0&&$t();case 5:case"end":return $n.stop()}},Xt)}));return function(){return fn.apply(this,arguments)}}();return h.a.createElement(A.a,{centered:!0,keyboard:!1,closable:!1,destroyOnClose:!0,visible:Rt.actionTabs.key==="Problemset-Delete",title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",confirmLoading:Ot["problemset/handleDelete"],width:"442px",onOk:wn,onCancel:function(){pn({type:"problemset/setActionTabs",payload:{}})}},h.a.createElement("div",{className:de.a.modalContent},"\u786E\u8BA4\u5220\u9664\u540E\uFF0C\u65E0\u6CD5\u64A4\u9500"),h.a.createElement("div",{className:de.a.modalContent},"\u662F\u5426\u786E\u8BA4\u5220\u9664\uFF1F"))},ht=Object(N.a)(function(Wt){var lt=Wt.problemset,Rt=Wt.loading,Tt=Wt.globalSetting;return{problemset:lt,globalSetting:Tt,loading:Rt.effects}})(Ge),ot=F("LvDl"),st=F("9Bee"),qe=function(lt){var Rt,Tt=lt.problemset,Ot=lt.dispatch,pn=Object(W.useState)({}),bn=Object(a.a)(pn,2),$t=bn[0],Zt=bn[1],wn=Object(W.useState)([]),fn=Object(a.a)(wn,2),Xt=fn[0],En=fn[1],Vn=Object(W.useState)(!1),$n=Object(a.a)(Vn,2),Jt=$n[0],un=$n[1],Zn=["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(W.useEffect)(function(){var Cn;if((Tt==null||((Cn=Tt.actionTabs)===null||Cn===void 0)?void 0:Cn.key)==="SINGLE"){var Nt,Lt=Object(ot.cloneDeep)(Tt==null||((Nt=Tt.actionTabs)===null||Nt===void 0)?void 0:Nt.params);Zt(Lt),En(Lt.choices)}},[Tt==null||((Rt=Tt.actionTabs)===null||Rt===void 0)?void 0:Rt.key]);var Hn=function(){var Cn=Object(l.a)(j.a.mark(function Nt(){var Lt,jt;return j.a.wrap(function(Ht){for(;;)switch(Ht.prev=Ht.next){case 0:if(Xt.some(function(Tn){return Tn==null?void 0:Tn.checked})){Ht.next=3;break}return d.b.warn("\u8BF7\u60A8\u4F5C\u7B54\u540E\u518D\u63D0\u4EA4"),Ht.abrupt("return");case 3:Jt&&(jt=Object(ot.cloneDeep)(Tt==null||((Lt=Tt.actionTabs)===null||Lt===void 0)?void 0:Lt.params),En(jt.choices)),un(!Jt);case 5:case"end":return Ht.stop()}},Nt)}));return function(){return Cn.apply(this,arguments)}}(),an=function(Nt,Lt){console.log(Nt.target.checked);var jt=Xt.map(function(Ae,Ht){return Object(u.a)(Object(u.a)({},Ae),{},{checked:Ht===Lt?Nt.target.checked:!1})});En(jt)},hn=function(){Zt({}),En([]),un(!1),Ot({type:"problemset/setActionTabs",payload:{}})};return h.a.createElement(A.a,{centered:!0,destroyOnClose:!0,visible:Tt.actionTabs.key==="SINGLE",title:"\u8BD5\u9898\u4F53\u9A8C",okText:Jt?"\u91CD\u65B0\u7B54\u9898":"\u63D0\u4EA4\u7B54\u6848",cancelText:"\u53D6\u6D88",width:708,onOk:Hn,onCancel:hn},h.a.createElement("div",null,h.a.createElement("div",{className:"c-light-primary mb5 font16"},"\u5355\u9009\u9898"),h.a.createElement(st.a,{value:$t==null?void 0:$t.name}),Xt==null?void 0:Xt.map(function(Cn,Nt){var Lt=Cn.is_answer,jt=Cn.checked,Ae=Cn.choice_text,Ht="";return Jt&&Lt&&(Ht=de.a.green),Jt&&!Lt&&jt&&(Ht=de.a.red),h.a.createElement("div",{key:Nt,style:{pointerEvents:Jt?"none":"auto"},className:"".concat(de.a.row," ").concat(Ht)},h.a.createElement(C.a,{onChange:function(nr){return an(nr,Nt)},checked:jt}),h.a.createElement("span",null,Zn[Nt],".\xA0"),h.a.createElement(st.a,{className:de.a.html,value:Ae}),Jt&&Lt&&h.a.createElement("span",{style:{paddingTop:4},className:"iconfont icon-duigou1 font16"}),Jt&&!Lt&&jt&&h.a.createElement("span",{style:{fontWeight:600,paddingTop:5},className:"iconfont icon-guanbi font16"}))}),Jt&&h.a.createElement(W.Fragment,null,h.a.createElement("div",{className:de.a.line}),h.a.createElement("div",{className:"c-grey-333 mb5"},h.a.createElement("b",null,"\u6B63\u786E\u7B54\u6848:\xA0"),Zn[Xt.findIndex(function(Cn){return Cn.is_answer})]),h.a.createElement("div",{className:"c-grey-333 mb10"},h.a.createElement("b",null,"\u89E3\u6790:\xA0"),($t==null?void 0:$t.analysis)||"\u6682\u65E0\u89E3\u6790"))))},vt=Object(N.a)(function(Wt){var lt=Wt.problemset;return{problemset:lt}})(qe),pt=function(lt){var Rt,Tt=lt.problemset,Ot=lt.dispatch,pn=Object(W.useState)({}),bn=Object(a.a)(pn,2),$t=bn[0],Zt=bn[1],wn=Object(W.useState)([]),fn=Object(a.a)(wn,2),Xt=fn[0],En=fn[1],Vn=Object(W.useState)(!1),$n=Object(a.a)(Vn,2),Jt=$n[0],un=$n[1],Zn=["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(W.useEffect)(function(){var Nt;if((Tt==null||((Nt=Tt.actionTabs)===null||Nt===void 0)?void 0:Nt.key)==="MULTIPLE"){var Lt,jt=Object(ot.cloneDeep)(Tt==null||((Lt=Tt.actionTabs)===null||Lt===void 0)?void 0:Lt.params);Zt(jt),En(jt.choices)}},[Tt==null||((Rt=Tt.actionTabs)===null||Rt===void 0)?void 0:Rt.key]);var Hn=function(){var Nt=Object(l.a)(j.a.mark(function Lt(){var jt,Ae;return j.a.wrap(function(Tn){for(;;)switch(Tn.prev=Tn.next){case 0:if(Xt.some(function(nr){return nr==null?void 0:nr.checked})){Tn.next=3;break}return d.b.warn("\u8BF7\u60A8\u4F5C\u7B54\u540E\u518D\u63D0\u4EA4"),Tn.abrupt("return");case 3:Jt&&(Ae=Object(ot.cloneDeep)(Tt==null||((jt=Tt.actionTabs)===null||jt===void 0)?void 0:jt.params),En(Ae.choices)),un(!Jt);case 5:case"end":return Tn.stop()}},Lt)}));return function(){return Nt.apply(this,arguments)}}(),an=function(Lt,jt){console.log(Lt.target.checked);var Ae=Xt.map(function(Ht,Tn){return Object(u.a)(Object(u.a)({},Ht),{},{checked:Tn===jt?Lt.target.checked:Ht.checked})});En(Ae)},hn=function(){Zt({}),En([]),un(!1),Ot({type:"problemset/setActionTabs",payload:{}})},Cn=function(){var Lt="";return Xt.forEach(function(jt,Ae){jt.is_answer&&(Lt=Lt+Zn[Ae])}),Lt};return h.a.createElement(A.a,{centered:!0,destroyOnClose:!0,visible:Tt.actionTabs.key==="MULTIPLE",title:"\u8BD5\u9898\u4F53\u9A8C",okText:Jt?"\u91CD\u65B0\u7B54\u9898":"\u63D0\u4EA4\u7B54\u6848",cancelText:"\u53D6\u6D88",width:708,onOk:Hn,onCancel:hn},h.a.createElement("div",null,h.a.createElement("div",{className:"c-light-primary mb5 font16"},"\u591A\u9009\u9898"),h.a.createElement(st.a,{value:$t==null?void 0:$t.name}),Xt==null?void 0:Xt.map(function(Nt,Lt){var jt=Nt.is_answer,Ae=Nt.checked,Ht=Nt.choice_text,Tn="";return Jt&&jt&&(Tn=de.a.green),Jt&&!jt&&Ae&&(Tn=de.a.red),h.a.createElement("div",{key:Lt,style:{pointerEvents:Jt?"none":"auto"},className:"".concat(de.a.row," ").concat(Tn)},h.a.createElement(s.a,{style:{padding:3},onChange:function(Gt){return an(Gt,Lt)},checked:Ae}),h.a.createElement("span",null,Zn[Lt],".\xA0"),h.a.createElement(st.a,{className:de.a.html,value:Ht}),Jt&&jt&&h.a.createElement("span",{style:{paddingTop:4},className:"iconfont icon-duigou1 font16"}),Jt&&!jt&&Ae&&h.a.createElement("span",{style:{fontWeight:600,paddingTop:5},className:"iconfont icon-guanbi font16"}))}),Jt&&h.a.createElement(W.Fragment,null,h.a.createElement("div",{className:de.a.line}),h.a.createElement("div",{className:"c-grey-333 mb5"},h.a.createElement("b",null,"\u6B63\u786E\u7B54\u6848:\xA0"),Cn()),h.a.createElement("div",{className:"c-grey-333 mb10"},h.a.createElement("b",null,"\u89E3\u6790:\xA0"),($t==null?void 0:$t.analysis)||"\u6682\u65E0\u89E3\u6790"))))},gt=Object(N.a)(function(Wt){var lt=Wt.problemset;return{problemset:lt}})(pt),Be=function(lt){var Rt,Tt,Ot=lt.problemset,pn=lt.dispatch,bn=Object(W.useState)({}),$t=Object(a.a)(bn,2),Zt=$t[0],wn=$t[1],fn=Object(W.useState)([]),Xt=Object(a.a)(fn,2),En=Xt[0],Vn=Xt[1],$n=Object(W.useState)(!1),Jt=Object(a.a)($n,2),un=Jt[0],Zn=Jt[1],Hn=["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(W.useEffect)(function(){var Nt;if((Ot==null||((Nt=Ot.actionTabs)===null||Nt===void 0)?void 0:Nt.key)==="JUDGMENT"){var Lt,jt=Object(ot.cloneDeep)(Ot==null||((Lt=Ot.actionTabs)===null||Lt===void 0)?void 0:Lt.params);wn(jt),Vn(jt.choices)}},[Ot==null||((Rt=Ot.actionTabs)===null||Rt===void 0)?void 0:Rt.key]);var an=function(){var Nt=Object(l.a)(j.a.mark(function Lt(){var jt,Ae;return j.a.wrap(function(Tn){for(;;)switch(Tn.prev=Tn.next){case 0:if(En.some(function(nr){return nr==null?void 0:nr.checked})){Tn.next=3;break}return d.b.warn("\u8BF7\u60A8\u4F5C\u7B54\u540E\u518D\u63D0\u4EA4"),Tn.abrupt("return");case 3:un&&(Ae=Object(ot.cloneDeep)(Ot==null||((jt=Ot.actionTabs)===null||jt===void 0)?void 0:jt.params),Vn(Ae.choices)),Zn(!un);case 5:case"end":return Tn.stop()}},Lt)}));return function(){return Nt.apply(this,arguments)}}(),hn=function(Lt,jt){console.log(Lt.target.checked);var Ae=En.map(function(Ht,Tn){return Object(u.a)(Object(u.a)({},Ht),{},{checked:Tn===jt?Lt.target.checked:!1})});Vn(Ae)},Cn=function(){wn({}),Vn([]),Zn(!1),pn({type:"problemset/setActionTabs",payload:{}})};return h.a.createElement(A.a,{centered:!0,destroyOnClose:!0,visible:Ot.actionTabs.key==="JUDGMENT",title:"\u8BD5\u9898\u4F53\u9A8C",okText:un?"\u91CD\u65B0\u7B54\u9898":"\u63D0\u4EA4\u7B54\u6848",cancelText:"\u53D6\u6D88",width:708,onOk:an,onCancel:Cn},h.a.createElement("div",null,h.a.createElement("div",{className:"c-light-primary mb5 font16"},"\u5224\u65AD\u9898"),h.a.createElement(st.a,{value:Zt==null?void 0:Zt.name}),En==null?void 0:En.map(function(Nt,Lt){var jt=Nt.is_answer,Ae=Nt.checked,Ht=Nt.choice_text,Tn="";return un&&jt&&(Tn=de.a.green),un&&!jt&&Ae&&(Tn=de.a.red),h.a.createElement("div",{key:Lt,style:{pointerEvents:un?"none":"auto"},className:"".concat(de.a.row," ").concat(Tn)},h.a.createElement(C.a,{onChange:function(Gt){return hn(Gt,Lt)},checked:Ae}),h.a.createElement(st.a,{className:de.a.html,value:Ht}),un&&jt&&h.a.createElement("span",{style:{paddingTop:4},className:"iconfont icon-duigou1 font16"}),un&&!jt&&Ae&&h.a.createElement("span",{style:{fontWeight:600,paddingTop:5},className:"iconfont icon-guanbi font16"}))}),un&&h.a.createElement(W.Fragment,null,h.a.createElement("div",{className:de.a.line}),h.a.createElement("div",{className:"c-grey-333 mb5"},h.a.createElement("b",null,"\u6B63\u786E\u7B54\u6848:\xA0"),(Tt=En.find(function(Nt){return Nt.is_answer}))===null||Tt===void 0?void 0:Tt.choice_text),h.a.createElement("div",{className:"c-grey-333 mb10"},h.a.createElement("b",null,"\u89E3\u6790:\xA0"),(Zt==null?void 0:Zt.analysis)||"\u6682\u65E0\u89E3\u6790"))))},Ct=Object(N.a)(function(Wt){var lt=Wt.problemset;return{problemset:lt}})(Be),yt=function(lt){var Rt,Tt,Ot=lt.problemset,pn=lt.dispatch,bn=Object(W.useState)({}),$t=Object(a.a)(bn,2),Zt=$t[0],wn=$t[1],fn=Object(W.useState)([]),Xt=Object(a.a)(fn,2),En=Xt[0],Vn=Xt[1],$n=Object(W.useState)(!1),Jt=Object(a.a)($n,2),un=Jt[0],Zn=Jt[1],Hn=["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(W.useEffect)(function(){var Nt;if((Ot==null||((Nt=Ot.actionTabs)===null||Nt===void 0)?void 0:Nt.key)==="COMPLETION"){var Lt,jt,Ae=Object(ot.cloneDeep)(Ot==null||((Lt=Ot.actionTabs)===null||Lt===void 0)?void 0:Lt.params);wn(Ae),Vn(Ae==null||((jt=Ae.standard_answer)===null||jt===void 0)?void 0:jt.map(function(Ht){return{value:"",answer:(Ht==null?void 0:Ht.answer_text)||[]}}))}},[Ot==null||((Rt=Ot.actionTabs)===null||Rt===void 0)?void 0:Rt.key]);var an=function(){var Nt=Object(l.a)(j.a.mark(function Lt(){var jt,Ae,Ht;return j.a.wrap(function(nr){for(;;)switch(nr.prev=nr.next){case 0:if(!En.some(function(Gt){return(Gt==null?void 0:Gt.value)===""})){nr.next=3;break}return d.b.warn("\u8BF7\u60A8\u4F5C\u7B54\u540E\u518D\u63D0\u4EA4"),nr.abrupt("return");case 3:un&&(Ht=Object(ot.cloneDeep)(Ot==null||((jt=Ot.actionTabs)===null||jt===void 0)?void 0:jt.params),Vn(Ht==null||((Ae=Ht.standard_answer)===null||Ae===void 0)?void 0:Ae.map(function(Gt){return{value:"",answer:(Gt==null?void 0:Gt.answer_text)||[]}}))),Zn(!un);case 5:case"end":return nr.stop()}},Lt)}));return function(){return Nt.apply(this,arguments)}}(),hn=function(Lt,jt){var Ae=En.map(function(Ht,Tn){return Object(u.a)(Object(u.a)({},Ht),{},{value:Tn===jt?Lt.target.value:Ht.value})});Vn(Ae)},Cn=function(){wn({}),Vn([]),Zn(!1),pn({type:"problemset/setActionTabs",payload:{}})};return h.a.createElement(A.a,{centered:!0,destroyOnClose:!0,visible:Ot.actionTabs.key==="COMPLETION",title:"\u8BD5\u9898\u4F53\u9A8C",okText:un?"\u91CD\u65B0\u7B54\u9898":"\u63D0\u4EA4\u7B54\u6848",cancelText:"\u53D6\u6D88",width:708,onOk:an,onCancel:Cn},h.a.createElement("div",null,h.a.createElement("div",{className:"c-light-primary mb5 font16"},"\u586B\u7A7A\u9898"),h.a.createElement(st.a,{value:Zt==null?void 0:Zt.name}),En==null?void 0:En.map(function(Nt,Lt){var jt=Nt.value,Ae=Nt.answer,Ht="";return un&&Ae!==null&&Ae!==void 0&&Ae.includes(jt)&&(Ht=de.a.green),un&&!(Ae!=null&&Ae.includes(jt))&&(Ht=de.a.red),h.a.createElement("div",{key:Lt,style:{pointerEvents:un?"none":"auto",marginTop:10},className:"".concat(de.a.row," ").concat(Ht)},h.a.createElement("div",{style:{minWidth:80}},"\u586B\u7A7A",Lt+1,"\u7B54\u6848:"),h.a.createElement(v.a.TextArea,{className:de.a.textArea,style:{width:610,marginRight:10},onChange:function(nr){return hn(nr,Lt)},value:jt}),un&&(Ae==null?void 0:Ae.includes(jt))&&h.a.createElement("span",{style:{paddingTop:4},className:"iconfont icon-duigou1 font16"}),un&&!(Ae!=null&&Ae.includes(jt))&&h.a.createElement("span",{style:{fontWeight:600,paddingTop:5},className:"iconfont icon-guanbi font16"}))}),un&&h.a.createElement(W.Fragment,null,h.a.createElement("div",{className:de.a.line}),Zt==null||((Tt=Zt.standard_answer)===null||Tt===void 0)?void 0:Tt.map(function(Nt,Lt){var jt;return h.a.createElement("div",{className:"c-grey-333 mb5"},h.a.createElement("b",null,"\u586B\u7A7A",Lt+1,"\u7B54\u6848:\xA0"),(Nt==null||((jt=Nt.answer_text)===null||jt===void 0)?void 0:jt.join("\u3001"))||"")}),h.a.createElement("div",{className:"c-grey-333 mb10"},h.a.createElement("b",null,"\u89E3\u6790:\xA0"),(Zt==null?void 0:Zt.analysis)||"\u6682\u65E0\u89E3\u6790"))))},He=Object(N.a)(function(Wt){var lt=Wt.problemset;return{problemset:lt}})(yt),rt=F("SAoR"),me=F("tK3L"),se=F.n(me),be=F("bbsP"),te=F("/wGt"),oe=F("IPdS"),ce=F.n(oe),_e=[],je=function(lt){_e.forEach(function(Rt){if(lt.target===Rt.element||Xe.isParent(lt.target,Rt.element))return;Rt.callbacks.forEach(function(Tt){return Tt()})})};window.document.body?window.document.body.addEventListener("click",je):window.addEventListener("DOMContentLoaded",function(){window.document.body.addEventListener("click",je)});var Xe={isParent:function(lt,Rt){for(var Tt=lt;Tt&&Tt.tagName&&Tt.tagName.toLowerCase()!=="body";){if(Tt===Rt)return!0;Tt=Tt.parentNode}return!1},init:function(lt,Rt){var Tt=_e.filter(function(Ot){return Ot.element===lt});return Tt.length>0?Tt[0].callbacks.push(Rt):_e.push({element:lt,callbacks:[Rt]}),{clear:function(){_e=_e.filter(function(pn){return pn.element!==lt})}}}},Ze=Xe,_t=[{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"}],It=function(lt){var Rt=lt.visible,Tt=lt.basketData,Ot=lt.basketTotal,pn=lt.onClose,bn=pn===void 0?function(){}:pn,$t=lt.onDelete,Zt=$t===void 0?function(){}:$t,wn=Object(W.useRef)(),fn=Object(W.useRef)();return Object(W.useEffect)(function(){return fn.current?(Ot>=0&&!wn.current&&(wn.current=Ze.init(fn.current,function(){bn()})),function(){wn.current&&wn.current.clear()}):void 0},[fn.current]),h.a.createElement(te.a,{className:ce.a.drawerWrap,placement:"right",closable:!1,mask:!1,visible:Rt,forceRender:!0,onClose:bn},Ot>0?h.a.createElement("div",{style:{height:"100%"},ref:fn},h.a.createElement("div",{className:ce.a.title},"\u8BD5\u9898\u7BEE"),_t.map(function(Xt){return Tt[Xt.stateName]>0&&h.a.createElement("div",{className:ce.a.problemset,key:Xt.type},h.a.createElement("div",{className:ce.a.content},Xt.typeName,"(",Tt[Xt.stateName],")"),h.a.createElement("div",{className:ce.a.delete,onClick:function(){return Zt(Xt.type)}},h.a.createElement("i",{className:"iconfont icon-shanchu1 ".concat(ce.a.deleteIcon)})))}),h.a.createElement("div",{className:ce.a.previewWrap},h.a.createElement("div",{className:ce.a.preview,onClick:function(){return N.d.push("/problemset/preview")}},"\u8BD5\u5377\u9884\u89C8"))):h.a.createElement("div",{ref:fn},h.a.createElement(re.a,{customText:"\u8BF7\u9009\u62E9\u8BD5\u9898\u8FDB\u884C\u7EC4\u5377"})))},$e={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"},Qt=function(lt){var Rt,Tt,Ot=lt.problemset,pn=lt.globalSetting,bn=lt.loading,$t=lt.dispatch,Zt=lt.onReloadData,wn=Zt===void 0?function(){}:Zt,fn=lt.onReloadBasketData,Xt=fn===void 0?function(){}:fn,En=Object(i.a)(lt,["problemset","globalSetting","loading","dispatch","onReloadData","onReloadBasketData"]),Vn=function(){var $n=Object(l.a)(j.a.mark(function Jt(){var un;return j.a.wrap(function(Hn){for(;;)switch(Hn.prev=Hn.next){case 0:return Hn.next=2,$t({type:"problemset/basketDelete",payload:Ot.actionTabs.params});case 2:un=Hn.sent,$t({type:"problemset/setActionTabs",payload:{}}),un.status===0&&(wn(),Xt());case 5:case"end":return Hn.stop()}},Jt)}));return function(){return $n.apply(this,arguments)}}();return h.a.createElement(A.a,{centered:!0,keyboard:!1,closable:!1,destroyOnClose:!0,visible:Ot.actionTabs.key==="Problemset-BasketDelete",title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",confirmLoading:bn["problemset/handleDelete"],width:"442px",onOk:Vn,onCancel:function(){$t({type:"problemset/setActionTabs",payload:{}})}},h.a.createElement("div",{className:de.a.modalContent},"\u662F\u5426\u5220\u9664\u8BD5\u9898\u7BEE\u4E2D",$e[(Rt=Ot.actionTabs)===null||Rt===void 0||((Tt=Rt.params)===null||Tt===void 0)?void 0:Tt.type]))},Bt=Object(N.a)(function(Wt){var lt=Wt.problemset,Rt=Wt.loading,Tt=Wt.globalSetting;return{problemset:lt,globalSetting:Tt,loading:Rt.effects}})(Qt),Pt=F("A60/"),mn=F.n(Pt),xn=function(lt){var Rt=lt.count,Tt=lt.visibleBasket,Ot=lt.onToggleVisible,pn=Ot===void 0?function(){}:Ot;return h.a.createElement("div",{className:"".concat(Tt?mn.a.right180:mn.a.right20," ").concat(mn.a.wrap)},h.a.createElement(w.a,{title:"\u8BD5\u9898\u7BEE",placement:"left"},h.a.createElement("div",{className:mn.a.basket,onClick:pn},Rt>0&&h.a.createElement("div",{className:mn.a.count},Rt),h.a.createElement("span",{className:mn.a.iconWrap},h.a.createElement("i",{className:"".concat(mn.a.icon," iconfont icon-shitilan")})),h.a.createElement("p",{className:mn.a.name},"\u8BD5\u9898\u7BEE"))))},er=F("EJTS"),Qn=F("LE3n"),nn=F("1vsH"),ur=F("xKgJ"),hr=F("/zsF"),vr=F("PArb"),ca=F("jCWc"),mr=F("kPKH"),Da=F("y8nQ"),Rr=F("Vl3Y"),fa=F("nSDg"),tr=F.n(fa),dr=F("HBuW"),Ut=F("NLgs"),ra=F("vkP9"),Ua=v.a.Search,Hr={id:"type",name:"\u6765\u6E90",children:[{name:"\u5168\u90E8",id:"all",type:"type"},{name:"\u6211\u7684",id:"mine",type:"type"}]},Kn={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"}]},ja=function(lt){var Rt,Tt,Ot,pn,bn=lt.classroomList,$t=lt.loading,Zt=lt.dispatch,wn=lt.cb,fn=lt.shixunIds,Xt=fn===void 0?[]:fn,En=Object(Le.i)(),Vn=Object(Le.h)(),$n=bn.actionTabs,Jt=Rr.a.useForm(),un=Object(a.a)(Jt,1),Zn=un[0],Hn=bn.shixunLists,an=Object(W.useState)([]),hn=Object(a.a)(an,2),Cn=hn[0],Nt=hn[1],Lt=Object(W.useState)([]),jt=Object(a.a)(Lt,2),Ae=jt[0],Ht=jt[1],Tn=Object(W.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}),nr=Object(a.a)(Tn,2),Gt=nr[0],Xr=nr[1];Object(W.useEffect)(function(){bn.actionTabs.key==="\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"&&Zt({type:"classroomList/getShixunLists",payload:Object(u.a)({},Gt)})},[bn.actionTabs.key]),Object(W.useEffect)(function(){return document.body.setAttribute("data-custom","height"),function(){document.body.removeAttribute("data-custom")}},[]),Object(W.useEffect)(function(){Pa()},[En]);var Pa=function(){var St=Object(l.a)(j.a.mark(function rr(){var vn;return j.a.wrap(function(yr){for(;;)switch(yr.prev=yr.next){case 0:return yr.next=2,Object(dr.pb)({});case 2:vn=yr.sent,Ht((vn==null?void 0:vn.disciplines)||[]);case 4:case"end":return yr.stop()}},rr)}));return function(){return St.apply(this,arguments)}}(),zr=function(rr,vn,Rn){Gt.tag_level=rr,Gt.sub_discipline_id=vn,Gt.discipline_id=Rn,Xr(Object(u.a)({},Gt)),Zt({type:"classroomList/getShixunLists",payload:Object(u.a)({},Gt)})},dn=function(){Zt({type:"classroomList/setActionTabs",payload:{}}),Xr({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 bn.actionTabs.key!=="\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"?null:h.a.createElement(te.a,{placement:"bottom",height:"100%",closable:!0,onClose:dn,visible:bn.actionTabs.key==="\u9009\u7528\u5B9E\u8DF5\u9879\u76EE",key:"bottom",className:tr.a.drawer,footer:h.a.createElement("div",{className:"tc"},h.a.createElement(P.a,{size:"large",onClick:function(){dn(),Nt([])},style:{marginRight:8}},"\u53D6\u6D88"),h.a.createElement(P.a,{size:"large",onClick:Object(l.a)(j.a.mark(function St(){var rr,vn,Rn;return j.a.wrap(function(kr){for(;;)switch(kr.prev=kr.next){case 0:rr=function(Sr){var Ir=Cn[Sr];if(Xt.includes(Ir)){var Sa,Nr;return d.b.info("\u8BF7\u52FF\u91CD\u590D\u9009\u62E9\uFF1A".concat(Hn==null||((Sa=Hn.shixun_list)===null||Sa===void 0||((Nr=Sa.find(function(oi){return oi.id===Ir}))===null||Nr===void 0))?void 0:Nr.title)),{v:void 0}}},vn=0;case 2:if(!(vn<(Cn==null?void 0:Cn.length))){kr.next=9;break}if(Rn=rr(vn),!(typeof Rn=="object")){kr.next=6;break}return kr.abrupt("return",Rn.v);case 6:vn++,kr.next=2;break;case 9:dn(),wn(Cn),Nt([]);case 12:case"end":return kr.stop()}},St)})),type:"primary"},"\u786E\u5B9A"))},h.a.createElement("section",{className:"tc"},h.a.createElement(ra.a,{onChange:function(rr){Xr(Object(u.a)(Object(u.a)(Object(u.a)({},Gt),rr),{},{page:1})),Zt({type:"classroomList/getShixunLists",payload:Object(u.a)(Object(u.a)(Object(u.a)({},Gt),rr),{},{page:1})})}})),h.a.createElement("section",{className:"edu-container"},h.a.createElement("ul",{className:tr.a.menu},h.a.createElement("li",null,Hr.name),Hr==null||((Rt=Hr.children)===null||Rt===void 0)?void 0:Rt.map(function(St,rr){return h.a.createElement("li",{className:Gt[Hr.id]==St.id?tr.a.actived:"",key:St.id,onClick:function(){Gt[Hr.id]=St.id,Xr(Object(u.a)({},Gt)),Zt({type:"classroomList/getShixunLists",payload:Object(u.a)({},Gt)})}},h.a.createElement("strong",null,St.name))})),h.a.createElement("ul",{className:tr.a.menuDirection},h.a.createElement("li",{className:tr.a.directionName},"\u65B9\u5411"),h.a.createElement("li",{className:Gt.discipline_id?"":tr.a.actived,onClick:function(){zr(null,null,null)}},h.a.createElement("strong",null,"\u5168\u90E8")),Ae==null?void 0:Ae.map(function(St,rr){return h.a.createElement("li",{key:rr,className:Gt.discipline_id==St.id?tr.a.actived:""},h.a.createElement("strong",{onClick:function(){zr(1,null,St.id)}},St.name),h.a.createElement("div",null,St.sub_disciplines.map(function(vn,Rn){return h.a.createElement("div",{key:Rn,className:"mt5"},h.a.createElement("div",{className:Gt.sub_discipline_id==vn.id?"".concat(tr.a.actived2," ").concat(tr.a.subTag):tr.a.subTag,onClick:function(){zr(2,vn.id,St.id)}},vn.name),h.a.createElement("ul",{className:"mt5"},vn.tags&&vn.tags.map(function(yr,kr){return h.a.createElement("li",{key:kr,className:Gt.sub_discipline_id==yr.id&&Gt.tag_level===3?tr.a.actived2:"",onClick:function(){zr(3,yr.id,St.id)}},yr.name)})))})))})),h.a.createElement("ul",{className:tr.a.menu},h.a.createElement("li",null,Kn.name),Kn==null||((Tt=Kn.children)===null||Tt===void 0)?void 0:Tt.map(function(St,rr){return h.a.createElement("li",{className:Gt[Kn.id]==St.id?tr.a.actived:"",key:St.name,onClick:function(){Gt[Kn.id]=St.id,Xr(Object(u.a)({},Gt)),Zt({type:"classroomList/getShixunLists",payload:Object(u.a)({},Gt)})}},h.a.createElement("strong",null,St.name))})),h.a.createElement(G.a,null,h.a.createElement(mr.a,{flex:"1"},h.a.createElement("div",{className:tr.a.menuCourse,style:{margin:"0px 15px"}},h.a.createElement("ul",null,h.a.createElement("li",null,"\u5DF2\u9009",h.a.createElement("span",{className:"c-blue"},Cn.length),"\u4E2A\u5B9E\u8BAD"),h.a.createElement("li",null,"\u5171",h.a.createElement("span",{className:"c-blue"},Hn.shixuns_count),"\u4E2A\u8BFE\u7A0B"),h.a.createElement("li",{className:"current",onClick:function(){var rr=Object(u.a)(Object(u.a)({},Gt),{},{order:Gt.order==="asc"?"desc":"asc"});Xr(rr),Zt({type:"classroomList/getShixunLists",payload:rr})}},"\u5B66\u4E60\u4EBA\u6570",h.a.createElement("p",{className:"edu-sorter current ".concat(Gt.order)},Gt.order==="asc"?h.a.createElement("span",{className:"iconfont icon-sanjiaoxing-up"}):h.a.createElement("span",{className:"iconfont icon-sanjiaoxing-down"})))))),h.a.createElement(mr.a,{className:"c-grey-999"},"\u4EC5\u5DF2\u53D1\u5E03\u7684\u5B9E\u8BAD\u8FDB\u5165\u672C\u5217\u8868\u5907\u9009")),Hn==null||((Ot=Hn.shixun_list)===null||Ot===void 0)?void 0:Ot.map(function(St,rr){return h.a.createElement("div",{className:tr.a.listItem,key:rr},h.a.createElement(s.a,{checked:Cn.includes(St.id),value:St.id,disabled:St==null?void 0:St.need_authorize,onChange:function(Rn){var yr=Cn.indexOf(St.id);Cn.indexOf(St.id)>-1?Nt(Cn.filter(function(kr){return kr!==St.id})):Nt(Cn.concat(St.id))}}),h.a.createElement("div",{className:tr.a.info},h.a.createElement("div",{className:tr.a.title},h.a.createElement("div",{className:tr.a.titleLeft},h.a.createElement("a",{className:"c-black",href:"/shixuns/".concat(St==null?void 0:St.identifier,"/challenges"),target:"_blank"},h.a.createElement("strong",{className:"font16",dangerouslySetInnerHTML:{__html:St.title}})),(St==null?void 0:St.need_authorize)&&h.a.createElement("span",{onClick:function(){Object(Ut.a)(!1)},style:{marginRight:"auto"},className:"tag-style bg-pink current ml10"},"\u9700\u6388\u6743"),Object(ur.v)()&&(St==null?void 0:St.mark_status)===1&&h.a.createElement(w.a,{title:St==null?void 0:St.mark_content},h.a.createElement("span",{style:{marginRight:"auto",background:"#2FA34F"},className:"tag-style current ml10"},"\u6B63\u5E38")),Object(ur.v)()&&(St==null?void 0:St.mark_status)===2&&h.a.createElement(w.a,{title:St==null?void 0:St.mark_content},h.a.createElement("span",{style:{marginRight:"auto",background:"#FF8C29"},className:"tag-style current ml10"},"\u9700\u5B8C\u5584")),Object(ur.v)()&&(St==null?void 0:St.mark_status)===3&&h.a.createElement(w.a,{title:St==null?void 0:St.mark_content},h.a.createElement("span",{style:{marginRight:"auto",background:"#E53333"},className:"tag-style current ml10"},"\u65E0\u6CD5\u4F7F\u7528")))),h.a.createElement("div",{className:"flex-wrp mt10 font14 c-light-black"},h.a.createElement("span",{className:tr.a.description,dangerouslySetInnerHTML:{__html:St.description}})),h.a.createElement("div",{className:" mt15"},St.challenge_names.map(function(vn,Rn){return h.a.createElement("span",{key:Rn,className:"mr30 font12"},"\u7B2C",Rn+1,"\u5173 ",vn," ")})),h.a.createElement(vr.a,{dashed:!0}),h.a.createElement("div",{className:"c-light-black mt20 font12"},h.a.createElement("span",null,St.author_name),h.a.createElement("span",{className:"ml15 mr15"},"|"),h.a.createElement("span",null,St.author_school_name),h.a.createElement("span",{className:"ml15 mr15"},"|"),h.a.createElement("span",null,"\u96BE\u5EA6\u7CFB\u6570 ",St.level),h.a.createElement("span",{className:"ml15 mr15"},"|"),h.a.createElement("span",null,"\u5B66\u4E60\u4EBA\u6570 "),h.a.createElement("span",null,St.study_count))))}),(Hn==null||((pn=Hn.shixun_list)===null||pn===void 0)?void 0:pn.length)===0&&h.a.createElement(re.a,null),h.a.createElement("p",null)),h.a.createElement("div",{className:"tc mt20"},h.a.createElement(K.a,{defaultCurrent:1,hideOnSinglePage:!0,defaultPageSize:10,showSizeChanger:!1,current:Gt.page||1,showQuickJumper:!0,total:Hn==null?void 0:Hn.shixuns_count,onChange:function(rr){var vn=Object(u.a)(Object(u.a)({},Gt),{},{page:rr});Xr(vn),Zt({type:"classroomList/getShixunLists",payload:vn})}})))},ri=Object(N.a)(function(Wt){var lt=Wt.classroomList,Rt=Wt.loading;return{classroomList:lt,loading:Rt}})(ja),Aa=F("ErOA"),ct=F("ORt/"),rn=F.n(ct),Ha=F("Ot1p"),Za=function(lt,Rt){var Tt,Ot=lt.data,pn=Rr.a.useForm(),bn=Object(a.a)(pn,1),$t=bn[0],Zt=Object(W.useState)({}),wn=Object(a.a)(Zt,2),fn=wn[0],Xt=wn[1];return Object(W.useEffect)(function(){Ot&&(Xt(Ot),$t.setFieldsValue(Object(u.a)({},Ot)))},[Ot]),Object(W.useImperativeHandle)(Rt,function(){return{form:$t}}),h.a.createElement("div",{className:rn.a.operating},h.a.createElement(Rr.a,{form:$t,scrollToFirstError:!0,onValuesChange:function(){Xt(Object(u.a)({},$t.getFieldsValue()))}},h.a.createElement(Rr.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"}]},h.a.createElement(v.a,{placeholder:"\u8BF7\u8F93\u5165\u6807\u9898\uFF0C\u6700\u5927\u9650\u523630\u4E2A\u5B57\u7B26",suffix:"".concat(((Tt=fn.name)===null||Tt===void 0?void 0:Tt.length)||0,"/30")})),h.a.createElement(Rr.a.Item,{name:"languages",label:"\u7F16\u7A0B\u8BED\u8A00",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u7F16\u7A0B\u8BED\u8A00"}]},h.a.createElement(s.a.Group,null,h.a.createElement(s.a,{value:"c"},"C"),h.a.createElement(s.a,{value:"c++"},"C++"),h.a.createElement(s.a,{value:"java"},"Java"),h.a.createElement(s.a,{value:"python"},"Python"))),h.a.createElement("div",{className:rn.a.tip},"\u9009\u62E9\u652F\u6301\u4EE5\u4E0B\u7F16\u7A0B\u8BD5\u9898\u8FDB\u884C\u7F16\u8BD1\u7684\u8BED\u8A00"),h.a.createElement("div",{style:{margin:"20px 0 12px 0px"}},"\u8BF4\u660E"),h.a.createElement(Rr.a.Item,{name:"description"},h.a.createElement(Ha.a,{defaultValue:fn.description||"",watch:!0}))))},ai=Object(W.forwardRef)(Za),Ja=F("SVaM"),_i=F("sesT"),ln=F.n(_i),Mi=F("wNkr"),Qi=F.n(Mi),Ba=F("xTzM"),oa=F.n(Ba),ii=D.a.TabPane,xi=v.a.Search,bt=v.a.TextArea,gr;(function(Wt){Wt.Mine="0",Wt.Public="1",Wt.Collection="2",Wt.TeachGroupShare="3"})(gr||(gr={}));var Li=function(lt){var Rt,Tt,Ot,pn,bn,$t,Zt,wn,fn,Xt,En,Vn,$n=lt.classroomList,Jt=lt.problemset,un=lt.user,Zn=lt.globalSetting,Hn=lt.loading,an=lt.dispatch,hn=lt.match,Cn=lt.shixunHomeworks,Nt=Object(i.a)(lt,["classroomList","problemset","user","globalSetting","loading","dispatch","match","shixunHomeworks"]),Lt=Object(W.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:((Rt=Nt.location)===null||Rt===void 0||((Tt=Rt.query)===null||Tt===void 0)?void 0:Tt.id)||null,exam_id:(hn==null||((Ot=hn.params)===null||Ot===void 0)?void 0:Ot.id)||null,exercise_id:(hn==null||((pn=hn.params)===null||pn===void 0)?void 0:pn.categoryId)||null}),jt=Object(a.a)(Lt,2),Ae=jt[0],Ht=jt[1],Tn=Object(W.useState)(0),nr=Object(a.a)(Tn,2),Gt=nr[0],Xr=nr[1],Pa=Object(W.useState)([]),zr=Object(a.a)(Pa,2),dn=zr[0],St=zr[1],rr=Object(W.useState)(gr.Mine),vn=Object(a.a)(rr,2),Rn=vn[0],yr=vn[1],kr=Object(W.useState)(0),br=Object(a.a)(kr,2),Sr=br[0],Ir=br[1],Sa=Object(W.useState)(-1),Nr=Object(a.a)(Sa,2),oi=Nr[0],Mt=Nr[1],cn=Object(W.useState)([]),Yt=Object(a.a)(cn,2),Un=Yt[0],Gn=Yt[1],cr=Object(W.useState)(!1),Mn=Object(a.a)(cr,2),Or=Mn[0],Ur=Mn[1],jn=Object(W.useState)([]),Oa=Object(a.a)(jn,2),ar=Oa[0],qr=Oa[1],Jn=Object(W.useState)(0),ha=Object(a.a)(Jn,2),si=ha[0],Ci=ha[1],So=Object(W.useState)(!1),ki=Object(a.a)(So,2),Ii=ki[0],Ni=ki[1],Yi=Object(W.useState)(!1),ro=Object(a.a)(Yi,2),ao=ro[0],Ti=ro[1],io=Object(W.useRef)(!1),Xo=Object(W.useRef)(""),za=Object(W.useRef)(),ba=Object(W.useRef)(),Qr=Object(W.useRef)(),fe=Object(W.useState)(),Te=Object(a.a)(fe,2),Oe=Te[0],ge=Te[1],Z=Object(W.useState)([]),ue=Object(a.a)(Z,2),$=ue[0],pe=ue[1],Ee=Object(W.useRef)(!1),Se=(hn==null?void 0:hn.url)==="/problemset",xe=hn==null||((bn=hn.url)===null||bn===void 0)?void 0:bn.includes("program_homework"),Re=xe&&hn!==null&&hn!==void 0&&($t=hn.params)!==null&&$t!==void 0&&$t.categoryId&&hn!==null&&hn!==void 0&&(Zt=hn.url)!==null&&Zt!==void 0&&Zt.includes("edit")?hn==null||((wn=hn.params)===null||wn===void 0)?void 0:wn.categoryId:"",Qe=Re?"\u7F16\u8F91\u7F16\u7A0B\u4F5C\u4E1A":"\u65B0\u5EFA\u7F16\u7A0B\u4F5C\u4E1A",mt=Object(W.useState)({}),ft=Object(a.a)(mt,2),At=ft[0],on=ft[1],On=Object(W.useState)(!1),gn=Object(a.a)(On,2),_n=gn[0],Sn=gn[1],yn=un.userInfo||{},An=yn.admin,zn=yn.business,Ln=yn.is_shixun_marker,xr=yn.is_teacher,kn=yn.user_identity,Vt=An||zn||Ln||xr||kn!=="\u5B66\u751F",qt=Object(W.useState)("\u6309\u66F4\u65B0\u65F6\u95F4\u964D\u5E8F"),In=Object(a.a)(qt,2),Wn=In[0],zt=In[1],Dn=Cn.commonHomeWorkAddDefaultData,Cr=Object(W.useState)([]),Xn=Object(a.a)(Cr,2),fr=Xn[0],ir=Xn[1],jr=Object(W.useRef)(null),Yr=Object(W.useState)(!1),Tr=Object(a.a)(Yr,2),sa=Tr[0],Ea=Tr[1],ma=Object(W.useState)([]),Gr=Object(a.a)(ma,2),en=Gr[0],Yn=Gr[1],wr=Object(W.useState)(""),Er=Object(a.a)(wr,2),Ra=Er[0],qa=Er[1],ei=Object(W.useState)(!1),sr=Object(a.a)(ei,2),Fa=sr[0],Ga=sr[1],or=Object(W.useRef)(null),qn=[{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(W.useEffect)(function(){return document.body.setAttribute("data-custom","initial"),function(){document.body.removeAttribute("data-custom")}},[]);var $r=function(){var Fe=Object(l.a)(j.a.mark(function Ke(){var We,et,it;return j.a.wrap(function(Et){for(;;)switch(Et.prev=Et.next){case 0:return Et.next=2,Object(De.q)({id:Re});case 2:We=Et.sent,We!=null&&We.name&&(it={description:We.description,languages:We.languages,name:We.name},or.current.form.setFieldsValue(it),on(Object(u.a)({},it)),Yn(Object(x.a)(We.data)),pe((et=We.data)===null||et===void 0?void 0:et.map(function(ut){return ut.id})));case 4:case"end":return Et.stop()}},Ke)}));return function(){return Fe.apply(this,arguments)}}();Object(W.useEffect)(function(){Re&&$r()},[Re]),Object(W.useEffect)(function(){var Fe;an({type:"problemset/getDisciplines",payload:{source:"question"}});var Ke=((Fe=Nt.location.query)===null||Fe===void 0?void 0:Fe.group_id)||0;Ae.group_id=Number(Ke),Ht(Ae),Dr(Ae).then(function(We){We!=null&&We.status||ir(We==null?void 0:We.item_banks_group),Ea(!1)}),_a(),$i()},[]),Object(W.useEffect)(function(){return an({type:"globalSetting/onlyShowBackTopToggle",payload:!1}),an({type:"globalSetting/onlyShowBackTopIconToggle",payload:!1}),function(){an({type:"globalSetting/onlyShowBackTopToggle",payload:!0}),an({type:"globalSetting/onlyShowBackTopIconToggle",payload:!0})}},[]),Object(W.useEffect)(function(){return an({type:"globalSetting/headerFixedToggle",payload:!0}),function(){an({type:"globalSetting/headerFixedToggle",payload:!1})}},[]),Object(W.useEffect)(function(){return an({type:"globalSetting/headerFooterToggle",payload:Se}),function(){an({type:"globalSetting/headerFooterToggle",payload:!0})}},[]),Object(W.useEffect)(function(){Object(nn.Z)(xe?Qe:"\u8BD5\u9898\u5E93")},[xe,Qe]);var Oo=function(Ke,We){var et=[];if(!Ke){var it,tt;Jt==null||((it=Jt.disciplinesData)===null||it===void 0||((tt=it.disciplines)===null||tt===void 0))||tt.forEach(function(Lr){var ea;Lr==null||((ea=Lr.sub_disciplines)===null||ea===void 0)||ea.forEach(function(Ka){var eo;Ka==null||((eo=Ka.tag_disciplines)===null||eo===void 0)||eo.forEach(function($a){$a.name!=="\u672A\u5339\u914D\u77E5\u8BC6\u70B9"&&et.push($a)})})})}if(Ke&&!We){var Et,ut,Ft,Pn=Jt==null||((Et=Jt.disciplinesData)===null||Et===void 0||((ut=Et.disciplines)===null||ut===void 0))?void 0:ut.find(function(Lr){return Lr.id===Ke});Pn==null||((Ft=Pn.sub_disciplines)===null||Ft===void 0)||Ft.forEach(function(Lr){var ea;Lr==null||((ea=Lr.tag_disciplines)===null||ea===void 0)||ea.forEach(function(Ka){Ka.name!=="\u672A\u5339\u914D\u77E5\u8BC6\u70B9"&&et.push(Ka)})})}if(Ke&&We){var la,Nn,ga,Mr,Zr=Jt==null||((la=Jt.disciplinesData)===null||la===void 0||((Nn=la.disciplines)===null||Nn===void 0))?void 0:Nn.find(function(Lr){return Lr.id===Ke}),hi=Zr==null||((ga=Zr.sub_disciplines)===null||ga===void 0)?void 0:ga.find(function(Lr){return Lr.id===We});hi==null||((Mr=hi.tag_disciplines)===null||Mr===void 0)||Mr.forEach(function(Lr){Lr.name!=="\u672A\u5339\u914D\u77E5\u8BC6\u70B9"&&et.push(Lr)})}return et},$i=function(){var Fe=Object(l.a)(j.a.mark(function Ke(){return j.a.wrap(function(et){for(;;)switch(et.prev=et.next){case 0:an({type:"problemset/getTeachGroupData"});case 1:case"end":return et.stop()}},Ke)}));return function(){return Fe.apply(this,arguments)}}();Object(W.useEffect)(function(){var Fe=Jt.basketData||{},Ke=Fe.completion_questions_count,We=Ke===void 0?0:Ke,et=Fe.judgement_questions_count,it=et===void 0?0:et,tt=Fe.multiple_questions_count,Et=tt===void 0?0:tt,ut=Fe.practical_questions_count,Ft=ut===void 0?0:ut,Pn=Fe.program_questions_count,la=Pn===void 0?0:Pn,Nn=Fe.single_questions_count,ga=Nn===void 0?0:Nn,Mr=Fe.subjective_questions_count,Zr=Mr===void 0?0:Mr,hi=Fe.combination_questions_count,Lr=hi===void 0?0:hi,ea=We+it+Et+Ft+la+ga+Zr+Lr;Ci(ea)},[Jt.basketData]);var Dr=function(){var Fe=Object(l.a)(j.a.mark(function Ke(We){var et;return j.a.wrap(function(tt){for(;;)switch(tt.prev=tt.next){case 0:return We.item_type=xe?"PROGRAM":We.item_type,Ea(!0),tt.next=4,an({type:"problemset/getItemBanks",payload:We});case 4:if(et=tt.sent,!(et&&et.status!==403&&et.status!==401&&et.status!==500)){tt.next=16;break}return Xr(et.items_count||0),St(et.items||[]),Gn(et.tag_disciplines||[]),ge(et.used_shixun_ids||[]),Ui(et.items||[]),xe||pe([]),qr((et==null?void 0:et.navigation)||[]),Ir((et==null?void 0:et.added_num)||0),Ea(!1),tt.abrupt("return",et);case 16:case"end":return tt.stop()}},Ke)}));return function(We){return Fe.apply(this,arguments)}}(),_a=function(){an({type:"problemset/getBasketList",payload:{}})},Ui=function(Ke){var We=Ke.every(function(et){var it;return((it=et.program_attr)===null||it===void 0?void 0:it.status)===0});io.current=We},Zi=function(Ke,We){if(Ae.discipline_id=Ke||"",Ae.sub_discipline_id=We||"",Ae.tag_discipline_id="",Ae.page=1,Ae.per_page=20,delete Ae.id,Mt(Ke===null?-1:null),Ht(Ae),Dr(Ae),Ke===null)return},ji=function(Ke){Ae.item_type=Ke||"",Ae.page=1,Ae.per_page=20,Ht(Ae),Dr(Ae)},wo=function(Ke){Ae.difficulty=Ke||"",Ae.page=1,Ae.per_page=20,delete Ae.id,Ht(Ae),Dr(Ae)},Do=function(Ke){Ae.tag_discipline_id=Ke,Ae.page=1,Ae.per_page=20,delete Ae.id,Ke===-1&&(Ae.discipline_id="",Ae.sub_discipline_id="",Ae.tag_discipline_id=""),Mt(Ke),Ht(Ae),Dr(Ae)},oo=Object(W.useState)(!1),Bi=Object(a.a)(oo,2),Ji=Bi[0],li=Bi[1],vi=function(Ke){an({type:"problemset/getDisciplines",payload:{source:"question",group_id:0,group_type:Ke}}),Ae.discipline_id="",Ae.sub_discipline_id="",Ae.tag_discipline_id="",Ae.item_type=null,Ae.difficulty=null,Ae.type=Ke,Ke==="0"?Ae.group_id=0:Ae.group_id=null,Ke==="3"&&xe?Ae.only_published=!0:Ae.only_published=null,Ke==="3"?li(!0):li(!1),Ae.page=1,Ae.per_page=20,delete Ae.id,Mt(-1),yr(Ke),Ht(Ae),Dr(Ae)},so=function(Ke,We){Ae.page=Ke,Ae.per_page=We,Ht(Ae),Dr(Ae)},Ai=function(Ke){Ae.discipline_id="",Ae.sub_discipline_id="",Ae.tag_discipline_id="",Ae.item_type=null,Ae.difficulty=null,Ae.page=1,Ae.keyword=Ke,delete Ae.id,Ke?(Ti(!0),Object(Ja.a)({name:Ke,copywriting:Ke,position:xe?"Practice":"ItemBank"})):Ti(!1),Mt(-1),Ht(Ae),Dr(Ae)},_r=function(){Ae.per_page=20,Ht(Ae),Dr(Ae)},ui=function(Ke){var We=Ke.length===dn.length&&Ae.page>1?Ae.page-1:Ae.page;Ae.page=We,Ae.per_page=20,_a(),Ht(Ae),Dr(Ae)},gi=function(){an({type:"problemset/setActionTabs",payload:{key:"Problemset-PublicReview"}})},Ma=function(){var Fe=Object(l.a)(j.a.mark(function Ke(We,et){var it;return j.a.wrap(function(Et){for(;;)switch(Et.prev=Et.next){case 0:if(!et){Et.next=6;break}return Et.next=3,Object(De.n)({id:We});case 3:Et.t0=Et.sent,Et.next=9;break;case 6:return Et.next=8,Object(De.G)({id:We});case 8:Et.t0=Et.sent;case 9:it=Et.t0,(it==null?void 0:it.status)===0&&_r();case 11:case"end":return Et.stop()}},Ke)}));return function(We,et){return Fe.apply(this,arguments)}}(),di=function(){var Fe=Object(l.a)(j.a.mark(function Ke(We){return j.a.wrap(function(it){for(;;)switch(it.prev=it.next){case 0:xa(We);case 1:case"end":return it.stop()}},Ke)}));return function(We){return Fe.apply(this,arguments)}}(),ti=function(){var Fe=Object(l.a)(j.a.mark(function Ke(We){return j.a.wrap(function(it){for(;;)switch(it.prev=it.next){case 0:Pr([We]);case 1:case"end":return it.stop()}},Ke)}));return function(We){return Fe.apply(this,arguments)}}(),Si=function(Ke){ba.current="",za.current="",A.a.confirm({centered:!0,width:530,icon:null,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u8BD5\u9898\u7EA0\u9519",content:h.a.createElement("div",{className:"font14"},h.a.createElement("div",null,"\u9519\u8BEF\u7C7B\u578B\uFF1A"),h.a.createElement(C.a.Group,{className:"mt10",onChange:function(et){return za.current=et.target.value}},h.a.createElement(C.a,{value:"\u9898\u5E72"},"\u9898\u5E72"),h.a.createElement(C.a,{value:"\u7B54\u6848"},"\u7B54\u6848"),h.a.createElement(C.a,{value:"\u89E3\u6790"},"\u89E3\u6790"),h.a.createElement(C.a,{value:"\u5C5E\u6027"},"\u5C5E\u6027"),h.a.createElement(C.a,{value:"\u5176\u5B83"},"\u5176\u5B83")),h.a.createElement("div",{className:"mt10"},"\u9519\u8BEF\u63CF\u8FF0\uFF1A"),h.a.createElement(bt,{className:"mt10",rows:4,defaultValue:ba.current,onChange:function(et){return ba.current=et.target.value}})),onOk:function(){return new Promise(function(){var et=Object(l.a)(j.a.mark(function it(tt,Et){var ut;return j.a.wrap(function(Pn){for(;;)switch(Pn.prev=Pn.next){case 0:if(za.current&&ba.current){Pn.next=3;break}return d.b.info("\u8BF7\u586B\u5199\u9519\u8BEF\u7C7B\u578B\u548C\u9519\u8BEF\u63CF\u8FF0\uFF01"),Pn.abrupt("return",Et());case 3:return Pn.next=5,Object(De.o)({id:Ke,clazz:za.current,description:ba.current});case 5:ut=Pn.sent,ut.status===0&&d.b.info("\u6DFB\u52A0\u6210\u529F\uFF01"),tt();case 8:case"end":return Pn.stop()}},it)}));return function(it,tt){return et.apply(this,arguments)}}())}})},ci=function(Ke){an({type:"problemset/setActionTabs",payload:{key:"Problemset-SetPrivate",params:{id:Ke}}})},Fi=function(Ke){an({type:"problemset/setActionTabs",payload:{key:"Problemset-Delete",params:{id:Ke}}})},qi=function(){var Fe=Object(l.a)(j.a.mark(function Ke(We){var et,it,tt,Et;return j.a.wrap(function(Ft){for(;;)switch(Ft.prev=Ft.next){case 0:if(et=We.item_type,!(et==="PROGRAM")){Ft.next=12;break}return it=We.program_attr.identifier,Ft.next=5,an({type:"problemset/startExperience",payload:{id:it}});case 5:if(tt=Ft.sent,!(tt.status===0)){Ft.next=10;break}return Et=tt.identifier,Object(nn.U)("/myproblems/".concat(Et)),Ft.abrupt("return");case 10:return d.b.warn(tt.message),Ft.abrupt("return");case 12:an({type:"problemset/setActionTabs",payload:{key:et,params:We}});case 13:case"end":return Ft.stop()}},Ke)}));return function(We){return Fe.apply(this,arguments)}}(),Oi=function(){var Fe=Object(l.a)(j.a.mark(function Ke(We){var et,it,tt;return j.a.wrap(function(ut){for(;;)switch(ut.prev=ut.next){case 0:if(!Ae.exam_id){ut.next=6;break}return ut.next=3,Object(De.M)({item_id:We,id:Ae.exam_id});case 3:return et=ut.sent,et.status===0&&_r(),ut.abrupt("return");case 6:if(!(Ae!=null&&Ae.exercise_id)){ut.next=12;break}return ut.next=9,Object(Aa.a)("/api/exercise_questions/delete_by_item_bank.json ",{method:"post",body:{exercise_id:Ae==null?void 0:Ae.exercise_id,item_bank_ids:[We]}});case 9:return it=ut.sent,it.status===0&&_r(),ut.abrupt("return");case 12:return ut.next=14,an({type:"problemset/cancel",payload:{id:We,item_bank:1}});case 14:tt=ut.sent,tt.status===0&&(_r(),_a());case 16:case"end":return ut.stop()}},Ke)}));return function(We){return Fe.apply(this,arguments)}}(),Ki=function(){var Fe=Object(l.a)(j.a.mark(function Ke(We){return j.a.wrap(function(it){for(;;)switch(it.prev=it.next){case 0:an({type:"problemset/getDisciplines",payload:{source:"question",group_id:Math.abs(We),group_type:gr.Mine}}),Ae.page=1,Ae.per_page=20,Ae.group_id=Math.abs(We),Ht(Ae),Dr(Ae).then(function(tt){return ir(tt==null?void 0:tt.item_banks_group)});case 6:case"end":return it.stop()}},Ke)}));return function(We){return Fe.apply(this,arguments)}}(),Va=function(){var Fe=Object(l.a)(j.a.mark(function Ke(We){var et,it,tt;return j.a.wrap(function(ut){for(;;)switch(ut.prev=ut.next){case 0:if(!Ae.exam_id){ut.next=6;break}return ut.next=3,Object(De.t)({exam_id:Ae.exam_id,item_bank_ids:[We]});case 3:return et=ut.sent,et.status===0&&_r(),ut.abrupt("return");case 6:if(!(Ae!=null&&Ae.exercise_id)){ut.next=12;break}return ut.next=9,Object(Aa.a)("/api/exercises/".concat(Ae==null?void 0:Ae.exercise_id,"/select_questions.json"),{method:"post",body:{item_bank_ids:[We]}});case 9:return it=ut.sent,it.status===0&&_r(),ut.abrupt("return");case 12:if(!(si===200)){ut.next=15;break}return d.b.info("\u5DF2\u9009200\u4E2A\u8BD5\u9898\uFF08\u4E0D\u80FD\u5728\u9009\u7528\u66F4\u591A\u8BD5\u9898\uFF09"),ut.abrupt("return");case 15:return ut.next=17,an({type:"problemset/select",payload:{item_bank_ids:[We]}});case 17:tt=ut.sent,tt.status===0&&(_r(),_a());case 19:case"end":return ut.stop()}},Ke)}));return function(We){return Fe.apply(this,arguments)}}(),Xa=function(){var Fe=Object(l.a)(j.a.mark(function Ke(We){return j.a.wrap(function(it){for(;;)switch(it.prev=it.next){case 0:if(We){it.next=3;break}if($!=null&&$.length){it.next=3;break}return it.abrupt("return",d.b.info("\u8BF7\u5148\u9009\u62E9\u8BD5\u9898"));case 3:Qr.current=[0],A.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:h.a.createElement("div",{className:"font14 ".concat(se.a.overflow),style:{maxHeight:500,overflow:"auto"}},h.a.createElement("p",{className:"c-grey-333"},"\u8BF7\u9009\u62E9\u9700\u8981\u79FB\u52A8\u5230\u7684\u6587\u4EF6\u5939"),h.a.createElement(ie.a,{defaultValue:!0,value:Qr.current,onChange:function(Et){return Qr.current=Et}})),onOk:function(){var tt=Object(l.a)(j.a.mark(function ut(){var Ft,Pn;return j.a.wrap(function(Nn){for(;;)switch(Nn.prev=Nn.next){case 0:return Nn.next=2,Object(De.f)({ids:We?[We]:$,groups_ids:(Ft=Qr.current)===null||Ft===void 0?void 0:Ft[0]});case 2:Pn=Nn.sent,Qr.current=[],(Pn==null?void 0:Pn.status)===0&&_r();case 5:case"end":return Nn.stop()}},ut)}));function Et(){return tt.apply(this,arguments)}return Et}()});case 5:case"end":return it.stop()}},Ke)}));return function(We){return Fe.apply(this,arguments)}}(),lo=function(){var Fe=Object(l.a)(j.a.mark(function Ke(We){var et,it;return j.a.wrap(function(Et){for(;;)switch(Et.prev=Et.next){case 0:return Et.next=2,Object(De.D)({clazz:"ItemBank",id:We});case 2:et=Et.sent,it=(et==null?void 0:et.groups)||[],Qr.current=[],A.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:h.a.createElement("div",{className:"font14 ".concat(se.a.overflow)},h.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"),h.a.createElement(s.a.Group,{className:se.a.checkbox,defaultValue:Qr.current,onChange:function(Ft){return Qr.current=Ft}},it==null?void 0:it.map(function(ut){return h.a.createElement(s.a,{key:ut.group_id,value:ut.group_id},ut.name)}))),onOk:function(){var ut=Object(l.a)(j.a.mark(function Pn(){return j.a.wrap(function(Nn){for(;;)switch(Nn.prev=Nn.next){case 0:return Nn.abrupt("return",new Promise(function(){var ga=Object(l.a)(j.a.mark(function Mr(Zr,hi){var Lr,ea,Ka;return j.a.wrap(function($a){for(;;)switch($a.prev=$a.next){case 0:if(Qr.current.length){$a.next=3;break}return d.b.warn("\u8BF7\u9009\u62E9\u9700\u8981\u64A4\u9500\u5171\u4EAB\u7684\u6559\u7814\u56E2\u961F"),$a.abrupt("return",hi());case 3:return ea=it==null||((Lr=it.map(function(zi){return zi.group_id}))===null||Lr===void 0)?void 0:Lr.filter(function(zi){return!Qr.current.includes(zi)}),$a.next=6,Object(De.l)({ids:[We],clazz:"ItemBank",group_ids:ea});case 6:return Ka=$a.sent,Qr.current=[],(Ka==null?void 0:Ka.status)===0&&(d.b.info("\u64A4\u9500\u5171\u4EAB\u6210\u529F"),_r()),$a.abrupt("return",Zr());case 10:case"end":return $a.stop()}},Mr)}));return function(Mr,Zr){return ga.apply(this,arguments)}}()));case 1:case"end":return Nn.stop()}},Pn)}));function Ft(){return ut.apply(this,arguments)}return Ft}()});case 6:case"end":return Et.stop()}},Ke)}));return function(We){return Fe.apply(this,arguments)}}(),Po=function(Ke){an({type:"problemset/setActionTabs",payload:{key:"Problemset-BasketDelete",params:{type:Ke}}})},Ro=function(){an({type:"problemset/setActionTabs",payload:{key:"\u65B0\u5EFA\u6587\u4EF6\u5939",params:Ae}});return},Mo=function(){var Ke={discipline_id:"&discipline_id=".concat(Ae.discipline_id),sub_discipline_id:"&sub_discipline_id=".concat(Ae.sub_discipline_id),tag_discipline_id:"&sub_discipline_id=".concat(Ae.tag_discipline_id),difficulty:"&difficulty=".concat(Ae.difficulty),item_type:"&item_type=".concat(Ae.item_type),group_id:"&group_id=".concat(Ae.group_id||0)},We="/problemset/newitem?pages=".concat(Ae.page);Object.keys(Ke).forEach(function(et){Ae[et]&&(We=We+Ke[et])}),N.d===null||N.d===void 0||N.d.push(We)},ni=function(Ke){var We=$;if(!(We!=null&&We.length))return d.b.info("\u8BF7\u5148\u9009\u62E9\u8BD5\u9898");if(si+We.length>200&&Ke&&Se){d.b.info("\u8BD5\u9898\u7BEE\u4E2D\u6700\u591A\u53EF\u518D\u52A0\u5165".concat(200-si,"\u9898\uFF0C\u5F53\u524D\u9009\u4E2D").concat(We.length,"\u9898\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9"));return}Ke?Lo(We):pa(We)},Lo=function(){var Fe=Object(l.a)(j.a.mark(function Ke(We){var et;return j.a.wrap(function(tt){for(;;)switch(tt.prev=tt.next){case 0:et=Object(x.a)(We),dn.forEach(function(Et){if(et.includes(Et.id)){var ut;Et.item_type==="PROGRAM"&&((ut=Et.program_attr)===null||ut===void 0?void 0:ut.status)===0&&Object(ot.remove)(et,function(Ft){return Ft===Et.id})}}),A.a.confirm({width:530,title:"\u63D0\u793A",className:"custom-modal-divider ",icon:null,centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:h.a.createElement("div",null,"\u5F53\u524D\u5DF2\u9009\u62E9",We.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 Et=Object(l.a)(j.a.mark(function Ft(){var Pn;return j.a.wrap(function(Nn){for(;;)switch(Nn.prev=Nn.next){case 0:if(!Ae.exam_id){Nn.next=6;break}return Nn.next=3,Object(De.t)({exam_id:Ae.exam_id,item_bank_ids:et});case 3:Pn=Nn.sent,Nn.next=15;break;case 6:if(!(Ae!=null&&Ae.exercise_id)){Nn.next=12;break}return Nn.next=9,Object(Aa.a)("/api/exercises/".concat(Ae==null?void 0:Ae.exercise_id,"/select_questions.json"),{method:"post",body:{item_bank_ids:et}});case 9:Pn=Nn.sent,Nn.next=15;break;case 12:return Nn.next=14,an({type:"problemset/select",payload:{item_bank_ids:et}});case 14:Pn=Nn.sent;case 15:Pn.status===0&&(_r(),_a());case 16:case"end":return Nn.stop()}},Ft)}));function ut(){return Et.apply(this,arguments)}return ut}()});case 3:case"end":return tt.stop()}},Ke)}));return function(We){return Fe.apply(this,arguments)}}(),pa=function(){var Fe=Object(l.a)(j.a.mark(function Ke(We){var et;return j.a.wrap(function(tt){for(;;)switch(tt.prev=tt.next){case 0:if(!Ae.exam_id){tt.next=6;break}return tt.next=3,Object(Aa.a)("/api/examination_banks/".concat(Ae.exam_id,"/batch_revoke_item.json"),{method:"post",body:{item_ids:We}});case 3:et=tt.sent,tt.next=15;break;case 6:if(!(Ae!=null&&Ae.exercise_id)){tt.next=12;break}return tt.next=9,Object(Aa.a)("/api/exercise_questions/delete_by_item_bank.json ",{method:"post",body:{exercise_id:Ae==null?void 0:Ae.exercise_id,item_bank_ids:We}});case 9:et=tt.sent,tt.next=15;break;case 12:return tt.next=14,an({type:"problemset/unselectAll",payload:{item_ids:We}});case 14:et=tt.sent;case 15:et.status===0&&(_r(),_a());case 16:case"end":return tt.stop()}},Ke)}));return function(We){return Fe.apply(this,arguments)}}(),Fr=function(){var Fe=Object(l.a)(j.a.mark(function Ke(We){var et;return j.a.wrap(function(tt){for(;;)switch(tt.prev=tt.next){case 0:if(!(Se&&si===200)){tt.next=3;break}return d.b.info("\u5DF2\u9009200\u4E2A\u8BD5\u9898\uFF08\u4E0D\u80FD\u5728\u9009\u7528\u66F4\u591A\u8BD5\u9898\uFF09"),tt.abrupt("return");case 3:if(!Ae.exam_id){tt.next=10;break}return tt.next=6,Object(De.t)({exam_id:Ae.exam_id,shixun_ids:We});case 6:et=tt.sent,et.status===0&&_r(),tt.next=14;break;case 10:return tt.next=12,an({type:"problemset/select",payload:{shixun_ids:We}});case 12:et=tt.sent,et.status===0&&(_a(),_r());case 14:case"end":return tt.stop()}},Ke)}));return function(We){return Fe.apply(this,arguments)}}(),aa=function(){an({type:"classroomList/setActionTabs",payload:{key:"\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"}})},Pr=function(Ke){var We,et,it,tt;if(!((We=Jt.teachGroupData)!==null&&We!==void 0&&(et=We.groups)!==null&&et!==void 0&&et.length))return d.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");A.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:h.a.createElement("div",{className:"font14 ".concat(se.a.overflow)},h.a.createElement(s.a.Group,{className:se.a.checkbox,defaultValue:Qr.current,onChange:function(ut){return Qr.current=ut}},(it=Jt.teachGroupData)===null||it===void 0||((tt=it.groups)===null||tt===void 0)?void 0:tt.map(function(Et){return h.a.createElement(s.a,{key:Et.group_id,value:Et.group_id},Et.name)}))),onOk:function(){return new Promise(function(){var ut=Object(l.a)(j.a.mark(function Ft(Pn,la){var Nn,ga;return j.a.wrap(function(Zr){for(;;)switch(Zr.prev=Zr.next){case 0:if((Nn=Qr.current)!==null&&Nn!==void 0&&Nn.length){Zr.next=3;break}return d.b.info("\u8BF7\u5148\u9009\u62E9\u6559\u7814\u56E2\u961F"),Zr.abrupt("return",la());case 3:return Zr.next=5,Object(De.l)({ids:Ke||$,clazz:"ItemBank",group_ids:Qr.current});case 5:ga=Zr.sent,(ga==null?void 0:ga.status)===0&&(d.b.info("\u6240\u9009\u8BD5\u9898\u6210\u529F\u5206\u4EAB\u81F3\u6559\u7814\u56E2\u961F"),Qr.current=[],pe([]),_r(),Pn());case 7:case"end":return Zr.stop()}},Ft)}));return function(Ft,Pn){return ut.apply(this,arguments)}}())}})},yi=function(){var Ke=function(){var We=Object(l.a)(j.a.mark(function et(){var it;return j.a.wrap(function(Et){for(;;)switch(Et.prev=Et.next){case 0:return Ur(!0),Et.next=3,Object(De.j)({ids:$});case 3:it=Et.sent,Ur(!1),(it==null?void 0:it.status)===0&&A.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(it.success,"\u6761\u8BD5\u9898\uFF0C\u6709").concat(it.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(){ui(new Array(it.success))}});case 6:case"end":return Et.stop()}},et)}));return function(){return We.apply(this,arguments)}}();if($!=null&&$.length){A.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($==null?void 0:$.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:Ke});return}d.b.warn("\u8BF7\u9009\u62E9\u9700\u8981\u5220\u9664\u7684\u8BD5\u9898")},uo=function(){var Ke,We;if(!($!=null&&$.length))return d.b.info("\u8BF7\u5148\u9009\u62E9\u8BD5\u9898");if(dn!=null&&(Ke=dn.filter(function(et){return $.includes(et.id)}))!==null&&Ke!==void 0&&Ke.every(function(et){return et.public}))return d.b.info("\u6240\u9009\u8BD5\u9898\u5DF2\u516C\u5F00\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9");if(dn!=null&&(We=dn.filter(function(et){return $.includes(et.id)}))!==null&&We!==void 0&&We.find(function(et){var it;return et.item_type==="PROGRAM"&&((it=et.program_attr)===null||it===void 0?void 0:it.status)===0}))return d.b.info("\u5DF2\u9009\u9898\u4E2D\u5B58\u5728\u672A\u53D1\u5E03\u7684\u7F16\u7A0B\u9898");window.localStorage.getItem("problemset-set-public-hint-flag")==="1"||un.userInfo.professional_certification?xa():A.a.confirm({centered:!0,width:530,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u516C\u5F00\u89C4\u5219\u544A\u77E5",maskClosable:!0,icon:null,content:h.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",h.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",h.a.createElement("br",null),"\u662F\u5426\u786E\u8BA4\u7533\u8BF7\u516C\u5F00\uFF1F",h.a.createElement("br",null),h.a.createElement(s.a,{className:"mt10",defaultChecked:!1,onChange:function(it){return Ee.current=it.target.checked}},"\u4E0D\u518D\u63D0\u793A")),onOk:function(){xa()}})},xa=function(){var Fe=Object(l.a)(j.a.mark(function Ke(We){var et,it;return j.a.wrap(function(Et){for(;;)switch(Et.prev=Et.next){case 0:return et=Rn===gr.TeachGroupShare?1:2,Et.next=3,Object(De.g)({ids:We?[We]:$,source:et});case 3:it=Et.sent,it.status===0&&(Ee.current&&window.localStorage.setItem("problemset-set-public-hint-flag","1"),Ee.current=!1,pe([]),_r());case 5:case"end":return Et.stop()}},Ke)}));return function(We){return Fe.apply(this,arguments)}}(),co=function(Ke){A.a.confirm({centered:!0,icon:null,title:"\u63D0\u793A",className:"custom-modal-divider",content:h.a.createElement(h.a.Fragment,null,h.a.createElement("div",{className:se.a.modalContent},"\u53D1\u5E03\u540E\u5373\u53EF\u5E94\u7528\u5230\u81EA\u5DF1\u7BA1\u7406\u7684\u8BFE\u5802"),h.a.createElement("div",{className:se.a.modalContent}," \u662F\u5426\u786E\u8BA4\u53D1\u5E03?")),okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:function(){var We=Object(l.a)(j.a.mark(function it(){var tt;return j.a.wrap(function(ut){for(;;)switch(ut.prev=ut.next){case 0:return ut.next=2,Object(De.L)({identifier:Ke});case 2:tt=ut.sent,(tt==null?void 0:tt.status)===0&&(d.b.success("\u53D1\u5E03\u6210\u529F"),_r());case 4:case"end":return ut.stop()}},it)}));function et(){return We.apply(this,arguments)}return et}()})},fo=function(Ke){A.a.confirm({centered:!0,icon:null,title:"\u63D0\u793A",className:"custom-modal-divider",content:h.a.createElement("p",{className:se.a.modalContent},"\u662F\u5426\u786E\u8BA4\u64A4\u9500\u53D1\u5E03\uFF1F"),okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:function(){var We=Object(l.a)(j.a.mark(function it(){var tt;return j.a.wrap(function(ut){for(;;)switch(ut.prev=ut.next){case 0:return ut.next=2,Object(De.K)({identifier:Ke});case 2:tt=ut.sent,(tt==null?void 0:tt.status)===0&&(d.b.success("\u64A4\u9500\u53D1\u5E03\u6210\u529F"),_r());case 4:case"end":return ut.stop()}},it)}));function et(){return We.apply(this,arguments)}return et}()})},ho=function(){var Fe=Object(l.a)(j.a.mark(function Ke(We){return j.a.wrap(function(it){for(;;)switch(it.prev=it.next){case 0:an({type:"problemset/getDisciplines",payload:{source:"question",group_id:We,group_type:gr.TeachGroupShare}}),Ae.page=1,Ae.group_id=We||null,delete Ae.id,Ht(Object(u.a)({},Ae)),Dr(Ae);case 6:case"end":return it.stop()}},Ke)}));return function(We){return Fe.apply(this,arguments)}}(),fi=function(Ke){Ae.sort_by=Ke.type,Ae.sort_direction=Ke.direction,Ae.page=1,Ae.per_page=20,zt(Ke.name),Ht(Ae),Dr(Ae)},Wi=function(){Ae.page=1,Ht(Ae),Dr(Ae)},wi=function(Ke){Ae.discipline_id="",Ae.sub_discipline_id="",Ae.tag_discipline_id="",Ae.item_type=null,Ae.difficulty=null,Ae.page=1,Ae.per_page=20,Ae.group_id=Ke,Mt(-1),Ht(Ae),Dr(Ae).then(function(We){return ir(We==null?void 0:We.item_banks_group)})},mo=function(){if(!($!=null&&$.length)){an({type:"problemset/setActionTabs",payload:{key:"\u5BFC\u51FA\u8BD5\u9898",params:Ae}});return}A.a.confirm({centered:!0,width:530,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u5BFC\u51FA\u63D0\u793A",maskClosable:!0,icon:null,content:h.a.createElement("div",{className:"font14 ".concat(se.a.overflow)},"\u5DF2\u9009\u4E2D",$==null?void 0:$.length,"\u9053\u9898\uFF0C\u5176\u4E2D\u7F16\u7A0B\u9898\u4E0E\u5B9E\u8BAD\u9898\u6682\u4E0D\u652F\u6301\u5BFC\u51FA\u3002"),onOk:function(){Object(ve.k)({ids:$})}})},Hi=function(){var Fe=Object(l.a)(j.a.mark(function Ke(){var We,et,it,tt;return j.a.wrap(function(ut){for(;;)switch(ut.prev=ut.next){case 0:return ut.next=2,Object(De.i)({ids:$});case 2:We=ut.sent,et=We.data||{},it=et.unpublish_program_question_count,tt=et.total_item_banks,it===0?A.a.error({title:"\u9519\u8BEF",content:h.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"}):A.a.confirm({title:"\u63D0\u793A",content:h.a.createElement("span",null,"\u5F53\u524D\u9009\u4E2D",tt,"\u9898\uFF0C\u5176\u4E2D\u5305\u542B",it,"\u9053\u672A\u53D1\u5E03\u7684\u7F16\u7A0B\u9898\uFF0C \u8BF7\u786E\u8BA4\u662F\u5426\u53D1\u5E03\uFF1F"),centered:!0,onOk:function(){var Ft=Object(l.a)(j.a.mark(function la(){var Nn;return j.a.wrap(function(Mr){for(;;)switch(Mr.prev=Mr.next){case 0:return Mr.next=2,Object(De.h)({ids:$});case 2:Nn=Mr.sent,Nn.status===0&&(d.b.success("\u53D1\u5E03\u6210\u529F"),_r());case 4:case"end":return Mr.stop()}},la)}));function Pn(){return Ft.apply(this,arguments)}return Pn}()});case 5:case"end":return ut.stop()}},Ke)}));return function(){return Fe.apply(this,arguments)}}(),lr=h.a.createElement(y.a,null,Vt&&h.a.createElement(y.a.Item,{onClick:function(){return ni(!0)}},"\u6279\u91CF\u52A0\u5165"),Vt&&h.a.createElement(y.a.Item,{onClick:function(){return ni(!1)}},"\u6279\u91CF\u79FB\u51FA"),Rn===gr.Mine&&Se&&h.a.createElement(y.a.Item,{onClick:function(){return Xa()}},"\u79FB\u52A8\u5230"),Rn===gr.Mine&&Se&&h.a.createElement(y.a.Item,{onClick:uo},"\u6279\u91CF\u516C\u5F00"),Rn===gr.Mine&&Se&&h.a.createElement(y.a.Item,{onClick:function(){return Pr()}},"\u6279\u91CF\u5171\u4EAB"),Rn===gr.Mine&&Se&&h.a.createElement(y.a.Item,{onClick:yi},"\u6279\u91CF\u5220\u9664")),Bn=function(Ke){if(xe)if((en==null?void 0:en.length)<=0){var We=dn.filter(function(Ft){return Ke.includes(Ft.id)});Yn(Object(x.a)(We)),pe(We==null?void 0:We.map(function(Ft){return Ft.id}))}else if(Ke.length>en.length){var et,it=dn.filter(function(Ft){return Ke.includes(Ft.id)}),tt=en.map(function(Ft){return Ft.id}),Et=it.filter(function(Ft){return!tt.includes(Ft.id)});Yn([].concat(Object(x.a)(en),Object(x.a)(Et))),pe((et=[].concat(Object(x.a)(en),Object(x.a)(Et)))===null||et===void 0?void 0:et.map(function(Ft){return Ft.id}))}else{var ut=en.filter(function(Ft){return Ke.includes(Ft.id)});Yn(Object(x.a)(ut)),pe(ut==null?void 0:ut.map(function(Ft){return Ft.id}))}else pe(Ke)},Kr=function(Ke){if(xe)if(Ke){var We,et=en==null?void 0:en.map(function(ut){return ut.id}),it=dn.filter(function(ut){return!et.includes(ut.id)});Yn([].concat(Object(x.a)(en),Object(x.a)(it))),pe((We=[].concat(Object(x.a)(en),Object(x.a)(it)))===null||We===void 0?void 0:We.map(function(ut){return ut.id}))}else{var tt=dn==null?void 0:dn.map(function(ut){return ut.id}),Et=en.filter(function(ut){return!tt.includes(ut.id)});Yn(Object(x.a)(Et)),pe(Et==null?void 0:Et.map(function(ut){return ut.id}))}else pe(Ke?dn==null?void 0:dn.map(function(ut){return ut.id}):[])},va=function(){var Ke="/problemset/preview";if(Ae.exam_id&&(Ke="/paperlibrary/edit/".concat(Ae.exam_id)),Ae!=null&&Ae.exercise_id){var We;Ke="/classrooms/".concat(hn==null||((We=hn.params)===null||We===void 0)?void 0:We.coursesId,"/exercise/").concat(Ae==null?void 0:Ae.exercise_id,"/edit")}N.d.push(Ke)},bi=[{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"}],Qa={1:"\u7B80\u5355",2:"\u9002\u4E2D",3:"\u56F0\u96BE"},Di=function(Ke,We){var et,it=We.id<0?"--":Vt?We[Ae.exercise_id?"added":"choosed"]?h.a.createElement("span",{key:1,className:se.a.btnAdd,onClick:function(ut){ut.target.style.pointerEvents="none",Oi(We.id)}},Se?"\u79FB\u51FA\u8BD5\u9898\u7BEE":h.a.createElement("span",null,h.a.createElement("b",{className:"iconfont icon-yichu ".concat(se.a.cancelC)}),"\u79FB\u51FA")):We.item_type==="PROGRAM"&&((et=We.program_attr)===null||et===void 0?void 0:et.status)===0?h.a.createElement(w.a,{placement:"top",title:"\u7F16\u7A0B\u9898\u672A\u53D1\u5E03\uFF0C\u4E0D\u80FD\u52A0\u5165\uFF01"},h.a.createElement("span",{className:se.a.btnAdd,style:{cursor:"not-allowed",background:"#E3E6EC",color:"#B1BACD"}}," ",Se?"\u52A0\u5165\u8BD5\u9898\u7BEE":h.a.createElement("span",{style:{padding:"0 3px"}},h.a.createElement("b",{className:"iconfont icon-jiaru ".concat(se.a.addC)}),"\u52A0\u5165")," ")):h.a.createElement("span",{className:se.a.btnAdd,onClick:function(){return Va(We.id)}},Se?"\u52A0\u5165\u8BD5\u9898\u7BEE":h.a.createElement("span",{style:{padding:"0 3px"}},h.a.createElement("b",{className:"iconfont icon-jiaru ".concat(se.a.addC)}),"\u52A0\u5165")):h.a.createElement(h.a.Fragment,null),tt=h.a.createElement("span",{className:se.a.actonBtn},We.id>0&&h.a.createElement(er.a,{isProblemset:Se,user:un,key:We.id,data:We,activeTabsKey:Rn,selectIds:$,onCollect:Ma,onSetPublic:di,onStartExperience:qi,onCorrection:Si,onPublicReview:gi,onSetPrivate:ci,onDelete:Fi,onCancel:Oi,onSelect:Va,onMoveTo:Xa,onSetShare:ti,onCancelShare:lo,onPublish:co,onCancelPublish:fo}),it);return tt};Object(W.useEffect)(function(){if(xe){var Fe=hn.params,Ke=Fe.coursesId,We=Fe.categoryId;an({type:"shixunHomeworks/addCommonHomeWorkDefaultData",payload:{category:We,coursesId:Ke,type:5}})}},[xe]);var Ya=function(){var Fe=Object(l.a)(j.a.mark(function Ke(){var We,et,it,tt,Et;return j.a.wrap(function(Ft){for(;;)switch(Ft.prev=Ft.next){case 0:return or.current.form.validateFields().catch(function(Pn){document.body.scrollIntoView()}),Ft.next=3,or.current.form.validateFields();case 3:if(We=or.current.form.getFieldsValue(),console.log(We,"value"),!((en==null?void 0:en.length)<=0)){Ft.next=8;break}return d.b.info("\u8BF7\u9009\u62E9\u7F16\u7A0B\u9898"),Ft.abrupt("return");case 8:return Sn(!0),et=hn.params,it=et.coursesId,tt=et.categoryId,Ft.next=12,Object(Aa.a)(Re?"/api/homework_commons/".concat(tt,"/update_hack.json"):"/api/courses/".concat(it,"/homework_commons.json"),{method:Re?"put":"post",body:Object(u.a)(Object(u.a)({},We),{},{coursesId:it,category:tt,type:5,hack_ids:en==null?void 0:en.map(function(Pn){return Pn.id})})});case 12:Et=Ft.sent,(Et==null?void 0:Et.status)===0&&N.d.push("/classrooms/".concat(hn.params.coursesId,"/program_homework/").concat(Re?tt:Et.homework_id,"/detail?tabs=1")),Sn(!1);case 15:case"end":return Ft.stop()}},Ke)}));return function(){return Fe.apply(this,arguments)}}();return h.a.createElement("div",{className:se.a.page},h.a.createElement("section",null,h.a.createElement("div",{className:se.a.wrap},Dn.course_name&&xe&&h.a.createElement("section",{className:"animated fadeIn"},h.a.createElement("aside",{className:"mt10"},Dn.category&&h.a.createElement(g.a,{separator:">"},h.a.createElement(g.a.Item,null,h.a.createElement(H.a,{to:"/classrooms/".concat(Dn.course_id,"/program_homework")},Dn.course_name)),h.a.createElement(g.a.Item,null,h.a.createElement(H.a,{to:"/classrooms/".concat(Dn.course_id,"/program_homework")},Dn.category.category_name)),h.a.createElement(g.a.Item,null,Qe)))),h.a.createElement("div",{className:se.a.title},xe?Qe:"\u8BD5\u9898\u5E93"),xe&&h.a.createElement(ai,{data:At,ref:or}),h.a.createElement("div",{className:se.a.headerWrapper},h.a.createElement("div",{className:se.a.tabsWrap},h.a.createElement(D.a,{activeKey:Rn,onChange:vi,tabBarExtraContent:h.a.createElement("div",{className:se.a.searchWrap},Rn===gr.Mine&&Se&&h.a.createElement(P.a,{className:se.a.addQuestionBtn,onClick:Mo},h.a.createElement("img",{src:ln.a,className:se.a.pngIcon,alt:""}),"\u65B0\u589E\u8BD5\u9898"),h.a.createElement(xi,{allowClear:!0,suffix:h.a.createElement("i",{className:"iconfont icon-sousuo9 font14 ".concat(se.a.searchIcon),onClick:function(){return Ai(Ae.keyword)}}),className:se.a.search,placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u641C\u7D22",size:"large",value:Ae.keyword,onChange:function(Ke){Ae.keyword=Ke.target.value,Ht(Object(u.a)({},Ae))},onSearch:Ai}))},h.a.createElement(ii,{tab:"\u516C\u5171",key:"1"}),((fn=Jt.teachGroupData)===null||fn===void 0||((Xt=fn.groups)===null||Xt===void 0)?void 0:Xt.length)&&h.a.createElement(ii,{tab:"\u6211\u7684\u7FA4\u7EC4",key:"3"}),!Object(ur.o)()&&!Object(ur.m)()&&!xe&&h.a.createElement(ii,{tab:"\u6536\u85CF\u5939",key:"2"}),h.a.createElement(ii,{tab:"\u6211\u521B\u5EFA\u7684",key:"0"}))),h.a.createElement(X.a,{showSelectAll:!1,className:se.a.select,disciplinesData:(En=Jt.disciplinesData)===null||En===void 0?void 0:En.disciplines,knowledgeData:Un,directionValue:Ae.discipline_id,subDisciplineValue:Ae.sub_discipline_id,typeValue:Ae.item_type,isprogram_homework:xe,showKnowledge:!0,name:Ra,setname:qa,difficultyValue:Ae.difficulty,showShixun:!Object(ur.m)()&&!Ae.exercise_id&&Rn!==gr.TeachGroupShare&&Rn!==gr.Public,onShixunChange:aa,onDirectionChange:Zi,onTypeChange:ji,onDifficultyChange:wo,knowledgeValue:oi,onKnowledgeChange:Do,teachGroupData:(Vn=Jt.teachGroupData)===null||Vn===void 0?void 0:Vn.groups,onTeachGroupChange:ho,teachGroupValue:Ae.group_id,showTeachGroup:Ji})),h.a.createElement("div",{className:se.a.treeWrapper,style:{display:Rn===gr.Mine?"block":"none"}},h.a.createElement("div",{className:se.a.treeHeader},h.a.createElement(rt.a,{data:ar,onClick:Ki}),h.a.createElement(P.a,{type:"link",onClick:Ro,className:se.a.exportBtn},h.a.createElement("img",{src:oa.a,alt:"",className:se.a.pngIcon}),"\u65B0\u5EFA\u6587\u4EF6\u5939")),h.a.createElement(I.a,{spinning:sa},h.a.createElement("div",{ref:jr,className:se.a.treeContent},h.a.createElement(Qn.a,{isProblemset:Se,reloadData:_r,data:fr,onShare:Pr,onOpen:Ki})))),h.a.createElement("div",{className:se.a.contentWrap},h.a.createElement("div",{className:se.a.batchWrap},h.a.createElement("div",{style:{flex:1,display:"flex",alignItems:"center"}},!xe&&h.a.createElement("div",{className:"font14"},h.a.createElement(L.a,{overlay:h.a.createElement(y.a,{selectedKeys:[Wn]},qn==null?void 0:qn.map(function(Fe,Ke){return h.a.createElement(y.a.Item,{key:Fe.name,onClick:function(){return fi(Fe)}},Fe.name)}))},h.a.createElement("span",{style:{color:"#464F66"}},h.a.createElement("i",{className:"iconfont icon-paixu font14 mr5 c-light-primary"}),Wn))),xe&&h.a.createElement("div",null,h.a.createElement(s.a,{checked:(dn==null?void 0:dn.filter(function(Fe){return en==null?void 0:en.map(function(Ke){return Ke.id}).includes(Fe.id)}).length)===dn.length,onChange:function(Ke){return Kr(Ke.target.checked)}},"\u672C\u9875\u5168\u9009",h.a.createElement("span",{style:{color:"#999",fontSize:12}},"/\u5DF2\u9009(",$==null?void 0:$.length,")"))),xe&&h.a.createElement(A.a,{visible:Fa,centered:!0,width:700,okText:"\u786E\u8BA4".concat(Re?"\u7F16\u8F91":"\u65B0\u5EFA"),onCancel:function(){return Ga(!1)},cancelText:"\u8FD4\u56DE\u5217\u8868",onOk:Ya,confirmLoading:_n,title:"\u67E5\u770B\u5DF2\u9009"},h.a.createElement("div",{className:"font14 c-light-primary mb10"},"\u5DF2\u9009",en==null?void 0:en.length,"\u4E2A"),h.a.createElement("div",{style:{height:400,overflow:"auto"}},en==null?void 0:en.map(function(Fe,Ke){var We,et,it,tt,Et,ut;return h.a.createElement("div",{key:Ke,className:se.a.sendModal},h.a.createElement("div",{className:se.a.li},h.a.createElement("p",null,Fe==null?void 0:Fe.name),h.a.createElement("div",{className:se.a.bottom},h.a.createElement("span",{className:"c-grey-333"},"\u7F16\u7A0B\u9898"),h.a.createElement("i",{className:se.a.line}),h.a.createElement("span",{className:"c-grey-333"},Fe.difficulty===1&&"\u7B80\u5355",Fe.difficulty===2&&"\u9002\u4E2D",Fe.difficulty===3&&"\u56F0\u96BE"),h.a.createElement("i",{className:se.a.line}),h.a.createElement("span",null,"\u521B\u5EFA\u8005\xA0",h.a.createElement(w.a,{title:Fe==null||((We=Fe.author)===null||We===void 0)?void 0:We.name},h.a.createElement("span",{className:"c-grey-333"},(Fe==null||((et=Fe.author)===null||et===void 0||((it=et.name)===null||it===void 0))?void 0:it.length)>6?(Fe==null||((tt=Fe.author)===null||tt===void 0||((Et=tt.name)===null||Et===void 0))?void 0:Et.substr(0,3))+"...":Fe==null||((ut=Fe.author)===null||ut===void 0)?void 0:ut.name))),h.a.createElement("i",{className:se.a.line}),h.a.createElement("span",{className:se.a.des},"\u66F4\u65B0\xA0",h.a.createElement("span",{className:"c-grey-333"},Fe==null?void 0:Fe.updated_at)))),h.a.createElement("div",{className:se.a.del,onClick:function(){Bn(en.filter(function(Pn){return Pn.id!==Fe.id}).map(function(Pn){return Pn.id}))}},"\u5220\u9664"))})))),h.a.createElement("div",null,Rn===gr.Mine&&Se&&h.a.createElement(P.a,{onClick:mo,type:"link",className:se.a.exportBtn},h.a.createElement("img",{src:Qi.a,className:se.a.pngIcon}),h.a.createElement("span",null,"\u5BFC\u51FA\u8BD5\u9898")))),ao?h.a.createElement("div",null,h.a.createElement(P.a,{style:{paddingLeft:0},onClick:function(){Ae.page=1,Ae.keyword=null,delete Ae.id,Ht(Ae),Ti(!1),Dr(Ae)},type:"link"}," ",h.a.createElement("i",{className:"iconfont icon-fanhui2 font14"}),"\u8FD4\u56DE"),h.a.createElement("span",{className:"font14 mr20 c-grey-333"},"\u641C\u7D22\u201C",Ae.keyword,"\u201D")):null,h.a.createElement("div",{className:se.a.contentListWrap},Gt!==0?h.a.createElement(I.a,{size:"large",spinning:Hn["problemset/getItemBanks"]},dn.map(function(Fe,Ke){var We,et;return h.a.createElement("div",{className:se.a.li},h.a.createElement("div",{className:se.a.top},h.a.createElement(er.b,{key:Fe.id,data:Fe,selectIds:$,onSelectCheckBox:Bn})),h.a.createElement("div",{className:se.a.bottom},h.a.createElement("p",{className:"".concat(se.a.actionLeftItem," ").concat(se.a.questionTypeName)},(We=bi.find(function(it){return it.type===Fe.item_type}))===null||We===void 0?void 0:We.name),h.a.createElement("p",{className:se.a.actionLeftItem},Qa[Fe.difficulty]),h.a.createElement("p",{className:se.a.actionLeftItem},"\u521B\u5EFA\u8005",h.a.createElement("span",{className:"c-grey-333"},Fe==null||((et=Fe.author)===null||et===void 0)?void 0:et.name)),h.a.createElement("p",{className:se.a.actionLeftItem},"\u66F4\u65B0",h.a.createElement("span",{className:"c-grey-333"},Fe==null?void 0:Fe.updated_at)),h.a.createElement("p",{className:se.a.actionLeftItem},"\u4F7F\u7528\u6B21\u6570",h.a.createElement("span",{className:"c-grey-333"},Fe==null?void 0:Fe.quotes)),!xe&&h.a.createElement("div",{className:se.a.more},Di({},Fe))))})):h.a.createElement(I.a,{size:"large",spinning:Hn["problemset/getItemBanks"]},h.a.createElement(re.a,null))),Gt!==0&&!xe&&h.a.createElement(K.a,{showQuickJumper:!0,onChange:so,defaultCurrent:1,pageSize:Ae==null?void 0:Ae.per_page,current:Ae.page||1,total:Gt,showTotal:function(Ke){return h.a.createElement("span",{className:"mr10"},"\u5171",h.a.createElement("span",{className:"c-light-primary"},Ke),"\u6761\u6570\u636E")}}),xe&&h.a.createElement("div",{style:{height:20}})),Se&&h.a.createElement(It,{basketData:Jt.basketData,visible:Ii,basketTotal:si,onClose:function(){return Ni(!1)},onDelete:Po}),!Object(ur.m)()&&Se&&h.a.createElement(xn,{visibleBasket:Ii,onToggleVisible:function(){return Ni(!Ii)},count:si})),h.a.createElement(ae,null),h.a.createElement(Ye,{onReloadData:_r}),h.a.createElement(ht,{onReloadData:function(){return ui([null])}}),h.a.createElement(Bt,{onReloadData:_r,onReloadBasketData:_a}),$n.actionTabs.key==="\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"?h.a.createElement(ri,{shixunIds:Oe,cb:Fr}):null,h.a.createElement(vt,null),h.a.createElement(gt,null),h.a.createElement(Ct,null),h.a.createElement(He,null),h.a.createElement(Ie,null),h.a.createElement(ze,{onOk:Wi}),h.a.createElement(Y.a,{onOk:wi})),Se?h.a.createElement(W.Fragment,null,!!($!=null&&$.length)&&h.a.createElement("div",{className:se.a.batch},h.a.createElement("aside",null,h.a.createElement("div",{style:{flexShrink:0,marginRight:20}},h.a.createElement(s.a,{className:"font14",checked:dn!=null&&dn.length?$.length===(dn==null?void 0:dn.length):!1,onChange:function(Ke){return Kr(Ke.target.checked)}},"\u672C\u9875\u5168\u9009",h.a.createElement("span",{style:{color:"#999",fontSize:12}},"/\u5DF2\u9009(",$==null?void 0:$.length,")"))),h.a.createElement("div",{className:se.a.btns},Vt&&h.a.createElement("div",{className:se.a.btn,onClick:function(){return ni(!0)}},h.a.createElement("i",{className:"iconfont icon-piliangjiaru"}),"\u6279\u91CF\u52A0\u5165"),Vt&&h.a.createElement("div",{className:se.a.btn,onClick:function(){return ni(!1)}},h.a.createElement("i",{className:"iconfont icon-piliangyichu"}),"\u6279\u91CF\u79FB\u51FA"),Rn===gr.Mine&&h.a.createElement("div",{className:se.a.btn,onClick:function(){return Xa()}},h.a.createElement("i",{className:"iconfont icon-yidongmulu font16"}),"\u6279\u91CF\u79FB\u52A8"),Rn===gr.Mine&&h.a.createElement("div",{className:se.a.btn,onClick:uo}," ",h.a.createElement("i",{className:"iconfont icon-pilianggongkai"}),"\u6279\u91CF\u516C\u5F00"),Rn===gr.Mine&&h.a.createElement("div",{className:se.a.btn,onClick:function(){return Pr()}}," ",h.a.createElement("i",{className:"iconfont icon-pilianggongxiang"}),"\u6279\u91CF\u5171\u4EAB"),Rn===gr.Mine&&h.a.createElement("div",{className:se.a.btn,onClick:yi}," ",h.a.createElement("i",{className:"iconfont icon-piliangshanchu3 c-red"}),"\u6279\u91CF\u5220\u9664"),Rn===gr.Mine&&h.a.createElement("div",{className:se.a.btn,onClick:Hi}," ",h.a.createElement("i",{className:"iconfont icon-fabu5"}),"\u6279\u91CF\u53D1\u5E03"),h.a.createElement("div",{onClick:function(){return pe([])},style:{marginLeft:"auto"},className:se.a.btn}," ",h.a.createElement("i",{className:"iconfont icon-piliangcaozuoicon2"}),"\u53D6\u6D88\u64CD\u4F5C"))))):xe?"":h.a.createElement("div",{className:se.a.batch},h.a.createElement("aside",null,h.a.createElement("div",{style:{flexShrink:0,marginRight:20}},h.a.createElement(s.a,{className:"font14",checked:dn!=null&&dn.length?$.length===(dn==null?void 0:dn.length):!1,onChange:function(Ke){return Kr(Ke.target.checked)}},"\u672C\u9875\u5168\u9009",h.a.createElement("span",{style:{color:"#999",fontSize:12}},"/\u5DF2\u9009(",$==null?void 0:$.length,")"))),h.a.createElement("div",{className:se.a.btns},Vt&&!!($!=null&&$.length)&&h.a.createElement("div",{className:se.a.btn,onClick:function(){return ni(!0)}},h.a.createElement("i",{className:"iconfont icon-piliangjiaru"}),"\u6279\u91CF\u52A0\u5165"),Vt&&!!($!=null&&$.length)&&h.a.createElement("div",{className:se.a.btn,onClick:function(){return ni(!1)}},h.a.createElement("i",{className:"iconfont icon-piliangyichu"}),"\u6279\u91CF\u79FB\u51FA"),h.a.createElement("div",{className:"c-grey-333 font12 mr40",style:{marginLeft:"auto"}},"\u5DF2\u52A0\u5165:\xA0\xA0",Sr,"\u9898"),h.a.createElement("div",{onClick:va,className:se.a.btn},"\u8FD4\u56DE\u8BD5\u5377")))),xe&&h.a.createElement("div",{className:se.a.batch},h.a.createElement("aside",null,h.a.createElement("div",{style:{flexShrink:0,marginRight:20}},h.a.createElement(K.a,{showQuickJumper:!0,onChange:so,defaultCurrent:1,pageSize:Ae==null?void 0:Ae.per_page,current:Ae.page||1,hideOnSinglePage:!0,total:Gt,showTotal:function(Ke){return h.a.createElement("span",{className:"mr10"},"\u5171",h.a.createElement("span",{className:"c-light-primary"},Ke),"\u6761\u6570\u636E")}})),h.a.createElement("div",{className:se.a.btns},h.a.createElement(G.a,{align:"middle",style:{marginLeft:"auto"}},h.a.createElement(G.a,{onClick:function(){if((en==null?void 0:en.length)<=0){d.b.info("\u5F53\u524D\u6682\u65E0\u6570\u636E");return}Ga(!0)},align:"middle",className:"current"},h.a.createElement("i",{className:"iconfont icon-yixuan mr10 c-light-primary font20"}),h.a.createElement("span",null,"\u5DF2\u9009",h.a.createElement("span",{className:"c-light-primary"},$.length),"\u4E2A")),h.a.createElement(P.a,{className:"mr20 ml40",onClick:function(){if(Re){var Ke;N.d.push("/classrooms/".concat(hn.params.coursesId,"/program_homework/").concat(hn==null||((Ke=hn.params)===null||Ke===void 0)?void 0:Ke.categoryId,"/detail?tabs=1"));return}N.d.push("/classrooms/".concat(hn.params.coursesId,"/program_homework"))}},"\u53D6\u6D88"),h.a.createElement(P.a,{loading:_n,onClick:Ya,type:"primary"},"\u786E\u8BA4",Re?"\u7F16\u8F91":"\u65B0\u5EFA"))))))},pi=Ne.default=Object(N.a)(function(Wt){var lt=Wt.classroomList,Rt=Wt.problemset,Tt=Wt.user,Ot=Wt.loading,pn=Wt.globalSetting,bn=Wt.shixunHomeworks;return{classroomList:lt,problemset:Rt,user:Tt,globalSetting:pn,loading:Ot.effects,shixunHomeworks:bn}})(Li)},LE3n:function(at,Ne,F){"use strict";var q=F("ozfa"),G=F("MJZm"),R=F("k1fw"),K=F("+L6B"),O=F("2/Rp"),L=F("5NDa"),U=F("5rEg"),I=F("2qtc"),T=F("kLXV"),P=F("miYZ"),b=F("tsqr"),g=F("9og8"),k=F("tJVT"),w=F("WmNS"),p=F.n(w),y=F("cDcd"),f=F.n(y),s=F("1vnw"),c=F.n(s),d=F("ErOA"),S=F("Ix/O"),C=F.n(S),m=F("xTzM"),A=F.n(m),x=F("WCUW"),u=F("LvDl"),l=F.n(u),a=function(v){var _=v.isProblemset,D=v.name,B=v.id,j=v.itemBanksCount,W=v.onOpen,h=W===void 0?function(){}:W,N=v.onShare,H=N===void 0?function(){}:N,X=v.onMove,Y=X===void 0?function(){}:X,re=v.onDeleteOk,he=re===void 0?function(){}:re,de=Object(y.useState)(!1),ne=Object(k.a)(de,2),ae=ne[0],le=ne[1],ee=Object(y.useState)(D),ie=Object(k.a)(ee,2),ve=ie[0],Pe=ie[1],Ie=Object(y.useState)(D),we=Object(k.a)(Ie,2),ke=we[0],De=we[1],Le=function(){var ze=Object(g.a)(p.a.mark(function Je(Ye){var Ge,ht,ot;return p.a.wrap(function(qe){for(;;)switch(qe.prev=qe.next){case 0:if(Ge=["\uFF1F","\u3001","/","\u2572","*","<",">","|"],ke.trim()){qe.next=4;break}return b.b.warn("\u8BF7\u8F93\u5165\u6587\u4EF6\u5939\u540D\u79F0"),qe.abrupt("return");case 4:if(!(ke.charAt(0)===" ")){qe.next=7;break}return b.b.warn("\u9996\u5B57\u7B26\u4E0D\u80FD\u4E3A\u7A7A\u683C"),qe.abrupt("return");case 7:ht=0;case 8:if(!(ht<ke.length)){qe.next=15;break}if(!Ge.includes(ke.charAt(ht))){qe.next=12;break}return b.b.warn("\u6587\u4EF6\u5939\u540D\u79F0\u5305\u542B\u7279\u6B8A\u5B57\u7B26"),qe.abrupt("return",!1);case 12:ht++,qe.next=8;break;case 15:return qe.next=17,Object(d.a)("/api/item_banks_groups/".concat(Math.abs(Ye),".json"),{method:"put",body:{name:ke}});case 17:ot=qe.sent,ot.status===0&&(le(!1),Pe(ke));case 19:case"end":return qe.stop()}},Je)}));return function(Ye){return ze.apply(this,arguments)}}(),Ve=function(Je){T.a.confirm({title:"\u63D0\u793A",okText:"\u786E\u8BA4\u5220\u9664",className:"custom-modal-divider ",icon:null,content:f.a.createElement("div",null,f.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"),f.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 Ye=Object(g.a)(p.a.mark(function ht(){var ot;return p.a.wrap(function(qe){for(;;)switch(qe.prev=qe.next){case 0:return qe.next=2,Object(d.a)("/api/item_banks_groups/".concat(Math.abs(Je),".json"),{method:"delete",body:{}});case 2:ot=qe.sent,ot.status===0&&he(Je);case 4:case"end":return qe.stop()}},ht)}));function Ge(){return Ye.apply(this,arguments)}return Ge}()})};return f.a.createElement("div",{className:c.a.list},ae?f.a.createElement(U.a,{style:{maxWidth:780},value:ke,onChange:function(Je){return De(Je.target.value)}}):f.a.createElement("div",{title:ve,onClick:function(){return h(B)},className:c.a.name},ve),_&&f.a.createElement("div",{className:c.a.btns},ae?f.a.createElement(f.a.Fragment,null,f.a.createElement("div",{style:{height:16},onClick:function(){return Le(B)},className:"ml0"},f.a.createElement("i",{className:"iconfont icon-chenggong1",style:{color:"#33BD8C"}})),f.a.createElement("div",{style:{height:16},onClick:function(){De(ve),le(!1)},className:"ml10"},f.a.createElement("i",{className:"iconfont icon-qingchu"}))):f.a.createElement(f.a.Fragment,null,f.a.createElement("div",{onClick:function(){return Y(B,"up")},className:"ml0"},f.a.createElement("i",{className:"iconfont icon-shangyi3",style:{transform:"translateY(2px)"}})),f.a.createElement("div",{onClick:function(){return Y(B,"down")},className:"ml10",style:{transform:"rotate(180deg) translateY(1px)"}},f.a.createElement("i",{className:"iconfont icon-shangyi3"}))),f.a.createElement(O.a,{className:"ml10",onClick:function(){if(!j){b.b.warn("\u8BE5\u76EE\u5F55\u4E0B\u6CA1\u6709\u8BD5\u9898");return}H(Math.abs(B))},type:"link"},"\u5171\u4EAB\u5168\u90E8\u8BD5\u9898"),f.a.createElement(O.a,{className:"ml10",onClick:function(){return le(!0)},type:"link"},"\u91CD\u547D\u540D"),f.a.createElement(O.a,{onClick:function(){return Ve(B)},type:"link",danger:!0},"\u5220\u9664")))},i=function(v){var _=v.isProblemset,D=v.data,B=v.onOpen,j=B===void 0?function(){}:B,W=v.onShare,h=W===void 0?function(){}:W,N=v.reloadData,H=Object(y.useState)(),X=Object(k.a)(H,2),Y=X[0],re=X[1];Object(y.useEffect)(function(){re(D==null?void 0:D.map(function(ve){return{title:f.a.createElement(a,{isProblemset:_,name:ve.name,id:ve.id,itemBanksCount:ve.item_banks_count,onMove:de,onOpen:j,onShare:h,onDeleteOk:ae}),key:ve.id,icon:f.a.createElement("img",{src:C.a,className:c.a.folderIcon}),isLeaf:!1}}))},[D]);var he=function ve(Pe,Ie,we){for(var ke=Object(u.cloneDeep)(Pe),De=0;De<ke.length;De++){if(ke[De].key===Ie){if(we==="up"){var Le=[ke[De],ke[De-1]];ke[De-1]=Le[0],ke[De]=Le[1]}else{var Ve=[ke[De+1],ke[De]];ke[De]=Ve[0],ke[De+1]=Ve[1]}break}ke[De].children&&(ke[De].children=ve(ke[De].children,Ie,we))}return ke},de=function(){var ve=Object(g.a)(p.a.mark(function Pe(Ie,we){var ke;return p.a.wrap(function(Le){for(;;)switch(Le.prev=Le.next){case 0:if(!(we==="up")){Le.next=6;break}return Le.next=3,Object(x.I)({id:Math.abs(Ie)});case 3:Le.t0=Le.sent,Le.next=9;break;case 6:return Le.next=8,Object(x.H)({id:Math.abs(Ie)});case 8:Le.t0=Le.sent;case 9:ke=Le.t0,ke.status===0&&re(function(Ve){return he(Ve,Ie,we)});case 11:case"end":return Le.stop()}},Pe)}));return function(Ie,we){return ve.apply(this,arguments)}}(),ne=function ve(Pe,Ie){return Pe.filter(function(we){return we.key===Ie?!1:(we.children&&(we.children=ve(we.children,Ie)),!0)})},ae=function(Pe){re(function(Ie){return ne(Ie,Pe)}),N()},le=function ve(Pe,Ie,we){return Pe.map(function(ke){return ke.key===Ie?Object(R.a)(Object(R.a)({},ke),we):ke.children?Object(R.a)(Object(R.a)({},ke),{},{children:ve(ke.children,Ie,we)}):ke})},ee=function(){var ve=Object(g.a)(p.a.mark(function Pe(Ie){var we,ke,De,Le,Ve;return p.a.wrap(function(Je){for(;;)switch(Je.prev=Je.next){case 0:return we=Ie.key,Je.next=3,Object(x.B)({group_id:Math.abs(we)});case 3:ke=Je.sent,De=ke||{},Le=De.item_banks_group,Ve=De.item_banks_group_count,Ve>0?re(function(Ye){return le(Ye,we,{children:Le.map(function(Ge){return{title:f.a.createElement(a,{isProblemset:_,name:Ge.name,id:Ge.id,itemBanksCount:Ge.item_banks_count,onMove:de,onOpen:j,onShare:h,onDeleteOk:ae}),key:Ge.id,icon:f.a.createElement("img",{src:C.a,className:c.a.folderIcon}),isLeaf:!1}})})}):re(function(Ye){return le(Ye,we,{isLeaf:!0})});case 6:case"end":return Je.stop()}},Pe)}));return function(Ie){return ve.apply(this,arguments)}}(),ie=function(Pe,Ie){var we=Ie.node,ke=Ie.expanded;re(function(De){return le(De,we.key,{icon:ke?f.a.createElement("img",{src:A.a,className:c.a.folderIcon}):f.a.createElement("img",{src:C.a,className:c.a.folderIcon})})})};return(Y==null?void 0:Y.length)>0&&f.a.createElement(G.a,{showLine:{showLeafIcon:!1},showIcon:!0,treeData:Y,loadData:ee,onExpand:ie,className:c.a.folderWrapper,selectable:!1})};Ne.a=i},LdHM:function(at,Ne,F){"use strict";F.d(Ne,"b",function(){return d}),F.d(Ne,"a",function(){return C});var q=F("1OyB"),G=F("vuIU"),R=F("Ji7U"),K=F("LK+K"),O=F("cDcd"),L=F("rePB"),U=F("Ff2n"),I=F("ODXe"),T=F("4IlW"),P=F("bX4T"),b=F("YrtM"),g=F("TSYQ"),k=F.n(g),w=F("+nKL"),p=F("8OUc"),y=function(H,X){var Y=H.prefixCls,re=H.id,he=H.flattenOptions,de=H.childrenAsData,ne=H.values,ae=H.searchValue,le=H.multiple,ee=H.defaultActiveFirstOption,ie=H.height,ve=H.itemHeight,Pe=H.notFoundContent,Ie=H.open,we=H.menuItemSelectedIcon,ke=H.virtual,De=H.onSelect,Le=H.onToggleOpen,Ve=H.onActiveValue,ze=H.onScroll,Je=H.onMouseEnter,Ye="".concat(Y,"-item"),Ge=Object(b.a)(function(){return he},[Ie,he],function(rt,me){return me[0]&&rt[1]!==me[1]}),ht=O.useRef(null),ot=function(me){me.preventDefault()},st=function(me){ht.current&&ht.current.scrollTo({index:me})},qe=function(me){for(var se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,be=Ge.length,te=0;te<be;te+=1){var oe=(me+te*se+be)%be,ce=Ge[oe],_e=ce.group,je=ce.data;if(!_e&&!je.disabled)return oe}return-1},vt=O.useState(function(){return qe(0)}),pt=Object(I.a)(vt,2),gt=pt[0],Be=pt[1],Ct=function(me){Be(me);var se=Ge[me];if(!se){Ve(null,-1);return}Ve(se.data.value,me)};O.useEffect(function(){Ct(ee!==!1?qe(0):-1)},[Ge.length,ae]),O.useEffect(function(){var rt=setTimeout(function(){if(!le&&Ie&&ne.size===1){var me=Array.from(ne)[0],se=Ge.findIndex(function(be){var te=be.data;return te.value===me});Ct(se),st(se)}});return function(){return clearTimeout(rt)}},[Ie]);var yt=function(me){me!==void 0&&De(me,{selected:!ne.has(me)}),le||Le(!1)};if(O.useImperativeHandle(X,function(){return{onKeyDown:function(me){var se=me.which;switch(se){case T.a.UP:case T.a.DOWN:{var be=0;if(se===T.a.UP?be=-1:se===T.a.DOWN&&(be=1),be!==0){var te=qe(gt+be,be);st(te),Ct(te)}break}case T.a.ENTER:{var oe=Ge[gt];oe&&!oe.data.disabled?yt(oe.data.value):yt(void 0),Ie&&me.preventDefault();break}case T.a.ESC:Le(!1)}},onKeyUp:function(){},scrollTo:function(me){st(me)}}}),Ge.length===0)return O.createElement("div",{role:"listbox",id:"".concat(re,"_list"),className:"".concat(Ye,"-empty"),onMouseDown:ot},Pe);function He(rt){var me=Ge[rt];if(!me)return null;var se=me.data||{},be=se.value,te=se.label,oe=se.children,ce=Object(P.a)(se,!0),_e=de?oe:te;return me?O.createElement("div",Object.assign({"aria-label":typeof _e=="string"?_e:null},ce,{key:rt,role:"option",id:"".concat(re,"_list_").concat(rt),"aria-selected":ne.has(be)}),be):null}return O.createElement(O.Fragment,null,O.createElement("div",{role:"listbox",id:"".concat(re,"_list"),style:{height:0,width:0,overflow:"hidden"}},He(gt-1),He(gt),He(gt+1)),O.createElement(w.a,{itemKey:"key",ref:ht,data:Ge,height:ie,itemHeight:ve,fullHeight:!1,onMouseDown:ot,onScroll:ze,virtual:ke,onMouseEnter:Je},function(rt,me){var se,be=rt.group,te=rt.groupOption,oe=rt.data,ce=oe.label,_e=oe.key;if(be)return O.createElement("div",{className:k()(Ye,"".concat(Ye,"-group"))},ce!==void 0?ce:_e);var je=oe.disabled,Xe=oe.value,Ze=oe.title,_t=oe.children,It=oe.style,$e=oe.className,Qt=Object(U.a)(oe,["disabled","value","title","children","style","className"]),Bt=ne.has(Xe),Pt="".concat(Ye,"-option"),mn=k()(Ye,Pt,$e,(se={},Object(L.a)(se,"".concat(Pt,"-grouped"),te),Object(L.a)(se,"".concat(Pt,"-active"),gt===me&&!je),Object(L.a)(se,"".concat(Pt,"-disabled"),je),Object(L.a)(se,"".concat(Pt,"-selected"),Bt),se)),xn=de?_t:ce,er=!we||typeof we=="function"||Bt;return O.createElement("div",Object.assign({},Qt,{"aria-selected":Bt,className:mn,title:Ze,onMouseMove:function(){if(gt===me||je)return;Ct(me)},onClick:function(){je||yt(Xe)},style:It}),O.createElement("div",{className:"".concat(Pt,"-content")},xn||Xe),O.isValidElement(we)||Bt,er&&O.createElement(p.a,{className:"".concat(Ye,"-option-state"),customizeIcon:we,customizeIconProps:{isSelected:Bt}},Bt?"\u2713":null))}))},f=O.forwardRef(y);f.displayName="OptionList";var s=f,c=function(){return null};c.isSelectOption=!0;var d=c,S=function(){return null};S.isSelectOptGroup=!0;var C=S,m=F("VTBJ"),A=F("Zm9Q");function x(N){var H=N.key,X=N.props,Y=X.children,re=X.value,he=Object(U.a)(X,["children","value"]);return Object(m.a)({key:H,value:re!==void 0?re:H,children:Y},he)}function u(N){var H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(A.a)(N).map(function(X,Y){if(!O.isValidElement(X)||!X.type)return null;var re=X.type.isSelectOptGroup,he=X.key,de=X.props,ne=de.children,ae=Object(U.a)(de,["children"]);return H||!re?x(X):Object(m.a)(Object(m.a)({key:"__RC_SELECT_GRP__".concat(he===null?Y:he,"__"),label:he},ae),{},{options:u(ne)})}).filter(function(X){return X})}var l=F("2Qr1"),a=F("qNPg"),i=F("U8pU"),E=F("Kwbf"),v=F("WKfj");function _(N){var H=N.mode,X=N.options,Y=N.children,re=N.backfill,he=N.allowClear,de=N.placeholder,ne=N.getInputElement,ae=N.showSearch,le=N.onSearch,ee=N.defaultOpen,ie=N.autoFocus,ve=N.labelInValue,Pe=N.value,Ie=N.inputValue,we=N.optionLabelProp,ke=H==="multiple"||H==="tags",De=ae!==void 0?ae:ke||H==="combobox",Le=X||u(Y);if(Object(E.a)(H!=="tags"||Le.every(function(Ye){return!Ye.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),H==="tags"||H==="combobox"){var Ve=Le.some(function(Ye){return Ye.options?Ye.options.some(function(Ge){return typeof("value"in Ge?Ge.value:Ge.key)=="number"}):typeof("value"in Ye?Ye.value:Ye.key)=="number"});Object(E.a)(!Ve,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(E.a)(H!=="combobox"||!we,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(E.a)(H==="combobox"||!re,"`backfill` only works with `combobox` mode."),Object(E.a)(H==="combobox"||!ne,"`getInputElement` only work with `combobox` mode."),Object(E.b)(H!=="combobox"||!ne||!he||!de,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),le&&!De&&H!=="combobox"&&H!=="tags"&&Object(E.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(E.b)(!ee||ie,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Pe!=null){var ze=Object(v.d)(Pe);Object(E.a)(!ve||ze.every(function(Ye){return Object(i.a)(Ye)==="object"&&("key"in Ye||"value"in Ye)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(E.a)(!ke||Array.isArray(Pe),"`value` should be array when `mode` is `multiple` or `tags`")}if(Y){var Je=null;Object(A.a)(Y).some(function(Ye){if(!O.isValidElement(Ye)||!Ye.type)return!1;var Ge=Ye.type;if(Ge.isSelectOption)return!1;if(Ge.isSelectOptGroup){var ht=Object(A.a)(Ye.props.children).every(function(ot){return!O.isValidElement(ot)||!Ye.type||ot.type.isSelectOption?!0:(Je=ot.type,!1)});return!ht}return Je=Ge,!0}),Je&&Object(E.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Je.displayName||Je.name||Je,"`.")),Object(E.a)(Ie===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var D=_,B=Object(a.a)({prefixCls:"rc-select",components:{optionList:s},convertChildrenToData:u,flattenOptions:l.d,getLabeledValue:l.e,filterOptions:l.b,isValueDisabled:l.g,findValueOption:l.c,warningProps:D,fillOptionsWithMissingValue:l.a}),j=function(N){Object(R.a)(X,N);var H=Object(K.a)(X);function X(){var Y;return Object(q.a)(this,X),Y=H.apply(this,arguments),Y.selectRef=O.createRef(),Y.focus=function(){Y.selectRef.current.focus()},Y.blur=function(){Y.selectRef.current.blur()},Y}return Object(G.a)(X,[{key:"render",value:function(){return O.createElement(B,Object.assign({ref:this.selectRef},this.props))}}]),X}(O.Component);j.Option=d,j.OptGroup=C;var W=j,h=Ne.c=W},M8RZ:function(at,Ne,F){"use strict";F.d(Ne,"a",function(){return T});var q=F("fWQN"),G=F("mtLc"),R=F("yKVA"),K=F("879j"),O=F("cDcd"),L=F.n(O),U=F("faye"),I=F.n(U),T=function(P){Object(R.a)(g,P);var b=Object(K.a)(g);function g(k){var w;Object(q.a)(this,g),w=b.call(this,k);var p=window.document;return w.node=p.createElement("div"),p.body.appendChild(w.node),w}return Object(G.a)(g,[{key:"render",value:function(){var w=this.props.children;return Object(U.createPortal)(w,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),g}(L.a.Component)},NLgs:function(at,Ne,F){"use strict";F.d(Ne,"e",function(){return d}),F.d(Ne,"f",function(){return S}),F.d(Ne,"d",function(){return m}),F.d(Ne,"c",function(){return A}),F.d(Ne,"a",function(){return x}),F.d(Ne,"b",function(){return u});var q=F("miYZ"),G=F("tsqr"),R=F("9og8"),K=F("2qtc"),O=F("kLXV"),L=F("WmNS"),U=F.n(L),I=F("cDcd"),T=F.n(I),P=F("9kvl"),b=F("xKgJ"),g=F("1vsH"),k=F("RCxd"),w=F("mOS8"),p=F.n(w),y=F("1ZF9"),f=F.n(y),s=F("NoGO"),c=F.n(s),d=function(a){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!!(S(a)&&C(i))},S=function(a){return Object(b.p)()?!0:(a({type:"user/showPopLogin",payload:{showPopLogin:!0,showClosable:!0}}),!1)},C=function(){var a,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,E=Object(P.c)()._store.getState(),v=E.user;return(a=v.userInfo)!==null&&a!==void 0&&a.profile_completed?!0:(O.a.confirm({title:"\u63D0\u793A",width:530,centered:!0,content:i?"\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(){P.d.push("/account/profile/edit")}}),!1)},m=function(){var a,i=Object(P.c)()._store.getState(),E=i.user;return(a=E.userInfo)!==null&&a!==void 0&&a.professional_certification?!0:(O.a.confirm({title:"\u63D0\u793A",centered:!0,content:T.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(g.U)("/account/certification")}}),!1)},A=function(){return Object(b.a)()?!0:(O.a.warning({centered:!0,width:530,title:"\u63D0\u793A",content:T.a.createElement("div",{className:"tc",style:{marginLeft:-38}},T.a.createElement("p",null,"\u626B\u7801\u52A0\u5934\u6B4C\u52A9\u6559\uFF0C\u7533\u8BF7\u64CD\u4F5C\u6743\u9650"),T.a.createElement("img",{src:c.a,width:200})),okText:"\u6211\u77E5\u9053\u4E86",maskClosable:!0}),!1)},x=function(a,i){return a?!0:(O.a.confirm({centered:!0,zIndex:1e4,width:530,title:"\u63D0\u793A",content:T.a.createElement("div",null,T.a.createElement("p",null,i||"\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"),T.a.createElement("div",{style:{marginLeft:"110px"}},T.a.createElement("img",{src:f.a,width:200}),T.a.createElement("div",{style:{marginLeft:"35px"}},"\u7FA4\u53F7\uFF1A","714336072"))),okText:"\u7ACB\u5373\u8054\u7CFB",cancelText:"\u53D6\u6D88",onOk:function(){Object(g.U)("https://qm.qq.com/cgi-bin/qm/qr?k=tIyDPXUtE0yEk-MOJxhH55lTUJS-nYAM&jump_from=webapi")}}),!1)},u=function(a){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",E=Object(P.c)()._store.getState(),v=E.shixunsDetail.detail;return(v==null?void 0:v.public)===2||(v==null?void 0:v.public)===1||(v==null?void 0:v.shixun_status)===3?(O.a.info({centered:!0,icon:T.a.createElement(k.a,{style:{color:"#faad14"}}),width:460,title:"\u63D0\u793A",content:T.a.createElement("div",{className:"tc",style:{marginLeft:-38}},T.a.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",paddingLeft:38,margin:"12px 0"}},T.a.createElement("span",null,"\u8BE5\u5B9E\u8DF5\u9879\u76EE\u7684\u72B6\u6001\u4E3A",(v==null?void 0:v.public)===2?"\u5DF2\u516C\u5F00":(v==null?void 0:v.public)===1?"\u5F85\u5BA1\u6838":"\u5DF2\u5173\u95ED","\uFF0C",i,"\u3002"),T.a.createElement("p",null,"\u5982\u6709\u9700\u8981\uFF0C\u8BF7\u8054\u7CFB\u5E73\u53F0\u7BA1\u7406\u5458\u8FDB\u884C\u6280\u672F\u652F\u6301\u3002")),T.a.createElement("img",{style:{border:"4px solid #0152d9",borderRadius:"4px"},src:p.a,alt:"\u4E8C\u7EF4\u7801",width:160})),okText:"\u6211\u77E5\u9053\u4E86"}),!0):(v==null?void 0:v.shixun_status)===2?(O.a.confirm({centered:!0,icon:T.a.createElement(k.a,null),title:"\u63D0\u793A",content:T.a.createElement("div",null,T.a.createElement("span",null,"\u8BE5\u5B9E\u8DF5\u9879\u76EE\u5DF2\u53D1\u5E03\uFF0C",i,"\u3002"),T.a.createElement("br",null),T.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(){O.a.confirm({width:440,centered:!0,icon:T.a.createElement(k.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 D=Object(R.a)(U.a.mark(function j(){var W;return U.a.wrap(function(N){for(;;)switch(N.prev=N.next){case 0:return N.next=2,a({type:"shixunsDetail/cancelRelease",payload:{id:v==null?void 0:v.identifier}});case 2:W=N.sent,W.status!==401&&(G.b.success("\u64A4\u9500\u53D1\u5E03\u6210\u529F\u3002\u5B9E\u8BAD\u56DE\u5230\u672A\u53D1\u5E03\u7684\u72B6\u6001\u3002"),a({type:"shixunsDetail/getShixunsDetail",payload:{id:v==null?void 0:v.identifier}}),a({type:"practiceSetting/getCommonData",payload:{id:v==null?void 0:v.identifier}}));case 4:case"end":return N.stop()}},j)}));function B(){return D.apply(this,arguments)}return B}()})}}),!0):!1}},NoGO:function(at,Ne,F){at.exports=F.p+"static/newqrcode.9bae6615.png"},NvD2:function(at,Ne,F){"use strict";F.d(Ne,"a",function(){return L});var q=F("Kwbf");function G(U,I){var T=new Set;return U.forEach(function(P){I.has(P)||T.add(P)}),T}function R(U){var I=U||{},T=I.disabled,P=I.disableCheckbox,b=I.checkable;return!!(T||P)||b===!1}function K(U,I,T,P){for(var b=new Set(U),g=new Set,k=0;k<=T;k+=1){var w=I.get(k)||new Set;w.forEach(function(s){var c=s.key,d=s.node,S=s.children,C=S===void 0?[]:S;b.has(c)&&!P(d)&&C.filter(function(m){return!P(m.node)}).forEach(function(m){b.add(m.key)})})}for(var p=new Set,y=T;y>=0;y-=1){var f=I.get(y)||new Set;f.forEach(function(s){var c=s.parent,d=s.node;if(P(d)||!s.parent||p.has(s.parent.key))return;if(P(s.parent.node)){p.add(c.key);return}var S=!0,C=!1;(c.children||[]).filter(function(m){return!P(m.node)}).forEach(function(m){var A=m.key,x=b.has(A);S&&!x&&(S=!1),!C&&(x||g.has(A))&&(C=!0)}),S&&b.add(c.key),C&&g.add(c.key),p.add(c.key)})}return{checkedKeys:Array.from(b),halfCheckedKeys:Array.from(G(g,b))}}function O(U,I,T,P,b){for(var g=new Set(U),k=new Set(I),w=0;w<=P;w+=1){var p=T.get(w)||new Set;p.forEach(function(c){var d=c.key,S=c.node,C=c.children,m=C===void 0?[]:C;!g.has(d)&&!k.has(d)&&!b(S)&&m.filter(function(A){return!b(A.node)}).forEach(function(A){g.delete(A.key)})})}k=new Set;for(var y=new Set,f=P;f>=0;f-=1){var s=T.get(f)||new Set;s.forEach(function(c){var d=c.parent,S=c.node;if(b(S)||!c.parent||y.has(c.parent.key))return;if(b(c.parent.node)){y.add(d.key);return}var C=!0,m=!1;(d.children||[]).filter(function(A){return!b(A.node)}).forEach(function(A){var x=A.key,u=g.has(x);C&&!u&&(C=!1),!m&&(u||k.has(x))&&(m=!0)}),C||g.delete(d.key),m&&k.add(d.key),y.add(d.key)})}return{checkedKeys:Array.from(g),halfCheckedKeys:Array.from(G(k,g))}}function L(U,I,T,P){var b=[],g;P?g=P:g=R;var k=new Set(U.filter(function(f){var s=!!T[f];return s||b.push(f),s})),w=new Map,p=0;Object.keys(T).forEach(function(f){var s=T[f],c=s.level,d=w.get(c);d||(d=new Set,w.set(c,d)),d.add(s),p=Math.max(p,c)}),Object(q.a)(!b.length,"Tree missing follow keys: ".concat(b.slice(0,100).map(function(f){return"'".concat(f,"'")}).join(", ")));var y;return I===!0?y=K(k,w,p,g):y=O(k,I.halfCheckedKeys,w,p,g),y}},"ORt/":function(at,Ne,F){at.exports={operating:"operating___1LS8K",tip:"tip___3LKV6"}},OZM5:function(at,Ne,F){"use strict";F.d(Ne,"b",function(){return P}),F.d(Ne,"a",function(){return b}),F.d(Ne,"k",function(){return g}),F.d(Ne,"h",function(){return k}),F.d(Ne,"i",function(){return w}),F.d(Ne,"g",function(){return p}),F.d(Ne,"c",function(){return y}),F.d(Ne,"d",function(){return f}),F.d(Ne,"j",function(){return d}),F.d(Ne,"e",function(){return S}),F.d(Ne,"f",function(){return C});var q=F("KQm4"),G=F("U8pU"),R=F("Ff2n"),K=F("cDcd"),O=F.n(K),L=F("Kwbf"),U=F("WaYH"),I=.25,T=2;function P(m,A){var x=m.slice(),u=x.indexOf(A);return u>=0&&x.splice(u,1),x}function b(m,A){var x=m.slice();return x.indexOf(A)===-1&&x.push(A),x}function g(m){return m.split("-")}function k(m,A){return"".concat(m,"-").concat(A)}function w(m){return m&&m.type&&m.type.isTreeNode}function p(m,A){var x=[m],u=A[m];function l(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];a.forEach(function(i){var E=i.key,v=i.children;x.push(E),l(v)})}return l(u.children),x}function y(m,A){var x=m.clientY,u=A.selectHandle.getBoundingClientRect(),l=u.top,a=u.bottom,i=u.height,E=Math.max(i*I,T);return x<=l+E?-1:x>=a-E?1:0}function f(m,A){if(!m)return;var x=A.multiple;return x?m.slice():m.length?[m[0]]:m}var s=function(A){return A};function c(m,A){if(!m)return[];var x=A||{},u=x.processProps,l=u===void 0?s:u,a=Array.isArray(m)?m:[m];return a.map(function(i){var E=i.children,v=Object(R.a)(i,["children"]),_=c(E,A);return O.a.createElement(U.a,Object.assign({},l(v)),_)})}function d(m){if(!m)return null;var A;if(Array.isArray(m))A={checkedKeys:m,halfCheckedKeys:void 0};else if(Object(G.a)(m)==="object")A={checkedKeys:m.checked||void 0,halfCheckedKeys:m.halfChecked||void 0};else return Object(L.a)(!1,"`checkedKeys` is not an array or an object"),null;return A}function S(m,A){var x=new Set;function u(l){if(x.has(l))return;var a=A[l];if(!a)return;x.add(l);var i=a.parent,E=a.node;if(E.disabled)return;i&&u(i.key)}return(m||[]).forEach(function(l){u(l)}),Object(q.a)(x)}function C(m){var A={};return Object.keys(m).forEach(function(x){(x.startsWith("data-")||x.startsWith("aria-"))&&(A[x]=m[x])}),A}},Ot1p:function(at,Ne,F){"use strict";var q=F("2qtc"),G=F("kLXV"),R=F("rAM+"),K=F("miYZ"),O=F("tsqr"),L=F("9og8"),U=F("tJVT"),I=F("jrin"),T=F("WmNS"),P=F.n(T),b=F("cDcd"),g=F.n(b),k=F("VrN/"),w=F.n(k),p=F("bdgK"),y=F("p77/"),f=F("Bd2K"),s=F("ELLl"),c=F("19Vz"),d=F("lZu9"),S=F("+NIl"),C=F("kSUc"),m=F("9Bee"),A=function($e){var Qt=$e.value,Bt=Qt===void 0?"":Qt,Pt=$e.className,mn=$e.showTextOnly,xn=$e.showLines,er=$e.style,Qn=er===void 0?{}:er,nn=Object(b.useMemo)(function(){return""},[Bt]);return g.a.createElement(g.a.Fragment,null,g.a.createElement("div",{dangerouslySetInnerHTML:{__html:nn}}))},x=F("Q9mQ"),u=F("diRs"),l=F("0Owb"),a=F("dejd"),i=F("C+DQ"),E=F("D1Df"),v=F.n(E),_=F("1vsH"),D=F("m3rI"),B=[{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 j($e){var Qt=$e.onActionCallback,Bt=$e.title,Pt=$e.icon,mn=$e.actionName,xn=$e.className,er=xn===void 0?"":xn,Qn=$e.children;function nn(){Qt(mn)}return g.a.createElement("a",{title:Bt,className:er,onClick:nn},g.a.createElement("i",{className:"md-iconfont ".concat(Pt)}),Qn)}var W=function($e){var Qt=$e.watch,Bt=$e.showNullButton,Pt=$e.onActionCallback,mn=$e.fullScreen,xn=$e.insertTemp,er=$e.hidetoolBar,Qn=$e.uuid,nn=$e.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(_.G)("_educoder_session_login"),"&_educoder_session=").concat(Object(_.G)("_educoder_session"),"&key=").concat(Qn,"&api=").concat(encodeURIComponent(D.a.PROXY_SERVER)));var ur=[].concat(B,[{title:"".concat(Qt?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Qt?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return g.a.createElement("ul",{className:"markdown-toolbar-container"},!er&&ur.map(function(hr,vr){return g.a.createElement("li",{key:vr},hr.actionName?g.a.createElement(j,Object(l.a)({},hr,{onActionCallback:Pt})):g.a.createElement("span",{className:"v-line"}))}),Bt?g.a.createElement("li",null,g.a.createElement(j,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:Pt},g.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,xn&&g.a.createElement("li",null,g.a.createElement(j,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(xn),onActionCallback:Pt},g.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),g.a.createElement("li",null,g.a.createElement(u.a,{title:"\u6253\u5F00\u624B\u673A\u626B\u4E00\u626B",content:g.a.createElement("div",null,g.a.createElement(v.a,{size:150,fgColor:"#000",value:"https://test2.educoder.net/upload.html?_educoder_session_login=".concat(Object(_.G)("_educoder_session_login"),"&_educoder_session=").concat(Object(_.G)("_educoder_session"),"&key=").concat(Qn,"&api=").concat(encodeURIComponent(D.a.PROXY_SERVER))}))},g.a.createElement("span",{className:"fill-tip",onMouseOver:function(){return nn(!0)}},"\u624B\u673A\u4E0A\u4F20\u6587\u4EF6"))),g.a.createElement("li",{className:"btn-full-screen"},g.a.createElement(j,{icon:"".concat(mn?"icon-shrink":"icon-enlarge"),title:mn?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:Pt})))},h=F("M8RZ"),N=F("+L6B"),H=F("2/Rp"),X=F("y8nQ"),Y=F("Vl3Y"),re=F("5NDa"),he=F("5rEg"),de={labelCol:{span:4},wrapperCol:{span:20}},ne=function($e){var Qt=$e.callback,Bt=$e.onCancel;function Pt(mn){Qt(mn)}return g.a.createElement(Y.a,Object(l.a)({},de,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Pt}),g.a.createElement(Y.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},g.a.createElement(he.a,null)),g.a.createElement(Y.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},g.a.createElement(he.a,null)),g.a.createElement("div",{className:"flex-container flex-end"},g.a.createElement(H.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),g.a.createElement(H.a,{type:"ghost",onClick:Bt},"\u53D6\u6D88")))},ae=F("7ahc"),le=F("k1fw"),ee=F("HmJG"),ie=F("BjJ7"),ve=Y.a.useForm,Pe={width:280,marginRight:10},Ie={labelCol:{span:5},wrapperCol:{span:19}},we=function($e){var Qt=$e.callback,Bt=$e.onCancel,Pt=ve(),mn=Object(U.a)(Pt,1),xn=mn[0],er=useRef();function Qn(hr){Qt(Object(le.a)(Object(le.a)({},hr),{},{name:er.current}))}function nn(hr,vr){if(hr.status===-1){O.b.error(hr.message);return}xn.setFieldsValue({src:"/api/attachments/".concat(hr.id),type:vr.type})}function ur(hr){var vr=hr.target.files[0];er.current=vr.name,De(vr,nn)}return g.a.createElement(Y.a,Object(l.a)({form:xn},Ie,{className:"upload-image-panel",onFinish:Qn}),g.a.createElement(Y.a.Item,{label:"\u6587\u4EF6\u5730\u5740",required:!0},g.a.createElement("div",{className:"flex-container"},g.a.createElement(Y.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5730\u5740"}]},g.a.createElement(he.a,{style:Pe})),g.a.createElement(ke,{onFileChange:ur}))),g.a.createElement(Y.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},g.a.createElement(he.a,{style:{width:264}})),g.a.createElement(Y.a.Item,{style:{textAlign:"right"}},g.a.createElement(H.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),g.a.createElement(H.a,{type:"ghost",onClick:Bt},"\u53D6\u6D88")))};function ke($e){var Qt=$e.onFileChange;return g.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",g.a.createElement("input",{type:"file",onChange:Qt}))}function De($e,Qt){if(!$e)throw new String("\u6CA1\u6709\u6587\u4EF6");var Bt=new FormData;Bt.append("editormd-image-file",$e),Bt.append("file_param_name","editormd-image-file"),Bt.append("byxhr","true");var Pt=new window.XMLHttpRequest;Pt.withCredentials=!0,Pt.addEventListener("load",function(mn){Qt(JSON.parse(mn.target.responseText),$e)},!1),Pt.addEventListener("error",function(mn){console.error(mn)},!1),Pt.open("POST","".concat(ie.a,"/api/attachments.json")),Pt.send(Bt)}var Le=F("giR+"),Ve=F("fyUT"),ze=F("7Kak"),Je=F("9yH6"),Ye=Je.a.Group,Ge={margin:"0 8px"},ht=function($e){var Qt=$e.callback,Bt=$e.onCancel;function Pt(mn){Qt(mn)}return g.a.createElement(Y.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Pt},g.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},g.a.createElement("span",{style:Ge},"\u5355\u5143\u683C\u6570\uFF1A"),g.a.createElement("span",{style:Ge},"\u884C\u6570"),g.a.createElement(Y.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},g.a.createElement(Ve.a,null)),g.a.createElement("span",{style:Ge},"\u5217\u6570"),g.a.createElement(Y.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},g.a.createElement(Ve.a,null))),g.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},g.a.createElement("span",{style:Ge},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),g.a.createElement(Y.a.Item,{name:"align"},g.a.createElement(Ye,null,g.a.createElement(Je.a,{value:"default"},g.a.createElement("i",{className:"fa fa-align-justify"})),g.a.createElement(Je.a,{value:"left"},g.a.createElement("i",{className:"fa fa-align-left"})),g.a.createElement(Je.a,{value:"center"},g.a.createElement("i",{className:"fa fa-align-center"})),g.a.createElement(Je.a,{value:"right"},g.a.createElement("i",{className:"fa fa-align-right"}))))),g.a.createElement("div",{className:"flex-container flex-end"},g.a.createElement(H.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),g.a.createElement(H.a,{type:"ghost",onClick:Bt},"\u53D6\u6D88")))},ot=F("ErOA"),st=F("7Cbv"),qe="link",vt="upload-image",pt="code-block",gt="add-table",Be="------------",Ct={default:Be,left:":".concat(Be),center:":".concat(Be,":"),right:"".concat(Be,":")},yt=F("9VGf"),He,rt;function me(){}var se=0,be=1e4,te="\u2581",oe=`
**\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 ce($e){return/^\d+$/.test($e)?"".concat($e,"px"):$e}var _e=navigator.platform.toUpperCase().indexOf("MAC")>=0,je=_e?"Cmd":"Ctrl",Xe=["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"],Ze=(He={},Object(I.a)(He,je+"-B","bold"),Object(I.a)(He,je+"-I","italic"),He),_t=(rt={},Object(I.a)(rt,qe,"\u6DFB\u52A0\u94FE\u63A5"),Object(I.a)(rt,pt,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(I.a)(rt,vt,"\u6DFB\u52A0\u6587\u4EF6"),Object(I.a)(rt,gt,"\u6DFB\u52A0\u8868\u683C"),rt),It=Ne.a=function($e){var Qt=$e.defaultValue,Bt=Qt===void 0?"":Qt,Pt=$e.onChange,mn=$e.width,xn=mn===void 0?"100%":mn,er=$e.height,Qn=er===void 0?400:er,nn=$e.miniToolbar,ur=nn===void 0?!1:nn,hr=$e.isFocus,vr=hr===void 0?!1:hr,ca=$e.watch,mr=$e.insertTemp,Da=$e.mode,Rr=Da===void 0?"markdown":Da,fa=$e.id,tr=fa===void 0?"markdown-editor-id":fa,dr=$e.showResizeBar,Ut=dr===void 0?!1:dr,ra=$e.noStorage,Ua=ra===void 0?!1:ra,Hr=$e.showNullButton,Kn=Hr===void 0?!1:Hr,ja=$e.hidetoolBar,ri=ja===void 0?!1:ja,Aa=$e.fullScreen,ct=Aa===void 0?!1:Aa,rn=$e.onBlur,Ha=$e.onCMBeforeChange,Za=$e.onFullScreen,ai=$e.className,Ja=ai===void 0?"":ai,_i=$e.disablePaste,ln=_i===void 0?!1:_i,Mi=$e.placeholder,Qi=Mi===void 0?"":Mi,Ba=$e.values,oa=Ba===void 0?"":Ba,ii=Object(b.useState)(null),xi=Object(U.a)(ii,2),bt=xi[0],gr=xi[1],Li=Object(b.useState)(Bt),pi=Object(U.a)(Li,2),Wt=pi[0],lt=pi[1],Rt=Object(b.useState)(ca),Tt=Object(U.a)(Rt,2),Ot=Tt[0],pn=Tt[1],bn=Object(b.useState)(ct),$t=Object(U.a)(bn,2),Zt=$t[0],wn=$t[1],fn=Object(b.useState)(""),Xt=Object(U.a)(fn,2),En=Xt[0],Vn=Xt[1],$n=Object(b.useState)(0),Jt=Object(U.a)($n,2),un=Jt[0],Zn=Jt[1],Hn=Object(b.useState)(Qn),an=Object(U.a)(Hn,2),hn=an[0],Cn=an[1],Nt=Object(b.useState)(!1),Lt=Object(U.a)(Nt,2),jt=Lt[0],Ae=Lt[1],Ht=Object(b.useRef)(Object(st.a)()),Tn=Object(b.useRef)(!1),nr=Object(b.useRef)(),Gt=Object(b.useRef)(),Xr=Object(b.useRef)(),Pa=Object(b.useRef)(),zr=Object(b.useRef)(),dn=function(){var Mt=Object(L.a)(P.a.mark(function cn(){var Yt,Un;return P.a.wrap(function(cr){for(;;)switch(cr.prev=cr.next){case 0:return cr.next=2,Object(ot.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:Ht.current}});case 2:Un=cr.sent,Un!=null&&(Yt=Un.attachments)!==null&&Yt!==void 0&&Yt.length&&(console.log("cm:",bt,Gt),Un.attachments.map(function(Mn){Mn.content_type.indexOf("image")>-1?bt.replaceSelection("![,](/api/attachments/".concat(Mn.id,"?type=").concat(Mn.content_type,")")):Mn.content_type.indexOf("video")>-1?bt.replaceSelection('<video width="100%" controls src="'.concat(D.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):Mn.content_type.indexOf("pdf")>-1?bt.replaceSelection('<a href="'.concat(D.a.API_SERVER,"/api/attachments/").concat(Mn.id,"?type=").concat(Mn.content_type,'&disposition=inline" target="_blank">').concat(Mn.name,"</a>")):bt.replaceSelection("[".concat(Mn.name,"](").concat(D.a.API_SERVER,"/api/attachments/").concat(Mn.id,"?type=").concat(Mn.content_type,")"))}));case 4:case"end":return cr.stop()}},cn)}));return function(){return Mt.apply(this,arguments)}}();Object(b.useEffect)(function(){lt(oa),bt==null||bt.setValue(oa)},[oa]),Object(b.useEffect)(function(){Za==null||Za(Zt)},[Zt]),Object(b.useEffect)(function(){if(Gt.current){var Mt=w.a.fromTextArea(Gt.current,{mode:Rr,lineNumbers:!ur,lineWrapping:!0,value:Bt,autoCloseTags:!0,autoCloseBrackets:!0});vr&&Mt.focus();function cn(Yt,Un){if(ln){Un.preventDefault();return}var Gn=Un.clipboardData;if(Gn){var cr=Gn.types.toString(),Mn=Gn.items;if(cr==="Files"||Gn.types.indexOf("Files")>-1){if(Un.preventDefault(),Rr=="stex")return;try{var Or,Ur=Mn[1];((Or=Mn[0])===null||Or===void 0?void 0:Or.kind)==="file"&&(Ur=Mn[0]);var jn=Ur.getAsFile(),Oa=jn.name.split(".").pop();De(jn,function(ar){if(ar.id){var qr,Jn,ha;(jn==null||((qr=jn.type)===null||qr===void 0)?void 0:qr.indexOf("image"))>-1?Mt.replaceSelection("![,](/api/attachments/".concat(ar.id,"?type=").concat(ar.content_type,")")):(jn==null||((Jn=jn.type)===null||Jn===void 0)?void 0:Jn.indexOf("video"))>-1?Mt.replaceSelection('<video width="100%" controls src="'.concat(D.a.API_SERVER,"/api/attachments/").concat(ar.id,'"></video>')):(jn==null||((ha=jn.type)===null||ha===void 0)?void 0:ha.indexOf("pdf"))>-1?Mt.replaceSelection('<a href="'.concat(D.a.API_SERVER,"/api/attachments/").concat(ar.id,"?type=").concat(jn.type,'&disposition=inline" target="_blank">').concat(jn.name,"</a>")):Xe.includes(Oa)?Mt.replaceSelection('<a href="'.concat(D.a.API_SERVER,"/api/attachments/").concat(ar.id,'?type=office&disposition=inline" target="_blank">').concat(jn.name,"</a>")):Mt.replaceSelection("[".concat(jn.name,"](").concat(D.a.API_SERVER,"/api/attachments/").concat(ar.id,"?type=").concat(ar.content_type,")"))}else(ar==null?void 0:ar.status)===401&&(document.location.href="/user/login")})}catch(ar){O.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return Mt.on("paste",cn),Mt.on("dragleave",function(Yt,Un){Xr.current.classList.remove("mouse-hover-md")}),Mt.on("dragover",function(Yt,Un){Xr.current.classList.add("mouse-hover-md")}),Mt.on("drop",function(Yt,Un){Xr.current.classList.add("mouse-hover-md");var Gn;if(Gn=Un.dataTransfer.files,Gn.length>0){Un.preventDefault(),Un.stopPropagation();for(var cr=function(Ur){var jn=Gn[Ur],Oa=jn.name.split(".").pop();De(jn,function(ar){if(ar.id){var qr,Jn,ha;(jn==null||((qr=jn.type)===null||qr===void 0)?void 0:qr.indexOf("image"))>-1?Mt.replaceSelection("![,](/api/attachments/".concat(ar.id,"?type=").concat(ar.content_type,")")):(jn==null||((Jn=jn.type)===null||Jn===void 0)?void 0:Jn.indexOf("video"))>-1?Mt.replaceSelection('<video width="100%" controls src="'.concat(D.a.API_SERVER,"/api/attachments/").concat(ar.id,'"></video>')):(jn==null||((ha=jn.type)===null||ha===void 0)?void 0:ha.indexOf("pdf"))>-1?Mt.replaceSelection('<a href="'.concat(D.a.API_SERVER,"/api/attachments/").concat(ar.id,"?type=").concat(jn.type,'&disposition=inline" target="_blank">').concat(jn.name,"</a>")):Xe.includes(Oa)?Mt.replaceSelection('<a href="'.concat(D.a.API_SERVER,"/api/attachments/").concat(ar.id,'?type=office&disposition=inline" target="_blank">').concat(jn.name,"</a>")):Mt.replaceSelection("[".concat(jn.name,"](").concat(D.a.API_SERVER,"/api/attachments/").concat(ar.id,"?type=").concat(ar.content_type,")"))}else(ar==null?void 0:ar.status)===401&&(document.location.href="/user/login")})},Mn=0;Mn<Gn.length;Mn++)cr(Mn)}}),gr(Mt),function(){Mt.off("paste",cn)}}},[]);var St=Object(b.useCallback)(function(){if(Xr.current)try{}catch(Mt){console.log(Mt,"---- to set md editor body height")}},[hn,Xr,Zt]);Object(b.useEffect)(function(){function Mt(){var Yt=new p.default(function(Un){var Gn=Object(R.a)(Un),cr;try{for(Gn.s();!(cr=Gn.n()).done;){var Mn=cr.value;(Mn.target.offsetHeight>0||Mn.target.offsetWidth>0)&&(St(),bt.setSize("100%","100%"),bt.refresh())}}catch(Or){Gn.e(Or)}finally{Gn.f()}});return Yt.observe(Gt.current.parentElement),Yt}if(bt){var cn=Mt();return function(){cn.unobserve(Gt.current.parentElement)}}},[bt,St]),Object(b.useEffect)(function(){if(bt){for(var Mt=[],cn=function(){var Mn=Un[Yt];Gn=Object(U.a)(Mn,2);var Or=Gn[0],Ur=Gn[1],jn=Object(I.a)({},Or,function(){rr(Ur)});Mt.push(jn),bt.addKeyMap(jn)},Yt=0,Un=Object.entries(Ze);Yt<Un.length;Yt++){var Gn;cn()}return nr.current=setInterval(function(){Tn.current&&dn()},4e3),function(){clearInterval(nr.current);var cr=Object(R.a)(Mt),Mn;try{for(cr.s();!(Mn=cr.n()).done;){var Or=Mn.value;bt.removeKeyMap(Or)}}catch(Ur){cr.e(Ur)}finally{cr.f()}}}},[bt]),Object(b.useEffect)(function(){ct!==Zt&&wn(ct)},[ct]),Object(yt.a)(function(){if(!Ua&&un>0){var Mt=new Date().getTime(),cn=window.sessionStorage.getItem(tr);Mt>=un+be&&(!cn||cn!==Wt)&&(window.sessionStorage.setItem(tr,Wt),Ae(!0))}},be),Object(b.useEffect)(function(){pn(ca)},[bt,ca]),Object(b.useEffect)(function(){bt&&(vr&&bt.focus())},[bt,vr]),Object(b.useEffect)(function(){if(Ot&&bt){var Mt=bt.getScrollerElement();function cn(Yt){var Un=Yt.target;if(zr.current){var Gn=Un.scrollTop/Un.scrollHeight;zr.current.scrollTop=zr.current.scrollHeight*Gn}}return Mt.addEventListener("scroll",cn),function(){Mt.removeEventListener("scroll",cn)}}},[bt,Ot]),Object(b.useEffect)(function(){if(bt&&Ha){function Mt(cn,Yt){Ha(cn,Yt)}return bt.on("beforeChange",Mt),function(){bt.off("beforeChange",Mt)}}},[bt,Ha]),Object(b.useEffect)(function(){if(bt&&rn){function Mt(){rn(bt.getValue())}return bt.on("blur",Mt),function(){bt.off("blur",Mt)}}},[bt,rn]),Object(b.useEffect)(function(){if(bt){function Mt(cn){var Yt=cn.getValue();lt(Yt),Zn(new Date().getTime()),cn.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Pt&&Pt(Yt)}return bt.on("change",Mt),function(){bt.off("change",Mt)}}},[bt,Pt]),Object(b.useEffect)(function(){bt&&(Bt==null?(bt.setValue(""),lt("")):Bt!==bt.getValue()&&(bt.setValue(Bt),lt(Bt),bt.setCursor(bt.lineCount(),0)))},[bt,Bt]);var rr=Object(b.useCallback)(function(Mt){var cn=bt.getCursor(),Yt=bt.getSelection(),Un=Yt.split(`
`);switch(Mt){case"bold":return bt.replaceSelection("**"+Yt+"**"),Yt===""&&bt.setCursor(cn.line,cn.ch+2),bt.focus();case"italic":return bt.replaceSelection("*"+Yt+"*"),Yt===""&&bt.setCursor(cn.line,cn.ch+1),bt.focus();case"code":return bt.replaceSelection("`"+Yt+"`"),Yt===""&&bt.setCursor(cn.line,cn.ch+1),bt.focus();case"inline-latex":return bt.replaceSelection("`$$"+Yt+"$$`"),Yt===""&&bt.setCursor(cn.line,cn.ch+3),bt.focus();case"latex":return bt.replaceSelection("```latex\n"+Yt+"\n```"),bt.setCursor(cn.line+1,Yt.length+1),bt.focus();case"line-break":return bt.replaceSelection(`<br/>
`),bt.focus();case"list-ul":return Yt===""?bt.replaceSelection("- "+Yt):bt.replaceSelection(Un.map(function(Gn){return Gn===""?"":"- ".concat(Gn)}).join(`
`)),bt.focus();case"list-ol":return Yt===""?bt.replaceSelection("1. "+Yt):bt.replaceSelection(Un.map(function(Gn,cr){return Gn===""?"":"".concat(cr+1,". ").concat(Gn)}).join(`
`)),bt.focus();case"add-null-ch":return Yt===""&&bt.setCursor(cn.line,cn.ch+1),bt.replaceSelection(te),bt.focus();case"inster-template-1":return Yt===""&&bt.setCursor(cn.line,cn.ch),bt.replaceSelection(oe),bt.focus();case"eraser":return bt.setValue(""),bt.focus();case"trigger-watch":return pn(!Ot),bt.focus();case"trigger-full-screen":return wn(!Zt),bt.focus();case qe:Vn(qe);return;case pt:Vn(pt);return;case vt:Vn(vt);return;case gt:Vn(gt);return;default:throw new Error}},[bt,Ot,Zt]),vn=Object(b.useCallback)(function(Mt){Vn("");switch(En){case qe:var cn=Mt.title,Yt=Mt.link;return bt.replaceSelection("[".concat(cn,"](").concat(Yt,")")),bt.focus();case pt:var Un=Mt.language,Gn=Mt.content;return bt.replaceSelection(["```"+Un,Gn,"```"].join(`
`)),bt.focus();case vt:var cr=Mt.src,Mn=Mt.alt;return Mn?bt.replaceSelection("![ ".concat(Mn," ]( ").concat(cr,' "').concat(Mn,'" )')):bt.replaceSelection("![,](".concat(cr,")")),bt.focus();case gt:for(var Or=Mt.row,Ur=Mt.col,jn=Mt.align,Oa=`
`,ar=0;ar<Or;ar++){for(var qr=[],Jn=[],ha=0;ha<Ur;ha++)ar===1&&Jn.push(Ct[jn]),qr.push(" ");ar===1&&(Oa+="| ".concat(Jn.join(" | "),` |
`)),Oa+="| ".concat(qr.join(Ur===1?"":" | "),` |
`)}return bt.replaceSelection(Oa+`
`),bt.focus();default:throw new Error}},[bt,En]),Rn=Object(b.useMemo)(function(){switch(En){case qe:return g.a.createElement(ne,{callback:vn,onCancel:yr});case pt:return g.a.createElement(ae.b,{callback:vn,onCancel:yr});case vt:return g.a.createElement(we,{callback:vn,onCancel:yr});case gt:return g.a.createElement(ht,{callback:vn,onCancel:yr});default:return null}},[En]);function yr(){Vn("")}Object(b.useEffect)(function(){if(Pa.current){var Mt=Pa.current,cn=!1,Yt=0;function Un(Mn){cn=!0,Yt=Mn.pageY}function Gn(){cn=!1}function cr(Mn){if(cn){var Or=Mn.pageY-Yt;Or<0&&(Or=0),Or>300&&(Or=300);var Ur=Qn+Or+"px";Cn(Ur)}}return Mt.addEventListener("mousedown",Un),document.addEventListener("mousemove",cr),document.addEventListener("mouseup",Gn),function(){Mt.removeEventListener("mousedown",Un),document.removeEventListener("mousemove",cr),document.removeEventListener("mouseup",Gn)}}},[bt,Pa]),Object(b.useEffect)(function(){Cn(Qn)},[Qn]);var kr=ce(xn),br=ce(hn),Sr={width:kr,height:br},Ir=Object(b.useMemo)(function(){if(un){var Mt=new Date(un),cn=Mt.getHours(),Yt=Mt.getMinutes(),Un=Mt.getSeconds();return cn=cn<10?"0"+cn:cn,Yt=Yt<10?"0"+Yt:Yt,Un=Un<10?"0"+Un:Un,"".concat(cn,":").concat(Yt,":").concat(Un)}return 0},[un]);function Sa(){window.sessionStorage.removeItem(tr),Ae(!1),Zn(0)}function Nr(){Ae(!1),Zn(0),bt.setValue(window.sessionStorage.getItem(tr))}function oi(Mt,cn){var Yt=bt.getValue();Yt=Yt.replace(Mt,cn),lt(Yt),bt==null||bt.setValue(Yt)}return g.a.createElement(b.Fragment,null,g.a.createElement("div",{className:"markdown-editor-wrapper",ref:Xr},g.a.createElement("div",{className:"markdown-editor-container ".concat(Ja," ").concat(Ot?"on-preview":""," ").concat(ur?"mini":""," ").concat(Zt?"full-screen":""),style:Sr},g.a.createElement(W,{insertTemp:mr,watch:Ot,fullScreen:Zt,showNullButton:Kn,onActionCallback:rr,hidetoolBar:ri,uuid:Ht.current,setOpenPhones:function(){Tn.current=!0}}),g.a.createElement("div",{className:"markdown-editor-body"},g.a.createElement("div",{className:"codemirror-container"},g.a.createElement("textarea",{ref:Gt,placeholder:Qi})),Ot?g.a.createElement("div",{ref:zr,className:"preview-container"},Rr==="stex"&&g.a.createElement(A,{value:Wt}),Rr!=="stex"&&g.a.createElement(m.a,{edit:!0,value:Wt,replaces:oi})):null))),Ut?g.a.createElement("a",{ref:Pa,className:"editor-resize"}):null,g.a.createElement(h.a,null,_t[En]?g.a.createElement(G.a,{centered:!0,title:_t[En],visible:!0,onCancel:yr,footer:null,className:"markdown-popup-form"},Rn):null))}},"P/tu":function(at,Ne,F){"use strict";var q=F("ozfa"),G=F("MJZm"),R=F("0Owb"),K=F("9og8"),O=F("tJVT"),L=F("PpiC"),U=F("WmNS"),I=F.n(U),T=F("cDcd"),P=F.n(T),b=F("WCUW"),g=F("spXi"),k=F.n(g),w=function(y){var f=y.value,s=y.onChange,c=y.defaultValue,d=y.disabled,S=Object(L.a)(y,["value","onChange","defaultValue","disabled"]),C=Object(T.useState)([]),m=Object(O.a)(C,2),A=m[0],x=m[1],u=Object(T.useState)("1"),l=Object(O.a)(u,2),a=l[0],i=l[1];Object(T.useEffect)(function(){E()},[]);var E=function(){var D=Object(K.a)(I.a.mark(function B(){var j,W;return I.a.wrap(function(N){for(;;)switch(N.prev=N.next){case 0:return N.next=2,Object(b.A)({});case 2:j=N.sent,j!=null&&j.data&&(W=[{title:P.a.createElement("div",{title:"\u6839\u76EE\u5F55",className:k.a.name},"\u6839\u76EE\u5F55"),value:0,key:0,icon:P.a.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:v(j.data||[])}],x(W),i("2"));case 4:case"end":return N.stop()}},B)}));return function(){return D.apply(this,arguments)}}(),v=function(B){function j(W){var h=W.children,N=Array.isArray(h)&&h.length>0,H=W==null?void 0:W.group_id;return{title:P.a.createElement("div",{title:W==null?void 0:W.name,className:k.a.name},W==null?void 0:W.name),value:H,key:H,icon:P.a.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:N?h==null?void 0:h.map(function(X){return j(X)}):[]}}return B==null?void 0:B.map(function(W){return j(W)})},_=c?{defaultExpandedKeys:[0]}:{selectedKeys:f,defaultExpandedKeys:f};return P.a.createElement("div",{className:k.a.customTree},P.a.createElement(G.a,Object(R.a)({key:a},_,{showIcon:!0,treeData:A,onSelect:s,disabled:d},S)))};Ne.a=w},Q0Vu:function(at,Ne,F){at.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(at,Ne,F){"use strict";var q=F("Q9mQ"),G=F("diRs"),R=F("cDcd"),K=F.n(R),O=F("+z73"),L=F.n(O),U=function(T){var P=T.data,b=P===void 0?[]:P,g=T.onClick,k=function(){return b.map(function(y,f){return K.a.createElement("div",{key:f,className:L.a.few},K.a.createElement("b",{title:y.name,style:{color:f===0?"#333333":"#999999"},onClick:function(){return g(y.id)}},y.name),f<b.length-1&&K.a.createElement("span",null,"/"))})},w=function(){var y=!0,f=b.slice(2,-2),s=K.a.createElement("div",{className:L.a.pWrap},f.map(function(c){return K.a.createElement("span",{title:c.name,onClick:function(){return g(c.id)},key:c.id},c.name)}));return b.map(function(c,d){var S=null;return d>1&&d<b.length-2?y&&(S=K.a.createElement(G.a,{key:d,placement:"bottom",content:s},K.a.createElement("span",{style:{color:"#999",cursor:"pointer"}},".../")),y=!1):S=K.a.createElement("div",{key:d,className:L.a.few},K.a.createElement("b",{title:c.name,style:{color:d===0?"#333333":"#999999"},onClick:function(){return g(c.id)}},c.name),d<b.length-1&&K.a.createElement("span",null,"/")),S})};return K.a.createElement("aside",{style:{overflowX:"auto"}},(b==null?void 0:b.length)>5?w():k())};Ne.a=U},SJMd:function(at,Ne){/**
* @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 F,q,G,R=!1,K,O;window.PR_SHOULD_USE_CONTINUATION=!0;var L,U;(function(){var I=window,T=["break,continue,do,else,for,if,return,while"],P=[T,"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"],b=[P,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],g=[b,"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"],k=[b,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],w=[b,"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"],p="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",y=[b,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],f="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",s=[T,"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"],c=[T,"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"],d=[T,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],S=[g,w,k,y,f,s,c,d],C=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,m="str",A="kwd",x="com",u="typ",l="lit",a="pun",i="pln",E="tag",v="dec",_="src",D="atn",B="atv",j="nocode",W="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function h(De){for(var Le=0,Ve=!1,ze=!1,Je=0,Ye=De.length;Je<Ye;++Je){var Ge=De[Je];if(Ge.ignoreCase)ze=!0;else if(/[a-z]/i.test(Ge.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Ve=!0,ze=!1;break}}var ht={b:8,t:9,n:10,v:11,f:12,r:13};function ot(gt){var Be=gt.charCodeAt(0);if(Be!==92)return Be;var Ct=gt.charAt(1);return Be=ht[Ct],Be||("0"<=Ct&&Ct<="7"?parseInt(gt.substring(1),8):Ct==="u"||Ct==="x"?parseInt(gt.substring(2),16):gt.charCodeAt(1))}function st(gt){if(gt<32)return(gt<16?"\\x0":"\\x")+gt.toString(16);var Be=String.fromCharCode(gt);return Be==="\\"||Be==="-"||Be==="]"||Be==="^"?"\\"+Be:Be}function qe(gt){var Be=gt.substring(1,gt.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")),Ct=[],yt=Be[0]==="^",He=["["];yt&&He.push("^");for(var rt=yt?1:0,me=Be.length;rt<me;++rt){var se=Be[rt];if(/\\[bdsw]/i.test(se))He.push(se);else{var be=ot(se),te;rt+2<me&&Be[rt+1]==="-"?(te=ot(Be[rt+2]),rt+=2):te=be,Ct.push([be,te]),te<65||be>122||(te<65||be>90||Ct.push([Math.max(65,be)|32,Math.min(te,90)|32]),te<97||be>122||Ct.push([Math.max(97,be)&~32,Math.min(te,122)&~32]))}}Ct.sort(function(je,Xe){return je[0]-Xe[0]||Xe[1]-je[1]});for(var oe=[],ce=[],rt=0;rt<Ct.length;++rt){var _e=Ct[rt];_e[0]<=ce[1]+1?ce[1]=Math.max(ce[1],_e[1]):oe.push(ce=_e)}for(var rt=0;rt<oe.length;++rt){var _e=oe[rt];He.push(st(_e[0])),_e[1]>_e[0]&&(_e[1]+1>_e[0]&&He.push("-"),He.push(st(_e[1])))}return He.push("]"),He.join("")}function vt(gt){for(var Be=gt.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")),Ct=Be.length,yt=[],He=0,rt=0;He<Ct;++He){var me=Be[He];if(me==="(")++rt;else if(me.charAt(0)==="\\"){var se=+me.substring(1);se&&(se<=rt?yt[se]=-1:Be[He]=st(se))}}for(var He=1;He<yt.length;++He)yt[He]===-1&&(yt[He]=++Le);for(var He=0,rt=0;He<Ct;++He){var me=Be[He];if(me==="(")++rt,yt[rt]||(Be[He]="(?:");else if(me.charAt(0)==="\\"){var se=+me.substring(1);se&&se<=rt&&(Be[He]="\\"+yt[se])}}for(var He=0;He<Ct;++He)Be[He]==="^"&&Be[He+1]!=="^"&&(Be[He]="");if(gt.ignoreCase&&Ve)for(var He=0;He<Ct;++He){var me=Be[He],be=me.charAt(0);me.length>=2&&be==="["?Be[He]=qe(me):be!=="\\"&&(Be[He]=me.replace(/[a-zA-Z]/g,function(ce){var _e=ce.charCodeAt(0);return"["+String.fromCharCode(_e&~32,_e|32)+"]"}))}return Be.join("")}for(var pt=[],Je=0,Ye=De.length;Je<Ye;++Je){var Ge=De[Je];if(Ge.global||Ge.multiline)throw new Error(""+Ge);pt.push("(?:"+vt(Ge)+")")}return new RegExp(pt.join("|"),ze?"gi":"g")}function N(De,Le){var Ve=/(?:^|\s)nocode(?:\s|$)/,ze=[],Je=0,Ye=[],Ge=0;function ht(ot){var st=ot.nodeType;if(st==1){if(Ve.test(ot.className))return;for(var qe=ot.firstChild;qe;qe=qe.nextSibling)ht(qe);var vt=ot.nodeName.toLowerCase();(vt==="br"||vt==="li")&&(ze[Ge]=`
`,Ye[Ge<<1]=Je++,Ye[Ge++<<1|1]=ot)}else if(st==3||st==4){var pt=ot.nodeValue;pt.length&&(Le?pt=pt.replace(/\r\n?/g,`
`):pt=pt.replace(/[ \t\r\n]+/g," "),ze[Ge]=pt,Ye[Ge<<1]=Je,Je+=pt.length,Ye[Ge++<<1|1]=ot)}}return ht(De),{sourceCode:ze.join("").replace(/\n$/,""),spans:Ye}}function H(De,Le,Ve,ze,Je){if(!Ve)return;var Ye={sourceNode:De,pre:1,langExtension:null,numberLines:null,sourceCode:Ve,spans:null,basePos:Le,decorations:null};ze(Ye),Je.push.apply(Je,Ye.decorations)}var X=/\S/;function Y(De){for(var Le=void 0,Ve=De.firstChild;Ve;Ve=Ve.nextSibling){var ze=Ve.nodeType;Le=ze===1?Le?De:Ve:ze===3&&X.test(Ve.nodeValue)?De:Le}return Le===De?void 0:Le}function re(De,Le){var Ve={},ze;(function(){for(var Ge=De.concat(Le),ht=[],ot={},st=0,qe=Ge.length;st<qe;++st){var vt=Ge[st],pt=vt[3];if(pt)for(var gt=pt.length;--gt>=0;)Ve[pt.charAt(gt)]=vt;var Be=vt[1],Ct=""+Be;ot.hasOwnProperty(Ct)||(ht.push(Be),ot[Ct]=null)}ht.push(/[\0-\uffff]/),ze=h(ht)})();var Je=Le.length,Ye=function(Ge){for(var ht=Ge.sourceCode,ot=Ge.basePos,st=Ge.sourceNode,qe=[ot,i],vt=0,pt=ht.match(ze)||[],gt={},Be=0,Ct=pt.length;Be<Ct;++Be){var yt=pt[Be],He=gt[yt],rt=void 0,me;if(typeof He=="string")me=!1;else{var se=Ve[yt.charAt(0)];if(se)rt=yt.match(se[1]),He=se[0];else{for(var be=0;be<Je;++be)if(se=Le[be],rt=yt.match(se[1]),rt){He=se[0];break}rt||(He=i)}me=He.length>=5&&He.substring(0,5)==="lang-",me&&!(rt&&typeof rt[1]=="string")&&(me=!1,He=_),me||(gt[yt]=He)}var te=vt;if(vt+=yt.length,!me)qe.push(ot+te,He);else{var oe=rt[1],ce=yt.indexOf(oe),_e=ce+oe.length;rt[2]&&(_e=yt.length-rt[2].length,ce=_e-oe.length);var je=He.substring(5);H(st,ot+te,yt.substring(0,ce),Ye,qe),H(st,ot+te+ce,oe,ie(je,oe),qe),H(st,ot+te+_e,yt.substring(_e),Ye,qe)}}Ge.decorations=qe};return Ye}function he(De){var Le=[],Ve=[];De.tripleQuotedStrings?Le.push([m,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):De.multiLineStrings?Le.push([m,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Le.push([m,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),De.verbatimStrings&&Ve.push([m,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var ze=De.hashComments;ze&&(De.cStyleComments?(ze>1?Le.push([x,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Le.push([x,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Ve.push([m,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Le.push([x,/^#[^\r\n]*/,null,"#"])),De.cStyleComments&&(Ve.push([x,/^\/\/[^\r\n]*/,null]),Ve.push([x,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Je=De.regexLiterals;if(Je){var Ye=Je>1?"":`
\r`,Ge=Ye?".":"[\\S\\s]",ht="/(?=[^/*"+Ye+"])(?:[^/\\x5B\\x5C"+Ye+"]|\\x5C"+Ge+"|\\x5B(?:[^\\x5C\\x5D"+Ye+"]|\\x5C"+Ge+")*(?:\\x5D|$))+/";Ve.push(["lang-regex",RegExp("^"+W+"("+ht+")")])}var ot=De.types;ot&&Ve.push([u,ot]);var st=(""+De.keywords).replace(/^ | $/g,"");st.length&&Ve.push([A,new RegExp("^(?:"+st.replace(/[\s,]+/g,"|")+")\\b"),null]),Le.push([i,/^\s+/,null,` \r
\xA0`]);var qe="^.[^\\s\\w.$@'\"`/\\\\]*";return De.regexLiterals&&(qe+="(?!s*/)"),Ve.push([l,/^@[a-z_$][a-z_$@0-9]*/i,null],[u,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[i,/^[a-z_$][a-z_$@0-9]*/i,null],[l,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[i,/^\\[\s\S]?/,null],[a,new RegExp(qe),null]),re(Le,Ve)}var de=he({keywords:S,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function ne(De,Le,Ve){for(var ze=/(?:^|\s)nocode(?:\s|$)/,Je=/\r\n?|\n/,Ye=De.ownerDocument,Ge=Ye.createElement("li");De.firstChild;)Ge.appendChild(De.firstChild);var ht=[Ge];function ot(Be){var Ct=Be.nodeType;if(Ct==1&&!ze.test(Be.className))if(Be.nodeName==="br")st(Be),Be.parentNode&&Be.parentNode.removeChild(Be);else for(var yt=Be.firstChild;yt;yt=yt.nextSibling)ot(yt);else if((Ct==3||Ct==4)&&Ve){var He=Be.nodeValue,rt=He.match(Je);if(rt){var me=He.substring(0,rt.index);Be.nodeValue=me;var se=He.substring(rt.index+rt[0].length);if(se){var be=Be.parentNode;be.insertBefore(Ye.createTextNode(se),Be.nextSibling)}st(Be),me||Be.parentNode.removeChild(Be)}}}function st(Be){for(;!Be.nextSibling;)if(Be=Be.parentNode,!Be)return;function Ct(rt,me){var se=me?rt.cloneNode(!1):rt,be=rt.parentNode;if(be){var te=Ct(be,1),oe=rt.nextSibling;te.appendChild(se);for(var ce=oe;ce;ce=oe)oe=ce.nextSibling,te.appendChild(ce)}return se}for(var yt=Ct(Be.nextSibling,0),He;(He=yt.parentNode)&&He.nodeType===1;)yt=He;ht.push(yt)}for(var qe=0;qe<ht.length;++qe)ot(ht[qe]);Le===(Le|0)&&ht[0].setAttribute("value",Le);var vt=Ye.createElement("ol");vt.className="linenums";for(var pt=Math.max(0,Le-1|0)||0,qe=0,gt=ht.length;qe<gt;++qe)Ge=ht[qe],Ge.className="L"+(qe+pt)%10,Ge.firstChild||Ge.appendChild(Ye.createTextNode("\xA0")),vt.appendChild(Ge);De.appendChild(vt)}function ae(De){var Le=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Le=Le&&+Le[1]<=8;var Ve=/\n/g,ze=De.sourceCode,Je=ze.length,Ye=0,Ge=De.spans,ht=Ge.length,ot=0,st=De.decorations,qe=st.length,vt=0;st[qe]=Je;var pt,gt;for(gt=pt=0;gt<qe;)st[gt]!==st[gt+2]?(st[pt++]=st[gt++],st[pt++]=st[gt++]):gt+=2;for(qe=pt,gt=pt=0;gt<qe;){for(var Be=st[gt],Ct=st[gt+1],yt=gt+2;yt+2<=qe&&st[yt+1]===Ct;)yt+=2;st[pt++]=Be,st[pt++]=Ct,gt=yt}qe=st.length=pt;var He=De.sourceNode,rt="";He&&(rt=He.style.display,He.style.display="none");try{for(var me=null;ot<ht;){var se=Ge[ot],be=Ge[ot+2]||Je,te=st[vt+2]||Je,yt=Math.min(be,te),oe=Ge[ot+1],ce;if(oe.nodeType!==1&&(ce=ze.substring(Ye,yt))){Le&&(ce=ce.replace(Ve,"\r")),oe.nodeValue=ce;var _e=oe.ownerDocument,je=_e.createElement("span");je.className=st[vt+1];var Xe=oe.parentNode;Xe.replaceChild(je,oe),je.appendChild(oe),Ye<be&&(Ge[ot+1]=oe=_e.createTextNode(ze.substring(yt,be)),Xe.insertBefore(oe,je.nextSibling))}Ye=yt,Ye>=be&&(ot+=2),Ye>=te&&(vt+=2)}}finally{He&&(He.style.display=rt)}}var le={};function ee(De,Le){for(var Ve=Le.length;--Ve>=0;){var ze=Le[Ve];le.hasOwnProperty(ze)?I.console&&console.warn("cannot override language handler %s",ze):le[ze]=De}}function ie(De,Le){return De&&le.hasOwnProperty(De)||(De=/^\s*</.test(Le)?"default-markup":"default-code"),le[De]}ee(de,["default-code"]),ee(re([],[[i,/^[^<?]+/],[v,/^<!\w[^>]*(?:>|$)/],[x,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[a,/^(?:<[%?]|[%?]>)/],["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"]),ee(re([[i,/^[\s]+/,null,` \r
`],[B,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[E,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[D,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[a,/^[=<>\/]+/],["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"]),ee(re([],[[B,/^[\s\S]+/]]),["uq.val"]),ee(he({keywords:g,hashComments:!0,cStyleComments:!0,types:C}),["c","cc","cpp","cxx","cyc","m"]),ee(he({keywords:"null,true,false"}),["json"]),ee(he({keywords:w,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:C}),["cs"]),ee(he({keywords:k,cStyleComments:!0}),["java"]),ee(he({keywords:d,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),ee(he({keywords:s,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),ee(he({keywords:f,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),ee(he({keywords:c,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),ee(he({keywords:y,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),ee(he({keywords:p,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),ee(re([],[[m,/^[\s\S]+/]]),["regex"]);function ve(De){var Le=De.langExtension;try{var Ve=N(De.sourceNode,De.pre),ze=Ve.sourceCode;De.sourceCode=ze,De.spans=Ve.spans,De.basePos=0,ie(Le,ze)(De),ae(De)}catch(Je){I.console&&console.log(Je&&Je.stack||Je)}}function Pe(De,Le,Ve){var ze=Ve||!1,Je=Le||null,Ye=document.createElement("div");Ye.innerHTML="<pre>"+De+"</pre>",Ye=Ye.firstChild,ze&&ne(Ye,ze,!0);var Ge={langExtension:Je,numberLines:ze,sourceNode:Ye,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return ve(Ge),Ye.innerHTML}function Ie(De,Le){var Ve=Le||document.body,ze=Ve.ownerDocument||document;function Je(se){return Ve.getElementsByTagName(se)}for(var Ye=[Je("pre"),Je("code"),Je("xmp")],Ge=[],ht=0;ht<Ye.length;++ht)for(var ot=0,st=Ye[ht].length;ot<st;++ot)Ge.push(Ye[ht][ot]);Ye=null;var qe=Date;qe.now||(qe={now:function(){return+new Date}});var vt=0,pt=/\blang(?:uage)?-([\w.]+)(?!\S)/,gt=/\bprettyprint\b/,Be=/\bprettyprinted\b/,Ct=/pre|xmp/i,yt=/^code$/i,He=/^(?:pre|code|xmp)$/i,rt={};function me(){for(var se=I.PR_SHOULD_USE_CONTINUATION?qe.now()+250:Infinity;vt<Ge.length&&qe.now()<se;vt++){for(var be=Ge[vt],te=rt,oe=be;oe=oe.previousSibling;){var ce=oe.nodeType,_e=(ce===7||ce===8)&&oe.nodeValue;if(_e?!/^\??prettify\b/.test(_e):ce!==3||/\S/.test(oe.nodeValue))break;if(_e){te={},_e.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Qn,nn,ur){te[nn]=ur});break}}var je=be.className;if((te!==rt||gt.test(je))&&!Be.test(je)){for(var Xe=!1,Ze=be.parentNode;Ze;Ze=Ze.parentNode){var _t=Ze.tagName;if(He.test(_t)&&Ze.className&&gt.test(Ze.className)){Xe=!0;break}}if(!Xe){be.className+=" prettyprinted";var It=te.lang;if(!It){It=je.match(pt);var $e;!It&&($e=Y(be))&&yt.test($e.tagName)&&(It=$e.className.match(pt)),It&&(It=It[1])}var Qt;if(Ct.test(be.tagName))Qt=1;else{var Bt=be.currentStyle,Pt=ze.defaultView,mn=Bt?Bt.whiteSpace:Pt&&Pt.getComputedStyle?Pt.getComputedStyle(be,null).getPropertyValue("white-space"):0;Qt=mn&&mn.substring(0,3)==="pre"}var xn=te.linenums;(xn=xn==="true"||+xn)||(xn=je.match(/\blinenums\b(?::(\d+))?/),xn=xn?xn[1]&&xn[1].length?+xn[1]:!0:!1),xn&&ne(be,xn,Qt);var er={langExtension:It,sourceNode:be,numberLines:xn,pre:Qt,sourceCode:null,basePos:null,spans:null,decorations:null};ve(er)}}}vt<Ge.length?I.setTimeout(me,250):typeof De=="function"&&De()}me()}var we=I.PR={createSimpleLexer:re,registerLangHandler:ee,sourceDecorator:he,PR_ATTRIB_NAME:D,PR_ATTRIB_VALUE:B,PR_COMMENT:x,PR_DECLARATION:v,PR_KEYWORD:A,PR_LITERAL:l,PR_NOCODE:j,PR_PLAIN:i,PR_PUNCTUATION:a,PR_SOURCE:_,PR_STRING:m,PR_TAG:E,PR_TYPE:u,prettyPrintOne:R?I.prettyPrintOne=Pe:L=Pe,prettyPrint:U=R?I.prettyPrint=Ie:U=Ie},ke=I.define;typeof ke=="function"&&ke.amd&&ke("google-code-prettify",[],function(){return we})})()},"VrN/":function(at,Ne,F){(function(q,G){at.exports=G()})(this,function(){"use strict";var q=navigator.userAgent,G=navigator.platform,R=/gecko\/\d/i.test(q),K=/MSIE \d/.test(q),O=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(q),L=/Edge\/(\d+)/.exec(q),U=K||O||L,I=U&&(K?document.documentMode||6:+(L||O)[1]),T=!L&&/WebKit\//.test(q),P=T&&/Qt\/\d+\.\d+/.test(q),b=!L&&/Chrome\//.test(q),g=/Opera\//.test(q),k=/Apple Computer/.test(navigator.vendor),w=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(q),p=/PhantomJS/.test(q),y=!L&&/AppleWebKit/.test(q)&&/Mobile\/\w+/.test(q),f=/Android/.test(q),s=y||f||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(q),c=y||/Mac/.test(G),d=/\bCrOS\b/.test(q),S=/win/i.test(G),C=g&&q.match(/Version\/(\d*\.\d*)/);C&&(C=Number(C[1])),C&&C>=15&&(g=!1,T=!0);var m=c&&(P||g&&(C==null||C<12.11)),A=R||U&&I>=9;function x(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var u=function(e,t){var r=e.className,n=x(t).exec(r);if(n){var o=r.slice(n.index+n[0].length);e.className=r.slice(0,n.index)+(o?n[1]+o:"")}};function l(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function a(e,t){return l(e).appendChild(t)}function i(e,t,r,n){var o=document.createElement(e);if(r&&(o.className=r),n&&(o.style.cssText=n),typeof t=="string")o.appendChild(document.createTextNode(t));else if(t)for(var M=0;M<t.length;++M)o.appendChild(t[M]);return o}function E(e,t,r,n){var o=i(e,t,r,n);return o.setAttribute("role","presentation"),o}var v;document.createRange?v=function(e,t,r,n){var o=document.createRange();return o.setEnd(n||e,r),o.setStart(e,t),o}:v=function(e,t,r){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(o){return n}return n.collapse(!0),n.moveEnd("character",r),n.moveStart("character",t),n};function _(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 D(){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 B(e,t){var r=e.className;x(t).test(r)||(e.className+=(r?" ":"")+t)}function j(e,t){for(var r=e.split(" "),n=0;n<r.length;n++)r[n]&&!x(r[n]).test(t)&&(t+=" "+r[n]);return t}var W=function(e){e.select()};y?W=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:U&&(W=function(e){try{e.select()}catch(t){}});function h(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function N(e,t,r){t||(t={});for(var n in e)e.hasOwnProperty(n)&&(r!==!1||!t.hasOwnProperty(n))&&(t[n]=e[n]);return t}function H(e,t,r,n,o){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var M=n||0,z=o||0;;){var V=e.indexOf(" ",M);if(V<0||V>=t)return z+(t-M);z+=V-M,z+=r-z%r,M=V+1}}var X=function(){this.id=null,this.f=null,this.time=0,this.handler=h(this.onTimeout,this)};X.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},X.prototype.set=function(e,t){this.f=t;var r=+new Date+e;(!this.id||r<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=r)};function Y(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r;return-1}var re=50,he={toString:function(){return"CodeMirror.Pass"}},de={scroll:!1},ne={origin:"*mouse"},ae={origin:"+move"};function le(e,t,r){for(var n=0,o=0;;){var M=e.indexOf(" ",n);M==-1&&(M=e.length);var z=M-n;if(M==e.length||o+z>=t)return n+Math.min(z,t-o);if(o+=M-n,o+=r-o%r,n=M+1,o>=t)return n}}var ee=[""];function ie(e){for(;ee.length<=e;)ee.push(ve(ee)+" ");return ee[e]}function ve(e){return e[e.length-1]}function Pe(e,t){for(var r=[],n=0;n<e.length;n++)r[n]=t(e[n],n);return r}function Ie(e,t,r){for(var n=0,o=r(t);n<e.length&&r(e[n])<=o;)n++;e.splice(n,0,t)}function we(){}function ke(e,t){var r;return Object.create?r=Object.create(e):(we.prototype=e,r=new we),t&&N(t,r),r}var De=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Le(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||De.test(e))}function Ve(e,t){return t?t.source.indexOf("\\w")>-1&&Le(e)?!0:t.test(e):Le(e)}function ze(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Je=/[\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 Ye(e){return e.charCodeAt(0)>=768&&Je.test(e)}function Ge(e,t,r){for(;(r<0?t>0:t<e.length)&&Ye(e.charAt(t));)t+=r;return t}function ht(e,t,r){for(var n=t>r?-1:1;;){if(t==r)return t;var o=(t+r)/2,M=n<0?Math.ceil(o):Math.floor(o);if(M==t)return e(M)?t:r;e(M)?r=M:t=M+n}}function ot(e,t,r,n){if(!e)return n(t,r,"ltr",0);for(var o=!1,M=0;M<e.length;++M){var z=e[M];(z.from<r&&z.to>t||t==r&&z.to==t)&&(n(Math.max(z.from,t),Math.min(z.to,r),z.level==1?"rtl":"ltr",M),o=!0)}o||n(t,r,"ltr")}var st=null;function qe(e,t,r){var n;st=null;for(var o=0;o<e.length;++o){var M=e[o];if(M.from<t&&M.to>t)return o;M.to==t&&(M.from!=M.to&&r=="before"?n=o:st=o),M.from==t&&(M.from!=M.to&&r!="before"?n=o:st=o)}return n!=null?n:st}var vt=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function r(J){return J<=247?e.charAt(J):1424<=J&&J<=1524?"R":1536<=J&&J<=1785?t.charAt(J-1536):1774<=J&&J<=2220?"r":8192<=J&&J<=8203?"w":J==8204?"b":"L"}var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,o=/[stwN]/,M=/[LRr]/,z=/[Lb1n]/,V=/[1n]/;function Q(J,ye,Ce){this.level=J,this.from=ye,this.to=Ce}return function(J,ye){var Ce=ye=="ltr"?"L":"R";if(J.length==0||ye=="ltr"&&!n.test(J))return!1;for(var Ue=J.length,Me=[],nt=0;nt<Ue;++nt)Me.push(r(J.charCodeAt(nt)));for(var dt=0,xt=Ce;dt<Ue;++dt){var wt=Me[dt];wt=="m"?Me[dt]=xt:xt=wt}for(var kt=0,Dt=Ce;kt<Ue;++kt){var Kt=Me[kt];Kt=="1"&&Dt=="r"?Me[kt]="n":M.test(Kt)&&(Dt=Kt,Kt=="r"&&(Me[kt]="R"))}for(var sn=1,tn=Me[0];sn<Ue-1;++sn){var Fn=Me[sn];Fn=="+"&&tn=="1"&&Me[sn+1]=="1"?Me[sn]="1":Fn==","&&tn==Me[sn+1]&&(tn=="1"||tn=="n")&&(Me[sn]=tn),tn=Fn}for(var Ar=0;Ar<Ue;++Ar){var ua=Me[Ar];if(ua==",")Me[Ar]="N";else if(ua=="%"){var Wr=void 0;for(Wr=Ar+1;Wr<Ue&&Me[Wr]=="%";++Wr);for(var Wa=Ar&&Me[Ar-1]=="!"||Wr<Ue&&Me[Wr]=="1"?"1":"N",ka=Ar;ka<Wr;++ka)Me[ka]=Wa;Ar=Wr-1}}for(var ta=0,Ia=Ce;ta<Ue;++ta){var ya=Me[ta];Ia=="L"&&ya=="1"?Me[ta]="L":M.test(ya)&&(Ia=ya)}for(var ia=0;ia<Ue;++ia)if(o.test(Me[ia])){var na=void 0;for(na=ia+1;na<Ue&&o.test(Me[na]);++na);for(var Vr=(ia?Me[ia-1]:Ce)=="L",Na=(na<Ue?Me[na]:Ce)=="L",To=Vr==Na?Vr?"L":"R":Ce,Xi=ia;Xi<na;++Xi)Me[Xi]=To;ia=na-1}for(var Ta=[],Ei,da=0;da<Ue;)if(z.test(Me[da])){var ys=da;for(++da;da<Ue&&z.test(Me[da]);++da);Ta.push(new Q(0,ys,da))}else{var Ri=da,to=Ta.length,no=ye=="rtl"?1:0;for(++da;da<Ue&&Me[da]!="L";++da);for(var wa=Ri;wa<da;)if(V.test(Me[wa])){Ri<wa&&(Ta.splice(to,0,new Q(1,Ri,wa)),to+=no);var Ao=wa;for(++wa;wa<da&&V.test(Me[wa]);++wa);Ta.splice(to,0,new Q(2,Ao,wa)),to+=no,Ri=wa}else++wa;Ri<da&&Ta.splice(to,0,new Q(1,Ri,da))}return ye=="ltr"&&(Ta[0].level==1&&(Ei=J.match(/^\s+/))&&(Ta[0].from=Ei[0].length,Ta.unshift(new Q(0,0,Ei[0].length))),ve(Ta).level==1&&(Ei=J.match(/\s+$/))&&(ve(Ta).to-=Ei[0].length,Ta.push(new Q(0,Ue-Ei[0].length,Ue)))),ye=="rtl"?Ta.reverse():Ta}}();function pt(e,t){var r=e.order;return r==null&&(r=e.order=vt(e.text,t)),r}var gt=[],Be=function(e,t,r){if(e.addEventListener)e.addEventListener(t,r,!1);else if(e.attachEvent)e.attachEvent("on"+t,r);else{var n=e._handlers||(e._handlers={});n[t]=(n[t]||gt).concat(r)}};function Ct(e,t){return e._handlers&&e._handlers[t]||gt}function yt(e,t,r){if(e.removeEventListener)e.removeEventListener(t,r,!1);else if(e.detachEvent)e.detachEvent("on"+t,r);else{var n=e._handlers,o=n&&n[t];if(o){var M=Y(o,r);M>-1&&(n[t]=o.slice(0,M).concat(o.slice(M+1)))}}}function He(e,t){var r=Ct(e,t);if(!r.length)return;for(var n=Array.prototype.slice.call(arguments,2),o=0;o<r.length;++o)r[o].apply(null,n)}function rt(e,t,r){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),He(e,r||t.type,e,t),ce(t)||t.codemirrorIgnore}function me(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var r=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)Y(r,t[n])==-1&&r.push(t[n])}function se(e,t){return Ct(e,t).length>0}function be(e){e.prototype.on=function(t,r){Be(this,t,r)},e.prototype.off=function(t,r){yt(this,t,r)}}function te(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function oe(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function ce(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function _e(e){te(e),oe(e)}function je(e){return e.target||e.srcElement}function Xe(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),c&&e.ctrlKey&&t==1&&(t=3),t}var Ze=function(){if(U&&I<9)return!1;var e=i("div");return"draggable"in e||"dragDrop"in e}(),_t;function It(e){if(_t==null){var t=i("span","\u200B");a(e,i("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(_t=t.offsetWidth<=1&&t.offsetHeight>2&&!(U&&I<8))}var r=_t?i("span","\u200B"):i("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}var $e;function Qt(e){if($e!=null)return $e;var t=a(e,document.createTextNode("A\u062EA")),r=v(t,0,1).getBoundingClientRect(),n=v(t,1,2).getBoundingClientRect();return l(e),!r||r.left==r.right?!1:$e=n.right-r.right<3}var Bt=`
b`.split(/\n/).length!=3?function(e){for(var t=0,r=[],n=e.length;t<=n;){var o=e.indexOf(`
`,t);o==-1&&(o=e.length);var M=e.slice(t,e.charAt(o-1)=="\r"?o-1:o),z=M.indexOf("\r");z!=-1?(r.push(M.slice(0,z)),t+=z+1):(r.push(M),t=o+1)}return r}:function(e){return e.split(/\r\n?|\n/)},Pt=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(r){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},mn=function(){var e=i("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),xn=null;function er(e){if(xn!=null)return xn;var t=a(e,i("span","x")),r=t.getBoundingClientRect(),n=v(t,0,1).getBoundingClientRect();return xn=Math.abs(r.left-n.left)>1}var Qn={},nn={};function ur(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Qn[e]=t}function hr(e,t){nn[e]=t}function vr(e){if(typeof e=="string"&&nn.hasOwnProperty(e))e=nn[e];else if(e&&typeof e.name=="string"&&nn.hasOwnProperty(e.name)){var t=nn[e.name];typeof t=="string"&&(t={name:t}),e=ke(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return vr("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return vr("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function ca(e,t){t=vr(t);var r=Qn[t.name];if(!r)return ca(e,"text/plain");var n=r(e,t);if(mr.hasOwnProperty(t.name)){var o=mr[t.name];for(var M in o){if(!o.hasOwnProperty(M))continue;n.hasOwnProperty(M)&&(n["_"+M]=n[M]),n[M]=o[M]}}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var z in t.modeProps)n[z]=t.modeProps[z];return n}var mr={};function Da(e,t){var r=mr.hasOwnProperty(e)?mr[e]:mr[e]={};N(t,r)}function Rr(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var r={};for(var n in t){var o=t[n];o instanceof Array&&(o=o.concat([])),r[n]=o}return r}function fa(e,t){for(var r;e.innerMode&&!(r=e.innerMode(t),!r||r.mode==e);)t=r.state,e=r.mode;return r||{mode:e,state:t}}function tr(e,t,r){return e.startState?e.startState(t,r):!0}var dr=function(e,t,r){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=r};dr.prototype.eol=function(){return this.pos>=this.string.length},dr.prototype.sol=function(){return this.pos==this.lineStart},dr.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},dr.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},dr.prototype.eat=function(e){var t=this.string.charAt(this.pos),r;if(typeof e=="string"?r=t==e:r=t&&(e.test?e.test(t):e(t)),r)return++this.pos,t},dr.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},dr.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},dr.prototype.skipToEnd=function(){this.pos=this.string.length},dr.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},dr.prototype.backUp=function(e){this.pos-=e},dr.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)},dr.prototype.indentation=function(){return H(this.string,null,this.tabSize)-(this.lineStart?H(this.string,this.lineStart,this.tabSize):0)},dr.prototype.match=function(e,t,r){if(typeof e=="string"){var n=function(z){return r?z.toLowerCase():z},o=this.string.substr(this.pos,e.length);if(n(o)==n(e))return t!==!1&&(this.pos+=e.length),!0}else{var M=this.string.slice(this.pos).match(e);return M&&M.index>0?null:(M&&t!==!1&&(this.pos+=M[0].length),M)}},dr.prototype.current=function(){return this.string.slice(this.start,this.pos)},dr.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},dr.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},dr.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function Ut(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 r=e;!r.lines;)for(var n=0;;++n){var o=r.children[n],M=o.chunkSize();if(t<M){r=o;break}t-=M}return r.lines[t]}function ra(e,t,r){var n=[],o=t.line;return e.iter(t.line,r.line+1,function(M){var z=M.text;o==r.line&&(z=z.slice(0,r.ch)),o==t.line&&(z=z.slice(t.ch)),n.push(z),++o}),n}function Ua(e,t,r){var n=[];return e.iter(t,r,function(o){n.push(o.text)}),n}function Hr(e,t){var r=t-e.height;if(r)for(var n=e;n;n=n.parent)n.height+=r}function Kn(e){if(e.parent==null)return null;for(var t=e.parent,r=Y(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var o=0;!(n.children[o]==t);++o)r+=n.children[o].chunkSize();return r+t.first}function ja(e,t){var r=e.first;e:do{for(var n=0;n<e.children.length;++n){var o=e.children[n],M=o.height;if(t<M){e=o;continue e}t-=M,r+=o.chunkSize()}return r}while(!e.lines);for(var z=0;z<e.lines.length;++z){var V=e.lines[z],Q=V.height;if(t<Q)break;t-=Q}return r+z}function ri(e,t){return t>=e.first&&t<e.first+e.size}function Aa(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function ct(e,t,r){if(r===void 0&&(r=null),!(this instanceof ct))return new ct(e,t,r);this.line=e,this.ch=t,this.sticky=r}function rn(e,t){return e.line-t.line||e.ch-t.ch}function Ha(e,t){return e.sticky==t.sticky&&rn(e,t)==0}function Za(e){return ct(e.line,e.ch)}function ai(e,t){return rn(e,t)<0?t:e}function Ja(e,t){return rn(e,t)<0?e:t}function _i(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function ln(e,t){if(t.line<e.first)return ct(e.first,0);var r=e.first+e.size-1;return t.line>r?ct(r,Ut(e,r).text.length):Mi(t,Ut(e,t.line).text.length)}function Mi(e,t){var r=e.ch;return r==null||r>t?ct(e.line,t):r<0?ct(e.line,0):e}function Qi(e,t){for(var r=[],n=0;n<t.length;n++)r[n]=ln(e,t[n]);return r}var Ba=function(e,t){this.state=e,this.lookAhead=t},oa=function(e,t,r,n){this.state=t,this.doc=e,this.line=r,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};oa.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},oa.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}},oa.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},oa.fromSaved=function(e,t,r){return t instanceof Ba?new oa(e,Rr(e.mode,t.state),r,t.lookAhead):new oa(e,Rr(e.mode,t),r)},oa.prototype.save=function(e){var t=e!==!1?Rr(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Ba(t,this.maxLookAhead):t};function ii(e,t,r,n){var o=[e.state.modeGen],M={};Tt(e,t.text,e.doc.mode,r,function(J,ye){return o.push(J,ye)},M,n);for(var z=r.state,V=function(J){r.baseTokens=o;var ye=e.state.overlays[J],Ce=1,Ue=0;r.state=!0,Tt(e,t.text,ye.mode,r,function(Me,nt){for(var dt=Ce;Ue<Me;){var xt=o[Ce];xt>Me&&o.splice(Ce,1,Me,o[Ce+1],xt),Ce+=2,Ue=Math.min(Me,xt)}if(!nt)return;if(ye.opaque)o.splice(dt,Ce-dt,Me,"overlay "+nt),Ce=dt+2;else for(;dt<Ce;dt+=2){var wt=o[dt+1];o[dt+1]=(wt?wt+" ":"")+"overlay "+nt}},M),r.state=z,r.baseTokens=null,r.baseTokenPos=1},Q=0;Q<e.state.overlays.length;++Q)V(Q);return{styles:o,classes:M.bgClass||M.textClass?M:null}}function xi(e,t,r){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=bt(e,Kn(t)),o=t.text.length>e.options.maxHighlightLength&&Rr(e.doc.mode,n.state),M=ii(e,t,n);o&&(n.state=o),t.stateAfter=n.save(!o),t.styles=M.styles,M.classes?t.styleClasses=M.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function bt(e,t,r){var n=e.doc,o=e.display;if(!n.mode.startState)return new oa(n,!0,t);var M=Ot(e,t,r),z=M>n.first&&Ut(n,M-1).stateAfter,V=z?oa.fromSaved(n,z,M):new oa(n,tr(n.mode),M);return n.iter(M,t,function(Q){gr(e,Q.text,V);var J=V.line;Q.stateAfter=J==t-1||J%5==0||J>=o.viewFrom&&J<o.viewTo?V.save():null,V.nextLine()}),r&&(n.modeFrontier=V.line),V}function gr(e,t,r,n){var o=e.doc.mode,M=new dr(t,e.options.tabSize,r);for(M.start=M.pos=n||0,t==""&&Li(o,r.state);!M.eol();)pi(o,M,r.state),M.start=M.pos}function Li(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var r=fa(e,t);if(r.mode.blankLine)return r.mode.blankLine(r.state)}function pi(e,t,r,n){for(var o=0;o<10;o++){n&&(n[0]=fa(e,r).mode);var M=e.token(t,r);if(t.pos>t.start)return M}throw new Error("Mode "+e.name+" failed to advance stream.")}var Wt=function(e,t,r){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=r};function lt(e,t,r,n){var o=e.doc,M=o.mode,z;t=ln(o,t);var V=Ut(o,t.line),Q=bt(e,t.line,r),J=new dr(V.text,e.options.tabSize,Q),ye;for(n&&(ye=[]);(n||J.pos<t.ch)&&!J.eol();)J.start=J.pos,z=pi(M,J,Q.state),n&&ye.push(new Wt(J,z,Rr(o.mode,Q.state)));return n?ye:new Wt(J,z,Q.state)}function Rt(e,t){if(e)for(;;){var r=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!r)break;e=e.slice(0,r.index)+e.slice(r.index+r[0].length);var n=r[1]?"bgClass":"textClass";t[n]==null?t[n]=r[2]:new RegExp("(?:^|\\s)"+r[2]+"(?:$|\\s)").test(t[n])||(t[n]+=" "+r[2])}return e}function Tt(e,t,r,n,o,M,z){var V=r.flattenSpans;V==null&&(V=e.options.flattenSpans);var Q=0,J=null,ye=new dr(t,e.options.tabSize,n),Ce,Ue=e.options.addModeClass&&[null];for(t==""&&Rt(Li(r,n.state),M);!ye.eol();){if(ye.pos>e.options.maxHighlightLength?(V=!1,z&&gr(e,t,n,ye.pos),ye.pos=t.length,Ce=null):Ce=Rt(pi(r,ye,n.state,Ue),M),Ue){var Me=Ue[0].name;Me&&(Ce="m-"+(Ce?Me+" "+Ce:Me))}if(!V||J!=Ce){for(;Q<ye.start;)Q=Math.min(ye.start,Q+5e3),o(Q,J);J=Ce}ye.start=ye.pos}for(;Q<ye.pos;){var nt=Math.min(ye.pos,Q+5e3);o(nt,J),Q=nt}}function Ot(e,t,r){for(var n,o,M=e.doc,z=r?-1:t-(e.doc.mode.innerMode?1e3:100),V=t;V>z;--V){if(V<=M.first)return M.first;var Q=Ut(M,V-1),J=Q.stateAfter;if(J&&(!r||V+(J instanceof Ba?J.lookAhead:0)<=M.modeFrontier))return V;var ye=H(Q.text,null,e.options.tabSize);(o==null||n>ye)&&(o=V-1,n=ye)}return o}function pn(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var r=e.first,n=t-1;n>r;n--){var o=Ut(e,n).stateAfter;if(o&&(!(o instanceof Ba)||n+o.lookAhead<t)){r=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,r)}var bn=!1,$t=!1;function Zt(){bn=!0}function wn(){$t=!0}function fn(e,t,r){this.marker=e,this.from=t,this.to=r}function Xt(e,t){if(e)for(var r=0;r<e.length;++r){var n=e[r];if(n.marker==t)return n}}function En(e,t){for(var r,n=0;n<e.length;++n)e[n]!=t&&(r||(r=[])).push(e[n]);return r}function Vn(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function $n(e,t,r){var n;if(e)for(var o=0;o<e.length;++o){var M=e[o],z=M.marker,V=M.from==null||(z.inclusiveLeft?M.from<=t:M.from<t);if(V||M.from==t&&z.type=="bookmark"&&(!r||!M.marker.insertLeft)){var Q=M.to==null||(z.inclusiveRight?M.to>=t:M.to>t);(n||(n=[])).push(new fn(z,M.from,Q?null:M.to))}}return n}function Jt(e,t,r){var n;if(e)for(var o=0;o<e.length;++o){var M=e[o],z=M.marker,V=M.to==null||(z.inclusiveRight?M.to>=t:M.to>t);if(V||M.from==t&&z.type=="bookmark"&&(!r||M.marker.insertLeft)){var Q=M.from==null||(z.inclusiveLeft?M.from<=t:M.from<t);(n||(n=[])).push(new fn(z,Q?null:M.from-t,M.to==null?null:M.to-t))}}return n}function un(e,t){if(t.full)return null;var r=ri(e,t.from.line)&&Ut(e,t.from.line).markedSpans,n=ri(e,t.to.line)&&Ut(e,t.to.line).markedSpans;if(!r&&!n)return null;var o=t.from.ch,M=t.to.ch,z=rn(t.from,t.to)==0,V=$n(r,o,z),Q=Jt(n,M,z),J=t.text.length==1,ye=ve(t.text).length+(J?o:0);if(V)for(var Ce=0;Ce<V.length;++Ce){var Ue=V[Ce];if(Ue.to==null){var Me=Xt(Q,Ue.marker);Me?J&&(Ue.to=Me.to==null?null:Me.to+ye):Ue.to=o}}if(Q)for(var nt=0;nt<Q.length;++nt){var dt=Q[nt];if(dt.to!=null&&(dt.to+=ye),dt.from==null){var xt=Xt(V,dt.marker);xt||(dt.from=ye,J&&(V||(V=[])).push(dt))}else dt.from+=ye,J&&(V||(V=[])).push(dt)}V&&(V=Zn(V)),Q&&Q!=V&&(Q=Zn(Q));var wt=[V];if(!J){var kt=t.text.length-2,Dt;if(kt>0&&V)for(var Kt=0;Kt<V.length;++Kt)V[Kt].to==null&&(Dt||(Dt=[])).push(new fn(V[Kt].marker,null,null));for(var sn=0;sn<kt;++sn)wt.push(Dt);wt.push(Q)}return wt}function Zn(e){for(var t=0;t<e.length;++t){var r=e[t];r.from!=null&&r.from==r.to&&r.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function Hn(e,t,r){var n=null;if(e.iter(t.line,r.line+1,function(Me){if(Me.markedSpans)for(var nt=0;nt<Me.markedSpans.length;++nt){var dt=Me.markedSpans[nt].marker;dt.readOnly&&(!n||Y(n,dt)==-1)&&(n||(n=[])).push(dt)}}),!n)return null;for(var o=[{from:t,to:r}],M=0;M<n.length;++M)for(var z=n[M],V=z.find(0),Q=0;Q<o.length;++Q){var J=o[Q];if(rn(J.to,V.from)<0||rn(J.from,V.to)>0)continue;var ye=[Q,1],Ce=rn(J.from,V.from),Ue=rn(J.to,V.to);(Ce<0||!z.inclusiveLeft&&!Ce)&&ye.push({from:J.from,to:V.from}),(Ue>0||!z.inclusiveRight&&!Ue)&&ye.push({from:V.to,to:J.to}),o.splice.apply(o,ye),Q+=ye.length-3}return o}function an(e){var t=e.markedSpans;if(!t)return;for(var r=0;r<t.length;++r)t[r].marker.detachLine(e);e.markedSpans=null}function hn(e,t){if(!t)return;for(var r=0;r<t.length;++r)t[r].marker.attachLine(e);e.markedSpans=t}function Cn(e){return e.inclusiveLeft?-1:0}function Nt(e){return e.inclusiveRight?1:0}function Lt(e,t){var r=e.lines.length-t.lines.length;if(r!=0)return r;var n=e.find(),o=t.find(),M=rn(n.from,o.from)||Cn(e)-Cn(t);if(M)return-M;var z=rn(n.to,o.to)||Nt(e)-Nt(t);return z||t.id-e.id}function jt(e,t){var r=$t&&e.markedSpans,n;if(r)for(var o=void 0,M=0;M<r.length;++M)o=r[M],o.marker.collapsed&&(t?o.from:o.to)==null&&(!n||Lt(n,o.marker)<0)&&(n=o.marker);return n}function Ae(e){return jt(e,!0)}function Ht(e){return jt(e,!1)}function Tn(e,t){var r=$t&&e.markedSpans,n;if(r)for(var o=0;o<r.length;++o){var M=r[o];M.marker.collapsed&&(M.from==null||M.from<t)&&(M.to==null||M.to>t)&&(!n||Lt(n,M.marker)<0)&&(n=M.marker)}return n}function nr(e,t,r,n,o){var M=Ut(e,t),z=$t&&M.markedSpans;if(z)for(var V=0;V<z.length;++V){var Q=z[V];if(!Q.marker.collapsed)continue;var J=Q.marker.find(0),ye=rn(J.from,r)||Cn(Q.marker)-Cn(o),Ce=rn(J.to,n)||Nt(Q.marker)-Nt(o);if(ye>=0&&Ce<=0||ye<=0&&Ce>=0)continue;if(ye<=0&&(Q.marker.inclusiveRight&&o.inclusiveLeft?rn(J.to,r)>=0:rn(J.to,r)>0)||ye>=0&&(Q.marker.inclusiveRight&&o.inclusiveLeft?rn(J.from,n)<=0:rn(J.from,n)<0))return!0}}function Gt(e){for(var t;t=Ae(e);)e=t.find(-1,!0).line;return e}function Xr(e){for(var t;t=Ht(e);)e=t.find(1,!0).line;return e}function Pa(e){for(var t,r;t=Ht(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}function zr(e,t){var r=Ut(e,t),n=Gt(r);return r==n?t:Kn(n)}function dn(e,t){if(t>e.lastLine())return t;var r=Ut(e,t),n;if(!St(e,r))return t;for(;n=Ht(r);)r=n.find(1,!0).line;return Kn(r)+1}function St(e,t){var r=$t&&t.markedSpans;if(r)for(var n=void 0,o=0;o<r.length;++o){if(n=r[o],!n.marker.collapsed)continue;if(n.from==null)return!0;if(n.marker.widgetNode)continue;if(n.from==0&&n.marker.inclusiveLeft&&rr(e,t,n))return!0}}function rr(e,t,r){if(r.to==null){var n=r.marker.find(1,!0);return rr(e,n.line,Xt(n.line.markedSpans,r.marker))}if(r.marker.inclusiveRight&&r.to==t.text.length)return!0;for(var o=void 0,M=0;M<t.markedSpans.length;++M)if(o=t.markedSpans[M],o.marker.collapsed&&!o.marker.widgetNode&&o.from==r.to&&(o.to==null||o.to!=r.from)&&(o.marker.inclusiveLeft||r.marker.inclusiveRight)&&rr(e,t,o))return!0}function vn(e){e=Gt(e);for(var t=0,r=e.parent,n=0;n<r.lines.length;++n){var o=r.lines[n];if(o==e)break;t+=o.height}for(var M=r.parent;M;r=M,M=r.parent)for(var z=0;z<M.children.length;++z){var V=M.children[z];if(V==r)break;t+=V.height}return t}function Rn(e){if(e.height==0)return 0;for(var t=e.text.length,r,n=e;r=Ae(n);){var o=r.find(0,!0);n=o.from.line,t+=o.from.ch-o.to.ch}for(n=e;r=Ht(n);){var M=r.find(0,!0);t-=n.text.length-M.from.ch,n=M.to.line,t+=n.text.length-M.to.ch}return t}function yr(e){var t=e.display,r=e.doc;t.maxLine=Ut(r,r.first),t.maxLineLength=Rn(t.maxLine),t.maxLineChanged=!0,r.iter(function(n){var o=Rn(n);o>t.maxLineLength&&(t.maxLineLength=o,t.maxLine=n)})}var kr=function(e,t,r){this.text=e,hn(this,t),this.height=r?r(this):1};kr.prototype.lineNo=function(){return Kn(this)},be(kr);function br(e,t,r,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),an(e),hn(e,r);var o=n?n(e):1;o!=e.height&&Hr(e,o)}function Sr(e){e.parent=null,an(e)}var Ir={},Sa={};function Nr(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?Sa:Ir;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function oi(e,t){var r=E("span",null,null,T?"padding-right: .1px":null),n={pre:E("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var o=0;o<=(t.rest?t.rest.length:0);o++){var M=o?t.rest[o-1]:t.line,z=void 0;n.pos=0,n.addToken=cn,Qt(e.display.measure)&&(z=pt(M,e.doc.direction))&&(n.addToken=Un(n.addToken,z)),n.map=[];var V=t!=e.display.externalMeasured&&Kn(M);cr(M,n,xi(e,M,V)),M.styleClasses&&(M.styleClasses.bgClass&&(n.bgClass=j(M.styleClasses.bgClass,n.bgClass||"")),M.styleClasses.textClass&&(n.textClass=j(M.styleClasses.textClass,n.textClass||""))),n.map.length==0&&n.map.push(0,0,n.content.appendChild(It(e.display.measure))),o==0?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(T){var Q=n.content.lastChild;(/\bcm-tab\b/.test(Q.className)||Q.querySelector&&Q.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return He(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=j(n.pre.className,n.textClass||"")),n}function Mt(e){var t=i("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function cn(e,t,r,n,o,M,z){if(!t)return;var V=e.splitSpaces?Yt(t,e.trailingSpace):t,Q=e.cm.state.specialChars,J=!1,ye;if(!Q.test(t))e.col+=t.length,ye=document.createTextNode(V),e.map.push(e.pos,e.pos+t.length,ye),U&&I<9&&(J=!0),e.pos+=t.length;else{ye=document.createDocumentFragment();for(var Ce=0;;){Q.lastIndex=Ce;var Ue=Q.exec(t),Me=Ue?Ue.index-Ce:t.length-Ce;if(Me){var nt=document.createTextNode(V.slice(Ce,Ce+Me));U&&I<9?ye.appendChild(i("span",[nt])):ye.appendChild(nt),e.map.push(e.pos,e.pos+Me,nt),e.col+=Me,e.pos+=Me}if(!Ue)break;Ce+=Me+1;var dt=void 0;if(Ue[0]==" "){var xt=e.cm.options.tabSize,wt=xt-e.col%xt;dt=ye.appendChild(i("span",ie(wt),"cm-tab")),dt.setAttribute("role","presentation"),dt.setAttribute("cm-text"," "),e.col+=wt}else Ue[0]=="\r"||Ue[0]==`
`?(dt=ye.appendChild(i("span",Ue[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),dt.setAttribute("cm-text",Ue[0]),e.col+=1):(dt=e.cm.options.specialCharPlaceholder(Ue[0]),dt.setAttribute("cm-text",Ue[0]),U&&I<9?ye.appendChild(i("span",[dt])):ye.appendChild(dt),e.col+=1);e.map.push(e.pos,e.pos+1,dt),e.pos++}}if(e.trailingSpace=V.charCodeAt(t.length-1)==32,r||n||o||J||M||z){var kt=r||"";n&&(kt+=n),o&&(kt+=o);var Dt=i("span",[ye],kt,M);if(z)for(var Kt in z)z.hasOwnProperty(Kt)&&Kt!="style"&&Kt!="class"&&Dt.setAttribute(Kt,z[Kt]);return e.content.appendChild(Dt)}e.content.appendChild(ye)}function Yt(e,t){if(e.length>1&&!/ /.test(e))return e;for(var r=t,n="",o=0;o<e.length;o++){var M=e.charAt(o);M==" "&&r&&(o==e.length-1||e.charCodeAt(o+1)==32)&&(M="\xA0"),n+=M,r=M==" "}return n}function Un(e,t){return function(r,n,o,M,z,V,Q){o=o?o+" cm-force-border":"cm-force-border";for(var J=r.pos,ye=J+n.length;;){for(var Ce=void 0,Ue=0;Ue<t.length&&!(Ce=t[Ue],Ce.to>J&&Ce.from<=J);Ue++);if(Ce.to>=ye)return e(r,n,o,M,z,V,Q);e(r,n.slice(0,Ce.to-J),o,M,null,V,Q),M=null,n=n.slice(Ce.to-J),J=Ce.to}}}function Gn(e,t,r,n){var o=!n&&r.widgetNode;o&&e.map.push(e.pos,e.pos+t,o),!n&&e.cm.display.input.needsContentAttribute&&(o||(o=e.content.appendChild(document.createElement("span"))),o.setAttribute("cm-marker",r.id)),o&&(e.cm.display.input.setUneditable(o),e.content.appendChild(o)),e.pos+=t,e.trailingSpace=!1}function cr(e,t,r){var n=e.markedSpans,o=e.text,M=0;if(!n){for(var z=1;z<r.length;z+=2)t.addToken(t,o.slice(M,M=r[z]),Nr(r[z+1],t.cm.options));return}for(var V=o.length,Q=0,J=1,ye="",Ce,Ue,Me=0,nt,dt,xt,wt,kt;;){if(Me==Q){nt=dt=xt=Ue="",kt=null,wt=null,Me=Infinity;for(var Dt=[],Kt=void 0,sn=0;sn<n.length;++sn){var tn=n[sn],Fn=tn.marker;if(Fn.type=="bookmark"&&tn.from==Q&&Fn.widgetNode)Dt.push(Fn);else if(tn.from<=Q&&(tn.to==null||tn.to>Q||Fn.collapsed&&tn.to==Q&&tn.from==Q)){if(tn.to!=null&&tn.to!=Q&&Me>tn.to&&(Me=tn.to,dt=""),Fn.className&&(nt+=" "+Fn.className),Fn.css&&(Ue=(Ue?Ue+";":"")+Fn.css),Fn.startStyle&&tn.from==Q&&(xt+=" "+Fn.startStyle),Fn.endStyle&&tn.to==Me&&(Kt||(Kt=[])).push(Fn.endStyle,tn.to),Fn.title&&((kt||(kt={})).title=Fn.title),Fn.attributes)for(var Ar in Fn.attributes)(kt||(kt={}))[Ar]=Fn.attributes[Ar];Fn.collapsed&&(!wt||Lt(wt.marker,Fn)<0)&&(wt=tn)}else tn.from>Q&&Me>tn.from&&(Me=tn.from)}if(Kt)for(var ua=0;ua<Kt.length;ua+=2)Kt[ua+1]==Me&&(dt+=" "+Kt[ua]);if(!wt||wt.from==Q)for(var Wr=0;Wr<Dt.length;++Wr)Gn(t,0,Dt[Wr]);if(wt&&(wt.from||0)==Q){if(Gn(t,(wt.to==null?V+1:wt.to)-Q,wt.marker,wt.from==null),wt.to==null)return;wt.to==Q&&(wt=!1)}}if(Q>=V)break;for(var Wa=Math.min(V,Me);;){if(ye){var ka=Q+ye.length;if(!wt){var ta=ka>Wa?ye.slice(0,Wa-Q):ye;t.addToken(t,ta,Ce?Ce+nt:nt,xt,Q+ta.length==Me?dt:"",Ue,kt)}if(ka>=Wa){ye=ye.slice(Wa-Q),Q=Wa;break}Q=ka,xt=""}ye=o.slice(M,M=r[J++]),Ce=Nr(r[J++],t.cm.options)}}}function Mn(e,t,r){this.line=t,this.rest=Pa(t),this.size=this.rest?Kn(ve(this.rest))-r+1:1,this.node=this.text=null,this.hidden=St(e,t)}function Or(e,t,r){for(var n=[],o,M=t;M<r;M=o){var z=new Mn(e.doc,Ut(e.doc,M),M);o=M+z.size,n.push(z)}return n}var Ur=null;function jn(e){Ur?Ur.ops.push(e):e.ownsGroup=Ur={ops:[e],delayedCallbacks:[]}}function Oa(e){var t=e.delayedCallbacks,r=0;do{for(;r<t.length;r++)t[r].call(null);for(var n=0;n<e.ops.length;n++){var o=e.ops[n];if(o.cursorActivityHandlers)for(;o.cursorActivityCalled<o.cursorActivityHandlers.length;)o.cursorActivityHandlers[o.cursorActivityCalled++].call(null,o.cm)}}while(r<t.length)}function ar(e,t){var r=e.ownsGroup;if(!r)return;try{Oa(r)}finally{Ur=null,t(r)}}var qr=null;function Jn(e,t){var r=Ct(e,t);if(!r.length)return;var n=Array.prototype.slice.call(arguments,2),o;Ur?o=Ur.delayedCallbacks:qr?o=qr:(o=qr=[],setTimeout(ha,0));for(var M=function(V){o.push(function(){return r[V].apply(null,n)})},z=0;z<r.length;++z)M(z)}function ha(){var e=qr;qr=null;for(var t=0;t<e.length;++t)e[t]()}function si(e,t,r,n){for(var o=0;o<t.changes.length;o++){var M=t.changes[o];M=="text"?Ii(e,t):M=="gutter"?Yi(e,t,r,n):M=="class"?Ni(e,t):M=="widget"&&ro(e,t,n)}t.changes=null}function Ci(e){return e.node==e.text&&(e.node=i("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),U&&I<8&&(e.node.style.zIndex=2)),e.node}function So(e,t){var r=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(r&&(r+=" CodeMirror-linebackground"),t.background)r?t.background.className=r:(t.background.parentNode.removeChild(t.background),t.background=null);else if(r){var n=Ci(t);t.background=n.insertBefore(i("div",null,r),n.firstChild),e.display.input.setUneditable(t.background)}}function ki(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):oi(e,t)}function Ii(e,t){var r=t.text.className,n=ki(e,t);t.text==t.node&&(t.node=n.pre),t.text.parentNode.replaceChild(n.pre,t.text),t.text=n.pre,n.bgClass!=t.bgClass||n.textClass!=t.textClass?(t.bgClass=n.bgClass,t.textClass=n.textClass,Ni(e,t)):r&&(t.text.className=r)}function Ni(e,t){So(e,t),t.line.wrapClass?Ci(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var r=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=r||""}function Yi(e,t,r,n){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 o=Ci(t);t.gutterBackground=i("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+n.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),o.insertBefore(t.gutterBackground,t.text)}var M=t.line.gutterMarkers;if(e.options.lineNumbers||M){var z=Ci(t),V=t.gutter=i("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(e.display.input.setUneditable(V),z.insertBefore(V,t.text),t.line.gutterClass&&(V.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!M||!M["CodeMirror-linenumbers"])&&(t.lineNumber=V.appendChild(i("div",Aa(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),M)for(var Q=0;Q<e.display.gutterSpecs.length;++Q){var J=e.display.gutterSpecs[Q].className,ye=M.hasOwnProperty(J)&&M[J];ye&&V.appendChild(i("div",[ye],"CodeMirror-gutter-elt","left: "+n.gutterLeft[J]+"px; width: "+n.gutterWidth[J]+"px"))}}}function ro(e,t,r){t.alignable&&(t.alignable=null);for(var n=x("CodeMirror-linewidget"),o=t.node.firstChild,M=void 0;o;o=M)M=o.nextSibling,n.test(o.className)&&t.node.removeChild(o);Ti(e,t,r)}function ao(e,t,r,n){var o=ki(e,t);return t.text=t.node=o.pre,o.bgClass&&(t.bgClass=o.bgClass),o.textClass&&(t.textClass=o.textClass),Ni(e,t),Yi(e,t,r,n),Ti(e,t,n),t.node}function Ti(e,t,r){if(io(e,t.line,t,r,!0),t.rest)for(var n=0;n<t.rest.length;n++)io(e,t.rest[n],t,r,!1)}function io(e,t,r,n,o){if(!t.widgets)return;for(var M=Ci(r),z=0,V=t.widgets;z<V.length;++z){var Q=V[z],J=i("div",[Q.node],"CodeMirror-linewidget"+(Q.className?" "+Q.className:""));Q.handleMouseEvents||J.setAttribute("cm-ignore-events","true"),Xo(Q,J,r,n),e.display.input.setUneditable(J),o&&Q.above?M.insertBefore(J,r.gutter||r.text):M.appendChild(J),Jn(Q,"redraw")}}function Xo(e,t,r,n){if(e.noHScroll){(r.alignable||(r.alignable=[])).push(t);var o=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(o-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=o+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function za(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!_(document.body,e.node)){var r="position: relative;";e.coverGutter&&(r+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(r+="width: "+t.display.wrapper.clientWidth+"px;"),a(t.display.measure,i("div",[e.node],null,r))}return e.height=e.node.parentNode.offsetHeight}function ba(e,t){for(var r=je(t);r!=e.wrapper;r=r.parentNode)if(!r||r.nodeType==1&&r.getAttribute("cm-ignore-events")=="true"||r.parentNode==e.sizer&&r!=e.mover)return!0}function Qr(e){return e.lineSpace.offsetTop}function fe(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Te(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=a(e.measure,i("pre","x","CodeMirror-line-like")),r=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n={left:parseInt(r.paddingLeft),right:parseInt(r.paddingRight)};return!isNaN(n.left)&&!isNaN(n.right)&&(e.cachedPaddingH=n),n}function Oe(e){return re-e.display.nativeBarWidth}function ge(e){return e.display.scroller.clientWidth-Oe(e)-e.display.barWidth}function Z(e){return e.display.scroller.clientHeight-Oe(e)-e.display.barHeight}function ue(e,t,r){var n=e.options.lineWrapping,o=n&&ge(e);if(!t.measure.heights||n&&t.measure.width!=o){var M=t.measure.heights=[];if(n){t.measure.width=o;for(var z=t.text.firstChild.getClientRects(),V=0;V<z.length-1;V++){var Q=z[V],J=z[V+1];Math.abs(Q.bottom-J.bottom)>2&&M.push((Q.bottom+J.top)/2-r.top)}}M.push(r.bottom-r.top)}}function $(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;n<e.rest.length;n++)if(e.rest[n]==t)return{map:e.measure.maps[n],cache:e.measure.caches[n]};for(var o=0;o<e.rest.length;o++)if(Kn(e.rest[o])>r)return{map:e.measure.maps[o],cache:e.measure.caches[o],before:!0}}function pe(e,t){t=Gt(t);var r=Kn(t),n=e.display.externalMeasured=new Mn(e.doc,t,r);n.lineN=r;var o=n.built=oi(e,n);return n.text=o.pre,a(e.display.lineMeasure,o.pre),n}function Ee(e,t,r,n){return Re(e,xe(e,t),r,n)}function Se(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[en(e,t)];var r=e.display.externalMeasured;if(r&&t>=r.lineN&&t<r.lineN+r.size)return r}function xe(e,t){var r=Kn(t),n=Se(e,r);n&&!n.text?n=null:n&&n.changes&&(si(e,n,r,Tr(e)),e.curOp.forceUpdate=!0),n||(n=pe(e,t));var o=$(n,t,r);return{line:t,view:n,rect:null,map:o.map,cache:o.cache,before:o.before,hasHeights:!1}}function Re(e,t,r,n,o){t.before&&(r=-1);var M=r+(n||""),z;return t.cache.hasOwnProperty(M)?z=t.cache[M]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(ue(e,t.view,t.rect),t.hasHeights=!0),z=At(e,t,r,n),z.bogus||(t.cache[M]=z)),{left:z.left,right:z.right,top:o?z.rtop:z.top,bottom:o?z.rbottom:z.bottom}}var Qe={left:0,right:0,top:0,bottom:0};function mt(e,t,r){for(var n,o,M,z,V,Q,J=0;J<e.length;J+=3)if(V=e[J],Q=e[J+1],t<V?(o=0,M=1,z="left"):t<Q?(o=t-V,M=o+1):(J==e.length-3||t==Q&&e[J+3]>t)&&(M=Q-V,o=M-1,t>=Q&&(z="right")),o!=null){if(n=e[J+2],V==Q&&r==(n.insertLeft?"left":"right")&&(z=r),r=="left"&&o==0)for(;J&&e[J-2]==e[J-3]&&e[J-1].insertLeft;)n=e[(J-=3)+2],z="left";if(r=="right"&&o==Q-V)for(;J<e.length-3&&e[J+3]==e[J+4]&&!e[J+5].insertLeft;)n=e[(J+=3)+2],z="right";break}return{node:n,start:o,end:M,collapse:z,coverStart:V,coverEnd:Q}}function ft(e,t){var r=Qe;if(t=="left")for(var n=0;n<e.length&&!((r=e[n]).left!=r.right);n++);else for(var o=e.length-1;o>=0&&!((r=e[o]).left!=r.right);o--);return r}function At(e,t,r,n){var o=mt(t.map,r,n),M=o.node,z=o.start,V=o.end,Q=o.collapse,J;if(M.nodeType==3){for(var ye=0;ye<4;ye++){for(;z&&Ye(t.line.text.charAt(o.coverStart+z));)--z;for(;o.coverStart+V<o.coverEnd&&Ye(t.line.text.charAt(o.coverStart+V));)++V;if(U&&I<9&&z==0&&V==o.coverEnd-o.coverStart?J=M.parentNode.getBoundingClientRect():J=ft(v(M,z,V).getClientRects(),n),J.left||J.right||z==0)break;V=z,z=z-1,Q="right"}U&&I<11&&(J=on(e.display.measure,J))}else{z>0&&(Q=n="right");var Ce;e.options.lineWrapping&&(Ce=M.getClientRects()).length>1?J=Ce[n=="right"?Ce.length-1:0]:J=M.getBoundingClientRect()}if(U&&I<9&&!z&&(!J||!J.left&&!J.right)){var Ue=M.parentNode.getClientRects()[0];Ue?J={left:Ue.left,right:Ue.left+Yr(e.display),top:Ue.top,bottom:Ue.bottom}:J=Qe}for(var Me=J.top-t.rect.top,nt=J.bottom-t.rect.top,dt=(Me+nt)/2,xt=t.view.measure.heights,wt=0;wt<xt.length-1&&!(dt<xt[wt]);wt++);var kt=wt?xt[wt-1]:0,Dt=xt[wt],Kt={left:(Q=="right"?J.right:J.left)-t.rect.left,right:(Q=="left"?J.left:J.right)-t.rect.left,top:kt,bottom:Dt};return!J.left&&!J.right&&(Kt.bogus=!0),e.options.singleCursorHeightPerLine||(Kt.rtop=Me,Kt.rbottom=nt),Kt}function on(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!er(e))return t;var r=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*r,right:t.right*r,top:t.top*n,bottom:t.bottom*n}}function On(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 gn(e){e.display.externalMeasure=null,l(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)On(e.display.view[t])}function _n(e){gn(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Sn(){return b&&f?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function yn(){return b&&f?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function An(e){var t=0;if(e.widgets)for(var r=0;r<e.widgets.length;++r)e.widgets[r].above&&(t+=za(e.widgets[r]));return t}function zn(e,t,r,n,o){if(!o){var M=An(t);r.top+=M,r.bottom+=M}if(n=="line")return r;n||(n="local");var z=vn(t);if(n=="local"?z+=Qr(e.display):z-=e.display.viewOffset,n=="page"||n=="window"){var V=e.display.lineSpace.getBoundingClientRect();z+=V.top+(n=="window"?0:yn());var Q=V.left+(n=="window"?0:Sn());r.left+=Q,r.right+=Q}return r.top+=z,r.bottom+=z,r}function Ln(e,t,r){if(r=="div")return t;var n=t.left,o=t.top;if(r=="page")n-=Sn(),o-=yn();else if(r=="local"||!r){var M=e.display.sizer.getBoundingClientRect();n+=M.left,o+=M.top}var z=e.display.lineSpace.getBoundingClientRect();return{left:n-z.left,top:o-z.top}}function xr(e,t,r,n,o){return n||(n=Ut(e.doc,t.line)),zn(e,n,Ee(e,n,t.ch,o),r)}function kn(e,t,r,n,o,M){n=n||Ut(e.doc,t.line),o||(o=xe(e,n));function z(nt,dt){var xt=Re(e,o,nt,dt?"right":"left",M);return dt?xt.left=xt.right:xt.right=xt.left,zn(e,n,xt,r)}var V=pt(n,e.doc.direction),Q=t.ch,J=t.sticky;if(Q>=n.text.length?(Q=n.text.length,J="before"):Q<=0&&(Q=0,J="after"),!V)return z(J=="before"?Q-1:Q,J=="before");function ye(nt,dt,xt){var wt=V[dt],kt=wt.level==1;return z(xt?nt-1:nt,kt!=xt)}var Ce=qe(V,Q,J),Ue=st,Me=ye(Q,Ce,J=="before");return Ue!=null&&(Me.other=ye(Q,Ue,J!="before")),Me}function Vt(e,t){var r=0;t=ln(e.doc,t),e.options.lineWrapping||(r=Yr(e.display)*t.ch);var n=Ut(e.doc,t.line),o=vn(n)+Qr(e.display);return{left:r,right:r,top:o,bottom:o+n.height}}function qt(e,t,r,n,o){var M=ct(e,t,r);return M.xRel=o,n&&(M.outside=n),M}function In(e,t,r){var n=e.doc;if(r+=e.display.viewOffset,r<0)return qt(n.first,0,null,-1,-1);var o=ja(n,r),M=n.first+n.size-1;if(o>M)return qt(n.first+n.size-1,Ut(n,M).text.length,null,1,1);t<0&&(t=0);for(var z=Ut(n,o);;){var V=Cr(e,z,o,t,r),Q=Tn(z,V.ch+(V.xRel>0||V.outside>0?1:0));if(!Q)return V;var J=Q.find(1);if(J.line==o)return J;z=Ut(n,o=J.line)}}function Wn(e,t,r,n){n-=An(t);var o=t.text.length,M=ht(function(z){return Re(e,r,z-1).bottom<=n},o,0);return o=ht(function(z){return Re(e,r,z).top>n},M,o),{begin:M,end:o}}function zt(e,t,r,n){r||(r=xe(e,t));var o=zn(e,t,Re(e,r,n),"line").top;return Wn(e,t,r,o)}function Dn(e,t,r,n){return e.bottom<=r?!1:e.top>r?!0:(n?e.left:e.right)>t}function Cr(e,t,r,n,o){o-=vn(t);var M=xe(e,t),z=An(t),V=0,Q=t.text.length,J=!0,ye=pt(t,e.doc.direction);if(ye){var Ce=(e.options.lineWrapping?fr:Xn)(e,t,r,M,ye,n,o);J=Ce.level!=1,V=J?Ce.from:Ce.to-1,Q=J?Ce.to:Ce.from-1}var Ue=null,Me=null,nt=ht(function(sn){var tn=Re(e,M,sn);return tn.top+=z,tn.bottom+=z,Dn(tn,n,o,!1)?(tn.top<=o&&tn.left<=n&&(Ue=sn,Me=tn),!0):!1},V,Q),dt,xt,wt=!1;if(Me){var kt=n-Me.left<Me.right-n,Dt=kt==J;nt=Ue+(Dt?0:1),xt=Dt?"after":"before",dt=kt?Me.left:Me.right}else{!J&&(nt==Q||nt==V)&&nt++,xt=nt==0?"after":nt==t.text.length?"before":Re(e,M,nt-(J?1:0)).bottom+z<=o==J?"after":"before";var Kt=kn(e,ct(r,nt,xt),"line",t,M);dt=Kt.left,wt=o<Kt.top?-1:o>=Kt.bottom?1:0}return nt=Ge(t.text,nt,1),qt(r,nt,xt,wt,n-dt)}function Xn(e,t,r,n,o,M,z){var V=ht(function(Ce){var Ue=o[Ce],Me=Ue.level!=1;return Dn(kn(e,ct(r,Me?Ue.to:Ue.from,Me?"before":"after"),"line",t,n),M,z,!0)},0,o.length-1),Q=o[V];if(V>0){var J=Q.level!=1,ye=kn(e,ct(r,J?Q.from:Q.to,J?"after":"before"),"line",t,n);Dn(ye,M,z,!0)&&ye.top>z&&(Q=o[V-1])}return Q}function fr(e,t,r,n,o,M,z){var V=Wn(e,t,n,z),Q=V.begin,J=V.end;/\s/.test(t.text.charAt(J-1))&&J--;for(var ye=null,Ce=null,Ue=0;Ue<o.length;Ue++){var Me=o[Ue];if(Me.from>=J||Me.to<=Q)continue;var nt=Me.level!=1,dt=Re(e,n,nt?Math.min(J,Me.to)-1:Math.max(Q,Me.from)).right,xt=dt<M?M-dt+1e9:dt-M;(!ye||Ce>xt)&&(ye=Me,Ce=xt)}return ye||(ye=o[o.length-1]),ye.from<Q&&(ye={from:Q,to:ye.to,level:ye.level}),ye.to>J&&(ye={from:ye.from,to:J,level:ye.level}),ye}var ir;function jr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(ir==null){ir=i("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)ir.appendChild(document.createTextNode("x")),ir.appendChild(i("br"));ir.appendChild(document.createTextNode("x"))}a(e.measure,ir);var r=ir.offsetHeight/50;return r>3&&(e.cachedTextHeight=r),l(e.measure),r||1}function Yr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=i("span","xxxxxxxxxx"),r=i("pre",[t],"CodeMirror-line-like");a(e.measure,r);var n=t.getBoundingClientRect(),o=(n.right-n.left)/10;return o>2&&(e.cachedCharWidth=o),o||10}function Tr(e){for(var t=e.display,r={},n={},o=t.gutters.clientLeft,M=t.gutters.firstChild,z=0;M;M=M.nextSibling,++z){var V=e.display.gutterSpecs[z].className;r[V]=M.offsetLeft+M.clientLeft+o,n[V]=M.clientWidth}return{fixedPos:sa(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function sa(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Ea(e){var t=jr(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/Yr(e.display)-3);return function(o){if(St(e.doc,o))return 0;var M=0;if(o.widgets)for(var z=0;z<o.widgets.length;z++)o.widgets[z].height&&(M+=o.widgets[z].height);return r?M+(Math.ceil(o.text.length/n)||1)*t:M+t}}function ma(e){var t=e.doc,r=Ea(e);t.iter(function(n){var o=r(n);o!=n.height&&Hr(n,o)})}function Gr(e,t,r,n){var o=e.display;if(!r&&je(t).getAttribute("cm-not-content")=="true")return null;var M,z,V=o.lineSpace.getBoundingClientRect();try{M=t.clientX-V.left,z=t.clientY-V.top}catch(Ce){return null}var Q=In(e,M,z),J;if(n&&Q.xRel>0&&(J=Ut(e.doc,Q.line).text).length==Q.ch){var ye=H(J,J.length,e.options.tabSize)-J.length;Q=ct(Q.line,Math.max(0,Math.round((M-Te(e.display).left)/Yr(e.display))-ye))}return Q}function en(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var r=e.display.view,n=0;n<r.length;n++)if(t-=r[n].size,t<0)return n}function Yn(e,t,r,n){t==null&&(t=e.doc.first),r==null&&(r=e.doc.first+e.doc.size),n||(n=0);var o=e.display;if(n&&r<o.viewTo&&(o.updateLineNumbers==null||o.updateLineNumbers>t)&&(o.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=o.viewTo)$t&&zr(e.doc,t)<o.viewTo&&Er(e);else if(r<=o.viewFrom)$t&&dn(e.doc,r+n)>o.viewFrom?Er(e):(o.viewFrom+=n,o.viewTo+=n);else if(t<=o.viewFrom&&r>=o.viewTo)Er(e);else if(t<=o.viewFrom){var M=Ra(e,r,r+n,1);M?(o.view=o.view.slice(M.index),o.viewFrom=M.lineN,o.viewTo+=n):Er(e)}else if(r>=o.viewTo){var z=Ra(e,t,t,-1);z?(o.view=o.view.slice(0,z.index),o.viewTo=z.lineN):Er(e)}else{var V=Ra(e,t,t,-1),Q=Ra(e,r,r+n,1);V&&Q?(o.view=o.view.slice(0,V.index).concat(Or(e,V.lineN,Q.lineN)).concat(o.view.slice(Q.index)),o.viewTo+=n):Er(e)}var J=o.externalMeasured;J&&(r<J.lineN?J.lineN+=n:t<J.lineN+J.size&&(o.externalMeasured=null))}function wr(e,t,r){e.curOp.viewChanged=!0;var n=e.display,o=e.display.externalMeasured;if(o&&t>=o.lineN&&t<o.lineN+o.size&&(n.externalMeasured=null),t<n.viewFrom||t>=n.viewTo)return;var M=n.view[en(e,t)];if(M.node==null)return;var z=M.changes||(M.changes=[]);Y(z,r)==-1&&z.push(r)}function Er(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Ra(e,t,r,n){var o=en(e,t),M,z=e.display.view;if(!$t||r==e.doc.first+e.doc.size)return{index:o,lineN:r};for(var V=e.display.viewFrom,Q=0;Q<o;Q++)V+=z[Q].size;if(V!=t){if(n>0){if(o==z.length-1)return null;M=V+z[o].size-t,o++}else M=V-t;t+=M,r+=M}for(;zr(e.doc,r)!=r;){if(o==(n<0?0:z.length-1))return null;r+=n*z[o-(n<0?1:0)].size,o+=n}return{index:o,lineN:r}}function qa(e,t,r){var n=e.display,o=n.view;o.length==0||t>=n.viewTo||r<=n.viewFrom?(n.view=Or(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=Or(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(en(e,t))),n.viewFrom=t,n.viewTo<r?n.view=n.view.concat(Or(e,n.viewTo,r)):n.viewTo>r&&(n.view=n.view.slice(0,en(e,r)))),n.viewTo=r}function ei(e){for(var t=e.display.view,r=0,n=0;n<t.length;n++){var o=t[n];!o.hidden&&(!o.node||o.changes)&&++r}return r}function sr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Fa(e,t){t===void 0&&(t=!0);for(var r=e.doc,n={},o=n.cursors=document.createDocumentFragment(),M=n.selection=document.createDocumentFragment(),z=0;z<r.sel.ranges.length;z++){if(!t&&z==r.sel.primIndex)continue;var V=r.sel.ranges[z];if(V.from().line>=e.display.viewTo||V.to().line<e.display.viewFrom)continue;var Q=V.empty();(Q||e.options.showCursorWhenSelecting)&&Ga(e,V.head,o),Q||qn(e,V,M)}return n}function Ga(e,t,r){var n=kn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),o=r.appendChild(i("div","\xA0","CodeMirror-cursor"));if(o.style.left=n.left+"px",o.style.top=n.top+"px",o.style.height=Math.max(0,n.bottom-n.top)*e.options.cursorHeight+"px",n.other){var M=r.appendChild(i("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));M.style.display="",M.style.left=n.other.left+"px",M.style.top=n.other.top+"px",M.style.height=(n.other.bottom-n.other.top)*.85+"px"}}function or(e,t){return e.top-t.top||e.left-t.left}function qn(e,t,r){var n=e.display,o=e.doc,M=document.createDocumentFragment(),z=Te(e.display),V=z.left,Q=Math.max(n.sizerWidth,ge(e)-n.sizer.offsetLeft)-z.right,J=o.direction=="ltr";function ye(Dt,Kt,sn,tn){Kt<0&&(Kt=0),Kt=Math.round(Kt),tn=Math.round(tn),M.appendChild(i("div",null,"CodeMirror-selected","position: absolute; left: "+Dt+`px;
top: `+Kt+"px; width: "+(sn==null?Q-Dt:sn)+`px;
height: `+(tn-Kt)+"px"))}function Ce(Dt,Kt,sn){var tn=Ut(o,Dt),Fn=tn.text.length,Ar,ua;function Wr(ta,Ia){return xr(e,ct(Dt,ta),"div",tn,Ia)}function Wa(ta,Ia,ya){var ia=zt(e,tn,null,ta),na=Ia=="ltr"==(ya=="after")?"left":"right",Vr=ya=="after"?ia.begin:ia.end-(/\s/.test(tn.text.charAt(ia.end-1))?2:1);return Wr(Vr,na)[na]}var ka=pt(tn,o.direction);return ot(ka,Kt||0,sn==null?Fn:sn,function(ta,Ia,ya,ia){var na=ya=="ltr",Vr=Wr(ta,na?"left":"right"),Na=Wr(Ia-1,na?"right":"left"),To=Kt==null&&ta==0,Xi=sn==null&&Ia==Fn,Ta=ia==0,Ei=!ka||ia==ka.length-1;if(Na.top-Vr.top<=3){var da=(J?To:Xi)&&Ta,ys=(J?Xi:To)&&Ei,Ri=da?V:(na?Vr:Na).left,to=ys?Q:(na?Na:Vr).right;ye(Ri,Vr.top,to-Ri,Vr.bottom)}else{var no,wa,Ao,bs;na?(no=J&&To&&Ta?V:Vr.left,wa=J?Q:Wa(ta,ya,"before"),Ao=J?V:Wa(Ia,ya,"after"),bs=J&&Xi&&Ei?Q:Na.right):(no=J?Wa(ta,ya,"before"):V,wa=!J&&To&&Ta?Q:Vr.right,Ao=!J&&Xi&&Ei?V:Na.left,bs=J?Wa(Ia,ya,"after"):Q),ye(no,Vr.top,wa-no,Vr.bottom),Vr.bottom<Na.top&&ye(V,Vr.bottom,null,Na.top),ye(Ao,Na.top,bs-Ao,Na.bottom)}(!Ar||or(Vr,Ar)<0)&&(Ar=Vr),or(Na,Ar)<0&&(Ar=Na),(!ua||or(Vr,ua)<0)&&(ua=Vr),or(Na,ua)<0&&(ua=Na)}),{start:Ar,end:ua}}var Ue=t.from(),Me=t.to();if(Ue.line==Me.line)Ce(Ue.line,Ue.ch,Me.ch);else{var nt=Ut(o,Ue.line),dt=Ut(o,Me.line),xt=Gt(nt)==Gt(dt),wt=Ce(Ue.line,Ue.ch,xt?nt.text.length+1:null).end,kt=Ce(Me.line,xt?0:null,Me.ch).start;xt&&(wt.top<kt.top-2?(ye(wt.right,wt.top,null,wt.bottom),ye(V,kt.top,kt.left,kt.bottom)):ye(wt.right,wt.top,kt.left-wt.right,wt.bottom)),wt.bottom<kt.top&&ye(V,wt.bottom,null,kt.top)}r.appendChild(M)}function $r(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var r=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||_a(e),t.cursorDiv.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function Oo(e){e.state.focused||(e.display.input.focus(),Dr(e))}function $i(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,_a(e))},100)}function Dr(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(He(e,"focus",e,t),e.state.focused=!0,B(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),T&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),$r(e)}function _a(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(He(e,"blur",e,t),e.state.focused=!1,u(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Ui(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var o=t.view[n],M=e.options.lineWrapping,z=void 0,V=0;if(o.hidden)continue;if(U&&I<8){var Q=o.node.offsetTop+o.node.offsetHeight;z=Q-r,r=Q}else{var J=o.node.getBoundingClientRect();z=J.bottom-J.top,!M&&o.text.firstChild&&(V=o.text.firstChild.getBoundingClientRect().right-J.left-1)}var ye=o.line.height-z;if((ye>.005||ye<-.005)&&(Hr(o.line,z),Zi(o.line),o.rest))for(var Ce=0;Ce<o.rest.length;Ce++)Zi(o.rest[Ce]);if(V>e.display.sizerWidth){var Ue=Math.ceil(V/Yr(e.display));Ue>e.display.maxLineLength&&(e.display.maxLineLength=Ue,e.display.maxLine=o.line,e.display.maxLineChanged=!0)}}}function Zi(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var r=e.widgets[t],n=r.node.parentNode;n&&(r.height=n.offsetHeight)}}function ji(e,t,r){var n=r&&r.top!=null?Math.max(0,r.top):e.scroller.scrollTop;n=Math.floor(n-Qr(e));var o=r&&r.bottom!=null?r.bottom:n+e.wrapper.clientHeight,M=ja(t,n),z=ja(t,o);if(r&&r.ensure){var V=r.ensure.from.line,Q=r.ensure.to.line;V<M?(M=V,z=ja(t,vn(Ut(t,V))+e.wrapper.clientHeight)):Math.min(Q,t.lastLine())>=z&&(M=ja(t,vn(Ut(t,Q))-e.wrapper.clientHeight),z=Q)}return{from:M,to:Math.max(z,M+1)}}function wo(e,t){if(rt(e,"scrollCursorIntoView"))return;var r=e.display,n=r.sizer.getBoundingClientRect(),o=null;if(t.top+n.top<0?o=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(o=!1),o!=null&&!p){var M=i("div","\u200B",null,`position: absolute;
top: `+(t.top-r.viewOffset-Qr(e.display))+`px;
height: `+(t.bottom-t.top+Oe(e)+r.barHeight)+`px;
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(M),M.scrollIntoView(o),e.display.lineSpace.removeChild(M)}}function Do(e,t,r,n){n==null&&(n=0);var o;!e.options.lineWrapping&&t==r&&(t=t.ch?ct(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,r=t.sticky=="before"?ct(t.line,t.ch+1,"before"):t);for(var M=0;M<5;M++){var z=!1,V=kn(e,t),Q=!r||r==t?V:kn(e,r);o={left:Math.min(V.left,Q.left),top:Math.min(V.top,Q.top)-n,right:Math.max(V.left,Q.left),bottom:Math.max(V.bottom,Q.bottom)+n};var J=Bi(e,o),ye=e.doc.scrollTop,Ce=e.doc.scrollLeft;if(J.scrollTop!=null&&(ui(e,J.scrollTop),Math.abs(e.doc.scrollTop-ye)>1&&(z=!0)),J.scrollLeft!=null&&(Ma(e,J.scrollLeft),Math.abs(e.doc.scrollLeft-Ce)>1&&(z=!0)),!z)break}return o}function oo(e,t){var r=Bi(e,t);r.scrollTop!=null&&ui(e,r.scrollTop),r.scrollLeft!=null&&Ma(e,r.scrollLeft)}function Bi(e,t){var r=e.display,n=jr(e.display);t.top<0&&(t.top=0);var o=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:r.scroller.scrollTop,M=Z(e),z={};t.bottom-t.top>M&&(t.bottom=t.top+M);var V=e.doc.height+fe(r),Q=t.top<n,J=t.bottom>V-n;if(t.top<o)z.scrollTop=Q?0:t.top;else if(t.bottom>o+M){var ye=Math.min(t.top,(J?V:t.bottom)-M);ye!=o&&(z.scrollTop=ye)}var Ce=e.options.fixedGutter?0:r.gutters.offsetWidth,Ue=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:r.scroller.scrollLeft-Ce,Me=ge(e)-r.gutters.offsetWidth,nt=t.right-t.left>Me;return nt&&(t.right=t.left+Me),t.left<10?z.scrollLeft=0:t.left<Ue?z.scrollLeft=Math.max(0,t.left+Ce-(nt?0:10)):t.right>Me+Ue-3&&(z.scrollLeft=t.right+(nt?0:10)-Me),z}function Ji(e,t){if(t==null)return;Ai(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function li(e){Ai(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function vi(e,t,r){(t!=null||r!=null)&&Ai(e),t!=null&&(e.curOp.scrollLeft=t),r!=null&&(e.curOp.scrollTop=r)}function so(e,t){Ai(e),e.curOp.scrollToPos=t}function Ai(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var r=Vt(e,t.from),n=Vt(e,t.to);_r(e,r,n,t.margin)}}function _r(e,t,r,n){var o=Bi(e,{left:Math.min(t.left,r.left),top:Math.min(t.top,r.top)-n,right:Math.max(t.right,r.right),bottom:Math.max(t.bottom,r.bottom)+n});vi(e,o.scrollLeft,o.scrollTop)}function ui(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;R||wi(e,{top:t}),gi(e,t,!0),R&&wi(e),yi(e,100)}function gi(e,t,r){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!r)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function Ma(e,t,r,n){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n)return;e.doc.scrollLeft=t,Bn(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function di(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+fe(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?r:0,docHeight:n,scrollHeight:n+Oe(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}var ti=function(e,t,r){this.cm=r;var n=this.vert=i("div",[i("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),o=this.horiz=i("div",[i("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=o.tabIndex=-1,e(n),e(o),Be(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),Be(o,"scroll",function(){o.clientWidth&&t(o.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,U&&I<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};ti.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var o=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+o)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=r?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var M=e.viewWidth-e.barLeft-(r?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+M)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(n==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?n:0,bottom:t?n:0}},ti.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},ti.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},ti.prototype.zeroWidthHack=function(){var e=c&&!w?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new X,this.disableVert=new X},ti.prototype.enableZeroWidthBar=function(e,t,r){e.style.pointerEvents="auto";function n(){var o=e.getBoundingClientRect(),M=r=="vert"?document.elementFromPoint(o.right-1,(o.top+o.bottom)/2):document.elementFromPoint((o.right+o.left)/2,o.bottom-1);M!=e?e.style.pointerEvents="none":t.set(1e3,n)}t.set(1e3,n)},ti.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Si=function(){};Si.prototype.update=function(){return{bottom:0,right:0}},Si.prototype.setScrollLeft=function(){},Si.prototype.setScrollTop=function(){},Si.prototype.clear=function(){};function ci(e,t){t||(t=di(e));var r=e.display.barWidth,n=e.display.barHeight;Fi(e,t);for(var o=0;o<4&&r!=e.display.barWidth||n!=e.display.barHeight;o++)r!=e.display.barWidth&&e.options.lineWrapping&&Ui(e),Fi(e,di(e)),r=e.display.barWidth,n=e.display.barHeight}function Fi(e,t){var r=e.display,n=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=n.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=n.bottom)+"px",r.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=n.bottom+"px",r.scrollbarFiller.style.width=n.right+"px"):r.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=n.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}var qi={native:ti,null:Si};function Oi(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&u(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new qi[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Be(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,r){r=="horizontal"?Ma(e,t):ui(e,t)},e),e.display.scrollbars.addClass&&B(e.display.wrapper,e.display.scrollbars.addClass)}var Ki=0;function Va(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:++Ki},jn(e.curOp)}function Xa(e){var t=e.curOp;t&&ar(t,function(r){for(var n=0;n<r.ops.length;n++)r.ops[n].cm.curOp=null;lo(r)})}function lo(e){for(var t=e.ops,r=0;r<t.length;r++)Po(t[r]);for(var n=0;n<t.length;n++)Ro(t[n]);for(var o=0;o<t.length;o++)Mo(t[o]);for(var M=0;M<t.length;M++)ni(t[M]);for(var z=0;z<t.length;z++)Lo(t[z])}function Po(e){var t=e.cm,r=t.display;co(t),e.updateMaxLine&&yr(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<r.viewFrom||e.scrollToPos.to.line>=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new xa(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Ro(e){e.updatedDisplay=e.mustUpdate&&fi(e.cm,e.update)}function Mo(e){var t=e.cm,r=t.display;e.updatedDisplay&&Ui(t),e.barMeasure=di(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Ee(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+Oe(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-ge(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function ni(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Ma(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var r=e.focus&&e.focus==D();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,r),(e.updatedDisplay||e.startHeight!=t.doc.height)&&ci(t,e.barMeasure),e.updatedDisplay&&lr(t,e.barMeasure),e.selectionChanged&&$r(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),r&&Oo(e.cm)}function Lo(e){var t=e.cm,r=t.display,n=t.doc;if(e.updatedDisplay&&Wi(t,e.update),r.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(r.wheelStartX=r.wheelStartY=null),e.scrollTop!=null&&gi(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Ma(t,e.scrollLeft,!0,!0),e.scrollToPos){var o=Do(t,ln(n,e.scrollToPos.from),ln(n,e.scrollToPos.to),e.scrollToPos.margin);wo(t,o)}var M=e.maybeHiddenMarkers,z=e.maybeUnhiddenMarkers;if(M)for(var V=0;V<M.length;++V)M[V].lines.length||He(M[V],"hide");if(z)for(var Q=0;Q<z.length;++Q)z[Q].lines.length&&He(z[Q],"unhide");r.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&He(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function pa(e,t){if(e.curOp)return t();Va(e);try{return t()}finally{Xa(e)}}function Fr(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Va(e);try{return t.apply(e,arguments)}finally{Xa(e)}}}function aa(e){return function(){if(this.curOp)return e.apply(this,arguments);Va(this);try{return e.apply(this,arguments)}finally{Xa(this)}}}function Pr(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Va(t);try{return e.apply(this,arguments)}finally{Xa(t)}}}function yi(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,h(uo,e))}function uo(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var r=+new Date+e.options.workTime,n=bt(e,t.highlightFrontier),o=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),function(M){if(n.line>=e.display.viewFrom){var z=M.styles,V=M.text.length>e.options.maxHighlightLength?Rr(t.mode,n.state):null,Q=ii(e,M,n,!0);V&&(n.state=V),M.styles=Q.styles;var J=M.styleClasses,ye=Q.classes;ye?M.styleClasses=ye:J&&(M.styleClasses=null);for(var Ce=!z||z.length!=M.styles.length||J!=ye&&(!J||!ye||J.bgClass!=ye.bgClass||J.textClass!=ye.textClass),Ue=0;!Ce&&Ue<z.length;++Ue)Ce=z[Ue]!=M.styles[Ue];Ce&&o.push(n.line),M.stateAfter=n.save(),n.nextLine()}else M.text.length<=e.options.maxHighlightLength&&gr(e,M.text,n),M.stateAfter=n.line%5==0?n.save():null,n.nextLine();if(+new Date>r)return yi(e,e.options.workDelay),!0}),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),o.length&&pa(e,function(){for(var M=0;M<o.length;M++)wr(e,o[M],"text")})}var xa=function(e,t,r){var n=e.display;this.viewport=t,this.visible=ji(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=ge(e),this.force=r,this.dims=Tr(e),this.events=[]};xa.prototype.signal=function(e,t){se(e,t)&&this.events.push(arguments)},xa.prototype.finish=function(){for(var e=0;e<this.events.length;e++)He.apply(null,this.events[e])};function co(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Oe(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Oe(e)+"px",t.scrollbarsClipped=!0)}function fo(e){if(e.hasFocus())return null;var t=D();if(!t||!_(e.display.lineDiv,t))return null;var r={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&_(e.display.lineDiv,n.anchorNode)&&(r.anchorNode=n.anchorNode,r.anchorOffset=n.anchorOffset,r.focusNode=n.focusNode,r.focusOffset=n.focusOffset)}return r}function ho(e){if(!e||!e.activeElt||e.activeElt==D())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&_(document.body,e.anchorNode)&&_(document.body,e.focusNode)){var t=window.getSelection(),r=document.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),t.removeAllRanges(),t.addRange(r),t.extend(e.focusNode,e.focusOffset)}}function fi(e,t){var r=e.display,n=e.doc;if(t.editorIsHidden)return Er(e),!1;if(!t.force&&t.visible.from>=r.viewFrom&&t.visible.to<=r.viewTo&&(r.updateLineNumbers==null||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&ei(e)==0)return!1;Kr(e)&&(Er(e),t.dims=Tr(e));var o=n.first+n.size,M=Math.max(t.visible.from-e.options.viewportMargin,n.first),z=Math.min(o,t.visible.to+e.options.viewportMargin);r.viewFrom<M&&M-r.viewFrom<20&&(M=Math.max(n.first,r.viewFrom)),r.viewTo>z&&r.viewTo-z<20&&(z=Math.min(o,r.viewTo)),$t&&(M=zr(e.doc,M),z=dn(e.doc,z));var V=M!=r.viewFrom||z!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;qa(e,M,z),r.viewOffset=vn(Ut(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var Q=ei(e);if(!V&&Q==0&&!t.force&&r.renderedView==r.view&&(r.updateLineNumbers==null||r.updateLineNumbers>=r.viewTo))return!1;var J=fo(e);return Q>4&&(r.lineDiv.style.display="none"),mo(e,r.updateLineNumbers,t.dims),Q>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,ho(J),l(r.cursorDiv),l(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,V&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,yi(e,400)),r.updateLineNumbers=null,!0}function Wi(e,t){for(var r=t.viewport,n=!0;;n=!1){if(!n||!e.options.lineWrapping||t.oldDisplayWidth==ge(e)){if(r&&r.top!=null&&(r={top:Math.min(e.doc.height+fe(e.display)-Z(e),r.top)}),t.visible=ji(e.display,e.doc,r),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else n&&(t.visible=ji(e.display,e.doc,r));if(!fi(e,t))break;Ui(e);var o=di(e);sr(e),ci(e,o),lr(e,o),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 wi(e,t){var r=new xa(e,t);if(fi(e,r)){Ui(e),Wi(e,r);var n=di(e);sr(e),ci(e,n),lr(e,n),r.finish()}}function mo(e,t,r){var n=e.display,o=e.options.lineNumbers,M=n.lineDiv,z=M.firstChild;function V(nt){var dt=nt.nextSibling;return T&&c&&e.display.currentWheelTarget==nt?nt.style.display="none":nt.parentNode.removeChild(nt),dt}for(var Q=n.view,J=n.viewFrom,ye=0;ye<Q.length;ye++){var Ce=Q[ye];if(!Ce.hidden)if(!Ce.node||Ce.node.parentNode!=M){var Ue=ao(e,Ce,J,r);M.insertBefore(Ue,z)}else{for(;z!=Ce.node;)z=V(z);var Me=o&&t!=null&&t<=J&&Ce.lineNumber;Ce.changes&&(Y(Ce.changes,"gutter")>-1&&(Me=!1),si(e,Ce,J,r)),Me&&(l(Ce.lineNumber),Ce.lineNumber.appendChild(document.createTextNode(Aa(e.options,J)))),z=Ce.node.nextSibling}J+=Ce.size}for(;z;)z=V(z)}function Hi(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function lr(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+Oe(e)+"px"}function Bn(e){var t=e.display,r=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var n=sa(t)-t.scroller.scrollLeft+e.doc.scrollLeft,o=t.gutters.offsetWidth,M=n+"px",z=0;z<r.length;z++)if(!r[z].hidden){e.options.fixedGutter&&(r[z].gutter&&(r[z].gutter.style.left=M),r[z].gutterBackground&&(r[z].gutterBackground.style.left=M));var V=r[z].alignable;if(V)for(var Q=0;Q<V.length;Q++)V[Q].style.left=M}e.options.fixedGutter&&(t.gutters.style.left=n+o+"px")}function Kr(e){if(!e.options.lineNumbers)return!1;var t=e.doc,r=Aa(e.options,t.first+t.size-1),n=e.display;if(r.length!=n.lineNumChars){var o=n.measure.appendChild(i("div",[i("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt")),M=o.firstChild.offsetWidth,z=o.offsetWidth-M;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(M,n.lineGutter.offsetWidth-z)+1,n.lineNumWidth=n.lineNumInnerWidth+z,n.lineNumChars=n.lineNumInnerWidth?r.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",Hi(e.display),!0}return!1}function va(e,t){for(var r=[],n=!1,o=0;o<e.length;o++){var M=e[o],z=null;if(typeof M!="string"&&(z=M.style,M=M.className),M=="CodeMirror-linenumbers")if(t)n=!0;else continue;r.push({className:M,style:z})}return t&&!n&&r.push({className:"CodeMirror-linenumbers",style:null}),r}function bi(e){var t=e.gutters,r=e.gutterSpecs;l(t),e.lineGutter=null;for(var n=0;n<r.length;++n){var o=r[n],M=o.className,z=o.style,V=t.appendChild(i("div",null,"CodeMirror-gutter "+M));z&&(V.style.cssText=z),M=="CodeMirror-linenumbers"&&(e.lineGutter=V,V.style.width=(e.lineNumWidth||1)+"px")}t.style.display=r.length?"":"none",Hi(e)}function Qa(e){bi(e.display),Yn(e),Bn(e)}function Di(e,t,r,n){var o=this;this.input=r,o.scrollbarFiller=i("div",null,"CodeMirror-scrollbar-filler"),o.scrollbarFiller.setAttribute("cm-not-content","true"),o.gutterFiller=i("div",null,"CodeMirror-gutter-filler"),o.gutterFiller.setAttribute("cm-not-content","true"),o.lineDiv=E("div",null,"CodeMirror-code"),o.selectionDiv=i("div",null,null,"position: relative; z-index: 1"),o.cursorDiv=i("div",null,"CodeMirror-cursors"),o.measure=i("div",null,"CodeMirror-measure"),o.lineMeasure=i("div",null,"CodeMirror-measure"),o.lineSpace=E("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var M=E("div",[o.lineSpace],"CodeMirror-lines");o.mover=i("div",[M],null,"position: relative"),o.sizer=i("div",[o.mover],"CodeMirror-sizer"),o.sizerWidth=null,o.heightForcer=i("div",null,null,"position: absolute; height: "+re+"px; width: 1px;"),o.gutters=i("div",null,"CodeMirror-gutters"),o.lineGutter=null,o.scroller=i("div",[o.sizer,o.heightForcer,o.gutters],"CodeMirror-scroll"),o.scroller.setAttribute("tabIndex","-1"),o.wrapper=i("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"CodeMirror"),U&&I<8&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),!T&&!(R&&s)&&(o.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(o.wrapper):e(o.wrapper)),o.viewFrom=o.viewTo=t.first,o.reportedViewFrom=o.reportedViewTo=t.first,o.view=[],o.renderedView=null,o.externalMeasured=null,o.viewOffset=0,o.lastWrapHeight=o.lastWrapWidth=0,o.updateLineNumbers=null,o.nativeBarWidth=o.barHeight=o.barWidth=0,o.scrollbarsClipped=!1,o.lineNumWidth=o.lineNumInnerWidth=o.lineNumChars=null,o.alignWidgets=!1,o.cachedCharWidth=o.cachedTextHeight=o.cachedPaddingH=null,o.maxLine=null,o.maxLineLength=0,o.maxLineChanged=!1,o.wheelDX=o.wheelDY=o.wheelStartX=o.wheelStartY=null,o.shift=!1,o.selForContextMenu=null,o.activeTouch=null,o.gutterSpecs=va(n.gutters,n.lineNumbers),bi(o),r.init(o)}var Ya=0,Fe=null;U?Fe=-.53:R?Fe=15:b?Fe=-.7:k&&(Fe=-1/3);function Ke(e){var t=e.wheelDeltaX,r=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),r==null&&e.detail&&e.axis==e.VERTICAL_AXIS?r=e.detail:r==null&&(r=e.wheelDelta),{x:t,y:r}}function We(e){var t=Ke(e);return t.x*=Fe,t.y*=Fe,t}function et(e,t){var r=Ke(t),n=r.x,o=r.y,M=e.display,z=M.scroller,V=z.scrollWidth>z.clientWidth,Q=z.scrollHeight>z.clientHeight;if(!(n&&V||o&&Q))return;if(o&&c&&T){e:for(var J=t.target,ye=M.view;J!=z;J=J.parentNode)for(var Ce=0;Ce<ye.length;Ce++)if(ye[Ce].node==J){e.display.currentWheelTarget=J;break e}}if(n&&!R&&!g&&Fe!=null){o&&Q&&ui(e,Math.max(0,z.scrollTop+o*Fe)),Ma(e,Math.max(0,z.scrollLeft+n*Fe)),(!o||o&&Q)&&te(t),M.wheelStartX=null;return}if(o&&Fe!=null){var Ue=o*Fe,Me=e.doc.scrollTop,nt=Me+M.wrapper.clientHeight;Ue<0?Me=Math.max(0,Me+Ue-50):nt=Math.min(e.doc.height,nt+Ue+50),wi(e,{top:Me,bottom:nt})}Ya<20&&(M.wheelStartX==null?(M.wheelStartX=z.scrollLeft,M.wheelStartY=z.scrollTop,M.wheelDX=n,M.wheelDY=o,setTimeout(function(){if(M.wheelStartX==null)return;var dt=z.scrollLeft-M.wheelStartX,xt=z.scrollTop-M.wheelStartY,wt=xt&&M.wheelDY&&xt/M.wheelDY||dt&&M.wheelDX&&dt/M.wheelDX;if(M.wheelStartX=M.wheelStartY=null,!wt)return;Fe=(Fe*Ya+wt)/(Ya+1),++Ya},200)):(M.wheelDX+=n,M.wheelDY+=o))}var it=function(e,t){this.ranges=e,this.primIndex=t};it.prototype.primary=function(){return this.ranges[this.primIndex]},it.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 r=this.ranges[t],n=e.ranges[t];if(!Ha(r.anchor,n.anchor)||!Ha(r.head,n.head))return!1}return!0},it.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new tt(Za(this.ranges[t].anchor),Za(this.ranges[t].head));return new it(e,this.primIndex)},it.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},it.prototype.contains=function(e,t){t||(t=e);for(var r=0;r<this.ranges.length;r++){var n=this.ranges[r];if(rn(t,n.from())>=0&&rn(e,n.to())<=0)return r}return-1};var tt=function(e,t){this.anchor=e,this.head=t};tt.prototype.from=function(){return Ja(this.anchor,this.head)},tt.prototype.to=function(){return ai(this.anchor,this.head)},tt.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Et(e,t,r){var n=e&&e.options.selectionsMayTouch,o=t[r];t.sort(function(Ue,Me){return rn(Ue.from(),Me.from())}),r=Y(t,o);for(var M=1;M<t.length;M++){var z=t[M],V=t[M-1],Q=rn(V.to(),z.from());if(n&&!z.empty()?Q>0:Q>=0){var J=Ja(V.from(),z.from()),ye=ai(V.to(),z.to()),Ce=V.empty()?z.from()==z.head:V.from()==V.head;M<=r&&--r,t.splice(--M,2,new tt(Ce?ye:J,Ce?J:ye))}}return new it(t,r)}function ut(e,t){return new it([new tt(e,t||e)],0)}function Ft(e){return e.text?ct(e.from.line+e.text.length-1,ve(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Pn(e,t){if(rn(e,t.from)<0)return e;if(rn(e,t.to)<=0)return Ft(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=Ft(t).ch-t.to.ch),ct(r,n)}function la(e,t){for(var r=[],n=0;n<e.sel.ranges.length;n++){var o=e.sel.ranges[n];r.push(new tt(Pn(o.anchor,t),Pn(o.head,t)))}return Et(e.cm,r,e.sel.primIndex)}function Nn(e,t,r){return e.line==t.line?ct(r.line,e.ch-t.ch+r.ch):ct(r.line+(e.line-t.line),e.ch)}function ga(e,t,r){for(var n=[],o=ct(e.first,0),M=o,z=0;z<t.length;z++){var V=t[z],Q=Nn(V.from,o,M),J=Nn(Ft(V),o,M);if(o=V.to,M=J,r=="around"){var ye=e.sel.ranges[z],Ce=rn(ye.head,ye.anchor)<0;n[z]=new tt(Ce?J:Q,Ce?Q:J)}else n[z]=new tt(Q,Q)}return new it(n,e.sel.primIndex)}function Mr(e){e.doc.mode=ca(e.options,e.doc.modeOption),Zr(e)}function Zr(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,yi(e,100),e.state.modeGen++,e.curOp&&Yn(e)}function hi(e,t){return t.from.ch==0&&t.to.ch==0&&ve(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Lr(e,t,r,n){function o(kt){return r?r[kt]:null}function M(kt,Dt,Kt){br(kt,Dt,Kt,n),Jn(kt,"change",kt,t)}function z(kt,Dt){for(var Kt=[],sn=kt;sn<Dt;++sn)Kt.push(new kr(J[sn],o(sn),n));return Kt}var V=t.from,Q=t.to,J=t.text,ye=Ut(e,V.line),Ce=Ut(e,Q.line),Ue=ve(J),Me=o(J.length-1),nt=Q.line-V.line;if(t.full)e.insert(0,z(0,J.length)),e.remove(J.length,e.size-J.length);else if(hi(e,t)){var dt=z(0,J.length-1);M(Ce,Ce.text,Me),nt&&e.remove(V.line,nt),dt.length&&e.insert(V.line,dt)}else if(ye==Ce)if(J.length==1)M(ye,ye.text.slice(0,V.ch)+Ue+ye.text.slice(Q.ch),Me);else{var xt=z(1,J.length-1);xt.push(new kr(Ue+ye.text.slice(Q.ch),Me,n)),M(ye,ye.text.slice(0,V.ch)+J[0],o(0)),e.insert(V.line+1,xt)}else if(J.length==1)M(ye,ye.text.slice(0,V.ch)+J[0]+Ce.text.slice(Q.ch),o(0)),e.remove(V.line+1,nt);else{M(ye,ye.text.slice(0,V.ch)+J[0],o(0)),M(Ce,Ue+Ce.text.slice(Q.ch),Me);var wt=z(1,J.length-1);nt>1&&e.remove(V.line+1,nt-1),e.insert(V.line+1,wt)}Jn(e,"change",e,t)}function ea(e,t,r){function n(o,M,z){if(o.linked)for(var V=0;V<o.linked.length;++V){var Q=o.linked[V];if(Q.doc==M)continue;var J=z&&Q.sharedHist;if(r&&!J)continue;t(Q.doc,J),n(Q.doc,o,J)}}n(e,null,!0)}function Ka(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,ma(e),Mr(e),eo(e),e.options.lineWrapping||yr(e),e.options.mode=t.modeOption,Yn(e)}function eo(e){(e.doc.direction=="rtl"?B:u)(e.display.lineDiv,"CodeMirror-rtl")}function $a(e){pa(e,function(){eo(e),Yn(e)})}function zi(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 os(e,t){var r={from:Za(t.from),to:Ft(t),text:ra(e,t.from,t.to)};return xs(e,r,t.from.line,t.to.line+1),ea(e,function(n){return xs(n,r,t.from.line,t.to.line+1)},!0),r}function Es(e){for(;e.length;){var t=ve(e);if(t.ranges)e.pop();else break}}function ml(e,t){if(t)return Es(e.done),ve(e.done);if(e.done.length&&!ve(e.done).ranges)return ve(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),ve(e.done)}function _s(e,t,r,n){var o=e.history;o.undone.length=0;var M=+new Date,z,V;if((o.lastOp==n||o.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&o.lastModTime>M-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(z=ml(o,o.lastOp==n)))V=ve(z.changes),rn(t.from,t.to)==0&&rn(t.from,V.to)==0?V.to=Ft(t):z.changes.push(os(e,t));else{var Q=ve(o.done);for((!Q||!Q.ranges)&&Qo(e.sel,o.done),z={changes:[os(e,t)],generation:o.generation},o.done.push(z);o.done.length>o.undoDepth;)o.done.shift(),o.done[0].ranges||o.done.shift()}o.done.push(r),o.generation=++o.maxGeneration,o.lastModTime=o.lastSelTime=M,o.lastOp=o.lastSelOp=n,o.lastOrigin=o.lastSelOrigin=t.origin,V||He(e,"historyAdded")}function pl(e,t,r,n){var o=t.charAt(0);return o=="*"||o=="+"&&r.ranges.length==n.ranges.length&&r.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function vl(e,t,r,n){var o=e.history,M=n&&n.origin;r==o.lastSelOp||M&&o.lastSelOrigin==M&&(o.lastModTime==o.lastSelTime&&o.lastOrigin==M||pl(e,M,ve(o.done),t))?o.done[o.done.length-1]=t:Qo(t,o.done),o.lastSelTime=+new Date,o.lastSelOrigin=M,o.lastSelOp=r,n&&n.clearRedo!==!1&&Es(o.undone)}function Qo(e,t){var r=ve(t);r&&r.ranges&&r.equals(e)||t.push(e)}function xs(e,t,r,n){var o=t["spans_"+e.id],M=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,n),function(z){z.markedSpans&&((o||(o=t["spans_"+e.id]={}))[M]=z.markedSpans),++M})}function gl(e){if(!e)return null;for(var t,r=0;r<e.length;++r)e[r].marker.explicitlyCleared?t||(t=e.slice(0,r)):t&&t.push(e[r]);return t?t.length?t:null:e}function yl(e,t){var r=t["spans_"+e.id];if(!r)return null;for(var n=[],o=0;o<t.text.length;++o)n.push(gl(r[o]));return n}function Cs(e,t){var r=yl(e,t),n=un(e,t);if(!r)return n;if(!n)return r;for(var o=0;o<r.length;++o){var M=r[o],z=n[o];if(M&&z){e:for(var V=0;V<z.length;++V){for(var Q=z[V],J=0;J<M.length;++J)if(M[J].marker==Q.marker)continue e;M.push(Q)}}else z&&(r[o]=z)}return r}function po(e,t,r){for(var n=[],o=0;o<e.length;++o){var M=e[o];if(M.ranges){n.push(r?it.prototype.deepCopy.call(M):M);continue}var z=M.changes,V=[];n.push({changes:V});for(var Q=0;Q<z.length;++Q){var J=z[Q],ye=void 0;if(V.push({from:J.from,to:J.to,text:J.text}),t)for(var Ce in J)(ye=Ce.match(/^spans_(\d+)$/))&&(Y(t,Number(ye[1]))>-1&&(ve(V)[Ce]=J[Ce],delete J[Ce]))}}return n}function ss(e,t,r,n){if(n){var o=e.anchor;if(r){var M=rn(t,o)<0;M!=rn(r,o)<0?(o=t,t=r):M!=rn(t,r)<0&&(t=r)}return new tt(o,t)}else return new tt(r||t,t)}function Yo(e,t,r,n,o){o==null&&(o=e.cm&&(e.cm.display.shift||e.extend)),Ca(e,new it([ss(e.sel.primary(),t,r,o)],0),n)}function Ts(e,t,r){for(var n=[],o=e.cm&&(e.cm.display.shift||e.extend),M=0;M<e.sel.ranges.length;M++)n[M]=ss(e.sel.ranges[M],t[M],null,o);var z=Et(e.cm,n,e.sel.primIndex);Ca(e,z,r)}function ls(e,t,r,n){var o=e.sel.ranges.slice(0);o[t]=r,Ca(e,Et(e.cm,o,e.sel.primIndex),n)}function As(e,t,r,n){Ca(e,ut(t,r),n)}function bl(e,t,r){var n={ranges:t.ranges,update:function(o){this.ranges=[];for(var M=0;M<o.length;M++)this.ranges[M]=new tt(ln(e,o[M].anchor),ln(e,o[M].head))},origin:r&&r.origin};return He(e,"beforeSelectionChange",e,n),e.cm&&He(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?Et(e.cm,n.ranges,n.ranges.length-1):t}function Ss(e,t,r){var n=e.history.done,o=ve(n);o&&o.ranges?(n[n.length-1]=t,$o(e,t,r)):Ca(e,t,r)}function Ca(e,t,r){$o(e,t,r),vl(e,e.sel,e.cm?e.cm.curOp.id:NaN,r)}function $o(e,t,r){(se(e,"beforeSelectionChange")||e.cm&&se(e.cm,"beforeSelectionChange"))&&(t=bl(e,t,r));var n=r&&r.bias||(rn(t.primary().head,e.sel.primary().head)<0?-1:1);Os(e,Ds(e,t,n,!0)),!(r&&r.scroll===!1)&&e.cm&&li(e.cm)}function Os(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,me(e.cm)),Jn(e,"cursorActivity",e)}function ws(e){Os(e,Ds(e,e.sel,null,!1))}function Ds(e,t,r,n){for(var o,M=0;M<t.ranges.length;M++){var z=t.ranges[M],V=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[M],Q=Zo(e,z.anchor,V&&V.anchor,r,n),J=Zo(e,z.head,V&&V.head,r,n);(o||Q!=z.anchor||J!=z.head)&&(o||(o=t.ranges.slice(0,M)),o[M]=new tt(Q,J))}return o?Et(e.cm,o,t.primIndex):t}function vo(e,t,r,n,o){var M=Ut(e,t.line);if(M.markedSpans)for(var z=0;z<M.markedSpans.length;++z){var V=M.markedSpans[z],Q=V.marker,J="selectLeft"in Q?!Q.selectLeft:Q.inclusiveLeft,ye="selectRight"in Q?!Q.selectRight:Q.inclusiveRight;if((V.from==null||(J?V.from<=t.ch:V.from<t.ch))&&(V.to==null||(ye?V.to>=t.ch:V.to>t.ch))){if(o&&(He(Q,"beforeCursorEnter"),Q.explicitlyCleared))if(M.markedSpans){--z;continue}else break;if(!Q.atomic)continue;if(r){var Ce=Q.find(n<0?1:-1),Ue=void 0;if((n<0?ye:J)&&(Ce=Ps(e,Ce,-n,Ce&&Ce.line==t.line?M:null)),Ce&&Ce.line==t.line&&(Ue=rn(Ce,r))&&(n<0?Ue<0:Ue>0))return vo(e,Ce,t,n,o)}var Me=Q.find(n<0?-1:1);return(n<0?J:ye)&&(Me=Ps(e,Me,n,Me.line==t.line?M:null)),Me?vo(e,Me,t,n,o):null}}return t}function Zo(e,t,r,n,o){var M=n||1,z=vo(e,t,r,M,o)||!o&&vo(e,t,r,M,!0)||vo(e,t,r,-M,o)||!o&&vo(e,t,r,-M,!0);return z||(e.cantEdit=!0,ct(e.first,0))}function Ps(e,t,r,n){return r<0&&t.ch==0?t.line>e.first?ln(e,ct(t.line-1)):null:r>0&&t.ch==(n||Ut(e,t.line)).text.length?t.line<e.first+e.size-1?ct(t.line+1,0):null:new ct(t.line,t.ch+r)}function Rs(e){e.setSelection(ct(e.firstLine(),0),ct(e.lastLine()),de)}function Ms(e,t,r){var n={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return n.canceled=!0}};return r&&(n.update=function(o,M,z,V){o&&(n.from=ln(e,o)),M&&(n.to=ln(e,M)),z&&(n.text=z),V!==void 0&&(n.origin=V)}),He(e,"beforeChange",e,n),e.cm&&He(e.cm,"beforeChange",e.cm,n),n.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:n.from,to:n.to,text:n.text,origin:n.origin}}function go(e,t,r){if(e.cm){if(!e.cm.curOp)return Fr(e.cm,go)(e,t,r);if(e.cm.state.suppressEdits)return}if((se(e,"beforeChange")||e.cm&&se(e.cm,"beforeChange"))&&(t=Ms(e,t,!0),!t))return;var n=bn&&!r&&Hn(e,t.from,t.to);if(n)for(var o=n.length-1;o>=0;--o)Ls(e,{from:n[o].from,to:n[o].to,text:o?[""]:t.text,origin:t.origin});else Ls(e,t)}function Ls(e,t){if(t.text.length==1&&t.text[0]==""&&rn(t.from,t.to)==0)return;var r=la(e,t);_s(e,t,r,e.cm?e.cm.curOp.id:NaN),ko(e,t,r,un(e,t));var n=[];ea(e,function(o,M){!M&&Y(n,o.history)==-1&&(Us(o.history,t),n.push(o.history)),ko(o,t,null,un(o,t))})}function Jo(e,t,r){var n=e.cm&&e.cm.state.suppressEdits;if(n&&!r)return;for(var o=e.history,M,z=e.sel,V=t=="undo"?o.done:o.undone,Q=t=="undo"?o.undone:o.done,J=0;J<V.length&&!(M=V[J],r?M.ranges&&!M.equals(e.sel):!M.ranges);J++);if(J==V.length)return;for(o.lastOrigin=o.lastSelOrigin=null;;)if(M=V.pop(),M.ranges){if(Qo(M,Q),r&&!M.equals(e.sel)){Ca(e,M,{clearRedo:!1});return}z=M}else if(n){V.push(M);return}else break;var ye=[];Qo(z,Q),Q.push({changes:ye,generation:o.generation}),o.generation=M.generation||++o.maxGeneration;for(var Ce=se(e,"beforeChange")||e.cm&&se(e.cm,"beforeChange"),Ue=function(dt){var xt=M.changes[dt];if(xt.origin=t,Ce&&!Ms(e,xt,!1))return V.length=0,{};ye.push(os(e,xt));var wt=dt?la(e,xt):ve(V);ko(e,xt,wt,Cs(e,xt)),!dt&&e.cm&&e.cm.scrollIntoView({from:xt.from,to:Ft(xt)});var kt=[];ea(e,function(Dt,Kt){!Kt&&Y(kt,Dt.history)==-1&&(Us(Dt.history,xt),kt.push(Dt.history)),ko(Dt,xt,null,Cs(Dt,xt))})},Me=M.changes.length-1;Me>=0;--Me){var nt=Ue(Me);if(nt)return nt.v}}function ks(e,t){if(t==0)return;if(e.first+=t,e.sel=new it(Pe(e.sel.ranges,function(o){return new tt(ct(o.anchor.line+t,o.anchor.ch),ct(o.head.line+t,o.head.ch))}),e.sel.primIndex),e.cm){Yn(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;n<r.viewTo;n++)wr(e.cm,n,"gutter")}}function ko(e,t,r,n){if(e.cm&&!e.cm.curOp)return Fr(e.cm,ko)(e,t,r,n);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 o=t.text.length-1-(e.first-t.from.line);ks(e,o),t={from:ct(e.first,0),to:ct(t.to.line+o,t.to.ch),text:[ve(t.text)],origin:t.origin}}var M=e.lastLine();t.to.line>M&&(t={from:t.from,to:ct(M,Ut(e,M).text.length),text:[t.text[0]],origin:t.origin}),t.removed=ra(e,t.from,t.to),r||(r=la(e,t)),e.cm?El(e.cm,t,n):Lr(e,t,n),$o(e,r,de),e.cantEdit&&Zo(e,ct(e.firstLine(),0))&&(e.cantEdit=!1)}function El(e,t,r){var n=e.doc,o=e.display,M=t.from,z=t.to,V=!1,Q=M.line;e.options.lineWrapping||(Q=Kn(Gt(Ut(n,M.line))),n.iter(Q,z.line+1,function(Me){if(Me==o.maxLine)return V=!0,!0})),n.sel.contains(t.from,t.to)>-1&&me(e),Lr(n,t,r,Ea(e)),e.options.lineWrapping||(n.iter(Q,M.line+t.text.length,function(Me){var nt=Rn(Me);nt>o.maxLineLength&&(o.maxLine=Me,o.maxLineLength=nt,o.maxLineChanged=!0,V=!1)}),V&&(e.curOp.updateMaxLine=!0)),pn(n,M.line),yi(e,400);var J=t.text.length-(z.line-M.line)-1;t.full?Yn(e):M.line==z.line&&t.text.length==1&&!hi(e.doc,t)?wr(e,M.line,"text"):Yn(e,M.line,z.line+1,J);var ye=se(e,"changes"),Ce=se(e,"change");if(Ce||ye){var Ue={from:M,to:z,text:t.text,removed:t.removed,origin:t.origin};Ce&&Jn(e,"change",e,Ue),ye&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Ue)}e.display.selForContextMenu=null}function yo(e,t,r,n,o){var M;n||(n=r),rn(n,r)<0&&(M=[n,r],r=M[0],n=M[1]),typeof t=="string"&&(t=e.splitLines(t)),go(e,{from:r,to:n,text:t,origin:o})}function Is(e,t,r,n){r<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function Ns(e,t,r,n){for(var o=0;o<e.length;++o){var M=e[o],z=!0;if(M.ranges){M.copied||(M=e[o]=M.deepCopy(),M.copied=!0);for(var V=0;V<M.ranges.length;V++)Is(M.ranges[V].anchor,t,r,n),Is(M.ranges[V].head,t,r,n);continue}for(var Q=0;Q<M.changes.length;++Q){var J=M.changes[Q];if(r<J.from.line)J.from=ct(J.from.line+n,J.from.ch),J.to=ct(J.to.line+n,J.to.ch);else if(t<=J.to.line){z=!1;break}}z||(e.splice(0,o+1),o=0)}}function Us(e,t){var r=t.from.line,n=t.to.line,o=t.text.length-(n-r)-1;Ns(e.done,r,n,o),Ns(e.undone,r,n,o)}function Io(e,t,r,n){var o=t,M=t;return typeof t=="number"?M=Ut(e,_i(e,t)):o=Kn(t),o==null?null:(n(M,o)&&e.cm&&wr(e.cm,o,r),M)}function No(e){this.lines=e,this.parent=null;for(var t=0,r=0;r<e.length;++r)e[r].parent=this,t+=e[r].height;this.height=t}No.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var r=e,n=e+t;r<n;++r){var o=this.lines[r];this.height-=o.height,Sr(o),Jn(o,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,r){this.height+=r,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var n=0;n<t.length;++n)t[n].parent=this},iterN:function(e,t,r){for(var n=e+t;e<n;++e)if(r(this.lines[e]))return!0}};function Uo(e){this.children=e;for(var t=0,r=0,n=0;n<e.length;++n){var o=e[n];t+=o.chunkSize(),r+=o.height,o.parent=this}this.size=t,this.height=r,this.parent=null}Uo.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var r=0;r<this.children.length;++r){var n=this.children[r],o=n.chunkSize();if(e<o){var M=Math.min(t,o-e),z=n.height;if(n.removeInner(e,M),this.height-=z-n.height,o==M&&(this.children.splice(r--,1),n.parent=null),(t-=M)==0)break;e=0}else e-=o}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof No))){var V=[];this.collapse(V),this.children=[new No(V)],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,r){this.size+=t.length,this.height+=r;for(var n=0;n<this.children.length;++n){var o=this.children[n],M=o.chunkSize();if(e<=M){if(o.insertInner(e,t,r),o.lines&&o.lines.length>50){for(var z=o.lines.length%25+25,V=z;V<o.lines.length;){var Q=new No(o.lines.slice(V,V+=25));o.height-=Q.height,this.children.splice(++n,0,Q),Q.parent=this}o.lines=o.lines.slice(0,z),this.maybeSpill()}break}e-=M}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),r=new Uo(t);if(e.parent){e.size-=r.size,e.height-=r.height;var o=Y(e.parent.children,e);e.parent.children.splice(o+1,0,r)}else{var n=new Uo(e.children);n.parent=e,e.children=[n,r],e=n}r.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,r){for(var n=0;n<this.children.length;++n){var o=this.children[n],M=o.chunkSize();if(e<M){var z=Math.min(t,M-e);if(o.iterN(e,z,r))return!0;if((t-=z)==0)break;e=0}else e-=M}}};var jo=function(e,t,r){if(r)for(var n in r)r.hasOwnProperty(n)&&(this[n]=r[n]);this.doc=e,this.node=t};jo.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,r=this.line,n=Kn(r);if(n==null||!t)return;for(var o=0;o<t.length;++o)t[o]==this&&t.splice(o--,1);t.length||(r.widgets=null);var M=za(this);Hr(r,Math.max(0,r.height-M)),e&&(pa(e,function(){js(e,r,-M),wr(e,n,"widget")}),Jn(e,"lineWidgetCleared",e,this,n))},jo.prototype.changed=function(){var e=this,t=this.height,r=this.doc.cm,n=this.line;this.height=null;var o=za(this)-t;if(!o)return;St(this.doc,n)||Hr(n,n.height+o),r&&pa(r,function(){r.curOp.forceUpdate=!0,js(r,n,o),Jn(r,"lineWidgetChanged",r,e,Kn(n))})},be(jo);function js(e,t,r){vn(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Ji(e,r)}function _l(e,t,r,n){var o=new jo(e,r,n),M=e.cm;return M&&o.noHScroll&&(M.display.alignWidgets=!0),Io(e,t,"widget",function(z){var V=z.widgets||(z.widgets=[]);if(o.insertAt==null?V.push(o):V.splice(Math.min(V.length-1,Math.max(0,o.insertAt)),0,o),o.line=z,M&&!St(e,z)){var Q=vn(z)<e.scrollTop;Hr(z,z.height+za(o)),Q&&Ji(M,o.height),M.curOp.forceUpdate=!0}return!0}),M&&Jn(M,"lineWidgetAdded",M,o,typeof t=="number"?t:Kn(t)),o}var Bs=0,Gi=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++Bs};Gi.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&Va(e),se(this,"clear")){var r=this.find();r&&Jn(this,"clear",r.from,r.to)}for(var n=null,o=null,M=0;M<this.lines.length;++M){var z=this.lines[M],V=Xt(z.markedSpans,this);e&&!this.collapsed?wr(e,Kn(z),"text"):e&&(V.to!=null&&(o=Kn(z)),V.from!=null&&(n=Kn(z))),z.markedSpans=En(z.markedSpans,V),V.from==null&&this.collapsed&&!St(this.doc,z)&&e&&Hr(z,jr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var Q=0;Q<this.lines.length;++Q){var J=Gt(this.lines[Q]),ye=Rn(J);ye>e.display.maxLineLength&&(e.display.maxLine=J,e.display.maxLineLength=ye,e.display.maxLineChanged=!0)}n!=null&&e&&this.collapsed&&Yn(e,n,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&ws(e.doc)),e&&Jn(e,"markerCleared",e,this,n,o),t&&Xa(e),this.parent&&this.parent.clear()},Gi.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var r,n,o=0;o<this.lines.length;++o){var M=this.lines[o],z=Xt(M.markedSpans,this);if(z.from!=null&&(r=ct(t?M:Kn(M),z.from),e==-1))return r;if(z.to!=null&&(n=ct(t?M:Kn(M),z.to),e==1))return n}return r&&{from:r,to:n}},Gi.prototype.changed=function(){var e=this,t=this.find(-1,!0),r=this,n=this.doc.cm;if(!t||!n)return;pa(n,function(){var o=t.line,M=Kn(t.line),z=Se(n,M);if(z&&(On(z),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!St(r.doc,o)&&r.height!=null){var V=r.height;r.height=null;var Q=za(r)-V;Q&&Hr(o,o.height+Q)}Jn(n,"markerChanged",n,e)})},Gi.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||Y(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Gi.prototype.detachLine=function(e){if(this.lines.splice(Y(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},be(Gi);function bo(e,t,r,n,o){if(n&&n.shared)return xl(e,t,r,n,o);if(e.cm&&!e.cm.curOp)return Fr(e.cm,bo)(e,t,r,n,o);var M=new Gi(e,o),z=rn(t,r);if(n&&N(n,M,!1),z>0||z==0&&M.clearWhenEmpty!==!1)return M;if(M.replacedWith&&(M.collapsed=!0,M.widgetNode=E("span",[M.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||M.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(M.widgetNode.insertLeft=!0)),M.collapsed){if(nr(e,t.line,t,r,M)||t.line!=r.line&&nr(e,r.line,t,r,M))throw new Error("Inserting collapsed marker partially overlapping an existing one");wn()}M.addToHistory&&_s(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var V=t.line,Q=e.cm,J;if(e.iter(V,r.line+1,function(Ce){Q&&M.collapsed&&!Q.options.lineWrapping&&Gt(Ce)==Q.display.maxLine&&(J=!0),M.collapsed&&V!=t.line&&Hr(Ce,0),Vn(Ce,new fn(M,V==t.line?t.ch:null,V==r.line?r.ch:null)),++V}),M.collapsed&&e.iter(t.line,r.line+1,function(Ce){St(e,Ce)&&Hr(Ce,0)}),M.clearOnEnter&&Be(M,"beforeCursorEnter",function(){return M.clear()}),M.readOnly&&(Zt(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),M.collapsed&&(M.id=++Bs,M.atomic=!0),Q){if(J&&(Q.curOp.updateMaxLine=!0),M.collapsed)Yn(Q,t.line,r.line+1);else if(M.className||M.startStyle||M.endStyle||M.css||M.attributes||M.title)for(var ye=t.line;ye<=r.line;ye++)wr(Q,ye,"text");M.atomic&&ws(Q.doc),Jn(Q,"markerAdded",Q,M)}return M}var Bo=function(e,t){this.markers=e,this.primary=t;for(var r=0;r<e.length;++r)e[r].parent=this};Bo.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Jn(this,"clear")},Bo.prototype.find=function(e,t){return this.primary.find(e,t)},be(Bo);function xl(e,t,r,n,o){n=N(n),n.shared=!1;var M=[bo(e,t,r,n,o)],z=M[0],V=n.widgetNode;return ea(e,function(Q){V&&(n.widgetNode=V.cloneNode(!0)),M.push(bo(Q,ln(Q,t),ln(Q,r),n,o));for(var J=0;J<Q.linked.length;++J)if(Q.linked[J].isParent)return;z=ve(M)}),new Bo(M,z)}function Fs(e){return e.findMarks(ct(e.first,0),e.clipPos(ct(e.lastLine())),function(t){return t.parent})}function Cl(e,t){for(var r=0;r<t.length;r++){var n=t[r],o=n.find(),M=e.clipPos(o.from),z=e.clipPos(o.to);if(rn(M,z)){var V=bo(e,M,z,n.primary,n.primary.type);n.markers.push(V),V.parent=n}}}function Tl(e){for(var t=function(n){var o=e[n],M=[o.primary.doc];ea(o.primary.doc,function(Q){return M.push(Q)});for(var z=0;z<o.markers.length;z++){var V=o.markers[z];Y(M,V.doc)==-1&&(V.parent=null,o.markers.splice(z--,1))}},r=0;r<e.length;r++)t(r)}var Al=0,La=function(e,t,r,n,o){if(!(this instanceof La))return new La(e,t,r,n,o);r==null&&(r=0),Uo.call(this,[new No([new kr("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=r;var M=ct(r,0);this.sel=ut(M),this.history=new zi(null),this.id=++Al,this.modeOption=t,this.lineSep=n,this.direction=o=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Lr(this,{from:M,to:M,text:e}),Ca(this,ut(M),de)};La.prototype=ke(Uo.prototype,{constructor:La,iter:function(e,t,r){r?this.iterN(e-this.first,t-e,r):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var r=0,n=0;n<t.length;++n)r+=t[n].height;this.insertInner(e-this.first,t,r)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Ua(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:Pr(function(e){var t=ct(this.first,0),r=this.first+this.size-1;go(this,{from:t,to:ct(r,Ut(this,r).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&vi(this.cm,0,0),Ca(this,ut(t),de)}),replaceRange:function(e,t,r,n){t=ln(this,t),r=r?ln(this,r):t,yo(this,e,t,r,n)},getRange:function(e,t,r){var n=ra(this,ln(this,e),ln(this,t));return r===!1?n:n.join(r||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(ri(this,e))return Ut(this,e)},getLineNumber:function(e){return Kn(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=Ut(this,e)),Gt(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return ln(this,e)},getCursor:function(e){var t=this.sel.primary(),r;return e==null||e=="head"?r=t.head:e=="anchor"?r=t.anchor:e=="end"||e=="to"||e===!1?r=t.to():r=t.from(),r},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Pr(function(e,t,r){As(this,ln(this,typeof e=="number"?ct(e,t||0):e),null,r)}),setSelection:Pr(function(e,t,r){As(this,ln(this,e),ln(this,t||e),r)}),extendSelection:Pr(function(e,t,r){Yo(this,ln(this,e),t&&ln(this,t),r)}),extendSelections:Pr(function(e,t){Ts(this,Qi(this,e),t)}),extendSelectionsBy:Pr(function(e,t){var r=Pe(this.sel.ranges,e);Ts(this,Qi(this,r),t)}),setSelections:Pr(function(e,t,r){if(!e.length)return;for(var n=[],o=0;o<e.length;o++)n[o]=new tt(ln(this,e[o].anchor),ln(this,e[o].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),Ca(this,Et(this.cm,n,t),r)}),addSelection:Pr(function(e,t,r){var n=this.sel.ranges.slice(0);n.push(new tt(ln(this,e),ln(this,t||e))),Ca(this,Et(this.cm,n,n.length-1),r)}),getSelection:function(e){for(var t=this.sel.ranges,r,n=0;n<t.length;n++){var o=ra(this,t[n].from(),t[n].to());r=r?r.concat(o):o}return e===!1?r:r.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],r=this.sel.ranges,n=0;n<r.length;n++){var o=ra(this,r[n].from(),r[n].to());e!==!1&&(o=o.join(e||this.lineSeparator())),t[n]=o}return t},replaceSelection:function(e,t,r){for(var n=[],o=0;o<this.sel.ranges.length;o++)n[o]=e;this.replaceSelections(n,t,r||"+input")},replaceSelections:Pr(function(e,t,r){for(var n=[],o=this.sel,M=0;M<o.ranges.length;M++){var z=o.ranges[M];n[M]={from:z.from(),to:z.to(),text:this.splitLines(e[M]),origin:r}}for(var V=t&&t!="end"&&ga(this,n,t),Q=n.length-1;Q>=0;Q--)go(this,n[Q]);V?Ss(this,V):this.cm&&li(this.cm)}),undo:Pr(function(){Jo(this,"undo")}),redo:Pr(function(){Jo(this,"redo")}),undoSelection:Pr(function(){Jo(this,"undo",!0)}),redoSelection:Pr(function(){Jo(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,r=0,n=0;n<e.done.length;n++)e.done[n].ranges||++t;for(var o=0;o<e.undone.length;o++)e.undone[o].ranges||++r;return{undo:t,redo:r}},clearHistory:function(){var e=this;this.history=new zi(this.history.maxGeneration),ea(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:po(this.history.done),undone:po(this.history.undone)}},setHistory:function(e){var t=this.history=new zi(this.history.maxGeneration);t.done=po(e.done.slice(0),null,!0),t.undone=po(e.undone.slice(0),null,!0)},setGutterMarker:Pr(function(e,t,r){return Io(this,e,"gutter",function(n){var o=n.gutterMarkers||(n.gutterMarkers={});return o[t]=r,!r&&ze(o)&&(n.gutterMarkers=null),!0})}),clearGutter:Pr(function(e){var t=this;this.iter(function(r){r.gutterMarkers&&r.gutterMarkers[e]&&Io(t,r,"gutter",function(){return r.gutterMarkers[e]=null,ze(r.gutterMarkers)&&(r.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!ri(this,e))return null;if(t=e,e=Ut(this,e),!e)return null}else if(t=Kn(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:Pr(function(e,t,r){return Io(this,e,t=="gutter"?"gutter":"class",function(n){var o=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!n[o])n[o]=r;else{if(x(r).test(n[o]))return!1;n[o]+=" "+r}return!0})}),removeLineClass:Pr(function(e,t,r){return Io(this,e,t=="gutter"?"gutter":"class",function(n){var o=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",M=n[o];if(M)if(r==null)n[o]=null;else{var z=M.match(x(r));if(!z)return!1;var V=z.index+z[0].length;n[o]=M.slice(0,z.index)+(!z.index||V==M.length?"":" ")+M.slice(V)||null}else return!1;return!0})}),addLineWidget:Pr(function(e,t,r){return _l(this,e,t,r)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,r){return bo(this,ln(this,e),ln(this,t),r,r&&r.type||"range")},setBookmark:function(e,t){var r={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=ln(this,e),bo(this,e,e,r,"bookmark")},findMarksAt:function(e){e=ln(this,e);var t=[],r=Ut(this,e.line).markedSpans;if(r)for(var n=0;n<r.length;++n){var o=r[n];(o.from==null||o.from<=e.ch)&&(o.to==null||o.to>=e.ch)&&t.push(o.marker.parent||o.marker)}return t},findMarks:function(e,t,r){e=ln(this,e),t=ln(this,t);var n=[],o=e.line;return this.iter(e.line,t.line+1,function(M){var z=M.markedSpans;if(z)for(var V=0;V<z.length;V++){var Q=z[V];!(Q.to!=null&&o==e.line&&e.ch>=Q.to||Q.from==null&&o!=e.line||Q.from!=null&&o==t.line&&Q.from>=t.ch)&&(!r||r(Q.marker))&&n.push(Q.marker.parent||Q.marker)}++o}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var r=t.markedSpans;if(r)for(var n=0;n<r.length;++n)r[n].from!=null&&e.push(r[n].marker)}),e},posFromIndex:function(e){var t,r=this.first,n=this.lineSeparator().length;return this.iter(function(o){var M=o.text.length+n;if(M>e)return t=e,!0;e-=M,++r}),ln(this,ct(r,t))},indexFromPos:function(e){e=ln(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var r=this.lineSeparator().length;return this.iter(this.first,e.line,function(n){t+=n.text.length+r}),t},copy:function(e){var t=new La(Ua(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,r=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<r&&(r=e.to);var n=new La(Ua(this,t,r),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(n.history=this.history),(this.linked||(this.linked=[])).push({doc:n,sharedHist:e.sharedHist}),n.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Cl(n,Fs(this)),n},unlinkDoc:function(e){if(e instanceof Br&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var r=this.linked[t];if(r.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),Tl(Fs(this));break}if(e.history==this.history){var n=[e.id];ea(e,function(o){return n.push(o.id)},!0),e.history=new zi(null),e.history.done=po(this.history.done,n),e.history.undone=po(this.history.undone,n)}},iterLinkedDocs:function(e){ea(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Bt(e)},lineSeparator:function(){return this.lineSep||`
`},setDirection:Pr(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&$a(this.cm)})}),La.prototype.eachLine=La.prototype.iter;var Ks=0;function Sl(e){var t=this;if(Ws(t),rt(t,e)||ba(t.display,e))return;te(e),U&&(Ks=+new Date);var r=Gr(t,e,!0),n=e.dataTransfer.files;if(!r||t.isReadOnly())return;if(n&&n.length&&window.FileReader&&window.File)for(var o=n.length,M=Array(o),z=0,V=function(){++z==o&&Fr(t,function(){r=ln(t.doc,r);var Me={from:r,to:r,text:t.doc.splitLines(M.filter(function(nt){return nt!=null}).join(t.doc.lineSeparator())),origin:"paste"};go(t.doc,Me),Ss(t.doc,ut(ln(t.doc,r),ln(t.doc,Ft(Me))))})()},Q=function(Me,nt){if(t.options.allowDropFileTypes&&Y(t.options.allowDropFileTypes,Me.type)==-1){V();return}var dt=new FileReader;dt.onerror=function(){return V()},dt.onload=function(){var xt=dt.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(xt)){V();return}M[nt]=xt,V()},dt.readAsText(Me)},J=0;J<n.length;J++)Q(n[J],J);else{if(t.state.draggingText&&t.doc.sel.contains(r)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var ye=e.dataTransfer.getData("Text");if(ye){var Ce;if(t.state.draggingText&&!t.state.draggingText.copy&&(Ce=t.listSelections()),$o(t.doc,ut(r,r)),Ce)for(var Ue=0;Ue<Ce.length;++Ue)yo(t.doc,"",Ce[Ue].anchor,Ce[Ue].head,"drag");t.replaceSelection(ye,"around","paste"),t.display.input.focus()}}catch(Me){}}}function Ol(e,t){if(U&&(!e.state.draggingText||+new Date-Ks<100)){_e(t);return}if(rt(e,t)||ba(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!k){var r=i("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",g&&(r.width=r.height=1,e.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),g&&r.parentNode.removeChild(r)}}function wl(e,t){var r=Gr(e,t);if(!r)return;var n=document.createDocumentFragment();Ga(e,r,n),e.display.dragCursor||(e.display.dragCursor=i("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),a(e.display.dragCursor,n)}function Ws(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Hs(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),r=[],n=0;n<t.length;n++){var o=t[n].CodeMirror;o&&r.push(o)}r.length&&r[0].operation(function(){for(var M=0;M<r.length;M++)e(r[M])})}var zs=!1;function Dl(){if(zs)return;Pl(),zs=!0}function Pl(){var e;Be(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Hs(Rl)},100))}),Be(window,"blur",function(){return Hs(_a)})}function Rl(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Vi={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"},Fo=0;Fo<10;Fo++)Vi[Fo+48]=Vi[Fo+96]=String(Fo);for(var qo=65;qo<=90;qo++)Vi[qo]=String.fromCharCode(qo);for(var Ko=1;Ko<=12;Ko++)Vi[Ko+111]=Vi[Ko+63235]="F"+Ko;var Pi={};Pi.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"},Pi.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"},Pi.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"},Pi.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"]},Pi.default=c?Pi.macDefault:Pi.pcDefault;function Ml(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var r,n,o,M,z=0;z<t.length-1;z++){var V=t[z];if(/^(cmd|meta|m)$/i.test(V))M=!0;else if(/^a(lt)?$/i.test(V))r=!0;else if(/^(c|ctrl|control)$/i.test(V))n=!0;else if(/^s(hift)?$/i.test(V))o=!0;else throw new Error("Unrecognized modifier name: "+V)}return r&&(e="Alt-"+e),n&&(e="Ctrl-"+e),M&&(e="Cmd-"+e),o&&(e="Shift-"+e),e}function Ll(e){var t={};for(var r in e)if(e.hasOwnProperty(r)){var n=e[r];if(/^(name|fallthrough|(de|at)tach)$/.test(r))continue;if(n=="..."){delete e[r];continue}for(var o=Pe(r.split(" "),Ml),M=0;M<o.length;M++){var z=void 0,V=void 0;M==o.length-1?(V=o.join(" "),z=n):(V=o.slice(0,M+1).join(" "),z="...");var Q=t[V];if(!Q)t[V]=z;else if(Q!=z)throw new Error("Inconsistent bindings for "+V)}delete e[r]}for(var J in t)e[J]=t[J];return e}function Eo(e,t,r,n){t=es(t);var o=t.call?t.call(e,n):t[e];if(o===!1)return"nothing";if(o==="...")return"multi";if(o!=null&&r(o))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return Eo(e,t.fallthrough,r,n);for(var M=0;M<t.fallthrough.length;M++){var z=Eo(e,t.fallthrough[M],r,n);if(z)return z}}}function Gs(e){var t=typeof e=="string"?e:Vi[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function Vs(e,t,r){var n=e;return t.altKey&&n!="Alt"&&(e="Alt-"+e),(m?t.metaKey:t.ctrlKey)&&n!="Ctrl"&&(e="Ctrl-"+e),(m?t.ctrlKey:t.metaKey)&&n!="Mod"&&(e="Cmd-"+e),!r&&t.shiftKey&&n!="Shift"&&(e="Shift-"+e),e}function Xs(e,t){if(g&&e.keyCode==34&&e.char)return!1;var r=Vi[e.keyCode];return r==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(r=e.code),Vs(r,e,t))}function es(e){return typeof e=="string"?Pi[e]:e}function _o(e,t){for(var r=e.doc.sel.ranges,n=[],o=0;o<r.length;o++){for(var M=t(r[o]);n.length&&rn(M.from,ve(n).to)<=0;){var z=n.pop();if(rn(z.from,M.from)<0){M.from=z.from;break}}n.push(M)}pa(e,function(){for(var V=n.length-1;V>=0;V--)yo(e.doc,"",n[V].from,n[V].to,"+delete");li(e)})}function us(e,t,r){var n=Ge(e.text,t+r,r);return n<0||n>e.text.length?null:n}function ds(e,t,r){var n=us(e,t.ch,r);return n==null?null:new ct(t.line,n,r<0?"after":"before")}function cs(e,t,r,n,o){if(e){t.doc.direction=="rtl"&&(o=-o);var M=pt(r,t.doc.direction);if(M){var z=o<0?ve(M):M[0],V=o<0==(z.level==1),Q=V?"after":"before",J;if(z.level>0||t.doc.direction=="rtl"){var ye=xe(t,r);J=o<0?r.text.length-1:0;var Ce=Re(t,ye,J).top;J=ht(function(Ue){return Re(t,ye,Ue).top==Ce},o<0==(z.level==1)?z.from:z.to-1,J),Q=="before"&&(J=us(r,J,1))}else J=o<0?z.to:z.from;return new ct(n,J,Q)}}return new ct(n,o<0?r.text.length:0,o<0?"before":"after")}function kl(e,t,r,n){var o=pt(t,e.doc.direction);if(!o)return ds(t,r,n);r.ch>=t.text.length?(r.ch=t.text.length,r.sticky="before"):r.ch<=0&&(r.ch=0,r.sticky="after");var M=qe(o,r.ch,r.sticky),z=o[M];if(e.doc.direction=="ltr"&&z.level%2==0&&(n>0?z.to>r.ch:z.from<r.ch))return ds(t,r,n);var V=function(wt,kt){return us(t,wt instanceof ct?wt.ch:wt,kt)},Q,J=function(wt){return e.options.lineWrapping?(Q=Q||xe(e,t),zt(e,t,Q,wt)):{begin:0,end:t.text.length}},ye=J(r.sticky=="before"?V(r,-1):r.ch);if(e.doc.direction=="rtl"||z.level==1){var Ce=z.level==1==n<0,Ue=V(r,Ce?1:-1);if(Ue!=null&&(Ce?Ue<=z.to&&Ue<=ye.end:Ue>=z.from&&Ue>=ye.begin)){var Me=Ce?"before":"after";return new ct(r.line,Ue,Me)}}var nt=function(wt,kt,Dt){for(var Kt=function(Ar,ua){return ua?new ct(r.line,V(Ar,1),"before"):new ct(r.line,Ar,"after")};wt>=0&&wt<o.length;wt+=kt){var sn=o[wt],tn=kt>0==(sn.level!=1),Fn=tn?Dt.begin:V(Dt.end,-1);if(sn.from<=Fn&&Fn<sn.to)return Kt(Fn,tn);if(Fn=tn?sn.from:V(sn.to,-1),Dt.begin<=Fn&&Fn<Dt.end)return Kt(Fn,tn)}},dt=nt(M+n,n,ye);if(dt)return dt;var xt=n>0?ye.end:V(ye.begin,-1);return xt!=null&&!(n>0&&xt==t.text.length)&&(dt=nt(n>0?0:o.length-1,n,J(xt)),dt)?dt:null}var Wo={selectAll:Rs,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),de)},killLine:function(e){return _o(e,function(t){if(t.empty()){var r=Ut(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line<e.lastLine()?{from:t.head,to:ct(t.head.line+1,0)}:{from:t.head,to:ct(t.head.line,r)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return _o(e,function(t){return{from:ct(t.from().line,0),to:ln(e.doc,ct(t.to().line+1,0))}})},delLineLeft:function(e){return _o(e,function(t){return{from:ct(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return _o(e,function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:r},"div");return{from:n,to:t.from()}})},delWrappedLineRight:function(e){return _o(e,function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div");return{from:t.from(),to:n}})},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 Qs(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return Ys(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Il(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div")},ae)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:r},"div")},ae)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:r},"div");return n.ch<e.getLine(n.line).search(/\S/)?Ys(e,t.head):n},ae)},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=[],r=e.listSelections(),n=e.options.tabSize,o=0;o<r.length;o++){var M=r[o].from(),z=H(e.getLine(M.line),M.ch,n);t.push(ie(n-z%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return pa(e,function(){for(var t=e.listSelections(),r=[],n=0;n<t.length;n++){if(!t[n].empty())continue;var o=t[n].head,M=Ut(e.doc,o.line).text;if(M){if(o.ch==M.length&&(o=new ct(o.line,o.ch-1)),o.ch>0)o=new ct(o.line,o.ch+1),e.replaceRange(M.charAt(o.ch-1)+M.charAt(o.ch-2),ct(o.line,o.ch-2),o,"+transpose");else if(o.line>e.doc.first){var z=Ut(e.doc,o.line-1).text;z&&(o=new ct(o.line,1),e.replaceRange(M.charAt(0)+e.doc.lineSeparator()+z.charAt(z.length-1),ct(o.line-1,z.length-1),o,"+transpose"))}}r.push(new tt(o,o))}e.setSelections(r)})},newlineAndIndent:function(e){return pa(e,function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange(e.doc.lineSeparator(),t[r].anchor,t[r].head,"+input");t=e.listSelections();for(var n=0;n<t.length;n++)e.indentLine(t[n].from().line,null,!0);li(e)})},openLine:function(e){return e.replaceSelection(`
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Qs(e,t){var r=Ut(e.doc,t),n=Gt(r);return n!=r&&(t=Kn(n)),cs(!0,e,n,t,1)}function Il(e,t){var r=Ut(e.doc,t),n=Xr(r);return n!=r&&(t=Kn(n)),cs(!0,e,r,t,-1)}function Ys(e,t){var r=Qs(e,t.line),n=Ut(e.doc,r.line),o=pt(n,e.doc.direction);if(!o||o[0].level==0){var M=Math.max(r.ch,n.text.search(/\S/)),z=t.line==r.line&&t.ch<=M&&t.ch;return ct(r.line,z?0:M,r.sticky)}return r}function ts(e,t,r){if(typeof t=="string"&&(t=Wo[t],!t))return!1;e.display.input.ensurePolled();var n=e.display.shift,o=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r&&(e.display.shift=!1),o=t(e)!=he}finally{e.display.shift=n,e.state.suppressEdits=!1}return o}function Nl(e,t,r){for(var n=0;n<e.state.keyMaps.length;n++){var o=Eo(t,e.state.keyMaps[n],r,e);if(o)return o}return e.options.extraKeys&&Eo(t,e.options.extraKeys,r,e)||Eo(t,e.options.keyMap,r,e)}var Ul=new X;function Ho(e,t,r,n){var o=e.state.keySeq;if(o){if(Gs(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Ul.set(50,function(){e.state.keySeq==o&&(e.state.keySeq=null,e.display.input.reset())}),$s(e,o+" "+t,r,n))return!0}return $s(e,t,r,n)}function $s(e,t,r,n){var o=Nl(e,t,n);return o=="multi"&&(e.state.keySeq=t),o=="handled"&&Jn(e,"keyHandled",e,t,r),(o=="handled"||o=="multi")&&(te(r),$r(e)),!!o}function Zs(e,t){var r=Xs(t,!0);return r?t.shiftKey&&!e.state.keySeq?Ho(e,"Shift-"+r,t,function(n){return ts(e,n,!0)})||Ho(e,r,t,function(n){if(typeof n=="string"?/^go[A-Z]/.test(n):n.motion)return ts(e,n)}):Ho(e,r,t,function(n){return ts(e,n)}):!1}function jl(e,t,r){return Ho(e,"'"+r+"'",t,function(n){return ts(e,n,!0)})}var fs=null;function Js(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=D(),rt(t,e))return;U&&I<11&&e.keyCode==27&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=r==16||e.shiftKey;var n=Zs(t,e);g&&(fs=n?r:null,!n&&r==88&&!mn&&(c?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),R&&!c&&!n&&r==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),r==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Bl(t)}function Bl(e){var t=e.display.lineDiv;B(t,"CodeMirror-crosshair");function r(n){(n.keyCode==18||!n.altKey)&&(u(t,"CodeMirror-crosshair"),yt(document,"keyup",r),yt(document,"mouseover",r))}Be(document,"keyup",r),Be(document,"mouseover",r)}function qs(e){e.keyCode==16&&(this.doc.sel.shift=!1),rt(this,e)}function el(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(ba(t.display,e)||rt(t,e)||e.ctrlKey&&!e.altKey||c&&e.metaKey)return;var r=e.keyCode,n=e.charCode;if(g&&r==fs){fs=null,te(e);return}if(g&&(!e.which||e.which<10)&&Zs(t,e))return;var o=String.fromCharCode(n==null?r:n);if(o=="\b")return;if(jl(t,e,o))return;t.display.input.onKeyPress(e)}var Fl=400,hs=function(e,t,r){this.time=e,this.pos=t,this.button=r};hs.prototype.compare=function(e,t,r){return this.time+Fl>e&&rn(t,this.pos)==0&&r==this.button};var zo,Go;function Kl(e,t){var r=+new Date;return Go&&Go.compare(r,e,t)?(zo=Go=null,"triple"):zo&&zo.compare(r,e,t)?(Go=new hs(r,e,t),zo=null,"double"):(zo=new hs(r,e,t),Go=null,"single")}function tl(e){var t=this,r=t.display;if(rt(t,e)||r.activeTouch&&r.input.supportsTouch())return;if(r.input.ensurePolled(),r.shift=e.shiftKey,ba(r,e)){T||(r.scroller.draggable=!1,setTimeout(function(){return r.scroller.draggable=!0},100));return}if(ms(t,e))return;var n=Gr(t,e),o=Xe(e),M=n?Kl(n,o):"single";if(window.focus(),o==1&&t.state.selectingText&&t.state.selectingText(e),n&&Wl(t,o,n,M,e))return;o==1?n?zl(t,n,M,e):je(e)==r.scroller&&te(e):o==2?(n&&Yo(t.doc,n),setTimeout(function(){return r.input.focus()},20)):o==3&&(A?t.display.input.onContextMenu(e):$i(t))}function Wl(e,t,r,n,o){var M="Click";return n=="double"?M="Double"+M:n=="triple"&&(M="Triple"+M),M=(t==1?"Left":t==2?"Middle":"Right")+M,Ho(e,Vs(M,o),o,function(z){if(typeof z=="string"&&(z=Wo[z]),!z)return!1;var V=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),V=z(e,r)!=he}finally{e.state.suppressEdits=!1}return V})}function Hl(e,t,r){var n=e.getOption("configureMouse"),o=n?n(e,t,r):{};if(o.unit==null){var M=d?r.shiftKey&&r.metaKey:r.altKey;o.unit=M?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(o.extend==null||e.doc.extend)&&(o.extend=e.doc.extend||r.shiftKey),o.addNew==null&&(o.addNew=c?r.metaKey:r.ctrlKey),o.moveOnDrag==null&&(o.moveOnDrag=!(c?r.altKey:r.ctrlKey)),o}function zl(e,t,r,n){U?setTimeout(h(Oo,e),0):e.curOp.focus=D();var o=Hl(e,r,n),M=e.doc.sel,z;e.options.dragDrop&&Ze&&!e.isReadOnly()&&r=="single"&&(z=M.contains(t))>-1&&(rn((z=M.ranges[z]).from(),t)<0||t.xRel>0)&&(rn(z.to(),t)>0||t.xRel<0)?Gl(e,n,t,o):Vl(e,n,t,o)}function Gl(e,t,r,n){var o=e.display,M=!1,z=Fr(e,function(J){T&&(o.scroller.draggable=!1),e.state.draggingText=!1,yt(o.wrapper.ownerDocument,"mouseup",z),yt(o.wrapper.ownerDocument,"mousemove",V),yt(o.scroller,"dragstart",Q),yt(o.scroller,"drop",z),M||(te(J),n.addNew||Yo(e.doc,r,null,null,n.extend),T&&!k||U&&I==9?setTimeout(function(){o.wrapper.ownerDocument.body.focus({preventScroll:!0}),o.input.focus()},20):o.input.focus())}),V=function(J){M=M||Math.abs(t.clientX-J.clientX)+Math.abs(t.clientY-J.clientY)>=10},Q=function(){return M=!0};T&&(o.scroller.draggable=!0),e.state.draggingText=z,z.copy=!n.moveOnDrag,o.scroller.dragDrop&&o.scroller.dragDrop(),Be(o.wrapper.ownerDocument,"mouseup",z),Be(o.wrapper.ownerDocument,"mousemove",V),Be(o.scroller,"dragstart",Q),Be(o.scroller,"drop",z),$i(e),setTimeout(function(){return o.input.focus()},20)}function nl(e,t,r){if(r=="char")return new tt(t,t);if(r=="word")return e.findWordAt(t);if(r=="line")return new tt(ct(t.line,0),ln(e.doc,ct(t.line+1,0)));var n=r(e,t);return new tt(n.from,n.to)}function Vl(e,t,r,n){var o=e.display,M=e.doc;te(t);var z,V,Q=M.sel,J=Q.ranges;if(n.addNew&&!n.extend?(V=M.sel.contains(r),V>-1?z=J[V]:z=new tt(r,r)):(z=M.sel.primary(),V=M.sel.primIndex),n.unit=="rectangle")n.addNew||(z=new tt(r,r)),r=Gr(e,t,!0,!0),V=-1;else{var ye=nl(e,r,n.unit);n.extend?z=ss(z,ye.anchor,ye.head,n.extend):z=ye}n.addNew?V==-1?(V=J.length,Ca(M,Et(e,J.concat([z]),V),{scroll:!1,origin:"*mouse"})):J.length>1&&J[V].empty()&&n.unit=="char"&&!n.extend?(Ca(M,Et(e,J.slice(0,V).concat(J.slice(V+1)),0),{scroll:!1,origin:"*mouse"}),Q=M.sel):ls(M,V,z,ne):(V=0,Ca(M,new it([z],0),ne),Q=M.sel);var Ce=r;function Ue(Dt){if(rn(Ce,Dt)==0)return;if(Ce=Dt,n.unit=="rectangle"){for(var Kt=[],sn=e.options.tabSize,tn=H(Ut(M,r.line).text,r.ch,sn),Fn=H(Ut(M,Dt.line).text,Dt.ch,sn),Ar=Math.min(tn,Fn),ua=Math.max(tn,Fn),Wr=Math.min(r.line,Dt.line),Wa=Math.min(e.lastLine(),Math.max(r.line,Dt.line));Wr<=Wa;Wr++){var ka=Ut(M,Wr).text,ta=le(ka,Ar,sn);Ar==ua?Kt.push(new tt(ct(Wr,ta),ct(Wr,ta))):ka.length>ta&&Kt.push(new tt(ct(Wr,ta),ct(Wr,le(ka,ua,sn))))}Kt.length||Kt.push(new tt(r,r)),Ca(M,Et(e,Q.ranges.slice(0,V).concat(Kt),V),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Dt)}else{var Ia=z,ya=nl(e,Dt,n.unit),ia=Ia.anchor,na;rn(ya.anchor,ia)>0?(na=ya.head,ia=Ja(Ia.from(),ya.anchor)):(na=ya.anchor,ia=ai(Ia.to(),ya.head));var Vr=Q.ranges.slice(0);Vr[V]=Xl(e,new tt(ln(M,ia),na)),Ca(M,Et(e,Vr,V),ne)}}var Me=o.wrapper.getBoundingClientRect(),nt=0;function dt(Dt){var Kt=++nt,sn=Gr(e,Dt,!0,n.unit=="rectangle");if(!sn)return;if(rn(sn,Ce)!=0){e.curOp.focus=D(),Ue(sn);var tn=ji(o,M);(sn.line>=tn.to||sn.line<tn.from)&&setTimeout(Fr(e,function(){nt==Kt&&dt(Dt)}),150)}else{var Fn=Dt.clientY<Me.top?-20:Dt.clientY>Me.bottom?20:0;Fn&&setTimeout(Fr(e,function(){if(nt!=Kt)return;o.scroller.scrollTop+=Fn,dt(Dt)}),50)}}function xt(Dt){e.state.selectingText=!1,nt=Infinity,Dt&&(te(Dt),o.input.focus()),yt(o.wrapper.ownerDocument,"mousemove",wt),yt(o.wrapper.ownerDocument,"mouseup",kt),M.history.lastSelOrigin=null}var wt=Fr(e,function(Dt){Dt.buttons===0||!Xe(Dt)?xt(Dt):dt(Dt)}),kt=Fr(e,xt);e.state.selectingText=kt,Be(o.wrapper.ownerDocument,"mousemove",wt),Be(o.wrapper.ownerDocument,"mouseup",kt)}function Xl(e,t){var r=t.anchor,n=t.head,o=Ut(e.doc,r.line);if(rn(r,n)==0&&r.sticky==n.sticky)return t;var M=pt(o);if(!M)return t;var z=qe(M,r.ch,r.sticky),V=M[z];if(V.from!=r.ch&&V.to!=r.ch)return t;var Q=z+(V.from==r.ch==(V.level!=1)?0:1);if(Q==0||Q==M.length)return t;var J;if(n.line!=r.line)J=(n.line-r.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var ye=qe(M,n.ch,n.sticky),Ce=ye-z||(n.ch-r.ch)*(V.level==1?-1:1);ye==Q-1||ye==Q?J=Ce<0:J=Ce>0}var Ue=M[Q+(J?-1:0)],Me=J==(Ue.level==1),nt=Me?Ue.from:Ue.to,dt=Me?"after":"before";return r.ch==nt&&r.sticky==dt?t:new tt(new ct(r.line,nt,dt),n)}function rl(e,t,r,n){var o,M;if(t.touches)o=t.touches[0].clientX,M=t.touches[0].clientY;else try{o=t.clientX,M=t.clientY}catch(Ue){return!1}if(o>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&te(t);var z=e.display,V=z.lineDiv.getBoundingClientRect();if(M>V.bottom||!se(e,r))return ce(t);M-=V.top-z.viewOffset;for(var Q=0;Q<e.display.gutterSpecs.length;++Q){var J=z.gutters.childNodes[Q];if(J&&J.getBoundingClientRect().right>=o){var ye=ja(e.doc,M),Ce=e.display.gutterSpecs[Q];return He(e,r,e,ye,Ce.className,t),ce(t)}}}function ms(e,t){return rl(e,t,"gutterClick",!0)}function al(e,t){if(ba(e.display,t)||Ql(e,t))return;if(rt(e,t,"contextmenu"))return;A||e.display.input.onContextMenu(t)}function Ql(e,t){return se(e,"gutterContextMenu")?rl(e,t,"gutterContextMenu",!1):!1}function il(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),_n(e)}var xo={toString:function(){return"CodeMirror.Init"}},ol={},ns={};function Yl(e){var t=e.optionHandlers;function r(n,o,M,z){e.defaults[n]=o,M&&(t[n]=z?function(V,Q,J){J!=xo&&M(V,Q,J)}:M)}e.defineOption=r,e.Init=xo,r("value","",function(n,o){return n.setValue(o)},!0),r("mode",null,function(n,o){n.doc.modeOption=o,Mr(n)},!0),r("indentUnit",2,Mr,!0),r("indentWithTabs",!1),r("smartIndent",!0),r("tabSize",4,function(n){Zr(n),_n(n),Yn(n)},!0),r("lineSeparator",null,function(n,o){if(n.doc.lineSep=o,!o)return;var M=[],z=n.doc.first;n.doc.iter(function(Q){for(var J=0;;){var ye=Q.text.indexOf(o,J);if(ye==-1)break;J=ye+o.length,M.push(ct(z,ye))}z++});for(var V=M.length-1;V>=0;V--)yo(n.doc,o,M[V],ct(M[V].line,M[V].ch+o.length))}),r("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(n,o,M){n.state.specialChars=new RegExp(o.source+(o.test(" ")?"":"| "),"g"),M!=xo&&n.refresh()}),r("specialCharPlaceholder",Mt,function(n){return n.refresh()},!0),r("electricChars",!0),r("inputStyle",s?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),r("spellcheck",!1,function(n,o){return n.getInputField().spellcheck=o},!0),r("autocorrect",!1,function(n,o){return n.getInputField().autocorrect=o},!0),r("autocapitalize",!1,function(n,o){return n.getInputField().autocapitalize=o},!0),r("rtlMoveVisually",!S),r("wholeLineUpdateBefore",!0),r("theme","default",function(n){il(n),Qa(n)},!0),r("keyMap","default",function(n,o,M){var z=es(o),V=M!=xo&&es(M);V&&V.detach&&V.detach(n,z),z.attach&&z.attach(n,V||null)}),r("extraKeys",null),r("configureMouse",null),r("lineWrapping",!1,Zl,!0),r("gutters",[],function(n,o){n.display.gutterSpecs=va(o,n.options.lineNumbers),Qa(n)},!0),r("fixedGutter",!0,function(n,o){n.display.gutters.style.left=o?sa(n.display)+"px":"0",n.refresh()},!0),r("coverGutterNextToScrollbar",!1,function(n){return ci(n)},!0),r("scrollbarStyle","native",function(n){Oi(n),ci(n),n.display.scrollbars.setScrollTop(n.doc.scrollTop),n.display.scrollbars.setScrollLeft(n.doc.scrollLeft)},!0),r("lineNumbers",!1,function(n,o){n.display.gutterSpecs=va(n.options.gutters,o),Qa(n)},!0),r("firstLineNumber",1,Qa,!0),r("lineNumberFormatter",function(n){return n},Qa,!0),r("showCursorWhenSelecting",!1,sr,!0),r("resetSelectionOnContextMenu",!0),r("lineWiseCopyCut",!0),r("pasteLinesPerSelection",!0),r("selectionsMayTouch",!1),r("readOnly",!1,function(n,o){o=="nocursor"&&(_a(n),n.display.input.blur()),n.display.input.readOnlyChanged(o)}),r("screenReaderLabel",null,function(n,o){o=o===""?null:o,n.display.input.screenReaderLabelChanged(o)}),r("disableInput",!1,function(n,o){o||n.display.input.reset()},!0),r("dragDrop",!0,$l),r("allowDropFileTypes",null),r("cursorBlinkRate",530),r("cursorScrollMargin",0),r("cursorHeight",1,sr,!0),r("singleCursorHeightPerLine",!0,sr,!0),r("workTime",100),r("workDelay",100),r("flattenSpans",!0,Zr,!0),r("addModeClass",!1,Zr,!0),r("pollInterval",100),r("undoDepth",200,function(n,o){return n.doc.history.undoDepth=o}),r("historyEventDelay",1250),r("viewportMargin",10,function(n){return n.refresh()},!0),r("maxHighlightLength",1e4,Zr,!0),r("moveInputWithCursor",!0,function(n,o){o||n.display.input.resetPosition()}),r("tabindex",null,function(n,o){return n.display.input.getField().tabIndex=o||""}),r("autofocus",null),r("direction","ltr",function(n,o){return n.doc.setDirection(o)},!0),r("phrases",null)}function $l(e,t,r){var n=r&&r!=xo;if(!t!=!n){var o=e.display.dragFunctions,M=t?Be:yt;M(e.display.scroller,"dragstart",o.start),M(e.display.scroller,"dragenter",o.enter),M(e.display.scroller,"dragover",o.over),M(e.display.scroller,"dragleave",o.leave),M(e.display.scroller,"drop",o.drop)}}function Zl(e){e.options.lineWrapping?(B(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(u(e.display.wrapper,"CodeMirror-wrap"),yr(e)),ma(e),Yn(e),_n(e),setTimeout(function(){return ci(e)},100)}function Br(e,t){var r=this;if(!(this instanceof Br))return new Br(e,t);this.options=t=t?N(t):{},N(ol,t,!1);var n=t.value;typeof n=="string"?n=new La(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var o=new Br.inputStyles[t.inputStyle](this),M=this.display=new Di(e,n,o,t);M.wrapper.CodeMirror=this,il(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Oi(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 X,keySeq:null,specialChars:null},t.autofocus&&!s&&M.input.focus(),U&&I<11&&setTimeout(function(){return r.display.input.reset(!0)},20),Jl(this),Dl(),Va(this),this.curOp.forceUpdate=!0,Ka(this,n),t.autofocus&&!s||this.hasFocus()?setTimeout(function(){r.hasFocus()&&!r.state.focused&&Dr(r)},20):_a(this);for(var z in ns)ns.hasOwnProperty(z)&&ns[z](this,t[z],xo);Kr(this),t.finishInit&&t.finishInit(this);for(var V=0;V<ps.length;++V)ps[V](this);Xa(this),T&&t.lineWrapping&&getComputedStyle(M.lineDiv).textRendering=="optimizelegibility"&&(M.lineDiv.style.textRendering="auto")}Br.defaults=ol,Br.optionHandlers=ns;function Jl(e){var t=e.display;Be(t.scroller,"mousedown",Fr(e,tl)),U&&I<11?Be(t.scroller,"dblclick",Fr(e,function(Q){if(rt(e,Q))return;var J=Gr(e,Q);if(!J||ms(e,Q)||ba(e.display,Q))return;te(Q);var ye=e.findWordAt(J);Yo(e.doc,ye.anchor,ye.head)})):Be(t.scroller,"dblclick",function(Q){return rt(e,Q)||te(Q)}),Be(t.scroller,"contextmenu",function(Q){return al(e,Q)}),Be(t.input.getField(),"contextmenu",function(Q){t.scroller.contains(Q.target)||al(e,Q)});var r,n={end:0};function o(){t.activeTouch&&(r=setTimeout(function(){return t.activeTouch=null},1e3),n=t.activeTouch,n.end=+new Date)}function M(Q){if(Q.touches.length!=1)return!1;var J=Q.touches[0];return J.radiusX<=1&&J.radiusY<=1}function z(Q,J){if(J.left==null)return!0;var ye=J.left-Q.left,Ce=J.top-Q.top;return ye*ye+Ce*Ce>20*20}Be(t.scroller,"touchstart",function(Q){if(!rt(e,Q)&&!M(Q)&&!ms(e,Q)){t.input.ensurePolled(),clearTimeout(r);var J=+new Date;t.activeTouch={start:J,moved:!1,prev:J-n.end<=300?n:null},Q.touches.length==1&&(t.activeTouch.left=Q.touches[0].pageX,t.activeTouch.top=Q.touches[0].pageY)}}),Be(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Be(t.scroller,"touchend",function(Q){var J=t.activeTouch;if(J&&!ba(t,Q)&&J.left!=null&&!J.moved&&new Date-J.start<300){var ye=e.coordsChar(t.activeTouch,"page"),Ce;!J.prev||z(J,J.prev)?Ce=new tt(ye,ye):!J.prev.prev||z(J,J.prev.prev)?Ce=e.findWordAt(ye):Ce=new tt(ct(ye.line,0),ln(e.doc,ct(ye.line+1,0))),e.setSelection(Ce.anchor,Ce.head),e.focus(),te(Q)}o()}),Be(t.scroller,"touchcancel",o),Be(t.scroller,"scroll",function(){t.scroller.clientHeight&&(ui(e,t.scroller.scrollTop),Ma(e,t.scroller.scrollLeft,!0),He(e,"scroll",e))}),Be(t.scroller,"mousewheel",function(Q){return et(e,Q)}),Be(t.scroller,"DOMMouseScroll",function(Q){return et(e,Q)}),Be(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(Q){rt(e,Q)||_e(Q)},over:function(Q){rt(e,Q)||(wl(e,Q),_e(Q))},start:function(Q){return Ol(e,Q)},drop:Fr(e,Sl),leave:function(Q){rt(e,Q)||Ws(e)}};var V=t.input.getField();Be(V,"keyup",function(Q){return qs.call(e,Q)}),Be(V,"keydown",Fr(e,Js)),Be(V,"keypress",Fr(e,el)),Be(V,"focus",function(Q){return Dr(e,Q)}),Be(V,"blur",function(Q){return _a(e,Q)})}var ps=[];Br.defineInitHook=function(e){return ps.push(e)};function Vo(e,t,r,n){var o=e.doc,M;r==null&&(r="add"),r=="smart"&&(o.mode.indent?M=bt(e,t).state:r="prev");var z=e.options.tabSize,V=Ut(o,t),Q=H(V.text,null,z);V.stateAfter&&(V.stateAfter=null);var J=V.text.match(/^\s*/)[0],ye;if(!n&&!/\S/.test(V.text))ye=0,r="not";else if(r=="smart"&&(ye=o.mode.indent(M,V.text.slice(J.length),V.text),ye==he||ye>150)){if(!n)return;r="prev"}r=="prev"?t>o.first?ye=H(Ut(o,t-1).text,null,z):ye=0:r=="add"?ye=Q+e.options.indentUnit:r=="subtract"?ye=Q-e.options.indentUnit:typeof r=="number"&&(ye=Q+r),ye=Math.max(0,ye);var Ce="",Ue=0;if(e.options.indentWithTabs)for(var Me=Math.floor(ye/z);Me;--Me)Ue+=z,Ce+=" ";if(Ue<ye&&(Ce+=ie(ye-Ue)),Ce!=J)return yo(o,Ce,ct(t,0),ct(t,J.length),"+input"),V.stateAfter=null,!0;for(var nt=0;nt<o.sel.ranges.length;nt++){var dt=o.sel.ranges[nt];if(dt.head.line==t&&dt.head.ch<J.length){var xt=ct(t,J.length);ls(o,nt,new tt(xt,xt));break}}}var mi=null;function rs(e){mi=e}function vs(e,t,r,n,o){var M=e.doc;e.display.shift=!1,n||(n=M.sel);var z=+new Date-200,V=o=="paste"||e.state.pasteIncoming>z,Q=Bt(t),J=null;if(V&&n.ranges.length>1)if(mi&&mi.text.join(`
`)==t){if(n.ranges.length%mi.text.length==0){J=[];for(var ye=0;ye<mi.text.length;ye++)J.push(M.splitLines(mi.text[ye]))}}else Q.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(J=Pe(Q,function(wt){return[wt]}));for(var Ce=e.curOp.updateInput,Ue=n.ranges.length-1;Ue>=0;Ue--){var Me=n.ranges[Ue],nt=Me.from(),dt=Me.to();Me.empty()&&(r&&r>0?nt=ct(nt.line,nt.ch-r):e.state.overwrite&&!V?dt=ct(dt.line,Math.min(Ut(M,dt.line).text.length,dt.ch+ve(Q).length)):V&&mi&&mi.lineWise&&mi.text.join(`
`)==Q.join(`
`)&&(nt=dt=ct(nt.line,0)));var xt={from:nt,to:dt,text:J?J[Ue%J.length]:Q,origin:o||(V?"paste":e.state.cutIncoming>z?"cut":"+input")};go(e.doc,xt),Jn(e,"inputRead",e,xt)}t&&!V&&ll(e,t),li(e),e.curOp.updateInput<2&&(e.curOp.updateInput=Ce),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function sl(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&pa(t,function(){return vs(t,r,0,null,"paste")}),!0}function ll(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var r=e.doc.sel,n=r.ranges.length-1;n>=0;n--){var o=r.ranges[n];if(o.head.ch>100||n&&r.ranges[n-1].head.line==o.head.line)continue;var M=e.getModeAt(o.head),z=!1;if(M.electricChars){for(var V=0;V<M.electricChars.length;V++)if(t.indexOf(M.electricChars.charAt(V))>-1){z=Vo(e,o.head.line,"smart");break}}else M.electricInput&&(M.electricInput.test(Ut(e.doc,o.head.line).text.slice(0,o.head.ch))&&(z=Vo(e,o.head.line,"smart")));z&&Jn(e,"electricInput",e,o.head.line)}}function ul(e){for(var t=[],r=[],n=0;n<e.doc.sel.ranges.length;n++){var o=e.doc.sel.ranges[n].head.line,M={anchor:ct(o,0),head:ct(o+1,0)};r.push(M),t.push(e.getRange(M.anchor,M.head))}return{text:t,ranges:r}}function dl(e,t,r,n){e.setAttribute("autocorrect",r?"":"off"),e.setAttribute("autocapitalize",n?"":"off"),e.setAttribute("spellcheck",!!t)}function cl(){var e=i("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=i("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return T?e.style.width="1000px":e.setAttribute("wrap","off"),y&&(e.style.border="1px solid black"),dl(e),t}function ql(e){var t=e.optionHandlers,r=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(n,o){var M=this.options,z=M[n];if(M[n]==o&&n!="mode")return;M[n]=o,t.hasOwnProperty(n)&&Fr(this,t[n])(this,o,z),He(this,"optionChange",this,n)},getOption:function(n){return this.options[n]},getDoc:function(){return this.doc},addKeyMap:function(n,o){this.state.keyMaps[o?"push":"unshift"](es(n))},removeKeyMap:function(n){for(var o=this.state.keyMaps,M=0;M<o.length;++M)if(o[M]==n||o[M].name==n)return o.splice(M,1),!0},addOverlay:aa(function(n,o){var M=n.token?n:e.getMode(this.options,n);if(M.startState)throw new Error("Overlays may not be stateful.");Ie(this.state.overlays,{mode:M,modeSpec:n,opaque:o&&o.opaque,priority:o&&o.priority||0},function(z){return z.priority}),this.state.modeGen++,Yn(this)}),removeOverlay:aa(function(n){for(var o=this.state.overlays,M=0;M<o.length;++M){var z=o[M].modeSpec;if(z==n||typeof n=="string"&&z.name==n){o.splice(M,1),this.state.modeGen++,Yn(this);return}}}),indentLine:aa(function(n,o,M){typeof o!="string"&&typeof o!="number"&&(o==null?o=this.options.smartIndent?"smart":"prev":o=o?"add":"subtract"),ri(this.doc,n)&&Vo(this,n,o,M)}),indentSelection:aa(function(n){for(var o=this.doc.sel.ranges,M=-1,z=0;z<o.length;z++){var V=o[z];if(V.empty())V.head.line>M&&(Vo(this,V.head.line,n,!0),M=V.head.line,z==this.doc.sel.primIndex&&li(this));else{var Q=V.from(),J=V.to(),ye=Math.max(M,Q.line);M=Math.min(this.lastLine(),J.line-(J.ch?0:1))+1;for(var Ce=ye;Ce<M;++Ce)Vo(this,Ce,n);var Ue=this.doc.sel.ranges;Q.ch==0&&o.length==Ue.length&&Ue[z].from().ch>0&&ls(this.doc,z,new tt(Q,Ue[z].to()),de)}}}),getTokenAt:function(n,o){return lt(this,n,o)},getLineTokens:function(n,o){return lt(this,ct(n),o,!0)},getTokenTypeAt:function(n){n=ln(this.doc,n);var o=xi(this,Ut(this.doc,n.line)),M=0,z=(o.length-1)/2,V=n.ch,Q;if(V==0)Q=o[2];else for(;;){var J=M+z>>1;if((J?o[J*2-1]:0)>=V)z=J;else if(o[J*2+1]<V)M=J+1;else{Q=o[J*2+2];break}}var ye=Q?Q.indexOf("overlay "):-1;return ye<0?Q:ye==0?null:Q.slice(0,ye-1)},getModeAt:function(n){var o=this.doc.mode;return o.innerMode?e.innerMode(o,this.getTokenAt(n).state).mode:o},getHelper:function(n,o){return this.getHelpers(n,o)[0]},getHelpers:function(n,o){var M=[];if(!r.hasOwnProperty(o))return M;var z=r[o],V=this.getModeAt(n);if(typeof V[o]=="string")z[V[o]]&&M.push(z[V[o]]);else if(V[o])for(var Q=0;Q<V[o].length;Q++){var J=z[V[o][Q]];J&&M.push(J)}else V.helperType&&z[V.helperType]?M.push(z[V.helperType]):z[V.name]&&M.push(z[V.name]);for(var ye=0;ye<z._global.length;ye++){var Ce=z._global[ye];Ce.pred(V,this)&&Y(M,Ce.val)==-1&&M.push(Ce.val)}return M},getStateAfter:function(n,o){var M=this.doc;return n=_i(M,n==null?M.first+M.size-1:n),bt(this,n+1,o).state},cursorCoords:function(n,o){var M,z=this.doc.sel.primary();return n==null?M=z.head:typeof n=="object"?M=ln(this.doc,n):M=n?z.from():z.to(),kn(this,M,o||"page")},charCoords:function(n,o){return xr(this,ln(this.doc,n),o||"page")},coordsChar:function(n,o){return n=Ln(this,n,o||"page"),In(this,n.left,n.top)},lineAtHeight:function(n,o){return n=Ln(this,{top:n,left:0},o||"page").top,ja(this.doc,n+this.display.viewOffset)},heightAtLine:function(n,o,M){var z=!1,V;if(typeof n=="number"){var Q=this.doc.first+this.doc.size-1;n<this.doc.first?n=this.doc.first:n>Q&&(n=Q,z=!0),V=Ut(this.doc,n)}else V=n;return zn(this,V,{top:0,left:0},o||"page",M||z).top+(z?this.doc.height-vn(V):0)},defaultTextHeight:function(){return jr(this.display)},defaultCharWidth:function(){return Yr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(n,o,M,z,V){var Q=this.display;n=kn(this,ln(this.doc,n));var J=n.bottom,ye=n.left;if(o.style.position="absolute",o.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(o),Q.sizer.appendChild(o),z=="over")J=n.top;else if(z=="above"||z=="near"){var Ce=Math.max(Q.wrapper.clientHeight,this.doc.height),Ue=Math.max(Q.sizer.clientWidth,Q.lineSpace.clientWidth);(z=="above"||n.bottom+o.offsetHeight>Ce)&&n.top>o.offsetHeight?J=n.top-o.offsetHeight:n.bottom+o.offsetHeight<=Ce&&(J=n.bottom),ye+o.offsetWidth>Ue&&(ye=Ue-o.offsetWidth)}o.style.top=J+"px",o.style.left=o.style.right="",V=="right"?(ye=Q.sizer.clientWidth-o.offsetWidth,o.style.right="0px"):(V=="left"?ye=0:V=="middle"&&(ye=(Q.sizer.clientWidth-o.offsetWidth)/2),o.style.left=ye+"px"),M&&oo(this,{left:ye,top:J,right:ye+o.offsetWidth,bottom:J+o.offsetHeight})},triggerOnKeyDown:aa(Js),triggerOnKeyPress:aa(el),triggerOnKeyUp:qs,triggerOnMouseDown:aa(tl),execCommand:function(n){if(Wo.hasOwnProperty(n))return Wo[n].call(null,this)},triggerElectric:aa(function(n){ll(this,n)}),findPosH:function(n,o,M,z){var V=1;o<0&&(V=-1,o=-o);for(var Q=ln(this.doc,n),J=0;J<o&&!(Q=gs(this.doc,Q,V,M,z),Q.hitSide);++J);return Q},moveH:aa(function(n,o){var M=this;this.extendSelectionsBy(function(z){return M.display.shift||M.doc.extend||z.empty()?gs(M.doc,z.head,n,o,M.options.rtlMoveVisually):n<0?z.from():z.to()},ae)}),deleteH:aa(function(n,o){var M=this.doc.sel,z=this.doc;M.somethingSelected()?z.replaceSelection("",null,"+delete"):_o(this,function(V){var Q=gs(z,V.head,n,o,!1);return n<0?{from:Q,to:V.head}:{from:V.head,to:Q}})}),findPosV:function(n,o,M,z){var V=1,Q=z;o<0&&(V=-1,o=-o);for(var J=ln(this.doc,n),ye=0;ye<o;++ye){var Ce=kn(this,J,"div");if(Q==null?Q=Ce.left:Ce.left=Q,J=fl(this,Ce,V,M),J.hitSide)break}return J},moveV:aa(function(n,o){var M=this,z=this.doc,V=[],Q=!this.display.shift&&!z.extend&&z.sel.somethingSelected();if(z.extendSelectionsBy(function(ye){if(Q)return n<0?ye.from():ye.to();var Ce=kn(M,ye.head,"div");ye.goalColumn!=null&&(Ce.left=ye.goalColumn),V.push(Ce.left);var Ue=fl(M,Ce,n,o);return o=="page"&&ye==z.sel.primary()&&Ji(M,xr(M,Ue,"div").top-Ce.top),Ue},ae),V.length)for(var J=0;J<z.sel.ranges.length;J++)z.sel.ranges[J].goalColumn=V[J]}),findWordAt:function(n){var o=this.doc,M=Ut(o,n.line).text,z=n.ch,V=n.ch;if(M){var Q=this.getHelper(n,"wordChars");(n.sticky=="before"||V==M.length)&&z?--z:++V;for(var J=M.charAt(z),ye=Ve(J,Q)?function(Ce){return Ve(Ce,Q)}:/\s/.test(J)?function(Ce){return/\s/.test(Ce)}:function(Ce){return!/\s/.test(Ce)&&!Ve(Ce)};z>0&&ye(M.charAt(z-1));)--z;for(;V<M.length&&ye(M.charAt(V));)++V}return new tt(ct(n.line,z),ct(n.line,V))},toggleOverwrite:function(n){if(n!=null&&n==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?B(this.display.cursorDiv,"CodeMirror-overwrite"):u(this.display.cursorDiv,"CodeMirror-overwrite"),He(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==D()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:aa(function(n,o){vi(this,n,o)}),getScrollInfo:function(){var n=this.display.scroller;return{left:n.scrollLeft,top:n.scrollTop,height:n.scrollHeight-Oe(this)-this.display.barHeight,width:n.scrollWidth-Oe(this)-this.display.barWidth,clientHeight:Z(this),clientWidth:ge(this)}},scrollIntoView:aa(function(n,o){n==null?(n={from:this.doc.sel.primary().head,to:null},o==null&&(o=this.options.cursorScrollMargin)):typeof n=="number"?n={from:ct(n,0),to:null}:n.from==null&&(n={from:n,to:null}),n.to||(n.to=n.from),n.margin=o||0,n.from.line!=null?so(this,n):_r(this,n.from,n.to,n.margin)}),setSize:aa(function(n,o){var M=this,z=function(Q){return typeof Q=="number"||/^\d+$/.test(String(Q))?Q+"px":Q};n!=null&&(this.display.wrapper.style.width=z(n)),o!=null&&(this.display.wrapper.style.height=z(o)),this.options.lineWrapping&&gn(this);var V=this.display.viewFrom;this.doc.iter(V,this.display.viewTo,function(Q){if(Q.widgets){for(var J=0;J<Q.widgets.length;J++)if(Q.widgets[J].noHScroll){wr(M,V,"widget");break}}++V}),this.curOp.forceUpdate=!0,He(this,"refresh",this)}),operation:function(n){return pa(this,n)},startOperation:function(){return Va(this)},endOperation:function(){return Xa(this)},refresh:aa(function(){var n=this.display.cachedTextHeight;Yn(this),this.curOp.forceUpdate=!0,_n(this),vi(this,this.doc.scrollLeft,this.doc.scrollTop),Hi(this.display),(n==null||Math.abs(n-jr(this.display))>.5||this.options.lineWrapping)&&ma(this),He(this,"refresh",this)}),swapDoc:aa(function(n){var o=this.doc;return o.cm=null,this.state.selectingText&&this.state.selectingText(),Ka(this,n),_n(this),this.display.input.reset(),vi(this,n.scrollLeft,n.scrollTop),this.curOp.forceScroll=!0,Jn(this,"swapDoc",this,o),o}),phrase:function(n){var o=this.options.phrases;return o&&Object.prototype.hasOwnProperty.call(o,n)?o[n]:n},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}},be(e),e.registerHelper=function(n,o,M){r.hasOwnProperty(n)||(r[n]=e[n]={_global:[]}),r[n][o]=M},e.registerGlobalHelper=function(n,o,M,z){e.registerHelper(n,o,z),r[n]._global.push({pred:M,val:z})}}function gs(e,t,r,n,o){var M=t,z=r,V=Ut(e,t.line),Q=o&&e.direction=="rtl"?-r:r;function J(){var kt=t.line+Q;return kt<e.first||kt>=e.first+e.size?!1:(t=new ct(kt,t.ch,t.sticky),V=Ut(e,kt))}function ye(kt){var Dt;if(n=="codepoint"){var Kt=V.text.charCodeAt(t.ch+(n>0?0:-1));isNaN(Kt)?Dt=null:Dt=new ct(t.line,Math.max(0,Math.min(V.text.length,t.ch+r*(Kt>=55296&&Kt<56320?2:1))),-r)}else o?Dt=kl(e.cm,V,t,r):Dt=ds(V,t,r);if(Dt==null)if(!kt&&J())t=cs(o,e.cm,V,t.line,Q);else return!1;else t=Dt;return!0}if(n=="char"||n=="codepoint")ye();else if(n=="column")ye(!0);else if(n=="word"||n=="group")for(var Ce=null,Ue=n=="group",Me=e.cm&&e.cm.getHelper(t,"wordChars"),nt=!0;!(r<0&&!ye(!nt));nt=!1){var dt=V.text.charAt(t.ch)||`
`,xt=Ve(dt,Me)?"w":Ue&&dt==`
`?"n":!Ue||/\s/.test(dt)?null:"p";if(Ue&&!nt&&!xt&&(xt="s"),Ce&&Ce!=xt){r<0&&(r=1,ye(),t.sticky="after");break}if(xt&&(Ce=xt),r>0&&!ye(!nt))break}var wt=Zo(e,t,M,z,!0);return Ha(M,wt)&&(wt.hitSide=!0),wt}function fl(e,t,r,n){var o=e.doc,M=t.left,z;if(n=="page"){var V=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),Q=Math.max(V-.5*jr(e.display),3);z=(r>0?t.bottom:t.top)+r*Q}else n=="line"&&(z=r>0?t.bottom+3:t.top-3);for(var J;!(J=In(e,M,z),!J.outside);){if(r<0?z<=0:z>=o.height){J.hitSide=!0;break}z+=r*5}return J}var pr=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new X,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};pr.prototype.init=function(e){var t=this,r=this,n=r.cm,o=r.div=e.lineDiv;dl(o,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize);function M(V){for(var Q=V.target;Q;Q=Q.parentNode){if(Q==o)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(Q.className))break}return!1}Be(o,"paste",function(V){if(!M(V)||rt(n,V)||sl(V,n))return;I<=11&&setTimeout(Fr(n,function(){return t.updateFromDOM()}),20)}),Be(o,"compositionstart",function(V){t.composing={data:V.data,done:!1}}),Be(o,"compositionupdate",function(V){t.composing||(t.composing={data:V.data,done:!1})}),Be(o,"compositionend",function(V){t.composing&&(V.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Be(o,"touchstart",function(){return r.forceCompositionEnd()}),Be(o,"input",function(){t.composing||t.readFromDOMSoon()});function z(V){if(!M(V)||rt(n,V))return;if(n.somethingSelected())rs({lineWise:!1,text:n.getSelections()}),V.type=="cut"&&n.replaceSelection("",null,"cut");else if(n.options.lineWiseCopyCut){var Q=ul(n);rs({lineWise:!0,text:Q.text}),V.type=="cut"&&n.operation(function(){n.setSelections(Q.ranges,0,de),n.replaceSelection("",null,"cut")})}else return;if(V.clipboardData){V.clipboardData.clearData();var J=mi.text.join(`
`);if(V.clipboardData.setData("Text",J),V.clipboardData.getData("Text")==J){V.preventDefault();return}}var ye=cl(),Ce=ye.firstChild;n.display.lineSpace.insertBefore(ye,n.display.lineSpace.firstChild),Ce.value=mi.text.join(`
`);var Ue=document.activeElement;W(Ce),setTimeout(function(){n.display.lineSpace.removeChild(ye),Ue.focus(),Ue==o&&r.showPrimarySelection()},50)}Be(o,"copy",z),Be(o,"cut",z)},pr.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},pr.prototype.prepareSelection=function(){var e=Fa(this.cm,!1);return e.focus=document.activeElement==this.div,e},pr.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},pr.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},pr.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,r=t.doc.sel.primary(),n=r.from(),o=r.to();if(t.display.viewTo==t.display.viewFrom||n.line>=t.display.viewTo||o.line<t.display.viewFrom){e.removeAllRanges();return}var M=as(t,e.anchorNode,e.anchorOffset),z=as(t,e.focusNode,e.focusOffset);if(M&&!M.bad&&z&&!z.bad&&rn(Ja(M,z),n)==0&&rn(ai(M,z),o)==0)return;var V=t.display.view,Q=n.line>=t.display.viewFrom&&hl(t,n)||{node:V[0].measure.map[2],offset:0},J=o.line<t.display.viewTo&&hl(t,o);if(!J){var ye=V[V.length-1].measure,Ce=ye.maps?ye.maps[ye.maps.length-1]:ye.map;J={node:Ce[Ce.length-1],offset:Ce[Ce.length-2]-Ce[Ce.length-3]}}if(!Q||!J){e.removeAllRanges();return}var Ue=e.rangeCount&&e.getRangeAt(0),Me;try{Me=v(Q.node,Q.offset,J.offset,J.node)}catch(nt){}Me&&(!R&&t.state.focused?(e.collapse(Q.node,Q.offset),Me.collapsed||(e.removeAllRanges(),e.addRange(Me))):(e.removeAllRanges(),e.addRange(Me)),Ue&&e.anchorNode==null?e.addRange(Ue):R&&this.startGracePeriod()),this.rememberSelection()},pr.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)},pr.prototype.showMultipleSelections=function(e){a(this.cm.display.cursorDiv,e.cursors),a(this.cm.display.selectionDiv,e.selection)},pr.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},pr.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return _(this.div,t)},pr.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},pr.prototype.blur=function(){this.div.blur()},pr.prototype.getField=function(){return this.div},pr.prototype.supportsTouch=function(){return!0},pr.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():pa(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)},pr.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},pr.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(f&&b&&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 r=as(t,e.anchorNode,e.anchorOffset),n=as(t,e.focusNode,e.focusOffset);r&&n&&pa(t,function(){Ca(t.doc,ut(r,n),de),(r.bad||n.bad)&&(t.curOp.selectionChanged=!0)})},pr.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,r=e.doc.sel.primary(),n=r.from(),o=r.to();if(n.ch==0&&n.line>e.firstLine()&&(n=ct(n.line-1,Ut(e.doc,n.line-1).length)),o.ch==Ut(e.doc,o.line).text.length&&o.line<e.lastLine()&&(o=ct(o.line+1,0)),n.line<t.viewFrom||o.line>t.viewTo-1)return!1;var M,z,V;n.line==t.viewFrom||(M=en(e,n.line))==0?(z=Kn(t.view[0].line),V=t.view[0].node):(z=Kn(t.view[M].line),V=t.view[M-1].node.nextSibling);var Q=en(e,o.line),J,ye;if(Q==t.view.length-1?(J=t.viewTo-1,ye=t.lineDiv.lastChild):(J=Kn(t.view[Q+1].line)-1,ye=t.view[Q+1].node.previousSibling),!V)return!1;for(var Ce=e.doc.splitLines(tu(e,V,ye,z,J)),Ue=ra(e.doc,ct(z,0),ct(J,Ut(e.doc,J).text.length));Ce.length>1&&Ue.length>1;)if(ve(Ce)==ve(Ue))Ce.pop(),Ue.pop(),J--;else if(Ce[0]==Ue[0])Ce.shift(),Ue.shift(),z++;else break;for(var Me=0,nt=0,dt=Ce[0],xt=Ue[0],wt=Math.min(dt.length,xt.length);Me<wt&&dt.charCodeAt(Me)==xt.charCodeAt(Me);)++Me;for(var kt=ve(Ce),Dt=ve(Ue),Kt=Math.min(kt.length-(Ce.length==1?Me:0),Dt.length-(Ue.length==1?Me:0));nt<Kt&&kt.charCodeAt(kt.length-nt-1)==Dt.charCodeAt(Dt.length-nt-1);)++nt;if(Ce.length==1&&Ue.length==1&&z==n.line)for(;Me&&Me>n.ch&&kt.charCodeAt(kt.length-nt-1)==Dt.charCodeAt(Dt.length-nt-1);)Me--,nt++;Ce[Ce.length-1]=kt.slice(0,kt.length-nt).replace(/^\u200b+/,""),Ce[0]=Ce[0].slice(Me).replace(/\u200b+$/,"");var sn=ct(z,Me),tn=ct(J,Ue.length?ve(Ue).length-nt:0);if(Ce.length>1||Ce[0]||rn(sn,tn))return yo(e.doc,Ce,sn,tn,"+input"),!0},pr.prototype.ensurePolled=function(){this.forceCompositionEnd()},pr.prototype.reset=function(){this.forceCompositionEnd()},pr.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},pr.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)},pr.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&pa(this.cm,function(){return Yn(e.cm)})},pr.prototype.setUneditable=function(e){e.contentEditable="false"},pr.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||Fr(this.cm,vs)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},pr.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},pr.prototype.onContextMenu=function(){},pr.prototype.resetPosition=function(){},pr.prototype.needsContentAttribute=!0;function hl(e,t){var r=Se(e,t.line);if(!r||r.hidden)return null;var n=Ut(e.doc,t.line),o=$(r,n,t.line),M=pt(n,e.doc.direction),z="left";if(M){var V=qe(M,t.ch);z=V%2?"right":"left"}var Q=mt(o.map,t.ch,z);return Q.offset=Q.collapse=="right"?Q.end:Q.start,Q}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Co(e,t){return t&&(e.bad=!0),e}function tu(e,t,r,n,o){var M="",z=!1,V=e.doc.lineSeparator(),Q=!1;function J(Me){return function(nt){return nt.id==Me}}function ye(){z&&(M+=V,Q&&(M+=V),z=Q=!1)}function Ce(Me){Me&&(ye(),M+=Me)}function Ue(Me){if(Me.nodeType==1){var nt=Me.getAttribute("cm-text");if(nt){Ce(nt);return}var dt=Me.getAttribute("cm-marker"),xt;if(dt){var wt=e.findMarks(ct(n,0),ct(o+1,0),J(+dt));wt.length&&(xt=wt[0].find(0))&&Ce(ra(e.doc,xt.from,xt.to).join(V));return}if(Me.getAttribute("contenteditable")=="false")return;var kt=/^(pre|div|p|li|table|br)$/i.test(Me.nodeName);if(!/^br$/i.test(Me.nodeName)&&Me.textContent.length==0)return;kt&&ye();for(var Dt=0;Dt<Me.childNodes.length;Dt++)Ue(Me.childNodes[Dt]);/^(pre|p)$/i.test(Me.nodeName)&&(Q=!0),kt&&(z=!0)}else Me.nodeType==3&&Ce(Me.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(Ue(t),t==r);)t=t.nextSibling,Q=!1;return M}function as(e,t,r){var n;if(t==e.display.lineDiv){if(n=e.display.lineDiv.childNodes[r],!n)return Co(e.clipPos(ct(e.display.viewTo-1)),!0);t=null,r=0}else for(n=t;;n=n.parentNode){if(!n||n==e.display.lineDiv)return null;if(n.parentNode&&n.parentNode==e.display.lineDiv)break}for(var o=0;o<e.display.view.length;o++){var M=e.display.view[o];if(M.node==n)return nu(M,t,r)}}function nu(e,t,r){var n=e.text.firstChild,o=!1;if(!t||!_(n,t))return Co(ct(Kn(e.line),0),!0);if(t==n&&(o=!0,t=n.childNodes[r],r=0,!t)){var M=e.rest?ve(e.rest):e.line;return Co(ct(Kn(M),M.text.length),o)}var z=t.nodeType==3?t:null,V=t;for(!z&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(z=t.firstChild,r&&(r=z.nodeValue.length));V.parentNode!=n;)V=V.parentNode;var Q=e.measure,J=Q.maps;function ye(xt,wt,kt){for(var Dt=-1;Dt<(J?J.length:0);Dt++)for(var Kt=Dt<0?Q.map:J[Dt],sn=0;sn<Kt.length;sn+=3){var tn=Kt[sn+2];if(tn==xt||tn==wt){var Fn=Kn(Dt<0?e.line:e.rest[Dt]),Ar=Kt[sn]+kt;return(kt<0||tn!=xt)&&(Ar=Kt[sn+(kt?1:0)]),ct(Fn,Ar)}}}var Ce=ye(z,V,r);if(Ce)return Co(Ce,o);for(var Ue=V.nextSibling,Me=z?z.nodeValue.length-r:0;Ue;Ue=Ue.nextSibling){if(Ce=ye(Ue,Ue.firstChild,0),Ce)return Co(ct(Ce.line,Ce.ch-Me),o);Me+=Ue.textContent.length}for(var nt=V.previousSibling,dt=r;nt;nt=nt.previousSibling){if(Ce=ye(nt,nt.firstChild,-1),Ce)return Co(ct(Ce.line,Ce.ch+dt),o);dt+=nt.textContent.length}}var Jr=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new X,this.hasSelection=!1,this.composing=null};Jr.prototype.init=function(e){var t=this,r=this,n=this.cm;this.createField(e);var o=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),y&&(o.style.width="0px"),Be(o,"input",function(){U&&I>=9&&t.hasSelection&&(t.hasSelection=null),r.poll()}),Be(o,"paste",function(z){if(rt(n,z)||sl(z,n))return;n.state.pasteIncoming=+new Date,r.fastPoll()});function M(z){if(rt(n,z))return;if(n.somethingSelected())rs({lineWise:!1,text:n.getSelections()});else if(n.options.lineWiseCopyCut){var V=ul(n);rs({lineWise:!0,text:V.text}),z.type=="cut"?n.setSelections(V.ranges,null,de):(r.prevInput="",o.value=V.text.join(`
`),W(o))}else return;z.type=="cut"&&(n.state.cutIncoming=+new Date)}Be(o,"cut",M),Be(o,"copy",M),Be(e.scroller,"paste",function(z){if(ba(e,z)||rt(n,z))return;if(!o.dispatchEvent){n.state.pasteIncoming=+new Date,r.focus();return}var V=new Event("paste");V.clipboardData=z.clipboardData,o.dispatchEvent(V)}),Be(e.lineSpace,"selectstart",function(z){ba(e,z)||te(z)}),Be(o,"compositionstart",function(){var z=n.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:z,range:n.markText(z,n.getCursor("to"),{className:"CodeMirror-composing"})}}),Be(o,"compositionend",function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)})},Jr.prototype.createField=function(e){this.wrapper=cl(),this.textarea=this.wrapper.firstChild},Jr.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Jr.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,n=Fa(e);if(e.options.moveInputWithCursor){var o=kn(e,r.sel.primary().head,"div"),M=t.wrapper.getBoundingClientRect(),z=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,o.top+z.top-M.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,o.left+z.left-M.left))}return n},Jr.prototype.showSelection=function(e){var t=this.cm,r=t.display;a(r.cursorDiv,e.cursors),a(r.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Jr.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var r=t.getSelection();this.textarea.value=r,t.state.focused&&W(this.textarea),U&&I>=9&&(this.hasSelection=r)}else e||(this.prevInput=this.textarea.value="",U&&I>=9&&(this.hasSelection=null))},Jr.prototype.getField=function(){return this.textarea},Jr.prototype.supportsTouch=function(){return!1},Jr.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!s||D()!=this.textarea))try{this.textarea.focus()}catch(e){}},Jr.prototype.blur=function(){this.textarea.blur()},Jr.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Jr.prototype.receivedFocus=function(){this.slowPoll()},Jr.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()})},Jr.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function r(){var n=t.poll();!n&&!e?(e=!0,t.polling.set(60,r)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,r)},Jr.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||Pt(r)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var o=r.value;if(o==n&&!t.somethingSelected())return!1;if(U&&I>=9&&this.hasSelection===o||c&&/[\uf700-\uf7ff]/.test(o))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var M=o.charCodeAt(0);if(M==8203&&!n&&(n="\u200B"),M==8666)return this.reset(),this.cm.execCommand("undo")}for(var z=0,V=Math.min(n.length,o.length);z<V&&n.charCodeAt(z)==o.charCodeAt(z);)++z;return pa(t,function(){vs(t,o.slice(z),n.length-z,null,e.composing?"*compose":null),o.length>1e3||o.indexOf(`
`)>-1?r.value=e.prevInput="":e.prevInput=o,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Jr.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Jr.prototype.onKeyPress=function(){U&&I>=9&&(this.hasSelection=null),this.fastPoll()},Jr.prototype.onContextMenu=function(e){var t=this,r=t.cm,n=r.display,o=t.textarea;t.contextMenuPending&&t.contextMenuPending();var M=Gr(r,e),z=n.scroller.scrollTop;if(!M||g)return;var V=r.options.resetSelectionOnContextMenu;V&&r.doc.sel.contains(M)==-1&&Fr(r,Ca)(r.doc,ut(M),de);var Q=o.style.cssText,J=t.wrapper.style.cssText,ye=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",o.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(e.clientY-ye.top-5)+"px; left: "+(e.clientX-ye.left-5)+`px;
z-index: 1000; background: `+(U?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Ce;T&&(Ce=window.scrollY),n.input.focus(),T&&window.scrollTo(null,Ce),n.input.reset(),r.somethingSelected()||(o.value=t.prevInput=" "),t.contextMenuPending=Me,n.selForContextMenu=r.doc.sel,clearTimeout(n.detectingSelectAll);function Ue(){if(o.selectionStart!=null){var dt=r.somethingSelected(),xt="\u200B"+(dt?o.value:"");o.value="\u21DA",o.value=xt,t.prevInput=dt?"":"\u200B",o.selectionStart=1,o.selectionEnd=xt.length,n.selForContextMenu=r.doc.sel}}function Me(){if(t.contextMenuPending!=Me)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=J,o.style.cssText=Q,U&&I<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=z),o.selectionStart!=null){(!U||U&&I<9)&&Ue();var dt=0,xt=function(){n.selForContextMenu==r.doc.sel&&o.selectionStart==0&&o.selectionEnd>0&&t.prevInput=="\u200B"?Fr(r,Rs)(r):dt++<10?n.detectingSelectAll=setTimeout(xt,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(xt,200)}}if(U&&I>=9&&Ue(),A){_e(e);var nt=function(){yt(window,"mouseup",nt),setTimeout(Me,20)};Be(window,"mouseup",nt)}else setTimeout(Me,50)},Jr.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Jr.prototype.setUneditable=function(){},Jr.prototype.needsContentAttribute=!1;function ru(e,t){if(t=t?N(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 r=D();t.autofocus=r==e||e.getAttribute("autofocus")!=null&&r==document.body}function n(){e.value=V.getValue()}var o;if(e.form&&(Be(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var M=e.form;o=M.submit;try{var z=M.submit=function(){n(),M.submit=o,M.submit(),M.submit=z}}catch(Q){}}t.finishInit=function(Q){Q.save=n,Q.getTextArea=function(){return e},Q.toTextArea=function(){Q.toTextArea=isNaN,n(),e.parentNode.removeChild(Q.getWrapperElement()),e.style.display="",e.form&&(yt(e.form,"submit",n),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=o))}},e.style.display="none";var V=Br(function(Q){return e.parentNode.insertBefore(Q,e.nextSibling)},t);return V}function au(e){e.off=yt,e.on=Be,e.wheelEventPixels=We,e.Doc=La,e.splitLines=Bt,e.countColumn=H,e.findColumn=le,e.isWordChar=Le,e.Pass=he,e.signal=He,e.Line=kr,e.changeEnd=Ft,e.scrollbarModel=qi,e.Pos=ct,e.cmpPos=rn,e.modes=Qn,e.mimeModes=nn,e.resolveMode=vr,e.getMode=ca,e.modeExtensions=mr,e.extendMode=Da,e.copyState=Rr,e.startState=tr,e.innerMode=fa,e.commands=Wo,e.keyMap=Pi,e.keyName=Xs,e.isModifierKey=Gs,e.lookupKey=Eo,e.normalizeKeyMap=Ll,e.StringStream=dr,e.SharedTextMarker=Bo,e.TextMarker=Gi,e.LineWidget=jo,e.e_preventDefault=te,e.e_stopPropagation=oe,e.e_stop=_e,e.addClass=B,e.contains=_,e.rmClass=u,e.keyNames=Vi}Yl(Br),ql(Br);var iu="iter insert remove copy getEditor constructor".split(" ");for(var is in La.prototype)La.prototype.hasOwnProperty(is)&&Y(iu,is)<0&&(Br.prototype[is]=function(e){return function(){return e.apply(this.doc,arguments)}}(La.prototype[is]));return be(La),Br.inputStyles={textarea:Jr,contenteditable:pr},Br.defineMode=function(e){!Br.defaults.mode&&e!="null"&&(Br.defaults.mode=e),ur.apply(this,arguments)},Br.defineMIME=hr,Br.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Br.defineMIME("text/plain","null"),Br.defineExtension=function(e,t){Br.prototype[e]=t},Br.defineDocExtension=function(e,t){La.prototype[e]=t},Br.fromTextArea=ru,au(Br),Br.version="5.58.2",Br})},WaYH:function(at,Ne,F){"use strict";var q=F("rePB"),G=F("Ff2n"),R=F("VTBJ"),K=F("1OyB"),O=F("vuIU"),L=F("JX7q"),U=F("Ji7U"),I=F("LK+K"),T=F("cDcd"),P=F("TSYQ"),b=F.n(P),g=F("sboe"),k=F("OZM5"),w=function(A){var x=A.prefixCls,u=A.level,l=A.isStart,a=A.isEnd;if(!u)return null;for(var i="".concat(x,"-indent-unit"),E=[],v=0;v<u;v+=1){var _;E.push(T.createElement("span",{key:v,className:b()(i,(_={},Object(q.a)(_,"".concat(i,"-start"),l[v+1]),Object(q.a)(_,"".concat(i,"-end"),a[v+1]),Object(q.a)(_,"".concat(i,"-end-first-level"),!v&&a[0]),_))}))}return T.createElement("span",{"aria-hidden":"true",className:"".concat(x,"-indent")},E)},p=w,y=F("815F"),f="open",s="close",c="---",d=function(m){Object(U.a)(x,m);var A=Object(I.a)(x);function x(){var u;return Object(K.a)(this,x),u=A.apply(this,arguments),u.state={dragNodeHighlight:!1},u.onSelectorClick=function(l){var a=u.props.context.onNodeClick;a(l,Object(y.b)(u.props)),u.isSelectable()?u.onSelect(l):u.onCheck(l)},u.onSelectorDoubleClick=function(l){var a=u.props.context.onNodeDoubleClick;a(l,Object(y.b)(u.props))},u.onSelect=function(l){if(u.isDisabled())return;var a=u.props.context.onNodeSelect;l.preventDefault(),a(l,Object(y.b)(u.props))},u.onCheck=function(l){if(u.isDisabled())return;var a=u.props,i=a.disableCheckbox,E=a.checked,v=u.props.context.onNodeCheck;if(!u.isCheckable()||i)return;l.preventDefault();var _=!E;v(l,Object(y.b)(u.props),_)},u.onMouseEnter=function(l){var a=u.props.context.onNodeMouseEnter;a(l,Object(y.b)(u.props))},u.onMouseLeave=function(l){var a=u.props.context.onNodeMouseLeave;a(l,Object(y.b)(u.props))},u.onContextMenu=function(l){var a=u.props.context.onNodeContextMenu;a(l,Object(y.b)(u.props))},u.onDragStart=function(l){var a=u.props.context.onNodeDragStart;l.stopPropagation(),u.setState({dragNodeHighlight:!0}),a(l,Object(L.a)(u));try{l.dataTransfer.setData("text/plain","")}catch(i){}},u.onDragEnter=function(l){var a=u.props.context.onNodeDragEnter;l.preventDefault(),l.stopPropagation(),a(l,Object(L.a)(u))},u.onDragOver=function(l){var a=u.props.context.onNodeDragOver;l.preventDefault(),l.stopPropagation(),a(l,Object(L.a)(u))},u.onDragLeave=function(l){var a=u.props.context.onNodeDragLeave;l.stopPropagation(),a(l,Object(L.a)(u))},u.onDragEnd=function(l){var a=u.props.context.onNodeDragEnd;l.stopPropagation(),u.setState({dragNodeHighlight:!1}),a(l,Object(L.a)(u))},u.onDrop=function(l){var a=u.props.context.onNodeDrop;l.preventDefault(),l.stopPropagation(),u.setState({dragNodeHighlight:!1}),a(l,Object(L.a)(u))},u.onExpand=function(l){var a=u.props.context.onNodeExpand;a(l,Object(y.b)(u.props))},u.setSelectHandle=function(l){u.selectHandle=l},u.getNodeState=function(){var l=u.props.expanded;return u.isLeaf()?null:l?f:s},u.hasChildren=function(){var l=u.props.eventKey,a=u.props.context.keyEntities,i=a[l]||{},E=i.children;return!!(E||[]).length},u.isLeaf=function(){var l=u.props,a=l.isLeaf,i=l.loaded,E=u.props.context.loadData,v=u.hasChildren();return a===!1?!1:a||!E&&!v||E&&i&&!v},u.isDisabled=function(){var l=u.props.disabled,a=u.props.context.disabled;return!!(a||l)},u.isCheckable=function(){var l=u.props.checkable,a=u.props.context.checkable;return!a||l===!1?!1:a},u.syncLoadData=function(l){var a=l.expanded,i=l.loading,E=l.loaded,v=u.props.context,_=v.loadData,D=v.onNodeLoad;if(i)return;_&&a&&!u.isLeaf()&&(!u.hasChildren()&&!E&&D(Object(y.b)(u.props)))},u.renderSwitcher=function(){var l=u.props,a=l.expanded,i=l.switcherIcon,E=u.props.context,v=E.prefixCls,_=E.switcherIcon,D=i||_;if(u.isLeaf())return T.createElement("span",{className:b()("".concat(v,"-switcher"),"".concat(v,"-switcher-noop"))},typeof D=="function"?D(Object(R.a)(Object(R.a)({},u.props),{},{isLeaf:!0})):D);var B=b()("".concat(v,"-switcher"),"".concat(v,"-switcher_").concat(a?f:s));return T.createElement("span",{onClick:u.onExpand,className:B},typeof D=="function"?D(Object(R.a)(Object(R.a)({},u.props),{},{isLeaf:!1})):D)},u.renderCheckbox=function(){var l=u.props,a=l.checked,i=l.halfChecked,E=l.disableCheckbox,v=u.props.context.prefixCls,_=u.isDisabled(),D=u.isCheckable();if(!D)return null;var B=typeof D!="boolean"?D:null;return T.createElement("span",{className:b()("".concat(v,"-checkbox"),a&&"".concat(v,"-checkbox-checked"),!a&&i&&"".concat(v,"-checkbox-indeterminate"),(_||E)&&"".concat(v,"-checkbox-disabled")),onClick:u.onCheck},B)},u.renderIcon=function(){var l=u.props.loading,a=u.props.context.prefixCls;return T.createElement("span",{className:b()("".concat(a,"-iconEle"),"".concat(a,"-icon__").concat(u.getNodeState()||"docu"),l&&"".concat(a,"-icon_loading"))})},u.renderSelector=function(){var l=u.state.dragNodeHighlight,a=u.props,i=a.title,E=a.selected,v=a.icon,_=a.loading,D=a.data,B=u.props.context,j=B.prefixCls,W=B.showIcon,h=B.icon,N=B.draggable,H=B.loadData,X=B.titleRender,Y=u.isDisabled(),re="".concat(j,"-node-content-wrapper"),he;if(W){var de=v||h;he=de?T.createElement("span",{className:b()("".concat(j,"-iconEle"),"".concat(j,"-icon__customize"))},typeof de=="function"?de(u.props):de):u.renderIcon()}else H&&_&&(he=u.renderIcon());var ne;typeof i=="function"?ne=i(D):X?ne=X(D):ne=i;var ae=T.createElement("span",{className:"".concat(j,"-title")},ne);return T.createElement("span",{ref:u.setSelectHandle,title:typeof i=="string"?i:"",className:b()("".concat(re),"".concat(re,"-").concat(u.getNodeState()||"normal"),!Y&&(E||l)&&"".concat(j,"-node-selected"),!Y&&N&&"draggable"),draggable:!Y&&N||void 0,"aria-grabbed":!Y&&N||void 0,onMouseEnter:u.onMouseEnter,onMouseLeave:u.onMouseLeave,onContextMenu:u.onContextMenu,onClick:u.onSelectorClick,onDoubleClick:u.onSelectorDoubleClick,onDragStart:N?u.onDragStart:void 0},he,ae)},u}return Object(O.a)(x,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var l=this.props.selectable,a=this.props.context.selectable;return typeof l=="boolean"?l:a}},{key:"render",value:function(){var l,a=this.props,i=a.eventKey,E=a.className,v=a.style,_=a.dragOver,D=a.dragOverGapTop,B=a.dragOverGapBottom,j=a.isLeaf,W=a.isStart,h=a.isEnd,N=a.expanded,H=a.selected,X=a.checked,Y=a.halfChecked,re=a.loading,he=a.domRef,de=a.active,ne=a.onMouseMove,ae=Object(G.a)(a,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),le=this.props.context,ee=le.prefixCls,ie=le.filterTreeNode,ve=le.draggable,Pe=le.keyEntities,Ie=this.isDisabled(),we=Object(k.f)(ae),ke=Pe[i]||{},De=ke.level,Le=h[h.length-1];return T.createElement("div",Object.assign({ref:he,className:b()(E,"".concat(ee,"-treenode"),(l={},Object(q.a)(l,"".concat(ee,"-treenode-disabled"),Ie),Object(q.a)(l,"".concat(ee,"-treenode-switcher-").concat(N?"open":"close"),!j),Object(q.a)(l,"".concat(ee,"-treenode-checkbox-checked"),X),Object(q.a)(l,"".concat(ee,"-treenode-checkbox-indeterminate"),Y),Object(q.a)(l,"".concat(ee,"-treenode-selected"),H),Object(q.a)(l,"".concat(ee,"-treenode-loading"),re),Object(q.a)(l,"".concat(ee,"-treenode-active"),de),Object(q.a)(l,"".concat(ee,"-treenode-leaf-last"),Le),Object(q.a)(l,"drag-over",!Ie&&_),Object(q.a)(l,"drag-over-gap-top",!Ie&&D),Object(q.a)(l,"drag-over-gap-bottom",!Ie&&B),Object(q.a)(l,"filter-node",ie&&ie(Object(y.b)(this.props))),l)),style:v,onDragEnter:ve?this.onDragEnter:void 0,onDragOver:ve?this.onDragOver:void 0,onDragLeave:ve?this.onDragLeave:void 0,onDrop:ve?this.onDrop:void 0,onDragEnd:ve?this.onDragEnd:void 0,onMouseMove:ne},we),T.createElement(p,{prefixCls:ee,level:De,isStart:W,isEnd:h}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),x}(T.Component),S=function(A){return T.createElement(g.a.Consumer,null,function(x){return T.createElement(d,Object.assign({},A,{context:x}))})};S.displayName="TreeNode",S.defaultProps={title:c},S.isTreeNode=1;var C=Ne.a=S},Y1PL:function(at,Ne,F){"use strict";F.r(Ne),F.d(Ne,"ResizableTextArea",function(){return Y});var q=F("wx14"),G=F("1OyB"),R=F("vuIU"),K=F("Ji7U"),O=F("LK+K"),L=F("cDcd"),U=F("VTBJ"),I=F("rePB"),T=F("Zm9Q"),P=F("Kwbf"),b=F("c+Xe"),g=F("m+aA"),k=F("bdgK"),w=new Map;function p(de){de.forEach(function(ne){var ae,le=ne.target;(ae=w.get(le))===null||ae===void 0||ae.forEach(function(ee){return ee(le)})})}var y=new k.default(p),f=null,s=null;function c(de,ne){w.has(de)||(w.set(de,new Set),y.observe(de)),w.get(de).add(ne)}function d(de,ne){w.has(de)&&(w.get(de).delete(ne),w.get(de).size||(y.unobserve(de),w.delete(de)))}var S=function(de){Object(K.a)(ae,de);var ne=Object(O.a)(ae);function ae(){return Object(G.a)(this,ae),ne.apply(this,arguments)}return Object(R.a)(ae,[{key:"render",value:function(){return this.props.children}}]),ae}(L.Component),C=L.createContext(null);function m(de){var ne=de.children,ae=de.onBatchResize,le=L.useRef(0),ee=L.useRef([]),ie=L.useContext(C),ve=L.useCallback(function(Pe,Ie,we){le.current+=1;var ke=le.current;ee.current.push({size:Pe,element:Ie,data:we}),Promise.resolve().then(function(){ke===le.current&&(ae==null||ae(ee.current),ee.current=[])}),ie==null||ie(Pe,Ie,we)},[ae,ie]);return L.createElement(C.Provider,{value:ve},ne)}function A(de){var ne=de.children,ae=de.disabled,le=L.useRef(null),ee=L.useRef(null),ie=L.useContext(C),ve=L.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),Pe=L.isValidElement(ne)&&Object(b.c)(ne),Ie=Pe?ne.ref:null,we=L.useMemo(function(){return Object(b.a)(Ie,le)},[Ie,le]),ke=L.useRef(de);ke.current=de;var De=L.useCallback(function(Le){var Ve=ke.current,ze=Ve.onResize,Je=Ve.data,Ye=Le.getBoundingClientRect(),Ge=Ye.width,ht=Ye.height,ot=Le.offsetWidth,st=Le.offsetHeight,qe=Math.floor(Ge),vt=Math.floor(ht);if(ve.current.width!==qe||ve.current.height!==vt||ve.current.offsetWidth!==ot||ve.current.offsetHeight!==st){var pt={width:qe,height:vt,offsetWidth:ot,offsetHeight:st};ve.current=pt;var gt=ot===Math.round(Ge)?Ge:ot,Be=st===Math.round(ht)?ht:st,Ct=Object(U.a)(Object(U.a)({},pt),{},{offsetWidth:gt,offsetHeight:Be});ie==null||ie(Ct,Le,Je),ze&&Promise.resolve().then(function(){ze(Ct,Le)})}},[]);return L.useEffect(function(){var Le=Object(g.a)(le.current)||Object(g.a)(ee.current);return Le&&!ae&&c(Le,De),function(){return d(Le,De)}},[le.current,ae]),L.createElement(S,{ref:ee},Pe?L.cloneElement(ne,{ref:we}):ne)}var x="rc-observer-key";function u(de){var ne=de.children,ae=Object(T.a)(ne);return ae.map(function(le,ee){var ie=(le==null?void 0:le.key)||"".concat(x,"-").concat(ee);return L.createElement(A,Object(q.a)({},de,{key:ie}),le)})}u.Collection=m;var l=u,a=F("bT9E"),i=F("TSYQ"),E=F.n(i),v=`
min-height:0 !important;
max-height:none !important;
height:0 !important;
visibility:hidden !important;
overflow:hidden !important;
position:absolute !important;
z-index:-1000 !important;
top:0 !important;
right:0 !important
`,_=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],D={},B;function j(de){var ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ae=de.getAttribute("id")||de.getAttribute("data-reactid")||de.getAttribute("name");if(ne&&D[ae])return D[ae];var le=window.getComputedStyle(de),ee=le.getPropertyValue("box-sizing")||le.getPropertyValue("-moz-box-sizing")||le.getPropertyValue("-webkit-box-sizing"),ie=parseFloat(le.getPropertyValue("padding-bottom"))+parseFloat(le.getPropertyValue("padding-top")),ve=parseFloat(le.getPropertyValue("border-bottom-width"))+parseFloat(le.getPropertyValue("border-top-width")),Pe=_.map(function(we){return"".concat(we,":").concat(le.getPropertyValue(we))}).join(";"),Ie={sizingStyle:Pe,paddingSize:ie,borderSize:ve,boxSizing:ee};return ne&&ae&&(D[ae]=Ie),Ie}function W(de){var ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ae=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,le=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;B||(B=document.createElement("textarea"),B.setAttribute("tab-index","-1"),B.setAttribute("aria-hidden","true"),document.body.appendChild(B)),de.getAttribute("wrap")?B.setAttribute("wrap",de.getAttribute("wrap")):B.removeAttribute("wrap");var ee=j(de,ne),ie=ee.paddingSize,ve=ee.borderSize,Pe=ee.boxSizing,Ie=ee.sizingStyle;B.setAttribute("style","".concat(Ie,";").concat(v)),B.value=de.value||de.placeholder||"";var we=Number.MIN_SAFE_INTEGER,ke=Number.MAX_SAFE_INTEGER,De=B.scrollHeight,Le;if(Pe==="border-box"?De+=ve:Pe==="content-box"&&(De-=ie),ae!==null||le!==null){B.value=" ";var Ve=B.scrollHeight-ie;ae!==null&&(we=Ve*ae,Pe==="border-box"&&(we=we+ie+ve),De=Math.max(we,De)),le!==null&&(ke=Ve*le,Pe==="border-box"&&(ke=ke+ie+ve),Le=De>ke?"":"hidden",De=Math.min(ke,De))}return{height:De,minHeight:we,maxHeight:ke,overflowY:Le,resize:"none"}}var h=F("Gytx"),N=F.n(h),H;(function(de){de[de.NONE=0]="NONE",de[de.RESIZING=1]="RESIZING",de[de.RESIZED=2]="RESIZED"})(H||(H={}));var X=function(de){Object(K.a)(ae,de);var ne=Object(O.a)(ae);function ae(le){var ee;return Object(G.a)(this,ae),ee=ne.call(this,le),ee.nextFrameActionId=void 0,ee.resizeFrameId=void 0,ee.textArea=void 0,ee.saveTextArea=function(ie){ee.textArea=ie},ee.handleResize=function(ie){var ve=ee.state.resizeStatus,Pe=ee.props,Ie=Pe.autoSize,we=Pe.onResize;if(ve!==H.NONE)return;typeof we=="function"&&we(ie),Ie&&ee.resizeOnNextFrame()},ee.resizeOnNextFrame=function(){cancelAnimationFrame(ee.nextFrameActionId),ee.nextFrameActionId=requestAnimationFrame(ee.resizeTextarea)},ee.resizeTextarea=function(){var ie=ee.props.autoSize;if(!ie||!ee.textArea)return;var ve=ie.minRows,Pe=ie.maxRows,Ie=W(ee.textArea,!1,ve,Pe);ee.setState({textareaStyles:Ie,resizeStatus:H.RESIZING},function(){cancelAnimationFrame(ee.resizeFrameId),ee.resizeFrameId=requestAnimationFrame(function(){ee.setState({resizeStatus:H.RESIZED},function(){ee.resizeFrameId=requestAnimationFrame(function(){ee.setState({resizeStatus:H.NONE}),ee.fixFirefoxAutoScroll()})})})})},ee.renderTextArea=function(){var ie=ee.props,ve=ie.prefixCls,Pe=ve===void 0?"rc-textarea":ve,Ie=ie.autoSize,we=ie.onResize,ke=ie.className,De=ie.disabled,Le=ee.state,Ve=Le.textareaStyles,ze=Le.resizeStatus,Je=Object(a.a)(ee.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Ye=E()(Pe,ke,Object(I.a)({},"".concat(Pe,"-disabled"),De));"value"in Je&&(Je.value=Je.value||"");var Ge=Object(U.a)(Object(U.a)(Object(U.a)({},ee.props.style),Ve),ze===H.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return L.createElement(l,{onResize:ee.handleResize,disabled:!(Ie||we)},L.createElement("textarea",Object(q.a)({},Je,{className:Ye,style:Ge,ref:ee.saveTextArea})))},ee.state={textareaStyles:{},resizeStatus:H.NONE},ee}return Object(R.a)(ae,[{key:"componentDidUpdate",value:function(ee){(ee.value!==this.props.value||!N()(ee.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 ee=this.textArea.selectionStart,ie=this.textArea.selectionEnd;this.textArea.setSelectionRange(ee,ie)}}catch(ve){}}},{key:"render",value:function(){return this.renderTextArea()}}]),ae}(L.Component),Y=X,re=function(de){Object(K.a)(ae,de);var ne=Object(O.a)(ae);function ae(le){var ee;Object(G.a)(this,ae),ee=ne.call(this,le),ee.resizableTextArea=void 0,ee.focus=function(){ee.resizableTextArea.textArea.focus()},ee.saveTextArea=function(ve){ee.resizableTextArea=ve},ee.handleChange=function(ve){var Pe=ee.props.onChange;ee.setValue(ve.target.value,function(){ee.resizableTextArea.resizeTextarea()}),Pe&&Pe(ve)},ee.handleKeyDown=function(ve){var Pe=ee.props,Ie=Pe.onPressEnter,we=Pe.onKeyDown;ve.keyCode===13&&Ie&&Ie(ve),we&&we(ve)};var ie=typeof le.value=="undefined"||le.value===null?le.defaultValue:le.value;return ee.state={value:ie},ee}return Object(R.a)(ae,[{key:"setValue",value:function(ee,ie){"value"in this.props||this.setState({value:ee},ie)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return L.createElement(Y,Object(q.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(ee){return"value"in ee?{value:ee.value}:null}}]),ae}(L.Component),he=Ne.default=re},ZW9T:function(at,Ne,F){"use strict";F.d(Ne,"a",function(){return C});var q=F("k1fw"),G=F("miYZ"),R=F("tsqr"),K=F("rAM+"),O=F("tJVT"),L=F("PpiC"),U=F("cDcd"),I=F.n(U),T=F("bdgK");function P(m,A,x,u,l){var a=A.getWordUntilPosition(x),i={startLineNumber:x.lineNumber,endLineNumber:x.lineNumber,startColumn:a.startColumn,endColumn:a.endColumn},E=u.map(function(v){return{label:v,kind:m.languages.CompletionItemKind.Keyword,insertText:v,insertTextRules:m.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:i}});return l.map(function(v){E.push(Object(q.a)(Object(q.a)({},v),{},{range:i}))}),E}var b=function(m){var A={label:"ifelse",kind:m.languages.CompletionItemKind.Method,insertText:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
`),insertTextRules:m.languages.CompletionItemInsertTextRule.InsertAsSnippet},x=["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","inline","restrict","_Bool","_Complex","_Imaginary","_Alignas","_Alignof","_Atomic","_Static_assert","_Noreturn","_Thread_local","_Generic"];m.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(i,E){var v=P(m,i,E,x,[A]);return{suggestions:v}}});var u=["False","None","True","and","as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal","not","or","pass","raise","return","try","while","with","yield"];m.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(i,E){var v=[{label:"print",kind:m.languages.CompletionItemKind.Snippet,insertText:["print($0)"].join(`
`),insertTextRules:m.languages.CompletionItemInsertTextRule.InsertAsSnippet}],_=P(m,i,E,u,v);return{suggestions:_}}});var l=["abstract","assert","boolean","break","byte","case","catch","char","class","const","continue","default","do","double","else","enum","extends","final","finally","float","for","goto","if","implements","import","instance of","int","interface","long","native","new","package","private","protected","public","return","strictfp","short","static","super","switch","synchronized","this","throw","throws","transient","try","void","volatile","while"];m.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(i,E){var v=[A,{label:"main",kind:m.languages.CompletionItemKind.Snippet,insertText:["public static void main(String[] args) {"," $0","}"].join(`
`),insertTextRules:m.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"System.out.print",kind:m.languages.CompletionItemKind.Snippet,insertText:["System.out.print($0)"].join(`
`),insertTextRules:m.languages.CompletionItemInsertTextRule.InsertAsSnippet}],_=P(m,i,E,l,v);return{suggestions:_}}})},g="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",k=F("LvDl"),w=F("+ua5");function p(m){return/^\d+$/.test(m)?"".concat(m,"px"):m}function y(){}var f=!1,s={"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 c(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],A=m;if(Array.isArray(m)){for(var x=0;x<m.length;x++){var u=s[m[x]];if(u)return u}return A[0]}return s[A]||A}var d=null,S=Ne.b=function(m){var A=m.width,x=A===void 0?"100%":A,u=m.height,l=u===void 0?"100%":u,a=m.value,i=m.language,E=i===void 0?"javascript":i,v=m.style,_=v===void 0?{}:v,D=m.options,B=D===void 0?{}:D,j=m.overrideServices,W=j===void 0?{}:j,h=m.theme,N=h===void 0?"vs-dark":h,H=m.onEditBlur,X=m.onSave,Y=m.autoHeight,re=Y===void 0?!1:Y,he=m.forbidCopy,de=he===void 0?!1:he,ne=m.onChange,ae=ne===void 0?y:ne,le=m.editorDidMount,ee=le===void 0?y:le,ie=m.onFocus,ve=ie===void 0?y:ie,Pe=m.filename,Ie=Pe===void 0?"educoder.txt":Pe,we=m.errorLine,ke=m.errorContent,De=ke===void 0?"":ke,Le=Object(L.a)(m,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),Ve=Object(U.useRef)(),ze=Object(U.useRef)({}),Je=Object(U.useRef)(),Ye=Object(U.useRef)(!1),Ge=Object(U.useRef)(),ht=Object(U.useState)(!1),ot=Object(O.a)(ht,2),st=ot[0],qe=ot[1];function vt(){var Ze;return Ve.current&&(Ze=new T.default(function(_t){var It=Object(K.a)(_t),$e;try{for(It.s();!($e=It.n()).done;){var Qt=$e.value;(Qt.target.offsetHeight>0||Qt.target.offsetWidth>0)&&ze.current.instance.layout()}}catch(Bt){It.e(Bt)}finally{It.f()}}),Ze.observe(Ve.current)),Ze}function pt(){R.b.warn(decodeURIComponent(g))}var gt=function(){var _t=ze.current.instance;if(a!=null&&_t&&st){var It=_t.getModel();It&&a!==It.getValue()&&(f=!0,It.setValue(a),_t.layout(),f=!1)}};Object(U.useEffect)(function(){Je.current&&clearTimeout(Je.current),Je.current=setTimeout(function(){gt()},500)},[a,st,ze.current]),Object(U.useEffect)(function(){if(we&&ze.current&&ze.current.instance){var Ze=ze.current.instance;Ze.changeViewZones(function(It){var $e=document.createElement("div");$e.style.padding="10px 20px",$e.style.width="calc(100% - 20px)",$e.className="my-error-line-wrp",$e.innerHTML=De,It.addZone({afterLineNumber:we||11,heightInLines:3,domNode:$e})});var _t={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}};Ze.addOverlayWidget(_t),Ze.revealPositionInCenter({lineNumber:20,column:1})}},[we,ze.current,st]);function Be(){var Ze=ze.current.instance;if(Ze){var _t=Ze.getSelection(),It=ze.current.pastePos||{},$e=new d.Range(It.startLineNumber||_t.endLineNumber,It.startColumn||_t.endColumn,It.endLineNumber||_t.endLineNumber,It.endColumn||_t.endColumn);setTimeout(function(){Ze.executeEdits("",[{range:$e,text:""}])},300)}}function Ct(Ze){(window.navigator.platform.match("Mac")?Ze.metaKey:Ze.ctrlKey)&&Ze.keyCode==83&&(Ze.preventDefault(),X())}var yt=function(){if(re&&ze.current.instance){var _t=ze.current.instance.getContentHeight();je(_t<l?l:_t)}else je(l)};function He(Ze){var _t=document.createEvent("MouseEvents");_t.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),Ze.dispatchEvent(_t)}function rt(Ze,_t){var It=window.URL||window.webkitURL||window,$e=new Blob([_t]),Qt=document.createElementNS("http://www.w3.org/1999/xhtml","a");Qt.href=It.createObjectURL($e),Qt.download=Ze,He(Qt)}Object(U.useEffect)(function(){yt()},[yt]),Object(U.useEffect)(function(){Ve.current&&!st&&F.e(27).then(F.t.bind(null,"M/lh",7)).then(function(Ze){try{d=Ze,ze.current.instance=d.editor.create(Ve.current,{value:a,language:c(E),theme:N,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},W);var _t=ze.current.instance;if(ee(_t,d),setTimeout(function(){yt(),ze.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){rt(Ie||"educoder.txt",_t.getValue())}})},500),ze.current.subscription=_t.onDidChangeModelContent(function($e){Ye.current?clearTimeout(Ge.current):(yt(),ae(_t.getValue(),$e)),Ge.current=setTimeout(function(){Ye.current=!1},500)}),window.Monaco||b(d),de&&(_t.addCommand(d.KeyMod.CtrlCmd|d.KeyMod.Shift|d.KeyCode.KEY_V,function(){return pt(),null}),_t.addCommand(d.KeyMod.CtrlCmd|d.KeyCode.KEY_C,function(){return pt(),null})),window.Monaco=d,H&&_t.onDidBlurEditorWidget(function(){H(_t.getValue())}),ve&&_t.onDidFocusEditorText(function(){ve(_t.getValue())}),de){_t.addCommand(d.KeyMod.CtrlCmd|d.KeyCode.KEY_V,function(){return pt(),null}),_t.onDidPaste(function($e){ze.current.pastePos=$e});try{window.addEventListener("paste",Be)}catch($e){}}var It=vt();return qe(!0),function(){var $e=ze.current.instance;$e.dispose();var Qt=$e.getModel();Qt&&Qt.dispose(),ze.current.subscription&&ze.current.subscription.dispose(),de&&window.removeEventListener("paste",Be),It.unobserve(Ve.current)}}catch($e){}})},[]),Object(U.useEffect)(function(){var Ze=ze.current.instance;if(Ze&&st)return document.addEventListener("keydown",Ct,!1),function(){document.removeEventListener("keydown",Ct)}},[X,st]),Object(U.useEffect)(function(){var Ze=ze.current.instance;if(Ze&&st){var _t=c(E);d.editor.setModelLanguage(Ze.getModel(),_t),console.log("language:",E,Ze.getModel(),_t)}},[E,st]),Object(U.useEffect)(function(){var Ze=ze.current.instance;Ze&&st&&d.editor.setTheme(N)},[N,st]),Object(U.useEffect)(function(){var Ze=ze.current.instance;Ze&&st&&(Ze.updateOptions(Object(q.a)({},B)),setTimeout(function(){Ze.getModel().updateOptions(Object(q.a)({},B))},200))},[JSON.stringify(B),st]),Object(U.useEffect)(function(){var Ze=ze.current.instance;Ze&&st&&Ze.layout()},[x,l,st]);var me=Object(U.useState)(p(x)),se=Object(O.a)(me,2),be=se[0],te=se[1],oe=Object(U.useState)(p(l)),ce=Object(O.a)(oe,2),_e=ce[0],je=ce[1],Xe=Object(q.a)(Object(q.a)({},_),{},{width:be,height:_e});return I.a.createElement("div",{className:"my-monaco-editor",ref:Ve,style:Xe})};function C(m){var A=m.width,x=A===void 0?"100%":A,u=m.height,l=u===void 0?"100%":u,a=m.original,i=m.modified,E=m.language,v=m.options,_=v===void 0?{}:v,D=Object(U.useRef)(),B=Object(U.useState)(null),j=Object(O.a)(B,2),W=j[0],h=j[1];function N(re){var he;return D.current&&(he=new T.default(function(de){var ne=Object(K.a)(de),ae;try{for(ne.s();!(ae=ne.n()).done;){var le=ae.value;(le.target.offsetHeight>0||le.target.offsetWidth>0)&&re.layout()}}catch(ee){ne.e(ee)}finally{ne.f()}}),he.observe(D.current)),he}Object(U.useEffect)(function(){D.current&&F.e(27).then(F.t.bind(null,"M/lh",7)).then(function(re){d=re;var he=d.editor.createDiffEditor(D.current,Object(q.a)(Object(q.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},_),{},{wordWrap:!0}));h(he);var de=N(he);return function(){he.dispose();var ne=he.getModel();ne&&ne.dispose(),de.unobserve(D.current)}})},[]),Object(U.useEffect)(function(){W&&W.setModel({original:d.editor.createModel(a,E),modified:d.editor.createModel(i,E)})},[a,i,E,W]);var H=p(x),X=p(l),Y={width:H,height:X};return I.a.createElement("div",{className:"my-diff-editor",ref:D,style:Y})}},ZpRC:function(at,Ne,F){"use strict";function q(b){return typeof b=="object"&&b!=null&&b.nodeType===1}function G(b,g){return(!g||b!=="hidden")&&b!=="visible"&&b!=="clip"}function R(b,g){if(b.clientHeight<b.scrollHeight||b.clientWidth<b.scrollWidth){var k=getComputedStyle(b,null);return G(k.overflowY,g)||G(k.overflowX,g)||function(w){var p=function(y){if(!y.ownerDocument||!y.ownerDocument.defaultView)return null;try{return y.ownerDocument.defaultView.frameElement}catch(f){return null}}(w);return!!p&&(p.clientHeight<w.scrollHeight||p.clientWidth<w.scrollWidth)}(b)}return!1}function K(b,g,k,w,p,y,f,s){return y<b&&f>g||y>b&&f<g?0:y<=b&&s<=k||f>=g&&s>=k?y-b-w:f>g&&s<k||y<b&&s>k?f-g+p:0}var O=function(b,g){var k=window,w=g.scrollMode,p=g.block,y=g.inline,f=g.boundary,s=g.skipOverflowHiddenElements,c=typeof f=="function"?f:function(Ve){return Ve!==f};if(!q(b))throw new TypeError("Invalid target");for(var d=document.scrollingElement||document.documentElement,S=[],C=b;q(C)&&c(C);){if((C=C.parentElement)===d){S.push(C);break}C!=null&&C===document.body&&R(C)&&!R(document.documentElement)||C!=null&&R(C,s)&&S.push(C)}for(var m=k.visualViewport?k.visualViewport.width:innerWidth,A=k.visualViewport?k.visualViewport.height:innerHeight,x=window.scrollX||pageXOffset,u=window.scrollY||pageYOffset,l=b.getBoundingClientRect(),a=l.height,i=l.width,E=l.top,v=l.right,_=l.bottom,D=l.left,B=p==="start"||p==="nearest"?E:p==="end"?_:E+a/2,j=y==="center"?D+i/2:y==="end"?v:D,W=[],h=0;h<S.length;h++){var N=S[h],H=N.getBoundingClientRect(),X=H.height,Y=H.width,re=H.top,he=H.right,de=H.bottom,ne=H.left;if(w==="if-needed"&&E>=0&&D>=0&&_<=A&&v<=m&&E>=re&&_<=de&&D>=ne&&v<=he)return W;var ae=getComputedStyle(N),le=parseInt(ae.borderLeftWidth,10),ee=parseInt(ae.borderTopWidth,10),ie=parseInt(ae.borderRightWidth,10),ve=parseInt(ae.borderBottomWidth,10),Pe=0,Ie=0,we="offsetWidth"in N?N.offsetWidth-N.clientWidth-le-ie:0,ke="offsetHeight"in N?N.offsetHeight-N.clientHeight-ee-ve:0;if(d===N)Pe=p==="start"?B:p==="end"?B-A:p==="nearest"?K(u,u+A,A,ee,ve,u+B,u+B+a,a):B-A/2,Ie=y==="start"?j:y==="center"?j-m/2:y==="end"?j-m:K(x,x+m,m,le,ie,x+j,x+j+i,i),Pe=Math.max(0,Pe+u),Ie=Math.max(0,Ie+x);else{Pe=p==="start"?B-re-ee:p==="end"?B-de+ve+ke:p==="nearest"?K(re,de,X,ee,ve+ke,B,B+a,a):B-(re+X/2)+ke/2,Ie=y==="start"?j-ne-le:y==="center"?j-(ne+Y/2)+we/2:y==="end"?j-he+ie+we:K(ne,he,Y,le,ie+we,j,j+i,i);var De=N.scrollLeft,Le=N.scrollTop;B+=Le-(Pe=Math.max(0,Math.min(Le+Pe,N.scrollHeight-X+ke))),j+=De-(Ie=Math.max(0,Math.min(De+Ie,N.scrollWidth-Y+we)))}W.push({el:N,top:Pe,left:Ie})}return W};function L(b){return b===Object(b)&&Object.keys(b).length!==0}function U(b,g){g===void 0&&(g="auto");var k="scrollBehavior"in document.body.style;b.forEach(function(w){var p=w.el,y=w.top,f=w.left;p.scroll&&k?p.scroll({top:y,left:f,behavior:g}):(p.scrollTop=y,p.scrollLeft=f)})}function I(b){return b===!1?{block:"end",inline:"nearest"}:L(b)?b:{block:"start",inline:"nearest"}}function T(b,g){var k=!b.ownerDocument.documentElement.contains(b);if(L(g)&&typeof g.behavior=="function")return g.behavior(k?[]:O(b,g));if(k)return;var w=I(g);return U(O(b,w),w.behavior)}var P=Ne.a=T},"a+yL":function(at,Ne,F){at.exports={search:"search___t0h96",btn:"btn___t2oDx"}},aRTE:function(at,Ne){at.exports={L:1,M:0,Q:3,H:2}},bT9E:function(at,Ne,F){"use strict";F.d(Ne,"a",function(){return G});var q=F("VTBJ");function G(R,K){var O=Object(q.a)({},R);return Array.isArray(K)&&K.forEach(function(L){delete O[L]}),O}},c5Ni:function(at,Ne,F){},d5o6:function(at,Ne,F){at.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"}},dQei:function(at,Ne){for(var F={glog:function(G){if(G<1)throw new Error("glog("+G+")");return F.LOG_TABLE[G]},gexp:function(G){for(;G<0;)G+=255;for(;G>=256;)G-=255;return F.EXP_TABLE[G]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},q=0;q<8;q++)F.EXP_TABLE[q]=1<<q;for(var q=8;q<256;q++)F.EXP_TABLE[q]=F.EXP_TABLE[q-4]^F.EXP_TABLE[q-5]^F.EXP_TABLE[q-6]^F.EXP_TABLE[q-8];for(var q=0;q<255;q++)F.LOG_TABLE[F.EXP_TABLE[q]]=q;at.exports=F},dWSS:function(at,Ne,F){var q=F("dQei");function G(R,K){if(R.length==null)throw new Error(R.length+"/"+K);for(var O=0;O<R.length&&R[O]==0;)O++;this.num=new Array(R.length-O+K);for(var L=0;L<R.length-O;L++)this.num[L]=R[L+O]}G.prototype={get:function(R){return this.num[R]},getLength:function(){return this.num.length},multiply:function(R){for(var K=new Array(this.getLength()+R.getLength()-1),O=0;O<this.getLength();O++)for(var L=0;L<R.getLength();L++)K[O+L]^=q.gexp(q.glog(this.get(O))+q.glog(R.get(L)));return new G(K,0)},mod:function(R){if(this.getLength()-R.getLength()<0)return this;for(var K=q.glog(this.get(0))-q.glog(R.get(0)),O=new Array(this.getLength()),L=0;L<this.getLength();L++)O[L]=this.get(L);for(var L=0;L<R.getLength();L++)O[L]^=q.gexp(q.glog(R.get(L))+K);return new G(O,0).mod(R)}},at.exports=G},dejd:function(at,Ne,F){},dmUQ:function(at,Ne,F){"use strict";var q=F("Ff2n"),G=F("rePB"),R=F("1OyB"),K=F("vuIU"),O=F("Ji7U"),L=F("md7G"),U=F("foSv"),I=F("cDcd"),T=F.n(I),P=F("TSYQ"),b=F.n(P),g=F("4IlW");function k(a,i){var E=Object.keys(a);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(a);i&&(v=v.filter(function(_){return Object.getOwnPropertyDescriptor(a,_).enumerable})),E.push.apply(E,v)}return E}function w(a){for(var i=1;i<arguments.length;i++){var E=arguments[i]!=null?arguments[i]:{};i%2?k(Object(E),!0).forEach(function(v){Object(G.a)(a,v,E[v])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(E)):k(Object(E)).forEach(function(v){Object.defineProperty(a,v,Object.getOwnPropertyDescriptor(E,v))})}return a}function p(a){var i=y();return function(){var v=Object(U.a)(a),_;if(i){var D=Object(U.a)(this).constructor;_=Reflect.construct(v,arguments,D)}else _=v.apply(this,arguments);return Object(L.a)(this,_)}}function y(){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(a){return!1}}function f(){}function s(a){a.preventDefault()}var c=function(i){return i.replace(/[^\w.-]+/g,"")},d=200,S=600,C=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,m=function(i){return i!=null},A=function(i,E){return E===i||typeof E=="number"&&typeof i=="number"&&isNaN(E)&&isNaN(i)},x=function(a){Object(O.a)(E,a);var i=p(E);function E(v){var _;Object(R.a)(this,E),_=i.call(this,v),_.onKeyDown=function(j){var W=_.props,h=W.onKeyDown,N=W.onPressEnter;if(j.keyCode===g.a.UP){var H=_.getRatio(j);_.up(j,H,null),_.stop()}else if(j.keyCode===g.a.DOWN){var X=_.getRatio(j);_.down(j,X,null),_.stop()}else j.keyCode===g.a.ENTER&&N&&N(j);if(_.recordCursorPosition(),_.lastKeyCode=j.keyCode,h){for(var Y=arguments.length,re=new Array(Y>1?Y-1:0),he=1;he<Y;he++)re[he-1]=arguments[he];h.apply(void 0,[j].concat(re))}},_.onKeyUp=function(j){var W=_.props.onKeyUp;if(_.stop(),_.recordCursorPosition(),W){for(var h=arguments.length,N=new Array(h>1?h-1:0),H=1;H<h;H++)N[H-1]=arguments[H];W.apply(void 0,[j].concat(N))}},_.onChange=function(j){var W=_.props.onChange;_.state.focused&&(_.inputting=!0),_.rawInput=_.props.parser(_.getValueFromEvent(j)),_.setState({inputValue:_.rawInput}),W(_.toNumber(_.rawInput))},_.onMouseUp=function(){var j=_.props.onMouseUp;_.recordCursorPosition(),j&&j.apply(void 0,arguments)},_.onFocus=function(){var j;_.setState({focused:!0}),(j=_.props).onFocus.apply(j,arguments)},_.onBlur=function(){var j=_.props.onBlur;_.inputting=!1,_.setState({focused:!1});var W=_.getCurrentValidValue(_.state.inputValue),h=_.setValue(W,f);if(j){var N=_.input.value,H=_.getInputDisplayValue({focus:!1,value:h});_.input.value=H&&Number(H),j.apply(void 0,arguments),_.input.value=N}},_.getRatio=function(j){var W=1;return j.metaKey||j.ctrlKey?W=.1:j.shiftKey&&(W=10),W},_.getFullNum=function(j){return isNaN(j)?j:/e/i.test(String(j))?Number(j).toFixed(18).replace(/\.?0+$/,""):j},_.getPrecision=function(j){if(m(_.props.precision))return _.props.precision;var W=String(j);if(W.indexOf("e-")>=0)return parseInt(W.slice(W.indexOf("e-")+2),10);var h=0;return W.indexOf(".")>=0&&(h=W.length-W.indexOf(".")-1),h},_.getInputDisplayValue=function(j){var W=j||_.state,h=W.focused,N=W.inputValue,H=W.value,X;h?X=N:X=_.toPrecisionAsStep(H),X==null&&(X="");var Y=_.formatWrapper(X);return m(_.props.decimalSeparator)&&(Y=Y.toString().replace(".",_.props.decimalSeparator)),Y},_.recordCursorPosition=function(){try{_.cursorStart=_.input.selectionStart,_.cursorEnd=_.input.selectionEnd,_.currentValue=_.input.value,_.cursorBefore=_.input.value.substring(0,_.cursorStart),_.cursorAfter=_.input.value.substring(_.cursorEnd)}catch(j){}},_.restoreByAfter=function(j){if(j===void 0)return!1;var W=_.input.value,h=W.lastIndexOf(j);if(h===-1)return!1;var N=_.cursorBefore.length;return _.lastKeyCode===g.a.DELETE&&_.cursorBefore.charAt(N-1)===j[0]?(_.fixCaret(N,N),!0):h+j.length===W.length?(_.fixCaret(h,h),!0):!1},_.partRestoreByAfter=function(j){return j===void 0?!1:Array.prototype.some.call(j,function(W,h){var N=j.substring(h);return _.restoreByAfter(N)})},_.isNotCompleteNumber=function(j){return isNaN(j)||j===""||j===null||j&&j.toString().indexOf(".")===j.toString().length-1},_.stop=function(){_.autoStepTimer&&clearTimeout(_.autoStepTimer)},_.down=function(j,W,h){_.pressingUpOrDown=!0,_.step("down",j,W,h)},_.up=function(j,W,h){_.pressingUpOrDown=!0,_.step("up",j,W,h)},_.saveInput=function(j){_.input=j};var D=v.value;D===void 0&&(D=v.defaultValue),_.state={focused:v.autoFocus};var B=_.getValidValue(_.toNumber(D));return _.state=w(w({},_.state),{},{inputValue:_.toPrecisionAsStep(B),value:B}),_}return Object(K.a)(E,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(_){var D=this.props,B=D.value,j=D.onChange,W=D.max,h=D.min,N=this.state.focused;if(_){if(!A(_.value,B)||!A(_.max,W)||!A(_.min,h)){var H=N?B:this.getValidValue(B),X;this.pressingUpOrDown?X=H:this.inputting?X=this.rawInput:X=this.toPrecisionAsStep(H),this.setState({value:H,inputValue:X})}var Y="value"in this.props?B:this.state.value;"max"in this.props&&_.max!==W&&typeof Y=="number"&&Y>W&&j&&j(W),"min"in this.props&&_.min!==h&&typeof Y=="number"&&Y<h&&j&&j(h)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var re=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===g.a.BACKSPACE?re=this.cursorStart-1:this.lastKeyCode===g.a.DELETE&&(re=this.cursorStart):re=this.input.value.length,this.fixCaret(re,re)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case g.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case g.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(he){}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(_){var D=_;return D===""?D="":this.isNotCompleteNumber(parseFloat(D))?D=this.state.value:D=this.getValidValue(D),this.toNumber(D)}},{key:"getValueFromEvent",value:function(_){var D=_.target.value.trim().replace(/。/g,".");return m(this.props.decimalSeparator)&&(D=D.replace(this.props.decimalSeparator,".")),D}},{key:"getValidValue",value:function(_){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,B=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,j=parseFloat(_);return isNaN(j)?_:(j<D&&(j=D),j>B&&(j=B),j)}},{key:"setValue",value:function(_,D){var B=this.props.precision,j=this.isNotCompleteNumber(parseFloat(_))?null:parseFloat(_),W=this.state.value,h=W===void 0?null:W,N=this.state.inputValue,H=N===void 0?null:N,X=typeof j=="number"?j.toFixed(B):"".concat(j),Y=j!==h||X!=="".concat(H);return"value"in this.props?(H=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:H},D)):this.setState({value:j,inputValue:this.toPrecisionAsStep(_)},D),Y&&this.props.onChange(j),j}},{key:"getMaxPrecision",value:function(_){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,B=this.props,j=B.precision,W=B.step;if(m(j))return j;var h=this.getPrecision(D),N=this.getPrecision(W),H=this.getPrecision(_);return _?Math.max(H,h+N):h+N}},{key:"getPrecisionFactor",value:function(_){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,B=this.getMaxPrecision(_,D);return Math.pow(10,B)}},{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(_){return this.props.formatter?this.props.formatter(_):_}},{key:"toPrecisionAsStep",value:function(_){if(this.isNotCompleteNumber(_)||_==="")return _;var D=Math.abs(this.getMaxPrecision(_));return isNaN(D)?_.toString():Number(_).toFixed(D)}},{key:"toNumber",value:function(_){var D=this.props.precision,B=this.state.focused,j=_&&_.length>16&&B;return this.isNotCompleteNumber(_)||j?_:m(D)?Math.round(_*Math.pow(10,D))/Math.pow(10,D):Number(_)}},{key:"upStep",value:function(_,D){var B=this.props.step,j=this.getPrecisionFactor(_,D),W=Math.abs(this.getMaxPrecision(_,D)),h=((j*_+j*B*D)/j).toFixed(W);return this.toNumber(h)}},{key:"downStep",value:function(_,D){var B=this.props.step,j=this.getPrecisionFactor(_,D),W=Math.abs(this.getMaxPrecision(_,D)),h=((j*_-j*B*D)/j).toFixed(W);return this.toNumber(h)}},{key:"step",value:function(_,D){var B=this,j=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,W=arguments.length>3?arguments[3]:void 0;this.stop(),D&&(D.persist(),D.preventDefault());var h=this.props;if(h.disabled)return;var N=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(N))return;var H=this["".concat(_,"Step")](N,j),X=H>h.max||H<h.min;if(H>h.max?H=h.max:H<h.min&&(H=h.min),this.setValue(H,null),this.setState({focused:!0},function(){B.pressingUpOrDown=!1}),X)return;this.autoStepTimer=setTimeout(function(){B[_](D,j,!0)},W?d:S)}},{key:"fixCaret",value:function(_,D){if(_===void 0||D===void 0||!this.input||!this.input.value)return;try{var B=this.input.selectionStart,j=this.input.selectionEnd;(_!==B||D!==j)&&this.input.setSelectionRange(_,D)}catch(W){}}},{key:"render",value:function(){var _,D=this.props,B=D.prefixCls,j=D.disabled,W=D.readOnly,h=D.useTouch,N=D.autoComplete,H=D.upHandler,X=D.downHandler,Y=D.className,re=D.max,he=D.min,de=D.style,ne=D.title,ae=D.onMouseEnter,le=D.onMouseLeave,ee=D.onMouseOver,ie=D.onMouseOut,ve=D.required,Pe=D.onClick,Ie=D.tabIndex,we=D.type,ke=D.placeholder,De=D.id,Le=D.inputMode,Ve=D.pattern,ze=D.step,Je=D.maxLength,Ye=D.autoFocus,Ge=D.name,ht=D.onPaste,ot=D.onInput,st=Object(q.a)(D,["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,vt=qe.value,pt=qe.focused,gt=b()(B,(_={},Object(G.a)(_,Y,!!Y),Object(G.a)(_,"".concat(B,"-disabled"),j),Object(G.a)(_,"".concat(B,"-focused"),pt),_)),Be={};Object.keys(st).forEach(function(_e){(_e.substr(0,5)==="data-"||_e.substr(0,5)==="aria-"||_e==="role")&&(Be[_e]=st[_e])});var Ct=!W&&!j,yt=this.getInputDisplayValue(null),He=(vt||vt===0)&&(isNaN(vt)||Number(vt)>=re),rt=(vt||vt===0)&&(isNaN(vt)||Number(vt)<=he),me=He||j||W,se=rt||j||W,be=b()("".concat(B,"-handler"),"".concat(B,"-handler-up"),Object(G.a)({},"".concat(B,"-handler-up-disabled"),me)),te=b()("".concat(B,"-handler"),"".concat(B,"-handler-down"),Object(G.a)({},"".concat(B,"-handler-down-disabled"),se)),oe=h?{onTouchStart:me?f:this.up,onTouchEnd:this.stop}:{onMouseDown:me?f:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},ce=h?{onTouchStart:se?f:this.down,onTouchEnd:this.stop}:{onMouseDown:se?f:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return T.a.createElement("div",{className:gt,style:de,title:ne,onMouseEnter:ae,onMouseLeave:le,onMouseOver:ee,onMouseOut:ie,onFocus:function(){return null},onBlur:function(){return null}},T.a.createElement("div",{className:"".concat(B,"-handler-wrap")},T.a.createElement("span",Object.assign({unselectable:"on"},oe,{role:"button","aria-label":"Increase Value","aria-disabled":me,className:be}),H||T.a.createElement("span",{unselectable:"on",className:"".concat(B,"-handler-up-inner"),onClick:s})),T.a.createElement("span",Object.assign({unselectable:"on"},ce,{role:"button","aria-label":"Decrease Value","aria-disabled":se,className:te}),X||T.a.createElement("span",{unselectable:"on",className:"".concat(B,"-handler-down-inner"),onClick:s}))),T.a.createElement("div",{className:"".concat(B,"-input-wrap")},T.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":he,"aria-valuemax":re,"aria-valuenow":vt,required:ve,type:we,placeholder:ke,onPaste:ht,onClick:Pe,onMouseUp:this.onMouseUp,className:"".concat(B,"-input"),tabIndex:Ie,autoComplete:N,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:Ct?this.onKeyDown:f,onKeyUp:Ct?this.onKeyUp:f,autoFocus:Ye,maxLength:Je,readOnly:W,disabled:j,max:re,min:he,step:ze,name:Ge,title:ne,id:De,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(yt),pattern:Ve,inputMode:Le,onInput:ot},Be))))}}]),E}(T.a.Component);x.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:C,min:-C,step:1,style:{},onChange:f,onKeyDown:f,onPressEnter:f,onFocus:f,onBlur:f,parser:c,required:!1,autoComplete:"off"};var u=x,l=Ne.a=u},f4xo:function(at,Ne,F){var q=F("nVVt");function G(R){this.mode=q.MODE_8BIT_BYTE,this.data=R}G.prototype={getLength:function(R){return this.data.length},write:function(R){for(var K=0;K<this.data.length;K++)R.put(this.data.charCodeAt(K),8)}},at.exports=G},fAei:function(at,Ne,F){"use strict";F.d(Ne,"a",function(){return d.a});var q=F("rePB"),G=F("VTBJ"),R=F("KQm4"),K=F("1OyB"),O=F("vuIU"),L=F("Ji7U"),U=F("LK+K"),I=F("cDcd"),T=F("4IlW"),P=F("Kwbf"),b=F("TSYQ"),g=F.n(b),k=F("sboe"),w=F("OZM5"),p=F("815F"),y=F("ODXe"),f=F("Ff2n"),s=F("+nKL"),c=F("8XRh"),d=F("WaYH"),S=function(he,de){var ne=he.className,ae=he.style,le=he.motion,ee=he.motionNodes,ie=he.motionType,ve=he.onMotionStart,Pe=he.onMotionEnd,Ie=he.active,we=he.treeNodeRequiredProps,ke=Object(f.a)(he,["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"]),De=I.useState(!0),Le=Object(y.a)(De,2),Ve=Le[0],ze=Le[1],Je=I.useContext(k.a),Ye=Je.prefixCls,Ge=I.useRef(!1),ht=function(){Ge.current||Pe(),Ge.current=!0};return Object(I.useEffect)(function(){ee&&ie==="hide"&&Ve&&ze(!1)},[ee]),Object(I.useEffect)(function(){return ee&&ve(),function(){ee&&ht()}},[]),ee?I.createElement(c.default,Object.assign({ref:de,visible:Ve},le,{motionAppear:ie==="show",onAppearEnd:ht,onLeaveEnd:ht}),function(ot,st){var qe=ot.className,vt=ot.style;return I.createElement("div",{ref:st,className:g()("".concat(Ye,"-treenode-motion"),qe),style:vt},ee.map(function(pt){var gt=pt.data,Be=gt.key,Ct=Object(f.a)(gt,["key"]),yt=pt.isStart,He=pt.isEnd;delete Ct.children;var rt=Object(p.f)(Be,we);return I.createElement(d.a,Object.assign({},Ct,rt,{active:Ie,data:pt.data,key:Be,isStart:yt,isEnd:He}))}))}):I.createElement(d.a,Object.assign({domRef:de,className:ne,style:ae},ke,{active:Ie}))};S.displayName="MotionTreeNode";var C=I.forwardRef(S),m=C;function A(){var re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],he=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],de=re.length,ne=he.length;if(Math.abs(de-ne)!==1)return{add:!1,key:null};function ae(le,ee){var ie=new Map;le.forEach(function(Pe){ie.set(Pe,!0)});var ve=ee.filter(function(Pe){return!ie.has(Pe)});return ve.length===1?ve[0]:null}return de<ne?{add:!0,key:ae(re,he)}:{add:!1,key:ae(he,re)}}function x(re,he,de){var ne=re.findIndex(function(ie){var ve=ie.data;return ve.key===de}),ae=re[ne+1],le=he.findIndex(function(ie){var ve=ie.data;return ve.key===de});if(ae){var ee=he.findIndex(function(ie){var ve=ie.data;return ve.key===ae.data.key});return he.slice(le+1,ee)}return he.slice(le+1)}var u={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},l=function(){},a="RC_TREE_MOTION_".concat(Math.random()),i={key:a},E={key:a,level:0,index:0,pos:"0",node:i},v={parent:null,children:[],pos:E.pos,data:i,isStart:[],isEnd:[]};function _(re,he,de,ne){return he===!1||!de?re:re.slice(0,Math.ceil(de/ne)+1)}function D(re){var he=re.data.key,de=re.pos;return Object(p.e)(he,de)}function B(re){for(var he=String(re.data.key),de=re;de.parent;)de=de.parent,he="".concat(de.data.key," > ").concat(he);return he}var j=function(he,de){var ne=he.prefixCls,ae=he.data,le=he.selectable,ee=he.checkable,ie=he.expandedKeys,ve=he.selectedKeys,Pe=he.checkedKeys,Ie=he.loadedKeys,we=he.loadingKeys,ke=he.halfCheckedKeys,De=he.keyEntities,Le=he.disabled,Ve=he.dragging,ze=he.dragOverNodeKey,Je=he.dropPosition,Ye=he.motion,Ge=he.height,ht=he.itemHeight,ot=he.virtual,st=he.focusable,qe=he.activeItem,vt=he.focused,pt=he.tabIndex,gt=he.onKeyDown,Be=he.onFocus,Ct=he.onBlur,yt=he.onActiveChange,He=he.onListChangeStart,rt=he.onListChangeEnd,me=Object(f.a)(he,["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=I.useRef(null);I.useImperativeHandle(de,function(){return{scrollTo:function(Da){se.current.scrollTo(Da)}}});var be=I.useState(ie),te=Object(y.a)(be,2),oe=te[0],ce=te[1],_e=I.useState(ae),je=Object(y.a)(_e,2),Xe=je[0],Ze=je[1],_t=I.useState(ae),It=Object(y.a)(_t,2),$e=It[0],Qt=It[1],Bt=I.useState([]),Pt=Object(y.a)(Bt,2),mn=Pt[0],xn=Pt[1],er=I.useState(null),Qn=Object(y.a)(er,2),nn=Qn[0],ur=Qn[1];function hr(){Ze(ae),Qt(ae),xn([]),ur(null),rt()}I.useEffect(function(){ce(ie);var mr=A(oe,ie);if(mr.key!==null)if(mr.add){var Da=Xe.findIndex(function(ra){var Ua=ra.data.key;return Ua===mr.key}),Rr=_(x(Xe,ae,mr.key),ot,Ge,ht),fa=Xe.slice();fa.splice(Da+1,0,v),Qt(fa),xn(Rr),ur("show")}else{var tr=ae.findIndex(function(ra){var Ua=ra.data.key;return Ua===mr.key}),dr=_(x(ae,Xe,mr.key),ot,Ge,ht),Ut=ae.slice();Ut.splice(tr+1,0,v),Qt(Ut),xn(dr),ur("hide")}else Xe!==ae&&(Ze(ae),Qt(ae))},[ie,ae]),I.useEffect(function(){Ve||hr()},[Ve]);var vr=Ye?$e:ae,ca={expandedKeys:ie,selectedKeys:ve,loadedKeys:Ie,loadingKeys:we,checkedKeys:Pe,halfCheckedKeys:ke,dragOverNodeKey:ze,dropPosition:Je,keyEntities:De};return I.createElement(I.Fragment,null,vt&&qe&&I.createElement("span",{style:u,"aria-live":"assertive"},B(qe)),I.createElement("div",{role:"tree"},I.createElement("input",{style:u,disabled:st===!1||Le,tabIndex:st!==!1?pt:null,onKeyDown:gt,onFocus:Be,onBlur:Ct,value:"",onChange:l})),I.createElement(s.a,Object.assign({},me,{data:vr,itemKey:D,height:Ge,fullHeight:!1,virtual:ot,itemHeight:ht,prefixCls:"".concat(ne,"-list"),ref:se}),function(mr){var Da=mr.pos,Rr=mr.data,fa=Rr.key,tr=Object(f.a)(Rr,["key"]),dr=mr.isStart,Ut=mr.isEnd,ra=Object(p.e)(fa,Da);delete tr.children;var Ua=Object(p.f)(ra,ca);return I.createElement(m,Object.assign({},tr,Ua,{active:qe&&fa===qe.data.key,pos:Da,data:mr.data,isStart:dr,isEnd:Ut,motion:Ye,motionNodes:fa===a?mn:null,motionType:nn,onMotionStart:He,onMotionEnd:hr,treeNodeRequiredProps:ca,onMouseMove:function(){yt(null)}}))}))},W=I.forwardRef(j);W.displayName="NodeList";var h=W,N=F("NvD2"),H=function(re){Object(L.a)(de,re);var he=Object(U.a)(de);function de(){var ne;return Object(K.a)(this,de),ne=he.apply(this,arguments),ne.destroyed=!1,ne.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},ne.listRef=I.createRef(),ne.onNodeDragStart=function(ae,le){var ee=ne.state,ie=ee.expandedKeys,ve=ee.keyEntities,Pe=ne.props.onDragStart,Ie=le.props.eventKey;ne.dragNode=le;var we=Object(w.b)(ie,Ie);ne.setState({dragging:!0,dragNodesKeys:Object(w.g)(Ie,ve)}),ne.setExpandedKeys(we),Pe&&Pe({event:ae,node:Object(p.b)(le.props)})},ne.onNodeDragEnter=function(ae,le){var ee=ne.state,ie=ee.expandedKeys,ve=ee.keyEntities,Pe=ee.dragNodesKeys,Ie=ne.props.onDragEnter,we=le.props,ke=we.pos,De=we.eventKey;if(!ne.dragNode||Pe.indexOf(De)!==-1)return;var Le=Object(w.c)(ae,le);if(ne.dragNode.props.eventKey===De&&Le===0){ne.setState({dragOverNodeKey:"",dropPosition:null});return}setTimeout(function(){ne.setState({dragOverNodeKey:De,dropPosition:Le}),ne.delayedDragEnterLogic||(ne.delayedDragEnterLogic={}),Object.keys(ne.delayedDragEnterLogic).forEach(function(Ve){clearTimeout(ne.delayedDragEnterLogic[Ve])}),ne.delayedDragEnterLogic[ke]=window.setTimeout(function(){if(!ne.state.dragging)return;var Ve=Object(R.a)(ie),ze=ve[De];ze&&(ze.children||[]).length&&(Ve=Object(w.a)(ie,De)),"expandedKeys"in ne.props||ne.setExpandedKeys(Ve),Ie&&Ie({event:ae,node:Object(p.b)(le.props),expandedKeys:Ve})},400)},0)},ne.onNodeDragOver=function(ae,le){var ee=ne.state.dragNodesKeys,ie=ne.props.onDragOver,ve=le.props.eventKey;if(ee.indexOf(ve)!==-1)return;if(ne.dragNode&&ve===ne.state.dragOverNodeKey){var Pe=Object(w.c)(ae,le);if(Pe===ne.state.dropPosition)return;ne.setState({dropPosition:Pe})}ie&&ie({event:ae,node:Object(p.b)(le.props)})},ne.onNodeDragLeave=function(ae,le){var ee=ne.props.onDragLeave;ne.setState({dragOverNodeKey:""}),ee&&ee({event:ae,node:Object(p.b)(le.props)})},ne.onNodeDragEnd=function(ae,le){var ee=ne.props.onDragEnd;ne.setState({dragOverNodeKey:""}),ne.cleanDragState(),ee&&ee({event:ae,node:Object(p.b)(le.props)}),ne.dragNode=null},ne.onNodeDrop=function(ae,le){var ee=ne.state,ie=ee.dragNodesKeys,ve=ie===void 0?[]:ie,Pe=ee.dropPosition,Ie=ne.props.onDrop,we=le.props,ke=we.eventKey,De=we.pos;if(ne.setState({dragOverNodeKey:""}),ne.cleanDragState(),ve.indexOf(ke)!==-1){Object(P.a)(!1,"Can not drop to dragNode(include it's children node)");return}var Le=Object(w.k)(De),Ve={event:ae,node:Object(p.b)(le.props),dragNode:ne.dragNode?Object(p.b)(ne.dragNode.props):null,dragNodesKeys:ve.slice(),dropPosition:Pe+Number(Le[Le.length-1]),dropToGap:!1};Pe!==0&&(Ve.dropToGap=!0),Ie&&Ie(Ve),ne.dragNode=null},ne.cleanDragState=function(){var ae=ne.state.dragging;ae&&ne.setState({dragging:!1})},ne.onNodeClick=function(ae,le){var ee=ne.props.onClick;ee&&ee(ae,le)},ne.onNodeDoubleClick=function(ae,le){var ee=ne.props.onDoubleClick;ee&&ee(ae,le)},ne.onNodeSelect=function(ae,le){var ee=ne.state.selectedKeys,ie=ne.state.keyEntities,ve=ne.props,Pe=ve.onSelect,Ie=ve.multiple,we=le.selected,ke=le.key,De=!we;De?Ie?ee=Object(w.a)(ee,ke):ee=[ke]:ee=Object(w.b)(ee,ke);var Le=ee.map(function(Ve){var ze=ie[Ve];return ze?ze.node:null}).filter(function(Ve){return Ve});ne.setUncontrolledState({selectedKeys:ee}),Pe&&Pe(ee,{event:"select",selected:De,node:le,selectedNodes:Le,nativeEvent:ae.nativeEvent})},ne.onNodeCheck=function(ae,le,ee){var ie=ne.state,ve=ie.keyEntities,Pe=ie.checkedKeys,Ie=ie.halfCheckedKeys,we=ne.props,ke=we.checkStrictly,De=we.onCheck,Le=le.key,Ve,ze={event:"check",node:le,checked:ee,nativeEvent:ae.nativeEvent};if(ke){var Je=ee?Object(w.a)(Pe,Le):Object(w.b)(Pe,Le),Ye=Object(w.b)(Ie,Le);Ve={checked:Je,halfChecked:Ye},ze.checkedNodes=Je.map(function(vt){return ve[vt]}).filter(function(vt){return vt}).map(function(vt){return vt.node}),ne.setUncontrolledState({checkedKeys:Je})}else{var Ge=Object(N.a)([].concat(Object(R.a)(Pe),[Le]),!0,ve),ht=Ge.checkedKeys,ot=Ge.halfCheckedKeys;if(!ee){var st=new Set(ht);st.delete(Le);var qe=Object(N.a)(Array.from(st),{checked:!1,halfCheckedKeys:ot},ve);ht=qe.checkedKeys,ot=qe.halfCheckedKeys}Ve=ht,ze.checkedNodes=[],ze.checkedNodesPositions=[],ze.halfCheckedKeys=ot,ht.forEach(function(vt){var pt=ve[vt];if(!pt)return;var gt=pt.node,Be=pt.pos;ze.checkedNodes.push(gt),ze.checkedNodesPositions.push({node:gt,pos:Be})}),ne.setUncontrolledState({checkedKeys:ht},!1,{halfCheckedKeys:ot})}De&&De(Ve,ze)},ne.onNodeLoad=function(ae){return new Promise(function(le){ne.setState(function(ee){var ie=ee.loadedKeys,ve=ie===void 0?[]:ie,Pe=ee.loadingKeys,Ie=Pe===void 0?[]:Pe,we=ne.props,ke=we.loadData,De=we.onLoad,Le=ae.key;if(!ke||ve.indexOf(Le)!==-1||Ie.indexOf(Le)!==-1)return{};var Ve=ke(ae);return Ve.then(function(){var ze=ne.state,Je=ze.loadedKeys,Ye=ze.loadingKeys,Ge=Object(w.a)(Je,Le),ht=Object(w.b)(Ye,Le);De&&De(Ge,{event:"load",node:ae}),ne.setUncontrolledState({loadedKeys:Ge}),ne.setState({loadingKeys:ht}),le()}),{loadingKeys:Object(w.a)(Ie,Le)}})})},ne.onNodeMouseEnter=function(ae,le){var ee=ne.props.onMouseEnter;ee&&ee({event:ae,node:le})},ne.onNodeMouseLeave=function(ae,le){var ee=ne.props.onMouseLeave;ee&&ee({event:ae,node:le})},ne.onNodeContextMenu=function(ae,le){var ee=ne.props.onRightClick;ee&&(ae.preventDefault(),ee({event:ae,node:le}))},ne.onFocus=function(){var ae=ne.props.onFocus;ne.setState({focused:!0}),ae&&ae.apply(void 0,arguments)},ne.onBlur=function(){var ae=ne.props.onBlur;ne.setState({focused:!1}),ne.onActiveChange(null),ae&&ae.apply(void 0,arguments)},ne.getTreeNodeRequiredProps=function(){var ae=ne.state,le=ae.expandedKeys,ee=ae.selectedKeys,ie=ae.loadedKeys,ve=ae.loadingKeys,Pe=ae.checkedKeys,Ie=ae.halfCheckedKeys,we=ae.dragOverNodeKey,ke=ae.dropPosition,De=ae.keyEntities;return{expandedKeys:le||[],selectedKeys:ee||[],loadedKeys:ie||[],loadingKeys:ve||[],checkedKeys:Pe||[],halfCheckedKeys:Ie||[],dragOverNodeKey:we,dropPosition:ke,keyEntities:De}},ne.setExpandedKeys=function(ae){var le=ne.state.treeData,ee=Object(p.d)(le,ae);ne.setUncontrolledState({expandedKeys:ae,flattenNodes:ee},!0)},ne.onNodeExpand=function(ae,le){var ee=ne.state.expandedKeys,ie=ne.state.listChanging,ve=ne.props,Pe=ve.onExpand,Ie=ve.loadData,we=le.key,ke=le.expanded;if(ie)return;var De=ee.indexOf(we),Le=!ke;if(Object(P.a)(ke&&De!==-1||!ke&&De===-1,"Expand state not sync with index check"),Le?ee=Object(w.a)(ee,we):ee=Object(w.b)(ee,we),ne.setExpandedKeys(ee),Pe&&Pe(ee,{node:le,expanded:Le,nativeEvent:ae.nativeEvent}),Le&&Ie){var Ve=ne.onNodeLoad(le);Ve&&Ve.then(function(){var ze=Object(p.d)(ne.state.treeData,ee);ne.setUncontrolledState({flattenNodes:ze})})}},ne.onListChangeStart=function(){ne.setUncontrolledState({listChanging:!0})},ne.onListChangeEnd=function(){setTimeout(function(){ne.setUncontrolledState({listChanging:!1})})},ne.onActiveChange=function(ae){var le=ne.state.activeKey,ee=ne.props.onActiveChange;if(le===ae)return;ne.setState({activeKey:ae}),ae!==null&&ne.scrollTo({key:ae}),ee&&ee(ae)},ne.getActiveItem=function(){var ae=ne.state,le=ae.activeKey,ee=ae.flattenNodes;return le===null?null:ee.find(function(ie){var ve=ie.data.key;return ve===le})||null},ne.offsetActiveKey=function(ae){var le=ne.state,ee=le.flattenNodes,ie=le.activeKey,ve=ee.findIndex(function(we){var ke=we.data.key;return ke===ie});ve===-1&&ae<0&&(ve=ee.length),ve=(ve+ae+ee.length)%ee.length;var Pe=ee[ve];if(Pe){var Ie=Pe.data.key;ne.onActiveChange(Ie)}else ne.onActiveChange(null)},ne.onKeyDown=function(ae){var le=ne.state,ee=le.activeKey,ie=le.expandedKeys,ve=le.checkedKeys,Pe=ne.props,Ie=Pe.onKeyDown,we=Pe.checkable,ke=Pe.selectable;switch(ae.which){case T.a.UP:{ne.offsetActiveKey(-1),ae.preventDefault();break}case T.a.DOWN:{ne.offsetActiveKey(1),ae.preventDefault();break}}var De=ne.getActiveItem();if(De&&De.data){var Le=ne.getTreeNodeRequiredProps(),Ve=De.data.isLeaf===!1||!!(De.data.children||[]).length,ze=Object(p.b)(Object(G.a)(Object(G.a)({},Object(p.f)(ee,Le)),{},{data:De.data,active:!0}));switch(ae.which){case T.a.LEFT:{Ve&&ie.includes(ee)?ne.onNodeExpand({},ze):De.parent&&ne.onActiveChange(De.parent.data.key),ae.preventDefault();break}case T.a.RIGHT:{Ve&&!ie.includes(ee)?ne.onNodeExpand({},ze):De.children&&De.children.length&&ne.onActiveChange(De.children[0].data.key),ae.preventDefault();break}case T.a.ENTER:case T.a.SPACE:{we&&!ze.disabled&&ze.checkable!==!1&&!ze.disableCheckbox?ne.onNodeCheck({},ze,!ve.includes(ee)):!we&&ke&&!ze.disabled&&ze.selectable!==!1&&ne.onNodeSelect({},ze);break}}}Ie&&Ie(ae)},ne.setUncontrolledState=function(ae){var le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ee=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(ne.destroyed)return;var ie=!1,ve=!0,Pe={};Object.keys(ae).forEach(function(Ie){if(Ie in ne.props){ve=!1;return}ie=!0,Pe[Ie]=ae[Ie]}),ie&&(!le||ve)&&ne.setState(Object(G.a)(Object(G.a)({},Pe),ee))},ne.scrollTo=function(ae){ne.listRef.current.scrollTo(ae)},ne}return Object(O.a)(de,[{key:"componentWillUnmount",value:function(){this.destroyed=!0}},{key:"render",value:function(){var ae,le=this.state,ee=le.focused,ie=le.flattenNodes,ve=le.keyEntities,Pe=le.dragging,Ie=le.activeKey,we=this.props,ke=we.prefixCls,De=we.className,Le=we.style,Ve=we.showLine,ze=we.focusable,Je=we.tabIndex,Ye=Je===void 0?0:Je,Ge=we.selectable,ht=we.showIcon,ot=we.icon,st=we.switcherIcon,qe=we.draggable,vt=we.checkable,pt=we.checkStrictly,gt=we.disabled,Be=we.motion,Ct=we.loadData,yt=we.filterTreeNode,He=we.height,rt=we.itemHeight,me=we.virtual,se=we.titleRender,be=we.onContextMenu,te=Object(w.f)(this.props);return I.createElement(k.a.Provider,{value:{prefixCls:ke,selectable:Ge,showIcon:ht,icon:ot,switcherIcon:st,draggable:qe,checkable:vt,checkStrictly:pt,disabled:gt,keyEntities:ve,loadData:Ct,filterTreeNode:yt,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}},I.createElement("div",{className:g()(ke,De,(ae={},Object(q.a)(ae,"".concat(ke,"-show-line"),Ve),Object(q.a)(ae,"".concat(ke,"-focused"),ee),Object(q.a)(ae,"".concat(ke,"-active-focused"),Ie!==null),ae))},I.createElement(h,Object.assign({ref:this.listRef,prefixCls:ke,style:Le,data:ie,disabled:gt,selectable:Ge,checkable:!!vt,motion:Be,dragging:Pe,height:He,itemHeight:rt,virtual:me,focusable:ze,focused:ee,tabIndex:Ye,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:be},this.getTreeNodeRequiredProps(),te))))}}],[{key:"getDerivedStateFromProps",value:function(ae,le){var ee=le.prevProps,ie={prevProps:ae};function ve(ot){return!ee&&ot in ae||ee&&ee[ot]!==ae[ot]}var Pe;if(ve("treeData")?Pe=ae.treeData:ve("children")&&(Object(P.a)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),Pe=Object(p.c)(ae.children)),Pe){ie.treeData=Pe;var Ie=Object(p.a)(Pe);ie.keyEntities=Object(G.a)(Object(q.a)({},a,E),Ie.keyEntities)}var we=ie.keyEntities||le.keyEntities;if(ve("expandedKeys")||ee&&ve("autoExpandParent"))ie.expandedKeys=ae.autoExpandParent||!ee&&ae.defaultExpandParent?Object(w.e)(ae.expandedKeys,we):ae.expandedKeys;else if(!ee&&ae.defaultExpandAll){var ke=Object(G.a)({},we);delete ke[a],ie.expandedKeys=Object.keys(ke).map(function(ot){return ke[ot].key})}else!ee&&ae.defaultExpandedKeys&&(ie.expandedKeys=ae.autoExpandParent||ae.defaultExpandParent?Object(w.e)(ae.defaultExpandedKeys,we):ae.defaultExpandedKeys);if(ie.expandedKeys||delete ie.expandedKeys,Pe||ie.expandedKeys){var De=Object(p.d)(Pe||le.treeData,ie.expandedKeys||le.expandedKeys);ie.flattenNodes=De}if(ae.selectable&&(ve("selectedKeys")?ie.selectedKeys=Object(w.d)(ae.selectedKeys,ae):!ee&&ae.defaultSelectedKeys&&(ie.selectedKeys=Object(w.d)(ae.defaultSelectedKeys,ae))),ae.checkable){var Le;if(ve("checkedKeys")?Le=Object(w.j)(ae.checkedKeys)||{}:!ee&&ae.defaultCheckedKeys?Le=Object(w.j)(ae.defaultCheckedKeys)||{}:Pe&&(Le=Object(w.j)(ae.checkedKeys)||{checkedKeys:le.checkedKeys,halfCheckedKeys:le.halfCheckedKeys}),Le){var Ve=Le,ze=Ve.checkedKeys,Je=ze===void 0?[]:ze,Ye=Ve.halfCheckedKeys,Ge=Ye===void 0?[]:Ye;if(!ae.checkStrictly){var ht=Object(N.a)(Je,!0,we);Je=ht.checkedKeys,Ge=ht.halfCheckedKeys}ie.checkedKeys=Je,ie.halfCheckedKeys=Ge}}return ve("loadedKeys")&&(ie.loadedKeys=ae.loadedKeys),ie}}]),de}(I.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=d.a;var X=H,Y=Ne.b=X},fcSX:function(at,Ne,F){"use strict";var q=F("Ff2n"),G=F("1OyB"),R=F("vuIU"),K=F("Ji7U"),O=F("md7G"),L=F("foSv"),U=F("1W/9"),I=F("cDcd"),T=F("rePB"),P=F("JX7q"),b=F("TSYQ"),g=F.n(b),k=F("qx4F"),w=F("4IlW");function p(j){return Array.isArray(j)?j:[j]}var y={transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend"},f=Object.keys(y).filter(function(j){if(typeof document=="undefined")return!1;var W=document.getElementsByTagName("html")[0];return j in(W?W.style:{})})[0],s=y[f];function c(j,W,h,N){j.addEventListener?j.addEventListener(W,h,N):j.attachEvent&&j.attachEvent("on".concat(W),h)}function d(j,W,h,N){j.removeEventListener?j.removeEventListener(W,h,N):j.attachEvent&&j.detachEvent("on".concat(W),h)}function S(j,W){var h=typeof j=="function"?j(W):j;return Array.isArray(h)?h.length===2?h:[h[0],h[1]]:[h]}var C=function(W){return!isNaN(parseFloat(W))&&isFinite(W)},m=!(typeof window!="undefined"&&window.document&&window.document.createElement),A=function j(W,h,N,H){if(!h||h===document||h instanceof Document)return!1;if(h===W.parentNode)return!0;var X=Math.max(Math.abs(N),Math.abs(H))===Math.abs(H),Y=Math.max(Math.abs(N),Math.abs(H))===Math.abs(N),re=h.scrollHeight-h.clientHeight,he=h.scrollWidth-h.clientWidth,de=document.defaultView.getComputedStyle(h),ne=de.overflowY==="auto"||de.overflowY==="scroll",ae=de.overflowX==="auto"||de.overflowX==="scroll",le=re&&ne,ee=he&&ae;return X&&(!le||le&&(h.scrollTop>=re&&H<0||h.scrollTop<=0&&H>0))||Y&&(!ee||ee&&(h.scrollLeft>=he&&N<0||h.scrollLeft<=0&&N>0))?j(W,h.parentNode,N,H):!1};function x(j){var W=u();return function(){var N=Object(L.a)(j),H;if(W){var X=Object(L.a)(this).constructor;H=Reflect.construct(N,arguments,X)}else H=N.apply(this,arguments);return Object(O.a)(this,H)}}function u(){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(j){return!1}}var l={},a=function(j){Object(K.a)(h,j);var W=x(h);function h(N){var H;return Object(G.a)(this,h),H=W.call(this,N),H.domFocus=function(){H.dom&&H.dom.focus()},H.removeStartHandler=function(X){if(X.touches.length>1)return;H.startPos={x:X.touches[0].clientX,y:X.touches[0].clientY}},H.removeMoveHandler=function(X){if(X.changedTouches.length>1)return;var Y=X.currentTarget,re=X.changedTouches[0].clientX-H.startPos.x,he=X.changedTouches[0].clientY-H.startPos.y;(Y===H.maskDom||Y===H.handlerDom||Y===H.contentDom&&A(Y,X.target,re,he))&&X.cancelable&&X.preventDefault()},H.transitionEnd=function(X){var Y=X.target;d(Y,s,H.transitionEnd),Y.style.transition=""},H.onKeyDown=function(X){if(X.keyCode===w.a.ESC){var Y=H.props.onClose;X.stopPropagation(),Y&&Y(X)}},H.onWrapperTransitionEnd=function(X){var Y=H.props,re=Y.open,he=Y.afterVisibleChange;X.target===H.contentWrapper&&X.propertyName.match(/transform$/)&&(H.dom.style.transition="",!re&&H.getCurrentDrawerSome()&&(document.body.style.overflowX="",H.maskDom&&(H.maskDom.style.left="",H.maskDom.style.width="")),he&&he(!!re))},H.openLevelTransition=function(){var X=H.props,Y=X.open,re=X.width,he=X.height,de=H.getHorizontalBoolAndPlacementName(),ne=de.isHorizontal,ae=de.placementName,le=H.contentDom?H.contentDom.getBoundingClientRect()[ne?"width":"height"]:0,ee=(ne?re:he)||le;H.setLevelAndScrolling(Y,ae,ee)},H.setLevelTransform=function(X,Y,re,he){var de=H.props,ne=de.placement,ae=de.levelMove,le=de.duration,ee=de.ease,ie=de.showMask;H.levelDom.forEach(function(ve){ve.style.transition="transform ".concat(le," ").concat(ee),c(ve,s,H.transitionEnd);var Pe=X?re:0;if(ae){var Ie=S(ae,{target:ve,open:X});Pe=X?Ie[0]:Ie[1]||0}var we=typeof Pe=="number"?"".concat(Pe,"px"):Pe,ke=ne==="left"||ne==="top"?we:"-".concat(we);ke=ie&&ne==="right"&&he?"calc(".concat(ke," + ").concat(he,"px)"):ke,ve.style.transform=Pe?"".concat(Y,"(").concat(ke,")"):""})},H.setLevelAndScrolling=function(X,Y,re){var he=H.props.onChange;if(!m){var de=document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth?Object(k.a)(!0):0;H.setLevelTransform(X,Y,re,de),H.toggleScrollingToDrawerAndBody(de)}he&&he(X)},H.toggleScrollingToDrawerAndBody=function(X){var Y=H.props,re=Y.getOpenCount,he=Y.getContainer,de=Y.showMask,ne=Y.open,ae=he&&he(),le=re&&re();if(ae&&ae.parentNode===document.body&&de){var ee=["touchstart"],ie=[document.body,H.maskDom,H.handlerDom,H.contentDom];ne&&document.body.style.overflow!=="hidden"?(X&&H.addScrollingEffect(X),le===1&&(document.body.style.overflow="hidden"),document.body.style.touchAction="none",ie.forEach(function(ve,Pe){if(!ve)return;c(ve,ee[Pe]||"touchmove",Pe?H.removeMoveHandler:H.removeStartHandler,H.passive)})):H.getCurrentDrawerSome()&&(le||(document.body.style.overflow=""),document.body.style.touchAction="",X&&H.remScrollingEffect(X),ie.forEach(function(ve,Pe){if(!ve)return;d(ve,ee[Pe]||"touchmove",Pe?H.removeMoveHandler:H.removeStartHandler,H.passive)}))}},H.addScrollingEffect=function(X){var Y=H.props,re=Y.placement,he=Y.duration,de=Y.ease,ne=Y.getOpenCount,ae=Y.switchScrollingEffect,le=ne&&ne();le===1&&ae();var ee="width ".concat(he," ").concat(de),ie="transform ".concat(he," ").concat(de);H.dom.style.transition="none";switch(re){case"right":H.dom.style.transform="translateX(-".concat(X,"px)");break;case"top":case"bottom":H.dom.style.width="calc(100% - ".concat(X,"px)"),H.dom.style.transform="translateZ(0)";break;default:break}clearTimeout(H.timeout),H.timeout=setTimeout(function(){H.dom&&(H.dom.style.transition="".concat(ie,",").concat(ee),H.dom.style.width="",H.dom.style.transform="")})},H.remScrollingEffect=function(X){var Y=H.props,re=Y.placement,he=Y.duration,de=Y.ease,ne=Y.getOpenCount,ae=Y.switchScrollingEffect,le=ne&&ne();le||ae(!0),f&&(document.body.style.overflowX="hidden"),H.dom.style.transition="none";var ee,ie="width ".concat(he," ").concat(de),ve="transform ".concat(he," ").concat(de);switch(re){case"left":{H.dom.style.width="100%",ie="width 0s ".concat(de," ").concat(he);break}case"right":{H.dom.style.transform="translateX(".concat(X,"px)"),H.dom.style.width="100%",ie="width 0s ".concat(de," ").concat(he),H.maskDom&&(H.maskDom.style.left="-".concat(X,"px"),H.maskDom.style.width="calc(100% + ".concat(X,"px)"));break}case"top":case"bottom":{H.dom.style.width="calc(100% + ".concat(X,"px)"),H.dom.style.height="100%",H.dom.style.transform="translateZ(0)",ee="height 0s ".concat(de," ").concat(he);break}default:break}clearTimeout(H.timeout),H.timeout=setTimeout(function(){H.dom&&(H.dom.style.transition="".concat(ve,",").concat(ee?"".concat(ee,","):"").concat(ie),H.dom.style.transform="",H.dom.style.width="",H.dom.style.height="")})},H.getCurrentDrawerSome=function(){return!Object.keys(l).some(function(X){return l[X]})},H.getLevelDom=function(X){var Y=X.level,re=X.getContainer;if(m)return;var he=re&&re(),de=he?he.parentNode:null;if(H.levelDom=[],Y==="all"){var ne=de?Array.prototype.slice.call(de.children):[];ne.forEach(function(ae){ae.nodeName!=="SCRIPT"&&ae.nodeName!=="STYLE"&&ae.nodeName!=="LINK"&&ae!==he&&H.levelDom.push(ae)})}else Y&&p(Y).forEach(function(ae){document.querySelectorAll(ae).forEach(function(le){H.levelDom.push(le)})})},H.getHorizontalBoolAndPlacementName=function(){var X=H.props.placement,Y=X==="left"||X==="right",re="translate".concat(Y?"X":"Y");return{isHorizontal:Y,placementName:re}},H.state={_self:Object(P.a)(H)},H}return Object(R.a)(h,[{key:"componentDidMount",value:function(){var H=this;if(!m){var X=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){return X=!0,null}}))}catch(ne){}this.passive=X?{passive:!1}:!1}var Y=this.props,re=Y.open,he=Y.getContainer,de=he&&he();this.drawerId="drawer_id_".concat(Number((Date.now()+Math.random()).toString().replace(".",Math.round(Math.random()*9).toString())).toString(16)),this.getLevelDom(this.props),re&&(de&&de.parentNode===document.body&&(l[this.drawerId]=re),this.openLevelTransition(),this.forceUpdate(function(){H.domFocus()}))}},{key:"componentDidUpdate",value:function(H){var X=this.props,Y=X.open,re=X.getContainer,he=re&&re();Y!==H.open&&(Y&&this.domFocus(),he&&he.parentNode===document.body&&(l[this.drawerId]=!!Y),this.openLevelTransition())}},{key:"componentWillUnmount",value:function(){var H=this.props,X=H.getOpenCount,Y=H.open,re=H.switchScrollingEffect,he=typeof X=="function"&&X();delete l[this.drawerId],Y&&(this.setLevelTransform(!1),document.body.style.touchAction=""),he||(document.body.style.overflow="",re(!0))}},{key:"render",value:function(){var H,X=this,Y=this.props,re=Y.className,he=Y.children,de=Y.style,ne=Y.width,ae=Y.height,le=Y.defaultOpen,ee=Y.open,ie=Y.prefixCls,ve=Y.placement,Pe=Y.level,Ie=Y.levelMove,we=Y.ease,ke=Y.duration,De=Y.getContainer,Le=Y.handler,Ve=Y.onChange,ze=Y.afterVisibleChange,Je=Y.showMask,Ye=Y.maskClosable,Ge=Y.maskStyle,ht=Y.onClose,ot=Y.onHandleClick,st=Y.keyboard,qe=Y.getOpenCount,vt=Y.switchScrollingEffect,pt=Object(q.a)(Y,["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"]),gt=this.dom?ee:!1,Be=g()(ie,(H={},Object(T.a)(H,"".concat(ie,"-").concat(ve),!0),Object(T.a)(H,"".concat(ie,"-open"),gt),Object(T.a)(H,re||"",!!re),Object(T.a)(H,"no-mask",!Je),H)),Ct=this.getHorizontalBoolAndPlacementName(),yt=Ct.placementName,He=ve==="left"||ve==="top"?"-100%":"100%",rt=gt?"":"".concat(yt,"(").concat(He,")"),me=Le&&I.cloneElement(Le,{onClick:function(be){Le.props.onClick&&Le.props.onClick(),ot&&ot(be)},ref:function(be){X.handlerDom=be}});return I.createElement("div",Object.assign({},pt,{tabIndex:-1,className:Be,style:de,ref:function(be){X.dom=be},onKeyDown:gt&&st?this.onKeyDown:void 0,onTransitionEnd:this.onWrapperTransitionEnd}),Je&&I.createElement("div",{className:"".concat(ie,"-mask"),onClick:Ye?ht:void 0,style:Ge,ref:function(be){X.maskDom=be}}),I.createElement("div",{className:"".concat(ie,"-content-wrapper"),style:{transform:rt,msTransform:rt,width:C(ne)?"".concat(ne,"px"):ne,height:C(ae)?"".concat(ae,"px"):ae},ref:function(be){X.contentWrapper=be}},I.createElement("div",{className:"".concat(ie,"-content"),ref:function(be){X.contentDom=be},onTouchStart:gt&&Je?this.removeStartHandler:void 0,onTouchMove:gt&&Je?this.removeMoveHandler:void 0},he),me))}}],[{key:"getDerivedStateFromProps",value:function(H,X){var Y=X.prevProps,re=X._self,he={prevProps:H};if(Y!==void 0){var de=H.placement,ne=H.level;de!==Y.placement&&(re.contentDom=null),ne!==Y.level&&re.getLevelDom(H)}return he}}]),h}(I.Component);a.defaultProps={switchScrollingEffect:function(){}};var i=a;function E(j){var W=v();return function(){var N=Object(L.a)(j),H;if(W){var X=Object(L.a)(this).constructor;H=Reflect.construct(N,arguments,X)}else H=N.apply(this,arguments);return Object(O.a)(this,H)}}function v(){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(j){return!1}}var _=function(j){Object(K.a)(h,j);var W=E(h);function h(N){var H;Object(G.a)(this,h),H=W.call(this,N),H.onHandleClick=function(Y){var re=H.props,he=re.onHandleClick,de=re.open;if(he&&he(Y),typeof de=="undefined"){var ne=H.state.open;H.setState({open:!ne})}},H.onClose=function(Y){var re=H.props,he=re.onClose,de=re.open;he&&he(Y),typeof de=="undefined"&&H.setState({open:!1})};var X=typeof N.open!="undefined"?N.open:!!N.defaultOpen;return H.state={open:X},"onMaskClick"in N&&console.warn("`onMaskClick` are removed, please use `onClose` instead."),H}return Object(R.a)(h,[{key:"render",value:function(){var H=this,X=this.props,Y=X.defaultOpen,re=X.getContainer,he=X.wrapperClassName,de=X.forceRender,ne=X.handler,ae=Object(q.a)(X,["defaultOpen","getContainer","wrapperClassName","forceRender","handler"]),le=this.state.open;if(!re)return I.createElement("div",{className:he,ref:function(ve){H.dom=ve}},I.createElement(i,Object.assign({},ae,{open:le,handler:ne,getContainer:function(){return H.dom},onClose:this.onClose,onHandleClick:this.onHandleClick})));var ee=!!ne||de;return I.createElement(U.a,{visible:le,forceRender:ee,getContainer:re,wrapperClassName:he},function(ie){var ve=ie.visible,Pe=ie.afterClose,Ie=Object(q.a)(ie,["visible","afterClose"]);return I.createElement(i,Object.assign({},ae,Ie,{open:ve!==void 0?ve:le,afterVisibleChange:Pe!==void 0?Pe:ae.afterVisibleChange,handler:ne,onClose:H.onClose,onHandleClick:H.onHandleClick}))})}}],[{key:"getDerivedStateFromProps",value:function(H,X){var Y=X.prevProps,re={prevProps:H};return typeof Y!="undefined"&&H.open!==Y.open&&(re.open=H.open),re}}]),h}(I.Component);_.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:I.createElement("div",{className:"drawer-handle"},I.createElement("i",{className:"drawer-handle-icon"})),showMask:!0,maskClosable:!0,maskStyle:{},wrapperClassName:"",className:"",keyboard:!0,forceRender:!1};var D=_,B=Ne.a=D},i8i3:function(at,Ne,F){at.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(at,Ne,F){at.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"}},iris:function(at,Ne,F){"use strict";F.d(Ne,"a",function(){return k});var q=F("qVdP"),G=F("jsC+"),R=F("lUTK"),K=F("BvKs"),O=F("tJVT"),L=F("cDcd"),U=F.n(L),I=F("Q0Vu"),T=F.n(I),P=[{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"}],b=[{name:"\u7B80\u5355",value:1},{name:"\u9002\u4E2D",value:2},{name:"\u56F0\u96BE",value:3}],g=[{name:"\u968F\u673A\u7EC4\u5377",value:1},{name:"\u4EBA\u5DE5\u7EC4\u5377",value:2}],k=function(p){var y=p.showSelectAll,f=y===void 0?!1:y,s=p.disciplinesData,c=s===void 0?[]:s,d=p.knowledgeData,S=d===void 0?[]:d,C=p.directionValue,m=p.subDisciplineValue,A=p.typeValue,x=p.knowledgeValue,u=p.showKnowledge,l=u===void 0?!1:u,a=p.showRandomType,i=a===void 0?!1:a,E=p.difficultyValue,v=p.randomValue,_=p.selectAll,D=p.languagesvalue,B=p.className,j=p.languages,W=j===void 0?[]:j,h=p.isprogram_homework,N=p.showShixun,H=N===void 0?!1:N,X=p.showItemType,Y=X===void 0?!0:X,re=p.onShixunChange,he=re===void 0?function(){}:re,de=p.onDirectionChange,ne=de===void 0?function(){}:de,ae=p.onTypeChange,le=ae===void 0?function(){}:ae,ee=p.onDifficultyChange,ie=ee===void 0?function(){}:ee,ve=p.handlelanguagesChange,Pe=ve===void 0?function(){}:ve,Ie=p.onKnowledgeChange,we=Ie===void 0?function(){}:Ie,ke=p.onRandomChange,De=ke===void 0?function(){}:ke,Le=p.showTeachGroup,Ve=Le===void 0?!1:Le,ze=p.teachGroupData,Je=ze===void 0?[]:ze,Ye=p.onTeachGroupChange,Ge=Ye===void 0?function(){}:Ye,ht=p.teachGroupValue,ot=Object(L.useState)(0),st=Object(O.a)(ot,2),qe=st[0],vt=st[1],pt=Object(L.useRef)(null),gt=Object(L.useState)(0),Be=Object(O.a)(gt,2),Ct=Be[0],yt=Be[1],He=Object(L.useRef)(null);Object(L.useEffect)(function(){if(c.length!==0){var me;(pt==null||((me=pt.current)===null||me===void 0)?void 0:me.clientHeight)>108?vt(1):vt(0)}c.length===0&&vt(0)},[c]),Object(L.useEffect)(function(){if(console.log(S.length===0,"\u6570\u91CF"),S.length!==0){var me,se;console.log(He==null||((me=He.current)===null||me===void 0)?void 0:me.clientHeight,"\u9AD8\u5EA6"),(He==null||((se=He.current)===null||se===void 0)?void 0:se.clientHeight)>108?yt(1):yt(0)}S.length===0&&yt(0)},[S]);var rt=function(){var se=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],be=arguments.length>1?arguments[1]:void 0;return U.a.createElement(K.a,{className:T.a.subMenu},se.map(function(te){return U.a.createElement(K.a.Item,{key:te.id},U.a.createElement("a",{className:"".concat(T.a.subItem," ").concat(m===te.id?T.a.subActive:""),onClick:function(){return ne(be,te.id)}},te.name))}))};return U.a.createElement("aside",{className:B?"".concat(T.a.main," ").concat(B):T.a.main},U.a.createElement("div",{className:T.a.wrap},h&&U.a.createElement("div",{className:T.a.programName},"\u8BD5\u9898\u5E93-\u7F16\u7A0B\u9898"),Ve&&U.a.createElement("div",{className:T.a.content},U.a.createElement("span",{className:T.a.name},"\u56E2\u961F"),U.a.createElement("div",{className:T.a.directionContentWrap},U.a.createElement("li",{className:"".concat(T.a.directionItem," ").concat(ht?"":T.a.active," "),onClick:function(){return Ge(null)}},"\u5168\u90E8"),Je==null?void 0:Je.map(function(me){return U.a.createElement("li",{key:me.group_id,className:"".concat(T.a.directionItem," ").concat(ht===me.group_id?T.a.active:""," "),onClick:function(){return Ge(me.group_id)}},me.name)}))),U.a.createElement("div",{className:T.a.content},U.a.createElement("span",{className:T.a.name},"\u65B9\u5411"),U.a.createElement("span",null),U.a.createElement("div",{className:T.a.directionContentWrap,style:{overflow:"hidden",height:qe===1?88:"auto"}},U.a.createElement("li",{className:"".concat(T.a.directionItem," ").concat(C?"":T.a.active," "),onClick:function(){return ne(null)}},"\u5168\u90E8"),c.map(function(me){var se;return U.a.createElement(U.a.Fragment,{key:me.id},((se=me.sub_disciplines)===null||se===void 0?void 0:se.length)>0?U.a.createElement(G.a,{placement:"bottomLeft",overlayStyle:{width:600},getPopupContainer:function(te){return te.parentNode},overlay:function(){return rt(me.sub_disciplines,me.id)}},U.a.createElement("li",{className:"".concat(T.a.directionItem," ").concat(C===me.id?T.a.active:""," "),onClick:function(){return ne(me.id)}},me.name)):U.a.createElement("li",{className:"".concat(T.a.directionItem," ").concat(C===me.id?T.a.active:""," "),onClick:function(){return ne(me.id)}},me.name))})),U.a.createElement("div",{className:T.a.directionContentWrap,ref:pt,style:{height:"auto",position:"fixed",left:0,top:0,width:1024,visibility:"hidden"}},c.map(function(me){var se;return U.a.createElement(U.a.Fragment,{key:me.id},((se=me.sub_disciplines)===null||se===void 0?void 0:se.length)>0?U.a.createElement(G.a,{placement:"bottomLeft",overlayStyle:{width:600},getPopupContainer:function(te){return te.parentNode},overlay:function(){return rt(me.sub_disciplines,me.id)}},U.a.createElement("li",{className:"".concat(T.a.directionItem," ").concat(C===me.id?T.a.active:""," "),onClick:function(){return ne(me.id)}},me.name)):U.a.createElement("li",{className:"".concat(T.a.directionItem," ").concat(C===me.id?T.a.active:""," "),onClick:function(){return ne(me.id)}},me.name))})),!!qe&&U.a.createElement("div",{className:T.a.action},qe===1&&U.a.createElement("span",{onClick:function(){return vt(2)}},"\u5C55\u5F00",U.a.createElement("i",{className:"iconfont icon-xiala"})),qe===2&&U.a.createElement("span",{onClick:function(){return vt(1)}},"\u6536\u8D77",U.a.createElement("i",{style:{transform:"scale(0.5) rotate(180deg) translateY(2px)"},className:"iconfont icon-xiala"})))),l&&U.a.createElement("div",{className:T.a.content},U.a.createElement("span",{className:T.a.name},"\u77E5\u8BC6\u70B9"),U.a.createElement("div",{className:T.a.directionContentWrap,style:{overflow:"hidden",height:Ct===1?106:"auto"}},U.a.createElement("li",{className:"".concat(T.a.directionItem," ").concat(x===-1?T.a.active:""," "),onClick:function(){return we(-1)}},"\u5168\u90E8"),S.map(function(me){return U.a.createElement("li",{key:me.id,className:"".concat(T.a.directionItem," ").concat(x===me.id?T.a.active:""," "),onClick:function(){return we(me.id)}},me.name)})),U.a.createElement("div",{ref:He,className:T.a.directionContentWrap,style:{height:"auto",position:"fixed",left:0,top:0,width:1010,visibility:"hidden"}},S.map(function(me){return U.a.createElement("li",{key:me.id,className:"".concat(T.a.directionItem," ").concat(x===me.id?T.a.active:""," "),onClick:function(){return we(me.id)}},me.name)})),!!Ct&&U.a.createElement("div",{className:T.a.action},Ct===1&&U.a.createElement("span",{onClick:function(){return yt(2)}},"\u5C55\u5F00",U.a.createElement("i",{className:"iconfont icon-xiala"})),Ct===2&&U.a.createElement("span",{onClick:function(){return yt(1)}},"\u6536\u8D77",U.a.createElement("i",{style:{transform:"scale(0.5) rotate(180deg) translateY(2px)"},className:"iconfont icon-xiala"})))),Y&&!h&&U.a.createElement("div",{className:T.a.content},U.a.createElement("span",{className:T.a.name},"\u9898\u578B"),U.a.createElement("li",{className:"".concat(T.a.directionItem," ").concat(A?"":T.a.active," "),onClick:function(){return le(null)}},"\u5168\u90E8"),U.a.createElement("div",{className:T.a.directionContentWrap},P.map(function(me){return U.a.createElement("li",{key:me.name,className:"".concat(T.a.directionItem," ").concat(A===me.value?T.a.active:""," "),onClick:function(){return le(me.value)}},me.name)}),H&&U.a.createElement("li",{key:"\u5B9E\u8BAD\u9898",className:T.a.directionItem,onClick:function(){return he()}},"\u5B9E\u8BAD\u9898"))),U.a.createElement("div",{className:T.a.content},U.a.createElement("span",{className:T.a.name},"\u96BE\u5EA6"),U.a.createElement("li",{className:"".concat(T.a.directionItem," ").concat(E?"":T.a.active," "),onClick:function(){return ie(null)}},"\u5168\u90E8"),U.a.createElement("div",{className:T.a.directionContentWrap},b.map(function(me){return U.a.createElement("li",{key:me.name,className:"".concat(T.a.directionItem," ").concat(E===me.value?T.a.active:""," "),onClick:function(){return ie(me.value)}},me.name)}))),i&&U.a.createElement("div",{className:T.a.content},U.a.createElement("span",{className:T.a.name},"\u7C7B\u578B"),U.a.createElement("li",{className:"".concat(T.a.directionItem," ").concat(v?"":T.a.active," "),onClick:function(){return De(null)}},"\u5168\u90E8"),U.a.createElement("div",{className:T.a.directionContentWrap},g.map(function(me){return U.a.createElement("li",{key:me.name,className:"".concat(T.a.directionItem," ").concat(v===me.value?T.a.active:""," "),onClick:function(){return De(me.value)}},me.name)})))))}},jcZT:function(at,Ne,F){"use strict";var q=F("2qtc"),G=F("kLXV"),R=F("5NDa"),K=F("5rEg"),O=F("miYZ"),L=F("tsqr"),U=F("9og8"),I=F("tJVT"),T=F("WmNS"),P=F.n(T),b=F("cDcd"),g=F.n(b),k=F("d5o6"),w=F.n(k),p=F("P/tu"),y=F("WCUW"),f=F("9kvl"),s=function(d){var S=d.problemset,C=d.dispatch,m=d.onOk,A=Object(b.useState)(""),x=Object(I.a)(A,2),u=x[0],l=x[1],a=Object(b.useState)([0]),i=Object(I.a)(a,2),E=i[0],v=i[1],_=function(){C({type:"problemset/setActionTabs",payload:{}})};Object(b.useEffect)(function(){if(S.actionTabs.key==="\u65B0\u5EFA\u6587\u4EF6\u5939"){var B,j;v([(B=S.actionTabs)===null||B===void 0||((j=B.params)===null||j===void 0)?void 0:j.group_id]),l("")}},[S.actionTabs.key]);var D=function(){var B=Object(U.a)(P.a.mark(function j(){var W,h,N;return P.a.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:if(W=["\uFF1F","\u3001","/","\u2572","*","<",">","|"],u.trim()){X.next=4;break}return L.b.warn("\u8BF7\u8F93\u5165\u6587\u4EF6\u5939\u540D\u79F0"),X.abrupt("return");case 4:if(!(u.charAt(0)===" ")){X.next=7;break}return L.b.warn("\u9996\u5B57\u7B26\u4E0D\u80FD\u4E3A\u7A7A\u683C"),X.abrupt("return");case 7:h=0;case 8:if(!(h<u.length)){X.next=15;break}if(!W.includes(u.charAt(h))){X.next=12;break}return L.b.warn("\u6587\u4EF6\u5939\u540D\u79F0\u5305\u542B\u7279\u6B8A\u5B57\u7B26"),X.abrupt("return",!1);case 12:h++,X.next=8;break;case 15:return X.next=17,Object(y.p)({parent_id:E.length>0?E[0]:0,name:u});case 17:N=X.sent,N.status===0&&(_(),m(N==null?void 0:N.id));case 19:case"end":return X.stop()}},j)}));return function(){return B.apply(this,arguments)}}();return g.a.createElement(G.a,{centered:!0,title:"\u65B0\u5EFA\u6587\u4EF6\u5939",visible:S.actionTabs.key==="\u65B0\u5EFA\u6587\u4EF6\u5939",width:500,onCancel:_,onOk:D,destroyOnClose:!0},g.a.createElement("div",{className:w.a.addModal},g.a.createElement("div",{className:w.a.row},g.a.createElement("span",{className:w.a.label},"\u6587\u4EF6\u5939\u540D\u79F0: "),g.a.createElement(K.a,{placeholder:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5939\u540D\u79F0",value:u,onChange:function(j){return l(j.target.value)}})),g.a.createElement("div",{className:w.a.row,style:{alignItems:"start",maxHeight:500,overflow:"auto"}},g.a.createElement("span",{className:w.a.label},"\u6587\u4EF6\u5939\u4F4D\u7F6E: "),g.a.createElement(p.a,{value:E,onChange:function(j){return v(j)}}))))};Ne.a=Object(f.a)(function(c){var d=c.problemset;return{problemset:d}})(s)},k3GJ:function(at,Ne,F){"use strict";F.d(Ne,"a",function(){return ao});var q=F("rePB"),G=F("ODXe"),R=F("Ff2n"),K=F("VTBJ"),O=F("cDcd"),L=F("TSYQ"),U=F.n(L),I=F("Zm9Q"),T=F("6cGi"),P=F("KQm4"),b=F("xEkU"),g=F.n(b),k=F("t23M");function w(fe){var Te=Object(O.useRef)(),Oe=Object(O.useRef)(!1);function ge(){for(var Z=arguments.length,ue=new Array(Z),$=0;$<Z;$++)ue[$]=arguments[$];Oe.current||(g.a.cancel(Te.current),Te.current=g()(function(){fe.apply(void 0,ue)}))}return Object(O.useEffect)(function(){return function(){Oe.current=!0,g.a.cancel(Te.current)}},[]),ge}function p(fe){var Te=Object(O.useRef)([]),Oe=Object(O.useState)({}),ge=Object(G.a)(Oe,2),Z=ge[1],ue=Object(O.useRef)(typeof fe=="function"?fe():fe),$=w(function(){var Ee=ue.current;Te.current.forEach(function(Se){Ee=Se(Ee)}),Te.current=[],ue.current=Ee,Z({})});function pe(Ee){Te.current.push(Ee),$()}return[ue.current,pe]}var y=F("4IlW");function f(fe,Te){var Oe,ge=fe.prefixCls,Z=fe.id,ue=fe.active,$=fe.rtl,pe=fe.tab,Ee=pe.key,Se=pe.tab,xe=pe.disabled,Re=pe.closeIcon,Qe=fe.tabBarGutter,mt=fe.tabPosition,ft=fe.closable,At=fe.renderWrapper,on=fe.removeAriaLabel,On=fe.editable,gn=fe.onClick,_n=fe.onRemove,Sn=fe.onFocus,yn="".concat(ge,"-tab");O.useEffect(function(){return _n},[]);var An={};mt==="top"||mt==="bottom"?An[$?"marginLeft":"marginRight"]=Qe:An.marginBottom=Qe;var zn=On&&ft!==!1&&!xe;function Ln(Vt){if(xe)return;gn(Vt)}function xr(Vt){Vt.preventDefault(),Vt.stopPropagation(),On.onEdit("remove",{key:Ee,event:Vt})}var kn=O.createElement("div",{key:Ee,ref:Te,className:U()(yn,(Oe={},Object(q.a)(Oe,"".concat(yn,"-with-remove"),zn),Object(q.a)(Oe,"".concat(yn,"-active"),ue),Object(q.a)(Oe,"".concat(yn,"-disabled"),xe),Oe)),style:An,onClick:Ln},O.createElement("div",{role:"tab","aria-selected":ue,id:Z&&"".concat(Z,"-tab-").concat(Ee),className:"".concat(yn,"-btn"),"aria-controls":Z&&"".concat(Z,"-panel-").concat(Ee),"aria-disabled":xe,tabIndex:xe?null:0,onClick:function(qt){qt.stopPropagation(),Ln(qt)},onKeyDown:function(qt){[y.a.SPACE,y.a.ENTER].includes(qt.which)&&(qt.preventDefault(),Ln(qt))},onFocus:Sn},Se),zn&&O.createElement("button",{type:"button","aria-label":on||"remove",tabIndex:0,className:"".concat(yn,"-remove"),onClick:function(qt){qt.stopPropagation(),xr(qt)}},Re||On.removeIcon||"\xD7"));return At&&(kn=At(kn)),kn}var s=O.forwardRef(f),c={width:0,height:0,left:0,top:0};function d(fe,Te,Oe){return Object(O.useMemo)(function(){for(var ge,Z=new Map,ue=Te.get((ge=fe[0])===null||ge===void 0?void 0:ge.key)||c,$=ue.left+ue.width,pe=0;pe<fe.length;pe+=1){var Ee=fe[pe].key,Se=Te.get(Ee);if(!Se){var xe;Se=Te.get((xe=fe[pe-1])===null||xe===void 0?void 0:xe.key)||c}var Re=Z.get(Ee)||Object(K.a)({},Se);Re.right=$-Re.left-Re.width,Z.set(Ee,Re)}return Z},[fe.map(function(ge){return ge.key}).join("_"),Te,Oe])}var S={width:0,height:0,left:0,top:0,right:0};function C(fe,Te,Oe,ge,Z){var ue=Z.tabs,$=Z.tabPosition,pe=Z.rtl,Ee,Se,xe;["top","bottom"].includes($)?(Ee="width",Se=pe?"right":"left",xe=Math.abs(Te.left)):(Ee="height",Se="top",xe=-Te.top);var Re=Te[Ee],Qe=Oe[Ee],mt=ge[Ee],ft=Re;return Qe+mt>Re&&(ft=Re-mt),Object(O.useMemo)(function(){if(!ue.length)return[0,0];for(var At=ue.length,on=At,On=0;On<At;On+=1){var gn=fe.get(ue[On].key)||S;if(gn[Se]+gn[Ee]>xe+ft){on=On-1;break}}for(var _n=0,Sn=At-1;Sn>=0;Sn-=1){var yn=fe.get(ue[Sn].key)||S;if(yn[Se]<xe){_n=Sn+1;break}}return[_n,on]},[fe,xe,ft,$,ue.map(function(At){return At.key}).join("_"),pe])}var m=F("wx14"),A=F("1OyB"),x=F("vuIU"),u=F("JX7q"),l=F("Ji7U"),a=F("LK+K"),i=F("I8Z2"),E=F("bT9E"),v=F("2GS6"),_=F("Gytx"),D=F.n(_),B=F("U8pU"),j=/iPhone/i,W=/iPod/i,h=/iPad/i,N=/\bAndroid(?:.+)Mobile\b/i,H=/Android/i,X=/\bAndroid(?:.+)SD4930UR\b/i,Y=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,re=/Windows Phone/i,he=/\bWindows(?:.+)ARM\b/i,de=/BlackBerry/i,ne=/BB10/i,ae=/Opera Mini/i,le=/\b(CriOS|Chrome)(?:.+)Mobile/i,ee=/Mobile(?:.+)Firefox\b/i;function ie(fe,Te){return fe.test(Te)}function ve(fe){var Te=fe||(typeof navigator!="undefined"?navigator.userAgent:""),Oe=(Te||"").split("[FBAN");if(typeof Oe[1]!="undefined"){var ge=Oe,Z=Object(G.a)(ge,1);Te=Z[0]}if(Oe=Te.split("Twitter"),typeof Oe[1]!="undefined"){var ue=Oe,$=Object(G.a)(ue,1);Te=$[0]}var pe={apple:{phone:ie(j,Te)&&!ie(re,Te),ipod:ie(W,Te),tablet:!ie(j,Te)&&ie(h,Te)&&!ie(re,Te),device:(ie(j,Te)||ie(W,Te)||ie(h,Te))&&!ie(re,Te)},amazon:{phone:ie(X,Te),tablet:!ie(X,Te)&&ie(Y,Te),device:ie(X,Te)||ie(Y,Te)},android:{phone:!ie(re,Te)&&ie(X,Te)||!ie(re,Te)&&ie(N,Te),tablet:!ie(re,Te)&&!ie(X,Te)&&!ie(N,Te)&&(ie(Y,Te)||ie(H,Te)),device:!ie(re,Te)&&(ie(X,Te)||ie(Y,Te)||ie(N,Te)||ie(H,Te))||ie(/\bokhttp\b/i,Te)},windows:{phone:ie(re,Te),tablet:ie(he,Te),device:ie(re,Te)||ie(he,Te)},other:{blackberry:ie(de,Te),blackberry10:ie(ne,Te),opera:ie(ae,Te),firefox:ie(ee,Te),chrome:ie(le,Te),device:ie(de,Te)||ie(ne,Te)||ie(ae,Te)||ie(ee,Te)||ie(le,Te)},any:null,phone:null,tablet:null};return pe.any=pe.apple.device||pe.android.device||pe.windows.device||pe.other.device,pe.phone=pe.apple.phone||pe.android.phone||pe.windows.phone,pe.tablet=pe.apple.tablet||pe.android.tablet||pe.windows.tablet,pe}var Pe=Object(K.a)(Object(K.a)({},ve()),{},{isMobile:ve}),Ie=Pe;function we(){}function ke(fe,Te,Oe){var ge=Te||"";return fe.key||"".concat(ge,"item_").concat(Oe)}function De(fe){return"".concat(fe,"-menu-")}function Le(fe,Te){var Oe=-1;O.Children.forEach(fe,function(ge){Oe+=1,ge&&ge.type&&ge.type.isMenuItemGroup?O.Children.forEach(ge.props.children,function(Z){Oe+=1,Te(Z,Oe)}):Te(ge,Oe)})}function Ve(fe,Te,Oe){if(!fe||Oe.find)return;O.Children.forEach(fe,function(ge){if(ge){var Z=ge.type;if(!Z||!(Z.isSubMenu||Z.isMenuItem||Z.isMenuItemGroup))return;Te.indexOf(ge.key)!==-1?Oe.find=!0:ge.props.children&&Ve(ge.props.children,Te,Oe)}})}var ze=["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"],Je=function(Te){var Oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ge=Te&&typeof Te.getBoundingClientRect=="function"&&Te.getBoundingClientRect().width;if(ge){if(Oe){var Z=getComputedStyle(Te),ue=Z.marginLeft,$=Z.marginRight;ge+=+ue.replace("px","")+ +$.replace("px","")}ge=+ge.toFixed(6)}return ge||0},Ye=function(Te,Oe,ge){Te&&Object(B.a)(Te.style)==="object"&&(Te.style[Oe]=ge)},Ge=function(){return Ie.any},ht=F("bdgK"),ot=F("faye"),st=F.n(ot),qe=F("wgJM"),vt=F("l4aY"),pt=F("m+aA"),gt=F("c+Xe"),Be=F("zT1h"),Ct=F("QC+M");function yt(fe,Te,Oe){return Oe?fe[0]===Te[0]:fe[0]===Te[0]&&fe[1]===Te[1]}function He(fe,Te,Oe){var ge=fe[Te]||{};return Object(K.a)(Object(K.a)({},ge),Oe)}function rt(fe,Te,Oe,ge){for(var Z=Oe.points,ue=Object.keys(fe),$=0;$<ue.length;$+=1){var pe=ue[$];if(yt(fe[pe].points,Z,ge))return"".concat(Te,"-placement-").concat(pe)}return""}var me=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var fe=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(fe)||/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(fe==null?void 0:fe.substr(0,4)))},se=F("MNnm");function be(fe,Te){var Oe={};return Oe[fe.toLowerCase()]=Te.toLowerCase(),Oe["Webkit".concat(fe)]="webkit".concat(Te),Oe["Moz".concat(fe)]="moz".concat(Te),Oe["ms".concat(fe)]="MS".concat(Te),Oe["O".concat(fe)]="o".concat(Te.toLowerCase()),Oe}function te(fe,Te){var Oe={animationend:be("Animation","AnimationEnd"),transitionend:be("Transition","TransitionEnd")};return fe&&("AnimationEvent"in Te||delete Oe.animationend.animation,"TransitionEvent"in Te||delete Oe.transitionend.transition),Oe}var oe=te(Object(se.a)(),typeof window!="undefined"?window:{}),ce={};if(Object(se.a)()){var _e=document.createElement("div");ce=_e.style}var je={};function Xe(fe){if(je[fe])return je[fe];var Te=oe[fe];if(Te)for(var Oe=Object.keys(Te),ge=Oe.length,Z=0;Z<ge;Z+=1){var ue=Oe[Z];if(Object.prototype.hasOwnProperty.call(Te,ue)&&ue in ce)return je[fe]=Te[ue],je[fe]}return""}var Ze=Xe("animationend"),_t=Xe("transitionend"),It=!!(Ze&&_t),$e=Ze||"animationend",Qt=_t||"transitionend";function Bt(fe,Te){if(!fe)return null;if(Object(B.a)(fe)==="object"){var Oe=Te.replace(/-\w/g,function(ge){return ge[1].toUpperCase()});return fe[Oe]}return"".concat(fe,"-").concat(Te)}var Pt="none",mn="appear",xn="enter",er="leave",Qn="none",nn="prepare",ur="start",hr="active",vr="end";function ca(fe){var Te=Object(O.useRef)(!1),Oe=Object(O.useState)(fe),ge=Object(G.a)(Oe,2),Z=ge[0],ue=ge[1];function $(pe){Te.current||ue(pe)}return Object(O.useEffect)(function(){return function(){Te.current=!0}},[]),[Z,$]}var mr=Object(se.a)()?O.useLayoutEffect:O.useEffect,Da=mr,Rr=function(){var fe=O.useRef(null);function Te(){qe.a.cancel(fe.current)}function Oe(ge){var Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;Te();var ue=Object(qe.a)(function(){Z<=1?ge({isCanceled:function(){return ue!==fe.current}}):Oe(ge,Z-1)});fe.current=ue}return O.useEffect(function(){return function(){Te()}},[]),[Oe,Te]},fa=[nn,ur,hr,vr],tr=!1,dr=!0;function Ut(fe){return fe===hr||fe===vr}var ra=function(fe,Te){var Oe=O.useState(Qn),ge=Object(G.a)(Oe,2),Z=ge[0],ue=ge[1],$=Rr(),pe=Object(G.a)($,2),Ee=pe[0],Se=pe[1];function xe(){ue(nn)}return Da(function(){if(Z!==Qn&&Z!==vr){var Re=fa.indexOf(Z),Qe=fa[Re+1],mt=Te(Z);mt===tr?ue(Qe):Ee(function(ft){function At(){if(ft.isCanceled())return;ue(Qe)}mt===!0?At():Promise.resolve(mt).then(At)})}},[fe,Z]),O.useEffect(function(){return function(){Se()}},[]),[xe,Z]},Ua=function(fe){var Te=Object(O.useRef)(),Oe=Object(O.useRef)(fe);Oe.current=fe;var ge=O.useCallback(function($){Oe.current($)},[]);function Z($){$&&($.removeEventListener(Qt,ge),$.removeEventListener($e,ge))}function ue($){Te.current&&Te.current!==$&&Z(Te.current),$&&$!==Te.current&&($.addEventListener(Qt,ge),$.addEventListener($e,ge),Te.current=$)}return O.useEffect(function(){return function(){Z(Te.current)}},[]),[ue,Z]};function Hr(fe,Te,Oe,ge){var Z=ge.motionEnter,ue=Z===void 0?!0:Z,$=ge.motionAppear,pe=$===void 0?!0:$,Ee=ge.motionLeave,Se=Ee===void 0?!0:Ee,xe=ge.motionDeadline,Re=ge.motionLeaveImmediately,Qe=ge.onAppearPrepare,mt=ge.onEnterPrepare,ft=ge.onLeavePrepare,At=ge.onAppearStart,on=ge.onEnterStart,On=ge.onLeaveStart,gn=ge.onAppearActive,_n=ge.onEnterActive,Sn=ge.onLeaveActive,yn=ge.onAppearEnd,An=ge.onEnterEnd,zn=ge.onLeaveEnd,Ln=ge.onVisibleChanged,xr=ca(),kn=Object(G.a)(xr,2),Vt=kn[0],qt=kn[1],In=ca(Pt),Wn=Object(G.a)(In,2),zt=Wn[0],Dn=Wn[1],Cr=ca(null),Xn=Object(G.a)(Cr,2),fr=Xn[0],ir=Xn[1],jr=Object(O.useRef)(!1),Yr=Object(O.useRef)(null),Tr=Object(O.useRef)(!1),sa=Object(O.useRef)(null);function Ea(){var or=Oe();return or||sa.current}var ma=Object(O.useRef)(!1);function Gr(or){var qn=Ea();if(or&&!or.deadline&&or.target!==qn)return;var $r;zt===mn&&ma.current?$r=yn==null?void 0:yn(qn,or):zt===xn&&ma.current?$r=An==null?void 0:An(qn,or):zt===er&&ma.current&&($r=zn==null?void 0:zn(qn,or)),$r!==!1&&!Tr.current&&(Dn(Pt),ir(null))}var en=Ua(Gr),Yn=Object(G.a)(en,1),wr=Yn[0],Er=O.useMemo(function(){var or,qn,$r;switch(zt){case"appear":return or={},Object(q.a)(or,nn,Qe),Object(q.a)(or,ur,At),Object(q.a)(or,hr,gn),or;case"enter":return qn={},Object(q.a)(qn,nn,mt),Object(q.a)(qn,ur,on),Object(q.a)(qn,hr,_n),qn;case"leave":return $r={},Object(q.a)($r,nn,ft),Object(q.a)($r,ur,On),Object(q.a)($r,hr,Sn),$r;default:return{}}},[zt]),Ra=ra(zt,function(or){if(or===nn){var qn=Er[nn];return qn?qn(Ea()):tr}if(sr in Er){var $r;ir((($r=Er[sr])===null||$r===void 0?void 0:$r.call(Er,Ea(),null))||null)}return sr===hr&&(wr(Ea()),xe>0&&(clearTimeout(Yr.current),Yr.current=setTimeout(function(){Gr({deadline:!0})},xe))),dr}),qa=Object(G.a)(Ra,2),ei=qa[0],sr=qa[1],Fa=Ut(sr);ma.current=Fa,Da(function(){qt(Te);var or=jr.current;if(jr.current=!0,!fe)return;var qn;!or&&Te&&pe&&(qn=mn),or&&Te&&ue&&(qn=xn),(or&&!Te&&Se||!or&&Re&&!Te&&Se)&&(qn=er),qn&&(Dn(qn),ei())},[Te]),Object(O.useEffect)(function(){(zt===mn&&!pe||zt===xn&&!ue||zt===er&&!Se)&&Dn(Pt)},[pe,ue,Se]),Object(O.useEffect)(function(){return function(){clearTimeout(Yr.current),Tr.current=!0}},[]),Object(O.useEffect)(function(){Vt!==void 0&&zt===Pt&&(Ln==null||Ln(Vt))},[Vt,zt]);var Ga=fr;return Er[nn]&&sr===ur&&(Ga=Object(K.a)({transition:"none"},Ga)),[zt,sr,Ga,Vt!=null?Vt:Te]}var Kn=function(fe){Object(l.a)(Oe,fe);var Te=Object(a.a)(Oe);function Oe(){return Object(A.a)(this,Oe),Te.apply(this,arguments)}return Object(x.a)(Oe,[{key:"render",value:function(){return this.props.children}}]),Oe}(O.Component),ja=Kn;function ri(fe){var Te=fe;Object(B.a)(fe)==="object"&&(Te=fe.transitionSupport);function Oe(Z){return!!(Z.motionName&&Te)}var ge=O.forwardRef(function(Z,ue){var $=Z.visible,pe=$===void 0?!0:$,Ee=Z.removeOnLeave,Se=Ee===void 0?!0:Ee,xe=Z.forceRender,Re=Z.children,Qe=Z.motionName,mt=Z.leavedClassName,ft=Z.eventProps,At=Oe(Z),on=Object(O.useRef)(),On=Object(O.useRef)();function gn(){try{return Object(pt.a)(on.current||On.current)}catch(Dn){return null}}var _n=Hr(At,pe,gn,Z),Sn=Object(G.a)(_n,4),yn=Sn[0],An=Sn[1],zn=Sn[2],Ln=Sn[3],xr=O.useRef(Ln);Ln&&(xr.current=!0);var kn=Object(O.useRef)(ue);kn.current=ue;var Vt=O.useCallback(function(Dn){on.current=Dn,Object(gt.b)(kn.current,Dn)},[]),qt,In=Object(K.a)(Object(K.a)({},ft),{},{visible:pe});if(!Re)qt=null;else if(yn===Pt||!Oe(Z))Ln?qt=Re(Object(K.a)({},In),Vt):!Se&&xr.current?qt=Re(Object(K.a)(Object(K.a)({},In),{},{className:mt}),Vt):xe?qt=Re(Object(K.a)(Object(K.a)({},In),{},{style:{display:"none"}}),Vt):qt=null;else{var Wn,zt;An===nn?zt="prepare":Ut(An)?zt="active":An===ur&&(zt="start"),qt=Re(Object(K.a)(Object(K.a)({},In),{},{className:U()(Bt(Qe,yn),(Wn={},Object(q.a)(Wn,Bt(Qe,"".concat(yn,"-").concat(zt)),zt),Object(q.a)(Wn,Qe,typeof Qe=="string"),Wn)),style:zn}),Vt)}return O.createElement(ja,{ref:On},qt)});return ge.displayName="CSSMotion",ge}var Aa=ri(It),ct="add",rn="keep",Ha="remove",Za="removed";function ai(fe){var Te;return fe&&Object(B.a)(fe)==="object"&&"key"in fe?Te=fe:Te={key:fe},Object(K.a)(Object(K.a)({},Te),{},{key:String(Te.key)})}function Ja(){var fe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return fe.map(ai)}function _i(){var fe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],Oe=[],ge=0,Z=Te.length,ue=Ja(fe),$=Ja(Te);ue.forEach(function(Se){for(var xe=!1,Re=ge;Re<Z;Re+=1){var Qe=$[Re];if(Qe.key===Se.key){ge<Re&&(Oe=Oe.concat($.slice(ge,Re).map(function(mt){return Object(K.a)(Object(K.a)({},mt),{},{status:ct})})),ge=Re),Oe.push(Object(K.a)(Object(K.a)({},Qe),{},{status:rn})),ge+=1,xe=!0;break}}xe||Oe.push(Object(K.a)(Object(K.a)({},Se),{},{status:Ha}))}),ge<Z&&(Oe=Oe.concat($.slice(ge).map(function(Se){return Object(K.a)(Object(K.a)({},Se),{},{status:ct})})));var pe={};Oe.forEach(function(Se){var xe=Se.key;pe[xe]=(pe[xe]||0)+1});var Ee=Object.keys(pe).filter(function(Se){return pe[Se]>1});return Ee.forEach(function(Se){Oe=Oe.filter(function(xe){var Re=xe.key,Qe=xe.status;return Re!==Se||Qe!==Ha}),Oe.forEach(function(xe){xe.key===Se&&(xe.status=rn)})}),Oe}var ln=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function Mi(fe){var Te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Aa,Oe=function(ge){Object(l.a)(ue,ge);var Z=Object(a.a)(ue);function ue(){var $;return Object(A.a)(this,ue),$=Z.apply(this,arguments),$.state={keyEntities:[]},$.removeKey=function(pe){$.setState(function(Ee){var Se=Ee.keyEntities;return{keyEntities:Se.map(function(xe){return xe.key!==pe?xe:Object(K.a)(Object(K.a)({},xe),{},{status:Za})})}})},$}return Object(x.a)(ue,[{key:"render",value:function(){var pe=this,Ee=this.state.keyEntities,Se=this.props,xe=Se.component,Re=Se.children,Qe=Se.onVisibleChanged,mt=Object(R.a)(Se,["component","children","onVisibleChanged"]),ft=xe||O.Fragment,At={};return ln.forEach(function(on){At[on]=mt[on],delete mt[on]}),delete mt.keys,O.createElement(ft,mt,Ee.map(function(on){var On=on.status,gn=Object(R.a)(on,["status"]),_n=On===ct||On===rn;return O.createElement(Te,Object(m.a)({},At,{key:gn.key,visible:_n,eventProps:gn,onVisibleChanged:function(yn){Qe==null||Qe(yn,{key:gn.key}),yn||pe.removeKey(gn.key)}}),Re)}))}}],[{key:"getDerivedStateFromProps",value:function(pe,Ee){var Se=pe.keys,xe=Ee.keyEntities,Re=Ja(Se),Qe=_i(xe,Re);return{keyEntities:Qe.filter(function(mt){var ft=xe.find(function(At){var on=At.key;return mt.key===on});return!(ft&&ft.status===Za&&mt.status===Ha)})}}}]),ue}(O.Component);return Oe.defaultProps={component:"div"},Oe}var Qi=Mi(It),Ba=Aa;function oa(fe){var Te=fe.prefixCls,Oe=fe.motion,ge=fe.animation,Z=fe.transitionName;return Oe||(ge?{motionName:"".concat(Te,"-").concat(ge)}:Z?{motionName:Z}:null)}function ii(fe){var Te=fe.prefixCls,Oe=fe.visible,ge=fe.zIndex,Z=fe.mask,ue=fe.maskMotion,$=fe.maskAnimation,pe=fe.maskTransitionName;if(!Z)return null;var Ee={};return(ue||pe||$)&&(Ee=Object(K.a)({motionAppear:!0},oa({motion:ue,prefixCls:Te,transitionName:pe,animation:$}))),O.createElement(Ba,Object(m.a)({},Ee,{visible:Oe,removeOnLeave:!0}),function(Se){var xe=Se.className;return O.createElement("div",{style:{zIndex:ge},className:U()("".concat(Te,"-mask"),xe)})})}var xi=F("9mu1"),bt=F("o0o1"),gr=F.n(bt),Li=F("HaE+"),pi=["measure","align",null,"motion"],Wt=function(fe,Te){var Oe=Object(O.useState)(null),ge=Object(G.a)(Oe,2),Z=ge[0],ue=ge[1],$=Object(O.useRef)(),pe=Object(O.useRef)(!1);function Ee(Re){pe.current||ue(Re)}function Se(){qe.a.cancel($.current)}function xe(Re){Se(),$.current=Object(qe.a)(function(){Ee(function(Qe){switch(Z){case"align":return"motion";case"motion":return"stable";default:}return Qe}),Re==null||Re()})}return Object(O.useEffect)(function(){Ee("measure")},[fe]),Object(O.useEffect)(function(){switch(Z){case"measure":Te();break;default:}Z&&($.current=Object(qe.a)(Object(Li.a)(gr.a.mark(function Re(){var Qe,mt;return gr.a.wrap(function(At){for(;;)switch(At.prev=At.next){case 0:Qe=pi.indexOf(Z),mt=pi[Qe+1],mt&&Qe!==-1&&Ee(mt);case 3:case"end":return At.stop()}},Re)}))))},[Z]),Object(O.useEffect)(function(){return function(){pe.current=!0,Se()}},[]),[Z,xe]},lt=function(fe){var Te=O.useState({width:0,height:0}),Oe=Object(G.a)(Te,2),ge=Oe[0],Z=Oe[1];function ue(pe){Z({width:pe.offsetWidth,height:pe.offsetHeight})}var $=O.useMemo(function(){var pe={};if(fe){var Ee=ge.width,Se=ge.height;fe.indexOf("height")!==-1&&Se?pe.height=Se:fe.indexOf("minHeight")!==-1&&Se&&(pe.minHeight=Se),fe.indexOf("width")!==-1&&Ee?pe.width=Ee:fe.indexOf("minWidth")!==-1&&Ee&&(pe.minWidth=Ee)}return pe},[fe,ge]);return[$,ue]},Rt=O.forwardRef(function(fe,Te){var Oe=fe.visible,ge=fe.prefixCls,Z=fe.className,ue=fe.style,$=fe.children,pe=fe.zIndex,Ee=fe.stretch,Se=fe.destroyPopupOnHide,xe=fe.forceRender,Re=fe.align,Qe=fe.point,mt=fe.getRootDomNode,ft=fe.getClassNameFromAlign,At=fe.onAlign,on=fe.onMouseEnter,On=fe.onMouseLeave,gn=fe.onMouseDown,_n=fe.onTouchStart,Sn=Object(O.useRef)(),yn=Object(O.useRef)(),An=Object(O.useState)(),zn=Object(G.a)(An,2),Ln=zn[0],xr=zn[1],kn=lt(Ee),Vt=Object(G.a)(kn,2),qt=Vt[0],In=Vt[1];function Wn(){Ee&&In(mt())}var zt=Wt(Oe,Wn),Dn=Object(G.a)(zt,2),Cr=Dn[0],Xn=Dn[1],fr=Object(O.useRef)();function ir(){return Qe||mt}function jr(){var en;(en=Sn.current)===null||en===void 0||en.forceAlign()}function Yr(en,Yn){var wr=ft(Yn);Ln!==wr&&xr(wr),Cr==="align"&&(Ln!==wr?Promise.resolve().then(function(){jr()}):Xn(function(){var Er;(Er=fr.current)===null||Er===void 0||Er.call(fr)}),At==null||At(en,Yn))}var Tr=Object(K.a)({},oa(fe));["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach(function(en){var Yn=Tr[en];Tr[en]=function(wr,Er){return Xn(),Yn==null?void 0:Yn(wr,Er)}});function sa(){return new Promise(function(en){fr.current=en})}O.useEffect(function(){!Tr.motionName&&Cr==="motion"&&Xn()},[Tr.motionName,Cr]),O.useImperativeHandle(Te,function(){return{forceAlign:jr,getElement:function(){return yn.current}}});var Ea=Object(K.a)(Object(K.a)({},qt),{},{zIndex:pe,opacity:Cr==="motion"||Cr==="stable"||!Oe?void 0:0,pointerEvents:Cr==="stable"?void 0:"none"},ue),ma=!0;(Re==null?void 0:Re.points)&&(Cr==="align"||Cr==="stable")&&(ma=!1);var Gr=$;return O.Children.count($)>1&&(Gr=O.createElement("div",{className:"".concat(ge,"-content")},$)),O.createElement(Ba,Object(m.a)({visible:Oe,ref:yn,leavedClassName:"".concat(ge,"-hidden")},Tr,{onAppearPrepare:sa,onEnterPrepare:sa,removeOnLeave:Se,forceRender:xe}),function(en,Yn){var wr=en.className,Er=en.style,Ra=U()(ge,Z,Ln,wr);return O.createElement(xi.a,{target:ir(),key:"popup",ref:Sn,monitorWindowResize:!0,disabled:ma,align:Re,onAlign:Yr},O.createElement("div",{ref:Yn,className:Ra,onMouseEnter:on,onMouseLeave:On,onMouseDownCapture:gn,onTouchStartCapture:_n,style:Object(K.a)(Object(K.a)({},Er),Ea)},Gr))})});Rt.displayName="PopupInner";var Tt=Rt,Ot=O.forwardRef(function(fe,Te){var Oe=fe.prefixCls,ge=fe.visible,Z=fe.zIndex,ue=fe.children,$=fe.mobile;$=$===void 0?{}:$;var pe=$.popupClassName,Ee=$.popupStyle,Se=$.popupMotion,xe=Se===void 0?{}:Se,Re=$.popupRender,Qe=O.useRef();O.useImperativeHandle(Te,function(){return{forceAlign:function(){},getElement:function(){return Qe.current}}});var mt=Object(K.a)({zIndex:Z},Ee),ft=ue;return O.Children.count(ue)>1&&(ft=O.createElement("div",{className:"".concat(Oe,"-content")},ue)),Re&&(ft=Re(ft)),O.createElement(Ba,Object(m.a)({visible:ge,ref:Qe,removeOnLeave:!0},xe),function(At,on){var On=At.className,gn=At.style,_n=U()(Oe,pe,On);return O.createElement("div",{ref:on,className:_n,style:Object(K.a)(Object(K.a)({},gn),mt)},ft)})});Ot.displayName="MobilePopupInner";var pn=Ot,bn=["visible","mobile"],$t=O.forwardRef(function(fe,Te){var Oe=fe.visible,ge=fe.mobile,Z=Object(R.a)(fe,bn),ue=Object(O.useState)(Oe),$=Object(G.a)(ue,2),pe=$[0],Ee=$[1],Se=Object(O.useState)(!1),xe=Object(G.a)(Se,2),Re=xe[0],Qe=xe[1],mt=Object(K.a)(Object(K.a)({},Z),{},{visible:pe});Object(O.useEffect)(function(){Ee(Oe),Oe&&ge&&Qe(me())},[Oe,ge]);var ft=Re?O.createElement(pn,Object(m.a)({},mt,{mobile:ge,ref:Te})):O.createElement(Tt,Object(m.a)({},mt,{ref:Te}));return O.createElement("div",null,O.createElement(ii,mt),ft)});$t.displayName="Popup";var Zt=$t,wn=O.createContext(null),fn=wn;function Xt(){}function En(){return""}function Vn(fe){return fe?fe.ownerDocument:window.document}var $n=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];function Jt(fe){var Te=function(Oe){Object(l.a)(Z,Oe);var ge=Object(a.a)(Z);function Z(ue){var $;Object(A.a)(this,Z),$=ge.call(this,ue),$.popupRef=O.createRef(),$.triggerRef=O.createRef(),$.attachId=void 0,$.clickOutsideHandler=void 0,$.touchOutsideHandler=void 0,$.contextMenuOutsideHandler1=void 0,$.contextMenuOutsideHandler2=void 0,$.mouseDownTimeout=void 0,$.focusTime=void 0,$.preClickTime=void 0,$.preTouchTime=void 0,$.delayTimer=void 0,$.hasPopupMouseDown=void 0,$.onMouseEnter=function(Ee){var Se=$.props.mouseEnterDelay;$.fireEvents("onMouseEnter",Ee),$.delaySetPopupVisible(!0,Se,Se?null:Ee)},$.onMouseMove=function(Ee){$.fireEvents("onMouseMove",Ee),$.setPoint(Ee)},$.onMouseLeave=function(Ee){$.fireEvents("onMouseLeave",Ee),$.delaySetPopupVisible(!1,$.props.mouseLeaveDelay)},$.onPopupMouseEnter=function(){$.clearDelayTimer()},$.onPopupMouseLeave=function(Ee){var Se;if(Ee.relatedTarget&&!Ee.relatedTarget.setTimeout&&Object(vt.a)((Se=$.popupRef.current)===null||Se===void 0?void 0:Se.getElement(),Ee.relatedTarget))return;$.delaySetPopupVisible(!1,$.props.mouseLeaveDelay)},$.onFocus=function(Ee){$.fireEvents("onFocus",Ee),$.clearDelayTimer(),$.isFocusToShow()&&($.focusTime=Date.now(),$.delaySetPopupVisible(!0,$.props.focusDelay))},$.onMouseDown=function(Ee){$.fireEvents("onMouseDown",Ee),$.preClickTime=Date.now()},$.onTouchStart=function(Ee){$.fireEvents("onTouchStart",Ee),$.preTouchTime=Date.now()},$.onBlur=function(Ee){$.fireEvents("onBlur",Ee),$.clearDelayTimer(),$.isBlurToHide()&&$.delaySetPopupVisible(!1,$.props.blurDelay)},$.onContextMenu=function(Ee){Ee.preventDefault(),$.fireEvents("onContextMenu",Ee),$.setPopupVisible(!0,Ee)},$.onContextMenuClose=function(){$.isContextMenuToShow()&&$.close()},$.onClick=function(Ee){if($.fireEvents("onClick",Ee),$.focusTime){var Se;if($.preClickTime&&$.preTouchTime?Se=Math.min($.preClickTime,$.preTouchTime):$.preClickTime?Se=$.preClickTime:$.preTouchTime&&(Se=$.preTouchTime),Math.abs(Se-$.focusTime)<20)return;$.focusTime=0}$.preClickTime=0,$.preTouchTime=0,$.isClickToShow()&&($.isClickToHide()||$.isBlurToHide())&&Ee&&Ee.preventDefault&&Ee.preventDefault();var xe=!$.state.popupVisible;($.isClickToHide()&&!xe||xe&&$.isClickToShow())&&$.setPopupVisible(!$.state.popupVisible,Ee)},$.onPopupMouseDown=function(){if($.hasPopupMouseDown=!0,clearTimeout($.mouseDownTimeout),$.mouseDownTimeout=window.setTimeout(function(){$.hasPopupMouseDown=!1},0),$.context){var Ee;(Ee=$.context).onPopupMouseDown.apply(Ee,arguments)}},$.onDocumentClick=function(Ee){if($.props.mask&&!$.props.maskClosable)return;var Se=Ee.target,xe=$.getRootDomNode(),Re=$.getPopupDomNode();(!Object(vt.a)(xe,Se)||$.isContextMenuOnly())&&!Object(vt.a)(Re,Se)&&!$.hasPopupMouseDown&&$.close()},$.getRootDomNode=function(){var Ee=$.props.getTriggerDOMNode;if(Ee)return Ee($.triggerRef.current);try{var Se=Object(pt.a)($.triggerRef.current);if(Se)return Se}catch(xe){}return st.a.findDOMNode(Object(u.a)($))},$.getPopupClassNameFromAlign=function(Ee){var Se=[],xe=$.props,Re=xe.popupPlacement,Qe=xe.builtinPlacements,mt=xe.prefixCls,ft=xe.alignPoint,At=xe.getPopupClassNameFromAlign;return Re&&Qe&&Se.push(rt(Qe,mt,Ee,ft)),At&&Se.push(At(Ee)),Se.join(" ")},$.getComponent=function(){var Ee=$.props,Se=Ee.prefixCls,xe=Ee.destroyPopupOnHide,Re=Ee.popupClassName,Qe=Ee.onPopupAlign,mt=Ee.popupMotion,ft=Ee.popupAnimation,At=Ee.popupTransitionName,on=Ee.popupStyle,On=Ee.mask,gn=Ee.maskAnimation,_n=Ee.maskTransitionName,Sn=Ee.maskMotion,yn=Ee.zIndex,An=Ee.popup,zn=Ee.stretch,Ln=Ee.alignPoint,xr=Ee.mobile,kn=Ee.forceRender,Vt=$.state,qt=Vt.popupVisible,In=Vt.point,Wn=$.getPopupAlign(),zt={};return $.isMouseEnterToShow()&&(zt.onMouseEnter=$.onPopupMouseEnter),$.isMouseLeaveToHide()&&(zt.onMouseLeave=$.onPopupMouseLeave),zt.onMouseDown=$.onPopupMouseDown,zt.onTouchStart=$.onPopupMouseDown,O.createElement(Zt,Object(m.a)({prefixCls:Se,destroyPopupOnHide:xe,visible:qt,point:Ln&&In,className:Re,align:Wn,onAlign:Qe,animation:ft,getClassNameFromAlign:$.getPopupClassNameFromAlign},zt,{stretch:zn,getRootDomNode:$.getRootDomNode,style:on,mask:On,zIndex:yn,transitionName:At,maskAnimation:gn,maskTransitionName:_n,maskMotion:Sn,ref:$.popupRef,motion:mt,mobile:xr,forceRender:kn}),typeof An=="function"?An():An)},$.attachParent=function(Ee){qe.a.cancel($.attachId);var Se=$.props,xe=Se.getPopupContainer,Re=Se.getDocument,Qe=$.getRootDomNode(),mt;xe?(Qe||xe.length===0)&&(mt=xe(Qe)):mt=Re($.getRootDomNode()).body,mt?mt.appendChild(Ee):$.attachId=Object(qe.a)(function(){$.attachParent(Ee)})},$.getContainer=function(){var Ee=$.props.getDocument,Se=Ee($.getRootDomNode()).createElement("div");return Se.style.position="absolute",Se.style.top="0",Se.style.left="0",Se.style.width="100%",$.attachParent(Se),Se},$.setPoint=function(Ee){var Se=$.props.alignPoint;if(!Se||!Ee)return;$.setState({point:{pageX:Ee.pageX,pageY:Ee.pageY}})},$.handlePortalUpdate=function(){$.state.prevPopupVisible!==$.state.popupVisible&&$.props.afterPopupVisibleChange($.state.popupVisible)},$.triggerContextValue={onPopupMouseDown:$.onPopupMouseDown};var pe;return"popupVisible"in ue?pe=!!ue.popupVisible:pe=!!ue.defaultPopupVisible,$.state={prevPopupVisible:pe,popupVisible:pe},$n.forEach(function(Ee){$["fire".concat(Ee)]=function(Se){$.fireEvents(Ee,Se)}}),$}return Object(x.a)(Z,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var $=this.props,pe=this.state;if(pe.popupVisible){var Ee;!this.clickOutsideHandler&&(this.isClickToHide()||this.isContextMenuToShow())&&(Ee=$.getDocument(this.getRootDomNode()),this.clickOutsideHandler=Object(Be.a)(Ee,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(Ee=Ee||$.getDocument(this.getRootDomNode()),this.touchOutsideHandler=Object(Be.a)(Ee,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(Ee=Ee||$.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=Object(Be.a)(Ee,"scroll",this.onContextMenuClose)),!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=Object(Be.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 $;return(($=this.popupRef.current)===null||$===void 0?void 0:$.getElement())||null}},{key:"getPopupAlign",value:function(){var $=this.props,pe=$.popupPlacement,Ee=$.popupAlign,Se=$.builtinPlacements;return pe&&Se?He(Se,pe,Ee):Ee}},{key:"setPopupVisible",value:function($,pe){var Ee=this.props.alignPoint,Se=this.state.popupVisible;this.clearDelayTimer(),Se!==$&&("popupVisible"in this.props||this.setState({popupVisible:$,prevPopupVisible:Se}),this.props.onPopupVisibleChange($)),Ee&&pe&&$&&this.setPoint(pe)}},{key:"delaySetPopupVisible",value:function($,pe,Ee){var Se=this,xe=pe*1e3;if(this.clearDelayTimer(),xe){var Re=Ee?{pageX:Ee.pageX,pageY:Ee.pageY}:null;this.delayTimer=window.setTimeout(function(){Se.setPopupVisible($,Re),Se.clearDelayTimer()},xe)}else this.setPopupVisible($,Ee)}},{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($){var pe=this.props.children.props,Ee=this.props;return pe[$]&&Ee[$]?this["fire".concat($)]:pe[$]||Ee[$]}},{key:"isClickToShow",value:function(){var $=this.props,pe=$.action,Ee=$.showAction;return pe.indexOf("click")!==-1||Ee.indexOf("click")!==-1}},{key:"isContextMenuOnly",value:function(){var $=this.props.action;return $==="contextMenu"||$.length===1&&$[0]==="contextMenu"}},{key:"isContextMenuToShow",value:function(){var $=this.props,pe=$.action,Ee=$.showAction;return pe.indexOf("contextMenu")!==-1||Ee.indexOf("contextMenu")!==-1}},{key:"isClickToHide",value:function(){var $=this.props,pe=$.action,Ee=$.hideAction;return pe.indexOf("click")!==-1||Ee.indexOf("click")!==-1}},{key:"isMouseEnterToShow",value:function(){var $=this.props,pe=$.action,Ee=$.showAction;return pe.indexOf("hover")!==-1||Ee.indexOf("mouseEnter")!==-1}},{key:"isMouseLeaveToHide",value:function(){var $=this.props,pe=$.action,Ee=$.hideAction;return pe.indexOf("hover")!==-1||Ee.indexOf("mouseLeave")!==-1}},{key:"isFocusToShow",value:function(){var $=this.props,pe=$.action,Ee=$.showAction;return pe.indexOf("focus")!==-1||Ee.indexOf("focus")!==-1}},{key:"isBlurToHide",value:function(){var $=this.props,pe=$.action,Ee=$.hideAction;return pe.indexOf("focus")!==-1||Ee.indexOf("blur")!==-1}},{key:"forcePopupAlign",value:function(){if(this.state.popupVisible){var $;($=this.popupRef.current)===null||$===void 0||$.forceAlign()}}},{key:"fireEvents",value:function($,pe){var Ee=this.props.children.props[$];Ee&&Ee(pe);var Se=this.props[$];Se&&Se(pe)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var $=this.state.popupVisible,pe=this.props,Ee=pe.children,Se=pe.forceRender,xe=pe.alignPoint,Re=pe.className,Qe=pe.autoDestroy,mt=O.Children.only(Ee),ft={key:"trigger"};this.isContextMenuToShow()?ft.onContextMenu=this.onContextMenu:ft.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(ft.onClick=this.onClick,ft.onMouseDown=this.onMouseDown,ft.onTouchStart=this.onTouchStart):(ft.onClick=this.createTwoChains("onClick"),ft.onMouseDown=this.createTwoChains("onMouseDown"),ft.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(ft.onMouseEnter=this.onMouseEnter,xe&&(ft.onMouseMove=this.onMouseMove)):ft.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?ft.onMouseLeave=this.onMouseLeave:ft.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(ft.onFocus=this.onFocus,ft.onBlur=this.onBlur):(ft.onFocus=this.createTwoChains("onFocus"),ft.onBlur=this.createTwoChains("onBlur"));var At=U()(mt&&mt.props&&mt.props.className,Re);At&&(ft.className=At);var on=Object(K.a)({},ft);Object(gt.c)(mt)&&(on.ref=Object(gt.a)(this.triggerRef,mt.ref));var On=O.cloneElement(mt,on),gn;return($||this.popupRef.current||Se)&&(gn=O.createElement(fe,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!$&&Qe&&(gn=null),O.createElement(fn.Provider,{value:this.triggerContextValue},On,gn)}}],[{key:"getDerivedStateFromProps",value:function($,pe){var Ee=$.popupVisible,Se={};return Ee!==void 0&&pe.popupVisible!==Ee&&(Se.popupVisible=Ee,Se.prevPopupVisible=pe.popupVisible),Se}}]),Z}(O.Component);return Te.contextType=fn,Te.defaultProps={prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:En,getDocument:Vn,onPopupVisibleChange:Xt,afterPopupVisibleChange:Xt,onPopupAlign:Xt,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1},Te}var un=Jt(Ct.a),Zn={adjustX:1,adjustY:1},Hn={topLeft:{points:["bl","tl"],overflow:Zn,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:Zn,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:Zn,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:Zn,offset:[4,0]}},an={topLeft:{points:["bl","tl"],overflow:Zn,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:Zn,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:Zn,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:Zn,offset:[4,0]}},hn=Hn,Cn=0,Nt={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},Lt=function(Te,Oe,ge){var Z=De(Oe),ue=Te.getState();Te.setState({defaultActiveFirst:Object(K.a)(Object(K.a)({},ue.defaultActiveFirst),{},Object(q.a)({},Z,ge))})},jt=function(fe){Object(l.a)(Oe,fe);var Te=Object(a.a)(Oe);function Oe(ge){var Z;Object(A.a)(this,Oe),Z=Te.call(this,ge),Z.onDestroy=function(xe){Z.props.onDestroy(xe)},Z.onKeyDown=function(xe){var Re=xe.keyCode,Qe=Z.menuInstance,mt=Z.props.store,ft=Z.getVisible();if(Re===y.a.ENTER)return Z.onTitleClick(xe),Lt(mt,Z.props.eventKey,!0),!0;if(Re===y.a.RIGHT)return ft?Qe.onKeyDown(xe):(Z.triggerOpenChange(!0),Lt(mt,Z.props.eventKey,!0)),!0;if(Re===y.a.LEFT){var At;if(ft)At=Qe.onKeyDown(xe);else return;return At||(Z.triggerOpenChange(!1),At=!0),At}return ft&&(Re===y.a.UP||Re===y.a.DOWN)?Qe.onKeyDown(xe):void 0},Z.onOpenChange=function(xe){Z.props.onOpenChange(xe)},Z.onPopupVisibleChange=function(xe){Z.triggerOpenChange(xe,xe?"mouseenter":"mouseleave")},Z.onMouseEnter=function(xe){var Re=Z.props,Qe=Re.eventKey,mt=Re.onMouseEnter,ft=Re.store;Lt(ft,Z.props.eventKey,!1),mt({key:Qe,domEvent:xe})},Z.onMouseLeave=function(xe){var Re=Z.props,Qe=Re.parentMenu,mt=Re.eventKey,ft=Re.onMouseLeave;Qe.subMenuInstance=Object(u.a)(Z),ft({key:mt,domEvent:xe})},Z.onTitleMouseEnter=function(xe){var Re=Z.props,Qe=Re.eventKey,mt=Re.onItemHover,ft=Re.onTitleMouseEnter;mt({key:Qe,hover:!0}),ft({key:Qe,domEvent:xe})},Z.onTitleMouseLeave=function(xe){var Re=Z.props,Qe=Re.parentMenu,mt=Re.eventKey,ft=Re.onItemHover,At=Re.onTitleMouseLeave;Qe.subMenuInstance=Object(u.a)(Z),ft({key:mt,hover:!1}),At({key:mt,domEvent:xe})},Z.onTitleClick=function(xe){var Re=Object(u.a)(Z),Qe=Re.props;if(Qe.onTitleClick({key:Qe.eventKey,domEvent:xe}),Qe.triggerSubMenuAction==="hover")return;Z.triggerOpenChange(!Z.getVisible(),"click"),Lt(Qe.store,Z.props.eventKey,!1)},Z.onSubMenuClick=function(xe){typeof Z.props.onClick=="function"&&Z.props.onClick(Z.addKeyPath(xe))},Z.onSelect=function(xe){Z.props.onSelect(xe)},Z.onDeselect=function(xe){Z.props.onDeselect(xe)},Z.getPrefixCls=function(){return"".concat(Z.props.rootPrefixCls,"-submenu")},Z.getActiveClassName=function(){return"".concat(Z.getPrefixCls(),"-active")},Z.getDisabledClassName=function(){return"".concat(Z.getPrefixCls(),"-disabled")},Z.getSelectedClassName=function(){return"".concat(Z.getPrefixCls(),"-selected")},Z.getOpenClassName=function(){return"".concat(Z.props.rootPrefixCls,"-submenu-open")},Z.getVisible=function(){return Z.state.isOpen},Z.getMode=function(){return Z.state.mode},Z.saveMenuInstance=function(xe){Z.menuInstance=xe},Z.addKeyPath=function(xe){return Object(K.a)(Object(K.a)({},xe),{},{keyPath:(xe.keyPath||[]).concat(Z.props.eventKey)})},Z.triggerOpenChange=function(xe,Re){var Qe=Z.props.eventKey,mt=function(){Z.onOpenChange({key:Qe,item:Object(u.a)(Z),trigger:Re,open:xe})};Re==="mouseenter"?Z.mouseenterTimeout=setTimeout(function(){mt()},0):mt()},Z.isChildrenSelected=function(){var xe={find:!1};return Ve(Z.props.children,Z.props.selectedKeys,xe),xe.find},Z.isInlineMode=function(){return Z.getMode()==="inline"},Z.adjustWidth=function(){if(!Z.subMenuTitle||!Z.menuInstance)return;var xe=ot.findDOMNode(Z.menuInstance);if(xe.offsetWidth>=Z.subMenuTitle.offsetWidth)return;xe.style.minWidth="".concat(Z.subMenuTitle.offsetWidth,"px")},Z.saveSubMenuTitle=function(xe){Z.subMenuTitle=xe},Z.getBaseProps=function(){var xe=Object(u.a)(Z),Re=xe.props,Qe=Z.getMode();return{mode:Qe==="horizontal"?"vertical":Qe,visible:Z.getVisible(),level:Re.level+1,inlineIndent:Re.inlineIndent,focusable:!1,onClick:Z.onSubMenuClick,onSelect:Z.onSelect,onDeselect:Z.onDeselect,onDestroy:Z.onDestroy,selectedKeys:Re.selectedKeys,eventKey:"".concat(Re.eventKey,"-menu-"),openKeys:Re.openKeys,motion:Re.motion,onOpenChange:Z.onOpenChange,subMenuOpenDelay:Re.subMenuOpenDelay,parentMenu:Object(u.a)(Z),subMenuCloseDelay:Re.subMenuCloseDelay,forceSubMenuRender:Re.forceSubMenuRender,triggerSubMenuAction:Re.triggerSubMenuAction,builtinPlacements:Re.builtinPlacements,defaultActiveFirst:Re.store.getState().defaultActiveFirst[De(Re.eventKey)],multiple:Re.multiple,prefixCls:Re.rootPrefixCls,id:Z.internalMenuId,manualRef:Z.saveMenuInstance,itemIcon:Re.itemIcon,expandIcon:Re.expandIcon,direction:Re.direction}},Z.getMotion=function(xe,Re){var Qe=Object(u.a)(Z),mt=Qe.haveRendered,ft=Z.props,At=ft.motion,on=ft.rootPrefixCls,On=Object(K.a)(Object(K.a)({},At),{},{leavedClassName:"".concat(on,"-hidden"),removeOnLeave:!1,motionAppear:mt||!Re||xe!=="inline"});return On};var ue=ge.store,$=ge.eventKey,pe=ue.getState(),Ee=pe.defaultActiveFirst;Z.isRootMenu=!1;var Se=!1;return Ee&&(Se=Ee[$]),Lt(ue,$,Se),Z.state={mode:ge.mode,isOpen:ge.isOpen},Z}return Object(x.a)(Oe,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var Z=this,ue=this.props,$=ue.mode,pe=ue.parentMenu,Ee=ue.manualRef,Se=ue.isOpen,xe=function(){Z.setState({mode:$,isOpen:Se})},Re=Se!==this.state.isOpen,Qe=$!==this.state.mode;if((Qe||Re)&&(qe.a.cancel(this.updateStateRaf),Qe?this.updateStateRaf=Object(qe.a)(xe):xe()),Ee&&Ee(this),$!=="horizontal"||!(pe==null?void 0:pe.isRootMenu)||!Se)return;this.minWidthTimeout=setTimeout(function(){return Z.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var Z=this.props,ue=Z.onDestroy,$=Z.eventKey;ue&&ue($),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout),qe.a.cancel(this.updateStateRaf)}},{key:"renderPopupMenu",value:function(Z,ue){var $=this.getBaseProps();return O.createElement(yr,Object(m.a)({},$,{id:this.internalMenuId,className:Z,style:ue}),this.props.children)}},{key:"renderChildren",value:function(){var Z=this,ue=this.getBaseProps(),$=ue.mode,pe=ue.visible,Ee=ue.forceSubMenuRender,Se=ue.direction,xe=this.getMotion($,pe);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||pe||Ee,!this.haveOpened)return O.createElement("div",null);var Re=U()("".concat(ue.prefixCls,"-sub"),Object(q.a)({},"".concat(ue.prefixCls,"-rtl"),Se==="rtl"));return this.isInlineMode()?O.createElement(Ba,Object(m.a)({visible:ue.visible,forceRender:Ee},xe),function(Qe){var mt=Qe.className,ft=Qe.style,At=U()(Re,mt);return Z.renderPopupMenu(At,ft)}):this.renderPopupMenu(Re)}},{key:"render",value:function(){var Z,ue,$,pe=Object(K.a)({},this.props),Ee=this.getVisible(),Se=this.getPrefixCls(),xe=this.isInlineMode(),Re=this.getMode(),Qe=U()(Se,"".concat(Se,"-").concat(Re),(Z={},Object(q.a)(Z,pe.className,!!pe.className),Object(q.a)(Z,this.getOpenClassName(),Ee),Object(q.a)(Z,this.getActiveClassName(),pe.active||Ee&&!xe),Object(q.a)(Z,this.getDisabledClassName(),pe.disabled),Object(q.a)(Z,this.getSelectedClassName(),this.isChildrenSelected()),Z));this.internalMenuId||(pe.eventKey?this.internalMenuId="".concat(pe.eventKey,"$Menu"):(Cn+=1,this.internalMenuId="$__$".concat(Cn,"$Menu")));var mt={},ft={},At={};pe.disabled||(mt={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},ft={onClick:this.onTitleClick},At={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var on={},On=pe.direction,gn=On==="rtl";xe&&(gn?on.paddingRight=pe.inlineIndent*pe.level:on.paddingLeft=pe.inlineIndent*pe.level);var _n={};this.getVisible()&&(_n={"aria-owns":this.internalMenuId});var Sn=null;Re!=="horizontal"&&(Sn=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(Sn=O.createElement(this.props.expandIcon,Object(K.a)({},this.props))));var yn=O.createElement("div",Object(m.a)({ref:this.saveSubMenuTitle,style:on,className:"".concat(Se,"-title"),role:"button"},At,ft,{"aria-expanded":Ee},_n,{"aria-haspopup":"true",title:typeof pe.title=="string"?pe.title:void 0}),pe.title,Sn||O.createElement("i",{className:"".concat(Se,"-arrow")})),An=this.renderChildren(),zn=((ue=pe.parentMenu)===null||ue===void 0?void 0:ue.isRootMenu)?pe.parentMenu.props.getPopupContainer:function(ir){return ir.parentNode},Ln=Nt[Re],xr=pe.popupOffset?{offset:pe.popupOffset}:{},kn=U()(($={},Object(q.a)($,pe.popupClassName,pe.popupClassName&&!xe),Object(q.a)($,"".concat(Se,"-rtl"),gn),$)),Vt=pe.disabled,qt=pe.triggerSubMenuAction,In=pe.subMenuOpenDelay,Wn=pe.forceSubMenuRender,zt=pe.subMenuCloseDelay,Dn=pe.builtinPlacements;ze.forEach(function(ir){return delete pe[ir]}),delete pe.onClick;var Cr=gn?Object(K.a)(Object(K.a)({},an),Dn):Object(K.a)(Object(K.a)({},Hn),Dn);delete pe.direction;var Xn=this.getBaseProps(),fr=xe?null:this.getMotion(Xn.mode,Xn.visible);return O.createElement("li",Object(m.a)({},pe,mt,{className:Qe,role:"menuitem"}),O.createElement(un,{prefixCls:Se,popupClassName:U()("".concat(Se,"-popup"),kn),getPopupContainer:zn,builtinPlacements:Cr,popupPlacement:Ln,popupVisible:xe?!1:Ee,popupAlign:xr,popup:xe?null:An,action:Vt||xe?[]:[qt],mouseEnterDelay:In,mouseLeaveDelay:zt,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:Wn,popupMotion:fr},yn),xe?An:null)}}]),Oe}(O.Component);jt.defaultProps={onMouseEnter:we,onMouseLeave:we,onTitleMouseEnter:we,onTitleMouseLeave:we,onTitleClick:we,manualRef:we,mode:"vertical",title:""};var Ae=Object(i.b)(function(fe,Te){var Oe=fe.openKeys,ge=fe.activeKey,Z=fe.selectedKeys,ue=Te.eventKey,$=Te.subMenuKey;return{isOpen:Oe.indexOf(ue)>-1,active:ge[$]===ue,selectedKeys:Z}})(jt);Ae.isSubMenu=!0;var Ht=Ae,Tn="menuitem-overflowed",nr=.5,Gt=function(fe){Object(l.a)(Oe,fe);var Te=Object(a.a)(Oe);function Oe(){var ge;return Object(A.a)(this,Oe),ge=Te.apply(this,arguments),ge.resizeObserver=null,ge.mutationObserver=null,ge.originalTotalWidth=0,ge.overflowedItems=[],ge.menuItemSizes=[],ge.cancelFrameId=null,ge.state={lastVisibleIndex:void 0},ge.childRef=O.createRef(),ge.getMenuItemNodes=function(){var Z=ge.props.prefixCls,ue=ge.childRef.current;return ue?[].slice.call(ue.children).filter(function($){return $.className.split(" ").indexOf("".concat(Z,"-overflowed-submenu"))<0}):[]},ge.getOverflowedSubMenuItem=function(Z,ue,$){var pe=ge.props,Ee=pe.overflowedIndicator,Se=pe.level,xe=pe.mode,Re=pe.prefixCls,Qe=pe.theme;if(Se!==1||xe!=="horizontal")return null;var mt=ge.props.children[0],ft=mt.props,At=ft.children,on=ft.title,On=ft.style,gn=Object(R.a)(ft,["children","title","style"]),_n=Object(K.a)({},On),Sn="".concat(Z,"-overflowed-indicator"),yn="".concat(Z,"-overflowed-indicator");ue.length===0&&$!==!0?_n=Object(K.a)(Object(K.a)({},_n),{},{display:"none"}):$&&(_n=Object(K.a)(Object(K.a)({},_n),{},{visibility:"hidden",position:"absolute"}),Sn="".concat(Sn,"-placeholder"),yn="".concat(yn,"-placeholder"));var An=Qe?"".concat(Re,"-").concat(Qe):"",zn={};return ze.forEach(function(Ln){gn[Ln]!==void 0&&(zn[Ln]=gn[Ln])}),O.createElement(Ht,Object(m.a)({title:Ee,className:"".concat(Re,"-overflowed-submenu"),popupClassName:An},zn,{key:Sn,eventKey:yn,disabled:!1,style:_n}),ue)},ge.setChildrenWidthAndResize=function(){if(ge.props.mode!=="horizontal")return;var Z=ge.childRef.current;if(!Z)return;var ue=Z.children;if(!ue||ue.length===0)return;var $=Z.children[ue.length-1];Ye($,"display","inline-block");var pe=ge.getMenuItemNodes(),Ee=pe.filter(function(Se){return Se.className.split(" ").indexOf(Tn)>=0});Ee.forEach(function(Se){Ye(Se,"display","inline-block")}),ge.menuItemSizes=pe.map(function(Se){return Je(Se,!0)}),Ee.forEach(function(Se){Ye(Se,"display","none")}),ge.overflowedIndicatorWidth=Je(Z.children[Z.children.length-1],!0),ge.originalTotalWidth=ge.menuItemSizes.reduce(function(Se,xe){return Se+xe},0),ge.handleResize(),Ye($,"display","none")},ge.handleResize=function(){if(ge.props.mode!=="horizontal")return;var Z=ge.childRef.current;if(!Z)return;var ue=Je(Z);ge.overflowedItems=[];var $=0,pe;ge.originalTotalWidth>ue+nr&&(pe=-1,ge.menuItemSizes.forEach(function(Ee){$+=Ee,$+ge.overflowedIndicatorWidth<=ue&&(pe+=1)})),ge.setState({lastVisibleIndex:pe})},ge}return Object(x.a)(Oe,[{key:"componentDidMount",value:function(){var Z=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var ue=this.childRef.current;if(!ue)return;this.resizeObserver=new ht.default(function($){$.forEach(function(){var pe=Z.cancelFrameId;cancelAnimationFrame(pe),Z.cancelFrameId=requestAnimationFrame(Z.setChildrenWidthAndResize)})}),[].slice.call(ue.children).concat(ue).forEach(function($){Z.resizeObserver.observe($)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){Z.resizeObserver.disconnect(),[].slice.call(ue.children).concat(ue).forEach(function($){Z.resizeObserver.observe($)}),Z.setChildrenWidthAndResize()}),this.mutationObserver.observe(ue,{attributes:!1,childList:!0,subTree:!1}))}}},{key:"componentWillUnmount",value:function(){this.resizeObserver&&this.resizeObserver.disconnect(),this.mutationObserver&&this.mutationObserver.disconnect(),cancelAnimationFrame(this.cancelFrameId)}},{key:"renderChildren",value:function(Z){var ue=this,$=this.state.lastVisibleIndex;return(Z||[]).reduce(function(pe,Ee,Se){var xe=Ee;if(ue.props.mode==="horizontal"){var Re=ue.getOverflowedSubMenuItem(Ee.props.eventKey,[]);$!==void 0&&ue.props.className.indexOf("".concat(ue.props.prefixCls,"-root"))!==-1&&(Se>$&&(xe=O.cloneElement(Ee,{style:{display:"none"},eventKey:"".concat(Ee.props.eventKey,"-hidden"),className:"".concat(Tn)})),Se===$+1&&(ue.overflowedItems=Z.slice($+1).map(function(mt){return O.cloneElement(mt,{key:mt.props.eventKey,mode:"vertical-left"})}),Re=ue.getOverflowedSubMenuItem(Ee.props.eventKey,ue.overflowedItems)));var Qe=[].concat(Object(P.a)(pe),[Re,xe]);return Se===Z.length-1&&Qe.push(ue.getOverflowedSubMenuItem(Ee.props.eventKey,[],!0)),Qe}return[].concat(Object(P.a)(pe),[xe])},[])}},{key:"render",value:function(){var Z=this.props,ue=Z.visible,$=Z.prefixCls,pe=Z.overflowedIndicator,Ee=Z.mode,Se=Z.level,xe=Z.tag,Re=Z.children,Qe=Z.theme,mt=Object(R.a)(Z,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),ft=xe;return O.createElement(ft,Object(m.a)({ref:this.childRef},mt),this.renderChildren(Re))}}]),Oe}(O.Component);Gt.defaultProps={tag:"div",className:""};var Xr=Gt;function Pa(fe){return fe.length?fe.every(function(Te){return!!Te.props.disabled}):!0}function zr(fe,Te,Oe){var ge=fe.getState();fe.setState({activeKey:Object(K.a)(Object(K.a)({},ge.activeKey),{},Object(q.a)({},Te,Oe))})}function dn(fe){return fe.eventKey||"0-menu-"}function St(fe,Te){var Oe=Te,ge=fe.children,Z=fe.eventKey;if(Oe){var ue;if(Le(ge,function($,pe){$&&$.props&&!$.props.disabled&&Oe===ke($,Z,pe)&&(ue=!0)}),ue)return Oe}return Oe=null,fe.defaultActiveFirst&&Le(ge,function($,pe){!Oe&&$&&!$.props.disabled&&(Oe=ke($,Z,pe))}),Oe}function rr(fe){if(!fe)return;var Te=this.instanceArray.indexOf(fe);Te!==-1?this.instanceArray[Te]=fe:this.instanceArray.push(fe)}var vn=function(fe){Object(l.a)(Oe,fe);var Te=Object(a.a)(Oe);function Oe(ge){var Z;return Object(A.a)(this,Oe),Z=Te.call(this,ge),Z.onKeyDown=function(ue,$){var pe=ue.keyCode,Ee;if(Z.getFlatInstanceArray().forEach(function(xe){xe&&xe.props.active&&xe.onKeyDown&&(Ee=xe.onKeyDown(ue))}),Ee)return 1;var Se=null;return(pe===y.a.UP||pe===y.a.DOWN)&&(Se=Z.step(pe===y.a.UP?-1:1)),Se?(ue.preventDefault(),zr(Z.props.store,dn(Z.props),Se.props.eventKey),typeof $=="function"&&$(Se),1):void 0},Z.onItemHover=function(ue){var $=ue.key,pe=ue.hover;zr(Z.props.store,dn(Z.props),pe?$:null)},Z.onDeselect=function(ue){Z.props.onDeselect(ue)},Z.onSelect=function(ue){Z.props.onSelect(ue)},Z.onClick=function(ue){Z.props.onClick(ue)},Z.onOpenChange=function(ue){Z.props.onOpenChange(ue)},Z.onDestroy=function(ue){Z.props.onDestroy(ue)},Z.getFlatInstanceArray=function(){return Z.instanceArray},Z.step=function(ue){var $=Z.getFlatInstanceArray(),pe=Z.props.store.getState().activeKey[dn(Z.props)],Ee=$.length;if(!Ee)return null;ue<0&&($=$.concat().reverse());var Se=-1;if($.every(function(mt,ft){return mt&&mt.props.eventKey===pe?(Se=ft,!1):!0}),!Z.props.defaultActiveFirst&&Se!==-1&&Pa($.slice(Se,Ee-1)))return;var xe=(Se+1)%Ee,Re=xe;do{var Qe=$[Re];if(!Qe||Qe.props.disabled)Re=(Re+1)%Ee;else return Qe}while(Re!==xe);return null},Z.renderCommonMenuItem=function(ue,$,pe){var Ee=Z.props.store.getState(),Se=Object(u.a)(Z),xe=Se.props,Re=ke(ue,xe.eventKey,$),Qe=ue.props;if(!Qe||typeof ue.type=="string")return ue;var mt=Re===Ee.activeKey,ft=Object(K.a)(Object(K.a)({mode:Qe.mode||xe.mode,level:xe.level,inlineIndent:xe.inlineIndent,renderMenuItem:Z.renderMenuItem,rootPrefixCls:xe.prefixCls,index:$,parentMenu:xe.parentMenu,manualRef:Qe.disabled?void 0:Object(v.a)(ue.ref,rr.bind(Object(u.a)(Z))),eventKey:Re,active:!Qe.disabled&&mt,multiple:xe.multiple,onClick:function(on){(Qe.onClick||we)(on),Z.onClick(on)},onItemHover:Z.onItemHover,motion:xe.motion,subMenuOpenDelay:xe.subMenuOpenDelay,subMenuCloseDelay:xe.subMenuCloseDelay,forceSubMenuRender:xe.forceSubMenuRender,onOpenChange:Z.onOpenChange,onDeselect:Z.onDeselect,onSelect:Z.onSelect,builtinPlacements:xe.builtinPlacements,itemIcon:Qe.itemIcon||Z.props.itemIcon,expandIcon:Qe.expandIcon||Z.props.expandIcon},pe),{},{direction:xe.direction});return(xe.mode==="inline"||Ge())&&(ft.triggerSubMenuAction="click"),O.cloneElement(ue,Object(K.a)(Object(K.a)({},ft),{},{key:Re||$}))},Z.renderMenuItem=function(ue,$,pe){if(!ue)return null;var Ee=Z.props.store.getState(),Se={openKeys:Ee.openKeys,selectedKeys:Ee.selectedKeys,triggerSubMenuAction:Z.props.triggerSubMenuAction,subMenuKey:pe};return Z.renderCommonMenuItem(ue,$,Se)},ge.store.setState({activeKey:Object(K.a)(Object(K.a)({},ge.store.getState().activeKey),{},Object(q.a)({},ge.eventKey,St(ge,ge.activeKey)))}),Z.instanceArray=[],Z}return Object(x.a)(Oe,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(Z){return this.props.visible||Z.visible||this.props.className!==Z.className||!D()(this.props.style,Z.style)}},{key:"componentDidUpdate",value:function(Z){var ue=this.props,$="activeKey"in ue?ue.activeKey:ue.store.getState().activeKey[dn(ue)],pe=St(ue,$);if(pe!==$)zr(ue.store,dn(ue),pe);else if("activeKey"in Z){var Ee=St(Z,Z.activeKey);pe!==Ee&&zr(ue.store,dn(ue),pe)}}},{key:"render",value:function(){var Z=this,ue=Object(m.a)({},this.props);this.instanceArray=[];var $=U()(ue.prefixCls,ue.className,"".concat(ue.prefixCls,"-").concat(ue.mode)),pe={className:$,role:ue.role||"menu"};ue.id&&(pe.id=ue.id),ue.focusable&&(pe.tabIndex=0,pe.onKeyDown=this.onKeyDown);var Ee=ue.prefixCls,Se=ue.eventKey,xe=ue.visible,Re=ue.level,Qe=ue.mode,mt=ue.overflowedIndicator,ft=ue.theme;return ze.forEach(function(At){return delete ue[At]}),delete ue.onClick,O.createElement(Xr,Object(m.a)({},ue,{prefixCls:Ee,mode:Qe,tag:"ul",level:Re,theme:ft,visible:xe,overflowedIndicator:mt},pe),Object(I.a)(ue.children).map(function(At,on){return Z.renderMenuItem(At,on,Se||"0-menu-")}))}}]),Oe}(O.Component);vn.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:we};var Rn=Object(i.b)()(vn),yr=Rn,kr=F("Kwbf");function br(fe,Te,Oe){var ge=fe.prefixCls,Z=fe.motion,ue=fe.defaultMotions,$=ue===void 0?{}:ue,pe=fe.openAnimation,Ee=fe.openTransitionName,Se=Te.switchingModeFromInline;if(Z)return Z;if(Object(B.a)(pe)==="object"&&pe)Object(kr.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof pe=="string")return{motionName:"".concat(ge,"-open-").concat(pe)};if(Ee)return{motionName:Ee};var xe=$[Oe];return xe||(Se?null:$.other)}var Sr=function(fe){Object(l.a)(Oe,fe);var Te=Object(a.a)(Oe);function Oe(ge){var Z;Object(A.a)(this,Oe),Z=Te.call(this,ge),Z.onSelect=function(pe){var Ee=Object(u.a)(Z),Se=Ee.props;if(Se.selectable){var xe=Z.store.getState(),Re=xe.selectedKeys,Qe=pe.key;Se.multiple?Re=Re.concat([Qe]):Re=[Qe],"selectedKeys"in Se||Z.store.setState({selectedKeys:Re}),Se.onSelect(Object(K.a)(Object(K.a)({},pe),{},{selectedKeys:Re}))}},Z.onClick=function(pe){var Ee=Z.getRealMenuMode(),Se=Object(u.a)(Z),xe=Se.store,Re=Se.props.onOpenChange;Ee!=="inline"&&!("openKeys"in Z.props)&&(xe.setState({openKeys:[]}),Re([])),Z.props.onClick(pe)},Z.onKeyDown=function(pe,Ee){Z.innerMenu.getWrappedInstance().onKeyDown(pe,Ee)},Z.onOpenChange=function(pe){var Ee=Object(u.a)(Z),Se=Ee.props,xe=Z.store.getState().openKeys.concat(),Re=!1,Qe=function(ft){var At=!1;if(ft.open)At=xe.indexOf(ft.key)===-1,At&&xe.push(ft.key);else{var on=xe.indexOf(ft.key);At=on!==-1,At&&xe.splice(on,1)}Re=Re||At};Array.isArray(pe)?pe.forEach(Qe):Qe(pe),Re&&("openKeys"in Z.props||Z.store.setState({openKeys:xe}),Se.onOpenChange(xe))},Z.onDeselect=function(pe){var Ee=Object(u.a)(Z),Se=Ee.props;if(Se.selectable){var xe=Z.store.getState().selectedKeys.concat(),Re=pe.key,Qe=xe.indexOf(Re);Qe!==-1&&xe.splice(Qe,1),"selectedKeys"in Se||Z.store.setState({selectedKeys:xe}),Se.onDeselect(Object(K.a)(Object(K.a)({},pe),{},{selectedKeys:xe}))}},Z.onMouseEnter=function(pe){Z.restoreModeVerticalFromInline();var Ee=Z.props.onMouseEnter;Ee&&Ee(pe)},Z.onTransitionEnd=function(pe){var Ee=pe.propertyName==="width"&&pe.target===pe.currentTarget,Se=pe.target.className,xe=Object.prototype.toString.call(Se)==="[object SVGAnimatedString]"?Se.animVal:Se,Re=pe.propertyName==="font-size"&&xe.indexOf("anticon")>=0;(Ee||Re)&&Z.restoreModeVerticalFromInline()},Z.setInnerMenu=function(pe){Z.innerMenu=pe},Z.isRootMenu=!0;var ue=ge.defaultSelectedKeys,$=ge.defaultOpenKeys;return"selectedKeys"in ge&&(ue=ge.selectedKeys||[]),"openKeys"in ge&&($=ge.openKeys||[]),Z.store=Object(i.c)({selectedKeys:ue,openKeys:$,activeKey:{"0-menu-":St(ge,ge.activeKey)}}),Z.state={switchingModeFromInline:!1,prevProps:ge,inlineOpenKeys:[],store:Z.store},Z}return Object(x.a)(Oe,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(Z){var ue=this.props,$=ue.siderCollapsed,pe=ue.inlineCollapsed,Ee=ue.onOpenChange;(!Z.inlineCollapsed&&pe||!Z.siderCollapsed&&$)&&Ee([]),this.updateMiniStore(),this.updateMenuDisplay()}},{key:"updateMenuDisplay",value:function(){var Z=this.props.collapsedWidth,ue=this.store,$=this.prevOpenKeys,pe=this.getInlineCollapsed()&&(Z===0||Z==="0"||Z==="0px");pe?(this.prevOpenKeys=ue.getState().openKeys.concat(),this.store.setState({openKeys:[]})):$&&(this.store.setState({openKeys:$}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var Z=this.props.mode,ue=this.state.switchingModeFromInline,$=this.getInlineCollapsed();return ue&&$?"inline":$?"vertical":Z}},{key:"getInlineCollapsed",value:function(){var Z=this.props,ue=Z.inlineCollapsed,$=Z.siderCollapsed;return $!==void 0?$:ue}},{key:"restoreModeVerticalFromInline",value:function(){var Z=this.state.switchingModeFromInline;Z&&this.setState({switchingModeFromInline:!1})}},{key:"updateMiniStore",value:function(){"selectedKeys"in this.props&&this.store.setState({selectedKeys:this.props.selectedKeys||[]}),"openKeys"in this.props&&this.store.setState({openKeys:this.props.openKeys||[]})}},{key:"render",value:function(){var Z=Object(K.a)({},Object(E.a)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),ue=this.getRealMenuMode();return Z.className+=" ".concat(Z.prefixCls,"-root"),Z.direction==="rtl"&&(Z.className+=" ".concat(Z.prefixCls,"-rtl")),Z=Object(K.a)(Object(K.a)({},Z),{},{mode:ue,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:br(this.props,this.state,ue)}),delete Z.openAnimation,delete Z.openTransitionName,O.createElement(i.a,{store:this.store},O.createElement(yr,Object(m.a)({},Z,{ref:this.setInnerMenu}),this.props.children))}}],[{key:"getDerivedStateFromProps",value:function(Z,ue){var $=ue.prevProps,pe=ue.store,Ee=pe.getState(),Se={},xe={prevProps:Z};return $.mode==="inline"&&Z.mode!=="inline"&&(xe.switchingModeFromInline=!0),"openKeys"in Z?Se.openKeys=Z.openKeys||[]:((Z.inlineCollapsed&&!$.inlineCollapsed||Z.siderCollapsed&&!$.siderCollapsed)&&(xe.switchingModeFromInline=!0,xe.inlineOpenKeys=Ee.openKeys,Se.openKeys=[]),(!Z.inlineCollapsed&&$.inlineCollapsed||!Z.siderCollapsed&&$.siderCollapsed)&&(Se.openKeys=ue.inlineOpenKeys,xe.inlineOpenKeys=[])),Object.keys(Se).length&&pe.setState(Se),xe}}]),Oe}(O.Component);Sr.defaultProps={selectable:!0,onClick:we,onSelect:we,onOpenChange:we,onDeselect:we,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:O.createElement("span",null,"\xB7\xB7\xB7")};var Ir=Sr,Sa=function(fe){Object(l.a)(Oe,fe);var Te=Object(a.a)(Oe);function Oe(){var ge;return Object(A.a)(this,Oe),ge=Te.apply(this,arguments),ge.onKeyDown=function(Z){var ue=Z.keyCode;return ue===y.a.ENTER?(ge.onClick(Z),!0):void 0},ge.onMouseLeave=function(Z){var ue=ge.props,$=ue.eventKey,pe=ue.onItemHover,Ee=ue.onMouseLeave;pe({key:$,hover:!1}),Ee({key:$,domEvent:Z})},ge.onMouseEnter=function(Z){var ue=ge.props,$=ue.eventKey,pe=ue.onItemHover,Ee=ue.onMouseEnter;pe({key:$,hover:!0}),Ee({key:$,domEvent:Z})},ge.onClick=function(Z){var ue=ge.props,$=ue.eventKey,pe=ue.multiple,Ee=ue.onClick,Se=ue.onSelect,xe=ue.onDeselect,Re=ue.isSelected,Qe={key:$,keyPath:[$],item:Object(u.a)(ge),domEvent:Z};Ee(Qe),pe?Re?xe(Qe):Se(Qe):Re||Se(Qe)},ge.saveNode=function(Z){ge.node=Z},ge}return Object(x.a)(Oe,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var Z=this.props;Z.onDestroy&&Z.onDestroy(Z.eventKey)}},{key:"getPrefixCls",value:function(){return"".concat(this.props.rootPrefixCls,"-item")}},{key:"getActiveClassName",value:function(){return"".concat(this.getPrefixCls(),"-active")}},{key:"getSelectedClassName",value:function(){return"".concat(this.getPrefixCls(),"-selected")}},{key:"getDisabledClassName",value:function(){return"".concat(this.getPrefixCls(),"-disabled")}},{key:"callRef",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"render",value:function(){var Z,ue=Object(K.a)({},this.props),$=U()(this.getPrefixCls(),ue.className,(Z={},Object(q.a)(Z,this.getActiveClassName(),!ue.disabled&&ue.active),Object(q.a)(Z,this.getSelectedClassName(),ue.isSelected),Object(q.a)(Z,this.getDisabledClassName(),ue.disabled),Z)),pe=Object(K.a)(Object(K.a)({},ue.attribute),{},{title:typeof ue.title=="string"?ue.title:void 0,className:$,role:ue.role||"menuitem","aria-disabled":ue.disabled});ue.role==="option"?pe=Object(K.a)(Object(K.a)({},pe),{},{role:"option","aria-selected":ue.isSelected}):(ue.role===null||ue.role==="none")&&(pe.role="none");var Ee={onClick:ue.disabled?null:this.onClick,onMouseLeave:ue.disabled?null:this.onMouseLeave,onMouseEnter:ue.disabled?null:this.onMouseEnter},Se=Object(K.a)({},ue.style);ue.mode==="inline"&&(ue.direction==="rtl"?Se.paddingRight=ue.inlineIndent*ue.level:Se.paddingLeft=ue.inlineIndent*ue.level),ze.forEach(function(Re){return delete ue[Re]}),delete ue.direction;var xe=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(xe=O.createElement(this.props.itemIcon,this.props)),O.createElement("li",Object(m.a)({},Object(E.a)(ue,["onClick","onMouseEnter","onMouseLeave","onSelect"]),pe,Ee,{style:Se,ref:this.saveNode}),ue.children,xe)}}]),Oe}(O.Component);Sa.isMenuItem=!0,Sa.defaultProps={onSelect:we,onMouseEnter:we,onMouseLeave:we,manualRef:we};var Nr=Object(i.b)(function(fe,Te){var Oe=fe.activeKey,ge=fe.selectedKeys,Z=Te.eventKey,ue=Te.subMenuKey;return{active:Oe[ue]===Z,isSelected:Array.isArray(ge)?ge.indexOf(Z)!==-1:ge===Z}})(Sa),oi=Nr,Mt=function(fe){Object(l.a)(Oe,fe);var Te=Object(a.a)(Oe);function Oe(){var ge;return Object(A.a)(this,Oe),ge=Te.apply(this,arguments),ge.renderInnerMenuItem=function(Z){var ue=ge.props,$=ue.renderMenuItem,pe=ue.index;return $(Z,pe,ge.props.subMenuKey)},ge}return Object(x.a)(Oe,[{key:"render",value:function(){var Z=Object(m.a)({},this.props),ue=Z.className,$=ue===void 0?"":ue,pe=Z.rootPrefixCls,Ee="".concat(pe,"-item-group-title"),Se="".concat(pe,"-item-group-list"),xe=Z.title,Re=Z.children;return ze.forEach(function(Qe){return delete Z[Qe]}),delete Z.direction,O.createElement("li",Object(m.a)({},Z,{onClick:function(mt){return mt.stopPropagation()},className:"".concat($," ").concat(pe,"-item-group")}),O.createElement("div",{className:Ee,title:typeof xe=="string"?xe:void 0},xe),O.createElement("ul",{className:Se},O.Children.map(Re,this.renderInnerMenuItem)))}}]),Oe}(O.Component);Mt.isMenuItemGroup=!0,Mt.defaultProps={disabled:!0};var cn=Mt,Yt=function(Te){var Oe=Te.className,ge=Te.rootPrefixCls,Z=Te.style;return O.createElement("li",{className:"".concat(Oe," ").concat(ge,"-item-divider"),style:Z})};Yt.defaultProps={disabled:!0,className:"",style:{}};var Un=Yt,Gn=Ir,cr=F("eDIo");function Mn(fe,Te){var Oe=fe.prefixCls,ge=fe.editable,Z=fe.locale,ue=fe.style;return!ge||ge.showAdd===!1?null:O.createElement("button",{ref:Te,type:"button",className:"".concat(Oe,"-nav-add"),style:ue,"aria-label":(Z==null?void 0:Z.addAriaLabel)||"Add tab",onClick:function(pe){ge.onEdit("add",{event:pe})}},ge.addIcon||"+")}var Or=O.forwardRef(Mn);function Ur(fe,Te){var Oe=fe.prefixCls,ge=fe.id,Z=fe.tabs,ue=fe.locale,$=fe.mobile,pe=fe.moreIcon,Ee=pe===void 0?"More":pe,Se=fe.moreTransitionName,xe=fe.style,Re=fe.className,Qe=fe.editable,mt=fe.tabBarGutter,ft=fe.rtl,At=fe.onTabClick,on=Object(O.useState)(!1),On=Object(G.a)(on,2),gn=On[0],_n=On[1],Sn=Object(O.useState)(null),yn=Object(G.a)(Sn,2),An=yn[0],zn=yn[1],Ln="".concat(ge,"-more-popup"),xr="".concat(Oe,"-dropdown"),kn=An!==null?"".concat(Ln,"-").concat(An):null,Vt=ue==null?void 0:ue.dropdownAriaLabel,qt=O.createElement(Gn,{onClick:function(fr){var ir=fr.key,jr=fr.domEvent;At(ir,jr),_n(!1)},id:Ln,tabIndex:-1,role:"listbox","aria-activedescendant":kn,selectedKeys:[An],"aria-label":Vt!==void 0?Vt:"expanded dropdown"},Z.map(function(Xn){return O.createElement(oi,{key:Xn.key,id:"".concat(Ln,"-").concat(Xn.key),role:"option","aria-controls":ge&&"".concat(ge,"-panel-").concat(Xn.key),disabled:Xn.disabled},Xn.tab)}));function In(Xn){for(var fr=Z.filter(function(sa){return!sa.disabled}),ir=fr.findIndex(function(sa){return sa.key===An})||0,jr=fr.length,Yr=0;Yr<jr;Yr+=1){ir=(ir+Xn+jr)%jr;var Tr=fr[ir];if(!Tr.disabled){zn(Tr.key);return}}}function Wn(Xn){var fr=Xn.which;if(!gn){[y.a.DOWN,y.a.SPACE,y.a.ENTER].includes(fr)&&(_n(!0),Xn.preventDefault());return}switch(fr){case y.a.UP:In(-1),Xn.preventDefault();break;case y.a.DOWN:In(1),Xn.preventDefault();break;case y.a.ESC:_n(!1);break;case y.a.SPACE:case y.a.ENTER:An!==null&&At(An,Xn);break}}Object(O.useEffect)(function(){var Xn=document.getElementById(kn);Xn&&Xn.scrollIntoView&&Xn.scrollIntoView(!1)},[An]),Object(O.useEffect)(function(){gn||zn(null)},[gn]);var zt=Object(q.a)({},ft?"marginLeft":"marginRight",mt);Z.length||(zt.visibility="hidden",zt.order=1);var Dn=U()(Object(q.a)({},"".concat(xr,"-rtl"),ft)),Cr=$?null:O.createElement(cr.a,{prefixCls:xr,overlay:qt,trigger:["hover"],visible:gn,transitionName:Se,onVisibleChange:_n,overlayClassName:Dn,mouseEnterDelay:.1,mouseLeaveDelay:.1},O.createElement("button",{type:"button",className:"".concat(Oe,"-nav-more"),style:zt,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":Ln,id:"".concat(ge,"-more"),"aria-expanded":gn,onKeyDown:Wn},Ee));return O.createElement("div",{className:U()("".concat(Oe,"-nav-operations"),Re),style:xe,ref:Te},Cr,O.createElement(Or,{prefixCls:Oe,locale:ue,editable:Qe}))}var jn=O.forwardRef(Ur),Oa=Object(O.createContext)(null),ar=.1,qr=.01,Jn=20,ha=Math.pow(.995,Jn);function si(){var fe=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(fe)||/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(fe.substr(0,4)))}function Ci(fe,Te){var Oe=Object(O.useState)(),ge=Object(G.a)(Oe,2),Z=ge[0],ue=ge[1],$=Object(O.useState)(0),pe=Object(G.a)($,2),Ee=pe[0],Se=pe[1],xe=Object(O.useState)(0),Re=Object(G.a)(xe,2),Qe=Re[0],mt=Re[1],ft=Object(O.useState)(),At=Object(G.a)(ft,2),on=At[0],On=At[1],gn=Object(O.useRef)();function _n(Vt){var qt=Vt.touches[0],In=qt.screenX,Wn=qt.screenY;ue({x:In,y:Wn}),window.clearInterval(gn.current)}function Sn(Vt){if(!Z)return;Vt.preventDefault();var qt=Vt.touches[0],In=qt.screenX,Wn=qt.screenY;ue({x:In,y:Wn});var zt=In-Z.x,Dn=Wn-Z.y;Te(zt,Dn);var Cr=Date.now();Se(Cr),mt(Cr-Ee),On({x:zt,y:Dn})}function yn(){if(!Z)return;if(ue(null),On(null),on){var Vt=on.x/Qe,qt=on.y/Qe,In=Math.abs(Vt),Wn=Math.abs(qt);if(Math.max(In,Wn)<ar)return;var zt=Vt,Dn=qt;gn.current=window.setInterval(function(){if(Math.abs(zt)<qr&&Math.abs(Dn)<qr){window.clearInterval(gn.current);return}zt*=ha,Dn*=ha,Te(zt*Jn,Dn*Jn)},Jn)}}var An=Object(O.useRef)(0),zn=Object(O.useRef)(!1),Ln=Object(O.useRef)();function xr(Vt){var qt=Vt.deltaX,In=Vt.deltaY,Wn=0,zt=Math.abs(qt),Dn=Math.abs(In);zt===Dn?Wn=Ln.current==="x"?qt:In:zt>Dn?(Wn=qt,Ln.current="x"):(Wn=In,Ln.current="y");var Cr=Date.now();Cr-An.current>100&&(zn.current=!1),(Te(-Wn,-Wn)||zn.current)&&(Vt.preventDefault(),zn.current=!0),An.current=Cr}var kn=Object(O.useRef)(null);kn.current={onTouchStart:_n,onTouchMove:Sn,onTouchEnd:yn,onWheel:xr},O.useEffect(function(){function Vt(zt){kn.current.onTouchStart(zt)}function qt(zt){kn.current.onTouchMove(zt)}function In(zt){kn.current.onTouchEnd(zt)}function Wn(zt){kn.current.onWheel(zt)}return document.addEventListener("touchmove",qt,{passive:!1}),document.addEventListener("touchend",In,{passive:!1}),fe.current.addEventListener("touchstart",Vt,{passive:!1}),fe.current.addEventListener("wheel",Wn),function(){document.removeEventListener("touchmove",qt),document.removeEventListener("touchend",In)}},[])}function So(){var fe=Object(O.useRef)(new Map);function Te(ge){return fe.current.has(ge)||fe.current.set(ge,O.createRef()),fe.current.get(ge)}function Oe(ge){fe.current.delete(ge)}return[Te,Oe]}function ki(fe,Te){var Oe=O.useRef(fe),ge=O.useState({}),Z=Object(G.a)(ge,2),ue=Z[1];function $(pe){var Ee=typeof pe=="function"?pe(Oe.current):pe;Ee!==Oe.current&&Te(Ee,Oe.current),Oe.current=Ee,ue({})}return[Oe.current,$]}var Ii=function(Te){var Oe=Te.position,ge=Te.prefixCls,Z=Te.extra;if(!Z)return null;var ue,$=Z;return Oe==="right"&&(ue=$.right||!$.left&&$||null),Oe==="left"&&(ue=$.left||null),ue?O.createElement("div",{className:"".concat(ge,"-extra-content")},ue):null};function Ni(fe,Te){var Oe,ge=O.useContext(Oa),Z=ge.prefixCls,ue=ge.tabs,$=fe.className,pe=fe.style,Ee=fe.id,Se=fe.animated,xe=fe.activeKey,Re=fe.rtl,Qe=fe.extra,mt=fe.editable,ft=fe.locale,At=fe.tabPosition,on=fe.tabBarGutter,On=fe.children,gn=fe.onTabClick,_n=fe.onTabScroll,Sn=Object(O.useRef)(),yn=Object(O.useRef)(),An=Object(O.useRef)(),zn=Object(O.useRef)(),Ln=So(),xr=Object(G.a)(Ln,2),kn=xr[0],Vt=xr[1],qt=At==="top"||At==="bottom",In=ki(0,function(lr,Bn){qt&&_n&&_n({direction:lr>Bn?"left":"right"})}),Wn=Object(G.a)(In,2),zt=Wn[0],Dn=Wn[1],Cr=ki(0,function(lr,Bn){!qt&&_n&&_n({direction:lr>Bn?"top":"bottom"})}),Xn=Object(G.a)(Cr,2),fr=Xn[0],ir=Xn[1],jr=Object(O.useState)(0),Yr=Object(G.a)(jr,2),Tr=Yr[0],sa=Yr[1],Ea=Object(O.useState)(0),ma=Object(G.a)(Ea,2),Gr=ma[0],en=ma[1],Yn=Object(O.useState)(0),wr=Object(G.a)(Yn,2),Er=wr[0],Ra=wr[1],qa=Object(O.useState)(0),ei=Object(G.a)(qa,2),sr=ei[0],Fa=ei[1],Ga=Object(O.useState)(null),or=Object(G.a)(Ga,2),qn=or[0],$r=or[1],Oo=Object(O.useState)(null),$i=Object(G.a)(Oo,2),Dr=$i[0],_a=$i[1],Ui=Object(O.useState)(0),Zi=Object(G.a)(Ui,2),ji=Zi[0],wo=Zi[1],Do=Object(O.useState)(0),oo=Object(G.a)(Do,2),Bi=oo[0],Ji=oo[1],li=p(new Map),vi=Object(G.a)(li,2),so=vi[0],Ai=vi[1],_r=d(ue,so,Tr),ui="".concat(Z,"-nav-operations-hidden"),gi=0,Ma=0;qt?Re?(gi=0,Ma=Math.max(0,Tr-qn)):(gi=Math.min(0,qn-Tr),Ma=0):(gi=Math.min(0,Dr-Gr),Ma=0);function di(lr){return lr<gi?[gi,!1]:lr>Ma?[Ma,!1]:[lr,!0]}var ti=Object(O.useRef)(),Si=Object(O.useState)(),ci=Object(G.a)(Si,2),Fi=ci[0],qi=ci[1];function Oi(){qi(Date.now())}function Ki(){window.clearTimeout(ti.current)}Ci(Sn,function(lr,Bn){var Kr=!1;function va(bi,Qa){bi(function(Di){var Ya=di(Di+Qa),Fe=Object(G.a)(Ya,2),Ke=Fe[0],We=Fe[1];return Kr=We,Ke})}if(qt){if(qn>=Tr)return Kr;va(Dn,lr)}else{if(Dr>=Gr)return Kr;va(ir,Bn)}return Ki(),Oi(),Kr}),Object(O.useEffect)(function(){return Ki(),Fi&&(ti.current=window.setTimeout(function(){qi(0)},100)),Ki},[Fi]);function Va(){var lr=arguments.length>0&&arguments[0]!==void 0?arguments[0]:xe,Bn=_r.get(lr);if(!Bn)return;if(qt){var Kr=zt;Re?Bn.right<zt?Kr=Bn.right:Bn.right+Bn.width>zt+qn&&(Kr=Bn.right+Bn.width-qn):Bn.left<-zt?Kr=-Bn.left:Bn.left+Bn.width>-zt+qn&&(Kr=-(Bn.left+Bn.width-qn)),ir(0),Dn(di(Kr)[0])}else{var va=fr;Bn.top<-fr?va=-Bn.top:Bn.top+Bn.height>-fr+Dr&&(va=-(Bn.top+Bn.height-Dr)),Dn(0),ir(di(va)[0])}}var Xa=C(_r,{width:qn,height:Dr,left:zt,top:fr},{width:Er,height:sr},{width:ji,height:Bi},Object(K.a)(Object(K.a)({},fe),{},{tabs:ue})),lo=Object(G.a)(Xa,2),Po=lo[0],Ro=lo[1],Mo=ue.map(function(lr){var Bn=lr.key;return O.createElement(s,{id:Ee,prefixCls:Z,key:Bn,rtl:Re,tab:lr,closable:lr.closable,editable:mt,active:Bn===xe,tabPosition:At,tabBarGutter:on,renderWrapper:On,removeAriaLabel:ft==null?void 0:ft.removeAriaLabel,ref:kn(Bn),onClick:function(va){gn(Bn,va)},onRemove:function(){Vt(Bn)},onFocus:function(){Va(Bn),Oi(),Re||(Sn.current.scrollLeft=0),Sn.current.scrollTop=0}})}),ni=w(function(){var lr,Bn,Kr,va,bi,Qa,Di,Ya,Fe,Ke=((lr=Sn.current)===null||lr===void 0?void 0:lr.offsetWidth)||0,We=((Bn=Sn.current)===null||Bn===void 0?void 0:Bn.offsetHeight)||0,et=((Kr=zn.current)===null||Kr===void 0?void 0:Kr.offsetWidth)||0,it=((va=zn.current)===null||va===void 0?void 0:va.offsetHeight)||0,tt=((bi=An.current)===null||bi===void 0?void 0:bi.offsetWidth)||0,Et=((Qa=An.current)===null||Qa===void 0?void 0:Qa.offsetHeight)||0;$r(Ke),_a(We),wo(et),Ji(it);var ut=(((Di=yn.current)===null||Di===void 0?void 0:Di.offsetWidth)||0)-et,Ft=(((Ya=yn.current)===null||Ya===void 0?void 0:Ya.offsetHeight)||0)-it;sa(ut),en(Ft);var Pn=(Fe=An.current)===null||Fe===void 0?void 0:Fe.className.includes(ui);Ra(ut-(Pn?0:tt)),Fa(Ft-(Pn?0:Et)),Ai(function(){var la=new Map;return ue.forEach(function(Nn){var ga=Nn.key,Mr=kn(ga).current;Mr&&la.set(ga,{width:Mr.offsetWidth,height:Mr.offsetHeight,left:Mr.offsetLeft,top:Mr.offsetTop})}),la})}),Lo=ue.slice(0,Po),pa=ue.slice(Ro+1),Fr=[].concat(Object(P.a)(Lo),Object(P.a)(pa)),aa=Object(O.useState)(),Pr=Object(G.a)(aa,2),yi=Pr[0],uo=Pr[1],xa=_r.get(xe),co=Object(O.useRef)();function fo(){g.a.cancel(co.current)}Object(O.useEffect)(function(){var lr={};return xa&&(qt?(Re?lr.right=xa.right:lr.left=xa.left,lr.width=xa.width):(lr.top=xa.top,lr.height=xa.height)),fo(),co.current=g()(function(){uo(lr)}),fo},[xa,qt,Re]),Object(O.useEffect)(function(){Va()},[xe,xa,_r,qt]),Object(O.useEffect)(function(){ni()},[Re,on,xe,ue.map(function(lr){return lr.key}).join("_")]);var ho=!!Fr.length,fi="".concat(Z,"-nav-wrap"),Wi,wi,mo,Hi;return qt?Re?(wi=zt>0,Wi=zt+qn<Tr):(Wi=zt<0,wi=-zt+qn<Tr):(mo=fr<0,Hi=-fr+Dr<Gr),O.createElement("div",{ref:Te,role:"tablist",className:U()("".concat(Z,"-nav"),$),style:pe,onKeyDown:function(){Oi()}},O.createElement(Ii,{position:"left",extra:Qe,prefixCls:Z}),O.createElement(k.a,{onResize:ni},O.createElement("div",{className:U()(fi,(Oe={},Object(q.a)(Oe,"".concat(fi,"-ping-left"),Wi),Object(q.a)(Oe,"".concat(fi,"-ping-right"),wi),Object(q.a)(Oe,"".concat(fi,"-ping-top"),mo),Object(q.a)(Oe,"".concat(fi,"-ping-bottom"),Hi),Oe)),ref:Sn},O.createElement(k.a,{onResize:ni},O.createElement("div",{ref:yn,className:"".concat(Z,"-nav-list"),style:{transform:"translate(".concat(zt,"px, ").concat(fr,"px)"),transition:Fi?"none":void 0}},Mo,O.createElement(Or,{ref:zn,prefixCls:Z,locale:ft,editable:mt,style:{visibility:ho?"hidden":null}}),O.createElement("div",{className:U()("".concat(Z,"-ink-bar"),Object(q.a)({},"".concat(Z,"-ink-bar-animated"),Se.inkBar)),style:yi}))))),O.createElement(jn,Object.assign({},fe,{ref:An,prefixCls:Z,tabs:Fr,className:!ho&&ui})),O.createElement(Ii,{position:"right",extra:Qe,prefixCls:Z}))}var Yi=O.forwardRef(Ni);function ro(fe){var Te=fe.id,Oe=fe.activeKey,ge=fe.animated,Z=fe.tabPosition,ue=fe.rtl,$=fe.destroyInactiveTabPane,pe=O.useContext(Oa),Ee=pe.prefixCls,Se=pe.tabs,xe=ge.tabPane,Re=Se.findIndex(function(Qe){return Qe.key===Oe});return O.createElement("div",{className:U()("".concat(Ee,"-content-holder"))},O.createElement("div",{className:U()("".concat(Ee,"-content"),"".concat(Ee,"-content-").concat(Z),Object(q.a)({},"".concat(Ee,"-content-animated"),xe)),style:Re&&xe?Object(q.a)({},ue?"marginRight":"marginLeft","-".concat(Re,"00%")):null},Se.map(function(Qe){return O.cloneElement(Qe.node,{key:Qe.key,prefixCls:Ee,tabKey:Qe.key,id:Te,animated:xe,active:Qe.key===Oe,destroyInactiveTabPane:$})})))}function ao(fe){var Te=fe.prefixCls,Oe=fe.forceRender,ge=fe.className,Z=fe.style,ue=fe.id,$=fe.active,pe=fe.animated,Ee=fe.destroyInactiveTabPane,Se=fe.tabKey,xe=fe.children,Re=O.useState(Oe),Qe=Object(G.a)(Re,2),mt=Qe[0],ft=Qe[1];O.useEffect(function(){$?ft(!0):Ee&&ft(!1)},[$,Ee]);var At={};return $||(pe?(At.visibility="hidden",At.height=0,At.overflowY="hidden"):At.display="none"),O.createElement("div",{id:ue&&"".concat(ue,"-panel-").concat(Se),role:"tabpanel",tabIndex:$?0:-1,"aria-labelledby":ue&&"".concat(ue,"-tab-").concat(Se),"aria-hidden":!$,style:Object(K.a)(Object(K.a)({},At),Z),className:U()("".concat(Te,"-tabpane"),$&&"".concat(Te,"-tabpane-active"),ge)},($||mt||Oe)&&xe)}var Ti=0;function io(fe){return Object(I.a)(fe).map(function(Te){if(O.isValidElement(Te)){var Oe=Te.key!==void 0?String(Te.key):void 0;return Object(K.a)(Object(K.a)({key:Oe},Te.props),{},{node:Te})}return null}).filter(function(Te){return Te})}function Xo(fe,Te){var Oe,ge=fe.id,Z=fe.prefixCls,ue=Z===void 0?"rc-tabs":Z,$=fe.className,pe=fe.children,Ee=fe.direction,Se=fe.activeKey,xe=fe.defaultActiveKey,Re=fe.editable,Qe=fe.animated,mt=fe.tabPosition,ft=mt===void 0?"top":mt,At=fe.tabBarGutter,on=fe.tabBarStyle,On=fe.tabBarExtraContent,gn=fe.locale,_n=fe.moreIcon,Sn=fe.moreTransitionName,yn=fe.destroyInactiveTabPane,An=fe.renderTabBar,zn=fe.onChange,Ln=fe.onTabClick,xr=fe.onTabScroll,kn=Object(R.a)(fe,["id","prefixCls","className","children","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll"]),Vt=io(pe),qt=Ee==="rtl",In;Qe===!1?In={inkBar:!1,tabPane:!1}:In=Object(K.a)({inkBar:!0,tabPane:!1},Qe!==!0?Qe:null);var Wn=Object(O.useState)(!1),zt=Object(G.a)(Wn,2),Dn=zt[0],Cr=zt[1];Object(O.useEffect)(function(){Cr(si())},[]);var Xn=Object(T.a)(function(){var sr;return(sr=Vt[0])===null||sr===void 0?void 0:sr.key},{value:Se,defaultValue:xe}),fr=Object(G.a)(Xn,2),ir=fr[0],jr=fr[1],Yr=Object(O.useState)(function(){return Vt.findIndex(function(sr){return sr.key===ir})}),Tr=Object(G.a)(Yr,2),sa=Tr[0],Ea=Tr[1];Object(O.useEffect)(function(){var sr=Vt.findIndex(function(Ga){return Ga.key===ir});if(sr===-1){var Fa;sr=Math.max(0,Math.min(sa,Vt.length-1)),jr((Fa=Vt[sr])===null||Fa===void 0?void 0:Fa.key)}Ea(sr)},[Vt.map(function(sr){return sr.key}).join("_"),ir,sa]);var ma=Object(T.a)(null,{value:ge}),Gr=Object(G.a)(ma,2),en=Gr[0],Yn=Gr[1],wr=ft;Dn&&!["left","right"].includes(ft)&&(wr="top"),Object(O.useEffect)(function(){ge||(Yn("rc-tabs-".concat(Ti)),Ti+=1)},[]);function Er(sr,Fa){Ln==null||Ln(sr,Fa),jr(sr),zn==null||zn(sr)}var Ra={id:en,activeKey:ir,animated:In,tabPosition:wr,rtl:qt,mobile:Dn},qa,ei=Object(K.a)(Object(K.a)({},Ra),{},{editable:Re,locale:gn,moreIcon:_n,moreTransitionName:Sn,tabBarGutter:At,onTabClick:Er,onTabScroll:xr,extra:On,style:on,panes:pe});return An?qa=An(ei,Yi):qa=O.createElement(Yi,Object.assign({},ei)),O.createElement(Oa.Provider,{value:{tabs:Vt,prefixCls:ue}},O.createElement("div",Object.assign({ref:Te,id:ge,className:U()(ue,"".concat(ue,"-").concat(wr),(Oe={},Object(q.a)(Oe,"".concat(ue,"-mobile"),Dn),Object(q.a)(Oe,"".concat(ue,"-editable"),Re),Object(q.a)(Oe,"".concat(ue,"-rtl"),qt),Oe),$)},kn),qa,O.createElement(ro,Object.assign({destroyInactiveTabPane:yn},Ra,{animated:In}))))}var za=O.forwardRef(Xo);za.TabPane=ao;var ba=za,Qr=Ne.b=ba},kSUc:function(at,Ne,F){},lZu9:function(at,Ne,F){(function(q){q(F("VrN/"),F("1eCo"),F("8EBN"))})(function(q){"use strict";q.defineMode("markdown",function(G,R){var K=q.getMode(G,"text/html"),O=K.name=="null";function L(h){if(q.findModeByName){var N=q.findModeByName(h);N&&(h=N.mime||N.mimes[0])}var H=q.getMode(G,h);return H.name=="null"?null:H}R.highlightFormatting===void 0&&(R.highlightFormatting=!1),R.maxBlockquoteDepth===void 0&&(R.maxBlockquoteDepth=0),R.taskLists===void 0&&(R.taskLists=!1),R.strikethrough===void 0&&(R.strikethrough=!1),R.emoji===void 0&&(R.emoji=!1),R.fencedCodeBlockHighlighting===void 0&&(R.fencedCodeBlockHighlighting=!0),R.fencedCodeBlockDefaultMode===void 0&&(R.fencedCodeBlockDefaultMode="text/plain"),R.xml===void 0&&(R.xml=!0),R.tokenTypeOverrides===void 0&&(R.tokenTypeOverrides={});var U={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 I in U)U.hasOwnProperty(I)&&R.tokenTypeOverrides[I]&&(U[I]=R.tokenTypeOverrides[I]);var T=/^([*\-_])(?:\s*\1){2,}\s*$/,P=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,b=/^\[(x| )\](?=\s)/i,g=R.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,k=/^ {0,3}(?:\={1,}|-{2,})\s*$/,w=/^[^#!\[\]*_\\<>` "'(~:]+/,p=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,y=/^\s*\[[^\]]+?\]:.*$/,f=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,s=" ";function c(h,N,H){return N.f=N.inline=H,H(h,N)}function d(h,N,H){return N.f=N.block=H,H(h,N)}function S(h){return!h||!/\S/.test(h.string)}function C(h){if(h.linkTitle=!1,h.linkHref=!1,h.linkText=!1,h.em=!1,h.strong=!1,h.strikethrough=!1,h.quote=0,h.indentedCode=!1,h.f==A){var N=O;if(!N){var H=q.innerMode(K,h.htmlState);N=H.mode.name=="xml"&&H.state.tagStart===null&&!H.state.context&&H.state.tokenize.isInText}N&&(h.f=a,h.block=m,h.htmlState=null)}return h.trailingSpace=0,h.trailingSpaceNewLine=!1,h.prevLine=h.thisLine,h.thisLine={stream:null},null}function m(h,N){var H=h.column()===N.indentation,X=S(N.prevLine.stream),Y=N.indentedCode,re=N.prevLine.hr,he=N.list!==!1,de=(N.listStack[N.listStack.length-1]||0)+3;N.indentedCode=!1;var ne=N.indentation;if(N.indentationDiff===null&&(N.indentationDiff=N.indentation,he)){for(N.list=null;ne<N.listStack[N.listStack.length-1];)N.listStack.pop(),N.listStack.length?N.indentation=N.listStack[N.listStack.length-1]:N.list=!1;N.list!==!1&&(N.indentationDiff=ne-N.listStack[N.listStack.length-1])}var ae=!X&&!re&&!N.prevLine.header&&(!he||!Y)&&!N.prevLine.fencedCodeEnd,le=(N.list===!1||re||X)&&N.indentation<=de&&h.match(T),ee=null;if(N.indentationDiff>=4&&(Y||N.prevLine.fencedCodeEnd||N.prevLine.header||X))return h.skipToEnd(),N.indentedCode=!0,U.code;if(h.eatSpace())return null;if(H&&N.indentation<=de&&(ee=h.match(g))&&ee[1].length<=6)return N.quote=0,N.header=ee[1].length,N.thisLine.header=!0,R.highlightFormatting&&(N.formatting="header"),N.f=N.inline,u(N);if(N.indentation<=de&&h.eat(">"))return N.quote=H?1:N.quote+1,R.highlightFormatting&&(N.formatting="quote"),h.eatSpace(),u(N);if(!le&&!N.setext&&H&&N.indentation<=de&&(ee=h.match(P))){var ie=ee[1]?"ol":"ul";return N.indentation=ne+h.current().length,N.list=!0,N.quote=0,N.listStack.push(N.indentation),N.em=!1,N.strong=!1,N.code=!1,N.strikethrough=!1,R.taskLists&&h.match(b,!1)&&(N.taskList=!0),N.f=N.inline,R.highlightFormatting&&(N.formatting=["list","list-"+ie]),u(N)}else{if(H&&N.indentation<=de&&(ee=h.match(p,!0)))return N.quote=0,N.fencedEndRE=new RegExp(ee[1]+"+ *$"),N.localMode=R.fencedCodeBlockHighlighting&&L(ee[2]||R.fencedCodeBlockDefaultMode),N.localMode&&(N.localState=q.startState(N.localMode)),N.f=N.block=x,R.highlightFormatting&&(N.formatting="code-block"),N.code=-1,u(N);if(N.setext||(!ae||!he)&&!N.quote&&N.list===!1&&!N.code&&!le&&!y.test(h.string)&&(ee=h.lookAhead(1))&&(ee=ee.match(k)))return N.setext?(N.header=N.setext,N.setext=0,h.skipToEnd(),R.highlightFormatting&&(N.formatting="header")):(N.header=ee[0].charAt(0)=="="?1:2,N.setext=N.header),N.thisLine.header=!0,N.f=N.inline,u(N);if(le)return h.skipToEnd(),N.hr=!0,N.thisLine.hr=!0,U.hr;if(h.peek()==="[")return c(h,N,D)}return c(h,N,N.inline)}function A(h,N){var H=K.token(h,N.htmlState);if(!O){var X=q.innerMode(K,N.htmlState);(X.mode.name=="xml"&&X.state.tagStart===null&&!X.state.context&&X.state.tokenize.isInText||N.md_inside&&h.current().indexOf(">")>-1)&&(N.f=a,N.block=m,N.htmlState=null)}return H}function x(h,N){var H=N.listStack[N.listStack.length-1]||0,X=N.indentation<H,Y=H+3;if(N.fencedEndRE&&N.indentation<=Y&&(X||h.match(N.fencedEndRE))){R.highlightFormatting&&(N.formatting="code-block");var re;return X||(re=u(N)),N.localMode=N.localState=null,N.block=m,N.f=a,N.fencedEndRE=null,N.code=0,N.thisLine.fencedCodeEnd=!0,X?d(h,N,N.block):re}else return N.localMode?N.localMode.token(h,N.localState):(h.skipToEnd(),U.code)}function u(h){var N=[];if(h.formatting){N.push(U.formatting),typeof h.formatting=="string"&&(h.formatting=[h.formatting]);for(var H=0;H<h.formatting.length;H++)N.push(U.formatting+"-"+h.formatting[H]),h.formatting[H]==="header"&&N.push(U.formatting+"-"+h.formatting[H]+"-"+h.header),h.formatting[H]==="quote"&&(!R.maxBlockquoteDepth||R.maxBlockquoteDepth>=h.quote?N.push(U.formatting+"-"+h.formatting[H]+"-"+h.quote):N.push("error"))}if(h.taskOpen)return N.push("meta"),N.length?N.join(" "):null;if(h.taskClosed)return N.push("property"),N.length?N.join(" "):null;if(h.linkHref?N.push(U.linkHref,"url"):(h.strong&&N.push(U.strong),h.em&&N.push(U.em),h.strikethrough&&N.push(U.strikethrough),h.emoji&&N.push(U.emoji),h.linkText&&N.push(U.linkText),h.code&&N.push(U.code),h.image&&N.push(U.image),h.imageAltText&&N.push(U.imageAltText,"link"),h.imageMarker&&N.push(U.imageMarker)),h.header&&N.push(U.header,U.header+"-"+h.header),h.quote&&(N.push(U.quote),!R.maxBlockquoteDepth||R.maxBlockquoteDepth>=h.quote?N.push(U.quote+"-"+h.quote):N.push(U.quote+"-"+R.maxBlockquoteDepth)),h.list!==!1){var X=(h.listStack.length-1)%3;X?X===1?N.push(U.list2):N.push(U.list3):N.push(U.list1)}return h.trailingSpaceNewLine?N.push("trailing-space-new-line"):h.trailingSpace&&N.push("trailing-space-"+(h.trailingSpace%2?"a":"b")),N.length?N.join(" "):null}function l(h,N){return h.match(w,!0)?u(N):void 0}function a(h,N){var H=N.text(h,N);if(typeof H!="undefined")return H;if(N.list)return N.list=null,u(N);if(N.taskList){var X=h.match(b,!0)[1]===" ";return X?N.taskOpen=!0:N.taskClosed=!0,R.highlightFormatting&&(N.formatting="task"),N.taskList=!1,u(N)}if(N.taskOpen=!1,N.taskClosed=!1,N.header&&h.match(/^#+$/,!0))return R.highlightFormatting&&(N.formatting="header"),u(N);var Y=h.next();if(N.linkTitle){N.linkTitle=!1;var re=Y;Y==="("&&(re=")"),re=(re+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var he="^\\s*(?:[^"+re+"\\\\]+|\\\\\\\\|\\\\.)"+re;if(h.match(new RegExp(he),!0))return U.linkHref}if(Y==="`"){var de=N.formatting;R.highlightFormatting&&(N.formatting="code"),h.eatWhile("`");var ne=h.current().length;if(N.code==0&&(!N.quote||ne==1))return N.code=ne,u(N);if(ne==N.code){var ae=u(N);return N.code=0,ae}else return N.formatting=de,u(N)}else if(N.code)return u(N);if(Y==="\\"&&(h.next(),R.highlightFormatting)){var le=u(N),ee=U.formatting+"-escape";return le?le+" "+ee:ee}if(Y==="!"&&h.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return N.imageMarker=!0,N.image=!0,R.highlightFormatting&&(N.formatting="image"),u(N);if(Y==="["&&N.imageMarker&&h.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return N.imageMarker=!1,N.imageAltText=!0,R.highlightFormatting&&(N.formatting="image"),u(N);if(Y==="]"&&N.imageAltText){R.highlightFormatting&&(N.formatting="image");var le=u(N);return N.imageAltText=!1,N.image=!1,N.inline=N.f=E,le}if(Y==="["&&!N.image)return N.linkText&&h.match(/^.*?\]/)||(N.linkText=!0,R.highlightFormatting&&(N.formatting="link")),u(N);if(Y==="]"&&N.linkText){R.highlightFormatting&&(N.formatting="link");var le=u(N);return N.linkText=!1,N.inline=N.f=h.match(/\(.*?\)| ?\[.*?\]/,!1)?E:a,le}if(Y==="<"&&h.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){N.f=N.inline=i,R.highlightFormatting&&(N.formatting="link");var le=u(N);return le?le+=" ":le="",le+U.linkInline}if(Y==="<"&&h.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){N.f=N.inline=i,R.highlightFormatting&&(N.formatting="link");var le=u(N);return le?le+=" ":le="",le+U.linkEmail}if(R.xml&&Y==="<"&&h.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var ie=h.string.indexOf(">",h.pos);if(ie!=-1){var ve=h.string.substring(h.start,ie);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(ve)&&(N.md_inside=!0)}return h.backUp(1),N.htmlState=q.startState(K),d(h,N,A)}if(R.xml&&Y==="<"&&h.match(/^\/\w*?>/))return N.md_inside=!1,"tag";if(Y==="*"||Y==="_"){for(var Pe=1,Ie=h.pos==1?" ":h.string.charAt(h.pos-2);Pe<3&&h.eat(Y);)Pe++;var we=h.peek()||" ",ke=!/\s/.test(we)&&(!f.test(we)||/\s/.test(Ie)||f.test(Ie)),De=!/\s/.test(Ie)&&(!f.test(Ie)||/\s/.test(we)||f.test(we)),Le=null,Ve=null;if(Pe%2&&(!N.em&&ke&&(Y==="*"||!De||f.test(Ie))?Le=!0:N.em==Y&&De&&(Y==="*"||!ke||f.test(we))&&(Le=!1)),Pe>1&&(!N.strong&&ke&&(Y==="*"||!De||f.test(Ie))?Ve=!0:N.strong==Y&&De&&(Y==="*"||!ke||f.test(we))&&(Ve=!1)),Ve!=null||Le!=null){R.highlightFormatting&&(N.formatting=Le==null?"strong":Ve==null?"em":"strong em"),Le===!0&&(N.em=Y),Ve===!0&&(N.strong=Y);var ae=u(N);return Le===!1&&(N.em=!1),Ve===!1&&(N.strong=!1),ae}}else if(Y===" "&&(h.eat("*")||h.eat("_"))){if(h.peek()===" ")return u(N);h.backUp(1)}if(R.strikethrough){if(Y==="~"&&h.eatWhile(Y)){if(N.strikethrough){R.highlightFormatting&&(N.formatting="strikethrough");var ae=u(N);return N.strikethrough=!1,ae}else if(h.match(/^[^\s]/,!1))return N.strikethrough=!0,R.highlightFormatting&&(N.formatting="strikethrough"),u(N)}else if(Y===" "&&h.match(/^~~/,!0)){if(h.peek()===" ")return u(N);h.backUp(2)}}if(R.emoji&&Y===":"&&h.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){N.emoji=!0,R.highlightFormatting&&(N.formatting="emoji");var ze=u(N);return N.emoji=!1,ze}return Y===" "&&(h.match(/^ +$/,!1)?N.trailingSpace++:N.trailingSpace&&(N.trailingSpaceNewLine=!0)),u(N)}function i(h,N){var H=h.next();if(H===">"){N.f=N.inline=a,R.highlightFormatting&&(N.formatting="link");var X=u(N);return X?X+=" ":X="",X+U.linkInline}return h.match(/^[^>]+/,!0),U.linkInline}function E(h,N){if(h.eatSpace())return null;var H=h.next();return H==="("||H==="["?(N.f=N.inline=_(H==="("?")":"]"),R.highlightFormatting&&(N.formatting="link-string"),N.linkHref=!0,u(N)):"error"}var v={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function _(h){return function(N,H){var X=N.next();if(X===h){H.f=H.inline=a,R.highlightFormatting&&(H.formatting="link-string");var Y=u(H);return H.linkHref=!1,Y}return N.match(v[h]),H.linkHref=!0,u(H)}}function D(h,N){return h.match(/^([^\]\\]|\\.)*\]:/,!1)?(N.f=B,h.next(),R.highlightFormatting&&(N.formatting="link"),N.linkText=!0,u(N)):c(h,N,a)}function B(h,N){if(h.match(/^\]:/,!0)){N.f=N.inline=j,R.highlightFormatting&&(N.formatting="link");var H=u(N);return N.linkText=!1,H}return h.match(/^([^\]\\]|\\.)+/,!0),U.linkText}function j(h,N){return h.eatSpace()?null:(h.match(/^[^\s]+/,!0),h.peek()===void 0?N.linkTitle=!0:h.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),N.f=N.inline=a,U.linkHref+" url")}var W={startState:function(){return{f:m,prevLine:{stream:null},thisLine:{stream:null},block:m,htmlState:null,indentation:0,inline:a,text:l,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(h){return{f:h.f,prevLine:h.prevLine,thisLine:h.thisLine,block:h.block,htmlState:h.htmlState&&q.copyState(K,h.htmlState),indentation:h.indentation,localMode:h.localMode,localState:h.localMode?q.copyState(h.localMode,h.localState):null,inline:h.inline,text:h.text,formatting:!1,linkText:h.linkText,linkTitle:h.linkTitle,linkHref:h.linkHref,code:h.code,em:h.em,strong:h.strong,strikethrough:h.strikethrough,emoji:h.emoji,header:h.header,setext:h.setext,hr:h.hr,taskList:h.taskList,list:h.list,listStack:h.listStack.slice(0),quote:h.quote,indentedCode:h.indentedCode,trailingSpace:h.trailingSpace,trailingSpaceNewLine:h.trailingSpaceNewLine,md_inside:h.md_inside,fencedEndRE:h.fencedEndRE}},token:function(h,N){if(N.formatting=!1,h!=N.thisLine.stream){if(N.header=0,N.hr=!1,h.match(/^\s*$/,!0))return C(N),null;if(N.prevLine=N.thisLine,N.thisLine={stream:h},N.taskList=!1,N.trailingSpace=0,N.trailingSpaceNewLine=!1,!N.localState&&(N.f=N.block,N.f!=A)){var H=h.match(/^\s*/,!0)[0].replace(/\t/g,s).length;if(N.indentation=H,N.indentationDiff=null,H>0)return null}}return N.f(h,N)},innerMode:function(h){return h.block==A?{state:h.htmlState,mode:K}:h.localState?{state:h.localState,mode:h.localMode}:{state:h,mode:W}},indent:function(h,N,H){return h.block==A&&K.indent?K.indent(h.htmlState,N,H):h.localState&&h.localMode.indent?h.localMode.indent(h.localState,N,H):q.Pass},blankLine:C,getType:u,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return W},"xml"),q.defineMIME("text/markdown","markdown"),q.defineMIME("text/x-markdown","markdown")})},mOS8:function(at,Ne,F){at.exports=F.p+"static/403Qrcode.6c17b6f4.png"},mgmH:function(at,Ne,F){"use strict";F.d(Ne,"d",function(){return k}),F.d(Ne,"b",function(){return w}),F.d(Ne,"e",function(){return p}),F.d(Ne,"c",function(){return y}),F.d(Ne,"n",function(){return f}),F.d(Ne,"g",function(){return s}),F.d(Ne,"h",function(){return c}),F.d(Ne,"j",function(){return S}),F.d(Ne,"a",function(){return C}),F.d(Ne,"l",function(){return m}),F.d(Ne,"f",function(){return A}),F.d(Ne,"k",function(){return x}),F.d(Ne,"m",function(){return u}),F.d(Ne,"i",function(){return l}),F.d(Ne,"o",function(){return a}),F.d(Ne,"t",function(){return i}),F.d(Ne,"s",function(){return E}),F.d(Ne,"p",function(){return v}),F.d(Ne,"q",function(){return _}),F.d(Ne,"r",function(){return D}),F.d(Ne,"v",function(){return B}),F.d(Ne,"u",function(){return j});var q=F("miYZ"),G=F("tsqr"),R=F("k1fw"),K=F("9og8"),O=F("WmNS"),L=F.n(O),U=F("oUNq"),I=F("9kvl"),T=F("1vsH"),P=F("m3rI"),b=function(){Object(I.c)()._store.dispatch({type:"globalSetting/setGlobalLoading",payload:{show:!0,text:"\u6B63\u5728\u751F\u6210\u6587\u4EF6\uFF0C\u8BF7\u7A0D\u540E..."}})},g=function(){Object(I.c)()._store.dispatch({type:"globalSetting/setGlobalLoading",payload:{show:!1,text:""}})},k=function(){var W=Object(K.a)(L.a.mark(function h(N){var H;return L.a.wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:return b(),Y.next=3,Object(U.t)(Object(R.a)({},N));case 3:if(H=Y.sent,!(H.status===0)){Y.next=7;break}return Y.next=7,Object(T.w)("",Object(T.ab)({url:P.a.API_SERVER+"/api/courses/".concat(N.coursesId,"/export_couser_info.json"),query:N}));case 7:g();case 8:case"end":return Y.stop()}},h)}));return function(N){return W.apply(this,arguments)}}(),w=function(){var W=Object(K.a)(L.a.mark(function h(N){var H;return L.a.wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:return Y.next=2,Object(U.r)(Object(R.a)({},N));case 2:if(H=Y.sent,!(H.status===0)){Y.next=8;break}G.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),I.d.push("/classrooms/".concat(N.coursesId,"/exportlist/course_member_act_score")),Y.next=13;break;case 8:if(!(H.status===-2)){Y.next=12;break}return Y.abrupt("return",H);case 12:H.status===-3&&(Object(I.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),I.d.push("/classrooms/".concat(N.coursesId,"/exportlist/course_member_act_score")));case 13:case"end":return Y.stop()}},h)}));return function(N){return W.apply(this,arguments)}}(),p=function(){var W=Object(K.a)(L.a.mark(function h(N){var H;return L.a.wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:return Y.next=2,Object(U.u)(Object(R.a)({},N));case 2:if(H=Y.sent,!(H.status===0)){Y.next=8;break}G.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),I.d.push("/classrooms/".concat(N.coursesId,"/exportlist/course_total_score")),Y.next=13;break;case 8:if(!(H.status===-2)){Y.next=12;break}return Y.abrupt("return",H);case 12:H.status===-3&&(Object(I.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),I.d.push("/classrooms/".concat(N.coursesId,"/exportlist/course_total_score")));case 13:case"end":return Y.stop()}},h)}));return function(N){return W.apply(this,arguments)}}(),y=function(){var W=Object(K.a)(L.a.mark(function h(N){var H;return L.a.wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:return Y.next=2,Object(U.s)(Object(R.a)({},N));case 2:if(H=Y.sent,!(H.status===0)){Y.next=8;break}G.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),I.d.push("/classrooms/".concat(N.coursesId,"/exportlist/course_total_exercise_and_other")),Y.next=13;break;case 8:if(!(H.status===-2)){Y.next=12;break}return Y.abrupt("return",H);case 12:H.status===-3&&(Object(I.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),I.d.push("/classrooms/".concat(N.coursesId,"/exportlist/course_total_exercise_and_other")));case 13:case"end":return Y.stop()}},h)}));return function(N){return W.apply(this,arguments)}}(),f=function(){var W=Object(K.a)(L.a.mark(function h(N){var H;return L.a.wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:return Y.next=2,Object(U.z)(Object(R.a)({},N));case 2:if(H=Y.sent,!(H.status===0)){Y.next=8;break}G.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),I.d.push("/classrooms/".concat(N.coursesId,"/exportlist/course_total_exercise_and_other")),Y.next=13;break;case 8:if(!(H.status===-2)){Y.next=12;break}return Y.abrupt("return",H);case 12:H.status===-3&&(Object(I.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),I.d.push("/classrooms/".concat(N.coursesId,"/exportlist/course_total_exercise_and_other")));case 13:case"end":return Y.stop()}},h)}));return function(N){return W.apply(this,arguments)}}(),s=function(){var W=Object(K.a)(L.a.mark(function h(N){var H;return L.a.wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:return Y.next=2,Object(U.v)(Object(R.a)({},N));case 2:if(H=Y.sent,!(H.status===0)){Y.next=8;break}G.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),I.d.push("/classrooms/".concat(N.coursesId,"/exportlist/course_total_homework")),Y.next=13;break;case 8:if(!(H.status===-2)){Y.next=12;break}return Y.abrupt("return",H);case 12:H.status===-3&&(Object(I.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),I.d.push("/classrooms/".concat(N.coursesId,"/exportlist/course_total_homework")));case 13:case"end":return Y.stop()}},h)}));return function(N){return W.apply(this,arguments)}}(),c=function(){var W=Object(K.a)(L.a.mark(function h(N,H){var X;return L.a.wrap(function(re){for(;;)switch(re.prev=re.next){case 0:return re.next=2,Object(U.x)(Object(R.a)({},N));case 2:X=re.sent,X.status===0?(G.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),I.d.push("/classrooms/".concat(N.coursesId,"/exportlist/").concat(H))):X.status===-3&&(Object(I.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),I.d.push("/classrooms/".concat(N.coursesId,"/exportlist/").concat(H)));case 4:case"end":return re.stop()}},h)}));return function(N,H){return W.apply(this,arguments)}}(),d=function(){var W=Object(K.a)(L.a.mark(function h(N){var H;return L.a.wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:return b(),Y.next=3,Object(U.w)(Object(R.a)({},N));case 3:if(H=Y.sent,!(H.status===0)){Y.next=7;break}return Y.next=7,Object(T.w)("",Object(T.ab)({url:P.a.API_SERVER+"/api/homework_commons/".concat(N.categoryId,"/works_list.zip"),query:N}));case 7:g();case 8:case"end":return Y.stop()}},h)}));return function(N){return W.apply(this,arguments)}}(),S=function(){var W=Object(K.a)(L.a.mark(function h(N){var H;return L.a.wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:return b(),Y.next=3,Object(U.A)(Object(R.a)({},N));case 3:if(H=Y.sent,!(H.status===0)){Y.next=7;break}return Y.next=7,Object(T.w)("",Object(T.ab)({url:P.a.API_SERVER+"/api/polls/".concat(N.categoryId,"/commit_result.xlsx"),query:N}));case 7:g();case 8:case"end":return Y.stop()}},h)}));return function(N){return W.apply(this,arguments)}}(),C=function(){var W=Object(K.a)(L.a.mark(function h(N){return L.a.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return X.next=2,Object(T.v)("",Object(T.ab)({url:P.a.API_SERVER+"/api/courses/".concat(N.coursesId,"/attendances/export_xlsx_data.xlsx"),query:N}));case 2:case"end":return X.stop()}},h)}));return function(N){return W.apply(this,arguments)}}(),m=function(){var W=Object(K.a)(L.a.mark(function h(N){return L.a.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return X.next=2,Object(T.v)("",Object(T.ab)({url:P.a.API_SERVER+"/api/courses/".concat(N.coursesId,"/video_study_statics.xlsx"),query:N}));case 2:case"end":return X.stop()}},h)}));return function(N){return W.apply(this,arguments)}}(),A=function(){var W=Object(K.a)(L.a.mark(function h(N){return L.a.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return X.next=2,Object(T.v)("",Object(T.ab)({url:P.a.API_SERVER+"/api/courses/".concat(N.coursesId,"/export_course_students_info.xlsx"),query:N}));case 2:case"end":return X.stop()}},h)}));return function(N){return W.apply(this,arguments)}}(),x=function(){var W=Object(K.a)(L.a.mark(function h(N){return L.a.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return X.next=2,Object(T.v)("",Object(T.ab)({url:P.a.API_SERVER+"/api/item_banks/export.xlsx",query:N}));case 2:case"end":return X.stop()}},h)}));return function(N){return W.apply(this,arguments)}}(),u=function(){var W=Object(K.a)(L.a.mark(function h(N){return L.a.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return X.next=2,Object(T.v)("",Object(T.ab)({url:P.a.API_SERVER+"/api/competitions/region_reports.xlsx",query:N}));case 2:case"end":return X.stop()}},h)}));return function(N){return W.apply(this,arguments)}}(),l=function(){var W=Object(K.a)(L.a.mark(function h(N){var H;return L.a.wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:return Y.next=2,Object(U.y)(Object(R.a)({},N));case 2:H=Y.sent,H.status===0?(G.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),I.d.push("/classrooms/".concat(N.coursesId,"/exportlist/exercise_score"))):H.status===-3&&(Object(I.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),I.d.push("/classrooms/".concat(N.coursesId,"/exportlist/exercise_score")));case 4:case"end":return Y.stop()}},h)}));return function(N){return W.apply(this,arguments)}}(),a=function(){var W=Object(K.a)(L.a.mark(function h(N){return L.a.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return console.log("----------","\u8C03\u7528\u4E0B\u8F7D"),X.next=3,Object(T.v)("",Object(T.ab)({url:P.a.API_SERVER+"/api/export_records/".concat(N.id,".xlsx"),query:N}));case 3:case"end":return X.stop()}},h)}));return function(N){return W.apply(this,arguments)}}(),i=function(){var W=Object(K.a)(L.a.mark(function h(N){return L.a.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return X.next=2,Object(T.v)("",Object(T.ab)({url:P.a.API_SERVER+"/api/ec_major_schools/0/ec_years.xlsx",query:N}));case 2:case"end":return X.stop()}},h)}));return function(N){return W.apply(this,arguments)}}(),E=function(){var W=Object(K.a)(L.a.mark(function h(N){return L.a.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return X.next=2,Object(T.v)("",Object(T.ab)({url:P.a.API_SERVER+"/api/ec_years/".concat(N==null?void 0:N.ec_year_id,"/ec_training_objectives.xlsx"),query:N}));case 2:case"end":return X.stop()}},h)}));return function(N){return W.apply(this,arguments)}}(),v=function(){var W=Object(K.a)(L.a.mark(function h(N){return L.a.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return X.next=2,Object(T.v)(N==null?void 0:N.name,Object(T.ab)({url:P.a.API_SERVER+"/api/attachments/get_ecs_attachment.docx",query:N}));case 2:case"end":return X.stop()}},h)}));return function(N){return W.apply(this,arguments)}}(),_=function(){var W=Object(K.a)(L.a.mark(function h(N){return L.a.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return X.next=2,Object(T.v)("",Object(T.ab)({url:P.a.API_SERVER+"/api/ec_years/".concat(N==null?void 0:N.ec_year_id,"/ec_courses.xlsx"),query:N}));case 2:case"end":return X.stop()}},h)}));return function(N){return W.apply(this,arguments)}}(),D=function(){var W=Object(K.a)(L.a.mark(function h(N){return L.a.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return X.next=2,Object(T.v)("",Object(T.ab)({url:P.a.API_SERVER+"/api/ec_years/".concat(N==null?void 0:N.ec_year_id,"/ec_graduation_requirements.xlsx"),query:N}));case 2:case"end":return X.stop()}},h)}));return function(N){return W.apply(this,arguments)}}(),B=function(){var W=Object(K.a)(L.a.mark(function h(N){return L.a.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return X.next=2,Object(T.v)("",Object(T.ab)({url:P.a.API_SERVER+"/api/courses/rank_list.xlsx",query:N}));case 2:case"end":return X.stop()}},h)}));return function(N){return W.apply(this,arguments)}}(),j=function(){var W=Object(K.a)(L.a.mark(function h(N){return L.a.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return X.next=2,Object(T.v)("",Object(T.ab)({url:P.a.API_SERVER+"/api/courses/question_rank_list.xlsx",query:N}));case 2:case"end":return X.stop()}},h)}));return function(N){return W.apply(this,arguments)}}()},nSDg:function(at,Ne,F){at.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"}},nVVt:function(at,Ne){at.exports={MODE_NUMBER:1<<0,MODE_ALPHA_NUM:1<<1,MODE_8BIT_BYTE:1<<2,MODE_KANJI:1<<3}},osHv:function(at,Ne,F){(function(q){q(F("VrN/"))})(function(q){"use strict";var G=q.Pos;function R(f,s){return f.line-s.line||f.ch-s.ch}var K="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",O=K+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",L=new RegExp("<(/?)(["+K+"]["+O+"]*)","g");function U(f,s,c,d){this.line=s,this.ch=c,this.cm=f,this.text=f.getLine(s),this.min=d?Math.max(d.from,f.firstLine()):f.firstLine(),this.max=d?Math.min(d.to-1,f.lastLine()):f.lastLine()}function I(f,s){var c=f.cm.getTokenTypeAt(G(f.line,s));return c&&/\btag\b/.test(c)}function T(f){return f.line>=f.max?void 0:(f.ch=0,f.text=f.cm.getLine(++f.line),!0)}function P(f){return f.line<=f.min?void 0:(f.text=f.cm.getLine(--f.line),f.ch=f.text.length,!0)}function b(f){for(;;){var s=f.text.indexOf(">",f.ch);if(s==-1){if(T(f))continue;return}if(!I(f,s+1)){f.ch=s+1;continue}var c=f.text.lastIndexOf("/",s),d=c>-1&&!/\S/.test(f.text.slice(c+1,s));return f.ch=s+1,d?"selfClose":"regular"}}function g(f){for(;;){var s=f.ch?f.text.lastIndexOf("<",f.ch-1):-1;if(s==-1){if(P(f))continue;return}if(!I(f,s+1)){f.ch=s;continue}L.lastIndex=s,f.ch=s;var c=L.exec(f.text);if(c&&c.index==s)return c}}function k(f){for(;;){L.lastIndex=f.ch;var s=L.exec(f.text);if(!s){if(T(f))continue;return}if(!I(f,s.index+1)){f.ch=s.index+1;continue}return f.ch=s.index+s[0].length,s}}function w(f){for(;;){var s=f.ch?f.text.lastIndexOf(">",f.ch-1):-1;if(s==-1){if(P(f))continue;return}if(!I(f,s+1)){f.ch=s;continue}var c=f.text.lastIndexOf("/",s),d=c>-1&&!/\S/.test(f.text.slice(c+1,s));return f.ch=s+1,d?"selfClose":"regular"}}function p(f,s){for(var c=[];;){var d=k(f),S,C=f.line,m=f.ch-(d?d[0].length:0);if(!d||!(S=b(f)))return;if(S=="selfClose")continue;if(d[1]){for(var A=c.length-1;A>=0;--A)if(c[A]==d[2]){c.length=A;break}if(A<0&&(!s||s==d[2]))return{tag:d[2],from:G(C,m),to:G(f.line,f.ch)}}else c.push(d[2])}}function y(f,s){for(var c=[];;){var d=w(f);if(!d)return;if(d=="selfClose"){g(f);continue}var S=f.line,C=f.ch,m=g(f);if(!m)return;if(m[1])c.push(m[2]);else{for(var A=c.length-1;A>=0;--A)if(c[A]==m[2]){c.length=A;break}if(A<0&&(!s||s==m[2]))return{tag:m[2],from:G(f.line,f.ch),to:G(S,C)}}}}q.registerHelper("fold","xml",function(f,s){for(var c=new U(f,s.line,0);;){var d=k(c);if(!d||c.line!=s.line)return;var S=b(c);if(!S)return;if(!d[1]&&S!="selfClose"){var C=G(c.line,c.ch),m=p(c,d[2]);return m&&R(m.from,C)>0?{from:C,to:m.from}:null}}}),q.findMatchingTag=function(f,s,c){var d=new U(f,s.line,s.ch,c);if(d.text.indexOf(">")==-1&&d.text.indexOf("<")==-1)return;var S=b(d),C=S&&G(d.line,d.ch),m=S&&g(d);if(!S||!m||R(d,s)>0)return;var A={from:G(d.line,d.ch),to:C,tag:m[2]};return S=="selfClose"?{open:A,close:null,at:"open"}:m[1]?{open:y(d,m[2]),close:A,at:"close"}:(d=new U(f,C.line,C.ch,c),{open:A,close:p(d,m[2]),at:"open"})},q.findEnclosingTag=function(f,s,c,d){for(var S=new U(f,s.line,s.ch,c);;){var C=y(S,d);if(!C)break;var m=new U(f,s.line,s.ch,c),A=p(m,C.tag);if(A)return{open:C,close:A}}},q.scanForClosingTag=function(f,s,c,d){var S=new U(f,s.line,s.ch,d?{from:0,to:d}:null);return p(S,c)}})},p5ED:function(at,Ne,F){"use strict";var q=F("+L6B"),G=F("2/Rp"),R=F("5Dmo"),K=F("3S7+"),O=F("k1fw"),L=F("tJVT"),U=F("cDcd"),I=F.n(U),T=F("vHTk"),P=F.n(T),b=F("yEEn"),g=F("ZW9T"),k=F("1vsH");Ne.a=function(w){var p=w.name,y=w.data,f=w.theme,s=w.type,c=w.filename,d=w.monacoEditor,S=w.className,C=w.style,m=w.close,A=w.onClose,x=w.hasMask,u=Object(U.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),l=Object(L.a)(u,2),a=l[0],i=l[1],E=Object(U.useState)(""),v=Object(L.a)(E,2),_=v[0],D=v[1],B,j=1024*1024,W=10*j,h=Object(U.useRef)();s==="office"&&(B=Object(k.V)(y).filesize,B>W&&(s="other")),c&&(d.filename=c),Object(U.useEffect)(function(){var X,Y,re=(X=document.cookie)===null||X===void 0||((Y=X.replace(/\s/g,""))===null||Y===void 0)?void 0:Y.split(";");re==null||re.map(function(he){var de=he.split("=");de[0]==="_educoder_session"&&D(de[1])})},[]);var N=function(){if(y.startsWith("http")||y.startsWith("blob:")){H();return}Object(k.z)(c||"educoder",y,c)},H=function(){Object(k.x)(c||"educoder",decodeURIComponent(y))};return console.log("data:",y,"fileanme:",c," name:",p),I.a.createElement("div",{style:Object(O.a)({},C||{}),className:"".concat(x&&P.a.bgBlack," ").concat(s?P.a.wrp:"hide")},m&&I.a.createElement("div",{className:P.a.close,ref:h},I.a.createElement(K.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return h.current}},I.a.createElement("span",{onClick:H},I.a.createElement("i",{className:"icon-quxiaozhiding"}))),I.a.createElement(K.a,{title:"\u5173\u95ED",getPopupContainer:function(){return h.current}},I.a.createElement("span",{className:"",onClick:A},I.a.createElement("i",{className:"icon-guanbi1"})))),I.a.createElement("div",{className:"".concat(P.a[S]," ").concat(S," ").concat(P.a.monaco," ").concat(s==="txt"?"show":"hide")},s==="txt"&&I.a.createElement(g.b,d)),s==="audio"&&I.a.createElement("audio",{src:"".concat(y!=null&&y.startsWith("/")||(y==null?void 0:y.indexOf("https://"))>-1?y:"data:audio/mp3;base64,").concat(y),autoPlay:!0}),s==="video"&&I.a.createElement(I.a.Fragment,null,y!=null&&y.startsWith("/")?I.a.createElement("video",{controls:!0,src:"".concat(y),autoPlay:!0}):I.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(y),autoPlay:!0})),s==="html"&&I.a.createElement("iframe",{src:y+"&disposition=inline"}),s==="html"&&I.a.createElement("iframe",{src:y+"&disposition=inline"}),s==="pdf"&&I.a.createElement("embed",{className:P.a.embed,src:y}),s==="image"&&I.a.createElement(I.a.Fragment,null,I.a.createElement("img",{src:"".concat(y!=null&&y.startsWith("/")||(y==null?void 0:y.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(y)})),s==="other"&&I.a.createElement("div",null,I.a.createElement(G.a,{type:"primary",size:"large",onClick:N},I.a.createElement(b.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),(s==="download"||s==="office")&&I.a.createElement(G.a,{type:"primary",size:"large",onClick:N},I.a.createElement(b.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(at,Ne,F){},"rAM+":function(at,Ne,F){"use strict";F.d(Ne,"a",function(){return G});var q=F("Qw5x");function G(R,K){var O;if(typeof Symbol=="undefined"||R[Symbol.iterator]==null){if(Array.isArray(R)||(O=Object(q.a)(R))||K&&R&&typeof R.length=="number"){O&&(R=O);var L=0,U=function(){};return{s:U,n:function(){return L>=R.length?{done:!0}:{done:!1,value:R[L++]}},e:function(g){throw g},f: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.`)}var I=!0,T=!1,P;return{s:function(){O=R[Symbol.iterator]()},n:function(){var g=O.next();return I=g.done,g},e:function(g){T=!0,P=g},f:function(){try{!I&&O.return!=null&&O.return()}finally{if(T)throw P}}}}},rUJ1:function(at,Ne){const F=/[&<>"']/,q=/[&<>"']/g,G=/[<>"']|&(?!#?\w+;)/,R=/[<>"']|&(?!#?\w+;)/g,K={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},O=x=>K[x];function L(x,u){if(u){if(F.test(x))return x.replace(q,O)}else if(G.test(x))return x.replace(R,O);return x}const U=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function I(x){return x.replace(U,(u,l)=>(l=l.toLowerCase(),l==="colon"?":":l.charAt(0)==="#"?l.charAt(1)==="x"?String.fromCharCode(parseInt(l.substring(2),16)):String.fromCharCode(+l.substring(1)):""))}const T=/(^|[^\[])\^/g;function P(x,u){x=x.source||x,u=u||"";const l={replace:(a,i)=>(i=i.source||i,i=i.replace(T,"$1"),x=x.replace(a,i),l),getRegex:()=>new RegExp(x,u)};return l}const b=/[^\w:]/g,g=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function k(x,u,l){if(x){let a;try{a=decodeURIComponent(I(l)).replace(b,"").toLowerCase()}catch(i){return null}if(a.indexOf("javascript:")===0||a.indexOf("vbscript:")===0||a.indexOf("data:")===0)return null}u&&!g.test(l)&&(l=s(u,l));try{l=encodeURI(l).replace(/%25/g,"%")}catch(a){return null}return l}const w={},p=/^[^:]+:\/*[^/]*$/,y=/^([^:]+:)[\s\S]*$/,f=/^([^:]+:\/*[^/]*)[\s\S]*$/;function s(x,u){w[" "+x]||(p.test(x)?w[" "+x]=x+"/":w[" "+x]=C(x,"/",!0)),x=w[" "+x];const l=x.indexOf(":")===-1;return u.substring(0,2)==="//"?l?u:x.replace(y,"$1")+u:u.charAt(0)==="/"?l?u:x.replace(f,"$1")+u:x+u}const c={exec:function(){}};function d(x){let u=1,l,a;for(;u<arguments.length;u++){l=arguments[u];for(a in l)Object.prototype.hasOwnProperty.call(l,a)&&(x[a]=l[a])}return x}function S(x,u){const l=x.replace(/\|/g,(E,v,_)=>{let D=!1,B=v;for(;--B>=0&&_[B]==="\\";)D=!D;return D?"|":" |"}),a=l.split(/ \|/);let i=0;if(a.length>u)a.splice(u);else for(;a.length<u;)a.push("");for(;i<a.length;i++)a[i]=a[i].trim().replace(/\\\|/g,"|");return a}function C(x,u,l){const a=x.length;if(a===0)return"";let i=0;for(;i<a;){const E=x.charAt(a-i-1);if(E===u&&!l)i++;else if(E!==u&&l)i++;else break}return x.substr(0,a-i)}function m(x,u){if(x.indexOf(u[1])===-1)return-1;const l=x.length;let a=0,i=0;for(;i<l;i++)if(x[i]==="\\")i++;else if(x[i]===u[0])a++;else if(x[i]===u[1]&&(a--,a<0))return i;return-1}function A(x){x&&x.sanitize&&!x.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")}at.exports={escape:L,unescape:I,edit:P,cleanUrl:k,resolveUrl:s,noopTest:c,merge:d,splitCells:S,rtrim:C,findClosingBracket:m,checkSanitizeDeprecation:A}},rcnY:function(at,Ne,F){var q=F("aRTE");function G(R,K){this.totalCount=R,this.dataCount=K}G.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],G.getRSBlocks=function(R,K){var O=G.getRsBlockTable(R,K);if(O==null)throw new Error("bad rs block @ typeNumber:"+R+"/errorCorrectLevel:"+K);for(var L=O.length/3,U=new Array,I=0;I<L;I++)for(var T=O[I*3+0],P=O[I*3+1],b=O[I*3+2],g=0;g<T;g++)U.push(new G(P,b));return U},G.getRsBlockTable=function(R,K){switch(K){case q.L:return G.RS_BLOCK_TABLE[(R-1)*4+0];case q.M:return G.RS_BLOCK_TABLE[(R-1)*4+1];case q.Q:return G.RS_BLOCK_TABLE[(R-1)*4+2];case q.H:return G.RS_BLOCK_TABLE[(R-1)*4+3];default:return}},at.exports=G},sboe:function(at,Ne,F){"use strict";F.d(Ne,"a",function(){return R});var q=F("cDcd"),G=F.n(q),R=q.createContext(null)},sesT:function(at,Ne){at.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(at,Ne,F){at.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(at,Ne,F){"use strict";var q=F("VTBJ"),G=F("1OyB"),R=F("vuIU"),K=F("Ji7U"),O=F("LK+K"),L=F("cDcd"),U=F.n(L),I=F("m+aA"),T=F("Zm9Q"),P=F("Kwbf"),b=F("c+Xe"),g=F("bdgK"),k="rc-observer-key",w=function(p){Object(K.a)(f,p);var y=Object(O.a)(f);function f(){var s;return Object(G.a)(this,f),s=y.apply(this,arguments),s.resizeObserver=null,s.childNode=null,s.currentElement=null,s.state={width:0,height:0,offsetHeight:0,offsetWidth:0},s.onResize=function(c){var d=s.props.onResize,S=c[0].target,C=S.getBoundingClientRect(),m=C.width,A=C.height,x=S.offsetWidth,u=S.offsetHeight,l=Math.floor(m),a=Math.floor(A);if(s.state.width!==l||s.state.height!==a||s.state.offsetWidth!==x||s.state.offsetHeight!==u){var i={width:l,height:a,offsetWidth:x,offsetHeight:u};s.setState(i),d&&Promise.resolve().then(function(){d(Object(q.a)(Object(q.a)({},i),{},{offsetWidth:x,offsetHeight:u}))})}},s.setChildNode=function(c){s.childNode=c},s}return Object(R.a)(f,[{key:"componentDidMount",value:function(){this.onComponentUpdated()}},{key:"componentDidUpdate",value:function(){this.onComponentUpdated()}},{key:"componentWillUnmount",value:function(){this.destroyObserver()}},{key:"onComponentUpdated",value:function(){var c=this.props.disabled;if(c){this.destroyObserver();return}var d=Object(I.a)(this.childNode||this),S=d!==this.currentElement;S&&(this.destroyObserver(),this.currentElement=d),!this.resizeObserver&&d&&(this.resizeObserver=new g.default(this.onResize),this.resizeObserver.observe(d))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var c=this.props.children,d=Object(T.a)(c);if(d.length>1)Object(P.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(d.length===0)return Object(P.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var S=d[0];if(L.isValidElement(S)&&Object(b.c)(S)){var C=S.ref;d[0]=L.cloneElement(S,{ref:Object(b.a)(C,this.setChildNode)})}return d.length===1?d[0]:d.map(function(m,A){return!L.isValidElement(m)||"key"in m&&m.key!==null?m:L.cloneElement(m,{key:"".concat(k,"-").concat(A)})})}}]),f}(L.Component);w.displayName="ResizeObserver",Ne.a=w},tK3L:function(at,Ne,F){at.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(at,Ne,F){typeof window!="undefined"&&function(G,R){at.exports=R()}(this,function(){return function(q){var G={};function R(K){if(G[K])return G[K].exports;var O=G[K]={i:K,l:!1,exports:{}};return q[K].call(O.exports,O,O.exports,R),O.l=!0,O.exports}return R.m=q,R.c=G,R.d=function(K,O,L){R.o(K,O)||Object.defineProperty(K,O,{enumerable:!0,get:L})},R.r=function(K){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(K,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(K,"__esModule",{value:!0})},R.t=function(K,O){if(O&1&&(K=R(K)),O&8)return K;if(O&4&&typeof K=="object"&&K&&K.__esModule)return K;var L=Object.create(null);if(R.r(L),Object.defineProperty(L,"default",{enumerable:!0,value:K}),O&2&&typeof K!="string")for(var U in K)R.d(L,U,function(I){return K[I]}.bind(null,U));return L},R.n=function(K){var O=K&&K.__esModule?function(){return K.default}:function(){return K};return R.d(O,"a",O),O},R.o=function(K,O){return Object.prototype.hasOwnProperty.call(K,O)},R.p="/dist/",R(R.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(q,G,R){"use strict";var K=Object.prototype.hasOwnProperty,O="~";function L(){}Object.create&&(L.prototype=Object.create(null),new L().__proto__||(O=!1));function U(b,g,k){this.fn=b,this.context=g,this.once=k||!1}function I(b,g,k,w,p){if(typeof k!="function")throw new TypeError("The listener must be a function");var y=new U(k,w||b,p),f=O?O+g:g;return b._events[f]?b._events[f].fn?b._events[f]=[b._events[f],y]:b._events[f].push(y):(b._events[f]=y,b._eventsCount++),b}function T(b,g){--b._eventsCount===0?b._events=new L:delete b._events[g]}function P(){this._events=new L,this._eventsCount=0}P.prototype.eventNames=function(){var g=[],k,w;if(this._eventsCount===0)return g;for(w in k=this._events)K.call(k,w)&&g.push(O?w.slice(1):w);return Object.getOwnPropertySymbols?g.concat(Object.getOwnPropertySymbols(k)):g},P.prototype.listeners=function(g){var k=O?O+g:g,w=this._events[k];if(!w)return[];if(w.fn)return[w.fn];for(var p=0,y=w.length,f=new Array(y);p<y;p++)f[p]=w[p].fn;return f},P.prototype.listenerCount=function(g){var k=O?O+g:g,w=this._events[k];return w?w.fn?1:w.length:0},P.prototype.emit=function(g,k,w,p,y,f){var s=O?O+g:g;if(!this._events[s])return!1;var c=this._events[s],d=arguments.length,S,C;if(c.fn){c.once&&this.removeListener(g,c.fn,void 0,!0);switch(d){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,k),!0;case 3:return c.fn.call(c.context,k,w),!0;case 4:return c.fn.call(c.context,k,w,p),!0;case 5:return c.fn.call(c.context,k,w,p,y),!0;case 6:return c.fn.call(c.context,k,w,p,y,f),!0}for(C=1,S=new Array(d-1);C<d;C++)S[C-1]=arguments[C];c.fn.apply(c.context,S)}else{var m=c.length,A;for(C=0;C<m;C++){c[C].once&&this.removeListener(g,c[C].fn,void 0,!0);switch(d){case 1:c[C].fn.call(c[C].context);break;case 2:c[C].fn.call(c[C].context,k);break;case 3:c[C].fn.call(c[C].context,k,w);break;case 4:c[C].fn.call(c[C].context,k,w,p);break;default:if(!S)for(A=1,S=new Array(d-1);A<d;A++)S[A-1]=arguments[A];c[C].fn.apply(c[C].context,S)}}}return!0},P.prototype.on=function(g,k,w){return I(this,g,k,w,!1)},P.prototype.once=function(g,k,w){return I(this,g,k,w,!0)},P.prototype.removeListener=function(g,k,w,p){var y=O?O+g:g;if(!this._events[y])return this;if(!k)return T(this,y),this;var f=this._events[y];if(f.fn)f.fn===k&&(!p||f.once)&&(!w||f.context===w)&&T(this,y);else{for(var s=0,c=[],d=f.length;s<d;s++)(f[s].fn!==k||p&&!f[s].once||w&&f[s].context!==w)&&c.push(f[s]);c.length?this._events[y]=c.length===1?c[0]:c:T(this,y)}return this},P.prototype.removeAllListeners=function(g){var k;return g?(k=O?O+g:g,this._events[k]&&T(this,k)):(this._events=new L,this._eventsCount=0),this},P.prototype.off=P.prototype.removeListener,P.prototype.addListener=P.prototype.on,P.prefixed=O,P.EventEmitter=P,q.exports=P},"./node_modules/url-toolkit/src/url-toolkit.js":function(q,G,R){(function(K){var O=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,L=/^([^\/?#]*)([^]*)$/,U=/(?:\/|^)\.(?=\/)/g,I=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,T={buildAbsoluteURL:function(P,b,g){if(g=g||{},P=P.trim(),b=b.trim(),!b){if(!g.alwaysNormalize)return P;var k=T.parseURL(P);if(!k)throw new Error("Error trying to parse base URL.");return k.path=T.normalizePath(k.path),T.buildURLFromParts(k)}var w=T.parseURL(b);if(!w)throw new Error("Error trying to parse relative URL.");if(w.scheme)return g.alwaysNormalize?(w.path=T.normalizePath(w.path),T.buildURLFromParts(w)):b;var p=T.parseURL(P);if(!p)throw new Error("Error trying to parse base URL.");if(!p.netLoc&&p.path&&p.path[0]!=="/"){var y=L.exec(p.path);p.netLoc=y[1],p.path=y[2]}p.netLoc&&!p.path&&(p.path="/");var f={scheme:p.scheme,netLoc:w.netLoc,path:null,params:w.params,query:w.query,fragment:w.fragment};if(!w.netLoc&&(f.netLoc=p.netLoc,w.path[0]!=="/"))if(!w.path)f.path=p.path,w.params||(f.params=p.params,w.query||(f.query=p.query));else{var s=p.path,c=s.substring(0,s.lastIndexOf("/")+1)+w.path;f.path=T.normalizePath(c)}return f.path===null&&(f.path=g.alwaysNormalize?T.normalizePath(w.path):w.path),T.buildURLFromParts(f)},parseURL:function(P){var b=O.exec(P);return b?{scheme:b[1]||"",netLoc:b[2]||"",path:b[3]||"",params:b[4]||"",query:b[5]||"",fragment:b[6]||""}:null},normalizePath:function(P){for(P=P.split("").reverse().join("").replace(U,"");P.length!==(P=P.replace(I,"")).length;);return P.split("").reverse().join("")},buildURLFromParts:function(P){return P.scheme+P.netLoc+P.path+P.params+P.query+P.fragment}};q.exports=T})(this)},"./node_modules/webworkify-webpack/index.js":function(q,G,R){function K(g){var k={};function w(y){if(k[y])return k[y].exports;var f=k[y]={i:y,l:!1,exports:{}};return g[y].call(f.exports,f,f.exports,w),f.l=!0,f.exports}w.m=g,w.c=k,w.i=function(y){return y},w.d=function(y,f,s){w.o(y,f)||Object.defineProperty(y,f,{configurable:!1,enumerable:!0,get:s})},w.r=function(y){Object.defineProperty(y,"__esModule",{value:!0})},w.n=function(y){var f=y&&y.__esModule?function(){return y.default}:function(){return y};return w.d(f,"a",f),f},w.o=function(y,f){return Object.prototype.hasOwnProperty.call(y,f)},w.p="/",w.oe=function(y){throw console.error(y),y};var p=w(w.s=ENTRY_MODULE);return p.default||p}var O="[\\.|\\-|\\+|\\w|/|@]+",L="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+O+").*?\\)";function U(g){return(g+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function I(g){return!isNaN(1*g)}function T(g,k,w){var p={};p[w]=[];var y=k.toString(),f=y.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!f)return p;for(var s=f[1],c=new RegExp("(\\\\n|\\W)"+U(s)+L,"g"),d;d=c.exec(y);){if(d[3]==="dll-reference")continue;p[w].push(d[3])}for(c=new RegExp("\\("+U(s)+'\\("(dll-reference\\s('+O+'))"\\)\\)'+L,"g");d=c.exec(y);)g[d[2]]||(p[w].push(d[1]),g[d[2]]=R(d[1]).m),p[d[2]]=p[d[2]]||[],p[d[2]].push(d[4]);for(var S=Object.keys(p),C=0;C<S.length;C++)for(var m=0;m<p[S[C]].length;m++)I(p[S[C]][m])&&(p[S[C]][m]=1*p[S[C]][m]);return p}function P(g){var k=Object.keys(g);return k.reduce(function(w,p){return w||g[p].length>0},!1)}function b(g,k){for(var w={main:[k]},p={main:[]},y={main:{}};P(w);)for(var f=Object.keys(w),s=0;s<f.length;s++){var c=f[s],d=w[c],S=d.pop();if(y[c]=y[c]||{},y[c][S]||!g[c][S])continue;y[c][S]=!0,p[c]=p[c]||[],p[c].push(S);for(var C=T(g,g[c][S],c),m=Object.keys(C),A=0;A<m.length;A++)w[m[A]]=w[m[A]]||[],w[m[A]]=w[m[A]].concat(C[m[A]])}return p}q.exports=function(g,k){k=k||{};var w={main:R.m},p=k.all?{main:Object.keys(w.main)}:b(w,g),y="";Object.keys(p).filter(function(S){return S!=="main"}).forEach(function(S){for(var C=0;p[S][C];)C++;p[S].push(C),w[S][C]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",y=y+"var "+S+" = ("+K.toString().replace("ENTRY_MODULE",JSON.stringify(C))+")({"+p[S].map(function(m){return""+JSON.stringify(m)+": "+w[S][m].toString()}).join(",")+`});
`}),y=y+"new (("+K.toString().replace("ENTRY_MODULE",JSON.stringify(g))+")({"+p.main.map(function(S){return""+JSON.stringify(S)+": "+w.main[S].toString()}).join(",")+"}))(self);";var f=new window.Blob([y],{type:"text/javascript"});if(k.bare)return f;var s=window.URL||window.webkitURL||window.mozURL||window.msURL,c=s.createObjectURL(f),d=new window.Worker(c);return d.objectURL=c,d}},"./src/config.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"hlsDefaultConfig",function(){return A}),R.d(G,"mergeConfig",function(){return u}),R.d(G,"enableStreamingMode",function(){return l});var K=R("./src/controller/abr-controller.ts"),O=R("./src/controller/audio-stream-controller.ts"),L=R("./src/controller/audio-track-controller.ts"),U=R("./src/controller/subtitle-stream-controller.ts"),I=R("./src/controller/subtitle-track-controller.ts"),T=R("./src/controller/buffer-controller.ts"),P=R("./src/controller/timeline-controller.ts"),b=R("./src/controller/cap-level-controller.ts"),g=R("./src/controller/fps-controller.ts"),k=R("./src/controller/eme-controller.ts"),w=R("./src/controller/cmcd-controller.ts"),p=R("./src/utils/xhr-loader.ts"),y=R("./src/utils/fetch-loader.ts"),f=R("./src/utils/cues.ts"),s=R("./src/utils/mediakeys-helper.ts"),c=R("./src/utils/logger.ts");function d(){return d=Object.assign||function(a){for(var i=1;i<arguments.length;i++){var E=arguments[i];for(var v in E)Object.prototype.hasOwnProperty.call(E,v)&&(a[v]=E[v])}return a},d.apply(this,arguments)}function S(a,i){var E=Object.keys(a);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(a);i&&(v=v.filter(function(_){return Object.getOwnPropertyDescriptor(a,_).enumerable})),E.push.apply(E,v)}return E}function C(a){for(var i=1;i<arguments.length;i++){var E=arguments[i]!=null?arguments[i]:{};i%2?S(Object(E),!0).forEach(function(v){m(a,v,E[v])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(E)):S(Object(E)).forEach(function(v){Object.defineProperty(a,v,Object.getOwnPropertyDescriptor(E,v))})}return a}function m(a,i,E){return i in a?Object.defineProperty(a,i,{value:E,enumerable:!0,configurable:!0,writable:!0}):a[i]=E,a}var A=C(C({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:p.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:K.default,bufferController:T.default,capLevelController:b.default,fpsController:g.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:s.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},x()),{},{subtitleStreamController:U.SubtitleStreamController,subtitleTrackController:I.default,timelineController:P.TimelineController,audioStreamController:O.default,audioTrackController:L.default,emeController:k.default,cmcdController:w.default});function x(){return{cueHandler:f.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 u(a,i){if((i.liveSyncDurationCount||i.liveMaxLatencyDurationCount)&&(i.liveSyncDuration||i.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(i.liveMaxLatencyDurationCount!==void 0&&(i.liveSyncDurationCount===void 0||i.liveMaxLatencyDurationCount<=i.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(i.liveMaxLatencyDuration!==void 0&&(i.liveSyncDuration===void 0||i.liveMaxLatencyDuration<=i.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return d({},a,i)}function l(a){var i=a.loader;if(i!==y.default&&i!==p.default)c.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),a.progressive=!1;else{var E=Object(y.fetchSupported)();E&&(a.loader=y.default,a.progressive=!0,a.enableSoftwareAES=!0,c.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(q,G,R){"use strict";R.r(G);var K=R("./src/polyfills/number.ts"),O=R("./src/utils/ewma-bandwidth-estimator.ts"),L=R("./src/events.ts"),U=R("./src/utils/buffer-helper.ts"),I=R("./src/errors.ts"),T=R("./src/types/loader.ts"),P=R("./src/utils/logger.ts");function b(w,p){for(var y=0;y<p.length;y++){var f=p[y];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(w,f.key,f)}}function g(w,p,y){return p&&b(w.prototype,p),y&&b(w,y),w}var k=function(){function w(y){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=y;var f=y.config;this.bwEstimator=new O.default(f.abrEwmaSlowVoD,f.abrEwmaFastVoD,f.abrEwmaDefaultEstimate),this.registerListeners()}var p=w.prototype;return p.registerListeners=function(){var f=this.hls;f.on(L.Events.FRAG_LOADING,this.onFragLoading,this),f.on(L.Events.FRAG_LOADED,this.onFragLoaded,this),f.on(L.Events.FRAG_BUFFERED,this.onFragBuffered,this),f.on(L.Events.LEVEL_LOADED,this.onLevelLoaded,this),f.on(L.Events.ERROR,this.onError,this)},p.unregisterListeners=function(){var f=this.hls;f.off(L.Events.FRAG_LOADING,this.onFragLoading,this),f.off(L.Events.FRAG_LOADED,this.onFragLoaded,this),f.off(L.Events.FRAG_BUFFERED,this.onFragBuffered,this),f.off(L.Events.LEVEL_LOADED,this.onLevelLoaded,this),f.off(L.Events.ERROR,this.onError,this)},p.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},p.onFragLoading=function(f,s){var c=s.frag;if(c.type===T.PlaylistLevelType.MAIN&&!this.timer){var d;this.fragCurrent=c,this.partCurrent=(d=s.part)!=null?d:null,this.timer=self.setInterval(this.onCheck,100)}},p.onLevelLoaded=function(f,s){var c=this.hls.config;s.details.live?this.bwEstimator.update(c.abrEwmaSlowLive,c.abrEwmaFastLive):this.bwEstimator.update(c.abrEwmaSlowVoD,c.abrEwmaFastVoD)},p._abandonRulesCheck=function(){var f=this.fragCurrent,s=this.partCurrent,c=this.hls,d=c.autoLevelEnabled,S=c.config,C=c.media;if(!f||!C)return;var m=s?s.stats:f.stats,A=s?s.duration:f.duration;if(m.aborted){P.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!d||C.paused||!C.playbackRate||!C.readyState)return;var x=performance.now()-m.loading.start,u=Math.abs(C.playbackRate);if(x<=500*A/u)return;var l=c.levels,a=c.minAutoLevel,i=l[f.level],E=m.total||Math.max(m.loaded,Math.round(A*i.maxBitrate/8)),v=Math.max(1,m.bwEstimate?m.bwEstimate/8:m.loaded*1e3/x),_=(E-m.loaded)/v,D=C.currentTime,B=(U.BufferHelper.bufferInfo(C,D,S.maxBufferHole).end-D)/u;if(B>=2*A/u||_<=B)return;var j=Number.POSITIVE_INFINITY,W;for(W=f.level-1;W>a;W--){var h=l[W].maxBitrate;if(j=A*h/(8*.8*v),j<B)break}if(j>=_)return;var N=this.bwEstimator.getEstimate();P.logger.warn("Fragment "+f.sn+(s?" part "+s.index:"")+" of level "+f.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+W+`
Current BW estimate: `+(Object(K.isFiniteNumber)(N)?(N/1024).toFixed(3):"Unknown")+` Kb/s
Estimated load time for current fragment: `+_.toFixed(3)+` s
Estimated load time for the next fragment: `+j.toFixed(3)+` s
Time to underbuffer: `+B.toFixed(3)+" s"),c.nextLoadLevel=W,this.bwEstimator.sample(x,m.loaded),this.clearTimer(),f.loader&&(this.fragCurrent=this.partCurrent=null,f.loader.abort()),c.trigger(L.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:f,part:s,stats:m})},p.onFragLoaded=function(f,s){var c=s.frag,d=s.part;if(c.type===T.PlaylistLevelType.MAIN&&Object(K.isFiniteNumber)(c.sn)){var S=d?d.stats:c.stats,C=d?d.duration:c.duration;if(this.clearTimer(),this.lastLoadedFragLevel=c.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var m=this.hls.levels[c.level],A=(m.loaded?m.loaded.bytes:0)+S.loaded,x=(m.loaded?m.loaded.duration:0)+C;m.loaded={bytes:A,duration:x},m.realBitrate=Math.round(8*A/x)}if(c.bitrateTest){var u={stats:S,frag:c,part:d,id:c.type};this.onFragBuffered(L.Events.FRAG_BUFFERED,u),c.bitrateTest=!1}}},p.onFragBuffered=function(f,s){var c=s.frag,d=s.part,S=d?d.stats:c.stats;if(S.aborted)return;if(c.type!==T.PlaylistLevelType.MAIN||c.sn==="initSegment")return;var C=S.parsing.end-S.loading.start;this.bwEstimator.sample(C,S.loaded),S.bwEstimate=this.bwEstimator.getEstimate(),c.bitrateTest?this.bitrateTestDelay=C/1e3:this.bitrateTestDelay=0},p.onError=function(f,s){switch(s.details){case I.ErrorDetails.FRAG_LOAD_ERROR:case I.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},p.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},p.getNextABRAutoLevel=function(){var f=this.fragCurrent,s=this.partCurrent,c=this.hls,d=c.maxAutoLevel,S=c.config,C=c.minAutoLevel,m=c.media,A=s?s.duration:f?f.duration:0,x=m?m.currentTime:0,u=m&&m.playbackRate!==0?Math.abs(m.playbackRate):1,l=this.bwEstimator?this.bwEstimator.getEstimate():S.abrEwmaDefaultEstimate,a=(U.BufferHelper.bufferInfo(m,x,S.maxBufferHole).end-x)/u,i=this.findBestLevel(l,C,d,a,S.abrBandWidthFactor,S.abrBandWidthUpFactor);if(i>=0)return i;P.logger.trace((a?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var E=A?Math.min(A,S.maxStarvationDelay):S.maxStarvationDelay,v=S.abrBandWidthFactor,_=S.abrBandWidthUpFactor;if(!a){var D=this.bitrateTestDelay;if(D){var B=A?Math.min(A,S.maxLoadingDelay):S.maxLoadingDelay;E=B-D,P.logger.trace("bitrate test took "+Math.round(1e3*D)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*E)+" ms"),v=_=1}}return i=this.findBestLevel(l,C,d,a+E,v,_),Math.max(i,0)},p.findBestLevel=function(f,s,c,d,S,C){for(var m,A=this.fragCurrent,x=this.partCurrent,u=this.lastLoadedFragLevel,l=this.hls.levels,a=l[u],i=!!(a!=null&&(m=a.details)!==null&&m!==void 0&&m.live),E=a==null?void 0:a.codecSet,v=x?x.duration:A?A.duration:0,_=c;_>=s;_--){var D=l[_];if(!D||E&&D.codecSet!==E)continue;var B=D.details,j=(x?B==null?void 0:B.partTarget:B==null?void 0:B.averagetargetduration)||v,W=void 0;_<=u?W=S*f:W=C*f;var h=l[_].maxBitrate,N=h*j/W;if(P.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+_+"/"+Math.round(W)+"/"+h+"/"+j+"/"+d+"/"+N),W>h&&(!N||i&&!this.bitrateTestDelay||N<d))return _}return-1},g(w,[{key:"nextAutoLevel",get:function(){var f=this._nextAutoLevel,s=this.bwEstimator;if(f!==-1&&(!s||!s.canEstimate()))return f;var c=this.getNextABRAutoLevel();return f!==-1&&(c=Math.min(f,c)),c},set:function(f){this._nextAutoLevel=f}}]),w}();G.default=k},"./src/controller/audio-stream-controller.ts":function(q,G,R){"use strict";R.r(G);var K=R("./src/polyfills/number.ts"),O=R("./src/controller/base-stream-controller.ts"),L=R("./src/events.ts"),U=R("./src/utils/buffer-helper.ts"),I=R("./src/controller/fragment-tracker.ts"),T=R("./src/types/level.ts"),P=R("./src/types/loader.ts"),b=R("./src/loader/fragment.ts"),g=R("./src/demux/chunk-cache.ts"),k=R("./src/demux/transmuxer-interface.ts"),w=R("./src/types/transmuxer.ts"),p=R("./src/controller/fragment-finders.ts"),y=R("./src/utils/discontinuities.ts"),f=R("./src/errors.ts"),s=R("./src/utils/logger.ts");function c(){return c=Object.assign||function(A){for(var x=1;x<arguments.length;x++){var u=arguments[x];for(var l in u)Object.prototype.hasOwnProperty.call(u,l)&&(A[l]=u[l])}return A},c.apply(this,arguments)}function d(A,x){A.prototype=Object.create(x.prototype),A.prototype.constructor=A,S(A,x)}function S(A,x){return S=Object.setPrototypeOf||function(l,a){return l.__proto__=a,l},S(A,x)}var C=100,m=function(A){d(x,A);function x(l,a){var i;return i=A.call(this,l,a,"[audio-stream-controller]")||this,i.videoBuffer=null,i.videoTrackCC=-1,i.waitingVideoCC=-1,i.audioSwitch=!1,i.trackId=-1,i.waitingData=null,i.mainDetails=null,i.bufferFlushed=!1,i._registerListeners(),i}var u=x.prototype;return u.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},u._registerListeners=function(){var a=this.hls;a.on(L.Events.MEDIA_ATTACHED,this.onMediaAttached,this),a.on(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.on(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.on(L.Events.LEVEL_LOADED,this.onLevelLoaded,this),a.on(L.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),a.on(L.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),a.on(L.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),a.on(L.Events.ERROR,this.onError,this),a.on(L.Events.BUFFER_RESET,this.onBufferReset,this),a.on(L.Events.BUFFER_CREATED,this.onBufferCreated,this),a.on(L.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),a.on(L.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),a.on(L.Events.FRAG_BUFFERED,this.onFragBuffered,this)},u._unregisterListeners=function(){var a=this.hls;a.off(L.Events.MEDIA_ATTACHED,this.onMediaAttached,this),a.off(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.off(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.off(L.Events.LEVEL_LOADED,this.onLevelLoaded,this),a.off(L.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),a.off(L.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),a.off(L.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),a.off(L.Events.ERROR,this.onError,this),a.off(L.Events.BUFFER_RESET,this.onBufferReset,this),a.off(L.Events.BUFFER_CREATED,this.onBufferCreated,this),a.off(L.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),a.off(L.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),a.off(L.Events.FRAG_BUFFERED,this.onFragBuffered,this)},u.onInitPtsFound=function(a,i){var E=i.frag,v=i.id,_=i.initPTS;if(v==="main"){var D=E.cc;this.initPTS[E.cc]=_,this.log("InitPTS for cc: "+D+" found from main: "+_),this.videoTrackCC=D,this.state===O.State.WAITING_INIT_PTS&&this.tick()}},u.startLoad=function(a){if(!this.levels){this.startPosition=a,this.state=O.State.STOPPED;return}var i=this.lastCurrentTime;this.stopLoad(),this.setInterval(C),this.fragLoadError=0,i>0&&a===-1?(this.log("Override startPosition with lastCurrentTime @"+i.toFixed(3)),this.state=O.State.IDLE):(this.loadedmetadata=!1,this.state=O.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=a,this.tick()},u.doTick=function(){switch(this.state){case O.State.IDLE:this.doTickIdle();break;case O.State.WAITING_TRACK:{var a,i=this.levels,E=this.trackId,v=i==null||((a=i[E])===null||a===void 0)?void 0:a.details;if(v){if(this.waitForCdnTuneIn(v))break;this.state=O.State.WAITING_INIT_PTS}break}case O.State.FRAG_LOADING_WAITING_RETRY:{var _,D=performance.now(),B=this.retryDate;(!B||D>=B||(_=this.media)!==null&&_!==void 0&&_.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=O.State.IDLE);break}case O.State.WAITING_INIT_PTS:{var j=this.waitingData;if(j){var W=j.frag,h=j.part,N=j.cache,H=j.complete;if(this.initPTS[W.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=O.State.FRAG_LOADING;var X=N.flush(),Y={frag:W,part:h,payload:X,networkDetails:null};this._handleFragmentLoadProgress(Y),H&&A.prototype._handleFragmentLoadComplete.call(this,Y)}else if(this.videoTrackCC!==this.waitingVideoCC)s.logger.log("Waiting fragment cc ("+W.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var re=this.getLoadPosition(),he=U.BufferHelper.bufferInfo(this.mediaBuffer,re,this.config.maxBufferHole),de=Object(p.fragmentWithinToleranceTest)(he.end,this.config.maxFragLookUpTolerance,W);de<0&&(s.logger.log("Waiting fragment cc ("+W.cc+") @ "+W.start+" cancelled because another fragment at "+he.end+" is needed"),this.clearWaitingFragment())}}else this.state=O.State.IDLE}}this.onTickEnd()},u.clearWaitingFragment=function(){var a=this.waitingData;a&&(this.fragmentTracker.removeFragment(a.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=O.State.IDLE)},u.onTickEnd=function(){var a=this.media;if(!a||!a.readyState)return;var i=this.mediaBuffer?this.mediaBuffer:a,E=i.buffered;!this.loadedmetadata&&E.length&&(this.loadedmetadata=!0),this.lastCurrentTime=a.currentTime},u.doTickIdle=function(){var a,i,E=this.hls,v=this.levels,_=this.media,D=this.trackId,B=E.config;if(!v||!v[D])return;if(!_&&(this.startFragRequested||!B.startFragPrefetch))return;var j=v[D],W=j.details;if(!W||W.live&&this.levelLastLoaded!==D||this.waitForCdnTuneIn(W)){this.state=O.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,b.ElementaryStreamTypes.AUDIO,P.PlaylistLevelType.AUDIO));var h=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,P.PlaylistLevelType.AUDIO);if(h===null)return;var N=h.len,H=this.getMaxBufferLength(),X=this.audioSwitch;if(N>=H&&!X)return;if(!X&&this._streamEnded(h,W)){E.trigger(L.Events.BUFFER_EOS,{type:"audio"}),this.state=O.State.ENDED;return}var Y=W.fragments,re=Y[0].start,he=h.end;if(X){var de=this.getLoadPosition();he=de,W.PTSKnown&&de<re&&((h.end>re||h.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),_.currentTime=re+.05))}var ne=this.getNextFragment(he,W);if(!ne){this.bufferFlushed=!0;return}((a=ne.decryptdata)===null||a===void 0?void 0:a.keyFormat)==="identity"&&!((i=ne.decryptdata)!==null&&i!==void 0&&i.key)?this.loadKey(ne,W):this.loadFragment(ne,W,he)},u.getMaxBufferLength=function(){var a=A.prototype.getMaxBufferLength.call(this),i=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,P.PlaylistLevelType.MAIN);return i===null?a:Math.max(a,i.len)},u.onMediaDetaching=function(){this.videoBuffer=null,A.prototype.onMediaDetaching.call(this)},u.onAudioTracksUpdated=function(a,i){var E=i.audioTracks;this.resetTransmuxer(),this.levels=E.map(function(v){return new T.Level(v)})},u.onAudioTrackSwitching=function(a,i){var E=!!i.url;this.trackId=i.id;var v=this.fragCurrent;v!=null&&v.loader&&v.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),E?this.setInterval(C):this.resetTransmuxer(),E?(this.audioSwitch=!0,this.state=O.State.IDLE):this.state=O.State.STOPPED,this.tick()},u.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},u.onLevelLoaded=function(a,i){this.mainDetails=i.details},u.onAudioTrackLoaded=function(a,i){var E,v=this.levels,_=i.details,D=i.id;if(!v){this.warn("Audio tracks were reset while loading level "+D);return}this.log("Track "+D+" loaded ["+_.startSN+","+_.endSN+"],duration:"+_.totalduration);var B=v[D],j=0;if(_.live||(E=B.details)!==null&&E!==void 0&&E.live){var W=this.mainDetails;if(_.fragments[0]||(_.deltaUpdateFailed=!0),_.deltaUpdateFailed||!W)return;!B.details&&_.hasProgramDateTime&&W.hasProgramDateTime?(Object(y.alignMediaPlaylistByPDT)(_,W),j=_.fragments[0].start):j=this.alignPlaylists(_,B.details)}B.details=_,this.levelLastLoaded=D,!this.startFragRequested&&(this.mainDetails||!_.live)&&this.setStartPosition(B.details,j),this.state===O.State.WAITING_TRACK&&!this.waitForCdnTuneIn(_)&&(this.state=O.State.IDLE),this.tick()},u._handleFragmentLoadProgress=function(a){var i,E=a.frag,v=a.part,_=a.payload,D=this.config,B=this.trackId,j=this.levels;if(!j){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+E.sn+" of level "+E.level+" will not be buffered");return}var W=j[B];console.assert(W,"Audio track is defined on fragment load progress");var h=W.details;console.assert(h,"Audio track details are defined on fragment load progress");var N=D.defaultAudioCodec||W.audioCodec||"mp4a.40.2",H=this.transmuxer;H||(H=this.transmuxer=new k.default(this.hls,P.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var X=this.initPTS[E.cc],Y=(i=E.initSegment)===null||i===void 0?void 0:i.data;if(X!==void 0){var re=!1,he=v?v.index:-1,de=he!==-1,ne=new w.ChunkMetadata(E.level,E.sn,E.stats.chunkCount,_.byteLength,he,de);H.push(_,Y,N,"",E,v,h.totalduration,re,ne,X)}else{s.logger.log("Unknown video PTS for cc "+E.cc+", waiting for video PTS before demuxing audio frag "+E.sn+" of ["+h.startSN+" ,"+h.endSN+"],track "+B);var ae=this.waitingData=this.waitingData||{frag:E,part:v,cache:new g.default,complete:!1},le=ae.cache;le.push(new Uint8Array(_)),this.waitingVideoCC=this.videoTrackCC,this.state=O.State.WAITING_INIT_PTS}},u._handleFragmentLoadComplete=function(a){if(this.waitingData){this.waitingData.complete=!0;return}A.prototype._handleFragmentLoadComplete.call(this,a)},u.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},u.onBufferCreated=function(a,i){var E=i.tracks.audio;E&&(this.mediaBuffer=E.buffer),i.tracks.video&&(this.videoBuffer=i.tracks.video.buffer)},u.onFragBuffered=function(a,i){var E=i.frag,v=i.part;if(E.type!==P.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(E)){this.warn("Fragment "+E.sn+(v?" p: "+v.index:"")+" of level "+E.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}E.sn!=="initSegment"&&(this.fragPrevious=E,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(L.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(E,v)},u.onError=function(a,i){switch(i.details){case f.ErrorDetails.FRAG_LOAD_ERROR:case f.ErrorDetails.FRAG_LOAD_TIMEOUT:case f.ErrorDetails.KEY_LOAD_ERROR:case f.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(P.PlaylistLevelType.AUDIO,i);break;case f.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case f.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==O.State.ERROR&&this.state!==O.State.STOPPED&&(this.state=i.fatal?O.State.ERROR:O.State.IDLE,this.warn(i.details+" while loading frag, switching to "+this.state+" state"));break;case f.ErrorDetails.BUFFER_FULL_ERROR:if(i.parent==="audio"&&(this.state===O.State.PARSING||this.state===O.State.PARSED)){var E=!0,v=this.getFwdBufferInfo(this.mediaBuffer,P.PlaylistLevelType.AUDIO);v&&v.len>.5&&(E=!this.reduceMaxBufferLength(v.len)),E&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,A.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},u.onBufferFlushed=function(a,i){var E=i.type;E===b.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},u._handleTransmuxComplete=function(a){var i,E="audio",v=this.hls,_=a.remuxResult,D=a.chunkMeta,B=this.getCurrentContext(D);if(!B){this.warn("The loading context changed while buffering fragment "+D.sn+" of level "+D.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(D.level);return}var j=B.frag,W=B.part,h=_.audio,N=_.text,H=_.id3,X=_.initSegment;if(this.fragContextChanged(j))return;if(this.state=O.State.PARSING,this.audioSwitch&&h&&this.completeAudioSwitch(),X!=null&&X.tracks&&(this._bufferInitSegment(X.tracks,j,D),v.trigger(L.Events.FRAG_PARSING_INIT_SEGMENT,{frag:j,id:E,tracks:X.tracks})),h){var Y=h.startPTS,re=h.endPTS,he=h.startDTS,de=h.endDTS;W&&(W.elementaryStreams[b.ElementaryStreamTypes.AUDIO]={startPTS:Y,endPTS:re,startDTS:he,endDTS:de}),j.setElementaryStreamInfo(b.ElementaryStreamTypes.AUDIO,Y,re,he,de),this.bufferFragmentData(h,j,W,D)}if(H!=null&&(i=H.samples)!==null&&i!==void 0&&i.length){var ne=c({frag:j,id:E},H);v.trigger(L.Events.FRAG_PARSING_METADATA,ne)}if(N){var ae=c({frag:j,id:E},N);v.trigger(L.Events.FRAG_PARSING_USERDATA,ae)}},u._bufferInitSegment=function(a,i,E){if(this.state!==O.State.PARSING)return;a.video&&delete a.video;var v=a.audio;if(!v)return;v.levelCodec=v.codec,v.id="audio",this.log("Init audio buffer, container:"+v.container+", codecs[parsed]=["+v.codec+"]"),this.hls.trigger(L.Events.BUFFER_CODECS,a);var _=v.initSegment;if(_!=null&&_.byteLength){var D={type:"audio",frag:i,part:null,chunkMeta:E,parent:i.type,data:_};this.hls.trigger(L.Events.BUFFER_APPENDING,D)}this.tick()},u.loadFragment=function(a,i,E){var v=this.fragmentTracker.getState(a);this.fragCurrent=a,(this.audioSwitch||v===I.FragmentState.NOT_LOADED||v===I.FragmentState.PARTIAL)&&(a.sn==="initSegment"?this._loadInitSegment(a):i.live&&!Object(K.isFiniteNumber)(this.initPTS[a.cc])?(this.log("Waiting for video PTS in continuity counter "+a.cc+" of live stream before loading audio fragment "+a.sn+" of level "+this.trackId),this.state=O.State.WAITING_INIT_PTS):(this.startFragRequested=!0,A.prototype.loadFragment.call(this,a,i,E)))},u.completeAudioSwitch=function(){var a=this.hls,i=this.media,E=this.trackId;i&&(this.log("Switching audio track : flushing all audio"),A.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,a.trigger(L.Events.AUDIO_TRACK_SWITCHED,{id:E})},x}(O.default);G.default=m},"./src/controller/audio-track-controller.ts":function(q,G,R){"use strict";R.r(G);var K=R("./src/events.ts"),O=R("./src/errors.ts"),L=R("./src/controller/base-playlist-controller.ts"),U=R("./src/types/loader.ts");function I(k,w){for(var p=0;p<w.length;p++){var y=w[p];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(k,y.key,y)}}function T(k,w,p){return w&&I(k.prototype,w),p&&I(k,p),k}function P(k,w){k.prototype=Object.create(w.prototype),k.prototype.constructor=k,b(k,w)}function b(k,w){return b=Object.setPrototypeOf||function(y,f){return y.__proto__=f,y},b(k,w)}var g=function(k){P(w,k);function w(y){var f;return f=k.call(this,y,"[audio-track-controller]")||this,f.tracks=[],f.groupId=null,f.tracksInGroup=[],f.trackId=-1,f.trackName="",f.selectDefaultTrack=!0,f.registerListeners(),f}var p=w.prototype;return p.registerListeners=function(){var f=this.hls;f.on(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),f.on(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),f.on(K.Events.LEVEL_LOADING,this.onLevelLoading,this),f.on(K.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),f.on(K.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),f.on(K.Events.ERROR,this.onError,this)},p.unregisterListeners=function(){var f=this.hls;f.off(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),f.off(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),f.off(K.Events.LEVEL_LOADING,this.onLevelLoading,this),f.off(K.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),f.off(K.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),f.off(K.Events.ERROR,this.onError,this)},p.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,k.prototype.destroy.call(this)},p.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},p.onManifestParsed=function(f,s){this.tracks=s.audioTracks||[]},p.onAudioTrackLoaded=function(f,s){var c=s.id,d=s.details,S=this.tracksInGroup[c];if(!S){this.warn("Invalid audio track id "+c);return}var C=S.details;S.details=s.details,this.log("audioTrack "+c+" loaded ["+d.startSN+"-"+d.endSN+"]"),c===this.trackId&&(this.retryCount=0,this.playlistLoaded(c,s,C))},p.onLevelLoading=function(f,s){this.switchLevel(s.level)},p.onLevelSwitching=function(f,s){this.switchLevel(s.level)},p.switchLevel=function(f){var s=this.hls.levels[f];if(!(s!=null&&s.audioGroupIds))return;var c=s.audioGroupIds[s.urlId];if(this.groupId!==c){this.groupId=c;var d=this.tracks.filter(function(C){return!c||C.groupId===c});this.selectDefaultTrack&&!d.some(function(C){return C.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=d;var S={audioTracks:d};this.log("Updating audio tracks, "+d.length+' track(s) found in "'+c+'" group-id'),this.hls.trigger(K.Events.AUDIO_TRACKS_UPDATED,S),this.selectInitialTrack()}},p.onError=function(f,s){if(k.prototype.onError.call(this,f,s),s.fatal||!s.context)return;s.context.type===U.PlaylistContextType.AUDIO_TRACK&&s.context.id===this.trackId&&s.context.groupId===this.groupId&&this.retryLoadingOrFail(s)},p.setAudioTrack=function(f){var s=this.tracksInGroup;if(f<0||f>=s.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var c=s[this.trackId];this.log("Now switching to audio-track index "+f);var d=s[f],S=d.id,C=d.groupId,m=C===void 0?"":C,A=d.name,x=d.type,u=d.url;if(this.trackId=f,this.trackName=A,this.selectDefaultTrack=!1,this.hls.trigger(K.Events.AUDIO_TRACK_SWITCHING,{id:S,groupId:m,name:A,type:x,url:u}),d.details&&!d.details.live)return;var l=this.switchParams(d.url,c==null?void 0:c.details);this.loadPlaylist(l)},p.selectInitialTrack=function(){var f=this.tracksInGroup;console.assert(f.length,"Initial audio track should be selected when tracks are known");var s=this.trackName,c=this.findTrackId(s)||this.findTrackId();c!==-1?this.setAudioTrack(c):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(K.Events.ERROR,{type:O.ErrorTypes.MEDIA_ERROR,details:O.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},p.findTrackId=function(f){for(var s=this.tracksInGroup,c=0;c<s.length;c++){var d=s[c];if((!this.selectDefaultTrack||d.default)&&(!f||f===d.name))return d.id}return-1},p.loadPlaylist=function(f){var s=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(s)){var c=s.id,d=s.groupId,S=s.url;if(f)try{S=f.addDirectives(S)}catch(C){this.warn("Could not construct new URL with HLS Delivery Directives: "+C)}this.log("loading audio-track playlist for id: "+c),this.clearTimer(),this.hls.trigger(K.Events.AUDIO_TRACK_LOADING,{url:S,id:c,groupId:d,deliveryDirectives:f||null})}},T(w,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(f){this.selectDefaultTrack=!1,this.setAudioTrack(f)}}]),w}(L.default);G.default=g},"./src/controller/base-playlist-controller.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"default",function(){return T});var K=R("./src/polyfills/number.ts"),O=R("./src/types/level.ts"),L=R("./src/controller/level-helper.ts"),U=R("./src/utils/logger.ts"),I=R("./src/errors.ts"),T=function(){function P(g,k){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=U.logger.log.bind(U.logger,k+":"),this.warn=U.logger.warn.bind(U.logger,k+":"),this.hls=g}var b=P.prototype;return b.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},b.onError=function(k,w){w.fatal&&w.type===I.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},b.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},b.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},b.stopLoad=function(){this.canLoad=!1,this.clearTimer()},b.switchParams=function(k,w){var p=w==null?void 0:w.renditionReports;if(p)for(var y=0;y<p.length;y++){var f=p[y],s=""+f.URI;if(s===k.substr(-s.length)){var c=parseInt(f["LAST-MSN"]),d=parseInt(f["LAST-PART"]);if(w&&this.hls.config.lowLatencyMode){var S=Math.min(w.age-w.partTarget,w.targetduration);d!==void 0&&S>w.partTarget&&(d+=1)}if(Object(K.isFiniteNumber)(c))return new O.HlsUrlParameters(c,Object(K.isFiniteNumber)(d)?d:void 0,O.HlsSkip.No)}}},b.loadPlaylist=function(k){},b.shouldLoadTrack=function(k){return this.canLoad&&k&&!!k.url&&(!k.details||k.details.live)},b.playlistLoaded=function(k,w,p){var y=this,f=w.details,s=w.stats,c=s.loading.end?Math.max(0,self.performance.now()-s.loading.end):0;if(f.advancedDateTime=Date.now()-c,f.live||p!=null&&p.live){if(f.reloaded(p),p&&this.log("live playlist "+k+" "+(f.advanced?"REFRESHED "+f.lastPartSn+"-"+f.lastPartIndex:"MISSED")),p&&f.fragments.length>0&&Object(L.mergeDetails)(p,f),!this.canLoad||!f.live)return;var d,S=void 0,C=void 0;if(f.canBlockReload&&f.endSN&&f.advanced){var m=this.hls.config.lowLatencyMode,A=f.lastPartSn,x=f.endSN,u=f.lastPartIndex,l=u!==-1,a=A===x,i=m?0:u;l?(S=a?x+1:A,C=a?i:u+1):S=x+1;var E=f.age,v=E+f.ageHeader,_=Math.min(v-f.partTarget,f.targetduration*1.5);if(_>0){if(p&&_>p.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+p.tuneInGoal+" to: "+_+" with playlist age: "+f.age),_=0;else{var D=Math.floor(_/f.targetduration);if(S+=D,C!==void 0){var B=Math.round(_%f.targetduration/f.partTarget);C+=B}this.log("CDN Tune-in age: "+f.ageHeader+"s last advanced "+E.toFixed(2)+"s goal: "+_+" skip sn "+D+" to part "+C)}f.tuneInGoal=_}if(d=this.getDeliveryDirectives(f,w.deliveryDirectives,S,C),m||!a){this.loadPlaylist(d);return}}else d=this.getDeliveryDirectives(f,w.deliveryDirectives,S,C);var j=Object(L.computeReloadInterval)(f,s);S!==void 0&&f.canBlockReload&&(j-=f.partTarget||1),this.log("reload live playlist "+k+" in "+Math.round(j)+" ms"),this.timer=self.setTimeout(function(){return y.loadPlaylist(d)},j)}else this.clearTimer()},b.getDeliveryDirectives=function(k,w,p,y){var f=Object(O.getSkipValue)(k,p);return w!=null&&w.skip&&k.deltaUpdateFailed&&(p=w.msn,y=w.part,f=O.HlsSkip.No),new O.HlsUrlParameters(p,y,f)},b.retryLoadingOrFail=function(k){var w=this,p=this.hls.config,y=this.retryCount<p.levelLoadingMaxRetry;if(y){var f;if(this.retryCount++,k.details.indexOf("LoadTimeOut")>-1&&(f=k.context)!==null&&f!==void 0&&f.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+k.details+'"'),this.loadPlaylist();else{var s=Math.min(Math.pow(2,this.retryCount)*p.levelLoadingRetryDelay,p.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return w.loadPlaylist()},s),this.warn("retry playlist loading #"+this.retryCount+" in "+s+' ms after "'+k.details+'"')}}else this.warn('cannot recover from error "'+k.details+'"'),this.clearTimer(),k.fatal=!0;return y},P}()},"./src/controller/base-stream-controller.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"State",function(){return x}),R.d(G,"default",function(){return u});var K=R("./src/polyfills/number.ts"),O=R("./src/task-loop.ts"),L=R("./src/controller/fragment-tracker.ts"),U=R("./src/utils/buffer-helper.ts"),I=R("./src/utils/logger.ts"),T=R("./src/events.ts"),P=R("./src/errors.ts"),b=R("./src/types/transmuxer.ts"),g=R("./src/utils/mp4-tools.ts"),k=R("./src/utils/discontinuities.ts"),w=R("./src/controller/fragment-finders.ts"),p=R("./src/controller/level-helper.ts"),y=R("./src/loader/fragment-loader.ts"),f=R("./src/crypt/decrypter.ts"),s=R("./src/utils/time-ranges.ts"),c=R("./src/types/loader.ts");function d(l,a){for(var i=0;i<a.length;i++){var E=a[i];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(l,E.key,E)}}function S(l,a,i){return a&&d(l.prototype,a),i&&d(l,i),l}function C(l){if(l===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l}function m(l,a){l.prototype=Object.create(a.prototype),l.prototype.constructor=l,A(l,a)}function A(l,a){return A=Object.setPrototypeOf||function(E,v){return E.__proto__=v,E},A(l,a)}var x={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"},u=function(l){m(a,l);function a(E,v,_){var D;return D=l.call(this)||this,D.hls=void 0,D.fragPrevious=null,D.fragCurrent=null,D.fragmentTracker=void 0,D.transmuxer=null,D._state=x.STOPPED,D.media=void 0,D.mediaBuffer=void 0,D.config=void 0,D.bitrateTest=!1,D.lastCurrentTime=0,D.nextLoadPosition=0,D.startPosition=0,D.loadedmetadata=!1,D.fragLoadError=0,D.retryDate=0,D.levels=null,D.fragmentLoader=void 0,D.levelLastLoaded=null,D.startFragRequested=!1,D.decrypter=void 0,D.initPTS=[],D.onvseeking=null,D.onvended=null,D.logPrefix="",D.log=void 0,D.warn=void 0,D.logPrefix=_,D.log=I.logger.log.bind(I.logger,_+":"),D.warn=I.logger.warn.bind(I.logger,_+":"),D.hls=E,D.fragmentLoader=new y.default(E.config),D.fragmentTracker=v,D.config=E.config,D.decrypter=new f.default(E,E.config),E.on(T.Events.KEY_LOADED,D.onKeyLoaded,C(D)),D}var i=a.prototype;return i.doTick=function(){this.onTickEnd()},i.onTickEnd=function(){},i.startLoad=function(v){},i.stopLoad=function(){this.fragmentLoader.abort();var v=this.fragCurrent;v&&this.fragmentTracker.removeFragment(v),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=x.STOPPED},i._streamEnded=function(v,_){var D=this.fragCurrent,B=this.fragmentTracker;if(!_.live&&D&&D.sn===_.endSN&&!v.nextStart){var j=B.getState(D);return j===L.FragmentState.PARTIAL||j===L.FragmentState.OK}return!1},i.onMediaAttached=function(v,_){var D=this.media=this.mediaBuffer=_.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),D.addEventListener("seeking",this.onvseeking),D.addEventListener("ended",this.onvended);var B=this.config;this.levels&&B.autoStartLoad&&this.state===x.STOPPED&&this.startLoad(B.startPosition)},i.onMediaDetaching=function(){var v=this.media;v!=null&&v.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),v&&(v.removeEventListener("seeking",this.onvseeking),v.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},i.onMediaSeeking=function(){var v=this.config,_=this.fragCurrent,D=this.media,B=this.mediaBuffer,j=this.state,W=D?D.currentTime:0,h=U.BufferHelper.bufferInfo(B||D,W,v.maxBufferHole);if(this.log("media seeking to "+(Object(K.isFiniteNumber)(W)?W.toFixed(3):W)+", state: "+j),j===x.ENDED)this.resetLoadingState();else if(_&&!h.len){var N=v.maxFragLookUpTolerance,H=_.start-N,X=_.start+_.duration+N,Y=W>X;(W<H||Y)&&(Y&&_.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),_.loader.abort()),this.resetLoadingState())}D&&(this.lastCurrentTime=W),!this.loadedmetadata&&!h.len&&(this.nextLoadPosition=this.startPosition=W),this.tickImmediate()},i.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},i.onKeyLoaded=function(v,_){if(this.state!==x.KEY_LOADING||_.frag!==this.fragCurrent||!this.levels)return;this.state=x.IDLE;var D=this.levels[_.frag.level].details;D&&this.loadFragment(_.frag,D,_.frag.start)},i.onHandlerDestroying=function(){this.stopLoad(),l.prototype.onHandlerDestroying.call(this)},i.onHandlerDestroyed=function(){this.state=x.STOPPED,this.hls.off(T.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,l.prototype.onHandlerDestroyed.call(this)},i.loadKey=function(v,_){this.log("Loading key for "+v.sn+" of ["+_.startSN+"-"+_.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+v.level),this.state=x.KEY_LOADING,this.fragCurrent=v,this.hls.trigger(T.Events.KEY_LOADING,{frag:v})},i.loadFragment=function(v,_,D){this._loadFragForPlayback(v,_,D)},i._loadFragForPlayback=function(v,_,D){var B=this,j=function(h){if(B.fragContextChanged(v)){B.warn("Fragment "+v.sn+(h.part?" p: "+h.part.index:"")+" of level "+v.level+" was dropped during download."),B.fragmentTracker.removeFragment(v);return}v.stats.chunkCount++,B._handleFragmentLoadProgress(h)};this._doFragLoad(v,_,D,j).then(function(W){if(!W)return;B.fragLoadError=0;var h=B.state;if(B.fragContextChanged(v)){(h===x.FRAG_LOADING||h===x.BACKTRACKING||!B.fragCurrent&&h===x.PARSING)&&(B.fragmentTracker.removeFragment(v),B.state=x.IDLE);return}if("payload"in W&&(B.log("Loaded fragment "+v.sn+" of level "+v.level),B.hls.trigger(T.Events.FRAG_LOADED,W),B.state===x.BACKTRACKING)){B.fragmentTracker.backtrack(v,W),B.resetFragmentLoading(v);return}B._handleFragmentLoadComplete(W)}).catch(function(W){B.warn(W),B.resetFragmentLoading(v)})},i.flushMainBuffer=function(v,_,D){if(D===void 0&&(D=null),!(v-_))return;var B={startOffset:v,endOffset:_,type:D};this.fragLoadError=0,this.hls.trigger(T.Events.BUFFER_FLUSHING,B)},i._loadInitSegment=function(v){var _=this;this._doFragLoad(v).then(function(D){if(!D||_.fragContextChanged(v)||!_.levels)throw new Error("init load aborted");return D}).then(function(D){var B=_.hls,j=D.payload,W=v.decryptdata;if(j&&j.byteLength>0&&W&&W.key&&W.iv&&W.method==="AES-128"){var h=self.performance.now();return _.decrypter.webCryptoDecrypt(new Uint8Array(j),W.key.buffer,W.iv.buffer).then(function(N){var H=self.performance.now();return B.trigger(T.Events.FRAG_DECRYPTED,{frag:v,payload:N,stats:{tstart:h,tdecrypt:H}}),D.payload=N,D})}return D}).then(function(D){var B=_.fragCurrent,j=_.hls,W=_.levels;if(!W)throw new Error("init load aborted, missing levels");var h=W[v.level].details;console.assert(h,"Level details are defined when init segment is loaded");var N=v.stats;_.state=x.IDLE,_.fragLoadError=0,v.data=new Uint8Array(D.payload),N.parsing.start=N.buffering.start=self.performance.now(),N.parsing.end=N.buffering.end=self.performance.now(),D.frag===B&&j.trigger(T.Events.FRAG_BUFFERED,{stats:N,frag:B,part:null,id:v.type}),_.tick()}).catch(function(D){_.warn(D),_.resetFragmentLoading(v)})},i.fragContextChanged=function(v){var _=this.fragCurrent;return!v||!_||v.level!==_.level||v.sn!==_.sn||v.urlId!==_.urlId},i.fragBufferedComplete=function(v,_){var D=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+v.type+" sn: "+v.sn+(_?" part: "+_.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+v.level+" "+s.default.toString(U.BufferHelper.getBuffered(D))),this.state=x.IDLE,this.tick()},i._handleFragmentLoadComplete=function(v){var _=this.transmuxer;if(!_)return;var D=v.frag,B=v.part,j=v.partsLoaded,W=!j||j.length===0||j.some(function(N){return!N}),h=new b.ChunkMetadata(D.level,D.sn,D.stats.chunkCount+1,0,B?B.index:-1,!W);_.flush(h)},i._handleFragmentLoadProgress=function(v){},i._doFragLoad=function(v,_,D,B){var j=this;if(D===void 0&&(D=null),!this.levels)throw new Error("frag load aborted, missing levels");if(D=Math.max(v.start,D||0),this.config.lowLatencyMode&&_){var W=_.partList;if(W&&B){D>v.end&&_.fragmentHint&&(v=_.fragmentHint);var h=this.getNextPart(W,v,D);if(h>-1){var N=W[h];return this.log("Loading part sn: "+v.sn+" p: "+N.index+" cc: "+v.cc+" of playlist ["+_.startSN+"-"+_.endSN+"] parts [0-"+h+"-"+(W.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+v.level+", target: "+parseFloat(D.toFixed(3))),this.nextLoadPosition=N.start+N.duration,this.state=x.FRAG_LOADING,this.hls.trigger(T.Events.FRAG_LOADING,{frag:v,part:W[h],targetBufferTime:D}),this.doFragPartsLoad(v,W,h,B).catch(function(H){return j.handleFragLoadError(H)})}else if(!v.url||this.loadedEndOfParts(W,D))return Promise.resolve(null)}}return this.log("Loading fragment "+v.sn+" cc: "+v.cc+" "+(_?"of ["+_.startSN+"-"+_.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+v.level+", target: "+parseFloat(D.toFixed(3))),Object(K.isFiniteNumber)(v.sn)&&!this.bitrateTest&&(this.nextLoadPosition=v.start+v.duration),this.state=x.FRAG_LOADING,this.hls.trigger(T.Events.FRAG_LOADING,{frag:v,targetBufferTime:D}),this.fragmentLoader.load(v,B).catch(function(H){return j.handleFragLoadError(H)})},i.doFragPartsLoad=function(v,_,D,B){var j=this;return new Promise(function(W,h){var N=[],H=function X(Y){var re=_[Y];j.fragmentLoader.loadPart(v,re,B).then(function(he){N[re.index]=he;var de=he.part;j.hls.trigger(T.Events.FRAG_LOADED,he);var ne=_[Y+1];if(ne&&ne.fragment===v)X(Y+1);else return W({frag:v,part:de,partsLoaded:N})}).catch(h)};H(D)})},i.handleFragLoadError=function(v){var _=v.data;return _&&_.details===P.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(_.frag,_.part):this.hls.trigger(T.Events.ERROR,_),null},i._handleTransmuxerFlush=function(v){var _=this.getCurrentContext(v);if(!_||this.state!==x.PARSING){this.fragCurrent||(this.state=x.IDLE);return}var D=_.frag,B=_.part,j=_.level,W=self.performance.now();D.stats.parsing.end=W,B&&(B.stats.parsing.end=W),this.updateLevelTiming(D,B,j,v.partial)},i.getCurrentContext=function(v){var _=this.levels,D=v.level,B=v.sn,j=v.part;if(!_||!_[D])return this.warn("Levels object was unset while buffering fragment "+B+" of level "+D+". The current chunk will not be buffered."),null;var W=_[D],h=j>-1?Object(p.getPartWith)(W,B,j):null,N=h?h.fragment:Object(p.getFragmentWithSN)(W,B,this.fragCurrent);return N?{frag:N,part:h,level:W}:null},i.bufferFragmentData=function(v,_,D,B){if(!v||this.state!==x.PARSING)return;var j=v.data1,W=v.data2,h=j;if(j&&W&&(h=Object(g.appendUint8Array)(j,W)),!h||!h.length)return;var N={type:v.type,frag:_,part:D,chunkMeta:B,parent:_.type,data:h};this.hls.trigger(T.Events.BUFFER_APPENDING,N),v.dropped&&v.independent&&!D&&this.flushBufferGap(_)},i.flushBufferGap=function(v){var _=this.media;if(!_)return;if(!U.BufferHelper.isBuffered(_,_.currentTime)){this.flushMainBuffer(0,v.start);return}var D=_.currentTime,B=U.BufferHelper.bufferInfo(_,D,0),j=v.duration,W=Math.min(this.config.maxFragLookUpTolerance*2,j*.25),h=Math.max(Math.min(v.start-W,B.end-W),D+W);v.start-h>W&&this.flushMainBuffer(h,v.start)},i.getFwdBufferInfo=function(v,_){var D=this.config,B=this.getLoadPosition();if(!Object(K.isFiniteNumber)(B))return null;var j=U.BufferHelper.bufferInfo(v,B,D.maxBufferHole);if(j.len===0&&j.nextStart!==void 0){var W=this.fragmentTracker.getBufferedFrag(B,_);if(W&&j.nextStart<W.end)return U.BufferHelper.bufferInfo(v,B,Math.max(j.nextStart,D.maxBufferHole))}return j},i.getMaxBufferLength=function(v){var _=this.config,D;return v?D=Math.max(8*_.maxBufferSize/v,_.maxBufferLength):D=_.maxBufferLength,Math.min(D,_.maxMaxBufferLength)},i.reduceMaxBufferLength=function(v){var _=this.config,D=v||_.maxBufferLength;return _.maxMaxBufferLength>=D?(_.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+_.maxMaxBufferLength+"s"),!0):!1},i.getNextFragment=function(v,_){var D,B,j=_.fragments,W=j.length;if(!W)return null;var h=this.config,N=j[0].start,H;if(_.live){var X=h.initialLiveManifestSize;if(W<X)return this.warn("Not enough fragments to start playback (have: "+W+", need: "+X+")"),null;!_.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(H=this.getInitialLiveFragment(_,j),this.startPosition=H?this.hls.liveSyncPosition||H.start:v)}else v<=N&&(H=j[0]);if(!H){var Y=h.lowLatencyMode?_.partEnd:_.fragmentEnd;H=this.getFragmentAtPosition(v,Y,_)}return(D=H)!==null&&D!==void 0&&D.initSegment&&!((B=H)!==null&&B!==void 0&&B.initSegment.data)&&!this.bitrateTest&&(H=H.initSegment),H},i.getNextPart=function(v,_,D){for(var B=-1,j=!1,W=!0,h=0,N=v.length;h<N;h++){var H=v[h];if(W=W&&!H.independent,B>-1&&D<H.start)break;var X=H.loaded;!X&&(j||H.independent||W)&&H.fragment===_&&(B=h),j=X}return B},i.loadedEndOfParts=function(v,_){var D=v[v.length-1];return D&&_>D.start&&D.loaded},i.getInitialLiveFragment=function(v,_){var D=this.fragPrevious,B=null;if(D){if(v.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+D.programDateTime),B=Object(w.findFragmentByPDT)(_,D.endProgramDateTime,this.config.maxFragLookUpTolerance)),!B){var j=D.sn+1;if(j>=v.startSN&&j<=v.endSN){var W=_[j-v.startSN];D.cc===W.cc&&(B=W,this.log("Live playlist, switching playlist, load frag with next SN: "+B.sn))}B||(B=Object(w.findFragWithCC)(_,D.cc),B&&this.log("Live playlist, switching playlist, load frag with same CC: "+B.sn))}}else{var h=this.hls.liveSyncPosition;h!==null&&(B=this.getFragmentAtPosition(h,this.bitrateTest?v.fragmentEnd:v.edge,v))}return B},i.getFragmentAtPosition=function(v,_,D){var B=this.config,j=this.fragPrevious,W=D.fragments,h=D.endSN,N=D.fragmentHint,H=B.maxFragLookUpTolerance,X=!!(B.lowLatencyMode&&D.partList&&N);X&&N&&!this.bitrateTest&&(W=W.concat(N),h=N.sn);var Y;if(v<_){var re=v>_-H?0:H;Y=Object(w.findFragmentByPTS)(j,W,v,re)}else Y=W[W.length-1];if(Y){var he=Y.sn-D.startSN,de=j&&Y.level===j.level,ne=W[he+1],ae=this.fragmentTracker.getState(Y);if(ae===L.FragmentState.BACKTRACKED){Y=null;for(var le=he;W[le]&&this.fragmentTracker.getState(W[le])===L.FragmentState.BACKTRACKED;)j?Y=W[le--]:Y=W[--le];Y||(Y=ne)}else j&&Y.sn===j.sn&&!X&&(de&&(Y.sn<h&&this.fragmentTracker.getState(ne)!==L.FragmentState.OK?(this.log("SN "+Y.sn+" just loaded, load next one: "+ne.sn),Y=ne):Y=null))}return Y},i.synchronizeToLiveEdge=function(v){var _=this.config,D=this.media;if(!D)return;var B=this.hls.liveSyncPosition,j=D.currentTime,W=v.fragments[0].start,h=v.edge,N=j>=W-_.maxFragLookUpTolerance&&j<=h;if(B!==null&&D.duration>B&&(j<B||!N)){var H=_.liveMaxLatencyDuration!==void 0?_.liveMaxLatencyDuration:_.liveMaxLatencyDurationCount*v.targetduration;(!N&&D.readyState<4||j<h-H)&&(this.loadedmetadata||(this.nextLoadPosition=B),D.readyState&&(this.warn("Playback: "+j.toFixed(3)+" is located too far from the end of live sliding playlist: "+h+", reset currentTime to : "+B.toFixed(3)),D.currentTime=B))}},i.alignPlaylists=function(v,_){var D=this.levels,B=this.levelLastLoaded,j=this.fragPrevious,W=B!==null?D[B]:null,h=v.fragments.length;if(!h)return this.warn("No fragments in live playlist"),0;var N=v.fragments[0].start,H=!_,X=v.alignedSliding&&Object(K.isFiniteNumber)(N);if(H||!X&&!N){Object(k.alignStream)(j,W,v);var Y=v.fragments[0].start;return this.log("Live playlist sliding: "+Y.toFixed(2)+" start-sn: "+(_?_.startSN:"na")+"->"+v.startSN+" prev-sn: "+(j?j.sn:"na")+" fragments: "+h),Y}return N},i.waitForCdnTuneIn=function(v){var _=3;return v.live&&v.canBlockReload&&v.tuneInGoal>Math.max(v.partHoldBack,v.partTarget*_)},i.setStartPosition=function(v,_){var D=this.startPosition;if(D<_&&(D=-1),D===-1||this.lastCurrentTime===-1){var B=v.startTimeOffset;Object(K.isFiniteNumber)(B)?(D=_+B,B<0&&(D+=v.totalduration),D=Math.min(Math.max(_,D),_+v.totalduration),this.log("Start time offset "+B+" found in playlist, adjust startPosition to "+D),this.startPosition=D):v.live?D=this.hls.liveSyncPosition||_:this.startPosition=D=0,this.lastCurrentTime=D}this.nextLoadPosition=D},i.getLoadPosition=function(){var v=this.media,_=0;return this.loadedmetadata&&v?_=v.currentTime:this.nextLoadPosition&&(_=this.nextLoadPosition),_},i.handleFragLoadAborted=function(v,_){this.transmuxer&&v.sn!=="initSegment"&&v.stats.aborted&&(this.warn("Fragment "+v.sn+(_?" part"+_.index:"")+" of level "+v.level+" was aborted"),this.resetFragmentLoading(v))},i.resetFragmentLoading=function(v){(!this.fragCurrent||!this.fragContextChanged(v))&&(this.state=x.IDLE)},i.onFragmentOrKeyLoadError=function(v,_){if(_.fatal)return;var D=_.frag;if(!D||D.type!==v)return;var B=this.fragCurrent;console.assert(B&&D.sn===B.sn&&D.level===B.level&&D.urlId===B.urlId,"Frag load error must match current frag to retry");var j=this.config;if(this.fragLoadError+1<=j.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(D.level))return;var W=Math.min(Math.pow(2,this.fragLoadError)*j.fragLoadingRetryDelay,j.fragLoadingMaxRetryTimeout);this.warn("Fragment "+D.sn+" of "+v+" "+D.level+" failed to load, retrying in "+W+"ms"),this.retryDate=self.performance.now()+W,this.fragLoadError++,this.state=x.FRAG_LOADING_WAITING_RETRY}else _.levelRetry?(v===c.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=x.IDLE):(I.logger.error(_.details+" reaches max retry, redispatch as fatal ..."),_.fatal=!0,this.hls.stopLoad(),this.state=x.ERROR)},i.afterBufferFlushed=function(v,_,D){if(!v)return;var B=U.BufferHelper.getBuffered(v);this.fragmentTracker.detectEvictedFragments(_,B,D),this.state===x.ENDED&&this.resetLoadingState()},i.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=x.IDLE},i.resetLiveStartWhenNotLoaded=function(v){if(!this.loadedmetadata){this.startFragRequested=!1;var _=this.levels?this.levels[v].details:null;if(_!=null&&_.live)return this.startPosition=-1,this.setStartPosition(_,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},i.updateLevelTiming=function(v,_,D,B){var j=this,W=D.details;console.assert(!!W,"level.details must be defined");var h=Object.keys(v.elementaryStreams).reduce(function(N,H){var X=v.elementaryStreams[H];if(X){var Y=X.endPTS-X.startPTS;if(Y<=0)return j.warn("Could not parse fragment "+v.sn+" "+H+" duration reliably ("+Y+") resetting transmuxer to fallback to playlist timing"),j.resetTransmuxer(),N||!1;var re=B?0:Object(p.updateFragPTSDTS)(W,v,X.startPTS,X.endPTS,X.startDTS,X.endDTS);return j.hls.trigger(T.Events.LEVEL_PTS_UPDATED,{details:W,level:D,drift:re,type:H,frag:v,start:X.startPTS,end:X.endPTS}),!0}return N},!1);h?(this.state=x.PARSED,this.hls.trigger(T.Events.FRAG_PARSED,{frag:v,part:_})):this.resetLoadingState()},i.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},S(a,[{key:"state",get:function(){return this._state},set:function(v){var _=this._state;_!==v&&(this._state=v,this.log(_+"->"+v))}}]),a}(O.default)},"./src/controller/buffer-controller.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"default",function(){return w});var K=R("./src/polyfills/number.ts"),O=R("./src/events.ts"),L=R("./src/utils/logger.ts"),U=R("./src/errors.ts"),I=R("./src/utils/buffer-helper.ts"),T=R("./src/utils/mediasource-helper.ts"),P=R("./src/loader/fragment.ts"),b=R("./src/controller/buffer-operation-queue.ts"),g=Object(T.getMediaSource)(),k=/([ha]vc.)(?:\.[^.,]+)+/,w=function(){function p(f){var s=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 c=s.hls,d=s.media,S=s.mediaSource;L.logger.log("[buffer-controller]: Media source opened"),d&&(s.updateMediaElementDuration(),c.trigger(O.Events.MEDIA_ATTACHED,{media:d})),S&&S.removeEventListener("sourceopen",s._onMediaSourceOpen),s.checkPendingTracks()},this._onMediaSourceClose=function(){L.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){L.logger.log("[buffer-controller]: Media source ended")},this.hls=f,this._initSourceBuffer(),this.registerListeners()}var y=p.prototype;return y.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},y.destroy=function(){this.unregisterListeners(),this.details=null},y.registerListeners=function(){var s=this.hls;s.on(O.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),s.on(O.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.on(O.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.on(O.Events.BUFFER_RESET,this.onBufferReset,this),s.on(O.Events.BUFFER_APPENDING,this.onBufferAppending,this),s.on(O.Events.BUFFER_CODECS,this.onBufferCodecs,this),s.on(O.Events.BUFFER_EOS,this.onBufferEos,this),s.on(O.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),s.on(O.Events.LEVEL_UPDATED,this.onLevelUpdated,this),s.on(O.Events.FRAG_PARSED,this.onFragParsed,this),s.on(O.Events.FRAG_CHANGED,this.onFragChanged,this)},y.unregisterListeners=function(){var s=this.hls;s.off(O.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),s.off(O.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.off(O.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.off(O.Events.BUFFER_RESET,this.onBufferReset,this),s.off(O.Events.BUFFER_APPENDING,this.onBufferAppending,this),s.off(O.Events.BUFFER_CODECS,this.onBufferCodecs,this),s.off(O.Events.BUFFER_EOS,this.onBufferEos,this),s.off(O.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),s.off(O.Events.LEVEL_UPDATED,this.onLevelUpdated,this),s.off(O.Events.FRAG_PARSED,this.onFragParsed,this),s.off(O.Events.FRAG_CHANGED,this.onFragChanged,this)},y._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new b.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},y.onManifestParsed=function(s,c){var d=2;(c.audio&&!c.video||!c.altAudio)&&(d=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=d,this.details=null,L.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},y.onMediaAttaching=function(s,c){var d=this.media=c.media;if(d&&g){var S=this.mediaSource=new g;S.addEventListener("sourceopen",this._onMediaSourceOpen),S.addEventListener("sourceended",this._onMediaSourceEnded),S.addEventListener("sourceclose",this._onMediaSourceClose),d.src=self.URL.createObjectURL(S),this._objectUrl=d.src}},y.onMediaDetaching=function(){var s=this.media,c=this.mediaSource,d=this._objectUrl;if(c){if(L.logger.log("[buffer-controller]: media source detaching"),c.readyState==="open")try{c.endOfStream()}catch(S){L.logger.warn("[buffer-controller]: onMediaDetaching: "+S.message+" while calling endOfStream")}this.onBufferReset(),c.removeEventListener("sourceopen",this._onMediaSourceOpen),c.removeEventListener("sourceended",this._onMediaSourceEnded),c.removeEventListener("sourceclose",this._onMediaSourceClose),s&&(d&&self.URL.revokeObjectURL(d),s.src===d?(s.removeAttribute("src"),s.load()):L.logger.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(O.Events.MEDIA_DETACHED,void 0)},y.onBufferReset=function(){var s=this;this.getSourceBufferTypes().forEach(function(c){var d=s.sourceBuffer[c];try{d&&(s.removeBufferListeners(c),s.mediaSource&&s.mediaSource.removeSourceBuffer(d),s.sourceBuffer[c]=void 0)}catch(S){L.logger.warn("[buffer-controller]: Failed to reset the "+c+" buffer",S)}}),this._initSourceBuffer()},y.onBufferCodecs=function(s,c){var d=this,S=this.getSourceBufferTypes().length;if(Object.keys(c).forEach(function(C){if(S){var m=d.tracks[C];if(m&&typeof m.buffer.changeType=="function"){var A=c[C],x=A.codec,u=A.levelCodec,l=A.container,a=(m.levelCodec||m.codec).replace(k,"$1"),i=(u||x).replace(k,"$1");if(a!==i){var E=l+";codecs="+(u||x);d.appendChangeType(C,E)}}}else d.pendingTracks[C]=c[C]}),S)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},y.appendChangeType=function(s,c){var d=this,S=this.operationQueue,C={execute:function(){var A=d.sourceBuffer[s];A&&(L.logger.log("[buffer-controller]: changing "+s+" sourceBuffer type to "+c),A.changeType(c)),S.shiftAndExecuteNext(s)},onStart:function(){},onComplete:function(){},onError:function(A){L.logger.warn("[buffer-controller]: Failed to change "+s+" SourceBuffer type",A)}};S.append(C,s)},y.onBufferAppending=function(s,c){var d=this,S=this.hls,C=this.operationQueue,m=this.tracks,A=c.data,x=c.type,u=c.frag,l=c.part,a=c.chunkMeta,i=a.buffering[x],E=self.performance.now();i.start=E;var v=u.stats.buffering,_=l?l.stats.buffering:null;v.start===0&&(v.start=E),_&&_.start===0&&(_.start=E);var D=m.audio,B=x==="audio"&&a.id===1&&(D==null?void 0:D.container)==="audio/mpeg",j={execute:function(){if(i.executeStart=self.performance.now(),B){var h=d.sourceBuffer[x];if(h){var N=u.start-h.timestampOffset;Math.abs(N)>=.1&&(L.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+u.start+" (delta: "+N+") sn: "+u.sn+")"),h.timestampOffset=u.start)}}d.appendExecutor(A,x)},onStart:function(){},onComplete:function(){var h=self.performance.now();i.executeEnd=i.end=h,v.first===0&&(v.first=h),_&&_.first===0&&(_.first=h);var N=d.sourceBuffer,H={};for(var X in N)H[X]=I.BufferHelper.getBuffered(N[X]);d.appendError=0,d.hls.trigger(O.Events.BUFFER_APPENDED,{type:x,frag:u,part:l,chunkMeta:a,parent:u.type,timeRanges:H})},onError:function(h){L.logger.error("[buffer-controller]: Error encountered while trying to append to the "+x+" SourceBuffer",h);var N={type:U.ErrorTypes.MEDIA_ERROR,parent:u.type,details:U.ErrorDetails.BUFFER_APPEND_ERROR,err:h,fatal:!1};h.code===DOMException.QUOTA_EXCEEDED_ERR?N.details=U.ErrorDetails.BUFFER_FULL_ERROR:(d.appendError++,N.details=U.ErrorDetails.BUFFER_APPEND_ERROR,d.appendError>S.config.appendErrorMaxRetry&&(L.logger.error("[buffer-controller]: Failed "+S.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),N.fatal=!0)),S.trigger(O.Events.ERROR,N)}};C.append(j,x)},y.onBufferFlushing=function(s,c){var d=this,S=this.operationQueue,C=function(A){return{execute:d.removeExecutor.bind(d,A,c.startOffset,c.endOffset),onStart:function(){},onComplete:function(){d.hls.trigger(O.Events.BUFFER_FLUSHED,{type:A})},onError:function(u){L.logger.warn("[buffer-controller]: Failed to remove from "+A+" SourceBuffer",u)}}};c.type?S.append(C(c.type),c.type):this.getSourceBufferTypes().forEach(function(m){S.append(C(m),m)})},y.onFragParsed=function(s,c){var d=this,S=c.frag,C=c.part,m=[],A=C?C.elementaryStreams:S.elementaryStreams;A[P.ElementaryStreamTypes.AUDIOVIDEO]?m.push("audiovideo"):(A[P.ElementaryStreamTypes.AUDIO]&&m.push("audio"),A[P.ElementaryStreamTypes.VIDEO]&&m.push("video"));var x=function(){var l=self.performance.now();S.stats.buffering.end=l,C&&(C.stats.buffering.end=l);var a=C?C.stats:S.stats;d.hls.trigger(O.Events.FRAG_BUFFERED,{frag:S,part:C,stats:a,id:S.type})};m.length===0&&L.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+S.type+" level: "+S.level+" sn: "+S.sn),this.blockBuffers(x,m)},y.onFragChanged=function(s,c){this.flushBackBuffer()},y.onBufferEos=function(s,c){var d=this,S=this.getSourceBufferTypes().reduce(function(C,m){var A=d.sourceBuffer[m];return(!c.type||c.type===m)&&(A&&!A.ended&&(A.ended=!0,L.logger.log("[buffer-controller]: "+m+" sourceBuffer now EOS"))),C&&!!(!A||A.ended)},!0);S&&this.blockBuffers(function(){var C=d.mediaSource;if(!C||C.readyState!=="open")return;C.endOfStream()})},y.onLevelUpdated=function(s,c){var d=c.details;if(!d.fragments.length)return;this.details=d,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},y.flushBackBuffer=function(){var s=this.hls,c=this.details,d=this.media,S=this.sourceBuffer;if(!d||c===null)return;var C=this.getSourceBufferTypes();if(!C.length)return;var m=c.live&&s.config.liveBackBufferLength!==null?s.config.liveBackBufferLength:s.config.backBufferLength;if(!Object(K.isFiniteNumber)(m)||m<0)return;var A=d.currentTime,x=c.levelTargetDuration,u=Math.max(m,x),l=Math.floor(A/x)*x-u;C.forEach(function(a){var i=S[a];if(i){var E=I.BufferHelper.getBuffered(i);E.length>0&&l>E.start(0)&&(s.trigger(O.Events.BACK_BUFFER_REACHED,{bufferEnd:l}),c.live&&s.trigger(O.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:l}),s.trigger(O.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:l,type:a}))}})},y.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var s=this.details,c=this.hls,d=this.media,S=this.mediaSource,C=s.fragments[0].start+s.totalduration,m=d.duration,A=Object(K.isFiniteNumber)(S.duration)?S.duration:0;s.live&&c.config.liveDurationInfinity?(L.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),S.duration=Infinity,this.updateSeekableRange(s)):(C>A&&C>m||!Object(K.isFiniteNumber)(m))&&(L.logger.log("[buffer-controller]: Updating Media Source duration to "+C.toFixed(3)),S.duration=C)},y.updateSeekableRange=function(s){var c=this.mediaSource,d=s.fragments,S=d.length;if(S&&s.live&&c!==null&&c!==void 0&&c.setLiveSeekableRange){var C=Math.max(0,d[0].start),m=Math.max(C,C+s.totalduration);c.setLiveSeekableRange(C,m)}},y.checkPendingTracks=function(){var s=this.bufferCodecEventsExpected,c=this.operationQueue,d=this.pendingTracks,S=Object.keys(d).length;if(S&&!s||S===2){this.createSourceBuffers(d),this.pendingTracks={};var C=this.getSourceBufferTypes();if(C.length===0){this.hls.trigger(O.Events.ERROR,{type:U.ErrorTypes.MEDIA_ERROR,details:U.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}C.forEach(function(m){c.executeNext(m)})}},y.createSourceBuffers=function(s){var c=this.sourceBuffer,d=this.mediaSource;if(!d)throw Error("createSourceBuffers called when mediaSource was null");var S=0;for(var C in s)if(!c[C]){var m=s[C];if(!m)throw Error("source buffer exists for track "+C+", however track does not");var A=m.levelCodec||m.codec,x=m.container+";codecs="+A;L.logger.log("[buffer-controller]: creating sourceBuffer("+x+")");try{var u=c[C]=d.addSourceBuffer(x),l=C;this.addBufferListener(l,"updatestart",this._onSBUpdateStart),this.addBufferListener(l,"updateend",this._onSBUpdateEnd),this.addBufferListener(l,"error",this._onSBUpdateError),this.tracks[C]={buffer:u,codec:A,container:m.container,levelCodec:m.levelCodec,id:m.id},S++}catch(a){L.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+a.message),this.hls.trigger(O.Events.ERROR,{type:U.ErrorTypes.MEDIA_ERROR,details:U.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:a,mimeType:x})}}S&&this.hls.trigger(O.Events.BUFFER_CREATED,{tracks:this.tracks})},y._onSBUpdateStart=function(s){var c=this.operationQueue,d=c.current(s);d.onStart()},y._onSBUpdateEnd=function(s){var c=this.operationQueue,d=c.current(s);d.onComplete(),c.shiftAndExecuteNext(s)},y._onSBUpdateError=function(s,c){L.logger.error("[buffer-controller]: "+s+" SourceBuffer error",c),this.hls.trigger(O.Events.ERROR,{type:U.ErrorTypes.MEDIA_ERROR,details:U.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var d=this.operationQueue.current(s);d&&d.onError(c)},y.removeExecutor=function(s,c,d){var S=this.media,C=this.mediaSource,m=this.operationQueue,A=this.sourceBuffer,x=A[s];if(!S||!C||!x){L.logger.warn("[buffer-controller]: Attempting to remove from the "+s+" SourceBuffer, but it does not exist"),m.shiftAndExecuteNext(s);return}var u=Object(K.isFiniteNumber)(S.duration)?S.duration:Infinity,l=Object(K.isFiniteNumber)(C.duration)?C.duration:Infinity,a=Math.max(0,c),i=Math.min(d,u,l);i>a?(L.logger.log("[buffer-controller]: Removing ["+a+","+i+"] from the "+s+" SourceBuffer"),console.assert(!x.updating,s+" sourceBuffer must not be updating"),x.remove(a,i)):m.shiftAndExecuteNext(s)},y.appendExecutor=function(s,c){var d=this.operationQueue,S=this.sourceBuffer,C=S[c];if(!C){L.logger.warn("[buffer-controller]: Attempting to append to the "+c+" SourceBuffer, but it does not exist"),d.shiftAndExecuteNext(c);return}C.ended=!1,console.assert(!C.updating,c+" sourceBuffer must not be updating"),C.appendBuffer(s)},y.blockBuffers=function(s,c){var d=this;if(c===void 0&&(c=this.getSourceBufferTypes()),!c.length){L.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(s);return}var S=this.operationQueue,C=c.map(function(m){return S.appendBlocker(m)});Promise.all(C).then(function(){s(),c.forEach(function(m){var A=d.sourceBuffer[m];(!A||!A.updating)&&S.shiftAndExecuteNext(m)})})},y.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},y.addBufferListener=function(s,c,d){var S=this.sourceBuffer[s];if(!S)return;var C=d.bind(this,s);this.listeners[s].push({event:c,listener:C}),S.addEventListener(c,C)},y.removeBufferListeners=function(s){var c=this.sourceBuffer[s];if(!c)return;this.listeners[s].forEach(function(d){c.removeEventListener(d.event,d.listener)})},p}()},"./src/controller/buffer-operation-queue.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"default",function(){return O});var K=R("./src/utils/logger.ts"),O=function(){function L(I){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=I}var U=L.prototype;return U.append=function(T,P){var b=this.queues[P];b.push(T),b.length===1&&this.buffers[P]&&this.executeNext(P)},U.insertAbort=function(T,P){var b=this.queues[P];b.unshift(T),this.executeNext(P)},U.appendBlocker=function(T){var P,b=new Promise(function(k){P=k}),g={execute:P,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(g,T),b},U.executeNext=function(T){var P=this.buffers,b=this.queues,g=P[T],k=b[T];if(k.length){var w=k[0];try{w.execute()}catch(p){K.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),w.onError(p),(!g||!g.updating)&&(k.shift(),this.executeNext(T))}}},U.shiftAndExecuteNext=function(T){this.queues[T].shift(),this.executeNext(T)},U.current=function(T){return this.queues[T][0]},L}()},"./src/controller/cap-level-controller.ts":function(q,G,R){"use strict";R.r(G);var K=R("./src/events.ts");function O(I,T){for(var P=0;P<T.length;P++){var b=T[P];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(I,b.key,b)}}function L(I,T,P){return T&&O(I.prototype,T),P&&O(I,P),I}var U=function(){function I(P){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=P,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var T=I.prototype;return T.setStreamController=function(b){this.streamController=b},T.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},T.registerListeners=function(){var b=this.hls;b.on(K.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),b.on(K.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),b.on(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),b.on(K.Events.BUFFER_CODECS,this.onBufferCodecs,this),b.on(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},T.unregisterListener=function(){var b=this.hls;b.off(K.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),b.off(K.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),b.off(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),b.off(K.Events.BUFFER_CODECS,this.onBufferCodecs,this),b.off(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},T.onFpsDropLevelCapping=function(b,g){I.isLevelAllowed(g.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(g.droppedLevel)},T.onMediaAttaching=function(b,g){this.media=g.media instanceof HTMLVideoElement?g.media:null},T.onManifestParsed=function(b,g){var k=this.hls;this.restrictedLevels=[],this.firstLevel=g.firstLevel,k.config.capLevelToPlayerSize&&g.video&&this.startCapping()},T.onBufferCodecs=function(b,g){var k=this.hls;k.config.capLevelToPlayerSize&&g.video&&this.startCapping()},T.onMediaDetaching=function(){this.stopCapping()},T.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var b=this.hls.levels;if(b.length){var g=this.hls;g.autoLevelCapping=this.getMaxLevel(b.length-1),g.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=g.autoLevelCapping}}},T.getMaxLevel=function(b){var g=this,k=this.hls.levels;if(!k.length)return-1;var w=k.filter(function(p,y){return I.isLevelAllowed(y,g.restrictedLevels)&&y<=b});return this.clientRect=null,I.getMaxLevelByMediaSize(w,this.mediaWidth,this.mediaHeight)},T.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()},T.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},T.getDimensions=function(){if(this.clientRect)return this.clientRect;var b=this.media,g={width:0,height:0};if(b){var k=b.getBoundingClientRect();g.width=k.width,g.height=k.height,!g.width&&!g.height&&(g.width=k.right-k.left||b.width||0,g.height=k.bottom-k.top||b.height||0)}return this.clientRect=g,g},I.isLevelAllowed=function(b,g){return g===void 0&&(g=[]),g.indexOf(b)===-1},I.getMaxLevelByMediaSize=function(b,g,k){if(!b||!b.length)return-1;for(var w=function(c,d){return d?c.width!==d.width||c.height!==d.height:!0},p=b.length-1,y=0;y<b.length;y+=1){var f=b[y];if((f.width>=g||f.height>=k)&&w(f,b[y+1])){p=y;break}}return p},L(I,[{key:"mediaWidth",get:function(){return this.getDimensions().width*I.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*I.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var b=1;try{b=self.devicePixelRatio}catch(g){}return b}}]),I}();G.default=U},"./src/controller/cmcd-controller.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"default",function(){return w});var K=R("./src/events.ts"),O=R("./src/types/cmcd.ts"),L=R("./src/utils/buffer-helper.ts"),U=R("./src/utils/logger.ts");function I(p,y){for(var f=0;f<y.length;f++){var s=y[f];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(p,s.key,s)}}function T(p,y,f){return y&&I(p.prototype,y),f&&I(p,f),p}function P(p,y){var f=typeof Symbol!="undefined"&&p[Symbol.iterator]||p["@@iterator"];if(f)return(f=f.call(p)).next.bind(f);if(Array.isArray(p)||(f=b(p))||y&&p&&typeof p.length=="number"){f&&(p=f);var s=0;return function(){return s>=p.length?{done:!0}:{done:!1,value:p[s++]}}}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 b(p,y){if(!p)return;if(typeof p=="string")return g(p,y);var f=Object.prototype.toString.call(p).slice(8,-1);if(f==="Object"&&p.constructor&&(f=p.constructor.name),f==="Map"||f==="Set")return Array.from(p);if(f==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(f))return g(p,y)}function g(p,y){(y==null||y>p.length)&&(y=p.length);for(var f=0,s=new Array(y);f<y;f++)s[f]=p[f];return s}function k(){return k=Object.assign||function(p){for(var y=1;y<arguments.length;y++){var f=arguments[y];for(var s in f)Object.prototype.hasOwnProperty.call(f,s)&&(p[s]=f[s])}return p},k.apply(this,arguments)}var w=function(){function p(f){var s=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(){s.initialized&&(s.starved=!0),s.buffering=!0},this.onPlaying=function(){s.initialized||(s.initialized=!0),s.buffering=!1},this.applyPlaylistData=function(S){try{s.apply(S,{ot:O.CMCDObjectType.MANIFEST,su:!s.initialized})}catch(C){U.logger.warn("Could not generate manifest CMCD data.",C)}},this.applyFragmentData=function(S){try{var C=S.frag,m=s.hls.levels[C.level],A=s.getObjectType(C),x={d:C.duration*1e3,ot:A};(A===O.CMCDObjectType.VIDEO||A===O.CMCDObjectType.AUDIO||A==O.CMCDObjectType.MUXED)&&(x.br=m.bitrate/1e3,x.tb=s.getTopBandwidth(A),x.bl=s.getBufferLength(A)),s.apply(S,x)}catch(u){U.logger.warn("Could not generate segment CMCD data.",u)}},this.hls=f;var c=this.config=f.config,d=c.cmcd;d!=null&&(c.pLoader=this.createPlaylistLoader(),c.fLoader=this.createFragmentLoader(),this.sid=d.sessionId||p.uuid(),this.cid=d.contentId,this.useHeaders=d.useHeaders===!0,this.registerListeners())}var y=p.prototype;return y.registerListeners=function(){var s=this.hls;s.on(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.on(K.Events.MEDIA_DETACHED,this.onMediaDetached,this),s.on(K.Events.BUFFER_CREATED,this.onBufferCreated,this)},y.unregisterListeners=function(){var s=this.hls;s.off(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.off(K.Events.MEDIA_DETACHED,this.onMediaDetached,this),s.off(K.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},y.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},y.onMediaAttached=function(s,c){this.media=c.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},y.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},y.onBufferCreated=function(s,c){var d,S;this.audioBuffer=(d=c.tracks.audio)===null||d===void 0?void 0:d.buffer,this.videoBuffer=(S=c.tracks.video)===null||S===void 0?void 0:S.buffer},y.createData=function(){var s;return{v:O.CMCDVersion,sf:O.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(s=this.media)===null||s===void 0?void 0:s.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},y.apply=function(s,c){c===void 0&&(c={}),k(c,this.createData());var d=c.ot===O.CMCDObjectType.INIT||c.ot===O.CMCDObjectType.VIDEO||c.ot===O.CMCDObjectType.MUXED;if(this.starved&&d&&(c.bs=!0,c.su=!0,this.starved=!1),c.su==null&&(c.su=this.buffering),this.useHeaders){var S=p.toHeaders(c);if(!Object.keys(S).length)return;s.headers||(s.headers={}),k(s.headers,S)}else{var C=p.toQuery(c);if(!C)return;s.url=p.appendQueryToUri(s.url,C)}},y.getObjectType=function(s){var c=s.type;return c==="subtitle"?O.CMCDObjectType.TIMED_TEXT:s.sn==="initSegment"?O.CMCDObjectType.INIT:c==="audio"?O.CMCDObjectType.AUDIO:c==="main"?this.hls.audioTracks.length?O.CMCDObjectType.VIDEO:O.CMCDObjectType.MUXED:void 0},y.getTopBandwidth=function(s){for(var c=0,d=s===O.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,S=P(d),C;!(C=S()).done;){var m=C.value;m.bitrate>c&&(c=m.bitrate)}return c>0?c:NaN},y.getBufferLength=function(s){var c=this.hls.media,d=s===O.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!d||!c)return NaN;var S=L.BufferHelper.bufferInfo(d,c.currentTime,this.config.maxBufferHole);return S.len*1e3},y.createPlaylistLoader=function(){var s=this.config.pLoader,c=this.applyPlaylistData,d=s||this.config.loader;return function(){function S(m){this.loader=void 0,this.loader=new d(m)}var C=S.prototype;return C.destroy=function(){this.loader.destroy()},C.abort=function(){this.loader.abort()},C.load=function(A,x,u){c(A),this.loader.load(A,x,u)},T(S,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),S}()},y.createFragmentLoader=function(){var s=this.config.fLoader,c=this.applyFragmentData,d=s||this.config.loader;return function(){function S(m){this.loader=void 0,this.loader=new d(m)}var C=S.prototype;return C.destroy=function(){this.loader.destroy()},C.abort=function(){this.loader.abort()},C.load=function(A,x,u){c(A),this.loader.load(A,x,u)},T(S,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),S}()},p.uuid=function(){var s=URL.createObjectURL(new Blob),c=s.toString();return URL.revokeObjectURL(s),c.substr(c.lastIndexOf("/")+1)},p.serialize=function(s){for(var c=[],d=function(B){return!Number.isNaN(B)&&B!=null&&B!==""&&B!==!1},S=function(B){return Math.round(B)},C=function(B){return S(B/100)*100},m=function(B){return encodeURIComponent(B)},A={br:S,d:S,bl:C,dl:C,mtp:C,nor:m,rtp:C,tb:S},x=Object.keys(s||{}).sort(),u=P(x),l;!(l=u()).done;){var a=l.value,i=s[a];if(!d(i))continue;if(a==="v"&&i===1)continue;if(a=="pr"&&i===1)continue;var E=A[a];E&&(i=E(i));var v=typeof i,_=void 0;a==="ot"||a==="sf"||a==="st"?_=a+"="+i:v==="boolean"?_=a:v==="number"?_=a+"="+i:_=a+"="+JSON.stringify(i),c.push(_)}return c.join(",")},p.toHeaders=function(s){for(var c=Object.keys(s),d={},S=["Object","Request","Session","Status"],C=[{},{},{},{}],m={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},A=0,x=c;A<x.length;A++){var u=x[A],l=m[u]!=null?m[u]:1;C[l][u]=s[u]}for(var a=0;a<C.length;a++){var i=p.serialize(C[a]);i&&(d["CMCD-"+S[a]]=i)}return d},p.toQuery=function(s){return"CMCD="+encodeURIComponent(p.serialize(s))},p.appendQueryToUri=function(s,c){if(!c)return s;var d=s.includes("?")?"&":"?";return""+s+d+c},p}()},"./src/controller/eme-controller.ts":function(q,G,R){"use strict";R.r(G);var K=R("./src/events.ts"),O=R("./src/errors.ts"),L=R("./src/utils/logger.ts"),U=R("./src/utils/mediakeys-helper.ts");function I(w,p){for(var y=0;y<p.length;y++){var f=p[y];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(w,f.key,f)}}function T(w,p,y){return p&&I(w.prototype,p),y&&I(w,y),w}var P=3,b=function(p,y,f){var s={audioCapabilities:[],videoCapabilities:[]};return p.forEach(function(c){s.audioCapabilities.push({contentType:'audio/mp4; codecs="'+c+'"',robustness:f.audioRobustness||""})}),y.forEach(function(c){s.videoCapabilities.push({contentType:'video/mp4; codecs="'+c+'"',robustness:f.videoRobustness||""})}),[s]},g=function(p,y,f,s){switch(p){case U.KeySystems.WIDEVINE:return b(y,f,s);default:throw new Error("Unknown key-system: "+p)}},k=function(){function w(y){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=y,this._config=y.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 p=w.prototype;return p.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},p._registerListeners=function(){this.hls.on(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(K.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(K.Events.MANIFEST_PARSED,this.onManifestParsed,this)},p._unregisterListeners=function(){this.hls.off(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(K.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(K.Events.MANIFEST_PARSED,this.onManifestParsed,this)},p.getLicenseServerUrl=function(f){switch(f){case U.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+f+'"')},p._attemptKeySystemAccess=function(f,s,c){var d=this,S=g(f,s,c,this._drmSystemOptions);L.logger.log("Requesting encrypted media key-system access");var C=this.requestMediaKeySystemAccess(f,S);this.mediaKeysPromise=C.then(function(m){return d._onMediaKeySystemAccessObtained(f,m)}),C.catch(function(m){L.logger.error('Failed to obtain key-system "'+f+'" access:',m)})},p._onMediaKeySystemAccessObtained=function(f,s){var c=this;L.logger.log('Access for key-system "'+f+'" obtained');var d={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:s,mediaKeySystemDomain:f};this._mediaKeysList.push(d);var S=Promise.resolve().then(function(){return s.createMediaKeys()}).then(function(C){return d.mediaKeys=C,L.logger.log('Media-keys created for key-system "'+f+'"'),c._onMediaKeysCreated(),C});return S.catch(function(C){L.logger.error("Failed to create media-keys:",C)}),S},p._onMediaKeysCreated=function(){var f=this;this._mediaKeysList.forEach(function(s){s.mediaKeysSession||(s.mediaKeysSession=s.mediaKeys.createSession(),f._onNewMediaKeySession(s.mediaKeysSession))})},p._onNewMediaKeySession=function(f){var s=this;L.logger.log("New key-system session "+f.sessionId),f.addEventListener("message",function(c){s._onKeySessionMessage(f,c.message)},!1)},p._onKeySessionMessage=function(f,s){L.logger.log("Got EME message event, creating license request"),this._requestLicense(s,function(c){L.logger.log("Received license data (length: "+(c&&c.byteLength)+"), updating key-session"),f.update(c)})},p.onMediaEncrypted=function(f){var s=this;if(L.logger.log('Media is encrypted using "'+f.initDataType+'" init data type'),!this.mediaKeysPromise){L.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(K.Events.ERROR,{type:O.ErrorTypes.KEY_SYSTEM_ERROR,details:O.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var c=function(S){if(!s._media)return;s._attemptSetMediaKeys(S),s._generateRequestWithPreferredKeySession(f.initDataType,f.initData)};this.mediaKeysPromise.then(c).catch(c)},p._attemptSetMediaKeys=function(f){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var s=this._mediaKeysList[0];if(!s||!s.mediaKeys){L.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(K.Events.ERROR,{type:O.ErrorTypes.KEY_SYSTEM_ERROR,details:O.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}L.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(s.mediaKeys),this._hasSetMediaKeys=!0}},p._generateRequestWithPreferredKeySession=function(f,s){var c=this,d=this._mediaKeysList[0];if(!d){L.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(K.Events.ERROR,{type:O.ErrorTypes.KEY_SYSTEM_ERROR,details:O.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(d.mediaKeysSessionInitialized){L.logger.warn("Key-Session already initialized but requested again");return}var S=d.mediaKeysSession;if(!S){L.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(K.Events.ERROR,{type:O.ErrorTypes.KEY_SYSTEM_ERROR,details:O.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!s){L.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(K.Events.ERROR,{type:O.ErrorTypes.KEY_SYSTEM_ERROR,details:O.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}L.logger.log('Generating key-session request for "'+f+'" init data type'),d.mediaKeysSessionInitialized=!0,S.generateRequest(f,s).then(function(){L.logger.debug("Key-session generation succeeded")}).catch(function(C){L.logger.error("Error generating key-session request:",C),c.hls.trigger(K.Events.ERROR,{type:O.ErrorTypes.KEY_SYSTEM_ERROR,details:O.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},p._createLicenseXhr=function(f,s,c){var d=new XMLHttpRequest;d.responseType="arraybuffer",d.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,d,f,s,c);var S=this._licenseXhrSetup;if(S)try{S.call(this.hls,d,f),S=void 0}catch(C){L.logger.error(C)}try{d.readyState||d.open("POST",f,!0),S&&S.call(this.hls,d,f)}catch(C){throw new Error("issue setting up KeySystem license XHR "+C)}return d},p._onLicenseRequestReadyStageChange=function(f,s,c,d){switch(f.readyState){case 4:if(f.status===200){this._requestLicenseFailureCount=0,L.logger.log("License request succeeded");var S=f.response,C=this._licenseResponseCallback;if(C)try{S=C.call(this.hls,f,s)}catch(A){L.logger.error(A)}d(S)}else{if(L.logger.error("License Request XHR failed ("+s+"). Status: "+f.status+" ("+f.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>P){this.hls.trigger(K.Events.ERROR,{type:O.ErrorTypes.KEY_SYSTEM_ERROR,details:O.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var m=P-this._requestLicenseFailureCount+1;L.logger.warn("Retrying license request, "+m+" attempts left"),this._requestLicense(c,d)}break}},p._generateLicenseRequestChallenge=function(f,s){switch(f.mediaKeySystemDomain){case U.KeySystems.WIDEVINE:return s}throw new Error("unsupported key-system: "+f.mediaKeySystemDomain)},p._requestLicense=function(f,s){L.logger.log("Requesting content license for key-system");var c=this._mediaKeysList[0];if(!c){L.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(K.Events.ERROR,{type:O.ErrorTypes.KEY_SYSTEM_ERROR,details:O.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var d=this.getLicenseServerUrl(c.mediaKeySystemDomain),S=this._createLicenseXhr(d,f,s);L.logger.log("Sending license request to URL: "+d);var C=this._generateLicenseRequestChallenge(c,f);S.send(C)}catch(m){L.logger.error("Failure requesting DRM license: "+m),this.hls.trigger(K.Events.ERROR,{type:O.ErrorTypes.KEY_SYSTEM_ERROR,details:O.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},p.onMediaAttached=function(f,s){if(!this._emeEnabled)return;var c=s.media;this._media=c,c.addEventListener("encrypted",this._onMediaEncrypted)},p.onMediaDetached=function(){var f=this._media,s=this._mediaKeysList;if(!f)return;f.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(s.map(function(c){if(c.mediaKeysSession)return c.mediaKeysSession.close().catch(function(){})})).then(function(){return f.setMediaKeys(null)}).catch(function(){})},p.onManifestParsed=function(f,s){if(!this._emeEnabled)return;var c=s.levels.map(function(S){return S.audioCodec}).filter(function(S){return!!S}),d=s.levels.map(function(S){return S.videoCodec}).filter(function(S){return!!S});this._attemptKeySystemAccess(U.KeySystems.WIDEVINE,c,d)},T(w,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),w}();G.default=k},"./src/controller/fps-controller.ts":function(q,G,R){"use strict";R.r(G);var K=R("./src/events.ts"),O=R("./src/utils/logger.ts"),L=function(){function U(T){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=T,this.registerListeners()}var I=U.prototype;return I.setStreamController=function(P){this.streamController=P},I.registerListeners=function(){this.hls.on(K.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},I.unregisterListeners=function(){this.hls.off(K.Events.MEDIA_ATTACHING,this.onMediaAttaching)},I.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},I.onMediaAttaching=function(P,b){var g=this.hls.config;if(g.capLevelOnFPSDrop){var k=b.media instanceof self.HTMLVideoElement?b.media:null;this.media=k,k&&typeof k.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),g.fpsDroppedMonitoringPeriod)}},I.checkFPS=function(P,b,g){var k=performance.now();if(b){if(this.lastTime){var w=k-this.lastTime,p=g-this.lastDroppedFrames,y=b-this.lastDecodedFrames,f=1e3*p/w,s=this.hls;if(s.trigger(K.Events.FPS_DROP,{currentDropped:p,currentDecoded:y,totalDroppedFrames:g}),f>0&&p>s.config.fpsDroppedMonitoringThreshold*y){var c=s.currentLevel;O.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+c),c>0&&(s.autoLevelCapping===-1||s.autoLevelCapping>=c)&&(c=c-1,s.trigger(K.Events.FPS_DROP_LEVEL_CAPPING,{level:c,droppedLevel:s.currentLevel}),s.autoLevelCapping=c,this.streamController.nextLevelSwitch())}}this.lastTime=k,this.lastDroppedFrames=g,this.lastDecodedFrames=b}},I.checkFPSInterval=function(){var P=this.media;if(P)if(this.isVideoPlaybackQualityAvailable){var b=P.getVideoPlaybackQuality();this.checkFPS(P,b.totalVideoFrames,b.droppedVideoFrames)}else this.checkFPS(P,P.webkitDecodedFrameCount,P.webkitDroppedFrameCount)},U}();G.default=L},"./src/controller/fragment-finders.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"findFragmentByPDT",function(){return L}),R.d(G,"findFragmentByPTS",function(){return U}),R.d(G,"fragmentWithinToleranceTest",function(){return I}),R.d(G,"pdtWithinToleranceTest",function(){return T}),R.d(G,"findFragWithCC",function(){return P});var K=R("./src/polyfills/number.ts"),O=R("./src/utils/binary-search.ts");function L(b,g,k){if(g===null||!Array.isArray(b)||!b.length||!Object(K.isFiniteNumber)(g))return null;var w=b[0].programDateTime;if(g<(w||0))return null;var p=b[b.length-1].endProgramDateTime;if(g>=(p||0))return null;k=k||0;for(var y=0;y<b.length;++y){var f=b[y];if(T(g,k,f))return f}return null}function U(b,g,k,w){k===void 0&&(k=0),w===void 0&&(w=0);var p=null;if(b?p=g[b.sn-g[0].sn+1]||null:k===0&&g[0].start===0&&(p=g[0]),p&&I(k,w,p)===0)return p;var y=O.default.search(g,I.bind(null,k,w));return y||p}function I(b,g,k){b===void 0&&(b=0),g===void 0&&(g=0);var w=Math.min(g,k.duration+(k.deltaPTS?k.deltaPTS:0));return k.start+k.duration-w<=b?1:k.start-w>b&&k.start?-1:0}function T(b,g,k){var w=Math.min(g,k.duration+(k.deltaPTS?k.deltaPTS:0))*1e3,p=k.endProgramDateTime||0;return p-w>b}function P(b,g){return O.default.search(b,function(k){return k.cc<g?1:k.cc>g?-1:0})}},"./src/controller/fragment-tracker.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"FragmentState",function(){return L}),R.d(G,"FragmentTracker",function(){return U});var K=R("./src/events.ts"),O=R("./src/types/loader.ts"),L;(function(P){P.NOT_LOADED="NOT_LOADED",P.BACKTRACKED="BACKTRACKED",P.APPENDING="APPENDING",P.PARTIAL="PARTIAL",P.OK="OK"})(L||(L={}));var U=function(){function P(g){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=g,this._registerListeners()}var b=P.prototype;return b._registerListeners=function(){var k=this.hls;k.on(K.Events.BUFFER_APPENDED,this.onBufferAppended,this),k.on(K.Events.FRAG_BUFFERED,this.onFragBuffered,this),k.on(K.Events.FRAG_LOADED,this.onFragLoaded,this)},b._unregisterListeners=function(){var k=this.hls;k.off(K.Events.BUFFER_APPENDED,this.onBufferAppended,this),k.off(K.Events.FRAG_BUFFERED,this.onFragBuffered,this),k.off(K.Events.FRAG_LOADED,this.onFragLoaded,this)},b.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},b.getAppendedFrag=function(k,w){if(w===O.PlaylistLevelType.MAIN){var p=this.activeFragment,y=this.activeParts;if(!p)return null;if(y)for(var f=y.length;f--;){var s=y[f],c=s?s.end:p.appendedPTS;if(s.start<=k&&c!==void 0&&k<=c)return f>9&&(this.activeParts=y.slice(f-9)),s}else if(p.start<=k&&p.appendedPTS!==void 0&&k<=p.appendedPTS)return p}return this.getBufferedFrag(k,w)},b.getBufferedFrag=function(k,w){for(var p=this.fragments,y=Object.keys(p),f=y.length;f--;){var s=p[y[f]];if((s==null?void 0:s.body.type)===w&&s.buffered){var c=s.body;if(c.start<=k&&k<=c.end)return c}}return null},b.detectEvictedFragments=function(k,w,p){var y=this;Object.keys(this.fragments).forEach(function(f){var s=y.fragments[f];if(!s)return;if(!s.buffered){s.body.type===p&&y.removeFragment(s.body);return}var c=s.range[k];if(!c)return;c.time.some(function(d){var S=!y.isTimeBuffered(d.startPTS,d.endPTS,w);return S&&y.removeFragment(s.body),S})})},b.detectPartialFragments=function(k){var w=this,p=this.timeRanges,y=k.frag,f=k.part;if(!p||y.sn==="initSegment")return;var s=T(y),c=this.fragments[s];if(!c)return;Object.keys(p).forEach(function(d){var S=y.elementaryStreams[d];if(!S)return;var C=p[d],m=f!==null||S.partial===!0;c.range[d]=w.getBufferedTimes(y,f,m,C)}),c.backtrack=c.loaded=null,Object.keys(c.range).length?c.buffered=!0:this.removeFragment(c.body)},b.fragBuffered=function(k){var w=T(k),p=this.fragments[w];p&&(p.backtrack=p.loaded=null,p.buffered=!0)},b.getBufferedTimes=function(k,w,p,y){for(var f={time:[],partial:p},s=w?w.start:k.start,c=w?w.end:k.end,d=k.minEndPTS||c,S=k.maxStartPTS||s,C=0;C<y.length;C++){var m=y.start(C)-this.bufferPadding,A=y.end(C)+this.bufferPadding;if(S>=m&&d<=A){f.time.push({startPTS:Math.max(s,y.start(C)),endPTS:Math.min(c,y.end(C))});break}else if(s<A&&c>m)f.partial=!0,f.time.push({startPTS:Math.max(s,y.start(C)),endPTS:Math.min(c,y.end(C))});else if(c<=m)break}return f},b.getPartialFragment=function(k){var w=null,p,y,f,s=0,c=this.bufferPadding,d=this.fragments;return Object.keys(d).forEach(function(S){var C=d[S];if(!C)return;I(C)&&(y=C.body.start-c,f=C.body.end+c,k>=y&&k<=f&&(p=Math.min(k-y,f-k),s<=p&&(w=C.body,s=p)))}),w},b.getState=function(k){var w=T(k),p=this.fragments[w];return p?p.buffered?I(p)?L.PARTIAL:L.OK:p.backtrack?L.BACKTRACKED:L.APPENDING:L.NOT_LOADED},b.backtrack=function(k,w){var p=T(k),y=this.fragments[p];if(!y||y.backtrack)return null;var f=y.backtrack=w||y.loaded;return y.loaded=null,f},b.getBacktrackData=function(k){var w=T(k),p=this.fragments[w];if(p){var y,f=p.backtrack;if(f!=null&&(y=f.payload)!==null&&y!==void 0&&y.byteLength)return f;this.removeFragment(k)}return null},b.isTimeBuffered=function(k,w,p){for(var y,f,s=0;s<p.length;s++){if(y=p.start(s)-this.bufferPadding,f=p.end(s)+this.bufferPadding,k>=y&&w<=f)return!0;if(w<=y)return!1}return!1},b.onFragLoaded=function(k,w){var p=w.frag,y=w.part;if(p.sn==="initSegment"||p.bitrateTest||y)return;var f=T(p);this.fragments[f]={body:p,loaded:w,backtrack:null,buffered:!1,range:Object.create(null)}},b.onBufferAppended=function(k,w){var p=this,y=w.frag,f=w.part,s=w.timeRanges;if(y.type===O.PlaylistLevelType.MAIN)if(this.activeFragment=y,f){var c=this.activeParts;c||(this.activeParts=c=[]),c.push(f)}else this.activeParts=null;this.timeRanges=s,Object.keys(s).forEach(function(d){var S=s[d];if(p.detectEvictedFragments(d,S),!f)for(var C=0;C<S.length;C++)y.appendedPTS=Math.max(S.end(C),y.appendedPTS||0)})},b.onFragBuffered=function(k,w){this.detectPartialFragments(w)},b.hasFragment=function(k){var w=T(k);return!!this.fragments[w]},b.removeFragmentsInRange=function(k,w,p){var y=this;Object.keys(this.fragments).forEach(function(f){var s=y.fragments[f];if(!s)return;if(s.buffered){var c=s.body;c.type===p&&c.start<w&&c.end>k&&y.removeFragment(c)}})},b.removeFragment=function(k){var w=T(k);k.stats.loaded=0,k.clearElementaryStreamInfo(),delete this.fragments[w]},b.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},P}();function I(P){var b,g;return P.buffered&&(((b=P.range.video)===null||b===void 0?void 0:b.partial)||((g=P.range.audio)===null||g===void 0?void 0:g.partial))}function T(P){return P.type+"_"+P.level+"_"+P.urlId+"_"+P.sn}},"./src/controller/gap-controller.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"STALL_MINIMUM_DURATION_MS",function(){return I}),R.d(G,"MAX_START_GAP_JUMP",function(){return T}),R.d(G,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return P}),R.d(G,"SKIP_BUFFER_RANGE_START",function(){return b}),R.d(G,"default",function(){return g});var K=R("./src/utils/buffer-helper.ts"),O=R("./src/errors.ts"),L=R("./src/events.ts"),U=R("./src/utils/logger.ts"),I=250,T=2,P=.1,b=.05,g=function(){function k(p,y,f,s){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=p,this.media=y,this.fragmentTracker=f,this.hls=s}var w=k.prototype;return w.destroy=function(){this.hls=this.fragmentTracker=this.media=null},w.poll=function(y){var f=this.config,s=this.media,c=this.stalled,d=s.currentTime,S=s.seeking,C=this.seeking&&!S,m=!this.seeking&&S;if(this.seeking=S,d!==y){if(this.moved=!0,c!==null){if(this.stallReported){var A=self.performance.now()-c;U.logger.warn("playback not stuck anymore @"+d+", after "+Math.round(A)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((m||C)&&(this.stalled=null),s.paused||s.ended||s.playbackRate===0||!K.BufferHelper.getBuffered(s).length)return;var x=K.BufferHelper.bufferInfo(s,d,0),u=x.len>0,l=x.nextStart||0;if(!u&&!l)return;if(S){var a=x.len>T,i=!l||l-d>T&&!this.fragmentTracker.getPartialFragment(d);if(a||i)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var E,v=Math.max(l,x.start||0)-d,_=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,D=_==null||((E=_.details)===null||E===void 0)?void 0:E.live,B=D?_.details.targetduration*2:T;if(v>0&&v<=B){this._trySkipBufferHole(null);return}}var j=self.performance.now();if(c===null){this.stalled=j;return}var W=j-c;!S&&W>=I&&this._reportStall(x.len);var h=K.BufferHelper.bufferInfo(s,d,f.maxBufferHole);this._tryFixBufferStall(h,W)},w._tryFixBufferStall=function(y,f){var s=this.config,c=this.fragmentTracker,d=this.media,S=d.currentTime,C=c.getPartialFragment(S);if(C){var m=this._trySkipBufferHole(C);if(m)return}y.len>s.maxBufferHole&&f>s.highBufferWatchdogPeriod*1e3&&(U.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},w._reportStall=function(y){var f=this.hls,s=this.media,c=this.stallReported;c||(this.stallReported=!0,U.logger.warn("Playback stalling at @"+s.currentTime+" due to low buffer (buffer="+y+")"),f.trigger(L.Events.ERROR,{type:O.ErrorTypes.MEDIA_ERROR,details:O.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:y}))},w._trySkipBufferHole=function(y){for(var f=this.config,s=this.hls,c=this.media,d=c.currentTime,S=0,C=K.BufferHelper.getBuffered(c),m=0;m<C.length;m++){var A=C.start(m);if(d+f.maxBufferHole>=S&&d<A){var x=Math.max(A+b,c.currentTime+P);return U.logger.warn("skipping hole, adjusting currentTime from "+d+" to "+x),this.moved=!0,this.stalled=null,c.currentTime=x,y&&s.trigger(L.Events.ERROR,{type:O.ErrorTypes.MEDIA_ERROR,details:O.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+d+" to "+x,frag:y}),x}S=C.end(m)}return 0},w._tryNudgeBuffer=function(){var y=this.config,f=this.hls,s=this.media,c=s.currentTime,d=(this.nudgeRetry||0)+1;if(this.nudgeRetry=d,d<y.nudgeMaxRetry){var S=c+d*y.nudgeOffset;U.logger.warn("Nudging 'currentTime' from "+c+" to "+S),s.currentTime=S,f.trigger(L.Events.ERROR,{type:O.ErrorTypes.MEDIA_ERROR,details:O.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else U.logger.error("Playhead still not moving while enough data buffered @"+c+" after "+y.nudgeMaxRetry+" nudges"),f.trigger(L.Events.ERROR,{type:O.ErrorTypes.MEDIA_ERROR,details:O.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},k}()},"./src/controller/id3-track-controller.ts":function(q,G,R){"use strict";R.r(G);var K=R("./src/events.ts"),O=R("./src/utils/texttrack-utils.ts"),L=R("./src/demux/id3.ts"),U=.25,I=function(){function T(b){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=b,this._registerListeners()}var P=T.prototype;return P.destroy=function(){this._unregisterListeners()},P._registerListeners=function(){var g=this.hls;g.on(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),g.on(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),g.on(K.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),g.on(K.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},P._unregisterListeners=function(){var g=this.hls;g.off(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),g.off(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),g.off(K.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),g.off(K.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},P.onMediaAttached=function(g,k){this.media=k.media},P.onMediaDetaching=function(){if(!this.id3Track)return;Object(O.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},P.getID3Track=function(g){if(!this.media)return;for(var k=0;k<g.length;k++){var w=g[k];if(w.kind==="metadata"&&w.label==="id3")return Object(O.sendAddTrackEvent)(w,this.media),w}return this.media.addTextTrack("metadata","id3")},P.onFragParsingMetadata=function(g,k){if(!this.media)return;var w=k.frag,p=k.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var y=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,f=0;f<p.length;f++){var s=L.getID3Frames(p[f].data);if(s){var c=p[f].pts,d=f<p.length-1?p[f+1].pts:w.end,S=d-c;S<=0&&(d=c+U);for(var C=0;C<s.length;C++){var m=s[C];if(!L.isTimeStampFrame(m)){var A=new y(c,d,"");A.value=m,this.id3Track.addCue(A)}}}}},P.onBufferFlushing=function(g,k){var w=k.startOffset,p=k.endOffset,y=k.type;if(!y||y==="audio"){var f=this.id3Track;f&&Object(O.removeCuesInRange)(f,w,p)}},T}();G.default=I},"./src/controller/latency-controller.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"default",function(){return T});var K=R("./src/errors.ts"),O=R("./src/events.ts"),L=R("./src/utils/logger.ts");function U(P,b){for(var g=0;g<b.length;g++){var k=b[g];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(P,k.key,k)}}function I(P,b,g){return b&&U(P.prototype,b),g&&U(P,g),P}var T=function(){function P(g){var k=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 k.timeupdate()},this.hls=g,this.config=g.config,this.registerListeners()}var b=P.prototype;return b.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},b.registerListeners=function(){this.hls.on(O.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(O.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(O.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(O.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(O.Events.ERROR,this.onError,this)},b.unregisterListeners=function(){this.hls.off(O.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(O.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(O.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(O.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(O.Events.ERROR,this.onError)},b.onMediaAttached=function(k,w){this.media=w.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},b.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},b.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},b.onLevelUpdated=function(k,w){var p=w.details;this.levelDetails=p,p.advanced&&this.timeupdate(),!p.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},b.onError=function(k,w){if(w.details!==K.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,L.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},b.timeupdate=function(){var k=this.media,w=this.levelDetails;if(!k||!w)return;this.currentTime=k.currentTime;var p=this.computeLatency();if(p===null)return;this._latency=p;var y=this.config,f=y.lowLatencyMode,s=y.maxLiveSyncPlaybackRate;if(!f||s===1)return;var c=this.targetLatency;if(c===null)return;var d=p-c,S=Math.min(this.maxLatency,c+w.targetduration),C=d<S;if(w.live&&C&&d>.05&&this.forwardBufferLength>1){var m=Math.min(2,Math.max(1,s)),A=Math.round(2/(1+Math.exp(-.75*d-this.edgeStalled))*20)/20;k.playbackRate=Math.min(m,Math.max(1,A))}else k.playbackRate!==1&&k.playbackRate!==0&&(k.playbackRate=1)},b.estimateLiveEdge=function(){var k=this.levelDetails;return k===null?null:k.edge+k.age},b.computeLatency=function(){var k=this.estimateLiveEdge();return k===null?null:k-this.currentTime},I(P,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var k=this.config,w=this.levelDetails;return k.liveMaxLatencyDuration!==void 0?k.liveMaxLatencyDuration:w?k.liveMaxLatencyDurationCount*w.targetduration:0}},{key:"targetLatency",get:function(){var k=this.levelDetails;if(k===null)return null;var w=k.holdBack,p=k.partHoldBack,y=k.targetduration,f=this.config,s=f.liveSyncDuration,c=f.liveSyncDurationCount,d=f.lowLatencyMode,S=this.hls.userConfig,C=d&&p||w;(S.liveSyncDuration||S.liveSyncDurationCount||C===0)&&(C=s!==void 0?s:c*y);var m=y,A=1;return C+Math.min(this.stallCount*A,m)}},{key:"liveSyncPosition",get:function(){var k=this.estimateLiveEdge(),w=this.targetLatency,p=this.levelDetails;if(k===null||w===null||p===null)return null;var y=p.edge,f=k-w-this.edgeStalled,s=y-p.totalduration,c=y-(this.config.lowLatencyMode&&p.partTarget||p.targetduration);return Math.min(Math.max(s,f),c)}},{key:"drift",get:function(){var k=this.levelDetails;return k===null?1:k.drift}},{key:"edgeStalled",get:function(){var k=this.levelDetails;if(k===null)return 0;var w=(this.config.lowLatencyMode&&k.partTarget||k.targetduration)*3;return Math.max(k.age-w,0)}},{key:"forwardBufferLength",get:function(){var k=this.media,w=this.levelDetails;if(!k||!w)return 0;var p=k.buffered.length;return p?k.buffered.end(p-1):w.edge-this.currentTime}}]),P}()},"./src/controller/level-controller.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"default",function(){return f});var K=R("./src/types/level.ts"),O=R("./src/events.ts"),L=R("./src/errors.ts"),U=R("./src/utils/codecs.ts"),I=R("./src/controller/level-helper.ts"),T=R("./src/controller/base-playlist-controller.ts"),P=R("./src/types/loader.ts");function b(){return b=Object.assign||function(s){for(var c=1;c<arguments.length;c++){var d=arguments[c];for(var S in d)Object.prototype.hasOwnProperty.call(d,S)&&(s[S]=d[S])}return s},b.apply(this,arguments)}function g(s,c){for(var d=0;d<c.length;d++){var S=c[d];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(s,S.key,S)}}function k(s,c,d){return c&&g(s.prototype,c),d&&g(s,d),s}function w(s,c){s.prototype=Object.create(c.prototype),s.prototype.constructor=s,p(s,c)}function p(s,c){return p=Object.setPrototypeOf||function(S,C){return S.__proto__=C,S},p(s,c)}var y=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),f=function(s){w(c,s);function c(S){var C;return C=s.call(this,S,"[level-controller]")||this,C._levels=[],C._firstLevel=-1,C._startLevel=void 0,C.currentLevelIndex=-1,C.manualLevelIndex=-1,C.onParsedComplete=void 0,C._registerListeners(),C}var d=c.prototype;return d._registerListeners=function(){var C=this.hls;C.on(O.Events.MANIFEST_LOADED,this.onManifestLoaded,this),C.on(O.Events.LEVEL_LOADED,this.onLevelLoaded,this),C.on(O.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),C.on(O.Events.FRAG_LOADED,this.onFragLoaded,this),C.on(O.Events.ERROR,this.onError,this)},d._unregisterListeners=function(){var C=this.hls;C.off(O.Events.MANIFEST_LOADED,this.onManifestLoaded,this),C.off(O.Events.LEVEL_LOADED,this.onLevelLoaded,this),C.off(O.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),C.off(O.Events.FRAG_LOADED,this.onFragLoaded,this),C.off(O.Events.ERROR,this.onError,this)},d.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,s.prototype.destroy.call(this)},d.startLoad=function(){var C=this._levels;C.forEach(function(m){m.loadError=0}),s.prototype.startLoad.call(this)},d.onManifestLoaded=function(C,m){var A=[],x=[],u=[],l,a={},i,E=!1,v=!1,_=!1;if(m.levels.forEach(function(W){var h=W.attrs;E=E||!!(W.width&&W.height),v=v||!!W.videoCodec,_=_||!!W.audioCodec,y&&W.audioCodec&&W.audioCodec.indexOf("mp4a.40.34")!==-1&&(W.audioCodec=void 0);var N=W.bitrate+"-"+W.attrs.RESOLUTION+"-"+W.attrs.CODECS;i=a[N],i?i.url.push(W.url):(i=new K.Level(W),a[N]=i,A.push(i)),h&&(h.AUDIO&&Object(I.addGroupId)(i,"audio",h.AUDIO),h.SUBTITLES&&Object(I.addGroupId)(i,"text",h.SUBTITLES))}),(E||v)&&_&&(A=A.filter(function(W){var h=W.videoCodec,N=W.width,H=W.height;return!!h||!!(N&&H)})),A=A.filter(function(W){var h=W.audioCodec,N=W.videoCodec;return(!h||Object(U.isCodecSupportedInMp4)(h,"audio"))&&(!N||Object(U.isCodecSupportedInMp4)(N,"video"))}),m.audioTracks&&(x=m.audioTracks.filter(function(W){return!W.audioCodec||Object(U.isCodecSupportedInMp4)(W.audioCodec,"audio")}),Object(I.assignTrackIdsByGroup)(x)),m.subtitles&&(u=m.subtitles,Object(I.assignTrackIdsByGroup)(u)),A.length>0){l=A[0].bitrate,A.sort(function(W,h){return W.bitrate-h.bitrate}),this._levels=A;for(var D=0;D<A.length;D++)if(A[D].bitrate===l){this._firstLevel=D,this.log("manifest loaded, "+A.length+" level(s) found, first bitrate: "+l);break}var B=_&&!v,j={levels:A,audioTracks:x,subtitleTracks:u,firstLevel:this._firstLevel,stats:m.stats,audio:_,video:v,altAudio:!B&&x.some(function(W){return!!W.url})};this.hls.trigger(O.Events.MANIFEST_PARSED,j),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(O.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:m.url,reason:"no level with compatible codecs found in manifest"})},d.onError=function(C,m){if(s.prototype.onError.call(this,C,m),m.fatal)return;var A=m.context,x=this._levels[this.currentLevelIndex];if(A&&(A.type===P.PlaylistContextType.AUDIO_TRACK&&x.audioGroupIds&&A.groupId===x.audioGroupIds[x.urlId]||A.type===P.PlaylistContextType.SUBTITLE_TRACK&&x.textGroupIds&&A.groupId===x.textGroupIds[x.urlId])){this.redundantFailover(this.currentLevelIndex);return}var u=!1,l=!0,a;switch(m.details){case L.ErrorDetails.FRAG_LOAD_ERROR:case L.ErrorDetails.FRAG_LOAD_TIMEOUT:case L.ErrorDetails.KEY_LOAD_ERROR:case L.ErrorDetails.KEY_LOAD_TIMEOUT:if(m.frag){var i=this._levels[m.frag.level];i?(i.fragmentError++,i.fragmentError>this.hls.config.fragLoadingMaxRetry&&(a=m.frag.level)):a=m.frag.level}break;case L.ErrorDetails.LEVEL_LOAD_ERROR:case L.ErrorDetails.LEVEL_LOAD_TIMEOUT:A&&(A.deliveryDirectives&&(l=!1),a=A.level),u=!0;break;case L.ErrorDetails.REMUX_ALLOC_ERROR:a=m.level,u=!0;break}a!==void 0&&this.recoverLevel(m,a,u,l)},d.recoverLevel=function(C,m,A,x){var u=C.details,l=this._levels[m];if(l.loadError++,A){var a=this.retryLoadingOrFail(C);if(a)C.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(x){var i=l.url.length;if(i>1&&l.loadError<i)C.levelRetry=!0,this.redundantFailover(m);else if(this.manualLevelIndex===-1){var E=m===0?this._levels.length-1:m-1;this.currentLevelIndex!==E&&this._levels[E].loadError===0&&(this.warn(u+": switch to "+E),C.levelRetry=!0,this.hls.nextAutoLevel=E)}}},d.redundantFailover=function(C){var m=this._levels[C],A=m.url.length;if(A>1){var x=(m.urlId+1)%A;this.warn("Switching to redundant URL-id "+x),this._levels.forEach(function(u){u.urlId=x}),this.level=C}},d.onFragLoaded=function(C,m){var A=m.frag;if(A!==void 0&&A.type===P.PlaylistLevelType.MAIN){var x=this._levels[A.level];x!==void 0&&(x.fragmentError=0,x.loadError=0)}},d.onLevelLoaded=function(C,m){var A,x=m.level,u=m.details,l=this._levels[x];if(!l){var a;this.warn("Invalid level index "+x),(a=m.deliveryDirectives)!==null&&a!==void 0&&a.skip&&(u.deltaUpdateFailed=!0);return}x===this.currentLevelIndex?(l.fragmentError===0&&(l.loadError=0,this.retryCount=0),this.playlistLoaded(x,m,l.details)):(A=m.deliveryDirectives)!==null&&A!==void 0&&A.skip&&(u.deltaUpdateFailed=!0)},d.onAudioTrackSwitched=function(C,m){var A=this.hls.levels[this.currentLevelIndex];if(!A)return;if(A.audioGroupIds){for(var x=-1,u=this.hls.audioTracks[m.id].groupId,l=0;l<A.audioGroupIds.length;l++)if(A.audioGroupIds[l]===u){x=l;break}x!==A.urlId&&(A.urlId=x,this.startLoad())}},d.loadPlaylist=function(C){var m=this.currentLevelIndex,A=this._levels[m];if(this.canLoad&&A&&A.url.length>0){var x=A.urlId,u=A.url[x];if(C)try{u=C.addDirectives(u)}catch(l){this.warn("Could not construct new URL with HLS Delivery Directives: "+l)}this.log("Attempt loading level index "+m+(C?" at sn "+C.msn+" part "+C.part:"")+" with URL-id "+x+" "+u),this.clearTimer(),this.hls.trigger(O.Events.LEVEL_LOADING,{url:u,level:m,id:x,deliveryDirectives:C||null})}},d.removeLevel=function(C,m){var A=function(l,a){return a!==m},x=this._levels.filter(function(u,l){return l!==C?!0:u.url.length>1&&m!==void 0?(u.url=u.url.filter(A),u.audioGroupIds&&(u.audioGroupIds=u.audioGroupIds.filter(A)),u.textGroupIds&&(u.textGroupIds=u.textGroupIds.filter(A)),u.urlId=0,!0):!1}).map(function(u,l){var a=u.details;return a!=null&&a.fragments&&a.fragments.forEach(function(i){i.level=l}),u});this._levels=x,this.hls.trigger(O.Events.LEVELS_UPDATED,{levels:x})},k(c,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(C){var m,A=this._levels;if(A.length===0)return;if(this.currentLevelIndex===C&&(m=A[C])!==null&&m!==void 0&&m.details)return;if(C<0||C>=A.length){var x=C<0;if(this.hls.trigger(O.Events.ERROR,{type:L.ErrorTypes.OTHER_ERROR,details:L.ErrorDetails.LEVEL_SWITCH_ERROR,level:C,fatal:x,reason:"invalid level idx"}),x)return;C=Math.min(C,A.length-1)}this.clearTimer();var u=this.currentLevelIndex,l=A[u],a=A[C];this.log("switching to level "+C+" from "+u),this.currentLevelIndex=C;var i=b({},a,{level:C,maxBitrate:a.maxBitrate,uri:a.uri,urlId:a.urlId});delete i._urlId,this.hls.trigger(O.Events.LEVEL_SWITCHING,i);var E=a.details;if(!E||E.live){var v=this.switchParams(a.uri,l==null?void 0:l.details);this.loadPlaylist(v)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(C){this.manualLevelIndex=C,this._startLevel===void 0&&(this._startLevel=C),C!==-1&&(this.level=C)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(C){this._firstLevel=C}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var C=this.hls.config.startLevel;return C!==void 0?C:this._firstLevel}else return this._startLevel},set:function(C){this._startLevel=C}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(C){this.level=C,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=C)}}]),c}(T.default)},"./src/controller/level-helper.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"addGroupId",function(){return L}),R.d(G,"assignTrackIdsByGroup",function(){return U}),R.d(G,"updatePTS",function(){return I}),R.d(G,"updateFragPTSDTS",function(){return P}),R.d(G,"mergeDetails",function(){return b}),R.d(G,"mapPartIntersection",function(){return g}),R.d(G,"mapFragmentIntersection",function(){return k}),R.d(G,"adjustSliding",function(){return w}),R.d(G,"addSliding",function(){return p}),R.d(G,"computeReloadInterval",function(){return y}),R.d(G,"getFragmentWithSN",function(){return f}),R.d(G,"getPartWith",function(){return s});var K=R("./src/polyfills/number.ts"),O=R("./src/utils/logger.ts");function L(c,d,S){switch(d){case"audio":c.audioGroupIds||(c.audioGroupIds=[]),c.audioGroupIds.push(S);break;case"text":c.textGroupIds||(c.textGroupIds=[]),c.textGroupIds.push(S);break}}function U(c){var d={};c.forEach(function(S){var C=S.groupId||"";S.id=d[C]=d[C]||0,d[C]++})}function I(c,d,S){var C=c[d],m=c[S];T(C,m)}function T(c,d){var S=d.startPTS;if(Object(K.isFiniteNumber)(S)){var C=0,m;d.sn>c.sn?(C=S-c.start,m=c):(C=c.start-S,m=d),m.duration!==C&&(m.duration=C)}else if(d.sn>c.sn){var A=c.cc===d.cc;A&&c.minEndPTS?d.start=c.start+(c.minEndPTS-c.start):d.start=c.start+c.duration}else d.start=Math.max(c.start-d.duration,0)}function P(c,d,S,C,m,A){var x=C-S;x<=0&&(O.logger.warn("Fragment should have a positive duration",d),C=S+d.duration,A=m+d.duration);var u=S,l=C,a=d.startPTS,i=d.endPTS;if(Object(K.isFiniteNumber)(a)){var E=Math.abs(a-S);Object(K.isFiniteNumber)(d.deltaPTS)?d.deltaPTS=Math.max(E,d.deltaPTS):d.deltaPTS=E,u=Math.max(S,a),S=Math.min(S,a),m=Math.min(m,d.startDTS),l=Math.min(C,i),C=Math.max(C,i),A=Math.max(A,d.endDTS)}d.duration=C-S;var v=S-d.start;d.appendedPTS=C,d.start=d.startPTS=S,d.maxStartPTS=u,d.startDTS=m,d.endPTS=C,d.minEndPTS=l,d.endDTS=A;var _=d.sn;if(!c||_<c.startSN||_>c.endSN)return 0;var D,B=_-c.startSN,j=c.fragments;for(j[B]=d,D=B;D>0;D--)T(j[D],j[D-1]);for(D=B;D<j.length-1;D++)T(j[D],j[D+1]);return c.fragmentHint&&T(j[j.length-1],c.fragmentHint),c.PTSKnown=c.alignedSliding=!0,v}function b(c,d){for(var S=null,C=c.fragments,m=C.length-1;m>=0;m--){var A=C[m].initSegment;if(A){S=A;break}}c.fragmentHint&&delete c.fragmentHint.endPTS;var x=0,u;if(k(c,d,function(D,B){D.relurl&&(x=D.cc-B.cc),Object(K.isFiniteNumber)(D.startPTS)&&Object(K.isFiniteNumber)(D.endPTS)&&(B.start=B.startPTS=D.startPTS,B.startDTS=D.startDTS,B.appendedPTS=D.appendedPTS,B.maxStartPTS=D.maxStartPTS,B.endPTS=D.endPTS,B.endDTS=D.endDTS,B.minEndPTS=D.minEndPTS,B.duration=D.endPTS-D.startPTS,B.duration&&(u=B),d.PTSKnown=d.alignedSliding=!0),B.elementaryStreams=D.elementaryStreams,B.loader=D.loader,B.stats=D.stats,B.urlId=D.urlId,D.initSegment&&(B.initSegment=D.initSegment,S=D.initSegment)}),S){var l=d.fragmentHint?d.fragments.concat(d.fragmentHint):d.fragments;l.forEach(function(D){var B;(!D.initSegment||D.initSegment.relurl===((B=S)===null||B===void 0?void 0:B.relurl))&&(D.initSegment=S)})}if(d.skippedSegments&&(d.deltaUpdateFailed=d.fragments.some(function(D){return!D}),d.deltaUpdateFailed)){O.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var a=d.skippedSegments;a--;)d.fragments.shift();d.startSN=d.fragments[0].sn,d.startCC=d.fragments[0].cc}var i=d.fragments;if(x){O.logger.warn("discontinuity sliding from playlist, take drift into account");for(var E=0;E<i.length;E++)i[E].cc+=x}d.skippedSegments&&(d.startCC=d.fragments[0].cc),g(c.partList,d.partList,function(D,B){B.elementaryStreams=D.elementaryStreams,B.stats=D.stats}),u?P(d,u,u.startPTS,u.endPTS,u.startDTS,u.endDTS):w(c,d),i.length&&(d.totalduration=d.edge-i[0].start),d.driftStartTime=c.driftStartTime,d.driftStart=c.driftStart;var v=d.advancedDateTime;if(d.advanced&&v){var _=d.edge;d.driftStart||(d.driftStartTime=v,d.driftStart=_),d.driftEndTime=v,d.driftEnd=_}else d.driftEndTime=c.driftEndTime,d.driftEnd=c.driftEnd,d.advancedDateTime=c.advancedDateTime}function g(c,d,S){if(c&&d)for(var C=0,m=0,A=c.length;m<=A;m++){var x=c[m],u=d[m+C];x&&u&&x.index===u.index&&x.fragment.sn===u.fragment.sn?S(x,u):C--}}function k(c,d,S){for(var C=d.skippedSegments,m=Math.max(c.startSN,d.startSN)-d.startSN,A=(c.fragmentHint?1:0)+(C?d.endSN:Math.min(c.endSN,d.endSN))-d.startSN,x=d.startSN-c.startSN,u=d.fragmentHint?d.fragments.concat(d.fragmentHint):d.fragments,l=c.fragmentHint?c.fragments.concat(c.fragmentHint):c.fragments,a=m;a<=A;a++){var i=l[x+a],E=u[a];C&&!E&&a<C&&(E=d.fragments[a]=i),i&&E&&S(i,E)}}function w(c,d){var S=d.startSN+d.skippedSegments-c.startSN,C=c.fragments;if(S<0||S>=C.length)return;p(d,C[S].start)}function p(c,d){if(d){for(var S=c.fragments,C=c.skippedSegments;C<S.length;C++)S[C].start+=d;c.fragmentHint&&(c.fragmentHint.start+=d)}}function y(c,d){var S=1e3*c.levelTargetDuration,C=S/2,m=c.age,A=m>0&&m<S*3,x=d.loading.end-d.loading.start,u,l=c.availabilityDelay;if(c.updated===!1)if(A){var a=333*c.misses;u=Math.max(Math.min(C,x*2),a),c.availabilityDelay=(c.availabilityDelay||0)+u}else u=C;else A?(l=Math.min(l||S/2,m),c.availabilityDelay=l,u=l+S-m):u=S-x;return Math.round(u)}function f(c,d,S){if(!c||!c.details)return null;var C=c.details,m=C.fragments[d-C.startSN];return m||(m=C.fragmentHint,m&&m.sn===d?m:d<C.startSN&&S&&S.sn===d?S:null)}function s(c,d,S){if(!c||!c.details)return null;var C=c.details.partList;if(C)for(var m=C.length;m--;){var A=C[m];if(A.index===S&&A.fragment.sn===d)return A}return null}},"./src/controller/stream-controller.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"default",function(){return C});var K=R("./src/polyfills/number.ts"),O=R("./src/controller/base-stream-controller.ts"),L=R("./src/is-supported.ts"),U=R("./src/events.ts"),I=R("./src/utils/buffer-helper.ts"),T=R("./src/controller/fragment-tracker.ts"),P=R("./src/types/loader.ts"),b=R("./src/loader/fragment.ts"),g=R("./src/demux/transmuxer-interface.ts"),k=R("./src/types/transmuxer.ts"),w=R("./src/controller/gap-controller.ts"),p=R("./src/errors.ts"),y=R("./src/utils/logger.ts");function f(m,A){for(var x=0;x<A.length;x++){var u=A[x];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(m,u.key,u)}}function s(m,A,x){return A&&f(m.prototype,A),x&&f(m,x),m}function c(m,A){m.prototype=Object.create(A.prototype),m.prototype.constructor=m,d(m,A)}function d(m,A){return d=Object.setPrototypeOf||function(u,l){return u.__proto__=l,u},d(m,A)}var S=100,C=function(m){c(A,m);function A(u,l){var a;return a=m.call(this,u,l,"[stream-controller]")||this,a.audioCodecSwap=!1,a.gapController=null,a.level=-1,a._forceStartLoad=!1,a.altAudio=!1,a.audioOnly=!1,a.fragPlaying=null,a.onvplaying=null,a.onvseeked=null,a.fragLastKbps=0,a.stalled=!1,a.couldBacktrack=!1,a.audioCodecSwitch=!1,a.videoBuffer=null,a._registerListeners(),a}var x=A.prototype;return x._registerListeners=function(){var l=this.hls;l.on(U.Events.MEDIA_ATTACHED,this.onMediaAttached,this),l.on(U.Events.MEDIA_DETACHING,this.onMediaDetaching,this),l.on(U.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.on(U.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.on(U.Events.LEVEL_LOADING,this.onLevelLoading,this),l.on(U.Events.LEVEL_LOADED,this.onLevelLoaded,this),l.on(U.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),l.on(U.Events.ERROR,this.onError,this),l.on(U.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),l.on(U.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),l.on(U.Events.BUFFER_CREATED,this.onBufferCreated,this),l.on(U.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),l.on(U.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),l.on(U.Events.FRAG_BUFFERED,this.onFragBuffered,this)},x._unregisterListeners=function(){var l=this.hls;l.off(U.Events.MEDIA_ATTACHED,this.onMediaAttached,this),l.off(U.Events.MEDIA_DETACHING,this.onMediaDetaching,this),l.off(U.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.off(U.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.off(U.Events.LEVEL_LOADED,this.onLevelLoaded,this),l.off(U.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),l.off(U.Events.ERROR,this.onError,this),l.off(U.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),l.off(U.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),l.off(U.Events.BUFFER_CREATED,this.onBufferCreated,this),l.off(U.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),l.off(U.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),l.off(U.Events.FRAG_BUFFERED,this.onFragBuffered,this)},x.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},x.startLoad=function(l){if(this.levels){var a=this.lastCurrentTime,i=this.hls;if(this.stopLoad(),this.setInterval(S),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var E=i.startLevel;E===-1&&(i.config.testBandwidth?(E=0,this.bitrateTest=!0):E=i.nextAutoLevel),this.level=i.nextLoadLevel=E,this.loadedmetadata=!1}a>0&&l===-1&&(this.log("Override startPosition with lastCurrentTime @"+a.toFixed(3)),l=a),this.state=O.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=l,this.tick()}else this._forceStartLoad=!0,this.state=O.State.STOPPED},x.stopLoad=function(){this._forceStartLoad=!1,m.prototype.stopLoad.call(this)},x.doTick=function(){switch(this.state){case O.State.IDLE:this.doTickIdle();break;case O.State.WAITING_LEVEL:{var l,a=this.levels,i=this.level,E=a==null||((l=a[i])===null||l===void 0)?void 0:l.details;if(E&&(!E.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(E))break;this.state=O.State.IDLE;break}break}case O.State.FRAG_LOADING_WAITING_RETRY:{var v,_=self.performance.now(),D=this.retryDate;(!D||_>=D||(v=this.media)!==null&&v!==void 0&&v.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=O.State.IDLE)}break;default:break}this.onTickEnd()},x.onTickEnd=function(){m.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},x.doTickIdle=function(){var l,a,i=this.hls,E=this.levelLastLoaded,v=this.levels,_=this.media,D=i.config,B=i.nextLoadLevel;if(E===null||!_&&(this.startFragRequested||!D.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!v||!v[B])return;var j=v[B];this.level=i.nextLoadLevel=B;var W=j.details;if(!W||this.state===O.State.WAITING_LEVEL||W.live&&this.levelLastLoaded!==B){this.state=O.State.WAITING_LEVEL;return}var h=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:_,P.PlaylistLevelType.MAIN);if(h===null)return;var N=h.len,H=this.getMaxBufferLength(j.maxBitrate);if(N>=H)return;if(this._streamEnded(h,W)){var X={};this.altAudio&&(X.type="video"),this.hls.trigger(U.Events.BUFFER_EOS,X),this.state=O.State.ENDED;return}var Y=h.end,re=this.getNextFragment(Y,W);if(this.couldBacktrack&&!this.fragPrevious&&re&&re.sn!=="initSegment"){var he=re.sn-W.startSN;he>1&&(re=W.fragments[he-1],this.fragmentTracker.removeFragment(re))}if(re&&this.fragmentTracker.getState(re)===T.FragmentState.OK&&this.nextLoadPosition>Y){var de=this.audioOnly&&!this.altAudio?b.ElementaryStreamTypes.AUDIO:b.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(_,de,P.PlaylistLevelType.MAIN),re=this.getNextFragment(this.nextLoadPosition,W)}if(!re)return;re.initSegment&&!re.initSegment.data&&!this.bitrateTest&&(re=re.initSegment),((l=re.decryptdata)===null||l===void 0?void 0:l.keyFormat)==="identity"&&!((a=re.decryptdata)!==null&&a!==void 0&&a.key)?this.loadKey(re,W):this.loadFragment(re,W,Y)},x.loadFragment=function(l,a,i){var E,v=this.fragmentTracker.getState(l);if(this.fragCurrent=l,v===T.FragmentState.BACKTRACKED){var _=this.fragmentTracker.getBacktrackData(l);if(_){this._handleFragmentLoadProgress(_),this._handleFragmentLoadComplete(_);return}else v=T.FragmentState.NOT_LOADED}v===T.FragmentState.NOT_LOADED||v===T.FragmentState.PARTIAL?l.sn==="initSegment"?this._loadInitSegment(l):this.bitrateTest?(l.bitrateTest=!0,this.log("Fragment "+l.sn+" of level "+l.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(l)):(this.startFragRequested=!0,m.prototype.loadFragment.call(this,l,a,i)):v===T.FragmentState.APPENDING?this.reduceMaxBufferLength(l.duration)&&this.fragmentTracker.removeFragment(l):((E=this.media)===null||E===void 0?void 0:E.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},x.getAppendedFrag=function(l){var a=this.fragmentTracker.getAppendedFrag(l,P.PlaylistLevelType.MAIN);return a&&"fragment"in a?a.fragment:a},x.getBufferedFrag=function(l){return this.fragmentTracker.getBufferedFrag(l,P.PlaylistLevelType.MAIN)},x.followingBufferedFrag=function(l){return l?this.getBufferedFrag(l.end+.5):null},x.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},x.nextLevelSwitch=function(){var l=this.levels,a=this.media;if(a!=null&&a.readyState){var i,E=this.getAppendedFrag(a.currentTime);if(E&&E.start>1&&this.flushMainBuffer(0,E.start-1),!a.paused&&l){var v=this.hls.nextLoadLevel,_=l[v],D=this.fragLastKbps;D&&this.fragCurrent?i=this.fragCurrent.duration*_.maxBitrate/(1e3*D)+1:i=0}else i=0;var B=this.getBufferedFrag(a.currentTime+i);if(B){var j=this.followingBufferedFrag(B);if(j){this.abortCurrentFrag();var W=j.maxStartPTS?j.maxStartPTS:j.start,h=j.duration,N=Math.max(B.end,W+Math.min(Math.max(h-this.config.maxFragLookUpTolerance,h*.5),h*.75));this.flushMainBuffer(N,Number.POSITIVE_INFINITY)}}}},x.abortCurrentFrag=function(){var l=this.fragCurrent;this.fragCurrent=null,l!=null&&l.loader&&l.loader.abort(),this.state===O.State.KEY_LOADING&&(this.state=O.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},x.flushMainBuffer=function(l,a){m.prototype.flushMainBuffer.call(this,l,a,this.altAudio?"video":null)},x.onMediaAttached=function(l,a){m.prototype.onMediaAttached.call(this,l,a);var i=a.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),i.addEventListener("playing",this.onvplaying),i.addEventListener("seeked",this.onvseeked),this.gapController=new w.default(this.config,i,this.fragmentTracker,this.hls)},x.onMediaDetaching=function(){var l=this.media;l&&(l.removeEventListener("playing",this.onvplaying),l.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),m.prototype.onMediaDetaching.call(this)},x.onMediaPlaying=function(){this.tick()},x.onMediaSeeked=function(){var l=this.media,a=l?l.currentTime:null;Object(K.isFiniteNumber)(a)&&this.log("Media seeked to "+a.toFixed(3)),this.tick()},x.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(U.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},x.onManifestParsed=function(l,a){var i=!1,E=!1,v;a.levels.forEach(function(_){v=_.audioCodec,v&&(v.indexOf("mp4a.40.2")!==-1&&(i=!0),v.indexOf("mp4a.40.5")!==-1&&(E=!0))}),this.audioCodecSwitch=i&&E&&!Object(L.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=a.levels,this.startFragRequested=!1},x.onLevelLoading=function(l,a){var i=this.levels;if(!i||this.state!==O.State.IDLE)return;var E=i[a.level];(!E.details||E.details.live&&this.levelLastLoaded!==a.level||this.waitForCdnTuneIn(E.details))&&(this.state=O.State.WAITING_LEVEL)},x.onLevelLoaded=function(l,a){var i,E=this.levels,v=a.level,_=a.details,D=_.totalduration;if(!E){this.warn("Levels were reset while loading level "+v);return}this.log("Level "+v+" loaded ["+_.startSN+","+_.endSN+"], cc ["+_.startCC+", "+_.endCC+"] duration:"+D);var B=this.fragCurrent;B&&(this.state===O.State.FRAG_LOADING||this.state===O.State.FRAG_LOADING_WAITING_RETRY)&&(B.level!==a.level&&B.loader&&(this.state=O.State.IDLE,B.loader.abort()));var j=E[v],W=0;if(_.live||(i=j.details)!==null&&i!==void 0&&i.live){if(_.fragments[0]||(_.deltaUpdateFailed=!0),_.deltaUpdateFailed)return;W=this.alignPlaylists(_,j.details)}if(j.details=_,this.levelLastLoaded=v,this.hls.trigger(U.Events.LEVEL_UPDATED,{details:_,level:v}),this.state===O.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(_))return;this.state=O.State.IDLE}this.startFragRequested?_.live&&this.synchronizeToLiveEdge(_):this.setStartPosition(_,W),this.tick()},x._handleFragmentLoadProgress=function(l){var a,i=l.frag,E=l.part,v=l.payload,_=this.levels;if(!_){this.warn("Levels were reset while fragment load was in progress. Fragment "+i.sn+" of level "+i.level+" will not be buffered");return}var D=_[i.level],B=D.details;if(!B){this.warn("Dropping fragment "+i.sn+" of level "+i.level+" after level details were reset");return}var j=D.videoCodec,W=B.PTSKnown||!B.live,h=(a=i.initSegment)===null||a===void 0?void 0:a.data,N=this._getAudioCodec(D),H=this.transmuxer=this.transmuxer||new g.default(this.hls,P.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),X=E?E.index:-1,Y=X!==-1,re=new k.ChunkMetadata(i.level,i.sn,i.stats.chunkCount,v.byteLength,X,Y),he=this.initPTS[i.cc];H.push(v,h,N,j,i,E,B.totalduration,W,re,he)},x.onAudioTrackSwitching=function(l,a){var i=this.altAudio,E=!!a.url,v=a.id;if(!E){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var _=this.fragCurrent;_!=null&&_.loader&&(this.log("Switching to main audio track, cancel main fragment load"),_.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var D=this.hls;i&&D.trigger(U.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),D.trigger(U.Events.AUDIO_TRACK_SWITCHED,{id:v})}},x.onAudioTrackSwitched=function(l,a){var i=a.id,E=!!this.hls.audioTracks[i].url;if(E){var v=this.videoBuffer;v&&this.mediaBuffer!==v&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=v)}this.altAudio=E,this.tick()},x.onBufferCreated=function(l,a){var i=a.tracks,E,v,_=!1;for(var D in i){var B=i[D];if(B.id==="main"){if(v=D,E=B,D==="video"){var j=i[D];j&&(this.videoBuffer=j.buffer)}}else _=!0}_&&E?(this.log("Alternate track found, use "+v+".buffered to schedule main fragment loading"),this.mediaBuffer=E.buffer):this.mediaBuffer=this.media},x.onFragBuffered=function(l,a){var i=a.frag,E=a.part;if(i&&i.type!==P.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(i)){this.warn("Fragment "+i.sn+(E?" p: "+E.index:"")+" of level "+i.level+" finished buffering, but was aborted. state: "+this.state),this.state===O.State.PARSED&&(this.state=O.State.IDLE);return}var v=E?E.stats:i.stats;this.fragLastKbps=Math.round(8*v.total/(v.buffering.end-v.loading.first)),i.sn!=="initSegment"&&(this.fragPrevious=i),this.fragBufferedComplete(i,E)},x.onError=function(l,a){switch(a.details){case p.ErrorDetails.FRAG_LOAD_ERROR:case p.ErrorDetails.FRAG_LOAD_TIMEOUT:case p.ErrorDetails.KEY_LOAD_ERROR:case p.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(P.PlaylistLevelType.MAIN,a);break;case p.ErrorDetails.LEVEL_LOAD_ERROR:case p.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==O.State.ERROR&&(a.fatal?(this.warn(""+a.details),this.state=O.State.ERROR):!a.levelRetry&&this.state===O.State.WAITING_LEVEL&&(this.state=O.State.IDLE));break;case p.ErrorDetails.BUFFER_FULL_ERROR:if(a.parent==="main"&&(this.state===O.State.PARSING||this.state===O.State.PARSED)){var i=!0,E=this.getFwdBufferInfo(this.media,P.PlaylistLevelType.MAIN);E&&E.len>.5&&(i=!this.reduceMaxBufferLength(E.len)),i&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},x.checkBuffer=function(){var l=this.media,a=this.gapController;if(!l||!a||!l.readyState)return;var i=I.BufferHelper.getBuffered(l);!this.loadedmetadata&&i.length?(this.loadedmetadata=!0,this.seekToStartPos()):a.poll(this.lastCurrentTime),this.lastCurrentTime=l.currentTime},x.onFragLoadEmergencyAborted=function(){this.state=O.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},x.onBufferFlushed=function(l,a){var i=a.type;if(i!==b.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var E=(i===b.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(E,i,P.PlaylistLevelType.MAIN)}},x.onLevelsUpdated=function(l,a){this.levels=a.levels},x.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},x.seekToStartPos=function(){var l=this.media,a=l.currentTime,i=this.startPosition;if(i>=0&&a<i){if(l.seeking){y.logger.log("could not seek to "+i+", already seeking at "+a);return}var E=I.BufferHelper.getBuffered(l),v=E.length?E.start(0):0,_=v-i;_>0&&(_<this.config.maxBufferHole||_<this.config.maxFragLookUpTolerance)&&(y.logger.log("adjusting start position by "+_+" to match buffer start"),i+=_,this.startPosition=i),this.log("seek to target start position "+i+" from current time "+a),l.currentTime=i}},x._getAudioCodec=function(l){var a=this.config.defaultAudioCodec||l.audioCodec;return this.audioCodecSwap&&a&&(this.log("Swapping audio codec"),a.indexOf("mp4a.40.5")!==-1?a="mp4a.40.2":a="mp4a.40.5"),a},x._loadBitrateTestFrag=function(l){var a=this;this._doFragLoad(l).then(function(i){var E=a.hls;if(!i||E.nextLoadLevel||a.fragContextChanged(l))return;a.fragLoadError=0,a.state=O.State.IDLE,a.startFragRequested=!1,a.bitrateTest=!1;var v=l.stats;v.parsing.start=v.parsing.end=v.buffering.start=v.buffering.end=self.performance.now(),E.trigger(U.Events.FRAG_LOADED,i)})},x._handleTransmuxComplete=function(l){var a,i="main",E=this.hls,v=l.remuxResult,_=l.chunkMeta,D=this.getCurrentContext(_);if(!D){this.warn("The loading context changed while buffering fragment "+_.sn+" of level "+_.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(_.level);return}var B=D.frag,j=D.part,W=D.level,h=v.video,N=v.text,H=v.id3,X=v.initSegment,Y=this.altAudio?void 0:v.audio;if(this.fragContextChanged(B))return;if(this.state=O.State.PARSING,X){X.tracks&&(this._bufferInitSegment(W,X.tracks,B,_),E.trigger(U.Events.FRAG_PARSING_INIT_SEGMENT,{frag:B,id:i,tracks:X.tracks}));var re=X.initPTS,he=X.timescale;Object(K.isFiniteNumber)(re)&&(this.initPTS[B.cc]=re,E.trigger(U.Events.INIT_PTS_FOUND,{frag:B,id:i,initPTS:re,timescale:he}))}if(h&&v.independent!==!1){if(W.details){var de=h.startPTS,ne=h.endPTS,ae=h.startDTS,le=h.endDTS;if(j)j.elementaryStreams[h.type]={startPTS:de,endPTS:ne,startDTS:ae,endDTS:le};else if(h.firstKeyFrame&&h.independent&&(this.couldBacktrack=!0),h.dropped&&h.independent){var ee=this.getLoadPosition()+this.config.maxBufferHole;if(ee<de){this.backtrack(B);return}B.setElementaryStreamInfo(h.type,B.start,ne,B.start,le,!0)}B.setElementaryStreamInfo(h.type,de,ne,ae,le),this.bufferFragmentData(h,B,j,_)}}else if(v.independent===!1){this.backtrack(B);return}if(Y){var ie=Y.startPTS,ve=Y.endPTS,Pe=Y.startDTS,Ie=Y.endDTS;j&&(j.elementaryStreams[b.ElementaryStreamTypes.AUDIO]={startPTS:ie,endPTS:ve,startDTS:Pe,endDTS:Ie}),B.setElementaryStreamInfo(b.ElementaryStreamTypes.AUDIO,ie,ve,Pe,Ie),this.bufferFragmentData(Y,B,j,_)}if(H!=null&&(a=H.samples)!==null&&a!==void 0&&a.length){var we={frag:B,id:i,samples:H.samples};E.trigger(U.Events.FRAG_PARSING_METADATA,we)}if(N){var ke={frag:B,id:i,samples:N.samples};E.trigger(U.Events.FRAG_PARSING_USERDATA,ke)}},x._bufferInitSegment=function(l,a,i,E){var v=this;if(this.state!==O.State.PARSING)return;this.audioOnly=!!a.audio&&!a.video,this.altAudio&&!this.audioOnly&&delete a.audio;var _=a.audio,D=a.video,B=a.audiovideo;if(_){var j=l.audioCodec,W=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(j&&(j.indexOf("mp4a.40.5")!==-1?j="mp4a.40.2":j="mp4a.40.5"),_.metadata.channelCount!==1&&W.indexOf("firefox")===-1&&(j="mp4a.40.5")),W.indexOf("android")!==-1&&_.container!=="audio/mpeg"&&(j="mp4a.40.2",this.log("Android: force audio codec to "+j)),l.audioCodec&&l.audioCodec!==j&&this.log('Swapping manifest audio codec "'+l.audioCodec+'" for "'+j+'"'),_.levelCodec=j,_.id="main",this.log("Init audio buffer, container:"+_.container+", codecs[selected/level/parsed]=["+(j||"")+"/"+(l.audioCodec||"")+"/"+_.codec+"]")}D&&(D.levelCodec=l.videoCodec,D.id="main",this.log("Init video buffer, container:"+D.container+", codecs[level/parsed]=["+(l.videoCodec||"")+"/"+D.codec+"]")),B&&this.log("Init audiovideo buffer, container:"+B.container+", codecs[level/parsed]=["+(l.attrs.CODECS||"")+"/"+B.codec+"]"),this.hls.trigger(U.Events.BUFFER_CODECS,a),Object.keys(a).forEach(function(h){var N=a[h],H=N.initSegment;H!=null&&H.byteLength&&v.hls.trigger(U.Events.BUFFER_APPENDING,{type:h,data:H,frag:i,part:null,chunkMeta:E,parent:i.type})}),this.tick()},x.backtrack=function(l){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(l);var a=this.fragmentTracker.backtrack(l);this.fragPrevious=null,this.nextLoadPosition=l.start,a?this.resetFragmentLoading(l):this.state=O.State.BACKTRACKING},x.checkFragmentChanged=function(){var l=this.media,a=null;if(l&&l.readyState>1&&l.seeking===!1){var i=l.currentTime;if(I.BufferHelper.isBuffered(l,i)?a=this.getAppendedFrag(i):I.BufferHelper.isBuffered(l,i+.1)&&(a=this.getAppendedFrag(i+.1)),a){var E=this.fragPlaying,v=a.level;(!E||a.sn!==E.sn||E.level!==v||a.urlId!==E.urlId)&&(this.hls.trigger(U.Events.FRAG_CHANGED,{frag:a}),(!E||E.level!==v)&&this.hls.trigger(U.Events.LEVEL_SWITCHED,{level:v}),this.fragPlaying=a)}}},s(A,[{key:"nextLevel",get:function(){var l=this.nextBufferedFrag;return l?l.level:-1}},{key:"currentLevel",get:function(){var l=this.media;if(l){var a=this.getAppendedFrag(l.currentTime);if(a)return a.level}return-1}},{key:"nextBufferedFrag",get:function(){var l=this.media;if(l){var a=this.getAppendedFrag(l.currentTime);return this.followingBufferedFrag(a)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),A}(O.default)},"./src/controller/subtitle-stream-controller.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"SubtitleStreamController",function(){return c});var K=R("./src/events.ts"),O=R("./src/utils/logger.ts"),L=R("./src/utils/buffer-helper.ts"),U=R("./src/controller/fragment-finders.ts"),I=R("./src/utils/discontinuities.ts"),T=R("./src/controller/level-helper.ts"),P=R("./src/controller/fragment-tracker.ts"),b=R("./src/controller/base-stream-controller.ts"),g=R("./src/types/loader.ts"),k=R("./src/types/level.ts");function w(d,S){for(var C=0;C<S.length;C++){var m=S[C];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(d,m.key,m)}}function p(d,S,C){return S&&w(d.prototype,S),C&&w(d,C),d}function y(d,S){d.prototype=Object.create(S.prototype),d.prototype.constructor=d,f(d,S)}function f(d,S){return f=Object.setPrototypeOf||function(m,A){return m.__proto__=A,m},f(d,S)}var s=500,c=function(d){y(S,d);function S(m,A){var x;return x=d.call(this,m,A,"[subtitle-stream-controller]")||this,x.levels=[],x.currentTrackId=-1,x.tracksBuffered=[],x.mainDetails=null,x._registerListeners(),x}var C=S.prototype;return C.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},C._registerListeners=function(){var A=this.hls;A.on(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),A.on(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),A.on(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),A.on(K.Events.LEVEL_LOADED,this.onLevelLoaded,this),A.on(K.Events.ERROR,this.onError,this),A.on(K.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),A.on(K.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),A.on(K.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),A.on(K.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),A.on(K.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},C._unregisterListeners=function(){var A=this.hls;A.off(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),A.off(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),A.off(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),A.off(K.Events.LEVEL_LOADED,this.onLevelLoaded,this),A.off(K.Events.ERROR,this.onError,this),A.off(K.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),A.off(K.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),A.off(K.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),A.off(K.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),A.off(K.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},C.startLoad=function(){this.stopLoad(),this.state=b.State.IDLE,this.setInterval(s),this.tick()},C.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},C.onLevelLoaded=function(A,x){this.mainDetails=x.details},C.onSubtitleFragProcessed=function(A,x){var u=x.frag,l=x.success;if(this.fragPrevious=u,this.state=b.State.IDLE,!l)return;var a=this.tracksBuffered[this.currentTrackId];if(!a)return;for(var i,E=u.start,v=0;v<a.length;v++)if(E>=a[v].start&&E<=a[v].end){i=a[v];break}var _=u.start+u.duration;i?i.end=_:(i={start:E,end:_},a.push(i)),this.fragmentTracker.fragBuffered(u)},C.onBufferFlushing=function(A,x){var u=x.startOffset,l=x.endOffset;if(u===0&&l!==Number.POSITIVE_INFINITY){var a=this.currentTrackId,i=this.levels;if(!i.length||!i[a]||!i[a].details)return;var E=i[a].details,v=E.targetduration,_=l-v;if(_<=0)return;x.endOffsetSubtitles=Math.max(0,_),this.tracksBuffered.forEach(function(D){for(var B=0;B<D.length;){if(D[B].end<=_){D.shift();continue}else if(D[B].start<_)D[B].start=_;else break;B++}}),this.fragmentTracker.removeFragmentsInRange(u,_,g.PlaylistLevelType.SUBTITLE)}},C.onError=function(A,x){var u,l=x.frag;if(!l||l.type!==g.PlaylistLevelType.SUBTITLE)return;(u=this.fragCurrent)!==null&&u!==void 0&&u.loader&&this.fragCurrent.loader.abort(),this.state=b.State.IDLE},C.onSubtitleTracksUpdated=function(A,x){var u=this,l=x.subtitleTracks;this.tracksBuffered=[],this.levels=l.map(function(a){return new k.Level(a)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(a){u.tracksBuffered[a.id]=[]}),this.mediaBuffer=null},C.onSubtitleTrackSwitch=function(A,x){if(this.currentTrackId=x.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var u=this.levels[this.currentTrackId];u!=null&&u.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,u&&this.setInterval(s)},C.onSubtitleTrackLoaded=function(A,x){var u,l=x.details,a=x.id,i=this.currentTrackId,E=this.levels;if(!E.length)return;var v=E[i];if(a>=E.length||a!==i||!v)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,l.live||(u=v.details)!==null&&u!==void 0&&u.live){var _=this.mainDetails;if(l.deltaUpdateFailed||!_)return;var D=_.fragments[0];if(!v.details)l.hasProgramDateTime&&_.hasProgramDateTime?Object(I.alignMediaPlaylistByPDT)(l,_):D&&Object(T.addSliding)(l,D.start);else{var B=this.alignPlaylists(l,v.details);B===0&&D&&Object(T.addSliding)(l,D.start)}}if(v.details=l,this.levelLastLoaded=a,this.tick(),l.live&&!this.fragCurrent&&this.media&&this.state===b.State.IDLE){var j=Object(U.findFragmentByPTS)(null,l.fragments,this.media.currentTime,0);j||(this.warn("Subtitle playlist not aligned with playback"),v.details=void 0)}},C._handleFragmentLoadComplete=function(A){var x=A.frag,u=A.payload,l=x.decryptdata,a=this.hls;if(this.fragContextChanged(x))return;if(u&&u.byteLength>0&&l&&l.key&&l.iv&&l.method==="AES-128"){var i=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(u),l.key.buffer,l.iv.buffer).then(function(E){var v=performance.now();a.trigger(K.Events.FRAG_DECRYPTED,{frag:x,payload:E,stats:{tstart:i,tdecrypt:v}})})}},C.doTick=function(){if(!this.media){this.state=b.State.IDLE;return}if(this.state===b.State.IDLE){var A,x=this.currentTrackId,u=this.levels;if(!u.length||!u[x]||!u[x].details)return;var l=u[x].details,a=l.targetduration,i=this.config,E=this.media,v=L.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,E.currentTime-a,i.maxBufferHole),_=v.end,D=v.len,B=this.getMaxBufferLength()+a;if(D>B)return;console.assert(l,"Subtitle track details are defined on idle subtitle stream controller tick");var j=l.fragments,W=j.length,h=l.edge,N,H=this.fragPrevious;if(_<h){var X=i.maxFragLookUpTolerance;H&&l.hasProgramDateTime&&(N=Object(U.findFragmentByPDT)(j,H.endProgramDateTime,X)),N||(N=Object(U.findFragmentByPTS)(H,j,_,X),!N&&H&&H.start<j[0].start&&(N=j[0]))}else N=j[W-1];(A=N)!==null&&A!==void 0&&A.encrypted?(O.logger.log("Loading key for "+N.sn),this.state=b.State.KEY_LOADING,this.hls.trigger(K.Events.KEY_LOADING,{frag:N})):N&&this.fragmentTracker.getState(N)===P.FragmentState.NOT_LOADED&&this.loadFragment(N,l,_)}},C.loadFragment=function(A,x,u){this.fragCurrent=A,d.prototype.loadFragment.call(this,A,x,u)},p(S,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),S}(b.default)},"./src/controller/subtitle-track-controller.ts":function(q,G,R){"use strict";R.r(G);var K=R("./src/events.ts"),O=R("./src/utils/texttrack-utils.ts"),L=R("./src/controller/base-playlist-controller.ts"),U=R("./src/types/loader.ts");function I(w,p){for(var y=0;y<p.length;y++){var f=p[y];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(w,f.key,f)}}function T(w,p,y){return p&&I(w.prototype,p),y&&I(w,y),w}function P(w,p){w.prototype=Object.create(p.prototype),w.prototype.constructor=w,b(w,p)}function b(w,p){return b=Object.setPrototypeOf||function(f,s){return f.__proto__=s,f},b(w,p)}var g=function(w){P(p,w);function p(f){var s;return s=w.call(this,f,"[subtitle-track-controller]")||this,s.media=null,s.tracks=[],s.groupId=null,s.tracksInGroup=[],s.trackId=-1,s.selectDefaultTrack=!0,s.queuedDefaultTrack=-1,s.trackChangeListener=function(){return s.onTextTracksChanged()},s.asyncPollTrackChange=function(){return s.pollTrackChange(0)},s.useTextTrackPolling=!1,s.subtitlePollingInterval=-1,s.subtitleDisplay=!0,s.registerListeners(),s}var y=p.prototype;return y.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,w.prototype.destroy.call(this)},y.registerListeners=function(){var s=this.hls;s.on(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.on(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.on(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.on(K.Events.LEVEL_LOADING,this.onLevelLoading,this),s.on(K.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),s.on(K.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),s.on(K.Events.ERROR,this.onError,this)},y.unregisterListeners=function(){var s=this.hls;s.off(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.off(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.off(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.off(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.off(K.Events.LEVEL_LOADING,this.onLevelLoading,this),s.off(K.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),s.off(K.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),s.off(K.Events.ERROR,this.onError,this)},y.onMediaAttached=function(s,c){if(this.media=c.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)},y.pollTrackChange=function(s){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,s)},y.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 s=k(this.media.textTracks);s.forEach(function(c){Object(O.clearCurrentCues)(c)}),this.subtitleTrack=-1,this.media=null},y.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},y.onManifestParsed=function(s,c){this.tracks=c.subtitleTracks},y.onSubtitleTrackLoaded=function(s,c){var d=c.id,S=c.details,C=this.trackId,m=this.tracksInGroup[C];if(!m){this.warn("Invalid subtitle track id "+d);return}var A=m.details;m.details=c.details,this.log("subtitle track "+d+" loaded ["+S.startSN+"-"+S.endSN+"]"),d===this.trackId&&(this.retryCount=0,this.playlistLoaded(d,c,A))},y.onLevelLoading=function(s,c){this.switchLevel(c.level)},y.onLevelSwitching=function(s,c){this.switchLevel(c.level)},y.switchLevel=function(s){var c=this.hls.levels[s];if(!(c!=null&&c.textGroupIds))return;var d=c.textGroupIds[c.urlId];if(this.groupId!==d){var S=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,C=this.tracks.filter(function(x){return!d||x.groupId===d});this.tracksInGroup=C;var m=this.findTrackId(S==null?void 0:S.name)||this.findTrackId();this.groupId=d;var A={subtitleTracks:C};this.log("Updating subtitle tracks, "+C.length+' track(s) found in "'+d+'" group-id'),this.hls.trigger(K.Events.SUBTITLE_TRACKS_UPDATED,A),m!==-1&&this.setSubtitleTrack(m,S)}},y.findTrackId=function(s){for(var c=this.tracksInGroup,d=0;d<c.length;d++){var S=c[d];if((!this.selectDefaultTrack||S.default)&&(!s||s===S.name))return S.id}return-1},y.onError=function(s,c){if(w.prototype.onError.call(this,s,c),c.fatal||!c.context)return;c.context.type===U.PlaylistContextType.SUBTITLE_TRACK&&c.context.id===this.trackId&&c.context.groupId===this.groupId&&this.retryLoadingOrFail(c)},y.loadPlaylist=function(s){var c=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(c)){var d=c.id,S=c.groupId,C=c.url;if(s)try{C=s.addDirectives(C)}catch(m){this.warn("Could not construct new URL with HLS Delivery Directives: "+m)}this.log("Loading subtitle playlist for id "+d),this.hls.trigger(K.Events.SUBTITLE_TRACK_LOADING,{url:C,id:d,groupId:S,deliveryDirectives:s||null})}},y.toggleTrackModes=function(s){var c=this,d=this.media,S=this.subtitleDisplay,C=this.trackId;if(!d)return;var m=k(d.textTracks),A=m.filter(function(l){return l.groupId===c.groupId});if(s===-1)[].slice.call(m).forEach(function(l){l.mode="disabled"});else{var x=A[C];x&&(x.mode="disabled")}var u=A[s];u&&(u.mode=S?"showing":"hidden")},y.setSubtitleTrack=function(s,c){var d,S=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=s;return}if(this.trackId!==s&&this.toggleTrackModes(s),this.trackId===s&&(s===-1||(d=S[s])!==null&&d!==void 0&&d.details)||s<-1||s>=S.length)return;this.clearTimer();var C=S[s];if(this.log("Switching to subtitle track "+s),this.trackId=s,C){var m=C.id,A=C.groupId,x=A===void 0?"":A,u=C.name,l=C.type,a=C.url;this.hls.trigger(K.Events.SUBTITLE_TRACK_SWITCH,{id:m,groupId:x,name:u,type:l,url:a});var i=this.switchParams(C.url,c==null?void 0:c.details);this.loadPlaylist(i)}else this.hls.trigger(K.Events.SUBTITLE_TRACK_SWITCH,{id:s})},y.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var s=-1,c=k(this.media.textTracks),d=0;d<c.length;d++)if(c[d].mode==="hidden")s=d;else if(c[d].mode==="showing"){s=d;break}this.subtitleTrack!==s&&(this.subtitleTrack=s)},T(p,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(s){this.selectDefaultTrack=!1;var c=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(s,c)}}]),p}(L.default);function k(w){for(var p=[],y=0;y<w.length;y++){var f=w[y];f.kind==="subtitles"&&f.label&&p.push(w[y])}return p}G.default=g},"./src/controller/timeline-controller.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"TimelineController",function(){return k});var K=R("./src/polyfills/number.ts"),O=R("./src/events.ts"),L=R("./src/utils/cea-608-parser.ts"),U=R("./src/utils/output-filter.ts"),I=R("./src/utils/webvtt-parser.ts"),T=R("./src/utils/texttrack-utils.ts"),P=R("./src/utils/imsc1-ttml-parser.ts"),b=R("./src/types/loader.ts"),g=R("./src/utils/logger.ts"),k=function(){function f(c){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=y(),this.captionsProperties=void 0,this.hls=c,this.config=c.config,this.Cues=c.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 d=new U.default(this,"textTrack1"),S=new U.default(this,"textTrack2"),C=new U.default(this,"textTrack3"),m=new U.default(this,"textTrack4");this.cea608Parser1=new L.default(1,d,S),this.cea608Parser2=new L.default(3,C,m)}c.on(O.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),c.on(O.Events.MEDIA_DETACHING,this.onMediaDetaching,this),c.on(O.Events.MANIFEST_LOADING,this.onManifestLoading,this),c.on(O.Events.MANIFEST_LOADED,this.onManifestLoaded,this),c.on(O.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),c.on(O.Events.FRAG_LOADING,this.onFragLoading,this),c.on(O.Events.FRAG_LOADED,this.onFragLoaded,this),c.on(O.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),c.on(O.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),c.on(O.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),c.on(O.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),c.on(O.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var s=f.prototype;return s.destroy=function(){var d=this.hls;d.off(O.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),d.off(O.Events.MEDIA_DETACHING,this.onMediaDetaching,this),d.off(O.Events.MANIFEST_LOADING,this.onManifestLoading,this),d.off(O.Events.MANIFEST_LOADED,this.onManifestLoaded,this),d.off(O.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),d.off(O.Events.FRAG_LOADING,this.onFragLoading,this),d.off(O.Events.FRAG_LOADED,this.onFragLoaded,this),d.off(O.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),d.off(O.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),d.off(O.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),d.off(O.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),d.off(O.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},s.addCues=function(d,S,C,m,A){for(var x=!1,u=A.length;u--;){var l=A[u],a=p(l[0],l[1],S,C);if(a>=0&&(l[0]=Math.min(l[0],S),l[1]=Math.max(l[1],C),x=!0,a/(C-S)>.5))return}if(x||A.push([S,C]),this.config.renderTextTracksNatively){var i=this.captionsTracks[d];this.Cues.newCue(i,S,C,m)}else{var E=this.Cues.newCue(null,S,C,m);this.hls.trigger(O.Events.CUES_PARSED,{type:"captions",cues:E,track:d})}},s.onInitPtsFound=function(d,S){var C=this,m=S.frag,A=S.id,x=S.initPTS,u=S.timescale,l=this.unparsedVttFrags;A==="main"&&(this.initPTS[m.cc]=x,this.timescale[m.cc]=u),l.length&&(this.unparsedVttFrags=[],l.forEach(function(a){C.onFragLoaded(O.Events.FRAG_LOADED,a)}))},s.getExistingTrack=function(d){var S=this.media;if(S)for(var C=0;C<S.textTracks.length;C++){var m=S.textTracks[C];if(m[d])return m}return null},s.createCaptionsTrack=function(d){this.config.renderTextTracksNatively?this.createNativeTrack(d):this.createNonNativeTrack(d)},s.createNativeTrack=function(d){if(this.captionsTracks[d])return;var S=this.captionsProperties,C=this.captionsTracks,m=this.media,A=S[d],x=A.label,u=A.languageCode,l=this.getExistingTrack(d);if(l)C[d]=l,Object(T.clearCurrentCues)(C[d]),Object(T.sendAddTrackEvent)(C[d],m);else{var a=this.createTextTrack("captions",x,u);a&&(a[d]=!0,C[d]=a)}},s.createNonNativeTrack=function(d){if(this.nonNativeCaptionsTracks[d])return;var S=this.captionsProperties[d];if(!S)return;var C=S.label,m={_id:d,label:C,kind:"captions",default:S.media?!!S.media.default:!1,closedCaptions:S.media};this.nonNativeCaptionsTracks[d]=m,this.hls.trigger(O.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[m]})},s.createTextTrack=function(d,S,C){var m=this.media;return m?m.addTextTrack(d,S,C):void 0},s.onMediaAttaching=function(d,S){this.media=S.media,this._cleanTracks()},s.onMediaDetaching=function(){var d=this.captionsTracks;Object.keys(d).forEach(function(S){Object(T.clearCurrentCues)(d[S]),delete d[S]}),this.nonNativeCaptionsTracks={}},s.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=y(),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())},s._cleanTracks=function(){var d=this.media;if(!d)return;var S=d.textTracks;if(S)for(var C=0;C<S.length;C++)Object(T.clearCurrentCues)(S[C])},s.onSubtitleTracksUpdated=function(d,S){var C=this;this.textTracks=[];var m=S.subtitleTracks||[],A=m.some(function(a){return a.textCodec===P.IMSC1_CODEC});if(this.config.enableWebVTT||A&&this.config.enableIMSC1){var x=this.tracks&&m&&this.tracks.length===m.length;if(this.tracks=m||[],this.config.renderTextTracksNatively){var u=this.media?this.media.textTracks:[];this.tracks.forEach(function(a,i){var E;if(i<u.length){for(var v=null,_=0;_<u.length;_++)if(w(u[_],a)){v=u[_];break}v&&(E=v)}E?Object(T.clearCurrentCues)(E):(E=C.createTextTrack("subtitles",a.name,a.lang),E&&(E.mode="disabled")),E&&(E.groupId=a.groupId,C.textTracks.push(E))})}else if(!x&&this.tracks&&this.tracks.length){var l=this.tracks.map(function(a){return{label:a.name,kind:a.type.toLowerCase(),default:a.default,subtitleTrack:a}});this.hls.trigger(O.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:l})}}},s.onManifestLoaded=function(d,S){var C=this;this.config.enableCEA708Captions&&S.captions&&S.captions.forEach(function(m){var A=/(?:CC|SERVICE)([1-4])/.exec(m.instreamId);if(!A)return;var x="textTrack"+A[1],u=C.captionsProperties[x];if(!u)return;u.label=m.name,m.lang&&(u.languageCode=m.lang),u.media=m})},s.onFragLoading=function(d,S){var C=this.cea608Parser1,m=this.cea608Parser2,A=this.lastSn,x=this.lastPartIndex;if(!this.enabled||!(C&&m))return;if(S.frag.type===b.PlaylistLevelType.MAIN){var u,l,a=S.frag.sn,i=(u=S==null||((l=S.part)===null||l===void 0)?void 0:l.index)!=null?u:-1;a===A+1||a===A&&i===x+1||(C.reset(),m.reset()),this.lastSn=a,this.lastPartIndex=i}},s.onFragLoaded=function(d,S){var C=S.frag,m=S.payload,A=this.initPTS,x=this.unparsedVttFrags;if(C.type===b.PlaylistLevelType.SUBTITLE)if(m.byteLength){if(!Object(K.isFiniteNumber)(A[C.cc])){x.push(S),A.length&&this.hls.trigger(O.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:C,error:new Error("Missing initial subtitle PTS")});return}var u=C.decryptdata;if(u==null||u.key==null||u.method!=="AES-128"){var l=this.tracks[C.level],a=this.vttCCs;a[C.cc]||(a[C.cc]={start:C.start,prevCC:this.prevCC,new:!0},this.prevCC=C.cc),l&&l.textCodec===P.IMSC1_CODEC?this._parseIMSC1(C,m):this._parseVTTs(C,m,a)}}else this.hls.trigger(O.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:C,error:new Error("Empty subtitle payload")})},s._parseIMSC1=function(d,S){var C=this,m=this.hls;Object(P.parseIMSC1)(S,this.initPTS[d.cc],this.timescale[d.cc],function(A){C._appendCues(A,d.level),m.trigger(O.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:d})},function(A){g.logger.log("Failed to parse IMSC1: "+A),m.trigger(O.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:d,error:A})})},s._parseVTTs=function(d,S,C){var m=this,A=this.hls;Object(I.parseWebVTT)(S,this.initPTS[d.cc],this.timescale[d.cc],C,d.cc,d.start,function(x){m._appendCues(x,d.level),A.trigger(O.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:d})},function(x){m._fallbackToIMSC1(d,S),g.logger.log("Failed to parse VTT cue: "+x),A.trigger(O.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:d,error:x})})},s._fallbackToIMSC1=function(d,S){var C=this,m=this.tracks[d.level];m.textCodec||Object(P.parseIMSC1)(S,this.initPTS[d.cc],this.timescale[d.cc],function(){m.textCodec=P.IMSC1_CODEC,C._parseIMSC1(d,S)},function(){m.textCodec="wvtt"})},s._appendCues=function(d,S){var C=this.hls;if(this.config.renderTextTracksNatively){var m=this.textTracks[S];if(m.mode==="disabled")return;d.forEach(function(u){return Object(T.addCueToTrack)(m,u)})}else{var A=this.tracks[S],x=A.default?"default":"subtitles"+S;C.trigger(O.Events.CUES_PARSED,{type:"subtitles",cues:d,track:x})}},s.onFragDecrypted=function(d,S){var C=S.frag;if(C.type===b.PlaylistLevelType.SUBTITLE){if(!Object(K.isFiniteNumber)(this.initPTS[C.cc])){this.unparsedVttFrags.push(S);return}this.onFragLoaded(O.Events.FRAG_LOADED,S)}},s.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},s.onFragParsingUserdata=function(d,S){var C=this.cea608Parser1,m=this.cea608Parser2;if(!this.enabled||!(C&&m))return;for(var A=0;A<S.samples.length;A++){var x=S.samples[A].bytes;if(x){var u=this.extractCea608Data(x);C.addData(S.samples[A].pts,u[0]),m.addData(S.samples[A].pts,u[1])}}},s.onBufferFlushing=function(d,S){var C=S.startOffset,m=S.endOffset,A=S.endOffsetSubtitles,x=S.type,u=this.media;if(!u||u.currentTime<m)return;if(!x||x==="video"){var l=this.captionsTracks;Object.keys(l).forEach(function(i){return Object(T.removeCuesInRange)(l[i],C,m)})}if(this.config.renderTextTracksNatively&&(C===0&&A!==void 0)){var a=this.textTracks;Object.keys(a).forEach(function(i){return Object(T.removeCuesInRange)(a[i],C,A)})}},s.extractCea608Data=function(d){for(var S=d[0]&31,C=2,m=[[],[]],A=0;A<S;A++){var x=d[C++],u=127&d[C++],l=127&d[C++],a=(4&x)!==0,i=3&x;if(u===0&&l===0)continue;a&&((i===0||i===1)&&(m[i].push(u),m[i].push(l)))}return m},f}();function w(f,s){return f&&f.label===s.name&&!(f.textTrack1||f.textTrack2)}function p(f,s,c,d){return Math.min(s,d)-Math.max(f,c)}function y(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"default",function(){return K});var K=function(){function O(U,I){this.subtle=void 0,this.aesIV=void 0,this.subtle=U,this.aesIV=I}var L=O.prototype;return L.decrypt=function(I,T){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},T,I)},O}()},"./src/crypt/aes-decryptor.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"removePadding",function(){return O}),R.d(G,"default",function(){return L});var K=R("./src/utils/typed-array.ts");function O(U){var I=U.byteLength,T=I&&new DataView(U.buffer).getUint8(I-1);return T?Object(K.sliceUint8)(U,0,I-T):U}var L=function(){function U(){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 I=U.prototype;return I.uint8ArrayToUint32Array_=function(P){for(var b=new DataView(P),g=new Uint32Array(4),k=0;k<4;k++)g[k]=b.getUint32(k*4);return g},I.initTable=function(){var P=this.sBox,b=this.invSBox,g=this.subMix,k=g[0],w=g[1],p=g[2],y=g[3],f=this.invSubMix,s=f[0],c=f[1],d=f[2],S=f[3],C=new Uint32Array(256),m=0,A=0,x=0;for(x=0;x<256;x++)x<128?C[x]=x<<1:C[x]=x<<1^283;for(x=0;x<256;x++){var u=A^A<<1^A<<2^A<<3^A<<4;u=u>>>8^u&255^99,P[m]=u,b[u]=m;var l=C[m],a=C[l],i=C[a],E=C[u]*257^u*16843008;k[m]=E<<24|E>>>8,w[m]=E<<16|E>>>16,p[m]=E<<8|E>>>24,y[m]=E,E=i*16843009^a*65537^l*257^m*16843008,s[u]=E<<24|E>>>8,c[u]=E<<16|E>>>16,d[u]=E<<8|E>>>24,S[u]=E,m?(m=l^C[C[C[i^l]]],A^=C[C[A]]):m=A=1}},I.expandKey=function(P){for(var b=this.uint8ArrayToUint32Array_(P),g=!0,k=0;k<b.length&&g;)g=b[k]===this.key[k],k++;if(g)return;this.key=b;var w=this.keySize=b.length;if(w!==4&&w!==6&&w!==8)throw new Error("Invalid aes key size="+w);var p=this.ksRows=(w+6+1)*4,y,f,s=this.keySchedule=new Uint32Array(p),c=this.invKeySchedule=new Uint32Array(p),d=this.sBox,S=this.rcon,C=this.invSubMix,m=C[0],A=C[1],x=C[2],u=C[3],l,a;for(y=0;y<p;y++){if(y<w){l=s[y]=b[y];continue}a=l,y%w===0?(a=a<<8|a>>>24,a=d[a>>>24]<<24|d[a>>>16&255]<<16|d[a>>>8&255]<<8|d[a&255],a^=S[y/w|0]<<24):w>6&&y%w===4&&(a=d[a>>>24]<<24|d[a>>>16&255]<<16|d[a>>>8&255]<<8|d[a&255]),s[y]=l=(s[y-w]^a)>>>0}for(f=0;f<p;f++)y=p-f,f&3?a=s[y]:a=s[y-4],f<4||y<=4?c[f]=a:c[f]=m[d[a>>>24]]^A[d[a>>>16&255]]^x[d[a>>>8&255]]^u[d[a&255]],c[f]=c[f]>>>0},I.networkToHostOrderSwap=function(P){return P<<24|(P&65280)<<8|(P&16711680)>>8|P>>>24},I.decrypt=function(P,b,g){for(var k=this.keySize+6,w=this.invKeySchedule,p=this.invSBox,y=this.invSubMix,f=y[0],s=y[1],c=y[2],d=y[3],S=this.uint8ArrayToUint32Array_(g),C=S[0],m=S[1],A=S[2],x=S[3],u=new Int32Array(P),l=new Int32Array(u.length),a,i,E,v,_,D,B,j,W,h,N,H,X,Y,re=this.networkToHostOrderSwap;b<u.length;){for(W=re(u[b]),h=re(u[b+1]),N=re(u[b+2]),H=re(u[b+3]),_=W^w[0],D=H^w[1],B=N^w[2],j=h^w[3],X=4,Y=1;Y<k;Y++)a=f[_>>>24]^s[D>>16&255]^c[B>>8&255]^d[j&255]^w[X],i=f[D>>>24]^s[B>>16&255]^c[j>>8&255]^d[_&255]^w[X+1],E=f[B>>>24]^s[j>>16&255]^c[_>>8&255]^d[D&255]^w[X+2],v=f[j>>>24]^s[_>>16&255]^c[D>>8&255]^d[B&255]^w[X+3],_=a,D=i,B=E,j=v,X=X+4;a=p[_>>>24]<<24^p[D>>16&255]<<16^p[B>>8&255]<<8^p[j&255]^w[X],i=p[D>>>24]<<24^p[B>>16&255]<<16^p[j>>8&255]<<8^p[_&255]^w[X+1],E=p[B>>>24]<<24^p[j>>16&255]<<16^p[_>>8&255]<<8^p[D&255]^w[X+2],v=p[j>>>24]<<24^p[_>>16&255]<<16^p[D>>8&255]<<8^p[B&255]^w[X+3],l[b]=re(a^C),l[b+1]=re(v^m),l[b+2]=re(E^A),l[b+3]=re(i^x),C=W,m=h,A=N,x=H,b=b+4}return l.buffer},U}()},"./src/crypt/decrypter.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"default",function(){return b});var K=R("./src/crypt/aes-crypto.ts"),O=R("./src/crypt/fast-aes-key.ts"),L=R("./src/crypt/aes-decryptor.ts"),U=R("./src/utils/logger.ts"),I=R("./src/utils/mp4-tools.ts"),T=R("./src/utils/typed-array.ts"),P=16,b=function(){function g(w,p,y){var f=y===void 0?{}:y,s=f.removePKCS7Padding,c=s===void 0?!0:s;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=w,this.config=p,this.removePKCS7Padding=c,c)try{var d=self.crypto;d&&(this.subtle=d.subtle||d.webkitSubtle)}catch(S){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var k=g.prototype;return k.destroy=function(){this.observer=null},k.isSync=function(){return this.config.enableSoftwareAES},k.flush=function(){var p=this.currentResult;if(!p){this.reset();return}var y=new Uint8Array(p);return this.reset(),this.removePKCS7Padding?Object(L.removePadding)(y):y},k.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},k.decrypt=function(p,y,f,s){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(p),y,f);var c=this.flush();c&&s(c.buffer)}else this.webCryptoDecrypt(new Uint8Array(p),y,f).then(s)},k.softwareDecrypt=function(p,y,f){var s=this.currentIV,c=this.currentResult,d=this.remainderData;this.logOnce("JS AES decrypt"),d&&(p=Object(I.appendUint8Array)(d,p),this.remainderData=null);var S=this.getValidChunk(p);if(!S.length)return null;s&&(f=s);var C=this.softwareDecrypter;C||(C=this.softwareDecrypter=new L.default),C.expandKey(y);var m=c;return this.currentResult=C.decrypt(S.buffer,0,f),this.currentIV=Object(T.sliceUint8)(S,-16).buffer,m||null},k.webCryptoDecrypt=function(p,y,f){var s=this,c=this.subtle;return(this.key!==y||!this.fastAesKey)&&(this.key=y,this.fastAesKey=new O.default(c,y)),this.fastAesKey.expandKey().then(function(d){if(!c)return Promise.reject(new Error("web crypto not initialized"));var S=new K.default(c,f);return S.decrypt(p.buffer,d)}).catch(function(d){return s.onWebCryptoError(d,p,y,f)})},k.onWebCryptoError=function(p,y,f,s){return U.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",p),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(y,f,s)},k.getValidChunk=function(p){var y=p,f=p.length-p.length%P;return f!==p.length&&(y=Object(T.sliceUint8)(p,0,f),this.remainderData=Object(T.sliceUint8)(p,f)),y},k.logOnce=function(p){if(!this.logEnabled)return;U.logger.log("[decrypter.ts]: "+p),this.logEnabled=!1},g}()},"./src/crypt/fast-aes-key.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"default",function(){return K});var K=function(){function O(U,I){this.subtle=void 0,this.key=void 0,this.subtle=U,this.key=I}var L=O.prototype;return L.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},O}()},"./src/demux/aacdemuxer.ts":function(q,G,R){"use strict";R.r(G);var K=R("./src/demux/base-audio-demuxer.ts"),O=R("./src/demux/adts.ts"),L=R("./src/utils/logger.ts"),U=R("./src/demux/id3.ts");function I(b,g){b.prototype=Object.create(g.prototype),b.prototype.constructor=b,T(b,g)}function T(b,g){return T=Object.setPrototypeOf||function(w,p){return w.__proto__=p,w},T(b,g)}var P=function(b){I(g,b);function g(w,p){var y;return y=b.call(this)||this,y.observer=void 0,y.config=void 0,y.observer=w,y.config=p,y}var k=g.prototype;return k.resetInitSegment=function(p,y,f){b.prototype.resetInitSegment.call(this,p,y,f),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:p,duration:f,inputTimeScale:9e4,dropped:0}},g.probe=function(p){if(!p)return!1;for(var y=U.getID3Data(p,0)||[],f=y.length,s=p.length;f<s;f++)if(O.probe(p,f))return L.logger.log("ADTS sync word found !"),!0;return!1},k.canParse=function(p,y){return O.canParse(p,y)},k.appendFrame=function(p,y,f){O.initTrackConfig(p,this.observer,y,f,p.manifestCodec);var s=O.appendFrame(p,y,f,this.initPTS,this.frameIndex);if(s&&s.missing===0)return s},g}(K.default);P.minProbeByteLength=9,G.default=P},"./src/demux/adts.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"getAudioConfig",function(){return U}),R.d(G,"isHeaderPattern",function(){return I}),R.d(G,"getHeaderLength",function(){return T}),R.d(G,"getFullFrameLength",function(){return P}),R.d(G,"canGetFrameLength",function(){return b}),R.d(G,"isHeader",function(){return g}),R.d(G,"canParse",function(){return k}),R.d(G,"probe",function(){return w}),R.d(G,"initTrackConfig",function(){return p}),R.d(G,"getFrameDuration",function(){return y}),R.d(G,"parseFrameHeader",function(){return f}),R.d(G,"appendFrame",function(){return s});var K=R("./src/utils/logger.ts"),O=R("./src/errors.ts"),L=R("./src/events.ts");function U(c,d,S,C){var m,A,x,u,l=navigator.userAgent.toLowerCase(),a=C,i=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];m=((d[S+2]&192)>>>6)+1;var E=(d[S+2]&60)>>>2;if(E>i.length-1){c.trigger(L.Events.ERROR,{type:O.ErrorTypes.MEDIA_ERROR,details:O.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+E});return}return x=(d[S+2]&1)<<2,x|=(d[S+3]&192)>>>6,K.logger.log("manifest codec:"+C+", ADTS type:"+m+", samplingIndex:"+E),/firefox/i.test(l)?E>=6?(m=5,u=new Array(4),A=E-3):(m=2,u=new Array(2),A=E):l.indexOf("android")!==-1?(m=2,u=new Array(2),A=E):(m=5,u=new Array(4),C&&(C.indexOf("mp4a.40.29")!==-1||C.indexOf("mp4a.40.5")!==-1)||!C&&E>=6?A=E-3:((C&&C.indexOf("mp4a.40.2")!==-1&&(E>=6&&x===1||/vivaldi/i.test(l))||!C&&x===1)&&(m=2,u=new Array(2)),A=E)),u[0]=m<<3,u[0]|=(E&14)>>1,u[1]|=(E&1)<<7,u[1]|=x<<3,m===5&&(u[1]|=(A&14)>>1,u[2]=(A&1)<<7,u[2]|=2<<2,u[3]=0),{config:u,samplerate:i[E],channelCount:x,codec:"mp4a.40."+m,manifestCodec:a}}function I(c,d){return c[d]===255&&(c[d+1]&246)===240}function T(c,d){return c[d+1]&1?7:9}function P(c,d){return(c[d+3]&3)<<11|c[d+4]<<3|(c[d+5]&224)>>>5}function b(c,d){return d+5<c.length}function g(c,d){return d+1<c.length&&I(c,d)}function k(c,d){return b(c,d)&&I(c,d)&&P(c,d)<=c.length-d}function w(c,d){if(g(c,d)){var S=T(c,d);if(d+S>=c.length)return!1;var C=P(c,d);if(C<=S)return!1;var m=d+C;return m===c.length||g(c,m)}return!1}function p(c,d,S,C,m){if(!c.samplerate){var A=U(d,S,C,m);if(!A)return;c.config=A.config,c.samplerate=A.samplerate,c.channelCount=A.channelCount,c.codec=A.codec,c.manifestCodec=A.manifestCodec,K.logger.log("parsed codec:"+c.codec+", rate:"+A.samplerate+", channels:"+A.channelCount)}}function y(c){return 1024*9e4/c}function f(c,d,S,C,m){var A=T(c,d),x=P(c,d);if(x-=A,x>0){var u=S+C*m;return{headerLength:A,frameLength:x,stamp:u}}}function s(c,d,S,C,m){var A=y(c.samplerate),x=f(d,S,C,m,A);if(x){var u=x.frameLength,l=x.headerLength,a=x.stamp,i=l+u,E=Math.max(0,S+i-d.length),v;E?(v=new Uint8Array(i-l),v.set(d.subarray(S+l,d.length),0)):v=d.subarray(S+l,S+i);var _={unit:v,pts:a};return E||c.samples.push(_),{sample:_,length:i,missing:E}}}},"./src/demux/base-audio-demuxer.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"initPTSFn",function(){return P});var K=R("./src/polyfills/number.ts"),O=R("./src/demux/id3.ts"),L=R("./src/demux/dummy-demuxed-track.ts"),U=R("./src/utils/mp4-tools.ts"),I=R("./src/utils/typed-array.ts"),T=function(){function b(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var g=b.prototype;return g.resetInitSegment=function(w,p,y){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},g.resetTimeStamp=function(){},g.resetContiguity=function(){},g.canParse=function(w,p){return!1},g.appendFrame=function(w,p,y){},g.demux=function(w,p){this.cachedData&&(w=Object(U.appendUint8Array)(this.cachedData,w),this.cachedData=null);var y=O.getID3Data(w,0),f=y?y.length:0,s,c,d=this._audioTrack,S=this._id3Track,C=y?O.getTimeStamp(y):void 0,m=w.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=P(C,p)),y&&y.length>0&&S.samples.push({pts:this.initPTS,dts:this.initPTS,data:y}),c=this.initPTS;f<m;){if(this.canParse(w,f)){var A=this.appendFrame(d,w,f);A?(this.frameIndex++,c=A.sample.pts,f+=A.length,s=f):f=m}else O.canParse(w,f)?(y=O.getID3Data(w,f),S.samples.push({pts:c,dts:c,data:y}),f+=y.length,s=f):f++;if(f===m&&s!==m){var x=Object(I.sliceUint8)(w,s);this.cachedData?this.cachedData=Object(U.appendUint8Array)(this.cachedData,x):this.cachedData=x}}return{audioTrack:d,avcTrack:Object(L.dummyTrack)(),id3Track:S,textTrack:Object(L.dummyTrack)()}},g.demuxSampleAes=function(w,p,y){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},g.flush=function(w){var p=this.cachedData;return p&&(this.cachedData=null,this.demux(p,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(L.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(L.dummyTrack)()}},g.destroy=function(){},b}(),P=function(g,k){return Object(K.isFiniteNumber)(g)?g*90:k*9e4};G.default=T},"./src/demux/chunk-cache.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"default",function(){return K});var K=function(){function L(){this.chunks=[],this.dataLength=0}var U=L.prototype;return U.push=function(T){this.chunks.push(T),this.dataLength+=T.length},U.flush=function(){var T=this.chunks,P=this.dataLength,b;if(T.length)T.length===1?b=T[0]:b=O(T,P);else return new Uint8Array(0);return this.reset(),b},U.reset=function(){this.chunks.length=0,this.dataLength=0},L}();function O(L,U){for(var I=new Uint8Array(U),T=0,P=0;P<L.length;P++){var b=L[P];I.set(b,T),T+=b.length}return I}},"./src/demux/dummy-demuxed-track.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"dummyTrack",function(){return K});function K(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(q,G,R){"use strict";R.r(G);var K=R("./src/utils/logger.ts"),O=function(){function L(I){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=I,this.bytesAvailable=I.byteLength,this.word=0,this.bitsAvailable=0}var U=L.prototype;return U.loadWord=function(){var T=this.data,P=this.bytesAvailable,b=T.byteLength-P,g=new Uint8Array(4),k=Math.min(4,P);if(k===0)throw new Error("no bytes available");g.set(T.subarray(b,b+k)),this.word=new DataView(g.buffer).getUint32(0),this.bitsAvailable=k*8,this.bytesAvailable-=k},U.skipBits=function(T){var P;this.bitsAvailable>T?(this.word<<=T,this.bitsAvailable-=T):(T-=this.bitsAvailable,P=T>>3,T-=P>>3,this.bytesAvailable-=P,this.loadWord(),this.word<<=T,this.bitsAvailable-=T)},U.readBits=function(T){var P=Math.min(this.bitsAvailable,T),b=this.word>>>32-P;return T>32&&K.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=P,this.bitsAvailable>0?this.word<<=P:this.bytesAvailable>0&&this.loadWord(),P=T-P,P>0&&this.bitsAvailable?b<<P|this.readBits(P):b},U.skipLZ=function(){var T;for(T=0;T<this.bitsAvailable;++T)if((this.word&2147483648>>>T)!==0)return this.word<<=T,this.bitsAvailable-=T,T;return this.loadWord(),T+this.skipLZ()},U.skipUEG=function(){this.skipBits(1+this.skipLZ())},U.skipEG=function(){this.skipBits(1+this.skipLZ())},U.readUEG=function(){var T=this.skipLZ();return this.readBits(T+1)-1},U.readEG=function(){var T=this.readUEG();return 1&T?1+T>>>1:-1*(T>>>1)},U.readBoolean=function(){return this.readBits(1)===1},U.readUByte=function(){return this.readBits(8)},U.readUShort=function(){return this.readBits(16)},U.readUInt=function(){return this.readBits(32)},U.skipScalingList=function(T){for(var P=8,b=8,g,k=0;k<T;k++)b!==0&&(g=this.readEG(),b=(P+g+256)%256),P=b===0?P:b},U.readSPS=function(){var T=0,P=0,b=0,g=0,k,w,p,y=this.readUByte.bind(this),f=this.readBits.bind(this),s=this.readUEG.bind(this),c=this.readBoolean.bind(this),d=this.skipBits.bind(this),S=this.skipEG.bind(this),C=this.skipUEG.bind(this),m=this.skipScalingList.bind(this);y();var A=y();if(f(5),d(3),y(),C(),A===100||A===110||A===122||A===244||A===44||A===83||A===86||A===118||A===128){var x=s();if(x===3&&d(1),C(),C(),d(1),c())for(w=x!==3?8:12,p=0;p<w;p++)c()&&(p<6?m(16):m(64))}C();var u=s();if(u===0)s();else if(u===1)for(d(1),S(),S(),k=s(),p=0;p<k;p++)S();C(),d(1);var l=s(),a=s(),i=f(1);i===0&&d(1),d(1),c()&&(T=s(),P=s(),b=s(),g=s());var E=[1,1];if(c()&&c()){var v=y();switch(v){case 1:E=[1,1];break;case 2:E=[12,11];break;case 3:E=[10,11];break;case 4:E=[16,11];break;case 5:E=[40,33];break;case 6:E=[24,11];break;case 7:E=[20,11];break;case 8:E=[32,11];break;case 9:E=[80,33];break;case 10:E=[18,11];break;case 11:E=[15,11];break;case 12:E=[64,33];break;case 13:E=[160,99];break;case 14:E=[4,3];break;case 15:E=[3,2];break;case 16:E=[2,1];break;case 255:{E=[y()<<8|y(),y()<<8|y()];break}}}return{width:Math.ceil((l+1)*16-T*2-P*2),height:(2-i)*(a+1)*16-(i?2:4)*(b+g),pixelRatio:E}},U.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},L}();G.default=O},"./src/demux/id3.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"isHeader",function(){return K}),R.d(G,"isFooter",function(){return O}),R.d(G,"getID3Data",function(){return L}),R.d(G,"canParse",function(){return I}),R.d(G,"getTimeStamp",function(){return T}),R.d(G,"isTimeStampFrame",function(){return P}),R.d(G,"getID3Frames",function(){return g}),R.d(G,"decodeFrame",function(){return k}),R.d(G,"utf8ArrayToStr",function(){return s}),R.d(G,"testables",function(){return c});var K=function(m,A){return A+10<=m.length&&(m[A]===73&&m[A+1]===68&&m[A+2]===51&&(m[A+3]<255&&m[A+4]<255&&(m[A+6]<128&&m[A+7]<128&&m[A+8]<128&&m[A+9]<128)))},O=function(m,A){return A+10<=m.length&&(m[A]===51&&m[A+1]===68&&m[A+2]===73&&(m[A+3]<255&&m[A+4]<255&&(m[A+6]<128&&m[A+7]<128&&m[A+8]<128&&m[A+9]<128)))},L=function(m,A){for(var x=A,u=0;K(m,A);){u+=10;var l=U(m,A+6);u+=l,O(m,A+10)&&(u+=10),A+=u}return u>0?m.subarray(x,x+u):void 0},U=function(m,A){var x=0;return x=(m[A]&127)<<21,x|=(m[A+1]&127)<<14,x|=(m[A+2]&127)<<7,x|=m[A+3]&127,x},I=function(m,A){return K(m,A)&&U(m,A+6)+10<=m.length-A},T=function(m){for(var A=g(m),x=0;x<A.length;x++){var u=A[x];if(P(u))return f(u)}return},P=function(m){return m&&m.key==="PRIV"&&m.info==="com.apple.streaming.transportStreamTimestamp"},b=function(m){var A=String.fromCharCode(m[0],m[1],m[2],m[3]),x=U(m,4),u=10;return{type:A,size:x,data:m.subarray(u,u+x)}},g=function(m){for(var A=0,x=[];K(m,A);){var u=U(m,A+6);A+=10;for(var l=A+u;A+8<l;){var a=b(m.subarray(A)),i=k(a);i&&x.push(i),A+=a.size+10}O(m,A)&&(A+=10)}return x},k=function(m){return m.type==="PRIV"?w(m):m.type[0]==="W"?y(m):p(m)},w=function(m){if(m.size<2)return;var A=s(m.data,!0),x=new Uint8Array(m.data.subarray(A.length+1));return{key:m.type,info:A,data:x.buffer}},p=function(m){if(m.size<2)return;if(m.type==="TXXX"){var A=1,x=s(m.data.subarray(A),!0);A+=x.length+1;var u=s(m.data.subarray(A));return{key:m.type,info:x,data:u}}var l=s(m.data.subarray(1));return{key:m.type,data:l}},y=function(m){if(m.type==="WXXX"){if(m.size<2)return;var A=1,x=s(m.data.subarray(A),!0);A+=x.length+1;var u=s(m.data.subarray(A));return{key:m.type,info:x,data:u}}var l=s(m.data);return{key:m.type,data:l}},f=function(m){if(m.data.byteLength===8){var A=new Uint8Array(m.data),x=A[3]&1,u=(A[4]<<23)+(A[5]<<15)+(A[6]<<7)+A[7];return u/=45,x&&(u+=4772185884e-2),Math.round(u)}return},s=function(m,A){A===void 0&&(A=!1);var x=S();if(x){var u=x.decode(m);if(A){var l=u.indexOf("\0");return l!==-1?u.substring(0,l):u}return u.replace(/\0/g,"")}for(var a=m.length,i,E,v,_="",D=0;D<a;){if(i=m[D++],i===0&&A)return _;if(i===0||i===3)continue;switch(i>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:_+=String.fromCharCode(i);break;case 12:case 13:E=m[D++],_+=String.fromCharCode((i&31)<<6|E&63);break;case 14:E=m[D++],v=m[D++],_+=String.fromCharCode((i&15)<<12|(E&63)<<6|(v&63)<<0);break;default:}}return _},c={decodeTextFrame:p},d;function S(){return!d&&typeof self.TextDecoder!="undefined"&&(d=new self.TextDecoder("utf-8")),d}},"./src/demux/mp3demuxer.ts":function(q,G,R){"use strict";R.r(G);var K=R("./src/demux/base-audio-demuxer.ts"),O=R("./src/demux/id3.ts"),L=R("./src/utils/logger.ts"),U=R("./src/demux/mpegaudio.ts");function I(b,g){b.prototype=Object.create(g.prototype),b.prototype.constructor=b,T(b,g)}function T(b,g){return T=Object.setPrototypeOf||function(w,p){return w.__proto__=p,w},T(b,g)}var P=function(b){I(g,b);function g(){return b.apply(this,arguments)||this}var k=g.prototype;return k.resetInitSegment=function(p,y,f){b.prototype.resetInitSegment.call(this,p,y,f),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:p,duration:f,inputTimeScale:9e4,dropped:0}},g.probe=function(p){if(!p)return!1;for(var y=O.getID3Data(p,0)||[],f=y.length,s=p.length;f<s;f++)if(U.probe(p,f))return L.logger.log("MPEG Audio sync word found !"),!0;return!1},k.canParse=function(p,y){return U.canParse(p,y)},k.appendFrame=function(p,y,f){return this.initPTS===null?void 0:U.appendFrame(p,y,f,this.initPTS,this.frameIndex)},g}(K.default);P.minProbeByteLength=4,G.default=P},"./src/demux/mp4demuxer.ts":function(q,G,R){"use strict";R.r(G);var K=R("./src/utils/mp4-tools.ts"),O=R("./src/demux/dummy-demuxed-track.ts"),L=function(){function U(T,P){this.remainderData=null,this.config=void 0,this.config=P}var I=U.prototype;return I.resetTimeStamp=function(){},I.resetInitSegment=function(){},I.resetContiguity=function(){},U.probe=function(P){return Object(K.findBox)({data:P,start:0,end:Math.min(P.length,16384)},["moof"]).length>0},I.demux=function(P){var b=P,g=Object(O.dummyTrack)();if(this.config.progressive){this.remainderData&&(b=Object(K.appendUint8Array)(this.remainderData,P));var k=Object(K.segmentValidRange)(b);this.remainderData=k.remainder,g.samples=k.valid||new Uint8Array}else g.samples=b;return{audioTrack:Object(O.dummyTrack)(),avcTrack:g,id3Track:Object(O.dummyTrack)(),textTrack:Object(O.dummyTrack)()}},I.flush=function(){var P=Object(O.dummyTrack)();return P.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(O.dummyTrack)(),avcTrack:P,id3Track:Object(O.dummyTrack)(),textTrack:Object(O.dummyTrack)()}},I.demuxSampleAes=function(P,b,g){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},I.destroy=function(){},U}();L.minProbeByteLength=1024,G.default=L},"./src/demux/mpegaudio.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"appendFrame",function(){return T}),R.d(G,"parseHeader",function(){return P}),R.d(G,"isHeaderPattern",function(){return b}),R.d(G,"isHeader",function(){return g}),R.d(G,"canParse",function(){return k}),R.d(G,"probe",function(){return w});var K=null,O=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],L=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],U=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],I=[0,1,1,4];function T(p,y,f,s,c){if(f+24>y.length)return;var d=P(y,f);if(d&&f+d.frameLength<=y.length){var S=d.samplesPerFrame*9e4/d.sampleRate,C=s+c*S,m={unit:y.subarray(f,f+d.frameLength),pts:C,dts:C};return p.config=[],p.channelCount=d.channelCount,p.samplerate=d.sampleRate,p.samples.push(m),{sample:m,length:d.frameLength,missing:0}}}function P(p,y){var f=p[y+1]>>3&3,s=p[y+1]>>1&3,c=p[y+2]>>4&15,d=p[y+2]>>2&3;if(f!==1&&c!==0&&c!==15&&d!==3){var S=p[y+2]>>1&1,C=p[y+3]>>6,m=f===3?3-s:s===3?3:4,A=O[m*14+c-1]*1e3,x=f===3?0:f===2?1:2,u=L[x*3+d],l=C===3?1:2,a=U[f][s],i=I[s],E=a*8*i,v=Math.floor(a*A/u+S)*i;if(K===null){var _=navigator.userAgent||"",D=_.match(/Chrome\/(\d+)/i);K=D?parseInt(D[1]):0}var B=!!K&&K<=87;return B&&s===2&&A>=224e3&&C===0&&(p[y+3]=p[y+3]|128),{sampleRate:u,channelCount:l,frameLength:v,samplesPerFrame:E}}}function b(p,y){return p[y]===255&&(p[y+1]&224)===224&&(p[y+1]&6)!==0}function g(p,y){return y+1<p.length&&b(p,y)}function k(p,y){var f=4;return b(p,y)&&f<=p.length-y}function w(p,y){if(y+1<p.length&&b(p,y)){var f=4,s=P(p,y),c=f;s!=null&&s.frameLength&&(c=s.frameLength);var d=y+c;return d===p.length||g(p,d)}return!1}},"./src/demux/sample-aes.ts":function(q,G,R){"use strict";R.r(G);var K=R("./src/crypt/decrypter.ts"),O=R("./src/demux/tsdemuxer.ts"),L=function(){function U(T,P,b){this.keyData=void 0,this.decrypter=void 0,this.keyData=b,this.decrypter=new K.default(T,P,{removePKCS7Padding:!1})}var I=U.prototype;return I.decryptBuffer=function(P,b){this.decrypter.decrypt(P,this.keyData.key.buffer,this.keyData.iv.buffer,b)},I.decryptAacSample=function(P,b,g,k){var w=P[b].unit,p=w.subarray(16,w.length-w.length%16),y=p.buffer.slice(p.byteOffset,p.byteOffset+p.length),f=this;this.decryptBuffer(y,function(s){var c=new Uint8Array(s);w.set(c,16),k||f.decryptAacSamples(P,b+1,g)})},I.decryptAacSamples=function(P,b,g){for(;;b++){if(b>=P.length){g();return}if(P[b].unit.length<32)continue;var k=this.decrypter.isSync();if(this.decryptAacSample(P,b,g,k),!k)return}},I.getAvcEncryptedData=function(P){for(var b=Math.floor((P.length-48)/160)*16+16,g=new Int8Array(b),k=0,w=32;w<=P.length-16;w+=160,k+=16)g.set(P.subarray(w,w+16),k);return g},I.getAvcDecryptedUnit=function(P,b){for(var g=new Uint8Array(b),k=0,w=32;w<=P.length-16;w+=160,k+=16)P.set(g.subarray(k,k+16),w);return P},I.decryptAvcSample=function(P,b,g,k,w,p){var y=Object(O.discardEPB)(w.data),f=this.getAvcEncryptedData(y),s=this;this.decryptBuffer(f.buffer,function(c){w.data=s.getAvcDecryptedUnit(y,c),p||s.decryptAvcSamples(P,b,g+1,k)})},I.decryptAvcSamples=function(P,b,g,k){if(P instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;b++,g=0){if(b>=P.length){k();return}for(var w=P[b].units;!(g>=w.length);g++){var p=w[g];if(p.data.length<=48||p.type!==1&&p.type!==5)continue;var y=this.decrypter.isSync();if(this.decryptAvcSample(P,b,g,k,p,y),!y)return}}},U}();G.default=L},"./src/demux/transmuxer-interface.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"default",function(){return w});var K=R("./node_modules/webworkify-webpack/index.js"),O=R.n(K),L=R("./src/events.ts"),U=R("./src/demux/transmuxer.ts"),I=R("./src/utils/logger.ts"),T=R("./src/errors.ts"),P=R("./src/utils/mediasource-helper.ts"),b=R("./node_modules/eventemitter3/index.js"),g=R.n(b),k=Object(P.getMediaSource)()||{isTypeSupported:function(){return!1}},w=function(){function p(f,s,c,d){var S=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=f,this.id=s,this.onTransmuxComplete=c,this.onFlush=d;var C=f.config,m=function(a,i){i=i||{},i.frag=S.frag,i.id=S.id,f.trigger(a,i)};this.observer=new b.EventEmitter,this.observer.on(L.Events.FRAG_DECRYPTED,m),this.observer.on(L.Events.ERROR,m);var A={mp4:k.isTypeSupported("video/mp4"),mpeg:k.isTypeSupported("audio/mpeg"),mp3:k.isTypeSupported('audio/mp4; codecs="mp3"')},x=navigator.vendor;if(C.enableWorker&&typeof Worker!="undefined"){I.logger.log("demuxing in webworker");var u;try{u=this.worker=K("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),u.addEventListener("message",this.onwmsg),u.onerror=function(l){f.trigger(L.Events.ERROR,{type:T.ErrorTypes.OTHER_ERROR,details:T.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(l.message+" ("+l.filename+":"+l.lineno+")")})},u.postMessage({cmd:"init",typeSupported:A,vendor:x,id:s,config:JSON.stringify(C)})}catch(l){I.logger.warn("Error in worker:",l),I.logger.error("Error while initializing DemuxerWorker, fallback to inline"),u&&self.URL.revokeObjectURL(u.objectURL),this.transmuxer=new U.default(this.observer,A,C,x,s),this.worker=null}}else this.transmuxer=new U.default(this.observer,A,C,x,s)}var y=p.prototype;return y.destroy=function(){var s=this.worker;if(s)s.removeEventListener("message",this.onwmsg),s.terminate(),this.worker=null;else{var c=this.transmuxer;c&&(c.destroy(),this.transmuxer=null)}var d=this.observer;d&&d.removeAllListeners(),this.observer=null},y.push=function(s,c,d,S,C,m,A,x,u,l){var a=this;u.transmuxing.start=self.performance.now();var i=this.transmuxer,E=this.worker,v=m?m.start:C.start,_=C.decryptdata,D=this.frag,B=!(D&&C.cc===D.cc),j=!(D&&u.level===D.level),W=D?u.sn-D.sn:-1,h=this.part?u.part-this.part.index:1,N=!j&&(W===1||W===0&&h===1),H=self.performance.now();(j||W||C.stats.parsing.start===0)&&(C.stats.parsing.start=H),m&&(h||!N)&&(m.stats.parsing.start=H);var X=new U.TransmuxState(B,N,x,j,v);if(!N||B){I.logger.log("[transmuxer-interface, "+C.type+"]: Starting new transmux session for sn: "+u.sn+" p: "+u.part+" level: "+u.level+" id: "+u.id+`
discontinuity: `+B+`
trackSwitch: `+j+`
contiguous: `+N+`
accurateTimeOffset: `+x+`
timeOffset: `+v);var Y=new U.TransmuxConfig(d,S,c,A,l);this.configureTransmuxer(Y)}if(this.frag=C,this.part=m,E)E.postMessage({cmd:"demux",data:s,decryptdata:_,chunkMeta:u,state:X},s instanceof ArrayBuffer?[s]:[]);else if(i){var re=i.push(s,_,u,X);Object(U.isPromise)(re)?re.then(function(he){a.handleTransmuxComplete(he)}):this.handleTransmuxComplete(re)}},y.flush=function(s){var c=this;s.transmuxing.start=self.performance.now();var d=this.transmuxer,S=this.worker;if(S)S.postMessage({cmd:"flush",chunkMeta:s});else if(d){var C=d.flush(s);Object(U.isPromise)(C)?C.then(function(m){c.handleFlushResult(m,s)}):this.handleFlushResult(C,s)}},y.handleFlushResult=function(s,c){var d=this;s.forEach(function(S){d.handleTransmuxComplete(S)}),this.onFlush(c)},y.onWorkerMessage=function(s){var c=s.data,d=this.hls;switch(c.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(c.data);break}case"flush":{this.onFlush(c.data);break}default:{c.data=c.data||{},c.data.frag=this.frag,c.data.id=this.id,d.trigger(c.event,c.data);break}}},y.configureTransmuxer=function(s){var c=this.worker,d=this.transmuxer;c?c.postMessage({cmd:"configure",config:s}):d&&d.configure(s)},y.handleTransmuxComplete=function(s){s.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(s)},p}()},"./src/demux/transmuxer-worker.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"default",function(){return T});var K=R("./src/demux/transmuxer.ts"),O=R("./src/events.ts"),L=R("./src/utils/logger.ts"),U=R("./node_modules/eventemitter3/index.js"),I=R.n(U);function T(w){var p=new U.EventEmitter,y=function(s,c){w.postMessage({event:s,data:c})};p.on(O.Events.FRAG_DECRYPTED,y),p.on(O.Events.ERROR,y),w.addEventListener("message",function(f){var s=f.data;switch(s.cmd){case"init":{var c=JSON.parse(s.config);w.transmuxer=new K.default(p,s.typeSupported,c,s.vendor,s.id),Object(L.enableLogs)(c.debug),y("init",null);break}case"configure":{w.transmuxer.configure(s.config);break}case"demux":{var d=w.transmuxer.push(s.data,s.decryptdata,s.chunkMeta,s.state);Object(K.isPromise)(d)?d.then(function(m){P(w,m)}):P(w,d);break}case"flush":{var S=s.chunkMeta,C=w.transmuxer.flush(S);Object(K.isPromise)(C)?C.then(function(m){g(w,m,S)}):g(w,C,S);break}default:break}})}function P(w,p){if(k(p.remuxResult))return;var y=[],f=p.remuxResult,s=f.audio,c=f.video;s&&b(y,s),c&&b(y,c),w.postMessage({event:"transmuxComplete",data:p},y)}function b(w,p){p.data1&&w.push(p.data1.buffer),p.data2&&w.push(p.data2.buffer)}function g(w,p,y){p.forEach(function(f){P(w,f)}),w.postMessage({event:"flush",data:y})}function k(w){return!w.audio&&!w.video&&!w.text&&!w.id3&&!w.initSegment}},"./src/demux/transmuxer.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"default",function(){return c}),R.d(G,"isPromise",function(){return C}),R.d(G,"TransmuxConfig",function(){return m}),R.d(G,"TransmuxState",function(){return A});var K=R("./src/events.ts"),O=R("./src/errors.ts"),L=R("./src/crypt/decrypter.ts"),U=R("./src/demux/aacdemuxer.ts"),I=R("./src/demux/mp4demuxer.ts"),T=R("./src/demux/tsdemuxer.ts"),P=R("./src/demux/mp3demuxer.ts"),b=R("./src/remux/mp4-remuxer.ts"),g=R("./src/remux/passthrough-remuxer.ts"),k=R("./src/demux/chunk-cache.ts"),w=R("./src/utils/mp4-tools.ts"),p=R("./src/utils/logger.ts"),y;try{y=self.performance.now.bind(self.performance)}catch(x){p.logger.debug("Unable to use Performance API on this environment"),y=self.Date.now}var f=[{demux:T.default,remux:b.default},{demux:I.default,remux:g.default},{demux:U.default,remux:b.default},{demux:P.default,remux:b.default}],s=1024;f.forEach(function(x){var u=x.demux;s=Math.max(s,u.minProbeByteLength)});var c=function(){function x(l,a,i,E,v){this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.cache=new k.default,this.observer=l,this.typeSupported=a,this.config=i,this.vendor=E,this.id=v}var u=x.prototype;return u.configure=function(a){this.transmuxConfig=a,this.decrypter&&this.decrypter.reset()},u.push=function(a,i,E,v){var _=this,D=E.transmuxing;D.executeStart=y();var B=new Uint8Array(a),j=this.cache,W=this.config,h=this.currentTransmuxState,N=this.transmuxConfig;v&&(this.currentTransmuxState=v);var H=d(B,i);if(H&&H.method==="AES-128"){var X=this.getDecrypter();if(W.enableSoftwareAES){var Y=X.softwareDecrypt(B,H.key.buffer,H.iv.buffer);if(!Y)return D.executeEnd=y(),S(E);B=new Uint8Array(Y)}else return this.decryptionPromise=X.webCryptoDecrypt(B,H.key.buffer,H.iv.buffer).then(function(Le){var Ve=_.push(Le,null,E);return _.decryptionPromise=null,Ve}),this.decryptionPromise}var re=v||h,he=re.contiguous,de=re.discontinuity,ne=re.trackSwitch,ae=re.accurateTimeOffset,le=re.timeOffset,ee=N.audioCodec,ie=N.videoCodec,ve=N.defaultInitPts,Pe=N.duration,Ie=N.initSegmentData;if((de||ne)&&this.resetInitSegment(Ie,ee,ie,Pe),de&&this.resetInitialTimestamp(ve),he||this.resetContiguity(),this.needsProbing(B,de,ne)){if(j.dataLength){var we=j.flush();B=Object(w.appendUint8Array)(we,B)}this.configureTransmuxer(B,N)}var ke=this.transmux(B,H,le,ae,E),De=this.currentTransmuxState;return De.contiguous=!0,De.discontinuity=!1,De.trackSwitch=!1,D.executeEnd=y(),ke},u.flush=function(a){var i=this,E=a.transmuxing;E.executeStart=y();var v=this.decrypter,_=this.cache,D=this.currentTransmuxState,B=this.decryptionPromise;if(B)return B.then(function(){return i.flush(a)});var j=[],W=D.timeOffset;if(v){var h=v.flush();h&&j.push(this.push(h,null,a))}var N=_.dataLength;_.reset();var H=this.demuxer,X=this.remuxer;if(!H||!X)return N>=s&&this.observer.emit(K.Events.ERROR,K.Events.ERROR,{type:O.ErrorTypes.MEDIA_ERROR,details:O.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),E.executeEnd=y(),[S(a)];var Y=H.flush(W);return C(Y)?Y.then(function(re){return i.flushRemux(j,re,a),j}):(this.flushRemux(j,Y,a),j)},u.flushRemux=function(a,i,E){var v=i.audioTrack,_=i.avcTrack,D=i.id3Track,B=i.textTrack,j=this.currentTransmuxState,W=j.accurateTimeOffset,h=j.timeOffset;p.logger.log("[transmuxer.ts]: Flushed fragment "+E.sn+(E.part>-1?" p: "+E.part:"")+" of level "+E.level);var N=this.remuxer.remux(v,_,D,B,h,W,!0,this.id);a.push({remuxResult:N,chunkMeta:E}),E.transmuxing.executeEnd=y()},u.resetInitialTimestamp=function(a){var i=this.demuxer,E=this.remuxer;if(!i||!E)return;i.resetTimeStamp(a),E.resetTimeStamp(a)},u.resetContiguity=function(){var a=this.demuxer,i=this.remuxer;if(!a||!i)return;a.resetContiguity(),i.resetNextTimestamp()},u.resetInitSegment=function(a,i,E,v){var _=this.demuxer,D=this.remuxer;if(!_||!D)return;_.resetInitSegment(i,E,v),D.resetInitSegment(a,i,E)},u.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},u.transmux=function(a,i,E,v,_){var D;return i&&i.method==="SAMPLE-AES"?D=this.transmuxSampleAes(a,i,E,v,_):D=this.transmuxUnencrypted(a,E,v,_),D},u.transmuxUnencrypted=function(a,i,E,v){var _=this.demuxer.demux(a,i,!1,!this.config.progressive),D=_.audioTrack,B=_.avcTrack,j=_.id3Track,W=_.textTrack,h=this.remuxer.remux(D,B,j,W,i,E,!1,this.id);return{remuxResult:h,chunkMeta:v}},u.transmuxSampleAes=function(a,i,E,v,_){var D=this;return this.demuxer.demuxSampleAes(a,i,E).then(function(B){var j=D.remuxer.remux(B.audioTrack,B.avcTrack,B.id3Track,B.textTrack,E,v,!1,D.id);return{remuxResult:j,chunkMeta:_}})},u.configureTransmuxer=function(a,i){for(var E=this.config,v=this.observer,_=this.typeSupported,D=this.vendor,B=i.audioCodec,j=i.defaultInitPts,W=i.duration,h=i.initSegmentData,N=i.videoCodec,H,X=0,Y=f.length;X<Y;X++)if(f[X].demux.probe(a)){H=f[X];break}H||(p.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),H={demux:I.default,remux:g.default});var re=this.demuxer,he=this.remuxer,de=H.remux,ne=H.demux;(!he||!(he instanceof de))&&(this.remuxer=new de(v,E,_,D)),(!re||!(re instanceof ne))&&(this.demuxer=new ne(v,E,_),this.probe=ne.probe),this.resetInitSegment(h,B,N,W),this.resetInitialTimestamp(j)},u.needsProbing=function(a,i,E){return!this.demuxer||!this.remuxer||i||E},u.getDecrypter=function(){var a=this.decrypter;return a||(a=this.decrypter=new L.default(this.observer,this.config)),a},x}();function d(x,u){var l=null;return x.byteLength>0&&u!=null&&u.key!=null&&u.iv!==null&&u.method!=null&&(l=u),l}var S=function(u){return{remuxResult:{},chunkMeta:u}};function C(x){return"then"in x&&x.then instanceof Function}var m=function(u,l,a,i,E){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=u,this.videoCodec=l,this.initSegmentData=a,this.duration=i,this.defaultInitPts=E},A=function(u,l,a,i,E){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=u,this.contiguous=l,this.accurateTimeOffset=a,this.trackSwitch=i,this.timeOffset=E}},"./src/demux/tsdemuxer.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"discardEPB",function(){return S});var K=R("./src/demux/adts.ts"),O=R("./src/demux/mpegaudio.ts"),L=R("./src/demux/exp-golomb.ts"),U=R("./src/demux/id3.ts"),I=R("./src/demux/sample-aes.ts"),T=R("./src/events.ts"),P=R("./src/utils/mp4-tools.ts"),b=R("./src/utils/logger.ts"),g=R("./src/errors.ts"),k={video:1,audio:2,id3:3,text:4},w=function(){function C(A,x,u){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=A,this.config=x,this.typeSupported=u}C.probe=function(x){var u=C.syncOffset(x);return u<0?!1:(u&&b.logger.warn("MPEG2-TS detected but first sync word found @ offset "+u+", junk ahead ?"),!0)},C.syncOffset=function(x){for(var u=Math.min(1e3,x.length-3*188),l=0;l<u;){if(x[l]===71&&x[l+188]===71&&x[l+2*188]===71)return l;l++}return-1},C.createTrack=function(x,u){return{container:x==="video"||x==="audio"?"video/mp2t":void 0,type:x,id:k[x],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:x==="audio"?u:void 0}};var m=C.prototype;return m.resetInitSegment=function(x,u,l){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=C.createTrack("video",l),this._audioTrack=C.createTrack("audio",l),this._id3Track=C.createTrack("id3",l),this._txtTrack=C.createTrack("text",l),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=x,this.videoCodec=u,this._duration=l},m.resetTimeStamp=function(){},m.resetContiguity=function(){var x=this._audioTrack,u=this._avcTrack,l=this._id3Track;x&&(x.pesData=null),u&&(u.pesData=null),l&&(l.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},m.demux=function(x,u,l,a){l===void 0&&(l=!1),a===void 0&&(a=!1),l||(this.sampleAes=null);var i,E=this._avcTrack,v=this._audioTrack,_=this._id3Track,D=E.pid,B=E.pesData,j=v.pid,W=_.pid,h=v.pesData,N=_.pesData,H=!1,X=this.pmtParsed,Y=this._pmtId,re=x.length;if(this.remainderData&&(x=Object(P.appendUint8Array)(this.remainderData,x),re=x.length,this.remainderData=null),re<188&&!a)return this.remainderData=x,{audioTrack:v,avcTrack:E,id3Track:_,textTrack:this._txtTrack};var he=Math.max(0,C.syncOffset(x));re-=(re+he)%188,re<x.byteLength&&!a&&(this.remainderData=new Uint8Array(x.buffer,re,x.buffer.byteLength-re));for(var de=he;de<re;de+=188)if(x[de]===71){var ne=!!(x[de+1]&64),ae=((x[de+1]&31)<<8)+x[de+2],le=(x[de+3]&48)>>4,ee=void 0;if(le>1){if(ee=de+5+x[de+4],ee===de+188)continue}else ee=de+4;switch(ae){case D:ne&&(B&&(i=s(B))&&this.parseAVCPES(i,!1),B={data:[],size:0}),B&&(B.data.push(x.subarray(ee,de+188)),B.size+=de+188-ee);break;case j:ne&&(h&&(i=s(h))&&(v.isAAC?this.parseAACPES(i):this.parseMPEGPES(i)),h={data:[],size:0}),h&&(h.data.push(x.subarray(ee,de+188)),h.size+=de+188-ee);break;case W:ne&&(N&&(i=s(N))&&this.parseID3PES(i),N={data:[],size:0}),N&&(N.data.push(x.subarray(ee,de+188)),N.size+=de+188-ee);break;case 0:ne&&(ee+=x[ee]+1),Y=this._pmtId=y(x,ee);break;case Y:{ne&&(ee+=x[ee]+1);var ie=f(x,ee,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,l);D=ie.avc,D>0&&(E.pid=D),j=ie.audio,j>0&&(v.pid=j,v.isAAC=ie.isAAC),W=ie.id3,W>0&&(_.pid=W),H&&!X&&(b.logger.log("reparse from beginning"),H=!1,de=he-188),X=this.pmtParsed=!0;break}case 17:case 8191:break;default:H=!0;break}}else this.observer.emit(T.Events.ERROR,T.Events.ERROR,{type:g.ErrorTypes.MEDIA_ERROR,details:g.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});E.pesData=B,v.pesData=h,_.pesData=N;var ve={audioTrack:v,avcTrack:E,id3Track:_,textTrack:this._txtTrack};return a&&this.extractRemainingSamples(ve),ve},m.flush=function(){var x=this.remainderData;this.remainderData=null;var u;return x?u=this.demux(x,-1,!1,!0):u={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(u),this.sampleAes?this.decrypt(u,this.sampleAes):u},m.extractRemainingSamples=function(x){var u=x.audioTrack,l=x.avcTrack,a=x.id3Track,i=l.pesData,E=u.pesData,v=a.pesData,_;i&&(_=s(i))?(this.parseAVCPES(_,!0),l.pesData=null):l.pesData=i,E&&(_=s(E))?(u.isAAC?this.parseAACPES(_):this.parseMPEGPES(_),u.pesData=null):(E!=null&&E.size&&b.logger.log("last AAC PES packet truncated,might overlap between fragments"),u.pesData=E),v&&(_=s(v))?(this.parseID3PES(_),a.pesData=null):a.pesData=v},m.demuxSampleAes=function(x,u,l){var a=this.demux(x,l,!0,!this.config.progressive),i=this.sampleAes=new I.default(this.observer,this.config,u);return this.decrypt(a,i)},m.decrypt=function(x,u){return new Promise(function(l){var a=x.audioTrack,i=x.avcTrack;a.samples&&a.isAAC?u.decryptAacSamples(a.samples,0,function(){i.samples?u.decryptAvcSamples(i.samples,0,0,function(){l(x)}):l(x)}):i.samples&&u.decryptAvcSamples(i.samples,0,0,function(){l(x)})})},m.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},m.parseAVCPES=function(x,u){var l=this,a=this._avcTrack,i=this.parseAVCNALu(x.data),E=!1,v=this.avcSample,_,D=!1;x.data=null,v&&i.length&&!a.audFound&&(c(v,a),v=this.avcSample=p(!1,x.pts,x.dts,"")),i.forEach(function(B){switch(B.type){case 1:{_=!0,v||(v=l.avcSample=p(!0,x.pts,x.dts,"")),E&&(v.debug+="NDR "),v.frame=!0;var j=B.data;if(D&&j.length>4){var W=new L.default(j).readSliceType();(W===2||W===4||W===7||W===9)&&(v.key=!0)}break}case 5:_=!0,v||(v=l.avcSample=p(!0,x.pts,x.dts,"")),E&&(v.debug+="IDR "),v.key=!0,v.frame=!0;break;case 6:{_=!0,E&&v&&(v.debug+="SEI ");var h=new L.default(S(B.data));h.readUByte();for(var N=0,H=0,X=!1,Y=0;!X&&h.bytesAvailable>1;){N=0;do Y=h.readUByte(),N+=Y;while(Y===255);H=0;do Y=h.readUByte(),H+=Y;while(Y===255);if(N===4&&h.bytesAvailable!==0){X=!0;var re=h.readUByte();if(re===181){var he=h.readUShort();if(he===49){var de=h.readUInt();if(de===1195456820){var ne=h.readUByte();if(ne===3){for(var ae=h.readUByte(),le=h.readUByte(),ee=31&ae,ie=[ae,le],ve=0;ve<ee;ve++)ie.push(h.readUByte()),ie.push(h.readUByte()),ie.push(h.readUByte());d(l._txtTrack.samples,{type:3,pts:x.pts,bytes:ie})}}}}}else if(N===5&&h.bytesAvailable!==0){if(X=!0,H>16){for(var Pe=[],Ie=0;Ie<16;Ie++)Pe.push(h.readUByte().toString(16)),(Ie===3||Ie===5||Ie===7||Ie===9)&&Pe.push("-");for(var we=H-16,ke=new Uint8Array(we),De=0;De<we;De++)ke[De]=h.readUByte();d(l._txtTrack.samples,{pts:x.pts,payloadType:N,uuid:Pe.join(""),userData:Object(U.utf8ArrayToStr)(ke),userDataBytes:ke})}}else if(H<h.bytesAvailable)for(var Le=0;Le<H;Le++)h.readUByte()}break}case 7:if(_=!0,D=!0,E&&v&&(v.debug+="SPS "),!a.sps){var Ve=new L.default(B.data),ze=Ve.readSPS();a.width=ze.width,a.height=ze.height,a.pixelRatio=ze.pixelRatio,a.sps=[B.data],a.duration=l._duration;for(var Je=B.data.subarray(1,4),Ye="avc1.",Ge=0;Ge<3;Ge++){var ht=Je[Ge].toString(16);ht.length<2&&(ht="0"+ht),Ye+=ht}a.codec=Ye}break;case 8:_=!0,E&&v&&(v.debug+="PPS "),a.pps||(a.pps=[B.data]);break;case 9:_=!1,a.audFound=!0,v&&c(v,a),v=l.avcSample=p(!1,x.pts,x.dts,E?"AUD ":"");break;case 12:_=!1;break;default:_=!1,v&&(v.debug+="unknown NAL "+B.type+" ");break}if(v&&_){var ot=v.units;ot.push(B)}}),u&&v&&(c(v,a),this.avcSample=null)},m.getLastNalUnit=function(){var x,u=this.avcSample,l;if(!u||u.units.length===0){var a=this._avcTrack.samples;u=a[a.length-1]}if((x=u)!==null&&x!==void 0&&x.units){var i=u.units;l=i[i.length-1]}return l},m.parseAVCNALu=function(x){var u=x.byteLength,l=this._avcTrack,a=l.naluState||0,i=a,E=[],v=0,_,D,B,j=-1,W=0;for(a===-1&&(j=0,W=x[0]&31,a=0,v=1);v<u;){if(_=x[v++],!a){a=_?0:1;continue}if(a===1){a=_?0:2;continue}if(!_)a=3;else if(_===1){if(j>=0){var h={data:x.subarray(j,v-a-1),type:W};E.push(h)}else{var N=this.getLastNalUnit();if(N&&(i&&v<=4-i&&(N.state&&(N.data=N.data.subarray(0,N.data.byteLength-i))),D=v-a-1,D>0)){var H=new Uint8Array(N.data.byteLength+D);H.set(N.data,0),H.set(x.subarray(0,D),N.data.byteLength),N.data=H,N.state=0}}v<u?(B=x[v]&31,j=v,W=B,a=0):a=-1}else a=0}if(j>=0&&a>=0){var X={data:x.subarray(j,u),type:W,state:a};E.push(X)}if(E.length===0){var Y=this.getLastNalUnit();if(Y){var re=new Uint8Array(Y.data.byteLength+x.byteLength);re.set(Y.data,0),re.set(x,Y.data.byteLength),Y.data=re}}return l.naluState=a,E},m.parseAACPES=function(x){var u=0,l=this._audioTrack,a=this.aacOverFlow,i=x.data;if(a){this.aacOverFlow=null;var E=a.sample.unit.byteLength,v=Math.min(a.missing,E),_=E-v;a.sample.unit.set(i.subarray(0,v),_),l.samples.push(a.sample),u=a.missing}var D,B;for(D=u,B=i.length;D<B-1&&!K.isHeader(i,D);D++);if(D!==u){var j,W;if(D<B-1?(j="AAC PES did not start with ADTS header,offset:"+D,W=!1):(j="no ADTS header found in AAC PES",W=!0),b.logger.warn("parsing error:"+j),this.observer.emit(T.Events.ERROR,T.Events.ERROR,{type:g.ErrorTypes.MEDIA_ERROR,details:g.ErrorDetails.FRAG_PARSING_ERROR,fatal:W,reason:j}),W)return}K.initTrackConfig(l,this.observer,i,D,this.audioCodec);var h;if(x.pts!==void 0)h=x.pts;else if(a){var N=K.getFrameDuration(l.samplerate);h=a.sample.pts+N}else{b.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var H=0;D<B;)if(K.isHeader(i,D)){if(D+5<B){var X=K.appendFrame(l,i,D,h,H);if(X)if(X.missing)this.aacOverFlow=X;else{D+=X.length,H++;continue}}break}else D++},m.parseMPEGPES=function(x){var u=x.data,l=u.length,a=0,i=0,E=x.pts;if(E===void 0){b.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;i<l;)if(O.isHeader(u,i)){var v=O.appendFrame(this._audioTrack,u,i,E,a);if(v)i+=v.length,a++;else break}else i++},m.parseID3PES=function(x){if(x.pts===void 0){b.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(x)},C}();w.minProbeByteLength=188;function p(C,m,A,x){return{key:C,frame:!1,pts:m,dts:A,units:[],debug:x,length:0}}function y(C,m){return(C[m+10]&31)<<8|C[m+11]}function f(C,m,A,x){var u={audio:-1,avc:-1,id3:-1,isAAC:!0},l=(C[m+1]&15)<<8|C[m+2],a=m+3+l-4,i=(C[m+10]&15)<<8|C[m+11];for(m+=12+i;m<a;){var E=(C[m+1]&31)<<8|C[m+2];switch(C[m]){case 207:if(!x){b.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:u.audio===-1&&(u.audio=E);break;case 21:u.id3===-1&&(u.id3=E);break;case 219:if(!x){b.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:u.avc===-1&&(u.avc=E);break;case 3:case 4:A?u.audio===-1&&(u.audio=E,u.isAAC=!1):b.logger.log("MPEG audio found, not supported in this browser");break;case 36:b.logger.warn("Unsupported HEVC stream type found");break;default:break}m+=((C[m+3]&15)<<8|C[m+4])+5}return u}function s(C){var m=0,A,x,u,l,a,i=C.data;if(!C||C.size===0)return null;for(;i[0].length<19&&i.length>1;){var E=new Uint8Array(i[0].length+i[1].length);E.set(i[0]),E.set(i[1],i[0].length),i[0]=E,i.splice(1,1)}A=i[0];var v=(A[0]<<16)+(A[1]<<8)+A[2];if(v===1){if(x=(A[4]<<8)+A[5],x&&x>C.size-6)return null;var _=A[7];_&192&&(l=(A[9]&14)*536870912+(A[10]&255)*4194304+(A[11]&254)*16384+(A[12]&255)*128+(A[13]&254)/2,_&64?(a=(A[14]&14)*536870912+(A[15]&255)*4194304+(A[16]&254)*16384+(A[17]&255)*128+(A[18]&254)/2,l-a>60*9e4&&(b.logger.warn(Math.round((l-a)/9e4)+"s delta between PTS and DTS, align them"),l=a)):a=l),u=A[8];var D=u+9;if(C.size<=D)return null;C.size-=D;for(var B=new Uint8Array(C.size),j=0,W=i.length;j<W;j++){A=i[j];var h=A.byteLength;if(D)if(D>h){D-=h;continue}else A=A.subarray(D),h-=D,D=0;B.set(A,m),m+=h}return x&&(x-=u+3),{data:B,pts:l,dts:a,len:x}}return null}function c(C,m){if(C.units.length&&C.frame){if(C.pts===void 0){var A=m.samples,x=A.length;if(x){var u=A[x-1];C.pts=u.pts,C.dts=u.dts}else{m.dropped++;return}}m.samples.push(C)}C.debug.length&&b.logger.log(C.pts+"/"+C.dts+":"+C.debug)}function d(C,m){var A=C.length;if(A>0){if(m.pts>=C[A-1].pts)C.push(m);else for(var x=A-1;x>=0;x--)if(m.pts<C[x].pts){C.splice(x,0,m);break}}else C.push(m)}function S(C){for(var m=C.byteLength,A=[],x=1;x<m-2;)C[x]===0&&C[x+1]===0&&C[x+2]===3?(A.push(x+2),x+=2):x++;if(A.length===0)return C;var u=m-A.length,l=new Uint8Array(u),a=0;for(x=0;x<u;a++,x++)a===A[0]&&(a++,A.shift()),l[x]=C[a];return l}G.default=w},"./src/errors.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"ErrorTypes",function(){return K}),R.d(G,"ErrorDetails",function(){return O});var K;(function(L){L.NETWORK_ERROR="networkError",L.MEDIA_ERROR="mediaError",L.KEY_SYSTEM_ERROR="keySystemError",L.MUX_ERROR="muxError",L.OTHER_ERROR="otherError"})(K||(K={}));var O;(function(L){L.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",L.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",L.KEY_SYSTEM_NO_SESSION="keySystemNoSession",L.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",L.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",L.MANIFEST_LOAD_ERROR="manifestLoadError",L.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",L.MANIFEST_PARSING_ERROR="manifestParsingError",L.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",L.LEVEL_EMPTY_ERROR="levelEmptyError",L.LEVEL_LOAD_ERROR="levelLoadError",L.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",L.LEVEL_SWITCH_ERROR="levelSwitchError",L.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",L.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",L.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",L.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",L.FRAG_LOAD_ERROR="fragLoadError",L.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",L.FRAG_DECRYPT_ERROR="fragDecryptError",L.FRAG_PARSING_ERROR="fragParsingError",L.REMUX_ALLOC_ERROR="remuxAllocError",L.KEY_LOAD_ERROR="keyLoadError",L.KEY_LOAD_TIMEOUT="keyLoadTimeOut",L.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",L.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",L.BUFFER_APPEND_ERROR="bufferAppendError",L.BUFFER_APPENDING_ERROR="bufferAppendingError",L.BUFFER_STALLED_ERROR="bufferStalledError",L.BUFFER_FULL_ERROR="bufferFullError",L.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",L.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",L.INTERNAL_EXCEPTION="internalException",L.INTERNAL_ABORTED="aborted",L.UNKNOWN="unknown"})(O||(O={}))},"./src/events.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"Events",function(){return K});var K;(function(O){O.MEDIA_ATTACHING="hlsMediaAttaching",O.MEDIA_ATTACHED="hlsMediaAttached",O.MEDIA_DETACHING="hlsMediaDetaching",O.MEDIA_DETACHED="hlsMediaDetached",O.BUFFER_RESET="hlsBufferReset",O.BUFFER_CODECS="hlsBufferCodecs",O.BUFFER_CREATED="hlsBufferCreated",O.BUFFER_APPENDING="hlsBufferAppending",O.BUFFER_APPENDED="hlsBufferAppended",O.BUFFER_EOS="hlsBufferEos",O.BUFFER_FLUSHING="hlsBufferFlushing",O.BUFFER_FLUSHED="hlsBufferFlushed",O.MANIFEST_LOADING="hlsManifestLoading",O.MANIFEST_LOADED="hlsManifestLoaded",O.MANIFEST_PARSED="hlsManifestParsed",O.LEVEL_SWITCHING="hlsLevelSwitching",O.LEVEL_SWITCHED="hlsLevelSwitched",O.LEVEL_LOADING="hlsLevelLoading",O.LEVEL_LOADED="hlsLevelLoaded",O.LEVEL_UPDATED="hlsLevelUpdated",O.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",O.LEVELS_UPDATED="hlsLevelsUpdated",O.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",O.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",O.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",O.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",O.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",O.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",O.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",O.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",O.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",O.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",O.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",O.CUES_PARSED="hlsCuesParsed",O.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",O.INIT_PTS_FOUND="hlsInitPtsFound",O.FRAG_LOADING="hlsFragLoading",O.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",O.FRAG_LOADED="hlsFragLoaded",O.FRAG_DECRYPTED="hlsFragDecrypted",O.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",O.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",O.FRAG_PARSING_METADATA="hlsFragParsingMetadata",O.FRAG_PARSED="hlsFragParsed",O.FRAG_BUFFERED="hlsFragBuffered",O.FRAG_CHANGED="hlsFragChanged",O.FPS_DROP="hlsFpsDrop",O.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",O.ERROR="hlsError",O.DESTROYING="hlsDestroying",O.KEY_LOADING="hlsKeyLoading",O.KEY_LOADED="hlsKeyLoaded",O.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",O.BACK_BUFFER_REACHED="hlsBackBufferReached"})(K||(K={}))},"./src/hls.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"default",function(){return C});var K=R("./node_modules/url-toolkit/src/url-toolkit.js"),O=R.n(K),L=R("./src/loader/playlist-loader.ts"),U=R("./src/loader/key-loader.ts"),I=R("./src/controller/id3-track-controller.ts"),T=R("./src/controller/latency-controller.ts"),P=R("./src/controller/level-controller.ts"),b=R("./src/controller/fragment-tracker.ts"),g=R("./src/controller/stream-controller.ts"),k=R("./src/is-supported.ts"),w=R("./src/utils/logger.ts"),p=R("./src/config.ts"),y=R("./node_modules/eventemitter3/index.js"),f=R.n(y),s=R("./src/events.ts"),c=R("./src/errors.ts");function d(m,A){for(var x=0;x<A.length;x++){var u=A[x];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(m,u.key,u)}}function S(m,A,x){return A&&d(m.prototype,A),x&&d(m,x),m}var C=function(){m.isSupported=function(){return Object(k.isSupported)()};function m(x){x===void 0&&(x={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new y.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 u=this.config=Object(p.mergeConfig)(m.DefaultConfig,x);this.userConfig=x,Object(w.enableLogs)(u.debug),this._autoLevelCapping=-1,u.progressive&&Object(p.enableStreamingMode)(u);var l=u.abrController,a=u.bufferController,i=u.capLevelController,E=u.fpsController,v=this.abrController=new l(this),_=this.bufferController=new a(this),D=this.capLevelController=new i(this),B=new E(this),j=new L.default(this),W=new U.default(this),h=new I.default(this),N=this.levelController=new P.default(this),H=new b.FragmentTracker(this),X=this.streamController=new g.default(this,H);D.setStreamController(X),B.setStreamController(X);var Y=[N,X];this.networkControllers=Y;var re=[j,W,v,_,D,B,h,H];this.audioTrackController=this.createController(u.audioTrackController,null,Y),this.createController(u.audioStreamController,H,Y),this.subtitleTrackController=this.createController(u.subtitleTrackController,null,Y),this.createController(u.subtitleStreamController,H,Y),this.createController(u.timelineController,null,re),this.emeController=this.createController(u.emeController,null,re),this.cmcdController=this.createController(u.cmcdController,null,re),this.latencyController=this.createController(T.default,null,re),this.coreComponents=re}var A=m.prototype;return A.createController=function(u,l,a){if(u){var i=l?new u(this,l):new u(this);return a&&a.push(i),i}return null},A.on=function(u,l,a){a===void 0&&(a=this),this._emitter.on(u,l,a)},A.once=function(u,l,a){a===void 0&&(a=this),this._emitter.once(u,l,a)},A.removeAllListeners=function(u){this._emitter.removeAllListeners(u)},A.off=function(u,l,a,i){a===void 0&&(a=this),this._emitter.off(u,l,a,i)},A.listeners=function(u){return this._emitter.listeners(u)},A.emit=function(u,l,a){return this._emitter.emit(u,l,a)},A.trigger=function(u,l){if(this.config.debug)return this.emit(u,u,l);try{return this.emit(u,u,l)}catch(a){w.logger.error("An internal error happened while handling event "+u+'. Error message: "'+a.message+'". Here is a stacktrace:',a),this.trigger(s.Events.ERROR,{type:c.ErrorTypes.OTHER_ERROR,details:c.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:u,error:a})}return!1},A.listenerCount=function(u){return this._emitter.listenerCount(u)},A.destroy=function(){w.logger.log("destroy"),this.trigger(s.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(u){return u.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(u){return u.destroy()}),this.coreComponents.length=0},A.attachMedia=function(u){w.logger.log("attachMedia"),this._media=u,this.trigger(s.Events.MEDIA_ATTACHING,{media:u})},A.detachMedia=function(){w.logger.log("detachMedia"),this.trigger(s.Events.MEDIA_DETACHING,void 0),this._media=null},A.loadSource=function(u){this.stopLoad();var l=this.media,a=this.url,i=this.url=K.buildAbsoluteURL(self.location.href,u,{alwaysNormalize:!0});w.logger.log("loadSource:"+i),l&&a&&a!==i&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(l)),this.trigger(s.Events.MANIFEST_LOADING,{url:u})},A.startLoad=function(u){u===void 0&&(u=-1),w.logger.log("startLoad("+u+")"),this.networkControllers.forEach(function(l){l.startLoad(u)})},A.stopLoad=function(){w.logger.log("stopLoad"),this.networkControllers.forEach(function(u){u.stopLoad()})},A.swapAudioCodec=function(){w.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},A.recoverMediaError=function(){w.logger.log("recoverMediaError");var u=this._media;this.detachMedia(),u&&this.attachMedia(u)},A.removeLevel=function(u,l){l===void 0&&(l=0),this.levelController.removeLevel(u,l)},S(m,[{key:"levels",get:function(){var u=this.levelController.levels;return u||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(u){w.logger.log("set currentLevel:"+u),this.loadLevel=u,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(u){w.logger.log("set nextLevel:"+u),this.levelController.manualLevel=u,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(u){w.logger.log("set loadLevel:"+u),this.levelController.manualLevel=u}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(u){this.levelController.nextLoadLevel=u}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(u){w.logger.log("set firstLevel:"+u),this.levelController.firstLevel=u}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(u){w.logger.log("set startLevel:"+u),u!==-1&&(u=Math.max(u,this.minAutoLevel)),this.levelController.startLevel=u}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(u){var l=!!u;l!==this.config.capLevelToPlayerSize&&(l?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=l)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(u){this._autoLevelCapping!==u&&(w.logger.log("set autoLevelCapping:"+u),this._autoLevelCapping=u)}},{key:"bandwidthEstimate",get:function(){var u=this.abrController.bwEstimator;return u?u.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var u=this.levels,l=this.config.minAutoBitrate;if(!u)return 0;for(var a=u.length,i=0;i<a;i++)if(u[i].maxBitrate>l)return i;return 0}},{key:"maxAutoLevel",get:function(){var u=this.levels,l=this.autoLevelCapping,a;return l===-1&&u&&u.length?a=u.length-1:a=l,a}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(u){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,u)}},{key:"audioTracks",get:function(){var u=this.audioTrackController;return u?u.audioTracks:[]}},{key:"audioTrack",get:function(){var u=this.audioTrackController;return u?u.audioTrack:-1},set:function(u){var l=this.audioTrackController;l&&(l.audioTrack=u)}},{key:"subtitleTracks",get:function(){var u=this.subtitleTrackController;return u?u.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var u=this.subtitleTrackController;return u?u.subtitleTrack:-1},set:function(u){var l=this.subtitleTrackController;l&&(l.subtitleTrack=u)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var u=this.subtitleTrackController;return u?u.subtitleDisplay:!1},set:function(u){var l=this.subtitleTrackController;l&&(l.subtitleDisplay=u)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(u){this.config.lowLatencyMode=u}},{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 s.Events}},{key:"ErrorTypes",get:function(){return c.ErrorTypes}},{key:"ErrorDetails",get:function(){return c.ErrorDetails}},{key:"DefaultConfig",get:function(){return m.defaultConfig?m.defaultConfig:p.hlsDefaultConfig},set:function(u){m.defaultConfig=u}}]),m}();C.defaultConfig=void 0},"./src/is-supported.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"isSupported",function(){return L}),R.d(G,"changeTypeSupported",function(){return U});var K=R("./src/utils/mediasource-helper.ts");function O(){return self.SourceBuffer||self.WebKitSourceBuffer}function L(){var I=Object(K.getMediaSource)();if(!I)return!1;var T=O(),P=I&&typeof I.isTypeSupported=="function"&&I.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),b=!T||T.prototype&&typeof T.prototype.appendBuffer=="function"&&typeof T.prototype.remove=="function";return!!P&&!!b}function U(){var I,T=O();return typeof(T==null||((I=T.prototype)===null||I===void 0)?void 0:I.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"default",function(){return w}),R.d(G,"LoadError",function(){return y});var K=R("./src/polyfills/number.ts"),O=R("./src/errors.ts");function L(f,s){f.prototype=Object.create(s.prototype),f.prototype.constructor=f,b(f,s)}function U(f){var s=typeof Map=="function"?new Map:void 0;return U=function(d){if(d===null||!P(d))return d;if(typeof d!="function")throw new TypeError("Super expression must either be null or a function");if(typeof s!="undefined"){if(s.has(d))return s.get(d);s.set(d,S)}function S(){return I(d,arguments,g(this).constructor)}return S.prototype=Object.create(d.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),b(S,d)},U(f)}function I(f,s,c){return T()?I=Reflect.construct:I=function(S,C,m){var A=[null];A.push.apply(A,C);var x=Function.bind.apply(S,A),u=new x;return m&&b(u,m.prototype),u},I.apply(null,arguments)}function T(){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(f){return!1}}function P(f){return Function.toString.call(f).indexOf("[native code]")!==-1}function b(f,s){return b=Object.setPrototypeOf||function(d,S){return d.__proto__=S,d},b(f,s)}function g(f){return g=Object.setPrototypeOf?Object.getPrototypeOf:function(c){return c.__proto__||Object.getPrototypeOf(c)},g(f)}var k=Math.pow(2,17),w=function(){function f(c){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=c}var s=f.prototype;return s.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},s.abort=function(){this.loader&&this.loader.abort()},s.load=function(d,S){var C=this,m=d.url;if(!m)return Promise.reject(new y({type:O.ErrorTypes.NETWORK_ERROR,details:O.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:d,networkDetails:null},"Fragment does not have a "+(m?"part list":"url")));this.abort();var A=this.config,x=A.fLoader,u=A.loader;return new Promise(function(l,a){C.loader&&C.loader.destroy();var i=C.loader=d.loader=x?new x(A):new u(A),E=p(d),v={timeout:A.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:A.fragLoadingMaxRetryTimeout,highWaterMark:k};d.stats=i.stats,i.load(E,v,{onSuccess:function(D,B,j,W){C.resetLoader(d,i),l({frag:d,part:null,payload:D.data,networkDetails:W})},onError:function(D,B,j){C.resetLoader(d,i),a(new y({type:O.ErrorTypes.NETWORK_ERROR,details:O.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:d,response:D,networkDetails:j}))},onAbort:function(D,B,j){C.resetLoader(d,i),a(new y({type:O.ErrorTypes.NETWORK_ERROR,details:O.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:d,networkDetails:j}))},onTimeout:function(D,B,j){C.resetLoader(d,i),a(new y({type:O.ErrorTypes.NETWORK_ERROR,details:O.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:d,networkDetails:j}))},onProgress:function(D,B,j,W){S&&S({frag:d,part:null,payload:j,networkDetails:W})}})})},s.loadPart=function(d,S,C){var m=this;this.abort();var A=this.config,x=A.fLoader,u=A.loader;return new Promise(function(l,a){m.loader&&m.loader.destroy();var i=m.loader=d.loader=x?new x(A):new u(A),E=p(d,S),v={timeout:A.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:A.fragLoadingMaxRetryTimeout,highWaterMark:k};S.stats=i.stats,i.load(E,v,{onSuccess:function(D,B,j,W){m.resetLoader(d,i),m.updateStatsFromPart(d,S);var h={frag:d,part:S,payload:D.data,networkDetails:W};C(h),l(h)},onError:function(D,B,j){m.resetLoader(d,i),a(new y({type:O.ErrorTypes.NETWORK_ERROR,details:O.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:d,part:S,response:D,networkDetails:j}))},onAbort:function(D,B,j){d.stats.aborted=S.stats.aborted,m.resetLoader(d,i),a(new y({type:O.ErrorTypes.NETWORK_ERROR,details:O.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:d,part:S,networkDetails:j}))},onTimeout:function(D,B,j){m.resetLoader(d,i),a(new y({type:O.ErrorTypes.NETWORK_ERROR,details:O.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:d,part:S,networkDetails:j}))}})})},s.updateStatsFromPart=function(d,S){var C=d.stats,m=S.stats,A=m.total;if(C.loaded+=m.loaded,A){var x=Math.round(d.duration/S.duration),u=Math.min(Math.round(C.loaded/A),x),l=x-u,a=l*Math.round(C.loaded/u);C.total=C.loaded+a}else C.total=Math.max(C.loaded,C.total);var i=C.loading,E=m.loading;i.start?i.first+=E.first-E.start:(i.start=E.start,i.first=E.first),i.end=E.end},s.resetLoader=function(d,S){d.loader=null,this.loader===S&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),S.destroy()},f}();function p(f,s){s===void 0&&(s=null);var c=s||f,d={frag:f,part:s,responseType:"arraybuffer",url:c.url,headers:{},rangeStart:0,rangeEnd:0},S=c.byteRangeStartOffset,C=c.byteRangeEndOffset;return Object(K.isFiniteNumber)(S)&&Object(K.isFiniteNumber)(C)&&(d.rangeStart=S,d.rangeEnd=C),d}var y=function(f){L(s,f);function s(c){for(var d,S=arguments.length,C=new Array(S>1?S-1:0),m=1;m<S;m++)C[m-1]=arguments[m];return d=f.call.apply(f,[this].concat(C))||this,d.data=void 0,d.data=c,d}return s}(U(Error))},"./src/loader/fragment.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"ElementaryStreamTypes",function(){return w}),R.d(G,"BaseSegment",function(){return p}),R.d(G,"Fragment",function(){return y}),R.d(G,"Part",function(){return f});var K=R("./src/polyfills/number.ts"),O=R("./node_modules/url-toolkit/src/url-toolkit.js"),L=R.n(O),U=R("./src/utils/logger.ts"),I=R("./src/loader/level-key.ts"),T=R("./src/loader/load-stats.ts");function P(s,c){s.prototype=Object.create(c.prototype),s.prototype.constructor=s,b(s,c)}function b(s,c){return b=Object.setPrototypeOf||function(S,C){return S.__proto__=C,S},b(s,c)}function g(s,c){for(var d=0;d<c.length;d++){var S=c[d];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(s,S.key,S)}}function k(s,c,d){return c&&g(s.prototype,c),d&&g(s,d),s}var w;(function(s){s.AUDIO="audio",s.VIDEO="video",s.AUDIOVIDEO="audiovideo"})(w||(w={}));var p=function(){function s(d){var S;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(S={},S[w.AUDIO]=null,S[w.VIDEO]=null,S[w.AUDIOVIDEO]=null,S),this.baseurl=d}var c=s.prototype;return c.setByteRange=function(S,C){var m=S.split("@",2),A=[];m.length===1?A[0]=C?C.byteRangeEndOffset:0:A[0]=parseInt(m[1]),A[1]=parseInt(m[0])+A[0],this._byteRange=A},k(s,[{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(O.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(S){this._url=S}}]),s}(),y=function(s){P(c,s);function c(S,C){var m;return m=s.call(this,C)||this,m._decryptdata=null,m.rawProgramDateTime=null,m.programDateTime=null,m.tagList=[],m.duration=0,m.sn=0,m.levelkey=void 0,m.type=void 0,m.loader=null,m.level=-1,m.cc=0,m.startPTS=void 0,m.endPTS=void 0,m.appendedPTS=void 0,m.startDTS=void 0,m.endDTS=void 0,m.start=0,m.deltaPTS=void 0,m.maxStartPTS=void 0,m.minEndPTS=void 0,m.stats=new T.LoadStats,m.urlId=0,m.data=void 0,m.bitrateTest=!1,m.title=null,m.initSegment=null,m.type=S,m}var d=c.prototype;return d.createInitializationVector=function(C){for(var m=new Uint8Array(16),A=12;A<16;A++)m[A]=C>>8*(15-A)&255;return m},d.setDecryptDataFromLevelKey=function(C,m){var A=C;return(C==null?void 0:C.method)==="AES-128"&&C.uri&&!C.iv&&(A=I.LevelKey.fromURI(C.uri),A.method=C.method,A.iv=this.createInitializationVector(m),A.keyFormat="identity"),A},d.setElementaryStreamInfo=function(C,m,A,x,u,l){l===void 0&&(l=!1);var a=this.elementaryStreams,i=a[C];if(!i){a[C]={startPTS:m,endPTS:A,startDTS:x,endDTS:u,partial:l};return}i.startPTS=Math.min(i.startPTS,m),i.endPTS=Math.max(i.endPTS,A),i.startDTS=Math.min(i.startDTS,x),i.endDTS=Math.max(i.endDTS,u)},d.clearElementaryStreamInfo=function(){var C=this.elementaryStreams;C[w.AUDIO]=null,C[w.VIDEO]=null,C[w.AUDIOVIDEO]=null},k(c,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var C=this.sn;typeof C!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&U.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),C=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,C)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(K.isFiniteNumber)(this.programDateTime))return null;var C=Object(K.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+C*1e3}},{key:"encrypted",get:function(){var C;return!!((C=this.decryptdata)!==null&&C!==void 0&&C.keyFormat&&this.decryptdata.uri)}}]),c}(p),f=function(s){P(c,s);function c(d,S,C,m,A){var x;x=s.call(this,C)||this,x.fragOffset=0,x.duration=0,x.gap=!1,x.independent=!1,x.relurl=void 0,x.fragment=void 0,x.index=void 0,x.stats=new T.LoadStats,x.duration=d.decimalFloatingPoint("DURATION"),x.gap=d.bool("GAP"),x.independent=d.bool("INDEPENDENT"),x.relurl=d.enumeratedString("URI"),x.fragment=S,x.index=m;var u=d.enumeratedString("BYTERANGE");return u&&x.setByteRange(u,A),A&&(x.fragOffset=A.fragOffset+A.duration),x}return k(c,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var S=this.elementaryStreams;return!!(S.audio||S.video||S.audiovideo)}}]),c}(p)},"./src/loader/key-loader.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"default",function(){return U});var K=R("./src/events.ts"),O=R("./src/errors.ts"),L=R("./src/utils/logger.ts"),U=function(){function I(P){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=P,this._registerListeners()}var T=I.prototype;return T._registerListeners=function(){this.hls.on(K.Events.KEY_LOADING,this.onKeyLoading,this)},T._unregisterListeners=function(){this.hls.off(K.Events.KEY_LOADING,this.onKeyLoading)},T.destroy=function(){this._unregisterListeners();for(var b in this.loaders){var g=this.loaders[b];g&&g.destroy()}this.loaders={}},T.onKeyLoading=function(b,g){var k=g.frag,w=k.type,p=this.loaders[w];if(!k.decryptdata){L.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var y=k.decryptdata.uri;if(y!==this.decrypturl||this.decryptkey===null){var f=this.hls.config;if(p&&(L.logger.warn("abort previous key loader for type:"+w),p.abort()),!y){L.logger.warn("key uri is falsy");return}var s=f.loader,c=k.loader=this.loaders[w]=new s(f);this.decrypturl=y,this.decryptkey=null;var d={url:y,frag:k,responseType:"arraybuffer"},S={timeout:f.fragLoadingTimeOut,maxRetry:0,retryDelay:f.fragLoadingRetryDelay,maxRetryDelay:f.fragLoadingMaxRetryTimeout,highWaterMark:0},C={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};c.load(d,S,C)}else this.decryptkey&&(k.decryptdata.key=this.decryptkey,this.hls.trigger(K.Events.KEY_LOADED,{frag:k}))},T.loadsuccess=function(b,g,k){var w=k.frag;if(!w.decryptdata){L.logger.error("after key load, decryptdata unset");return}this.decryptkey=w.decryptdata.key=new Uint8Array(b.data),w.loader=null,delete this.loaders[w.type],this.hls.trigger(K.Events.KEY_LOADED,{frag:w})},T.loaderror=function(b,g){var k=g.frag,w=k.loader;w&&w.abort(),delete this.loaders[k.type],this.hls.trigger(K.Events.ERROR,{type:O.ErrorTypes.NETWORK_ERROR,details:O.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:k,response:b})},T.loadtimeout=function(b,g){var k=g.frag,w=k.loader;w&&w.abort(),delete this.loaders[k.type],this.hls.trigger(K.Events.ERROR,{type:O.ErrorTypes.NETWORK_ERROR,details:O.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:k})},I}()},"./src/loader/level-details.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"LevelDetails",function(){return I});var K=R("./src/polyfills/number.ts");function O(T,P){for(var b=0;b<P.length;b++){var g=P[b];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(T,g.key,g)}}function L(T,P,b){return P&&O(T.prototype,P),b&&O(T,b),T}var U=10,I=function(){function T(b){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=b}var P=T.prototype;return P.reloaded=function(g){if(!g){this.advanced=!0,this.updated=!0;return}var k=this.lastPartSn-g.lastPartSn,w=this.lastPartIndex-g.lastPartIndex;this.updated=this.endSN!==g.endSN||!!w||!!k,this.advanced=this.endSN>g.endSN||k>0||k===0&&w>0,this.updated||this.advanced?this.misses=Math.floor(g.misses*.6):this.misses=g.misses+1,this.availabilityDelay=g.availabilityDelay},L(T,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(K.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||U}},{key:"drift",get:function(){var g=this.driftEndTime-this.driftStartTime;if(g>0){var k=this.driftEnd-this.driftStart;return k*1e3/g}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var g;return(g=this.partList)!==null&&g!==void 0&&g.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var g;return(g=this.fragments)!==null&&g!==void 0&&g.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 g;return(g=this.partList)!==null&&g!==void 0&&g.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var g;return(g=this.partList)!==null&&g!==void 0&&g.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),T}()},"./src/loader/level-key.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"LevelKey",function(){return I});var K=R("./node_modules/url-toolkit/src/url-toolkit.js"),O=R.n(K);function L(T,P){for(var b=0;b<P.length;b++){var g=P[b];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(T,g.key,g)}}function U(T,P,b){return P&&L(T.prototype,P),b&&L(T,b),T}var I=function(){T.fromURL=function(b,g){return new T(b,g)},T.fromURI=function(b){return new T(b)};function T(P,b){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,b?this._uri=Object(K.buildAbsoluteURL)(P,b,{alwaysNormalize:!0}):this._uri=P}return U(T,[{key:"uri",get:function(){return this._uri}}]),T}()},"./src/loader/load-stats.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"LoadStats",function(){return K});var K=function(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}},"./src/loader/m3u8-parser.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"default",function(){return c});var K=R("./src/polyfills/number.ts"),O=R("./node_modules/url-toolkit/src/url-toolkit.js"),L=R.n(O),U=R("./src/loader/fragment.ts"),I=R("./src/loader/level-details.ts"),T=R("./src/loader/level-key.ts"),P=R("./src/utils/attr-list.ts"),b=R("./src/utils/logger.ts"),g=R("./src/utils/codecs.ts"),k=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,w=/#EXT-X-MEDIA:(.*)/g,p=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),y=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("|")),f=/\.(mp4|m4s|m4v|m4a)$/i;function s(A){var x,u;return f.test((x=(u=O.parseURL(A))===null||u===void 0?void 0:u.path)!=null?x:"")}var c=function(){function A(){}return A.findGroup=function(u,l){for(var a=0;a<u.length;a++){var i=u[a];if(i.id===l)return i}},A.convertAVC1ToAVCOTI=function(u){var l=u.split(".");if(l.length>2){var a=l.shift()+".";return a+=parseInt(l.shift()).toString(16),a+=("000"+parseInt(l.shift()).toString(16)).substr(-4),a}return u},A.resolve=function(u,l){return O.buildAbsoluteURL(l,u,{alwaysNormalize:!0})},A.parseMasterPlaylist=function(u,l){var a=[],i={},E=!1;k.lastIndex=0;for(var v;(v=k.exec(u))!=null;)if(v[1]){var _=new P.AttrList(v[1]),D={attrs:_,bitrate:_.decimalInteger("AVERAGE-BANDWIDTH")||_.decimalInteger("BANDWIDTH"),name:_.NAME,url:A.resolve(v[2],l)},B=_.decimalResolution("RESOLUTION");B&&(D.width=B.width,D.height=B.height),d((_.CODECS||"").split(/[ ,]+/).filter(function(W){return W}),D),D.videoCodec&&D.videoCodec.indexOf("avc1")!==-1&&(D.videoCodec=A.convertAVC1ToAVCOTI(D.videoCodec)),a.push(D)}else if(v[3]){var j=new P.AttrList(v[3]);j["DATA-ID"]&&(E=!0,i[j["DATA-ID"]]=j)}return{levels:a,sessionData:E?i:null}},A.parseMasterPlaylistMedia=function(u,l,a,i){i===void 0&&(i=[]);var E,v=[],_=0;for(w.lastIndex=0;(E=w.exec(u))!==null;){var D=new P.AttrList(E[1]);if(D.TYPE===a){var B={attrs:D,bitrate:0,id:_++,groupId:D["GROUP-ID"],instreamId:D["INSTREAM-ID"],name:D.NAME||D.LANGUAGE||"",type:a,default:D.bool("DEFAULT"),autoselect:D.bool("AUTOSELECT"),forced:D.bool("FORCED"),lang:D.LANGUAGE,url:D.URI?A.resolve(D.URI,l):""};if(i.length){var j=A.findGroup(i,B.groupId)||i[0];S(B,j,"audioCodec"),S(B,j,"textCodec")}v.push(B)}}return v},A.parseLevelPlaylist=function(u,l,a,i,E){var v=new I.LevelDetails(l),_=v.fragments,D=null,B=0,j=0,W=0,h=0,N=null,H=new U.Fragment(i,l),X,Y,re,he=-1,de=!1;for(p.lastIndex=0,v.m3u8=u;(X=p.exec(u))!==null;){de&&(de=!1,H=new U.Fragment(i,l),H.start=W,H.sn=B,H.cc=h,H.level=a,D&&(H.initSegment=D,H.rawProgramDateTime=D.rawProgramDateTime));var ne=X[1];if(ne){H.duration=parseFloat(ne);var ae=(" "+X[2]).slice(1);H.title=ae||null,H.tagList.push(ae?["INF",ne,ae]:["INF",ne])}else if(X[3])Object(K.isFiniteNumber)(H.duration)&&(H.start=W,re&&(H.levelkey=re),H.sn=B,H.level=a,H.cc=h,H.urlId=E,_.push(H),H.relurl=(" "+X[3]).slice(1),m(H,N),N=H,W+=H.duration,B++,j=0,de=!0);else if(X[4]){var le=(" "+X[4]).slice(1);N?H.setByteRange(le,N):H.setByteRange(le)}else if(X[5])H.rawProgramDateTime=(" "+X[5]).slice(1),H.tagList.push(["PROGRAM-DATE-TIME",H.rawProgramDateTime]),he===-1&&(he=_.length);else{if(X=X[0].match(y),!X){b.logger.warn("No matches on slow regex match for level playlist!");continue}for(Y=1;Y<X.length&&!(typeof X[Y]!="undefined");Y++);var ee=(" "+X[Y]).slice(1),ie=(" "+X[Y+1]).slice(1),ve=X[Y+2]?(" "+X[Y+2]).slice(1):"";switch(ee){case"PLAYLIST-TYPE":v.type=ie.toUpperCase();break;case"MEDIA-SEQUENCE":B=v.startSN=parseInt(ie);break;case"SKIP":{var Pe=new P.AttrList(ie),Ie=Pe.decimalInteger("SKIPPED-SEGMENTS");if(Object(K.isFiniteNumber)(Ie)){v.skippedSegments=Ie;for(var we=Ie;we--;)_.unshift(null);B+=Ie}var ke=Pe.enumeratedString("RECENTLY-REMOVED-DATERANGES");ke&&(v.recentlyRemovedDateranges=ke.split(" "));break}case"TARGETDURATION":v.targetduration=parseFloat(ie);break;case"VERSION":v.version=parseInt(ie);break;case"EXTM3U":break;case"ENDLIST":v.live=!1;break;case"#":(ie||ve)&&H.tagList.push(ve?[ie,ve]:[ie]);break;case"DIS":h++;case"GAP":H.tagList.push([ee]);break;case"BITRATE":H.tagList.push([ee,ie]);break;case"DISCONTINUITY-SEQ":h=parseInt(ie);break;case"KEY":{var De,Le=new P.AttrList(ie),Ve=Le.enumeratedString("METHOD"),ze=Le.URI,Je=Le.hexadecimalInteger("IV"),Ye=Le.enumeratedString("KEYFORMATVERSIONS"),Ge=Le.enumeratedString("KEYID"),ht=(De=Le.enumeratedString("KEYFORMAT"))!=null?De:"identity",ot=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(ot.indexOf(ht)>-1){b.logger.warn("Keyformat "+ht+" is not supported from the manifest");continue}else if(ht!=="identity")continue;Ve&&(re=T.LevelKey.fromURL(l,ze),ze&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Ve)>=0&&(re.method=Ve,re.keyFormat=ht,Ge&&(re.keyID=Ge),Ye&&(re.keyFormatVersions=Ye),re.iv=Je));break}case"START":{var st=new P.AttrList(ie),qe=st.decimalFloatingPoint("TIME-OFFSET");Object(K.isFiniteNumber)(qe)&&(v.startTimeOffset=qe);break}case"MAP":{var vt=new P.AttrList(ie);H.relurl=vt.URI,vt.BYTERANGE&&H.setByteRange(vt.BYTERANGE),H.level=a,H.sn="initSegment",re&&(H.levelkey=re),H.initSegment=null,D=H,de=!0;break}case"SERVER-CONTROL":{var pt=new P.AttrList(ie);v.canBlockReload=pt.bool("CAN-BLOCK-RELOAD"),v.canSkipUntil=pt.optionalFloat("CAN-SKIP-UNTIL",0),v.canSkipDateRanges=v.canSkipUntil>0&&pt.bool("CAN-SKIP-DATERANGES"),v.partHoldBack=pt.optionalFloat("PART-HOLD-BACK",0),v.holdBack=pt.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var gt=new P.AttrList(ie);v.partTarget=gt.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Be=v.partList;Be||(Be=v.partList=[]);var Ct=j>0?Be[Be.length-1]:void 0,yt=j++,He=new U.Part(new P.AttrList(ie),H,l,yt,Ct);Be.push(He),H.duration+=He.duration;break}case"PRELOAD-HINT":{var rt=new P.AttrList(ie);v.preloadHint=rt;break}case"RENDITION-REPORT":{var me=new P.AttrList(ie);v.renditionReports=v.renditionReports||[],v.renditionReports.push(me);break}default:b.logger.warn("line parsed but not handled: "+X);break}}}N&&!N.relurl?(_.pop(),W-=N.duration,v.partList&&(v.fragmentHint=N)):v.partList&&(m(H,N),H.cc=h,v.fragmentHint=H);var se=_.length,be=_[0],te=_[se-1];if(W+=v.skippedSegments*v.targetduration,W>0&&se&&te){v.averagetargetduration=W/se;var oe=te.sn;v.endSN=oe!=="initSegment"?oe:0,be&&(v.startCC=be.cc,be.initSegment||v.fragments.every(function(ce){return ce.relurl&&s(ce.relurl)})&&(b.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),H=new U.Fragment(i,l),H.relurl=te.relurl,H.level=a,H.sn="initSegment",be.initSegment=H,v.needSidxRanges=!0))}else v.endSN=0,v.startCC=0;return v.fragmentHint&&(W+=v.fragmentHint.duration),v.totalduration=W,v.endCC=h,he>0&&C(_,he),v},A}();function d(A,x){["video","audio","text"].forEach(function(u){var l=A.filter(function(i){return Object(g.isCodecType)(i,u)});if(l.length){var a=l.filter(function(i){return i.lastIndexOf("avc1",0)===0||i.lastIndexOf("mp4a",0)===0});x[u+"Codec"]=a.length>0?a[0]:l[0],A=A.filter(function(i){return l.indexOf(i)===-1})}}),x.unknownCodecs=A}function S(A,x,u){var l=x[u];l&&(A[u]=l)}function C(A,x){for(var u=A[x],l=x;l--;){var a=A[l];if(!a)return;a.programDateTime=u.programDateTime-a.duration*1e3,u=a}}function m(A,x){A.rawProgramDateTime?A.programDateTime=Date.parse(A.rawProgramDateTime):x!=null&&x.programDateTime&&(A.programDateTime=x.endProgramDateTime),Object(K.isFiniteNumber)(A.programDateTime)||(A.programDateTime=null,A.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(q,G,R){"use strict";R.r(G);var K=R("./src/polyfills/number.ts"),O=R("./src/events.ts"),L=R("./src/errors.ts"),U=R("./src/utils/logger.ts"),I=R("./src/utils/mp4-tools.ts"),T=R("./src/loader/m3u8-parser.ts"),P=R("./src/types/loader.ts"),b=R("./src/utils/attr-list.ts");function g(p){var y=p.type;switch(y){case P.PlaylistContextType.AUDIO_TRACK:return P.PlaylistLevelType.AUDIO;case P.PlaylistContextType.SUBTITLE_TRACK:return P.PlaylistLevelType.SUBTITLE;default:return P.PlaylistLevelType.MAIN}}function k(p,y){var f=p.url;return(f===void 0||f.indexOf("data:")===0)&&(f=y.url),f}var w=function(){function p(f){this.hls=void 0,this.loaders=Object.create(null),this.hls=f,this.registerListeners()}var y=p.prototype;return y.registerListeners=function(){var s=this.hls;s.on(O.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(O.Events.LEVEL_LOADING,this.onLevelLoading,this),s.on(O.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),s.on(O.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},y.unregisterListeners=function(){var s=this.hls;s.off(O.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.off(O.Events.LEVEL_LOADING,this.onLevelLoading,this),s.off(O.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),s.off(O.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},y.createInternalLoader=function(s){var c=this.hls.config,d=c.pLoader,S=c.loader,C=d||S,m=new C(c);return s.loader=m,this.loaders[s.type]=m,m},y.getInternalLoader=function(s){return this.loaders[s.type]},y.resetInternalLoader=function(s){this.loaders[s]&&delete this.loaders[s]},y.destroyInternalLoaders=function(){for(var s in this.loaders){var c=this.loaders[s];c&&c.destroy(),this.resetInternalLoader(s)}},y.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},y.onManifestLoading=function(s,c){var d=c.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:P.PlaylistContextType.MANIFEST,url:d,deliveryDirectives:null})},y.onLevelLoading=function(s,c){var d=c.id,S=c.level,C=c.url,m=c.deliveryDirectives;this.load({id:d,groupId:null,level:S,responseType:"text",type:P.PlaylistContextType.LEVEL,url:C,deliveryDirectives:m})},y.onAudioTrackLoading=function(s,c){var d=c.id,S=c.groupId,C=c.url,m=c.deliveryDirectives;this.load({id:d,groupId:S,level:null,responseType:"text",type:P.PlaylistContextType.AUDIO_TRACK,url:C,deliveryDirectives:m})},y.onSubtitleTrackLoading=function(s,c){var d=c.id,S=c.groupId,C=c.url,m=c.deliveryDirectives;this.load({id:d,groupId:S,level:null,responseType:"text",type:P.PlaylistContextType.SUBTITLE_TRACK,url:C,deliveryDirectives:m})},y.load=function(s){var c,d=this.hls.config,S=this.getInternalLoader(s);if(S){var C=S.context;if(C&&C.url===s.url){U.logger.trace("[playlist-loader]: playlist request ongoing");return}U.logger.log("[playlist-loader]: aborting previous loader for type: "+s.type),S.abort()}var m,A,x,u;switch(s.type){case P.PlaylistContextType.MANIFEST:m=d.manifestLoadingMaxRetry,A=d.manifestLoadingTimeOut,x=d.manifestLoadingRetryDelay,u=d.manifestLoadingMaxRetryTimeout;break;case P.PlaylistContextType.LEVEL:case P.PlaylistContextType.AUDIO_TRACK:case P.PlaylistContextType.SUBTITLE_TRACK:m=0,A=d.levelLoadingTimeOut;break;default:m=d.levelLoadingMaxRetry,A=d.levelLoadingTimeOut,x=d.levelLoadingRetryDelay,u=d.levelLoadingMaxRetryTimeout;break}if(S=this.createInternalLoader(s),(c=s.deliveryDirectives)!==null&&c!==void 0&&c.part){var l;if(s.type===P.PlaylistContextType.LEVEL&&s.level!==null?l=this.hls.levels[s.level].details:s.type===P.PlaylistContextType.AUDIO_TRACK&&s.id!==null?l=this.hls.audioTracks[s.id].details:s.type===P.PlaylistContextType.SUBTITLE_TRACK&&s.id!==null&&(l=this.hls.subtitleTracks[s.id].details),l){var a=l.partTarget,i=l.targetduration;a&&i&&(A=Math.min(Math.max(a*3,i*.8)*1e3,A))}}var E={timeout:A,maxRetry:m,retryDelay:x,maxRetryDelay:u,highWaterMark:0},v={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};S.load(s,E,v)},y.loadsuccess=function(s,c,d,S){if(S===void 0&&(S=null),d.isSidxRequest){this.handleSidxRequest(s,d),this.handlePlaylistLoaded(s,c,d,S);return}this.resetInternalLoader(d.type);var C=s.data;if(C.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(s,d,"no EXTM3U delimiter",S);return}c.parsing.start=performance.now(),C.indexOf("#EXTINF:")>0||C.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(s,c,d,S):this.handleMasterPlaylist(s,c,d,S)},y.loaderror=function(s,c,d){d===void 0&&(d=null),this.handleNetworkError(c,d,!1,s)},y.loadtimeout=function(s,c,d){d===void 0&&(d=null),this.handleNetworkError(c,d,!0)},y.handleMasterPlaylist=function(s,c,d,S){var C=this.hls,m=s.data,A=k(s,d),x=T.default.parseMasterPlaylist(m,A),u=x.levels,l=x.sessionData;if(!u.length){this.handleManifestParsingError(s,d,"no level found in manifest",S);return}var a=u.map(function(B){return{id:B.attrs.AUDIO,audioCodec:B.audioCodec}}),i=u.map(function(B){return{id:B.attrs.SUBTITLES,textCodec:B.textCodec}}),E=T.default.parseMasterPlaylistMedia(m,A,"AUDIO",a),v=T.default.parseMasterPlaylistMedia(m,A,"SUBTITLES",i),_=T.default.parseMasterPlaylistMedia(m,A,"CLOSED-CAPTIONS");if(E.length){var D=E.some(function(B){return!B.url});!D&&u[0].audioCodec&&!u[0].attrs.AUDIO&&(U.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),E.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new b.AttrList({}),bitrate:0,url:""}))}C.trigger(O.Events.MANIFEST_LOADED,{levels:u,audioTracks:E,subtitles:v,captions:_,url:A,stats:c,networkDetails:S,sessionData:l})},y.handleTrackOrLevelPlaylist=function(s,c,d,S){var C=this.hls,m=d.id,A=d.level,x=d.type,u=k(s,d),l=Object(K.isFiniteNumber)(m)?m:0,a=Object(K.isFiniteNumber)(A)?A:l,i=g(d),E=T.default.parseLevelPlaylist(s.data,u,a,i,l);if(!E.fragments.length){C.trigger(O.Events.ERROR,{type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:u,reason:"no fragments found in level",level:typeof d.level=="number"?d.level:void 0});return}if(x===P.PlaylistContextType.MANIFEST){var v={attrs:new b.AttrList({}),bitrate:0,details:E,name:"",url:u};C.trigger(O.Events.MANIFEST_LOADED,{levels:[v],audioTracks:[],url:u,stats:c,networkDetails:S,sessionData:null})}if(c.parsing.end=performance.now(),E.needSidxRanges){var _,D=(_=E.fragments[0].initSegment)===null||_===void 0?void 0:_.url;this.load({url:D,isSidxRequest:!0,type:x,level:A,levelDetails:E,id:m,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}d.levelDetails=E,this.handlePlaylistLoaded(s,c,d,S)},y.handleSidxRequest=function(s,c){var d=Object(I.parseSegmentIndex)(new Uint8Array(s.data));if(!d)return;var S=d.references,C=c.levelDetails;S.forEach(function(m,A){var x=m.info,u=C.fragments[A];u.byteRange.length===0&&u.setByteRange(String(1+x.end-x.start)+"@"+String(x.start)),u.initSegment&&u.initSegment.setByteRange(String(d.moovEndOffset)+"@0")})},y.handleManifestParsingError=function(s,c,d,S){this.hls.trigger(O.Events.ERROR,{type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:c.type===P.PlaylistContextType.MANIFEST,url:s.url,reason:d,response:s,context:c,networkDetails:S})},y.handleNetworkError=function(s,c,d,S){d===void 0&&(d=!1),U.logger.warn("[playlist-loader]: A network "+(d?"timeout":"error")+" occurred while loading "+s.type+" level: "+s.level+" id: "+s.id+' group-id: "'+s.groupId+'"');var C=L.ErrorDetails.UNKNOWN,m=!1,A=this.getInternalLoader(s);switch(s.type){case P.PlaylistContextType.MANIFEST:C=d?L.ErrorDetails.MANIFEST_LOAD_TIMEOUT:L.ErrorDetails.MANIFEST_LOAD_ERROR,m=!0;break;case P.PlaylistContextType.LEVEL:C=d?L.ErrorDetails.LEVEL_LOAD_TIMEOUT:L.ErrorDetails.LEVEL_LOAD_ERROR,m=!1;break;case P.PlaylistContextType.AUDIO_TRACK:C=d?L.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:L.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,m=!1;break;case P.PlaylistContextType.SUBTITLE_TRACK:C=d?L.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:L.ErrorDetails.SUBTITLE_LOAD_ERROR,m=!1;break}A&&this.resetInternalLoader(s.type);var x={type:L.ErrorTypes.NETWORK_ERROR,details:C,fatal:m,url:s.url,loader:A,context:s,networkDetails:c};S&&(x.response=S),this.hls.trigger(O.Events.ERROR,x)},y.handlePlaylistLoaded=function(s,c,d,S){var C=d.type,m=d.level,A=d.id,x=d.groupId,u=d.loader,l=d.levelDetails,a=d.deliveryDirectives;if(!(l!=null&&l.targetduration)){this.handleManifestParsingError(s,d,"invalid target duration",S);return}if(!u)return;l.live&&(u.getCacheAge&&(l.ageHeader=u.getCacheAge()||0),(!u.getCacheAge||isNaN(l.ageHeader))&&(l.ageHeader=0));switch(C){case P.PlaylistContextType.MANIFEST:case P.PlaylistContextType.LEVEL:this.hls.trigger(O.Events.LEVEL_LOADED,{details:l,level:m||0,id:A||0,stats:c,networkDetails:S,deliveryDirectives:a});break;case P.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(O.Events.AUDIO_TRACK_LOADED,{details:l,id:A||0,groupId:x||"",stats:c,networkDetails:S,deliveryDirectives:a});break;case P.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(O.Events.SUBTITLE_TRACK_LOADED,{details:l,id:A||0,groupId:x||"",stats:c,networkDetails:S,deliveryDirectives:a});break}},p}();G.default=w},"./src/polyfills/number.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"isFiniteNumber",function(){return K}),R.d(G,"MAX_SAFE_INTEGER",function(){return O});var K=Number.isFinite||function(L){return typeof L=="number"&&isFinite(L)},O=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(q,G,R){"use strict";R.r(G);var K=function(){function O(){}return O.getSilentFrame=function(U,I){switch(U){case"mp4a.40.2":if(I===1)return new Uint8Array([0,200,0,128,35,128]);if(I===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(I===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(I===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(I===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(I===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(I===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(I===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(I===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},O}();G.default=K},"./src/remux/mp4-generator.ts":function(q,G,R){"use strict";R.r(G);var K=Math.pow(2,32)-1,O=function(){function L(){}return L.init=function(){L.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};var I;for(I in L.types)L.types.hasOwnProperty(I)&&(L.types[I]=[I.charCodeAt(0),I.charCodeAt(1),I.charCodeAt(2),I.charCodeAt(3)]);var T=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]),P=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);L.HDLR_TYPES={video:T,audio:P};var b=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),g=new Uint8Array([0,0,0,0,0,0,0,0]);L.STTS=L.STSC=L.STCO=g,L.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),L.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),L.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),L.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var k=new Uint8Array([105,115,111,109]),w=new Uint8Array([97,118,99,49]),p=new Uint8Array([0,0,0,1]);L.FTYP=L.box(L.types.ftyp,k,p,k,w),L.DINF=L.box(L.types.dinf,L.box(L.types.dref,b))},L.box=function(I){for(var T=8,P=arguments.length,b=new Array(P>1?P-1:0),g=1;g<P;g++)b[g-1]=arguments[g];for(var k=b.length,w=k;k--;)T+=b[k].byteLength;var p=new Uint8Array(T);for(p[0]=T>>24&255,p[1]=T>>16&255,p[2]=T>>8&255,p[3]=T&255,p.set(I,4),k=0,T=8;k<w;k++)p.set(b[k],T),T+=b[k].byteLength;return p},L.hdlr=function(I){return L.box(L.types.hdlr,L.HDLR_TYPES[I])},L.mdat=function(I){return L.box(L.types.mdat,I)},L.mdhd=function(I,T){T*=I;var P=Math.floor(T/(K+1)),b=Math.floor(T%(K+1));return L.box(L.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,I>>24&255,I>>16&255,I>>8&255,I&255,P>>24,P>>16&255,P>>8&255,P&255,b>>24,b>>16&255,b>>8&255,b&255,85,196,0,0]))},L.mdia=function(I){return L.box(L.types.mdia,L.mdhd(I.timescale,I.duration),L.hdlr(I.type),L.minf(I))},L.mfhd=function(I){return L.box(L.types.mfhd,new Uint8Array([0,0,0,0,I>>24,I>>16&255,I>>8&255,I&255]))},L.minf=function(I){return I.type==="audio"?L.box(L.types.minf,L.box(L.types.smhd,L.SMHD),L.DINF,L.stbl(I)):L.box(L.types.minf,L.box(L.types.vmhd,L.VMHD),L.DINF,L.stbl(I))},L.moof=function(I,T,P){return L.box(L.types.moof,L.mfhd(I),L.traf(P,T))},L.moov=function(I){for(var T=I.length,P=[];T--;)P[T]=L.trak(I[T]);return L.box.apply(null,[L.types.moov,L.mvhd(I[0].timescale,I[0].duration)].concat(P).concat(L.mvex(I)))},L.mvex=function(I){for(var T=I.length,P=[];T--;)P[T]=L.trex(I[T]);return L.box.apply(null,[L.types.mvex].concat(P))},L.mvhd=function(I,T){T*=I;var P=Math.floor(T/(K+1)),b=Math.floor(T%(K+1)),g=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,I>>24&255,I>>16&255,I>>8&255,I&255,P>>24,P>>16&255,P>>8&255,P&255,b>>24,b>>16&255,b>>8&255,b&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return L.box(L.types.mvhd,g)},L.sdtp=function(I){var T=I.samples||[],P=new Uint8Array(4+T.length),b,g;for(b=0;b<T.length;b++)g=T[b].flags,P[b+4]=g.dependsOn<<4|g.isDependedOn<<2|g.hasRedundancy;return L.box(L.types.sdtp,P)},L.stbl=function(I){return L.box(L.types.stbl,L.stsd(I),L.box(L.types.stts,L.STTS),L.box(L.types.stsc,L.STSC),L.box(L.types.stsz,L.STSZ),L.box(L.types.stco,L.STCO))},L.avc1=function(I){var T=[],P=[],b,g,k;for(b=0;b<I.sps.length;b++)g=I.sps[b],k=g.byteLength,T.push(k>>>8&255),T.push(k&255),T=T.concat(Array.prototype.slice.call(g));for(b=0;b<I.pps.length;b++)g=I.pps[b],k=g.byteLength,P.push(k>>>8&255),P.push(k&255),P=P.concat(Array.prototype.slice.call(g));var w=L.box(L.types.avcC,new Uint8Array([1,T[3],T[4],T[5],252|3,224|I.sps.length].concat(T).concat([I.pps.length]).concat(P))),p=I.width,y=I.height,f=I.pixelRatio[0],s=I.pixelRatio[1];return L.box(L.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,p>>8&255,p&255,y>>8&255,y&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]),w,L.box(L.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),L.box(L.types.pasp,new Uint8Array([f>>24,f>>16&255,f>>8&255,f&255,s>>24,s>>16&255,s>>8&255,s&255])))},L.esds=function(I){var T=I.config.length;return new Uint8Array([0,0,0,0,3,23+T,0,1,0,4,15+T,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([T]).concat(I.config).concat([6,1,2]))},L.mp4a=function(I){var T=I.samplerate;return L.box(L.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,I.channelCount,0,16,0,0,0,0,T>>8&255,T&255,0,0]),L.box(L.types.esds,L.esds(I)))},L.mp3=function(I){var T=I.samplerate;return L.box(L.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,I.channelCount,0,16,0,0,0,0,T>>8&255,T&255,0,0]))},L.stsd=function(I){return I.type==="audio"?!I.isAAC&&I.codec==="mp3"?L.box(L.types.stsd,L.STSD,L.mp3(I)):L.box(L.types.stsd,L.STSD,L.mp4a(I)):L.box(L.types.stsd,L.STSD,L.avc1(I))},L.tkhd=function(I){var T=I.id,P=I.duration*I.timescale,b=I.width,g=I.height,k=Math.floor(P/(K+1)),w=Math.floor(P%(K+1));return L.box(L.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,T>>24&255,T>>16&255,T>>8&255,T&255,0,0,0,0,k>>24,k>>16&255,k>>8&255,k&255,w>>24,w>>16&255,w>>8&255,w&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,b>>8&255,b&255,0,0,g>>8&255,g&255,0,0]))},L.traf=function(I,T){var P=L.sdtp(I),b=I.id,g=Math.floor(T/(K+1)),k=Math.floor(T%(K+1));return L.box(L.types.traf,L.box(L.types.tfhd,new Uint8Array([0,0,0,0,b>>24,b>>16&255,b>>8&255,b&255])),L.box(L.types.tfdt,new Uint8Array([1,0,0,0,g>>24,g>>16&255,g>>8&255,g&255,k>>24,k>>16&255,k>>8&255,k&255])),L.trun(I,P.length+16+20+8+16+8+8),P)},L.trak=function(I){return I.duration=I.duration||4294967295,L.box(L.types.trak,L.tkhd(I),L.mdia(I))},L.trex=function(I){var T=I.id;return L.box(L.types.trex,new Uint8Array([0,0,0,0,T>>24,T>>16&255,T>>8&255,T&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},L.trun=function(I,T){var P=I.samples||[],b=P.length,g=12+16*b,k=new Uint8Array(g),w,p,y,f,s,c;for(T+=8+g,k.set([0,0,15,1,b>>>24&255,b>>>16&255,b>>>8&255,b&255,T>>>24&255,T>>>16&255,T>>>8&255,T&255],0),w=0;w<b;w++)p=P[w],y=p.duration,f=p.size,s=p.flags,c=p.cts,k.set([y>>>24&255,y>>>16&255,y>>>8&255,y&255,f>>>24&255,f>>>16&255,f>>>8&255,f&255,s.isLeading<<2|s.dependsOn,s.isDependedOn<<6|s.hasRedundancy<<4|s.paddingValue<<1|s.isNonSync,s.degradPrio&240<<8,s.degradPrio&15,c>>>24&255,c>>>16&255,c>>>8&255,c&255],12+16*w);return L.box(L.types.trun,k)},L.initSegment=function(I){L.types||L.init();var T=L.moov(I),P=new Uint8Array(L.FTYP.byteLength+T.byteLength);return P.set(L.FTYP),P.set(T,L.FTYP.byteLength),P},L}();O.types=void 0,O.HDLR_TYPES=void 0,O.STTS=void 0,O.STSC=void 0,O.STCO=void 0,O.STSZ=void 0,O.VMHD=void 0,O.SMHD=void 0,O.STSD=void 0,O.FTYP=void 0,O.DINF=void 0,G.default=O},"./src/remux/mp4-remuxer.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"default",function(){return c}),R.d(G,"normalizePts",function(){return d});var K=R("./src/polyfills/number.ts"),O=R("./src/remux/aac-helper.ts"),L=R("./src/remux/mp4-generator.ts"),U=R("./src/events.ts"),I=R("./src/errors.ts"),T=R("./src/utils/logger.ts"),P=R("./src/types/loader.ts"),b=R("./src/utils/timescale-conversion.ts");function g(){return g=Object.assign||function(A){for(var x=1;x<arguments.length;x++){var u=arguments[x];for(var l in u)Object.prototype.hasOwnProperty.call(u,l)&&(A[l]=u[l])}return A},g.apply(this,arguments)}var k=10*1e3,w=1024,p=1152,y=null,f=null,s=!1,c=function(){function A(u,l,a,i){if(i===void 0&&(i=""),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=u,this.config=l,this.typeSupported=a,this.ISGenerated=!1,y===null){var E=navigator.userAgent||"",v=E.match(/Chrome\/(\d+)/i);y=v?parseInt(v[1]):0}if(f===null){var _=navigator.userAgent.match(/Safari\/(\d+)/i);f=_?parseInt(_[1]):0}s=!!y&&y<75||!!f&&f<600}var x=A.prototype;return x.destroy=function(){},x.resetTimeStamp=function(l){T.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=l},x.resetNextTimestamp=function(){T.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},x.resetInitSegment=function(){T.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},x.getVideoStartPts=function(l){var a=!1,i=l.reduce(function(E,v){var _=v.pts-E;return _<-4294967296?(a=!0,d(E,v.pts)):_>0?E:v.pts},l[0].pts);return a&&T.logger.debug("PTS rollover detected"),i},x.remux=function(l,a,i,E,v,_,D,B){var j,W,h,N,H,X,Y=v,re=v,he=l.pid>-1,de=a.pid>-1,ne=a.samples.length,ae=l.samples.length>0,le=ne>1,ee=(!he||ae)&&(!de||le)||this.ISGenerated||D;if(ee){this.ISGenerated||(h=this.generateIS(l,a,v));var ie=this.isVideoContiguous,ve=-1;if(le&&(ve=S(a.samples),!ie&&this.config.forceKeyFrameOnDiscontinuity))if(X=!0,ve>0){T.logger.warn("[mp4-remuxer]: Dropped "+ve+" out of "+ne+" video samples due to a missing keyframe");var Pe=this.getVideoStartPts(a.samples);a.samples=a.samples.slice(ve),a.dropped+=ve,re+=(a.samples[0].pts-Pe)/(a.timescale||9e4)}else ve===-1&&(T.logger.warn("[mp4-remuxer]: No keyframe found out of "+ne+" video samples"),X=!1);if(this.ISGenerated){if(ae&&le){var Ie=this.getVideoStartPts(a.samples),we=d(l.samples[0].pts,Ie)-Ie,ke=we/a.inputTimeScale;Y+=Math.max(0,ke),re+=Math.max(0,-ke)}if(ae){if(l.samplerate||(T.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),h=this.generateIS(l,a,v)),W=this.remuxAudio(l,Y,this.isAudioContiguous,_,de||le||B===P.PlaylistLevelType.AUDIO?re:void 0),le){var De=W?W.endPTS-W.startPTS:0;a.inputTimeScale||(T.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),h=this.generateIS(l,a,v)),j=this.remuxVideo(a,re,ie,De)}}else le&&(j=this.remuxVideo(a,re,ie,0));j&&(j.firstKeyFrame=ve,j.independent=ve!==-1)}}return this.ISGenerated&&(i.samples.length&&(H=this.remuxID3(i,v)),E.samples.length&&(N=this.remuxText(E,v))),{audio:W,video:j,initSegment:h,independent:X,text:N,id3:H}},x.generateIS=function(l,a,i){var E=l.samples,v=a.samples,_=this.typeSupported,D={},B=!Object(K.isFiniteNumber)(this._initPTS),j="audio/mp4",W,h,N;if(B&&(W=h=Infinity),l.config&&E.length&&(l.timescale=l.samplerate,l.isAAC||(_.mpeg?(j="audio/mpeg",l.codec=""):_.mp3&&(l.codec="mp3")),D.audio={id:"audio",container:j,codec:l.codec,initSegment:!l.isAAC&&_.mpeg?new Uint8Array(0):L.default.initSegment([l]),metadata:{channelCount:l.channelCount}},B&&(N=l.inputTimeScale,W=h=E[0].pts-Math.round(N*i))),a.sps&&a.pps&&v.length&&(a.timescale=a.inputTimeScale,D.video={id:"main",container:"video/mp4",codec:a.codec,initSegment:L.default.initSegment([a]),metadata:{width:a.width,height:a.height}},B)){N=a.inputTimeScale;var H=this.getVideoStartPts(v),X=Math.round(N*i);h=Math.min(h,d(v[0].dts,H)-X),W=Math.min(W,H-X)}if(Object.keys(D).length)return this.ISGenerated=!0,B&&(this._initPTS=W,this._initDTS=h),{tracks:D,initPTS:W,timescale:N}},x.remuxVideo=function(l,a,i,E){var v=l.inputTimeScale,_=l.samples,D=[],B=_.length,j=this._initPTS,W=this.nextAvcDts,h=8,N,H,X,Y=Number.POSITIVE_INFINITY,re=Number.NEGATIVE_INFINITY,he=0,de=!1;if(!i||W===null){var ne=a*v,ae=_[0].pts-d(_[0].dts,_[0].pts);W=ne-ae}for(var le=0;le<B;le++){var ee=_[le];if(ee.pts=d(ee.pts-j,W),ee.dts=d(ee.dts-j,W),ee.dts>ee.pts){var ie=9e4*.2;he=Math.max(Math.min(he,ee.pts-ee.dts),-1*ie)}ee.dts<_[le>0?le-1:le].dts&&(de=!0)}de&&_.sort(function(Qt,Bt){var Pt=Qt.dts-Bt.dts,mn=Qt.pts-Bt.pts;return Pt||mn}),H=_[0].dts,X=_[_.length-1].dts;var ve=Math.round((X-H)/(B-1));if(he<0){if(he<ve*-2){T.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(b.toMsFromMpegTsClock)(-ve,!0)+" ms");for(var Pe=he,Ie=0;Ie<B;Ie++)_[Ie].dts=Pe=Math.max(Pe,_[Ie].pts-ve),_[Ie].pts=Math.max(Pe,_[Ie].pts)}else{T.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(b.toMsFromMpegTsClock)(he,!0)+" ms to overcome this issue");for(var we=0;we<B;we++)_[we].dts=_[we].dts+he}H=_[0].dts}if(i){var ke=H-W,De=ke>ve,Le=ke<-1;if(De||Le){De?T.logger.warn("AVC: "+Object(b.toMsFromMpegTsClock)(ke,!0)+" ms ("+ke+"dts) hole between fragments detected, filling it"):T.logger.warn("AVC: "+Object(b.toMsFromMpegTsClock)(-ke,!0)+" ms ("+ke+"dts) overlapping between fragments detected"),H=W;var Ve=_[0].pts-ke;_[0].dts=H,_[0].pts=Ve,T.logger.log("Video: First PTS/DTS adjusted: "+Object(b.toMsFromMpegTsClock)(Ve,!0)+"/"+Object(b.toMsFromMpegTsClock)(H,!0)+", delta: "+Object(b.toMsFromMpegTsClock)(ke,!0)+" ms")}}s&&(H=Math.max(0,H));for(var ze=0,Je=0,Ye=0;Ye<B;Ye++){for(var Ge=_[Ye],ht=Ge.units,ot=ht.length,st=0,qe=0;qe<ot;qe++)st+=ht[qe].data.length;Je+=st,ze+=ot,Ge.length=st,Ge.dts=Math.max(Ge.dts,H),Ge.pts=Math.max(Ge.pts,Ge.dts,0),Y=Math.min(Ge.pts,Y),re=Math.max(Ge.pts,re)}X=_[B-1].dts;var vt=Je+4*ze+8,pt;try{pt=new Uint8Array(vt)}catch(Qt){this.observer.emit(U.Events.ERROR,U.Events.ERROR,{type:I.ErrorTypes.MUX_ERROR,details:I.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:vt,reason:"fail allocating video mdat "+vt});return}var gt=new DataView(pt.buffer);gt.setUint32(0,vt),pt.set(L.default.types.mdat,4);for(var Be=0;Be<B;Be++){for(var Ct=_[Be],yt=Ct.units,He=0,rt=0,me=yt.length;rt<me;rt++){var se=yt[rt],be=se.data,te=se.data.byteLength;gt.setUint32(h,te),h+=4,pt.set(be,h),h+=te,He+=4+te}if(Be<B-1)N=_[Be+1].dts-Ct.dts;else{var oe=this.config,ce=Ct.dts-_[Be>0?Be-1:Be].dts;if(oe.stretchShortVideoTrack&&this.nextAudioPts!==null){var _e=Math.floor(oe.maxBufferHole*v),je=(E?Y+E*v:this.nextAudioPts)-Ct.pts;je>_e?(N=je-ce,N<0&&(N=ce),T.logger.log("[mp4-remuxer]: It is approximately "+je/90+" ms to the next segment; using duration "+N/90+" ms for the last video frame.")):N=ce}else N=ce}var Xe=Math.round(Ct.pts-Ct.dts);D.push(new C(Ct.key,N,He,Xe))}if(D.length&&y&&y<70){var Ze=D[0].flags;Ze.dependsOn=2,Ze.isNonSync=0}console.assert(N!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=W=X+N,this.isVideoContiguous=!0;var _t=L.default.moof(l.sequenceNumber++,H,g({},l,{samples:D})),It="video",$e={data1:_t,data2:pt,startPTS:Y/v,endPTS:(re+N)/v,startDTS:H/v,endDTS:W/v,type:It,hasAudio:!1,hasVideo:!0,nb:D.length,dropped:l.dropped};return l.samples=[],l.dropped=0,console.assert(pt.length,"MDAT length must not be zero"),$e},x.remuxAudio=function(l,a,i,E,v){var _=l.inputTimeScale,D=l.samplerate?l.samplerate:_,B=_/D,j=l.isAAC?w:p,W=j*B,h=this._initPTS,N=!l.isAAC&&this.typeSupported.mpeg,H=[],X=l.samples,Y=N?0:8,re=this.nextAudioPts||-1,he=a*_;if(this.isAudioContiguous=i=i||X.length&&re>0&&(E&&Math.abs(he-re)<9e3||Math.abs(d(X[0].pts-h,he)-re)<20*W),X.forEach(function(be){be.pts=d(be.pts-h,he)}),!i||re<0){if(X=X.filter(function(be){return be.pts>=0}),!X.length)return;v===0?re=0:E?re=Math.max(0,he):re=X[0].pts}if(l.isAAC)for(var de=v!==void 0,ne=this.config.maxAudioFramesDrift,ae=0,le=re;ae<X.length;ae++){var ee=X[ae],ie=ee.pts,ve=ie-le,Pe=Math.abs(1e3*ve/_);if(ve<=-ne*W&&de)ae===0&&(T.logger.warn("Audio frame @ "+(ie/_).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*ve/_)+" ms."),this.nextAudioPts=re=le=ie);else if(ve>=ne*W&&Pe<k&&de){var Ie=Math.round(ve/W);le=ie-Ie*W,le<0&&(Ie--,le+=W),ae===0&&(this.nextAudioPts=re=le),T.logger.warn("[mp4-remuxer]: Injecting "+Ie+" audio frame @ "+(le/_).toFixed(3)+"s due to "+Math.round(1e3*ve/_)+" ms gap.");for(var we=0;we<Ie;we++){var ke=Math.max(le,0),De=O.default.getSilentFrame(l.manifestCodec||l.codec,l.channelCount);De||(T.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),De=ee.unit.subarray()),X.splice(ae,0,{unit:De,pts:ke}),le+=W,ae++}}ee.pts=le,le+=W}for(var Le=null,Ve=null,ze,Je=0,Ye=X.length;Ye--;)Je+=X[Ye].unit.byteLength;for(var Ge=0,ht=X.length;Ge<ht;Ge++){var ot=X[Ge],st=ot.unit,qe=ot.pts;if(Ve!==null){var vt=H[Ge-1];vt.duration=Math.round((qe-Ve)/B)}else if(i&&l.isAAC&&(qe=re),Le=qe,Je>0){Je+=Y;try{ze=new Uint8Array(Je)}catch(be){this.observer.emit(U.Events.ERROR,U.Events.ERROR,{type:I.ErrorTypes.MUX_ERROR,details:I.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Je,reason:"fail allocating audio mdat "+Je});return}if(!N){var pt=new DataView(ze.buffer);pt.setUint32(0,Je),ze.set(L.default.types.mdat,4)}}else return;ze.set(st,Y);var gt=st.byteLength;Y+=gt,H.push(new C(!0,j,gt,0)),Ve=qe}var Be=H.length;if(!Be)return;var Ct=H[H.length-1];this.nextAudioPts=re=Ve+B*Ct.duration;var yt=N?new Uint8Array(0):L.default.moof(l.sequenceNumber++,Le/B,g({},l,{samples:H}));l.samples=[];var He=Le/_,rt=re/_,me="audio",se={data1:yt,data2:ze,startPTS:He,endPTS:rt,startDTS:He,endDTS:rt,type:me,hasAudio:!0,hasVideo:!1,nb:Be};return this.isAudioContiguous=!0,console.assert(ze.length,"MDAT length must not be zero"),se},x.remuxEmptyAudio=function(l,a,i,E){var v=l.inputTimeScale,_=l.samplerate?l.samplerate:v,D=v/_,B=this.nextAudioPts,j=(B!==null?B:E.startDTS*v)+this._initDTS,W=E.endDTS*v+this._initDTS,h=D*w,N=Math.ceil((W-j)/h),H=O.default.getSilentFrame(l.manifestCodec||l.codec,l.channelCount);if(T.logger.warn("[mp4-remuxer]: remux empty Audio"),!H){T.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var X=[],Y=0;Y<N;Y++){var re=j+Y*h;X.push({unit:H,pts:re,dts:re})}return l.samples=X,this.remuxAudio(l,a,i,!1)},x.remuxID3=function(l,a){var i=l.samples.length;if(!i)return;for(var E=l.inputTimeScale,v=this._initPTS,_=this._initDTS,D=0;D<i;D++){var B=l.samples[D];B.pts=d(B.pts-v,a*E)/E,B.dts=d(B.dts-_,a*E)/E}var j=l.samples;return l.samples=[],{samples:j}},x.remuxText=function(l,a){var i=l.samples.length;if(!i)return;for(var E=l.inputTimeScale,v=this._initPTS,_=0;_<i;_++){var D=l.samples[_];D.pts=d(D.pts-v,a*E)/E}l.samples.sort(function(j,W){return j.pts-W.pts});var B=l.samples;return l.samples=[],{samples:B}},A}();function d(A,x){var u;if(x===null)return A;for(x<A?u=-8589934592:u=8589934592;Math.abs(A-x)>4294967296;)A+=u;return A}function S(A){for(var x=0;x<A.length;x++)if(A[x].key)return x;return-1}var C=function(x,u,l,a){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=u,this.size=l,this.cts=a,this.flags=new m(x)},m=function(x){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=x?2:1,this.isNonSync=x?0:1}},"./src/remux/passthrough-remuxer.ts":function(q,G,R){"use strict";R.r(G);var K=R("./src/polyfills/number.ts"),O=R("./src/utils/mp4-tools.ts"),L=R("./src/loader/fragment.ts"),U=R("./src/utils/logger.ts"),I=function(){function b(){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 g=b.prototype;return g.destroy=function(){},g.resetTimeStamp=function(w){this.initPTS=w,this.lastEndDTS=null},g.resetNextTimestamp=function(){this.lastEndDTS=null},g.resetInitSegment=function(w,p,y){this.audioCodec=p,this.videoCodec=y,this.generateInitSegment(w),this.emitInitSegment=!0},g.generateInitSegment=function(w){var p=this.audioCodec,y=this.videoCodec;if(!w||!w.byteLength){this.initTracks=void 0,this.initData=void 0;return}var f=this.initData=Object(O.parseInitSegment)(w);p||(p=P(f.audio,L.ElementaryStreamTypes.AUDIO)),y||(y=P(f.video,L.ElementaryStreamTypes.VIDEO));var s={};f.audio&&f.video?s.audiovideo={container:"video/mp4",codec:p+","+y,initSegment:w,id:"main"}:f.audio?s.audio={container:"audio/mp4",codec:p,initSegment:w,id:"audio"}:f.video?s.video={container:"video/mp4",codec:y,initSegment:w,id:"main"}:U.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=s},g.remux=function(w,p,y,f,s){var c=this.initPTS,d=this.lastEndDTS,S={audio:void 0,video:void 0,text:f,id3:y,initSegment:void 0};Object(K.isFiniteNumber)(d)||(d=this.lastEndDTS=s||0);var C=p.samples;if(!C||!C.length)return S;var m={initPTS:void 0,timescale:1},A=this.initData;if((!A||!A.length)&&(this.generateInitSegment(C),A=this.initData),!A||!A.length)return U.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),S;this.emitInitSegment&&(m.tracks=this.initTracks,this.emitInitSegment=!1),Object(K.isFiniteNumber)(c)||(this.initPTS=m.initPTS=c=T(A,C,d));var x=Object(O.getDuration)(C,A),u=d,l=x+u;Object(O.offsetStartDTS)(A,C,c),x>0?this.lastEndDTS=l:(U.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var a=!!A.audio,i=!!A.video,E="";a&&(E+="audio"),i&&(E+="video");var v={data1:C,startPTS:u,startDTS:u,endPTS:l,endDTS:l,type:E,hasAudio:a,hasVideo:i,nb:1,dropped:0};return S.audio=v.type==="audio"?v:void 0,S.video=v.type!=="audio"?v:void 0,S.text=f,S.id3=y,S.initSegment=m,S},b}(),T=function(g,k,w){return Object(O.getStartDTS)(g,k)-w};function P(b,g){var k=b==null?void 0:b.codec;return k&&k.length>4?k:k==="hvc1"?"hvc1.1.c.L120.90":k==="av01"?"av01.0.04M.08":k==="avc1"||g===L.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}G.default=I},"./src/task-loop.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"default",function(){return K});var K=function(){function O(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var L=O.prototype;return L.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},L.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},L.onHandlerDestroyed=function(){},L.hasInterval=function(){return!!this._tickInterval},L.hasNextTick=function(){return!!this._tickTimer},L.setInterval=function(I){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,I),!0)},L.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},L.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},L.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},L.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},L.doTick=function(){},O}()},"./src/types/cmcd.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"CMCDVersion",function(){return K}),R.d(G,"CMCDObjectType",function(){return O}),R.d(G,"CMCDStreamingFormat",function(){return L}),R.d(G,"CMCDStreamType",function(){return U});var K=1,O;(function(I){I.MANIFEST="m",I.AUDIO="a",I.VIDEO="v",I.MUXED="av",I.INIT="i",I.CAPTION="c",I.TIMED_TEXT="tt",I.KEY="k",I.OTHER="o"})(O||(O={}));var L;(function(I){I.DASH="d",I.HLS="h",I.SMOOTH="s",I.OTHER="o"})(L||(L={}));var U;(function(I){I.VOD="v",I.LIVE="l"})(U||(U={}))},"./src/types/level.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"HlsSkip",function(){return L}),R.d(G,"getSkipValue",function(){return U}),R.d(G,"HlsUrlParameters",function(){return I}),R.d(G,"Level",function(){return T});function K(P,b){for(var g=0;g<b.length;g++){var k=b[g];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(P,k.key,k)}}function O(P,b,g){return b&&K(P.prototype,b),g&&K(P,g),P}var L;(function(P){P.No="",P.Yes="YES",P.v2="v2"})(L||(L={}));function U(P,b){var g=P.canSkipUntil,k=P.canSkipDateRanges,w=P.endSN,p=b!==void 0?b-w:0;return g&&p<g?k?L.v2:L.Yes:L.No}var I=function(){function P(g,k,w){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=g,this.part=k,this.skip=w}var b=P.prototype;return b.addDirectives=function(k){var w=new self.URL(k);return this.msn!==void 0&&w.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&w.searchParams.set("_HLS_part",this.part.toString()),this.skip&&w.searchParams.set("_HLS_skip",this.skip),w.toString()},P}(),T=function(){function P(b){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=[b.url],this.attrs=b.attrs,this.bitrate=b.bitrate,b.details&&(this.details=b.details),this.id=b.id||0,this.name=b.name,this.width=b.width||0,this.height=b.height||0,this.audioCodec=b.audioCodec,this.videoCodec=b.videoCodec,this.unknownCodecs=b.unknownCodecs,this.codecSet=[b.videoCodec,b.audioCodec].filter(function(g){return g}).join(",").replace(/\.[^.,]+/g,"")}return O(P,[{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(g){var k=g%this.url.length;this._urlId!==k&&(this.details=void 0,this._urlId=k)}}]),P}()},"./src/types/loader.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"PlaylistContextType",function(){return K}),R.d(G,"PlaylistLevelType",function(){return O});var K;(function(L){L.MANIFEST="manifest",L.LEVEL="level",L.AUDIO_TRACK="audioTrack",L.SUBTITLE_TRACK="subtitleTrack"})(K||(K={}));var O;(function(L){L.MAIN="main",L.AUDIO="audio",L.SUBTITLE="subtitle"})(O||(O={}))},"./src/types/transmuxer.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"ChunkMetadata",function(){return K});var K=function(U,I,T,P,b,g){P===void 0&&(P=0),b===void 0&&(b=-1),g===void 0&&(g=!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=O(),this.buffering={audio:O(),video:O(),audiovideo:O()},this.level=U,this.sn=I,this.id=T,this.size=P,this.part=b,this.partial=g};function O(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"AttrList",function(){return L});var K=/^(\d+)x(\d+)$/,O=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,L=function(){function U(T){typeof T=="string"&&(T=U.parseAttrList(T));for(var P in T)T.hasOwnProperty(P)&&(this[P]=T[P])}var I=U.prototype;return I.decimalInteger=function(P){var b=parseInt(this[P],10);return b>Number.MAX_SAFE_INTEGER?Infinity:b},I.hexadecimalInteger=function(P){if(this[P]){var b=(this[P]||"0x").slice(2);b=(b.length&1?"0":"")+b;for(var g=new Uint8Array(b.length/2),k=0;k<b.length/2;k++)g[k]=parseInt(b.slice(k*2,k*2+2),16);return g}else return null},I.hexadecimalIntegerAsNumber=function(P){var b=parseInt(this[P],16);return b>Number.MAX_SAFE_INTEGER?Infinity:b},I.decimalFloatingPoint=function(P){return parseFloat(this[P])},I.optionalFloat=function(P,b){var g=this[P];return g?parseFloat(g):b},I.enumeratedString=function(P){return this[P]},I.bool=function(P){return this[P]==="YES"},I.decimalResolution=function(P){var b=K.exec(this[P]);return b===null?void 0:{width:parseInt(b[1],10),height:parseInt(b[2],10)}},U.parseAttrList=function(P){var b,g={},k='"';for(O.lastIndex=0;(b=O.exec(P))!==null;){var w=b[2];w.indexOf(k)===0&&w.lastIndexOf(k)===w.length-1&&(w=w.slice(1,-1)),g[b[1]]=w}return g},U}()},"./src/utils/binary-search.ts":function(q,G,R){"use strict";R.r(G);var K={search:function(L,U){for(var I=0,T=L.length-1,P=null,b=null;I<=T;){P=(I+T)/2|0,b=L[P];var g=U(b);if(g>0)I=P+1;else if(g<0)T=P-1;else return b}return null}};G.default=K},"./src/utils/buffer-helper.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"BufferHelper",function(){return L});var K=R("./src/utils/logger.ts"),O={length:0,start:function(){return 0},end:function(){return 0}},L=function(){function U(){}return U.isBuffered=function(T,P){try{if(T){for(var b=U.getBuffered(T),g=0;g<b.length;g++)if(P>=b.start(g)&&P<=b.end(g))return!0}}catch(k){}return!1},U.bufferInfo=function(T,P,b){try{if(T){var g=U.getBuffered(T),k=[],w;for(w=0;w<g.length;w++)k.push({start:g.start(w),end:g.end(w)});return this.bufferedInfo(k,P,b)}}catch(p){}return{len:0,start:P,end:P,nextStart:void 0}},U.bufferedInfo=function(T,P,b){P=Math.max(0,P),T.sort(function(m,A){var x=m.start-A.start;return x||A.end-m.end});var g=[];if(b)for(var k=0;k<T.length;k++){var w=g.length;if(w){var p=g[w-1].end;T[k].start-p<b?T[k].end>p&&(g[w-1].end=T[k].end):g.push(T[k])}else g.push(T[k])}else g=T;for(var y=0,f,s=P,c=P,d=0;d<g.length;d++){var S=g[d].start,C=g[d].end;if(P+b>=S&&P<C)s=S,c=C,y=c-P;else if(P+b<S){f=S;break}}return{len:y,start:s||0,end:c||0,nextStart:f}},U.getBuffered=function(T){try{return T.buffered}catch(P){return K.logger.log("failed to get media.buffered",P),O}},U}()},"./src/utils/cea-608-parser.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"Row",function(){return c}),R.d(G,"CaptionScreen",function(){return d});var K=R("./src/utils/logger.ts"),O={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},L=function(l){var a=l;return O.hasOwnProperty(l)&&(a=O[l]),String.fromCharCode(a)},U=15,I=100,T={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},P={17:2,18:4,21:6,22:8,23:10,19:13,20:15},b={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},g={25:2,26:4,29:6,30:8,31:10,27:13,28:15},k=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],w;(function(u){u[u.ERROR=0]="ERROR",u[u.TEXT=1]="TEXT",u[u.WARNING=2]="WARNING",u[u.INFO=2]="INFO",u[u.DEBUG=3]="DEBUG",u[u.DATA=3]="DATA"})(w||(w={}));var p=function(){function u(){this.time=null,this.verboseLevel=w.ERROR}var l=u.prototype;return l.log=function(i,E){this.verboseLevel>=i&&K.logger.log(this.time+" ["+i+"] "+E)},u}(),y=function(l){for(var a=[],i=0;i<l.length;i++)a.push(l[i].toString(16));return a},f=function(){function u(a,i,E,v,_){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=a||"white",this.underline=i||!1,this.italics=E||!1,this.background=v||"black",this.flash=_||!1}var l=u.prototype;return l.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},l.setStyles=function(i){for(var E=["foreground","underline","italics","background","flash"],v=0;v<E.length;v++){var _=E[v];i.hasOwnProperty(_)&&(this[_]=i[_])}},l.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},l.equals=function(i){return this.foreground===i.foreground&&this.underline===i.underline&&this.italics===i.italics&&this.background===i.background&&this.flash===i.flash},l.copy=function(i){this.foreground=i.foreground,this.underline=i.underline,this.italics=i.italics,this.background=i.background,this.flash=i.flash},l.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},u}(),s=function(){function u(a,i,E,v,_,D){this.uchar=void 0,this.penState=void 0,this.uchar=a||" ",this.penState=new f(i,E,v,_,D)}var l=u.prototype;return l.reset=function(){this.uchar=" ",this.penState.reset()},l.setChar=function(i,E){this.uchar=i,this.penState.copy(E)},l.setPenState=function(i){this.penState.copy(i)},l.equals=function(i){return this.uchar===i.uchar&&this.penState.equals(i.penState)},l.copy=function(i){this.uchar=i.uchar,this.penState.copy(i.penState)},l.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},u}(),c=function(){function u(a){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var i=0;i<I;i++)this.chars.push(new s);this.logger=a,this.pos=0,this.currPenState=new f}var l=u.prototype;return l.equals=function(i){for(var E=!0,v=0;v<I;v++)if(!this.chars[v].equals(i.chars[v])){E=!1;break}return E},l.copy=function(i){for(var E=0;E<I;E++)this.chars[E].copy(i.chars[E])},l.isEmpty=function(){for(var i=!0,E=0;E<I;E++)if(!this.chars[E].isEmpty()){i=!1;break}return i},l.setCursor=function(i){this.pos!==i&&(this.pos=i),this.pos<0?(this.logger.log(w.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>I&&(this.logger.log(w.DEBUG,"Too large cursor position "+this.pos),this.pos=I)},l.moveCursor=function(i){var E=this.pos+i;if(i>1)for(var v=this.pos+1;v<E+1;v++)this.chars[v].setPenState(this.currPenState);this.setCursor(E)},l.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},l.insertChar=function(i){i>=144&&this.backSpace();var E=L(i);if(this.pos>=I){this.logger.log(w.ERROR,"Cannot insert "+i.toString(16)+" ("+E+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(E,this.currPenState),this.moveCursor(1)},l.clearFromPos=function(i){var E;for(E=i;E<I;E++)this.chars[E].reset()},l.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},l.clearToEndOfRow=function(){this.clearFromPos(this.pos)},l.getTextString=function(){for(var i=[],E=!0,v=0;v<I;v++){var _=this.chars[v].uchar;_!==" "&&(E=!1),i.push(_)}return E?"":i.join("")},l.setPenStyles=function(i){this.currPenState.setStyles(i);var E=this.chars[this.pos];E.setPenState(this.currPenState)},u}(),d=function(){function u(a){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var i=0;i<U;i++)this.rows.push(new c(a));this.logger=a,this.currRow=U-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var l=u.prototype;return l.reset=function(){for(var i=0;i<U;i++)this.rows[i].clear();this.currRow=U-1},l.equals=function(i){for(var E=!0,v=0;v<U;v++)if(!this.rows[v].equals(i.rows[v])){E=!1;break}return E},l.copy=function(i){for(var E=0;E<U;E++)this.rows[E].copy(i.rows[E])},l.isEmpty=function(){for(var i=!0,E=0;E<U;E++)if(!this.rows[E].isEmpty()){i=!1;break}return i},l.backSpace=function(){var i=this.rows[this.currRow];i.backSpace()},l.clearToEndOfRow=function(){var i=this.rows[this.currRow];i.clearToEndOfRow()},l.insertChar=function(i){var E=this.rows[this.currRow];E.insertChar(i)},l.setPen=function(i){var E=this.rows[this.currRow];E.setPenStyles(i)},l.moveCursor=function(i){var E=this.rows[this.currRow];E.moveCursor(i)},l.setCursor=function(i){this.logger.log(w.INFO,"setCursor: "+i);var E=this.rows[this.currRow];E.setCursor(i)},l.setPAC=function(i){this.logger.log(w.INFO,"pacData = "+JSON.stringify(i));var E=i.row-1;if(this.nrRollUpRows&&E<this.nrRollUpRows-1&&(E=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==E){for(var v=0;v<U;v++)this.rows[v].clear();var _=this.currRow+1-this.nrRollUpRows,D=this.lastOutputScreen;if(D){var B=D.rows[_].cueStartTime,j=this.logger.time;if(B&&j!==null&&B<j)for(var W=0;W<this.nrRollUpRows;W++)this.rows[E-this.nrRollUpRows+W+1].copy(D.rows[_+W])}}this.currRow=E;var h=this.rows[this.currRow];if(i.indent!==null){var N=i.indent,H=Math.max(N-1,0);h.setCursor(i.indent),i.color=h.chars[H].penState.foreground}var X={foreground:i.color,underline:i.underline,italics:i.italics,background:"black",flash:!1};this.setPen(X)},l.setBkgData=function(i){this.logger.log(w.INFO,"bkgData = "+JSON.stringify(i)),this.backSpace(),this.setPen(i),this.insertChar(32)},l.setRollUpRows=function(i){this.nrRollUpRows=i},l.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(w.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(w.TEXT,this.getDisplayText());var i=this.currRow+1-this.nrRollUpRows,E=this.rows.splice(i,1)[0];E.clear(),this.rows.splice(this.currRow,0,E),this.logger.log(w.INFO,"Rolling up")},l.getDisplayText=function(i){i=i||!1;for(var E=[],v="",_=-1,D=0;D<U;D++){var B=this.rows[D].getTextString();B&&(_=D+1,i?E.push("Row "+_+": '"+B+"'"):E.push(B.trim()))}return E.length>0&&(i?v="["+E.join(" | ")+"]":v=E.join(`
`)),v},l.getTextAndFormat=function(){return this.rows},u}(),S=function(){function u(a,i,E){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=a,this.outputFilter=i,this.mode=null,this.verbose=0,this.displayedMemory=new d(E),this.nonDisplayedMemory=new d(E),this.lastOutputScreen=new d(E),this.currRollUpRow=this.displayedMemory.rows[U-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=E}var l=u.prototype;return l.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[U-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},l.getHandler=function(){return this.outputFilter},l.setHandler=function(i){this.outputFilter=i},l.setPAC=function(i){this.writeScreen.setPAC(i)},l.setBkgData=function(i){this.writeScreen.setBkgData(i)},l.setMode=function(i){if(i===this.mode)return;this.mode=i,this.logger.log(w.INFO,"MODE="+i),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=i},l.insertChars=function(i){for(var E=0;E<i.length;E++)this.writeScreen.insertChar(i[E]);var v=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(w.INFO,v+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(w.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},l.ccRCL=function(){this.logger.log(w.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},l.ccBS=function(){if(this.logger.log(w.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},l.ccAOF=function(){},l.ccAON=function(){},l.ccDER=function(){this.logger.log(w.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},l.ccRU=function(i){this.logger.log(w.INFO,"RU("+i+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(i)},l.ccFON=function(){this.logger.log(w.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},l.ccRDC=function(){this.logger.log(w.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},l.ccTR=function(){this.logger.log(w.INFO,"TR"),this.setMode("MODE_TEXT")},l.ccRTD=function(){this.logger.log(w.INFO,"RTD"),this.setMode("MODE_TEXT")},l.ccEDM=function(){this.logger.log(w.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},l.ccCR=function(){this.logger.log(w.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},l.ccENM=function(){this.logger.log(w.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},l.ccEOC=function(){if(this.logger.log(w.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var i=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=i,this.writeScreen=this.nonDisplayedMemory,this.logger.log(w.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},l.ccTO=function(i){this.logger.log(w.INFO,"TO("+i+") - Tab Offset"),this.writeScreen.moveCursor(i)},l.ccMIDROW=function(i){var E={flash:!1};if(E.underline=i%2===1,E.italics=i>=46,E.italics)E.foreground="white";else{var v=Math.floor(i/2)-16,_=["white","green","blue","cyan","red","yellow","magenta"];E.foreground=_[v]}this.logger.log(w.INFO,"MIDROW: "+JSON.stringify(E)),this.writeScreen.setPen(E)},l.outputDataUpdate=function(i){i===void 0&&(i=!1);var E=this.logger.time;if(E===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=E:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,E,this.lastOutputScreen),i&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:E),this.lastOutputScreen.copy(this.displayedMemory))},l.cueSplitAtTime=function(i){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,i,this.displayedMemory),this.cueStartTime=i))},u}(),C=function(){function u(a,i,E){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var v=new p;this.channels=[null,new S(a,i,v),new S(a+1,E,v)],this.cmdHistory=x(),this.logger=v}var l=u.prototype;return l.getHandler=function(i){return this.channels[i].getHandler()},l.setHandler=function(i,E){this.channels[i].setHandler(E)},l.addData=function(i,E){var v,_,D,B=!1;this.logger.time=i;for(var j=0;j<E.length;j+=2){if(_=E[j]&127,D=E[j+1]&127,_===0&&D===0)continue;if(this.logger.log(w.DATA,"["+y([E[j],E[j+1]])+"] -> ("+y([_,D])+")"),v=this.parseCmd(_,D),v||(v=this.parseMidrow(_,D)),v||(v=this.parsePAC(_,D)),v||(v=this.parseBackgroundAttributes(_,D)),!v&&(B=this.parseChars(_,D),B)){var W=this.currentChannel;if(W&&W>0){var h=this.channels[W];h.insertChars(B)}else this.logger.log(w.WARNING,"No channel found yet. TEXT-MODE?")}!v&&!B&&this.logger.log(w.WARNING,"Couldn't parse cleaned data "+y([_,D])+" orig: "+y([E[j],E[j+1]]))}},l.parseCmd=function(i,E){var v=this.cmdHistory,_=(i===20||i===28||i===21||i===29)&&E>=32&&E<=47,D=(i===23||i===31)&&E>=33&&E<=35;if(!(_||D))return!1;if(A(i,E,v))return m(null,null,v),this.logger.log(w.DEBUG,"Repeated command ("+y([i,E])+") is dropped"),!0;var B=i===20||i===21||i===23?1:2,j=this.channels[B];return i===20||i===21||i===28||i===29?E===32?j.ccRCL():E===33?j.ccBS():E===34?j.ccAOF():E===35?j.ccAON():E===36?j.ccDER():E===37?j.ccRU(2):E===38?j.ccRU(3):E===39?j.ccRU(4):E===40?j.ccFON():E===41?j.ccRDC():E===42?j.ccTR():E===43?j.ccRTD():E===44?j.ccEDM():E===45?j.ccCR():E===46?j.ccENM():E===47&&j.ccEOC():j.ccTO(E-32),m(i,E,v),this.currentChannel=B,!0},l.parseMidrow=function(i,E){var v=0;if((i===17||i===25)&&E>=32&&E<=47){if(i===17?v=1:v=2,v!==this.currentChannel)return this.logger.log(w.ERROR,"Mismatch channel in midrow parsing"),!1;var _=this.channels[v];return _?(_.ccMIDROW(E),this.logger.log(w.DEBUG,"MIDROW ("+y([i,E])+")"),!0):!1}return!1},l.parsePAC=function(i,E){var v,_=this.cmdHistory,D=(i>=17&&i<=23||i>=25&&i<=31)&&E>=64&&E<=127,B=(i===16||i===24)&&E>=64&&E<=95;if(!(D||B))return!1;if(A(i,E,_))return m(null,null,_),!0;var j=i<=23?1:2;E>=64&&E<=95?v=j===1?T[i]:b[i]:v=j===1?P[i]:g[i];var W=this.channels[j];return W?(W.setPAC(this.interpretPAC(v,E)),m(i,E,_),this.currentChannel=j,!0):!1},l.interpretPAC=function(i,E){var v,_={color:null,italics:!1,indent:null,underline:!1,row:i};return E>95?v=E-96:v=E-64,_.underline=(v&1)===1,v<=13?_.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(v/2)]:v<=15?(_.italics=!0,_.color="white"):_.indent=Math.floor((v-16)/2)*4,_},l.parseChars=function(i,E){var v,_=null,D=null;if(i>=25?(v=2,D=i-8):(v=1,D=i),D>=17&&D<=19){var B;D===17?B=E+80:D===18?B=E+112:B=E+144,this.logger.log(w.INFO,"Special char '"+L(B)+"' in channel "+v),_=[B]}else i>=32&&i<=127&&(_=E===0?[i]:[i,E]);if(_){var j=y(_);this.logger.log(w.DEBUG,"Char codes = "+j.join(",")),m(i,E,this.cmdHistory)}return _},l.parseBackgroundAttributes=function(i,E){var v=(i===16||i===24)&&E>=32&&E<=47,_=(i===23||i===31)&&E>=45&&E<=47;if(!(v||_))return!1;var D,B={};i===16||i===24?(D=Math.floor((E-32)/2),B.background=k[D],E%2===1&&(B.background=B.background+"_semi")):E===45?B.background="transparent":(B.foreground="black",E===47&&(B.underline=!0));var j=i<=23?1:2,W=this.channels[j];return W.setBkgData(B),m(i,E,this.cmdHistory),!0},l.reset=function(){for(var i=0;i<Object.keys(this.channels).length;i++){var E=this.channels[i];E&&E.reset()}this.cmdHistory=x()},l.cueSplitAtTime=function(i){for(var E=0;E<this.channels.length;E++){var v=this.channels[E];v&&v.cueSplitAtTime(i)}},u}();function m(u,l,a){a.a=u,a.b=l}function A(u,l,a){return a.a===u&&a.b===l}function x(){return{a:null,b:null}}G.default=C},"./src/utils/codecs.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"isCodecType",function(){return O}),R.d(G,"isCodecSupportedInMp4",function(){return L});var K={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}};function O(U,I){var T=K[I];return!!T&&T[U.slice(0,4)]===!0}function L(U,I){return MediaSource.isTypeSupported((I||"video")+'/mp4;codecs="'+U+'"')}},"./src/utils/cues.ts":function(q,G,R){"use strict";R.r(G);var K=R("./src/utils/vttparser.ts"),O=R("./src/utils/webvtt-parser.ts"),L=R("./src/utils/texttrack-utils.ts"),U=/\s/,I={newCue:function(P,b,g,k){for(var w=[],p,y,f,s,c,d=self.VTTCue||self.TextTrackCue,S=0;S<k.rows.length;S++)if(p=k.rows[S],f=!0,s=0,c="",!p.isEmpty()){for(var C=0;C<p.chars.length;C++)U.test(p.chars[C].uchar)&&f?s++:(c+=p.chars[C].uchar,f=!1);p.cueStartTime=b,b===g&&(g+=1e-4),s>=16?s--:s++;var m=Object(K.fixLineBreaks)(c.trim()),A=Object(O.generateCueId)(b,g,m);(!P||!P.cues||!P.cues.getCueById(A))&&(y=new d(b,g,m),y.id=A,y.line=S+1,y.align="left",y.position=10+Math.min(80,Math.floor(s*8/32)*10),w.push(y))}return P&&w.length&&(w.sort(function(x,u){return x.line==="auto"||u.line==="auto"?0:x.line>8&&u.line>8?u.line-x.line:x.line-u.line}),w.forEach(function(x){return Object(L.addCueToTrack)(P,x)})),w}};G.default=I},"./src/utils/discontinuities.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"findFirstFragWithCC",function(){return U}),R.d(G,"shouldAlignOnDiscontinuities",function(){return I}),R.d(G,"findDiscontinuousReferenceFrag",function(){return T}),R.d(G,"adjustSlidingStart",function(){return b}),R.d(G,"alignStream",function(){return g}),R.d(G,"alignPDT",function(){return w}),R.d(G,"alignFragmentByPDTDelta",function(){return p}),R.d(G,"alignMediaPlaylistByPDT",function(){return y});var K=R("./src/polyfills/number.ts"),O=R("./src/utils/logger.ts"),L=R("./src/controller/level-helper.ts");function U(f,s){for(var c=null,d=0,S=f.length;d<S;d++){var C=f[d];if(C&&C.cc===s){c=C;break}}return c}function I(f,s,c){return!!(s.details&&(c.endCC>c.startCC||f&&f.cc<c.startCC))}function T(f,s){var c=f.fragments,d=s.fragments;if(!d.length||!c.length){O.logger.log("No fragments to align");return}var S=U(c,d[0].cc);if(!S||S&&!S.startPTS){O.logger.log("No frag in previous level to align on");return}return S}function P(f,s){if(f){var c=f.start+s;f.start=f.startPTS=c,f.endPTS=c+f.duration}}function b(f,s){for(var c=s.fragments,d=0,S=c.length;d<S;d++)P(c[d],f);s.fragmentHint&&P(s.fragmentHint,f),s.alignedSliding=!0}function g(f,s,c){if(!s)return;k(f,c,s),!c.alignedSliding&&s.details&&w(c,s.details),!c.alignedSliding&&s.details&&!c.skippedSegments&&Object(L.adjustSliding)(s.details,c)}function k(f,s,c){if(I(f,c,s)){var d=T(c.details,s);d&&Object(K.isFiniteNumber)(d.start)&&(O.logger.log("Adjusting PTS using last level due to CC increase within current level "+s.url),b(d.start,s))}}function w(f,s){if(!s.fragments.length||!f.hasProgramDateTime||!s.hasProgramDateTime)return;var c=s.fragments[0].programDateTime,d=f.fragments[0].programDateTime,S=(d-c)/1e3+s.fragments[0].start;S&&Object(K.isFiniteNumber)(S)&&(O.logger.log("Adjusting PTS using programDateTime delta "+(d-c)+"ms, sliding:"+S.toFixed(3)+" "+f.url+" "),b(S,f))}function p(f,s){var c=f.programDateTime;if(!c)return;var d=(c-s)/1e3;f.start=f.startPTS=d,f.endPTS=d+f.duration}function y(f,s){if(!s.fragments.length||!f.hasProgramDateTime||!s.hasProgramDateTime)return;var c=s.fragments[0].programDateTime,d=s.fragments[0].start,S=c-d*1e3;f.fragments.forEach(function(C){p(C,S)}),f.fragmentHint&&p(f.fragmentHint,S),f.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(q,G,R){"use strict";R.r(G);var K=R("./src/utils/ewma.ts"),O=function(){function L(I,T,P){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=P,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new K.default(I),this.fast_=new K.default(T)}var U=L.prototype;return U.update=function(T,P){var b=this.slow_,g=this.fast_;this.slow_.halfLife!==T&&(this.slow_=new K.default(T,b.getEstimate(),b.getTotalWeight())),this.fast_.halfLife!==P&&(this.fast_=new K.default(P,g.getEstimate(),g.getTotalWeight()))},U.sample=function(T,P){T=Math.max(T,this.minDelayMs_);var b=8*P,g=T/1e3,k=b/g;this.fast_.sample(g,k),this.slow_.sample(g,k)},U.canEstimate=function(){var T=this.fast_;return T&&T.getTotalWeight()>=this.minWeight_},U.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},U.destroy=function(){},L}();G.default=O},"./src/utils/ewma.ts":function(q,G,R){"use strict";R.r(G);var K=function(){function O(U,I,T){I===void 0&&(I=0),T===void 0&&(T=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=U,this.alpha_=U?Math.exp(Math.log(.5)/U):0,this.estimate_=I,this.totalWeight_=T}var L=O.prototype;return L.sample=function(I,T){var P=Math.pow(this.alpha_,I);this.estimate_=T*(1-P)+P*this.estimate_,this.totalWeight_+=I},L.getTotalWeight=function(){return this.totalWeight_},L.getEstimate=function(){if(this.alpha_){var I=1-Math.pow(this.alpha_,this.totalWeight_);if(I)return this.estimate_/I}return this.estimate_},O}();G.default=K},"./src/utils/fetch-loader.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"fetchSupported",function(){return p});var K=R("./src/polyfills/number.ts"),O=R("./src/loader/load-stats.ts"),L=R("./src/demux/chunk-cache.ts");function U(d,S){d.prototype=Object.create(S.prototype),d.prototype.constructor=d,g(d,S)}function I(d){var S=typeof Map=="function"?new Map:void 0;return I=function(m){if(m===null||!b(m))return m;if(typeof m!="function")throw new TypeError("Super expression must either be null or a function");if(typeof S!="undefined"){if(S.has(m))return S.get(m);S.set(m,A)}function A(){return T(m,arguments,k(this).constructor)}return A.prototype=Object.create(m.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),g(A,m)},I(d)}function T(d,S,C){return P()?T=Reflect.construct:T=function(A,x,u){var l=[null];l.push.apply(l,x);var a=Function.bind.apply(A,l),i=new a;return u&&g(i,u.prototype),i},T.apply(null,arguments)}function P(){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(d){return!1}}function b(d){return Function.toString.call(d).indexOf("[native code]")!==-1}function g(d,S){return g=Object.setPrototypeOf||function(m,A){return m.__proto__=A,m},g(d,S)}function k(d){return k=Object.setPrototypeOf?Object.getPrototypeOf:function(C){return C.__proto__||Object.getPrototypeOf(C)},k(d)}function w(){return w=Object.assign||function(d){for(var S=1;S<arguments.length;S++){var C=arguments[S];for(var m in C)Object.prototype.hasOwnProperty.call(C,m)&&(d[m]=C[m])}return d},w.apply(this,arguments)}function p(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(d){}return!1}var y=function(){function d(C){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=C.fetchSetup||s,this.controller=new self.AbortController,this.stats=new O.LoadStats}var S=d.prototype;return S.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},S.abortInternal=function(){var m=this.response;(!m||!m.ok)&&(this.stats.aborted=!0,this.controller.abort())},S.abort=function(){var m;this.abortInternal(),(m=this.callbacks)!==null&&m!==void 0&&m.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},S.load=function(m,A,x){var u=this,l=this.stats;if(l.loading.start)throw new Error("Loader can only be used once.");l.loading.start=self.performance.now();var a=f(m,this.controller.signal),i=x.onProgress,E=m.responseType==="arraybuffer",v=E?"byteLength":"length";this.context=m,this.config=A,this.callbacks=x,this.request=this.fetchSetup(m,a),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){u.abortInternal(),x.onTimeout(l,m,u.response)},A.timeout),self.fetch(this.request).then(function(_){if(u.response=u.loader=_,!_.ok){var D=_.status,B=_.statusText;throw new c(B||"fetch, bad network response",D,_)}return l.loading.first=Math.max(self.performance.now(),l.loading.start),l.total=parseInt(_.headers.get("Content-Length")||"0"),i&&Object(K.isFiniteNumber)(A.highWaterMark)?u.loadProgressively(_,l,m,A.highWaterMark,i):E?_.arrayBuffer():_.text()}).then(function(_){var D=u.response;self.clearTimeout(u.requestTimeout),l.loading.end=Math.max(self.performance.now(),l.loading.first),l.loaded=l.total=_[v];var B={url:D.url,data:_};i&&!Object(K.isFiniteNumber)(A.highWaterMark)&&i(l,m,_,D),x.onSuccess(B,l,m,D)}).catch(function(_){if(self.clearTimeout(u.requestTimeout),l.aborted)return;var D=_.code||0;x.onError({code:D,text:_.message},m,_.details)})},S.getCacheAge=function(){var m=null;if(this.response){var A=this.response.headers.get("age");m=A?parseFloat(A):null}return m},S.loadProgressively=function(m,A,x,u,l){u===void 0&&(u=0);var a=new L.default,i=m.body.getReader(),E=function v(){return i.read().then(function(_){if(_.done)return a.dataLength&&l(A,x,a.flush(),m),Promise.resolve(new ArrayBuffer(0));var D=_.value,B=D.length;return A.loaded+=B,B<u||a.dataLength?(a.push(D),a.dataLength>=u&&l(A,x,a.flush(),m)):l(A,x,D,m),v()}).catch(function(){return Promise.reject()})};return E()},d}();function f(d,S){var C={method:"GET",mode:"cors",credentials:"same-origin",signal:S,headers:new self.Headers(w({},d.headers))};return d.rangeEnd&&C.headers.set("Range","bytes="+d.rangeStart+"-"+String(d.rangeEnd-1)),C}function s(d,S){return new self.Request(d.url,S)}var c=function(d){U(S,d);function S(C,m,A){var x;return x=d.call(this,C)||this,x.code=void 0,x.details=void 0,x.code=m,x.details=A,x}return S}(I(Error));G.default=y},"./src/utils/imsc1-ttml-parser.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"IMSC1_CODEC",function(){return b}),R.d(G,"parseIMSC1",function(){return p});var K=R("./src/utils/mp4-tools.ts"),O=R("./src/utils/vttparser.ts"),L=R("./src/utils/vttcue.ts"),U=R("./src/demux/id3.ts"),I=R("./src/utils/timescale-conversion.ts"),T=R("./src/utils/webvtt-parser.ts");function P(){return P=Object.assign||function(u){for(var l=1;l<arguments.length;l++){var a=arguments[l];for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(u[i]=a[i])}return u},P.apply(this,arguments)}var b="stpp.ttml.im1t",g=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,k=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,w={left:"start",center:"center",right:"end",start:"start",end:"end"};function p(u,l,a,i,E){var v=Object(K.findBox)(new Uint8Array(u),["mdat"]);if(v.length===0){E(new Error("Could not parse IMSC1 mdat"));return}var _=v[0],D=Object(U.utf8ArrayToStr)(new Uint8Array(u,_.start,_.end-_.start)),B=Object(I.toTimescaleFromScale)(l,1,a);try{i(y(D,B))}catch(j){E(j)}}function y(u,l){var a=new DOMParser,i=a.parseFromString(u,"text/xml"),E=i.getElementsByTagName("tt")[0];if(!E)throw new Error("Invalid ttml");var v={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},_=Object.keys(v).reduce(function(h,N){return h[N]=E.getAttribute("ttp:"+N)||v[N],h},{}),D=E.getAttribute("xml:space")!=="preserve",B=s(f(E,"styling","style")),j=s(f(E,"layout","region")),W=f(E,"body","[begin]");return[].map.call(W,function(h){var N=c(h,D);if(!N||!h.hasAttribute("begin"))return null;var H=m(h.getAttribute("begin"),_),X=m(h.getAttribute("dur"),_),Y=m(h.getAttribute("end"),_);if(H===null)throw C(h);if(Y===null){if(X===null)throw C(h);Y=H+X}var re=new L.default(H-l,Y-l,N);re.id=Object(T.generateCueId)(re.startTime,re.endTime,re.text);var he=j[h.getAttribute("region")],de=B[h.getAttribute("style")];re.position=10,re.size=80;var ne=d(he,de),ae=ne.textAlign;if(ae){var le=w[ae];le&&(re.lineAlign=le),re.align=ae}return P(re,ne),re}).filter(function(h){return h!==null})}function f(u,l,a){var i=u.getElementsByTagName(l)[0];return i?[].slice.call(i.querySelectorAll(a)):[]}function s(u){return u.reduce(function(l,a){var i=a.getAttribute("xml:id");return i&&(l[i]=a),l},{})}function c(u,l){return[].slice.call(u.childNodes).reduce(function(a,i,E){var v;return i.nodeName==="br"&&E?a+`
`:(v=i.childNodes)!==null&&v!==void 0&&v.length?c(i,l):l?a+i.textContent.trim().replace(/\s+/g," "):a+i.textContent},"")}function d(u,l){var a="http://www.w3.org/ns/ttml#styling",i=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return i.reduce(function(E,v){var _=S(l,a,v)||S(u,a,v);return _&&(E[v]=_),E},{})}function S(u,l,a){return u.hasAttributeNS(l,a)?u.getAttributeNS(l,a):null}function C(u){return new Error("Could not parse ttml timestamp "+u)}function m(u,l){if(!u)return null;var a=Object(O.parseTimeStamp)(u);return a===null&&(g.test(u)?a=A(u,l):k.test(u)&&(a=x(u,l))),a}function A(u,l){var a=g.exec(u),i=(a[4]|0)+(a[5]|0)/l.subFrameRate;return(a[1]|0)*3600+(a[2]|0)*60+(a[3]|0)+i/l.frameRate}function x(u,l){var a=k.exec(u),i=Number(a[1]),E=a[2];switch(E){case"h":return i*3600;case"m":return i*60;case"ms":return i*1e3;case"f":return i/l.frameRate;case"t":return i/l.tickRate}return i}},"./src/utils/logger.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"enableLogs",function(){return T}),R.d(G,"logger",function(){return P});var K=function(){},O={trace:K,debug:K,log:K,warn:K,info:K,error:K},L=O;function U(b){var g=self.console[b];return g?g.bind(self.console,"["+b+"] >"):K}function I(b){for(var g=arguments.length,k=new Array(g>1?g-1:0),w=1;w<g;w++)k[w-1]=arguments[w];k.forEach(function(p){L[p]=b[p]?b[p].bind(b):U(p)})}function T(b){if(self.console&&b===!0||typeof b=="object"){I(b,"debug","log","info","warn","error");try{L.log()}catch(g){L=O}}else L=O}var P=L},"./src/utils/mediakeys-helper.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"KeySystems",function(){return K}),R.d(G,"requestMediaKeySystemAccess",function(){return O});var K;(function(L){L.WIDEVINE="com.widevine.alpha",L.PLAYREADY="com.microsoft.playready"})(K||(K={}));var O=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"getMediaSource",function(){return K});function K(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"bin2str",function(){return I}),R.d(G,"readUint16",function(){return T}),R.d(G,"readUint32",function(){return P}),R.d(G,"writeUint32",function(){return b}),R.d(G,"findBox",function(){return g}),R.d(G,"parseSegmentIndex",function(){return k}),R.d(G,"parseInitSegment",function(){return w}),R.d(G,"getStartDTS",function(){return p}),R.d(G,"getDuration",function(){return y}),R.d(G,"computeRawDurationFromSamples",function(){return f}),R.d(G,"offsetStartDTS",function(){return s}),R.d(G,"segmentValidRange",function(){return c}),R.d(G,"appendUint8Array",function(){return d});var K=R("./src/utils/typed-array.ts"),O=R("./src/loader/fragment.ts"),L=Math.pow(2,32)-1,U=[].push;function I(S){return String.fromCharCode.apply(null,S)}function T(S,C){"data"in S&&(C+=S.start,S=S.data);var m=S[C]<<8|S[C+1];return m<0?65536+m:m}function P(S,C){"data"in S&&(C+=S.start,S=S.data);var m=S[C]<<24|S[C+1]<<16|S[C+2]<<8|S[C+3];return m<0?4294967296+m:m}function b(S,C,m){"data"in S&&(C+=S.start,S=S.data),S[C]=m>>24,S[C+1]=m>>16&255,S[C+2]=m>>8&255,S[C+3]=m&255}function g(S,C){var m=[];if(!C.length)return m;var A,x,u;"data"in S?(A=S.data,x=S.start,u=S.end):(A=S,x=0,u=A.byteLength);for(var l=x;l<u;){var a=P(A,l),i=I(A.subarray(l+4,l+8)),E=a>1?l+a:u;if(i===C[0])if(C.length===1)m.push({data:A,start:l+8,end:E});else{var v=g({data:A,start:l+8,end:E},C.slice(1));v.length&&U.apply(m,v)}l=E}return m}function k(S){var C=g(S,["moov"]),m=C[0],A=m?m.end:null,x=g(S,["sidx"]);if(!x||!x[0])return null;var u=[],l=x[0],a=l.data[0],i=a===0?8:16,E=P(l,i);i+=4;var v=0,_=0;a===0?i+=8:i+=16,i+=2;var D=l.end+_,B=T(l,i);i+=2;for(var j=0;j<B;j++){var W=i,h=P(l,W);W+=4;var N=h&2147483647,H=(h&2147483648)>>>31;if(H===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var X=P(l,W);W+=4,u.push({referenceSize:N,subsegmentDuration:X,info:{duration:X/E,start:D,end:D+N-1}}),D+=N,W+=4,i=W}return{earliestPresentationTime:v,timescale:E,version:a,referencesCount:B,references:u,moovEndOffset:A}}function w(S){for(var C=[],m=g(S,["moov","trak"]),A=0;A<m.length;A++){var x=m[A],u=g(x,["tkhd"])[0];if(u){var l=u.data[u.start],a=l===0?12:20,i=P(u,a),E=g(x,["mdia","mdhd"])[0];if(E){l=E.data[E.start],a=l===0?12:20;var v=P(E,a),_=g(x,["mdia","hdlr"])[0];if(_){var D=I(_.data.subarray(_.start+8,_.start+12)),B={soun:O.ElementaryStreamTypes.AUDIO,vide:O.ElementaryStreamTypes.VIDEO}[D];if(B){var j=g(x,["mdia","minf","stbl","stsd"])[0],W=void 0;j&&(W=I(j.data.subarray(j.start+12,j.start+16))),C[i]={timescale:v,type:B},C[B]={timescale:v,id:i,codec:W}}}}}}var h=g(S,["moov","mvex","trex"]);return h.forEach(function(N){var H=P(N,4),X=C[H];X&&(X.default={duration:P(N,12),flags:P(N,20)})}),C}function p(S,C){return g(C,["moof","traf"]).reduce(function(m,A){var x=g(A,["tfdt"])[0],u=x.data[x.start],l=g(A,["tfhd"]).reduce(function(a,i){var E=P(i,4),v=S[E];if(v){var _=P(x,4);u===1&&(_*=Math.pow(2,32),_+=P(x,8));var D=v.timescale||9e4,B=_/D;if(isFinite(B)&&(a===null||B<a))return B}return a},null);return l!==null&&isFinite(l)&&(m===null||l<m)?l:m},null)||0}function y(S,C){for(var m=0,A=0,x=0,u=g(S,["moof","traf"]),l=0;l<u.length;l++){var a=u[l],i=g(a,["tfhd"])[0],E=P(i,4),v=C[E];if(!v)continue;var _=v.default,D=P(i,0)|(_==null?void 0:_.flags),B=_==null?void 0:_.duration;D&8&&(D&2?B=P(i,12):B=P(i,8));for(var j=v.timescale||9e4,W=g(a,["trun"]),h=0;h<W.length;h++){if(B){var N=P(W[h],4);m=B*N}else m=f(W[h]);v.type===O.ElementaryStreamTypes.VIDEO?A+=m/j:v.type===O.ElementaryStreamTypes.AUDIO&&(x+=m/j)}}if(A===0&&x===0){var H=k(S);if(H!=null&&H.references)return H.references.reduce(function(X,Y){return X+Y.info.duration||0},0)}return A||x}function f(S){var C=P(S,0),m=8;C&1&&(m+=4),C&4&&(m+=4);for(var A=0,x=P(S,4),u=0;u<x;u++){if(C&256){var l=P(S,m);A+=l,m+=4}C&512&&(m+=4),C&1024&&(m+=4),C&2048&&(m+=4)}return A}function s(S,C,m){g(C,["moof","traf"]).forEach(function(A){g(A,["tfhd"]).forEach(function(x){var u=P(x,4),l=S[u];if(!l)return;var a=l.timescale||9e4;g(A,["tfdt"]).forEach(function(i){var E=i.data[i.start],v=P(i,4);if(E===0)b(i,4,v-m*a);else{v*=Math.pow(2,32),v+=P(i,8),v-=m*a,v=Math.max(v,0);var _=Math.floor(v/(L+1)),D=Math.floor(v%(L+1));b(i,4,_),b(i,8,D)}})})})}function c(S){var C={valid:null,remainder:null},m=g(S,["moof"]);if(m){if(m.length<2)return C.remainder=S,C}else return C;var A=m[m.length-1];return C.valid=Object(K.sliceUint8)(S,0,A.start-8),C.remainder=Object(K.sliceUint8)(S,A.start-8),C}function d(S,C){var m=new Uint8Array(S.length+C.length);return m.set(S),m.set(C,S.length),m}},"./src/utils/output-filter.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"default",function(){return K});var K=function(){function O(U,I){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=U,this.trackName=I}var L=O.prototype;return L.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},L.newCue=function(I,T,P){(this.startTime===null||this.startTime>I)&&(this.startTime=I),this.endTime=T,this.screen=P,this.timelineController.createCaptionsTrack(this.trackName)},L.reset=function(){this.cueRanges=[]},O}()},"./src/utils/texttrack-utils.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"sendAddTrackEvent",function(){return O}),R.d(G,"addCueToTrack",function(){return L}),R.d(G,"clearCurrentCues",function(){return U}),R.d(G,"removeCuesInRange",function(){return I}),R.d(G,"getCuesInRange",function(){return P});var K=R("./src/utils/logger.ts");function O(b,g){var k;try{k=new Event("addtrack")}catch(w){k=document.createEvent("Event"),k.initEvent("addtrack",!1,!1)}k.track=b,g.dispatchEvent(k)}function L(b,g){var k=b.mode;if(k==="disabled"&&(b.mode="hidden"),b.cues&&!b.cues.getCueById(g.id))try{if(b.addCue(g),!b.cues.getCueById(g.id))throw new Error("addCue is failed for: "+g)}catch(p){K.logger.debug("[texttrack-utils]: "+p);var w=new self.TextTrackCue(g.startTime,g.endTime,g.text);w.id=g.id,b.addCue(w)}k==="disabled"&&(b.mode=k)}function U(b){var g=b.mode;if(g==="disabled"&&(b.mode="hidden"),b.cues)for(var k=b.cues.length;k--;)b.removeCue(b.cues[k]);g==="disabled"&&(b.mode=g)}function I(b,g,k){var w=b.mode;if(w==="disabled"&&(b.mode="hidden"),b.cues&&b.cues.length>0)for(var p=P(b.cues,g,k),y=0;y<p.length;y++)b.removeCue(p[y]);w==="disabled"&&(b.mode=w)}function T(b,g){if(g<b[0].startTime)return 0;var k=b.length-1;if(g>b[k].endTime)return-1;for(var w=0,p=k;w<=p;){var y=Math.floor((p+w)/2);if(g<b[y].startTime)p=y-1;else if(g>b[y].startTime&&w<k)w=y+1;else return y}return b[w].startTime-g<g-b[p].startTime?w:p}function P(b,g,k){var w=[],p=T(b,g);if(p>-1)for(var y=p,f=b.length;y<f;y++){var s=b[y];if(s.startTime>=g&&s.endTime<=k)w.push(s);else if(s.startTime>k)return w}return w}},"./src/utils/time-ranges.ts":function(q,G,R){"use strict";R.r(G);var K={toString:function(L){for(var U="",I=L.length,T=0;T<I;T++)U+="["+L.start(T).toFixed(3)+","+L.end(T).toFixed(3)+"]";return U}};G.default=K},"./src/utils/timescale-conversion.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"toTimescaleFromBase",function(){return O}),R.d(G,"toTimescaleFromScale",function(){return L}),R.d(G,"toMsFromMpegTsClock",function(){return U}),R.d(G,"toMpegTsClockFromTimescale",function(){return I});var K=9e4;function O(T,P,b,g){b===void 0&&(b=1),g===void 0&&(g=!1);var k=T*P*b;return g?Math.round(k):k}function L(T,P,b,g){return b===void 0&&(b=1),g===void 0&&(g=!1),O(T,P,1/b,g)}function U(T,P){return P===void 0&&(P=!1),O(T,1e3,1/K,P)}function I(T,P){return P===void 0&&(P=1),O(T,K,1/P)}},"./src/utils/typed-array.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"sliceUint8",function(){return K});function K(O,L,U){return Uint8Array.prototype.slice?O.slice(L,U):new Uint8Array(Array.prototype.slice.call(O,L,U))}},"./src/utils/vttcue.ts":function(q,G,R){"use strict";R.r(G),G.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var K=["","lr","rl"],O=["start","middle","end","left","right"];function L(b,g){if(typeof g!="string")return!1;if(!Array.isArray(b))return!1;var k=g.toLowerCase();return~b.indexOf(k)?k:!1}function U(b){return L(K,b)}function I(b){return L(O,b)}function T(b){for(var g=arguments.length,k=new Array(g>1?g-1:0),w=1;w<g;w++)k[w-1]=arguments[w];for(var p=1;p<arguments.length;p++){var y=arguments[p];for(var f in y)b[f]=y[f]}return b}function P(b,g,k){var w=this,p={enumerable:!0};w.hasBeenReset=!1;var y="",f=!1,s=b,c=g,d=k,S=null,C="",m=!0,A="auto",x="start",u=50,l="middle",a=50,i="middle";Object.defineProperty(w,"id",T({},p,{get:function(){return y},set:function(v){y=""+v}})),Object.defineProperty(w,"pauseOnExit",T({},p,{get:function(){return f},set:function(v){f=!!v}})),Object.defineProperty(w,"startTime",T({},p,{get:function(){return s},set:function(v){if(typeof v!="number")throw new TypeError("Start time must be set to a number.");s=v,this.hasBeenReset=!0}})),Object.defineProperty(w,"endTime",T({},p,{get:function(){return c},set:function(v){if(typeof v!="number")throw new TypeError("End time must be set to a number.");c=v,this.hasBeenReset=!0}})),Object.defineProperty(w,"text",T({},p,{get:function(){return d},set:function(v){d=""+v,this.hasBeenReset=!0}})),Object.defineProperty(w,"region",T({},p,{get:function(){return S},set:function(v){S=v,this.hasBeenReset=!0}})),Object.defineProperty(w,"vertical",T({},p,{get:function(){return C},set:function(v){var _=U(v);if(_===!1)throw new SyntaxError("An invalid or illegal string was specified.");C=_,this.hasBeenReset=!0}})),Object.defineProperty(w,"snapToLines",T({},p,{get:function(){return m},set:function(v){m=!!v,this.hasBeenReset=!0}})),Object.defineProperty(w,"line",T({},p,{get:function(){return A},set:function(v){if(typeof v!="number"&&v!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");A=v,this.hasBeenReset=!0}})),Object.defineProperty(w,"lineAlign",T({},p,{get:function(){return x},set:function(v){var _=I(v);if(!_)throw new SyntaxError("An invalid or illegal string was specified.");x=_,this.hasBeenReset=!0}})),Object.defineProperty(w,"position",T({},p,{get:function(){return u},set:function(v){if(v<0||v>100)throw new Error("Position must be between 0 and 100.");u=v,this.hasBeenReset=!0}})),Object.defineProperty(w,"positionAlign",T({},p,{get:function(){return l},set:function(v){var _=I(v);if(!_)throw new SyntaxError("An invalid or illegal string was specified.");l=_,this.hasBeenReset=!0}})),Object.defineProperty(w,"size",T({},p,{get:function(){return a},set:function(v){if(v<0||v>100)throw new Error("Size must be between 0 and 100.");a=v,this.hasBeenReset=!0}})),Object.defineProperty(w,"align",T({},p,{get:function(){return i},set:function(v){var _=I(v);if(!_)throw new SyntaxError("An invalid or illegal string was specified.");i=_,this.hasBeenReset=!0}})),w.displayState=void 0}return P.prototype.getCueAsHTML=function(){var b=self.WebVTT;return b.convertCueToDOMTree(self,this.text)},P}()},"./src/utils/vttparser.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"parseTimeStamp",function(){return L}),R.d(G,"fixLineBreaks",function(){return g}),R.d(G,"VTTParser",function(){return k});var K=R("./src/utils/vttcue.ts"),O=function(){function w(){}var p=w.prototype;return p.decode=function(f,s){if(!f)return"";if(typeof f!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(f))},w}();function L(w){function p(f,s,c,d){return(f|0)*3600+(s|0)*60+(c|0)+parseFloat(d||0)}var y=w.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return y?parseFloat(y[2])>59?p(y[2],y[3],0,y[4]):p(y[1],y[2],y[3],y[4]):null}var U=function(){function w(){this.values=Object.create(null)}var p=w.prototype;return p.set=function(f,s){!this.get(f)&&s!==""&&(this.values[f]=s)},p.get=function(f,s,c){return c?this.has(f)?this.values[f]:s[c]:this.has(f)?this.values[f]:s},p.has=function(f){return f in this.values},p.alt=function(f,s,c){for(var d=0;d<c.length;++d)if(s===c[d]){this.set(f,s);break}},p.integer=function(f,s){/^-?\d+$/.test(s)&&this.set(f,parseInt(s,10))},p.percent=function(f,s){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(s)){var c=parseFloat(s);if(c>=0&&c<=100)return this.set(f,c),!0}return!1},w}();function I(w,p,y,f){var s=f?w.split(f):[w];for(var c in s){if(typeof s[c]!="string")continue;var d=s[c].split(y);if(d.length!==2)continue;var S=d[0],C=d[1];p(S,C)}}var T=new K.default(0,0,""),P=T.align==="middle"?"middle":"center";function b(w,p,y){var f=w;function s(){var S=L(w);if(S===null)throw new Error("Malformed timestamp: "+f);return w=w.replace(/^[^\sa-zA-Z-]+/,""),S}function c(S,C){var m=new U;I(S,function(u,l){var a;switch(u){case"region":for(var i=y.length-1;i>=0;i--)if(y[i].id===l){m.set(u,y[i].region);break}break;case"vertical":m.alt(u,l,["rl","lr"]);break;case"line":a=l.split(","),m.integer(u,a[0]),m.percent(u,a[0])&&m.set("snapToLines",!1),m.alt(u,a[0],["auto"]),a.length===2&&m.alt("lineAlign",a[1],["start",P,"end"]);break;case"position":a=l.split(","),m.percent(u,a[0]),a.length===2&&m.alt("positionAlign",a[1],["start",P,"end","line-left","line-right","auto"]);break;case"size":m.percent(u,l);break;case"align":m.alt(u,l,["start",P,"end","left","right"]);break}},/:/,/\s/),C.region=m.get("region",null),C.vertical=m.get("vertical","");var A=m.get("line","auto");A==="auto"&&T.line===-1&&(A=-1),C.line=A,C.lineAlign=m.get("lineAlign","start"),C.snapToLines=m.get("snapToLines",!0),C.size=m.get("size",100),C.align=m.get("align",P);var x=m.get("position","auto");x==="auto"&&T.position===50&&(x=C.align==="start"||C.align==="left"?0:C.align==="end"||C.align==="right"?100:50),C.position=x}function d(){w=w.replace(/^\s+/,"")}if(d(),p.startTime=s(),d(),w.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+f);w=w.substr(3),d(),p.endTime=s(),d(),c(w,p)}function g(w){return w.replace(/<br(?: \/)?>/gi,`
`)}var k=function(){function w(){this.state="INITIAL",this.buffer="",this.decoder=new O,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var p=w.prototype;return p.parse=function(f){var s=this;f&&(s.buffer+=s.decoder.decode(f,{stream:!0}));function c(){var x=s.buffer,u=0;for(x=g(x);u<x.length&&x[u]!=="\r"&&x[u]!==`
`;)++u;var l=x.substr(0,u);return x[u]==="\r"&&++u,x[u]===`
`&&++u,s.buffer=x.substr(u),l}function d(x){I(x,function(u,l){},/:/)}try{var S="";if(s.state==="INITIAL"){if(!/\r\n|\n/.test(s.buffer))return this;S=c();var C=S.match(/^()?WEBVTT([ \t].*)?$/);if(!C||!C[0])throw new Error("Malformed WebVTT signature.");s.state="HEADER"}for(var m=!1;s.buffer;){if(!/\r\n|\n/.test(s.buffer))return this;m?m=!1:S=c();switch(s.state){case"HEADER":/:/.test(S)?d(S):S||(s.state="ID");continue;case"NOTE":S||(s.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(S)){s.state="NOTE";break}if(!S)continue;if(s.cue=new K.default(0,0,""),s.state="CUE",S.indexOf("-->")===-1){s.cue.id=S;continue}case"CUE":if(!s.cue){s.state="BADCUE";continue}try{b(S,s.cue,s.regionList)}catch(x){s.cue=null,s.state="BADCUE";continue}s.state="CUETEXT";continue;case"CUETEXT":{var A=S.indexOf("-->")!==-1;if(!S||A&&(m=!0)){s.oncue&&s.cue&&s.oncue(s.cue),s.cue=null,s.state="ID";continue}if(s.cue===null)continue;s.cue.text&&(s.cue.text+=`
`),s.cue.text+=S}continue;case"BADCUE":S||(s.state="ID")}}}catch(x){s.state==="CUETEXT"&&s.cue&&s.oncue&&s.oncue(s.cue),s.cue=null,s.state=s.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},p.flush=function(){var f=this;try{if((f.cue||f.state==="HEADER")&&(f.buffer+=`
`,f.parse()),f.state==="INITIAL"||f.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(s){f.onparsingerror&&f.onparsingerror(s)}return f.onflush&&f.onflush(),this},w}()},"./src/utils/webvtt-parser.ts":function(q,G,R){"use strict";R.r(G),R.d(G,"generateCueId",function(){return k}),R.d(G,"parseWebVTT",function(){return p});var K=R("./src/polyfills/number.ts"),O=R("./src/utils/vttparser.ts"),L=R("./src/demux/id3.ts"),U=R("./src/utils/timescale-conversion.ts"),I=R("./src/remux/mp4-remuxer.ts"),T=/\r\n|\n\r|\n|\r/g,P=function(f,s,c){return c===void 0&&(c=0),f.substr(c,s.length)===s},b=function(f){var s=parseInt(f.substr(-3)),c=parseInt(f.substr(-6,2)),d=parseInt(f.substr(-9,2)),S=f.length>9?parseInt(f.substr(0,f.indexOf(":"))):0;if(!Object(K.isFiniteNumber)(s)||!Object(K.isFiniteNumber)(c)||!Object(K.isFiniteNumber)(d)||!Object(K.isFiniteNumber)(S))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+f);return s+=1e3*c,s+=60*1e3*d,s+=60*60*1e3*S,s},g=function(f){for(var s=5381,c=f.length;c;)s=s*33^f.charCodeAt(--c);return(s>>>0).toString()};function k(y,f,s){return g(y.toString())+g(f.toString())+g(s)}var w=function(f,s,c){var d=f[s],S=f[d.prevCC];if(!S||!S.new&&d.new){f.ccOffset=f.presentationOffset=d.start,d.new=!1;return}for(;(C=S)!==null&&C!==void 0&&C.new;){var C;f.ccOffset+=d.start-S.start,d.new=!1,d=S,S=f[d.prevCC]}f.presentationOffset=c};function p(y,f,s,c,d,S,C,m){var A=new O.VTTParser,x=Object(L.utf8ArrayToStr)(new Uint8Array(y)).trim().replace(T,`
`).split(`
`),u=[],l=Object(U.toMpegTsClockFromTimescale)(f,s),a="00:00.000",i=0,E=0,v,_=!0,D=!1;A.oncue=function(B){var j=c[d],W=c.ccOffset,h=(i-l)/9e4;if(j!=null&&j.new&&(E!==void 0?W=c.ccOffset=j.start:w(c,d,h)),h&&(W=h-c.presentationOffset),D){var N=B.endTime-B.startTime,H=Object(I.normalizePts)((B.startTime+W-E)*9e4,S*9e4)/9e4;B.startTime=H,B.endTime=H+N}var X=B.text.trim();B.text=decodeURIComponent(encodeURIComponent(X)),B.id||(B.id=k(B.startTime,B.endTime,X)),B.endTime>0&&u.push(B)},A.onparsingerror=function(B){v=B},A.onflush=function(){if(v){m(v);return}C(u)},x.forEach(function(B){if(_)if(P(B,"X-TIMESTAMP-MAP=")){_=!1,D=!0,B.substr(16).split(",").forEach(function(j){P(j,"LOCAL:")?a=j.substr(6):P(j,"MPEGTS:")&&(i=parseInt(j.substr(7)))});try{E=b(a)/1e3}catch(j){D=!1,v=j}return}else B===""&&(_=!1);A.parse(B+`
`)}),A.flush()}},"./src/utils/xhr-loader.ts":function(q,G,R){"use strict";R.r(G);var K=R("./src/utils/logger.ts"),O=R("./src/loader/load-stats.ts"),L=/^age:\s*[\d.]+\s*$/m,U=function(){function I(P){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=P?P.xhrSetup:null,this.stats=new O.LoadStats,this.retryDelay=0}var T=I.prototype;return T.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},T.abortInternal=function(){var b=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),b&&(b.onreadystatechange=null,b.onprogress=null,b.readyState!==4&&(this.stats.aborted=!0,b.abort()))},T.abort=function(){var b;this.abortInternal(),(b=this.callbacks)!==null&&b!==void 0&&b.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},T.load=function(b,g,k){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=b,this.config=g,this.callbacks=k,this.retryDelay=g.retryDelay,this.loadInternal()},T.loadInternal=function(){var b=this.config,g=this.context;if(!b)return;var k=this.loader=new self.XMLHttpRequest,w=this.stats;w.loading.first=0,w.loaded=0;var p=this.xhrSetup;try{if(p)try{p(k,g.url)}catch(s){k.open("GET",g.url,!0),p(k,g.url)}k.readyState||k.open("GET",g.url,!0);var y=this.context.headers;if(y)for(var f in y)k.setRequestHeader(f,y[f])}catch(s){this.callbacks.onError({code:k.status,text:s.message},g,k);return}g.rangeEnd&&k.setRequestHeader("Range","bytes="+g.rangeStart+"-"+(g.rangeEnd-1)),k.onreadystatechange=this.readystatechange.bind(this),k.onprogress=this.loadprogress.bind(this),k.responseType=g.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),b.timeout),k.send()},T.readystatechange=function(){var b=this.context,g=this.loader,k=this.stats;if(!b||!g)return;var w=g.readyState,p=this.config;if(k.aborted)return;if(w>=2)if(self.clearTimeout(this.requestTimeout),k.loading.first===0&&(k.loading.first=Math.max(self.performance.now(),k.loading.start)),w===4){g.onreadystatechange=null,g.onprogress=null;var y=g.status;if(y>=200&&y<300){k.loading.end=Math.max(self.performance.now(),k.loading.first);var f,s;if(b.responseType==="arraybuffer"?(f=g.response,s=f.byteLength):(f=g.responseText,s=f.length),k.loaded=k.total=s,!this.callbacks)return;var c=this.callbacks.onProgress;if(c&&c(k,b,f,g),!this.callbacks)return;var d={url:g.responseURL,data:f};this.callbacks.onSuccess(d,k,b,g)}else k.retry>=p.maxRetry||y>=400&&y<499?(K.logger.error(y+" while loading "+b.url),this.callbacks.onError({code:y,text:g.statusText},b,g)):(K.logger.warn(y+" while loading "+b.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,p.maxRetryDelay),k.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),p.timeout)},T.loadtimeout=function(){K.logger.warn("timeout while loading "+this.context.url);var b=this.callbacks;b&&(this.abortInternal(),b.onTimeout(this.stats,this.context,this.loader))},T.loadprogress=function(b){var g=this.stats;g.loaded=b.loaded,b.lengthComputable&&(g.total=b.total)},T.getCacheAge=function(){var b=null;if(this.loader&&L.test(this.loader.getAllResponseHeaders())){var g=this.loader.getResponseHeader("age");b=g?parseFloat(g):null}return b},I}();G.default=U}}).default})},vHTk:function(at,Ne,F){at.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},vkP9:function(at,Ne,F){"use strict";var q=F("+L6B"),G=F("2/Rp"),R=F("5NDa"),K=F("5rEg"),O=F("y8nQ"),L=F("Vl3Y"),U=F("tJVT"),I=F("cDcd"),T=F.n(I),P=F("a+yL"),b=F.n(P),g=function(w){var p=w.value,y=w.onChange,f=L.a.useForm(),s=Object(U.a)(f,1),c=s[0];Object(I.useEffect)(function(){p&&c.setFieldsValue(p)},p);var d=function(C){y(C)};return T.a.createElement("div",{className:b.a.search},T.a.createElement(L.a,{className:b.a.formWrap,colon:!1,form:c,size:"large",layout:"inline",onFinish:d},T.a.createElement(L.a.Item,{label:"\u5B9E\u8BAD\u4FE1\u606F",name:"keyword",initialValue:""},T.a.createElement(K.a,{style:{width:280,height:40}})),T.a.createElement(L.a.Item,{label:"\u5B66\u6821/\u5355\u4F4D",name:"schools",initialValue:"",style:{margin:"0 40px"}},T.a.createElement(K.a,{style:{width:280,height:40}})),T.a.createElement(L.a.Item,{label:"\u521B\u5EFA\u8005",name:"creator",initialValue:""},T.a.createElement(K.a,{style:{width:200,height:40}})),T.a.createElement(G.a,{className:b.a.btn,type:"primary",htmlType:"submit"},"\u641C\u7D22")))};Ne.a=g},wNkr:function(at,Ne){at.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="},wU8J:function(at,Ne){function F(){this.buffer=new Array,this.length=0}F.prototype={get:function(q){var G=Math.floor(q/8);return(this.buffer[G]>>>7-q%8&1)==1},put:function(q,G){for(var R=0;R<G;R++)this.putBit((q>>>G-R-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(q){var G=Math.floor(this.length/8);this.buffer.length<=G&&this.buffer.push(0),q&&(this.buffer[G]|=128>>>this.length%8),this.length++}},at.exports=F},xTzM:function(at,Ne){at.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(at,Ne,F){at.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"}}}]);