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

133 lines
796 KiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[221,7,9],{"+NIl":function(we,Ae,Q){(function(q){q(Q("VrN/"))})(function(q){"use strict";q.defineMode("stex",function(G,D){"use strict";function K(C,S){C.cmdState.push(S)}function P(C){return C.cmdState.length>0?C.cmdState[C.cmdState.length-1]:null}function M(C){var S=C.cmdState.pop();S&&S.closeBracket()}function U(C){for(var S=C.cmdState,A=S.length-1;A>=0;A--){var d=S[A];if(d.name=="DEFAULT")continue;return d}return{styleIdentifier:function(){return null}}}function B(C,S,A){return function(){this.name=C,this.bracketNo=0,this.style=S,this.styles=A,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var I={};I.importmodule=B("importmodule","tag",["string","builtin"]),I.documentclass=B("documentclass","tag",["","atom"]),I.usepackage=B("usepackage","tag",["atom"]),I.begin=B("begin","tag",["atom"]),I.end=B("end","tag",["atom"]),I.label=B("label","tag",["atom"]),I.ref=B("ref","tag",["atom"]),I.eqref=B("eqref","tag",["atom"]),I.cite=B("cite","tag",["atom"]),I.bibitem=B("bibitem","tag",["atom"]),I.Bibitem=B("Bibitem","tag",["atom"]),I.RBibitem=B("RBibitem","tag",["atom"]),I.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function R(C,S){C.f=S}function g(C,S){var A;if(C.match(/^\\[a-zA-Z@]+/)){var d=C.current().slice(1);return A=I.hasOwnProperty(d)?I[d]:I.DEFAULT,A=new A,K(S,A),R(S,L),A.style}if(C.match(/^\\[$&%#{}_]/))return"tag";if(C.match(/^\\[,;!\/\\]/))return"tag";if(C.match("\\["))return R(S,function(l,u){return T(l,u,"\\]")}),"keyword";if(C.match("\\("))return R(S,function(l,u){return T(l,u,"\\)")}),"keyword";if(C.match("$$"))return R(S,function(l,u){return T(l,u,"$$")}),"keyword";if(C.match("$"))return R(S,function(l,u){return T(l,u,"$")}),"keyword";var o=C.next();if(o=="%")return C.skipToEnd(),"comment";if(o=="}"||o=="]"){if(A=P(S),A)A.closeBracket(o),R(S,L);else return"error";return"bracket"}else return o=="{"||o=="["?(A=I.DEFAULT,A=new A,K(S,A),"bracket"):/\d/.test(o)?(C.eatWhile(/[\w.%]/),"atom"):(C.eatWhile(/[\w\-_]/),A=U(S),A.name=="begin"&&(A.argument=C.current()),A.styleIdentifier())}function T(C,S,A){if(C.eatSpace())return null;if(A&&C.match(A))return R(S,g),"keyword";if(C.match(/^\\[a-zA-Z@]+/))return"tag";if(C.match(/^[a-zA-Z]+/))return"variable-2";if(C.match(/^\\[$&%#{}_]/))return"tag";if(C.match(/^\\[,;!\/]/))return"tag";if(C.match(/^[\^_&]/))return"tag";if(C.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(C.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var d=C.next();return d=="{"||d=="}"||d=="["||d=="]"||d=="("||d==")"?"bracket":d=="%"?(C.skipToEnd(),"comment"):"error"}function L(C,S){var A=C.peek(),d;return A=="{"||A=="["?(d=P(S),d.openBracket(A),C.eat(A),R(S,g),"bracket"):/[ \t\r]/.test(A)?(C.eat(A),null):(R(S,g),M(S),g(C,S))}return{startState:function(){var C=D.inMathMode?function(S,A){return T(S,A)}:g;return{cmdState:[],f:C}},copyState:function(C){return{cmdState:C.cmdState.slice(),f:C.f}},token:function(C,S){return S.f(C,S)},blankLine:function(C){C.f=g,C.cmdState.length=0},lineComment:"%"}}),q.defineMIME("text/x-stex","stex"),q.defineMIME("text/x-latex","stex")})},"/GNS":function(we,Ae,Q){we.exports=Q.p+"static/search1.c4136dd4.png"},"19Vz":function(we,Ae,Q){(function(q){q(Q("VrN/"))})(function(q){q.defineOption("placeholder","",function(B,I,R){var g=R&&R!=q.Init;if(I&&!g)B.on("blur",P),B.on("change",M),B.on("swapDoc",M),q.on(B.getInputField(),"compositionupdate",B.state.placeholderCompose=function(){K(B)}),M(B);else if(!I&&g){B.off("blur",P),B.off("change",M),B.off("swapDoc",M),q.off(B.getInputField(),"compositionupdate",B.state.placeholderCompose),G(B);var T=B.getWrapperElement();T.className=T.className.replace(" CodeMirror-empty","")}I&&!B.hasFocus()&&P(B)});function G(B){B.state.placeholder&&(B.state.placeholder.parentNode.removeChild(B.state.placeholder),B.state.placeholder=null)}function D(B){G(B);var I=B.state.placeholder=document.createElement("pre");I.style.cssText="height: 0; overflow: visible",I.style.direction=B.getOption("direction"),I.className="CodeMirror-placeholder CodeMirror-line-like";var R=B.getOption("placeholder");typeof R=="string"&&(R=document.createTextNode(R)),I.appendChild(R),B.display.lineSpace.insertBefore(I,B.display.lineSpace.firstChild)}function K(B){setTimeout(function(){var I=!1,R=B.getInputField();R.nodeName=="TEXTAREA"?I=!R.value:B.lineCount()==1&&(I=!/[^\u200b]/.test(R.querySelector(".CodeMirror-line").textContent)),I?D(B):G(B)},20)}function P(B){U(B)&&D(B)}function M(B){var I=B.getWrapperElement(),R=U(B);I.className=I.className.replace(" CodeMirror-empty","")+(R?" CodeMirror-empty":""),R?D(B):G(B)}function U(B){return B.lineCount()===1&&B.getLine(0)===""}})},"1eCo":function(we,Ae,Q){(function(q){q(Q("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},D={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};q.defineMode("xml",function(K,P){var M=K.indentUnit,U={},B=P.htmlMode?G:D;for(var I in B)U[I]=B[I];for(var I in P)U[I]=P[I];var R,g;function T(a,v){function p(N){return v.tokenize=N,N(a,v)}var b=a.next();if(b=="<")return a.eat("!")?a.eat("[")?a.match("CDATA[")?p(S("atom","]]>")):null:a.match("--")?p(S("comment","-->")):a.match("DOCTYPE",!0,!0)?(a.eatWhile(/[\w\._\-]/),p(A(1))):null:a.eat("?")?(a.eatWhile(/[\w\._\-]/),v.tokenize=S("meta","?>"),"meta"):(R=a.eat("/")?"closeTag":"openTag",v.tokenize=L,"tag bracket");if(b=="&"){var O;return a.eat("#")?a.eat("x")?O=a.eatWhile(/[a-fA-F\d]/)&&a.eat(";"):O=a.eatWhile(/[\d]/)&&a.eat(";"):O=a.eatWhile(/[\w\.\-:]/)&&a.eat(";"),O?"atom":"error"}else return a.eatWhile(/[^&<]/),null}T.isInText=!0;function L(a,v){var p=a.next();if(p==">"||p=="/"&&a.eat(">"))return v.tokenize=T,R=p==">"?"endTag":"selfcloseTag","tag bracket";if(p=="=")return R="equals",null;if(p=="<"){v.tokenize=T,v.state=u,v.tagName=v.tagStart=null;var b=v.tokenize(a,v);return b?b+" tag error":"tag error"}else return/[\'\"]/.test(p)?(v.tokenize=C(p),v.stringStartCol=a.column(),v.tokenize(a,v)):(a.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function C(a){var v=function(p,b){for(;!p.eol();)if(p.next()==a){b.tokenize=L;break}return"string"};return v.isInAttribute=!0,v}function S(a,v){return function(p,b){for(;!p.eol();){if(p.match(v)){b.tokenize=T;break}p.next()}return a}}function A(a){return function(v,p){for(var b;(b=v.next())!=null;){if(b=="<")return p.tokenize=A(a+1),p.tokenize(v,p);if(b==">")if(a==1){p.tokenize=T;break}else return p.tokenize=A(a-1),p.tokenize(v,p)}return"meta"}}function d(a,v,p){this.prev=a.context,this.tagName=v,this.indent=a.indented,this.startOfLine=p,(U.doNotIndent.hasOwnProperty(v)||a.context&&a.context.noIndent)&&(this.noIndent=!0)}function o(a){a.context&&(a.context=a.context.prev)}function l(a,v){for(var p;;){if(!a.context)return;if(p=a.context.tagName,!U.contextGrabbers.hasOwnProperty(p)||!U.contextGrabbers[p].hasOwnProperty(v))return;o(a)}}function u(a,v,p){return a=="openTag"?(p.tagStart=v.column(),y):a=="closeTag"?m:u}function y(a,v,p){return a=="word"?(p.tagName=v.current(),g="tag",E):U.allowMissingTagName&&a=="endTag"?(g="tag bracket",E(a,v,p)):(g="error",y)}function m(a,v,p){if(a=="word"){var b=v.current();return p.context&&p.context.tagName!=b&&U.implicitlyClosed.hasOwnProperty(p.context.tagName)&&o(p),p.context&&p.context.tagName==b||U.matchClosing===!1?(g="tag",h):(g="tag error",w)}else return U.allowMissingTagName&&a=="endTag"?(g="tag bracket",h(a,v,p)):(g="error",w)}function h(a,v,p){return a!="endTag"?(g="error",h):(o(p),u)}function w(a,v,p){return g="error",h(a,v,p)}function E(a,v,p){if(a=="word")return g="attribute",f;if(a=="endTag"||a=="selfcloseTag"){var b=p.tagName,O=p.tagStart;return p.tagName=p.tagStart=null,a=="selfcloseTag"||U.autoSelfClosers.hasOwnProperty(b)?l(p,b):(l(p,b),p.context=new d(p,b,O==p.indented)),u}return g="error",E}function f(a,v,p){return a=="equals"?c:(U.allowMissing||(g="error"),E(a,v,p))}function c(a,v,p){return a=="string"?s:a=="word"&&U.allowUnquoted?(g="string",E):(g="error",E(a,v,p))}function s(a,v,p){return a=="string"?s:E(a,v,p)}return{startState:function(a){var v={tokenize:T,state:u,indented:a||0,tagName:null,tagStart:null,context:null};return a!=null&&(v.baseIndent=a),v},token:function(a,v){if(!v.tagName&&a.sol()&&(v.indented=a.indentation()),a.eatSpace())return null;R=null;var p=v.tokenize(a,v);return(p||R)&&p!="comment"&&(g=null,v.state=v.state(R||p,a,v),g&&(p=g=="error"?p+" error":g)),p},indent:function(a,v,p){var b=a.context;if(a.tokenize.isInAttribute)return a.tagStart==a.indented?a.stringStartCol+1:a.indented+M;if(b&&b.noIndent)return q.Pass;if(a.tokenize!=L&&a.tokenize!=T)return p?p.match(/^(\s*)/)[0].length:0;if(a.tagName)return U.multilineTagIndentPastTag!==!1?a.tagStart+a.tagName.length+2:a.tagStart+M*(U.multilineTagIndentFactor||1);if(U.alignCDATA&&/<!\[CDATA\[/.test(v))return 0;var O=v&&/^<(\/)?([\w_:\.-]*)/.exec(v);if(O&&O[1])for(;b;)if(b.tagName==O[2]){b=b.prev;break}else if(U.implicitlyClosed.hasOwnProperty(b.tagName))b=b.prev;else break;else if(O)for(;b;){var N=U.contextGrabbers[b.tagName];if(N&&N.hasOwnProperty(O[2]))b=b.prev;else break}for(;b&&b.prev&&!b.startOfLine;)b=b.prev;return b?b.indent+M:a.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:U.htmlMode?"html":"xml",helperType:U.htmlMode?"html":"xml",skipAttribute:function(a){a.state==c&&(a.state=E)},xmlCurrentTag:function(a){return a.tagName?{name:a.tagName,close:a.type=="closeTag"}:null},xmlCurrentContext:function(a){for(var v=[],p=a.context;p;p=p.prev)p.tagName&&v.push(p.tagName);return v.reverse()}}}),q.defineMIME("text/xml","xml"),q.defineMIME("application/xml","xml"),q.mimeModes.hasOwnProperty("text/html")||q.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"4YB9":function(we,Ae,Q){"use strict";var q=Q("cDcd"),G=Q.n(q),D=Q("Ty5D"),K=Q("55Ip"),P=Q("W1YM"),M=Q.n(P);Ae.a=function(U){var B=U.activeIndex,I=Object(D.i)(),R=I.id,g=I.challengesId,T=Object(q.useMemo)(function(){return[{name:"1\u3001\u672C\u5173\u4EFB\u52A1",url:"/shixuns/".concat(R,"/challenges/").concat(g,"/editcheckpoint")},{name:"2\u3001\u8BC4\u6D4B\u8BBE\u7F6E",url:"/shixuns/".concat(R,"/challenges/").concat(g,"/tab=2")},{name:"3\u3001\u53C2\u8003\u7B54\u6848",url:"/shixuns/".concat(R,"/challenges/").concat(g,"/tab=3")},{name:"4\u3001\u5173\u5361\u6392\u884C\u699C",url:"/shixuns/".concat(R,"/challenges/").concat(g,"/tab=4")}]},[R,g]);return G.a.createElement("ul",{className:"challenge-nav"},T.map(function(L,C){return B===C?G.a.createElement("li",{key:L.url}," ",G.a.createElement("a",{className:"active"},L.name)," "):G.a.createElement("li",{key:L.url}," ",G.a.createElement(K.a,{to:L.url},L.name)," ")}))}},"4qgm":function(we,Ae){we.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAAwCAYAAABE1blzAAAIeUlEQVRoQ72aa2wU1xXHf2dm1jYEBClJGgofIFJLU0W04AdQWgJSW0UprZRIpB/aJBTxStIShWchJvbytA2lBCKKeajhQ5s2tGpFK1G1UowqKNjYBkraJCqqiCDEDZSncezdmTnVnd2FxaztmfWaa632w9459/7v75xzz71j4R61ssM6TkrYqMon3qesPjFNLt6LoWWgB5n1ttr/GcMCLKrE5qFgPJf3gRXN5XJgoMcfUIFlR/QxiqgVhyfVA/MxTWKgPuZvL51UtUyTjwdK6IAI/NLbWlQylhctWC0xPuN35Zi+gFUMfpIzoqxsLpffDoTIggssb9KvqLBJYnxD3dvUepq8OIAPqux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VSMHbDuyO5CMQGAS/Rtf6U55Q3sNnZj2jFRgZ3FBcBSwQ83pTOG7z5EQMy11i2cyu4COQqBDxaMq8BvXPVrN3JugiEiYClC0CY/bnVXQRii0DHWkEJbYKG95ABnmSX6LFdFnc0pxEISXTPWTxaN+Ztn+US3Wng3f5ii4A50U/hydOZeT94P8rkEj22y+KO5jQCRkT3eI6T5GnPHH/ea5foTgPv9hdbBLIS/RD58t7C7C0rAyfiEj22y+KO5jQCmYm+j3yeG5m97ZvgYVyiOw28219sEfATfTd5klozZ2vAR6b8U3GJHttlcUdzGgFF9J8gbyvmb/nFrHuX6E4D7/YXWwTurLWJQnnbMGPLnlADu0SP7bK4ozmNQLe6pZn2wwGrbv8PSygpSs9Cw9cAAAAASUVORK5CYII="},"55Ip":function(we,Ae,Q){"use strict";Q.d(Ae,"a",function(){return l});var q=Q("Ty5D"),G=Q("dI71"),D=Q("cDcd"),K=Q.n(D),P=Q("YS25"),M=Q("17x9"),U=Q.n(M),B=Q("wx14"),I=Q("zLVn"),R=Q("9R94"),g=function(c){Object(G.a)(s,c);function s(){for(var v,p=arguments.length,b=new Array(p),O=0;O<p;O++)b[O]=arguments[O];return v=c.call.apply(c,[this].concat(b))||this,v.history=Object(P.a)(v.props),v}var a=s.prototype;return a.render=function(){return K.a.createElement(q.c,{history:this.history,children:this.props.children})},s}(K.a.Component),T=function(c){Object(G.a)(s,c);function s(){for(var v,p=arguments.length,b=new Array(p),O=0;O<p;O++)b[O]=arguments[O];return v=c.call.apply(c,[this].concat(b))||this,v.history=Object(P.b)(v.props),v}var a=s.prototype;return a.render=function(){return K.a.createElement(q.c,{history:this.history,children:this.props.children})},s}(K.a.Component),L=function(s,a){return typeof s=="function"?s(a):s},C=function(s,a){return typeof s=="string"?Object(P.c)(s,null,null,a):s},S=function(s){return s},A=K.a.forwardRef;typeof A=="undefined"&&(A=S);function d(c){return!!(c.metaKey||c.altKey||c.ctrlKey||c.shiftKey)}var o=A(function(c,s){var a=c.innerRef,v=c.navigate,p=c.onClick,b=Object(I.a)(c,["innerRef","navigate","onClick"]),O=b.target,N=Object(B.a)({},b,{onClick:function(V){try{p&&p(V)}catch(F){throw V.preventDefault(),F}!V.defaultPrevented&&V.button===0&&(!O||O==="_self")&&!d(V)&&(V.preventDefault(),v())}});return S!==A?N.ref=s||a:N.ref=a,K.a.createElement("a",N)}),l=A(function(c,s){var a=c.component,v=a===void 0?o:a,p=c.replace,b=c.to,O=c.innerRef,N=Object(I.a)(c,["component","replace","to","innerRef"]);return K.a.createElement(q.e.Consumer,null,function(W){W||Object(R.a)(!1);var V=W.history,F=C(L(b,W.location),W.location),_=F?V.createHref(F):"",J=Object(B.a)({},N,{href:_,navigate:function(){var oe=L(b,W.location),de=p?V.replace:V.push;de(oe)}});return S!==A?J.ref=s||O:J.innerRef=O,K.a.createElement(v,J)})});if(!1)var u,y;var m=function(s){return s},h=K.a.forwardRef;typeof h=="undefined"&&(h=m);function w(){for(var c=arguments.length,s=new Array(c),a=0;a<c;a++)s[a]=arguments[a];return s.filter(function(v){return v}).join(" ")}var E=h(function(c,s){var a=c["aria-current"],v=a===void 0?"page":a,p=c.activeClassName,b=p===void 0?"active":p,O=c.activeStyle,N=c.className,W=c.exact,V=c.isActive,F=c.location,_=c.sensitive,J=c.strict,ee=c.style,oe=c.to,de=c.innerRef,Ce=Object(I.a)(c,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return K.a.createElement(q.e.Consumer,null,function(ge){ge||Object(R.a)(!1);var pe=F||ge.location,ce=C(L(oe,pe),pe),he=ce.pathname,ne=he&&he.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),ue=ne?Object(q.f)(pe.pathname,{path:ne,exact:W,sensitive:_,strict:J}):null,Ee=!!(V?V(ue,pe):ue),_e=Ee?w(N,b):N,Oe=Ee?Object(B.a)({},ee,{},O):ee,Ne=Object(B.a)({"aria-current":Ee&&v||null,className:_e,style:Oe,to:ce},Ce);return m!==h?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("OaEy"),d=Q("2fM7"),o=Q("WmNS"),l=Q.n(o),u=Q("cDcd"),y=Q.n(u),m=Q("9kvl"),h=Q("Ot1p"),w=Q("HBuW"),E=Q("E3HF"),f=Q.n(E),c=Q("9ZNV"),s=Q("CJF0"),a=Q("4YB9"),v=d.a.Option,p=S.a.TextArea,b=function(N){var W=N.shixunsDetail,V=N.dispatch,F=N.loading,_=N.match,J=Object(L.a)(N,["shixunsDetail","dispatch","loading","match"]),ee=Object(u.useState)({}),oe=Object(T.a)(ee,2),de=oe[0],Ce=oe[1],ge=Object(u.useState)([]),pe=Object(T.a)(ge,2),ce=pe[0],he=pe[1];Object(u.useEffect)(function(){return V({type:"globalSetting/footerToggle",payload:!1}),function(){V({type:"globalSetting/footerToggle",payload:!0})}},[]),Object(u.useEffect)(function(){ne(),ue()},[]);var ne=function(){var _e=Object(g.a)(l.a.mark(function Oe(){var Ne;return l.a.wrap(function(xe){for(;;)switch(xe.prev=xe.next){case 0:return xe.next=2,Object(w.H)({id:_.params.id,challengeId:_.params.challengesId,tab:2});case 2:Ne=xe.sent,Ne&&Ce(Ne);case 4:case"end":return xe.stop()}},Oe)}));return function(){return _e.apply(this,arguments)}}(),ue=function(){var _e=Object(g.a)(l.a.mark(function Oe(){var Ne;return l.a.wrap(function(xe){for(;;)switch(xe.prev=xe.next){case 0:return xe.next=2,Object(w.I)({id:_.params.id,challengeId:_.params.challengesId});case 2:Ne=xe.sent,Ne&&he(Ne);case 4:case"end":return xe.stop()}},Oe)}));return function(){return _e.apply(this,arguments)}}(),Ee=function(){var _e=Object(g.a)(l.a.mark(function Oe(){var Ne,je,xe;return l.a.wrap(function(Ie){for(;;)switch(Ie.prev=Ie.next){case 0:if(Ne=ce.map(function(Fe){return Fe.score}),je=Ne.reduce(function(Fe,He){return Fe+He},0),!(je!==100&&ce!==null&&ce!==void 0&&ce.length)){Ie.next=5;break}return R.b.info("\u6D4B\u8BD5\u96C6\u7684\u8BC4\u5206\u5360\u6BD4\u4E4B\u548C\u5FC5\u987B\u7B49\u4E8E100"),Ie.abrupt("return");case 5:if(ce.every(function(Fe){return Fe.name})){Ie.next=8;break}return R.b.info("\u8BF7\u5148\u586B\u5199\u53C2\u8003\u7B54\u6848\u540D\u79F0"),Ie.abrupt("return");case 8:if(ce.every(function(Fe){return Fe.contents})){Ie.next=11;break}return R.b.info("\u8BF7\u5148\u586B\u5199\u53C2\u8003\u7B54\u6848\u5185\u5BB9"),Ie.abrupt("return");case 11:return Ie.next=13,Object(w.Lb)({id:_.params.id,challengeId:_.params.challengesId,challenge_answer:ce});case 13:xe=Ie.sent,xe!=null&&xe.message&&R.b.info(xe.message),xe.status===1&&m.d.push("/shixuns/".concat(_.params.id,"/challenges/").concat(_.params.challengesId,"/tab=4"));case 16:case"end":return Ie.stop()}},Oe)}));return function(){return _e.apply(this,arguments)}}();return y.a.createElement("section",{className:f.a.bg},y.a.createElement("aside",{className:"bg-white mb10 pl20 pr20 "},y.a.createElement(s.a,{data:de,title:"\u5B9E\u8DF5\u9898"})),y.a.createElement(a.a,{activeIndex:2}),y.a.createElement("div",{className:f.a.fieldWrap},y.a.createElement("p",{className:"font14"},"\u53EF\u4EE5\u5C06\u53C2\u8003\u7B54\u6848\u5206\u7EA7\u8BBE\u7F6E\uFF0C\u8BA9\u5B66\u5458\u81EA\u884C\u9009\u62E9\u7EA7\u522B\uFF0C\u6BCF\u7EA7\u67E5\u770B\u540E\u6309\u7167\u6BD4\u4F8B\u6263\u5206\u503C\uFF08\u5B66\u5458\u5DF2\u5B8C\u6210\u4EFB\u52A1\u518D\u67E5\u770B\uFF0C\u5219\u4E0D\u5F71\u54CD\u5B66\u5458\u5DF2\u83B7\u5F97\u7684\u6210\u7EE9\uFF09"),y.a.createElement("div",null,y.a.createElement("div",null,"\u793A\u4F8B\uFF1A\u7EA7\u522B1\uFF0C\u6263\u51CF\u5206\u503C\u5360\u6BD425%\uFF1B\u7EA7\u522B2\uFF0C\u6263\u51CF\u5206\u503C\u5360\u6BD435%\uFF1B\u7EA7\u522B3\uFF0C\u6263\u51CF\u5206\u503C\u5360\u6BD440%\uFF1B"),y.a.createElement("div",{className:"mt5 ml40"},"\u82E5\u5B66\u5458\u9009\u62E9\u67E5\u770B\u7EA7\u522B1\u7684\u7B54\u6848\uFF0C\u5C06\u88AB\u6263\u51CF25%\u7684\u5206\u503C\uFF1B\u9009\u62E9\u67E5\u770B\u7EA7\u522B2\u7684\u7B54\u6848\uFF0C\u5C06\u88AB\u6263\u51CF60%\u7684\u5206\u503C\uFF1B\u9009\u62E9\u67E5\u770B\u7EA7\u522B3\u7684\u7B54\u6848\uFF0C\u5C06\u88AB\u6263\u51CF100%\u7684\u5206\u503C\u3002")),ce==null?void 0:ce.map(function(_e,Oe){return y.a.createElement("div",{className:"mt30"},y.a.createElement("div",{className:f.a.flexRow},y.a.createElement("div",{className:"font16"},"\u7EA7\u522B\uFF1A",Oe+1),y.a.createElement("div",{className:"tr flex1"},y.a.createElement(B.a,{placement:"bottom",title:"\u5220\u9664"},y.a.createElement("i",{className:"iconfont icon-shanchu_Hover font16 c-red current",onClick:function(){he(ce.filter(function(je,xe){return xe!==Oe}))}})))),y.a.createElement("div",{className:f.a.contentWrap},y.a.createElement("div",{className:f.a.flexRow},y.a.createElement("div",null,y.a.createElement("p",{className:"font16"},"\u540D\u79F0\uFF1A"),y.a.createElement(S.a,{style:{width:"200px"},value:_e.name,onChange:function(je){var xe=ce.map(function(Se,Ie){return Ie===Oe?Object(M.a)(Object(M.a)({},Se),{},{name:je.target.value}):Se});he(xe)}})),y.a.createElement("div",{className:"ml10"},y.a.createElement("p",{className:"font16"},"\u6263\u51CF\u5206\u503C\u5360\u6BD4\uFF1A"),y.a.createElement(P.a,{style:{width:"200px"},value:_e.score,onChange:function(je){var xe=ce.map(function(Se,Ie){return Ie===Oe?Object(M.a)(Object(M.a)({},Se),{},{score:je}):Se});he(xe)}})," %"))),y.a.createElement("div",{className:"mt10 mb10"},y.a.createElement("div",{className:"font16 mb10"},"\u5185\u5BB9\uFF1A"),y.a.createElement(h.a,{defaultValue:_e.contents,onChange:function(je){var xe=ce.map(function(Se,Ie){return Ie===Oe?Object(M.a)(Object(M.a)({},Se),{},{contents:je}):Se});he(xe)}})))}),y.a.createElement("div",{className:"tc"},y.a.createElement(G.a,{type:"primary",ghost:!0,className:"mt10",onClick:function(){he([].concat(Object(D.a)(ce),[{name:"\u89E3\u9898\u601D\u8DEF".concat(ce.length+1),contents:"",score:10,id:null,level:null}]))}},"\u65B0\u589E\u53C2\u8003\u7B54\u6848"))),y.a.createElement(c.a,{onOk:Ee,onCancel:function(){return m.d.push("/shixuns/".concat(_.params.id,"/challenges"))}}))};Ae.default=Object(m.a)(function(O){var N=O.shixunsDetail,W=O.newCourse,V=O.loading,F=O.globalSetting;return{shixunsDetail:N,newCourse:W,globalSetting:F,loading:V.effects}})(b)},"7Cbv":function(we,Ae,Q){"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 D(){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 P(L){return typeof L=="string"&&K.test(L)}for(var M=P,U=[],B=0;B<256;++B)U.push((B+256).toString(16).substr(1));function I(L){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,S=(U[L[C+0]]+U[L[C+1]]+U[L[C+2]]+U[L[C+3]]+"-"+U[L[C+4]]+U[L[C+5]]+"-"+U[L[C+6]]+U[L[C+7]]+"-"+U[L[C+8]]+U[L[C+9]]+"-"+U[L[C+10]]+U[L[C+11]]+U[L[C+12]]+U[L[C+13]]+U[L[C+14]]+U[L[C+15]]).toLowerCase();if(!M(S))throw TypeError("Stringified UUID is invalid");return S}var R=I;function g(L,C,S){L=L||{};var A=L.random||(L.rng||D)();if(A[6]=A[6]&15|64,A[8]=A[8]&63|128,C){S=S||0;for(var d=0;d<16;++d)C[S+d]=A[d];return C}return R(A)}var T=Ae.a=g},"7ZXX":function(we,Ae,Q){we.exports=Q.p+"static/err.6e7c5817.png"},"7ahc":function(we,Ae,Q){"use strict";Q.d(Ae,"a",function(){return y});var q=Q("k1fw"),G=Q("0Owb"),D=Q("+L6B"),K=Q("2/Rp"),P=Q("y8nQ"),M=Q("Vl3Y"),U=Q("tJVT"),B=Q("OaEy"),I=Q("2fM7"),R=Q("cDcd"),g=Q.n(R),T=Q("VrN/"),L=Q.n(T),C=Q("p77/"),S=Q.n(C),A=Q("c5Ni"),d=Q.n(A),o=I.a.Option,l={labelCol:{span:4},wrapperCol:{span:20}},u={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"]};Ae.b=function(m){var h=m.callback,w=m.onCancel,E=Object(R.useState)("python"),f=Object(U.a)(E,2),c=f[0],s=f[1];function a(p){s(u[p][1])}function v(p){h(p)}return g.a.createElement(M.a,Object(G.a)({},l,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:v}),g.a.createElement(M.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},g.a.createElement(I.a,{onChange:a},Object.keys(u).map(function(p){return g.a.createElement(o,{key:p,value:p},u[p][0])}))),g.a.createElement(M.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},g.a.createElement(y,{mode:c})),g.a.createElement("div",{className:"flex-container flex-end"},g.a.createElement(K.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),g.a.createElement(K.a,{type:"ghost",onClick:w},"\u53D6\u6D88")))};function y(m){var h=m.value,w=m.onChange,E=m.mode,f=m.options,c=f===void 0?{}:f,s=Object(R.useRef)(),a=Object(R.useState)(),v=Object(U.a)(a,2),p=v[0],b=v[1];return Object(R.useEffect)(function(){if(p){function O(N){var W=N.getValue();w&&w(W)}return p.on("change",O),function(){p.off("change",O)}}},[p,w]),Object(R.useEffect)(function(){p&&p.setOption("mode",E)},[p,E]),Object(R.useEffect)(function(){p&&((h!==p.getValue()||h==="")&&setTimeout(function(){p.setValue(h||" ")},300))},[p,h]),Object(R.useEffect)(function(){if(s.current&&!p){var O=L.a.fromTextArea(s.current,Object(q.a)({mode:E,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},c));b(O)}},[s.current,p]),g.a.createElement("div",{className:"my-codemirror-container"},g.a.createElement("textarea",{ref:s}))}},"7ixt":function(we,Ae,Q){"use strict";Q.d(Ae,"a",function(){return D});var q={adjustX:1,adjustY:1},G=[0,0],D={left:{points:["cr","cl"],overflow:q,offset:[-4,0],targetOffset:G},right:{points:["cl","cr"],overflow:q,offset:[4,0],targetOffset:G},top:{points:["bc","tc"],overflow:q,offset:[0,-4],targetOffset:G},bottom:{points:["tc","bc"],overflow:q,offset:[0,4],targetOffset:G},topLeft:{points:["bl","tl"],overflow:q,offset:[0,-4],targetOffset:G},leftTop:{points:["tr","tl"],overflow:q,offset:[-4,0],targetOffset:G},topRight:{points:["br","tr"],overflow:q,offset:[0,-4],targetOffset:G},rightTop:{points:["tl","tr"],overflow:q,offset:[4,0],targetOffset:G},bottomRight:{points:["tr","br"],overflow:q,offset:[0,4],targetOffset:G},rightBottom:{points:["bl","br"],overflow:q,offset:[4,0],targetOffset:G},bottomLeft:{points:["tl","bl"],overflow:q,offset:[0,4],targetOffset:G},leftBottom:{points:["br","bl"],overflow:q,offset:[-4,0],targetOffset:G}},K=D},"7v3h":function(we,Ae,Q){we.exports=Q.p+"static/empty2.dd73f390.png"},"8/bI":function(we,Ae,Q){we.exports=Q.p+"static/empty.8918e228.png"},"8EBN":function(we,Ae,Q){(function(q){q(Q("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 D=q.modeInfo[G];D.mimes&&(D.mime=D.mimes[0])}q.findModeByMIME=function(K){K=K.toLowerCase();for(var P=0;P<q.modeInfo.length;P++){var M=q.modeInfo[P];if(M.mime==K)return M;if(M.mimes){for(var U=0;U<M.mimes.length;U++)if(M.mimes[U]==K)return M}}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 P=0;P<q.modeInfo.length;P++){var M=q.modeInfo[P];if(M.ext){for(var U=0;U<M.ext.length;U++)if(M.ext[U]==K)return M}}},q.findModeByFileName=function(K){for(var P=0;P<q.modeInfo.length;P++){var M=q.modeInfo[P];if(M.file&&M.file.test(K))return M}var U=K.lastIndexOf("."),B=U>-1&&K.substring(U+1,K.length);if(B)return q.findModeByExtension(B)},q.findModeByName=function(K){K=K.toLowerCase();for(var P=0;P<q.modeInfo.length;P++){var M=q.modeInfo[P];if(M.name.toLowerCase()==K)return M;if(M.alias){for(var U=0;U<M.alias.length;U++)if(M.alias[U].toLowerCase()==K)return M}}}})},"8hTe":function(we,Ae,Q){we.exports={button:"button___1wy9m"}},"9Bee":function(we,Ae,Q){"use strict";var q=Q("DYRE"),G=Q("zeV3"),D=Q("+L6B"),K=Q("2/Rp"),P=Q("k1fw"),M=Q("tJVT"),U=Q("cDcd"),B=Q.n(U),I=Q("vg9a"),R=Q("DlQD"),g=Q.n(R),T=Q("rUJ1");function L(pe,ce){var he=pe.match(/^(\s+)(?:```)/);if(he===null)return ce;var ne=he[1];return ce.split(`
`).map(function(ue){var Ee=ue.match(/^\s+/);if(Ee===null)return ue;var _e=Object(M.a)(Ee,1),Oe=_e[0];return Oe.length>=ne.length?ue.slice(ne.length):ue}).join(`
`)}var C=[],S=["<ul>"],A=new g.a.Renderer,d=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function o(){C.length=0,S=["<ul>"]}var l={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function u(pe,ce,he,ne){if(ce>=pe.length||pe[ce].level<=he)return ce;var ue=pe[ce];ne.push("<li><a href='#"+ue.anchor+"'>"+ue.text+"</a>"),ce++;var Ee=[];return ce=u(pe,ce,ue.level,Ee),Ee.length>0&&(ne.push("<ul>"),Ee.forEach(function(_e){ne.push(_e)}),ne.push("</ul>")),ne.push("</li>"),ce=u(pe,ce,he,ne),ce}function y(){return u(C,0,0,S),S.push("</ul>"),S.join("")}var m={heading:function(ce){var he=d.exec(ce);if(he)return{type:"heading",raw:he[0],depth:he[1].length,text:he[2]}},fences:function(ce){var he=this.rules.block.fences.exec(ce);if(he){var ne=he[0],ue=L(ne,he[3]||""),Ee=he[2]?he[2].trim():he[2];if(["latex","katex","math"].indexOf(Ee)>=0){var _e=E(),Oe=ue;ue=_e,f[_e]={type:"block",expression:Oe}}return{type:"code",raw:ne,lang:Ee,text:ue}}}},h=/(?:\${2})([^\n`]+?)(?:\${2})/gi,w=0,E=function(){return"__special_katext_id_".concat(w++,"__")},f={};function c(){return f}function s(){w=0,f={}}function a(pe){return pe=pe.replace(h,function(ce,he){var ne=E();return f[ne]={type:"inline",expression:he},ne}),pe}var v=A.listitem;A.listitem=function(pe){return v(a(pe))};var p=A.paragraph;A.paragraph=function(pe){return p(a(pe))};var b=A.tablecell;A.tablecell=function(pe,ce){return b(a(pe),ce)},A.code=function(pe,ce,he){var ne=(ce||"").match(/\S*/)[0];return ne?["latex","katex","math"].indexOf(ne)>=0?"<p class='editormd-tex'>".concat(pe,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(ce,'">').concat(he?pe:Object(T.escape)(pe,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(he?pe:Object(T.escape)(pe,!0))+"</code></pre>"},A.heading=function(pe,ce,he){var ne=this.options.headerPrefix+he.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return C.push({anchor:ne,level:ce,text:pe}),"<h"+ce+' id="'+ne+'">'+pe+"</h"+ce+">"},g.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),g.a.use({tokenizer:m,renderer:A});var O=g.a,N=Q("SJMd"),W=Q("ulZh"),V=Q.n(W),F=Q("m3rI"),_=Q("Oy/b"),J=Q("p5ED"),ee=Q("8hTe"),oe=Q.n(ee),de=/<pre[^>]*>/g;function Ce(pe){var ce=document.createElement("div");return ce.innerHTML=pe,ce.childNodes.length===0?"":ce.childNodes[0].nodeValue}var ge=Ae.a=function(pe){var ce=pe.value,he=ce===void 0?"":ce,ne=pe.edit,ue=ne===void 0?!1:ne,Ee=pe.className,_e=pe.showTextOnly,Oe=pe.showLines,Ne=pe.replaces,je=pe.zoomImg,xe=pe.hasMask,Se=pe.style,Ie=Se===void 0?{}:Se,Fe=pe.stylesPrev,He=Fe===void 0?{}:Fe,Me=String(he),Le=Object(U.useRef)(),qe=Object(U.useRef)(),Ze=Object(U.useState)(""),ze=Object(M.a)(Ze,2),Ge=ze[0],tt=ze[1],Xe=Object(U.useState)("office"),Ye=Object(M.a)(Xe,2),ye=Ye[0],$e=Ye[1],Ve=Object(U.useMemo)(function(){try{var ae=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Y=/\"\/api\/attachments\/|\"\/attachments\/download\//g,X=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Me=Me.replace(ae,"("+F.a.API_SERVER+"/api/attachments/").replace(Y,'"'+F.a.API_SERVER+"/api/attachments/").replace(X,'"'+F.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(ve){}var Z=O(Me),te=c();if(Me.match(/\[TOC\]/)&&(Z=Z.replace("<p>[TOC]</p>",y()),o()),Z=Z.replace(/(__special_katext_id_\d+__)/g,function(ve,De){var Qe=te[De],at=Qe.type,rt=Qe.expression;return Object(_.renderToString)(Ce(rt)||"",{displayMode:at==="block",throwOnError:!1,output:"html"})}),Z=Z.replace(/▁/g,"\u2581\u2581\u2581"),s(),_e){var se=document.createElement("div");return se.innerHTML=Z,se.innerText}return setTimeout(function(){return le()},500),Z},[Me]),be=Object(U.useRef)();l.WebkitLineClamp=Oe,Oe&&(Ie=Object(P.a)(Object(P.a)({},Ie),l));function Pe(ae){var Y=ae.target;if(Y.tagName.toUpperCase()==="IMG"){if(je){var X=Y.getAttribute("src");tt(X),$e("image")}}else if(Y.tagName.toUpperCase()==="A"){var Z=Y.getAttribute("href");if(Z.indexOf("office")>-1)ae.preventDefault(),tt(Z),$e("office");else if(Z.indexOf("application/pdf")>-1)ae.preventDefault(),tt(Z),$e("pdf");else if(Z.indexOf("text/html")>-1)ae.preventDefault(),tt(Z),$e("html");else if(Z.startsWith("#")){ae.preventDefault();var te=document.getElementById(Z.replace("#",""));te&&te.scrollIntoView(!0)}}}var le=function(){var Y,X=(Y=be.current)===null||Y===void 0?void 0:Y.querySelectorAll("video");X==null||X.forEach(function(Z){if(Z.oncontextmenu=function(){return!1},Z.src.indexOf(".m3u8")>-1&&!Z.canPlayType("application/vnd.apple.mpegurl")){if(V.a.isSupported()){var te=new V.a;te.loadSource(Z.src),te.attachMedia(Z)}}})};Object(U.useEffect)(function(){if(be.current&&Ve&&(Ve.match(de)&&window.PR.prettyPrint()),be.current)return be.current.addEventListener("click",Pe),function(){be.current.removeEventListener("click",Pe),s(),o()}},[Ve,be.current,Pe]);var ie=function(Y){if(!ue)return;Y.target.nodeName==="IMG"?(Le.current.style.display="flex",Le.current.style.width=Y.target.clientWidth+"px",Le.current.style.height=Y.target.clientHeight+"px",Le.current.style.top=Y.target.offsetTop+"px",Le.current.style.left=Y.target.offsetLeft+"px",qe.current.src=Y.target.getAttribute("src")):Le.current.style.display="none"};return B.a.createElement("div",{style:{position:"relative"}},B.a.createElement("div",{ref:be,style:Object(P.a)({},Ie),className:"".concat(Ee||""," markdown-body ").concat(oe.a.mdBody),onMouseOver:ie,dangerouslySetInnerHTML:{__html:Ve}}),B.a.createElement("div",{ref:Le,className:oe.a.button},B.a.createElement(G.a,null,B.a.createElement(K.a,{onClick:function(){return openCrop()}},"\u88C1\u526A"),B.a.createElement(K.a,{onClick:function(){return openEditor()}},"\u7F16\u8F91"))),B.a.createElement("img",{ref:qe,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1,top:"-10000px"}}),B.a.createElement(J.a,{close:!0,data:Ge,type:Ge!=null&&Ge.length?ye:"",style:Object(P.a)({},He),onClose:function(){return tt("")}}))}},"9VGf":function(we,Ae,Q){"use strict";Q.d(Ae,"a",function(){return D});var q=Q("cDcd"),G=Q.n(q);function D(K,P){var M=Object(q.useRef)();Object(q.useEffect)(function(){M.current=K}),Object(q.useEffect)(function(){function U(){M.current()}if(P!==null){var B=setInterval(U,P);return function(){return clearInterval(B)}}},[P])}},"9ZNV":function(we,Ae,Q){"use strict";Q.d(Ae,"a",function(){return R});var q=Q("0Owb"),G=Q("+L6B"),D=Q("2/Rp"),K=Q("cDcd"),P=Q.n(K),M=Q("UUDw"),U=Q.n(M),B=Q("TSYQ"),I=Q.n(B),R=function(T){var L=T.cancelText,C=L===void 0?"\u53D6\u6D88":L,S=T.okText,A=S===void 0?"\u786E\u5B9A":S,d=T.loading,o=d===void 0?!1:d,l=T.hasOkBtn,u=l===void 0?!0:l,y=T.okButtonProps,m=y===void 0?{}:y,h=T.onCancel,w=h===void 0?function(){}:h,E=T.onOk,f=E===void 0?function(){}:E,c=T.className,s=c===void 0?"":c;return P.a.createElement("div",{className:I()(U.a.buttonFixed,s)},P.a.createElement("div",{className:U.a.buttonWrap},P.a.createElement(D.a,{size:"large",className:"".concat(U.a.button," mr20"),onClick:w},C),u&&P.a.createElement(D.a,Object(q.a)({size:"large",type:"primary",className:"".conc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zwAUGdY+273nc6Y294z3p1sRW2ZhSt02Gsg+eDxknyl07FYWRY8I+aZptYx27B0Bw/Bp3faHRcs13EsCWiWpjZ8DEU+Ecxe7IKjVl5GMy8zAJMQSIwbH27rL+7FH2jUzTNfUwgMMAkFiFlf5MrstviA4PU61HIuo1KQRCdkGeJCDJoCQkkkzyOFVF4mOxyv9u8x8opnU6UeBF0wAAAABJRU5ErkJggg=="},Bd2K:function(we,Ae,Q){(function(q){q(Q("VrN/"),Q("osHv"))})(function(q){q.defineOption("autoCloseTags",!1,function(I,R,g){if(g!=q.Init&&g&&I.removeKeyMap("autoCloseTags"),!R)return;var T={name:"autoCloseTags"};(typeof R!="object"||R.whenClosing!==!1)&&(T["'/'"]=function(L){return M(L)}),(typeof R!="object"||R.whenOpening!==!1)&&(T["'>'"]=function(L){return K(L)}),I.addKeyMap(T)});var G=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],D=["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(I){if(I.getOption("disableInput"))return q.Pass;for(var R=I.listSelections(),g=[],T=I.getOption("autoCloseTags"),L=0;L<R.length;L++){if(!R[L].empty())return q.Pass;var C=R[L].head,S=I.getTokenAt(C),A=q.innerMode(I.getMode(),S.state),d=A.state,o=A.mode.xmlCurrentTag&&A.mode.xmlCurrentTag(d),l=o&&o.name;if(!l)return q.Pass;var u=A.mode.configuration=="html",y=typeof T=="object"&&T.dontCloseTags||u&&G,m=typeof T=="object"&&T.indentTags||u&&D;S.end>C.ch&&(l=l.slice(0,l.length-S.end+C.ch));var h=l.toLowerCase();if(!l||S.type=="string"&&(S.end!=C.ch||!/[\"\']/.test(S.string.charAt(S.string.length-1))||S.string.length==1)||S.type=="tag"&&o.close||S.string.indexOf("/")==C.ch-S.start-1||y&&U(y,h)>-1||B(I,A.mode.xmlCurrentContext&&A.mode.xmlCurrentContext(d)||[],l,C,!0))return q.Pass;var w=typeof T=="object"&&T.emptyTags;if(w&&U(w,l)>-1){g[L]={text:"/>",newPos:q.Pos(C.line,C.ch+2)};continue}var E=m&&U(m,h)>-1;g[L]={indent:E,text:">"+(E?`
`:"")+"</"+l+">",newPos:E?q.Pos(C.line+1,0):q.Pos(C.line,C.ch+1)}}for(var f=typeof T=="object"&&T.dontIndentOnAutoClose,L=R.length-1;L>=0;L--){var c=g[L];I.replaceRange(c.text,R[L].head,R[L].anchor,"+insert");var s=I.listSelections().slice(0);s[L]={head:c.newPos,anchor:c.newPos},I.setSelections(s),!f&&c.indent&&(I.indentLine(c.newPos.line,null,!0),I.indentLine(c.newPos.line+1,null,!0))}}function P(I,R){for(var g=I.listSelections(),T=[],L=R?"/":"</",C=I.getOption("autoCloseTags"),S=typeof C=="object"&&C.dontIndentOnSlash,A=0;A<g.length;A++){if(!g[A].empty())return q.Pass;var d=g[A].head,o=I.getTokenAt(d),l=q.innerMode(I.getMode(),o.state),u=l.state;if(R&&(o.type=="string"||o.string.charAt(0)!="<"||o.start!=d.ch-1))return q.Pass;var y,m=l.mode.name!="xml"&&I.getMode().name=="htmlmixed";if(m&&l.mode.name=="javascript")y=L+"script";else if(m&&l.mode.name=="css")y=L+"style";else{var h=l.mode.xmlCurrentContext&&l.mode.xmlCurrentContext(u);if(!h||h.length&&B(I,h,h[h.length-1],d))return q.Pass;y=L+h[h.length-1]}I.getLine(d.line).charAt(o.end)!=">"&&(y+=">"),T[A]=y}if(I.replaceSelections(T),g=I.listSelections(),!S)for(var A=0;A<g.length;A++)(A==g.length-1||g[A].head.line<g[A+1].head.line)&&I.indentLine(g[A].head.line)}function M(I){return I.getOption("disableInput")?q.Pass:P(I,!0)}q.commands.closeTag=function(I){return P(I)};function U(I,R){if(I.indexOf)return I.indexOf(R);for(var g=0,T=I.length;g<T;++g)if(I[g]==R)return g;return-1}function B(I,R,g,T,L){if(!q.scanForClosingTag)return!1;var C=Math.min(I.lastLine()+1,T.line+500),S=q.scanForClosingTag(I,T,null,C);if(!S||S.tag!=g)return!1;for(var A=L?1:0,d=R.length-1;d>=0&&R[d]==g;d--)++A;T=S.to;for(var d=1;d<A;d++){var o=q.scanForClosingTag(I,T,null,C);if(!o||o.tag!=g)return!1;T=o.to}return!0}})},BjJ7:function(we,Ae,Q){"use strict";Q.d(Ae,"d",function(){return G}),Q.d(Ae,"c",function(){return D}),Q.d(Ae,"e",function(){return K}),Q.d(Ae,"b",function(){return P}),Q.d(Ae,"a",function(){return U});var q=Q("m3rI");function G(B){var I=!0;if(B.length>0){for(var R=0;R<B.length;R++)if(B[R].compile_success==0||!B[R].compile_success){I=!1;break}}else I=!1;return I}function D(B){for(var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",R=[],g=0;g<B.length;g++){var T=B[g],L=I?"".concat(I,"/").concat(T.name):"".concat(T.name);R.push({title:T.name,isLeaf:!(T.type==="tree"),key:L})}return R}function K(B,I,R){for(var g=0;g<B.length;g++){var T=B[g];if(T.key===I){T.children=R;break}T.children&&K(T.children,I,R)}return B}function P(B,I,R){var g;return function(){var T=this,L=arguments,C=function(){g=null,R||B.apply(T,L)},S=R&&!g;clearTimeout(g),g=setTimeout(C,I),S&&B.apply(T,L)}}var M=!0,U=q.a.API_SERVER},"C+DQ":function(we,Ae,Q){},CJF0:function(we,Ae,Q){"use strict";var q=Q("14J3"),G=Q("BMrR"),D=Q("+L6B"),K=Q("2/Rp"),P=Q("jCWc"),M=Q("kPKH"),U=Q("PpiC"),B=Q("cDcd"),I=Q.n(B),R=Q("Ty5D"),g=Q("9kvl"),T=Q("55Ip"),L=Q("lzim"),C=Q("nZ20"),S=Q.n(C),A=function(o){var l,u,y,m,h=o.shixunsDetail,w=o.dispatch,E=o.loading,f=o.match,c=o.data,s=c===void 0?{}:c,a=o.title,v=Object(U.a)(o,["shixunsDetail","dispatch","loading","match","data","title"]),p=Object(R.i)(),b=!(((l=h.detail)===null||l===void 0?void 0:l.identity)>4||((u=h.detail)===null||u===void 0?void 0:u.identity)===void 0||((y=h.detail)===null||y===void 0?void 0:y.shixun_status)===2||((m=h.detail)===null||m===void 0?void 0:m.shixun_status)===1);return I.a.createElement("aside",{className:"bg-white mb10 pl20 pr20 ".concat(S.a.wrap)},I.a.createElement(G.a,{gutter:[20,20],align:"middle"},I.a.createElement(M.a,{flex:1},I.a.createElement("span",{className:S.a.icons},I.a.createElement("img",{src:L.e,width:"14"})),I.a.createElement("span",{className:"font16"},"\u7B2C ",s==null?void 0:s.position," \u5173\uFF1A",a)),I.a.createElement(M.a,null,(s==null?void 0:s.prev_challenge)&&I.a.createElement(K.a,{type:"primary",ghost:!0,className:"mt10 mr5",onClick:function(){var N,W=s.prev_challenge.st===0?"/editcheckpoint":"/editquestion",V="/shixuns/".concat(p.id,"/challenges/").concat(s==null||((N=s.prev_challenge)===null||N===void 0)?void 0:N.id).concat(W);g.d.replace(V)}},"\u4E0A\u4E00\u5173"),s.next_challenge&&I.a.createElement(K.a,{type:"primary",ghost:!0,className:"mt10 mr5",onClick:function(){var N,W=s.next_challenge.st===0?"/editcheckpoint":"/editquestion",V="/shixuns/".concat(p.id,"/challenges/").concat(s==null||((N=s.next_challenge)===null||N===void 0)?void 0:N.id).concat(W);g.d.replace(V)}},"\u4E0B\u4E00\u5173"),b&&I.a.createElement(K.a,{type:"primary"},I.a.createElement(T.a,{to:"/shixuns/".concat(p.id,"/challenges/newquestion")},"\u65B0\u589E\u9009\u62E9\u9898\u4EFB\u52A1")),b&&I.a.createElement(K.a,{type:"primary",className:"ml5"},I.a.createElement(T.a,{to:"/shixuns/".concat(p.id,"/challenges/new")},"\u65B0\u589E\u5B9E\u8DF5\u4EFB\u52A1")),I.a.createElement(K.a,{type:"primary",className:"ml5"},I.a.createElement(T.a,{to:"/shixuns/".concat(p.id,"/challenges")},"\u8FD4\u56DE")))))};Ae.a=Object(g.a)(function(d){var o=d.shixunsDetail,l=d.newCourse,u=d.loading,y=d.globalSetting;return{shixunsDetail:o,newCourse:l,globalSetting:y,loading:u.effects}})(A)},DlQD:function(we,Ae,Q){(function(q,G){we.exports=G()})(this,function(){"use strict";function q(le,ie){for(var ae=0;ae<ie.length;ae++){var Y=ie[ae];Y.enumerable=Y.enumerable||!1,Y.configurable=!0,"value"in Y&&(Y.writable=!0),Object.defineProperty(le,Y.key,Y)}}function G(le,ie,ae){return ie&&q(le.prototype,ie),ae&&q(le,ae),le}function D(le,ie){if(!le)return;if(typeof le=="string")return K(le,ie);var ae=Object.prototype.toString.call(le).slice(8,-1);if(ae==="Object"&&le.constructor&&(ae=le.constructor.name),ae==="Map"||ae==="Set")return Array.from(le);if(ae==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ae))return K(le,ie)}function K(le,ie){(ie==null||ie>le.length)&&(ie=le.length);for(var ae=0,Y=new Array(ie);ae<ie;ae++)Y[ae]=le[ae];return Y}function P(le,ie){var ae;if(typeof Symbol=="undefined"||le[Symbol.iterator]==null){if(Array.isArray(le)||(ae=D(le))||ie&&le&&typeof le.length=="number"){ae&&(le=ae);var Y=0;return function(){return Y>=le.length?{done:!0}:{done:!1,value:le[Y++]}}}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 ae=le[Symbol.iterator](),ae.next.bind(ae)}function M(le,ie){return ie={exports:{}},le(ie,ie.exports),ie.exports}var U=M(function(le){function ie(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function ae(Y){le.exports.defaults=Y}le.exports={defaults:ie(),getDefaults:ie,changeDefaults:ae}}),B=U.defaults,I=U.getDefaults,R=U.changeDefaults,g=/[&<>"']/,T=/[&<>"']/g,L=/[<>"']|&(?!#?\w+;)/,C=/[<>"']|&(?!#?\w+;)/g,S={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},A=function(ie){return S[ie]};function d(le,ie){if(ie){if(g.test(le))return le.replace(T,A)}else if(L.test(le))return le.replace(C,A);return le}var o=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function l(le){return le.replace(o,function(ie,ae){return ae=ae.toLowerCase(),ae==="colon"?":":ae.charAt(0)==="#"?ae.charAt(1)==="x"?String.fromCharCode(parseInt(ae.substring(2),16)):String.fromCharCode(+ae.substring(1)):""})}var u=/(^|[^\[])\^/g;function y(le,ie){le=le.source||le,ie=ie||"";var ae={replace:function(X,Z){return Z=Z.source||Z,Z=Z.replace(u,"$1"),le=le.replace(X,Z),ae},getRegex:function(){return new RegExp(le,ie)}};return ae}var m=/[^\w:]/g,h=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function w(le,ie,ae){if(le){var Y;try{Y=decodeURIComponent(l(ae)).replace(m,"").toLowerCase()}catch(X){return null}if(Y.indexOf("javascript:")===0||Y.indexOf("vbscript:")===0||Y.indexOf("data:")===0)return null}ie&&!h.test(ae)&&(ae=a(ie,ae));try{ae=encodeURI(ae).replace(/%25/g,"%")}catch(X){return null}return ae}var E={},f=/^[^:]+:\/*[^/]*$/,c=/^([^:]+:)[\s\S]*$/,s=/^([^:]+:\/*[^/]*)[\s\S]*$/;function a(le,ie){E[" "+le]||(f.test(le)?E[" "+le]=le+"/":E[" "+le]=O(le,"/",!0)),le=E[" "+le];var ae=le.indexOf(":")===-1;return ie.substring(0,2)==="//"?ae?ie:le.replace(c,"$1")+ie:ie.charAt(0)==="/"?ae?ie:le.replace(s,"$1")+ie:le+ie}var v={exec:function(){}};function p(le){for(var ie=1,ae,Y;ie<arguments.length;ie++){ae=arguments[ie];for(Y in ae)Object.prototype.hasOwnProperty.call(ae,Y)&&(le[Y]=ae[Y])}return le}function b(le,ie){var ae=le.replace(/\|/g,function(Z,te,se){for(var ve=!1,De=te;--De>=0&&se[De]==="\\";)ve=!ve;return ve?"|":" |"}),Y=ae.split(/ \|/),X=0;if(Y.length>ie)Y.splice(ie);else for(;Y.length<ie;)Y.push("");for(;X<Y.length;X++)Y[X]=Y[X].trim().replace(/\\\|/g,"|");return Y}function O(le,ie,ae){var Y=le.length;if(Y===0)return"";for(var X=0;X<Y;){var Z=le.charAt(Y-X-1);if(Z===ie&&!ae)X++;else if(Z!==ie&&ae)X++;else break}return le.substr(0,Y-X)}function N(le,ie){if(le.indexOf(ie[1])===-1)return-1;for(var ae=le.length,Y=0,X=0;X<ae;X++)if(le[X]==="\\")X++;else if(le[X]===ie[0])Y++;else if(le[X]===ie[1]&&(Y--,Y<0))return X;return-1}function W(le){le&&le.sanitize&&!le.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 V={escape:d,unescape:l,edit:y,cleanUrl:w,resolveUrl:a,noopTest:v,merge:p,splitCells:b,rtrim:O,findClosingBracket:N,checkSanitizeDeprecation:W},F=U.defaults,_=V.rtrim,J=V.splitCells,ee=V.escape,oe=V.findClosingBracket;function de(le,ie,ae){var Y=ie.href,X=ie.title?ee(ie.title):null,Z=le[1].replace(/\\([\[\]])/g,"$1");return le[0].charAt(0)!=="!"?{type:"link",raw:ae,href:Y,title:X,text:Z}:{type:"image",raw:ae,href:Y,title:X,text:ee(Z)}}function Ce(le,ie){var ae=le.match(/^(\s+)(?:```)/);if(ae===null)return ie;var Y=ae[1];return ie.split(`
`).map(function(X){var Z=X.match(/^\s+/);if(Z===null)return X;var te=Z[0];return te.length>=Y.length?X.slice(Y.length):X}).join(`
`)}var ge=function(){function le(ae){this.options=ae||F}var ie=le.prototype;return ie.space=function(Y){var X=this.rules.block.newline.exec(Y);if(X)return X[0].length>1?{type:"space",raw:X[0]}:{raw:`
`}},ie.code=function(Y,X){var Z=this.rules.block.code.exec(Y);if(Z){var te=X[X.length-1];if(te&&te.type==="paragraph")return{raw:Z[0],text:Z[0].trimRight()};var se=Z[0].replace(/^ {4}/gm,"");return{type:"code",raw:Z[0],codeBlockStyle:"indented",text:this.options.pedantic?se:_(se,`
`)}}},ie.fences=function(Y){var X=this.rules.block.fences.exec(Y);if(X){var Z=X[0],te=Ce(Z,X[3]||"");return{type:"code",raw:Z,lang:X[2]?X[2].trim():X[2],text:te}}},ie.heading=function(Y){var X=this.rules.block.heading.exec(Y);if(X)return{type:"heading",raw:X[0],depth:X[1].length,text:X[2]}},ie.nptable=function(Y){var X=this.rules.block.nptable.exec(Y);if(X){var Z={type:"table",header:J(X[1].replace(/^ *| *\| *$/g,"")),align:X[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:X[3]?X[3].replace(/\n$/,"").split(`
`):[],raw:X[0]};if(Z.header.length===Z.align.length){var te=Z.align.length,se;for(se=0;se<te;se++)/^ *-+: *$/.test(Z.align[se])?Z.align[se]="right":/^ *:-+: *$/.test(Z.align[se])?Z.align[se]="center":/^ *:-+ *$/.test(Z.align[se])?Z.align[se]="left":Z.align[se]=null;for(te=Z.cells.length,se=0;se<te;se++)Z.cells[se]=J(Z.cells[se],Z.header.length);return Z}}},ie.hr=function(Y){var X=this.rules.block.hr.exec(Y);if(X)return{type:"hr",raw:X[0]}},ie.blockquote=function(Y){var X=this.rules.block.blockquote.exec(Y);if(X){var Z=X[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:X[0],text:Z}}},ie.list=function(Y){var X=this.rules.block.list.exec(Y);if(X){for(var Z=X[0],te=X[2],se=te.length>1,ve=te[te.length-1]===")",De={type:"list",raw:Z,ordered:se,start:se?+te.slice(0,-1):"",loose:!1,items:[]},Qe=X[0].match(this.rules.block.item),at=!1,rt,xt,ht,st,Ct,yt,Ft,Bt=Qe.length,Et=0;Et<Bt;Et++)rt=Qe[Et],Z=rt,xt=rt.length,rt=rt.replace(/^ *([*+-]|\d+[.)]) */,""),~rt.indexOf(`
`)&&(xt-=rt.length,rt=this.options.pedantic?rt.replace(/^ {1,4}/gm,""):rt.replace(new RegExp("^ {1,"+xt+"}","gm"),"")),Et!==Bt-1&&(ht=this.rules.block.bullet.exec(Qe[Et+1])[0],(se?ht.length===1||!ve&&ht[ht.length-1]===")":ht.length>1||this.options.smartLists&&ht!==te)&&(st=Qe.slice(Et+1).join(`
`),De.raw=De.raw.substring(0,De.raw.length-st.length),Et=Bt-1)),Ct=at||/\n\n(?!\s*$)/.test(rt),Et!==Bt-1&&(at=rt.charAt(rt.length-1)===`
`,Ct||(Ct=at)),Ct&&(De.loose=!0),yt=/^\[[ xX]\] /.test(rt),Ft=void 0,yt&&(Ft=rt[1]!==" ",rt=rt.replace(/^\[[ xX]\] +/,"")),De.items.push({type:"list_item",raw:Z,task:yt,checked:Ft,loose:Ct,text:rt});return De}},ie.html=function(Y){var X=this.rules.block.html.exec(Y);if(X)return{type:this.options.sanitize?"paragraph":"html",raw:X[0],pre:!this.options.sanitizer&&(X[1]==="pre"||X[1]==="script"||X[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(X[0]):ee(X[0]):X[0]}},ie.def=function(Y){var X=this.rules.block.def.exec(Y);if(X){X[3]&&(X[3]=X[3].substring(1,X[3].length-1));var Z=X[1].toLowerCase().replace(/\s+/g," ");return{tag:Z,raw:X[0],href:X[2],title:X[3]}}},ie.table=function(Y){var X=this.rules.block.table.exec(Y);if(X){var Z={type:"table",header:J(X[1].replace(/^ *| *\| *$/g,"")),align:X[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:X[3]?X[3].replace(/\n$/,"").split(`
`):[]};if(Z.header.length===Z.align.length){Z.raw=X[0];var te=Z.align.length,se;for(se=0;se<te;se++)/^ *-+: *$/.test(Z.align[se])?Z.align[se]="right":/^ *:-+: *$/.test(Z.align[se])?Z.align[se]="center":/^ *:-+ *$/.test(Z.align[se])?Z.align[se]="left":Z.align[se]=null;for(te=Z.cells.length,se=0;se<te;se++)Z.cells[se]=J(Z.cells[se].replace(/^ *\| *| *\| *$/g,""),Z.header.length);return Z}}},ie.lheading=function(Y){var X=this.rules.block.lheading.exec(Y);if(X)return{type:"heading",raw:X[0],depth:X[2].charAt(0)==="="?1:2,text:X[1]}},ie.paragraph=function(Y){var X=this.rules.block.paragraph.exec(Y);if(X)return{type:"paragraph",raw:X[0],text:X[1].charAt(X[1].length-1)===`
`?X[1].slice(0,-1):X[1]}},ie.text=function(Y,X){var Z=this.rules.block.text.exec(Y);if(Z){var te=X[X.length-1];return te&&te.type==="text"?{raw:Z[0],text:Z[0]}:{type:"text",raw:Z[0],text:Z[0]}}},ie.escape=function(Y){var X=this.rules.inline.escape.exec(Y);if(X)return{type:"escape",raw:X[0],text:ee(X[1])}},ie.tag=function(Y,X,Z){var te=this.rules.inline.tag.exec(Y);if(te)return!X&&/^<a /i.test(te[0])?X=!0:X&&/^<\/a>/i.test(te[0])&&(X=!1),!Z&&/^<(pre|code|kbd|script)(\s|>)/i.test(te[0])?Z=!0:Z&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(te[0])&&(Z=!1),{type:this.options.sanitize?"text":"html",raw:te[0],inLink:X,inRawBlock:Z,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(te[0]):ee(te[0]):te[0]}},ie.link=function(Y){var X=this.rules.inline.link.exec(Y);if(X){var Z=oe(X[2],"()");if(Z>-1){var te=X[0].indexOf("!")===0?5:4,se=te+X[1].length+Z;X[2]=X[2].substring(0,Z),X[0]=X[0].substring(0,se).trim(),X[3]=""}var ve=X[2],De="";if(this.options.pedantic){var Qe=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(ve);Qe?(ve=Qe[1],De=Qe[3]):De=""}else De=X[3]?X[3].slice(1,-1):"";ve=ve.trim().replace(/^<([\s\S]*)>$/,"$1");var at=de(X,{href:ve&&ve.replace(this.rules.inline._escapes,"$1"),title:De&&De.replace(this.rules.inline._escapes,"$1")},X[0]);return at}},ie.reflink=function(Y,X){var Z;if((Z=this.rules.inline.reflink.exec(Y))||(Z=this.rules.inline.nolink.exec(Y))){var te=(Z[2]||Z[1]).replace(/\s+/g," ");if(te=X[te.toLowerCase()],!te||!te.href){var se=Z[0].charAt(0);return{type:"text",raw:se,text:se}}var ve=de(Z,te,Z[0]);return ve}},ie.strong=function(Y,X,Z){Z===void 0&&(Z="");var te=this.rules.inline.strong.start.exec(Y);if(te&&(!te[1]||te[1]&&(Z===""||this.rules.inline.punctuation.exec(Z)))){X=X.slice(-1*Y.length);var se=te[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;se.lastIndex=0;for(var ve;(te=se.exec(X))!=null;)if(ve=this.rules.inline.strong.middle.exec(X.slice(0,te.index+3)),ve)return{type:"strong",raw:Y.slice(0,ve[0].length),text:Y.slice(2,ve[0].length-2)}}},ie.em=function(Y,X,Z){Z===void 0&&(Z="");var te=this.rules.inline.em.start.exec(Y);if(te&&(!te[1]||te[1]&&(Z===""||this.rules.inline.punctuation.exec(Z)))){X=X.slice(-1*Y.length);var se=te[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;se.lastIndex=0;for(var ve;(te=se.exec(X))!=null;)if(ve=this.rules.inline.em.middle.exec(X.slice(0,te.index+2)),ve)return{type:"em",raw:Y.slice(0,ve[0].length),text:Y.slice(1,ve[0].length-1)}}},ie.codespan=function(Y){var X=this.rules.inline.code.exec(Y);if(X){var Z=X[2].replace(/\n/g," "),te=/[^ ]/.test(Z),se=Z.startsWith(" ")&&Z.endsWith(" ");return te&&se&&(Z=Z.substring(1,Z.length-1)),Z=ee(Z,!0),{type:"codespan",raw:X[0],text:Z}}},ie.br=function(Y){var X=this.rules.inline.br.exec(Y);if(X)return{type:"br",raw:X[0]}},ie.del=function(Y){var X=this.rules.inline.del.exec(Y);if(X)return{type:"del",raw:X[0],text:X[1]}},ie.autolink=function(Y,X){var Z=this.rules.inline.autolink.exec(Y);if(Z){var te,se;return Z[2]==="@"?(te=ee(this.options.mangle?X(Z[1]):Z[1]),se="mailto:"+te):(te=ee(Z[1]),se=te),{type:"link",raw:Z[0],text:te,href:se,tokens:[{type:"text",raw:te,text:te}]}}},ie.url=function(Y,X){var Z;if(Z=this.rules.inline.url.exec(Y)){var te,se;if(Z[2]==="@")te=ee(this.options.mangle?X(Z[0]):Z[0]),se="mailto:"+te;else{var ve;do ve=Z[0],Z[0]=this.rules.inline._backpedal.exec(Z[0])[0];while(ve!==Z[0]);te=ee(Z[0]),Z[1]==="www."?se="http://"+te:se=te}return{type:"link",raw:Z[0],text:te,href:se,tokens:[{type:"text",raw:te,text:te}]}}},ie.inlineText=function(Y,X,Z){var te=this.rules.inline.text.exec(Y);if(te){var se;return X?se=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(te[0]):ee(te[0]):te[0]:se=ee(this.options.smartypants?Z(te[0]):te[0]),{type:"text",raw:te[0],text:se}}},le}(),pe=V.noopTest,ce=V.edit,he=V.merge,ne={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:pe,table:pe,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};ne._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,ne._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ne.def=ce(ne.def).replace("label",ne._label).replace("title",ne._title).getRegex(),ne.bullet=/(?:[*+-]|\d{1,9}[.)])/,ne.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,ne.item=ce(ne.item,"gm").replace(/bull/g,ne.bullet).getRegex(),ne.list=ce(ne.list).replace(/bull/g,ne.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ne.def.source+")").getRegex(),ne._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",ne._comment=/<!--(?!-?>)[\s\S]*?-->/,ne.html=ce(ne.html,"i").replace("comment",ne._comment).replace("tag",ne._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ne.paragraph=ce(ne._paragraph).replace("hr",ne.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",ne._tag).getRegex(),ne.blockquote=ce(ne.blockquote).replace("paragraph",ne.paragraph).getRegex(),ne.normal=he({},ne),ne.gfm=he({},ne.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*|$)"}),ne.gfm.nptable=ce(ne.gfm.nptable).replace("hr",ne.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",ne._tag).getRegex(),ne.gfm.table=ce(ne.gfm.table).replace("hr",ne.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",ne._tag).getRegex(),ne.pedantic=he({},ne.normal,{html:ce(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ne._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:pe,paragraph:ce(ne.normal._paragraph).replace("hr",ne.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",ne.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ue={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:pe,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:pe,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};ue._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",ue.punctuation=ce(ue.punctuation).replace(/punctuation/g,ue._punctuation).getRegex(),ue._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",ue._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",ue.em.start=ce(ue.em.start).replace(/punctuation/g,ue._punctuation).getRegex(),ue.em.middle=ce(ue.em.middle).replace(/punctuation/g,ue._punctuation).replace(/overlapSkip/g,ue._overlapSkip).getRegex(),ue.em.endAst=ce(ue.em.endAst,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.em.endUnd=ce(ue.em.endUnd,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.strong.start=ce(ue.strong.start).replace(/punctuation/g,ue._punctuation).getRegex(),ue.strong.middle=ce(ue.strong.middle).replace(/punctuation/g,ue._punctuation).replace(/blockSkip/g,ue._blockSkip).getRegex(),ue.strong.endAst=ce(ue.strong.endAst,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.strong.endUnd=ce(ue.strong.endUnd,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.blockSkip=ce(ue._blockSkip,"g").getRegex(),ue.overlapSkip=ce(ue._overlapSkip,"g").getRegex(),ue._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ue._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ue._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])?)+(?![-_])/,ue.autolink=ce(ue.autolink).replace("scheme",ue._scheme).replace("email",ue._email).getRegex(),ue._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ue.tag=ce(ue.tag).replace("comment",ne._comment).replace("attribute",ue._attribute).getRegex(),ue._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ue._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,ue._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ue.link=ce(ue.link).replace("label",ue._label).replace("href",ue._href).replace("title",ue._title).getRegex(),ue.reflink=ce(ue.reflink).replace("label",ue._label).getRegex(),ue.reflinkSearch=ce(ue.reflinkSearch,"g").replace("reflink",ue.reflink).replace("nolink",ue.nolink).getRegex(),ue.normal=he({},ue),ue.pedantic=he({},ue.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:ce(/^!?\[(label)\]\((.*?)\)/).replace("label",ue._label).getRegex(),reflink:ce(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ue._label).getRegex()}),ue.gfm=he({},ue.normal,{escape:ce(ue.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),ue.gfm.url=ce(ue.gfm.url,"i").replace("email",ue.gfm._extended_email).getRegex(),ue.breaks=he({},ue.gfm,{br:ce(ue.br).replace("{2,}","*").getRegex(),text:ce(ue.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var Ee={block:ne,inline:ue},_e=U.defaults,Oe=Ee.block,Ne=Ee.inline;function je(le){return le.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 xe(le){var ie="",ae,Y,X=le.length;for(ae=0;ae<X;ae++)Y=le.charCodeAt(ae),Math.random()>.5&&(Y="x"+Y.toString(16)),ie+="&#"+Y+";";return ie}var Se=function(){function le(ae){this.tokens=[],this.tokens.links=Object.create(null),this.options=ae||_e,this.options.tokenizer=this.options.tokenizer||new ge,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var Y={block:Oe.normal,inline:Ne.normal};this.options.pedantic?(Y.block=Oe.pedantic,Y.inline=Ne.pedantic):this.options.gfm&&(Y.block=Oe.gfm,this.options.breaks?Y.inline=Ne.breaks:Y.inline=Ne.gfm),this.tokenizer.rules=Y}le.lex=function(Y,X){var Z=new le(X);return Z.lex(Y)};var ie=le.prototype;return ie.lex=function(Y){return Y=Y.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(Y,this.tokens,!0),this.inline(this.tokens),this.tokens},ie.blockTokens=function(Y,X,Z){X===void 0&&(X=[]),Z===void 0&&(Z=!0),Y=Y.replace(/^ +$/gm,"");for(var te,se,ve,De;Y;){if(te=this.tokenizer.space(Y)){Y=Y.substring(te.raw.length),te.type&&X.push(te);continue}if(te=this.tokenizer.code(Y,X)){Y=Y.substring(te.raw.length),te.type?X.push(te):(De=X[X.length-1],De.raw+=`
`+te.raw,De.text+=`
`+te.text);continue}if(te=this.tokenizer.fences(Y)){Y=Y.substring(te.raw.length),X.push(te);continue}if(te=this.tokenizer.heading(Y)){Y=Y.substring(te.raw.length),X.push(te);continue}if(te=this.tokenizer.nptable(Y)){Y=Y.substring(te.raw.length),X.push(te);continue}if(te=this.tokenizer.hr(Y)){Y=Y.substring(te.raw.length),X.push(te);continue}if(te=this.tokenizer.blockquote(Y)){Y=Y.substring(te.raw.length),te.tokens=this.blockTokens(te.text,[],Z),X.push(te);continue}if(te=this.tokenizer.list(Y)){for(Y=Y.substring(te.raw.length),ve=te.items.length,se=0;se<ve;se++)te.items[se].tokens=this.blockTokens(te.items[se].text,[],!1);X.push(te);continue}if(te=this.tokenizer.html(Y)){Y=Y.substring(te.raw.length),X.push(te);continue}if(Z&&(te=this.tokenizer.def(Y))){Y=Y.substring(te.raw.length),this.tokens.links[te.tag]||(this.tokens.links[te.tag]={href:te.href,title:te.title});continue}if(te=this.tokenizer.table(Y)){Y=Y.substring(te.raw.length),X.push(te);continue}if(te=this.tokenizer.lheading(Y)){Y=Y.substring(te.raw.length),X.push(te);continue}if(Z&&(te=this.tokenizer.paragraph(Y))){Y=Y.substring(te.raw.length),X.push(te);continue}if(te=this.tokenizer.text(Y,X)){Y=Y.substring(te.raw.length),te.type?X.push(te):(De=X[X.length-1],De.raw+=`
`+te.raw,De.text+=`
`+te.text);continue}if(Y){var Qe="Infinite loop on byte: "+Y.charCodeAt(0);if(this.options.silent){console.error(Qe);break}else throw new Error(Qe)}}return X},ie.inline=function(Y){var X,Z,te,se,ve,De,Qe=Y.length;for(X=0;X<Qe;X++){De=Y[X];switch(De.type){case"paragraph":case"text":case"heading":{De.tokens=[],this.inlineTokens(De.text,De.tokens);break}case"table":{for(De.tokens={header:[],cells:[]},se=De.header.length,Z=0;Z<se;Z++)De.tokens.header[Z]=[],this.inlineTokens(De.header[Z],De.tokens.header[Z]);for(se=De.cells.length,Z=0;Z<se;Z++)for(ve=De.cells[Z],De.tokens.cells[Z]=[],te=0;te<ve.length;te++)De.tokens.cells[Z][te]=[],this.inlineTokens(ve[te],De.tokens.cells[Z][te]);break}case"blockquote":{this.inline(De.tokens);break}case"list":{for(se=De.items.length,Z=0;Z<se;Z++)this.inline(De.items[Z].tokens);break}}}return Y},ie.inlineTokens=function(Y,X,Z,te,se){X===void 0&&(X=[]),Z===void 0&&(Z=!1),te===void 0&&(te=!1),se===void 0&&(se="");var ve,De=Y,Qe;if(this.tokens.links){var at=Object.keys(this.tokens.links);if(at.length>0)for(;(Qe=this.tokenizer.rules.inline.reflinkSearch.exec(De))!=null;)at.includes(Qe[0].slice(Qe[0].lastIndexOf("[")+1,-1))&&(De=De.slice(0,Qe.index)+"["+"a".repeat(Qe[0].length-2)+"]"+De.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Qe=this.tokenizer.rules.inline.blockSkip.exec(De))!=null;)De=De.slice(0,Qe.index)+"["+"a".repeat(Qe[0].length-2)+"]"+De.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;Y;){if(ve=this.tokenizer.escape(Y)){Y=Y.substring(ve.raw.length),X.push(ve);continue}if(ve=this.tokenizer.tag(Y,Z,te)){Y=Y.substring(ve.raw.length),Z=ve.inLink,te=ve.inRawBlock,X.push(ve);continue}if(ve=this.tokenizer.link(Y)){Y=Y.substring(ve.raw.length),ve.type==="link"&&(ve.tokens=this.inlineTokens(ve.text,[],!0,te)),X.push(ve);continue}if(ve=this.tokenizer.reflink(Y,this.tokens.links)){Y=Y.substring(ve.raw.length),ve.type==="link"&&(ve.tokens=this.inlineTokens(ve.text,[],!0,te)),X.push(ve);continue}if(ve=this.tokenizer.strong(Y,De,se)){Y=Y.substring(ve.raw.length),ve.tokens=this.inlineTokens(ve.text,[],Z,te),X.push(ve);continue}if(ve=this.tokenizer.em(Y,De,se)){Y=Y.substring(ve.raw.length),ve.tokens=this.inlineTokens(ve.text,[],Z,te),X.push(ve);continue}if(ve=this.tokenizer.codespan(Y)){Y=Y.substring(ve.raw.length),X.push(ve);continue}if(ve=this.tokenizer.br(Y)){Y=Y.substring(ve.raw.length),X.push(ve);continue}if(ve=this.tokenizer.del(Y)){Y=Y.substring(ve.raw.length),ve.tokens=this.inlineTokens(ve.text,[],Z,te),X.push(ve);continue}if(ve=this.tokenizer.autolink(Y,xe)){Y=Y.substring(ve.raw.length),X.push(ve);continue}if(!Z&&(ve=this.tokenizer.url(Y,xe))){Y=Y.substring(ve.raw.length),X.push(ve);continue}if(ve=this.tokenizer.inlineText(Y,te,je)){Y=Y.substring(ve.raw.length),se=ve.raw.slice(-1),X.push(ve);continue}if(Y){var rt="Infinite loop on byte: "+Y.charCodeAt(0);if(this.options.silent){console.error(rt);break}else throw new Error(rt)}}return X},G(le,null,[{key:"rules",get:function(){return{block:Oe,inline:Ne}}}]),le}(),Ie=U.defaults,Fe=V.cleanUrl,He=V.escape,Me=function(){function le(ae){this.options=ae||Ie}var ie=le.prototype;return ie.code=function(Y,X,Z){var te=(X||"").match(/\S*/)[0];if(this.options.highlight){var se=this.options.highlight(Y,te);se!=null&&se!==Y&&(Z=!0,Y=se)}return te?'<pre><code class="'+this.options.langPrefix+He(te,!0)+'">'+(Z?Y:He(Y,!0))+`</code></pre>
`:"<pre><code>"+(Z?Y:He(Y,!0))+`</code></pre>
`},ie.blockquote=function(Y){return`<blockquote>
`+Y+`</blockquote>
`},ie.html=function(Y){return Y},ie.heading=function(Y,X,Z,te){return this.options.headerIds?"<h"+X+' id="'+this.options.headerPrefix+te.slug(Z)+'">'+Y+"</h"+X+`>
`:"<h"+X+">"+Y+"</h"+X+`>
`},ie.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},ie.list=function(Y,X,Z){var te=X?"ol":"ul",se=X&&Z!==1?' start="'+Z+'"':"";return"<"+te+se+`>
`+Y+"</"+te+`>
`},ie.listitem=function(Y){return"<li>"+Y+`</li>
`},ie.checkbox=function(Y){return"<input "+(Y?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},ie.paragraph=function(Y){return"<p>"+Y+`</p>
`},ie.table=function(Y,X){return X&&(X="<tbody>"+X+"</tbody>"),`<table>
<thead>
`+Y+`</thead>
`+X+`</table>
`},ie.tablerow=function(Y){return`<tr>
`+Y+`</tr>
`},ie.tablecell=function(Y,X){var Z=X.header?"th":"td",te=X.align?"<"+Z+' align="'+X.align+'">':"<"+Z+">";return te+Y+"</"+Z+`>
`},ie.strong=function(Y){return"<strong>"+Y+"</strong>"},ie.em=function(Y){return"<em>"+Y+"</em>"},ie.codespan=function(Y){return"<code>"+Y+"</code>"},ie.br=function(){return this.options.xhtml?"<br/>":"<br>"},ie.del=function(Y){return"<del>"+Y+"</del>"},ie.link=function(Y,X,Z){if(Y=Fe(this.options.sanitize,this.options.baseUrl,Y),Y===null)return Z;var te='<a href="'+He(Y)+'"';return X&&(te+=' title="'+X+'"'),te+=">"+Z+"</a>",te},ie.image=function(Y,X,Z){if(Y=Fe(this.options.sanitize,this.options.baseUrl,Y),Y===null)return Z;var te='<img src="'+Y+'" alt="'+Z+'"';return X&&(te+=' title="'+X+'"'),te+=this.options.xhtml?"/>":">",te},ie.text=function(Y){return Y},le}(),Le=function(){function le(){}var ie=le.prototype;return ie.strong=function(Y){return Y},ie.em=function(Y){return Y},ie.codespan=function(Y){return Y},ie.del=function(Y){return Y},ie.html=function(Y){return Y},ie.text=function(Y){return Y},ie.link=function(Y,X,Z){return""+Z},ie.image=function(Y,X,Z){return""+Z},ie.br=function(){return""},le}(),qe=function(){function le(){this.seen={}}var ie=le.prototype;return ie.slug=function(Y){var X=Y.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(X)){var Z=X;do this.seen[Z]++,X=Z+"-"+this.seen[Z];while(this.seen.hasOwnProperty(X))}return this.seen[X]=0,X},le}(),Ze=U.defaults,ze=V.unescape,Ge=function(){function le(ae){this.options=ae||Ze,this.options.renderer=this.options.renderer||new Me,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Le,this.slugger=new qe}le.parse=function(Y,X){var Z=new le(X);return Z.parse(Y)};var ie=le.prototype;return ie.parse=function(Y,X){X===void 0&&(X=!0);var Z="",te,se,ve,De,Qe,at,rt,xt,ht,st,Ct,yt,Ft,Bt,Et,Cr,Or,lr,pr=Y.length;for(te=0;te<pr;te++){st=Y[te];switch(st.type){case"space":continue;case"hr":{Z+=this.renderer.hr();continue}case"heading":{Z+=this.renderer.heading(this.parseInline(st.tokens),st.depth,ze(this.parseInline(st.tokens,this.textRenderer)),this.slugger);continue}case"code":{Z+=this.renderer.code(st.text,st.lang,st.escaped);continue}case"table":{for(xt="",rt="",De=st.header.length,se=0;se<De;se++)rt+=this.renderer.tablecell(this.parseInline(st.tokens.header[se]),{header:!0,align:st.align[se]});for(xt+=this.renderer.tablerow(rt),ht="",De=st.cells.length,se=0;se<De;se++){for(at=st.tokens.cells[se],rt="",Qe=at.length,ve=0;ve<Qe;ve++)rt+=this.renderer.tablecell(this.parseInline(at[ve]),{header:!1,align:st.align[ve]});ht+=this.renderer.tablerow(rt)}Z+=this.renderer.table(xt,ht);continue}case"blockquote":{ht=this.parse(st.tokens),Z+=this.renderer.blockquote(ht);continue}case"list":{for(Ct=st.ordered,yt=st.start,Ft=st.loose,De=st.items.length,ht="",se=0;se<De;se++)Et=st.items[se],Cr=Et.checked,Or=Et.task,Bt="",Et.task&&(lr=this.renderer.checkbox(Cr),Ft?Et.tokens.length>0&&Et.tokens[0].type==="text"?(Et.tokens[0].text=lr+" "+Et.tokens[0].text,Et.tokens[0].tokens&&Et.tokens[0].tokens.length>0&&Et.tokens[0].tokens[0].type==="text"&&(Et.tokens[0].tokens[0].text=lr+" "+Et.tokens[0].tokens[0].text)):Et.tokens.unshift({type:"text",text:lr}):Bt+=lr),Bt+=this.parse(Et.tokens,Ft),ht+=this.renderer.listitem(Bt,Or,Cr);Z+=this.renderer.list(ht,Ct,yt);continue}case"html":{Z+=this.renderer.html(st.text);continue}case"paragraph":{Z+=this.renderer.paragraph(this.parseInline(st.tokens));continue}case"text":{for(ht=st.tokens?this.parseInline(st.tokens):st.text;te+1<pr&&Y[te+1].type==="text";)st=Y[++te],ht+=`
`+(st.tokens?this.parseInline(st.tokens):st.text);Z+=X?this.renderer.paragraph(ht):ht;continue}default:{var fr='Token with "'+st.type+'" type was not found.';if(this.options.silent){console.error(fr);return}else throw new Error(fr)}}}return Z},ie.parseInline=function(Y,X){X=X||this.renderer;var Z="",te,se,ve=Y.length;for(te=0;te<ve;te++){se=Y[te];switch(se.type){case"escape":{Z+=X.text(se.text);break}case"html":{Z+=X.html(se.text);break}case"link":{Z+=X.link(se.href,se.title,this.parseInline(se.tokens,X));break}case"image":{Z+=X.image(se.href,se.title,se.text);break}case"strong":{Z+=X.strong(this.parseInline(se.tokens,X));break}case"em":{Z+=X.em(this.parseInline(se.tokens,X));break}case"codespan":{Z+=X.codespan(se.text);break}case"br":{Z+=X.br();break}case"del":{Z+=X.del(this.parseInline(se.tokens,X));break}case"text":{Z+=X.text(se.text);break}default:{var De='Token with "'+se.type+'" type was not found.';if(this.options.silent){console.error(De);return}else throw new Error(De)}}}return Z},le}(),tt=V.merge,Xe=V.checkSanitizeDeprecation,Ye=V.escape,ye=U.getDefaults,$e=U.changeDefaults,Ve=U.defaults;function be(le,ie,ae){if(typeof le=="undefined"||le===null)throw new Error("marked(): input parameter is undefined or null");if(typeof le!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(le)+", string expected");if(typeof ie=="function"&&(ae=ie,ie=null),ie=tt({},be.defaults,ie||{}),Xe(ie),ae){var Y=ie.highlight,X;try{X=Se.lex(le,ie)}catch(ve){return ae(ve)}var Z=function(De){var Qe;if(!De)try{Qe=Ge.parse(X,ie)}catch(at){De=at}return ie.highlight=Y,De?ae(De):ae(null,Qe)};if(!Y||Y.length<3)return Z();if(delete ie.highlight,!X.length)return Z();var te=0;be.walkTokens(X,function(ve){ve.type==="code"&&(te++,setTimeout(function(){Y(ve.text,ve.lang,function(De,Qe){if(De)return Z(De);Qe!=null&&Qe!==ve.text&&(ve.text=Qe,ve.escaped=!0),te--,te===0&&Z()})},0))}),te===0&&Z();return}try{var se=Se.lex(le,ie);return ie.walkTokens&&be.walkTokens(se,ie.walkTokens),Ge.parse(se,ie)}catch(ve){if(ve.message+=`
Please report this to https://github.com/markedjs/marked.`,ie.silent)return"<p>An error occurred:</p><pre>"+Ye(ve.message+"",!0)+"</pre>";throw ve}}be.options=be.setOptions=function(le){return tt(be.defaults,le),$e(be.defaults),be},be.getDefaults=ye,be.defaults=Ve,be.use=function(le){var ie=tt({},le);if(le.renderer&&function(){var Y=be.defaults.renderer||new Me,X=function(se){var ve=Y[se];Y[se]=function(){for(var De=arguments.length,Qe=new Array(De),at=0;at<De;at++)Qe[at]=arguments[at];var rt=le.renderer[se].apply(Y,Qe);return rt===!1&&(rt=ve.apply(Y,Qe)),rt}};for(var Z in le.renderer)X(Z);ie.renderer=Y}(),le.tokenizer&&function(){var Y=be.defaults.tokenizer||new ge,X=function(se){var ve=Y[se];Y[se]=function(){for(var De=arguments.length,Qe=new Array(De),at=0;at<De;at++)Qe[at]=arguments[at];var rt=le.tokenizer[se].apply(Y,Qe);return rt===!1&&(rt=ve.apply(Y,Qe)),rt}};for(var Z in le.tokenizer)X(Z);ie.tokenizer=Y}(),le.walkTokens){var ae=be.defaults.walkTokens;ie.walkTokens=function(Y){le.walkTokens(Y),ae&&ae(Y)}}be.setOptions(ie)},be.walkTokens=function(le,ie){for(var ae=P(le),Y;!(Y=ae()).done;){var X=Y.value;ie(X);switch(X.type){case"table":{for(var Z=P(X.tokens.header),te;!(te=Z()).done;){var se=te.value;be.walkTokens(se,ie)}for(var ve=P(X.tokens.cells),De;!(De=ve()).done;)for(var Qe=De.value,at=P(Qe),rt;!(rt=at()).done;){var xt=rt.value;be.walkTokens(xt,ie)}break}case"list":{be.walkTokens(X.items,ie);break}default:X.tokens&&be.walkTokens(X.tokens,ie)}}},be.Parser=Ge,be.parser=Ge.parse,be.Renderer=Me,be.TextRenderer=Le,be.Lexer=Se,be.lexer=Se.lex,be.Tokenizer=ge,be.Slugger=qe,be.parse=be;var Pe=be;return Pe})},E3HF:function(we,Ae,Q){we.exports={flex_box_center:"flex_box_center___9yD0l",flex_space_between:"flex_space_between___12_t1",flex_box_vertical_center:"flex_box_vertical_center____RzXy",flex_box_center_end:"flex_box_center_end___w5V55",flex_box_column:"flex_box_column___1O69H",bg:"bg___1SAB4",flexRow:"flexRow___TGonw",flexJustifyCenter:"flexJustifyCenter___FdZYv",flexAlignEnd:"flexAlignEnd___2MQGW",flexAlingCenter:"flexAlingCenter___HR4pS",flexAlignCenter:"flexAlignCenter___2tpRP",flexColumn:"flexColumn___2x5QM",formWrap:"formWrap___3nPVX",titleWrap:"titleWrap___2I_px",fieldWrap:"fieldWrap___q51w8",mdWrap:"mdWrap___1_3Z7",backgroundFa:"backgroundFa___3eVc8",button:"button___BK_yA",icons:"icons___FzVfz",navBar:"navBar___3G5De",active:"active___15cJu",tipWrap:"tipWrap___20yI4",tip:"tip___2Y6MS",width300:"width300___-1o3l",popover:"popover___2-F6L",groupWrap:"groupWrap___2_3AK"}},E7E6:function(we,Ae){we.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADUCAYAAADZTGx+AAAgAElEQVR4Xu2dC3BU13nHv7MrIQkQQoCEtAIEAmxig4GACxhogpM6NY7jOKZO4nimwcFot23SNNNO02napJN0JjN9TNMm5eG3x4+YSeI3ftUGjCDGQMBgG4wxb+0u4mEeQhJI2tP539WR7i77uPfuvXfvar8zs7Mr7bnn8Z3vt9/5zlMQB5aAQQmsW7fO397eHujp6Rkfi8XGExFeDX2vABHVSSlrhBDDiKhdSnlOCBGWUu4mol1lZWWv3nfffccNZueJaMITpeBCeEICjz/++LCOjo5GIpogpWwUQjT2vU/A/wCClNJvtbBCCCml3CaEeGzChAmPLF269LLVtNx6jgFxS9IeyOehhx6q7OnpmSilnEhE2gsA4L0PhjHZillRUUHl5WUUf6+giopyKi+Pv8rKyrSX3++nnp4e7XXpUgedP3+ezp37lE6ebKPe3l4tCyFEhIj+UwjxaHNz8+ls+ebrewYkX5J3IN9169YNv3DhwsRYLIbXJAWBDoZRmbKFYkPRhw4dqgEwdCgAwOfyPiDKyefzWS454Dh58iQdPPiJBk0fKN1E9KyU8gehUKjVcuIOPciAOCRYJ5J95JFHyq9cuaJZACHEJCklIOgHQUq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eI6lLUpAMslMSulva2ub2NPT0+TzyUAsJup9PgpIKQNSinohtM/1RFRo5/1cFkJEpKSwEDIihAjHYhT2+WQkFhPhkpKSQ7W1tUdwsnmOOjWoHmdALDbn+fPnR3V2dgKW0ULEqmIxUSWlHCmErJJSVAlBVVIS3kcS4X9ULoQolVKWZnpHcaSU3UKI7szv1EUkzuNSKSEI7+eFkOelFOeFEOd8Pnz24fOZioqKcFVV1VmLVS3qx/4fQLyzKIIkCJoAAAAASUVORK5CYII="},ELLl:function(we,Ae,Q){(function(q){q(Q("VrN/"))})(function(q){var G={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},D=q.Pos;q.defineOption("autoCloseBrackets",!1,function(S,A,d){d&&d!=q.Init&&(S.removeKeyMap(P),S.state.closeBrackets=null),A&&(M(K(A,"pairs")),S.state.closeBrackets=A,S.addKeyMap(P))});function K(S,A){return A=="pairs"&&typeof S=="string"?S:typeof S=="object"&&S[A]!=null?S[A]:G[A]}var P={Backspace:I,Enter:R};function M(S){for(var A=0;A<S.length;A++){var d=S.charAt(A),o="'"+d+"'";P[o]||(P[o]=U(d))}}M(G.pairs+"`");function U(S){return function(A){return T(A,S)}}function B(S){var A=S.state.closeBrackets;if(!A||A.override)return A;var d=S.getModeAt(S.getCursor());return d.closeBrackets||A}function I(S){var A=B(S);if(!A||S.getOption("disableInput"))return q.Pass;for(var d=K(A,"pairs"),o=S.listSelections(),l=0;l<o.length;l++){if(!o[l].empty())return q.Pass;var u=L(S,o[l].head);if(!u||d.indexOf(u)%2!=0)return q.Pass}for(var l=o.length-1;l>=0;l--){var y=o[l].head;S.replaceRange("",D(y.line,y.ch-1),D(y.line,y.ch+1),"+delete")}}function R(S){var A=B(S),d=A&&K(A,"explode");if(!d||S.getOption("disableInput"))return q.Pass;for(var o=S.listSelections(),l=0;l<o.length;l++){if(!o[l].empty())return q.Pass;var u=L(S,o[l].head);if(!u||d.indexOf(u)%2!=0)return q.Pass}S.operation(function(){var y=S.lineSeparator()||`
`;S.replaceSelection(y+y,null),S.execCommand("goCharLeft"),o=S.listSelections();for(var m=0;m<o.length;m++){var h=o[m].head.line;S.indentLine(h,null,!0),S.indentLine(h+1,null,!0)}})}function g(S){var A=q.cmpPos(S.anchor,S.head)>0;return{anchor:new D(S.anchor.line,S.anchor.ch+(A?-1:1)),head:new D(S.head.line,S.head.ch+(A?1:-1))}}function T(S,A){var d=B(S);if(!d||S.getOption("disableInput"))return q.Pass;var o=K(d,"pairs"),l=o.indexOf(A);if(l==-1)return q.Pass;for(var u=K(d,"closeBefore"),y=K(d,"triples"),m=o.charAt(l+1)==A,h=S.listSelections(),w=l%2==0,E,f=0;f<h.length;f++){var c=h[f],s=c.head,a,v=S.getRange(s,D(s.line,s.ch+1));if(w&&!c.empty())a="surround";else if((m||!w)&&v==A)m&&C(S,s)?a="both":y.indexOf(A)>=0&&S.getRange(s,D(s.line,s.ch+3))==A+A+A?a="skipThree":a="skip";else if(m&&s.ch>1&&y.indexOf(A)>=0&&S.getRange(D(s.line,s.ch-2),s)==A+A){if(s.ch>2&&/\bstring/.test(S.getTokenTypeAt(D(s.line,s.ch-2))))return q.Pass;a="addFour"}else if(m){var p=s.ch==0?" ":S.getRange(D(s.line,s.ch-1),s);if(!q.isWordChar(v)&&p!=A&&!q.isWordChar(p))a="both";else return q.Pass}else if(w&&(v.length===0||/\s/.test(v)||u.indexOf(v)>-1))a="both";else return q.Pass;if(!E)E=a;else if(E!=a)return q.Pass}var b=l%2?o.charAt(l-1):A,O=l%2?A:o.charAt(l+1);S.operation(function(){if(E=="skip")S.execCommand("goCharRight");else if(E=="skipThree")for(var N=0;N<3;N++)S.execCommand("goCharRight");else if(E=="surround"){for(var W=S.getSelections(),N=0;N<W.length;N++)W[N]=b+W[N]+O;S.replaceSelections(W,"around"),W=S.listSelections().slice();for(var N=0;N<W.length;N++)W[N]=g(W[N]);S.setSelections(W)}else E=="both"?(S.replaceSelection(b+O,null),S.triggerElectric(b+O),S.execCommand("goCharLeft")):E=="addFour"&&(S.replaceSelection(b+b+b+b,"before"),S.execCommand("goCharRight"))})}function L(S,A){var d=S.getRange(D(A.line,A.ch-1),D(A.line,A.ch+1));return d.length==2?d:null}function C(S,A){var d=S.getTokenAt(D(A.line,A.ch+1));return/\bstring/.test(d.type)&&d.start==A.ch&&(A.ch==0||!/\bstring/.test(S.getTokenTypeAt(A)))}})},FOrL:function(we,Ae,Q){we.exports=Q.p+"static/nodata.a6b3f948.png"},FPkq:function(we,Ae,Q){we.exports=Q.p+"static/qrCode.dd0fe9b2.png"},GABl:function(we,Ae){we.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAYAAADFeBvrAAAKi0lEQVRoQ71ae3BU1Rn//e7dzYuioNRsHlSqRiUB2eUx0hbaKAHEAMWxiQ6PTUAUGCuIQNVOZ0xnrHUE5GHHIqOwCag8BlQiQnnUokgt5AEIK5GnBpIFXwjkAdl7vs7dkJCETXLvEj3/5d7v9/u+337nfN8554bowBHo16+3YRh3K7IPBHcRSIDI9QJ0AWkA8h0E3xM8DWAvde5x6Pqe+D17jnVUGLxWogqPp78SGSeC3wP4ZUR8pJ+Ct50O7e344uKjEXFcBkUkSERY6e43RkE9JcCgawngaiw3O6A/l7CvaHckvLYFhTKi5B8C3B2JQ6sYEhvpcMxKKioqs4ox7SwLkvT0mFNnz82HqKkCaHacRGxL1gDybHJp6WKSYoXHkqBytzuF4FoR6WOFtKNtCP4b0c7s5N27v22Pu11B5e7+6ZTgBgE6t0f2Y74n8IUjOuo+1+7dx9vy06agcrf7fgjXARLzYwZrnZsB6BzevaRkf2uYVgWdcruHKnAjRJzWHf4ElmSl5nTcnbRnT3k4b2EFVfTt29NQ8l+zKf4EIUbi4kAnhz7ohuLiH1qCwwo62cf9ccf3l0jibh1DckPy3lKzmTcbYQWV9+k7HlArOjaEjmejRm9yaWmzOMMKMncCp9x9dwlkYEeEQUCBrO0IrqYcApx1xsV6XLt2nWl43kyQqyB38dQJPZ7M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DCjIfulZM/KMo9YptchsAEk8HvPkvhdbVwYznIJJnA97EVBvLXlvfblZ0whG58nPWCvCHyJy0gyKPde7WOdVcP3JkWHfUqkOAxNn2Rcxn2vbZLXFhr15vW/nEdeeNcyUArr5ctO25OUAjH6z0+tZfzs4qRFJZiU1IHTySvPoDQKt3yeb1cFDJNhHcdI0amhQk7gh4fen1YoYPhgQ/ss/NzxHtHGj2nHDYNi/Hk9/MTQka2CoiN9t3fNVkUDr0/hU5b5SK5Gnw7yyCiMcWL+GH5sxkz80nWsO1e9uftHJysqHqtoigpy3nLYxJLgt4fY+EsnMg41FAltriIzciyjm2tcy0WuXCOUnKf/xGg1VvishwW0Fc8XIhNoYpJ7J9gfpLRByGyM8tc5FzkTromXBrxlJRaM2ReW0sSi0QQTfLwZiG1P582rv876Hs+DNehpKZFvEnoWE2U7dbbrrtTrmWjhPfeqybEby0ECLjrARF8ETML9DzxD2+WikbdifqDHND2vb/PpDm5/oXcV3XRey+tsaKH1tTLhyh661H0xCsmyaQCW1dg1HTHwpMWLbmcpneBJH7Wg+QVdCwFKI/z7R/fWdHyDULaiCIL5jdScM3Y6X+m04/aXIPQGJnwJs/OCTm8yEjYSDMLSurQPkI5CrcoK2ja0vobBTpsD3l2nKU/mGe43DFiV5Ksb8SNUCj9lrlhOUl5r8JwG9evjMBhDmdjkJYBp2luLPHHrL+nq8jxv8BV2A7FHmr6w0AAAAASUVORK5CYII="},Gytx:function(we,Ae){we.exports=function(q,G,D,K){var P=D?D.call(K,q,G):void 0;if(P!==void 0)return!!P;if(q===G)return!0;if(typeof q!="object"||!q||typeof G!="object"||!G)return!1;var M=Object.keys(q),U=Object.keys(G);if(M.length!==U.length)return!1;for(var B=Object.prototype.hasOwnProperty.bind(G),I=0;I<M.length;I++){var R=M[I];if(!B(R))return!1;var g=q[R],T=G[R];if(P=D?D.call(K,g,T,R):void 0,P===!1||P===void 0&&g!==T)return!1}return!0}},HmJG:function(we,Ae,Q){},HpTS:function(we,Ae,Q){we.exports=Q.p+"static/small_program.f74069ec.png"},JWDV:function(we,Ae,Q){we.exports=Q.p+"static/charpter-white.5fa14f93.svg"},JeFH:function(we,Ae){we.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGgAAAAwCAYAAAD9wT87AAAe2UlEQVR4XtVcB5QUVbr+blV1T+ieGWaYBAwgOSgooJLjENeA6a2KCVfZNbum3VXXsG9VdFfc1TXtGlfXLCKgEiRnUAHJWRzAyTl3V9V957vV1dPTM+M4Hn2Pd8/xIHRV9f3vn77/+/9qgVaWlHIggHMB+AA8K4TIbe2ek/FzKWUmgLGw7THQtLlCiBUn4z6j9ySa26SUMg3A+ZDyaljBMTC87mXrAUwSQtT+fxBOSqmbpjnaMIyrYJnToRvtQ/sOAJgihFh1ssvRSEFSysEAroJlXQZdp8VhXUEAS07UYGavBPSIQz10vacQ4vjJLJiUMgPAhZByJoQYyr0erZFYmFOFZK+GK7szGOB3Qoi/nsxycG9KQVLKKyDltbDMbBge5NYD87+twvxjNdhbZiIoJZZMysRpPqsShreXECL/ZBRMSjkAwM2wzIugG2k2gOW59fjgaDU2FNbjRI2Fm/r48eigdtz+TUKIF05GOSL3JKSUDwN4SALYXBRQwqzIrUNBvQ1DAIYm4BHAJxMz0TPOLoJu9BFClJxsglVVVWXGx8d/IYTIOl4rsSCnGvNzarCvIghLAl5NoN6WuKVPAu4dkMjtXyuEeP1kk6NJDpJSHgTQ8+Ht5Xj5UBWoqBhNQAsFP/6dwi2alIlTYq1caEY/IUT5zyGYlLIvgD4AugLIgm0zF3qgaccDgcCbMTExu1v6Xinl6YDc/lWxiWvWF6E04BiYxxUEQK0lcUe/BNx9qlLQFUKIt38mOVIAnA6gG4AugM104Qe0ajo1gA+FEHTwVhc96CoAbzy9txJP7KpAPKWKWFRQrCawZEoHZHnN4yEFVbX65DZeIKW8DVI+DiHimrtVSnlCCDFUCHGihc+TYJl7jwf1DlOW5KHWltCiLqSCfndqIm7vlwDLsi41DOP9Nm6z1cullL0BLATAP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png"},LdHM:function(we,Ae,Q){"use strict";Q.d(Ae,"b",function(){return u}),Q.d(Ae,"a",function(){return m});var q=Q("1OyB"),G=Q("vuIU"),D=Q("Ji7U"),K=Q("LK+K"),P=Q("cDcd"),M=Q("rePB"),U=Q("Ff2n"),B=Q("ODXe"),I=Q("4IlW"),R=Q("bX4T"),g=Q("YrtM"),T=Q("TSYQ"),L=Q.n(T),C=Q("+nKL"),S=Q("8OUc"),A=function(J,ee){var oe=J.prefixCls,de=J.id,Ce=J.flattenOptions,ge=J.childrenAsData,pe=J.values,ce=J.searchValue,he=J.multiple,ne=J.defaultActiveFirstOption,ue=J.height,Ee=J.itemHeight,_e=J.notFoundContent,Oe=J.open,Ne=J.menuItemSelectedIcon,je=J.virtual,xe=J.onSelect,Se=J.onToggleOpen,Ie=J.onActiveValue,Fe=J.onScroll,He=J.onMouseEnter,Me="".concat(oe,"-item"),Le=Object(g.a)(function(){return Ce},[Oe,Ce],function(Pe,le){return le[0]&&Pe[1]!==le[1]}),qe=P.useRef(null),Ze=function(le){le.preventDefault()},ze=function(le){qe.current&&qe.current.scrollTo({index:le})},Ge=function(le){for(var ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,ae=Le.length,Y=0;Y<ae;Y+=1){var X=(le+Y*ie+ae)%ae,Z=Le[X],te=Z.group,se=Z.data;if(!te&&!se.disabled)return X}return-1},tt=P.useState(function(){return Ge(0)}),Xe=Object(B.a)(tt,2),Ye=Xe[0],ye=Xe[1],$e=function(le){ye(le);var ie=Le[le];if(!ie){Ie(null,-1);return}Ie(ie.data.value,le)};P.useEffect(function(){$e(ne!==!1?Ge(0):-1)},[Le.length,ce]),P.useEffect(function(){var Pe=setTimeout(function(){if(!he&&Oe&&pe.size===1){var le=Array.from(pe)[0],ie=Le.findIndex(function(ae){var Y=ae.data;return Y.value===le});$e(ie),ze(ie)}});return function(){return clearTimeout(Pe)}},[Oe]);var Ve=function(le){le!==void 0&&xe(le,{selected:!pe.has(le)}),he||Se(!1)};if(P.useImperativeHandle(ee,function(){return{onKeyDown:function(le){var ie=le.which;switch(ie){case I.a.UP:case I.a.DOWN:{var ae=0;if(ie===I.a.UP?ae=-1:ie===I.a.DOWN&&(ae=1),ae!==0){var Y=Ge(Ye+ae,ae);ze(Y),$e(Y)}break}case I.a.ENTER:{var X=Le[Ye];X&&!X.data.disabled?Ve(X.data.value):Ve(void 0),Oe&&le.preventDefault();break}case I.a.ESC:Se(!1)}},onKeyUp:function(){},scrollTo:function(le){ze(le)}}}),Le.length===0)return P.createElement("div",{role:"listbox",id:"".concat(de,"_list"),className:"".concat(Me,"-empty"),onMouseDown:Ze},_e);function be(Pe){var le=Le[Pe];if(!le)return null;var ie=le.data||{},ae=ie.value,Y=ie.label,X=ie.children,Z=Object(R.a)(ie,!0),te=ge?X:Y;return le?P.createElement("div",Object.assign({"aria-label":typeof te=="string"?te:null},Z,{key:Pe,role:"option",id:"".concat(de,"_list_").concat(Pe),"aria-selected":pe.has(ae)}),ae):null}return P.createElement(P.Fragment,null,P.createElement("div",{role:"listbox",id:"".concat(de,"_list"),style:{height:0,width:0,overflow:"hidden"}},be(Ye-1),be(Ye),be(Ye+1)),P.createElement(C.a,{itemKey:"key",ref:qe,data:Le,height:ue,itemHeight:Ee,fullHeight:!1,onMouseDown:Ze,onScroll:Fe,virtual:je,onMouseEnter:He},function(Pe,le){var ie,ae=Pe.group,Y=Pe.groupOption,X=Pe.data,Z=X.label,te=X.key;if(ae)return P.createElement("div",{className:L()(Me,"".concat(Me,"-group"))},Z!==void 0?Z:te);var se=X.disabled,ve=X.value,De=X.title,Qe=X.children,at=X.style,rt=X.className,xt=Object(U.a)(X,["disabled","value","title","children","style","className"]),ht=pe.has(ve),st="".concat(Me,"-option"),Ct=L()(Me,st,rt,(ie={},Object(M.a)(ie,"".concat(st,"-grouped"),Y),Object(M.a)(ie,"".concat(st,"-active"),Ye===le&&!se),Object(M.a)(ie,"".concat(st,"-disabled"),se),Object(M.a)(ie,"".concat(st,"-selected"),ht),ie)),yt=ge?Qe:Z,Ft=!Ne||typeof Ne=="function"||ht;return P.createElement("div",Object.assign({},xt,{"aria-selected":ht,className:Ct,title:De,onMouseMove:function(){if(Ye===le||se)return;$e(le)},onClick:function(){se||Ve(ve)},style:at}),P.createElement("div",{className:"".concat(st,"-content")},yt||ve),P.isValidElement(Ne)||ht,Ft&&P.createElement(S.a,{className:"".concat(Me,"-option-state"),customizeIcon:Ne,customizeIconProps:{isSelected:ht}},ht?"\u2713":null))}))},d=P.forwardRef(A);d.displayName="OptionList";var o=d,l=function(){return null};l.isSelectOption=!0;var u=l,y=function(){return null};y.isSelectOptGroup=!0;var m=y,h=Q("VTBJ"),w=Q("Zm9Q");function E(_){var J=_.key,ee=_.props,oe=ee.children,de=ee.value,Ce=Object(U.a)(ee,["children","value"]);return Object(h.a)({key:J,value:de!==void 0?de:J,children:oe},Ce)}function f(_){var J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(w.a)(_).map(function(ee,oe){if(!P.isValidElement(ee)||!ee.type)return null;var de=ee.type.isSelectOptGroup,Ce=ee.key,ge=ee.props,pe=ge.children,ce=Object(U.a)(ge,["children"]);return J||!de?E(ee):Object(h.a)(Object(h.a)({key:"__RC_SELECT_GRP__".concat(Ce===null?oe:Ce,"__"),label:Ce},ce),{},{options:f(pe)})}).filter(function(ee){return ee})}var c=Q("2Qr1"),s=Q("qNPg"),a=Q("U8pU"),v=Q("Kwbf"),p=Q("WKfj");function b(_){var J=_.mode,ee=_.options,oe=_.children,de=_.backfill,Ce=_.allowClear,ge=_.placeholder,pe=_.getInputElement,ce=_.showSearch,he=_.onSearch,ne=_.defaultOpen,ue=_.autoFocus,Ee=_.labelInValue,_e=_.value,Oe=_.inputValue,Ne=_.optionLabelProp,je=J==="multiple"||J==="tags",xe=ce!==void 0?ce:je||J==="combobox",Se=ee||f(oe);if(Object(v.a)(J!=="tags"||Se.every(function(Me){return!Me.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),J==="tags"||J==="combobox"){var Ie=Se.some(function(Me){return Me.options?Me.options.some(function(Le){return typeof("value"in Le?Le.value:Le.key)=="number"}):typeof("value"in Me?Me.value:Me.key)=="number"});Object(v.a)(!Ie,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(v.a)(J!=="combobox"||!Ne,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(v.a)(J==="combobox"||!de,"`backfill` only works with `combobox` mode."),Object(v.a)(J==="combobox"||!pe,"`getInputElement` only work with `combobox` mode."),Object(v.b)(J!=="combobox"||!pe||!Ce||!ge,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),he&&!xe&&J!=="combobox"&&J!=="tags"&&Object(v.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(v.b)(!ne||ue,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),_e!=null){var Fe=Object(p.d)(_e);Object(v.a)(!Ee||Fe.every(function(Me){return Object(a.a)(Me)==="object"&&("key"in Me||"value"in Me)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(v.a)(!je||Array.isArray(_e),"`value` should be array when `mode` is `multiple` or `tags`")}if(oe){var He=null;Object(w.a)(oe).some(function(Me){if(!P.isValidElement(Me)||!Me.type)return!1;var Le=Me.type;if(Le.isSelectOption)return!1;if(Le.isSelectOptGroup){var qe=Object(w.a)(Me.props.children).every(function(Ze){return!P.isValidElement(Ze)||!Me.type||Ze.type.isSelectOption?!0:(He=Ze.type,!1)});return!qe}return He=Le,!0}),He&&Object(v.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(He.displayName||He.name||He,"`.")),Object(v.a)(Oe===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var O=b,N=Object(s.a)({prefixCls:"rc-select",components:{optionList:o},convertChildrenToData:f,flattenOptions:c.d,getLabeledValue:c.e,filterOptions:c.b,isValueDisabled:c.g,findValueOption:c.c,warningProps:O,fillOptionsWithMissingValue:c.a}),W=function(_){Object(D.a)(ee,_);var J=Object(K.a)(ee);function ee(){var oe;return Object(q.a)(this,ee),oe=J.apply(this,arguments),oe.selectRef=P.createRef(),oe.focus=function(){oe.selectRef.current.focus()},oe.blur=function(){oe.selectRef.current.blur()},oe}return Object(G.a)(ee,[{key:"render",value:function(){return P.createElement(N,Object.assign({ref:this.selectRef},this.props))}}]),ee}(P.Component);W.Option=u,W.OptGroup=m;var V=W,F=Ae.c=V},M8RZ:function(we,Ae,Q){"use strict";Q.d(Ae,"a",function(){return I});var q=Q("fWQN"),G=Q("mtLc"),D=Q("yKVA"),K=Q("879j"),P=Q("cDcd"),M=Q.n(P),U=Q("faye"),B=Q.n(U),I=function(R){Object(D.a)(T,R);var g=Object(K.a)(T);function T(L){var C;Object(q.a)(this,T),C=g.call(this,L);var S=window.document;return C.node=S.createElement("div"),S.body.appendChild(C.node),C}return Object(G.a)(T,[{key:"render",value:function(){var C=this.props.children;return Object(U.createPortal)(C,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),T}(M.a.Component)},Nmxd:function(we,Ae){we.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAF4ElEQVRoQ91aW2wUVRj+/rPbSivURIgKjZcHjUYTgZ0lthgv3V0LSqB9IAQeNNEIaKKwZbcFnuQJoZ1piyYawJjIiwZDwiVBaHd28QItaWeLD4KJPgimiA+YCAZj6Z7fzPZiu7e57WriJE0f5v++//tm/j3nn3MOoQyXcmJ/LdfeCBOjEUA9EdUzUA9g0ST9VQJGmXkU5n/CAN2q043Vm295TU9uCRS9MwCiFWBqAmD++R1yjQNIgTgF5tNGuCPtEJ8Nd2xgWarzPil9UbBsA1G1m6R5GOYxkOgRItM71NRxzQmnIwMBvStKoCiAB50kcRB7mcG96XB7r12MLQNPJXrvzdD4QQZW2yX2EkfACR/7N56PRH+14rE0sDSpLRaM4wA/Y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AMQbyNRrhtvT0qkQgqe4lRof7RHKdEe6Y9XEe0NVDBLzsnrMwcmbp/rOs8lXPQtzODHhY+/9LEq0aCcV0M22wX21jge5yiwdwGVW+RuPZnGUVM9FkP+NlYesaIFcJ8s+TLM9UQDwY1JYOx6Y3QPLXRpNqPzEiHpJfBOAD8KgHjoJQs3VIh+Kzlj3zDCzp63zEJ8QgCHeXW4AnPsZvGSkbLjR3/DCT5/+3vD7lTkl0bQHRPk9PrVxg5q1GpL3gZkvpLaZU93qW8r/dYhJiw3DTNudbTFMPb1lf5xIpxHEQ7i/XA7XFw/hZSLlmqLn094flLqWZzNzcZikO/JvbrCTkJjub3rYMZJ8YgwJJbSuBK7zRTb3pUGwfCGznTdk3MMm2tG/vIvL7tpJE1G3vlCeMMcYCvTye2TfSvP2qHeFTMY4NTI9Sek8AJFewlCGi7IEPc/JycmWYOUVCJMHitNmYOQF7NjAzmTK8v5Z/N4/biEYI1BN46riNeeTGvEazx21Ao5DmcRs5QHfV6UbQ+3GbvwHH7EQQahyMxwAAAABJRU5ErkJggg=="},OLES:function(we,Ae,Q){"use strict";var q=Q("U8pU"),G=Q("VTBJ"),D=Q("Ff2n"),K=Q("cDcd"),P=Q("uciX"),M=Q("7ixt"),U=function(L){var C=L.overlay,S=L.prefixCls,A=L.id,d=L.overlayInnerStyle;return K.createElement("div",{className:"".concat(S,"-inner"),id:A,role:"tooltip",style:d},typeof C=="function"?C():C)},B=U,I=function(L,C){var S=L.overlayClassName,A=L.trigger,d=A===void 0?["hover"]:A,o=L.mouseEnterDelay,l=o===void 0?0:o,u=L.mouseLeaveDelay,y=u===void 0?.1:u,m=L.overlayStyle,h=L.prefixCls,w=h===void 0?"rc-tooltip":h,E=L.children,f=L.onVisibleChange,c=L.afterVisibleChange,s=L.transitionName,a=L.animation,v=L.placement,p=v===void 0?"right":v,b=L.align,O=b===void 0?{}:b,N=L.destroyTooltipOnHide,W=N===void 0?!1:N,V=L.defaultVisible,F=L.getTooltipContainer,_=L.overlayInnerStyle,J=Object(D.a)(L,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),ee=Object(K.useRef)(null);Object(K.useImperativeHandle)(C,function(){return ee.current});var oe=Object(G.a)({},J);"visible"in L&&(oe.popupVisible=L.visible);var de=function(){var he=L.arrowContent,ne=he===void 0?null:he,ue=L.overlay,Ee=L.id;return[K.createElement("div",{className:"".concat(w,"-arrow"),key:"arrow"},ne),K.createElement(B,{key:"content",prefixCls:w,id:Ee,overlay:ue,overlayInnerStyle:_})]},Ce=!1,ge=!1;if(typeof W=="boolean")Ce=W;else if(W&&Object(q.a)(W)==="object"){var pe=W.keepParent;Ce=pe===!0,ge=pe===!1}return K.createElement(P.a,Object.assign({popupClassName:S,prefixCls:w,popup:de,action:d,builtinPlacements:M.a,popupPlacement:p,ref:ee,popupAlign:O,getPopupContainer:F,onPopupVisibleChange:f,afterPopupVisibleChange:c,popupTransitionName:s,popupAnimation:a,defaultPopupVisible:V,destroyPopupOnHide:Ce,autoDestroy:ge,mouseLeaveDelay:y,popupStyle:m,mouseEnterDelay:l},oe),E)},R=Object(K.forwardRef)(I),g=Ae.a=R},Ohmc:function(we,Ae,Q){we.exports=Q.p+"static/certificate.fc32dc1b.jpg"},Ot1p:function(we,Ae,Q){"use strict";var q=Q("2qtc"),G=Q("kLXV"),D=Q("rAM+"),K=Q("miYZ"),P=Q("tsqr"),M=Q("9og8"),U=Q("tJVT"),B=Q("jrin"),I=Q("WmNS"),R=Q.n(I),g=Q("cDcd"),T=Q.n(g),L=Q("VrN/"),C=Q.n(L),S=Q("bdgK"),A=Q("p77/"),d=Q("Bd2K"),o=Q("ELLl"),l=Q("19Vz"),u=Q("lZu9"),y=Q("+NIl"),m=Q("kSUc"),h=Q("9Bee"),w=function(se){var ve=se.value,De=ve===void 0?"":ve,Qe=se.className,at=se.showTextOnly,rt=se.showLines,xt=se.style,ht=xt===void 0?{}:xt,st=Object(g.useMemo)(function(){return""},[De]);return T.a.createElement(T.a.Fragment,null,T.a.createElement("div",{dangerouslySetInnerHTML:{__html:st}}))},E=Q("0Owb"),f=Q("dejd"),c=Q("C+DQ"),s=Q("1vsH"),a=Q("m3rI"),v=[{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 p(se){var ve=se.onActionCallback,De=se.title,Qe=se.icon,at=se.actionName,rt=se.className,xt=rt===void 0?"":rt,ht=se.children;function st(){ve(at)}return T.a.createElement("a",{title:De,className:xt,onClick:st},T.a.createElement("i",{className:"md-iconfont ".concat(Qe)}),ht)}var b=function(se){var ve=se.watch,De=se.showNullButton,Qe=se.onActionCallback,at=se.fullScreen,rt=se.insertTemp,xt=se.hidetoolBar,ht=se.uuid,st=se.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(s.G)("_educoder_session_login"),"&_educoder_session=").concat(Object(s.G)("_educoder_session"),"&key=").concat(ht,"&api=").concat(encodeURIComponent(a.a.PROXY_SERVER)));var Ct=[].concat(v,[{title:"".concat(ve?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(ve?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return T.a.createElement("ul",{className:"markdown-toolbar-container"},!xt&&Ct.map(function(yt,Ft){return T.a.createElement("li",{key:Ft},yt.actionName?T.a.createElement(p,Object(E.a)({},yt,{onActionCallback:Qe})):T.a.createElement("span",{className:"v-line"}))}),De?T.a.createElement("li",null,T.a.createElement(p,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:Qe},T.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,rt&&T.a.createElement("li",null,T.a.createElement(p,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(rt),onActionCallback:Qe},T.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),T.a.createElement("li",{className:"btn-full-screen"},T.a.createElement(p,{icon:"".concat(at?"icon-shrink":"icon-enlarge"),title:at?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:Qe})))},O=Q("M8RZ"),N=Q("+L6B"),W=Q("2/Rp"),V=Q("y8nQ"),F=Q("Vl3Y"),_=Q("5NDa"),J=Q("5rEg"),ee={labelCol:{span:4},wrapperCol:{span:20}},oe=function(se){var ve=se.callback,De=se.onCancel;function Qe(at){ve(at)}return T.a.createElement(F.a,Object(E.a)({},ee,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Qe}),T.a.createElement(F.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},T.a.createElement(J.a,null)),T.a.createElement(F.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},T.a.createElement(J.a,null)),T.a.createElement("div",{className:"flex-container flex-end"},T.a.createElement(W.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),T.a.createElement(W.a,{type:"ghost",onClick:De},"\u53D6\u6D88")))},de=Q("7ahc"),Ce=Q("HmJG"),ge=Q("BjJ7"),pe=F.a.useForm,ce={width:280,marginRight:10},he={labelCol:{span:5},wrapperCol:{span:19}},ne=function(se){var ve=se.callback,De=se.onCancel,Qe=pe(),at=Object(U.a)(Qe,1),rt=at[0];function xt(Ct){ve(Ct)}function ht(Ct,yt){if(Ct.status===-1){P.b.error(Ct.message);return}rt.setFieldsValue({src:"/api/attachments/".concat(Ct.id),type:yt.type})}function st(Ct){var yt=Ct.target.files[0];Ee(yt,ht)}return T.a.createElement(F.a,Object(E.a)({form:rt},he,{className:"upload-image-panel",onFinish:xt}),T.a.createElement(F.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},T.a.createElement("div",{className:"flex-container"},T.a.createElement(F.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},T.a.createElement(J.a,{style:ce})),T.a.createElement(ue,{onFileChange:st}))),T.a.createElement(F.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},T.a.createElement(J.a,{style:{width:264}})),T.a.createElement(F.a.Item,{style:{textAlign:"right"}},T.a.createElement(W.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),T.a.createElement(W.a,{type:"ghost",onClick:De},"\u53D6\u6D88")))};function ue(se){var ve=se.onFileChange;return T.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",T.a.createElement("input",{type:"file",onChange:ve}))}function Ee(se,ve){if(!se)throw new String("\u6CA1\u6709\u6587\u4EF6");var De=new FormData;De.append("editormd-image-file",se),De.append("file_param_name","editormd-image-file"),De.append("byxhr","true");var Qe=new window.XMLHttpRequest;Qe.withCredentials=!0,Qe.addEventListener("load",function(at){ve(JSON.parse(at.target.responseText),se)},!1),Qe.addEventListener("error",function(at){console.error(at)},!1),Qe.open("POST","".concat(ge.a,"/api/attachments.json")),Qe.send(De)}var _e=Q("giR+"),Oe=Q("fyUT"),Ne=Q("7Kak"),je=Q("9yH6"),xe=je.a.Group,Se={margin:"0 8px"},Ie=function(se){var ve=se.callback,De=se.onCancel;function Qe(at){ve(at)}return T.a.createElement(F.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Qe},T.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},T.a.createElement("span",{style:Se},"\u5355\u5143\u683C\u6570\uFF1A"),T.a.createElement("span",{style:Se},"\u884C\u6570"),T.a.createElement(F.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},T.a.createElement(Oe.a,null)),T.a.createElement("span",{style:Se},"\u5217\u6570"),T.a.createElement(F.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},T.a.createElement(Oe.a,null))),T.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},T.a.createElement("span",{style:Se},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),T.a.createElement(F.a.Item,{name:"align"},T.a.createElement(xe,null,T.a.createElement(je.a,{value:"default"},T.a.createElement("i",{className:"fa fa-align-justify"})),T.a.createElement(je.a,{value:"left"},T.a.createElement("i",{className:"fa fa-align-left"})),T.a.createElement(je.a,{value:"center"},T.a.createElement("i",{className:"fa fa-align-center"})),T.a.createElement(je.a,{value:"right"},T.a.createElement("i",{className:"fa fa-align-right"}))))),T.a.createElement("div",{className:"flex-container flex-end"},T.a.createElement(W.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),T.a.createElement(W.a,{type:"ghost",onClick:De},"\u53D6\u6D88")))},Fe=Q("ErOA"),He=Q("7Cbv"),Me="link",Le="upload-image",qe="code-block",Ze="add-table",ze="------------",Ge={default:ze,left:":".concat(ze),center:":".concat(ze,":"),right:"".concat(ze,":")},tt=Q("9VGf"),Xe,Ye;function ye(){}var $e=0,Ve=1e4,be="\u2581",Pe=`
**\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 le(se){return/^\d+$/.test(se)?"".concat(se,"px"):se}var ie=navigator.platform.toUpperCase().indexOf("MAC")>=0,ae=ie?"Cmd":"Ctrl",Y=["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"],X=(Xe={},Object(B.a)(Xe,ae+"-B","bold"),Object(B.a)(Xe,ae+"-I","italic"),Xe),Z=(Ye={},Object(B.a)(Ye,Me,"\u6DFB\u52A0\u94FE\u63A5"),Object(B.a)(Ye,qe,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(B.a)(Ye,Le,"\u6DFB\u52A0\u6587\u4EF6"),Object(B.a)(Ye,Ze,"\u6DFB\u52A0\u8868\u683C"),Ye),te=Ae.a=function(se){var ve=se.defaultValue,De=ve===void 0?"":ve,Qe=se.onChange,at=se.width,rt=at===void 0?"100%":at,xt=se.height,ht=xt===void 0?400:xt,st=se.miniToolbar,Ct=st===void 0?!1:st,yt=se.isFocus,Ft=yt===void 0?!1:yt,Bt=se.watch,Et=se.insertTemp,Cr=se.mode,Or=Cr===void 0?"markdown":Cr,lr=se.id,pr=lr===void 0?"markdown-editor-id":lr,fr=se.showResizeBar,ia=fr===void 0?!1:fr,wr=se.noStorage,Kn=wr===void 0?!1:wr,Hn=se.showNullButton,Ot=Hn===void 0?!1:Hn,nt=se.hidetoolBar,Mr=nt===void 0?!1:nt,mn=se.fullScreen,qt=mn===void 0?!1:mn,At=se.onBlur,gr=se.onCMBeforeChange,Pr=se.onFullScreen,pn=se.className,ke=pn===void 0?"":pn,dt=se.disablePaste,Gn=dt===void 0?!1:dt,gn=se.placeholder,vn=gn===void 0?"":gn,Zr=se.values,yn=Zr===void 0?"":Zr,ft=Object(g.useState)(null),wi=Object(U.a)(ft,2),Be=wi[0],En=wi[1],hr=Object(g.useState)(De),zn=Object(U.a)(hr,2),qr=zn[0],vr=zn[1],Vn=Object(g.useState)(Bt),Qn=Object(U.a)(Vn,2),yr=Qn[0],Yn=Qn[1],Di=Object(g.useState)(qt),Jn=Object(U.a)(Di,2),Er=Jn[0],Li=Jn[1],aa=Object(g.useState)(""),Xn=Object(U.a)(aa,2),Jt=Xn[0],Wr=Xn[1],oa=Object(g.useState)(0),$r=Object(U.a)(oa,2),br=$r[0],Zn=$r[1],sa=Object(g.useState)(ht),Ri=Object(U.a)(sa,2),Ii=Ri[0],bn=Ri[1],Oi=Object(g.useState)(!1),Mi=Object(U.a)(Oi,2),la=Mi[0],xn=Mi[1],en=Object(g.useRef)(Object(He.a)()),tn=Object(g.useRef)(!1),An=Object(g.useRef)(),kr=Object(g.useRef)(),_r=Object(g.useRef)(),Br=Object(g.useRef)(),Tn=Object(g.useRef)(),Pi=function(){var it=Object(M.a)(R.a.mark(function ct(){var lt,pt;return R.a.wrap(function(Dt){for(;;)switch(Dt.prev=Dt.next){case 0:return Dt.next=2,Object(Fe.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:en.current}});case 2:pt=Dt.sent,pt!=null&&(lt=pt.attachments)!==null&&lt!==void 0&&lt.length&&(console.log("cm:",Be,kr),pt.attachments.map(function(vt){vt.content_type.indexOf("image")>-1?Be.replaceSelection("![,](/api/attachments/".concat(vt.id,"?type=").concat(vt.content_type,")")):vt.content_type.indexOf("video")>-1?Be.replaceSelection('<video width="100%" controls src="'.concat(a.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):vt.content_type.indexOf("pdf")>-1?Be.replaceSelection('<a href="'.concat(a.a.API_SERVER,"/api/attachments/").concat(vt.id,"?type=").concat(vt.content_type,'&disposition=inline" target="_blank">').concat(vt.name,"</a>")):Be.replaceSelection("[".concat(vt.name,"](").concat(a.a.API_SERVER,"/api/attachments/").concat(vt.id,"?type=").concat(vt.content_type,")"))}));case 4:case"end":return Dt.stop()}},ct)}));return function(){return it.apply(this,arguments)}}();Object(g.useEffect)(function(){vr(yn),Be==null||Be.setValue(yn)},[yn]),Object(g.useEffect)(function(){Pr==null||Pr(Er)},[Er]),Object(g.useEffect)(function(){if(kr.current){var it=C.a.fromTextArea(kr.current,{mode:Or,lineNumbers:!Ct,lineWrapping:!0,value:De,autoCloseTags:!0,autoCloseBrackets:!0});Ft&&it.focus();function ct(lt,pt){if(Gn){pt.preventDefault();return}var bt=pt.clipboardData;if(bt){var Dt=bt.types.toString(),vt=bt.items;if(Dt==="Files"||bt.types.indexOf("Files")>-1){if(pt.preventDefault(),Or=="stex")return;try{var Ut,$t=vt[1];((Ut=vt[0])===null||Ut===void 0?void 0:Ut.kind)==="file"&&($t=vt[0]);var gt=$t.getAsFile(),Ur=gt.name.split(".").pop();Ee(gt,function(Tt){if(Tt.id){var er,Vt,mr;(gt==null||((er=gt.type)===null||er===void 0)?void 0:er.indexOf("image"))>-1?it.replaceSelection("![,](/api/attachments/".concat(Tt.id,"?type=").concat(Tt.content_type,")")):(gt==null||((Vt=gt.type)===null||Vt===void 0)?void 0:Vt.indexOf("video"))>-1?it.replaceSelection('<video width="100%" controls src="'.concat(a.a.API_SERVER,"/api/attachments/").concat(Tt.id,'"></video>')):(gt==null||((mr=gt.type)===null||mr===void 0)?void 0:mr.indexOf("pdf"))>-1?it.replaceSelection('<a href="'.concat(a.a.API_SERVER,"/api/attachments/").concat(Tt.id,"?type=").concat(gt.type,'&disposition=inline" target="_blank">').concat(gt.name,"</a>")):Y.includes(Ur)?it.replaceSelection('<a href="'.concat(a.a.API_SERVER,"/api/attachments/").concat(Tt.id,'?type=office&disposition=inline" target="_blank">').concat(gt.name,"</a>")):it.replaceSelection("[".concat(gt.name,"](").concat(a.a.API_SERVER,"/api/attachments/").concat(Tt.id,"?type=").concat(Tt.content_type,")"))}else(Tt==null?void 0:Tt.status)===401&&(document.location.href="/user/login")})}catch(Tt){P.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return it.on("paste",ct),it.on("dragleave",function(lt,pt){_r.current.classList.remove("mouse-hover-md")}),it.on("dragover",function(lt,pt){_r.current.classList.add("mouse-hover-md")}),it.on("drop",function(lt,pt){_r.current.classList.add("mouse-hover-md");var bt;if(bt=pt.dataTransfer.files,bt.length>0){pt.preventDefault(),pt.stopPropagation();for(var Dt=function($t){var gt=bt[$t],Ur=gt.name.split(".").pop();Ee(gt,function(Tt){if(Tt.id){var er,Vt,mr;(gt==null||((er=gt.type)===null||er===void 0)?void 0:er.indexOf("image"))>-1?it.replaceSelection("![,](/api/attachments/".concat(Tt.id,"?type=").concat(Tt.content_type,")")):(gt==null||((Vt=gt.type)===null||Vt===void 0)?void 0:Vt.indexOf("video"))>-1?it.replaceSelection('<video width="100%" controls src="'.concat(a.a.API_SERVER,"/api/attachments/").concat(Tt.id,'"></video>')):(gt==null||((mr=gt.type)===null||mr===void 0)?void 0:mr.indexOf("pdf"))>-1?it.replaceSelection('<a href="'.concat(a.a.API_SERVER,"/api/attachments/").concat(Tt.id,"?type=").concat(gt.type,'&disposition=inline" target="_blank">').concat(gt.name,"</a>")):Y.includes(Ur)?it.replaceSelection('<a href="'.concat(a.a.API_SERVER,"/api/attachments/").concat(Tt.id,'?type=office&disposition=inline" target="_blank">').concat(gt.name,"</a>")):it.replaceSelection("[".concat(gt.name,"](").concat(a.a.API_SERVER,"/api/attachments/").concat(Tt.id,"?type=").concat(Tt.content_type,")"))}else(Tt==null?void 0:Tt.status)===401&&(document.location.href="/user/login")})},vt=0;vt<bt.length;vt++)Dt(vt)}}),En(it),function(){it.off("paste",ct)}}},[]);var ur=Object(g.useCallback)(function(){if(_r.current)try{}catch(it){console.log(it,"---- to set md editor body height")}},[Ii,_r,Er]);Object(g.useEffect)(function(){function it(){var lt=new S.default(function(pt){var bt=Object(D.a)(pt),Dt;try{for(bt.s();!(Dt=bt.n()).done;){var vt=Dt.value;(vt.target.offsetHeight>0||vt.target.offsetWidth>0)&&(ur(),Be.setSize("100%","100%"),Be.refresh())}}catch(Ut){bt.e(Ut)}finally{bt.f()}});return lt.observe(kr.current.parentElement),lt}if(Be){var ct=it();return function(){ct.unobserve(kr.current.parentElement)}}},[Be,ur]),Object(g.useEffect)(function(){if(Be){for(var it=[],ct=function(){var vt=pt[lt];bt=Object(U.a)(vt,2);var Ut=bt[0],$t=bt[1],gt=Object(B.a)({},Ut,function(){ki($t)});it.push(gt),Be.addKeyMap(gt)},lt=0,pt=Object.entries(X);lt<pt.length;lt++){var bt;ct()}return An.current=setInterval(function(){tn.current&&Pi()},4e3),function(){clearInterval(An.current);var Dt=Object(D.a)(it),vt;try{for(Dt.s();!(vt=Dt.n()).done;){var Ut=vt.value;Be.removeKeyMap(Ut)}}catch($t){Dt.e($t)}finally{Dt.f()}}}},[Be]),Object(g.useEffect)(function(){qt!==Er&&Li(qt)},[qt]),Object(tt.a)(function(){if(!Kn&&br>0){var it=new Date().getTime(),ct=window.sessionStorage.getItem(pr);it>=br+Ve&&(!ct||ct!==qr)&&(window.sessionStorage.setItem(pr,qr),xn(!0))}},Ve),Object(g.useEffect)(function(){Yn(Bt)},[Be,Bt]),Object(g.useEffect)(function(){Be&&(Ft&&Be.focus())},[Be,Ft]),Object(g.useEffect)(function(){if(yr&&Be){var it=Be.getScrollerElement();function ct(lt){var pt=lt.target;if(Tn.current){var bt=pt.scrollTop/pt.scrollHeight;Tn.current.scrollTop=Tn.current.scrollHeight*bt}}return it.addEventListener("scroll",ct),function(){it.removeEventListener("scroll",ct)}}},[Be,yr]),Object(g.useEffect)(function(){if(Be&&gr){function it(ct,lt){gr(ct,lt)}return Be.on("beforeChange",it),function(){Be.off("beforeChange",it)}}},[Be,gr]),Object(g.useEffect)(function(){if(Be&&At){function it(){At(Be.getValue())}return Be.on("blur",it),function(){Be.off("blur",it)}}},[Be,At]),Object(g.useEffect)(function(){if(Be){function it(ct){var lt=ct.getValue();vr(lt),Zn(new Date().getTime()),ct.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Qe&&Qe(lt)}return Be.on("change",it),function(){Be.off("change",it)}}},[Be,Qe]),Object(g.useEffect)(function(){Be&&(De==null?(Be.setValue(""),vr("")):De!==Be.getValue()&&(Be.setValue(De),vr(De),Be.setCursor(Be.lineCount(),0)))},[Be,De]);var ki=Object(g.useCallback)(function(it){var ct=Be.getCursor(),lt=Be.getSelection(),pt=lt.split(`
`);switch(it){case"bold":return Be.replaceSelection("**"+lt+"**"),lt===""&&Be.setCursor(ct.line,ct.ch+2),Be.focus();case"italic":return Be.replaceSelection("*"+lt+"*"),lt===""&&Be.setCursor(ct.line,ct.ch+1),Be.focus();case"code":return Be.replaceSelection("`"+lt+"`"),lt===""&&Be.setCursor(ct.line,ct.ch+1),Be.focus();case"inline-latex":return Be.replaceSelection("`$$"+lt+"$$`"),lt===""&&Be.setCursor(ct.line,ct.ch+3),Be.focus();case"latex":return Be.replaceSelection("```latex\n"+lt+"\n```"),Be.setCursor(ct.line+1,lt.length+1),Be.focus();case"line-break":return Be.replaceSelection(`<br/>
`),Be.focus();case"list-ul":return lt===""?Be.replaceSelection("- "+lt):Be.replaceSelection(pt.map(function(bt){return bt===""?"":"- ".concat(bt)}).join(`
`)),Be.focus();case"list-ol":return lt===""?Be.replaceSelection("1. "+lt):Be.replaceSelection(pt.map(function(bt,Dt){return bt===""?"":"".concat(Dt+1,". ").concat(bt)}).join(`
`)),Be.focus();case"add-null-ch":return lt===""&&Be.setCursor(ct.line,ct.ch+1),Be.replaceSelection(be),Be.focus();case"inster-template-1":return lt===""&&Be.setCursor(ct.line,ct.ch),Be.replaceSelection(Pe),Be.focus();case"eraser":return Be.setValue(""),Be.focus();case"trigger-watch":return Yn(!yr),Be.focus();case"trigger-full-screen":return Li(!Er),Be.focus();case Me:Wr(Me);return;case qe:Wr(qe);return;case Le:Wr(Le);return;case Ze:Wr(Ze);return;default:throw new Error}},[Be,yr,Er]),Sn=Object(g.useCallback)(function(it){Wr("");switch(Jt){case Me:var ct=it.title,lt=it.link;return Be.replaceSelection("[".concat(ct,"](").concat(lt,")")),Be.focus();case qe:var pt=it.language,bt=it.content;return Be.replaceSelection(["```"+pt,bt,"```"].join(`
`)),Be.focus();case Le:var Dt=it.src,vt=it.alt;return vt?Be.replaceSelection("![ ".concat(vt," ]( ").concat(Dt,' "').concat(vt,'" )')):Be.replaceSelection("![,](".concat(Dt,")")),Be.focus();case Ze:for(var Ut=it.row,$t=it.col,gt=it.align,Ur=`
`,Tt=0;Tt<Ut;Tt++){for(var er=[],Vt=[],mr=0;mr<$t;mr++)Tt===1&&Vt.push(Ge[gt]),er.push(" ");Tt===1&&(Ur+="| ".concat(Vt.join(" | "),` |
`)),Ur+="| ".concat(er.join($t===1?"":" | "),` |
`)}return Be.replaceSelection(Ur+`
`),Be.focus();default:throw new Error}},[Be,Jt]),qn=Object(g.useMemo)(function(){switch(Jt){case Me:return T.a.createElement(oe,{callback:Sn,onCancel:Kr});case qe:return T.a.createElement(de.b,{callback:Sn,onCancel:Kr});case Le:return T.a.createElement(ne,{callback:Sn,onCancel:Kr});case Ze:return T.a.createElement(Ie,{callback:Sn,onCancel:Kr});default:return null}},[Jt]);function Kr(){Wr("")}Object(g.useEffect)(function(){if(Br.current){var it=Br.current,ct=!1,lt=0;function pt(vt){ct=!0,lt=vt.pageY}function bt(){ct=!1}function Dt(vt){if(ct){var Ut=vt.pageY-lt;Ut<0&&(Ut=0),Ut>300&&(Ut=300);var $t=ht+Ut+"px";bn($t)}}return it.addEventListener("mousedown",pt),document.addEventListener("mousemove",Dt),document.addEventListener("mouseup",bt),function(){it.removeEventListener("mousedown",pt),document.removeEventListener("mousemove",Dt),document.removeEventListener("mouseup",bt)}}},[Be,Br]),Object(g.useEffect)(function(){bn(ht)},[ht]);var Dr=le(rt),$n=le(Ii),xr={width:Dr,height:$n},ei=Object(g.useMemo)(function(){if(br){var it=new Date(br),ct=it.getHours(),lt=it.getMinutes(),pt=it.getSeconds();return ct=ct<10?"0"+ct:ct,lt=lt<10?"0"+lt:lt,pt=pt<10?"0"+pt:pt,"".concat(ct,":").concat(lt,":").concat(pt)}return 0},[br]);function _i(){window.sessionStorage.removeItem(pr),xn(!1),Zn(0)}function rn(){xn(!1),Zn(0),Be.setValue(window.sessionStorage.getItem(pr))}function ua(it,ct){var lt=Be.getValue();lt=lt.replace(it,ct),vr(lt),Be==null||Be.setValue(lt)}return T.a.createElement(g.Fragment,null,T.a.createElement("div",{className:"markdown-editor-wrapper",ref:_r},T.a.createElement("div",{className:"markdown-editor-container ".concat(ke," ").concat(yr?"on-preview":""," ").concat(Ct?"mini":""," ").concat(Er?"full-screen":""),style:xr},T.a.createElement(b,{insertTemp:Et,watch:yr,fullScreen:Er,showNullButton:Ot,onActionCallback:ki,hidetoolBar:Mr,uuid:en.current,setOpenPhones:function(){tn.current=!0}}),T.a.createElement("div",{className:"markdown-editor-body"},T.a.createElement("div",{className:"codemirror-container"},T.a.createElement("textarea",{ref:kr,placeholder:vn})),yr?T.a.createElement("div",{ref:Tn,className:"preview-container"},Or==="stex"&&T.a.createElement(w,{value:qr}),Or!=="stex"&&T.a.createElement(h.a,{edit:!0,value:qr,replaces:ua})):null))),ia?T.a.createElement("a",{ref:Br,className:"editor-resize"}):null,T.a.createElement(O.a,null,Z[Jt]?T.a.createElement(G.a,{centered:!0,title:Z[Jt],visible:!0,onCancel:Kr,footer:null,className:"markdown-popup-form"},qn):null))}},RMFE:function(we,Ae){we.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAWgAAAFyCAYAAADYqEAoAAAAAXNSR0IArs4c6QAADetJREFUeAHt1jFqXUEQRUHLaP9b/jZObmYU9MAJSlGDxNBUPw76+vz9+eWHAAECBHICv3MbWYgAAQIE/gkItA+BAAECUQGBjh7GWgQIEBBo3wABAgSiAgIdPYy1CBAgINC+AQIECEQFBDp6GGsRIEBAoH0DBAgQiAoIdPQw1iJAgIBA+wYIECAQFRDo6GGsRYAAAYH2DRAgQCAqINDRw1iLAAECAu0bIECAQFRAoKOHsRYBAgQE2jdAgACBqIBARw9jLQIECAi0b4AAAQJRAYGOHsZaBAgQEGjfAAECBKICAh09jLUIECAg0L4BAgQIRAUEOnoYaxEgQECgfQMECBCICgh09DDWIkCAgED7BggQIBAVEOjoYaxFgAABgfYNECBAICog0NHDWIsAAQIC7RsgQIBAVECgo4exFgECBATaN0CAAIGogEBHD2MtAgQICLRvgAABAlEBgY4exloECBAQaN8AAQIEogICHT2MtQgQICDQvgECBAhEBQQ6ehhrESBAQKB9AwQIEIgKCHT0MNYiQICAQPsGCBAgEBUQ6OhhrEWAAAGB9g0QIEAgKiDQ0cNYiwABAgLtGyBAgEBUQKCjh7EWAQIEBNo3QIAAgaiAQEcPYy0CBAh8/5Tg6+vrp3/q7wgQIEDgPwKfz+c/v92v/Ac9CxMBAgRSAgKdOodlCBAgMAGBnoWJAAECKQGBTp3DMgQIEJiAQM/CRIAAgZSAQKfOYRkCBAhMQKBnYSJAgEBKQKBT57AMAQIEJiDQszARIEAgJSDQqXNYhgABAhMQ6FmYCBAgkBIQ6NQ5LEOAAIEJCPQsTAQIEEgJCHTqHJYhQIDABAR6FiYCBAikBAQ6dQ7LECBAYAICPQsTAQIEUgICnTqHZQgQIDABgZ6FiQABAikBgU6dwzIECBCYgEDPwkSAAIGUgECnzmEZAgQITECgZ2EiQIBASkCgU+ewDAECBCYg0LMwESBAICUg0KlzW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AgL9QtWbBAgQOBAQ6ANETxAgQOCFgEC/UPUmAQIEDgQE+gDREwQIEHghINAvVL1JgACBAwGBPkD0BAECBF4ICPQLVW8SIEDgQECgDxA9QYAAgRcCAv1C1ZsECBA4EBDoA0RPECBA4IWAQL9Q9SYBAgQOBAT6ANETBAgQeCEg0C9UvUmAAIEDAYE+QPQEAQIEXggI9AtVbxIgQOBAQKAPED1BgACBFwIC/ULVmwQIEDgQEOgDRE8QIEDghYBAv1D1JgECBA4EBPoA0RMECBB4ISDQL1S9SYAAgQMBgT5A9AQBAgReCAj0C1VvEiBA4EBAoA8QPUGAAIEXAgL9QtWbBAgQOBAQ6ANETxAgQOCFgEC/UPUmAQIEDgQE+gDREwQIEHghINAvVL1JgACBAwGBPkD0BAECBF4ICPQLVW8SIEDgQECgDxA9QYAAgRcCAv1C1ZsECBA4EBDoA0RPECBA4IXAH7PYDOHnuk1pAAAAAElFTkSuQmCC"},SJMd:function(we,Ae){/**
* @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 Q,q,G,D=!1,K,P;window.PR_SHOULD_USE_CONTINUATION=!0;var M,U;(function(){var B=window,I=["break,continue,do,else,for,if,return,while"],R=[I,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],g=[R,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],T=[g,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],L=[g,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],C=[g,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],S="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",A=[g,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],d="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",o=[I,"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"],l=[I,"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"],u=[I,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],y=[T,C,L,A,d,o,l,u],m=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,h="str",w="kwd",E="com",f="typ",c="lit",s="pun",a="pln",v="tag",p="dec",b="src",O="atn",N="atv",W="nocode",V="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function F(xe){for(var Se=0,Ie=!1,Fe=!1,He=0,Me=xe.length;He<Me;++He){var Le=xe[He];if(Le.ignoreCase)Fe=!0;else if(/[a-z]/i.test(Le.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Ie=!0,Fe=!1;break}}var qe={b:8,t:9,n:10,v:11,f:12,r:13};function Ze(Ye){var ye=Ye.charCodeAt(0);if(ye!==92)return ye;var $e=Ye.charAt(1);return ye=qe[$e],ye||("0"<=$e&&$e<="7"?parseInt(Ye.substring(1),8):$e==="u"||$e==="x"?parseInt(Ye.substring(2),16):Ye.charCodeAt(1))}function ze(Ye){if(Ye<32)return(Ye<16?"\\x0":"\\x")+Ye.toString(16);var ye=String.fromCharCode(Ye);return ye==="\\"||ye==="-"||ye==="]"||ye==="^"?"\\"+ye:ye}function Ge(Ye){var ye=Ye.substring(1,Ye.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")),$e=[],Ve=ye[0]==="^",be=["["];Ve&&be.push("^");for(var Pe=Ve?1:0,le=ye.length;Pe<le;++Pe){var ie=ye[Pe];if(/\\[bdsw]/i.test(ie))be.push(ie);else{var ae=Ze(ie),Y;Pe+2<le&&ye[Pe+1]==="-"?(Y=Ze(ye[Pe+2]),Pe+=2):Y=ae,$e.push([ae,Y]),Y<65||ae>122||(Y<65||ae>90||$e.push([Math.max(65,ae)|32,Math.min(Y,90)|32]),Y<97||ae>122||$e.push([Math.max(97,ae)&~32,Math.min(Y,122)&~32]))}}$e.sort(function(se,ve){return se[0]-ve[0]||ve[1]-se[1]});for(var X=[],Z=[],Pe=0;Pe<$e.length;++Pe){var te=$e[Pe];te[0]<=Z[1]+1?Z[1]=Math.max(Z[1],te[1]):X.push(Z=te)}for(var Pe=0;Pe<X.length;++Pe){var te=X[Pe];be.push(ze(te[0])),te[1]>te[0]&&(te[1]+1>te[0]&&be.push("-"),be.push(ze(te[1])))}return be.push("]"),be.join("")}function tt(Ye){for(var ye=Ye.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")),$e=ye.length,Ve=[],be=0,Pe=0;be<$e;++be){var le=ye[be];if(le==="(")++Pe;else if(le.charAt(0)==="\\"){var ie=+le.substring(1);ie&&(ie<=Pe?Ve[ie]=-1:ye[be]=ze(ie))}}for(var be=1;be<Ve.length;++be)Ve[be]===-1&&(Ve[be]=++Se);for(var be=0,Pe=0;be<$e;++be){var le=ye[be];if(le==="(")++Pe,Ve[Pe]||(ye[be]="(?:");else if(le.charAt(0)==="\\"){var ie=+le.substring(1);ie&&ie<=Pe&&(ye[be]="\\"+Ve[ie])}}for(var be=0;be<$e;++be)ye[be]==="^"&&ye[be+1]!=="^"&&(ye[be]="");if(Ye.ignoreCase&&Ie)for(var be=0;be<$e;++be){var le=ye[be],ae=le.charAt(0);le.length>=2&&ae==="["?ye[be]=Ge(le):ae!=="\\"&&(ye[be]=le.replace(/[a-zA-Z]/g,function(Z){var te=Z.charCodeAt(0);return"["+String.fromCharCode(te&~32,te|32)+"]"}))}return ye.join("")}for(var Xe=[],He=0,Me=xe.length;He<Me;++He){var Le=xe[He];if(Le.global||Le.multiline)throw new Error(""+Le);Xe.push("(?:"+tt(Le)+")")}return new RegExp(Xe.join("|"),Fe?"gi":"g")}function _(xe,Se){var Ie=/(?:^|\s)nocode(?:\s|$)/,Fe=[],He=0,Me=[],Le=0;function qe(Ze){var ze=Ze.nodeType;if(ze==1){if(Ie.test(Ze.className))return;for(var Ge=Ze.firstChild;Ge;Ge=Ge.nextSibling)qe(Ge);var tt=Ze.nodeName.toLowerCase();(tt==="br"||tt==="li")&&(Fe[Le]=`
`,Me[Le<<1]=He++,Me[Le++<<1|1]=Ze)}else if(ze==3||ze==4){var Xe=Ze.nodeValue;Xe.length&&(Se?Xe=Xe.replace(/\r\n?/g,`
`):Xe=Xe.replace(/[ \t\r\n]+/g," "),Fe[Le]=Xe,Me[Le<<1]=He,He+=Xe.length,Me[Le++<<1|1]=Ze)}}return qe(xe),{sourceCode:Fe.join("").replace(/\n$/,""),spans:Me}}function J(xe,Se,Ie,Fe,He){if(!Ie)return;var Me={sourceNode:xe,pre:1,langExtension:null,numberLines:null,sourceCode:Ie,spans:null,basePos:Se,decorations:null};Fe(Me),He.push.apply(He,Me.decorations)}var ee=/\S/;function oe(xe){for(var Se=void 0,Ie=xe.firstChild;Ie;Ie=Ie.nextSibling){var Fe=Ie.nodeType;Se=Fe===1?Se?xe:Ie:Fe===3&&ee.test(Ie.nodeValue)?xe:Se}return Se===xe?void 0:Se}function de(xe,Se){var Ie={},Fe;(function(){for(var Le=xe.concat(Se),qe=[],Ze={},ze=0,Ge=Le.length;ze<Ge;++ze){var tt=Le[ze],Xe=tt[3];if(Xe)for(var Ye=Xe.length;--Ye>=0;)Ie[Xe.charAt(Ye)]=tt;var ye=tt[1],$e=""+ye;Ze.hasOwnProperty($e)||(qe.push(ye),Ze[$e]=null)}qe.push(/[\0-\uffff]/),Fe=F(qe)})();var He=Se.length,Me=function(Le){for(var qe=Le.sourceCode,Ze=Le.basePos,ze=Le.sourceNode,Ge=[Ze,a],tt=0,Xe=qe.match(Fe)||[],Ye={},ye=0,$e=Xe.length;ye<$e;++ye){var Ve=Xe[ye],be=Ye[Ve],Pe=void 0,le;if(typeof be=="string")le=!1;else{var ie=Ie[Ve.charAt(0)];if(ie)Pe=Ve.match(ie[1]),be=ie[0];else{for(var ae=0;ae<He;++ae)if(ie=Se[ae],Pe=Ve.match(ie[1]),Pe){be=ie[0];break}Pe||(be=a)}le=be.length>=5&&be.substring(0,5)==="lang-",le&&!(Pe&&typeof Pe[1]=="string")&&(le=!1,be=b),le||(Ye[Ve]=be)}var Y=tt;if(tt+=Ve.length,!le)Ge.push(Ze+Y,be);else{var X=Pe[1],Z=Ve.indexOf(X),te=Z+X.length;Pe[2]&&(te=Ve.length-Pe[2].length,Z=te-X.length);var se=be.substring(5);J(ze,Ze+Y,Ve.substring(0,Z),Me,Ge),J(ze,Ze+Y+Z,X,ue(se,X),Ge),J(ze,Ze+Y+te,Ve.substring(te),Me,Ge)}}Le.decorations=Ge};return Me}function Ce(xe){var Se=[],Ie=[];xe.tripleQuotedStrings?Se.push([h,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):xe.multiLineStrings?Se.push([h,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Se.push([h,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),xe.verbatimStrings&&Ie.push([h,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Fe=xe.hashComments;Fe&&(xe.cStyleComments?(Fe>1?Se.push([E,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Se.push([E,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Ie.push([h,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Se.push([E,/^#[^\r\n]*/,null,"#"])),xe.cStyleComments&&(Ie.push([E,/^\/\/[^\r\n]*/,null]),Ie.push([E,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var He=xe.regexLiterals;if(He){var Me=He>1?"":`
\r`,Le=Me?".":"[\\S\\s]",qe="/(?=[^/*"+Me+"])(?:[^/\\x5B\\x5C"+Me+"]|\\x5C"+Le+"|\\x5B(?:[^\\x5C\\x5D"+Me+"]|\\x5C"+Le+")*(?:\\x5D|$))+/";Ie.push(["lang-regex",RegExp("^"+V+"("+qe+")")])}var Ze=xe.types;Ze&&Ie.push([f,Ze]);var ze=(""+xe.keywords).replace(/^ | $/g,"");ze.length&&Ie.push([w,new RegExp("^(?:"+ze.replace(/[\s,]+/g,"|")+")\\b"),null]),Se.push([a,/^\s+/,null,` \r
\xA0`]);var Ge="^.[^\\s\\w.$@'\"`/\\\\]*";return xe.regexLiterals&&(Ge+="(?!s*/)"),Ie.push([c,/^@[a-z_$][a-z_$@0-9]*/i,null],[f,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[a,/^[a-z_$][a-z_$@0-9]*/i,null],[c,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[a,/^\\[\s\S]?/,null],[s,new RegExp(Ge),null]),de(Se,Ie)}var ge=Ce({keywords:y,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function pe(xe,Se,Ie){for(var Fe=/(?:^|\s)nocode(?:\s|$)/,He=/\r\n?|\n/,Me=xe.ownerDocument,Le=Me.createElement("li");xe.firstChild;)Le.appendChild(xe.firstChild);var qe=[Le];function Ze(ye){var $e=ye.nodeType;if($e==1&&!Fe.test(ye.className))if(ye.nodeName==="br")ze(ye),ye.parentNode&&ye.parentNode.removeChild(ye);else for(var Ve=ye.firstChild;Ve;Ve=Ve.nextSibling)Ze(Ve);else if(($e==3||$e==4)&&Ie){var be=ye.nodeValue,Pe=be.match(He);if(Pe){var le=be.substring(0,Pe.index);ye.nodeValue=le;var ie=be.substring(Pe.index+Pe[0].length);if(ie){var ae=ye.parentNode;ae.insertBefore(Me.createTextNode(ie),ye.nextSibling)}ze(ye),le||ye.parentNode.removeChild(ye)}}}function ze(ye){for(;!ye.nextSibling;)if(ye=ye.parentNode,!ye)return;function $e(Pe,le){var ie=le?Pe.cloneNode(!1):Pe,ae=Pe.parentNode;if(ae){var Y=$e(ae,1),X=Pe.nextSibling;Y.appendChild(ie);for(var Z=X;Z;Z=X)X=Z.nextSibling,Y.appendChild(Z)}return ie}for(var Ve=$e(ye.nextSibling,0),be;(be=Ve.parentNode)&&be.nodeType===1;)Ve=be;qe.push(Ve)}for(var Ge=0;Ge<qe.length;++Ge)Ze(qe[Ge]);Se===(Se|0)&&qe[0].setAttribute("value",Se);var tt=Me.createElement("ol");tt.className="linenums";for(var Xe=Math.max(0,Se-1|0)||0,Ge=0,Ye=qe.length;Ge<Ye;++Ge)Le=qe[Ge],Le.className="L"+(Ge+Xe)%10,Le.firstChild||Le.appendChild(Me.createTextNode("\xA0")),tt.appendChild(Le);xe.appendChild(tt)}function ce(xe){var Se=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Se=Se&&+Se[1]<=8;var Ie=/\n/g,Fe=xe.sourceCode,He=Fe.length,Me=0,Le=xe.spans,qe=Le.length,Ze=0,ze=xe.decorations,Ge=ze.length,tt=0;ze[Ge]=He;var Xe,Ye;for(Ye=Xe=0;Ye<Ge;)ze[Ye]!==ze[Ye+2]?(ze[Xe++]=ze[Ye++],ze[Xe++]=ze[Ye++]):Ye+=2;for(Ge=Xe,Ye=Xe=0;Ye<Ge;){for(var ye=ze[Ye],$e=ze[Ye+1],Ve=Ye+2;Ve+2<=Ge&&ze[Ve+1]===$e;)Ve+=2;ze[Xe++]=ye,ze[Xe++]=$e,Ye=Ve}Ge=ze.length=Xe;var be=xe.sourceNode,Pe="";be&&(Pe=be.style.display,be.style.display="none");try{for(var le=null;Ze<qe;){var ie=Le[Ze],ae=Le[Ze+2]||He,Y=ze[tt+2]||He,Ve=Math.min(ae,Y),X=Le[Ze+1],Z;if(X.nodeType!==1&&(Z=Fe.substring(Me,Ve))){Se&&(Z=Z.replace(Ie,"\r")),X.nodeValue=Z;var te=X.ownerDocument,se=te.createElement("span");se.className=ze[tt+1];var ve=X.parentNode;ve.replaceChild(se,X),se.appendChild(X),Me<ae&&(Le[Ze+1]=X=te.createTextNode(Fe.substring(Ve,ae)),ve.insertBefore(X,se.nextSibling))}Me=Ve,Me>=ae&&(Ze+=2),Me>=Y&&(tt+=2)}}finally{be&&(be.style.display=Pe)}}var he={};function ne(xe,Se){for(var Ie=Se.length;--Ie>=0;){var Fe=Se[Ie];he.hasOwnProperty(Fe)?B.console&&console.warn("cannot override language handler %s",Fe):he[Fe]=xe}}function ue(xe,Se){return xe&&he.hasOwnProperty(xe)||(xe=/^\s*</.test(Se)?"default-markup":"default-code"),he[xe]}ne(ge,["default-code"]),ne(de([],[[a,/^[^<?]+/],[p,/^<!\w[^>]*(?:>|$)/],[E,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[s,/^(?:<[%?]|[%?]>)/],["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"]),ne(de([[a,/^[\s]+/,null,` \r
`],[N,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[v,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[O,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[s,/^[=<>\/]+/],["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"]),ne(de([],[[N,/^[\s\S]+/]]),["uq.val"]),ne(Ce({keywords:T,hashComments:!0,cStyleComments:!0,types:m}),["c","cc","cpp","cxx","cyc","m"]),ne(Ce({keywords:"null,true,false"}),["json"]),ne(Ce({keywords:C,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:m}),["cs"]),ne(Ce({keywords:L,cStyleComments:!0}),["java"]),ne(Ce({keywords:u,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),ne(Ce({keywords:o,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),ne(Ce({keywords:d,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),ne(Ce({keywords:l,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),ne(Ce({keywords:A,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),ne(Ce({keywords:S,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),ne(de([],[[h,/^[\s\S]+/]]),["regex"]);function Ee(xe){var Se=xe.langExtension;try{var Ie=_(xe.sourceNode,xe.pre),Fe=Ie.sourceCode;xe.sourceCode=Fe,xe.spans=Ie.spans,xe.basePos=0,ue(Se,Fe)(xe),ce(xe)}catch(He){B.console&&console.log(He&&He.stack||He)}}function _e(xe,Se,Ie){var Fe=Ie||!1,He=Se||null,Me=document.createElement("div");Me.innerHTML="<pre>"+xe+"</pre>",Me=Me.firstChild,Fe&&pe(Me,Fe,!0);var Le={langExtension:He,numberLines:Fe,sourceNode:Me,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return Ee(Le),Me.innerHTML}function Oe(xe,Se){var Ie=Se||document.body,Fe=Ie.ownerDocument||document;function He(ie){return Ie.getElementsByTagName(ie)}for(var Me=[He("pre"),He("code"),He("xmp")],Le=[],qe=0;qe<Me.length;++qe)for(var Ze=0,ze=Me[qe].length;Ze<ze;++Ze)Le.push(Me[qe][Ze]);Me=null;var Ge=Date;Ge.now||(Ge={now:function(){return+new Date}});var tt=0,Xe=/\blang(?:uage)?-([\w.]+)(?!\S)/,Ye=/\bprettyprint\b/,ye=/\bprettyprinted\b/,$e=/pre|xmp/i,Ve=/^code$/i,be=/^(?:pre|code|xmp)$/i,Pe={};function le(){for(var ie=B.PR_SHOULD_USE_CONTINUATION?Ge.now()+250:Infinity;tt<Le.length&&Ge.now()<ie;tt++){for(var ae=Le[tt],Y=Pe,X=ae;X=X.previousSibling;){var Z=X.nodeType,te=(Z===7||Z===8)&&X.nodeValue;if(te?!/^\??prettify\b/.test(te):Z!==3||/\S/.test(X.nodeValue))break;if(te){Y={},te.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Bt,Et,Cr){Y[Et]=Cr});break}}var se=ae.className;if((Y!==Pe||Ye.test(se))&&!ye.test(se)){for(var ve=!1,De=ae.parentNode;De;De=De.parentNode){var Qe=De.tagName;if(be.test(Qe)&&De.className&&Ye.test(De.className)){ve=!0;break}}if(!ve){ae.className+=" prettyprinted";var at=Y.lang;if(!at){at=se.match(Xe);var rt;!at&&(rt=oe(ae))&&Ve.test(rt.tagName)&&(at=rt.className.match(Xe)),at&&(at=at[1])}var xt;if($e.test(ae.tagName))xt=1;else{var ht=ae.currentStyle,st=Fe.defaultView,Ct=ht?ht.whiteSpace:st&&st.getComputedStyle?st.getComputedStyle(ae,null).getPropertyValue("white-space"):0;xt=Ct&&Ct.substring(0,3)==="pre"}var yt=Y.linenums;(yt=yt==="true"||+yt)||(yt=se.match(/\blinenums\b(?::(\d+))?/),yt=yt?yt[1]&&yt[1].length?+yt[1]:!0:!1),yt&&pe(ae,yt,xt);var Ft={langExtension:at,sourceNode:ae,numberLines:yt,pre:xt,sourceCode:null,basePos:null,spans:null,decorations:null};Ee(Ft)}}}tt<Le.length?B.setTimeout(le,250):typeof xe=="function"&&xe()}le()}var Ne=B.PR={createSimpleLexer:de,registerLangHandler:ne,sourceDecorator:Ce,PR_ATTRIB_NAME:O,PR_ATTRIB_VALUE:N,PR_COMMENT:E,PR_DECLARATION:p,PR_KEYWORD:w,PR_LITERAL:c,PR_NOCODE:W,PR_PLAIN:a,PR_PUNCTUATION:s,PR_SOURCE:b,PR_STRING:h,PR_TAG:v,PR_TYPE:f,prettyPrintOne:D?B.prettyPrintOne=_e:M=_e,prettyPrint:U=D?B.prettyPrint=Oe:U=Oe},je=B.define;typeof je=="function"&&je.amd&&je("google-code-prettify",[],function(){return Ne})})()},SMhR:function(we,Ae){we.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcYAAAHGCAYAAADuYispAAAAAklEQVR4AewaftIAABHTSURBVO3BQY4cy5IEQdNA3//KNo2/8NU8XzCQyCpSReivSJKk/zmRJEnjRJIkjRNJkjROJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ40SSJI0TSZI0TiRJ0jiRJEnjRJIkjRNJkjROJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ40SSJI0TSZI0TiRJ0jiRJEnjRJIkjRNJkjROJEnSOJEkSeNEkiSNE0mSNH7yMiB/s7a5AWTTNhsgN9pmA2TTNp8MyI22uQHkv7TNDSCbttkAudE2bwJyo22eBGTTNhsgf7O2ecuJJEkaJ5IkaZxIkqRxIkmSxokkSRonkiRpnEiSpPGTD9c2nwzIk9pmA2TTNjeAPAnIpm1uANm0zQbIDSBPAXIDyKZtPhmQG22zAfLN2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bvAnIjbb5VCeSJGmcSJKkcSJJksaJJEkaJ5IkaZxIkqRxIkmSBv2VFwH5m7XNk4Bs2uZJQJ7UNjeA3GibTwXkRttsgNxomw2QG22zAXKjbW4AeVLbbIDcaJsNkCe1zVtOJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ40SSJA36K5Ik6X9OJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ40SSJI0TSZI0TiRJ0jiRJEnjRJIkjRNJkjROJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ40SSJI0TSZI0TiRJ0jiRJEnjRJIkjRNJkjROJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ4/8ATrCgy9kbxW8AAAAASUVORK5CYII="},TGq3:function(we,Ae,Q){we.exports=Q.p+"static/lockclose.365036e8.svg"},UUDw:function(we,Ae,Q){we.exports={buttonFixed:"buttonFixed___2zLVJ",button:"button___-JgFH",buttonWrap:"buttonWrap___aZhhk"}},"VrN/":function(we,Ae,Q){(function(q,G){we.exports=G()})(this,function(){"use strict";var q=navigator.userAgent,G=navigator.platform,D=/gecko\/\d/i.test(q),K=/MSIE \d/.test(q),P=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(q),M=/Edge\/(\d+)/.exec(q),U=K||P||M,B=U&&(K?document.documentMode||6:+(M||P)[1]),I=!M&&/WebKit\//.test(q),R=I&&/Qt\/\d+\.\d+/.test(q),g=!M&&/Chrome\//.test(q),T=/Opera\//.test(q),L=/Apple Computer/.test(navigator.vendor),C=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(q),S=/PhantomJS/.test(q),A=!M&&/AppleWebKit/.test(q)&&/Mobile\/\w+/.test(q),d=/Android/.test(q),o=A||d||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(q),l=A||/Mac/.test(G),u=/\bCrOS\b/.test(q),y=/win/i.test(G),m=T&&q.match(/Version\/(\d*\.\d*)/);m&&(m=Number(m[1])),m&&m>=15&&(T=!1,I=!0);var h=l&&(R||T&&(m==null||m<12.11)),w=D||U&&B>=9;function E(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var f=function(e,t){var n=e.className,r=E(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function c(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function s(e,t){return c(e).appendChild(t)}function a(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),typeof t=="string")i.appendChild(document.createTextNode(t));else if(t)for(var x=0;x<t.length;++x)i.appendChild(t[x]);return i}function v(e,t,n,r){var i=a(e,t,n,r);return i.setAttribute("role","presentation"),i}var p;document.createRange?p=function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:p=function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(i){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};function b(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 O(){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 N(e,t){var n=e.className;E(t).test(n)||(e.className+=(n?" ":"")+t)}function W(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!E(n[r]).test(t)&&(t+=" "+n[r]);return t}var V=function(e){e.select()};A?V=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:U&&(V=function(e){try{e.select()}catch(t){}});function F(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function _(e,t,n){t||(t={});for(var r in e)e.hasOwnProperty(r)&&(n!==!1||!t.hasOwnProperty(r))&&(t[r]=e[r]);return t}function J(e,t,n,r,i){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var x=r||0,k=i||0;;){var j=e.indexOf(" ",x);if(j<0||j>=t)return k+(t-x);k+=j-x,k+=n-k%n,x=j+1}}var ee=function(){this.id=null,this.f=null,this.time=0,this.handler=F(this.onTimeout,this)};ee.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},ee.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=n)};function oe(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}var de=50,Ce={toString:function(){return"CodeMirror.Pass"}},ge={scroll:!1},pe={origin:"*mouse"},ce={origin:"+move"};function he(e,t,n){for(var r=0,i=0;;){var x=e.indexOf(" ",r);x==-1&&(x=e.length);var k=x-r;if(x==e.length||i+k>=t)return r+Math.min(k,t-i);if(i+=x-r,i+=n-i%n,r=x+1,i>=t)return r}}var ne=[""];function ue(e){for(;ne.length<=e;)ne.push(Ee(ne)+" ");return ne[e]}function Ee(e){return e[e.length-1]}function _e(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function Oe(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}function Ne(){}function je(e,t){var n;return Object.create?n=Object.create(e):(Ne.prototype=e,n=new Ne),t&&_(t,n),n}var xe=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Se(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||xe.test(e))}function Ie(e,t){return t?t.source.indexOf("\\w")>-1&&Se(e)?!0:t.test(e):Se(e)}function Fe(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var He=/[\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 Me(e){return e.charCodeAt(0)>=768&&He.test(e)}function Le(e,t,n){for(;(n<0?t>0:t<e.length)&&Me(e.charAt(t));)t+=n;return t}function qe(e,t,n){for(var r=t>n?-1:1;;){if(t==n)return t;var i=(t+n)/2,x=r<0?Math.ceil(i):Math.floor(i);if(x==t)return e(x)?t:n;e(x)?n=x:t=x+r}}function Ze(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,x=0;x<e.length;++x){var k=e[x];(k.from<n&&k.to>t||t==n&&k.to==t)&&(r(Math.max(k.from,t),Math.min(k.to,n),k.level==1?"rtl":"ltr",x),i=!0)}i||r(t,n,"ltr")}var ze=null;function Ge(e,t,n){var r;ze=null;for(var i=0;i<e.length;++i){var x=e[i];if(x.from<t&&x.to>t)return i;x.to==t&&(x.from!=x.to&&n=="before"?r=i:ze=i),x.from==t&&(x.from!=x.to&&n!="before"?r=i:ze=i)}return r!=null?r:ze}var tt=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(z){return z<=247?e.charAt(z):1424<=z&&z<=1524?"R":1536<=z&&z<=1785?t.charAt(z-1536):1774<=z&&z<=2220?"r":8192<=z&&z<=8203?"w":z==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,x=/[LRr]/,k=/[Lb1n]/,j=/[1n]/;function H(z,$,re){this.level=z,this.from=$,this.to=re}return function(z,$){var re=$=="ltr"?"L":"R";if(z.length==0||$=="ltr"&&!r.test(z))return!1;for(var me=z.length,fe=[],Te=0;Te<me;++Te)fe.push(n(z.charCodeAt(Te)));for(var Re=0,Ue=re;Re<me;++Re){var We=fe[Re];We=="m"?fe[Re]=Ue:Ue=We}for(var Je=0,Ke=re;Je<me;++Je){var et=fe[Je];et=="1"&&Ke=="r"?fe[Je]="n":x.test(et)&&(Ke=et,et=="r"&&(fe[Je]="R"))}for(var ut=1,ot=fe[0];ut<me-1;++ut){var mt=fe[ut];mt=="+"&&ot=="1"&&fe[ut+1]=="1"?fe[ut]="1":mt==","&&ot==fe[ut+1]&&(ot=="1"||ot=="n")&&(fe[ut]=ot),ot=mt}for(var Lt=0;Lt<me;++Lt){var Kt=fe[Lt];if(Kt==",")fe[Lt]="N";else if(Kt=="%"){var It=void 0;for(It=Lt+1;It<me&&fe[It]=="%";++It);for(var sr=Lt&&fe[Lt-1]=="!"||It<me&&fe[It]=="1"?"1":"N",nr=Lt;nr<It;++nr)fe[nr]=sr;Lt=It-1}}for(var kt=0,ir=re;kt<me;++kt){var zt=fe[kt];ir=="L"&&zt=="1"?fe[kt]="L":x.test(zt)&&(ir=zt)}for(var Nt=0;Nt<me;++Nt)if(i.test(fe[Nt])){var _t=void 0;for(_t=Nt+1;_t<me&&i.test(fe[_t]);++_t);for(var Mt=(Nt?fe[Nt-1]:re)=="L",ar=(_t<me?fe[_t]:re)=="L",jn=Mt==ar?Mt?"L":"R":re,Xr=Nt;Xr<_t;++Xr)fe[Xr]=jn;Nt=_t-1}for(var Yt=[],Ir,Ht=0;Ht<me;)if(k.test(fe[Ht])){var Va=Ht;for(++Ht;Ht<me&&k.test(fe[Ht]);++Ht);Yt.push(new H(0,Va,Ht))}else{var jr=Ht,fn=Yt.length,hn=$=="rtl"?1:0;for(++Ht;Ht<me&&fe[Ht]!="L";++Ht);for(var Zt=jr;Zt<Ht;)if(j.test(fe[Zt])){jr<Zt&&(Yt.splice(fn,0,new H(1,jr,Zt)),fn+=hn);var Wn=Zt;for(++Zt;Zt<Ht&&j.test(fe[Zt]);++Zt);Yt.splice(fn,0,new H(2,Wn,Zt)),fn+=hn,jr=Zt}else++Zt;jr<Ht&&Yt.splice(fn,0,new H(1,jr,Ht))}return $=="ltr"&&(Yt[0].level==1&&(Ir=z.match(/^\s+/))&&(Yt[0].from=Ir[0].length,Yt.unshift(new H(0,0,Ir[0].length))),Ee(Yt).level==1&&(Ir=z.match(/\s+$/))&&(Ee(Yt).to-=Ir[0].length,Yt.push(new H(0,me-Ir[0].length,me)))),$=="rtl"?Yt.reverse():Yt}}();function Xe(e,t){var n=e.order;return n==null&&(n=e.order=tt(e.text,t)),n}var Ye=[],ye=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||Ye).concat(n)}};function $e(e,t){return e._handlers&&e._handlers[t]||Ye}function Ve(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers,i=r&&r[t];if(i){var x=oe(i,n);x>-1&&(r[t]=i.slice(0,x).concat(i.slice(x+1)))}}}function be(e,t){var n=$e(e,t);if(!n.length)return;for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)}function Pe(e,t,n){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),be(e,n||t.type,e,t),Z(t)||t.codemirrorIgnore}function le(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)oe(n,t[r])==-1&&n.push(t[r])}function ie(e,t){return $e(e,t).length>0}function ae(e){e.prototype.on=function(t,n){ye(this,t,n)},e.prototype.off=function(t,n){Ve(this,t,n)}}function Y(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function X(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Z(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function te(e){Y(e),X(e)}function se(e){return e.target||e.srcElement}function ve(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),l&&e.ctrlKey&&t==1&&(t=3),t}var De=function(){if(U&&B<9)return!1;var e=a("div");return"draggable"in e||"dragDrop"in e}(),Qe;function at(e){if(Qe==null){var t=a("span","\u200B");s(e,a("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Qe=t.offsetWidth<=1&&t.offsetHeight>2&&!(U&&B<8))}var n=Qe?a("span","\u200B"):a("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}var rt;function xt(e){if(rt!=null)return rt;var t=s(e,document.createTextNode("A\u062EA")),n=p(t,0,1).getBoundingClientRect(),r=p(t,1,2).getBoundingClientRect();return c(e),!n||n.left==n.right?!1:rt=r.right-n.right<3}var ht=`
b`.split(/\n/).length!=3?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf(`
`,t);i==-1&&(i=e.length);var x=e.slice(t,e.charAt(i-1)=="\r"?i-1:i),k=x.indexOf("\r");k!=-1?(n.push(x.slice(0,k)),t+=k+1):(n.push(x),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},st=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(n){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Ct=function(){var e=a("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),yt=null;function Ft(e){if(yt!=null)return yt;var t=s(e,a("span","x")),n=t.getBoundingClientRect(),r=p(t,0,1).getBoundingClientRect();return yt=Math.abs(n.left-r.left)>1}var Bt={},Et={};function Cr(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Bt[e]=t}function Or(e,t){Et[e]=t}function lr(e){if(typeof e=="string"&&Et.hasOwnProperty(e))e=Et[e];else if(e&&typeof e.name=="string"&&Et.hasOwnProperty(e.name)){var t=Et[e.name];typeof t=="string"&&(t={name:t}),e=je(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return lr("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return lr("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function pr(e,t){t=lr(t);var n=Bt[t.name];if(!n)return pr(e,"text/plain");var r=n(e,t);if(fr.hasOwnProperty(t.name)){var i=fr[t.name];for(var x in i){if(!i.hasOwnProperty(x))continue;r.hasOwnProperty(x)&&(r["_"+x]=r[x]),r[x]=i[x]}}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var k in t.modeProps)r[k]=t.modeProps[k];return r}var fr={};function ia(e,t){var n=fr.hasOwnProperty(e)?fr[e]:fr[e]={};_(t,n)}function wr(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function Kn(e,t){for(var n;e.innerMode&&!(n=e.innerMode(t),!n||n.mode==e);)t=n.state,e=n.mode;return n||{mode:e,state:t}}function Hn(e,t,n){return e.startState?e.startState(t,n):!0}var Ot=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};Ot.prototype.eol=function(){return this.pos>=this.string.length},Ot.prototype.sol=function(){return this.pos==this.lineStart},Ot.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ot.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Ot.prototype.eat=function(e){var t=this.string.charAt(this.pos),n;if(typeof e=="string"?n=t==e:n=t&&(e.test?e.test(t):e(t)),n)return++this.pos,t},Ot.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Ot.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Ot.prototype.skipToEnd=function(){this.pos=this.string.length},Ot.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ot.prototype.backUp=function(e){this.pos-=e},Ot.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=J(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?J(this.string,this.lineStart,this.tabSize):0)},Ot.prototype.indentation=function(){return J(this.string,null,this.tabSize)-(this.lineStart?J(this.string,this.lineStart,this.tabSize):0)},Ot.prototype.match=function(e,t,n){if(typeof e=="string"){var r=function(k){return n?k.toLowerCase():k},i=this.string.substr(this.pos,e.length);if(r(i)==r(e))return t!==!1&&(this.pos+=e.length),!0}else{var x=this.string.slice(this.pos).match(e);return x&&x.index>0?null:(x&&t!==!1&&(this.pos+=x[0].length),x)}},Ot.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ot.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Ot.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Ot.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function nt(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 n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],x=i.chunkSize();if(t<x){n=i;break}t-=x}return n.lines[t]}function Mr(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,function(x){var k=x.text;i==n.line&&(k=k.slice(0,n.ch)),i==t.line&&(k=k.slice(t.ch)),r.push(k),++i}),r}function mn(e,t,n){var r=[];return e.iter(t,n,function(i){r.push(i.text)}),r}function qt(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function At(e){if(e.parent==null)return null;for(var t=e.parent,n=oe(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;!(r.children[i]==t);++i)n+=r.children[i].chunkSize();return n+t.first}function gr(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],x=i.height;if(t<x){e=i;continue e}t-=x,n+=i.chunkSize()}return n}while(!e.lines);for(var k=0;k<e.lines.length;++k){var j=e.lines[k],H=j.height;if(t<H)break;t-=H}return n+k}function Pr(e,t){return t>=e.first&&t<e.first+e.size}function pn(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function ke(e,t,n){if(n===void 0&&(n=null),!(this instanceof ke))return new ke(e,t,n);this.line=e,this.ch=t,this.sticky=n}function dt(e,t){return e.line-t.line||e.ch-t.ch}function Gn(e,t){return e.sticky==t.sticky&&dt(e,t)==0}function gn(e){return ke(e.line,e.ch)}function vn(e,t){return dt(e,t)<0?t:e}function Zr(e,t){return dt(e,t)<0?e:t}function yn(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function ft(e,t){if(t.line<e.first)return ke(e.first,0);var n=e.first+e.size-1;return t.line>n?ke(n,nt(e,n).text.length):wi(t,nt(e,t.line).text.length)}function wi(e,t){var n=e.ch;return n==null||n>t?ke(e.line,t):n<0?ke(e.line,0):e}function Be(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=ft(e,t[r]);return n}var En=function(e,t){this.state=e,this.lookAhead=t},hr=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};hr.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},hr.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}},hr.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},hr.fromSaved=function(e,t,n){return t instanceof En?new hr(e,wr(e.mode,t.state),n,t.lookAhead):new hr(e,wr(e.mode,t),n)},hr.prototype.save=function(e){var t=e!==!1?wr(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new En(t,this.maxLookAhead):t};function zn(e,t,n,r){var i=[e.state.modeGen],x={};Er(e,t.text,e.doc.mode,n,function(z,$){return i.push(z,$)},x,r);for(var k=n.state,j=function(z){n.baseTokens=i;var $=e.state.overlays[z],re=1,me=0;n.state=!0,Er(e,t.text,$.mode,n,function(fe,Te){for(var Re=re;me<fe;){var Ue=i[re];Ue>fe&&i.splice(re,1,fe,i[re+1],Ue),re+=2,me=Math.min(fe,Ue)}if(!Te)return;if($.opaque)i.splice(Re,re-Re,fe,"overlay "+Te),re=Re+2;else for(;Re<re;Re+=2){var We=i[Re+1];i[Re+1]=(We?We+" ":"")+"overlay "+Te}},x),n.state=k,n.baseTokens=null,n.baseTokenPos=1},H=0;H<e.state.overlays.length;++H)j(H);return{styles:i,classes:x.bgClass||x.textClass?x:null}}function qr(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=vr(e,At(t)),i=t.text.length>e.options.maxHighlightLength&&wr(e.doc.mode,r.state),x=zn(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=x.styles,x.classes?t.styleClasses=x.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function vr(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new hr(r,!0,t);var x=Li(e,t,n),k=x>r.first&&nt(r,x-1).stateAfter,j=k?hr.fromSaved(r,k,x):new hr(r,Hn(r.mode),x);return r.iter(x,t,function(H){Vn(e,H.text,j);var z=j.line;H.stateAfter=z==t-1||z%5==0||z>=i.viewFrom&&z<i.viewTo?j.save():null,j.nextLine()}),n&&(r.modeFrontier=j.line),j}function Vn(e,t,n,r){var i=e.doc.mode,x=new Ot(t,e.options.tabSize,n);for(x.start=x.pos=r||0,t==""&&Qn(i,n.state);!x.eol();)yr(i,x,n.state),x.start=x.pos}function Qn(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var n=Kn(e,t);if(n.mode.blankLine)return n.mode.blankLine(n.state)}function yr(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=Kn(e,n).mode);var x=e.token(t,n);if(t.pos>t.start)return x}throw new Error("Mode "+e.name+" failed to advance stream.")}var Yn=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function Di(e,t,n,r){var i=e.doc,x=i.mode,k;t=ft(i,t);var j=nt(i,t.line),H=vr(e,t.line,n),z=new Ot(j.text,e.options.tabSize,H),$;for(r&&($=[]);(r||z.pos<t.ch)&&!z.eol();)z.start=z.pos,k=yr(x,z,H.state),r&&$.push(new Yn(z,k,wr(i.mode,H.state)));return r?$:new Yn(z,k,H.state)}function Jn(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";t[r]==null?t[r]=n[2]:new RegExp("(?:^|\\s)"+n[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+n[2])}return e}function Er(e,t,n,r,i,x,k){var j=n.flattenSpans;j==null&&(j=e.options.flattenSpans);var H=0,z=null,$=new Ot(t,e.options.tabSize,r),re,me=e.options.addModeClass&&[null];for(t==""&&Jn(Qn(n,r.state),x);!$.eol();){if($.pos>e.options.maxHighlightLength?(j=!1,k&&Vn(e,t,r,$.pos),$.pos=t.length,re=null):re=Jn(yr(n,$,r.state,me),x),me){var fe=me[0].name;fe&&(re="m-"+(re?fe+" "+re:fe))}if(!j||z!=re){for(;H<$.start;)H=Math.min($.start,H+5e3),i(H,z);z=re}$.start=$.pos}for(;H<$.pos;){var Te=Math.min($.pos,H+5e3);i(Te,z),H=Te}}function Li(e,t,n){for(var r,i,x=e.doc,k=n?-1:t-(e.doc.mode.innerMode?1e3:100),j=t;j>k;--j){if(j<=x.first)return x.first;var H=nt(x,j-1),z=H.stateAfter;if(z&&(!n||j+(z instanceof En?z.lookAhead:0)<=x.modeFrontier))return j;var $=J(H.text,null,e.options.tabSize);(i==null||r>$)&&(i=j-1,r=$)}return i}function aa(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var n=e.first,r=t-1;r>n;r--){var i=nt(e,r).stateAfter;if(i&&(!(i instanceof En)||r+i.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}var Xn=!1,Jt=!1;function Wr(){Xn=!0}function oa(){Jt=!0}function $r(e,t,n){this.marker=e,this.from=t,this.to=n}function br(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function Zn(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function sa(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function Ri(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var x=e[i],k=x.marker,j=x.from==null||(k.inclusiveLeft?x.from<=t:x.from<t);if(j||x.from==t&&k.type=="bookmark"&&(!n||!x.marker.insertLeft)){var H=x.to==null||(k.inclusiveRight?x.to>=t:x.to>t);(r||(r=[])).push(new $r(k,x.from,H?null:x.to))}}return r}function Ii(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var x=e[i],k=x.marker,j=x.to==null||(k.inclusiveRight?x.to>=t:x.to>t);if(j||x.from==t&&k.type=="bookmark"&&(!n||x.marker.insertLeft)){var H=x.from==null||(k.inclusiveLeft?x.from<=t:x.from<t);(r||(r=[])).push(new $r(k,H?null:x.from-t,x.to==null?null:x.to-t))}}return r}function bn(e,t){if(t.full)return null;var n=Pr(e,t.from.line)&&nt(e,t.from.line).markedSpans,r=Pr(e,t.to.line)&&nt(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,x=t.to.ch,k=dt(t.from,t.to)==0,j=Ri(n,i,k),H=Ii(r,x,k),z=t.text.length==1,$=Ee(t.text).length+(z?i:0);if(j)for(var re=0;re<j.length;++re){var me=j[re];if(me.to==null){var fe=br(H,me.marker);fe?z&&(me.to=fe.to==null?null:fe.to+$):me.to=i}}if(H)for(var Te=0;Te<H.length;++Te){var Re=H[Te];if(Re.to!=null&&(Re.to+=$),Re.from==null){var Ue=br(j,Re.marker);Ue||(Re.from=$,z&&(j||(j=[])).push(Re))}else Re.from+=$,z&&(j||(j=[])).push(Re)}j&&(j=Oi(j)),H&&H!=j&&(H=Oi(H));var We=[j];if(!z){var Je=t.text.length-2,Ke;if(Je>0&&j)for(var et=0;et<j.length;++et)j[et].to==null&&(Ke||(Ke=[])).push(new $r(j[et].marker,null,null));for(var ut=0;ut<Je;++ut)We.push(Ke);We.push(H)}return We}function Oi(e){for(var t=0;t<e.length;++t){var n=e[t];n.from!=null&&n.from==n.to&&n.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function Mi(e,t,n){var r=null;if(e.iter(t.line,n.line+1,function(fe){if(fe.markedSpans)for(var Te=0;Te<fe.markedSpans.length;++Te){var Re=fe.markedSpans[Te].marker;Re.readOnly&&(!r||oe(r,Re)==-1)&&(r||(r=[])).push(Re)}}),!r)return null;for(var i=[{from:t,to:n}],x=0;x<r.length;++x)for(var k=r[x],j=k.find(0),H=0;H<i.length;++H){var z=i[H];if(dt(z.to,j.from)<0||dt(z.from,j.to)>0)continue;var $=[H,1],re=dt(z.from,j.from),me=dt(z.to,j.to);(re<0||!k.inclusiveLeft&&!re)&&$.push({from:z.from,to:j.from}),(me>0||!k.inclusiveRight&&!me)&&$.push({from:j.to,to:z.to}),i.splice.apply(i,$),H+=$.length-3}return i}function la(e){var t=e.markedSpans;if(!t)return;for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}function xn(e,t){if(!t)return;for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}function en(e){return e.inclusiveLeft?-1:0}function tn(e){return e.inclusiveRight?1:0}function An(e,t){var n=e.lines.length-t.lines.length;if(n!=0)return n;var r=e.find(),i=t.find(),x=dt(r.from,i.from)||en(e)-en(t);if(x)return-x;var k=dt(r.to,i.to)||tn(e)-tn(t);return k||t.id-e.id}function kr(e,t){var n=Jt&&e.markedSpans,r;if(n)for(var i=void 0,x=0;x<n.length;++x)i=n[x],i.marker.collapsed&&(t?i.from:i.to)==null&&(!r||An(r,i.marker)<0)&&(r=i.marker);return r}function _r(e){return kr(e,!0)}function Br(e){return kr(e,!1)}function Tn(e,t){var n=Jt&&e.markedSpans,r;if(n)for(var i=0;i<n.length;++i){var x=n[i];x.marker.collapsed&&(x.from==null||x.from<t)&&(x.to==null||x.to>t)&&(!r||An(r,x.marker)<0)&&(r=x.marker)}return r}function Pi(e,t,n,r,i){var x=nt(e,t),k=Jt&&x.markedSpans;if(k)for(var j=0;j<k.length;++j){var H=k[j];if(!H.marker.collapsed)continue;var z=H.marker.find(0),$=dt(z.from,n)||en(H.marker)-en(i),re=dt(z.to,r)||tn(H.marker)-tn(i);if($>=0&&re<=0||$<=0&&re>=0)continue;if($<=0&&(H.marker.inclusiveRight&&i.inclusiveLeft?dt(z.to,n)>=0:dt(z.to,n)>0)||$>=0&&(H.marker.inclusiveRight&&i.inclusiveLeft?dt(z.from,r)<=0:dt(z.from,r)<0))return!0}}function ur(e){for(var t;t=_r(e);)e=t.find(-1,!0).line;return e}function ki(e){for(var t;t=Br(e);)e=t.find(1,!0).line;return e}function Sn(e){for(var t,n;t=Br(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function qn(e,t){var n=nt(e,t),r=ur(n);return n==r?t:At(r)}function Kr(e,t){if(t>e.lastLine())return t;var n=nt(e,t),r;if(!Dr(e,n))return t;for(;r=Br(n);)n=r.find(1,!0).line;return At(n)+1}function Dr(e,t){var n=Jt&&t.markedSpans;if(n)for(var r=void 0,i=0;i<n.length;++i){if(r=n[i],!r.marker.collapsed)continue;if(r.from==null)return!0;if(r.marker.widgetNode)continue;if(r.from==0&&r.marker.inclusiveLeft&&$n(e,t,r))return!0}}function $n(e,t,n){if(n.to==null){var r=n.marker.find(1,!0);return $n(e,r.line,br(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i=void 0,x=0;x<t.markedSpans.length;++x)if(i=t.markedSpans[x],i.marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(i.to==null||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&$n(e,t,i))return!0}function xr(e){e=ur(e);for(var t=0,n=e.parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var x=n.parent;x;n=x,x=n.parent)for(var k=0;k<x.children.length;++k){var j=x.children[k];if(j==n)break;t+=j.height}return t}function ei(e){if(e.height==0)return 0;for(var t=e.text.length,n,r=e;n=_r(r);){var i=n.find(0,!0);r=i.from.line,t+=i.from.ch-i.to.ch}for(r=e;n=Br(r);){var x=n.find(0,!0);t-=r.text.length-x.from.ch,r=x.to.line,t+=r.text.length-x.to.ch}return t}function _i(e){var t=e.display,n=e.doc;t.maxLine=nt(n,n.first),t.maxLineLength=ei(t.maxLine),t.maxLineChanged=!0,n.iter(function(r){var i=ei(r);i>t.maxLineLength&&(t.maxLineLength=i,t.maxLine=r)})}var rn=function(e,t,n){this.text=e,xn(this,t),this.height=n?n(this):1};rn.prototype.lineNo=function(){return At(this)},ae(rn);function ua(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),la(e),xn(e,n);var i=r?r(e):1;i!=e.height&&qt(e,i)}function it(e){e.parent=null,la(e)}var ct={},lt={};function pt(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?lt:ct;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function bt(e,t){var n=v("span",null,null,I?"padding-right: .1px":null),r={pre:v("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var x=i?t.rest[i-1]:t.line,k=void 0;r.pos=0,r.addToken=vt,xt(e.display.measure)&&(k=Xe(x,e.doc.direction))&&(r.addToken=$t(r.addToken,k)),r.map=[];var j=t!=e.display.externalMeasured&&At(x);Ur(x,r,qr(e,x,j)),x.styleClasses&&(x.styleClasses.bgClass&&(r.bgClass=W(x.styleClasses.bgClass,r.bgClass||"")),x.styleClasses.textClass&&(r.textClass=W(x.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(at(e.display.measure))),i==0?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(I){var H=r.content.lastChild;(/\bcm-tab\b/.test(H.className)||H.querySelector&&H.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return be(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=W(r.pre.className,r.textClass||"")),r}function Dt(e){var t=a("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function vt(e,t,n,r,i,x,k){if(!t)return;var j=e.splitSpaces?Ut(t,e.trailingSpace):t,H=e.cm.state.specialChars,z=!1,$;if(!H.test(t))e.col+=t.length,$=document.createTextNode(j),e.map.push(e.pos,e.pos+t.length,$),U&&B<9&&(z=!0),e.pos+=t.length;else{$=document.createDocumentFragment();for(var re=0;;){H.lastIndex=re;var me=H.exec(t),fe=me?me.index-re:t.length-re;if(fe){var Te=document.createTextNode(j.slice(re,re+fe));U&&B<9?$.appendChild(a("span",[Te])):$.appendChild(Te),e.map.push(e.pos,e.pos+fe,Te),e.col+=fe,e.pos+=fe}if(!me)break;re+=fe+1;var Re=void 0;if(me[0]==" "){var Ue=e.cm.options.tabSize,We=Ue-e.col%Ue;Re=$.appendChild(a("span",ue(We),"cm-tab")),Re.setAttribute("role","presentation"),Re.setAttribute("cm-text"," "),e.col+=We}else me[0]=="\r"||me[0]==`
`?(Re=$.appendChild(a("span",me[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Re.setAttribute("cm-text",me[0]),e.col+=1):(Re=e.cm.options.specialCharPlaceholder(me[0]),Re.setAttribute("cm-text",me[0]),U&&B<9?$.appendChild(a("span",[Re])):$.appendChild(Re),e.col+=1);e.map.push(e.pos,e.pos+1,Re),e.pos++}}if(e.trailingSpace=j.charCodeAt(t.length-1)==32,n||r||i||z||x||k){var Je=n||"";r&&(Je+=r),i&&(Je+=i);var Ke=a("span",[$],Je,x);if(k)for(var et in k)k.hasOwnProperty(et)&&et!="style"&&et!="class"&&Ke.setAttribute(et,k[et]);return e.content.appendChild(Ke)}e.content.appendChild($)}function Ut(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;i<e.length;i++){var x=e.charAt(i);x==" "&&n&&(i==e.length-1||e.charCodeAt(i+1)==32)&&(x="\xA0"),r+=x,n=x==" "}return r}function $t(e,t){return function(n,r,i,x,k,j,H){i=i?i+" cm-force-border":"cm-force-border";for(var z=n.pos,$=z+r.length;;){for(var re=void 0,me=0;me<t.length&&!(re=t[me],re.to>z&&re.from<=z);me++);if(re.to>=$)return e(n,r,i,x,k,j,H);e(n,r.slice(0,re.to-z),i,x,null,j,H),x=null,r=r.slice(re.to-z),z=re.to}}}function gt(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function Ur(e,t,n){var r=e.markedSpans,i=e.text,x=0;if(!r){for(var k=1;k<n.length;k+=2)t.addToken(t,i.slice(x,x=n[k]),pt(n[k+1],t.cm.options));return}for(var j=i.length,H=0,z=1,$="",re,me,fe=0,Te,Re,Ue,We,Je;;){if(fe==H){Te=Re=Ue=me="",Je=null,We=null,fe=Infinity;for(var Ke=[],et=void 0,ut=0;ut<r.length;++ut){var ot=r[ut],mt=ot.marker;if(mt.type=="bookmark"&&ot.from==H&&mt.widgetNode)Ke.push(mt);else if(ot.from<=H&&(ot.to==null||ot.to>H||mt.collapsed&&ot.to==H&&ot.from==H)){if(ot.to!=null&&ot.to!=H&&fe>ot.to&&(fe=ot.to,Re=""),mt.className&&(Te+=" "+mt.className),mt.css&&(me=(me?me+";":"")+mt.css),mt.startStyle&&ot.from==H&&(Ue+=" "+mt.startStyle),mt.endStyle&&ot.to==fe&&(et||(et=[])).push(mt.endStyle,ot.to),mt.title&&((Je||(Je={})).title=mt.title),mt.attributes)for(var Lt in mt.attributes)(Je||(Je={}))[Lt]=mt.attributes[Lt];mt.collapsed&&(!We||An(We.marker,mt)<0)&&(We=ot)}else ot.from>H&&fe>ot.from&&(fe=ot.from)}if(et)for(var Kt=0;Kt<et.length;Kt+=2)et[Kt+1]==fe&&(Re+=" "+et[Kt]);if(!We||We.from==H)for(var It=0;It<Ke.length;++It)gt(t,0,Ke[It]);if(We&&(We.from||0)==H){if(gt(t,(We.to==null?j+1:We.to)-H,We.marker,We.from==null),We.to==null)return;We.to==H&&(We=!1)}}if(H>=j)break;for(var sr=Math.min(j,fe);;){if($){var nr=H+$.length;if(!We){var kt=nr>sr?$.slice(0,sr-H):$;t.addToken(t,kt,re?re+Te:Te,Ue,H+kt.length==fe?Re:"",me,Je)}if(nr>=sr){$=$.slice(sr-H),H=sr;break}H=nr,Ue=""}$=i.slice(x,x=n[z++]),re=pt(n[z++],t.cm.options)}}}function Tt(e,t,n){this.line=t,this.rest=Sn(t),this.size=this.rest?At(Ee(this.rest))-n+1:1,this.node=this.text=null,this.hidden=Dr(e,t)}function er(e,t,n){for(var r=[],i,x=t;x<n;x=i){var k=new Tt(e.doc,nt(e.doc,x),x);i=x+k.size,r.push(k)}return r}var Vt=null;function mr(e){Vt?Vt.ops.push(e):e.ownsGroup=Vt={ops:[e],delayedCallbacks:[]}}function Is(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<t.length)}function Os(e,t){var n=e.ownsGroup;if(!n)return;try{Is(n)}finally{Vt=null,t(n)}}var ti=null;function Gt(e,t){var n=$e(e,t);if(!n.length)return;var r=Array.prototype.slice.call(arguments,2),i;Vt?i=Vt.delayedCallbacks:ti?i=ti:(i=ti=[],setTimeout(Ms,0));for(var x=function(j){i.push(function(){return n[j].apply(null,r)})},k=0;k<n.length;++k)x(k)}function Ms(){var e=ti;ti=null;for(var t=0;t<e.length;++t)e[t]()}function Ya(e,t,n,r){for(var i=0;i<t.changes.length;i++){var x=t.changes[i];x=="text"?ks(e,t):x=="gutter"?Xa(e,t,n,r):x=="class"?da(e,t):x=="widget"&&_s(e,t,r)}t.changes=null}function ri(e){return e.node==e.text&&(e.node=a("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),U&&B<8&&(e.node.style.zIndex=2)),e.node}function Ps(e,t){var n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var r=ri(t);t.background=r.insertBefore(a("div",null,n),r.firstChild),e.display.input.setUneditable(t.background)}}function Ja(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):bt(e,t)}function ks(e,t){var n=t.text.className,r=Ja(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,da(e,t)):n&&(t.text.className=n)}function da(e,t){Ps(e,t),t.line.wrapClass?ri(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var n=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=n||""}function Xa(e,t,n,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=ri(t);t.gutterBackground=a("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var x=t.line.gutterMarkers;if(e.options.lineNumbers||x){var k=ri(t),j=t.gutter=a("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(e.display.input.setUneditable(j),k.insertBefore(j,t.text),t.line.gutterClass&&(j.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!x||!x["CodeMirror-linenumbers"])&&(t.lineNumber=j.appendChild(a("div",pn(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),x)for(var H=0;H<e.display.gutterSpecs.length;++H){var z=e.display.gutterSpecs[H].className,$=x.hasOwnProperty(z)&&x[z];$&&j.appendChild(a("div",[$],"CodeMirror-gutter-elt","left: "+r.gutterLeft[z]+"px; width: "+r.gutterWidth[z]+"px"))}}}function _s(e,t,n){t.alignable&&(t.alignable=null);for(var r=E("CodeMirror-linewidget"),i=t.node.firstChild,x=void 0;i;i=x)x=i.nextSibling,r.test(i.className)&&t.node.removeChild(i);Za(e,t,n)}function Bs(e,t,n,r){var i=Ja(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),da(e,t),Xa(e,t,n,r),Za(e,t,r),t.node}function Za(e,t,n){if(qa(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)qa(e,t.rest[r],t,n,!1)}function qa(e,t,n,r,i){if(!t.widgets)return;for(var x=ri(n),k=0,j=t.widgets;k<j.length;++k){var H=j[k],z=a("div",[H.node],"CodeMirror-linewidget"+(H.className?" "+H.className:""));H.handleMouseEvents||z.setAttribute("cm-ignore-events","true"),Us(H,z,n,r),e.display.input.setUneditable(z),i&&H.above?x.insertBefore(z,n.gutter||n.text):x.appendChild(z),Gt(H,"redraw")}}function Us(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var i=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(i-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function ni(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!b(document.body,e.node)){var n="position: relative;";e.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),s(t.display.measure,a("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function Nr(e,t){for(var n=se(t);n!=e.wrapper;n=n.parentNode)if(!n||n.nodeType==1&&n.getAttribute("cm-ignore-events")=="true"||n.parentNode==e.sizer&&n!=e.mover)return!0}function Bi(e){return e.lineSpace.offsetTop}function ca(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function $a(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=s(e.measure,a("pre","x","CodeMirror-line-like")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return!isNaN(r.left)&&!isNaN(r.right)&&(e.cachedPaddingH=r),r}function Lr(e){return de-e.display.nativeBarWidth}function nn(e){return e.display.scroller.clientWidth-Lr(e)-e.display.barWidth}function fa(e){return e.display.scroller.clientHeight-Lr(e)-e.display.barHeight}function Ns(e,t,n){var r=e.options.lineWrapping,i=r&&nn(e);if(!t.measure.heights||r&&t.measure.width!=i){var x=t.measure.heights=[];if(r){t.measure.width=i;for(var k=t.text.firstChild.getClientRects(),j=0;j<k.length-1;j++){var H=k[j],z=k[j+1];Math.abs(H.bottom-z.bottom)>2&&x.push((H.bottom+z.top)/2-n.top)}}x.push(n.bottom-n.top)}}function eo(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var i=0;i<e.rest.length;i++)if(At(e.rest[i])>n)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Fs(e,t){t=ur(t);var n=At(t),r=e.display.externalMeasured=new Tt(e.doc,t,n);r.lineN=n;var i=r.built=bt(e,r);return r.text=i.pre,s(e.display.lineMeasure,i.pre),r}function to(e,t,n,r){return Rr(e,Cn(e,t),n,r)}function ha(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[sn(e,t)];var n=e.display.externalMeasured;if(n&&t>=n.lineN&&t<n.lineN+n.size)return n}function Cn(e,t){var n=At(t),r=ha(e,n);r&&!r.text?r=null:r&&r.changes&&(Ya(e,r,n,Ea(e)),e.curOp.forceUpdate=!0),r||(r=Fs(e,t));var i=eo(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function Rr(e,t,n,r,i){t.before&&(n=-1);var x=n+(r||""),k;return t.cache.hasOwnProperty(x)?k=t.cache[x]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Ns(e,t.view,t.rect),t.hasHeights=!0),k=Ws(e,t,n,r),k.bogus||(t.cache[x]=k)),{left:k.left,right:k.right,top:i?k.rtop:k.top,bottom:i?k.rbottom:k.bottom}}var ro={left:0,right:0,top:0,bottom:0};function no(e,t,n){for(var r,i,x,k,j,H,z=0;z<e.length;z+=3)if(j=e[z],H=e[z+1],t<j?(i=0,x=1,k="left"):t<H?(i=t-j,x=i+1):(z==e.length-3||t==H&&e[z+3]>t)&&(x=H-j,i=x-1,t>=H&&(k="right")),i!=null){if(r=e[z+2],j==H&&n==(r.insertLeft?"left":"right")&&(k=n),n=="left"&&i==0)for(;z&&e[z-2]==e[z-3]&&e[z-1].insertLeft;)r=e[(z-=3)+2],k="left";if(n=="right"&&i==H-j)for(;z<e.length-3&&e[z+3]==e[z+4]&&!e[z+5].insertLeft;)r=e[(z+=3)+2],k="right";break}return{node:r,start:i,end:x,collapse:k,coverStart:j,coverEnd:H}}function js(e,t){var n=ro;if(t=="left")for(var r=0;r<e.length&&!((n=e[r]).left!=n.right);r++);else for(var i=e.length-1;i>=0&&!((n=e[i]).left!=n.right);i--);return n}function Ws(e,t,n,r){var i=no(t.map,n,r),x=i.node,k=i.start,j=i.end,H=i.collapse,z;if(x.nodeType==3){for(var $=0;$<4;$++){for(;k&&Me(t.line.text.charAt(i.coverStart+k));)--k;for(;i.coverStart+j<i.coverEnd&&Me(t.line.text.charAt(i.coverStart+j));)++j;if(U&&B<9&&k==0&&j==i.coverEnd-i.coverStart?z=x.parentNode.getBoundingClientRect():z=js(p(x,k,j).getClientRects(),r),z.left||z.right||k==0)break;j=k,k=k-1,H="right"}U&&B<11&&(z=Ks(e.display.measure,z))}else{k>0&&(H=r="right");var re;e.options.lineWrapping&&(re=x.getClientRects()).length>1?z=re[r=="right"?re.length-1:0]:z=x.getBoundingClientRect()}if(U&&B<9&&!k&&(!z||!z.left&&!z.right)){var me=x.parentNode.getClientRects()[0];me?z={left:me.left,right:me.left+Dn(e.display),top:me.top,bottom:me.bottom}:z=ro}for(var fe=z.top-t.rect.top,Te=z.bottom-t.rect.top,Re=(fe+Te)/2,Ue=t.view.measure.heights,We=0;We<Ue.length-1&&!(Re<Ue[We]);We++);var Je=We?Ue[We-1]:0,Ke=Ue[We],et={left:(H=="right"?z.right:z.left)-t.rect.left,right:(H=="left"?z.left:z.right)-t.rect.left,top:Je,bottom:Ke};return!z.left&&!z.right&&(et.bogus=!0),e.options.singleCursorHeightPerLine||(et.rtop=fe,et.rbottom=Te),et}function Ks(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Ft(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}function io(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 ao(e){e.display.externalMeasure=null,c(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)io(e.display.view[t])}function ii(e){ao(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function oo(){return g&&d?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function so(){return g&&d?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function ma(e){var t=0;if(e.widgets)for(var n=0;n<e.widgets.length;++n)e.widgets[n].above&&(t+=ni(e.widgets[n]));return t}function Ui(e,t,n,r,i){if(!i){var x=ma(t);n.top+=x,n.bottom+=x}if(r=="line")return n;r||(r="local");var k=xr(t);if(r=="local"?k+=Bi(e.display):k-=e.display.viewOffset,r=="page"||r=="window"){var j=e.display.lineSpace.getBoundingClientRect();k+=j.top+(r=="window"?0:so());var H=j.left+(r=="window"?0:oo());n.left+=H,n.right+=H}return n.top+=k,n.bottom+=k,n}function lo(e,t,n){if(n=="div")return t;var r=t.left,i=t.top;if(n=="page")r-=oo(),i-=so();else if(n=="local"||!n){var x=e.display.sizer.getBoundingClientRect();r+=x.left,i+=x.top}var k=e.display.lineSpace.getBoundingClientRect();return{left:r-k.left,top:i-k.top}}function pa(e,t,n,r,i){return r||(r=nt(e.doc,t.line)),Ui(e,r,to(e,r,t.ch,i),n)}function Ar(e,t,n,r,i,x){r=r||nt(e.doc,t.line),i||(i=Cn(e,r));function k(Te,Re){var Ue=Rr(e,i,Te,Re?"right":"left",x);return Re?Ue.left=Ue.right:Ue.right=Ue.left,Ui(e,r,Ue,n)}var j=Xe(r,e.doc.direction),H=t.ch,z=t.sticky;if(H>=r.text.length?(H=r.text.length,z="before"):H<=0&&(H=0,z="after"),!j)return k(z=="before"?H-1:H,z=="before");function $(Te,Re,Ue){var We=j[Re],Je=We.level==1;return k(Ue?Te-1:Te,Je!=Ue)}var re=Ge(j,H,z),me=ze,fe=$(H,re,z=="before");return me!=null&&(fe.other=$(H,me,z!="before")),fe}function uo(e,t){var n=0;t=ft(e.doc,t),e.options.lineWrapping||(n=Dn(e.display)*t.ch);var r=nt(e.doc,t.line),i=xr(r)+Bi(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function ga(e,t,n,r,i){var x=ke(e,t,n);return x.xRel=i,r&&(x.outside=r),x}function va(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,n<0)return ga(r.first,0,null,-1,-1);var i=gr(r,n),x=r.first+r.size-1;if(i>x)return ga(r.first+r.size-1,nt(r,x).text.length,null,1,1);t<0&&(t=0);for(var k=nt(r,i);;){var j=Hs(e,k,i,t,n),H=Tn(k,j.ch+(j.xRel>0||j.outside>0?1:0));if(!H)return j;var z=H.find(1);if(z.line==i)return z;k=nt(r,i=z.line)}}function co(e,t,n,r){r-=ma(t);var i=t.text.length,x=qe(function(k){return Rr(e,n,k-1).bottom<=r},i,0);return i=qe(function(k){return Rr(e,n,k).top>r},x,i),{begin:x,end:i}}function fo(e,t,n,r){n||(n=Cn(e,t));var i=Ui(e,t,Rr(e,n,r),"line").top;return co(e,t,n,i)}function ya(e,t,n,r){return e.bottom<=n?!1:e.top>n?!0:(r?e.left:e.right)>t}function Hs(e,t,n,r,i){i-=xr(t);var x=Cn(e,t),k=ma(t),j=0,H=t.text.length,z=!0,$=Xe(t,e.doc.direction);if($){var re=(e.options.lineWrapping?zs:Gs)(e,t,n,x,$,r,i);z=re.level!=1,j=z?re.from:re.to-1,H=z?re.to:re.from-1}var me=null,fe=null,Te=qe(function(ut){var ot=Rr(e,x,ut);return ot.top+=k,ot.bottom+=k,ya(ot,r,i,!1)?(ot.top<=i&&ot.left<=r&&(me=ut,fe=ot),!0):!1},j,H),Re,Ue,We=!1;if(fe){var Je=r-fe.left<fe.right-r,Ke=Je==z;Te=me+(Ke?0:1),Ue=Ke?"after":"before",Re=Je?fe.left:fe.right}else{!z&&(Te==H||Te==j)&&Te++,Ue=Te==0?"after":Te==t.text.length?"before":Rr(e,x,Te-(z?1:0)).bottom+k<=i==z?"after":"before";var et=Ar(e,ke(n,Te,Ue),"line",t,x);Re=et.left,We=i<et.top?-1:i>=et.bottom?1:0}return Te=Le(t.text,Te,1),ga(n,Te,Ue,We,r-Re)}function Gs(e,t,n,r,i,x,k){var j=qe(function(re){var me=i[re],fe=me.level!=1;return ya(Ar(e,ke(n,fe?me.to:me.from,fe?"before":"after"),"line",t,r),x,k,!0)},0,i.length-1),H=i[j];if(j>0){var z=H.level!=1,$=Ar(e,ke(n,z?H.from:H.to,z?"after":"before"),"line",t,r);ya($,x,k,!0)&&$.top>k&&(H=i[j-1])}return H}function zs(e,t,n,r,i,x,k){var j=co(e,t,r,k),H=j.begin,z=j.end;/\s/.test(t.text.charAt(z-1))&&z--;for(var $=null,re=null,me=0;me<i.length;me++){var fe=i[me];if(fe.from>=z||fe.to<=H)continue;var Te=fe.level!=1,Re=Rr(e,r,Te?Math.min(z,fe.to)-1:Math.max(H,fe.from)).right,Ue=Re<x?x-Re+1e9:Re-x;(!$||re>Ue)&&($=fe,re=Ue)}return $||($=i[i.length-1]),$.from<H&&($={from:H,to:$.to,level:$.level}),$.to>z&&($={from:$.from,to:z,level:$.level}),$}var an;function wn(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(an==null){an=a("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)an.appendChild(document.createTextNode("x")),an.appendChild(a("br"));an.appendChild(document.createTextNode("x"))}s(e.measure,an);var n=an.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),c(e.measure),n||1}function Dn(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=a("span","xxxxxxxxxx"),n=a("pre",[t],"CodeMirror-line-like");s(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function Ea(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,x=t.gutters.firstChild,k=0;x;x=x.nextSibling,++k){var j=e.display.gutterSpecs[k].className;n[j]=x.offsetLeft+x.clientLeft+i,r[j]=x.clientWidth}return{fixedPos:ba(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function ba(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function ho(e){var t=wn(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/Dn(e.display)-3);return function(i){if(Dr(e.doc,i))return 0;var x=0;if(i.widgets)for(var k=0;k<i.widgets.length;k++)i.widgets[k].height&&(x+=i.widgets[k].height);return n?x+(Math.ceil(i.text.length/r)||1)*t:x+t}}function xa(e){var t=e.doc,n=ho(e);t.iter(function(r){var i=n(r);i!=r.height&&qt(r,i)})}function on(e,t,n,r){var i=e.display;if(!n&&se(t).getAttribute("cm-not-content")=="true")return null;var x,k,j=i.lineSpace.getBoundingClientRect();try{x=t.clientX-j.left,k=t.clientY-j.top}catch(re){return null}var H=va(e,x,k),z;if(r&&H.xRel>0&&(z=nt(e.doc,H.line).text).length==H.ch){var $=J(z,z.length,e.options.tabSize)-z.length;H=ke(H.line,Math.max(0,Math.round((x-$a(e.display).left)/Dn(e.display))-$))}return H}function sn(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var n=e.display.view,r=0;r<n.length;r++)if(t-=n[r].size,t<0)return r}function tr(e,t,n,r){t==null&&(t=e.doc.first),n==null&&(n=e.doc.first+e.doc.size),r||(r=0);var i=e.display;if(r&&n<i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Jt&&qn(e.doc,t)<i.viewTo&&Gr(e);else if(n<=i.viewFrom)Jt&&Kr(e.doc,n+r)>i.viewFrom?Gr(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)Gr(e);else if(t<=i.viewFrom){var x=Ni(e,n,n+r,1);x?(i.view=i.view.slice(x.index),i.viewFrom=x.lineN,i.viewTo+=r):Gr(e)}else if(n>=i.viewTo){var k=Ni(e,t,t,-1);k?(i.view=i.view.slice(0,k.index),i.viewTo=k.lineN):Gr(e)}else{var j=Ni(e,t,t,-1),H=Ni(e,n,n+r,1);j&&H?(i.view=i.view.slice(0,j.index).concat(er(e,j.lineN,H.lineN)).concat(i.view.slice(H.index)),i.viewTo+=r):Gr(e)}var z=i.externalMeasured;z&&(n<z.lineN?z.lineN+=r:t<z.lineN+z.size&&(i.externalMeasured=null))}function Hr(e,t,n){e.curOp.viewChanged=!0;var r=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(r.externalMeasured=null),t<r.viewFrom||t>=r.viewTo)return;var x=r.view[sn(e,t)];if(x.node==null)return;var k=x.changes||(x.changes=[]);oe(k,n)==-1&&k.push(n)}function Gr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Ni(e,t,n,r){var i=sn(e,t),x,k=e.display.view;if(!Jt||n==e.doc.first+e.doc.size)return{index:i,lineN:n};for(var j=e.display.viewFrom,H=0;H<i;H++)j+=k[H].size;if(j!=t){if(r>0){if(i==k.length-1)return null;x=j+k[i].size-t,i++}else x=j-t;t+=x,n+=x}for(;qn(e.doc,n)!=n;){if(i==(r<0?0:k.length-1))return null;n+=r*k[i-(r<0?1:0)].size,i+=r}return{index:i,lineN:n}}function Vs(e,t,n){var r=e.display,i=r.view;i.length==0||t>=r.viewTo||n<=r.viewFrom?(r.view=er(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=er(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(sn(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(er(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,sn(e,n)))),r.viewTo=n}function mo(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var i=t[r];!i.hidden&&(!i.node||i.changes)&&++n}return n}function ai(e){e.display.input.showSelection(e.display.input.prepareSelection())}function po(e,t){t===void 0&&(t=!0);for(var n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),x=r.selection=document.createDocumentFragment(),k=0;k<n.sel.ranges.length;k++){if(!t&&k==n.sel.primIndex)continue;var j=n.sel.ranges[k];if(j.from().line>=e.display.viewTo||j.to().line<e.display.viewFrom)continue;var H=j.empty();(H||e.options.showCursorWhenSelecting)&&go(e,j.head,i),H||Qs(e,j,x)}return r}function go(e,t,n){var r=Ar(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=n.appendChild(a("div","\xA0","CodeMirror-cursor"));if(i.style.left=r.left+"px",i.style.top=r.top+"px",i.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",r.other){var x=n.appendChild(a("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));x.style.display="",x.style.left=r.other.left+"px",x.style.top=r.other.top+"px",x.style.height=(r.other.bottom-r.other.top)*.85+"px"}}function Fi(e,t){return e.top-t.top||e.left-t.left}function Qs(e,t,n){var r=e.display,i=e.doc,x=document.createDocumentFragment(),k=$a(e.display),j=k.left,H=Math.max(r.sizerWidth,nn(e)-r.sizer.offsetLeft)-k.right,z=i.direction=="ltr";function $(Ke,et,ut,ot){et<0&&(et=0),et=Math.round(et),ot=Math.round(ot),x.appendChild(a("div",null,"CodeMirror-selected","position: absolute; left: "+Ke+`px;
top: `+et+"px; width: "+(ut==null?H-Ke:ut)+`px;
height: `+(ot-et)+"px"))}function re(Ke,et,ut){var ot=nt(i,Ke),mt=ot.text.length,Lt,Kt;function It(kt,ir){return pa(e,ke(Ke,kt),"div",ot,ir)}function sr(kt,ir,zt){var Nt=fo(e,ot,null,kt),_t=ir=="ltr"==(zt=="after")?"left":"right",Mt=zt=="after"?Nt.begin:Nt.end-(/\s/.test(ot.text.charAt(Nt.end-1))?2:1);return It(Mt,_t)[_t]}var nr=Xe(ot,i.direction);return Ze(nr,et||0,ut==null?mt:ut,function(kt,ir,zt,Nt){var _t=zt=="ltr",Mt=It(kt,_t?"left":"right"),ar=It(ir-1,_t?"right":"left"),jn=et==null&&kt==0,Xr=ut==null&&ir==mt,Yt=Nt==0,Ir=!nr||Nt==nr.length-1;if(ar.top-Mt.top<=3){var Ht=(z?jn:Xr)&&Yt,Va=(z?Xr:jn)&&Ir,jr=Ht?j:(_t?Mt:ar).left,fn=Va?H:(_t?ar:Mt).right;$(jr,Mt.top,fn-jr,Mt.bottom)}else{var hn,Zt,Wn,Qa;_t?(hn=z&&jn&&Yt?j:Mt.left,Zt=z?H:sr(kt,zt,"before"),Wn=z?j:sr(ir,zt,"after"),Qa=z&&Xr&&Ir?H:ar.right):(hn=z?sr(kt,zt,"before"):j,Zt=!z&&jn&&Yt?H:Mt.right,Wn=!z&&Xr&&Ir?j:ar.left,Qa=z?sr(ir,zt,"after"):H),$(hn,Mt.top,Zt-hn,Mt.bottom),Mt.bottom<ar.top&&$(j,Mt.bottom,null,ar.top),$(Wn,ar.top,Qa-Wn,ar.bottom)}(!Lt||Fi(Mt,Lt)<0)&&(Lt=Mt),Fi(ar,Lt)<0&&(Lt=ar),(!Kt||Fi(Mt,Kt)<0)&&(Kt=Mt),Fi(ar,Kt)<0&&(Kt=ar)}),{start:Lt,end:Kt}}var me=t.from(),fe=t.to();if(me.line==fe.line)re(me.line,me.ch,fe.ch);else{var Te=nt(i,me.line),Re=nt(i,fe.line),Ue=ur(Te)==ur(Re),We=re(me.line,me.ch,Ue?Te.text.length+1:null).end,Je=re(fe.line,Ue?0:null,fe.ch).start;Ue&&(We.top<Je.top-2?($(We.right,We.top,null,We.bottom),$(j,Je.top,Je.left,Je.bottom)):$(We.right,We.top,Je.left-We.right,We.bottom)),We.bottom<Je.top&&$(j,We.bottom,null,Je.top)}n.appendChild(x)}function Aa(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Ln(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function vo(e){e.state.focused||(e.display.input.focus(),Ta(e))}function yo(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Ln(e))},100)}function Ta(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(be(e,"focus",e,t),e.state.focused=!0,N(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),I&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Aa(e)}function Ln(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(be(e,"blur",e,t),e.state.focused=!1,f(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function ji(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r<t.view.length;r++){var i=t.view[r],x=e.options.lineWrapping,k=void 0,j=0;if(i.hidden)continue;if(U&&B<8){var H=i.node.offsetTop+i.node.offsetHeight;k=H-n,n=H}else{var z=i.node.getBoundingClientRect();k=z.bottom-z.top,!x&&i.text.firstChild&&(j=i.text.firstChild.getBoundingClientRect().right-z.left-1)}var $=i.line.height-k;if(($>.005||$<-.005)&&(qt(i.line,k),Eo(i.line),i.rest))for(var re=0;re<i.rest.length;re++)Eo(i.rest[re]);if(j>e.display.sizerWidth){var me=Math.ceil(j/Dn(e.display));me>e.display.maxLineLength&&(e.display.maxLineLength=me,e.display.maxLine=i.line,e.display.maxLineChanged=!0)}}}function Eo(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function Wi(e,t,n){var r=n&&n.top!=null?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-Bi(e));var i=n&&n.bottom!=null?n.bottom:r+e.wrapper.clientHeight,x=gr(t,r),k=gr(t,i);if(n&&n.ensure){var j=n.ensure.from.line,H=n.ensure.to.line;j<x?(x=j,k=gr(t,xr(nt(t,j))+e.wrapper.clientHeight)):Math.min(H,t.lastLine())>=k&&(x=gr(t,xr(nt(t,H))-e.wrapper.clientHeight),k=H)}return{from:x,to:Math.max(k,x+1)}}function Ys(e,t){if(Pe(e,"scrollCursorIntoView"))return;var n=e.display,r=n.sizer.getBoundingClientRect(),i=null;if(t.top+r.top<0?i=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),i!=null&&!S){var x=a("div","\u200B",null,`position: absolute;
top: `+(t.top-n.viewOffset-Bi(e.display))+`px;
height: `+(t.bottom-t.top+Lr(e)+n.barHeight)+`px;
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(x),x.scrollIntoView(i),e.display.lineSpace.removeChild(x)}}function Js(e,t,n,r){r==null&&(r=0);var i;!e.options.lineWrapping&&t==n&&(t=t.ch?ke(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,n=t.sticky=="before"?ke(t.line,t.ch+1,"before"):t);for(var x=0;x<5;x++){var k=!1,j=Ar(e,t),H=!n||n==t?j:Ar(e,n);i={left:Math.min(j.left,H.left),top:Math.min(j.top,H.top)-r,right:Math.max(j.left,H.left),bottom:Math.max(j.bottom,H.bottom)+r};var z=Sa(e,i),$=e.doc.scrollTop,re=e.doc.scrollLeft;if(z.scrollTop!=null&&(si(e,z.scrollTop),Math.abs(e.doc.scrollTop-$)>1&&(k=!0)),z.scrollLeft!=null&&(ln(e,z.scrollLeft),Math.abs(e.doc.scrollLeft-re)>1&&(k=!0)),!k)break}return i}function Xs(e,t){var n=Sa(e,t);n.scrollTop!=null&&si(e,n.scrollTop),n.scrollLeft!=null&&ln(e,n.scrollLeft)}function Sa(e,t){var n=e.display,r=wn(e.display);t.top<0&&(t.top=0);var i=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:n.scroller.scrollTop,x=fa(e),k={};t.bottom-t.top>x&&(t.bottom=t.top+x);var j=e.doc.height+ca(n),H=t.top<r,z=t.bottom>j-r;if(t.top<i)k.scrollTop=H?0:t.top;else if(t.bottom>i+x){var $=Math.min(t.top,(z?j:t.bottom)-x);$!=i&&(k.scrollTop=$)}var re=e.options.fixedGutter?0:n.gutters.offsetWidth,me=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:n.scroller.scrollLeft-re,fe=nn(e)-n.gutters.offsetWidth,Te=t.right-t.left>fe;return Te&&(t.right=t.left+fe),t.left<10?k.scrollLeft=0:t.left<me?k.scrollLeft=Math.max(0,t.left+re-(Te?0:10)):t.right>fe+me-3&&(k.scrollLeft=t.right+(Te?0:10)-fe),k}function Ca(e,t){if(t==null)return;Ki(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function Rn(e){Ki(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function oi(e,t,n){(t!=null||n!=null)&&Ki(e),t!=null&&(e.curOp.scrollLeft=t),n!=null&&(e.curOp.scrollTop=n)}function Zs(e,t){Ki(e),e.curOp.scrollToPos=t}function Ki(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=uo(e,t.from),r=uo(e,t.to);bo(e,n,r,t.margin)}}function bo(e,t,n,r){var i=Sa(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});oi(e,i.scrollLeft,i.scrollTop)}function si(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;D||Da(e,{top:t}),xo(e,t,!0),D&&Da(e),di(e,100)}function xo(e,t,n){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!n)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function ln(e,t,n,r){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)return;e.doc.scrollLeft=t,wo(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function li(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+ca(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?n:0,docHeight:r,scrollHeight:r+Lr(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var un=function(e,t,n){this.cm=n;var r=this.vert=a("div",[a("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=a("div",[a("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),ye(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),ye(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,U&&B<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};un.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var x=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+x)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},un.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},un.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},un.prototype.zeroWidthHack=function(){var e=l&&!C?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new ee,this.disableVert=new ee},un.prototype.enableZeroWidthBar=function(e,t,n){e.style.pointerEvents="auto";function r(){var i=e.getBoundingClientRect(),x=n=="vert"?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1);x!=e?e.style.pointerEvents="none":t.set(1e3,r)}t.set(1e3,r)},un.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var ui=function(){};ui.prototype.update=function(){return{bottom:0,right:0}},ui.prototype.setScrollLeft=function(){},ui.prototype.setScrollTop=function(){},ui.prototype.clear=function(){};function In(e,t){t||(t=li(e));var n=e.display.barWidth,r=e.display.barHeight;Ao(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&ji(e),Ao(e,li(e)),n=e.display.barWidth,r=e.display.barHeight}function Ao(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}var To={native:un,null:ui};function So(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&f(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new To[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),ye(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,n){n=="horizontal"?ln(e,t):si(e,t)},e),e.display.scrollbars.addClass&&N(e.display.wrapper,e.display.scrollbars.addClass)}var qs=0;function dn(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:++qs},mr(e.curOp)}function cn(e){var t=e.curOp;t&&Os(t,function(n){for(var r=0;r<n.ops.length;r++)n.ops[r].cm.curOp=null;$s(n)})}function $s(e){for(var t=e.ops,n=0;n<t.length;n++)el(t[n]);for(var r=0;r<t.length;r++)tl(t[r]);for(var i=0;i<t.length;i++)rl(t[i]);for(var x=0;x<t.length;x++)nl(t[x]);for(var k=0;k<t.length;k++)il(t[k])}function el(e){var t=e.cm,n=t.display;ol(t),e.updateMaxLine&&_i(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Hi(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&wa(e.cm,e.update)}function rl(e){var t=e.cm,n=t.display;e.updatedDisplay&&ji(t),e.barMeasure=li(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=to(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Lr(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-nn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function nl(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&ln(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==O();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&In(t,e.barMeasure),e.updatedDisplay&&Ra(t,e.barMeasure),e.selectionChanged&&Aa(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&vo(e.cm)}function il(e){var t=e.cm,n=t.display,r=t.doc;if(e.updatedDisplay&&Co(t,e.update),n.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(n.wheelStartX=n.wheelStartY=null),e.scrollTop!=null&&xo(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&ln(t,e.scrollLeft,!0,!0),e.scrollToPos){var i=Js(t,ft(r,e.scrollToPos.from),ft(r,e.scrollToPos.to),e.scrollToPos.margin);Ys(t,i)}var x=e.maybeHiddenMarkers,k=e.maybeUnhiddenMarkers;if(x)for(var j=0;j<x.length;++j)x[j].lines.length||be(x[j],"hide");if(k)for(var H=0;H<k.length;++H)k[H].lines.length&&be(k[H],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&be(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function or(e,t){if(e.curOp)return t();dn(e);try{return t()}finally{cn(e)}}function jt(e,t){return function(){if(e.curOp)return t.apply(e,arguments);dn(e);try{return t.apply(e,arguments)}finally{cn(e)}}}function Xt(e){return function(){if(this.curOp)return e.apply(this,arguments);dn(this);try{return e.apply(this,arguments)}finally{cn(this)}}}function Wt(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);dn(t);try{return e.apply(this,arguments)}finally{cn(t)}}}function di(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,F(al,e))}function al(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var n=+new Date+e.options.workTime,r=vr(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(x){if(r.line>=e.display.viewFrom){var k=x.styles,j=x.text.length>e.options.maxHighlightLength?wr(t.mode,r.state):null,H=zn(e,x,r,!0);j&&(r.state=j),x.styles=H.styles;var z=x.styleClasses,$=H.classes;$?x.styleClasses=$:z&&(x.styleClasses=null);for(var re=!k||k.length!=x.styles.length||z!=$&&(!z||!$||z.bgClass!=$.bgClass||z.textClass!=$.textClass),me=0;!re&&me<k.length;++me)re=k[me]!=x.styles[me];re&&i.push(r.line),x.stateAfter=r.save(),r.nextLine()}else x.text.length<=e.options.maxHighlightLength&&Vn(e,x.text,r),x.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return di(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&or(e,function(){for(var x=0;x<i.length;x++)Hr(e,i[x],"text")})}var Hi=function(e,t,n){var r=e.display;this.viewport=t,this.visible=Wi(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=nn(e),this.force=n,this.dims=Ea(e),this.events=[]};Hi.prototype.signal=function(e,t){ie(e,t)&&this.events.push(arguments)},Hi.prototype.finish=function(){for(var e=0;e<this.events.length;e++)be.apply(null,this.events[e])};function ol(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Lr(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Lr(e)+"px",t.scrollbarsClipped=!0)}function sl(e){if(e.hasFocus())return null;var t=O();if(!t||!b(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&b(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}function ll(e){if(!e||!e.activeElt||e.activeElt==O())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&b(document.body,e.anchorNode)&&b(document.body,e.focusNode)){var t=window.getSelection(),n=document.createRange();n.setEnd(e.anchorNode,e.anchorOffset),n.collapse(!1),t.removeAllRanges(),t.addRange(n),t.extend(e.focusNode,e.focusOffset)}}function wa(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return Gr(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&mo(e)==0)return!1;Do(e)&&(Gr(e),t.dims=Ea(e));var i=r.first+r.size,x=Math.max(t.visible.from-e.options.viewportMargin,r.first),k=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFrom<x&&x-n.viewFrom<20&&(x=Math.max(r.first,n.viewFrom)),n.viewTo>k&&n.viewTo-k<20&&(k=Math.min(i,n.viewTo)),Jt&&(x=qn(e.doc,x),k=Kr(e.doc,k));var j=x!=n.viewFrom||k!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;Vs(e,x,k),n.viewOffset=xr(nt(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var H=mo(e);if(!j&&H==0&&!t.force&&n.renderedView==n.view&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo))return!1;var z=sl(e);return H>4&&(n.lineDiv.style.display="none"),ul(e,n.updateLineNumbers,t.dims),H>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,ll(z),c(n.cursorDiv),c(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,j&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,di(e,400)),n.updateLineNumbers=null,!0}function Co(e,t){for(var n=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==nn(e)){if(n&&n.top!=null&&(n={top:Math.min(e.doc.height+ca(e.display)-fa(e),n.top)}),t.visible=Wi(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=Wi(e.display,e.doc,n));if(!wa(e,t))break;ji(e);var i=li(e);ai(e),In(e,i),Ra(e,i),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 Da(e,t){var n=new Hi(e,t);if(wa(e,n)){ji(e),Co(e,n);var r=li(e);ai(e),In(e,r),Ra(e,r),n.finish()}}function ul(e,t,n){var r=e.display,i=e.options.lineNumbers,x=r.lineDiv,k=x.firstChild;function j(Te){var Re=Te.nextSibling;return I&&l&&e.display.currentWheelTarget==Te?Te.style.display="none":Te.parentNode.removeChild(Te),Re}for(var H=r.view,z=r.viewFrom,$=0;$<H.length;$++){var re=H[$];if(!re.hidden)if(!re.node||re.node.parentNode!=x){var me=Bs(e,re,z,n);x.insertBefore(me,k)}else{for(;k!=re.node;)k=j(k);var fe=i&&t!=null&&t<=z&&re.lineNumber;re.changes&&(oe(re.changes,"gutter")>-1&&(fe=!1),Ya(e,re,z,n)),fe&&(c(re.lineNumber),re.lineNumber.appendChild(document.createTextNode(pn(e.options,z)))),k=re.node.nextSibling}z+=re.size}for(;k;)k=j(k)}function La(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Ra(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+Lr(e)+"px"}function wo(e){var t=e.display,n=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var r=ba(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,x=r+"px",k=0;k<n.length;k++)if(!n[k].hidden){e.options.fixedGutter&&(n[k].gutter&&(n[k].gutter.style.left=x),n[k].gutterBackground&&(n[k].gutterBackground.style.left=x));var j=n[k].alignable;if(j)for(var H=0;H<j.length;H++)j[H].style.left=x}e.options.fixedGutter&&(t.gutters.style.left=r+i+"px")}function Do(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=pn(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(a("div",[a("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),x=i.firstChild.offsetWidth,k=i.offsetWidth-x;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(x,r.lineGutter.offsetWidth-k)+1,r.lineNumWidth=r.lineNumInnerWidth+k,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",La(e.display),!0}return!1}function Ia(e,t){for(var n=[],r=!1,i=0;i<e.length;i++){var x=e[i],k=null;if(typeof x!="string"&&(k=x.style,x=x.className),x=="CodeMirror-linenumbers")if(t)r=!0;else continue;n.push({className:x,style:k})}return t&&!r&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function Lo(e){var t=e.gutters,n=e.gutterSpecs;c(t),e.lineGutter=null;for(var r=0;r<n.length;++r){var i=n[r],x=i.className,k=i.style,j=t.appendChild(a("div",null,"CodeMirror-gutter "+x));k&&(j.style.cssText=k),x=="CodeMirror-linenumbers"&&(e.lineGutter=j,j.style.width=(e.lineNumWidth||1)+"px")}t.style.display=n.length?"":"none",La(e)}function ci(e){Lo(e.display),tr(e),wo(e)}function dl(e,t,n,r){var i=this;this.input=n,i.scrollbarFiller=a("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=a("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=v("div",null,"CodeMirror-code"),i.selectionDiv=a("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=a("div",null,"CodeMirror-cursors"),i.measure=a("div",null,"CodeMirror-measure"),i.lineMeasure=a("div",null,"CodeMirror-measure"),i.lineSpace=v("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none");var x=v("div",[i.lineSpace],"CodeMirror-lines");i.mover=a("div",[x],null,"position: relative"),i.sizer=a("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=a("div",null,null,"position: absolute; height: "+de+"px; width: 1px;"),i.gutters=a("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=a("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=a("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),U&&B<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),!I&&!(D&&o)&&(i.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper)),i.viewFrom=i.viewTo=t.first,i.reportedViewFrom=i.reportedViewTo=t.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,i.gutterSpecs=Ia(r.gutters,r.lineNumbers),Lo(i),n.init(i)}var Gi=0,dr=null;U?dr=-.53:D?dr=15:g?dr=-.7:L&&(dr=-1/3);function Ro(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),n==null&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:n==null&&(n=e.wheelDelta),{x:t,y:n}}function cl(e){var t=Ro(e);return t.x*=dr,t.y*=dr,t}function Io(e,t){var n=Ro(t),r=n.x,i=n.y,x=e.display,k=x.scroller,j=k.scrollWidth>k.clientWidth,H=k.scrollHeight>k.clientHeight;if(!(r&&j||i&&H))return;if(i&&l&&I){e:for(var z=t.target,$=x.view;z!=k;z=z.parentNode)for(var re=0;re<$.length;re++)if($[re].node==z){e.display.currentWheelTarget=z;break e}}if(r&&!D&&!T&&dr!=null){i&&H&&si(e,Math.max(0,k.scrollTop+i*dr)),ln(e,Math.max(0,k.scrollLeft+r*dr)),(!i||i&&H)&&Y(t),x.wheelStartX=null;return}if(i&&dr!=null){var me=i*dr,fe=e.doc.scrollTop,Te=fe+x.wrapper.clientHeight;me<0?fe=Math.max(0,fe+me-50):Te=Math.min(e.doc.height,Te+me+50),Da(e,{top:fe,bottom:Te})}Gi<20&&(x.wheelStartX==null?(x.wheelStartX=k.scrollLeft,x.wheelStartY=k.scrollTop,x.wheelDX=r,x.wheelDY=i,setTimeout(function(){if(x.wheelStartX==null)return;var Re=k.scrollLeft-x.wheelStartX,Ue=k.scrollTop-x.wheelStartY,We=Ue&&x.wheelDY&&Ue/x.wheelDY||Re&&x.wheelDX&&Re/x.wheelDX;if(x.wheelStartX=x.wheelStartY=null,!We)return;dr=(dr*Gi+We)/(Gi+1),++Gi},200)):(x.wheelDX+=r,x.wheelDY+=i))}var cr=function(e,t){this.ranges=e,this.primIndex=t};cr.prototype.primary=function(){return this.ranges[this.primIndex]},cr.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 n=this.ranges[t],r=e.ranges[t];if(!Gn(n.anchor,r.anchor)||!Gn(n.head,r.head))return!1}return!0},cr.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new St(gn(this.ranges[t].anchor),gn(this.ranges[t].head));return new cr(e,this.primIndex)},cr.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},cr.prototype.contains=function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(dt(t,r.from())>=0&&dt(e,r.to())<=0)return n}return-1};var St=function(e,t){this.anchor=e,this.head=t};St.prototype.from=function(){return Zr(this.anchor,this.head)},St.prototype.to=function(){return vn(this.anchor,this.head)},St.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Tr(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort(function(me,fe){return dt(me.from(),fe.from())}),n=oe(t,i);for(var x=1;x<t.length;x++){var k=t[x],j=t[x-1],H=dt(j.to(),k.from());if(r&&!k.empty()?H>0:H>=0){var z=Zr(j.from(),k.from()),$=vn(j.to(),k.to()),re=j.empty()?k.from()==k.head:j.from()==j.head;x<=n&&--n,t.splice(--x,2,new St(re?$:z,re?z:$))}}return new cr(t,n)}function zr(e,t){return new cr([new St(e,t||e)],0)}function Vr(e){return e.text?ke(e.from.line+e.text.length-1,Ee(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Oo(e,t){if(dt(e,t.from)<0)return e;if(dt(e,t.to)<=0)return Vr(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=Vr(t).ch-t.to.ch),ke(n,r)}function Oa(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new St(Oo(i.anchor,t),Oo(i.head,t)))}return Tr(e.cm,n,e.sel.primIndex)}function Mo(e,t,n){return e.line==t.line?ke(n.line,e.ch-t.ch+n.ch):ke(n.line+(e.line-t.line),e.ch)}function fl(e,t,n){for(var r=[],i=ke(e.first,0),x=i,k=0;k<t.length;k++){var j=t[k],H=Mo(j.from,i,x),z=Mo(Vr(j),i,x);if(i=j.to,x=z,n=="around"){var $=e.sel.ranges[k],re=dt($.head,$.anchor)<0;r[k]=new St(re?z:H,re?H:z)}else r[k]=new St(H,H)}return new cr(r,e.sel.primIndex)}function Ma(e){e.doc.mode=pr(e.options,e.doc.modeOption),fi(e)}function fi(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,di(e,100),e.state.modeGen++,e.curOp&&tr(e)}function Po(e,t){return t.from.ch==0&&t.to.ch==0&&Ee(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Pa(e,t,n,r){function i(Je){return n?n[Je]:null}function x(Je,Ke,et){ua(Je,Ke,et,r),Gt(Je,"change",Je,t)}function k(Je,Ke){for(var et=[],ut=Je;ut<Ke;++ut)et.push(new rn(z[ut],i(ut),r));return et}var j=t.from,H=t.to,z=t.text,$=nt(e,j.line),re=nt(e,H.line),me=Ee(z),fe=i(z.length-1),Te=H.line-j.line;if(t.full)e.insert(0,k(0,z.length)),e.remove(z.length,e.size-z.length);else if(Po(e,t)){var Re=k(0,z.length-1);x(re,re.text,fe),Te&&e.remove(j.line,Te),Re.length&&e.insert(j.line,Re)}else if($==re)if(z.length==1)x($,$.text.slice(0,j.ch)+me+$.text.slice(H.ch),fe);else{var Ue=k(1,z.length-1);Ue.push(new rn(me+$.text.slice(H.ch),fe,r)),x($,$.text.slice(0,j.ch)+z[0],i(0)),e.insert(j.line+1,Ue)}else if(z.length==1)x($,$.text.slice(0,j.ch)+z[0]+re.text.slice(H.ch),i(0)),e.remove(j.line+1,Te);else{x($,$.text.slice(0,j.ch)+z[0],i(0)),x(re,me+re.text.slice(H.ch),fe);var We=k(1,z.length-1);Te>1&&e.remove(j.line+1,Te-1),e.insert(j.line+1,We)}Gt(e,"change",e,t)}function Qr(e,t,n){function r(i,x,k){if(i.linked)for(var j=0;j<i.linked.length;++j){var H=i.linked[j];if(H.doc==x)continue;var z=k&&H.sharedHist;if(n&&!z)continue;t(H.doc,z),r(H.doc,i,z)}}r(e,null,!0)}function ko(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,xa(e),Ma(e),_o(e),e.options.lineWrapping||_i(e),e.options.mode=t.modeOption,tr(e)}function _o(e){(e.doc.direction=="rtl"?N:f)(e.display.lineDiv,"CodeMirror-rtl")}function hl(e){or(e,function(){_o(e),tr(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 ka(e,t){var n={from:gn(t.from),to:Vr(t),text:Mr(e,t.from,t.to)};return No(e,n,t.from.line,t.to.line+1),Qr(e,function(r){return No(r,n,t.from.line,t.to.line+1)},!0),n}function Bo(e){for(;e.length;){var t=Ee(e);if(t.ranges)e.pop();else break}}function ml(e,t){if(t)return Bo(e.done),Ee(e.done);if(e.done.length&&!Ee(e.done).ranges)return Ee(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),Ee(e.done)}function Uo(e,t,n,r){var i=e.history;i.undone.length=0;var x=+new Date,k,j;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&i.lastModTime>x-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(k=ml(i,i.lastOp==r)))j=Ee(k.changes),dt(t.from,t.to)==0&&dt(t.from,j.to)==0?j.to=Vr(t):k.changes.push(ka(e,t));else{var H=Ee(i.done);for((!H||!H.ranges)&&Vi(e.sel,i.done),k={changes:[ka(e,t)],generation:i.generation},i.done.push(k);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=x,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,j||be(e,"historyAdded")}function pl(e,t,n,r){var i=t.charAt(0);return i=="*"||i=="+"&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,n,r){var i=e.history,x=r&&r.origin;n==i.lastSelOp||x&&i.lastSelOrigin==x&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==x||pl(e,x,Ee(i.done),t))?i.done[i.done.length-1]=t:Vi(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=x,i.lastSelOp=n,r&&r.clearRedo!==!1&&Bo(i.undone)}function Vi(e,t){var n=Ee(t);n&&n.ranges&&n.equals(e)||t.push(e)}function No(e,t,n,r){var i=t["spans_"+e.id],x=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(k){k.markedSpans&&((i||(i=t["spans_"+e.id]={}))[x]=k.markedSpans),++x})}function vl(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function yl(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=[],i=0;i<t.text.length;++i)r.push(vl(n[i]));return r}function Fo(e,t){var n=yl(e,t),r=bn(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var x=n[i],k=r[i];if(x&&k){e:for(var j=0;j<k.length;++j){for(var H=k[j],z=0;z<x.length;++z)if(x[z].marker==H.marker)continue e;x.push(H)}}else k&&(n[i]=k)}return n}function On(e,t,n){for(var r=[],i=0;i<e.length;++i){var x=e[i];if(x.ranges){r.push(n?cr.prototype.deepCopy.call(x):x);continue}var k=x.changes,j=[];r.push({changes:j});for(var H=0;H<k.length;++H){var z=k[H],$=void 0;if(j.push({from:z.from,to:z.to,text:z.text}),t)for(var re in z)($=re.match(/^spans_(\d+)$/))&&(oe(t,Number($[1]))>-1&&(Ee(j)[re]=z[re],delete z[re]))}}return r}function _a(e,t,n,r){if(r){var i=e.anchor;if(n){var x=dt(t,i)<0;x!=dt(n,i)<0?(i=t,t=n):x!=dt(t,n)<0&&(t=n)}return new St(i,t)}else return new St(n||t,t)}function Qi(e,t,n,r,i){i==null&&(i=e.cm&&(e.cm.display.shift||e.extend)),Qt(e,new cr([_a(e.sel.primary(),t,n,i)],0),r)}function jo(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),x=0;x<e.sel.ranges.length;x++)r[x]=_a(e.sel.ranges[x],t[x],null,i);var k=Tr(e.cm,r,e.sel.primIndex);Qt(e,k,n)}function Ba(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,Qt(e,Tr(e.cm,i,e.sel.primIndex),r)}function Wo(e,t,n,r){Qt(e,zr(t,n),r)}function El(e,t,n){var r={ranges:t.ranges,update:function(i){this.ranges=[];for(var x=0;x<i.length;x++)this.ranges[x]=new St(ft(e,i[x].anchor),ft(e,i[x].head))},origin:n&&n.origin};return be(e,"beforeSelectionChange",e,r),e.cm&&be(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?Tr(e.cm,r.ranges,r.ranges.length-1):t}function Ko(e,t,n){var r=e.history.done,i=Ee(r);i&&i.ranges?(r[r.length-1]=t,Yi(e,t,n)):Qt(e,t,n)}function Qt(e,t,n){Yi(e,t,n),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function Yi(e,t,n){(ie(e,"beforeSelectionChange")||e.cm&&ie(e.cm,"beforeSelectionChange"))&&(t=El(e,t,n));var r=n&&n.bias||(dt(t.primary().head,e.sel.primary().head)<0?-1:1);Ho(e,zo(e,t,r,!0)),!(n&&n.scroll===!1)&&e.cm&&Rn(e.cm)}function Ho(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,le(e.cm)),Gt(e,"cursorActivity",e)}function Go(e){Ho(e,zo(e,e.sel,null,!1))}function zo(e,t,n,r){for(var i,x=0;x<t.ranges.length;x++){var k=t.ranges[x],j=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[x],H=Ji(e,k.anchor,j&&j.anchor,n,r),z=Ji(e,k.head,j&&j.head,n,r);(i||H!=k.anchor||z!=k.head)&&(i||(i=t.ranges.slice(0,x)),i[x]=new St(H,z))}return i?Tr(e.cm,i,t.primIndex):t}function Mn(e,t,n,r,i){var x=nt(e,t.line);if(x.markedSpans)for(var k=0;k<x.markedSpans.length;++k){var j=x.markedSpans[k],H=j.marker,z="selectLeft"in H?!H.selectLeft:H.inclusiveLeft,$="selectRight"in H?!H.selectRight:H.inclusiveRight;if((j.from==null||(z?j.from<=t.ch:j.from<t.ch))&&(j.to==null||($?j.to>=t.ch:j.to>t.ch))){if(i&&(be(H,"beforeCursorEnter"),H.explicitlyCleared))if(x.markedSpans){--k;continue}else break;if(!H.atomic)continue;if(n){var re=H.find(r<0?1:-1),me=void 0;if((r<0?$:z)&&(re=Vo(e,re,-r,re&&re.line==t.line?x:null)),re&&re.line==t.line&&(me=dt(re,n))&&(r<0?me<0:me>0))return Mn(e,re,t,r,i)}var fe=H.find(r<0?-1:1);return(r<0?z:$)&&(fe=Vo(e,fe,r,fe.line==t.line?x:null)),fe?Mn(e,fe,t,r,i):null}}return t}function Ji(e,t,n,r,i){var x=r||1,k=Mn(e,t,n,x,i)||!i&&Mn(e,t,n,x,!0)||Mn(e,t,n,-x,i)||!i&&Mn(e,t,n,-x,!0);return k||(e.cantEdit=!0,ke(e.first,0))}function Vo(e,t,n,r){return n<0&&t.ch==0?t.line>e.first?ft(e,ke(t.line-1)):null:n>0&&t.ch==(r||nt(e,t.line)).text.length?t.line<e.first+e.size-1?ke(t.line+1,0):null:new ke(t.line,t.ch+n)}function Qo(e){e.setSelection(ke(e.firstLine(),0),ke(e.lastLine()),ge)}function Yo(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return n&&(r.update=function(i,x,k,j){i&&(r.from=ft(e,i)),x&&(r.to=ft(e,x)),k&&(r.text=k),j!==void 0&&(r.origin=j)}),be(e,"beforeChange",e,r),e.cm&&be(e.cm,"beforeChange",e.cm,r),r.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function Pn(e,t,n){if(e.cm){if(!e.cm.curOp)return jt(e.cm,Pn)(e,t,n);if(e.cm.state.suppressEdits)return}if((ie(e,"beforeChange")||e.cm&&ie(e.cm,"beforeChange"))&&(t=Yo(e,t,!0),!t))return;var r=Xn&&!n&&Mi(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)Jo(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else Jo(e,t)}function Jo(e,t){if(t.text.length==1&&t.text[0]==""&&dt(t.from,t.to)==0)return;var n=Oa(e,t);Uo(e,t,n,e.cm?e.cm.curOp.id:NaN),hi(e,t,n,bn(e,t));var r=[];Qr(e,function(i,x){!x&&oe(r,i.history)==-1&&($o(i.history,t),r.push(i.history)),hi(i,t,null,bn(i,t))})}function Xi(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(r&&!n)return;for(var i=e.history,x,k=e.sel,j=t=="undo"?i.done:i.undone,H=t=="undo"?i.undone:i.done,z=0;z<j.length&&!(x=j[z],n?x.ranges&&!x.equals(e.sel):!x.ranges);z++);if(z==j.length)return;for(i.lastOrigin=i.lastSelOrigin=null;;)if(x=j.pop(),x.ranges){if(Vi(x,H),n&&!x.equals(e.sel)){Qt(e,x,{clearRedo:!1});return}k=x}else if(r){j.push(x);return}else break;var $=[];Vi(k,H),H.push({changes:$,generation:i.generation}),i.generation=x.generation||++i.maxGeneration;for(var re=ie(e,"beforeChange")||e.cm&&ie(e.cm,"beforeChange"),me=function(Re){var Ue=x.changes[Re];if(Ue.origin=t,re&&!Yo(e,Ue,!1))return j.length=0,{};$.push(ka(e,Ue));var We=Re?Oa(e,Ue):Ee(j);hi(e,Ue,We,Fo(e,Ue)),!Re&&e.cm&&e.cm.scrollIntoView({from:Ue.from,to:Vr(Ue)});var Je=[];Qr(e,function(Ke,et){!et&&oe(Je,Ke.history)==-1&&($o(Ke.history,Ue),Je.push(Ke.history)),hi(Ke,Ue,null,Fo(Ke,Ue))})},fe=x.changes.length-1;fe>=0;--fe){var Te=me(fe);if(Te)return Te.v}}function Xo(e,t){if(t==0)return;if(e.first+=t,e.sel=new cr(_e(e.sel.ranges,function(i){return new St(ke(i.anchor.line+t,i.anchor.ch),ke(i.head.line+t,i.head.ch))}),e.sel.primIndex),e.cm){tr(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)Hr(e.cm,r,"gutter")}}function hi(e,t,n,r){if(e.cm&&!e.cm.curOp)return jt(e.cm,hi)(e,t,n,r);if(t.to.line<e.first){Xo(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 i=t.text.length-1-(e.first-t.from.line);Xo(e,i),t={from:ke(e.first,0),to:ke(t.to.line+i,t.to.ch),text:[Ee(t.text)],origin:t.origin}}var x=e.lastLine();t.to.line>x&&(t={from:t.from,to:ke(x,nt(e,x).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Mr(e,t.from,t.to),n||(n=Oa(e,t)),e.cm?bl(e.cm,t,r):Pa(e,t,r),Yi(e,n,ge),e.cantEdit&&Ji(e,ke(e.firstLine(),0))&&(e.cantEdit=!1)}function bl(e,t,n){var r=e.doc,i=e.display,x=t.from,k=t.to,j=!1,H=x.line;e.options.lineWrapping||(H=At(ur(nt(r,x.line))),r.iter(H,k.line+1,function(fe){if(fe==i.maxLine)return j=!0,!0})),r.sel.contains(t.from,t.to)>-1&&le(e),Pa(r,t,n,ho(e)),e.options.lineWrapping||(r.iter(H,x.line+t.text.length,function(fe){var Te=ei(fe);Te>i.maxLineLength&&(i.maxLine=fe,i.maxLineLength=Te,i.maxLineChanged=!0,j=!1)}),j&&(e.curOp.updateMaxLine=!0)),aa(r,x.line),di(e,400);var z=t.text.length-(k.line-x.line)-1;t.full?tr(e):x.line==k.line&&t.text.length==1&&!Po(e.doc,t)?Hr(e,x.line,"text"):tr(e,x.line,k.line+1,z);var $=ie(e,"changes"),re=ie(e,"change");if(re||$){var me={from:x,to:k,text:t.text,removed:t.removed,origin:t.origin};re&&Gt(e,"change",e,me),$&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(me)}e.display.selForContextMenu=null}function kn(e,t,n,r,i){var x;r||(r=n),dt(r,n)<0&&(x=[r,n],n=x[0],r=x[1]),typeof t=="string"&&(t=e.splitLines(t)),Pn(e,{from:n,to:r,text:t,origin:i})}function Zo(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function qo(e,t,n,r){for(var i=0;i<e.length;++i){var x=e[i],k=!0;if(x.ranges){x.copied||(x=e[i]=x.deepCopy(),x.copied=!0);for(var j=0;j<x.ranges.length;j++)Zo(x.ranges[j].anchor,t,n,r),Zo(x.ranges[j].head,t,n,r);continue}for(var H=0;H<x.changes.length;++H){var z=x.changes[H];if(n<z.from.line)z.from=ke(z.from.line+r,z.from.ch),z.to=ke(z.to.line+r,z.to.ch);else if(t<=z.to.line){k=!1;break}}k||(e.splice(0,i+1),i=0)}}function $o(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;qo(e.done,n,r,i),qo(e.undone,n,r,i)}function mi(e,t,n,r){var i=t,x=t;return typeof t=="number"?x=nt(e,yn(e,t)):i=At(t),i==null?null:(r(x,i)&&e.cm&&Hr(e.cm,i,n),x)}function pi(e){this.lines=e,this.parent=null;for(var t=0,n=0;n<e.length;++n)e[n].parent=this,t+=e[n].height;this.height=t}pi.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;n<r;++n){var i=this.lines[n];this.height-=i.height,it(i),Gt(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}};function gi(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var i=e[r];t+=i.chunkSize(),n+=i.height,i.parent=this}this.size=t,this.height=n,this.parent=null}gi.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(e<i){var x=Math.min(t,i-e),k=r.height;if(r.removeInner(e,x),this.height-=k-r.height,i==x&&(this.children.splice(n--,1),r.parent=null),(t-=x)==0)break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof pi))){var j=[];this.collapse(j),this.children=[new pi(j)],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,n){this.size+=t.length,this.height+=n;for(var r=0;r<this.children.length;++r){var i=this.children[r],x=i.chunkSize();if(e<=x){if(i.insertInner(e,t,n),i.lines&&i.lines.length>50){for(var k=i.lines.length%25+25,j=k;j<i.lines.length;){var H=new pi(i.lines.slice(j,j+=25));i.height-=H.height,this.children.splice(++r,0,H),H.parent=this}i.lines=i.lines.slice(0,k),this.maybeSpill()}break}e-=x}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new gi(t);if(e.parent){e.size-=n.size,e.height-=n.height;var i=oe(e.parent.children,e);e.parent.children.splice(i+1,0,n)}else{var r=new gi(e.children);r.parent=e,e.children=[r,n],e=r}n.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],x=i.chunkSize();if(e<x){var k=Math.min(t,x-e);if(i.iterN(e,k,n))return!0;if((t-=k)==0)break;e=0}else e-=x}}};var vi=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};vi.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=At(n);if(r==null||!t)return;for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(n.widgets=null);var x=ni(this);qt(n,Math.max(0,n.height-x)),e&&(or(e,function(){es(e,n,-x),Hr(e,r,"widget")}),Gt(e,"lineWidgetCleared",e,this,r))},vi.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var i=ni(this)-t;if(!i)return;Dr(this.doc,r)||qt(r,r.height+i),n&&or(n,function(){n.curOp.forceUpdate=!0,es(n,r,i),Gt(n,"lineWidgetChanged",n,e,At(r))})},ae(vi);function es(e,t,n){xr(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Ca(e,n)}function xl(e,t,n,r){var i=new vi(e,n,r),x=e.cm;return x&&i.noHScroll&&(x.display.alignWidgets=!0),mi(e,t,"widget",function(k){var j=k.widgets||(k.widgets=[]);if(i.insertAt==null?j.push(i):j.splice(Math.min(j.length-1,Math.max(0,i.insertAt)),0,i),i.line=k,x&&!Dr(e,k)){var H=xr(k)<e.scrollTop;qt(k,k.height+ni(i)),H&&Ca(x,i.height),x.curOp.forceUpdate=!0}return!0}),x&&Gt(x,"lineWidgetAdded",x,i,typeof t=="number"?t:At(t)),i}var ts=0,Yr=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++ts};Yr.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&dn(e),ie(this,"clear")){var n=this.find();n&&Gt(this,"clear",n.from,n.to)}for(var r=null,i=null,x=0;x<this.lines.length;++x){var k=this.lines[x],j=br(k.markedSpans,this);e&&!this.collapsed?Hr(e,At(k),"text"):e&&(j.to!=null&&(i=At(k)),j.from!=null&&(r=At(k))),k.markedSpans=Zn(k.markedSpans,j),j.from==null&&this.collapsed&&!Dr(this.doc,k)&&e&&qt(k,wn(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var H=0;H<this.lines.length;++H){var z=ur(this.lines[H]),$=ei(z);$>e.display.maxLineLength&&(e.display.maxLine=z,e.display.maxLineLength=$,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&tr(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Go(e.doc)),e&&Gt(e,"markerCleared",e,this,r,i),t&&cn(e),this.parent&&this.parent.clear()},Yr.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var n,r,i=0;i<this.lines.length;++i){var x=this.lines[i],k=br(x.markedSpans,this);if(k.from!=null&&(n=ke(t?x:At(x),k.from),e==-1))return n;if(k.to!=null&&(r=ke(t?x:At(x),k.to),e==1))return r}return n&&{from:n,to:r}},Yr.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;if(!t||!r)return;or(r,function(){var i=t.line,x=At(t.line),k=ha(r,x);if(k&&(io(k),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!Dr(n.doc,i)&&n.height!=null){var j=n.height;n.height=null;var H=ni(n)-j;H&&qt(i,i.height+H)}Gt(r,"markerChanged",r,e)})},Yr.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||oe(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Yr.prototype.detachLine=function(e){if(this.lines.splice(oe(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},ae(Yr);function _n(e,t,n,r,i){if(r&&r.shared)return Al(e,t,n,r,i);if(e.cm&&!e.cm.curOp)return jt(e.cm,_n)(e,t,n,r,i);var x=new Yr(e,i),k=dt(t,n);if(r&&_(r,x,!1),k>0||k==0&&x.clearWhenEmpty!==!1)return x;if(x.replacedWith&&(x.collapsed=!0,x.widgetNode=v("span",[x.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||x.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(x.widgetNode.insertLeft=!0)),x.collapsed){if(Pi(e,t.line,t,n,x)||t.line!=n.line&&Pi(e,n.line,t,n,x))throw new Error("Inserting collapsed marker partially overlapping an existing one");oa()}x.addToHistory&&Uo(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var j=t.line,H=e.cm,z;if(e.iter(j,n.line+1,function(re){H&&x.collapsed&&!H.options.lineWrapping&&ur(re)==H.display.maxLine&&(z=!0),x.collapsed&&j!=t.line&&qt(re,0),sa(re,new $r(x,j==t.line?t.ch:null,j==n.line?n.ch:null)),++j}),x.collapsed&&e.iter(t.line,n.line+1,function(re){Dr(e,re)&&qt(re,0)}),x.clearOnEnter&&ye(x,"beforeCursorEnter",function(){return x.clear()}),x.readOnly&&(Wr(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),x.collapsed&&(x.id=++ts,x.atomic=!0),H){if(z&&(H.curOp.updateMaxLine=!0),x.collapsed)tr(H,t.line,n.line+1);else if(x.className||x.startStyle||x.endStyle||x.css||x.attributes||x.title)for(var $=t.line;$<=n.line;$++)Hr(H,$,"text");x.atomic&&Go(H.doc),Gt(H,"markerAdded",H,x)}return x}var yi=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};yi.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Gt(this,"clear")},yi.prototype.find=function(e,t){return this.primary.find(e,t)},ae(yi);function Al(e,t,n,r,i){r=_(r),r.shared=!1;var x=[_n(e,t,n,r,i)],k=x[0],j=r.widgetNode;return Qr(e,function(H){j&&(r.widgetNode=j.cloneNode(!0)),x.push(_n(H,ft(H,t),ft(H,n),r,i));for(var z=0;z<H.linked.length;++z)if(H.linked[z].isParent)return;k=Ee(x)}),new yi(x,k)}function rs(e){return e.findMarks(ke(e.first,0),e.clipPos(ke(e.lastLine())),function(t){return t.parent})}function Tl(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),x=e.clipPos(i.from),k=e.clipPos(i.to);if(dt(x,k)){var j=_n(e,x,k,r.primary,r.primary.type);r.markers.push(j),j.parent=r}}}function Sl(e){for(var t=function(r){var i=e[r],x=[i.primary.doc];Qr(i.primary.doc,function(H){return x.push(H)});for(var k=0;k<i.markers.length;k++){var j=i.markers[k];oe(x,j.doc)==-1&&(j.parent=null,i.markers.splice(k--,1))}},n=0;n<e.length;n++)t(n)}var Cl=0,rr=function(e,t,n,r,i){if(!(this instanceof rr))return new rr(e,t,n,r,i);n==null&&(n=0),gi.call(this,[new pi([new rn("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var x=ke(n,0);this.sel=zr(x),this.history=new zi(null),this.id=++Cl,this.modeOption=t,this.lineSep=r,this.direction=i=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Pa(this,{from:x,to:x,text:e}),Qt(this,zr(x),ge)};rr.prototype=je(gi.prototype,{constructor:rr,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=mn(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:Wt(function(e){var t=ke(this.first,0),n=this.first+this.size-1;Pn(this,{from:t,to:ke(n,nt(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&oi(this.cm,0,0),Qt(this,zr(t),ge)}),replaceRange:function(e,t,n,r){t=ft(this,t),n=n?ft(this,n):t,kn(this,e,t,n,r)},getRange:function(e,t,n){var r=Mr(this,ft(this,e),ft(this,t));return n===!1?r:r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Pr(this,e))return nt(this,e)},getLineNumber:function(e){return At(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=nt(this,e)),ur(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return ft(this,e)},getCursor:function(e){var t=this.sel.primary(),n;return e==null||e=="head"?n=t.head:e=="anchor"?n=t.anchor:e=="end"||e=="to"||e===!1?n=t.to():n=t.from(),n},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Wt(function(e,t,n){Wo(this,ft(this,typeof e=="number"?ke(e,t||0):e),null,n)}),setSelection:Wt(function(e,t,n){Wo(this,ft(this,e),ft(this,t||e),n)}),extendSelection:Wt(function(e,t,n){Qi(this,ft(this,e),t&&ft(this,t),n)}),extendSelections:Wt(function(e,t){jo(this,Be(this,e),t)}),extendSelectionsBy:Wt(function(e,t){var n=_e(this.sel.ranges,e);jo(this,Be(this,n),t)}),setSelections:Wt(function(e,t,n){if(!e.length)return;for(var r=[],i=0;i<e.length;i++)r[i]=new St(ft(this,e[i].anchor),ft(this,e[i].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),Qt(this,Tr(this.cm,r,t),n)}),addSelection:Wt(function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new St(ft(this,e),ft(this,t||e))),Qt(this,Tr(this.cm,r,r.length-1),n)}),getSelection:function(e){for(var t=this.sel.ranges,n,r=0;r<t.length;r++){var i=Mr(this,t[r].from(),t[r].to());n=n?n.concat(i):i}return e===!1?n:n.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=Mr(this,n[r].from(),n[r].to());e!==!1&&(i=i.join(e||this.lineSeparator())),t[r]=i}return t},replaceSelection:function(e,t,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:Wt(function(e,t,n){for(var r=[],i=this.sel,x=0;x<i.ranges.length;x++){var k=i.ranges[x];r[x]={from:k.from(),to:k.to(),text:this.splitLines(e[x]),origin:n}}for(var j=t&&t!="end"&&fl(this,r,t),H=r.length-1;H>=0;H--)Pn(this,r[H]);j?Ko(this,j):this.cm&&Rn(this.cm)}),undo:Wt(function(){Xi(this,"undo")}),redo:Wt(function(){Xi(this,"redo")}),undoSelection:Wt(function(){Xi(this,"undo",!0)}),redoSelection:Wt(function(){Xi(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){var e=this;this.history=new zi(this.history.maxGeneration),Qr(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:On(this.history.done),undone:On(this.history.undone)}},setHistory:function(e){var t=this.history=new zi(this.history.maxGeneration);t.done=On(e.done.slice(0),null,!0),t.undone=On(e.undone.slice(0),null,!0)},setGutterMarker:Wt(function(e,t,n){return mi(this,e,"gutter",function(r){var i=r.gutterMarkers||(r.gutterMarkers={});return i[t]=n,!n&&Fe(i)&&(r.gutterMarkers=null),!0})}),clearGutter:Wt(function(e){var t=this;this.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&mi(t,n,"gutter",function(){return n.gutterMarkers[e]=null,Fe(n.gutterMarkers)&&(n.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!Pr(this,e))return null;if(t=e,e=nt(this,e),!e)return null}else if(t=At(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:Wt(function(e,t,n){return mi(this,e,t=="gutter"?"gutter":"class",function(r){var i=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!r[i])r[i]=n;else{if(E(n).test(r[i]))return!1;r[i]+=" "+n}return!0})}),removeLineClass:Wt(function(e,t,n){return mi(this,e,t=="gutter"?"gutter":"class",function(r){var i=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",x=r[i];if(x)if(n==null)r[i]=null;else{var k=x.match(E(n));if(!k)return!1;var j=k.index+k[0].length;r[i]=x.slice(0,k.index)+(!k.index||j==x.length?"":" ")+x.slice(j)||null}else return!1;return!0})}),addLineWidget:Wt(function(e,t,n){return xl(this,e,t,n)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return _n(this,ft(this,e),ft(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=ft(this,e),_n(this,e,e,n,"bookmark")},findMarksAt:function(e){e=ft(this,e);var t=[],n=nt(this,e.line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(i.from==null||i.from<=e.ch)&&(i.to==null||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=ft(this,e),t=ft(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,function(x){var k=x.markedSpans;if(k)for(var j=0;j<k.length;j++){var H=k[j];!(H.to!=null&&i==e.line&&e.ch>=H.to||H.from==null&&i!=e.line||H.from!=null&&i==t.line&&H.from>=t.ch)&&(!n||n(H.marker))&&r.push(H.marker.parent||H.marker)}++i}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)n[r].from!=null&&e.push(n[r].marker)}),e},posFromIndex:function(e){var t,n=this.first,r=this.lineSeparator().length;return this.iter(function(i){var x=i.text.length+r;if(x>e)return t=e,!0;e-=x,++n}),ft(this,ke(n,t))},indexFromPos:function(e){e=ft(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,function(r){t+=r.text.length+n}),t},copy:function(e){var t=new rr(mn(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,n=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<n&&(n=e.to);var r=new rr(mn(this,t,n),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Tl(r,rs(this)),r},unlinkDoc:function(e){if(e instanceof Rt&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var n=this.linked[t];if(n.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),Sl(rs(this));break}if(e.history==this.history){var r=[e.id];Qr(e,function(i){return r.push(i.id)},!0),e.history=new zi(null),e.history.done=On(this.history.done,r),e.history.undone=On(this.history.undone,r)}},iterLinkedDocs:function(e){Qr(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):ht(e)},lineSeparator:function(){return this.lineSep||`
`},setDirection:Wt(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&hl(this.cm)})}),rr.prototype.eachLine=rr.prototype.iter;var ns=0;function wl(e){var t=this;if(is(t),Pe(t,e)||Nr(t.display,e))return;Y(e),U&&(ns=+new Date);var n=on(t,e,!0),r=e.dataTransfer.files;if(!n||t.isReadOnly())return;if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,x=Array(i),k=0,j=function(){++k==i&&jt(t,function(){n=ft(t.doc,n);var fe={from:n,to:n,text:t.doc.splitLines(x.filter(function(Te){return Te!=null}).join(t.doc.lineSeparator())),origin:"paste"};Pn(t.doc,fe),Ko(t.doc,zr(ft(t.doc,n),ft(t.doc,Vr(fe))))})()},H=function(fe,Te){if(t.options.allowDropFileTypes&&oe(t.options.allowDropFileTypes,fe.type)==-1){j();return}var Re=new FileReader;Re.onerror=function(){return j()},Re.onload=function(){var Ue=Re.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Ue)){j();return}x[Te]=Ue,j()},Re.readAsText(fe)},z=0;z<r.length;z++)H(r[z],z);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var $=e.dataTransfer.getData("Text");if($){var re;if(t.state.draggingText&&!t.state.draggingText.copy&&(re=t.listSelections()),Yi(t.doc,zr(n,n)),re)for(var me=0;me<re.length;++me)kn(t.doc,"",re[me].anchor,re[me].head,"drag");t.replaceSelection($,"around","paste"),t.display.input.focus()}}catch(fe){}}}function Dl(e,t){if(U&&(!e.state.draggingText||+new Date-ns<100)){te(t);return}if(Pe(e,t)||Nr(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!L){var n=a("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",T&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),T&&n.parentNode.removeChild(n)}}function Ll(e,t){var n=on(e,t);if(!n)return;var r=document.createDocumentFragment();go(e,n,r),e.display.dragCursor||(e.display.dragCursor=a("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),s(e.display.dragCursor,r)}function is(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function as(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),n=[],r=0;r<t.length;r++){var i=t[r].CodeMirror;i&&n.push(i)}n.length&&n[0].operation(function(){for(var x=0;x<n.length;x++)e(n[x])})}var os=!1;function Rl(){if(os)return;Il(),os=!0}function Il(){var e;ye(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,as(Ol)},100))}),ye(window,"blur",function(){return as(Ln)})}function Ol(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Jr={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"},Ei=0;Ei<10;Ei++)Jr[Ei+48]=Jr[Ei+96]=String(Ei);for(var Zi=65;Zi<=90;Zi++)Jr[Zi]=String.fromCharCode(Zi);for(var bi=1;bi<=12;bi++)Jr[bi+111]=Jr[bi+63235]="F"+bi;var Fr={};Fr.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"},Fr.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"},Fr.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"},Fr.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"]},Fr.default=l?Fr.macDefault:Fr.pcDefault;function Ml(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var n,r,i,x,k=0;k<t.length-1;k++){var j=t[k];if(/^(cmd|meta|m)$/i.test(j))x=!0;else if(/^a(lt)?$/i.test(j))n=!0;else if(/^(c|ctrl|control)$/i.test(j))r=!0;else if(/^s(hift)?$/i.test(j))i=!0;else throw new Error("Unrecognized modifier name: "+j)}return n&&(e="Alt-"+e),r&&(e="Ctrl-"+e),x&&(e="Cmd-"+e),i&&(e="Shift-"+e),e}function Pl(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if(r=="..."){delete e[n];continue}for(var i=_e(n.split(" "),Ml),x=0;x<i.length;x++){var k=void 0,j=void 0;x==i.length-1?(j=i.join(" "),k=r):(j=i.slice(0,x+1).join(" "),k="...");var H=t[j];if(!H)t[j]=k;else if(H!=k)throw new Error("Inconsistent bindings for "+j)}delete e[n]}for(var z in t)e[z]=t[z];return e}function Bn(e,t,n,r){t=qi(t);var i=t.call?t.call(e,r):t[e];if(i===!1)return"nothing";if(i==="...")return"multi";if(i!=null&&n(i))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return Bn(e,t.fallthrough,n,r);for(var x=0;x<t.fallthrough.length;x++){var k=Bn(e,t.fallthrough[x],n,r);if(k)return k}}}function ss(e){var t=typeof e=="string"?e:Jr[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function ls(e,t,n){var r=e;return t.altKey&&r!="Alt"&&(e="Alt-"+e),(h?t.metaKey:t.ctrlKey)&&r!="Ctrl"&&(e="Ctrl-"+e),(h?t.ctrlKey:t.metaKey)&&r!="Mod"&&(e="Cmd-"+e),!n&&t.shiftKey&&r!="Shift"&&(e="Shift-"+e),e}function us(e,t){if(T&&e.keyCode==34&&e.char)return!1;var n=Jr[e.keyCode];return n==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(n=e.code),ls(n,e,t))}function qi(e){return typeof e=="string"?Fr[e]:e}function Un(e,t){for(var n=e.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var x=t(n[i]);r.length&&dt(x.from,Ee(r).to)<=0;){var k=r.pop();if(dt(k.from,x.from)<0){x.from=k.from;break}}r.push(x)}or(e,function(){for(var j=r.length-1;j>=0;j--)kn(e.doc,"",r[j].from,r[j].to,"+delete");Rn(e)})}function Ua(e,t,n){var r=Le(e.text,t+n,n);return r<0||r>e.text.length?null:r}function Na(e,t,n){var r=Ua(e,t.ch,n);return r==null?null:new ke(t.line,r,n<0?"after":"before")}function Fa(e,t,n,r,i){if(e){t.doc.direction=="rtl"&&(i=-i);var x=Xe(n,t.doc.direction);if(x){var k=i<0?Ee(x):x[0],j=i<0==(k.level==1),H=j?"after":"before",z;if(k.level>0||t.doc.direction=="rtl"){var $=Cn(t,n);z=i<0?n.text.length-1:0;var re=Rr(t,$,z).top;z=qe(function(me){return Rr(t,$,me).top==re},i<0==(k.level==1)?k.from:k.to-1,z),H=="before"&&(z=Ua(n,z,1))}else z=i<0?k.to:k.from;return new ke(r,z,H)}}return new ke(r,i<0?n.text.length:0,i<0?"before":"after")}function kl(e,t,n,r){var i=Xe(t,e.doc.direction);if(!i)return Na(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var x=Ge(i,n.ch,n.sticky),k=i[x];if(e.doc.direction=="ltr"&&k.level%2==0&&(r>0?k.to>n.ch:k.from<n.ch))return Na(t,n,r);var j=function(We,Je){return Ua(t,We instanceof ke?We.ch:We,Je)},H,z=function(We){return e.options.lineWrapping?(H=H||Cn(e,t),fo(e,t,H,We)):{begin:0,end:t.text.length}},$=z(n.sticky=="before"?j(n,-1):n.ch);if(e.doc.direction=="rtl"||k.level==1){var re=k.level==1==r<0,me=j(n,re?1:-1);if(me!=null&&(re?me<=k.to&&me<=$.end:me>=k.from&&me>=$.begin)){var fe=re?"before":"after";return new ke(n.line,me,fe)}}var Te=function(We,Je,Ke){for(var et=function(Lt,Kt){return Kt?new ke(n.line,j(Lt,1),"before"):new ke(n.line,Lt,"after")};We>=0&&We<i.length;We+=Je){var ut=i[We],ot=Je>0==(ut.level!=1),mt=ot?Ke.begin:j(Ke.end,-1);if(ut.from<=mt&&mt<ut.to)return et(mt,ot);if(mt=ot?ut.from:j(ut.to,-1),Ke.begin<=mt&&mt<Ke.end)return et(mt,ot)}},Re=Te(x+r,r,$);if(Re)return Re;var Ue=r>0?$.end:j($.begin,-1);return Ue!=null&&!(r>0&&Ue==t.text.length)&&(Re=Te(r>0?0:i.length-1,r,z(Ue)),Re)?Re:null}var xi={selectAll:Qo,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),ge)},killLine:function(e){return Un(e,function(t){if(t.empty()){var n=nt(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:ke(t.head.line+1,0)}:{from:t.head,to:ke(t.head.line,n)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Un(e,function(t){return{from:ke(t.from().line,0),to:ft(e.doc,ke(t.to().line+1,0))}})},delLineLeft:function(e){return Un(e,function(t){return{from:ke(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return Un(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return{from:r,to:t.from()}})},delWrappedLineRight:function(e){return Un(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:r}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(ke(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(ke(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return ds(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return cs(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return _l(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")},ce)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")},ce)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return r.ch<e.getLine(r.line).search(/\S/)?cs(e,t.head):r},ce)},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=[],n=e.listSelections(),r=e.options.tabSize,i=0;i<n.length;i++){var x=n[i].from(),k=J(e.getLine(x.line),x.ch,r);t.push(ue(r-k%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return or(e,function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++){if(!t[r].empty())continue;var i=t[r].head,x=nt(e.doc,i.line).text;if(x){if(i.ch==x.length&&(i=new ke(i.line,i.ch-1)),i.ch>0)i=new ke(i.line,i.ch+1),e.replaceRange(x.charAt(i.ch-1)+x.charAt(i.ch-2),ke(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var k=nt(e.doc,i.line-1).text;k&&(i=new ke(i.line,1),e.replaceRange(x.charAt(0)+e.doc.lineSeparator()+k.charAt(k.length-1),ke(i.line-1,k.length-1),i,"+transpose"))}}n.push(new St(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){return or(e,function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);Rn(e)})},openLine:function(e){return e.replaceSelection(`
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function ds(e,t){var n=nt(e.doc,t),r=ur(n);return r!=n&&(t=At(r)),Fa(!0,e,r,t,1)}function _l(e,t){var n=nt(e.doc,t),r=ki(n);return r!=n&&(t=At(r)),Fa(!0,e,n,t,-1)}function cs(e,t){var n=ds(e,t.line),r=nt(e.doc,n.line),i=Xe(r,e.doc.direction);if(!i||i[0].level==0){var x=Math.max(n.ch,r.text.search(/\S/)),k=t.line==n.line&&t.ch<=x&&t.ch;return ke(n.line,k?0:x,n.sticky)}return n}function $i(e,t,n){if(typeof t=="string"&&(t=xi[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=Ce}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}function Bl(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=Bn(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&Bn(t,e.options.extraKeys,n,e)||Bn(t,e.options.keyMap,n,e)}var Ul=new ee;function Ai(e,t,n,r){var i=e.state.keySeq;if(i){if(ss(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Ul.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),fs(e,i+" "+t,n,r))return!0}return fs(e,t,n,r)}function fs(e,t,n,r){var i=Bl(e,t,r);return i=="multi"&&(e.state.keySeq=t),i=="handled"&&Gt(e,"keyHandled",e,t,n),(i=="handled"||i=="multi")&&(Y(n),Aa(e)),!!i}function hs(e,t){var n=us(t,!0);return n?t.shiftKey&&!e.state.keySeq?Ai(e,"Shift-"+n,t,function(r){return $i(e,r,!0)})||Ai(e,n,t,function(r){if(typeof r=="string"?/^go[A-Z]/.test(r):r.motion)return $i(e,r)}):Ai(e,n,t,function(r){return $i(e,r)}):!1}function Nl(e,t,n){return Ai(e,"'"+n+"'",t,function(r){return $i(e,r,!0)})}var ja=null;function ms(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=O(),Pe(t,e))return;U&&B<11&&e.keyCode==27&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=n==16||e.shiftKey;var r=hs(t,e);T&&(ja=r?n:null,!r&&n==88&&!Ct&&(l?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),D&&!l&&!r&&n==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),n==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Fl(t)}function Fl(e){var t=e.display.lineDiv;N(t,"CodeMirror-crosshair");function n(r){(r.keyCode==18||!r.altKey)&&(f(t,"CodeMirror-crosshair"),Ve(document,"keyup",n),Ve(document,"mouseover",n))}ye(document,"keyup",n),ye(document,"mouseover",n)}function ps(e){e.keyCode==16&&(this.doc.sel.shift=!1),Pe(this,e)}function gs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(Nr(t.display,e)||Pe(t,e)||e.ctrlKey&&!e.altKey||l&&e.metaKey)return;var n=e.keyCode,r=e.charCode;if(T&&n==ja){ja=null,Y(e);return}if(T&&(!e.which||e.which<10)&&hs(t,e))return;var i=String.fromCharCode(r==null?n:r);if(i=="\b")return;if(Nl(t,e,i))return;t.display.input.onKeyPress(e)}var jl=400,Wa=function(e,t,n){this.time=e,this.pos=t,this.button=n};Wa.prototype.compare=function(e,t,n){return this.time+jl>e&&dt(t,this.pos)==0&&n==this.button};var Ti,Si;function Wl(e,t){var n=+new Date;return Si&&Si.compare(n,e,t)?(Ti=Si=null,"triple"):Ti&&Ti.compare(n,e,t)?(Si=new Wa(n,e,t),Ti=null,"double"):(Ti=new Wa(n,e,t),Si=null,"single")}function vs(e){var t=this,n=t.display;if(Pe(t,e)||n.activeTouch&&n.input.supportsTouch())return;if(n.input.ensurePolled(),n.shift=e.shiftKey,Nr(n,e)){I||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));return}if(Ka(t,e))return;var r=on(t,e),i=ve(e),x=r?Wl(r,i):"single";if(window.focus(),i==1&&t.state.selectingText&&t.state.selectingText(e),r&&Kl(t,i,r,x,e))return;i==1?r?Gl(t,r,x,e):se(e)==n.scroller&&Y(e):i==2?(r&&Qi(t.doc,r),setTimeout(function(){return n.input.focus()},20)):i==3&&(w?t.display.input.onContextMenu(e):yo(t))}function Kl(e,t,n,r,i){var x="Click";return r=="double"?x="Double"+x:r=="triple"&&(x="Triple"+x),x=(t==1?"Left":t==2?"Middle":"Right")+x,Ai(e,ls(x,i),i,function(k){if(typeof k=="string"&&(k=xi[k]),!k)return!1;var j=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),j=k(e,n)!=Ce}finally{e.state.suppressEdits=!1}return j})}function Hl(e,t,n){var r=e.getOption("configureMouse"),i=r?r(e,t,n):{};if(i.unit==null){var x=u?n.shiftKey&&n.metaKey:n.altKey;i.unit=x?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(i.extend==null||e.doc.extend)&&(i.extend=e.doc.extend||n.shiftKey),i.addNew==null&&(i.addNew=l?n.metaKey:n.ctrlKey),i.moveOnDrag==null&&(i.moveOnDrag=!(l?n.altKey:n.ctrlKey)),i}function Gl(e,t,n,r){U?setTimeout(F(vo,e),0):e.curOp.focus=O();var i=Hl(e,n,r),x=e.doc.sel,k;e.options.dragDrop&&De&&!e.isReadOnly()&&n=="single"&&(k=x.contains(t))>-1&&(dt((k=x.ranges[k]).from(),t)<0||t.xRel>0)&&(dt(k.to(),t)>0||t.xRel<0)?zl(e,r,t,i):Vl(e,r,t,i)}function zl(e,t,n,r){var i=e.display,x=!1,k=jt(e,function(z){I&&(i.scroller.draggable=!1),e.state.draggingText=!1,Ve(i.wrapper.ownerDocument,"mouseup",k),Ve(i.wrapper.ownerDocument,"mousemove",j),Ve(i.scroller,"dragstart",H),Ve(i.scroller,"drop",k),x||(Y(z),r.addNew||Qi(e.doc,n,null,null,r.extend),I&&!L||U&&B==9?setTimeout(function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()},20):i.input.focus())}),j=function(z){x=x||Math.abs(t.clientX-z.clientX)+Math.abs(t.clientY-z.clientY)>=10},H=function(){return x=!0};I&&(i.scroller.draggable=!0),e.state.draggingText=k,k.copy=!r.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop(),ye(i.wrapper.ownerDocument,"mouseup",k),ye(i.wrapper.ownerDocument,"mousemove",j),ye(i.scroller,"dragstart",H),ye(i.scroller,"drop",k),yo(e),setTimeout(function(){return i.input.focus()},20)}function ys(e,t,n){if(n=="char")return new St(t,t);if(n=="word")return e.findWordAt(t);if(n=="line")return new St(ke(t.line,0),ft(e.doc,ke(t.line+1,0)));var r=n(e,t);return new St(r.from,r.to)}function Vl(e,t,n,r){var i=e.display,x=e.doc;Y(t);var k,j,H=x.sel,z=H.ranges;if(r.addNew&&!r.extend?(j=x.sel.contains(n),j>-1?k=z[j]:k=new St(n,n)):(k=x.sel.primary(),j=x.sel.primIndex),r.unit=="rectangle")r.addNew||(k=new St(n,n)),n=on(e,t,!0,!0),j=-1;else{var $=ys(e,n,r.unit);r.extend?k=_a(k,$.anchor,$.head,r.extend):k=$}r.addNew?j==-1?(j=z.length,Qt(x,Tr(e,z.concat([k]),j),{scroll:!1,origin:"*mouse"})):z.length>1&&z[j].empty()&&r.unit=="char"&&!r.extend?(Qt(x,Tr(e,z.slice(0,j).concat(z.slice(j+1)),0),{scroll:!1,origin:"*mouse"}),H=x.sel):Ba(x,j,k,pe):(j=0,Qt(x,new cr([k],0),pe),H=x.sel);var re=n;function me(Ke){if(dt(re,Ke)==0)return;if(re=Ke,r.unit=="rectangle"){for(var et=[],ut=e.options.tabSize,ot=J(nt(x,n.line).text,n.ch,ut),mt=J(nt(x,Ke.line).text,Ke.ch,ut),Lt=Math.min(ot,mt),Kt=Math.max(ot,mt),It=Math.min(n.line,Ke.line),sr=Math.min(e.lastLine(),Math.max(n.line,Ke.line));It<=sr;It++){var nr=nt(x,It).text,kt=he(nr,Lt,ut);Lt==Kt?et.push(new St(ke(It,kt),ke(It,kt))):nr.length>kt&&et.push(new St(ke(It,kt),ke(It,he(nr,Kt,ut))))}et.length||et.push(new St(n,n)),Qt(x,Tr(e,H.ranges.slice(0,j).concat(et),j),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Ke)}else{var ir=k,zt=ys(e,Ke,r.unit),Nt=ir.anchor,_t;dt(zt.anchor,Nt)>0?(_t=zt.head,Nt=Zr(ir.from(),zt.anchor)):(_t=zt.anchor,Nt=vn(ir.to(),zt.head));var Mt=H.ranges.slice(0);Mt[j]=Ql(e,new St(ft(x,Nt),_t)),Qt(x,Tr(e,Mt,j),pe)}}var fe=i.wrapper.getBoundingClientRect(),Te=0;function Re(Ke){var et=++Te,ut=on(e,Ke,!0,r.unit=="rectangle");if(!ut)return;if(dt(ut,re)!=0){e.curOp.focus=O(),me(ut);var ot=Wi(i,x);(ut.line>=ot.to||ut.line<ot.from)&&setTimeout(jt(e,function(){Te==et&&Re(Ke)}),150)}else{var mt=Ke.clientY<fe.top?-20:Ke.clientY>fe.bottom?20:0;mt&&setTimeout(jt(e,function(){if(Te!=et)return;i.scroller.scrollTop+=mt,Re(Ke)}),50)}}function Ue(Ke){e.state.selectingText=!1,Te=Infinity,Ke&&(Y(Ke),i.input.focus()),Ve(i.wrapper.ownerDocument,"mousemove",We),Ve(i.wrapper.ownerDocument,"mouseup",Je),x.history.lastSelOrigin=null}var We=jt(e,function(Ke){Ke.buttons===0||!ve(Ke)?Ue(Ke):Re(Ke)}),Je=jt(e,Ue);e.state.selectingText=Je,ye(i.wrapper.ownerDocument,"mousemove",We),ye(i.wrapper.ownerDocument,"mouseup",Je)}function Ql(e,t){var n=t.anchor,r=t.head,i=nt(e.doc,n.line);if(dt(n,r)==0&&n.sticky==r.sticky)return t;var x=Xe(i);if(!x)return t;var k=Ge(x,n.ch,n.sticky),j=x[k];if(j.from!=n.ch&&j.to!=n.ch)return t;var H=k+(j.from==n.ch==(j.level!=1)?0:1);if(H==0||H==x.length)return t;var z;if(r.line!=n.line)z=(r.line-n.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var $=Ge(x,r.ch,r.sticky),re=$-k||(r.ch-n.ch)*(j.level==1?-1:1);$==H-1||$==H?z=re<0:z=re>0}var me=x[H+(z?-1:0)],fe=z==(me.level==1),Te=fe?me.from:me.to,Re=fe?"after":"before";return n.ch==Te&&n.sticky==Re?t:new St(new ke(n.line,Te,Re),r)}function Es(e,t,n,r){var i,x;if(t.touches)i=t.touches[0].clientX,x=t.touches[0].clientY;else try{i=t.clientX,x=t.clientY}catch(me){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&Y(t);var k=e.display,j=k.lineDiv.getBoundingClientRect();if(x>j.bottom||!ie(e,n))return Z(t);x-=j.top-k.viewOffset;for(var H=0;H<e.display.gutterSpecs.length;++H){var z=k.gutters.childNodes[H];if(z&&z.getBoundingClientRect().right>=i){var $=gr(e.doc,x),re=e.display.gutterSpecs[H];return be(e,n,e,$,re.className,t),Z(t)}}}function Ka(e,t){return Es(e,t,"gutterClick",!0)}function bs(e,t){if(Nr(e.display,t)||Yl(e,t))return;if(Pe(e,t,"contextmenu"))return;w||e.display.input.onContextMenu(t)}function Yl(e,t){return ie(e,"gutterContextMenu")?Es(e,t,"gutterContextMenu",!1):!1}function xs(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),ii(e)}var Nn={toString:function(){return"CodeMirror.Init"}},As={},ea={};function Jl(e){var t=e.optionHandlers;function n(r,i,x,k){e.defaults[r]=i,x&&(t[r]=k?function(j,H,z){z!=Nn&&x(j,H,z)}:x)}e.defineOption=n,e.Init=Nn,n("value","",function(r,i){return r.setValue(i)},!0),n("mode",null,function(r,i){r.doc.modeOption=i,Ma(r)},!0),n("indentUnit",2,Ma,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,function(r){fi(r),ii(r),tr(r)},!0),n("lineSeparator",null,function(r,i){if(r.doc.lineSep=i,!i)return;var x=[],k=r.doc.first;r.doc.iter(function(H){for(var z=0;;){var $=H.text.indexOf(i,z);if($==-1)break;z=$+i.length,x.push(ke(k,$))}k++});for(var j=x.length-1;j>=0;j--)kn(r.doc,i,x[j],ke(x[j].line,x[j].ch+i.length))}),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(r,i,x){r.state.specialChars=new RegExp(i.source+(i.test(" ")?"":"| "),"g"),x!=Nn&&r.refresh()}),n("specialCharPlaceholder",Dt,function(r){return r.refresh()},!0),n("electricChars",!0),n("inputStyle",o?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),n("spellcheck",!1,function(r,i){return r.getInputField().spellcheck=i},!0),n("autocorrect",!1,function(r,i){return r.getInputField().autocorrect=i},!0),n("autocapitalize",!1,function(r,i){return r.getInputField().autocapitalize=i},!0),n("rtlMoveVisually",!y),n("wholeLineUpdateBefore",!0),n("theme","default",function(r){xs(r),ci(r)},!0),n("keyMap","default",function(r,i,x){var k=qi(i),j=x!=Nn&&qi(x);j&&j.detach&&j.detach(r,k),k.attach&&k.attach(r,j||null)}),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Zl,!0),n("gutters",[],function(r,i){r.display.gutterSpecs=Ia(i,r.options.lineNumbers),ci(r)},!0),n("fixedGutter",!0,function(r,i){r.display.gutters.style.left=i?ba(r.display)+"px":"0",r.refresh()},!0),n("coverGutterNextToScrollbar",!1,function(r){return In(r)},!0),n("scrollbarStyle","native",function(r){So(r),In(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),n("lineNumbers",!1,function(r,i){r.display.gutterSpecs=Ia(r.options.gutters,i),ci(r)},!0),n("firstLineNumber",1,ci,!0),n("lineNumberFormatter",function(r){return r},ci,!0),n("showCursorWhenSelecting",!1,ai,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,function(r,i){i=="nocursor"&&(Ln(r),r.display.input.blur()),r.display.input.readOnlyChanged(i)}),n("screenReaderLabel",null,function(r,i){i=i===""?null:i,r.display.input.screenReaderLabelChanged(i)}),n("disableInput",!1,function(r,i){i||r.display.input.reset()},!0),n("dragDrop",!0,Xl),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,ai,!0),n("singleCursorHeightPerLine",!0,ai,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,fi,!0),n("addModeClass",!1,fi,!0),n("pollInterval",100),n("undoDepth",200,function(r,i){return r.doc.history.undoDepth=i}),n("historyEventDelay",1250),n("viewportMargin",10,function(r){return r.refresh()},!0),n("maxHighlightLength",1e4,fi,!0),n("moveInputWithCursor",!0,function(r,i){i||r.display.input.resetPosition()}),n("tabindex",null,function(r,i){return r.display.input.getField().tabIndex=i||""}),n("autofocus",null),n("direction","ltr",function(r,i){return r.doc.setDirection(i)},!0),n("phrases",null)}function Xl(e,t,n){var r=n&&n!=Nn;if(!t!=!r){var i=e.display.dragFunctions,x=t?ye:Ve;x(e.display.scroller,"dragstart",i.start),x(e.display.scroller,"dragenter",i.enter),x(e.display.scroller,"dragover",i.over),x(e.display.scroller,"dragleave",i.leave),x(e.display.scroller,"drop",i.drop)}}function Zl(e){e.options.lineWrapping?(N(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(f(e.display.wrapper,"CodeMirror-wrap"),_i(e)),xa(e),tr(e),ii(e),setTimeout(function(){return In(e)},100)}function Rt(e,t){var n=this;if(!(this instanceof Rt))return new Rt(e,t);this.options=t=t?_(t):{},_(As,t,!1);var r=t.value;typeof r=="string"?r=new rr(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new Rt.inputStyles[t.inputStyle](this),x=this.display=new dl(e,r,i,t);x.wrapper.CodeMirror=this,xs(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),So(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 ee,keySeq:null,specialChars:null},t.autofocus&&!o&&x.input.focus(),U&&B<11&&setTimeout(function(){return n.display.input.reset(!0)},20),ql(this),Rl(),dn(this),this.curOp.forceUpdate=!0,ko(this,r),t.autofocus&&!o||this.hasFocus()?setTimeout(function(){n.hasFocus()&&!n.state.focused&&Ta(n)},20):Ln(this);for(var k in ea)ea.hasOwnProperty(k)&&ea[k](this,t[k],Nn);Do(this),t.finishInit&&t.finishInit(this);for(var j=0;j<Ha.length;++j)Ha[j](this);cn(this),I&&t.lineWrapping&&getComputedStyle(x.lineDiv).textRendering=="optimizelegibility"&&(x.lineDiv.style.textRendering="auto")}Rt.defaults=As,Rt.optionHandlers=ea;function ql(e){var t=e.display;ye(t.scroller,"mousedown",jt(e,vs)),U&&B<11?ye(t.scroller,"dblclick",jt(e,function(H){if(Pe(e,H))return;var z=on(e,H);if(!z||Ka(e,H)||Nr(e.display,H))return;Y(H);var $=e.findWordAt(z);Qi(e.doc,$.anchor,$.head)})):ye(t.scroller,"dblclick",function(H){return Pe(e,H)||Y(H)}),ye(t.scroller,"contextmenu",function(H){return bs(e,H)}),ye(t.input.getField(),"contextmenu",function(H){t.scroller.contains(H.target)||bs(e,H)});var n,r={end:0};function i(){t.activeTouch&&(n=setTimeout(function(){return t.activeTouch=null},1e3),r=t.activeTouch,r.end=+new Date)}function x(H){if(H.touches.length!=1)return!1;var z=H.touches[0];return z.radiusX<=1&&z.radiusY<=1}function k(H,z){if(z.left==null)return!0;var $=z.left-H.left,re=z.top-H.top;return $*$+re*re>20*20}ye(t.scroller,"touchstart",function(H){if(!Pe(e,H)&&!x(H)&&!Ka(e,H)){t.input.ensurePolled(),clearTimeout(n);var z=+new Date;t.activeTouch={start:z,moved:!1,prev:z-r.end<=300?r:null},H.touches.length==1&&(t.activeTouch.left=H.touches[0].pageX,t.activeTouch.top=H.touches[0].pageY)}}),ye(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),ye(t.scroller,"touchend",function(H){var z=t.activeTouch;if(z&&!Nr(t,H)&&z.left!=null&&!z.moved&&new Date-z.start<300){var $=e.coordsChar(t.activeTouch,"page"),re;!z.prev||k(z,z.prev)?re=new St($,$):!z.prev.prev||k(z,z.prev.prev)?re=e.findWordAt($):re=new St(ke($.line,0),ft(e.doc,ke($.line+1,0))),e.setSelection(re.anchor,re.head),e.focus(),Y(H)}i()}),ye(t.scroller,"touchcancel",i),ye(t.scroller,"scroll",function(){t.scroller.clientHeight&&(si(e,t.scroller.scrollTop),ln(e,t.scroller.scrollLeft,!0),be(e,"scroll",e))}),ye(t.scroller,"mousewheel",function(H){return Io(e,H)}),ye(t.scroller,"DOMMouseScroll",function(H){return Io(e,H)}),ye(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(H){Pe(e,H)||te(H)},over:function(H){Pe(e,H)||(Ll(e,H),te(H))},start:function(H){return Dl(e,H)},drop:jt(e,wl),leave:function(H){Pe(e,H)||is(e)}};var j=t.input.getField();ye(j,"keyup",function(H){return ps.call(e,H)}),ye(j,"keydown",jt(e,ms)),ye(j,"keypress",jt(e,gs)),ye(j,"focus",function(H){return Ta(e,H)}),ye(j,"blur",function(H){return Ln(e,H)})}var Ha=[];Rt.defineInitHook=function(e){return Ha.push(e)};function Ci(e,t,n,r){var i=e.doc,x;n==null&&(n="add"),n=="smart"&&(i.mode.indent?x=vr(e,t).state:n="prev");var k=e.options.tabSize,j=nt(i,t),H=J(j.text,null,k);j.stateAfter&&(j.stateAfter=null);var z=j.text.match(/^\s*/)[0],$;if(!r&&!/\S/.test(j.text))$=0,n="not";else if(n=="smart"&&($=i.mode.indent(x,j.text.slice(z.length),j.text),$==Ce||$>150)){if(!r)return;n="prev"}n=="prev"?t>i.first?$=J(nt(i,t-1).text,null,k):$=0:n=="add"?$=H+e.options.indentUnit:n=="subtract"?$=H-e.options.indentUnit:typeof n=="number"&&($=H+n),$=Math.max(0,$);var re="",me=0;if(e.options.indentWithTabs)for(var fe=Math.floor($/k);fe;--fe)me+=k,re+=" ";if(me<$&&(re+=ue($-me)),re!=z)return kn(i,re,ke(t,0),ke(t,z.length),"+input"),j.stateAfter=null,!0;for(var Te=0;Te<i.sel.ranges.length;Te++){var Re=i.sel.ranges[Te];if(Re.head.line==t&&Re.head.ch<z.length){var Ue=ke(t,z.length);Ba(i,Te,new St(Ue,Ue));break}}}var Sr=null;function ta(e){Sr=e}function Ga(e,t,n,r,i){var x=e.doc;e.display.shift=!1,r||(r=x.sel);var k=+new Date-200,j=i=="paste"||e.state.pasteIncoming>k,H=ht(t),z=null;if(j&&r.ranges.length>1)if(Sr&&Sr.text.join(`
`)==t){if(r.ranges.length%Sr.text.length==0){z=[];for(var $=0;$<Sr.text.length;$++)z.push(x.splitLines(Sr.text[$]))}}else H.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(z=_e(H,function(We){return[We]}));for(var re=e.curOp.updateInput,me=r.ranges.length-1;me>=0;me--){var fe=r.ranges[me],Te=fe.from(),Re=fe.to();fe.empty()&&(n&&n>0?Te=ke(Te.line,Te.ch-n):e.state.overwrite&&!j?Re=ke(Re.line,Math.min(nt(x,Re.line).text.length,Re.ch+Ee(H).length)):j&&Sr&&Sr.lineWise&&Sr.text.join(`
`)==H.join(`
`)&&(Te=Re=ke(Te.line,0)));var Ue={from:Te,to:Re,text:z?z[me%z.length]:H,origin:i||(j?"paste":e.state.cutIncoming>k?"cut":"+input")};Pn(e.doc,Ue),Gt(e,"inputRead",e,Ue)}t&&!j&&Ss(e,t),Rn(e),e.curOp.updateInput<2&&(e.curOp.updateInput=re),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Ts(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&or(t,function(){return Ga(t,n,0,null,"paste")}),!0}function Ss(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)continue;var x=e.getModeAt(i.head),k=!1;if(x.electricChars){for(var j=0;j<x.electricChars.length;j++)if(t.indexOf(x.electricChars.charAt(j))>-1){k=Ci(e,i.head.line,"smart");break}}else x.electricInput&&(x.electricInput.test(nt(e.doc,i.head.line).text.slice(0,i.head.ch))&&(k=Ci(e,i.head.line,"smart")));k&&Gt(e,"electricInput",e,i.head.line)}}function Cs(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,x={anchor:ke(i,0),head:ke(i+1,0)};n.push(x),t.push(e.getRange(x.anchor,x.head))}return{text:t,ranges:n}}function ws(e,t,n,r){e.setAttribute("autocorrect",n?"":"off"),e.setAttribute("autocapitalize",r?"":"off"),e.setAttribute("spellcheck",!!t)}function Ds(){var e=a("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=a("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return I?e.style.width="1000px":e.setAttribute("wrap","off"),A&&(e.style.border="1px solid black"),ws(e),t}function $l(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(r,i){var x=this.options,k=x[r];if(x[r]==i&&r!="mode")return;x[r]=i,t.hasOwnProperty(r)&&jt(this,t[r])(this,i,k),be(this,"optionChange",this,r)},getOption:function(r){return this.options[r]},getDoc:function(){return this.doc},addKeyMap:function(r,i){this.state.keyMaps[i?"push":"unshift"](qi(r))},removeKeyMap:function(r){for(var i=this.state.keyMaps,x=0;x<i.length;++x)if(i[x]==r||i[x].name==r)return i.splice(x,1),!0},addOverlay:Xt(function(r,i){var x=r.token?r:e.getMode(this.options,r);if(x.startState)throw new Error("Overlays may not be stateful.");Oe(this.state.overlays,{mode:x,modeSpec:r,opaque:i&&i.opaque,priority:i&&i.priority||0},function(k){return k.priority}),this.state.modeGen++,tr(this)}),removeOverlay:Xt(function(r){for(var i=this.state.overlays,x=0;x<i.length;++x){var k=i[x].modeSpec;if(k==r||typeof r=="string"&&k.name==r){i.splice(x,1),this.state.modeGen++,tr(this);return}}}),indentLine:Xt(function(r,i,x){typeof i!="string"&&typeof i!="number"&&(i==null?i=this.options.smartIndent?"smart":"prev":i=i?"add":"subtract"),Pr(this.doc,r)&&Ci(this,r,i,x)}),indentSelection:Xt(function(r){for(var i=this.doc.sel.ranges,x=-1,k=0;k<i.length;k++){var j=i[k];if(j.empty())j.head.line>x&&(Ci(this,j.head.line,r,!0),x=j.head.line,k==this.doc.sel.primIndex&&Rn(this));else{var H=j.from(),z=j.to(),$=Math.max(x,H.line);x=Math.min(this.lastLine(),z.line-(z.ch?0:1))+1;for(var re=$;re<x;++re)Ci(this,re,r);var me=this.doc.sel.ranges;H.ch==0&&i.length==me.length&&me[k].from().ch>0&&Ba(this.doc,k,new St(H,me[k].to()),ge)}}}),getTokenAt:function(r,i){return Di(this,r,i)},getLineTokens:function(r,i){return Di(this,ke(r),i,!0)},getTokenTypeAt:function(r){r=ft(this.doc,r);var i=qr(this,nt(this.doc,r.line)),x=0,k=(i.length-1)/2,j=r.ch,H;if(j==0)H=i[2];else for(;;){var z=x+k>>1;if((z?i[z*2-1]:0)>=j)k=z;else if(i[z*2+1]<j)x=z+1;else{H=i[z*2+2];break}}var $=H?H.indexOf("overlay "):-1;return $<0?H:$==0?null:H.slice(0,$-1)},getModeAt:function(r){var i=this.doc.mode;return i.innerMode?e.innerMode(i,this.getTokenAt(r).state).mode:i},getHelper:function(r,i){return this.getHelpers(r,i)[0]},getHelpers:function(r,i){var x=[];if(!n.hasOwnProperty(i))return x;var k=n[i],j=this.getModeAt(r);if(typeof j[i]=="string")k[j[i]]&&x.push(k[j[i]]);else if(j[i])for(var H=0;H<j[i].length;H++){var z=k[j[i][H]];z&&x.push(z)}else j.helperType&&k[j.helperType]?x.push(k[j.helperType]):k[j.name]&&x.push(k[j.name]);for(var $=0;$<k._global.length;$++){var re=k._global[$];re.pred(j,this)&&oe(x,re.val)==-1&&x.push(re.val)}return x},getStateAfter:function(r,i){var x=this.doc;return r=yn(x,r==null?x.first+x.size-1:r),vr(this,r+1,i).state},cursorCoords:function(r,i){var x,k=this.doc.sel.primary();return r==null?x=k.head:typeof r=="object"?x=ft(this.doc,r):x=r?k.from():k.to(),Ar(this,x,i||"page")},charCoords:function(r,i){return pa(this,ft(this.doc,r),i||"page")},coordsChar:function(r,i){return r=lo(this,r,i||"page"),va(this,r.left,r.top)},lineAtHeight:function(r,i){return r=lo(this,{top:r,left:0},i||"page").top,gr(this.doc,r+this.display.viewOffset)},heightAtLine:function(r,i,x){var k=!1,j;if(typeof r=="number"){var H=this.doc.first+this.doc.size-1;r<this.doc.first?r=this.doc.first:r>H&&(r=H,k=!0),j=nt(this.doc,r)}else j=r;return Ui(this,j,{top:0,left:0},i||"page",x||k).top+(k?this.doc.height-xr(j):0)},defaultTextHeight:function(){return wn(this.display)},defaultCharWidth:function(){return Dn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,i,x,k,j){var H=this.display;r=Ar(this,ft(this.doc,r));var z=r.bottom,$=r.left;if(i.style.position="absolute",i.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(i),H.sizer.appendChild(i),k=="over")z=r.top;else if(k=="above"||k=="near"){var re=Math.max(H.wrapper.clientHeight,this.doc.height),me=Math.max(H.sizer.clientWidth,H.lineSpace.clientWidth);(k=="above"||r.bottom+i.offsetHeight>re)&&r.top>i.offsetHeight?z=r.top-i.offsetHeight:r.bottom+i.offsetHeight<=re&&(z=r.bottom),$+i.offsetWidth>me&&($=me-i.offsetWidth)}i.style.top=z+"px",i.style.left=i.style.right="",j=="right"?($=H.sizer.clientWidth-i.offsetWidth,i.style.right="0px"):(j=="left"?$=0:j=="middle"&&($=(H.sizer.clientWidth-i.offsetWidth)/2),i.style.left=$+"px"),x&&Xs(this,{left:$,top:z,right:$+i.offsetWidth,bottom:z+i.offsetHeight})},triggerOnKeyDown:Xt(ms),triggerOnKeyPress:Xt(gs),triggerOnKeyUp:ps,triggerOnMouseDown:Xt(vs),execCommand:function(r){if(xi.hasOwnProperty(r))return xi[r].call(null,this)},triggerElectric:Xt(function(r){Ss(this,r)}),findPosH:function(r,i,x,k){var j=1;i<0&&(j=-1,i=-i);for(var H=ft(this.doc,r),z=0;z<i&&!(H=za(this.doc,H,j,x,k),H.hitSide);++z);return H},moveH:Xt(function(r,i){var x=this;this.extendSelectionsBy(function(k){return x.display.shift||x.doc.extend||k.empty()?za(x.doc,k.head,r,i,x.options.rtlMoveVisually):r<0?k.from():k.to()},ce)}),deleteH:Xt(function(r,i){var x=this.doc.sel,k=this.doc;x.somethingSelected()?k.replaceSelection("",null,"+delete"):Un(this,function(j){var H=za(k,j.head,r,i,!1);return r<0?{from:H,to:j.head}:{from:j.head,to:H}})}),findPosV:function(r,i,x,k){var j=1,H=k;i<0&&(j=-1,i=-i);for(var z=ft(this.doc,r),$=0;$<i;++$){var re=Ar(this,z,"div");if(H==null?H=re.left:re.left=H,z=Ls(this,re,j,x),z.hitSide)break}return z},moveV:Xt(function(r,i){var x=this,k=this.doc,j=[],H=!this.display.shift&&!k.extend&&k.sel.somethingSelected();if(k.extendSelectionsBy(function($){if(H)return r<0?$.from():$.to();var re=Ar(x,$.head,"div");$.goalColumn!=null&&(re.left=$.goalColumn),j.push(re.left);var me=Ls(x,re,r,i);return i=="page"&&$==k.sel.primary()&&Ca(x,pa(x,me,"div").top-re.top),me},ce),j.length)for(var z=0;z<k.sel.ranges.length;z++)k.sel.ranges[z].goalColumn=j[z]}),findWordAt:function(r){var i=this.doc,x=nt(i,r.line).text,k=r.ch,j=r.ch;if(x){var H=this.getHelper(r,"wordChars");(r.sticky=="before"||j==x.length)&&k?--k:++j;for(var z=x.charAt(k),$=Ie(z,H)?function(re){return Ie(re,H)}:/\s/.test(z)?function(re){return/\s/.test(re)}:function(re){return!/\s/.test(re)&&!Ie(re)};k>0&&$(x.charAt(k-1));)--k;for(;j<x.length&&$(x.charAt(j));)++j}return new St(ke(r.line,k),ke(r.line,j))},toggleOverwrite:function(r){if(r!=null&&r==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?N(this.display.cursorDiv,"CodeMirror-overwrite"):f(this.display.cursorDiv,"CodeMirror-overwrite"),be(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==O()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Xt(function(r,i){oi(this,r,i)}),getScrollInfo:function(){var r=this.display.scroller;return{left:r.scrollLeft,top:r.scrollTop,height:r.scrollHeight-Lr(this)-this.display.barHeight,width:r.scrollWidth-Lr(this)-this.display.barWidth,clientHeight:fa(this),clientWidth:nn(this)}},scrollIntoView:Xt(function(r,i){r==null?(r={from:this.doc.sel.primary().head,to:null},i==null&&(i=this.options.cursorScrollMargin)):typeof r=="number"?r={from:ke(r,0),to:null}:r.from==null&&(r={from:r,to:null}),r.to||(r.to=r.from),r.margin=i||0,r.from.line!=null?Zs(this,r):bo(this,r.from,r.to,r.margin)}),setSize:Xt(function(r,i){var x=this,k=function(H){return typeof H=="number"||/^\d+$/.test(String(H))?H+"px":H};r!=null&&(this.display.wrapper.style.width=k(r)),i!=null&&(this.display.wrapper.style.height=k(i)),this.options.lineWrapping&&ao(this);var j=this.display.viewFrom;this.doc.iter(j,this.display.viewTo,function(H){if(H.widgets){for(var z=0;z<H.widgets.length;z++)if(H.widgets[z].noHScroll){Hr(x,j,"widget");break}}++j}),this.curOp.forceUpdate=!0,be(this,"refresh",this)}),operation:function(r){return or(this,r)},startOperation:function(){return dn(this)},endOperation:function(){return cn(this)},refresh:Xt(function(){var r=this.display.cachedTextHeight;tr(this),this.curOp.forceUpdate=!0,ii(this),oi(this,this.doc.scrollLeft,this.doc.scrollTop),La(this.display),(r==null||Math.abs(r-wn(this.display))>.5||this.options.lineWrapping)&&xa(this),be(this,"refresh",this)}),swapDoc:Xt(function(r){var i=this.doc;return i.cm=null,this.state.selectingText&&this.state.selectingText(),ko(this,r),ii(this),this.display.input.reset(),oi(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,Gt(this,"swapDoc",this,i),i}),phrase:function(r){var i=this.options.phrases;return i&&Object.prototype.hasOwnProperty.call(i,r)?i[r]:r},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},ae(e),e.registerHelper=function(r,i,x){n.hasOwnProperty(r)||(n[r]=e[r]={_global:[]}),n[r][i]=x},e.registerGlobalHelper=function(r,i,x,k){e.registerHelper(r,i,k),n[r]._global.push({pred:x,val:k})}}function za(e,t,n,r,i){var x=t,k=n,j=nt(e,t.line),H=i&&e.direction=="rtl"?-n:n;function z(){var Je=t.line+H;return Je<e.first||Je>=e.first+e.size?!1:(t=new ke(Je,t.ch,t.sticky),j=nt(e,Je))}function $(Je){var Ke;if(r=="codepoint"){var et=j.text.charCodeAt(t.ch+(r>0?0:-1));isNaN(et)?Ke=null:Ke=new ke(t.line,Math.max(0,Math.min(j.text.length,t.ch+n*(et>=55296&&et<56320?2:1))),-n)}else i?Ke=kl(e.cm,j,t,n):Ke=Na(j,t,n);if(Ke==null)if(!Je&&z())t=Fa(i,e.cm,j,t.line,H);else return!1;else t=Ke;return!0}if(r=="char"||r=="codepoint")$();else if(r=="column")$(!0);else if(r=="word"||r=="group")for(var re=null,me=r=="group",fe=e.cm&&e.cm.getHelper(t,"wordChars"),Te=!0;!(n<0&&!$(!Te));Te=!1){var Re=j.text.charAt(t.ch)||`
`,Ue=Ie(Re,fe)?"w":me&&Re==`
`?"n":!me||/\s/.test(Re)?null:"p";if(me&&!Te&&!Ue&&(Ue="s"),re&&re!=Ue){n<0&&(n=1,$(),t.sticky="after");break}if(Ue&&(re=Ue),n>0&&!$(!Te))break}var We=Ji(e,t,x,k,!0);return Gn(x,We)&&(We.hitSide=!0),We}function Ls(e,t,n,r){var i=e.doc,x=t.left,k;if(r=="page"){var j=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),H=Math.max(j-.5*wn(e.display),3);k=(n>0?t.bottom:t.top)+n*H}else r=="line"&&(k=n>0?t.bottom+3:t.top-3);for(var z;!(z=va(e,x,k),!z.outside);){if(n<0?k<=0:k>=i.height){z.hitSide=!0;break}k+=n*5}return z}var wt=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new ee,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};wt.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;ws(i,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function x(j){for(var H=j.target;H;H=H.parentNode){if(H==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(H.className))break}return!1}ye(i,"paste",function(j){if(!x(j)||Pe(r,j)||Ts(j,r))return;B<=11&&setTimeout(jt(r,function(){return t.updateFromDOM()}),20)}),ye(i,"compositionstart",function(j){t.composing={data:j.data,done:!1}}),ye(i,"compositionupdate",function(j){t.composing||(t.composing={data:j.data,done:!1})}),ye(i,"compositionend",function(j){t.composing&&(j.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),ye(i,"touchstart",function(){return n.forceCompositionEnd()}),ye(i,"input",function(){t.composing||t.readFromDOMSoon()});function k(j){if(!x(j)||Pe(r,j))return;if(r.somethingSelected())ta({lineWise:!1,text:r.getSelections()}),j.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var H=Cs(r);ta({lineWise:!0,text:H.text}),j.type=="cut"&&r.operation(function(){r.setSelections(H.ranges,0,ge),r.replaceSelection("",null,"cut")})}else return;if(j.clipboardData){j.clipboardData.clearData();var z=Sr.text.join(`
`);if(j.clipboardData.setData("Text",z),j.clipboardData.getData("Text")==z){j.preventDefault();return}}var $=Ds(),re=$.firstChild;r.display.lineSpace.insertBefore($,r.display.lineSpace.firstChild),re.value=Sr.text.join(`
`);var me=document.activeElement;V(re),setTimeout(function(){r.display.lineSpace.removeChild($),me.focus(),me==i&&n.showPrimarySelection()},50)}ye(i,"copy",k),ye(i,"cut",k)},wt.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},wt.prototype.prepareSelection=function(){var e=po(this.cm,!1);return e.focus=document.activeElement==this.div,e},wt.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},wt.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},wt.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,n=t.doc.sel.primary(),r=n.from(),i=n.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||i.line<t.display.viewFrom){e.removeAllRanges();return}var x=ra(t,e.anchorNode,e.anchorOffset),k=ra(t,e.focusNode,e.focusOffset);if(x&&!x.bad&&k&&!k.bad&&dt(Zr(x,k),r)==0&&dt(vn(x,k),i)==0)return;var j=t.display.view,H=r.line>=t.display.viewFrom&&Rs(t,r)||{node:j[0].measure.map[2],offset:0},z=i.line<t.display.viewTo&&Rs(t,i);if(!z){var $=j[j.length-1].measure,re=$.maps?$.maps[$.maps.length-1]:$.map;z={node:re[re.length-1],offset:re[re.length-2]-re[re.length-3]}}if(!H||!z){e.removeAllRanges();return}var me=e.rangeCount&&e.getRangeAt(0),fe;try{fe=p(H.node,H.offset,z.offset,z.node)}catch(Te){}fe&&(!D&&t.state.focused?(e.collapse(H.node,H.offset),fe.collapsed||(e.removeAllRanges(),e.addRange(fe))):(e.removeAllRanges(),e.addRange(fe)),me&&e.anchorNode==null?e.addRange(me):D&&this.startGracePeriod()),this.rememberSelection()},wt.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)},wt.prototype.showMultipleSelections=function(e){s(this.cm.display.cursorDiv,e.cursors),s(this.cm.display.selectionDiv,e.selection)},wt.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},wt.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return b(this.div,t)},wt.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},wt.prototype.blur=function(){this.div.blur()},wt.prototype.getField=function(){return this.div},wt.prototype.supportsTouch=function(){return!0},wt.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():or(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)},wt.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},wt.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(d&&g&&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 n=ra(t,e.anchorNode,e.anchorOffset),r=ra(t,e.focusNode,e.focusOffset);n&&r&&or(t,function(){Qt(t.doc,zr(n,r),ge),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)})},wt.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,n=e.doc.sel.primary(),r=n.from(),i=n.to();if(r.ch==0&&r.line>e.firstLine()&&(r=ke(r.line-1,nt(e.doc,r.line-1).length)),i.ch==nt(e.doc,i.line).text.length&&i.line<e.lastLine()&&(i=ke(i.line+1,0)),r.line<t.viewFrom||i.line>t.viewTo-1)return!1;var x,k,j;r.line==t.viewFrom||(x=sn(e,r.line))==0?(k=At(t.view[0].line),j=t.view[0].node):(k=At(t.view[x].line),j=t.view[x-1].node.nextSibling);var H=sn(e,i.line),z,$;if(H==t.view.length-1?(z=t.viewTo-1,$=t.lineDiv.lastChild):(z=At(t.view[H+1].line)-1,$=t.view[H+1].node.previousSibling),!j)return!1;for(var re=e.doc.splitLines(tu(e,j,$,k,z)),me=Mr(e.doc,ke(k,0),ke(z,nt(e.doc,z).text.length));re.length>1&&me.length>1;)if(Ee(re)==Ee(me))re.pop(),me.pop(),z--;else if(re[0]==me[0])re.shift(),me.shift(),k++;else break;for(var fe=0,Te=0,Re=re[0],Ue=me[0],We=Math.min(Re.length,Ue.length);fe<We&&Re.charCodeAt(fe)==Ue.charCodeAt(fe);)++fe;for(var Je=Ee(re),Ke=Ee(me),et=Math.min(Je.length-(re.length==1?fe:0),Ke.length-(me.length==1?fe:0));Te<et&&Je.charCodeAt(Je.length-Te-1)==Ke.charCodeAt(Ke.length-Te-1);)++Te;if(re.length==1&&me.length==1&&k==r.line)for(;fe&&fe>r.ch&&Je.charCodeAt(Je.length-Te-1)==Ke.charCodeAt(Ke.length-Te-1);)fe--,Te++;re[re.length-1]=Je.slice(0,Je.length-Te).replace(/^\u200b+/,""),re[0]=re[0].slice(fe).replace(/\u200b+$/,"");var ut=ke(k,fe),ot=ke(z,me.length?Ee(me).length-Te:0);if(re.length>1||re[0]||dt(ut,ot))return kn(e.doc,re,ut,ot,"+input"),!0},wt.prototype.ensurePolled=function(){this.forceCompositionEnd()},wt.prototype.reset=function(){this.forceCompositionEnd()},wt.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},wt.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)},wt.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&or(this.cm,function(){return tr(e.cm)})},wt.prototype.setUneditable=function(e){e.contentEditable="false"},wt.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||jt(this.cm,Ga)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},wt.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},wt.prototype.onContextMenu=function(){},wt.prototype.resetPosition=function(){},wt.prototype.needsContentAttribute=!0;function Rs(e,t){var n=ha(e,t.line);if(!n||n.hidden)return null;var r=nt(e.doc,t.line),i=eo(n,r,t.line),x=Xe(r,e.doc.direction),k="left";if(x){var j=Ge(x,t.ch);k=j%2?"right":"left"}var H=no(i.map,t.ch,k);return H.offset=H.collapse=="right"?H.end:H.start,H}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Fn(e,t){return t&&(e.bad=!0),e}function tu(e,t,n,r,i){var x="",k=!1,j=e.doc.lineSeparator(),H=!1;function z(fe){return function(Te){return Te.id==fe}}function $(){k&&(x+=j,H&&(x+=j),k=H=!1)}function re(fe){fe&&($(),x+=fe)}function me(fe){if(fe.nodeType==1){var Te=fe.getAttribute("cm-text");if(Te){re(Te);return}var Re=fe.getAttribute("cm-marker"),Ue;if(Re){var We=e.findMarks(ke(r,0),ke(i+1,0),z(+Re));We.length&&(Ue=We[0].find(0))&&re(Mr(e.doc,Ue.from,Ue.to).join(j));return}if(fe.getAttribute("contenteditable")=="false")return;var Je=/^(pre|div|p|li|table|br)$/i.test(fe.nodeName);if(!/^br$/i.test(fe.nodeName)&&fe.textContent.length==0)return;Je&&$();for(var Ke=0;Ke<fe.childNodes.length;Ke++)me(fe.childNodes[Ke]);/^(pre|p)$/i.test(fe.nodeName)&&(H=!0),Je&&(k=!0)}else fe.nodeType==3&&re(fe.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(me(t),t==n);)t=t.nextSibling,H=!1;return x}function ra(e,t,n){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[n],!r)return Fn(e.clipPos(ke(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var x=e.display.view[i];if(x.node==r)return ru(x,t,n)}}function ru(e,t,n){var r=e.text.firstChild,i=!1;if(!t||!b(r,t))return Fn(ke(At(e.line),0),!0);if(t==r&&(i=!0,t=r.childNodes[n],n=0,!t)){var x=e.rest?Ee(e.rest):e.line;return Fn(ke(At(x),x.text.length),i)}var k=t.nodeType==3?t:null,j=t;for(!k&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(k=t.firstChild,n&&(n=k.nodeValue.length));j.parentNode!=r;)j=j.parentNode;var H=e.measure,z=H.maps;function $(Ue,We,Je){for(var Ke=-1;Ke<(z?z.length:0);Ke++)for(var et=Ke<0?H.map:z[Ke],ut=0;ut<et.length;ut+=3){var ot=et[ut+2];if(ot==Ue||ot==We){var mt=At(Ke<0?e.line:e.rest[Ke]),Lt=et[ut]+Je;return(Je<0||ot!=Ue)&&(Lt=et[ut+(Je?1:0)]),ke(mt,Lt)}}}var re=$(k,j,n);if(re)return Fn(re,i);for(var me=j.nextSibling,fe=k?k.nodeValue.length-n:0;me;me=me.nextSibling){if(re=$(me,me.firstChild,0),re)return Fn(ke(re.line,re.ch-fe),i);fe+=me.textContent.length}for(var Te=j.previousSibling,Re=n;Te;Te=Te.previousSibling){if(re=$(Te,Te.firstChild,-1),re)return Fn(ke(re.line,re.ch+Re),i);Re+=Te.textContent.length}}var Pt=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new ee,this.hasSelection=!1,this.composing=null};Pt.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var i=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),A&&(i.style.width="0px"),ye(i,"input",function(){U&&B>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()}),ye(i,"paste",function(k){if(Pe(r,k)||Ts(k,r))return;r.state.pasteIncoming=+new Date,n.fastPoll()});function x(k){if(Pe(r,k))return;if(r.somethingSelected())ta({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var j=Cs(r);ta({lineWise:!0,text:j.text}),k.type=="cut"?r.setSelections(j.ranges,null,ge):(n.prevInput="",i.value=j.text.join(`
`),V(i))}else return;k.type=="cut"&&(r.state.cutIncoming=+new Date)}ye(i,"cut",x),ye(i,"copy",x),ye(e.scroller,"paste",function(k){if(Nr(e,k)||Pe(r,k))return;if(!i.dispatchEvent){r.state.pasteIncoming=+new Date,n.focus();return}var j=new Event("paste");j.clipboardData=k.clipboardData,i.dispatchEvent(j)}),ye(e.lineSpace,"selectstart",function(k){Nr(e,k)||Y(k)}),ye(i,"compositionstart",function(){var k=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:k,range:r.markText(k,r.getCursor("to"),{className:"CodeMirror-composing"})}}),ye(i,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},Pt.prototype.createField=function(e){this.wrapper=Ds(),this.textarea=this.wrapper.firstChild},Pt.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Pt.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=po(e);if(e.options.moveInputWithCursor){var i=Ar(e,n.sel.primary().head,"div"),x=t.wrapper.getBoundingClientRect(),k=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+k.top-x.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+k.left-x.left))}return r},Pt.prototype.showSelection=function(e){var t=this.cm,n=t.display;s(n.cursorDiv,e.cursors),s(n.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Pt.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&V(this.textarea),U&&B>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",U&&B>=9&&(this.hasSelection=null))},Pt.prototype.getField=function(){return this.textarea},Pt.prototype.supportsTouch=function(){return!1},Pt.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!o||O()!=this.textarea))try{this.textarea.focus()}catch(e){}},Pt.prototype.blur=function(){this.textarea.blur()},Pt.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Pt.prototype.receivedFocus=function(){this.slowPoll()},Pt.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()})},Pt.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function n(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,n)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,n)},Pt.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||st(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(U&&B>=9&&this.hasSelection===i||l&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var x=i.charCodeAt(0);if(x==8203&&!r&&(r="\u200B"),x==8666)return this.reset(),this.cm.execCommand("undo")}for(var k=0,j=Math.min(r.length,i.length);k<j&&r.charCodeAt(k)==i.charCodeAt(k);)++k;return or(t,function(){Ga(t,i.slice(k),r.length-k,null,e.composing?"*compose":null),i.length>1e3||i.indexOf(`
`)>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Pt.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Pt.prototype.onKeyPress=function(){U&&B>=9&&(this.hasSelection=null),this.fastPoll()},Pt.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var x=on(n,e),k=r.scroller.scrollTop;if(!x||T)return;var j=n.options.resetSelectionOnContextMenu;j&&n.doc.sel.contains(x)==-1&&jt(n,Qt)(n.doc,zr(x),ge);var H=i.style.cssText,z=t.wrapper.style.cssText,$=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",i.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(e.clientY-$.top-5)+"px; left: "+(e.clientX-$.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 re;I&&(re=window.scrollY),r.input.focus(),I&&window.scrollTo(null,re),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=fe,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll);function me(){if(i.selectionStart!=null){var Re=n.somethingSelected(),Ue="\u200B"+(Re?i.value:"");i.value="\u21DA",i.value=Ue,t.prevInput=Re?"":"\u200B",i.selectionStart=1,i.selectionEnd=Ue.length,r.selForContextMenu=n.doc.sel}}function fe(){if(t.contextMenuPending!=fe)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=z,i.style.cssText=H,U&&B<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=k),i.selectionStart!=null){(!U||U&&B<9)&&me();var Re=0,Ue=function(){r.selForContextMenu==n.doc.sel&&i.selectionStart==0&&i.selectionEnd>0&&t.prevInput=="\u200B"?jt(n,Qo)(n):Re++<10?r.detectingSelectAll=setTimeout(Ue,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(Ue,200)}}if(U&&B>=9&&me(),w){te(e);var Te=function(){Ve(window,"mouseup",Te),setTimeout(fe,20)};ye(window,"mouseup",Te)}else setTimeout(fe,50)},Pt.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Pt.prototype.setUneditable=function(){},Pt.prototype.needsContentAttribute=!1;function nu(e,t){if(t=t?_(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 n=O();t.autofocus=n==e||e.getAttribute("autofocus")!=null&&n==document.body}function r(){e.value=j.getValue()}var i;if(e.form&&(ye(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var x=e.form;i=x.submit;try{var k=x.submit=function(){r(),x.submit=i,x.submit(),x.submit=k}}catch(H){}}t.finishInit=function(H){H.save=r,H.getTextArea=function(){return e},H.toTextArea=function(){H.toTextArea=isNaN,r(),e.parentNode.removeChild(H.getWrapperElement()),e.style.display="",e.form&&(Ve(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=i))}},e.style.display="none";var j=Rt(function(H){return e.parentNode.insertBefore(H,e.nextSibling)},t);return j}function iu(e){e.off=Ve,e.on=ye,e.wheelEventPixels=cl,e.Doc=rr,e.splitLines=ht,e.countColumn=J,e.findColumn=he,e.isWordChar=Se,e.Pass=Ce,e.signal=be,e.Line=rn,e.changeEnd=Vr,e.scrollbarModel=To,e.Pos=ke,e.cmpPos=dt,e.modes=Bt,e.mimeModes=Et,e.resolveMode=lr,e.getMode=pr,e.modeExtensions=fr,e.extendMode=ia,e.copyState=wr,e.startState=Hn,e.innerMode=Kn,e.commands=xi,e.keyMap=Fr,e.keyName=us,e.isModifierKey=ss,e.lookupKey=Bn,e.normalizeKeyMap=Pl,e.StringStream=Ot,e.SharedTextMarker=yi,e.TextMarker=Yr,e.LineWidget=vi,e.e_preventDefault=Y,e.e_stopPropagation=X,e.e_stop=te,e.addClass=N,e.contains=b,e.rmClass=f,e.keyNames=Jr}Jl(Rt),$l(Rt);var au="iter insert remove copy getEditor constructor".split(" ");for(var na in rr.prototype)rr.prototype.hasOwnProperty(na)&&oe(au,na)<0&&(Rt.prototype[na]=function(e){return function(){return e.apply(this.doc,arguments)}}(rr.prototype[na]));return ae(rr),Rt.inputStyles={textarea:Pt,contenteditable:wt},Rt.defineMode=function(e){!Rt.defaults.mode&&e!="null"&&(Rt.defaults.mode=e),Cr.apply(this,arguments)},Rt.defineMIME=Or,Rt.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Rt.defineMIME("text/plain","null"),Rt.defineExtension=function(e,t){Rt.prototype[e]=t},Rt.defineDocExtension=function(e,t){rr.prototype[e]=t},Rt.fromTextArea=nu,iu(Rt),Rt.version="5.58.2",Rt})},W1YM:function(we,Ae,Q){},W6BS:function(we,Ae){we.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAA4CAYAAACohjseAAAVs0lEQVRoQ+2aa6xlZ3nff++677Xv+9zPHM/YHo+xwQ4E14GKKESkiFsSM8bYQBIEkaBEAkqbRmo/9FulSoX2Qz9GVVQJqUJBhKKA1KRJCIlowwdDDDa+jOd65syc275f1v1d1fOufYYE2ZhJZKRWXjOjvffaa6/1/p//8/yfyzuqLMuS/48P9RrA/8fZfY3B2yXQBHQpf185tBUK+SvH8uV2H/eK1/+jGfwRIBC5ks/Vq/yplq2Wqz+B/ONg5LNlrlz+Qhnot373iih+wgX/YIAivrJgjTKA9BKcYa/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rrMeHzIjck+2eiA65OYdrjOPace5NzOw/hO10zW5ZDm27VDUxdLnMtwOctSk+NqtYDNzU3W1tfpdbvm2pc6bgE0u7IvsRUs56M4Yj6dmfJrOhwyGE8YjkaMxkNmszlpLDGbkeUx02RAlC2Y5UeUSZ+pdYyaz1k4Y9OdhE4D5dVoB6dZWbuLlneaXm2DPC1NR5BGCbF0CWVJEAQ0GnXanTb1sE69Xmdzc4uNjQ1ardZy4+dlN3fNF6+4R/9SP5eHJ0nMYhEh8TscDun3+0aoJuMJi8WCJMnRZgRZkJOR5FMKvWBz/QyN2gqqsEjTBE1q7iU5znZsfN83i2+32zSbTXq9HisrK6yurtJoNH4ympf49rYAvhzL1b5JSZqmZqGTyZT+4Jj+cd+4+mg4Yh7F5Kk0xqK4Jb7rVP87w1KGpU6nR6vVNMAEkPzrdDqGxX/McVsAb/dBsh0mKWgxnzMajxgOhhwf9+n3j5nNZ7RbbbrdrgElYE5Aua57u4962etfNYAvx7YISJIkxrXFxdvtlnFJW+Yiy+MnecrtIn/VAN7uQl6t618D+GpZ9md139cY/FlZ+tV6zmsMvlqW/Vnd9/8CAe3hZpCQX/4AAAAASUVORK5CYII="},Xsq0:function(we,Ae,Q){we.exports=Q.p+"static/mainbanner.0a951716.jpg"},Y1PL:function(we,Ae,Q){"use strict";Q.r(Ae),Q.d(Ae,"ResizableTextArea",function(){return oe});var q=Q("wx14"),G=Q("1OyB"),D=Q("vuIU"),K=Q("Ji7U"),P=Q("LK+K"),M=Q("cDcd"),U=Q("VTBJ"),B=Q("rePB"),I=Q("Zm9Q"),R=Q("Kwbf"),g=Q("c+Xe"),T=Q("m+aA"),L=Q("bdgK"),C=new Map;function S(ge){ge.forEach(function(pe){var ce,he=pe.target;(ce=C.get(he))===null||ce===void 0||ce.forEach(function(ne){return ne(he)})})}var A=new L.default(S),d=null,o=null;function l(ge,pe){C.has(ge)||(C.set(ge,new Set),A.observe(ge)),C.get(ge).add(pe)}function u(ge,pe){C.has(ge)&&(C.get(ge).delete(pe),C.get(ge).size||(A.unobserve(ge),C.delete(ge)))}var y=function(ge){Object(K.a)(ce,ge);var pe=Object(P.a)(ce);function ce(){return Object(G.a)(this,ce),pe.apply(this,arguments)}return Object(D.a)(ce,[{key:"render",value:function(){return this.props.children}}]),ce}(M.Component),m=M.createContext(null);function h(ge){var pe=ge.children,ce=ge.onBatchResize,he=M.useRef(0),ne=M.useRef([]),ue=M.useContext(m),Ee=M.useCallback(function(_e,Oe,Ne){he.current+=1;var je=he.current;ne.current.push({size:_e,element:Oe,data:Ne}),Promise.resolve().then(function(){je===he.current&&(ce==null||ce(ne.current),ne.current=[])}),ue==null||ue(_e,Oe,Ne)},[ce,ue]);return M.createElement(m.Provider,{value:Ee},pe)}function w(ge){var pe=ge.children,ce=ge.disabled,he=M.useRef(null),ne=M.useRef(null),ue=M.useContext(m),Ee=M.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),_e=M.isValidElement(pe)&&Object(g.c)(pe),Oe=_e?pe.ref:null,Ne=M.useMemo(function(){return Object(g.a)(Oe,he)},[Oe,he]),je=M.useRef(ge);je.current=ge;var xe=M.useCallback(function(Se){var Ie=je.current,Fe=Ie.onResize,He=Ie.data,Me=Se.getBoundingClientRect(),Le=Me.width,qe=Me.height,Ze=Se.offsetWidth,ze=Se.offsetHeight,Ge=Math.floor(Le),tt=Math.floor(qe);if(Ee.current.width!==Ge||Ee.current.height!==tt||Ee.current.offsetWidth!==Ze||Ee.current.offsetHeight!==ze){var Xe={width:Ge,height:tt,offsetWidth:Ze,offsetHeight:ze};Ee.current=Xe;var Ye=Ze===Math.round(Le)?Le:Ze,ye=ze===Math.round(qe)?qe:ze,$e=Object(U.a)(Object(U.a)({},Xe),{},{offsetWidth:Ye,offsetHeight:ye});ue==null||ue($e,Se,He),Fe&&Promise.resolve().then(function(){Fe($e,Se)})}},[]);return M.useEffect(function(){var Se=Object(T.a)(he.current)||Object(T.a)(ne.current);return Se&&!ce&&l(Se,xe),function(){return u(Se,xe)}},[he.current,ce]),M.createElement(y,{ref:ne},_e?M.cloneElement(pe,{ref:Ne}):pe)}var E="rc-observer-key";function f(ge){var pe=ge.children,ce=Object(I.a)(pe);return ce.map(function(he,ne){var ue=(he==null?void 0:he.key)||"".concat(E,"-").concat(ne);return M.createElement(w,Object(q.a)({},ge,{key:ue}),he)})}f.Collection=h;var c=f,s=Q("bT9E"),a=Q("TSYQ"),v=Q.n(a),p=`
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
`,b=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],O={},N;function W(ge){var pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ce=ge.getAttribute("id")||ge.getAttribute("data-reactid")||ge.getAttribute("name");if(pe&&O[ce])return O[ce];var he=window.getComputedStyle(ge),ne=he.getPropertyValue("box-sizing")||he.getPropertyValue("-moz-box-sizing")||he.getPropertyValue("-webkit-box-sizing"),ue=parseFloat(he.getPropertyValue("padding-bottom"))+parseFloat(he.getPropertyValue("padding-top")),Ee=parseFloat(he.getPropertyValue("border-bottom-width"))+parseFloat(he.getPropertyValue("border-top-width")),_e=b.map(function(Ne){return"".concat(Ne,":").concat(he.getPropertyValue(Ne))}).join(";"),Oe={sizingStyle:_e,paddingSize:ue,borderSize:Ee,boxSizing:ne};return pe&&ce&&(O[ce]=Oe),Oe}function V(ge){var pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ce=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,he=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;N||(N=document.createElement("textarea"),N.setAttribute("tab-index","-1"),N.setAttribute("aria-hidden","true"),document.body.appendChild(N)),ge.getAttribute("wrap")?N.setAttribute("wrap",ge.getAttribute("wrap")):N.removeAttribute("wrap");var ne=W(ge,pe),ue=ne.paddingSize,Ee=ne.borderSize,_e=ne.boxSizing,Oe=ne.sizingStyle;N.setAttribute("style","".concat(Oe,";").concat(p)),N.value=ge.value||ge.placeholder||"";var Ne=Number.MIN_SAFE_INTEGER,je=Number.MAX_SAFE_INTEGER,xe=N.scrollHeight,Se;if(_e==="border-box"?xe+=Ee:_e==="content-box"&&(xe-=ue),ce!==null||he!==null){N.value=" ";var Ie=N.scrollHeight-ue;ce!==null&&(Ne=Ie*ce,_e==="border-box"&&(Ne=Ne+ue+Ee),xe=Math.max(Ne,xe)),he!==null&&(je=Ie*he,_e==="border-box"&&(je=je+ue+Ee),Se=xe>je?"":"hidden",xe=Math.min(je,xe))}return{height:xe,minHeight:Ne,maxHeight:je,overflowY:Se,resize:"none"}}var F=Q("Gytx"),_=Q.n(F),J;(function(ge){ge[ge.NONE=0]="NONE",ge[ge.RESIZING=1]="RESIZING",ge[ge.RESIZED=2]="RESIZED"})(J||(J={}));var ee=function(ge){Object(K.a)(ce,ge);var pe=Object(P.a)(ce);function ce(he){var ne;return Object(G.a)(this,ce),ne=pe.call(this,he),ne.nextFrameActionId=void 0,ne.resizeFrameId=void 0,ne.textArea=void 0,ne.saveTextArea=function(ue){ne.textArea=ue},ne.handleResize=function(ue){var Ee=ne.state.resizeStatus,_e=ne.props,Oe=_e.autoSize,Ne=_e.onResize;if(Ee!==J.NONE)return;typeof Ne=="function"&&Ne(ue),Oe&&ne.resizeOnNextFrame()},ne.resizeOnNextFrame=function(){cancelAnimationFrame(ne.nextFrameActionId),ne.nextFrameActionId=requestAnimationFrame(ne.resizeTextarea)},ne.resizeTextarea=function(){var ue=ne.props.autoSize;if(!ue||!ne.textArea)return;var Ee=ue.minRows,_e=ue.maxRows,Oe=V(ne.textArea,!1,Ee,_e);ne.setState({textareaStyles:Oe,resizeStatus:J.RESIZING},function(){cancelAnimationFrame(ne.resizeFrameId),ne.resizeFrameId=requestAnimationFrame(function(){ne.setState({resizeStatus:J.RESIZED},function(){ne.resizeFrameId=requestAnimationFrame(function(){ne.setState({resizeStatus:J.NONE}),ne.fixFirefoxAutoScroll()})})})})},ne.renderTextArea=function(){var ue=ne.props,Ee=ue.prefixCls,_e=Ee===void 0?"rc-textarea":Ee,Oe=ue.autoSize,Ne=ue.onResize,je=ue.className,xe=ue.disabled,Se=ne.state,Ie=Se.textareaStyles,Fe=Se.resizeStatus,He=Object(s.a)(ne.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Me=v()(_e,je,Object(B.a)({},"".concat(_e,"-disabled"),xe));"value"in He&&(He.value=He.value||"");var Le=Object(U.a)(Object(U.a)(Object(U.a)({},ne.props.style),Ie),Fe===J.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return M.createElement(c,{onResize:ne.handleResize,disabled:!(Oe||Ne)},M.createElement("textarea",Object(q.a)({},He,{className:Me,style:Le,ref:ne.saveTextArea})))},ne.state={textareaStyles:{},resizeStatus:J.NONE},ne}return Object(D.a)(ce,[{key:"componentDidUpdate",value:function(ne){(ne.value!==this.props.value||!_()(ne.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 ne=this.textArea.selectionStart,ue=this.textArea.selectionEnd;this.textArea.setSelectionRange(ne,ue)}}catch(Ee){}}},{key:"render",value:function(){return this.renderTextArea()}}]),ce}(M.Component),oe=ee,de=function(ge){Object(K.a)(ce,ge);var pe=Object(P.a)(ce);function ce(he){var ne;Object(G.a)(this,ce),ne=pe.call(this,he),ne.resizableTextArea=void 0,ne.focus=function(){ne.resizableTextArea.textArea.focus()},ne.saveTextArea=function(Ee){ne.resizableTextArea=Ee},ne.handleChange=function(Ee){var _e=ne.props.onChange;ne.setValue(Ee.target.value,function(){ne.resizableTextArea.resizeTextarea()}),_e&&_e(Ee)},ne.handleKeyDown=function(Ee){var _e=ne.props,Oe=_e.onPressEnter,Ne=_e.onKeyDown;Ee.keyCode===13&&Oe&&Oe(Ee),Ne&&Ne(Ee)};var ue=typeof he.value=="undefined"||he.value===null?he.defaultValue:he.value;return ne.state={value:ue},ne}return Object(D.a)(ce,[{key:"setValue",value:function(ne,ue){"value"in this.props||this.setState({value:ne},ue)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return M.createElement(oe,Object(q.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(ne){return"value"in ne?{value:ne.value}:null}}]),ce}(M.Component),Ce=Ae.default=de},ZpRC:function(we,Ae,Q){"use strict";function q(g){return typeof g=="object"&&g!=null&&g.nodeType===1}function G(g,T){return(!T||g!=="hidden")&&g!=="visible"&&g!=="clip"}function D(g,T){if(g.clientHeight<g.scrollHeight||g.clientWidth<g.scrollWidth){var L=getComputedStyle(g,null);return G(L.overflowY,T)||G(L.overflowX,T)||function(C){var S=function(A){if(!A.ownerDocument||!A.ownerDocument.defaultView)return null;try{return A.ownerDocument.defaultView.frameElement}catch(d){return null}}(C);return!!S&&(S.clientHeight<C.scrollHeight||S.clientWidth<C.scrollWidth)}(g)}return!1}function K(g,T,L,C,S,A,d,o){return A<g&&d>T||A>g&&d<T?0:A<=g&&o<=L||d>=T&&o>=L?A-g-C:d>T&&o<L||A<g&&o>L?d-T+S:0}var P=function(g,T){var L=window,C=T.scrollMode,S=T.block,A=T.inline,d=T.boundary,o=T.skipOverflowHiddenElements,l=typeof d=="function"?d:function(Ie){return Ie!==d};if(!q(g))throw new TypeError("Invalid target");for(var u=document.scrollingElement||document.documentElement,y=[],m=g;q(m)&&l(m);){if((m=m.parentElement)===u){y.push(m);break}m!=null&&m===document.body&&D(m)&&!D(document.documentElement)||m!=null&&D(m,o)&&y.push(m)}for(var h=L.visualViewport?L.visualViewport.width:innerWidth,w=L.visualViewport?L.visualViewport.height:innerHeight,E=window.scrollX||pageXOffset,f=window.scrollY||pageYOffset,c=g.getBoundingClientRect(),s=c.height,a=c.width,v=c.top,p=c.right,b=c.bottom,O=c.left,N=S==="start"||S==="nearest"?v:S==="end"?b:v+s/2,W=A==="center"?O+a/2:A==="end"?p:O,V=[],F=0;F<y.length;F++){var _=y[F],J=_.getBoundingClientRect(),ee=J.height,oe=J.width,de=J.top,Ce=J.right,ge=J.bottom,pe=J.left;if(C==="if-needed"&&v>=0&&O>=0&&b<=w&&p<=h&&v>=de&&b<=ge&&O>=pe&&p<=Ce)return V;var ce=getComputedStyle(_),he=parseInt(ce.borderLeftWidth,10),ne=parseInt(ce.borderTopWidth,10),ue=parseInt(ce.borderRightWidth,10),Ee=parseInt(ce.borderBottomWidth,10),_e=0,Oe=0,Ne="offsetWidth"in _?_.offsetWidth-_.clientWidth-he-ue:0,je="offsetHeight"in _?_.offsetHeight-_.clientHeight-ne-Ee:0;if(u===_)_e=S==="start"?N:S==="end"?N-w:S==="nearest"?K(f,f+w,w,ne,Ee,f+N,f+N+s,s):N-w/2,Oe=A==="start"?W:A==="center"?W-h/2:A==="end"?W-h:K(E,E+h,h,he,ue,E+W,E+W+a,a),_e=Math.max(0,_e+f),Oe=Math.max(0,Oe+E);else{_e=S==="start"?N-de-ne:S==="end"?N-ge+Ee+je:S==="nearest"?K(de,ge,ee,ne,Ee+je,N,N+s,s):N-(de+ee/2)+je/2,Oe=A==="start"?W-pe-he:A==="center"?W-(pe+oe/2)+Ne/2:A==="end"?W-Ce+ue+Ne:K(pe,Ce,oe,he,ue+Ne,W,W+a,a);var xe=_.scrollLeft,Se=_.scrollTop;N+=Se-(_e=Math.max(0,Math.min(Se+_e,_.scrollHeight-ee+je))),W+=xe-(Oe=Math.max(0,Math.min(xe+Oe,_.scrollWidth-oe+Ne)))}V.push({el:_,top:_e,left:Oe})}return V};function M(g){return g===Object(g)&&Object.keys(g).length!==0}function U(g,T){T===void 0&&(T="auto");var L="scrollBehavior"in document.body.style;g.forEach(function(C){var S=C.el,A=C.top,d=C.left;S.scroll&&L?S.scroll({top:A,left:d,behavior:T}):(S.scrollTop=A,S.scrollLeft=d)})}function B(g){return g===!1?{block:"end",inline:"nearest"}:M(g)?g:{block:"start",inline:"nearest"}}function I(g,T){var L=!g.ownerDocument.documentElement.contains(g);if(M(T)&&typeof T.behavior=="function")return T.behavior(L?[]:P(g,T));if(L)return;var C=B(T);return U(P(g,C),C.behavior)}var R=Ae.a=I},bT9E:function(we,Ae,Q){"use strict";Q.d(Ae,"a",function(){return G});var q=Q("VTBJ");function G(D,K){var P=Object(q.a)({},D);return Array.isArray(K)&&K.forEach(function(M){delete P[M]}),P}},c5Ni:function(we,Ae,Q){},cRFk:function(we,Ae,Q){we.exports=Q.p+"static/RepositoryNoneData.828085a8.png"},csWT:function(we,Ae,Q){we.exports=Q.p+"static/choose.4ad1045f.svg"},dejd:function(we,Ae,Q){},djh8:function(we,Ae,Q){we.exports=Q.p+"static/qrCode.42927872.png"},dmUQ:function(we,Ae,Q){"use strict";var q=Q("Ff2n"),G=Q("rePB"),D=Q("1OyB"),K=Q("vuIU"),P=Q("Ji7U"),M=Q("md7G"),U=Q("foSv"),B=Q("cDcd"),I=Q.n(B),R=Q("TSYQ"),g=Q.n(R),T=Q("4IlW");function L(s,a){var v=Object.keys(s);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(s);a&&(p=p.filter(function(b){return Object.getOwnPropertyDescriptor(s,b).enumerable})),v.push.apply(v,p)}return v}function C(s){for(var a=1;a<arguments.length;a++){var v=arguments[a]!=null?arguments[a]:{};a%2?L(Object(v),!0).forEach(function(p){Object(G.a)(s,p,v[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(v)):L(Object(v)).forEach(function(p){Object.defineProperty(s,p,Object.getOwnPropertyDescriptor(v,p))})}return s}function S(s){var a=A();return function(){var p=Object(U.a)(s),b;if(a){var O=Object(U.a)(this).constructor;b=Reflect.construct(p,arguments,O)}else b=p.apply(this,arguments);return Object(M.a)(this,b)}}function A(){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(s){return!1}}function d(){}function o(s){s.preventDefault()}var l=function(a){return a.replace(/[^\w.-]+/g,"")},u=200,y=600,m=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,h=function(a){return a!=null},w=function(a,v){return v===a||typeof v=="number"&&typeof a=="number"&&isNaN(v)&&isNaN(a)},E=function(s){Object(P.a)(v,s);var a=S(v);function v(p){var b;Object(D.a)(this,v),b=a.call(this,p),b.onKeyDown=function(W){var V=b.props,F=V.onKeyDown,_=V.onPressEnter;if(W.keyCode===T.a.UP){var J=b.getRatio(W);b.up(W,J,null),b.stop()}else if(W.keyCode===T.a.DOWN){var ee=b.getRatio(W);b.down(W,ee,null),b.stop()}else W.keyCode===T.a.ENTER&&_&&_(W);if(b.recordCursorPosition(),b.lastKeyCode=W.keyCode,F){for(var oe=arguments.length,de=new Array(oe>1?oe-1:0),Ce=1;Ce<oe;Ce++)de[Ce-1]=arguments[Ce];F.apply(void 0,[W].concat(de))}},b.onKeyUp=function(W){var V=b.props.onKeyUp;if(b.stop(),b.recordCursorPosition(),V){for(var F=arguments.length,_=new Array(F>1?F-1:0),J=1;J<F;J++)_[J-1]=arguments[J];V.apply(void 0,[W].concat(_))}},b.onChange=function(W){var V=b.props.onChange;b.state.focused&&(b.inputting=!0),b.rawInput=b.props.parser(b.getValueFromEvent(W)),b.setState({inputValue:b.rawInput}),V(b.toNumber(b.rawInput))},b.onMouseUp=function(){var W=b.props.onMouseUp;b.recordCursorPosition(),W&&W.apply(void 0,arguments)},b.onFocus=function(){var W;b.setState({focused:!0}),(W=b.props).onFocus.apply(W,arguments)},b.onBlur=function(){var W=b.props.onBlur;b.inputting=!1,b.setState({focused:!1});var V=b.getCurrentValidValue(b.state.inputValue),F=b.setValue(V,d);if(W){var _=b.input.value,J=b.getInputDisplayValue({focus:!1,value:F});b.input.value=J&&Number(J),W.apply(void 0,arguments),b.input.value=_}},b.getRatio=function(W){var V=1;return W.metaKey||W.ctrlKey?V=.1:W.shiftKey&&(V=10),V},b.getFullNum=function(W){return isNaN(W)?W:/e/i.test(String(W))?Number(W).toFixed(18).replace(/\.?0+$/,""):W},b.getPrecision=function(W){if(h(b.props.precision))return b.props.precision;var V=String(W);if(V.indexOf("e-")>=0)return parseInt(V.slice(V.indexOf("e-")+2),10);var F=0;return V.indexOf(".")>=0&&(F=V.length-V.indexOf(".")-1),F},b.getInputDisplayValue=function(W){var V=W||b.state,F=V.focused,_=V.inputValue,J=V.value,ee;F?ee=_:ee=b.toPrecisionAsStep(J),ee==null&&(ee="");var oe=b.formatWrapper(ee);return h(b.props.decimalSeparator)&&(oe=oe.toString().replace(".",b.props.decimalSeparator)),oe},b.recordCursorPosition=function(){try{b.cursorStart=b.input.selectionStart,b.cursorEnd=b.input.selectionEnd,b.currentValue=b.input.value,b.cursorBefore=b.input.value.substring(0,b.cursorStart),b.cursorAfter=b.input.value.substring(b.cursorEnd)}catch(W){}},b.restoreByAfter=function(W){if(W===void 0)return!1;var V=b.input.value,F=V.lastIndexOf(W);if(F===-1)return!1;var _=b.cursorBefore.length;return b.lastKeyCode===T.a.DELETE&&b.cursorBefore.charAt(_-1)===W[0]?(b.fixCaret(_,_),!0):F+W.length===V.length?(b.fixCaret(F,F),!0):!1},b.partRestoreByAfter=function(W){return W===void 0?!1:Array.prototype.some.call(W,function(V,F){var _=W.substring(F);return b.restoreByAfter(_)})},b.isNotCompleteNumber=function(W){return isNaN(W)||W===""||W===null||W&&W.toString().indexOf(".")===W.toString().length-1},b.stop=function(){b.autoStepTimer&&clearTimeout(b.autoStepTimer)},b.down=function(W,V,F){b.pressingUpOrDown=!0,b.step("down",W,V,F)},b.up=function(W,V,F){b.pressingUpOrDown=!0,b.step("up",W,V,F)},b.saveInput=function(W){b.input=W};var O=p.value;O===void 0&&(O=p.defaultValue),b.state={focused:p.autoFocus};var N=b.getValidValue(b.toNumber(O));return b.state=C(C({},b.state),{},{inputValue:b.toPrecisionAsStep(N),value:N}),b}return Object(K.a)(v,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(b){var O=this.props,N=O.value,W=O.onChange,V=O.max,F=O.min,_=this.state.focused;if(b){if(!w(b.value,N)||!w(b.max,V)||!w(b.min,F)){var J=_?N:this.getValidValue(N),ee;this.pressingUpOrDown?ee=J:this.inputting?ee=this.rawInput:ee=this.toPrecisionAsStep(J),this.setState({value:J,inputValue:ee})}var oe="value"in this.props?N:this.state.value;"max"in this.props&&b.max!==V&&typeof oe=="number"&&oe>V&&W&&W(V),"min"in this.props&&b.min!==F&&typeof oe=="number"&&oe<F&&W&&W(F)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var de=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===T.a.BACKSPACE?de=this.cursorStart-1:this.lastKeyCode===T.a.DELETE&&(de=this.cursorStart):de=this.input.value.length,this.fixCaret(de,de)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case T.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case T.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(Ce){}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(b){var O=b;return O===""?O="":this.isNotCompleteNumber(parseFloat(O))?O=this.state.value:O=this.getValidValue(O),this.toNumber(O)}},{key:"getValueFromEvent",value:function(b){var O=b.target.value.trim().replace(/。/g,".");return h(this.props.decimalSeparator)&&(O=O.replace(this.props.decimalSeparator,".")),O}},{key:"getValidValue",value:function(b){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,N=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,W=parseFloat(b);return isNaN(W)?b:(W<O&&(W=O),W>N&&(W=N),W)}},{key:"setValue",value:function(b,O){var N=this.props.precision,W=this.isNotCompleteNumber(parseFloat(b))?null:parseFloat(b),V=this.state.value,F=V===void 0?null:V,_=this.state.inputValue,J=_===void 0?null:_,ee=typeof W=="number"?W.toFixed(N):"".concat(W),oe=W!==F||ee!=="".concat(J);return"value"in this.props?(J=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:J},O)):this.setState({value:W,inputValue:this.toPrecisionAsStep(b)},O),oe&&this.props.onChange(W),W}},{key:"getMaxPrecision",value:function(b){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,N=this.props,W=N.precision,V=N.step;if(h(W))return W;var F=this.getPrecision(O),_=this.getPrecision(V),J=this.getPrecision(b);return b?Math.max(J,F+_):F+_}},{key:"getPrecisionFactor",value:function(b){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,N=this.getMaxPrecision(b,O);return Math.pow(10,N)}},{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(b){return this.props.formatter?this.props.formatter(b):b}},{key:"toPrecisionAsStep",value:function(b){if(this.isNotCompleteNumber(b)||b==="")return b;var O=Math.abs(this.getMaxPrecision(b));return isNaN(O)?b.toString():Number(b).toFixed(O)}},{key:"toNumber",value:function(b){var O=this.props.precision,N=this.state.focused,W=b&&b.length>16&&N;return this.isNotCompleteNumber(b)||W?b:h(O)?Math.round(b*Math.pow(10,O))/Math.pow(10,O):Number(b)}},{key:"upStep",value:function(b,O){var N=this.props.step,W=this.getPrecisionFactor(b,O),V=Math.abs(this.getMaxPrecision(b,O)),F=((W*b+W*N*O)/W).toFixed(V);return this.toNumber(F)}},{key:"downStep",value:function(b,O){var N=this.props.step,W=this.getPrecisionFactor(b,O),V=Math.abs(this.getMaxPrecision(b,O)),F=((W*b-W*N*O)/W).toFixed(V);return this.toNumber(F)}},{key:"step",value:function(b,O){var N=this,W=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,V=arguments.length>3?arguments[3]:void 0;this.stop(),O&&(O.persist(),O.preventDefault());var F=this.props;if(F.disabled)return;var _=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(_))return;var J=this["".concat(b,"Step")](_,W),ee=J>F.max||J<F.min;if(J>F.max?J=F.max:J<F.min&&(J=F.min),this.setValue(J,null),this.setState({focused:!0},function(){N.pressingUpOrDown=!1}),ee)return;this.autoStepTimer=setTimeout(function(){N[b](O,W,!0)},V?u:y)}},{key:"fixCaret",value:function(b,O){if(b===void 0||O===void 0||!this.input||!this.input.value)return;try{var N=this.input.selectionStart,W=this.input.selectionEnd;(b!==N||O!==W)&&this.input.setSelectionRange(b,O)}catch(V){}}},{key:"render",value:function(){var b,O=this.props,N=O.prefixCls,W=O.disabled,V=O.readOnly,F=O.useTouch,_=O.autoComplete,J=O.upHandler,ee=O.downHandler,oe=O.className,de=O.max,Ce=O.min,ge=O.style,pe=O.title,ce=O.onMouseEnter,he=O.onMouseLeave,ne=O.onMouseOver,ue=O.onMouseOut,Ee=O.required,_e=O.onClick,Oe=O.tabIndex,Ne=O.type,je=O.placeholder,xe=O.id,Se=O.inputMode,Ie=O.pattern,Fe=O.step,He=O.maxLength,Me=O.autoFocus,Le=O.name,qe=O.onPaste,Ze=O.onInput,ze=Object(q.a)(O,["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"]),Ge=this.state,tt=Ge.value,Xe=Ge.focused,Ye=g()(N,(b={},Object(G.a)(b,oe,!!oe),Object(G.a)(b,"".concat(N,"-disabled"),W),Object(G.a)(b,"".concat(N,"-focused"),Xe),b)),ye={};Object.keys(ze).forEach(function(te){(te.substr(0,5)==="data-"||te.substr(0,5)==="aria-"||te==="role")&&(ye[te]=ze[te])});var $e=!V&&!W,Ve=this.getInputDisplayValue(null),be=(tt||tt===0)&&(isNaN(tt)||Number(tt)>=de),Pe=(tt||tt===0)&&(isNaN(tt)||Number(tt)<=Ce),le=be||W||V,ie=Pe||W||V,ae=g()("".concat(N,"-handler"),"".concat(N,"-handler-up"),Object(G.a)({},"".concat(N,"-handler-up-disabled"),le)),Y=g()("".concat(N,"-handler"),"".concat(N,"-handler-down"),Object(G.a)({},"".concat(N,"-handler-down-disabled"),ie)),X=F?{onTouchStart:le?d:this.up,onTouchEnd:this.stop}:{onMouseDown:le?d:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},Z=F?{onTouchStart:ie?d:this.down,onTouchEnd:this.stop}:{onMouseDown:ie?d:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return I.a.createElement("div",{className:Ye,style:ge,title:pe,onMouseEnter:ce,onMouseLeave:he,onMouseOver:ne,onMouseOut:ue,onFocus:function(){return null},onBlur:function(){return null}},I.a.createElement("div",{className:"".concat(N,"-handler-wrap")},I.a.createElement("span",Object.assign({unselectable:"on"},X,{role:"button","aria-label":"Increase Value","aria-disabled":le,className:ae}),J||I.a.createElement("span",{unselectable:"on",className:"".concat(N,"-handler-up-inner"),onClick:o})),I.a.createElement("span",Object.assign({unselectable:"on"},Z,{role:"button","aria-label":"Decrease Value","aria-disabled":ie,className:Y}),ee||I.a.createElement("span",{unselectable:"on",className:"".concat(N,"-handler-down-inner"),onClick:o}))),I.a.createElement("div",{className:"".concat(N,"-input-wrap")},I.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Ce,"aria-valuemax":de,"aria-valuenow":tt,required:Ee,type:Ne,placeholder:je,onPaste:qe,onClick:_e,onMouseUp:this.onMouseUp,className:"".concat(N,"-input"),tabIndex:Oe,autoComplete:_,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:$e?this.onKeyDown:d,onKeyUp:$e?this.onKeyUp:d,autoFocus:Me,maxLength:He,readOnly:V,disabled:W,max:de,min:Ce,step:Fe,name:Le,title:pe,id:xe,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(Ve),pattern:Ie,inputMode:Se,onInput:Ze},ye))))}}]),v}(I.a.Component);E.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:m,min:-m,step:1,style:{},onChange:d,onKeyDown:d,onPressEnter:d,onFocus:d,onBlur:d,parser:l,required:!1,autoComplete:"off"};var f=E,c=Ae.a=f},ji0R:function(we,Ae,Q){we.exports=Q.p+"static/douyu.3e6df9ee.jpg"},kPWJ:function(we,Ae,Q){we.exports=Q.p+"static/question.cb52bef9.gif"},kPYp:function(we,Ae){we.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAF8AAAAUCAYAAADr0+FaAAANEklEQVRYR8WZe5RX1XXHP/vce3/zHoaXgFp5DQyOQLRgUTEtDW1qYyVmZUGNklRdiRpKE3lHfPyc4TngIBgfC0wx1ixt1NRWal2kotbE2lbRiCIISBCGhzDAvGd+87v37K5z5zfDzMCM46pr9fw1a+45+5zz3fvs/d3fn4yr1F8Do0UIUb74UFR8Gm3IO/Wf8MThat7mOYnaDZUmNUF/htpWLlePK4xwCcoQICHQbOGoKDuM4U1p5r0Px1DNrDPrezzQs+qNPUh/o4xXj6tRJhlhGEqeQNrCCYXdGvGfFt5JNHLoozJp7WyvdI0OtR4LEK7CstUIWyJLTSRcLfCnvlAiUKSgCEfV8o6NeMVE/G53itOUiXX3Sxcx2ov4qhG+qjBWoFChWYUqIt6VgFeblR0H5lEL0oGyjKvU1yHezPviyHdZ0Ro180basvD398n77svIFTokK5vrgW8LTELJRwgA6bTSHcaBckot/yWGX2YZtv5untT0dJ7SpOZrAX9mLTeIYarAIIQEYLrZTQNNFj7A8rx6/GrPfDncPmdihV6Y9nkA+Ot4nrIXaDSGElH6K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4vw6HtneQ8N06YNalIp4HmF6X8EfV6ljRfk5EmNxJvIdn09ksdYIs7oV2d7h7uGrhUOEzP14ibzoNgXmC3wjQx3dbwZdwM6YcbHpNJFDKjxr4dHOunv3rcY9rANNC7dbR4WFkbhIP7ddFxSxTK3Cr0nzgFMz2+05Su37saTsWJRVS5VnuHnnAnmtp8vPnKne+1NY4jlZwtDfWpob6ijzhQ098fyLVmn/bJ97PMPtQJ5r8Dxck5VUMyqXP0wEzEHjNFHQR438rPPZtuyiKpTtmsdjrji7SGmJmBJrGYZSlIsyfYD7oaJVlVqEAwbejSJeafR5t6dOsfOGTuXMTTHeBExHmCzCaDTurLPEFWOlXqFKlI+s8prfwG92lnXVXkoq9HwTcD/KdSp8mGrmyVSaf+pJJmjff/gKHZaTxR3G8E1rKWyoY4MvbOwJfIdIcSUX+8Ic1yg6yT6Eb7Q1Wc4BORRk+RQZQ2DD3n8Y+Lwn4edT/cEcOd0xL6nmyn5knWghPzuL7JQQJMC0umjzafUbaG5J0XigjFSfeHuHYZXSJIH0Iz+VJtczBL6H58pLZAhTaVqKCmnYfoSWc4l6Tko/nscg8clvMtQPyOFUn/oRVCauJZcs+jeHJFLHOX1wFTW9MkEnyg0kP2EpitJ4+YVU/S8v1xqrW4H9MAAAAABJRU5ErkJggg=="},kSUc:function(we,Ae,Q){},l2Kq:function(we,Ae,Q){we.exports=Q.p+"static/match_ad.24dc22fd.jpg"},lZu9:function(we,Ae,Q){(function(q){q(Q("VrN/"),Q("1eCo"),Q("8EBN"))})(function(q){"use strict";q.defineMode("markdown",function(G,D){var K=q.getMode(G,"text/html"),P=K.name=="null";function M(F){if(q.findModeByName){var _=q.findModeByName(F);_&&(F=_.mime||_.mimes[0])}var J=q.getMode(G,F);return J.name=="null"?null:J}D.highlightFormatting===void 0&&(D.highlightFormatting=!1),D.maxBlockquoteDepth===void 0&&(D.maxBlockquoteDepth=0),D.taskLists===void 0&&(D.taskLists=!1),D.strikethrough===void 0&&(D.strikethrough=!1),D.emoji===void 0&&(D.emoji=!1),D.fencedCodeBlockHighlighting===void 0&&(D.fencedCodeBlockHighlighting=!0),D.fencedCodeBlockDefaultMode===void 0&&(D.fencedCodeBlockDefaultMode="text/plain"),D.xml===void 0&&(D.xml=!0),D.tokenTypeOverrides===void 0&&(D.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 B in U)U.hasOwnProperty(B)&&D.tokenTypeOverrides[B]&&(U[B]=D.tokenTypeOverrides[B]);var I=/^([*\-_])(?:\s*\1){2,}\s*$/,R=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,g=/^\[(x| )\](?=\s)/i,T=D.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,L=/^ {0,3}(?:\={1,}|-{2,})\s*$/,C=/^[^#!\[\]*_\\<>` "'(~:]+/,S=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,A=/^\s*\[[^\]]+?\]:.*$/,d=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,o=" ";function l(F,_,J){return _.f=_.inline=J,J(F,_)}function u(F,_,J){return _.f=_.block=J,J(F,_)}function y(F){return!F||!/\S/.test(F.string)}function m(F){if(F.linkTitle=!1,F.linkHref=!1,F.linkText=!1,F.em=!1,F.strong=!1,F.strikethrough=!1,F.quote=0,F.indentedCode=!1,F.f==w){var _=P;if(!_){var J=q.innerMode(K,F.htmlState);_=J.mode.name=="xml"&&J.state.tagStart===null&&!J.state.context&&J.state.tokenize.isInText}_&&(F.f=s,F.block=h,F.htmlState=null)}return F.trailingSpace=0,F.trailingSpaceNewLine=!1,F.prevLine=F.thisLine,F.thisLine={stream:null},null}function h(F,_){var J=F.column()===_.indentation,ee=y(_.prevLine.stream),oe=_.indentedCode,de=_.prevLine.hr,Ce=_.list!==!1,ge=(_.listStack[_.listStack.length-1]||0)+3;_.indentedCode=!1;var pe=_.indentation;if(_.indentationDiff===null&&(_.indentationDiff=_.indentation,Ce)){for(_.list=null;pe<_.listStack[_.listStack.length-1];)_.listStack.pop(),_.listStack.length?_.indentation=_.listStack[_.listStack.length-1]:_.list=!1;_.list!==!1&&(_.indentationDiff=pe-_.listStack[_.listStack.length-1])}var ce=!ee&&!de&&!_.prevLine.header&&(!Ce||!oe)&&!_.prevLine.fencedCodeEnd,he=(_.list===!1||de||ee)&&_.indentation<=ge&&F.match(I),ne=null;if(_.indentationDiff>=4&&(oe||_.prevLine.fencedCodeEnd||_.prevLine.header||ee))return F.skipToEnd(),_.indentedCode=!0,U.code;if(F.eatSpace())return null;if(J&&_.indentation<=ge&&(ne=F.match(T))&&ne[1].length<=6)return _.quote=0,_.header=ne[1].length,_.thisLine.header=!0,D.highlightFormatting&&(_.formatting="header"),_.f=_.inline,f(_);if(_.indentation<=ge&&F.eat(">"))return _.quote=J?1:_.quote+1,D.highlightFormatting&&(_.formatting="quote"),F.eatSpace(),f(_);if(!he&&!_.setext&&J&&_.indentation<=ge&&(ne=F.match(R))){var ue=ne[1]?"ol":"ul";return _.indentation=pe+F.current().length,_.list=!0,_.quote=0,_.listStack.push(_.indentation),_.em=!1,_.strong=!1,_.code=!1,_.strikethrough=!1,D.taskLists&&F.match(g,!1)&&(_.taskList=!0),_.f=_.inline,D.highlightFormatting&&(_.formatting=["list","list-"+ue]),f(_)}else{if(J&&_.indentation<=ge&&(ne=F.match(S,!0)))return _.quote=0,_.fencedEndRE=new RegExp(ne[1]+"+ *$"),_.localMode=D.fencedCodeBlockHighlighting&&M(ne[2]||D.fencedCodeBlockDefaultMode),_.localMode&&(_.localState=q.startState(_.localMode)),_.f=_.block=E,D.highlightFormatting&&(_.formatting="code-block"),_.code=-1,f(_);if(_.setext||(!ce||!Ce)&&!_.quote&&_.list===!1&&!_.code&&!he&&!A.test(F.string)&&(ne=F.lookAhead(1))&&(ne=ne.match(L)))return _.setext?(_.header=_.setext,_.setext=0,F.skipToEnd(),D.highlightFormatting&&(_.formatting="header")):(_.header=ne[0].charAt(0)=="="?1:2,_.setext=_.header),_.thisLine.header=!0,_.f=_.inline,f(_);if(he)return F.skipToEnd(),_.hr=!0,_.thisLine.hr=!0,U.hr;if(F.peek()==="[")return l(F,_,O)}return l(F,_,_.inline)}function w(F,_){var J=K.token(F,_.htmlState);if(!P){var ee=q.innerMode(K,_.htmlState);(ee.mode.name=="xml"&&ee.state.tagStart===null&&!ee.state.context&&ee.state.tokenize.isInText||_.md_inside&&F.current().indexOf(">")>-1)&&(_.f=s,_.block=h,_.htmlState=null)}return J}function E(F,_){var J=_.listStack[_.listStack.length-1]||0,ee=_.indentation<J,oe=J+3;if(_.fencedEndRE&&_.indentation<=oe&&(ee||F.match(_.fencedEndRE))){D.highlightFormatting&&(_.formatting="code-block");var de;return ee||(de=f(_)),_.localMode=_.localState=null,_.block=h,_.f=s,_.fencedEndRE=null,_.code=0,_.thisLine.fencedCodeEnd=!0,ee?u(F,_,_.block):de}else return _.localMode?_.localMode.token(F,_.localState):(F.skipToEnd(),U.code)}function f(F){var _=[];if(F.formatting){_.push(U.formatting),typeof F.formatting=="string"&&(F.formatting=[F.formatting]);for(var J=0;J<F.formatting.length;J++)_.push(U.formatting+"-"+F.formatting[J]),F.formatting[J]==="header"&&_.push(U.formatting+"-"+F.formatting[J]+"-"+F.header),F.formatting[J]==="quote"&&(!D.maxBlockquoteDepth||D.maxBlockquoteDepth>=F.quote?_.push(U.formatting+"-"+F.formatting[J]+"-"+F.quote):_.push("error"))}if(F.taskOpen)return _.push("meta"),_.length?_.join(" "):null;if(F.taskClosed)return _.push("property"),_.length?_.join(" "):null;if(F.linkHref?_.push(U.linkHref,"url"):(F.strong&&_.push(U.strong),F.em&&_.push(U.em),F.strikethrough&&_.push(U.strikethrough),F.emoji&&_.push(U.emoji),F.linkText&&_.push(U.linkText),F.code&&_.push(U.code),F.image&&_.push(U.image),F.imageAltText&&_.push(U.imageAltText,"link"),F.imageMarker&&_.push(U.imageMarker)),F.header&&_.push(U.header,U.header+"-"+F.header),F.quote&&(_.push(U.quote),!D.maxBlockquoteDepth||D.maxBlockquoteDepth>=F.quote?_.push(U.quote+"-"+F.quote):_.push(U.quote+"-"+D.maxBlockquoteDepth)),F.list!==!1){var ee=(F.listStack.length-1)%3;ee?ee===1?_.push(U.list2):_.push(U.list3):_.push(U.list1)}return F.trailingSpaceNewLine?_.push("trailing-space-new-line"):F.trailingSpace&&_.push("trailing-space-"+(F.trailingSpace%2?"a":"b")),_.length?_.join(" "):null}function c(F,_){return F.match(C,!0)?f(_):void 0}function s(F,_){var J=_.text(F,_);if(typeof J!="undefined")return J;if(_.list)return _.list=null,f(_);if(_.taskList){var ee=F.match(g,!0)[1]===" ";return ee?_.taskOpen=!0:_.taskClosed=!0,D.highlightFormatting&&(_.formatting="task"),_.taskList=!1,f(_)}if(_.taskOpen=!1,_.taskClosed=!1,_.header&&F.match(/^#+$/,!0))return D.highlightFormatting&&(_.formatting="header"),f(_);var oe=F.next();if(_.linkTitle){_.linkTitle=!1;var de=oe;oe==="("&&(de=")"),de=(de+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Ce="^\\s*(?:[^"+de+"\\\\]+|\\\\\\\\|\\\\.)"+de;if(F.match(new RegExp(Ce),!0))return U.linkHref}if(oe==="`"){var ge=_.formatting;D.highlightFormatting&&(_.formatting="code"),F.eatWhile("`");var pe=F.current().length;if(_.code==0&&(!_.quote||pe==1))return _.code=pe,f(_);if(pe==_.code){var ce=f(_);return _.code=0,ce}else return _.formatting=ge,f(_)}else if(_.code)return f(_);if(oe==="\\"&&(F.next(),D.highlightFormatting)){var he=f(_),ne=U.formatting+"-escape";return he?he+" "+ne:ne}if(oe==="!"&&F.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return _.imageMarker=!0,_.image=!0,D.highlightFormatting&&(_.formatting="image"),f(_);if(oe==="["&&_.imageMarker&&F.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return _.imageMarker=!1,_.imageAltText=!0,D.highlightFormatting&&(_.formatting="image"),f(_);if(oe==="]"&&_.imageAltText){D.highlightFormatting&&(_.formatting="image");var he=f(_);return _.imageAltText=!1,_.image=!1,_.inline=_.f=v,he}if(oe==="["&&!_.image)return _.linkText&&F.match(/^.*?\]/)||(_.linkText=!0,D.highlightFormatting&&(_.formatting="link")),f(_);if(oe==="]"&&_.linkText){D.highlightFormatting&&(_.formatting="link");var he=f(_);return _.linkText=!1,_.inline=_.f=F.match(/\(.*?\)| ?\[.*?\]/,!1)?v:s,he}if(oe==="<"&&F.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){_.f=_.inline=a,D.highlightFormatting&&(_.formatting="link");var he=f(_);return he?he+=" ":he="",he+U.linkInline}if(oe==="<"&&F.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){_.f=_.inline=a,D.highlightFormatting&&(_.formatting="link");var he=f(_);return he?he+=" ":he="",he+U.linkEmail}if(D.xml&&oe==="<"&&F.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var ue=F.string.indexOf(">",F.pos);if(ue!=-1){var Ee=F.string.substring(F.start,ue);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Ee)&&(_.md_inside=!0)}return F.backUp(1),_.htmlState=q.startState(K),u(F,_,w)}if(D.xml&&oe==="<"&&F.match(/^\/\w*?>/))return _.md_inside=!1,"tag";if(oe==="*"||oe==="_"){for(var _e=1,Oe=F.pos==1?" ":F.string.charAt(F.pos-2);_e<3&&F.eat(oe);)_e++;var Ne=F.peek()||" ",je=!/\s/.test(Ne)&&(!d.test(Ne)||/\s/.test(Oe)||d.test(Oe)),xe=!/\s/.test(Oe)&&(!d.test(Oe)||/\s/.test(Ne)||d.test(Ne)),Se=null,Ie=null;if(_e%2&&(!_.em&&je&&(oe==="*"||!xe||d.test(Oe))?Se=!0:_.em==oe&&xe&&(oe==="*"||!je||d.test(Ne))&&(Se=!1)),_e>1&&(!_.strong&&je&&(oe==="*"||!xe||d.test(Oe))?Ie=!0:_.strong==oe&&xe&&(oe==="*"||!je||d.test(Ne))&&(Ie=!1)),Ie!=null||Se!=null){D.highlightFormatting&&(_.formatting=Se==null?"strong":Ie==null?"em":"strong em"),Se===!0&&(_.em=oe),Ie===!0&&(_.strong=oe);var ce=f(_);return Se===!1&&(_.em=!1),Ie===!1&&(_.strong=!1),ce}}else if(oe===" "&&(F.eat("*")||F.eat("_"))){if(F.peek()===" ")return f(_);F.backUp(1)}if(D.strikethrough){if(oe==="~"&&F.eatWhile(oe)){if(_.strikethrough){D.highlightFormatting&&(_.formatting="strikethrough");var ce=f(_);return _.strikethrough=!1,ce}else if(F.match(/^[^\s]/,!1))return _.strikethrough=!0,D.highlightFormatting&&(_.formatting="strikethrough"),f(_)}else if(oe===" "&&F.match(/^~~/,!0)){if(F.peek()===" ")return f(_);F.backUp(2)}}if(D.emoji&&oe===":"&&F.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){_.emoji=!0,D.highlightFormatting&&(_.formatting="emoji");var Fe=f(_);return _.emoji=!1,Fe}return oe===" "&&(F.match(/^ +$/,!1)?_.trailingSpace++:_.trailingSpace&&(_.trailingSpaceNewLine=!0)),f(_)}function a(F,_){var J=F.next();if(J===">"){_.f=_.inline=s,D.highlightFormatting&&(_.formatting="link");var ee=f(_);return ee?ee+=" ":ee="",ee+U.linkInline}return F.match(/^[^>]+/,!0),U.linkInline}function v(F,_){if(F.eatSpace())return null;var J=F.next();return J==="("||J==="["?(_.f=_.inline=b(J==="("?")":"]"),D.highlightFormatting&&(_.formatting="link-string"),_.linkHref=!0,f(_)):"error"}var p={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function b(F){return function(_,J){var ee=_.next();if(ee===F){J.f=J.inline=s,D.highlightFormatting&&(J.formatting="link-string");var oe=f(J);return J.linkHref=!1,oe}return _.match(p[F]),J.linkHref=!0,f(J)}}function O(F,_){return F.match(/^([^\]\\]|\\.)*\]:/,!1)?(_.f=N,F.next(),D.highlightFormatting&&(_.formatting="link"),_.linkText=!0,f(_)):l(F,_,s)}function N(F,_){if(F.match(/^\]:/,!0)){_.f=_.inline=W,D.highlightFormatting&&(_.formatting="link");var J=f(_);return _.linkText=!1,J}return F.match(/^([^\]\\]|\\.)+/,!0),U.linkText}function W(F,_){return F.eatSpace()?null:(F.match(/^[^\s]+/,!0),F.peek()===void 0?_.linkTitle=!0:F.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),_.f=_.inline=s,U.linkHref+" url")}var V={startState:function(){return{f:h,prevLine:{stream:null},thisLine:{stream:null},block:h,htmlState:null,indentation:0,inline:s,text:c,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(F){return{f:F.f,prevLine:F.prevLine,thisLine:F.thisLine,block:F.block,htmlState:F.htmlState&&q.copyState(K,F.htmlState),indentation:F.indentation,localMode:F.localMode,localState:F.localMode?q.copyState(F.localMode,F.localState):null,inline:F.inline,text:F.text,formatting:!1,linkText:F.linkText,linkTitle:F.linkTitle,linkHref:F.linkHref,code:F.code,em:F.em,strong:F.strong,strikethrough:F.strikethrough,emoji:F.emoji,header:F.header,setext:F.setext,hr:F.hr,taskList:F.taskList,list:F.list,listStack:F.listStack.slice(0),quote:F.quote,indentedCode:F.indentedCode,trailingSpace:F.trailingSpace,trailingSpaceNewLine:F.trailingSpaceNewLine,md_inside:F.md_inside,fencedEndRE:F.fencedEndRE}},token:function(F,_){if(_.formatting=!1,F!=_.thisLine.stream){if(_.header=0,_.hr=!1,F.match(/^\s*$/,!0))return m(_),null;if(_.prevLine=_.thisLine,_.thisLine={stream:F},_.taskList=!1,_.trailingSpace=0,_.trailingSpaceNewLine=!1,!_.localState&&(_.f=_.block,_.f!=w)){var J=F.match(/^\s*/,!0)[0].replace(/\t/g,o).length;if(_.indentation=J,_.indentationDiff=null,J>0)return null}}return _.f(F,_)},innerMode:function(F){return F.block==w?{state:F.htmlState,mode:K}:F.localState?{state:F.localState,mode:F.localMode}:{state:F,mode:V}},indent:function(F,_,J){return F.block==w&&K.indent?K.indent(F.htmlState,_,J):F.localState&&F.localMode.indent?F.localMode.indent(F.localState,_,J):q.Pass},blankLine:m,getType:f,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return V},"xml"),q.defineMIME("text/markdown","markdown"),q.defineMIME("text/x-markdown","markdown")})},lzim:function(we,Ae,Q){"use strict";var q=Q("E7E6"),G=Q.n(q);Q.d(Ae,"z",function(){return G.a});var D=Q("/GNS"),K=Q.n(D);Q.d(Ae,"y",function(){return K.a});var P=Q("FOrL"),M=Q.n(P);Q.d(Ae,"s",function(){return M.a});var U=Q("HpTS"),B=Q.n(U);Q.d(Ae,"A",function(){return B.a});var I=Q("tWlo"),R=Q.n(I);Q.d(Ae,"b",function(){return R.a});var g=Q("7ZXX"),T=Q.n(g);Q.d(Ae,"m",function(){return T.a});var L=Q("GABl"),C=Q.n(L);Q.d(Ae,"f",function(){return C.a});var S=Q("onxn"),A=Q.n(S);Q.d(Ae,"o",function(){return A.a});var d=Q("nKGa"),o=Q.n(d);Q.d(Ae,"n",function(){return o.a});var l=Q("4qgm"),u=Q.n(l);Q.d(Ae,"C",function(){return u.a});var y=Q("JeFH"),m=Q.n(y);Q.d(Ae,"c",function(){return m.a});var h=Q("ji0R"),w=Q.n(h);Q.d(Ae,"j",function(){return w.a});var E=Q("W6BS"),f=Q.n(E);Q.d(Ae,"D",function(){return f.a});var c=Q("kPYp"),s=Q.n(c);Q.d(Ae,"E",function(){return s.a});var a=Q("nukY"),v=Q.n(a),p=Q("4u4S"),b=Q.n(p),O=Q("yslc"),N=Q.n(O),W=Q("l2Kq"),V=Q.n(W);Q.d(Ae,"r",function(){return V.a});var F=Q("RMFE"),_=Q.n(F);Q.d(Ae,"p",function(){return _.a});var J=Q("TGq3"),ee=Q.n(J),oe=Q("SMhR"),de=Q.n(oe);Q.d(Ae,"B",function(){return de.a});var Ce=Q("8/bI"),ge=Q.n(Ce);Q.d(Ae,"k",function(){return ge.a});var pe=Q("JWDV"),ce=Q.n(pe),he=Q("Xsq0"),ne=Q.n(he);Q.d(Ae,"q",function(){return ne.a});var ue=Q("Ohmc"),Ee=Q.n(ue);Q.d(Ae,"d",function(){return Ee.a});var _e=Q("csWT"),Oe=Q.n(_e);Q.d(Ae,"e",function(){return Oe.a});var Ne=Q("7v3h"),je=Q.n(Ne);Q.d(Ae,"l",function(){return je.a});var xe=Q("cRFk"),Se=Q.n(xe);Q.d(Ae,"x",function(){return Se.a});var Ie=Q("kPWJ"),Fe=Q.n(Ie);Q.d(Ae,"w",function(){return Fe.a});var He=Q("qgvg"),Me=Q.n(He);Q.d(Ae,"t",function(){return Me.a});var Le=Q("FPkq"),qe=Q.n(Le);Q.d(Ae,"v",function(){return qe.a});var Ze=Q("A/g1"),ze=Q.n(Ze);Q.d(Ae,"g",function(){return ze.a});var Ge=Q("Nmxd"),tt=Q.n(Ge);Q.d(Ae,"h",function(){return tt.a});var Xe=Q("5D2P"),Ye=Q.n(Xe);Q.d(Ae,"i",function(){return Ye.a});var ye=Q("djh8"),$e=Q.n(ye);Q.d(Ae,"u",function(){return $e.a});var Ve=Q("Jq4h"),be=Q.n(Ve);Q.d(Ae,"a",function(){return be.a})},nKGa:function(we,Ae,Q){we.exports=Q.p+"static/export_exercise-template.f7655c19.png"},nZ20:function(we,Ae,Q){we.exports={icons:"icons___3O80F"}},nukY:function(we,Ae){we.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALoAAABSCAYAAADjGc4eAAAMkklEQVR4Xu2dWWwcSRnHv7Yd577v+74vkgWEQCAEy6IVWuCB62GVICFIYkcsvMC+LW8LL7BIiTiEhCweInjgPrRCC2KBJTBVYzm24yRO4ty3kziJj9ie+tC/d9oaT2b67ume7irJsjdbVf19X/266quvjjaEEG8w8yukk7ZAii1gMHODEOK3RPRSivXUqmXcAgb07+jomDk2NvYPZn4u4/bQ6qfUAiboSEKI5cz8XyJanVJdtVoZtsAE6EXYdzPzv4hoToZtolVPoQUmgV6E/QVm/hMRNaVQX61SRi3wDOiwg5Tya0qpn2TUJlrtFFqgIujFnv27zPztFOqsVcqgBaqCzsyGlPJXzPy5DNpFq5wyC1QFHXr29fVN6+/v/zszfyBlemt1MmYBW9Bhi3w+v7hQKJwkog0Zs41WN0UWcAS96K9vI6J3mHl+inTXqmTIAq5Ahz1yudxHDcN4k5mbM2QfrWpKLOAa9CLsB4ioLSW6azUyZAFPoBdh/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O3OSgzvFjjporyX6qKNwdMU/6UxpWTfmsuOFCrtZT8WKMKqyJkdbfSPpn5nql4XamMamN5GB0TvUK4KE6HbTqS5ma+eahgtO2ZY9fx2TlKtVziZp3Zl/FigUiZ3wOIYWZ/52pLR35oOU6oPtuw+dNdl6QfsAHmYlMZcEpiXsak6tnQY70bWubrUepjkNJTKTbGv8s8SSlOaD5Z0LwhL4XWmQvSa42rWrgf7+Fn7byVVV5KX6mLbTWcKueEa6etz+M+OphwqlZtmnSUME1bjJyb6vOmm8tc3PvrCeMIJZTLt5zBb1i59tUxuvDeRm+14RscbD1IB9Uo6ZnHRfp2XsX4489Ujy8eT08YTAjSg6Plf333p9HDLpzPlpnEvg4kYH83TrZrxcugy7IkU4SnrdszlW6AS5iOzndzu2FAbexmKY2RCgDR5zVsfrFm2YSrc92cqveNe2xMF9pk4HZvFMmQwflxrqMZFXKub49R1+ZtOne5hJaZpwoAG1GpXjhf/YXuxTK37pyLFPZSGErM7JleYCPVGRN7kreaXsp45OnY7aAwN3xvQcH1b1y65VabMwzMU5zQ79bMKmLHLm2GCEXC0jUkVRSLUF6hdW62c8n7WyzXHfsianBVAg16rqGCOerYt+E4tuOIbviR3suK+cBp1Zdpp0GRVRfZl4/XHD7AzTpnYSFWB0vHlzS2TDiz/cPn4vx2YAML/AxiD3K8wfl5pAAAAAElFTkSuQmCC"},osHv:function(we,Ae,Q){(function(q){q(Q("VrN/"))})(function(q){"use strict";var G=q.Pos;function D(d,o){return d.line-o.line||d.ch-o.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",P=K+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",M=new RegExp("<(/?)(["+K+"]["+P+"]*)","g");function U(d,o,l,u){this.line=o,this.ch=l,this.cm=d,this.text=d.getLine(o),this.min=u?Math.max(u.from,d.firstLine()):d.firstLine(),this.max=u?Math.min(u.to-1,d.lastLine()):d.lastLine()}function B(d,o){var l=d.cm.getTokenTypeAt(G(d.line,o));return l&&/\btag\b/.test(l)}function I(d){return d.line>=d.max?void 0:(d.ch=0,d.text=d.cm.getLine(++d.line),!0)}function R(d){return d.line<=d.min?void 0:(d.text=d.cm.getLine(--d.line),d.ch=d.text.length,!0)}function g(d){for(;;){var o=d.text.indexOf(">",d.ch);if(o==-1){if(I(d))continue;return}if(!B(d,o+1)){d.ch=o+1;continue}var l=d.text.lastIndexOf("/",o),u=l>-1&&!/\S/.test(d.text.slice(l+1,o));return d.ch=o+1,u?"selfClose":"regular"}}function T(d){for(;;){var o=d.ch?d.text.lastIndexOf("<",d.ch-1):-1;if(o==-1){if(R(d))continue;return}if(!B(d,o+1)){d.ch=o;continue}M.lastIndex=o,d.ch=o;var l=M.exec(d.text);if(l&&l.index==o)return l}}function L(d){for(;;){M.lastIndex=d.ch;var o=M.exec(d.text);if(!o){if(I(d))continue;return}if(!B(d,o.index+1)){d.ch=o.index+1;continue}return d.ch=o.index+o[0].length,o}}function C(d){for(;;){var o=d.ch?d.text.lastIndexOf(">",d.ch-1):-1;if(o==-1){if(R(d))continue;return}if(!B(d,o+1)){d.ch=o;continue}var l=d.text.lastIndexOf("/",o),u=l>-1&&!/\S/.test(d.text.slice(l+1,o));return d.ch=o+1,u?"selfClose":"regular"}}function S(d,o){for(var l=[];;){var u=L(d),y,m=d.line,h=d.ch-(u?u[0].length:0);if(!u||!(y=g(d)))return;if(y=="selfClose")continue;if(u[1]){for(var w=l.length-1;w>=0;--w)if(l[w]==u[2]){l.length=w;break}if(w<0&&(!o||o==u[2]))return{tag:u[2],from:G(m,h),to:G(d.line,d.ch)}}else l.push(u[2])}}function A(d,o){for(var l=[];;){var u=C(d);if(!u)return;if(u=="selfClose"){T(d);continue}var y=d.line,m=d.ch,h=T(d);if(!h)return;if(h[1])l.push(h[2]);else{for(var w=l.length-1;w>=0;--w)if(l[w]==h[2]){l.length=w;break}if(w<0&&(!o||o==h[2]))return{tag:h[2],from:G(d.line,d.ch),to:G(y,m)}}}}q.registerHelper("fold","xml",function(d,o){for(var l=new U(d,o.line,0);;){var u=L(l);if(!u||l.line!=o.line)return;var y=g(l);if(!y)return;if(!u[1]&&y!="selfClose"){var m=G(l.line,l.ch),h=S(l,u[2]);return h&&D(h.from,m)>0?{from:m,to:h.from}:null}}}),q.findMatchingTag=function(d,o,l){var u=new U(d,o.line,o.ch,l);if(u.text.indexOf(">")==-1&&u.text.indexOf("<")==-1)return;var y=g(u),m=y&&G(u.line,u.ch),h=y&&T(u);if(!y||!h||D(u,o)>0)return;var w={from:G(u.line,u.ch),to:m,tag:h[2]};return y=="selfClose"?{open:w,close:null,at:"open"}:h[1]?{open:A(u,h[2]),close:w,at:"close"}:(u=new U(d,m.line,m.ch,l),{open:w,close:S(u,h[2]),at:"open"})},q.findEnclosingTag=function(d,o,l,u){for(var y=new U(d,o.line,o.ch,l);;){var m=A(y,u);if(!m)break;var h=new U(d,o.line,o.ch,l),w=S(h,m.tag);if(w)return{open:m,close:w}}},q.scanForClosingTag=function(d,o,l,u){var y=new U(d,o.line,o.ch,u?{from:0,to:u}:null);return S(y,l)}})},"p77/":function(we,Ae,Q){},qgvg:function(we,Ae){we.exports="data:image/gif;base64,R0lGODlhFAAQAOZVAD6Q33p6ezZto2VnaW5vcDuCxiYvNysvM1tdXzNij5eXlyg0QTA0OExOUWZnaS8zN19hYzFYf0Oi/Sg1QoeHh2JjZWZoaTdzrTRmljl5tzFZgDBWez6P3Tl4tjl8uzdxqWBiYys/VCUqL39/gHV2dy4yNScyPDJeiEpNTzk8P0CX6jc7PiYuNWlqaywwNDZtojAzNytDWScrLitAVUGb8Xl6eoWFhTp+wDNgjWRmZ4+QkFdZWzo9QIODgyo/Uzh3syg0QCczPmprbTRllW9wcSotMVJUVjZupDuEylBSVUGb8kxPUZGRkTd0rUG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lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},P=E=>K[E];function M(E,f){if(f){if(Q.test(E))return E.replace(q,P)}else if(G.test(E))return E.replace(D,P);return E}const U=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function B(E){return E.replace(U,(f,c)=>(c=c.toLowerCase(),c==="colon"?":":c.charAt(0)==="#"?c.charAt(1)==="x"?String.fromCharCode(parseInt(c.substring(2),16)):String.fromCharCode(+c.substring(1)):""))}const I=/(^|[^\[])\^/g;function R(E,f){E=E.source||E,f=f||"";const c={replace:(s,a)=>(a=a.source||a,a=a.replace(I,"$1"),E=E.replace(s,a),c),getRegex:()=>new RegExp(E,f)};return c}const g=/[^\w:]/g,T=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function L(E,f,c){if(E){let s;try{s=decodeURIComponent(B(c)).replace(g,"").toLowerCase()}catch(a){return null}if(s.indexOf("javascript:")===0||s.indexOf("vbscript:")===0||s.indexOf("data:")===0)return null}f&&!T.test(c)&&(c=o(f,c));try{c=encodeURI(c).replace(/%25/g,"%")}catch(s){return null}return c}const C={},S=/^[^:]+:\/*[^/]*$/,A=/^([^:]+:)[\s\S]*$/,d=/^([^:]+:\/*[^/]*)[\s\S]*$/;function o(E,f){C[" "+E]||(S.test(E)?C[" "+E]=E+"/":C[" "+E]=m(E,"/",!0)),E=C[" "+E];const c=E.indexOf(":")===-1;return f.substring(0,2)==="//"?c?f:E.replace(A,"$1")+f:f.charAt(0)==="/"?c?f:E.replace(d,"$1")+f:E+f}const l={exec:function(){}};function u(E){let f=1,c,s;for(;f<arguments.length;f++){c=arguments[f];for(s in c)Object.prototype.hasOwnProperty.call(c,s)&&(E[s]=c[s])}return E}function y(E,f){const c=E.replace(/\|/g,(v,p,b)=>{let O=!1,N=p;for(;--N>=0&&b[N]==="\\";)O=!O;return O?"|":" |"}),s=c.split(/ \|/);let a=0;if(s.length>f)s.splice(f);else for(;s.length<f;)s.push("");for(;a<s.length;a++)s[a]=s[a].trim().replace(/\\\|/g,"|");return s}function m(E,f,c){const s=E.length;if(s===0)return"";let a=0;for(;a<s;){const v=E.charAt(s-a-1);if(v===f&&!c)a++;else if(v!==f&&c)a++;else break}return E.substr(0,s-a)}function h(E,f){if(E.indexOf(f[1])===-1)return-1;const c=E.length;let s=0,a=0;for(;a<c;a++)if(E[a]==="\\")a++;else if(E[a]===f[0])s++;else if(E[a]===f[1]&&(s--,s<0))return a;return-1}function w(E){E&&E.sanitize&&!E.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}we.exports={escape:M,unescape:B,edit:R,cleanUrl:L,resolveUrl:o,noopTest:l,merge:u,splitCells:y,rtrim:m,findClosingBracket:h,checkSanitizeDeprecation:w}},tWlo:function(we,Ae){we.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL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s2+ytTjcI+7gc0IkHwpMD+JnpbnZGdCXk4WPJSUKFlHzj0bGTrtGqhZNjJqgQHzIHRjWMbzhd7/MqLaZxqzxfjVFU+UjhcZCs+gp7f9nowcszMhfg17SoptSKDyym9N9cbePt8O2GrQ5pbrDRMTkwbe6MQpN6hfFRUVWa+Qb+7je23ideLAtPdGZ/cUZpw1iTsTFtFLJcBwEc2RIryHqELvW2q/qQPT4JA4AmupL5aP/Saza8A0eDU2Jvr0DrWaNkEe3L32kULmhXV+cHHR8cOvV5tcDd9f8qvm9ouAW2Zm5yhpm5uwWi9HRoRXq1UqC9zt08cDe391VUiJPyaPo+F1zddaZy80XFyLRv52v2ViPrehiJSvz6Z7rthQpZI+t6E+K91yuj+3UXnkL+7PbYxCFdiIKfgYdTcohHZ23QTnEntd8Y8AAwCTubpzlq2wWAAAAABJRU5ErkJggg=="},ulZh:function(we,Ae,Q){typeof window!="undefined"&&function(G,D){we.exports=D()}(this,function(){return function(q){var G={};function D(K){if(G[K])return G[K].exports;var P=G[K]={i:K,l:!1,exports:{}};return q[K].call(P.exports,P,P.exports,D),P.l=!0,P.exports}return D.m=q,D.c=G,D.d=function(K,P,M){D.o(K,P)||Object.defineProperty(K,P,{enumerable:!0,get:M})},D.r=function(K){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(K,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(K,"__esModule",{value:!0})},D.t=function(K,P){if(P&1&&(K=D(K)),P&8)return K;if(P&4&&typeof K=="object"&&K&&K.__esModule)return K;var M=Object.create(null);if(D.r(M),Object.defineProperty(M,"default",{enumerable:!0,value:K}),P&2&&typeof K!="string")for(var U in K)D.d(M,U,function(B){return K[B]}.bind(null,U));return M},D.n=function(K){var P=K&&K.__esModule?function(){return K.default}:function(){return K};return D.d(P,"a",P),P},D.o=function(K,P){return Object.prototype.hasOwnProperty.call(K,P)},D.p="/dist/",D(D.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(q,G,D){"use strict";var K=Object.prototype.hasOwnProperty,P="~";function M(){}Object.create&&(M.prototype=Object.create(null),new M().__proto__||(P=!1));function U(g,T,L){this.fn=g,this.context=T,this.once=L||!1}function B(g,T,L,C,S){if(typeof L!="function")throw new TypeError("The listener must be a function");var A=new U(L,C||g,S),d=P?P+T:T;return g._events[d]?g._events[d].fn?g._events[d]=[g._events[d],A]:g._events[d].push(A):(g._events[d]=A,g._eventsCount++),g}function I(g,T){--g._eventsCount===0?g._events=new M:delete g._events[T]}function R(){this._events=new M,this._eventsCount=0}R.prototype.eventNames=function(){var T=[],L,C;if(this._eventsCount===0)return T;for(C in L=this._events)K.call(L,C)&&T.push(P?C.slice(1):C);return Object.getOwnPropertySymbols?T.concat(Object.getOwnPropertySymbols(L)):T},R.prototype.listeners=function(T){var L=P?P+T:T,C=this._events[L];if(!C)return[];if(C.fn)return[C.fn];for(var S=0,A=C.length,d=new Array(A);S<A;S++)d[S]=C[S].fn;return d},R.prototype.listenerCount=function(T){var L=P?P+T:T,C=this._events[L];return C?C.fn?1:C.length:0},R.prototype.emit=function(T,L,C,S,A,d){var o=P?P+T:T;if(!this._events[o])return!1;var l=this._events[o],u=arguments.length,y,m;if(l.fn){l.once&&this.removeListener(T,l.fn,void 0,!0);switch(u){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,L),!0;case 3:return l.fn.call(l.context,L,C),!0;case 4:return l.fn.call(l.context,L,C,S),!0;case 5:return l.fn.call(l.context,L,C,S,A),!0;case 6:return l.fn.call(l.context,L,C,S,A,d),!0}for(m=1,y=new Array(u-1);m<u;m++)y[m-1]=arguments[m];l.fn.apply(l.context,y)}else{var h=l.length,w;for(m=0;m<h;m++){l[m].once&&this.removeListener(T,l[m].fn,void 0,!0);switch(u){case 1:l[m].fn.call(l[m].context);break;case 2:l[m].fn.call(l[m].context,L);break;case 3:l[m].fn.call(l[m].context,L,C);break;case 4:l[m].fn.call(l[m].context,L,C,S);break;default:if(!y)for(w=1,y=new Array(u-1);w<u;w++)y[w-1]=arguments[w];l[m].fn.apply(l[m].context,y)}}}return!0},R.prototype.on=function(T,L,C){return B(this,T,L,C,!1)},R.prototype.once=function(T,L,C){return B(this,T,L,C,!0)},R.prototype.removeListener=function(T,L,C,S){var A=P?P+T:T;if(!this._events[A])return this;if(!L)return I(this,A),this;var d=this._events[A];if(d.fn)d.fn===L&&(!S||d.once)&&(!C||d.context===C)&&I(this,A);else{for(var o=0,l=[],u=d.length;o<u;o++)(d[o].fn!==L||S&&!d[o].once||C&&d[o].context!==C)&&l.push(d[o]);l.length?this._events[A]=l.length===1?l[0]:l:I(this,A)}return this},R.prototype.removeAllListeners=function(T){var L;return T?(L=P?P+T:T,this._events[L]&&I(this,L)):(this._events=new M,this._eventsCount=0),this},R.prototype.off=R.prototype.removeListener,R.prototype.addListener=R.prototype.on,R.prefixed=P,R.EventEmitter=R,q.exports=R},"./node_modules/url-toolkit/src/url-toolkit.js":function(q,G,D){(function(K){var P=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,M=/^([^\/?#]*)([^]*)$/,U=/(?:\/|^)\.(?=\/)/g,B=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,I={buildAbsoluteURL:function(R,g,T){if(T=T||{},R=R.trim(),g=g.trim(),!g){if(!T.alwaysNormalize)return R;var L=I.parseURL(R);if(!L)throw new Error("Error trying to parse base URL.");return L.path=I.normalizePath(L.path),I.buildURLFromParts(L)}var C=I.parseURL(g);if(!C)throw new Error("Error trying to parse relative URL.");if(C.scheme)return T.alwaysNormalize?(C.path=I.normalizePath(C.path),I.buildURLFromParts(C)):g;var S=I.parseURL(R);if(!S)throw new Error("Error trying to parse base URL.");if(!S.netLoc&&S.path&&S.path[0]!=="/"){var A=M.exec(S.path);S.netLoc=A[1],S.path=A[2]}S.netLoc&&!S.path&&(S.path="/");var d={scheme:S.scheme,netLoc:C.netLoc,path:null,params:C.params,query:C.query,fragment:C.fragment};if(!C.netLoc&&(d.netLoc=S.netLoc,C.path[0]!=="/"))if(!C.path)d.path=S.path,C.params||(d.params=S.params,C.query||(d.query=S.query));else{var o=S.path,l=o.substring(0,o.lastIndexOf("/")+1)+C.path;d.path=I.normalizePath(l)}return d.path===null&&(d.path=T.alwaysNormalize?I.normalizePath(C.path):C.path),I.buildURLFromParts(d)},parseURL:function(R){var g=P.exec(R);return g?{scheme:g[1]||"",netLoc:g[2]||"",path:g[3]||"",params:g[4]||"",query:g[5]||"",fragment:g[6]||""}:null},normalizePath:function(R){for(R=R.split("").reverse().join("").replace(U,"");R.length!==(R=R.replace(B,"")).length;);return R.split("").reverse().join("")},buildURLFromParts:function(R){return R.scheme+R.netLoc+R.path+R.params+R.query+R.fragment}};q.exports=I})(this)},"./node_modules/webworkify-webpack/index.js":function(q,G,D){function K(T){var L={};function C(A){if(L[A])return L[A].exports;var d=L[A]={i:A,l:!1,exports:{}};return T[A].call(d.exports,d,d.exports,C),d.l=!0,d.exports}C.m=T,C.c=L,C.i=function(A){return A},C.d=function(A,d,o){C.o(A,d)||Object.defineProperty(A,d,{configurable:!1,enumerable:!0,get:o})},C.r=function(A){Object.defineProperty(A,"__esModule",{value:!0})},C.n=function(A){var d=A&&A.__esModule?function(){return A.default}:function(){return A};return C.d(d,"a",d),d},C.o=function(A,d){return Object.prototype.hasOwnProperty.call(A,d)},C.p="/",C.oe=function(A){throw console.error(A),A};var S=C(C.s=ENTRY_MODULE);return S.default||S}var P="[\\.|\\-|\\+|\\w|/|@]+",M="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+P+").*?\\)";function U(T){return(T+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function B(T){return!isNaN(1*T)}function I(T,L,C){var S={};S[C]=[];var A=L.toString(),d=A.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!d)return S;for(var o=d[1],l=new RegExp("(\\\\n|\\W)"+U(o)+M,"g"),u;u=l.exec(A);){if(u[3]==="dll-reference")continue;S[C].push(u[3])}for(l=new RegExp("\\("+U(o)+'\\("(dll-reference\\s('+P+'))"\\)\\)'+M,"g");u=l.exec(A);)T[u[2]]||(S[C].push(u[1]),T[u[2]]=D(u[1]).m),S[u[2]]=S[u[2]]||[],S[u[2]].push(u[4]);for(var y=Object.keys(S),m=0;m<y.length;m++)for(var h=0;h<S[y[m]].length;h++)B(S[y[m]][h])&&(S[y[m]][h]=1*S[y[m]][h]);return S}function R(T){var L=Object.keys(T);return L.reduce(function(C,S){return C||T[S].length>0},!1)}function g(T,L){for(var C={main:[L]},S={main:[]},A={main:{}};R(C);)for(var d=Object.keys(C),o=0;o<d.length;o++){var l=d[o],u=C[l],y=u.pop();if(A[l]=A[l]||{},A[l][y]||!T[l][y])continue;A[l][y]=!0,S[l]=S[l]||[],S[l].push(y);for(var m=I(T,T[l][y],l),h=Object.keys(m),w=0;w<h.length;w++)C[h[w]]=C[h[w]]||[],C[h[w]]=C[h[w]].concat(m[h[w]])}return S}q.exports=function(T,L){L=L||{};var C={main:D.m},S=L.all?{main:Object.keys(C.main)}:g(C,T),A="";Object.keys(S).filter(function(y){return y!=="main"}).forEach(function(y){for(var m=0;S[y][m];)m++;S[y].push(m),C[y][m]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",A=A+"var "+y+" = ("+K.toString().replace("ENTRY_MODULE",JSON.stringify(m))+")({"+S[y].map(function(h){return""+JSON.stringify(h)+": "+C[y][h].toString()}).join(",")+`});
`}),A=A+"new (("+K.toString().replace("ENTRY_MODULE",JSON.stringify(T))+")({"+S.main.map(function(y){return""+JSON.stringify(y)+": "+C.main[y].toString()}).join(",")+"}))(self);";var d=new window.Blob([A],{type:"text/javascript"});if(L.bare)return d;var o=window.URL||window.webkitURL||window.mozURL||window.msURL,l=o.createObjectURL(d),u=new window.Worker(l);return u.objectURL=l,u}},"./src/config.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"hlsDefaultConfig",function(){return w}),D.d(G,"mergeConfig",function(){return f}),D.d(G,"enableStreamingMode",function(){return c});var K=D("./src/controller/abr-controller.ts"),P=D("./src/controller/audio-stream-controller.ts"),M=D("./src/controller/audio-track-controller.ts"),U=D("./src/controller/subtitle-stream-controller.ts"),B=D("./src/controller/subtitle-track-controller.ts"),I=D("./src/controller/buffer-controller.ts"),R=D("./src/controller/timeline-controller.ts"),g=D("./src/controller/cap-level-controller.ts"),T=D("./src/controller/fps-controller.ts"),L=D("./src/controller/eme-controller.ts"),C=D("./src/controller/cmcd-controller.ts"),S=D("./src/utils/xhr-loader.ts"),A=D("./src/utils/fetch-loader.ts"),d=D("./src/utils/cues.ts"),o=D("./src/utils/mediakeys-helper.ts"),l=D("./src/utils/logger.ts");function u(){return u=Object.assign||function(s){for(var a=1;a<arguments.length;a++){var v=arguments[a];for(var p in v)Object.prototype.hasOwnProperty.call(v,p)&&(s[p]=v[p])}return s},u.apply(this,arguments)}function y(s,a){var v=Object.keys(s);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(s);a&&(p=p.filter(function(b){return Object.getOwnPropertyDescriptor(s,b).enumerable})),v.push.apply(v,p)}return v}function m(s){for(var a=1;a<arguments.length;a++){var v=arguments[a]!=null?arguments[a]:{};a%2?y(Object(v),!0).forEach(function(p){h(s,p,v[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(v)):y(Object(v)).forEach(function(p){Object.defineProperty(s,p,Object.getOwnPropertyDescriptor(v,p))})}return s}function h(s,a,v){return a in s?Object.defineProperty(s,a,{value:v,enumerable:!0,configurable:!0,writable:!0}):s[a]=v,s}var w=m(m({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:Infinity,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:Infinity,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:S.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:K.default,bufferController:I.default,capLevelController:g.default,fpsController:T.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:o.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},E()),{},{subtitleStreamController:U.SubtitleStreamController,subtitleTrackController:B.default,timelineController:R.TimelineController,audioStreamController:P.default,audioTrackController:M.default,emeController:L.default,cmcdController:C.default});function E(){return{cueHandler:d.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 f(s,a){if((a.liveSyncDurationCount||a.liveMaxLatencyDurationCount)&&(a.liveSyncDuration||a.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(a.liveMaxLatencyDurationCount!==void 0&&(a.liveSyncDurationCount===void 0||a.liveMaxLatencyDurationCount<=a.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(a.liveMaxLatencyDuration!==void 0&&(a.liveSyncDuration===void 0||a.liveMaxLatencyDuration<=a.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return u({},s,a)}function c(s){var a=s.loader;if(a!==A.default&&a!==S.default)l.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),s.progressive=!1;else{var v=Object(A.fetchSupported)();v&&(s.loader=A.default,s.progressive=!0,s.enableSoftwareAES=!0,l.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(q,G,D){"use strict";D.r(G);var K=D("./src/polyfills/number.ts"),P=D("./src/utils/ewma-bandwidth-estimator.ts"),M=D("./src/events.ts"),U=D("./src/utils/buffer-helper.ts"),B=D("./src/errors.ts"),I=D("./src/types/loader.ts"),R=D("./src/utils/logger.ts");function g(C,S){for(var A=0;A<S.length;A++){var d=S[A];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(C,d.key,d)}}function T(C,S,A){return S&&g(C.prototype,S),A&&g(C,A),C}var L=function(){function C(A){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=A;var d=A.config;this.bwEstimator=new P.default(d.abrEwmaSlowVoD,d.abrEwmaFastVoD,d.abrEwmaDefaultEstimate),this.registerListeners()}var S=C.prototype;return S.registerListeners=function(){var d=this.hls;d.on(M.Events.FRAG_LOADING,this.onFragLoading,this),d.on(M.Events.FRAG_LOADED,this.onFragLoaded,this),d.on(M.Events.FRAG_BUFFERED,this.onFragBuffered,this),d.on(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),d.on(M.Events.ERROR,this.onError,this)},S.unregisterListeners=function(){var d=this.hls;d.off(M.Events.FRAG_LOADING,this.onFragLoading,this),d.off(M.Events.FRAG_LOADED,this.onFragLoaded,this),d.off(M.Events.FRAG_BUFFERED,this.onFragBuffered,this),d.off(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),d.off(M.Events.ERROR,this.onError,this)},S.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},S.onFragLoading=function(d,o){var l=o.frag;if(l.type===I.PlaylistLevelType.MAIN&&!this.timer){var u;this.fragCurrent=l,this.partCurrent=(u=o.part)!=null?u:null,this.timer=self.setInterval(this.onCheck,100)}},S.onLevelLoaded=function(d,o){var l=this.hls.config;o.details.live?this.bwEstimator.update(l.abrEwmaSlowLive,l.abrEwmaFastLive):this.bwEstimator.update(l.abrEwmaSlowVoD,l.abrEwmaFastVoD)},S._abandonRulesCheck=function(){var d=this.fragCurrent,o=this.partCurrent,l=this.hls,u=l.autoLevelEnabled,y=l.config,m=l.media;if(!d||!m)return;var h=o?o.stats:d.stats,w=o?o.duration:d.duration;if(h.aborted){R.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!u||m.paused||!m.playbackRate||!m.readyState)return;var E=performance.now()-h.loading.start,f=Math.abs(m.playbackRate);if(E<=500*w/f)return;var c=l.levels,s=l.minAutoLevel,a=c[d.level],v=h.total||Math.max(h.loaded,Math.round(w*a.maxBitrate/8)),p=Math.max(1,h.bwEstimate?h.bwEstimate/8:h.loaded*1e3/E),b=(v-h.loaded)/p,O=m.currentTime,N=(U.BufferHelper.bufferInfo(m,O,y.maxBufferHole).end-O)/f;if(N>=2*w/f||b<=N)return;var W=Number.POSITIVE_INFINITY,V;for(V=d.level-1;V>s;V--){var F=c[V].maxBitrate;if(W=w*F/(8*.8*p),W<N)break}if(W>=b)return;var _=this.bwEstimator.getEstimate();R.logger.warn("Fragment "+d.sn+(o?" part "+o.index:"")+" of level "+d.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+V+`
Current BW estimate: `+(Object(K.isFiniteNumber)(_)?(_/1024).toFixed(3):"Unknown")+` Kb/s
Estimated load time for current fragment: `+b.toFixed(3)+` s
Estimated load time for the next fragment: `+W.toFixed(3)+` s
Time to underbuffer: `+N.toFixed(3)+" s"),l.nextLoadLevel=V,this.bwEstimator.sample(E,h.loaded),this.clearTimer(),d.loader&&(this.fragCurrent=this.partCurrent=null,d.loader.abort()),l.trigger(M.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:d,part:o,stats:h})},S.onFragLoaded=function(d,o){var l=o.frag,u=o.part;if(l.type===I.PlaylistLevelType.MAIN&&Object(K.isFiniteNumber)(l.sn)){var y=u?u.stats:l.stats,m=u?u.duration:l.duration;if(this.clearTimer(),this.lastLoadedFragLevel=l.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var h=this.hls.levels[l.level],w=(h.loaded?h.loaded.bytes:0)+y.loaded,E=(h.loaded?h.loaded.duration:0)+m;h.loaded={bytes:w,duration:E},h.realBitrate=Math.round(8*w/E)}if(l.bitrateTest){var f={stats:y,frag:l,part:u,id:l.type};this.onFragBuffered(M.Events.FRAG_BUFFERED,f),l.bitrateTest=!1}}},S.onFragBuffered=function(d,o){var l=o.frag,u=o.part,y=u?u.stats:l.stats;if(y.aborted)return;if(l.type!==I.PlaylistLevelType.MAIN||l.sn==="initSegment")return;var m=y.parsing.end-y.loading.start;this.bwEstimator.sample(m,y.loaded),y.bwEstimate=this.bwEstimator.getEstimate(),l.bitrateTest?this.bitrateTestDelay=m/1e3:this.bitrateTestDelay=0},S.onError=function(d,o){switch(o.details){case B.ErrorDetails.FRAG_LOAD_ERROR:case B.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},S.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},S.getNextABRAutoLevel=function(){var d=this.fragCurrent,o=this.partCurrent,l=this.hls,u=l.maxAutoLevel,y=l.config,m=l.minAutoLevel,h=l.media,w=o?o.duration:d?d.duration:0,E=h?h.currentTime:0,f=h&&h.playbackRate!==0?Math.abs(h.playbackRate):1,c=this.bwEstimator?this.bwEstimator.getEstimate():y.abrEwmaDefaultEstimate,s=(U.BufferHelper.bufferInfo(h,E,y.maxBufferHole).end-E)/f,a=this.findBestLevel(c,m,u,s,y.abrBandWidthFactor,y.abrBandWidthUpFactor);if(a>=0)return a;R.logger.trace((s?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var v=w?Math.min(w,y.maxStarvationDelay):y.maxStarvationDelay,p=y.abrBandWidthFactor,b=y.abrBandWidthUpFactor;if(!s){var O=this.bitrateTestDelay;if(O){var N=w?Math.min(w,y.maxLoadingDelay):y.maxLoadingDelay;v=N-O,R.logger.trace("bitrate test took "+Math.round(1e3*O)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*v)+" ms"),p=b=1}}return a=this.findBestLevel(c,m,u,s+v,p,b),Math.max(a,0)},S.findBestLevel=function(d,o,l,u,y,m){for(var h,w=this.fragCurrent,E=this.partCurrent,f=this.lastLoadedFragLevel,c=this.hls.levels,s=c[f],a=!!(s!=null&&(h=s.details)!==null&&h!==void 0&&h.live),v=s==null?void 0:s.codecSet,p=E?E.duration:w?w.duration:0,b=l;b>=o;b--){var O=c[b];if(!O||v&&O.codecSet!==v)continue;var N=O.details,W=(E?N==null?void 0:N.partTarget:N==null?void 0:N.averagetargetduration)||p,V=void 0;b<=f?V=y*d:V=m*d;var F=c[b].maxBitrate,_=F*W/V;if(R.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+b+"/"+Math.round(V)+"/"+F+"/"+W+"/"+u+"/"+_),V>F&&(!_||a&&!this.bitrateTestDelay||_<u))return b}return-1},T(C,[{key:"nextAutoLevel",get:function(){var d=this._nextAutoLevel,o=this.bwEstimator;if(d!==-1&&(!o||!o.canEstimate()))return d;var l=this.getNextABRAutoLevel();return d!==-1&&(l=Math.min(d,l)),l},set:function(d){this._nextAutoLevel=d}}]),C}();G.default=L},"./src/controller/audio-stream-controller.ts":function(q,G,D){"use strict";D.r(G);var K=D("./src/polyfills/number.ts"),P=D("./src/controller/base-stream-controller.ts"),M=D("./src/events.ts"),U=D("./src/utils/buffer-helper.ts"),B=D("./src/controller/fragment-tracker.ts"),I=D("./src/types/level.ts"),R=D("./src/types/loader.ts"),g=D("./src/loader/fragment.ts"),T=D("./src/demux/chunk-cache.ts"),L=D("./src/demux/transmuxer-interface.ts"),C=D("./src/types/transmuxer.ts"),S=D("./src/controller/fragment-finders.ts"),A=D("./src/utils/discontinuities.ts"),d=D("./src/errors.ts"),o=D("./src/utils/logger.ts");function l(){return l=Object.assign||function(w){for(var E=1;E<arguments.length;E++){var f=arguments[E];for(var c in f)Object.prototype.hasOwnProperty.call(f,c)&&(w[c]=f[c])}return w},l.apply(this,arguments)}function u(w,E){w.prototype=Object.create(E.prototype),w.prototype.constructor=w,y(w,E)}function y(w,E){return y=Object.setPrototypeOf||function(c,s){return c.__proto__=s,c},y(w,E)}var m=100,h=function(w){u(E,w);function E(c,s){var a;return a=w.call(this,c,s,"[audio-stream-controller]")||this,a.videoBuffer=null,a.videoTrackCC=-1,a.waitingVideoCC=-1,a.audioSwitch=!1,a.trackId=-1,a.waitingData=null,a.mainDetails=null,a.bufferFlushed=!1,a._registerListeners(),a}var f=E.prototype;return f.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},f._registerListeners=function(){var s=this.hls;s.on(M.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.on(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.on(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),s.on(M.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),s.on(M.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),s.on(M.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),s.on(M.Events.ERROR,this.onError,this),s.on(M.Events.BUFFER_RESET,this.onBufferReset,this),s.on(M.Events.BUFFER_CREATED,this.onBufferCreated,this),s.on(M.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),s.on(M.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),s.on(M.Events.FRAG_BUFFERED,this.onFragBuffered,this)},f._unregisterListeners=function(){var s=this.hls;s.off(M.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.off(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.off(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.off(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),s.off(M.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),s.off(M.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),s.off(M.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),s.off(M.Events.ERROR,this.onError,this),s.off(M.Events.BUFFER_RESET,this.onBufferReset,this),s.off(M.Events.BUFFER_CREATED,this.onBufferCreated,this),s.off(M.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),s.off(M.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),s.off(M.Events.FRAG_BUFFERED,this.onFragBuffered,this)},f.onInitPtsFound=function(s,a){var v=a.frag,p=a.id,b=a.initPTS;if(p==="main"){var O=v.cc;this.initPTS[v.cc]=b,this.log("InitPTS for cc: "+O+" found from main: "+b),this.videoTrackCC=O,this.state===P.State.WAITING_INIT_PTS&&this.tick()}},f.startLoad=function(s){if(!this.levels){this.startPosition=s,this.state=P.State.STOPPED;return}var a=this.lastCurrentTime;this.stopLoad(),this.setInterval(m),this.fragLoadError=0,a>0&&s===-1?(this.log("Override startPosition with lastCurrentTime @"+a.toFixed(3)),this.state=P.State.IDLE):(this.loadedmetadata=!1,this.state=P.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=s,this.tick()},f.doTick=function(){switch(this.state){case P.State.IDLE:this.doTickIdle();break;case P.State.WAITING_TRACK:{var s,a=this.levels,v=this.trackId,p=a==null||((s=a[v])===null||s===void 0)?void 0:s.details;if(p){if(this.waitForCdnTuneIn(p))break;this.state=P.State.WAITING_INIT_PTS}break}case P.State.FRAG_LOADING_WAITING_RETRY:{var b,O=performance.now(),N=this.retryDate;(!N||O>=N||(b=this.media)!==null&&b!==void 0&&b.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=P.State.IDLE);break}case P.State.WAITING_INIT_PTS:{var W=this.waitingData;if(W){var V=W.frag,F=W.part,_=W.cache,J=W.complete;if(this.initPTS[V.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=P.State.FRAG_LOADING;var ee=_.flush(),oe={frag:V,part:F,payload:ee,networkDetails:null};this._handleFragmentLoadProgress(oe),J&&w.prototype._handleFragmentLoadComplete.call(this,oe)}else if(this.videoTrackCC!==this.waitingVideoCC)o.logger.log("Waiting fragment cc ("+V.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var de=this.getLoadPosition(),Ce=U.BufferHelper.bufferInfo(this.mediaBuffer,de,this.config.maxBufferHole),ge=Object(S.fragmentWithinToleranceTest)(Ce.end,this.config.maxFragLookUpTolerance,V);ge<0&&(o.logger.log("Waiting fragment cc ("+V.cc+") @ "+V.start+" cancelled because another fragment at "+Ce.end+" is needed"),this.clearWaitingFragment())}}else this.state=P.State.IDLE}}this.onTickEnd()},f.clearWaitingFragment=function(){var s=this.waitingData;s&&(this.fragmentTracker.removeFragment(s.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=P.State.IDLE)},f.onTickEnd=function(){var s=this.media;if(!s||!s.readyState)return;var a=this.mediaBuffer?this.mediaBuffer:s,v=a.buffered;!this.loadedmetadata&&v.length&&(this.loadedmetadata=!0),this.lastCurrentTime=s.currentTime},f.doTickIdle=function(){var s,a,v=this.hls,p=this.levels,b=this.media,O=this.trackId,N=v.config;if(!p||!p[O])return;if(!b&&(this.startFragRequested||!N.startFragPrefetch))return;var W=p[O],V=W.details;if(!V||V.live&&this.levelLastLoaded!==O||this.waitForCdnTuneIn(V)){this.state=P.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,g.ElementaryStreamTypes.AUDIO,R.PlaylistLevelType.AUDIO));var F=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,R.PlaylistLevelType.AUDIO);if(F===null)return;var _=F.len,J=this.getMaxBufferLength(),ee=this.audioSwitch;if(_>=J&&!ee)return;if(!ee&&this._streamEnded(F,V)){v.trigger(M.Events.BUFFER_EOS,{type:"audio"}),this.state=P.State.ENDED;return}var oe=V.fragments,de=oe[0].start,Ce=F.end;if(ee){var ge=this.getLoadPosition();Ce=ge,V.PTSKnown&&ge<de&&((F.end>de||F.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),b.currentTime=de+.05))}var pe=this.getNextFragment(Ce,V);if(!pe){this.bufferFlushed=!0;return}((s=pe.decryptdata)===null||s===void 0?void 0:s.keyFormat)==="identity"&&!((a=pe.decryptdata)!==null&&a!==void 0&&a.key)?this.loadKey(pe,V):this.loadFragment(pe,V,Ce)},f.getMaxBufferLength=function(){var s=w.prototype.getMaxBufferLength.call(this),a=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,R.PlaylistLevelType.MAIN);return a===null?s:Math.max(s,a.len)},f.onMediaDetaching=function(){this.videoBuffer=null,w.prototype.onMediaDetaching.call(this)},f.onAudioTracksUpdated=function(s,a){var v=a.audioTracks;this.resetTransmuxer(),this.levels=v.map(function(p){return new I.Level(p)})},f.onAudioTrackSwitching=function(s,a){var v=!!a.url;this.trackId=a.id;var p=this.fragCurrent;p!=null&&p.loader&&p.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),v?this.setInterval(m):this.resetTransmuxer(),v?(this.audioSwitch=!0,this.state=P.State.IDLE):this.state=P.State.STOPPED,this.tick()},f.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},f.onLevelLoaded=function(s,a){this.mainDetails=a.details},f.onAudioTrackLoaded=function(s,a){var v,p=this.levels,b=a.details,O=a.id;if(!p){this.warn("Audio tracks were reset while loading level "+O);return}this.log("Track "+O+" loaded ["+b.startSN+","+b.endSN+"],duration:"+b.totalduration);var N=p[O],W=0;if(b.live||(v=N.details)!==null&&v!==void 0&&v.live){var V=this.mainDetails;if(b.fragments[0]||(b.deltaUpdateFailed=!0),b.deltaUpdateFailed||!V)return;!N.details&&b.hasProgramDateTime&&V.hasProgramDateTime?(Object(A.alignMediaPlaylistByPDT)(b,V),W=b.fragments[0].start):W=this.alignPlaylists(b,N.details)}N.details=b,this.levelLastLoaded=O,!this.startFragRequested&&(this.mainDetails||!b.live)&&this.setStartPosition(N.details,W),this.state===P.State.WAITING_TRACK&&!this.waitForCdnTuneIn(b)&&(this.state=P.State.IDLE),this.tick()},f._handleFragmentLoadProgress=function(s){var a,v=s.frag,p=s.part,b=s.payload,O=this.config,N=this.trackId,W=this.levels;if(!W){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+v.sn+" of level "+v.level+" will not be buffered");return}var V=W[N];console.assert(V,"Audio track is defined on fragment load progress");var F=V.details;console.assert(F,"Audio track details are defined on fragment load progress");var _=O.defaultAudioCodec||V.audioCodec||"mp4a.40.2",J=this.transmuxer;J||(J=this.transmuxer=new L.default(this.hls,R.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var ee=this.initPTS[v.cc],oe=(a=v.initSegment)===null||a===void 0?void 0:a.data;if(ee!==void 0){var de=!1,Ce=p?p.index:-1,ge=Ce!==-1,pe=new C.ChunkMetadata(v.level,v.sn,v.stats.chunkCount,b.byteLength,Ce,ge);J.push(b,oe,_,"",v,p,F.totalduration,de,pe,ee)}else{o.logger.log("Unknown video PTS for cc "+v.cc+", waiting for video PTS before demuxing audio frag "+v.sn+" of ["+F.startSN+" ,"+F.endSN+"],track "+N);var ce=this.waitingData=this.waitingData||{frag:v,part:p,cache:new T.default,complete:!1},he=ce.cache;he.push(new Uint8Array(b)),this.waitingVideoCC=this.videoTrackCC,this.state=P.State.WAITING_INIT_PTS}},f._handleFragmentLoadComplete=function(s){if(this.waitingData){this.waitingData.complete=!0;return}w.prototype._handleFragmentLoadComplete.call(this,s)},f.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},f.onBufferCreated=function(s,a){var v=a.tracks.audio;v&&(this.mediaBuffer=v.buffer),a.tracks.video&&(this.videoBuffer=a.tracks.video.buffer)},f.onFragBuffered=function(s,a){var v=a.frag,p=a.part;if(v.type!==R.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(v)){this.warn("Fragment "+v.sn+(p?" p: "+p.index:"")+" of level "+v.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}v.sn!=="initSegment"&&(this.fragPrevious=v,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(M.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(v,p)},f.onError=function(s,a){switch(a.details){case d.ErrorDetails.FRAG_LOAD_ERROR:case d.ErrorDetails.FRAG_LOAD_TIMEOUT:case d.ErrorDetails.KEY_LOAD_ERROR:case d.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(R.PlaylistLevelType.AUDIO,a);break;case d.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case d.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==P.State.ERROR&&this.state!==P.State.STOPPED&&(this.state=a.fatal?P.State.ERROR:P.State.IDLE,this.warn(a.details+" while loading frag, switching to "+this.state+" state"));break;case d.ErrorDetails.BUFFER_FULL_ERROR:if(a.parent==="audio"&&(this.state===P.State.PARSING||this.state===P.State.PARSED)){var v=!0,p=this.getFwdBufferInfo(this.mediaBuffer,R.PlaylistLevelType.AUDIO);p&&p.len>.5&&(v=!this.reduceMaxBufferLength(p.len)),v&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,w.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},f.onBufferFlushed=function(s,a){var v=a.type;v===g.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},f._handleTransmuxComplete=function(s){var a,v="audio",p=this.hls,b=s.remuxResult,O=s.chunkMeta,N=this.getCurrentContext(O);if(!N){this.warn("The loading context changed while buffering fragment "+O.sn+" of level "+O.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(O.level);return}var W=N.frag,V=N.part,F=b.audio,_=b.text,J=b.id3,ee=b.initSegment;if(this.fragContextChanged(W))return;if(this.state=P.State.PARSING,this.audioSwitch&&F&&this.completeAudioSwitch(),ee!=null&&ee.tracks&&(this._bufferInitSegment(ee.tracks,W,O),p.trigger(M.Events.FRAG_PARSING_INIT_SEGMENT,{frag:W,id:v,tracks:ee.tracks})),F){var oe=F.startPTS,de=F.endPTS,Ce=F.startDTS,ge=F.endDTS;V&&(V.elementaryStreams[g.ElementaryStreamTypes.AUDIO]={startPTS:oe,endPTS:de,startDTS:Ce,endDTS:ge}),W.setElementaryStreamInfo(g.ElementaryStreamTypes.AUDIO,oe,de,Ce,ge),this.bufferFragmentData(F,W,V,O)}if(J!=null&&(a=J.samples)!==null&&a!==void 0&&a.length){var pe=l({frag:W,id:v},J);p.trigger(M.Events.FRAG_PARSING_METADATA,pe)}if(_){var ce=l({frag:W,id:v},_);p.trigger(M.Events.FRAG_PARSING_USERDATA,ce)}},f._bufferInitSegment=function(s,a,v){if(this.state!==P.State.PARSING)return;s.video&&delete s.video;var p=s.audio;if(!p)return;p.levelCodec=p.codec,p.id="audio",this.log("Init audio buffer, container:"+p.container+", codecs[parsed]=["+p.codec+"]"),this.hls.trigger(M.Events.BUFFER_CODECS,s);var b=p.initSegment;if(b!=null&&b.byteLength){var O={type:"audio",frag:a,part:null,chunkMeta:v,parent:a.type,data:b};this.hls.trigger(M.Events.BUFFER_APPENDING,O)}this.tick()},f.loadFragment=function(s,a,v){var p=this.fragmentTracker.getState(s);this.fragCurrent=s,(this.audioSwitch||p===B.FragmentState.NOT_LOADED||p===B.FragmentState.PARTIAL)&&(s.sn==="initSegment"?this._loadInitSegment(s):a.live&&!Object(K.isFiniteNumber)(this.initPTS[s.cc])?(this.log("Waiting for video PTS in continuity counter "+s.cc+" of live stream before loading audio fragment "+s.sn+" of level "+this.trackId),this.state=P.State.WAITING_INIT_PTS):(this.startFragRequested=!0,w.prototype.loadFragment.call(this,s,a,v)))},f.completeAudioSwitch=function(){var s=this.hls,a=this.media,v=this.trackId;a&&(this.log("Switching audio track : flushing all audio"),w.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,s.trigger(M.Events.AUDIO_TRACK_SWITCHED,{id:v})},E}(P.default);G.default=h},"./src/controller/audio-track-controller.ts":function(q,G,D){"use strict";D.r(G);var K=D("./src/events.ts"),P=D("./src/errors.ts"),M=D("./src/controller/base-playlist-controller.ts"),U=D("./src/types/loader.ts");function B(L,C){for(var S=0;S<C.length;S++){var A=C[S];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(L,A.key,A)}}function I(L,C,S){return C&&B(L.prototype,C),S&&B(L,S),L}function R(L,C){L.prototype=Object.create(C.prototype),L.prototype.constructor=L,g(L,C)}function g(L,C){return g=Object.setPrototypeOf||function(A,d){return A.__proto__=d,A},g(L,C)}var T=function(L){R(C,L);function C(A){var d;return d=L.call(this,A,"[audio-track-controller]")||this,d.tracks=[],d.groupId=null,d.tracksInGroup=[],d.trackId=-1,d.trackName="",d.selectDefaultTrack=!0,d.registerListeners(),d}var S=C.prototype;return S.registerListeners=function(){var d=this.hls;d.on(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),d.on(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),d.on(K.Events.LEVEL_LOADING,this.onLevelLoading,this),d.on(K.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),d.on(K.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),d.on(K.Events.ERROR,this.onError,this)},S.unregisterListeners=function(){var d=this.hls;d.off(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),d.off(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),d.off(K.Events.LEVEL_LOADING,this.onLevelLoading,this),d.off(K.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),d.off(K.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),d.off(K.Events.ERROR,this.onError,this)},S.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,L.prototype.destroy.call(this)},S.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},S.onManifestParsed=function(d,o){this.tracks=o.audioTracks||[]},S.onAudioTrackLoaded=function(d,o){var l=o.id,u=o.details,y=this.tracksInGroup[l];if(!y){this.warn("Invalid audio track id "+l);return}var m=y.details;y.details=o.details,this.log("audioTrack "+l+" loaded ["+u.startSN+"-"+u.endSN+"]"),l===this.trackId&&(this.retryCount=0,this.playlistLoaded(l,o,m))},S.onLevelLoading=function(d,o){this.switchLevel(o.level)},S.onLevelSwitching=function(d,o){this.switchLevel(o.level)},S.switchLevel=function(d){var o=this.hls.levels[d];if(!(o!=null&&o.audioGroupIds))return;var l=o.audioGroupIds[o.urlId];if(this.groupId!==l){this.groupId=l;var u=this.tracks.filter(function(m){return!l||m.groupId===l});this.selectDefaultTrack&&!u.some(function(m){return m.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=u;var y={audioTracks:u};this.log("Updating audio tracks, "+u.length+' track(s) found in "'+l+'" group-id'),this.hls.trigger(K.Events.AUDIO_TRACKS_UPDATED,y),this.selectInitialTrack()}},S.onError=function(d,o){if(L.prototype.onError.call(this,d,o),o.fatal||!o.context)return;o.context.type===U.PlaylistContextType.AUDIO_TRACK&&o.context.id===this.trackId&&o.context.groupId===this.groupId&&this.retryLoadingOrFail(o)},S.setAudioTrack=function(d){var o=this.tracksInGroup;if(d<0||d>=o.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var l=o[this.trackId];this.log("Now switching to audio-track index "+d);var u=o[d],y=u.id,m=u.groupId,h=m===void 0?"":m,w=u.name,E=u.type,f=u.url;if(this.trackId=d,this.trackName=w,this.selectDefaultTrack=!1,this.hls.trigger(K.Events.AUDIO_TRACK_SWITCHING,{id:y,groupId:h,name:w,type:E,url:f}),u.details&&!u.details.live)return;var c=this.switchParams(u.url,l==null?void 0:l.details);this.loadPlaylist(c)},S.selectInitialTrack=function(){var d=this.tracksInGroup;console.assert(d.length,"Initial audio track should be selected when tracks are known");var o=this.trackName,l=this.findTrackId(o)||this.findTrackId();l!==-1?this.setAudioTrack(l):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(K.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},S.findTrackId=function(d){for(var o=this.tracksInGroup,l=0;l<o.length;l++){var u=o[l];if((!this.selectDefaultTrack||u.default)&&(!d||d===u.name))return u.id}return-1},S.loadPlaylist=function(d){var o=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(o)){var l=o.id,u=o.groupId,y=o.url;if(d)try{y=d.addDirectives(y)}catch(m){this.warn("Could not construct new URL with HLS Delivery Directives: "+m)}this.log("loading audio-track playlist for id: "+l),this.clearTimer(),this.hls.trigger(K.Events.AUDIO_TRACK_LOADING,{url:y,id:l,groupId:u,deliveryDirectives:d||null})}},I(C,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(d){this.selectDefaultTrack=!1,this.setAudioTrack(d)}}]),C}(M.default);G.default=T},"./src/controller/base-playlist-controller.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"default",function(){return I});var K=D("./src/polyfills/number.ts"),P=D("./src/types/level.ts"),M=D("./src/controller/level-helper.ts"),U=D("./src/utils/logger.ts"),B=D("./src/errors.ts"),I=function(){function R(T,L){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,L+":"),this.warn=U.logger.warn.bind(U.logger,L+":"),this.hls=T}var g=R.prototype;return g.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},g.onError=function(L,C){C.fatal&&C.type===B.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},g.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},g.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},g.stopLoad=function(){this.canLoad=!1,this.clearTimer()},g.switchParams=function(L,C){var S=C==null?void 0:C.renditionReports;if(S)for(var A=0;A<S.length;A++){var d=S[A],o=""+d.URI;if(o===L.substr(-o.length)){var l=parseInt(d["LAST-MSN"]),u=parseInt(d["LAST-PART"]);if(C&&this.hls.config.lowLatencyMode){var y=Math.min(C.age-C.partTarget,C.targetduration);u!==void 0&&y>C.partTarget&&(u+=1)}if(Object(K.isFiniteNumber)(l))return new P.HlsUrlParameters(l,Object(K.isFiniteNumber)(u)?u:void 0,P.HlsSkip.No)}}},g.loadPlaylist=function(L){},g.shouldLoadTrack=function(L){return this.canLoad&&L&&!!L.url&&(!L.details||L.details.live)},g.playlistLoaded=function(L,C,S){var A=this,d=C.details,o=C.stats,l=o.loading.end?Math.max(0,self.performance.now()-o.loading.end):0;if(d.advancedDateTime=Date.now()-l,d.live||S!=null&&S.live){if(d.reloaded(S),S&&this.log("live playlist "+L+" "+(d.advanced?"REFRESHED "+d.lastPartSn+"-"+d.lastPartIndex:"MISSED")),S&&d.fragments.length>0&&Object(M.mergeDetails)(S,d),!this.canLoad||!d.live)return;var u,y=void 0,m=void 0;if(d.canBlockReload&&d.endSN&&d.advanced){var h=this.hls.config.lowLatencyMode,w=d.lastPartSn,E=d.endSN,f=d.lastPartIndex,c=f!==-1,s=w===E,a=h?0:f;c?(y=s?E+1:w,m=s?a:f+1):y=E+1;var v=d.age,p=v+d.ageHeader,b=Math.min(p-d.partTarget,d.targetduration*1.5);if(b>0){if(S&&b>S.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+S.tuneInGoal+" to: "+b+" with playlist age: "+d.age),b=0;else{var O=Math.floor(b/d.targetduration);if(y+=O,m!==void 0){var N=Math.round(b%d.targetduration/d.partTarget);m+=N}this.log("CDN Tune-in age: "+d.ageHeader+"s last advanced "+v.toFixed(2)+"s goal: "+b+" skip sn "+O+" to part "+m)}d.tuneInGoal=b}if(u=this.getDeliveryDirectives(d,C.deliveryDirectives,y,m),h||!s){this.loadPlaylist(u);return}}else u=this.getDeliveryDirectives(d,C.deliveryDirectives,y,m);var W=Object(M.computeReloadInterval)(d,o);y!==void 0&&d.canBlockReload&&(W-=d.partTarget||1),this.log("reload live playlist "+L+" in "+Math.round(W)+" ms"),this.timer=self.setTimeout(function(){return A.loadPlaylist(u)},W)}else this.clearTimer()},g.getDeliveryDirectives=function(L,C,S,A){var d=Object(P.getSkipValue)(L,S);return C!=null&&C.skip&&L.deltaUpdateFailed&&(S=C.msn,A=C.part,d=P.HlsSkip.No),new P.HlsUrlParameters(S,A,d)},g.retryLoadingOrFail=function(L){var C=this,S=this.hls.config,A=this.retryCount<S.levelLoadingMaxRetry;if(A){var d;if(this.retryCount++,L.details.indexOf("LoadTimeOut")>-1&&(d=L.context)!==null&&d!==void 0&&d.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+L.details+'"'),this.loadPlaylist();else{var o=Math.min(Math.pow(2,this.retryCount)*S.levelLoadingRetryDelay,S.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return C.loadPlaylist()},o),this.warn("retry playlist loading #"+this.retryCount+" in "+o+' ms after "'+L.details+'"')}}else this.warn('cannot recover from error "'+L.details+'"'),this.clearTimer(),L.fatal=!0;return A},R}()},"./src/controller/base-stream-controller.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"State",function(){return E}),D.d(G,"default",function(){return f});var K=D("./src/polyfills/number.ts"),P=D("./src/task-loop.ts"),M=D("./src/controller/fragment-tracker.ts"),U=D("./src/utils/buffer-helper.ts"),B=D("./src/utils/logger.ts"),I=D("./src/events.ts"),R=D("./src/errors.ts"),g=D("./src/types/transmuxer.ts"),T=D("./src/utils/mp4-tools.ts"),L=D("./src/utils/discontinuities.ts"),C=D("./src/controller/fragment-finders.ts"),S=D("./src/controller/level-helper.ts"),A=D("./src/loader/fragment-loader.ts"),d=D("./src/crypt/decrypter.ts"),o=D("./src/utils/time-ranges.ts"),l=D("./src/types/loader.ts");function u(c,s){for(var a=0;a<s.length;a++){var v=s[a];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(c,v.key,v)}}function y(c,s,a){return s&&u(c.prototype,s),a&&u(c,a),c}function m(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function h(c,s){c.prototype=Object.create(s.prototype),c.prototype.constructor=c,w(c,s)}function w(c,s){return w=Object.setPrototypeOf||function(v,p){return v.__proto__=p,v},w(c,s)}var E={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",BACKTRACKING:"BACKTRACKING",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"},f=function(c){h(s,c);function s(v,p,b){var O;return O=c.call(this)||this,O.hls=void 0,O.fragPrevious=null,O.fragCurrent=null,O.fragmentTracker=void 0,O.transmuxer=null,O._state=E.STOPPED,O.media=void 0,O.mediaBuffer=void 0,O.config=void 0,O.bitrateTest=!1,O.lastCurrentTime=0,O.nextLoadPosition=0,O.startPosition=0,O.loadedmetadata=!1,O.fragLoadError=0,O.retryDate=0,O.levels=null,O.fragmentLoader=void 0,O.levelLastLoaded=null,O.startFragRequested=!1,O.decrypter=void 0,O.initPTS=[],O.onvseeking=null,O.onvended=null,O.logPrefix="",O.log=void 0,O.warn=void 0,O.logPrefix=b,O.log=B.logger.log.bind(B.logger,b+":"),O.warn=B.logger.warn.bind(B.logger,b+":"),O.hls=v,O.fragmentLoader=new A.default(v.config),O.fragmentTracker=p,O.config=v.config,O.decrypter=new d.default(v,v.config),v.on(I.Events.KEY_LOADED,O.onKeyLoaded,m(O)),O}var a=s.prototype;return a.doTick=function(){this.onTickEnd()},a.onTickEnd=function(){},a.startLoad=function(p){},a.stopLoad=function(){this.fragmentLoader.abort();var p=this.fragCurrent;p&&this.fragmentTracker.removeFragment(p),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=E.STOPPED},a._streamEnded=function(p,b){var O=this.fragCurrent,N=this.fragmentTracker;if(!b.live&&O&&O.sn===b.endSN&&!p.nextStart){var W=N.getState(O);return W===M.FragmentState.PARTIAL||W===M.FragmentState.OK}return!1},a.onMediaAttached=function(p,b){var O=this.media=this.mediaBuffer=b.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),O.addEventListener("seeking",this.onvseeking),O.addEventListener("ended",this.onvended);var N=this.config;this.levels&&N.autoStartLoad&&this.state===E.STOPPED&&this.startLoad(N.startPosition)},a.onMediaDetaching=function(){var p=this.media;p!=null&&p.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),p&&(p.removeEventListener("seeking",this.onvseeking),p.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},a.onMediaSeeking=function(){var p=this.config,b=this.fragCurrent,O=this.media,N=this.mediaBuffer,W=this.state,V=O?O.currentTime:0,F=U.BufferHelper.bufferInfo(N||O,V,p.maxBufferHole);if(this.log("media seeking to "+(Object(K.isFiniteNumber)(V)?V.toFixed(3):V)+", state: "+W),W===E.ENDED)this.resetLoadingState();else if(b&&!F.len){var _=p.maxFragLookUpTolerance,J=b.start-_,ee=b.start+b.duration+_,oe=V>ee;(V<J||oe)&&(oe&&b.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),b.loader.abort()),this.resetLoadingState())}O&&(this.lastCurrentTime=V),!this.loadedmetadata&&!F.len&&(this.nextLoadPosition=this.startPosition=V),this.tickImmediate()},a.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},a.onKeyLoaded=function(p,b){if(this.state!==E.KEY_LOADING||b.frag!==this.fragCurrent||!this.levels)return;this.state=E.IDLE;var O=this.levels[b.frag.level].details;O&&this.loadFragment(b.frag,O,b.frag.start)},a.onHandlerDestroying=function(){this.stopLoad(),c.prototype.onHandlerDestroying.call(this)},a.onHandlerDestroyed=function(){this.state=E.STOPPED,this.hls.off(I.Events.KEY_LOADED,this.onKeyLoaded,this),this.fragmentLoader&&this.fragmentLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.fragmentLoader=this.fragmentTracker=null,c.prototype.onHandlerDestroyed.call(this)},a.loadKey=function(p,b){this.log("Loading key for "+p.sn+" of ["+b.startSN+"-"+b.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+p.level),this.state=E.KEY_LOADING,this.fragCurrent=p,this.hls.trigger(I.Events.KEY_LOADING,{frag:p})},a.loadFragment=function(p,b,O){this._loadFragForPlayback(p,b,O)},a._loadFragForPlayback=function(p,b,O){var N=this,W=function(F){if(N.fragContextChanged(p)){N.warn("Fragment "+p.sn+(F.part?" p: "+F.part.index:"")+" of level "+p.level+" was dropped during download."),N.fragmentTracker.removeFragment(p);return}p.stats.chunkCount++,N._handleFragmentLoadProgress(F)};this._doFragLoad(p,b,O,W).then(function(V){if(!V)return;N.fragLoadError=0;var F=N.state;if(N.fragContextChanged(p)){(F===E.FRAG_LOADING||F===E.BACKTRACKING||!N.fragCurrent&&F===E.PARSING)&&(N.fragmentTracker.removeFragment(p),N.state=E.IDLE);return}if("payload"in V&&(N.log("Loaded fragment "+p.sn+" of level "+p.level),N.hls.trigger(I.Events.FRAG_LOADED,V),N.state===E.BACKTRACKING)){N.fragmentTracker.backtrack(p,V),N.resetFragmentLoading(p);return}N._handleFragmentLoadComplete(V)}).catch(function(V){N.warn(V),N.resetFragmentLoading(p)})},a.flushMainBuffer=function(p,b,O){if(O===void 0&&(O=null),!(p-b))return;var N={startOffset:p,endOffset:b,type:O};this.fragLoadError=0,this.hls.trigger(I.Events.BUFFER_FLUSHING,N)},a._loadInitSegment=function(p){var b=this;this._doFragLoad(p).then(function(O){if(!O||b.fragContextChanged(p)||!b.levels)throw new Error("init load aborted");return O}).then(function(O){var N=b.hls,W=O.payload,V=p.decryptdata;if(W&&W.byteLength>0&&V&&V.key&&V.iv&&V.method==="AES-128"){var F=self.performance.now();return b.decrypter.webCryptoDecrypt(new Uint8Array(W),V.key.buffer,V.iv.buffer).then(function(_){var J=self.performance.now();return N.trigger(I.Events.FRAG_DECRYPTED,{frag:p,payload:_,stats:{tstart:F,tdecrypt:J}}),O.payload=_,O})}return O}).then(function(O){var N=b.fragCurrent,W=b.hls,V=b.levels;if(!V)throw new Error("init load aborted, missing levels");var F=V[p.level].details;console.assert(F,"Level details are defined when init segment is loaded");var _=p.stats;b.state=E.IDLE,b.fragLoadError=0,p.data=new Uint8Array(O.payload),_.parsing.start=_.buffering.start=self.performance.now(),_.parsing.end=_.buffering.end=self.performance.now(),O.frag===N&&W.trigger(I.Events.FRAG_BUFFERED,{stats:_,frag:N,part:null,id:p.type}),b.tick()}).catch(function(O){b.warn(O),b.resetFragmentLoading(p)})},a.fragContextChanged=function(p){var b=this.fragCurrent;return!p||!b||p.level!==b.level||p.sn!==b.sn||p.urlId!==b.urlId},a.fragBufferedComplete=function(p,b){var O=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+p.type+" sn: "+p.sn+(b?" part: "+b.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+p.level+" "+o.default.toString(U.BufferHelper.getBuffered(O))),this.state=E.IDLE,this.tick()},a._handleFragmentLoadComplete=function(p){var b=this.transmuxer;if(!b)return;var O=p.frag,N=p.part,W=p.partsLoaded,V=!W||W.length===0||W.some(function(_){return!_}),F=new g.ChunkMetadata(O.level,O.sn,O.stats.chunkCount+1,0,N?N.index:-1,!V);b.flush(F)},a._handleFragmentLoadProgress=function(p){},a._doFragLoad=function(p,b,O,N){var W=this;if(O===void 0&&(O=null),!this.levels)throw new Error("frag load aborted, missing levels");if(O=Math.max(p.start,O||0),this.config.lowLatencyMode&&b){var V=b.partList;if(V&&N){O>p.end&&b.fragmentHint&&(p=b.fragmentHint);var F=this.getNextPart(V,p,O);if(F>-1){var _=V[F];return this.log("Loading part sn: "+p.sn+" p: "+_.index+" cc: "+p.cc+" of playlist ["+b.startSN+"-"+b.endSN+"] parts [0-"+F+"-"+(V.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+p.level+", target: "+parseFloat(O.toFixed(3))),this.nextLoadPosition=_.start+_.duration,this.state=E.FRAG_LOADING,this.hls.trigger(I.Events.FRAG_LOADING,{frag:p,part:V[F],targetBufferTime:O}),this.doFragPartsLoad(p,V,F,N).catch(function(J){return W.handleFragLoadError(J)})}else if(!p.url||this.loadedEndOfParts(V,O))return Promise.resolve(null)}}return this.log("Loading fragment "+p.sn+" cc: "+p.cc+" "+(b?"of ["+b.startSN+"-"+b.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+p.level+", target: "+parseFloat(O.toFixed(3))),Object(K.isFiniteNumber)(p.sn)&&!this.bitrateTest&&(this.nextLoadPosition=p.start+p.duration),this.state=E.FRAG_LOADING,this.hls.trigger(I.Events.FRAG_LOADING,{frag:p,targetBufferTime:O}),this.fragmentLoader.load(p,N).catch(function(J){return W.handleFragLoadError(J)})},a.doFragPartsLoad=function(p,b,O,N){var W=this;return new Promise(function(V,F){var _=[],J=function ee(oe){var de=b[oe];W.fragmentLoader.loadPart(p,de,N).then(function(Ce){_[de.index]=Ce;var ge=Ce.part;W.hls.trigger(I.Events.FRAG_LOADED,Ce);var pe=b[oe+1];if(pe&&pe.fragment===p)ee(oe+1);else return V({frag:p,part:ge,partsLoaded:_})}).catch(F)};J(O)})},a.handleFragLoadError=function(p){var b=p.data;return b&&b.details===R.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(b.frag,b.part):this.hls.trigger(I.Events.ERROR,b),null},a._handleTransmuxerFlush=function(p){var b=this.getCurrentContext(p);if(!b||this.state!==E.PARSING){this.fragCurrent||(this.state=E.IDLE);return}var O=b.frag,N=b.part,W=b.level,V=self.performance.now();O.stats.parsing.end=V,N&&(N.stats.parsing.end=V),this.updateLevelTiming(O,N,W,p.partial)},a.getCurrentContext=function(p){var b=this.levels,O=p.level,N=p.sn,W=p.part;if(!b||!b[O])return this.warn("Levels object was unset while buffering fragment "+N+" of level "+O+". The current chunk will not be buffered."),null;var V=b[O],F=W>-1?Object(S.getPartWith)(V,N,W):null,_=F?F.fragment:Object(S.getFragmentWithSN)(V,N,this.fragCurrent);return _?{frag:_,part:F,level:V}:null},a.bufferFragmentData=function(p,b,O,N){if(!p||this.state!==E.PARSING)return;var W=p.data1,V=p.data2,F=W;if(W&&V&&(F=Object(T.appendUint8Array)(W,V)),!F||!F.length)return;var _={type:p.type,frag:b,part:O,chunkMeta:N,parent:b.type,data:F};this.hls.trigger(I.Events.BUFFER_APPENDING,_),p.dropped&&p.independent&&!O&&this.flushBufferGap(b)},a.flushBufferGap=function(p){var b=this.media;if(!b)return;if(!U.BufferHelper.isBuffered(b,b.currentTime)){this.flushMainBuffer(0,p.start);return}var O=b.currentTime,N=U.BufferHelper.bufferInfo(b,O,0),W=p.duration,V=Math.min(this.config.maxFragLookUpTolerance*2,W*.25),F=Math.max(Math.min(p.start-V,N.end-V),O+V);p.start-F>V&&this.flushMainBuffer(F,p.start)},a.getFwdBufferInfo=function(p,b){var O=this.config,N=this.getLoadPosition();if(!Object(K.isFiniteNumber)(N))return null;var W=U.BufferHelper.bufferInfo(p,N,O.maxBufferHole);if(W.len===0&&W.nextStart!==void 0){var V=this.fragmentTracker.getBufferedFrag(N,b);if(V&&W.nextStart<V.end)return U.BufferHelper.bufferInfo(p,N,Math.max(W.nextStart,O.maxBufferHole))}return W},a.getMaxBufferLength=function(p){var b=this.config,O;return p?O=Math.max(8*b.maxBufferSize/p,b.maxBufferLength):O=b.maxBufferLength,Math.min(O,b.maxMaxBufferLength)},a.reduceMaxBufferLength=function(p){var b=this.config,O=p||b.maxBufferLength;return b.maxMaxBufferLength>=O?(b.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+b.maxMaxBufferLength+"s"),!0):!1},a.getNextFragment=function(p,b){var O,N,W=b.fragments,V=W.length;if(!V)return null;var F=this.config,_=W[0].start,J;if(b.live){var ee=F.initialLiveManifestSize;if(V<ee)return this.warn("Not enough fragments to start playback (have: "+V+", need: "+ee+")"),null;!b.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(J=this.getInitialLiveFragment(b,W),this.startPosition=J?this.hls.liveSyncPosition||J.start:p)}else p<=_&&(J=W[0]);if(!J){var oe=F.lowLatencyMode?b.partEnd:b.fragmentEnd;J=this.getFragmentAtPosition(p,oe,b)}return(O=J)!==null&&O!==void 0&&O.initSegment&&!((N=J)!==null&&N!==void 0&&N.initSegment.data)&&!this.bitrateTest&&(J=J.initSegment),J},a.getNextPart=function(p,b,O){for(var N=-1,W=!1,V=!0,F=0,_=p.length;F<_;F++){var J=p[F];if(V=V&&!J.independent,N>-1&&O<J.start)break;var ee=J.loaded;!ee&&(W||J.independent||V)&&J.fragment===b&&(N=F),W=ee}return N},a.loadedEndOfParts=function(p,b){var O=p[p.length-1];return O&&b>O.start&&O.loaded},a.getInitialLiveFragment=function(p,b){var O=this.fragPrevious,N=null;if(O){if(p.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+O.programDateTime),N=Object(C.findFragmentByPDT)(b,O.endProgramDateTime,this.config.maxFragLookUpTolerance)),!N){var W=O.sn+1;if(W>=p.startSN&&W<=p.endSN){var V=b[W-p.startSN];O.cc===V.cc&&(N=V,this.log("Live playlist, switching playlist, load frag with next SN: "+N.sn))}N||(N=Object(C.findFragWithCC)(b,O.cc),N&&this.log("Live playlist, switching playlist, load frag with same CC: "+N.sn))}}else{var F=this.hls.liveSyncPosition;F!==null&&(N=this.getFragmentAtPosition(F,this.bitrateTest?p.fragmentEnd:p.edge,p))}return N},a.getFragmentAtPosition=function(p,b,O){var N=this.config,W=this.fragPrevious,V=O.fragments,F=O.endSN,_=O.fragmentHint,J=N.maxFragLookUpTolerance,ee=!!(N.lowLatencyMode&&O.partList&&_);ee&&_&&!this.bitrateTest&&(V=V.concat(_),F=_.sn);var oe;if(p<b){var de=p>b-J?0:J;oe=Object(C.findFragmentByPTS)(W,V,p,de)}else oe=V[V.length-1];if(oe){var Ce=oe.sn-O.startSN,ge=W&&oe.level===W.level,pe=V[Ce+1],ce=this.fragmentTracker.getState(oe);if(ce===M.FragmentState.BACKTRACKED){oe=null;for(var he=Ce;V[he]&&this.fragmentTracker.getState(V[he])===M.FragmentState.BACKTRACKED;)W?oe=V[he--]:oe=V[--he];oe||(oe=pe)}else W&&oe.sn===W.sn&&!ee&&(ge&&(oe.sn<F&&this.fragmentTracker.getState(pe)!==M.FragmentState.OK?(this.log("SN "+oe.sn+" just loaded, load next one: "+pe.sn),oe=pe):oe=null))}return oe},a.synchronizeToLiveEdge=function(p){var b=this.config,O=this.media;if(!O)return;var N=this.hls.liveSyncPosition,W=O.currentTime,V=p.fragments[0].start,F=p.edge,_=W>=V-b.maxFragLookUpTolerance&&W<=F;if(N!==null&&O.duration>N&&(W<N||!_)){var J=b.liveMaxLatencyDuration!==void 0?b.liveMaxLatencyDuration:b.liveMaxLatencyDurationCount*p.targetduration;(!_&&O.readyState<4||W<F-J)&&(this.loadedmetadata||(this.nextLoadPosition=N),O.readyState&&(this.warn("Playback: "+W.toFixed(3)+" is located too far from the end of live sliding playlist: "+F+", reset currentTime to : "+N.toFixed(3)),O.currentTime=N))}},a.alignPlaylists=function(p,b){var O=this.levels,N=this.levelLastLoaded,W=this.fragPrevious,V=N!==null?O[N]:null,F=p.fragments.length;if(!F)return this.warn("No fragments in live playlist"),0;var _=p.fragments[0].start,J=!b,ee=p.alignedSliding&&Object(K.isFiniteNumber)(_);if(J||!ee&&!_){Object(L.alignStream)(W,V,p);var oe=p.fragments[0].start;return this.log("Live playlist sliding: "+oe.toFixed(2)+" start-sn: "+(b?b.startSN:"na")+"->"+p.startSN+" prev-sn: "+(W?W.sn:"na")+" fragments: "+F),oe}return _},a.waitForCdnTuneIn=function(p){var b=3;return p.live&&p.canBlockReload&&p.tuneInGoal>Math.max(p.partHoldBack,p.partTarget*b)},a.setStartPosition=function(p,b){var O=this.startPosition;if(O<b&&(O=-1),O===-1||this.lastCurrentTime===-1){var N=p.startTimeOffset;Object(K.isFiniteNumber)(N)?(O=b+N,N<0&&(O+=p.totalduration),O=Math.min(Math.max(b,O),b+p.totalduration),this.log("Start time offset "+N+" found in playlist, adjust startPosition to "+O),this.startPosition=O):p.live?O=this.hls.liveSyncPosition||b:this.startPosition=O=0,this.lastCurrentTime=O}this.nextLoadPosition=O},a.getLoadPosition=function(){var p=this.media,b=0;return this.loadedmetadata&&p?b=p.currentTime:this.nextLoadPosition&&(b=this.nextLoadPosition),b},a.handleFragLoadAborted=function(p,b){this.transmuxer&&p.sn!=="initSegment"&&p.stats.aborted&&(this.warn("Fragment "+p.sn+(b?" part"+b.index:"")+" of level "+p.level+" was aborted"),this.resetFragmentLoading(p))},a.resetFragmentLoading=function(p){(!this.fragCurrent||!this.fragContextChanged(p))&&(this.state=E.IDLE)},a.onFragmentOrKeyLoadError=function(p,b){if(b.fatal)return;var O=b.frag;if(!O||O.type!==p)return;var N=this.fragCurrent;console.assert(N&&O.sn===N.sn&&O.level===N.level&&O.urlId===N.urlId,"Frag load error must match current frag to retry");var W=this.config;if(this.fragLoadError+1<=W.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(O.level))return;var V=Math.min(Math.pow(2,this.fragLoadError)*W.fragLoadingRetryDelay,W.fragLoadingMaxRetryTimeout);this.warn("Fragment "+O.sn+" of "+p+" "+O.level+" failed to load, retrying in "+V+"ms"),this.retryDate=self.performance.now()+V,this.fragLoadError++,this.state=E.FRAG_LOADING_WAITING_RETRY}else b.levelRetry?(p===l.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=E.IDLE):(B.logger.error(b.details+" reaches max retry, redispatch as fatal ..."),b.fatal=!0,this.hls.stopLoad(),this.state=E.ERROR)},a.afterBufferFlushed=function(p,b,O){if(!p)return;var N=U.BufferHelper.getBuffered(p);this.fragmentTracker.detectEvictedFragments(b,N,O),this.state===E.ENDED&&this.resetLoadingState()},a.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=E.IDLE},a.resetLiveStartWhenNotLoaded=function(p){if(!this.loadedmetadata){this.startFragRequested=!1;var b=this.levels?this.levels[p].details:null;if(b!=null&&b.live)return this.startPosition=-1,this.setStartPosition(b,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},a.updateLevelTiming=function(p,b,O,N){var W=this,V=O.details;console.assert(!!V,"level.details must be defined");var F=Object.keys(p.elementaryStreams).reduce(function(_,J){var ee=p.elementaryStreams[J];if(ee){var oe=ee.endPTS-ee.startPTS;if(oe<=0)return W.warn("Could not parse fragment "+p.sn+" "+J+" duration reliably ("+oe+") resetting transmuxer to fallback to playlist timing"),W.resetTransmuxer(),_||!1;var de=N?0:Object(S.updateFragPTSDTS)(V,p,ee.startPTS,ee.endPTS,ee.startDTS,ee.endDTS);return W.hls.trigger(I.Events.LEVEL_PTS_UPDATED,{details:V,level:O,drift:de,type:J,frag:p,start:ee.startPTS,end:ee.endPTS}),!0}return _},!1);F?(this.state=E.PARSED,this.hls.trigger(I.Events.FRAG_PARSED,{frag:p,part:b})):this.resetLoadingState()},a.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},y(s,[{key:"state",get:function(){return this._state},set:function(p){var b=this._state;b!==p&&(this._state=p,this.log(b+"->"+p))}}]),s}(P.default)},"./src/controller/buffer-controller.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"default",function(){return C});var K=D("./src/polyfills/number.ts"),P=D("./src/events.ts"),M=D("./src/utils/logger.ts"),U=D("./src/errors.ts"),B=D("./src/utils/buffer-helper.ts"),I=D("./src/utils/mediasource-helper.ts"),R=D("./src/loader/fragment.ts"),g=D("./src/controller/buffer-operation-queue.ts"),T=Object(I.getMediaSource)(),L=/([ha]vc.)(?:\.[^.,]+)+/,C=function(){function S(d){var o=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 l=o.hls,u=o.media,y=o.mediaSource;M.logger.log("[buffer-controller]: Media source opened"),u&&(o.updateMediaElementDuration(),l.trigger(P.Events.MEDIA_ATTACHED,{media:u})),y&&y.removeEventListener("sourceopen",o._onMediaSourceOpen),o.checkPendingTracks()},this._onMediaSourceClose=function(){M.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){M.logger.log("[buffer-controller]: Media source ended")},this.hls=d,this._initSourceBuffer(),this.registerListeners()}var A=S.prototype;return A.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},A.destroy=function(){this.unregisterListeners(),this.details=null},A.registerListeners=function(){var o=this.hls;o.on(P.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),o.on(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.on(P.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.on(P.Events.BUFFER_RESET,this.onBufferReset,this),o.on(P.Events.BUFFER_APPENDING,this.onBufferAppending,this),o.on(P.Events.BUFFER_CODECS,this.onBufferCodecs,this),o.on(P.Events.BUFFER_EOS,this.onBufferEos,this),o.on(P.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),o.on(P.Events.LEVEL_UPDATED,this.onLevelUpdated,this),o.on(P.Events.FRAG_PARSED,this.onFragParsed,this),o.on(P.Events.FRAG_CHANGED,this.onFragChanged,this)},A.unregisterListeners=function(){var o=this.hls;o.off(P.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),o.off(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.off(P.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.off(P.Events.BUFFER_RESET,this.onBufferReset,this),o.off(P.Events.BUFFER_APPENDING,this.onBufferAppending,this),o.off(P.Events.BUFFER_CODECS,this.onBufferCodecs,this),o.off(P.Events.BUFFER_EOS,this.onBufferEos,this),o.off(P.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),o.off(P.Events.LEVEL_UPDATED,this.onLevelUpdated,this),o.off(P.Events.FRAG_PARSED,this.onFragParsed,this),o.off(P.Events.FRAG_CHANGED,this.onFragChanged,this)},A._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new g.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},A.onManifestParsed=function(o,l){var u=2;(l.audio&&!l.video||!l.altAudio)&&(u=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=u,this.details=null,M.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},A.onMediaAttaching=function(o,l){var u=this.media=l.media;if(u&&T){var y=this.mediaSource=new T;y.addEventListener("sourceopen",this._onMediaSourceOpen),y.addEventListener("sourceended",this._onMediaSourceEnded),y.addEventListener("sourceclose",this._onMediaSourceClose),u.src=self.URL.createObjectURL(y),this._objectUrl=u.src}},A.onMediaDetaching=function(){var o=this.media,l=this.mediaSource,u=this._objectUrl;if(l){if(M.logger.log("[buffer-controller]: media source detaching"),l.readyState==="open")try{l.endOfStream()}catch(y){M.logger.warn("[buffer-controller]: onMediaDetaching: "+y.message+" while calling endOfStream")}this.onBufferReset(),l.removeEventListener("sourceopen",this._onMediaSourceOpen),l.removeEventListener("sourceended",this._onMediaSourceEnded),l.removeEventListener("sourceclose",this._onMediaSourceClose),o&&(u&&self.URL.revokeObjectURL(u),o.src===u?(o.removeAttribute("src"),o.load()):M.logger.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(P.Events.MEDIA_DETACHED,void 0)},A.onBufferReset=function(){var o=this;this.getSourceBufferTypes().forEach(function(l){var u=o.sourceBuffer[l];try{u&&(o.removeBufferListeners(l),o.mediaSource&&o.mediaSource.removeSourceBuffer(u),o.sourceBuffer[l]=void 0)}catch(y){M.logger.warn("[buffer-controller]: Failed to reset the "+l+" buffer",y)}}),this._initSourceBuffer()},A.onBufferCodecs=function(o,l){var u=this,y=this.getSourceBufferTypes().length;if(Object.keys(l).forEach(function(m){if(y){var h=u.tracks[m];if(h&&typeof h.buffer.changeType=="function"){var w=l[m],E=w.codec,f=w.levelCodec,c=w.container,s=(h.levelCodec||h.codec).replace(L,"$1"),a=(f||E).replace(L,"$1");if(s!==a){var v=c+";codecs="+(f||E);u.appendChangeType(m,v)}}}else u.pendingTracks[m]=l[m]}),y)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},A.appendChangeType=function(o,l){var u=this,y=this.operationQueue,m={execute:function(){var w=u.sourceBuffer[o];w&&(M.logger.log("[buffer-controller]: changing "+o+" sourceBuffer type to "+l),w.changeType(l)),y.shiftAndExecuteNext(o)},onStart:function(){},onComplete:function(){},onError:function(w){M.logger.warn("[buffer-controller]: Failed to change "+o+" SourceBuffer type",w)}};y.append(m,o)},A.onBufferAppending=function(o,l){var u=this,y=this.hls,m=this.operationQueue,h=this.tracks,w=l.data,E=l.type,f=l.frag,c=l.part,s=l.chunkMeta,a=s.buffering[E],v=self.performance.now();a.start=v;var p=f.stats.buffering,b=c?c.stats.buffering:null;p.start===0&&(p.start=v),b&&b.start===0&&(b.start=v);var O=h.audio,N=E==="audio"&&s.id===1&&(O==null?void 0:O.container)==="audio/mpeg",W={execute:function(){if(a.executeStart=self.performance.now(),N){var F=u.sourceBuffer[E];if(F){var _=f.start-F.timestampOffset;Math.abs(_)>=.1&&(M.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+f.start+" (delta: "+_+") sn: "+f.sn+")"),F.timestampOffset=f.start)}}u.appendExecutor(w,E)},onStart:function(){},onComplete:function(){var F=self.performance.now();a.executeEnd=a.end=F,p.first===0&&(p.first=F),b&&b.first===0&&(b.first=F);var _=u.sourceBuffer,J={};for(var ee in _)J[ee]=B.BufferHelper.getBuffered(_[ee]);u.appendError=0,u.hls.trigger(P.Events.BUFFER_APPENDED,{type:E,frag:f,part:c,chunkMeta:s,parent:f.type,timeRanges:J})},onError:function(F){M.logger.error("[buffer-controller]: Error encountered while trying to append to the "+E+" SourceBuffer",F);var _={type:U.ErrorTypes.MEDIA_ERROR,parent:f.type,details:U.ErrorDetails.BUFFER_APPEND_ERROR,err:F,fatal:!1};F.code===DOMException.QUOTA_EXCEEDED_ERR?_.details=U.ErrorDetails.BUFFER_FULL_ERROR:(u.appendError++,_.details=U.ErrorDetails.BUFFER_APPEND_ERROR,u.appendError>y.config.appendErrorMaxRetry&&(M.logger.error("[buffer-controller]: Failed "+y.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),_.fatal=!0)),y.trigger(P.Events.ERROR,_)}};m.append(W,E)},A.onBufferFlushing=function(o,l){var u=this,y=this.operationQueue,m=function(w){return{execute:u.removeExecutor.bind(u,w,l.startOffset,l.endOffset),onStart:function(){},onComplete:function(){u.hls.trigger(P.Events.BUFFER_FLUSHED,{type:w})},onError:function(f){M.logger.warn("[buffer-controller]: Failed to remove from "+w+" SourceBuffer",f)}}};l.type?y.append(m(l.type),l.type):this.getSourceBufferTypes().forEach(function(h){y.append(m(h),h)})},A.onFragParsed=function(o,l){var u=this,y=l.frag,m=l.part,h=[],w=m?m.elementaryStreams:y.elementaryStreams;w[R.ElementaryStreamTypes.AUDIOVIDEO]?h.push("audiovideo"):(w[R.ElementaryStreamTypes.AUDIO]&&h.push("audio"),w[R.ElementaryStreamTypes.VIDEO]&&h.push("video"));var E=function(){var c=self.performance.now();y.stats.buffering.end=c,m&&(m.stats.buffering.end=c);var s=m?m.stats:y.stats;u.hls.trigger(P.Events.FRAG_BUFFERED,{frag:y,part:m,stats:s,id:y.type})};h.length===0&&M.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+y.type+" level: "+y.level+" sn: "+y.sn),this.blockBuffers(E,h)},A.onFragChanged=function(o,l){this.flushBackBuffer()},A.onBufferEos=function(o,l){var u=this,y=this.getSourceBufferTypes().reduce(function(m,h){var w=u.sourceBuffer[h];return(!l.type||l.type===h)&&(w&&!w.ended&&(w.ended=!0,M.logger.log("[buffer-controller]: "+h+" sourceBuffer now EOS"))),m&&!!(!w||w.ended)},!0);y&&this.blockBuffers(function(){var m=u.mediaSource;if(!m||m.readyState!=="open")return;m.endOfStream()})},A.onLevelUpdated=function(o,l){var u=l.details;if(!u.fragments.length)return;this.details=u,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},A.flushBackBuffer=function(){var o=this.hls,l=this.details,u=this.media,y=this.sourceBuffer;if(!u||l===null)return;var m=this.getSourceBufferTypes();if(!m.length)return;var h=l.live&&o.config.liveBackBufferLength!==null?o.config.liveBackBufferLength:o.config.backBufferLength;if(!Object(K.isFiniteNumber)(h)||h<0)return;var w=u.currentTime,E=l.levelTargetDuration,f=Math.max(h,E),c=Math.floor(w/E)*E-f;m.forEach(function(s){var a=y[s];if(a){var v=B.BufferHelper.getBuffered(a);v.length>0&&c>v.start(0)&&(o.trigger(P.Events.BACK_BUFFER_REACHED,{bufferEnd:c}),l.live&&o.trigger(P.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:c}),o.trigger(P.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:c,type:s}))}})},A.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var o=this.details,l=this.hls,u=this.media,y=this.mediaSource,m=o.fragments[0].start+o.totalduration,h=u.duration,w=Object(K.isFiniteNumber)(y.duration)?y.duration:0;o.live&&l.config.liveDurationInfinity?(M.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),y.duration=Infinity,this.updateSeekableRange(o)):(m>w&&m>h||!Object(K.isFiniteNumber)(h))&&(M.logger.log("[buffer-controller]: Updating Media Source duration to "+m.toFixed(3)),y.duration=m)},A.updateSeekableRange=function(o){var l=this.mediaSource,u=o.fragments,y=u.length;if(y&&o.live&&l!==null&&l!==void 0&&l.setLiveSeekableRange){var m=Math.max(0,u[0].start),h=Math.max(m,m+o.totalduration);l.setLiveSeekableRange(m,h)}},A.checkPendingTracks=function(){var o=this.bufferCodecEventsExpected,l=this.operationQueue,u=this.pendingTracks,y=Object.keys(u).length;if(y&&!o||y===2){this.createSourceBuffers(u),this.pendingTracks={};var m=this.getSourceBufferTypes();if(m.length===0){this.hls.trigger(P.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}m.forEach(function(h){l.executeNext(h)})}},A.createSourceBuffers=function(o){var l=this.sourceBuffer,u=this.mediaSource;if(!u)throw Error("createSourceBuffers called when mediaSource was null");var y=0;for(var m in o)if(!l[m]){var h=o[m];if(!h)throw Error("source buffer exists for track "+m+", however track does not");var w=h.levelCodec||h.codec,E=h.container+";codecs="+w;M.logger.log("[buffer-controller]: creating sourceBuffer("+E+")");try{var f=l[m]=u.addSourceBuffer(E),c=m;this.addBufferListener(c,"updatestart",this._onSBUpdateStart),this.addBufferListener(c,"updateend",this._onSBUpdateEnd),this.addBufferListener(c,"error",this._onSBUpdateError),this.tracks[m]={buffer:f,codec:w,container:h.container,levelCodec:h.levelCodec,id:h.id},y++}catch(s){M.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+s.message),this.hls.trigger(P.Events.ERROR,{type:U.ErrorTypes.MEDIA_ERROR,details:U.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:s,mimeType:E})}}y&&this.hls.trigger(P.Events.BUFFER_CREATED,{tracks:this.tracks})},A._onSBUpdateStart=function(o){var l=this.operationQueue,u=l.current(o);u.onStart()},A._onSBUpdateEnd=function(o){var l=this.operationQueue,u=l.current(o);u.onComplete(),l.shiftAndExecuteNext(o)},A._onSBUpdateError=function(o,l){M.logger.error("[buffer-controller]: "+o+" SourceBuffer error",l),this.hls.trigger(P.Events.ERROR,{type:U.ErrorTypes.MEDIA_ERROR,details:U.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var u=this.operationQueue.current(o);u&&u.onError(l)},A.removeExecutor=function(o,l,u){var y=this.media,m=this.mediaSource,h=this.operationQueue,w=this.sourceBuffer,E=w[o];if(!y||!m||!E){M.logger.warn("[buffer-controller]: Attempting to remove from the "+o+" SourceBuffer, but it does not exist"),h.shiftAndExecuteNext(o);return}var f=Object(K.isFiniteNumber)(y.duration)?y.duration:Infinity,c=Object(K.isFiniteNumber)(m.duration)?m.duration:Infinity,s=Math.max(0,l),a=Math.min(u,f,c);a>s?(M.logger.log("[buffer-controller]: Removing ["+s+","+a+"] from the "+o+" SourceBuffer"),console.assert(!E.updating,o+" sourceBuffer must not be updating"),E.remove(s,a)):h.shiftAndExecuteNext(o)},A.appendExecutor=function(o,l){var u=this.operationQueue,y=this.sourceBuffer,m=y[l];if(!m){M.logger.warn("[buffer-controller]: Attempting to append to the "+l+" SourceBuffer, but it does not exist"),u.shiftAndExecuteNext(l);return}m.ended=!1,console.assert(!m.updating,l+" sourceBuffer must not be updating"),m.appendBuffer(o)},A.blockBuffers=function(o,l){var u=this;if(l===void 0&&(l=this.getSourceBufferTypes()),!l.length){M.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(o);return}var y=this.operationQueue,m=l.map(function(h){return y.appendBlocker(h)});Promise.all(m).then(function(){o(),l.forEach(function(h){var w=u.sourceBuffer[h];(!w||!w.updating)&&y.shiftAndExecuteNext(h)})})},A.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},A.addBufferListener=function(o,l,u){var y=this.sourceBuffer[o];if(!y)return;var m=u.bind(this,o);this.listeners[o].push({event:l,listener:m}),y.addEventListener(l,m)},A.removeBufferListeners=function(o){var l=this.sourceBuffer[o];if(!l)return;this.listeners[o].forEach(function(u){l.removeEventListener(u.event,u.listener)})},S}()},"./src/controller/buffer-operation-queue.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"default",function(){return P});var K=D("./src/utils/logger.ts"),P=function(){function M(B){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=B}var U=M.prototype;return U.append=function(I,R){var g=this.queues[R];g.push(I),g.length===1&&this.buffers[R]&&this.executeNext(R)},U.insertAbort=function(I,R){var g=this.queues[R];g.unshift(I),this.executeNext(R)},U.appendBlocker=function(I){var R,g=new Promise(function(L){R=L}),T={execute:R,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(T,I),g},U.executeNext=function(I){var R=this.buffers,g=this.queues,T=R[I],L=g[I];if(L.length){var C=L[0];try{C.execute()}catch(S){K.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),C.onError(S),(!T||!T.updating)&&(L.shift(),this.executeNext(I))}}},U.shiftAndExecuteNext=function(I){this.queues[I].shift(),this.executeNext(I)},U.current=function(I){return this.queues[I][0]},M}()},"./src/controller/cap-level-controller.ts":function(q,G,D){"use strict";D.r(G);var K=D("./src/events.ts");function P(B,I){for(var R=0;R<I.length;R++){var g=I[R];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(B,g.key,g)}}function M(B,I,R){return I&&P(B.prototype,I),R&&P(B,R),B}var U=function(){function B(R){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=R,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var I=B.prototype;return I.setStreamController=function(g){this.streamController=g},I.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},I.registerListeners=function(){var g=this.hls;g.on(K.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),g.on(K.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),g.on(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),g.on(K.Events.BUFFER_CODECS,this.onBufferCodecs,this),g.on(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},I.unregisterListener=function(){var g=this.hls;g.off(K.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),g.off(K.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),g.off(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),g.off(K.Events.BUFFER_CODECS,this.onBufferCodecs,this),g.off(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},I.onFpsDropLevelCapping=function(g,T){B.isLevelAllowed(T.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(T.droppedLevel)},I.onMediaAttaching=function(g,T){this.media=T.media instanceof HTMLVideoElement?T.media:null},I.onManifestParsed=function(g,T){var L=this.hls;this.restrictedLevels=[],this.firstLevel=T.firstLevel,L.config.capLevelToPlayerSize&&T.video&&this.startCapping()},I.onBufferCodecs=function(g,T){var L=this.hls;L.config.capLevelToPlayerSize&&T.video&&this.startCapping()},I.onMediaDetaching=function(){this.stopCapping()},I.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var g=this.hls.levels;if(g.length){var T=this.hls;T.autoLevelCapping=this.getMaxLevel(g.length-1),T.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=T.autoLevelCapping}}},I.getMaxLevel=function(g){var T=this,L=this.hls.levels;if(!L.length)return-1;var C=L.filter(function(S,A){return B.isLevelAllowed(A,T.restrictedLevels)&&A<=g});return this.clientRect=null,B.getMaxLevelByMediaSize(C,this.mediaWidth,this.mediaHeight)},I.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()},I.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},I.getDimensions=function(){if(this.clientRect)return this.clientRect;var g=this.media,T={width:0,height:0};if(g){var L=g.getBoundingClientRect();T.width=L.width,T.height=L.height,!T.width&&!T.height&&(T.width=L.right-L.left||g.width||0,T.height=L.bottom-L.top||g.height||0)}return this.clientRect=T,T},B.isLevelAllowed=function(g,T){return T===void 0&&(T=[]),T.indexOf(g)===-1},B.getMaxLevelByMediaSize=function(g,T,L){if(!g||!g.length)return-1;for(var C=function(l,u){return u?l.width!==u.width||l.height!==u.height:!0},S=g.length-1,A=0;A<g.length;A+=1){var d=g[A];if((d.width>=T||d.height>=L)&&C(d,g[A+1])){S=A;break}}return S},M(B,[{key:"mediaWidth",get:function(){return this.getDimensions().width*B.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*B.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var g=1;try{g=self.devicePixelRatio}catch(T){}return g}}]),B}();G.default=U},"./src/controller/cmcd-controller.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"default",function(){return C});var K=D("./src/events.ts"),P=D("./src/types/cmcd.ts"),M=D("./src/utils/buffer-helper.ts"),U=D("./src/utils/logger.ts");function B(S,A){for(var d=0;d<A.length;d++){var o=A[d];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(S,o.key,o)}}function I(S,A,d){return A&&B(S.prototype,A),d&&B(S,d),S}function R(S,A){var d=typeof Symbol!="undefined"&&S[Symbol.iterator]||S["@@iterator"];if(d)return(d=d.call(S)).next.bind(d);if(Array.isArray(S)||(d=g(S))||A&&S&&typeof S.length=="number"){d&&(S=d);var o=0;return function(){return o>=S.length?{done:!0}:{done:!1,value:S[o++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function g(S,A){if(!S)return;if(typeof S=="string")return T(S,A);var d=Object.prototype.toString.call(S).slice(8,-1);if(d==="Object"&&S.constructor&&(d=S.constructor.name),d==="Map"||d==="Set")return Array.from(S);if(d==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d))return T(S,A)}function T(S,A){(A==null||A>S.length)&&(A=S.length);for(var d=0,o=new Array(A);d<A;d++)o[d]=S[d];return o}function L(){return L=Object.assign||function(S){for(var A=1;A<arguments.length;A++){var d=arguments[A];for(var o in d)Object.prototype.hasOwnProperty.call(d,o)&&(S[o]=d[o])}return S},L.apply(this,arguments)}var C=function(){function S(d){var o=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(){o.initialized&&(o.starved=!0),o.buffering=!0},this.onPlaying=function(){o.initialized||(o.initialized=!0),o.buffering=!1},this.applyPlaylistData=function(y){try{o.apply(y,{ot:P.CMCDObjectType.MANIFEST,su:!o.initialized})}catch(m){U.logger.warn("Could not generate manifest CMCD data.",m)}},this.applyFragmentData=function(y){try{var m=y.frag,h=o.hls.levels[m.level],w=o.getObjectType(m),E={d:m.duration*1e3,ot:w};(w===P.CMCDObjectType.VIDEO||w===P.CMCDObjectType.AUDIO||w==P.CMCDObjectType.MUXED)&&(E.br=h.bitrate/1e3,E.tb=o.getTopBandwidth(w),E.bl=o.getBufferLength(w)),o.apply(y,E)}catch(f){U.logger.warn("Could not generate segment CMCD data.",f)}},this.hls=d;var l=this.config=d.config,u=l.cmcd;u!=null&&(l.pLoader=this.createPlaylistLoader(),l.fLoader=this.createFragmentLoader(),this.sid=u.sessionId||S.uuid(),this.cid=u.contentId,this.useHeaders=u.useHeaders===!0,this.registerListeners())}var A=S.prototype;return A.registerListeners=function(){var o=this.hls;o.on(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),o.on(K.Events.MEDIA_DETACHED,this.onMediaDetached,this),o.on(K.Events.BUFFER_CREATED,this.onBufferCreated,this)},A.unregisterListeners=function(){var o=this.hls;o.off(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),o.off(K.Events.MEDIA_DETACHED,this.onMediaDetached,this),o.off(K.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},A.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},A.onMediaAttached=function(o,l){this.media=l.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},A.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},A.onBufferCreated=function(o,l){var u,y;this.audioBuffer=(u=l.tracks.audio)===null||u===void 0?void 0:u.buffer,this.videoBuffer=(y=l.tracks.video)===null||y===void 0?void 0:y.buffer},A.createData=function(){var o;return{v:P.CMCDVersion,sf:P.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(o=this.media)===null||o===void 0?void 0:o.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},A.apply=function(o,l){l===void 0&&(l={}),L(l,this.createData());var u=l.ot===P.CMCDObjectType.INIT||l.ot===P.CMCDObjectType.VIDEO||l.ot===P.CMCDObjectType.MUXED;if(this.starved&&u&&(l.bs=!0,l.su=!0,this.starved=!1),l.su==null&&(l.su=this.buffering),this.useHeaders){var y=S.toHeaders(l);if(!Object.keys(y).length)return;o.headers||(o.headers={}),L(o.headers,y)}else{var m=S.toQuery(l);if(!m)return;o.url=S.appendQueryToUri(o.url,m)}},A.getObjectType=function(o){var l=o.type;return l==="subtitle"?P.CMCDObjectType.TIMED_TEXT:o.sn==="initSegment"?P.CMCDObjectType.INIT:l==="audio"?P.CMCDObjectType.AUDIO:l==="main"?this.hls.audioTracks.length?P.CMCDObjectType.VIDEO:P.CMCDObjectType.MUXED:void 0},A.getTopBandwidth=function(o){for(var l=0,u=o===P.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,y=R(u),m;!(m=y()).done;){var h=m.value;h.bitrate>l&&(l=h.bitrate)}return l>0?l:NaN},A.getBufferLength=function(o){var l=this.hls.media,u=o===P.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!u||!l)return NaN;var y=M.BufferHelper.bufferInfo(u,l.currentTime,this.config.maxBufferHole);return y.len*1e3},A.createPlaylistLoader=function(){var o=this.config.pLoader,l=this.applyPlaylistData,u=o||this.config.loader;return function(){function y(h){this.loader=void 0,this.loader=new u(h)}var m=y.prototype;return m.destroy=function(){this.loader.destroy()},m.abort=function(){this.loader.abort()},m.load=function(w,E,f){l(w),this.loader.load(w,E,f)},I(y,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),y}()},A.createFragmentLoader=function(){var o=this.config.fLoader,l=this.applyFragmentData,u=o||this.config.loader;return function(){function y(h){this.loader=void 0,this.loader=new u(h)}var m=y.prototype;return m.destroy=function(){this.loader.destroy()},m.abort=function(){this.loader.abort()},m.load=function(w,E,f){l(w),this.loader.load(w,E,f)},I(y,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),y}()},S.uuid=function(){var o=URL.createObjectURL(new Blob),l=o.toString();return URL.revokeObjectURL(o),l.substr(l.lastIndexOf("/")+1)},S.serialize=function(o){for(var l=[],u=function(N){return!Number.isNaN(N)&&N!=null&&N!==""&&N!==!1},y=function(N){return Math.round(N)},m=function(N){return y(N/100)*100},h=function(N){return encodeURIComponent(N)},w={br:y,d:y,bl:m,dl:m,mtp:m,nor:h,rtp:m,tb:y},E=Object.keys(o||{}).sort(),f=R(E),c;!(c=f()).done;){var s=c.value,a=o[s];if(!u(a))continue;if(s==="v"&&a===1)continue;if(s=="pr"&&a===1)continue;var v=w[s];v&&(a=v(a));var p=typeof a,b=void 0;s==="ot"||s==="sf"||s==="st"?b=s+"="+a:p==="boolean"?b=s:p==="number"?b=s+"="+a:b=s+"="+JSON.stringify(a),l.push(b)}return l.join(",")},S.toHeaders=function(o){for(var l=Object.keys(o),u={},y=["Object","Request","Session","Status"],m=[{},{},{},{}],h={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},w=0,E=l;w<E.length;w++){var f=E[w],c=h[f]!=null?h[f]:1;m[c][f]=o[f]}for(var s=0;s<m.length;s++){var a=S.serialize(m[s]);a&&(u["CMCD-"+y[s]]=a)}return u},S.toQuery=function(o){return"CMCD="+encodeURIComponent(S.serialize(o))},S.appendQueryToUri=function(o,l){if(!l)return o;var u=o.includes("?")?"&":"?";return""+o+u+l},S}()},"./src/controller/eme-controller.ts":function(q,G,D){"use strict";D.r(G);var K=D("./src/events.ts"),P=D("./src/errors.ts"),M=D("./src/utils/logger.ts"),U=D("./src/utils/mediakeys-helper.ts");function B(C,S){for(var A=0;A<S.length;A++){var d=S[A];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(C,d.key,d)}}function I(C,S,A){return S&&B(C.prototype,S),A&&B(C,A),C}var R=3,g=function(S,A,d){var o={audioCapabilities:[],videoCapabilities:[]};return S.forEach(function(l){o.audioCapabilities.push({contentType:'audio/mp4; codecs="'+l+'"',robustness:d.audioRobustness||""})}),A.forEach(function(l){o.videoCapabilities.push({contentType:'video/mp4; codecs="'+l+'"',robustness:d.videoRobustness||""})}),[o]},T=function(S,A,d,o){switch(S){case U.KeySystems.WIDEVINE:return g(A,d,o);default:throw new Error("Unknown key-system: "+S)}},L=function(){function C(A){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=A,this._config=A.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 S=C.prototype;return S.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},S._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)},S._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)},S.getLicenseServerUrl=function(d){switch(d){case U.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+d+'"')},S._attemptKeySystemAccess=function(d,o,l){var u=this,y=T(d,o,l,this._drmSystemOptions);M.logger.log("Requesting encrypted media key-system access");var m=this.requestMediaKeySystemAccess(d,y);this.mediaKeysPromise=m.then(function(h){return u._onMediaKeySystemAccessObtained(d,h)}),m.catch(function(h){M.logger.error('Failed to obtain key-system "'+d+'" access:',h)})},S._onMediaKeySystemAccessObtained=function(d,o){var l=this;M.logger.log('Access for key-system "'+d+'" obtained');var u={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:o,mediaKeySystemDomain:d};this._mediaKeysList.push(u);var y=Promise.resolve().then(function(){return o.createMediaKeys()}).then(function(m){return u.mediaKeys=m,M.logger.log('Media-keys created for key-system "'+d+'"'),l._onMediaKeysCreated(),m});return y.catch(function(m){M.logger.error("Failed to create media-keys:",m)}),y},S._onMediaKeysCreated=function(){var d=this;this._mediaKeysList.forEach(function(o){o.mediaKeysSession||(o.mediaKeysSession=o.mediaKeys.createSession(),d._onNewMediaKeySession(o.mediaKeysSession))})},S._onNewMediaKeySession=function(d){var o=this;M.logger.log("New key-system session "+d.sessionId),d.addEventListener("message",function(l){o._onKeySessionMessage(d,l.message)},!1)},S._onKeySessionMessage=function(d,o){M.logger.log("Got EME message event, creating license request"),this._requestLicense(o,function(l){M.logger.log("Received license data (length: "+(l&&l.byteLength)+"), updating key-session"),d.update(l)})},S.onMediaEncrypted=function(d){var o=this;if(M.logger.log('Media is encrypted using "'+d.initDataType+'" init data type'),!this.mediaKeysPromise){M.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(K.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var l=function(y){if(!o._media)return;o._attemptSetMediaKeys(y),o._generateRequestWithPreferredKeySession(d.initDataType,d.initData)};this.mediaKeysPromise.then(l).catch(l)},S._attemptSetMediaKeys=function(d){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var o=this._mediaKeysList[0];if(!o||!o.mediaKeys){M.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(K.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}M.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(o.mediaKeys),this._hasSetMediaKeys=!0}},S._generateRequestWithPreferredKeySession=function(d,o){var l=this,u=this._mediaKeysList[0];if(!u){M.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(K.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(u.mediaKeysSessionInitialized){M.logger.warn("Key-Session already initialized but requested again");return}var y=u.mediaKeysSession;if(!y){M.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(K.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!o){M.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(K.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}M.logger.log('Generating key-session request for "'+d+'" init data type'),u.mediaKeysSessionInitialized=!0,y.generateRequest(d,o).then(function(){M.logger.debug("Key-session generation succeeded")}).catch(function(m){M.logger.error("Error generating key-session request:",m),l.hls.trigger(K.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},S._createLicenseXhr=function(d,o,l){var u=new XMLHttpRequest;u.responseType="arraybuffer",u.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,u,d,o,l);var y=this._licenseXhrSetup;if(y)try{y.call(this.hls,u,d),y=void 0}catch(m){M.logger.error(m)}try{u.readyState||u.open("POST",d,!0),y&&y.call(this.hls,u,d)}catch(m){throw new Error("issue setting up KeySystem license XHR "+m)}return u},S._onLicenseRequestReadyStageChange=function(d,o,l,u){switch(d.readyState){case 4:if(d.status===200){this._requestLicenseFailureCount=0,M.logger.log("License request succeeded");var y=d.response,m=this._licenseResponseCallback;if(m)try{y=m.call(this.hls,d,o)}catch(w){M.logger.error(w)}u(y)}else{if(M.logger.error("License Request XHR failed ("+o+"). Status: "+d.status+" ("+d.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>R){this.hls.trigger(K.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var h=R-this._requestLicenseFailureCount+1;M.logger.warn("Retrying license request, "+h+" attempts left"),this._requestLicense(l,u)}break}},S._generateLicenseRequestChallenge=function(d,o){switch(d.mediaKeySystemDomain){case U.KeySystems.WIDEVINE:return o}throw new Error("unsupported key-system: "+d.mediaKeySystemDomain)},S._requestLicense=function(d,o){M.logger.log("Requesting content license for key-system");var l=this._mediaKeysList[0];if(!l){M.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(K.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var u=this.getLicenseServerUrl(l.mediaKeySystemDomain),y=this._createLicenseXhr(u,d,o);M.logger.log("Sending license request to URL: "+u);var m=this._generateLicenseRequestChallenge(l,d);y.send(m)}catch(h){M.logger.error("Failure requesting DRM license: "+h),this.hls.trigger(K.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},S.onMediaAttached=function(d,o){if(!this._emeEnabled)return;var l=o.media;this._media=l,l.addEventListener("encrypted",this._onMediaEncrypted)},S.onMediaDetached=function(){var d=this._media,o=this._mediaKeysList;if(!d)return;d.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(o.map(function(l){if(l.mediaKeysSession)return l.mediaKeysSession.close().catch(function(){})})).then(function(){return d.setMediaKeys(null)}).catch(function(){})},S.onManifestParsed=function(d,o){if(!this._emeEnabled)return;var l=o.levels.map(function(y){return y.audioCodec}).filter(function(y){return!!y}),u=o.levels.map(function(y){return y.videoCodec}).filter(function(y){return!!y});this._attemptKeySystemAccess(U.KeySystems.WIDEVINE,l,u)},I(C,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),C}();G.default=L},"./src/controller/fps-controller.ts":function(q,G,D){"use strict";D.r(G);var K=D("./src/events.ts"),P=D("./src/utils/logger.ts"),M=function(){function U(I){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=I,this.registerListeners()}var B=U.prototype;return B.setStreamController=function(R){this.streamController=R},B.registerListeners=function(){this.hls.on(K.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},B.unregisterListeners=function(){this.hls.off(K.Events.MEDIA_ATTACHING,this.onMediaAttaching)},B.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},B.onMediaAttaching=function(R,g){var T=this.hls.config;if(T.capLevelOnFPSDrop){var L=g.media instanceof self.HTMLVideoElement?g.media:null;this.media=L,L&&typeof L.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),T.fpsDroppedMonitoringPeriod)}},B.checkFPS=function(R,g,T){var L=performance.now();if(g){if(this.lastTime){var C=L-this.lastTime,S=T-this.lastDroppedFrames,A=g-this.lastDecodedFrames,d=1e3*S/C,o=this.hls;if(o.trigger(K.Events.FPS_DROP,{currentDropped:S,currentDecoded:A,totalDroppedFrames:T}),d>0&&S>o.config.fpsDroppedMonitoringThreshold*A){var l=o.currentLevel;P.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+l),l>0&&(o.autoLevelCapping===-1||o.autoLevelCapping>=l)&&(l=l-1,o.trigger(K.Events.FPS_DROP_LEVEL_CAPPING,{level:l,droppedLevel:o.currentLevel}),o.autoLevelCapping=l,this.streamController.nextLevelSwitch())}}this.lastTime=L,this.lastDroppedFrames=T,this.lastDecodedFrames=g}},B.checkFPSInterval=function(){var R=this.media;if(R)if(this.isVideoPlaybackQualityAvailable){var g=R.getVideoPlaybackQuality();this.checkFPS(R,g.totalVideoFrames,g.droppedVideoFrames)}else this.checkFPS(R,R.webkitDecodedFrameCount,R.webkitDroppedFrameCount)},U}();G.default=M},"./src/controller/fragment-finders.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"findFragmentByPDT",function(){return M}),D.d(G,"findFragmentByPTS",function(){return U}),D.d(G,"fragmentWithinToleranceTest",function(){return B}),D.d(G,"pdtWithinToleranceTest",function(){return I}),D.d(G,"findFragWithCC",function(){return R});var K=D("./src/polyfills/number.ts"),P=D("./src/utils/binary-search.ts");function M(g,T,L){if(T===null||!Array.isArray(g)||!g.length||!Object(K.isFiniteNumber)(T))return null;var C=g[0].programDateTime;if(T<(C||0))return null;var S=g[g.length-1].endProgramDateTime;if(T>=(S||0))return null;L=L||0;for(var A=0;A<g.length;++A){var d=g[A];if(I(T,L,d))return d}return null}function U(g,T,L,C){L===void 0&&(L=0),C===void 0&&(C=0);var S=null;if(g?S=T[g.sn-T[0].sn+1]||null:L===0&&T[0].start===0&&(S=T[0]),S&&B(L,C,S)===0)return S;var A=P.default.search(T,B.bind(null,L,C));return A||S}function B(g,T,L){g===void 0&&(g=0),T===void 0&&(T=0);var C=Math.min(T,L.duration+(L.deltaPTS?L.deltaPTS:0));return L.start+L.duration-C<=g?1:L.start-C>g&&L.start?-1:0}function I(g,T,L){var C=Math.min(T,L.duration+(L.deltaPTS?L.deltaPTS:0))*1e3,S=L.endProgramDateTime||0;return S-C>g}function R(g,T){return P.default.search(g,function(L){return L.cc<T?1:L.cc>T?-1:0})}},"./src/controller/fragment-tracker.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"FragmentState",function(){return M}),D.d(G,"FragmentTracker",function(){return U});var K=D("./src/events.ts"),P=D("./src/types/loader.ts"),M;(function(R){R.NOT_LOADED="NOT_LOADED",R.BACKTRACKED="BACKTRACKED",R.APPENDING="APPENDING",R.PARTIAL="PARTIAL",R.OK="OK"})(M||(M={}));var U=function(){function R(T){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=T,this._registerListeners()}var g=R.prototype;return g._registerListeners=function(){var L=this.hls;L.on(K.Events.BUFFER_APPENDED,this.onBufferAppended,this),L.on(K.Events.FRAG_BUFFERED,this.onFragBuffered,this),L.on(K.Events.FRAG_LOADED,this.onFragLoaded,this)},g._unregisterListeners=function(){var L=this.hls;L.off(K.Events.BUFFER_APPENDED,this.onBufferAppended,this),L.off(K.Events.FRAG_BUFFERED,this.onFragBuffered,this),L.off(K.Events.FRAG_LOADED,this.onFragLoaded,this)},g.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},g.getAppendedFrag=function(L,C){if(C===P.PlaylistLevelType.MAIN){var S=this.activeFragment,A=this.activeParts;if(!S)return null;if(A)for(var d=A.length;d--;){var o=A[d],l=o?o.end:S.appendedPTS;if(o.start<=L&&l!==void 0&&L<=l)return d>9&&(this.activeParts=A.slice(d-9)),o}else if(S.start<=L&&S.appendedPTS!==void 0&&L<=S.appendedPTS)return S}return this.getBufferedFrag(L,C)},g.getBufferedFrag=function(L,C){for(var S=this.fragments,A=Object.keys(S),d=A.length;d--;){var o=S[A[d]];if((o==null?void 0:o.body.type)===C&&o.buffered){var l=o.body;if(l.start<=L&&L<=l.end)return l}}return null},g.detectEvictedFragments=function(L,C,S){var A=this;Object.keys(this.fragments).forEach(function(d){var o=A.fragments[d];if(!o)return;if(!o.buffered){o.body.type===S&&A.removeFragment(o.body);return}var l=o.range[L];if(!l)return;l.time.some(function(u){var y=!A.isTimeBuffered(u.startPTS,u.endPTS,C);return y&&A.removeFragment(o.body),y})})},g.detectPartialFragments=function(L){var C=this,S=this.timeRanges,A=L.frag,d=L.part;if(!S||A.sn==="initSegment")return;var o=I(A),l=this.fragments[o];if(!l)return;Object.keys(S).forEach(function(u){var y=A.elementaryStreams[u];if(!y)return;var m=S[u],h=d!==null||y.partial===!0;l.range[u]=C.getBufferedTimes(A,d,h,m)}),l.backtrack=l.loaded=null,Object.keys(l.range).length?l.buffered=!0:this.removeFragment(l.body)},g.fragBuffered=function(L){var C=I(L),S=this.fragments[C];S&&(S.backtrack=S.loaded=null,S.buffered=!0)},g.getBufferedTimes=function(L,C,S,A){for(var d={time:[],partial:S},o=C?C.start:L.start,l=C?C.end:L.end,u=L.minEndPTS||l,y=L.maxStartPTS||o,m=0;m<A.length;m++){var h=A.start(m)-this.bufferPadding,w=A.end(m)+this.bufferPadding;if(y>=h&&u<=w){d.time.push({startPTS:Math.max(o,A.start(m)),endPTS:Math.min(l,A.end(m))});break}else if(o<w&&l>h)d.partial=!0,d.time.push({startPTS:Math.max(o,A.start(m)),endPTS:Math.min(l,A.end(m))});else if(l<=h)break}return d},g.getPartialFragment=function(L){var C=null,S,A,d,o=0,l=this.bufferPadding,u=this.fragments;return Object.keys(u).forEach(function(y){var m=u[y];if(!m)return;B(m)&&(A=m.body.start-l,d=m.body.end+l,L>=A&&L<=d&&(S=Math.min(L-A,d-L),o<=S&&(C=m.body,o=S)))}),C},g.getState=function(L){var C=I(L),S=this.fragments[C];return S?S.buffered?B(S)?M.PARTIAL:M.OK:S.backtrack?M.BACKTRACKED:M.APPENDING:M.NOT_LOADED},g.backtrack=function(L,C){var S=I(L),A=this.fragments[S];if(!A||A.backtrack)return null;var d=A.backtrack=C||A.loaded;return A.loaded=null,d},g.getBacktrackData=function(L){var C=I(L),S=this.fragments[C];if(S){var A,d=S.backtrack;if(d!=null&&(A=d.payload)!==null&&A!==void 0&&A.byteLength)return d;this.removeFragment(L)}return null},g.isTimeBuffered=function(L,C,S){for(var A,d,o=0;o<S.length;o++){if(A=S.start(o)-this.bufferPadding,d=S.end(o)+this.bufferPadding,L>=A&&C<=d)return!0;if(C<=A)return!1}return!1},g.onFragLoaded=function(L,C){var S=C.frag,A=C.part;if(S.sn==="initSegment"||S.bitrateTest||A)return;var d=I(S);this.fragments[d]={body:S,loaded:C,backtrack:null,buffered:!1,range:Object.create(null)}},g.onBufferAppended=function(L,C){var S=this,A=C.frag,d=C.part,o=C.timeRanges;if(A.type===P.PlaylistLevelType.MAIN)if(this.activeFragment=A,d){var l=this.activeParts;l||(this.activeParts=l=[]),l.push(d)}else this.activeParts=null;this.timeRanges=o,Object.keys(o).forEach(function(u){var y=o[u];if(S.detectEvictedFragments(u,y),!d)for(var m=0;m<y.length;m++)A.appendedPTS=Math.max(y.end(m),A.appendedPTS||0)})},g.onFragBuffered=function(L,C){this.detectPartialFragments(C)},g.hasFragment=function(L){var C=I(L);return!!this.fragments[C]},g.removeFragmentsInRange=function(L,C,S){var A=this;Object.keys(this.fragments).forEach(function(d){var o=A.fragments[d];if(!o)return;if(o.buffered){var l=o.body;l.type===S&&l.start<C&&l.end>L&&A.removeFragment(l)}})},g.removeFragment=function(L){var C=I(L);L.stats.loaded=0,L.clearElementaryStreamInfo(),delete this.fragments[C]},g.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},R}();function B(R){var g,T;return R.buffered&&(((g=R.range.video)===null||g===void 0?void 0:g.partial)||((T=R.range.audio)===null||T===void 0?void 0:T.partial))}function I(R){return R.type+"_"+R.level+"_"+R.urlId+"_"+R.sn}},"./src/controller/gap-controller.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"STALL_MINIMUM_DURATION_MS",function(){return B}),D.d(G,"MAX_START_GAP_JUMP",function(){return I}),D.d(G,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return R}),D.d(G,"SKIP_BUFFER_RANGE_START",function(){return g}),D.d(G,"default",function(){return T});var K=D("./src/utils/buffer-helper.ts"),P=D("./src/errors.ts"),M=D("./src/events.ts"),U=D("./src/utils/logger.ts"),B=250,I=2,R=.1,g=.05,T=function(){function L(S,A,d,o){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=S,this.media=A,this.fragmentTracker=d,this.hls=o}var C=L.prototype;return C.destroy=function(){this.hls=this.fragmentTracker=this.media=null},C.poll=function(A){var d=this.config,o=this.media,l=this.stalled,u=o.currentTime,y=o.seeking,m=this.seeking&&!y,h=!this.seeking&&y;if(this.seeking=y,u!==A){if(this.moved=!0,l!==null){if(this.stallReported){var w=self.performance.now()-l;U.logger.warn("playback not stuck anymore @"+u+", after "+Math.round(w)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((h||m)&&(this.stalled=null),o.paused||o.ended||o.playbackRate===0||!K.BufferHelper.getBuffered(o).length)return;var E=K.BufferHelper.bufferInfo(o,u,0),f=E.len>0,c=E.nextStart||0;if(!f&&!c)return;if(y){var s=E.len>I,a=!c||c-u>I&&!this.fragmentTracker.getPartialFragment(u);if(s||a)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var v,p=Math.max(c,E.start||0)-u,b=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,O=b==null||((v=b.details)===null||v===void 0)?void 0:v.live,N=O?b.details.targetduration*2:I;if(p>0&&p<=N){this._trySkipBufferHole(null);return}}var W=self.performance.now();if(l===null){this.stalled=W;return}var V=W-l;!y&&V>=B&&this._reportStall(E.len);var F=K.BufferHelper.bufferInfo(o,u,d.maxBufferHole);this._tryFixBufferStall(F,V)},C._tryFixBufferStall=function(A,d){var o=this.config,l=this.fragmentTracker,u=this.media,y=u.currentTime,m=l.getPartialFragment(y);if(m){var h=this._trySkipBufferHole(m);if(h)return}A.len>o.maxBufferHole&&d>o.highBufferWatchdogPeriod*1e3&&(U.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},C._reportStall=function(A){var d=this.hls,o=this.media,l=this.stallReported;l||(this.stallReported=!0,U.logger.warn("Playback stalling at @"+o.currentTime+" due to low buffer (buffer="+A+")"),d.trigger(M.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:A}))},C._trySkipBufferHole=function(A){for(var d=this.config,o=this.hls,l=this.media,u=l.currentTime,y=0,m=K.BufferHelper.getBuffered(l),h=0;h<m.length;h++){var w=m.start(h);if(u+d.maxBufferHole>=y&&u<w){var E=Math.max(w+g,l.currentTime+R);return U.logger.warn("skipping hole, adjusting currentTime from "+u+" to "+E),this.moved=!0,this.stalled=null,l.currentTime=E,A&&o.trigger(M.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+u+" to "+E,frag:A}),E}y=m.end(h)}return 0},C._tryNudgeBuffer=function(){var A=this.config,d=this.hls,o=this.media,l=o.currentTime,u=(this.nudgeRetry||0)+1;if(this.nudgeRetry=u,u<A.nudgeMaxRetry){var y=l+u*A.nudgeOffset;U.logger.warn("Nudging 'currentTime' from "+l+" to "+y),o.currentTime=y,d.trigger(M.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else U.logger.error("Playhead still not moving while enough data buffered @"+l+" after "+A.nudgeMaxRetry+" nudges"),d.trigger(M.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},L}()},"./src/controller/id3-track-controller.ts":function(q,G,D){"use strict";D.r(G);var K=D("./src/events.ts"),P=D("./src/utils/texttrack-utils.ts"),M=D("./src/demux/id3.ts"),U=.25,B=function(){function I(g){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=g,this._registerListeners()}var R=I.prototype;return R.destroy=function(){this._unregisterListeners()},R._registerListeners=function(){var T=this.hls;T.on(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),T.on(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),T.on(K.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),T.on(K.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},R._unregisterListeners=function(){var T=this.hls;T.off(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),T.off(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),T.off(K.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),T.off(K.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},R.onMediaAttached=function(T,L){this.media=L.media},R.onMediaDetaching=function(){if(!this.id3Track)return;Object(P.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},R.getID3Track=function(T){if(!this.media)return;for(var L=0;L<T.length;L++){var C=T[L];if(C.kind==="metadata"&&C.label==="id3")return Object(P.sendAddTrackEvent)(C,this.media),C}return this.media.addTextTrack("metadata","id3")},R.onFragParsingMetadata=function(T,L){if(!this.media)return;var C=L.frag,S=L.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var A=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,d=0;d<S.length;d++){var o=M.getID3Frames(S[d].data);if(o){var l=S[d].pts,u=d<S.length-1?S[d+1].pts:C.end,y=u-l;y<=0&&(u=l+U);for(var m=0;m<o.length;m++){var h=o[m];if(!M.isTimeStampFrame(h)){var w=new A(l,u,"");w.value=h,this.id3Track.addCue(w)}}}}},R.onBufferFlushing=function(T,L){var C=L.startOffset,S=L.endOffset,A=L.type;if(!A||A==="audio"){var d=this.id3Track;d&&Object(P.removeCuesInRange)(d,C,S)}},I}();G.default=B},"./src/controller/latency-controller.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"default",function(){return I});var K=D("./src/errors.ts"),P=D("./src/events.ts"),M=D("./src/utils/logger.ts");function U(R,g){for(var T=0;T<g.length;T++){var L=g[T];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(R,L.key,L)}}function B(R,g,T){return g&&U(R.prototype,g),T&&U(R,T),R}var I=function(){function R(T){var L=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 L.timeupdate()},this.hls=T,this.config=T.config,this.registerListeners()}var g=R.prototype;return g.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},g.registerListeners=function(){this.hls.on(P.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(P.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(P.Events.ERROR,this.onError,this)},g.unregisterListeners=function(){this.hls.off(P.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(P.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(P.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(P.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(P.Events.ERROR,this.onError)},g.onMediaAttached=function(L,C){this.media=C.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},g.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},g.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},g.onLevelUpdated=function(L,C){var S=C.details;this.levelDetails=S,S.advanced&&this.timeupdate(),!S.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},g.onError=function(L,C){if(C.details!==K.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,M.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},g.timeupdate=function(){var L=this.media,C=this.levelDetails;if(!L||!C)return;this.currentTime=L.currentTime;var S=this.computeLatency();if(S===null)return;this._latency=S;var A=this.config,d=A.lowLatencyMode,o=A.maxLiveSyncPlaybackRate;if(!d||o===1)return;var l=this.targetLatency;if(l===null)return;var u=S-l,y=Math.min(this.maxLatency,l+C.targetduration),m=u<y;if(C.live&&m&&u>.05&&this.forwardBufferLength>1){var h=Math.min(2,Math.max(1,o)),w=Math.round(2/(1+Math.exp(-.75*u-this.edgeStalled))*20)/20;L.playbackRate=Math.min(h,Math.max(1,w))}else L.playbackRate!==1&&L.playbackRate!==0&&(L.playbackRate=1)},g.estimateLiveEdge=function(){var L=this.levelDetails;return L===null?null:L.edge+L.age},g.computeLatency=function(){var L=this.estimateLiveEdge();return L===null?null:L-this.currentTime},B(R,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var L=this.config,C=this.levelDetails;return L.liveMaxLatencyDuration!==void 0?L.liveMaxLatencyDuration:C?L.liveMaxLatencyDurationCount*C.targetduration:0}},{key:"targetLatency",get:function(){var L=this.levelDetails;if(L===null)return null;var C=L.holdBack,S=L.partHoldBack,A=L.targetduration,d=this.config,o=d.liveSyncDuration,l=d.liveSyncDurationCount,u=d.lowLatencyMode,y=this.hls.userConfig,m=u&&S||C;(y.liveSyncDuration||y.liveSyncDurationCount||m===0)&&(m=o!==void 0?o:l*A);var h=A,w=1;return m+Math.min(this.stallCount*w,h)}},{key:"liveSyncPosition",get:function(){var L=this.estimateLiveEdge(),C=this.targetLatency,S=this.levelDetails;if(L===null||C===null||S===null)return null;var A=S.edge,d=L-C-this.edgeStalled,o=A-S.totalduration,l=A-(this.config.lowLatencyMode&&S.partTarget||S.targetduration);return Math.min(Math.max(o,d),l)}},{key:"drift",get:function(){var L=this.levelDetails;return L===null?1:L.drift}},{key:"edgeStalled",get:function(){var L=this.levelDetails;if(L===null)return 0;var C=(this.config.lowLatencyMode&&L.partTarget||L.targetduration)*3;return Math.max(L.age-C,0)}},{key:"forwardBufferLength",get:function(){var L=this.media,C=this.levelDetails;if(!L||!C)return 0;var S=L.buffered.length;return S?L.buffered.end(S-1):C.edge-this.currentTime}}]),R}()},"./src/controller/level-controller.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"default",function(){return d});var K=D("./src/types/level.ts"),P=D("./src/events.ts"),M=D("./src/errors.ts"),U=D("./src/utils/codecs.ts"),B=D("./src/controller/level-helper.ts"),I=D("./src/controller/base-playlist-controller.ts"),R=D("./src/types/loader.ts");function g(){return g=Object.assign||function(o){for(var l=1;l<arguments.length;l++){var u=arguments[l];for(var y in u)Object.prototype.hasOwnProperty.call(u,y)&&(o[y]=u[y])}return o},g.apply(this,arguments)}function T(o,l){for(var u=0;u<l.length;u++){var y=l[u];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(o,y.key,y)}}function L(o,l,u){return l&&T(o.prototype,l),u&&T(o,u),o}function C(o,l){o.prototype=Object.create(l.prototype),o.prototype.constructor=o,S(o,l)}function S(o,l){return S=Object.setPrototypeOf||function(y,m){return y.__proto__=m,y},S(o,l)}var A=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),d=function(o){C(l,o);function l(y){var m;return m=o.call(this,y,"[level-controller]")||this,m._levels=[],m._firstLevel=-1,m._startLevel=void 0,m.currentLevelIndex=-1,m.manualLevelIndex=-1,m.onParsedComplete=void 0,m._registerListeners(),m}var u=l.prototype;return u._registerListeners=function(){var m=this.hls;m.on(P.Events.MANIFEST_LOADED,this.onManifestLoaded,this),m.on(P.Events.LEVEL_LOADED,this.onLevelLoaded,this),m.on(P.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),m.on(P.Events.FRAG_LOADED,this.onFragLoaded,this),m.on(P.Events.ERROR,this.onError,this)},u._unregisterListeners=function(){var m=this.hls;m.off(P.Events.MANIFEST_LOADED,this.onManifestLoaded,this),m.off(P.Events.LEVEL_LOADED,this.onLevelLoaded,this),m.off(P.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),m.off(P.Events.FRAG_LOADED,this.onFragLoaded,this),m.off(P.Events.ERROR,this.onError,this)},u.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,o.prototype.destroy.call(this)},u.startLoad=function(){var m=this._levels;m.forEach(function(h){h.loadError=0}),o.prototype.startLoad.call(this)},u.onManifestLoaded=function(m,h){var w=[],E=[],f=[],c,s={},a,v=!1,p=!1,b=!1;if(h.levels.forEach(function(V){var F=V.attrs;v=v||!!(V.width&&V.height),p=p||!!V.videoCodec,b=b||!!V.audioCodec,A&&V.audioCodec&&V.audioCodec.indexOf("mp4a.40.34")!==-1&&(V.audioCodec=void 0);var _=V.bitrate+"-"+V.attrs.RESOLUTION+"-"+V.attrs.CODECS;a=s[_],a?a.url.push(V.url):(a=new K.Level(V),s[_]=a,w.push(a)),F&&(F.AUDIO&&Object(B.addGroupId)(a,"audio",F.AUDIO),F.SUBTITLES&&Object(B.addGroupId)(a,"text",F.SUBTITLES))}),(v||p)&&b&&(w=w.filter(function(V){var F=V.videoCodec,_=V.width,J=V.height;return!!F||!!(_&&J)})),w=w.filter(function(V){var F=V.audioCodec,_=V.videoCodec;return(!F||Object(U.isCodecSupportedInMp4)(F,"audio"))&&(!_||Object(U.isCodecSupportedInMp4)(_,"video"))}),h.audioTracks&&(E=h.audioTracks.filter(function(V){return!V.audioCodec||Object(U.isCodecSupportedInMp4)(V.audioCodec,"audio")}),Object(B.assignTrackIdsByGroup)(E)),h.subtitles&&(f=h.subtitles,Object(B.assignTrackIdsByGroup)(f)),w.length>0){c=w[0].bitrate,w.sort(function(V,F){return V.bitrate-F.bitrate}),this._levels=w;for(var O=0;O<w.length;O++)if(w[O].bitrate===c){this._firstLevel=O,this.log("manifest loaded, "+w.length+" level(s) found, first bitrate: "+c);break}var N=b&&!p,W={levels:w,audioTracks:E,subtitleTracks:f,firstLevel:this._firstLevel,stats:h.stats,audio:b,video:p,altAudio:!N&&E.some(function(V){return!!V.url})};this.hls.trigger(P.Events.MANIFEST_PARSED,W),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(P.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:h.url,reason:"no level with compatible codecs found in manifest"})},u.onError=function(m,h){if(o.prototype.onError.call(this,m,h),h.fatal)return;var w=h.context,E=this._levels[this.currentLevelIndex];if(w&&(w.type===R.PlaylistContextType.AUDIO_TRACK&&E.audioGroupIds&&w.groupId===E.audioGroupIds[E.urlId]||w.type===R.PlaylistContextType.SUBTITLE_TRACK&&E.textGroupIds&&w.groupId===E.textGroupIds[E.urlId])){this.redundantFailover(this.currentLevelIndex);return}var f=!1,c=!0,s;switch(h.details){case M.ErrorDetails.FRAG_LOAD_ERROR:case M.ErrorDetails.FRAG_LOAD_TIMEOUT:case M.ErrorDetails.KEY_LOAD_ERROR:case M.ErrorDetails.KEY_LOAD_TIMEOUT:if(h.frag){var a=this._levels[h.frag.level];a?(a.fragmentError++,a.fragmentError>this.hls.config.fragLoadingMaxRetry&&(s=h.frag.level)):s=h.frag.level}break;case M.ErrorDetails.LEVEL_LOAD_ERROR:case M.ErrorDetails.LEVEL_LOAD_TIMEOUT:w&&(w.deliveryDirectives&&(c=!1),s=w.level),f=!0;break;case M.ErrorDetails.REMUX_ALLOC_ERROR:s=h.level,f=!0;break}s!==void 0&&this.recoverLevel(h,s,f,c)},u.recoverLevel=function(m,h,w,E){var f=m.details,c=this._levels[h];if(c.loadError++,w){var s=this.retryLoadingOrFail(m);if(s)m.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(E){var a=c.url.length;if(a>1&&c.loadError<a)m.levelRetry=!0,this.redundantFailover(h);else if(this.manualLevelIndex===-1){var v=h===0?this._levels.length-1:h-1;this.currentLevelIndex!==v&&this._levels[v].loadError===0&&(this.warn(f+": switch to "+v),m.levelRetry=!0,this.hls.nextAutoLevel=v)}}},u.redundantFailover=function(m){var h=this._levels[m],w=h.url.length;if(w>1){var E=(h.urlId+1)%w;this.warn("Switching to redundant URL-id "+E),this._levels.forEach(function(f){f.urlId=E}),this.level=m}},u.onFragLoaded=function(m,h){var w=h.frag;if(w!==void 0&&w.type===R.PlaylistLevelType.MAIN){var E=this._levels[w.level];E!==void 0&&(E.fragmentError=0,E.loadError=0)}},u.onLevelLoaded=function(m,h){var w,E=h.level,f=h.details,c=this._levels[E];if(!c){var s;this.warn("Invalid level index "+E),(s=h.deliveryDirectives)!==null&&s!==void 0&&s.skip&&(f.deltaUpdateFailed=!0);return}E===this.currentLevelIndex?(c.fragmentError===0&&(c.loadError=0,this.retryCount=0),this.playlistLoaded(E,h,c.details)):(w=h.deliveryDirectives)!==null&&w!==void 0&&w.skip&&(f.deltaUpdateFailed=!0)},u.onAudioTrackSwitched=function(m,h){var w=this.hls.levels[this.currentLevelIndex];if(!w)return;if(w.audioGroupIds){for(var E=-1,f=this.hls.audioTracks[h.id].groupId,c=0;c<w.audioGroupIds.length;c++)if(w.audioGroupIds[c]===f){E=c;break}E!==w.urlId&&(w.urlId=E,this.startLoad())}},u.loadPlaylist=function(m){var h=this.currentLevelIndex,w=this._levels[h];if(this.canLoad&&w&&w.url.length>0){var E=w.urlId,f=w.url[E];if(m)try{f=m.addDirectives(f)}catch(c){this.warn("Could not construct new URL with HLS Delivery Directives: "+c)}this.log("Attempt loading level index "+h+(m?" at sn "+m.msn+" part "+m.part:"")+" with URL-id "+E+" "+f),this.clearTimer(),this.hls.trigger(P.Events.LEVEL_LOADING,{url:f,level:h,id:E,deliveryDirectives:m||null})}},u.removeLevel=function(m,h){var w=function(c,s){return s!==h},E=this._levels.filter(function(f,c){return c!==m?!0:f.url.length>1&&h!==void 0?(f.url=f.url.filter(w),f.audioGroupIds&&(f.audioGroupIds=f.audioGroupIds.filter(w)),f.textGroupIds&&(f.textGroupIds=f.textGroupIds.filter(w)),f.urlId=0,!0):!1}).map(function(f,c){var s=f.details;return s!=null&&s.fragments&&s.fragments.forEach(function(a){a.level=c}),f});this._levels=E,this.hls.trigger(P.Events.LEVELS_UPDATED,{levels:E})},L(l,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(m){var h,w=this._levels;if(w.length===0)return;if(this.currentLevelIndex===m&&(h=w[m])!==null&&h!==void 0&&h.details)return;if(m<0||m>=w.length){var E=m<0;if(this.hls.trigger(P.Events.ERROR,{type:M.ErrorTypes.OTHER_ERROR,details:M.ErrorDetails.LEVEL_SWITCH_ERROR,level:m,fatal:E,reason:"invalid level idx"}),E)return;m=Math.min(m,w.length-1)}this.clearTimer();var f=this.currentLevelIndex,c=w[f],s=w[m];this.log("switching to level "+m+" from "+f),this.currentLevelIndex=m;var a=g({},s,{level:m,maxBitrate:s.maxBitrate,uri:s.uri,urlId:s.urlId});delete a._urlId,this.hls.trigger(P.Events.LEVEL_SWITCHING,a);var v=s.details;if(!v||v.live){var p=this.switchParams(s.uri,c==null?void 0:c.details);this.loadPlaylist(p)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(m){this.manualLevelIndex=m,this._startLevel===void 0&&(this._startLevel=m),m!==-1&&(this.level=m)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(m){this._firstLevel=m}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var m=this.hls.config.startLevel;return m!==void 0?m:this._firstLevel}else return this._startLevel},set:function(m){this._startLevel=m}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(m){this.level=m,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=m)}}]),l}(I.default)},"./src/controller/level-helper.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"addGroupId",function(){return M}),D.d(G,"assignTrackIdsByGroup",function(){return U}),D.d(G,"updatePTS",function(){return B}),D.d(G,"updateFragPTSDTS",function(){return R}),D.d(G,"mergeDetails",function(){return g}),D.d(G,"mapPartIntersection",function(){return T}),D.d(G,"mapFragmentIntersection",function(){return L}),D.d(G,"adjustSliding",function(){return C}),D.d(G,"addSliding",function(){return S}),D.d(G,"computeReloadInterval",function(){return A}),D.d(G,"getFragmentWithSN",function(){return d}),D.d(G,"getPartWith",function(){return o});var K=D("./src/polyfills/number.ts"),P=D("./src/utils/logger.ts");function M(l,u,y){switch(u){case"audio":l.audioGroupIds||(l.audioGroupIds=[]),l.audioGroupIds.push(y);break;case"text":l.textGroupIds||(l.textGroupIds=[]),l.textGroupIds.push(y);break}}function U(l){var u={};l.forEach(function(y){var m=y.groupId||"";y.id=u[m]=u[m]||0,u[m]++})}function B(l,u,y){var m=l[u],h=l[y];I(m,h)}function I(l,u){var y=u.startPTS;if(Object(K.isFiniteNumber)(y)){var m=0,h;u.sn>l.sn?(m=y-l.start,h=l):(m=l.start-y,h=u),h.duration!==m&&(h.duration=m)}else if(u.sn>l.sn){var w=l.cc===u.cc;w&&l.minEndPTS?u.start=l.start+(l.minEndPTS-l.start):u.start=l.start+l.duration}else u.start=Math.max(l.start-u.duration,0)}function R(l,u,y,m,h,w){var E=m-y;E<=0&&(P.logger.warn("Fragment should have a positive duration",u),m=y+u.duration,w=h+u.duration);var f=y,c=m,s=u.startPTS,a=u.endPTS;if(Object(K.isFiniteNumber)(s)){var v=Math.abs(s-y);Object(K.isFiniteNumber)(u.deltaPTS)?u.deltaPTS=Math.max(v,u.deltaPTS):u.deltaPTS=v,f=Math.max(y,s),y=Math.min(y,s),h=Math.min(h,u.startDTS),c=Math.min(m,a),m=Math.max(m,a),w=Math.max(w,u.endDTS)}u.duration=m-y;var p=y-u.start;u.appendedPTS=m,u.start=u.startPTS=y,u.maxStartPTS=f,u.startDTS=h,u.endPTS=m,u.minEndPTS=c,u.endDTS=w;var b=u.sn;if(!l||b<l.startSN||b>l.endSN)return 0;var O,N=b-l.startSN,W=l.fragments;for(W[N]=u,O=N;O>0;O--)I(W[O],W[O-1]);for(O=N;O<W.length-1;O++)I(W[O],W[O+1]);return l.fragmentHint&&I(W[W.length-1],l.fragmentHint),l.PTSKnown=l.alignedSliding=!0,p}function g(l,u){for(var y=null,m=l.fragments,h=m.length-1;h>=0;h--){var w=m[h].initSegment;if(w){y=w;break}}l.fragmentHint&&delete l.fragmentHint.endPTS;var E=0,f;if(L(l,u,function(O,N){O.relurl&&(E=O.cc-N.cc),Object(K.isFiniteNumber)(O.startPTS)&&Object(K.isFiniteNumber)(O.endPTS)&&(N.start=N.startPTS=O.startPTS,N.startDTS=O.startDTS,N.appendedPTS=O.appendedPTS,N.maxStartPTS=O.maxStartPTS,N.endPTS=O.endPTS,N.endDTS=O.endDTS,N.minEndPTS=O.minEndPTS,N.duration=O.endPTS-O.startPTS,N.duration&&(f=N),u.PTSKnown=u.alignedSliding=!0),N.elementaryStreams=O.elementaryStreams,N.loader=O.loader,N.stats=O.stats,N.urlId=O.urlId,O.initSegment&&(N.initSegment=O.initSegment,y=O.initSegment)}),y){var c=u.fragmentHint?u.fragments.concat(u.fragmentHint):u.fragments;c.forEach(function(O){var N;(!O.initSegment||O.initSegment.relurl===((N=y)===null||N===void 0?void 0:N.relurl))&&(O.initSegment=y)})}if(u.skippedSegments&&(u.deltaUpdateFailed=u.fragments.some(function(O){return!O}),u.deltaUpdateFailed)){P.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var s=u.skippedSegments;s--;)u.fragments.shift();u.startSN=u.fragments[0].sn,u.startCC=u.fragments[0].cc}var a=u.fragments;if(E){P.logger.warn("discontinuity sliding from playlist, take drift into account");for(var v=0;v<a.length;v++)a[v].cc+=E}u.skippedSegments&&(u.startCC=u.fragments[0].cc),T(l.partList,u.partList,function(O,N){N.elementaryStreams=O.elementaryStreams,N.stats=O.stats}),f?R(u,f,f.startPTS,f.endPTS,f.startDTS,f.endDTS):C(l,u),a.length&&(u.totalduration=u.edge-a[0].start),u.driftStartTime=l.driftStartTime,u.driftStart=l.driftStart;var p=u.advancedDateTime;if(u.advanced&&p){var b=u.edge;u.driftStart||(u.driftStartTime=p,u.driftStart=b),u.driftEndTime=p,u.driftEnd=b}else u.driftEndTime=l.driftEndTime,u.driftEnd=l.driftEnd,u.advancedDateTime=l.advancedDateTime}function T(l,u,y){if(l&&u)for(var m=0,h=0,w=l.length;h<=w;h++){var E=l[h],f=u[h+m];E&&f&&E.index===f.index&&E.fragment.sn===f.fragment.sn?y(E,f):m--}}function L(l,u,y){for(var m=u.skippedSegments,h=Math.max(l.startSN,u.startSN)-u.startSN,w=(l.fragmentHint?1:0)+(m?u.endSN:Math.min(l.endSN,u.endSN))-u.startSN,E=u.startSN-l.startSN,f=u.fragmentHint?u.fragments.concat(u.fragmentHint):u.fragments,c=l.fragmentHint?l.fragments.concat(l.fragmentHint):l.fragments,s=h;s<=w;s++){var a=c[E+s],v=f[s];m&&!v&&s<m&&(v=u.fragments[s]=a),a&&v&&y(a,v)}}function C(l,u){var y=u.startSN+u.skippedSegments-l.startSN,m=l.fragments;if(y<0||y>=m.length)return;S(u,m[y].start)}function S(l,u){if(u){for(var y=l.fragments,m=l.skippedSegments;m<y.length;m++)y[m].start+=u;l.fragmentHint&&(l.fragmentHint.start+=u)}}function A(l,u){var y=1e3*l.levelTargetDuration,m=y/2,h=l.age,w=h>0&&h<y*3,E=u.loading.end-u.loading.start,f,c=l.availabilityDelay;if(l.updated===!1)if(w){var s=333*l.misses;f=Math.max(Math.min(m,E*2),s),l.availabilityDelay=(l.availabilityDelay||0)+f}else f=m;else w?(c=Math.min(c||y/2,h),l.availabilityDelay=c,f=c+y-h):f=y-E;return Math.round(f)}function d(l,u,y){if(!l||!l.details)return null;var m=l.details,h=m.fragments[u-m.startSN];return h||(h=m.fragmentHint,h&&h.sn===u?h:u<m.startSN&&y&&y.sn===u?y:null)}function o(l,u,y){if(!l||!l.details)return null;var m=l.details.partList;if(m)for(var h=m.length;h--;){var w=m[h];if(w.index===y&&w.fragment.sn===u)return w}return null}},"./src/controller/stream-controller.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"default",function(){return m});var K=D("./src/polyfills/number.ts"),P=D("./src/controller/base-stream-controller.ts"),M=D("./src/is-supported.ts"),U=D("./src/events.ts"),B=D("./src/utils/buffer-helper.ts"),I=D("./src/controller/fragment-tracker.ts"),R=D("./src/types/loader.ts"),g=D("./src/loader/fragment.ts"),T=D("./src/demux/transmuxer-interface.ts"),L=D("./src/types/transmuxer.ts"),C=D("./src/controller/gap-controller.ts"),S=D("./src/errors.ts"),A=D("./src/utils/logger.ts");function d(h,w){for(var E=0;E<w.length;E++){var f=w[E];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(h,f.key,f)}}function o(h,w,E){return w&&d(h.prototype,w),E&&d(h,E),h}function l(h,w){h.prototype=Object.create(w.prototype),h.prototype.constructor=h,u(h,w)}function u(h,w){return u=Object.setPrototypeOf||function(f,c){return f.__proto__=c,f},u(h,w)}var y=100,m=function(h){l(w,h);function w(f,c){var s;return s=h.call(this,f,c,"[stream-controller]")||this,s.audioCodecSwap=!1,s.gapController=null,s.level=-1,s._forceStartLoad=!1,s.altAudio=!1,s.audioOnly=!1,s.fragPlaying=null,s.onvplaying=null,s.onvseeked=null,s.fragLastKbps=0,s.stalled=!1,s.couldBacktrack=!1,s.audioCodecSwitch=!1,s.videoBuffer=null,s._registerListeners(),s}var E=w.prototype;return E._registerListeners=function(){var c=this.hls;c.on(U.Events.MEDIA_ATTACHED,this.onMediaAttached,this),c.on(U.Events.MEDIA_DETACHING,this.onMediaDetaching,this),c.on(U.Events.MANIFEST_LOADING,this.onManifestLoading,this),c.on(U.Events.MANIFEST_PARSED,this.onManifestParsed,this),c.on(U.Events.LEVEL_LOADING,this.onLevelLoading,this),c.on(U.Events.LEVEL_LOADED,this.onLevelLoaded,this),c.on(U.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),c.on(U.Events.ERROR,this.onError,this),c.on(U.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),c.on(U.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),c.on(U.Events.BUFFER_CREATED,this.onBufferCreated,this),c.on(U.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),c.on(U.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),c.on(U.Events.FRAG_BUFFERED,this.onFragBuffered,this)},E._unregisterListeners=function(){var c=this.hls;c.off(U.Events.MEDIA_ATTACHED,this.onMediaAttached,this),c.off(U.Events.MEDIA_DETACHING,this.onMediaDetaching,this),c.off(U.Events.MANIFEST_LOADING,this.onManifestLoading,this),c.off(U.Events.MANIFEST_PARSED,this.onManifestParsed,this),c.off(U.Events.LEVEL_LOADED,this.onLevelLoaded,this),c.off(U.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),c.off(U.Events.ERROR,this.onError,this),c.off(U.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),c.off(U.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),c.off(U.Events.BUFFER_CREATED,this.onBufferCreated,this),c.off(U.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),c.off(U.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),c.off(U.Events.FRAG_BUFFERED,this.onFragBuffered,this)},E.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},E.startLoad=function(c){if(this.levels){var s=this.lastCurrentTime,a=this.hls;if(this.stopLoad(),this.setInterval(y),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var v=a.startLevel;v===-1&&(a.config.testBandwidth?(v=0,this.bitrateTest=!0):v=a.nextAutoLevel),this.level=a.nextLoadLevel=v,this.loadedmetadata=!1}s>0&&c===-1&&(this.log("Override startPosition with lastCurrentTime @"+s.toFixed(3)),c=s),this.state=P.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=c,this.tick()}else this._forceStartLoad=!0,this.state=P.State.STOPPED},E.stopLoad=function(){this._forceStartLoad=!1,h.prototype.stopLoad.call(this)},E.doTick=function(){switch(this.state){case P.State.IDLE:this.doTickIdle();break;case P.State.WAITING_LEVEL:{var c,s=this.levels,a=this.level,v=s==null||((c=s[a])===null||c===void 0)?void 0:c.details;if(v&&(!v.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(v))break;this.state=P.State.IDLE;break}break}case P.State.FRAG_LOADING_WAITING_RETRY:{var p,b=self.performance.now(),O=this.retryDate;(!O||b>=O||(p=this.media)!==null&&p!==void 0&&p.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=P.State.IDLE)}break;default:break}this.onTickEnd()},E.onTickEnd=function(){h.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},E.doTickIdle=function(){var c,s,a=this.hls,v=this.levelLastLoaded,p=this.levels,b=this.media,O=a.config,N=a.nextLoadLevel;if(v===null||!b&&(this.startFragRequested||!O.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!p||!p[N])return;var W=p[N];this.level=a.nextLoadLevel=N;var V=W.details;if(!V||this.state===P.State.WAITING_LEVEL||V.live&&this.levelLastLoaded!==N){this.state=P.State.WAITING_LEVEL;return}var F=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:b,R.PlaylistLevelType.MAIN);if(F===null)return;var _=F.len,J=this.getMaxBufferLength(W.maxBitrate);if(_>=J)return;if(this._streamEnded(F,V)){var ee={};this.altAudio&&(ee.type="video"),this.hls.trigger(U.Events.BUFFER_EOS,ee),this.state=P.State.ENDED;return}var oe=F.end,de=this.getNextFragment(oe,V);if(this.couldBacktrack&&!this.fragPrevious&&de&&de.sn!=="initSegment"){var Ce=de.sn-V.startSN;Ce>1&&(de=V.fragments[Ce-1],this.fragmentTracker.removeFragment(de))}if(de&&this.fragmentTracker.getState(de)===I.FragmentState.OK&&this.nextLoadPosition>oe){var ge=this.audioOnly&&!this.altAudio?g.ElementaryStreamTypes.AUDIO:g.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(b,ge,R.PlaylistLevelType.MAIN),de=this.getNextFragment(this.nextLoadPosition,V)}if(!de)return;de.initSegment&&!de.initSegment.data&&!this.bitrateTest&&(de=de.initSegment),((c=de.decryptdata)===null||c===void 0?void 0:c.keyFormat)==="identity"&&!((s=de.decryptdata)!==null&&s!==void 0&&s.key)?this.loadKey(de,V):this.loadFragment(de,V,oe)},E.loadFragment=function(c,s,a){var v,p=this.fragmentTracker.getState(c);if(this.fragCurrent=c,p===I.FragmentState.BACKTRACKED){var b=this.fragmentTracker.getBacktrackData(c);if(b){this._handleFragmentLoadProgress(b),this._handleFragmentLoadComplete(b);return}else p=I.FragmentState.NOT_LOADED}p===I.FragmentState.NOT_LOADED||p===I.FragmentState.PARTIAL?c.sn==="initSegment"?this._loadInitSegment(c):this.bitrateTest?(c.bitrateTest=!0,this.log("Fragment "+c.sn+" of level "+c.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(c)):(this.startFragRequested=!0,h.prototype.loadFragment.call(this,c,s,a)):p===I.FragmentState.APPENDING?this.reduceMaxBufferLength(c.duration)&&this.fragmentTracker.removeFragment(c):((v=this.media)===null||v===void 0?void 0:v.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},E.getAppendedFrag=function(c){var s=this.fragmentTracker.getAppendedFrag(c,R.PlaylistLevelType.MAIN);return s&&"fragment"in s?s.fragment:s},E.getBufferedFrag=function(c){return this.fragmentTracker.getBufferedFrag(c,R.PlaylistLevelType.MAIN)},E.followingBufferedFrag=function(c){return c?this.getBufferedFrag(c.end+.5):null},E.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},E.nextLevelSwitch=function(){var c=this.levels,s=this.media;if(s!=null&&s.readyState){var a,v=this.getAppendedFrag(s.currentTime);if(v&&v.start>1&&this.flushMainBuffer(0,v.start-1),!s.paused&&c){var p=this.hls.nextLoadLevel,b=c[p],O=this.fragLastKbps;O&&this.fragCurrent?a=this.fragCurrent.duration*b.maxBitrate/(1e3*O)+1:a=0}else a=0;var N=this.getBufferedFrag(s.currentTime+a);if(N){var W=this.followingBufferedFrag(N);if(W){this.abortCurrentFrag();var V=W.maxStartPTS?W.maxStartPTS:W.start,F=W.duration,_=Math.max(N.end,V+Math.min(Math.max(F-this.config.maxFragLookUpTolerance,F*.5),F*.75));this.flushMainBuffer(_,Number.POSITIVE_INFINITY)}}}},E.abortCurrentFrag=function(){var c=this.fragCurrent;this.fragCurrent=null,c!=null&&c.loader&&c.loader.abort(),this.state===P.State.KEY_LOADING&&(this.state=P.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},E.flushMainBuffer=function(c,s){h.prototype.flushMainBuffer.call(this,c,s,this.altAudio?"video":null)},E.onMediaAttached=function(c,s){h.prototype.onMediaAttached.call(this,c,s);var a=s.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),a.addEventListener("playing",this.onvplaying),a.addEventListener("seeked",this.onvseeked),this.gapController=new C.default(this.config,a,this.fragmentTracker,this.hls)},E.onMediaDetaching=function(){var c=this.media;c&&(c.removeEventListener("playing",this.onvplaying),c.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),h.prototype.onMediaDetaching.call(this)},E.onMediaPlaying=function(){this.tick()},E.onMediaSeeked=function(){var c=this.media,s=c?c.currentTime:null;Object(K.isFiniteNumber)(s)&&this.log("Media seeked to "+s.toFixed(3)),this.tick()},E.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},E.onManifestParsed=function(c,s){var a=!1,v=!1,p;s.levels.forEach(function(b){p=b.audioCodec,p&&(p.indexOf("mp4a.40.2")!==-1&&(a=!0),p.indexOf("mp4a.40.5")!==-1&&(v=!0))}),this.audioCodecSwitch=a&&v&&!Object(M.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=s.levels,this.startFragRequested=!1},E.onLevelLoading=function(c,s){var a=this.levels;if(!a||this.state!==P.State.IDLE)return;var v=a[s.level];(!v.details||v.details.live&&this.levelLastLoaded!==s.level||this.waitForCdnTuneIn(v.details))&&(this.state=P.State.WAITING_LEVEL)},E.onLevelLoaded=function(c,s){var a,v=this.levels,p=s.level,b=s.details,O=b.totalduration;if(!v){this.warn("Levels were reset while loading level "+p);return}this.log("Level "+p+" loaded ["+b.startSN+","+b.endSN+"], cc ["+b.startCC+", "+b.endCC+"] duration:"+O);var N=this.fragCurrent;N&&(this.state===P.State.FRAG_LOADING||this.state===P.State.FRAG_LOADING_WAITING_RETRY)&&(N.level!==s.level&&N.loader&&(this.state=P.State.IDLE,N.loader.abort()));var W=v[p],V=0;if(b.live||(a=W.details)!==null&&a!==void 0&&a.live){if(b.fragments[0]||(b.deltaUpdateFailed=!0),b.deltaUpdateFailed)return;V=this.alignPlaylists(b,W.details)}if(W.details=b,this.levelLastLoaded=p,this.hls.trigger(U.Events.LEVEL_UPDATED,{details:b,level:p}),this.state===P.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(b))return;this.state=P.State.IDLE}this.startFragRequested?b.live&&this.synchronizeToLiveEdge(b):this.setStartPosition(b,V),this.tick()},E._handleFragmentLoadProgress=function(c){var s,a=c.frag,v=c.part,p=c.payload,b=this.levels;if(!b){this.warn("Levels were reset while fragment load was in progress. Fragment "+a.sn+" of level "+a.level+" will not be buffered");return}var O=b[a.level],N=O.details;if(!N){this.warn("Dropping fragment "+a.sn+" of level "+a.level+" after level details were reset");return}var W=O.videoCodec,V=N.PTSKnown||!N.live,F=(s=a.initSegment)===null||s===void 0?void 0:s.data,_=this._getAudioCodec(O),J=this.transmuxer=this.transmuxer||new T.default(this.hls,R.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),ee=v?v.index:-1,oe=ee!==-1,de=new L.ChunkMetadata(a.level,a.sn,a.stats.chunkCount,p.byteLength,ee,oe),Ce=this.initPTS[a.cc];J.push(p,F,_,W,a,v,N.totalduration,V,de,Ce)},E.onAudioTrackSwitching=function(c,s){var a=this.altAudio,v=!!s.url,p=s.id;if(!v){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var b=this.fragCurrent;b!=null&&b.loader&&(this.log("Switching to main audio track, cancel main fragment load"),b.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var O=this.hls;a&&O.trigger(U.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),O.trigger(U.Events.AUDIO_TRACK_SWITCHED,{id:p})}},E.onAudioTrackSwitched=function(c,s){var a=s.id,v=!!this.hls.audioTracks[a].url;if(v){var p=this.videoBuffer;p&&this.mediaBuffer!==p&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=p)}this.altAudio=v,this.tick()},E.onBufferCreated=function(c,s){var a=s.tracks,v,p,b=!1;for(var O in a){var N=a[O];if(N.id==="main"){if(p=O,v=N,O==="video"){var W=a[O];W&&(this.videoBuffer=W.buffer)}}else b=!0}b&&v?(this.log("Alternate track found, use "+p+".buffered to schedule main fragment loading"),this.mediaBuffer=v.buffer):this.mediaBuffer=this.media},E.onFragBuffered=function(c,s){var a=s.frag,v=s.part;if(a&&a.type!==R.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(a)){this.warn("Fragment "+a.sn+(v?" p: "+v.index:"")+" of level "+a.level+" finished buffering, but was aborted. state: "+this.state),this.state===P.State.PARSED&&(this.state=P.State.IDLE);return}var p=v?v.stats:a.stats;this.fragLastKbps=Math.round(8*p.total/(p.buffering.end-p.loading.first)),a.sn!=="initSegment"&&(this.fragPrevious=a),this.fragBufferedComplete(a,v)},E.onError=function(c,s){switch(s.details){case S.ErrorDetails.FRAG_LOAD_ERROR:case S.ErrorDetails.FRAG_LOAD_TIMEOUT:case S.ErrorDetails.KEY_LOAD_ERROR:case S.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(R.PlaylistLevelType.MAIN,s);break;case S.ErrorDetails.LEVEL_LOAD_ERROR:case S.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==P.State.ERROR&&(s.fatal?(this.warn(""+s.details),this.state=P.State.ERROR):!s.levelRetry&&this.state===P.State.WAITING_LEVEL&&(this.state=P.State.IDLE));break;case S.ErrorDetails.BUFFER_FULL_ERROR:if(s.parent==="main"&&(this.state===P.State.PARSING||this.state===P.State.PARSED)){var a=!0,v=this.getFwdBufferInfo(this.media,R.PlaylistLevelType.MAIN);v&&v.len>.5&&(a=!this.reduceMaxBufferLength(v.len)),a&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},E.checkBuffer=function(){var c=this.media,s=this.gapController;if(!c||!s||!c.readyState)return;var a=B.BufferHelper.getBuffered(c);!this.loadedmetadata&&a.length?(this.loadedmetadata=!0,this.seekToStartPos()):s.poll(this.lastCurrentTime),this.lastCurrentTime=c.currentTime},E.onFragLoadEmergencyAborted=function(){this.state=P.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},E.onBufferFlushed=function(c,s){var a=s.type;if(a!==g.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var v=(a===g.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(v,a,R.PlaylistLevelType.MAIN)}},E.onLevelsUpdated=function(c,s){this.levels=s.levels},E.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},E.seekToStartPos=function(){var c=this.media,s=c.currentTime,a=this.startPosition;if(a>=0&&s<a){if(c.seeking){A.logger.log("could not seek to "+a+", already seeking at "+s);return}var v=B.BufferHelper.getBuffered(c),p=v.length?v.start(0):0,b=p-a;b>0&&(b<this.config.maxBufferHole||b<this.config.maxFragLookUpTolerance)&&(A.logger.log("adjusting start position by "+b+" to match buffer start"),a+=b,this.startPosition=a),this.log("seek to target start position "+a+" from current time "+s),c.currentTime=a}},E._getAudioCodec=function(c){var s=this.config.defaultAudioCodec||c.audioCodec;return this.audioCodecSwap&&s&&(this.log("Swapping audio codec"),s.indexOf("mp4a.40.5")!==-1?s="mp4a.40.2":s="mp4a.40.5"),s},E._loadBitrateTestFrag=function(c){var s=this;this._doFragLoad(c).then(function(a){var v=s.hls;if(!a||v.nextLoadLevel||s.fragContextChanged(c))return;s.fragLoadError=0,s.state=P.State.IDLE,s.startFragRequested=!1,s.bitrateTest=!1;var p=c.stats;p.parsing.start=p.parsing.end=p.buffering.start=p.buffering.end=self.performance.now(),v.trigger(U.Events.FRAG_LOADED,a)})},E._handleTransmuxComplete=function(c){var s,a="main",v=this.hls,p=c.remuxResult,b=c.chunkMeta,O=this.getCurrentContext(b);if(!O){this.warn("The loading context changed while buffering fragment "+b.sn+" of level "+b.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(b.level);return}var N=O.frag,W=O.part,V=O.level,F=p.video,_=p.text,J=p.id3,ee=p.initSegment,oe=this.altAudio?void 0:p.audio;if(this.fragContextChanged(N))return;if(this.state=P.State.PARSING,ee){ee.tracks&&(this._bufferInitSegment(V,ee.tracks,N,b),v.trigger(U.Events.FRAG_PARSING_INIT_SEGMENT,{frag:N,id:a,tracks:ee.tracks}));var de=ee.initPTS,Ce=ee.timescale;Object(K.isFiniteNumber)(de)&&(this.initPTS[N.cc]=de,v.trigger(U.Events.INIT_PTS_FOUND,{frag:N,id:a,initPTS:de,timescale:Ce}))}if(F&&p.independent!==!1){if(V.details){var ge=F.startPTS,pe=F.endPTS,ce=F.startDTS,he=F.endDTS;if(W)W.elementaryStreams[F.type]={startPTS:ge,endPTS:pe,startDTS:ce,endDTS:he};else if(F.firstKeyFrame&&F.independent&&(this.couldBacktrack=!0),F.dropped&&F.independent){var ne=this.getLoadPosition()+this.config.maxBufferHole;if(ne<ge){this.backtrack(N);return}N.setElementaryStreamInfo(F.type,N.start,pe,N.start,he,!0)}N.setElementaryStreamInfo(F.type,ge,pe,ce,he),this.bufferFragmentData(F,N,W,b)}}else if(p.independent===!1){this.backtrack(N);return}if(oe){var ue=oe.startPTS,Ee=oe.endPTS,_e=oe.startDTS,Oe=oe.endDTS;W&&(W.elementaryStreams[g.ElementaryStreamTypes.AUDIO]={startPTS:ue,endPTS:Ee,startDTS:_e,endDTS:Oe}),N.setElementaryStreamInfo(g.ElementaryStreamTypes.AUDIO,ue,Ee,_e,Oe),this.bufferFragmentData(oe,N,W,b)}if(J!=null&&(s=J.samples)!==null&&s!==void 0&&s.length){var Ne={frag:N,id:a,samples:J.samples};v.trigger(U.Events.FRAG_PARSING_METADATA,Ne)}if(_){var je={frag:N,id:a,samples:_.samples};v.trigger(U.Events.FRAG_PARSING_USERDATA,je)}},E._bufferInitSegment=function(c,s,a,v){var p=this;if(this.state!==P.State.PARSING)return;this.audioOnly=!!s.audio&&!s.video,this.altAudio&&!this.audioOnly&&delete s.audio;var b=s.audio,O=s.video,N=s.audiovideo;if(b){var W=c.audioCodec,V=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(W&&(W.indexOf("mp4a.40.5")!==-1?W="mp4a.40.2":W="mp4a.40.5"),b.metadata.channelCount!==1&&V.indexOf("firefox")===-1&&(W="mp4a.40.5")),V.indexOf("android")!==-1&&b.container!=="audio/mpeg"&&(W="mp4a.40.2",this.log("Android: force audio codec to "+W)),c.audioCodec&&c.audioCodec!==W&&this.log('Swapping manifest audio codec "'+c.audioCodec+'" for "'+W+'"'),b.levelCodec=W,b.id="main",this.log("Init audio buffer, container:"+b.container+", codecs[selected/level/parsed]=["+(W||"")+"/"+(c.audioCodec||"")+"/"+b.codec+"]")}O&&(O.levelCodec=c.videoCodec,O.id="main",this.log("Init video buffer, container:"+O.container+", codecs[level/parsed]=["+(c.videoCodec||"")+"/"+O.codec+"]")),N&&this.log("Init audiovideo buffer, container:"+N.container+", codecs[level/parsed]=["+(c.attrs.CODECS||"")+"/"+N.codec+"]"),this.hls.trigger(U.Events.BUFFER_CODECS,s),Object.keys(s).forEach(function(F){var _=s[F],J=_.initSegment;J!=null&&J.byteLength&&p.hls.trigger(U.Events.BUFFER_APPENDING,{type:F,data:J,frag:a,part:null,chunkMeta:v,parent:a.type})}),this.tick()},E.backtrack=function(c){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(c);var s=this.fragmentTracker.backtrack(c);this.fragPrevious=null,this.nextLoadPosition=c.start,s?this.resetFragmentLoading(c):this.state=P.State.BACKTRACKING},E.checkFragmentChanged=function(){var c=this.media,s=null;if(c&&c.readyState>1&&c.seeking===!1){var a=c.currentTime;if(B.BufferHelper.isBuffered(c,a)?s=this.getAppendedFrag(a):B.BufferHelper.isBuffered(c,a+.1)&&(s=this.getAppendedFrag(a+.1)),s){var v=this.fragPlaying,p=s.level;(!v||s.sn!==v.sn||v.level!==p||s.urlId!==v.urlId)&&(this.hls.trigger(U.Events.FRAG_CHANGED,{frag:s}),(!v||v.level!==p)&&this.hls.trigger(U.Events.LEVEL_SWITCHED,{level:p}),this.fragPlaying=s)}}},o(w,[{key:"nextLevel",get:function(){var c=this.nextBufferedFrag;return c?c.level:-1}},{key:"currentLevel",get:function(){var c=this.media;if(c){var s=this.getAppendedFrag(c.currentTime);if(s)return s.level}return-1}},{key:"nextBufferedFrag",get:function(){var c=this.media;if(c){var s=this.getAppendedFrag(c.currentTime);return this.followingBufferedFrag(s)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),w}(P.default)},"./src/controller/subtitle-stream-controller.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"SubtitleStreamController",function(){return l});var K=D("./src/events.ts"),P=D("./src/utils/logger.ts"),M=D("./src/utils/buffer-helper.ts"),U=D("./src/controller/fragment-finders.ts"),B=D("./src/utils/discontinuities.ts"),I=D("./src/controller/level-helper.ts"),R=D("./src/controller/fragment-tracker.ts"),g=D("./src/controller/base-stream-controller.ts"),T=D("./src/types/loader.ts"),L=D("./src/types/level.ts");function C(u,y){for(var m=0;m<y.length;m++){var h=y[m];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(u,h.key,h)}}function S(u,y,m){return y&&C(u.prototype,y),m&&C(u,m),u}function A(u,y){u.prototype=Object.create(y.prototype),u.prototype.constructor=u,d(u,y)}function d(u,y){return d=Object.setPrototypeOf||function(h,w){return h.__proto__=w,h},d(u,y)}var o=500,l=function(u){A(y,u);function y(h,w){var E;return E=u.call(this,h,w,"[subtitle-stream-controller]")||this,E.levels=[],E.currentTrackId=-1,E.tracksBuffered=[],E.mainDetails=null,E._registerListeners(),E}var m=y.prototype;return m.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},m._registerListeners=function(){var w=this.hls;w.on(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),w.on(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),w.on(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),w.on(K.Events.LEVEL_LOADED,this.onLevelLoaded,this),w.on(K.Events.ERROR,this.onError,this),w.on(K.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),w.on(K.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),w.on(K.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),w.on(K.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),w.on(K.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},m._unregisterListeners=function(){var w=this.hls;w.off(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),w.off(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),w.off(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),w.off(K.Events.LEVEL_LOADED,this.onLevelLoaded,this),w.off(K.Events.ERROR,this.onError,this),w.off(K.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),w.off(K.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),w.off(K.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),w.off(K.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),w.off(K.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},m.startLoad=function(){this.stopLoad(),this.state=g.State.IDLE,this.setInterval(o),this.tick()},m.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},m.onLevelLoaded=function(w,E){this.mainDetails=E.details},m.onSubtitleFragProcessed=function(w,E){var f=E.frag,c=E.success;if(this.fragPrevious=f,this.state=g.State.IDLE,!c)return;var s=this.tracksBuffered[this.currentTrackId];if(!s)return;for(var a,v=f.start,p=0;p<s.length;p++)if(v>=s[p].start&&v<=s[p].end){a=s[p];break}var b=f.start+f.duration;a?a.end=b:(a={start:v,end:b},s.push(a)),this.fragmentTracker.fragBuffered(f)},m.onBufferFlushing=function(w,E){var f=E.startOffset,c=E.endOffset;if(f===0&&c!==Number.POSITIVE_INFINITY){var s=this.currentTrackId,a=this.levels;if(!a.length||!a[s]||!a[s].details)return;var v=a[s].details,p=v.targetduration,b=c-p;if(b<=0)return;E.endOffsetSubtitles=Math.max(0,b),this.tracksBuffered.forEach(function(O){for(var N=0;N<O.length;){if(O[N].end<=b){O.shift();continue}else if(O[N].start<b)O[N].start=b;else break;N++}}),this.fragmentTracker.removeFragmentsInRange(f,b,T.PlaylistLevelType.SUBTITLE)}},m.onError=function(w,E){var f,c=E.frag;if(!c||c.type!==T.PlaylistLevelType.SUBTITLE)return;(f=this.fragCurrent)!==null&&f!==void 0&&f.loader&&this.fragCurrent.loader.abort(),this.state=g.State.IDLE},m.onSubtitleTracksUpdated=function(w,E){var f=this,c=E.subtitleTracks;this.tracksBuffered=[],this.levels=c.map(function(s){return new L.Level(s)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(s){f.tracksBuffered[s.id]=[]}),this.mediaBuffer=null},m.onSubtitleTrackSwitch=function(w,E){if(this.currentTrackId=E.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var f=this.levels[this.currentTrackId];f!=null&&f.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,f&&this.setInterval(o)},m.onSubtitleTrackLoaded=function(w,E){var f,c=E.details,s=E.id,a=this.currentTrackId,v=this.levels;if(!v.length)return;var p=v[a];if(s>=v.length||s!==a||!p)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,c.live||(f=p.details)!==null&&f!==void 0&&f.live){var b=this.mainDetails;if(c.deltaUpdateFailed||!b)return;var O=b.fragments[0];if(!p.details)c.hasProgramDateTime&&b.hasProgramDateTime?Object(B.alignMediaPlaylistByPDT)(c,b):O&&Object(I.addSliding)(c,O.start);else{var N=this.alignPlaylists(c,p.details);N===0&&O&&Object(I.addSliding)(c,O.start)}}if(p.details=c,this.levelLastLoaded=s,this.tick(),c.live&&!this.fragCurrent&&this.media&&this.state===g.State.IDLE){var W=Object(U.findFragmentByPTS)(null,c.fragments,this.media.currentTime,0);W||(this.warn("Subtitle playlist not aligned with playback"),p.details=void 0)}},m._handleFragmentLoadComplete=function(w){var E=w.frag,f=w.payload,c=E.decryptdata,s=this.hls;if(this.fragContextChanged(E))return;if(f&&f.byteLength>0&&c&&c.key&&c.iv&&c.method==="AES-128"){var a=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(f),c.key.buffer,c.iv.buffer).then(function(v){var p=performance.now();s.trigger(K.Events.FRAG_DECRYPTED,{frag:E,payload:v,stats:{tstart:a,tdecrypt:p}})})}},m.doTick=function(){if(!this.media){this.state=g.State.IDLE;return}if(this.state===g.State.IDLE){var w,E=this.currentTrackId,f=this.levels;if(!f.length||!f[E]||!f[E].details)return;var c=f[E].details,s=c.targetduration,a=this.config,v=this.media,p=M.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,v.currentTime-s,a.maxBufferHole),b=p.end,O=p.len,N=this.getMaxBufferLength()+s;if(O>N)return;console.assert(c,"Subtitle track details are defined on idle subtitle stream controller tick");var W=c.fragments,V=W.length,F=c.edge,_,J=this.fragPrevious;if(b<F){var ee=a.maxFragLookUpTolerance;J&&c.hasProgramDateTime&&(_=Object(U.findFragmentByPDT)(W,J.endProgramDateTime,ee)),_||(_=Object(U.findFragmentByPTS)(J,W,b,ee),!_&&J&&J.start<W[0].start&&(_=W[0]))}else _=W[V-1];(w=_)!==null&&w!==void 0&&w.encrypted?(P.logger.log("Loading key for "+_.sn),this.state=g.State.KEY_LOADING,this.hls.trigger(K.Events.KEY_LOADING,{frag:_})):_&&this.fragmentTracker.getState(_)===R.FragmentState.NOT_LOADED&&this.loadFragment(_,c,b)}},m.loadFragment=function(w,E,f){this.fragCurrent=w,u.prototype.loadFragment.call(this,w,E,f)},S(y,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),y}(g.default)},"./src/controller/subtitle-track-controller.ts":function(q,G,D){"use strict";D.r(G);var K=D("./src/events.ts"),P=D("./src/utils/texttrack-utils.ts"),M=D("./src/controller/base-playlist-controller.ts"),U=D("./src/types/loader.ts");function B(C,S){for(var A=0;A<S.length;A++){var d=S[A];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(C,d.key,d)}}function I(C,S,A){return S&&B(C.prototype,S),A&&B(C,A),C}function R(C,S){C.prototype=Object.create(S.prototype),C.prototype.constructor=C,g(C,S)}function g(C,S){return g=Object.setPrototypeOf||function(d,o){return d.__proto__=o,d},g(C,S)}var T=function(C){R(S,C);function S(d){var o;return o=C.call(this,d,"[subtitle-track-controller]")||this,o.media=null,o.tracks=[],o.groupId=null,o.tracksInGroup=[],o.trackId=-1,o.selectDefaultTrack=!0,o.queuedDefaultTrack=-1,o.trackChangeListener=function(){return o.onTextTracksChanged()},o.asyncPollTrackChange=function(){return o.pollTrackChange(0)},o.useTextTrackPolling=!1,o.subtitlePollingInterval=-1,o.subtitleDisplay=!0,o.registerListeners(),o}var A=S.prototype;return A.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,C.prototype.destroy.call(this)},A.registerListeners=function(){var o=this.hls;o.on(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),o.on(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.on(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.on(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.on(K.Events.LEVEL_LOADING,this.onLevelLoading,this),o.on(K.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),o.on(K.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),o.on(K.Events.ERROR,this.onError,this)},A.unregisterListeners=function(){var o=this.hls;o.off(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),o.off(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.off(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.off(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.off(K.Events.LEVEL_LOADING,this.onLevelLoading,this),o.off(K.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),o.off(K.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),o.off(K.Events.ERROR,this.onError,this)},A.onMediaAttached=function(o,l){if(this.media=l.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)},A.pollTrackChange=function(o){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,o)},A.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 o=L(this.media.textTracks);o.forEach(function(l){Object(P.clearCurrentCues)(l)}),this.subtitleTrack=-1,this.media=null},A.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},A.onManifestParsed=function(o,l){this.tracks=l.subtitleTracks},A.onSubtitleTrackLoaded=function(o,l){var u=l.id,y=l.details,m=this.trackId,h=this.tracksInGroup[m];if(!h){this.warn("Invalid subtitle track id "+u);return}var w=h.details;h.details=l.details,this.log("subtitle track "+u+" loaded ["+y.startSN+"-"+y.endSN+"]"),u===this.trackId&&(this.retryCount=0,this.playlistLoaded(u,l,w))},A.onLevelLoading=function(o,l){this.switchLevel(l.level)},A.onLevelSwitching=function(o,l){this.switchLevel(l.level)},A.switchLevel=function(o){var l=this.hls.levels[o];if(!(l!=null&&l.textGroupIds))return;var u=l.textGroupIds[l.urlId];if(this.groupId!==u){var y=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,m=this.tracks.filter(function(E){return!u||E.groupId===u});this.tracksInGroup=m;var h=this.findTrackId(y==null?void 0:y.name)||this.findTrackId();this.groupId=u;var w={subtitleTracks:m};this.log("Updating subtitle tracks, "+m.length+' track(s) found in "'+u+'" group-id'),this.hls.trigger(K.Events.SUBTITLE_TRACKS_UPDATED,w),h!==-1&&this.setSubtitleTrack(h,y)}},A.findTrackId=function(o){for(var l=this.tracksInGroup,u=0;u<l.length;u++){var y=l[u];if((!this.selectDefaultTrack||y.default)&&(!o||o===y.name))return y.id}return-1},A.onError=function(o,l){if(C.prototype.onError.call(this,o,l),l.fatal||!l.context)return;l.context.type===U.PlaylistContextType.SUBTITLE_TRACK&&l.context.id===this.trackId&&l.context.groupId===this.groupId&&this.retryLoadingOrFail(l)},A.loadPlaylist=function(o){var l=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(l)){var u=l.id,y=l.groupId,m=l.url;if(o)try{m=o.addDirectives(m)}catch(h){this.warn("Could not construct new URL with HLS Delivery Directives: "+h)}this.log("Loading subtitle playlist for id "+u),this.hls.trigger(K.Events.SUBTITLE_TRACK_LOADING,{url:m,id:u,groupId:y,deliveryDirectives:o||null})}},A.toggleTrackModes=function(o){var l=this,u=this.media,y=this.subtitleDisplay,m=this.trackId;if(!u)return;var h=L(u.textTracks),w=h.filter(function(c){return c.groupId===l.groupId});if(o===-1)[].slice.call(h).forEach(function(c){c.mode="disabled"});else{var E=w[m];E&&(E.mode="disabled")}var f=w[o];f&&(f.mode=y?"showing":"hidden")},A.setSubtitleTrack=function(o,l){var u,y=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=o;return}if(this.trackId!==o&&this.toggleTrackModes(o),this.trackId===o&&(o===-1||(u=y[o])!==null&&u!==void 0&&u.details)||o<-1||o>=y.length)return;this.clearTimer();var m=y[o];if(this.log("Switching to subtitle track "+o),this.trackId=o,m){var h=m.id,w=m.groupId,E=w===void 0?"":w,f=m.name,c=m.type,s=m.url;this.hls.trigger(K.Events.SUBTITLE_TRACK_SWITCH,{id:h,groupId:E,name:f,type:c,url:s});var a=this.switchParams(m.url,l==null?void 0:l.details);this.loadPlaylist(a)}else this.hls.trigger(K.Events.SUBTITLE_TRACK_SWITCH,{id:o})},A.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var o=-1,l=L(this.media.textTracks),u=0;u<l.length;u++)if(l[u].mode==="hidden")o=u;else if(l[u].mode==="showing"){o=u;break}this.subtitleTrack!==o&&(this.subtitleTrack=o)},I(S,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(o){this.selectDefaultTrack=!1;var l=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(o,l)}}]),S}(M.default);function L(C){for(var S=[],A=0;A<C.length;A++){var d=C[A];d.kind==="subtitles"&&d.label&&S.push(C[A])}return S}G.default=T},"./src/controller/timeline-controller.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"TimelineController",function(){return L});var K=D("./src/polyfills/number.ts"),P=D("./src/events.ts"),M=D("./src/utils/cea-608-parser.ts"),U=D("./src/utils/output-filter.ts"),B=D("./src/utils/webvtt-parser.ts"),I=D("./src/utils/texttrack-utils.ts"),R=D("./src/utils/imsc1-ttml-parser.ts"),g=D("./src/types/loader.ts"),T=D("./src/utils/logger.ts"),L=function(){function d(l){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=A(),this.captionsProperties=void 0,this.hls=l,this.config=l.config,this.Cues=l.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 u=new U.default(this,"textTrack1"),y=new U.default(this,"textTrack2"),m=new U.default(this,"textTrack3"),h=new U.default(this,"textTrack4");this.cea608Parser1=new M.default(1,u,y),this.cea608Parser2=new M.default(3,m,h)}l.on(P.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),l.on(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),l.on(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.on(P.Events.MANIFEST_LOADED,this.onManifestLoaded,this),l.on(P.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),l.on(P.Events.FRAG_LOADING,this.onFragLoading,this),l.on(P.Events.FRAG_LOADED,this.onFragLoaded,this),l.on(P.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),l.on(P.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),l.on(P.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),l.on(P.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),l.on(P.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var o=d.prototype;return o.destroy=function(){var u=this.hls;u.off(P.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),u.off(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.off(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.off(P.Events.MANIFEST_LOADED,this.onManifestLoaded,this),u.off(P.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),u.off(P.Events.FRAG_LOADING,this.onFragLoading,this),u.off(P.Events.FRAG_LOADED,this.onFragLoaded,this),u.off(P.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),u.off(P.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),u.off(P.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),u.off(P.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),u.off(P.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},o.addCues=function(u,y,m,h,w){for(var E=!1,f=w.length;f--;){var c=w[f],s=S(c[0],c[1],y,m);if(s>=0&&(c[0]=Math.min(c[0],y),c[1]=Math.max(c[1],m),E=!0,s/(m-y)>.5))return}if(E||w.push([y,m]),this.config.renderTextTracksNatively){var a=this.captionsTracks[u];this.Cues.newCue(a,y,m,h)}else{var v=this.Cues.newCue(null,y,m,h);this.hls.trigger(P.Events.CUES_PARSED,{type:"captions",cues:v,track:u})}},o.onInitPtsFound=function(u,y){var m=this,h=y.frag,w=y.id,E=y.initPTS,f=y.timescale,c=this.unparsedVttFrags;w==="main"&&(this.initPTS[h.cc]=E,this.timescale[h.cc]=f),c.length&&(this.unparsedVttFrags=[],c.forEach(function(s){m.onFragLoaded(P.Events.FRAG_LOADED,s)}))},o.getExistingTrack=function(u){var y=this.media;if(y)for(var m=0;m<y.textTracks.length;m++){var h=y.textTracks[m];if(h[u])return h}return null},o.createCaptionsTrack=function(u){this.config.renderTextTracksNatively?this.createNativeTrack(u):this.createNonNativeTrack(u)},o.createNativeTrack=function(u){if(this.captionsTracks[u])return;var y=this.captionsProperties,m=this.captionsTracks,h=this.media,w=y[u],E=w.label,f=w.languageCode,c=this.getExistingTrack(u);if(c)m[u]=c,Object(I.clearCurrentCues)(m[u]),Object(I.sendAddTrackEvent)(m[u],h);else{var s=this.createTextTrack("captions",E,f);s&&(s[u]=!0,m[u]=s)}},o.createNonNativeTrack=function(u){if(this.nonNativeCaptionsTracks[u])return;var y=this.captionsProperties[u];if(!y)return;var m=y.label,h={_id:u,label:m,kind:"captions",default:y.media?!!y.media.default:!1,closedCaptions:y.media};this.nonNativeCaptionsTracks[u]=h,this.hls.trigger(P.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[h]})},o.createTextTrack=function(u,y,m){var h=this.media;return h?h.addTextTrack(u,y,m):void 0},o.onMediaAttaching=function(u,y){this.media=y.media,this._cleanTracks()},o.onMediaDetaching=function(){var u=this.captionsTracks;Object.keys(u).forEach(function(y){Object(I.clearCurrentCues)(u[y]),delete u[y]}),this.nonNativeCaptionsTracks={}},o.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=A(),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())},o._cleanTracks=function(){var u=this.media;if(!u)return;var y=u.textTracks;if(y)for(var m=0;m<y.length;m++)Object(I.clearCurrentCues)(y[m])},o.onSubtitleTracksUpdated=function(u,y){var m=this;this.textTracks=[];var h=y.subtitleTracks||[],w=h.some(function(s){return s.textCodec===R.IMSC1_CODEC});if(this.config.enableWebVTT||w&&this.config.enableIMSC1){var E=this.tracks&&h&&this.tracks.length===h.length;if(this.tracks=h||[],this.config.renderTextTracksNatively){var f=this.media?this.media.textTracks:[];this.tracks.forEach(function(s,a){var v;if(a<f.length){for(var p=null,b=0;b<f.length;b++)if(C(f[b],s)){p=f[b];break}p&&(v=p)}v?Object(I.clearCurrentCues)(v):(v=m.createTextTrack("subtitles",s.name,s.lang),v&&(v.mode="disabled")),v&&(v.groupId=s.groupId,m.textTracks.push(v))})}else if(!E&&this.tracks&&this.tracks.length){var c=this.tracks.map(function(s){return{label:s.name,kind:s.type.toLowerCase(),default:s.default,subtitleTrack:s}});this.hls.trigger(P.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:c})}}},o.onManifestLoaded=function(u,y){var m=this;this.config.enableCEA708Captions&&y.captions&&y.captions.forEach(function(h){var w=/(?:CC|SERVICE)([1-4])/.exec(h.instreamId);if(!w)return;var E="textTrack"+w[1],f=m.captionsProperties[E];if(!f)return;f.label=h.name,h.lang&&(f.languageCode=h.lang),f.media=h})},o.onFragLoading=function(u,y){var m=this.cea608Parser1,h=this.cea608Parser2,w=this.lastSn,E=this.lastPartIndex;if(!this.enabled||!(m&&h))return;if(y.frag.type===g.PlaylistLevelType.MAIN){var f,c,s=y.frag.sn,a=(f=y==null||((c=y.part)===null||c===void 0)?void 0:c.index)!=null?f:-1;s===w+1||s===w&&a===E+1||(m.reset(),h.reset()),this.lastSn=s,this.lastPartIndex=a}},o.onFragLoaded=function(u,y){var m=y.frag,h=y.payload,w=this.initPTS,E=this.unparsedVttFrags;if(m.type===g.PlaylistLevelType.SUBTITLE)if(h.byteLength){if(!Object(K.isFiniteNumber)(w[m.cc])){E.push(y),w.length&&this.hls.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:m,error:new Error("Missing initial subtitle PTS")});return}var f=m.decryptdata;if(f==null||f.key==null||f.method!=="AES-128"){var c=this.tracks[m.level],s=this.vttCCs;s[m.cc]||(s[m.cc]={start:m.start,prevCC:this.prevCC,new:!0},this.prevCC=m.cc),c&&c.textCodec===R.IMSC1_CODEC?this._parseIMSC1(m,h):this._parseVTTs(m,h,s)}}else this.hls.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:m,error:new Error("Empty subtitle payload")})},o._parseIMSC1=function(u,y){var m=this,h=this.hls;Object(R.parseIMSC1)(y,this.initPTS[u.cc],this.timescale[u.cc],function(w){m._appendCues(w,u.level),h.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:u})},function(w){T.logger.log("Failed to parse IMSC1: "+w),h.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:u,error:w})})},o._parseVTTs=function(u,y,m){var h=this,w=this.hls;Object(B.parseWebVTT)(y,this.initPTS[u.cc],this.timescale[u.cc],m,u.cc,u.start,function(E){h._appendCues(E,u.level),w.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:u})},function(E){h._fallbackToIMSC1(u,y),T.logger.log("Failed to parse VTT cue: "+E),w.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:u,error:E})})},o._fallbackToIMSC1=function(u,y){var m=this,h=this.tracks[u.level];h.textCodec||Object(R.parseIMSC1)(y,this.initPTS[u.cc],this.timescale[u.cc],function(){h.textCodec=R.IMSC1_CODEC,m._parseIMSC1(u,y)},function(){h.textCodec="wvtt"})},o._appendCues=function(u,y){var m=this.hls;if(this.config.renderTextTracksNatively){var h=this.textTracks[y];if(h.mode==="disabled")return;u.forEach(function(f){return Object(I.addCueToTrack)(h,f)})}else{var w=this.tracks[y],E=w.default?"default":"subtitles"+y;m.trigger(P.Events.CUES_PARSED,{type:"subtitles",cues:u,track:E})}},o.onFragDecrypted=function(u,y){var m=y.frag;if(m.type===g.PlaylistLevelType.SUBTITLE){if(!Object(K.isFiniteNumber)(this.initPTS[m.cc])){this.unparsedVttFrags.push(y);return}this.onFragLoaded(P.Events.FRAG_LOADED,y)}},o.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},o.onFragParsingUserdata=function(u,y){var m=this.cea608Parser1,h=this.cea608Parser2;if(!this.enabled||!(m&&h))return;for(var w=0;w<y.samples.length;w++){var E=y.samples[w].bytes;if(E){var f=this.extractCea608Data(E);m.addData(y.samples[w].pts,f[0]),h.addData(y.samples[w].pts,f[1])}}},o.onBufferFlushing=function(u,y){var m=y.startOffset,h=y.endOffset,w=y.endOffsetSubtitles,E=y.type,f=this.media;if(!f||f.currentTime<h)return;if(!E||E==="video"){var c=this.captionsTracks;Object.keys(c).forEach(function(a){return Object(I.removeCuesInRange)(c[a],m,h)})}if(this.config.renderTextTracksNatively&&(m===0&&w!==void 0)){var s=this.textTracks;Object.keys(s).forEach(function(a){return Object(I.removeCuesInRange)(s[a],m,w)})}},o.extractCea608Data=function(u){for(var y=u[0]&31,m=2,h=[[],[]],w=0;w<y;w++){var E=u[m++],f=127&u[m++],c=127&u[m++],s=(4&E)!==0,a=3&E;if(f===0&&c===0)continue;s&&((a===0||a===1)&&(h[a].push(f),h[a].push(c)))}return h},d}();function C(d,o){return d&&d.label===o.name&&!(d.textTrack1||d.textTrack2)}function S(d,o,l,u){return Math.min(o,u)-Math.max(d,l)}function A(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"default",function(){return K});var K=function(){function P(U,B){this.subtle=void 0,this.aesIV=void 0,this.subtle=U,this.aesIV=B}var M=P.prototype;return M.decrypt=function(B,I){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},I,B)},P}()},"./src/crypt/aes-decryptor.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"removePadding",function(){return P}),D.d(G,"default",function(){return M});var K=D("./src/utils/typed-array.ts");function P(U){var B=U.byteLength,I=B&&new DataView(U.buffer).getUint8(B-1);return I?Object(K.sliceUint8)(U,0,B-I):U}var M=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 B=U.prototype;return B.uint8ArrayToUint32Array_=function(R){for(var g=new DataView(R),T=new Uint32Array(4),L=0;L<4;L++)T[L]=g.getUint32(L*4);return T},B.initTable=function(){var R=this.sBox,g=this.invSBox,T=this.subMix,L=T[0],C=T[1],S=T[2],A=T[3],d=this.invSubMix,o=d[0],l=d[1],u=d[2],y=d[3],m=new Uint32Array(256),h=0,w=0,E=0;for(E=0;E<256;E++)E<128?m[E]=E<<1:m[E]=E<<1^283;for(E=0;E<256;E++){var f=w^w<<1^w<<2^w<<3^w<<4;f=f>>>8^f&255^99,R[h]=f,g[f]=h;var c=m[h],s=m[c],a=m[s],v=m[f]*257^f*16843008;L[h]=v<<24|v>>>8,C[h]=v<<16|v>>>16,S[h]=v<<8|v>>>24,A[h]=v,v=a*16843009^s*65537^c*257^h*16843008,o[f]=v<<24|v>>>8,l[f]=v<<16|v>>>16,u[f]=v<<8|v>>>24,y[f]=v,h?(h=c^m[m[m[a^c]]],w^=m[m[w]]):h=w=1}},B.expandKey=function(R){for(var g=this.uint8ArrayToUint32Array_(R),T=!0,L=0;L<g.length&&T;)T=g[L]===this.key[L],L++;if(T)return;this.key=g;var C=this.keySize=g.length;if(C!==4&&C!==6&&C!==8)throw new Error("Invalid aes key size="+C);var S=this.ksRows=(C+6+1)*4,A,d,o=this.keySchedule=new Uint32Array(S),l=this.invKeySchedule=new Uint32Array(S),u=this.sBox,y=this.rcon,m=this.invSubMix,h=m[0],w=m[1],E=m[2],f=m[3],c,s;for(A=0;A<S;A++){if(A<C){c=o[A]=g[A];continue}s=c,A%C===0?(s=s<<8|s>>>24,s=u[s>>>24]<<24|u[s>>>16&255]<<16|u[s>>>8&255]<<8|u[s&255],s^=y[A/C|0]<<24):C>6&&A%C===4&&(s=u[s>>>24]<<24|u[s>>>16&255]<<16|u[s>>>8&255]<<8|u[s&255]),o[A]=c=(o[A-C]^s)>>>0}for(d=0;d<S;d++)A=S-d,d&3?s=o[A]:s=o[A-4],d<4||A<=4?l[d]=s:l[d]=h[u[s>>>24]]^w[u[s>>>16&255]]^E[u[s>>>8&255]]^f[u[s&255]],l[d]=l[d]>>>0},B.networkToHostOrderSwap=function(R){return R<<24|(R&65280)<<8|(R&16711680)>>8|R>>>24},B.decrypt=function(R,g,T){for(var L=this.keySize+6,C=this.invKeySchedule,S=this.invSBox,A=this.invSubMix,d=A[0],o=A[1],l=A[2],u=A[3],y=this.uint8ArrayToUint32Array_(T),m=y[0],h=y[1],w=y[2],E=y[3],f=new Int32Array(R),c=new Int32Array(f.length),s,a,v,p,b,O,N,W,V,F,_,J,ee,oe,de=this.networkToHostOrderSwap;g<f.length;){for(V=de(f[g]),F=de(f[g+1]),_=de(f[g+2]),J=de(f[g+3]),b=V^C[0],O=J^C[1],N=_^C[2],W=F^C[3],ee=4,oe=1;oe<L;oe++)s=d[b>>>24]^o[O>>16&255]^l[N>>8&255]^u[W&255]^C[ee],a=d[O>>>24]^o[N>>16&255]^l[W>>8&255]^u[b&255]^C[ee+1],v=d[N>>>24]^o[W>>16&255]^l[b>>8&255]^u[O&255]^C[ee+2],p=d[W>>>24]^o[b>>16&255]^l[O>>8&255]^u[N&255]^C[ee+3],b=s,O=a,N=v,W=p,ee=ee+4;s=S[b>>>24]<<24^S[O>>16&255]<<16^S[N>>8&255]<<8^S[W&255]^C[ee],a=S[O>>>24]<<24^S[N>>16&255]<<16^S[W>>8&255]<<8^S[b&255]^C[ee+1],v=S[N>>>24]<<24^S[W>>16&255]<<16^S[b>>8&255]<<8^S[O&255]^C[ee+2],p=S[W>>>24]<<24^S[b>>16&255]<<16^S[O>>8&255]<<8^S[N&255]^C[ee+3],c[g]=de(s^m),c[g+1]=de(p^h),c[g+2]=de(v^w),c[g+3]=de(a^E),m=V,h=F,w=_,E=J,g=g+4}return c.buffer},U}()},"./src/crypt/decrypter.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"default",function(){return g});var K=D("./src/crypt/aes-crypto.ts"),P=D("./src/crypt/fast-aes-key.ts"),M=D("./src/crypt/aes-decryptor.ts"),U=D("./src/utils/logger.ts"),B=D("./src/utils/mp4-tools.ts"),I=D("./src/utils/typed-array.ts"),R=16,g=function(){function T(C,S,A){var d=A===void 0?{}:A,o=d.removePKCS7Padding,l=o===void 0?!0:o;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=C,this.config=S,this.removePKCS7Padding=l,l)try{var u=self.crypto;u&&(this.subtle=u.subtle||u.webkitSubtle)}catch(y){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var L=T.prototype;return L.destroy=function(){this.observer=null},L.isSync=function(){return this.config.enableSoftwareAES},L.flush=function(){var S=this.currentResult;if(!S){this.reset();return}var A=new Uint8Array(S);return this.reset(),this.removePKCS7Padding?Object(M.removePadding)(A):A},L.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},L.decrypt=function(S,A,d,o){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(S),A,d);var l=this.flush();l&&o(l.buffer)}else this.webCryptoDecrypt(new Uint8Array(S),A,d).then(o)},L.softwareDecrypt=function(S,A,d){var o=this.currentIV,l=this.currentResult,u=this.remainderData;this.logOnce("JS AES decrypt"),u&&(S=Object(B.appendUint8Array)(u,S),this.remainderData=null);var y=this.getValidChunk(S);if(!y.length)return null;o&&(d=o);var m=this.softwareDecrypter;m||(m=this.softwareDecrypter=new M.default),m.expandKey(A);var h=l;return this.currentResult=m.decrypt(y.buffer,0,d),this.currentIV=Object(I.sliceUint8)(y,-16).buffer,h||null},L.webCryptoDecrypt=function(S,A,d){var o=this,l=this.subtle;return(this.key!==A||!this.fastAesKey)&&(this.key=A,this.fastAesKey=new P.default(l,A)),this.fastAesKey.expandKey().then(function(u){if(!l)return Promise.reject(new Error("web crypto not initialized"));var y=new K.default(l,d);return y.decrypt(S.buffer,u)}).catch(function(u){return o.onWebCryptoError(u,S,A,d)})},L.onWebCryptoError=function(S,A,d,o){return U.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",S),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(A,d,o)},L.getValidChunk=function(S){var A=S,d=S.length-S.length%R;return d!==S.length&&(A=Object(I.sliceUint8)(S,0,d),this.remainderData=Object(I.sliceUint8)(S,d)),A},L.logOnce=function(S){if(!this.logEnabled)return;U.logger.log("[decrypter.ts]: "+S),this.logEnabled=!1},T}()},"./src/crypt/fast-aes-key.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"default",function(){return K});var K=function(){function P(U,B){this.subtle=void 0,this.key=void 0,this.subtle=U,this.key=B}var M=P.prototype;return M.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},P}()},"./src/demux/aacdemuxer.ts":function(q,G,D){"use strict";D.r(G);var K=D("./src/demux/base-audio-demuxer.ts"),P=D("./src/demux/adts.ts"),M=D("./src/utils/logger.ts"),U=D("./src/demux/id3.ts");function B(g,T){g.prototype=Object.create(T.prototype),g.prototype.constructor=g,I(g,T)}function I(g,T){return I=Object.setPrototypeOf||function(C,S){return C.__proto__=S,C},I(g,T)}var R=function(g){B(T,g);function T(C,S){var A;return A=g.call(this)||this,A.observer=void 0,A.config=void 0,A.observer=C,A.config=S,A}var L=T.prototype;return L.resetInitSegment=function(S,A,d){g.prototype.resetInitSegment.call(this,S,A,d),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:S,duration:d,inputTimeScale:9e4,dropped:0}},T.probe=function(S){if(!S)return!1;for(var A=U.getID3Data(S,0)||[],d=A.length,o=S.length;d<o;d++)if(P.probe(S,d))return M.logger.log("ADTS sync word found !"),!0;return!1},L.canParse=function(S,A){return P.canParse(S,A)},L.appendFrame=function(S,A,d){P.initTrackConfig(S,this.observer,A,d,S.manifestCodec);var o=P.appendFrame(S,A,d,this.initPTS,this.frameIndex);if(o&&o.missing===0)return o},T}(K.default);R.minProbeByteLength=9,G.default=R},"./src/demux/adts.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"getAudioConfig",function(){return U}),D.d(G,"isHeaderPattern",function(){return B}),D.d(G,"getHeaderLength",function(){return I}),D.d(G,"getFullFrameLength",function(){return R}),D.d(G,"canGetFrameLength",function(){return g}),D.d(G,"isHeader",function(){return T}),D.d(G,"canParse",function(){return L}),D.d(G,"probe",function(){return C}),D.d(G,"initTrackConfig",function(){return S}),D.d(G,"getFrameDuration",function(){return A}),D.d(G,"parseFrameHeader",function(){return d}),D.d(G,"appendFrame",function(){return o});var K=D("./src/utils/logger.ts"),P=D("./src/errors.ts"),M=D("./src/events.ts");function U(l,u,y,m){var h,w,E,f,c=navigator.userAgent.toLowerCase(),s=m,a=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];h=((u[y+2]&192)>>>6)+1;var v=(u[y+2]&60)>>>2;if(v>a.length-1){l.trigger(M.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+v});return}return E=(u[y+2]&1)<<2,E|=(u[y+3]&192)>>>6,K.logger.log("manifest codec:"+m+", ADTS type:"+h+", samplingIndex:"+v),/firefox/i.test(c)?v>=6?(h=5,f=new Array(4),w=v-3):(h=2,f=new Array(2),w=v):c.indexOf("android")!==-1?(h=2,f=new Array(2),w=v):(h=5,f=new Array(4),m&&(m.indexOf("mp4a.40.29")!==-1||m.indexOf("mp4a.40.5")!==-1)||!m&&v>=6?w=v-3:((m&&m.indexOf("mp4a.40.2")!==-1&&(v>=6&&E===1||/vivaldi/i.test(c))||!m&&E===1)&&(h=2,f=new Array(2)),w=v)),f[0]=h<<3,f[0]|=(v&14)>>1,f[1]|=(v&1)<<7,f[1]|=E<<3,h===5&&(f[1]|=(w&14)>>1,f[2]=(w&1)<<7,f[2]|=2<<2,f[3]=0),{config:f,samplerate:a[v],channelCount:E,codec:"mp4a.40."+h,manifestCodec:s}}function B(l,u){return l[u]===255&&(l[u+1]&246)===240}function I(l,u){return l[u+1]&1?7:9}function R(l,u){return(l[u+3]&3)<<11|l[u+4]<<3|(l[u+5]&224)>>>5}function g(l,u){return u+5<l.length}function T(l,u){return u+1<l.length&&B(l,u)}function L(l,u){return g(l,u)&&B(l,u)&&R(l,u)<=l.length-u}function C(l,u){if(T(l,u)){var y=I(l,u);if(u+y>=l.length)return!1;var m=R(l,u);if(m<=y)return!1;var h=u+m;return h===l.length||T(l,h)}return!1}function S(l,u,y,m,h){if(!l.samplerate){var w=U(u,y,m,h);if(!w)return;l.config=w.config,l.samplerate=w.samplerate,l.channelCount=w.channelCount,l.codec=w.codec,l.manifestCodec=w.manifestCodec,K.logger.log("parsed codec:"+l.codec+", rate:"+w.samplerate+", channels:"+w.channelCount)}}function A(l){return 1024*9e4/l}function d(l,u,y,m,h){var w=I(l,u),E=R(l,u);if(E-=w,E>0){var f=y+m*h;return{headerLength:w,frameLength:E,stamp:f}}}function o(l,u,y,m,h){var w=A(l.samplerate),E=d(u,y,m,h,w);if(E){var f=E.frameLength,c=E.headerLength,s=E.stamp,a=c+f,v=Math.max(0,y+a-u.length),p;v?(p=new Uint8Array(a-c),p.set(u.subarray(y+c,u.length),0)):p=u.subarray(y+c,y+a);var b={unit:p,pts:s};return v||l.samples.push(b),{sample:b,length:a,missing:v}}}},"./src/demux/base-audio-demuxer.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"initPTSFn",function(){return R});var K=D("./src/polyfills/number.ts"),P=D("./src/demux/id3.ts"),M=D("./src/demux/dummy-demuxed-track.ts"),U=D("./src/utils/mp4-tools.ts"),B=D("./src/utils/typed-array.ts"),I=function(){function g(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var T=g.prototype;return T.resetInitSegment=function(C,S,A){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},T.resetTimeStamp=function(){},T.resetContiguity=function(){},T.canParse=function(C,S){return!1},T.appendFrame=function(C,S,A){},T.demux=function(C,S){this.cachedData&&(C=Object(U.appendUint8Array)(this.cachedData,C),this.cachedData=null);var A=P.getID3Data(C,0),d=A?A.length:0,o,l,u=this._audioTrack,y=this._id3Track,m=A?P.getTimeStamp(A):void 0,h=C.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=R(m,S)),A&&A.length>0&&y.samples.push({pts:this.initPTS,dts:this.initPTS,data:A}),l=this.initPTS;d<h;){if(this.canParse(C,d)){var w=this.appendFrame(u,C,d);w?(this.frameIndex++,l=w.sample.pts,d+=w.length,o=d):d=h}else P.canParse(C,d)?(A=P.getID3Data(C,d),y.samples.push({pts:l,dts:l,data:A}),d+=A.length,o=d):d++;if(d===h&&o!==h){var E=Object(B.sliceUint8)(C,o);this.cachedData?this.cachedData=Object(U.appendUint8Array)(this.cachedData,E):this.cachedData=E}}return{audioTrack:u,avcTrack:Object(M.dummyTrack)(),id3Track:y,textTrack:Object(M.dummyTrack)()}},T.demuxSampleAes=function(C,S,A){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},T.flush=function(C){var S=this.cachedData;return S&&(this.cachedData=null,this.demux(S,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(M.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(M.dummyTrack)()}},T.destroy=function(){},g}(),R=function(T,L){return Object(K.isFiniteNumber)(T)?T*90:L*9e4};G.default=I},"./src/demux/chunk-cache.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"default",function(){return K});var K=function(){function M(){this.chunks=[],this.dataLength=0}var U=M.prototype;return U.push=function(I){this.chunks.push(I),this.dataLength+=I.length},U.flush=function(){var I=this.chunks,R=this.dataLength,g;if(I.length)I.length===1?g=I[0]:g=P(I,R);else return new Uint8Array(0);return this.reset(),g},U.reset=function(){this.chunks.length=0,this.dataLength=0},M}();function P(M,U){for(var B=new Uint8Array(U),I=0,R=0;R<M.length;R++){var g=M[R];B.set(g,I),I+=g.length}return B}},"./src/demux/dummy-demuxed-track.ts":function(q,G,D){"use strict";D.r(G),D.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,D){"use strict";D.r(G);var K=D("./src/utils/logger.ts"),P=function(){function M(B){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=B,this.bytesAvailable=B.byteLength,this.word=0,this.bitsAvailable=0}var U=M.prototype;return U.loadWord=function(){var I=this.data,R=this.bytesAvailable,g=I.byteLength-R,T=new Uint8Array(4),L=Math.min(4,R);if(L===0)throw new Error("no bytes available");T.set(I.subarray(g,g+L)),this.word=new DataView(T.buffer).getUint32(0),this.bitsAvailable=L*8,this.bytesAvailable-=L},U.skipBits=function(I){var R;this.bitsAvailable>I?(this.word<<=I,this.bitsAvailable-=I):(I-=this.bitsAvailable,R=I>>3,I-=R>>3,this.bytesAvailable-=R,this.loadWord(),this.word<<=I,this.bitsAvailable-=I)},U.readBits=function(I){var R=Math.min(this.bitsAvailable,I),g=this.word>>>32-R;return I>32&&K.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=R,this.bitsAvailable>0?this.word<<=R:this.bytesAvailable>0&&this.loadWord(),R=I-R,R>0&&this.bitsAvailable?g<<R|this.readBits(R):g},U.skipLZ=function(){var I;for(I=0;I<this.bitsAvailable;++I)if((this.word&2147483648>>>I)!==0)return this.word<<=I,this.bitsAvailable-=I,I;return this.loadWord(),I+this.skipLZ()},U.skipUEG=function(){this.skipBits(1+this.skipLZ())},U.skipEG=function(){this.skipBits(1+this.skipLZ())},U.readUEG=function(){var I=this.skipLZ();return this.readBits(I+1)-1},U.readEG=function(){var I=this.readUEG();return 1&I?1+I>>>1:-1*(I>>>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(I){for(var R=8,g=8,T,L=0;L<I;L++)g!==0&&(T=this.readEG(),g=(R+T+256)%256),R=g===0?R:g},U.readSPS=function(){var I=0,R=0,g=0,T=0,L,C,S,A=this.readUByte.bind(this),d=this.readBits.bind(this),o=this.readUEG.bind(this),l=this.readBoolean.bind(this),u=this.skipBits.bind(this),y=this.skipEG.bind(this),m=this.skipUEG.bind(this),h=this.skipScalingList.bind(this);A();var w=A();if(d(5),u(3),A(),m(),w===100||w===110||w===122||w===244||w===44||w===83||w===86||w===118||w===128){var E=o();if(E===3&&u(1),m(),m(),u(1),l())for(C=E!==3?8:12,S=0;S<C;S++)l()&&(S<6?h(16):h(64))}m();var f=o();if(f===0)o();else if(f===1)for(u(1),y(),y(),L=o(),S=0;S<L;S++)y();m(),u(1);var c=o(),s=o(),a=d(1);a===0&&u(1),u(1),l()&&(I=o(),R=o(),g=o(),T=o());var v=[1,1];if(l()&&l()){var p=A();switch(p){case 1:v=[1,1];break;case 2:v=[12,11];break;case 3:v=[10,11];break;case 4:v=[16,11];break;case 5:v=[40,33];break;case 6:v=[24,11];break;case 7:v=[20,11];break;case 8:v=[32,11];break;case 9:v=[80,33];break;case 10:v=[18,11];break;case 11:v=[15,11];break;case 12:v=[64,33];break;case 13:v=[160,99];break;case 14:v=[4,3];break;case 15:v=[3,2];break;case 16:v=[2,1];break;case 255:{v=[A()<<8|A(),A()<<8|A()];break}}}return{width:Math.ceil((c+1)*16-I*2-R*2),height:(2-a)*(s+1)*16-(a?2:4)*(g+T),pixelRatio:v}},U.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},M}();G.default=P},"./src/demux/id3.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"isHeader",function(){return K}),D.d(G,"isFooter",function(){return P}),D.d(G,"getID3Data",function(){return M}),D.d(G,"canParse",function(){return B}),D.d(G,"getTimeStamp",function(){return I}),D.d(G,"isTimeStampFrame",function(){return R}),D.d(G,"getID3Frames",function(){return T}),D.d(G,"decodeFrame",function(){return L}),D.d(G,"utf8ArrayToStr",function(){return o}),D.d(G,"testables",function(){return l});var K=function(h,w){return w+10<=h.length&&(h[w]===73&&h[w+1]===68&&h[w+2]===51&&(h[w+3]<255&&h[w+4]<255&&(h[w+6]<128&&h[w+7]<128&&h[w+8]<128&&h[w+9]<128)))},P=function(h,w){return w+10<=h.length&&(h[w]===51&&h[w+1]===68&&h[w+2]===73&&(h[w+3]<255&&h[w+4]<255&&(h[w+6]<128&&h[w+7]<128&&h[w+8]<128&&h[w+9]<128)))},M=function(h,w){for(var E=w,f=0;K(h,w);){f+=10;var c=U(h,w+6);f+=c,P(h,w+10)&&(f+=10),w+=f}return f>0?h.subarray(E,E+f):void 0},U=function(h,w){var E=0;return E=(h[w]&127)<<21,E|=(h[w+1]&127)<<14,E|=(h[w+2]&127)<<7,E|=h[w+3]&127,E},B=function(h,w){return K(h,w)&&U(h,w+6)+10<=h.length-w},I=function(h){for(var w=T(h),E=0;E<w.length;E++){var f=w[E];if(R(f))return d(f)}return},R=function(h){return h&&h.key==="PRIV"&&h.info==="com.apple.streaming.transportStreamTimestamp"},g=function(h){var w=String.fromCharCode(h[0],h[1],h[2],h[3]),E=U(h,4),f=10;return{type:w,size:E,data:h.subarray(f,f+E)}},T=function(h){for(var w=0,E=[];K(h,w);){var f=U(h,w+6);w+=10;for(var c=w+f;w+8<c;){var s=g(h.subarray(w)),a=L(s);a&&E.push(a),w+=s.size+10}P(h,w)&&(w+=10)}return E},L=function(h){return h.type==="PRIV"?C(h):h.type[0]==="W"?A(h):S(h)},C=function(h){if(h.size<2)return;var w=o(h.data,!0),E=new Uint8Array(h.data.subarray(w.length+1));return{key:h.type,info:w,data:E.buffer}},S=function(h){if(h.size<2)return;if(h.type==="TXXX"){var w=1,E=o(h.data.subarray(w),!0);w+=E.length+1;var f=o(h.data.subarray(w));return{key:h.type,info:E,data:f}}var c=o(h.data.subarray(1));return{key:h.type,data:c}},A=function(h){if(h.type==="WXXX"){if(h.size<2)return;var w=1,E=o(h.data.subarray(w),!0);w+=E.length+1;var f=o(h.data.subarray(w));return{key:h.type,info:E,data:f}}var c=o(h.data);return{key:h.type,data:c}},d=function(h){if(h.data.byteLength===8){var w=new Uint8Array(h.data),E=w[3]&1,f=(w[4]<<23)+(w[5]<<15)+(w[6]<<7)+w[7];return f/=45,E&&(f+=4772185884e-2),Math.round(f)}return},o=function(h,w){w===void 0&&(w=!1);var E=y();if(E){var f=E.decode(h);if(w){var c=f.indexOf("\0");return c!==-1?f.substring(0,c):f}return f.replace(/\0/g,"")}for(var s=h.length,a,v,p,b="",O=0;O<s;){if(a=h[O++],a===0&&w)return b;if(a===0||a===3)continue;switch(a>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:b+=String.fromCharCode(a);break;case 12:case 13:v=h[O++],b+=String.fromCharCode((a&31)<<6|v&63);break;case 14:v=h[O++],p=h[O++],b+=String.fromCharCode((a&15)<<12|(v&63)<<6|(p&63)<<0);break;default:}}return b},l={decodeTextFrame:S},u;function y(){return!u&&typeof self.TextDecoder!="undefined"&&(u=new self.TextDecoder("utf-8")),u}},"./src/demux/mp3demuxer.ts":function(q,G,D){"use strict";D.r(G);var K=D("./src/demux/base-audio-demuxer.ts"),P=D("./src/demux/id3.ts"),M=D("./src/utils/logger.ts"),U=D("./src/demux/mpegaudio.ts");function B(g,T){g.prototype=Object.create(T.prototype),g.prototype.constructor=g,I(g,T)}function I(g,T){return I=Object.setPrototypeOf||function(C,S){return C.__proto__=S,C},I(g,T)}var R=function(g){B(T,g);function T(){return g.apply(this,arguments)||this}var L=T.prototype;return L.resetInitSegment=function(S,A,d){g.prototype.resetInitSegment.call(this,S,A,d),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:S,duration:d,inputTimeScale:9e4,dropped:0}},T.probe=function(S){if(!S)return!1;for(var A=P.getID3Data(S,0)||[],d=A.length,o=S.length;d<o;d++)if(U.probe(S,d))return M.logger.log("MPEG Audio sync word found !"),!0;return!1},L.canParse=function(S,A){return U.canParse(S,A)},L.appendFrame=function(S,A,d){return this.initPTS===null?void 0:U.appendFrame(S,A,d,this.initPTS,this.frameIndex)},T}(K.default);R.minProbeByteLength=4,G.default=R},"./src/demux/mp4demuxer.ts":function(q,G,D){"use strict";D.r(G);var K=D("./src/utils/mp4-tools.ts"),P=D("./src/demux/dummy-demuxed-track.ts"),M=function(){function U(I,R){this.remainderData=null,this.config=void 0,this.config=R}var B=U.prototype;return B.resetTimeStamp=function(){},B.resetInitSegment=function(){},B.resetContiguity=function(){},U.probe=function(R){return Object(K.findBox)({data:R,start:0,end:Math.min(R.length,16384)},["moof"]).length>0},B.demux=function(R){var g=R,T=Object(P.dummyTrack)();if(this.config.progressive){this.remainderData&&(g=Object(K.appendUint8Array)(this.remainderData,R));var L=Object(K.segmentValidRange)(g);this.remainderData=L.remainder,T.samples=L.valid||new Uint8Array}else T.samples=g;return{audioTrack:Object(P.dummyTrack)(),avcTrack:T,id3Track:Object(P.dummyTrack)(),textTrack:Object(P.dummyTrack)()}},B.flush=function(){var R=Object(P.dummyTrack)();return R.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(P.dummyTrack)(),avcTrack:R,id3Track:Object(P.dummyTrack)(),textTrack:Object(P.dummyTrack)()}},B.demuxSampleAes=function(R,g,T){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},B.destroy=function(){},U}();M.minProbeByteLength=1024,G.default=M},"./src/demux/mpegaudio.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"appendFrame",function(){return I}),D.d(G,"parseHeader",function(){return R}),D.d(G,"isHeaderPattern",function(){return g}),D.d(G,"isHeader",function(){return T}),D.d(G,"canParse",function(){return L}),D.d(G,"probe",function(){return C});var K=null,P=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],M=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],U=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],B=[0,1,1,4];function I(S,A,d,o,l){if(d+24>A.length)return;var u=R(A,d);if(u&&d+u.frameLength<=A.length){var y=u.samplesPerFrame*9e4/u.sampleRate,m=o+l*y,h={unit:A.subarray(d,d+u.frameLength),pts:m,dts:m};return S.config=[],S.channelCount=u.channelCount,S.samplerate=u.sampleRate,S.samples.push(h),{sample:h,length:u.frameLength,missing:0}}}function R(S,A){var d=S[A+1]>>3&3,o=S[A+1]>>1&3,l=S[A+2]>>4&15,u=S[A+2]>>2&3;if(d!==1&&l!==0&&l!==15&&u!==3){var y=S[A+2]>>1&1,m=S[A+3]>>6,h=d===3?3-o:o===3?3:4,w=P[h*14+l-1]*1e3,E=d===3?0:d===2?1:2,f=M[E*3+u],c=m===3?1:2,s=U[d][o],a=B[o],v=s*8*a,p=Math.floor(s*w/f+y)*a;if(K===null){var b=navigator.userAgent||"",O=b.match(/Chrome\/(\d+)/i);K=O?parseInt(O[1]):0}var N=!!K&&K<=87;return N&&o===2&&w>=224e3&&m===0&&(S[A+3]=S[A+3]|128),{sampleRate:f,channelCount:c,frameLength:p,samplesPerFrame:v}}}function g(S,A){return S[A]===255&&(S[A+1]&224)===224&&(S[A+1]&6)!==0}function T(S,A){return A+1<S.length&&g(S,A)}function L(S,A){var d=4;return g(S,A)&&d<=S.length-A}function C(S,A){if(A+1<S.length&&g(S,A)){var d=4,o=R(S,A),l=d;o!=null&&o.frameLength&&(l=o.frameLength);var u=A+l;return u===S.length||T(S,u)}return!1}},"./src/demux/sample-aes.ts":function(q,G,D){"use strict";D.r(G);var K=D("./src/crypt/decrypter.ts"),P=D("./src/demux/tsdemuxer.ts"),M=function(){function U(I,R,g){this.keyData=void 0,this.decrypter=void 0,this.keyData=g,this.decrypter=new K.default(I,R,{removePKCS7Padding:!1})}var B=U.prototype;return B.decryptBuffer=function(R,g){this.decrypter.decrypt(R,this.keyData.key.buffer,this.keyData.iv.buffer,g)},B.decryptAacSample=function(R,g,T,L){var C=R[g].unit,S=C.subarray(16,C.length-C.length%16),A=S.buffer.slice(S.byteOffset,S.byteOffset+S.length),d=this;this.decryptBuffer(A,function(o){var l=new Uint8Array(o);C.set(l,16),L||d.decryptAacSamples(R,g+1,T)})},B.decryptAacSamples=function(R,g,T){for(;;g++){if(g>=R.length){T();return}if(R[g].unit.length<32)continue;var L=this.decrypter.isSync();if(this.decryptAacSample(R,g,T,L),!L)return}},B.getAvcEncryptedData=function(R){for(var g=Math.floor((R.length-48)/160)*16+16,T=new Int8Array(g),L=0,C=32;C<=R.length-16;C+=160,L+=16)T.set(R.subarray(C,C+16),L);return T},B.getAvcDecryptedUnit=function(R,g){for(var T=new Uint8Array(g),L=0,C=32;C<=R.length-16;C+=160,L+=16)R.set(T.subarray(L,L+16),C);return R},B.decryptAvcSample=function(R,g,T,L,C,S){var A=Object(P.discardEPB)(C.data),d=this.getAvcEncryptedData(A),o=this;this.decryptBuffer(d.buffer,function(l){C.data=o.getAvcDecryptedUnit(A,l),S||o.decryptAvcSamples(R,g,T+1,L)})},B.decryptAvcSamples=function(R,g,T,L){if(R instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;g++,T=0){if(g>=R.length){L();return}for(var C=R[g].units;!(T>=C.length);T++){var S=C[T];if(S.data.length<=48||S.type!==1&&S.type!==5)continue;var A=this.decrypter.isSync();if(this.decryptAvcSample(R,g,T,L,S,A),!A)return}}},U}();G.default=M},"./src/demux/transmuxer-interface.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"default",function(){return C});var K=D("./node_modules/webworkify-webpack/index.js"),P=D.n(K),M=D("./src/events.ts"),U=D("./src/demux/transmuxer.ts"),B=D("./src/utils/logger.ts"),I=D("./src/errors.ts"),R=D("./src/utils/mediasource-helper.ts"),g=D("./node_modules/eventemitter3/index.js"),T=D.n(g),L=Object(R.getMediaSource)()||{isTypeSupported:function(){return!1}},C=function(){function S(d,o,l,u){var y=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=d,this.id=o,this.onTransmuxComplete=l,this.onFlush=u;var m=d.config,h=function(s,a){a=a||{},a.frag=y.frag,a.id=y.id,d.trigger(s,a)};this.observer=new g.EventEmitter,this.observer.on(M.Events.FRAG_DECRYPTED,h),this.observer.on(M.Events.ERROR,h);var w={mp4:L.isTypeSupported("video/mp4"),mpeg:L.isTypeSupported("audio/mpeg"),mp3:L.isTypeSupported('audio/mp4; codecs="mp3"')},E=navigator.vendor;if(m.enableWorker&&typeof Worker!="undefined"){B.logger.log("demuxing in webworker");var f;try{f=this.worker=K("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),f.addEventListener("message",this.onwmsg),f.onerror=function(c){d.trigger(M.Events.ERROR,{type:I.ErrorTypes.OTHER_ERROR,details:I.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(c.message+" ("+c.filename+":"+c.lineno+")")})},f.postMessage({cmd:"init",typeSupported:w,vendor:E,id:o,config:JSON.stringify(m)})}catch(c){B.logger.warn("Error in worker:",c),B.logger.error("Error while initializing DemuxerWorker, fallback to inline"),f&&self.URL.revokeObjectURL(f.objectURL),this.transmuxer=new U.default(this.observer,w,m,E,o),this.worker=null}}else this.transmuxer=new U.default(this.observer,w,m,E,o)}var A=S.prototype;return A.destroy=function(){var o=this.worker;if(o)o.removeEventListener("message",this.onwmsg),o.terminate(),this.worker=null;else{var l=this.transmuxer;l&&(l.destroy(),this.transmuxer=null)}var u=this.observer;u&&u.removeAllListeners(),this.observer=null},A.push=function(o,l,u,y,m,h,w,E,f,c){var s=this;f.transmuxing.start=self.performance.now();var a=this.transmuxer,v=this.worker,p=h?h.start:m.start,b=m.decryptdata,O=this.frag,N=!(O&&m.cc===O.cc),W=!(O&&f.level===O.level),V=O?f.sn-O.sn:-1,F=this.part?f.part-this.part.index:1,_=!W&&(V===1||V===0&&F===1),J=self.performance.now();(W||V||m.stats.parsing.start===0)&&(m.stats.parsing.start=J),h&&(F||!_)&&(h.stats.parsing.start=J);var ee=new U.TransmuxState(N,_,E,W,p);if(!_||N){B.logger.log("[transmuxer-interface, "+m.type+"]: Starting new transmux session for sn: "+f.sn+" p: "+f.part+" level: "+f.level+" id: "+f.id+`
discontinuity: `+N+`
trackSwitch: `+W+`
contiguous: `+_+`
accurateTimeOffset: `+E+`
timeOffset: `+p);var oe=new U.TransmuxConfig(u,y,l,w,c);this.configureTransmuxer(oe)}if(this.frag=m,this.part=h,v)v.postMessage({cmd:"demux",data:o,decryptdata:b,chunkMeta:f,state:ee},o instanceof ArrayBuffer?[o]:[]);else if(a){var de=a.push(o,b,f,ee);Object(U.isPromise)(de)?de.then(function(Ce){s.handleTransmuxComplete(Ce)}):this.handleTransmuxComplete(de)}},A.flush=function(o){var l=this;o.transmuxing.start=self.performance.now();var u=this.transmuxer,y=this.worker;if(y)y.postMessage({cmd:"flush",chunkMeta:o});else if(u){var m=u.flush(o);Object(U.isPromise)(m)?m.then(function(h){l.handleFlushResult(h,o)}):this.handleFlushResult(m,o)}},A.handleFlushResult=function(o,l){var u=this;o.forEach(function(y){u.handleTransmuxComplete(y)}),this.onFlush(l)},A.onWorkerMessage=function(o){var l=o.data,u=this.hls;switch(l.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(l.data);break}case"flush":{this.onFlush(l.data);break}default:{l.data=l.data||{},l.data.frag=this.frag,l.data.id=this.id,u.trigger(l.event,l.data);break}}},A.configureTransmuxer=function(o){var l=this.worker,u=this.transmuxer;l?l.postMessage({cmd:"configure",config:o}):u&&u.configure(o)},A.handleTransmuxComplete=function(o){o.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(o)},S}()},"./src/demux/transmuxer-worker.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"default",function(){return I});var K=D("./src/demux/transmuxer.ts"),P=D("./src/events.ts"),M=D("./src/utils/logger.ts"),U=D("./node_modules/eventemitter3/index.js"),B=D.n(U);function I(C){var S=new U.EventEmitter,A=function(o,l){C.postMessage({event:o,data:l})};S.on(P.Events.FRAG_DECRYPTED,A),S.on(P.Events.ERROR,A),C.addEventListener("message",function(d){var o=d.data;switch(o.cmd){case"init":{var l=JSON.parse(o.config);C.transmuxer=new K.default(S,o.typeSupported,l,o.vendor,o.id),Object(M.enableLogs)(l.debug),A("init",null);break}case"configure":{C.transmuxer.configure(o.config);break}case"demux":{var u=C.transmuxer.push(o.data,o.decryptdata,o.chunkMeta,o.state);Object(K.isPromise)(u)?u.then(function(h){R(C,h)}):R(C,u);break}case"flush":{var y=o.chunkMeta,m=C.transmuxer.flush(y);Object(K.isPromise)(m)?m.then(function(h){T(C,h,y)}):T(C,m,y);break}default:break}})}function R(C,S){if(L(S.remuxResult))return;var A=[],d=S.remuxResult,o=d.audio,l=d.video;o&&g(A,o),l&&g(A,l),C.postMessage({event:"transmuxComplete",data:S},A)}function g(C,S){S.data1&&C.push(S.data1.buffer),S.data2&&C.push(S.data2.buffer)}function T(C,S,A){S.forEach(function(d){R(C,d)}),C.postMessage({event:"flush",data:A})}function L(C){return!C.audio&&!C.video&&!C.text&&!C.id3&&!C.initSegment}},"./src/demux/transmuxer.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"default",function(){return l}),D.d(G,"isPromise",function(){return m}),D.d(G,"TransmuxConfig",function(){return h}),D.d(G,"TransmuxState",function(){return w});var K=D("./src/events.ts"),P=D("./src/errors.ts"),M=D("./src/crypt/decrypter.ts"),U=D("./src/demux/aacdemuxer.ts"),B=D("./src/demux/mp4demuxer.ts"),I=D("./src/demux/tsdemuxer.ts"),R=D("./src/demux/mp3demuxer.ts"),g=D("./src/remux/mp4-remuxer.ts"),T=D("./src/remux/passthrough-remuxer.ts"),L=D("./src/demux/chunk-cache.ts"),C=D("./src/utils/mp4-tools.ts"),S=D("./src/utils/logger.ts"),A;try{A=self.performance.now.bind(self.performance)}catch(E){S.logger.debug("Unable to use Performance API on this environment"),A=self.Date.now}var d=[{demux:I.default,remux:g.default},{demux:B.default,remux:T.default},{demux:U.default,remux:g.default},{demux:R.default,remux:g.default}],o=1024;d.forEach(function(E){var f=E.demux;o=Math.max(o,f.minProbeByteLength)});var l=function(){function E(c,s,a,v,p){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 L.default,this.observer=c,this.typeSupported=s,this.config=a,this.vendor=v,this.id=p}var f=E.prototype;return f.configure=function(s){this.transmuxConfig=s,this.decrypter&&this.decrypter.reset()},f.push=function(s,a,v,p){var b=this,O=v.transmuxing;O.executeStart=A();var N=new Uint8Array(s),W=this.cache,V=this.config,F=this.currentTransmuxState,_=this.transmuxConfig;p&&(this.currentTransmuxState=p);var J=u(N,a);if(J&&J.method==="AES-128"){var ee=this.getDecrypter();if(V.enableSoftwareAES){var oe=ee.softwareDecrypt(N,J.key.buffer,J.iv.buffer);if(!oe)return O.executeEnd=A(),y(v);N=new Uint8Array(oe)}else return this.decryptionPromise=ee.webCryptoDecrypt(N,J.key.buffer,J.iv.buffer).then(function(Se){var Ie=b.push(Se,null,v);return b.decryptionPromise=null,Ie}),this.decryptionPromise}var de=p||F,Ce=de.contiguous,ge=de.discontinuity,pe=de.trackSwitch,ce=de.accurateTimeOffset,he=de.timeOffset,ne=_.audioCodec,ue=_.videoCodec,Ee=_.defaultInitPts,_e=_.duration,Oe=_.initSegmentData;if((ge||pe)&&this.resetInitSegment(Oe,ne,ue,_e),ge&&this.resetInitialTimestamp(Ee),Ce||this.resetContiguity(),this.needsProbing(N,ge,pe)){if(W.dataLength){var Ne=W.flush();N=Object(C.appendUint8Array)(Ne,N)}this.configureTransmuxer(N,_)}var je=this.transmux(N,J,he,ce,v),xe=this.currentTransmuxState;return xe.contiguous=!0,xe.discontinuity=!1,xe.trackSwitch=!1,O.executeEnd=A(),je},f.flush=function(s){var a=this,v=s.transmuxing;v.executeStart=A();var p=this.decrypter,b=this.cache,O=this.currentTransmuxState,N=this.decryptionPromise;if(N)return N.then(function(){return a.flush(s)});var W=[],V=O.timeOffset;if(p){var F=p.flush();F&&W.push(this.push(F,null,s))}var _=b.dataLength;b.reset();var J=this.demuxer,ee=this.remuxer;if(!J||!ee)return _>=o&&this.observer.emit(K.Events.ERROR,K.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),v.executeEnd=A(),[y(s)];var oe=J.flush(V);return m(oe)?oe.then(function(de){return a.flushRemux(W,de,s),W}):(this.flushRemux(W,oe,s),W)},f.flushRemux=function(s,a,v){var p=a.audioTrack,b=a.avcTrack,O=a.id3Track,N=a.textTrack,W=this.currentTransmuxState,V=W.accurateTimeOffset,F=W.timeOffset;S.logger.log("[transmuxer.ts]: Flushed fragment "+v.sn+(v.part>-1?" p: "+v.part:"")+" of level "+v.level);var _=this.remuxer.remux(p,b,O,N,F,V,!0,this.id);s.push({remuxResult:_,chunkMeta:v}),v.transmuxing.executeEnd=A()},f.resetInitialTimestamp=function(s){var a=this.demuxer,v=this.remuxer;if(!a||!v)return;a.resetTimeStamp(s),v.resetTimeStamp(s)},f.resetContiguity=function(){var s=this.demuxer,a=this.remuxer;if(!s||!a)return;s.resetContiguity(),a.resetNextTimestamp()},f.resetInitSegment=function(s,a,v,p){var b=this.demuxer,O=this.remuxer;if(!b||!O)return;b.resetInitSegment(a,v,p),O.resetInitSegment(s,a,v)},f.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},f.transmux=function(s,a,v,p,b){var O;return a&&a.method==="SAMPLE-AES"?O=this.transmuxSampleAes(s,a,v,p,b):O=this.transmuxUnencrypted(s,v,p,b),O},f.transmuxUnencrypted=function(s,a,v,p){var b=this.demuxer.demux(s,a,!1,!this.config.progressive),O=b.audioTrack,N=b.avcTrack,W=b.id3Track,V=b.textTrack,F=this.remuxer.remux(O,N,W,V,a,v,!1,this.id);return{remuxResult:F,chunkMeta:p}},f.transmuxSampleAes=function(s,a,v,p,b){var O=this;return this.demuxer.demuxSampleAes(s,a,v).then(function(N){var W=O.remuxer.remux(N.audioTrack,N.avcTrack,N.id3Track,N.textTrack,v,p,!1,O.id);return{remuxResult:W,chunkMeta:b}})},f.configureTransmuxer=function(s,a){for(var v=this.config,p=this.observer,b=this.typeSupported,O=this.vendor,N=a.audioCodec,W=a.defaultInitPts,V=a.duration,F=a.initSegmentData,_=a.videoCodec,J,ee=0,oe=d.length;ee<oe;ee++)if(d[ee].demux.probe(s)){J=d[ee];break}J||(S.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),J={demux:B.default,remux:T.default});var de=this.demuxer,Ce=this.remuxer,ge=J.remux,pe=J.demux;(!Ce||!(Ce instanceof ge))&&(this.remuxer=new ge(p,v,b,O)),(!de||!(de instanceof pe))&&(this.demuxer=new pe(p,v,b),this.probe=pe.probe),this.resetInitSegment(F,N,_,V),this.resetInitialTimestamp(W)},f.needsProbing=function(s,a,v){return!this.demuxer||!this.remuxer||a||v},f.getDecrypter=function(){var s=this.decrypter;return s||(s=this.decrypter=new M.default(this.observer,this.config)),s},E}();function u(E,f){var c=null;return E.byteLength>0&&f!=null&&f.key!=null&&f.iv!==null&&f.method!=null&&(c=f),c}var y=function(f){return{remuxResult:{},chunkMeta:f}};function m(E){return"then"in E&&E.then instanceof Function}var h=function(f,c,s,a,v){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=f,this.videoCodec=c,this.initSegmentData=s,this.duration=a,this.defaultInitPts=v},w=function(f,c,s,a,v){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=f,this.contiguous=c,this.accurateTimeOffset=s,this.trackSwitch=a,this.timeOffset=v}},"./src/demux/tsdemuxer.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"discardEPB",function(){return y});var K=D("./src/demux/adts.ts"),P=D("./src/demux/mpegaudio.ts"),M=D("./src/demux/exp-golomb.ts"),U=D("./src/demux/id3.ts"),B=D("./src/demux/sample-aes.ts"),I=D("./src/events.ts"),R=D("./src/utils/mp4-tools.ts"),g=D("./src/utils/logger.ts"),T=D("./src/errors.ts"),L={video:1,audio:2,id3:3,text:4},C=function(){function m(w,E,f){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=w,this.config=E,this.typeSupported=f}m.probe=function(E){var f=m.syncOffset(E);return f<0?!1:(f&&g.logger.warn("MPEG2-TS detected but first sync word found @ offset "+f+", junk ahead ?"),!0)},m.syncOffset=function(E){for(var f=Math.min(1e3,E.length-3*188),c=0;c<f;){if(E[c]===71&&E[c+188]===71&&E[c+2*188]===71)return c;c++}return-1},m.createTrack=function(E,f){return{container:E==="video"||E==="audio"?"video/mp2t":void 0,type:E,id:L[E],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:E==="audio"?f:void 0}};var h=m.prototype;return h.resetInitSegment=function(E,f,c){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=m.createTrack("video",c),this._audioTrack=m.createTrack("audio",c),this._id3Track=m.createTrack("id3",c),this._txtTrack=m.createTrack("text",c),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=E,this.videoCodec=f,this._duration=c},h.resetTimeStamp=function(){},h.resetContiguity=function(){var E=this._audioTrack,f=this._avcTrack,c=this._id3Track;E&&(E.pesData=null),f&&(f.pesData=null),c&&(c.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},h.demux=function(E,f,c,s){c===void 0&&(c=!1),s===void 0&&(s=!1),c||(this.sampleAes=null);var a,v=this._avcTrack,p=this._audioTrack,b=this._id3Track,O=v.pid,N=v.pesData,W=p.pid,V=b.pid,F=p.pesData,_=b.pesData,J=!1,ee=this.pmtParsed,oe=this._pmtId,de=E.length;if(this.remainderData&&(E=Object(R.appendUint8Array)(this.remainderData,E),de=E.length,this.remainderData=null),de<188&&!s)return this.remainderData=E,{audioTrack:p,avcTrack:v,id3Track:b,textTrack:this._txtTrack};var Ce=Math.max(0,m.syncOffset(E));de-=(de+Ce)%188,de<E.byteLength&&!s&&(this.remainderData=new Uint8Array(E.buffer,de,E.buffer.byteLength-de));for(var ge=Ce;ge<de;ge+=188)if(E[ge]===71){var pe=!!(E[ge+1]&64),ce=((E[ge+1]&31)<<8)+E[ge+2],he=(E[ge+3]&48)>>4,ne=void 0;if(he>1){if(ne=ge+5+E[ge+4],ne===ge+188)continue}else ne=ge+4;switch(ce){case O:pe&&(N&&(a=o(N))&&this.parseAVCPES(a,!1),N={data:[],size:0}),N&&(N.data.push(E.subarray(ne,ge+188)),N.size+=ge+188-ne);break;case W:pe&&(F&&(a=o(F))&&(p.isAAC?this.parseAACPES(a):this.parseMPEGPES(a)),F={data:[],size:0}),F&&(F.data.push(E.subarray(ne,ge+188)),F.size+=ge+188-ne);break;case V:pe&&(_&&(a=o(_))&&this.parseID3PES(a),_={data:[],size:0}),_&&(_.data.push(E.subarray(ne,ge+188)),_.size+=ge+188-ne);break;case 0:pe&&(ne+=E[ne]+1),oe=this._pmtId=A(E,ne);break;case oe:{pe&&(ne+=E[ne]+1);var ue=d(E,ne,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,c);O=ue.avc,O>0&&(v.pid=O),W=ue.audio,W>0&&(p.pid=W,p.isAAC=ue.isAAC),V=ue.id3,V>0&&(b.pid=V),J&&!ee&&(g.logger.log("reparse from beginning"),J=!1,ge=Ce-188),ee=this.pmtParsed=!0;break}case 17:case 8191:break;default:J=!0;break}}else this.observer.emit(I.Events.ERROR,I.Events.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});v.pesData=N,p.pesData=F,b.pesData=_;var Ee={audioTrack:p,avcTrack:v,id3Track:b,textTrack:this._txtTrack};return s&&this.extractRemainingSamples(Ee),Ee},h.flush=function(){var E=this.remainderData;this.remainderData=null;var f;return E?f=this.demux(E,-1,!1,!0):f={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(f),this.sampleAes?this.decrypt(f,this.sampleAes):f},h.extractRemainingSamples=function(E){var f=E.audioTrack,c=E.avcTrack,s=E.id3Track,a=c.pesData,v=f.pesData,p=s.pesData,b;a&&(b=o(a))?(this.parseAVCPES(b,!0),c.pesData=null):c.pesData=a,v&&(b=o(v))?(f.isAAC?this.parseAACPES(b):this.parseMPEGPES(b),f.pesData=null):(v!=null&&v.size&&g.logger.log("last AAC PES packet truncated,might overlap between fragments"),f.pesData=v),p&&(b=o(p))?(this.parseID3PES(b),s.pesData=null):s.pesData=p},h.demuxSampleAes=function(E,f,c){var s=this.demux(E,c,!0,!this.config.progressive),a=this.sampleAes=new B.default(this.observer,this.config,f);return this.decrypt(s,a)},h.decrypt=function(E,f){return new Promise(function(c){var s=E.audioTrack,a=E.avcTrack;s.samples&&s.isAAC?f.decryptAacSamples(s.samples,0,function(){a.samples?f.decryptAvcSamples(a.samples,0,0,function(){c(E)}):c(E)}):a.samples&&f.decryptAvcSamples(a.samples,0,0,function(){c(E)})})},h.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},h.parseAVCPES=function(E,f){var c=this,s=this._avcTrack,a=this.parseAVCNALu(E.data),v=!1,p=this.avcSample,b,O=!1;E.data=null,p&&a.length&&!s.audFound&&(l(p,s),p=this.avcSample=S(!1,E.pts,E.dts,"")),a.forEach(function(N){switch(N.type){case 1:{b=!0,p||(p=c.avcSample=S(!0,E.pts,E.dts,"")),v&&(p.debug+="NDR "),p.frame=!0;var W=N.data;if(O&&W.length>4){var V=new M.default(W).readSliceType();(V===2||V===4||V===7||V===9)&&(p.key=!0)}break}case 5:b=!0,p||(p=c.avcSample=S(!0,E.pts,E.dts,"")),v&&(p.debug+="IDR "),p.key=!0,p.frame=!0;break;case 6:{b=!0,v&&p&&(p.debug+="SEI ");var F=new M.default(y(N.data));F.readUByte();for(var _=0,J=0,ee=!1,oe=0;!ee&&F.bytesAvailable>1;){_=0;do oe=F.readUByte(),_+=oe;while(oe===255);J=0;do oe=F.readUByte(),J+=oe;while(oe===255);if(_===4&&F.bytesAvailable!==0){ee=!0;var de=F.readUByte();if(de===181){var Ce=F.readUShort();if(Ce===49){var ge=F.readUInt();if(ge===1195456820){var pe=F.readUByte();if(pe===3){for(var ce=F.readUByte(),he=F.readUByte(),ne=31&ce,ue=[ce,he],Ee=0;Ee<ne;Ee++)ue.push(F.readUByte()),ue.push(F.readUByte()),ue.push(F.readUByte());u(c._txtTrack.samples,{type:3,pts:E.pts,bytes:ue})}}}}}else if(_===5&&F.bytesAvailable!==0){if(ee=!0,J>16){for(var _e=[],Oe=0;Oe<16;Oe++)_e.push(F.readUByte().toString(16)),(Oe===3||Oe===5||Oe===7||Oe===9)&&_e.push("-");for(var Ne=J-16,je=new Uint8Array(Ne),xe=0;xe<Ne;xe++)je[xe]=F.readUByte();u(c._txtTrack.samples,{pts:E.pts,payloadType:_,uuid:_e.join(""),userData:Object(U.utf8ArrayToStr)(je),userDataBytes:je})}}else if(J<F.bytesAvailable)for(var Se=0;Se<J;Se++)F.readUByte()}break}case 7:if(b=!0,O=!0,v&&p&&(p.debug+="SPS "),!s.sps){var Ie=new M.default(N.data),Fe=Ie.readSPS();s.width=Fe.width,s.height=Fe.height,s.pixelRatio=Fe.pixelRatio,s.sps=[N.data],s.duration=c._duration;for(var He=N.data.subarray(1,4),Me="avc1.",Le=0;Le<3;Le++){var qe=He[Le].toString(16);qe.length<2&&(qe="0"+qe),Me+=qe}s.codec=Me}break;case 8:b=!0,v&&p&&(p.debug+="PPS "),s.pps||(s.pps=[N.data]);break;case 9:b=!1,s.audFound=!0,p&&l(p,s),p=c.avcSample=S(!1,E.pts,E.dts,v?"AUD ":"");break;case 12:b=!1;break;default:b=!1,p&&(p.debug+="unknown NAL "+N.type+" ");break}if(p&&b){var Ze=p.units;Ze.push(N)}}),f&&p&&(l(p,s),this.avcSample=null)},h.getLastNalUnit=function(){var E,f=this.avcSample,c;if(!f||f.units.length===0){var s=this._avcTrack.samples;f=s[s.length-1]}if((E=f)!==null&&E!==void 0&&E.units){var a=f.units;c=a[a.length-1]}return c},h.parseAVCNALu=function(E){var f=E.byteLength,c=this._avcTrack,s=c.naluState||0,a=s,v=[],p=0,b,O,N,W=-1,V=0;for(s===-1&&(W=0,V=E[0]&31,s=0,p=1);p<f;){if(b=E[p++],!s){s=b?0:1;continue}if(s===1){s=b?0:2;continue}if(!b)s=3;else if(b===1){if(W>=0){var F={data:E.subarray(W,p-s-1),type:V};v.push(F)}else{var _=this.getLastNalUnit();if(_&&(a&&p<=4-a&&(_.state&&(_.data=_.data.subarray(0,_.data.byteLength-a))),O=p-s-1,O>0)){var J=new Uint8Array(_.data.byteLength+O);J.set(_.data,0),J.set(E.subarray(0,O),_.data.byteLength),_.data=J,_.state=0}}p<f?(N=E[p]&31,W=p,V=N,s=0):s=-1}else s=0}if(W>=0&&s>=0){var ee={data:E.subarray(W,f),type:V,state:s};v.push(ee)}if(v.length===0){var oe=this.getLastNalUnit();if(oe){var de=new Uint8Array(oe.data.byteLength+E.byteLength);de.set(oe.data,0),de.set(E,oe.data.byteLength),oe.data=de}}return c.naluState=s,v},h.parseAACPES=function(E){var f=0,c=this._audioTrack,s=this.aacOverFlow,a=E.data;if(s){this.aacOverFlow=null;var v=s.sample.unit.byteLength,p=Math.min(s.missing,v),b=v-p;s.sample.unit.set(a.subarray(0,p),b),c.samples.push(s.sample),f=s.missing}var O,N;for(O=f,N=a.length;O<N-1&&!K.isHeader(a,O);O++);if(O!==f){var W,V;if(O<N-1?(W="AAC PES did not start with ADTS header,offset:"+O,V=!1):(W="no ADTS header found in AAC PES",V=!0),g.logger.warn("parsing error:"+W),this.observer.emit(I.Events.ERROR,I.Events.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.FRAG_PARSING_ERROR,fatal:V,reason:W}),V)return}K.initTrackConfig(c,this.observer,a,O,this.audioCodec);var F;if(E.pts!==void 0)F=E.pts;else if(s){var _=K.getFrameDuration(c.samplerate);F=s.sample.pts+_}else{g.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var J=0;O<N;)if(K.isHeader(a,O)){if(O+5<N){var ee=K.appendFrame(c,a,O,F,J);if(ee)if(ee.missing)this.aacOverFlow=ee;else{O+=ee.length,J++;continue}}break}else O++},h.parseMPEGPES=function(E){var f=E.data,c=f.length,s=0,a=0,v=E.pts;if(v===void 0){g.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;a<c;)if(P.isHeader(f,a)){var p=P.appendFrame(this._audioTrack,f,a,v,s);if(p)a+=p.length,s++;else break}else a++},h.parseID3PES=function(E){if(E.pts===void 0){g.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(E)},m}();C.minProbeByteLength=188;function S(m,h,w,E){return{key:m,frame:!1,pts:h,dts:w,units:[],debug:E,length:0}}function A(m,h){return(m[h+10]&31)<<8|m[h+11]}function d(m,h,w,E){var f={audio:-1,avc:-1,id3:-1,isAAC:!0},c=(m[h+1]&15)<<8|m[h+2],s=h+3+c-4,a=(m[h+10]&15)<<8|m[h+11];for(h+=12+a;h<s;){var v=(m[h+1]&31)<<8|m[h+2];switch(m[h]){case 207:if(!E){g.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:f.audio===-1&&(f.audio=v);break;case 21:f.id3===-1&&(f.id3=v);break;case 219:if(!E){g.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:f.avc===-1&&(f.avc=v);break;case 3:case 4:w?f.audio===-1&&(f.audio=v,f.isAAC=!1):g.logger.log("MPEG audio found, not supported in this browser");break;case 36:g.logger.warn("Unsupported HEVC stream type found");break;default:break}h+=((m[h+3]&15)<<8|m[h+4])+5}return f}function o(m){var h=0,w,E,f,c,s,a=m.data;if(!m||m.size===0)return null;for(;a[0].length<19&&a.length>1;){var v=new Uint8Array(a[0].length+a[1].length);v.set(a[0]),v.set(a[1],a[0].length),a[0]=v,a.splice(1,1)}w=a[0];var p=(w[0]<<16)+(w[1]<<8)+w[2];if(p===1){if(E=(w[4]<<8)+w[5],E&&E>m.size-6)return null;var b=w[7];b&192&&(c=(w[9]&14)*536870912+(w[10]&255)*4194304+(w[11]&254)*16384+(w[12]&255)*128+(w[13]&254)/2,b&64?(s=(w[14]&14)*536870912+(w[15]&255)*4194304+(w[16]&254)*16384+(w[17]&255)*128+(w[18]&254)/2,c-s>60*9e4&&(g.logger.warn(Math.round((c-s)/9e4)+"s delta between PTS and DTS, align them"),c=s)):s=c),f=w[8];var O=f+9;if(m.size<=O)return null;m.size-=O;for(var N=new Uint8Array(m.size),W=0,V=a.length;W<V;W++){w=a[W];var F=w.byteLength;if(O)if(O>F){O-=F;continue}else w=w.subarray(O),F-=O,O=0;N.set(w,h),h+=F}return E&&(E-=f+3),{data:N,pts:c,dts:s,len:E}}return null}function l(m,h){if(m.units.length&&m.frame){if(m.pts===void 0){var w=h.samples,E=w.length;if(E){var f=w[E-1];m.pts=f.pts,m.dts=f.dts}else{h.dropped++;return}}h.samples.push(m)}m.debug.length&&g.logger.log(m.pts+"/"+m.dts+":"+m.debug)}function u(m,h){var w=m.length;if(w>0){if(h.pts>=m[w-1].pts)m.push(h);else for(var E=w-1;E>=0;E--)if(h.pts<m[E].pts){m.splice(E,0,h);break}}else m.push(h)}function y(m){for(var h=m.byteLength,w=[],E=1;E<h-2;)m[E]===0&&m[E+1]===0&&m[E+2]===3?(w.push(E+2),E+=2):E++;if(w.length===0)return m;var f=h-w.length,c=new Uint8Array(f),s=0;for(E=0;E<f;s++,E++)s===w[0]&&(s++,w.shift()),c[E]=m[s];return c}G.default=C},"./src/errors.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"ErrorTypes",function(){return K}),D.d(G,"ErrorDetails",function(){return P});var K;(function(M){M.NETWORK_ERROR="networkError",M.MEDIA_ERROR="mediaError",M.KEY_SYSTEM_ERROR="keySystemError",M.MUX_ERROR="muxError",M.OTHER_ERROR="otherError"})(K||(K={}));var P;(function(M){M.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",M.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",M.KEY_SYSTEM_NO_SESSION="keySystemNoSession",M.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",M.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",M.MANIFEST_LOAD_ERROR="manifestLoadError",M.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",M.MANIFEST_PARSING_ERROR="manifestParsingError",M.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",M.LEVEL_EMPTY_ERROR="levelEmptyError",M.LEVEL_LOAD_ERROR="levelLoadError",M.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",M.LEVEL_SWITCH_ERROR="levelSwitchError",M.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",M.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",M.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",M.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",M.FRAG_LOAD_ERROR="fragLoadError",M.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",M.FRAG_DECRYPT_ERROR="fragDecryptError",M.FRAG_PARSING_ERROR="fragParsingError",M.REMUX_ALLOC_ERROR="remuxAllocError",M.KEY_LOAD_ERROR="keyLoadError",M.KEY_LOAD_TIMEOUT="keyLoadTimeOut",M.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",M.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",M.BUFFER_APPEND_ERROR="bufferAppendError",M.BUFFER_APPENDING_ERROR="bufferAppendingError",M.BUFFER_STALLED_ERROR="bufferStalledError",M.BUFFER_FULL_ERROR="bufferFullError",M.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",M.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",M.INTERNAL_EXCEPTION="internalException",M.INTERNAL_ABORTED="aborted",M.UNKNOWN="unknown"})(P||(P={}))},"./src/events.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"Events",function(){return K});var K;(function(P){P.MEDIA_ATTACHING="hlsMediaAttaching",P.MEDIA_ATTACHED="hlsMediaAttached",P.MEDIA_DETACHING="hlsMediaDetaching",P.MEDIA_DETACHED="hlsMediaDetached",P.BUFFER_RESET="hlsBufferReset",P.BUFFER_CODECS="hlsBufferCodecs",P.BUFFER_CREATED="hlsBufferCreated",P.BUFFER_APPENDING="hlsBufferAppending",P.BUFFER_APPENDED="hlsBufferAppended",P.BUFFER_EOS="hlsBufferEos",P.BUFFER_FLUSHING="hlsBufferFlushing",P.BUFFER_FLUSHED="hlsBufferFlushed",P.MANIFEST_LOADING="hlsManifestLoading",P.MANIFEST_LOADED="hlsManifestLoaded",P.MANIFEST_PARSED="hlsManifestParsed",P.LEVEL_SWITCHING="hlsLevelSwitching",P.LEVEL_SWITCHED="hlsLevelSwitched",P.LEVEL_LOADING="hlsLevelLoading",P.LEVEL_LOADED="hlsLevelLoaded",P.LEVEL_UPDATED="hlsLevelUpdated",P.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",P.LEVELS_UPDATED="hlsLevelsUpdated",P.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",P.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",P.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",P.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",P.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",P.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",P.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",P.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",P.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",P.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",P.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",P.CUES_PARSED="hlsCuesParsed",P.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",P.INIT_PTS_FOUND="hlsInitPtsFound",P.FRAG_LOADING="hlsFragLoading",P.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",P.FRAG_LOADED="hlsFragLoaded",P.FRAG_DECRYPTED="hlsFragDecrypted",P.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",P.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",P.FRAG_PARSING_METADATA="hlsFragParsingMetadata",P.FRAG_PARSED="hlsFragParsed",P.FRAG_BUFFERED="hlsFragBuffered",P.FRAG_CHANGED="hlsFragChanged",P.FPS_DROP="hlsFpsDrop",P.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",P.ERROR="hlsError",P.DESTROYING="hlsDestroying",P.KEY_LOADING="hlsKeyLoading",P.KEY_LOADED="hlsKeyLoaded",P.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",P.BACK_BUFFER_REACHED="hlsBackBufferReached"})(K||(K={}))},"./src/hls.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"default",function(){return m});var K=D("./node_modules/url-toolkit/src/url-toolkit.js"),P=D.n(K),M=D("./src/loader/playlist-loader.ts"),U=D("./src/loader/key-loader.ts"),B=D("./src/controller/id3-track-controller.ts"),I=D("./src/controller/latency-controller.ts"),R=D("./src/controller/level-controller.ts"),g=D("./src/controller/fragment-tracker.ts"),T=D("./src/controller/stream-controller.ts"),L=D("./src/is-supported.ts"),C=D("./src/utils/logger.ts"),S=D("./src/config.ts"),A=D("./node_modules/eventemitter3/index.js"),d=D.n(A),o=D("./src/events.ts"),l=D("./src/errors.ts");function u(h,w){for(var E=0;E<w.length;E++){var f=w[E];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(h,f.key,f)}}function y(h,w,E){return w&&u(h.prototype,w),E&&u(h,E),h}var m=function(){h.isSupported=function(){return Object(L.isSupported)()};function h(E){E===void 0&&(E={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new A.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 f=this.config=Object(S.mergeConfig)(h.DefaultConfig,E);this.userConfig=E,Object(C.enableLogs)(f.debug),this._autoLevelCapping=-1,f.progressive&&Object(S.enableStreamingMode)(f);var c=f.abrController,s=f.bufferController,a=f.capLevelController,v=f.fpsController,p=this.abrController=new c(this),b=this.bufferController=new s(this),O=this.capLevelController=new a(this),N=new v(this),W=new M.default(this),V=new U.default(this),F=new B.default(this),_=this.levelController=new R.default(this),J=new g.FragmentTracker(this),ee=this.streamController=new T.default(this,J);O.setStreamController(ee),N.setStreamController(ee);var oe=[_,ee];this.networkControllers=oe;var de=[W,V,p,b,O,N,F,J];this.audioTrackController=this.createController(f.audioTrackController,null,oe),this.createController(f.audioStreamController,J,oe),this.subtitleTrackController=this.createController(f.subtitleTrackController,null,oe),this.createController(f.subtitleStreamController,J,oe),this.createController(f.timelineController,null,de),this.emeController=this.createController(f.emeController,null,de),this.cmcdController=this.createController(f.cmcdController,null,de),this.latencyController=this.createController(I.default,null,de),this.coreComponents=de}var w=h.prototype;return w.createController=function(f,c,s){if(f){var a=c?new f(this,c):new f(this);return s&&s.push(a),a}return null},w.on=function(f,c,s){s===void 0&&(s=this),this._emitter.on(f,c,s)},w.once=function(f,c,s){s===void 0&&(s=this),this._emitter.once(f,c,s)},w.removeAllListeners=function(f){this._emitter.removeAllListeners(f)},w.off=function(f,c,s,a){s===void 0&&(s=this),this._emitter.off(f,c,s,a)},w.listeners=function(f){return this._emitter.listeners(f)},w.emit=function(f,c,s){return this._emitter.emit(f,c,s)},w.trigger=function(f,c){if(this.config.debug)return this.emit(f,f,c);try{return this.emit(f,f,c)}catch(s){C.logger.error("An internal error happened while handling event "+f+'. Error message: "'+s.message+'". Here is a stacktrace:',s),this.trigger(o.Events.ERROR,{type:l.ErrorTypes.OTHER_ERROR,details:l.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:f,error:s})}return!1},w.listenerCount=function(f){return this._emitter.listenerCount(f)},w.destroy=function(){C.logger.log("destroy"),this.trigger(o.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(f){return f.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(f){return f.destroy()}),this.coreComponents.length=0},w.attachMedia=function(f){C.logger.log("attachMedia"),this._media=f,this.trigger(o.Events.MEDIA_ATTACHING,{media:f})},w.detachMedia=function(){C.logger.log("detachMedia"),this.trigger(o.Events.MEDIA_DETACHING,void 0),this._media=null},w.loadSource=function(f){this.stopLoad();var c=this.media,s=this.url,a=this.url=K.buildAbsoluteURL(self.location.href,f,{alwaysNormalize:!0});C.logger.log("loadSource:"+a),c&&s&&s!==a&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(c)),this.trigger(o.Events.MANIFEST_LOADING,{url:f})},w.startLoad=function(f){f===void 0&&(f=-1),C.logger.log("startLoad("+f+")"),this.networkControllers.forEach(function(c){c.startLoad(f)})},w.stopLoad=function(){C.logger.log("stopLoad"),this.networkControllers.forEach(function(f){f.stopLoad()})},w.swapAudioCodec=function(){C.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},w.recoverMediaError=function(){C.logger.log("recoverMediaError");var f=this._media;this.detachMedia(),f&&this.attachMedia(f)},w.removeLevel=function(f,c){c===void 0&&(c=0),this.levelController.removeLevel(f,c)},y(h,[{key:"levels",get:function(){var f=this.levelController.levels;return f||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(f){C.logger.log("set currentLevel:"+f),this.loadLevel=f,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(f){C.logger.log("set nextLevel:"+f),this.levelController.manualLevel=f,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(f){C.logger.log("set loadLevel:"+f),this.levelController.manualLevel=f}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(f){this.levelController.nextLoadLevel=f}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(f){C.logger.log("set firstLevel:"+f),this.levelController.firstLevel=f}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(f){C.logger.log("set startLevel:"+f),f!==-1&&(f=Math.max(f,this.minAutoLevel)),this.levelController.startLevel=f}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(f){var c=!!f;c!==this.config.capLevelToPlayerSize&&(c?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=c)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(f){this._autoLevelCapping!==f&&(C.logger.log("set autoLevelCapping:"+f),this._autoLevelCapping=f)}},{key:"bandwidthEstimate",get:function(){var f=this.abrController.bwEstimator;return f?f.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var f=this.levels,c=this.config.minAutoBitrate;if(!f)return 0;for(var s=f.length,a=0;a<s;a++)if(f[a].maxBitrate>c)return a;return 0}},{key:"maxAutoLevel",get:function(){var f=this.levels,c=this.autoLevelCapping,s;return c===-1&&f&&f.length?s=f.length-1:s=c,s}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(f){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,f)}},{key:"audioTracks",get:function(){var f=this.audioTrackController;return f?f.audioTracks:[]}},{key:"audioTrack",get:function(){var f=this.audioTrackController;return f?f.audioTrack:-1},set:function(f){var c=this.audioTrackController;c&&(c.audioTrack=f)}},{key:"subtitleTracks",get:function(){var f=this.subtitleTrackController;return f?f.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var f=this.subtitleTrackController;return f?f.subtitleTrack:-1},set:function(f){var c=this.subtitleTrackController;c&&(c.subtitleTrack=f)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var f=this.subtitleTrackController;return f?f.subtitleDisplay:!1},set:function(f){var c=this.subtitleTrackController;c&&(c.subtitleDisplay=f)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(f){this.config.lowLatencyMode=f}},{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 o.Events}},{key:"ErrorTypes",get:function(){return l.ErrorTypes}},{key:"ErrorDetails",get:function(){return l.ErrorDetails}},{key:"DefaultConfig",get:function(){return h.defaultConfig?h.defaultConfig:S.hlsDefaultConfig},set:function(f){h.defaultConfig=f}}]),h}();m.defaultConfig=void 0},"./src/is-supported.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"isSupported",function(){return M}),D.d(G,"changeTypeSupported",function(){return U});var K=D("./src/utils/mediasource-helper.ts");function P(){return self.SourceBuffer||self.WebKitSourceBuffer}function M(){var B=Object(K.getMediaSource)();if(!B)return!1;var I=P(),R=B&&typeof B.isTypeSupported=="function"&&B.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),g=!I||I.prototype&&typeof I.prototype.appendBuffer=="function"&&typeof I.prototype.remove=="function";return!!R&&!!g}function U(){var B,I=P();return typeof(I==null||((B=I.prototype)===null||B===void 0)?void 0:B.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"default",function(){return C}),D.d(G,"LoadError",function(){return A});var K=D("./src/polyfills/number.ts"),P=D("./src/errors.ts");function M(d,o){d.prototype=Object.create(o.prototype),d.prototype.constructor=d,g(d,o)}function U(d){var o=typeof Map=="function"?new Map:void 0;return U=function(u){if(u===null||!R(u))return u;if(typeof u!="function")throw new TypeError("Super expression must either be null or a function");if(typeof o!="undefined"){if(o.has(u))return o.get(u);o.set(u,y)}function y(){return B(u,arguments,T(this).constructor)}return y.prototype=Object.create(u.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),g(y,u)},U(d)}function B(d,o,l){return I()?B=Reflect.construct:B=function(y,m,h){var w=[null];w.push.apply(w,m);var E=Function.bind.apply(y,w),f=new E;return h&&g(f,h.prototype),f},B.apply(null,arguments)}function I(){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 R(d){return Function.toString.call(d).indexOf("[native code]")!==-1}function g(d,o){return g=Object.setPrototypeOf||function(u,y){return u.__proto__=y,u},g(d,o)}function T(d){return T=Object.setPrototypeOf?Object.getPrototypeOf:function(l){return l.__proto__||Object.getPrototypeOf(l)},T(d)}var L=Math.pow(2,17),C=function(){function d(l){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=l}var o=d.prototype;return o.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},o.abort=function(){this.loader&&this.loader.abort()},o.load=function(u,y){var m=this,h=u.url;if(!h)return Promise.reject(new A({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:u,networkDetails:null},"Fragment does not have a "+(h?"part list":"url")));this.abort();var w=this.config,E=w.fLoader,f=w.loader;return new Promise(function(c,s){m.loader&&m.loader.destroy();var a=m.loader=u.loader=E?new E(w):new f(w),v=S(u),p={timeout:w.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:w.fragLoadingMaxRetryTimeout,highWaterMark:L};u.stats=a.stats,a.load(v,p,{onSuccess:function(O,N,W,V){m.resetLoader(u,a),c({frag:u,part:null,payload:O.data,networkDetails:V})},onError:function(O,N,W){m.resetLoader(u,a),s(new A({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:u,response:O,networkDetails:W}))},onAbort:function(O,N,W){m.resetLoader(u,a),s(new A({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:u,networkDetails:W}))},onTimeout:function(O,N,W){m.resetLoader(u,a),s(new A({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:u,networkDetails:W}))},onProgress:function(O,N,W,V){y&&y({frag:u,part:null,payload:W,networkDetails:V})}})})},o.loadPart=function(u,y,m){var h=this;this.abort();var w=this.config,E=w.fLoader,f=w.loader;return new Promise(function(c,s){h.loader&&h.loader.destroy();var a=h.loader=u.loader=E?new E(w):new f(w),v=S(u,y),p={timeout:w.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:w.fragLoadingMaxRetryTimeout,highWaterMark:L};y.stats=a.stats,a.load(v,p,{onSuccess:function(O,N,W,V){h.resetLoader(u,a),h.updateStatsFromPart(u,y);var F={frag:u,part:y,payload:O.data,networkDetails:V};m(F),c(F)},onError:function(O,N,W){h.resetLoader(u,a),s(new A({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:u,part:y,response:O,networkDetails:W}))},onAbort:function(O,N,W){u.stats.aborted=y.stats.aborted,h.resetLoader(u,a),s(new A({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:u,part:y,networkDetails:W}))},onTimeout:function(O,N,W){h.resetLoader(u,a),s(new A({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:u,part:y,networkDetails:W}))}})})},o.updateStatsFromPart=function(u,y){var m=u.stats,h=y.stats,w=h.total;if(m.loaded+=h.loaded,w){var E=Math.round(u.duration/y.duration),f=Math.min(Math.round(m.loaded/w),E),c=E-f,s=c*Math.round(m.loaded/f);m.total=m.loaded+s}else m.total=Math.max(m.loaded,m.total);var a=m.loading,v=h.loading;a.start?a.first+=v.first-v.start:(a.start=v.start,a.first=v.first),a.end=v.end},o.resetLoader=function(u,y){u.loader=null,this.loader===y&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),y.destroy()},d}();function S(d,o){o===void 0&&(o=null);var l=o||d,u={frag:d,part:o,responseType:"arraybuffer",url:l.url,headers:{},rangeStart:0,rangeEnd:0},y=l.byteRangeStartOffset,m=l.byteRangeEndOffset;return Object(K.isFiniteNumber)(y)&&Object(K.isFiniteNumber)(m)&&(u.rangeStart=y,u.rangeEnd=m),u}var A=function(d){M(o,d);function o(l){for(var u,y=arguments.length,m=new Array(y>1?y-1:0),h=1;h<y;h++)m[h-1]=arguments[h];return u=d.call.apply(d,[this].concat(m))||this,u.data=void 0,u.data=l,u}return o}(U(Error))},"./src/loader/fragment.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"ElementaryStreamTypes",function(){return C}),D.d(G,"BaseSegment",function(){return S}),D.d(G,"Fragment",function(){return A}),D.d(G,"Part",function(){return d});var K=D("./src/polyfills/number.ts"),P=D("./node_modules/url-toolkit/src/url-toolkit.js"),M=D.n(P),U=D("./src/utils/logger.ts"),B=D("./src/loader/level-key.ts"),I=D("./src/loader/load-stats.ts");function R(o,l){o.prototype=Object.create(l.prototype),o.prototype.constructor=o,g(o,l)}function g(o,l){return g=Object.setPrototypeOf||function(y,m){return y.__proto__=m,y},g(o,l)}function T(o,l){for(var u=0;u<l.length;u++){var y=l[u];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(o,y.key,y)}}function L(o,l,u){return l&&T(o.prototype,l),u&&T(o,u),o}var C;(function(o){o.AUDIO="audio",o.VIDEO="video",o.AUDIOVIDEO="audiovideo"})(C||(C={}));var S=function(){function o(u){var y;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(y={},y[C.AUDIO]=null,y[C.VIDEO]=null,y[C.AUDIOVIDEO]=null,y),this.baseurl=u}var l=o.prototype;return l.setByteRange=function(y,m){var h=y.split("@",2),w=[];h.length===1?w[0]=m?m.byteRangeEndOffset:0:w[0]=parseInt(h[1]),w[1]=parseInt(h[0])+w[0],this._byteRange=w},L(o,[{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(P.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(y){this._url=y}}]),o}(),A=function(o){R(l,o);function l(y,m){var h;return h=o.call(this,m)||this,h._decryptdata=null,h.rawProgramDateTime=null,h.programDateTime=null,h.tagList=[],h.duration=0,h.sn=0,h.levelkey=void 0,h.type=void 0,h.loader=null,h.level=-1,h.cc=0,h.startPTS=void 0,h.endPTS=void 0,h.appendedPTS=void 0,h.startDTS=void 0,h.endDTS=void 0,h.start=0,h.deltaPTS=void 0,h.maxStartPTS=void 0,h.minEndPTS=void 0,h.stats=new I.LoadStats,h.urlId=0,h.data=void 0,h.bitrateTest=!1,h.title=null,h.initSegment=null,h.type=y,h}var u=l.prototype;return u.createInitializationVector=function(m){for(var h=new Uint8Array(16),w=12;w<16;w++)h[w]=m>>8*(15-w)&255;return h},u.setDecryptDataFromLevelKey=function(m,h){var w=m;return(m==null?void 0:m.method)==="AES-128"&&m.uri&&!m.iv&&(w=B.LevelKey.fromURI(m.uri),w.method=m.method,w.iv=this.createInitializationVector(h),w.keyFormat="identity"),w},u.setElementaryStreamInfo=function(m,h,w,E,f,c){c===void 0&&(c=!1);var s=this.elementaryStreams,a=s[m];if(!a){s[m]={startPTS:h,endPTS:w,startDTS:E,endDTS:f,partial:c};return}a.startPTS=Math.min(a.startPTS,h),a.endPTS=Math.max(a.endPTS,w),a.startDTS=Math.min(a.startDTS,E),a.endDTS=Math.max(a.endDTS,f)},u.clearElementaryStreamInfo=function(){var m=this.elementaryStreams;m[C.AUDIO]=null,m[C.VIDEO]=null,m[C.AUDIOVIDEO]=null},L(l,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var m=this.sn;typeof m!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&U.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),m=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,m)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(K.isFiniteNumber)(this.programDateTime))return null;var m=Object(K.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+m*1e3}},{key:"encrypted",get:function(){var m;return!!((m=this.decryptdata)!==null&&m!==void 0&&m.keyFormat&&this.decryptdata.uri)}}]),l}(S),d=function(o){R(l,o);function l(u,y,m,h,w){var E;E=o.call(this,m)||this,E.fragOffset=0,E.duration=0,E.gap=!1,E.independent=!1,E.relurl=void 0,E.fragment=void 0,E.index=void 0,E.stats=new I.LoadStats,E.duration=u.decimalFloatingPoint("DURATION"),E.gap=u.bool("GAP"),E.independent=u.bool("INDEPENDENT"),E.relurl=u.enumeratedString("URI"),E.fragment=y,E.index=h;var f=u.enumeratedString("BYTERANGE");return f&&E.setByteRange(f,w),w&&(E.fragOffset=w.fragOffset+w.duration),E}return L(l,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var y=this.elementaryStreams;return!!(y.audio||y.video||y.audiovideo)}}]),l}(S)},"./src/loader/key-loader.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"default",function(){return U});var K=D("./src/events.ts"),P=D("./src/errors.ts"),M=D("./src/utils/logger.ts"),U=function(){function B(R){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=R,this._registerListeners()}var I=B.prototype;return I._registerListeners=function(){this.hls.on(K.Events.KEY_LOADING,this.onKeyLoading,this)},I._unregisterListeners=function(){this.hls.off(K.Events.KEY_LOADING,this.onKeyLoading)},I.destroy=function(){this._unregisterListeners();for(var g in this.loaders){var T=this.loaders[g];T&&T.destroy()}this.loaders={}},I.onKeyLoading=function(g,T){var L=T.frag,C=L.type,S=this.loaders[C];if(!L.decryptdata){M.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var A=L.decryptdata.uri;if(A!==this.decrypturl||this.decryptkey===null){var d=this.hls.config;if(S&&(M.logger.warn("abort previous key loader for type:"+C),S.abort()),!A){M.logger.warn("key uri is falsy");return}var o=d.loader,l=L.loader=this.loaders[C]=new o(d);this.decrypturl=A,this.decryptkey=null;var u={url:A,frag:L,responseType:"arraybuffer"},y={timeout:d.fragLoadingTimeOut,maxRetry:0,retryDelay:d.fragLoadingRetryDelay,maxRetryDelay:d.fragLoadingMaxRetryTimeout,highWaterMark:0},m={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};l.load(u,y,m)}else this.decryptkey&&(L.decryptdata.key=this.decryptkey,this.hls.trigger(K.Events.KEY_LOADED,{frag:L}))},I.loadsuccess=function(g,T,L){var C=L.frag;if(!C.decryptdata){M.logger.error("after key load, decryptdata unset");return}this.decryptkey=C.decryptdata.key=new Uint8Array(g.data),C.loader=null,delete this.loaders[C.type],this.hls.trigger(K.Events.KEY_LOADED,{frag:C})},I.loaderror=function(g,T){var L=T.frag,C=L.loader;C&&C.abort(),delete this.loaders[L.type],this.hls.trigger(K.Events.ERROR,{type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:L,response:g})},I.loadtimeout=function(g,T){var L=T.frag,C=L.loader;C&&C.abort(),delete this.loaders[L.type],this.hls.trigger(K.Events.ERROR,{type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:L})},B}()},"./src/loader/level-details.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"LevelDetails",function(){return B});var K=D("./src/polyfills/number.ts");function P(I,R){for(var g=0;g<R.length;g++){var T=R[g];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(I,T.key,T)}}function M(I,R,g){return R&&P(I.prototype,R),g&&P(I,g),I}var U=10,B=function(){function I(g){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.needSidxRanges=!1,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.fragments=[],this.url=g}var R=I.prototype;return R.reloaded=function(T){if(!T){this.advanced=!0,this.updated=!0;return}var L=this.lastPartSn-T.lastPartSn,C=this.lastPartIndex-T.lastPartIndex;this.updated=this.endSN!==T.endSN||!!C||!!L,this.advanced=this.endSN>T.endSN||L>0||L===0&&C>0,this.updated||this.advanced?this.misses=Math.floor(T.misses*.6):this.misses=T.misses+1,this.availabilityDelay=T.availabilityDelay},M(I,[{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 T=this.driftEndTime-this.driftStartTime;if(T>0){var L=this.driftEnd-this.driftStart;return L*1e3/T}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var T;return(T=this.partList)!==null&&T!==void 0&&T.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var T;return(T=this.fragments)!==null&&T!==void 0&&T.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 T;return(T=this.partList)!==null&&T!==void 0&&T.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var T;return(T=this.partList)!==null&&T!==void 0&&T.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),I}()},"./src/loader/level-key.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"LevelKey",function(){return B});var K=D("./node_modules/url-toolkit/src/url-toolkit.js"),P=D.n(K);function M(I,R){for(var g=0;g<R.length;g++){var T=R[g];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(I,T.key,T)}}function U(I,R,g){return R&&M(I.prototype,R),g&&M(I,g),I}var B=function(){I.fromURL=function(g,T){return new I(g,T)},I.fromURI=function(g){return new I(g)};function I(R,g){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,g?this._uri=Object(K.buildAbsoluteURL)(R,g,{alwaysNormalize:!0}):this._uri=R}return U(I,[{key:"uri",get:function(){return this._uri}}]),I}()},"./src/loader/load-stats.ts":function(q,G,D){"use strict";D.r(G),D.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,D){"use strict";D.r(G),D.d(G,"default",function(){return l});var K=D("./src/polyfills/number.ts"),P=D("./node_modules/url-toolkit/src/url-toolkit.js"),M=D.n(P),U=D("./src/loader/fragment.ts"),B=D("./src/loader/level-details.ts"),I=D("./src/loader/level-key.ts"),R=D("./src/utils/attr-list.ts"),g=D("./src/utils/logger.ts"),T=D("./src/utils/codecs.ts"),L=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,C=/#EXT-X-MEDIA:(.*)/g,S=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),A=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("|")),d=/\.(mp4|m4s|m4v|m4a)$/i;function o(w){var E,f;return d.test((E=(f=P.parseURL(w))===null||f===void 0?void 0:f.path)!=null?E:"")}var l=function(){function w(){}return w.findGroup=function(f,c){for(var s=0;s<f.length;s++){var a=f[s];if(a.id===c)return a}},w.convertAVC1ToAVCOTI=function(f){var c=f.split(".");if(c.length>2){var s=c.shift()+".";return s+=parseInt(c.shift()).toString(16),s+=("000"+parseInt(c.shift()).toString(16)).substr(-4),s}return f},w.resolve=function(f,c){return P.buildAbsoluteURL(c,f,{alwaysNormalize:!0})},w.parseMasterPlaylist=function(f,c){var s=[],a={},v=!1;L.lastIndex=0;for(var p;(p=L.exec(f))!=null;)if(p[1]){var b=new R.AttrList(p[1]),O={attrs:b,bitrate:b.decimalInteger("AVERAGE-BANDWIDTH")||b.decimalInteger("BANDWIDTH"),name:b.NAME,url:w.resolve(p[2],c)},N=b.decimalResolution("RESOLUTION");N&&(O.width=N.width,O.height=N.height),u((b.CODECS||"").split(/[ ,]+/).filter(function(V){return V}),O),O.videoCodec&&O.videoCodec.indexOf("avc1")!==-1&&(O.videoCodec=w.convertAVC1ToAVCOTI(O.videoCodec)),s.push(O)}else if(p[3]){var W=new R.AttrList(p[3]);W["DATA-ID"]&&(v=!0,a[W["DATA-ID"]]=W)}return{levels:s,sessionData:v?a:null}},w.parseMasterPlaylistMedia=function(f,c,s,a){a===void 0&&(a=[]);var v,p=[],b=0;for(C.lastIndex=0;(v=C.exec(f))!==null;){var O=new R.AttrList(v[1]);if(O.TYPE===s){var N={attrs:O,bitrate:0,id:b++,groupId:O["GROUP-ID"],instreamId:O["INSTREAM-ID"],name:O.NAME||O.LANGUAGE||"",type:s,default:O.bool("DEFAULT"),autoselect:O.bool("AUTOSELECT"),forced:O.bool("FORCED"),lang:O.LANGUAGE,url:O.URI?w.resolve(O.URI,c):""};if(a.length){var W=w.findGroup(a,N.groupId)||a[0];y(N,W,"audioCodec"),y(N,W,"textCodec")}p.push(N)}}return p},w.parseLevelPlaylist=function(f,c,s,a,v){var p=new B.LevelDetails(c),b=p.fragments,O=null,N=0,W=0,V=0,F=0,_=null,J=new U.Fragment(a,c),ee,oe,de,Ce=-1,ge=!1;for(S.lastIndex=0,p.m3u8=f;(ee=S.exec(f))!==null;){ge&&(ge=!1,J=new U.Fragment(a,c),J.start=V,J.sn=N,J.cc=F,J.level=s,O&&(J.initSegment=O,J.rawProgramDateTime=O.rawProgramDateTime));var pe=ee[1];if(pe){J.duration=parseFloat(pe);var ce=(" "+ee[2]).slice(1);J.title=ce||null,J.tagList.push(ce?["INF",pe,ce]:["INF",pe])}else if(ee[3])Object(K.isFiniteNumber)(J.duration)&&(J.start=V,de&&(J.levelkey=de),J.sn=N,J.level=s,J.cc=F,J.urlId=v,b.push(J),J.relurl=(" "+ee[3]).slice(1),h(J,_),_=J,V+=J.duration,N++,W=0,ge=!0);else if(ee[4]){var he=(" "+ee[4]).slice(1);_?J.setByteRange(he,_):J.setByteRange(he)}else if(ee[5])J.rawProgramDateTime=(" "+ee[5]).slice(1),J.tagList.push(["PROGRAM-DATE-TIME",J.rawProgramDateTime]),Ce===-1&&(Ce=b.length);else{if(ee=ee[0].match(A),!ee){g.logger.warn("No matches on slow regex match for level playlist!");continue}for(oe=1;oe<ee.length&&!(typeof ee[oe]!="undefined");oe++);var ne=(" "+ee[oe]).slice(1),ue=(" "+ee[oe+1]).slice(1),Ee=ee[oe+2]?(" "+ee[oe+2]).slice(1):"";switch(ne){case"PLAYLIST-TYPE":p.type=ue.toUpperCase();break;case"MEDIA-SEQUENCE":N=p.startSN=parseInt(ue);break;case"SKIP":{var _e=new R.AttrList(ue),Oe=_e.decimalInteger("SKIPPED-SEGMENTS");if(Object(K.isFiniteNumber)(Oe)){p.skippedSegments=Oe;for(var Ne=Oe;Ne--;)b.unshift(null);N+=Oe}var je=_e.enumeratedString("RECENTLY-REMOVED-DATERANGES");je&&(p.recentlyRemovedDateranges=je.split(" "));break}case"TARGETDURATION":p.targetduration=parseFloat(ue);break;case"VERSION":p.version=parseInt(ue);break;case"EXTM3U":break;case"ENDLIST":p.live=!1;break;case"#":(ue||Ee)&&J.tagList.push(Ee?[ue,Ee]:[ue]);break;case"DIS":F++;case"GAP":J.tagList.push([ne]);break;case"BITRATE":J.tagList.push([ne,ue]);break;case"DISCONTINUITY-SEQ":F=parseInt(ue);break;case"KEY":{var xe,Se=new R.AttrList(ue),Ie=Se.enumeratedString("METHOD"),Fe=Se.URI,He=Se.hexadecimalInteger("IV"),Me=Se.enumeratedString("KEYFORMATVERSIONS"),Le=Se.enumeratedString("KEYID"),qe=(xe=Se.enumeratedString("KEYFORMAT"))!=null?xe:"identity",Ze=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(Ze.indexOf(qe)>-1){g.logger.warn("Keyformat "+qe+" is not supported from the manifest");continue}else if(qe!=="identity")continue;Ie&&(de=I.LevelKey.fromURL(c,Fe),Fe&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Ie)>=0&&(de.method=Ie,de.keyFormat=qe,Le&&(de.keyID=Le),Me&&(de.keyFormatVersions=Me),de.iv=He));break}case"START":{var ze=new R.AttrList(ue),Ge=ze.decimalFloatingPoint("TIME-OFFSET");Object(K.isFiniteNumber)(Ge)&&(p.startTimeOffset=Ge);break}case"MAP":{var tt=new R.AttrList(ue);J.relurl=tt.URI,tt.BYTERANGE&&J.setByteRange(tt.BYTERANGE),J.level=s,J.sn="initSegment",de&&(J.levelkey=de),J.initSegment=null,O=J,ge=!0;break}case"SERVER-CONTROL":{var Xe=new R.AttrList(ue);p.canBlockReload=Xe.bool("CAN-BLOCK-RELOAD"),p.canSkipUntil=Xe.optionalFloat("CAN-SKIP-UNTIL",0),p.canSkipDateRanges=p.canSkipUntil>0&&Xe.bool("CAN-SKIP-DATERANGES"),p.partHoldBack=Xe.optionalFloat("PART-HOLD-BACK",0),p.holdBack=Xe.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Ye=new R.AttrList(ue);p.partTarget=Ye.decimalFloatingPoint("PART-TARGET");break}case"PART":{var ye=p.partList;ye||(ye=p.partList=[]);var $e=W>0?ye[ye.length-1]:void 0,Ve=W++,be=new U.Part(new R.AttrList(ue),J,c,Ve,$e);ye.push(be),J.duration+=be.duration;break}case"PRELOAD-HINT":{var Pe=new R.AttrList(ue);p.preloadHint=Pe;break}case"RENDITION-REPORT":{var le=new R.AttrList(ue);p.renditionReports=p.renditionReports||[],p.renditionReports.push(le);break}default:g.logger.warn("line parsed but not handled: "+ee);break}}}_&&!_.relurl?(b.pop(),V-=_.duration,p.partList&&(p.fragmentHint=_)):p.partList&&(h(J,_),J.cc=F,p.fragmentHint=J);var ie=b.length,ae=b[0],Y=b[ie-1];if(V+=p.skippedSegments*p.targetduration,V>0&&ie&&Y){p.averagetargetduration=V/ie;var X=Y.sn;p.endSN=X!=="initSegment"?X:0,ae&&(p.startCC=ae.cc,ae.initSegment||p.fragments.every(function(Z){return Z.relurl&&o(Z.relurl)})&&(g.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),J=new U.Fragment(a,c),J.relurl=Y.relurl,J.level=s,J.sn="initSegment",ae.initSegment=J,p.needSidxRanges=!0))}else p.endSN=0,p.startCC=0;return p.fragmentHint&&(V+=p.fragmentHint.duration),p.totalduration=V,p.endCC=F,Ce>0&&m(b,Ce),p},w}();function u(w,E){["video","audio","text"].forEach(function(f){var c=w.filter(function(a){return Object(T.isCodecType)(a,f)});if(c.length){var s=c.filter(function(a){return a.lastIndexOf("avc1",0)===0||a.lastIndexOf("mp4a",0)===0});E[f+"Codec"]=s.length>0?s[0]:c[0],w=w.filter(function(a){return c.indexOf(a)===-1})}}),E.unknownCodecs=w}function y(w,E,f){var c=E[f];c&&(w[f]=c)}function m(w,E){for(var f=w[E],c=E;c--;){var s=w[c];if(!s)return;s.programDateTime=f.programDateTime-s.duration*1e3,f=s}}function h(w,E){w.rawProgramDateTime?w.programDateTime=Date.parse(w.rawProgramDateTime):E!=null&&E.programDateTime&&(w.programDateTime=E.endProgramDateTime),Object(K.isFiniteNumber)(w.programDateTime)||(w.programDateTime=null,w.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(q,G,D){"use strict";D.r(G);var K=D("./src/polyfills/number.ts"),P=D("./src/events.ts"),M=D("./src/errors.ts"),U=D("./src/utils/logger.ts"),B=D("./src/utils/mp4-tools.ts"),I=D("./src/loader/m3u8-parser.ts"),R=D("./src/types/loader.ts"),g=D("./src/utils/attr-list.ts");function T(S){var A=S.type;switch(A){case R.PlaylistContextType.AUDIO_TRACK:return R.PlaylistLevelType.AUDIO;case R.PlaylistContextType.SUBTITLE_TRACK:return R.PlaylistLevelType.SUBTITLE;default:return R.PlaylistLevelType.MAIN}}function L(S,A){var d=S.url;return(d===void 0||d.indexOf("data:")===0)&&(d=A.url),d}var C=function(){function S(d){this.hls=void 0,this.loaders=Object.create(null),this.hls=d,this.registerListeners()}var A=S.prototype;return A.registerListeners=function(){var o=this.hls;o.on(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.on(P.Events.LEVEL_LOADING,this.onLevelLoading,this),o.on(P.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),o.on(P.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},A.unregisterListeners=function(){var o=this.hls;o.off(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.off(P.Events.LEVEL_LOADING,this.onLevelLoading,this),o.off(P.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),o.off(P.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},A.createInternalLoader=function(o){var l=this.hls.config,u=l.pLoader,y=l.loader,m=u||y,h=new m(l);return o.loader=h,this.loaders[o.type]=h,h},A.getInternalLoader=function(o){return this.loaders[o.type]},A.resetInternalLoader=function(o){this.loaders[o]&&delete this.loaders[o]},A.destroyInternalLoaders=function(){for(var o in this.loaders){var l=this.loaders[o];l&&l.destroy(),this.resetInternalLoader(o)}},A.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},A.onManifestLoading=function(o,l){var u=l.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:R.PlaylistContextType.MANIFEST,url:u,deliveryDirectives:null})},A.onLevelLoading=function(o,l){var u=l.id,y=l.level,m=l.url,h=l.deliveryDirectives;this.load({id:u,groupId:null,level:y,responseType:"text",type:R.PlaylistContextType.LEVEL,url:m,deliveryDirectives:h})},A.onAudioTrackLoading=function(o,l){var u=l.id,y=l.groupId,m=l.url,h=l.deliveryDirectives;this.load({id:u,groupId:y,level:null,responseType:"text",type:R.PlaylistContextType.AUDIO_TRACK,url:m,deliveryDirectives:h})},A.onSubtitleTrackLoading=function(o,l){var u=l.id,y=l.groupId,m=l.url,h=l.deliveryDirectives;this.load({id:u,groupId:y,level:null,responseType:"text",type:R.PlaylistContextType.SUBTITLE_TRACK,url:m,deliveryDirectives:h})},A.load=function(o){var l,u=this.hls.config,y=this.getInternalLoader(o);if(y){var m=y.context;if(m&&m.url===o.url){U.logger.trace("[playlist-loader]: playlist request ongoing");return}U.logger.log("[playlist-loader]: aborting previous loader for type: "+o.type),y.abort()}var h,w,E,f;switch(o.type){case R.PlaylistContextType.MANIFEST:h=u.manifestLoadingMaxRetry,w=u.manifestLoadingTimeOut,E=u.manifestLoadingRetryDelay,f=u.manifestLoadingMaxRetryTimeout;break;case R.PlaylistContextType.LEVEL:case R.PlaylistContextType.AUDIO_TRACK:case R.PlaylistContextType.SUBTITLE_TRACK:h=0,w=u.levelLoadingTimeOut;break;default:h=u.levelLoadingMaxRetry,w=u.levelLoadingTimeOut,E=u.levelLoadingRetryDelay,f=u.levelLoadingMaxRetryTimeout;break}if(y=this.createInternalLoader(o),(l=o.deliveryDirectives)!==null&&l!==void 0&&l.part){var c;if(o.type===R.PlaylistContextType.LEVEL&&o.level!==null?c=this.hls.levels[o.level].details:o.type===R.PlaylistContextType.AUDIO_TRACK&&o.id!==null?c=this.hls.audioTracks[o.id].details:o.type===R.PlaylistContextType.SUBTITLE_TRACK&&o.id!==null&&(c=this.hls.subtitleTracks[o.id].details),c){var s=c.partTarget,a=c.targetduration;s&&a&&(w=Math.min(Math.max(s*3,a*.8)*1e3,w))}}var v={timeout:w,maxRetry:h,retryDelay:E,maxRetryDelay:f,highWaterMark:0},p={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};y.load(o,v,p)},A.loadsuccess=function(o,l,u,y){if(y===void 0&&(y=null),u.isSidxRequest){this.handleSidxRequest(o,u),this.handlePlaylistLoaded(o,l,u,y);return}this.resetInternalLoader(u.type);var m=o.data;if(m.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(o,u,"no EXTM3U delimiter",y);return}l.parsing.start=performance.now(),m.indexOf("#EXTINF:")>0||m.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(o,l,u,y):this.handleMasterPlaylist(o,l,u,y)},A.loaderror=function(o,l,u){u===void 0&&(u=null),this.handleNetworkError(l,u,!1,o)},A.loadtimeout=function(o,l,u){u===void 0&&(u=null),this.handleNetworkError(l,u,!0)},A.handleMasterPlaylist=function(o,l,u,y){var m=this.hls,h=o.data,w=L(o,u),E=I.default.parseMasterPlaylist(h,w),f=E.levels,c=E.sessionData;if(!f.length){this.handleManifestParsingError(o,u,"no level found in manifest",y);return}var s=f.map(function(N){return{id:N.attrs.AUDIO,audioCodec:N.audioCodec}}),a=f.map(function(N){return{id:N.attrs.SUBTITLES,textCodec:N.textCodec}}),v=I.default.parseMasterPlaylistMedia(h,w,"AUDIO",s),p=I.default.parseMasterPlaylistMedia(h,w,"SUBTITLES",a),b=I.default.parseMasterPlaylistMedia(h,w,"CLOSED-CAPTIONS");if(v.length){var O=v.some(function(N){return!N.url});!O&&f[0].audioCodec&&!f[0].attrs.AUDIO&&(U.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),v.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new g.AttrList({}),bitrate:0,url:""}))}m.trigger(P.Events.MANIFEST_LOADED,{levels:f,audioTracks:v,subtitles:p,captions:b,url:w,stats:l,networkDetails:y,sessionData:c})},A.handleTrackOrLevelPlaylist=function(o,l,u,y){var m=this.hls,h=u.id,w=u.level,E=u.type,f=L(o,u),c=Object(K.isFiniteNumber)(h)?h:0,s=Object(K.isFiniteNumber)(w)?w:c,a=T(u),v=I.default.parseLevelPlaylist(o.data,f,s,a,c);if(!v.fragments.length){m.trigger(P.Events.ERROR,{type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:f,reason:"no fragments found in level",level:typeof u.level=="number"?u.level:void 0});return}if(E===R.PlaylistContextType.MANIFEST){var p={attrs:new g.AttrList({}),bitrate:0,details:v,name:"",url:f};m.trigger(P.Events.MANIFEST_LOADED,{levels:[p],audioTracks:[],url:f,stats:l,networkDetails:y,sessionData:null})}if(l.parsing.end=performance.now(),v.needSidxRanges){var b,O=(b=v.fragments[0].initSegment)===null||b===void 0?void 0:b.url;this.load({url:O,isSidxRequest:!0,type:E,level:w,levelDetails:v,id:h,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}u.levelDetails=v,this.handlePlaylistLoaded(o,l,u,y)},A.handleSidxRequest=function(o,l){var u=Object(B.parseSegmentIndex)(new Uint8Array(o.data));if(!u)return;var y=u.references,m=l.levelDetails;y.forEach(function(h,w){var E=h.info,f=m.fragments[w];f.byteRange.length===0&&f.setByteRange(String(1+E.end-E.start)+"@"+String(E.start)),f.initSegment&&f.initSegment.setByteRange(String(u.moovEndOffset)+"@0")})},A.handleManifestParsingError=function(o,l,u,y){this.hls.trigger(P.Events.ERROR,{type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:l.type===R.PlaylistContextType.MANIFEST,url:o.url,reason:u,response:o,context:l,networkDetails:y})},A.handleNetworkError=function(o,l,u,y){u===void 0&&(u=!1),U.logger.warn("[playlist-loader]: A network "+(u?"timeout":"error")+" occurred while loading "+o.type+" level: "+o.level+" id: "+o.id+' group-id: "'+o.groupId+'"');var m=M.ErrorDetails.UNKNOWN,h=!1,w=this.getInternalLoader(o);switch(o.type){case R.PlaylistContextType.MANIFEST:m=u?M.ErrorDetails.MANIFEST_LOAD_TIMEOUT:M.ErrorDetails.MANIFEST_LOAD_ERROR,h=!0;break;case R.PlaylistContextType.LEVEL:m=u?M.ErrorDetails.LEVEL_LOAD_TIMEOUT:M.ErrorDetails.LEVEL_LOAD_ERROR,h=!1;break;case R.PlaylistContextType.AUDIO_TRACK:m=u?M.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:M.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,h=!1;break;case R.PlaylistContextType.SUBTITLE_TRACK:m=u?M.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:M.ErrorDetails.SUBTITLE_LOAD_ERROR,h=!1;break}w&&this.resetInternalLoader(o.type);var E={type:M.ErrorTypes.NETWORK_ERROR,details:m,fatal:h,url:o.url,loader:w,context:o,networkDetails:l};y&&(E.response=y),this.hls.trigger(P.Events.ERROR,E)},A.handlePlaylistLoaded=function(o,l,u,y){var m=u.type,h=u.level,w=u.id,E=u.groupId,f=u.loader,c=u.levelDetails,s=u.deliveryDirectives;if(!(c!=null&&c.targetduration)){this.handleManifestParsingError(o,u,"invalid target duration",y);return}if(!f)return;c.live&&(f.getCacheAge&&(c.ageHeader=f.getCacheAge()||0),(!f.getCacheAge||isNaN(c.ageHeader))&&(c.ageHeader=0));switch(m){case R.PlaylistContextType.MANIFEST:case R.PlaylistContextType.LEVEL:this.hls.trigger(P.Events.LEVEL_LOADED,{details:c,level:h||0,id:w||0,stats:l,networkDetails:y,deliveryDirectives:s});break;case R.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(P.Events.AUDIO_TRACK_LOADED,{details:c,id:w||0,groupId:E||"",stats:l,networkDetails:y,deliveryDirectives:s});break;case R.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(P.Events.SUBTITLE_TRACK_LOADED,{details:c,id:w||0,groupId:E||"",stats:l,networkDetails:y,deliveryDirectives:s});break}},S}();G.default=C},"./src/polyfills/number.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"isFiniteNumber",function(){return K}),D.d(G,"MAX_SAFE_INTEGER",function(){return P});var K=Number.isFinite||function(M){return typeof M=="number"&&isFinite(M)},P=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(q,G,D){"use strict";D.r(G);var K=function(){function P(){}return P.getSilentFrame=function(U,B){switch(U){case"mp4a.40.2":if(B===1)return new Uint8Array([0,200,0,128,35,128]);if(B===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(B===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(B===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(B===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(B===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(B===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(B===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(B===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},P}();G.default=K},"./src/remux/mp4-generator.ts":function(q,G,D){"use strict";D.r(G);var K=Math.pow(2,32)-1,P=function(){function M(){}return M.init=function(){M.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};var B;for(B in M.types)M.types.hasOwnProperty(B)&&(M.types[B]=[B.charCodeAt(0),B.charCodeAt(1),B.charCodeAt(2),B.charCodeAt(3)]);var I=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]),R=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);M.HDLR_TYPES={video:I,audio:R};var g=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),T=new Uint8Array([0,0,0,0,0,0,0,0]);M.STTS=M.STSC=M.STCO=T,M.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),M.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),M.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),M.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var L=new Uint8Array([105,115,111,109]),C=new Uint8Array([97,118,99,49]),S=new Uint8Array([0,0,0,1]);M.FTYP=M.box(M.types.ftyp,L,S,L,C),M.DINF=M.box(M.types.dinf,M.box(M.types.dref,g))},M.box=function(B){for(var I=8,R=arguments.length,g=new Array(R>1?R-1:0),T=1;T<R;T++)g[T-1]=arguments[T];for(var L=g.length,C=L;L--;)I+=g[L].byteLength;var S=new Uint8Array(I);for(S[0]=I>>24&255,S[1]=I>>16&255,S[2]=I>>8&255,S[3]=I&255,S.set(B,4),L=0,I=8;L<C;L++)S.set(g[L],I),I+=g[L].byteLength;return S},M.hdlr=function(B){return M.box(M.types.hdlr,M.HDLR_TYPES[B])},M.mdat=function(B){return M.box(M.types.mdat,B)},M.mdhd=function(B,I){I*=B;var R=Math.floor(I/(K+1)),g=Math.floor(I%(K+1));return M.box(M.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,B>>24&255,B>>16&255,B>>8&255,B&255,R>>24,R>>16&255,R>>8&255,R&255,g>>24,g>>16&255,g>>8&255,g&255,85,196,0,0]))},M.mdia=function(B){return M.box(M.types.mdia,M.mdhd(B.timescale,B.duration),M.hdlr(B.type),M.minf(B))},M.mfhd=function(B){return M.box(M.types.mfhd,new Uint8Array([0,0,0,0,B>>24,B>>16&255,B>>8&255,B&255]))},M.minf=function(B){return B.type==="audio"?M.box(M.types.minf,M.box(M.types.smhd,M.SMHD),M.DINF,M.stbl(B)):M.box(M.types.minf,M.box(M.types.vmhd,M.VMHD),M.DINF,M.stbl(B))},M.moof=function(B,I,R){return M.box(M.types.moof,M.mfhd(B),M.traf(R,I))},M.moov=function(B){for(var I=B.length,R=[];I--;)R[I]=M.trak(B[I]);return M.box.apply(null,[M.types.moov,M.mvhd(B[0].timescale,B[0].duration)].concat(R).concat(M.mvex(B)))},M.mvex=function(B){for(var I=B.length,R=[];I--;)R[I]=M.trex(B[I]);return M.box.apply(null,[M.types.mvex].concat(R))},M.mvhd=function(B,I){I*=B;var R=Math.floor(I/(K+1)),g=Math.floor(I%(K+1)),T=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,B>>24&255,B>>16&255,B>>8&255,B&255,R>>24,R>>16&255,R>>8&255,R&255,g>>24,g>>16&255,g>>8&255,g&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return M.box(M.types.mvhd,T)},M.sdtp=function(B){var I=B.samples||[],R=new Uint8Array(4+I.length),g,T;for(g=0;g<I.length;g++)T=I[g].flags,R[g+4]=T.dependsOn<<4|T.isDependedOn<<2|T.hasRedundancy;return M.box(M.types.sdtp,R)},M.stbl=function(B){return M.box(M.types.stbl,M.stsd(B),M.box(M.types.stts,M.STTS),M.box(M.types.stsc,M.STSC),M.box(M.types.stsz,M.STSZ),M.box(M.types.stco,M.STCO))},M.avc1=function(B){var I=[],R=[],g,T,L;for(g=0;g<B.sps.length;g++)T=B.sps[g],L=T.byteLength,I.push(L>>>8&255),I.push(L&255),I=I.concat(Array.prototype.slice.call(T));for(g=0;g<B.pps.length;g++)T=B.pps[g],L=T.byteLength,R.push(L>>>8&255),R.push(L&255),R=R.concat(Array.prototype.slice.call(T));var C=M.box(M.types.avcC,new Uint8Array([1,I[3],I[4],I[5],252|3,224|B.sps.length].concat(I).concat([B.pps.length]).concat(R))),S=B.width,A=B.height,d=B.pixelRatio[0],o=B.pixelRatio[1];return M.box(M.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,S>>8&255,S&255,A>>8&255,A&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]),C,M.box(M.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),M.box(M.types.pasp,new Uint8Array([d>>24,d>>16&255,d>>8&255,d&255,o>>24,o>>16&255,o>>8&255,o&255])))},M.esds=function(B){var I=B.config.length;return new Uint8Array([0,0,0,0,3,23+I,0,1,0,4,15+I,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([I]).concat(B.config).concat([6,1,2]))},M.mp4a=function(B){var I=B.samplerate;return M.box(M.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,B.channelCount,0,16,0,0,0,0,I>>8&255,I&255,0,0]),M.box(M.types.esds,M.esds(B)))},M.mp3=function(B){var I=B.samplerate;return M.box(M.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,B.channelCount,0,16,0,0,0,0,I>>8&255,I&255,0,0]))},M.stsd=function(B){return B.type==="audio"?!B.isAAC&&B.codec==="mp3"?M.box(M.types.stsd,M.STSD,M.mp3(B)):M.box(M.types.stsd,M.STSD,M.mp4a(B)):M.box(M.types.stsd,M.STSD,M.avc1(B))},M.tkhd=function(B){var I=B.id,R=B.duration*B.timescale,g=B.width,T=B.height,L=Math.floor(R/(K+1)),C=Math.floor(R%(K+1));return M.box(M.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,I>>24&255,I>>16&255,I>>8&255,I&255,0,0,0,0,L>>24,L>>16&255,L>>8&255,L&255,C>>24,C>>16&255,C>>8&255,C&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,g>>8&255,g&255,0,0,T>>8&255,T&255,0,0]))},M.traf=function(B,I){var R=M.sdtp(B),g=B.id,T=Math.floor(I/(K+1)),L=Math.floor(I%(K+1));return M.box(M.types.traf,M.box(M.types.tfhd,new Uint8Array([0,0,0,0,g>>24,g>>16&255,g>>8&255,g&255])),M.box(M.types.tfdt,new Uint8Array([1,0,0,0,T>>24,T>>16&255,T>>8&255,T&255,L>>24,L>>16&255,L>>8&255,L&255])),M.trun(B,R.length+16+20+8+16+8+8),R)},M.trak=function(B){return B.duration=B.duration||4294967295,M.box(M.types.trak,M.tkhd(B),M.mdia(B))},M.trex=function(B){var I=B.id;return M.box(M.types.trex,new Uint8Array([0,0,0,0,I>>24,I>>16&255,I>>8&255,I&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},M.trun=function(B,I){var R=B.samples||[],g=R.length,T=12+16*g,L=new Uint8Array(T),C,S,A,d,o,l;for(I+=8+T,L.set([0,0,15,1,g>>>24&255,g>>>16&255,g>>>8&255,g&255,I>>>24&255,I>>>16&255,I>>>8&255,I&255],0),C=0;C<g;C++)S=R[C],A=S.duration,d=S.size,o=S.flags,l=S.cts,L.set([A>>>24&255,A>>>16&255,A>>>8&255,A&255,d>>>24&255,d>>>16&255,d>>>8&255,d&255,o.isLeading<<2|o.dependsOn,o.isDependedOn<<6|o.hasRedundancy<<4|o.paddingValue<<1|o.isNonSync,o.degradPrio&240<<8,o.degradPrio&15,l>>>24&255,l>>>16&255,l>>>8&255,l&255],12+16*C);return M.box(M.types.trun,L)},M.initSegment=function(B){M.types||M.init();var I=M.moov(B),R=new Uint8Array(M.FTYP.byteLength+I.byteLength);return R.set(M.FTYP),R.set(I,M.FTYP.byteLength),R},M}();P.types=void 0,P.HDLR_TYPES=void 0,P.STTS=void 0,P.STSC=void 0,P.STCO=void 0,P.STSZ=void 0,P.VMHD=void 0,P.SMHD=void 0,P.STSD=void 0,P.FTYP=void 0,P.DINF=void 0,G.default=P},"./src/remux/mp4-remuxer.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"default",function(){return l}),D.d(G,"normalizePts",function(){return u});var K=D("./src/polyfills/number.ts"),P=D("./src/remux/aac-helper.ts"),M=D("./src/remux/mp4-generator.ts"),U=D("./src/events.ts"),B=D("./src/errors.ts"),I=D("./src/utils/logger.ts"),R=D("./src/types/loader.ts"),g=D("./src/utils/timescale-conversion.ts");function T(){return T=Object.assign||function(w){for(var E=1;E<arguments.length;E++){var f=arguments[E];for(var c in f)Object.prototype.hasOwnProperty.call(f,c)&&(w[c]=f[c])}return w},T.apply(this,arguments)}var L=10*1e3,C=1024,S=1152,A=null,d=null,o=!1,l=function(){function w(f,c,s,a){if(a===void 0&&(a=""),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=f,this.config=c,this.typeSupported=s,this.ISGenerated=!1,A===null){var v=navigator.userAgent||"",p=v.match(/Chrome\/(\d+)/i);A=p?parseInt(p[1]):0}if(d===null){var b=navigator.userAgent.match(/Safari\/(\d+)/i);d=b?parseInt(b[1]):0}o=!!A&&A<75||!!d&&d<600}var E=w.prototype;return E.destroy=function(){},E.resetTimeStamp=function(c){I.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=c},E.resetNextTimestamp=function(){I.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},E.resetInitSegment=function(){I.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},E.getVideoStartPts=function(c){var s=!1,a=c.reduce(function(v,p){var b=p.pts-v;return b<-4294967296?(s=!0,u(v,p.pts)):b>0?v:p.pts},c[0].pts);return s&&I.logger.debug("PTS rollover detected"),a},E.remux=function(c,s,a,v,p,b,O,N){var W,V,F,_,J,ee,oe=p,de=p,Ce=c.pid>-1,ge=s.pid>-1,pe=s.samples.length,ce=c.samples.length>0,he=pe>1,ne=(!Ce||ce)&&(!ge||he)||this.ISGenerated||O;if(ne){this.ISGenerated||(F=this.generateIS(c,s,p));var ue=this.isVideoContiguous,Ee=-1;if(he&&(Ee=y(s.samples),!ue&&this.config.forceKeyFrameOnDiscontinuity))if(ee=!0,Ee>0){I.logger.warn("[mp4-remuxer]: Dropped "+Ee+" out of "+pe+" video samples due to a missing keyframe");var _e=this.getVideoStartPts(s.samples);s.samples=s.samples.slice(Ee),s.dropped+=Ee,de+=(s.samples[0].pts-_e)/(s.timescale||9e4)}else Ee===-1&&(I.logger.warn("[mp4-remuxer]: No keyframe found out of "+pe+" video samples"),ee=!1);if(this.ISGenerated){if(ce&&he){var Oe=this.getVideoStartPts(s.samples),Ne=u(c.samples[0].pts,Oe)-Oe,je=Ne/s.inputTimeScale;oe+=Math.max(0,je),de+=Math.max(0,-je)}if(ce){if(c.samplerate||(I.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),F=this.generateIS(c,s,p)),V=this.remuxAudio(c,oe,this.isAudioContiguous,b,ge||he||N===R.PlaylistLevelType.AUDIO?de:void 0),he){var xe=V?V.endPTS-V.startPTS:0;s.inputTimeScale||(I.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),F=this.generateIS(c,s,p)),W=this.remuxVideo(s,de,ue,xe)}}else he&&(W=this.remuxVideo(s,de,ue,0));W&&(W.firstKeyFrame=Ee,W.independent=Ee!==-1)}}return this.ISGenerated&&(a.samples.length&&(J=this.remuxID3(a,p)),v.samples.length&&(_=this.remuxText(v,p))),{audio:V,video:W,initSegment:F,independent:ee,text:_,id3:J}},E.generateIS=function(c,s,a){var v=c.samples,p=s.samples,b=this.typeSupported,O={},N=!Object(K.isFiniteNumber)(this._initPTS),W="audio/mp4",V,F,_;if(N&&(V=F=Infinity),c.config&&v.length&&(c.timescale=c.samplerate,c.isAAC||(b.mpeg?(W="audio/mpeg",c.codec=""):b.mp3&&(c.codec="mp3")),O.audio={id:"audio",container:W,codec:c.codec,initSegment:!c.isAAC&&b.mpeg?new Uint8Array(0):M.default.initSegment([c]),metadata:{channelCount:c.channelCount}},N&&(_=c.inputTimeScale,V=F=v[0].pts-Math.round(_*a))),s.sps&&s.pps&&p.length&&(s.timescale=s.inputTimeScale,O.video={id:"main",container:"video/mp4",codec:s.codec,initSegment:M.default.initSegment([s]),metadata:{width:s.width,height:s.height}},N)){_=s.inputTimeScale;var J=this.getVideoStartPts(p),ee=Math.round(_*a);F=Math.min(F,u(p[0].dts,J)-ee),V=Math.min(V,J-ee)}if(Object.keys(O).length)return this.ISGenerated=!0,N&&(this._initPTS=V,this._initDTS=F),{tracks:O,initPTS:V,timescale:_}},E.remuxVideo=function(c,s,a,v){var p=c.inputTimeScale,b=c.samples,O=[],N=b.length,W=this._initPTS,V=this.nextAvcDts,F=8,_,J,ee,oe=Number.POSITIVE_INFINITY,de=Number.NEGATIVE_INFINITY,Ce=0,ge=!1;if(!a||V===null){var pe=s*p,ce=b[0].pts-u(b[0].dts,b[0].pts);V=pe-ce}for(var he=0;he<N;he++){var ne=b[he];if(ne.pts=u(ne.pts-W,V),ne.dts=u(ne.dts-W,V),ne.dts>ne.pts){var ue=9e4*.2;Ce=Math.max(Math.min(Ce,ne.pts-ne.dts),-1*ue)}ne.dts<b[he>0?he-1:he].dts&&(ge=!0)}ge&&b.sort(function(xt,ht){var st=xt.dts-ht.dts,Ct=xt.pts-ht.pts;return st||Ct}),J=b[0].dts,ee=b[b.length-1].dts;var Ee=Math.round((ee-J)/(N-1));if(Ce<0){if(Ce<Ee*-2){I.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(g.toMsFromMpegTsClock)(-Ee,!0)+" ms");for(var _e=Ce,Oe=0;Oe<N;Oe++)b[Oe].dts=_e=Math.max(_e,b[Oe].pts-Ee),b[Oe].pts=Math.max(_e,b[Oe].pts)}else{I.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(g.toMsFromMpegTsClock)(Ce,!0)+" ms to overcome this issue");for(var Ne=0;Ne<N;Ne++)b[Ne].dts=b[Ne].dts+Ce}J=b[0].dts}if(a){var je=J-V,xe=je>Ee,Se=je<-1;if(xe||Se){xe?I.logger.warn("AVC: "+Object(g.toMsFromMpegTsClock)(je,!0)+" ms ("+je+"dts) hole between fragments detected, filling it"):I.logger.warn("AVC: "+Object(g.toMsFromMpegTsClock)(-je,!0)+" ms ("+je+"dts) overlapping between fragments detected"),J=V;var Ie=b[0].pts-je;b[0].dts=J,b[0].pts=Ie,I.logger.log("Video: First PTS/DTS adjusted: "+Object(g.toMsFromMpegTsClock)(Ie,!0)+"/"+Object(g.toMsFromMpegTsClock)(J,!0)+", delta: "+Object(g.toMsFromMpegTsClock)(je,!0)+" ms")}}o&&(J=Math.max(0,J));for(var Fe=0,He=0,Me=0;Me<N;Me++){for(var Le=b[Me],qe=Le.units,Ze=qe.length,ze=0,Ge=0;Ge<Ze;Ge++)ze+=qe[Ge].data.length;He+=ze,Fe+=Ze,Le.length=ze,Le.dts=Math.max(Le.dts,J),Le.pts=Math.max(Le.pts,Le.dts,0),oe=Math.min(Le.pts,oe),de=Math.max(Le.pts,de)}ee=b[N-1].dts;var tt=He+4*Fe+8,Xe;try{Xe=new Uint8Array(tt)}catch(xt){this.observer.emit(U.Events.ERROR,U.Events.ERROR,{type:B.ErrorTypes.MUX_ERROR,details:B.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:tt,reason:"fail allocating video mdat "+tt});return}var Ye=new DataView(Xe.buffer);Ye.setUint32(0,tt),Xe.set(M.default.types.mdat,4);for(var ye=0;ye<N;ye++){for(var $e=b[ye],Ve=$e.units,be=0,Pe=0,le=Ve.length;Pe<le;Pe++){var ie=Ve[Pe],ae=ie.data,Y=ie.data.byteLength;Ye.setUint32(F,Y),F+=4,Xe.set(ae,F),F+=Y,be+=4+Y}if(ye<N-1)_=b[ye+1].dts-$e.dts;else{var X=this.config,Z=$e.dts-b[ye>0?ye-1:ye].dts;if(X.stretchShortVideoTrack&&this.nextAudioPts!==null){var te=Math.floor(X.maxBufferHole*p),se=(v?oe+v*p:this.nextAudioPts)-$e.pts;se>te?(_=se-Z,_<0&&(_=Z),I.logger.log("[mp4-remuxer]: It is approximately "+se/90+" ms to the next segment; using duration "+_/90+" ms for the last video frame.")):_=Z}else _=Z}var ve=Math.round($e.pts-$e.dts);O.push(new m($e.key,_,be,ve))}if(O.length&&A&&A<70){var De=O[0].flags;De.dependsOn=2,De.isNonSync=0}console.assert(_!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=V=ee+_,this.isVideoContiguous=!0;var Qe=M.default.moof(c.sequenceNumber++,J,T({},c,{samples:O})),at="video",rt={data1:Qe,data2:Xe,startPTS:oe/p,endPTS:(de+_)/p,startDTS:J/p,endDTS:V/p,type:at,hasAudio:!1,hasVideo:!0,nb:O.length,dropped:c.dropped};return c.samples=[],c.dropped=0,console.assert(Xe.length,"MDAT length must not be zero"),rt},E.remuxAudio=function(c,s,a,v,p){var b=c.inputTimeScale,O=c.samplerate?c.samplerate:b,N=b/O,W=c.isAAC?C:S,V=W*N,F=this._initPTS,_=!c.isAAC&&this.typeSupported.mpeg,J=[],ee=c.samples,oe=_?0:8,de=this.nextAudioPts||-1,Ce=s*b;if(this.isAudioContiguous=a=a||ee.length&&de>0&&(v&&Math.abs(Ce-de)<9e3||Math.abs(u(ee[0].pts-F,Ce)-de)<20*V),ee.forEach(function(ae){ae.pts=u(ae.pts-F,Ce)}),!a||de<0){if(ee=ee.filter(function(ae){return ae.pts>=0}),!ee.length)return;p===0?de=0:v?de=Math.max(0,Ce):de=ee[0].pts}if(c.isAAC)for(var ge=p!==void 0,pe=this.config.maxAudioFramesDrift,ce=0,he=de;ce<ee.length;ce++){var ne=ee[ce],ue=ne.pts,Ee=ue-he,_e=Math.abs(1e3*Ee/b);if(Ee<=-pe*V&&ge)ce===0&&(I.logger.warn("Audio frame @ "+(ue/b).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*Ee/b)+" ms."),this.nextAudioPts=de=he=ue);else if(Ee>=pe*V&&_e<L&&ge){var Oe=Math.round(Ee/V);he=ue-Oe*V,he<0&&(Oe--,he+=V),ce===0&&(this.nextAudioPts=de=he),I.logger.warn("[mp4-remuxer]: Injecting "+Oe+" audio frame @ "+(he/b).toFixed(3)+"s due to "+Math.round(1e3*Ee/b)+" ms gap.");for(var Ne=0;Ne<Oe;Ne++){var je=Math.max(he,0),xe=P.default.getSilentFrame(c.manifestCodec||c.codec,c.channelCount);xe||(I.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),xe=ne.unit.subarray()),ee.splice(ce,0,{unit:xe,pts:je}),he+=V,ce++}}ne.pts=he,he+=V}for(var Se=null,Ie=null,Fe,He=0,Me=ee.length;Me--;)He+=ee[Me].unit.byteLength;for(var Le=0,qe=ee.length;Le<qe;Le++){var Ze=ee[Le],ze=Ze.unit,Ge=Ze.pts;if(Ie!==null){var tt=J[Le-1];tt.duration=Math.round((Ge-Ie)/N)}else if(a&&c.isAAC&&(Ge=de),Se=Ge,He>0){He+=oe;try{Fe=new Uint8Array(He)}catch(ae){this.observer.emit(U.Events.ERROR,U.Events.ERROR,{type:B.ErrorTypes.MUX_ERROR,details:B.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:He,reason:"fail allocating audio mdat "+He});return}if(!_){var Xe=new DataView(Fe.buffer);Xe.setUint32(0,He),Fe.set(M.default.types.mdat,4)}}else return;Fe.set(ze,oe);var Ye=ze.byteLength;oe+=Ye,J.push(new m(!0,W,Ye,0)),Ie=Ge}var ye=J.length;if(!ye)return;var $e=J[J.length-1];this.nextAudioPts=de=Ie+N*$e.duration;var Ve=_?new Uint8Array(0):M.default.moof(c.sequenceNumber++,Se/N,T({},c,{samples:J}));c.samples=[];var be=Se/b,Pe=de/b,le="audio",ie={data1:Ve,data2:Fe,startPTS:be,endPTS:Pe,startDTS:be,endDTS:Pe,type:le,hasAudio:!0,hasVideo:!1,nb:ye};return this.isAudioContiguous=!0,console.assert(Fe.length,"MDAT length must not be zero"),ie},E.remuxEmptyAudio=function(c,s,a,v){var p=c.inputTimeScale,b=c.samplerate?c.samplerate:p,O=p/b,N=this.nextAudioPts,W=(N!==null?N:v.startDTS*p)+this._initDTS,V=v.endDTS*p+this._initDTS,F=O*C,_=Math.ceil((V-W)/F),J=P.default.getSilentFrame(c.manifestCodec||c.codec,c.channelCount);if(I.logger.warn("[mp4-remuxer]: remux empty Audio"),!J){I.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var ee=[],oe=0;oe<_;oe++){var de=W+oe*F;ee.push({unit:J,pts:de,dts:de})}return c.samples=ee,this.remuxAudio(c,s,a,!1)},E.remuxID3=function(c,s){var a=c.samples.length;if(!a)return;for(var v=c.inputTimeScale,p=this._initPTS,b=this._initDTS,O=0;O<a;O++){var N=c.samples[O];N.pts=u(N.pts-p,s*v)/v,N.dts=u(N.dts-b,s*v)/v}var W=c.samples;return c.samples=[],{samples:W}},E.remuxText=function(c,s){var a=c.samples.length;if(!a)return;for(var v=c.inputTimeScale,p=this._initPTS,b=0;b<a;b++){var O=c.samples[b];O.pts=u(O.pts-p,s*v)/v}c.samples.sort(function(W,V){return W.pts-V.pts});var N=c.samples;return c.samples=[],{samples:N}},w}();function u(w,E){var f;if(E===null)return w;for(E<w?f=-8589934592:f=8589934592;Math.abs(w-E)>4294967296;)w+=f;return w}function y(w){for(var E=0;E<w.length;E++)if(w[E].key)return E;return-1}var m=function(E,f,c,s){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=f,this.size=c,this.cts=s,this.flags=new h(E)},h=function(E){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=E?2:1,this.isNonSync=E?0:1}},"./src/remux/passthrough-remuxer.ts":function(q,G,D){"use strict";D.r(G);var K=D("./src/polyfills/number.ts"),P=D("./src/utils/mp4-tools.ts"),M=D("./src/loader/fragment.ts"),U=D("./src/utils/logger.ts"),B=function(){function g(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndDTS=null}var T=g.prototype;return T.destroy=function(){},T.resetTimeStamp=function(C){this.initPTS=C,this.lastEndDTS=null},T.resetNextTimestamp=function(){this.lastEndDTS=null},T.resetInitSegment=function(C,S,A){this.audioCodec=S,this.videoCodec=A,this.generateInitSegment(C),this.emitInitSegment=!0},T.generateInitSegment=function(C){var S=this.audioCodec,A=this.videoCodec;if(!C||!C.byteLength){this.initTracks=void 0,this.initData=void 0;return}var d=this.initData=Object(P.parseInitSegment)(C);S||(S=R(d.audio,M.ElementaryStreamTypes.AUDIO)),A||(A=R(d.video,M.ElementaryStreamTypes.VIDEO));var o={};d.audio&&d.video?o.audiovideo={container:"video/mp4",codec:S+","+A,initSegment:C,id:"main"}:d.audio?o.audio={container:"audio/mp4",codec:S,initSegment:C,id:"audio"}:d.video?o.video={container:"video/mp4",codec:A,initSegment:C,id:"main"}:U.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=o},T.remux=function(C,S,A,d,o){var l=this.initPTS,u=this.lastEndDTS,y={audio:void 0,video:void 0,text:d,id3:A,initSegment:void 0};Object(K.isFiniteNumber)(u)||(u=this.lastEndDTS=o||0);var m=S.samples;if(!m||!m.length)return y;var h={initPTS:void 0,timescale:1},w=this.initData;if((!w||!w.length)&&(this.generateInitSegment(m),w=this.initData),!w||!w.length)return U.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),y;this.emitInitSegment&&(h.tracks=this.initTracks,this.emitInitSegment=!1),Object(K.isFiniteNumber)(l)||(this.initPTS=h.initPTS=l=I(w,m,u));var E=Object(P.getDuration)(m,w),f=u,c=E+f;Object(P.offsetStartDTS)(w,m,l),E>0?this.lastEndDTS=c:(U.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var s=!!w.audio,a=!!w.video,v="";s&&(v+="audio"),a&&(v+="video");var p={data1:m,startPTS:f,startDTS:f,endPTS:c,endDTS:c,type:v,hasAudio:s,hasVideo:a,nb:1,dropped:0};return y.audio=p.type==="audio"?p:void 0,y.video=p.type!=="audio"?p:void 0,y.text=d,y.id3=A,y.initSegment=h,y},g}(),I=function(T,L,C){return Object(P.getStartDTS)(T,L)-C};function R(g,T){var L=g==null?void 0:g.codec;return L&&L.length>4?L:L==="hvc1"?"hvc1.1.c.L120.90":L==="av01"?"av01.0.04M.08":L==="avc1"||T===M.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}G.default=B},"./src/task-loop.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"default",function(){return K});var K=function(){function P(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var M=P.prototype;return M.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},M.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},M.onHandlerDestroyed=function(){},M.hasInterval=function(){return!!this._tickInterval},M.hasNextTick=function(){return!!this._tickTimer},M.setInterval=function(B){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,B),!0)},M.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},M.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},M.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},M.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},M.doTick=function(){},P}()},"./src/types/cmcd.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"CMCDVersion",function(){return K}),D.d(G,"CMCDObjectType",function(){return P}),D.d(G,"CMCDStreamingFormat",function(){return M}),D.d(G,"CMCDStreamType",function(){return U});var K=1,P;(function(B){B.MANIFEST="m",B.AUDIO="a",B.VIDEO="v",B.MUXED="av",B.INIT="i",B.CAPTION="c",B.TIMED_TEXT="tt",B.KEY="k",B.OTHER="o"})(P||(P={}));var M;(function(B){B.DASH="d",B.HLS="h",B.SMOOTH="s",B.OTHER="o"})(M||(M={}));var U;(function(B){B.VOD="v",B.LIVE="l"})(U||(U={}))},"./src/types/level.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"HlsSkip",function(){return M}),D.d(G,"getSkipValue",function(){return U}),D.d(G,"HlsUrlParameters",function(){return B}),D.d(G,"Level",function(){return I});function K(R,g){for(var T=0;T<g.length;T++){var L=g[T];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(R,L.key,L)}}function P(R,g,T){return g&&K(R.prototype,g),T&&K(R,T),R}var M;(function(R){R.No="",R.Yes="YES",R.v2="v2"})(M||(M={}));function U(R,g){var T=R.canSkipUntil,L=R.canSkipDateRanges,C=R.endSN,S=g!==void 0?g-C:0;return T&&S<T?L?M.v2:M.Yes:M.No}var B=function(){function R(T,L,C){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=T,this.part=L,this.skip=C}var g=R.prototype;return g.addDirectives=function(L){var C=new self.URL(L);return this.msn!==void 0&&C.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&C.searchParams.set("_HLS_part",this.part.toString()),this.skip&&C.searchParams.set("_HLS_skip",this.skip),C.toString()},R}(),I=function(){function R(g){this.attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.unknownCodecs=void 0,this.audioGroupIds=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.textGroupIds=void 0,this.url=void 0,this._urlId=0,this.url=[g.url],this.attrs=g.attrs,this.bitrate=g.bitrate,g.details&&(this.details=g.details),this.id=g.id||0,this.name=g.name,this.width=g.width||0,this.height=g.height||0,this.audioCodec=g.audioCodec,this.videoCodec=g.videoCodec,this.unknownCodecs=g.unknownCodecs,this.codecSet=[g.videoCodec,g.audioCodec].filter(function(T){return T}).join(",").replace(/\.[^.,]+/g,"")}return P(R,[{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(T){var L=T%this.url.length;this._urlId!==L&&(this.details=void 0,this._urlId=L)}}]),R}()},"./src/types/loader.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"PlaylistContextType",function(){return K}),D.d(G,"PlaylistLevelType",function(){return P});var K;(function(M){M.MANIFEST="manifest",M.LEVEL="level",M.AUDIO_TRACK="audioTrack",M.SUBTITLE_TRACK="subtitleTrack"})(K||(K={}));var P;(function(M){M.MAIN="main",M.AUDIO="audio",M.SUBTITLE="subtitle"})(P||(P={}))},"./src/types/transmuxer.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"ChunkMetadata",function(){return K});var K=function(U,B,I,R,g,T){R===void 0&&(R=0),g===void 0&&(g=-1),T===void 0&&(T=!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=P(),this.buffering={audio:P(),video:P(),audiovideo:P()},this.level=U,this.sn=B,this.id=I,this.size=R,this.part=g,this.partial=T};function P(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"AttrList",function(){return M});var K=/^(\d+)x(\d+)$/,P=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,M=function(){function U(I){typeof I=="string"&&(I=U.parseAttrList(I));for(var R in I)I.hasOwnProperty(R)&&(this[R]=I[R])}var B=U.prototype;return B.decimalInteger=function(R){var g=parseInt(this[R],10);return g>Number.MAX_SAFE_INTEGER?Infinity:g},B.hexadecimalInteger=function(R){if(this[R]){var g=(this[R]||"0x").slice(2);g=(g.length&1?"0":"")+g;for(var T=new Uint8Array(g.length/2),L=0;L<g.length/2;L++)T[L]=parseInt(g.slice(L*2,L*2+2),16);return T}else return null},B.hexadecimalIntegerAsNumber=function(R){var g=parseInt(this[R],16);return g>Number.MAX_SAFE_INTEGER?Infinity:g},B.decimalFloatingPoint=function(R){return parseFloat(this[R])},B.optionalFloat=function(R,g){var T=this[R];return T?parseFloat(T):g},B.enumeratedString=function(R){return this[R]},B.bool=function(R){return this[R]==="YES"},B.decimalResolution=function(R){var g=K.exec(this[R]);return g===null?void 0:{width:parseInt(g[1],10),height:parseInt(g[2],10)}},U.parseAttrList=function(R){var g,T={},L='"';for(P.lastIndex=0;(g=P.exec(R))!==null;){var C=g[2];C.indexOf(L)===0&&C.lastIndexOf(L)===C.length-1&&(C=C.slice(1,-1)),T[g[1]]=C}return T},U}()},"./src/utils/binary-search.ts":function(q,G,D){"use strict";D.r(G);var K={search:function(M,U){for(var B=0,I=M.length-1,R=null,g=null;B<=I;){R=(B+I)/2|0,g=M[R];var T=U(g);if(T>0)B=R+1;else if(T<0)I=R-1;else return g}return null}};G.default=K},"./src/utils/buffer-helper.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"BufferHelper",function(){return M});var K=D("./src/utils/logger.ts"),P={length:0,start:function(){return 0},end:function(){return 0}},M=function(){function U(){}return U.isBuffered=function(I,R){try{if(I){for(var g=U.getBuffered(I),T=0;T<g.length;T++)if(R>=g.start(T)&&R<=g.end(T))return!0}}catch(L){}return!1},U.bufferInfo=function(I,R,g){try{if(I){var T=U.getBuffered(I),L=[],C;for(C=0;C<T.length;C++)L.push({start:T.start(C),end:T.end(C)});return this.bufferedInfo(L,R,g)}}catch(S){}return{len:0,start:R,end:R,nextStart:void 0}},U.bufferedInfo=function(I,R,g){R=Math.max(0,R),I.sort(function(h,w){var E=h.start-w.start;return E||w.end-h.end});var T=[];if(g)for(var L=0;L<I.length;L++){var C=T.length;if(C){var S=T[C-1].end;I[L].start-S<g?I[L].end>S&&(T[C-1].end=I[L].end):T.push(I[L])}else T.push(I[L])}else T=I;for(var A=0,d,o=R,l=R,u=0;u<T.length;u++){var y=T[u].start,m=T[u].end;if(R+g>=y&&R<m)o=y,l=m,A=l-R;else if(R+g<y){d=y;break}}return{len:A,start:o||0,end:l||0,nextStart:d}},U.getBuffered=function(I){try{return I.buffered}catch(R){return K.logger.log("failed to get media.buffered",R),P}},U}()},"./src/utils/cea-608-parser.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"Row",function(){return l}),D.d(G,"CaptionScreen",function(){return u});var K=D("./src/utils/logger.ts"),P={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},M=function(c){var s=c;return P.hasOwnProperty(c)&&(s=P[c]),String.fromCharCode(s)},U=15,B=100,I={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},R={17:2,18:4,21:6,22:8,23:10,19:13,20:15},g={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},T={25:2,26:4,29:6,30:8,31:10,27:13,28:15},L=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],C;(function(f){f[f.ERROR=0]="ERROR",f[f.TEXT=1]="TEXT",f[f.WARNING=2]="WARNING",f[f.INFO=2]="INFO",f[f.DEBUG=3]="DEBUG",f[f.DATA=3]="DATA"})(C||(C={}));var S=function(){function f(){this.time=null,this.verboseLevel=C.ERROR}var c=f.prototype;return c.log=function(a,v){this.verboseLevel>=a&&K.logger.log(this.time+" ["+a+"] "+v)},f}(),A=function(c){for(var s=[],a=0;a<c.length;a++)s.push(c[a].toString(16));return s},d=function(){function f(s,a,v,p,b){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=s||"white",this.underline=a||!1,this.italics=v||!1,this.background=p||"black",this.flash=b||!1}var c=f.prototype;return c.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},c.setStyles=function(a){for(var v=["foreground","underline","italics","background","flash"],p=0;p<v.length;p++){var b=v[p];a.hasOwnProperty(b)&&(this[b]=a[b])}},c.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},c.equals=function(a){return this.foreground===a.foreground&&this.underline===a.underline&&this.italics===a.italics&&this.background===a.background&&this.flash===a.flash},c.copy=function(a){this.foreground=a.foreground,this.underline=a.underline,this.italics=a.italics,this.background=a.background,this.flash=a.flash},c.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},f}(),o=function(){function f(s,a,v,p,b,O){this.uchar=void 0,this.penState=void 0,this.uchar=s||" ",this.penState=new d(a,v,p,b,O)}var c=f.prototype;return c.reset=function(){this.uchar=" ",this.penState.reset()},c.setChar=function(a,v){this.uchar=a,this.penState.copy(v)},c.setPenState=function(a){this.penState.copy(a)},c.equals=function(a){return this.uchar===a.uchar&&this.penState.equals(a.penState)},c.copy=function(a){this.uchar=a.uchar,this.penState.copy(a.penState)},c.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},f}(),l=function(){function f(s){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var a=0;a<B;a++)this.chars.push(new o);this.logger=s,this.pos=0,this.currPenState=new d}var c=f.prototype;return c.equals=function(a){for(var v=!0,p=0;p<B;p++)if(!this.chars[p].equals(a.chars[p])){v=!1;break}return v},c.copy=function(a){for(var v=0;v<B;v++)this.chars[v].copy(a.chars[v])},c.isEmpty=function(){for(var a=!0,v=0;v<B;v++)if(!this.chars[v].isEmpty()){a=!1;break}return a},c.setCursor=function(a){this.pos!==a&&(this.pos=a),this.pos<0?(this.logger.log(C.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>B&&(this.logger.log(C.DEBUG,"Too large cursor position "+this.pos),this.pos=B)},c.moveCursor=function(a){var v=this.pos+a;if(a>1)for(var p=this.pos+1;p<v+1;p++)this.chars[p].setPenState(this.currPenState);this.setCursor(v)},c.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},c.insertChar=function(a){a>=144&&this.backSpace();var v=M(a);if(this.pos>=B){this.logger.log(C.ERROR,"Cannot insert "+a.toString(16)+" ("+v+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(v,this.currPenState),this.moveCursor(1)},c.clearFromPos=function(a){var v;for(v=a;v<B;v++)this.chars[v].reset()},c.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},c.clearToEndOfRow=function(){this.clearFromPos(this.pos)},c.getTextString=function(){for(var a=[],v=!0,p=0;p<B;p++){var b=this.chars[p].uchar;b!==" "&&(v=!1),a.push(b)}return v?"":a.join("")},c.setPenStyles=function(a){this.currPenState.setStyles(a);var v=this.chars[this.pos];v.setPenState(this.currPenState)},f}(),u=function(){function f(s){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var a=0;a<U;a++)this.rows.push(new l(s));this.logger=s,this.currRow=U-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var c=f.prototype;return c.reset=function(){for(var a=0;a<U;a++)this.rows[a].clear();this.currRow=U-1},c.equals=function(a){for(var v=!0,p=0;p<U;p++)if(!this.rows[p].equals(a.rows[p])){v=!1;break}return v},c.copy=function(a){for(var v=0;v<U;v++)this.rows[v].copy(a.rows[v])},c.isEmpty=function(){for(var a=!0,v=0;v<U;v++)if(!this.rows[v].isEmpty()){a=!1;break}return a},c.backSpace=function(){var a=this.rows[this.currRow];a.backSpace()},c.clearToEndOfRow=function(){var a=this.rows[this.currRow];a.clearToEndOfRow()},c.insertChar=function(a){var v=this.rows[this.currRow];v.insertChar(a)},c.setPen=function(a){var v=this.rows[this.currRow];v.setPenStyles(a)},c.moveCursor=function(a){var v=this.rows[this.currRow];v.moveCursor(a)},c.setCursor=function(a){this.logger.log(C.INFO,"setCursor: "+a);var v=this.rows[this.currRow];v.setCursor(a)},c.setPAC=function(a){this.logger.log(C.INFO,"pacData = "+JSON.stringify(a));var v=a.row-1;if(this.nrRollUpRows&&v<this.nrRollUpRows-1&&(v=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==v){for(var p=0;p<U;p++)this.rows[p].clear();var b=this.currRow+1-this.nrRollUpRows,O=this.lastOutputScreen;if(O){var N=O.rows[b].cueStartTime,W=this.logger.time;if(N&&W!==null&&N<W)for(var V=0;V<this.nrRollUpRows;V++)this.rows[v-this.nrRollUpRows+V+1].copy(O.rows[b+V])}}this.currRow=v;var F=this.rows[this.currRow];if(a.indent!==null){var _=a.indent,J=Math.max(_-1,0);F.setCursor(a.indent),a.color=F.chars[J].penState.foreground}var ee={foreground:a.color,underline:a.underline,italics:a.italics,background:"black",flash:!1};this.setPen(ee)},c.setBkgData=function(a){this.logger.log(C.INFO,"bkgData = "+JSON.stringify(a)),this.backSpace(),this.setPen(a),this.insertChar(32)},c.setRollUpRows=function(a){this.nrRollUpRows=a},c.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(C.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(C.TEXT,this.getDisplayText());var a=this.currRow+1-this.nrRollUpRows,v=this.rows.splice(a,1)[0];v.clear(),this.rows.splice(this.currRow,0,v),this.logger.log(C.INFO,"Rolling up")},c.getDisplayText=function(a){a=a||!1;for(var v=[],p="",b=-1,O=0;O<U;O++){var N=this.rows[O].getTextString();N&&(b=O+1,a?v.push("Row "+b+": '"+N+"'"):v.push(N.trim()))}return v.length>0&&(a?p="["+v.join(" | ")+"]":p=v.join(`
`)),p},c.getTextAndFormat=function(){return this.rows},f}(),y=function(){function f(s,a,v){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=s,this.outputFilter=a,this.mode=null,this.verbose=0,this.displayedMemory=new u(v),this.nonDisplayedMemory=new u(v),this.lastOutputScreen=new u(v),this.currRollUpRow=this.displayedMemory.rows[U-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=v}var c=f.prototype;return c.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[U-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},c.getHandler=function(){return this.outputFilter},c.setHandler=function(a){this.outputFilter=a},c.setPAC=function(a){this.writeScreen.setPAC(a)},c.setBkgData=function(a){this.writeScreen.setBkgData(a)},c.setMode=function(a){if(a===this.mode)return;this.mode=a,this.logger.log(C.INFO,"MODE="+a),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=a},c.insertChars=function(a){for(var v=0;v<a.length;v++)this.writeScreen.insertChar(a[v]);var p=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(C.INFO,p+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(C.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},c.ccRCL=function(){this.logger.log(C.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},c.ccBS=function(){if(this.logger.log(C.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},c.ccAOF=function(){},c.ccAON=function(){},c.ccDER=function(){this.logger.log(C.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},c.ccRU=function(a){this.logger.log(C.INFO,"RU("+a+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(a)},c.ccFON=function(){this.logger.log(C.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},c.ccRDC=function(){this.logger.log(C.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},c.ccTR=function(){this.logger.log(C.INFO,"TR"),this.setMode("MODE_TEXT")},c.ccRTD=function(){this.logger.log(C.INFO,"RTD"),this.setMode("MODE_TEXT")},c.ccEDM=function(){this.logger.log(C.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},c.ccCR=function(){this.logger.log(C.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},c.ccENM=function(){this.logger.log(C.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},c.ccEOC=function(){if(this.logger.log(C.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var a=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=a,this.writeScreen=this.nonDisplayedMemory,this.logger.log(C.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},c.ccTO=function(a){this.logger.log(C.INFO,"TO("+a+") - Tab Offset"),this.writeScreen.moveCursor(a)},c.ccMIDROW=function(a){var v={flash:!1};if(v.underline=a%2===1,v.italics=a>=46,v.italics)v.foreground="white";else{var p=Math.floor(a/2)-16,b=["white","green","blue","cyan","red","yellow","magenta"];v.foreground=b[p]}this.logger.log(C.INFO,"MIDROW: "+JSON.stringify(v)),this.writeScreen.setPen(v)},c.outputDataUpdate=function(a){a===void 0&&(a=!1);var v=this.logger.time;if(v===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=v:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,v,this.lastOutputScreen),a&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:v),this.lastOutputScreen.copy(this.displayedMemory))},c.cueSplitAtTime=function(a){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,a,this.displayedMemory),this.cueStartTime=a))},f}(),m=function(){function f(s,a,v){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var p=new S;this.channels=[null,new y(s,a,p),new y(s+1,v,p)],this.cmdHistory=E(),this.logger=p}var c=f.prototype;return c.getHandler=function(a){return this.channels[a].getHandler()},c.setHandler=function(a,v){this.channels[a].setHandler(v)},c.addData=function(a,v){var p,b,O,N=!1;this.logger.time=a;for(var W=0;W<v.length;W+=2){if(b=v[W]&127,O=v[W+1]&127,b===0&&O===0)continue;if(this.logger.log(C.DATA,"["+A([v[W],v[W+1]])+"] -> ("+A([b,O])+")"),p=this.parseCmd(b,O),p||(p=this.parseMidrow(b,O)),p||(p=this.parsePAC(b,O)),p||(p=this.parseBackgroundAttributes(b,O)),!p&&(N=this.parseChars(b,O),N)){var V=this.currentChannel;if(V&&V>0){var F=this.channels[V];F.insertChars(N)}else this.logger.log(C.WARNING,"No channel found yet. TEXT-MODE?")}!p&&!N&&this.logger.log(C.WARNING,"Couldn't parse cleaned data "+A([b,O])+" orig: "+A([v[W],v[W+1]]))}},c.parseCmd=function(a,v){var p=this.cmdHistory,b=(a===20||a===28||a===21||a===29)&&v>=32&&v<=47,O=(a===23||a===31)&&v>=33&&v<=35;if(!(b||O))return!1;if(w(a,v,p))return h(null,null,p),this.logger.log(C.DEBUG,"Repeated command ("+A([a,v])+") is dropped"),!0;var N=a===20||a===21||a===23?1:2,W=this.channels[N];return a===20||a===21||a===28||a===29?v===32?W.ccRCL():v===33?W.ccBS():v===34?W.ccAOF():v===35?W.ccAON():v===36?W.ccDER():v===37?W.ccRU(2):v===38?W.ccRU(3):v===39?W.ccRU(4):v===40?W.ccFON():v===41?W.ccRDC():v===42?W.ccTR():v===43?W.ccRTD():v===44?W.ccEDM():v===45?W.ccCR():v===46?W.ccENM():v===47&&W.ccEOC():W.ccTO(v-32),h(a,v,p),this.currentChannel=N,!0},c.parseMidrow=function(a,v){var p=0;if((a===17||a===25)&&v>=32&&v<=47){if(a===17?p=1:p=2,p!==this.currentChannel)return this.logger.log(C.ERROR,"Mismatch channel in midrow parsing"),!1;var b=this.channels[p];return b?(b.ccMIDROW(v),this.logger.log(C.DEBUG,"MIDROW ("+A([a,v])+")"),!0):!1}return!1},c.parsePAC=function(a,v){var p,b=this.cmdHistory,O=(a>=17&&a<=23||a>=25&&a<=31)&&v>=64&&v<=127,N=(a===16||a===24)&&v>=64&&v<=95;if(!(O||N))return!1;if(w(a,v,b))return h(null,null,b),!0;var W=a<=23?1:2;v>=64&&v<=95?p=W===1?I[a]:g[a]:p=W===1?R[a]:T[a];var V=this.channels[W];return V?(V.setPAC(this.interpretPAC(p,v)),h(a,v,b),this.currentChannel=W,!0):!1},c.interpretPAC=function(a,v){var p,b={color:null,italics:!1,indent:null,underline:!1,row:a};return v>95?p=v-96:p=v-64,b.underline=(p&1)===1,p<=13?b.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(p/2)]:p<=15?(b.italics=!0,b.color="white"):b.indent=Math.floor((p-16)/2)*4,b},c.parseChars=function(a,v){var p,b=null,O=null;if(a>=25?(p=2,O=a-8):(p=1,O=a),O>=17&&O<=19){var N;O===17?N=v+80:O===18?N=v+112:N=v+144,this.logger.log(C.INFO,"Special char '"+M(N)+"' in channel "+p),b=[N]}else a>=32&&a<=127&&(b=v===0?[a]:[a,v]);if(b){var W=A(b);this.logger.log(C.DEBUG,"Char codes = "+W.join(",")),h(a,v,this.cmdHistory)}return b},c.parseBackgroundAttributes=function(a,v){var p=(a===16||a===24)&&v>=32&&v<=47,b=(a===23||a===31)&&v>=45&&v<=47;if(!(p||b))return!1;var O,N={};a===16||a===24?(O=Math.floor((v-32)/2),N.background=L[O],v%2===1&&(N.background=N.background+"_semi")):v===45?N.background="transparent":(N.foreground="black",v===47&&(N.underline=!0));var W=a<=23?1:2,V=this.channels[W];return V.setBkgData(N),h(a,v,this.cmdHistory),!0},c.reset=function(){for(var a=0;a<Object.keys(this.channels).length;a++){var v=this.channels[a];v&&v.reset()}this.cmdHistory=E()},c.cueSplitAtTime=function(a){for(var v=0;v<this.channels.length;v++){var p=this.channels[v];p&&p.cueSplitAtTime(a)}},f}();function h(f,c,s){s.a=f,s.b=c}function w(f,c,s){return s.a===f&&s.b===c}function E(){return{a:null,b:null}}G.default=m},"./src/utils/codecs.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"isCodecType",function(){return P}),D.d(G,"isCodecSupportedInMp4",function(){return M});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 P(U,B){var I=K[B];return!!I&&I[U.slice(0,4)]===!0}function M(U,B){return MediaSource.isTypeSupported((B||"video")+'/mp4;codecs="'+U+'"')}},"./src/utils/cues.ts":function(q,G,D){"use strict";D.r(G);var K=D("./src/utils/vttparser.ts"),P=D("./src/utils/webvtt-parser.ts"),M=D("./src/utils/texttrack-utils.ts"),U=/\s/,B={newCue:function(R,g,T,L){for(var C=[],S,A,d,o,l,u=self.VTTCue||self.TextTrackCue,y=0;y<L.rows.length;y++)if(S=L.rows[y],d=!0,o=0,l="",!S.isEmpty()){for(var m=0;m<S.chars.length;m++)U.test(S.chars[m].uchar)&&d?o++:(l+=S.chars[m].uchar,d=!1);S.cueStartTime=g,g===T&&(T+=1e-4),o>=16?o--:o++;var h=Object(K.fixLineBreaks)(l.trim()),w=Object(P.generateCueId)(g,T,h);(!R||!R.cues||!R.cues.getCueById(w))&&(A=new u(g,T,h),A.id=w,A.line=y+1,A.align="left",A.position=10+Math.min(80,Math.floor(o*8/32)*10),C.push(A))}return R&&C.length&&(C.sort(function(E,f){return E.line==="auto"||f.line==="auto"?0:E.line>8&&f.line>8?f.line-E.line:E.line-f.line}),C.forEach(function(E){return Object(M.addCueToTrack)(R,E)})),C}};G.default=B},"./src/utils/discontinuities.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"findFirstFragWithCC",function(){return U}),D.d(G,"shouldAlignOnDiscontinuities",function(){return B}),D.d(G,"findDiscontinuousReferenceFrag",function(){return I}),D.d(G,"adjustSlidingStart",function(){return g}),D.d(G,"alignStream",function(){return T}),D.d(G,"alignPDT",function(){return C}),D.d(G,"alignFragmentByPDTDelta",function(){return S}),D.d(G,"alignMediaPlaylistByPDT",function(){return A});var K=D("./src/polyfills/number.ts"),P=D("./src/utils/logger.ts"),M=D("./src/controller/level-helper.ts");function U(d,o){for(var l=null,u=0,y=d.length;u<y;u++){var m=d[u];if(m&&m.cc===o){l=m;break}}return l}function B(d,o,l){return!!(o.details&&(l.endCC>l.startCC||d&&d.cc<l.startCC))}function I(d,o){var l=d.fragments,u=o.fragments;if(!u.length||!l.length){P.logger.log("No fragments to align");return}var y=U(l,u[0].cc);if(!y||y&&!y.startPTS){P.logger.log("No frag in previous level to align on");return}return y}function R(d,o){if(d){var l=d.start+o;d.start=d.startPTS=l,d.endPTS=l+d.duration}}function g(d,o){for(var l=o.fragments,u=0,y=l.length;u<y;u++)R(l[u],d);o.fragmentHint&&R(o.fragmentHint,d),o.alignedSliding=!0}function T(d,o,l){if(!o)return;L(d,l,o),!l.alignedSliding&&o.details&&C(l,o.details),!l.alignedSliding&&o.details&&!l.skippedSegments&&Object(M.adjustSliding)(o.details,l)}function L(d,o,l){if(B(d,l,o)){var u=I(l.details,o);u&&Object(K.isFiniteNumber)(u.start)&&(P.logger.log("Adjusting PTS using last level due to CC increase within current level "+o.url),g(u.start,o))}}function C(d,o){if(!o.fragments.length||!d.hasProgramDateTime||!o.hasProgramDateTime)return;var l=o.fragments[0].programDateTime,u=d.fragments[0].programDateTime,y=(u-l)/1e3+o.fragments[0].start;y&&Object(K.isFiniteNumber)(y)&&(P.logger.log("Adjusting PTS using programDateTime delta "+(u-l)+"ms, sliding:"+y.toFixed(3)+" "+d.url+" "),g(y,d))}function S(d,o){var l=d.programDateTime;if(!l)return;var u=(l-o)/1e3;d.start=d.startPTS=u,d.endPTS=u+d.duration}function A(d,o){if(!o.fragments.length||!d.hasProgramDateTime||!o.hasProgramDateTime)return;var l=o.fragments[0].programDateTime,u=o.fragments[0].start,y=l-u*1e3;d.fragments.forEach(function(m){S(m,y)}),d.fragmentHint&&S(d.fragmentHint,y),d.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(q,G,D){"use strict";D.r(G);var K=D("./src/utils/ewma.ts"),P=function(){function M(B,I,R){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=R,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new K.default(B),this.fast_=new K.default(I)}var U=M.prototype;return U.update=function(I,R){var g=this.slow_,T=this.fast_;this.slow_.halfLife!==I&&(this.slow_=new K.default(I,g.getEstimate(),g.getTotalWeight())),this.fast_.halfLife!==R&&(this.fast_=new K.default(R,T.getEstimate(),T.getTotalWeight()))},U.sample=function(I,R){I=Math.max(I,this.minDelayMs_);var g=8*R,T=I/1e3,L=g/T;this.fast_.sample(T,L),this.slow_.sample(T,L)},U.canEstimate=function(){var I=this.fast_;return I&&I.getTotalWeight()>=this.minWeight_},U.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},U.destroy=function(){},M}();G.default=P},"./src/utils/ewma.ts":function(q,G,D){"use strict";D.r(G);var K=function(){function P(U,B,I){B===void 0&&(B=0),I===void 0&&(I=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_=B,this.totalWeight_=I}var M=P.prototype;return M.sample=function(B,I){var R=Math.pow(this.alpha_,B);this.estimate_=I*(1-R)+R*this.estimate_,this.totalWeight_+=B},M.getTotalWeight=function(){return this.totalWeight_},M.getEstimate=function(){if(this.alpha_){var B=1-Math.pow(this.alpha_,this.totalWeight_);if(B)return this.estimate_/B}return this.estimate_},P}();G.default=K},"./src/utils/fetch-loader.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"fetchSupported",function(){return S});var K=D("./src/polyfills/number.ts"),P=D("./src/loader/load-stats.ts"),M=D("./src/demux/chunk-cache.ts");function U(u,y){u.prototype=Object.create(y.prototype),u.prototype.constructor=u,T(u,y)}function B(u){var y=typeof Map=="function"?new Map:void 0;return B=function(h){if(h===null||!g(h))return h;if(typeof h!="function")throw new TypeError("Super expression must either be null or a function");if(typeof y!="undefined"){if(y.has(h))return y.get(h);y.set(h,w)}function w(){return I(h,arguments,L(this).constructor)}return w.prototype=Object.create(h.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),T(w,h)},B(u)}function I(u,y,m){return R()?I=Reflect.construct:I=function(w,E,f){var c=[null];c.push.apply(c,E);var s=Function.bind.apply(w,c),a=new s;return f&&T(a,f.prototype),a},I.apply(null,arguments)}function R(){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(u){return!1}}function g(u){return Function.toString.call(u).indexOf("[native code]")!==-1}function T(u,y){return T=Object.setPrototypeOf||function(h,w){return h.__proto__=w,h},T(u,y)}function L(u){return L=Object.setPrototypeOf?Object.getPrototypeOf:function(m){return m.__proto__||Object.getPrototypeOf(m)},L(u)}function C(){return C=Object.assign||function(u){for(var y=1;y<arguments.length;y++){var m=arguments[y];for(var h in m)Object.prototype.hasOwnProperty.call(m,h)&&(u[h]=m[h])}return u},C.apply(this,arguments)}function S(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(u){}return!1}var A=function(){function u(m){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=void 0,this.response=void 0,this.controller=void 0,this.context=void 0,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=m.fetchSetup||o,this.controller=new self.AbortController,this.stats=new P.LoadStats}var y=u.prototype;return y.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},y.abortInternal=function(){var h=this.response;(!h||!h.ok)&&(this.stats.aborted=!0,this.controller.abort())},y.abort=function(){var h;this.abortInternal(),(h=this.callbacks)!==null&&h!==void 0&&h.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},y.load=function(h,w,E){var f=this,c=this.stats;if(c.loading.start)throw new Error("Loader can only be used once.");c.loading.start=self.performance.now();var s=d(h,this.controller.signal),a=E.onProgress,v=h.responseType==="arraybuffer",p=v?"byteLength":"length";this.context=h,this.config=w,this.callbacks=E,this.request=this.fetchSetup(h,s),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){f.abortInternal(),E.onTimeout(c,h,f.response)},w.timeout),self.fetch(this.request).then(function(b){if(f.response=f.loader=b,!b.ok){var O=b.status,N=b.statusText;throw new l(N||"fetch, bad network response",O,b)}return c.loading.first=Math.max(self.performance.now(),c.loading.start),c.total=parseInt(b.headers.get("Content-Length")||"0"),a&&Object(K.isFiniteNumber)(w.highWaterMark)?f.loadProgressively(b,c,h,w.highWaterMark,a):v?b.arrayBuffer():b.text()}).then(function(b){var O=f.response;self.clearTimeout(f.requestTimeout),c.loading.end=Math.max(self.performance.now(),c.loading.first),c.loaded=c.total=b[p];var N={url:O.url,data:b};a&&!Object(K.isFiniteNumber)(w.highWaterMark)&&a(c,h,b,O),E.onSuccess(N,c,h,O)}).catch(function(b){if(self.clearTimeout(f.requestTimeout),c.aborted)return;var O=b.code||0;E.onError({code:O,text:b.message},h,b.details)})},y.getCacheAge=function(){var h=null;if(this.response){var w=this.response.headers.get("age");h=w?parseFloat(w):null}return h},y.loadProgressively=function(h,w,E,f,c){f===void 0&&(f=0);var s=new M.default,a=h.body.getReader(),v=function p(){return a.read().then(function(b){if(b.done)return s.dataLength&&c(w,E,s.flush(),h),Promise.resolve(new ArrayBuffer(0));var O=b.value,N=O.length;return w.loaded+=N,N<f||s.dataLength?(s.push(O),s.dataLength>=f&&c(w,E,s.flush(),h)):c(w,E,O,h),p()}).catch(function(){return Promise.reject()})};return v()},u}();function d(u,y){var m={method:"GET",mode:"cors",credentials:"same-origin",signal:y,headers:new self.Headers(C({},u.headers))};return u.rangeEnd&&m.headers.set("Range","bytes="+u.rangeStart+"-"+String(u.rangeEnd-1)),m}function o(u,y){return new self.Request(u.url,y)}var l=function(u){U(y,u);function y(m,h,w){var E;return E=u.call(this,m)||this,E.code=void 0,E.details=void 0,E.code=h,E.details=w,E}return y}(B(Error));G.default=A},"./src/utils/imsc1-ttml-parser.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"IMSC1_CODEC",function(){return g}),D.d(G,"parseIMSC1",function(){return S});var K=D("./src/utils/mp4-tools.ts"),P=D("./src/utils/vttparser.ts"),M=D("./src/utils/vttcue.ts"),U=D("./src/demux/id3.ts"),B=D("./src/utils/timescale-conversion.ts"),I=D("./src/utils/webvtt-parser.ts");function R(){return R=Object.assign||function(f){for(var c=1;c<arguments.length;c++){var s=arguments[c];for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(f[a]=s[a])}return f},R.apply(this,arguments)}var g="stpp.ttml.im1t",T=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,L=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,C={left:"start",center:"center",right:"end",start:"start",end:"end"};function S(f,c,s,a,v){var p=Object(K.findBox)(new Uint8Array(f),["mdat"]);if(p.length===0){v(new Error("Could not parse IMSC1 mdat"));return}var b=p[0],O=Object(U.utf8ArrayToStr)(new Uint8Array(f,b.start,b.end-b.start)),N=Object(B.toTimescaleFromScale)(c,1,s);try{a(A(O,N))}catch(W){v(W)}}function A(f,c){var s=new DOMParser,a=s.parseFromString(f,"text/xml"),v=a.getElementsByTagName("tt")[0];if(!v)throw new Error("Invalid ttml");var p={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},b=Object.keys(p).reduce(function(F,_){return F[_]=v.getAttribute("ttp:"+_)||p[_],F},{}),O=v.getAttribute("xml:space")!=="preserve",N=o(d(v,"styling","style")),W=o(d(v,"layout","region")),V=d(v,"body","[begin]");return[].map.call(V,function(F){var _=l(F,O);if(!_||!F.hasAttribute("begin"))return null;var J=h(F.getAttribute("begin"),b),ee=h(F.getAttribute("dur"),b),oe=h(F.getAttribute("end"),b);if(J===null)throw m(F);if(oe===null){if(ee===null)throw m(F);oe=J+ee}var de=new M.default(J-c,oe-c,_);de.id=Object(I.generateCueId)(de.startTime,de.endTime,de.text);var Ce=W[F.getAttribute("region")],ge=N[F.getAttribute("style")];de.position=10,de.size=80;var pe=u(Ce,ge),ce=pe.textAlign;if(ce){var he=C[ce];he&&(de.lineAlign=he),de.align=ce}return R(de,pe),de}).filter(function(F){return F!==null})}function d(f,c,s){var a=f.getElementsByTagName(c)[0];return a?[].slice.call(a.querySelectorAll(s)):[]}function o(f){return f.reduce(function(c,s){var a=s.getAttribute("xml:id");return a&&(c[a]=s),c},{})}function l(f,c){return[].slice.call(f.childNodes).reduce(function(s,a,v){var p;return a.nodeName==="br"&&v?s+`
`:(p=a.childNodes)!==null&&p!==void 0&&p.length?l(a,c):c?s+a.textContent.trim().replace(/\s+/g," "):s+a.textContent},"")}function u(f,c){var s="http://www.w3.org/ns/ttml#styling",a=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return a.reduce(function(v,p){var b=y(c,s,p)||y(f,s,p);return b&&(v[p]=b),v},{})}function y(f,c,s){return f.hasAttributeNS(c,s)?f.getAttributeNS(c,s):null}function m(f){return new Error("Could not parse ttml timestamp "+f)}function h(f,c){if(!f)return null;var s=Object(P.parseTimeStamp)(f);return s===null&&(T.test(f)?s=w(f,c):L.test(f)&&(s=E(f,c))),s}function w(f,c){var s=T.exec(f),a=(s[4]|0)+(s[5]|0)/c.subFrameRate;return(s[1]|0)*3600+(s[2]|0)*60+(s[3]|0)+a/c.frameRate}function E(f,c){var s=L.exec(f),a=Number(s[1]),v=s[2];switch(v){case"h":return a*3600;case"m":return a*60;case"ms":return a*1e3;case"f":return a/c.frameRate;case"t":return a/c.tickRate}return a}},"./src/utils/logger.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"enableLogs",function(){return I}),D.d(G,"logger",function(){return R});var K=function(){},P={trace:K,debug:K,log:K,warn:K,info:K,error:K},M=P;function U(g){var T=self.console[g];return T?T.bind(self.console,"["+g+"] >"):K}function B(g){for(var T=arguments.length,L=new Array(T>1?T-1:0),C=1;C<T;C++)L[C-1]=arguments[C];L.forEach(function(S){M[S]=g[S]?g[S].bind(g):U(S)})}function I(g){if(self.console&&g===!0||typeof g=="object"){B(g,"debug","log","info","warn","error");try{M.log()}catch(T){M=P}}else M=P}var R=M},"./src/utils/mediakeys-helper.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"KeySystems",function(){return K}),D.d(G,"requestMediaKeySystemAccess",function(){return P});var K;(function(M){M.WIDEVINE="com.widevine.alpha",M.PLAYREADY="com.microsoft.playready"})(K||(K={}));var P=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,D){"use strict";D.r(G),D.d(G,"getMediaSource",function(){return K});function K(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"bin2str",function(){return B}),D.d(G,"readUint16",function(){return I}),D.d(G,"readUint32",function(){return R}),D.d(G,"writeUint32",function(){return g}),D.d(G,"findBox",function(){return T}),D.d(G,"parseSegmentIndex",function(){return L}),D.d(G,"parseInitSegment",function(){return C}),D.d(G,"getStartDTS",function(){return S}),D.d(G,"getDuration",function(){return A}),D.d(G,"computeRawDurationFromSamples",function(){return d}),D.d(G,"offsetStartDTS",function(){return o}),D.d(G,"segmentValidRange",function(){return l}),D.d(G,"appendUint8Array",function(){return u});var K=D("./src/utils/typed-array.ts"),P=D("./src/loader/fragment.ts"),M=Math.pow(2,32)-1,U=[].push;function B(y){return String.fromCharCode.apply(null,y)}function I(y,m){"data"in y&&(m+=y.start,y=y.data);var h=y[m]<<8|y[m+1];return h<0?65536+h:h}function R(y,m){"data"in y&&(m+=y.start,y=y.data);var h=y[m]<<24|y[m+1]<<16|y[m+2]<<8|y[m+3];return h<0?4294967296+h:h}function g(y,m,h){"data"in y&&(m+=y.start,y=y.data),y[m]=h>>24,y[m+1]=h>>16&255,y[m+2]=h>>8&255,y[m+3]=h&255}function T(y,m){var h=[];if(!m.length)return h;var w,E,f;"data"in y?(w=y.data,E=y.start,f=y.end):(w=y,E=0,f=w.byteLength);for(var c=E;c<f;){var s=R(w,c),a=B(w.subarray(c+4,c+8)),v=s>1?c+s:f;if(a===m[0])if(m.length===1)h.push({data:w,start:c+8,end:v});else{var p=T({data:w,start:c+8,end:v},m.slice(1));p.length&&U.apply(h,p)}c=v}return h}function L(y){var m=T(y,["moov"]),h=m[0],w=h?h.end:null,E=T(y,["sidx"]);if(!E||!E[0])return null;var f=[],c=E[0],s=c.data[0],a=s===0?8:16,v=R(c,a);a+=4;var p=0,b=0;s===0?a+=8:a+=16,a+=2;var O=c.end+b,N=I(c,a);a+=2;for(var W=0;W<N;W++){var V=a,F=R(c,V);V+=4;var _=F&2147483647,J=(F&2147483648)>>>31;if(J===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var ee=R(c,V);V+=4,f.push({referenceSize:_,subsegmentDuration:ee,info:{duration:ee/v,start:O,end:O+_-1}}),O+=_,V+=4,a=V}return{earliestPresentationTime:p,timescale:v,version:s,referencesCount:N,references:f,moovEndOffset:w}}function C(y){for(var m=[],h=T(y,["moov","trak"]),w=0;w<h.length;w++){var E=h[w],f=T(E,["tkhd"])[0];if(f){var c=f.data[f.start],s=c===0?12:20,a=R(f,s),v=T(E,["mdia","mdhd"])[0];if(v){c=v.data[v.start],s=c===0?12:20;var p=R(v,s),b=T(E,["mdia","hdlr"])[0];if(b){var O=B(b.data.subarray(b.start+8,b.start+12)),N={soun:P.ElementaryStreamTypes.AUDIO,vide:P.ElementaryStreamTypes.VIDEO}[O];if(N){var W=T(E,["mdia","minf","stbl","stsd"])[0],V=void 0;W&&(V=B(W.data.subarray(W.start+12,W.start+16))),m[a]={timescale:p,type:N},m[N]={timescale:p,id:a,codec:V}}}}}}var F=T(y,["moov","mvex","trex"]);return F.forEach(function(_){var J=R(_,4),ee=m[J];ee&&(ee.default={duration:R(_,12),flags:R(_,20)})}),m}function S(y,m){return T(m,["moof","traf"]).reduce(function(h,w){var E=T(w,["tfdt"])[0],f=E.data[E.start],c=T(w,["tfhd"]).reduce(function(s,a){var v=R(a,4),p=y[v];if(p){var b=R(E,4);f===1&&(b*=Math.pow(2,32),b+=R(E,8));var O=p.timescale||9e4,N=b/O;if(isFinite(N)&&(s===null||N<s))return N}return s},null);return c!==null&&isFinite(c)&&(h===null||c<h)?c:h},null)||0}function A(y,m){for(var h=0,w=0,E=0,f=T(y,["moof","traf"]),c=0;c<f.length;c++){var s=f[c],a=T(s,["tfhd"])[0],v=R(a,4),p=m[v];if(!p)continue;var b=p.default,O=R(a,0)|(b==null?void 0:b.flags),N=b==null?void 0:b.duration;O&8&&(O&2?N=R(a,12):N=R(a,8));for(var W=p.timescale||9e4,V=T(s,["trun"]),F=0;F<V.length;F++){if(N){var _=R(V[F],4);h=N*_}else h=d(V[F]);p.type===P.ElementaryStreamTypes.VIDEO?w+=h/W:p.type===P.ElementaryStreamTypes.AUDIO&&(E+=h/W)}}if(w===0&&E===0){var J=L(y);if(J!=null&&J.references)return J.references.reduce(function(ee,oe){return ee+oe.info.duration||0},0)}return w||E}function d(y){var m=R(y,0),h=8;m&1&&(h+=4),m&4&&(h+=4);for(var w=0,E=R(y,4),f=0;f<E;f++){if(m&256){var c=R(y,h);w+=c,h+=4}m&512&&(h+=4),m&1024&&(h+=4),m&2048&&(h+=4)}return w}function o(y,m,h){T(m,["moof","traf"]).forEach(function(w){T(w,["tfhd"]).forEach(function(E){var f=R(E,4),c=y[f];if(!c)return;var s=c.timescale||9e4;T(w,["tfdt"]).forEach(function(a){var v=a.data[a.start],p=R(a,4);if(v===0)g(a,4,p-h*s);else{p*=Math.pow(2,32),p+=R(a,8),p-=h*s,p=Math.max(p,0);var b=Math.floor(p/(M+1)),O=Math.floor(p%(M+1));g(a,4,b),g(a,8,O)}})})})}function l(y){var m={valid:null,remainder:null},h=T(y,["moof"]);if(h){if(h.length<2)return m.remainder=y,m}else return m;var w=h[h.length-1];return m.valid=Object(K.sliceUint8)(y,0,w.start-8),m.remainder=Object(K.sliceUint8)(y,w.start-8),m}function u(y,m){var h=new Uint8Array(y.length+m.length);return h.set(y),h.set(m,y.length),h}},"./src/utils/output-filter.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"default",function(){return K});var K=function(){function P(U,B){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=U,this.trackName=B}var M=P.prototype;return M.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},M.newCue=function(B,I,R){(this.startTime===null||this.startTime>B)&&(this.startTime=B),this.endTime=I,this.screen=R,this.timelineController.createCaptionsTrack(this.trackName)},M.reset=function(){this.cueRanges=[]},P}()},"./src/utils/texttrack-utils.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"sendAddTrackEvent",function(){return P}),D.d(G,"addCueToTrack",function(){return M}),D.d(G,"clearCurrentCues",function(){return U}),D.d(G,"removeCuesInRange",function(){return B}),D.d(G,"getCuesInRange",function(){return R});var K=D("./src/utils/logger.ts");function P(g,T){var L;try{L=new Event("addtrack")}catch(C){L=document.createEvent("Event"),L.initEvent("addtrack",!1,!1)}L.track=g,T.dispatchEvent(L)}function M(g,T){var L=g.mode;if(L==="disabled"&&(g.mode="hidden"),g.cues&&!g.cues.getCueById(T.id))try{if(g.addCue(T),!g.cues.getCueById(T.id))throw new Error("addCue is failed for: "+T)}catch(S){K.logger.debug("[texttrack-utils]: "+S);var C=new self.TextTrackCue(T.startTime,T.endTime,T.text);C.id=T.id,g.addCue(C)}L==="disabled"&&(g.mode=L)}function U(g){var T=g.mode;if(T==="disabled"&&(g.mode="hidden"),g.cues)for(var L=g.cues.length;L--;)g.removeCue(g.cues[L]);T==="disabled"&&(g.mode=T)}function B(g,T,L){var C=g.mode;if(C==="disabled"&&(g.mode="hidden"),g.cues&&g.cues.length>0)for(var S=R(g.cues,T,L),A=0;A<S.length;A++)g.removeCue(S[A]);C==="disabled"&&(g.mode=C)}function I(g,T){if(T<g[0].startTime)return 0;var L=g.length-1;if(T>g[L].endTime)return-1;for(var C=0,S=L;C<=S;){var A=Math.floor((S+C)/2);if(T<g[A].startTime)S=A-1;else if(T>g[A].startTime&&C<L)C=A+1;else return A}return g[C].startTime-T<T-g[S].startTime?C:S}function R(g,T,L){var C=[],S=I(g,T);if(S>-1)for(var A=S,d=g.length;A<d;A++){var o=g[A];if(o.startTime>=T&&o.endTime<=L)C.push(o);else if(o.startTime>L)return C}return C}},"./src/utils/time-ranges.ts":function(q,G,D){"use strict";D.r(G);var K={toString:function(M){for(var U="",B=M.length,I=0;I<B;I++)U+="["+M.start(I).toFixed(3)+","+M.end(I).toFixed(3)+"]";return U}};G.default=K},"./src/utils/timescale-conversion.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"toTimescaleFromBase",function(){return P}),D.d(G,"toTimescaleFromScale",function(){return M}),D.d(G,"toMsFromMpegTsClock",function(){return U}),D.d(G,"toMpegTsClockFromTimescale",function(){return B});var K=9e4;function P(I,R,g,T){g===void 0&&(g=1),T===void 0&&(T=!1);var L=I*R*g;return T?Math.round(L):L}function M(I,R,g,T){return g===void 0&&(g=1),T===void 0&&(T=!1),P(I,R,1/g,T)}function U(I,R){return R===void 0&&(R=!1),P(I,1e3,1/K,R)}function B(I,R){return R===void 0&&(R=1),P(I,K,1/R)}},"./src/utils/typed-array.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"sliceUint8",function(){return K});function K(P,M,U){return Uint8Array.prototype.slice?P.slice(M,U):new Uint8Array(Array.prototype.slice.call(P,M,U))}},"./src/utils/vttcue.ts":function(q,G,D){"use strict";D.r(G),G.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var K=["","lr","rl"],P=["start","middle","end","left","right"];function M(g,T){if(typeof T!="string")return!1;if(!Array.isArray(g))return!1;var L=T.toLowerCase();return~g.indexOf(L)?L:!1}function U(g){return M(K,g)}function B(g){return M(P,g)}function I(g){for(var T=arguments.length,L=new Array(T>1?T-1:0),C=1;C<T;C++)L[C-1]=arguments[C];for(var S=1;S<arguments.length;S++){var A=arguments[S];for(var d in A)g[d]=A[d]}return g}function R(g,T,L){var C=this,S={enumerable:!0};C.hasBeenReset=!1;var A="",d=!1,o=g,l=T,u=L,y=null,m="",h=!0,w="auto",E="start",f=50,c="middle",s=50,a="middle";Object.defineProperty(C,"id",I({},S,{get:function(){return A},set:function(p){A=""+p}})),Object.defineProperty(C,"pauseOnExit",I({},S,{get:function(){return d},set:function(p){d=!!p}})),Object.defineProperty(C,"startTime",I({},S,{get:function(){return o},set:function(p){if(typeof p!="number")throw new TypeError("Start time must be set to a number.");o=p,this.hasBeenReset=!0}})),Object.defineProperty(C,"endTime",I({},S,{get:function(){return l},set:function(p){if(typeof p!="number")throw new TypeError("End time must be set to a number.");l=p,this.hasBeenReset=!0}})),Object.defineProperty(C,"text",I({},S,{get:function(){return u},set:function(p){u=""+p,this.hasBeenReset=!0}})),Object.defineProperty(C,"region",I({},S,{get:function(){return y},set:function(p){y=p,this.hasBeenReset=!0}})),Object.defineProperty(C,"vertical",I({},S,{get:function(){return m},set:function(p){var b=U(p);if(b===!1)throw new SyntaxError("An invalid or illegal string was specified.");m=b,this.hasBeenReset=!0}})),Object.defineProperty(C,"snapToLines",I({},S,{get:function(){return h},set:function(p){h=!!p,this.hasBeenReset=!0}})),Object.defineProperty(C,"line",I({},S,{get:function(){return w},set:function(p){if(typeof p!="number"&&p!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");w=p,this.hasBeenReset=!0}})),Object.defineProperty(C,"lineAlign",I({},S,{get:function(){return E},set:function(p){var b=B(p);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");E=b,this.hasBeenReset=!0}})),Object.defineProperty(C,"position",I({},S,{get:function(){return f},set:function(p){if(p<0||p>100)throw new Error("Position must be between 0 and 100.");f=p,this.hasBeenReset=!0}})),Object.defineProperty(C,"positionAlign",I({},S,{get:function(){return c},set:function(p){var b=B(p);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");c=b,this.hasBeenReset=!0}})),Object.defineProperty(C,"size",I({},S,{get:function(){return s},set:function(p){if(p<0||p>100)throw new Error("Size must be between 0 and 100.");s=p,this.hasBeenReset=!0}})),Object.defineProperty(C,"align",I({},S,{get:function(){return a},set:function(p){var b=B(p);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");a=b,this.hasBeenReset=!0}})),C.displayState=void 0}return R.prototype.getCueAsHTML=function(){var g=self.WebVTT;return g.convertCueToDOMTree(self,this.text)},R}()},"./src/utils/vttparser.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"parseTimeStamp",function(){return M}),D.d(G,"fixLineBreaks",function(){return T}),D.d(G,"VTTParser",function(){return L});var K=D("./src/utils/vttcue.ts"),P=function(){function C(){}var S=C.prototype;return S.decode=function(d,o){if(!d)return"";if(typeof d!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(d))},C}();function M(C){function S(d,o,l,u){return(d|0)*3600+(o|0)*60+(l|0)+parseFloat(u||0)}var A=C.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return A?parseFloat(A[2])>59?S(A[2],A[3],0,A[4]):S(A[1],A[2],A[3],A[4]):null}var U=function(){function C(){this.values=Object.create(null)}var S=C.prototype;return S.set=function(d,o){!this.get(d)&&o!==""&&(this.values[d]=o)},S.get=function(d,o,l){return l?this.has(d)?this.values[d]:o[l]:this.has(d)?this.values[d]:o},S.has=function(d){return d in this.values},S.alt=function(d,o,l){for(var u=0;u<l.length;++u)if(o===l[u]){this.set(d,o);break}},S.integer=function(d,o){/^-?\d+$/.test(o)&&this.set(d,parseInt(o,10))},S.percent=function(d,o){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(o)){var l=parseFloat(o);if(l>=0&&l<=100)return this.set(d,l),!0}return!1},C}();function B(C,S,A,d){var o=d?C.split(d):[C];for(var l in o){if(typeof o[l]!="string")continue;var u=o[l].split(A);if(u.length!==2)continue;var y=u[0],m=u[1];S(y,m)}}var I=new K.default(0,0,""),R=I.align==="middle"?"middle":"center";function g(C,S,A){var d=C;function o(){var y=M(C);if(y===null)throw new Error("Malformed timestamp: "+d);return C=C.replace(/^[^\sa-zA-Z-]+/,""),y}function l(y,m){var h=new U;B(y,function(f,c){var s;switch(f){case"region":for(var a=A.length-1;a>=0;a--)if(A[a].id===c){h.set(f,A[a].region);break}break;case"vertical":h.alt(f,c,["rl","lr"]);break;case"line":s=c.split(","),h.integer(f,s[0]),h.percent(f,s[0])&&h.set("snapToLines",!1),h.alt(f,s[0],["auto"]),s.length===2&&h.alt("lineAlign",s[1],["start",R,"end"]);break;case"position":s=c.split(","),h.percent(f,s[0]),s.length===2&&h.alt("positionAlign",s[1],["start",R,"end","line-left","line-right","auto"]);break;case"size":h.percent(f,c);break;case"align":h.alt(f,c,["start",R,"end","left","right"]);break}},/:/,/\s/),m.region=h.get("region",null),m.vertical=h.get("vertical","");var w=h.get("line","auto");w==="auto"&&I.line===-1&&(w=-1),m.line=w,m.lineAlign=h.get("lineAlign","start"),m.snapToLines=h.get("snapToLines",!0),m.size=h.get("size",100),m.align=h.get("align",R);var E=h.get("position","auto");E==="auto"&&I.position===50&&(E=m.align==="start"||m.align==="left"?0:m.align==="end"||m.align==="right"?100:50),m.position=E}function u(){C=C.replace(/^\s+/,"")}if(u(),S.startTime=o(),u(),C.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+d);C=C.substr(3),u(),S.endTime=o(),u(),l(C,S)}function T(C){return C.replace(/<br(?: \/)?>/gi,`
`)}var L=function(){function C(){this.state="INITIAL",this.buffer="",this.decoder=new P,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var S=C.prototype;return S.parse=function(d){var o=this;d&&(o.buffer+=o.decoder.decode(d,{stream:!0}));function l(){var E=o.buffer,f=0;for(E=T(E);f<E.length&&E[f]!=="\r"&&E[f]!==`
`;)++f;var c=E.substr(0,f);return E[f]==="\r"&&++f,E[f]===`
`&&++f,o.buffer=E.substr(f),c}function u(E){B(E,function(f,c){},/:/)}try{var y="";if(o.state==="INITIAL"){if(!/\r\n|\n/.test(o.buffer))return this;y=l();var m=y.match(/^()?WEBVTT([ \t].*)?$/);if(!m||!m[0])throw new Error("Malformed WebVTT signature.");o.state="HEADER"}for(var h=!1;o.buffer;){if(!/\r\n|\n/.test(o.buffer))return this;h?h=!1:y=l();switch(o.state){case"HEADER":/:/.test(y)?u(y):y||(o.state="ID");continue;case"NOTE":y||(o.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(y)){o.state="NOTE";break}if(!y)continue;if(o.cue=new K.default(0,0,""),o.state="CUE",y.indexOf("-->")===-1){o.cue.id=y;continue}case"CUE":if(!o.cue){o.state="BADCUE";continue}try{g(y,o.cue,o.regionList)}catch(E){o.cue=null,o.state="BADCUE";continue}o.state="CUETEXT";continue;case"CUETEXT":{var w=y.indexOf("-->")!==-1;if(!y||w&&(h=!0)){o.oncue&&o.cue&&o.oncue(o.cue),o.cue=null,o.state="ID";continue}if(o.cue===null)continue;o.cue.text&&(o.cue.text+=`
`),o.cue.text+=y}continue;case"BADCUE":y||(o.state="ID")}}}catch(E){o.state==="CUETEXT"&&o.cue&&o.oncue&&o.oncue(o.cue),o.cue=null,o.state=o.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},S.flush=function(){var d=this;try{if((d.cue||d.state==="HEADER")&&(d.buffer+=`
`,d.parse()),d.state==="INITIAL"||d.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(o){d.onparsingerror&&d.onparsingerror(o)}return d.onflush&&d.onflush(),this},C}()},"./src/utils/webvtt-parser.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"generateCueId",function(){return L}),D.d(G,"parseWebVTT",function(){return S});var K=D("./src/polyfills/number.ts"),P=D("./src/utils/vttparser.ts"),M=D("./src/demux/id3.ts"),U=D("./src/utils/timescale-conversion.ts"),B=D("./src/remux/mp4-remuxer.ts"),I=/\r\n|\n\r|\n|\r/g,R=function(d,o,l){return l===void 0&&(l=0),d.substr(l,o.length)===o},g=function(d){var o=parseInt(d.substr(-3)),l=parseInt(d.substr(-6,2)),u=parseInt(d.substr(-9,2)),y=d.length>9?parseInt(d.substr(0,d.indexOf(":"))):0;if(!Object(K.isFiniteNumber)(o)||!Object(K.isFiniteNumber)(l)||!Object(K.isFiniteNumber)(u)||!Object(K.isFiniteNumber)(y))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+d);return o+=1e3*l,o+=60*1e3*u,o+=60*60*1e3*y,o},T=function(d){for(var o=5381,l=d.length;l;)o=o*33^d.charCodeAt(--l);return(o>>>0).toString()};function L(A,d,o){return T(A.toString())+T(d.toString())+T(o)}var C=function(d,o,l){var u=d[o],y=d[u.prevCC];if(!y||!y.new&&u.new){d.ccOffset=d.presentationOffset=u.start,u.new=!1;return}for(;(m=y)!==null&&m!==void 0&&m.new;){var m;d.ccOffset+=u.start-y.start,u.new=!1,u=y,y=d[u.prevCC]}d.presentationOffset=l};function S(A,d,o,l,u,y,m,h){var w=new P.VTTParser,E=Object(M.utf8ArrayToStr)(new Uint8Array(A)).trim().replace(I,`
`).split(`
`),f=[],c=Object(U.toMpegTsClockFromTimescale)(d,o),s="00:00.000",a=0,v=0,p,b=!0,O=!1;w.oncue=function(N){var W=l[u],V=l.ccOffset,F=(a-c)/9e4;if(W!=null&&W.new&&(v!==void 0?V=l.ccOffset=W.start:C(l,u,F)),F&&(V=F-l.presentationOffset),O){var _=N.endTime-N.startTime,J=Object(B.normalizePts)((N.startTime+V-v)*9e4,y*9e4)/9e4;N.startTime=J,N.endTime=J+_}var ee=N.text.trim();N.text=decodeURIComponent(encodeURIComponent(ee)),N.id||(N.id=L(N.startTime,N.endTime,ee)),N.endTime>0&&f.push(N)},w.onparsingerror=function(N){p=N},w.onflush=function(){if(p){h(p);return}m(f)},E.forEach(function(N){if(b)if(R(N,"X-TIMESTAMP-MAP=")){b=!1,O=!0,N.substr(16).split(",").forEach(function(W){R(W,"LOCAL:")?s=W.substr(6):R(W,"MPEGTS:")&&(a=parseInt(W.substr(7)))});try{v=g(s)/1e3}catch(W){O=!1,p=W}return}else N===""&&(b=!1);w.parse(N+`
`)}),w.flush()}},"./src/utils/xhr-loader.ts":function(q,G,D){"use strict";D.r(G);var K=D("./src/utils/logger.ts"),P=D("./src/loader/load-stats.ts"),M=/^age:\s*[\d.]+\s*$/m,U=function(){function B(R){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=R?R.xhrSetup:null,this.stats=new P.LoadStats,this.retryDelay=0}var I=B.prototype;return I.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},I.abortInternal=function(){var g=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),g&&(g.onreadystatechange=null,g.onprogress=null,g.readyState!==4&&(this.stats.aborted=!0,g.abort()))},I.abort=function(){var g;this.abortInternal(),(g=this.callbacks)!==null&&g!==void 0&&g.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},I.load=function(g,T,L){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=g,this.config=T,this.callbacks=L,this.retryDelay=T.retryDelay,this.loadInternal()},I.loadInternal=function(){var g=this.config,T=this.context;if(!g)return;var L=this.loader=new self.XMLHttpRequest,C=this.stats;C.loading.first=0,C.loaded=0;var S=this.xhrSetup;try{if(S)try{S(L,T.url)}catch(o){L.open("GET",T.url,!0),S(L,T.url)}L.readyState||L.open("GET",T.url,!0);var A=this.context.headers;if(A)for(var d in A)L.setRequestHeader(d,A[d])}catch(o){this.callbacks.onError({code:L.status,text:o.message},T,L);return}T.rangeEnd&&L.setRequestHeader("Range","bytes="+T.rangeStart+"-"+(T.rangeEnd-1)),L.onreadystatechange=this.readystatechange.bind(this),L.onprogress=this.loadprogress.bind(this),L.responseType=T.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),g.timeout),L.send()},I.readystatechange=function(){var g=this.context,T=this.loader,L=this.stats;if(!g||!T)return;var C=T.readyState,S=this.config;if(L.aborted)return;if(C>=2)if(self.clearTimeout(this.requestTimeout),L.loading.first===0&&(L.loading.first=Math.max(self.performance.now(),L.loading.start)),C===4){T.onreadystatechange=null,T.onprogress=null;var A=T.status;if(A>=200&&A<300){L.loading.end=Math.max(self.performance.now(),L.loading.first);var d,o;if(g.responseType==="arraybuffer"?(d=T.response,o=d.byteLength):(d=T.responseText,o=d.length),L.loaded=L.total=o,!this.callbacks)return;var l=this.callbacks.onProgress;if(l&&l(L,g,d,T),!this.callbacks)return;var u={url:T.responseURL,data:d};this.callbacks.onSuccess(u,L,g,T)}else L.retry>=S.maxRetry||A>=400&&A<499?(K.logger.error(A+" while loading "+g.url),this.callbacks.onError({code:A,text:T.statusText},g,T)):(K.logger.warn(A+" while loading "+g.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,S.maxRetryDelay),L.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),S.timeout)},I.loadtimeout=function(){K.logger.warn("timeout while loading "+this.context.url);var g=this.callbacks;g&&(this.abortInternal(),g.onTimeout(this.stats,this.context,this.loader))},I.loadprogress=function(g){var T=this.stats;T.loaded=g.loaded,g.lengthComputable&&(T.total=g.total)},I.getCacheAge=function(){var g=null;if(this.loader&&M.test(this.loader.getAllResponseHeaders())){var T=this.loader.getResponseHeader("age");g=T?parseFloat(T):null}return g},B}();G.default=U}}).default})},yslc:function(we,Ae){we.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALoAAABSCAYAAADjGc4eAAAOHklEQVR4Xu1dCXQURRr+emZyTO6D3BCEgKCInCKeK3IoiyIqlxLyQBRBV8DNhCCrS3Z9Cq66KOoi68ECKocCcutTLhUERM1MEpBLEuQmQMKEnDNd+6onEzKTuXqmJ5l0V/EeL+mp+qu+r77UVP1V9TcHffZbIJgOlhgDMmaAA8lTwVDxJQh5UMY4GTSFM8AJ+PW6cIDsBEEfhfPB4MuUAYvQaTowOwV1NXtB0E6mWBksBTNwTeiUBENud/CmHwBEKZgTBl2GDNgKnQIsyBkCM9kEEI0M8TJICmWgqdCFkT17MngsUignDLYMGXAsdAo0XzcPILkyxMwgKZAB50InhIMhZxUIGalAXhhkmTHgXOgU6PG8UFwxbgdBf5nhZnAUxoBroVMyjryQgMraPSDoqDBuGFwZMeBe6MLi9IWuIHW7QUisjLAzKApiwDOhC25H3T3g8TUICVYQPwyqTBjwXOgUsD4nC4RfIhPsDIaCGBAndEHsujwQMkdBHDGoMmBAvNAtPvZlAMmUAX4GQSEMeCf0wrxgmCu+ASF3K4QnBrOVM+Cd0Cnoorw4mIw/guD6Vs4Ba74CGPBe6IInJicDZn4PgDYK4IpBbMUM+CZ0Qey5t4M3bwUhoa2YB4dNT1CHIzkoEkZzDYrrLtvkCeU0aBsULTw7WntRbtARoQrGbWHtBVw/Vpaggq9t1Rh9F7qwOM0ZA45fDgJp7PmJ0i4hCegU3AabjAc9qmF24r14JeXP+MZ4GEN+/69NmVvD0rGn8zThWYghF7XE7JFN+0wL0x5BQfVZLL60D1XE5JUNfxTqEZqC/C7Zgumeh96EvvqMP6ppNpvSCTM/ZxbAz222lousqGtIAnZkPIMETThmndmM1y/scGvB30KfFNcPH7YbL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