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
829 KiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[223,7,9,16],{"+NIl":function(xe,be,z){(function(Z){Z(z("VrN/"))})(function(Z){"use strict";Z.defineMode("stex",function(H,w){"use strict";function W(S,E){S.cmdState.push(E)}function P(S){return S.cmdState.length>0?S.cmdState[S.cmdState.length-1]:null}function M(S){var E=S.cmdState.pop();E&&E.closeBracket()}function N(S){for(var E=S.cmdState,b=E.length-1;b>=0;b--){var d=E[b];if(d.name=="DEFAULT")continue;return d}return{styleIdentifier:function(){return null}}}function k(S,E,b){return function(){this.name=S,this.bracketNo=0,this.style=E,this.styles=b,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var O={};O.importmodule=k("importmodule","tag",["string","builtin"]),O.documentclass=k("documentclass","tag",["","atom"]),O.usepackage=k("usepackage","tag",["atom"]),O.begin=k("begin","tag",["atom"]),O.end=k("end","tag",["atom"]),O.label=k("label","tag",["atom"]),O.ref=k("ref","tag",["atom"]),O.eqref=k("eqref","tag",["atom"]),O.cite=k("cite","tag",["atom"]),O.bibitem=k("bibitem","tag",["atom"]),O.Bibitem=k("Bibitem","tag",["atom"]),O.RBibitem=k("RBibitem","tag",["atom"]),O.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function R(S,E){S.f=E}function h(S,E){var b;if(S.match(/^\\[a-zA-Z@]+/)){var d=S.current().slice(1);return b=O.hasOwnProperty(d)?O[d]:O.DEFAULT,b=new b,W(E,b),R(E,L),b.style}if(S.match(/^\\[$&%#{}_]/))return"tag";if(S.match(/^\\[,;!\/\\]/))return"tag";if(S.match("\\["))return R(E,function(l,u){return v(l,u,"\\]")}),"keyword";if(S.match("\\("))return R(E,function(l,u){return v(l,u,"\\)")}),"keyword";if(S.match("$$"))return R(E,function(l,u){return v(l,u,"$$")}),"keyword";if(S.match("$"))return R(E,function(l,u){return v(l,u,"$")}),"keyword";var a=S.next();if(a=="%")return S.skipToEnd(),"comment";if(a=="}"||a=="]"){if(b=P(E),b)b.closeBracket(a),R(E,L);else return"error";return"bracket"}else return a=="{"||a=="["?(b=O.DEFAULT,b=new b,W(E,b),"bracket"):/\d/.test(a)?(S.eatWhile(/[\w.%]/),"atom"):(S.eatWhile(/[\w\-_]/),b=N(E),b.name=="begin"&&(b.argument=S.current()),b.styleIdentifier())}function v(S,E,b){if(S.eatSpace())return null;if(b&&S.match(b))return R(E,h),"keyword";if(S.match(/^\\[a-zA-Z@]+/))return"tag";if(S.match(/^[a-zA-Z]+/))return"variable-2";if(S.match(/^\\[$&%#{}_]/))return"tag";if(S.match(/^\\[,;!\/]/))return"tag";if(S.match(/^[\^_&]/))return"tag";if(S.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(S.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var d=S.next();return d=="{"||d=="}"||d=="["||d=="]"||d=="("||d==")"?"bracket":d=="%"?(S.skipToEnd(),"comment"):"error"}function L(S,E){var b=S.peek(),d;return b=="{"||b=="["?(d=P(E),d.openBracket(b),S.eat(b),R(E,h),"bracket"):/[ \t\r]/.test(b)?(S.eat(b),null):(R(E,h),M(E),h(S,E))}return{startState:function(){var S=w.inMathMode?function(E,b){return v(E,b)}:h;return{cmdState:[],f:S}},copyState:function(S){return{cmdState:S.cmdState.slice(),f:S.f}},token:function(S,E){return E.f(S,E)},blankLine:function(S){S.f=h,S.cmdState.length=0},lineComment:"%"}}),Z.defineMIME("text/x-stex","stex"),Z.defineMIME("text/x-latex","stex")})},"/GNS":function(xe,be,z){xe.exports=z.p+"static/search1.c4136dd4.png"},"19Vz":function(xe,be,z){(function(Z){Z(z("VrN/"))})(function(Z){Z.defineOption("placeholder","",function(k,O,R){var h=R&&R!=Z.Init;if(O&&!h)k.on("blur",P),k.on("change",M),k.on("swapDoc",M),Z.on(k.getInputField(),"compositionupdate",k.state.placeholderCompose=function(){W(k)}),M(k);else if(!O&&h){k.off("blur",P),k.off("change",M),k.off("swapDoc",M),Z.off(k.getInputField(),"compositionupdate",k.state.placeholderCompose),H(k);var v=k.getWrapperElement();v.className=v.className.replace(" CodeMirror-empty","")}O&&!k.hasFocus()&&P(k)});function H(k){k.state.placeholder&&(k.state.placeholder.parentNode.removeChild(k.state.placeholder),k.state.placeholder=null)}function w(k){H(k);var O=k.state.placeholder=document.createElement("pre");O.style.cssText="height: 0; overflow: visible",O.style.direction=k.getOption("direction"),O.className="CodeMirror-placeholder CodeMirror-line-like";var R=k.getOption("placeholder");typeof R=="string"&&(R=document.createTextNode(R)),O.appendChild(R),k.display.lineSpace.insertBefore(O,k.display.lineSpace.firstChild)}function W(k){setTimeout(function(){var O=!1,R=k.getInputField();R.nodeName=="TEXTAREA"?O=!R.value:k.lineCount()==1&&(O=!/[^\u200b]/.test(R.querySelector(".CodeMirror-line").textContent)),O?w(k):H(k)},20)}function P(k){N(k)&&w(k)}function M(k){var O=k.getWrapperElement(),R=N(k);O.className=O.className.replace(" CodeMirror-empty","")+(R?" CodeMirror-empty":""),R?w(k):H(k)}function N(k){return k.lineCount()===1&&k.getLine(0)===""}})},"1eCo":function(xe,be,z){(function(Z){Z(z("VrN/"))})(function(Z){"use strict";var H={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},w={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};Z.defineMode("xml",function(W,P){var M=W.indentUnit,N={},k=P.htmlMode?H:w;for(var O in k)N[O]=k[O];for(var O in P)N[O]=P[O];var R,h;function v(o,x){function y(B){return x.tokenize=B,B(o,x)}var p=o.next();if(p=="<")return o.eat("!")?o.eat("[")?o.match("CDATA[")?y(E("atom","]]>")):null:o.match("--")?y(E("comment","-->")):o.match("DOCTYPE",!0,!0)?(o.eatWhile(/[\w\._\-]/),y(b(1))):null:o.eat("?")?(o.eatWhile(/[\w\._\-]/),x.tokenize=E("meta","?>"),"meta"):(R=o.eat("/")?"closeTag":"openTag",x.tokenize=L,"tag bracket");if(p=="&"){var I;return o.eat("#")?o.eat("x")?I=o.eatWhile(/[a-fA-F\d]/)&&o.eat(";"):I=o.eatWhile(/[\d]/)&&o.eat(";"):I=o.eatWhile(/[\w\.\-:]/)&&o.eat(";"),I?"atom":"error"}else return o.eatWhile(/[^&<]/),null}v.isInText=!0;function L(o,x){var y=o.next();if(y==">"||y=="/"&&o.eat(">"))return x.tokenize=v,R=y==">"?"endTag":"selfcloseTag","tag bracket";if(y=="=")return R="equals",null;if(y=="<"){x.tokenize=v,x.state=u,x.tagName=x.tagStart=null;var p=x.tokenize(o,x);return p?p+" tag error":"tag error"}else return/[\'\"]/.test(y)?(x.tokenize=S(y),x.stringStartCol=o.column(),x.tokenize(o,x)):(o.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function S(o){var x=function(y,p){for(;!y.eol();)if(y.next()==o){p.tokenize=L;break}return"string"};return x.isInAttribute=!0,x}function E(o,x){return function(y,p){for(;!y.eol();){if(y.match(x)){p.tokenize=v;break}y.next()}return o}}function b(o){return function(x,y){for(var p;(p=x.next())!=null;){if(p=="<")return y.tokenize=b(o+1),y.tokenize(x,y);if(p==">")if(o==1){y.tokenize=v;break}else return y.tokenize=b(o-1),y.tokenize(x,y)}return"meta"}}function d(o,x,y){this.prev=o.context,this.tagName=x,this.indent=o.indented,this.startOfLine=y,(N.doNotIndent.hasOwnProperty(x)||o.context&&o.context.noIndent)&&(this.noIndent=!0)}function a(o){o.context&&(o.context=o.context.prev)}function l(o,x){for(var y;;){if(!o.context)return;if(y=o.context.tagName,!N.contextGrabbers.hasOwnProperty(y)||!N.contextGrabbers[y].hasOwnProperty(x))return;a(o)}}function u(o,x,y){return o=="openTag"?(y.tagStart=x.column(),C):o=="closeTag"?g:u}function C(o,x,y){return o=="word"?(y.tagName=x.current(),h="tag",A):N.allowMissingTagName&&o=="endTag"?(h="tag bracket",A(o,x,y)):(h="error",C)}function g(o,x,y){if(o=="word"){var p=x.current();return y.context&&y.context.tagName!=p&&N.implicitlyClosed.hasOwnProperty(y.context.tagName)&&a(y),y.context&&y.context.tagName==p||N.matchClosing===!1?(h="tag",m):(h="tag error",D)}else return N.allowMissingTagName&&o=="endTag"?(h="tag bracket",m(o,x,y)):(h="error",D)}function m(o,x,y){return o!="endTag"?(h="error",m):(a(y),u)}function D(o,x,y){return h="error",m(o,x,y)}function A(o,x,y){if(o=="word")return h="attribute",f;if(o=="endTag"||o=="selfcloseTag"){var p=y.tagName,I=y.tagStart;return y.tagName=y.tagStart=null,o=="selfcloseTag"||N.autoSelfClosers.hasOwnProperty(p)?l(y,p):(l(y,p),y.context=new d(y,p,I==y.indented)),u}return h="error",A}function f(o,x,y){return o=="equals"?c:(N.allowMissing||(h="error"),A(o,x,y))}function c(o,x,y){return o=="string"?s:o=="word"&&N.allowUnquoted?(h="string",A):(h="error",A(o,x,y))}function s(o,x,y){return o=="string"?s:A(o,x,y)}return{startState:function(o){var x={tokenize:v,state:u,indented:o||0,tagName:null,tagStart:null,context:null};return o!=null&&(x.baseIndent=o),x},token:function(o,x){if(!x.tagName&&o.sol()&&(x.indented=o.indentation()),o.eatSpace())return null;R=null;var y=x.tokenize(o,x);return(y||R)&&y!="comment"&&(h=null,x.state=x.state(R||y,o,x),h&&(y=h=="error"?y+" error":h)),y},indent:function(o,x,y){var p=o.context;if(o.tokenize.isInAttribute)return o.tagStart==o.indented?o.stringStartCol+1:o.indented+M;if(p&&p.noIndent)return Z.Pass;if(o.tokenize!=L&&o.tokenize!=v)return y?y.match(/^(\s*)/)[0].length:0;if(o.tagName)return N.multilineTagIndentPastTag!==!1?o.tagStart+o.tagName.length+2:o.tagStart+M*(N.multilineTagIndentFactor||1);if(N.alignCDATA&&/<!\[CDATA\[/.test(x))return 0;var I=x&&/^<(\/)?([\w_:\.-]*)/.exec(x);if(I&&I[1])for(;p;)if(p.tagName==I[2]){p=p.prev;break}else if(N.implicitlyClosed.hasOwnProperty(p.tagName))p=p.prev;else break;else if(I)for(;p;){var B=N.contextGrabbers[p.tagName];if(B&&B.hasOwnProperty(I[2]))p=p.prev;else break}for(;p&&p.prev&&!p.startOfLine;)p=p.prev;return p?p.indent+M:o.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:N.htmlMode?"html":"xml",helperType:N.htmlMode?"html":"xml",skipAttribute:function(o){o.state==c&&(o.state=A)},xmlCurrentTag:function(o){return o.tagName?{name:o.tagName,close:o.type=="closeTag"}:null},xmlCurrentContext:function(o){for(var x=[],y=o.context;y;y=y.prev)y.tagName&&x.push(y.tagName);return x.reverse()}}}),Z.defineMIME("text/xml","xml"),Z.defineMIME("application/xml","xml"),Z.mimeModes.hasOwnProperty("text/html")||Z.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"2RCv":function(xe,be,z){"use strict";var Z=z("Awhp"),H=z("KrTs"),w=z("+L6B"),W=z("2/Rp"),P=z("5NDa"),M=z("5rEg"),N=z("0Owb"),k=z("oBTY"),O=z("tJVT"),R=z("PpiC"),h=z("cDcd"),v=z.n(h),L=function(E){var b=E.InputRight,d=E.value,a=d===void 0?[]:d,l=E.onChange,u=l===void 0?function(){}:l,C=Object(R.a)(E,["InputRight","value","onChange"]),g=Object(h.useState)(),m=Object(O.a)(g,2),D=m[0],A=m[1],f=function(o){var x=a.filter(function(y,p){return p!==o});u(x)},c=function(o){if(o.preventDefault(),!D)return;u([].concat(Object(k.a)(a),[D])),A(null)};return v.a.createElement("div",null,v.a.createElement(M.a,Object(N.a)({},C,{value:D,onChange:function(o){return A(o.target.value)},onPressEnter:c,onBlur:c})),b,v.a.createElement("div",{className:"mt20"},a==null?void 0:a.map(function(s,o){return v.a.createElement(H.a,{className:"ml10 mr10",count:"x",onClick:function(){return f(o)}},v.a.createElement(W.a,{type:"primary",ghost:!0},s))})))};be.a=L},"4qgm":function(xe,be){xe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAAwCAYAAABE1blzAAAIeUlEQVRoQ72aa2wU1xXHf2dm1jYEBClJGgofIFJLU0W04AdQWgJSW0UprZRIpB/aJBTxStIShWchJvbytA2lBCKKeajhQ5s2tGpFK1G1UowqKNjYBkraJCqqiCDEDZSncezdmTnVnd2FxaztmfWaa632w9459/7v75xzz71j4R61ssM6TkrYqMon3qesPjFNLt6LoWWgB5n1ttr/GcMCLKrE5qFgPJf3gRXN5XJgoMcfUIFlR/QxiqgVhyfVA/MxTWKgPuZvL51UtUyTjwdK6IAI/NLbWlQylhctWC0xPuN35Zi+gFUMfpIzoqxsLpffDoTIggssb9KvqLBJYnxD3dvUepq8OIAPquxzfCobJ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uyO5CMQGAS/Rtf6U55Q3sNnZj2jFRgZ3FBcBSwQ83pTOG7z5EQMy11i2cyu4COQqBDxaMq8BvXPVrN3JugiEiYClC0CY/bnVXQRii0DHWkEJbYKG95ABnmSX6LFdFnc0pxEISXTPWTxaN+Ztn+US3Wng3f5ii4A50U/hydOZeT94P8rkEj22y+KO5jQCRkT3eI6T5GnPHH/ea5foTgPv9hdbBLIS/RD58t7C7C0rAyfiEj22y+KO5jQCmYm+j3yeG5m97ZvgYVyiOw28219sEfATfTd5klozZ2vAR6b8U3GJHttlcUdzGgFF9J8gbyvmb/nFrHuX6E4D7/YXWwTurLWJQnnbMGPLnlADu0SP7bK4ozmNQLe6pZn2wwGrbv8PSygpSs9Cw9cAAAAASUVORK5CYII="},"55Ip":function(xe,be,z){"use strict";z.d(be,"a",function(){return l});var Z=z("Ty5D"),H=z("dI71"),w=z("cDcd"),W=z.n(w),P=z("YS25"),M=z("17x9"),N=z.n(M),k=z("wx14"),O=z("zLVn"),R=z("9R94"),h=function(c){Object(H.a)(s,c);function s(){for(var x,y=arguments.length,p=new Array(y),I=0;I<y;I++)p[I]=arguments[I];return x=c.call.apply(c,[this].concat(p))||this,x.history=Object(P.a)(x.props),x}var o=s.prototype;return o.render=function(){return W.a.createElement(Z.c,{history:this.history,children:this.props.children})},s}(W.a.Component),v=function(c){Object(H.a)(s,c);function s(){for(var x,y=arguments.length,p=new Array(y),I=0;I<y;I++)p[I]=arguments[I];return x=c.call.apply(c,[this].concat(p))||this,x.history=Object(P.b)(x.props),x}var o=s.prototype;return o.render=function(){return W.a.createElement(Z.c,{history:this.history,children:this.props.children})},s}(W.a.Component),L=function(s,o){return typeof s=="function"?s(o):s},S=function(s,o){return typeof s=="string"?Object(P.c)(s,null,null,o):s},E=function(s){return s},b=W.a.forwardRef;typeof b=="undefined"&&(b=E);function d(c){return!!(c.metaKey||c.altKey||c.ctrlKey||c.shiftKey)}var a=b(function(c,s){var o=c.innerRef,x=c.navigate,y=c.onClick,p=Object(O.a)(c,["innerRef","navigate","onClick"]),I=p.target,B=Object(k.a)({},p,{onClick:function(Q){try{y&&y(Q)}catch(j){throw Q.preventDefault(),j}!Q.defaultPrevented&&Q.button===0&&(!I||I==="_self")&&!d(Q)&&(Q.preventDefault(),x())}});return E!==b?B.ref=s||o:B.ref=o,W.a.createElement("a",B)}),l=b(function(c,s){var o=c.component,x=o===void 0?a:o,y=c.replace,p=c.to,I=c.innerRef,B=Object(O.a)(c,["component","replace","to","innerRef"]);return W.a.createElement(Z.e.Consumer,null,function(F){F||Object(R.a)(!1);var Q=F.history,j=S(L(p,F.location),F.location),U=j?Q.createHref(j):"",X=Object(k.a)({},B,{href:U,navigate:function(){var ne=L(p,F.location),ue=y?Q.replace:Q.push;ue(ne)}});return E!==b?X.ref=s||I:X.innerRef=I,W.a.createElement(x,X)})});if(!1)var u,C;var g=function(s){return s},m=W.a.forwardRef;typeof m=="undefined"&&(m=g);function D(){for(var c=arguments.length,s=new Array(c),o=0;o<c;o++)s[o]=arguments[o];return s.filter(function(x){return x}).join(" ")}var A=m(function(c,s){var o=c["aria-current"],x=o===void 0?"page":o,y=c.activeClassName,p=y===void 0?"active":y,I=c.activeStyle,B=c.className,F=c.exact,Q=c.isActive,j=c.location,U=c.sensitive,X=c.strict,$=c.style,ne=c.to,ue=c.innerRef,Te=Object(O.a)(c,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return W.a.createElement(Z.e.Consumer,null,function(pe){pe||Object(R.a)(!1);var de=j||pe.location,ce=S(L(ne,de),de),fe=ce.pathname,te=fe&&fe.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),se=te?Object(Z.f)(de.pathname,{path:te,exact:F,sensitive:U,strict:X}):null,Ee=!!(Q?Q(se,de):se),ke=Ee?D(B,p):B,Le=Ee?Object(k.a)({},$,{},I):$,We=Object(k.a)({"aria-current":Ee&&x||null,className:ke,style:Le,to:ce},Te);return g!==m?We.ref=s||ue:We.innerRef=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DcZ+1EckAw0L44FM4/4vq+aZfr7+zu6urq2MbPMoSuavieSt9b6zJyU7+OonXVygIjWKKUOxCGFhaA4cj0AF/KS7z8D4DmMfpTIGdcQOgtgldZaJlpss9auA/B1q/Kgrhjm+08B3JuEF/ediE44T2IikiOP1Uqp7/IYDePeElFvXhwAY2nTqJCXkTiZ1XgBcT9jmplHxYEd4SR04kRER0ul0ur169dLWKVqYb7/IpVSjHB9IctSShzQWq9JQySMeyG/MI1ewhxYnqeYq2itnePYGPMmgO6iyAP4v5gTwBzl9Cta68RdnDHmWQAtz3WyOjRTTodZYSsRvZoRbLvWemeU7vDw8P2e532eETtSjZmf931/d31HtkguHdIWUw3oWmttm60NDQ1dVS6XZat6V8EOTMplitwpNJ5K7ALwQg5Da7XWszbnxphRAE/lwIxSnQnd5mMVGYWsZ///MvMK3/ePiFVjjFyADLSBvCyo0vuzj1VCo3J5kflgi5lPE9EKIprHzFIqtKO1PtiqWzLGyIb6oRyW5ZynBOCOHBhRqmNa61nHnhedjQZBcDsRycS7pg0E8kD+LZse3/d/agS5/I7XG0JpI4B9ebqsQN1NWuuWly2X7xVTvfestXfXarWDRHRTgT2aCMXMv3metzJp/5F4SymWhoaG5pfLZVlpL9k1a7VaVRs2bEi89HZyIOwu2b1tukQX3TL3OHGYsjw1GBwc7Oro6Kg7UthTA7mhn5yc3NfX1ycPQ5xbmhGYBSqPPYhINkMPAJDHHrJ4pWlTAOShx1FmvnSPPVoxbHxu43neAmauP7eRf2nTz2yI6FStViv0uc1/ndZCH8rgOooAAAAASUVORK5CYII="},"7Cbv":function(xe,be,z){"use strict";var Z=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),H=new Uint8Array(16);function w(){if(!Z)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Z(H)}var W=/^(?:[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"&&W.test(L)}for(var M=P,N=[],k=0;k<256;++k)N.push((k+256).toString(16).substr(1));function O(L){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,E=(N[L[S+0]]+N[L[S+1]]+N[L[S+2]]+N[L[S+3]]+"-"+N[L[S+4]]+N[L[S+5]]+"-"+N[L[S+6]]+N[L[S+7]]+"-"+N[L[S+8]]+N[L[S+9]]+"-"+N[L[S+10]]+N[L[S+11]]+N[L[S+12]]+N[L[S+13]]+N[L[S+14]]+N[L[S+15]]).toLowerCase();if(!M(E))throw TypeError("Stringified UUID is invalid");return E}var R=O;function h(L,S,E){L=L||{};var b=L.random||(L.rng||w)();if(b[6]=b[6]&15|64,b[8]=b[8]&63|128,S){E=E||0;for(var d=0;d<16;++d)S[E+d]=b[d];return S}return R(b)}var v=be.a=h},"7ZXX":function(xe,be,z){xe.exports=z.p+"static/err.6e7c5817.png"},"7ahc":function(xe,be,z){"use strict";z.d(be,"a",function(){return C});var Z=z("k1fw"),H=z("0Owb"),w=z("+L6B"),W=z("2/Rp"),P=z("y8nQ"),M=z("Vl3Y"),N=z("tJVT"),k=z("OaEy"),O=z("2fM7"),R=z("cDcd"),h=z.n(R),v=z("VrN/"),L=z.n(v),S=z("p77/"),E=z.n(S),b=z("c5Ni"),d=z.n(b),a=O.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"]};be.b=function(g){var m=g.callback,D=g.onCancel,A=Object(R.useState)("python"),f=Object(N.a)(A,2),c=f[0],s=f[1];function o(y){s(u[y][1])}function x(y){m(y)}return h.a.createElement(M.a,Object(H.a)({},l,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:x}),h.a.createElement(M.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},h.a.createElement(O.a,{onChange:o},Object.keys(u).map(function(y){return h.a.createElement(a,{key:y,value:y},u[y][0])}))),h.a.createElement(M.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},h.a.createElement(C,{mode:c})),h.a.createElement("div",{className:"flex-container flex-end"},h.a.createElement(W.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),h.a.createElement(W.a,{type:"ghost",onClick:D},"\u53D6\u6D88")))};function C(g){var m=g.value,D=g.onChange,A=g.mode,f=g.options,c=f===void 0?{}:f,s=Object(R.useRef)(),o=Object(R.useState)(),x=Object(N.a)(o,2),y=x[0],p=x[1];return Object(R.useEffect)(function(){if(y){function I(B){var F=B.getValue();D&&D(F)}return y.on("change",I),function(){y.off("change",I)}}},[y,D]),Object(R.useEffect)(function(){y&&y.setOption("mode",A)},[y,A]),Object(R.useEffect)(function(){y&&((m!==y.getValue()||m==="")&&setTimeout(function(){y.setValue(m||" ")},300))},[y,m]),Object(R.useEffect)(function(){if(s.current&&!y){var I=L.a.fromTextArea(s.current,Object(Z.a)({mode:A,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},c));p(I)}},[s.current,y]),h.a.createElement("div",{className:"my-codemirror-container"},h.a.createElement("textarea",{ref:s}))}},"7ixt":function(xe,be,z){"use strict";z.d(be,"a",function(){return w});var Z={adjustX:1,adjustY:1},H=[0,0],w={left:{points:["cr","cl"],overflow:Z,offset:[-4,0],targetOffset:H},right:{points:["cl","cr"],overflow:Z,offset:[4,0],targetOffset:H},top:{points:["bc","tc"],overflow:Z,offset:[0,-4],targetOffset:H},bottom:{points:["tc","bc"],overflow:Z,offset:[0,4],targetOffset:H},topLeft:{points:["bl","tl"],overflow:Z,offset:[0,-4],targetOffset:H},leftTop:{points:["tr","tl"],overflow:Z,offset:[-4,0],targetOffset:H},topRight:{points:["br","tr"],overflow:Z,offset:[0,-4],targetOffset:H},rightTop:{points:["tl","tr"],overflow:Z,offset:[4,0],targetOffset:H},bottomRight:{points:["tr","br"],overflow:Z,offset:[0,4],targetOffset:H},rightBottom:{points:["bl","br"],overflow:Z,offset:[4,0],targetOffset:H},bottomLeft:{points:["tl","bl"],overflow:Z,offset:[0,4],targetOffset:H},leftBottom:{points:["br","bl"],overflow:Z,offset:[-4,0],targetOffset:H}},W=w},"7v3h":function(xe,be,z){xe.exports=z.p+"static/empty2.dd73f390.png"},"8/bI":function(xe,be,z){xe.exports=z.p+"static/empty.8918e228.png"},"8EBN":function(xe,be,z){(function(Z){Z(z("VrN/"))})(function(Z){"use strict";Z.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 H=0;H<Z.modeInfo.length;H++){var w=Z.modeInfo[H];w.mimes&&(w.mime=w.mimes[0])}Z.findModeByMIME=function(W){W=W.toLowerCase();for(var P=0;P<Z.modeInfo.length;P++){var M=Z.modeInfo[P];if(M.mime==W)return M;if(M.mimes){for(var N=0;N<M.mimes.length;N++)if(M.mimes[N]==W)return M}}if(/\+xml$/.test(W))return Z.findModeByMIME("application/xml");if(/\+json$/.test(W))return Z.findModeByMIME("application/json")},Z.findModeByExtension=function(W){W=W.toLowerCase();for(var P=0;P<Z.modeInfo.length;P++){var M=Z.modeInfo[P];if(M.ext){for(var N=0;N<M.ext.length;N++)if(M.ext[N]==W)return M}}},Z.findModeByFileName=function(W){for(var P=0;P<Z.modeInfo.length;P++){var M=Z.modeInfo[P];if(M.file&&M.file.test(W))return M}var N=W.lastIndexOf("."),k=N>-1&&W.substring(N+1,W.length);if(k)return Z.findModeByExtension(k)},Z.findModeByName=function(W){W=W.toLowerCase();for(var P=0;P<Z.modeInfo.length;P++){var M=Z.modeInfo[P];if(M.name.toLowerCase()==W)return M;if(M.alias){for(var N=0;N<M.alias.length;N++)if(M.alias[N].toLowerCase()==W)return M}}}})},"8hTe":function(xe,be,z){xe.exports={button:"button___1wy9m"}},"9Bee":function(xe,be,z){"use strict";var Z=z("DYRE"),H=z("zeV3"),w=z("+L6B"),W=z("2/Rp"),P=z("k1fw"),M=z("tJVT"),N=z("cDcd"),k=z.n(N),O=z("vg9a"),R=z("DlQD"),h=z.n(R),v=z("rUJ1");function L(de,ce){var fe=de.match(/^(\s+)(?:```)/);if(fe===null)return ce;var te=fe[1];return ce.split(`
`).map(function(se){var Ee=se.match(/^\s+/);if(Ee===null)return se;var ke=Object(M.a)(Ee,1),Le=ke[0];return Le.length>=te.length?se.slice(te.length):se}).join(`
`)}var S=[],E=["<ul>"],b=new h.a.Renderer,d=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function a(){S.length=0,E=["<ul>"]}var l={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function u(de,ce,fe,te){if(ce>=de.length||de[ce].level<=fe)return ce;var se=de[ce];te.push("<li><a href='#"+se.anchor+"'>"+se.text+"</a>"),ce++;var Ee=[];return ce=u(de,ce,se.level,Ee),Ee.length>0&&(te.push("<ul>"),Ee.forEach(function(ke){te.push(ke)}),te.push("</ul>")),te.push("</li>"),ce=u(de,ce,fe,te),ce}function C(){return u(S,0,0,E),E.push("</ul>"),E.join("")}var g={heading:function(ce){var fe=d.exec(ce);if(fe)return{type:"heading",raw:fe[0],depth:fe[1].length,text:fe[2]}},fences:function(ce){var fe=this.rules.block.fences.exec(ce);if(fe){var te=fe[0],se=L(te,fe[3]||""),Ee=fe[2]?fe[2].trim():fe[2];if(["latex","katex","math"].indexOf(Ee)>=0){var ke=A(),Le=se;se=ke,f[ke]={type:"block",expression:Le}}return{type:"code",raw:te,lang:Ee,text:se}}}},m=/(?:\${2})([^\n`]+?)(?:\${2})/gi,D=0,A=function(){return"__special_katext_id_".concat(D++,"__")},f={};function c(){return f}function s(){D=0,f={}}function o(de){return de=de.replace(m,function(ce,fe){var te=A();return f[te]={type:"inline",expression:fe},te}),de}var x=b.listitem;b.listitem=function(de){return x(o(de))};var y=b.paragraph;b.paragraph=function(de){return y(o(de))};var p=b.tablecell;b.tablecell=function(de,ce){return p(o(de),ce)},b.code=function(de,ce,fe){var te=(ce||"").match(/\S*/)[0];return te?["latex","katex","math"].indexOf(te)>=0?"<p class='editormd-tex'>".concat(de,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(ce,'">').concat(fe?de:Object(v.escape)(de,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(fe?de:Object(v.escape)(de,!0))+"</code></pre>"},b.heading=function(de,ce,fe){var te=this.options.headerPrefix+fe.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return S.push({anchor:te,level:ce,text:de}),"<h"+ce+' id="'+te+'">'+de+"</h"+ce+">"},h.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),h.a.use({tokenizer:g,renderer:b});var I=h.a,B=z("SJMd"),F=z("ulZh"),Q=z.n(F),j=z("m3rI"),U=z("Oy/b"),X=z("p5ED"),$=z("8hTe"),ne=z.n($),ue=/<pre[^>]*>/g;function Te(de){var ce=document.createElement("div");return ce.innerHTML=de,ce.childNodes.length===0?"":ce.childNodes[0].nodeValue}var pe=be.a=function(de){var ce=de.value,fe=ce===void 0?"":ce,te=de.edit,se=te===void 0?!1:te,Ee=de.className,ke=de.showTextOnly,Le=de.showLines,We=de.replaces,Xe=de.zoomImg,we=de.hasMask,Re=de.style,De=Re===void 0?{}:Re,He=de.stylesPrev,Ve=He===void 0?{}:He,Ce=String(fe),Me=Object(N.useRef)(),qe=Object(N.useRef)(),tt=Object(N.useState)(""),Ke=Object(M.a)(tt,2),Ne=Ke[0],rt=Ke[1],Je=Object(N.useState)("office"),Ze=Object(M.a)(Je,2),ye=Ze[0],$e=Ze[1],Ge=Object(N.useMemo)(function(){try{var oe=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Y=/\"\/api\/attachments\/|\"\/attachments\/download\//g,J=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Ce=Ce.replace(oe,"("+j.a.API_SERVER+"/api/attachments/").replace(Y,'"'+j.a.API_SERVER+"/api/attachments/").replace(J,'"'+j.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(Ae){}var q=I(Ce),re=c();if(Ce.match(/\[TOC\]/)&&(q=q.replace("<p>[TOC]</p>",C()),a()),q=q.replace(/(__special_katext_id_\d+__)/g,function(Ae,Be){var lt=re[Be],Pe=lt.type,Ye=lt.expression;return Object(U.renderToString)(Te(Ye)||"",{displayMode:Pe==="block",throwOnError:!1,output:"html"})}),q=q.replace(/▁/g,"\u2581\u2581\u2581"),s(),ke){var ge=document.createElement("div");return ge.innerHTML=q,ge.innerText}return setTimeout(function(){return le()},500),q},[Ce]),ve=Object(N.useRef)();l.WebkitLineClamp=Le,Le&&(De=Object(P.a)(Object(P.a)({},De),l));function Ie(oe){var Y=oe.target;if(Y.tagName.toUpperCase()==="IMG"){if(Xe){var J=Y.getAttribute("src");rt(J),$e("image")}}else if(Y.tagName.toUpperCase()==="A"){var q=Y.getAttribute("href");if(q.indexOf("office")>-1)oe.preventDefault(),rt(q),$e("office");else if(q.indexOf("application/pdf")>-1)oe.preventDefault(),rt(q),$e("pdf");else if(q.indexOf("text/html")>-1)oe.preventDefault(),rt(q),$e("html");else if(q.startsWith("#")){oe.preventDefault();var re=document.getElementById(q.replace("#",""));re&&re.scrollIntoView(!0)}}}var le=function(){var Y,J=(Y=ve.current)===null||Y===void 0?void 0:Y.querySelectorAll("video");J==null||J.forEach(function(q){if(q.oncontextmenu=function(){return!1},q.src.indexOf(".m3u8")>-1&&!q.canPlayType("application/vnd.apple.mpegurl")){if(Q.a.isSupported()){var re=new Q.a;re.loadSource(q.src),re.attachMedia(q)}}})};Object(N.useEffect)(function(){if(ve.current&&Ge&&(Ge.match(ue)&&window.PR.prettyPrint()),ve.current)return ve.current.addEventListener("click",Ie),function(){ve.current.removeEventListener("click",Ie),s(),a()}},[Ge,ve.current,Ie]);var ae=function(Y){if(!se)return;Y.target.nodeName==="IMG"?(Me.current.style.display="flex",Me.current.style.width=Y.target.clientWidth+"px",Me.current.style.height=Y.target.clientHeight+"px",Me.current.style.top=Y.target.offsetTop+"px",Me.current.style.left=Y.target.offsetLeft+"px",qe.current.src=Y.target.getAttribute("src")):Me.current.style.display="none"};return k.a.createElement("div",{style:{position:"relative"}},k.a.createElement("div",{ref:ve,style:Object(P.a)({},De),className:"".concat(Ee||""," markdown-body ").concat(ne.a.mdBody),onMouseOver:ae,dangerouslySetInnerHTML:{__html:Ge}}),k.a.createElement("div",{ref:Me,className:ne.a.button},k.a.createElement(H.a,null,k.a.createElement(W.a,{onClick:function(){return openCrop()}},"\u88C1\u526A"),k.a.createElement(W.a,{onClick:function(){return openEditor()}},"\u7F16\u8F91"))),k.a.createElement("img",{ref:qe,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1,top:"-10000px"}}),k.a.createElement(X.a,{close:!0,data:Ne,type:Ne!=null&&Ne.length?ye:"",style:Object(P.a)({},Ve),onClose:function(){return rt("")}}))}},"9VGf":function(xe,be,z){"use strict";z.d(be,"a",function(){return w});var Z=z("cDcd"),H=z.n(Z);function w(W,P){var M=Object(Z.useRef)();Object(Z.useEffect)(function(){M.current=W}),Object(Z.useEffect)(function(){function N(){M.current()}if(P!==null){var k=setInterval(N,P);return function(){return clearInterval(k)}}},[P])}},"A/g1":function(xe,be){xe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAF92lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1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z("VrN/"),z("osHv"))})(function(Z){Z.defineOption("autoCloseTags",!1,function(O,R,h){if(h!=Z.Init&&h&&O.removeKeyMap("autoCloseTags"),!R)return;var v={name:"autoCloseTags"};(typeof R!="object"||R.whenClosing!==!1)&&(v["'/'"]=function(L){return M(L)}),(typeof R!="object"||R.whenOpening!==!1)&&(v["'>'"]=function(L){return W(L)}),O.addKeyMap(v)});var H=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],w=["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 W(O){if(O.getOption("disableInput"))return Z.Pass;for(var R=O.listSelections(),h=[],v=O.getOption("autoCloseTags"),L=0;L<R.length;L++){if(!R[L].empty())return Z.Pass;var S=R[L].head,E=O.getTokenAt(S),b=Z.innerMode(O.getMode(),E.state),d=b.state,a=b.mode.xmlCurrentTag&&b.mode.xmlCurrentTag(d),l=a&&a.name;if(!l)return Z.Pass;var u=b.mode.configuration=="html",C=typeof v=="object"&&v.dontCloseTags||u&&H,g=typeof v=="object"&&v.indentTags||u&&w;E.end>S.ch&&(l=l.slice(0,l.length-E.end+S.ch));var m=l.toLowerCase();if(!l||E.type=="string"&&(E.end!=S.ch||!/[\"\']/.test(E.string.charAt(E.string.length-1))||E.string.length==1)||E.type=="tag"&&a.close||E.string.indexOf("/")==S.ch-E.start-1||C&&N(C,m)>-1||k(O,b.mode.xmlCurrentContext&&b.mode.xmlCurrentContext(d)||[],l,S,!0))return Z.Pass;var D=typeof v=="object"&&v.emptyTags;if(D&&N(D,l)>-1){h[L]={text:"/>",newPos:Z.Pos(S.line,S.ch+2)};continue}var A=g&&N(g,m)>-1;h[L]={indent:A,text:">"+(A?`
`:"")+"</"+l+">",newPos:A?Z.Pos(S.line+1,0):Z.Pos(S.line,S.ch+1)}}for(var f=typeof v=="object"&&v.dontIndentOnAutoClose,L=R.length-1;L>=0;L--){var c=h[L];O.replaceRange(c.text,R[L].head,R[L].anchor,"+insert");var s=O.listSelections().slice(0);s[L]={head:c.newPos,anchor:c.newPos},O.setSelections(s),!f&&c.indent&&(O.indentLine(c.newPos.line,null,!0),O.indentLine(c.newPos.line+1,null,!0))}}function P(O,R){for(var h=O.listSelections(),v=[],L=R?"/":"</",S=O.getOption("autoCloseTags"),E=typeof S=="object"&&S.dontIndentOnSlash,b=0;b<h.length;b++){if(!h[b].empty())return Z.Pass;var d=h[b].head,a=O.getTokenAt(d),l=Z.innerMode(O.getMode(),a.state),u=l.state;if(R&&(a.type=="string"||a.string.charAt(0)!="<"||a.start!=d.ch-1))return Z.Pass;var C,g=l.mode.name!="xml"&&O.getMode().name=="htmlmixed";if(g&&l.mode.name=="javascript")C=L+"script";else if(g&&l.mode.name=="css")C=L+"style";else{var m=l.mode.xmlCurrentContext&&l.mode.xmlCurrentContext(u);if(!m||m.length&&k(O,m,m[m.length-1],d))return Z.Pass;C=L+m[m.length-1]}O.getLine(d.line).charAt(a.end)!=">"&&(C+=">"),v[b]=C}if(O.replaceSelections(v),h=O.listSelections(),!E)for(var b=0;b<h.length;b++)(b==h.length-1||h[b].head.line<h[b+1].head.line)&&O.indentLine(h[b].head.line)}function M(O){return O.getOption("disableInput")?Z.Pass:P(O,!0)}Z.commands.closeTag=function(O){return P(O)};function N(O,R){if(O.indexOf)return O.indexOf(R);for(var h=0,v=O.length;h<v;++h)if(O[h]==R)return h;return-1}function k(O,R,h,v,L){if(!Z.scanForClosingTag)return!1;var S=Math.min(O.lastLine()+1,v.line+500),E=Z.scanForClosingTag(O,v,null,S);if(!E||E.tag!=h)return!1;for(var b=L?1:0,d=R.length-1;d>=0&&R[d]==h;d--)++b;v=E.to;for(var d=1;d<b;d++){var a=Z.scanForClosingTag(O,v,null,S);if(!a||a.tag!=h)return!1;v=a.to}return!0}})},BjJ7:function(xe,be,z){"use strict";z.d(be,"d",function(){return H}),z.d(be,"c",function(){return w}),z.d(be,"e",function(){return W}),z.d(be,"b",function(){return P}),z.d(be,"a",function(){return N});var Z=z("m3rI");function H(k){var O=!0;if(k.length>0){for(var R=0;R<k.length;R++)if(k[R].compile_success==0||!k[R].compile_success){O=!1;break}}else O=!1;return O}function w(k){for(var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",R=[],h=0;h<k.length;h++){var v=k[h],L=O?"".concat(O,"/").concat(v.name):"".concat(v.name);R.push({title:v.name,isLeaf:!(v.type==="tree"),key:L})}return R}function W(k,O,R){for(var h=0;h<k.length;h++){var v=k[h];if(v.key===O){v.children=R;break}v.children&&W(v.children,O,R)}return k}function P(k,O,R){var h;return function(){var v=this,L=arguments,S=function(){h=null,R||k.apply(v,L)},E=R&&!h;clearTimeout(h),h=setTimeout(S,O),E&&k.apply(v,L)}}var M=!0,N=Z.a.API_SERVER},"C+DQ":function(xe,be,z){},CJF0:function(xe,be,z){"use strict";var Z=z("14J3"),H=z("BMrR"),w=z("+L6B"),W=z("2/Rp"),P=z("jCWc"),M=z("kPKH"),N=z("PpiC"),k=z("cDcd"),O=z.n(k),R=z("Ty5D"),h=z("9kvl"),v=z("55Ip"),L=z("lzim"),S=z("nZ20"),E=z.n(S),b=function(a){var l,u,C,g,m=a.shixunsDetail,D=a.dispatch,A=a.loading,f=a.match,c=a.data,s=c===void 0?{}:c,o=a.title,x=Object(N.a)(a,["shixunsDetail","dispatch","loading","match","data","title"]),y=Object(R.i)(),p=!(((l=m.detail)===null||l===void 0?void 0:l.identity)>4||((u=m.detail)===null||u===void 0?void 0:u.identity)===void 0||((C=m.detail)===null||C===void 0?void 0:C.shixun_status)===2||((g=m.detail)===null||g===void 0?void 0:g.shixun_status)===1);return O.a.createElement("aside",{className:"bg-white mb10 pl20 pr20 ".concat(E.a.wrap)},O.a.createElement(H.a,{gutter:[20,20],align:"middle"},O.a.createElement(M.a,{flex:1},O.a.createElement("span",{className:E.a.icons},O.a.createElement("img",{src:L.e,width:"14"})),O.a.createElement("span",{className:"font16"},"\u7B2C ",s==null?void 0:s.position," \u5173\uFF1A",o)),O.a.createElement(M.a,null,(s==null?void 0:s.prev_challenge)&&O.a.createElement(W.a,{type:"primary",ghost:!0,className:"mt10 mr5",onClick:function(){var B,F=s.prev_challenge.st===0?"/editcheckpoint":"/editquestion",Q="/shixuns/".concat(y.id,"/challenges/").concat(s==null||((B=s.prev_challenge)===null||B===void 0)?void 0:B.id).concat(F);h.d.replace(Q)}},"\u4E0A\u4E00\u5173"),s.next_challenge&&O.a.createElement(W.a,{type:"primary",ghost:!0,className:"mt10 mr5",onClick:function(){var B,F=s.next_challenge.st===0?"/editcheckpoint":"/editquestion",Q="/shixuns/".concat(y.id,"/challenges/").concat(s==null||((B=s.next_challenge)===null||B===void 0)?void 0:B.id).concat(F);h.d.replace(Q)}},"\u4E0B\u4E00\u5173"),p&&O.a.createElement(W.a,{type:"primary"},O.a.createElement(v.a,{to:"/shixuns/".concat(y.id,"/challenges/newquestion")},"\u65B0\u589E\u9009\u62E9\u9898\u4EFB\u52A1")),p&&O.a.createElement(W.a,{type:"primary",className:"ml5"},O.a.createElement(v.a,{to:"/shixuns/".concat(y.id,"/challenges/new")},"\u65B0\u589E\u5B9E\u8DF5\u4EFB\u52A1")),O.a.createElement(W.a,{type:"primary",className:"ml5"},O.a.createElement(v.a,{to:"/shixuns/".concat(y.id,"/challenges")},"\u8FD4\u56DE")))))};be.a=Object(h.a)(function(d){var a=d.shixunsDetail,l=d.newCourse,u=d.loading,C=d.globalSetting;return{shixunsDetail:a,newCourse:l,globalSetting:C,loading:u.effects}})(b)},D1Df:function(xe,be,z){"use strict";function Z(p){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Z=function(B){return typeof B}:Z=function(B){return B&&typeof Symbol=="function"&&B.constructor===Symbol&&B!==Symbol.prototype?"symbol":typeof B},Z(p)}function H(){return H=Object.assign||function(p){for(var I=1;I<arguments.length;I++){var B=arguments[I];for(var F in B)Object.prototype.hasOwnProperty.call(B,F)&&(p[F]=B[F])}return p},H.apply(this,arguments)}function w(p,I){var B=Object.keys(p);if(Object.getOwnPropertySymbols){var F=Object.getOwnPropertySymbols(p);I&&(F=F.filter(function(Q){return Object.getOwnPropertyDescriptor(p,Q).enumerable})),B.push.apply(B,F)}return B}function W(p){for(var I=1;I<arguments.length;I++){var B=arguments[I]!=null?arguments[I]:{};I%2?w(B,!0).forEach(function(F){E(p,F,B[F])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(B)):w(B).forEach(function(F){Object.defineProperty(p,F,Object.getOwnPropertyDescriptor(B,F))})}return p}function P(p,I){if(p==null)return{};var B=M(p,I),F,Q;if(Object.getOwnPropertySymbols){var j=Object.getOwnPropertySymbols(p);for(Q=0;Q<j.length;Q++){if(F=j[Q],I.indexOf(F)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(p,F))continue;B[F]=p[F]}}return B}function M(p,I){if(p==null)return{};var B={},F=Object.keys(p),Q,j;for(j=0;j<F.length;j++){if(Q=F[j],I.indexOf(Q)>=0)continue;B[Q]=p[Q]}return B}function N(p,I){if(!(p instanceof I))throw new TypeError("Cannot call a class as a function")}function k(p,I){for(var B=0;B<I.length;B++){var F=I[B];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(p,F.key,F)}}function O(p,I,B){return I&&k(p.prototype,I),B&&k(p,B),p}function R(p,I){return I&&(Z(I)==="object"||typeof I=="function")?I:v(p)}function h(p){return h=Object.setPrototypeOf?Object.getPrototypeOf:function(B){return B.__proto__||Object.getPrototypeOf(B)},h(p)}function v(p){if(p===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p}function L(p,I){if(typeof I!="function"&&I!==null)throw new TypeError("Super expression must either be null or a function");p.prototype=Object.create(I&&I.prototype,{constructor:{value:p,writable:!0,configurable:!0}}),I&&S(p,I)}function S(p,I){return S=Object.setPrototypeOf||function(F,Q){return F.__proto__=Q,F},S(p,I)}function E(p,I,B){return I in p?Object.defineProperty(p,I,{value:B,enumerable:!0,configurable:!0,writable:!0}):p[I]=B,p}var b=z("cDcd"),d=z("17x9"),a=z("H38U"),l=z("aRTE");function u(p){for(var I="",B=0;B<p.length;B++){var F=p.charCodeAt(B);F<128?I+=String.fromCharCode(F):F<2048?(I+=String.fromCharCode(192|F>>6),I+=String.fromCharCode(128|F&63)):F<55296||F>=57344?(I+=String.fromCharCode(224|F>>12),I+=String.fromCharCode(128|F>>6&63),I+=String.fromCharCode(128|F&63)):(B++,F=65536+((F&1023)<<10|p.charCodeAt(B)&1023),I+=String.fromCharCode(240|F>>18),I+=String.fromCharCode(128|F>>12&63),I+=String.fromCharCode(128|F>>6&63),I+=String.fromCharCode(128|F&63))}return I}var C={size:128,level:"L",bgColor:"#FFFFFF",fgColor:"#000000",includeMargin:!1},g={},m=4,D=.1;function A(p){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,B=[];return p.forEach(function(F,Q){var j=null;F.forEach(function(U,X){if(!U&&j!==null){B.push("M".concat(j+I," ").concat(Q+I,"h").concat(X-j,"v1H").concat(j+I,"z")),j=null;return}if(X===F.length-1){if(!U)return;j===null?B.push("M".concat(X+I,",").concat(Q+I," h1v1H").concat(X+I,"z")):B.push("M".concat(j+I,",").concat(Q+I," h").concat(X+1-j,"v1H").concat(j+I,"z"));return}U&&j===null&&(j=X)})}),B.join("")}function f(p,I){return p.slice().map(function(B,F){return F<I.y||F>=I.y+I.h?B:B.map(function(Q,j){return j<I.x||j>=I.x+I.w?Q:!1})})}function c(p,I){var B=p.imageSettings,F=p.size,Q=p.includeMargin;if(B==null)return null;var j=Q?m:0,U=I.length+j*2,X=Math.floor(F*D),$=U/F,ne=(B.width||X)*$,ue=(B.height||X)*$,Te=B.x==null?I.length/2-ne/2:B.x*$,pe=B.y==null?I.length/2-ue/2:B.y*$,de=null;if(B.excavate){var ce=Math.floor(Te),fe=Math.floor(pe),te=Math.ceil(ne+Te-ce),se=Math.ceil(ue+pe-fe);de={x:ce,y:fe,w:te,h:se}}return{x:Te,y:pe,h:ue,w:ne,excavation:de}}var s=function(){try{new Path2D().addPath(new Path2D)}catch(p){return!1}return!0}(),o=function(p){L(I,p);function I(){var B,F;N(this,I);for(var Q=arguments.length,j=new Array(Q),U=0;U<Q;U++)j[U]=arguments[U];return F=R(this,(B=h(I)).call.apply(B,[this].concat(j))),E(v(F),"_canvas",void 0),E(v(F),"_image",void 0),E(v(F),"state",{imgLoaded:!1}),E(v(F),"handleImageLoad",function(){F.setState({imgLoaded:!0})}),F}return O(I,[{key:"componentDidMount",value:function(){this.update()}},{key:"componentDidUpdate",value:function(){this.update()}},{key:"update",value:function(){var F=this.props,Q=F.value,j=F.size,U=F.level,X=F.bgColor,$=F.fgColor,ne=F.includeMargin,ue=F.imageSettings,Te=new a(-1,l[U]);if(Te.addData(u(Q)),Te.make(),this._canvas!=null){var pe=this._canvas,de=pe.getContext("2d");if(!de)return;var ce=Te.modules;if(ce===null)return;var fe=ne?m:0,te=ce.length+fe*2,se=c(this.props,ce);ue!=null&&se!=null&&(se.excavation!=null&&(ce=f(ce,se.excavation)));var Ee=window.devicePixelRatio||1;pe.height=pe.width=j*Ee;var ke=j/te*Ee;de.scale(ke,ke),de.fillStyle=X,de.fillRect(0,0,te,te),de.fillStyle=$,s?de.fill(new Path2D(A(ce,fe))):ce.forEach(function(Le,We){Le.forEach(function(Xe,we){Xe&&de.fillRect(we+fe,We+fe,1,1)})}),this.state.imgLoaded&&this._image&&se!=null&&de.drawImage(this._image,se.x+fe,se.y+fe,se.w,se.h)}}},{key:"render",value:function(){var F=this,Q=this.props,j=Q.value,U=Q.size,X=Q.level,$=Q.bgColor,ne=Q.fgColor,ue=Q.style,Te=Q.includeMargin,pe=Q.imageSettings,de=P(Q,["value","size","level","bgColor","fgColor","style","includeMargin","imageSettings"]),ce=W({height:U,width:U},ue),fe=null,te=pe&&pe.src;return pe!=null&&te!=null&&(fe=b.createElement("img",{src:te,style:{display:"none"},onLoad:this.handleImageLoad,ref:function(Ee){return F._image=Ee}})),b.createElement(b.Fragment,null,b.createElement("canvas",H({style:ce,height:U,width:U,ref:function(Ee){return F._canvas=Ee}},de)),fe)}}]),I}(b.PureComponent);E(o,"defaultProps",C);var x=function(p){L(I,p);function I(){return N(this,I),R(this,h(I).apply(this,arguments))}return O(I,[{key:"render",value:function(){var F=this.props,Q=F.value,j=F.size,U=F.level,X=F.bgColor,$=F.fgColor,ne=F.includeMargin,ue=F.imageSettings,Te=P(F,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]),pe=new a(-1,l[U]);pe.addData(u(Q)),pe.make();var de=pe.modules;if(de===null)return null;var ce=ne?m:0,fe=de.length+ce*2,te=c(this.props,de),se=null;ue!=null&&te!=null&&(te.excavation!=null&&(de=f(de,te.excavation)),se=b.createElement("image",{xlinkHref:ue.src,height:te.h,width:te.w,x:te.x+ce,y:te.y+ce,preserveAspectRatio:"none"}));var Ee=A(de,ce);return b.createElement("svg",H({shapeRendering:"crispEdges",height:j,width:j,viewBox:"0 0 ".concat(fe," ").concat(fe)},Te),b.createElement("path",{fill:X,d:"M0,0 h".concat(fe,"v").concat(fe,"H0z")}),b.createElement("path",{fill:$,d:Ee}),se)}}]),I}(b.PureComponent);E(x,"defaultProps",C);var y=function(I){var B=I.renderAs,F=P(I,["renderAs"]),Q=B==="svg"?x:o;return b.createElement(Q,F)};y.defaultProps=W({renderAs:"canvas"},C),xe.exports=y},DlQD:function(xe,be,z){(function(Z,H){xe.exports=H()})(this,function(){"use strict";function Z(le,ae){for(var oe=0;oe<ae.length;oe++){var Y=ae[oe];Y.enumerable=Y.enumerable||!1,Y.configurable=!0,"value"in Y&&(Y.writable=!0),Object.defineProperty(le,Y.key,Y)}}function H(le,ae,oe){return ae&&Z(le.prototype,ae),oe&&Z(le,oe),le}function w(le,ae){if(!le)return;if(typeof le=="string")return W(le,ae);var oe=Object.prototype.toString.call(le).slice(8,-1);if(oe==="Object"&&le.constructor&&(oe=le.constructor.name),oe==="Map"||oe==="Set")return Array.from(le);if(oe==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(oe))return W(le,ae)}function W(le,ae){(ae==null||ae>le.length)&&(ae=le.length);for(var oe=0,Y=new Array(ae);oe<ae;oe++)Y[oe]=le[oe];return Y}function P(le,ae){var oe;if(typeof Symbol=="undefined"||le[Symbol.iterator]==null){if(Array.isArray(le)||(oe=w(le))||ae&&le&&typeof le.length=="number"){oe&&(le=oe);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 oe=le[Symbol.iterator](),oe.next.bind(oe)}function M(le,ae){return ae={exports:{}},le(ae,ae.exports),ae.exports}var N=M(function(le){function ae(){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 oe(Y){le.exports.defaults=Y}le.exports={defaults:ae(),getDefaults:ae,changeDefaults:oe}}),k=N.defaults,O=N.getDefaults,R=N.changeDefaults,h=/[&<>"']/,v=/[&<>"']/g,L=/[<>"']|&(?!#?\w+;)/,S=/[<>"']|&(?!#?\w+;)/g,E={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},b=function(ae){return E[ae]};function d(le,ae){if(ae){if(h.test(le))return le.replace(v,b)}else if(L.test(le))return le.replace(S,b);return le}var a=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function l(le){return le.replace(a,function(ae,oe){return oe=oe.toLowerCase(),oe==="colon"?":":oe.charAt(0)==="#"?oe.charAt(1)==="x"?String.fromCharCode(parseInt(oe.substring(2),16)):String.fromCharCode(+oe.substring(1)):""})}var u=/(^|[^\[])\^/g;function C(le,ae){le=le.source||le,ae=ae||"";var oe={replace:function(J,q){return q=q.source||q,q=q.replace(u,"$1"),le=le.replace(J,q),oe},getRegex:function(){return new RegExp(le,ae)}};return oe}var g=/[^\w:]/g,m=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function D(le,ae,oe){if(le){var Y;try{Y=decodeURIComponent(l(oe)).replace(g,"").toLowerCase()}catch(J){return null}if(Y.indexOf("javascript:")===0||Y.indexOf("vbscript:")===0||Y.indexOf("data:")===0)return null}ae&&!m.test(oe)&&(oe=o(ae,oe));try{oe=encodeURI(oe).replace(/%25/g,"%")}catch(J){return null}return oe}var A={},f=/^[^:]+:\/*[^/]*$/,c=/^([^:]+:)[\s\S]*$/,s=/^([^:]+:\/*[^/]*)[\s\S]*$/;function o(le,ae){A[" "+le]||(f.test(le)?A[" "+le]=le+"/":A[" "+le]=I(le,"/",!0)),le=A[" "+le];var oe=le.indexOf(":")===-1;return ae.substring(0,2)==="//"?oe?ae:le.replace(c,"$1")+ae:ae.charAt(0)==="/"?oe?ae:le.replace(s,"$1")+ae:le+ae}var x={exec:function(){}};function y(le){for(var ae=1,oe,Y;ae<arguments.length;ae++){oe=arguments[ae];for(Y in oe)Object.prototype.hasOwnProperty.call(oe,Y)&&(le[Y]=oe[Y])}return le}function p(le,ae){var oe=le.replace(/\|/g,function(q,re,ge){for(var Ae=!1,Be=re;--Be>=0&&ge[Be]==="\\";)Ae=!Ae;return Ae?"|":" |"}),Y=oe.split(/ \|/),J=0;if(Y.length>ae)Y.splice(ae);else for(;Y.length<ae;)Y.push("");for(;J<Y.length;J++)Y[J]=Y[J].trim().replace(/\\\|/g,"|");return Y}function I(le,ae,oe){var Y=le.length;if(Y===0)return"";for(var J=0;J<Y;){var q=le.charAt(Y-J-1);if(q===ae&&!oe)J++;else if(q!==ae&&oe)J++;else break}return le.substr(0,Y-J)}function B(le,ae){if(le.indexOf(ae[1])===-1)return-1;for(var oe=le.length,Y=0,J=0;J<oe;J++)if(le[J]==="\\")J++;else if(le[J]===ae[0])Y++;else if(le[J]===ae[1]&&(Y--,Y<0))return J;return-1}function F(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 Q={escape:d,unescape:l,edit:C,cleanUrl:D,resolveUrl:o,noopTest:x,merge:y,splitCells:p,rtrim:I,findClosingBracket:B,checkSanitizeDeprecation:F},j=N.defaults,U=Q.rtrim,X=Q.splitCells,$=Q.escape,ne=Q.findClosingBracket;function ue(le,ae,oe){var Y=ae.href,J=ae.title?$(ae.title):null,q=le[1].replace(/\\([\[\]])/g,"$1");return le[0].charAt(0)!=="!"?{type:"link",raw:oe,href:Y,title:J,text:q}:{type:"image",raw:oe,href:Y,title:J,text:$(q)}}function Te(le,ae){var oe=le.match(/^(\s+)(?:```)/);if(oe===null)return ae;var Y=oe[1];return ae.split(`
`).map(function(J){var q=J.match(/^\s+/);if(q===null)return J;var re=q[0];return re.length>=Y.length?J.slice(Y.length):J}).join(`
`)}var pe=function(){function le(oe){this.options=oe||j}var ae=le.prototype;return ae.space=function(Y){var J=this.rules.block.newline.exec(Y);if(J)return J[0].length>1?{type:"space",raw:J[0]}:{raw:`
`}},ae.code=function(Y,J){var q=this.rules.block.code.exec(Y);if(q){var re=J[J.length-1];if(re&&re.type==="paragraph")return{raw:q[0],text:q[0].trimRight()};var ge=q[0].replace(/^ {4}/gm,"");return{type:"code",raw:q[0],codeBlockStyle:"indented",text:this.options.pedantic?ge:U(ge,`
`)}}},ae.fences=function(Y){var J=this.rules.block.fences.exec(Y);if(J){var q=J[0],re=Te(q,J[3]||"");return{type:"code",raw:q,lang:J[2]?J[2].trim():J[2],text:re}}},ae.heading=function(Y){var J=this.rules.block.heading.exec(Y);if(J)return{type:"heading",raw:J[0],depth:J[1].length,text:J[2]}},ae.nptable=function(Y){var J=this.rules.block.nptable.exec(Y);if(J){var q={type:"table",header:X(J[1].replace(/^ *| *\| *$/g,"")),align:J[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:J[3]?J[3].replace(/\n$/,"").split(`
`):[],raw:J[0]};if(q.header.length===q.align.length){var re=q.align.length,ge;for(ge=0;ge<re;ge++)/^ *-+: *$/.test(q.align[ge])?q.align[ge]="right":/^ *:-+: *$/.test(q.align[ge])?q.align[ge]="center":/^ *:-+ *$/.test(q.align[ge])?q.align[ge]="left":q.align[ge]=null;for(re=q.cells.length,ge=0;ge<re;ge++)q.cells[ge]=X(q.cells[ge],q.header.length);return q}}},ae.hr=function(Y){var J=this.rules.block.hr.exec(Y);if(J)return{type:"hr",raw:J[0]}},ae.blockquote=function(Y){var J=this.rules.block.blockquote.exec(Y);if(J){var q=J[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:J[0],text:q}}},ae.list=function(Y){var J=this.rules.block.list.exec(Y);if(J){for(var q=J[0],re=J[2],ge=re.length>1,Ae=re[re.length-1]===")",Be={type:"list",raw:q,ordered:ge,start:ge?+re.slice(0,-1):"",loose:!1,items:[]},lt=J[0].match(this.rules.block.item),Pe=!1,Ye,ht,ot,it,Ot,xt,Ct,bt=lt.length,at=0;at<bt;at++)Ye=lt[at],q=Ye,ht=Ye.length,Ye=Ye.replace(/^ *([*+-]|\d+[.)]) */,""),~Ye.indexOf(`
`)&&(ht-=Ye.length,Ye=this.options.pedantic?Ye.replace(/^ {1,4}/gm,""):Ye.replace(new RegExp("^ {1,"+ht+"}","gm"),"")),at!==bt-1&&(ot=this.rules.block.bullet.exec(lt[at+1])[0],(ge?ot.length===1||!Ae&&ot[ot.length-1]===")":ot.length>1||this.options.smartLists&&ot!==re)&&(it=lt.slice(at+1).join(`
`),Be.raw=Be.raw.substring(0,Be.raw.length-it.length),at=bt-1)),Ot=Pe||/\n\n(?!\s*$)/.test(Ye),at!==bt-1&&(Pe=Ye.charAt(Ye.length-1)===`
`,Ot||(Ot=Pe)),Ot&&(Be.loose=!0),xt=/^\[[ xX]\] /.test(Ye),Ct=void 0,xt&&(Ct=Ye[1]!==" ",Ye=Ye.replace(/^\[[ xX]\] +/,"")),Be.items.push({type:"list_item",raw:q,task:xt,checked:Ct,loose:Ot,text:Ye});return Be}},ae.html=function(Y){var J=this.rules.block.html.exec(Y);if(J)return{type:this.options.sanitize?"paragraph":"html",raw:J[0],pre:!this.options.sanitizer&&(J[1]==="pre"||J[1]==="script"||J[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(J[0]):$(J[0]):J[0]}},ae.def=function(Y){var J=this.rules.block.def.exec(Y);if(J){J[3]&&(J[3]=J[3].substring(1,J[3].length-1));var q=J[1].toLowerCase().replace(/\s+/g," ");return{tag:q,raw:J[0],href:J[2],title:J[3]}}},ae.table=function(Y){var J=this.rules.block.table.exec(Y);if(J){var q={type:"table",header:X(J[1].replace(/^ *| *\| *$/g,"")),align:J[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:J[3]?J[3].replace(/\n$/,"").split(`
`):[]};if(q.header.length===q.align.length){q.raw=J[0];var re=q.align.length,ge;for(ge=0;ge<re;ge++)/^ *-+: *$/.test(q.align[ge])?q.align[ge]="right":/^ *:-+: *$/.test(q.align[ge])?q.align[ge]="center":/^ *:-+ *$/.test(q.align[ge])?q.align[ge]="left":q.align[ge]=null;for(re=q.cells.length,ge=0;ge<re;ge++)q.cells[ge]=X(q.cells[ge].replace(/^ *\| *| *\| *$/g,""),q.header.length);return q}}},ae.lheading=function(Y){var J=this.rules.block.lheading.exec(Y);if(J)return{type:"heading",raw:J[0],depth:J[2].charAt(0)==="="?1:2,text:J[1]}},ae.paragraph=function(Y){var J=this.rules.block.paragraph.exec(Y);if(J)return{type:"paragraph",raw:J[0],text:J[1].charAt(J[1].length-1)===`
`?J[1].slice(0,-1):J[1]}},ae.text=function(Y,J){var q=this.rules.block.text.exec(Y);if(q){var re=J[J.length-1];return re&&re.type==="text"?{raw:q[0],text:q[0]}:{type:"text",raw:q[0],text:q[0]}}},ae.escape=function(Y){var J=this.rules.inline.escape.exec(Y);if(J)return{type:"escape",raw:J[0],text:$(J[1])}},ae.tag=function(Y,J,q){var re=this.rules.inline.tag.exec(Y);if(re)return!J&&/^<a /i.test(re[0])?J=!0:J&&/^<\/a>/i.test(re[0])&&(J=!1),!q&&/^<(pre|code|kbd|script)(\s|>)/i.test(re[0])?q=!0:q&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(re[0])&&(q=!1),{type:this.options.sanitize?"text":"html",raw:re[0],inLink:J,inRawBlock:q,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(re[0]):$(re[0]):re[0]}},ae.link=function(Y){var J=this.rules.inline.link.exec(Y);if(J){var q=ne(J[2],"()");if(q>-1){var re=J[0].indexOf("!")===0?5:4,ge=re+J[1].length+q;J[2]=J[2].substring(0,q),J[0]=J[0].substring(0,ge).trim(),J[3]=""}var Ae=J[2],Be="";if(this.options.pedantic){var lt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Ae);lt?(Ae=lt[1],Be=lt[3]):Be=""}else Be=J[3]?J[3].slice(1,-1):"";Ae=Ae.trim().replace(/^<([\s\S]*)>$/,"$1");var Pe=ue(J,{href:Ae&&Ae.replace(this.rules.inline._escapes,"$1"),title:Be&&Be.replace(this.rules.inline._escapes,"$1")},J[0]);return Pe}},ae.reflink=function(Y,J){var q;if((q=this.rules.inline.reflink.exec(Y))||(q=this.rules.inline.nolink.exec(Y))){var re=(q[2]||q[1]).replace(/\s+/g," ");if(re=J[re.toLowerCase()],!re||!re.href){var ge=q[0].charAt(0);return{type:"text",raw:ge,text:ge}}var Ae=ue(q,re,q[0]);return Ae}},ae.strong=function(Y,J,q){q===void 0&&(q="");var re=this.rules.inline.strong.start.exec(Y);if(re&&(!re[1]||re[1]&&(q===""||this.rules.inline.punctuation.exec(q)))){J=J.slice(-1*Y.length);var ge=re[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;ge.lastIndex=0;for(var Ae;(re=ge.exec(J))!=null;)if(Ae=this.rules.inline.strong.middle.exec(J.slice(0,re.index+3)),Ae)return{type:"strong",raw:Y.slice(0,Ae[0].length),text:Y.slice(2,Ae[0].length-2)}}},ae.em=function(Y,J,q){q===void 0&&(q="");var re=this.rules.inline.em.start.exec(Y);if(re&&(!re[1]||re[1]&&(q===""||this.rules.inline.punctuation.exec(q)))){J=J.slice(-1*Y.length);var ge=re[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;ge.lastIndex=0;for(var Ae;(re=ge.exec(J))!=null;)if(Ae=this.rules.inline.em.middle.exec(J.slice(0,re.index+2)),Ae)return{type:"em",raw:Y.slice(0,Ae[0].length),text:Y.slice(1,Ae[0].length-1)}}},ae.codespan=function(Y){var J=this.rules.inline.code.exec(Y);if(J){var q=J[2].replace(/\n/g," "),re=/[^ ]/.test(q),ge=q.startsWith(" ")&&q.endsWith(" ");return re&&ge&&(q=q.substring(1,q.length-1)),q=$(q,!0),{type:"codespan",raw:J[0],text:q}}},ae.br=function(Y){var J=this.rules.inline.br.exec(Y);if(J)return{type:"br",raw:J[0]}},ae.del=function(Y){var J=this.rules.inline.del.exec(Y);if(J)return{type:"del",raw:J[0],text:J[1]}},ae.autolink=function(Y,J){var q=this.rules.inline.autolink.exec(Y);if(q){var re,ge;return q[2]==="@"?(re=$(this.options.mangle?J(q[1]):q[1]),ge="mailto:"+re):(re=$(q[1]),ge=re),{type:"link",raw:q[0],text:re,href:ge,tokens:[{type:"text",raw:re,text:re}]}}},ae.url=function(Y,J){var q;if(q=this.rules.inline.url.exec(Y)){var re,ge;if(q[2]==="@")re=$(this.options.mangle?J(q[0]):q[0]),ge="mailto:"+re;else{var Ae;do Ae=q[0],q[0]=this.rules.inline._backpedal.exec(q[0])[0];while(Ae!==q[0]);re=$(q[0]),q[1]==="www."?ge="http://"+re:ge=re}return{type:"link",raw:q[0],text:re,href:ge,tokens:[{type:"text",raw:re,text:re}]}}},ae.inlineText=function(Y,J,q){var re=this.rules.inline.text.exec(Y);if(re){var ge;return J?ge=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(re[0]):$(re[0]):re[0]:ge=$(this.options.smartypants?q(re[0]):re[0]),{type:"text",raw:re[0],text:ge}}},le}(),de=Q.noopTest,ce=Q.edit,fe=Q.merge,te={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:de,table:de,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};te._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,te._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,te.def=ce(te.def).replace("label",te._label).replace("title",te._title).getRegex(),te.bullet=/(?:[*+-]|\d{1,9}[.)])/,te.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,te.item=ce(te.item,"gm").replace(/bull/g,te.bullet).getRegex(),te.list=ce(te.list).replace(/bull/g,te.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+te.def.source+")").getRegex(),te._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",te._comment=/<!--(?!-?>)[\s\S]*?-->/,te.html=ce(te.html,"i").replace("comment",te._comment).replace("tag",te._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),te.paragraph=ce(te._paragraph).replace("hr",te.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",te._tag).getRegex(),te.blockquote=ce(te.blockquote).replace("paragraph",te.paragraph).getRegex(),te.normal=fe({},te),te.gfm=fe({},te.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*|$)"}),te.gfm.nptable=ce(te.gfm.nptable).replace("hr",te.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",te._tag).getRegex(),te.gfm.table=ce(te.gfm.table).replace("hr",te.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",te._tag).getRegex(),te.pedantic=fe({},te.normal,{html:ce(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",te._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:de,paragraph:ce(te.normal._paragraph).replace("hr",te.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",te.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var se={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:de,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:de,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};se._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",se.punctuation=ce(se.punctuation).replace(/punctuation/g,se._punctuation).getRegex(),se._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",se._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",se.em.start=ce(se.em.start).replace(/punctuation/g,se._punctuation).getRegex(),se.em.middle=ce(se.em.middle).replace(/punctuation/g,se._punctuation).replace(/overlapSkip/g,se._overlapSkip).getRegex(),se.em.endAst=ce(se.em.endAst,"g").replace(/punctuation/g,se._punctuation).getRegex(),se.em.endUnd=ce(se.em.endUnd,"g").replace(/punctuation/g,se._punctuation).getRegex(),se.strong.start=ce(se.strong.start).replace(/punctuation/g,se._punctuation).getRegex(),se.strong.middle=ce(se.strong.middle).replace(/punctuation/g,se._punctuation).replace(/blockSkip/g,se._blockSkip).getRegex(),se.strong.endAst=ce(se.strong.endAst,"g").replace(/punctuation/g,se._punctuation).getRegex(),se.strong.endUnd=ce(se.strong.endUnd,"g").replace(/punctuation/g,se._punctuation).getRegex(),se.blockSkip=ce(se._blockSkip,"g").getRegex(),se.overlapSkip=ce(se._overlapSkip,"g").getRegex(),se._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,se._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,se._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])?)+(?![-_])/,se.autolink=ce(se.autolink).replace("scheme",se._scheme).replace("email",se._email).getRegex(),se._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,se.tag=ce(se.tag).replace("comment",te._comment).replace("attribute",se._attribute).getRegex(),se._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,se._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,se._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,se.link=ce(se.link).replace("label",se._label).replace("href",se._href).replace("title",se._title).getRegex(),se.reflink=ce(se.reflink).replace("label",se._label).getRegex(),se.reflinkSearch=ce(se.reflinkSearch,"g").replace("reflink",se.reflink).replace("nolink",se.nolink).getRegex(),se.normal=fe({},se),se.pedantic=fe({},se.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",se._label).getRegex(),reflink:ce(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",se._label).getRegex()}),se.gfm=fe({},se.normal,{escape:ce(se.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),se.gfm.url=ce(se.gfm.url,"i").replace("email",se.gfm._extended_email).getRegex(),se.breaks=fe({},se.gfm,{br:ce(se.br).replace("{2,}","*").getRegex(),text:ce(se.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var Ee={block:te,inline:se},ke=N.defaults,Le=Ee.block,We=Ee.inline;function Xe(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 we(le){var ae="",oe,Y,J=le.length;for(oe=0;oe<J;oe++)Y=le.charCodeAt(oe),Math.random()>.5&&(Y="x"+Y.toString(16)),ae+="&#"+Y+";";return ae}var Re=function(){function le(oe){this.tokens=[],this.tokens.links=Object.create(null),this.options=oe||ke,this.options.tokenizer=this.options.tokenizer||new pe,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var Y={block:Le.normal,inline:We.normal};this.options.pedantic?(Y.block=Le.pedantic,Y.inline=We.pedantic):this.options.gfm&&(Y.block=Le.gfm,this.options.breaks?Y.inline=We.breaks:Y.inline=We.gfm),this.tokenizer.rules=Y}le.lex=function(Y,J){var q=new le(J);return q.lex(Y)};var ae=le.prototype;return ae.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},ae.blockTokens=function(Y,J,q){J===void 0&&(J=[]),q===void 0&&(q=!0),Y=Y.replace(/^ +$/gm,"");for(var re,ge,Ae,Be;Y;){if(re=this.tokenizer.space(Y)){Y=Y.substring(re.raw.length),re.type&&J.push(re);continue}if(re=this.tokenizer.code(Y,J)){Y=Y.substring(re.raw.length),re.type?J.push(re):(Be=J[J.length-1],Be.raw+=`
`+re.raw,Be.text+=`
`+re.text);continue}if(re=this.tokenizer.fences(Y)){Y=Y.substring(re.raw.length),J.push(re);continue}if(re=this.tokenizer.heading(Y)){Y=Y.substring(re.raw.length),J.push(re);continue}if(re=this.tokenizer.nptable(Y)){Y=Y.substring(re.raw.length),J.push(re);continue}if(re=this.tokenizer.hr(Y)){Y=Y.substring(re.raw.length),J.push(re);continue}if(re=this.tokenizer.blockquote(Y)){Y=Y.substring(re.raw.length),re.tokens=this.blockTokens(re.text,[],q),J.push(re);continue}if(re=this.tokenizer.list(Y)){for(Y=Y.substring(re.raw.length),Ae=re.items.length,ge=0;ge<Ae;ge++)re.items[ge].tokens=this.blockTokens(re.items[ge].text,[],!1);J.push(re);continue}if(re=this.tokenizer.html(Y)){Y=Y.substring(re.raw.length),J.push(re);continue}if(q&&(re=this.tokenizer.def(Y))){Y=Y.substring(re.raw.length),this.tokens.links[re.tag]||(this.tokens.links[re.tag]={href:re.href,title:re.title});continue}if(re=this.tokenizer.table(Y)){Y=Y.substring(re.raw.length),J.push(re);continue}if(re=this.tokenizer.lheading(Y)){Y=Y.substring(re.raw.length),J.push(re);continue}if(q&&(re=this.tokenizer.paragraph(Y))){Y=Y.substring(re.raw.length),J.push(re);continue}if(re=this.tokenizer.text(Y,J)){Y=Y.substring(re.raw.length),re.type?J.push(re):(Be=J[J.length-1],Be.raw+=`
`+re.raw,Be.text+=`
`+re.text);continue}if(Y){var lt="Infinite loop on byte: "+Y.charCodeAt(0);if(this.options.silent){console.error(lt);break}else throw new Error(lt)}}return J},ae.inline=function(Y){var J,q,re,ge,Ae,Be,lt=Y.length;for(J=0;J<lt;J++){Be=Y[J];switch(Be.type){case"paragraph":case"text":case"heading":{Be.tokens=[],this.inlineTokens(Be.text,Be.tokens);break}case"table":{for(Be.tokens={header:[],cells:[]},ge=Be.header.length,q=0;q<ge;q++)Be.tokens.header[q]=[],this.inlineTokens(Be.header[q],Be.tokens.header[q]);for(ge=Be.cells.length,q=0;q<ge;q++)for(Ae=Be.cells[q],Be.tokens.cells[q]=[],re=0;re<Ae.length;re++)Be.tokens.cells[q][re]=[],this.inlineTokens(Ae[re],Be.tokens.cells[q][re]);break}case"blockquote":{this.inline(Be.tokens);break}case"list":{for(ge=Be.items.length,q=0;q<ge;q++)this.inline(Be.items[q].tokens);break}}}return Y},ae.inlineTokens=function(Y,J,q,re,ge){J===void 0&&(J=[]),q===void 0&&(q=!1),re===void 0&&(re=!1),ge===void 0&&(ge="");var Ae,Be=Y,lt;if(this.tokens.links){var Pe=Object.keys(this.tokens.links);if(Pe.length>0)for(;(lt=this.tokenizer.rules.inline.reflinkSearch.exec(Be))!=null;)Pe.includes(lt[0].slice(lt[0].lastIndexOf("[")+1,-1))&&(Be=Be.slice(0,lt.index)+"["+"a".repeat(lt[0].length-2)+"]"+Be.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(lt=this.tokenizer.rules.inline.blockSkip.exec(Be))!=null;)Be=Be.slice(0,lt.index)+"["+"a".repeat(lt[0].length-2)+"]"+Be.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;Y;){if(Ae=this.tokenizer.escape(Y)){Y=Y.substring(Ae.raw.length),J.push(Ae);continue}if(Ae=this.tokenizer.tag(Y,q,re)){Y=Y.substring(Ae.raw.length),q=Ae.inLink,re=Ae.inRawBlock,J.push(Ae);continue}if(Ae=this.tokenizer.link(Y)){Y=Y.substring(Ae.raw.length),Ae.type==="link"&&(Ae.tokens=this.inlineTokens(Ae.text,[],!0,re)),J.push(Ae);continue}if(Ae=this.tokenizer.reflink(Y,this.tokens.links)){Y=Y.substring(Ae.raw.length),Ae.type==="link"&&(Ae.tokens=this.inlineTokens(Ae.text,[],!0,re)),J.push(Ae);continue}if(Ae=this.tokenizer.strong(Y,Be,ge)){Y=Y.substring(Ae.raw.length),Ae.tokens=this.inlineTokens(Ae.text,[],q,re),J.push(Ae);continue}if(Ae=this.tokenizer.em(Y,Be,ge)){Y=Y.substring(Ae.raw.length),Ae.tokens=this.inlineTokens(Ae.text,[],q,re),J.push(Ae);continue}if(Ae=this.tokenizer.codespan(Y)){Y=Y.substring(Ae.raw.length),J.push(Ae);continue}if(Ae=this.tokenizer.br(Y)){Y=Y.substring(Ae.raw.length),J.push(Ae);continue}if(Ae=this.tokenizer.del(Y)){Y=Y.substring(Ae.raw.length),Ae.tokens=this.inlineTokens(Ae.text,[],q,re),J.push(Ae);continue}if(Ae=this.tokenizer.autolink(Y,we)){Y=Y.substring(Ae.raw.length),J.push(Ae);continue}if(!q&&(Ae=this.tokenizer.url(Y,we))){Y=Y.substring(Ae.raw.length),J.push(Ae);continue}if(Ae=this.tokenizer.inlineText(Y,re,Xe)){Y=Y.substring(Ae.raw.length),ge=Ae.raw.slice(-1),J.push(Ae);continue}if(Y){var Ye="Infinite loop on byte: "+Y.charCodeAt(0);if(this.options.silent){console.error(Ye);break}else throw new Error(Ye)}}return J},H(le,null,[{key:"rules",get:function(){return{block:Le,inline:We}}}]),le}(),De=N.defaults,He=Q.cleanUrl,Ve=Q.escape,Ce=function(){function le(oe){this.options=oe||De}var ae=le.prototype;return ae.code=function(Y,J,q){var re=(J||"").match(/\S*/)[0];if(this.options.highlight){var ge=this.options.highlight(Y,re);ge!=null&&ge!==Y&&(q=!0,Y=ge)}return re?'<pre><code class="'+this.options.langPrefix+Ve(re,!0)+'">'+(q?Y:Ve(Y,!0))+`</code></pre>
`:"<pre><code>"+(q?Y:Ve(Y,!0))+`</code></pre>
`},ae.blockquote=function(Y){return`<blockquote>
`+Y+`</blockquote>
`},ae.html=function(Y){return Y},ae.heading=function(Y,J,q,re){return this.options.headerIds?"<h"+J+' id="'+this.options.headerPrefix+re.slug(q)+'">'+Y+"</h"+J+`>
`:"<h"+J+">"+Y+"</h"+J+`>
`},ae.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},ae.list=function(Y,J,q){var re=J?"ol":"ul",ge=J&&q!==1?' start="'+q+'"':"";return"<"+re+ge+`>
`+Y+"</"+re+`>
`},ae.listitem=function(Y){return"<li>"+Y+`</li>
`},ae.checkbox=function(Y){return"<input "+(Y?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},ae.paragraph=function(Y){return"<p>"+Y+`</p>
`},ae.table=function(Y,J){return J&&(J="<tbody>"+J+"</tbody>"),`<table>
<thead>
`+Y+`</thead>
`+J+`</table>
`},ae.tablerow=function(Y){return`<tr>
`+Y+`</tr>
`},ae.tablecell=function(Y,J){var q=J.header?"th":"td",re=J.align?"<"+q+' align="'+J.align+'">':"<"+q+">";return re+Y+"</"+q+`>
`},ae.strong=function(Y){return"<strong>"+Y+"</strong>"},ae.em=function(Y){return"<em>"+Y+"</em>"},ae.codespan=function(Y){return"<code>"+Y+"</code>"},ae.br=function(){return this.options.xhtml?"<br/>":"<br>"},ae.del=function(Y){return"<del>"+Y+"</del>"},ae.link=function(Y,J,q){if(Y=He(this.options.sanitize,this.options.baseUrl,Y),Y===null)return q;var re='<a href="'+Ve(Y)+'"';return J&&(re+=' title="'+J+'"'),re+=">"+q+"</a>",re},ae.image=function(Y,J,q){if(Y=He(this.options.sanitize,this.options.baseUrl,Y),Y===null)return q;var re='<img src="'+Y+'" alt="'+q+'"';return J&&(re+=' title="'+J+'"'),re+=this.options.xhtml?"/>":">",re},ae.text=function(Y){return Y},le}(),Me=function(){function le(){}var ae=le.prototype;return ae.strong=function(Y){return Y},ae.em=function(Y){return Y},ae.codespan=function(Y){return Y},ae.del=function(Y){return Y},ae.html=function(Y){return Y},ae.text=function(Y){return Y},ae.link=function(Y,J,q){return""+q},ae.image=function(Y,J,q){return""+q},ae.br=function(){return""},le}(),qe=function(){function le(){this.seen={}}var ae=le.prototype;return ae.slug=function(Y){var J=Y.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(J)){var q=J;do this.seen[q]++,J=q+"-"+this.seen[q];while(this.seen.hasOwnProperty(J))}return this.seen[J]=0,J},le}(),tt=N.defaults,Ke=Q.unescape,Ne=function(){function le(oe){this.options=oe||tt,this.options.renderer=this.options.renderer||new Ce,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Me,this.slugger=new qe}le.parse=function(Y,J){var q=new le(J);return q.parse(Y)};var ae=le.prototype;return ae.parse=function(Y,J){J===void 0&&(J=!0);var q="",re,ge,Ae,Be,lt,Pe,Ye,ht,ot,it,Ot,xt,Ct,bt,at,Et,Lt,Rt,Ht=Y.length;for(re=0;re<Ht;re++){it=Y[re];switch(it.type){case"space":continue;case"hr":{q+=this.renderer.hr();continue}case"heading":{q+=this.renderer.heading(this.parseInline(it.tokens),it.depth,Ke(this.parseInline(it.tokens,this.textRenderer)),this.slugger);continue}case"code":{q+=this.renderer.code(it.text,it.lang,it.escaped);continue}case"table":{for(ht="",Ye="",Be=it.header.length,ge=0;ge<Be;ge++)Ye+=this.renderer.tablecell(this.parseInline(it.tokens.header[ge]),{header:!0,align:it.align[ge]});for(ht+=this.renderer.tablerow(Ye),ot="",Be=it.cells.length,ge=0;ge<Be;ge++){for(Pe=it.tokens.cells[ge],Ye="",lt=Pe.length,Ae=0;Ae<lt;Ae++)Ye+=this.renderer.tablecell(this.parseInline(Pe[Ae]),{header:!1,align:it.align[Ae]});ot+=this.renderer.tablerow(Ye)}q+=this.renderer.table(ht,ot);continue}case"blockquote":{ot=this.parse(it.tokens),q+=this.renderer.blockquote(ot);continue}case"list":{for(Ot=it.ordered,xt=it.start,Ct=it.loose,Be=it.items.length,ot="",ge=0;ge<Be;ge++)at=it.items[ge],Et=at.checked,Lt=at.task,bt="",at.task&&(Rt=this.renderer.checkbox(Et),Ct?at.tokens.length>0&&at.tokens[0].type==="text"?(at.tokens[0].text=Rt+" "+at.tokens[0].text,at.tokens[0].tokens&&at.tokens[0].tokens.length>0&&at.tokens[0].tokens[0].type==="text"&&(at.tokens[0].tokens[0].text=Rt+" "+at.tokens[0].tokens[0].text)):at.tokens.unshift({type:"text",text:Rt}):bt+=Rt),bt+=this.parse(at.tokens,Ct),ot+=this.renderer.listitem(bt,Lt,Et);q+=this.renderer.list(ot,Ot,xt);continue}case"html":{q+=this.renderer.html(it.text);continue}case"paragraph":{q+=this.renderer.paragraph(this.parseInline(it.tokens));continue}case"text":{for(ot=it.tokens?this.parseInline(it.tokens):it.text;re+1<Ht&&Y[re+1].type==="text";)it=Y[++re],ot+=`
`+(it.tokens?this.parseInline(it.tokens):it.text);q+=J?this.renderer.paragraph(ot):ot;continue}default:{var nr='Token with "'+it.type+'" type was not found.';if(this.options.silent){console.error(nr);return}else throw new Error(nr)}}}return q},ae.parseInline=function(Y,J){J=J||this.renderer;var q="",re,ge,Ae=Y.length;for(re=0;re<Ae;re++){ge=Y[re];switch(ge.type){case"escape":{q+=J.text(ge.text);break}case"html":{q+=J.html(ge.text);break}case"link":{q+=J.link(ge.href,ge.title,this.parseInline(ge.tokens,J));break}case"image":{q+=J.image(ge.href,ge.title,ge.text);break}case"strong":{q+=J.strong(this.parseInline(ge.tokens,J));break}case"em":{q+=J.em(this.parseInline(ge.tokens,J));break}case"codespan":{q+=J.codespan(ge.text);break}case"br":{q+=J.br();break}case"del":{q+=J.del(this.parseInline(ge.tokens,J));break}case"text":{q+=J.text(ge.text);break}default:{var Be='Token with "'+ge.type+'" type was not found.';if(this.options.silent){console.error(Be);return}else throw new Error(Be)}}}return q},le}(),rt=Q.merge,Je=Q.checkSanitizeDeprecation,Ze=Q.escape,ye=N.getDefaults,$e=N.changeDefaults,Ge=N.defaults;function ve(le,ae,oe){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 ae=="function"&&(oe=ae,ae=null),ae=rt({},ve.defaults,ae||{}),Je(ae),oe){var Y=ae.highlight,J;try{J=Re.lex(le,ae)}catch(Ae){return oe(Ae)}var q=function(Be){var lt;if(!Be)try{lt=Ne.parse(J,ae)}catch(Pe){Be=Pe}return ae.highlight=Y,Be?oe(Be):oe(null,lt)};if(!Y||Y.length<3)return q();if(delete ae.highlight,!J.length)return q();var re=0;ve.walkTokens(J,function(Ae){Ae.type==="code"&&(re++,setTimeout(function(){Y(Ae.text,Ae.lang,function(Be,lt){if(Be)return q(Be);lt!=null&&lt!==Ae.text&&(Ae.text=lt,Ae.escaped=!0),re--,re===0&&q()})},0))}),re===0&&q();return}try{var ge=Re.lex(le,ae);return ae.walkTokens&&ve.walkTokens(ge,ae.walkTokens),Ne.parse(ge,ae)}catch(Ae){if(Ae.message+=`
Please report this to https://github.com/markedjs/marked.`,ae.silent)return"<p>An error occurred:</p><pre>"+Ze(Ae.message+"",!0)+"</pre>";throw Ae}}ve.options=ve.setOptions=function(le){return rt(ve.defaults,le),$e(ve.defaults),ve},ve.getDefaults=ye,ve.defaults=Ge,ve.use=function(le){var ae=rt({},le);if(le.renderer&&function(){var Y=ve.defaults.renderer||new Ce,J=function(ge){var Ae=Y[ge];Y[ge]=function(){for(var Be=arguments.length,lt=new Array(Be),Pe=0;Pe<Be;Pe++)lt[Pe]=arguments[Pe];var Ye=le.renderer[ge].apply(Y,lt);return Ye===!1&&(Ye=Ae.apply(Y,lt)),Ye}};for(var q in le.renderer)J(q);ae.renderer=Y}(),le.tokenizer&&function(){var Y=ve.defaults.tokenizer||new pe,J=function(ge){var Ae=Y[ge];Y[ge]=function(){for(var Be=arguments.length,lt=new Array(Be),Pe=0;Pe<Be;Pe++)lt[Pe]=arguments[Pe];var Ye=le.tokenizer[ge].apply(Y,lt);return Ye===!1&&(Ye=Ae.apply(Y,lt)),Ye}};for(var q in le.tokenizer)J(q);ae.tokenizer=Y}(),le.walkTokens){var oe=ve.defaults.walkTokens;ae.walkTokens=function(Y){le.walkTokens(Y),oe&&oe(Y)}}ve.setOptions(ae)},ve.walkTokens=function(le,ae){for(var oe=P(le),Y;!(Y=oe()).done;){var J=Y.value;ae(J);switch(J.type){case"table":{for(var q=P(J.tokens.header),re;!(re=q()).done;){var ge=re.value;ve.walkTokens(ge,ae)}for(var Ae=P(J.tokens.cells),Be;!(Be=Ae()).done;)for(var lt=Be.value,Pe=P(lt),Ye;!(Ye=Pe()).done;){var ht=Ye.value;ve.walkTokens(ht,ae)}break}case"list":{ve.walkTokens(J.items,ae);break}default:J.tokens&&ve.walkTokens(J.tokens,ae)}}},ve.Parser=Ne,ve.parser=Ne.parse,ve.Renderer=Ce,ve.TextRenderer=Me,ve.Lexer=Re,ve.lexer=Re.lex,ve.Tokenizer=pe,ve.Slugger=qe,ve.parse=ve;var Ie=ve;return Ie})},E7E6:function(xe,be){xe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADUCAYAAADZTGx+AAAgAElEQVR4Xu2dC3BU13nHv7MrIQkQQoCEtAIEAmxig4GACxhogpM6NY7jOKZO4nimwcFot23SNNNO02napJN0JjN9TNMm5eG3x4+YSeI3ftUGjCDGQMBgG4wxb+0u4mEeQhJI2tP539WR7i77uPfuvXfvar8zs7Mr7bnn8Z3vt9/5zlMQB5aAQQmsW7fO397eHujp6Rkfi8XGExFeDX2vABHVSSlrhBDDiKhdSnlOCBGWUu4mol1lZWWv3nfffccNZueJaMITpeBCeEICjz/++LCOjo5GIpogpWwUQjT2vU/A/wCClNJvtbBCCCml3CaEeGzChAmPLF269LLVtNx6jgFxS9IeyOehhx6q7OnpmSilnEhE2gsA4L0PhjHZillRUUHl5WUUf6+giop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hBA5Is9La2trqenp6biGi2lJhv0eZcxhVq4xRIuU8Qid1CCKyB31VSUrK1trY2WiBlz1rMQQVIqtpeuHBidEcHzZIy/iLSXtfyWrGsupEQIb7WiT4iot1CxF9Dh9LuESPGnTGXUmHFHvSApGoOzLm0tbU19vb2TpVSThGCphLJKVLSVCFoYrHCAwikpCNC0MdE4qCU9LEQ4qDf7/+4trb2aN/cRGFpeI6lLUpAMslMSulva2ub2NPT0+TzyUAsJup9PgpIKQNSinohtM/1RFRo5/1cFkJEpKSwEDIihAjHYhT2+WQkFhPhkpKSQ7W1tUdwsnmOOjWoHmdALDbn+fPnR3V2dgKW0ULEqmIxUSWlHCmErJJSVAlBVVIS3kcS4X9ULoQolVKWZnpHcaSU3UKI7szv1EUkzuNSKSEI7+eFkOelFOeFEOd8Pnz24fOZioqKcFVV1VmLVS3qx/4fQLyzKIIkCJoAAAAASUVORK5CYII="},ELLl:function(xe,be,z){(function(Z){Z(z("VrN/"))})(function(Z){var H={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},w=Z.Pos;Z.defineOption("autoCloseBrackets",!1,function(E,b,d){d&&d!=Z.Init&&(E.removeKeyMap(P),E.state.closeBrackets=null),b&&(M(W(b,"pairs")),E.state.closeBrackets=b,E.addKeyMap(P))});function W(E,b){return b=="pairs"&&typeof E=="string"?E:typeof E=="object"&&E[b]!=null?E[b]:H[b]}var P={Backspace:O,Enter:R};function M(E){for(var b=0;b<E.length;b++){var d=E.charAt(b),a="'"+d+"'";P[a]||(P[a]=N(d))}}M(H.pairs+"`");function N(E){return function(b){return v(b,E)}}function k(E){var b=E.state.closeBrackets;if(!b||b.override)return b;var d=E.getModeAt(E.getCursor());return d.closeBrackets||b}function O(E){var b=k(E);if(!b||E.getOption("disableInput"))return Z.Pass;for(var d=W(b,"pairs"),a=E.listSelections(),l=0;l<a.length;l++){if(!a[l].empty())return Z.Pass;var u=L(E,a[l].head);if(!u||d.indexOf(u)%2!=0)return Z.Pass}for(var l=a.length-1;l>=0;l--){var C=a[l].head;E.replaceRange("",w(C.line,C.ch-1),w(C.line,C.ch+1),"+delete")}}function R(E){var b=k(E),d=b&&W(b,"explode");if(!d||E.getOption("disableInput"))return Z.Pass;for(var a=E.listSelections(),l=0;l<a.length;l++){if(!a[l].empty())return Z.Pass;var u=L(E,a[l].head);if(!u||d.indexOf(u)%2!=0)return Z.Pass}E.operation(function(){var C=E.lineSeparator()||`
`;E.replaceSelection(C+C,null),E.execCommand("goCharLeft"),a=E.listSelections();for(var g=0;g<a.length;g++){var m=a[g].head.line;E.indentLine(m,null,!0),E.indentLine(m+1,null,!0)}})}function h(E){var b=Z.cmpPos(E.anchor,E.head)>0;return{anchor:new w(E.anchor.line,E.anchor.ch+(b?-1:1)),head:new w(E.head.line,E.head.ch+(b?1:-1))}}function v(E,b){var d=k(E);if(!d||E.getOption("disableInput"))return Z.Pass;var a=W(d,"pairs"),l=a.indexOf(b);if(l==-1)return Z.Pass;for(var u=W(d,"closeBefore"),C=W(d,"triples"),g=a.charAt(l+1)==b,m=E.listSelections(),D=l%2==0,A,f=0;f<m.length;f++){var c=m[f],s=c.head,o,x=E.getRange(s,w(s.line,s.ch+1));if(D&&!c.empty())o="surround";else if((g||!D)&&x==b)g&&S(E,s)?o="both":C.indexOf(b)>=0&&E.getRange(s,w(s.line,s.ch+3))==b+b+b?o="skipThree":o="skip";else if(g&&s.ch>1&&C.indexOf(b)>=0&&E.getRange(w(s.line,s.ch-2),s)==b+b){if(s.ch>2&&/\bstring/.test(E.getTokenTypeAt(w(s.line,s.ch-2))))return Z.Pass;o="addFour"}else if(g){var y=s.ch==0?" ":E.getRange(w(s.line,s.ch-1),s);if(!Z.isWordChar(x)&&y!=b&&!Z.isWordChar(y))o="both";else return Z.Pass}else if(D&&(x.length===0||/\s/.test(x)||u.indexOf(x)>-1))o="both";else return Z.Pass;if(!A)A=o;else if(A!=o)return Z.Pass}var p=l%2?a.charAt(l-1):b,I=l%2?b:a.charAt(l+1);E.operation(function(){if(A=="skip")E.execCommand("goCharRight");else if(A=="skipThree")for(var B=0;B<3;B++)E.execCommand("goCharRight");else if(A=="surround"){for(var F=E.getSelections(),B=0;B<F.length;B++)F[B]=p+F[B]+I;E.replaceSelections(F,"around"),F=E.listSelections().slice();for(var B=0;B<F.length;B++)F[B]=h(F[B]);E.setSelections(F)}else A=="both"?(E.replaceSelection(p+I,null),E.triggerElectric(p+I),E.execCommand("goCharLeft")):A=="addFour"&&(E.replaceSelection(p+p+p+p,"before"),E.execCommand("goCharRight"))})}function L(E,b){var d=E.getRange(w(b.line,b.ch-1),w(b.line,b.ch+1));return d.length==2?d:null}function S(E,b){var d=E.getTokenAt(w(b.line,b.ch+1));return/\bstring/.test(d.type)&&d.start==b.ch&&(b.ch==0||!/\bstring/.test(E.getTokenTypeAt(b)))}})},FOrL:function(xe,be,z){xe.exports=z.p+"static/nodata.a6b3f948.png"},FPkq:function(xe,be,z){xe.exports=z.p+"static/qrCode.dd0fe9b2.png"},GABl:function(xe,be){xe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAYAAADFeBvrAAAKi0lEQVRoQ71ae3BU1Rn//e7dzYuioNRsHlSqRiUB2eUx0hbaKAHEAMWxiQ6PTUAUGCuIQNVOZ0xnrHUE5GHHIqOwCag8BlQiQnnUokgt5AEIK5GnBpIFXwjkAdl7vs7dkJCETXLvEj3/5d7v9/u+337nfN8554bowBHo16+3YRh3K7IPBHcRSIDI9QJ0AWkA8h0E3xM8DWAvde5x6Pqe+D17jnVUGLxWogqPp78SGSeC3wP4ZUR8pJ+Ct50O7e344uKjEXFcBkUkSERY6e43RkE9JcCgawngaiw3O6A/l7CvaHckvLYFhTKi5B8C3B2JQ6sYEhvpcMxKKioqs4ox7SwLkvT0mFNnz82HqKkCaHacRGxL1gDybHJp6WKSYoXHkqBytzuF4FoR6WOFtKNtCP4b0c7s5N27v22Pu11B5e7+6ZTgBgE6t0f2Y74n8IUjOuo+1+7dx9vy06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dBowRi/0cFtcVM2xqq1FcErZyYKoZ8FkmWGoMjjwGy6MaYTsv82a9eaOuHue2DJ6KP3P/KxQYbOThkB8R6g2/i8xwcsbfyjsJQX2x50XhNWboigGcBrKam7RKRMqce+vodYwiSIOihREYAPN5wJJGDGdkQsdc6Gpxp/AtTt/2t4c9mghIKJvcU1O0VQVQk084yhjgHxKac9i45I+VZsTj3/SGI/MIyvjF6VqBrbAoTC6vDCjIfulZM/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(xe,be){xe.exports=function(Z,H,w,W){var P=w?w.call(W,Z,H):void 0;if(P!==void 0)return!!P;if(Z===H)return!0;if(typeof Z!="object"||!Z||typeof H!="object"||!H)return!1;var M=Object.keys(Z),N=Object.keys(H);if(M.length!==N.length)return!1;for(var k=Object.prototype.hasOwnProperty.bind(H),O=0;O<M.length;O++){var R=M[O];if(!k(R))return!1;var h=Z[R],v=H[R];if(P=w?w.call(W,h,v,R):void 0,P===!1||P===void 0&&h!==v)return!1}return!0}},H38U:function(xe,be,z){var Z=z("f4xo"),H=z("rcnY"),w=z("wU8J"),W=z("Iq15"),P=z("dWSS");function M(k,O){this.typeNumber=k,this.errorCorrectLevel=O,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}var N=M.prototype;N.addData=function(k){var O=new Z(k);this.dataList.push(O),this.dataCache=null},N.isDark=function(k,O){if(k<0||this.moduleCount<=k||O<0||this.moduleCount<=O)throw new Error(k+","+O);return this.modules[k][O]},N.getModuleCount=function(){return this.moduleCount},N.make=function(){if(this.typeNumber<1){var k=1;for(k=1;k<40;k++){for(var O=H.getRSBlocks(k,this.errorCorrectLevel),R=new w,h=0,v=0;v<O.length;v++)h+=O[v].dataCount;for(var v=0;v<this.dataList.length;v++){var L=this.dataList[v];R.put(L.mode,4),R.put(L.getLength(),W.getLengthInBits(L.mode,k)),L.write(R)}if(R.getLengthInBits()<=h*8)break}this.typeNumber=k}this.makeImpl(!1,this.getBestMaskPattern())},N.makeImpl=function(k,O){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var R=0;R<this.moduleCount;R++){this.modules[R]=new Array(this.moduleCount);for(var h=0;h<this.moduleCount;h++)this.modules[R][h]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(k,O),this.typeNumber>=7&&this.setupTypeNumber(k),this.dataCache==null&&(this.dataCache=M.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,O)},N.setupPositionProbePattern=function(k,O){for(var R=-1;R<=7;R++){if(k+R<=-1||this.moduleCount<=k+R)continue;for(var h=-1;h<=7;h++){if(O+h<=-1||this.moduleCount<=O+h)continue;0<=R&&R<=6&&(h==0||h==6)||0<=h&&h<=6&&(R==0||R==6)||2<=R&&R<=4&&2<=h&&h<=4?this.modules[k+R][O+h]=!0:this.modules[k+R][O+h]=!1}}},N.getBestMaskPattern=function(){for(var k=0,O=0,R=0;R<8;R++){this.makeImpl(!0,R);var h=W.getLostPoint(this);(R==0||k>h)&&(k=h,O=R)}return O},N.createMovieClip=function(k,O,R){var h=k.createEmptyMovieClip(O,R),v=1;this.make();for(var L=0;L<this.modules.length;L++)for(var S=L*v,E=0;E<this.modules[L].length;E++){var b=E*v,d=this.modules[L][E];d&&(h.beginFill(0,100),h.moveTo(b,S),h.lineTo(b+v,S),h.lineTo(b+v,S+v),h.lineTo(b,S+v),h.endFill())}return h},N.setupTimingPattern=function(){for(var k=8;k<this.moduleCount-8;k++){if(this.modules[k][6]!=null)continue;this.modules[k][6]=k%2==0}for(var O=8;O<this.moduleCount-8;O++){if(this.modules[6][O]!=null)continue;this.modules[6][O]=O%2==0}},N.setupPositionAdjustPattern=function(){for(var k=W.getPatternPosition(this.typeNumber),O=0;O<k.length;O++)for(var R=0;R<k.length;R++){var h=k[O],v=k[R];if(this.modules[h][v]!=null)continue;for(var L=-2;L<=2;L++)for(var S=-2;S<=2;S++)L==-2||L==2||S==-2||S==2||L==0&&S==0?this.modules[h+L][v+S]=!0:this.modules[h+L][v+S]=!1}},N.setupTypeNumber=function(k){for(var O=W.getBCHTypeNumber(this.typeNumber),R=0;R<18;R++){var h=!k&&(O>>R&1)==1;this.modules[Math.floor(R/3)][R%3+this.moduleCount-8-3]=h}for(var R=0;R<18;R++){var h=!k&&(O>>R&1)==1;this.modules[R%3+this.moduleCount-8-3][Math.floor(R/3)]=h}},N.setupTypeInfo=function(k,O){for(var R=this.errorCorrectLevel<<3|O,h=W.getBCHTypeInfo(R),v=0;v<15;v++){var L=!k&&(h>>v&1)==1;v<6?this.modules[v][8]=L:v<8?this.modules[v+1][8]=L:this.modules[this.moduleCount-15+v][8]=L}for(var v=0;v<15;v++){var L=!k&&(h>>v&1)==1;v<8?this.modules[8][this.moduleCount-v-1]=L:v<9?this.modules[8][15-v-1+1]=L:this.modules[8][15-v-1]=L}this.modules[this.moduleCount-8][8]=!k},N.mapData=function(k,O){for(var R=-1,h=this.moduleCount-1,v=7,L=0,S=this.moduleCount-1;S>0;S-=2)for(S==6&&S--;;){for(var E=0;E<2;E++)if(this.modules[h][S-E]==null){var b=!1;L<k.length&&(b=(k[L]>>>v&1)==1);var d=W.getMask(O,h,S-E);d&&(b=!b),this.modules[h][S-E]=b,v--,v==-1&&(L++,v=7)}if(h+=R,h<0||this.moduleCount<=h){h-=R,R=-R;break}}},M.PAD0=236,M.PAD1=17,M.createData=function(k,O,R){for(var h=H.getRSBlocks(k,O),v=new w,L=0;L<R.length;L++){var S=R[L];v.put(S.mode,4),v.put(S.getLength(),W.getLengthInBits(S.mode,k)),S.write(v)}for(var E=0,L=0;L<h.length;L++)E+=h[L].dataCount;if(v.getLengthInBits()>E*8)throw new Error("code length overflow. ("+v.getLengthInBits()+">"+E*8+")");for(v.getLengthInBits()+4<=E*8&&v.put(0,4);v.getLengthInBits()%8!=0;)v.putBit(!1);for(;!(v.getLengthInBits()>=E*8);){if(v.put(M.PAD0,8),v.getLengthInBits()>=E*8)break;v.put(M.PAD1,8)}return M.createBytes(v,h)},M.createBytes=function(k,O){for(var R=0,h=0,v=0,L=new Array(O.length),S=new Array(O.length),E=0;E<O.length;E++){var b=O[E].dataCount,d=O[E].totalCount-b;h=Math.max(h,b),v=Math.max(v,d),L[E]=new Array(b);for(var a=0;a<L[E].length;a++)L[E][a]=255&k.buffer[a+R];R+=b;var l=W.getErrorCorrectPolynomial(d),u=new P(L[E],l.getLength()-1),C=u.mod(l);S[E]=new Array(l.getLength()-1);for(var a=0;a<S[E].length;a++){var g=a+C.getLength()-S[E].length;S[E][a]=g>=0?C.get(g):0}}for(var m=0,a=0;a<O.length;a++)m+=O[a].totalCount;for(var D=new Array(m),A=0,a=0;a<h;a++)for(var E=0;E<O.length;E++)a<L[E].length&&(D[A++]=L[E][a]);for(var a=0;a<v;a++)for(var E=0;E<O.length;E++)a<S[E].length&&(D[A++]=S[E][a]);return D},xe.exports=M},HmJG:function(xe,be,z){},HpTS:function(xe,be,z){xe.exports=z.p+"static/small_program.f74069ec.png"},Iq15:function(xe,be,z){var Z=z("nVVt"),H=z("dWSS"),w=z("dQei"),W={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},P={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1<<10|1<<8|1<<5|1<<4|1<<2|1<<1|1<<0,G18:1<<12|1<<11|1<<10|1<<9|1<<8|1<<5|1<<2|1<<0,G15_MASK:1<<14|1<<12|1<<10|1<<4|1<<1,getBCHTypeInfo:function(M){for(var N=M<<10;P.getBCHDigit(N)-P.getBCHDigit(P.G15)>=0;)N^=P.G15<<P.getBCHDigit(N)-P.getBCHDigit(P.G15);return(M<<10|N)^P.G15_MASK},getBCHTypeNumber:function(M){for(var N=M<<12;P.getBCHDigit(N)-P.getBCHDigit(P.G18)>=0;)N^=P.G18<<P.getBCHDigit(N)-P.getBCHDigit(P.G18);return M<<12|N},getBCHDigit:function(M){for(var N=0;M!=0;)N++,M>>>=1;return N},getPatternPosition:function(M){return P.PATTERN_POSITION_TABLE[M-1]},getMask:function(M,N,k){switch(M){case W.PATTERN000:return(N+k)%2==0;case W.PATTERN001:return N%2==0;case W.PATTERN010:return k%3==0;case W.PATTERN011:return(N+k)%3==0;case W.PATTERN100:return(Math.floor(N/2)+Math.floor(k/3))%2==0;case W.PATTERN101:return N*k%2+N*k%3==0;case W.PATTERN110:return(N*k%2+N*k%3)%2==0;case W.PATTERN111:return(N*k%3+(N+k)%2)%2==0;default:throw new Error("bad maskPattern:"+M)}},getErrorCorrectPolynomial:function(M){for(var N=new H([1],0),k=0;k<M;k++)N=N.multiply(new H([1,w.gexp(k)],0));return N},getLengthInBits:function(M,N){if(1<=N&&N<10)switch(M){case Z.MODE_NUMBER:return 10;case Z.MODE_ALPHA_NUM:return 9;case Z.MODE_8BIT_BYTE:return 8;case Z.MODE_KANJI:return 8;default:throw new Error("mode:"+M)}else if(N<27)switch(M){case Z.MODE_NUMBER:return 12;case Z.MODE_ALPHA_NUM:return 11;case Z.MODE_8BIT_BYTE:return 16;case Z.MODE_KANJI:return 10;default:throw new Error("mode:"+M)}else if(N<41)switch(M){case Z.MODE_NUMBER:return 14;case Z.MODE_ALPHA_NUM:return 13;case Z.MODE_8BIT_BYTE:return 16;case Z.MODE_KANJI:return 12;default:throw new Error("mode:"+M)}else throw new Error("type:"+N)},getLostPoint:function(M){for(var N=M.getModuleCount(),k=0,O=0;O<N;O++)for(var R=0;R<N;R++){for(var h=0,v=M.isDark(O,R),L=-1;L<=1;L++){if(O+L<0||N<=O+L)continue;for(var S=-1;S<=1;S++){if(R+S<0||N<=R+S)continue;if(L==0&&S==0)continue;v==M.isDark(O+L,R+S)&&h++}}h>5&&(k+=3+h-5)}for(var O=0;O<N-1;O++)for(var R=0;R<N-1;R++){var E=0;M.isDark(O,R)&&E++,M.isDark(O+1,R)&&E++,M.isDark(O,R+1)&&E++,M.isDark(O+1,R+1)&&E++,(E==0||E==4)&&(k+=3)}for(var O=0;O<N;O++)for(var R=0;R<N-6;R++)M.isDark(O,R)&&!M.isDark(O,R+1)&&M.isDark(O,R+2)&&M.isDark(O,R+3)&&M.isDark(O,R+4)&&!M.isDark(O,R+5)&&M.isDark(O,R+6)&&(k+=40);for(var R=0;R<N;R++)for(var O=0;O<N-6;O++)M.isDark(O,R)&&!M.isDark(O+1,R)&&M.isDark(O+2,R)&&M.isDark(O+3,R)&&M.isDark(O+4,R)&&!M.isDark(O+5,R)&&M.isDark(O+6,R)&&(k+=40);for(var b=0,R=0;R<N;R++)for(var O=0;O<N;O++)M.isDark(O,R)&&b++;var d=Math.abs(100*b/N/N-50)/5;return k+=d*10,k}};xe.exports=P},JWDV:function(xe,be,z){xe.exports=z.p+"static/charpter-white.5fa14f93.svg"},JeFH:function(xe,be){xe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGgAAAAwCAYAAAD9wT87AAAe2UlEQVR4XtVcB5QUVbr+blV1T+ieGWaYBAwgOSgooJLjENeA6a2KCVfZNbum3VXXsG9VdFfc1TXtGlfXLCKgEiRnUAHJWRzAyTl3V9V957vV1dPTM+M4Hn2Pd8/xIHRV9f3vn77/+/9qgVaWlHIggHMB+AA8K4TIbe2ek/FzKWUmgLGw7THQtLlCiBUn4z6j9ySa26SUMg3A+ZDyaljBMTC87mXrAUwSQtT+fxBOSqmbpjnaMIyrYJnToRvtQ/sOAJgihFh1ssvRSEFSysEAroJlXQZdp8VhXUEAS07UYGavBPSIQz10vacQ4vjJLJiUMgPAhZByJoQYyr0erZFYmFOFZK+GK7szGOB3Qoi/nsxycG9KQVLKKyDltbDMbBge5NYD87+twvxjNdhbZiIoJZZMysRpPqsShreXECL/ZBRMSjkAwM2wzIugG2k2gOW59fjgaDU2FNbjRI2Fm/r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Q1mjUK554XYFvnw7YEhAhCSr6pYULTv2R6aklBAwC5Y3uJief2VyqtEoHGG5rT/4nVVN+EPaCsBB0pkT0gyyyDpq+HEB8DWNTSa/PNbbgt/yal5NkxyzI90VRVdI3+HSFpmyuk0MeTeGXnkspgrE/0aGgfyxxqoJPPQGe/BxxcDYtiBiQ042to2mfsZwkheGA/ywr9NhJlIBekZBFqOrZ5kgCFhYUJqampbAWzp9LCsgDLrgB/t0foByDkdkB1UrdFv5j0s0j1Ax8qpfxdqP/U8h1mIABN5EEYhyHELgBUBv87IAS98/9utUhA19TUZMXFxc0AcCZbIqG5A+YFvhvEMEQXVm4s6Jon6VKzA053dTI46OH8hMARhbwa5OCbboU/9e8//BRH8j9mLdQoDqqNCwAAAABJRU5ErkJggg=="},Jq4h:function(xe,be,z){xe.exports=z.p+"static/qrcode.2267e4d5.png"},LdHM:function(xe,be,z){"use strict";z.d(be,"b",function(){return u}),z.d(be,"a",function(){return g});var Z=z("1OyB"),H=z("vuIU"),w=z("Ji7U"),W=z("LK+K"),P=z("cDcd"),M=z("rePB"),N=z("Ff2n"),k=z("ODXe"),O=z("4IlW"),R=z("bX4T"),h=z("YrtM"),v=z("TSYQ"),L=z.n(v),S=z("+nKL"),E=z("8OUc"),b=function(X,$){var ne=X.prefixCls,ue=X.id,Te=X.flattenOptions,pe=X.childrenAsData,de=X.values,ce=X.searchValue,fe=X.multiple,te=X.defaultActiveFirstOption,se=X.height,Ee=X.itemHeight,ke=X.notFoundContent,Le=X.open,We=X.menuItemSelectedIcon,Xe=X.virtual,we=X.onSelect,Re=X.onToggleOpen,De=X.onActiveValue,He=X.onScroll,Ve=X.onMouseEnter,Ce="".concat(ne,"-item"),Me=Object(h.a)(function(){return Te},[Le,Te],function(Ie,le){return le[0]&&Ie[1]!==le[1]}),qe=P.useRef(null),tt=function(le){le.preventDefault()},Ke=function(le){qe.current&&qe.current.scrollTo({index:le})},Ne=function(le){for(var ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,oe=Me.length,Y=0;Y<oe;Y+=1){var J=(le+Y*ae+oe)%oe,q=Me[J],re=q.group,ge=q.data;if(!re&&!ge.disabled)return J}return-1},rt=P.useState(function(){return Ne(0)}),Je=Object(k.a)(rt,2),Ze=Je[0],ye=Je[1],$e=function(le){ye(le);var ae=Me[le];if(!ae){De(null,-1);return}De(ae.data.value,le)};P.useEffect(function(){$e(te!==!1?Ne(0):-1)},[Me.length,ce]),P.useEffect(function(){var Ie=setTimeout(function(){if(!fe&&Le&&de.size===1){var le=Array.from(de)[0],ae=Me.findIndex(function(oe){var Y=oe.data;return Y.value===le});$e(ae),Ke(ae)}});return function(){return clearTimeout(Ie)}},[Le]);var Ge=function(le){le!==void 0&&we(le,{selected:!de.has(le)}),fe||Re(!1)};if(P.useImperativeHandle($,function(){return{onKeyDown:function(le){var ae=le.which;switch(ae){case O.a.UP:case O.a.DOWN:{var oe=0;if(ae===O.a.UP?oe=-1:ae===O.a.DOWN&&(oe=1),oe!==0){var Y=Ne(Ze+oe,oe);Ke(Y),$e(Y)}break}case O.a.ENTER:{var J=Me[Ze];J&&!J.data.disabled?Ge(J.data.value):Ge(void 0),Le&&le.preventDefault();break}case O.a.ESC:Re(!1)}},onKeyUp:function(){},scrollTo:function(le){Ke(le)}}}),Me.length===0)return P.createElement("div",{role:"listbox",id:"".concat(ue,"_list"),className:"".concat(Ce,"-empty"),onMouseDown:tt},ke);function ve(Ie){var le=Me[Ie];if(!le)return null;var ae=le.data||{},oe=ae.value,Y=ae.label,J=ae.children,q=Object(R.a)(ae,!0),re=pe?J:Y;return le?P.createElement("div",Object.assign({"aria-label":typeof re=="string"?re:null},q,{key:Ie,role:"option",id:"".concat(ue,"_list_").concat(Ie),"aria-selected":de.has(oe)}),oe):null}return P.createElement(P.Fragment,null,P.createElement("div",{role:"listbox",id:"".concat(ue,"_list"),style:{height:0,width:0,overflow:"hidden"}},ve(Ze-1),ve(Ze),ve(Ze+1)),P.createElement(S.a,{itemKey:"key",ref:qe,data:Me,height:se,itemHeight:Ee,fullHeight:!1,onMouseDown:tt,onScroll:He,virtual:Xe,onMouseEnter:Ve},function(Ie,le){var ae,oe=Ie.group,Y=Ie.groupOption,J=Ie.data,q=J.label,re=J.key;if(oe)return P.createElement("div",{className:L()(Ce,"".concat(Ce,"-group"))},q!==void 0?q:re);var ge=J.disabled,Ae=J.value,Be=J.title,lt=J.children,Pe=J.style,Ye=J.className,ht=Object(N.a)(J,["disabled","value","title","children","style","className"]),ot=de.has(Ae),it="".concat(Ce,"-option"),Ot=L()(Ce,it,Ye,(ae={},Object(M.a)(ae,"".concat(it,"-grouped"),Y),Object(M.a)(ae,"".concat(it,"-active"),Ze===le&&!ge),Object(M.a)(ae,"".concat(it,"-disabled"),ge),Object(M.a)(ae,"".concat(it,"-selected"),ot),ae)),xt=pe?lt:q,Ct=!We||typeof We=="function"||ot;return P.createElement("div",Object.assign({},ht,{"aria-selected":ot,className:Ot,title:Be,onMouseMove:function(){if(Ze===le||ge)return;$e(le)},onClick:function(){ge||Ge(Ae)},style:Pe}),P.createElement("div",{className:"".concat(it,"-content")},xt||Ae),P.isValidElement(We)||ot,Ct&&P.createElement(E.a,{className:"".concat(Ce,"-option-state"),customizeIcon:We,customizeIconProps:{isSelected:ot}},ot?"\u2713":null))}))},d=P.forwardRef(b);d.displayName="OptionList";var a=d,l=function(){return null};l.isSelectOption=!0;var u=l,C=function(){return null};C.isSelectOptGroup=!0;var g=C,m=z("VTBJ"),D=z("Zm9Q");function A(U){var X=U.key,$=U.props,ne=$.children,ue=$.value,Te=Object(N.a)($,["children","value"]);return Object(m.a)({key:X,value:ue!==void 0?ue:X,children:ne},Te)}function f(U){var X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(D.a)(U).map(function($,ne){if(!P.isValidElement($)||!$.type)return null;var ue=$.type.isSelectOptGroup,Te=$.key,pe=$.props,de=pe.children,ce=Object(N.a)(pe,["children"]);return X||!ue?A($):Object(m.a)(Object(m.a)({key:"__RC_SELECT_GRP__".concat(Te===null?ne:Te,"__"),label:Te},ce),{},{options:f(de)})}).filter(function($){return $})}var c=z("2Qr1"),s=z("qNPg"),o=z("U8pU"),x=z("Kwbf"),y=z("WKfj");function p(U){var X=U.mode,$=U.options,ne=U.children,ue=U.backfill,Te=U.allowClear,pe=U.placeholder,de=U.getInputElement,ce=U.showSearch,fe=U.onSearch,te=U.defaultOpen,se=U.autoFocus,Ee=U.labelInValue,ke=U.value,Le=U.inputValue,We=U.optionLabelProp,Xe=X==="multiple"||X==="tags",we=ce!==void 0?ce:Xe||X==="combobox",Re=$||f(ne);if(Object(x.a)(X!=="tags"||Re.every(function(Ce){return!Ce.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),X==="tags"||X==="combobox"){var De=Re.some(function(Ce){return Ce.options?Ce.options.some(function(Me){return typeof("value"in Me?Me.value:Me.key)=="number"}):typeof("value"in Ce?Ce.value:Ce.key)=="number"});Object(x.a)(!De,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(x.a)(X!=="combobox"||!We,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(x.a)(X==="combobox"||!ue,"`backfill` only works with `combobox` mode."),Object(x.a)(X==="combobox"||!de,"`getInputElement` only work with `combobox` mode."),Object(x.b)(X!=="combobox"||!de||!Te||!pe,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),fe&&!we&&X!=="combobox"&&X!=="tags"&&Object(x.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(x.b)(!te||se,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),ke!=null){var He=Object(y.d)(ke);Object(x.a)(!Ee||He.every(function(Ce){return Object(o.a)(Ce)==="object"&&("key"in Ce||"value"in Ce)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(x.a)(!Xe||Array.isArray(ke),"`value` should be array when `mode` is `multiple` or `tags`")}if(ne){var Ve=null;Object(D.a)(ne).some(function(Ce){if(!P.isValidElement(Ce)||!Ce.type)return!1;var Me=Ce.type;if(Me.isSelectOption)return!1;if(Me.isSelectOptGroup){var qe=Object(D.a)(Ce.props.children).every(function(tt){return!P.isValidElement(tt)||!Ce.type||tt.type.isSelectOption?!0:(Ve=tt.type,!1)});return!qe}return Ve=Me,!0}),Ve&&Object(x.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Ve.displayName||Ve.name||Ve,"`.")),Object(x.a)(Le===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var I=p,B=Object(s.a)({prefixCls:"rc-select",components:{optionList:a},convertChildrenToData:f,flattenOptions:c.d,getLabeledValue:c.e,filterOptions:c.b,isValueDisabled:c.g,findValueOption:c.c,warningProps:I,fillOptionsWithMissingValue:c.a}),F=function(U){Object(w.a)($,U);var X=Object(W.a)($);function $(){var ne;return Object(Z.a)(this,$),ne=X.apply(this,arguments),ne.selectRef=P.createRef(),ne.focus=function(){ne.selectRef.current.focus()},ne.blur=function(){ne.selectRef.current.blur()},ne}return Object(H.a)($,[{key:"render",value:function(){return P.createElement(B,Object.assign({ref:this.selectRef},this.props))}}]),$}(P.Component);F.Option=u,F.OptGroup=g;var Q=F,j=be.c=Q},M8RZ:function(xe,be,z){"use strict";z.d(be,"a",function(){return O});var Z=z("fWQN"),H=z("mtLc"),w=z("yKVA"),W=z("879j"),P=z("cDcd"),M=z.n(P),N=z("faye"),k=z.n(N),O=function(R){Object(w.a)(v,R);var h=Object(W.a)(v);function v(L){var S;Object(Z.a)(this,v),S=h.call(this,L);var E=window.document;return S.node=E.createElement("div"),E.body.appendChild(S.node),S}return Object(H.a)(v,[{key:"render",value:function(){var S=this.props.children;return Object(N.createPortal)(S,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),v}(M.a.Component)},Nmxd:function(xe,be){xe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHA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ls,b=L.id,d=L.overlayInnerStyle;return W.createElement("div",{className:"".concat(E,"-inner"),id:b,role:"tooltip",style:d},typeof S=="function"?S():S)},k=N,O=function(L,S){var E=L.overlayClassName,b=L.trigger,d=b===void 0?["hover"]:b,a=L.mouseEnterDelay,l=a===void 0?0:a,u=L.mouseLeaveDelay,C=u===void 0?.1:u,g=L.overlayStyle,m=L.prefixCls,D=m===void 0?"rc-tooltip":m,A=L.children,f=L.onVisibleChange,c=L.afterVisibleChange,s=L.transitionName,o=L.animation,x=L.placement,y=x===void 0?"right":x,p=L.align,I=p===void 0?{}:p,B=L.destroyTooltipOnHide,F=B===void 0?!1:B,Q=L.defaultVisible,j=L.getTooltipContainer,U=L.overlayInnerStyle,X=Object(w.a)(L,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),$=Object(W.useRef)(null);Object(W.useImperativeHandle)(S,function(){return $.current});var ne=Object(H.a)({},X);"visible"in L&&(ne.popupVisible=L.visible);var ue=function(){var fe=L.arrowContent,te=fe===void 0?null:fe,se=L.overlay,Ee=L.id;return[W.createElement("div",{className:"".concat(D,"-arrow"),key:"arrow"},te),W.createElement(k,{key:"content",prefixCls:D,id:Ee,overlay:se,overlayInnerStyle:U})]},Te=!1,pe=!1;if(typeof F=="boolean")Te=F;else if(F&&Object(Z.a)(F)==="object"){var de=F.keepParent;Te=de===!0,pe=de===!1}return W.createElement(P.a,Object.assign({popupClassName:E,prefixCls:D,popup:ue,action:d,builtinPlacements:M.a,popupPlacement:y,ref:$,popupAlign:I,getPopupContainer:j,onPopupVisibleChange:f,afterPopupVisibleChange:c,popupTransitionName:s,popupAnimation:o,defaultPopupVisible:Q,destroyPopupOnHide:Te,autoDestroy:pe,mouseLeaveDelay:C,popupStyle:g,mouseEnterDelay:l},ne),A)},R=Object(W.forwardRef)(O),h=be.a=R},Ohmc:function(xe,be,z){xe.exports=z.p+"static/certificate.fc32dc1b.jpg"},Ot1p:function(xe,be,z){"use strict";var Z=z("2qtc"),H=z("kLXV"),w=z("rAM+"),W=z("miYZ"),P=z("tsqr"),M=z("9og8"),N=z("tJVT"),k=z("jrin"),O=z("WmNS"),R=z.n(O),h=z("cDcd"),v=z.n(h),L=z("VrN/"),S=z.n(L),E=z("bdgK"),b=z("p77/"),d=z("Bd2K"),a=z("ELLl"),l=z("19Vz"),u=z("lZu9"),C=z("+NIl"),g=z("kSUc"),m=z("9Bee"),D=function(Pe){var Ye=Pe.value,ht=Ye===void 0?"":Ye,ot=Pe.className,it=Pe.showTextOnly,Ot=Pe.showLines,xt=Pe.style,Ct=xt===void 0?{}:xt,bt=Object(h.useMemo)(function(){return""},[ht]);return v.a.createElement(v.a.Fragment,null,v.a.createElement("div",{dangerouslySetInnerHTML:{__html:bt}}))},A=z("Q9mQ"),f=z("diRs"),c=z("0Owb"),s=z("dejd"),o=z("C+DQ"),x=z("D1Df"),y=z.n(x),p=z("1vsH"),I=z("m3rI"),B=[{title:"\u7C97\u4F53",icon:"icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"icon-sum",actionName:"inline-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"icon-formula",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"icon-picture",actionName:"upload-image"},{title:"\u8868\u683C",icon:"icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"icon-eraser",actionName:"eraser"}];function F(Pe){var Ye=Pe.onActionCallback,ht=Pe.title,ot=Pe.icon,it=Pe.actionName,Ot=Pe.className,xt=Ot===void 0?"":Ot,Ct=Pe.children;function bt(){Ye(it)}return v.a.createElement("a",{title:ht,className:xt,onClick:bt},v.a.createElement("i",{className:"md-iconfont ".concat(ot)}),Ct)}var Q=function(Pe){var Ye=Pe.watch,ht=Pe.showNullButton,ot=Pe.onActionCallback,it=Pe.fullScreen,Ot=Pe.insertTemp,xt=Pe.hidetoolBar,Ct=Pe.uuid,bt=Pe.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(p.G)("_educoder_session_login"),"&_educoder_session=").concat(Object(p.G)("_educoder_session"),"&key=").concat(Ct,"&api=").concat(encodeURIComponent(I.a.PROXY_SERVER)));var at=[].concat(B,[{title:"".concat(Ye?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Ye?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return v.a.createElement("ul",{className:"markdown-toolbar-container"},!xt&&at.map(function(Et,Lt){return v.a.createElement("li",{key:Lt},Et.actionName?v.a.createElement(F,Object(c.a)({},Et,{onActionCallback:ot})):v.a.createElement("span",{className:"v-line"}))}),ht?v.a.createElement("li",null,v.a.createElement(F,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:ot},v.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,Ot&&v.a.createElement("li",null,v.a.createElement(F,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(Ot),onActionCallback:ot},v.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),v.a.createElement("li",null,v.a.createElement(f.a,{title:"\u6253\u5F00\u624B\u673A\u626B\u4E00\u626B",content:v.a.createElement("div",null,v.a.createElement(y.a,{size:150,fgColor:"#000",value:"https://test2.educoder.net/upload.html?_educoder_session_login=".concat(Object(p.G)("_educoder_session_login"),"&_educoder_session=").concat(Object(p.G)("_educoder_session"),"&key=").concat(Ct,"&api=").concat(encodeURIComponent(I.a.PROXY_SERVER))}))},v.a.createElement("span",{className:"fill-tip",onMouseOver:function(){return bt(!0)}},"\u624B\u673A\u4E0A\u4F20\u6587\u4EF6"))),v.a.createElement("li",{className:"btn-full-screen"},v.a.createElement(F,{icon:"".concat(it?"icon-shrink":"icon-enlarge"),title:it?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:ot})))},j=z("M8RZ"),U=z("+L6B"),X=z("2/Rp"),$=z("y8nQ"),ne=z("Vl3Y"),ue=z("5NDa"),Te=z("5rEg"),pe={labelCol:{span:4},wrapperCol:{span:20}},de=function(Pe){var Ye=Pe.callback,ht=Pe.onCancel;function ot(it){Ye(it)}return v.a.createElement(ne.a,Object(c.a)({},pe,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:ot}),v.a.createElement(ne.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},v.a.createElement(Te.a,null)),v.a.createElement(ne.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},v.a.createElement(Te.a,null)),v.a.createElement("div",{className:"flex-container flex-end"},v.a.createElement(X.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),v.a.createElement(X.a,{type:"ghost",onClick:ht},"\u53D6\u6D88")))},ce=z("7ahc"),fe=z("HmJG"),te=z("BjJ7"),se=ne.a.useForm,Ee={width:280,marginRight:10},ke={labelCol:{span:5},wrapperCol:{span:19}},Le=function(Pe){var Ye=Pe.callback,ht=Pe.onCancel,ot=se(),it=Object(N.a)(ot,1),Ot=it[0];function xt(at){Ye(at)}function Ct(at,Et){if(at.status===-1){P.b.error(at.message);return}Ot.setFieldsValue({src:"/api/attachments/".concat(at.id),type:Et.type})}function bt(at){var Et=at.target.files[0];Xe(Et,Ct)}return v.a.createElement(ne.a,Object(c.a)({form:Ot},ke,{className:"upload-image-panel",onFinish:xt}),v.a.createElement(ne.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},v.a.createElement("div",{className:"flex-container"},v.a.createElement(ne.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},v.a.createElement(Te.a,{style:Ee})),v.a.createElement(We,{onFileChange:bt}))),v.a.createElement(ne.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},v.a.createElement(Te.a,{style:{width:264}})),v.a.createElement(ne.a.Item,{style:{textAlign:"right"}},v.a.createElement(X.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),v.a.createElement(X.a,{type:"ghost",onClick:ht},"\u53D6\u6D88")))};function We(Pe){var Ye=Pe.onFileChange;return v.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",v.a.createElement("input",{type:"file",onChange:Ye}))}function Xe(Pe,Ye){if(!Pe)throw new String("\u6CA1\u6709\u6587\u4EF6");var ht=new FormData;ht.append("editormd-image-file",Pe),ht.append("file_param_name","editormd-image-file"),ht.append("byxhr","true");var ot=new window.XMLHttpRequest;ot.withCredentials=!0,ot.addEventListener("load",function(it){Ye(JSON.parse(it.target.responseText),Pe)},!1),ot.addEventListener("error",function(it){console.error(it)},!1),ot.open("POST","".concat(te.a,"/api/attachments.json")),ot.send(ht)}var we=z("giR+"),Re=z("fyUT"),De=z("7Kak"),He=z("9yH6"),Ve=He.a.Group,Ce={margin:"0 8px"},Me=function(Pe){var Ye=Pe.callback,ht=Pe.onCancel;function ot(it){Ye(it)}return v.a.createElement(ne.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:ot},v.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},v.a.createElement("span",{style:Ce},"\u5355\u5143\u683C\u6570\uFF1A"),v.a.createElement("span",{style:Ce},"\u884C\u6570"),v.a.createElement(ne.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},v.a.createElement(Re.a,null)),v.a.createElement("span",{style:Ce},"\u5217\u6570"),v.a.createElement(ne.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},v.a.createElement(Re.a,null))),v.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},v.a.createElement("span",{style:Ce},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),v.a.createElement(ne.a.Item,{name:"align"},v.a.createElement(Ve,null,v.a.createElement(He.a,{value:"default"},v.a.createElement("i",{className:"fa fa-align-justify"})),v.a.createElement(He.a,{value:"left"},v.a.createElement("i",{className:"fa fa-align-left"})),v.a.createElement(He.a,{value:"center"},v.a.createElement("i",{className:"fa fa-align-center"})),v.a.createElement(He.a,{value:"right"},v.a.createElement("i",{className:"fa fa-align-right"}))))),v.a.createElement("div",{className:"flex-container flex-end"},v.a.createElement(X.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),v.a.createElement(X.a,{type:"ghost",onClick:ht},"\u53D6\u6D88")))},qe=z("ErOA"),tt=z("7Cbv"),Ke="link",Ne="upload-image",rt="code-block",Je="add-table",Ze="------------",ye={default:Ze,left:":".concat(Ze),center:":".concat(Ze,":"),right:"".concat(Ze,":")},$e=z("9VGf"),Ge,ve;function Ie(){}var le=0,ae=1e4,oe="\u2581",Y=`
**\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 J(Pe){return/^\d+$/.test(Pe)?"".concat(Pe,"px"):Pe}var q=navigator.platform.toUpperCase().indexOf("MAC")>=0,re=q?"Cmd":"Ctrl",ge=["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"],Ae=(Ge={},Object(k.a)(Ge,re+"-B","bold"),Object(k.a)(Ge,re+"-I","italic"),Ge),Be=(ve={},Object(k.a)(ve,Ke,"\u6DFB\u52A0\u94FE\u63A5"),Object(k.a)(ve,rt,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(k.a)(ve,Ne,"\u6DFB\u52A0\u6587\u4EF6"),Object(k.a)(ve,Je,"\u6DFB\u52A0\u8868\u683C"),ve),lt=be.a=function(Pe){var Ye=Pe.defaultValue,ht=Ye===void 0?"":Ye,ot=Pe.onChange,it=Pe.width,Ot=it===void 0?"100%":it,xt=Pe.height,Ct=xt===void 0?400:xt,bt=Pe.miniToolbar,at=bt===void 0?!1:bt,Et=Pe.isFocus,Lt=Et===void 0?!1:Et,Rt=Pe.watch,Ht=Pe.insertTemp,nr=Pe.mode,yr=nr===void 0?"markdown":nr,xr=Pe.id,Ir=xr===void 0?"markdown-editor-id":xr,Ft=Pe.showResizeBar,mt=Ft===void 0?!1:Ft,Ue=Pe.noStorage,_t=Ue===void 0?!1:Ue,yt=Pe.showNullButton,zt=yt===void 0?!1:yt,wt=Pe.hidetoolBar,ir=wt===void 0?!1:wt,ut=Pe.fullScreen,Or=ut===void 0?!1:ut,_e=Pe.onBlur,pt=Pe.onCMBeforeChange,rn=Pe.onFullScreen,xn=Pe.className,An=xn===void 0?"":xn,nn=Pe.disablePaste,wi=nn===void 0?!1:nn,gt=Pe.placeholder,ia=gt===void 0?"":gt,Gn=Pe.values,Kr=Gn===void 0?"":Gn,Ar=Object(h.useState)(null),zn=Object(N.a)(Ar,2),Fe=zn[0],an=zn[1],Qn=Object(h.useState)(ht),Vn=Object(N.a)(Qn,2),Hr=Vn[0],Gr=Vn[1],Di=Object(h.useState)(Rt),Xn=Object(N.a)(Di,2),Mr=Xn[0],Li=Xn[1],aa=Object(h.useState)(Or),Yn=Object(N.a)(aa,2),er=Yn[0],Ri=Yn[1],oa=Object(h.useState)(""),on=Object(N.a)(oa,2),Tr=on[0],zr=on[1],sa=Object(h.useState)(0),Ii=Object(N.a)(sa,2),sn=Ii[0],ln=Ii[1],Oi=Object(h.useState)(Ct),Mi=Object(N.a)(Oi,2),Jn=Mi[0],Zn=Mi[1],Tn=Object(h.useState)(!1),un=Object(N.a)(Tn,2),Pi=un[0],Sn=un[1],qn=Object(h.useRef)(Object(tt.a)()),dn=Object(h.useRef)(!1),ki=Object(h.useRef)(),Nr=Object(h.useRef)(),ar=Object(h.useRef)(),Cn=Object(h.useRef)(),wn=Object(h.useRef)(),$n=function(){var st=Object(M.a)(R.a.mark(function vt(){var ct,St;return R.a.wrap(function(Bt){for(;;)switch(Bt.prev=Bt.next){case 0:return Bt.next=2,Object(qe.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:qn.current}});case 2:St=Bt.sent,St!=null&&(ct=St.attachments)!==null&&ct!==void 0&&ct.length&&(console.log("cm:",Fe,Nr),St.attachments.map(function(Dt){Dt.content_type.indexOf("image")>-1?Fe.replaceSelection("![,](/api/attachments/".concat(Dt.id,"?type=").concat(Dt.content_type,")")):Dt.content_type.indexOf("video")>-1?Fe.replaceSelection('<video width="100%" controls src="'.concat(I.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):Dt.content_type.indexOf("pdf")>-1?Fe.replaceSelection('<a href="'.concat(I.a.API_SERVER,"/api/attachments/").concat(Dt.id,"?type=").concat(Dt.content_type,'&disposition=inline" target="_blank">').concat(Dt.name,"</a>")):Fe.replaceSelection("[".concat(Dt.name,"](").concat(I.a.API_SERVER,"/api/attachments/").concat(Dt.id,"?type=").concat(Dt.content_type,")"))}));case 4:case"end":return Bt.stop()}},vt)}));return function(){return st.apply(this,arguments)}}();Object(h.useEffect)(function(){Gr(Kr),Fe==null||Fe.setValue(Kr)},[Kr]),Object(h.useEffect)(function(){rn==null||rn(er)},[er]),Object(h.useEffect)(function(){if(Nr.current){var st=S.a.fromTextArea(Nr.current,{mode:yr,lineNumbers:!at,lineWrapping:!0,value:ht,autoCloseTags:!0,autoCloseBrackets:!0});Lt&&st.focus();function vt(ct,St){if(wi){St.preventDefault();return}var It=St.clipboardData;if(It){var Bt=It.types.toString(),Dt=It.items;if(Bt==="Files"||It.types.indexOf("Files")>-1){if(St.preventDefault(),yr=="stex")return;try{var Qt,tr=Dt[1];((Qt=Dt[0])===null||Qt===void 0?void 0:Qt.kind)==="file"&&(tr=Dt[0]);var At=tr.getAsFile(),Ur=At.name.split(".").pop();Xe(At,function(Pt){if(Pt.id){var Sr,lr,Nt;(At==null||((Sr=At.type)===null||Sr===void 0)?void 0:Sr.indexOf("image"))>-1?st.replaceSelection("![,](/api/attachments/".concat(Pt.id,"?type=").concat(Pt.content_type,")")):(At==null||((lr=At.type)===null||lr===void 0)?void 0:lr.indexOf("video"))>-1?st.replaceSelection('<video width="100%" controls src="'.concat(I.a.API_SERVER,"/api/attachments/").concat(Pt.id,'"></video>')):(At==null||((Nt=At.type)===null||Nt===void 0)?void 0:Nt.indexOf("pdf"))>-1?st.replaceSelection('<a href="'.concat(I.a.API_SERVER,"/api/attachments/").concat(Pt.id,"?type=").concat(At.type,'&disposition=inline" target="_blank">').concat(At.name,"</a>")):ge.includes(Ur)?st.replaceSelection('<a href="'.concat(I.a.API_SERVER,"/api/attachments/").concat(Pt.id,'?type=office&disposition=inline" target="_blank">').concat(At.name,"</a>")):st.replaceSelection("[".concat(At.name,"](").concat(I.a.API_SERVER,"/api/attachments/").concat(Pt.id,"?type=").concat(Pt.content_type,")"))}else(Pt==null?void 0:Pt.status)===401&&(document.location.href="/user/login")})}catch(Pt){P.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return st.on("paste",vt),st.on("dragleave",function(ct,St){ar.current.classList.remove("mouse-hover-md")}),st.on("dragover",function(ct,St){ar.current.classList.add("mouse-hover-md")}),st.on("drop",function(ct,St){ar.current.classList.add("mouse-hover-md");var It;if(It=St.dataTransfer.files,It.length>0){St.preventDefault(),St.stopPropagation();for(var Bt=function(tr){var At=It[tr],Ur=At.name.split(".").pop();Xe(At,function(Pt){if(Pt.id){var Sr,lr,Nt;(At==null||((Sr=At.type)===null||Sr===void 0)?void 0:Sr.indexOf("image"))>-1?st.replaceSelection("![,](/api/attachments/".concat(Pt.id,"?type=").concat(Pt.content_type,")")):(At==null||((lr=At.type)===null||lr===void 0)?void 0:lr.indexOf("video"))>-1?st.replaceSelection('<video width="100%" controls src="'.concat(I.a.API_SERVER,"/api/attachments/").concat(Pt.id,'"></video>')):(At==null||((Nt=At.type)===null||Nt===void 0)?void 0:Nt.indexOf("pdf"))>-1?st.replaceSelection('<a href="'.concat(I.a.API_SERVER,"/api/attachments/").concat(Pt.id,"?type=").concat(At.type,'&disposition=inline" target="_blank">').concat(At.name,"</a>")):ge.includes(Ur)?st.replaceSelection('<a href="'.concat(I.a.API_SERVER,"/api/attachments/").concat(Pt.id,'?type=office&disposition=inline" target="_blank">').concat(At.name,"</a>")):st.replaceSelection("[".concat(At.name,"](").concat(I.a.API_SERVER,"/api/attachments/").concat(Pt.id,"?type=").concat(Pt.content_type,")"))}else(Pt==null?void 0:Pt.status)===401&&(document.location.href="/user/login")})},Dt=0;Dt<It.length;Dt++)Bt(Dt)}}),an(st),function(){st.off("paste",vt)}}},[]);var ei=Object(h.useCallback)(function(){if(ar.current)try{}catch(st){console.log(st,"---- to set md editor body height")}},[Jn,ar,er]);Object(h.useEffect)(function(){function st(){var ct=new E.default(function(St){var It=Object(w.a)(St),Bt;try{for(It.s();!(Bt=It.n()).done;){var Dt=Bt.value;(Dt.target.offsetHeight>0||Dt.target.offsetWidth>0)&&(ei(),Fe.setSize("100%","100%"),Fe.refresh())}}catch(Qt){It.e(Qt)}finally{It.f()}});return ct.observe(Nr.current.parentElement),ct}if(Fe){var vt=st();return function(){vt.unobserve(Nr.current.parentElement)}}},[Fe,ei]),Object(h.useEffect)(function(){if(Fe){for(var st=[],vt=function(){var Dt=St[ct];It=Object(N.a)(Dt,2);var Qt=It[0],tr=It[1],At=Object(k.a)({},Qt,function(){Cr(tr)});st.push(At),Fe.addKeyMap(At)},ct=0,St=Object.entries(Ae);ct<St.length;ct++){var It;vt()}return ki.current=setInterval(function(){dn.current&&$n()},4e3),function(){clearInterval(ki.current);var Bt=Object(w.a)(st),Dt;try{for(Bt.s();!(Dt=Bt.n()).done;){var Qt=Dt.value;Fe.removeKeyMap(Qt)}}catch(tr){Bt.e(tr)}finally{Bt.f()}}}},[Fe]),Object(h.useEffect)(function(){Or!==er&&Ri(Or)},[Or]),Object($e.a)(function(){if(!_t&&sn>0){var st=new Date().getTime(),vt=window.sessionStorage.getItem(Ir);st>=sn+ae&&(!vt||vt!==Hr)&&(window.sessionStorage.setItem(Ir,Hr),Sn(!0))}},ae),Object(h.useEffect)(function(){Li(Rt)},[Fe,Rt]),Object(h.useEffect)(function(){Fe&&(Lt&&Fe.focus())},[Fe,Lt]),Object(h.useEffect)(function(){if(Mr&&Fe){var st=Fe.getScrollerElement();function vt(ct){var St=ct.target;if(wn.current){var It=St.scrollTop/St.scrollHeight;wn.current.scrollTop=wn.current.scrollHeight*It}}return st.addEventListener("scroll",vt),function(){st.removeEventListener("scroll",vt)}}},[Fe,Mr]),Object(h.useEffect)(function(){if(Fe&&pt){function st(vt,ct){pt(vt,ct)}return Fe.on("beforeChange",st),function(){Fe.off("beforeChange",st)}}},[Fe,pt]),Object(h.useEffect)(function(){if(Fe&&_e){function st(){_e(Fe.getValue())}return Fe.on("blur",st),function(){Fe.off("blur",st)}}},[Fe,_e]),Object(h.useEffect)(function(){if(Fe){function st(vt){var ct=vt.getValue();Gr(ct),ln(new Date().getTime()),vt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),ot&&ot(ct)}return Fe.on("change",st),function(){Fe.off("change",st)}}},[Fe,ot]),Object(h.useEffect)(function(){Fe&&(ht==null?(Fe.setValue(""),Gr("")):ht!==Fe.getValue()&&(Fe.setValue(ht),Gr(ht),Fe.setCursor(Fe.lineCount(),0)))},[Fe,ht]);var Cr=Object(h.useCallback)(function(st){var vt=Fe.getCursor(),ct=Fe.getSelection(),St=ct.split(`
`);switch(st){case"bold":return Fe.replaceSelection("**"+ct+"**"),ct===""&&Fe.setCursor(vt.line,vt.ch+2),Fe.focus();case"italic":return Fe.replaceSelection("*"+ct+"*"),ct===""&&Fe.setCursor(vt.line,vt.ch+1),Fe.focus();case"code":return Fe.replaceSelection("`"+ct+"`"),ct===""&&Fe.setCursor(vt.line,vt.ch+1),Fe.focus();case"inline-latex":return Fe.replaceSelection("`$$"+ct+"$$`"),ct===""&&Fe.setCursor(vt.line,vt.ch+3),Fe.focus();case"latex":return Fe.replaceSelection("```latex\n"+ct+"\n```"),Fe.setCursor(vt.line+1,ct.length+1),Fe.focus();case"line-break":return Fe.replaceSelection(`<br/>
`),Fe.focus();case"list-ul":return ct===""?Fe.replaceSelection("- "+ct):Fe.replaceSelection(St.map(function(It){return It===""?"":"- ".concat(It)}).join(`
`)),Fe.focus();case"list-ol":return ct===""?Fe.replaceSelection("1. "+ct):Fe.replaceSelection(St.map(function(It,Bt){return It===""?"":"".concat(Bt+1,". ").concat(It)}).join(`
`)),Fe.focus();case"add-null-ch":return ct===""&&Fe.setCursor(vt.line,vt.ch+1),Fe.replaceSelection(oe),Fe.focus();case"inster-template-1":return ct===""&&Fe.setCursor(vt.line,vt.ch),Fe.replaceSelection(Y),Fe.focus();case"eraser":return Fe.setValue(""),Fe.focus();case"trigger-watch":return Li(!Mr),Fe.focus();case"trigger-full-screen":return Ri(!er),Fe.focus();case Ke:zr(Ke);return;case rt:zr(rt);return;case Ne:zr(Ne);return;case Je:zr(Je);return;default:throw new Error}},[Fe,Mr,er]),Qr=Object(h.useCallback)(function(st){zr("");switch(Tr){case Ke:var vt=st.title,ct=st.link;return Fe.replaceSelection("[".concat(vt,"](").concat(ct,")")),Fe.focus();case rt:var St=st.language,It=st.content;return Fe.replaceSelection(["```"+St,It,"```"].join(`
`)),Fe.focus();case Ne:var Bt=st.src,Dt=st.alt;return Dt?Fe.replaceSelection("![ ".concat(Dt," ]( ").concat(Bt,' "').concat(Dt,'" )')):Fe.replaceSelection("![,](".concat(Bt,")")),Fe.focus();case Je:for(var Qt=st.row,tr=st.col,At=st.align,Ur=`
`,Pt=0;Pt<Qt;Pt++){for(var Sr=[],lr=[],Nt=0;Nt<tr;Nt++)Pt===1&&lr.push(ye[At]),Sr.push(" ");Pt===1&&(Ur+="| ".concat(lr.join(" | "),` |
`)),Ur+="| ".concat(Sr.join(tr===1?"":" | "),` |
`)}return Fe.replaceSelection(Ur+`
`),Fe.focus();default:throw new Error}},[Fe,Tr]),wr=Object(h.useMemo)(function(){switch(Tr){case Ke:return v.a.createElement(de,{callback:Qr,onCancel:Pr});case rt:return v.a.createElement(ce.b,{callback:Qr,onCancel:Pr});case Ne:return v.a.createElement(Le,{callback:Qr,onCancel:Pr});case Je:return v.a.createElement(Me,{callback:Qr,onCancel:Pr});default:return null}},[Tr]);function Pr(){zr("")}Object(h.useEffect)(function(){if(Cn.current){var st=Cn.current,vt=!1,ct=0;function St(Dt){vt=!0,ct=Dt.pageY}function It(){vt=!1}function Bt(Dt){if(vt){var Qt=Dt.pageY-ct;Qt<0&&(Qt=0),Qt>300&&(Qt=300);var tr=Ct+Qt+"px";Zn(tr)}}return st.addEventListener("mousedown",St),document.addEventListener("mousemove",Bt),document.addEventListener("mouseup",It),function(){st.removeEventListener("mousedown",St),document.removeEventListener("mousemove",Bt),document.removeEventListener("mouseup",It)}}},[Fe,Cn]),Object(h.useEffect)(function(){Zn(Ct)},[Ct]);var ti=J(Ot),Vr=J(Jn),la={width:ti,height:Vr},Va=Object(h.useMemo)(function(){if(sn){var st=new Date(sn),vt=st.getHours(),ct=st.getMinutes(),St=st.getSeconds();return vt=vt<10?"0"+vt:vt,ct=ct<10?"0"+ct:ct,St=St<10?"0"+St:St,"".concat(vt,":").concat(ct,":").concat(St)}return 0},[sn]);function Xa(){window.sessionStorage.removeItem(Ir),Sn(!1),ln(0)}function Ya(){Sn(!1),ln(0),Fe.setValue(window.sessionStorage.getItem(Ir))}function _i(st,vt){var ct=Fe.getValue();ct=ct.replace(st,vt),Gr(ct),Fe==null||Fe.setValue(ct)}return v.a.createElement(h.Fragment,null,v.a.createElement("div",{className:"markdown-editor-wrapper",ref:ar},v.a.createElement("div",{className:"markdown-editor-container ".concat(An," ").concat(Mr?"on-preview":""," ").concat(at?"mini":""," ").concat(er?"full-screen":""),style:la},v.a.createElement(Q,{insertTemp:Ht,watch:Mr,fullScreen:er,showNullButton:zt,onActionCallback:Cr,hidetoolBar:ir,uuid:qn.current,setOpenPhones:function(){dn.current=!0}}),v.a.createElement("div",{className:"markdown-editor-body"},v.a.createElement("div",{className:"codemirror-container"},v.a.createElement("textarea",{ref:Nr,placeholder:ia})),Mr?v.a.createElement("div",{ref:wn,className:"preview-container"},yr==="stex"&&v.a.createElement(D,{value:Hr}),yr!=="stex"&&v.a.createElement(m.a,{edit:!0,value:Hr,replaces:_i})):null))),mt?v.a.createElement("a",{ref:Cn,className:"editor-resize"}):null,v.a.createElement(j.a,null,Be[Tr]?v.a.createElement(H.a,{centered:!0,title:Be[Tr],visible:!0,onCancel:Pr,footer:null,className:"markdown-popup-form"},wr):null))}},RMFE:function(xe,be){xe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAWgAAAFyCAYAAADYqEAoAAAAAXNSR0IArs4c6QAADetJREFUeAHt1jFqXUEQRUHLa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A0RPECBA4IWAQL9Q9SYBAgQOBAT6ANETBAgQeCEg0C9UvUmAAIEDAYE+QPQEAQIEXggI9AtVbxIgQOBAQKAPED1BgACBFwIC/ULVmwQIEDgQEOgDRE8QIEDghYBAv1D1JgECBA4EBPoA0RMECBB4ISDQL1S9SYAAgQMBgT5A9AQBAgReCAj0C1VvEiBA4EBAoA8QPUGAAIEXAgL9QtWbBAgQOBAQ6ANETxAgQOCFgEC/UPUmAQIEDgQE+gDREwQIEHghINAvVL1JgACBAwGBPkD0BAECBF4ICPQLVW8SIEDgQECgDxA9QYAAgRcCAv1C1ZsECBA4EBDoA0RPECBA4IXAH7PYDOHnuk1pAAAAAElFTkSuQmCC"},SJMd:function(xe,be){/**
* @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 z,Z,H,w=!1,W,P;window.PR_SHOULD_USE_CONTINUATION=!0;var M,N;(function(){var k=window,O=["break,continue,do,else,for,if,return,while"],R=[O,"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"],h=[R,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],v=[h,"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=[h,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],S=[h,"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"],E="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",b=[h,"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",a=[O,"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=[O,"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=[O,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],C=[v,S,L,b,d,a,l,u],g=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,m="str",D="kwd",A="com",f="typ",c="lit",s="pun",o="pln",x="tag",y="dec",p="src",I="atn",B="atv",F="nocode",Q="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function j(we){for(var Re=0,De=!1,He=!1,Ve=0,Ce=we.length;Ve<Ce;++Ve){var Me=we[Ve];if(Me.ignoreCase)He=!0;else if(/[a-z]/i.test(Me.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){De=!0,He=!1;break}}var qe={b:8,t:9,n:10,v:11,f:12,r:13};function tt(Ze){var ye=Ze.charCodeAt(0);if(ye!==92)return ye;var $e=Ze.charAt(1);return ye=qe[$e],ye||("0"<=$e&&$e<="7"?parseInt(Ze.substring(1),8):$e==="u"||$e==="x"?parseInt(Ze.substring(2),16):Ze.charCodeAt(1))}function Ke(Ze){if(Ze<32)return(Ze<16?"\\x0":"\\x")+Ze.toString(16);var ye=String.fromCharCode(Ze);return ye==="\\"||ye==="-"||ye==="]"||ye==="^"?"\\"+ye:ye}function Ne(Ze){var ye=Ze.substring(1,Ze.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=[],Ge=ye[0]==="^",ve=["["];Ge&&ve.push("^");for(var Ie=Ge?1:0,le=ye.length;Ie<le;++Ie){var ae=ye[Ie];if(/\\[bdsw]/i.test(ae))ve.push(ae);else{var oe=tt(ae),Y;Ie+2<le&&ye[Ie+1]==="-"?(Y=tt(ye[Ie+2]),Ie+=2):Y=oe,$e.push([oe,Y]),Y<65||oe>122||(Y<65||oe>90||$e.push([Math.max(65,oe)|32,Math.min(Y,90)|32]),Y<97||oe>122||$e.push([Math.max(97,oe)&~32,Math.min(Y,122)&~32]))}}$e.sort(function(ge,Ae){return ge[0]-Ae[0]||Ae[1]-ge[1]});for(var J=[],q=[],Ie=0;Ie<$e.length;++Ie){var re=$e[Ie];re[0]<=q[1]+1?q[1]=Math.max(q[1],re[1]):J.push(q=re)}for(var Ie=0;Ie<J.length;++Ie){var re=J[Ie];ve.push(Ke(re[0])),re[1]>re[0]&&(re[1]+1>re[0]&&ve.push("-"),ve.push(Ke(re[1])))}return ve.push("]"),ve.join("")}function rt(Ze){for(var ye=Ze.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,Ge=[],ve=0,Ie=0;ve<$e;++ve){var le=ye[ve];if(le==="(")++Ie;else if(le.charAt(0)==="\\"){var ae=+le.substring(1);ae&&(ae<=Ie?Ge[ae]=-1:ye[ve]=Ke(ae))}}for(var ve=1;ve<Ge.length;++ve)Ge[ve]===-1&&(Ge[ve]=++Re);for(var ve=0,Ie=0;ve<$e;++ve){var le=ye[ve];if(le==="(")++Ie,Ge[Ie]||(ye[ve]="(?:");else if(le.charAt(0)==="\\"){var ae=+le.substring(1);ae&&ae<=Ie&&(ye[ve]="\\"+Ge[ae])}}for(var ve=0;ve<$e;++ve)ye[ve]==="^"&&ye[ve+1]!=="^"&&(ye[ve]="");if(Ze.ignoreCase&&De)for(var ve=0;ve<$e;++ve){var le=ye[ve],oe=le.charAt(0);le.length>=2&&oe==="["?ye[ve]=Ne(le):oe!=="\\"&&(ye[ve]=le.replace(/[a-zA-Z]/g,function(q){var re=q.charCodeAt(0);return"["+String.fromCharCode(re&~32,re|32)+"]"}))}return ye.join("")}for(var Je=[],Ve=0,Ce=we.length;Ve<Ce;++Ve){var Me=we[Ve];if(Me.global||Me.multiline)throw new Error(""+Me);Je.push("(?:"+rt(Me)+")")}return new RegExp(Je.join("|"),He?"gi":"g")}function U(we,Re){var De=/(?:^|\s)nocode(?:\s|$)/,He=[],Ve=0,Ce=[],Me=0;function qe(tt){var Ke=tt.nodeType;if(Ke==1){if(De.test(tt.className))return;for(var Ne=tt.firstChild;Ne;Ne=Ne.nextSibling)qe(Ne);var rt=tt.nodeName.toLowerCase();(rt==="br"||rt==="li")&&(He[Me]=`
`,Ce[Me<<1]=Ve++,Ce[Me++<<1|1]=tt)}else if(Ke==3||Ke==4){var Je=tt.nodeValue;Je.length&&(Re?Je=Je.replace(/\r\n?/g,`
`):Je=Je.replace(/[ \t\r\n]+/g," "),He[Me]=Je,Ce[Me<<1]=Ve,Ve+=Je.length,Ce[Me++<<1|1]=tt)}}return qe(we),{sourceCode:He.join("").replace(/\n$/,""),spans:Ce}}function X(we,Re,De,He,Ve){if(!De)return;var Ce={sourceNode:we,pre:1,langExtension:null,numberLines:null,sourceCode:De,spans:null,basePos:Re,decorations:null};He(Ce),Ve.push.apply(Ve,Ce.decorations)}var $=/\S/;function ne(we){for(var Re=void 0,De=we.firstChild;De;De=De.nextSibling){var He=De.nodeType;Re=He===1?Re?we:De:He===3&&$.test(De.nodeValue)?we:Re}return Re===we?void 0:Re}function ue(we,Re){var De={},He;(function(){for(var Me=we.concat(Re),qe=[],tt={},Ke=0,Ne=Me.length;Ke<Ne;++Ke){var rt=Me[Ke],Je=rt[3];if(Je)for(var Ze=Je.length;--Ze>=0;)De[Je.charAt(Ze)]=rt;var ye=rt[1],$e=""+ye;tt.hasOwnProperty($e)||(qe.push(ye),tt[$e]=null)}qe.push(/[\0-\uffff]/),He=j(qe)})();var Ve=Re.length,Ce=function(Me){for(var qe=Me.sourceCode,tt=Me.basePos,Ke=Me.sourceNode,Ne=[tt,o],rt=0,Je=qe.match(He)||[],Ze={},ye=0,$e=Je.length;ye<$e;++ye){var Ge=Je[ye],ve=Ze[Ge],Ie=void 0,le;if(typeof ve=="string")le=!1;else{var ae=De[Ge.charAt(0)];if(ae)Ie=Ge.match(ae[1]),ve=ae[0];else{for(var oe=0;oe<Ve;++oe)if(ae=Re[oe],Ie=Ge.match(ae[1]),Ie){ve=ae[0];break}Ie||(ve=o)}le=ve.length>=5&&ve.substring(0,5)==="lang-",le&&!(Ie&&typeof Ie[1]=="string")&&(le=!1,ve=p),le||(Ze[Ge]=ve)}var Y=rt;if(rt+=Ge.length,!le)Ne.push(tt+Y,ve);else{var J=Ie[1],q=Ge.indexOf(J),re=q+J.length;Ie[2]&&(re=Ge.length-Ie[2].length,q=re-J.length);var ge=ve.substring(5);X(Ke,tt+Y,Ge.substring(0,q),Ce,Ne),X(Ke,tt+Y+q,J,se(ge,J),Ne),X(Ke,tt+Y+re,Ge.substring(re),Ce,Ne)}}Me.decorations=Ne};return Ce}function Te(we){var Re=[],De=[];we.tripleQuotedStrings?Re.push([m,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):we.multiLineStrings?Re.push([m,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Re.push([m,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),we.verbatimStrings&&De.push([m,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var He=we.hashComments;He&&(we.cStyleComments?(He>1?Re.push([A,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Re.push([A,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),De.push([m,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Re.push([A,/^#[^\r\n]*/,null,"#"])),we.cStyleComments&&(De.push([A,/^\/\/[^\r\n]*/,null]),De.push([A,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Ve=we.regexLiterals;if(Ve){var Ce=Ve>1?"":`
\r`,Me=Ce?".":"[\\S\\s]",qe="/(?=[^/*"+Ce+"])(?:[^/\\x5B\\x5C"+Ce+"]|\\x5C"+Me+"|\\x5B(?:[^\\x5C\\x5D"+Ce+"]|\\x5C"+Me+")*(?:\\x5D|$))+/";De.push(["lang-regex",RegExp("^"+Q+"("+qe+")")])}var tt=we.types;tt&&De.push([f,tt]);var Ke=(""+we.keywords).replace(/^ | $/g,"");Ke.length&&De.push([D,new RegExp("^(?:"+Ke.replace(/[\s,]+/g,"|")+")\\b"),null]),Re.push([o,/^\s+/,null,` \r
\xA0`]);var Ne="^.[^\\s\\w.$@'\"`/\\\\]*";return we.regexLiterals&&(Ne+="(?!s*/)"),De.push([c,/^@[a-z_$][a-z_$@0-9]*/i,null],[f,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[o,/^[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"],[o,/^\\[\s\S]?/,null],[s,new RegExp(Ne),null]),ue(Re,De)}var pe=Te({keywords:C,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function de(we,Re,De){for(var He=/(?:^|\s)nocode(?:\s|$)/,Ve=/\r\n?|\n/,Ce=we.ownerDocument,Me=Ce.createElement("li");we.firstChild;)Me.appendChild(we.firstChild);var qe=[Me];function tt(ye){var $e=ye.nodeType;if($e==1&&!He.test(ye.className))if(ye.nodeName==="br")Ke(ye),ye.parentNode&&ye.parentNode.removeChild(ye);else for(var Ge=ye.firstChild;Ge;Ge=Ge.nextSibling)tt(Ge);else if(($e==3||$e==4)&&De){var ve=ye.nodeValue,Ie=ve.match(Ve);if(Ie){var le=ve.substring(0,Ie.index);ye.nodeValue=le;var ae=ve.substring(Ie.index+Ie[0].length);if(ae){var oe=ye.parentNode;oe.insertBefore(Ce.createTextNode(ae),ye.nextSibling)}Ke(ye),le||ye.parentNode.removeChild(ye)}}}function Ke(ye){for(;!ye.nextSibling;)if(ye=ye.parentNode,!ye)return;function $e(Ie,le){var ae=le?Ie.cloneNode(!1):Ie,oe=Ie.parentNode;if(oe){var Y=$e(oe,1),J=Ie.nextSibling;Y.appendChild(ae);for(var q=J;q;q=J)J=q.nextSibling,Y.appendChild(q)}return ae}for(var Ge=$e(ye.nextSibling,0),ve;(ve=Ge.parentNode)&&ve.nodeType===1;)Ge=ve;qe.push(Ge)}for(var Ne=0;Ne<qe.length;++Ne)tt(qe[Ne]);Re===(Re|0)&&qe[0].setAttribute("value",Re);var rt=Ce.createElement("ol");rt.className="linenums";for(var Je=Math.max(0,Re-1|0)||0,Ne=0,Ze=qe.length;Ne<Ze;++Ne)Me=qe[Ne],Me.className="L"+(Ne+Je)%10,Me.firstChild||Me.appendChild(Ce.createTextNode("\xA0")),rt.appendChild(Me);we.appendChild(rt)}function ce(we){var Re=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Re=Re&&+Re[1]<=8;var De=/\n/g,He=we.sourceCode,Ve=He.length,Ce=0,Me=we.spans,qe=Me.length,tt=0,Ke=we.decorations,Ne=Ke.length,rt=0;Ke[Ne]=Ve;var Je,Ze;for(Ze=Je=0;Ze<Ne;)Ke[Ze]!==Ke[Ze+2]?(Ke[Je++]=Ke[Ze++],Ke[Je++]=Ke[Ze++]):Ze+=2;for(Ne=Je,Ze=Je=0;Ze<Ne;){for(var ye=Ke[Ze],$e=Ke[Ze+1],Ge=Ze+2;Ge+2<=Ne&&Ke[Ge+1]===$e;)Ge+=2;Ke[Je++]=ye,Ke[Je++]=$e,Ze=Ge}Ne=Ke.length=Je;var ve=we.sourceNode,Ie="";ve&&(Ie=ve.style.display,ve.style.display="none");try{for(var le=null;tt<qe;){var ae=Me[tt],oe=Me[tt+2]||Ve,Y=Ke[rt+2]||Ve,Ge=Math.min(oe,Y),J=Me[tt+1],q;if(J.nodeType!==1&&(q=He.substring(Ce,Ge))){Re&&(q=q.replace(De,"\r")),J.nodeValue=q;var re=J.ownerDocument,ge=re.createElement("span");ge.className=Ke[rt+1];var Ae=J.parentNode;Ae.replaceChild(ge,J),ge.appendChild(J),Ce<oe&&(Me[tt+1]=J=re.createTextNode(He.substring(Ge,oe)),Ae.insertBefore(J,ge.nextSibling))}Ce=Ge,Ce>=oe&&(tt+=2),Ce>=Y&&(rt+=2)}}finally{ve&&(ve.style.display=Ie)}}var fe={};function te(we,Re){for(var De=Re.length;--De>=0;){var He=Re[De];fe.hasOwnProperty(He)?k.console&&console.warn("cannot override language handler %s",He):fe[He]=we}}function se(we,Re){return we&&fe.hasOwnProperty(we)||(we=/^\s*</.test(Re)?"default-markup":"default-code"),fe[we]}te(pe,["default-code"]),te(ue([],[[o,/^[^<?]+/],[y,/^<!\w[^>]*(?:>|$)/],[A,/^<\!--[\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"]),te(ue([[o,/^[\s]+/,null,` \r
`],[B,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[x,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[I,/^(?!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"]),te(ue([],[[B,/^[\s\S]+/]]),["uq.val"]),te(Te({keywords:v,hashComments:!0,cStyleComments:!0,types:g}),["c","cc","cpp","cxx","cyc","m"]),te(Te({keywords:"null,true,false"}),["json"]),te(Te({keywords:S,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:g}),["cs"]),te(Te({keywords:L,cStyleComments:!0}),["java"]),te(Te({keywords:u,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),te(Te({keywords:a,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),te(Te({keywords:d,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),te(Te({keywords:l,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),te(Te({keywords:b,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),te(Te({keywords:E,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),te(ue([],[[m,/^[\s\S]+/]]),["regex"]);function Ee(we){var Re=we.langExtension;try{var De=U(we.sourceNode,we.pre),He=De.sourceCode;we.sourceCode=He,we.spans=De.spans,we.basePos=0,se(Re,He)(we),ce(we)}catch(Ve){k.console&&console.log(Ve&&Ve.stack||Ve)}}function ke(we,Re,De){var He=De||!1,Ve=Re||null,Ce=document.createElement("div");Ce.innerHTML="<pre>"+we+"</pre>",Ce=Ce.firstChild,He&&de(Ce,He,!0);var Me={langExtension:Ve,numberLines:He,sourceNode:Ce,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return Ee(Me),Ce.innerHTML}function Le(we,Re){var De=Re||document.body,He=De.ownerDocument||document;function Ve(ae){return De.getElementsByTagName(ae)}for(var Ce=[Ve("pre"),Ve("code"),Ve("xmp")],Me=[],qe=0;qe<Ce.length;++qe)for(var tt=0,Ke=Ce[qe].length;tt<Ke;++tt)Me.push(Ce[qe][tt]);Ce=null;var Ne=Date;Ne.now||(Ne={now:function(){return+new Date}});var rt=0,Je=/\blang(?:uage)?-([\w.]+)(?!\S)/,Ze=/\bprettyprint\b/,ye=/\bprettyprinted\b/,$e=/pre|xmp/i,Ge=/^code$/i,ve=/^(?:pre|code|xmp)$/i,Ie={};function le(){for(var ae=k.PR_SHOULD_USE_CONTINUATION?Ne.now()+250:Infinity;rt<Me.length&&Ne.now()<ae;rt++){for(var oe=Me[rt],Y=Ie,J=oe;J=J.previousSibling;){var q=J.nodeType,re=(q===7||q===8)&&J.nodeValue;if(re?!/^\??prettify\b/.test(re):q!==3||/\S/.test(J.nodeValue))break;if(re){Y={},re.replace(/\b(\w+)=([\w:.%+-]+)/g,function(bt,at,Et){Y[at]=Et});break}}var ge=oe.className;if((Y!==Ie||Ze.test(ge))&&!ye.test(ge)){for(var Ae=!1,Be=oe.parentNode;Be;Be=Be.parentNode){var lt=Be.tagName;if(ve.test(lt)&&Be.className&&Ze.test(Be.className)){Ae=!0;break}}if(!Ae){oe.className+=" prettyprinted";var Pe=Y.lang;if(!Pe){Pe=ge.match(Je);var Ye;!Pe&&(Ye=ne(oe))&&Ge.test(Ye.tagName)&&(Pe=Ye.className.match(Je)),Pe&&(Pe=Pe[1])}var ht;if($e.test(oe.tagName))ht=1;else{var ot=oe.currentStyle,it=He.defaultView,Ot=ot?ot.whiteSpace:it&&it.getComputedStyle?it.getComputedStyle(oe,null).getPropertyValue("white-space"):0;ht=Ot&&Ot.substring(0,3)==="pre"}var xt=Y.linenums;(xt=xt==="true"||+xt)||(xt=ge.match(/\blinenums\b(?::(\d+))?/),xt=xt?xt[1]&&xt[1].length?+xt[1]:!0:!1),xt&&de(oe,xt,ht);var Ct={langExtension:Pe,sourceNode:oe,numberLines:xt,pre:ht,sourceCode:null,basePos:null,spans:null,decorations:null};Ee(Ct)}}}rt<Me.length?k.setTimeout(le,250):typeof we=="function"&&we()}le()}var We=k.PR={createSimpleLexer:ue,registerLangHandler:te,sourceDecorator:Te,PR_ATTRIB_NAME:I,PR_ATTRIB_VALUE:B,PR_COMMENT:A,PR_DECLARATION:y,PR_KEYWORD:D,PR_LITERAL:c,PR_NOCODE:F,PR_PLAIN:o,PR_PUNCTUATION:s,PR_SOURCE:p,PR_STRING:m,PR_TAG:x,PR_TYPE:f,prettyPrintOne:w?k.prettyPrintOne=ke:M=ke,prettyPrint:N=w?k.prettyPrint=Le:N=Le},Xe=k.define;typeof Xe=="function"&&Xe.amd&&Xe("google-code-prettify",[],function(){return We})})()},SMhR:function(xe,be){xe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcYAAAHGCAYAAADuYispAAAAAklEQVR4AewaftIAABHTSURBVO3BQY4cy5IEQdNA3//KNo2/8NU8XzCQyCpSReivSJKk/zmRJEnjRJIkjRNJkjROJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ40SSJI0TSZI0TiRJ0jiRJEnjRJIkjRNJkjROJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ40SSJI0TSZI0TiRJ0jiRJEnjRJIkjRNJkjROJEnSOJEkSeNEkiSNE0mSNH7yMiB/s7a5AWTTNhsgN9pmA2TTNp8MyI22uQHkv7TNDSCbttkAudE2bwJyo22eBGTTNhsgf7O2ecuJJEkaJ5IkaZxIkqRxIkmSxokkSRonkiRpnEiSpPGTD9c2nwzIk9pmA2TTNjeAPAnIpm1uANm0zQbIDSBPAXIDyKZtPhmQG22zAfLN2uaTAflUJ5IkaZxIkqRxIkmSxokkSRonkiRpnEiSpHEiSZLGT74ckCe1zZOAbNpm0zYbIDfaZgPkRts8qW1utM0GyKZtntI2GyBPArJpmw2QTds8CcimbW4A+WRAntQ23+pEkiSNE0mSNE4kSdI4kSRJ40SSJI0TSZI0TiRJ0viJXtU2T2qbDZA3Adm0zZOAbNpm0zYbIJu2+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SNE4kSdI4kSRJ40SSJI0TSZI0TiRJ0jiRJEnjRJIkjRNJkjROJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ40SSJI0TSZI0TiRJ0jiRJEnjRJIkjRNJkjROJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ4/8ATrCgy9kbxW8AAAAASUVORK5CYII="},TGq3:function(xe,be,z){xe.exports=z.p+"static/lockclose.365036e8.svg"},"VrN/":function(xe,be,z){(function(Z,H){xe.exports=H()})(this,function(){"use strict";var Z=navigator.userAgent,H=navigator.platform,w=/gecko\/\d/i.test(Z),W=/MSIE \d/.test(Z),P=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Z),M=/Edge\/(\d+)/.exec(Z),N=W||P||M,k=N&&(W?document.documentMode||6:+(M||P)[1]),O=!M&&/WebKit\//.test(Z),R=O&&/Qt\/\d+\.\d+/.test(Z),h=!M&&/Chrome\//.test(Z),v=/Opera\//.test(Z),L=/Apple Computer/.test(navigator.vendor),S=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(Z),E=/PhantomJS/.test(Z),b=!M&&/AppleWebKit/.test(Z)&&/Mobile\/\w+/.test(Z),d=/Android/.test(Z),a=b||d||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(Z),l=b||/Mac/.test(H),u=/\bCrOS\b/.test(Z),C=/win/i.test(H),g=v&&Z.match(/Version\/(\d*\.\d*)/);g&&(g=Number(g[1])),g&&g>=15&&(v=!1,O=!0);var m=l&&(R||v&&(g==null||g<12.11)),D=w||N&&k>=9;function A(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var f=function(e,t){var n=e.className,r=A(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 o(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 T=0;T<t.length;++T)i.appendChild(t[T]);return i}function x(e,t,n,r){var i=o(e,t,n,r);return i.setAttribute("role","presentation"),i}var y;document.createRange?y=function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:y=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 p(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 I(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function B(e,t){var n=e.className;A(t).test(n)||(e.className+=(n?" ":"")+t)}function F(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!A(n[r]).test(t)&&(t+=" "+n[r]);return t}var Q=function(e){e.select()};b?Q=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:N&&(Q=function(e){try{e.select()}catch(t){}});function j(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function U(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 X(e,t,n,r,i){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var T=r||0,_=i||0;;){var K=e.indexOf(" ",T);if(K<0||K>=t)return _+(t-T);_+=K-T,_+=n-_%n,T=K+1}}var $=function(){this.id=null,this.f=null,this.time=0,this.handler=j(this.onTimeout,this)};$.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},$.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 ne(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}var ue=50,Te={toString:function(){return"CodeMirror.Pass"}},pe={scroll:!1},de={origin:"*mouse"},ce={origin:"+move"};function fe(e,t,n){for(var r=0,i=0;;){var T=e.indexOf(" ",r);T==-1&&(T=e.length);var _=T-r;if(T==e.length||i+_>=t)return r+Math.min(_,t-i);if(i+=T-r,i+=n-i%n,r=T+1,i>=t)return r}}var te=[""];function se(e){for(;te.length<=e;)te.push(Ee(te)+" ");return te[e]}function Ee(e){return e[e.length-1]}function ke(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function Le(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}function We(){}function Xe(e,t){var n;return Object.create?n=Object.create(e):(We.prototype=e,n=new We),t&&U(t,n),n}var we=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Re(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||we.test(e))}function De(e,t){return t?t.source.indexOf("\\w")>-1&&Re(e)?!0:t.test(e):Re(e)}function He(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Ve=/[\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 Ce(e){return e.charCodeAt(0)>=768&&Ve.test(e)}function Me(e,t,n){for(;(n<0?t>0:t<e.length)&&Ce(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,T=r<0?Math.ceil(i):Math.floor(i);if(T==t)return e(T)?t:n;e(T)?n=T:t=T+r}}function tt(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,T=0;T<e.length;++T){var _=e[T];(_.from<n&&_.to>t||t==n&&_.to==t)&&(r(Math.max(_.from,t),Math.min(_.to,n),_.level==1?"rtl":"ltr",T),i=!0)}i||r(t,n,"ltr")}var Ke=null;function Ne(e,t,n){var r;Ke=null;for(var i=0;i<e.length;++i){var T=e[i];if(T.from<t&&T.to>t)return i;T.to==t&&(T.from!=T.to&&n=="before"?r=i:Ke=i),T.from==t&&(T.from!=T.to&&n!="before"?r=i:Ke=i)}return r!=null?r:Ke}var rt=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(V){return V<=247?e.charAt(V):1424<=V&&V<=1524?"R":1536<=V&&V<=1785?t.charAt(V-1536):1774<=V&&V<=2220?"r":8192<=V&&V<=8203?"w":V==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,T=/[LRr]/,_=/[Lb1n]/,K=/[1n]/;function G(V,ee,ie){this.level=V,this.from=ee,this.to=ie}return function(V,ee){var ie=ee=="ltr"?"L":"R";if(V.length==0||ee=="ltr"&&!r.test(V))return!1;for(var me=V.length,he=[],Se=0;Se<me;++Se)he.push(n(V.charCodeAt(Se)));for(var Oe=0,je=ie;Oe<me;++Oe){var ze=he[Oe];ze=="m"?he[Oe]=je:je=ze}for(var et=0,Qe=ie;et<me;++et){var nt=he[et];nt=="1"&&Qe=="r"?he[et]="n":T.test(nt)&&(Qe=nt,nt=="r"&&(he[et]="R"))}for(var ft=1,dt=he[0];ft<me-1;++ft){var Tt=he[ft];Tt=="+"&&dt=="1"&&he[ft+1]=="1"?he[ft]="1":Tt==","&&dt==he[ft+1]&&(dt=="1"||dt=="n")&&(he[ft]=dt),dt=Tt}for(var Ut=0;Ut<me;++Ut){var qt=he[Ut];if(qt==",")he[Ut]="N";else if(qt=="%"){var Wt=void 0;for(Wt=Ut+1;Wt<me&&he[Wt]=="%";++Wt);for(var vr=Ut&&he[Ut-1]=="!"||Wt<me&&he[Wt]=="1"?"1":"N",hr=Ut;hr<Wt;++hr)he[hr]=vr;Ut=Wt-1}}for(var Vt=0,mr=ie;Vt<me;++Vt){var rr=he[Vt];mr=="L"&&rr=="1"?he[Vt]="L":T.test(rr)&&(mr=rr)}for(var Yt=0;Yt<me;++Yt)if(i.test(he[Yt])){var Xt=void 0;for(Xt=Yt+1;Xt<me&&i.test(he[Xt]);++Xt);for(var Kt=(Yt?he[Yt-1]:ie)=="L",pr=(Xt<me?he[Xt]:ie)=="L",Kn=Kt==pr?Kt?"L":"R":ie,tn=Yt;tn<Xt;++tn)he[tn]=Kn;Yt=Xt-1}for(var sr=[],Br,$t=0;$t<me;)if(_.test(he[$t])){var za=$t;for(++$t;$t<me&&_.test(he[$t]);++$t);sr.push(new G(0,za,$t))}else{var Wr=$t,En=sr.length,bn=ee=="rtl"?1:0;for(++$t;$t<me&&he[$t]!="L";++$t);for(var dr=Wr;dr<$t;)if(K.test(he[dr])){Wr<dr&&(sr.splice(En,0,new G(1,Wr,dr)),En+=bn);var Hn=dr;for(++dr;dr<$t&&K.test(he[dr]);++dr);sr.splice(En,0,new G(2,Hn,dr)),En+=bn,Wr=dr}else++dr;Wr<$t&&sr.splice(En,0,new G(1,Wr,$t))}return ee=="ltr"&&(sr[0].level==1&&(Br=V.match(/^\s+/))&&(sr[0].from=Br[0].length,sr.unshift(new G(0,0,Br[0].length))),Ee(sr).level==1&&(Br=V.match(/\s+$/))&&(Ee(sr).to-=Br[0].length,sr.push(new G(0,me-Br[0].length,me)))),ee=="rtl"?sr.reverse():sr}}();function Je(e,t){var n=e.order;return n==null&&(n=e.order=rt(e.text,t)),n}var Ze=[],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]||Ze).concat(n)}};function $e(e,t){return e._handlers&&e._handlers[t]||Ze}function Ge(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 T=ne(i,n);T>-1&&(r[t]=i.slice(0,T).concat(i.slice(T+1)))}}}function ve(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 Ie(e,t,n){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),ve(e,n||t.type,e,t),q(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)ne(n,t[r])==-1&&n.push(t[r])}function ae(e,t){return $e(e,t).length>0}function oe(e){e.prototype.on=function(t,n){ye(this,t,n)},e.prototype.off=function(t,n){Ge(this,t,n)}}function Y(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function J(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function q(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function re(e){Y(e),J(e)}function ge(e){return e.target||e.srcElement}function Ae(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 Be=function(){if(N&&k<9)return!1;var e=o("div");return"draggable"in e||"dragDrop"in e}(),lt;function Pe(e){if(lt==null){var t=o("span","\u200B");s(e,o("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(lt=t.offsetWidth<=1&&t.offsetHeight>2&&!(N&&k<8))}var n=lt?o("span","\u200B"):o("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}var Ye;function ht(e){if(Ye!=null)return Ye;var t=s(e,document.createTextNode("A\u062EA")),n=y(t,0,1).getBoundingClientRect(),r=y(t,1,2).getBoundingClientRect();return c(e),!n||n.left==n.right?!1:Ye=r.right-n.right<3}var ot=`
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 T=e.slice(t,e.charAt(i-1)=="\r"?i-1:i),_=T.indexOf("\r");_!=-1?(n.push(T.slice(0,_)),t+=_+1):(n.push(T),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},it=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},Ot=function(){var e=o("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),xt=null;function Ct(e){if(xt!=null)return xt;var t=s(e,o("span","x")),n=t.getBoundingClientRect(),r=y(t,0,1).getBoundingClientRect();return xt=Math.abs(n.left-r.left)>1}var bt={},at={};function Et(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),bt[e]=t}function Lt(e,t){at[e]=t}function Rt(e){if(typeof e=="string"&&at.hasOwnProperty(e))e=at[e];else if(e&&typeof e.name=="string"&&at.hasOwnProperty(e.name)){var t=at[e.name];typeof t=="string"&&(t={name:t}),e=Xe(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Rt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Rt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Ht(e,t){t=Rt(t);var n=bt[t.name];if(!n)return Ht(e,"text/plain");var r=n(e,t);if(nr.hasOwnProperty(t.name)){var i=nr[t.name];for(var T in i){if(!i.hasOwnProperty(T))continue;r.hasOwnProperty(T)&&(r["_"+T]=r[T]),r[T]=i[T]}}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var _ in t.modeProps)r[_]=t.modeProps[_];return r}var nr={};function yr(e,t){var n=nr.hasOwnProperty(e)?nr[e]:nr[e]={};U(t,n)}function xr(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 Ir(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 Ft(e,t,n){return e.startState?e.startState(t,n):!0}var mt=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};mt.prototype.eol=function(){return this.pos>=this.string.length},mt.prototype.sol=function(){return this.pos==this.lineStart},mt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},mt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},mt.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},mt.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},mt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},mt.prototype.skipToEnd=function(){this.pos=this.string.length},mt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},mt.prototype.backUp=function(e){this.pos-=e},mt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=X(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?X(this.string,this.lineStart,this.tabSize):0)},mt.prototype.indentation=function(){return X(this.string,null,this.tabSize)-(this.lineStart?X(this.string,this.lineStart,this.tabSize):0)},mt.prototype.match=function(e,t,n){if(typeof e=="string"){var r=function(_){return n?_.toLowerCase():_},i=this.string.substr(this.pos,e.length);if(r(i)==r(e))return t!==!1&&(this.pos+=e.length),!0}else{var T=this.string.slice(this.pos).match(e);return T&&T.index>0?null:(T&&t!==!1&&(this.pos+=T[0].length),T)}},mt.prototype.current=function(){return this.string.slice(this.start,this.pos)},mt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},mt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},mt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function Ue(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],T=i.chunkSize();if(t<T){n=i;break}t-=T}return n.lines[t]}function _t(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,function(T){var _=T.text;i==n.line&&(_=_.slice(0,n.ch)),i==t.line&&(_=_.slice(t.ch)),r.push(_),++i}),r}function yt(e,t,n){var r=[];return e.iter(t,n,function(i){r.push(i.text)}),r}function zt(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function wt(e){if(e.parent==null)return null;for(var t=e.parent,n=ne(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 ir(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],T=i.height;if(t<T){e=i;continue e}t-=T,n+=i.chunkSize()}return n}while(!e.lines);for(var _=0;_<e.lines.length;++_){var K=e.lines[_],G=K.height;if(t<G)break;t-=G}return n+_}function ut(e,t){return t>=e.first&&t<e.first+e.size}function Or(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function _e(e,t,n){if(n===void 0&&(n=null),!(this instanceof _e))return new _e(e,t,n);this.line=e,this.ch=t,this.sticky=n}function pt(e,t){return e.line-t.line||e.ch-t.ch}function rn(e,t){return e.sticky==t.sticky&&pt(e,t)==0}function xn(e){return _e(e.line,e.ch)}function An(e,t){return pt(e,t)<0?t:e}function nn(e,t){return pt(e,t)<0?e:t}function wi(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function gt(e,t){if(t.line<e.first)return _e(e.first,0);var n=e.first+e.size-1;return t.line>n?_e(n,Ue(e,n).text.length):ia(t,Ue(e,t.line).text.length)}function ia(e,t){var n=e.ch;return n==null||n>t?_e(e.line,t):n<0?_e(e.line,0):e}function Gn(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=gt(e,t[r]);return n}var Kr=function(e,t){this.state=e,this.lookAhead=t},Ar=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};Ar.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Ar.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}},Ar.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Ar.fromSaved=function(e,t,n){return t instanceof Kr?new Ar(e,xr(e.mode,t.state),n,t.lookAhead):new Ar(e,xr(e.mode,t),n)},Ar.prototype.save=function(e){var t=e!==!1?xr(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Kr(t,this.maxLookAhead):t};function zn(e,t,n,r){var i=[e.state.modeGen],T={};Mr(e,t.text,e.doc.mode,n,function(V,ee){return i.push(V,ee)},T,r);for(var _=n.state,K=function(V){n.baseTokens=i;var ee=e.state.overlays[V],ie=1,me=0;n.state=!0,Mr(e,t.text,ee.mode,n,function(he,Se){for(var Oe=ie;me<he;){var je=i[ie];je>he&&i.splice(ie,1,he,i[ie+1],je),ie+=2,me=Math.min(he,je)}if(!Se)return;if(ee.opaque)i.splice(Oe,ie-Oe,he,"overlay "+Se),ie=Oe+2;else for(;Oe<ie;Oe+=2){var ze=i[Oe+1];i[Oe+1]=(ze?ze+" ":"")+"overlay "+Se}},T),n.state=_,n.baseTokens=null,n.baseTokenPos=1},G=0;G<e.state.overlays.length;++G)K(G);return{styles:i,classes:T.bgClass||T.textClass?T:null}}function Fe(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=an(e,wt(t)),i=t.text.length>e.options.maxHighlightLength&&xr(e.doc.mode,r.state),T=zn(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=T.styles,T.classes?t.styleClasses=T.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 an(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new Ar(r,!0,t);var T=Li(e,t,n),_=T>r.first&&Ue(r,T-1).stateAfter,K=_?Ar.fromSaved(r,_,T):new Ar(r,Ft(r.mode),T);return r.iter(T,t,function(G){Qn(e,G.text,K);var V=K.line;G.stateAfter=V==t-1||V%5==0||V>=i.viewFrom&&V<i.viewTo?K.save():null,K.nextLine()}),n&&(r.modeFrontier=K.line),K}function Qn(e,t,n,r){var i=e.doc.mode,T=new mt(t,e.options.tabSize,n);for(T.start=T.pos=r||0,t==""&&Vn(i,n.state);!T.eol();)Hr(i,T,n.state),T.start=T.pos}function Vn(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var n=Ir(e,t);if(n.mode.blankLine)return n.mode.blankLine(n.state)}function Hr(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=Ir(e,n).mode);var T=e.token(t,n);if(t.pos>t.start)return T}throw new Error("Mode "+e.name+" failed to advance stream.")}var Gr=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,T=i.mode,_;t=gt(i,t);var K=Ue(i,t.line),G=an(e,t.line,n),V=new mt(K.text,e.options.tabSize,G),ee;for(r&&(ee=[]);(r||V.pos<t.ch)&&!V.eol();)V.start=V.pos,_=Hr(T,V,G.state),r&&ee.push(new Gr(V,_,xr(i.mode,G.state)));return r?ee:new Gr(V,_,G.state)}function Xn(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 Mr(e,t,n,r,i,T,_){var K=n.flattenSpans;K==null&&(K=e.options.flattenSpans);var G=0,V=null,ee=new mt(t,e.options.tabSize,r),ie,me=e.options.addModeClass&&[null];for(t==""&&Xn(Vn(n,r.state),T);!ee.eol();){if(ee.pos>e.options.maxHighlightLength?(K=!1,_&&Qn(e,t,r,ee.pos),ee.pos=t.length,ie=null):ie=Xn(Hr(n,ee,r.state,me),T),me){var he=me[0].name;he&&(ie="m-"+(ie?he+" "+ie:he))}if(!K||V!=ie){for(;G<ee.start;)G=Math.min(ee.start,G+5e3),i(G,V);V=ie}ee.start=ee.pos}for(;G<ee.pos;){var Se=Math.min(ee.pos,G+5e3);i(Se,V),G=Se}}function Li(e,t,n){for(var r,i,T=e.doc,_=n?-1:t-(e.doc.mode.innerMode?1e3:100),K=t;K>_;--K){if(K<=T.first)return T.first;var G=Ue(T,K-1),V=G.stateAfter;if(V&&(!n||K+(V instanceof Kr?V.lookAhead:0)<=T.modeFrontier))return K;var ee=X(G.text,null,e.options.tabSize);(i==null||r>ee)&&(i=K-1,r=ee)}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=Ue(e,r).stateAfter;if(i&&(!(i instanceof Kr)||r+i.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}var Yn=!1,er=!1;function Ri(){Yn=!0}function oa(){er=!0}function on(e,t,n){this.marker=e,this.from=t,this.to=n}function Tr(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function zr(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 Ii(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var T=e[i],_=T.marker,K=T.from==null||(_.inclusiveLeft?T.from<=t:T.from<t);if(K||T.from==t&&_.type=="bookmark"&&(!n||!T.marker.insertLeft)){var G=T.to==null||(_.inclusiveRight?T.to>=t:T.to>t);(r||(r=[])).push(new on(_,T.from,G?null:T.to))}}return r}function sn(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var T=e[i],_=T.marker,K=T.to==null||(_.inclusiveRight?T.to>=t:T.to>t);if(K||T.from==t&&_.type=="bookmark"&&(!n||T.marker.insertLeft)){var G=T.from==null||(_.inclusiveLeft?T.from<=t:T.from<t);(r||(r=[])).push(new on(_,G?null:T.from-t,T.to==null?null:T.to-t))}}return r}function ln(e,t){if(t.full)return null;var n=ut(e,t.from.line)&&Ue(e,t.from.line).markedSpans,r=ut(e,t.to.line)&&Ue(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,T=t.to.ch,_=pt(t.from,t.to)==0,K=Ii(n,i,_),G=sn(r,T,_),V=t.text.length==1,ee=Ee(t.text).length+(V?i:0);if(K)for(var ie=0;ie<K.length;++ie){var me=K[ie];if(me.to==null){var he=Tr(G,me.marker);he?V&&(me.to=he.to==null?null:he.to+ee):me.to=i}}if(G)for(var Se=0;Se<G.length;++Se){var Oe=G[Se];if(Oe.to!=null&&(Oe.to+=ee),Oe.from==null){var je=Tr(K,Oe.marker);je||(Oe.from=ee,V&&(K||(K=[])).push(Oe))}else Oe.from+=ee,V&&(K||(K=[])).push(Oe)}K&&(K=Oi(K)),G&&G!=K&&(G=Oi(G));var ze=[K];if(!V){var et=t.text.length-2,Qe;if(et>0&&K)for(var nt=0;nt<K.length;++nt)K[nt].to==null&&(Qe||(Qe=[])).push(new on(K[nt].marker,null,null));for(var ft=0;ft<et;++ft)ze.push(Qe);ze.push(G)}return ze}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(he){if(he.markedSpans)for(var Se=0;Se<he.markedSpans.length;++Se){var Oe=he.markedSpans[Se].marker;Oe.readOnly&&(!r||ne(r,Oe)==-1)&&(r||(r=[])).push(Oe)}}),!r)return null;for(var i=[{from:t,to:n}],T=0;T<r.length;++T)for(var _=r[T],K=_.find(0),G=0;G<i.length;++G){var V=i[G];if(pt(V.to,K.from)<0||pt(V.from,K.to)>0)continue;var ee=[G,1],ie=pt(V.from,K.from),me=pt(V.to,K.to);(ie<0||!_.inclusiveLeft&&!ie)&&ee.push({from:V.from,to:K.from}),(me>0||!_.inclusiveRight&&!me)&&ee.push({from:K.to,to:V.to}),i.splice.apply(i,ee),G+=ee.length-3}return i}function Jn(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 Zn(e,t){if(!t)return;for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}function Tn(e){return e.inclusiveLeft?-1:0}function un(e){return e.inclusiveRight?1:0}function Pi(e,t){var n=e.lines.length-t.lines.length;if(n!=0)return n;var r=e.find(),i=t.find(),T=pt(r.from,i.from)||Tn(e)-Tn(t);if(T)return-T;var _=pt(r.to,i.to)||un(e)-un(t);return _||t.id-e.id}function Sn(e,t){var n=er&&e.markedSpans,r;if(n)for(var i=void 0,T=0;T<n.length;++T)i=n[T],i.marker.collapsed&&(t?i.from:i.to)==null&&(!r||Pi(r,i.marker)<0)&&(r=i.marker);return r}function qn(e){return Sn(e,!0)}function dn(e){return Sn(e,!1)}function ki(e,t){var n=er&&e.markedSpans,r;if(n)for(var i=0;i<n.length;++i){var T=n[i];T.marker.collapsed&&(T.from==null||T.from<t)&&(T.to==null||T.to>t)&&(!r||Pi(r,T.marker)<0)&&(r=T.marker)}return r}function Nr(e,t,n,r,i){var T=Ue(e,t),_=er&&T.markedSpans;if(_)for(var K=0;K<_.length;++K){var G=_[K];if(!G.marker.collapsed)continue;var V=G.marker.find(0),ee=pt(V.from,n)||Tn(G.marker)-Tn(i),ie=pt(V.to,r)||un(G.marker)-un(i);if(ee>=0&&ie<=0||ee<=0&&ie>=0)continue;if(ee<=0&&(G.marker.inclusiveRight&&i.inclusiveLeft?pt(V.to,n)>=0:pt(V.to,n)>0)||ee>=0&&(G.marker.inclusiveRight&&i.inclusiveLeft?pt(V.from,r)<=0:pt(V.from,r)<0))return!0}}function ar(e){for(var t;t=qn(e);)e=t.find(-1,!0).line;return e}function Cn(e){for(var t;t=dn(e);)e=t.find(1,!0).line;return e}function wn(e){for(var t,n;t=dn(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function $n(e,t){var n=Ue(e,t),r=ar(n);return n==r?t:wt(r)}function ei(e,t){if(t>e.lastLine())return t;var n=Ue(e,t),r;if(!Cr(e,n))return t;for(;r=dn(n);)n=r.find(1,!0).line;return wt(n)+1}function Cr(e,t){var n=er&&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&&Qr(e,t,r))return!0}}function Qr(e,t,n){if(n.to==null){var r=n.marker.find(1,!0);return Qr(e,r.line,Tr(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i=void 0,T=0;T<t.markedSpans.length;++T)if(i=t.markedSpans[T],i.marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(i.to==null||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&Qr(e,t,i))return!0}function wr(e){e=ar(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 T=n.parent;T;n=T,T=n.parent)for(var _=0;_<T.children.length;++_){var K=T.children[_];if(K==n)break;t+=K.height}return t}function Pr(e){if(e.height==0)return 0;for(var t=e.text.length,n,r=e;n=qn(r);){var i=n.find(0,!0);r=i.from.line,t+=i.from.ch-i.to.ch}for(r=e;n=dn(r);){var T=n.find(0,!0);t-=r.text.length-T.from.ch,r=T.to.line,t+=r.text.length-T.to.ch}return t}function ti(e){var t=e.display,n=e.doc;t.maxLine=Ue(n,n.first),t.maxLineLength=Pr(t.maxLine),t.maxLineChanged=!0,n.iter(function(r){var i=Pr(r);i>t.maxLineLength&&(t.maxLineLength=i,t.maxLine=r)})}var Vr=function(e,t,n){this.text=e,Zn(this,t),this.height=n?n(this):1};Vr.prototype.lineNo=function(){return wt(this)},oe(Vr);function la(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Jn(e),Zn(e,n);var i=r?r(e):1;i!=e.height&&zt(e,i)}function Va(e){e.parent=null,Jn(e)}var Xa={},Ya={};function _i(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Ya:Xa;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function st(e,t){var n=x("span",null,null,O?"padding-right: .1px":null),r={pre:x("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 T=i?t.rest[i-1]:t.line,_=void 0;r.pos=0,r.addToken=ct,ht(e.display.measure)&&(_=Je(T,e.doc.direction))&&(r.addToken=It(r.addToken,_)),r.map=[];var K=t!=e.display.externalMeasured&&wt(T);Dt(T,r,Fe(e,T,K)),T.styleClasses&&(T.styleClasses.bgClass&&(r.bgClass=F(T.styleClasses.bgClass,r.bgClass||"")),T.styleClasses.textClass&&(r.textClass=F(T.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(Pe(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(O){var G=r.content.lastChild;(/\bcm-tab\b/.test(G.className)||G.querySelector&&G.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return ve(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=F(r.pre.className,r.textClass||"")),r}function vt(e){var t=o("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function ct(e,t,n,r,i,T,_){if(!t)return;var K=e.splitSpaces?St(t,e.trailingSpace):t,G=e.cm.state.specialChars,V=!1,ee;if(!G.test(t))e.col+=t.length,ee=document.createTextNode(K),e.map.push(e.pos,e.pos+t.length,ee),N&&k<9&&(V=!0),e.pos+=t.length;else{ee=document.createDocumentFragment();for(var ie=0;;){G.lastIndex=ie;var me=G.exec(t),he=me?me.index-ie:t.length-ie;if(he){var Se=document.createTextNode(K.slice(ie,ie+he));N&&k<9?ee.appendChild(o("span",[Se])):ee.appendChild(Se),e.map.push(e.pos,e.pos+he,Se),e.col+=he,e.pos+=he}if(!me)break;ie+=he+1;var Oe=void 0;if(me[0]==" "){var je=e.cm.options.tabSize,ze=je-e.col%je;Oe=ee.appendChild(o("span",se(ze),"cm-tab")),Oe.setAttribute("role","presentation"),Oe.setAttribute("cm-text"," "),e.col+=ze}else me[0]=="\r"||me[0]==`
`?(Oe=ee.appendChild(o("span",me[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Oe.setAttribute("cm-text",me[0]),e.col+=1):(Oe=e.cm.options.specialCharPlaceholder(me[0]),Oe.setAttribute("cm-text",me[0]),N&&k<9?ee.appendChild(o("span",[Oe])):ee.appendChild(Oe),e.col+=1);e.map.push(e.pos,e.pos+1,Oe),e.pos++}}if(e.trailingSpace=K.charCodeAt(t.length-1)==32,n||r||i||V||T||_){var et=n||"";r&&(et+=r),i&&(et+=i);var Qe=o("span",[ee],et,T);if(_)for(var nt in _)_.hasOwnProperty(nt)&&nt!="style"&&nt!="class"&&Qe.setAttribute(nt,_[nt]);return e.content.appendChild(Qe)}e.content.appendChild(ee)}function St(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;i<e.length;i++){var T=e.charAt(i);T==" "&&n&&(i==e.length-1||e.charCodeAt(i+1)==32)&&(T="\xA0"),r+=T,n=T==" "}return r}function It(e,t){return function(n,r,i,T,_,K,G){i=i?i+" cm-force-border":"cm-force-border";for(var V=n.pos,ee=V+r.length;;){for(var ie=void 0,me=0;me<t.length&&!(ie=t[me],ie.to>V&&ie.from<=V);me++);if(ie.to>=ee)return e(n,r,i,T,_,K,G);e(n,r.slice(0,ie.to-V),i,T,null,K,G),T=null,r=r.slice(ie.to-V),V=ie.to}}}function Bt(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 Dt(e,t,n){var r=e.markedSpans,i=e.text,T=0;if(!r){for(var _=1;_<n.length;_+=2)t.addToken(t,i.slice(T,T=n[_]),_i(n[_+1],t.cm.options));return}for(var K=i.length,G=0,V=1,ee="",ie,me,he=0,Se,Oe,je,ze,et;;){if(he==G){Se=Oe=je=me="",et=null,ze=null,he=Infinity;for(var Qe=[],nt=void 0,ft=0;ft<r.length;++ft){var dt=r[ft],Tt=dt.marker;if(Tt.type=="bookmark"&&dt.from==G&&Tt.widgetNode)Qe.push(Tt);else if(dt.from<=G&&(dt.to==null||dt.to>G||Tt.collapsed&&dt.to==G&&dt.from==G)){if(dt.to!=null&&dt.to!=G&&he>dt.to&&(he=dt.to,Oe=""),Tt.className&&(Se+=" "+Tt.className),Tt.css&&(me=(me?me+";":"")+Tt.css),Tt.startStyle&&dt.from==G&&(je+=" "+Tt.startStyle),Tt.endStyle&&dt.to==he&&(nt||(nt=[])).push(Tt.endStyle,dt.to),Tt.title&&((et||(et={})).title=Tt.title),Tt.attributes)for(var Ut in Tt.attributes)(et||(et={}))[Ut]=Tt.attributes[Ut];Tt.collapsed&&(!ze||Pi(ze.marker,Tt)<0)&&(ze=dt)}else dt.from>G&&he>dt.from&&(he=dt.from)}if(nt)for(var qt=0;qt<nt.length;qt+=2)nt[qt+1]==he&&(Oe+=" "+nt[qt]);if(!ze||ze.from==G)for(var Wt=0;Wt<Qe.length;++Wt)Bt(t,0,Qe[Wt]);if(ze&&(ze.from||0)==G){if(Bt(t,(ze.to==null?K+1:ze.to)-G,ze.marker,ze.from==null),ze.to==null)return;ze.to==G&&(ze=!1)}}if(G>=K)break;for(var vr=Math.min(K,he);;){if(ee){var hr=G+ee.length;if(!ze){var Vt=hr>vr?ee.slice(0,vr-G):ee;t.addToken(t,Vt,ie?ie+Se:Se,je,G+Vt.length==he?Oe:"",me,et)}if(hr>=vr){ee=ee.slice(vr-G),G=vr;break}G=hr,je=""}ee=i.slice(T,T=n[V++]),ie=_i(n[V++],t.cm.options)}}}function Qt(e,t,n){this.line=t,this.rest=wn(t),this.size=this.rest?wt(Ee(this.rest))-n+1:1,this.node=this.text=null,this.hidden=Cr(e,t)}function tr(e,t,n){for(var r=[],i,T=t;T<n;T=i){var _=new Qt(e.doc,Ue(e.doc,T),T);i=T+_.size,r.push(_)}return r}var At=null;function Ur(e){At?At.ops.push(e):e.ownsGroup=At={ops:[e],delayedCallbacks:[]}}function Pt(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 Sr(e,t){var n=e.ownsGroup;if(!n)return;try{Pt(n)}finally{At=null,t(n)}}var lr=null;function Nt(e,t){var n=$e(e,t);if(!n.length)return;var r=Array.prototype.slice.call(arguments,2),i;At?i=At.delayedCallbacks:lr?i=lr:(i=lr=[],setTimeout(Ms,0));for(var T=function(K){i.push(function(){return n[K].apply(null,r)})},_=0;_<n.length;++_)T(_)}function Ms(){var e=lr;lr=null;for(var t=0;t<e.length;++t)e[t]()}function Ja(e,t,n,r){for(var i=0;i<t.changes.length;i++){var T=t.changes[i];T=="text"?ks(e,t):T=="gutter"?qa(e,t,n,r):T=="class"?ua(e,t):T=="widget"&&_s(e,t,r)}t.changes=null}function ri(e){return e.node==e.text&&(e.node=o("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),N&&k<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(o("div",null,n),r.firstChild),e.display.input.setUneditable(t.background)}}function Za(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):st(e,t)}function ks(e,t){var n=t.text.className,r=Za(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,ua(e,t)):n&&(t.text.className=n)}function ua(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 qa(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=o("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 T=t.line.gutterMarkers;if(e.options.lineNumbers||T){var _=ri(t),K=t.gutter=o("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(e.display.input.setUneditable(K),_.insertBefore(K,t.text),t.line.gutterClass&&(K.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!T||!T["CodeMirror-linenumbers"])&&(t.lineNumber=K.appendChild(o("div",Or(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),T)for(var G=0;G<e.display.gutterSpecs.length;++G){var V=e.display.gutterSpecs[G].className,ee=T.hasOwnProperty(V)&&T[V];ee&&K.appendChild(o("div",[ee],"CodeMirror-gutter-elt","left: "+r.gutterLeft[V]+"px; width: "+r.gutterWidth[V]+"px"))}}}function _s(e,t,n){t.alignable&&(t.alignable=null);for(var r=A("CodeMirror-linewidget"),i=t.node.firstChild,T=void 0;i;i=T)T=i.nextSibling,r.test(i.className)&&t.node.removeChild(i);$a(e,t,n)}function Bs(e,t,n,r){var i=Za(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),ua(e,t),qa(e,t,n,r),$a(e,t,r),t.node}function $a(e,t,n){if(eo(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)eo(e,t.rest[r],t,n,!1)}function eo(e,t,n,r,i){if(!t.widgets)return;for(var T=ri(n),_=0,K=t.widgets;_<K.length;++_){var G=K[_],V=o("div",[G.node],"CodeMirror-linewidget"+(G.className?" "+G.className:""));G.handleMouseEvents||V.setAttribute("cm-ignore-events","true"),Ns(G,V,n,r),e.display.input.setUneditable(V),i&&G.above?T.insertBefore(V,n.gutter||n.text):T.appendChild(V),Nt(G,"redraw")}}function Ns(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(!p(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,o("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function Fr(e,t){for(var n=ge(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 da(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function to(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=s(e.measure,o("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 kr(e){return ue-e.display.nativeBarWidth}function cn(e){return e.display.scroller.clientWidth-kr(e)-e.display.barWidth}function ca(e){return e.display.scroller.clientHeight-kr(e)-e.display.barHeight}function Us(e,t,n){var r=e.options.lineWrapping,i=r&&cn(e);if(!t.measure.heights||r&&t.measure.width!=i){var T=t.measure.heights=[];if(r){t.measure.width=i;for(var _=t.text.firstChild.getClientRects(),K=0;K<_.length-1;K++){var G=_[K],V=_[K+1];Math.abs(G.bottom-V.bottom)>2&&T.push((G.bottom+V.top)/2-n.top)}}T.push(n.bottom-n.top)}}function ro(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(wt(e.rest[i])>n)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Fs(e,t){t=ar(t);var n=wt(t),r=e.display.externalMeasured=new Qt(e.doc,t,n);r.lineN=n;var i=r.built=st(e,r);return r.text=i.pre,s(e.display.lineMeasure,i.pre),r}function no(e,t,n,r){return _r(e,Dn(e,t),n,r)}function fa(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[mn(e,t)];var n=e.display.externalMeasured;if(n&&t>=n.lineN&&t<n.lineN+n.size)return n}function Dn(e,t){var n=wt(t),r=fa(e,n);r&&!r.text?r=null:r&&r.changes&&(Ja(e,r,n,ya(e)),e.curOp.forceUpdate=!0),r||(r=Fs(e,t));var i=ro(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function _r(e,t,n,r,i){t.before&&(n=-1);var T=n+(r||""),_;return t.cache.hasOwnProperty(T)?_=t.cache[T]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Us(e,t.view,t.rect),t.hasHeights=!0),_=Ws(e,t,n,r),_.bogus||(t.cache[T]=_)),{left:_.left,right:_.right,top:i?_.rtop:_.top,bottom:i?_.rbottom:_.bottom}}var io={left:0,right:0,top:0,bottom:0};function ao(e,t,n){for(var r,i,T,_,K,G,V=0;V<e.length;V+=3)if(K=e[V],G=e[V+1],t<K?(i=0,T=1,_="left"):t<G?(i=t-K,T=i+1):(V==e.length-3||t==G&&e[V+3]>t)&&(T=G-K,i=T-1,t>=G&&(_="right")),i!=null){if(r=e[V+2],K==G&&n==(r.insertLeft?"left":"right")&&(_=n),n=="left"&&i==0)for(;V&&e[V-2]==e[V-3]&&e[V-1].insertLeft;)r=e[(V-=3)+2],_="left";if(n=="right"&&i==G-K)for(;V<e.length-3&&e[V+3]==e[V+4]&&!e[V+5].insertLeft;)r=e[(V+=3)+2],_="right";break}return{node:r,start:i,end:T,collapse:_,coverStart:K,coverEnd:G}}function js(e,t){var n=io;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=ao(t.map,n,r),T=i.node,_=i.start,K=i.end,G=i.collapse,V;if(T.nodeType==3){for(var ee=0;ee<4;ee++){for(;_&&Ce(t.line.text.charAt(i.coverStart+_));)--_;for(;i.coverStart+K<i.coverEnd&&Ce(t.line.text.charAt(i.coverStart+K));)++K;if(N&&k<9&&_==0&&K==i.coverEnd-i.coverStart?V=T.parentNode.getBoundingClientRect():V=js(y(T,_,K).getClientRects(),r),V.left||V.right||_==0)break;K=_,_=_-1,G="right"}N&&k<11&&(V=Ks(e.display.measure,V))}else{_>0&&(G=r="right");var ie;e.options.lineWrapping&&(ie=T.getClientRects()).length>1?V=ie[r=="right"?ie.length-1:0]:V=T.getBoundingClientRect()}if(N&&k<9&&!_&&(!V||!V.left&&!V.right)){var me=T.parentNode.getClientRects()[0];me?V={left:me.left,right:me.left+Rn(e.display),top:me.top,bottom:me.bottom}:V=io}for(var he=V.top-t.rect.top,Se=V.bottom-t.rect.top,Oe=(he+Se)/2,je=t.view.measure.heights,ze=0;ze<je.length-1&&!(Oe<je[ze]);ze++);var et=ze?je[ze-1]:0,Qe=je[ze],nt={left:(G=="right"?V.right:V.left)-t.rect.left,right:(G=="left"?V.left:V.right)-t.rect.left,top:et,bottom:Qe};return!V.left&&!V.right&&(nt.bogus=!0),e.options.singleCursorHeightPerLine||(nt.rtop=he,nt.rbottom=Se),nt}function Ks(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Ct(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 oo(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 so(e){e.display.externalMeasure=null,c(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)oo(e.display.view[t])}function ii(e){so(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function lo(){return h&&d?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function uo(){return h&&d?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function ha(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 Ni(e,t,n,r,i){if(!i){var T=ha(t);n.top+=T,n.bottom+=T}if(r=="line")return n;r||(r="local");var _=wr(t);if(r=="local"?_+=Bi(e.display):_-=e.display.viewOffset,r=="page"||r=="window"){var K=e.display.lineSpace.getBoundingClientRect();_+=K.top+(r=="window"?0:uo());var G=K.left+(r=="window"?0:lo());n.left+=G,n.right+=G}return n.top+=_,n.bottom+=_,n}function co(e,t,n){if(n=="div")return t;var r=t.left,i=t.top;if(n=="page")r-=lo(),i-=uo();else if(n=="local"||!n){var T=e.display.sizer.getBoundingClientRect();r+=T.left,i+=T.top}var _=e.display.lineSpace.getBoundingClientRect();return{left:r-_.left,top:i-_.top}}function ma(e,t,n,r,i){return r||(r=Ue(e.doc,t.line)),Ni(e,r,no(e,r,t.ch,i),n)}function Dr(e,t,n,r,i,T){r=r||Ue(e.doc,t.line),i||(i=Dn(e,r));function _(Se,Oe){var je=_r(e,i,Se,Oe?"right":"left",T);return Oe?je.left=je.right:je.right=je.left,Ni(e,r,je,n)}var K=Je(r,e.doc.direction),G=t.ch,V=t.sticky;if(G>=r.text.length?(G=r.text.length,V="before"):G<=0&&(G=0,V="after"),!K)return _(V=="before"?G-1:G,V=="before");function ee(Se,Oe,je){var ze=K[Oe],et=ze.level==1;return _(je?Se-1:Se,et!=je)}var ie=Ne(K,G,V),me=Ke,he=ee(G,ie,V=="before");return me!=null&&(he.other=ee(G,me,V!="before")),he}function fo(e,t){var n=0;t=gt(e.doc,t),e.options.lineWrapping||(n=Rn(e.display)*t.ch);var r=Ue(e.doc,t.line),i=wr(r)+Bi(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function pa(e,t,n,r,i){var T=_e(e,t,n);return T.xRel=i,r&&(T.outside=r),T}function ga(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,n<0)return pa(r.first,0,null,-1,-1);var i=ir(r,n),T=r.first+r.size-1;if(i>T)return pa(r.first+r.size-1,Ue(r,T).text.length,null,1,1);t<0&&(t=0);for(var _=Ue(r,i);;){var K=Hs(e,_,i,t,n),G=ki(_,K.ch+(K.xRel>0||K.outside>0?1:0));if(!G)return K;var V=G.find(1);if(V.line==i)return V;_=Ue(r,i=V.line)}}function ho(e,t,n,r){r-=ha(t);var i=t.text.length,T=qe(function(_){return _r(e,n,_-1).bottom<=r},i,0);return i=qe(function(_){return _r(e,n,_).top>r},T,i),{begin:T,end:i}}function mo(e,t,n,r){n||(n=Dn(e,t));var i=Ni(e,t,_r(e,n,r),"line").top;return ho(e,t,n,i)}function va(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-=wr(t);var T=Dn(e,t),_=ha(t),K=0,G=t.text.length,V=!0,ee=Je(t,e.doc.direction);if(ee){var ie=(e.options.lineWrapping?zs:Gs)(e,t,n,T,ee,r,i);V=ie.level!=1,K=V?ie.from:ie.to-1,G=V?ie.to:ie.from-1}var me=null,he=null,Se=qe(function(ft){var dt=_r(e,T,ft);return dt.top+=_,dt.bottom+=_,va(dt,r,i,!1)?(dt.top<=i&&dt.left<=r&&(me=ft,he=dt),!0):!1},K,G),Oe,je,ze=!1;if(he){var et=r-he.left<he.right-r,Qe=et==V;Se=me+(Qe?0:1),je=Qe?"after":"before",Oe=et?he.left:he.right}else{!V&&(Se==G||Se==K)&&Se++,je=Se==0?"after":Se==t.text.length?"before":_r(e,T,Se-(V?1:0)).bottom+_<=i==V?"after":"before";var nt=Dr(e,_e(n,Se,je),"line",t,T);Oe=nt.left,ze=i<nt.top?-1:i>=nt.bottom?1:0}return Se=Me(t.text,Se,1),pa(n,Se,je,ze,r-Oe)}function Gs(e,t,n,r,i,T,_){var K=qe(function(ie){var me=i[ie],he=me.level!=1;return va(Dr(e,_e(n,he?me.to:me.from,he?"before":"after"),"line",t,r),T,_,!0)},0,i.length-1),G=i[K];if(K>0){var V=G.level!=1,ee=Dr(e,_e(n,V?G.from:G.to,V?"after":"before"),"line",t,r);va(ee,T,_,!0)&&ee.top>_&&(G=i[K-1])}return G}function zs(e,t,n,r,i,T,_){var K=ho(e,t,r,_),G=K.begin,V=K.end;/\s/.test(t.text.charAt(V-1))&&V--;for(var ee=null,ie=null,me=0;me<i.length;me++){var he=i[me];if(he.from>=V||he.to<=G)continue;var Se=he.level!=1,Oe=_r(e,r,Se?Math.min(V,he.to)-1:Math.max(G,he.from)).right,je=Oe<T?T-Oe+1e9:Oe-T;(!ee||ie>je)&&(ee=he,ie=je)}return ee||(ee=i[i.length-1]),ee.from<G&&(ee={from:G,to:ee.to,level:ee.level}),ee.to>V&&(ee={from:ee.from,to:V,level:ee.level}),ee}var fn;function Ln(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(fn==null){fn=o("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)fn.appendChild(document.createTextNode("x")),fn.appendChild(o("br"));fn.appendChild(document.createTextNode("x"))}s(e.measure,fn);var n=fn.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),c(e.measure),n||1}function Rn(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=o("span","xxxxxxxxxx"),n=o("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 ya(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,T=t.gutters.firstChild,_=0;T;T=T.nextSibling,++_){var K=e.display.gutterSpecs[_].className;n[K]=T.offsetLeft+T.clientLeft+i,r[K]=T.clientWidth}return{fixedPos:Ea(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Ea(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function po(e){var t=Ln(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/Rn(e.display)-3);return function(i){if(Cr(e.doc,i))return 0;var T=0;if(i.widgets)for(var _=0;_<i.widgets.length;_++)i.widgets[_].height&&(T+=i.widgets[_].height);return n?T+(Math.ceil(i.text.length/r)||1)*t:T+t}}function ba(e){var t=e.doc,n=po(e);t.iter(function(r){var i=n(r);i!=r.height&&zt(r,i)})}function hn(e,t,n,r){var i=e.display;if(!n&&ge(t).getAttribute("cm-not-content")=="true")return null;var T,_,K=i.lineSpace.getBoundingClientRect();try{T=t.clientX-K.left,_=t.clientY-K.top}catch(ie){return null}var G=ga(e,T,_),V;if(r&&G.xRel>0&&(V=Ue(e.doc,G.line).text).length==G.ch){var ee=X(V,V.length,e.options.tabSize)-V.length;G=_e(G.line,Math.max(0,Math.round((T-to(e.display).left)/Rn(e.display))-ee))}return G}function mn(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 cr(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)er&&$n(e.doc,t)<i.viewTo&&Yr(e);else if(n<=i.viewFrom)er&&ei(e.doc,n+r)>i.viewFrom?Yr(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)Yr(e);else if(t<=i.viewFrom){var T=Ui(e,n,n+r,1);T?(i.view=i.view.slice(T.index),i.viewFrom=T.lineN,i.viewTo+=r):Yr(e)}else if(n>=i.viewTo){var _=Ui(e,t,t,-1);_?(i.view=i.view.slice(0,_.index),i.viewTo=_.lineN):Yr(e)}else{var K=Ui(e,t,t,-1),G=Ui(e,n,n+r,1);K&&G?(i.view=i.view.slice(0,K.index).concat(tr(e,K.lineN,G.lineN)).concat(i.view.slice(G.index)),i.viewTo+=r):Yr(e)}var V=i.externalMeasured;V&&(n<V.lineN?V.lineN+=r:t<V.lineN+V.size&&(i.externalMeasured=null))}function Xr(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 T=r.view[mn(e,t)];if(T.node==null)return;var _=T.changes||(T.changes=[]);ne(_,n)==-1&&_.push(n)}function Yr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Ui(e,t,n,r){var i=mn(e,t),T,_=e.display.view;if(!er||n==e.doc.first+e.doc.size)return{index:i,lineN:n};for(var K=e.display.viewFrom,G=0;G<i;G++)K+=_[G].size;if(K!=t){if(r>0){if(i==_.length-1)return null;T=K+_[i].size-t,i++}else T=K-t;t+=T,n+=T}for(;$n(e.doc,n)!=n;){if(i==(r<0?0:_.length-1))return null;n+=r*_[i-(r<0?1:0)].size,i+=r}return{index:i,lineN:n}}function Qs(e,t,n){var r=e.display,i=r.view;i.length==0||t>=r.viewTo||n<=r.viewFrom?(r.view=tr(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=tr(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(mn(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(tr(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,mn(e,n)))),r.viewTo=n}function go(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 vo(e,t){t===void 0&&(t=!0);for(var n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),T=r.selection=document.createDocumentFragment(),_=0;_<n.sel.ranges.length;_++){if(!t&&_==n.sel.primIndex)continue;var K=n.sel.ranges[_];if(K.from().line>=e.display.viewTo||K.to().line<e.display.viewFrom)continue;var G=K.empty();(G||e.options.showCursorWhenSelecting)&&yo(e,K.head,i),G||Vs(e,K,T)}return r}function yo(e,t,n){var r=Dr(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=n.appendChild(o("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 T=n.appendChild(o("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));T.style.display="",T.style.left=r.other.left+"px",T.style.top=r.other.top+"px",T.style.height=(r.other.bottom-r.other.top)*.85+"px"}}function Fi(e,t){return e.top-t.top||e.left-t.left}function Vs(e,t,n){var r=e.display,i=e.doc,T=document.createDocumentFragment(),_=to(e.display),K=_.left,G=Math.max(r.sizerWidth,cn(e)-r.sizer.offsetLeft)-_.right,V=i.direction=="ltr";function ee(Qe,nt,ft,dt){nt<0&&(nt=0),nt=Math.round(nt),dt=Math.round(dt),T.appendChild(o("div",null,"CodeMirror-selected","position: absolute; left: "+Qe+`px;
top: `+nt+"px; width: "+(ft==null?G-Qe:ft)+`px;
height: `+(dt-nt)+"px"))}function ie(Qe,nt,ft){var dt=Ue(i,Qe),Tt=dt.text.length,Ut,qt;function Wt(Vt,mr){return ma(e,_e(Qe,Vt),"div",dt,mr)}function vr(Vt,mr,rr){var Yt=mo(e,dt,null,Vt),Xt=mr=="ltr"==(rr=="after")?"left":"right",Kt=rr=="after"?Yt.begin:Yt.end-(/\s/.test(dt.text.charAt(Yt.end-1))?2:1);return Wt(Kt,Xt)[Xt]}var hr=Je(dt,i.direction);return tt(hr,nt||0,ft==null?Tt:ft,function(Vt,mr,rr,Yt){var Xt=rr=="ltr",Kt=Wt(Vt,Xt?"left":"right"),pr=Wt(mr-1,Xt?"right":"left"),Kn=nt==null&&Vt==0,tn=ft==null&&mr==Tt,sr=Yt==0,Br=!hr||Yt==hr.length-1;if(pr.top-Kt.top<=3){var $t=(V?Kn:tn)&&sr,za=(V?tn:Kn)&&Br,Wr=$t?K:(Xt?Kt:pr).left,En=za?G:(Xt?pr:Kt).right;ee(Wr,Kt.top,En-Wr,Kt.bottom)}else{var bn,dr,Hn,Qa;Xt?(bn=V&&Kn&&sr?K:Kt.left,dr=V?G:vr(Vt,rr,"before"),Hn=V?K:vr(mr,rr,"after"),Qa=V&&tn&&Br?G:pr.right):(bn=V?vr(Vt,rr,"before"):K,dr=!V&&Kn&&sr?G:Kt.right,Hn=!V&&tn&&Br?K:pr.left,Qa=V?vr(mr,rr,"after"):G),ee(bn,Kt.top,dr-bn,Kt.bottom),Kt.bottom<pr.top&&ee(K,Kt.bottom,null,pr.top),ee(Hn,pr.top,Qa-Hn,pr.bottom)}(!Ut||Fi(Kt,Ut)<0)&&(Ut=Kt),Fi(pr,Ut)<0&&(Ut=pr),(!qt||Fi(Kt,qt)<0)&&(qt=Kt),Fi(pr,qt)<0&&(qt=pr)}),{start:Ut,end:qt}}var me=t.from(),he=t.to();if(me.line==he.line)ie(me.line,me.ch,he.ch);else{var Se=Ue(i,me.line),Oe=Ue(i,he.line),je=ar(Se)==ar(Oe),ze=ie(me.line,me.ch,je?Se.text.length+1:null).end,et=ie(he.line,je?0:null,he.ch).start;je&&(ze.top<et.top-2?(ee(ze.right,ze.top,null,ze.bottom),ee(K,et.top,et.left,et.bottom)):ee(ze.right,ze.top,et.left-ze.right,ze.bottom)),ze.bottom<et.top&&ee(K,ze.bottom,null,et.top)}n.appendChild(T)}function xa(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()||In(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function Eo(e){e.state.focused||(e.display.input.focus(),Aa(e))}function bo(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,In(e))},100)}function Aa(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(ve(e,"focus",e,t),e.state.focused=!0,B(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),O&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),xa(e)}function In(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(ve(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],T=e.options.lineWrapping,_=void 0,K=0;if(i.hidden)continue;if(N&&k<8){var G=i.node.offsetTop+i.node.offsetHeight;_=G-n,n=G}else{var V=i.node.getBoundingClientRect();_=V.bottom-V.top,!T&&i.text.firstChild&&(K=i.text.firstChild.getBoundingClientRect().right-V.left-1)}var ee=i.line.height-_;if((ee>.005||ee<-.005)&&(zt(i.line,_),xo(i.line),i.rest))for(var ie=0;ie<i.rest.length;ie++)xo(i.rest[ie]);if(K>e.display.sizerWidth){var me=Math.ceil(K/Rn(e.display));me>e.display.maxLineLength&&(e.display.maxLineLength=me,e.display.maxLine=i.line,e.display.maxLineChanged=!0)}}}function xo(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,T=ir(t,r),_=ir(t,i);if(n&&n.ensure){var K=n.ensure.from.line,G=n.ensure.to.line;K<T?(T=K,_=ir(t,wr(Ue(t,K))+e.wrapper.clientHeight)):Math.min(G,t.lastLine())>=_&&(T=ir(t,wr(Ue(t,G))-e.wrapper.clientHeight),_=G)}return{from:T,to:Math.max(_,T+1)}}function Xs(e,t){if(Ie(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&&!E){var T=o("div","\u200B",null,`position: absolute;
top: `+(t.top-n.viewOffset-Bi(e.display))+`px;
height: `+(t.bottom-t.top+kr(e)+n.barHeight)+`px;
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(T),T.scrollIntoView(i),e.display.lineSpace.removeChild(T)}}function Ys(e,t,n,r){r==null&&(r=0);var i;!e.options.lineWrapping&&t==n&&(t=t.ch?_e(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,n=t.sticky=="before"?_e(t.line,t.ch+1,"before"):t);for(var T=0;T<5;T++){var _=!1,K=Dr(e,t),G=!n||n==t?K:Dr(e,n);i={left:Math.min(K.left,G.left),top:Math.min(K.top,G.top)-r,right:Math.max(K.left,G.left),bottom:Math.max(K.bottom,G.bottom)+r};var V=Ta(e,i),ee=e.doc.scrollTop,ie=e.doc.scrollLeft;if(V.scrollTop!=null&&(si(e,V.scrollTop),Math.abs(e.doc.scrollTop-ee)>1&&(_=!0)),V.scrollLeft!=null&&(pn(e,V.scrollLeft),Math.abs(e.doc.scrollLeft-ie)>1&&(_=!0)),!_)break}return i}function Js(e,t){var n=Ta(e,t);n.scrollTop!=null&&si(e,n.scrollTop),n.scrollLeft!=null&&pn(e,n.scrollLeft)}function Ta(e,t){var n=e.display,r=Ln(e.display);t.top<0&&(t.top=0);var i=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:n.scroller.scrollTop,T=ca(e),_={};t.bottom-t.top>T&&(t.bottom=t.top+T);var K=e.doc.height+da(n),G=t.top<r,V=t.bottom>K-r;if(t.top<i)_.scrollTop=G?0:t.top;else if(t.bottom>i+T){var ee=Math.min(t.top,(V?K:t.bottom)-T);ee!=i&&(_.scrollTop=ee)}var ie=e.options.fixedGutter?0:n.gutters.offsetWidth,me=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:n.scroller.scrollLeft-ie,he=cn(e)-n.gutters.offsetWidth,Se=t.right-t.left>he;return Se&&(t.right=t.left+he),t.left<10?_.scrollLeft=0:t.left<me?_.scrollLeft=Math.max(0,t.left+ie-(Se?0:10)):t.right>he+me-3&&(_.scrollLeft=t.right+(Se?0:10)-he),_}function Sa(e,t){if(t==null)return;Ki(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function On(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=fo(e,t.from),r=fo(e,t.to);Ao(e,n,r,t.margin)}}function Ao(e,t,n,r){var i=Ta(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;w||wa(e,{top:t}),To(e,t,!0),w&&wa(e),di(e,100)}function To(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 pn(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,Lo(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+da(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+kr(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var gn=function(e,t,n){this.cm=n;var r=this.vert=o("div",[o("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=o("div",[o("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,N&&k<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};gn.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 T=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+T)+"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}},gn.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},gn.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},gn.prototype.zeroWidthHack=function(){var e=l&&!S?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new $,this.disableVert=new $},gn.prototype.enableZeroWidthBar=function(e,t,n){e.style.pointerEvents="auto";function r(){var i=e.getBoundingClientRect(),T=n=="vert"?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1);T!=e?e.style.pointerEvents="none":t.set(1e3,r)}t.set(1e3,r)},gn.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 Mn(e,t){t||(t=li(e));var n=e.display.barWidth,r=e.display.barHeight;So(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),So(e,li(e)),n=e.display.barWidth,r=e.display.barHeight}function So(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 Co={native:gn,null:ui};function wo(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&f(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Co[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"?pn(e,t):si(e,t)},e),e.display.scrollbars.addClass&&B(e.display.wrapper,e.display.scrollbars.addClass)}var qs=0;function vn(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},Ur(e.curOp)}function yn(e){var t=e.curOp;t&&Sr(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 T=0;T<t.length;T++)nl(t[T]);for(var _=0;_<t.length;_++)il(t[_])}function el(e){var t=e.cm,n=t.display;ol(t),e.updateMaxLine&&ti(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&&Ca(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=no(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+kr(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-cn(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&&pn(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==I();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Mn(t,e.barMeasure),e.updatedDisplay&&La(t,e.barMeasure),e.selectionChanged&&xa(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&Eo(e.cm)}function il(e){var t=e.cm,n=t.display,r=t.doc;if(e.updatedDisplay&&Do(t,e.update),n.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(n.wheelStartX=n.wheelStartY=null),e.scrollTop!=null&&To(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&pn(t,e.scrollLeft,!0,!0),e.scrollToPos){var i=Ys(t,gt(r,e.scrollToPos.from),gt(r,e.scrollToPos.to),e.scrollToPos.margin);Xs(t,i)}var T=e.maybeHiddenMarkers,_=e.maybeUnhiddenMarkers;if(T)for(var K=0;K<T.length;++K)T[K].lines.length||ve(T[K],"hide");if(_)for(var G=0;G<_.length;++G)_[G].lines.length&&ve(_[G],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&ve(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function gr(e,t){if(e.curOp)return t();vn(e);try{return t()}finally{yn(e)}}function Jt(e,t){return function(){if(e.curOp)return t.apply(e,arguments);vn(e);try{return t.apply(e,arguments)}finally{yn(e)}}}function ur(e){return function(){if(this.curOp)return e.apply(this,arguments);vn(this);try{return e.apply(this,arguments)}finally{yn(this)}}}function Zt(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);vn(t);try{return e.apply(this,arguments)}finally{yn(t)}}}function di(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,j(al,e))}function al(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var n=+new Date+e.options.workTime,r=an(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(T){if(r.line>=e.display.viewFrom){var _=T.styles,K=T.text.length>e.options.maxHighlightLength?xr(t.mode,r.state):null,G=zn(e,T,r,!0);K&&(r.state=K),T.styles=G.styles;var V=T.styleClasses,ee=G.classes;ee?T.styleClasses=ee:V&&(T.styleClasses=null);for(var ie=!_||_.length!=T.styles.length||V!=ee&&(!V||!ee||V.bgClass!=ee.bgClass||V.textClass!=ee.textClass),me=0;!ie&&me<_.length;++me)ie=_[me]!=T.styles[me];ie&&i.push(r.line),T.stateAfter=r.save(),r.nextLine()}else T.text.length<=e.options.maxHighlightLength&&Qn(e,T.text,r),T.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&&gr(e,function(){for(var T=0;T<i.length;T++)Xr(e,i[T],"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=cn(e),this.force=n,this.dims=ya(e),this.events=[]};Hi.prototype.signal=function(e,t){ae(e,t)&&this.events.push(arguments)},Hi.prototype.finish=function(){for(var e=0;e<this.events.length;e++)ve.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=kr(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=kr(e)+"px",t.scrollbarsClipped=!0)}function sl(e){if(e.hasFocus())return null;var t=I();if(!t||!p(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&p(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==I())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&p(document.body,e.anchorNode)&&p(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 Ca(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return Yr(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&&go(e)==0)return!1;Ro(e)&&(Yr(e),t.dims=ya(e));var i=r.first+r.size,T=Math.max(t.visible.from-e.options.viewportMargin,r.first),_=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFrom<T&&T-n.viewFrom<20&&(T=Math.max(r.first,n.viewFrom)),n.viewTo>_&&n.viewTo-_<20&&(_=Math.min(i,n.viewTo)),er&&(T=$n(e.doc,T),_=ei(e.doc,_));var K=T!=n.viewFrom||_!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;Qs(e,T,_),n.viewOffset=wr(Ue(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var G=go(e);if(!K&&G==0&&!t.force&&n.renderedView==n.view&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo))return!1;var V=sl(e);return G>4&&(n.lineDiv.style.display="none"),ul(e,n.updateLineNumbers,t.dims),G>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,ll(V),c(n.cursorDiv),c(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,K&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,di(e,400)),n.updateLineNumbers=null,!0}function Do(e,t){for(var n=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==cn(e)){if(n&&n.top!=null&&(n={top:Math.min(e.doc.height+da(e.display)-ca(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(!Ca(e,t))break;ji(e);var i=li(e);ai(e),Mn(e,i),La(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 wa(e,t){var n=new Hi(e,t);if(Ca(e,n)){ji(e),Do(e,n);var r=li(e);ai(e),Mn(e,r),La(e,r),n.finish()}}function ul(e,t,n){var r=e.display,i=e.options.lineNumbers,T=r.lineDiv,_=T.firstChild;function K(Se){var Oe=Se.nextSibling;return O&&l&&e.display.currentWheelTarget==Se?Se.style.display="none":Se.parentNode.removeChild(Se),Oe}for(var G=r.view,V=r.viewFrom,ee=0;ee<G.length;ee++){var ie=G[ee];if(!ie.hidden)if(!ie.node||ie.node.parentNode!=T){var me=Bs(e,ie,V,n);T.insertBefore(me,_)}else{for(;_!=ie.node;)_=K(_);var he=i&&t!=null&&t<=V&&ie.lineNumber;ie.changes&&(ne(ie.changes,"gutter")>-1&&(he=!1),Ja(e,ie,V,n)),he&&(c(ie.lineNumber),ie.lineNumber.appendChild(document.createTextNode(Or(e.options,V)))),_=ie.node.nextSibling}V+=ie.size}for(;_;)_=K(_)}function Da(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function La(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+kr(e)+"px"}function Lo(e){var t=e.display,n=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var r=Ea(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,T=r+"px",_=0;_<n.length;_++)if(!n[_].hidden){e.options.fixedGutter&&(n[_].gutter&&(n[_].gutter.style.left=T),n[_].gutterBackground&&(n[_].gutterBackground.style.left=T));var K=n[_].alignable;if(K)for(var G=0;G<K.length;G++)K[G].style.left=T}e.options.fixedGutter&&(t.gutters.style.left=r+i+"px")}function Ro(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=Or(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(o("div",[o("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),T=i.firstChild.offsetWidth,_=i.offsetWidth-T;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(T,r.lineGutter.offsetWidth-_)+1,r.lineNumWidth=r.lineNumInnerWidth+_,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",Da(e.display),!0}return!1}function Ra(e,t){for(var n=[],r=!1,i=0;i<e.length;i++){var T=e[i],_=null;if(typeof T!="string"&&(_=T.style,T=T.className),T=="CodeMirror-linenumbers")if(t)r=!0;else continue;n.push({className:T,style:_})}return t&&!r&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function Io(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],T=i.className,_=i.style,K=t.appendChild(o("div",null,"CodeMirror-gutter "+T));_&&(K.style.cssText=_),T=="CodeMirror-linenumbers"&&(e.lineGutter=K,K.style.width=(e.lineNumWidth||1)+"px")}t.style.display=n.length?"":"none",Da(e)}function ci(e){Io(e.display),cr(e),Lo(e)}function dl(e,t,n,r){var i=this;this.input=n,i.scrollbarFiller=o("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=o("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=x("div",null,"CodeMirror-code"),i.selectionDiv=o("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=o("div",null,"CodeMirror-cursors"),i.measure=o("div",null,"CodeMirror-measure"),i.lineMeasure=o("div",null,"CodeMirror-measure"),i.lineSpace=x("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none");var T=x("div",[i.lineSpace],"CodeMirror-lines");i.mover=o("div",[T],null,"position: relative"),i.sizer=o("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=o("div",null,null,"position: absolute; height: "+ue+"px; width: 1px;"),i.gutters=o("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=o("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=o("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),N&&k<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),!O&&!(w&&a)&&(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=Ra(r.gutters,r.lineNumbers),Io(i),n.init(i)}var Gi=0,Er=null;N?Er=-.53:w?Er=15:h?Er=-.7:L&&(Er=-1/3);function Oo(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=Oo(e);return t.x*=Er,t.y*=Er,t}function Mo(e,t){var n=Oo(t),r=n.x,i=n.y,T=e.display,_=T.scroller,K=_.scrollWidth>_.clientWidth,G=_.scrollHeight>_.clientHeight;if(!(r&&K||i&&G))return;if(i&&l&&O){e:for(var V=t.target,ee=T.view;V!=_;V=V.parentNode)for(var ie=0;ie<ee.length;ie++)if(ee[ie].node==V){e.display.currentWheelTarget=V;break e}}if(r&&!w&&!v&&Er!=null){i&&G&&si(e,Math.max(0,_.scrollTop+i*Er)),pn(e,Math.max(0,_.scrollLeft+r*Er)),(!i||i&&G)&&Y(t),T.wheelStartX=null;return}if(i&&Er!=null){var me=i*Er,he=e.doc.scrollTop,Se=he+T.wrapper.clientHeight;me<0?he=Math.max(0,he+me-50):Se=Math.min(e.doc.height,Se+me+50),wa(e,{top:he,bottom:Se})}Gi<20&&(T.wheelStartX==null?(T.wheelStartX=_.scrollLeft,T.wheelStartY=_.scrollTop,T.wheelDX=r,T.wheelDY=i,setTimeout(function(){if(T.wheelStartX==null)return;var Oe=_.scrollLeft-T.wheelStartX,je=_.scrollTop-T.wheelStartY,ze=je&&T.wheelDY&&je/T.wheelDY||Oe&&T.wheelDX&&Oe/T.wheelDX;if(T.wheelStartX=T.wheelStartY=null,!ze)return;Er=(Er*Gi+ze)/(Gi+1),++Gi},200)):(T.wheelDX+=r,T.wheelDY+=i))}var br=function(e,t){this.ranges=e,this.primIndex=t};br.prototype.primary=function(){return this.ranges[this.primIndex]},br.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(!rn(n.anchor,r.anchor)||!rn(n.head,r.head))return!1}return!0},br.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Mt(xn(this.ranges[t].anchor),xn(this.ranges[t].head));return new br(e,this.primIndex)},br.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},br.prototype.contains=function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(pt(t,r.from())>=0&&pt(e,r.to())<=0)return n}return-1};var Mt=function(e,t){this.anchor=e,this.head=t};Mt.prototype.from=function(){return nn(this.anchor,this.head)},Mt.prototype.to=function(){return An(this.anchor,this.head)},Mt.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Lr(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort(function(me,he){return pt(me.from(),he.from())}),n=ne(t,i);for(var T=1;T<t.length;T++){var _=t[T],K=t[T-1],G=pt(K.to(),_.from());if(r&&!_.empty()?G>0:G>=0){var V=nn(K.from(),_.from()),ee=An(K.to(),_.to()),ie=K.empty()?_.from()==_.head:K.from()==K.head;T<=n&&--n,t.splice(--T,2,new Mt(ie?ee:V,ie?V:ee))}}return new br(t,n)}function Jr(e,t){return new br([new Mt(e,t||e)],0)}function Zr(e){return e.text?_e(e.from.line+e.text.length-1,Ee(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Po(e,t){if(pt(e,t.from)<0)return e;if(pt(e,t.to)<=0)return Zr(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+=Zr(t).ch-t.to.ch),_e(n,r)}function Ia(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new Mt(Po(i.anchor,t),Po(i.head,t)))}return Lr(e.cm,n,e.sel.primIndex)}function ko(e,t,n){return e.line==t.line?_e(n.line,e.ch-t.ch+n.ch):_e(n.line+(e.line-t.line),e.ch)}function fl(e,t,n){for(var r=[],i=_e(e.first,0),T=i,_=0;_<t.length;_++){var K=t[_],G=ko(K.from,i,T),V=ko(Zr(K),i,T);if(i=K.to,T=V,n=="around"){var ee=e.sel.ranges[_],ie=pt(ee.head,ee.anchor)<0;r[_]=new Mt(ie?V:G,ie?G:V)}else r[_]=new Mt(G,G)}return new br(r,e.sel.primIndex)}function Oa(e){e.doc.mode=Ht(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&&cr(e)}function _o(e,t){return t.from.ch==0&&t.to.ch==0&&Ee(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Ma(e,t,n,r){function i(et){return n?n[et]:null}function T(et,Qe,nt){la(et,Qe,nt,r),Nt(et,"change",et,t)}function _(et,Qe){for(var nt=[],ft=et;ft<Qe;++ft)nt.push(new Vr(V[ft],i(ft),r));return nt}var K=t.from,G=t.to,V=t.text,ee=Ue(e,K.line),ie=Ue(e,G.line),me=Ee(V),he=i(V.length-1),Se=G.line-K.line;if(t.full)e.insert(0,_(0,V.length)),e.remove(V.length,e.size-V.length);else if(_o(e,t)){var Oe=_(0,V.length-1);T(ie,ie.text,he),Se&&e.remove(K.line,Se),Oe.length&&e.insert(K.line,Oe)}else if(ee==ie)if(V.length==1)T(ee,ee.text.slice(0,K.ch)+me+ee.text.slice(G.ch),he);else{var je=_(1,V.length-1);je.push(new Vr(me+ee.text.slice(G.ch),he,r)),T(ee,ee.text.slice(0,K.ch)+V[0],i(0)),e.insert(K.line+1,je)}else if(V.length==1)T(ee,ee.text.slice(0,K.ch)+V[0]+ie.text.slice(G.ch),i(0)),e.remove(K.line+1,Se);else{T(ee,ee.text.slice(0,K.ch)+V[0],i(0)),T(ie,me+ie.text.slice(G.ch),he);var ze=_(1,V.length-1);Se>1&&e.remove(K.line+1,Se-1),e.insert(K.line+1,ze)}Nt(e,"change",e,t)}function qr(e,t,n){function r(i,T,_){if(i.linked)for(var K=0;K<i.linked.length;++K){var G=i.linked[K];if(G.doc==T)continue;var V=_&&G.sharedHist;if(n&&!V)continue;t(G.doc,V),r(G.doc,i,V)}}r(e,null,!0)}function Bo(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,ba(e),Oa(e),No(e),e.options.lineWrapping||ti(e),e.options.mode=t.modeOption,cr(e)}function No(e){(e.doc.direction=="rtl"?B:f)(e.display.lineDiv,"CodeMirror-rtl")}function hl(e){gr(e,function(){No(e),cr(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 Pa(e,t){var n={from:xn(t.from),to:Zr(t),text:_t(e,t.from,t.to)};return jo(e,n,t.from.line,t.to.line+1),qr(e,function(r){return jo(r,n,t.from.line,t.to.line+1)},!0),n}function Uo(e){for(;e.length;){var t=Ee(e);if(t.ranges)e.pop();else break}}function ml(e,t){if(t)return Uo(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 Fo(e,t,n,r){var i=e.history;i.undone.length=0;var T=+new Date,_,K;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&i.lastModTime>T-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(_=ml(i,i.lastOp==r)))K=Ee(_.changes),pt(t.from,t.to)==0&&pt(t.from,K.to)==0?K.to=Zr(t):_.changes.push(Pa(e,t));else{var G=Ee(i.done);for((!G||!G.ranges)&&Qi(e.sel,i.done),_={changes:[Pa(e,t)],generation:i.generation},i.done.push(_);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=T,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,K||ve(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,T=r&&r.origin;n==i.lastSelOp||T&&i.lastSelOrigin==T&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==T||pl(e,T,Ee(i.done),t))?i.done[i.done.length-1]=t:Qi(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=T,i.lastSelOp=n,r&&r.clearRedo!==!1&&Uo(i.undone)}function Qi(e,t){var n=Ee(t);n&&n.ranges&&n.equals(e)||t.push(e)}function jo(e,t,n,r){var i=t["spans_"+e.id],T=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(_){_.markedSpans&&((i||(i=t["spans_"+e.id]={}))[T]=_.markedSpans),++T})}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 Wo(e,t){var n=yl(e,t),r=ln(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var T=n[i],_=r[i];if(T&&_){e:for(var K=0;K<_.length;++K){for(var G=_[K],V=0;V<T.length;++V)if(T[V].marker==G.marker)continue e;T.push(G)}}else _&&(n[i]=_)}return n}function Pn(e,t,n){for(var r=[],i=0;i<e.length;++i){var T=e[i];if(T.ranges){r.push(n?br.prototype.deepCopy.call(T):T);continue}var _=T.changes,K=[];r.push({changes:K});for(var G=0;G<_.length;++G){var V=_[G],ee=void 0;if(K.push({from:V.from,to:V.to,text:V.text}),t)for(var ie in V)(ee=ie.match(/^spans_(\d+)$/))&&(ne(t,Number(ee[1]))>-1&&(Ee(K)[ie]=V[ie],delete V[ie]))}}return r}function ka(e,t,n,r){if(r){var i=e.anchor;if(n){var T=pt(t,i)<0;T!=pt(n,i)<0?(i=t,t=n):T!=pt(t,n)<0&&(t=n)}return new Mt(i,t)}else return new Mt(n||t,t)}function Vi(e,t,n,r,i){i==null&&(i=e.cm&&(e.cm.display.shift||e.extend)),or(e,new br([ka(e.sel.primary(),t,n,i)],0),r)}function Ko(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),T=0;T<e.sel.ranges.length;T++)r[T]=ka(e.sel.ranges[T],t[T],null,i);var _=Lr(e.cm,r,e.sel.primIndex);or(e,_,n)}function _a(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,or(e,Lr(e.cm,i,e.sel.primIndex),r)}function Ho(e,t,n,r){or(e,Jr(t,n),r)}function El(e,t,n){var r={ranges:t.ranges,update:function(i){this.ranges=[];for(var T=0;T<i.length;T++)this.ranges[T]=new Mt(gt(e,i[T].anchor),gt(e,i[T].head))},origin:n&&n.origin};return ve(e,"beforeSelectionChange",e,r),e.cm&&ve(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?Lr(e.cm,r.ranges,r.ranges.length-1):t}function Go(e,t,n){var r=e.history.done,i=Ee(r);i&&i.ranges?(r[r.length-1]=t,Xi(e,t,n)):or(e,t,n)}function or(e,t,n){Xi(e,t,n),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function Xi(e,t,n){(ae(e,"beforeSelectionChange")||e.cm&&ae(e.cm,"beforeSelectionChange"))&&(t=El(e,t,n));var r=n&&n.bias||(pt(t.primary().head,e.sel.primary().head)<0?-1:1);zo(e,Vo(e,t,r,!0)),!(n&&n.scroll===!1)&&e.cm&&On(e.cm)}function zo(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)),Nt(e,"cursorActivity",e)}function Qo(e){zo(e,Vo(e,e.sel,null,!1))}function Vo(e,t,n,r){for(var i,T=0;T<t.ranges.length;T++){var _=t.ranges[T],K=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[T],G=Yi(e,_.anchor,K&&K.anchor,n,r),V=Yi(e,_.head,K&&K.head,n,r);(i||G!=_.anchor||V!=_.head)&&(i||(i=t.ranges.slice(0,T)),i[T]=new Mt(G,V))}return i?Lr(e.cm,i,t.primIndex):t}function kn(e,t,n,r,i){var T=Ue(e,t.line);if(T.markedSpans)for(var _=0;_<T.markedSpans.length;++_){var K=T.markedSpans[_],G=K.marker,V="selectLeft"in G?!G.selectLeft:G.inclusiveLeft,ee="selectRight"in G?!G.selectRight:G.inclusiveRight;if((K.from==null||(V?K.from<=t.ch:K.from<t.ch))&&(K.to==null||(ee?K.to>=t.ch:K.to>t.ch))){if(i&&(ve(G,"beforeCursorEnter"),G.explicitlyCleared))if(T.markedSpans){--_;continue}else break;if(!G.atomic)continue;if(n){var ie=G.find(r<0?1:-1),me=void 0;if((r<0?ee:V)&&(ie=Xo(e,ie,-r,ie&&ie.line==t.line?T:null)),ie&&ie.line==t.line&&(me=pt(ie,n))&&(r<0?me<0:me>0))return kn(e,ie,t,r,i)}var he=G.find(r<0?-1:1);return(r<0?V:ee)&&(he=Xo(e,he,r,he.line==t.line?T:null)),he?kn(e,he,t,r,i):null}}return t}function Yi(e,t,n,r,i){var T=r||1,_=kn(e,t,n,T,i)||!i&&kn(e,t,n,T,!0)||kn(e,t,n,-T,i)||!i&&kn(e,t,n,-T,!0);return _||(e.cantEdit=!0,_e(e.first,0))}function Xo(e,t,n,r){return n<0&&t.ch==0?t.line>e.first?gt(e,_e(t.line-1)):null:n>0&&t.ch==(r||Ue(e,t.line)).text.length?t.line<e.first+e.size-1?_e(t.line+1,0):null:new _e(t.line,t.ch+n)}function Yo(e){e.setSelection(_e(e.firstLine(),0),_e(e.lastLine()),pe)}function Jo(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,T,_,K){i&&(r.from=gt(e,i)),T&&(r.to=gt(e,T)),_&&(r.text=_),K!==void 0&&(r.origin=K)}),ve(e,"beforeChange",e,r),e.cm&&ve(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 _n(e,t,n){if(e.cm){if(!e.cm.curOp)return Jt(e.cm,_n)(e,t,n);if(e.cm.state.suppressEdits)return}if((ae(e,"beforeChange")||e.cm&&ae(e.cm,"beforeChange"))&&(t=Jo(e,t,!0),!t))return;var r=Yn&&!n&&Mi(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)Zo(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else Zo(e,t)}function Zo(e,t){if(t.text.length==1&&t.text[0]==""&&pt(t.from,t.to)==0)return;var n=Ia(e,t);Fo(e,t,n,e.cm?e.cm.curOp.id:NaN),hi(e,t,n,ln(e,t));var r=[];qr(e,function(i,T){!T&&ne(r,i.history)==-1&&(ts(i.history,t),r.push(i.history)),hi(i,t,null,ln(i,t))})}function Ji(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(r&&!n)return;for(var i=e.history,T,_=e.sel,K=t=="undo"?i.done:i.undone,G=t=="undo"?i.undone:i.done,V=0;V<K.length&&!(T=K[V],n?T.ranges&&!T.equals(e.sel):!T.ranges);V++);if(V==K.length)return;for(i.lastOrigin=i.lastSelOrigin=null;;)if(T=K.pop(),T.ranges){if(Qi(T,G),n&&!T.equals(e.sel)){or(e,T,{clearRedo:!1});return}_=T}else if(r){K.push(T);return}else break;var ee=[];Qi(_,G),G.push({changes:ee,generation:i.generation}),i.generation=T.generation||++i.maxGeneration;for(var ie=ae(e,"beforeChange")||e.cm&&ae(e.cm,"beforeChange"),me=function(Oe){var je=T.changes[Oe];if(je.origin=t,ie&&!Jo(e,je,!1))return K.length=0,{};ee.push(Pa(e,je));var ze=Oe?Ia(e,je):Ee(K);hi(e,je,ze,Wo(e,je)),!Oe&&e.cm&&e.cm.scrollIntoView({from:je.from,to:Zr(je)});var et=[];qr(e,function(Qe,nt){!nt&&ne(et,Qe.history)==-1&&(ts(Qe.history,je),et.push(Qe.history)),hi(Qe,je,null,Wo(Qe,je))})},he=T.changes.length-1;he>=0;--he){var Se=me(he);if(Se)return Se.v}}function qo(e,t){if(t==0)return;if(e.first+=t,e.sel=new br(ke(e.sel.ranges,function(i){return new Mt(_e(i.anchor.line+t,i.anchor.ch),_e(i.head.line+t,i.head.ch))}),e.sel.primIndex),e.cm){cr(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)Xr(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){qo(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);qo(e,i),t={from:_e(e.first,0),to:_e(t.to.line+i,t.to.ch),text:[Ee(t.text)],origin:t.origin}}var T=e.lastLine();t.to.line>T&&(t={from:t.from,to:_e(T,Ue(e,T).text.length),text:[t.text[0]],origin:t.origin}),t.removed=_t(e,t.from,t.to),n||(n=Ia(e,t)),e.cm?bl(e.cm,t,r):Ma(e,t,r),Xi(e,n,pe),e.cantEdit&&Yi(e,_e(e.firstLine(),0))&&(e.cantEdit=!1)}function bl(e,t,n){var r=e.doc,i=e.display,T=t.from,_=t.to,K=!1,G=T.line;e.options.lineWrapping||(G=wt(ar(Ue(r,T.line))),r.iter(G,_.line+1,function(he){if(he==i.maxLine)return K=!0,!0})),r.sel.contains(t.from,t.to)>-1&&le(e),Ma(r,t,n,po(e)),e.options.lineWrapping||(r.iter(G,T.line+t.text.length,function(he){var Se=Pr(he);Se>i.maxLineLength&&(i.maxLine=he,i.maxLineLength=Se,i.maxLineChanged=!0,K=!1)}),K&&(e.curOp.updateMaxLine=!0)),aa(r,T.line),di(e,400);var V=t.text.length-(_.line-T.line)-1;t.full?cr(e):T.line==_.line&&t.text.length==1&&!_o(e.doc,t)?Xr(e,T.line,"text"):cr(e,T.line,_.line+1,V);var ee=ae(e,"changes"),ie=ae(e,"change");if(ie||ee){var me={from:T,to:_,text:t.text,removed:t.removed,origin:t.origin};ie&&Nt(e,"change",e,me),ee&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(me)}e.display.selForContextMenu=null}function Bn(e,t,n,r,i){var T;r||(r=n),pt(r,n)<0&&(T=[r,n],n=T[0],r=T[1]),typeof t=="string"&&(t=e.splitLines(t)),_n(e,{from:n,to:r,text:t,origin:i})}function $o(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function es(e,t,n,r){for(var i=0;i<e.length;++i){var T=e[i],_=!0;if(T.ranges){T.copied||(T=e[i]=T.deepCopy(),T.copied=!0);for(var K=0;K<T.ranges.length;K++)$o(T.ranges[K].anchor,t,n,r),$o(T.ranges[K].head,t,n,r);continue}for(var G=0;G<T.changes.length;++G){var V=T.changes[G];if(n<V.from.line)V.from=_e(V.from.line+r,V.from.ch),V.to=_e(V.to.line+r,V.to.ch);else if(t<=V.to.line){_=!1;break}}_||(e.splice(0,i+1),i=0)}}function ts(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;es(e.done,n,r,i),es(e.undone,n,r,i)}function mi(e,t,n,r){var i=t,T=t;return typeof t=="number"?T=Ue(e,wi(e,t)):i=wt(t),i==null?null:(r(T,i)&&e.cm&&Xr(e.cm,i,n),T)}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,Va(i),Nt(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 T=Math.min(t,i-e),_=r.height;if(r.removeInner(e,T),this.height-=_-r.height,i==T&&(this.children.splice(n--,1),r.parent=null),(t-=T)==0)break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof pi))){var K=[];this.collapse(K),this.children=[new pi(K)],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],T=i.chunkSize();if(e<=T){if(i.insertInner(e,t,n),i.lines&&i.lines.length>50){for(var _=i.lines.length%25+25,K=_;K<i.lines.length;){var G=new pi(i.lines.slice(K,K+=25));i.height-=G.height,this.children.splice(++r,0,G),G.parent=this}i.lines=i.lines.slice(0,_),this.maybeSpill()}break}e-=T}},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=ne(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],T=i.chunkSize();if(e<T){var _=Math.min(t,T-e);if(i.iterN(e,_,n))return!0;if((t-=_)==0)break;e=0}else e-=T}}};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=wt(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 T=ni(this);zt(n,Math.max(0,n.height-T)),e&&(gr(e,function(){rs(e,n,-T),Xr(e,r,"widget")}),Nt(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;Cr(this.doc,r)||zt(r,r.height+i),n&&gr(n,function(){n.curOp.forceUpdate=!0,rs(n,r,i),Nt(n,"lineWidgetChanged",n,e,wt(r))})},oe(vi);function rs(e,t,n){wr(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Sa(e,n)}function xl(e,t,n,r){var i=new vi(e,n,r),T=e.cm;return T&&i.noHScroll&&(T.display.alignWidgets=!0),mi(e,t,"widget",function(_){var K=_.widgets||(_.widgets=[]);if(i.insertAt==null?K.push(i):K.splice(Math.min(K.length-1,Math.max(0,i.insertAt)),0,i),i.line=_,T&&!Cr(e,_)){var G=wr(_)<e.scrollTop;zt(_,_.height+ni(i)),G&&Sa(T,i.height),T.curOp.forceUpdate=!0}return!0}),T&&Nt(T,"lineWidgetAdded",T,i,typeof t=="number"?t:wt(t)),i}var ns=0,$r=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++ns};$r.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&vn(e),ae(this,"clear")){var n=this.find();n&&Nt(this,"clear",n.from,n.to)}for(var r=null,i=null,T=0;T<this.lines.length;++T){var _=this.lines[T],K=Tr(_.markedSpans,this);e&&!this.collapsed?Xr(e,wt(_),"text"):e&&(K.to!=null&&(i=wt(_)),K.from!=null&&(r=wt(_))),_.markedSpans=zr(_.markedSpans,K),K.from==null&&this.collapsed&&!Cr(this.doc,_)&&e&&zt(_,Ln(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var G=0;G<this.lines.length;++G){var V=ar(this.lines[G]),ee=Pr(V);ee>e.display.maxLineLength&&(e.display.maxLine=V,e.display.maxLineLength=ee,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&cr(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Qo(e.doc)),e&&Nt(e,"markerCleared",e,this,r,i),t&&yn(e),this.parent&&this.parent.clear()},$r.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var n,r,i=0;i<this.lines.length;++i){var T=this.lines[i],_=Tr(T.markedSpans,this);if(_.from!=null&&(n=_e(t?T:wt(T),_.from),e==-1))return n;if(_.to!=null&&(r=_e(t?T:wt(T),_.to),e==1))return r}return n&&{from:n,to:r}},$r.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;if(!t||!r)return;gr(r,function(){var i=t.line,T=wt(t.line),_=fa(r,T);if(_&&(oo(_),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!Cr(n.doc,i)&&n.height!=null){var K=n.height;n.height=null;var G=ni(n)-K;G&&zt(i,i.height+G)}Nt(r,"markerChanged",r,e)})},$r.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||ne(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},$r.prototype.detachLine=function(e){if(this.lines.splice(ne(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},oe($r);function Nn(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,Nn)(e,t,n,r,i);var T=new $r(e,i),_=pt(t,n);if(r&&U(r,T,!1),_>0||_==0&&T.clearWhenEmpty!==!1)return T;if(T.replacedWith&&(T.collapsed=!0,T.widgetNode=x("span",[T.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||T.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(T.widgetNode.insertLeft=!0)),T.collapsed){if(Nr(e,t.line,t,n,T)||t.line!=n.line&&Nr(e,n.line,t,n,T))throw new Error("Inserting collapsed marker partially overlapping an existing one");oa()}T.addToHistory&&Fo(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var K=t.line,G=e.cm,V;if(e.iter(K,n.line+1,function(ie){G&&T.collapsed&&!G.options.lineWrapping&&ar(ie)==G.display.maxLine&&(V=!0),T.collapsed&&K!=t.line&&zt(ie,0),sa(ie,new on(T,K==t.line?t.ch:null,K==n.line?n.ch:null)),++K}),T.collapsed&&e.iter(t.line,n.line+1,function(ie){Cr(e,ie)&&zt(ie,0)}),T.clearOnEnter&&ye(T,"beforeCursorEnter",function(){return T.clear()}),T.readOnly&&(Ri(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),T.collapsed&&(T.id=++ns,T.atomic=!0),G){if(V&&(G.curOp.updateMaxLine=!0),T.collapsed)cr(G,t.line,n.line+1);else if(T.className||T.startStyle||T.endStyle||T.css||T.attributes||T.title)for(var ee=t.line;ee<=n.line;ee++)Xr(G,ee,"text");T.atomic&&Qo(G.doc),Nt(G,"markerAdded",G,T)}return T}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();Nt(this,"clear")},yi.prototype.find=function(e,t){return this.primary.find(e,t)},oe(yi);function Al(e,t,n,r,i){r=U(r),r.shared=!1;var T=[Nn(e,t,n,r,i)],_=T[0],K=r.widgetNode;return qr(e,function(G){K&&(r.widgetNode=K.cloneNode(!0)),T.push(Nn(G,gt(G,t),gt(G,n),r,i));for(var V=0;V<G.linked.length;++V)if(G.linked[V].isParent)return;_=Ee(T)}),new yi(T,_)}function is(e){return e.findMarks(_e(e.first,0),e.clipPos(_e(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(),T=e.clipPos(i.from),_=e.clipPos(i.to);if(pt(T,_)){var K=Nn(e,T,_,r.primary,r.primary.type);r.markers.push(K),K.parent=r}}}function Sl(e){for(var t=function(r){var i=e[r],T=[i.primary.doc];qr(i.primary.doc,function(G){return T.push(G)});for(var _=0;_<i.markers.length;_++){var K=i.markers[_];ne(T,K.doc)==-1&&(K.parent=null,i.markers.splice(_--,1))}},n=0;n<e.length;n++)t(n)}var Cl=0,fr=function(e,t,n,r,i){if(!(this instanceof fr))return new fr(e,t,n,r,i);n==null&&(n=0),gi.call(this,[new pi([new Vr("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var T=_e(n,0);this.sel=Jr(T),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)),Ma(this,{from:T,to:T,text:e}),or(this,Jr(T),pe)};fr.prototype=Xe(gi.prototype,{constructor:fr,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=yt(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:Zt(function(e){var t=_e(this.first,0),n=this.first+this.size-1;_n(this,{from:t,to:_e(n,Ue(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&oi(this.cm,0,0),or(this,Jr(t),pe)}),replaceRange:function(e,t,n,r){t=gt(this,t),n=n?gt(this,n):t,Bn(this,e,t,n,r)},getRange:function(e,t,n){var r=_t(this,gt(this,e),gt(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(ut(this,e))return Ue(this,e)},getLineNumber:function(e){return wt(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=Ue(this,e)),ar(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return gt(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:Zt(function(e,t,n){Ho(this,gt(this,typeof e=="number"?_e(e,t||0):e),null,n)}),setSelection:Zt(function(e,t,n){Ho(this,gt(this,e),gt(this,t||e),n)}),extendSelection:Zt(function(e,t,n){Vi(this,gt(this,e),t&&gt(this,t),n)}),extendSelections:Zt(function(e,t){Ko(this,Gn(this,e),t)}),extendSelectionsBy:Zt(function(e,t){var n=ke(this.sel.ranges,e);Ko(this,Gn(this,n),t)}),setSelections:Zt(function(e,t,n){if(!e.length)return;for(var r=[],i=0;i<e.length;i++)r[i]=new Mt(gt(this,e[i].anchor),gt(this,e[i].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),or(this,Lr(this.cm,r,t),n)}),addSelection:Zt(function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new Mt(gt(this,e),gt(this,t||e))),or(this,Lr(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=_t(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=_t(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:Zt(function(e,t,n){for(var r=[],i=this.sel,T=0;T<i.ranges.length;T++){var _=i.ranges[T];r[T]={from:_.from(),to:_.to(),text:this.splitLines(e[T]),origin:n}}for(var K=t&&t!="end"&&fl(this,r,t),G=r.length-1;G>=0;G--)_n(this,r[G]);K?Go(this,K):this.cm&&On(this.cm)}),undo:Zt(function(){Ji(this,"undo")}),redo:Zt(function(){Ji(this,"redo")}),undoSelection:Zt(function(){Ji(this,"undo",!0)}),redoSelection:Zt(function(){Ji(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:Pn(this.history.done),undone:Pn(this.history.undone)}},setHistory:function(e){var t=this.history=new zi(this.history.maxGeneration);t.done=Pn(e.done.slice(0),null,!0),t.undone=Pn(e.undone.slice(0),null,!0)},setGutterMarker:Zt(function(e,t,n){return mi(this,e,"gutter",function(r){var i=r.gutterMarkers||(r.gutterMarkers={});return i[t]=n,!n&&He(i)&&(r.gutterMarkers=null),!0})}),clearGutter:Zt(function(e){var t=this;this.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&mi(t,n,"gutter",function(){return n.gutterMarkers[e]=null,He(n.gutterMarkers)&&(n.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!ut(this,e))return null;if(t=e,e=Ue(this,e),!e)return null}else if(t=wt(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:Zt(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(A(n).test(r[i]))return!1;r[i]+=" "+n}return!0})}),removeLineClass:Zt(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",T=r[i];if(T)if(n==null)r[i]=null;else{var _=T.match(A(n));if(!_)return!1;var K=_.index+_[0].length;r[i]=T.slice(0,_.index)+(!_.index||K==T.length?"":" ")+T.slice(K)||null}else return!1;return!0})}),addLineWidget:Zt(function(e,t,n){return xl(this,e,t,n)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return Nn(this,gt(this,e),gt(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=gt(this,e),Nn(this,e,e,n,"bookmark")},findMarksAt:function(e){e=gt(this,e);var t=[],n=Ue(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=gt(this,e),t=gt(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,function(T){var _=T.markedSpans;if(_)for(var K=0;K<_.length;K++){var G=_[K];!(G.to!=null&&i==e.line&&e.ch>=G.to||G.from==null&&i!=e.line||G.from!=null&&i==t.line&&G.from>=t.ch)&&(!n||n(G.marker))&&r.push(G.marker.parent||G.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 T=i.text.length+r;if(T>e)return t=e,!0;e-=T,++n}),gt(this,_e(n,t))},indexFromPos:function(e){e=gt(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 fr(yt(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 fr(yt(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,is(this)),r},unlinkDoc:function(e){if(e instanceof jt&&(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(is(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=Pn(this.history.done,r),e.history.undone=Pn(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):ot(e)},lineSeparator:function(){return this.lineSep||`
`},setDirection:Zt(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)})}),fr.prototype.eachLine=fr.prototype.iter;var as=0;function wl(e){var t=this;if(os(t),Ie(t,e)||Fr(t.display,e))return;Y(e),N&&(as=+new Date);var n=hn(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,T=Array(i),_=0,K=function(){++_==i&&Jt(t,function(){n=gt(t.doc,n);var he={from:n,to:n,text:t.doc.splitLines(T.filter(function(Se){return Se!=null}).join(t.doc.lineSeparator())),origin:"paste"};_n(t.doc,he),Go(t.doc,Jr(gt(t.doc,n),gt(t.doc,Zr(he))))})()},G=function(he,Se){if(t.options.allowDropFileTypes&&ne(t.options.allowDropFileTypes,he.type)==-1){K();return}var Oe=new FileReader;Oe.onerror=function(){return K()},Oe.onload=function(){var je=Oe.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(je)){K();return}T[Se]=je,K()},Oe.readAsText(he)},V=0;V<r.length;V++)G(r[V],V);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 ee=e.dataTransfer.getData("Text");if(ee){var ie;if(t.state.draggingText&&!t.state.draggingText.copy&&(ie=t.listSelections()),Xi(t.doc,Jr(n,n)),ie)for(var me=0;me<ie.length;++me)Bn(t.doc,"",ie[me].anchor,ie[me].head,"drag");t.replaceSelection(ee,"around","paste"),t.display.input.focus()}}catch(he){}}}function Dl(e,t){if(N&&(!e.state.draggingText||+new Date-as<100)){re(t);return}if(Ie(e,t)||Fr(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!L){var n=o("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",v&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),v&&n.parentNode.removeChild(n)}}function Ll(e,t){var n=hn(e,t);if(!n)return;var r=document.createDocumentFragment();yo(e,n,r),e.display.dragCursor||(e.display.dragCursor=o("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),s(e.display.dragCursor,r)}function os(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function ss(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 T=0;T<n.length;T++)e(n[T])})}var ls=!1;function Rl(){if(ls)return;Il(),ls=!0}function Il(){var e;ye(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,ss(Ol)},100))}),ye(window,"blur",function(){return ss(In)})}function Ol(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var en={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++)en[Ei+48]=en[Ei+96]=String(Ei);for(var Zi=65;Zi<=90;Zi++)en[Zi]=String.fromCharCode(Zi);for(var bi=1;bi<=12;bi++)en[bi+111]=en[bi+63235]="F"+bi;var jr={};jr.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"},jr.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"},jr.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"},jr.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"]},jr.default=l?jr.macDefault:jr.pcDefault;function Ml(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var n,r,i,T,_=0;_<t.length-1;_++){var K=t[_];if(/^(cmd|meta|m)$/i.test(K))T=!0;else if(/^a(lt)?$/i.test(K))n=!0;else if(/^(c|ctrl|control)$/i.test(K))r=!0;else if(/^s(hift)?$/i.test(K))i=!0;else throw new Error("Unrecognized modifier name: "+K)}return n&&(e="Alt-"+e),r&&(e="Ctrl-"+e),T&&(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=ke(n.split(" "),Ml),T=0;T<i.length;T++){var _=void 0,K=void 0;T==i.length-1?(K=i.join(" "),_=r):(K=i.slice(0,T+1).join(" "),_="...");var G=t[K];if(!G)t[K]=_;else if(G!=_)throw new Error("Inconsistent bindings for "+K)}delete e[n]}for(var V in t)e[V]=t[V];return e}function Un(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 Un(e,t.fallthrough,n,r);for(var T=0;T<t.fallthrough.length;T++){var _=Un(e,t.fallthrough[T],n,r);if(_)return _}}}function us(e){var t=typeof e=="string"?e:en[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function ds(e,t,n){var r=e;return t.altKey&&r!="Alt"&&(e="Alt-"+e),(m?t.metaKey:t.ctrlKey)&&r!="Ctrl"&&(e="Ctrl-"+e),(m?t.ctrlKey:t.metaKey)&&r!="Mod"&&(e="Cmd-"+e),!n&&t.shiftKey&&r!="Shift"&&(e="Shift-"+e),e}function cs(e,t){if(v&&e.keyCode==34&&e.char)return!1;var n=en[e.keyCode];return n==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(n=e.code),ds(n,e,t))}function qi(e){return typeof e=="string"?jr[e]:e}function Fn(e,t){for(var n=e.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var T=t(n[i]);r.length&&pt(T.from,Ee(r).to)<=0;){var _=r.pop();if(pt(_.from,T.from)<0){T.from=_.from;break}}r.push(T)}gr(e,function(){for(var K=r.length-1;K>=0;K--)Bn(e.doc,"",r[K].from,r[K].to,"+delete");On(e)})}function Ba(e,t,n){var r=Me(e.text,t+n,n);return r<0||r>e.text.length?null:r}function Na(e,t,n){var r=Ba(e,t.ch,n);return r==null?null:new _e(t.line,r,n<0?"after":"before")}function Ua(e,t,n,r,i){if(e){t.doc.direction=="rtl"&&(i=-i);var T=Je(n,t.doc.direction);if(T){var _=i<0?Ee(T):T[0],K=i<0==(_.level==1),G=K?"after":"before",V;if(_.level>0||t.doc.direction=="rtl"){var ee=Dn(t,n);V=i<0?n.text.length-1:0;var ie=_r(t,ee,V).top;V=qe(function(me){return _r(t,ee,me).top==ie},i<0==(_.level==1)?_.from:_.to-1,V),G=="before"&&(V=Ba(n,V,1))}else V=i<0?_.to:_.from;return new _e(r,V,G)}}return new _e(r,i<0?n.text.length:0,i<0?"before":"after")}function kl(e,t,n,r){var i=Je(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 T=Ne(i,n.ch,n.sticky),_=i[T];if(e.doc.direction=="ltr"&&_.level%2==0&&(r>0?_.to>n.ch:_.from<n.ch))return Na(t,n,r);var K=function(ze,et){return Ba(t,ze instanceof _e?ze.ch:ze,et)},G,V=function(ze){return e.options.lineWrapping?(G=G||Dn(e,t),mo(e,t,G,ze)):{begin:0,end:t.text.length}},ee=V(n.sticky=="before"?K(n,-1):n.ch);if(e.doc.direction=="rtl"||_.level==1){var ie=_.level==1==r<0,me=K(n,ie?1:-1);if(me!=null&&(ie?me<=_.to&&me<=ee.end:me>=_.from&&me>=ee.begin)){var he=ie?"before":"after";return new _e(n.line,me,he)}}var Se=function(ze,et,Qe){for(var nt=function(Ut,qt){return qt?new _e(n.line,K(Ut,1),"before"):new _e(n.line,Ut,"after")};ze>=0&&ze<i.length;ze+=et){var ft=i[ze],dt=et>0==(ft.level!=1),Tt=dt?Qe.begin:K(Qe.end,-1);if(ft.from<=Tt&&Tt<ft.to)return nt(Tt,dt);if(Tt=dt?ft.from:K(ft.to,-1),Qe.begin<=Tt&&Tt<Qe.end)return nt(Tt,dt)}},Oe=Se(T+r,r,ee);if(Oe)return Oe;var je=r>0?ee.end:K(ee.begin,-1);return je!=null&&!(r>0&&je==t.text.length)&&(Oe=Se(r>0?0:i.length-1,r,V(je)),Oe)?Oe:null}var xi={selectAll:Yo,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),pe)},killLine:function(e){return Fn(e,function(t){if(t.empty()){var n=Ue(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:_e(t.head.line+1,0)}:{from:t.head,to:_e(t.head.line,n)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Fn(e,function(t){return{from:_e(t.from().line,0),to:gt(e.doc,_e(t.to().line+1,0))}})},delLineLeft:function(e){return Fn(e,function(t){return{from:_e(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return Fn(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 Fn(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(_e(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(_e(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return fs(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return hs(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/)?hs(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 T=n[i].from(),_=X(e.getLine(T.line),T.ch,r);t.push(se(r-_%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return gr(e,function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++){if(!t[r].empty())continue;var i=t[r].head,T=Ue(e.doc,i.line).text;if(T){if(i.ch==T.length&&(i=new _e(i.line,i.ch-1)),i.ch>0)i=new _e(i.line,i.ch+1),e.replaceRange(T.charAt(i.ch-1)+T.charAt(i.ch-2),_e(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var _=Ue(e.doc,i.line-1).text;_&&(i=new _e(i.line,1),e.replaceRange(T.charAt(0)+e.doc.lineSeparator()+_.charAt(_.length-1),_e(i.line-1,_.length-1),i,"+transpose"))}}n.push(new Mt(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){return gr(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);On(e)})},openLine:function(e){return e.replaceSelection(`
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function fs(e,t){var n=Ue(e.doc,t),r=ar(n);return r!=n&&(t=wt(r)),Ua(!0,e,r,t,1)}function _l(e,t){var n=Ue(e.doc,t),r=Cn(n);return r!=n&&(t=wt(r)),Ua(!0,e,n,t,-1)}function hs(e,t){var n=fs(e,t.line),r=Ue(e.doc,n.line),i=Je(r,e.doc.direction);if(!i||i[0].level==0){var T=Math.max(n.ch,r.text.search(/\S/)),_=t.line==n.line&&t.ch<=T&&t.ch;return _e(n.line,_?0:T,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)!=Te}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=Un(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&Un(t,e.options.extraKeys,n,e)||Un(t,e.options.keyMap,n,e)}var Nl=new $;function Ai(e,t,n,r){var i=e.state.keySeq;if(i){if(us(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Nl.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),ms(e,i+" "+t,n,r))return!0}return ms(e,t,n,r)}function ms(e,t,n,r){var i=Bl(e,t,r);return i=="multi"&&(e.state.keySeq=t),i=="handled"&&Nt(e,"keyHandled",e,t,n),(i=="handled"||i=="multi")&&(Y(n),xa(e)),!!i}function ps(e,t){var n=cs(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 Ul(e,t,n){return Ai(e,"'"+n+"'",t,function(r){return $i(e,r,!0)})}var Fa=null;function gs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=I(),Ie(t,e))return;N&&k<11&&e.keyCode==27&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=n==16||e.shiftKey;var r=ps(t,e);v&&(Fa=r?n:null,!r&&n==88&&!Ot&&(l?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),w&&!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;B(t,"CodeMirror-crosshair");function n(r){(r.keyCode==18||!r.altKey)&&(f(t,"CodeMirror-crosshair"),Ge(document,"keyup",n),Ge(document,"mouseover",n))}ye(document,"keyup",n),ye(document,"mouseover",n)}function vs(e){e.keyCode==16&&(this.doc.sel.shift=!1),Ie(this,e)}function ys(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(Fr(t.display,e)||Ie(t,e)||e.ctrlKey&&!e.altKey||l&&e.metaKey)return;var n=e.keyCode,r=e.charCode;if(v&&n==Fa){Fa=null,Y(e);return}if(v&&(!e.which||e.which<10)&&ps(t,e))return;var i=String.fromCharCode(r==null?n:r);if(i=="\b")return;if(Ul(t,e,i))return;t.display.input.onKeyPress(e)}var jl=400,ja=function(e,t,n){this.time=e,this.pos=t,this.button=n};ja.prototype.compare=function(e,t,n){return this.time+jl>e&&pt(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 ja(n,e,t),Ti=null,"double"):(Ti=new ja(n,e,t),Si=null,"single")}function Es(e){var t=this,n=t.display;if(Ie(t,e)||n.activeTouch&&n.input.supportsTouch())return;if(n.input.ensurePolled(),n.shift=e.shiftKey,Fr(n,e)){O||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));return}if(Wa(t,e))return;var r=hn(t,e),i=Ae(e),T=r?Wl(r,i):"single";if(window.focus(),i==1&&t.state.selectingText&&t.state.selectingText(e),r&&Kl(t,i,r,T,e))return;i==1?r?Gl(t,r,T,e):ge(e)==n.scroller&&Y(e):i==2?(r&&Vi(t.doc,r),setTimeout(function(){return n.input.focus()},20)):i==3&&(D?t.display.input.onContextMenu(e):bo(t))}function Kl(e,t,n,r,i){var T="Click";return r=="double"?T="Double"+T:r=="triple"&&(T="Triple"+T),T=(t==1?"Left":t==2?"Middle":"Right")+T,Ai(e,ds(T,i),i,function(_){if(typeof _=="string"&&(_=xi[_]),!_)return!1;var K=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),K=_(e,n)!=Te}finally{e.state.suppressEdits=!1}return K})}function Hl(e,t,n){var r=e.getOption("configureMouse"),i=r?r(e,t,n):{};if(i.unit==null){var T=u?n.shiftKey&&n.metaKey:n.altKey;i.unit=T?"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){N?setTimeout(j(Eo,e),0):e.curOp.focus=I();var i=Hl(e,n,r),T=e.doc.sel,_;e.options.dragDrop&&Be&&!e.isReadOnly()&&n=="single"&&(_=T.contains(t))>-1&&(pt((_=T.ranges[_]).from(),t)<0||t.xRel>0)&&(pt(_.to(),t)>0||t.xRel<0)?zl(e,r,t,i):Ql(e,r,t,i)}function zl(e,t,n,r){var i=e.display,T=!1,_=Jt(e,function(V){O&&(i.scroller.draggable=!1),e.state.draggingText=!1,Ge(i.wrapper.ownerDocument,"mouseup",_),Ge(i.wrapper.ownerDocument,"mousemove",K),Ge(i.scroller,"dragstart",G),Ge(i.scroller,"drop",_),T||(Y(V),r.addNew||Vi(e.doc,n,null,null,r.extend),O&&!L||N&&k==9?setTimeout(function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()},20):i.input.focus())}),K=function(V){T=T||Math.abs(t.clientX-V.clientX)+Math.abs(t.clientY-V.clientY)>=10},G=function(){return T=!0};O&&(i.scroller.draggable=!0),e.state.draggingText=_,_.copy=!r.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop(),ye(i.wrapper.ownerDocument,"mouseup",_),ye(i.wrapper.ownerDocument,"mousemove",K),ye(i.scroller,"dragstart",G),ye(i.scroller,"drop",_),bo(e),setTimeout(function(){return i.input.focus()},20)}function bs(e,t,n){if(n=="char")return new Mt(t,t);if(n=="word")return e.findWordAt(t);if(n=="line")return new Mt(_e(t.line,0),gt(e.doc,_e(t.line+1,0)));var r=n(e,t);return new Mt(r.from,r.to)}function Ql(e,t,n,r){var i=e.display,T=e.doc;Y(t);var _,K,G=T.sel,V=G.ranges;if(r.addNew&&!r.extend?(K=T.sel.contains(n),K>-1?_=V[K]:_=new Mt(n,n)):(_=T.sel.primary(),K=T.sel.primIndex),r.unit=="rectangle")r.addNew||(_=new Mt(n,n)),n=hn(e,t,!0,!0),K=-1;else{var ee=bs(e,n,r.unit);r.extend?_=ka(_,ee.anchor,ee.head,r.extend):_=ee}r.addNew?K==-1?(K=V.length,or(T,Lr(e,V.concat([_]),K),{scroll:!1,origin:"*mouse"})):V.length>1&&V[K].empty()&&r.unit=="char"&&!r.extend?(or(T,Lr(e,V.slice(0,K).concat(V.slice(K+1)),0),{scroll:!1,origin:"*mouse"}),G=T.sel):_a(T,K,_,de):(K=0,or(T,new br([_],0),de),G=T.sel);var ie=n;function me(Qe){if(pt(ie,Qe)==0)return;if(ie=Qe,r.unit=="rectangle"){for(var nt=[],ft=e.options.tabSize,dt=X(Ue(T,n.line).text,n.ch,ft),Tt=X(Ue(T,Qe.line).text,Qe.ch,ft),Ut=Math.min(dt,Tt),qt=Math.max(dt,Tt),Wt=Math.min(n.line,Qe.line),vr=Math.min(e.lastLine(),Math.max(n.line,Qe.line));Wt<=vr;Wt++){var hr=Ue(T,Wt).text,Vt=fe(hr,Ut,ft);Ut==qt?nt.push(new Mt(_e(Wt,Vt),_e(Wt,Vt))):hr.length>Vt&&nt.push(new Mt(_e(Wt,Vt),_e(Wt,fe(hr,qt,ft))))}nt.length||nt.push(new Mt(n,n)),or(T,Lr(e,G.ranges.slice(0,K).concat(nt),K),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Qe)}else{var mr=_,rr=bs(e,Qe,r.unit),Yt=mr.anchor,Xt;pt(rr.anchor,Yt)>0?(Xt=rr.head,Yt=nn(mr.from(),rr.anchor)):(Xt=rr.anchor,Yt=An(mr.to(),rr.head));var Kt=G.ranges.slice(0);Kt[K]=Vl(e,new Mt(gt(T,Yt),Xt)),or(T,Lr(e,Kt,K),de)}}var he=i.wrapper.getBoundingClientRect(),Se=0;function Oe(Qe){var nt=++Se,ft=hn(e,Qe,!0,r.unit=="rectangle");if(!ft)return;if(pt(ft,ie)!=0){e.curOp.focus=I(),me(ft);var dt=Wi(i,T);(ft.line>=dt.to||ft.line<dt.from)&&setTimeout(Jt(e,function(){Se==nt&&Oe(Qe)}),150)}else{var Tt=Qe.clientY<he.top?-20:Qe.clientY>he.bottom?20:0;Tt&&setTimeout(Jt(e,function(){if(Se!=nt)return;i.scroller.scrollTop+=Tt,Oe(Qe)}),50)}}function je(Qe){e.state.selectingText=!1,Se=Infinity,Qe&&(Y(Qe),i.input.focus()),Ge(i.wrapper.ownerDocument,"mousemove",ze),Ge(i.wrapper.ownerDocument,"mouseup",et),T.history.lastSelOrigin=null}var ze=Jt(e,function(Qe){Qe.buttons===0||!Ae(Qe)?je(Qe):Oe(Qe)}),et=Jt(e,je);e.state.selectingText=et,ye(i.wrapper.ownerDocument,"mousemove",ze),ye(i.wrapper.ownerDocument,"mouseup",et)}function Vl(e,t){var n=t.anchor,r=t.head,i=Ue(e.doc,n.line);if(pt(n,r)==0&&n.sticky==r.sticky)return t;var T=Je(i);if(!T)return t;var _=Ne(T,n.ch,n.sticky),K=T[_];if(K.from!=n.ch&&K.to!=n.ch)return t;var G=_+(K.from==n.ch==(K.level!=1)?0:1);if(G==0||G==T.length)return t;var V;if(r.line!=n.line)V=(r.line-n.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var ee=Ne(T,r.ch,r.sticky),ie=ee-_||(r.ch-n.ch)*(K.level==1?-1:1);ee==G-1||ee==G?V=ie<0:V=ie>0}var me=T[G+(V?-1:0)],he=V==(me.level==1),Se=he?me.from:me.to,Oe=he?"after":"before";return n.ch==Se&&n.sticky==Oe?t:new Mt(new _e(n.line,Se,Oe),r)}function xs(e,t,n,r){var i,T;if(t.touches)i=t.touches[0].clientX,T=t.touches[0].clientY;else try{i=t.clientX,T=t.clientY}catch(me){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&Y(t);var _=e.display,K=_.lineDiv.getBoundingClientRect();if(T>K.bottom||!ae(e,n))return q(t);T-=K.top-_.viewOffset;for(var G=0;G<e.display.gutterSpecs.length;++G){var V=_.gutters.childNodes[G];if(V&&V.getBoundingClientRect().right>=i){var ee=ir(e.doc,T),ie=e.display.gutterSpecs[G];return ve(e,n,e,ee,ie.className,t),q(t)}}}function Wa(e,t){return xs(e,t,"gutterClick",!0)}function As(e,t){if(Fr(e.display,t)||Xl(e,t))return;if(Ie(e,t,"contextmenu"))return;D||e.display.input.onContextMenu(t)}function Xl(e,t){return ae(e,"gutterContextMenu")?xs(e,t,"gutterContextMenu",!1):!1}function Ts(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 jn={toString:function(){return"CodeMirror.Init"}},Ss={},ea={};function Yl(e){var t=e.optionHandlers;function n(r,i,T,_){e.defaults[r]=i,T&&(t[r]=_?function(K,G,V){V!=jn&&T(K,G,V)}:T)}e.defineOption=n,e.Init=jn,n("value","",function(r,i){return r.setValue(i)},!0),n("mode",null,function(r,i){r.doc.modeOption=i,Oa(r)},!0),n("indentUnit",2,Oa,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,function(r){fi(r),ii(r),cr(r)},!0),n("lineSeparator",null,function(r,i){if(r.doc.lineSep=i,!i)return;var T=[],_=r.doc.first;r.doc.iter(function(G){for(var V=0;;){var ee=G.text.indexOf(i,V);if(ee==-1)break;V=ee+i.length,T.push(_e(_,ee))}_++});for(var K=T.length-1;K>=0;K--)Bn(r.doc,i,T[K],_e(T[K].line,T[K].ch+i.length))}),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(r,i,T){r.state.specialChars=new RegExp(i.source+(i.test(" ")?"":"| "),"g"),T!=jn&&r.refresh()}),n("specialCharPlaceholder",vt,function(r){return r.refresh()},!0),n("electricChars",!0),n("inputStyle",a?"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",!C),n("wholeLineUpdateBefore",!0),n("theme","default",function(r){Ts(r),ci(r)},!0),n("keyMap","default",function(r,i,T){var _=qi(i),K=T!=jn&&qi(T);K&&K.detach&&K.detach(r,_),_.attach&&_.attach(r,K||null)}),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Zl,!0),n("gutters",[],function(r,i){r.display.gutterSpecs=Ra(i,r.options.lineNumbers),ci(r)},!0),n("fixedGutter",!0,function(r,i){r.display.gutters.style.left=i?Ea(r.display)+"px":"0",r.refresh()},!0),n("coverGutterNextToScrollbar",!1,function(r){return Mn(r)},!0),n("scrollbarStyle","native",function(r){wo(r),Mn(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=Ra(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"&&(In(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,Jl),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 Jl(e,t,n){var r=n&&n!=jn;if(!t!=!r){var i=e.display.dragFunctions,T=t?ye:Ge;T(e.display.scroller,"dragstart",i.start),T(e.display.scroller,"dragenter",i.enter),T(e.display.scroller,"dragover",i.over),T(e.display.scroller,"dragleave",i.leave),T(e.display.scroller,"drop",i.drop)}}function Zl(e){e.options.lineWrapping?(B(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(f(e.display.wrapper,"CodeMirror-wrap"),ti(e)),ba(e),cr(e),ii(e),setTimeout(function(){return Mn(e)},100)}function jt(e,t){var n=this;if(!(this instanceof jt))return new jt(e,t);this.options=t=t?U(t):{},U(Ss,t,!1);var r=t.value;typeof r=="string"?r=new fr(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new jt.inputStyles[t.inputStyle](this),T=this.display=new dl(e,r,i,t);T.wrapper.CodeMirror=this,Ts(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),wo(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 $,keySeq:null,specialChars:null},t.autofocus&&!a&&T.input.focus(),N&&k<11&&setTimeout(function(){return n.display.input.reset(!0)},20),ql(this),Rl(),vn(this),this.curOp.forceUpdate=!0,Bo(this,r),t.autofocus&&!a||this.hasFocus()?setTimeout(function(){n.hasFocus()&&!n.state.focused&&Aa(n)},20):In(this);for(var _ in ea)ea.hasOwnProperty(_)&&ea[_](this,t[_],jn);Ro(this),t.finishInit&&t.finishInit(this);for(var K=0;K<Ka.length;++K)Ka[K](this);yn(this),O&&t.lineWrapping&&getComputedStyle(T.lineDiv).textRendering=="optimizelegibility"&&(T.lineDiv.style.textRendering="auto")}jt.defaults=Ss,jt.optionHandlers=ea;function ql(e){var t=e.display;ye(t.scroller,"mousedown",Jt(e,Es)),N&&k<11?ye(t.scroller,"dblclick",Jt(e,function(G){if(Ie(e,G))return;var V=hn(e,G);if(!V||Wa(e,G)||Fr(e.display,G))return;Y(G);var ee=e.findWordAt(V);Vi(e.doc,ee.anchor,ee.head)})):ye(t.scroller,"dblclick",function(G){return Ie(e,G)||Y(G)}),ye(t.scroller,"contextmenu",function(G){return As(e,G)}),ye(t.input.getField(),"contextmenu",function(G){t.scroller.contains(G.target)||As(e,G)});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 T(G){if(G.touches.length!=1)return!1;var V=G.touches[0];return V.radiusX<=1&&V.radiusY<=1}function _(G,V){if(V.left==null)return!0;var ee=V.left-G.left,ie=V.top-G.top;return ee*ee+ie*ie>20*20}ye(t.scroller,"touchstart",function(G){if(!Ie(e,G)&&!T(G)&&!Wa(e,G)){t.input.ensurePolled(),clearTimeout(n);var V=+new Date;t.activeTouch={start:V,moved:!1,prev:V-r.end<=300?r:null},G.touches.length==1&&(t.activeTouch.left=G.touches[0].pageX,t.activeTouch.top=G.touches[0].pageY)}}),ye(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),ye(t.scroller,"touchend",function(G){var V=t.activeTouch;if(V&&!Fr(t,G)&&V.left!=null&&!V.moved&&new Date-V.start<300){var ee=e.coordsChar(t.activeTouch,"page"),ie;!V.prev||_(V,V.prev)?ie=new Mt(ee,ee):!V.prev.prev||_(V,V.prev.prev)?ie=e.findWordAt(ee):ie=new Mt(_e(ee.line,0),gt(e.doc,_e(ee.line+1,0))),e.setSelection(ie.anchor,ie.head),e.focus(),Y(G)}i()}),ye(t.scroller,"touchcancel",i),ye(t.scroller,"scroll",function(){t.scroller.clientHeight&&(si(e,t.scroller.scrollTop),pn(e,t.scroller.scrollLeft,!0),ve(e,"scroll",e))}),ye(t.scroller,"mousewheel",function(G){return Mo(e,G)}),ye(t.scroller,"DOMMouseScroll",function(G){return Mo(e,G)}),ye(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(G){Ie(e,G)||re(G)},over:function(G){Ie(e,G)||(Ll(e,G),re(G))},start:function(G){return Dl(e,G)},drop:Jt(e,wl),leave:function(G){Ie(e,G)||os(e)}};var K=t.input.getField();ye(K,"keyup",function(G){return vs.call(e,G)}),ye(K,"keydown",Jt(e,gs)),ye(K,"keypress",Jt(e,ys)),ye(K,"focus",function(G){return Aa(e,G)}),ye(K,"blur",function(G){return In(e,G)})}var Ka=[];jt.defineInitHook=function(e){return Ka.push(e)};function Ci(e,t,n,r){var i=e.doc,T;n==null&&(n="add"),n=="smart"&&(i.mode.indent?T=an(e,t).state:n="prev");var _=e.options.tabSize,K=Ue(i,t),G=X(K.text,null,_);K.stateAfter&&(K.stateAfter=null);var V=K.text.match(/^\s*/)[0],ee;if(!r&&!/\S/.test(K.text))ee=0,n="not";else if(n=="smart"&&(ee=i.mode.indent(T,K.text.slice(V.length),K.text),ee==Te||ee>150)){if(!r)return;n="prev"}n=="prev"?t>i.first?ee=X(Ue(i,t-1).text,null,_):ee=0:n=="add"?ee=G+e.options.indentUnit:n=="subtract"?ee=G-e.options.indentUnit:typeof n=="number"&&(ee=G+n),ee=Math.max(0,ee);var ie="",me=0;if(e.options.indentWithTabs)for(var he=Math.floor(ee/_);he;--he)me+=_,ie+=" ";if(me<ee&&(ie+=se(ee-me)),ie!=V)return Bn(i,ie,_e(t,0),_e(t,V.length),"+input"),K.stateAfter=null,!0;for(var Se=0;Se<i.sel.ranges.length;Se++){var Oe=i.sel.ranges[Se];if(Oe.head.line==t&&Oe.head.ch<V.length){var je=_e(t,V.length);_a(i,Se,new Mt(je,je));break}}}var Rr=null;function ta(e){Rr=e}function Ha(e,t,n,r,i){var T=e.doc;e.display.shift=!1,r||(r=T.sel);var _=+new Date-200,K=i=="paste"||e.state.pasteIncoming>_,G=ot(t),V=null;if(K&&r.ranges.length>1)if(Rr&&Rr.text.join(`
`)==t){if(r.ranges.length%Rr.text.length==0){V=[];for(var ee=0;ee<Rr.text.length;ee++)V.push(T.splitLines(Rr.text[ee]))}}else G.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(V=ke(G,function(ze){return[ze]}));for(var ie=e.curOp.updateInput,me=r.ranges.length-1;me>=0;me--){var he=r.ranges[me],Se=he.from(),Oe=he.to();he.empty()&&(n&&n>0?Se=_e(Se.line,Se.ch-n):e.state.overwrite&&!K?Oe=_e(Oe.line,Math.min(Ue(T,Oe.line).text.length,Oe.ch+Ee(G).length)):K&&Rr&&Rr.lineWise&&Rr.text.join(`
`)==G.join(`
`)&&(Se=Oe=_e(Se.line,0)));var je={from:Se,to:Oe,text:V?V[me%V.length]:G,origin:i||(K?"paste":e.state.cutIncoming>_?"cut":"+input")};_n(e.doc,je),Nt(e,"inputRead",e,je)}t&&!K&&ws(e,t),On(e),e.curOp.updateInput<2&&(e.curOp.updateInput=ie),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Cs(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&gr(t,function(){return Ha(t,n,0,null,"paste")}),!0}function ws(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 T=e.getModeAt(i.head),_=!1;if(T.electricChars){for(var K=0;K<T.electricChars.length;K++)if(t.indexOf(T.electricChars.charAt(K))>-1){_=Ci(e,i.head.line,"smart");break}}else T.electricInput&&(T.electricInput.test(Ue(e.doc,i.head.line).text.slice(0,i.head.ch))&&(_=Ci(e,i.head.line,"smart")));_&&Nt(e,"electricInput",e,i.head.line)}}function Ds(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,T={anchor:_e(i,0),head:_e(i+1,0)};n.push(T),t.push(e.getRange(T.anchor,T.head))}return{text:t,ranges:n}}function Ls(e,t,n,r){e.setAttribute("autocorrect",n?"":"off"),e.setAttribute("autocapitalize",r?"":"off"),e.setAttribute("spellcheck",!!t)}function Rs(){var e=o("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=o("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return O?e.style.width="1000px":e.setAttribute("wrap","off"),b&&(e.style.border="1px solid black"),Ls(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 T=this.options,_=T[r];if(T[r]==i&&r!="mode")return;T[r]=i,t.hasOwnProperty(r)&&Jt(this,t[r])(this,i,_),ve(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,T=0;T<i.length;++T)if(i[T]==r||i[T].name==r)return i.splice(T,1),!0},addOverlay:ur(function(r,i){var T=r.token?r:e.getMode(this.options,r);if(T.startState)throw new Error("Overlays may not be stateful.");Le(this.state.overlays,{mode:T,modeSpec:r,opaque:i&&i.opaque,priority:i&&i.priority||0},function(_){return _.priority}),this.state.modeGen++,cr(this)}),removeOverlay:ur(function(r){for(var i=this.state.overlays,T=0;T<i.length;++T){var _=i[T].modeSpec;if(_==r||typeof r=="string"&&_.name==r){i.splice(T,1),this.state.modeGen++,cr(this);return}}}),indentLine:ur(function(r,i,T){typeof i!="string"&&typeof i!="number"&&(i==null?i=this.options.smartIndent?"smart":"prev":i=i?"add":"subtract"),ut(this.doc,r)&&Ci(this,r,i,T)}),indentSelection:ur(function(r){for(var i=this.doc.sel.ranges,T=-1,_=0;_<i.length;_++){var K=i[_];if(K.empty())K.head.line>T&&(Ci(this,K.head.line,r,!0),T=K.head.line,_==this.doc.sel.primIndex&&On(this));else{var G=K.from(),V=K.to(),ee=Math.max(T,G.line);T=Math.min(this.lastLine(),V.line-(V.ch?0:1))+1;for(var ie=ee;ie<T;++ie)Ci(this,ie,r);var me=this.doc.sel.ranges;G.ch==0&&i.length==me.length&&me[_].from().ch>0&&_a(this.doc,_,new Mt(G,me[_].to()),pe)}}}),getTokenAt:function(r,i){return Di(this,r,i)},getLineTokens:function(r,i){return Di(this,_e(r),i,!0)},getTokenTypeAt:function(r){r=gt(this.doc,r);var i=Fe(this,Ue(this.doc,r.line)),T=0,_=(i.length-1)/2,K=r.ch,G;if(K==0)G=i[2];else for(;;){var V=T+_>>1;if((V?i[V*2-1]:0)>=K)_=V;else if(i[V*2+1]<K)T=V+1;else{G=i[V*2+2];break}}var ee=G?G.indexOf("overlay "):-1;return ee<0?G:ee==0?null:G.slice(0,ee-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 T=[];if(!n.hasOwnProperty(i))return T;var _=n[i],K=this.getModeAt(r);if(typeof K[i]=="string")_[K[i]]&&T.push(_[K[i]]);else if(K[i])for(var G=0;G<K[i].length;G++){var V=_[K[i][G]];V&&T.push(V)}else K.helperType&&_[K.helperType]?T.push(_[K.helperType]):_[K.name]&&T.push(_[K.name]);for(var ee=0;ee<_._global.length;ee++){var ie=_._global[ee];ie.pred(K,this)&&ne(T,ie.val)==-1&&T.push(ie.val)}return T},getStateAfter:function(r,i){var T=this.doc;return r=wi(T,r==null?T.first+T.size-1:r),an(this,r+1,i).state},cursorCoords:function(r,i){var T,_=this.doc.sel.primary();return r==null?T=_.head:typeof r=="object"?T=gt(this.doc,r):T=r?_.from():_.to(),Dr(this,T,i||"page")},charCoords:function(r,i){return ma(this,gt(this.doc,r),i||"page")},coordsChar:function(r,i){return r=co(this,r,i||"page"),ga(this,r.left,r.top)},lineAtHeight:function(r,i){return r=co(this,{top:r,left:0},i||"page").top,ir(this.doc,r+this.display.viewOffset)},heightAtLine:function(r,i,T){var _=!1,K;if(typeof r=="number"){var G=this.doc.first+this.doc.size-1;r<this.doc.first?r=this.doc.first:r>G&&(r=G,_=!0),K=Ue(this.doc,r)}else K=r;return Ni(this,K,{top:0,left:0},i||"page",T||_).top+(_?this.doc.height-wr(K):0)},defaultTextHeight:function(){return Ln(this.display)},defaultCharWidth:function(){return Rn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,i,T,_,K){var G=this.display;r=Dr(this,gt(this.doc,r));var V=r.bottom,ee=r.left;if(i.style.position="absolute",i.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(i),G.sizer.appendChild(i),_=="over")V=r.top;else if(_=="above"||_=="near"){var ie=Math.max(G.wrapper.clientHeight,this.doc.height),me=Math.max(G.sizer.clientWidth,G.lineSpace.clientWidth);(_=="above"||r.bottom+i.offsetHeight>ie)&&r.top>i.offsetHeight?V=r.top-i.offsetHeight:r.bottom+i.offsetHeight<=ie&&(V=r.bottom),ee+i.offsetWidth>me&&(ee=me-i.offsetWidth)}i.style.top=V+"px",i.style.left=i.style.right="",K=="right"?(ee=G.sizer.clientWidth-i.offsetWidth,i.style.right="0px"):(K=="left"?ee=0:K=="middle"&&(ee=(G.sizer.clientWidth-i.offsetWidth)/2),i.style.left=ee+"px"),T&&Js(this,{left:ee,top:V,right:ee+i.offsetWidth,bottom:V+i.offsetHeight})},triggerOnKeyDown:ur(gs),triggerOnKeyPress:ur(ys),triggerOnKeyUp:vs,triggerOnMouseDown:ur(Es),execCommand:function(r){if(xi.hasOwnProperty(r))return xi[r].call(null,this)},triggerElectric:ur(function(r){ws(this,r)}),findPosH:function(r,i,T,_){var K=1;i<0&&(K=-1,i=-i);for(var G=gt(this.doc,r),V=0;V<i&&!(G=Ga(this.doc,G,K,T,_),G.hitSide);++V);return G},moveH:ur(function(r,i){var T=this;this.extendSelectionsBy(function(_){return T.display.shift||T.doc.extend||_.empty()?Ga(T.doc,_.head,r,i,T.options.rtlMoveVisually):r<0?_.from():_.to()},ce)}),deleteH:ur(function(r,i){var T=this.doc.sel,_=this.doc;T.somethingSelected()?_.replaceSelection("",null,"+delete"):Fn(this,function(K){var G=Ga(_,K.head,r,i,!1);return r<0?{from:G,to:K.head}:{from:K.head,to:G}})}),findPosV:function(r,i,T,_){var K=1,G=_;i<0&&(K=-1,i=-i);for(var V=gt(this.doc,r),ee=0;ee<i;++ee){var ie=Dr(this,V,"div");if(G==null?G=ie.left:ie.left=G,V=Is(this,ie,K,T),V.hitSide)break}return V},moveV:ur(function(r,i){var T=this,_=this.doc,K=[],G=!this.display.shift&&!_.extend&&_.sel.somethingSelected();if(_.extendSelectionsBy(function(ee){if(G)return r<0?ee.from():ee.to();var ie=Dr(T,ee.head,"div");ee.goalColumn!=null&&(ie.left=ee.goalColumn),K.push(ie.left);var me=Is(T,ie,r,i);return i=="page"&&ee==_.sel.primary()&&Sa(T,ma(T,me,"div").top-ie.top),me},ce),K.length)for(var V=0;V<_.sel.ranges.length;V++)_.sel.ranges[V].goalColumn=K[V]}),findWordAt:function(r){var i=this.doc,T=Ue(i,r.line).text,_=r.ch,K=r.ch;if(T){var G=this.getHelper(r,"wordChars");(r.sticky=="before"||K==T.length)&&_?--_:++K;for(var V=T.charAt(_),ee=De(V,G)?function(ie){return De(ie,G)}:/\s/.test(V)?function(ie){return/\s/.test(ie)}:function(ie){return!/\s/.test(ie)&&!De(ie)};_>0&&ee(T.charAt(_-1));)--_;for(;K<T.length&&ee(T.charAt(K));)++K}return new Mt(_e(r.line,_),_e(r.line,K))},toggleOverwrite:function(r){if(r!=null&&r==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?B(this.display.cursorDiv,"CodeMirror-overwrite"):f(this.display.cursorDiv,"CodeMirror-overwrite"),ve(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==I()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:ur(function(r,i){oi(this,r,i)}),getScrollInfo:function(){var r=this.display.scroller;return{left:r.scrollLeft,top:r.scrollTop,height:r.scrollHeight-kr(this)-this.display.barHeight,width:r.scrollWidth-kr(this)-this.display.barWidth,clientHeight:ca(this),clientWidth:cn(this)}},scrollIntoView:ur(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:_e(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):Ao(this,r.from,r.to,r.margin)}),setSize:ur(function(r,i){var T=this,_=function(G){return typeof G=="number"||/^\d+$/.test(String(G))?G+"px":G};r!=null&&(this.display.wrapper.style.width=_(r)),i!=null&&(this.display.wrapper.style.height=_(i)),this.options.lineWrapping&&so(this);var K=this.display.viewFrom;this.doc.iter(K,this.display.viewTo,function(G){if(G.widgets){for(var V=0;V<G.widgets.length;V++)if(G.widgets[V].noHScroll){Xr(T,K,"widget");break}}++K}),this.curOp.forceUpdate=!0,ve(this,"refresh",this)}),operation:function(r){return gr(this,r)},startOperation:function(){return vn(this)},endOperation:function(){return yn(this)},refresh:ur(function(){var r=this.display.cachedTextHeight;cr(this),this.curOp.forceUpdate=!0,ii(this),oi(this,this.doc.scrollLeft,this.doc.scrollTop),Da(this.display),(r==null||Math.abs(r-Ln(this.display))>.5||this.options.lineWrapping)&&ba(this),ve(this,"refresh",this)}),swapDoc:ur(function(r){var i=this.doc;return i.cm=null,this.state.selectingText&&this.state.selectingText(),Bo(this,r),ii(this),this.display.input.reset(),oi(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,Nt(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}},oe(e),e.registerHelper=function(r,i,T){n.hasOwnProperty(r)||(n[r]=e[r]={_global:[]}),n[r][i]=T},e.registerGlobalHelper=function(r,i,T,_){e.registerHelper(r,i,_),n[r]._global.push({pred:T,val:_})}}function Ga(e,t,n,r,i){var T=t,_=n,K=Ue(e,t.line),G=i&&e.direction=="rtl"?-n:n;function V(){var et=t.line+G;return et<e.first||et>=e.first+e.size?!1:(t=new _e(et,t.ch,t.sticky),K=Ue(e,et))}function ee(et){var Qe;if(r=="codepoint"){var nt=K.text.charCodeAt(t.ch+(r>0?0:-1));isNaN(nt)?Qe=null:Qe=new _e(t.line,Math.max(0,Math.min(K.text.length,t.ch+n*(nt>=55296&&nt<56320?2:1))),-n)}else i?Qe=kl(e.cm,K,t,n):Qe=Na(K,t,n);if(Qe==null)if(!et&&V())t=Ua(i,e.cm,K,t.line,G);else return!1;else t=Qe;return!0}if(r=="char"||r=="codepoint")ee();else if(r=="column")ee(!0);else if(r=="word"||r=="group")for(var ie=null,me=r=="group",he=e.cm&&e.cm.getHelper(t,"wordChars"),Se=!0;!(n<0&&!ee(!Se));Se=!1){var Oe=K.text.charAt(t.ch)||`
`,je=De(Oe,he)?"w":me&&Oe==`
`?"n":!me||/\s/.test(Oe)?null:"p";if(me&&!Se&&!je&&(je="s"),ie&&ie!=je){n<0&&(n=1,ee(),t.sticky="after");break}if(je&&(ie=je),n>0&&!ee(!Se))break}var ze=Yi(e,t,T,_,!0);return rn(T,ze)&&(ze.hitSide=!0),ze}function Is(e,t,n,r){var i=e.doc,T=t.left,_;if(r=="page"){var K=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),G=Math.max(K-.5*Ln(e.display),3);_=(n>0?t.bottom:t.top)+n*G}else r=="line"&&(_=n>0?t.bottom+3:t.top-3);for(var V;!(V=ga(e,T,_),!V.outside);){if(n<0?_<=0:_>=i.height){V.hitSide=!0;break}_+=n*5}return V}var kt=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new $,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};kt.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;Ls(i,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function T(K){for(var G=K.target;G;G=G.parentNode){if(G==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(G.className))break}return!1}ye(i,"paste",function(K){if(!T(K)||Ie(r,K)||Cs(K,r))return;k<=11&&setTimeout(Jt(r,function(){return t.updateFromDOM()}),20)}),ye(i,"compositionstart",function(K){t.composing={data:K.data,done:!1}}),ye(i,"compositionupdate",function(K){t.composing||(t.composing={data:K.data,done:!1})}),ye(i,"compositionend",function(K){t.composing&&(K.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){if(!T(K)||Ie(r,K))return;if(r.somethingSelected())ta({lineWise:!1,text:r.getSelections()}),K.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var G=Ds(r);ta({lineWise:!0,text:G.text}),K.type=="cut"&&r.operation(function(){r.setSelections(G.ranges,0,pe),r.replaceSelection("",null,"cut")})}else return;if(K.clipboardData){K.clipboardData.clearData();var V=Rr.text.join(`
`);if(K.clipboardData.setData("Text",V),K.clipboardData.getData("Text")==V){K.preventDefault();return}}var ee=Rs(),ie=ee.firstChild;r.display.lineSpace.insertBefore(ee,r.display.lineSpace.firstChild),ie.value=Rr.text.join(`
`);var me=document.activeElement;Q(ie),setTimeout(function(){r.display.lineSpace.removeChild(ee),me.focus(),me==i&&n.showPrimarySelection()},50)}ye(i,"copy",_),ye(i,"cut",_)},kt.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},kt.prototype.prepareSelection=function(){var e=vo(this.cm,!1);return e.focus=document.activeElement==this.div,e},kt.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},kt.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},kt.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 T=ra(t,e.anchorNode,e.anchorOffset),_=ra(t,e.focusNode,e.focusOffset);if(T&&!T.bad&&_&&!_.bad&&pt(nn(T,_),r)==0&&pt(An(T,_),i)==0)return;var K=t.display.view,G=r.line>=t.display.viewFrom&&Os(t,r)||{node:K[0].measure.map[2],offset:0},V=i.line<t.display.viewTo&&Os(t,i);if(!V){var ee=K[K.length-1].measure,ie=ee.maps?ee.maps[ee.maps.length-1]:ee.map;V={node:ie[ie.length-1],offset:ie[ie.length-2]-ie[ie.length-3]}}if(!G||!V){e.removeAllRanges();return}var me=e.rangeCount&&e.getRangeAt(0),he;try{he=y(G.node,G.offset,V.offset,V.node)}catch(Se){}he&&(!w&&t.state.focused?(e.collapse(G.node,G.offset),he.collapsed||(e.removeAllRanges(),e.addRange(he))):(e.removeAllRanges(),e.addRange(he)),me&&e.anchorNode==null?e.addRange(me):w&&this.startGracePeriod()),this.rememberSelection()},kt.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)},kt.prototype.showMultipleSelections=function(e){s(this.cm.display.cursorDiv,e.cursors),s(this.cm.display.selectionDiv,e.selection)},kt.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},kt.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return p(this.div,t)},kt.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},kt.prototype.blur=function(){this.div.blur()},kt.prototype.getField=function(){return this.div},kt.prototype.supportsTouch=function(){return!0},kt.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():gr(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)},kt.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},kt.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(d&&h&&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&&gr(t,function(){or(t.doc,Jr(n,r),pe),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)})},kt.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=_e(r.line-1,Ue(e.doc,r.line-1).length)),i.ch==Ue(e.doc,i.line).text.length&&i.line<e.lastLine()&&(i=_e(i.line+1,0)),r.line<t.viewFrom||i.line>t.viewTo-1)return!1;var T,_,K;r.line==t.viewFrom||(T=mn(e,r.line))==0?(_=wt(t.view[0].line),K=t.view[0].node):(_=wt(t.view[T].line),K=t.view[T-1].node.nextSibling);var G=mn(e,i.line),V,ee;if(G==t.view.length-1?(V=t.viewTo-1,ee=t.lineDiv.lastChild):(V=wt(t.view[G+1].line)-1,ee=t.view[G+1].node.previousSibling),!K)return!1;for(var ie=e.doc.splitLines(tu(e,K,ee,_,V)),me=_t(e.doc,_e(_,0),_e(V,Ue(e.doc,V).text.length));ie.length>1&&me.length>1;)if(Ee(ie)==Ee(me))ie.pop(),me.pop(),V--;else if(ie[0]==me[0])ie.shift(),me.shift(),_++;else break;for(var he=0,Se=0,Oe=ie[0],je=me[0],ze=Math.min(Oe.length,je.length);he<ze&&Oe.charCodeAt(he)==je.charCodeAt(he);)++he;for(var et=Ee(ie),Qe=Ee(me),nt=Math.min(et.length-(ie.length==1?he:0),Qe.length-(me.length==1?he:0));Se<nt&&et.charCodeAt(et.length-Se-1)==Qe.charCodeAt(Qe.length-Se-1);)++Se;if(ie.length==1&&me.length==1&&_==r.line)for(;he&&he>r.ch&&et.charCodeAt(et.length-Se-1)==Qe.charCodeAt(Qe.length-Se-1);)he--,Se++;ie[ie.length-1]=et.slice(0,et.length-Se).replace(/^\u200b+/,""),ie[0]=ie[0].slice(he).replace(/\u200b+$/,"");var ft=_e(_,he),dt=_e(V,me.length?Ee(me).length-Se:0);if(ie.length>1||ie[0]||pt(ft,dt))return Bn(e.doc,ie,ft,dt,"+input"),!0},kt.prototype.ensurePolled=function(){this.forceCompositionEnd()},kt.prototype.reset=function(){this.forceCompositionEnd()},kt.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},kt.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)},kt.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&gr(this.cm,function(){return cr(e.cm)})},kt.prototype.setUneditable=function(e){e.contentEditable="false"},kt.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||Jt(this.cm,Ha)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},kt.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},kt.prototype.onContextMenu=function(){},kt.prototype.resetPosition=function(){},kt.prototype.needsContentAttribute=!0;function Os(e,t){var n=fa(e,t.line);if(!n||n.hidden)return null;var r=Ue(e.doc,t.line),i=ro(n,r,t.line),T=Je(r,e.doc.direction),_="left";if(T){var K=Ne(T,t.ch);_=K%2?"right":"left"}var G=ao(i.map,t.ch,_);return G.offset=G.collapse=="right"?G.end:G.start,G}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Wn(e,t){return t&&(e.bad=!0),e}function tu(e,t,n,r,i){var T="",_=!1,K=e.doc.lineSeparator(),G=!1;function V(he){return function(Se){return Se.id==he}}function ee(){_&&(T+=K,G&&(T+=K),_=G=!1)}function ie(he){he&&(ee(),T+=he)}function me(he){if(he.nodeType==1){var Se=he.getAttribute("cm-text");if(Se){ie(Se);return}var Oe=he.getAttribute("cm-marker"),je;if(Oe){var ze=e.findMarks(_e(r,0),_e(i+1,0),V(+Oe));ze.length&&(je=ze[0].find(0))&&ie(_t(e.doc,je.from,je.to).join(K));return}if(he.getAttribute("contenteditable")=="false")return;var et=/^(pre|div|p|li|table|br)$/i.test(he.nodeName);if(!/^br$/i.test(he.nodeName)&&he.textContent.length==0)return;et&&ee();for(var Qe=0;Qe<he.childNodes.length;Qe++)me(he.childNodes[Qe]);/^(pre|p)$/i.test(he.nodeName)&&(G=!0),et&&(_=!0)}else he.nodeType==3&&ie(he.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(me(t),t==n);)t=t.nextSibling,G=!1;return T}function ra(e,t,n){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[n],!r)return Wn(e.clipPos(_e(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 T=e.display.view[i];if(T.node==r)return ru(T,t,n)}}function ru(e,t,n){var r=e.text.firstChild,i=!1;if(!t||!p(r,t))return Wn(_e(wt(e.line),0),!0);if(t==r&&(i=!0,t=r.childNodes[n],n=0,!t)){var T=e.rest?Ee(e.rest):e.line;return Wn(_e(wt(T),T.text.length),i)}var _=t.nodeType==3?t:null,K=t;for(!_&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(_=t.firstChild,n&&(n=_.nodeValue.length));K.parentNode!=r;)K=K.parentNode;var G=e.measure,V=G.maps;function ee(je,ze,et){for(var Qe=-1;Qe<(V?V.length:0);Qe++)for(var nt=Qe<0?G.map:V[Qe],ft=0;ft<nt.length;ft+=3){var dt=nt[ft+2];if(dt==je||dt==ze){var Tt=wt(Qe<0?e.line:e.rest[Qe]),Ut=nt[ft]+et;return(et<0||dt!=je)&&(Ut=nt[ft+(et?1:0)]),_e(Tt,Ut)}}}var ie=ee(_,K,n);if(ie)return Wn(ie,i);for(var me=K.nextSibling,he=_?_.nodeValue.length-n:0;me;me=me.nextSibling){if(ie=ee(me,me.firstChild,0),ie)return Wn(_e(ie.line,ie.ch-he),i);he+=me.textContent.length}for(var Se=K.previousSibling,Oe=n;Se;Se=Se.previousSibling){if(ie=ee(Se,Se.firstChild,-1),ie)return Wn(_e(ie.line,ie.ch+Oe),i);Oe+=Se.textContent.length}}var Gt=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new $,this.hasSelection=!1,this.composing=null};Gt.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),b&&(i.style.width="0px"),ye(i,"input",function(){N&&k>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()}),ye(i,"paste",function(_){if(Ie(r,_)||Cs(_,r))return;r.state.pasteIncoming=+new Date,n.fastPoll()});function T(_){if(Ie(r,_))return;if(r.somethingSelected())ta({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var K=Ds(r);ta({lineWise:!0,text:K.text}),_.type=="cut"?r.setSelections(K.ranges,null,pe):(n.prevInput="",i.value=K.text.join(`
`),Q(i))}else return;_.type=="cut"&&(r.state.cutIncoming=+new Date)}ye(i,"cut",T),ye(i,"copy",T),ye(e.scroller,"paste",function(_){if(Fr(e,_)||Ie(r,_))return;if(!i.dispatchEvent){r.state.pasteIncoming=+new Date,n.focus();return}var K=new Event("paste");K.clipboardData=_.clipboardData,i.dispatchEvent(K)}),ye(e.lineSpace,"selectstart",function(_){Fr(e,_)||Y(_)}),ye(i,"compositionstart",function(){var _=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:_,range:r.markText(_,r.getCursor("to"),{className:"CodeMirror-composing"})}}),ye(i,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},Gt.prototype.createField=function(e){this.wrapper=Rs(),this.textarea=this.wrapper.firstChild},Gt.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Gt.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=vo(e);if(e.options.moveInputWithCursor){var i=Dr(e,n.sel.primary().head,"div"),T=t.wrapper.getBoundingClientRect(),_=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+_.top-T.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+_.left-T.left))}return r},Gt.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")},Gt.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&&Q(this.textarea),N&&k>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",N&&k>=9&&(this.hasSelection=null))},Gt.prototype.getField=function(){return this.textarea},Gt.prototype.supportsTouch=function(){return!1},Gt.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!a||I()!=this.textarea))try{this.textarea.focus()}catch(e){}},Gt.prototype.blur=function(){this.textarea.blur()},Gt.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Gt.prototype.receivedFocus=function(){this.slowPoll()},Gt.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()})},Gt.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)},Gt.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||it(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(N&&k>=9&&this.hasSelection===i||l&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var T=i.charCodeAt(0);if(T==8203&&!r&&(r="\u200B"),T==8666)return this.reset(),this.cm.execCommand("undo")}for(var _=0,K=Math.min(r.length,i.length);_<K&&r.charCodeAt(_)==i.charCodeAt(_);)++_;return gr(t,function(){Ha(t,i.slice(_),r.length-_,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},Gt.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Gt.prototype.onKeyPress=function(){N&&k>=9&&(this.hasSelection=null),this.fastPoll()},Gt.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var T=hn(n,e),_=r.scroller.scrollTop;if(!T||v)return;var K=n.options.resetSelectionOnContextMenu;K&&n.doc.sel.contains(T)==-1&&Jt(n,or)(n.doc,Jr(T),pe);var G=i.style.cssText,V=t.wrapper.style.cssText,ee=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",i.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(e.clientY-ee.top-5)+"px; left: "+(e.clientX-ee.left-5)+`px;
z-index: 1000; background: `+(N?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var ie;O&&(ie=window.scrollY),r.input.focus(),O&&window.scrollTo(null,ie),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=he,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll);function me(){if(i.selectionStart!=null){var Oe=n.somethingSelected(),je="\u200B"+(Oe?i.value:"");i.value="\u21DA",i.value=je,t.prevInput=Oe?"":"\u200B",i.selectionStart=1,i.selectionEnd=je.length,r.selForContextMenu=n.doc.sel}}function he(){if(t.contextMenuPending!=he)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=V,i.style.cssText=G,N&&k<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=_),i.selectionStart!=null){(!N||N&&k<9)&&me();var Oe=0,je=function(){r.selForContextMenu==n.doc.sel&&i.selectionStart==0&&i.selectionEnd>0&&t.prevInput=="\u200B"?Jt(n,Yo)(n):Oe++<10?r.detectingSelectAll=setTimeout(je,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(je,200)}}if(N&&k>=9&&me(),D){re(e);var Se=function(){Ge(window,"mouseup",Se),setTimeout(he,20)};ye(window,"mouseup",Se)}else setTimeout(he,50)},Gt.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Gt.prototype.setUneditable=function(){},Gt.prototype.needsContentAttribute=!1;function nu(e,t){if(t=t?U(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=I();t.autofocus=n==e||e.getAttribute("autofocus")!=null&&n==document.body}function r(){e.value=K.getValue()}var i;if(e.form&&(ye(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var T=e.form;i=T.submit;try{var _=T.submit=function(){r(),T.submit=i,T.submit(),T.submit=_}}catch(G){}}t.finishInit=function(G){G.save=r,G.getTextArea=function(){return e},G.toTextArea=function(){G.toTextArea=isNaN,r(),e.parentNode.removeChild(G.getWrapperElement()),e.style.display="",e.form&&(Ge(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=i))}},e.style.display="none";var K=jt(function(G){return e.parentNode.insertBefore(G,e.nextSibling)},t);return K}function iu(e){e.off=Ge,e.on=ye,e.wheelEventPixels=cl,e.Doc=fr,e.splitLines=ot,e.countColumn=X,e.findColumn=fe,e.isWordChar=Re,e.Pass=Te,e.signal=ve,e.Line=Vr,e.changeEnd=Zr,e.scrollbarModel=Co,e.Pos=_e,e.cmpPos=pt,e.modes=bt,e.mimeModes=at,e.resolveMode=Rt,e.getMode=Ht,e.modeExtensions=nr,e.extendMode=yr,e.copyState=xr,e.startState=Ft,e.innerMode=Ir,e.commands=xi,e.keyMap=jr,e.keyName=cs,e.isModifierKey=us,e.lookupKey=Un,e.normalizeKeyMap=Pl,e.StringStream=mt,e.SharedTextMarker=yi,e.TextMarker=$r,e.LineWidget=vi,e.e_preventDefault=Y,e.e_stopPropagation=J,e.e_stop=re,e.addClass=B,e.contains=p,e.rmClass=f,e.keyNames=en}Yl(jt),$l(jt);var au="iter insert remove copy getEditor constructor".split(" ");for(var na in fr.prototype)fr.prototype.hasOwnProperty(na)&&ne(au,na)<0&&(jt.prototype[na]=function(e){return function(){return e.apply(this.doc,arguments)}}(fr.prototype[na]));return oe(fr),jt.inputStyles={textarea:Gt,contenteditable:kt},jt.defineMode=function(e){!jt.defaults.mode&&e!="null"&&(jt.defaults.mode=e),Et.apply(this,arguments)},jt.defineMIME=Lt,jt.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),jt.defineMIME("text/plain","null"),jt.defineExtension=function(e,t){jt.prototype[e]=t},jt.defineDocExtension=function(e,t){fr.prototype[e]=t},jt.fromTextArea=nu,iu(jt),jt.version="5.58.2",jt})},W6BS:function(xe,be){xe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAA4CAYAAACohjseAAAVs0lEQVRoQ+2aa6xlZ3nff++677Xv+9zPHM/YHo+xwQ4E14GKKESkiFsSM8bY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+1z/bo/em6/S/84pmg89zwPrj/COd55mMDkirNWwkx3G0QsUB2/Ba57jjq0OZTxGOS46ryYJ82jApetPcTDYJ6yt4tshtVoIuUMz7NI/HqJ1SthscMfOHZy9+y62trbwPO/WbuHf3z7TmvlcLDVmMBgwHIwYjSbMJ3Nm0ZxI5p3JjHk6RkbCgVfDsgN8ArP3N5juM5jdJD26xrOjq9TzCcfzkGYYcXrrbTz6xDs5OrrMeHzIjck+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(xe,be,z){xe.exports=z.p+"static/mainbanner.0a951716.jpg"},Y1PL:function(xe,be,z){"use strict";z.r(be),z.d(be,"ResizableTextArea",function(){return ne});var Z=z("wx14"),H=z("1OyB"),w=z("vuIU"),W=z("Ji7U"),P=z("LK+K"),M=z("cDcd"),N=z("VTBJ"),k=z("rePB"),O=z("Zm9Q"),R=z("Kwbf"),h=z("c+Xe"),v=z("m+aA"),L=z("bdgK"),S=new Map;function E(pe){pe.forEach(function(de){var ce,fe=de.target;(ce=S.get(fe))===null||ce===void 0||ce.forEach(function(te){return te(fe)})})}var b=new L.default(E),d=null,a=null;function l(pe,de){S.has(pe)||(S.set(pe,new Set),b.observe(pe)),S.get(pe).add(de)}function u(pe,de){S.has(pe)&&(S.get(pe).delete(de),S.get(pe).size||(b.unobserve(pe),S.delete(pe)))}var C=function(pe){Object(W.a)(ce,pe);var de=Object(P.a)(ce);function ce(){return Object(H.a)(this,ce),de.apply(this,arguments)}return Object(w.a)(ce,[{key:"render",value:function(){return this.props.children}}]),ce}(M.Component),g=M.createContext(null);function m(pe){var de=pe.children,ce=pe.onBatchResize,fe=M.useRef(0),te=M.useRef([]),se=M.useContext(g),Ee=M.useCallback(function(ke,Le,We){fe.current+=1;var Xe=fe.current;te.current.push({size:ke,element:Le,data:We}),Promise.resolve().then(function(){Xe===fe.current&&(ce==null||ce(te.current),te.current=[])}),se==null||se(ke,Le,We)},[ce,se]);return M.createElement(g.Provider,{value:Ee},de)}function D(pe){var de=pe.children,ce=pe.disabled,fe=M.useRef(null),te=M.useRef(null),se=M.useContext(g),Ee=M.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),ke=M.isValidElement(de)&&Object(h.c)(de),Le=ke?de.ref:null,We=M.useMemo(function(){return Object(h.a)(Le,fe)},[Le,fe]),Xe=M.useRef(pe);Xe.current=pe;var we=M.useCallback(function(Re){var De=Xe.current,He=De.onResize,Ve=De.data,Ce=Re.getBoundingClientRect(),Me=Ce.width,qe=Ce.height,tt=Re.offsetWidth,Ke=Re.offsetHeight,Ne=Math.floor(Me),rt=Math.floor(qe);if(Ee.current.width!==Ne||Ee.current.height!==rt||Ee.current.offsetWidth!==tt||Ee.current.offsetHeight!==Ke){var Je={width:Ne,height:rt,offsetWidth:tt,offsetHeight:Ke};Ee.current=Je;var Ze=tt===Math.round(Me)?Me:tt,ye=Ke===Math.round(qe)?qe:Ke,$e=Object(N.a)(Object(N.a)({},Je),{},{offsetWidth:Ze,offsetHeight:ye});se==null||se($e,Re,Ve),He&&Promise.resolve().then(function(){He($e,Re)})}},[]);return M.useEffect(function(){var Re=Object(v.a)(fe.current)||Object(v.a)(te.current);return Re&&!ce&&l(Re,we),function(){return u(Re,we)}},[fe.current,ce]),M.createElement(C,{ref:te},ke?M.cloneElement(de,{ref:We}):de)}var A="rc-observer-key";function f(pe){var de=pe.children,ce=Object(O.a)(de);return ce.map(function(fe,te){var se=(fe==null?void 0:fe.key)||"".concat(A,"-").concat(te);return M.createElement(D,Object(Z.a)({},pe,{key:se}),fe)})}f.Collection=m;var c=f,s=z("bT9E"),o=z("TSYQ"),x=z.n(o),y=`
min-height:0 !important;
max-height:none !important;
height:0 !important;
visibility:hidden !important;
overflow:hidden !important;
position:absolute !important;
z-index:-1000 !important;
top:0 !important;
right:0 !important
`,p=["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"],I={},B;function F(pe){var de=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ce=pe.getAttribute("id")||pe.getAttribute("data-reactid")||pe.getAttribute("name");if(de&&I[ce])return I[ce];var fe=window.getComputedStyle(pe),te=fe.getPropertyValue("box-sizing")||fe.getPropertyValue("-moz-box-sizing")||fe.getPropertyValue("-webkit-box-sizing"),se=parseFloat(fe.getPropertyValue("padding-bottom"))+parseFloat(fe.getPropertyValue("padding-top")),Ee=parseFloat(fe.getPropertyValue("border-bottom-width"))+parseFloat(fe.getPropertyValue("border-top-width")),ke=p.map(function(We){return"".concat(We,":").concat(fe.getPropertyValue(We))}).join(";"),Le={sizingStyle:ke,paddingSize:se,borderSize:Ee,boxSizing:te};return de&&ce&&(I[ce]=Le),Le}function Q(pe){var de=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ce=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,fe=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;B||(B=document.createElement("textarea"),B.setAttribute("tab-index","-1"),B.setAttribute("aria-hidden","true"),document.body.appendChild(B)),pe.getAttribute("wrap")?B.setAttribute("wrap",pe.getAttribute("wrap")):B.removeAttribute("wrap");var te=F(pe,de),se=te.paddingSize,Ee=te.borderSize,ke=te.boxSizing,Le=te.sizingStyle;B.setAttribute("style","".concat(Le,";").concat(y)),B.value=pe.value||pe.placeholder||"";var We=Number.MIN_SAFE_INTEGER,Xe=Number.MAX_SAFE_INTEGER,we=B.scrollHeight,Re;if(ke==="border-box"?we+=Ee:ke==="content-box"&&(we-=se),ce!==null||fe!==null){B.value=" ";var De=B.scrollHeight-se;ce!==null&&(We=De*ce,ke==="border-box"&&(We=We+se+Ee),we=Math.max(We,we)),fe!==null&&(Xe=De*fe,ke==="border-box"&&(Xe=Xe+se+Ee),Re=we>Xe?"":"hidden",we=Math.min(Xe,we))}return{height:we,minHeight:We,maxHeight:Xe,overflowY:Re,resize:"none"}}var j=z("Gytx"),U=z.n(j),X;(function(pe){pe[pe.NONE=0]="NONE",pe[pe.RESIZING=1]="RESIZING",pe[pe.RESIZED=2]="RESIZED"})(X||(X={}));var $=function(pe){Object(W.a)(ce,pe);var de=Object(P.a)(ce);function ce(fe){var te;return Object(H.a)(this,ce),te=de.call(this,fe),te.nextFrameActionId=void 0,te.resizeFrameId=void 0,te.textArea=void 0,te.saveTextArea=function(se){te.textArea=se},te.handleResize=function(se){var Ee=te.state.resizeStatus,ke=te.props,Le=ke.autoSize,We=ke.onResize;if(Ee!==X.NONE)return;typeof We=="function"&&We(se),Le&&te.resizeOnNextFrame()},te.resizeOnNextFrame=function(){cancelAnimationFrame(te.nextFrameActionId),te.nextFrameActionId=requestAnimationFrame(te.resizeTextarea)},te.resizeTextarea=function(){var se=te.props.autoSize;if(!se||!te.textArea)return;var Ee=se.minRows,ke=se.maxRows,Le=Q(te.textArea,!1,Ee,ke);te.setState({textareaStyles:Le,resizeStatus:X.RESIZING},function(){cancelAnimationFrame(te.resizeFrameId),te.resizeFrameId=requestAnimationFrame(function(){te.setState({resizeStatus:X.RESIZED},function(){te.resizeFrameId=requestAnimationFrame(function(){te.setState({resizeStatus:X.NONE}),te.fixFirefoxAutoScroll()})})})})},te.renderTextArea=function(){var se=te.props,Ee=se.prefixCls,ke=Ee===void 0?"rc-textarea":Ee,Le=se.autoSize,We=se.onResize,Xe=se.className,we=se.disabled,Re=te.state,De=Re.textareaStyles,He=Re.resizeStatus,Ve=Object(s.a)(te.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Ce=x()(ke,Xe,Object(k.a)({},"".concat(ke,"-disabled"),we));"value"in Ve&&(Ve.value=Ve.value||"");var Me=Object(N.a)(Object(N.a)(Object(N.a)({},te.props.style),De),He===X.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return M.createElement(c,{onResize:te.handleResize,disabled:!(Le||We)},M.createElement("textarea",Object(Z.a)({},Ve,{className:Ce,style:Me,ref:te.saveTextArea})))},te.state={textareaStyles:{},resizeStatus:X.NONE},te}return Object(w.a)(ce,[{key:"componentDidUpdate",value:function(te){(te.value!==this.props.value||!U()(te.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 te=this.textArea.selectionStart,se=this.textArea.selectionEnd;this.textArea.setSelectionRange(te,se)}}catch(Ee){}}},{key:"render",value:function(){return this.renderTextArea()}}]),ce}(M.Component),ne=$,ue=function(pe){Object(W.a)(ce,pe);var de=Object(P.a)(ce);function ce(fe){var te;Object(H.a)(this,ce),te=de.call(this,fe),te.resizableTextArea=void 0,te.focus=function(){te.resizableTextArea.textArea.focus()},te.saveTextArea=function(Ee){te.resizableTextArea=Ee},te.handleChange=function(Ee){var ke=te.props.onChange;te.setValue(Ee.target.value,function(){te.resizableTextArea.resizeTextarea()}),ke&&ke(Ee)},te.handleKeyDown=function(Ee){var ke=te.props,Le=ke.onPressEnter,We=ke.onKeyDown;Ee.keyCode===13&&Le&&Le(Ee),We&&We(Ee)};var se=typeof fe.value=="undefined"||fe.value===null?fe.defaultValue:fe.value;return te.state={value:se},te}return Object(w.a)(ce,[{key:"setValue",value:function(te,se){"value"in this.props||this.setState({value:te},se)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return M.createElement(ne,Object(Z.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(te){return"value"in te?{value:te.value}:null}}]),ce}(M.Component),Te=be.default=ue},ZpRC:function(xe,be,z){"use strict";function Z(h){return typeof h=="object"&&h!=null&&h.nodeType===1}function H(h,v){return(!v||h!=="hidden")&&h!=="visible"&&h!=="clip"}function w(h,v){if(h.clientHeight<h.scrollHeight||h.clientWidth<h.scrollWidth){var L=getComputedStyle(h,null);return H(L.overflowY,v)||H(L.overflowX,v)||function(S){var E=function(b){if(!b.ownerDocument||!b.ownerDocument.defaultView)return null;try{return b.ownerDocument.defaultView.frameElement}catch(d){return null}}(S);return!!E&&(E.clientHeight<S.scrollHeight||E.clientWidth<S.scrollWidth)}(h)}return!1}function W(h,v,L,S,E,b,d,a){return b<h&&d>v||b>h&&d<v?0:b<=h&&a<=L||d>=v&&a>=L?b-h-S:d>v&&a<L||b<h&&a>L?d-v+E:0}var P=function(h,v){var L=window,S=v.scrollMode,E=v.block,b=v.inline,d=v.boundary,a=v.skipOverflowHiddenElements,l=typeof d=="function"?d:function(De){return De!==d};if(!Z(h))throw new TypeError("Invalid target");for(var u=document.scrollingElement||document.documentElement,C=[],g=h;Z(g)&&l(g);){if((g=g.parentElement)===u){C.push(g);break}g!=null&&g===document.body&&w(g)&&!w(document.documentElement)||g!=null&&w(g,a)&&C.push(g)}for(var m=L.visualViewport?L.visualViewport.width:innerWidth,D=L.visualViewport?L.visualViewport.height:innerHeight,A=window.scrollX||pageXOffset,f=window.scrollY||pageYOffset,c=h.getBoundingClientRect(),s=c.height,o=c.width,x=c.top,y=c.right,p=c.bottom,I=c.left,B=E==="start"||E==="nearest"?x:E==="end"?p:x+s/2,F=b==="center"?I+o/2:b==="end"?y:I,Q=[],j=0;j<C.length;j++){var U=C[j],X=U.getBoundingClientRect(),$=X.height,ne=X.width,ue=X.top,Te=X.right,pe=X.bottom,de=X.left;if(S==="if-needed"&&x>=0&&I>=0&&p<=D&&y<=m&&x>=ue&&p<=pe&&I>=de&&y<=Te)return Q;var ce=getComputedStyle(U),fe=parseInt(ce.borderLeftWidth,10),te=parseInt(ce.borderTopWidth,10),se=parseInt(ce.borderRightWidth,10),Ee=parseInt(ce.borderBottomWidth,10),ke=0,Le=0,We="offsetWidth"in U?U.offsetWidth-U.clientWidth-fe-se:0,Xe="offsetHeight"in U?U.offsetHeight-U.clientHeight-te-Ee:0;if(u===U)ke=E==="start"?B:E==="end"?B-D:E==="nearest"?W(f,f+D,D,te,Ee,f+B,f+B+s,s):B-D/2,Le=b==="start"?F:b==="center"?F-m/2:b==="end"?F-m:W(A,A+m,m,fe,se,A+F,A+F+o,o),ke=Math.max(0,ke+f),Le=Math.max(0,Le+A);else{ke=E==="start"?B-ue-te:E==="end"?B-pe+Ee+Xe:E==="nearest"?W(ue,pe,$,te,Ee+Xe,B,B+s,s):B-(ue+$/2)+Xe/2,Le=b==="start"?F-de-fe:b==="center"?F-(de+ne/2)+We/2:b==="end"?F-Te+se+We:W(de,Te,ne,fe,se+We,F,F+o,o);var we=U.scrollLeft,Re=U.scrollTop;B+=Re-(ke=Math.max(0,Math.min(Re+ke,U.scrollHeight-$+Xe))),F+=we-(Le=Math.max(0,Math.min(we+Le,U.scrollWidth-ne+We)))}Q.push({el:U,top:ke,left:Le})}return Q};function M(h){return h===Object(h)&&Object.keys(h).length!==0}function N(h,v){v===void 0&&(v="auto");var L="scrollBehavior"in document.body.style;h.forEach(function(S){var E=S.el,b=S.top,d=S.left;E.scroll&&L?E.scroll({top:b,left:d,behavior:v}):(E.scrollTop=b,E.scrollLeft=d)})}function k(h){return h===!1?{block:"end",inline:"nearest"}:M(h)?h:{block:"start",inline:"nearest"}}function O(h,v){var L=!h.ownerDocument.documentElement.contains(h);if(M(v)&&typeof v.behavior=="function")return v.behavior(L?[]:P(h,v));if(L)return;var S=k(v);return N(P(h,S),S.behavior)}var R=be.a=O},aRTE:function(xe,be){xe.exports={L:1,M:0,Q:3,H:2}},bT9E:function(xe,be,z){"use strict";z.d(be,"a",function(){return H});var Z=z("VTBJ");function H(w,W){var P=Object(Z.a)({},w);return Array.isArray(W)&&W.forEach(function(M){delete P[M]}),P}},c5Ni:function(xe,be,z){},cRFk:function(xe,be,z){xe.exports=z.p+"static/RepositoryNoneData.828085a8.png"},csWT:function(xe,be,z){xe.exports=z.p+"static/choose.4ad1045f.svg"},dQei:function(xe,be){for(var z={glog:function(H){if(H<1)throw new Error("glog("+H+")");return z.LOG_TABLE[H]},gexp:function(H){for(;H<0;)H+=255;for(;H>=256;)H-=255;return z.EXP_TABLE[H]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},Z=0;Z<8;Z++)z.EXP_TABLE[Z]=1<<Z;for(var Z=8;Z<256;Z++)z.EXP_TABLE[Z]=z.EXP_TABLE[Z-4]^z.EXP_TABLE[Z-5]^z.EXP_TABLE[Z-6]^z.EXP_TABLE[Z-8];for(var Z=0;Z<255;Z++)z.LOG_TABLE[z.EXP_TABLE[Z]]=Z;xe.exports=z},dWSS:function(xe,be,z){var Z=z("dQei");function H(w,W){if(w.length==null)throw new Error(w.length+"/"+W);for(var P=0;P<w.length&&w[P]==0;)P++;this.num=new Array(w.length-P+W);for(var M=0;M<w.length-P;M++)this.num[M]=w[M+P]}H.prototype={get:function(w){return this.num[w]},getLength:function(){return this.num.length},multiply:function(w){for(var W=new Array(this.getLength()+w.getLength()-1),P=0;P<this.getLength();P++)for(var M=0;M<w.getLength();M++)W[P+M]^=Z.gexp(Z.glog(this.get(P))+Z.glog(w.get(M)));return new H(W,0)},mod:function(w){if(this.getLength()-w.getLength()<0)return this;for(var W=Z.glog(this.get(0))-Z.glog(w.get(0)),P=new Array(this.getLength()),M=0;M<this.getLength();M++)P[M]=this.get(M);for(var M=0;M<w.getLength();M++)P[M]^=Z.gexp(Z.glog(w.get(M))+W);return new H(P,0).mod(w)}},xe.exports=H},dejd:function(xe,be,z){},djh8:function(xe,be,z){xe.exports=z.p+"static/qrCode.42927872.png"},dmUQ:function(xe,be,z){"use strict";var Z=z("Ff2n"),H=z("rePB"),w=z("1OyB"),W=z("vuIU"),P=z("Ji7U"),M=z("md7G"),N=z("foSv"),k=z("cDcd"),O=z.n(k),R=z("TSYQ"),h=z.n(R),v=z("4IlW");function L(s,o){var x=Object.keys(s);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(s);o&&(y=y.filter(function(p){return Object.getOwnPropertyDescriptor(s,p).enumerable})),x.push.apply(x,y)}return x}function S(s){for(var o=1;o<arguments.length;o++){var x=arguments[o]!=null?arguments[o]:{};o%2?L(Object(x),!0).forEach(function(y){Object(H.a)(s,y,x[y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(x)):L(Object(x)).forEach(function(y){Object.defineProperty(s,y,Object.getOwnPropertyDescriptor(x,y))})}return s}function E(s){var o=b();return function(){var y=Object(N.a)(s),p;if(o){var I=Object(N.a)(this).constructor;p=Reflect.construct(y,arguments,I)}else p=y.apply(this,arguments);return Object(M.a)(this,p)}}function b(){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 a(s){s.preventDefault()}var l=function(o){return o.replace(/[^\w.-]+/g,"")},u=200,C=600,g=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,m=function(o){return o!=null},D=function(o,x){return x===o||typeof x=="number"&&typeof o=="number"&&isNaN(x)&&isNaN(o)},A=function(s){Object(P.a)(x,s);var o=E(x);function x(y){var p;Object(w.a)(this,x),p=o.call(this,y),p.onKeyDown=function(F){var Q=p.props,j=Q.onKeyDown,U=Q.onPressEnter;if(F.keyCode===v.a.UP){var X=p.getRatio(F);p.up(F,X,null),p.stop()}else if(F.keyCode===v.a.DOWN){var $=p.getRatio(F);p.down(F,$,null),p.stop()}else F.keyCode===v.a.ENTER&&U&&U(F);if(p.recordCursorPosition(),p.lastKeyCode=F.keyCode,j){for(var ne=arguments.length,ue=new Array(ne>1?ne-1:0),Te=1;Te<ne;Te++)ue[Te-1]=arguments[Te];j.apply(void 0,[F].concat(ue))}},p.onKeyUp=function(F){var Q=p.props.onKeyUp;if(p.stop(),p.recordCursorPosition(),Q){for(var j=arguments.length,U=new Array(j>1?j-1:0),X=1;X<j;X++)U[X-1]=arguments[X];Q.apply(void 0,[F].concat(U))}},p.onChange=function(F){var Q=p.props.onChange;p.state.focused&&(p.inputting=!0),p.rawInput=p.props.parser(p.getValueFromEvent(F)),p.setState({inputValue:p.rawInput}),Q(p.toNumber(p.rawInput))},p.onMouseUp=function(){var F=p.props.onMouseUp;p.recordCursorPosition(),F&&F.apply(void 0,arguments)},p.onFocus=function(){var F;p.setState({focused:!0}),(F=p.props).onFocus.apply(F,arguments)},p.onBlur=function(){var F=p.props.onBlur;p.inputting=!1,p.setState({focused:!1});var Q=p.getCurrentValidValue(p.state.inputValue),j=p.setValue(Q,d);if(F){var U=p.input.value,X=p.getInputDisplayValue({focus:!1,value:j});p.input.value=X&&Number(X),F.apply(void 0,arguments),p.input.value=U}},p.getRatio=function(F){var Q=1;return F.metaKey||F.ctrlKey?Q=.1:F.shiftKey&&(Q=10),Q},p.getFullNum=function(F){return isNaN(F)?F:/e/i.test(String(F))?Number(F).toFixed(18).replace(/\.?0+$/,""):F},p.getPrecision=function(F){if(m(p.props.precision))return p.props.precision;var Q=String(F);if(Q.indexOf("e-")>=0)return parseInt(Q.slice(Q.indexOf("e-")+2),10);var j=0;return Q.indexOf(".")>=0&&(j=Q.length-Q.indexOf(".")-1),j},p.getInputDisplayValue=function(F){var Q=F||p.state,j=Q.focused,U=Q.inputValue,X=Q.value,$;j?$=U:$=p.toPrecisionAsStep(X),$==null&&($="");var ne=p.formatWrapper($);return m(p.props.decimalSeparator)&&(ne=ne.toString().replace(".",p.props.decimalSeparator)),ne},p.recordCursorPosition=function(){try{p.cursorStart=p.input.selectionStart,p.cursorEnd=p.input.selectionEnd,p.currentValue=p.input.value,p.cursorBefore=p.input.value.substring(0,p.cursorStart),p.cursorAfter=p.input.value.substring(p.cursorEnd)}catch(F){}},p.restoreByAfter=function(F){if(F===void 0)return!1;var Q=p.input.value,j=Q.lastIndexOf(F);if(j===-1)return!1;var U=p.cursorBefore.length;return p.lastKeyCode===v.a.DELETE&&p.cursorBefore.charAt(U-1)===F[0]?(p.fixCaret(U,U),!0):j+F.length===Q.length?(p.fixCaret(j,j),!0):!1},p.partRestoreByAfter=function(F){return F===void 0?!1:Array.prototype.some.call(F,function(Q,j){var U=F.substring(j);return p.restoreByAfter(U)})},p.isNotCompleteNumber=function(F){return isNaN(F)||F===""||F===null||F&&F.toString().indexOf(".")===F.toString().length-1},p.stop=function(){p.autoStepTimer&&clearTimeout(p.autoStepTimer)},p.down=function(F,Q,j){p.pressingUpOrDown=!0,p.step("down",F,Q,j)},p.up=function(F,Q,j){p.pressingUpOrDown=!0,p.step("up",F,Q,j)},p.saveInput=function(F){p.input=F};var I=y.value;I===void 0&&(I=y.defaultValue),p.state={focused:y.autoFocus};var B=p.getValidValue(p.toNumber(I));return p.state=S(S({},p.state),{},{inputValue:p.toPrecisionAsStep(B),value:B}),p}return Object(W.a)(x,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(p){var I=this.props,B=I.value,F=I.onChange,Q=I.max,j=I.min,U=this.state.focused;if(p){if(!D(p.value,B)||!D(p.max,Q)||!D(p.min,j)){var X=U?B:this.getValidValue(B),$;this.pressingUpOrDown?$=X:this.inputting?$=this.rawInput:$=this.toPrecisionAsStep(X),this.setState({value:X,inputValue:$})}var ne="value"in this.props?B:this.state.value;"max"in this.props&&p.max!==Q&&typeof ne=="number"&&ne>Q&&F&&F(Q),"min"in this.props&&p.min!==j&&typeof ne=="number"&&ne<j&&F&&F(j)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var ue=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===v.a.BACKSPACE?ue=this.cursorStart-1:this.lastKeyCode===v.a.DELETE&&(ue=this.cursorStart):ue=this.input.value.length,this.fixCaret(ue,ue)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case v.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case v.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(Te){}if(this.lastKeyCode=null,!this.pressingUpOrDown)return;this.props.focusOnUpDown&&this.state.focused&&(document.activeElement!==this.input&&this.focus())}},{key:"componentWillUnmount",value:function(){this.stop()}},{key:"getCurrentValidValue",value:function(p){var I=p;return I===""?I="":this.isNotCompleteNumber(parseFloat(I))?I=this.state.value:I=this.getValidValue(I),this.toNumber(I)}},{key:"getValueFromEvent",value:function(p){var I=p.target.value.trim().replace(/。/g,".");return m(this.props.decimalSeparator)&&(I=I.replace(this.props.decimalSeparator,".")),I}},{key:"getValidValue",value:function(p){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,B=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,F=parseFloat(p);return isNaN(F)?p:(F<I&&(F=I),F>B&&(F=B),F)}},{key:"setValue",value:function(p,I){var B=this.props.precision,F=this.isNotCompleteNumber(parseFloat(p))?null:parseFloat(p),Q=this.state.value,j=Q===void 0?null:Q,U=this.state.inputValue,X=U===void 0?null:U,$=typeof F=="number"?F.toFixed(B):"".concat(F),ne=F!==j||$!=="".concat(X);return"value"in this.props?(X=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:X},I)):this.setState({value:F,inputValue:this.toPrecisionAsStep(p)},I),ne&&this.props.onChange(F),F}},{key:"getMaxPrecision",value:function(p){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,B=this.props,F=B.precision,Q=B.step;if(m(F))return F;var j=this.getPrecision(I),U=this.getPrecision(Q),X=this.getPrecision(p);return p?Math.max(X,j+U):j+U}},{key:"getPrecisionFactor",value:function(p){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,B=this.getMaxPrecision(p,I);return Math.pow(10,B)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(p){return this.props.formatter?this.props.formatter(p):p}},{key:"toPrecisionAsStep",value:function(p){if(this.isNotCompleteNumber(p)||p==="")return p;var I=Math.abs(this.getMaxPrecision(p));return isNaN(I)?p.toString():Number(p).toFixed(I)}},{key:"toNumber",value:function(p){var I=this.props.precision,B=this.state.focused,F=p&&p.length>16&&B;return this.isNotCompleteNumber(p)||F?p:m(I)?Math.round(p*Math.pow(10,I))/Math.pow(10,I):Number(p)}},{key:"upStep",value:function(p,I){var B=this.props.step,F=this.getPrecisionFactor(p,I),Q=Math.abs(this.getMaxPrecision(p,I)),j=((F*p+F*B*I)/F).toFixed(Q);return this.toNumber(j)}},{key:"downStep",value:function(p,I){var B=this.props.step,F=this.getPrecisionFactor(p,I),Q=Math.abs(this.getMaxPrecision(p,I)),j=((F*p-F*B*I)/F).toFixed(Q);return this.toNumber(j)}},{key:"step",value:function(p,I){var B=this,F=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,Q=arguments.length>3?arguments[3]:void 0;this.stop(),I&&(I.persist(),I.preventDefault());var j=this.props;if(j.disabled)return;var U=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(U))return;var X=this["".concat(p,"Step")](U,F),$=X>j.max||X<j.min;if(X>j.max?X=j.max:X<j.min&&(X=j.min),this.setValue(X,null),this.setState({focused:!0},function(){B.pressingUpOrDown=!1}),$)return;this.autoStepTimer=setTimeout(function(){B[p](I,F,!0)},Q?u:C)}},{key:"fixCaret",value:function(p,I){if(p===void 0||I===void 0||!this.input||!this.input.value)return;try{var B=this.input.selectionStart,F=this.input.selectionEnd;(p!==B||I!==F)&&this.input.setSelectionRange(p,I)}catch(Q){}}},{key:"render",value:function(){var p,I=this.props,B=I.prefixCls,F=I.disabled,Q=I.readOnly,j=I.useTouch,U=I.autoComplete,X=I.upHandler,$=I.downHandler,ne=I.className,ue=I.max,Te=I.min,pe=I.style,de=I.title,ce=I.onMouseEnter,fe=I.onMouseLeave,te=I.onMouseOver,se=I.onMouseOut,Ee=I.required,ke=I.onClick,Le=I.tabIndex,We=I.type,Xe=I.placeholder,we=I.id,Re=I.inputMode,De=I.pattern,He=I.step,Ve=I.maxLength,Ce=I.autoFocus,Me=I.name,qe=I.onPaste,tt=I.onInput,Ke=Object(Z.a)(I,["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"]),Ne=this.state,rt=Ne.value,Je=Ne.focused,Ze=h()(B,(p={},Object(H.a)(p,ne,!!ne),Object(H.a)(p,"".concat(B,"-disabled"),F),Object(H.a)(p,"".concat(B,"-focused"),Je),p)),ye={};Object.keys(Ke).forEach(function(re){(re.substr(0,5)==="data-"||re.substr(0,5)==="aria-"||re==="role")&&(ye[re]=Ke[re])});var $e=!Q&&!F,Ge=this.getInputDisplayValue(null),ve=(rt||rt===0)&&(isNaN(rt)||Number(rt)>=ue),Ie=(rt||rt===0)&&(isNaN(rt)||Number(rt)<=Te),le=ve||F||Q,ae=Ie||F||Q,oe=h()("".concat(B,"-handler"),"".concat(B,"-handler-up"),Object(H.a)({},"".concat(B,"-handler-up-disabled"),le)),Y=h()("".concat(B,"-handler"),"".concat(B,"-handler-down"),Object(H.a)({},"".concat(B,"-handler-down-disabled"),ae)),J=j?{onTouchStart:le?d:this.up,onTouchEnd:this.stop}:{onMouseDown:le?d:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},q=j?{onTouchStart:ae?d:this.down,onTouchEnd:this.stop}:{onMouseDown:ae?d:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return O.a.createElement("div",{className:Ze,style:pe,title:de,onMouseEnter:ce,onMouseLeave:fe,onMouseOver:te,onMouseOut:se,onFocus:function(){return null},onBlur:function(){return null}},O.a.createElement("div",{className:"".concat(B,"-handler-wrap")},O.a.createElement("span",Object.assign({unselectable:"on"},J,{role:"button","aria-label":"Increase Value","aria-disabled":le,className:oe}),X||O.a.createElement("span",{unselectable:"on",className:"".concat(B,"-handler-up-inner"),onClick:a})),O.a.createElement("span",Object.assign({unselectable:"on"},q,{role:"button","aria-label":"Decrease Value","aria-disabled":ae,className:Y}),$||O.a.createElement("span",{unselectable:"on",className:"".concat(B,"-handler-down-inner"),onClick:a}))),O.a.createElement("div",{className:"".concat(B,"-input-wrap")},O.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Te,"aria-valuemax":ue,"aria-valuenow":rt,required:Ee,type:We,placeholder:Xe,onPaste:qe,onClick:ke,onMouseUp:this.onMouseUp,className:"".concat(B,"-input"),tabIndex:Le,autoComplete:U,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:$e?this.onKeyDown:d,onKeyUp:$e?this.onKeyUp:d,autoFocus:Ce,maxLength:Ve,readOnly:Q,disabled:F,max:ue,min:Te,step:He,name:Me,title:de,id:we,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(Ge),pattern:De,inputMode:Re,onInput:tt},ye))))}}]),x}(O.a.Component);A.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:g,min:-g,step:1,style:{},onChange:d,onKeyDown:d,onPressEnter:d,onFocus:d,onBlur:d,parser:l,required:!1,autoComplete:"off"};var f=A,c=be.a=f},f4xo:function(xe,be,z){var Z=z("nVVt");function H(w){this.mode=Z.MODE_8BIT_BYTE,this.data=w}H.prototype={getLength:function(w){return this.data.length},write:function(w){for(var W=0;W<this.data.length;W++)w.put(this.data.charCodeAt(W),8)}},xe.exports=H},is8o:function(xe,be,z){xe.exports={flex_box_center:"flex_box_center___45jij",flex_space_between:"flex_space_between___2rBtS",flex_box_vertical_center:"flex_box_vertical_center___B3dEI",flex_box_center_end:"flex_box_center_end___1hlbx",flex_box_column:"flex_box_column___n3oa5",wrap:"wrap___2Ebga",modal:"modal___37ZgF",titleWrap:"titleWrap___dEwT4",required:"required___4a1a5",title:"title___1MHB3",colorGray:"colorGray___1tQ38",choiceWrap:"choiceWrap___2Ik_w",answer:"answer___3N5FQ",activeAnswer:"activeAnswer___3zdHK",deleteIcon:"deleteIcon___U7nIS",addIcon:"addIcon___2tuSF",editorWrap:"editorWrap___ZOK2K",htmlWrap:"htmlWrap___3X_dl",radio:"radio___wS7N0",color333:"color333___S1zDX",color999:"color999___VJwGv",questionType:"questionType___BHDve",questionChoices:"questionChoices___3YAfc"}},ji0R:function(xe,be,z){xe.exports=z.p+"static/douyu.3e6df9ee.jpg"},kPWJ:function(xe,be,z){xe.exports=z.p+"static/question.cb52bef9.gif"},kPYp:function(xe,be){xe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAF8AAAAUCAYAAADr0+FaAAANEklEQVRYR8WZe5RX1XXHP/vce3/zHoaXgFp5DQyOQLRgUTEtDW1qYyVmZUGNklRdiRpKE3lHfPyc4TngIBgfC0wx1ixt1NRWal2kotbE2lbRiCIISBCGhzDAvGd+87v37K5z5zfDzMCM46pr9fw1a+45+5zz3fvs/d3fn4yr1F8Do0UIUb74UFR8Gm3IO/Wf8MThat7mOYnaD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,be,z){},kvPc:function(xe,be,z){"use strict";z.r(be);var Z=z("5Dmo"),H=z("3S7+"),w=z("P2fV"),W=z("NJEC"),P=z("14J3"),M=z("BMrR"),N=z("jCWc"),k=z("kPKH"),O=z("OaEy"),R=z("2fM7"),h=z("7Kak"),v=z("9yH6"),L=z("+L6B"),S=z("2/Rp"),E=z("5NDa"),b=z("5rEg"),d=z("miYZ"),a=z("tsqr"),l=z("k1fw"),u=z("9og8"),C=z("y8nQ"),g=z("Vl3Y"),m=z("tJVT"),D=z("PpiC"),A=z("WmNS"),f=z.n(A),c=z("cDcd"),s=z.n(c),o=z("9kvl"),x=z("Ot1p"),y=z("HBuW"),p=z("oBTY"),I=z("2qtc"),B=z("kLXV"),F=z("Ty5D"),Q=z("V0Rq"),j=z("9Bee"),U=z("is8o"),X=z.n(U),$=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],ne=function(Le,We){var Xe=Le.problemset,we=Le.globalSetting,Re=Le.loading,De=Le.dispatch,He=Le.onRef,Ve=He===void 0?function(){}:He,Ce=Le.editData,Me=Object(D.a)(Le,["problemset","globalSetting","loading","dispatch","onRef","editData"]),qe=Object(c.useState)([]),tt=Object(m.a)(qe,2),Ke=tt[0],Ne=tt[1],rt=Object(c.useState)(),Je=Object(m.a)(rt,2),Ze=Je[0],ye=Je[1],$e=Object(c.useState)([]),Ge=Object(m.a)($e,2),ve=Ge[0],Ie=Ge[1],le=Object(c.useState)(""),ae=Object(m.a)(le,2),oe=ae[0],Y=ae[1],J=Object(c.useState)(5),q=Object(m.a)(J,2),re=q[0],ge=q[1],Ae=Object(c.useState)(!1),Be=Object(m.a)(Ae,2),lt=Be[0],Pe=Be[1],Ye=Object(F.i)();Object(c.useEffect)(function(){Ne(["","","",""])},[]),Object(c.useEffect)(function(){var Ct,bt;if(!(Ce!=null&&Ce.challenge_id)){Pe(!0);return}Y(Ce==null?void 0:Ce.subject),ge(parseInt(Ce==null?void 0:Ce.question_score)),Ne(Ce==null||((Ct=Ce.choose_contents)===null||Ct===void 0)?void 0:Ct.map(function(Et){return Et.option_name}));var at=[];Ce==null||((bt=Ce.standard_answer)===null||bt===void 0)||bt.split("").map(function(Et,Lt){at.push($.indexOf(Et))}),Ie(at)},[Ce]),Object(c.useImperativeHandle)(We,function(){return{onSave:ot,onReset:ht,isEdit:lt}});var ht=function(){Ne(["","","",""]),Y(""),Ie([])},ot=function(){var Ct=Object(u.a)(f.a.mark(function bt(){var at,Et;return f.a.wrap(function(Rt){for(;;)switch(Rt.prev=Rt.next){case 0:if(oe){Rt.next=3;break}return a.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),Rt.abrupt("return",!1);case 3:if(at=Ke.findIndex(function(Ht){return!Ht}),!(at>-1)){Rt.next=7;break}return a.b.info("\u8BF7\u5148\u8F93\u5165 ".concat($[at]," \u9009\u9879\u7684\u5185\u5BB9")),Rt.abrupt("return",!1);case 7:if(ve.length){Rt.next=10;break}return a.b.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),Rt.abrupt("return",!1);case 10:if(!(ve.length<1)){Rt.next=13;break}return a.b.info("\u8BF7\u9009\u62E9\u7B54\u6848"),Rt.abrupt("return",!1);case 13:return Et=Ke.map(function(Ht,nr){return{choice_text:Ht,is_answer:!!ve.includes(nr)}}),Rt.abrupt("return",{subject:oe,question:{cnt:Et.map(function(Ht){return Ht.choice_text})},choice:{answer:Et.map(function(Ht){return Ht.is_answer})}});case 15:case"end":return Rt.stop()}},bt)}));return function(){return Ct.apply(this,arguments)}}(),it=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu",id:"del"},{name:"\u4E0A\u79FB",icon:"iconfont c-green ml30 icon-shangyi_Hover",id:"up"},{name:"\u4E0B\u79FB",icon:"iconfont c-green ml30 icon-xiayi_moren",id:"down"},{name:"\u7F16\u8F91",icon:"iconfont c-green ml30 icon-bianjishijuan3x",id:"edit"}],Ot=function(){var Ct=Object(u.a)(f.a.mark(function bt(at){return f.a.wrap(function(Lt){for(;;)switch(Lt.prev=Lt.next){case 0:Lt.t0=at.id,Lt.next=Lt.t0==="del"?3:Lt.t0==="up"||Lt.t0==="down"?5:Lt.t0==="edit"?9:11;break;case 3:return B.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u95EE\u9898\u5417\uFF1F",onOk:function(){return Object(u.a)(f.a.mark(function Ht(){return f.a.wrap(function(yr){for(;;)switch(yr.prev=yr.next){case 0:return yr.next=2,Object(Q.n)({id:Ce.question_id});case 2:De({type:"exercise/editExercise",payload:Object(l.a)({},Ye)});case 3:case"end":return yr.stop()}},Ht)}))()}}),Lt.abrupt("break",11);case 5:return Lt.next=7,De({type:"exercise/exeriseMoveUpDown",payload:{id:Ce.question_id,opr:at.id}});case 7:return De({type:"exercise/editExercise",payload:Object(l.a)({},Ye)}),Lt.abrupt("break",11);case 9:return Pe(!0),Lt.abrupt("break",11);case 11:case"end":return Lt.stop()}},bt)}));return function(at){return Ct.apply(this,arguments)}}(),xt=function(){var bt;return s.a.createElement("aside",null,s.a.createElement("p",{className:X.a.titleWrap},s.a.createElement("span",{className:X.a.required},"*"),s.a.createElement("span",{className:X.a.title},"\u9898\u5E72\uFF1A")),s.a.createElement(x.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:oe,onChange:function(Et){return Y(Et)}}),s.a.createElement("p",{className:X.a.titleWrap},s.a.createElement("span",{className:X.a.required},"*"),s.a.createElement("span",{className:X.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",s.a.createElement("span",{className:X.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),Ke.map(function(at,Et){return s.a.createElement("div",{className:X.a.choiceWrap,key:Et},s.a.createElement(H.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},s.a.createElement("div",{className:"".concat(X.a.answer," ").concat(ve.includes(Et)?X.a.activeAnswer:""),onClick:function(){ve.includes(Et)?Ie(ve.filter(function(Rt){return Rt!==Et})):Ie([].concat(Object(p.a)(ve),[Et]))}},$[Et])),s.a.createElement("div",{className:X.a.editorWrap},Ze===Et?s.a.createElement(x.a,{id:"single-question-option-".concat(Et),watch:!0,isFocus:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:at,onChange:function(Rt){Ke[Et]=Rt,Ne(Ke)}}):s.a.createElement("div",{className:X.a.htmlWrap,onClick:function(){return ye(Et)}},s.a.createElement(j.a,{value:at}))),Et>1&&s.a.createElement(H.a,{title:"\u5220\u9664"},s.a.createElement("i",{className:"".concat(X.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return Ne(Ke.filter(function(Rt,Ht){return Ht!==Et}))}})),Et<7&&Et===Ke.length-1&&s.a.createElement(H.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},s.a.createElement("i",{className:"".concat(X.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return Ne([].concat(Object(p.a)(Ke),[""]))}})))}),s.a.createElement(M.a,{className:"mt10"},s.a.createElement(k.a,{flex:"1"},s.a.createElement("p",{className:"c-grey-999"},"\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u9009\u9879\u8F93\u5165\u6846\u53EF\u8BBE\u7F6E\u7B54\u6848\uFF1B\u9009\u4E2D\u7684\u9009\u9879\u5373\u4E3A\u6B63\u786E\u7B54\u6848\uFF0C\u9009\u62E9\u591A\u4E2A\u7B54\u6848\u5373\u4E3A\u591A\u9009\u9898")),s.a.createElement(k.a,null,"\u6807\u51C6\u7B54\u6848\uFF1A",s.a.createElement("span",{className:"c-orange"},ve==null||((bt=ve.sort(function(at,Et){return at-Et}))===null||bt===void 0)?void 0:bt.map(function(at){return $[at]})))))};return s.a.createElement("section",{className:X.a.wrap},xt())},ue=Object(o.a)(function(ke){var Le=ke.problemset,We=ke.loading,Xe=ke.globalSetting;return{problemset:Le,globalSetting:Xe,loading:We.effects}},null,null,{forwardRef:!0})(Object(c.forwardRef)(ne)),Te=z("1vsH"),pe=z("zEei"),de=z.n(pe),ce=z("CJF0"),fe=z("2RCv"),te={1:[10,20],2:[30,40,50,60],3:[70,80,90,100]},se=function(Le){var We,Xe=Le.shixunsDetail,we=Le.dispatch,Re=Le.loading,De=Le.match,He=Le.location,Ve=Object(D.a)(Le,["shixunsDetail","dispatch","loading","match","location"]),Ce=g.a.useForm(),Me=Object(m.a)(Ce,1),qe=Me[0],tt=Object(c.useState)({}),Ke=Object(m.a)(tt,2),Ne=Ke[0],rt=Ke[1],Je=Object(c.useState)(!1),Ze=Object(m.a)(Je,2),ye=Ze[0],$e=Ze[1],Ge=Object(c.useState)(!0),ve=Object(m.a)(Ge,2),Ie=ve[0],le=ve[1],ae=Object(c.useState)(),oe=Object(m.a)(ae,2),Y=oe[0],J=oe[1],q=Object(c.useState)([10,20]),re=Object(m.a)(q,2),ge=re[0],Ae=re[1],Be=Object(c.useState)(!1),lt=Object(m.a)(Be,2),Pe=lt[0],Ye=lt[1],ht=Object(c.useState)({}),ot=Object(m.a)(ht,2),it=ot[0],Ot=ot[1],xt=Xe.challengesEdit,Ct=Xe.editChallengesQuestion,bt=Object(c.useRef)(),at=function(){var Ft=Object(u.a)(f.a.mark(function mt(){var Ue;return f.a.wrap(function(yt){for(;;)switch(yt.prev=yt.next){case 0:return yt.next=2,we({type:"shixunsDetail/getChallengesEdit",payload:Object(l.a)({},De.params)});case 2:Ue=yt.sent,qe.setFieldsValue(Object(l.a)({},Ue));case 4:case"end":return yt.stop()}},mt)}));return function(){return Ft.apply(this,arguments)}}(),Et=function(){var Ft=Object(u.a)(f.a.mark(function mt(){var Ue;return f.a.wrap(function(yt){for(;;)switch(yt.prev=yt.next){case 0:if(!De.params.questionId){yt.next=7;break}return yt.next=3,we({type:"shixunsDetail/getEditChallengesQuestion",payload:Object(l.a)({},De.params)});case 3:Ue=yt.sent,qe.setFieldsValue({challenge_tag:Ue.tags,difficult:Ue.difficult,score:Ue.score,answer:Ue.answer}),Ae(te[Ue.difficult]),Ot(Ue);case 7:case"end":return yt.stop()}},mt)}));return function(){return Ft.apply(this,arguments)}}();Object(c.useEffect)(function(){at(),De.params.questionId&&(J(!0),Et(),$e(!0))},[He.pathname]);var Lt=function(){var Ft=Object(u.a)(f.a.mark(function mt(){var Ue,_t,yt,zt;return f.a.wrap(function(ir){for(;;)switch(ir.prev=ir.next){case 0:return _t="",yt=Object(l.a)({},Ne),ir.next=4,bt.current.onSave();case 4:return zt=ir.sent,(Ue=zt.choice)===null||Ue===void 0||Ue.answer.map(function(ut,Or){ut&&(_t+=Te.o[Or])}),ir.abrupt("return",{challenge_choose:{subject:zt.subject,answer:Ne.task_pass,standard_answer:_t,score:Ne.score,difficult:Ne.difficult},challenge_tag:Ne.challenge_tag,question:zt.question,choice:zt.choice});case 7:case"end":return ir.stop()}},mt)}));return function(){return Ft.apply(this,arguments)}}(),Rt=function(mt){var Ue=te[mt],_t=Ue==null?void 0:Ue[0];Ae(Ue),qe.setFieldsValue({score:_t}),rt(Object(l.a)(Object(l.a)({},qe.getFieldsValue()),{score:_t}))},Ht=function(mt,Ue){rt(Object(l.a)({},qe.getFieldsValue())),"difficult"in mt&&Rt(mt.difficult)},nr=function(){var Ft=Object(u.a)(f.a.mark(function mt(){var Ue;return f.a.wrap(function(yt){for(;;)switch(yt.prev=yt.next){case 0:return yt.t0=y.w,yt.t1=l.a,yt.t2=l.a,yt.t3={},yt.next=6,Lt();case 6:return yt.t4=yt.sent,yt.t5=(0,yt.t2)(yt.t3,yt.t4),yt.t6=De.params,yt.t7=(0,yt.t1)(yt.t5,yt.t6),yt.next=12,(0,yt.t0)(yt.t7);case 12:Ue=yt.sent,(Ue==null?void 0:Ue.status)===1&&a.b.success("\u5220\u9664\u6210\u529F"),Ve.history.replace("/shixuns/".concat(De.params.id,"/challenges/").concat(De.params.challengesId,"/editquestion"));case 15:case"end":return yt.stop()}},mt)}));return function(){return Ft.apply(this,arguments)}}(),yr=function(){var Ft=Object(u.a)(f.a.mark(function mt(Ue){var _t,yt,zt,wt;return f.a.wrap(function(ut){for(;;)switch(ut.prev=ut.next){case 0:if(_t=Object(l.a)({},Ne),Ye(!0),Ie){ut.next=20;break}return ut.t0=y.c,ut.t1=l.a,ut.t2=l.a,ut.t3={},ut.next=9,Lt();case 9:return ut.t4=ut.sent,ut.t5=(0,ut.t2)(ut.t3,ut.t4),ut.t6=De.params,ut.t7=(0,ut.t1)(ut.t5,ut.t6),ut.next=15,(0,ut.t0)(ut.t7);case 15:yt=ut.sent,Ye(!1),yt.challenge_choose_id&&(a.b.success("\u64CD\u4F5C\u6210\u529F"),Ve.history.replace("/shixuns/".concat(De.params.id,"/challenges/").concat(De.params.challengesId,"/editquestion/").concat(yt.challenge_choose_id))),ut.next=45;break;case 20:if(!De.params.questionId){ut.next=38;break}return ut.t8=y.Nb,ut.t9=l.a,ut.t10=l.a,ut.t11={},ut.next=27,Lt();case 27:return ut.t12=ut.sent,ut.t13=(0,ut.t10)(ut.t11,ut.t12),ut.t14=De.params,ut.t15=(0,ut.t9)(ut.t13,ut.t14),ut.next=33,(0,ut.t8)(ut.t15);case 33:zt=ut.sent,Ye(!1),zt.challenge_choose_id&&a.b.success("\u64CD\u4F5C\u6210\u529F"),ut.next=45;break;case 38:return _t.identifier=De.params.id,_t.st=1,ut.next=42,Object(y.Mb)(Object(l.a)(Object(l.a)({},_t),De.params));case 42:wt=ut.sent,Ye(!1),wt.challenge_id&&a.b.success("\u64CD\u4F5C\u6210\u529F");case 45:case"end":return ut.stop()}},mt)}));return function(Ue){return Ft.apply(this,arguments)}}(),xr=function(){var mt;return s.a.createElement("div",null,s.a.createElement("div",{className:de.a.fieldWrap},s.a.createElement(g.a.Item,{name:"subject",label:"\u4EFB\u52A1\u540D\u79F0:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EFB\u52A1\u540D\u79F0"}]},s.a.createElement(b.a,{maxLength:60,suffix:"".concat(((mt=Ne.subject)===null||mt===void 0?void 0:mt.length)||0,"/60"),placeholder:"\u4F8B\u5982\uFF1A\u4ECEPython\u7A0B\u5E8F\u8BBE\u8BA1-\u5165\u95E8\u7CBE\u901A"}))),s.a.createElement("div",{className:de.a.mdWrap},s.a.createElement(g.a.Item,{name:"task_pass",label:"\u8FC7\u5173\u4EFB\u52A1:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4F5C\u4E1A\u7684\u7B80\u4ECB"},{max:35e3,message:"\u4F5C\u4E1A\u7B80\u4ECB\u6700\u5927\u9650\u52365000\u4E2A\u5B57\u7B26"}]},s.a.createElement(x.a,{watch:!0,defaultValue:xt.task_pass}))),s.a.createElement("div",{className:de.a.backgroundFa},s.a.createElement("div",{className:"pt40 mb30"},s.a.createElement(g.a.Item,null,s.a.createElement(S.a,{size:"large",type:"primary",className:"".concat(de.a.button," mr20"),htmlType:"submit",loading:Pe},"\u63D0\u4EA4"),s.a.createElement(S.a,{size:"large",type:"primary",ghost:!0,className:de.a.button,onClick:function(){return o.d.push("/shixuns/".concat(De.params.id,"/challenges"))}},"\u53D6\u6D88")))))},Ir=function(){var mt,Ue;return s.a.createElement("div",null,s.a.createElement("div",{className:"bg-white"},s.a.createElement(ue,{ref:bt,editData:it})),s.a.createElement("div",{className:de.a.mdWrap},s.a.createElement(g.a.Item,{name:"task_pass",label:"\u53C2\u8003\u7B54\u6848:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4F5C\u4E1A\u7684\u7B80\u4ECB"},{max:35e3,message:"\u4F5C\u4E1A\u7B80\u4ECB\u6700\u5927\u9650\u52365000\u4E2A\u5B57\u7B26"}]},s.a.createElement(x.a,{watch:!0,defaultValue:Ie?Ct.answer:""})),s.a.createElement(g.a.Item,{name:"difficult",label:"\u96BE\u5EA6\u7CFB\u6570:",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u96BE\u5EA6\u7CFB\u6570"}]},s.a.createElement(v.a.Group,{disabled:((mt=Xe.detail)===null||mt===void 0?void 0:mt.shixun_status)===2},s.a.createElement(v.a,{value:1},"\u7B80\u5355"),s.a.createElement(v.a,{value:2},"\u4E2D\u7B49"),s.a.createElement(v.a,{value:3},"\u56F0\u96BE"))),s.a.createElement(M.a,null,s.a.createElement(k.a,null,s.a.createElement(g.a.Item,{name:"score",label:"\u5956\u52B1\u7ECF\u9A8C\u503C:",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u5956\u52B1\u7ECF\u9A8C\u503C"}]},s.a.createElement(R.a,{disabled:((Ue=Xe.detail)===null||Ue===void 0?void 0:Ue.shixun_status)===2},ge.map(function(_t){return s.a.createElement(R.a.Option,{key:_t,value:_t},_t)})))),s.a.createElement(k.a,{flex:1},s.a.createElement("div",{className:"font12 c-light-black ml10 mt20"},"\u5982\u679C\u5B66\u5458\u7B54\u9898\u9519\u8BEF\uFF0C\u5219\u4E0D\u80FD\u5F97\u5230\u76F8\u5E94\u7684\u7ECF\u9A8C\u503C",s.a.createElement("br",null),"\u5982\u679C\u5B66\u5458\u6210\u529F\u5F97\u5230\u7ECF\u9A8C\u503C\uFF0C\u90A3\u4E48\u5C06\u540C\u65F6\u83B7\u5F97\u7B49\u503C\u7684\u91D1\u5E01\u5956\u52B1\uFF0C\u5982\uFF1A+10\u7ECF\u9A8C\u503C\u3001+10\u91D1\u5E01"))),s.a.createElement(g.a.Item,{name:"challenge_tag",label:s.a.createElement("div",null,"\u6280\u80FD\u6807\u7B7E ",s.a.createElement("span",{className:"pl20 font12 c-light-black"},"\u5B66\u5458\u7B54\u9898\u6B63\u786E\u5C06\u83B7\u5F97\u6280\u80FD\uFF0C\u5426\u5219\u4E0D\u80FD\u83B7\u5F97\u6280\u80FD\uFF08\u56DE\u8F66\u6DFB\u52A0\u6807\u7B7E\uFF09")),rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6280\u80FD\u6807\u7B7E"}]},s.a.createElement(fe.a,{placeholder:"\u6DFB\u52A0\u6807\u7B7E"}))),s.a.createElement("div",{className:de.a.backgroundFa},s.a.createElement(M.a,{className:"pt40 mb30"},s.a.createElement(k.a,{flex:1},s.a.createElement(g.a.Item,null,s.a.createElement(S.a,{size:"large",type:"primary",className:"".concat(de.a.button," mr20"),htmlType:"submit",loading:Pe},"\u63D0\u4EA4"),s.a.createElement(S.a,{size:"large",type:"primary",ghost:!0,className:de.a.button,onClick:function(){return o.d.push("/shixuns/".concat(De.params.id,"/challenges"))}},"\u53D6\u6D88"))),s.a.createElement(k.a,null,Y&&s.a.createElement(S.a,{size:"large",ghost:!0,className:"".concat(de.a.button," ").concat(de.a.deleteButton),onClick:nr},"\u5220\u9664")))))};return s.a.createElement("section",{className:de.a.bg},s.a.createElement(ce.a,{data:xt,title:"\u9009\u62E9\u9898"}),s.a.createElement(g.a,{form:qe,className:de.a.formWrap,scrollToFirstError:!0,layout:"vertical",onValuesChange:Ht,onFinish:yr,initialValues:{difficult:1,score:10}},s.a.createElement("aside",{className:["bg-white",de.a.navBar].join(" ")},s.a.createElement(W.a,{title:"\u5207\u6362\u524D\u8BF7\u786E\u8BA4\u5F53\u524D\u9009\u62E9\u9898\u5DF2\u63D0\u4EA4\uFF0C\u5426\u5219\u4E0D\u4F1A\u4FDD\u5B58\u4F60\u5F53\u524D\u6240\u6709\u8F93\u5165\uFF01",onConfirm:function(){o.d.replace("/shixuns/".concat(De.params.id,"/challenges/").concat(De.params.challengesId,"/editquestion"))}},s.a.createElement("strong",{className:"current"},"\u672C\u5173\u4EFB\u52A1")),xt==null||((We=xt.chooses)===null||We===void 0)?void 0:We.map(function(Ft,mt){return s.a.createElement(W.a,{title:"\u5207\u6362\u524D\u8BF7\u786E\u8BA4\u5F53\u524D\u9009\u62E9\u9898\u5DF2\u63D0\u4EA4\uFF0C\u5426\u5219\u4E0D\u4F1A\u4FDD\u5B58\u4F60\u5F53\u524D\u6240\u6709\u8F93\u5165\uFF01",onConfirm:function(){o.d.replace("/shixuns/".concat(De.params.id,"/challenges/").concat(De.params.challengesId,"/editquestion/").concat(Ft.choose_id))}},s.a.createElement("strong",{className:"current ".concat(De.params.questionId==Ft.choose_id&&Ie?de.a.actived:"")},Ft.type===1?"\u5355\u9009\u9898":"\u591A\u9009\u9898"))}),Ie&&s.a.createElement(W.a,{title:"\u5207\u6362\u524D\u8BF7\u786E\u8BA4\u5F53\u524D\u9009\u62E9\u9898\u5DF2\u63D0\u4EA4\uFF0C\u5426\u5219\u4E0D\u4F1A\u4FDD\u5B58\u4F60\u5F53\u524D\u6240\u6709\u8F93\u5165\uFF01",onConfirm:function(){$e(!0),le(!1),Ot({}),bt.current&&bt.current.onReset(),qe.resetFields()}},s.a.createElement(H.a,{title:"\u65B0\u589E\u9009\u62E9\u9898"},s.a.createElement("span",{className:de.a.addButton,onClick:function(){}},"+"))),!Ie&&s.a.createElement("strong",{className:de.a.actived},"\u9009\u62E9\u9898")),!ye&&xr(),ye&&Ir()))},Ee=be.default=Object(o.a)(function(ke){var Le=ke.shixunsDetail,We=ke.newCourse,Xe=ke.loading,we=ke.globalSetting;return{shixunsDetail:Le,newCourse:We,globalSetting:we,loading:Xe.effects}})(se)},l2Kq:function(xe,be,z){xe.exports=z.p+"static/match_ad.24dc22fd.jpg"},lZu9:function(xe,be,z){(function(Z){Z(z("VrN/"),z("1eCo"),z("8EBN"))})(function(Z){"use strict";Z.defineMode("markdown",function(H,w){var W=Z.getMode(H,"text/html"),P=W.name=="null";function M(j){if(Z.findModeByName){var U=Z.findModeByName(j);U&&(j=U.mime||U.mimes[0])}var X=Z.getMode(H,j);return X.name=="null"?null:X}w.highlightFormatting===void 0&&(w.highlightFormatting=!1),w.maxBlockquoteDepth===void 0&&(w.maxBlockquoteDepth=0),w.taskLists===void 0&&(w.taskLists=!1),w.strikethrough===void 0&&(w.strikethrough=!1),w.emoji===void 0&&(w.emoji=!1),w.fencedCodeBlockHighlighting===void 0&&(w.fencedCodeBlockHighlighting=!0),w.fencedCodeBlockDefaultMode===void 0&&(w.fencedCodeBlockDefaultMode="text/plain"),w.xml===void 0&&(w.xml=!0),w.tokenTypeOverrides===void 0&&(w.tokenTypeOverrides={});var N={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var k in N)N.hasOwnProperty(k)&&w.tokenTypeOverrides[k]&&(N[k]=w.tokenTypeOverrides[k]);var O=/^([*\-_])(?:\s*\1){2,}\s*$/,R=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,h=/^\[(x| )\](?=\s)/i,v=w.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,L=/^ {0,3}(?:\={1,}|-{2,})\s*$/,S=/^[^#!\[\]*_\\<>` "'(~:]+/,E=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,b=/^\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]/,a=" ";function l(j,U,X){return U.f=U.inline=X,X(j,U)}function u(j,U,X){return U.f=U.block=X,X(j,U)}function C(j){return!j||!/\S/.test(j.string)}function g(j){if(j.linkTitle=!1,j.linkHref=!1,j.linkText=!1,j.em=!1,j.strong=!1,j.strikethrough=!1,j.quote=0,j.indentedCode=!1,j.f==D){var U=P;if(!U){var X=Z.innerMode(W,j.htmlState);U=X.mode.name=="xml"&&X.state.tagStart===null&&!X.state.context&&X.state.tokenize.isInText}U&&(j.f=s,j.block=m,j.htmlState=null)}return j.trailingSpace=0,j.trailingSpaceNewLine=!1,j.prevLine=j.thisLine,j.thisLine={stream:null},null}function m(j,U){var X=j.column()===U.indentation,$=C(U.prevLine.stream),ne=U.indentedCode,ue=U.prevLine.hr,Te=U.list!==!1,pe=(U.listStack[U.listStack.length-1]||0)+3;U.indentedCode=!1;var de=U.indentation;if(U.indentationDiff===null&&(U.indentationDiff=U.indentation,Te)){for(U.list=null;de<U.listStack[U.listStack.length-1];)U.listStack.pop(),U.listStack.length?U.indentation=U.listStack[U.listStack.length-1]:U.list=!1;U.list!==!1&&(U.indentationDiff=de-U.listStack[U.listStack.length-1])}var ce=!$&&!ue&&!U.prevLine.header&&(!Te||!ne)&&!U.prevLine.fencedCodeEnd,fe=(U.list===!1||ue||$)&&U.indentation<=pe&&j.match(O),te=null;if(U.indentationDiff>=4&&(ne||U.prevLine.fencedCodeEnd||U.prevLine.header||$))return j.skipToEnd(),U.indentedCode=!0,N.code;if(j.eatSpace())return null;if(X&&U.indentation<=pe&&(te=j.match(v))&&te[1].length<=6)return U.quote=0,U.header=te[1].length,U.thisLine.header=!0,w.highlightFormatting&&(U.formatting="header"),U.f=U.inline,f(U);if(U.indentation<=pe&&j.eat(">"))return U.quote=X?1:U.quote+1,w.highlightFormatting&&(U.formatting="quote"),j.eatSpace(),f(U);if(!fe&&!U.setext&&X&&U.indentation<=pe&&(te=j.match(R))){var se=te[1]?"ol":"ul";return U.indentation=de+j.current().length,U.list=!0,U.quote=0,U.listStack.push(U.indentation),U.em=!1,U.strong=!1,U.code=!1,U.strikethrough=!1,w.taskLists&&j.match(h,!1)&&(U.taskList=!0),U.f=U.inline,w.highlightFormatting&&(U.formatting=["list","list-"+se]),f(U)}else{if(X&&U.indentation<=pe&&(te=j.match(E,!0)))return U.quote=0,U.fencedEndRE=new RegExp(te[1]+"+ *$"),U.localMode=w.fencedCodeBlockHighlighting&&M(te[2]||w.fencedCodeBlockDefaultMode),U.localMode&&(U.localState=Z.startState(U.localMode)),U.f=U.block=A,w.highlightFormatting&&(U.formatting="code-block"),U.code=-1,f(U);if(U.setext||(!ce||!Te)&&!U.quote&&U.list===!1&&!U.code&&!fe&&!b.test(j.string)&&(te=j.lookAhead(1))&&(te=te.match(L)))return U.setext?(U.header=U.setext,U.setext=0,j.skipToEnd(),w.highlightFormatting&&(U.formatting="header")):(U.header=te[0].charAt(0)=="="?1:2,U.setext=U.header),U.thisLine.header=!0,U.f=U.inline,f(U);if(fe)return j.skipToEnd(),U.hr=!0,U.thisLine.hr=!0,N.hr;if(j.peek()==="[")return l(j,U,I)}return l(j,U,U.inline)}function D(j,U){var X=W.token(j,U.htmlState);if(!P){var $=Z.innerMode(W,U.htmlState);($.mode.name=="xml"&&$.state.tagStart===null&&!$.state.context&&$.state.tokenize.isInText||U.md_inside&&j.current().indexOf(">")>-1)&&(U.f=s,U.block=m,U.htmlState=null)}return X}function A(j,U){var X=U.listStack[U.listStack.length-1]||0,$=U.indentation<X,ne=X+3;if(U.fencedEndRE&&U.indentation<=ne&&($||j.match(U.fencedEndRE))){w.highlightFormatting&&(U.formatting="code-block");var ue;return $||(ue=f(U)),U.localMode=U.localState=null,U.block=m,U.f=s,U.fencedEndRE=null,U.code=0,U.thisLine.fencedCodeEnd=!0,$?u(j,U,U.block):ue}else return U.localMode?U.localMode.token(j,U.localState):(j.skipToEnd(),N.code)}function f(j){var U=[];if(j.formatting){U.push(N.formatting),typeof j.formatting=="string"&&(j.formatting=[j.formatting]);for(var X=0;X<j.formatting.length;X++)U.push(N.formatting+"-"+j.formatting[X]),j.formatting[X]==="header"&&U.push(N.formatting+"-"+j.formatting[X]+"-"+j.header),j.formatting[X]==="quote"&&(!w.maxBlockquoteDepth||w.maxBlockquoteDepth>=j.quote?U.push(N.formatting+"-"+j.formatting[X]+"-"+j.quote):U.push("error"))}if(j.taskOpen)return U.push("meta"),U.length?U.join(" "):null;if(j.taskClosed)return U.push("property"),U.length?U.join(" "):null;if(j.linkHref?U.push(N.linkHref,"url"):(j.strong&&U.push(N.strong),j.em&&U.push(N.em),j.strikethrough&&U.push(N.strikethrough),j.emoji&&U.push(N.emoji),j.linkText&&U.push(N.linkText),j.code&&U.push(N.code),j.image&&U.push(N.image),j.imageAltText&&U.push(N.imageAltText,"link"),j.imageMarker&&U.push(N.imageMarker)),j.header&&U.push(N.header,N.header+"-"+j.header),j.quote&&(U.push(N.quote),!w.maxBlockquoteDepth||w.maxBlockquoteDepth>=j.quote?U.push(N.quote+"-"+j.quote):U.push(N.quote+"-"+w.maxBlockquoteDepth)),j.list!==!1){var $=(j.listStack.length-1)%3;$?$===1?U.push(N.list2):U.push(N.list3):U.push(N.list1)}return j.trailingSpaceNewLine?U.push("trailing-space-new-line"):j.trailingSpace&&U.push("trailing-space-"+(j.trailingSpace%2?"a":"b")),U.length?U.join(" "):null}function c(j,U){return j.match(S,!0)?f(U):void 0}function s(j,U){var X=U.text(j,U);if(typeof X!="undefined")return X;if(U.list)return U.list=null,f(U);if(U.taskList){var $=j.match(h,!0)[1]===" ";return $?U.taskOpen=!0:U.taskClosed=!0,w.highlightFormatting&&(U.formatting="task"),U.taskList=!1,f(U)}if(U.taskOpen=!1,U.taskClosed=!1,U.header&&j.match(/^#+$/,!0))return w.highlightFormatting&&(U.formatting="header"),f(U);var ne=j.next();if(U.linkTitle){U.linkTitle=!1;var ue=ne;ne==="("&&(ue=")"),ue=(ue+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Te="^\\s*(?:[^"+ue+"\\\\]+|\\\\\\\\|\\\\.)"+ue;if(j.match(new RegExp(Te),!0))return N.linkHref}if(ne==="`"){var pe=U.formatting;w.highlightFormatting&&(U.formatting="code"),j.eatWhile("`");var de=j.current().length;if(U.code==0&&(!U.quote||de==1))return U.code=de,f(U);if(de==U.code){var ce=f(U);return U.code=0,ce}else return U.formatting=pe,f(U)}else if(U.code)return f(U);if(ne==="\\"&&(j.next(),w.highlightFormatting)){var fe=f(U),te=N.formatting+"-escape";return fe?fe+" "+te:te}if(ne==="!"&&j.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return U.imageMarker=!0,U.image=!0,w.highlightFormatting&&(U.formatting="image"),f(U);if(ne==="["&&U.imageMarker&&j.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return U.imageMarker=!1,U.imageAltText=!0,w.highlightFormatting&&(U.formatting="image"),f(U);if(ne==="]"&&U.imageAltText){w.highlightFormatting&&(U.formatting="image");var fe=f(U);return U.imageAltText=!1,U.image=!1,U.inline=U.f=x,fe}if(ne==="["&&!U.image)return U.linkText&&j.match(/^.*?\]/)||(U.linkText=!0,w.highlightFormatting&&(U.formatting="link")),f(U);if(ne==="]"&&U.linkText){w.highlightFormatting&&(U.formatting="link");var fe=f(U);return U.linkText=!1,U.inline=U.f=j.match(/\(.*?\)| ?\[.*?\]/,!1)?x:s,fe}if(ne==="<"&&j.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){U.f=U.inline=o,w.highlightFormatting&&(U.formatting="link");var fe=f(U);return fe?fe+=" ":fe="",fe+N.linkInline}if(ne==="<"&&j.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){U.f=U.inline=o,w.highlightFormatting&&(U.formatting="link");var fe=f(U);return fe?fe+=" ":fe="",fe+N.linkEmail}if(w.xml&&ne==="<"&&j.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var se=j.string.indexOf(">",j.pos);if(se!=-1){var Ee=j.string.substring(j.start,se);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Ee)&&(U.md_inside=!0)}return j.backUp(1),U.htmlState=Z.startState(W),u(j,U,D)}if(w.xml&&ne==="<"&&j.match(/^\/\w*?>/))return U.md_inside=!1,"tag";if(ne==="*"||ne==="_"){for(var ke=1,Le=j.pos==1?" ":j.string.charAt(j.pos-2);ke<3&&j.eat(ne);)ke++;var We=j.peek()||" ",Xe=!/\s/.test(We)&&(!d.test(We)||/\s/.test(Le)||d.test(Le)),we=!/\s/.test(Le)&&(!d.test(Le)||/\s/.test(We)||d.test(We)),Re=null,De=null;if(ke%2&&(!U.em&&Xe&&(ne==="*"||!we||d.test(Le))?Re=!0:U.em==ne&&we&&(ne==="*"||!Xe||d.test(We))&&(Re=!1)),ke>1&&(!U.strong&&Xe&&(ne==="*"||!we||d.test(Le))?De=!0:U.strong==ne&&we&&(ne==="*"||!Xe||d.test(We))&&(De=!1)),De!=null||Re!=null){w.highlightFormatting&&(U.formatting=Re==null?"strong":De==null?"em":"strong em"),Re===!0&&(U.em=ne),De===!0&&(U.strong=ne);var ce=f(U);return Re===!1&&(U.em=!1),De===!1&&(U.strong=!1),ce}}else if(ne===" "&&(j.eat("*")||j.eat("_"))){if(j.peek()===" ")return f(U);j.backUp(1)}if(w.strikethrough){if(ne==="~"&&j.eatWhile(ne)){if(U.strikethrough){w.highlightFormatting&&(U.formatting="strikethrough");var ce=f(U);return U.strikethrough=!1,ce}else if(j.match(/^[^\s]/,!1))return U.strikethrough=!0,w.highlightFormatting&&(U.formatting="strikethrough"),f(U)}else if(ne===" "&&j.match(/^~~/,!0)){if(j.peek()===" ")return f(U);j.backUp(2)}}if(w.emoji&&ne===":"&&j.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){U.emoji=!0,w.highlightFormatting&&(U.formatting="emoji");var He=f(U);return U.emoji=!1,He}return ne===" "&&(j.match(/^ +$/,!1)?U.trailingSpace++:U.trailingSpace&&(U.trailingSpaceNewLine=!0)),f(U)}function o(j,U){var X=j.next();if(X===">"){U.f=U.inline=s,w.highlightFormatting&&(U.formatting="link");var $=f(U);return $?$+=" ":$="",$+N.linkInline}return j.match(/^[^>]+/,!0),N.linkInline}function x(j,U){if(j.eatSpace())return null;var X=j.next();return X==="("||X==="["?(U.f=U.inline=p(X==="("?")":"]"),w.highlightFormatting&&(U.formatting="link-string"),U.linkHref=!0,f(U)):"error"}var y={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function p(j){return function(U,X){var $=U.next();if($===j){X.f=X.inline=s,w.highlightFormatting&&(X.formatting="link-string");var ne=f(X);return X.linkHref=!1,ne}return U.match(y[j]),X.linkHref=!0,f(X)}}function I(j,U){return j.match(/^([^\]\\]|\\.)*\]:/,!1)?(U.f=B,j.next(),w.highlightFormatting&&(U.formatting="link"),U.linkText=!0,f(U)):l(j,U,s)}function B(j,U){if(j.match(/^\]:/,!0)){U.f=U.inline=F,w.highlightFormatting&&(U.formatting="link");var X=f(U);return U.linkText=!1,X}return j.match(/^([^\]\\]|\\.)+/,!0),N.linkText}function F(j,U){return j.eatSpace()?null:(j.match(/^[^\s]+/,!0),j.peek()===void 0?U.linkTitle=!0:j.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),U.f=U.inline=s,N.linkHref+" url")}var Q={startState:function(){return{f:m,prevLine:{stream:null},thisLine:{stream:null},block:m,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(j){return{f:j.f,prevLine:j.prevLine,thisLine:j.thisLine,block:j.block,htmlState:j.htmlState&&Z.copyState(W,j.htmlState),indentation:j.indentation,localMode:j.localMode,localState:j.localMode?Z.copyState(j.localMode,j.localState):null,inline:j.inline,text:j.text,formatting:!1,linkText:j.linkText,linkTitle:j.linkTitle,linkHref:j.linkHref,code:j.code,em:j.em,strong:j.strong,strikethrough:j.strikethrough,emoji:j.emoji,header:j.header,setext:j.setext,hr:j.hr,taskList:j.taskList,list:j.list,listStack:j.listStack.slice(0),quote:j.quote,indentedCode:j.indentedCode,trailingSpace:j.trailingSpace,trailingSpaceNewLine:j.trailingSpaceNewLine,md_inside:j.md_inside,fencedEndRE:j.fencedEndRE}},token:function(j,U){if(U.formatting=!1,j!=U.thisLine.stream){if(U.header=0,U.hr=!1,j.match(/^\s*$/,!0))return g(U),null;if(U.prevLine=U.thisLine,U.thisLine={stream:j},U.taskList=!1,U.trailingSpace=0,U.trailingSpaceNewLine=!1,!U.localState&&(U.f=U.block,U.f!=D)){var X=j.match(/^\s*/,!0)[0].replace(/\t/g,a).length;if(U.indentation=X,U.indentationDiff=null,X>0)return null}}return U.f(j,U)},innerMode:function(j){return j.block==D?{state:j.htmlState,mode:W}:j.localState?{state:j.localState,mode:j.localMode}:{state:j,mode:Q}},indent:function(j,U,X){return j.block==D&&W.indent?W.indent(j.htmlState,U,X):j.localState&&j.localMode.indent?j.localMode.indent(j.localState,U,X):Z.Pass},blankLine:g,getType:f,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return Q},"xml"),Z.defineMIME("text/markdown","markdown"),Z.defineMIME("text/x-markdown","markdown")})},lzim:function(xe,be,z){"use strict";var Z=z("E7E6"),H=z.n(Z);z.d(be,"z",function(){return H.a});var w=z("/GNS"),W=z.n(w);z.d(be,"y",function(){return W.a});var P=z("FOrL"),M=z.n(P);z.d(be,"s",function(){return M.a});var N=z("HpTS"),k=z.n(N);z.d(be,"A",function(){return k.a});var O=z("tWlo"),R=z.n(O);z.d(be,"b",function(){return R.a});var h=z("7ZXX"),v=z.n(h);z.d(be,"m",function(){return v.a});var L=z("GABl"),S=z.n(L);z.d(be,"f",function(){return S.a});var E=z("onxn"),b=z.n(E);z.d(be,"o",function(){return b.a});var d=z("nKGa"),a=z.n(d);z.d(be,"n",function(){return a.a});var l=z("4qgm"),u=z.n(l);z.d(be,"C",function(){return u.a});var C=z("JeFH"),g=z.n(C);z.d(be,"c",function(){return g.a});var m=z("ji0R"),D=z.n(m);z.d(be,"j",function(){return D.a});var A=z("W6BS"),f=z.n(A);z.d(be,"D",function(){return f.a});var c=z("kPYp"),s=z.n(c);z.d(be,"E",function(){return s.a});var o=z("nukY"),x=z.n(o),y=z("4u4S"),p=z.n(y),I=z("yslc"),B=z.n(I),F=z("l2Kq"),Q=z.n(F);z.d(be,"r",function(){return Q.a});var j=z("RMFE"),U=z.n(j);z.d(be,"p",function(){return U.a});var X=z("TGq3"),$=z.n(X),ne=z("SMhR"),ue=z.n(ne);z.d(be,"B",function(){return ue.a});var Te=z("8/bI"),pe=z.n(Te);z.d(be,"k",function(){return pe.a});var de=z("JWDV"),ce=z.n(de),fe=z("Xsq0"),te=z.n(fe);z.d(be,"q",function(){return te.a});var se=z("Ohmc"),Ee=z.n(se);z.d(be,"d",function(){return Ee.a});var ke=z("csWT"),Le=z.n(ke);z.d(be,"e",function(){return Le.a});var We=z("7v3h"),Xe=z.n(We);z.d(be,"l",function(){return Xe.a});var we=z("cRFk"),Re=z.n(we);z.d(be,"x",function(){return Re.a});var De=z("kPWJ"),He=z.n(De);z.d(be,"w",function(){return He.a});var Ve=z("qgvg"),Ce=z.n(Ve);z.d(be,"t",function(){return Ce.a});var Me=z("FPkq"),qe=z.n(Me);z.d(be,"v",function(){return qe.a});var tt=z("A/g1"),Ke=z.n(tt);z.d(be,"g",function(){return Ke.a});var Ne=z("Nmxd"),rt=z.n(Ne);z.d(be,"h",function(){return rt.a});var Je=z("5D2P"),Ze=z.n(Je);z.d(be,"i",function(){return Ze.a});var ye=z("djh8"),$e=z.n(ye);z.d(be,"u",function(){return $e.a});var Ge=z("Jq4h"),ve=z.n(Ge);z.d(be,"a",function(){return ve.a})},nKGa:function(xe,be,z){xe.exports=z.p+"static/export_exercise-template.f7655c19.png"},nVVt:function(xe,be){xe.exports={MODE_NUMBER:1<<0,MODE_ALPHA_NUM:1<<1,MODE_8BIT_BYTE:1<<2,MODE_KANJI:1<<3}},nZ20:function(xe,be,z){xe.exports={icons:"icons___3O80F"}},nukY:function(xe,be){xe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALoAAABSCAYAAADjGc4eAAAMkklEQVR4Xu2dWWwcSRnHv7Yd577v+74vkgWEQCAEy6IVWuCB62GVICFIYkcsvMC+LW8LL7BIiTiEhCweInjgPrRCC2KBJTBVYzm24yRO4ty3kziJj9ie+tC/d9oaT2b67ume7irJsjdbVf19X/266quvjjaEEG8w8yukk7ZAii1gMHODEOK3RPRSivXUqmXcAgb07+jomDk2NvYPZn4u4/bQ6qfUAiboSEKI5cz8XyJanVJdtVoZtsAE6EXYdzPzv4hoToZtolVPoQUmgV6E/QVm/hMRNaVQX61SRi3wDOiwg5Tya0qpn2TUJlrtFFqgIujFnv27zPztFOqsVcqgBaqCzsyGlPJXzPy5DNpFq5wyC1QFHXr29fVN6+/v/zszfyBlemt1MmYBW9Bhi3w+v7hQKJwkog0Zs41WN0UWcAS96K9vI6J3mHl+inTXqmTIAq5Ahz1yudxHDcN4k5mbM2QfrWpKLOAa9CLsB4ioLSW6azUyZAFPoBdh/w4RvZYhG2lVU2ABz6AXYf8FEb2cAv21ChmxgC/Qu7q6moeHh/9KRB/JiJ20mnVuAV+gQ+fu7u4FQ0ND/yGiLXVuAy1+BizgG/Ri2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tVziZp3Zl/FigUiZ3wOIYWZ/52pLR35oOU6oPtuw+dNdl6QfsAHmYlMZcEpiXsak6tnQY70bWubrUepjkNJTKTbGv8s8SSlOaD5Z0LwhL4XWmQvSa42rWrgf7+Fn7byVVV5KX6mLbTWcKueEa6etz+M+OphwqlZtmnSUME1bjJyb6vOmm8tc3PvrCeMIJZTLt5zBb1i59tUxuvDeRm+14RscbD1IB9Uo6ZnHRfp2XsX4489Ujy8eT08YTAjSg6Plf333p9HDLpzPlpnEvg4kYH83TrZrxcugy7IkU4SnrdszlW6AS5iOzndzu2FAbexmKY2RCgDR5zVsfrFm2YSrc92cqveNe2xMF9pk4HZvFMmQwflxrqMZFXKub49R1+ZtOne5hJaZpwoAG1GpXjhf/YXuxTK37pyLFPZSGErM7JleYCPVGRN7kreaXsp45OnY7aAwN3xvQcH1b1y65VabMwzMU5zQ79bMKmLHLm2GCEXC0jUkVRSLUF6hdW62c8n7WyzXHfsianBVAg16rqGCOerYt+E4tuOIbviR3suK+cBp1Zdpp0GRVRfZl4/XHD7AzTpnYSFWB0vHlzS2TDiz/cPn4vx2YAML/AxiD3K8wfl5pAAAAAElFTkSuQmCC"},osHv:function(xe,be,z){(function(Z){Z(z("VrN/"))})(function(Z){"use strict";var H=Z.Pos;function w(d,a){return d.line-a.line||d.ch-a.ch}var W="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=W+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",M=new RegExp("<(/?)(["+W+"]["+P+"]*)","g");function N(d,a,l,u){this.line=a,this.ch=l,this.cm=d,this.text=d.getLine(a),this.min=u?Math.max(u.from,d.firstLine()):d.firstLine(),this.max=u?Math.min(u.to-1,d.lastLine()):d.lastLine()}function k(d,a){var l=d.cm.getTokenTypeAt(H(d.line,a));return l&&/\btag\b/.test(l)}function O(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 h(d){for(;;){var a=d.text.indexOf(">",d.ch);if(a==-1){if(O(d))continue;return}if(!k(d,a+1)){d.ch=a+1;continue}var l=d.text.lastIndexOf("/",a),u=l>-1&&!/\S/.test(d.text.slice(l+1,a));return d.ch=a+1,u?"selfClose":"regular"}}function v(d){for(;;){var a=d.ch?d.text.lastIndexOf("<",d.ch-1):-1;if(a==-1){if(R(d))continue;return}if(!k(d,a+1)){d.ch=a;continue}M.lastIndex=a,d.ch=a;var l=M.exec(d.text);if(l&&l.index==a)return l}}function L(d){for(;;){M.lastIndex=d.ch;var a=M.exec(d.text);if(!a){if(O(d))continue;return}if(!k(d,a.index+1)){d.ch=a.index+1;continue}return d.ch=a.index+a[0].length,a}}function S(d){for(;;){var a=d.ch?d.text.lastIndexOf(">",d.ch-1):-1;if(a==-1){if(R(d))continue;return}if(!k(d,a+1)){d.ch=a;continue}var l=d.text.lastIndexOf("/",a),u=l>-1&&!/\S/.test(d.text.slice(l+1,a));return d.ch=a+1,u?"selfClose":"regular"}}function E(d,a){for(var l=[];;){var u=L(d),C,g=d.line,m=d.ch-(u?u[0].length:0);if(!u||!(C=h(d)))return;if(C=="selfClose")continue;if(u[1]){for(var D=l.length-1;D>=0;--D)if(l[D]==u[2]){l.length=D;break}if(D<0&&(!a||a==u[2]))return{tag:u[2],from:H(g,m),to:H(d.line,d.ch)}}else l.push(u[2])}}function b(d,a){for(var l=[];;){var u=S(d);if(!u)return;if(u=="selfClose"){v(d);continue}var C=d.line,g=d.ch,m=v(d);if(!m)return;if(m[1])l.push(m[2]);else{for(var D=l.length-1;D>=0;--D)if(l[D]==m[2]){l.length=D;break}if(D<0&&(!a||a==m[2]))return{tag:m[2],from:H(d.line,d.ch),to:H(C,g)}}}}Z.registerHelper("fold","xml",function(d,a){for(var l=new N(d,a.line,0);;){var u=L(l);if(!u||l.line!=a.line)return;var C=h(l);if(!C)return;if(!u[1]&&C!="selfClose"){var g=H(l.line,l.ch),m=E(l,u[2]);return m&&w(m.from,g)>0?{from:g,to:m.from}:null}}}),Z.findMatchingTag=function(d,a,l){var u=new N(d,a.line,a.ch,l);if(u.text.indexOf(">")==-1&&u.text.indexOf("<")==-1)return;var C=h(u),g=C&&H(u.line,u.ch),m=C&&v(u);if(!C||!m||w(u,a)>0)return;var D={from:H(u.line,u.ch),to:g,tag:m[2]};return C=="selfClose"?{open:D,close:null,at:"open"}:m[1]?{open:b(u,m[2]),close:D,at:"close"}:(u=new N(d,g.line,g.ch,l),{open:D,close:E(u,m[2]),at:"open"})},Z.findEnclosingTag=function(d,a,l,u){for(var C=new N(d,a.line,a.ch,l);;){var g=b(C,u);if(!g)break;var m=new N(d,a.line,a.ch,l),D=E(m,g.tag);if(D)return{open:g,close:D}}},Z.scanForClosingTag=function(d,a,l,u){var C=new N(d,a.line,a.ch,u?{from:0,to:u}:null);return E(C,l)}})},"p77/":function(xe,be,z){},qgvg:function(xe,be){xe.exports="data:image/gif;base64,R0lGODlhFAAQAOZVAD6Q33p6ezZto2VnaW5vcDuCxiYvNysvM1tdXzNij5eXlyg0QTA0OExOUWZnaS8zN19hYzFYf0Oi/Sg1QoeHh2JjZWZoaTdzrTRmljl5tzFZgDBWez6P3Tl4tjl8uzdxqWBiYys/VCUqL39/gHV2dy4yNScyPDJeiEpNTzk8P0CX6jc7PiYuNWlqaywwNDZtojAzNytDWScrLitAVUGb8Xl6eoWFhTp+wDNgjWRmZ4+QkFdZWzo9QIODgyo/Uzh3syg0QCczPmprbTRllW9wcSotMVJUVjZupDuEylBSVUGb8kxPUZGRkTd0rUGc82JkZUKe9j2M1zg7P4iIiEOj/yUpLQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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ieG1wLmRpZDo3RTc3OTU2RTlCREYxMUVBQjNDMUNCNjkwRUU4NkMwNyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PgH//v38+/r5+Pf29fTz8vHw7+7t7Ovq6ejn5uXk4+Lh4N/e3dzb2tnY19bV1NPS0dDPzs3My8rJyMfGxcTDwsHAv769vLu6ubi3trW0s7KxsK+urayrqqmop6alpKOioaCfnp2cm5qZmJeWlZSTkpGQj46NjIuKiYiHhoWEg4KBgH9+fXx7enl4d3Z1dHNycXBvbm1sa2ppaGdmZWRjYmFgX15dXFtaWVhXVlVUU1JRUE9OTUxLSklIR0ZFRENCQUA/Pj08Ozo5ODc2NTQzMjEwLy4tLCsqKSgnJiUkIyIhIB8eHRwbGhkYFxYVFBMSERAPDg0MCwoJCAcGBQQDAgEAACH5BAUyAFUALAAAAAAUABAAAAd5gFWCg4RSLoSIiVUPFlNEhAwDCIoyST1TUwGCBwM6AweJPCSYmJpVCAMMgykgFRUtFKSlilVCsreZtAS4sqaJu7yzisDBvhAKyBDEvL6Iy7jNhA7BwoklKA0NRiO30bRFOzakpqiqtItPsTWbA0wWoOcrOUuEMA6TgQAh+QQFMgBVACwAAAAAFAAQAAAHeIBVgoOEISaEiIlVExlUSIQLAgmKIidOVFQAggYCNAIGiTFRmJiaVQkCC4MzHxcXHhKkpYpVN7K3mbQFuLKmibu8s4rAwb4YpBjEvL6IyrjMhB3BwolBGxEROCq30LQsQ1CkpqiqtItNsRybAkpHoOY+PxqEQC+TgQA7"},rUJ1:function(xe,be){const z=/[&<>"']/,Z=/[&<>"']/g,H=/[<>"']|&(?!#?\w+;)/,w=/[<>"']|&(?!#?\w+;)/g,W={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},P=A=>W[A];function M(A,f){if(f){if(z.test(A))return A.replace(Z,P)}else if(H.test(A))return A.replace(w,P);return A}const N=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function k(A){return A.replace(N,(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 O=/(^|[^\[])\^/g;function R(A,f){A=A.source||A,f=f||"";const c={replace:(s,o)=>(o=o.source||o,o=o.replace(O,"$1"),A=A.replace(s,o),c),getRegex:()=>new RegExp(A,f)};return c}const h=/[^\w:]/g,v=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function L(A,f,c){if(A){let s;try{s=decodeURIComponent(k(c)).replace(h,"").toLowerCase()}catch(o){return null}if(s.indexOf("javascript:")===0||s.indexOf("vbscript:")===0||s.indexOf("data:")===0)return null}f&&!v.test(c)&&(c=a(f,c));try{c=encodeURI(c).replace(/%25/g,"%")}catch(s){return null}return c}const S={},E=/^[^:]+:\/*[^/]*$/,b=/^([^:]+:)[\s\S]*$/,d=/^([^:]+:\/*[^/]*)[\s\S]*$/;function a(A,f){S[" "+A]||(E.test(A)?S[" "+A]=A+"/":S[" "+A]=g(A,"/",!0)),A=S[" "+A];const c=A.indexOf(":")===-1;return f.substring(0,2)==="//"?c?f:A.replace(b,"$1")+f:f.charAt(0)==="/"?c?f:A.replace(d,"$1")+f:A+f}const l={exec:function(){}};function u(A){let f=1,c,s;for(;f<arguments.length;f++){c=arguments[f];for(s in c)Object.prototype.hasOwnProperty.call(c,s)&&(A[s]=c[s])}return A}function C(A,f){const c=A.replace(/\|/g,(x,y,p)=>{let I=!1,B=y;for(;--B>=0&&p[B]==="\\";)I=!I;return I?"|":" |"}),s=c.split(/ \|/);let o=0;if(s.length>f)s.splice(f);else for(;s.length<f;)s.push("");for(;o<s.length;o++)s[o]=s[o].trim().replace(/\\\|/g,"|");return s}function g(A,f,c){const s=A.length;if(s===0)return"";let o=0;for(;o<s;){const x=A.charAt(s-o-1);if(x===f&&!c)o++;else if(x!==f&&c)o++;else break}return A.substr(0,s-o)}function m(A,f){if(A.indexOf(f[1])===-1)return-1;const c=A.length;let s=0,o=0;for(;o<c;o++)if(A[o]==="\\")o++;else if(A[o]===f[0])s++;else if(A[o]===f[1]&&(s--,s<0))return o;return-1}function D(A){A&&A.sanitize&&!A.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")}xe.exports={escape:M,unescape:k,edit:R,cleanUrl:L,resolveUrl:a,noopTest:l,merge:u,splitCells:C,rtrim:g,findClosingBracket:m,checkSanitizeDeprecation:D}},rcnY:function(xe,be,z){var Z=z("aRTE");function H(w,W){this.totalCount=w,this.dataCount=W}H.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],H.getRSBlocks=function(w,W){var P=H.getRsBlockTable(w,W);if(P==null)throw new Error("bad rs block @ typeNumber:"+w+"/errorCorrectLevel:"+W);for(var M=P.length/3,N=new Array,k=0;k<M;k++)for(var O=P[k*3+0],R=P[k*3+1],h=P[k*3+2],v=0;v<O;v++)N.push(new H(R,h));return N},H.getRsBlockTable=function(w,W){switch(W){case Z.L:return H.RS_BLOCK_TABLE[(w-1)*4+0];case Z.M:return H.RS_BLOCK_TABLE[(w-1)*4+1];case Z.Q:return H.RS_BLOCK_TABLE[(w-1)*4+2];case Z.H:return H.RS_BLOCK_TABLE[(w-1)*4+3];default:return}},xe.exports=H},tWlo:function(xe,be){xe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZj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IzEhnTtwQhwQb/5vNDc1dkinak4gDsMUFSEhwMJQ9vhueqihnWhYBMhnokYRGowGLZRwcW9fWLsGxTV6HqA8F6sMfR5z0qiDUKsjQpoEuPQ1SsSILVPDd1FJTrDA/Fwry9NDX1w9dxh7MSs2+ytTjcI+7gc0IkHwpMD+JnpbnZGdCXk4WPJSUKFlHzj0bGTrtGqhZNjJqgQHzIHRjWMbzhd7/MqLaZxqzxfjVFU+UjhcZCs+gp7f9nowcszMhfg17SoptSKDyym9N9cbePt8O2GrQ5pbrDRMTkwbe6MQpN6hfFRUVWa+Qb+7je23ideLAtPdGZ/cUZpw1iTsTFtFLJcBwEc2RIryHqELvW2q/qQPT4JA4AmupL5aP/Saza8A0eDU2Jvr0DrWaNkEe3L32kULmhXV+cHHR8cOvV5tcDd9f8qvm9ouAW2Zm5yhpm5uwWi9HRoRXq1UqC9zt08cDe391VUiJPyaPo+F1zddaZy80XFyLRv52v2ViPrehiJSvz6Z7rthQpZI+t6E+K91yuj+3UXnkL+7PbYxCFdiIKfgYdTcohHZ23QTnEntd8Y8AAwCTubpzlq2wWAAAAABJRU5ErkJggg=="},ulZh:function(xe,be,z){typeof window!="undefined"&&function(H,w){xe.exports=w()}(this,function(){return function(Z){var H={};function w(W){if(H[W])return H[W].exports;var P=H[W]={i:W,l:!1,exports:{}};return Z[W].call(P.exports,P,P.exports,w),P.l=!0,P.exports}return w.m=Z,w.c=H,w.d=function(W,P,M){w.o(W,P)||Object.defineProperty(W,P,{enumerable:!0,get:M})},w.r=function(W){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(W,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(W,"__esModule",{value:!0})},w.t=function(W,P){if(P&1&&(W=w(W)),P&8)return W;if(P&4&&typeof W=="object"&&W&&W.__esModule)return W;var M=Object.create(null);if(w.r(M),Object.defineProperty(M,"default",{enumerable:!0,value:W}),P&2&&typeof W!="string")for(var N in W)w.d(M,N,function(k){return W[k]}.bind(null,N));return M},w.n=function(W){var P=W&&W.__esModule?function(){return W.default}:function(){return W};return w.d(P,"a",P),P},w.o=function(W,P){return Object.prototype.hasOwnProperty.call(W,P)},w.p="/dist/",w(w.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(Z,H,w){"use strict";var W=Object.prototype.hasOwnProperty,P="~";function M(){}Object.create&&(M.prototype=Object.create(null),new M().__proto__||(P=!1));function N(h,v,L){this.fn=h,this.context=v,this.once=L||!1}function k(h,v,L,S,E){if(typeof L!="function")throw new TypeError("The listener must be a function");var b=new N(L,S||h,E),d=P?P+v:v;return h._events[d]?h._events[d].fn?h._events[d]=[h._events[d],b]:h._events[d].push(b):(h._events[d]=b,h._eventsCount++),h}function O(h,v){--h._eventsCount===0?h._events=new M:delete h._events[v]}function R(){this._events=new M,this._eventsCount=0}R.prototype.eventNames=function(){var v=[],L,S;if(this._eventsCount===0)return v;for(S in L=this._events)W.call(L,S)&&v.push(P?S.slice(1):S);return Object.getOwnPropertySymbols?v.concat(Object.getOwnPropertySymbols(L)):v},R.prototype.listeners=function(v){var L=P?P+v:v,S=this._events[L];if(!S)return[];if(S.fn)return[S.fn];for(var E=0,b=S.length,d=new Array(b);E<b;E++)d[E]=S[E].fn;return d},R.prototype.listenerCount=function(v){var L=P?P+v:v,S=this._events[L];return S?S.fn?1:S.length:0},R.prototype.emit=function(v,L,S,E,b,d){var a=P?P+v:v;if(!this._events[a])return!1;var l=this._events[a],u=arguments.length,C,g;if(l.fn){l.once&&this.removeListener(v,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,S),!0;case 4:return l.fn.call(l.context,L,S,E),!0;case 5:return l.fn.call(l.context,L,S,E,b),!0;case 6:return l.fn.call(l.context,L,S,E,b,d),!0}for(g=1,C=new Array(u-1);g<u;g++)C[g-1]=arguments[g];l.fn.apply(l.context,C)}else{var m=l.length,D;for(g=0;g<m;g++){l[g].once&&this.removeListener(v,l[g].fn,void 0,!0);switch(u){case 1:l[g].fn.call(l[g].context);break;case 2:l[g].fn.call(l[g].context,L);break;case 3:l[g].fn.call(l[g].context,L,S);break;case 4:l[g].fn.call(l[g].context,L,S,E);break;default:if(!C)for(D=1,C=new Array(u-1);D<u;D++)C[D-1]=arguments[D];l[g].fn.apply(l[g].context,C)}}}return!0},R.prototype.on=function(v,L,S){return k(this,v,L,S,!1)},R.prototype.once=function(v,L,S){return k(this,v,L,S,!0)},R.prototype.removeListener=function(v,L,S,E){var b=P?P+v:v;if(!this._events[b])return this;if(!L)return O(this,b),this;var d=this._events[b];if(d.fn)d.fn===L&&(!E||d.once)&&(!S||d.context===S)&&O(this,b);else{for(var a=0,l=[],u=d.length;a<u;a++)(d[a].fn!==L||E&&!d[a].once||S&&d[a].context!==S)&&l.push(d[a]);l.length?this._events[b]=l.length===1?l[0]:l:O(this,b)}return this},R.prototype.removeAllListeners=function(v){var L;return v?(L=P?P+v:v,this._events[L]&&O(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,Z.exports=R},"./node_modules/url-toolkit/src/url-toolkit.js":function(Z,H,w){(function(W){var P=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,M=/^([^\/?#]*)([^]*)$/,N=/(?:\/|^)\.(?=\/)/g,k=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,O={buildAbsoluteURL:function(R,h,v){if(v=v||{},R=R.trim(),h=h.trim(),!h){if(!v.alwaysNormalize)return R;var L=O.parseURL(R);if(!L)throw new Error("Error trying to parse base URL.");return L.path=O.normalizePath(L.path),O.buildURLFromParts(L)}var S=O.parseURL(h);if(!S)throw new Error("Error trying to parse relative URL.");if(S.scheme)return v.alwaysNormalize?(S.path=O.normalizePath(S.path),O.buildURLFromParts(S)):h;var E=O.parseURL(R);if(!E)throw new Error("Error trying to parse base URL.");if(!E.netLoc&&E.path&&E.path[0]!=="/"){var b=M.exec(E.path);E.netLoc=b[1],E.path=b[2]}E.netLoc&&!E.path&&(E.path="/");var d={scheme:E.scheme,netLoc:S.netLoc,path:null,params:S.params,query:S.query,fragment:S.fragment};if(!S.netLoc&&(d.netLoc=E.netLoc,S.path[0]!=="/"))if(!S.path)d.path=E.path,S.params||(d.params=E.params,S.query||(d.query=E.query));else{var a=E.path,l=a.substring(0,a.lastIndexOf("/")+1)+S.path;d.path=O.normalizePath(l)}return d.path===null&&(d.path=v.alwaysNormalize?O.normalizePath(S.path):S.path),O.buildURLFromParts(d)},parseURL:function(R){var h=P.exec(R);return h?{scheme:h[1]||"",netLoc:h[2]||"",path:h[3]||"",params:h[4]||"",query:h[5]||"",fragment:h[6]||""}:null},normalizePath:function(R){for(R=R.split("").reverse().join("").replace(N,"");R.length!==(R=R.replace(k,"")).length;);return R.split("").reverse().join("")},buildURLFromParts:function(R){return R.scheme+R.netLoc+R.path+R.params+R.query+R.fragment}};Z.exports=O})(this)},"./node_modules/webworkify-webpack/index.js":function(Z,H,w){function W(v){var L={};function S(b){if(L[b])return L[b].exports;var d=L[b]={i:b,l:!1,exports:{}};return v[b].call(d.exports,d,d.exports,S),d.l=!0,d.exports}S.m=v,S.c=L,S.i=function(b){return b},S.d=function(b,d,a){S.o(b,d)||Object.defineProperty(b,d,{configurable:!1,enumerable:!0,get:a})},S.r=function(b){Object.defineProperty(b,"__esModule",{value:!0})},S.n=function(b){var d=b&&b.__esModule?function(){return b.default}:function(){return b};return S.d(d,"a",d),d},S.o=function(b,d){return Object.prototype.hasOwnProperty.call(b,d)},S.p="/",S.oe=function(b){throw console.error(b),b};var E=S(S.s=ENTRY_MODULE);return E.default||E}var P="[\\.|\\-|\\+|\\w|/|@]+",M="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+P+").*?\\)";function N(v){return(v+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function k(v){return!isNaN(1*v)}function O(v,L,S){var E={};E[S]=[];var b=L.toString(),d=b.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!d)return E;for(var a=d[1],l=new RegExp("(\\\\n|\\W)"+N(a)+M,"g"),u;u=l.exec(b);){if(u[3]==="dll-reference")continue;E[S].push(u[3])}for(l=new RegExp("\\("+N(a)+'\\("(dll-reference\\s('+P+'))"\\)\\)'+M,"g");u=l.exec(b);)v[u[2]]||(E[S].push(u[1]),v[u[2]]=w(u[1]).m),E[u[2]]=E[u[2]]||[],E[u[2]].push(u[4]);for(var C=Object.keys(E),g=0;g<C.length;g++)for(var m=0;m<E[C[g]].length;m++)k(E[C[g]][m])&&(E[C[g]][m]=1*E[C[g]][m]);return E}function R(v){var L=Object.keys(v);return L.reduce(function(S,E){return S||v[E].length>0},!1)}function h(v,L){for(var S={main:[L]},E={main:[]},b={main:{}};R(S);)for(var d=Object.keys(S),a=0;a<d.length;a++){var l=d[a],u=S[l],C=u.pop();if(b[l]=b[l]||{},b[l][C]||!v[l][C])continue;b[l][C]=!0,E[l]=E[l]||[],E[l].push(C);for(var g=O(v,v[l][C],l),m=Object.keys(g),D=0;D<m.length;D++)S[m[D]]=S[m[D]]||[],S[m[D]]=S[m[D]].concat(g[m[D]])}return E}Z.exports=function(v,L){L=L||{};var S={main:w.m},E=L.all?{main:Object.keys(S.main)}:h(S,v),b="";Object.keys(E).filter(function(C){return C!=="main"}).forEach(function(C){for(var g=0;E[C][g];)g++;E[C].push(g),S[C][g]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",b=b+"var "+C+" = ("+W.toString().replace("ENTRY_MODULE",JSON.stringify(g))+")({"+E[C].map(function(m){return""+JSON.stringify(m)+": "+S[C][m].toString()}).join(",")+`});
`}),b=b+"new (("+W.toString().replace("ENTRY_MODULE",JSON.stringify(v))+")({"+E.main.map(function(C){return""+JSON.stringify(C)+": "+S.main[C].toString()}).join(",")+"}))(self);";var d=new window.Blob([b],{type:"text/javascript"});if(L.bare)return d;var a=window.URL||window.webkitURL||window.mozURL||window.msURL,l=a.createObjectURL(d),u=new window.Worker(l);return u.objectURL=l,u}},"./src/config.ts":function(Z,H,w){"use strict";w.r(H),w.d(H,"hlsDefaultConfig",function(){return D}),w.d(H,"mergeConfig",function(){return f}),w.d(H,"enableStreamingMode",function(){return c});var W=w("./src/controller/abr-controller.ts"),P=w("./src/controller/audio-stream-controller.ts"),M=w("./src/controller/audio-track-controller.ts"),N=w("./src/controller/subtitle-stream-controller.ts"),k=w("./src/controller/subtitle-track-controller.ts"),O=w("./src/controller/buffer-controller.ts"),R=w("./src/controller/timeline-controller.ts"),h=w("./src/controller/cap-level-controller.ts"),v=w("./src/controller/fps-controller.ts"),L=w("./src/controller/eme-controller.ts"),S=w("./src/controller/cmcd-controller.ts"),E=w("./src/utils/xhr-loader.ts"),b=w("./src/utils/fetch-loader.ts"),d=w("./src/utils/cues.ts"),a=w("./src/utils/mediakeys-helper.ts"),l=w("./src/utils/logger.ts");function u(){return u=Object.assign||function(s){for(var o=1;o<arguments.length;o++){var x=arguments[o];for(var y in x)Object.prototype.hasOwnProperty.call(x,y)&&(s[y]=x[y])}return s},u.apply(this,arguments)}function C(s,o){var x=Object.keys(s);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(s);o&&(y=y.filter(function(p){return Object.getOwnPropertyDescriptor(s,p).enumerable})),x.push.apply(x,y)}return x}function g(s){for(var o=1;o<arguments.length;o++){var x=arguments[o]!=null?arguments[o]:{};o%2?C(Object(x),!0).forEach(function(y){m(s,y,x[y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(x)):C(Object(x)).forEach(function(y){Object.defineProperty(s,y,Object.getOwnPropertyDescriptor(x,y))})}return s}function m(s,o,x){return o in s?Object.defineProperty(s,o,{value:x,enumerable:!0,configurable:!0,writable:!0}):s[o]=x,s}var D=g(g({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:E.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:W.default,bufferController:O.default,capLevelController:h.default,fpsController:v.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:a.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},A()),{},{subtitleStreamController:N.SubtitleStreamController,subtitleTrackController:k.default,timelineController:R.TimelineController,audioStreamController:P.default,audioTrackController:M.default,emeController:L.default,cmcdController:S.default});function A(){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,o){if((o.liveSyncDurationCount||o.liveMaxLatencyDurationCount)&&(o.liveSyncDuration||o.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(o.liveMaxLatencyDurationCount!==void 0&&(o.liveSyncDurationCount===void 0||o.liveMaxLatencyDurationCount<=o.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(o.liveMaxLatencyDuration!==void 0&&(o.liveSyncDuration===void 0||o.liveMaxLatencyDuration<=o.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return u({},s,o)}function c(s){var o=s.loader;if(o!==b.default&&o!==E.default)l.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),s.progressive=!1;else{var x=Object(b.fetchSupported)();x&&(s.loader=b.default,s.progressive=!0,s.enableSoftwareAES=!0,l.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(Z,H,w){"use strict";w.r(H);var W=w("./src/polyfills/number.ts"),P=w("./src/utils/ewma-bandwidth-estimator.ts"),M=w("./src/events.ts"),N=w("./src/utils/buffer-helper.ts"),k=w("./src/errors.ts"),O=w("./src/types/loader.ts"),R=w("./src/utils/logger.ts");function h(S,E){for(var b=0;b<E.length;b++){var d=E[b];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(S,d.key,d)}}function v(S,E,b){return E&&h(S.prototype,E),b&&h(S,b),S}var L=function(){function S(b){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=b;var d=b.config;this.bwEstimator=new P.default(d.abrEwmaSlowVoD,d.abrEwmaFastVoD,d.abrEwmaDefaultEstimate),this.registerListeners()}var E=S.prototype;return E.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)},E.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)},E.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},E.onFragLoading=function(d,a){var l=a.frag;if(l.type===O.PlaylistLevelType.MAIN&&!this.timer){var u;this.fragCurrent=l,this.partCurrent=(u=a.part)!=null?u:null,this.timer=self.setInterval(this.onCheck,100)}},E.onLevelLoaded=function(d,a){var l=this.hls.config;a.details.live?this.bwEstimator.update(l.abrEwmaSlowLive,l.abrEwmaFastLive):this.bwEstimator.update(l.abrEwmaSlowVoD,l.abrEwmaFastVoD)},E._abandonRulesCheck=function(){var d=this.fragCurrent,a=this.partCurrent,l=this.hls,u=l.autoLevelEnabled,C=l.config,g=l.media;if(!d||!g)return;var m=a?a.stats:d.stats,D=a?a.duration:d.duration;if(m.aborted){R.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!u||g.paused||!g.playbackRate||!g.readyState)return;var A=performance.now()-m.loading.start,f=Math.abs(g.playbackRate);if(A<=500*D/f)return;var c=l.levels,s=l.minAutoLevel,o=c[d.level],x=m.total||Math.max(m.loaded,Math.round(D*o.maxBitrate/8)),y=Math.max(1,m.bwEstimate?m.bwEstimate/8:m.loaded*1e3/A),p=(x-m.loaded)/y,I=g.currentTime,B=(N.BufferHelper.bufferInfo(g,I,C.maxBufferHole).end-I)/f;if(B>=2*D/f||p<=B)return;var F=Number.POSITIVE_INFINITY,Q;for(Q=d.level-1;Q>s;Q--){var j=c[Q].maxBitrate;if(F=D*j/(8*.8*y),F<B)break}if(F>=p)return;var U=this.bwEstimator.getEstimate();R.logger.warn("Fragment "+d.sn+(a?" part "+a.index:"")+" of level "+d.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+Q+`
Current BW estimate: `+(Object(W.isFiniteNumber)(U)?(U/1024).toFixed(3):"Unknown")+` Kb/s
Estimated load time for current fragment: `+p.toFixed(3)+` s
Estimated load time for the next fragment: `+F.toFixed(3)+` s
Time to underbuffer: `+B.toFixed(3)+" s"),l.nextLoadLevel=Q,this.bwEstimator.sample(A,m.loaded),this.clearTimer(),d.loader&&(this.fragCurrent=this.partCurrent=null,d.loader.abort()),l.trigger(M.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:d,part:a,stats:m})},E.onFragLoaded=function(d,a){var l=a.frag,u=a.part;if(l.type===O.PlaylistLevelType.MAIN&&Object(W.isFiniteNumber)(l.sn)){var C=u?u.stats:l.stats,g=u?u.duration:l.duration;if(this.clearTimer(),this.lastLoadedFragLevel=l.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var m=this.hls.levels[l.level],D=(m.loaded?m.loaded.bytes:0)+C.loaded,A=(m.loaded?m.loaded.duration:0)+g;m.loaded={bytes:D,duration:A},m.realBitrate=Math.round(8*D/A)}if(l.bitrateTest){var f={stats:C,frag:l,part:u,id:l.type};this.onFragBuffered(M.Events.FRAG_BUFFERED,f),l.bitrateTest=!1}}},E.onFragBuffered=function(d,a){var l=a.frag,u=a.part,C=u?u.stats:l.stats;if(C.aborted)return;if(l.type!==O.PlaylistLevelType.MAIN||l.sn==="initSegment")return;var g=C.parsing.end-C.loading.start;this.bwEstimator.sample(g,C.loaded),C.bwEstimate=this.bwEstimator.getEstimate(),l.bitrateTest?this.bitrateTestDelay=g/1e3:this.bitrateTestDelay=0},E.onError=function(d,a){switch(a.details){case k.ErrorDetails.FRAG_LOAD_ERROR:case k.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},E.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},E.getNextABRAutoLevel=function(){var d=this.fragCurrent,a=this.partCurrent,l=this.hls,u=l.maxAutoLevel,C=l.config,g=l.minAutoLevel,m=l.media,D=a?a.duration:d?d.duration:0,A=m?m.currentTime:0,f=m&&m.playbackRate!==0?Math.abs(m.playbackRate):1,c=this.bwEstimator?this.bwEstimator.getEstimate():C.abrEwmaDefaultEstimate,s=(N.BufferHelper.bufferInfo(m,A,C.maxBufferHole).end-A)/f,o=this.findBestLevel(c,g,u,s,C.abrBandWidthFactor,C.abrBandWidthUpFactor);if(o>=0)return o;R.logger.trace((s?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var x=D?Math.min(D,C.maxStarvationDelay):C.maxStarvationDelay,y=C.abrBandWidthFactor,p=C.abrBandWidthUpFactor;if(!s){var I=this.bitrateTestDelay;if(I){var B=D?Math.min(D,C.maxLoadingDelay):C.maxLoadingDelay;x=B-I,R.logger.trace("bitrate test took "+Math.round(1e3*I)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*x)+" ms"),y=p=1}}return o=this.findBestLevel(c,g,u,s+x,y,p),Math.max(o,0)},E.findBestLevel=function(d,a,l,u,C,g){for(var m,D=this.fragCurrent,A=this.partCurrent,f=this.lastLoadedFragLevel,c=this.hls.levels,s=c[f],o=!!(s!=null&&(m=s.details)!==null&&m!==void 0&&m.live),x=s==null?void 0:s.codecSet,y=A?A.duration:D?D.duration:0,p=l;p>=a;p--){var I=c[p];if(!I||x&&I.codecSet!==x)continue;var B=I.details,F=(A?B==null?void 0:B.partTarget:B==null?void 0:B.averagetargetduration)||y,Q=void 0;p<=f?Q=C*d:Q=g*d;var j=c[p].maxBitrate,U=j*F/Q;if(R.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+p+"/"+Math.round(Q)+"/"+j+"/"+F+"/"+u+"/"+U),Q>j&&(!U||o&&!this.bitrateTestDelay||U<u))return p}return-1},v(S,[{key:"nextAutoLevel",get:function(){var d=this._nextAutoLevel,a=this.bwEstimator;if(d!==-1&&(!a||!a.canEstimate()))return d;var l=this.getNextABRAutoLevel();return d!==-1&&(l=Math.min(d,l)),l},set:function(d){this._nextAutoLevel=d}}]),S}();H.default=L},"./src/controller/audio-stream-controller.ts":function(Z,H,w){"use strict";w.r(H);var W=w("./src/polyfills/number.ts"),P=w("./src/controller/base-stream-controller.ts"),M=w("./src/events.ts"),N=w("./src/utils/buffer-helper.ts"),k=w("./src/controller/fragment-tracker.ts"),O=w("./src/types/level.ts"),R=w("./src/types/loader.ts"),h=w("./src/loader/fragment.ts"),v=w("./src/demux/chunk-cache.ts"),L=w("./src/demux/transmuxer-interface.ts"),S=w("./src/types/transmuxer.ts"),E=w("./src/controller/fragment-finders.ts"),b=w("./src/utils/discontinuities.ts"),d=w("./src/errors.ts"),a=w("./src/utils/logger.ts");function l(){return l=Object.assign||function(D){for(var A=1;A<arguments.length;A++){var f=arguments[A];for(var c in f)Object.prototype.hasOwnProperty.call(f,c)&&(D[c]=f[c])}return D},l.apply(this,arguments)}function u(D,A){D.prototype=Object.create(A.prototype),D.prototype.constructor=D,C(D,A)}function C(D,A){return C=Object.setPrototypeOf||function(c,s){return c.__proto__=s,c},C(D,A)}var g=100,m=function(D){u(A,D);function A(c,s){var o;return o=D.call(this,c,s,"[audio-stream-controller]")||this,o.videoBuffer=null,o.videoTrackCC=-1,o.waitingVideoCC=-1,o.audioSwitch=!1,o.trackId=-1,o.waitingData=null,o.mainDetails=null,o.bufferFlushed=!1,o._registerListeners(),o}var f=A.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,o){var x=o.frag,y=o.id,p=o.initPTS;if(y==="main"){var I=x.cc;this.initPTS[x.cc]=p,this.log("InitPTS for cc: "+I+" found from main: "+p),this.videoTrackCC=I,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 o=this.lastCurrentTime;this.stopLoad(),this.setInterval(g),this.fragLoadError=0,o>0&&s===-1?(this.log("Override startPosition with lastCurrentTime @"+o.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,o=this.levels,x=this.trackId,y=o==null||((s=o[x])===null||s===void 0)?void 0:s.details;if(y){if(this.waitForCdnTuneIn(y))break;this.state=P.State.WAITING_INIT_PTS}break}case P.State.FRAG_LOADING_WAITING_RETRY:{var p,I=performance.now(),B=this.retryDate;(!B||I>=B||(p=this.media)!==null&&p!==void 0&&p.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=P.State.IDLE);break}case P.State.WAITING_INIT_PTS:{var F=this.waitingData;if(F){var Q=F.frag,j=F.part,U=F.cache,X=F.complete;if(this.initPTS[Q.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=P.State.FRAG_LOADING;var $=U.flush(),ne={frag:Q,part:j,payload:$,networkDetails:null};this._handleFragmentLoadProgress(ne),X&&D.prototype._handleFragmentLoadComplete.call(this,ne)}else if(this.videoTrackCC!==this.waitingVideoCC)a.logger.log("Waiting fragment cc ("+Q.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var ue=this.getLoadPosition(),Te=N.BufferHelper.bufferInfo(this.mediaBuffer,ue,this.config.maxBufferHole),pe=Object(E.fragmentWithinToleranceTest)(Te.end,this.config.maxFragLookUpTolerance,Q);pe<0&&(a.logger.log("Waiting fragment cc ("+Q.cc+") @ "+Q.start+" cancelled because another fragment at "+Te.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 o=this.mediaBuffer?this.mediaBuffer:s,x=o.buffered;!this.loadedmetadata&&x.length&&(this.loadedmetadata=!0),this.lastCurrentTime=s.currentTime},f.doTickIdle=function(){var s,o,x=this.hls,y=this.levels,p=this.media,I=this.trackId,B=x.config;if(!y||!y[I])return;if(!p&&(this.startFragRequested||!B.startFragPrefetch))return;var F=y[I],Q=F.details;if(!Q||Q.live&&this.levelLastLoaded!==I||this.waitForCdnTuneIn(Q)){this.state=P.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,h.ElementaryStreamTypes.AUDIO,R.PlaylistLevelType.AUDIO));var j=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,R.PlaylistLevelType.AUDIO);if(j===null)return;var U=j.len,X=this.getMaxBufferLength(),$=this.audioSwitch;if(U>=X&&!$)return;if(!$&&this._streamEnded(j,Q)){x.trigger(M.Events.BUFFER_EOS,{type:"audio"}),this.state=P.State.ENDED;return}var ne=Q.fragments,ue=ne[0].start,Te=j.end;if($){var pe=this.getLoadPosition();Te=pe,Q.PTSKnown&&pe<ue&&((j.end>ue||j.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),p.currentTime=ue+.05))}var de=this.getNextFragment(Te,Q);if(!de){this.bufferFlushed=!0;return}((s=de.decryptdata)===null||s===void 0?void 0:s.keyFormat)==="identity"&&!((o=de.decryptdata)!==null&&o!==void 0&&o.key)?this.loadKey(de,Q):this.loadFragment(de,Q,Te)},f.getMaxBufferLength=function(){var s=D.prototype.getMaxBufferLength.call(this),o=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,R.PlaylistLevelType.MAIN);return o===null?s:Math.max(s,o.len)},f.onMediaDetaching=function(){this.videoBuffer=null,D.prototype.onMediaDetaching.call(this)},f.onAudioTracksUpdated=function(s,o){var x=o.audioTracks;this.resetTransmuxer(),this.levels=x.map(function(y){return new O.Level(y)})},f.onAudioTrackSwitching=function(s,o){var x=!!o.url;this.trackId=o.id;var y=this.fragCurrent;y!=null&&y.loader&&y.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),x?this.setInterval(g):this.resetTransmuxer(),x?(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,o){this.mainDetails=o.details},f.onAudioTrackLoaded=function(s,o){var x,y=this.levels,p=o.details,I=o.id;if(!y){this.warn("Audio tracks were reset while loading level "+I);return}this.log("Track "+I+" loaded ["+p.startSN+","+p.endSN+"],duration:"+p.totalduration);var B=y[I],F=0;if(p.live||(x=B.details)!==null&&x!==void 0&&x.live){var Q=this.mainDetails;if(p.fragments[0]||(p.deltaUpdateFailed=!0),p.deltaUpdateFailed||!Q)return;!B.details&&p.hasProgramDateTime&&Q.hasProgramDateTime?(Object(b.alignMediaPlaylistByPDT)(p,Q),F=p.fragments[0].start):F=this.alignPlaylists(p,B.details)}B.details=p,this.levelLastLoaded=I,!this.startFragRequested&&(this.mainDetails||!p.live)&&this.setStartPosition(B.details,F),this.state===P.State.WAITING_TRACK&&!this.waitForCdnTuneIn(p)&&(this.state=P.State.IDLE),this.tick()},f._handleFragmentLoadProgress=function(s){var o,x=s.frag,y=s.part,p=s.payload,I=this.config,B=this.trackId,F=this.levels;if(!F){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+x.sn+" of level "+x.level+" will not be buffered");return}var Q=F[B];console.assert(Q,"Audio track is defined on fragment load progress");var j=Q.details;console.assert(j,"Audio track details are defined on fragment load progress");var U=I.defaultAudioCodec||Q.audioCodec||"mp4a.40.2",X=this.transmuxer;X||(X=this.transmuxer=new L.default(this.hls,R.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var $=this.initPTS[x.cc],ne=(o=x.initSegment)===null||o===void 0?void 0:o.data;if($!==void 0){var ue=!1,Te=y?y.index:-1,pe=Te!==-1,de=new S.ChunkMetadata(x.level,x.sn,x.stats.chunkCount,p.byteLength,Te,pe);X.push(p,ne,U,"",x,y,j.totalduration,ue,de,$)}else{a.logger.log("Unknown video PTS for cc "+x.cc+", waiting for video PTS before demuxing audio frag "+x.sn+" of ["+j.startSN+" ,"+j.endSN+"],track "+B);var ce=this.waitingData=this.waitingData||{frag:x,part:y,cache:new v.default,complete:!1},fe=ce.cache;fe.push(new Uint8Array(p)),this.waitingVideoCC=this.videoTrackCC,this.state=P.State.WAITING_INIT_PTS}},f._handleFragmentLoadComplete=function(s){if(this.waitingData){this.waitingData.complete=!0;return}D.prototype._handleFragmentLoadComplete.call(this,s)},f.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},f.onBufferCreated=function(s,o){var x=o.tracks.audio;x&&(this.mediaBuffer=x.buffer),o.tracks.video&&(this.videoBuffer=o.tracks.video.buffer)},f.onFragBuffered=function(s,o){var x=o.frag,y=o.part;if(x.type!==R.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(x)){this.warn("Fragment "+x.sn+(y?" p: "+y.index:"")+" of level "+x.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}x.sn!=="initSegment"&&(this.fragPrevious=x,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(M.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(x,y)},f.onError=function(s,o){switch(o.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,o);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=o.fatal?P.State.ERROR:P.State.IDLE,this.warn(o.details+" while loading frag, switching to "+this.state+" state"));break;case d.ErrorDetails.BUFFER_FULL_ERROR:if(o.parent==="audio"&&(this.state===P.State.PARSING||this.state===P.State.PARSED)){var x=!0,y=this.getFwdBufferInfo(this.mediaBuffer,R.PlaylistLevelType.AUDIO);y&&y.len>.5&&(x=!this.reduceMaxBufferLength(y.len)),x&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,D.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},f.onBufferFlushed=function(s,o){var x=o.type;x===h.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},f._handleTransmuxComplete=function(s){var o,x="audio",y=this.hls,p=s.remuxResult,I=s.chunkMeta,B=this.getCurrentContext(I);if(!B){this.warn("The loading context changed while buffering fragment "+I.sn+" of level "+I.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(I.level);return}var F=B.frag,Q=B.part,j=p.audio,U=p.text,X=p.id3,$=p.initSegment;if(this.fragContextChanged(F))return;if(this.state=P.State.PARSING,this.audioSwitch&&j&&this.completeAudioSwitch(),$!=null&&$.tracks&&(this._bufferInitSegment($.tracks,F,I),y.trigger(M.Events.FRAG_PARSING_INIT_SEGMENT,{frag:F,id:x,tracks:$.tracks})),j){var ne=j.startPTS,ue=j.endPTS,Te=j.startDTS,pe=j.endDTS;Q&&(Q.elementaryStreams[h.ElementaryStreamTypes.AUDIO]={startPTS:ne,endPTS:ue,startDTS:Te,endDTS:pe}),F.setElementaryStreamInfo(h.ElementaryStreamTypes.AUDIO,ne,ue,Te,pe),this.bufferFragmentData(j,F,Q,I)}if(X!=null&&(o=X.samples)!==null&&o!==void 0&&o.length){var de=l({frag:F,id:x},X);y.trigger(M.Events.FRAG_PARSING_METADATA,de)}if(U){var ce=l({frag:F,id:x},U);y.trigger(M.Events.FRAG_PARSING_USERDATA,ce)}},f._bufferInitSegment=function(s,o,x){if(this.state!==P.State.PARSING)return;s.video&&delete s.video;var y=s.audio;if(!y)return;y.levelCodec=y.codec,y.id="audio",this.log("Init audio buffer, container:"+y.container+", codecs[parsed]=["+y.codec+"]"),this.hls.trigger(M.Events.BUFFER_CODECS,s);var p=y.initSegment;if(p!=null&&p.byteLength){var I={type:"audio",frag:o,part:null,chunkMeta:x,parent:o.type,data:p};this.hls.trigger(M.Events.BUFFER_APPENDING,I)}this.tick()},f.loadFragment=function(s,o,x){var y=this.fragmentTracker.getState(s);this.fragCurrent=s,(this.audioSwitch||y===k.FragmentState.NOT_LOADED||y===k.FragmentState.PARTIAL)&&(s.sn==="initSegment"?this._loadInitSegment(s):o.live&&!Object(W.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,D.prototype.loadFragment.call(this,s,o,x)))},f.completeAudioSwitch=function(){var s=this.hls,o=this.media,x=this.trackId;o&&(this.log("Switching audio track : flushing all audio"),D.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,s.trigger(M.Events.AUDIO_TRACK_SWITCHED,{id:x})},A}(P.default);H.default=m},"./src/controller/audio-track-controller.ts":function(Z,H,w){"use strict";w.r(H);var W=w("./src/events.ts"),P=w("./src/errors.ts"),M=w("./src/controller/base-playlist-controller.ts"),N=w("./src/types/loader.ts");function k(L,S){for(var E=0;E<S.length;E++){var b=S[E];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(L,b.key,b)}}function O(L,S,E){return S&&k(L.prototype,S),E&&k(L,E),L}function R(L,S){L.prototype=Object.create(S.prototype),L.prototype.constructor=L,h(L,S)}function h(L,S){return h=Object.setPrototypeOf||function(b,d){return b.__proto__=d,b},h(L,S)}var v=function(L){R(S,L);function S(b){var d;return d=L.call(this,b,"[audio-track-controller]")||this,d.tracks=[],d.groupId=null,d.tracksInGroup=[],d.trackId=-1,d.trackName="",d.selectDefaultTrack=!0,d.registerListeners(),d}var E=S.prototype;return E.registerListeners=function(){var d=this.hls;d.on(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),d.on(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),d.on(W.Events.LEVEL_LOADING,this.onLevelLoading,this),d.on(W.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),d.on(W.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),d.on(W.Events.ERROR,this.onError,this)},E.unregisterListeners=function(){var d=this.hls;d.off(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),d.off(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),d.off(W.Events.LEVEL_LOADING,this.onLevelLoading,this),d.off(W.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),d.off(W.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),d.off(W.Events.ERROR,this.onError,this)},E.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,L.prototype.destroy.call(this)},E.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},E.onManifestParsed=function(d,a){this.tracks=a.audioTracks||[]},E.onAudioTrackLoaded=function(d,a){var l=a.id,u=a.details,C=this.tracksInGroup[l];if(!C){this.warn("Invalid audio track id "+l);return}var g=C.details;C.details=a.details,this.log("audioTrack "+l+" loaded ["+u.startSN+"-"+u.endSN+"]"),l===this.trackId&&(this.retryCount=0,this.playlistLoaded(l,a,g))},E.onLevelLoading=function(d,a){this.switchLevel(a.level)},E.onLevelSwitching=function(d,a){this.switchLevel(a.level)},E.switchLevel=function(d){var a=this.hls.levels[d];if(!(a!=null&&a.audioGroupIds))return;var l=a.audioGroupIds[a.urlId];if(this.groupId!==l){this.groupId=l;var u=this.tracks.filter(function(g){return!l||g.groupId===l});this.selectDefaultTrack&&!u.some(function(g){return g.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=u;var C={audioTracks:u};this.log("Updating audio tracks, "+u.length+' track(s) found in "'+l+'" group-id'),this.hls.trigger(W.Events.AUDIO_TRACKS_UPDATED,C),this.selectInitialTrack()}},E.onError=function(d,a){if(L.prototype.onError.call(this,d,a),a.fatal||!a.context)return;a.context.type===N.PlaylistContextType.AUDIO_TRACK&&a.context.id===this.trackId&&a.context.groupId===this.groupId&&this.retryLoadingOrFail(a)},E.setAudioTrack=function(d){var a=this.tracksInGroup;if(d<0||d>=a.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var l=a[this.trackId];this.log("Now switching to audio-track index "+d);var u=a[d],C=u.id,g=u.groupId,m=g===void 0?"":g,D=u.name,A=u.type,f=u.url;if(this.trackId=d,this.trackName=D,this.selectDefaultTrack=!1,this.hls.trigger(W.Events.AUDIO_TRACK_SWITCHING,{id:C,groupId:m,name:D,type:A,url:f}),u.details&&!u.details.live)return;var c=this.switchParams(u.url,l==null?void 0:l.details);this.loadPlaylist(c)},E.selectInitialTrack=function(){var d=this.tracksInGroup;console.assert(d.length,"Initial audio track should be selected when tracks are known");var a=this.trackName,l=this.findTrackId(a)||this.findTrackId();l!==-1?this.setAudioTrack(l):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(W.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},E.findTrackId=function(d){for(var a=this.tracksInGroup,l=0;l<a.length;l++){var u=a[l];if((!this.selectDefaultTrack||u.default)&&(!d||d===u.name))return u.id}return-1},E.loadPlaylist=function(d){var a=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(a)){var l=a.id,u=a.groupId,C=a.url;if(d)try{C=d.addDirectives(C)}catch(g){this.warn("Could not construct new URL with HLS Delivery Directives: "+g)}this.log("loading audio-track playlist for id: "+l),this.clearTimer(),this.hls.trigger(W.Events.AUDIO_TRACK_LOADING,{url:C,id:l,groupId:u,deliveryDirectives:d||null})}},O(S,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(d){this.selectDefaultTrack=!1,this.setAudioTrack(d)}}]),S}(M.default);H.default=v},"./src/controller/base-playlist-controller.ts":function(Z,H,w){"use strict";w.r(H),w.d(H,"default",function(){return O});var W=w("./src/polyfills/number.ts"),P=w("./src/types/level.ts"),M=w("./src/controller/level-helper.ts"),N=w("./src/utils/logger.ts"),k=w("./src/errors.ts"),O=function(){function R(v,L){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=N.logger.log.bind(N.logger,L+":"),this.warn=N.logger.warn.bind(N.logger,L+":"),this.hls=v}var h=R.prototype;return h.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},h.onError=function(L,S){S.fatal&&S.type===k.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},h.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},h.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},h.stopLoad=function(){this.canLoad=!1,this.clearTimer()},h.switchParams=function(L,S){var E=S==null?void 0:S.renditionReports;if(E)for(var b=0;b<E.length;b++){var d=E[b],a=""+d.URI;if(a===L.substr(-a.length)){var l=parseInt(d["LAST-MSN"]),u=parseInt(d["LAST-PART"]);if(S&&this.hls.config.lowLatencyMode){var C=Math.min(S.age-S.partTarget,S.targetduration);u!==void 0&&C>S.partTarget&&(u+=1)}if(Object(W.isFiniteNumber)(l))return new P.HlsUrlParameters(l,Object(W.isFiniteNumber)(u)?u:void 0,P.HlsSkip.No)}}},h.loadPlaylist=function(L){},h.shouldLoadTrack=function(L){return this.canLoad&&L&&!!L.url&&(!L.details||L.details.live)},h.playlistLoaded=function(L,S,E){var b=this,d=S.details,a=S.stats,l=a.loading.end?Math.max(0,self.performance.now()-a.loading.end):0;if(d.advancedDateTime=Date.now()-l,d.live||E!=null&&E.live){if(d.reloaded(E),E&&this.log("live playlist "+L+" "+(d.advanced?"REFRESHED "+d.lastPartSn+"-"+d.lastPartIndex:"MISSED")),E&&d.fragments.length>0&&Object(M.mergeDetails)(E,d),!this.canLoad||!d.live)return;var u,C=void 0,g=void 0;if(d.canBlockReload&&d.endSN&&d.advanced){var m=this.hls.config.lowLatencyMode,D=d.lastPartSn,A=d.endSN,f=d.lastPartIndex,c=f!==-1,s=D===A,o=m?0:f;c?(C=s?A+1:D,g=s?o:f+1):C=A+1;var x=d.age,y=x+d.ageHeader,p=Math.min(y-d.partTarget,d.targetduration*1.5);if(p>0){if(E&&p>E.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+E.tuneInGoal+" to: "+p+" with playlist age: "+d.age),p=0;else{var I=Math.floor(p/d.targetduration);if(C+=I,g!==void 0){var B=Math.round(p%d.targetduration/d.partTarget);g+=B}this.log("CDN Tune-in age: "+d.ageHeader+"s last advanced "+x.toFixed(2)+"s goal: "+p+" skip sn "+I+" to part "+g)}d.tuneInGoal=p}if(u=this.getDeliveryDirectives(d,S.deliveryDirectives,C,g),m||!s){this.loadPlaylist(u);return}}else u=this.getDeliveryDirectives(d,S.deliveryDirectives,C,g);var F=Object(M.computeReloadInterval)(d,a);C!==void 0&&d.canBlockReload&&(F-=d.partTarget||1),this.log("reload live playlist "+L+" in "+Math.round(F)+" ms"),this.timer=self.setTimeout(function(){return b.loadPlaylist(u)},F)}else this.clearTimer()},h.getDeliveryDirectives=function(L,S,E,b){var d=Object(P.getSkipValue)(L,E);return S!=null&&S.skip&&L.deltaUpdateFailed&&(E=S.msn,b=S.part,d=P.HlsSkip.No),new P.HlsUrlParameters(E,b,d)},h.retryLoadingOrFail=function(L){var S=this,E=this.hls.config,b=this.retryCount<E.levelLoadingMaxRetry;if(b){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 a=Math.min(Math.pow(2,this.retryCount)*E.levelLoadingRetryDelay,E.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return S.loadPlaylist()},a),this.warn("retry playlist loading #"+this.retryCount+" in "+a+' ms after "'+L.details+'"')}}else this.warn('cannot recover from error "'+L.details+'"'),this.clearTimer(),L.fatal=!0;return b},R}()},"./src/controller/base-stream-controller.ts":function(Z,H,w){"use strict";w.r(H),w.d(H,"State",function(){return A}),w.d(H,"default",function(){return f});var W=w("./src/polyfills/number.ts"),P=w("./src/task-loop.ts"),M=w("./src/controller/fragment-tracker.ts"),N=w("./src/utils/buffer-helper.ts"),k=w("./src/utils/logger.ts"),O=w("./src/events.ts"),R=w("./src/errors.ts"),h=w("./src/types/transmuxer.ts"),v=w("./src/utils/mp4-tools.ts"),L=w("./src/utils/discontinuities.ts"),S=w("./src/controller/fragment-finders.ts"),E=w("./src/controller/level-helper.ts"),b=w("./src/loader/fragment-loader.ts"),d=w("./src/crypt/decrypter.ts"),a=w("./src/utils/time-ranges.ts"),l=w("./src/types/loader.ts");function u(c,s){for(var o=0;o<s.length;o++){var x=s[o];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(c,x.key,x)}}function C(c,s,o){return s&&u(c.prototype,s),o&&u(c,o),c}function g(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function m(c,s){c.prototype=Object.create(s.prototype),c.prototype.constructor=c,D(c,s)}function D(c,s){return D=Object.setPrototypeOf||function(x,y){return x.__proto__=y,x},D(c,s)}var A={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){m(s,c);function s(x,y,p){var I;return I=c.call(this)||this,I.hls=void 0,I.fragPrevious=null,I.fragCurrent=null,I.fragmentTracker=void 0,I.transmuxer=null,I._state=A.STOPPED,I.media=void 0,I.mediaBuffer=void 0,I.config=void 0,I.bitrateTest=!1,I.lastCurrentTime=0,I.nextLoadPosition=0,I.startPosition=0,I.loadedmetadata=!1,I.fragLoadError=0,I.retryDate=0,I.levels=null,I.fragmentLoader=void 0,I.levelLastLoaded=null,I.startFragRequested=!1,I.decrypter=void 0,I.initPTS=[],I.onvseeking=null,I.onvended=null,I.logPrefix="",I.log=void 0,I.warn=void 0,I.logPrefix=p,I.log=k.logger.log.bind(k.logger,p+":"),I.warn=k.logger.warn.bind(k.logger,p+":"),I.hls=x,I.fragmentLoader=new b.default(x.config),I.fragmentTracker=y,I.config=x.config,I.decrypter=new d.default(x,x.config),x.on(O.Events.KEY_LOADED,I.onKeyLoaded,g(I)),I}var o=s.prototype;return o.doTick=function(){this.onTickEnd()},o.onTickEnd=function(){},o.startLoad=function(y){},o.stopLoad=function(){this.fragmentLoader.abort();var y=this.fragCurrent;y&&this.fragmentTracker.removeFragment(y),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=A.STOPPED},o._streamEnded=function(y,p){var I=this.fragCurrent,B=this.fragmentTracker;if(!p.live&&I&&I.sn===p.endSN&&!y.nextStart){var F=B.getState(I);return F===M.FragmentState.PARTIAL||F===M.FragmentState.OK}return!1},o.onMediaAttached=function(y,p){var I=this.media=this.mediaBuffer=p.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),I.addEventListener("seeking",this.onvseeking),I.addEventListener("ended",this.onvended);var B=this.config;this.levels&&B.autoStartLoad&&this.state===A.STOPPED&&this.startLoad(B.startPosition)},o.onMediaDetaching=function(){var y=this.media;y!=null&&y.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),y&&(y.removeEventListener("seeking",this.onvseeking),y.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},o.onMediaSeeking=function(){var y=this.config,p=this.fragCurrent,I=this.media,B=this.mediaBuffer,F=this.state,Q=I?I.currentTime:0,j=N.BufferHelper.bufferInfo(B||I,Q,y.maxBufferHole);if(this.log("media seeking to "+(Object(W.isFiniteNumber)(Q)?Q.toFixed(3):Q)+", state: "+F),F===A.ENDED)this.resetLoadingState();else if(p&&!j.len){var U=y.maxFragLookUpTolerance,X=p.start-U,$=p.start+p.duration+U,ne=Q>$;(Q<X||ne)&&(ne&&p.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),p.loader.abort()),this.resetLoadingState())}I&&(this.lastCurrentTime=Q),!this.loadedmetadata&&!j.len&&(this.nextLoadPosition=this.startPosition=Q),this.tickImmediate()},o.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},o.onKeyLoaded=function(y,p){if(this.state!==A.KEY_LOADING||p.frag!==this.fragCurrent||!this.levels)return;this.state=A.IDLE;var I=this.levels[p.frag.level].details;I&&this.loadFragment(p.frag,I,p.frag.start)},o.onHandlerDestroying=function(){this.stopLoad(),c.prototype.onHandlerDestroying.call(this)},o.onHandlerDestroyed=function(){this.state=A.STOPPED,this.hls.off(O.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)},o.loadKey=function(y,p){this.log("Loading key for "+y.sn+" of ["+p.startSN+"-"+p.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+y.level),this.state=A.KEY_LOADING,this.fragCurrent=y,this.hls.trigger(O.Events.KEY_LOADING,{frag:y})},o.loadFragment=function(y,p,I){this._loadFragForPlayback(y,p,I)},o._loadFragForPlayback=function(y,p,I){var B=this,F=function(j){if(B.fragContextChanged(y)){B.warn("Fragment "+y.sn+(j.part?" p: "+j.part.index:"")+" of level "+y.level+" was dropped during download."),B.fragmentTracker.removeFragment(y);return}y.stats.chunkCount++,B._handleFragmentLoadProgress(j)};this._doFragLoad(y,p,I,F).then(function(Q){if(!Q)return;B.fragLoadError=0;var j=B.state;if(B.fragContextChanged(y)){(j===A.FRAG_LOADING||j===A.BACKTRACKING||!B.fragCurrent&&j===A.PARSING)&&(B.fragmentTracker.removeFragment(y),B.state=A.IDLE);return}if("payload"in Q&&(B.log("Loaded fragment "+y.sn+" of level "+y.level),B.hls.trigger(O.Events.FRAG_LOADED,Q),B.state===A.BACKTRACKING)){B.fragmentTracker.backtrack(y,Q),B.resetFragmentLoading(y);return}B._handleFragmentLoadComplete(Q)}).catch(function(Q){B.warn(Q),B.resetFragmentLoading(y)})},o.flushMainBuffer=function(y,p,I){if(I===void 0&&(I=null),!(y-p))return;var B={startOffset:y,endOffset:p,type:I};this.fragLoadError=0,this.hls.trigger(O.Events.BUFFER_FLUSHING,B)},o._loadInitSegment=function(y){var p=this;this._doFragLoad(y).then(function(I){if(!I||p.fragContextChanged(y)||!p.levels)throw new Error("init load aborted");return I}).then(function(I){var B=p.hls,F=I.payload,Q=y.decryptdata;if(F&&F.byteLength>0&&Q&&Q.key&&Q.iv&&Q.method==="AES-128"){var j=self.performance.now();return p.decrypter.webCryptoDecrypt(new Uint8Array(F),Q.key.buffer,Q.iv.buffer).then(function(U){var X=self.performance.now();return B.trigger(O.Events.FRAG_DECRYPTED,{frag:y,payload:U,stats:{tstart:j,tdecrypt:X}}),I.payload=U,I})}return I}).then(function(I){var B=p.fragCurrent,F=p.hls,Q=p.levels;if(!Q)throw new Error("init load aborted, missing levels");var j=Q[y.level].details;console.assert(j,"Level details are defined when init segment is loaded");var U=y.stats;p.state=A.IDLE,p.fragLoadError=0,y.data=new Uint8Array(I.payload),U.parsing.start=U.buffering.start=self.performance.now(),U.parsing.end=U.buffering.end=self.performance.now(),I.frag===B&&F.trigger(O.Events.FRAG_BUFFERED,{stats:U,frag:B,part:null,id:y.type}),p.tick()}).catch(function(I){p.warn(I),p.resetFragmentLoading(y)})},o.fragContextChanged=function(y){var p=this.fragCurrent;return!y||!p||y.level!==p.level||y.sn!==p.sn||y.urlId!==p.urlId},o.fragBufferedComplete=function(y,p){var I=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+y.type+" sn: "+y.sn+(p?" part: "+p.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+y.level+" "+a.default.toString(N.BufferHelper.getBuffered(I))),this.state=A.IDLE,this.tick()},o._handleFragmentLoadComplete=function(y){var p=this.transmuxer;if(!p)return;var I=y.frag,B=y.part,F=y.partsLoaded,Q=!F||F.length===0||F.some(function(U){return!U}),j=new h.ChunkMetadata(I.level,I.sn,I.stats.chunkCount+1,0,B?B.index:-1,!Q);p.flush(j)},o._handleFragmentLoadProgress=function(y){},o._doFragLoad=function(y,p,I,B){var F=this;if(I===void 0&&(I=null),!this.levels)throw new Error("frag load aborted, missing levels");if(I=Math.max(y.start,I||0),this.config.lowLatencyMode&&p){var Q=p.partList;if(Q&&B){I>y.end&&p.fragmentHint&&(y=p.fragmentHint);var j=this.getNextPart(Q,y,I);if(j>-1){var U=Q[j];return this.log("Loading part sn: "+y.sn+" p: "+U.index+" cc: "+y.cc+" of playlist ["+p.startSN+"-"+p.endSN+"] parts [0-"+j+"-"+(Q.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+y.level+", target: "+parseFloat(I.toFixed(3))),this.nextLoadPosition=U.start+U.duration,this.state=A.FRAG_LOADING,this.hls.trigger(O.Events.FRAG_LOADING,{frag:y,part:Q[j],targetBufferTime:I}),this.doFragPartsLoad(y,Q,j,B).catch(function(X){return F.handleFragLoadError(X)})}else if(!y.url||this.loadedEndOfParts(Q,I))return Promise.resolve(null)}}return this.log("Loading fragment "+y.sn+" cc: "+y.cc+" "+(p?"of ["+p.startSN+"-"+p.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+y.level+", target: "+parseFloat(I.toFixed(3))),Object(W.isFiniteNumber)(y.sn)&&!this.bitrateTest&&(this.nextLoadPosition=y.start+y.duration),this.state=A.FRAG_LOADING,this.hls.trigger(O.Events.FRAG_LOADING,{frag:y,targetBufferTime:I}),this.fragmentLoader.load(y,B).catch(function(X){return F.handleFragLoadError(X)})},o.doFragPartsLoad=function(y,p,I,B){var F=this;return new Promise(function(Q,j){var U=[],X=function $(ne){var ue=p[ne];F.fragmentLoader.loadPart(y,ue,B).then(function(Te){U[ue.index]=Te;var pe=Te.part;F.hls.trigger(O.Events.FRAG_LOADED,Te);var de=p[ne+1];if(de&&de.fragment===y)$(ne+1);else return Q({frag:y,part:pe,partsLoaded:U})}).catch(j)};X(I)})},o.handleFragLoadError=function(y){var p=y.data;return p&&p.details===R.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(p.frag,p.part):this.hls.trigger(O.Events.ERROR,p),null},o._handleTransmuxerFlush=function(y){var p=this.getCurrentContext(y);if(!p||this.state!==A.PARSING){this.fragCurrent||(this.state=A.IDLE);return}var I=p.frag,B=p.part,F=p.level,Q=self.performance.now();I.stats.parsing.end=Q,B&&(B.stats.parsing.end=Q),this.updateLevelTiming(I,B,F,y.partial)},o.getCurrentContext=function(y){var p=this.levels,I=y.level,B=y.sn,F=y.part;if(!p||!p[I])return this.warn("Levels object was unset while buffering fragment "+B+" of level "+I+". The current chunk will not be buffered."),null;var Q=p[I],j=F>-1?Object(E.getPartWith)(Q,B,F):null,U=j?j.fragment:Object(E.getFragmentWithSN)(Q,B,this.fragCurrent);return U?{frag:U,part:j,level:Q}:null},o.bufferFragmentData=function(y,p,I,B){if(!y||this.state!==A.PARSING)return;var F=y.data1,Q=y.data2,j=F;if(F&&Q&&(j=Object(v.appendUint8Array)(F,Q)),!j||!j.length)return;var U={type:y.type,frag:p,part:I,chunkMeta:B,parent:p.type,data:j};this.hls.trigger(O.Events.BUFFER_APPENDING,U),y.dropped&&y.independent&&!I&&this.flushBufferGap(p)},o.flushBufferGap=function(y){var p=this.media;if(!p)return;if(!N.BufferHelper.isBuffered(p,p.currentTime)){this.flushMainBuffer(0,y.start);return}var I=p.currentTime,B=N.BufferHelper.bufferInfo(p,I,0),F=y.duration,Q=Math.min(this.config.maxFragLookUpTolerance*2,F*.25),j=Math.max(Math.min(y.start-Q,B.end-Q),I+Q);y.start-j>Q&&this.flushMainBuffer(j,y.start)},o.getFwdBufferInfo=function(y,p){var I=this.config,B=this.getLoadPosition();if(!Object(W.isFiniteNumber)(B))return null;var F=N.BufferHelper.bufferInfo(y,B,I.maxBufferHole);if(F.len===0&&F.nextStart!==void 0){var Q=this.fragmentTracker.getBufferedFrag(B,p);if(Q&&F.nextStart<Q.end)return N.BufferHelper.bufferInfo(y,B,Math.max(F.nextStart,I.maxBufferHole))}return F},o.getMaxBufferLength=function(y){var p=this.config,I;return y?I=Math.max(8*p.maxBufferSize/y,p.maxBufferLength):I=p.maxBufferLength,Math.min(I,p.maxMaxBufferLength)},o.reduceMaxBufferLength=function(y){var p=this.config,I=y||p.maxBufferLength;return p.maxMaxBufferLength>=I?(p.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+p.maxMaxBufferLength+"s"),!0):!1},o.getNextFragment=function(y,p){var I,B,F=p.fragments,Q=F.length;if(!Q)return null;var j=this.config,U=F[0].start,X;if(p.live){var $=j.initialLiveManifestSize;if(Q<$)return this.warn("Not enough fragments to start playback (have: "+Q+", need: "+$+")"),null;!p.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(X=this.getInitialLiveFragment(p,F),this.startPosition=X?this.hls.liveSyncPosition||X.start:y)}else y<=U&&(X=F[0]);if(!X){var ne=j.lowLatencyMode?p.partEnd:p.fragmentEnd;X=this.getFragmentAtPosition(y,ne,p)}return(I=X)!==null&&I!==void 0&&I.initSegment&&!((B=X)!==null&&B!==void 0&&B.initSegment.data)&&!this.bitrateTest&&(X=X.initSegment),X},o.getNextPart=function(y,p,I){for(var B=-1,F=!1,Q=!0,j=0,U=y.length;j<U;j++){var X=y[j];if(Q=Q&&!X.independent,B>-1&&I<X.start)break;var $=X.loaded;!$&&(F||X.independent||Q)&&X.fragment===p&&(B=j),F=$}return B},o.loadedEndOfParts=function(y,p){var I=y[y.length-1];return I&&p>I.start&&I.loaded},o.getInitialLiveFragment=function(y,p){var I=this.fragPrevious,B=null;if(I){if(y.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+I.programDateTime),B=Object(S.findFragmentByPDT)(p,I.endProgramDateTime,this.config.maxFragLookUpTolerance)),!B){var F=I.sn+1;if(F>=y.startSN&&F<=y.endSN){var Q=p[F-y.startSN];I.cc===Q.cc&&(B=Q,this.log("Live playlist, switching playlist, load frag with next SN: "+B.sn))}B||(B=Object(S.findFragWithCC)(p,I.cc),B&&this.log("Live playlist, switching playlist, load frag with same CC: "+B.sn))}}else{var j=this.hls.liveSyncPosition;j!==null&&(B=this.getFragmentAtPosition(j,this.bitrateTest?y.fragmentEnd:y.edge,y))}return B},o.getFragmentAtPosition=function(y,p,I){var B=this.config,F=this.fragPrevious,Q=I.fragments,j=I.endSN,U=I.fragmentHint,X=B.maxFragLookUpTolerance,$=!!(B.lowLatencyMode&&I.partList&&U);$&&U&&!this.bitrateTest&&(Q=Q.concat(U),j=U.sn);var ne;if(y<p){var ue=y>p-X?0:X;ne=Object(S.findFragmentByPTS)(F,Q,y,ue)}else ne=Q[Q.length-1];if(ne){var Te=ne.sn-I.startSN,pe=F&&ne.level===F.level,de=Q[Te+1],ce=this.fragmentTracker.getState(ne);if(ce===M.FragmentState.BACKTRACKED){ne=null;for(var fe=Te;Q[fe]&&this.fragmentTracker.getState(Q[fe])===M.FragmentState.BACKTRACKED;)F?ne=Q[fe--]:ne=Q[--fe];ne||(ne=de)}else F&&ne.sn===F.sn&&!$&&(pe&&(ne.sn<j&&this.fragmentTracker.getState(de)!==M.FragmentState.OK?(this.log("SN "+ne.sn+" just loaded, load next one: "+de.sn),ne=de):ne=null))}return ne},o.synchronizeToLiveEdge=function(y){var p=this.config,I=this.media;if(!I)return;var B=this.hls.liveSyncPosition,F=I.currentTime,Q=y.fragments[0].start,j=y.edge,U=F>=Q-p.maxFragLookUpTolerance&&F<=j;if(B!==null&&I.duration>B&&(F<B||!U)){var X=p.liveMaxLatencyDuration!==void 0?p.liveMaxLatencyDuration:p.liveMaxLatencyDurationCount*y.targetduration;(!U&&I.readyState<4||F<j-X)&&(this.loadedmetadata||(this.nextLoadPosition=B),I.readyState&&(this.warn("Playback: "+F.toFixed(3)+" is located too far from the end of live sliding playlist: "+j+", reset currentTime to : "+B.toFixed(3)),I.currentTime=B))}},o.alignPlaylists=function(y,p){var I=this.levels,B=this.levelLastLoaded,F=this.fragPrevious,Q=B!==null?I[B]:null,j=y.fragments.length;if(!j)return this.warn("No fragments in live playlist"),0;var U=y.fragments[0].start,X=!p,$=y.alignedSliding&&Object(W.isFiniteNumber)(U);if(X||!$&&!U){Object(L.alignStream)(F,Q,y);var ne=y.fragments[0].start;return this.log("Live playlist sliding: "+ne.toFixed(2)+" start-sn: "+(p?p.startSN:"na")+"->"+y.startSN+" prev-sn: "+(F?F.sn:"na")+" fragments: "+j),ne}return U},o.waitForCdnTuneIn=function(y){var p=3;return y.live&&y.canBlockReload&&y.tuneInGoal>Math.max(y.partHoldBack,y.partTarget*p)},o.setStartPosition=function(y,p){var I=this.startPosition;if(I<p&&(I=-1),I===-1||this.lastCurrentTime===-1){var B=y.startTimeOffset;Object(W.isFiniteNumber)(B)?(I=p+B,B<0&&(I+=y.totalduration),I=Math.min(Math.max(p,I),p+y.totalduration),this.log("Start time offset "+B+" found in playlist, adjust startPosition to "+I),this.startPosition=I):y.live?I=this.hls.liveSyncPosition||p:this.startPosition=I=0,this.lastCurrentTime=I}this.nextLoadPosition=I},o.getLoadPosition=function(){var y=this.media,p=0;return this.loadedmetadata&&y?p=y.currentTime:this.nextLoadPosition&&(p=this.nextLoadPosition),p},o.handleFragLoadAborted=function(y,p){this.transmuxer&&y.sn!=="initSegment"&&y.stats.aborted&&(this.warn("Fragment "+y.sn+(p?" part"+p.index:"")+" of level "+y.level+" was aborted"),this.resetFragmentLoading(y))},o.resetFragmentLoading=function(y){(!this.fragCurrent||!this.fragContextChanged(y))&&(this.state=A.IDLE)},o.onFragmentOrKeyLoadError=function(y,p){if(p.fatal)return;var I=p.frag;if(!I||I.type!==y)return;var B=this.fragCurrent;console.assert(B&&I.sn===B.sn&&I.level===B.level&&I.urlId===B.urlId,"Frag load error must match current frag to retry");var F=this.config;if(this.fragLoadError+1<=F.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(I.level))return;var Q=Math.min(Math.pow(2,this.fragLoadError)*F.fragLoadingRetryDelay,F.fragLoadingMaxRetryTimeout);this.warn("Fragment "+I.sn+" of "+y+" "+I.level+" failed to load, retrying in "+Q+"ms"),this.retryDate=self.performance.now()+Q,this.fragLoadError++,this.state=A.FRAG_LOADING_WAITING_RETRY}else p.levelRetry?(y===l.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=A.IDLE):(k.logger.error(p.details+" reaches max retry, redispatch as fatal ..."),p.fatal=!0,this.hls.stopLoad(),this.state=A.ERROR)},o.afterBufferFlushed=function(y,p,I){if(!y)return;var B=N.BufferHelper.getBuffered(y);this.fragmentTracker.detectEvictedFragments(p,B,I),this.state===A.ENDED&&this.resetLoadingState()},o.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=A.IDLE},o.resetLiveStartWhenNotLoaded=function(y){if(!this.loadedmetadata){this.startFragRequested=!1;var p=this.levels?this.levels[y].details:null;if(p!=null&&p.live)return this.startPosition=-1,this.setStartPosition(p,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},o.updateLevelTiming=function(y,p,I,B){var F=this,Q=I.details;console.assert(!!Q,"level.details must be defined");var j=Object.keys(y.elementaryStreams).reduce(function(U,X){var $=y.elementaryStreams[X];if($){var ne=$.endPTS-$.startPTS;if(ne<=0)return F.warn("Could not parse fragment "+y.sn+" "+X+" duration reliably ("+ne+") resetting transmuxer to fallback to playlist timing"),F.resetTransmuxer(),U||!1;var ue=B?0:Object(E.updateFragPTSDTS)(Q,y,$.startPTS,$.endPTS,$.startDTS,$.endDTS);return F.hls.trigger(O.Events.LEVEL_PTS_UPDATED,{details:Q,level:I,drift:ue,type:X,frag:y,start:$.startPTS,end:$.endPTS}),!0}return U},!1);j?(this.state=A.PARSED,this.hls.trigger(O.Events.FRAG_PARSED,{frag:y,part:p})):this.resetLoadingState()},o.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},C(s,[{key:"state",get:function(){return this._state},set:function(y){var p=this._state;p!==y&&(this._state=y,this.log(p+"->"+y))}}]),s}(P.default)},"./src/controller/buffer-controller.ts":function(Z,H,w){"use strict";w.r(H),w.d(H,"default",function(){return S});var W=w("./src/polyfills/number.ts"),P=w("./src/events.ts"),M=w("./src/utils/logger.ts"),N=w("./src/errors.ts"),k=w("./src/utils/buffer-helper.ts"),O=w("./src/utils/mediasource-helper.ts"),R=w("./src/loader/fragment.ts"),h=w("./src/controller/buffer-operation-queue.ts"),v=Object(O.getMediaSource)(),L=/([ha]vc.)(?:\.[^.,]+)+/,S=function(){function E(d){var a=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=a.hls,u=a.media,C=a.mediaSource;M.logger.log("[buffer-controller]: Media source opened"),u&&(a.updateMediaElementDuration(),l.trigger(P.Events.MEDIA_ATTACHED,{media:u})),C&&C.removeEventListener("sourceopen",a._onMediaSourceOpen),a.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 b=E.prototype;return b.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},b.destroy=function(){this.unregisterListeners(),this.details=null},b.registerListeners=function(){var a=this.hls;a.on(P.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),a.on(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.on(P.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.on(P.Events.BUFFER_RESET,this.onBufferReset,this),a.on(P.Events.BUFFER_APPENDING,this.onBufferAppending,this),a.on(P.Events.BUFFER_CODECS,this.onBufferCodecs,this),a.on(P.Events.BUFFER_EOS,this.onBufferEos,this),a.on(P.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),a.on(P.Events.LEVEL_UPDATED,this.onLevelUpdated,this),a.on(P.Events.FRAG_PARSED,this.onFragParsed,this),a.on(P.Events.FRAG_CHANGED,this.onFragChanged,this)},b.unregisterListeners=function(){var a=this.hls;a.off(P.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),a.off(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.off(P.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.off(P.Events.BUFFER_RESET,this.onBufferReset,this),a.off(P.Events.BUFFER_APPENDING,this.onBufferAppending,this),a.off(P.Events.BUFFER_CODECS,this.onBufferCodecs,this),a.off(P.Events.BUFFER_EOS,this.onBufferEos,this),a.off(P.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),a.off(P.Events.LEVEL_UPDATED,this.onLevelUpdated,this),a.off(P.Events.FRAG_PARSED,this.onFragParsed,this),a.off(P.Events.FRAG_CHANGED,this.onFragChanged,this)},b._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new h.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},b.onManifestParsed=function(a,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")},b.onMediaAttaching=function(a,l){var u=this.media=l.media;if(u&&v){var C=this.mediaSource=new v;C.addEventListener("sourceopen",this._onMediaSourceOpen),C.addEventListener("sourceended",this._onMediaSourceEnded),C.addEventListener("sourceclose",this._onMediaSourceClose),u.src=self.URL.createObjectURL(C),this._objectUrl=u.src}},b.onMediaDetaching=function(){var a=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(C){M.logger.warn("[buffer-controller]: onMediaDetaching: "+C.message+" while calling endOfStream")}this.onBufferReset(),l.removeEventListener("sourceopen",this._onMediaSourceOpen),l.removeEventListener("sourceended",this._onMediaSourceEnded),l.removeEventListener("sourceclose",this._onMediaSourceClose),a&&(u&&self.URL.revokeObjectURL(u),a.src===u?(a.removeAttribute("src"),a.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)},b.onBufferReset=function(){var a=this;this.getSourceBufferTypes().forEach(function(l){var u=a.sourceBuffer[l];try{u&&(a.removeBufferListeners(l),a.mediaSource&&a.mediaSource.removeSourceBuffer(u),a.sourceBuffer[l]=void 0)}catch(C){M.logger.warn("[buffer-controller]: Failed to reset the "+l+" buffer",C)}}),this._initSourceBuffer()},b.onBufferCodecs=function(a,l){var u=this,C=this.getSourceBufferTypes().length;if(Object.keys(l).forEach(function(g){if(C){var m=u.tracks[g];if(m&&typeof m.buffer.changeType=="function"){var D=l[g],A=D.codec,f=D.levelCodec,c=D.container,s=(m.levelCodec||m.codec).replace(L,"$1"),o=(f||A).replace(L,"$1");if(s!==o){var x=c+";codecs="+(f||A);u.appendChangeType(g,x)}}}else u.pendingTracks[g]=l[g]}),C)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},b.appendChangeType=function(a,l){var u=this,C=this.operationQueue,g={execute:function(){var D=u.sourceBuffer[a];D&&(M.logger.log("[buffer-controller]: changing "+a+" sourceBuffer type to "+l),D.changeType(l)),C.shiftAndExecuteNext(a)},onStart:function(){},onComplete:function(){},onError:function(D){M.logger.warn("[buffer-controller]: Failed to change "+a+" SourceBuffer type",D)}};C.append(g,a)},b.onBufferAppending=function(a,l){var u=this,C=this.hls,g=this.operationQueue,m=this.tracks,D=l.data,A=l.type,f=l.frag,c=l.part,s=l.chunkMeta,o=s.buffering[A],x=self.performance.now();o.start=x;var y=f.stats.buffering,p=c?c.stats.buffering:null;y.start===0&&(y.start=x),p&&p.start===0&&(p.start=x);var I=m.audio,B=A==="audio"&&s.id===1&&(I==null?void 0:I.container)==="audio/mpeg",F={execute:function(){if(o.executeStart=self.performance.now(),B){var j=u.sourceBuffer[A];if(j){var U=f.start-j.timestampOffset;Math.abs(U)>=.1&&(M.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+f.start+" (delta: "+U+") sn: "+f.sn+")"),j.timestampOffset=f.start)}}u.appendExecutor(D,A)},onStart:function(){},onComplete:function(){var j=self.performance.now();o.executeEnd=o.end=j,y.first===0&&(y.first=j),p&&p.first===0&&(p.first=j);var U=u.sourceBuffer,X={};for(var $ in U)X[$]=k.BufferHelper.getBuffered(U[$]);u.appendError=0,u.hls.trigger(P.Events.BUFFER_APPENDED,{type:A,frag:f,part:c,chunkMeta:s,parent:f.type,timeRanges:X})},onError:function(j){M.logger.error("[buffer-controller]: Error encountered while trying to append to the "+A+" SourceBuffer",j);var U={type:N.ErrorTypes.MEDIA_ERROR,parent:f.type,details:N.ErrorDetails.BUFFER_APPEND_ERROR,err:j,fatal:!1};j.code===DOMException.QUOTA_EXCEEDED_ERR?U.details=N.ErrorDetails.BUFFER_FULL_ERROR:(u.appendError++,U.details=N.ErrorDetails.BUFFER_APPEND_ERROR,u.appendError>C.config.appendErrorMaxRetry&&(M.logger.error("[buffer-controller]: Failed "+C.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),U.fatal=!0)),C.trigger(P.Events.ERROR,U)}};g.append(F,A)},b.onBufferFlushing=function(a,l){var u=this,C=this.operationQueue,g=function(D){return{execute:u.removeExecutor.bind(u,D,l.startOffset,l.endOffset),onStart:function(){},onComplete:function(){u.hls.trigger(P.Events.BUFFER_FLUSHED,{type:D})},onError:function(f){M.logger.warn("[buffer-controller]: Failed to remove from "+D+" SourceBuffer",f)}}};l.type?C.append(g(l.type),l.type):this.getSourceBufferTypes().forEach(function(m){C.append(g(m),m)})},b.onFragParsed=function(a,l){var u=this,C=l.frag,g=l.part,m=[],D=g?g.elementaryStreams:C.elementaryStreams;D[R.ElementaryStreamTypes.AUDIOVIDEO]?m.push("audiovideo"):(D[R.ElementaryStreamTypes.AUDIO]&&m.push("audio"),D[R.ElementaryStreamTypes.VIDEO]&&m.push("video"));var A=function(){var c=self.performance.now();C.stats.buffering.end=c,g&&(g.stats.buffering.end=c);var s=g?g.stats:C.stats;u.hls.trigger(P.Events.FRAG_BUFFERED,{frag:C,part:g,stats:s,id:C.type})};m.length===0&&M.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+C.type+" level: "+C.level+" sn: "+C.sn),this.blockBuffers(A,m)},b.onFragChanged=function(a,l){this.flushBackBuffer()},b.onBufferEos=function(a,l){var u=this,C=this.getSourceBufferTypes().reduce(function(g,m){var D=u.sourceBuffer[m];return(!l.type||l.type===m)&&(D&&!D.ended&&(D.ended=!0,M.logger.log("[buffer-controller]: "+m+" sourceBuffer now EOS"))),g&&!!(!D||D.ended)},!0);C&&this.blockBuffers(function(){var g=u.mediaSource;if(!g||g.readyState!=="open")return;g.endOfStream()})},b.onLevelUpdated=function(a,l){var u=l.details;if(!u.fragments.length)return;this.details=u,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},b.flushBackBuffer=function(){var a=this.hls,l=this.details,u=this.media,C=this.sourceBuffer;if(!u||l===null)return;var g=this.getSourceBufferTypes();if(!g.length)return;var m=l.live&&a.config.liveBackBufferLength!==null?a.config.liveBackBufferLength:a.config.backBufferLength;if(!Object(W.isFiniteNumber)(m)||m<0)return;var D=u.currentTime,A=l.levelTargetDuration,f=Math.max(m,A),c=Math.floor(D/A)*A-f;g.forEach(function(s){var o=C[s];if(o){var x=k.BufferHelper.getBuffered(o);x.length>0&&c>x.start(0)&&(a.trigger(P.Events.BACK_BUFFER_REACHED,{bufferEnd:c}),l.live&&a.trigger(P.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:c}),a.trigger(P.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:c,type:s}))}})},b.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var a=this.details,l=this.hls,u=this.media,C=this.mediaSource,g=a.fragments[0].start+a.totalduration,m=u.duration,D=Object(W.isFiniteNumber)(C.duration)?C.duration:0;a.live&&l.config.liveDurationInfinity?(M.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),C.duration=Infinity,this.updateSeekableRange(a)):(g>D&&g>m||!Object(W.isFiniteNumber)(m))&&(M.logger.log("[buffer-controller]: Updating Media Source duration to "+g.toFixed(3)),C.duration=g)},b.updateSeekableRange=function(a){var l=this.mediaSource,u=a.fragments,C=u.length;if(C&&a.live&&l!==null&&l!==void 0&&l.setLiveSeekableRange){var g=Math.max(0,u[0].start),m=Math.max(g,g+a.totalduration);l.setLiveSeekableRange(g,m)}},b.checkPendingTracks=function(){var a=this.bufferCodecEventsExpected,l=this.operationQueue,u=this.pendingTracks,C=Object.keys(u).length;if(C&&!a||C===2){this.createSourceBuffers(u),this.pendingTracks={};var g=this.getSourceBufferTypes();if(g.length===0){this.hls.trigger(P.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}g.forEach(function(m){l.executeNext(m)})}},b.createSourceBuffers=function(a){var l=this.sourceBuffer,u=this.mediaSource;if(!u)throw Error("createSourceBuffers called when mediaSource was null");var C=0;for(var g in a)if(!l[g]){var m=a[g];if(!m)throw Error("source buffer exists for track "+g+", however track does not");var D=m.levelCodec||m.codec,A=m.container+";codecs="+D;M.logger.log("[buffer-controller]: creating sourceBuffer("+A+")");try{var f=l[g]=u.addSourceBuffer(A),c=g;this.addBufferListener(c,"updatestart",this._onSBUpdateStart),this.addBufferListener(c,"updateend",this._onSBUpdateEnd),this.addBufferListener(c,"error",this._onSBUpdateError),this.tracks[g]={buffer:f,codec:D,container:m.container,levelCodec:m.levelCodec,id:m.id},C++}catch(s){M.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+s.message),this.hls.trigger(P.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:s,mimeType:A})}}C&&this.hls.trigger(P.Events.BUFFER_CREATED,{tracks:this.tracks})},b._onSBUpdateStart=function(a){var l=this.operationQueue,u=l.current(a);u.onStart()},b._onSBUpdateEnd=function(a){var l=this.operationQueue,u=l.current(a);u.onComplete(),l.shiftAndExecuteNext(a)},b._onSBUpdateError=function(a,l){M.logger.error("[buffer-controller]: "+a+" SourceBuffer error",l),this.hls.trigger(P.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var u=this.operationQueue.current(a);u&&u.onError(l)},b.removeExecutor=function(a,l,u){var C=this.media,g=this.mediaSource,m=this.operationQueue,D=this.sourceBuffer,A=D[a];if(!C||!g||!A){M.logger.warn("[buffer-controller]: Attempting to remove from the "+a+" SourceBuffer, but it does not exist"),m.shiftAndExecuteNext(a);return}var f=Object(W.isFiniteNumber)(C.duration)?C.duration:Infinity,c=Object(W.isFiniteNumber)(g.duration)?g.duration:Infinity,s=Math.max(0,l),o=Math.min(u,f,c);o>s?(M.logger.log("[buffer-controller]: Removing ["+s+","+o+"] from the "+a+" SourceBuffer"),console.assert(!A.updating,a+" sourceBuffer must not be updating"),A.remove(s,o)):m.shiftAndExecuteNext(a)},b.appendExecutor=function(a,l){var u=this.operationQueue,C=this.sourceBuffer,g=C[l];if(!g){M.logger.warn("[buffer-controller]: Attempting to append to the "+l+" SourceBuffer, but it does not exist"),u.shiftAndExecuteNext(l);return}g.ended=!1,console.assert(!g.updating,l+" sourceBuffer must not be updating"),g.appendBuffer(a)},b.blockBuffers=function(a,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(a);return}var C=this.operationQueue,g=l.map(function(m){return C.appendBlocker(m)});Promise.all(g).then(function(){a(),l.forEach(function(m){var D=u.sourceBuffer[m];(!D||!D.updating)&&C.shiftAndExecuteNext(m)})})},b.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},b.addBufferListener=function(a,l,u){var C=this.sourceBuffer[a];if(!C)return;var g=u.bind(this,a);this.listeners[a].push({event:l,listener:g}),C.addEventListener(l,g)},b.removeBufferListeners=function(a){var l=this.sourceBuffer[a];if(!l)return;this.listeners[a].forEach(function(u){l.removeEventListener(u.event,u.listener)})},E}()},"./src/controller/buffer-operation-queue.ts":function(Z,H,w){"use strict";w.r(H),w.d(H,"default",function(){return P});var W=w("./src/utils/logger.ts"),P=function(){function M(k){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=k}var N=M.prototype;return N.append=function(O,R){var h=this.queues[R];h.push(O),h.length===1&&this.buffers[R]&&this.executeNext(R)},N.insertAbort=function(O,R){var h=this.queues[R];h.unshift(O),this.executeNext(R)},N.appendBlocker=function(O){var R,h=new Promise(function(L){R=L}),v={execute:R,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(v,O),h},N.executeNext=function(O){var R=this.buffers,h=this.queues,v=R[O],L=h[O];if(L.length){var S=L[0];try{S.execute()}catch(E){W.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),S.onError(E),(!v||!v.updating)&&(L.shift(),this.executeNext(O))}}},N.shiftAndExecuteNext=function(O){this.queues[O].shift(),this.executeNext(O)},N.current=function(O){return this.queues[O][0]},M}()},"./src/controller/cap-level-controller.ts":function(Z,H,w){"use strict";w.r(H);var W=w("./src/events.ts");function P(k,O){for(var R=0;R<O.length;R++){var h=O[R];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(k,h.key,h)}}function M(k,O,R){return O&&P(k.prototype,O),R&&P(k,R),k}var N=function(){function k(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 O=k.prototype;return O.setStreamController=function(h){this.streamController=h},O.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},O.registerListeners=function(){var h=this.hls;h.on(W.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),h.on(W.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),h.on(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),h.on(W.Events.BUFFER_CODECS,this.onBufferCodecs,this),h.on(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},O.unregisterListener=function(){var h=this.hls;h.off(W.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),h.off(W.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),h.off(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),h.off(W.Events.BUFFER_CODECS,this.onBufferCodecs,this),h.off(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},O.onFpsDropLevelCapping=function(h,v){k.isLevelAllowed(v.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(v.droppedLevel)},O.onMediaAttaching=function(h,v){this.media=v.media instanceof HTMLVideoElement?v.media:null},O.onManifestParsed=function(h,v){var L=this.hls;this.restrictedLevels=[],this.firstLevel=v.firstLevel,L.config.capLevelToPlayerSize&&v.video&&this.startCapping()},O.onBufferCodecs=function(h,v){var L=this.hls;L.config.capLevelToPlayerSize&&v.video&&this.startCapping()},O.onMediaDetaching=function(){this.stopCapping()},O.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var h=this.hls.levels;if(h.length){var v=this.hls;v.autoLevelCapping=this.getMaxLevel(h.length-1),v.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=v.autoLevelCapping}}},O.getMaxLevel=function(h){var v=this,L=this.hls.levels;if(!L.length)return-1;var S=L.filter(function(E,b){return k.isLevelAllowed(b,v.restrictedLevels)&&b<=h});return this.clientRect=null,k.getMaxLevelByMediaSize(S,this.mediaWidth,this.mediaHeight)},O.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()},O.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},O.getDimensions=function(){if(this.clientRect)return this.clientRect;var h=this.media,v={width:0,height:0};if(h){var L=h.getBoundingClientRect();v.width=L.width,v.height=L.height,!v.width&&!v.height&&(v.width=L.right-L.left||h.width||0,v.height=L.bottom-L.top||h.height||0)}return this.clientRect=v,v},k.isLevelAllowed=function(h,v){return v===void 0&&(v=[]),v.indexOf(h)===-1},k.getMaxLevelByMediaSize=function(h,v,L){if(!h||!h.length)return-1;for(var S=function(l,u){return u?l.width!==u.width||l.height!==u.height:!0},E=h.length-1,b=0;b<h.length;b+=1){var d=h[b];if((d.width>=v||d.height>=L)&&S(d,h[b+1])){E=b;break}}return E},M(k,[{key:"mediaWidth",get:function(){return this.getDimensions().width*k.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*k.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var h=1;try{h=self.devicePixelRatio}catch(v){}return h}}]),k}();H.default=N},"./src/controller/cmcd-controller.ts":function(Z,H,w){"use strict";w.r(H),w.d(H,"default",function(){return S});var W=w("./src/events.ts"),P=w("./src/types/cmcd.ts"),M=w("./src/utils/buffer-helper.ts"),N=w("./src/utils/logger.ts");function k(E,b){for(var d=0;d<b.length;d++){var a=b[d];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(E,a.key,a)}}function O(E,b,d){return b&&k(E.prototype,b),d&&k(E,d),E}function R(E,b){var d=typeof Symbol!="undefined"&&E[Symbol.iterator]||E["@@iterator"];if(d)return(d=d.call(E)).next.bind(d);if(Array.isArray(E)||(d=h(E))||b&&E&&typeof E.length=="number"){d&&(E=d);var a=0;return function(){return a>=E.length?{done:!0}:{done:!1,value:E[a++]}}}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 h(E,b){if(!E)return;if(typeof E=="string")return v(E,b);var d=Object.prototype.toString.call(E).slice(8,-1);if(d==="Object"&&E.constructor&&(d=E.constructor.name),d==="Map"||d==="Set")return Array.from(E);if(d==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d))return v(E,b)}function v(E,b){(b==null||b>E.length)&&(b=E.length);for(var d=0,a=new Array(b);d<b;d++)a[d]=E[d];return a}function L(){return L=Object.assign||function(E){for(var b=1;b<arguments.length;b++){var d=arguments[b];for(var a in d)Object.prototype.hasOwnProperty.call(d,a)&&(E[a]=d[a])}return E},L.apply(this,arguments)}var S=function(){function E(d){var a=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(){a.initialized&&(a.starved=!0),a.buffering=!0},this.onPlaying=function(){a.initialized||(a.initialized=!0),a.buffering=!1},this.applyPlaylistData=function(C){try{a.apply(C,{ot:P.CMCDObjectType.MANIFEST,su:!a.initialized})}catch(g){N.logger.warn("Could not generate manifest CMCD data.",g)}},this.applyFragmentData=function(C){try{var g=C.frag,m=a.hls.levels[g.level],D=a.getObjectType(g),A={d:g.duration*1e3,ot:D};(D===P.CMCDObjectType.VIDEO||D===P.CMCDObjectType.AUDIO||D==P.CMCDObjectType.MUXED)&&(A.br=m.bitrate/1e3,A.tb=a.getTopBandwidth(D),A.bl=a.getBufferLength(D)),a.apply(C,A)}catch(f){N.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||E.uuid(),this.cid=u.contentId,this.useHeaders=u.useHeaders===!0,this.registerListeners())}var b=E.prototype;return b.registerListeners=function(){var a=this.hls;a.on(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),a.on(W.Events.MEDIA_DETACHED,this.onMediaDetached,this),a.on(W.Events.BUFFER_CREATED,this.onBufferCreated,this)},b.unregisterListeners=function(){var a=this.hls;a.off(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),a.off(W.Events.MEDIA_DETACHED,this.onMediaDetached,this),a.off(W.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},b.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},b.onMediaAttached=function(a,l){this.media=l.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},b.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},b.onBufferCreated=function(a,l){var u,C;this.audioBuffer=(u=l.tracks.audio)===null||u===void 0?void 0:u.buffer,this.videoBuffer=(C=l.tracks.video)===null||C===void 0?void 0:C.buffer},b.createData=function(){var a;return{v:P.CMCDVersion,sf:P.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(a=this.media)===null||a===void 0?void 0:a.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},b.apply=function(a,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 C=E.toHeaders(l);if(!Object.keys(C).length)return;a.headers||(a.headers={}),L(a.headers,C)}else{var g=E.toQuery(l);if(!g)return;a.url=E.appendQueryToUri(a.url,g)}},b.getObjectType=function(a){var l=a.type;return l==="subtitle"?P.CMCDObjectType.TIMED_TEXT:a.sn==="initSegment"?P.CMCDObjectType.INIT:l==="audio"?P.CMCDObjectType.AUDIO:l==="main"?this.hls.audioTracks.length?P.CMCDObjectType.VIDEO:P.CMCDObjectType.MUXED:void 0},b.getTopBandwidth=function(a){for(var l=0,u=a===P.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,C=R(u),g;!(g=C()).done;){var m=g.value;m.bitrate>l&&(l=m.bitrate)}return l>0?l:NaN},b.getBufferLength=function(a){var l=this.hls.media,u=a===P.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!u||!l)return NaN;var C=M.BufferHelper.bufferInfo(u,l.currentTime,this.config.maxBufferHole);return C.len*1e3},b.createPlaylistLoader=function(){var a=this.config.pLoader,l=this.applyPlaylistData,u=a||this.config.loader;return function(){function C(m){this.loader=void 0,this.loader=new u(m)}var g=C.prototype;return g.destroy=function(){this.loader.destroy()},g.abort=function(){this.loader.abort()},g.load=function(D,A,f){l(D),this.loader.load(D,A,f)},O(C,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),C}()},b.createFragmentLoader=function(){var a=this.config.fLoader,l=this.applyFragmentData,u=a||this.config.loader;return function(){function C(m){this.loader=void 0,this.loader=new u(m)}var g=C.prototype;return g.destroy=function(){this.loader.destroy()},g.abort=function(){this.loader.abort()},g.load=function(D,A,f){l(D),this.loader.load(D,A,f)},O(C,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),C}()},E.uuid=function(){var a=URL.createObjectURL(new Blob),l=a.toString();return URL.revokeObjectURL(a),l.substr(l.lastIndexOf("/")+1)},E.serialize=function(a){for(var l=[],u=function(B){return!Number.isNaN(B)&&B!=null&&B!==""&&B!==!1},C=function(B){return Math.round(B)},g=function(B){return C(B/100)*100},m=function(B){return encodeURIComponent(B)},D={br:C,d:C,bl:g,dl:g,mtp:g,nor:m,rtp:g,tb:C},A=Object.keys(a||{}).sort(),f=R(A),c;!(c=f()).done;){var s=c.value,o=a[s];if(!u(o))continue;if(s==="v"&&o===1)continue;if(s=="pr"&&o===1)continue;var x=D[s];x&&(o=x(o));var y=typeof o,p=void 0;s==="ot"||s==="sf"||s==="st"?p=s+"="+o:y==="boolean"?p=s:y==="number"?p=s+"="+o:p=s+"="+JSON.stringify(o),l.push(p)}return l.join(",")},E.toHeaders=function(a){for(var l=Object.keys(a),u={},C=["Object","Request","Session","Status"],g=[{},{},{},{}],m={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},D=0,A=l;D<A.length;D++){var f=A[D],c=m[f]!=null?m[f]:1;g[c][f]=a[f]}for(var s=0;s<g.length;s++){var o=E.serialize(g[s]);o&&(u["CMCD-"+C[s]]=o)}return u},E.toQuery=function(a){return"CMCD="+encodeURIComponent(E.serialize(a))},E.appendQueryToUri=function(a,l){if(!l)return a;var u=a.includes("?")?"&":"?";return""+a+u+l},E}()},"./src/controller/eme-controller.ts":function(Z,H,w){"use strict";w.r(H);var W=w("./src/events.ts"),P=w("./src/errors.ts"),M=w("./src/utils/logger.ts"),N=w("./src/utils/mediakeys-helper.ts");function k(S,E){for(var b=0;b<E.length;b++){var d=E[b];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(S,d.key,d)}}function O(S,E,b){return E&&k(S.prototype,E),b&&k(S,b),S}var R=3,h=function(E,b,d){var a={audioCapabilities:[],videoCapabilities:[]};return E.forEach(function(l){a.audioCapabilities.push({contentType:'audio/mp4; codecs="'+l+'"',robustness:d.audioRobustness||""})}),b.forEach(function(l){a.videoCapabilities.push({contentType:'video/mp4; codecs="'+l+'"',robustness:d.videoRobustness||""})}),[a]},v=function(E,b,d,a){switch(E){case N.KeySystems.WIDEVINE:return h(b,d,a);default:throw new Error("Unknown key-system: "+E)}},L=function(){function S(b){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=b,this._config=b.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 E=S.prototype;return E.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},E._registerListeners=function(){this.hls.on(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(W.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(W.Events.MANIFEST_PARSED,this.onManifestParsed,this)},E._unregisterListeners=function(){this.hls.off(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(W.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(W.Events.MANIFEST_PARSED,this.onManifestParsed,this)},E.getLicenseServerUrl=function(d){switch(d){case N.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+d+'"')},E._attemptKeySystemAccess=function(d,a,l){var u=this,C=v(d,a,l,this._drmSystemOptions);M.logger.log("Requesting encrypted media key-system access");var g=this.requestMediaKeySystemAccess(d,C);this.mediaKeysPromise=g.then(function(m){return u._onMediaKeySystemAccessObtained(d,m)}),g.catch(function(m){M.logger.error('Failed to obtain key-system "'+d+'" access:',m)})},E._onMediaKeySystemAccessObtained=function(d,a){var l=this;M.logger.log('Access for key-system "'+d+'" obtained');var u={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:a,mediaKeySystemDomain:d};this._mediaKeysList.push(u);var C=Promise.resolve().then(function(){return a.createMediaKeys()}).then(function(g){return u.mediaKeys=g,M.logger.log('Media-keys created for key-system "'+d+'"'),l._onMediaKeysCreated(),g});return C.catch(function(g){M.logger.error("Failed to create media-keys:",g)}),C},E._onMediaKeysCreated=function(){var d=this;this._mediaKeysList.forEach(function(a){a.mediaKeysSession||(a.mediaKeysSession=a.mediaKeys.createSession(),d._onNewMediaKeySession(a.mediaKeysSession))})},E._onNewMediaKeySession=function(d){var a=this;M.logger.log("New key-system session "+d.sessionId),d.addEventListener("message",function(l){a._onKeySessionMessage(d,l.message)},!1)},E._onKeySessionMessage=function(d,a){M.logger.log("Got EME message event, creating license request"),this._requestLicense(a,function(l){M.logger.log("Received license data (length: "+(l&&l.byteLength)+"), updating key-session"),d.update(l)})},E.onMediaEncrypted=function(d){var a=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(W.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var l=function(C){if(!a._media)return;a._attemptSetMediaKeys(C),a._generateRequestWithPreferredKeySession(d.initDataType,d.initData)};this.mediaKeysPromise.then(l).catch(l)},E._attemptSetMediaKeys=function(d){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var a=this._mediaKeysList[0];if(!a||!a.mediaKeys){M.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(W.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(a.mediaKeys),this._hasSetMediaKeys=!0}},E._generateRequestWithPreferredKeySession=function(d,a){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(W.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 C=u.mediaKeysSession;if(!C){M.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(W.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!a){M.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(W.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,C.generateRequest(d,a).then(function(){M.logger.debug("Key-session generation succeeded")}).catch(function(g){M.logger.error("Error generating key-session request:",g),l.hls.trigger(W.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},E._createLicenseXhr=function(d,a,l){var u=new XMLHttpRequest;u.responseType="arraybuffer",u.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,u,d,a,l);var C=this._licenseXhrSetup;if(C)try{C.call(this.hls,u,d),C=void 0}catch(g){M.logger.error(g)}try{u.readyState||u.open("POST",d,!0),C&&C.call(this.hls,u,d)}catch(g){throw new Error("issue setting up KeySystem license XHR "+g)}return u},E._onLicenseRequestReadyStageChange=function(d,a,l,u){switch(d.readyState){case 4:if(d.status===200){this._requestLicenseFailureCount=0,M.logger.log("License request succeeded");var C=d.response,g=this._licenseResponseCallback;if(g)try{C=g.call(this.hls,d,a)}catch(D){M.logger.error(D)}u(C)}else{if(M.logger.error("License Request XHR failed ("+a+"). Status: "+d.status+" ("+d.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>R){this.hls.trigger(W.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var m=R-this._requestLicenseFailureCount+1;M.logger.warn("Retrying license request, "+m+" attempts left"),this._requestLicense(l,u)}break}},E._generateLicenseRequestChallenge=function(d,a){switch(d.mediaKeySystemDomain){case N.KeySystems.WIDEVINE:return a}throw new Error("unsupported key-system: "+d.mediaKeySystemDomain)},E._requestLicense=function(d,a){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(W.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),C=this._createLicenseXhr(u,d,a);M.logger.log("Sending license request to URL: "+u);var g=this._generateLicenseRequestChallenge(l,d);C.send(g)}catch(m){M.logger.error("Failure requesting DRM license: "+m),this.hls.trigger(W.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},E.onMediaAttached=function(d,a){if(!this._emeEnabled)return;var l=a.media;this._media=l,l.addEventListener("encrypted",this._onMediaEncrypted)},E.onMediaDetached=function(){var d=this._media,a=this._mediaKeysList;if(!d)return;d.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(a.map(function(l){if(l.mediaKeysSession)return l.mediaKeysSession.close().catch(function(){})})).then(function(){return d.setMediaKeys(null)}).catch(function(){})},E.onManifestParsed=function(d,a){if(!this._emeEnabled)return;var l=a.levels.map(function(C){return C.audioCodec}).filter(function(C){return!!C}),u=a.levels.map(function(C){return C.videoCodec}).filter(function(C){return!!C});this._attemptKeySystemAccess(N.KeySystems.WIDEVINE,l,u)},O(S,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),S}();H.default=L},"./src/controller/fps-controller.ts":function(Z,H,w){"use strict";w.r(H);var W=w("./src/events.ts"),P=w("./src/utils/logger.ts"),M=function(){function N(O){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=O,this.registerListeners()}var k=N.prototype;return k.setStreamController=function(R){this.streamController=R},k.registerListeners=function(){this.hls.on(W.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},k.unregisterListeners=function(){this.hls.off(W.Events.MEDIA_ATTACHING,this.onMediaAttaching)},k.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},k.onMediaAttaching=function(R,h){var v=this.hls.config;if(v.capLevelOnFPSDrop){var L=h.media instanceof self.HTMLVideoElement?h.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),v.fpsDroppedMonitoringPeriod)}},k.checkFPS=function(R,h,v){var L=performance.now();if(h){if(this.lastTime){var S=L-this.lastTime,E=v-this.lastDroppedFrames,b=h-this.lastDecodedFrames,d=1e3*E/S,a=this.hls;if(a.trigger(W.Events.FPS_DROP,{currentDropped:E,currentDecoded:b,totalDroppedFrames:v}),d>0&&E>a.config.fpsDroppedMonitoringThreshold*b){var l=a.currentLevel;P.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+l),l>0&&(a.autoLevelCapping===-1||a.autoLevelCapping>=l)&&(l=l-1,a.trigger(W.Events.FPS_DROP_LEVEL_CAPPING,{level:l,droppedLevel:a.currentLevel}),a.autoLevelCapping=l,this.streamController.nextLevelSwitch())}}this.lastTime=L,this.lastDroppedFrames=v,this.lastDecodedFrames=h}},k.checkFPSInterval=function(){var R=this.media;if(R)if(this.isVideoPlaybackQualityAvailable){var h=R.getVideoPlaybackQuality();this.checkFPS(R,h.totalVideoFrames,h.droppedVideoFrames)}else this.checkFPS(R,R.webkitDecodedFrameCount,R.webkitDroppedFrameCount)},N}();H.default=M},"./src/controller/fragment-finders.ts":function(Z,H,w){"use strict";w.r(H),w.d(H,"findFragmentByPDT",function(){return M}),w.d(H,"findFragmentByPTS",function(){return N}),w.d(H,"fragmentWithinToleranceTest",function(){return k}),w.d(H,"pdtWithinToleranceTest",function(){return O}),w.d(H,"findFragWithCC",function(){return R});var W=w("./src/polyfills/number.ts"),P=w("./src/utils/binary-search.ts");function M(h,v,L){if(v===null||!Array.isArray(h)||!h.length||!Object(W.isFiniteNumber)(v))return null;var S=h[0].programDateTime;if(v<(S||0))return null;var E=h[h.length-1].endProgramDateTime;if(v>=(E||0))return null;L=L||0;for(var b=0;b<h.length;++b){var d=h[b];if(O(v,L,d))return d}return null}function N(h,v,L,S){L===void 0&&(L=0),S===void 0&&(S=0);var E=null;if(h?E=v[h.sn-v[0].sn+1]||null:L===0&&v[0].start===0&&(E=v[0]),E&&k(L,S,E)===0)return E;var b=P.default.search(v,k.bind(null,L,S));return b||E}function k(h,v,L){h===void 0&&(h=0),v===void 0&&(v=0);var S=Math.min(v,L.duration+(L.deltaPTS?L.deltaPTS:0));return L.start+L.duration-S<=h?1:L.start-S>h&&L.start?-1:0}function O(h,v,L){var S=Math.min(v,L.duration+(L.deltaPTS?L.deltaPTS:0))*1e3,E=L.endProgramDateTime||0;return E-S>h}function R(h,v){return P.default.search(h,function(L){return L.cc<v?1:L.cc>v?-1:0})}},"./src/controller/fragment-tracker.ts":function(Z,H,w){"use strict";w.r(H),w.d(H,"FragmentState",function(){return M}),w.d(H,"FragmentTracker",function(){return N});var W=w("./src/events.ts"),P=w("./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 N=function(){function R(v){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=v,this._registerListeners()}var h=R.prototype;return h._registerListeners=function(){var L=this.hls;L.on(W.Events.BUFFER_APPENDED,this.onBufferAppended,this),L.on(W.Events.FRAG_BUFFERED,this.onFragBuffered,this),L.on(W.Events.FRAG_LOADED,this.onFragLoaded,this)},h._unregisterListeners=function(){var L=this.hls;L.off(W.Events.BUFFER_APPENDED,this.onBufferAppended,this),L.off(W.Events.FRAG_BUFFERED,this.onFragBuffered,this),L.off(W.Events.FRAG_LOADED,this.onFragLoaded,this)},h.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},h.getAppendedFrag=function(L,S){if(S===P.PlaylistLevelType.MAIN){var E=this.activeFragment,b=this.activeParts;if(!E)return null;if(b)for(var d=b.length;d--;){var a=b[d],l=a?a.end:E.appendedPTS;if(a.start<=L&&l!==void 0&&L<=l)return d>9&&(this.activeParts=b.slice(d-9)),a}else if(E.start<=L&&E.appendedPTS!==void 0&&L<=E.appendedPTS)return E}return this.getBufferedFrag(L,S)},h.getBufferedFrag=function(L,S){for(var E=this.fragments,b=Object.keys(E),d=b.length;d--;){var a=E[b[d]];if((a==null?void 0:a.body.type)===S&&a.buffered){var l=a.body;if(l.start<=L&&L<=l.end)return l}}return null},h.detectEvictedFragments=function(L,S,E){var b=this;Object.keys(this.fragments).forEach(function(d){var a=b.fragments[d];if(!a)return;if(!a.buffered){a.body.type===E&&b.removeFragment(a.body);return}var l=a.range[L];if(!l)return;l.time.some(function(u){var C=!b.isTimeBuffered(u.startPTS,u.endPTS,S);return C&&b.removeFragment(a.body),C})})},h.detectPartialFragments=function(L){var S=this,E=this.timeRanges,b=L.frag,d=L.part;if(!E||b.sn==="initSegment")return;var a=O(b),l=this.fragments[a];if(!l)return;Object.keys(E).forEach(function(u){var C=b.elementaryStreams[u];if(!C)return;var g=E[u],m=d!==null||C.partial===!0;l.range[u]=S.getBufferedTimes(b,d,m,g)}),l.backtrack=l.loaded=null,Object.keys(l.range).length?l.buffered=!0:this.removeFragment(l.body)},h.fragBuffered=function(L){var S=O(L),E=this.fragments[S];E&&(E.backtrack=E.loaded=null,E.buffered=!0)},h.getBufferedTimes=function(L,S,E,b){for(var d={time:[],partial:E},a=S?S.start:L.start,l=S?S.end:L.end,u=L.minEndPTS||l,C=L.maxStartPTS||a,g=0;g<b.length;g++){var m=b.start(g)-this.bufferPadding,D=b.end(g)+this.bufferPadding;if(C>=m&&u<=D){d.time.push({startPTS:Math.max(a,b.start(g)),endPTS:Math.min(l,b.end(g))});break}else if(a<D&&l>m)d.partial=!0,d.time.push({startPTS:Math.max(a,b.start(g)),endPTS:Math.min(l,b.end(g))});else if(l<=m)break}return d},h.getPartialFragment=function(L){var S=null,E,b,d,a=0,l=this.bufferPadding,u=this.fragments;return Object.keys(u).forEach(function(C){var g=u[C];if(!g)return;k(g)&&(b=g.body.start-l,d=g.body.end+l,L>=b&&L<=d&&(E=Math.min(L-b,d-L),a<=E&&(S=g.body,a=E)))}),S},h.getState=function(L){var S=O(L),E=this.fragments[S];return E?E.buffered?k(E)?M.PARTIAL:M.OK:E.backtrack?M.BACKTRACKED:M.APPENDING:M.NOT_LOADED},h.backtrack=function(L,S){var E=O(L),b=this.fragments[E];if(!b||b.backtrack)return null;var d=b.backtrack=S||b.loaded;return b.loaded=null,d},h.getBacktrackData=function(L){var S=O(L),E=this.fragments[S];if(E){var b,d=E.backtrack;if(d!=null&&(b=d.payload)!==null&&b!==void 0&&b.byteLength)return d;this.removeFragment(L)}return null},h.isTimeBuffered=function(L,S,E){for(var b,d,a=0;a<E.length;a++){if(b=E.start(a)-this.bufferPadding,d=E.end(a)+this.bufferPadding,L>=b&&S<=d)return!0;if(S<=b)return!1}return!1},h.onFragLoaded=function(L,S){var E=S.frag,b=S.part;if(E.sn==="initSegment"||E.bitrateTest||b)return;var d=O(E);this.fragments[d]={body:E,loaded:S,backtrack:null,buffered:!1,range:Object.create(null)}},h.onBufferAppended=function(L,S){var E=this,b=S.frag,d=S.part,a=S.timeRanges;if(b.type===P.PlaylistLevelType.MAIN)if(this.activeFragment=b,d){var l=this.activeParts;l||(this.activeParts=l=[]),l.push(d)}else this.activeParts=null;this.timeRanges=a,Object.keys(a).forEach(function(u){var C=a[u];if(E.detectEvictedFragments(u,C),!d)for(var g=0;g<C.length;g++)b.appendedPTS=Math.max(C.end(g),b.appendedPTS||0)})},h.onFragBuffered=function(L,S){this.detectPartialFragments(S)},h.hasFragment=function(L){var S=O(L);return!!this.fragments[S]},h.removeFragmentsInRange=function(L,S,E){var b=this;Object.keys(this.fragments).forEach(function(d){var a=b.fragments[d];if(!a)return;if(a.buffered){var l=a.body;l.type===E&&l.start<S&&l.end>L&&b.removeFragment(l)}})},h.removeFragment=function(L){var S=O(L);L.stats.loaded=0,L.clearElementaryStreamInfo(),delete this.fragments[S]},h.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},R}();function k(R){var h,v;return R.buffered&&(((h=R.range.video)===null||h===void 0?void 0:h.partial)||((v=R.range.audio)===null||v===void 0?void 0:v.partial))}function O(R){return R.type+"_"+R.level+"_"+R.urlId+"_"+R.sn}},"./src/controller/gap-controller.ts":function(Z,H,w){"use strict";w.r(H),w.d(H,"STALL_MINIMUM_DURATION_MS",function(){return k}),w.d(H,"MAX_START_GAP_JUMP",function(){return O}),w.d(H,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return R}),w.d(H,"SKIP_BUFFER_RANGE_START",function(){return h}),w.d(H,"default",function(){return v});var W=w("./src/utils/buffer-helper.ts"),P=w("./src/errors.ts"),M=w("./src/events.ts"),N=w("./src/utils/logger.ts"),k=250,O=2,R=.1,h=.05,v=function(){function L(E,b,d,a){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=E,this.media=b,this.fragmentTracker=d,this.hls=a}var S=L.prototype;return S.destroy=function(){this.hls=this.fragmentTracker=this.media=null},S.poll=function(b){var d=this.config,a=this.media,l=this.stalled,u=a.currentTime,C=a.seeking,g=this.seeking&&!C,m=!this.seeking&&C;if(this.seeking=C,u!==b){if(this.moved=!0,l!==null){if(this.stallReported){var D=self.performance.now()-l;N.logger.warn("playback not stuck anymore @"+u+", after "+Math.round(D)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((m||g)&&(this.stalled=null),a.paused||a.ended||a.playbackRate===0||!W.BufferHelper.getBuffered(a).length)return;var A=W.BufferHelper.bufferInfo(a,u,0),f=A.len>0,c=A.nextStart||0;if(!f&&!c)return;if(C){var s=A.len>O,o=!c||c-u>O&&!this.fragmentTracker.getPartialFragment(u);if(s||o)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var x,y=Math.max(c,A.start||0)-u,p=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,I=p==null||((x=p.details)===null||x===void 0)?void 0:x.live,B=I?p.details.targetduration*2:O;if(y>0&&y<=B){this._trySkipBufferHole(null);return}}var F=self.performance.now();if(l===null){this.stalled=F;return}var Q=F-l;!C&&Q>=k&&this._reportStall(A.len);var j=W.BufferHelper.bufferInfo(a,u,d.maxBufferHole);this._tryFixBufferStall(j,Q)},S._tryFixBufferStall=function(b,d){var a=this.config,l=this.fragmentTracker,u=this.media,C=u.currentTime,g=l.getPartialFragment(C);if(g){var m=this._trySkipBufferHole(g);if(m)return}b.len>a.maxBufferHole&&d>a.highBufferWatchdogPeriod*1e3&&(N.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},S._reportStall=function(b){var d=this.hls,a=this.media,l=this.stallReported;l||(this.stallReported=!0,N.logger.warn("Playback stalling at @"+a.currentTime+" due to low buffer (buffer="+b+")"),d.trigger(M.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:b}))},S._trySkipBufferHole=function(b){for(var d=this.config,a=this.hls,l=this.media,u=l.currentTime,C=0,g=W.BufferHelper.getBuffered(l),m=0;m<g.length;m++){var D=g.start(m);if(u+d.maxBufferHole>=C&&u<D){var A=Math.max(D+h,l.currentTime+R);return N.logger.warn("skipping hole, adjusting currentTime from "+u+" to "+A),this.moved=!0,this.stalled=null,l.currentTime=A,b&&a.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 "+A,frag:b}),A}C=g.end(m)}return 0},S._tryNudgeBuffer=function(){var b=this.config,d=this.hls,a=this.media,l=a.currentTime,u=(this.nudgeRetry||0)+1;if(this.nudgeRetry=u,u<b.nudgeMaxRetry){var C=l+u*b.nudgeOffset;N.logger.warn("Nudging 'currentTime' from "+l+" to "+C),a.currentTime=C,d.trigger(M.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else N.logger.error("Playhead still not moving while enough data buffered @"+l+" after "+b.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(Z,H,w){"use strict";w.r(H);var W=w("./src/events.ts"),P=w("./src/utils/texttrack-utils.ts"),M=w("./src/demux/id3.ts"),N=.25,k=function(){function O(h){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=h,this._registerListeners()}var R=O.prototype;return R.destroy=function(){this._unregisterListeners()},R._registerListeners=function(){var v=this.hls;v.on(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),v.on(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),v.on(W.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),v.on(W.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},R._unregisterListeners=function(){var v=this.hls;v.off(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),v.off(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),v.off(W.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),v.off(W.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},R.onMediaAttached=function(v,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(v){if(!this.media)return;for(var L=0;L<v.length;L++){var S=v[L];if(S.kind==="metadata"&&S.label==="id3")return Object(P.sendAddTrackEvent)(S,this.media),S}return this.media.addTextTrack("metadata","id3")},R.onFragParsingMetadata=function(v,L){if(!this.media)return;var S=L.frag,E=L.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var b=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,d=0;d<E.length;d++){var a=M.getID3Frames(E[d].data);if(a){var l=E[d].pts,u=d<E.length-1?E[d+1].pts:S.end,C=u-l;C<=0&&(u=l+N);for(var g=0;g<a.length;g++){var m=a[g];if(!M.isTimeStampFrame(m)){var D=new b(l,u,"");D.value=m,this.id3Track.addCue(D)}}}}},R.onBufferFlushing=function(v,L){var S=L.startOffset,E=L.endOffset,b=L.type;if(!b||b==="audio"){var d=this.id3Track;d&&Object(P.removeCuesInRange)(d,S,E)}},O}();H.default=k},"./src/controller/latency-controller.ts":function(Z,H,w){"use strict";w.r(H),w.d(H,"default",function(){return O});var W=w("./src/errors.ts"),P=w("./src/events.ts"),M=w("./src/utils/logger.ts");function N(R,h){for(var v=0;v<h.length;v++){var L=h[v];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(R,L.key,L)}}function k(R,h,v){return h&&N(R.prototype,h),v&&N(R,v),R}var O=function(){function R(v){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=v,this.config=v.config,this.registerListeners()}var h=R.prototype;return h.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},h.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)},h.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)},h.onMediaAttached=function(L,S){this.media=S.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},h.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},h.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},h.onLevelUpdated=function(L,S){var E=S.details;this.levelDetails=E,E.advanced&&this.timeupdate(),!E.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},h.onError=function(L,S){if(S.details!==W.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,M.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},h.timeupdate=function(){var L=this.media,S=this.levelDetails;if(!L||!S)return;this.currentTime=L.currentTime;var E=this.computeLatency();if(E===null)return;this._latency=E;var b=this.config,d=b.lowLatencyMode,a=b.maxLiveSyncPlaybackRate;if(!d||a===1)return;var l=this.targetLatency;if(l===null)return;var u=E-l,C=Math.min(this.maxLatency,l+S.targetduration),g=u<C;if(S.live&&g&&u>.05&&this.forwardBufferLength>1){var m=Math.min(2,Math.max(1,a)),D=Math.round(2/(1+Math.exp(-.75*u-this.edgeStalled))*20)/20;L.playbackRate=Math.min(m,Math.max(1,D))}else L.playbackRate!==1&&L.playbackRate!==0&&(L.playbackRate=1)},h.estimateLiveEdge=function(){var L=this.levelDetails;return L===null?null:L.edge+L.age},h.computeLatency=function(){var L=this.estimateLiveEdge();return L===null?null:L-this.currentTime},k(R,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var L=this.config,S=this.levelDetails;return L.liveMaxLatencyDuration!==void 0?L.liveMaxLatencyDuration:S?L.liveMaxLatencyDurationCount*S.targetduration:0}},{key:"targetLatency",get:function(){var L=this.levelDetails;if(L===null)return null;var S=L.holdBack,E=L.partHoldBack,b=L.targetduration,d=this.config,a=d.liveSyncDuration,l=d.liveSyncDurationCount,u=d.lowLatencyMode,C=this.hls.userConfig,g=u&&E||S;(C.liveSyncDuration||C.liveSyncDurationCount||g===0)&&(g=a!==void 0?a:l*b);var m=b,D=1;return g+Math.min(this.stallCount*D,m)}},{key:"liveSyncPosition",get:function(){var L=this.estimateLiveEdge(),S=this.targetLatency,E=this.levelDetails;if(L===null||S===null||E===null)return null;var b=E.edge,d=L-S-this.edgeStalled,a=b-E.totalduration,l=b-(this.config.lowLatencyMode&&E.partTarget||E.targetduration);return Math.min(Math.max(a,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 S=(this.config.lowLatencyMode&&L.partTarget||L.targetduration)*3;return Math.max(L.age-S,0)}},{key:"forwardBufferLength",get:function(){var L=this.media,S=this.levelDetails;if(!L||!S)return 0;var E=L.buffered.length;return E?L.buffered.end(E-1):S.edge-this.currentTime}}]),R}()},"./src/controller/level-controller.ts":function(Z,H,w){"use strict";w.r(H),w.d(H,"default",function(){return d});var W=w("./src/types/level.ts"),P=w("./src/events.ts"),M=w("./src/errors.ts"),N=w("./src/utils/codecs.ts"),k=w("./src/controller/level-helper.ts"),O=w("./src/controller/base-playlist-controller.ts"),R=w("./src/types/loader.ts");function h(){return h=Object.assign||function(a){for(var l=1;l<arguments.length;l++){var u=arguments[l];for(var C in u)Object.prototype.hasOwnProperty.call(u,C)&&(a[C]=u[C])}return a},h.apply(this,arguments)}function v(a,l){for(var u=0;u<l.length;u++){var C=l[u];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(a,C.key,C)}}function L(a,l,u){return l&&v(a.prototype,l),u&&v(a,u),a}function S(a,l){a.prototype=Object.create(l.prototype),a.prototype.constructor=a,E(a,l)}function E(a,l){return E=Object.setPrototypeOf||function(C,g){return C.__proto__=g,C},E(a,l)}var b=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),d=function(a){S(l,a);function l(C){var g;return g=a.call(this,C,"[level-controller]")||this,g._levels=[],g._firstLevel=-1,g._startLevel=void 0,g.currentLevelIndex=-1,g.manualLevelIndex=-1,g.onParsedComplete=void 0,g._registerListeners(),g}var u=l.prototype;return u._registerListeners=function(){var g=this.hls;g.on(P.Events.MANIFEST_LOADED,this.onManifestLoaded,this),g.on(P.Events.LEVEL_LOADED,this.onLevelLoaded,this),g.on(P.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),g.on(P.Events.FRAG_LOADED,this.onFragLoaded,this),g.on(P.Events.ERROR,this.onError,this)},u._unregisterListeners=function(){var g=this.hls;g.off(P.Events.MANIFEST_LOADED,this.onManifestLoaded,this),g.off(P.Events.LEVEL_LOADED,this.onLevelLoaded,this),g.off(P.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),g.off(P.Events.FRAG_LOADED,this.onFragLoaded,this),g.off(P.Events.ERROR,this.onError,this)},u.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,a.prototype.destroy.call(this)},u.startLoad=function(){var g=this._levels;g.forEach(function(m){m.loadError=0}),a.prototype.startLoad.call(this)},u.onManifestLoaded=function(g,m){var D=[],A=[],f=[],c,s={},o,x=!1,y=!1,p=!1;if(m.levels.forEach(function(Q){var j=Q.attrs;x=x||!!(Q.width&&Q.height),y=y||!!Q.videoCodec,p=p||!!Q.audioCodec,b&&Q.audioCodec&&Q.audioCodec.indexOf("mp4a.40.34")!==-1&&(Q.audioCodec=void 0);var U=Q.bitrate+"-"+Q.attrs.RESOLUTION+"-"+Q.attrs.CODECS;o=s[U],o?o.url.push(Q.url):(o=new W.Level(Q),s[U]=o,D.push(o)),j&&(j.AUDIO&&Object(k.addGroupId)(o,"audio",j.AUDIO),j.SUBTITLES&&Object(k.addGroupId)(o,"text",j.SUBTITLES))}),(x||y)&&p&&(D=D.filter(function(Q){var j=Q.videoCodec,U=Q.width,X=Q.height;return!!j||!!(U&&X)})),D=D.filter(function(Q){var j=Q.audioCodec,U=Q.videoCodec;return(!j||Object(N.isCodecSupportedInMp4)(j,"audio"))&&(!U||Object(N.isCodecSupportedInMp4)(U,"video"))}),m.audioTracks&&(A=m.audioTracks.filter(function(Q){return!Q.audioCodec||Object(N.isCodecSupportedInMp4)(Q.audioCodec,"audio")}),Object(k.assignTrackIdsByGroup)(A)),m.subtitles&&(f=m.subtitles,Object(k.assignTrackIdsByGroup)(f)),D.length>0){c=D[0].bitrate,D.sort(function(Q,j){return Q.bitrate-j.bitrate}),this._levels=D;for(var I=0;I<D.length;I++)if(D[I].bitrate===c){this._firstLevel=I,this.log("manifest loaded, "+D.length+" level(s) found, first bitrate: "+c);break}var B=p&&!y,F={levels:D,audioTracks:A,subtitleTracks:f,firstLevel:this._firstLevel,stats:m.stats,audio:p,video:y,altAudio:!B&&A.some(function(Q){return!!Q.url})};this.hls.trigger(P.Events.MANIFEST_PARSED,F),(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:m.url,reason:"no level with compatible codecs found in manifest"})},u.onError=function(g,m){if(a.prototype.onError.call(this,g,m),m.fatal)return;var D=m.context,A=this._levels[this.currentLevelIndex];if(D&&(D.type===R.PlaylistContextType.AUDIO_TRACK&&A.audioGroupIds&&D.groupId===A.audioGroupIds[A.urlId]||D.type===R.PlaylistContextType.SUBTITLE_TRACK&&A.textGroupIds&&D.groupId===A.textGroupIds[A.urlId])){this.redundantFailover(this.currentLevelIndex);return}var f=!1,c=!0,s;switch(m.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(m.frag){var o=this._levels[m.frag.level];o?(o.fragmentError++,o.fragmentError>this.hls.config.fragLoadingMaxRetry&&(s=m.frag.level)):s=m.frag.level}break;case M.ErrorDetails.LEVEL_LOAD_ERROR:case M.ErrorDetails.LEVEL_LOAD_TIMEOUT:D&&(D.deliveryDirectives&&(c=!1),s=D.level),f=!0;break;case M.ErrorDetails.REMUX_ALLOC_ERROR:s=m.level,f=!0;break}s!==void 0&&this.recoverLevel(m,s,f,c)},u.recoverLevel=function(g,m,D,A){var f=g.details,c=this._levels[m];if(c.loadError++,D){var s=this.retryLoadingOrFail(g);if(s)g.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(A){var o=c.url.length;if(o>1&&c.loadError<o)g.levelRetry=!0,this.redundantFailover(m);else if(this.manualLevelIndex===-1){var x=m===0?this._levels.length-1:m-1;this.currentLevelIndex!==x&&this._levels[x].loadError===0&&(this.warn(f+": switch to "+x),g.levelRetry=!0,this.hls.nextAutoLevel=x)}}},u.redundantFailover=function(g){var m=this._levels[g],D=m.url.length;if(D>1){var A=(m.urlId+1)%D;this.warn("Switching to redundant URL-id "+A),this._levels.forEach(function(f){f.urlId=A}),this.level=g}},u.onFragLoaded=function(g,m){var D=m.frag;if(D!==void 0&&D.type===R.PlaylistLevelType.MAIN){var A=this._levels[D.level];A!==void 0&&(A.fragmentError=0,A.loadError=0)}},u.onLevelLoaded=function(g,m){var D,A=m.level,f=m.details,c=this._levels[A];if(!c){var s;this.warn("Invalid level index "+A),(s=m.deliveryDirectives)!==null&&s!==void 0&&s.skip&&(f.deltaUpdateFailed=!0);return}A===this.currentLevelIndex?(c.fragmentError===0&&(c.loadError=0,this.retryCount=0),this.playlistLoaded(A,m,c.details)):(D=m.deliveryDirectives)!==null&&D!==void 0&&D.skip&&(f.deltaUpdateFailed=!0)},u.onAudioTrackSwitched=function(g,m){var D=this.hls.levels[this.currentLevelIndex];if(!D)return;if(D.audioGroupIds){for(var A=-1,f=this.hls.audioTracks[m.id].groupId,c=0;c<D.audioGroupIds.length;c++)if(D.audioGroupIds[c]===f){A=c;break}A!==D.urlId&&(D.urlId=A,this.startLoad())}},u.loadPlaylist=function(g){var m=this.currentLevelIndex,D=this._levels[m];if(this.canLoad&&D&&D.url.length>0){var A=D.urlId,f=D.url[A];if(g)try{f=g.addDirectives(f)}catch(c){this.warn("Could not construct new URL with HLS Delivery Directives: "+c)}this.log("Attempt loading level index "+m+(g?" at sn "+g.msn+" part "+g.part:"")+" with URL-id "+A+" "+f),this.clearTimer(),this.hls.trigger(P.Events.LEVEL_LOADING,{url:f,level:m,id:A,deliveryDirectives:g||null})}},u.removeLevel=function(g,m){var D=function(c,s){return s!==m},A=this._levels.filter(function(f,c){return c!==g?!0:f.url.length>1&&m!==void 0?(f.url=f.url.filter(D),f.audioGroupIds&&(f.audioGroupIds=f.audioGroupIds.filter(D)),f.textGroupIds&&(f.textGroupIds=f.textGroupIds.filter(D)),f.urlId=0,!0):!1}).map(function(f,c){var s=f.details;return s!=null&&s.fragments&&s.fragments.forEach(function(o){o.level=c}),f});this._levels=A,this.hls.trigger(P.Events.LEVELS_UPDATED,{levels:A})},L(l,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(g){var m,D=this._levels;if(D.length===0)return;if(this.currentLevelIndex===g&&(m=D[g])!==null&&m!==void 0&&m.details)return;if(g<0||g>=D.length){var A=g<0;if(this.hls.trigger(P.Events.ERROR,{type:M.ErrorTypes.OTHER_ERROR,details:M.ErrorDetails.LEVEL_SWITCH_ERROR,level:g,fatal:A,reason:"invalid level idx"}),A)return;g=Math.min(g,D.length-1)}this.clearTimer();var f=this.currentLevelIndex,c=D[f],s=D[g];this.log("switching to level "+g+" from "+f),this.currentLevelIndex=g;var o=h({},s,{level:g,maxBitrate:s.maxBitrate,uri:s.uri,urlId:s.urlId});delete o._urlId,this.hls.trigger(P.Events.LEVEL_SWITCHING,o);var x=s.details;if(!x||x.live){var y=this.switchParams(s.uri,c==null?void 0:c.details);this.loadPlaylist(y)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(g){this.manualLevelIndex=g,this._startLevel===void 0&&(this._startLevel=g),g!==-1&&(this.level=g)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(g){this._firstLevel=g}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var g=this.hls.config.startLevel;return g!==void 0?g:this._firstLevel}else return this._startLevel},set:function(g){this._startLevel=g}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(g){this.level=g,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=g)}}]),l}(O.default)},"./src/controller/level-helper.ts":function(Z,H,w){"use strict";w.r(H),w.d(H,"addGroupId",function(){return M}),w.d(H,"assignTrackIdsByGroup",function(){return N}),w.d(H,"updatePTS",function(){return k}),w.d(H,"updateFragPTSDTS",function(){return R}),w.d(H,"mergeDetails",function(){return h}),w.d(H,"mapPartIntersection",function(){return v}),w.d(H,"mapFragmentIntersection",function(){return L}),w.d(H,"adjustSliding",function(){return S}),w.d(H,"addSliding",function(){return E}),w.d(H,"computeReloadInterval",function(){return b}),w.d(H,"getFragmentWithSN",function(){return d}),w.d(H,"getPartWith",function(){return a});var W=w("./src/polyfills/number.ts"),P=w("./src/utils/logger.ts");function M(l,u,C){switch(u){case"audio":l.audioGroupIds||(l.audioGroupIds=[]),l.audioGroupIds.push(C);break;case"text":l.textGroupIds||(l.textGroupIds=[]),l.textGroupIds.push(C);break}}function N(l){var u={};l.forEach(function(C){var g=C.groupId||"";C.id=u[g]=u[g]||0,u[g]++})}function k(l,u,C){var g=l[u],m=l[C];O(g,m)}function O(l,u){var C=u.startPTS;if(Object(W.isFiniteNumber)(C)){var g=0,m;u.sn>l.sn?(g=C-l.start,m=l):(g=l.start-C,m=u),m.duration!==g&&(m.duration=g)}else if(u.sn>l.sn){var D=l.cc===u.cc;D&&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,C,g,m,D){var A=g-C;A<=0&&(P.logger.warn("Fragment should have a positive duration",u),g=C+u.duration,D=m+u.duration);var f=C,c=g,s=u.startPTS,o=u.endPTS;if(Object(W.isFiniteNumber)(s)){var x=Math.abs(s-C);Object(W.isFiniteNumber)(u.deltaPTS)?u.deltaPTS=Math.max(x,u.deltaPTS):u.deltaPTS=x,f=Math.max(C,s),C=Math.min(C,s),m=Math.min(m,u.startDTS),c=Math.min(g,o),g=Math.max(g,o),D=Math.max(D,u.endDTS)}u.duration=g-C;var y=C-u.start;u.appendedPTS=g,u.start=u.startPTS=C,u.maxStartPTS=f,u.startDTS=m,u.endPTS=g,u.minEndPTS=c,u.endDTS=D;var p=u.sn;if(!l||p<l.startSN||p>l.endSN)return 0;var I,B=p-l.startSN,F=l.fragments;for(F[B]=u,I=B;I>0;I--)O(F[I],F[I-1]);for(I=B;I<F.length-1;I++)O(F[I],F[I+1]);return l.fragmentHint&&O(F[F.length-1],l.fragmentHint),l.PTSKnown=l.alignedSliding=!0,y}function h(l,u){for(var C=null,g=l.fragments,m=g.length-1;m>=0;m--){var D=g[m].initSegment;if(D){C=D;break}}l.fragmentHint&&delete l.fragmentHint.endPTS;var A=0,f;if(L(l,u,function(I,B){I.relurl&&(A=I.cc-B.cc),Object(W.isFiniteNumber)(I.startPTS)&&Object(W.isFiniteNumber)(I.endPTS)&&(B.start=B.startPTS=I.startPTS,B.startDTS=I.startDTS,B.appendedPTS=I.appendedPTS,B.maxStartPTS=I.maxStartPTS,B.endPTS=I.endPTS,B.endDTS=I.endDTS,B.minEndPTS=I.minEndPTS,B.duration=I.endPTS-I.startPTS,B.duration&&(f=B),u.PTSKnown=u.alignedSliding=!0),B.elementaryStreams=I.elementaryStreams,B.loader=I.loader,B.stats=I.stats,B.urlId=I.urlId,I.initSegment&&(B.initSegment=I.initSegment,C=I.initSegment)}),C){var c=u.fragmentHint?u.fragments.concat(u.fragmentHint):u.fragments;c.forEach(function(I){var B;(!I.initSegment||I.initSegment.relurl===((B=C)===null||B===void 0?void 0:B.relurl))&&(I.initSegment=C)})}if(u.skippedSegments&&(u.deltaUpdateFailed=u.fragments.some(function(I){return!I}),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 o=u.fragments;if(A){P.logger.warn("discontinuity sliding from playlist, take drift into account");for(var x=0;x<o.length;x++)o[x].cc+=A}u.skippedSegments&&(u.startCC=u.fragments[0].cc),v(l.partList,u.partList,function(I,B){B.elementaryStreams=I.elementaryStreams,B.stats=I.stats}),f?R(u,f,f.startPTS,f.endPTS,f.startDTS,f.endDTS):S(l,u),o.length&&(u.totalduration=u.edge-o[0].start),u.driftStartTime=l.driftStartTime,u.driftStart=l.driftStart;var y=u.advancedDateTime;if(u.advanced&&y){var p=u.edge;u.driftStart||(u.driftStartTime=y,u.driftStart=p),u.driftEndTime=y,u.driftEnd=p}else u.driftEndTime=l.driftEndTime,u.driftEnd=l.driftEnd,u.advancedDateTime=l.advancedDateTime}function v(l,u,C){if(l&&u)for(var g=0,m=0,D=l.length;m<=D;m++){var A=l[m],f=u[m+g];A&&f&&A.index===f.index&&A.fragment.sn===f.fragment.sn?C(A,f):g--}}function L(l,u,C){for(var g=u.skippedSegments,m=Math.max(l.startSN,u.startSN)-u.startSN,D=(l.fragmentHint?1:0)+(g?u.endSN:Math.min(l.endSN,u.endSN))-u.startSN,A=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=m;s<=D;s++){var o=c[A+s],x=f[s];g&&!x&&s<g&&(x=u.fragments[s]=o),o&&x&&C(o,x)}}function S(l,u){var C=u.startSN+u.skippedSegments-l.startSN,g=l.fragments;if(C<0||C>=g.length)return;E(u,g[C].start)}function E(l,u){if(u){for(var C=l.fragments,g=l.skippedSegments;g<C.length;g++)C[g].start+=u;l.fragmentHint&&(l.fragmentHint.start+=u)}}function b(l,u){var C=1e3*l.levelTargetDuration,g=C/2,m=l.age,D=m>0&&m<C*3,A=u.loading.end-u.loading.start,f,c=l.availabilityDelay;if(l.updated===!1)if(D){var s=333*l.misses;f=Math.max(Math.min(g,A*2),s),l.availabilityDelay=(l.availabilityDelay||0)+f}else f=g;else D?(c=Math.min(c||C/2,m),l.availabilityDelay=c,f=c+C-m):f=C-A;return Math.round(f)}function d(l,u,C){if(!l||!l.details)return null;var g=l.details,m=g.fragments[u-g.startSN];return m||(m=g.fragmentHint,m&&m.sn===u?m:u<g.startSN&&C&&C.sn===u?C:null)}function a(l,u,C){if(!l||!l.details)return null;var g=l.details.partList;if(g)for(var m=g.length;m--;){var D=g[m];if(D.index===C&&D.fragment.sn===u)return D}return null}},"./src/controller/stream-controller.ts":function(Z,H,w){"use strict";w.r(H),w.d(H,"default",function(){return g});var W=w("./src/polyfills/number.ts"),P=w("./src/controller/base-stream-controller.ts"),M=w("./src/is-supported.ts"),N=w("./src/events.ts"),k=w("./src/utils/buffer-helper.ts"),O=w("./src/controller/fragment-tracker.ts"),R=w("./src/types/loader.ts"),h=w("./src/loader/fragment.ts"),v=w("./src/demux/transmuxer-interface.ts"),L=w("./src/types/transmuxer.ts"),S=w("./src/controller/gap-controller.ts"),E=w("./src/errors.ts"),b=w("./src/utils/logger.ts");function d(m,D){for(var A=0;A<D.length;A++){var f=D[A];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(m,f.key,f)}}function a(m,D,A){return D&&d(m.prototype,D),A&&d(m,A),m}function l(m,D){m.prototype=Object.create(D.prototype),m.prototype.constructor=m,u(m,D)}function u(m,D){return u=Object.setPrototypeOf||function(f,c){return f.__proto__=c,f},u(m,D)}var C=100,g=function(m){l(D,m);function D(f,c){var s;return s=m.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 A=D.prototype;return A._registerListeners=function(){var c=this.hls;c.on(N.Events.MEDIA_ATTACHED,this.onMediaAttached,this),c.on(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),c.on(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),c.on(N.Events.MANIFEST_PARSED,this.onManifestParsed,this),c.on(N.Events.LEVEL_LOADING,this.onLevelLoading,this),c.on(N.Events.LEVEL_LOADED,this.onLevelLoaded,this),c.on(N.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),c.on(N.Events.ERROR,this.onError,this),c.on(N.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),c.on(N.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),c.on(N.Events.BUFFER_CREATED,this.onBufferCreated,this),c.on(N.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),c.on(N.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),c.on(N.Events.FRAG_BUFFERED,this.onFragBuffered,this)},A._unregisterListeners=function(){var c=this.hls;c.off(N.Events.MEDIA_ATTACHED,this.onMediaAttached,this),c.off(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),c.off(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),c.off(N.Events.MANIFEST_PARSED,this.onManifestParsed,this),c.off(N.Events.LEVEL_LOADED,this.onLevelLoaded,this),c.off(N.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),c.off(N.Events.ERROR,this.onError,this),c.off(N.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),c.off(N.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),c.off(N.Events.BUFFER_CREATED,this.onBufferCreated,this),c.off(N.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),c.off(N.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),c.off(N.Events.FRAG_BUFFERED,this.onFragBuffered,this)},A.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},A.startLoad=function(c){if(this.levels){var s=this.lastCurrentTime,o=this.hls;if(this.stopLoad(),this.setInterval(C),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var x=o.startLevel;x===-1&&(o.config.testBandwidth?(x=0,this.bitrateTest=!0):x=o.nextAutoLevel),this.level=o.nextLoadLevel=x,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},A.stopLoad=function(){this._forceStartLoad=!1,m.prototype.stopLoad.call(this)},A.doTick=function(){switch(this.state){case P.State.IDLE:this.doTickIdle();break;case P.State.WAITING_LEVEL:{var c,s=this.levels,o=this.level,x=s==null||((c=s[o])===null||c===void 0)?void 0:c.details;if(x&&(!x.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(x))break;this.state=P.State.IDLE;break}break}case P.State.FRAG_LOADING_WAITING_RETRY:{var y,p=self.performance.now(),I=this.retryDate;(!I||p>=I||(y=this.media)!==null&&y!==void 0&&y.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=P.State.IDLE)}break;default:break}this.onTickEnd()},A.onTickEnd=function(){m.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},A.doTickIdle=function(){var c,s,o=this.hls,x=this.levelLastLoaded,y=this.levels,p=this.media,I=o.config,B=o.nextLoadLevel;if(x===null||!p&&(this.startFragRequested||!I.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!y||!y[B])return;var F=y[B];this.level=o.nextLoadLevel=B;var Q=F.details;if(!Q||this.state===P.State.WAITING_LEVEL||Q.live&&this.levelLastLoaded!==B){this.state=P.State.WAITING_LEVEL;return}var j=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:p,R.PlaylistLevelType.MAIN);if(j===null)return;var U=j.len,X=this.getMaxBufferLength(F.maxBitrate);if(U>=X)return;if(this._streamEnded(j,Q)){var $={};this.altAudio&&($.type="video"),this.hls.trigger(N.Events.BUFFER_EOS,$),this.state=P.State.ENDED;return}var ne=j.end,ue=this.getNextFragment(ne,Q);if(this.couldBacktrack&&!this.fragPrevious&&ue&&ue.sn!=="initSegment"){var Te=ue.sn-Q.startSN;Te>1&&(ue=Q.fragments[Te-1],this.fragmentTracker.removeFragment(ue))}if(ue&&this.fragmentTracker.getState(ue)===O.FragmentState.OK&&this.nextLoadPosition>ne){var pe=this.audioOnly&&!this.altAudio?h.ElementaryStreamTypes.AUDIO:h.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(p,pe,R.PlaylistLevelType.MAIN),ue=this.getNextFragment(this.nextLoadPosition,Q)}if(!ue)return;ue.initSegment&&!ue.initSegment.data&&!this.bitrateTest&&(ue=ue.initSegment),((c=ue.decryptdata)===null||c===void 0?void 0:c.keyFormat)==="identity"&&!((s=ue.decryptdata)!==null&&s!==void 0&&s.key)?this.loadKey(ue,Q):this.loadFragment(ue,Q,ne)},A.loadFragment=function(c,s,o){var x,y=this.fragmentTracker.getState(c);if(this.fragCurrent=c,y===O.FragmentState.BACKTRACKED){var p=this.fragmentTracker.getBacktrackData(c);if(p){this._handleFragmentLoadProgress(p),this._handleFragmentLoadComplete(p);return}else y=O.FragmentState.NOT_LOADED}y===O.FragmentState.NOT_LOADED||y===O.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,m.prototype.loadFragment.call(this,c,s,o)):y===O.FragmentState.APPENDING?this.reduceMaxBufferLength(c.duration)&&this.fragmentTracker.removeFragment(c):((x=this.media)===null||x===void 0?void 0:x.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},A.getAppendedFrag=function(c){var s=this.fragmentTracker.getAppendedFrag(c,R.PlaylistLevelType.MAIN);return s&&"fragment"in s?s.fragment:s},A.getBufferedFrag=function(c){return this.fragmentTracker.getBufferedFrag(c,R.PlaylistLevelType.MAIN)},A.followingBufferedFrag=function(c){return c?this.getBufferedFrag(c.end+.5):null},A.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},A.nextLevelSwitch=function(){var c=this.levels,s=this.media;if(s!=null&&s.readyState){var o,x=this.getAppendedFrag(s.currentTime);if(x&&x.start>1&&this.flushMainBuffer(0,x.start-1),!s.paused&&c){var y=this.hls.nextLoadLevel,p=c[y],I=this.fragLastKbps;I&&this.fragCurrent?o=this.fragCurrent.duration*p.maxBitrate/(1e3*I)+1:o=0}else o=0;var B=this.getBufferedFrag(s.currentTime+o);if(B){var F=this.followingBufferedFrag(B);if(F){this.abortCurrentFrag();var Q=F.maxStartPTS?F.maxStartPTS:F.start,j=F.duration,U=Math.max(B.end,Q+Math.min(Math.max(j-this.config.maxFragLookUpTolerance,j*.5),j*.75));this.flushMainBuffer(U,Number.POSITIVE_INFINITY)}}}},A.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()},A.flushMainBuffer=function(c,s){m.prototype.flushMainBuffer.call(this,c,s,this.altAudio?"video":null)},A.onMediaAttached=function(c,s){m.prototype.onMediaAttached.call(this,c,s);var o=s.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),o.addEventListener("playing",this.onvplaying),o.addEventListener("seeked",this.onvseeked),this.gapController=new S.default(this.config,o,this.fragmentTracker,this.hls)},A.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),m.prototype.onMediaDetaching.call(this)},A.onMediaPlaying=function(){this.tick()},A.onMediaSeeked=function(){var c=this.media,s=c?c.currentTime:null;Object(W.isFiniteNumber)(s)&&this.log("Media seeked to "+s.toFixed(3)),this.tick()},A.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(N.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},A.onManifestParsed=function(c,s){var o=!1,x=!1,y;s.levels.forEach(function(p){y=p.audioCodec,y&&(y.indexOf("mp4a.40.2")!==-1&&(o=!0),y.indexOf("mp4a.40.5")!==-1&&(x=!0))}),this.audioCodecSwitch=o&&x&&!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},A.onLevelLoading=function(c,s){var o=this.levels;if(!o||this.state!==P.State.IDLE)return;var x=o[s.level];(!x.details||x.details.live&&this.levelLastLoaded!==s.level||this.waitForCdnTuneIn(x.details))&&(this.state=P.State.WAITING_LEVEL)},A.onLevelLoaded=function(c,s){var o,x=this.levels,y=s.level,p=s.details,I=p.totalduration;if(!x){this.warn("Levels were reset while loading level "+y);return}this.log("Level "+y+" loaded ["+p.startSN+","+p.endSN+"], cc ["+p.startCC+", "+p.endCC+"] duration:"+I);var B=this.fragCurrent;B&&(this.state===P.State.FRAG_LOADING||this.state===P.State.FRAG_LOADING_WAITING_RETRY)&&(B.level!==s.level&&B.loader&&(this.state=P.State.IDLE,B.loader.abort()));var F=x[y],Q=0;if(p.live||(o=F.details)!==null&&o!==void 0&&o.live){if(p.fragments[0]||(p.deltaUpdateFailed=!0),p.deltaUpdateFailed)return;Q=this.alignPlaylists(p,F.details)}if(F.details=p,this.levelLastLoaded=y,this.hls.trigger(N.Events.LEVEL_UPDATED,{details:p,level:y}),this.state===P.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(p))return;this.state=P.State.IDLE}this.startFragRequested?p.live&&this.synchronizeToLiveEdge(p):this.setStartPosition(p,Q),this.tick()},A._handleFragmentLoadProgress=function(c){var s,o=c.frag,x=c.part,y=c.payload,p=this.levels;if(!p){this.warn("Levels were reset while fragment load was in progress. Fragment "+o.sn+" of level "+o.level+" will not be buffered");return}var I=p[o.level],B=I.details;if(!B){this.warn("Dropping fragment "+o.sn+" of level "+o.level+" after level details were reset");return}var F=I.videoCodec,Q=B.PTSKnown||!B.live,j=(s=o.initSegment)===null||s===void 0?void 0:s.data,U=this._getAudioCodec(I),X=this.transmuxer=this.transmuxer||new v.default(this.hls,R.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),$=x?x.index:-1,ne=$!==-1,ue=new L.ChunkMetadata(o.level,o.sn,o.stats.chunkCount,y.byteLength,$,ne),Te=this.initPTS[o.cc];X.push(y,j,U,F,o,x,B.totalduration,Q,ue,Te)},A.onAudioTrackSwitching=function(c,s){var o=this.altAudio,x=!!s.url,y=s.id;if(!x){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var p=this.fragCurrent;p!=null&&p.loader&&(this.log("Switching to main audio track, cancel main fragment load"),p.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var I=this.hls;o&&I.trigger(N.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),I.trigger(N.Events.AUDIO_TRACK_SWITCHED,{id:y})}},A.onAudioTrackSwitched=function(c,s){var o=s.id,x=!!this.hls.audioTracks[o].url;if(x){var y=this.videoBuffer;y&&this.mediaBuffer!==y&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=y)}this.altAudio=x,this.tick()},A.onBufferCreated=function(c,s){var o=s.tracks,x,y,p=!1;for(var I in o){var B=o[I];if(B.id==="main"){if(y=I,x=B,I==="video"){var F=o[I];F&&(this.videoBuffer=F.buffer)}}else p=!0}p&&x?(this.log("Alternate track found, use "+y+".buffered to schedule main fragment loading"),this.mediaBuffer=x.buffer):this.mediaBuffer=this.media},A.onFragBuffered=function(c,s){var o=s.frag,x=s.part;if(o&&o.type!==R.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(o)){this.warn("Fragment "+o.sn+(x?" p: "+x.index:"")+" of level "+o.level+" finished buffering, but was aborted. state: "+this.state),this.state===P.State.PARSED&&(this.state=P.State.IDLE);return}var y=x?x.stats:o.stats;this.fragLastKbps=Math.round(8*y.total/(y.buffering.end-y.loading.first)),o.sn!=="initSegment"&&(this.fragPrevious=o),this.fragBufferedComplete(o,x)},A.onError=function(c,s){switch(s.details){case E.ErrorDetails.FRAG_LOAD_ERROR:case E.ErrorDetails.FRAG_LOAD_TIMEOUT:case E.ErrorDetails.KEY_LOAD_ERROR:case E.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(R.PlaylistLevelType.MAIN,s);break;case E.ErrorDetails.LEVEL_LOAD_ERROR:case E.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 E.ErrorDetails.BUFFER_FULL_ERROR:if(s.parent==="main"&&(this.state===P.State.PARSING||this.state===P.State.PARSED)){var o=!0,x=this.getFwdBufferInfo(this.media,R.PlaylistLevelType.MAIN);x&&x.len>.5&&(o=!this.reduceMaxBufferLength(x.len)),o&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},A.checkBuffer=function(){var c=this.media,s=this.gapController;if(!c||!s||!c.readyState)return;var o=k.BufferHelper.getBuffered(c);!this.loadedmetadata&&o.length?(this.loadedmetadata=!0,this.seekToStartPos()):s.poll(this.lastCurrentTime),this.lastCurrentTime=c.currentTime},A.onFragLoadEmergencyAborted=function(){this.state=P.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},A.onBufferFlushed=function(c,s){var o=s.type;if(o!==h.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var x=(o===h.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(x,o,R.PlaylistLevelType.MAIN)}},A.onLevelsUpdated=function(c,s){this.levels=s.levels},A.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},A.seekToStartPos=function(){var c=this.media,s=c.currentTime,o=this.startPosition;if(o>=0&&s<o){if(c.seeking){b.logger.log("could not seek to "+o+", already seeking at "+s);return}var x=k.BufferHelper.getBuffered(c),y=x.length?x.start(0):0,p=y-o;p>0&&(p<this.config.maxBufferHole||p<this.config.maxFragLookUpTolerance)&&(b.logger.log("adjusting start position by "+p+" to match buffer start"),o+=p,this.startPosition=o),this.log("seek to target start position "+o+" from current time "+s),c.currentTime=o}},A._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},A._loadBitrateTestFrag=function(c){var s=this;this._doFragLoad(c).then(function(o){var x=s.hls;if(!o||x.nextLoadLevel||s.fragContextChanged(c))return;s.fragLoadError=0,s.state=P.State.IDLE,s.startFragRequested=!1,s.bitrateTest=!1;var y=c.stats;y.parsing.start=y.parsing.end=y.buffering.start=y.buffering.end=self.performance.now(),x.trigger(N.Events.FRAG_LOADED,o)})},A._handleTransmuxComplete=function(c){var s,o="main",x=this.hls,y=c.remuxResult,p=c.chunkMeta,I=this.getCurrentContext(p);if(!I){this.warn("The loading context changed while buffering fragment "+p.sn+" of level "+p.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(p.level);return}var B=I.frag,F=I.part,Q=I.level,j=y.video,U=y.text,X=y.id3,$=y.initSegment,ne=this.altAudio?void 0:y.audio;if(this.fragContextChanged(B))return;if(this.state=P.State.PARSING,$){$.tracks&&(this._bufferInitSegment(Q,$.tracks,B,p),x.trigger(N.Events.FRAG_PARSING_INIT_SEGMENT,{frag:B,id:o,tracks:$.tracks}));var ue=$.initPTS,Te=$.timescale;Object(W.isFiniteNumber)(ue)&&(this.initPTS[B.cc]=ue,x.trigger(N.Events.INIT_PTS_FOUND,{frag:B,id:o,initPTS:ue,timescale:Te}))}if(j&&y.independent!==!1){if(Q.details){var pe=j.startPTS,de=j.endPTS,ce=j.startDTS,fe=j.endDTS;if(F)F.elementaryStreams[j.type]={startPTS:pe,endPTS:de,startDTS:ce,endDTS:fe};else if(j.firstKeyFrame&&j.independent&&(this.couldBacktrack=!0),j.dropped&&j.independent){var te=this.getLoadPosition()+this.config.maxBufferHole;if(te<pe){this.backtrack(B);return}B.setElementaryStreamInfo(j.type,B.start,de,B.start,fe,!0)}B.setElementaryStreamInfo(j.type,pe,de,ce,fe),this.bufferFragmentData(j,B,F,p)}}else if(y.independent===!1){this.backtrack(B);return}if(ne){var se=ne.startPTS,Ee=ne.endPTS,ke=ne.startDTS,Le=ne.endDTS;F&&(F.elementaryStreams[h.ElementaryStreamTypes.AUDIO]={startPTS:se,endPTS:Ee,startDTS:ke,endDTS:Le}),B.setElementaryStreamInfo(h.ElementaryStreamTypes.AUDIO,se,Ee,ke,Le),this.bufferFragmentData(ne,B,F,p)}if(X!=null&&(s=X.samples)!==null&&s!==void 0&&s.length){var We={frag:B,id:o,samples:X.samples};x.trigger(N.Events.FRAG_PARSING_METADATA,We)}if(U){var Xe={frag:B,id:o,samples:U.samples};x.trigger(N.Events.FRAG_PARSING_USERDATA,Xe)}},A._bufferInitSegment=function(c,s,o,x){var y=this;if(this.state!==P.State.PARSING)return;this.audioOnly=!!s.audio&&!s.video,this.altAudio&&!this.audioOnly&&delete s.audio;var p=s.audio,I=s.video,B=s.audiovideo;if(p){var F=c.audioCodec,Q=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(F&&(F.indexOf("mp4a.40.5")!==-1?F="mp4a.40.2":F="mp4a.40.5"),p.metadata.channelCount!==1&&Q.indexOf("firefox")===-1&&(F="mp4a.40.5")),Q.indexOf("android")!==-1&&p.container!=="audio/mpeg"&&(F="mp4a.40.2",this.log("Android: force audio codec to "+F)),c.audioCodec&&c.audioCodec!==F&&this.log('Swapping manifest audio codec "'+c.audioCodec+'" for "'+F+'"'),p.levelCodec=F,p.id="main",this.log("Init audio buffer, container:"+p.container+", codecs[selected/level/parsed]=["+(F||"")+"/"+(c.audioCodec||"")+"/"+p.codec+"]")}I&&(I.levelCodec=c.videoCodec,I.id="main",this.log("Init video buffer, container:"+I.container+", codecs[level/parsed]=["+(c.videoCodec||"")+"/"+I.codec+"]")),B&&this.log("Init audiovideo buffer, container:"+B.container+", codecs[level/parsed]=["+(c.attrs.CODECS||"")+"/"+B.codec+"]"),this.hls.trigger(N.Events.BUFFER_CODECS,s),Object.keys(s).forEach(function(j){var U=s[j],X=U.initSegment;X!=null&&X.byteLength&&y.hls.trigger(N.Events.BUFFER_APPENDING,{type:j,data:X,frag:o,part:null,chunkMeta:x,parent:o.type})}),this.tick()},A.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},A.checkFragmentChanged=function(){var c=this.media,s=null;if(c&&c.readyState>1&&c.seeking===!1){var o=c.currentTime;if(k.BufferHelper.isBuffered(c,o)?s=this.getAppendedFrag(o):k.BufferHelper.isBuffered(c,o+.1)&&(s=this.getAppendedFrag(o+.1)),s){var x=this.fragPlaying,y=s.level;(!x||s.sn!==x.sn||x.level!==y||s.urlId!==x.urlId)&&(this.hls.trigger(N.Events.FRAG_CHANGED,{frag:s}),(!x||x.level!==y)&&this.hls.trigger(N.Events.LEVEL_SWITCHED,{level:y}),this.fragPlaying=s)}}},a(D,[{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}}]),D}(P.default)},"./src/controller/subtitle-stream-controller.ts":function(Z,H,w){"use strict";w.r(H),w.d(H,"SubtitleStreamController",function(){return l});var W=w("./src/events.ts"),P=w("./src/utils/logger.ts"),M=w("./src/utils/buffer-helper.ts"),N=w("./src/controller/fragment-finders.ts"),k=w("./src/utils/discontinuities.ts"),O=w("./src/controller/level-helper.ts"),R=w("./src/controller/fragment-tracker.ts"),h=w("./src/controller/base-stream-controller.ts"),v=w("./src/types/loader.ts"),L=w("./src/types/level.ts");function S(u,C){for(var g=0;g<C.length;g++){var m=C[g];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(u,m.key,m)}}function E(u,C,g){return C&&S(u.prototype,C),g&&S(u,g),u}function b(u,C){u.prototype=Object.create(C.prototype),u.prototype.constructor=u,d(u,C)}function d(u,C){return d=Object.setPrototypeOf||function(m,D){return m.__proto__=D,m},d(u,C)}var a=500,l=function(u){b(C,u);function C(m,D){var A;return A=u.call(this,m,D,"[subtitle-stream-controller]")||this,A.levels=[],A.currentTrackId=-1,A.tracksBuffered=[],A.mainDetails=null,A._registerListeners(),A}var g=C.prototype;return g.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},g._registerListeners=function(){var D=this.hls;D.on(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),D.on(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),D.on(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),D.on(W.Events.LEVEL_LOADED,this.onLevelLoaded,this),D.on(W.Events.ERROR,this.onError,this),D.on(W.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),D.on(W.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),D.on(W.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),D.on(W.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),D.on(W.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},g._unregisterListeners=function(){var D=this.hls;D.off(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),D.off(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),D.off(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),D.off(W.Events.LEVEL_LOADED,this.onLevelLoaded,this),D.off(W.Events.ERROR,this.onError,this),D.off(W.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),D.off(W.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),D.off(W.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),D.off(W.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),D.off(W.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},g.startLoad=function(){this.stopLoad(),this.state=h.State.IDLE,this.setInterval(a),this.tick()},g.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},g.onLevelLoaded=function(D,A){this.mainDetails=A.details},g.onSubtitleFragProcessed=function(D,A){var f=A.frag,c=A.success;if(this.fragPrevious=f,this.state=h.State.IDLE,!c)return;var s=this.tracksBuffered[this.currentTrackId];if(!s)return;for(var o,x=f.start,y=0;y<s.length;y++)if(x>=s[y].start&&x<=s[y].end){o=s[y];break}var p=f.start+f.duration;o?o.end=p:(o={start:x,end:p},s.push(o)),this.fragmentTracker.fragBuffered(f)},g.onBufferFlushing=function(D,A){var f=A.startOffset,c=A.endOffset;if(f===0&&c!==Number.POSITIVE_INFINITY){var s=this.currentTrackId,o=this.levels;if(!o.length||!o[s]||!o[s].details)return;var x=o[s].details,y=x.targetduration,p=c-y;if(p<=0)return;A.endOffsetSubtitles=Math.max(0,p),this.tracksBuffered.forEach(function(I){for(var B=0;B<I.length;){if(I[B].end<=p){I.shift();continue}else if(I[B].start<p)I[B].start=p;else break;B++}}),this.fragmentTracker.removeFragmentsInRange(f,p,v.PlaylistLevelType.SUBTITLE)}},g.onError=function(D,A){var f,c=A.frag;if(!c||c.type!==v.PlaylistLevelType.SUBTITLE)return;(f=this.fragCurrent)!==null&&f!==void 0&&f.loader&&this.fragCurrent.loader.abort(),this.state=h.State.IDLE},g.onSubtitleTracksUpdated=function(D,A){var f=this,c=A.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},g.onSubtitleTrackSwitch=function(D,A){if(this.currentTrackId=A.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(a)},g.onSubtitleTrackLoaded=function(D,A){var f,c=A.details,s=A.id,o=this.currentTrackId,x=this.levels;if(!x.length)return;var y=x[o];if(s>=x.length||s!==o||!y)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,c.live||(f=y.details)!==null&&f!==void 0&&f.live){var p=this.mainDetails;if(c.deltaUpdateFailed||!p)return;var I=p.fragments[0];if(!y.details)c.hasProgramDateTime&&p.hasProgramDateTime?Object(k.alignMediaPlaylistByPDT)(c,p):I&&Object(O.addSliding)(c,I.start);else{var B=this.alignPlaylists(c,y.details);B===0&&I&&Object(O.addSliding)(c,I.start)}}if(y.details=c,this.levelLastLoaded=s,this.tick(),c.live&&!this.fragCurrent&&this.media&&this.state===h.State.IDLE){var F=Object(N.findFragmentByPTS)(null,c.fragments,this.media.currentTime,0);F||(this.warn("Subtitle playlist not aligned with playback"),y.details=void 0)}},g._handleFragmentLoadComplete=function(D){var A=D.frag,f=D.payload,c=A.decryptdata,s=this.hls;if(this.fragContextChanged(A))return;if(f&&f.byteLength>0&&c&&c.key&&c.iv&&c.method==="AES-128"){var o=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(f),c.key.buffer,c.iv.buffer).then(function(x){var y=performance.now();s.trigger(W.Events.FRAG_DECRYPTED,{frag:A,payload:x,stats:{tstart:o,tdecrypt:y}})})}},g.doTick=function(){if(!this.media){this.state=h.State.IDLE;return}if(this.state===h.State.IDLE){var D,A=this.currentTrackId,f=this.levels;if(!f.length||!f[A]||!f[A].details)return;var c=f[A].details,s=c.targetduration,o=this.config,x=this.media,y=M.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,x.currentTime-s,o.maxBufferHole),p=y.end,I=y.len,B=this.getMaxBufferLength()+s;if(I>B)return;console.assert(c,"Subtitle track details are defined on idle subtitle stream controller tick");var F=c.fragments,Q=F.length,j=c.edge,U,X=this.fragPrevious;if(p<j){var $=o.maxFragLookUpTolerance;X&&c.hasProgramDateTime&&(U=Object(N.findFragmentByPDT)(F,X.endProgramDateTime,$)),U||(U=Object(N.findFragmentByPTS)(X,F,p,$),!U&&X&&X.start<F[0].start&&(U=F[0]))}else U=F[Q-1];(D=U)!==null&&D!==void 0&&D.encrypted?(P.logger.log("Loading key for "+U.sn),this.state=h.State.KEY_LOADING,this.hls.trigger(W.Events.KEY_LOADING,{frag:U})):U&&this.fragmentTracker.getState(U)===R.FragmentState.NOT_LOADED&&this.loadFragment(U,c,p)}},g.loadFragment=function(D,A,f){this.fragCurrent=D,u.prototype.loadFragment.call(this,D,A,f)},E(C,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),C}(h.default)},"./src/controller/subtitle-track-controller.ts":function(Z,H,w){"use strict";w.r(H);var W=w("./src/events.ts"),P=w("./src/utils/texttrack-utils.ts"),M=w("./src/controller/base-playlist-controller.ts"),N=w("./src/types/loader.ts");function k(S,E){for(var b=0;b<E.length;b++){var d=E[b];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(S,d.key,d)}}function O(S,E,b){return E&&k(S.prototype,E),b&&k(S,b),S}function R(S,E){S.prototype=Object.create(E.prototype),S.prototype.constructor=S,h(S,E)}function h(S,E){return h=Object.setPrototypeOf||function(d,a){return d.__proto__=a,d},h(S,E)}var v=function(S){R(E,S);function E(d){var a;return a=S.call(this,d,"[subtitle-track-controller]")||this,a.media=null,a.tracks=[],a.groupId=null,a.tracksInGroup=[],a.trackId=-1,a.selectDefaultTrack=!0,a.queuedDefaultTrack=-1,a.trackChangeListener=function(){return a.onTextTracksChanged()},a.asyncPollTrackChange=function(){return a.pollTrackChange(0)},a.useTextTrackPolling=!1,a.subtitlePollingInterval=-1,a.subtitleDisplay=!0,a.registerListeners(),a}var b=E.prototype;return b.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,S.prototype.destroy.call(this)},b.registerListeners=function(){var a=this.hls;a.on(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),a.on(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.on(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.on(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.on(W.Events.LEVEL_LOADING,this.onLevelLoading,this),a.on(W.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),a.on(W.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),a.on(W.Events.ERROR,this.onError,this)},b.unregisterListeners=function(){var a=this.hls;a.off(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),a.off(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.off(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.off(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.off(W.Events.LEVEL_LOADING,this.onLevelLoading,this),a.off(W.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),a.off(W.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),a.off(W.Events.ERROR,this.onError,this)},b.onMediaAttached=function(a,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)},b.pollTrackChange=function(a){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,a)},b.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 a=L(this.media.textTracks);a.forEach(function(l){Object(P.clearCurrentCues)(l)}),this.subtitleTrack=-1,this.media=null},b.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},b.onManifestParsed=function(a,l){this.tracks=l.subtitleTracks},b.onSubtitleTrackLoaded=function(a,l){var u=l.id,C=l.details,g=this.trackId,m=this.tracksInGroup[g];if(!m){this.warn("Invalid subtitle track id "+u);return}var D=m.details;m.details=l.details,this.log("subtitle track "+u+" loaded ["+C.startSN+"-"+C.endSN+"]"),u===this.trackId&&(this.retryCount=0,this.playlistLoaded(u,l,D))},b.onLevelLoading=function(a,l){this.switchLevel(l.level)},b.onLevelSwitching=function(a,l){this.switchLevel(l.level)},b.switchLevel=function(a){var l=this.hls.levels[a];if(!(l!=null&&l.textGroupIds))return;var u=l.textGroupIds[l.urlId];if(this.groupId!==u){var C=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,g=this.tracks.filter(function(A){return!u||A.groupId===u});this.tracksInGroup=g;var m=this.findTrackId(C==null?void 0:C.name)||this.findTrackId();this.groupId=u;var D={subtitleTracks:g};this.log("Updating subtitle tracks, "+g.length+' track(s) found in "'+u+'" group-id'),this.hls.trigger(W.Events.SUBTITLE_TRACKS_UPDATED,D),m!==-1&&this.setSubtitleTrack(m,C)}},b.findTrackId=function(a){for(var l=this.tracksInGroup,u=0;u<l.length;u++){var C=l[u];if((!this.selectDefaultTrack||C.default)&&(!a||a===C.name))return C.id}return-1},b.onError=function(a,l){if(S.prototype.onError.call(this,a,l),l.fatal||!l.context)return;l.context.type===N.PlaylistContextType.SUBTITLE_TRACK&&l.context.id===this.trackId&&l.context.groupId===this.groupId&&this.retryLoadingOrFail(l)},b.loadPlaylist=function(a){var l=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(l)){var u=l.id,C=l.groupId,g=l.url;if(a)try{g=a.addDirectives(g)}catch(m){this.warn("Could not construct new URL with HLS Delivery Directives: "+m)}this.log("Loading subtitle playlist for id "+u),this.hls.trigger(W.Events.SUBTITLE_TRACK_LOADING,{url:g,id:u,groupId:C,deliveryDirectives:a||null})}},b.toggleTrackModes=function(a){var l=this,u=this.media,C=this.subtitleDisplay,g=this.trackId;if(!u)return;var m=L(u.textTracks),D=m.filter(function(c){return c.groupId===l.groupId});if(a===-1)[].slice.call(m).forEach(function(c){c.mode="disabled"});else{var A=D[g];A&&(A.mode="disabled")}var f=D[a];f&&(f.mode=C?"showing":"hidden")},b.setSubtitleTrack=function(a,l){var u,C=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=a;return}if(this.trackId!==a&&this.toggleTrackModes(a),this.trackId===a&&(a===-1||(u=C[a])!==null&&u!==void 0&&u.details)||a<-1||a>=C.length)return;this.clearTimer();var g=C[a];if(this.log("Switching to subtitle track "+a),this.trackId=a,g){var m=g.id,D=g.groupId,A=D===void 0?"":D,f=g.name,c=g.type,s=g.url;this.hls.trigger(W.Events.SUBTITLE_TRACK_SWITCH,{id:m,groupId:A,name:f,type:c,url:s});var o=this.switchParams(g.url,l==null?void 0:l.details);this.loadPlaylist(o)}else this.hls.trigger(W.Events.SUBTITLE_TRACK_SWITCH,{id:a})},b.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var a=-1,l=L(this.media.textTracks),u=0;u<l.length;u++)if(l[u].mode==="hidden")a=u;else if(l[u].mode==="showing"){a=u;break}this.subtitleTrack!==a&&(this.subtitleTrack=a)},O(E,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(a){this.selectDefaultTrack=!1;var l=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(a,l)}}]),E}(M.default);function L(S){for(var E=[],b=0;b<S.length;b++){var d=S[b];d.kind==="subtitles"&&d.label&&E.push(S[b])}return E}H.default=v},"./src/controller/timeline-controller.ts":function(Z,H,w){"use strict";w.r(H),w.d(H,"TimelineController",function(){return L});var W=w("./src/polyfills/number.ts"),P=w("./src/events.ts"),M=w("./src/utils/cea-608-parser.ts"),N=w("./src/utils/output-filter.ts"),k=w("./src/utils/webvtt-parser.ts"),O=w("./src/utils/texttrack-utils.ts"),R=w("./src/utils/imsc1-ttml-parser.ts"),h=w("./src/types/loader.ts"),v=w("./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=b(),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 N.default(this,"textTrack1"),C=new N.default(this,"textTrack2"),g=new N.default(this,"textTrack3"),m=new N.default(this,"textTrack4");this.cea608Parser1=new M.default(1,u,C),this.cea608Parser2=new M.default(3,g,m)}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 a=d.prototype;return a.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},a.addCues=function(u,C,g,m,D){for(var A=!1,f=D.length;f--;){var c=D[f],s=E(c[0],c[1],C,g);if(s>=0&&(c[0]=Math.min(c[0],C),c[1]=Math.max(c[1],g),A=!0,s/(g-C)>.5))return}if(A||D.push([C,g]),this.config.renderTextTracksNatively){var o=this.captionsTracks[u];this.Cues.newCue(o,C,g,m)}else{var x=this.Cues.newCue(null,C,g,m);this.hls.trigger(P.Events.CUES_PARSED,{type:"captions",cues:x,track:u})}},a.onInitPtsFound=function(u,C){var g=this,m=C.frag,D=C.id,A=C.initPTS,f=C.timescale,c=this.unparsedVttFrags;D==="main"&&(this.initPTS[m.cc]=A,this.timescale[m.cc]=f),c.length&&(this.unparsedVttFrags=[],c.forEach(function(s){g.onFragLoaded(P.Events.FRAG_LOADED,s)}))},a.getExistingTrack=function(u){var C=this.media;if(C)for(var g=0;g<C.textTracks.length;g++){var m=C.textTracks[g];if(m[u])return m}return null},a.createCaptionsTrack=function(u){this.config.renderTextTracksNatively?this.createNativeTrack(u):this.createNonNativeTrack(u)},a.createNativeTrack=function(u){if(this.captionsTracks[u])return;var C=this.captionsProperties,g=this.captionsTracks,m=this.media,D=C[u],A=D.label,f=D.languageCode,c=this.getExistingTrack(u);if(c)g[u]=c,Object(O.clearCurrentCues)(g[u]),Object(O.sendAddTrackEvent)(g[u],m);else{var s=this.createTextTrack("captions",A,f);s&&(s[u]=!0,g[u]=s)}},a.createNonNativeTrack=function(u){if(this.nonNativeCaptionsTracks[u])return;var C=this.captionsProperties[u];if(!C)return;var g=C.label,m={_id:u,label:g,kind:"captions",default:C.media?!!C.media.default:!1,closedCaptions:C.media};this.nonNativeCaptionsTracks[u]=m,this.hls.trigger(P.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[m]})},a.createTextTrack=function(u,C,g){var m=this.media;return m?m.addTextTrack(u,C,g):void 0},a.onMediaAttaching=function(u,C){this.media=C.media,this._cleanTracks()},a.onMediaDetaching=function(){var u=this.captionsTracks;Object.keys(u).forEach(function(C){Object(O.clearCurrentCues)(u[C]),delete u[C]}),this.nonNativeCaptionsTracks={}},a.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=b(),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())},a._cleanTracks=function(){var u=this.media;if(!u)return;var C=u.textTracks;if(C)for(var g=0;g<C.length;g++)Object(O.clearCurrentCues)(C[g])},a.onSubtitleTracksUpdated=function(u,C){var g=this;this.textTracks=[];var m=C.subtitleTracks||[],D=m.some(function(s){return s.textCodec===R.IMSC1_CODEC});if(this.config.enableWebVTT||D&&this.config.enableIMSC1){var A=this.tracks&&m&&this.tracks.length===m.length;if(this.tracks=m||[],this.config.renderTextTracksNatively){var f=this.media?this.media.textTracks:[];this.tracks.forEach(function(s,o){var x;if(o<f.length){for(var y=null,p=0;p<f.length;p++)if(S(f[p],s)){y=f[p];break}y&&(x=y)}x?Object(O.clearCurrentCues)(x):(x=g.createTextTrack("subtitles",s.name,s.lang),x&&(x.mode="disabled")),x&&(x.groupId=s.groupId,g.textTracks.push(x))})}else if(!A&&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})}}},a.onManifestLoaded=function(u,C){var g=this;this.config.enableCEA708Captions&&C.captions&&C.captions.forEach(function(m){var D=/(?:CC|SERVICE)([1-4])/.exec(m.instreamId);if(!D)return;var A="textTrack"+D[1],f=g.captionsProperties[A];if(!f)return;f.label=m.name,m.lang&&(f.languageCode=m.lang),f.media=m})},a.onFragLoading=function(u,C){var g=this.cea608Parser1,m=this.cea608Parser2,D=this.lastSn,A=this.lastPartIndex;if(!this.enabled||!(g&&m))return;if(C.frag.type===h.PlaylistLevelType.MAIN){var f,c,s=C.frag.sn,o=(f=C==null||((c=C.part)===null||c===void 0)?void 0:c.index)!=null?f:-1;s===D+1||s===D&&o===A+1||(g.reset(),m.reset()),this.lastSn=s,this.lastPartIndex=o}},a.onFragLoaded=function(u,C){var g=C.frag,m=C.payload,D=this.initPTS,A=this.unparsedVttFrags;if(g.type===h.PlaylistLevelType.SUBTITLE)if(m.byteLength){if(!Object(W.isFiniteNumber)(D[g.cc])){A.push(C),D.length&&this.hls.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:g,error:new Error("Missing initial subtitle PTS")});return}var f=g.decryptdata;if(f==null||f.key==null||f.method!=="AES-128"){var c=this.tracks[g.level],s=this.vttCCs;s[g.cc]||(s[g.cc]={start:g.start,prevCC:this.prevCC,new:!0},this.prevCC=g.cc),c&&c.textCodec===R.IMSC1_CODEC?this._parseIMSC1(g,m):this._parseVTTs(g,m,s)}}else this.hls.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:g,error:new Error("Empty subtitle payload")})},a._parseIMSC1=function(u,C){var g=this,m=this.hls;Object(R.parseIMSC1)(C,this.initPTS[u.cc],this.timescale[u.cc],function(D){g._appendCues(D,u.level),m.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:u})},function(D){v.logger.log("Failed to parse IMSC1: "+D),m.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:u,error:D})})},a._parseVTTs=function(u,C,g){var m=this,D=this.hls;Object(k.parseWebVTT)(C,this.initPTS[u.cc],this.timescale[u.cc],g,u.cc,u.start,function(A){m._appendCues(A,u.level),D.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:u})},function(A){m._fallbackToIMSC1(u,C),v.logger.log("Failed to parse VTT cue: "+A),D.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:u,error:A})})},a._fallbackToIMSC1=function(u,C){var g=this,m=this.tracks[u.level];m.textCodec||Object(R.parseIMSC1)(C,this.initPTS[u.cc],this.timescale[u.cc],function(){m.textCodec=R.IMSC1_CODEC,g._parseIMSC1(u,C)},function(){m.textCodec="wvtt"})},a._appendCues=function(u,C){var g=this.hls;if(this.config.renderTextTracksNatively){var m=this.textTracks[C];if(m.mode==="disabled")return;u.forEach(function(f){return Object(O.addCueToTrack)(m,f)})}else{var D=this.tracks[C],A=D.default?"default":"subtitles"+C;g.trigger(P.Events.CUES_PARSED,{type:"subtitles",cues:u,track:A})}},a.onFragDecrypted=function(u,C){var g=C.frag;if(g.type===h.PlaylistLevelType.SUBTITLE){if(!Object(W.isFiniteNumber)(this.initPTS[g.cc])){this.unparsedVttFrags.push(C);return}this.onFragLoaded(P.Events.FRAG_LOADED,C)}},a.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},a.onFragParsingUserdata=function(u,C){var g=this.cea608Parser1,m=this.cea608Parser2;if(!this.enabled||!(g&&m))return;for(var D=0;D<C.samples.length;D++){var A=C.samples[D].bytes;if(A){var f=this.extractCea608Data(A);g.addData(C.samples[D].pts,f[0]),m.addData(C.samples[D].pts,f[1])}}},a.onBufferFlushing=function(u,C){var g=C.startOffset,m=C.endOffset,D=C.endOffsetSubtitles,A=C.type,f=this.media;if(!f||f.currentTime<m)return;if(!A||A==="video"){var c=this.captionsTracks;Object.keys(c).forEach(function(o){return Object(O.removeCuesInRange)(c[o],g,m)})}if(this.config.renderTextTracksNatively&&(g===0&&D!==void 0)){var s=this.textTracks;Object.keys(s).forEach(function(o){return Object(O.removeCuesInRange)(s[o],g,D)})}},a.extractCea608Data=function(u){for(var C=u[0]&31,g=2,m=[[],[]],D=0;D<C;D++){var A=u[g++],f=127&u[g++],c=127&u[g++],s=(4&A)!==0,o=3&A;if(f===0&&c===0)continue;s&&((o===0||o===1)&&(m[o].push(f),m[o].push(c)))}return m},d}();function S(d,a){return d&&d.label===a.name&&!(d.textTrack1||d.textTrack2)}function E(d,a,l,u){return Math.min(a,u)-Math.max(d,l)}function b(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(Z,H,w){"use strict";w.r(H),w.d(H,"default",function(){return W});var W=function(){function P(N,k){this.subtle=void 0,this.aesIV=void 0,this.subtle=N,this.aesIV=k}var M=P.prototype;return M.decrypt=function(k,O){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},O,k)},P}()},"./src/crypt/aes-decryptor.ts":function(Z,H,w){"use strict";w.r(H),w.d(H,"removePadding",function(){return P}),w.d(H,"default",function(){return M});var W=w("./src/utils/typed-array.ts");function P(N){var k=N.byteLength,O=k&&new DataView(N.buffer).getUint8(k-1);return O?Object(W.sliceUint8)(N,0,k-O):N}var M=function(){function N(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}var k=N.prototype;return k.uint8ArrayToUint32Array_=function(R){for(var h=new DataView(R),v=new Uint32Array(4),L=0;L<4;L++)v[L]=h.getUint32(L*4);return v},k.initTable=function(){var R=this.sBox,h=this.invSBox,v=this.subMix,L=v[0],S=v[1],E=v[2],b=v[3],d=this.invSubMix,a=d[0],l=d[1],u=d[2],C=d[3],g=new Uint32Array(256),m=0,D=0,A=0;for(A=0;A<256;A++)A<128?g[A]=A<<1:g[A]=A<<1^283;for(A=0;A<256;A++){var f=D^D<<1^D<<2^D<<3^D<<4;f=f>>>8^f&255^99,R[m]=f,h[f]=m;var c=g[m],s=g[c],o=g[s],x=g[f]*257^f*16843008;L[m]=x<<24|x>>>8,S[m]=x<<16|x>>>16,E[m]=x<<8|x>>>24,b[m]=x,x=o*16843009^s*65537^c*257^m*16843008,a[f]=x<<24|x>>>8,l[f]=x<<16|x>>>16,u[f]=x<<8|x>>>24,C[f]=x,m?(m=c^g[g[g[o^c]]],D^=g[g[D]]):m=D=1}},k.expandKey=function(R){for(var h=this.uint8ArrayToUint32Array_(R),v=!0,L=0;L<h.length&&v;)v=h[L]===this.key[L],L++;if(v)return;this.key=h;var S=this.keySize=h.length;if(S!==4&&S!==6&&S!==8)throw new Error("Invalid aes key size="+S);var E=this.ksRows=(S+6+1)*4,b,d,a=this.keySchedule=new Uint32Array(E),l=this.invKeySchedule=new Uint32Array(E),u=this.sBox,C=this.rcon,g=this.invSubMix,m=g[0],D=g[1],A=g[2],f=g[3],c,s;for(b=0;b<E;b++){if(b<S){c=a[b]=h[b];continue}s=c,b%S===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^=C[b/S|0]<<24):S>6&&b%S===4&&(s=u[s>>>24]<<24|u[s>>>16&255]<<16|u[s>>>8&255]<<8|u[s&255]),a[b]=c=(a[b-S]^s)>>>0}for(d=0;d<E;d++)b=E-d,d&3?s=a[b]:s=a[b-4],d<4||b<=4?l[d]=s:l[d]=m[u[s>>>24]]^D[u[s>>>16&255]]^A[u[s>>>8&255]]^f[u[s&255]],l[d]=l[d]>>>0},k.networkToHostOrderSwap=function(R){return R<<24|(R&65280)<<8|(R&16711680)>>8|R>>>24},k.decrypt=function(R,h,v){for(var L=this.keySize+6,S=this.invKeySchedule,E=this.invSBox,b=this.invSubMix,d=b[0],a=b[1],l=b[2],u=b[3],C=this.uint8ArrayToUint32Array_(v),g=C[0],m=C[1],D=C[2],A=C[3],f=new Int32Array(R),c=new Int32Array(f.length),s,o,x,y,p,I,B,F,Q,j,U,X,$,ne,ue=this.networkToHostOrderSwap;h<f.length;){for(Q=ue(f[h]),j=ue(f[h+1]),U=ue(f[h+2]),X=ue(f[h+3]),p=Q^S[0],I=X^S[1],B=U^S[2],F=j^S[3],$=4,ne=1;ne<L;ne++)s=d[p>>>24]^a[I>>16&255]^l[B>>8&255]^u[F&255]^S[$],o=d[I>>>24]^a[B>>16&255]^l[F>>8&255]^u[p&255]^S[$+1],x=d[B>>>24]^a[F>>16&255]^l[p>>8&255]^u[I&255]^S[$+2],y=d[F>>>24]^a[p>>16&255]^l[I>>8&255]^u[B&255]^S[$+3],p=s,I=o,B=x,F=y,$=$+4;s=E[p>>>24]<<24^E[I>>16&255]<<16^E[B>>8&255]<<8^E[F&255]^S[$],o=E[I>>>24]<<24^E[B>>16&255]<<16^E[F>>8&255]<<8^E[p&255]^S[$+1],x=E[B>>>24]<<24^E[F>>16&255]<<16^E[p>>8&255]<<8^E[I&255]^S[$+2],y=E[F>>>24]<<24^E[p>>16&255]<<16^E[I>>8&255]<<8^E[B&255]^S[$+3],c[h]=ue(s^g),c[h+1]=ue(y^m),c[h+2]=ue(x^D),c[h+3]=ue(o^A),g=Q,m=j,D=U,A=X,h=h+4}return c.buffer},N}()},"./src/crypt/decrypter.ts":function(Z,H,w){"use strict";w.r(H),w.d(H,"default",function(){return h});var W=w("./src/crypt/aes-crypto.ts"),P=w("./src/crypt/fast-aes-key.ts"),M=w("./src/crypt/aes-decryptor.ts"),N=w("./src/utils/logger.ts"),k=w("./src/utils/mp4-tools.ts"),O=w("./src/utils/typed-array.ts"),R=16,h=function(){function v(S,E,b){var d=b===void 0?{}:b,a=d.removePKCS7Padding,l=a===void 0?!0:a;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=S,this.config=E,this.removePKCS7Padding=l,l)try{var u=self.crypto;u&&(this.subtle=u.subtle||u.webkitSubtle)}catch(C){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var L=v.prototype;return L.destroy=function(){this.observer=null},L.isSync=function(){return this.config.enableSoftwareAES},L.flush=function(){var E=this.currentResult;if(!E){this.reset();return}var b=new Uint8Array(E);return this.reset(),this.removePKCS7Padding?Object(M.removePadding)(b):b},L.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},L.decrypt=function(E,b,d,a){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(E),b,d);var l=this.flush();l&&a(l.buffer)}else this.webCryptoDecrypt(new Uint8Array(E),b,d).then(a)},L.softwareDecrypt=function(E,b,d){var a=this.currentIV,l=this.currentResult,u=this.remainderData;this.logOnce("JS AES decrypt"),u&&(E=Object(k.appendUint8Array)(u,E),this.remainderData=null);var C=this.getValidChunk(E);if(!C.length)return null;a&&(d=a);var g=this.softwareDecrypter;g||(g=this.softwareDecrypter=new M.default),g.expandKey(b);var m=l;return this.currentResult=g.decrypt(C.buffer,0,d),this.currentIV=Object(O.sliceUint8)(C,-16).buffer,m||null},L.webCryptoDecrypt=function(E,b,d){var a=this,l=this.subtle;return(this.key!==b||!this.fastAesKey)&&(this.key=b,this.fastAesKey=new P.default(l,b)),this.fastAesKey.expandKey().then(function(u){if(!l)return Promise.reject(new Error("web crypto not initialized"));var C=new W.default(l,d);return C.decrypt(E.buffer,u)}).catch(function(u){return a.onWebCryptoError(u,E,b,d)})},L.onWebCryptoError=function(E,b,d,a){return N.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",E),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(b,d,a)},L.getValidChunk=function(E){var b=E,d=E.length-E.length%R;return d!==E.length&&(b=Object(O.sliceUint8)(E,0,d),this.remainderData=Object(O.sliceUint8)(E,d)),b},L.logOnce=function(E){if(!this.logEnabled)return;N.logger.log("[decrypter.ts]: "+E),this.logEnabled=!1},v}()},"./src/crypt/fast-aes-key.ts":function(Z,H,w){"use strict";w.r(H),w.d(H,"default",function(){return W});var W=function(){function P(N,k){this.subtle=void 0,this.key=void 0,this.subtle=N,this.key=k}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(Z,H,w){"use strict";w.r(H);var W=w("./src/demux/base-audio-demuxer.ts"),P=w("./src/demux/adts.ts"),M=w("./src/utils/logger.ts"),N=w("./src/demux/id3.ts");function k(h,v){h.prototype=Object.create(v.prototype),h.prototype.constructor=h,O(h,v)}function O(h,v){return O=Object.setPrototypeOf||function(S,E){return S.__proto__=E,S},O(h,v)}var R=function(h){k(v,h);function v(S,E){var b;return b=h.call(this)||this,b.observer=void 0,b.config=void 0,b.observer=S,b.config=E,b}var L=v.prototype;return L.resetInitSegment=function(E,b,d){h.prototype.resetInitSegment.call(this,E,b,d),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:E,duration:d,inputTimeScale:9e4,dropped:0}},v.probe=function(E){if(!E)return!1;for(var b=N.getID3Data(E,0)||[],d=b.length,a=E.length;d<a;d++)if(P.probe(E,d))return M.logger.log("ADTS sync word found !"),!0;return!1},L.canParse=function(E,b){return P.canParse(E,b)},L.appendFrame=function(E,b,d){P.initTrackConfig(E,this.observer,b,d,E.manifestCodec);var a=P.appendFrame(E,b,d,this.initPTS,this.frameIndex);if(a&&a.missing===0)return a},v}(W.default);R.minProbeByteLength=9,H.default=R},"./src/demux/adts.ts":function(Z,H,w){"use strict";w.r(H),w.d(H,"getAudioConfig",function(){return N}),w.d(H,"isHeaderPattern",function(){return k}),w.d(H,"getHeaderLength",function(){return O}),w.d(H,"getFullFrameLength",function(){return R}),w.d(H,"canGetFrameLength",function(){return h}),w.d(H,"isHeader",function(){return v}),w.d(H,"canParse",function(){return L}),w.d(H,"probe",function(){return S}),w.d(H,"initTrackConfig",function(){return E}),w.d(H,"getFrameDuration",function(){return b}),w.d(H,"parseFrameHeader",function(){return d}),w.d(H,"appendFrame",function(){return a});var W=w("./src/utils/logger.ts"),P=w("./src/errors.ts"),M=w("./src/events.ts");function N(l,u,C,g){var m,D,A,f,c=navigator.userAgent.toLowerCase(),s=g,o=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];m=((u[C+2]&192)>>>6)+1;var x=(u[C+2]&60)>>>2;if(x>o.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:"+x});return}return A=(u[C+2]&1)<<2,A|=(u[C+3]&192)>>>6,W.logger.log("manifest codec:"+g+", ADTS type:"+m+", samplingIndex:"+x),/firefox/i.test(c)?x>=6?(m=5,f=new Array(4),D=x-3):(m=2,f=new Array(2),D=x):c.indexOf("android")!==-1?(m=2,f=new Array(2),D=x):(m=5,f=new Array(4),g&&(g.indexOf("mp4a.40.29")!==-1||g.indexOf("mp4a.40.5")!==-1)||!g&&x>=6?D=x-3:((g&&g.indexOf("mp4a.40.2")!==-1&&(x>=6&&A===1||/vivaldi/i.test(c))||!g&&A===1)&&(m=2,f=new Array(2)),D=x)),f[0]=m<<3,f[0]|=(x&14)>>1,f[1]|=(x&1)<<7,f[1]|=A<<3,m===5&&(f[1]|=(D&14)>>1,f[2]=(D&1)<<7,f[2]|=2<<2,f[3]=0),{config:f,samplerate:o[x],channelCount:A,codec:"mp4a.40."+m,manifestCodec:s}}function k(l,u){return l[u]===255&&(l[u+1]&246)===240}function O(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 h(l,u){return u+5<l.length}function v(l,u){return u+1<l.length&&k(l,u)}function L(l,u){return h(l,u)&&k(l,u)&&R(l,u)<=l.length-u}function S(l,u){if(v(l,u)){var C=O(l,u);if(u+C>=l.length)return!1;var g=R(l,u);if(g<=C)return!1;var m=u+g;return m===l.length||v(l,m)}return!1}function E(l,u,C,g,m){if(!l.samplerate){var D=N(u,C,g,m);if(!D)return;l.config=D.config,l.samplerate=D.samplerate,l.channelCount=D.channelCount,l.codec=D.codec,l.manifestCodec=D.manifestCodec,W.logger.log("parsed codec:"+l.codec+", rate:"+D.samplerate+", channels:"+D.channelCount)}}function b(l){return 1024*9e4/l}function d(l,u,C,g,m){var D=O(l,u),A=R(l,u);if(A-=D,A>0){var f=C+g*m;return{headerLength:D,frameLength:A,stamp:f}}}function a(l,u,C,g,m){var D=b(l.samplerate),A=d(u,C,g,m,D);if(A){var f=A.frameLength,c=A.headerLength,s=A.stamp,o=c+f,x=Math.max(0,C+o-u.length),y;x?(y=new Uint8Array(o-c),y.set(u.subarray(C+c,u.length),0)):y=u.subarray(C+c,C+o);var p={unit:y,pts:s};return x||l.samples.push(p),{sample:p,length:o,missing:x}}}},"./src/demux/base-audio-demuxer.ts":function(Z,H,w){"use strict";w.r(H),w.d(H,"initPTSFn",function(){return R});var W=w("./src/polyfills/number.ts"),P=w("./src/demux/id3.ts"),M=w("./src/demux/dummy-demuxed-track.ts"),N=w("./src/utils/mp4-tools.ts"),k=w("./src/utils/typed-array.ts"),O=function(){function h(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var v=h.prototype;return v.resetInitSegment=function(S,E,b){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},v.resetTimeStamp=function(){},v.resetContiguity=function(){},v.canParse=function(S,E){return!1},v.appendFrame=function(S,E,b){},v.demux=function(S,E){this.cachedData&&(S=Object(N.appendUint8Array)(this.cachedData,S),this.cachedData=null);var b=P.getID3Data(S,0),d=b?b.length:0,a,l,u=this._audioTrack,C=this._id3Track,g=b?P.getTimeStamp(b):void 0,m=S.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=R(g,E)),b&&b.length>0&&C.samples.push({pts:this.initPTS,dts:this.initPTS,data:b}),l=this.initPTS;d<m;){if(this.canParse(S,d)){var D=this.appendFrame(u,S,d);D?(this.frameIndex++,l=D.sample.pts,d+=D.length,a=d):d=m}else P.canParse(S,d)?(b=P.getID3Data(S,d),C.samples.push({pts:l,dts:l,data:b}),d+=b.length,a=d):d++;if(d===m&&a!==m){var A=Object(k.sliceUint8)(S,a);this.cachedData?this.cachedData=Object(N.appendUint8Array)(this.cachedData,A):this.cachedData=A}}return{audioTrack:u,avcTrack:Object(M.dummyTrack)(),id3Track:C,textTrack:Object(M.dummyTrack)()}},v.demuxSampleAes=function(S,E,b){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},v.flush=function(S){var E=this.cachedData;return E&&(this.cachedData=null,this.demux(E,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(M.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(M.dummyTrack)()}},v.destroy=function(){},h}(),R=function(v,L){return Object(W.isFiniteNumber)(v)?v*90:L*9e4};H.default=O},"./src/demux/chunk-cache.ts":function(Z,H,w){"use strict";w.r(H),w.d(H,"default",function(){return W});var W=function(){function M(){this.chunks=[],this.dataLength=0}var N=M.prototype;return N.push=function(O){this.chunks.push(O),this.dataLength+=O.length},N.flush=function(){var O=this.chunks,R=this.dataLength,h;if(O.length)O.length===1?h=O[0]:h=P(O,R);else return new Uint8Array(0);return this.reset(),h},N.reset=function(){this.chunks.length=0,this.dataLength=0},M}();function P(M,N){for(var k=new Uint8Array(N),O=0,R=0;R<M.length;R++){var h=M[R];k.set(h,O),O+=h.length}return k}},"./src/demux/dummy-demuxed-track.ts":function(Z,H,w){"use strict";w.r(H),w.d(H,"dummyTrack",function(){return W});function W(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(Z,H,w){"use strict";w.r(H);var W=w("./src/utils/logger.ts"),P=function(){function M(k){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=k,this.bytesAvailable=k.byteLength,this.word=0,this.bitsAvailable=0}var N=M.prototype;return N.loadWord=function(){var O=this.data,R=this.bytesAvailable,h=O.byteLength-R,v=new Uint8Array(4),L=Math.min(4,R);if(L===0)throw new Error("no bytes available");v.set(O.subarray(h,h+L)),this.word=new DataView(v.buffer).getUint32(0),this.bitsAvailable=L*8,this.bytesAvailable-=L},N.skipBits=function(O){var R;this.bitsAvailable>O?(this.word<<=O,this.bitsAvailable-=O):(O-=this.bitsAvailable,R=O>>3,O-=R>>3,this.bytesAvailable-=R,this.loadWord(),this.word<<=O,this.bitsAvailable-=O)},N.readBits=function(O){var R=Math.min(this.bitsAvailable,O),h=this.word>>>32-R;return O>32&&W.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=O-R,R>0&&this.bitsAvailable?h<<R|this.readBits(R):h},N.skipLZ=function(){var O;for(O=0;O<this.bitsAvailable;++O)if((this.word&2147483648>>>O)!==0)return this.word<<=O,this.bitsAvailable-=O,O;return this.loadWord(),O+this.skipLZ()},N.skipUEG=function(){this.skipBits(1+this.skipLZ())},N.skipEG=function(){this.skipBits(1+this.skipLZ())},N.readUEG=function(){var O=this.skipLZ();return this.readBits(O+1)-1},N.readEG=function(){var O=this.readUEG();return 1&O?1+O>>>1:-1*(O>>>1)},N.readBoolean=function(){return this.readBits(1)===1},N.readUByte=function(){return this.readBits(8)},N.readUShort=function(){return this.readBits(16)},N.readUInt=function(){return this.readBits(32)},N.skipScalingList=function(O){for(var R=8,h=8,v,L=0;L<O;L++)h!==0&&(v=this.readEG(),h=(R+v+256)%256),R=h===0?R:h},N.readSPS=function(){var O=0,R=0,h=0,v=0,L,S,E,b=this.readUByte.bind(this),d=this.readBits.bind(this),a=this.readUEG.bind(this),l=this.readBoolean.bind(this),u=this.skipBits.bind(this),C=this.skipEG.bind(this),g=this.skipUEG.bind(this),m=this.skipScalingList.bind(this);b();var D=b();if(d(5),u(3),b(),g(),D===100||D===110||D===122||D===244||D===44||D===83||D===86||D===118||D===128){var A=a();if(A===3&&u(1),g(),g(),u(1),l())for(S=A!==3?8:12,E=0;E<S;E++)l()&&(E<6?m(16):m(64))}g();var f=a();if(f===0)a();else if(f===1)for(u(1),C(),C(),L=a(),E=0;E<L;E++)C();g(),u(1);var c=a(),s=a(),o=d(1);o===0&&u(1),u(1),l()&&(O=a(),R=a(),h=a(),v=a());var x=[1,1];if(l()&&l()){var y=b();switch(y){case 1:x=[1,1];break;case 2:x=[12,11];break;case 3:x=[10,11];break;case 4:x=[16,11];break;case 5:x=[40,33];break;case 6:x=[24,11];break;case 7:x=[20,11];break;case 8:x=[32,11];break;case 9:x=[80,33];break;case 10:x=[18,11];break;case 11:x=[15,11];break;case 12:x=[64,33];break;case 13:x=[160,99];break;case 14:x=[4,3];break;case 15:x=[3,2];break;case 16:x=[2,1];break;case 255:{x=[b()<<8|b(),b()<<8|b()];break}}}return{width:Math.ceil((c+1)*16-O*2-R*2),height:(2-o)*(s+1)*16-(o?2:4)*(h+v),pixelRatio:x}},N.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},M}();H.default=P},"./src/demux/id3.ts":function(Z,H,w){"use strict";w.r(H),w.d(H,"isHeader",function(){return W}),w.d(H,"isFooter",function(){return P}),w.d(H,"getID3Data",function(){return M}),w.d(H,"canParse",function(){return k}),w.d(H,"getTimeStamp",function(){return O}),w.d(H,"isTimeStampFrame",function(){return R}),w.d(H,"getID3Frames",function(){return v}),w.d(H,"decodeFrame",function(){return L}),w.d(H,"utf8ArrayToStr",function(){return a}),w.d(H,"testables",function(){return l});var W=function(m,D){return D+10<=m.length&&(m[D]===73&&m[D+1]===68&&m[D+2]===51&&(m[D+3]<255&&m[D+4]<255&&(m[D+6]<128&&m[D+7]<128&&m[D+8]<128&&m[D+9]<128)))},P=function(m,D){return D+10<=m.length&&(m[D]===51&&m[D+1]===68&&m[D+2]===73&&(m[D+3]<255&&m[D+4]<255&&(m[D+6]<128&&m[D+7]<128&&m[D+8]<128&&m[D+9]<128)))},M=function(m,D){for(var A=D,f=0;W(m,D);){f+=10;var c=N(m,D+6);f+=c,P(m,D+10)&&(f+=10),D+=f}return f>0?m.subarray(A,A+f):void 0},N=function(m,D){var A=0;return A=(m[D]&127)<<21,A|=(m[D+1]&127)<<14,A|=(m[D+2]&127)<<7,A|=m[D+3]&127,A},k=function(m,D){return W(m,D)&&N(m,D+6)+10<=m.length-D},O=function(m){for(var D=v(m),A=0;A<D.length;A++){var f=D[A];if(R(f))return d(f)}return},R=function(m){return m&&m.key==="PRIV"&&m.info==="com.apple.streaming.transportStreamTimestamp"},h=function(m){var D=String.fromCharCode(m[0],m[1],m[2],m[3]),A=N(m,4),f=10;return{type:D,size:A,data:m.subarray(f,f+A)}},v=function(m){for(var D=0,A=[];W(m,D);){var f=N(m,D+6);D+=10;for(var c=D+f;D+8<c;){var s=h(m.subarray(D)),o=L(s);o&&A.push(o),D+=s.size+10}P(m,D)&&(D+=10)}return A},L=function(m){return m.type==="PRIV"?S(m):m.type[0]==="W"?b(m):E(m)},S=function(m){if(m.size<2)return;var D=a(m.data,!0),A=new Uint8Array(m.data.subarray(D.length+1));return{key:m.type,info:D,data:A.buffer}},E=function(m){if(m.size<2)return;if(m.type==="TXXX"){var D=1,A=a(m.data.subarray(D),!0);D+=A.length+1;var f=a(m.data.subarray(D));return{key:m.type,info:A,data:f}}var c=a(m.data.subarray(1));return{key:m.type,data:c}},b=function(m){if(m.type==="WXXX"){if(m.size<2)return;var D=1,A=a(m.data.subarray(D),!0);D+=A.length+1;var f=a(m.data.subarray(D));return{key:m.type,info:A,data:f}}var c=a(m.data);return{key:m.type,data:c}},d=function(m){if(m.data.byteLength===8){var D=new Uint8Array(m.data),A=D[3]&1,f=(D[4]<<23)+(D[5]<<15)+(D[6]<<7)+D[7];return f/=45,A&&(f+=4772185884e-2),Math.round(f)}return},a=function(m,D){D===void 0&&(D=!1);var A=C();if(A){var f=A.decode(m);if(D){var c=f.indexOf("\0");return c!==-1?f.substring(0,c):f}return f.replace(/\0/g,"")}for(var s=m.length,o,x,y,p="",I=0;I<s;){if(o=m[I++],o===0&&D)return p;if(o===0||o===3)continue;switch(o>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:p+=String.fromCharCode(o);break;case 12:case 13:x=m[I++],p+=String.fromCharCode((o&31)<<6|x&63);break;case 14:x=m[I++],y=m[I++],p+=String.fromCharCode((o&15)<<12|(x&63)<<6|(y&63)<<0);break;default:}}return p},l={decodeTextFrame:E},u;function C(){return!u&&typeof self.TextDecoder!="undefined"&&(u=new self.TextDecoder("utf-8")),u}},"./src/demux/mp3demuxer.ts":function(Z,H,w){"use strict";w.r(H);var W=w("./src/demux/base-audio-demuxer.ts"),P=w("./src/demux/id3.ts"),M=w("./src/utils/logger.ts"),N=w("./src/demux/mpegaudio.ts");function k(h,v){h.prototype=Object.create(v.prototype),h.prototype.constructor=h,O(h,v)}function O(h,v){return O=Object.setPrototypeOf||function(S,E){return S.__proto__=E,S},O(h,v)}var R=function(h){k(v,h);function v(){return h.apply(this,arguments)||this}var L=v.prototype;return L.resetInitSegment=function(E,b,d){h.prototype.resetInitSegment.call(this,E,b,d),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:E,duration:d,inputTimeScale:9e4,dropped:0}},v.probe=function(E){if(!E)return!1;for(var b=P.getID3Data(E,0)||[],d=b.length,a=E.length;d<a;d++)if(N.probe(E,d))return M.logger.log("MPEG Audio sync word found !"),!0;return!1},L.canParse=function(E,b){return N.canParse(E,b)},L.appendFrame=function(E,b,d){return this.initPTS===null?void 0:N.appendFrame(E,b,d,this.initPTS,this.frameIndex)},v}(W.default);R.minProbeByteLength=4,H.default=R},"./src/demux/mp4demuxer.ts":function(Z,H,w){"use strict";w.r(H);var W=w("./src/utils/mp4-tools.ts"),P=w("./src/demux/dummy-demuxed-track.ts"),M=function(){function N(O,R){this.remainderData=null,this.config=void 0,this.config=R}var k=N.prototype;return k.resetTimeStamp=function(){},k.resetInitSegment=function(){},k.resetContiguity=function(){},N.probe=function(R){return Object(W.findBox)({data:R,start:0,end:Math.min(R.length,16384)},["moof"]).length>0},k.demux=function(R){var h=R,v=Object(P.dummyTrack)();if(this.config.progressive){this.remainderData&&(h=Object(W.appendUint8Array)(this.remainderData,R));var L=Object(W.segmentValidRange)(h);this.remainderData=L.remainder,v.samples=L.valid||new Uint8Array}else v.samples=h;return{audioTrack:Object(P.dummyTrack)(),avcTrack:v,id3Track:Object(P.dummyTrack)(),textTrack:Object(P.dummyTrack)()}},k.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)()}},k.demuxSampleAes=function(R,h,v){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},k.destroy=function(){},N}();M.minProbeByteLength=1024,H.default=M},"./src/demux/mpegaudio.ts":function(Z,H,w){"use strict";w.r(H),w.d(H,"appendFrame",function(){return O}),w.d(H,"parseHeader",function(){return R}),w.d(H,"isHeaderPattern",function(){return h}),w.d(H,"isHeader",function(){return v}),w.d(H,"canParse",function(){return L}),w.d(H,"probe",function(){return S});var W=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],N=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],k=[0,1,1,4];function O(E,b,d,a,l){if(d+24>b.length)return;var u=R(b,d);if(u&&d+u.frameLength<=b.length){var C=u.samplesPerFrame*9e4/u.sampleRate,g=a+l*C,m={unit:b.subarray(d,d+u.frameLength),pts:g,dts:g};return E.config=[],E.channelCount=u.channelCount,E.samplerate=u.sampleRate,E.samples.push(m),{sample:m,length:u.frameLength,missing:0}}}function R(E,b){var d=E[b+1]>>3&3,a=E[b+1]>>1&3,l=E[b+2]>>4&15,u=E[b+2]>>2&3;if(d!==1&&l!==0&&l!==15&&u!==3){var C=E[b+2]>>1&1,g=E[b+3]>>6,m=d===3?3-a:a===3?3:4,D=P[m*14+l-1]*1e3,A=d===3?0:d===2?1:2,f=M[A*3+u],c=g===3?1:2,s=N[d][a],o=k[a],x=s*8*o,y=Math.floor(s*D/f+C)*o;if(W===null){var p=navigator.userAgent||"",I=p.match(/Chrome\/(\d+)/i);W=I?parseInt(I[1]):0}var B=!!W&&W<=87;return B&&a===2&&D>=224e3&&g===0&&(E[b+3]=E[b+3]|128),{sampleRate:f,channelCount:c,frameLength:y,samplesPerFrame:x}}}function h(E,b){return E[b]===255&&(E[b+1]&224)===224&&(E[b+1]&6)!==0}function v(E,b){return b+1<E.length&&h(E,b)}function L(E,b){var d=4;return h(E,b)&&d<=E.length-b}function S(E,b){if(b+1<E.length&&h(E,b)){var d=4,a=R(E,b),l=d;a!=null&&a.frameLength&&(l=a.frameLength);var u=b+l;return u===E.length||v(E,u)}return!1}},"./src/demux/sample-aes.ts":function(Z,H,w){"use strict";w.r(H);var W=w("./src/crypt/decrypter.ts"),P=w("./src/demux/tsdemuxer.ts"),M=function(){function N(O,R,h){this.keyData=void 0,this.decrypter=void 0,this.keyData=h,this.decrypter=new W.default(O,R,{removePKCS7Padding:!1})}var k=N.prototype;return k.decryptBuffer=function(R,h){this.decrypter.decrypt(R,this.keyData.key.buffer,this.keyData.iv.buffer,h)},k.decryptAacSample=function(R,h,v,L){var S=R[h].unit,E=S.subarray(16,S.length-S.length%16),b=E.buffer.slice(E.byteOffset,E.byteOffset+E.length),d=this;this.decryptBuffer(b,function(a){var l=new Uint8Array(a);S.set(l,16),L||d.decryptAacSamples(R,h+1,v)})},k.decryptAacSamples=function(R,h,v){for(;;h++){if(h>=R.length){v();return}if(R[h].unit.length<32)continue;var L=this.decrypter.isSync();if(this.decryptAacSample(R,h,v,L),!L)return}},k.getAvcEncryptedData=function(R){for(var h=Math.floor((R.length-48)/160)*16+16,v=new Int8Array(h),L=0,S=32;S<=R.length-16;S+=160,L+=16)v.set(R.subarray(S,S+16),L);return v},k.getAvcDecryptedUnit=function(R,h){for(var v=new Uint8Array(h),L=0,S=32;S<=R.length-16;S+=160,L+=16)R.set(v.subarray(L,L+16),S);return R},k.decryptAvcSample=function(R,h,v,L,S,E){var b=Object(P.discardEPB)(S.data),d=this.getAvcEncryptedData(b),a=this;this.decryptBuffer(d.buffer,function(l){S.data=a.getAvcDecryptedUnit(b,l),E||a.decryptAvcSamples(R,h,v+1,L)})},k.decryptAvcSamples=function(R,h,v,L){if(R instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;h++,v=0){if(h>=R.length){L();return}for(var S=R[h].units;!(v>=S.length);v++){var E=S[v];if(E.data.length<=48||E.type!==1&&E.type!==5)continue;var b=this.decrypter.isSync();if(this.decryptAvcSample(R,h,v,L,E,b),!b)return}}},N}();H.default=M},"./src/demux/transmuxer-interface.ts":function(Z,H,w){"use strict";w.r(H),w.d(H,"default",function(){return S});var W=w("./node_modules/webworkify-webpack/index.js"),P=w.n(W),M=w("./src/events.ts"),N=w("./src/demux/transmuxer.ts"),k=w("./src/utils/logger.ts"),O=w("./src/errors.ts"),R=w("./src/utils/mediasource-helper.ts"),h=w("./node_modules/eventemitter3/index.js"),v=w.n(h),L=Object(R.getMediaSource)()||{isTypeSupported:function(){return!1}},S=function(){function E(d,a,l,u){var C=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=a,this.onTransmuxComplete=l,this.onFlush=u;var g=d.config,m=function(s,o){o=o||{},o.frag=C.frag,o.id=C.id,d.trigger(s,o)};this.observer=new h.EventEmitter,this.observer.on(M.Events.FRAG_DECRYPTED,m),this.observer.on(M.Events.ERROR,m);var D={mp4:L.isTypeSupported("video/mp4"),mpeg:L.isTypeSupported("audio/mpeg"),mp3:L.isTypeSupported('audio/mp4; codecs="mp3"')},A=navigator.vendor;if(g.enableWorker&&typeof Worker!="undefined"){k.logger.log("demuxing in webworker");var f;try{f=this.worker=W("./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:O.ErrorTypes.OTHER_ERROR,details:O.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(c.message+" ("+c.filename+":"+c.lineno+")")})},f.postMessage({cmd:"init",typeSupported:D,vendor:A,id:a,config:JSON.stringify(g)})}catch(c){k.logger.warn("Error in worker:",c),k.logger.error("Error while initializing DemuxerWorker, fallback to inline"),f&&self.URL.revokeObjectURL(f.objectURL),this.transmuxer=new N.default(this.observer,D,g,A,a),this.worker=null}}else this.transmuxer=new N.default(this.observer,D,g,A,a)}var b=E.prototype;return b.destroy=function(){var a=this.worker;if(a)a.removeEventListener("message",this.onwmsg),a.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},b.push=function(a,l,u,C,g,m,D,A,f,c){var s=this;f.transmuxing.start=self.performance.now();var o=this.transmuxer,x=this.worker,y=m?m.start:g.start,p=g.decryptdata,I=this.frag,B=!(I&&g.cc===I.cc),F=!(I&&f.level===I.level),Q=I?f.sn-I.sn:-1,j=this.part?f.part-this.part.index:1,U=!F&&(Q===1||Q===0&&j===1),X=self.performance.now();(F||Q||g.stats.parsing.start===0)&&(g.stats.parsing.start=X),m&&(j||!U)&&(m.stats.parsing.start=X);var $=new N.TransmuxState(B,U,A,F,y);if(!U||B){k.logger.log("[transmuxer-interface, "+g.type+"]: Starting new transmux session for sn: "+f.sn+" p: "+f.part+" level: "+f.level+" id: "+f.id+`
discontinuity: `+B+`
trackSwitch: `+F+`
contiguous: `+U+`
accurateTimeOffset: `+A+`
timeOffset: `+y);var ne=new N.TransmuxConfig(u,C,l,D,c);this.configureTransmuxer(ne)}if(this.frag=g,this.part=m,x)x.postMessage({cmd:"demux",data:a,decryptdata:p,chunkMeta:f,state:$},a instanceof ArrayBuffer?[a]:[]);else if(o){var ue=o.push(a,p,f,$);Object(N.isPromise)(ue)?ue.then(function(Te){s.handleTransmuxComplete(Te)}):this.handleTransmuxComplete(ue)}},b.flush=function(a){var l=this;a.transmuxing.start=self.performance.now();var u=this.transmuxer,C=this.worker;if(C)C.postMessage({cmd:"flush",chunkMeta:a});else if(u){var g=u.flush(a);Object(N.isPromise)(g)?g.then(function(m){l.handleFlushResult(m,a)}):this.handleFlushResult(g,a)}},b.handleFlushResult=function(a,l){var u=this;a.forEach(function(C){u.handleTransmuxComplete(C)}),this.onFlush(l)},b.onWorkerMessage=function(a){var l=a.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}}},b.configureTransmuxer=function(a){var l=this.worker,u=this.transmuxer;l?l.postMessage({cmd:"configure",config:a}):u&&u.configure(a)},b.handleTransmuxComplete=function(a){a.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(a)},E}()},"./src/demux/transmuxer-worker.ts":function(Z,H,w){"use strict";w.r(H),w.d(H,"default",function(){return O});var W=w("./src/demux/transmuxer.ts"),P=w("./src/events.ts"),M=w("./src/utils/logger.ts"),N=w("./node_modules/eventemitter3/index.js"),k=w.n(N);function O(S){var E=new N.EventEmitter,b=function(a,l){S.postMessage({event:a,data:l})};E.on(P.Events.FRAG_DECRYPTED,b),E.on(P.Events.ERROR,b),S.addEventListener("message",function(d){var a=d.data;switch(a.cmd){case"init":{var l=JSON.parse(a.config);S.transmuxer=new W.default(E,a.typeSupported,l,a.vendor,a.id),Object(M.enableLogs)(l.debug),b("init",null);break}case"configure":{S.transmuxer.configure(a.config);break}case"demux":{var u=S.transmuxer.push(a.data,a.decryptdata,a.chunkMeta,a.state);Object(W.isPromise)(u)?u.then(function(m){R(S,m)}):R(S,u);break}case"flush":{var C=a.chunkMeta,g=S.transmuxer.flush(C);Object(W.isPromise)(g)?g.then(function(m){v(S,m,C)}):v(S,g,C);break}default:break}})}function R(S,E){if(L(E.remuxResult))return;var b=[],d=E.remuxResult,a=d.audio,l=d.video;a&&h(b,a),l&&h(b,l),S.postMessage({event:"transmuxComplete",data:E},b)}function h(S,E){E.data1&&S.push(E.data1.buffer),E.data2&&S.push(E.data2.buffer)}function v(S,E,b){E.forEach(function(d){R(S,d)}),S.postMessage({event:"flush",data:b})}function L(S){return!S.audio&&!S.video&&!S.text&&!S.id3&&!S.initSegment}},"./src/demux/transmuxer.ts":function(Z,H,w){"use strict";w.r(H),w.d(H,"default",function(){return l}),w.d(H,"isPromise",function(){return g}),w.d(H,"TransmuxConfig",function(){return m}),w.d(H,"TransmuxState",function(){return D});var W=w("./src/events.ts"),P=w("./src/errors.ts"),M=w("./src/crypt/decrypter.ts"),N=w("./src/demux/aacdemuxer.ts"),k=w("./src/demux/mp4demuxer.ts"),O=w("./src/demux/tsdemuxer.ts"),R=w("./src/demux/mp3demuxer.ts"),h=w("./src/remux/mp4-remuxer.ts"),v=w("./src/remux/passthrough-remuxer.ts"),L=w("./src/demux/chunk-cache.ts"),S=w("./src/utils/mp4-tools.ts"),E=w("./src/utils/logger.ts"),b;try{b=self.performance.now.bind(self.performance)}catch(A){E.logger.debug("Unable to use Performance API on this environment"),b=self.Date.now}var d=[{demux:O.default,remux:h.default},{demux:k.default,remux:v.default},{demux:N.default,remux:h.default},{demux:R.default,remux:h.default}],a=1024;d.forEach(function(A){var f=A.demux;a=Math.max(a,f.minProbeByteLength)});var l=function(){function A(c,s,o,x,y){this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.cache=new L.default,this.observer=c,this.typeSupported=s,this.config=o,this.vendor=x,this.id=y}var f=A.prototype;return f.configure=function(s){this.transmuxConfig=s,this.decrypter&&this.decrypter.reset()},f.push=function(s,o,x,y){var p=this,I=x.transmuxing;I.executeStart=b();var B=new Uint8Array(s),F=this.cache,Q=this.config,j=this.currentTransmuxState,U=this.transmuxConfig;y&&(this.currentTransmuxState=y);var X=u(B,o);if(X&&X.method==="AES-128"){var $=this.getDecrypter();if(Q.enableSoftwareAES){var ne=$.softwareDecrypt(B,X.key.buffer,X.iv.buffer);if(!ne)return I.executeEnd=b(),C(x);B=new Uint8Array(ne)}else return this.decryptionPromise=$.webCryptoDecrypt(B,X.key.buffer,X.iv.buffer).then(function(Re){var De=p.push(Re,null,x);return p.decryptionPromise=null,De}),this.decryptionPromise}var ue=y||j,Te=ue.contiguous,pe=ue.discontinuity,de=ue.trackSwitch,ce=ue.accurateTimeOffset,fe=ue.timeOffset,te=U.audioCodec,se=U.videoCodec,Ee=U.defaultInitPts,ke=U.duration,Le=U.initSegmentData;if((pe||de)&&this.resetInitSegment(Le,te,se,ke),pe&&this.resetInitialTimestamp(Ee),Te||this.resetContiguity(),this.needsProbing(B,pe,de)){if(F.dataLength){var We=F.flush();B=Object(S.appendUint8Array)(We,B)}this.configureTransmuxer(B,U)}var Xe=this.transmux(B,X,fe,ce,x),we=this.currentTransmuxState;return we.contiguous=!0,we.discontinuity=!1,we.trackSwitch=!1,I.executeEnd=b(),Xe},f.flush=function(s){var o=this,x=s.transmuxing;x.executeStart=b();var y=this.decrypter,p=this.cache,I=this.currentTransmuxState,B=this.decryptionPromise;if(B)return B.then(function(){return o.flush(s)});var F=[],Q=I.timeOffset;if(y){var j=y.flush();j&&F.push(this.push(j,null,s))}var U=p.dataLength;p.reset();var X=this.demuxer,$=this.remuxer;if(!X||!$)return U>=a&&this.observer.emit(W.Events.ERROR,W.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),x.executeEnd=b(),[C(s)];var ne=X.flush(Q);return g(ne)?ne.then(function(ue){return o.flushRemux(F,ue,s),F}):(this.flushRemux(F,ne,s),F)},f.flushRemux=function(s,o,x){var y=o.audioTrack,p=o.avcTrack,I=o.id3Track,B=o.textTrack,F=this.currentTransmuxState,Q=F.accurateTimeOffset,j=F.timeOffset;E.logger.log("[transmuxer.ts]: Flushed fragment "+x.sn+(x.part>-1?" p: "+x.part:"")+" of level "+x.level);var U=this.remuxer.remux(y,p,I,B,j,Q,!0,this.id);s.push({remuxResult:U,chunkMeta:x}),x.transmuxing.executeEnd=b()},f.resetInitialTimestamp=function(s){var o=this.demuxer,x=this.remuxer;if(!o||!x)return;o.resetTimeStamp(s),x.resetTimeStamp(s)},f.resetContiguity=function(){var s=this.demuxer,o=this.remuxer;if(!s||!o)return;s.resetContiguity(),o.resetNextTimestamp()},f.resetInitSegment=function(s,o,x,y){var p=this.demuxer,I=this.remuxer;if(!p||!I)return;p.resetInitSegment(o,x,y),I.resetInitSegment(s,o,x)},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,o,x,y,p){var I;return o&&o.method==="SAMPLE-AES"?I=this.transmuxSampleAes(s,o,x,y,p):I=this.transmuxUnencrypted(s,x,y,p),I},f.transmuxUnencrypted=function(s,o,x,y){var p=this.demuxer.demux(s,o,!1,!this.config.progressive),I=p.audioTrack,B=p.avcTrack,F=p.id3Track,Q=p.textTrack,j=this.remuxer.remux(I,B,F,Q,o,x,!1,this.id);return{remuxResult:j,chunkMeta:y}},f.transmuxSampleAes=function(s,o,x,y,p){var I=this;return this.demuxer.demuxSampleAes(s,o,x).then(function(B){var F=I.remuxer.remux(B.audioTrack,B.avcTrack,B.id3Track,B.textTrack,x,y,!1,I.id);return{remuxResult:F,chunkMeta:p}})},f.configureTransmuxer=function(s,o){for(var x=this.config,y=this.observer,p=this.typeSupported,I=this.vendor,B=o.audioCodec,F=o.defaultInitPts,Q=o.duration,j=o.initSegmentData,U=o.videoCodec,X,$=0,ne=d.length;$<ne;$++)if(d[$].demux.probe(s)){X=d[$];break}X||(E.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),X={demux:k.default,remux:v.default});var ue=this.demuxer,Te=this.remuxer,pe=X.remux,de=X.demux;(!Te||!(Te instanceof pe))&&(this.remuxer=new pe(y,x,p,I)),(!ue||!(ue instanceof de))&&(this.demuxer=new de(y,x,p),this.probe=de.probe),this.resetInitSegment(j,B,U,Q),this.resetInitialTimestamp(F)},f.needsProbing=function(s,o,x){return!this.demuxer||!this.remuxer||o||x},f.getDecrypter=function(){var s=this.decrypter;return s||(s=this.decrypter=new M.default(this.observer,this.config)),s},A}();function u(A,f){var c=null;return A.byteLength>0&&f!=null&&f.key!=null&&f.iv!==null&&f.method!=null&&(c=f),c}var C=function(f){return{remuxResult:{},chunkMeta:f}};function g(A){return"then"in A&&A.then instanceof Function}var m=function(f,c,s,o,x){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=o,this.defaultInitPts=x},D=function(f,c,s,o,x){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=o,this.timeOffset=x}},"./src/demux/tsdemuxer.ts":function(Z,H,w){"use strict";w.r(H),w.d(H,"discardEPB",function(){return C});var W=w("./src/demux/adts.ts"),P=w("./src/demux/mpegaudio.ts"),M=w("./src/demux/exp-golomb.ts"),N=w("./src/demux/id3.ts"),k=w("./src/demux/sample-aes.ts"),O=w("./src/events.ts"),R=w("./src/utils/mp4-tools.ts"),h=w("./src/utils/logger.ts"),v=w("./src/errors.ts"),L={video:1,audio:2,id3:3,text:4},S=function(){function g(D,A,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=D,this.config=A,this.typeSupported=f}g.probe=function(A){var f=g.syncOffset(A);return f<0?!1:(f&&h.logger.warn("MPEG2-TS detected but first sync word found @ offset "+f+", junk ahead ?"),!0)},g.syncOffset=function(A){for(var f=Math.min(1e3,A.length-3*188),c=0;c<f;){if(A[c]===71&&A[c+188]===71&&A[c+2*188]===71)return c;c++}return-1},g.createTrack=function(A,f){return{container:A==="video"||A==="audio"?"video/mp2t":void 0,type:A,id:L[A],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:A==="audio"?f:void 0}};var m=g.prototype;return m.resetInitSegment=function(A,f,c){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=g.createTrack("video",c),this._audioTrack=g.createTrack("audio",c),this._id3Track=g.createTrack("id3",c),this._txtTrack=g.createTrack("text",c),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=A,this.videoCodec=f,this._duration=c},m.resetTimeStamp=function(){},m.resetContiguity=function(){var A=this._audioTrack,f=this._avcTrack,c=this._id3Track;A&&(A.pesData=null),f&&(f.pesData=null),c&&(c.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},m.demux=function(A,f,c,s){c===void 0&&(c=!1),s===void 0&&(s=!1),c||(this.sampleAes=null);var o,x=this._avcTrack,y=this._audioTrack,p=this._id3Track,I=x.pid,B=x.pesData,F=y.pid,Q=p.pid,j=y.pesData,U=p.pesData,X=!1,$=this.pmtParsed,ne=this._pmtId,ue=A.length;if(this.remainderData&&(A=Object(R.appendUint8Array)(this.remainderData,A),ue=A.length,this.remainderData=null),ue<188&&!s)return this.remainderData=A,{audioTrack:y,avcTrack:x,id3Track:p,textTrack:this._txtTrack};var Te=Math.max(0,g.syncOffset(A));ue-=(ue+Te)%188,ue<A.byteLength&&!s&&(this.remainderData=new Uint8Array(A.buffer,ue,A.buffer.byteLength-ue));for(var pe=Te;pe<ue;pe+=188)if(A[pe]===71){var de=!!(A[pe+1]&64),ce=((A[pe+1]&31)<<8)+A[pe+2],fe=(A[pe+3]&48)>>4,te=void 0;if(fe>1){if(te=pe+5+A[pe+4],te===pe+188)continue}else te=pe+4;switch(ce){case I:de&&(B&&(o=a(B))&&this.parseAVCPES(o,!1),B={data:[],size:0}),B&&(B.data.push(A.subarray(te,pe+188)),B.size+=pe+188-te);break;case F:de&&(j&&(o=a(j))&&(y.isAAC?this.parseAACPES(o):this.parseMPEGPES(o)),j={data:[],size:0}),j&&(j.data.push(A.subarray(te,pe+188)),j.size+=pe+188-te);break;case Q:de&&(U&&(o=a(U))&&this.parseID3PES(o),U={data:[],size:0}),U&&(U.data.push(A.subarray(te,pe+188)),U.size+=pe+188-te);break;case 0:de&&(te+=A[te]+1),ne=this._pmtId=b(A,te);break;case ne:{de&&(te+=A[te]+1);var se=d(A,te,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,c);I=se.avc,I>0&&(x.pid=I),F=se.audio,F>0&&(y.pid=F,y.isAAC=se.isAAC),Q=se.id3,Q>0&&(p.pid=Q),X&&!$&&(h.logger.log("reparse from beginning"),X=!1,pe=Te-188),$=this.pmtParsed=!0;break}case 17:case 8191:break;default:X=!0;break}}else this.observer.emit(O.Events.ERROR,O.Events.ERROR,{type:v.ErrorTypes.MEDIA_ERROR,details:v.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});x.pesData=B,y.pesData=j,p.pesData=U;var Ee={audioTrack:y,avcTrack:x,id3Track:p,textTrack:this._txtTrack};return s&&this.extractRemainingSamples(Ee),Ee},m.flush=function(){var A=this.remainderData;this.remainderData=null;var f;return A?f=this.demux(A,-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},m.extractRemainingSamples=function(A){var f=A.audioTrack,c=A.avcTrack,s=A.id3Track,o=c.pesData,x=f.pesData,y=s.pesData,p;o&&(p=a(o))?(this.parseAVCPES(p,!0),c.pesData=null):c.pesData=o,x&&(p=a(x))?(f.isAAC?this.parseAACPES(p):this.parseMPEGPES(p),f.pesData=null):(x!=null&&x.size&&h.logger.log("last AAC PES packet truncated,might overlap between fragments"),f.pesData=x),y&&(p=a(y))?(this.parseID3PES(p),s.pesData=null):s.pesData=y},m.demuxSampleAes=function(A,f,c){var s=this.demux(A,c,!0,!this.config.progressive),o=this.sampleAes=new k.default(this.observer,this.config,f);return this.decrypt(s,o)},m.decrypt=function(A,f){return new Promise(function(c){var s=A.audioTrack,o=A.avcTrack;s.samples&&s.isAAC?f.decryptAacSamples(s.samples,0,function(){o.samples?f.decryptAvcSamples(o.samples,0,0,function(){c(A)}):c(A)}):o.samples&&f.decryptAvcSamples(o.samples,0,0,function(){c(A)})})},m.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},m.parseAVCPES=function(A,f){var c=this,s=this._avcTrack,o=this.parseAVCNALu(A.data),x=!1,y=this.avcSample,p,I=!1;A.data=null,y&&o.length&&!s.audFound&&(l(y,s),y=this.avcSample=E(!1,A.pts,A.dts,"")),o.forEach(function(B){switch(B.type){case 1:{p=!0,y||(y=c.avcSample=E(!0,A.pts,A.dts,"")),x&&(y.debug+="NDR "),y.frame=!0;var F=B.data;if(I&&F.length>4){var Q=new M.default(F).readSliceType();(Q===2||Q===4||Q===7||Q===9)&&(y.key=!0)}break}case 5:p=!0,y||(y=c.avcSample=E(!0,A.pts,A.dts,"")),x&&(y.debug+="IDR "),y.key=!0,y.frame=!0;break;case 6:{p=!0,x&&y&&(y.debug+="SEI ");var j=new M.default(C(B.data));j.readUByte();for(var U=0,X=0,$=!1,ne=0;!$&&j.bytesAvailable>1;){U=0;do ne=j.readUByte(),U+=ne;while(ne===255);X=0;do ne=j.readUByte(),X+=ne;while(ne===255);if(U===4&&j.bytesAvailable!==0){$=!0;var ue=j.readUByte();if(ue===181){var Te=j.readUShort();if(Te===49){var pe=j.readUInt();if(pe===1195456820){var de=j.readUByte();if(de===3){for(var ce=j.readUByte(),fe=j.readUByte(),te=31&ce,se=[ce,fe],Ee=0;Ee<te;Ee++)se.push(j.readUByte()),se.push(j.readUByte()),se.push(j.readUByte());u(c._txtTrack.samples,{type:3,pts:A.pts,bytes:se})}}}}}else if(U===5&&j.bytesAvailable!==0){if($=!0,X>16){for(var ke=[],Le=0;Le<16;Le++)ke.push(j.readUByte().toString(16)),(Le===3||Le===5||Le===7||Le===9)&&ke.push("-");for(var We=X-16,Xe=new Uint8Array(We),we=0;we<We;we++)Xe[we]=j.readUByte();u(c._txtTrack.samples,{pts:A.pts,payloadType:U,uuid:ke.join(""),userData:Object(N.utf8ArrayToStr)(Xe),userDataBytes:Xe})}}else if(X<j.bytesAvailable)for(var Re=0;Re<X;Re++)j.readUByte()}break}case 7:if(p=!0,I=!0,x&&y&&(y.debug+="SPS "),!s.sps){var De=new M.default(B.data),He=De.readSPS();s.width=He.width,s.height=He.height,s.pixelRatio=He.pixelRatio,s.sps=[B.data],s.duration=c._duration;for(var Ve=B.data.subarray(1,4),Ce="avc1.",Me=0;Me<3;Me++){var qe=Ve[Me].toString(16);qe.length<2&&(qe="0"+qe),Ce+=qe}s.codec=Ce}break;case 8:p=!0,x&&y&&(y.debug+="PPS "),s.pps||(s.pps=[B.data]);break;case 9:p=!1,s.audFound=!0,y&&l(y,s),y=c.avcSample=E(!1,A.pts,A.dts,x?"AUD ":"");break;case 12:p=!1;break;default:p=!1,y&&(y.debug+="unknown NAL "+B.type+" ");break}if(y&&p){var tt=y.units;tt.push(B)}}),f&&y&&(l(y,s),this.avcSample=null)},m.getLastNalUnit=function(){var A,f=this.avcSample,c;if(!f||f.units.length===0){var s=this._avcTrack.samples;f=s[s.length-1]}if((A=f)!==null&&A!==void 0&&A.units){var o=f.units;c=o[o.length-1]}return c},m.parseAVCNALu=function(A){var f=A.byteLength,c=this._avcTrack,s=c.naluState||0,o=s,x=[],y=0,p,I,B,F=-1,Q=0;for(s===-1&&(F=0,Q=A[0]&31,s=0,y=1);y<f;){if(p=A[y++],!s){s=p?0:1;continue}if(s===1){s=p?0:2;continue}if(!p)s=3;else if(p===1){if(F>=0){var j={data:A.subarray(F,y-s-1),type:Q};x.push(j)}else{var U=this.getLastNalUnit();if(U&&(o&&y<=4-o&&(U.state&&(U.data=U.data.subarray(0,U.data.byteLength-o))),I=y-s-1,I>0)){var X=new Uint8Array(U.data.byteLength+I);X.set(U.data,0),X.set(A.subarray(0,I),U.data.byteLength),U.data=X,U.state=0}}y<f?(B=A[y]&31,F=y,Q=B,s=0):s=-1}else s=0}if(F>=0&&s>=0){var $={data:A.subarray(F,f),type:Q,state:s};x.push($)}if(x.length===0){var ne=this.getLastNalUnit();if(ne){var ue=new Uint8Array(ne.data.byteLength+A.byteLength);ue.set(ne.data,0),ue.set(A,ne.data.byteLength),ne.data=ue}}return c.naluState=s,x},m.parseAACPES=function(A){var f=0,c=this._audioTrack,s=this.aacOverFlow,o=A.data;if(s){this.aacOverFlow=null;var x=s.sample.unit.byteLength,y=Math.min(s.missing,x),p=x-y;s.sample.unit.set(o.subarray(0,y),p),c.samples.push(s.sample),f=s.missing}var I,B;for(I=f,B=o.length;I<B-1&&!W.isHeader(o,I);I++);if(I!==f){var F,Q;if(I<B-1?(F="AAC PES did not start with ADTS header,offset:"+I,Q=!1):(F="no ADTS header found in AAC PES",Q=!0),h.logger.warn("parsing error:"+F),this.observer.emit(O.Events.ERROR,O.Events.ERROR,{type:v.ErrorTypes.MEDIA_ERROR,details:v.ErrorDetails.FRAG_PARSING_ERROR,fatal:Q,reason:F}),Q)return}W.initTrackConfig(c,this.observer,o,I,this.audioCodec);var j;if(A.pts!==void 0)j=A.pts;else if(s){var U=W.getFrameDuration(c.samplerate);j=s.sample.pts+U}else{h.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var X=0;I<B;)if(W.isHeader(o,I)){if(I+5<B){var $=W.appendFrame(c,o,I,j,X);if($)if($.missing)this.aacOverFlow=$;else{I+=$.length,X++;continue}}break}else I++},m.parseMPEGPES=function(A){var f=A.data,c=f.length,s=0,o=0,x=A.pts;if(x===void 0){h.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;o<c;)if(P.isHeader(f,o)){var y=P.appendFrame(this._audioTrack,f,o,x,s);if(y)o+=y.length,s++;else break}else o++},m.parseID3PES=function(A){if(A.pts===void 0){h.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(A)},g}();S.minProbeByteLength=188;function E(g,m,D,A){return{key:g,frame:!1,pts:m,dts:D,units:[],debug:A,length:0}}function b(g,m){return(g[m+10]&31)<<8|g[m+11]}function d(g,m,D,A){var f={audio:-1,avc:-1,id3:-1,isAAC:!0},c=(g[m+1]&15)<<8|g[m+2],s=m+3+c-4,o=(g[m+10]&15)<<8|g[m+11];for(m+=12+o;m<s;){var x=(g[m+1]&31)<<8|g[m+2];switch(g[m]){case 207:if(!A){h.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:f.audio===-1&&(f.audio=x);break;case 21:f.id3===-1&&(f.id3=x);break;case 219:if(!A){h.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:f.avc===-1&&(f.avc=x);break;case 3:case 4:D?f.audio===-1&&(f.audio=x,f.isAAC=!1):h.logger.log("MPEG audio found, not supported in this browser");break;case 36:h.logger.warn("Unsupported HEVC stream type found");break;default:break}m+=((g[m+3]&15)<<8|g[m+4])+5}return f}function a(g){var m=0,D,A,f,c,s,o=g.data;if(!g||g.size===0)return null;for(;o[0].length<19&&o.length>1;){var x=new Uint8Array(o[0].length+o[1].length);x.set(o[0]),x.set(o[1],o[0].length),o[0]=x,o.splice(1,1)}D=o[0];var y=(D[0]<<16)+(D[1]<<8)+D[2];if(y===1){if(A=(D[4]<<8)+D[5],A&&A>g.size-6)return null;var p=D[7];p&192&&(c=(D[9]&14)*536870912+(D[10]&255)*4194304+(D[11]&254)*16384+(D[12]&255)*128+(D[13]&254)/2,p&64?(s=(D[14]&14)*536870912+(D[15]&255)*4194304+(D[16]&254)*16384+(D[17]&255)*128+(D[18]&254)/2,c-s>60*9e4&&(h.logger.warn(Math.round((c-s)/9e4)+"s delta between PTS and DTS, align them"),c=s)):s=c),f=D[8];var I=f+9;if(g.size<=I)return null;g.size-=I;for(var B=new Uint8Array(g.size),F=0,Q=o.length;F<Q;F++){D=o[F];var j=D.byteLength;if(I)if(I>j){I-=j;continue}else D=D.subarray(I),j-=I,I=0;B.set(D,m),m+=j}return A&&(A-=f+3),{data:B,pts:c,dts:s,len:A}}return null}function l(g,m){if(g.units.length&&g.frame){if(g.pts===void 0){var D=m.samples,A=D.length;if(A){var f=D[A-1];g.pts=f.pts,g.dts=f.dts}else{m.dropped++;return}}m.samples.push(g)}g.debug.length&&h.logger.log(g.pts+"/"+g.dts+":"+g.debug)}function u(g,m){var D=g.length;if(D>0){if(m.pts>=g[D-1].pts)g.push(m);else for(var A=D-1;A>=0;A--)if(m.pts<g[A].pts){g.splice(A,0,m);break}}else g.push(m)}function C(g){for(var m=g.byteLength,D=[],A=1;A<m-2;)g[A]===0&&g[A+1]===0&&g[A+2]===3?(D.push(A+2),A+=2):A++;if(D.length===0)return g;var f=m-D.length,c=new Uint8Array(f),s=0;for(A=0;A<f;s++,A++)s===D[0]&&(s++,D.shift()),c[A]=g[s];return c}H.default=S},"./src/errors.ts":function(Z,H,w){"use strict";w.r(H),w.d(H,"ErrorTypes",function(){return W}),w.d(H,"ErrorDetails",function(){return P});var W;(function(M){M.NETWORK_ERROR="networkError",M.MEDIA_ERROR="mediaError",M.KEY_SYSTEM_ERROR="keySystemError",M.MUX_ERROR="muxError",M.OTHER_ERROR="otherError"})(W||(W={}));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(Z,H,w){"use strict";w.r(H),w.d(H,"Events",function(){return W});var W;(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"})(W||(W={}))},"./src/hls.ts":function(Z,H,w){"use strict";w.r(H),w.d(H,"default",function(){return g});var W=w("./node_modules/url-toolkit/src/url-toolkit.js"),P=w.n(W),M=w("./src/loader/playlist-loader.ts"),N=w("./src/loader/key-loader.ts"),k=w("./src/controller/id3-track-controller.ts"),O=w("./src/controller/latency-controller.ts"),R=w("./src/controller/level-controller.ts"),h=w("./src/controller/fragment-tracker.ts"),v=w("./src/controller/stream-controller.ts"),L=w("./src/is-supported.ts"),S=w("./src/utils/logger.ts"),E=w("./src/config.ts"),b=w("./node_modules/eventemitter3/index.js"),d=w.n(b),a=w("./src/events.ts"),l=w("./src/errors.ts");function u(m,D){for(var A=0;A<D.length;A++){var f=D[A];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(m,f.key,f)}}function C(m,D,A){return D&&u(m.prototype,D),A&&u(m,A),m}var g=function(){m.isSupported=function(){return Object(L.isSupported)()};function m(A){A===void 0&&(A={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new b.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(E.mergeConfig)(m.DefaultConfig,A);this.userConfig=A,Object(S.enableLogs)(f.debug),this._autoLevelCapping=-1,f.progressive&&Object(E.enableStreamingMode)(f);var c=f.abrController,s=f.bufferController,o=f.capLevelController,x=f.fpsController,y=this.abrController=new c(this),p=this.bufferController=new s(this),I=this.capLevelController=new o(this),B=new x(this),F=new M.default(this),Q=new N.default(this),j=new k.default(this),U=this.levelController=new R.default(this),X=new h.FragmentTracker(this),$=this.streamController=new v.default(this,X);I.setStreamController($),B.setStreamController($);var ne=[U,$];this.networkControllers=ne;var ue=[F,Q,y,p,I,B,j,X];this.audioTrackController=this.createController(f.audioTrackController,null,ne),this.createController(f.audioStreamController,X,ne),this.subtitleTrackController=this.createController(f.subtitleTrackController,null,ne),this.createController(f.subtitleStreamController,X,ne),this.createController(f.timelineController,null,ue),this.emeController=this.createController(f.emeController,null,ue),this.cmcdController=this.createController(f.cmcdController,null,ue),this.latencyController=this.createController(O.default,null,ue),this.coreComponents=ue}var D=m.prototype;return D.createController=function(f,c,s){if(f){var o=c?new f(this,c):new f(this);return s&&s.push(o),o}return null},D.on=function(f,c,s){s===void 0&&(s=this),this._emitter.on(f,c,s)},D.once=function(f,c,s){s===void 0&&(s=this),this._emitter.once(f,c,s)},D.removeAllListeners=function(f){this._emitter.removeAllListeners(f)},D.off=function(f,c,s,o){s===void 0&&(s=this),this._emitter.off(f,c,s,o)},D.listeners=function(f){return this._emitter.listeners(f)},D.emit=function(f,c,s){return this._emitter.emit(f,c,s)},D.trigger=function(f,c){if(this.config.debug)return this.emit(f,f,c);try{return this.emit(f,f,c)}catch(s){S.logger.error("An internal error happened while handling event "+f+'. Error message: "'+s.message+'". Here is a stacktrace:',s),this.trigger(a.Events.ERROR,{type:l.ErrorTypes.OTHER_ERROR,details:l.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:f,error:s})}return!1},D.listenerCount=function(f){return this._emitter.listenerCount(f)},D.destroy=function(){S.logger.log("destroy"),this.trigger(a.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},D.attachMedia=function(f){S.logger.log("attachMedia"),this._media=f,this.trigger(a.Events.MEDIA_ATTACHING,{media:f})},D.detachMedia=function(){S.logger.log("detachMedia"),this.trigger(a.Events.MEDIA_DETACHING,void 0),this._media=null},D.loadSource=function(f){this.stopLoad();var c=this.media,s=this.url,o=this.url=W.buildAbsoluteURL(self.location.href,f,{alwaysNormalize:!0});S.logger.log("loadSource:"+o),c&&s&&s!==o&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(c)),this.trigger(a.Events.MANIFEST_LOADING,{url:f})},D.startLoad=function(f){f===void 0&&(f=-1),S.logger.log("startLoad("+f+")"),this.networkControllers.forEach(function(c){c.startLoad(f)})},D.stopLoad=function(){S.logger.log("stopLoad"),this.networkControllers.forEach(function(f){f.stopLoad()})},D.swapAudioCodec=function(){S.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},D.recoverMediaError=function(){S.logger.log("recoverMediaError");var f=this._media;this.detachMedia(),f&&this.attachMedia(f)},D.removeLevel=function(f,c){c===void 0&&(c=0),this.levelController.removeLevel(f,c)},C(m,[{key:"levels",get:function(){var f=this.levelController.levels;return f||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(f){S.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){S.logger.log("set nextLevel:"+f),this.levelController.manualLevel=f,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(f){S.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){S.logger.log("set firstLevel:"+f),this.levelController.firstLevel=f}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(f){S.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&&(S.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,o=0;o<s;o++)if(f[o].maxBitrate>c)return o;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 a.Events}},{key:"ErrorTypes",get:function(){return l.ErrorTypes}},{key:"ErrorDetails",get:function(){return l.ErrorDetails}},{key:"DefaultConfig",get:function(){return m.defaultConfig?m.defaultConfig:E.hlsDefaultConfig},set:function(f){m.defaultConfig=f}}]),m}();g.defaultConfig=void 0},"./src/is-supported.ts":function(Z,H,w){"use strict";w.r(H),w.d(H,"isSupported",function(){return M}),w.d(H,"changeTypeSupported",function(){return N});var W=w("./src/utils/mediasource-helper.ts");function P(){return self.SourceBuffer||self.WebKitSourceBuffer}function M(){var k=Object(W.getMediaSource)();if(!k)return!1;var O=P(),R=k&&typeof k.isTypeSupported=="function"&&k.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),h=!O||O.prototype&&typeof O.prototype.appendBuffer=="function"&&typeof O.prototype.remove=="function";return!!R&&!!h}function N(){var k,O=P();return typeof(O==null||((k=O.prototype)===null||k===void 0)?void 0:k.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(Z,H,w){"use strict";w.r(H),w.d(H,"default",function(){return S}),w.d(H,"LoadError",function(){return b});var W=w("./src/polyfills/number.ts"),P=w("./src/errors.ts");function M(d,a){d.prototype=Object.create(a.prototype),d.prototype.constructor=d,h(d,a)}function N(d){var a=typeof Map=="function"?new Map:void 0;return N=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 a!="undefined"){if(a.has(u))return a.get(u);a.set(u,C)}function C(){return k(u,arguments,v(this).constructor)}return C.prototype=Object.create(u.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),h(C,u)},N(d)}function k(d,a,l){return O()?k=Reflect.construct:k=function(C,g,m){var D=[null];D.push.apply(D,g);var A=Function.bind.apply(C,D),f=new A;return m&&h(f,m.prototype),f},k.apply(null,arguments)}function O(){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 h(d,a){return h=Object.setPrototypeOf||function(u,C){return u.__proto__=C,u},h(d,a)}function v(d){return v=Object.setPrototypeOf?Object.getPrototypeOf:function(l){return l.__proto__||Object.getPrototypeOf(l)},v(d)}var L=Math.pow(2,17),S=function(){function d(l){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=l}var a=d.prototype;return a.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},a.abort=function(){this.loader&&this.loader.abort()},a.load=function(u,C){var g=this,m=u.url;if(!m)return Promise.reject(new b({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:u,networkDetails:null},"Fragment does not have a "+(m?"part list":"url")));this.abort();var D=this.config,A=D.fLoader,f=D.loader;return new Promise(function(c,s){g.loader&&g.loader.destroy();var o=g.loader=u.loader=A?new A(D):new f(D),x=E(u),y={timeout:D.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:D.fragLoadingMaxRetryTimeout,highWaterMark:L};u.stats=o.stats,o.load(x,y,{onSuccess:function(I,B,F,Q){g.resetLoader(u,o),c({frag:u,part:null,payload:I.data,networkDetails:Q})},onError:function(I,B,F){g.resetLoader(u,o),s(new b({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:u,response:I,networkDetails:F}))},onAbort:function(I,B,F){g.resetLoader(u,o),s(new b({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:u,networkDetails:F}))},onTimeout:function(I,B,F){g.resetLoader(u,o),s(new b({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:u,networkDetails:F}))},onProgress:function(I,B,F,Q){C&&C({frag:u,part:null,payload:F,networkDetails:Q})}})})},a.loadPart=function(u,C,g){var m=this;this.abort();var D=this.config,A=D.fLoader,f=D.loader;return new Promise(function(c,s){m.loader&&m.loader.destroy();var o=m.loader=u.loader=A?new A(D):new f(D),x=E(u,C),y={timeout:D.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:D.fragLoadingMaxRetryTimeout,highWaterMark:L};C.stats=o.stats,o.load(x,y,{onSuccess:function(I,B,F,Q){m.resetLoader(u,o),m.updateStatsFromPart(u,C);var j={frag:u,part:C,payload:I.data,networkDetails:Q};g(j),c(j)},onError:function(I,B,F){m.resetLoader(u,o),s(new b({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:u,part:C,response:I,networkDetails:F}))},onAbort:function(I,B,F){u.stats.aborted=C.stats.aborted,m.resetLoader(u,o),s(new b({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:u,part:C,networkDetails:F}))},onTimeout:function(I,B,F){m.resetLoader(u,o),s(new b({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:u,part:C,networkDetails:F}))}})})},a.updateStatsFromPart=function(u,C){var g=u.stats,m=C.stats,D=m.total;if(g.loaded+=m.loaded,D){var A=Math.round(u.duration/C.duration),f=Math.min(Math.round(g.loaded/D),A),c=A-f,s=c*Math.round(g.loaded/f);g.total=g.loaded+s}else g.total=Math.max(g.loaded,g.total);var o=g.loading,x=m.loading;o.start?o.first+=x.first-x.start:(o.start=x.start,o.first=x.first),o.end=x.end},a.resetLoader=function(u,C){u.loader=null,this.loader===C&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),C.destroy()},d}();function E(d,a){a===void 0&&(a=null);var l=a||d,u={frag:d,part:a,responseType:"arraybuffer",url:l.url,headers:{},rangeStart:0,rangeEnd:0},C=l.byteRangeStartOffset,g=l.byteRangeEndOffset;return Object(W.isFiniteNumber)(C)&&Object(W.isFiniteNumber)(g)&&(u.rangeStart=C,u.rangeEnd=g),u}var b=function(d){M(a,d);function a(l){for(var u,C=arguments.length,g=new Array(C>1?C-1:0),m=1;m<C;m++)g[m-1]=arguments[m];return u=d.call.apply(d,[this].concat(g))||this,u.data=void 0,u.data=l,u}return a}(N(Error))},"./src/loader/fragment.ts":function(Z,H,w){"use strict";w.r(H),w.d(H,"ElementaryStreamTypes",function(){return S}),w.d(H,"BaseSegment",function(){return E}),w.d(H,"Fragment",function(){return b}),w.d(H,"Part",function(){return d});var W=w("./src/polyfills/number.ts"),P=w("./node_modules/url-toolkit/src/url-toolkit.js"),M=w.n(P),N=w("./src/utils/logger.ts"),k=w("./src/loader/level-key.ts"),O=w("./src/loader/load-stats.ts");function R(a,l){a.prototype=Object.create(l.prototype),a.prototype.constructor=a,h(a,l)}function h(a,l){return h=Object.setPrototypeOf||function(C,g){return C.__proto__=g,C},h(a,l)}function v(a,l){for(var u=0;u<l.length;u++){var C=l[u];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(a,C.key,C)}}function L(a,l,u){return l&&v(a.prototype,l),u&&v(a,u),a}var S;(function(a){a.AUDIO="audio",a.VIDEO="video",a.AUDIOVIDEO="audiovideo"})(S||(S={}));var E=function(){function a(u){var C;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(C={},C[S.AUDIO]=null,C[S.VIDEO]=null,C[S.AUDIOVIDEO]=null,C),this.baseurl=u}var l=a.prototype;return l.setByteRange=function(C,g){var m=C.split("@",2),D=[];m.length===1?D[0]=g?g.byteRangeEndOffset:0:D[0]=parseInt(m[1]),D[1]=parseInt(m[0])+D[0],this._byteRange=D},L(a,[{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(C){this._url=C}}]),a}(),b=function(a){R(l,a);function l(C,g){var m;return m=a.call(this,g)||this,m._decryptdata=null,m.rawProgramDateTime=null,m.programDateTime=null,m.tagList=[],m.duration=0,m.sn=0,m.levelkey=void 0,m.type=void 0,m.loader=null,m.level=-1,m.cc=0,m.startPTS=void 0,m.endPTS=void 0,m.appendedPTS=void 0,m.startDTS=void 0,m.endDTS=void 0,m.start=0,m.deltaPTS=void 0,m.maxStartPTS=void 0,m.minEndPTS=void 0,m.stats=new O.LoadStats,m.urlId=0,m.data=void 0,m.bitrateTest=!1,m.title=null,m.initSegment=null,m.type=C,m}var u=l.prototype;return u.createInitializationVector=function(g){for(var m=new Uint8Array(16),D=12;D<16;D++)m[D]=g>>8*(15-D)&255;return m},u.setDecryptDataFromLevelKey=function(g,m){var D=g;return(g==null?void 0:g.method)==="AES-128"&&g.uri&&!g.iv&&(D=k.LevelKey.fromURI(g.uri),D.method=g.method,D.iv=this.createInitializationVector(m),D.keyFormat="identity"),D},u.setElementaryStreamInfo=function(g,m,D,A,f,c){c===void 0&&(c=!1);var s=this.elementaryStreams,o=s[g];if(!o){s[g]={startPTS:m,endPTS:D,startDTS:A,endDTS:f,partial:c};return}o.startPTS=Math.min(o.startPTS,m),o.endPTS=Math.max(o.endPTS,D),o.startDTS=Math.min(o.startDTS,A),o.endDTS=Math.max(o.endDTS,f)},u.clearElementaryStreamInfo=function(){var g=this.elementaryStreams;g[S.AUDIO]=null,g[S.VIDEO]=null,g[S.AUDIOVIDEO]=null},L(l,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var g=this.sn;typeof g!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&N.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),g=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,g)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(W.isFiniteNumber)(this.programDateTime))return null;var g=Object(W.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+g*1e3}},{key:"encrypted",get:function(){var g;return!!((g=this.decryptdata)!==null&&g!==void 0&&g.keyFormat&&this.decryptdata.uri)}}]),l}(E),d=function(a){R(l,a);function l(u,C,g,m,D){var A;A=a.call(this,g)||this,A.fragOffset=0,A.duration=0,A.gap=!1,A.independent=!1,A.relurl=void 0,A.fragment=void 0,A.index=void 0,A.stats=new O.LoadStats,A.duration=u.decimalFloatingPoint("DURATION"),A.gap=u.bool("GAP"),A.independent=u.bool("INDEPENDENT"),A.relurl=u.enumeratedString("URI"),A.fragment=C,A.index=m;var f=u.enumeratedString("BYTERANGE");return f&&A.setByteRange(f,D),D&&(A.fragOffset=D.fragOffset+D.duration),A}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 C=this.elementaryStreams;return!!(C.audio||C.video||C.audiovideo)}}]),l}(E)},"./src/loader/key-loader.ts":function(Z,H,w){"use strict";w.r(H),w.d(H,"default",function(){return N});var W=w("./src/events.ts"),P=w("./src/errors.ts"),M=w("./src/utils/logger.ts"),N=function(){function k(R){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=R,this._registerListeners()}var O=k.prototype;return O._registerListeners=function(){this.hls.on(W.Events.KEY_LOADING,this.onKeyLoading,this)},O._unregisterListeners=function(){this.hls.off(W.Events.KEY_LOADING,this.onKeyLoading)},O.destroy=function(){this._unregisterListeners();for(var h in this.loaders){var v=this.loaders[h];v&&v.destroy()}this.loaders={}},O.onKeyLoading=function(h,v){var L=v.frag,S=L.type,E=this.loaders[S];if(!L.decryptdata){M.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var b=L.decryptdata.uri;if(b!==this.decrypturl||this.decryptkey===null){var d=this.hls.config;if(E&&(M.logger.warn("abort previous key loader for type:"+S),E.abort()),!b){M.logger.warn("key uri is falsy");return}var a=d.loader,l=L.loader=this.loaders[S]=new a(d);this.decrypturl=b,this.decryptkey=null;var u={url:b,frag:L,responseType:"arraybuffer"},C={timeout:d.fragLoadingTimeOut,maxRetry:0,retryDelay:d.fragLoadingRetryDelay,maxRetryDelay:d.fragLoadingMaxRetryTimeout,highWaterMark:0},g={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};l.load(u,C,g)}else this.decryptkey&&(L.decryptdata.key=this.decryptkey,this.hls.trigger(W.Events.KEY_LOADED,{frag:L}))},O.loadsuccess=function(h,v,L){var S=L.frag;if(!S.decryptdata){M.logger.error("after key load, decryptdata unset");return}this.decryptkey=S.decryptdata.key=new Uint8Array(h.data),S.loader=null,delete this.loaders[S.type],this.hls.trigger(W.Events.KEY_LOADED,{frag:S})},O.loaderror=function(h,v){var L=v.frag,S=L.loader;S&&S.abort(),delete this.loaders[L.type],this.hls.trigger(W.Events.ERROR,{type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:L,response:h})},O.loadtimeout=function(h,v){var L=v.frag,S=L.loader;S&&S.abort(),delete this.loaders[L.type],this.hls.trigger(W.Events.ERROR,{type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:L})},k}()},"./src/loader/level-details.ts":function(Z,H,w){"use strict";w.r(H),w.d(H,"LevelDetails",function(){return k});var W=w("./src/polyfills/number.ts");function P(O,R){for(var h=0;h<R.length;h++){var v=R[h];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(O,v.key,v)}}function M(O,R,h){return R&&P(O.prototype,R),h&&P(O,h),O}var N=10,k=function(){function O(h){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=h}var R=O.prototype;return R.reloaded=function(v){if(!v){this.advanced=!0,this.updated=!0;return}var L=this.lastPartSn-v.lastPartSn,S=this.lastPartIndex-v.lastPartIndex;this.updated=this.endSN!==v.endSN||!!S||!!L,this.advanced=this.endSN>v.endSN||L>0||L===0&&S>0,this.updated||this.advanced?this.misses=Math.floor(v.misses*.6):this.misses=v.misses+1,this.availabilityDelay=v.availabilityDelay},M(O,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(W.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||N}},{key:"drift",get:function(){var v=this.driftEndTime-this.driftStartTime;if(v>0){var L=this.driftEnd-this.driftStart;return L*1e3/v}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var v;return(v=this.partList)!==null&&v!==void 0&&v.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var v;return(v=this.fragments)!==null&&v!==void 0&&v.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 v;return(v=this.partList)!==null&&v!==void 0&&v.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var v;return(v=this.partList)!==null&&v!==void 0&&v.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),O}()},"./src/loader/level-key.ts":function(Z,H,w){"use strict";w.r(H),w.d(H,"LevelKey",function(){return k});var W=w("./node_modules/url-toolkit/src/url-toolkit.js"),P=w.n(W);function M(O,R){for(var h=0;h<R.length;h++){var v=R[h];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(O,v.key,v)}}function N(O,R,h){return R&&M(O.prototype,R),h&&M(O,h),O}var k=function(){O.fromURL=function(h,v){return new O(h,v)},O.fromURI=function(h){return new O(h)};function O(R,h){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,h?this._uri=Object(W.buildAbsoluteURL)(R,h,{alwaysNormalize:!0}):this._uri=R}return N(O,[{key:"uri",get:function(){return this._uri}}]),O}()},"./src/loader/load-stats.ts":function(Z,H,w){"use strict";w.r(H),w.d(H,"LoadStats",function(){return W});var W=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(Z,H,w){"use strict";w.r(H),w.d(H,"default",function(){return l});var W=w("./src/polyfills/number.ts"),P=w("./node_modules/url-toolkit/src/url-toolkit.js"),M=w.n(P),N=w("./src/loader/fragment.ts"),k=w("./src/loader/level-details.ts"),O=w("./src/loader/level-key.ts"),R=w("./src/utils/attr-list.ts"),h=w("./src/utils/logger.ts"),v=w("./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,S=/#EXT-X-MEDIA:(.*)/g,E=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),b=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 a(D){var A,f;return d.test((A=(f=P.parseURL(D))===null||f===void 0?void 0:f.path)!=null?A:"")}var l=function(){function D(){}return D.findGroup=function(f,c){for(var s=0;s<f.length;s++){var o=f[s];if(o.id===c)return o}},D.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},D.resolve=function(f,c){return P.buildAbsoluteURL(c,f,{alwaysNormalize:!0})},D.parseMasterPlaylist=function(f,c){var s=[],o={},x=!1;L.lastIndex=0;for(var y;(y=L.exec(f))!=null;)if(y[1]){var p=new R.AttrList(y[1]),I={attrs:p,bitrate:p.decimalInteger("AVERAGE-BANDWIDTH")||p.decimalInteger("BANDWIDTH"),name:p.NAME,url:D.resolve(y[2],c)},B=p.decimalResolution("RESOLUTION");B&&(I.width=B.width,I.height=B.height),u((p.CODECS||"").split(/[ ,]+/).filter(function(Q){return Q}),I),I.videoCodec&&I.videoCodec.indexOf("avc1")!==-1&&(I.videoCodec=D.convertAVC1ToAVCOTI(I.videoCodec)),s.push(I)}else if(y[3]){var F=new R.AttrList(y[3]);F["DATA-ID"]&&(x=!0,o[F["DATA-ID"]]=F)}return{levels:s,sessionData:x?o:null}},D.parseMasterPlaylistMedia=function(f,c,s,o){o===void 0&&(o=[]);var x,y=[],p=0;for(S.lastIndex=0;(x=S.exec(f))!==null;){var I=new R.AttrList(x[1]);if(I.TYPE===s){var B={attrs:I,bitrate:0,id:p++,groupId:I["GROUP-ID"],instreamId:I["INSTREAM-ID"],name:I.NAME||I.LANGUAGE||"",type:s,default:I.bool("DEFAULT"),autoselect:I.bool("AUTOSELECT"),forced:I.bool("FORCED"),lang:I.LANGUAGE,url:I.URI?D.resolve(I.URI,c):""};if(o.length){var F=D.findGroup(o,B.groupId)||o[0];C(B,F,"audioCodec"),C(B,F,"textCodec")}y.push(B)}}return y},D.parseLevelPlaylist=function(f,c,s,o,x){var y=new k.LevelDetails(c),p=y.fragments,I=null,B=0,F=0,Q=0,j=0,U=null,X=new N.Fragment(o,c),$,ne,ue,Te=-1,pe=!1;for(E.lastIndex=0,y.m3u8=f;($=E.exec(f))!==null;){pe&&(pe=!1,X=new N.Fragment(o,c),X.start=Q,X.sn=B,X.cc=j,X.level=s,I&&(X.initSegment=I,X.rawProgramDateTime=I.rawProgramDateTime));var de=$[1];if(de){X.duration=parseFloat(de);var ce=(" "+$[2]).slice(1);X.title=ce||null,X.tagList.push(ce?["INF",de,ce]:["INF",de])}else if($[3])Object(W.isFiniteNumber)(X.duration)&&(X.start=Q,ue&&(X.levelkey=ue),X.sn=B,X.level=s,X.cc=j,X.urlId=x,p.push(X),X.relurl=(" "+$[3]).slice(1),m(X,U),U=X,Q+=X.duration,B++,F=0,pe=!0);else if($[4]){var fe=(" "+$[4]).slice(1);U?X.setByteRange(fe,U):X.setByteRange(fe)}else if($[5])X.rawProgramDateTime=(" "+$[5]).slice(1),X.tagList.push(["PROGRAM-DATE-TIME",X.rawProgramDateTime]),Te===-1&&(Te=p.length);else{if($=$[0].match(b),!$){h.logger.warn("No matches on slow regex match for level playlist!");continue}for(ne=1;ne<$.length&&!(typeof $[ne]!="undefined");ne++);var te=(" "+$[ne]).slice(1),se=(" "+$[ne+1]).slice(1),Ee=$[ne+2]?(" "+$[ne+2]).slice(1):"";switch(te){case"PLAYLIST-TYPE":y.type=se.toUpperCase();break;case"MEDIA-SEQUENCE":B=y.startSN=parseInt(se);break;case"SKIP":{var ke=new R.AttrList(se),Le=ke.decimalInteger("SKIPPED-SEGMENTS");if(Object(W.isFiniteNumber)(Le)){y.skippedSegments=Le;for(var We=Le;We--;)p.unshift(null);B+=Le}var Xe=ke.enumeratedString("RECENTLY-REMOVED-DATERANGES");Xe&&(y.recentlyRemovedDateranges=Xe.split(" "));break}case"TARGETDURATION":y.targetduration=parseFloat(se);break;case"VERSION":y.version=parseInt(se);break;case"EXTM3U":break;case"ENDLIST":y.live=!1;break;case"#":(se||Ee)&&X.tagList.push(Ee?[se,Ee]:[se]);break;case"DIS":j++;case"GAP":X.tagList.push([te]);break;case"BITRATE":X.tagList.push([te,se]);break;case"DISCONTINUITY-SEQ":j=parseInt(se);break;case"KEY":{var we,Re=new R.AttrList(se),De=Re.enumeratedString("METHOD"),He=Re.URI,Ve=Re.hexadecimalInteger("IV"),Ce=Re.enumeratedString("KEYFORMATVERSIONS"),Me=Re.enumeratedString("KEYID"),qe=(we=Re.enumeratedString("KEYFORMAT"))!=null?we:"identity",tt=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(tt.indexOf(qe)>-1){h.logger.warn("Keyformat "+qe+" is not supported from the manifest");continue}else if(qe!=="identity")continue;De&&(ue=O.LevelKey.fromURL(c,He),He&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(De)>=0&&(ue.method=De,ue.keyFormat=qe,Me&&(ue.keyID=Me),Ce&&(ue.keyFormatVersions=Ce),ue.iv=Ve));break}case"START":{var Ke=new R.AttrList(se),Ne=Ke.decimalFloatingPoint("TIME-OFFSET");Object(W.isFiniteNumber)(Ne)&&(y.startTimeOffset=Ne);break}case"MAP":{var rt=new R.AttrList(se);X.relurl=rt.URI,rt.BYTERANGE&&X.setByteRange(rt.BYTERANGE),X.level=s,X.sn="initSegment",ue&&(X.levelkey=ue),X.initSegment=null,I=X,pe=!0;break}case"SERVER-CONTROL":{var Je=new R.AttrList(se);y.canBlockReload=Je.bool("CAN-BLOCK-RELOAD"),y.canSkipUntil=Je.optionalFloat("CAN-SKIP-UNTIL",0),y.canSkipDateRanges=y.canSkipUntil>0&&Je.bool("CAN-SKIP-DATERANGES"),y.partHoldBack=Je.optionalFloat("PART-HOLD-BACK",0),y.holdBack=Je.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Ze=new R.AttrList(se);y.partTarget=Ze.decimalFloatingPoint("PART-TARGET");break}case"PART":{var ye=y.partList;ye||(ye=y.partList=[]);var $e=F>0?ye[ye.length-1]:void 0,Ge=F++,ve=new N.Part(new R.AttrList(se),X,c,Ge,$e);ye.push(ve),X.duration+=ve.duration;break}case"PRELOAD-HINT":{var Ie=new R.AttrList(se);y.preloadHint=Ie;break}case"RENDITION-REPORT":{var le=new R.AttrList(se);y.renditionReports=y.renditionReports||[],y.renditionReports.push(le);break}default:h.logger.warn("line parsed but not handled: "+$);break}}}U&&!U.relurl?(p.pop(),Q-=U.duration,y.partList&&(y.fragmentHint=U)):y.partList&&(m(X,U),X.cc=j,y.fragmentHint=X);var ae=p.length,oe=p[0],Y=p[ae-1];if(Q+=y.skippedSegments*y.targetduration,Q>0&&ae&&Y){y.averagetargetduration=Q/ae;var J=Y.sn;y.endSN=J!=="initSegment"?J:0,oe&&(y.startCC=oe.cc,oe.initSegment||y.fragments.every(function(q){return q.relurl&&a(q.relurl)})&&(h.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),X=new N.Fragment(o,c),X.relurl=Y.relurl,X.level=s,X.sn="initSegment",oe.initSegment=X,y.needSidxRanges=!0))}else y.endSN=0,y.startCC=0;return y.fragmentHint&&(Q+=y.fragmentHint.duration),y.totalduration=Q,y.endCC=j,Te>0&&g(p,Te),y},D}();function u(D,A){["video","audio","text"].forEach(function(f){var c=D.filter(function(o){return Object(v.isCodecType)(o,f)});if(c.length){var s=c.filter(function(o){return o.lastIndexOf("avc1",0)===0||o.lastIndexOf("mp4a",0)===0});A[f+"Codec"]=s.length>0?s[0]:c[0],D=D.filter(function(o){return c.indexOf(o)===-1})}}),A.unknownCodecs=D}function C(D,A,f){var c=A[f];c&&(D[f]=c)}function g(D,A){for(var f=D[A],c=A;c--;){var s=D[c];if(!s)return;s.programDateTime=f.programDateTime-s.duration*1e3,f=s}}function m(D,A){D.rawProgramDateTime?D.programDateTime=Date.parse(D.rawProgramDateTime):A!=null&&A.programDateTime&&(D.programDateTime=A.endProgramDateTime),Object(W.isFiniteNumber)(D.programDateTime)||(D.programDateTime=null,D.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(Z,H,w){"use strict";w.r(H);var W=w("./src/polyfills/number.ts"),P=w("./src/events.ts"),M=w("./src/errors.ts"),N=w("./src/utils/logger.ts"),k=w("./src/utils/mp4-tools.ts"),O=w("./src/loader/m3u8-parser.ts"),R=w("./src/types/loader.ts"),h=w("./src/utils/attr-list.ts");function v(E){var b=E.type;switch(b){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(E,b){var d=E.url;return(d===void 0||d.indexOf("data:")===0)&&(d=b.url),d}var S=function(){function E(d){this.hls=void 0,this.loaders=Object.create(null),this.hls=d,this.registerListeners()}var b=E.prototype;return b.registerListeners=function(){var a=this.hls;a.on(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.on(P.Events.LEVEL_LOADING,this.onLevelLoading,this),a.on(P.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),a.on(P.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},b.unregisterListeners=function(){var a=this.hls;a.off(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.off(P.Events.LEVEL_LOADING,this.onLevelLoading,this),a.off(P.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),a.off(P.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},b.createInternalLoader=function(a){var l=this.hls.config,u=l.pLoader,C=l.loader,g=u||C,m=new g(l);return a.loader=m,this.loaders[a.type]=m,m},b.getInternalLoader=function(a){return this.loaders[a.type]},b.resetInternalLoader=function(a){this.loaders[a]&&delete this.loaders[a]},b.destroyInternalLoaders=function(){for(var a in this.loaders){var l=this.loaders[a];l&&l.destroy(),this.resetInternalLoader(a)}},b.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},b.onManifestLoading=function(a,l){var u=l.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:R.PlaylistContextType.MANIFEST,url:u,deliveryDirectives:null})},b.onLevelLoading=function(a,l){var u=l.id,C=l.level,g=l.url,m=l.deliveryDirectives;this.load({id:u,groupId:null,level:C,responseType:"text",type:R.PlaylistContextType.LEVEL,url:g,deliveryDirectives:m})},b.onAudioTrackLoading=function(a,l){var u=l.id,C=l.groupId,g=l.url,m=l.deliveryDirectives;this.load({id:u,groupId:C,level:null,responseType:"text",type:R.PlaylistContextType.AUDIO_TRACK,url:g,deliveryDirectives:m})},b.onSubtitleTrackLoading=function(a,l){var u=l.id,C=l.groupId,g=l.url,m=l.deliveryDirectives;this.load({id:u,groupId:C,level:null,responseType:"text",type:R.PlaylistContextType.SUBTITLE_TRACK,url:g,deliveryDirectives:m})},b.load=function(a){var l,u=this.hls.config,C=this.getInternalLoader(a);if(C){var g=C.context;if(g&&g.url===a.url){N.logger.trace("[playlist-loader]: playlist request ongoing");return}N.logger.log("[playlist-loader]: aborting previous loader for type: "+a.type),C.abort()}var m,D,A,f;switch(a.type){case R.PlaylistContextType.MANIFEST:m=u.manifestLoadingMaxRetry,D=u.manifestLoadingTimeOut,A=u.manifestLoadingRetryDelay,f=u.manifestLoadingMaxRetryTimeout;break;case R.PlaylistContextType.LEVEL:case R.PlaylistContextType.AUDIO_TRACK:case R.PlaylistContextType.SUBTITLE_TRACK:m=0,D=u.levelLoadingTimeOut;break;default:m=u.levelLoadingMaxRetry,D=u.levelLoadingTimeOut,A=u.levelLoadingRetryDelay,f=u.levelLoadingMaxRetryTimeout;break}if(C=this.createInternalLoader(a),(l=a.deliveryDirectives)!==null&&l!==void 0&&l.part){var c;if(a.type===R.PlaylistContextType.LEVEL&&a.level!==null?c=this.hls.levels[a.level].details:a.type===R.PlaylistContextType.AUDIO_TRACK&&a.id!==null?c=this.hls.audioTracks[a.id].details:a.type===R.PlaylistContextType.SUBTITLE_TRACK&&a.id!==null&&(c=this.hls.subtitleTracks[a.id].details),c){var s=c.partTarget,o=c.targetduration;s&&o&&(D=Math.min(Math.max(s*3,o*.8)*1e3,D))}}var x={timeout:D,maxRetry:m,retryDelay:A,maxRetryDelay:f,highWaterMark:0},y={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};C.load(a,x,y)},b.loadsuccess=function(a,l,u,C){if(C===void 0&&(C=null),u.isSidxRequest){this.handleSidxRequest(a,u),this.handlePlaylistLoaded(a,l,u,C);return}this.resetInternalLoader(u.type);var g=a.data;if(g.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(a,u,"no EXTM3U delimiter",C);return}l.parsing.start=performance.now(),g.indexOf("#EXTINF:")>0||g.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(a,l,u,C):this.handleMasterPlaylist(a,l,u,C)},b.loaderror=function(a,l,u){u===void 0&&(u=null),this.handleNetworkError(l,u,!1,a)},b.loadtimeout=function(a,l,u){u===void 0&&(u=null),this.handleNetworkError(l,u,!0)},b.handleMasterPlaylist=function(a,l,u,C){var g=this.hls,m=a.data,D=L(a,u),A=O.default.parseMasterPlaylist(m,D),f=A.levels,c=A.sessionData;if(!f.length){this.handleManifestParsingError(a,u,"no level found in manifest",C);return}var s=f.map(function(B){return{id:B.attrs.AUDIO,audioCodec:B.audioCodec}}),o=f.map(function(B){return{id:B.attrs.SUBTITLES,textCodec:B.textCodec}}),x=O.default.parseMasterPlaylistMedia(m,D,"AUDIO",s),y=O.default.parseMasterPlaylistMedia(m,D,"SUBTITLES",o),p=O.default.parseMasterPlaylistMedia(m,D,"CLOSED-CAPTIONS");if(x.length){var I=x.some(function(B){return!B.url});!I&&f[0].audioCodec&&!f[0].attrs.AUDIO&&(N.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),x.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new h.AttrList({}),bitrate:0,url:""}))}g.trigger(P.Events.MANIFEST_LOADED,{levels:f,audioTracks:x,subtitles:y,captions:p,url:D,stats:l,networkDetails:C,sessionData:c})},b.handleTrackOrLevelPlaylist=function(a,l,u,C){var g=this.hls,m=u.id,D=u.level,A=u.type,f=L(a,u),c=Object(W.isFiniteNumber)(m)?m:0,s=Object(W.isFiniteNumber)(D)?D:c,o=v(u),x=O.default.parseLevelPlaylist(a.data,f,s,o,c);if(!x.fragments.length){g.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(A===R.PlaylistContextType.MANIFEST){var y={attrs:new h.AttrList({}),bitrate:0,details:x,name:"",url:f};g.trigger(P.Events.MANIFEST_LOADED,{levels:[y],audioTracks:[],url:f,stats:l,networkDetails:C,sessionData:null})}if(l.parsing.end=performance.now(),x.needSidxRanges){var p,I=(p=x.fragments[0].initSegment)===null||p===void 0?void 0:p.url;this.load({url:I,isSidxRequest:!0,type:A,level:D,levelDetails:x,id:m,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}u.levelDetails=x,this.handlePlaylistLoaded(a,l,u,C)},b.handleSidxRequest=function(a,l){var u=Object(k.parseSegmentIndex)(new Uint8Array(a.data));if(!u)return;var C=u.references,g=l.levelDetails;C.forEach(function(m,D){var A=m.info,f=g.fragments[D];f.byteRange.length===0&&f.setByteRange(String(1+A.end-A.start)+"@"+String(A.start)),f.initSegment&&f.initSegment.setByteRange(String(u.moovEndOffset)+"@0")})},b.handleManifestParsingError=function(a,l,u,C){this.hls.trigger(P.Events.ERROR,{type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:l.type===R.PlaylistContextType.MANIFEST,url:a.url,reason:u,response:a,context:l,networkDetails:C})},b.handleNetworkError=function(a,l,u,C){u===void 0&&(u=!1),N.logger.warn("[playlist-loader]: A network "+(u?"timeout":"error")+" occurred while loading "+a.type+" level: "+a.level+" id: "+a.id+' group-id: "'+a.groupId+'"');var g=M.ErrorDetails.UNKNOWN,m=!1,D=this.getInternalLoader(a);switch(a.type){case R.PlaylistContextType.MANIFEST:g=u?M.ErrorDetails.MANIFEST_LOAD_TIMEOUT:M.ErrorDetails.MANIFEST_LOAD_ERROR,m=!0;break;case R.PlaylistContextType.LEVEL:g=u?M.ErrorDetails.LEVEL_LOAD_TIMEOUT:M.ErrorDetails.LEVEL_LOAD_ERROR,m=!1;break;case R.PlaylistContextType.AUDIO_TRACK:g=u?M.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:M.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,m=!1;break;case R.PlaylistContextType.SUBTITLE_TRACK:g=u?M.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:M.ErrorDetails.SUBTITLE_LOAD_ERROR,m=!1;break}D&&this.resetInternalLoader(a.type);var A={type:M.ErrorTypes.NETWORK_ERROR,details:g,fatal:m,url:a.url,loader:D,context:a,networkDetails:l};C&&(A.response=C),this.hls.trigger(P.Events.ERROR,A)},b.handlePlaylistLoaded=function(a,l,u,C){var g=u.type,m=u.level,D=u.id,A=u.groupId,f=u.loader,c=u.levelDetails,s=u.deliveryDirectives;if(!(c!=null&&c.targetduration)){this.handleManifestParsingError(a,u,"invalid target duration",C);return}if(!f)return;c.live&&(f.getCacheAge&&(c.ageHeader=f.getCacheAge()||0),(!f.getCacheAge||isNaN(c.ageHeader))&&(c.ageHeader=0));switch(g){case R.PlaylistContextType.MANIFEST:case R.PlaylistContextType.LEVEL:this.hls.trigger(P.Events.LEVEL_LOADED,{details:c,level:m||0,id:D||0,stats:l,networkDetails:C,deliveryDirectives:s});break;case R.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(P.Events.AUDIO_TRACK_LOADED,{details:c,id:D||0,groupId:A||"",stats:l,networkDetails:C,deliveryDirectives:s});break;case R.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(P.Events.SUBTITLE_TRACK_LOADED,{details:c,id:D||0,groupId:A||"",stats:l,networkDetails:C,deliveryDirectives:s});break}},E}();H.default=S},"./src/polyfills/number.ts":function(Z,H,w){"use strict";w.r(H),w.d(H,"isFiniteNumber",function(){return W}),w.d(H,"MAX_SAFE_INTEGER",function(){return P});var W=Number.isFinite||function(M){return typeof M=="number"&&isFinite(M)},P=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(Z,H,w){"use strict";w.r(H);var W=function(){function P(){}return P.getSilentFrame=function(N,k){switch(N){case"mp4a.40.2":if(k===1)return new Uint8Array([0,200,0,128,35,128]);if(k===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(k===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(k===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(k===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(k===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(k===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(k===2)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(k===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);break}return},P}();H.default=W},"./src/remux/mp4-generator.ts":function(Z,H,w){"use strict";w.r(H);var W=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 k;for(k in M.types)M.types.hasOwnProperty(k)&&(M.types[k]=[k.charCodeAt(0),k.charCodeAt(1),k.charCodeAt(2),k.charCodeAt(3)]);var O=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:O,audio:R};var h=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),v=new Uint8Array([0,0,0,0,0,0,0,0]);M.STTS=M.STSC=M.STCO=v,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]),S=new Uint8Array([97,118,99,49]),E=new Uint8Array([0,0,0,1]);M.FTYP=M.box(M.types.ftyp,L,E,L,S),M.DINF=M.box(M.types.dinf,M.box(M.types.dref,h))},M.box=function(k){for(var O=8,R=arguments.length,h=new Array(R>1?R-1:0),v=1;v<R;v++)h[v-1]=arguments[v];for(var L=h.length,S=L;L--;)O+=h[L].byteLength;var E=new Uint8Array(O);for(E[0]=O>>24&255,E[1]=O>>16&255,E[2]=O>>8&255,E[3]=O&255,E.set(k,4),L=0,O=8;L<S;L++)E.set(h[L],O),O+=h[L].byteLength;return E},M.hdlr=function(k){return M.box(M.types.hdlr,M.HDLR_TYPES[k])},M.mdat=function(k){return M.box(M.types.mdat,k)},M.mdhd=function(k,O){O*=k;var R=Math.floor(O/(W+1)),h=Math.floor(O%(W+1));return M.box(M.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,k>>24&255,k>>16&255,k>>8&255,k&255,R>>24,R>>16&255,R>>8&255,R&255,h>>24,h>>16&255,h>>8&255,h&255,85,196,0,0]))},M.mdia=function(k){return M.box(M.types.mdia,M.mdhd(k.timescale,k.duration),M.hdlr(k.type),M.minf(k))},M.mfhd=function(k){return M.box(M.types.mfhd,new Uint8Array([0,0,0,0,k>>24,k>>16&255,k>>8&255,k&255]))},M.minf=function(k){return k.type==="audio"?M.box(M.types.minf,M.box(M.types.smhd,M.SMHD),M.DINF,M.stbl(k)):M.box(M.types.minf,M.box(M.types.vmhd,M.VMHD),M.DINF,M.stbl(k))},M.moof=function(k,O,R){return M.box(M.types.moof,M.mfhd(k),M.traf(R,O))},M.moov=function(k){for(var O=k.length,R=[];O--;)R[O]=M.trak(k[O]);return M.box.apply(null,[M.types.moov,M.mvhd(k[0].timescale,k[0].duration)].concat(R).concat(M.mvex(k)))},M.mvex=function(k){for(var O=k.length,R=[];O--;)R[O]=M.trex(k[O]);return M.box.apply(null,[M.types.mvex].concat(R))},M.mvhd=function(k,O){O*=k;var R=Math.floor(O/(W+1)),h=Math.floor(O%(W+1)),v=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,k>>24&255,k>>16&255,k>>8&255,k&255,R>>24,R>>16&255,R>>8&255,R&255,h>>24,h>>16&255,h>>8&255,h&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,v)},M.sdtp=function(k){var O=k.samples||[],R=new Uint8Array(4+O.length),h,v;for(h=0;h<O.length;h++)v=O[h].flags,R[h+4]=v.dependsOn<<4|v.isDependedOn<<2|v.hasRedundancy;return M.box(M.types.sdtp,R)},M.stbl=function(k){return M.box(M.types.stbl,M.stsd(k),M.box(M.types.stts,M.STTS),M.box(M.types.stsc,M.STSC),M.box(M.types.stsz,M.STSZ),M.box(M.types.stco,M.STCO))},M.avc1=function(k){var O=[],R=[],h,v,L;for(h=0;h<k.sps.length;h++)v=k.sps[h],L=v.byteLength,O.push(L>>>8&255),O.push(L&255),O=O.concat(Array.prototype.slice.call(v));for(h=0;h<k.pps.length;h++)v=k.pps[h],L=v.byteLength,R.push(L>>>8&255),R.push(L&255),R=R.concat(Array.prototype.slice.call(v));var S=M.box(M.types.avcC,new Uint8Array([1,O[3],O[4],O[5],252|3,224|k.sps.length].concat(O).concat([k.pps.length]).concat(R))),E=k.width,b=k.height,d=k.pixelRatio[0],a=k.pixelRatio[1];return M.box(M.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,E>>8&255,E&255,b>>8&255,b&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]),S,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,a>>24,a>>16&255,a>>8&255,a&255])))},M.esds=function(k){var O=k.config.length;return new Uint8Array([0,0,0,0,3,23+O,0,1,0,4,15+O,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([O]).concat(k.config).concat([6,1,2]))},M.mp4a=function(k){var O=k.samplerate;return M.box(M.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,k.channelCount,0,16,0,0,0,0,O>>8&255,O&255,0,0]),M.box(M.types.esds,M.esds(k)))},M.mp3=function(k){var O=k.samplerate;return M.box(M.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,k.channelCount,0,16,0,0,0,0,O>>8&255,O&255,0,0]))},M.stsd=function(k){return k.type==="audio"?!k.isAAC&&k.codec==="mp3"?M.box(M.types.stsd,M.STSD,M.mp3(k)):M.box(M.types.stsd,M.STSD,M.mp4a(k)):M.box(M.types.stsd,M.STSD,M.avc1(k))},M.tkhd=function(k){var O=k.id,R=k.duration*k.timescale,h=k.width,v=k.height,L=Math.floor(R/(W+1)),S=Math.floor(R%(W+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,O>>24&255,O>>16&255,O>>8&255,O&255,0,0,0,0,L>>24,L>>16&255,L>>8&255,L&255,S>>24,S>>16&255,S>>8&255,S&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,h>>8&255,h&255,0,0,v>>8&255,v&255,0,0]))},M.traf=function(k,O){var R=M.sdtp(k),h=k.id,v=Math.floor(O/(W+1)),L=Math.floor(O%(W+1));return M.box(M.types.traf,M.box(M.types.tfhd,new Uint8Array([0,0,0,0,h>>24,h>>16&255,h>>8&255,h&255])),M.box(M.types.tfdt,new Uint8Array([1,0,0,0,v>>24,v>>16&255,v>>8&255,v&255,L>>24,L>>16&255,L>>8&255,L&255])),M.trun(k,R.length+16+20+8+16+8+8),R)},M.trak=function(k){return k.duration=k.duration||4294967295,M.box(M.types.trak,M.tkhd(k),M.mdia(k))},M.trex=function(k){var O=k.id;return M.box(M.types.trex,new Uint8Array([0,0,0,0,O>>24,O>>16&255,O>>8&255,O&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},M.trun=function(k,O){var R=k.samples||[],h=R.length,v=12+16*h,L=new Uint8Array(v),S,E,b,d,a,l;for(O+=8+v,L.set([0,0,15,1,h>>>24&255,h>>>16&255,h>>>8&255,h&255,O>>>24&255,O>>>16&255,O>>>8&255,O&255],0),S=0;S<h;S++)E=R[S],b=E.duration,d=E.size,a=E.flags,l=E.cts,L.set([b>>>24&255,b>>>16&255,b>>>8&255,b&255,d>>>24&255,d>>>16&255,d>>>8&255,d&255,a.isLeading<<2|a.dependsOn,a.isDependedOn<<6|a.hasRedundancy<<4|a.paddingValue<<1|a.isNonSync,a.degradPrio&240<<8,a.degradPrio&15,l>>>24&255,l>>>16&255,l>>>8&255,l&255],12+16*S);return M.box(M.types.trun,L)},M.initSegment=function(k){M.types||M.init();var O=M.moov(k),R=new Uint8Array(M.FTYP.byteLength+O.byteLength);return R.set(M.FTYP),R.set(O,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,H.default=P},"./src/remux/mp4-remuxer.ts":function(Z,H,w){"use strict";w.r(H),w.d(H,"default",function(){return l}),w.d(H,"normalizePts",function(){return u});var W=w("./src/polyfills/number.ts"),P=w("./src/remux/aac-helper.ts"),M=w("./src/remux/mp4-generator.ts"),N=w("./src/events.ts"),k=w("./src/errors.ts"),O=w("./src/utils/logger.ts"),R=w("./src/types/loader.ts"),h=w("./src/utils/timescale-conversion.ts");function v(){return v=Object.assign||function(D){for(var A=1;A<arguments.length;A++){var f=arguments[A];for(var c in f)Object.prototype.hasOwnProperty.call(f,c)&&(D[c]=f[c])}return D},v.apply(this,arguments)}var L=10*1e3,S=1024,E=1152,b=null,d=null,a=!1,l=function(){function D(f,c,s,o){if(o===void 0&&(o=""),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,b===null){var x=navigator.userAgent||"",y=x.match(/Chrome\/(\d+)/i);b=y?parseInt(y[1]):0}if(d===null){var p=navigator.userAgent.match(/Safari\/(\d+)/i);d=p?parseInt(p[1]):0}a=!!b&&b<75||!!d&&d<600}var A=D.prototype;return A.destroy=function(){},A.resetTimeStamp=function(c){O.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=c},A.resetNextTimestamp=function(){O.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},A.resetInitSegment=function(){O.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},A.getVideoStartPts=function(c){var s=!1,o=c.reduce(function(x,y){var p=y.pts-x;return p<-4294967296?(s=!0,u(x,y.pts)):p>0?x:y.pts},c[0].pts);return s&&O.logger.debug("PTS rollover detected"),o},A.remux=function(c,s,o,x,y,p,I,B){var F,Q,j,U,X,$,ne=y,ue=y,Te=c.pid>-1,pe=s.pid>-1,de=s.samples.length,ce=c.samples.length>0,fe=de>1,te=(!Te||ce)&&(!pe||fe)||this.ISGenerated||I;if(te){this.ISGenerated||(j=this.generateIS(c,s,y));var se=this.isVideoContiguous,Ee=-1;if(fe&&(Ee=C(s.samples),!se&&this.config.forceKeyFrameOnDiscontinuity))if($=!0,Ee>0){O.logger.warn("[mp4-remuxer]: Dropped "+Ee+" out of "+de+" video samples due to a missing keyframe");var ke=this.getVideoStartPts(s.samples);s.samples=s.samples.slice(Ee),s.dropped+=Ee,ue+=(s.samples[0].pts-ke)/(s.timescale||9e4)}else Ee===-1&&(O.logger.warn("[mp4-remuxer]: No keyframe found out of "+de+" video samples"),$=!1);if(this.ISGenerated){if(ce&&fe){var Le=this.getVideoStartPts(s.samples),We=u(c.samples[0].pts,Le)-Le,Xe=We/s.inputTimeScale;ne+=Math.max(0,Xe),ue+=Math.max(0,-Xe)}if(ce){if(c.samplerate||(O.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),j=this.generateIS(c,s,y)),Q=this.remuxAudio(c,ne,this.isAudioContiguous,p,pe||fe||B===R.PlaylistLevelType.AUDIO?ue:void 0),fe){var we=Q?Q.endPTS-Q.startPTS:0;s.inputTimeScale||(O.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),j=this.generateIS(c,s,y)),F=this.remuxVideo(s,ue,se,we)}}else fe&&(F=this.remuxVideo(s,ue,se,0));F&&(F.firstKeyFrame=Ee,F.independent=Ee!==-1)}}return this.ISGenerated&&(o.samples.length&&(X=this.remuxID3(o,y)),x.samples.length&&(U=this.remuxText(x,y))),{audio:Q,video:F,initSegment:j,independent:$,text:U,id3:X}},A.generateIS=function(c,s,o){var x=c.samples,y=s.samples,p=this.typeSupported,I={},B=!Object(W.isFiniteNumber)(this._initPTS),F="audio/mp4",Q,j,U;if(B&&(Q=j=Infinity),c.config&&x.length&&(c.timescale=c.samplerate,c.isAAC||(p.mpeg?(F="audio/mpeg",c.codec=""):p.mp3&&(c.codec="mp3")),I.audio={id:"audio",container:F,codec:c.codec,initSegment:!c.isAAC&&p.mpeg?new Uint8Array(0):M.default.initSegment([c]),metadata:{channelCount:c.channelCount}},B&&(U=c.inputTimeScale,Q=j=x[0].pts-Math.round(U*o))),s.sps&&s.pps&&y.length&&(s.timescale=s.inputTimeScale,I.video={id:"main",container:"video/mp4",codec:s.codec,initSegment:M.default.initSegment([s]),metadata:{width:s.width,height:s.height}},B)){U=s.inputTimeScale;var X=this.getVideoStartPts(y),$=Math.round(U*o);j=Math.min(j,u(y[0].dts,X)-$),Q=Math.min(Q,X-$)}if(Object.keys(I).length)return this.ISGenerated=!0,B&&(this._initPTS=Q,this._initDTS=j),{tracks:I,initPTS:Q,timescale:U}},A.remuxVideo=function(c,s,o,x){var y=c.inputTimeScale,p=c.samples,I=[],B=p.length,F=this._initPTS,Q=this.nextAvcDts,j=8,U,X,$,ne=Number.POSITIVE_INFINITY,ue=Number.NEGATIVE_INFINITY,Te=0,pe=!1;if(!o||Q===null){var de=s*y,ce=p[0].pts-u(p[0].dts,p[0].pts);Q=de-ce}for(var fe=0;fe<B;fe++){var te=p[fe];if(te.pts=u(te.pts-F,Q),te.dts=u(te.dts-F,Q),te.dts>te.pts){var se=9e4*.2;Te=Math.max(Math.min(Te,te.pts-te.dts),-1*se)}te.dts<p[fe>0?fe-1:fe].dts&&(pe=!0)}pe&&p.sort(function(ht,ot){var it=ht.dts-ot.dts,Ot=ht.pts-ot.pts;return it||Ot}),X=p[0].dts,$=p[p.length-1].dts;var Ee=Math.round(($-X)/(B-1));if(Te<0){if(Te<Ee*-2){O.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(h.toMsFromMpegTsClock)(-Ee,!0)+" ms");for(var ke=Te,Le=0;Le<B;Le++)p[Le].dts=ke=Math.max(ke,p[Le].pts-Ee),p[Le].pts=Math.max(ke,p[Le].pts)}else{O.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(h.toMsFromMpegTsClock)(Te,!0)+" ms to overcome this issue");for(var We=0;We<B;We++)p[We].dts=p[We].dts+Te}X=p[0].dts}if(o){var Xe=X-Q,we=Xe>Ee,Re=Xe<-1;if(we||Re){we?O.logger.warn("AVC: "+Object(h.toMsFromMpegTsClock)(Xe,!0)+" ms ("+Xe+"dts) hole between fragments detected, filling it"):O.logger.warn("AVC: "+Object(h.toMsFromMpegTsClock)(-Xe,!0)+" ms ("+Xe+"dts) overlapping between fragments detected"),X=Q;var De=p[0].pts-Xe;p[0].dts=X,p[0].pts=De,O.logger.log("Video: First PTS/DTS adjusted: "+Object(h.toMsFromMpegTsClock)(De,!0)+"/"+Object(h.toMsFromMpegTsClock)(X,!0)+", delta: "+Object(h.toMsFromMpegTsClock)(Xe,!0)+" ms")}}a&&(X=Math.max(0,X));for(var He=0,Ve=0,Ce=0;Ce<B;Ce++){for(var Me=p[Ce],qe=Me.units,tt=qe.length,Ke=0,Ne=0;Ne<tt;Ne++)Ke+=qe[Ne].data.length;Ve+=Ke,He+=tt,Me.length=Ke,Me.dts=Math.max(Me.dts,X),Me.pts=Math.max(Me.pts,Me.dts,0),ne=Math.min(Me.pts,ne),ue=Math.max(Me.pts,ue)}$=p[B-1].dts;var rt=Ve+4*He+8,Je;try{Je=new Uint8Array(rt)}catch(ht){this.observer.emit(N.Events.ERROR,N.Events.ERROR,{type:k.ErrorTypes.MUX_ERROR,details:k.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:rt,reason:"fail allocating video mdat "+rt});return}var Ze=new DataView(Je.buffer);Ze.setUint32(0,rt),Je.set(M.default.types.mdat,4);for(var ye=0;ye<B;ye++){for(var $e=p[ye],Ge=$e.units,ve=0,Ie=0,le=Ge.length;Ie<le;Ie++){var ae=Ge[Ie],oe=ae.data,Y=ae.data.byteLength;Ze.setUint32(j,Y),j+=4,Je.set(oe,j),j+=Y,ve+=4+Y}if(ye<B-1)U=p[ye+1].dts-$e.dts;else{var J=this.config,q=$e.dts-p[ye>0?ye-1:ye].dts;if(J.stretchShortVideoTrack&&this.nextAudioPts!==null){var re=Math.floor(J.maxBufferHole*y),ge=(x?ne+x*y:this.nextAudioPts)-$e.pts;ge>re?(U=ge-q,U<0&&(U=q),O.logger.log("[mp4-remuxer]: It is approximately "+ge/90+" ms to the next segment; using duration "+U/90+" ms for the last video frame.")):U=q}else U=q}var Ae=Math.round($e.pts-$e.dts);I.push(new g($e.key,U,ve,Ae))}if(I.length&&b&&b<70){var Be=I[0].flags;Be.dependsOn=2,Be.isNonSync=0}console.assert(U!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=Q=$+U,this.isVideoContiguous=!0;var lt=M.default.moof(c.sequenceNumber++,X,v({},c,{samples:I})),Pe="video",Ye={data1:lt,data2:Je,startPTS:ne/y,endPTS:(ue+U)/y,startDTS:X/y,endDTS:Q/y,type:Pe,hasAudio:!1,hasVideo:!0,nb:I.length,dropped:c.dropped};return c.samples=[],c.dropped=0,console.assert(Je.length,"MDAT length must not be zero"),Ye},A.remuxAudio=function(c,s,o,x,y){var p=c.inputTimeScale,I=c.samplerate?c.samplerate:p,B=p/I,F=c.isAAC?S:E,Q=F*B,j=this._initPTS,U=!c.isAAC&&this.typeSupported.mpeg,X=[],$=c.samples,ne=U?0:8,ue=this.nextAudioPts||-1,Te=s*p;if(this.isAudioContiguous=o=o||$.length&&ue>0&&(x&&Math.abs(Te-ue)<9e3||Math.abs(u($[0].pts-j,Te)-ue)<20*Q),$.forEach(function(oe){oe.pts=u(oe.pts-j,Te)}),!o||ue<0){if($=$.filter(function(oe){return oe.pts>=0}),!$.length)return;y===0?ue=0:x?ue=Math.max(0,Te):ue=$[0].pts}if(c.isAAC)for(var pe=y!==void 0,de=this.config.maxAudioFramesDrift,ce=0,fe=ue;ce<$.length;ce++){var te=$[ce],se=te.pts,Ee=se-fe,ke=Math.abs(1e3*Ee/p);if(Ee<=-de*Q&&pe)ce===0&&(O.logger.warn("Audio frame @ "+(se/p).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*Ee/p)+" ms."),this.nextAudioPts=ue=fe=se);else if(Ee>=de*Q&&ke<L&&pe){var Le=Math.round(Ee/Q);fe=se-Le*Q,fe<0&&(Le--,fe+=Q),ce===0&&(this.nextAudioPts=ue=fe),O.logger.warn("[mp4-remuxer]: Injecting "+Le+" audio frame @ "+(fe/p).toFixed(3)+"s due to "+Math.round(1e3*Ee/p)+" ms gap.");for(var We=0;We<Le;We++){var Xe=Math.max(fe,0),we=P.default.getSilentFrame(c.manifestCodec||c.codec,c.channelCount);we||(O.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),we=te.unit.subarray()),$.splice(ce,0,{unit:we,pts:Xe}),fe+=Q,ce++}}te.pts=fe,fe+=Q}for(var Re=null,De=null,He,Ve=0,Ce=$.length;Ce--;)Ve+=$[Ce].unit.byteLength;for(var Me=0,qe=$.length;Me<qe;Me++){var tt=$[Me],Ke=tt.unit,Ne=tt.pts;if(De!==null){var rt=X[Me-1];rt.duration=Math.round((Ne-De)/B)}else if(o&&c.isAAC&&(Ne=ue),Re=Ne,Ve>0){Ve+=ne;try{He=new Uint8Array(Ve)}catch(oe){this.observer.emit(N.Events.ERROR,N.Events.ERROR,{type:k.ErrorTypes.MUX_ERROR,details:k.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Ve,reason:"fail allocating audio mdat "+Ve});return}if(!U){var Je=new DataView(He.buffer);Je.setUint32(0,Ve),He.set(M.default.types.mdat,4)}}else return;He.set(Ke,ne);var Ze=Ke.byteLength;ne+=Ze,X.push(new g(!0,F,Ze,0)),De=Ne}var ye=X.length;if(!ye)return;var $e=X[X.length-1];this.nextAudioPts=ue=De+B*$e.duration;var Ge=U?new Uint8Array(0):M.default.moof(c.sequenceNumber++,Re/B,v({},c,{samples:X}));c.samples=[];var ve=Re/p,Ie=ue/p,le="audio",ae={data1:Ge,data2:He,startPTS:ve,endPTS:Ie,startDTS:ve,endDTS:Ie,type:le,hasAudio:!0,hasVideo:!1,nb:ye};return this.isAudioContiguous=!0,console.assert(He.length,"MDAT length must not be zero"),ae},A.remuxEmptyAudio=function(c,s,o,x){var y=c.inputTimeScale,p=c.samplerate?c.samplerate:y,I=y/p,B=this.nextAudioPts,F=(B!==null?B:x.startDTS*y)+this._initDTS,Q=x.endDTS*y+this._initDTS,j=I*S,U=Math.ceil((Q-F)/j),X=P.default.getSilentFrame(c.manifestCodec||c.codec,c.channelCount);if(O.logger.warn("[mp4-remuxer]: remux empty Audio"),!X){O.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var $=[],ne=0;ne<U;ne++){var ue=F+ne*j;$.push({unit:X,pts:ue,dts:ue})}return c.samples=$,this.remuxAudio(c,s,o,!1)},A.remuxID3=function(c,s){var o=c.samples.length;if(!o)return;for(var x=c.inputTimeScale,y=this._initPTS,p=this._initDTS,I=0;I<o;I++){var B=c.samples[I];B.pts=u(B.pts-y,s*x)/x,B.dts=u(B.dts-p,s*x)/x}var F=c.samples;return c.samples=[],{samples:F}},A.remuxText=function(c,s){var o=c.samples.length;if(!o)return;for(var x=c.inputTimeScale,y=this._initPTS,p=0;p<o;p++){var I=c.samples[p];I.pts=u(I.pts-y,s*x)/x}c.samples.sort(function(F,Q){return F.pts-Q.pts});var B=c.samples;return c.samples=[],{samples:B}},D}();function u(D,A){var f;if(A===null)return D;for(A<D?f=-8589934592:f=8589934592;Math.abs(D-A)>4294967296;)D+=f;return D}function C(D){for(var A=0;A<D.length;A++)if(D[A].key)return A;return-1}var g=function(A,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 m(A)},m=function(A){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=A?2:1,this.isNonSync=A?0:1}},"./src/remux/passthrough-remuxer.ts":function(Z,H,w){"use strict";w.r(H);var W=w("./src/polyfills/number.ts"),P=w("./src/utils/mp4-tools.ts"),M=w("./src/loader/fragment.ts"),N=w("./src/utils/logger.ts"),k=function(){function h(){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 v=h.prototype;return v.destroy=function(){},v.resetTimeStamp=function(S){this.initPTS=S,this.lastEndDTS=null},v.resetNextTimestamp=function(){this.lastEndDTS=null},v.resetInitSegment=function(S,E,b){this.audioCodec=E,this.videoCodec=b,this.generateInitSegment(S),this.emitInitSegment=!0},v.generateInitSegment=function(S){var E=this.audioCodec,b=this.videoCodec;if(!S||!S.byteLength){this.initTracks=void 0,this.initData=void 0;return}var d=this.initData=Object(P.parseInitSegment)(S);E||(E=R(d.audio,M.ElementaryStreamTypes.AUDIO)),b||(b=R(d.video,M.ElementaryStreamTypes.VIDEO));var a={};d.audio&&d.video?a.audiovideo={container:"video/mp4",codec:E+","+b,initSegment:S,id:"main"}:d.audio?a.audio={container:"audio/mp4",codec:E,initSegment:S,id:"audio"}:d.video?a.video={container:"video/mp4",codec:b,initSegment:S,id:"main"}:N.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=a},v.remux=function(S,E,b,d,a){var l=this.initPTS,u=this.lastEndDTS,C={audio:void 0,video:void 0,text:d,id3:b,initSegment:void 0};Object(W.isFiniteNumber)(u)||(u=this.lastEndDTS=a||0);var g=E.samples;if(!g||!g.length)return C;var m={initPTS:void 0,timescale:1},D=this.initData;if((!D||!D.length)&&(this.generateInitSegment(g),D=this.initData),!D||!D.length)return N.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),C;this.emitInitSegment&&(m.tracks=this.initTracks,this.emitInitSegment=!1),Object(W.isFiniteNumber)(l)||(this.initPTS=m.initPTS=l=O(D,g,u));var A=Object(P.getDuration)(g,D),f=u,c=A+f;Object(P.offsetStartDTS)(D,g,l),A>0?this.lastEndDTS=c:(N.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var s=!!D.audio,o=!!D.video,x="";s&&(x+="audio"),o&&(x+="video");var y={data1:g,startPTS:f,startDTS:f,endPTS:c,endDTS:c,type:x,hasAudio:s,hasVideo:o,nb:1,dropped:0};return C.audio=y.type==="audio"?y:void 0,C.video=y.type!=="audio"?y:void 0,C.text=d,C.id3=b,C.initSegment=m,C},h}(),O=function(v,L,S){return Object(P.getStartDTS)(v,L)-S};function R(h,v){var L=h==null?void 0:h.codec;return L&&L.length>4?L:L==="hvc1"?"hvc1.1.c.L120.90":L==="av01"?"av01.0.04M.08":L==="avc1"||v===M.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}H.default=k},"./src/task-loop.ts":function(Z,H,w){"use strict";w.r(H),w.d(H,"default",function(){return W});var W=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(k){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,k),!0)},M.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},M.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},M.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},M.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},M.doTick=function(){},P}()},"./src/types/cmcd.ts":function(Z,H,w){"use strict";w.r(H),w.d(H,"CMCDVersion",function(){return W}),w.d(H,"CMCDObjectType",function(){return P}),w.d(H,"CMCDStreamingFormat",function(){return M}),w.d(H,"CMCDStreamType",function(){return N});var W=1,P;(function(k){k.MANIFEST="m",k.AUDIO="a",k.VIDEO="v",k.MUXED="av",k.INIT="i",k.CAPTION="c",k.TIMED_TEXT="tt",k.KEY="k",k.OTHER="o"})(P||(P={}));var M;(function(k){k.DASH="d",k.HLS="h",k.SMOOTH="s",k.OTHER="o"})(M||(M={}));var N;(function(k){k.VOD="v",k.LIVE="l"})(N||(N={}))},"./src/types/level.ts":function(Z,H,w){"use strict";w.r(H),w.d(H,"HlsSkip",function(){return M}),w.d(H,"getSkipValue",function(){return N}),w.d(H,"HlsUrlParameters",function(){return k}),w.d(H,"Level",function(){return O});function W(R,h){for(var v=0;v<h.length;v++){var L=h[v];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(R,L.key,L)}}function P(R,h,v){return h&&W(R.prototype,h),v&&W(R,v),R}var M;(function(R){R.No="",R.Yes="YES",R.v2="v2"})(M||(M={}));function N(R,h){var v=R.canSkipUntil,L=R.canSkipDateRanges,S=R.endSN,E=h!==void 0?h-S:0;return v&&E<v?L?M.v2:M.Yes:M.No}var k=function(){function R(v,L,S){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=v,this.part=L,this.skip=S}var h=R.prototype;return h.addDirectives=function(L){var S=new self.URL(L);return this.msn!==void 0&&S.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&S.searchParams.set("_HLS_part",this.part.toString()),this.skip&&S.searchParams.set("_HLS_skip",this.skip),S.toString()},R}(),O=function(){function R(h){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=[h.url],this.attrs=h.attrs,this.bitrate=h.bitrate,h.details&&(this.details=h.details),this.id=h.id||0,this.name=h.name,this.width=h.width||0,this.height=h.height||0,this.audioCodec=h.audioCodec,this.videoCodec=h.videoCodec,this.unknownCodecs=h.unknownCodecs,this.codecSet=[h.videoCodec,h.audioCodec].filter(function(v){return v}).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(v){var L=v%this.url.length;this._urlId!==L&&(this.details=void 0,this._urlId=L)}}]),R}()},"./src/types/loader.ts":function(Z,H,w){"use strict";w.r(H),w.d(H,"PlaylistContextType",function(){return W}),w.d(H,"PlaylistLevelType",function(){return P});var W;(function(M){M.MANIFEST="manifest",M.LEVEL="level",M.AUDIO_TRACK="audioTrack",M.SUBTITLE_TRACK="subtitleTrack"})(W||(W={}));var P;(function(M){M.MAIN="main",M.AUDIO="audio",M.SUBTITLE="subtitle"})(P||(P={}))},"./src/types/transmuxer.ts":function(Z,H,w){"use strict";w.r(H),w.d(H,"ChunkMetadata",function(){return W});var W=function(N,k,O,R,h,v){R===void 0&&(R=0),h===void 0&&(h=-1),v===void 0&&(v=!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=N,this.sn=k,this.id=O,this.size=R,this.part=h,this.partial=v};function P(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(Z,H,w){"use strict";w.r(H),w.d(H,"AttrList",function(){return M});var W=/^(\d+)x(\d+)$/,P=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,M=function(){function N(O){typeof O=="string"&&(O=N.parseAttrList(O));for(var R in O)O.hasOwnProperty(R)&&(this[R]=O[R])}var k=N.prototype;return k.decimalInteger=function(R){var h=parseInt(this[R],10);return h>Number.MAX_SAFE_INTEGER?Infinity:h},k.hexadecimalInteger=function(R){if(this[R]){var h=(this[R]||"0x").slice(2);h=(h.length&1?"0":"")+h;for(var v=new Uint8Array(h.length/2),L=0;L<h.length/2;L++)v[L]=parseInt(h.slice(L*2,L*2+2),16);return v}else return null},k.hexadecimalIntegerAsNumber=function(R){var h=parseInt(this[R],16);return h>Number.MAX_SAFE_INTEGER?Infinity:h},k.decimalFloatingPoint=function(R){return parseFloat(this[R])},k.optionalFloat=function(R,h){var v=this[R];return v?parseFloat(v):h},k.enumeratedString=function(R){return this[R]},k.bool=function(R){return this[R]==="YES"},k.decimalResolution=function(R){var h=W.exec(this[R]);return h===null?void 0:{width:parseInt(h[1],10),height:parseInt(h[2],10)}},N.parseAttrList=function(R){var h,v={},L='"';for(P.lastIndex=0;(h=P.exec(R))!==null;){var S=h[2];S.indexOf(L)===0&&S.lastIndexOf(L)===S.length-1&&(S=S.slice(1,-1)),v[h[1]]=S}return v},N}()},"./src/utils/binary-search.ts":function(Z,H,w){"use strict";w.r(H);var W={search:function(M,N){for(var k=0,O=M.length-1,R=null,h=null;k<=O;){R=(k+O)/2|0,h=M[R];var v=N(h);if(v>0)k=R+1;else if(v<0)O=R-1;else return h}return null}};H.default=W},"./src/utils/buffer-helper.ts":function(Z,H,w){"use strict";w.r(H),w.d(H,"BufferHelper",function(){return M});var W=w("./src/utils/logger.ts"),P={length:0,start:function(){return 0},end:function(){return 0}},M=function(){function N(){}return N.isBuffered=function(O,R){try{if(O){for(var h=N.getBuffered(O),v=0;v<h.length;v++)if(R>=h.start(v)&&R<=h.end(v))return!0}}catch(L){}return!1},N.bufferInfo=function(O,R,h){try{if(O){var v=N.getBuffered(O),L=[],S;for(S=0;S<v.length;S++)L.push({start:v.start(S),end:v.end(S)});return this.bufferedInfo(L,R,h)}}catch(E){}return{len:0,start:R,end:R,nextStart:void 0}},N.bufferedInfo=function(O,R,h){R=Math.max(0,R),O.sort(function(m,D){var A=m.start-D.start;return A||D.end-m.end});var v=[];if(h)for(var L=0;L<O.length;L++){var S=v.length;if(S){var E=v[S-1].end;O[L].start-E<h?O[L].end>E&&(v[S-1].end=O[L].end):v.push(O[L])}else v.push(O[L])}else v=O;for(var b=0,d,a=R,l=R,u=0;u<v.length;u++){var C=v[u].start,g=v[u].end;if(R+h>=C&&R<g)a=C,l=g,b=l-R;else if(R+h<C){d=C;break}}return{len:b,start:a||0,end:l||0,nextStart:d}},N.getBuffered=function(O){try{return O.buffered}catch(R){return W.logger.log("failed to get media.buffered",R),P}},N}()},"./src/utils/cea-608-parser.ts":function(Z,H,w){"use strict";w.r(H),w.d(H,"Row",function(){return l}),w.d(H,"CaptionScreen",function(){return u});var W=w("./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)},N=15,k=100,O={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},h={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},v={25:2,26:4,29:6,30:8,31:10,27:13,28:15},L=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],S;(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"})(S||(S={}));var E=function(){function f(){this.time=null,this.verboseLevel=S.ERROR}var c=f.prototype;return c.log=function(o,x){this.verboseLevel>=o&&W.logger.log(this.time+" ["+o+"] "+x)},f}(),b=function(c){for(var s=[],o=0;o<c.length;o++)s.push(c[o].toString(16));return s},d=function(){function f(s,o,x,y,p){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=o||!1,this.italics=x||!1,this.background=y||"black",this.flash=p||!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(o){for(var x=["foreground","underline","italics","background","flash"],y=0;y<x.length;y++){var p=x[y];o.hasOwnProperty(p)&&(this[p]=o[p])}},c.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},c.equals=function(o){return this.foreground===o.foreground&&this.underline===o.underline&&this.italics===o.italics&&this.background===o.background&&this.flash===o.flash},c.copy=function(o){this.foreground=o.foreground,this.underline=o.underline,this.italics=o.italics,this.background=o.background,this.flash=o.flash},c.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},f}(),a=function(){function f(s,o,x,y,p,I){this.uchar=void 0,this.penState=void 0,this.uchar=s||" ",this.penState=new d(o,x,y,p,I)}var c=f.prototype;return c.reset=function(){this.uchar=" ",this.penState.reset()},c.setChar=function(o,x){this.uchar=o,this.penState.copy(x)},c.setPenState=function(o){this.penState.copy(o)},c.equals=function(o){return this.uchar===o.uchar&&this.penState.equals(o.penState)},c.copy=function(o){this.uchar=o.uchar,this.penState.copy(o.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 o=0;o<k;o++)this.chars.push(new a);this.logger=s,this.pos=0,this.currPenState=new d}var c=f.prototype;return c.equals=function(o){for(var x=!0,y=0;y<k;y++)if(!this.chars[y].equals(o.chars[y])){x=!1;break}return x},c.copy=function(o){for(var x=0;x<k;x++)this.chars[x].copy(o.chars[x])},c.isEmpty=function(){for(var o=!0,x=0;x<k;x++)if(!this.chars[x].isEmpty()){o=!1;break}return o},c.setCursor=function(o){this.pos!==o&&(this.pos=o),this.pos<0?(this.logger.log(S.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>k&&(this.logger.log(S.DEBUG,"Too large cursor position "+this.pos),this.pos=k)},c.moveCursor=function(o){var x=this.pos+o;if(o>1)for(var y=this.pos+1;y<x+1;y++)this.chars[y].setPenState(this.currPenState);this.setCursor(x)},c.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},c.insertChar=function(o){o>=144&&this.backSpace();var x=M(o);if(this.pos>=k){this.logger.log(S.ERROR,"Cannot insert "+o.toString(16)+" ("+x+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(x,this.currPenState),this.moveCursor(1)},c.clearFromPos=function(o){var x;for(x=o;x<k;x++)this.chars[x].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 o=[],x=!0,y=0;y<k;y++){var p=this.chars[y].uchar;p!==" "&&(x=!1),o.push(p)}return x?"":o.join("")},c.setPenStyles=function(o){this.currPenState.setStyles(o);var x=this.chars[this.pos];x.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 o=0;o<N;o++)this.rows.push(new l(s));this.logger=s,this.currRow=N-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var c=f.prototype;return c.reset=function(){for(var o=0;o<N;o++)this.rows[o].clear();this.currRow=N-1},c.equals=function(o){for(var x=!0,y=0;y<N;y++)if(!this.rows[y].equals(o.rows[y])){x=!1;break}return x},c.copy=function(o){for(var x=0;x<N;x++)this.rows[x].copy(o.rows[x])},c.isEmpty=function(){for(var o=!0,x=0;x<N;x++)if(!this.rows[x].isEmpty()){o=!1;break}return o},c.backSpace=function(){var o=this.rows[this.currRow];o.backSpace()},c.clearToEndOfRow=function(){var o=this.rows[this.currRow];o.clearToEndOfRow()},c.insertChar=function(o){var x=this.rows[this.currRow];x.insertChar(o)},c.setPen=function(o){var x=this.rows[this.currRow];x.setPenStyles(o)},c.moveCursor=function(o){var x=this.rows[this.currRow];x.moveCursor(o)},c.setCursor=function(o){this.logger.log(S.INFO,"setCursor: "+o);var x=this.rows[this.currRow];x.setCursor(o)},c.setPAC=function(o){this.logger.log(S.INFO,"pacData = "+JSON.stringify(o));var x=o.row-1;if(this.nrRollUpRows&&x<this.nrRollUpRows-1&&(x=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==x){for(var y=0;y<N;y++)this.rows[y].clear();var p=this.currRow+1-this.nrRollUpRows,I=this.lastOutputScreen;if(I){var B=I.rows[p].cueStartTime,F=this.logger.time;if(B&&F!==null&&B<F)for(var Q=0;Q<this.nrRollUpRows;Q++)this.rows[x-this.nrRollUpRows+Q+1].copy(I.rows[p+Q])}}this.currRow=x;var j=this.rows[this.currRow];if(o.indent!==null){var U=o.indent,X=Math.max(U-1,0);j.setCursor(o.indent),o.color=j.chars[X].penState.foreground}var $={foreground:o.color,underline:o.underline,italics:o.italics,background:"black",flash:!1};this.setPen($)},c.setBkgData=function(o){this.logger.log(S.INFO,"bkgData = "+JSON.stringify(o)),this.backSpace(),this.setPen(o),this.insertChar(32)},c.setRollUpRows=function(o){this.nrRollUpRows=o},c.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(S.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(S.TEXT,this.getDisplayText());var o=this.currRow+1-this.nrRollUpRows,x=this.rows.splice(o,1)[0];x.clear(),this.rows.splice(this.currRow,0,x),this.logger.log(S.INFO,"Rolling up")},c.getDisplayText=function(o){o=o||!1;for(var x=[],y="",p=-1,I=0;I<N;I++){var B=this.rows[I].getTextString();B&&(p=I+1,o?x.push("Row "+p+": '"+B+"'"):x.push(B.trim()))}return x.length>0&&(o?y="["+x.join(" | ")+"]":y=x.join(`
`)),y},c.getTextAndFormat=function(){return this.rows},f}(),C=function(){function f(s,o,x){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=o,this.mode=null,this.verbose=0,this.displayedMemory=new u(x),this.nonDisplayedMemory=new u(x),this.lastOutputScreen=new u(x),this.currRollUpRow=this.displayedMemory.rows[N-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=x}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[N-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},c.getHandler=function(){return this.outputFilter},c.setHandler=function(o){this.outputFilter=o},c.setPAC=function(o){this.writeScreen.setPAC(o)},c.setBkgData=function(o){this.writeScreen.setBkgData(o)},c.setMode=function(o){if(o===this.mode)return;this.mode=o,this.logger.log(S.INFO,"MODE="+o),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=o},c.insertChars=function(o){for(var x=0;x<o.length;x++)this.writeScreen.insertChar(o[x]);var y=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(S.INFO,y+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(S.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},c.ccRCL=function(){this.logger.log(S.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},c.ccBS=function(){if(this.logger.log(S.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(S.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},c.ccRU=function(o){this.logger.log(S.INFO,"RU("+o+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(o)},c.ccFON=function(){this.logger.log(S.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},c.ccRDC=function(){this.logger.log(S.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},c.ccTR=function(){this.logger.log(S.INFO,"TR"),this.setMode("MODE_TEXT")},c.ccRTD=function(){this.logger.log(S.INFO,"RTD"),this.setMode("MODE_TEXT")},c.ccEDM=function(){this.logger.log(S.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},c.ccCR=function(){this.logger.log(S.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},c.ccENM=function(){this.logger.log(S.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},c.ccEOC=function(){if(this.logger.log(S.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var o=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=o,this.writeScreen=this.nonDisplayedMemory,this.logger.log(S.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},c.ccTO=function(o){this.logger.log(S.INFO,"TO("+o+") - Tab Offset"),this.writeScreen.moveCursor(o)},c.ccMIDROW=function(o){var x={flash:!1};if(x.underline=o%2===1,x.italics=o>=46,x.italics)x.foreground="white";else{var y=Math.floor(o/2)-16,p=["white","green","blue","cyan","red","yellow","magenta"];x.foreground=p[y]}this.logger.log(S.INFO,"MIDROW: "+JSON.stringify(x)),this.writeScreen.setPen(x)},c.outputDataUpdate=function(o){o===void 0&&(o=!1);var x=this.logger.time;if(x===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=x:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,x,this.lastOutputScreen),o&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:x),this.lastOutputScreen.copy(this.displayedMemory))},c.cueSplitAtTime=function(o){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,o,this.displayedMemory),this.cueStartTime=o))},f}(),g=function(){function f(s,o,x){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var y=new E;this.channels=[null,new C(s,o,y),new C(s+1,x,y)],this.cmdHistory=A(),this.logger=y}var c=f.prototype;return c.getHandler=function(o){return this.channels[o].getHandler()},c.setHandler=function(o,x){this.channels[o].setHandler(x)},c.addData=function(o,x){var y,p,I,B=!1;this.logger.time=o;for(var F=0;F<x.length;F+=2){if(p=x[F]&127,I=x[F+1]&127,p===0&&I===0)continue;if(this.logger.log(S.DATA,"["+b([x[F],x[F+1]])+"] -> ("+b([p,I])+")"),y=this.parseCmd(p,I),y||(y=this.parseMidrow(p,I)),y||(y=this.parsePAC(p,I)),y||(y=this.parseBackgroundAttributes(p,I)),!y&&(B=this.parseChars(p,I),B)){var Q=this.currentChannel;if(Q&&Q>0){var j=this.channels[Q];j.insertChars(B)}else this.logger.log(S.WARNING,"No channel found yet. TEXT-MODE?")}!y&&!B&&this.logger.log(S.WARNING,"Couldn't parse cleaned data "+b([p,I])+" orig: "+b([x[F],x[F+1]]))}},c.parseCmd=function(o,x){var y=this.cmdHistory,p=(o===20||o===28||o===21||o===29)&&x>=32&&x<=47,I=(o===23||o===31)&&x>=33&&x<=35;if(!(p||I))return!1;if(D(o,x,y))return m(null,null,y),this.logger.log(S.DEBUG,"Repeated command ("+b([o,x])+") is dropped"),!0;var B=o===20||o===21||o===23?1:2,F=this.channels[B];return o===20||o===21||o===28||o===29?x===32?F.ccRCL():x===33?F.ccBS():x===34?F.ccAOF():x===35?F.ccAON():x===36?F.ccDER():x===37?F.ccRU(2):x===38?F.ccRU(3):x===39?F.ccRU(4):x===40?F.ccFON():x===41?F.ccRDC():x===42?F.ccTR():x===43?F.ccRTD():x===44?F.ccEDM():x===45?F.ccCR():x===46?F.ccENM():x===47&&F.ccEOC():F.ccTO(x-32),m(o,x,y),this.currentChannel=B,!0},c.parseMidrow=function(o,x){var y=0;if((o===17||o===25)&&x>=32&&x<=47){if(o===17?y=1:y=2,y!==this.currentChannel)return this.logger.log(S.ERROR,"Mismatch channel in midrow parsing"),!1;var p=this.channels[y];return p?(p.ccMIDROW(x),this.logger.log(S.DEBUG,"MIDROW ("+b([o,x])+")"),!0):!1}return!1},c.parsePAC=function(o,x){var y,p=this.cmdHistory,I=(o>=17&&o<=23||o>=25&&o<=31)&&x>=64&&x<=127,B=(o===16||o===24)&&x>=64&&x<=95;if(!(I||B))return!1;if(D(o,x,p))return m(null,null,p),!0;var F=o<=23?1:2;x>=64&&x<=95?y=F===1?O[o]:h[o]:y=F===1?R[o]:v[o];var Q=this.channels[F];return Q?(Q.setPAC(this.interpretPAC(y,x)),m(o,x,p),this.currentChannel=F,!0):!1},c.interpretPAC=function(o,x){var y,p={color:null,italics:!1,indent:null,underline:!1,row:o};return x>95?y=x-96:y=x-64,p.underline=(y&1)===1,y<=13?p.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(y/2)]:y<=15?(p.italics=!0,p.color="white"):p.indent=Math.floor((y-16)/2)*4,p},c.parseChars=function(o,x){var y,p=null,I=null;if(o>=25?(y=2,I=o-8):(y=1,I=o),I>=17&&I<=19){var B;I===17?B=x+80:I===18?B=x+112:B=x+144,this.logger.log(S.INFO,"Special char '"+M(B)+"' in channel "+y),p=[B]}else o>=32&&o<=127&&(p=x===0?[o]:[o,x]);if(p){var F=b(p);this.logger.log(S.DEBUG,"Char codes = "+F.join(",")),m(o,x,this.cmdHistory)}return p},c.parseBackgroundAttributes=function(o,x){var y=(o===16||o===24)&&x>=32&&x<=47,p=(o===23||o===31)&&x>=45&&x<=47;if(!(y||p))return!1;var I,B={};o===16||o===24?(I=Math.floor((x-32)/2),B.background=L[I],x%2===1&&(B.background=B.background+"_semi")):x===45?B.background="transparent":(B.foreground="black",x===47&&(B.underline=!0));var F=o<=23?1:2,Q=this.channels[F];return Q.setBkgData(B),m(o,x,this.cmdHistory),!0},c.reset=function(){for(var o=0;o<Object.keys(this.channels).length;o++){var x=this.channels[o];x&&x.reset()}this.cmdHistory=A()},c.cueSplitAtTime=function(o){for(var x=0;x<this.channels.length;x++){var y=this.channels[x];y&&y.cueSplitAtTime(o)}},f}();function m(f,c,s){s.a=f,s.b=c}function D(f,c,s){return s.a===f&&s.b===c}function A(){return{a:null,b:null}}H.default=g},"./src/utils/codecs.ts":function(Z,H,w){"use strict";w.r(H),w.d(H,"isCodecType",function(){return P}),w.d(H,"isCodecSupportedInMp4",function(){return M});var W={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(N,k){var O=W[k];return!!O&&O[N.slice(0,4)]===!0}function M(N,k){return MediaSource.isTypeSupported((k||"video")+'/mp4;codecs="'+N+'"')}},"./src/utils/cues.ts":function(Z,H,w){"use strict";w.r(H);var W=w("./src/utils/vttparser.ts"),P=w("./src/utils/webvtt-parser.ts"),M=w("./src/utils/texttrack-utils.ts"),N=/\s/,k={newCue:function(R,h,v,L){for(var S=[],E,b,d,a,l,u=self.VTTCue||self.TextTrackCue,C=0;C<L.rows.length;C++)if(E=L.rows[C],d=!0,a=0,l="",!E.isEmpty()){for(var g=0;g<E.chars.length;g++)N.test(E.chars[g].uchar)&&d?a++:(l+=E.chars[g].uchar,d=!1);E.cueStartTime=h,h===v&&(v+=1e-4),a>=16?a--:a++;var m=Object(W.fixLineBreaks)(l.trim()),D=Object(P.generateCueId)(h,v,m);(!R||!R.cues||!R.cues.getCueById(D))&&(b=new u(h,v,m),b.id=D,b.line=C+1,b.align="left",b.position=10+Math.min(80,Math.floor(a*8/32)*10),S.push(b))}return R&&S.length&&(S.sort(function(A,f){return A.line==="auto"||f.line==="auto"?0:A.line>8&&f.line>8?f.line-A.line:A.line-f.line}),S.forEach(function(A){return Object(M.addCueToTrack)(R,A)})),S}};H.default=k},"./src/utils/discontinuities.ts":function(Z,H,w){"use strict";w.r(H),w.d(H,"findFirstFragWithCC",function(){return N}),w.d(H,"shouldAlignOnDiscontinuities",function(){return k}),w.d(H,"findDiscontinuousReferenceFrag",function(){return O}),w.d(H,"adjustSlidingStart",function(){return h}),w.d(H,"alignStream",function(){return v}),w.d(H,"alignPDT",function(){return S}),w.d(H,"alignFragmentByPDTDelta",function(){return E}),w.d(H,"alignMediaPlaylistByPDT",function(){return b});var W=w("./src/polyfills/number.ts"),P=w("./src/utils/logger.ts"),M=w("./src/controller/level-helper.ts");function N(d,a){for(var l=null,u=0,C=d.length;u<C;u++){var g=d[u];if(g&&g.cc===a){l=g;break}}return l}function k(d,a,l){return!!(a.details&&(l.endCC>l.startCC||d&&d.cc<l.startCC))}function O(d,a){var l=d.fragments,u=a.fragments;if(!u.length||!l.length){P.logger.log("No fragments to align");return}var C=N(l,u[0].cc);if(!C||C&&!C.startPTS){P.logger.log("No frag in previous level to align on");return}return C}function R(d,a){if(d){var l=d.start+a;d.start=d.startPTS=l,d.endPTS=l+d.duration}}function h(d,a){for(var l=a.fragments,u=0,C=l.length;u<C;u++)R(l[u],d);a.fragmentHint&&R(a.fragmentHint,d),a.alignedSliding=!0}function v(d,a,l){if(!a)return;L(d,l,a),!l.alignedSliding&&a.details&&S(l,a.details),!l.alignedSliding&&a.details&&!l.skippedSegments&&Object(M.adjustSliding)(a.details,l)}function L(d,a,l){if(k(d,l,a)){var u=O(l.details,a);u&&Object(W.isFiniteNumber)(u.start)&&(P.logger.log("Adjusting PTS using last level due to CC increase within current level "+a.url),h(u.start,a))}}function S(d,a){if(!a.fragments.length||!d.hasProgramDateTime||!a.hasProgramDateTime)return;var l=a.fragments[0].programDateTime,u=d.fragments[0].programDateTime,C=(u-l)/1e3+a.fragments[0].start;C&&Object(W.isFiniteNumber)(C)&&(P.logger.log("Adjusting PTS using programDateTime delta "+(u-l)+"ms, sliding:"+C.toFixed(3)+" "+d.url+" "),h(C,d))}function E(d,a){var l=d.programDateTime;if(!l)return;var u=(l-a)/1e3;d.start=d.startPTS=u,d.endPTS=u+d.duration}function b(d,a){if(!a.fragments.length||!d.hasProgramDateTime||!a.hasProgramDateTime)return;var l=a.fragments[0].programDateTime,u=a.fragments[0].start,C=l-u*1e3;d.fragments.forEach(function(g){E(g,C)}),d.fragmentHint&&E(d.fragmentHint,C),d.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(Z,H,w){"use strict";w.r(H);var W=w("./src/utils/ewma.ts"),P=function(){function M(k,O,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 W.default(k),this.fast_=new W.default(O)}var N=M.prototype;return N.update=function(O,R){var h=this.slow_,v=this.fast_;this.slow_.halfLife!==O&&(this.slow_=new W.default(O,h.getEstimate(),h.getTotalWeight())),this.fast_.halfLife!==R&&(this.fast_=new W.default(R,v.getEstimate(),v.getTotalWeight()))},N.sample=function(O,R){O=Math.max(O,this.minDelayMs_);var h=8*R,v=O/1e3,L=h/v;this.fast_.sample(v,L),this.slow_.sample(v,L)},N.canEstimate=function(){var O=this.fast_;return O&&O.getTotalWeight()>=this.minWeight_},N.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},N.destroy=function(){},M}();H.default=P},"./src/utils/ewma.ts":function(Z,H,w){"use strict";w.r(H);var W=function(){function P(N,k,O){k===void 0&&(k=0),O===void 0&&(O=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=N,this.alpha_=N?Math.exp(Math.log(.5)/N):0,this.estimate_=k,this.totalWeight_=O}var M=P.prototype;return M.sample=function(k,O){var R=Math.pow(this.alpha_,k);this.estimate_=O*(1-R)+R*this.estimate_,this.totalWeight_+=k},M.getTotalWeight=function(){return this.totalWeight_},M.getEstimate=function(){if(this.alpha_){var k=1-Math.pow(this.alpha_,this.totalWeight_);if(k)return this.estimate_/k}return this.estimate_},P}();H.default=W},"./src/utils/fetch-loader.ts":function(Z,H,w){"use strict";w.r(H),w.d(H,"fetchSupported",function(){return E});var W=w("./src/polyfills/number.ts"),P=w("./src/loader/load-stats.ts"),M=w("./src/demux/chunk-cache.ts");function N(u,C){u.prototype=Object.create(C.prototype),u.prototype.constructor=u,v(u,C)}function k(u){var C=typeof Map=="function"?new Map:void 0;return k=function(m){if(m===null||!h(m))return m;if(typeof m!="function")throw new TypeError("Super expression must either be null or a function");if(typeof C!="undefined"){if(C.has(m))return C.get(m);C.set(m,D)}function D(){return O(m,arguments,L(this).constructor)}return D.prototype=Object.create(m.prototype,{constructor:{value:D,enumerable:!1,writable:!0,configurable:!0}}),v(D,m)},k(u)}function O(u,C,g){return R()?O=Reflect.construct:O=function(D,A,f){var c=[null];c.push.apply(c,A);var s=Function.bind.apply(D,c),o=new s;return f&&v(o,f.prototype),o},O.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 h(u){return Function.toString.call(u).indexOf("[native code]")!==-1}function v(u,C){return v=Object.setPrototypeOf||function(m,D){return m.__proto__=D,m},v(u,C)}function L(u){return L=Object.setPrototypeOf?Object.getPrototypeOf:function(g){return g.__proto__||Object.getPrototypeOf(g)},L(u)}function S(){return S=Object.assign||function(u){for(var C=1;C<arguments.length;C++){var g=arguments[C];for(var m in g)Object.prototype.hasOwnProperty.call(g,m)&&(u[m]=g[m])}return u},S.apply(this,arguments)}function E(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(u){}return!1}var b=function(){function u(g){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=g.fetchSetup||a,this.controller=new self.AbortController,this.stats=new P.LoadStats}var C=u.prototype;return C.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},C.abortInternal=function(){var m=this.response;(!m||!m.ok)&&(this.stats.aborted=!0,this.controller.abort())},C.abort=function(){var m;this.abortInternal(),(m=this.callbacks)!==null&&m!==void 0&&m.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},C.load=function(m,D,A){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(m,this.controller.signal),o=A.onProgress,x=m.responseType==="arraybuffer",y=x?"byteLength":"length";this.context=m,this.config=D,this.callbacks=A,this.request=this.fetchSetup(m,s),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){f.abortInternal(),A.onTimeout(c,m,f.response)},D.timeout),self.fetch(this.request).then(function(p){if(f.response=f.loader=p,!p.ok){var I=p.status,B=p.statusText;throw new l(B||"fetch, bad network response",I,p)}return c.loading.first=Math.max(self.performance.now(),c.loading.start),c.total=parseInt(p.headers.get("Content-Length")||"0"),o&&Object(W.isFiniteNumber)(D.highWaterMark)?f.loadProgressively(p,c,m,D.highWaterMark,o):x?p.arrayBuffer():p.text()}).then(function(p){var I=f.response;self.clearTimeout(f.requestTimeout),c.loading.end=Math.max(self.performance.now(),c.loading.first),c.loaded=c.total=p[y];var B={url:I.url,data:p};o&&!Object(W.isFiniteNumber)(D.highWaterMark)&&o(c,m,p,I),A.onSuccess(B,c,m,I)}).catch(function(p){if(self.clearTimeout(f.requestTimeout),c.aborted)return;var I=p.code||0;A.onError({code:I,text:p.message},m,p.details)})},C.getCacheAge=function(){var m=null;if(this.response){var D=this.response.headers.get("age");m=D?parseFloat(D):null}return m},C.loadProgressively=function(m,D,A,f,c){f===void 0&&(f=0);var s=new M.default,o=m.body.getReader(),x=function y(){return o.read().then(function(p){if(p.done)return s.dataLength&&c(D,A,s.flush(),m),Promise.resolve(new ArrayBuffer(0));var I=p.value,B=I.length;return D.loaded+=B,B<f||s.dataLength?(s.push(I),s.dataLength>=f&&c(D,A,s.flush(),m)):c(D,A,I,m),y()}).catch(function(){return Promise.reject()})};return x()},u}();function d(u,C){var g={method:"GET",mode:"cors",credentials:"same-origin",signal:C,headers:new self.Headers(S({},u.headers))};return u.rangeEnd&&g.headers.set("Range","bytes="+u.rangeStart+"-"+String(u.rangeEnd-1)),g}function a(u,C){return new self.Request(u.url,C)}var l=function(u){N(C,u);function C(g,m,D){var A;return A=u.call(this,g)||this,A.code=void 0,A.details=void 0,A.code=m,A.details=D,A}return C}(k(Error));H.default=b},"./src/utils/imsc1-ttml-parser.ts":function(Z,H,w){"use strict";w.r(H),w.d(H,"IMSC1_CODEC",function(){return h}),w.d(H,"parseIMSC1",function(){return E});var W=w("./src/utils/mp4-tools.ts"),P=w("./src/utils/vttparser.ts"),M=w("./src/utils/vttcue.ts"),N=w("./src/demux/id3.ts"),k=w("./src/utils/timescale-conversion.ts"),O=w("./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 o in s)Object.prototype.hasOwnProperty.call(s,o)&&(f[o]=s[o])}return f},R.apply(this,arguments)}var h="stpp.ttml.im1t",v=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,L=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,S={left:"start",center:"center",right:"end",start:"start",end:"end"};function E(f,c,s,o,x){var y=Object(W.findBox)(new Uint8Array(f),["mdat"]);if(y.length===0){x(new Error("Could not parse IMSC1 mdat"));return}var p=y[0],I=Object(N.utf8ArrayToStr)(new Uint8Array(f,p.start,p.end-p.start)),B=Object(k.toTimescaleFromScale)(c,1,s);try{o(b(I,B))}catch(F){x(F)}}function b(f,c){var s=new DOMParser,o=s.parseFromString(f,"text/xml"),x=o.getElementsByTagName("tt")[0];if(!x)throw new Error("Invalid ttml");var y={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},p=Object.keys(y).reduce(function(j,U){return j[U]=x.getAttribute("ttp:"+U)||y[U],j},{}),I=x.getAttribute("xml:space")!=="preserve",B=a(d(x,"styling","style")),F=a(d(x,"layout","region")),Q=d(x,"body","[begin]");return[].map.call(Q,function(j){var U=l(j,I);if(!U||!j.hasAttribute("begin"))return null;var X=m(j.getAttribute("begin"),p),$=m(j.getAttribute("dur"),p),ne=m(j.getAttribute("end"),p);if(X===null)throw g(j);if(ne===null){if($===null)throw g(j);ne=X+$}var ue=new M.default(X-c,ne-c,U);ue.id=Object(O.generateCueId)(ue.startTime,ue.endTime,ue.text);var Te=F[j.getAttribute("region")],pe=B[j.getAttribute("style")];ue.position=10,ue.size=80;var de=u(Te,pe),ce=de.textAlign;if(ce){var fe=S[ce];fe&&(ue.lineAlign=fe),ue.align=ce}return R(ue,de),ue}).filter(function(j){return j!==null})}function d(f,c,s){var o=f.getElementsByTagName(c)[0];return o?[].slice.call(o.querySelectorAll(s)):[]}function a(f){return f.reduce(function(c,s){var o=s.getAttribute("xml:id");return o&&(c[o]=s),c},{})}function l(f,c){return[].slice.call(f.childNodes).reduce(function(s,o,x){var y;return o.nodeName==="br"&&x?s+`
`:(y=o.childNodes)!==null&&y!==void 0&&y.length?l(o,c):c?s+o.textContent.trim().replace(/\s+/g," "):s+o.textContent},"")}function u(f,c){var s="http://www.w3.org/ns/ttml#styling",o=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return o.reduce(function(x,y){var p=C(c,s,y)||C(f,s,y);return p&&(x[y]=p),x},{})}function C(f,c,s){return f.hasAttributeNS(c,s)?f.getAttributeNS(c,s):null}function g(f){return new Error("Could not parse ttml timestamp "+f)}function m(f,c){if(!f)return null;var s=Object(P.parseTimeStamp)(f);return s===null&&(v.test(f)?s=D(f,c):L.test(f)&&(s=A(f,c))),s}function D(f,c){var s=v.exec(f),o=(s[4]|0)+(s[5]|0)/c.subFrameRate;return(s[1]|0)*3600+(s[2]|0)*60+(s[3]|0)+o/c.frameRate}function A(f,c){var s=L.exec(f),o=Number(s[1]),x=s[2];switch(x){case"h":return o*3600;case"m":return o*60;case"ms":return o*1e3;case"f":return o/c.frameRate;case"t":return o/c.tickRate}return o}},"./src/utils/logger.ts":function(Z,H,w){"use strict";w.r(H),w.d(H,"enableLogs",function(){return O}),w.d(H,"logger",function(){return R});var W=function(){},P={trace:W,debug:W,log:W,warn:W,info:W,error:W},M=P;function N(h){var v=self.console[h];return v?v.bind(self.console,"["+h+"] >"):W}function k(h){for(var v=arguments.length,L=new Array(v>1?v-1:0),S=1;S<v;S++)L[S-1]=arguments[S];L.forEach(function(E){M[E]=h[E]?h[E].bind(h):N(E)})}function O(h){if(self.console&&h===!0||typeof h=="object"){k(h,"debug","log","info","warn","error");try{M.log()}catch(v){M=P}}else M=P}var R=M},"./src/utils/mediakeys-helper.ts":function(Z,H,w){"use strict";w.r(H),w.d(H,"KeySystems",function(){return W}),w.d(H,"requestMediaKeySystemAccess",function(){return P});var W;(function(M){M.WIDEVINE="com.widevine.alpha",M.PLAYREADY="com.microsoft.playready"})(W||(W={}));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(Z,H,w){"use strict";w.r(H),w.d(H,"getMediaSource",function(){return W});function W(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(Z,H,w){"use strict";w.r(H),w.d(H,"bin2str",function(){return k}),w.d(H,"readUint16",function(){return O}),w.d(H,"readUint32",function(){return R}),w.d(H,"writeUint32",function(){return h}),w.d(H,"findBox",function(){return v}),w.d(H,"parseSegmentIndex",function(){return L}),w.d(H,"parseInitSegment",function(){return S}),w.d(H,"getStartDTS",function(){return E}),w.d(H,"getDuration",function(){return b}),w.d(H,"computeRawDurationFromSamples",function(){return d}),w.d(H,"offsetStartDTS",function(){return a}),w.d(H,"segmentValidRange",function(){return l}),w.d(H,"appendUint8Array",function(){return u});var W=w("./src/utils/typed-array.ts"),P=w("./src/loader/fragment.ts"),M=Math.pow(2,32)-1,N=[].push;function k(C){return String.fromCharCode.apply(null,C)}function O(C,g){"data"in C&&(g+=C.start,C=C.data);var m=C[g]<<8|C[g+1];return m<0?65536+m:m}function R(C,g){"data"in C&&(g+=C.start,C=C.data);var m=C[g]<<24|C[g+1]<<16|C[g+2]<<8|C[g+3];return m<0?4294967296+m:m}function h(C,g,m){"data"in C&&(g+=C.start,C=C.data),C[g]=m>>24,C[g+1]=m>>16&255,C[g+2]=m>>8&255,C[g+3]=m&255}function v(C,g){var m=[];if(!g.length)return m;var D,A,f;"data"in C?(D=C.data,A=C.start,f=C.end):(D=C,A=0,f=D.byteLength);for(var c=A;c<f;){var s=R(D,c),o=k(D.subarray(c+4,c+8)),x=s>1?c+s:f;if(o===g[0])if(g.length===1)m.push({data:D,start:c+8,end:x});else{var y=v({data:D,start:c+8,end:x},g.slice(1));y.length&&N.apply(m,y)}c=x}return m}function L(C){var g=v(C,["moov"]),m=g[0],D=m?m.end:null,A=v(C,["sidx"]);if(!A||!A[0])return null;var f=[],c=A[0],s=c.data[0],o=s===0?8:16,x=R(c,o);o+=4;var y=0,p=0;s===0?o+=8:o+=16,o+=2;var I=c.end+p,B=O(c,o);o+=2;for(var F=0;F<B;F++){var Q=o,j=R(c,Q);Q+=4;var U=j&2147483647,X=(j&2147483648)>>>31;if(X===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var $=R(c,Q);Q+=4,f.push({referenceSize:U,subsegmentDuration:$,info:{duration:$/x,start:I,end:I+U-1}}),I+=U,Q+=4,o=Q}return{earliestPresentationTime:y,timescale:x,version:s,referencesCount:B,references:f,moovEndOffset:D}}function S(C){for(var g=[],m=v(C,["moov","trak"]),D=0;D<m.length;D++){var A=m[D],f=v(A,["tkhd"])[0];if(f){var c=f.data[f.start],s=c===0?12:20,o=R(f,s),x=v(A,["mdia","mdhd"])[0];if(x){c=x.data[x.start],s=c===0?12:20;var y=R(x,s),p=v(A,["mdia","hdlr"])[0];if(p){var I=k(p.data.subarray(p.start+8,p.start+12)),B={soun:P.ElementaryStreamTypes.AUDIO,vide:P.ElementaryStreamTypes.VIDEO}[I];if(B){var F=v(A,["mdia","minf","stbl","stsd"])[0],Q=void 0;F&&(Q=k(F.data.subarray(F.start+12,F.start+16))),g[o]={timescale:y,type:B},g[B]={timescale:y,id:o,codec:Q}}}}}}var j=v(C,["moov","mvex","trex"]);return j.forEach(function(U){var X=R(U,4),$=g[X];$&&($.default={duration:R(U,12),flags:R(U,20)})}),g}function E(C,g){return v(g,["moof","traf"]).reduce(function(m,D){var A=v(D,["tfdt"])[0],f=A.data[A.start],c=v(D,["tfhd"]).reduce(function(s,o){var x=R(o,4),y=C[x];if(y){var p=R(A,4);f===1&&(p*=Math.pow(2,32),p+=R(A,8));var I=y.timescale||9e4,B=p/I;if(isFinite(B)&&(s===null||B<s))return B}return s},null);return c!==null&&isFinite(c)&&(m===null||c<m)?c:m},null)||0}function b(C,g){for(var m=0,D=0,A=0,f=v(C,["moof","traf"]),c=0;c<f.length;c++){var s=f[c],o=v(s,["tfhd"])[0],x=R(o,4),y=g[x];if(!y)continue;var p=y.default,I=R(o,0)|(p==null?void 0:p.flags),B=p==null?void 0:p.duration;I&8&&(I&2?B=R(o,12):B=R(o,8));for(var F=y.timescale||9e4,Q=v(s,["trun"]),j=0;j<Q.length;j++){if(B){var U=R(Q[j],4);m=B*U}else m=d(Q[j]);y.type===P.ElementaryStreamTypes.VIDEO?D+=m/F:y.type===P.ElementaryStreamTypes.AUDIO&&(A+=m/F)}}if(D===0&&A===0){var X=L(C);if(X!=null&&X.references)return X.references.reduce(function($,ne){return $+ne.info.duration||0},0)}return D||A}function d(C){var g=R(C,0),m=8;g&1&&(m+=4),g&4&&(m+=4);for(var D=0,A=R(C,4),f=0;f<A;f++){if(g&256){var c=R(C,m);D+=c,m+=4}g&512&&(m+=4),g&1024&&(m+=4),g&2048&&(m+=4)}return D}function a(C,g,m){v(g,["moof","traf"]).forEach(function(D){v(D,["tfhd"]).forEach(function(A){var f=R(A,4),c=C[f];if(!c)return;var s=c.timescale||9e4;v(D,["tfdt"]).forEach(function(o){var x=o.data[o.start],y=R(o,4);if(x===0)h(o,4,y-m*s);else{y*=Math.pow(2,32),y+=R(o,8),y-=m*s,y=Math.max(y,0);var p=Math.floor(y/(M+1)),I=Math.floor(y%(M+1));h(o,4,p),h(o,8,I)}})})})}function l(C){var g={valid:null,remainder:null},m=v(C,["moof"]);if(m){if(m.length<2)return g.remainder=C,g}else return g;var D=m[m.length-1];return g.valid=Object(W.sliceUint8)(C,0,D.start-8),g.remainder=Object(W.sliceUint8)(C,D.start-8),g}function u(C,g){var m=new Uint8Array(C.length+g.length);return m.set(C),m.set(g,C.length),m}},"./src/utils/output-filter.ts":function(Z,H,w){"use strict";w.r(H),w.d(H,"default",function(){return W});var W=function(){function P(N,k){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=N,this.trackName=k}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(k,O,R){(this.startTime===null||this.startTime>k)&&(this.startTime=k),this.endTime=O,this.screen=R,this.timelineController.createCaptionsTrack(this.trackName)},M.reset=function(){this.cueRanges=[]},P}()},"./src/utils/texttrack-utils.ts":function(Z,H,w){"use strict";w.r(H),w.d(H,"sendAddTrackEvent",function(){return P}),w.d(H,"addCueToTrack",function(){return M}),w.d(H,"clearCurrentCues",function(){return N}),w.d(H,"removeCuesInRange",function(){return k}),w.d(H,"getCuesInRange",function(){return R});var W=w("./src/utils/logger.ts");function P(h,v){var L;try{L=new Event("addtrack")}catch(S){L=document.createEvent("Event"),L.initEvent("addtrack",!1,!1)}L.track=h,v.dispatchEvent(L)}function M(h,v){var L=h.mode;if(L==="disabled"&&(h.mode="hidden"),h.cues&&!h.cues.getCueById(v.id))try{if(h.addCue(v),!h.cues.getCueById(v.id))throw new Error("addCue is failed for: "+v)}catch(E){W.logger.debug("[texttrack-utils]: "+E);var S=new self.TextTrackCue(v.startTime,v.endTime,v.text);S.id=v.id,h.addCue(S)}L==="disabled"&&(h.mode=L)}function N(h){var v=h.mode;if(v==="disabled"&&(h.mode="hidden"),h.cues)for(var L=h.cues.length;L--;)h.removeCue(h.cues[L]);v==="disabled"&&(h.mode=v)}function k(h,v,L){var S=h.mode;if(S==="disabled"&&(h.mode="hidden"),h.cues&&h.cues.length>0)for(var E=R(h.cues,v,L),b=0;b<E.length;b++)h.removeCue(E[b]);S==="disabled"&&(h.mode=S)}function O(h,v){if(v<h[0].startTime)return 0;var L=h.length-1;if(v>h[L].endTime)return-1;for(var S=0,E=L;S<=E;){var b=Math.floor((E+S)/2);if(v<h[b].startTime)E=b-1;else if(v>h[b].startTime&&S<L)S=b+1;else return b}return h[S].startTime-v<v-h[E].startTime?S:E}function R(h,v,L){var S=[],E=O(h,v);if(E>-1)for(var b=E,d=h.length;b<d;b++){var a=h[b];if(a.startTime>=v&&a.endTime<=L)S.push(a);else if(a.startTime>L)return S}return S}},"./src/utils/time-ranges.ts":function(Z,H,w){"use strict";w.r(H);var W={toString:function(M){for(var N="",k=M.length,O=0;O<k;O++)N+="["+M.start(O).toFixed(3)+","+M.end(O).toFixed(3)+"]";return N}};H.default=W},"./src/utils/timescale-conversion.ts":function(Z,H,w){"use strict";w.r(H),w.d(H,"toTimescaleFromBase",function(){return P}),w.d(H,"toTimescaleFromScale",function(){return M}),w.d(H,"toMsFromMpegTsClock",function(){return N}),w.d(H,"toMpegTsClockFromTimescale",function(){return k});var W=9e4;function P(O,R,h,v){h===void 0&&(h=1),v===void 0&&(v=!1);var L=O*R*h;return v?Math.round(L):L}function M(O,R,h,v){return h===void 0&&(h=1),v===void 0&&(v=!1),P(O,R,1/h,v)}function N(O,R){return R===void 0&&(R=!1),P(O,1e3,1/W,R)}function k(O,R){return R===void 0&&(R=1),P(O,W,1/R)}},"./src/utils/typed-array.ts":function(Z,H,w){"use strict";w.r(H),w.d(H,"sliceUint8",function(){return W});function W(P,M,N){return Uint8Array.prototype.slice?P.slice(M,N):new Uint8Array(Array.prototype.slice.call(P,M,N))}},"./src/utils/vttcue.ts":function(Z,H,w){"use strict";w.r(H),H.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var W=["","lr","rl"],P=["start","middle","end","left","right"];function M(h,v){if(typeof v!="string")return!1;if(!Array.isArray(h))return!1;var L=v.toLowerCase();return~h.indexOf(L)?L:!1}function N(h){return M(W,h)}function k(h){return M(P,h)}function O(h){for(var v=arguments.length,L=new Array(v>1?v-1:0),S=1;S<v;S++)L[S-1]=arguments[S];for(var E=1;E<arguments.length;E++){var b=arguments[E];for(var d in b)h[d]=b[d]}return h}function R(h,v,L){var S=this,E={enumerable:!0};S.hasBeenReset=!1;var b="",d=!1,a=h,l=v,u=L,C=null,g="",m=!0,D="auto",A="start",f=50,c="middle",s=50,o="middle";Object.defineProperty(S,"id",O({},E,{get:function(){return b},set:function(y){b=""+y}})),Object.defineProperty(S,"pauseOnExit",O({},E,{get:function(){return d},set:function(y){d=!!y}})),Object.defineProperty(S,"startTime",O({},E,{get:function(){return a},set:function(y){if(typeof y!="number")throw new TypeError("Start time must be set to a number.");a=y,this.hasBeenReset=!0}})),Object.defineProperty(S,"endTime",O({},E,{get:function(){return l},set:function(y){if(typeof y!="number")throw new TypeError("End time must be set to a number.");l=y,this.hasBeenReset=!0}})),Object.defineProperty(S,"text",O({},E,{get:function(){return u},set:function(y){u=""+y,this.hasBeenReset=!0}})),Object.defineProperty(S,"region",O({},E,{get:function(){return C},set:function(y){C=y,this.hasBeenReset=!0}})),Object.defineProperty(S,"vertical",O({},E,{get:function(){return g},set:function(y){var p=N(y);if(p===!1)throw new SyntaxError("An invalid or illegal string was specified.");g=p,this.hasBeenReset=!0}})),Object.defineProperty(S,"snapToLines",O({},E,{get:function(){return m},set:function(y){m=!!y,this.hasBeenReset=!0}})),Object.defineProperty(S,"line",O({},E,{get:function(){return D},set:function(y){if(typeof y!="number"&&y!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");D=y,this.hasBeenReset=!0}})),Object.defineProperty(S,"lineAlign",O({},E,{get:function(){return A},set:function(y){var p=k(y);if(!p)throw new SyntaxError("An invalid or illegal string was specified.");A=p,this.hasBeenReset=!0}})),Object.defineProperty(S,"position",O({},E,{get:function(){return f},set:function(y){if(y<0||y>100)throw new Error("Position must be between 0 and 100.");f=y,this.hasBeenReset=!0}})),Object.defineProperty(S,"positionAlign",O({},E,{get:function(){return c},set:function(y){var p=k(y);if(!p)throw new SyntaxError("An invalid or illegal string was specified.");c=p,this.hasBeenReset=!0}})),Object.defineProperty(S,"size",O({},E,{get:function(){return s},set:function(y){if(y<0||y>100)throw new Error("Size must be between 0 and 100.");s=y,this.hasBeenReset=!0}})),Object.defineProperty(S,"align",O({},E,{get:function(){return o},set:function(y){var p=k(y);if(!p)throw new SyntaxError("An invalid or illegal string was specified.");o=p,this.hasBeenReset=!0}})),S.displayState=void 0}return R.prototype.getCueAsHTML=function(){var h=self.WebVTT;return h.convertCueToDOMTree(self,this.text)},R}()},"./src/utils/vttparser.ts":function(Z,H,w){"use strict";w.r(H),w.d(H,"parseTimeStamp",function(){return M}),w.d(H,"fixLineBreaks",function(){return v}),w.d(H,"VTTParser",function(){return L});var W=w("./src/utils/vttcue.ts"),P=function(){function S(){}var E=S.prototype;return E.decode=function(d,a){if(!d)return"";if(typeof d!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(d))},S}();function M(S){function E(d,a,l,u){return(d|0)*3600+(a|0)*60+(l|0)+parseFloat(u||0)}var b=S.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return b?parseFloat(b[2])>59?E(b[2],b[3],0,b[4]):E(b[1],b[2],b[3],b[4]):null}var N=function(){function S(){this.values=Object.create(null)}var E=S.prototype;return E.set=function(d,a){!this.get(d)&&a!==""&&(this.values[d]=a)},E.get=function(d,a,l){return l?this.has(d)?this.values[d]:a[l]:this.has(d)?this.values[d]:a},E.has=function(d){return d in this.values},E.alt=function(d,a,l){for(var u=0;u<l.length;++u)if(a===l[u]){this.set(d,a);break}},E.integer=function(d,a){/^-?\d+$/.test(a)&&this.set(d,parseInt(a,10))},E.percent=function(d,a){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(a)){var l=parseFloat(a);if(l>=0&&l<=100)return this.set(d,l),!0}return!1},S}();function k(S,E,b,d){var a=d?S.split(d):[S];for(var l in a){if(typeof a[l]!="string")continue;var u=a[l].split(b);if(u.length!==2)continue;var C=u[0],g=u[1];E(C,g)}}var O=new W.default(0,0,""),R=O.align==="middle"?"middle":"center";function h(S,E,b){var d=S;function a(){var C=M(S);if(C===null)throw new Error("Malformed timestamp: "+d);return S=S.replace(/^[^\sa-zA-Z-]+/,""),C}function l(C,g){var m=new N;k(C,function(f,c){var s;switch(f){case"region":for(var o=b.length-1;o>=0;o--)if(b[o].id===c){m.set(f,b[o].region);break}break;case"vertical":m.alt(f,c,["rl","lr"]);break;case"line":s=c.split(","),m.integer(f,s[0]),m.percent(f,s[0])&&m.set("snapToLines",!1),m.alt(f,s[0],["auto"]),s.length===2&&m.alt("lineAlign",s[1],["start",R,"end"]);break;case"position":s=c.split(","),m.percent(f,s[0]),s.length===2&&m.alt("positionAlign",s[1],["start",R,"end","line-left","line-right","auto"]);break;case"size":m.percent(f,c);break;case"align":m.alt(f,c,["start",R,"end","left","right"]);break}},/:/,/\s/),g.region=m.get("region",null),g.vertical=m.get("vertical","");var D=m.get("line","auto");D==="auto"&&O.line===-1&&(D=-1),g.line=D,g.lineAlign=m.get("lineAlign","start"),g.snapToLines=m.get("snapToLines",!0),g.size=m.get("size",100),g.align=m.get("align",R);var A=m.get("position","auto");A==="auto"&&O.position===50&&(A=g.align==="start"||g.align==="left"?0:g.align==="end"||g.align==="right"?100:50),g.position=A}function u(){S=S.replace(/^\s+/,"")}if(u(),E.startTime=a(),u(),S.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+d);S=S.substr(3),u(),E.endTime=a(),u(),l(S,E)}function v(S){return S.replace(/<br(?: \/)?>/gi,`
`)}var L=function(){function S(){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 E=S.prototype;return E.parse=function(d){var a=this;d&&(a.buffer+=a.decoder.decode(d,{stream:!0}));function l(){var A=a.buffer,f=0;for(A=v(A);f<A.length&&A[f]!=="\r"&&A[f]!==`
`;)++f;var c=A.substr(0,f);return A[f]==="\r"&&++f,A[f]===`
`&&++f,a.buffer=A.substr(f),c}function u(A){k(A,function(f,c){},/:/)}try{var C="";if(a.state==="INITIAL"){if(!/\r\n|\n/.test(a.buffer))return this;C=l();var g=C.match(/^()?WEBVTT([ \t].*)?$/);if(!g||!g[0])throw new Error("Malformed WebVTT signature.");a.state="HEADER"}for(var m=!1;a.buffer;){if(!/\r\n|\n/.test(a.buffer))return this;m?m=!1:C=l();switch(a.state){case"HEADER":/:/.test(C)?u(C):C||(a.state="ID");continue;case"NOTE":C||(a.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(C)){a.state="NOTE";break}if(!C)continue;if(a.cue=new W.default(0,0,""),a.state="CUE",C.indexOf("-->")===-1){a.cue.id=C;continue}case"CUE":if(!a.cue){a.state="BADCUE";continue}try{h(C,a.cue,a.regionList)}catch(A){a.cue=null,a.state="BADCUE";continue}a.state="CUETEXT";continue;case"CUETEXT":{var D=C.indexOf("-->")!==-1;if(!C||D&&(m=!0)){a.oncue&&a.cue&&a.oncue(a.cue),a.cue=null,a.state="ID";continue}if(a.cue===null)continue;a.cue.text&&(a.cue.text+=`
`),a.cue.text+=C}continue;case"BADCUE":C||(a.state="ID")}}}catch(A){a.state==="CUETEXT"&&a.cue&&a.oncue&&a.oncue(a.cue),a.cue=null,a.state=a.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},E.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(a){d.onparsingerror&&d.onparsingerror(a)}return d.onflush&&d.onflush(),this},S}()},"./src/utils/webvtt-parser.ts":function(Z,H,w){"use strict";w.r(H),w.d(H,"generateCueId",function(){return L}),w.d(H,"parseWebVTT",function(){return E});var W=w("./src/polyfills/number.ts"),P=w("./src/utils/vttparser.ts"),M=w("./src/demux/id3.ts"),N=w("./src/utils/timescale-conversion.ts"),k=w("./src/remux/mp4-remuxer.ts"),O=/\r\n|\n\r|\n|\r/g,R=function(d,a,l){return l===void 0&&(l=0),d.substr(l,a.length)===a},h=function(d){var a=parseInt(d.substr(-3)),l=parseInt(d.substr(-6,2)),u=parseInt(d.substr(-9,2)),C=d.length>9?parseInt(d.substr(0,d.indexOf(":"))):0;if(!Object(W.isFiniteNumber)(a)||!Object(W.isFiniteNumber)(l)||!Object(W.isFiniteNumber)(u)||!Object(W.isFiniteNumber)(C))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+d);return a+=1e3*l,a+=60*1e3*u,a+=60*60*1e3*C,a},v=function(d){for(var a=5381,l=d.length;l;)a=a*33^d.charCodeAt(--l);return(a>>>0).toString()};function L(b,d,a){return v(b.toString())+v(d.toString())+v(a)}var S=function(d,a,l){var u=d[a],C=d[u.prevCC];if(!C||!C.new&&u.new){d.ccOffset=d.presentationOffset=u.start,u.new=!1;return}for(;(g=C)!==null&&g!==void 0&&g.new;){var g;d.ccOffset+=u.start-C.start,u.new=!1,u=C,C=d[u.prevCC]}d.presentationOffset=l};function E(b,d,a,l,u,C,g,m){var D=new P.VTTParser,A=Object(M.utf8ArrayToStr)(new Uint8Array(b)).trim().replace(O,`
`).split(`
`),f=[],c=Object(N.toMpegTsClockFromTimescale)(d,a),s="00:00.000",o=0,x=0,y,p=!0,I=!1;D.oncue=function(B){var F=l[u],Q=l.ccOffset,j=(o-c)/9e4;if(F!=null&&F.new&&(x!==void 0?Q=l.ccOffset=F.start:S(l,u,j)),j&&(Q=j-l.presentationOffset),I){var U=B.endTime-B.startTime,X=Object(k.normalizePts)((B.startTime+Q-x)*9e4,C*9e4)/9e4;B.startTime=X,B.endTime=X+U}var $=B.text.trim();B.text=decodeURIComponent(encodeURIComponent($)),B.id||(B.id=L(B.startTime,B.endTime,$)),B.endTime>0&&f.push(B)},D.onparsingerror=function(B){y=B},D.onflush=function(){if(y){m(y);return}g(f)},A.forEach(function(B){if(p)if(R(B,"X-TIMESTAMP-MAP=")){p=!1,I=!0,B.substr(16).split(",").forEach(function(F){R(F,"LOCAL:")?s=F.substr(6):R(F,"MPEGTS:")&&(o=parseInt(F.substr(7)))});try{x=h(s)/1e3}catch(F){I=!1,y=F}return}else B===""&&(p=!1);D.parse(B+`
`)}),D.flush()}},"./src/utils/xhr-loader.ts":function(Z,H,w){"use strict";w.r(H);var W=w("./src/utils/logger.ts"),P=w("./src/loader/load-stats.ts"),M=/^age:\s*[\d.]+\s*$/m,N=function(){function k(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 O=k.prototype;return O.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},O.abortInternal=function(){var h=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),h&&(h.onreadystatechange=null,h.onprogress=null,h.readyState!==4&&(this.stats.aborted=!0,h.abort()))},O.abort=function(){var h;this.abortInternal(),(h=this.callbacks)!==null&&h!==void 0&&h.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},O.load=function(h,v,L){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=h,this.config=v,this.callbacks=L,this.retryDelay=v.retryDelay,this.loadInternal()},O.loadInternal=function(){var h=this.config,v=this.context;if(!h)return;var L=this.loader=new self.XMLHttpRequest,S=this.stats;S.loading.first=0,S.loaded=0;var E=this.xhrSetup;try{if(E)try{E(L,v.url)}catch(a){L.open("GET",v.url,!0),E(L,v.url)}L.readyState||L.open("GET",v.url,!0);var b=this.context.headers;if(b)for(var d in b)L.setRequestHeader(d,b[d])}catch(a){this.callbacks.onError({code:L.status,text:a.message},v,L);return}v.rangeEnd&&L.setRequestHeader("Range","bytes="+v.rangeStart+"-"+(v.rangeEnd-1)),L.onreadystatechange=this.readystatechange.bind(this),L.onprogress=this.loadprogress.bind(this),L.responseType=v.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),h.timeout),L.send()},O.readystatechange=function(){var h=this.context,v=this.loader,L=this.stats;if(!h||!v)return;var S=v.readyState,E=this.config;if(L.aborted)return;if(S>=2)if(self.clearTimeout(this.requestTimeout),L.loading.first===0&&(L.loading.first=Math.max(self.performance.now(),L.loading.start)),S===4){v.onreadystatechange=null,v.onprogress=null;var b=v.status;if(b>=200&&b<300){L.loading.end=Math.max(self.performance.now(),L.loading.first);var d,a;if(h.responseType==="arraybuffer"?(d=v.response,a=d.byteLength):(d=v.responseText,a=d.length),L.loaded=L.total=a,!this.callbacks)return;var l=this.callbacks.onProgress;if(l&&l(L,h,d,v),!this.callbacks)return;var u={url:v.responseURL,data:d};this.callbacks.onSuccess(u,L,h,v)}else L.retry>=E.maxRetry||b>=400&&b<499?(W.logger.error(b+" while loading "+h.url),this.callbacks.onError({code:b,text:v.statusText},h,v)):(W.logger.warn(b+" while loading "+h.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,E.maxRetryDelay),L.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),E.timeout)},O.loadtimeout=function(){W.logger.warn("timeout while loading "+this.context.url);var h=this.callbacks;h&&(this.abortInternal(),h.onTimeout(this.stats,this.context,this.loader))},O.loadprogress=function(h){var v=this.stats;v.loaded=h.loaded,h.lengthComputable&&(v.total=h.total)},O.getCacheAge=function(){var h=null;if(this.loader&&M.test(this.loader.getAllResponseHeaders())){var v=this.loader.getResponseHeader("age");h=v?parseFloat(v):null}return h},k}();H.default=N}}).default})},wU8J:function(xe,be){function z(){this.buffer=new Array,this.length=0}z.prototype={get:function(Z){var H=Math.floor(Z/8);return(this.buffer[H]>>>7-Z%8&1)==1},put:function(Z,H){for(var w=0;w<H;w++)this.putBit((Z>>>H-w-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(Z){var H=Math.floor(this.length/8);this.buffer.length<=H&&this.buffer.push(0),Z&&(this.buffer[H]|=128>>>this.length%8),this.length++}},xe.exports=z},yslc:function(xe,be){xe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALoAAABSCAYAAADjGc4eAAAOHklEQVR4Xu1dCXQURRr+emZyTO6D3BCEgKCInCKeK3IoiyIqlxLyQBRBV8DNhCCrS3Z9Cq66KOoi68ECKocCcutTLhUERM1MEpBLEuQmQMKEnDNd+6onEzKTuXqmJ5l0V/EeL+mp+qu+r77UVP1V9TcHffZbIJgOlhgDMmaAA8lTwVDxJQh5UMY4GTSFM8AJ+PW6cIDsBEEfhfPB4MuUAYvQaTowOwV1NXtB0E6mWBksBTNwTeiUBENud/CmHwBEKZgTBl2GDNgKnQIsyBkCM9kEEI0M8TJICmWgqdCFkT17MngsUignDLYMGXAsdAo0XzcPILkyxMwgKZAB50InhIMhZxUIGalAXhhkmTHgXOg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pVpVOqhdZkbaJSKhsSELruuVxYgG6FzOK+Bekjd+I16exaY0JWlC9mhbRA6h5PBCBpUM369w1jdTOiy63plAaoX+rEQNTewetzmEmfomdCVpQvZoeWWDi3UctrBlePXnHHpTZcdcgZIUQxErnk43vjI2ovuQP8faDGikjbF4FsAAAAASUVORK5CYII="},zEei:function(xe,be,z){xe.exports={flex_box_center:"flex_box_center___3trsE",flex_space_between:"flex_space_between___vYNfG",flex_box_vertical_center:"flex_box_vertical_center___267W4",flex_box_center_end:"flex_box_center_end___35F4i",flex_box_column:"flex_box_column___1cLWS",bg:"bg___13rUr",flexRow:"flexRow___geim6",flexJustifyCenter:"flexJustifyCenter___2SLQ2",flexAlignEnd:"flexAlignEnd___2-3OH",flexAlignCenter:"flexAlignCenter___2PK_9",flexColumn:"flexColumn___pc_D1",formWrap:"formWrap___3ozw6",titleWrap:"titleWrap___3JSLu",fieldWrap:"fieldWrap___1M8-z",mdWrap:"mdWrap___3iPl2",backgroundFa:"backgroundFa___2Wd1f",button:"button___3ie7q",icons:"icons___-WSHu",addButton:"addButton___1qx7n",navBar:"navBar___xDlWA",actived:"actived___dZNDy",deleteButton:"deleteButton___3Ethm"}}}]);