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

361 lines
1.1 MiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[270,7,9,10,16],{"+NIl":function(Ge,We,X){(function(de){de(X("VrN/"))})(function(de){"use strict";de.defineMode("stex",function(V,O){"use strict";function H(w,T){w.cmdState.push(T)}function A(w){return w.cmdState.length>0?w.cmdState[w.cmdState.length-1]:null}function k(w){var T=w.cmdState.pop();T&&T.closeBracket()}function W(w){for(var T=w.cmdState,y=T.length-1;y>=0;y--){var u=T[y];if(u.name=="DEFAULT")continue;return u}return{styleIdentifier:function(){return null}}}function U(w,T,y){return function(){this.name=w,this.bracketNo=0,this.style=T,this.styles=y,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var P={};P.importmodule=U("importmodule","tag",["string","builtin"]),P.documentclass=U("documentclass","tag",["","atom"]),P.usepackage=U("usepackage","tag",["atom"]),P.begin=U("begin","tag",["atom"]),P.end=U("end","tag",["atom"]),P.label=U("label","tag",["atom"]),P.ref=U("ref","tag",["atom"]),P.eqref=U("eqref","tag",["atom"]),P.cite=U("cite","tag",["atom"]),P.bibitem=U("bibitem","tag",["atom"]),P.Bibitem=U("Bibitem","tag",["atom"]),P.RBibitem=U("RBibitem","tag",["atom"]),P.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function L(w,T){w.f=T}function b(w,T){var y;if(w.match(/^\\[a-zA-Z@]+/)){var u=w.current().slice(1);return y=P.hasOwnProperty(u)?P[u]:P.DEFAULT,y=new y,H(T,y),L(T,I),y.style}if(w.match(/^\\[$&%#{}_]/))return"tag";if(w.match(/^\\[,;!\/\\]/))return"tag";if(w.match("\\["))return L(T,function(l,s){return E(l,s,"\\]")}),"keyword";if(w.match("\\("))return L(T,function(l,s){return E(l,s,"\\)")}),"keyword";if(w.match("$$"))return L(T,function(l,s){return E(l,s,"$$")}),"keyword";if(w.match("$"))return L(T,function(l,s){return E(l,s,"$")}),"keyword";var a=w.next();if(a=="%")return w.skipToEnd(),"comment";if(a=="}"||a=="]"){if(y=A(T),y)y.closeBracket(a),L(T,I);else return"error";return"bracket"}else return a=="{"||a=="["?(y=P.DEFAULT,y=new y,H(T,y),"bracket"):/\d/.test(a)?(w.eatWhile(/[\w.%]/),"atom"):(w.eatWhile(/[\w\-_]/),y=W(T),y.name=="begin"&&(y.argument=w.current()),y.styleIdentifier())}function E(w,T,y){if(w.eatSpace())return null;if(y&&w.match(y))return L(T,b),"keyword";if(w.match(/^\\[a-zA-Z@]+/))return"tag";if(w.match(/^[a-zA-Z]+/))return"variable-2";if(w.match(/^\\[$&%#{}_]/))return"tag";if(w.match(/^\\[,;!\/]/))return"tag";if(w.match(/^[\^_&]/))return"tag";if(w.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(w.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var u=w.next();return u=="{"||u=="}"||u=="["||u=="]"||u=="("||u==")"?"bracket":u=="%"?(w.skipToEnd(),"comment"):"error"}function I(w,T){var y=w.peek(),u;return y=="{"||y=="["?(u=A(T),u.openBracket(y),w.eat(y),L(T,b),"bracket"):/[ \t\r]/.test(y)?(w.eat(y),null):(L(T,b),k(T),b(w,T))}return{startState:function(){var w=O.inMathMode?function(T,y){return E(T,y)}:b;return{cmdState:[],f:w}},copyState:function(w){return{cmdState:w.cmdState.slice(),f:w.f}},token:function(w,T){return T.f(w,T)},blankLine:function(w){w.f=b,w.cmdState.length=0},lineComment:"%"}}),de.defineMIME("text/x-stex","stex"),de.defineMIME("text/x-latex","stex")})},"/GNS":function(Ge,We,X){Ge.exports=X.p+"static/search1.c4136dd4.png"},"19Vz":function(Ge,We,X){(function(de){de(X("VrN/"))})(function(de){de.defineOption("placeholder","",function(U,P,L){var b=L&&L!=de.Init;if(P&&!b)U.on("blur",A),U.on("change",k),U.on("swapDoc",k),de.on(U.getInputField(),"compositionupdate",U.state.placeholderCompose=function(){H(U)}),k(U);else if(!P&&b){U.off("blur",A),U.off("change",k),U.off("swapDoc",k),de.off(U.getInputField(),"compositionupdate",U.state.placeholderCompose),V(U);var E=U.getWrapperElement();E.className=E.className.replace(" CodeMirror-empty","")}P&&!U.hasFocus()&&A(U)});function V(U){U.state.placeholder&&(U.state.placeholder.parentNode.removeChild(U.state.placeholder),U.state.placeholder=null)}function O(U){V(U);var P=U.state.placeholder=document.createElement("pre");P.style.cssText="height: 0; overflow: visible",P.style.direction=U.getOption("direction"),P.className="CodeMirror-placeholder CodeMirror-line-like";var L=U.getOption("placeholder");typeof L=="string"&&(L=document.createTextNode(L)),P.appendChild(L),U.display.lineSpace.insertBefore(P,U.display.lineSpace.firstChild)}function H(U){setTimeout(function(){var P=!1,L=U.getInputField();L.nodeName=="TEXTAREA"?P=!L.value:U.lineCount()==1&&(P=!/[^\u200b]/.test(L.querySelector(".CodeMirror-line").textContent)),P?O(U):V(U)},20)}function A(U){W(U)&&O(U)}function k(U){var P=U.getWrapperElement(),L=W(U);P.className=P.className.replace(" CodeMirror-empty","")+(L?" CodeMirror-empty":""),L?O(U):V(U)}function W(U){return U.lineCount()===1&&U.getLine(0)===""}})},"1eCo":function(Ge,We,X){(function(de){de(X("VrN/"))})(function(de){"use strict";var V={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},O={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};de.defineMode("xml",function(H,A){var k=H.indentUnit,W={},U=A.htmlMode?V:O;for(var P in U)W[P]=U[P];for(var P in A)W[P]=A[P];var L,b;function E(o,x){function g(z){return x.tokenize=z,z(o,x)}var C=o.next();if(C=="<")return o.eat("!")?o.eat("[")?o.match("CDATA[")?g(T("atom","]]>")):null:o.match("--")?g(T("comment","-->")):o.match("DOCTYPE",!0,!0)?(o.eatWhile(/[\w\._\-]/),g(y(1))):null:o.eat("?")?(o.eatWhile(/[\w\._\-]/),x.tokenize=T("meta","?>"),"meta"):(L=o.eat("/")?"closeTag":"openTag",x.tokenize=I,"tag bracket");if(C=="&"){var _;return o.eat("#")?o.eat("x")?_=o.eatWhile(/[a-fA-F\d]/)&&o.eat(";"):_=o.eatWhile(/[\d]/)&&o.eat(";"):_=o.eatWhile(/[\w\.\-:]/)&&o.eat(";"),_?"atom":"error"}else return o.eatWhile(/[^&<]/),null}E.isInText=!0;function I(o,x){var g=o.next();if(g==">"||g=="/"&&o.eat(">"))return x.tokenize=E,L=g==">"?"endTag":"selfcloseTag","tag bracket";if(g=="=")return L="equals",null;if(g=="<"){x.tokenize=E,x.state=s,x.tagName=x.tagStart=null;var C=x.tokenize(o,x);return C?C+" tag error":"tag error"}else return/[\'\"]/.test(g)?(x.tokenize=w(g),x.stringStartCol=o.column(),x.tokenize(o,x)):(o.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function w(o){var x=function(g,C){for(;!g.eol();)if(g.next()==o){C.tokenize=I;break}return"string"};return x.isInAttribute=!0,x}function T(o,x){return function(g,C){for(;!g.eol();){if(g.match(x)){C.tokenize=E;break}g.next()}return o}}function y(o){return function(x,g){for(var C;(C=x.next())!=null;){if(C=="<")return g.tokenize=y(o+1),g.tokenize(x,g);if(C==">")if(o==1){g.tokenize=E;break}else return g.tokenize=y(o-1),g.tokenize(x,g)}return"meta"}}function u(o,x,g){this.prev=o.context,this.tagName=x,this.indent=o.indented,this.startOfLine=g,(W.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 g;;){if(!o.context)return;if(g=o.context.tagName,!W.contextGrabbers.hasOwnProperty(g)||!W.contextGrabbers[g].hasOwnProperty(x))return;a(o)}}function s(o,x,g){return o=="openTag"?(g.tagStart=x.column(),m):o=="closeTag"?d:s}function m(o,x,g){return o=="word"?(g.tagName=x.current(),b="tag",v):W.allowMissingTagName&&o=="endTag"?(b="tag bracket",v(o,x,g)):(b="error",m)}function d(o,x,g){if(o=="word"){var C=x.current();return g.context&&g.context.tagName!=C&&W.implicitlyClosed.hasOwnProperty(g.context.tagName)&&a(g),g.context&&g.context.tagName==C||W.matchClosing===!1?(b="tag",f):(b="tag error",D)}else return W.allowMissingTagName&&o=="endTag"?(b="tag bracket",f(o,x,g)):(b="error",D)}function f(o,x,g){return o!="endTag"?(b="error",f):(a(g),s)}function D(o,x,g){return b="error",f(o,x,g)}function v(o,x,g){if(o=="word")return b="attribute",h;if(o=="endTag"||o=="selfcloseTag"){var C=g.tagName,_=g.tagStart;return g.tagName=g.tagStart=null,o=="selfcloseTag"||W.autoSelfClosers.hasOwnProperty(C)?l(g,C):(l(g,C),g.context=new u(g,C,_==g.indented)),s}return b="error",v}function h(o,x,g){return o=="equals"?p:(W.allowMissing||(b="error"),v(o,x,g))}function p(o,x,g){return o=="string"?c:o=="word"&&W.allowUnquoted?(b="string",v):(b="error",v(o,x,g))}function c(o,x,g){return o=="string"?c:v(o,x,g)}return{startState:function(o){var x={tokenize:E,state:s,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;L=null;var g=x.tokenize(o,x);return(g||L)&&g!="comment"&&(b=null,x.state=x.state(L||g,o,x),b&&(g=b=="error"?g+" error":b)),g},indent:function(o,x,g){var C=o.context;if(o.tokenize.isInAttribute)return o.tagStart==o.indented?o.stringStartCol+1:o.indented+k;if(C&&C.noIndent)return de.Pass;if(o.tokenize!=I&&o.tokenize!=E)return g?g.match(/^(\s*)/)[0].length:0;if(o.tagName)return W.multilineTagIndentPastTag!==!1?o.tagStart+o.tagName.length+2:o.tagStart+k*(W.multilineTagIndentFactor||1);if(W.alignCDATA&&/<!\[CDATA\[/.test(x))return 0;var _=x&&/^<(\/)?([\w_:\.-]*)/.exec(x);if(_&&_[1])for(;C;)if(C.tagName==_[2]){C=C.prev;break}else if(W.implicitlyClosed.hasOwnProperty(C.tagName))C=C.prev;else break;else if(_)for(;C;){var z=W.contextGrabbers[C.tagName];if(z&&z.hasOwnProperty(_[2]))C=C.prev;else break}for(;C&&C.prev&&!C.startOfLine;)C=C.prev;return C?C.indent+k:o.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:W.htmlMode?"html":"xml",helperType:W.htmlMode?"html":"xml",skipAttribute:function(o){o.state==p&&(o.state=v)},xmlCurrentTag:function(o){return o.tagName?{name:o.tagName,close:o.type=="closeTag"}:null},xmlCurrentContext:function(o){for(var x=[],g=o.context;g;g=g.prev)g.tagName&&x.push(g.tagName);return x.reverse()}}}),de.defineMIME("text/xml","xml"),de.defineMIME("application/xml","xml"),de.mimeModes.hasOwnProperty("text/html")||de.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"4qgm":function(Ge,We){Ge.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAAwCAYAAABE1blzAAAIeUlEQVRoQ72aa2wU1xXHf2dm1jYEBClJGgofIFJLU0W04AdQWgJSW0UprZRIpB/aJBTxStIShWchJvbytA2lBCKKeajhQ5s2tGpFK1G1UowqKNjYBkraJCqqiCDEDZSncezdmTnVnd2FxaztmfWaa632w9459/7v75xzz71j4R61ssM6TkrYqMon3qesPjFNLt6LoWWgB5n1ttr/GcMCLKrE5qFgPJf3gRXN5XJgoMcfUIFlR/QxiqgVhyfVA/MxTWKgPuZvL51UtUyTjwdK6IAI/NLbWlQylhctWC0xPuN35Zi+gFUMfpIzoqxsLpffDoTIggssb9KvqLBJYnxD3dvUepq8OIAPquxzfCobJ8v5QgotmMAxDVoyYjAvi81KcRiWk1qPKm/RPIvHqy2T5FeFElkQgeVNWq42m8TmcU0G8ZVXC2ia5vOW47Lq2BQ5m5ehrIf6JbC0WQdbsMSH5ZbNED/R3+mYDHSL5kcqVLZOZB8imq/lvAWWHdWpOGySIqYEwvKk1mtsmtl5/M72WNk4Wf6dj8jIAqce1qGJEparsgSHQVoIar3M3GRadWnDp+rb5eyJi0RaykgCy47q9DS1srDUvLRzme+YFXhg5CY2YD4uf/RdVrROkffCGgk13vQTOrzdZZUKi8SmOCy1pMLUYfCDkfD7T+Cvl1PTckKNereENM1L6rFmaAc/PzRD3L6E9jlUabN+Swj2tfFB6o8Q7h0e/GQMPDcy9djBS7DjPJzthOJ+0lSPvzguyxonyz96E9mjwIpGHeGZ+lFYiEXMpP+ozQhcPgZmj7z95MUE1H8Ef7gIhnCszyXOPWqa5lWUDVcvsu3Mk5KrXsodEhUtOtNT6qwYj0allj2dXAIzvx+5CtvOwT9vQpEFVtTVMzuK8QJT1yY55HssbZ0sLd3N3LF+k47pZ70YcZ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gBcT9jmplHxYEd4SR04kRER0ul0ur169dLWKVqYb7/IpVSjHB9IctSShzQWq9JQySMeyG/MI1ewhxYnqeYq2itnePYGPMmgO6iyAP4v5gTwBzl9Cta68RdnDHmWQAtz3WyOjRTTodZYSsRvZoRbLvWemeU7vDw8P2e532eETtSjZmf931/d31HtkguHdIWUw3oWmttm60NDQ1dVS6XZat6V8EOTMplitwpNJ5K7ALwQg5Da7XWszbnxphRAE/lwIxSnQnd5mMVGYWsZ///MvMK3/ePiFVjjFyADLSBvCyo0vuzj1VCo3J5kflgi5lPE9EKIprHzFIqtKO1PtiqWzLGyIb6oRyW5ZynBOCOHBhRqmNa61nHnhedjQZBcDsRycS7pg0E8kD+LZse3/d/agS5/I7XG0JpI4B9ebqsQN1NWuuWly2X7xVTvfestXfXarWDRHRTgT2aCMXMv3metzJp/5F4SymWhoaG5pfLZVlpL9k1a7VaVRs2bEi89HZyIOwu2b1tukQX3TL3OHGYsjw1GBwc7Oro6Kg7UthTA7mhn5yc3NfX1ycPQ5xbmhGYBSqPPYhINkMPAJDHHrJ4pWlTAOShx1FmvnSPPVoxbHxu43neAmauP7eRf2nTz2yI6FStViv0uc1/ndZCH8rgOooAAAAASUVORK5CYII="},"7Cbv":function(Ge,We,X){"use strict";var de=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),V=new Uint8Array(16);function O(){if(!de)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return de(V)}var H=/^(?:[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 A(I){return typeof I=="string"&&H.test(I)}for(var k=A,W=[],U=0;U<256;++U)W.push((U+256).toString(16).substr(1));function P(I){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,T=(W[I[w+0]]+W[I[w+1]]+W[I[w+2]]+W[I[w+3]]+"-"+W[I[w+4]]+W[I[w+5]]+"-"+W[I[w+6]]+W[I[w+7]]+"-"+W[I[w+8]]+W[I[w+9]]+"-"+W[I[w+10]]+W[I[w+11]]+W[I[w+12]]+W[I[w+13]]+W[I[w+14]]+W[I[w+15]]).toLowerCase();if(!k(T))throw TypeError("Stringified UUID is invalid");return T}var L=P;function b(I,w,T){I=I||{};var y=I.random||(I.rng||O)();if(y[6]=y[6]&15|64,y[8]=y[8]&63|128,w){T=T||0;for(var u=0;u<16;++u)w[T+u]=y[u];return w}return L(y)}var E=We.a=b},"7ZXX":function(Ge,We,X){Ge.exports=X.p+"static/err.6e7c5817.png"},"7ahc":function(Ge,We,X){"use strict";X.d(We,"a",function(){return m});var de=X("k1fw"),V=X("0Owb"),O=X("+L6B"),H=X("2/Rp"),A=X("y8nQ"),k=X("Vl3Y"),W=X("tJVT"),U=X("OaEy"),P=X("2fM7"),L=X("q1tI"),b=X.n(L),E=X("VrN/"),I=X.n(E),w=X("p77/"),T=X.n(w),y=X("c5Ni"),u=X.n(y),a=P.a.Option,l={labelCol:{span:4},wrapperCol:{span:20}},s={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"]};We.b=function(d){var f=d.callback,D=d.onCancel,v=Object(L.useState)("python"),h=Object(W.a)(v,2),p=h[0],c=h[1];function o(g){c(s[g][1])}function x(g){f(g)}return b.a.createElement(k.a,Object(V.a)({},l,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:x}),b.a.createElement(k.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},b.a.createElement(P.a,{onChange:o},Object.keys(s).map(function(g){return b.a.createElement(a,{key:g,value:g},s[g][0])}))),b.a.createElement(k.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},b.a.createElement(m,{mode:p})),b.a.createElement("div",{className:"flex-container flex-end"},b.a.createElement(H.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),b.a.createElement(H.a,{type:"ghost",onClick:D},"\u53D6\u6D88")))};function m(d){var f=d.value,D=d.onChange,v=d.mode,h=d.options,p=h===void 0?{}:h,c=Object(L.useRef)(),o=Object(L.useState)(),x=Object(W.a)(o,2),g=x[0],C=x[1];return Object(L.useEffect)(function(){if(g){function _(z){var Y=z.getValue();D&&D(Y)}return g.on("change",_),function(){g.off("change",_)}}},[g,D]),Object(L.useEffect)(function(){g&&g.setOption("mode",v)},[g,v]),Object(L.useEffect)(function(){g&&((f!==g.getValue()||f==="")&&setTimeout(function(){g.setValue(f||" ")},300))},[g,f]),Object(L.useEffect)(function(){if(c.current&&!g){var _=I.a.fromTextArea(c.current,Object(de.a)({mode:v,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},p));C(_)}},[c.current,g]),b.a.createElement("div",{className:"my-codemirror-container"},b.a.createElement("textarea",{ref:c}))}},"7ixt":function(Ge,We,X){"use strict";X.d(We,"a",function(){return O});var de={adjustX:1,adjustY:1},V=[0,0],O={left:{points:["cr","cl"],overflow:de,offset:[-4,0],targetOffset:V},right:{points:["cl","cr"],overflow:de,offset:[4,0],targetOffset:V},top:{points:["bc","tc"],overflow:de,offset:[0,-4],targetOffset:V},bottom:{points:["tc","bc"],overflow:de,offset:[0,4],targetOffset:V},topLeft:{points:["bl","tl"],overflow:de,offset:[0,-4],targetOffset:V},leftTop:{points:["tr","tl"],overflow:de,offset:[-4,0],targetOffset:V},topRight:{points:["br","tr"],overflow:de,offset:[0,-4],targetOffset:V},rightTop:{points:["tl","tr"],overflow:de,offset:[4,0],targetOffset:V},bottomRight:{points:["tr","br"],overflow:de,offset:[0,4],targetOffset:V},rightBottom:{points:["bl","br"],overflow:de,offset:[4,0],targetOffset:V},bottomLeft:{points:["tl","bl"],overflow:de,offset:[0,4],targetOffset:V},leftBottom:{points:["br","bl"],overflow:de,offset:[-4,0],targetOffset:V}},H=O},"7qnI":function(Ge,We,X){"use strict";var de=X("5Dmo"),V=X("3S7+"),O=X("fWQN"),H=X("mtLc"),A=X("yKVA"),k=X("879j"),W=X("5NDa"),U=X("5rEg"),P=X("q1tI"),L=X.n(P),b=X("O2Wb"),E=X.n(b),I=U.a.TextArea,w=function(T){Object(A.a)(u,T);var y=Object(k.a)(u);function u(){return Object(O.a)(this,u),y.apply(this,arguments)}return Object(H.a)(u,[{key:"render",value:function(){var l=this,s=this.props,m=s.index,d=s.onAnswerChange,f=s.addChildAnswer,D=s.exerciseIsPublish,v=s.answers,h=s.activeOptionErrorIndex,p=s.flex,c=p===void 0?"0 0 1000px":p;return L.a.createElement("div",{className:E.a.flex},L.a.createElement("div",{className:"".concat(E.a.color666," mb5 mt6"),style:{flex:"0 0 90px"}},"\u7B54\u6848(\u586B\u7A7A",m+1,"):"),L.a.createElement("div",{className:"".concat(E.a.flex," ").concat(E.a.flex1),style:{flexDirection:"column"}},v.map(function(o,x){var g="".concat(m,"-").concat(x);return L.a.createElement("div",{className:"".concat(E.a.flex," ").concat(E.a.flex1),key:x},L.a.createElement("div",{className:E.a.flex1,style:{flex:c}},L.a.createElement("div",null,L.a.createElement(I,{className:g===h?E.a.error:"",spellCheck:!1,rows:4,value:o||"",defaultValue:"\u8BF7\u8F93\u5165\u53C2\u8003\u7B54\u6848".concat(x==0?"":"(\u53EF\u9009)"),onChange:function(_){return d(m,x,_.target.value)},style:{minHeight:95}}))),!D&&L.a.createElement(L.a.Fragment,null,x!=0&&L.a.createElement(V.a,{title:"\u5220\u9664"},L.a.createElement("i",{className:"".concat(E.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return l.props.deleteChildAnswer(m,x)},style:{float:"right"}})),x===0&&L.a.createElement(V.a,{title:"\u5220\u9664"},L.a.createElement("i",{className:"".concat(E.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return l.props.deleteChildAnswermain(m,x)},style:{float:"right"}})),L.a.createElement(V.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},L.a.createElement("i",{className:"".concat(E.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return f(m)},style:{float:"right",visibility:x==v.length-1?"":"hidden"}}))))})))}}]),u}(P.Component);We.a=w},"7v3h":function(Ge,We,X){Ge.exports=X.p+"static/empty2.dd73f390.png"},"8/bI":function(Ge,We,X){Ge.exports=X.p+"static/empty.8918e228.png"},"8EBN":function(Ge,We,X){(function(de){de(X("VrN/"))})(function(de){"use strict";de.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 V=0;V<de.modeInfo.length;V++){var O=de.modeInfo[V];O.mimes&&(O.mime=O.mimes[0])}de.findModeByMIME=function(H){H=H.toLowerCase();for(var A=0;A<de.modeInfo.length;A++){var k=de.modeInfo[A];if(k.mime==H)return k;if(k.mimes){for(var W=0;W<k.mimes.length;W++)if(k.mimes[W]==H)return k}}if(/\+xml$/.test(H))return de.findModeByMIME("application/xml");if(/\+json$/.test(H))return de.findModeByMIME("application/json")},de.findModeByExtension=function(H){H=H.toLowerCase();for(var A=0;A<de.modeInfo.length;A++){var k=de.modeInfo[A];if(k.ext){for(var W=0;W<k.ext.length;W++)if(k.ext[W]==H)return k}}},de.findModeByFileName=function(H){for(var A=0;A<de.modeInfo.length;A++){var k=de.modeInfo[A];if(k.file&&k.file.test(H))return k}var W=H.lastIndexOf("."),U=W>-1&&H.substring(W+1,H.length);if(U)return de.findModeByExtension(U)},de.findModeByName=function(H){H=H.toLowerCase();for(var A=0;A<de.modeInfo.length;A++){var k=de.modeInfo[A];if(k.name.toLowerCase()==H)return k;if(k.alias){for(var W=0;W<k.alias.length;W++)if(k.alias[W].toLowerCase()==H)return k}}}})},"8hTe":function(Ge,We,X){Ge.exports={button:"button___1wy9m"}},"9Bee":function(Ge,We,X){"use strict";var de=X("DYRE"),V=X("zeV3"),O=X("+L6B"),H=X("2/Rp"),A=X("k1fw"),k=X("9og8"),W=X("tJVT"),U=X("WmNS"),P=X.n(U),L=X("q1tI"),b=X.n(L),E=X("vg9a"),I=X("DlQD"),w=X.n(I),T=X("rUJ1");function y(le,Z){var q=le.match(/^(\s+)(?:```)/);if(q===null)return Z;var ne=q[1];return Z.split(`
`).map(function(ue){var ee=ue.match(/^\s+/);if(ee===null)return ue;var ie=Object(W.a)(ee,1),ce=ie[0];return ce.length>=ne.length?ue.slice(ne.length):ue}).join(`
`)}var u=[],a=["<ul>"],l=new w.a.Renderer,s=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function m(){u.length=0,a=["<ul>"]}var d={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function f(le,Z,q,ne){if(Z>=le.length||le[Z].level<=q)return Z;var ue=le[Z];ne.push("<li><a href='#"+ue.anchor+"'>"+ue.text+"</a>"),Z++;var ee=[];return Z=f(le,Z,ue.level,ee),ee.length>0&&(ne.push("<ul>"),ee.forEach(function(ie){ne.push(ie)}),ne.push("</ul>")),ne.push("</li>"),Z=f(le,Z,q,ne),Z}function D(){return f(u,0,0,a),a.push("</ul>"),a.join("")}var v={heading:function(Z){var q=s.exec(Z);if(q)return{type:"heading",raw:q[0],depth:q[1].length,text:q[2]}},fences:function(Z){var q=this.rules.block.fences.exec(Z);if(q){var ne=q[0],ue=y(ne,q[3]||""),ee=q[2]?q[2].trim():q[2];if(["latex","katex","math"].indexOf(ee)>=0){var ie=c(),ce=ue;ue=ie,o[ie]={type:"block",expression:ce}}return{type:"code",raw:ne,lang:ee,text:ue}}}},h=/(?:\${2})([^\n`]+?)(?:\${2})/gi,p=0,c=function(){return"__special_katext_id_".concat(p++,"__")},o={};function x(){return o}function g(){p=0,o={}}function C(le){return le=le.replace(h,function(Z,q){var ne=c();return o[ne]={type:"inline",expression:q},ne}),le}var _=l.listitem;l.listitem=function(le){return _(C(le))};var z=l.paragraph;l.paragraph=function(le){return z(C(le))};var Y=l.tablecell;l.tablecell=function(le,Z){return Y(C(le),Z)},l.code=function(le,Z,q){var ne=(Z||"").match(/\S*/)[0];return ne?["latex","katex","math"].indexOf(ne)>=0?"<p class='editormd-tex'>".concat(le,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(Z,'">').concat(q?le:Object(T.escape)(le,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(q?le:Object(T.escape)(le,!0))+"</code></pre>"},l.heading=function(le,Z,q){var ne=this.options.headerPrefix+q.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return u.push({anchor:ne,level:Z,text:le}),"<h"+Z+' id="'+ne+'">'+le+"</h"+Z+">"},w.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),w.a.use({tokenizer:v,renderer:l});var oe=w.a,G=X("SJMd"),j=X("ulZh"),se=X.n(j),fe=X("m3rI"),Se=X("Oy/b"),ke=X("p5ED"),Je=X("ErOA"),_e=X("STEk");/* **********************************
cropro version 1.2.0
@license SEE LICENSE IN LICENSE
copyright Alan Mendelevich
see README and LICENSE for details
********************************** *//*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var Qe=function(le,Z){return(Qe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(q,ne){q.__proto__=ne}||function(q,ne){for(var ue in ne)Object.prototype.hasOwnProperty.call(ne,ue)&&(q[ue]=ne[ue])})(le,Z)};function Ue(le,Z){if(typeof Z!="function"&&Z!==null)throw new TypeError("Class extends value "+String(Z)+" is not a constructor or null");function q(){this.constructor=le}Qe(le,Z),le.prototype=Z===null?Object.create(Z):(q.prototype=Z.prototype,new q)}function Fe(le,Z,q,ne){return new(q||(q=Promise))(function(ue,ee){function ie(xe){try{pe(ne.next(xe))}catch(De){ee(De)}}function ce(xe){try{pe(ne.throw(xe))}catch(De){ee(De)}}function pe(xe){var De;xe.done?ue(xe.value):(De=xe.value,De instanceof q?De:new q(function(Be){Be(De)})).then(ie,ce)}pe((ne=ne.apply(le,Z||[])).next())})}function we(le,Z){var q,ne,ue,ee,ie={label:0,sent:function(){if(1&ue[0])throw ue[1];return ue[1]},trys:[],ops:[]};return ee={next:ce(0),throw:ce(1),return:ce(2)},typeof Symbol=="function"&&(ee[Symbol.iterator]=function(){return this}),ee;function ce(pe){return function(xe){return function(De){if(q)throw new TypeError("Generator is already executing.");for(;ie;)try{if(q=1,ne&&(ue=2&De[0]?ne.return:De[0]?ne.throw||((ue=ne.return)&&ue.call(ne),0):ne.next)&&!(ue=ue.call(ne,De[1])).done)return ue;switch(ne=0,ue&&(De=[2&De[0],ue.value]),De[0]){case 0:case 1:ue=De;break;case 4:return ie.label++,{value:De[1],done:!1};case 5:ie.label++,ne=De[1],De=[0];continue;case 7:De=ie.ops.pop(),ie.trys.pop();continue;default:if(!(ue=ie.trys,(ue=ue.length>0&&ue[ue.length-1])||De[0]!==6&&De[0]!==2)){ie=0;continue}if(De[0]===3&&(!ue||De[1]>ue[0]&&De[1]<ue[3])){ie.label=De[1];break}if(De[0]===6&&ie.label<ue[1]){ie.label=ue[1],ue=De;break}if(ue&&ie.label<ue[2]){ie.label=ue[2],ie.ops.push(De);break}ue[2]&&ie.ops.pop(),ie.trys.pop();continue}De=Z.call(le,ie)}catch(Be){De=[6,Be],ne=0}finally{q=ue=0}if(5&De[0])throw De[1];return{value:De[0]?De[1]:void 0,done:!0}}([pe,xe])}}}var F=function(){function le(){}return le.addKey=function(Z){le.key=Z},Object.defineProperty(le,"isLicensed",{get:function(){return!!le.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(le.key)},enumerable:!1,configurable:!0}),le}(),R=function(){function le(){}return le.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},le.setAttributes=function(Z,q){for(var ne=0,ue=q;ne<ue.length;ne++){var ee=ue[ne],ie=ee[0],ce=ee[1];Z.setAttribute(ie,ce)}},le.createRect=function(Z,q,ne){var ue=document.createElementNS("http://www.w3.org/2000/svg","rect");return ue.setAttribute("width",Z.toString()),ue.setAttribute("height",q.toString()),ne&&le.setAttributes(ue,ne),ue},le.createLine=function(Z,q,ne,ue,ee){var ie=document.createElementNS("http://www.w3.org/2000/svg","line");return ie.setAttribute("x1",Z.toString()),ie.setAttribute("y1",q.toString()),ie.setAttribute("x2",ne.toString()),ie.setAttribute("y2",ue.toString()),ee&&le.setAttributes(ie,ee),ie},le.createPolygon=function(Z,q){var ne=document.createElementNS("http://www.w3.org/2000/svg","polygon");return ne.setAttribute("points",Z),q&&le.setAttributes(ne,q),ne},le.createCircle=function(Z,q){var ne=document.createElementNS("http://www.w3.org/2000/svg","circle");return ne.setAttribute("cx",(Z/2).toString()),ne.setAttribute("cy",(Z/2).toString()),ne.setAttribute("r",Z.toString()),q&&le.setAttributes(ne,q),ne},le.createEllipse=function(Z,q,ne){var ue=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return ue.setAttribute("cx",(Z/2).toString()),ue.setAttribute("cy",(q/2).toString()),ue.setAttribute("rx",(Z/2).toString()),ue.setAttribute("ry",(q/2).toString()),ne&&le.setAttributes(ue,ne),ue},le.createGroup=function(Z){var q=document.createElementNS("http://www.w3.org/2000/svg","g");return Z&&le.setAttributes(q,Z),q},le.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},le.createMarker=function(Z,q,ne,ue,ee,ie,ce){var pe=document.createElementNS("http://www.w3.org/2000/svg","marker");return le.setAttributes(pe,[["id",Z],["orient",q],["markerWidth",ne.toString()],["markerHeight",ue.toString()],["refX",ee.toString()],["refY",ie.toString()]]),pe.appendChild(ce),pe},le.createText=function(Z){var q=document.createElementNS("http://www.w3.org/2000/svg","text");return q.setAttribute("x","0"),q.setAttribute("y","0"),Z&&le.setAttributes(q,Z),q},le.createTSpan=function(Z,q){var ne=document.createElementNS("http://www.w3.org/2000/svg","tspan");return ne.textContent=Z,q&&le.setAttributes(ne,q),ne},le.createImage=function(Z){var q=document.createElementNS("http://www.w3.org/2000/svg","image");return Z&&le.setAttributes(q,Z),q},le.createPoint=function(Z,q){var ne=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return ne.x=Z,ne.y=q,ne},le.createPath=function(Z,q){var ne=document.createElementNS("http://www.w3.org/2000/svg","path");return ne.setAttribute("d",Z),q&&le.setAttributes(ne,q),ne},le.createElement=function(Z,q){var ne=document.createElementNS("http://www.w3.org/2000/svg",Z);return q&&le.setAttributes(ne,q),ne},le.getHollowRectanglePath=function(Z,q,ne,ue,ee,ie,ce,pe){return"M"+Z+","+q+"V"+(q+ue)+"H"+(Z+ne)+"V"+q+"H"+ee+"V"+ie+"H"+(ee+ce)+"V"+(ie+pe)+"H"+ee+"V"+q+"Z"},le}(),M=function(){function le(Z){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+Z+"_"}return Object.defineProperty(le.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#333333",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarBackgroundActiveColor:"#282828",toolbarColor:"#eeeeee",cropShadeColor:"#ffffff",cropFrameColor:"#ffffff",gripColor:"#333333",gripFillColor:"#cccccc",toolbarHeight:40}},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),le.prototype.addClass=function(Z){return this.styleSheet===void 0&&this.addStyleSheet(),Z.name=""+this.classNamePrefix+Z.localName,this.classes.push(Z),this.styleSheet.sheet.insertRule("."+Z.name+" {"+Z.style+"}",this.styleSheet.sheet.cssRules.length),Z},le.prototype.addRule=function(Z){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(Z),this.styleSheet.sheet.insertRule(Z.selector+" {"+Z.style+"}",this.styleSheet.sheet.cssRules.length)},le.prototype.addStyleSheet=function(){var Z;this.styleSheet=document.createElement("style"),((Z=this.styleSheetRoot)!==null&&Z!==void 0?Z:document.head).appendChild(this.styleSheet),this.addRule(new K("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new K("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new K("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new $("_fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new $("_fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},le.prototype.removeStyleSheet=function(){var Z;this.styleSheet&&(((Z=this.styleSheetRoot)!==null&&Z!==void 0?Z:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},le}(),K=function(le,Z){this.selector=le,this.style=Z},$=function(le,Z){this.localName=le,this.style=Z},B=function(){function le(){this.blocks=[],this.display=""}return le.prototype.addButtonBlock=function(Z){Z.className=this.blockClassName,Z.buttonClassName=this.buttonClassName,Z.buttonColorsClassName=this.buttonColorsClassName,Z.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(Z)},le.prototype.addElementBlock=function(Z){Z.className===void 0&&(Z.className=this.blockClassName),this.blocks.push(Z)},le.prototype.getUI=function(){var Z=document.createElement("div");return Z.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,Z.style.display=this.display,this.blocks.forEach(function(q){return Z.appendChild(q.getUI())}),Z},le}(),ge=function(){function le(){}return le.prototype.getUI=function(){var Z=document.createElement("div");if(Z.className=this.className,this.minWidth!==void 0&&(Z.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":Z.style.justifyContent="flex-start";break;case"center":Z.style.justifyContent="center";break;case"end":Z.style.justifyContent="flex-end"}return Z.style.whiteSpace="nowrap",Z},le}(),Oe=function(le){function Z(){var q=le!==null&&le.apply(this,arguments)||this;return q.buttons=[],q}return Ue(Z,le),Z.prototype.addButton=function(q){q.className=this.buttonClassName,q.colorsClassName=this.buttonColorsClassName,q.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(q)},Z.prototype.getUI=function(){var q=le.prototype.getUI.call(this);return this.buttons.forEach(function(ne){return q.appendChild(ne.getUI())}),q},Z}(ge),je=function(){function le(Z,q){this._isActive=!1,this._isHidden=!1,this._icon=Z,this.title=q,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(le.prototype,"icon",{get:function(){return this._icon},set:function(Z){this._icon=Z,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"isActive",{get:function(){return this._isActive},set:function(Z){this._isActive=Z,this.adjustClassName()},enumerable:!1,configurable:!0}),le.prototype.getUI=function(){var Z=this;return this.buttonContainer=document.createElement("div"),this.buttonContainer.title=this.title,this.buttonContainer.className=this.className+" "+this.colorsClassName,this.adjustClassName(),this.buttonContainer.innerHTML=this._icon,this.onClick&&this.buttonContainer.addEventListener("click",function(){return Z.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},le.prototype.adjustClassName=function(){this.activeColorsClassName&&(this._isActive&&this.buttonContainer.className.indexOf(this.activeColorsClassName)<0?this.buttonContainer.className+=" "+this.activeColorsClassName:this._isActive||(this.buttonContainer.className=this.buttonContainer.className.replace(this.activeColorsClassName,"")))},le.prototype.hide=function(){this._isHidden=!0},le}(),Ze=function(le){function Z(){var q=le!==null&&le.apply(this,arguments)||this;return q.elements=[],q}return Ue(Z,le),Z.prototype.addElement=function(q){this.elements.push(q)},Z.prototype.getUI=function(){var q=le.prototype.getUI.call(this);return this.elements.forEach(function(ne){return q.appendChild(ne)}),q},Z}(ge),He=function(){function le(Z,q){this.horizontal=Z,this.vertical=q}return Object.defineProperty(le.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),le.prototype.getVerticalLength=function(Z){return Z/this.ratio},le.prototype.getHorizontalLength=function(Z){return Z*this.ratio},le}(),ze=function(){function le(){}return le.getIcon=function(Z,q){if(Z>0&&q>0){var ne=new He(Z,q),ue=ne.ratio>=1?20:ne.getHorizontalLength(20),ee=ne.ratio<1?20:ne.getVerticalLength(20),ie=document.createElementNS("http://www.w3.org/2000/svg","svg");ie.setAttribute("xmlns","http://www.w3.org/2000/svg"),ie.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(ie);var ce=R.createDefs();ie.appendChild(ce);var pe=R.createElement("clipPath",[["id","text-bg-clip"]]);ce.appendChild(pe);var xe=R.createPath(R.getHollowRectanglePath((24-ue)/2,(24-ee)/2,ue,ee,(24-ue)/2+2,(24-ee)/2+2,ue-4,ee-4));ie.appendChild(xe);var De=R.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);De.appendChild(R.createTSpan(Z+":"+q)),ie.appendChild(De);var Be=De.getBBox();R.setAttributes(De,[["x",((24-Be.width)/2).toString()],["y",((24-Be.height)/2-Be.y).toString()]]);var $e=R.createPath(R.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Be.width))/2,(24-Math.ceil(Be.height))/2,Math.ceil(Be.width),Math.ceil(Be.height)));return pe.appendChild($e),R.setAttributes(xe,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(ie),ie.outerHTML}return'<svg viewBox="0 0 24 24"><path d="M19 12h-2v3h-3v2h5v-5M7 9h3V7H5v5h2V9m14-6H3a2 2 0 00-2 2v14a2 2 0 002 2h18a2 2 0 002-2V5a2 2 0 00-2-2m0 16H3V5h18v14z"/></svg>'},le}(),Xe=function(le){function Z(q,ne,ue){var ee=le.call(this,q,ne)||this;return ee.isDropdownOpen=!1,ee.onClick=ee.dropdownButtonClicked,ee.dropdownButtons=ue,ee}return Ue(Z,le),Z.prototype.setupDropdown=function(){var q=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(ne){ne.className=q.className,ne.colorsClassName=q.colorsClassName,q.dropdownBlock.appendChild(ne.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},Z.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},Z.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},Z.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},Z.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},Z.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},Z}(je),dt=function(){function le(Z,q){this.GRIP_SIZE=10,this.color=Z,this.fillColor=q,this.visual=R.createGroup(),this.visual.appendChild(R.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(R.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return le.prototype.ownsTarget=function(Z){return Z===this.visual||Z===this.visual.childNodes[0]||Z===this.visual.childNodes[1]},le.prototype.setCenter=function(Z,q){this.visual.childNodes.forEach(function(ne){return R.setAttributes(ne,[["cx",Z.toString()],["cy",q.toString()]])})},le}(),ct=function(){function le(Z,q,ne,ue){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=Z,this.canvasHeight=q,this.margin=ne,this.container=ue,this.attachEvents=this.attachEvents.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.resize=this.resize.bind(this),this.adjustCropRect=this.adjustCropRect.bind(this),this.scaleCanvas=this.scaleCanvas.bind(this),this.getRescaledRect=this.getRescaledRect.bind(this)}return Object.defineProperty(le.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(Z){this._aspectRatio=Z,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(Z){this._isGridVisible=Z,this.gridContainer&&R.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(Z){this._zoomFactor=Z,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),le.prototype.open=function(){var Z=this;this.cropShadeElement=R.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=R.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var q=0;q<this.numberOfGridLines;q++)this.horizontalGridLines.push(R.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(R.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(ne){return Z.gridContainer.appendChild(ne)}),this.verticalGridLines.forEach(function(ne){return Z.gridContainer.appendChild(ne)}),this.cropRectElement=R.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new dt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new dt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new dt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new dt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},le.prototype.setCropRectangle=function(Z){this.cropRect=Z;var q=Object.assign({},this.cropRect);this.zoomFactor!==1&&(q.width=this.cropRect.width*this.zoomFactor,q.height=this.cropRect.height*this.zoomFactor,q.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-q.width/2,q.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-q.height/2),R.setAttributes(this.cropRectElement,[["x",q.x.toString()],["y",q.y.toString()],["width",q.width.toString()],["height",q.height.toString()]]);var ne=q.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(ee,ie){var ce=q.y+ne*(ie+1);R.setAttributes(ee,[["x1",""+q.x],["y1",""+ce],["x2",""+(q.x+q.width)],["y2",""+ce]])});var ue=q.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(ee,ie){var ce=q.x+ue*(ie+1);R.setAttributes(ee,[["x1",""+ce],["y1",""+q.y],["x2",""+ce],["y2",""+(q.y+q.height)]])}),R.setAttributes(this.cropShadeElement,[["d",R.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,q.x,q.y,q.width,q.height)]]),this.topLeftGrip.setCenter(q.x,q.y),this.topRightGrip.setCenter(q.x+q.width,q.y),this.bottomLeftGrip.setCenter(q.x,q.y+q.height),this.bottomRightGrip.setCenter(q.x+q.width,q.y+q.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},le.prototype.attachEvents=function(){this.container.style.touchAction="none",this.container.addEventListener("pointerdown",this.onPointerDown),this.container.addEventListener("pointermove",this.onPointerMove),this.container.addEventListener("pointerup",this.onPointerUp)},le.prototype.clientToLocalCoordinates=function(Z,q){var ne=this.container.getBoundingClientRect();return{x:Z-ne.left+this.margin,y:q-ne.top+this.margin}},le.prototype.onPointerDown=function(Z){this.container.setPointerCapture(Z.pointerId),this.previousPoint=this.clientToLocalCoordinates(Z.clientX,Z.clientY),this.cropRectElement===Z.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(Z.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(Z.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(Z.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(Z.target)&&(this.activeGrip=this.bottomRightGrip)},le.prototype.onPointerMove=function(Z){if(this.isMoving)this.move(this.clientToLocalCoordinates(Z.clientX,Z.clientY));else if(this.activeGrip){var q=this.clientToLocalCoordinates(Z.clientX,Z.clientY);this.resize(q)}Z.preventDefault()},le.prototype.onPointerUp=function(Z){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(Z.pointerId)},le.prototype.move=function(Z){var q=Z.x-this.previousPoint.x,ne=Z.y-this.previousPoint.y;this.zoomFactor!==1&&(q=-q/this.zoomFactor,ne=-ne/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+q),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+ne),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=Z},le.prototype.resize=function(Z){var q=Object.assign({},this.cropRect),ne=Z.x-this.previousPoint.x,ue=Z.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:q.x+ne<this.margin&&(ne=this.margin-q.x),q.x+=ne,q.width=this.cropRect.x+this.cropRect.width-q.x;break;case this.bottomRightGrip:case this.topRightGrip:q.width+ne>this.canvasWidth*this.zoomFactor&&(ne=this.canvasWidth*this.zoomFactor-q.width),q.width+=ne}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(q.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(ne),q.height=this.aspectRatio.getVerticalLength(q.width)):(q.y+=ue,q.height=this.cropRect.y+this.cropRect.height-q.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?q.height=this.aspectRatio.getVerticalLength(q.width):q.height+=ue}q.width<10&&(q.x=this.cropRect.x,q.width=10),q.height<10&&(q.y=this.cropRect.y,q.height=10),this.previousPoint=Z,q.x>=this.margin&&q.y>=this.margin&&q.x-this.margin+q.width<=this.canvasWidth&&q.y-this.margin+q.height<=this.canvasHeight&&(this.cropRect=q,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},le.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var Z=this.cropRect.x+this.cropRect.width/2,q=this.cropRect.y+this.cropRect.height/2,ne=this.aspectRatio.getHorizontalLength(this.cropRect.height),ue=this.aspectRatio.getVerticalLength(this.cropRect.width);ne/this.canvasWidth<ue/this.canvasHeight?this.cropRect.width=ne:this.cropRect.height=ue,this.cropRect.width>this.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=Z-this.cropRect.width/2,this.cropRect.y=q-this.cropRect.height/2,this.cropRect.x+this.cropRect.width>this.margin+this.canvasWidth&&(this.cropRect.x=this.margin+this.canvasWidth-this.cropRect.width),this.cropRect.y+this.cropRect.height>this.margin+this.canvasHeight&&(this.cropRect.y=this.margin+this.canvasHeight-this.cropRect.height),this.cropRect.x=Math.max(this.cropRect.x,this.margin),this.cropRect.y=Math.max(this.cropRect.y,this.margin)}},le.prototype.getRescaledRect=function(Z,q,ne,ue,ee,ie){var ce=ne/Z,pe=ue/q;return{x:(ee.x-ie)*ce+ie,y:(ee.y-ie)*pe+ie,width:ee.width*ce,height:ee.height*pe}},le.prototype.scaleCanvas=function(Z,q){var ne=this.getRescaledRect(this.canvasWidth,this.canvasHeight,Z,q,this.cropRect,this.margin);this.canvasWidth=Z,this.canvasHeight=q,this.onCropChange&&this.onCropChange(ne),this.setCropRectangle(ne)},le}(),gt=function(){function le(Z){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=Z,this.uiContainer=document.createElement("div"),this.getUI=this.getUI.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.setAngleLabel=this.setAngleLabel.bind(this),this.positionScaleShape=this.positionScaleShape.bind(this)}return Object.defineProperty(le.prototype,"angle",{get:function(){return this._angle},set:function(Z){this._angle=Z,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),le.prototype.getUI=function(){return this.controlContainer=document.createElement("div"),this.controlContainer.title=this.title,this.controlContainer.className=this.className+" "+this.colorsClassName,this.controlContainer.appendChild(this.getVisual()),this.controlContainer.addEventListener("pointerdown",this.onPointerDown),this.controlContainer.addEventListener("pointermove",this.onPointerMove),this.controlContainer.addEventListener("pointerup",this.onPointerUp),this.uiContainer.appendChild(this.controlContainer),this.uiContainer.style.display="inline-block",this.uiContainer.style.touchAction="none",this.setAngleLabel(),this.positionScaleShape(),this.uiContainer},le.prototype.onPointerDown=function(Z){this.controlContainer.setPointerCapture(Z.pointerId),this.isDragging=!0,this.previousPoint={x:Z.clientX,y:Z.clientY}},le.prototype.onPointerMove=function(Z){this.isDragging&&(this.onAngleChange&&this.onAngleChange((Z.clientX-this.previousPoint.x)/5),this.previousPoint.x=Z.clientX)},le.prototype.onPointerUp=function(Z){this.isDragging&&this.onAngleChange&&this.onAngleChange((Z.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(Z.pointerId)},le.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var Z=this.angleLabelText.getBBox();R.setAttributes(this.angleLabelElement,[["x",((this.width-Z.width)/2).toString()],["y",(this.height/2).toString()]])}},le.prototype.positionScaleShape=function(){if(this.scaleShape){var Z=this.scaleShape.transform.baseVal.getItem(0);Z.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(Z,0)}},le.prototype.getVisual=function(){var Z=document.createElementNS("http://www.w3.org/2000/svg","svg");Z.setAttribute("xmlns","http://www.w3.org/2000/svg"),Z.setAttribute("width",this.width+"px"),Z.setAttribute("height",this.height+"px"),Z.setAttribute("viewBox","0 0 "+this.width+" "+this.height),Z.style.flexShrink="0",document.body.appendChild(Z);for(var q="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,ne=1;ne<=this.width/5+10;ne++){var ue=ne%5==0?this.height/3:this.height/6;q+="h4v"+-ue+"h1v"+ue}q+="v1H0Z",this.scaleShape=R.createPath(q);var ee=R.createTransform();this.scaleShape.transform.baseVal.appendItem(ee),Z.appendChild(this.scaleShape),this.angleLabelElement=R.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=R.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var ie=R.createTSpan("");return ie.innerHTML="&deg;",this.angleLabelElement.appendChild(ie),Z.appendChild(this.angleLabelElement),document.body.removeChild(Z),Z},le}(),at=function(){function le(){this.naturalSize=!1,this.imageType="image/png"}return le.prototype.rasterize=function(Z,q,ne,ue,ee,ie,ce){var pe=this;return new Promise(function(xe){var De=document.createElement("canvas");De.width=Z.width.baseVal.value-2*ue,De.height=Z.height.baseVal.value-2*ue;var Be=1,$e=1;pe.naturalSize===!0?(Be=q.naturalWidth/(Z.width.baseVal.value-2*ue)/ie,$e=q.naturalHeight/(Z.height.baseVal.value-2*ue)/ce,De.width=q.naturalWidth/ie,De.height=q.naturalHeight/ce):pe.width!==void 0&&pe.height!==void 0&&(Be=pe.width/ne.width,$e=pe.height/ne.height,De.width*=Be,De.height*=$e);var pt=De.getContext("2d");pt.translate(De.width/2,De.height/2),pt.rotate(ee*Math.PI/180),pt.scale(ie,ce),pt.translate(-De.width/2,-De.height/2),pt.drawImage(q,0,0,De.width,De.height);var xt=document.createElement("canvas");xt.width=ne.width*Be,xt.height=ne.height*$e,xt.getContext("2d").putImageData(pt.getImageData((ne.x-ue)*Be,(ne.y-ue)*$e,ne.width*Be,ne.height*$e),0,0),xe(xt.toDataURL(pe.imageType,pe.imageQuality))})},le}(),ft=function(){function le(Z){this._zoomToCropEnabled=!0,this.zoomFactor=1,this.flippedHorizontally=!1,this.flippedVertically=!1,this._isGridVisible=!0,this._gridLines=2,this._rotationAngle=0,this.scaleFactor=1,this.renderEventListeners=[],this.closeEventListeners=[],this._isOpen=!1,this.CANVAS_MARGIN=20,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.displayMode="inline",this.popupMargin=30,this.toolbarHeight=40,this.aspectRatios=[{horizontal:0,vertical:0},{horizontal:4,vertical:3},{horizontal:3,vertical:2},{horizontal:16,vertical:9},{horizontal:1,vertical:1},{horizontal:3,vertical:4},{horizontal:2,vertical:3},{horizontal:9,vertical:16}],this._instanceNo=le.instanceCounter++,this.styles=new M(this.instanceNo),this.target=Z,this.targetRoot=document.body,this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.rotateBy=this.rotateBy.bind(this),this.applyRotation=this.applyRotation.bind(this),this.cropRectChanged=this.cropRectChanged.bind(this),this.zoomToCrop=this.zoomToCrop.bind(this),this.unzoomFromCrop=this.unzoomFromCrop.bind(this),this.rotateLeftButtonClicked=this.rotateLeftButtonClicked.bind(this),this.rotateRightButtonClicked=this.rotateRightButtonClicked.bind(this),this.flipHorizontallyButtonClicked=this.flipHorizontallyButtonClicked.bind(this),this.flipVerticallyButtonClicked=this.flipVerticallyButtonClicked.bind(this),this.applyFlip=this.applyFlip.bind(this),this.startRenderAndClose=this.startRenderAndClose.bind(this),this.render=this.render.bind(this),this.onPopupResize=this.onPopupResize.bind(this),this.applyAspectRatio=this.applyAspectRatio.bind(this)}return Object.defineProperty(le.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(Z){this._zoomToCropEnabled=Z,Z?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(Z){this._isGridVisible=Z,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"gridLines",{get:function(){return this._gridLines},set:function(Z){this._gridLines=Z,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(Z){this._rotationAngle=Z,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"aspectRatio",{get:function(){var Z;return(Z=this._aspectRatio)!==null&&Z!==void 0?Z:this.aspectRatios[0]},set:function(Z){this._aspectRatio=Z},enumerable:!1,configurable:!0}),le.prototype.open=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.setupResizeObserver(),this.initCropCanvas(),this.setEditingTarget(),this.setTopLeft(),this.initCropLayer(),this.attachEvents(),this.applyAspectRatio(),this.displayMode==="popup"&&this.onPopupResize(),this._isOpen=!0},le.prototype.show=function(){this.showUI(),this.open()},le.prototype.close=function(Z){Z===void 0&&(Z=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),Z||this.closeEventListeners.forEach(function(q){return q()}),this._isOpen=!1)},le.prototype.addRenderEventListener=function(Z){this.renderEventListeners.push(Z)},le.prototype.removeRenderEventListener=function(Z){this.renderEventListeners.indexOf(Z)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(Z),1)},le.prototype.addCloseEventListener=function(Z){this.closeEventListeners.push(Z)},le.prototype.removeCloseEventListener=function(Z){this.closeEventListeners.indexOf(Z)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(Z),1)},le.prototype.setupResizeObserver=function(){var Z=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){Z.resize(Z.target.clientWidth,Z.target.clientHeight)}),this.targetObserver.observe(this.target)):this.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},le.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var Z=1*this.target.clientWidth/this.target.clientHeight,q=this.contentDiv.clientWidth/Z>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*Z:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,ne=q+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/Z;this.resize(q,ne)}},le.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},le.prototype.setEditingTargetSize=function(){this.editorCanvas.style.width=this.imageWidth+2*this.CANVAS_MARGIN+"px",this.editorCanvas.style.height=this.imageHeight+2*this.CANVAS_MARGIN+"px",R.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},le.prototype.resize=function(Z,q){this.imageWidth=Math.round(Z),this.imageHeight=Math.round(q),this.setEditingTargetSize(),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.displayMode!=="popup"?this.coverDiv.style.width=this.paddedImageWidth+"px":(this.setTopLeft(),this.positionCropImage()),this.cropLayer.scaleCanvas(this.imageWidth,this.imageHeight),this.applyRotation()},le.prototype.setEditingTarget=function(){var Z=document.createElement("canvas");Z.width=this.target.naturalWidth,Z.height=this.target.naturalHeight,Z.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var q=Z.toDataURL();R.setAttributes(this.editingTarget,[["href",q]]),this.setEditingTargetSize()},le.prototype.setTopLeft=function(){var Z=this.target.getBoundingClientRect(),q=this.editorCanvas.getBoundingClientRect();this.left=Z.left-q.left-this.CANVAS_MARGIN,this.top=Z.top-q.top-this.CANVAS_MARGIN},le.prototype.initCropCanvas=function(){this.cropImageHolder=document.createElement("div"),this.cropImageHolder.style.setProperty("touch-action","none"),this.cropImageHolder.style.setProperty("-ms-touch-action","none"),this.cropImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.cropImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImage.style.pointerEvents="auto",this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.cropImageHolder.style.transformOrigin="top left",this.positionCropImage(),this.defs=R.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=R.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=R.createGroup(),this.editingTargetRotationScaleContainer=R.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var Z=R.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(Z);var q=R.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(q),this.editingTargetContainer=R.createGroup(),this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px)",this.editingTargetContainer.appendChild(this.editingTargetRotationContainer),this.cropImage.appendChild(this.editingTargetContainer),this.cropImageHolder.appendChild(this.cropImage),this.editorCanvas.appendChild(this.cropImageHolder)},le.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},le.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=R.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new ct(this.imageWidth,this.imageHeight,this.CANVAS_MARGIN,this.cropLayerContainer),this.cropLayer.onCropChange=this.cropRectChanged,this.cropLayer.numberOfGridLines=this.gridLines,this.cropLayer.isGridVisible=this.isGridVisible,this.cropLayer.cropShadeColor=this.styles.settings.cropShadeColor,this.cropLayer.cropFrameColor=this.styles.settings.cropFrameColor,this.cropLayer.gripColor=this.styles.settings.gripColor,this.cropLayer.gripFillColor=this.styles.settings.gripFillColor,this.cropLayer.open(),this.cropLayer.setCropRectangle(this.cropRect),this.zoomToCropEnabled&&this.zoomToCrop()},le.prototype.zoomToCrop=function(){if(this.cropRect){var Z=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,q=this.cropRect.y-this.CANVAS_MARGIN+this.cropRect.height/2;this.zoomFactor=Math.min(this.imageWidth/this.cropRect.width,this.imageHeight/this.cropRect.height),this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin=Z+"px "+q+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-Z+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-q+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},le.prototype.unzoomFromCrop=function(){this.zoomFactor=1,this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin="center",this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px) scale(1)",this.cropLayer.zoomFactor=this.zoomFactor)},le.prototype.cropRectChanged=function(Z){this.cropRect=Z,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},le.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},le.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},le.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},le.prototype.showUI=function(){switch(this.addStyles(),this.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.displayMode){case"inline":this.coverDiv.style.position="absolute";var Z=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,q=this.target.offsetTop>Z+this.CANVAS_MARGIN?this.target.offsetTop-(Z+this.CANVAS_MARGIN):0;this.coverDiv.style.top=q+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.displayMode==="popup"?this.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.addToolbars(),this.uiDiv.appendChild(this.topToolbar.getUI()),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.alignItems="center",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.contentDiv.style.overflow="hidden",this.contentDiv.style.backgroundColor=this.styles.settings.canvasBackgroundColor,this.displayMode==="popup"&&(this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.popupMargin+"px)"),this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.contentDiv.appendChild(this.editorCanvas),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},le.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},le.prototype.addTopToolbar=function(){var Z=this;this.topToolbar=new B,this.topToolbar.display=this.styles.settings.hideTopToolbar?"none":"",this.topToolbar.className=this.toolbarStyleClass.name,this.topToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.topToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.topToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.topToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.topToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.topToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var q=new Oe;q.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(q);var ne=[];this.aspectRatios.forEach(function($e){var pt=new je(ze.getIcon($e.horizontal,$e.vertical),$e.horizontal===0&&$e.vertical===0?"FREE":$e.horizontal+":"+$e.vertical);pt.onClick=function(){return Z.ratioButtonClicked($e)},ne.push(pt)}),this.aspectRatioButton=new Xe(ze.getIcon(0,0),"Aspect ratio",ne),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,q.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var ue=new je('<svg viewBox="0 0 24 24"><path d="M10 4v4h4V4h-4m6 0v4h4V4h-4m0 6v4h4v-4h-4m0 6v4h4v-4h-4m-2 4v-4h-4v4h4m-6 0v-4H4v4h4m0-6v-4H4v4h4m0-6V4H4v4h4m2 6h4v-4h-4v4M4 2h16a2 2 0 012 2v16a2 2 0 01-2 2H4c-1.08 0-2-.9-2-2V4a2 2 0 012-2z"/></svg>',"Toggle grid");ue.isActive=this.isGridVisible,ue.onClick=function(){Z.isGridVisible=!Z.isGridVisible,ue.isActive=Z.isGridVisible},q.addButton(ue);var ee=new je('<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"Zoom to selection");if(ee.isActive=this.zoomToCropEnabled,ee.onClick=function(){Z.zoomToCropEnabled=!Z.zoomToCropEnabled,ee.isActive=Z.zoomToCropEnabled},q.addButton(ee),!F.isLicensed){var ie=new Ze;this.topToolbar.addElementBlock(ie);var ce=document.createElement("div");ce.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var pe=document.createElement("a");pe.style.color="currentColor",pe.href="https://markerjs.com/products/cropro",pe.target="_blank",pe.innerHTML='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2"><path d="M16.326 14.895c0 1.126-.558 1.688-1.673 1.688H9.931c-1.116 0-1.674-.562-1.674-1.688V3.733c0-1.126.558-1.688 1.674-1.688h4.722c1.115 0 1.673.562 1.673 1.688v2.899h-1.957V3.793h-4.124v11.042h4.124v-3.242h1.957v3.302z" fill="currentColor"/><path d="M15.94 7.364a.783.783 0 00-1.065-.304l-11.01 6.126a.783.783 0 00-.303 1.065l4.498 8.085a.783.783 0 001.065.304l11.01-6.126a.783.783 0 00.303-1.065L15.94 7.364zM5.311 14.173l3.737 6.718 9.641-5.364-3.737-6.718-9.641 5.364z" fill="#eef762"/></svg>',ce.appendChild(pe),ie.addElement(ce)}var xe=new Oe;xe.minWidth=3*this.toolbarHeight+"px",xe.contentAlign="end",this.topToolbar.addButtonBlock(xe);var De=new je('<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"OK");De.onClick=this.startRenderAndClose,xe.addButton(De),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(De.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Be=new je('<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"Close");Be.onClick=this.close,xe.addButton(Be),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Be.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},le.prototype.addBottomToolbar=function(){var Z=this;this.bottomToolbar=new B,this.bottomToolbar.display=this.styles.settings.hideBottomToolbar?"none":"",this.bottomToolbar.className=this.toolbarStyleClass.name,this.bottomToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.bottomToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.bottomToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.bottomToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.bottomToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.bottomToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var q=new Oe;q.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(q);var ne=new je('<svg viewBox="0 0 24 24"><path d="M13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93M7.1 18.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03L7.1 18.32M6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47m1.02-4.47L5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47z"/></svg>',"Rotate left");ne.onClick=this.rotateLeftButtonClicked,q.addButton(ne);var ue=new je('<svg viewBox="0 0 24 24"><path d="M16.89 15.5l1.42 1.39c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.5M13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03m6.93-6.9a7.906 7.906 0 00-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47m-2.36-5.45L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45z"/></svg>',"Rotate right");ue.onClick=this.rotateRightButtonClicked,q.addButton(ue);var ee=new Ze;ee.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(ee),this.straightener=new gt("Straighten"),this.straightener.className=this.toolbarStraightenerStyleClass.name,this.straightener.colorsClassName=this.styles.settings.toolbarStraightenerColorsClassName?this.styles.settings.toolbarStraightenerColorsClassName:this.toolbarStraightenerStyleColorsClass.name,this.straightener.onAngleChange=function(xe){Z.rotateBy(xe),Z.straightener.angle=Z.rotationAngle},ee.addElement(this.straightener.getUI());var ie=new Oe;ie.minWidth=2*this.toolbarHeight+"px",ie.contentAlign="end",this.bottomToolbar.addButtonBlock(ie);var ce=new je('<svg viewBox="0 0 24 24"><path d="M15 21h2v-2h-2m4-10h2V7h-2M3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2m16-2v2h2c0-1.1-.9-2-2-2m-8 20h2V1h-2m8 16h2v-2h-2M15 5h2V3h-2m4 10h2v-2h-2m0 10c1.1 0 2-.9 2-2h-2z"/></svg>',"Flip horizontal");ce.onClick=this.flipHorizontallyButtonClicked,ie.addButton(ce);var pe=new je('<svg viewBox="0 0 24 24"><path d="M3 15v2h2v-2m10 4v2h2v-2m2-16H5c-1.1 0-2 .9-2 2v4h2V5h14v4h2V5c0-1.1-.9-2-2-2m2 16h-2v2c1.1 0 2-.9 2-2M1 11v2h22v-2M7 19v2h2v-2m10-4v2h2v-2m-10 4v2h2v-2M3 19c0 1.1.9 2 2 2v-2z"/></svg>',"Flip vertical");pe.onClick=this.flipVerticallyButtonClicked,ie.addButton(pe)},le.prototype.ratioButtonClicked=function(Z){this.aspectRatio=Z,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},le.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=ze.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},le.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new He(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},le.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},le.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},le.prototype.restoreState=function(Z){if(Z){var q=this.cropLayer.getRescaledRect(Z.width,Z.height,this.imageWidth,this.imageHeight,Z.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(q),this.cropRectChanged(q),this.flippedHorizontally=Z.flippedHorizontally,this.flippedVertically=Z.flippedVertically,this.applyFlip(),this.rotationAngle=Z.rotationAngle,this.applyRotation()}},le.prototype.clientToLocalCoordinates=function(Z,q){var ne=this.cropImage.getBoundingClientRect();return{x:Z-ne.left,y:q-ne.top}},le.prototype.onWindowResize=function(){this.positionUI()},le.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var Z=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=Z+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)"}this.positionCropImage()},le.prototype.rotateLeftButtonClicked=function(){var Z=this.rotationAngle-90;this.rotationAngle%90!=0&&(Z+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(Z)},le.prototype.rotateRightButtonClicked=function(){var Z=this.rotationAngle+90;this.rotationAngle%90!=0&&(Z-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(Z)},le.prototype.rotateTo=function(Z){Z=(Z=Z>180?Z-360:Z)<=-180?Z+360:Z,this.rotationAngle=Z,this.applyRotation()},le.prototype.rotateBy=function(Z){this.rotateTo((this.rotationAngle+Z)%360)},le.prototype.applyRotation=function(){var Z=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var q=this.editingTargetRotationContainer.transform.baseVal.getItem(0);q.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(q,0);var ne=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/ne.width,this.imageHeight/ne.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=Z},le.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},le.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},le.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},le.prototype.startRenderAndClose=function(){return Fe(this,void 0,void 0,function(){var Z,q;return we(this,function(ne){switch(ne.label){case 0:return[4,this.render()];case 1:return Z=ne.sent(),q=this.getState(),this.renderEventListeners.forEach(function(ue){return ue(Z,q)}),this.close(!0),[2]}})})},le.prototype.render=function(){return Fe(this,void 0,void 0,function(){var Z;return we(this,function(q){switch(q.label){case 0:return(Z=new at).naturalSize=this.renderAtNaturalSize,Z.imageType=this.renderImageType,Z.imageQuality=this.renderImageQuality,Z.width=this.renderWidth,Z.height=this.renderHeight,this.unzoomFromCrop(),R.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,Z.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 1:return q.sent(),[4,Z.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return[2,q.sent()]}})})},le.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new $("toolbar",`
width: `+(this.displayMode==="inline"?"100%":"calc(100vw - "+2*this.popupMargin+"px)")+`;
flex-shrink: 0;
display: flex;
flex-direction: row;
justify-content: space-between;
height: `+this.toolbarHeight+`px;
box-sizing: content-box;
overflow: hidden;
line-height: 0px;
`)),this.toolbarStyleColorsClass=this.styles.addClass(new $("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new $("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var Z=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new $("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*Z)+`px;
height: `+(this.toolbarHeight-2*Z)+`px;
padding: `+Z+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new $("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new $("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new K("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new K("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new $("toolbar_dropdown",`
position: absolute;
max-width: `+4*this.toolbarHeight+`px;
z-index: 20;
white-space: normal;
box-sizing: content-box;
box-shadow: 3px 3px rgba(33, 33, 33, 0.1);
margin: `+(this.displayMode==="inline"?"0":this.popupMargin)+`px;
line-height: 0px;
`)),this.toolbarDropdownStyleColorsClass=this.styles.addClass(new $("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new $("toolbar_straightener_block",`
display: flex;
overflow: hidden;
justify-content: center;
-webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 30%, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 100%);
`)),this.toolbarStraightenerStyleClass=this.styles.addClass(new $("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*Z)+`px;
padding: `+Z+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new $("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},le.instanceCounter=0,le}(),lt=X("8hTe"),Ye=X.n(lt),Ne=/<pre[^>]*>/g;function ht(le){var Z=document.createElement("div");return Z.innerHTML=le,Z.childNodes.length===0?"":Z.childNodes[0].nodeValue}var qe=We.a=function(le){var Z=le.value,q=Z===void 0?"":Z,ne=le.edit,ue=ne===void 0?!1:ne,ee=le.className,ie=le.showTextOnly,ce=le.showLines,pe=le.replaces,xe=le.zoomImg,De=le.hasMask,Be=le.style,$e=Be===void 0?{}:Be,pt=le.stylesPrev,xt=pt===void 0?{}:pt,Ft=String(q),Ct=Object(L.useRef)(),ot=Object(L.useRef)(),Ut=Object(L.useState)(""),Rt=Object(W.a)(Ut,2),_t=Rt[0],Vt=Rt[1],bt=Object(L.useState)("office"),cr=Object(W.a)(bt,2),Gt=cr[0],Tt=cr[1],qt=function(){var sr=new ft(ot.current);sr.displayMode="popup",sr.addRenderEventListener(function(){var Gr=Object(k.a)(P.a.mark(function zt(Ht){var vr;return P.a.wrap(function(Br){for(;;)switch(Br.prev=Br.next){case 0:return Ct.current.style.display="none",Br.next=3,Object(Je.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Ht}});case 3:vr=Br.sent,vr!=null&&vr.id&&pe(ot.current.getAttribute("src").replace(fe.a.API_SERVER,""),"/api/attachments/".concat(vr==null?void 0:vr.id,"?type=").concat(vr.content_type));case 5:case"end":return Br.stop()}},zt)}));return function(zt){return Gr.apply(this,arguments)}}()),sr.show()},nt=function(){var sr=new _e.a(ot.current);sr.settings.displayMode="popup",sr.addEventListener("render",function(){var Gr=Object(k.a)(P.a.mark(function zt(Ht){var vr;return P.a.wrap(function(Br){for(;;)switch(Br.prev=Br.next){case 0:if(Ct.current.style.display="none",!ot.current){Br.next=6;break}return Br.next=4,Object(Je.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Ht.dataUrl}});case 4:vr=Br.sent,vr!=null&&vr.id&&pe(ot.current.getAttribute("src").replace(fe.a.API_SERVER,""),"/api/attachments/".concat(vr==null?void 0:vr.id,"?type=").concat(vr.content_type));case 6:case"end":return Br.stop()}},zt)}));return function(zt){return Gr.apply(this,arguments)}}()),sr.show(),window.markerArea=sr},Or=Object(L.useMemo)(function(){Ct.current&&(Ct.current.style.zIndex=-1);try{var Et=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,sr=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Gr=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Ft=Ft.replace(Et,"("+fe.a.API_SERVER+"/api/attachments/").replace(sr,'"'+fe.a.API_SERVER+"/api/attachments/").replace(Gr,'"'+fe.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(pn){}var zt=oe(Ft),Ht=x();if(Ft.match(/\[TOC\]/)&&(zt=zt.replace("<p>[TOC]</p>",D()),m()),zt=zt.replace(/(__special_katext_id_\d+__)/g,function(pn,Br){var tt=Ht[Br],Ot=tt.type,Ln=tt.expression;return Object(Se.renderToString)(ht(Ln)||"",{displayMode:Ot==="block",throwOnError:!1,output:"html"})}),zt=zt.replace(/▁/g,"\u2581\u2581\u2581"),g(),ie){var vr=document.createElement("div");return vr.innerHTML=zt,vr.innerText}return setTimeout(function(){return ln()},500),zt},[Ft]),ur=Object(L.useRef)();d.WebkitLineClamp=ce,ce&&($e=Object(A.a)(Object(A.a)({},$e),d));function Ar(Et){var sr=Et.target;if(sr.tagName.toUpperCase()==="IMG"){if(xe){var Gr=sr.getAttribute("src");Vt(Gr),Tt("image")}}else if(sr.tagName.toUpperCase()==="A"){var zt=sr.getAttribute("href");if(zt.indexOf("office")>-1)Et.preventDefault(),Vt(zt),Tt("office");else if(zt.indexOf("application/pdf")>-1)Et.preventDefault(),Vt(zt),Tt("pdf");else if(zt.indexOf("text/html")>-1)Et.preventDefault(),Vt(zt),Tt("html");else if(zt.startsWith("#")){Et.preventDefault();var Ht=document.getElementById(zt.replace("#",""));Ht&&Ht.scrollIntoView(!0)}}}var ln=function(){var sr,Gr=(sr=ur.current)===null||sr===void 0?void 0:sr.querySelectorAll("video");Gr==null||Gr.forEach(function(zt){if(zt.oncontextmenu=function(){return!1},zt.src.indexOf(".m3u8")>-1&&!zt.canPlayType("application/vnd.apple.mpegurl")){if(se.a.isSupported()){var Ht=new se.a;Ht.loadSource(zt.src),Ht.attachMedia(zt)}}})};Object(L.useEffect)(function(){if(ur.current&&Or&&(Or.match(Ne)&&window.PR.prettyPrint()),ur.current)return ur.current.addEventListener("click",Ar),function(){ur.current.removeEventListener("click",Ar),g(),m()}},[Or,ur.current,Ar]);var Mr=function(sr){if(!ue)return;sr.target.nodeName==="IMG"?(Ct.current.style.zIndex=1,Ct.current.style.display="flex",Ct.current.style.width=sr.target.clientWidth+"px",Ct.current.style.height=sr.target.clientHeight+"px",Ct.current.style.top=sr.target.offsetTop+"px",Ct.current.style.left=sr.target.offsetLeft+"px",ot.current.src=sr.target.getAttribute("src")):Ct.current.style.display="none"};return b.a.createElement("div",{style:{position:"relative"}},b.a.createElement("div",{ref:ur,style:Object(A.a)({},$e),className:"".concat(ee||""," markdown-body ").concat(Ye.a.mdBody),onMouseOver:Mr,dangerouslySetInnerHTML:{__html:Or}}),b.a.createElement("div",{ref:Ct,className:Ye.a.button},b.a.createElement(V.a,null,b.a.createElement(H.a,{onClick:function(){return qt()}},"\u88C1\u526A"),b.a.createElement(H.a,{onClick:function(){return nt()}},"\u7F16\u8F91"))),b.a.createElement("img",{ref:ot,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),b.a.createElement(ke.a,{close:!0,data:_t,type:_t!=null&&_t.length?Gt:"",style:Object(A.a)({},xt),onClose:function(){return Vt("")}}))}},"9VGf":function(Ge,We,X){"use strict";X.d(We,"a",function(){return O});var de=X("q1tI"),V=X.n(de);function O(H,A){var k=Object(de.useRef)();Object(de.useEffect)(function(){k.current=H}),Object(de.useEffect)(function(){function W(){k.current()}if(A!==null){var U=setInterval(W,A);return function(){return clearInterval(U)}}},[A])}},"9ZNV":function(Ge,We,X){"use strict";X.d(We,"a",function(){return L});var de=X("0Owb"),V=X("+L6B"),O=X("2/Rp"),H=X("q1tI"),A=X.n(H),k=X("UUDw"),W=X.n(k),U=X("TSYQ"),P=X.n(U),L=function(E){var I=E.cancelText,w=I===void 0?"\u53D6\u6D88":I,T=E.okText,y=T===void 0?"\u786E\u5B9A":T,u=E.loading,a=u===void 0?!1:u,l=E.hasOkBtn,s=l===void 0?!0:l,m=E.okButtonProps,d=m===void 0?{}:m,f=E.onCancel,D=f===void 0?function(){}:f,v=E.onOk,h=v===void 0?function(){}:v,p=E.className,c=p===void 0?"":p;return A.a.createElement("div",{className:P()(W.a.buttonFixed,c)},A.a.createElement("div",{className:W.a.buttonWrap},A.a.createElement(O.a,{size:"large",className:"".concat(W.a.button," mr20"),onClick:D},w),s&&A.a.createElement(O.a,Object(de.a)({size:"large",type:"primary",className:"".concat(W.a.button," mr20"),loading:a,onClick:h},d),y)))}},"A/g1":function(Ge,We){Ge.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAF92lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNi4wLWMwM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+G+Oenq4kxiIk+ZLIKbjitEO1Lvyr0/SHieD8qtLqQhbG/Qvl9C2OSIqMWvwHasUdWSW6Umojbh/VPNgTlOCCLWElsOB3hO7BL6XLHfCqOaXuYsA466aPR6XnAZQ8qHKB4fWJP4kNV7SrV3ymqwNVAFiTUe85HzLedaKNxfd/h4FvuPdoA9Hvj7ftmhMAkFbZyaxaQH1a3XwurL9tp4kN7fsUQz5fTnxbGH8GFt7DcwpecTuMFmlIaZ+bjOgvF2u7d/gnIWZR+Q1KPowcIIaAhQSarqmH/xE0TpQbb92M9uT7kdz+/HqfDB0EcF/ZRi1ggYFER/cYcMtMOO3jzlmVjXKDrkt5uv9are9ZLJ8L6UcJ+HplVotygVRlYLFwM4GWf2njl/ymq1fqrSgM3J1Sfz5Rnd15ulp/tiGtPV6h0aIwaCDxUPc/F8sfOQdqTKnbrvjMf9fOK7ZLCyv8Jom1s9qvsHANttQw4dhY++6BW+sKFlNJr7E9K6wOZEoT0YU3ogvXm5OSMK5KQ347v7oggZbr3j/+PWwUnoj9jyHCk+OP7p3Kry+6nL33uvazqbD+6+W35RDmrtGOPW8Va7JcjzemtC+frTKWfgJyCQmxI/GZ7x+warfdUKy/rj47UZXdnlHZXHprJWBcFKZsGX1k16t2spI7oqbr3iOTkdzGyz7z8tK5s4eAN4UiHxx5dO94Ka2jLd2Gq95TI/e9tXoqbBytZLJzwAUGdY+273nc6Y294z3p1sRW2ZhSt02Gsg+eDxknyl07FYWRY8I+aZptYx27B0Bw/Bp3faHRcs13EsCWiWpjZ8DEU+Ecxe7IKjVl5GMy8zAJMQSIwbH27rL+7FH2jUzTNfUwgMMAkFiFlf5MrstviA4PU61HIuo1KQRCdkGeJCDJoCQkkkzyOFVF4mOxyv9u8x8opnU6UeBF0wAAAABJRU5ErkJggg=="},Bd2K:function(Ge,We,X){(function(de){de(X("VrN/"),X("osHv"))})(function(de){de.defineOption("autoCloseTags",!1,function(P,L,b){if(b!=de.Init&&b&&P.removeKeyMap("autoCloseTags"),!L)return;var E={name:"autoCloseTags"};(typeof L!="object"||L.whenClosing!==!1)&&(E["'/'"]=function(I){return k(I)}),(typeof L!="object"||L.whenOpening!==!1)&&(E["'>'"]=function(I){return H(I)}),P.addKeyMap(E)});var V=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],O=["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 H(P){if(P.getOption("disableInput"))return de.Pass;for(var L=P.listSelections(),b=[],E=P.getOption("autoCloseTags"),I=0;I<L.length;I++){if(!L[I].empty())return de.Pass;var w=L[I].head,T=P.getTokenAt(w),y=de.innerMode(P.getMode(),T.state),u=y.state,a=y.mode.xmlCurrentTag&&y.mode.xmlCurrentTag(u),l=a&&a.name;if(!l)return de.Pass;var s=y.mode.configuration=="html",m=typeof E=="object"&&E.dontCloseTags||s&&V,d=typeof E=="object"&&E.indentTags||s&&O;T.end>w.ch&&(l=l.slice(0,l.length-T.end+w.ch));var f=l.toLowerCase();if(!l||T.type=="string"&&(T.end!=w.ch||!/[\"\']/.test(T.string.charAt(T.string.length-1))||T.string.length==1)||T.type=="tag"&&a.close||T.string.indexOf("/")==w.ch-T.start-1||m&&W(m,f)>-1||U(P,y.mode.xmlCurrentContext&&y.mode.xmlCurrentContext(u)||[],l,w,!0))return de.Pass;var D=typeof E=="object"&&E.emptyTags;if(D&&W(D,l)>-1){b[I]={text:"/>",newPos:de.Pos(w.line,w.ch+2)};continue}var v=d&&W(d,f)>-1;b[I]={indent:v,text:">"+(v?`
`:"")+"</"+l+">",newPos:v?de.Pos(w.line+1,0):de.Pos(w.line,w.ch+1)}}for(var h=typeof E=="object"&&E.dontIndentOnAutoClose,I=L.length-1;I>=0;I--){var p=b[I];P.replaceRange(p.text,L[I].head,L[I].anchor,"+insert");var c=P.listSelections().slice(0);c[I]={head:p.newPos,anchor:p.newPos},P.setSelections(c),!h&&p.indent&&(P.indentLine(p.newPos.line,null,!0),P.indentLine(p.newPos.line+1,null,!0))}}function A(P,L){for(var b=P.listSelections(),E=[],I=L?"/":"</",w=P.getOption("autoCloseTags"),T=typeof w=="object"&&w.dontIndentOnSlash,y=0;y<b.length;y++){if(!b[y].empty())return de.Pass;var u=b[y].head,a=P.getTokenAt(u),l=de.innerMode(P.getMode(),a.state),s=l.state;if(L&&(a.type=="string"||a.string.charAt(0)!="<"||a.start!=u.ch-1))return de.Pass;var m,d=l.mode.name!="xml"&&P.getMode().name=="htmlmixed";if(d&&l.mode.name=="javascript")m=I+"script";else if(d&&l.mode.name=="css")m=I+"style";else{var f=l.mode.xmlCurrentContext&&l.mode.xmlCurrentContext(s);if(!f||f.length&&U(P,f,f[f.length-1],u))return de.Pass;m=I+f[f.length-1]}P.getLine(u.line).charAt(a.end)!=">"&&(m+=">"),E[y]=m}if(P.replaceSelections(E),b=P.listSelections(),!T)for(var y=0;y<b.length;y++)(y==b.length-1||b[y].head.line<b[y+1].head.line)&&P.indentLine(b[y].head.line)}function k(P){return P.getOption("disableInput")?de.Pass:A(P,!0)}de.commands.closeTag=function(P){return A(P)};function W(P,L){if(P.indexOf)return P.indexOf(L);for(var b=0,E=P.length;b<E;++b)if(P[b]==L)return b;return-1}function U(P,L,b,E,I){if(!de.scanForClosingTag)return!1;var w=Math.min(P.lastLine()+1,E.line+500),T=de.scanForClosingTag(P,E,null,w);if(!T||T.tag!=b)return!1;for(var y=I?1:0,u=L.length-1;u>=0&&L[u]==b;u--)++y;E=T.to;for(var u=1;u<y;u++){var a=de.scanForClosingTag(P,E,null,w);if(!a||a.tag!=b)return!1;E=a.to}return!0}})},BjJ7:function(Ge,We,X){"use strict";X.d(We,"d",function(){return V}),X.d(We,"c",function(){return O}),X.d(We,"e",function(){return H}),X.d(We,"b",function(){return A}),X.d(We,"a",function(){return W});var de=X("m3rI");function V(U){var P=!0;if(U.length>0){for(var L=0;L<U.length;L++)if(U[L].compile_success==0||!U[L].compile_success){P=!1;break}}else P=!1;return P}function O(U){for(var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",L=[],b=0;b<U.length;b++){var E=U[b],I=P?"".concat(P,"/").concat(E.name):"".concat(E.name);L.push({title:E.name,isLeaf:!(E.type==="tree"),key:I})}return L}function H(U,P,L){for(var b=0;b<U.length;b++){var E=U[b];if(E.key===P){E.children=L;break}E.children&&H(E.children,P,L)}return U}function A(U,P,L){var b;return function(){var E=this,I=arguments,w=function(){b=null,L||U.apply(E,I)},T=L&&!b;clearTimeout(b),b=setTimeout(w,P),T&&U.apply(E,I)}}var k=!0,W=de.a.API_SERVER},"C+DQ":function(Ge,We,X){},DlQD:function(Ge,We,X){(function(de,V){Ge.exports=V()})(this,function(){"use strict";function de(q,ne){for(var ue=0;ue<ne.length;ue++){var ee=ne[ue];ee.enumerable=ee.enumerable||!1,ee.configurable=!0,"value"in ee&&(ee.writable=!0),Object.defineProperty(q,ee.key,ee)}}function V(q,ne,ue){return ne&&de(q.prototype,ne),ue&&de(q,ue),q}function O(q,ne){if(!q)return;if(typeof q=="string")return H(q,ne);var ue=Object.prototype.toString.call(q).slice(8,-1);if(ue==="Object"&&q.constructor&&(ue=q.constructor.name),ue==="Map"||ue==="Set")return Array.from(q);if(ue==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ue))return H(q,ne)}function H(q,ne){(ne==null||ne>q.length)&&(ne=q.length);for(var ue=0,ee=new Array(ne);ue<ne;ue++)ee[ue]=q[ue];return ee}function A(q,ne){var ue;if(typeof Symbol=="undefined"||q[Symbol.iterator]==null){if(Array.isArray(q)||(ue=O(q))||ne&&q&&typeof q.length=="number"){ue&&(q=ue);var ee=0;return function(){return ee>=q.length?{done:!0}:{done:!1,value:q[ee++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return ue=q[Symbol.iterator](),ue.next.bind(ue)}function k(q,ne){return ne={exports:{}},q(ne,ne.exports),ne.exports}var W=k(function(q){function ne(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function ue(ee){q.exports.defaults=ee}q.exports={defaults:ne(),getDefaults:ne,changeDefaults:ue}}),U=W.defaults,P=W.getDefaults,L=W.changeDefaults,b=/[&<>"']/,E=/[&<>"']/g,I=/[<>"']|&(?!#?\w+;)/,w=/[<>"']|&(?!#?\w+;)/g,T={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},y=function(ne){return T[ne]};function u(q,ne){if(ne){if(b.test(q))return q.replace(E,y)}else if(I.test(q))return q.replace(w,y);return q}var a=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function l(q){return q.replace(a,function(ne,ue){return ue=ue.toLowerCase(),ue==="colon"?":":ue.charAt(0)==="#"?ue.charAt(1)==="x"?String.fromCharCode(parseInt(ue.substring(2),16)):String.fromCharCode(+ue.substring(1)):""})}var s=/(^|[^\[])\^/g;function m(q,ne){q=q.source||q,ne=ne||"";var ue={replace:function(ie,ce){return ce=ce.source||ce,ce=ce.replace(s,"$1"),q=q.replace(ie,ce),ue},getRegex:function(){return new RegExp(q,ne)}};return ue}var d=/[^\w:]/g,f=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function D(q,ne,ue){if(q){var ee;try{ee=decodeURIComponent(l(ue)).replace(d,"").toLowerCase()}catch(ie){return null}if(ee.indexOf("javascript:")===0||ee.indexOf("vbscript:")===0||ee.indexOf("data:")===0)return null}ne&&!f.test(ue)&&(ue=o(ne,ue));try{ue=encodeURI(ue).replace(/%25/g,"%")}catch(ie){return null}return ue}var v={},h=/^[^:]+:\/*[^/]*$/,p=/^([^:]+:)[\s\S]*$/,c=/^([^:]+:\/*[^/]*)[\s\S]*$/;function o(q,ne){v[" "+q]||(h.test(q)?v[" "+q]=q+"/":v[" "+q]=_(q,"/",!0)),q=v[" "+q];var ue=q.indexOf(":")===-1;return ne.substring(0,2)==="//"?ue?ne:q.replace(p,"$1")+ne:ne.charAt(0)==="/"?ue?ne:q.replace(c,"$1")+ne:q+ne}var x={exec:function(){}};function g(q){for(var ne=1,ue,ee;ne<arguments.length;ne++){ue=arguments[ne];for(ee in ue)Object.prototype.hasOwnProperty.call(ue,ee)&&(q[ee]=ue[ee])}return q}function C(q,ne){var ue=q.replace(/\|/g,function(ce,pe,xe){for(var De=!1,Be=pe;--Be>=0&&xe[Be]==="\\";)De=!De;return De?"|":" |"}),ee=ue.split(/ \|/),ie=0;if(ee.length>ne)ee.splice(ne);else for(;ee.length<ne;)ee.push("");for(;ie<ee.length;ie++)ee[ie]=ee[ie].trim().replace(/\\\|/g,"|");return ee}function _(q,ne,ue){var ee=q.length;if(ee===0)return"";for(var ie=0;ie<ee;){var ce=q.charAt(ee-ie-1);if(ce===ne&&!ue)ie++;else if(ce!==ne&&ue)ie++;else break}return q.substr(0,ee-ie)}function z(q,ne){if(q.indexOf(ne[1])===-1)return-1;for(var ue=q.length,ee=0,ie=0;ie<ue;ie++)if(q[ie]==="\\")ie++;else if(q[ie]===ne[0])ee++;else if(q[ie]===ne[1]&&(ee--,ee<0))return ie;return-1}function Y(q){q&&q.sanitize&&!q.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}var oe={escape:u,unescape:l,edit:m,cleanUrl:D,resolveUrl:o,noopTest:x,merge:g,splitCells:C,rtrim:_,findClosingBracket:z,checkSanitizeDeprecation:Y},G=W.defaults,j=oe.rtrim,se=oe.splitCells,fe=oe.escape,Se=oe.findClosingBracket;function ke(q,ne,ue){var ee=ne.href,ie=ne.title?fe(ne.title):null,ce=q[1].replace(/\\([\[\]])/g,"$1");return q[0].charAt(0)!=="!"?{type:"link",raw:ue,href:ee,title:ie,text:ce}:{type:"image",raw:ue,href:ee,title:ie,text:fe(ce)}}function Je(q,ne){var ue=q.match(/^(\s+)(?:```)/);if(ue===null)return ne;var ee=ue[1];return ne.split(`
`).map(function(ie){var ce=ie.match(/^\s+/);if(ce===null)return ie;var pe=ce[0];return pe.length>=ee.length?ie.slice(ee.length):ie}).join(`
`)}var _e=function(){function q(ue){this.options=ue||G}var ne=q.prototype;return ne.space=function(ee){var ie=this.rules.block.newline.exec(ee);if(ie)return ie[0].length>1?{type:"space",raw:ie[0]}:{raw:`
`}},ne.code=function(ee,ie){var ce=this.rules.block.code.exec(ee);if(ce){var pe=ie[ie.length-1];if(pe&&pe.type==="paragraph")return{raw:ce[0],text:ce[0].trimRight()};var xe=ce[0].replace(/^ {4}/gm,"");return{type:"code",raw:ce[0],codeBlockStyle:"indented",text:this.options.pedantic?xe:j(xe,`
`)}}},ne.fences=function(ee){var ie=this.rules.block.fences.exec(ee);if(ie){var ce=ie[0],pe=Je(ce,ie[3]||"");return{type:"code",raw:ce,lang:ie[2]?ie[2].trim():ie[2],text:pe}}},ne.heading=function(ee){var ie=this.rules.block.heading.exec(ee);if(ie)return{type:"heading",raw:ie[0],depth:ie[1].length,text:ie[2]}},ne.nptable=function(ee){var ie=this.rules.block.nptable.exec(ee);if(ie){var ce={type:"table",header:se(ie[1].replace(/^ *| *\| *$/g,"")),align:ie[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ie[3]?ie[3].replace(/\n$/,"").split(`
`):[],raw:ie[0]};if(ce.header.length===ce.align.length){var pe=ce.align.length,xe;for(xe=0;xe<pe;xe++)/^ *-+: *$/.test(ce.align[xe])?ce.align[xe]="right":/^ *:-+: *$/.test(ce.align[xe])?ce.align[xe]="center":/^ *:-+ *$/.test(ce.align[xe])?ce.align[xe]="left":ce.align[xe]=null;for(pe=ce.cells.length,xe=0;xe<pe;xe++)ce.cells[xe]=se(ce.cells[xe],ce.header.length);return ce}}},ne.hr=function(ee){var ie=this.rules.block.hr.exec(ee);if(ie)return{type:"hr",raw:ie[0]}},ne.blockquote=function(ee){var ie=this.rules.block.blockquote.exec(ee);if(ie){var ce=ie[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:ie[0],text:ce}}},ne.list=function(ee){var ie=this.rules.block.list.exec(ee);if(ie){for(var ce=ie[0],pe=ie[2],xe=pe.length>1,De=pe[pe.length-1]===")",Be={type:"list",raw:ce,ordered:xe,start:xe?+pe.slice(0,-1):"",loose:!1,items:[]},$e=ie[0].match(this.rules.block.item),pt=!1,xt,Ft,Ct,ot,Ut,Rt,_t,Vt=$e.length,bt=0;bt<Vt;bt++)xt=$e[bt],ce=xt,Ft=xt.length,xt=xt.replace(/^ *([*+-]|\d+[.)]) */,""),~xt.indexOf(`
`)&&(Ft-=xt.length,xt=this.options.pedantic?xt.replace(/^ {1,4}/gm,""):xt.replace(new RegExp("^ {1,"+Ft+"}","gm"),"")),bt!==Vt-1&&(Ct=this.rules.block.bullet.exec($e[bt+1])[0],(xe?Ct.length===1||!De&&Ct[Ct.length-1]===")":Ct.length>1||this.options.smartLists&&Ct!==pe)&&(ot=$e.slice(bt+1).join(`
`),Be.raw=Be.raw.substring(0,Be.raw.length-ot.length),bt=Vt-1)),Ut=pt||/\n\n(?!\s*$)/.test(xt),bt!==Vt-1&&(pt=xt.charAt(xt.length-1)===`
`,Ut||(Ut=pt)),Ut&&(Be.loose=!0),Rt=/^\[[ xX]\] /.test(xt),_t=void 0,Rt&&(_t=xt[1]!==" ",xt=xt.replace(/^\[[ xX]\] +/,"")),Be.items.push({type:"list_item",raw:ce,task:Rt,checked:_t,loose:Ut,text:xt});return Be}},ne.html=function(ee){var ie=this.rules.block.html.exec(ee);if(ie)return{type:this.options.sanitize?"paragraph":"html",raw:ie[0],pre:!this.options.sanitizer&&(ie[1]==="pre"||ie[1]==="script"||ie[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ie[0]):fe(ie[0]):ie[0]}},ne.def=function(ee){var ie=this.rules.block.def.exec(ee);if(ie){ie[3]&&(ie[3]=ie[3].substring(1,ie[3].length-1));var ce=ie[1].toLowerCase().replace(/\s+/g," ");return{tag:ce,raw:ie[0],href:ie[2],title:ie[3]}}},ne.table=function(ee){var ie=this.rules.block.table.exec(ee);if(ie){var ce={type:"table",header:se(ie[1].replace(/^ *| *\| *$/g,"")),align:ie[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ie[3]?ie[3].replace(/\n$/,"").split(`
`):[]};if(ce.header.length===ce.align.length){ce.raw=ie[0];var pe=ce.align.length,xe;for(xe=0;xe<pe;xe++)/^ *-+: *$/.test(ce.align[xe])?ce.align[xe]="right":/^ *:-+: *$/.test(ce.align[xe])?ce.align[xe]="center":/^ *:-+ *$/.test(ce.align[xe])?ce.align[xe]="left":ce.align[xe]=null;for(pe=ce.cells.length,xe=0;xe<pe;xe++)ce.cells[xe]=se(ce.cells[xe].replace(/^ *\| *| *\| *$/g,""),ce.header.length);return ce}}},ne.lheading=function(ee){var ie=this.rules.block.lheading.exec(ee);if(ie)return{type:"heading",raw:ie[0],depth:ie[2].charAt(0)==="="?1:2,text:ie[1]}},ne.paragraph=function(ee){var ie=this.rules.block.paragraph.exec(ee);if(ie)return{type:"paragraph",raw:ie[0],text:ie[1].charAt(ie[1].length-1)===`
`?ie[1].slice(0,-1):ie[1]}},ne.text=function(ee,ie){var ce=this.rules.block.text.exec(ee);if(ce){var pe=ie[ie.length-1];return pe&&pe.type==="text"?{raw:ce[0],text:ce[0]}:{type:"text",raw:ce[0],text:ce[0]}}},ne.escape=function(ee){var ie=this.rules.inline.escape.exec(ee);if(ie)return{type:"escape",raw:ie[0],text:fe(ie[1])}},ne.tag=function(ee,ie,ce){var pe=this.rules.inline.tag.exec(ee);if(pe)return!ie&&/^<a /i.test(pe[0])?ie=!0:ie&&/^<\/a>/i.test(pe[0])&&(ie=!1),!ce&&/^<(pre|code|kbd|script)(\s|>)/i.test(pe[0])?ce=!0:ce&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(pe[0])&&(ce=!1),{type:this.options.sanitize?"text":"html",raw:pe[0],inLink:ie,inRawBlock:ce,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(pe[0]):fe(pe[0]):pe[0]}},ne.link=function(ee){var ie=this.rules.inline.link.exec(ee);if(ie){var ce=Se(ie[2],"()");if(ce>-1){var pe=ie[0].indexOf("!")===0?5:4,xe=pe+ie[1].length+ce;ie[2]=ie[2].substring(0,ce),ie[0]=ie[0].substring(0,xe).trim(),ie[3]=""}var De=ie[2],Be="";if(this.options.pedantic){var $e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(De);$e?(De=$e[1],Be=$e[3]):Be=""}else Be=ie[3]?ie[3].slice(1,-1):"";De=De.trim().replace(/^<([\s\S]*)>$/,"$1");var pt=ke(ie,{href:De&&De.replace(this.rules.inline._escapes,"$1"),title:Be&&Be.replace(this.rules.inline._escapes,"$1")},ie[0]);return pt}},ne.reflink=function(ee,ie){var ce;if((ce=this.rules.inline.reflink.exec(ee))||(ce=this.rules.inline.nolink.exec(ee))){var pe=(ce[2]||ce[1]).replace(/\s+/g," ");if(pe=ie[pe.toLowerCase()],!pe||!pe.href){var xe=ce[0].charAt(0);return{type:"text",raw:xe,text:xe}}var De=ke(ce,pe,ce[0]);return De}},ne.strong=function(ee,ie,ce){ce===void 0&&(ce="");var pe=this.rules.inline.strong.start.exec(ee);if(pe&&(!pe[1]||pe[1]&&(ce===""||this.rules.inline.punctuation.exec(ce)))){ie=ie.slice(-1*ee.length);var xe=pe[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;xe.lastIndex=0;for(var De;(pe=xe.exec(ie))!=null;)if(De=this.rules.inline.strong.middle.exec(ie.slice(0,pe.index+3)),De)return{type:"strong",raw:ee.slice(0,De[0].length),text:ee.slice(2,De[0].length-2)}}},ne.em=function(ee,ie,ce){ce===void 0&&(ce="");var pe=this.rules.inline.em.start.exec(ee);if(pe&&(!pe[1]||pe[1]&&(ce===""||this.rules.inline.punctuation.exec(ce)))){ie=ie.slice(-1*ee.length);var xe=pe[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;xe.lastIndex=0;for(var De;(pe=xe.exec(ie))!=null;)if(De=this.rules.inline.em.middle.exec(ie.slice(0,pe.index+2)),De)return{type:"em",raw:ee.slice(0,De[0].length),text:ee.slice(1,De[0].length-1)}}},ne.codespan=function(ee){var ie=this.rules.inline.code.exec(ee);if(ie){var ce=ie[2].replace(/\n/g," "),pe=/[^ ]/.test(ce),xe=ce.startsWith(" ")&&ce.endsWith(" ");return pe&&xe&&(ce=ce.substring(1,ce.length-1)),ce=fe(ce,!0),{type:"codespan",raw:ie[0],text:ce}}},ne.br=function(ee){var ie=this.rules.inline.br.exec(ee);if(ie)return{type:"br",raw:ie[0]}},ne.del=function(ee){var ie=this.rules.inline.del.exec(ee);if(ie)return{type:"del",raw:ie[0],text:ie[1]}},ne.autolink=function(ee,ie){var ce=this.rules.inline.autolink.exec(ee);if(ce){var pe,xe;return ce[2]==="@"?(pe=fe(this.options.mangle?ie(ce[1]):ce[1]),xe="mailto:"+pe):(pe=fe(ce[1]),xe=pe),{type:"link",raw:ce[0],text:pe,href:xe,tokens:[{type:"text",raw:pe,text:pe}]}}},ne.url=function(ee,ie){var ce;if(ce=this.rules.inline.url.exec(ee)){var pe,xe;if(ce[2]==="@")pe=fe(this.options.mangle?ie(ce[0]):ce[0]),xe="mailto:"+pe;else{var De;do De=ce[0],ce[0]=this.rules.inline._backpedal.exec(ce[0])[0];while(De!==ce[0]);pe=fe(ce[0]),ce[1]==="www."?xe="http://"+pe:xe=pe}return{type:"link",raw:ce[0],text:pe,href:xe,tokens:[{type:"text",raw:pe,text:pe}]}}},ne.inlineText=function(ee,ie,ce){var pe=this.rules.inline.text.exec(ee);if(pe){var xe;return ie?xe=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(pe[0]):fe(pe[0]):pe[0]:xe=fe(this.options.smartypants?ce(pe[0]):pe[0]),{type:"text",raw:pe[0],text:xe}}},q}(),Qe=oe.noopTest,Ue=oe.edit,Fe=oe.merge,we={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:Qe,table:Qe,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};we._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,we._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,we.def=Ue(we.def).replace("label",we._label).replace("title",we._title).getRegex(),we.bullet=/(?:[*+-]|\d{1,9}[.)])/,we.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,we.item=Ue(we.item,"gm").replace(/bull/g,we.bullet).getRegex(),we.list=Ue(we.list).replace(/bull/g,we.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+we.def.source+")").getRegex(),we._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",we._comment=/<!--(?!-?>)[\s\S]*?-->/,we.html=Ue(we.html,"i").replace("comment",we._comment).replace("tag",we._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),we.paragraph=Ue(we._paragraph).replace("hr",we.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",we._tag).getRegex(),we.blockquote=Ue(we.blockquote).replace("paragraph",we.paragraph).getRegex(),we.normal=Fe({},we),we.gfm=Fe({},we.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*|$)"}),we.gfm.nptable=Ue(we.gfm.nptable).replace("hr",we.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",we._tag).getRegex(),we.gfm.table=Ue(we.gfm.table).replace("hr",we.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",we._tag).getRegex(),we.pedantic=Fe({},we.normal,{html:Ue(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",we._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:Qe,paragraph:Ue(we.normal._paragraph).replace("hr",we.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",we.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var F={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Qe,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:Qe,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};F._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",F.punctuation=Ue(F.punctuation).replace(/punctuation/g,F._punctuation).getRegex(),F._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",F._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",F.em.start=Ue(F.em.start).replace(/punctuation/g,F._punctuation).getRegex(),F.em.middle=Ue(F.em.middle).replace(/punctuation/g,F._punctuation).replace(/overlapSkip/g,F._overlapSkip).getRegex(),F.em.endAst=Ue(F.em.endAst,"g").replace(/punctuation/g,F._punctuation).getRegex(),F.em.endUnd=Ue(F.em.endUnd,"g").replace(/punctuation/g,F._punctuation).getRegex(),F.strong.start=Ue(F.strong.start).replace(/punctuation/g,F._punctuation).getRegex(),F.strong.middle=Ue(F.strong.middle).replace(/punctuation/g,F._punctuation).replace(/blockSkip/g,F._blockSkip).getRegex(),F.strong.endAst=Ue(F.strong.endAst,"g").replace(/punctuation/g,F._punctuation).getRegex(),F.strong.endUnd=Ue(F.strong.endUnd,"g").replace(/punctuation/g,F._punctuation).getRegex(),F.blockSkip=Ue(F._blockSkip,"g").getRegex(),F.overlapSkip=Ue(F._overlapSkip,"g").getRegex(),F._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,F._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,F._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])?)+(?![-_])/,F.autolink=Ue(F.autolink).replace("scheme",F._scheme).replace("email",F._email).getRegex(),F._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,F.tag=Ue(F.tag).replace("comment",we._comment).replace("attribute",F._attribute).getRegex(),F._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,F._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,F._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,F.link=Ue(F.link).replace("label",F._label).replace("href",F._href).replace("title",F._title).getRegex(),F.reflink=Ue(F.reflink).replace("label",F._label).getRegex(),F.reflinkSearch=Ue(F.reflinkSearch,"g").replace("reflink",F.reflink).replace("nolink",F.nolink).getRegex(),F.normal=Fe({},F),F.pedantic=Fe({},F.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:Ue(/^!?\[(label)\]\((.*?)\)/).replace("label",F._label).getRegex(),reflink:Ue(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",F._label).getRegex()}),F.gfm=Fe({},F.normal,{escape:Ue(F.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),F.gfm.url=Ue(F.gfm.url,"i").replace("email",F.gfm._extended_email).getRegex(),F.breaks=Fe({},F.gfm,{br:Ue(F.br).replace("{2,}","*").getRegex(),text:Ue(F.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var R={block:we,inline:F},M=W.defaults,K=R.block,$=R.inline;function B(q){return q.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function ge(q){var ne="",ue,ee,ie=q.length;for(ue=0;ue<ie;ue++)ee=q.charCodeAt(ue),Math.random()>.5&&(ee="x"+ee.toString(16)),ne+="&#"+ee+";";return ne}var Oe=function(){function q(ue){this.tokens=[],this.tokens.links=Object.create(null),this.options=ue||M,this.options.tokenizer=this.options.tokenizer||new _e,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ee={block:K.normal,inline:$.normal};this.options.pedantic?(ee.block=K.pedantic,ee.inline=$.pedantic):this.options.gfm&&(ee.block=K.gfm,this.options.breaks?ee.inline=$.breaks:ee.inline=$.gfm),this.tokenizer.rules=ee}q.lex=function(ee,ie){var ce=new q(ie);return ce.lex(ee)};var ne=q.prototype;return ne.lex=function(ee){return ee=ee.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(ee,this.tokens,!0),this.inline(this.tokens),this.tokens},ne.blockTokens=function(ee,ie,ce){ie===void 0&&(ie=[]),ce===void 0&&(ce=!0),ee=ee.replace(/^ +$/gm,"");for(var pe,xe,De,Be;ee;){if(pe=this.tokenizer.space(ee)){ee=ee.substring(pe.raw.length),pe.type&&ie.push(pe);continue}if(pe=this.tokenizer.code(ee,ie)){ee=ee.substring(pe.raw.length),pe.type?ie.push(pe):(Be=ie[ie.length-1],Be.raw+=`
`+pe.raw,Be.text+=`
`+pe.text);continue}if(pe=this.tokenizer.fences(ee)){ee=ee.substring(pe.raw.length),ie.push(pe);continue}if(pe=this.tokenizer.heading(ee)){ee=ee.substring(pe.raw.length),ie.push(pe);continue}if(pe=this.tokenizer.nptable(ee)){ee=ee.substring(pe.raw.length),ie.push(pe);continue}if(pe=this.tokenizer.hr(ee)){ee=ee.substring(pe.raw.length),ie.push(pe);continue}if(pe=this.tokenizer.blockquote(ee)){ee=ee.substring(pe.raw.length),pe.tokens=this.blockTokens(pe.text,[],ce),ie.push(pe);continue}if(pe=this.tokenizer.list(ee)){for(ee=ee.substring(pe.raw.length),De=pe.items.length,xe=0;xe<De;xe++)pe.items[xe].tokens=this.blockTokens(pe.items[xe].text,[],!1);ie.push(pe);continue}if(pe=this.tokenizer.html(ee)){ee=ee.substring(pe.raw.length),ie.push(pe);continue}if(ce&&(pe=this.tokenizer.def(ee))){ee=ee.substring(pe.raw.length),this.tokens.links[pe.tag]||(this.tokens.links[pe.tag]={href:pe.href,title:pe.title});continue}if(pe=this.tokenizer.table(ee)){ee=ee.substring(pe.raw.length),ie.push(pe);continue}if(pe=this.tokenizer.lheading(ee)){ee=ee.substring(pe.raw.length),ie.push(pe);continue}if(ce&&(pe=this.tokenizer.paragraph(ee))){ee=ee.substring(pe.raw.length),ie.push(pe);continue}if(pe=this.tokenizer.text(ee,ie)){ee=ee.substring(pe.raw.length),pe.type?ie.push(pe):(Be=ie[ie.length-1],Be.raw+=`
`+pe.raw,Be.text+=`
`+pe.text);continue}if(ee){var $e="Infinite loop on byte: "+ee.charCodeAt(0);if(this.options.silent){console.error($e);break}else throw new Error($e)}}return ie},ne.inline=function(ee){var ie,ce,pe,xe,De,Be,$e=ee.length;for(ie=0;ie<$e;ie++){Be=ee[ie];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:[]},xe=Be.header.length,ce=0;ce<xe;ce++)Be.tokens.header[ce]=[],this.inlineTokens(Be.header[ce],Be.tokens.header[ce]);for(xe=Be.cells.length,ce=0;ce<xe;ce++)for(De=Be.cells[ce],Be.tokens.cells[ce]=[],pe=0;pe<De.length;pe++)Be.tokens.cells[ce][pe]=[],this.inlineTokens(De[pe],Be.tokens.cells[ce][pe]);break}case"blockquote":{this.inline(Be.tokens);break}case"list":{for(xe=Be.items.length,ce=0;ce<xe;ce++)this.inline(Be.items[ce].tokens);break}}}return ee},ne.inlineTokens=function(ee,ie,ce,pe,xe){ie===void 0&&(ie=[]),ce===void 0&&(ce=!1),pe===void 0&&(pe=!1),xe===void 0&&(xe="");var De,Be=ee,$e;if(this.tokens.links){var pt=Object.keys(this.tokens.links);if(pt.length>0)for(;($e=this.tokenizer.rules.inline.reflinkSearch.exec(Be))!=null;)pt.includes($e[0].slice($e[0].lastIndexOf("[")+1,-1))&&(Be=Be.slice(0,$e.index)+"["+"a".repeat($e[0].length-2)+"]"+Be.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;($e=this.tokenizer.rules.inline.blockSkip.exec(Be))!=null;)Be=Be.slice(0,$e.index)+"["+"a".repeat($e[0].length-2)+"]"+Be.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;ee;){if(De=this.tokenizer.escape(ee)){ee=ee.substring(De.raw.length),ie.push(De);continue}if(De=this.tokenizer.tag(ee,ce,pe)){ee=ee.substring(De.raw.length),ce=De.inLink,pe=De.inRawBlock,ie.push(De);continue}if(De=this.tokenizer.link(ee)){ee=ee.substring(De.raw.length),De.type==="link"&&(De.tokens=this.inlineTokens(De.text,[],!0,pe)),ie.push(De);continue}if(De=this.tokenizer.reflink(ee,this.tokens.links)){ee=ee.substring(De.raw.length),De.type==="link"&&(De.tokens=this.inlineTokens(De.text,[],!0,pe)),ie.push(De);continue}if(De=this.tokenizer.strong(ee,Be,xe)){ee=ee.substring(De.raw.length),De.tokens=this.inlineTokens(De.text,[],ce,pe),ie.push(De);continue}if(De=this.tokenizer.em(ee,Be,xe)){ee=ee.substring(De.raw.length),De.tokens=this.inlineTokens(De.text,[],ce,pe),ie.push(De);continue}if(De=this.tokenizer.codespan(ee)){ee=ee.substring(De.raw.length),ie.push(De);continue}if(De=this.tokenizer.br(ee)){ee=ee.substring(De.raw.length),ie.push(De);continue}if(De=this.tokenizer.del(ee)){ee=ee.substring(De.raw.length),De.tokens=this.inlineTokens(De.text,[],ce,pe),ie.push(De);continue}if(De=this.tokenizer.autolink(ee,ge)){ee=ee.substring(De.raw.length),ie.push(De);continue}if(!ce&&(De=this.tokenizer.url(ee,ge))){ee=ee.substring(De.raw.length),ie.push(De);continue}if(De=this.tokenizer.inlineText(ee,pe,B)){ee=ee.substring(De.raw.length),xe=De.raw.slice(-1),ie.push(De);continue}if(ee){var xt="Infinite loop on byte: "+ee.charCodeAt(0);if(this.options.silent){console.error(xt);break}else throw new Error(xt)}}return ie},V(q,null,[{key:"rules",get:function(){return{block:K,inline:$}}}]),q}(),je=W.defaults,Ze=oe.cleanUrl,He=oe.escape,ze=function(){function q(ue){this.options=ue||je}var ne=q.prototype;return ne.code=function(ee,ie,ce){var pe=(ie||"").match(/\S*/)[0];if(this.options.highlight){var xe=this.options.highlight(ee,pe);xe!=null&&xe!==ee&&(ce=!0,ee=xe)}return pe?'<pre><code class="'+this.options.langPrefix+He(pe,!0)+'">'+(ce?ee:He(ee,!0))+`</code></pre>
`:"<pre><code>"+(ce?ee:He(ee,!0))+`</code></pre>
`},ne.blockquote=function(ee){return`<blockquote>
`+ee+`</blockquote>
`},ne.html=function(ee){return ee},ne.heading=function(ee,ie,ce,pe){return this.options.headerIds?"<h"+ie+' id="'+this.options.headerPrefix+pe.slug(ce)+'">'+ee+"</h"+ie+`>
`:"<h"+ie+">"+ee+"</h"+ie+`>
`},ne.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},ne.list=function(ee,ie,ce){var pe=ie?"ol":"ul",xe=ie&&ce!==1?' start="'+ce+'"':"";return"<"+pe+xe+`>
`+ee+"</"+pe+`>
`},ne.listitem=function(ee){return"<li>"+ee+`</li>
`},ne.checkbox=function(ee){return"<input "+(ee?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},ne.paragraph=function(ee){return"<p>"+ee+`</p>
`},ne.table=function(ee,ie){return ie&&(ie="<tbody>"+ie+"</tbody>"),`<table>
<thead>
`+ee+`</thead>
`+ie+`</table>
`},ne.tablerow=function(ee){return`<tr>
`+ee+`</tr>
`},ne.tablecell=function(ee,ie){var ce=ie.header?"th":"td",pe=ie.align?"<"+ce+' align="'+ie.align+'">':"<"+ce+">";return pe+ee+"</"+ce+`>
`},ne.strong=function(ee){return"<strong>"+ee+"</strong>"},ne.em=function(ee){return"<em>"+ee+"</em>"},ne.codespan=function(ee){return"<code>"+ee+"</code>"},ne.br=function(){return this.options.xhtml?"<br/>":"<br>"},ne.del=function(ee){return"<del>"+ee+"</del>"},ne.link=function(ee,ie,ce){if(ee=Ze(this.options.sanitize,this.options.baseUrl,ee),ee===null)return ce;var pe='<a href="'+He(ee)+'"';return ie&&(pe+=' title="'+ie+'"'),pe+=">"+ce+"</a>",pe},ne.image=function(ee,ie,ce){if(ee=Ze(this.options.sanitize,this.options.baseUrl,ee),ee===null)return ce;var pe='<img src="'+ee+'" alt="'+ce+'"';return ie&&(pe+=' title="'+ie+'"'),pe+=this.options.xhtml?"/>":">",pe},ne.text=function(ee){return ee},q}(),Xe=function(){function q(){}var ne=q.prototype;return ne.strong=function(ee){return ee},ne.em=function(ee){return ee},ne.codespan=function(ee){return ee},ne.del=function(ee){return ee},ne.html=function(ee){return ee},ne.text=function(ee){return ee},ne.link=function(ee,ie,ce){return""+ce},ne.image=function(ee,ie,ce){return""+ce},ne.br=function(){return""},q}(),dt=function(){function q(){this.seen={}}var ne=q.prototype;return ne.slug=function(ee){var ie=ee.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(ie)){var ce=ie;do this.seen[ce]++,ie=ce+"-"+this.seen[ce];while(this.seen.hasOwnProperty(ie))}return this.seen[ie]=0,ie},q}(),ct=W.defaults,gt=oe.unescape,at=function(){function q(ue){this.options=ue||ct,this.options.renderer=this.options.renderer||new ze,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Xe,this.slugger=new dt}q.parse=function(ee,ie){var ce=new q(ie);return ce.parse(ee)};var ne=q.prototype;return ne.parse=function(ee,ie){ie===void 0&&(ie=!0);var ce="",pe,xe,De,Be,$e,pt,xt,Ft,Ct,ot,Ut,Rt,_t,Vt,bt,cr,Gt,Tt,qt=ee.length;for(pe=0;pe<qt;pe++){ot=ee[pe];switch(ot.type){case"space":continue;case"hr":{ce+=this.renderer.hr();continue}case"heading":{ce+=this.renderer.heading(this.parseInline(ot.tokens),ot.depth,gt(this.parseInline(ot.tokens,this.textRenderer)),this.slugger);continue}case"code":{ce+=this.renderer.code(ot.text,ot.lang,ot.escaped);continue}case"table":{for(Ft="",xt="",Be=ot.header.length,xe=0;xe<Be;xe++)xt+=this.renderer.tablecell(this.parseInline(ot.tokens.header[xe]),{header:!0,align:ot.align[xe]});for(Ft+=this.renderer.tablerow(xt),Ct="",Be=ot.cells.length,xe=0;xe<Be;xe++){for(pt=ot.tokens.cells[xe],xt="",$e=pt.length,De=0;De<$e;De++)xt+=this.renderer.tablecell(this.parseInline(pt[De]),{header:!1,align:ot.align[De]});Ct+=this.renderer.tablerow(xt)}ce+=this.renderer.table(Ft,Ct);continue}case"blockquote":{Ct=this.parse(ot.tokens),ce+=this.renderer.blockquote(Ct);continue}case"list":{for(Ut=ot.ordered,Rt=ot.start,_t=ot.loose,Be=ot.items.length,Ct="",xe=0;xe<Be;xe++)bt=ot.items[xe],cr=bt.checked,Gt=bt.task,Vt="",bt.task&&(Tt=this.renderer.checkbox(cr),_t?bt.tokens.length>0&&bt.tokens[0].type==="text"?(bt.tokens[0].text=Tt+" "+bt.tokens[0].text,bt.tokens[0].tokens&&bt.tokens[0].tokens.length>0&&bt.tokens[0].tokens[0].type==="text"&&(bt.tokens[0].tokens[0].text=Tt+" "+bt.tokens[0].tokens[0].text)):bt.tokens.unshift({type:"text",text:Tt}):Vt+=Tt),Vt+=this.parse(bt.tokens,_t),Ct+=this.renderer.listitem(Vt,Gt,cr);ce+=this.renderer.list(Ct,Ut,Rt);continue}case"html":{ce+=this.renderer.html(ot.text);continue}case"paragraph":{ce+=this.renderer.paragraph(this.parseInline(ot.tokens));continue}case"text":{for(Ct=ot.tokens?this.parseInline(ot.tokens):ot.text;pe+1<qt&&ee[pe+1].type==="text";)ot=ee[++pe],Ct+=`
`+(ot.tokens?this.parseInline(ot.tokens):ot.text);ce+=ie?this.renderer.paragraph(Ct):Ct;continue}default:{var nt='Token with "'+ot.type+'" type was not found.';if(this.options.silent){console.error(nt);return}else throw new Error(nt)}}}return ce},ne.parseInline=function(ee,ie){ie=ie||this.renderer;var ce="",pe,xe,De=ee.length;for(pe=0;pe<De;pe++){xe=ee[pe];switch(xe.type){case"escape":{ce+=ie.text(xe.text);break}case"html":{ce+=ie.html(xe.text);break}case"link":{ce+=ie.link(xe.href,xe.title,this.parseInline(xe.tokens,ie));break}case"image":{ce+=ie.image(xe.href,xe.title,xe.text);break}case"strong":{ce+=ie.strong(this.parseInline(xe.tokens,ie));break}case"em":{ce+=ie.em(this.parseInline(xe.tokens,ie));break}case"codespan":{ce+=ie.codespan(xe.text);break}case"br":{ce+=ie.br();break}case"del":{ce+=ie.del(this.parseInline(xe.tokens,ie));break}case"text":{ce+=ie.text(xe.text);break}default:{var Be='Token with "'+xe.type+'" type was not found.';if(this.options.silent){console.error(Be);return}else throw new Error(Be)}}}return ce},q}(),ft=oe.merge,lt=oe.checkSanitizeDeprecation,Ye=oe.escape,Ne=W.getDefaults,ht=W.changeDefaults,qe=W.defaults;function le(q,ne,ue){if(typeof q=="undefined"||q===null)throw new Error("marked(): input parameter is undefined or null");if(typeof q!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(q)+", string expected");if(typeof ne=="function"&&(ue=ne,ne=null),ne=ft({},le.defaults,ne||{}),lt(ne),ue){var ee=ne.highlight,ie;try{ie=Oe.lex(q,ne)}catch(De){return ue(De)}var ce=function(Be){var $e;if(!Be)try{$e=at.parse(ie,ne)}catch(pt){Be=pt}return ne.highlight=ee,Be?ue(Be):ue(null,$e)};if(!ee||ee.length<3)return ce();if(delete ne.highlight,!ie.length)return ce();var pe=0;le.walkTokens(ie,function(De){De.type==="code"&&(pe++,setTimeout(function(){ee(De.text,De.lang,function(Be,$e){if(Be)return ce(Be);$e!=null&&$e!==De.text&&(De.text=$e,De.escaped=!0),pe--,pe===0&&ce()})},0))}),pe===0&&ce();return}try{var xe=Oe.lex(q,ne);return ne.walkTokens&&le.walkTokens(xe,ne.walkTokens),at.parse(xe,ne)}catch(De){if(De.message+=`
Please report this to https://github.com/markedjs/marked.`,ne.silent)return"<p>An error occurred:</p><pre>"+Ye(De.message+"",!0)+"</pre>";throw De}}le.options=le.setOptions=function(q){return ft(le.defaults,q),ht(le.defaults),le},le.getDefaults=Ne,le.defaults=qe,le.use=function(q){var ne=ft({},q);if(q.renderer&&function(){var ee=le.defaults.renderer||new ze,ie=function(xe){var De=ee[xe];ee[xe]=function(){for(var Be=arguments.length,$e=new Array(Be),pt=0;pt<Be;pt++)$e[pt]=arguments[pt];var xt=q.renderer[xe].apply(ee,$e);return xt===!1&&(xt=De.apply(ee,$e)),xt}};for(var ce in q.renderer)ie(ce);ne.renderer=ee}(),q.tokenizer&&function(){var ee=le.defaults.tokenizer||new _e,ie=function(xe){var De=ee[xe];ee[xe]=function(){for(var Be=arguments.length,$e=new Array(Be),pt=0;pt<Be;pt++)$e[pt]=arguments[pt];var xt=q.tokenizer[xe].apply(ee,$e);return xt===!1&&(xt=De.apply(ee,$e)),xt}};for(var ce in q.tokenizer)ie(ce);ne.tokenizer=ee}(),q.walkTokens){var ue=le.defaults.walkTokens;ne.walkTokens=function(ee){q.walkTokens(ee),ue&&ue(ee)}}le.setOptions(ne)},le.walkTokens=function(q,ne){for(var ue=A(q),ee;!(ee=ue()).done;){var ie=ee.value;ne(ie);switch(ie.type){case"table":{for(var ce=A(ie.tokens.header),pe;!(pe=ce()).done;){var xe=pe.value;le.walkTokens(xe,ne)}for(var De=A(ie.tokens.cells),Be;!(Be=De()).done;)for(var $e=Be.value,pt=A($e),xt;!(xt=pt()).done;){var Ft=xt.value;le.walkTokens(Ft,ne)}break}case"list":{le.walkTokens(ie.items,ne);break}default:ie.tokens&&le.walkTokens(ie.tokens,ne)}}},le.Parser=at,le.parser=at.parse,le.Renderer=ze,le.TextRenderer=Xe,le.Lexer=Oe,le.lexer=Oe.lex,le.Tokenizer=_e,le.Slugger=dt,le.parse=le;var Z=le;return Z})},E7E6:function(Ge,We){Ge.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADUCAYAAADZTGx+AAAgAElEQVR4Xu2dC3BU13nHv7MrIQkQQoCEtAIEAmxig4GACxhogpM6NY7jOKZO4nimwcFot23SNNNO02napJN0JjN9TNMm5eG3x4+YSeI3ftUGjCDGQMBgG4wxb+0u4mEeQhJI2tP539WR7i77uPfuvXfvar8zs7Mr7bnn8Z3vt9/5zlMQB5aAQQmsW7fO397eHujp6Rkfi8XGExFeDX2vABHVSSlrhBDDiKhdSnlOCBGWUu4mol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/q6urq3hBBXb+J3pSTZM/E0IMnFj0Qi10kp/4QotphILJJSjs1eRY6RbwkIIU4SyRYi32YhxBv19fUD9yLku3BZ8i8oQJLrcurUiWt6e8Wi3l7CyBiO8JvicXkXS/EOEokWv582+/2ypaZm3IFCrXhBA5Is9La2trqenp6biGi2lJhv0eZcxhVq4xRIuU8Qid1CCKyB31VSUrK1trY2WiBlz1rMQQVIqtpeuHBidEcHzZIy/iLSXtfyWrGsupEQIb7WiT4iot1CxF9Dh9LuESPGnTGXUmHFHvSApGoOzLm0tbU19vb2TpVSThGCphLJKVLSVCFoYrHCAwikpCNC0MdE4qCU9LEQ4qDf7/+4trb2aN/cRGFpeI6lLUpAMslMSulva2ub2NPT0+TzyUAsJup9PgpIKQNSinohtM/1RFRo5/1cFkJEpKSwEDIihAjHYhT2+WQkFhPhkpKSQ7W1tUdwsnmOOjWoHmdALDbn+fPnR3V2dgKW0ULEqmIxUSWlHCmErJJSVAlBVVIS3kcS4X9ULoQolVKWZnpHcaSU3UKI7szv1EUkzuNSKSEI7+eFkOelFOeFEOd8Pnz24fOZioqKcFVV1VmLVS3qx/4fQLyzKIIkCJoAAAAASUVORK5CYII="},ELLl:function(Ge,We,X){(function(de){de(X("VrN/"))})(function(de){var V={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},O=de.Pos;de.defineOption("autoCloseBrackets",!1,function(T,y,u){u&&u!=de.Init&&(T.removeKeyMap(A),T.state.closeBrackets=null),y&&(k(H(y,"pairs")),T.state.closeBrackets=y,T.addKeyMap(A))});function H(T,y){return y=="pairs"&&typeof T=="string"?T:typeof T=="object"&&T[y]!=null?T[y]:V[y]}var A={Backspace:P,Enter:L};function k(T){for(var y=0;y<T.length;y++){var u=T.charAt(y),a="'"+u+"'";A[a]||(A[a]=W(u))}}k(V.pairs+"`");function W(T){return function(y){return E(y,T)}}function U(T){var y=T.state.closeBrackets;if(!y||y.override)return y;var u=T.getModeAt(T.getCursor());return u.closeBrackets||y}function P(T){var y=U(T);if(!y||T.getOption("disableInput"))return de.Pass;for(var u=H(y,"pairs"),a=T.listSelections(),l=0;l<a.length;l++){if(!a[l].empty())return de.Pass;var s=I(T,a[l].head);if(!s||u.indexOf(s)%2!=0)return de.Pass}for(var l=a.length-1;l>=0;l--){var m=a[l].head;T.replaceRange("",O(m.line,m.ch-1),O(m.line,m.ch+1),"+delete")}}function L(T){var y=U(T),u=y&&H(y,"explode");if(!u||T.getOption("disableInput"))return de.Pass;for(var a=T.listSelections(),l=0;l<a.length;l++){if(!a[l].empty())return de.Pass;var s=I(T,a[l].head);if(!s||u.indexOf(s)%2!=0)return de.Pass}T.operation(function(){var m=T.lineSeparator()||`
`;T.replaceSelection(m+m,null),T.execCommand("goCharLeft"),a=T.listSelections();for(var d=0;d<a.length;d++){var f=a[d].head.line;T.indentLine(f,null,!0),T.indentLine(f+1,null,!0)}})}function b(T){var y=de.cmpPos(T.anchor,T.head)>0;return{anchor:new O(T.anchor.line,T.anchor.ch+(y?-1:1)),head:new O(T.head.line,T.head.ch+(y?1:-1))}}function E(T,y){var u=U(T);if(!u||T.getOption("disableInput"))return de.Pass;var a=H(u,"pairs"),l=a.indexOf(y);if(l==-1)return de.Pass;for(var s=H(u,"closeBefore"),m=H(u,"triples"),d=a.charAt(l+1)==y,f=T.listSelections(),D=l%2==0,v,h=0;h<f.length;h++){var p=f[h],c=p.head,o,x=T.getRange(c,O(c.line,c.ch+1));if(D&&!p.empty())o="surround";else if((d||!D)&&x==y)d&&w(T,c)?o="both":m.indexOf(y)>=0&&T.getRange(c,O(c.line,c.ch+3))==y+y+y?o="skipThree":o="skip";else if(d&&c.ch>1&&m.indexOf(y)>=0&&T.getRange(O(c.line,c.ch-2),c)==y+y){if(c.ch>2&&/\bstring/.test(T.getTokenTypeAt(O(c.line,c.ch-2))))return de.Pass;o="addFour"}else if(d){var g=c.ch==0?" ":T.getRange(O(c.line,c.ch-1),c);if(!de.isWordChar(x)&&g!=y&&!de.isWordChar(g))o="both";else return de.Pass}else if(D&&(x.length===0||/\s/.test(x)||s.indexOf(x)>-1))o="both";else return de.Pass;if(!v)v=o;else if(v!=o)return de.Pass}var C=l%2?a.charAt(l-1):y,_=l%2?y:a.charAt(l+1);T.operation(function(){if(v=="skip")T.execCommand("goCharRight");else if(v=="skipThree")for(var z=0;z<3;z++)T.execCommand("goCharRight");else if(v=="surround"){for(var Y=T.getSelections(),z=0;z<Y.length;z++)Y[z]=C+Y[z]+_;T.replaceSelections(Y,"around"),Y=T.listSelections().slice();for(var z=0;z<Y.length;z++)Y[z]=b(Y[z]);T.setSelections(Y)}else v=="both"?(T.replaceSelection(C+_,null),T.triggerElectric(C+_),T.execCommand("goCharLeft")):v=="addFour"&&(T.replaceSelection(C+C+C+C,"before"),T.execCommand("goCharRight"))})}function I(T,y){var u=T.getRange(O(y.line,y.ch-1),O(y.line,y.ch+1));return u.length==2?u:null}function w(T,y){var u=T.getTokenAt(O(y.line,y.ch+1));return/\bstring/.test(u.type)&&u.start==y.ch&&(y.ch==0||!/\bstring/.test(T.getTokenTypeAt(y)))}})},F8wB:function(Ge,We,X){Ge.exports={loading:"loading___1SIOG"}},FOrL:function(Ge,We,X){Ge.exports=X.p+"static/nodata.a6b3f948.png"},FPkq:function(Ge,We,X){Ge.exports=X.p+"static/qrCode.dd0fe9b2.png"},GABl:function(Ge,We){Ge.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAYAAADFeBvrAAAKi0lEQVRoQ71ae3BU1Rn//e7dzYuioNRsHlSqRiUB2eUx0hbaKAHEAMWxiQ6PTUAUGCuIQNVOZ0xnrHUE5GHHIqOwCag8BlQiQnnUokgt5AEIK5GnBpIFXwjkAdl7vs7dkJCETXLvEj3/5d7v9/u+337nfN8554bowBHo16+3YRh3K7IPBHcRSIDI9QJ0AWkA8h0E3xM8DWAvde5x6Pqe+D17jnVUGLxWogqPp78SGSeC3wP4ZUR8pJ+Ct50O7e344uKjEXFcBkUkSERY6e43RkE9J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BTpsD3l2nKU/mGe43DFiV5Ksb8SNUCj9lrlhOUl5r8JwG9evjMBhDmdjkJYBp2luLPHHrL+nq8jxv8BV2A7FHmr6w0AAAAASUVORK5CYII="},Gytx:function(Ge,We){Ge.exports=function(de,V,O,H){var A=O?O.call(H,de,V):void 0;if(A!==void 0)return!!A;if(de===V)return!0;if(typeof de!="object"||!de||typeof V!="object"||!V)return!1;var k=Object.keys(de),W=Object.keys(V);if(k.length!==W.length)return!1;for(var U=Object.prototype.hasOwnProperty.bind(V),P=0;P<k.length;P++){var L=k[P];if(!U(L))return!1;var b=de[L],E=V[L];if(A=O?O.call(H,b,E,L):void 0,A===!1||A===void 0&&b!==E)return!1}return!0}},HmJG:function(Ge,We,X){},HpTS:function(Ge,We,X){Ge.exports=X.p+"static/small_program.f74069ec.png"},I8Z2:function(Ge,We,X){"use strict";X.d(We,"a",function(){return H}),X.d(We,"b",function(){return I}),X.d(We,"c",function(){return T});var de=X("q1tI"),V=function(){var y=function(u,a){return y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,s){l.__proto__=s}||function(l,s){for(var m in s)s.hasOwnProperty(m)&&(l[m]=s[m])},y(u,a)};return function(u,a){y(u,a);function l(){this.constructor=u}u.prototype=a===null?Object.create(a):(l.prototype=a.prototype,new l)}}(),O=de.createContext(null),H=function(y){V(u,y);function u(){return y!==null&&y.apply(this,arguments)||this}return u.prototype.render=function(){return de.createElement(O.Provider,{value:this.props.store},this.props.children)},u}(de.Component),A=X("Gytx"),k=X.n(A),W=X("2mql"),U=X.n(W),P=function(){var y=function(u,a){return y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,s){l.__proto__=s}||function(l,s){for(var m in s)s.hasOwnProperty(m)&&(l[m]=s[m])},y(u,a)};return function(u,a){y(u,a);function l(){this.constructor=u}u.prototype=a===null?Object.create(a):(l.prototype=a.prototype,new l)}}(),L=function(){return L=Object.assign||function(y){for(var u,a=1,l=arguments.length;a<l;a++){u=arguments[a];for(var s in u)Object.prototype.hasOwnProperty.call(u,s)&&(y[s]=u[s])}return y},L.apply(this,arguments)};function b(y){return y.displayName||y.name||"Component"}var E=function(){return{}};function I(y,u){u===void 0&&(u={});var a=!!y,l=y||E;return function(m){var d=function(D){P(v,D);function v(h,p){var c=D.call(this,h,p)||this;return c.unsubscribe=null,c.handleChange=function(){if(!c.unsubscribe)return;var o=l(c.store.getState(),c.props);c.setState({subscribed:o})},c.store=c.context,c.state={subscribed:l(c.store.getState(),h),store:c.store,props:h},c}return v.getDerivedStateFromProps=function(h,p){return y&&y.length===2&&h!==p.props?{subscribed:l(p.store.getState(),h),props:h}:{props:h}},v.prototype.componentDidMount=function(){this.trySubscribe()},v.prototype.componentWillUnmount=function(){this.tryUnsubscribe()},v.prototype.shouldComponentUpdate=function(h,p){return!k()(this.props,h)||!k()(this.state.subscribed,p.subscribed)},v.prototype.trySubscribe=function(){a&&(this.unsubscribe=this.store.subscribe(this.handleChange),this.handleChange())},v.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null)},v.prototype.render=function(){var h=L(L(L({},this.props),this.state.subscribed),{store:this.store});return de.createElement(m,L({},h,{ref:this.props.miniStoreForwardedRef}))},v.displayName="Connect("+b(m)+")",v.contextType=O,v}(de.Component);if(u.forwardRef){var f=de.forwardRef(function(D,v){return de.createElement(d,L({},D,{miniStoreForwardedRef:v}))});return U()(f,m)}return U()(d,m)}}var w=function(){return w=Object.assign||function(y){for(var u,a=1,l=arguments.length;a<l;a++){u=arguments[a];for(var s in u)Object.prototype.hasOwnProperty.call(u,s)&&(y[s]=u[s])}return y},w.apply(this,arguments)};function T(y){var u=y,a=[];function l(d){u=w(w({},u),d);for(var f=0;f<a.length;f++)a[f]()}function s(){return u}function m(d){return a.push(d),function(){var D=a.indexOf(d);a.splice(D,1)}}return{setState:l,getState:s,subscribe:m}}},JWDV:function(Ge,We,X){Ge.exports=X.p+"static/charpter-white.5fa14f93.svg"},JeFH:function(Ge,We){Ge.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eyOsTTKenBWAjYhbxxs6YemG3B+EGQY5xo4ekbPZF7j/OEcR0FzW1IQmeCPommI5iyPnkQlURgqhxU26Y3JHeNwXhcfsuL4/p9pQTdIzfP9ngPuc6SU3AU7mo0bgCYrXg/Hi2dETrHyXVa+HS2l5Ft21+6usMBuhMtidE/UECdlDYSggk6oV1psa893Qb3rlCW54ZepouXg37l3d0aAfzL/cNSYZcT0LvEYnuqyvnIrIChHo/dbZYjDbPxslSFLAfGUEIIcZ3gppTpvd6zLqweOVZuI0TUVDRgSOzjVy5yWFKSmTNn6vv2LxlMx7jdEMtiZcbR6h/kdmh7nkIlctlUCiLnQNL7Xs7W5g6mrq+sTExNDg6gM9eE5xFEM4HhLL4pJKYdwvg5msCsgg4AwFceueyptKZ/XNO3pkIdqkPaXVdAGjfwkt1FTzeXveCAN7QYNp/gMDEzxYFhaLAaneaH8xTY5hrvasu1/5ebmzuvcuXOTn8KRUpLZ5sQpWVD+EgvfAKEcBWQ1mjUK554XYFvnw7YEhAhCSr6pYULTv2R6aklBAwC5Y3uJief2VyqtEoHGG5rT/4nVVN+EPaCsBB0pkT0gyyyDpq+HEB8DWNTSa/PNbbgt/yal5NkxyzI90VRVdI3+HSFpmyuk0MeTeGXnkspgrE/0aGgfyxxqoJPPQGe/BxxcDYtiBiQ042to2mfsZwkheGA/ywr9NhJlIBekZBFqOrZ5kgCFhYUJqampbAWzp9LCsgDLrgB/t0foByDkdkB1UrdFv5j0s0j1Ax8qpfxdqP/U8h1mIABN5EEYhyHELgBUBv87IAS98/9utUhA19TUZMXFxc0AcCZbIqG5A+YFvhvEMEQXVm4s6Jon6VKzA053dTI46OH8hMARhbwa5OCbboU/9e8//BRH8j9mLdQoDqqNCwAAAABJRU5ErkJggg=="},Jq4h:function(Ge,We,X){Ge.exports=X.p+"static/qrcode.2267e4d5.png"},LdHM:function(Ge,We,X){"use strict";X.d(We,"b",function(){return s}),X.d(We,"a",function(){return d});var de=X("1OyB"),V=X("vuIU"),O=X("Ji7U"),H=X("LK+K"),A=X("q1tI"),k=X("rePB"),W=X("Ff2n"),U=X("ODXe"),P=X("4IlW"),L=X("bX4T"),b=X("YrtM"),E=X("TSYQ"),I=X.n(E),w=X("+nKL"),T=X("8OUc"),y=function(se,fe){var Se=se.prefixCls,ke=se.id,Je=se.flattenOptions,_e=se.childrenAsData,Qe=se.values,Ue=se.searchValue,Fe=se.multiple,we=se.defaultActiveFirstOption,F=se.height,R=se.itemHeight,M=se.notFoundContent,K=se.open,$=se.menuItemSelectedIcon,B=se.virtual,ge=se.onSelect,Oe=se.onToggleOpen,je=se.onActiveValue,Ze=se.onScroll,He=se.onMouseEnter,ze="".concat(Se,"-item"),Xe=Object(b.a)(function(){return Je},[K,Je],function(Z,q){return q[0]&&Z[1]!==q[1]}),dt=A.useRef(null),ct=function(q){q.preventDefault()},gt=function(q){dt.current&&dt.current.scrollTo({index:q})},at=function(q){for(var ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,ue=Xe.length,ee=0;ee<ue;ee+=1){var ie=(q+ee*ne+ue)%ue,ce=Xe[ie],pe=ce.group,xe=ce.data;if(!pe&&!xe.disabled)return ie}return-1},ft=A.useState(function(){return at(0)}),lt=Object(U.a)(ft,2),Ye=lt[0],Ne=lt[1],ht=function(q){Ne(q);var ne=Xe[q];if(!ne){je(null,-1);return}je(ne.data.value,q)};A.useEffect(function(){ht(we!==!1?at(0):-1)},[Xe.length,Ue]),A.useEffect(function(){var Z=setTimeout(function(){if(!Fe&&K&&Qe.size===1){var q=Array.from(Qe)[0],ne=Xe.findIndex(function(ue){var ee=ue.data;return ee.value===q});ht(ne),gt(ne)}});return function(){return clearTimeout(Z)}},[K]);var qe=function(q){q!==void 0&&ge(q,{selected:!Qe.has(q)}),Fe||Oe(!1)};if(A.useImperativeHandle(fe,function(){return{onKeyDown:function(q){var ne=q.which;switch(ne){case P.a.UP:case P.a.DOWN:{var ue=0;if(ne===P.a.UP?ue=-1:ne===P.a.DOWN&&(ue=1),ue!==0){var ee=at(Ye+ue,ue);gt(ee),ht(ee)}break}case P.a.ENTER:{var ie=Xe[Ye];ie&&!ie.data.disabled?qe(ie.data.value):qe(void 0),K&&q.preventDefault();break}case P.a.ESC:Oe(!1)}},onKeyUp:function(){},scrollTo:function(q){gt(q)}}}),Xe.length===0)return A.createElement("div",{role:"listbox",id:"".concat(ke,"_list"),className:"".concat(ze,"-empty"),onMouseDown:ct},M);function le(Z){var q=Xe[Z];if(!q)return null;var ne=q.data||{},ue=ne.value,ee=ne.label,ie=ne.children,ce=Object(L.a)(ne,!0),pe=_e?ie:ee;return q?A.createElement("div",Object.assign({"aria-label":typeof pe=="string"?pe:null},ce,{key:Z,role:"option",id:"".concat(ke,"_list_").concat(Z),"aria-selected":Qe.has(ue)}),ue):null}return A.createElement(A.Fragment,null,A.createElement("div",{role:"listbox",id:"".concat(ke,"_list"),style:{height:0,width:0,overflow:"hidden"}},le(Ye-1),le(Ye),le(Ye+1)),A.createElement(w.a,{itemKey:"key",ref:dt,data:Xe,height:F,itemHeight:R,fullHeight:!1,onMouseDown:ct,onScroll:Ze,virtual:B,onMouseEnter:He},function(Z,q){var ne,ue=Z.group,ee=Z.groupOption,ie=Z.data,ce=ie.label,pe=ie.key;if(ue)return A.createElement("div",{className:I()(ze,"".concat(ze,"-group"))},ce!==void 0?ce:pe);var xe=ie.disabled,De=ie.value,Be=ie.title,$e=ie.children,pt=ie.style,xt=ie.className,Ft=Object(W.a)(ie,["disabled","value","title","children","style","className"]),Ct=Qe.has(De),ot="".concat(ze,"-option"),Ut=I()(ze,ot,xt,(ne={},Object(k.a)(ne,"".concat(ot,"-grouped"),ee),Object(k.a)(ne,"".concat(ot,"-active"),Ye===q&&!xe),Object(k.a)(ne,"".concat(ot,"-disabled"),xe),Object(k.a)(ne,"".concat(ot,"-selected"),Ct),ne)),Rt=_e?$e:ce,_t=!$||typeof $=="function"||Ct;return A.createElement("div",Object.assign({},Ft,{"aria-selected":Ct,className:Ut,title:Be,onMouseMove:function(){if(Ye===q||xe)return;ht(q)},onClick:function(){xe||qe(De)},style:pt}),A.createElement("div",{className:"".concat(ot,"-content")},Rt||De),A.isValidElement($)||Ct,_t&&A.createElement(T.a,{className:"".concat(ze,"-option-state"),customizeIcon:$,customizeIconProps:{isSelected:Ct}},Ct?"\u2713":null))}))},u=A.forwardRef(y);u.displayName="OptionList";var a=u,l=function(){return null};l.isSelectOption=!0;var s=l,m=function(){return null};m.isSelectOptGroup=!0;var d=m,f=X("VTBJ"),D=X("Zm9Q");function v(j){var se=j.key,fe=j.props,Se=fe.children,ke=fe.value,Je=Object(W.a)(fe,["children","value"]);return Object(f.a)({key:se,value:ke!==void 0?ke:se,children:Se},Je)}function h(j){var se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(D.a)(j).map(function(fe,Se){if(!A.isValidElement(fe)||!fe.type)return null;var ke=fe.type.isSelectOptGroup,Je=fe.key,_e=fe.props,Qe=_e.children,Ue=Object(W.a)(_e,["children"]);return se||!ke?v(fe):Object(f.a)(Object(f.a)({key:"__RC_SELECT_GRP__".concat(Je===null?Se:Je,"__"),label:Je},Ue),{},{options:h(Qe)})}).filter(function(fe){return fe})}var p=X("2Qr1"),c=X("qNPg"),o=X("U8pU"),x=X("Kwbf"),g=X("WKfj");function C(j){var se=j.mode,fe=j.options,Se=j.children,ke=j.backfill,Je=j.allowClear,_e=j.placeholder,Qe=j.getInputElement,Ue=j.showSearch,Fe=j.onSearch,we=j.defaultOpen,F=j.autoFocus,R=j.labelInValue,M=j.value,K=j.inputValue,$=j.optionLabelProp,B=se==="multiple"||se==="tags",ge=Ue!==void 0?Ue:B||se==="combobox",Oe=fe||h(Se);if(Object(x.a)(se!=="tags"||Oe.every(function(ze){return!ze.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),se==="tags"||se==="combobox"){var je=Oe.some(function(ze){return ze.options?ze.options.some(function(Xe){return typeof("value"in Xe?Xe.value:Xe.key)=="number"}):typeof("value"in ze?ze.value:ze.key)=="number"});Object(x.a)(!je,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(x.a)(se!=="combobox"||!$,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(x.a)(se==="combobox"||!ke,"`backfill` only works with `combobox` mode."),Object(x.a)(se==="combobox"||!Qe,"`getInputElement` only work with `combobox` mode."),Object(x.b)(se!=="combobox"||!Qe||!Je||!_e,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Fe&&!ge&&se!=="combobox"&&se!=="tags"&&Object(x.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(x.b)(!we||F,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),M!=null){var Ze=Object(g.d)(M);Object(x.a)(!R||Ze.every(function(ze){return Object(o.a)(ze)==="object"&&("key"in ze||"value"in ze)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(x.a)(!B||Array.isArray(M),"`value` should be array when `mode` is `multiple` or `tags`")}if(Se){var He=null;Object(D.a)(Se).some(function(ze){if(!A.isValidElement(ze)||!ze.type)return!1;var Xe=ze.type;if(Xe.isSelectOption)return!1;if(Xe.isSelectOptGroup){var dt=Object(D.a)(ze.props.children).every(function(ct){return!A.isValidElement(ct)||!ze.type||ct.type.isSelectOption?!0:(He=ct.type,!1)});return!dt}return He=Xe,!0}),He&&Object(x.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(He.displayName||He.name||He,"`.")),Object(x.a)(K===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var _=C,z=Object(c.a)({prefixCls:"rc-select",components:{optionList:a},convertChildrenToData:h,flattenOptions:p.d,getLabeledValue:p.e,filterOptions:p.b,isValueDisabled:p.g,findValueOption:p.c,warningProps:_,fillOptionsWithMissingValue:p.a}),Y=function(j){Object(O.a)(fe,j);var se=Object(H.a)(fe);function fe(){var Se;return Object(de.a)(this,fe),Se=se.apply(this,arguments),Se.selectRef=A.createRef(),Se.focus=function(){Se.selectRef.current.focus()},Se.blur=function(){Se.selectRef.current.blur()},Se}return Object(V.a)(fe,[{key:"render",value:function(){return A.createElement(z,Object.assign({ref:this.selectRef},this.props))}}]),fe}(A.Component);Y.Option=s,Y.OptGroup=d;var oe=Y,G=We.c=oe},M8RZ:function(Ge,We,X){"use strict";X.d(We,"a",function(){return P});var de=X("fWQN"),V=X("mtLc"),O=X("yKVA"),H=X("879j"),A=X("q1tI"),k=X.n(A),W=X("i8i4"),U=X.n(W),P=function(L){Object(O.a)(E,L);var b=Object(H.a)(E);function E(I){var w;Object(de.a)(this,E),w=b.call(this,I);var T=window.document;return w.node=T.createElement("div"),T.body.appendChild(w.node),w}return Object(V.a)(E,[{key:"render",value:function(){var w=this.props.children;return Object(W.createPortal)(w,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),E}(k.a.Component)},Nmxd:function(Ge,We){Ge.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAF4ElEQVRoQ91aW2wUVRj+/rPbSivURIgKjZcHjUYTgZ0lthgv3V0LSqB9IAQeNNEIaKKwZbcFnuQJoZ1piyYawJjIiwZDwiVBaHd28QItaWeLD4KJPgimiA+YCAZj6Z7fzPZiu7e57WriJE0f5v++//tm/j3nn3MOoQyXcmJ/LdfeCBOjEUA9EdUzUA9g0ST9VQJGmXkU5n/CAN2q043Vm295TU9uCRS9MwCiFWBqAmD++R1yjQNIgTgF5tNGuCPtEJ8Nd2xgWarzPil9UbBsA1G1m6R5GOYxkOgRItM71NRxzQmnIwMBvStKoCiAB50kcRB7mcG96XB7r12MLQNPJXrvzdD4QQZW2yX2EkfACR/7N56PRH+14rE0sDSpLRaM4wA/YEVW3vt0RRLWjIRi35biLWkgmOhaz0SflleYMzZi3jAcaf+sGKqoAUVX3wbwnrN0FYveYoTj7xdiL2ggqKsvMnCyYnJcEBPw0nA4/kUuNM9AINX9MMnMIE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NlYesaIFcJ8s+TLM9UQDwY1JYOx6Y3QPLXRpNqPzEiHpJfBOAD8KgHjoJQs3VIh+Kzlj3zDCzp63zEJ8QgCHeXW4AnPsZvGSkbLjR3/DCT5/+3vD7lTkl0bQHRPk9PrVxg5q1GpL3gZkvpLaZU93qW8r/dYhJiw3DTNudbTFMPb1lf5xIpxHEQ7i/XA7XFw/hZSLlmqLn094flLqWZzNzcZikO/JvbrCTkJjub3rYMZJ8YgwJJbSuBK7zRTb3pUGwfCGznTdk3MMm2tG/vIvL7tpJE1G3vlCeMMcYCvTye2TfSvP2qHeFTMY4NTI9Sek8AJFewlCGi7IEPc/JycmWYOUVCJMHitNmYOQF7NjAzmTK8v5Z/N4/biEYI1BN46riNeeTGvEazx21Ao5DmcRs5QHfV6UbQ+3GbvwHH7EQQahyMxwAAAABJRU5ErkJggg=="},O2Wb:function(Ge,We,X){Ge.exports={flex:"flex___2gmSR",flex1:"flex1___3Tu1g",color666:"color666___2uyGL",error:"error___yJ86W",deleteIcon:"deleteIcon___1D2tg",addIcon:"addIcon___2VIYB"}},OLES:function(Ge,We,X){"use strict";var de=X("U8pU"),V=X("VTBJ"),O=X("Ff2n"),H=X("q1tI"),A=X("uciX"),k=X("7ixt"),W=function(I){var w=I.overlay,T=I.prefixCls,y=I.id,u=I.overlayInnerStyle;return H.createElement("div",{className:"".concat(T,"-inner"),id:y,role:"tooltip",style:u},typeof w=="function"?w():w)},U=W,P=function(I,w){var T=I.overlayClassName,y=I.trigger,u=y===void 0?["hover"]:y,a=I.mouseEnterDelay,l=a===void 0?0:a,s=I.mouseLeaveDelay,m=s===void 0?.1:s,d=I.overlayStyle,f=I.prefixCls,D=f===void 0?"rc-tooltip":f,v=I.children,h=I.onVisibleChange,p=I.afterVisibleChange,c=I.transitionName,o=I.animation,x=I.placement,g=x===void 0?"right":x,C=I.align,_=C===void 0?{}:C,z=I.destroyTooltipOnHide,Y=z===void 0?!1:z,oe=I.defaultVisible,G=I.getTooltipContainer,j=I.overlayInnerStyle,se=Object(O.a)(I,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),fe=Object(H.useRef)(null);Object(H.useImperativeHandle)(w,function(){return fe.current});var Se=Object(V.a)({},se);"visible"in I&&(Se.popupVisible=I.visible);var ke=function(){var Fe=I.arrowContent,we=Fe===void 0?null:Fe,F=I.overlay,R=I.id;return[H.createElement("div",{className:"".concat(D,"-arrow"),key:"arrow"},we),H.createElement(U,{key:"content",prefixCls:D,id:R,overlay:F,overlayInnerStyle:j})]},Je=!1,_e=!1;if(typeof Y=="boolean")Je=Y;else if(Y&&Object(de.a)(Y)==="object"){var Qe=Y.keepParent;Je=Qe===!0,_e=Qe===!1}return H.createElement(A.a,Object.assign({popupClassName:T,prefixCls:D,popup:ke,action:u,builtinPlacements:k.a,popupPlacement:g,ref:fe,popupAlign:_,getPopupContainer:G,onPopupVisibleChange:h,afterPopupVisibleChange:p,popupTransitionName:c,popupAnimation:o,defaultPopupVisible:oe,destroyPopupOnHide:Je,autoDestroy:_e,mouseLeaveDelay:m,popupStyle:d,mouseEnterDelay:l},Se),v)},L=Object(H.forwardRef)(P),b=We.a=L},Ohmc:function(Ge,We,X){Ge.exports=X.p+"static/certificate.fc32dc1b.jpg"},Ot1p:function(Ge,We,X){"use strict";var de=X("2qtc"),V=X("kLXV"),O=X("rAM+"),H=X("miYZ"),A=X("tsqr"),k=X("9og8"),W=X("tJVT"),U=X("jrin"),P=X("WmNS"),L=X.n(P),b=X("q1tI"),E=X.n(b),I=X("VrN/"),w=X.n(I),T=X("bdgK"),y=X("p77/"),u=X("Bd2K"),a=X("ELLl"),l=X("19Vz"),s=X("lZu9"),m=X("+NIl"),d=X("kSUc"),f=X("9Bee"),D=function(xe){var De=xe.value,Be=De===void 0?"":De,$e=xe.className,pt=xe.showTextOnly,xt=xe.showLines,Ft=xe.style,Ct=Ft===void 0?{}:Ft,ot=Object(b.useMemo)(function(){return""},[Be]);return E.a.createElement(E.a.Fragment,null,E.a.createElement("div",{dangerouslySetInnerHTML:{__html:ot}}))},v=X("0Owb"),h=X("dejd"),p=X("C+DQ"),c=X("1vsH"),o=X("m3rI"),x=[{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 g(xe){var De=xe.onActionCallback,Be=xe.title,$e=xe.icon,pt=xe.actionName,xt=xe.className,Ft=xt===void 0?"":xt,Ct=xe.children;function ot(){De(pt)}return E.a.createElement("a",{title:Be,className:Ft,onClick:ot},E.a.createElement("i",{className:"md-iconfont ".concat($e)}),Ct)}var C=function(xe){var De=xe.watch,Be=xe.showNullButton,$e=xe.onActionCallback,pt=xe.fullScreen,xt=xe.insertTemp,Ft=xe.hidetoolBar,Ct=xe.uuid,ot=xe.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(c.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(c.F)("_educoder_session"),"&key=").concat(Ct,"&api=").concat(encodeURIComponent(o.a.PROXY_SERVER)));var Ut=[].concat(x,[{title:"".concat(De?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(De?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return E.a.createElement("ul",{className:"markdown-toolbar-container"},!Ft&&Ut.map(function(Rt,_t){return E.a.createElement("li",{key:_t},Rt.actionName?E.a.createElement(g,Object(v.a)({},Rt,{onActionCallback:$e})):E.a.createElement("span",{className:"v-line"}))}),Be?E.a.createElement("li",null,E.a.createElement(g,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:$e},E.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,xt&&E.a.createElement("li",null,E.a.createElement(g,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(xt),onActionCallback:$e},E.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),E.a.createElement("li",{className:"btn-full-screen"},E.a.createElement(g,{icon:"".concat(pt?"icon-shrink":"icon-enlarge"),title:pt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:$e})))},_=X("M8RZ"),z=X("+L6B"),Y=X("2/Rp"),oe=X("y8nQ"),G=X("Vl3Y"),j=X("5NDa"),se=X("5rEg"),fe={labelCol:{span:4},wrapperCol:{span:20}},Se=function(xe){var De=xe.callback,Be=xe.onCancel;function $e(pt){De(pt)}return E.a.createElement(G.a,Object(v.a)({},fe,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:$e}),E.a.createElement(G.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},E.a.createElement(se.a,null)),E.a.createElement(G.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},E.a.createElement(se.a,null)),E.a.createElement("div",{className:"flex-container flex-end"},E.a.createElement(Y.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),E.a.createElement(Y.a,{type:"ghost",onClick:Be},"\u53D6\u6D88")))},ke=X("7ahc"),Je=X("HmJG"),_e=X("BjJ7"),Qe=G.a.useForm,Ue={width:280,marginRight:10},Fe={labelCol:{span:5},wrapperCol:{span:19}},we=function(xe){var De=xe.callback,Be=xe.onCancel,$e=Qe(),pt=Object(W.a)($e,1),xt=pt[0];function Ft(Ut){De(Ut)}function Ct(Ut,Rt){if(Ut.status===-1){A.b.error(Ut.message);return}xt.setFieldsValue({src:"/api/attachments/".concat(Ut.id),type:Rt.type})}function ot(Ut){var Rt=Ut.target.files[0];R(Rt,Ct)}return E.a.createElement(G.a,Object(v.a)({form:xt},Fe,{className:"upload-image-panel",onFinish:Ft}),E.a.createElement(G.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},E.a.createElement("div",{className:"flex-container"},E.a.createElement(G.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},E.a.createElement(se.a,{style:Ue})),E.a.createElement(F,{onFileChange:ot}))),E.a.createElement(G.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},E.a.createElement(se.a,{style:{width:264}})),E.a.createElement(G.a.Item,{style:{textAlign:"right"}},E.a.createElement(Y.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),E.a.createElement(Y.a,{type:"ghost",onClick:Be},"\u53D6\u6D88")))};function F(xe){var De=xe.onFileChange;return E.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",E.a.createElement("input",{type:"file",onChange:De}))}function R(xe,De){if(!xe)throw new String("\u6CA1\u6709\u6587\u4EF6");var Be=new FormData;Be.append("editormd-image-file",xe),Be.append("file_param_name","editormd-image-file"),Be.append("byxhr","true");var $e=new window.XMLHttpRequest;$e.withCredentials=!0,$e.addEventListener("load",function(pt){De(JSON.parse(pt.target.responseText),xe)},!1),$e.addEventListener("error",function(pt){console.error(pt)},!1),$e.open("POST","".concat(_e.a,"/api/attachments.json")),$e.send(Be)}var M=X("giR+"),K=X("fyUT"),$=X("7Kak"),B=X("9yH6"),ge=B.a.Group,Oe={margin:"0 8px"},je=function(xe){var De=xe.callback,Be=xe.onCancel;function $e(pt){De(pt)}return E.a.createElement(G.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:$e},E.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},E.a.createElement("span",{style:Oe},"\u5355\u5143\u683C\u6570\uFF1A"),E.a.createElement("span",{style:Oe},"\u884C\u6570"),E.a.createElement(G.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},E.a.createElement(K.a,null)),E.a.createElement("span",{style:Oe},"\u5217\u6570"),E.a.createElement(G.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},E.a.createElement(K.a,null))),E.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},E.a.createElement("span",{style:Oe},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),E.a.createElement(G.a.Item,{name:"align"},E.a.createElement(ge,null,E.a.createElement(B.a,{value:"default"},E.a.createElement("i",{className:"fa fa-align-justify"})),E.a.createElement(B.a,{value:"left"},E.a.createElement("i",{className:"fa fa-align-left"})),E.a.createElement(B.a,{value:"center"},E.a.createElement("i",{className:"fa fa-align-center"})),E.a.createElement(B.a,{value:"right"},E.a.createElement("i",{className:"fa fa-align-right"}))))),E.a.createElement("div",{className:"flex-container flex-end"},E.a.createElement(Y.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),E.a.createElement(Y.a,{type:"ghost",onClick:Be},"\u53D6\u6D88")))},Ze=X("ErOA"),He=X("7Cbv"),ze="link",Xe="upload-image",dt="code-block",ct="add-table",gt="------------",at={default:gt,left:":".concat(gt),center:":".concat(gt,":"),right:"".concat(gt,":")},ft=X("9VGf"),lt,Ye;function Ne(){}var ht=0,qe=1e4,le="\u2581",Z=`
**\u6A21\u677F\u6807\u9898**
\u6A21\u677F\u6B63\u6587\u5185\u5BB9\uFF0C\u53EF\u8F93\u5165\u6587\u672C\u5185\u5BB9\u548C\u7C98\u8D34\u56FE\u7247\u7B49\u64CD\u4F5C`;function q(xe){return/^\d+$/.test(xe)?"".concat(xe,"px"):xe}var ne=navigator.platform.toUpperCase().indexOf("MAC")>=0,ue=ne?"Cmd":"Ctrl",ee=["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"],ie=(lt={},Object(U.a)(lt,ue+"-B","bold"),Object(U.a)(lt,ue+"-I","italic"),lt),ce=(Ye={},Object(U.a)(Ye,ze,"\u6DFB\u52A0\u94FE\u63A5"),Object(U.a)(Ye,dt,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(U.a)(Ye,Xe,"\u6DFB\u52A0\u6587\u4EF6"),Object(U.a)(Ye,ct,"\u6DFB\u52A0\u8868\u683C"),Ye),pe=We.a=function(xe){var De=xe.defaultValue,Be=De===void 0?"":De,$e=xe.onChange,pt=xe.width,xt=pt===void 0?"100%":pt,Ft=xe.height,Ct=Ft===void 0?400:Ft,ot=xe.miniToolbar,Ut=ot===void 0?!1:ot,Rt=xe.isFocus,_t=Rt===void 0?!1:Rt,Vt=xe.watch,bt=xe.insertTemp,cr=xe.mode,Gt=cr===void 0?"markdown":cr,Tt=xe.id,qt=Tt===void 0?"markdown-editor-id":Tt,nt=xe.showResizeBar,Or=nt===void 0?!1:nt,ur=xe.noStorage,Ar=ur===void 0?!1:ur,ln=xe.showNullButton,Mr=ln===void 0?!1:ln,Et=xe.hidetoolBar,sr=Et===void 0?!1:Et,Gr=xe.fullScreen,zt=Gr===void 0?!1:Gr,Ht=xe.onBlur,vr=xe.onCMBeforeChange,pn=xe.onFullScreen,Br=xe.className,tt=Br===void 0?"":Br,Ot=xe.disablePaste,Ln=Ot===void 0?!1:Ot,ri=xe.placeholder,hi=ri===void 0?"":ri,zn=xe.values,fi=zn===void 0?"":zn,jt=Object(b.useState)(null),Hi=Object(W.a)(jt,2),st=Hi[0],yn=Hi[1],bn=Object(b.useState)(Be),Di=Object(W.a)(bn,2),ni=Di[0],In=Di[1],pi=Object(b.useState)(Vt),Ri=Object(W.a)(pi,2),An=Ri[0],Oi=Ri[1],Mi=Object(b.useState)(zt),mi=Object(W.a)(Mi,2),Pn=mi[0],ki=mi[1],na=Object(b.useState)(""),Er=Object(W.a)(na,2),Mt=Er[0],Wt=Er[1],nr=Object(b.useState)(0),yr=Object(W.a)(nr,2),Jt=yr[0],Zn=yr[1],un=Object(b.useState)(Ct),Ki=Object(W.a)(un,2),ia=Ki[0],Gn=Ki[1],En=Object(b.useState)(!1),dn=Object(W.a)(En,2),gi=dn[0],ii=dn[1],vi=Object(b.useRef)(Object(He.a)()),Li=Object(b.useRef)(!1),qn=Object(b.useRef)(),$n=Object(b.useRef)(),ei=Object(b.useRef)(),ai=Object(b.useRef)(),Ii=Object(b.useRef)(),ga=function(){var Dt=Object(k.a)(L.a.mark(function Kt(){var kt,tr;return L.a.wrap(function(Tr){for(;;)switch(Tr.prev=Tr.next){case 0:return Tr.next=2,Object(Ze.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:vi.current}});case 2:tr=Tr.sent,tr!=null&&(kt=tr.attachments)!==null&&kt!==void 0&&kt.length&&(console.log("cm:",st,$n),tr.attachments.map(function(hr){hr.content_type.indexOf("image")>-1?st.replaceSelection("![,](/api/attachments/".concat(hr.id,"?type=").concat(hr.content_type,")")):hr.content_type.indexOf("video")>-1?st.replaceSelection('<video width="100%" controls src="'.concat(o.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):hr.content_type.indexOf("pdf")>-1?st.replaceSelection('<a href="'.concat(o.a.API_SERVER,"/api/attachments/").concat(hr.id,"?type=").concat(hr.content_type,'&disposition=inline" target="_blank">').concat(hr.name,"</a>")):st.replaceSelection("[".concat(hr.name,"](").concat(o.a.API_SERVER,"/api/attachments/").concat(hr.id,"?type=").concat(hr.content_type,")"))}));case 4:case"end":return Tr.stop()}},Kt)}));return function(){return Dt.apply(this,arguments)}}();Object(b.useEffect)(function(){In(fi),st==null||st.setValue(fi)},[fi]),Object(b.useEffect)(function(){pn==null||pn(Pn)},[Pn]),Object(b.useEffect)(function(){if($n.current){var Dt=w.a.fromTextArea($n.current,{mode:Gt,lineNumbers:!Ut,lineWrapping:!0,value:Be,autoCloseTags:!0,autoCloseBrackets:!0});_t&&Dt.focus();function Kt(kt,tr){if(Ln){tr.preventDefault();return}var mr=tr.clipboardData;if(mr){var Tr=mr.types.toString(),hr=mr.items;if(Tr==="Files"||mr.types.indexOf("Files")>-1){if(tr.preventDefault(),Gt=="stex")return;try{var Vr,wn=hr[1];((Vr=hr[0])===null||Vr===void 0?void 0:Vr.kind)==="file"&&(wn=hr[0]);var ir=wn.getAsFile(),oi=ir.name.split(".").pop();R(ir,function(xr){if(xr.id){var mn,cn,Hn;(ir==null||((mn=ir.type)===null||mn===void 0)?void 0:mn.indexOf("image"))>-1?Dt.replaceSelection("![,](/api/attachments/".concat(xr.id,"?type=").concat(xr.content_type,")")):(ir==null||((cn=ir.type)===null||cn===void 0)?void 0:cn.indexOf("video"))>-1?Dt.replaceSelection('<video width="100%" controls src="'.concat(o.a.API_SERVER,"/api/attachments/").concat(xr.id,'"></video>')):(ir==null||((Hn=ir.type)===null||Hn===void 0)?void 0:Hn.indexOf("pdf"))>-1?Dt.replaceSelection('<a href="'.concat(o.a.API_SERVER,"/api/attachments/").concat(xr.id,"?type=").concat(ir.type,'&disposition=inline" target="_blank">').concat(ir.name,"</a>")):ee.includes(oi)?Dt.replaceSelection('<a href="'.concat(o.a.API_SERVER,"/api/attachments/").concat(xr.id,'?type=office&disposition=inline" target="_blank">').concat(ir.name,"</a>")):Dt.replaceSelection("[".concat(ir.name,"](").concat(o.a.API_SERVER,"/api/attachments/").concat(xr.id,"?type=").concat(xr.content_type,")"))}else(xr==null?void 0:xr.status)===401&&(document.location.href="/user/login")})}catch(xr){A.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return Dt.on("paste",Kt),Dt.on("dragleave",function(kt,tr){ei.current.classList.remove("mouse-hover-md")}),Dt.on("dragover",function(kt,tr){ei.current.classList.add("mouse-hover-md")}),Dt.on("drop",function(kt,tr){ei.current.classList.add("mouse-hover-md");var mr;if(mr=tr.dataTransfer.files,mr.length>0){tr.preventDefault(),tr.stopPropagation();for(var Tr=function(wn){var ir=mr[wn],oi=ir.name.split(".").pop();R(ir,function(xr){if(xr.id){var mn,cn,Hn;(ir==null||((mn=ir.type)===null||mn===void 0)?void 0:mn.indexOf("image"))>-1?Dt.replaceSelection("![,](/api/attachments/".concat(xr.id,"?type=").concat(xr.content_type,")")):(ir==null||((cn=ir.type)===null||cn===void 0)?void 0:cn.indexOf("video"))>-1?Dt.replaceSelection('<video width="100%" controls src="'.concat(o.a.API_SERVER,"/api/attachments/").concat(xr.id,'"></video>')):(ir==null||((Hn=ir.type)===null||Hn===void 0)?void 0:Hn.indexOf("pdf"))>-1?Dt.replaceSelection('<a href="'.concat(o.a.API_SERVER,"/api/attachments/").concat(xr.id,"?type=").concat(ir.type,'&disposition=inline" target="_blank">').concat(ir.name,"</a>")):ee.includes(oi)?Dt.replaceSelection('<a href="'.concat(o.a.API_SERVER,"/api/attachments/").concat(xr.id,'?type=office&disposition=inline" target="_blank">').concat(ir.name,"</a>")):Dt.replaceSelection("[".concat(ir.name,"](").concat(o.a.API_SERVER,"/api/attachments/").concat(xr.id,"?type=").concat(xr.content_type,")"))}else(xr==null?void 0:xr.status)===401&&(document.location.href="/user/login")})},hr=0;hr<mr.length;hr++)Tr(hr)}}),yn(Dt),function(){Dt.off("paste",Kt)}}},[]);var Tn=Object(b.useCallback)(function(){if(ei.current)try{}catch(Dt){console.log(Dt,"---- to set md editor body height")}},[ia,ei,Pn]);Object(b.useEffect)(function(){function Dt(){var kt=new T.default(function(tr){var mr=Object(O.a)(tr),Tr;try{for(mr.s();!(Tr=mr.n()).done;){var hr=Tr.value;(hr.target.offsetHeight>0||hr.target.offsetWidth>0)&&(Tn(),st.setSize("100%","100%"),st.refresh())}}catch(Vr){mr.e(Vr)}finally{mr.f()}});return kt.observe($n.current.parentElement),kt}if(st){var Kt=Dt();return function(){Kt.unobserve($n.current.parentElement)}}},[st,Tn]),Object(b.useEffect)(function(){if(st){for(var Dt=[],Kt=function(){var hr=tr[kt];mr=Object(W.a)(hr,2);var Vr=mr[0],wn=mr[1],ir=Object(U.a)({},Vr,function(){va(wn)});Dt.push(ir),st.addKeyMap(ir)},kt=0,tr=Object.entries(ie);kt<tr.length;kt++){var mr;Kt()}return qn.current=setInterval(function(){Li.current&&ga()},4e3),function(){clearInterval(qn.current);var Tr=Object(O.a)(Dt),hr;try{for(Tr.s();!(hr=Tr.n()).done;){var Vr=hr.value;st.removeKeyMap(Vr)}}catch(wn){Tr.e(wn)}finally{Tr.f()}}}},[st]),Object(b.useEffect)(function(){zt!==Pn&&ki(zt)},[zt]),Object(ft.a)(function(){if(!Ar&&Jt>0){var Dt=new Date().getTime(),Kt=window.sessionStorage.getItem(qt);Dt>=Jt+qe&&(!Kt||Kt!==ni)&&(window.sessionStorage.setItem(qt,ni),ii(!0))}},qe),Object(b.useEffect)(function(){Oi(Vt)},[st,Vt]),Object(b.useEffect)(function(){st&&(_t&&st.focus())},[st,_t]),Object(b.useEffect)(function(){if(An&&st){var Dt=st.getScrollerElement();function Kt(kt){var tr=kt.target;if(Ii.current){var mr=tr.scrollTop/tr.scrollHeight;Ii.current.scrollTop=Ii.current.scrollHeight*mr}}return Dt.addEventListener("scroll",Kt),function(){Dt.removeEventListener("scroll",Kt)}}},[st,An]),Object(b.useEffect)(function(){if(st&&vr){function Dt(Kt,kt){vr(Kt,kt)}return st.on("beforeChange",Dt),function(){st.off("beforeChange",Dt)}}},[st,vr]),Object(b.useEffect)(function(){if(st&&Ht){function Dt(){Ht(st.getValue())}return st.on("blur",Dt),function(){st.off("blur",Dt)}}},[st,Ht]),Object(b.useEffect)(function(){if(st){function Dt(Kt){var kt=Kt.getValue();In(kt),Zn(new Date().getTime()),Kt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),$e&&$e(kt)}return st.on("change",Dt),function(){st.off("change",Dt)}}},[st,$e]),Object(b.useEffect)(function(){st&&(Be==null?(st.setValue(""),In("")):Be!==st.getValue()&&(st.setValue(Be),In(Be),st.setCursor(st.lineCount(),0)))},[st,Be]);var va=Object(b.useCallback)(function(Dt){var Kt=st.getCursor(),kt=st.getSelection(),tr=kt.split(`
`);switch(Dt){case"bold":return st.replaceSelection("**"+kt+"**"),kt===""&&st.setCursor(Kt.line,Kt.ch+2),st.focus();case"italic":return st.replaceSelection("*"+kt+"*"),kt===""&&st.setCursor(Kt.line,Kt.ch+1),st.focus();case"code":return st.replaceSelection("`"+kt+"`"),kt===""&&st.setCursor(Kt.line,Kt.ch+1),st.focus();case"inline-latex":return st.replaceSelection("`$$"+kt+"$$`"),kt===""&&st.setCursor(Kt.line,Kt.ch+3),st.focus();case"latex":return st.replaceSelection("```latex\n"+kt+"\n```"),st.setCursor(Kt.line+1,kt.length+1),st.focus();case"line-break":return st.replaceSelection(`<br/>
`),st.focus();case"list-ul":return kt===""?st.replaceSelection("- "+kt):st.replaceSelection(tr.map(function(mr){return mr===""?"":"- ".concat(mr)}).join(`
`)),st.focus();case"list-ol":return kt===""?st.replaceSelection("1. "+kt):st.replaceSelection(tr.map(function(mr,Tr){return mr===""?"":"".concat(Tr+1,". ").concat(mr)}).join(`
`)),st.focus();case"add-null-ch":return kt===""&&st.setCursor(Kt.line,Kt.ch+1),st.replaceSelection(le),st.focus();case"inster-template-1":return kt===""&&st.setCursor(Kt.line,Kt.ch),st.replaceSelection(Z),st.focus();case"eraser":return st.setValue(""),st.focus();case"trigger-watch":return Oi(!An),st.focus();case"trigger-full-screen":return ki(!Pn),st.focus();case ze:Wt(ze);return;case dt:Wt(dt);return;case Xe:Wt(Xe);return;case ct:Wt(ct);return;default:throw new Error}},[st,An,Pn]),zi=Object(b.useCallback)(function(Dt){Wt("");switch(Mt){case ze:var Kt=Dt.title,kt=Dt.link;return st.replaceSelection("[".concat(Kt,"](").concat(kt,")")),st.focus();case dt:var tr=Dt.language,mr=Dt.content;return st.replaceSelection(["```"+tr,mr,"```"].join(`
`)),st.focus();case Xe:var Tr=Dt.src,hr=Dt.alt;return hr?st.replaceSelection("![ ".concat(hr," ]( ").concat(Tr,' "').concat(hr,'" )')):st.replaceSelection("![,](".concat(Tr,")")),st.focus();case ct:for(var Vr=Dt.row,wn=Dt.col,ir=Dt.align,oi=`
`,xr=0;xr<Vr;xr++){for(var mn=[],cn=[],Hn=0;Hn<wn;Hn++)xr===1&&cn.push(at[ir]),mn.push(" ");xr===1&&(oi+="| ".concat(cn.join(" | "),` |
`)),oi+="| ".concat(mn.join(wn===1?"":" | "),` |
`)}return st.replaceSelection(oi+`
`),st.focus();default:throw new Error}},[st,Mt]),yi=Object(b.useMemo)(function(){switch(Mt){case ze:return E.a.createElement(Se,{callback:zi,onCancel:_n});case dt:return E.a.createElement(ke.b,{callback:zi,onCancel:_n});case Xe:return E.a.createElement(we,{callback:zi,onCancel:_n});case ct:return E.a.createElement(je,{callback:zi,onCancel:_n});default:return null}},[Mt]);function _n(){Wt("")}Object(b.useEffect)(function(){if(ai.current){var Dt=ai.current,Kt=!1,kt=0;function tr(hr){Kt=!0,kt=hr.pageY}function mr(){Kt=!1}function Tr(hr){if(Kt){var Vr=hr.pageY-kt;Vr<0&&(Vr=0),Vr>300&&(Vr=300);var wn=Ct+Vr+"px";Gn(wn)}}return Dt.addEventListener("mousedown",tr),document.addEventListener("mousemove",Tr),document.addEventListener("mouseup",mr),function(){Dt.removeEventListener("mousedown",tr),document.removeEventListener("mousemove",Tr),document.removeEventListener("mouseup",mr)}}},[st,ai]),Object(b.useEffect)(function(){Gn(Ct)},[Ct]);var Nn=q(xt),aa=q(ia),Wn={width:Nn,height:aa},oa=Object(b.useMemo)(function(){if(Jt){var Dt=new Date(Jt),Kt=Dt.getHours(),kt=Dt.getMinutes(),tr=Dt.getSeconds();return Kt=Kt<10?"0"+Kt:Kt,kt=kt<10?"0"+kt:kt,tr=tr<10?"0"+tr:tr,"".concat(Kt,":").concat(kt,":").concat(tr)}return 0},[Jt]);function sa(){window.sessionStorage.removeItem(qt),ii(!1),Zn(0)}function Pi(){ii(!1),Zn(0),st.setValue(window.sessionStorage.getItem(qt))}function Ua(Dt,Kt){var kt=st.getValue();kt=kt.replace(Dt,Kt),In(kt),st==null||st.setValue(kt)}return E.a.createElement(b.Fragment,null,E.a.createElement("div",{className:"markdown-editor-wrapper",ref:ei},E.a.createElement("div",{className:"markdown-editor-container ".concat(tt," ").concat(An?"on-preview":""," ").concat(Ut?"mini":""," ").concat(Pn?"full-screen":""),style:Wn},E.a.createElement(C,{insertTemp:bt,watch:An,fullScreen:Pn,showNullButton:Mr,onActionCallback:va,hidetoolBar:sr,uuid:vi.current,setOpenPhones:function(){Li.current=!0}}),E.a.createElement("div",{className:"markdown-editor-body"},E.a.createElement("div",{className:"codemirror-container"},E.a.createElement("textarea",{ref:$n,placeholder:hi})),An?E.a.createElement("div",{ref:Ii,className:"preview-container"},Gt==="stex"&&E.a.createElement(D,{value:ni}),Gt!=="stex"&&E.a.createElement(f.a,{edit:!0,value:ni,replaces:Ua})):null))),Or?E.a.createElement("a",{ref:ai,className:"editor-resize"}):null,E.a.createElement(_.a,null,ce[Mt]?E.a.createElement(V.a,{centered:!0,title:ce[Mt],visible:!0,onCancel:_n,footer:null,className:"markdown-popup-form"},yi):null))}},RMFE:function(Ge,We){Ge.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAWgAAAFyCAYAAADYqEAoAAAAAXNSR0IArs4c6QAADetJREFUeAHt1jFqXUEQRUHLaP9b/jZObmYU9MAJSlGDxNBUPw76+vz9+eWHAAECBHICv3MbWYgAAQIE/gkItA+BAAECUQGBjh7GWgQIEBBo3wABAgSiAgIdPYy1CBAgINC+AQIECEQFBDp6GGsRIEBAoH0DBAgQiAoIdPQw1iJAgIBA+wYIECAQFRDo6GGsRYAAAYH2DRAgQCAqINDRw1iLAAECAu0bIECAQFRAoKOHsRYBAgQE2jdAgACBqIBARw9jLQIECAi0b4AAAQJRAYGOHsZaBAgQEGjfAAECBKICAh09jLUIECAg0L4BAgQIRAUEOnoYaxEgQECgfQMECBCICgh09DDWIkCAgED7BggQIBAVEOjoYaxFgAABgfYNECBAICog0NHDWIsAAQIC7RsgQIBAVECgo4exFgECBATaN0CAAIGogEBHD2MtAgQICLRvgAABAlEBgY4exloECBAQaN8AAQIEogICHT2MtQgQICDQvgECBAhEBQQ6ehhrESBAQKB9AwQIEIgKCHT0MNYiQICAQPsGCBAgEBUQ6OhhrEWAAAGB9g0QIEAgKiDQ0cNYiwABAgLtGyBAgEBUQKCjh7EWAQIEBNo3QIAAgaiAQEcPYy0CBAh8/5Tg6+vrp3/q7wgQIEDgPwKfz+c/v92v/Ac9CxMBAgRSAgKdOodlCBAgMAGBnoWJAAECKQGBTp3DMgQIEJiAQM/CRIAAgZSAQKfOYRkCBAhMQKBnYSJAgEBKQKBT57AMAQIEJiDQszARIEAgJSDQqXNYhgABAhMQ6FmYCBAgkBIQ6NQ5LEOAAIEJCPQsTAQIEEgJCHTqHJYhQIDABAR6FiYCBAikBAQ6dQ7LECBAYAICPQsTAQ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VmwQIEDgQEOgDRE8QIEDghYBAv1D1JgECBA4EBPoA0RMECBB4ISDQL1S9SYAAgQMBgT5A9AQBAgReCAj0C1VvEiBA4EBAoA8QPUGAAIEXAgL9QtWbBAgQOBAQ6ANETxAgQOCFgEC/UPUmAQIEDgQE+gDREwQIEHghINAvVL1JgACBAwGBPkD0BAECBF4ICPQLVW8SIEDgQECgDxA9QYAAgRcCAv1C1ZsECBA4EBDoA0RPECBA4IWAQL9Q9SYBAgQOBAT6ANETBAgQeCEg0C9UvUmAAIEDAYE+QPQEAQIEXggI9AtVbxIgQOBAQKAPED1BgACBFwIC/ULVmwQIEDgQEOgDRE8QIEDghYBAv1D1JgECBA4EBPoA0RMECBB4ISDQL1S9SYAAgQMBgT5A9AQBAgReCAj0C1VvEiBA4EBAoA8QPUGAAIEXAgL9QtWbBAgQOBAQ6ANETxAgQOCFgEC/UPUmAQIEDgQE+gDREwQIEHghINAvVL1JgACBAwGBPkD0BAECBF4ICPQLVW8SIEDgQECgDxA9QYAAgRcCAv1C1ZsECBA4EBDoA0RPECBA4IXAH7PYDOHnuk1pAAAAAElFTkSuQmCC"},SJMd:function(Ge,We){/**
* @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 X,de,V,O=!1,H,A;window.PR_SHOULD_USE_CONTINUATION=!0;var k,W;(function(){var U=window,P=["break,continue,do,else,for,if,return,while"],L=[P,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],b=[L,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],E=[b,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],I=[b,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],w=[b,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],T="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",y=[b,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],u="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=[P,"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=[P,"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"],s=[P,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],m=[E,w,I,y,u,a,l,s],d=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,f="str",D="kwd",v="com",h="typ",p="lit",c="pun",o="pln",x="tag",g="dec",C="src",_="atn",z="atv",Y="nocode",oe="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function G(ge){for(var Oe=0,je=!1,Ze=!1,He=0,ze=ge.length;He<ze;++He){var Xe=ge[He];if(Xe.ignoreCase)Ze=!0;else if(/[a-z]/i.test(Xe.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){je=!0,Ze=!1;break}}var dt={b:8,t:9,n:10,v:11,f:12,r:13};function ct(Ye){var Ne=Ye.charCodeAt(0);if(Ne!==92)return Ne;var ht=Ye.charAt(1);return Ne=dt[ht],Ne||("0"<=ht&&ht<="7"?parseInt(Ye.substring(1),8):ht==="u"||ht==="x"?parseInt(Ye.substring(2),16):Ye.charCodeAt(1))}function gt(Ye){if(Ye<32)return(Ye<16?"\\x0":"\\x")+Ye.toString(16);var Ne=String.fromCharCode(Ye);return Ne==="\\"||Ne==="-"||Ne==="]"||Ne==="^"?"\\"+Ne:Ne}function at(Ye){var Ne=Ye.substring(1,Ye.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),ht=[],qe=Ne[0]==="^",le=["["];qe&&le.push("^");for(var Z=qe?1:0,q=Ne.length;Z<q;++Z){var ne=Ne[Z];if(/\\[bdsw]/i.test(ne))le.push(ne);else{var ue=ct(ne),ee;Z+2<q&&Ne[Z+1]==="-"?(ee=ct(Ne[Z+2]),Z+=2):ee=ue,ht.push([ue,ee]),ee<65||ue>122||(ee<65||ue>90||ht.push([Math.max(65,ue)|32,Math.min(ee,90)|32]),ee<97||ue>122||ht.push([Math.max(97,ue)&~32,Math.min(ee,122)&~32]))}}ht.sort(function(xe,De){return xe[0]-De[0]||De[1]-xe[1]});for(var ie=[],ce=[],Z=0;Z<ht.length;++Z){var pe=ht[Z];pe[0]<=ce[1]+1?ce[1]=Math.max(ce[1],pe[1]):ie.push(ce=pe)}for(var Z=0;Z<ie.length;++Z){var pe=ie[Z];le.push(gt(pe[0])),pe[1]>pe[0]&&(pe[1]+1>pe[0]&&le.push("-"),le.push(gt(pe[1])))}return le.push("]"),le.join("")}function ft(Ye){for(var Ne=Ye.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),ht=Ne.length,qe=[],le=0,Z=0;le<ht;++le){var q=Ne[le];if(q==="(")++Z;else if(q.charAt(0)==="\\"){var ne=+q.substring(1);ne&&(ne<=Z?qe[ne]=-1:Ne[le]=gt(ne))}}for(var le=1;le<qe.length;++le)qe[le]===-1&&(qe[le]=++Oe);for(var le=0,Z=0;le<ht;++le){var q=Ne[le];if(q==="(")++Z,qe[Z]||(Ne[le]="(?:");else if(q.charAt(0)==="\\"){var ne=+q.substring(1);ne&&ne<=Z&&(Ne[le]="\\"+qe[ne])}}for(var le=0;le<ht;++le)Ne[le]==="^"&&Ne[le+1]!=="^"&&(Ne[le]="");if(Ye.ignoreCase&&je)for(var le=0;le<ht;++le){var q=Ne[le],ue=q.charAt(0);q.length>=2&&ue==="["?Ne[le]=at(q):ue!=="\\"&&(Ne[le]=q.replace(/[a-zA-Z]/g,function(ce){var pe=ce.charCodeAt(0);return"["+String.fromCharCode(pe&~32,pe|32)+"]"}))}return Ne.join("")}for(var lt=[],He=0,ze=ge.length;He<ze;++He){var Xe=ge[He];if(Xe.global||Xe.multiline)throw new Error(""+Xe);lt.push("(?:"+ft(Xe)+")")}return new RegExp(lt.join("|"),Ze?"gi":"g")}function j(ge,Oe){var je=/(?:^|\s)nocode(?:\s|$)/,Ze=[],He=0,ze=[],Xe=0;function dt(ct){var gt=ct.nodeType;if(gt==1){if(je.test(ct.className))return;for(var at=ct.firstChild;at;at=at.nextSibling)dt(at);var ft=ct.nodeName.toLowerCase();(ft==="br"||ft==="li")&&(Ze[Xe]=`
`,ze[Xe<<1]=He++,ze[Xe++<<1|1]=ct)}else if(gt==3||gt==4){var lt=ct.nodeValue;lt.length&&(Oe?lt=lt.replace(/\r\n?/g,`
`):lt=lt.replace(/[ \t\r\n]+/g," "),Ze[Xe]=lt,ze[Xe<<1]=He,He+=lt.length,ze[Xe++<<1|1]=ct)}}return dt(ge),{sourceCode:Ze.join("").replace(/\n$/,""),spans:ze}}function se(ge,Oe,je,Ze,He){if(!je)return;var ze={sourceNode:ge,pre:1,langExtension:null,numberLines:null,sourceCode:je,spans:null,basePos:Oe,decorations:null};Ze(ze),He.push.apply(He,ze.decorations)}var fe=/\S/;function Se(ge){for(var Oe=void 0,je=ge.firstChild;je;je=je.nextSibling){var Ze=je.nodeType;Oe=Ze===1?Oe?ge:je:Ze===3&&fe.test(je.nodeValue)?ge:Oe}return Oe===ge?void 0:Oe}function ke(ge,Oe){var je={},Ze;(function(){for(var Xe=ge.concat(Oe),dt=[],ct={},gt=0,at=Xe.length;gt<at;++gt){var ft=Xe[gt],lt=ft[3];if(lt)for(var Ye=lt.length;--Ye>=0;)je[lt.charAt(Ye)]=ft;var Ne=ft[1],ht=""+Ne;ct.hasOwnProperty(ht)||(dt.push(Ne),ct[ht]=null)}dt.push(/[\0-\uffff]/),Ze=G(dt)})();var He=Oe.length,ze=function(Xe){for(var dt=Xe.sourceCode,ct=Xe.basePos,gt=Xe.sourceNode,at=[ct,o],ft=0,lt=dt.match(Ze)||[],Ye={},Ne=0,ht=lt.length;Ne<ht;++Ne){var qe=lt[Ne],le=Ye[qe],Z=void 0,q;if(typeof le=="string")q=!1;else{var ne=je[qe.charAt(0)];if(ne)Z=qe.match(ne[1]),le=ne[0];else{for(var ue=0;ue<He;++ue)if(ne=Oe[ue],Z=qe.match(ne[1]),Z){le=ne[0];break}Z||(le=o)}q=le.length>=5&&le.substring(0,5)==="lang-",q&&!(Z&&typeof Z[1]=="string")&&(q=!1,le=C),q||(Ye[qe]=le)}var ee=ft;if(ft+=qe.length,!q)at.push(ct+ee,le);else{var ie=Z[1],ce=qe.indexOf(ie),pe=ce+ie.length;Z[2]&&(pe=qe.length-Z[2].length,ce=pe-ie.length);var xe=le.substring(5);se(gt,ct+ee,qe.substring(0,ce),ze,at),se(gt,ct+ee+ce,ie,F(xe,ie),at),se(gt,ct+ee+pe,qe.substring(pe),ze,at)}}Xe.decorations=at};return ze}function Je(ge){var Oe=[],je=[];ge.tripleQuotedStrings?Oe.push([f,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):ge.multiLineStrings?Oe.push([f,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Oe.push([f,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),ge.verbatimStrings&&je.push([f,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Ze=ge.hashComments;Ze&&(ge.cStyleComments?(Ze>1?Oe.push([v,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Oe.push([v,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),je.push([f,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Oe.push([v,/^#[^\r\n]*/,null,"#"])),ge.cStyleComments&&(je.push([v,/^\/\/[^\r\n]*/,null]),je.push([v,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var He=ge.regexLiterals;if(He){var ze=He>1?"":`
\r`,Xe=ze?".":"[\\S\\s]",dt="/(?=[^/*"+ze+"])(?:[^/\\x5B\\x5C"+ze+"]|\\x5C"+Xe+"|\\x5B(?:[^\\x5C\\x5D"+ze+"]|\\x5C"+Xe+")*(?:\\x5D|$))+/";je.push(["lang-regex",RegExp("^"+oe+"("+dt+")")])}var ct=ge.types;ct&&je.push([h,ct]);var gt=(""+ge.keywords).replace(/^ | $/g,"");gt.length&&je.push([D,new RegExp("^(?:"+gt.replace(/[\s,]+/g,"|")+")\\b"),null]),Oe.push([o,/^\s+/,null,` \r
\xA0`]);var at="^.[^\\s\\w.$@'\"`/\\\\]*";return ge.regexLiterals&&(at+="(?!s*/)"),je.push([p,/^@[a-z_$][a-z_$@0-9]*/i,null],[h,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[o,/^[a-z_$][a-z_$@0-9]*/i,null],[p,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[o,/^\\[\s\S]?/,null],[c,new RegExp(at),null]),ke(Oe,je)}var _e=Je({keywords:m,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Qe(ge,Oe,je){for(var Ze=/(?:^|\s)nocode(?:\s|$)/,He=/\r\n?|\n/,ze=ge.ownerDocument,Xe=ze.createElement("li");ge.firstChild;)Xe.appendChild(ge.firstChild);var dt=[Xe];function ct(Ne){var ht=Ne.nodeType;if(ht==1&&!Ze.test(Ne.className))if(Ne.nodeName==="br")gt(Ne),Ne.parentNode&&Ne.parentNode.removeChild(Ne);else for(var qe=Ne.firstChild;qe;qe=qe.nextSibling)ct(qe);else if((ht==3||ht==4)&&je){var le=Ne.nodeValue,Z=le.match(He);if(Z){var q=le.substring(0,Z.index);Ne.nodeValue=q;var ne=le.substring(Z.index+Z[0].length);if(ne){var ue=Ne.parentNode;ue.insertBefore(ze.createTextNode(ne),Ne.nextSibling)}gt(Ne),q||Ne.parentNode.removeChild(Ne)}}}function gt(Ne){for(;!Ne.nextSibling;)if(Ne=Ne.parentNode,!Ne)return;function ht(Z,q){var ne=q?Z.cloneNode(!1):Z,ue=Z.parentNode;if(ue){var ee=ht(ue,1),ie=Z.nextSibling;ee.appendChild(ne);for(var ce=ie;ce;ce=ie)ie=ce.nextSibling,ee.appendChild(ce)}return ne}for(var qe=ht(Ne.nextSibling,0),le;(le=qe.parentNode)&&le.nodeType===1;)qe=le;dt.push(qe)}for(var at=0;at<dt.length;++at)ct(dt[at]);Oe===(Oe|0)&&dt[0].setAttribute("value",Oe);var ft=ze.createElement("ol");ft.className="linenums";for(var lt=Math.max(0,Oe-1|0)||0,at=0,Ye=dt.length;at<Ye;++at)Xe=dt[at],Xe.className="L"+(at+lt)%10,Xe.firstChild||Xe.appendChild(ze.createTextNode("\xA0")),ft.appendChild(Xe);ge.appendChild(ft)}function Ue(ge){var Oe=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Oe=Oe&&+Oe[1]<=8;var je=/\n/g,Ze=ge.sourceCode,He=Ze.length,ze=0,Xe=ge.spans,dt=Xe.length,ct=0,gt=ge.decorations,at=gt.length,ft=0;gt[at]=He;var lt,Ye;for(Ye=lt=0;Ye<at;)gt[Ye]!==gt[Ye+2]?(gt[lt++]=gt[Ye++],gt[lt++]=gt[Ye++]):Ye+=2;for(at=lt,Ye=lt=0;Ye<at;){for(var Ne=gt[Ye],ht=gt[Ye+1],qe=Ye+2;qe+2<=at&&gt[qe+1]===ht;)qe+=2;gt[lt++]=Ne,gt[lt++]=ht,Ye=qe}at=gt.length=lt;var le=ge.sourceNode,Z="";le&&(Z=le.style.display,le.style.display="none");try{for(var q=null;ct<dt;){var ne=Xe[ct],ue=Xe[ct+2]||He,ee=gt[ft+2]||He,qe=Math.min(ue,ee),ie=Xe[ct+1],ce;if(ie.nodeType!==1&&(ce=Ze.substring(ze,qe))){Oe&&(ce=ce.replace(je,"\r")),ie.nodeValue=ce;var pe=ie.ownerDocument,xe=pe.createElement("span");xe.className=gt[ft+1];var De=ie.parentNode;De.replaceChild(xe,ie),xe.appendChild(ie),ze<ue&&(Xe[ct+1]=ie=pe.createTextNode(Ze.substring(qe,ue)),De.insertBefore(ie,xe.nextSibling))}ze=qe,ze>=ue&&(ct+=2),ze>=ee&&(ft+=2)}}finally{le&&(le.style.display=Z)}}var Fe={};function we(ge,Oe){for(var je=Oe.length;--je>=0;){var Ze=Oe[je];Fe.hasOwnProperty(Ze)?U.console&&console.warn("cannot override language handler %s",Ze):Fe[Ze]=ge}}function F(ge,Oe){return ge&&Fe.hasOwnProperty(ge)||(ge=/^\s*</.test(Oe)?"default-markup":"default-code"),Fe[ge]}we(_e,["default-code"]),we(ke([],[[o,/^[^<?]+/],[g,/^<!\w[^>]*(?:>|$)/],[v,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[c,/^(?:<[%?]|[%?]>)/],["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"]),we(ke([[o,/^[\s]+/,null,` \r
`],[z,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[x,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[_,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[c,/^[=<>\/]+/],["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"]),we(ke([],[[z,/^[\s\S]+/]]),["uq.val"]),we(Je({keywords:E,hashComments:!0,cStyleComments:!0,types:d}),["c","cc","cpp","cxx","cyc","m"]),we(Je({keywords:"null,true,false"}),["json"]),we(Je({keywords:w,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:d}),["cs"]),we(Je({keywords:I,cStyleComments:!0}),["java"]),we(Je({keywords:s,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),we(Je({keywords:a,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),we(Je({keywords:u,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),we(Je({keywords:l,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),we(Je({keywords:y,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),we(Je({keywords:T,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),we(ke([],[[f,/^[\s\S]+/]]),["regex"]);function R(ge){var Oe=ge.langExtension;try{var je=j(ge.sourceNode,ge.pre),Ze=je.sourceCode;ge.sourceCode=Ze,ge.spans=je.spans,ge.basePos=0,F(Oe,Ze)(ge),Ue(ge)}catch(He){U.console&&console.log(He&&He.stack||He)}}function M(ge,Oe,je){var Ze=je||!1,He=Oe||null,ze=document.createElement("div");ze.innerHTML="<pre>"+ge+"</pre>",ze=ze.firstChild,Ze&&Qe(ze,Ze,!0);var Xe={langExtension:He,numberLines:Ze,sourceNode:ze,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return R(Xe),ze.innerHTML}function K(ge,Oe){var je=Oe||document.body,Ze=je.ownerDocument||document;function He(ne){return je.getElementsByTagName(ne)}for(var ze=[He("pre"),He("code"),He("xmp")],Xe=[],dt=0;dt<ze.length;++dt)for(var ct=0,gt=ze[dt].length;ct<gt;++ct)Xe.push(ze[dt][ct]);ze=null;var at=Date;at.now||(at={now:function(){return+new Date}});var ft=0,lt=/\blang(?:uage)?-([\w.]+)(?!\S)/,Ye=/\bprettyprint\b/,Ne=/\bprettyprinted\b/,ht=/pre|xmp/i,qe=/^code$/i,le=/^(?:pre|code|xmp)$/i,Z={};function q(){for(var ne=U.PR_SHOULD_USE_CONTINUATION?at.now()+250:Infinity;ft<Xe.length&&at.now()<ne;ft++){for(var ue=Xe[ft],ee=Z,ie=ue;ie=ie.previousSibling;){var ce=ie.nodeType,pe=(ce===7||ce===8)&&ie.nodeValue;if(pe?!/^\??prettify\b/.test(pe):ce!==3||/\S/.test(ie.nodeValue))break;if(pe){ee={},pe.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Vt,bt,cr){ee[bt]=cr});break}}var xe=ue.className;if((ee!==Z||Ye.test(xe))&&!Ne.test(xe)){for(var De=!1,Be=ue.parentNode;Be;Be=Be.parentNode){var $e=Be.tagName;if(le.test($e)&&Be.className&&Ye.test(Be.className)){De=!0;break}}if(!De){ue.className+=" prettyprinted";var pt=ee.lang;if(!pt){pt=xe.match(lt);var xt;!pt&&(xt=Se(ue))&&qe.test(xt.tagName)&&(pt=xt.className.match(lt)),pt&&(pt=pt[1])}var Ft;if(ht.test(ue.tagName))Ft=1;else{var Ct=ue.currentStyle,ot=Ze.defaultView,Ut=Ct?Ct.whiteSpace:ot&&ot.getComputedStyle?ot.getComputedStyle(ue,null).getPropertyValue("white-space"):0;Ft=Ut&&Ut.substring(0,3)==="pre"}var Rt=ee.linenums;(Rt=Rt==="true"||+Rt)||(Rt=xe.match(/\blinenums\b(?::(\d+))?/),Rt=Rt?Rt[1]&&Rt[1].length?+Rt[1]:!0:!1),Rt&&Qe(ue,Rt,Ft);var _t={langExtension:pt,sourceNode:ue,numberLines:Rt,pre:Ft,sourceCode:null,basePos:null,spans:null,decorations:null};R(_t)}}}ft<Xe.length?U.setTimeout(q,250):typeof ge=="function"&&ge()}q()}var $=U.PR={createSimpleLexer:ke,registerLangHandler:we,sourceDecorator:Je,PR_ATTRIB_NAME:_,PR_ATTRIB_VALUE:z,PR_COMMENT:v,PR_DECLARATION:g,PR_KEYWORD:D,PR_LITERAL:p,PR_NOCODE:Y,PR_PLAIN:o,PR_PUNCTUATION:c,PR_SOURCE:C,PR_STRING:f,PR_TAG:x,PR_TYPE:h,prettyPrintOne:O?U.prettyPrintOne=M:k=M,prettyPrint:W=O?U.prettyPrint=K:W=K},B=U.define;typeof B=="function"&&B.amd&&B("google-code-prettify",[],function(){return $})})()},SMhR:function(Ge,We){Ge.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcYAAAHGCAYAAADuYispAAAAAklEQVR4AewaftIAABHTSURBVO3BQY4cy5IEQdNA3//KNo2/8NU8XzCQyCpSReivSJKk/zmRJEnjRJIkjRNJkjROJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ40SSJI0TSZI0TiRJ0jiRJEnjRJIkjRNJkjROJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ40SSJI0TSZI0TiRJ0jiRJEnjRJIkjRNJkjROJEnSOJEkSeNEkiSNE0mSNH7yMiB/s7a5AWTTNhsgN9pmA2TTNp8MyI22uQHkv7TNDSCbttkAudE2bwJyo22eBGTTNhsgf7O2ecuJJEkaJ5IkaZxIkqRxIkmSxokkSRonkiRpnEiSpPGTD9c2nwzIk9pmA2TTNjeAPAnIpm1uANm0zQbIDSBPAXIDyKZtPh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wKyaZsNkE3bvAnIjbb5VCeSJGmcSJKkcSJJksaJJEkaJ5IkaZxIkqRxIkmSBv2VFwH5m7XNk4Bs2uZJQJ7UNjeA3GibTwXkRttsgNxomw2QG22zAXKjbW4AeVLbbIDcaJsNkCe1zVtOJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ40SSJA36K5Ik6X9OJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ40SSJI0TSZI0TiRJ0jiRJEnjRJIkjRNJkjROJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ40SSJI0TSZI0TiRJ0jiRJEnjRJIkjRNJkjROJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ4/8ATrCgy9kbxW8AAAAASUVORK5CYII="},STEk:function(Ge,We,X){"use strict";X.d(We,"a",function(){return we});/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var de=function(F,R){return(de=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(M,K){M.__proto__=K}||function(M,K){for(var $ in K)Object.prototype.hasOwnProperty.call(K,$)&&(M[$]=K[$])})(F,R)};function V(F,R){function M(){this.constructor=F}de(F,R),F.prototype=R===null?Object.create(R):(M.prototype=R.prototype,new M)}function O(F,R,M,K){return new(M||(M=Promise))(function($,B){function ge(Ze){try{je(K.next(Ze))}catch(He){B(He)}}function Oe(Ze){try{je(K.throw(Ze))}catch(He){B(He)}}function je(Ze){var He;Ze.done?$(Ze.value):(He=Ze.value,He instanceof M?He:new M(function(ze){ze(He)})).then(ge,Oe)}je((K=K.apply(F,R||[])).next())})}function H(F,R){var M,K,$,B,ge={label:0,sent:function(){if(1&$[0])throw $[1];return $[1]},trys:[],ops:[]};return B={next:Oe(0),throw:Oe(1),return:Oe(2)},typeof Symbol=="function"&&(B[Symbol.iterator]=function(){return this}),B;function Oe(je){return function(Ze){return function(He){if(M)throw new TypeError("Generator is already executing.");for(;ge;)try{if(M=1,K&&($=2&He[0]?K.return:He[0]?K.throw||(($=K.return)&&$.call(K),0):K.next)&&!($=$.call(K,He[1])).done)return $;switch(K=0,$&&(He=[2&He[0],$.value]),He[0]){case 0:case 1:$=He;break;case 4:return ge.label++,{value:He[1],done:!1};case 5:ge.label++,K=He[1],He=[0];continue;case 7:He=ge.ops.pop(),ge.trys.pop();continue;default:if(!($=ge.trys,($=$.length>0&&$[$.length-1])||He[0]!==6&&He[0]!==2)){ge=0;continue}if(He[0]===3&&(!$||He[1]>$[0]&&He[1]<$[3])){ge.label=He[1];break}if(He[0]===6&&ge.label<$[1]){ge.label=$[1],$=He;break}if($&&ge.label<$[2]){ge.label=$[2],ge.ops.push(He);break}$[2]&&ge.ops.pop(),ge.trys.pop();continue}He=R.call(F,ge)}catch(ze){He=[6,ze],K=0}finally{M=$=0}if(5&He[0])throw He[1];return{value:He[0]?He[1]:void 0,done:!0}}([je,Ze])}}}function A(){for(var F=0,R=0,M=arguments.length;R<M;R++)F+=arguments[R].length;var K=Array(F),$=0;for(R=0;R<M;R++)for(var B=arguments[R],ge=0,Oe=B.length;ge<Oe;ge++,$++)K[$]=B[ge];return K}var k=function(){function F(){}return F.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},F.setAttributes=function(R,M){for(var K=0,$=M;K<$.length;K++){var B=$[K],ge=B[0],Oe=B[1];R.setAttribute(ge,Oe)}},F.createRect=function(R,M,K){var $=document.createElementNS("http://www.w3.org/2000/svg","rect");return $.setAttribute("width",R.toString()),$.setAttribute("height",M.toString()),K&&F.setAttributes($,K),$},F.createLine=function(R,M,K,$,B){var ge=document.createElementNS("http://www.w3.org/2000/svg","line");return ge.setAttribute("x1",R.toString()),ge.setAttribute("y1",M.toString()),ge.setAttribute("x2",K.toString()),ge.setAttribute("y2",$.toString()),B&&F.setAttributes(ge,B),ge},F.createPolygon=function(R,M){var K=document.createElementNS("http://www.w3.org/2000/svg","polygon");return K.setAttribute("points",R),M&&F.setAttributes(K,M),K},F.createCircle=function(R,M){var K=document.createElementNS("http://www.w3.org/2000/svg","circle");return K.setAttribute("cx",(R/2).toString()),K.setAttribute("cy",(R/2).toString()),K.setAttribute("r",R.toString()),M&&F.setAttributes(K,M),K},F.createEllipse=function(R,M,K){var $=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return $.setAttribute("cx",(R/2).toString()),$.setAttribute("cy",(M/2).toString()),$.setAttribute("rx",(R/2).toString()),$.setAttribute("ry",(M/2).toString()),K&&F.setAttributes($,K),$},F.createGroup=function(R){var M=document.createElementNS("http://www.w3.org/2000/svg","g");return R&&F.setAttributes(M,R),M},F.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},F.createMarker=function(R,M,K,$,B,ge,Oe){var je=document.createElementNS("http://www.w3.org/2000/svg","marker");return F.setAttributes(je,[["id",R],["orient",M],["markerWidth",K.toString()],["markerHeight",$.toString()],["refX",B.toString()],["refY",ge.toString()]]),je.appendChild(Oe),je},F.createText=function(R){var M=document.createElementNS("http://www.w3.org/2000/svg","text");return M.setAttribute("x","0"),M.setAttribute("y","0"),R&&F.setAttributes(M,R),M},F.createTSpan=function(R,M){var K=document.createElementNS("http://www.w3.org/2000/svg","tspan");return K.textContent=R,M&&F.setAttributes(K,M),K},F.createImage=function(R){var M=document.createElementNS("http://www.w3.org/2000/svg","image");return R&&F.setAttributes(M,R),M},F.createPoint=function(R,M){var K=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return K.x=R,K.y=M,K},F.createPath=function(R,M){var K=document.createElementNS("http://www.w3.org/2000/svg","path");return K.setAttribute("d",R),M&&F.setAttributes(K,M),K},F}(),W=function(){function F(){}return F.addKey=function(R){F.key=R},Object.defineProperty(F,"isLicensed",{get:function(){return!!F.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(F.key)},enumerable:!1,configurable:!0}),F}(),U=function(){function F(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return F.prototype.rasterize=function(R,M,K){var $=this;return new Promise(function(B){var ge=K!==void 0?K:document.createElement("canvas");R===null&&($.markersOnly=!0,$.naturalSize=!1);var Oe=document.createElementNS("http://www.w3.org/2000/svg","svg");Oe.setAttribute("xmlns","http://www.w3.org/2000/svg"),Oe.setAttribute("width",M.width.baseVal.valueAsString),Oe.setAttribute("height",M.height.baseVal.valueAsString),Oe.setAttribute("viewBox","0 0 "+M.viewBox.baseVal.width.toString()+" "+M.viewBox.baseVal.height.toString()),Oe.innerHTML=M.innerHTML,$.naturalSize===!0?(Oe.width.baseVal.value=R.naturalWidth,Oe.height.baseVal.value=R.naturalHeight):$.width!==void 0&&$.height!==void 0&&(Oe.width.baseVal.value=$.width,Oe.height.baseVal.value=$.height),ge.width=Oe.width.baseVal.value,ge.height=Oe.height.baseVal.value;var je=Oe.outerHTML,Ze=ge.getContext("2d");$.markersOnly!==!0&&Ze.drawImage(R,0,0,ge.width,ge.height);var He=window.URL,ze=new Image(ge.width,ge.height);ze.setAttribute("crossOrigin","anonymous");var Xe=new Blob([je],{type:"image/svg+xml"}),dt=He.createObjectURL(Xe);ze.onload=function(){Ze.drawImage(ze,0,0),He.revokeObjectURL(dt);var ct=ge.toDataURL($.imageType,$.imageQuality);B(ct)},ze.src=dt})},F}(),P=function(){},L=function(){function F(R){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+R+"_"}return Object.defineProperty(F.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#ffffff",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarColor:"#eeeeee",toolbarHeight:40,toolboxColor:"#eeeeee",toolboxAccentColor:"#3080c3",undoButtonVisible:!0,redoButtonVisible:!1,zoomButtonVisible:!1,zoomOutButtonVisible:!1,clearButtonVisible:!1,resultButtonBlockVisible:!0,logoPosition:"left"}},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),F.prototype.addClass=function(R){return this.styleSheet===void 0&&this.addStyleSheet(),R.name=""+this.classNamePrefix+R.localName,this.classes.push(R),this.styleSheet.sheet.insertRule("."+R.name+" {"+R.style+"}",this.styleSheet.sheet.cssRules.length),R},F.prototype.addRule=function(R){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(R),this.styleSheet.sheet.insertRule(R.selector+" {"+R.style+"}",this.styleSheet.sheet.cssRules.length)},F.prototype.addStyleSheet=function(){var R;this.styleSheet=document.createElement("style"),((R=this.styleSheetRoot)!==null&&R!==void 0?R:document.head).appendChild(this.styleSheet),this.addRule(new b("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new b("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new b("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new E("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new E("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},F.prototype.removeStyleSheet=function(){var R;this.styleSheet&&(((R=this.styleSheetRoot)!==null&&R!==void 0?R:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},F}(),b=function(F,R){this.selector=F,this.style=R},E=function(F,R){this.localName=F,this.style=R},I=function(){function F(R,M,K,$,B){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=R,this.displayMode=M,this.markerItems=K,this.uiStyleSettings=$,this.styles=B,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return F.prototype.show=function(R){var M=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=R,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var K=document.createElement("div");K.className=this.toolbarBlockStyleClass.name,K.style.whiteSpace="nowrap",this.uiContainer.appendChild(K),this.addActionButton(K,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(K,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(K,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(K,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(K,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(K,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(K,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(K,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(B){var ge=document.createElement("div");ge.className=""+M.toolbarButtonStyleClass.name,ge.setAttribute("data-type-name",B.typeName),ge.innerHTML=B.icon,ge.addEventListener("click",function(){M.markerToolbarButtonClicked(ge,B)}),M.buttons.push(ge),M.markerButtons.push(ge)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var $=document.createElement("div");$.className=this.toolbarBlockStyleClass.name,$.style.whiteSpace="nowrap",$.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild($),this.addActionButton($,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render"),this.addActionButton($,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},F.prototype.addButtonClickListener=function(R){this.buttonClickListeners.push(R)},F.prototype.removeButtonClickListener=function(R){this.buttonClickListeners.indexOf(R)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(R),1)},F.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},F.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var R=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var M=0;M<this.markerButtons.length;M++)M<R||M===R&&this.markerButtons.length-1===R?this.markerButtonBlock.appendChild(this.markerButtons[M]):(M===R&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[M]))}},F.prototype.overflowButtonClicked=function(){this.markerButtonOverflowBlock.style.display!=="none"?(this.markerButtonOverflowBlock.className=this.markerButtonOverflowBlock.className.replace(this.styles.fadeInAnimationClassName,""),this.markerButtonOverflowBlock.style.display="none"):(this.markerButtonOverflowBlock.className+=" "+this.styles.fadeInAnimationClassName,this.markerButtonOverflowBlock.style.top=this.uiContainer.offsetTop+this.overflowButton.offsetHeight+"px",this.markerButtonOverflowBlock.style.right=this.uiContainer.offsetWidth-this.overflowButton.offsetLeft-this.overflowButton.offsetWidth+2*this.uiContainer.offsetLeft+"px",this.markerButtonOverflowBlock.style.display="inline-block")},F.prototype.resetButtonStyles=function(){var R=this;this.buttons.forEach(function(M){M.className=M.className.replace(R.uiStyleSettings.toolbarButtonStyleColorsClassName?R.uiStyleSettings.toolbarButtonStyleColorsClassName:R.toolbarButtonStyleColorsClass.name,"").trim(),M.className=M.className.replace(R.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?R.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:R.toolbarActiveButtonStyleColorsClass.name,"").trim(),M.className+=" "+(R.uiStyleSettings.toolbarButtonStyleColorsClassName?R.uiStyleSettings.toolbarButtonStyleColorsClassName:R.toolbarButtonStyleColorsClass.name)})},F.prototype.addActionButton=function(R,M,K){var $=this,B=document.createElement("div");switch(B.className=""+this.toolbarButtonStyleClass.name,B.innerHTML=M,B.setAttribute("data-action",K),B.addEventListener("click",function(){$.actionToolbarButtonClicked(B,K)}),K){case"select":B.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":B.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":B.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":B.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":B.style.fill=this.uiStyleSettings.closeButtonColor}R.appendChild(B),this.buttons.push(B)},F.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new E("toolbar",`
width: 100%;
flex-shrink: 0;
display: flex;
flex-direction: row;
justify-content: space-between;
height: `+this.uiStyleSettings.toolbarHeight+`px;
box-sizing: content-box;
`+(this.displayMode==="inline"?"border-top-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
`+(this.displayMode==="inline"?"border-top-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
overflow: hidden;
`)),this.toolbarStyleColorsClass=this.styles.addClass(new E("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new E("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new E("toolbar-overflow-block",`
position: absolute;
top: `+this.uiStyleSettings.toolbarHeight+`px;
max-width: `+2*this.uiStyleSettings.toolbarHeight+`px;
z-index: 10;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleColorsClass=this.styles.addClass(new E("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var R=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new E("toolbar_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*R)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*R)+`px;
padding: `+R+`px;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new E("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new E("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new b("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new b("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},F.prototype.markerToolbarButtonClicked=function(R,M){this.setActiveButton(R),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(K){return K("marker",M)}),this.markerButtonOverflowBlock.style.display="none"},F.prototype.actionToolbarButtonClicked=function(R,M){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(K){return K("action",M)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},F.prototype.setActiveButton=function(R){this.resetButtonStyles(),R.className=R.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),R.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},F.prototype.setActiveMarkerButton=function(R){var M=this.markerButtons.find(function(K){return K.getAttribute("data-type-name")===R});M&&this.setActiveButton(M)},F.prototype.setCurrentMarker=function(R){var M=this;this.currentMarker=R,this.buttons.filter(function(K){return/delete|notes/.test(K.getAttribute("data-action"))}).forEach(function(K){M.currentMarker===void 0?(K.style.fillOpacity="0.4",K.style.pointerEvents="none"):(K.style.fillOpacity="1",K.style.pointerEvents="all")})},F}(),w=function(){function F(R,M,K,$){this.panels=[],this.panelButtons=[],this.markerjsContainer=R,this.displayMode=M,this.uiStyleSettings=K,this.styles=$,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return F.prototype.addStyles=function(){var R;this.toolboxStyleClass=this.styles.addClass(new E("toolbox",`
width: 100%;
flex-shrink: 0;
display: flex;
flex-direction: column;
font-family: sans-serif;
`+(this.displayMode==="popup"?"height:"+2.5*this.uiStyleSettings.toolbarHeight+"px;":"")+`
box-sizing: content-box;
`+(this.displayMode==="popup"?"background-color: "+this.uiStyleSettings.canvasBackgroundColor+";":"")+`
`+(this.displayMode==="inline"?"border-bottom-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
`+(this.displayMode==="inline"?"border-bottom-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
overflow: hidden;
`)),this.toolboxStyleColorsClass=this.styles.addClass(new E("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var M=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new E("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new E("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new E("toolbox-panel-row",`
display: flex;
`+(this.displayMode==="inline"?"position: absolute;":"")+`
`+(this.displayMode==="inline"?"bottom: "+this.uiStyleSettings.toolbarHeight+"px;":"")+`
cursor: default;
height: `+1.5*this.uiStyleSettings.toolbarHeight+`px;
`+(this.displayMode==="inline"?"width: 100%;":"")+`
box-sizing: content-box;
`)),this.toolboxPanelRowStyleColorsClass=this.styles.addClass(new E("toolbox-panel-row_colors",`
background-color: `+((R=this.uiStyleSettings.toolboxBackgroundColor)!==null&&R!==void 0?R:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new E("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*M)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*M)+`px;
padding: `+M+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new E("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new E("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new b("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new b("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},F.prototype.show=function(R){var M;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=R,this.uiContainer.className=this.toolboxStyleClass.name+" "+((M=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&M!==void 0?M:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},F.prototype.setPanelButtons=function(R){var M,K,$=this;this.panels=R,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((M=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&M!==void 0?M:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((K=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&K!==void 0?K:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(B){var ge;B.uiStyleSettings=$.uiStyleSettings;var Oe=document.createElement("div");Oe.className=$.toolboxButtonStyleClass.name+" "+((ge=$.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&ge!==void 0?ge:$.toolboxButtonStyleColorsClass.name),Oe.innerHTML=B.icon,Oe.title=B.title,Oe.addEventListener("click",function(){$.panelButtonClick(B)}),$.panelButtons.push(Oe),$.buttonRow.appendChild(Oe)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},F.prototype.panelButtonClick=function(R){var M=this,K=-1;if(R!==this.activePanel){K=this.panels.indexOf(R),this.panelRow.innerHTML="";var $=R.getUi();$.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild($),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=R}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){M.displayMode==="inline"?M.panelRow.style.display="none":M.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(B,ge){var Oe,je;B.className=M.toolboxButtonStyleClass.name+" "+(ge===K?""+((Oe=M.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Oe!==void 0?Oe:M.toolboxActiveButtonStyleColorsClass.name):""+((je=M.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&je!==void 0?je:M.toolboxButtonStyleColorsClass.name))})},F}(),T=function(F,R){this.title=F,this.icon=R},y=function(F){function R(M,K,$,B){var ge=F.call(this,M,B||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return ge.colors=[],ge.addTransparent=!1,ge.colorBoxes=[],ge.colors=K,ge.currentColor=$,ge.setCurrentColor=ge.setCurrentColor.bind(ge),ge.getColorBox=ge.getColorBox.bind(ge),ge}return V(R,F),R.prototype.getUi=function(){var M=this,K=document.createElement("div");return K.style.overflow="hidden",K.style.whiteSpace="nowrap",this.colors.forEach(function($){var B=M.getColorBox($);K.appendChild(B),M.colorBoxes.push(B)}),K},R.prototype.getColorBox=function(M){var K=this,$=this.uiStyleSettings.toolbarHeight/4,B=this.uiStyleSettings.toolbarHeight-$,ge=document.createElement("div");ge.style.display="inline-block",ge.style.boxSizing="content-box",ge.style.width=B-2+"px",ge.style.height=B-2+"px",ge.style.padding="1px",ge.style.marginRight="2px",ge.style.marginBottom="2px",ge.style.borderWidth="2px",ge.style.borderStyle="solid",ge.style.borderRadius=(B+2)/2+"px",ge.style.borderColor=M===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",ge.addEventListener("click",function(){K.setCurrentColor(M,ge)});var Oe=document.createElement("div");return Oe.style.display="inline-block",Oe.style.width=B-2+"px",Oe.style.height=B-2+"px",Oe.style.backgroundColor=M,Oe.style.borderRadius=B/2+"px",M==="transparent"&&(Oe.style.fill=this.uiStyleSettings.toolboxAccentColor,Oe.innerHTML=`<svg viewBox="0 0 24 24">
<path d="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z" />
</svg>`),ge.appendChild(Oe),ge},R.prototype.setCurrentColor=function(M,K){var $=this;this.currentColor=M,this.colorBoxes.forEach(function(B){B.style.borderColor=B===K?$.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(M)},R}(T),u=function(){function F(R,M,K){this._state="new",this._isSelected=!1,this._container=R,this._overlayContainer=M,this.globalSettings=K,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(F.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),F.prototype.ownsTarget=function(R){return!1},Object.defineProperty(F.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),F.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},F.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},F.prototype.pointerDown=function(R,M){},F.prototype.dblClick=function(R,M){},F.prototype.manipulate=function(R){},F.prototype.pointerUp=function(R){this.stateChanged()},F.prototype.dispose=function(){},F.prototype.addMarkerVisualToContainer=function(R){this.container.childNodes.length>0?this.container.insertBefore(R,this.container.childNodes[0]):this.container.appendChild(R)},F.prototype.getState=function(){return{typeName:F.typeName,state:this.state,notes:this.notes}},F.prototype.restoreState=function(R){this._state=R.state,this.notes=R.notes},F.prototype.scale=function(R,M){},F.prototype.colorChanged=function(R){this.onColorChanged&&this.onColorChanged(R),this.stateChanged()},F.prototype.fillColorChanged=function(R){this.onFillColorChanged&&this.onFillColorChanged(R),this.stateChanged()},F.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var R=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),R.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(R)&&this.onStateChanged(this)}},F.typeName="MarkerBase",F}(),a=function(){function F(){this.findGripByVisual=this.findGripByVisual.bind(this)}return F.prototype.findGripByVisual=function(R){return this.topLeft.ownsTarget(R)?this.topLeft:this.topCenter.ownsTarget(R)?this.topCenter:this.topRight.ownsTarget(R)?this.topRight:this.centerLeft.ownsTarget(R)?this.centerLeft:this.centerRight.ownsTarget(R)?this.centerRight:this.bottomLeft.ownsTarget(R)?this.bottomLeft:this.bottomCenter.ownsTarget(R)?this.bottomCenter:this.bottomRight.ownsTarget(R)?this.bottomRight:void 0},F}(),l=function(){function F(){this.GRIP_SIZE=10,this.visual=k.createGroup(),this.visual.appendChild(k.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(k.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return F.prototype.ownsTarget=function(R){return R===this.visual||R===this.visual.childNodes[0]||R===this.visual.childNodes[1]},F}(),s=function(){function F(){}return F.toITransformMatrix=function(R){return{a:R.a,b:R.b,c:R.c,d:R.d,e:R.e,f:R.f}},F.toSVGMatrix=function(R,M){return R.a=M.a,R.b=M.b,R.c=M.c,R.d=M.d,R.e=M.e,R.f=M.f,R},F}(),m=function(F){function R(M,K,$){var B=F.call(this,M,K,$)||this;return B.left=0,B.top=0,B.width=0,B.height=0,B.defaultSize={x:50,y:20},B.offsetX=0,B.offsetY=0,B.rotationAngle=0,B.CB_DISTANCE=10,B._suppressMarkerCreateEvent=!1,B.container.transform.baseVal.appendItem(k.createTransform()),B.setupControlBox(),B}return V(R,F),Object.defineProperty(R.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(R.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(R.prototype,"visual",{get:function(){return this._visual},set:function(M){this._visual=M;var K=k.createTransform();this._visual.transform.baseVal.appendItem(K)},enumerable:!1,configurable:!0}),R.prototype.ownsTarget=function(M){return!!F.prototype.ownsTarget.call(this,M)||!!(this.controlGrips.findGripByVisual(M)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(M))},R.prototype.pointerDown=function(M,K){F.prototype.pointerDown.call(this,M,K),this.state==="new"&&(this.left=M.x,this.top=M.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var $=this.unrotatePoint(M);if(this.manipulationStartX=$.x,this.manipulationStartY=$.y,this.offsetX=$.x-this.left,this.offsetY=$.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(K),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(K)){this.activeGrip=this.rotatorGrip;var B=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=B.x-this.width/2,this.top=B.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var ge=this.container.transform.baseVal.getItem(0);ge.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(ge,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},R.prototype.pointerUp=function(M){var K=this.state;F.prototype.pointerUp.call(this,M),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(M),this._state="select",K==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},R.prototype.moveVisual=function(M){this.visual.style.transform="translate("+M.x+"px, "+M.y+"px)"},R.prototype.manipulate=function(M){var K=this.unrotatePoint(M);this.state==="creating"?this.resize(M):this.state==="move"?(this.left=this.manipulationStartLeft+(K.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(K.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(K):this.state==="rotate"&&this.rotate(M)},R.prototype.resize=function(M){var K=this.manipulationStartLeft,$=this.manipulationStartWidth,B=this.manipulationStartTop,ge=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:K=this.manipulationStartLeft+M.x-this.manipulationStartX,$=this.manipulationStartWidth+this.manipulationStartLeft-K;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:$=this.manipulationStartWidth+M.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:B=this.manipulationStartTop+M.y-this.manipulationStartY,ge=this.manipulationStartHeight+this.manipulationStartTop-B;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:ge=this.manipulationStartHeight+M.y-this.manipulationStartY}$>=0?(this.left=K,this.width=$):(this.left=K+$,this.width=-$),ge>=0?(this.top=B,this.height=ge):(this.top=B+ge,this.height=-ge),this.setSize()},R.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},R.prototype.rotate=function(M){if(Math.abs(M.x-this.centerX)>.1){var K=Math.sign(M.x-this.centerX);this.rotationAngle=180*Math.atan((M.y-this.centerY)/(M.x-this.centerX))/Math.PI+90*K,this.applyRotation()}},R.prototype.applyRotation=function(){var M=this.container.transform.baseVal.getItem(0);M.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(M,0)},R.prototype.rotatePoint=function(M){if(this.rotationAngle===0)return M;var K=this.container.getCTM(),$=k.createPoint(M.x,M.y);return{x:($=$.matrixTransform(K)).x,y:$.y}},R.prototype.unrotatePoint=function(M){if(this.rotationAngle===0)return M;var K=this.container.getCTM();K=K.inverse();var $=k.createPoint(M.x,M.y);return{x:($=$.matrixTransform(K)).x,y:$.y}},R.prototype.select=function(){F.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},R.prototype.deselect=function(){F.prototype.deselect.call(this),this.controlBox.style.display="none"},R.prototype.setupControlBox=function(){this.controlBox=k.createGroup();var M=k.createTransform();M.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(M),this.container.appendChild(this.controlBox),this.controlRect=k.createRect(this.width+this.CB_DISTANCE,this.height+this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"],["fill","transparent"],["pointer-events","none"]]),this.controlBox.appendChild(this.controlRect),this.globalSettings.disableRotation!==!0&&(this.rotatorGripLine=k.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new a,this.addControlGrips(),this.controlBox.style.display="none"},R.prototype.adjustControlBox=function(){var M=this.controlBox.transform.baseVal.getItem(0);M.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(M,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},R.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},R.prototype.createGrip=function(){var M=new l;return M.visual.transform.baseVal.appendItem(k.createTransform()),this.controlBox.appendChild(M.visual),M},R.prototype.positionGrips=function(){var M=this.controlGrips.topLeft.GRIP_SIZE,K=-M/2,$=K,B=(this.width+this.CB_DISTANCE)/2-M/2,ge=(this.height+this.CB_DISTANCE)/2-M/2,Oe=this.height+this.CB_DISTANCE-M/2,je=this.width+this.CB_DISTANCE-M/2;this.positionGrip(this.controlGrips.topLeft.visual,K,$),this.positionGrip(this.controlGrips.topCenter.visual,B,$),this.positionGrip(this.controlGrips.topRight.visual,je,$),this.positionGrip(this.controlGrips.centerLeft.visual,K,ge),this.positionGrip(this.controlGrips.centerRight.visual,je,ge),this.positionGrip(this.controlGrips.bottomLeft.visual,K,Oe),this.positionGrip(this.controlGrips.bottomCenter.visual,B,Oe),this.positionGrip(this.controlGrips.bottomRight.visual,je,Oe),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,B,$-3*this.CB_DISTANCE)},R.prototype.positionGrip=function(M,K,$){var B=M.transform.baseVal.getItem(0);B.setTranslate(K,$),M.transform.baseVal.replaceItem(B,0)},R.prototype.hideControlBox=function(){this.controlBox.style.display="none"},R.prototype.showControlBox=function(){this.controlBox.style.display=""},R.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:s.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:s.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},F.prototype.getState.call(this))},R.prototype.restoreState=function(M){F.prototype.restoreState.call(this,M);var K=M;this.left=K.left,this.top=K.top,this.width=K.width,this.height=K.height,this.rotationAngle=K.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(s.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,K.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(s.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,K.containerTransformMatrix))},R.prototype.scale=function(M,K){F.prototype.scale.call(this,M,K);var $=this.rotatePoint({x:this.left,y:this.top}),B=this.unrotatePoint({x:$.x*M,y:$.y*K});this.left=B.x,this.top=B.y,this.width=this.width*M,this.height=this.height*K,this.adjustControlBox()},R}(u),d=function(F){function R(M,K,$){var B=F.call(this,M,K,$)||this;return B.fillColor="transparent",B.strokeColor="transparent",B.strokeWidth=0,B.strokeDasharray="",B.opacity=1,B.setStrokeColor=B.setStrokeColor.bind(B),B.setFillColor=B.setFillColor.bind(B),B.setStrokeWidth=B.setStrokeWidth.bind(B),B.setStrokeDasharray=B.setStrokeDasharray.bind(B),B.createVisual=B.createVisual.bind(B),B}return V(R,F),R.prototype.ownsTarget=function(M){return!(!F.prototype.ownsTarget.call(this,M)&&M!==this.visual)},R.prototype.createVisual=function(){this.visual=k.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},R.prototype.pointerDown=function(M,K){F.prototype.pointerDown.call(this,M,K),this.state==="new"&&(this.createVisual(),this.moveVisual(M),this._state="creating")},R.prototype.manipulate=function(M){F.prototype.manipulate.call(this,M)},R.prototype.resize=function(M){F.prototype.resize.call(this,M),this.setSize()},R.prototype.setSize=function(){F.prototype.setSize.call(this),k.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},R.prototype.pointerUp=function(M){F.prototype.pointerUp.call(this,M),this.setSize()},R.prototype.setStrokeColor=function(M){this.strokeColor=M,this.visual&&k.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(M),this.stateChanged()},R.prototype.setFillColor=function(M){this.fillColor=M,this.visual&&k.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},R.prototype.setStrokeWidth=function(M){this.strokeWidth=M,this.visual&&k.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},R.prototype.setStrokeDasharray=function(M){this.strokeDasharray=M,this.visual&&k.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},R.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},F.prototype.getState.call(this))},R.prototype.restoreState=function(M){var K=M;this.fillColor=K.fillColor,this.strokeColor=K.strokeColor,this.strokeWidth=K.strokeWidth,this.strokeDasharray=K.strokeDasharray,this.opacity=K.opacity,this.createVisual(),F.prototype.restoreState.call(this,M),this.setSize()},R.prototype.scale=function(M,K){F.prototype.scale.call(this,M,K),this.setSize()},R.title="Rectangle marker",R}(m),f=function(F){function R(M,K,$,B){var ge=F.call(this,M,B||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return ge.widths=[],ge.widthBoxes=[],ge.widths=K,ge.currentWidth=$,ge.setCurrentWidth=ge.setCurrentWidth.bind(ge),ge}return V(R,F),R.prototype.getUi=function(){var M=this,K=document.createElement("div");return K.style.display="flex",K.style.overflow="hidden",K.style.flexGrow="2",this.widths.forEach(function($){var B=document.createElement("div");B.style.display="flex",B.style.flexGrow="2",B.style.alignItems="center",B.style.justifyContent="space-between",B.style.padding="5px",B.style.borderWidth="2px",B.style.borderStyle="solid",B.style.borderColor=$===M.currentWidth?M.uiStyleSettings.toolboxAccentColor:"transparent",B.addEventListener("click",function(){M.setCurrentWidth($,B)}),K.appendChild(B);var ge=document.createElement("div");ge.innerText=$.toString(),ge.style.marginRight="5px",B.appendChild(ge);var Oe=document.createElement("div");Oe.style.minHeight="20px",Oe.style.flexGrow="2",Oe.style.display="flex",Oe.style.alignItems="center";var je=document.createElement("hr");je.style.minWidth="20px",je.style.border="0px",je.style.borderTop=$+"px solid "+M.uiStyleSettings.toolboxColor,je.style.flexGrow="2",Oe.appendChild(je),B.appendChild(Oe),M.widthBoxes.push(B)}),K},R.prototype.setCurrentWidth=function(M,K){var $=this;this.currentWidth=M,this.widthBoxes.forEach(function(B){B.style.borderColor=B===K?$.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},R}(T),D=function(F){function R(M,K,$,B){var ge=F.call(this,M,B||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return ge.styles=[],ge.styleBoxes=[],ge.styles=K,ge.currentStyle=$,ge.setCurrentStyle=ge.setCurrentStyle.bind(ge),ge}return V(R,F),R.prototype.getUi=function(){var M=this,K=document.createElement("div");return K.style.display="flex",K.style.overflow="hidden",K.style.flexGrow="2",this.styles.forEach(function($){var B=document.createElement("div");B.style.display="flex",B.style.alignItems="center",B.style.justifyContent="space-between",B.style.padding="5px",B.style.borderWidth="2px",B.style.borderStyle="solid",B.style.overflow="hidden",B.style.maxWidth=100/M.styles.length-5+"%",B.style.borderColor=$===M.currentStyle?M.uiStyleSettings.toolboxAccentColor:"transparent",B.addEventListener("click",function(){M.setCurrentStyle($,B)}),K.appendChild(B);var ge=document.createElement("div");ge.style.minHeight="20px",ge.style.flexGrow="2",ge.style.overflow="hidden";var Oe=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+M.uiStyleSettings.toolboxColor+'" stroke-width="3" '+($!==""?'stroke-dasharray="'+$+'"':"")+` />
</svg>`;ge.innerHTML=Oe,B.appendChild(ge),M.styleBoxes.push(B)}),K},R.prototype.setCurrentStyle=function(M,K){var $=this;this.currentStyle=M,this.styleBoxes.forEach(function(B){B.style.borderColor=B===K?$.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},R}(T),v=function(F){function R(M,K,$){var B=F.call(this,M,K,$)||this;return B.strokeColor=$.defaultColor,B.strokeWidth=$.defaultStrokeWidth,B.strokeDasharray=$.defaultStrokeDasharray,B.strokePanel=new y("Line color",$.defaultColorSet,$.defaultColor),B.strokePanel.onColorChanged=B.setStrokeColor,B.strokeWidthPanel=new f("Line width",$.defaultStrokeWidths,$.defaultStrokeWidth),B.strokeWidthPanel.onWidthChanged=B.setStrokeWidth,B.strokeStylePanel=new D("Line style",$.defaultStrokeDasharrays,$.defaultStrokeDasharray),B.strokeStylePanel.onStyleChanged=B.setStrokeDasharray,B}return V(R,F),Object.defineProperty(R.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),R.prototype.getState=function(){var M=F.prototype.getState.call(this);return M.typeName=R.typeName,M},R.typeName="FrameMarker",R.title="Frame marker",R.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',R}(d),h=function(){this.defaultColorSet=["#EF4444","#10B981","#2563EB","#FFFF00","#7C3AED","#F472B6","#000000","#FFFFFF"],this.defaultColor=this.defaultColorSet[0],this.defaultFillColor=this.defaultColorSet[0],this.defaultStrokeColor=this.defaultColorSet[7],this.defaultHighlightColor=this.defaultColorSet[3],this.defaultStrokeWidth=3,this.defaultStrokeDasharray="",this.defaultHighlightOpacity=.5,this.defaultFontFamily="Helvetica, Arial, sans-serif",this.defaultStrokeWidths=[1,2,3,5,10],this.defaultStrokeDasharrays=["","3","12 3","9 6 3 6"],this.defaultOpacitySteps=[.1,.25,.5,.75,1],this.displayMode="inline",this.defaultFontFamilies=['Times, "Times New Roman", serif',"Helvetica, Arial, sans-serif",'Courier, "Courier New", monospace',"cursive","fantasy"],this.popupMargin=30,this.newFreehandMarkerOnPointerUp=!1,this.defaultColorsFollowCurrentColors=!1,this.freehandPixelRatio=1,this.disableRotation=!1},p=function(F){function R(M,K,$){var B=F.call(this,M,K,$)||this;return B.x1=0,B.y1=0,B.x2=0,B.y2=0,B.defaultLength=50,B.manipulationStartX=0,B.manipulationStartY=0,B.manipulationStartX1=0,B.manipulationStartY1=0,B.manipulationStartX2=0,B.manipulationStartY2=0,B.setupControlBox(),B}return V(R,F),R.prototype.ownsTarget=function(M){return!!F.prototype.ownsTarget.call(this,M)||!(!this.grip1.ownsTarget(M)&&!this.grip2.ownsTarget(M))},R.prototype.pointerDown=function(M,K){F.prototype.pointerDown.call(this,M,K),this.manipulationStartX=M.x,this.manipulationStartY=M.y,this.state==="new"&&(this.x1=M.x,this.y1=M.y,this.x2=M.x,this.y2=M.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(K)?this.activeGrip=this.grip1:this.grip2.ownsTarget(K)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},R.prototype.pointerUp=function(M){var K=this.state;F.prototype.pointerUp.call(this,M),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(M),this._state="select",K==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},R.prototype.adjustVisual=function(){},R.prototype.manipulate=function(M){this.state==="creating"?this.resize(M):this.state==="move"?(this.x1=this.manipulationStartX1+M.x-this.manipulationStartX,this.y1=this.manipulationStartY1+M.y-this.manipulationStartY,this.x2=this.manipulationStartX2+M.x-this.manipulationStartX,this.y2=this.manipulationStartY2+M.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(M)},R.prototype.resize=function(M){switch(this.activeGrip){case this.grip1:this.x1=M.x,this.y1=M.y;break;case this.grip2:case void 0:this.x2=M.x,this.y2=M.y}this.adjustVisual(),this.adjustControlBox()},R.prototype.select=function(){F.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},R.prototype.deselect=function(){F.prototype.deselect.call(this),this.controlBox.style.display="none"},R.prototype.setupControlBox=function(){this.controlBox=k.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},R.prototype.adjustControlBox=function(){this.positionGrips()},R.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},R.prototype.createGrip=function(){var M=new l;return M.visual.transform.baseVal.appendItem(k.createTransform()),this.controlBox.appendChild(M.visual),M},R.prototype.positionGrips=function(){var M=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-M/2,this.y1-M/2),this.positionGrip(this.grip2.visual,this.x2-M/2,this.y2-M/2)},R.prototype.positionGrip=function(M,K,$){var B=M.transform.baseVal.getItem(0);B.setTranslate(K,$),M.transform.baseVal.replaceItem(B,0)},R.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},F.prototype.getState.call(this))},R.prototype.restoreState=function(M){F.prototype.restoreState.call(this,M);var K=M;this.x1=K.x1,this.y1=K.y1,this.x2=K.x2,this.y2=K.y2},R.prototype.scale=function(M,K){F.prototype.scale.call(this,M,K),this.x1=this.x1*M,this.y1=this.y1*K,this.x2=this.x2*M,this.y2=this.y2*K,this.adjustVisual(),this.adjustControlBox()},R}(u),c=function(F){function R(M,K,$){var B=F.call(this,M,K,$)||this;return B.strokeColor="transparent",B.strokeWidth=0,B.strokeDasharray="",B.setStrokeColor=B.setStrokeColor.bind(B),B.setStrokeWidth=B.setStrokeWidth.bind(B),B.setStrokeDasharray=B.setStrokeDasharray.bind(B),B.strokeColor=$.defaultColor,B.strokeWidth=$.defaultStrokeWidth,B.strokeDasharray=$.defaultStrokeDasharray,B.strokePanel=new y("Line color",$.defaultColorSet,$.defaultColor),B.strokePanel.onColorChanged=B.setStrokeColor,B.strokeWidthPanel=new f("Line width",$.defaultStrokeWidths,$.defaultStrokeWidth),B.strokeWidthPanel.onWidthChanged=B.setStrokeWidth,B.strokeStylePanel=new D("Line style",$.defaultStrokeDasharrays,$.defaultStrokeDasharray),B.strokeStylePanel.onStyleChanged=B.setStrokeDasharray,B}return V(R,F),R.prototype.ownsTarget=function(M){return!(!F.prototype.ownsTarget.call(this,M)&&M!==this.visual&&M!==this.selectorLine&&M!==this.visibleLine)},R.prototype.createVisual=function(){this.visual=k.createGroup(),this.selectorLine=k.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=k.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},R.prototype.pointerDown=function(M,K){F.prototype.pointerDown.call(this,M,K),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},R.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),k.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),k.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),k.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},R.prototype.setStrokeColor=function(M){this.strokeColor=M,this.adjustVisual(),this.colorChanged(M)},R.prototype.setStrokeWidth=function(M){this.strokeWidth=M,this.adjustVisual()},R.prototype.setStrokeDasharray=function(M){this.strokeDasharray=M,this.adjustVisual(),this.stateChanged()},Object.defineProperty(R.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),R.prototype.getState=function(){var M=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},F.prototype.getState.call(this));return M.typeName=R.typeName,M},R.prototype.restoreState=function(M){F.prototype.restoreState.call(this,M);var K=M;this.strokeColor=K.strokeColor,this.strokeWidth=K.strokeWidth,this.strokeDasharray=K.strokeDasharray,this.createVisual(),this.adjustVisual()},R.typeName="LineMarker",R.title="Line marker",R.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',R}(p),o=function(F){function R(M,K,$,B){var ge=F.call(this,M,B||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return ge.fonts=[],ge.fontBoxes=[],ge.fonts=K,ge.currentFont=$,ge.setCurrentFont=ge.setCurrentFont.bind(ge),ge}return V(R,F),R.prototype.getUi=function(){var M=this,K=document.createElement("div");return K.style.overflow="hidden",K.style.flexGrow="2",this.fonts.forEach(function($){var B=document.createElement("div");B.style.display="inline-block",B.style.alignItems="center",B.style.justifyContent="space-between",B.style.padding="5px",B.style.borderWidth="2px",B.style.borderStyle="solid",B.style.overflow="hidden",B.style.maxWidth=100/M.fonts.length-5+"%",B.style.borderColor=$===M.currentFont?M.uiStyleSettings.toolboxAccentColor:"transparent",B.addEventListener("click",function(){M.setCurrentFont($,B)}),K.appendChild(B);var ge=document.createElement("div");ge.style.display="flex",ge.style.minHeight="20px",ge.style.flexGrow="2",ge.style.fontFamily=$,ge.style.overflow="hidden";var Oe=document.createElement("div");Oe.style.whiteSpace="nowrap",Oe.style.overflow="hidden",Oe.style.textOverflow="ellipsis",Oe.innerHTML="The quick brown fox jumps over the lazy dog",ge.appendChild(Oe),B.appendChild(ge),M.fontBoxes.push(B)}),K},R.prototype.setCurrentFont=function(M,K){var $=this;this.currentFont=M,this.fontBoxes.forEach(function(B){B.style.borderColor=B===K?$.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},R}(T),x=function(F){function R(M,K,$){var B=F.call(this,M,K,$)||this;return B.color="transparent",B.padding=5,B.DEFAULT_TEXT="your text here",B.text=B.DEFAULT_TEXT,B.isMoved=!1,B.color=$.defaultColor,B.fontFamily=$.defaultFontFamily,B.defaultSize={x:100,y:30},B.setColor=B.setColor.bind(B),B.setFont=B.setFont.bind(B),B.renderText=B.renderText.bind(B),B.sizeText=B.sizeText.bind(B),B.textEditDivClicked=B.textEditDivClicked.bind(B),B.showTextEditor=B.showTextEditor.bind(B),B.setSize=B.setSize.bind(B),B.positionTextEditor=B.positionTextEditor.bind(B),B.colorPanel=new y("Color",$.defaultColorSet,$.defaultColor),B.colorPanel.onColorChanged=B.setColor,B.fontFamilyPanel=new o("Font",$.defaultFontFamilies,$.defaultFontFamily),B.fontFamilyPanel.onFontChanged=B.setFont,B}return V(R,F),R.prototype.ownsTarget=function(M){if(F.prototype.ownsTarget.call(this,M)||M===this.visual||M===this.textElement||M===this.bgRectangle)return!0;var K=!1;return this.textElement.childNodes.forEach(function($){$===M&&(K=!0)}),K},R.prototype.createVisual=function(){this.visual=k.createGroup(),this.bgRectangle=k.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=k.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(k.createTransform()),this.textElement.transform.baseVal.appendItem(k.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},R.prototype.pointerDown=function(M,K){F.prototype.pointerDown.call(this,M,K),this.isMoved=!1,this.pointerDownPoint=M,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(M),this._state="creating")},R.prototype.renderText=function(){var M=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(K){M.textElement.appendChild(k.createTSpan(K.trim()===""?" ":K.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},R.prototype.getTextScale=function(){var M=this.textElement.getBBox(),K=1;if(M.width>0&&M.height>0){var $=(1*this.width-this.width*this.padding*2/100)/M.width,B=(1*this.height-this.height*this.padding*2/100)/M.height;K=Math.min($,B)}return K},R.prototype.getTextPosition=function(M){var K=this.textElement.getBBox(),$=0,B=0;return K.width>0&&K.height>0&&($=(this.width-K.width*M)/2,B=this.height/2-K.height*M/2),{x:$,y:B}},R.prototype.sizeText=function(){var M=this.textElement.getBBox(),K=this.getTextScale(),$=this.getTextPosition(K);$.y-=M.y*K,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+$.x+"px, "+$.y+"px) scale("+K+", "+K+")":(this.textElement.transform.baseVal.getItem(0).setTranslate($.x,$.y),this.textElement.transform.baseVal.getItem(1).setScale(K,K))},R.prototype.manipulate=function(M){F.prototype.manipulate.call(this,M),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(M.x-this.pointerDownPoint.x)>5||Math.abs(M.y-this.pointerDownPoint.y)>5)},R.prototype.resize=function(M){F.prototype.resize.call(this,M),this.isMoved=!0,this.setSize(),this.sizeText()},R.prototype.setSize=function(){F.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(k.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),k.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},R.prototype.pointerUp=function(M){var K=this.state;K==="creating"&&(this._suppressMarkerCreateEvent=!0),F.prototype.pointerUp.call(this,M),this.setSize(),(K==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},R.prototype.showTextEditor=function(){var M=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(K){K.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var K=Number.parseFloat(M.textEditor.style.fontSize);M.textEditor.clientWidth>=Number.parseInt(M.textEditor.style.maxWidth)&&K>.9;)K-=.1,M.textEditor.style.fontSize=Math.max(K,.9)+"em"}),this.textEditor.addEventListener("keyup",function(K){K.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(K){if(K.clipboardData){var $=K.clipboardData.getData("text"),B=window.getSelection();if(!B.rangeCount)return!1;B.deleteFromDocument(),B.getRangeAt(0).insertNode(document.createTextNode($)),K.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){M.textEditDivClicked(M.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},R.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var M=this.getTextScale(),K=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),$=this.textElement.getBBox(),B={x:$.width*M,y:$.height*M};K.x-=B.x/2,K.y-=B.y/2,this.textEditor.style.top=K.y+"px",this.textEditor.style.left=K.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-K.x+"px",this.textEditor.style.fontSize=Math.max(16*M,12)+"px",this.textElement.style.display="none"}},R.prototype.textEditDivClicked=function(M){this.text=M.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},R.prototype.select=function(){F.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},R.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),F.prototype.deselect.call(this)},R.prototype.dblClick=function(M,K){F.prototype.dblClick.call(this,M,K),this.showTextEditor()},R.prototype.setColor=function(M){this.textElement&&k.setAttributes(this.textElement,[["fill",M]]),this.color=M,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(M)},R.prototype.setFont=function(M){this.textElement&&k.setAttributes(this.textElement,[["font-family",M]]),this.fontFamily=M,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},R.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},R.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(R.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),R.prototype.getState=function(){var M=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},F.prototype.getState.call(this));return M.typeName=R.typeName,M},R.prototype.restoreState=function(M){var K=M;this.color=K.color,this.fontFamily=K.fontFamily,this.padding=K.padding,this.text=K.text,this.createVisual(),F.prototype.restoreState.call(this,M),this.setSize()},R.prototype.scale=function(M,K){F.prototype.scale.call(this,M,K),this.setSize(),this.sizeText(),this.positionTextEditor()},R.typeName="TextMarker",R.title="Text marker",R.icon='<svg viewBox="0 0 24 24"><path d="M9.6 14L12 7.7l2.4 6.3M11 5L5.5 19h2.2l1.1-3H15l1.1 3h2.2L13 5h-2z"/></svg>',R}(m),g=function(F){function R(M,K,$){var B=F.call(this,M,K,$)||this;return B.color="transparent",B.lineWidth=3,B.drawing=!1,B.pixelRatio=1,B.color=$.defaultColor,B.lineWidth=$.defaultStrokeWidth,B.pixelRatio=$.freehandPixelRatio,B.setColor=B.setColor.bind(B),B.addCanvas=B.addCanvas.bind(B),B.finishCreation=B.finishCreation.bind(B),B.setLineWidth=B.setLineWidth.bind(B),B.colorPanel=new y("Color",$.defaultColorSet,$.defaultColor),B.colorPanel.onColorChanged=B.setColor,B.lineWidthPanel=new f("Line width",$.defaultStrokeWidths,$.defaultStrokeWidth),B.lineWidthPanel.onWidthChanged=B.setLineWidth,B}return V(R,F),R.prototype.ownsTarget=function(M){return!(!F.prototype.ownsTarget.call(this,M)&&M!==this.visual&&M!==this.drawingImage)},R.prototype.createVisual=function(){this.visual=k.createGroup(),this.drawingImage=k.createImage(),this.visual.appendChild(this.drawingImage);var M=k.createTransform();this.visual.transform.baseVal.appendItem(M),this.addMarkerVisualToContainer(this.visual)},R.prototype.pointerDown=function(M,K){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(M.x,M.y),this.drawing=!0):F.prototype.pointerDown.call(this,M,K)},R.prototype.manipulate=function(M){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(M.x,M.y),this.canvasContext.stroke()):F.prototype.manipulate.call(this,M)},R.prototype.resize=function(M){F.prototype.resize.call(this,M),k.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),k.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},R.prototype.pointerUp=function(M){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):F.prototype.pointerUp.call(this,M)},R.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},R.prototype.select=function(){this.state==="creating"&&this.finishCreation(),F.prototype.select.call(this)},R.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),F.prototype.deselect.call(this)},R.prototype.finishCreation=function(){for(var M=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),K=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],$=K[0],B=K[1],ge=K[2],Oe=K[3],je=!1,Ze=0;Ze<this.canvasElement.height;Ze++)for(var He=0;He<this.canvasElement.width;He++)M.data[Ze*this.canvasElement.width*4+4*He+3]>0&&(je=!0,Ze<B&&(B=Ze),He<$&&($=He),Ze>Oe&&(Oe=Ze),He>ge&&(ge=He));if(je){this.left=$/this.pixelRatio,this.top=B/this.pixelRatio,this.width=(ge-$)/this.pixelRatio,this.height=(Oe-B)/this.pixelRatio;var ze=document.createElement("canvas");ze.width=ge-$,ze.height=Oe-B,ze.getContext("2d").putImageData(this.canvasContext.getImageData($,B,ge-$,Oe-B),0,0),this.drawingImgUrl=ze.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},R.prototype.setDrawingImage=function(){k.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),k.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},R.prototype.setColor=function(M){this.color=M,this.colorChanged(M)},R.prototype.setLineWidth=function(M){this.lineWidth=M},Object.defineProperty(R.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),R.prototype.getState=function(){var M=Object.assign({drawingImgUrl:this.drawingImgUrl},F.prototype.getState.call(this));return M.typeName=R.typeName,M},R.prototype.restoreState=function(M){this.createVisual(),F.prototype.restoreState.call(this,M),this.drawingImgUrl=M.drawingImgUrl,this.setDrawingImage()},R.prototype.scale=function(M,K){F.prototype.scale.call(this,M,K),this.setDrawingImage()},R.typeName="FreehandMarker",R.title="Freehand marker",R.icon='<svg viewBox="0 0 24 24"><path d="M9.75 20.85c1.78-.7 1.39-2.63.49-3.85-.89-1.25-2.12-2.11-3.36-2.94A9.817 9.817 0 014.54 12c-.28-.33-.85-.94-.27-1.06.59-.12 1.61.46 2.13.68.91.38 1.81.82 2.65 1.34l1.01-1.7C8.5 10.23 6.5 9.32 4.64 9.05c-1.06-.16-2.18.06-2.54 1.21-.32.99.19 1.99.77 2.77 1.37 1.83 3.5 2.71 5.09 4.29.34.33.75.72.95 1.18.21.44.16.47-.31.47-1.24 0-2.79-.97-3.8-1.61l-1.01 1.7c1.53.94 4.09 2.41 5.96 1.79m11.09-15.6c.22-.22.22-.58 0-.79l-1.3-1.3a.562.562 0 00-.78 0l-1.02 1.02 2.08 2.08M11 10.92V13h2.08l6.15-6.15-2.08-2.08L11 10.92z"/></svg>',R}(m),C=function(F){function R(M,K,$){var B=F.call(this,M,$||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return B.typeBoxes=[],B.currentType=K,B.setCurrentType=B.setCurrentType.bind(B),B}return V(R,F),R.prototype.getUi=function(){var M=this,K=document.createElement("div");K.style.display="flex",K.style.overflow="hidden",K.style.flexGrow="2";for(var $=function(Oe){var je="both";switch(Oe){case 0:je="both";break;case 1:je="start";break;case 2:je="end";break;case 3:je="none"}var Ze=document.createElement("div");if(Ze.style.display="flex",Ze.style.flexGrow="2",Ze.style.alignItems="center",Ze.style.justifyContent="space-between",Ze.style.padding="5px",Ze.style.borderWidth="2px",Ze.style.borderStyle="solid",Ze.style.borderColor=je===B.currentType?B.uiStyleSettings.toolboxAccentColor:"transparent",Ze.addEventListener("click",function(){M.setCurrentType(je,Ze)}),K.appendChild(Ze),je==="both"||je==="start"){var He=document.createElement("div");He.style.display="flex",He.style.alignItems="center",He.style.minHeight="20px",He.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,5 10,0 10,10" fill="`+(B.uiStyleSettings!==void 0?B.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,He.style.marginLeft="5px",Ze.appendChild(He)}var ze=document.createElement("div");ze.style.display="flex",ze.style.alignItems="center",ze.style.minHeight="20px",ze.style.flexGrow="2";var Xe=document.createElement("hr");if(Xe.style.minWidth="20px",Xe.style.border="0px",Xe.style.borderTop="3px solid "+(B.uiStyleSettings!==void 0?B.uiStyleSettings.toolboxColor:"#eeeeee"),Xe.style.flexGrow="2",ze.appendChild(Xe),Ze.appendChild(ze),je==="both"||je==="end"){var dt=document.createElement("div");dt.style.display="flex",dt.style.alignItems="center",dt.style.minHeight="20px",dt.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,0 10,5 0,10" fill="`+(B.uiStyleSettings!==void 0?B.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,dt.style.marginRight="5px",Ze.appendChild(dt)}B.typeBoxes.push(Ze)},B=this,ge=0;ge<4;ge++)$(ge);return K},R.prototype.setCurrentType=function(M,K){var $=this;this.currentType=M,this.typeBoxes.forEach(function(B){B.style.borderColor=B===K?$.uiStyleSettings!==void 0?$.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},R}(T),_=function(F){function R(M,K,$){var B=F.call(this,M,K,$)||this;return B.arrowType="end",B.arrowBaseHeight=10,B.arrowBaseWidth=10,B.getArrowPoints=B.getArrowPoints.bind(B),B.setArrowType=B.setArrowType.bind(B),B.arrowTypePanel=new C("Arrow type","end"),B.arrowTypePanel.onArrowTypeChanged=B.setArrowType,B}return V(R,F),R.prototype.ownsTarget=function(M){return!(!F.prototype.ownsTarget.call(this,M)&&M!==this.arrow1&&M!==this.arrow2)},R.prototype.getArrowPoints=function(M,K){var $=this.arrowBaseWidth+2*this.strokeWidth,B=this.arrowBaseHeight+2*this.strokeWidth;return M-$/2+","+(K+B/2)+" "+M+","+(K-B/2)+" "+(M+$/2)+","+(K+B/2)},R.prototype.createTips=function(){this.arrow1=k.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(k.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=k.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(k.createTransform()),this.visual.appendChild(this.arrow2)},R.prototype.pointerDown=function(M,K){F.prototype.pointerDown.call(this,M,K),this.state==="creating"&&this.createTips()},R.prototype.adjustVisual=function(){if(F.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",k.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),k.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var M=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),K=this.arrow1.transform.baseVal.getItem(0);K.setRotate(M,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(K,0);var $=this.arrow2.transform.baseVal.getItem(0);$.setRotate(M+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem($,0)}},R.prototype.setArrowType=function(M){this.arrowType=M,this.adjustVisual(),this.stateChanged()},Object.defineProperty(R.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),R.prototype.getState=function(){var M=Object.assign({arrowType:this.arrowType},F.prototype.getState.call(this));return M.typeName=R.typeName,M},R.prototype.restoreState=function(M){F.prototype.restoreState.call(this,M);var K=M;this.arrowType=K.arrowType,this.createTips(),this.adjustVisual()},R.typeName="ArrowMarker",R.title="Arrow marker",R.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',R}(c),z=function(F){function R(M,K,$){var B=F.call(this,M,K,$)||this;return B.fillColor=$.defaultFillColor,B.strokeWidth=0,B.fillPanel=new y("Color",$.defaultColorSet,$.defaultFillColor),B.fillPanel.onColorChanged=B.setFillColor,B}return V(R,F),Object.defineProperty(R.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),R.prototype.getState=function(){var M=F.prototype.getState.call(this);return M.typeName=R.typeName,M},R.typeName="CoverMarker",R.title="Cover marker",R.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',R}(d),Y=function(F){function R(M,K,$,B){var ge=F.call(this,M,B||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return ge.opacities=[],ge.opacityBoxes=[],ge.opacities=K,ge.currentOpacity=$,ge.setCurrentOpacity=ge.setCurrentOpacity.bind(ge),ge}return V(R,F),R.prototype.getUi=function(){var M=this,K=document.createElement("div");return K.style.display="flex",K.style.overflow="hidden",K.style.flexGrow="2",K.style.justifyContent="space-between",this.opacities.forEach(function($){var B=document.createElement("div");B.style.display="flex",B.style.alignItems="center",B.style.justifyContent="center",B.style.padding="5px",B.style.borderWidth="2px",B.style.borderStyle="solid",B.style.borderColor=$===M.currentOpacity?M.uiStyleSettings.toolboxAccentColor:"transparent",B.addEventListener("click",function(){M.setCurrentOpacity($,B)}),K.appendChild(B);var ge=document.createElement("div");ge.innerText=100*$+"%",B.appendChild(ge),M.opacityBoxes.push(B)}),K},R.prototype.setCurrentOpacity=function(M,K){var $=this;this.currentOpacity=M,this.opacityBoxes.forEach(function(B){B.style.borderColor=B===K?$.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},R}(T),oe=function(F){function R(M,K,$){var B=F.call(this,M,K,$)||this;return B.setOpacity=B.setOpacity.bind(B),B.fillColor=$.defaultHighlightColor,B.strokeWidth=0,B.opacity=$.defaultHighlightOpacity,B.fillPanel=new y("Color",$.defaultColorSet,B.fillColor),B.fillPanel.onColorChanged=B.setFillColor,B.opacityPanel=new Y("Opacity",$.defaultOpacitySteps,B.opacity),B.opacityPanel.onOpacityChanged=B.setOpacity,B}return V(R,F),R.prototype.setOpacity=function(M){this.opacity=M,this.visual&&k.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(R.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),R.prototype.getState=function(){var M=F.prototype.getState.call(this);return M.typeName=R.typeName,M},R.typeName="HighlightMarker",R.title="Highlight marker",R.icon='<svg viewBox="0 0 24 24"><path d="M18.5 1.15c-.53 0-1.04.19-1.43.58l-5.81 5.82 5.65 5.65 5.82-5.81c.77-.78.77-2.04 0-2.83l-2.84-2.83c-.39-.39-.89-.58-1.39-.58M10.3 8.5l-5.96 5.96c-.78.78-.78 2.04.02 2.85C3.14 18.54 1.9 19.77.67 21h5.66l.86-.86c.78.76 2.03.75 2.81-.02l5.95-5.96"/></svg>',R}(z),G='<svg viewBox="0 0 24 24"><path d="M19 11.5s-2 2.17-2 3.5a2 2 0 002 2 2 2 0 002-2c0-1.33-2-3.5-2-3.5M5.21 10L10 5.21 14.79 10m1.77-1.06L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.56-.59 1.53 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.59.59-1.56 0-2.12z"/></svg>',j=function(F){function R(M,K,$){var B=F.call(this,M,K,$)||this;return B.bgColor="transparent",B.tipPosition={x:0,y:0},B.tipBase1Position={x:0,y:0},B.tipBase2Position={x:0,y:0},B.tipMoving=!1,B.color=$.defaultStrokeColor,B.bgColor=$.defaultFillColor,B.fontFamily=$.defaultFontFamily,B.defaultSize={x:100,y:30},B.setBgColor=B.setBgColor.bind(B),B.getTipPoints=B.getTipPoints.bind(B),B.positionTip=B.positionTip.bind(B),B.setTipPoints=B.setTipPoints.bind(B),B.colorPanel=new y("Text color",$.defaultColorSet,B.color,'<svg viewBox="0 0 24 24"><path d="M9.62 12L12 5.67 14.37 12M11 3L5.5 17h2.25l1.12-3h6.25l1.13 3h2.25L13 3h-2z"/></svg>'),B.colorPanel.onColorChanged=B.setColor,B.bgColorPanel=new y("Fill color",$.defaultColorSet,B.bgColor,G),B.bgColorPanel.onColorChanged=B.setBgColor,B.fontFamilyPanel=new o("Font",$.defaultFontFamilies,$.defaultFontFamily),B.fontFamilyPanel.onFontChanged=B.setFont,B.tipGrip=new l,B.tipGrip.visual.transform.baseVal.appendItem(k.createTransform()),B.controlBox.appendChild(B.tipGrip.visual),B}return V(R,F),R.prototype.ownsTarget=function(M){return F.prototype.ownsTarget.call(this,M)||this.tipGrip.ownsTarget(M)||this.tip===M},R.prototype.createTip=function(){k.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=k.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},R.prototype.pointerDown=function(M,K){this.state==="new"&&F.prototype.pointerDown.call(this,M,K),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(K)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):F.prototype.pointerDown.call(this,M,K)},R.prototype.pointerUp=function(M){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,F.prototype.pointerUp.call(this,M);else{var K=this.state==="creating";F.prototype.pointerUp.call(this,M),this.setTipPoints(K),this.positionTip()}},R.prototype.manipulate=function(M){if(this.tipMoving){var K=this.unrotatePoint(M);this.tipPosition={x:K.x-this.manipulationStartLeft,y:K.y-this.manipulationStartTop},this.positionTip()}else F.prototype.manipulate.call(this,M)},R.prototype.setBgColor=function(M){this.bgRectangle&&this.tip&&(k.setAttributes(this.bgRectangle,[["fill",M]]),k.setAttributes(this.tip,[["fill",M]])),this.bgColor=M,this.fillColorChanged(M)},R.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},R.prototype.setTipPoints=function(M){M===void 0&&(M=!1);var K=Math.min(this.height/2,15),$=this.height/5;M&&(this.tipPosition={x:K+$/2,y:this.height+20});var B=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?B<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?($=this.width/5,K=Math.min(this.width/2,15),this.tipBase1Position={x:K,y:0},this.tipBase2Position={x:K+$,y:0}):(this.tipBase1Position={x:0,y:K},this.tipBase2Position={x:0,y:K+$}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?B<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?($=this.width/5,K=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-K-$,y:0},this.tipBase2Position={x:this.width-K,y:0}):(this.tipBase1Position={x:this.width,y:K},this.tipBase2Position={x:this.width,y:K+$}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?B<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?($=this.width/5,K=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-K-$,y:this.height},this.tipBase2Position={x:this.width-K,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-K-$},this.tipBase2Position={x:this.width,y:this.height-K}):B<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?($=this.width/5,K=Math.min(this.width/2,15),this.tipBase1Position={x:K,y:this.height},this.tipBase2Position={x:K+$,y:this.height}):(this.tipBase1Position={x:0,y:this.height-K},this.tipBase2Position={x:0,y:this.height-K-$})},R.prototype.resize=function(M){F.prototype.resize.call(this,M),this.positionTip()},R.prototype.positionTip=function(){k.setAttributes(this.tip,[["points",this.getTipPoints()]]);var M=this.tipGrip.visual.transform.baseVal.getItem(0);M.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(M,0)},Object.defineProperty(R.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),R.prototype.select=function(){this.positionTip(),F.prototype.select.call(this)},R.prototype.getState=function(){var M=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},F.prototype.getState.call(this));return M.typeName=R.typeName,M},R.prototype.restoreState=function(M){var K=M;this.bgColor=K.bgColor,this.tipPosition=K.tipPosition,F.prototype.restoreState.call(this,M),this.createTip(),this.setTipPoints()},R.prototype.scale=function(M,K){F.prototype.scale.call(this,M,K),this.tipPosition={x:this.tipPosition.x*M,y:this.tipPosition.y*K},this.positionTip()},R.typeName="CalloutMarker",R.title="Callout marker",R.icon='<svg viewBox="0 0 24 24"><path d="M4 2h16a2 2 0 012 2v12a2 2 0 01-2 2h-4l-4 4-4-4H4a2 2 0 01-2-2V4a2 2 0 012-2m0 2v12h4.83L12 19.17 15.17 16H20V4H4m2 3h12v2H6V7m0 4h10v2H6v-2z"/></svg>',R}(x),se=function(F){function R(M,K,$){var B=F.call(this,M,K,$)||this;return B.fillColor="transparent",B.strokeColor="transparent",B.strokeWidth=0,B.strokeDasharray="",B.opacity=1,B.strokeColor=$.defaultColor,B.strokeWidth=$.defaultStrokeWidth,B.strokeDasharray=$.defaultStrokeDasharray,B.fillColor=$.defaultFillColor,B.setStrokeColor=B.setStrokeColor.bind(B),B.setFillColor=B.setFillColor.bind(B),B.setStrokeWidth=B.setStrokeWidth.bind(B),B.setStrokeDasharray=B.setStrokeDasharray.bind(B),B.setOpacity=B.setOpacity.bind(B),B.createVisual=B.createVisual.bind(B),B.strokePanel=new y("Line color",A($.defaultColorSet,["transparent"]),$.defaultColor),B.strokePanel.onColorChanged=B.setStrokeColor,B.fillPanel=new y("Fill color",A($.defaultColorSet,["transparent"]),B.fillColor,G),B.fillPanel.onColorChanged=B.setFillColor,B.strokeWidthPanel=new f("Line width",$.defaultStrokeWidths,$.defaultStrokeWidth),B.strokeWidthPanel.onWidthChanged=B.setStrokeWidth,B.strokeStylePanel=new D("Line style",$.defaultStrokeDasharrays,$.defaultStrokeDasharray),B.strokeStylePanel.onStyleChanged=B.setStrokeDasharray,B.opacityPanel=new Y("Opacity",$.defaultOpacitySteps,B.opacity),B.opacityPanel.onOpacityChanged=B.setOpacity,B}return V(R,F),R.prototype.ownsTarget=function(M){return!(!F.prototype.ownsTarget.call(this,M)&&M!==this.visual)},R.prototype.createVisual=function(){this.visual=k.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},R.prototype.pointerDown=function(M,K){F.prototype.pointerDown.call(this,M,K),this.state==="new"&&(this.createVisual(),this.moveVisual(M),this._state="creating")},R.prototype.manipulate=function(M){F.prototype.manipulate.call(this,M)},R.prototype.resize=function(M){F.prototype.resize.call(this,M),this.setSize()},R.prototype.setSize=function(){F.prototype.setSize.call(this),k.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},R.prototype.pointerUp=function(M){F.prototype.pointerUp.call(this,M),this.setSize()},R.prototype.setStrokeColor=function(M){this.strokeColor=M,this.visual&&k.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(M),this.stateChanged()},R.prototype.setFillColor=function(M){this.fillColor=M,this.visual&&k.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(M),this.stateChanged()},R.prototype.setStrokeWidth=function(M){this.strokeWidth=M,this.visual&&k.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},R.prototype.setStrokeDasharray=function(M){this.strokeDasharray=M,this.visual&&k.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},R.prototype.setOpacity=function(M){this.opacity=M,this.visual&&k.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(R.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),R.prototype.getState=function(){var M=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},F.prototype.getState.call(this));return M.typeName=R.typeName,M},R.prototype.restoreState=function(M){var K=M;this.fillColor=K.fillColor,this.strokeColor=K.strokeColor,this.strokeWidth=K.strokeWidth,this.strokeDasharray=K.strokeDasharray,this.opacity=K.opacity,this.createVisual(),F.prototype.restoreState.call(this,M),this.setSize()},R.prototype.scale=function(M,K){F.prototype.scale.call(this,M,K),this.setSize()},R.typeName="EllipseMarker",R.title="Ellipse marker",R.icon='<svg viewBox="0 0 24 24"><path d="M12 4C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',R}(m),fe=function(F){function R(M,K,$){return F.call(this,M,K,$)||this}return V(R,F),Object.defineProperty(R.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),R.prototype.ownsTarget=function(M){return!(!F.prototype.ownsTarget.call(this,M)&&M!==this.tip1&&M!==this.tip2)},R.prototype.createTips=function(){this.tip1=k.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(k.createTransform()),this.visual.appendChild(this.tip1),this.tip2=k.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(k.createTransform()),this.visual.appendChild(this.tip2)},R.prototype.pointerDown=function(M,K){F.prototype.pointerDown.call(this,M,K),this.state==="creating"&&this.createTips()},R.prototype.adjustVisual=function(){if(F.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(k.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),k.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var M=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),K=this.tip1.transform.baseVal.getItem(0);K.setRotate(M,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(K,0);var $=this.tip2.transform.baseVal.getItem(0);$.setRotate(M+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem($,0)}},Object.defineProperty(R.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),R.prototype.getState=function(){var M=F.prototype.getState.call(this);return M.typeName=R.typeName,M},R.prototype.restoreState=function(M){F.prototype.restoreState.call(this,M),this.createTips(),this.adjustVisual()},R.typeName="MeasurementMarker",R.title="Measurement marker",R.icon='<svg viewBox="0 0 24 24"><path d="M1.39 18.36l1.77-1.76L4.58 18l1.06-1.05-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.42 1.41L10.59 12l-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.41 1.41 1.07-1.06-1.42-1.41 1.42-1.42L18 6.7l1.07-1.06-2.47-2.48 1.76-1.77 4.25 4.25L5.64 22.61l-4.25-4.25z"/></svg>',R}(c),Se=function(F){function R(M,K,$){var B=F.call(this,M,K,$)||this;return B.strokePanel.colors=$.defaultColorSet,B.fillColor="transparent",B}return V(R,F),Object.defineProperty(R.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),R.prototype.getState=function(){var M=F.prototype.getState.call(this);return M.typeName=R.typeName,M},R.typeName="EllipseFrameMarker",R.title="Ellipse frame marker",R.icon='<svg viewBox="0 0 24 24"><path d="M12 6c4.41 0 8 2.69 8 6s-3.59 6-8 6-8-2.69-8-6 3.59-6 8-6m0-2C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',R}(se),ke=function(){function F(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(F.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),F.prototype.addUndoStep=function(R){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(R)||(this.undoStack.push(R),JSON.stringify(this.lastRedoStep)!==JSON.stringify(R)&&this.redoStack.splice(0,this.redoStack.length))},F.prototype.replaceLastUndoStep=function(R){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=R)},F.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},F.prototype.undo=function(){if(this.undoStack.length>1){var R=this.undoStack.pop();return R!==void 0&&this.redoStack.push(R),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},F.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},F}(),Je=function(F){function R(M,K,$){var B=F.call(this,M,K,$)||this;return B.strokeColor="transparent",B.strokeWidth=0,B.strokeDasharray="",B.curveX=0,B.curveY=0,B.manipulationStartCurveX=0,B.manipulationStartCurveY=0,B.setStrokeColor=B.setStrokeColor.bind(B),B.setStrokeWidth=B.setStrokeWidth.bind(B),B.setStrokeDasharray=B.setStrokeDasharray.bind(B),B.positionGrips=B.positionGrips.bind(B),B.addControlGrips=B.addControlGrips.bind(B),B.adjustVisual=B.adjustVisual.bind(B),B.setupControlBox=B.setupControlBox.bind(B),B.resize=B.resize.bind(B),B.strokeColor=$.defaultColor,B.strokeWidth=$.defaultStrokeWidth,B.strokeDasharray=$.defaultStrokeDasharray,B.strokePanel=new y("Line color",$.defaultColorSet,$.defaultColor),B.strokePanel.onColorChanged=B.setStrokeColor,B.strokeWidthPanel=new f("Line width",$.defaultStrokeWidths,$.defaultStrokeWidth),B.strokeWidthPanel.onWidthChanged=B.setStrokeWidth,B.strokeStylePanel=new D("Line style",$.defaultStrokeDasharrays,$.defaultStrokeDasharray),B.strokeStylePanel.onStyleChanged=B.setStrokeDasharray,B}return V(R,F),R.prototype.ownsTarget=function(M){return!(!F.prototype.ownsTarget.call(this,M)&&M!==this.visual&&M!==this.selectorCurve&&M!==this.visibleCurve&&!this.curveGrip.ownsTarget(M))},R.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},R.prototype.createVisual=function(){this.visual=k.createGroup(),this.selectorCurve=k.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=k.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},R.prototype.pointerDown=function(M,K){F.prototype.pointerDown.call(this,M,K),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=M.x,this.curveY=M.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(K)&&(this.activeGrip=this.curveGrip,this._state="resize")},R.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),k.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),k.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),k.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},R.prototype.setupControlBox=function(){F.prototype.setupControlBox.call(this),this.curveControlLine1=k.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=k.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},R.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,F.prototype.addControlGrips.call(this)},R.prototype.positionGrips=function(){F.prototype.positionGrips.call(this);var M=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-M/2,this.curveY-M/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},R.prototype.manipulate=function(M){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+M.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+M.y-this.manipulationStartY),F.prototype.manipulate.call(this,M)},R.prototype.resize=function(M){this.activeGrip===this.curveGrip&&(this.curveX=M.x,this.curveY=M.y),F.prototype.resize.call(this,M),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},R.prototype.setStrokeColor=function(M){this.strokeColor=M,this.adjustVisual(),this.colorChanged(M)},R.prototype.setStrokeWidth=function(M){this.strokeWidth=M,this.adjustVisual()},R.prototype.setStrokeDasharray=function(M){this.strokeDasharray=M,this.adjustVisual()},R.prototype.scale=function(M,K){this.curveX=this.curveX*M,this.curveY=this.curveY*K,F.prototype.scale.call(this,M,K)},Object.defineProperty(R.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),R.prototype.getState=function(){var M=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},F.prototype.getState.call(this));return M.typeName=R.typeName,M},R.prototype.restoreState=function(M){F.prototype.restoreState.call(this,M);var K=M;this.strokeColor=K.strokeColor,this.strokeWidth=K.strokeWidth,this.strokeDasharray=K.strokeDasharray,this.curveX=K.curveX,this.curveY=K.curveY,this.createVisual(),this.adjustVisual()},R.typeName="CurveMarker",R.title="Curve marker",R.icon='<svg viewBox="0 0 24 24"><path d="M18.5 2A1.5 1.5 0 0120 3.5 1.5 1.5 0 0118.5 5c-.23 0-.45-.05-.65-.15l-3.69 3.7.34.45c2.19-1.26 4.76-2 7.5-2l1 .03v2.01L22 9c-2.58 0-5 .75-7 2.04A3.96 3.96 0 0111.04 15C9.75 17 9 19.42 9 22l.04 1H7.03L7 22c0-2.74.74-5.31 2-7.5l-.45-.34-3.7 3.69c.1.2.15.42.15.65A1.5 1.5 0 013.5 20 1.5 1.5 0 012 18.5 1.5 1.5 0 013.5 17c.23 0 .45.05.65.15l3.69-3.7C7.31 12.78 7 11.92 7 11a4 4 0 014-4c.92 0 1.78.31 2.45.84l3.7-3.69c-.1-.2-.15-.42-.15-.65A1.5 1.5 0 0118.5 2M11 9a2 2 0 00-2 2 2 2 0 002 2 2 2 0 002-2 2 2 0 00-2-2z"/></svg>',R}(p),_e=function(){function F(R,M){M===void 0&&(M=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=R,this.cancelable=M}return Object.defineProperty(F.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),F.prototype.preventDefault=function(){this._defaultPrevented=!0},F}(),Qe=function(F){function R(M,K,$){var B=F.call(this,M,!1)||this;return B.dataUrl=K,B.state=$,B}return V(R,F),R}(_e),Ue=function(F){function R(M,K,$){$===void 0&&($=!1);var B=F.call(this,M,$)||this;return B.marker=K,B}return V(R,F),R}(_e),Fe=function(){function F(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return F.prototype.addEventListener=function(R,M){this[R].push(M)},F.prototype.removeEventListener=function(R,M){var K=this[R].indexOf(M);K>-1&&this[R].splice(K,1)},F}(),we=function(){function F(R){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new h,this._isOpen=!1,this.undoRedoManager=new ke,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.renderMarkersOnly=!1,this.zoomSteps=[1,1.5,2,4],this._zoomLevel=1,this._isResizing=!1,this.prevPanPoint={x:0,y:0},this.eventListeners=new Fe,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=F.instanceCounter++,this.styles=new L(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=R,this.targetRoot=document.body,this.width=R.clientWidth,this.height=R.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(F.prototype,"ALL_MARKER_TYPES",{get:function(){return[v,g,_,x,Se,se,oe,j,fe,z,c,Je]},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[v,g,_,x,se,oe,j]},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"BASIC_MARKER_TYPES",{get:function(){return[v,g,_,x,oe]},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(R){var M=this;this._availableMarkerTypes.splice(0),R.forEach(function(K){if(typeof K=="string"){var $=M.ALL_MARKER_TYPES.find(function(B){return B.typeName===K});$!==void 0&&M._availableMarkerTypes.push($)}else M._availableMarkerTypes.push(K)})},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(R){this._zoomLevel=R,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),F.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),W.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},F.prototype.show=function(){var R=this;this.styles.styleSheetRoot===void 0&&P.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=P.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(M){return M(new _e(R))})},F.prototype.render=function(){return O(this,void 0,void 0,function(){var R;return H(this,function(M){switch(M.label){case 0:return this.setCurrentMarker(),(R=new U).naturalSize=this.renderAtNaturalSize,R.imageType=this.renderImageType,R.imageQuality=this.renderImageQuality,R.markersOnly=this.renderMarkersOnly,R.width=this.renderWidth,R.height=this.renderHeight,[4,R.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return M.sent(),[4,R.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,M.sent()]}})})},F.prototype.close=function(R){var M=this;if(R===void 0&&(R=!1),this.isOpen){var K=!1;R||this.eventListeners.beforeclose.forEach(function($){var B=new _e(M,!0);$(B),B.defaultPrevented&&(K=!0)}),K||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function($){return $(new _e(M))}),this.detachEvents(),this._isOpen=!1)}},F.prototype.addMarkersToToolbar=function(){for(var R,M=[],K=0;K<arguments.length;K++)M[K]=arguments[K];(R=this._availableMarkerTypes).push.apply(R,M)},F.prototype.addRenderEventListener=function(R){this.addEventListener("render",function(M){R(M.dataUrl,M.state)})},F.prototype.removeRenderEventListener=function(R){},F.prototype.addCloseEventListener=function(R){this.addEventListener("close",function(){R()})},F.prototype.removeCloseEventListener=function(R){},F.prototype.setupResizeObserver=function(){var R=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){R.resize(R.target.clientWidth,R.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return R.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},F.prototype.onPopupTargetResize=function(){var R=1*this.target.clientWidth/this.target.clientHeight,M=this.editorCanvas.clientWidth/R>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*R:this.editorCanvas.clientWidth,K=M<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/R;this.resize(M,K)},F.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},F.prototype.resize=function(R,M){this._isResizing=!0;var K=R/this.imageWidth,$=M/this.imageHeight;this.imageWidth=Math.round(R),this.imageHeight=Math.round(M),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.settings.displayMode!=="popup"?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),this.toolbar!==void 0&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(K,$),this._isResizing=!1},F.prototype.scaleMarkers=function(R,M){var K,$=this;this._currentMarker&&this._currentMarker instanceof x?this._currentMarker.scale(R,M):(K=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(B){B!==$._currentMarker&&B.scale(R,M)}),K!==void 0&&this.setCurrentMarker(K)},F.prototype.setEditingTarget=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px"},F.prototype.setTopLeft=function(){var R=this.editingTarget.getBoundingClientRect(),M=this.editorCanvas.getBoundingClientRect();this.left=R.left-M.left,this.top=R.top-M.top},F.prototype.initMarkerCanvas=function(){this.markerImageHolder=document.createElement("div"),this.markerImageHolder.style.setProperty("touch-action","pinch-zoom"),this.markerImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.markerImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImage.style.pointerEvents="auto",this.markerImageHolder.style.position="absolute",this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.markerImageHolder.style.transformOrigin="top left",this.positionMarkerImage(),this.markerImageHolder.appendChild(this.markerImage),this.editorCanvas.appendChild(this.markerImageHolder)},F.prototype.addDefs=function(){for(var R,M=[],K=0;K<arguments.length;K++)M[K]=arguments[K];this.defs=k.createDefs(),this.addDefsToImage(),(R=this.defs).append.apply(R,M)},F.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},F.prototype.initOverlay=function(){this.overlayContainer=document.createElement("div"),this.overlayContainer.style.position="absolute",this.overlayContainer.style.left="0px",this.overlayContainer.style.top="0px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.overlayContainer.style.display="flex",this.markerImageHolder.appendChild(this.overlayContainer)},F.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},F.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},F.prototype.attachWindowEvents=function(){window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("pointerout",this.onPointerOut),window.addEventListener("pointerleave",this.onPointerUp),window.addEventListener("resize",this.onWindowResize),window.addEventListener("keyup",this.onKeyUp)},F.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},F.prototype.detachWindowEvents=function(){window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("pointerout",this.onPointerOut),window.removeEventListener("pointerleave",this.onPointerUp),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("keyup",this.onKeyUp)},F.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var R=document.createElement("a");R.href="https://markerjs.com/",R.target="_blank",R.innerHTML='<svg viewBox="0 0 112 96" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path fill="#e5f20d" fill-opacity=".647" d="M0 40.386h111.96V95.62H0z"/><path d="M93.61 61.452c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.591 1.048-1.481 0-2.222-.74-2.222-2.22 0-16.617-.533-29.347-1.604-38.192-1.068-8.842-2.92-13.265-5.552-13.265-4.443 0-10.94 15.509-19.497 46.52v.124c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.592 1.048-1.48 0-2.22-.74-2.22-2.22 0-3.29.165-8.392.493-15.302.33-7.732.494-13.82.494-18.262 0-6.17-.186-10.55-.556-13.142-.37-2.591-1.172-3.887-2.406-3.887-2.796 0-6.333 5.12-10.612 15.363C38.494 34.367 34.01 46.44 29.32 60.34l-1.11 3.209a5.714 5.714 0 01-1.42 2.097c-.617.578-1.295.864-2.036.864-.987 0-1.644-.081-1.974-.247-.328-.162-.533-.656-.617-1.48-.41-4.03-.74-9.418-.987-16.165-.163-1.728-.329-4.566-.494-8.515-.822-13.901-1.562-23.3-2.221-28.196-.657-4.893-.987-7.628-.987-8.205 0-.657.33-1.44.987-2.345.659-.903 1.276-1.357 1.85-1.357 1.319 0 2.387.947 3.21 2.838.411.906.863 4.526 1.357 10.859.493 6.335.905 14.19 1.233 23.568l.617 18.88c4.527-13.983 9.216-26.673 14.068-38.068C45.65 6.686 50.093.988 54.123.988c2.715 0 4.566 1.974 5.553 5.923.987 3.949 1.481 9.667 1.481 17.152 0 3.949-.081 9.625-.247 17.029l-.123 5.676c3.373-11.762 6.725-21.634 10.057-29.615 3.331-7.979 6.685-11.97 10.056-11.97 8.475 0 12.71 18.757 12.71 56.269z" fill-rule="nonzero"/></svg>',R.title="Powered by marker.js",R.style.display="grid",R.style.alignItems="center",R.style.justifyItems="center",R.style.padding="3px",R.style.width="20px",R.style.height="20px",this.logoUI.appendChild(R),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},F.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},F.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},F.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},F.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var R=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=R+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new I(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y<this.styles.settings.toolbarHeight&&(this.editingTarget.style.marginTop=this.target.offsetTop-this.styles.settings.toolbarHeight+"px"),this.editorCanvas.appendChild(this.editingTarget),this.toolbox=new w(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},F.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},F.prototype.removeMarker=function(R){this.markerImage.removeChild(R.container),this.markers.indexOf(R)>-1&&this.markers.splice(this.markers.indexOf(R),1),R.dispose()},F.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},F.prototype.toolbarButtonClicked=function(R,M){if(R==="marker"&&M!==void 0)this.createNewMarker(M);else if(R==="action")switch(M){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},F.prototype.deleteSelectedMarker=function(){var R=this;if(this._currentMarker!==void 0){var M=!1;if(this.eventListeners.markerbeforedelete.forEach(function($){var B=new Ue(R,R._currentMarker,!0);$(B),B.defaultPrevented&&(M=!0)}),!M){var K=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function($){return $(new Ue(R,K))})}}},F.prototype.clear=function(){var R=this,M=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(ge){var Oe=new Ue(R,void 0,!0);ge(Oe),Oe.defaultPrevented&&(M=!0)}),!M)){this.setCurrentMarker();for(var K=function(ge){var Oe=$.markers[ge];$.setCurrentMarker($.markers[ge]),$._currentMarker.dispose(),$.markerImage.removeChild($._currentMarker.container),$.markers.splice($.markers.indexOf($._currentMarker),1),$.eventListeners.markerdelete.forEach(function(je){return je(new Ue(R,Oe))})},$=this,B=this.markers.length-1;B>=0;B--)K(B);this.addUndoStep()}},Object.defineProperty(F.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),F.prototype.showNotesEditor=function(){var R;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(R=this._currentMarker.notes)!==null&&R!==void 0?R:"",this.overlayContainer.appendChild(this.notesArea))},F.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},F.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},F.prototype.addUndoStep=function(){var R=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var M=this.getState(),K=this.undoRedoManager.getLastUndoStep();if(!K||K.width===M.width&&K.height===M.height){var $=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(M),$<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(B){return B(new _e(R))})}else this.undoRedoManager.replaceLastUndoStep(M),this.eventListeners.statechange.forEach(function(B){return B(new _e(R))})}},F.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},F.prototype.undoStep=function(){var R=this,M=this.undoRedoManager.undo();M!==void 0&&(this.restoreState(M),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(K){return K(new _e(R))}))},F.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},F.prototype.redoStep=function(){var R=this,M=this.undoRedoManager.redo();M!==void 0&&(this.restoreState(M),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(K){return K(new _e(R))}))},F.prototype.stepZoom=function(){var R=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=R<this.zoomSteps.length-1?this.zoomSteps[R+1]:this.zoomSteps[0]},F.prototype.panTo=function(R){this.contentDiv.scrollBy({left:this.prevPanPoint.x-R.x,top:this.prevPanPoint.y-R.y}),this.prevPanPoint=R},F.prototype.startRenderAndClose=function(){return O(this,void 0,void 0,function(){var R,M,K=this;return H(this,function($){switch($.label){case 0:return[4,this.render()];case 1:return R=$.sent(),M=this.getState(),this.eventListeners.render.forEach(function(B){return B(new Qe(K,R,M))}),this.close(!0),[2]}})})},F.prototype.getState=function(R){R===!0&&this.setCurrentMarker();var M={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(K){return M.markers.push(K.getState())}),M},F.prototype.restoreState=function(R){var M=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);R.markers.forEach(function(K){var $=M._availableMarkerTypes.find(function(ge){return ge.typeName===K.typeName});if($!==void 0){var B=M.addNewMarker($);B.restoreState(K),M.markers.push(B)}}),R.width&&R.height&&(R.width!==this.imageWidth||R.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/R.width,this.imageHeight/R.height),this.eventListeners.restorestate.forEach(function(K){return K(new _e(M))})},F.prototype.addNewMarker=function(R){var M=k.createGroup();return this.markerImage.appendChild(M),new R(M,this.overlayContainer,this.settings)},F.prototype.createNewMarker=function(R){var M,K=this;(M=typeof R=="string"?this._availableMarkerTypes.find(function($){return $.typeName===R}):R)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(M),this._currentMarker.onMarkerCreated=this.markerCreated,this._currentMarker.onColorChanged=this.colorChanged,this._currentMarker.onFillColorChanged=this.fillColorChanged,this._currentMarker.onStateChanged=this.markerStateChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(M.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function($){return $(new Ue(K,K._currentMarker))}))},F.prototype.markerCreated=function(R){var M=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(R),this.setCurrentMarker(R),R instanceof g&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(g):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(K){return K(new Ue(M,M._currentMarker))})},F.prototype.colorChanged=function(R){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=R,this.settings.defaultStrokeColor=R)},F.prototype.fillColorChanged=function(R){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=R)},F.prototype.markerStateChanged=function(R){var M=this;this.eventListeners.markerchange.forEach(function(K){return K(new Ue(M,R))})},F.prototype.setCurrentMarker=function(R){var M=this;this._currentMarker!==R&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(K){return K(new Ue(M,M._currentMarker))})),this._currentMarker=R,this._currentMarker===void 0||this._currentMarker.isSelected||(this._currentMarker.state!=="new"&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach(function(K){return K(new Ue(M,M._currentMarker))}))},F.prototype.onPointerDown=function(R){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||R.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var M=this.markers.find(function(K){return K.ownsTarget(R.target)});M!==void 0?(this.setCurrentMarker(M),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(R.clientX,R.clientY),R.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:R.clientX,y:R.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(R.clientX,R.clientY))},F.prototype.onDblClick=function(R){if(this._isFocused||this.focus(),this.mode==="select"){var M=this.markers.find(function(K){return K.ownsTarget(R.target)});M!==void 0&&M!==this._currentMarker&&this.setCurrentMarker(M),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(R.clientX,R.clientY),R.target):this.setCurrentMarker()}},F.prototype.onPointerMove=function(R){this.touchPoints!==1&&R.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||R.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(R.clientX,R.clientY)):this.zoomLevel>1&&this.panTo({x:R.clientX,y:R.clientY}))},F.prototype.onPointerUp=function(R){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(R.clientX,R.clientY)),this.isDragging=!1,this.addUndoStep()},F.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},F.prototype.onKeyUp=function(R){this._currentMarker===void 0||this.notesArea!==void 0||R.key!=="Delete"&&R.key!=="Backspace"||this.deleteSelectedMarker()},F.prototype.clientToLocalCoordinates=function(R,M){var K=this.markerImage.getBoundingClientRect();return{x:(R-K.left)/this.zoomLevel,y:(M-K.top)/this.zoomLevel}},F.prototype.onWindowResize=function(){this.positionUI()},F.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var R=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=R+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},F.prototype.addLicenseKey=function(R){W.addKey(R)},F.prototype.addEventListener=function(R,M){this.eventListeners.addEventListener(R,M)},F.prototype.removeEventListener=function(R,M){this.eventListeners.removeEventListener(R,M)},F.prototype.renderState=function(R){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(R),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(F.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),F.prototype.focus=function(){var R=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(M){return M(new _e(R))}))},F.prototype.blur=function(){var R=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(M){return M(new _e(R))}))},F.instanceCounter=0,F}()},TGq3:function(Ge,We,X){Ge.exports=X.p+"static/lockclose.365036e8.svg"},UUDw:function(Ge,We,X){Ge.exports={buttonFixed:"buttonFixed___2zLVJ",button:"button___-JgFH",buttonWrap:"buttonWrap___aZhhk"}},UeE2:function(Ge,We,X){"use strict";X.r(We);var de=X("5NDa"),V=X("5rEg"),O=X("7Kak"),H=X("9yH6"),A=X("2qtc"),k=X("kLXV"),W=X("+L6B"),U=X("2/Rp"),P=X("miYZ"),L=X("tsqr"),b=X("9og8"),E=X("k1fw"),I=X("y8nQ"),w=X("Vl3Y"),T=X("tJVT"),y=X("PpiC"),u=X("Znn+"),a=X("ZTPi"),l=X("WmNS"),s=X.n(l),m=X("q1tI"),d=X.n(m),f=X("9kvl"),D=X("Ot1p"),v=X("9Bee"),h=X("HBuW"),p=X("14J3"),c=X("BMrR"),o=X("jCWc"),x=X("kPKH"),g=X("OaEy"),C=X("2fM7"),_=X("1vsH"),z=X("uIXO"),Y=X.n(z),oe=X("5Dmo"),G=X("3S7+"),j=X("oBTY"),se=X("WXWZ"),fe=X.n(se),Se=["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"],ke=function(ft,lt){var Ye=ft.editData,Ne=Object(m.useState)(["","","",""]),ht=Object(T.a)(Ne,2),qe=ht[0],le=ht[1],Z=Object(m.useState)(),q=Object(T.a)(Z,2),ne=q[0],ue=q[1],ee=Object(m.useState)([]),ie=Object(T.a)(ee,2),ce=ie[0],pe=ie[1],xe=Object(m.useState)(""),De=Object(T.a)(xe,2),Be=De[0],$e=De[1];Object(m.useEffect)(function(){var Ct,ot;if(!Ye)return;$e(Ye==null?void 0:Ye.subject),le(Ye==null||((Ct=Ye.choose_contents)===null||Ct===void 0)?void 0:Ct.map(function(Rt){return Rt.option_name}));var Ut=[];Ye==null||((ot=Ye.choose_contents)===null||ot===void 0)||ot.map(function(Rt,_t){Rt.right_key&&Ut.push(_t)}),pe(Ut)},[Ye]),Object(m.useImperativeHandle)(lt,function(){return{onSave:xt,Clear:Ft}});var pt=function(){for(var ot=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Ut=Object(j.a)(ot),Rt=Ut.sort(),_t=0;_t<Rt.length-1;_t++)if(Rt[_t]==Rt[_t+1])return!0;return!1},xt=function(){if(!Be)return L.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;var ot=qe.findIndex(function(Rt){return!Rt});if(ot>-1)return L.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(Se[ot]," \u9009\u9879\u7684\u5185\u5BB9")),!1;if(console.log(qe,"questionChoiceList"),pt(qe))return L.b.info("\u9009\u9879\u5DF2\u91CD\u590D"),!1;if(!ce.length)return L.b.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),!1;var Ut=qe.map(function(Rt,_t){return{choice_text:Rt,is_answer:ce.includes(_t)?1:0}});return{name:Be,choices:Ut}},Ft=function(){le(["","","",""]),$e(""),pe([])};return d.a.createElement("section",{className:fe.a.wrap},d.a.createElement("p",{className:fe.a.titleWrap},d.a.createElement("span",{className:fe.a.required},"*"),d.a.createElement("span",{className:fe.a.title},"\u9898\u5E72\uFF1A")),d.a.createElement(D.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Be,onChange:function(ot){return $e(ot)}}),d.a.createElement("p",{className:fe.a.titleWrap},d.a.createElement("span",{className:fe.a.required},"*"),d.a.createElement("span",{className:fe.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",d.a.createElement("span",{className:fe.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),qe.map(function(Ct,ot){return d.a.createElement("div",{className:fe.a.choiceWrap,key:ot},d.a.createElement(G.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},d.a.createElement("div",{className:"".concat(fe.a.answer," ").concat(ce.includes(ot)?fe.a.activeAnswer:""),onClick:function(){ce.includes(ot)?pe(ce.filter(function(Rt){return Rt!==ot})):pe([].concat(Object(j.a)(ce),[ot]))}},Se[ot])),d.a.createElement("div",{className:fe.a.editorWrap},ne===ot?d.a.createElement(D.a,{id:"single-question-option-".concat(ot),watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:Ct,onChange:function(Rt){qe[ot]=Rt,le(qe)}}):d.a.createElement("div",{className:fe.a.htmlWrap,onClick:function(){return ue(ot)}},d.a.createElement(v.a,{value:Ct}))),ot>1&&d.a.createElement(G.a,{title:"\u5220\u9664"},d.a.createElement("i",{className:"".concat(fe.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return le(qe.filter(function(Rt,_t){return _t!==ot}))}})),ot<7&&ot===qe.length-1&&d.a.createElement(G.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},d.a.createElement("i",{className:"".concat(fe.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return le([].concat(Object(j.a)(qe),[""]))}})))}),d.a.createElement("div",{className:"mt10 mb10"},d.a.createElement("span",{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")))},Je=Object(m.forwardRef)(ke),_e=X("sRBo"),Qe=X("kaz8"),Ue=X("kqOp"),Fe=X("7qnI"),we=function(ft,lt){var Ye=ft.editData,Ne=Object(m.useState)(""),ht=Object(T.a)(Ne,2),qe=ht[0],le=ht[1],Z=Object(m.useState)([]),q=Object(T.a)(Z,2),ne=q[0],ue=q[1],ee=Object(m.useState)(""),ie=Object(T.a)(ee,2),ce=ie[0],pe=ie[1],xe=Object(m.useState)(),De=Object(T.a)(xe,2),Be=De[0],$e=De[1],pt=Object(m.useState)(!1),xt=Object(T.a)(pt,2),Ft=xt[0],Ct=xt[1];Object(m.useEffect)(function(){if(!Ye)return;le(Ye==null?void 0:Ye.subject),$e(Ye==null?void 0:Ye.is_ordered),Ct(!0)},[Ye]),Object(m.useEffect)(function(){var Gt;if(!Ft)return;var Tt=Ye==null||((Gt=Ye.standard_answers)===null||Gt===void 0)?void 0:Gt.map(function(qt){return qt.text});ue(Tt),Ct(!1)},[Ft]),Object(m.useImperativeHandle)(lt,function(){return{onSave:ot,Clear:Ut}}),console.log(ne,"answerList");var ot=function(){var Tt=[],qt=!1;return ne.forEach(function(nt,Or){Tt.push({position:Or+1,answer_text:[]}),nt.forEach(function(ur,Ar){Tt[Or].answer_text.push(ur),(!ur||!Object(_.eb)(ur,1e4))&&(pe("".concat(Or,"-").concat(Ar)),L.b.info(ur?"\u7B54\u6848\u4E0D\u80FD\u8D85\u8FC710000\u5B57\u7B26":"\u7B54\u6848\uFF1A\u4E0D\u80FD\u4E3A\u7A7A"),qt=!0)})}),qt?!1:(Tt==null?void 0:Tt.length)>20?(L.b.warn("\u586B\u7A7A\u9898\u6807\u51C6\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A/\u4E0D\u80FD\u8D85\u8FC720\u4E2A\uFF01"),!1):{name:qe,standard_answers:Tt,is_ordered:Be}},Ut=function(){le(""),ue([]),$e(!1)},Rt=function(Tt,qt,nt){var Or=ne.slice();if(qt&&Or.splice(Tt,qt),nt)for(var ur=0;ur<nt;ur++)Or.splice(Tt+ur,0,[""]);ue(Or)},_t=function(Tt,qt,nt){pe("");var Or=ne.slice();Or[Tt][qt]=nt,ue(Or)},Vt=function(Tt){var qt=ne.slice();qt[Tt]=[].concat(Object(j.a)(qt[Tt]),[""]),ue(qt)},bt=function(Tt,qt){var nt=ne.slice();if(!nt[Tt][qt]){nt[Tt]=nt[Tt].filter(function(Or,ur){return ur!==qt}),ue(nt);return}k.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u53C2\u8003\u7B54\u6848\u5417\uFF1F",className:fe.a.modal,onOk:function(){nt[Tt]=nt[Tt].filter(function(ur,Ar){return Ar!==qt}),ue(nt)}})},cr=function(Tt){k.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u53C2\u8003\u7B54\u6848\u5417\uFF1F",className:fe.a.modal,onOk:function(){var nt=ne.slice();nt=ne.filter(function(Or,ur){return Tt!==ur}),ue(nt)}})};return d.a.createElement("section",{className:fe.a.wrap},d.a.createElement("p",{className:fe.a.titleWrap},d.a.createElement("span",{className:fe.a.required},"*"),d.a.createElement("span",{className:fe.a.title},"\u9898\u5E72\uFF1A")),d.a.createElement("div",null,d.a.createElement(Ue.a,{id:"completion-question-tittle",placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE",height:155,defaultValue:qe,onChange:function(Tt){return le(Tt)},showNullButton:!0,onPlaceholderChange:Rt})),d.a.createElement("div",{className:"mt20"},ne.map(function(Gt,Tt){return d.a.createElement(Fe.a,{key:Tt,answers:Gt,index:Tt,is_md:!0,activeOptionErrorIndex:ce,onAnswerChange:_t,addChildAnswer:Vt,deleteChildAnswer:bt,deleteChildAnswermain:cr})})),d.a.createElement("div",{className:"mt10 mb5"},ne.length>1&&d.a.createElement("span",null,d.a.createElement(Qe.a,{checked:Be,onChange:function(Tt){return $e(Tt.target.checked)},className:fe.a.color333},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),d.a.createElement("span",{className:"".concat(fe.a.color999," font12")},"\uFF08\u9009\u4E2D\uFF0C\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u987A\u5E8F\u5FC5\u987B\u4E0E\u53C2\u8003\u7B54\u6848\u4E00\u81F4\uFF09"))))},F=Object(m.forwardRef)(we),R=["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"],M=function(ft,lt){var Ye=ft.editData,Ne=Object(m.useState)(),ht=Object(T.a)(Ne,2),qe=ht[0],le=ht[1],Z=Object(m.useState)(""),q=Object(T.a)(Z,2),ne=q[0],ue=q[1];Object(m.useEffect)(function(){if(!Ye)return;ue(Ye==null?void 0:Ye.subject),le((Ye==null?void 0:Ye.standard_answer)==="\u6B63\u786E"?"0":"1")},[Ye]),Object(m.useImperativeHandle)(lt,function(){return{onSave:ee,Clear:ie}});var ee=function(){if(!ne)return L.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;if(!qe)return L.b.info("\u8BF7\u5148\u70B9\u51FB\u9009\u62E9\u672C\u5224\u65AD\u9898\u7684\u6B63\u786E\u9009\u9879"),!1;var pe=[{choice_text:"\u6B63\u786E",is_answer:qe==="0"?1:0},{choice_text:"\u9519\u8BEF",is_answer:qe==="1"?1:0}];return{name:ne,choices:pe}},ie=function(){ue(""),le("")};return d.a.createElement("section",{className:fe.a.wrap},d.a.createElement("p",{className:fe.a.titleWrap},d.a.createElement("span",{className:fe.a.required},"*"),d.a.createElement("span",{className:fe.a.title},"\u9898\u5E72\uFF1A")),d.a.createElement(D.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:ne,onChange:function(pe){return ue(pe)}}),d.a.createElement("p",{className:fe.a.titleWrap},d.a.createElement("span",{className:fe.a.required},"*"),d.a.createElement("span",{className:fe.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",d.a.createElement("span",{className:fe.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),d.a.createElement(H.a.Group,{className:"mb10",buttonStyle:"solid",value:qe,onChange:function(pe){return le(pe.target.value)}},d.a.createElement(H.a.Button,{value:"0",className:"".concat(fe.a.radio," mr40")},"\u6B63\u786E"),d.a.createElement(H.a.Button,{value:"1",className:fe.a.radio},"\u9519\u8BEF")))},K=Object(m.forwardRef)(M),$=function(ft){var lt=ft.visible,Ye=lt===void 0?!1:lt,Ne=ft.is_published,ht=ft.match,qe=ft.editData,le=ft.onOk,Z=ft.onCancel,q=Object(m.useState)([10,20]),ne=Object(T.a)(q,2),ue=ne[0],ee=ne[1],ie=w.a.useForm(),ce=Object(T.a)(ie,1),pe=ce[0],xe=Object(m.useState)({}),De=Object(T.a)(xe,2),Be=De[0],$e=De[1],pt=Object(m.useRef)();Object(m.useEffect)(function(){return document.getElementById("modal-level-question").style.transform="none",function(){document.getElementById("modal-level-question").style.transform="translateX(0)"}},[]),Object(m.useEffect)(function(){Ye&&qe&&(pe.setFieldsValue(Object(E.a)({},qe)),ee(xt[qe.difficult]))},[Ye]);var xt={1:[10,20],2:[30,40,50,60],3:[70,80,90,100]},Ft=function(Vt,bt){$e(Object(E.a)({},bt)),"difficult"in Vt&&ot(Vt.difficult)},Ct=function(){var _t=Object(b.a)(s.a.mark(function Vt(){var bt,cr,Gt,Tt,qt,nt,Or;return s.a.wrap(function(Ar){for(;;)switch(Ar.prev=Ar.next){case 0:return Ar.next=2,pt.current.onSave();case 2:if(bt=Ar.sent,bt){Ar.next=5;break}return Ar.abrupt("return",!1);case 5:if(!(Ye===1)){Ar.next=11;break}return cr="",Gt={cnt:bt==null?void 0:bt.choices.map(function(ln){return ln.choice_text})},Tt={answer:bt==null?void 0:bt.choices.map(function(ln){return ln.is_answer})},Tt==null||Tt.answer.map(function(ln,Mr){ln&&(cr+=_.o[Mr])}),Ar.abrupt("return",{challenge_choose:{subject:bt.name,answer:Be.task_pass,standard_answer:cr,score:Be.score,difficult:Be.difficult},question:Gt,choice:Tt});case 11:if(!(Ye===2)){Ar.next=13;break}return Ar.abrupt("return",{challenge_choose:{subject:bt.name,answer:Be.task_pass,score:Be.score,difficult:Be.difficult},blank_answers:bt==null?void 0:bt.standard_answers,is_ordered:bt==null?void 0:bt.is_ordered});case 13:if(!(Ye===3)){Ar.next=16;break}return Or=bt!=null&&(qt=bt.choices)!==null&&qt!==void 0&&(nt=qt[0])!==null&&nt!==void 0&&nt.is_answer?"true":"false",Ar.abrupt("return",{challenge_choose:{subject:bt.name,answer:Be.task_pass,standard_answer:Or,score:Be.score,difficult:Be.difficult}});case 16:case"end":return Ar.stop()}},Vt)}));return function(){return _t.apply(this,arguments)}}(),ot=function(Vt){var bt=xt[Vt],cr=bt==null?void 0:bt[0];ee(bt),pe.setFieldsValue({score:cr}),$e(Object(E.a)(Object(E.a)({},pe.getFieldsValue()),{score:cr}))},Ut=function(){var _t=Object(b.a)(s.a.mark(function Vt(bt){var cr,Gt,Tt;return s.a.wrap(function(nt){for(;;)switch(nt.prev=nt.next){case 0:return nt.next=2,Ct();case 2:if(cr=nt.sent,cr){nt.next=5;break}return nt.abrupt("return");case 5:if(!qe){nt.next=25;break}return nt.t0=h.Pb,nt.t1=E.a,nt.t2=E.a,nt.t3=E.a,nt.t4={},nt.next=13,cr;case 13:return nt.t5=nt.sent,nt.t6=(0,nt.t3)(nt.t4,nt.t5),nt.t7=ht.params,nt.t8=(0,nt.t2)(nt.t6,nt.t7),nt.t9={},nt.t10={questionId:qe.choose_id,type:Ye},nt.t11=(0,nt.t1)(nt.t8,nt.t9,nt.t10),nt.next=22,(0,nt.t0)(nt.t11);case 22:return Gt=nt.sent,Gt.challenge_choose_id&&(L.b.success("\u64CD\u4F5C\u6210\u529F"),le()),nt.abrupt("return");case 25:return nt.t12=h.c,nt.t13=E.a,nt.t14=E.a,nt.t15=E.a,nt.t16={},nt.next=32,cr;case 32:return nt.t17=nt.sent,nt.t18=(0,nt.t15)(nt.t16,nt.t17),nt.t19=ht.params,nt.t20=(0,nt.t14)(nt.t18,nt.t19),nt.t21={},nt.t22={type:Ye},nt.t23=(0,nt.t13)(nt.t20,nt.t21,nt.t22),nt.next=41,(0,nt.t12)(nt.t23);case 41:Tt=nt.sent,Tt.challenge_choose_id&&(L.b.success("\u64CD\u4F5C\u6210\u529F"),le());case 43:case"end":return nt.stop()}},Vt)}));return function(bt){return _t.apply(this,arguments)}}(),Rt=function(){var _t=Object(b.a)(s.a.mark(function Vt(){var bt;return s.a.wrap(function(Gt){for(;;)switch(Gt.prev=Gt.next){case 0:return Gt.next=2,pt.current.onSave();case 2:if(bt=Gt.sent,bt){Gt.next=5;break}return Gt.abrupt("return",!1);case 5:pe.submit();case 6:case"end":return Gt.stop()}},Vt)}));return function(){return _t.apply(this,arguments)}}();return d.a.createElement("div",{className:Y.a.modal},d.a.createElement("div",{className:Y.a.main},d.a.createElement("div",{className:Y.a.title},d.a.createElement("span",{className:Y.a.name},qe?"\u7F16\u8F91\u9898\u76EE":"\u6DFB\u52A0\u9898\u76EE"),d.a.createElement("span",{className:Y.a.edit,onClick:Z}," ",d.a.createElement("i",{className:"iconfont icon-guanbi1"})," ")),d.a.createElement("div",{className:Y.a.body,id:"question-scroll"},d.a.createElement(w.a,{form:pe,className:Y.a.form,scrollToFirstError:!0,layout:"vertical",onValuesChange:Ft,onFinish:Ut,initialValues:{difficult:1,score:10}},Ye===1&&d.a.createElement(Je,{ref:pt,editData:qe}),Ye===2&&d.a.createElement(F,{ref:pt,editData:qe}),Ye===3&&d.a.createElement(K,{ref:pt,editData:qe}),d.a.createElement(w.a.Item,{name:"task_pass",label:"\u53C2\u8003\u7B54\u6848:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u53C2\u8003\u7B54\u6848"},{max:35e3,message:"\u53C2\u8003\u7B54\u6848\u6700\u5927\u9650\u52365000\u4E2A\u5B57\u7B26"}]},d.a.createElement(D.a,{className:"mt5",watch:!0,defaultValue:(qe==null?void 0:qe.answer)||""})),d.a.createElement(w.a.Item,{name:"difficult",label:"\u96BE\u5EA6\u7CFB\u6570:",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u96BE\u5EA6\u7CFB\u6570"}]},d.a.createElement(H.a.Group,{disabled:Ne},d.a.createElement(H.a,{value:1},"\u7B80\u5355"),d.a.createElement(H.a,{style:{marginLeft:80},value:2},"\u4E2D\u7B49"),d.a.createElement(H.a,{style:{marginLeft:80},className:"ml80",value:3},"\u56F0\u96BE"))),d.a.createElement(c.a,{className:"customAddItemSelect"},d.a.createElement(x.a,null,d.a.createElement(w.a.Item,{name:"score",label:"\u5956\u52B1\u91D1\u5E01:",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u5956\u52B1\u7ECF\u9A8C\u503C"}]},d.a.createElement(C.a,{size:"large",disabled:Ne},ue.map(function(_t){return d.a.createElement(C.a.Option,{key:_t,value:_t},_t)})))),d.a.createElement(x.a,{style:{paddingTop:18}},d.a.createElement("div",{className:"font12 c-light-black ml10 mt20"},"\u5B66\u5458\u6B63\u786E\u7B54\u9898\u65F6\u83B7\u5F97\u91D1\u5E01\uFF0C\u5E76\u4E14\u83B7\u5F97\u7B49\u91CF\u7684\u7ECF\u9A8C\u503C\u3002\u5982\uFF1A+100\u91D1\u5E01\u3001+100\u7ECF\u9A8C\u503C\u3002"))))),d.a.createElement("div",{className:Y.a.btns},d.a.createElement(U.a,{size:"large",style:{marginRight:20},onClick:Z},"\u53D6\u6D88"),d.a.createElement(U.a,{size:"large",type:"primary",onClick:Rt},"\u4FDD\u5B58"))))},B=$,ge=X("mepR"),Oe=X.n(ge),je=X("9ZNV"),Ze=X("nuEh"),He=X("UqFu"),ze=X("lzim"),Xe=X("xKgJ"),dt=a.a.TabPane,ct=function(ft){var lt,Ye,Ne=ft.shixunsDetail,ht=ft.practiceSetting,qe=ft.dispatch,le=ft.match,Z=ft.location,q=Object(y.a)(ft,["shixunsDetail","practiceSetting","dispatch","match","location"]),ne=w.a.useForm(),ue=Object(T.a)(ne,1),ee=ue[0],ie=Object(m.useState)({}),ce=Object(T.a)(ie,2),pe=ce[0],xe=ce[1],De=Object(m.useState)([]),Be=Object(T.a)(De,2),$e=Be[0],pt=Be[1],xt=Object(m.useState)(!0),Ft=Object(T.a)(xt,2),Ct=Ft[0],ot=Ft[1],Ut=Object(m.useState)(!0),Rt=Object(T.a)(Ut,2),_t=Rt[0],Vt=Rt[1],bt=Object(m.useState)(!1),cr=Object(T.a)(bt,2),Gt=cr[0],Tt=cr[1],qt=Object(m.useState)(null),nt=Object(T.a)(qt,2),Or=nt[0],ur=nt[1],Ar=Object(m.useState)(null),ln=Object(T.a)(Ar,2),Mr=ln[0],Et=ln[1],sr=Object(m.useState)("1"),Gr=Object(T.a)(sr,2),zt=Gr[0],Ht=Gr[1],vr=Object(m.useState)(1),pn=Object(T.a)(vr,2),Br=pn[0],tt=pn[1],Ot=Object(m.useRef)({subject:"",task_pass:""}),Ln=Object(m.useRef)(null),ri=ht.is_published,hi=ht.id,zn=Ne.challengesEdit,fi=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];Object(m.useEffect)(function(){var Er;return Z!=null&&(Er=Z.query)!==null&&Er!==void 0&&Er.tab&&Ht(Z.query.tab),st(),yn(),function(){clearTimeout(Ln.current)}},[Z.pathname]);var jt=function(){clearTimeout(Ln.current),Ln.current=setTimeout(function(){var Mt=ee.getFieldsValue(),Wt=Mt.subject,nr=Mt.task_pass;Ot.current.subject!==""&&(Wt!==Ot.current.subject||nr!==Ot.current.task_pass?qe({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!0}}):qe({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!1}}))},500)},Hi=function(Mt,Wt){xe(Object(E.a)({},Wt)),jt()},st=function(){var Er=Object(b.a)(s.a.mark(function Mt(){var Wt;return s.a.wrap(function(yr){for(;;)switch(yr.prev=yr.next){case 0:return Vt(!0),yr.next=3,qe({type:"shixunsDetail/getChallengesEdit",payload:Object(E.a)({},le.params)});case 3:Wt=yr.sent,Et(Object(E.a)({},Wt)),Ot.current={subject:Wt.subject,task_pass:Object(He.a)(Wt.task_pass),unity_3d_routes:Wt.unity_3d_routes},xe(Object(E.a)({},Ot.current)),ee.setFieldsValue(Object(E.a)({},Wt)),Vt(!1);case 9:case"end":return yr.stop()}},Mt)}));return function(){return Er.apply(this,arguments)}}(),yn=function(){var Er=Object(b.a)(s.a.mark(function Mt(){var Wt;return s.a.wrap(function(yr){for(;;)switch(yr.prev=yr.next){case 0:return ot(!0),yr.next=3,Object(h.cb)(Object(E.a)({},le.params));case 3:Wt=yr.sent,pt(Wt.data),ot(!1);case 6:case"end":return yr.stop()}},Mt)}));return function(){return Er.apply(this,arguments)}}(),bn=function(){var Er=Object(b.a)(s.a.mark(function Mt(Wt){var nr,yr,Jt;return s.a.wrap(function(un){for(;;)switch(un.prev=un.next){case 0:return nr=!(!Wt.unity_3d_routes||Wt.unity_3d_routes==""),yr=Object(E.a)(Object(E.a)(Object(E.a)({},Wt),le.params),{},{unity_3d_routes:nr?Wt.unity_3d_routes:null,unity_3d:nr}),un.next=4,Object(h.Ob)(yr);case 4:Jt=un.sent,Jt.status===0&&(L.b.success(Jt.message),qe({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!1}}),qe({type:"practiceSetting/setUpdateIndex"}),Ht("2"),Mi());case 6:case"end":return un.stop()}},Mt)}));return function(Wt){return Er.apply(this,arguments)}}(),Di=function(){return zt==="1"?null:d.a.createElement("div",{className:"mb10"},d.a.createElement(U.a,{onClick:function(){return Tt(1)},type:"primary",ghost:!0},"\u6DFB\u52A0\u9009\u62E9\u9898"),d.a.createElement(U.a,{onClick:function(){return Tt(2)},type:"primary",className:"ml20 mr20",ghost:!0},"\u6DFB\u52A0\u586B\u7A7A\u9898"),d.a.createElement(U.a,{onClick:function(){return Tt(3)},type:"primary",ghost:!0},"\u6DFB\u52A0\u5224\u65AD\u9898"))},ni=function(Mt){var Wt,nr=function(){Ht(Mt),Mi(),qe({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!1}})};ht!=null&&(Wt=ht.sideBar)!==null&&Wt!==void 0&&Wt.confirmLeave?k.a.confirm({title:"\u79BB\u5F00\u6B64\u9875\u63D0\u793A",content:"\u7CFB\u7EDF\u53EF\u80FD\u4E0D\u4F1A\u4FDD\u5B58\u60A8\u6240\u505A\u7684\u66F4\u6539\u3002",okText:"\u79BB\u5F00",cancelText:"\u53D6\u6D88",onOk:function(){nr()}}):nr()},In=function(Mt){var Wt=function(){var nr=Object(b.a)(s.a.mark(function yr(){var Jt;return s.a.wrap(function(un){for(;;)switch(un.prev=un.next){case 0:return un.next=2,Object(h.w)(Object(E.a)(Object(E.a)({},le.params),{},{questionId:Mt}));case 2:Jt=un.sent,Jt.challenge_id&&(yn(),L.b.success("\u5220\u9664\u6210\u529F"));case 4:case"end":return un.stop()}},yr)}));return function(){return nr.apply(this,arguments)}}();k.a.confirm({title:"\u63D0\u793A",content:"\u662F\u5426\u5220\u9664\u9898\u76EE!",centered:!0,onOk:Wt})},pi=function(){var Er=Object(b.a)(s.a.mark(function Mt(Wt){var nr;return s.a.wrap(function(Jt){for(;;)switch(Jt.prev=Jt.next){case 0:return Jt.next=2,Object(h.Kb)(Object(E.a)(Object(E.a)({},le.params),{},{questionId:Wt}));case 2:nr=Jt.sent,nr.status===0&&yn();case 4:case"end":return Jt.stop()}},Mt)}));return function(Wt){return Er.apply(this,arguments)}}(),Ri=function(){var Er=Object(b.a)(s.a.mark(function Mt(Wt){var nr;return s.a.wrap(function(Jt){for(;;)switch(Jt.prev=Jt.next){case 0:return Jt.next=2,Object(h.C)(Object(E.a)(Object(E.a)({},le.params),{},{questionId:Wt}));case 2:nr=Jt.sent,nr.status===0&&yn();case 4:case"end":return Jt.stop()}},Mt)}));return function(Wt){return Er.apply(this,arguments)}}(),An=function(){var Er=Object(b.a)(s.a.mark(function Mt(Wt){var nr;return s.a.wrap(function(Jt){for(;;)switch(Jt.prev=Jt.next){case 0:return Jt.next=2,Object(h.S)(Object(E.a)(Object(E.a)({},le.params),{},{questionId:Wt}));case 2:nr=Jt.sent,ur(Object(E.a)(Object(E.a)({},nr),{},{choose_id:Wt})),Tt((nr==null?void 0:nr.question_name)==="\u5355\u9009\u9898/\u591A\u9009\u9898"?1:(nr==null?void 0:nr.question_name)==="\u586B\u7A7A\u9898"?2:3);case 5:case"end":return Jt.stop()}},Mt)}));return function(Wt){return Er.apply(this,arguments)}}(),Oi=function(){mi()},Mi=function(){tt(Br+1),st()},mi=function(){var Mt,Wt=function(){f.d.push("/shixuns/".concat(hi,"/challenges")),qe({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!1}})};ht!=null&&(Mt=ht.sideBar)!==null&&Mt!==void 0&&Mt.confirmLeave?k.a.confirm({title:"\u79BB\u5F00\u6B64\u9875\u63D0\u793A",content:"\u7CFB\u7EDF\u53EF\u80FD\u4E0D\u4F1A\u4FDD\u5B58\u60A8\u6240\u505A\u7684\u66F4\u6539\u3002",okText:"\u79BB\u5F00",cancelText:"\u53D6\u6D88",onOk:function(){Wt()}}):Wt()},Pn=function(){return $e.map(function(Mt,Wt){var nr=Mt.challenge_choose_id,yr=Mt.subject,Jt=Mt.choose_contents,Zn=Mt.standard_answer,un=Mt.answer,Ki=Mt.score,ia=Mt.category,Gn=Mt.question_name,En=Mt.standard_answers;return d.a.createElement("div",{key:nr,className:Oe.a.list},d.a.createElement("div",{className:Oe.a.top},d.a.createElement("div",{className:Oe.a.left},d.a.createElement("div",{className:Oe.a.title},d.a.createElement("div",{className:Oe.a.fs},Wt+1,". "),d.a.createElement(v.a,{value:yr})),Gn==="\u5355\u9009\u9898/\u591A\u9009\u9898"&&(Jt==null?void 0:Jt.map(function(dn,gi){return d.a.createElement("ul",{key:gi,className:dn.right_key?Oe.a.qsActive:Oe.a.qs},d.a.createElement("li",null,fi[dn.position]),d.a.createElement("li",null,d.a.createElement(v.a,{value:dn.option_name})))})),Gn==="\u5224\u65AD\u9898"&&d.a.createElement(H.a.Group,{className:"mb10",buttonStyle:"solid",value:Zn},d.a.createElement(H.a,{value:"\u6B63\u786E",className:"".concat(Oe.a.radio," mr40")},"\u6B63\u786E"),d.a.createElement(H.a,{value:"\u9519\u8BEF",className:Oe.a.radio},"\u9519\u8BEF"))),d.a.createElement("div",{className:Oe.a.right},d.a.createElement("i",{onClick:function(){return An(nr)},className:"iconfont icon-xiaoxiugai"}),d.a.createElement("i",{onClick:function(){return In(nr)},className:"iconfont icon-shanchu23"}),Wt!==$e.length-1&&d.a.createElement("i",{onClick:function(){return Ri(nr)},className:"iconfont icon-xiayi2"}),Wt!==0&&d.a.createElement("i",{onClick:function(){return pi(nr)},className:"iconfont icon-shangyi2"}))),d.a.createElement("div",{className:Oe.a.bt},"\u9898\u578B\uFF1A",Gn,"\xA0\xA0\xA0\xA0\u5956\u52B1\u91D1\u5E01\uFF1A",Ki),d.a.createElement("div",{className:Oe.a.answer},Gn==="\u586B\u7A7A\u9898"?En==null?void 0:En.map(function(dn,gi){var ii;return d.a.createElement("p",{key:gi},"\u586B\u7A7A",gi+1,"\uFF1A",dn==null||((ii=dn.text)===null||ii===void 0)?void 0:ii.join("\u3001"))}):d.a.createElement("p",null,"\u6807\u51C6\u7B54\u6848\uFF1A",Zn),d.a.createElement("p",null,d.a.createElement("div",{className:Oe.a.fs},"\u53C2\u8003\u7B54\u6848\uFF1A"),d.a.createElement(v.a,{value:un}))))})},ki=function(){Tt(!1),ur(null),yn()},na=function(){Tt(!1),ur(null)};return d.a.createElement("section",{className:Oe.a.bg,style:{marginBottom:zt==="1"?67:0}},d.a.createElement(a.a,{activeKey:zt,onChange:ni,tabBarExtraContent:Di()},d.a.createElement(dt,{tab:"\u672C\u5173\u4EFB\u52A1",key:"1"},d.a.createElement(w.a,{key:Br,form:ee,scrollToFirstError:!0,className:Oe.a.formWrap,layout:"vertical",onValuesChange:Hi,onFinish:bn},d.a.createElement("div",{className:Oe.a.fieldWrap},d.a.createElement(w.a.Item,{initialValue:"",name:"subject",label:"\u4EFB\u52A1\u540D\u79F0:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EFB\u52A1\u540D\u79F0"}]},d.a.createElement(V.a,{bordered:!1,maxLength:60,suffix:"".concat(((lt=pe.subject)===null||lt===void 0?void 0:lt.length)||0,"/60"),placeholder:"\u4F8B\u5982\uFF1A\u4ECEPython\u7A0B\u5E8F\u8BBE\u8BA1-\u5165\u95E8\u7CBE\u901A"}))),d.a.createElement("div",{className:Oe.a.mdWrap},d.a.createElement(w.a.Item,{name:"task_pass",label:"\u4EFB\u52A1\u8981\u6C42:",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"}]},d.a.createElement(D.a,{key:le.params.challengesId||"3",watch:!0,defaultValue:zn.task_pass}))),d.a.createElement(w.a.Item,{noStyle:!0},d.a.createElement(je.a,{okButtonProps:{htmlType:"submit"},className:"customFixedButton",onCancel:Oi})),Object(Xe.o)()&&d.a.createElement("div",{className:Oe.a.fieldWrap},d.a.createElement(w.a.Item,{initialValue:"",name:"unity_3d_routes",label:"\u5D4C\u5165\u7B2C\u4E09\u65B9\u5E73\u53F0:"},d.a.createElement(V.a,{bordered:!1,maxLength:60,suffix:"".concat(((Ye=pe.unity_3d_routes)===null||Ye===void 0?void 0:Ye.length)||0,"/60"),placeholder:"\u8BF7\u8F93\u5165\u7B2C\u4E09\u65B9\u5E73\u53F0\u5730\u5740"}))))),d.a.createElement(dt,{tab:"\u9898\u76EE",key:"2"},!!$e.length&&Pn(),!$e.length&&d.a.createElement("div",{className:Oe.a.empty},d.a.createElement("img",{src:ze.j,width:"258"}),d.a.createElement("span",{className:"c-grey-c"},"\u8BF7\u70B9\u51FB\u53F3\u4E0A\u89D2\u6DFB\u52A0\u9898\u76EE\u6309\u94AE\u8FDB\u884C\u9898\u76EE\u7684\u521B\u5EFA!"," ")))),!!Gt&&d.a.createElement(B,{is_published:ri,visible:Gt,onCancel:na,onOk:ki,match:le,editData:Or}),d.a.createElement(Ze.a,{loading:_t}))},gt=We.default=Object(f.a)(function(at){var ft=at.shixunsDetail,lt=at.newCourse,Ye=at.globalSetting,Ne=at.practiceSetting;return{shixunsDetail:ft,newCourse:lt,globalSetting:Ye,practiceSetting:Ne}})(ct)},UqFu:function(Ge,We,X){"use strict";X.d(We,"a",function(){return de});var de=function(O){var H=document.createElement("textarea");return H.value=O,H.value}},"VrN/":function(Ge,We,X){(function(de,V){Ge.exports=V()})(this,function(){"use strict";var de=navigator.userAgent,V=navigator.platform,O=/gecko\/\d/i.test(de),H=/MSIE \d/.test(de),A=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(de),k=/Edge\/(\d+)/.exec(de),W=H||A||k,U=W&&(H?document.documentMode||6:+(k||A)[1]),P=!k&&/WebKit\//.test(de),L=P&&/Qt\/\d+\.\d+/.test(de),b=!k&&/Chrome\//.test(de),E=/Opera\//.test(de),I=/Apple Computer/.test(navigator.vendor),w=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(de),T=/PhantomJS/.test(de),y=!k&&/AppleWebKit/.test(de)&&/Mobile\/\w+/.test(de),u=/Android/.test(de),a=y||u||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(de),l=y||/Mac/.test(V),s=/\bCrOS\b/.test(de),m=/win/i.test(V),d=E&&de.match(/Version\/(\d*\.\d*)/);d&&(d=Number(d[1])),d&&d>=15&&(E=!1,P=!0);var f=l&&(L||E&&(d==null||d<12.11)),D=O||W&&U>=9;function v(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var h=function(e,t){var n=e.className,r=v(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 p(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function c(e,t){return p(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 S=0;S<t.length;++S)i.appendChild(t[S]);return i}function x(e,t,n,r){var i=o(e,t,n,r);return i.setAttribute("role","presentation"),i}var g;document.createRange?g=function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:g=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 C(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 _(){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 z(e,t){var n=e.className;v(t).test(n)||(e.className+=(n?" ":"")+t)}function Y(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!v(n[r]).test(t)&&(t+=" "+n[r]);return t}var oe=function(e){e.select()};y?oe=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:W&&(oe=function(e){try{e.select()}catch(t){}});function G(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function j(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 se(e,t,n,r,i){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var S=r||0,N=i||0;;){var Q=e.indexOf(" ",S);if(Q<0||Q>=t)return N+(t-S);N+=Q-S,N+=n-N%n,S=Q+1}}var fe=function(){this.id=null,this.f=null,this.time=0,this.handler=G(this.onTimeout,this)};fe.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},fe.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 Se(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}var ke=50,Je={toString:function(){return"CodeMirror.Pass"}},_e={scroll:!1},Qe={origin:"*mouse"},Ue={origin:"+move"};function Fe(e,t,n){for(var r=0,i=0;;){var S=e.indexOf(" ",r);S==-1&&(S=e.length);var N=S-r;if(S==e.length||i+N>=t)return r+Math.min(N,t-i);if(i+=S-r,i+=n-i%n,r=S+1,i>=t)return r}}var we=[""];function F(e){for(;we.length<=e;)we.push(R(we)+" ");return we[e]}function R(e){return e[e.length-1]}function M(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function K(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}function $(){}function B(e,t){var n;return Object.create?n=Object.create(e):($.prototype=e,n=new $),t&&j(t,n),n}var ge=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Oe(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||ge.test(e))}function je(e,t){return t?t.source.indexOf("\\w")>-1&&Oe(e)?!0:t.test(e):Oe(e)}function Ze(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var He=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function ze(e){return e.charCodeAt(0)>=768&&He.test(e)}function Xe(e,t,n){for(;(n<0?t>0:t<e.length)&&ze(e.charAt(t));)t+=n;return t}function dt(e,t,n){for(var r=t>n?-1:1;;){if(t==n)return t;var i=(t+n)/2,S=r<0?Math.ceil(i):Math.floor(i);if(S==t)return e(S)?t:n;e(S)?n=S:t=S+r}}function ct(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,S=0;S<e.length;++S){var N=e[S];(N.from<n&&N.to>t||t==n&&N.to==t)&&(r(Math.max(N.from,t),Math.min(N.to,n),N.level==1?"rtl":"ltr",S),i=!0)}i||r(t,n,"ltr")}var gt=null;function at(e,t,n){var r;gt=null;for(var i=0;i<e.length;++i){var S=e[i];if(S.from<t&&S.to>t)return i;S.to==t&&(S.from!=S.to&&n=="before"?r=i:gt=i),S.from==t&&(S.from!=S.to&&n!="before"?r=i:gt=i)}return r!=null?r:gt}var ft=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(re){return re<=247?e.charAt(re):1424<=re&&re<=1524?"R":1536<=re&&re<=1785?t.charAt(re-1536):1774<=re&&re<=2220?"r":8192<=re&&re<=8203?"w":re==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,S=/[LRr]/,N=/[Lb1n]/,Q=/[1n]/;function J(re,ye,Ce){this.level=re,this.from=ye,this.to=Ce}return function(re,ye){var Ce=ye=="ltr"?"L":"R";if(re.length==0||ye=="ltr"&&!r.test(re))return!1;for(var Pe=re.length,Le=[],Ve=0;Ve<Pe;++Ve)Le.push(n(re.charCodeAt(Ve)));for(var et=0,ut=Ce;et<Pe;++et){var vt=Le[et];vt=="m"?Le[et]=ut:ut=vt}for(var St=0,yt=Ce;St<Pe;++St){var At=Le[St];At=="1"&&yt=="r"?Le[St]="n":S.test(At)&&(yt=At,At=="r"&&(Le[St]="R"))}for(var Bt=1,It=Le[0];Bt<Pe-1;++Bt){var rr=Le[Bt];rr=="+"&&It=="1"&&Le[Bt+1]=="1"?Le[Bt]="1":rr==","&&It==Le[Bt+1]&&(It=="1"||It=="n")&&(Le[Bt]=It),It=rr}for(var Nr=0;Nr<Pe;++Nr){var hn=Le[Nr];if(hn==",")Le[Nr]="N";else if(hn=="%"){var zr=void 0;for(zr=Nr+1;zr<Pe&&Le[zr]=="%";++zr);for(var Kn=Nr&&Le[Nr-1]=="!"||zr<Pe&&Le[zr]=="1"?"1":"N",Un=Nr;Un<zr;++Un)Le[Un]=Kn;Nr=zr-1}}for(var $r=0,Fn=Ce;$r<Pe;++$r){var vn=Le[$r];Fn=="L"&&vn=="1"?Le[$r]="L":S.test(vn)&&(Fn=vn)}for(var sn=0;sn<Pe;++sn)if(i.test(Le[sn])){var en=void 0;for(en=sn+1;en<Pe&&i.test(Le[en]);++en);for(var Yr=(sn?Le[sn-1]:Ce)=="L",jn=(en<Pe?Le[en]:Ce)=="L",Na=Yr==jn?Yr?"L":"R":Ce,ra=sn;ra<en;++ra)Le[ra]=Na;sn=en-1}for(var Sn=[],wi,fn=0;fn<Pe;)if(N.test(Le[fn])){var ps=fn;for(++fn;fn<Pe&&N.test(Le[fn]);++fn);Sn.push(new J(0,ps,fn))}else{var Wi=fn,pa=Sn.length,ma=ye=="rtl"?1:0;for(++fn;fn<Pe&&Le[fn]!="L";++fn);for(var kn=Wi;kn<fn;)if(Q.test(Le[kn])){Wi<kn&&(Sn.splice(pa,0,new J(1,Wi,kn)),pa+=ma);var Ba=kn;for(++kn;kn<fn&&Q.test(Le[kn]);++kn);Sn.splice(pa,0,new J(2,Ba,kn)),pa+=ma,Wi=kn}else++kn;Wi<fn&&Sn.splice(pa,0,new J(1,Wi,fn))}return ye=="ltr"&&(Sn[0].level==1&&(wi=re.match(/^\s+/))&&(Sn[0].from=wi[0].length,Sn.unshift(new J(0,0,wi[0].length))),R(Sn).level==1&&(wi=re.match(/\s+$/))&&(R(Sn).to-=wi[0].length,Sn.push(new J(0,Pe-wi[0].length,Pe)))),ye=="rtl"?Sn.reverse():Sn}}();function lt(e,t){var n=e.order;return n==null&&(n=e.order=ft(e.text,t)),n}var Ye=[],Ne=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||Ye).concat(n)}};function ht(e,t){return e._handlers&&e._handlers[t]||Ye}function qe(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 S=Se(i,n);S>-1&&(r[t]=i.slice(0,S).concat(i.slice(S+1)))}}}function le(e,t){var n=ht(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 Z(e,t,n){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),le(e,n||t.type,e,t),ce(t)||t.codemirrorIgnore}function q(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)Se(n,t[r])==-1&&n.push(t[r])}function ne(e,t){return ht(e,t).length>0}function ue(e){e.prototype.on=function(t,n){Ne(this,t,n)},e.prototype.off=function(t,n){qe(this,t,n)}}function ee(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ie(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function ce(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function pe(e){ee(e),ie(e)}function xe(e){return e.target||e.srcElement}function De(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(W&&U<9)return!1;var e=o("div");return"draggable"in e||"dragDrop"in e}(),$e;function pt(e){if($e==null){var t=o("span","\u200B");c(e,o("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&($e=t.offsetWidth<=1&&t.offsetHeight>2&&!(W&&U<8))}var n=$e?o("span","\u200B"):o("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}var xt;function Ft(e){if(xt!=null)return xt;var t=c(e,document.createTextNode("A\u062EA")),n=g(t,0,1).getBoundingClientRect(),r=g(t,1,2).getBoundingClientRect();return p(e),!n||n.left==n.right?!1:xt=r.right-n.right<3}var Ct=`
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 S=e.slice(t,e.charAt(i-1)=="\r"?i-1:i),N=S.indexOf("\r");N!=-1?(n.push(S.slice(0,N)),t+=N+1):(n.push(S),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},ot=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},Ut=function(){var e=o("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Rt=null;function _t(e){if(Rt!=null)return Rt;var t=c(e,o("span","x")),n=t.getBoundingClientRect(),r=g(t,0,1).getBoundingClientRect();return Rt=Math.abs(n.left-r.left)>1}var Vt={},bt={};function cr(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Vt[e]=t}function Gt(e,t){bt[e]=t}function Tt(e){if(typeof e=="string"&&bt.hasOwnProperty(e))e=bt[e];else if(e&&typeof e.name=="string"&&bt.hasOwnProperty(e.name)){var t=bt[e.name];typeof t=="string"&&(t={name:t}),e=B(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Tt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Tt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function qt(e,t){t=Tt(t);var n=Vt[t.name];if(!n)return qt(e,"text/plain");var r=n(e,t);if(nt.hasOwnProperty(t.name)){var i=nt[t.name];for(var S in i){if(!i.hasOwnProperty(S))continue;r.hasOwnProperty(S)&&(r["_"+S]=r[S]),r[S]=i[S]}}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var N in t.modeProps)r[N]=t.modeProps[N];return r}var nt={};function Or(e,t){var n=nt.hasOwnProperty(e)?nt[e]:nt[e]={};j(t,n)}function ur(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 Ar(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 ln(e,t,n){return e.startState?e.startState(t,n):!0}var Mr=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};Mr.prototype.eol=function(){return this.pos>=this.string.length},Mr.prototype.sol=function(){return this.pos==this.lineStart},Mr.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Mr.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Mr.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},Mr.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Mr.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Mr.prototype.skipToEnd=function(){this.pos=this.string.length},Mr.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Mr.prototype.backUp=function(e){this.pos-=e},Mr.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=se(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?se(this.string,this.lineStart,this.tabSize):0)},Mr.prototype.indentation=function(){return se(this.string,null,this.tabSize)-(this.lineStart?se(this.string,this.lineStart,this.tabSize):0)},Mr.prototype.match=function(e,t,n){if(typeof e=="string"){var r=function(N){return n?N.toLowerCase():N},i=this.string.substr(this.pos,e.length);if(r(i)==r(e))return t!==!1&&(this.pos+=e.length),!0}else{var S=this.string.slice(this.pos).match(e);return S&&S.index>0?null:(S&&t!==!1&&(this.pos+=S[0].length),S)}},Mr.prototype.current=function(){return this.string.slice(this.start,this.pos)},Mr.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Mr.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Mr.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function Et(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],S=i.chunkSize();if(t<S){n=i;break}t-=S}return n.lines[t]}function sr(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,function(S){var N=S.text;i==n.line&&(N=N.slice(0,n.ch)),i==t.line&&(N=N.slice(t.ch)),r.push(N),++i}),r}function Gr(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 Ht(e){if(e.parent==null)return null;for(var t=e.parent,n=Se(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 vr(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],S=i.height;if(t<S){e=i;continue e}t-=S,n+=i.chunkSize()}return n}while(!e.lines);for(var N=0;N<e.lines.length;++N){var Q=e.lines[N],J=Q.height;if(t<J)break;t-=J}return n+N}function pn(e,t){return t>=e.first&&t<e.first+e.size}function Br(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function tt(e,t,n){if(n===void 0&&(n=null),!(this instanceof tt))return new tt(e,t,n);this.line=e,this.ch=t,this.sticky=n}function Ot(e,t){return e.line-t.line||e.ch-t.ch}function Ln(e,t){return e.sticky==t.sticky&&Ot(e,t)==0}function ri(e){return tt(e.line,e.ch)}function hi(e,t){return Ot(e,t)<0?t:e}function zn(e,t){return Ot(e,t)<0?e:t}function fi(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function jt(e,t){if(t.line<e.first)return tt(e.first,0);var n=e.first+e.size-1;return t.line>n?tt(n,Et(e,n).text.length):Hi(t,Et(e,t.line).text.length)}function Hi(e,t){var n=e.ch;return n==null||n>t?tt(e.line,t):n<0?tt(e.line,0):e}function st(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=jt(e,t[r]);return n}var yn=function(e,t){this.state=e,this.lookAhead=t},bn=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};bn.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},bn.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}},bn.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},bn.fromSaved=function(e,t,n){return t instanceof yn?new bn(e,ur(e.mode,t.state),n,t.lookAhead):new bn(e,ur(e.mode,t),n)},bn.prototype.save=function(e){var t=e!==!1?ur(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new yn(t,this.maxLookAhead):t};function Di(e,t,n,r){var i=[e.state.modeGen],S={};Pn(e,t.text,e.doc.mode,n,function(re,ye){return i.push(re,ye)},S,r);for(var N=n.state,Q=function(re){n.baseTokens=i;var ye=e.state.overlays[re],Ce=1,Pe=0;n.state=!0,Pn(e,t.text,ye.mode,n,function(Le,Ve){for(var et=Ce;Pe<Le;){var ut=i[Ce];ut>Le&&i.splice(Ce,1,Le,i[Ce+1],ut),Ce+=2,Pe=Math.min(Le,ut)}if(!Ve)return;if(ye.opaque)i.splice(et,Ce-et,Le,"overlay "+Ve),Ce=et+2;else for(;et<Ce;et+=2){var vt=i[et+1];i[et+1]=(vt?vt+" ":"")+"overlay "+Ve}},S),n.state=N,n.baseTokens=null,n.baseTokenPos=1},J=0;J<e.state.overlays.length;++J)Q(J);return{styles:i,classes:S.bgClass||S.textClass?S:null}}function ni(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=In(e,Ht(t)),i=t.text.length>e.options.maxHighlightLength&&ur(e.doc.mode,r.state),S=Di(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=S.styles,S.classes?t.styleClasses=S.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 In(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new bn(r,!0,t);var S=ki(e,t,n),N=S>r.first&&Et(r,S-1).stateAfter,Q=N?bn.fromSaved(r,N,S):new bn(r,ln(r.mode),S);return r.iter(S,t,function(J){pi(e,J.text,Q);var re=Q.line;J.stateAfter=re==t-1||re%5==0||re>=i.viewFrom&&re<i.viewTo?Q.save():null,Q.nextLine()}),n&&(r.modeFrontier=Q.line),Q}function pi(e,t,n,r){var i=e.doc.mode,S=new Mr(t,e.options.tabSize,n);for(S.start=S.pos=r||0,t==""&&Ri(i,n.state);!S.eol();)An(i,S,n.state),S.start=S.pos}function Ri(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var n=Ar(e,t);if(n.mode.blankLine)return n.mode.blankLine(n.state)}function An(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=Ar(e,n).mode);var S=e.token(t,n);if(t.pos>t.start)return S}throw new Error("Mode "+e.name+" failed to advance stream.")}var Oi=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function Mi(e,t,n,r){var i=e.doc,S=i.mode,N;t=jt(i,t);var Q=Et(i,t.line),J=In(e,t.line,n),re=new Mr(Q.text,e.options.tabSize,J),ye;for(r&&(ye=[]);(r||re.pos<t.ch)&&!re.eol();)re.start=re.pos,N=An(S,re,J.state),r&&ye.push(new Oi(re,N,ur(i.mode,J.state)));return r?ye:new Oi(re,N,J.state)}function mi(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 Pn(e,t,n,r,i,S,N){var Q=n.flattenSpans;Q==null&&(Q=e.options.flattenSpans);var J=0,re=null,ye=new Mr(t,e.options.tabSize,r),Ce,Pe=e.options.addModeClass&&[null];for(t==""&&mi(Ri(n,r.state),S);!ye.eol();){if(ye.pos>e.options.maxHighlightLength?(Q=!1,N&&pi(e,t,r,ye.pos),ye.pos=t.length,Ce=null):Ce=mi(An(n,ye,r.state,Pe),S),Pe){var Le=Pe[0].name;Le&&(Ce="m-"+(Ce?Le+" "+Ce:Le))}if(!Q||re!=Ce){for(;J<ye.start;)J=Math.min(ye.start,J+5e3),i(J,re);re=Ce}ye.start=ye.pos}for(;J<ye.pos;){var Ve=Math.min(ye.pos,J+5e3);i(Ve,re),J=Ve}}function ki(e,t,n){for(var r,i,S=e.doc,N=n?-1:t-(e.doc.mode.innerMode?1e3:100),Q=t;Q>N;--Q){if(Q<=S.first)return S.first;var J=Et(S,Q-1),re=J.stateAfter;if(re&&(!n||Q+(re instanceof yn?re.lookAhead:0)<=S.modeFrontier))return Q;var ye=se(J.text,null,e.options.tabSize);(i==null||r>ye)&&(i=Q-1,r=ye)}return i}function na(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=Et(e,r).stateAfter;if(i&&(!(i instanceof yn)||r+i.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}var Er=!1,Mt=!1;function Wt(){Er=!0}function nr(){Mt=!0}function yr(e,t,n){this.marker=e,this.from=t,this.to=n}function Jt(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function Zn(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function un(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function Ki(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var S=e[i],N=S.marker,Q=S.from==null||(N.inclusiveLeft?S.from<=t:S.from<t);if(Q||S.from==t&&N.type=="bookmark"&&(!n||!S.marker.insertLeft)){var J=S.to==null||(N.inclusiveRight?S.to>=t:S.to>t);(r||(r=[])).push(new yr(N,S.from,J?null:S.to))}}return r}function ia(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var S=e[i],N=S.marker,Q=S.to==null||(N.inclusiveRight?S.to>=t:S.to>t);if(Q||S.from==t&&N.type=="bookmark"&&(!n||S.marker.insertLeft)){var J=S.from==null||(N.inclusiveLeft?S.from<=t:S.from<t);(r||(r=[])).push(new yr(N,J?null:S.from-t,S.to==null?null:S.to-t))}}return r}function Gn(e,t){if(t.full)return null;var n=pn(e,t.from.line)&&Et(e,t.from.line).markedSpans,r=pn(e,t.to.line)&&Et(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,S=t.to.ch,N=Ot(t.from,t.to)==0,Q=Ki(n,i,N),J=ia(r,S,N),re=t.text.length==1,ye=R(t.text).length+(re?i:0);if(Q)for(var Ce=0;Ce<Q.length;++Ce){var Pe=Q[Ce];if(Pe.to==null){var Le=Jt(J,Pe.marker);Le?re&&(Pe.to=Le.to==null?null:Le.to+ye):Pe.to=i}}if(J)for(var Ve=0;Ve<J.length;++Ve){var et=J[Ve];if(et.to!=null&&(et.to+=ye),et.from==null){var ut=Jt(Q,et.marker);ut||(et.from=ye,re&&(Q||(Q=[])).push(et))}else et.from+=ye,re&&(Q||(Q=[])).push(et)}Q&&(Q=En(Q)),J&&J!=Q&&(J=En(J));var vt=[Q];if(!re){var St=t.text.length-2,yt;if(St>0&&Q)for(var At=0;At<Q.length;++At)Q[At].to==null&&(yt||(yt=[])).push(new yr(Q[At].marker,null,null));for(var Bt=0;Bt<St;++Bt)vt.push(yt);vt.push(J)}return vt}function En(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 dn(e,t,n){var r=null;if(e.iter(t.line,n.line+1,function(Le){if(Le.markedSpans)for(var Ve=0;Ve<Le.markedSpans.length;++Ve){var et=Le.markedSpans[Ve].marker;et.readOnly&&(!r||Se(r,et)==-1)&&(r||(r=[])).push(et)}}),!r)return null;for(var i=[{from:t,to:n}],S=0;S<r.length;++S)for(var N=r[S],Q=N.find(0),J=0;J<i.length;++J){var re=i[J];if(Ot(re.to,Q.from)<0||Ot(re.from,Q.to)>0)continue;var ye=[J,1],Ce=Ot(re.from,Q.from),Pe=Ot(re.to,Q.to);(Ce<0||!N.inclusiveLeft&&!Ce)&&ye.push({from:re.from,to:Q.from}),(Pe>0||!N.inclusiveRight&&!Pe)&&ye.push({from:Q.to,to:re.to}),i.splice.apply(i,ye),J+=ye.length-3}return i}function gi(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 ii(e,t){if(!t)return;for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}function vi(e){return e.inclusiveLeft?-1:0}function Li(e){return e.inclusiveRight?1:0}function qn(e,t){var n=e.lines.length-t.lines.length;if(n!=0)return n;var r=e.find(),i=t.find(),S=Ot(r.from,i.from)||vi(e)-vi(t);if(S)return-S;var N=Ot(r.to,i.to)||Li(e)-Li(t);return N||t.id-e.id}function $n(e,t){var n=Mt&&e.markedSpans,r;if(n)for(var i=void 0,S=0;S<n.length;++S)i=n[S],i.marker.collapsed&&(t?i.from:i.to)==null&&(!r||qn(r,i.marker)<0)&&(r=i.marker);return r}function ei(e){return $n(e,!0)}function ai(e){return $n(e,!1)}function Ii(e,t){var n=Mt&&e.markedSpans,r;if(n)for(var i=0;i<n.length;++i){var S=n[i];S.marker.collapsed&&(S.from==null||S.from<t)&&(S.to==null||S.to>t)&&(!r||qn(r,S.marker)<0)&&(r=S.marker)}return r}function ga(e,t,n,r,i){var S=Et(e,t),N=Mt&&S.markedSpans;if(N)for(var Q=0;Q<N.length;++Q){var J=N[Q];if(!J.marker.collapsed)continue;var re=J.marker.find(0),ye=Ot(re.from,n)||vi(J.marker)-vi(i),Ce=Ot(re.to,r)||Li(J.marker)-Li(i);if(ye>=0&&Ce<=0||ye<=0&&Ce>=0)continue;if(ye<=0&&(J.marker.inclusiveRight&&i.inclusiveLeft?Ot(re.to,n)>=0:Ot(re.to,n)>0)||ye>=0&&(J.marker.inclusiveRight&&i.inclusiveLeft?Ot(re.from,r)<=0:Ot(re.from,r)<0))return!0}}function Tn(e){for(var t;t=ei(e);)e=t.find(-1,!0).line;return e}function va(e){for(var t;t=ai(e);)e=t.find(1,!0).line;return e}function zi(e){for(var t,n;t=ai(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function yi(e,t){var n=Et(e,t),r=Tn(n);return n==r?t:Ht(r)}function _n(e,t){if(t>e.lastLine())return t;var n=Et(e,t),r;if(!Nn(e,n))return t;for(;r=ai(n);)n=r.find(1,!0).line;return Ht(n)+1}function Nn(e,t){var n=Mt&&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&&aa(e,t,r))return!0}}function aa(e,t,n){if(n.to==null){var r=n.marker.find(1,!0);return aa(e,r.line,Jt(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i=void 0,S=0;S<t.markedSpans.length;++S)if(i=t.markedSpans[S],i.marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(i.to==null||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&aa(e,t,i))return!0}function Wn(e){e=Tn(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 S=n.parent;S;n=S,S=n.parent)for(var N=0;N<S.children.length;++N){var Q=S.children[N];if(Q==n)break;t+=Q.height}return t}function oa(e){if(e.height==0)return 0;for(var t=e.text.length,n,r=e;n=ei(r);){var i=n.find(0,!0);r=i.from.line,t+=i.from.ch-i.to.ch}for(r=e;n=ai(r);){var S=n.find(0,!0);t-=r.text.length-S.from.ch,r=S.to.line,t+=r.text.length-S.to.ch}return t}function sa(e){var t=e.display,n=e.doc;t.maxLine=Et(n,n.first),t.maxLineLength=oa(t.maxLine),t.maxLineChanged=!0,n.iter(function(r){var i=oa(r);i>t.maxLineLength&&(t.maxLineLength=i,t.maxLine=r)})}var Pi=function(e,t,n){this.text=e,ii(this,t),this.height=n?n(this):1};Pi.prototype.lineNo=function(){return Ht(this)},ue(Pi);function Ua(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),gi(e),ii(e,n);var i=r?r(e):1;i!=e.height&&zt(e,i)}function Dt(e){e.parent=null,gi(e)}var Kt={},kt={};function tr(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?kt:Kt;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function mr(e,t){var n=x("span",null,null,P?"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 S=i?t.rest[i-1]:t.line,N=void 0;r.pos=0,r.addToken=hr,Ft(e.display.measure)&&(N=lt(S,e.doc.direction))&&(r.addToken=wn(r.addToken,N)),r.map=[];var Q=t!=e.display.externalMeasured&&Ht(S);oi(S,r,ni(e,S,Q)),S.styleClasses&&(S.styleClasses.bgClass&&(r.bgClass=Y(S.styleClasses.bgClass,r.bgClass||"")),S.styleClasses.textClass&&(r.textClass=Y(S.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(pt(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(P){var J=r.content.lastChild;(/\bcm-tab\b/.test(J.className)||J.querySelector&&J.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return le(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=Y(r.pre.className,r.textClass||"")),r}function Tr(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 hr(e,t,n,r,i,S,N){if(!t)return;var Q=e.splitSpaces?Vr(t,e.trailingSpace):t,J=e.cm.state.specialChars,re=!1,ye;if(!J.test(t))e.col+=t.length,ye=document.createTextNode(Q),e.map.push(e.pos,e.pos+t.length,ye),W&&U<9&&(re=!0),e.pos+=t.length;else{ye=document.createDocumentFragment();for(var Ce=0;;){J.lastIndex=Ce;var Pe=J.exec(t),Le=Pe?Pe.index-Ce:t.length-Ce;if(Le){var Ve=document.createTextNode(Q.slice(Ce,Ce+Le));W&&U<9?ye.appendChild(o("span",[Ve])):ye.appendChild(Ve),e.map.push(e.pos,e.pos+Le,Ve),e.col+=Le,e.pos+=Le}if(!Pe)break;Ce+=Le+1;var et=void 0;if(Pe[0]==" "){var ut=e.cm.options.tabSize,vt=ut-e.col%ut;et=ye.appendChild(o("span",F(vt),"cm-tab")),et.setAttribute("role","presentation"),et.setAttribute("cm-text"," "),e.col+=vt}else Pe[0]=="\r"||Pe[0]==`
`?(et=ye.appendChild(o("span",Pe[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),et.setAttribute("cm-text",Pe[0]),e.col+=1):(et=e.cm.options.specialCharPlaceholder(Pe[0]),et.setAttribute("cm-text",Pe[0]),W&&U<9?ye.appendChild(o("span",[et])):ye.appendChild(et),e.col+=1);e.map.push(e.pos,e.pos+1,et),e.pos++}}if(e.trailingSpace=Q.charCodeAt(t.length-1)==32,n||r||i||re||S||N){var St=n||"";r&&(St+=r),i&&(St+=i);var yt=o("span",[ye],St,S);if(N)for(var At in N)N.hasOwnProperty(At)&&At!="style"&&At!="class"&&yt.setAttribute(At,N[At]);return e.content.appendChild(yt)}e.content.appendChild(ye)}function Vr(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;i<e.length;i++){var S=e.charAt(i);S==" "&&n&&(i==e.length-1||e.charCodeAt(i+1)==32)&&(S="\xA0"),r+=S,n=S==" "}return r}function wn(e,t){return function(n,r,i,S,N,Q,J){i=i?i+" cm-force-border":"cm-force-border";for(var re=n.pos,ye=re+r.length;;){for(var Ce=void 0,Pe=0;Pe<t.length&&!(Ce=t[Pe],Ce.to>re&&Ce.from<=re);Pe++);if(Ce.to>=ye)return e(n,r,i,S,N,Q,J);e(n,r.slice(0,Ce.to-re),i,S,null,Q,J),S=null,r=r.slice(Ce.to-re),re=Ce.to}}}function ir(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 oi(e,t,n){var r=e.markedSpans,i=e.text,S=0;if(!r){for(var N=1;N<n.length;N+=2)t.addToken(t,i.slice(S,S=n[N]),tr(n[N+1],t.cm.options));return}for(var Q=i.length,J=0,re=1,ye="",Ce,Pe,Le=0,Ve,et,ut,vt,St;;){if(Le==J){Ve=et=ut=Pe="",St=null,vt=null,Le=Infinity;for(var yt=[],At=void 0,Bt=0;Bt<r.length;++Bt){var It=r[Bt],rr=It.marker;if(rr.type=="bookmark"&&It.from==J&&rr.widgetNode)yt.push(rr);else if(It.from<=J&&(It.to==null||It.to>J||rr.collapsed&&It.to==J&&It.from==J)){if(It.to!=null&&It.to!=J&&Le>It.to&&(Le=It.to,et=""),rr.className&&(Ve+=" "+rr.className),rr.css&&(Pe=(Pe?Pe+";":"")+rr.css),rr.startStyle&&It.from==J&&(ut+=" "+rr.startStyle),rr.endStyle&&It.to==Le&&(At||(At=[])).push(rr.endStyle,It.to),rr.title&&((St||(St={})).title=rr.title),rr.attributes)for(var Nr in rr.attributes)(St||(St={}))[Nr]=rr.attributes[Nr];rr.collapsed&&(!vt||qn(vt.marker,rr)<0)&&(vt=It)}else It.from>J&&Le>It.from&&(Le=It.from)}if(At)for(var hn=0;hn<At.length;hn+=2)At[hn+1]==Le&&(et+=" "+At[hn]);if(!vt||vt.from==J)for(var zr=0;zr<yt.length;++zr)ir(t,0,yt[zr]);if(vt&&(vt.from||0)==J){if(ir(t,(vt.to==null?Q+1:vt.to)-J,vt.marker,vt.from==null),vt.to==null)return;vt.to==J&&(vt=!1)}}if(J>=Q)break;for(var Kn=Math.min(Q,Le);;){if(ye){var Un=J+ye.length;if(!vt){var $r=Un>Kn?ye.slice(0,Kn-J):ye;t.addToken(t,$r,Ce?Ce+Ve:Ve,ut,J+$r.length==Le?et:"",Pe,St)}if(Un>=Kn){ye=ye.slice(Kn-J),J=Kn;break}J=Un,ut=""}ye=i.slice(S,S=n[re++]),Ce=tr(n[re++],t.cm.options)}}}function xr(e,t,n){this.line=t,this.rest=zi(t),this.size=this.rest?Ht(R(this.rest))-n+1:1,this.node=this.text=null,this.hidden=Nn(e,t)}function mn(e,t,n){for(var r=[],i,S=t;S<n;S=i){var N=new xr(e.doc,Et(e.doc,S),S);i=S+N.size,r.push(N)}return r}var cn=null;function Hn(e){cn?cn.ops.push(e):e.ownsGroup=cn={ops:[e],delayedCallbacks:[]}}function Fa(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 Ko(e,t){var n=e.ownsGroup;if(!n)return;try{Fa(n)}finally{cn=null,t(n)}}var Gi=null;function Qr(e,t){var n=ht(e,t);if(!n.length)return;var r=Array.prototype.slice.call(arguments,2),i;cn?i=cn.delayedCallbacks:Gi?i=Gi:(i=Gi=[],setTimeout(go,0));for(var S=function(Q){i.push(function(){return n[Q].apply(null,r)})},N=0;N<n.length;++N)S(N)}function go(){var e=Gi;Gi=null;for(var t=0;t<e.length;++t)e[t]()}function vo(e,t,n,r){for(var i=0;i<t.changes.length;i++){var S=t.changes[i];S=="text"?yo(e,t):S=="gutter"?Ha(e,t,n,r):S=="class"?Wa(e,t):S=="widget"&&Go(e,t,r)}t.changes=null}function la(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),W&&U<8&&(e.node.style.zIndex=2)),e.node}function zo(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=la(t);t.background=r.insertBefore(o("div",null,n),r.firstChild),e.display.input.setUneditable(t.background)}}function ja(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):mr(e,t)}function yo(e,t){var n=t.text.className,r=ja(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,Wa(e,t)):n&&(t.text.className=n)}function Wa(e,t){zo(e,t),t.line.wrapClass?la(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 Ha(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=la(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 S=t.line.gutterMarkers;if(e.options.lineNumbers||S){var N=la(t),Q=t.gutter=o("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(e.display.input.setUneditable(Q),N.insertBefore(Q,t.text),t.line.gutterClass&&(Q.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!S||!S["CodeMirror-linenumbers"])&&(t.lineNumber=Q.appendChild(o("div",Br(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),S)for(var J=0;J<e.display.gutterSpecs.length;++J){var re=e.display.gutterSpecs[J].className,ye=S.hasOwnProperty(re)&&S[re];ye&&Q.appendChild(o("div",[ye],"CodeMirror-gutter-elt","left: "+r.gutterLeft[re]+"px; width: "+r.gutterWidth[re]+"px"))}}}function Go(e,t,n){t.alignable&&(t.alignable=null);for(var r=v("CodeMirror-linewidget"),i=t.node.firstChild,S=void 0;i;i=S)S=i.nextSibling,r.test(i.className)&&t.node.removeChild(i);Ka(e,t,n)}function bo(e,t,n,r){var i=ja(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),Wa(e,t),Ha(e,t,n,r),Ka(e,t,r),t.node}function Ka(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 S=la(n),N=0,Q=t.widgets;N<Q.length;++N){var J=Q[N],re=o("div",[J.node],"CodeMirror-linewidget"+(J.className?" "+J.className:""));J.handleMouseEvents||re.setAttribute("cm-ignore-events","true"),Vo(J,re,n,r),e.display.input.setUneditable(re),i&&J.above?S.insertBefore(re,n.gutter||n.text):S.appendChild(re),Qr(J,"redraw")}}function Vo(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 Vi(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!C(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;"),c(t.display.measure,o("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function si(e,t){for(var n=xe(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 za(e){return e.lineSpace.offsetTop}function me(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Ae(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=c(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 Re(e){return ke-e.display.nativeBarWidth}function ve(e){return e.display.scroller.clientWidth-Re(e)-e.display.barWidth}function te(e){return e.display.scroller.clientHeight-Re(e)-e.display.barHeight}function he(e,t,n){var r=e.options.lineWrapping,i=r&&ve(e);if(!t.measure.heights||r&&t.measure.width!=i){var S=t.measure.heights=[];if(r){t.measure.width=i;for(var N=t.text.firstChild.getClientRects(),Q=0;Q<N.length-1;Q++){var J=N[Q],re=N[Q+1];Math.abs(J.bottom-re.bottom)>2&&S.push((J.bottom+re.top)/2-n.top)}}S.push(n.bottom-n.top)}}function ae(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(Ht(e.rest[i])>n)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function be(e,t){t=Tn(t);var n=Ht(t),r=e.display.externalMeasured=new xr(e.doc,t,n);r.lineN=n;var i=r.built=mr(e,r);return r.text=i.pre,c(e.display.lineMeasure,i.pre),r}function Ee(e,t,n,r){return Ie(e,Te(e,t),n,r)}function Me(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[_r(e,t)];var n=e.display.externalMeasured;if(n&&t>=n.lineN&&t<n.lineN+n.size)return n}function Te(e,t){var n=Ht(t),r=Me(e,n);r&&!r.text?r=null:r&&r.changes&&(vo(e,r,n,Wr(e)),e.curOp.forceUpdate=!0),r||(r=be(e,t));var i=ae(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function Ie(e,t,n,r,i){t.before&&(n=-1);var S=n+(r||""),N;return t.cache.hasOwnProperty(S)?N=t.cache[S]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(he(e,t.view,t.rect),t.hasHeights=!0),N=mt(e,t,n,r),N.bogus||(t.cache[S]=N)),{left:N.left,right:N.right,top:i?N.rtop:N.top,bottom:i?N.rbottom:N.bottom}}var Ke={left:0,right:0,top:0,bottom:0};function it(e,t,n){for(var r,i,S,N,Q,J,re=0;re<e.length;re+=3)if(Q=e[re],J=e[re+1],t<Q?(i=0,S=1,N="left"):t<J?(i=t-Q,S=i+1):(re==e.length-3||t==J&&e[re+3]>t)&&(S=J-Q,i=S-1,t>=J&&(N="right")),i!=null){if(r=e[re+2],Q==J&&n==(r.insertLeft?"left":"right")&&(N=n),n=="left"&&i==0)for(;re&&e[re-2]==e[re-3]&&e[re-1].insertLeft;)r=e[(re-=3)+2],N="left";if(n=="right"&&i==J-Q)for(;re<e.length-3&&e[re+3]==e[re+4]&&!e[re+5].insertLeft;)r=e[(re+=3)+2],N="right";break}return{node:r,start:i,end:S,collapse:N,coverStart:Q,coverEnd:J}}function rt(e,t){var n=Ke;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 mt(e,t,n,r){var i=it(t.map,n,r),S=i.node,N=i.start,Q=i.end,J=i.collapse,re;if(S.nodeType==3){for(var ye=0;ye<4;ye++){for(;N&&ze(t.line.text.charAt(i.coverStart+N));)--N;for(;i.coverStart+Q<i.coverEnd&&ze(t.line.text.charAt(i.coverStart+Q));)++Q;if(W&&U<9&&N==0&&Q==i.coverEnd-i.coverStart?re=S.parentNode.getBoundingClientRect():re=rt(g(S,N,Q).getClientRects(),r),re.left||re.right||N==0)break;Q=N,N=N-1,J="right"}W&&U<11&&(re=Nt(e.display.measure,re))}else{N>0&&(J=r="right");var Ce;e.options.lineWrapping&&(Ce=S.getClientRects()).length>1?re=Ce[r=="right"?Ce.length-1:0]:re=S.getBoundingClientRect()}if(W&&U<9&&!N&&(!re||!re.left&&!re.right)){var Pe=S.parentNode.getClientRects()[0];Pe?re={left:Pe.left,right:Pe.left+tn(e.display),top:Pe.top,bottom:Pe.bottom}:re=Ke}for(var Le=re.top-t.rect.top,Ve=re.bottom-t.rect.top,et=(Le+Ve)/2,ut=t.view.measure.heights,vt=0;vt<ut.length-1&&!(et<ut[vt]);vt++);var St=vt?ut[vt-1]:0,yt=ut[vt],At={left:(J=="right"?re.right:re.left)-t.rect.left,right:(J=="left"?re.left:re.right)-t.rect.left,top:St,bottom:yt};return!re.left&&!re.right&&(At.bogus=!0),e.options.singleCursorHeightPerLine||(At.rtop=Le,At.rbottom=Ve),At}function Nt(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!_t(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 $t(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 Qt(e){e.display.externalMeasure=null,p(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)$t(e.display.view[t])}function Xt(e){Qt(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function er(){return b&&u?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Zt(){return b&&u?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Yt(e){var t=0;if(e.widgets)for(var n=0;n<e.widgets.length;++n)e.widgets[n].above&&(t+=Vi(e.widgets[n]));return t}function fr(e,t,n,r,i){if(!i){var S=Yt(t);n.top+=S,n.bottom+=S}if(r=="line")return n;r||(r="local");var N=Wn(t);if(r=="local"?N+=za(e.display):N-=e.display.viewOffset,r=="page"||r=="window"){var Q=e.display.lineSpace.getBoundingClientRect();N+=Q.top+(r=="window"?0:Zt());var J=Q.left+(r=="window"?0:er());n.left+=J,n.right+=J}return n.top+=N,n.bottom+=N,n}function ar(e,t,n){if(n=="div")return t;var r=t.left,i=t.top;if(n=="page")r-=er(),i-=Zt();else if(n=="local"||!n){var S=e.display.sizer.getBoundingClientRect();r+=S.left,i+=S.top}var N=e.display.lineSpace.getBoundingClientRect();return{left:r-N.left,top:i-N.top}}function Ur(e,t,n,r,i){return r||(r=Et(e.doc,t.line)),fr(e,r,Ee(e,r,t.ch,i),n)}function or(e,t,n,r,i,S){r=r||Et(e.doc,t.line),i||(i=Te(e,r));function N(Ve,et){var ut=Ie(e,i,Ve,et?"right":"left",S);return et?ut.left=ut.right:ut.right=ut.left,fr(e,r,ut,n)}var Q=lt(r,e.doc.direction),J=t.ch,re=t.sticky;if(J>=r.text.length?(J=r.text.length,re="before"):J<=0&&(J=0,re="after"),!Q)return N(re=="before"?J-1:J,re=="before");function ye(Ve,et,ut){var vt=Q[et],St=vt.level==1;return N(ut?Ve-1:Ve,St!=ut)}var Ce=at(Q,J,re),Pe=gt,Le=ye(J,Ce,re=="before");return Pe!=null&&(Le.other=ye(J,Pe,re!="before")),Le}function Pt(e,t){var n=0;t=jt(e.doc,t),e.options.lineWrapping||(n=tn(e.display)*t.ch);var r=Et(e.doc,t.line),i=Wn(r)+za(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Lt(e,t,n,r,i){var S=tt(e,t,n);return S.xRel=i,r&&(S.outside=r),S}function lr(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,n<0)return Lt(r.first,0,null,-1,-1);var i=vr(r,n),S=r.first+r.size-1;if(i>S)return Lt(r.first+r.size-1,Et(r,S).text.length,null,1,1);t<0&&(t=0);for(var N=Et(r,i);;){var Q=Fr(e,N,i,t,n),J=Ii(N,Q.ch+(Q.xRel>0||Q.outside>0?1:0));if(!J)return Q;var re=J.find(1);if(re.line==i)return re;N=Et(r,i=re.line)}}function pr(e,t,n,r){r-=Yt(t);var i=t.text.length,S=dt(function(N){return Ie(e,n,N-1).bottom<=r},i,0);return i=dt(function(N){return Ie(e,n,N).top>r},S,i),{begin:S,end:i}}function wt(e,t,n,r){n||(n=Te(e,t));var i=fr(e,t,Ie(e,n,r),"line").top;return pr(e,t,n,i)}function gr(e,t,n,r){return e.bottom<=n?!1:e.top>n?!0:(r?e.left:e.right)>t}function Fr(e,t,n,r,i){i-=Wn(t);var S=Te(e,t),N=Yt(t),Q=0,J=t.text.length,re=!0,ye=lt(t,e.doc.direction);if(ye){var Ce=(e.options.lineWrapping?kr:br)(e,t,n,S,ye,r,i);re=Ce.level!=1,Q=re?Ce.from:Ce.to-1,J=re?Ce.to:Ce.from-1}var Pe=null,Le=null,Ve=dt(function(Bt){var It=Ie(e,S,Bt);return It.top+=N,It.bottom+=N,gr(It,r,i,!1)?(It.top<=i&&It.left<=r&&(Pe=Bt,Le=It),!0):!1},Q,J),et,ut,vt=!1;if(Le){var St=r-Le.left<Le.right-r,yt=St==re;Ve=Pe+(yt?0:1),ut=yt?"after":"before",et=St?Le.left:Le.right}else{!re&&(Ve==J||Ve==Q)&&Ve++,ut=Ve==0?"after":Ve==t.text.length?"before":Ie(e,S,Ve-(re?1:0)).bottom+N<=i==re?"after":"before";var At=or(e,tt(n,Ve,ut),"line",t,S);et=At.left,vt=i<At.top?-1:i>=At.bottom?1:0}return Ve=Xe(t.text,Ve,1),Lt(n,Ve,ut,vt,r-et)}function br(e,t,n,r,i,S,N){var Q=dt(function(Ce){var Pe=i[Ce],Le=Pe.level!=1;return gr(or(e,tt(n,Le?Pe.to:Pe.from,Le?"before":"after"),"line",t,r),S,N,!0)},0,i.length-1),J=i[Q];if(Q>0){var re=J.level!=1,ye=or(e,tt(n,re?J.from:J.to,re?"after":"before"),"line",t,r);gr(ye,S,N,!0)&&ye.top>N&&(J=i[Q-1])}return J}function kr(e,t,n,r,i,S,N){var Q=pr(e,t,r,N),J=Q.begin,re=Q.end;/\s/.test(t.text.charAt(re-1))&&re--;for(var ye=null,Ce=null,Pe=0;Pe<i.length;Pe++){var Le=i[Pe];if(Le.from>=re||Le.to<=J)continue;var Ve=Le.level!=1,et=Ie(e,r,Ve?Math.min(re,Le.to)-1:Math.max(J,Le.from)).right,ut=et<S?S-et+1e9:et-S;(!ye||Ce>ut)&&(ye=Le,Ce=ut)}return ye||(ye=i[i.length-1]),ye.from<J&&(ye={from:J,to:ye.to,level:ye.level}),ye.to>re&&(ye={from:ye.from,to:re,level:ye.level}),ye}var Dr;function Xr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Dr==null){Dr=o("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Dr.appendChild(document.createTextNode("x")),Dr.appendChild(o("br"));Dr.appendChild(document.createTextNode("x"))}c(e.measure,Dr);var n=Dr.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),p(e.measure),n||1}function tn(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=o("span","xxxxxxxxxx"),n=o("pre",[t],"CodeMirror-line-like");c(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function Wr(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,S=t.gutters.firstChild,N=0;S;S=S.nextSibling,++N){var Q=e.display.gutterSpecs[N].className;n[Q]=S.offsetLeft+S.clientLeft+i,r[Q]=S.clientWidth}return{fixedPos:xn(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function xn(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Vn(e){var t=Xr(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/tn(e.display)-3);return function(i){if(Nn(e.doc,i))return 0;var S=0;if(i.widgets)for(var N=0;N<i.widgets.length;N++)i.widgets[N].height&&(S+=i.widgets[N].height);return n?S+(Math.ceil(i.text.length/r)||1)*t:S+t}}function Dn(e){var t=e.doc,n=Vn(e);t.iter(function(r){var i=n(r);i!=r.height&&zt(r,i)})}function rn(e,t,n,r){var i=e.display;if(!n&&xe(t).getAttribute("cm-not-content")=="true")return null;var S,N,Q=i.lineSpace.getBoundingClientRect();try{S=t.clientX-Q.left,N=t.clientY-Q.top}catch(Ce){return null}var J=lr(e,S,N),re;if(r&&J.xRel>0&&(re=Et(e.doc,J.line).text).length==J.ch){var ye=se(re,re.length,e.options.tabSize)-re.length;J=tt(J.line,Math.max(0,Math.round((S-Ae(e.display).left)/tn(e.display))-ye))}return J}function _r(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 Lr(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)Mt&&yi(e.doc,t)<i.viewTo&&jr(e);else if(n<=i.viewFrom)Mt&&_n(e.doc,n+r)>i.viewFrom?jr(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)jr(e);else if(t<=i.viewFrom){var S=Qn(e,n,n+r,1);S?(i.view=i.view.slice(S.index),i.viewFrom=S.lineN,i.viewTo+=r):jr(e)}else if(n>=i.viewTo){var N=Qn(e,t,t,-1);N?(i.view=i.view.slice(0,N.index),i.viewTo=N.lineN):jr(e)}else{var Q=Qn(e,t,t,-1),J=Qn(e,n,n+r,1);Q&&J?(i.view=i.view.slice(0,Q.index).concat(mn(e,Q.lineN,J.lineN)).concat(i.view.slice(J.index)),i.viewTo+=r):jr(e)}var re=i.externalMeasured;re&&(n<re.lineN?re.lineN+=r:t<re.lineN+re.size&&(i.externalMeasured=null))}function Hr(e,t,n){e.curOp.viewChanged=!0;var r=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(r.externalMeasured=null),t<r.viewFrom||t>=r.viewTo)return;var S=r.view[_r(e,t)];if(S.node==null)return;var N=S.changes||(S.changes=[]);Se(N,n)==-1&&N.push(n)}function jr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Qn(e,t,n,r){var i=_r(e,t),S,N=e.display.view;if(!Mt||n==e.doc.first+e.doc.size)return{index:i,lineN:n};for(var Q=e.display.viewFrom,J=0;J<i;J++)Q+=N[J].size;if(Q!=t){if(r>0){if(i==N.length-1)return null;S=Q+N[i].size-t,i++}else S=Q-t;t+=S,n+=S}for(;yi(e.doc,n)!=n;){if(i==(r<0?0:N.length-1))return null;n+=r*N[i-(r<0?1:0)].size,i+=r}return{index:i,lineN:n}}function bi(e,t,n){var r=e.display,i=r.view;i.length==0||t>=r.viewTo||n<=r.viewFrom?(r.view=mn(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=mn(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(_r(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(mn(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,_r(e,n)))),r.viewTo=n}function Ei(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 Rr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function ti(e,t){t===void 0&&(t=!0);for(var n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),S=r.selection=document.createDocumentFragment(),N=0;N<n.sel.ranges.length;N++){if(!t&&N==n.sel.primIndex)continue;var Q=n.sel.ranges[N];if(Q.from().line>=e.display.viewTo||Q.to().line<e.display.viewFrom)continue;var J=Q.empty();(J||e.options.showCursorWhenSelecting)&&xi(e,Q.head,i),J||wr(e,Q,S)}return r}function xi(e,t,n){var r=or(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 S=n.appendChild(o("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));S.style.display="",S.style.left=r.other.left+"px",S.style.top=r.other.top+"px",S.style.height=(r.other.bottom-r.other.top)*.85+"px"}}function Pr(e,t){return e.top-t.top||e.left-t.left}function wr(e,t,n){var r=e.display,i=e.doc,S=document.createDocumentFragment(),N=Ae(e.display),Q=N.left,J=Math.max(r.sizerWidth,ve(e)-r.sizer.offsetLeft)-N.right,re=i.direction=="ltr";function ye(yt,At,Bt,It){At<0&&(At=0),At=Math.round(At),It=Math.round(It),S.appendChild(o("div",null,"CodeMirror-selected","position: absolute; left: "+yt+`px;
top: `+At+"px; width: "+(Bt==null?J-yt:Bt)+`px;
height: `+(It-At)+"px"))}function Ce(yt,At,Bt){var It=Et(i,yt),rr=It.text.length,Nr,hn;function zr($r,Fn){return Ur(e,tt(yt,$r),"div",It,Fn)}function Kn($r,Fn,vn){var sn=wt(e,It,null,$r),en=Fn=="ltr"==(vn=="after")?"left":"right",Yr=vn=="after"?sn.begin:sn.end-(/\s/.test(It.text.charAt(sn.end-1))?2:1);return zr(Yr,en)[en]}var Un=lt(It,i.direction);return ct(Un,At||0,Bt==null?rr:Bt,function($r,Fn,vn,sn){var en=vn=="ltr",Yr=zr($r,en?"left":"right"),jn=zr(Fn-1,en?"right":"left"),Na=At==null&&$r==0,ra=Bt==null&&Fn==rr,Sn=sn==0,wi=!Un||sn==Un.length-1;if(jn.top-Yr.top<=3){var fn=(re?Na:ra)&&Sn,ps=(re?ra:Na)&&wi,Wi=fn?Q:(en?Yr:jn).left,pa=ps?J:(en?jn:Yr).right;ye(Wi,Yr.top,pa-Wi,Yr.bottom)}else{var ma,kn,Ba,ms;en?(ma=re&&Na&&Sn?Q:Yr.left,kn=re?J:Kn($r,vn,"before"),Ba=re?Q:Kn(Fn,vn,"after"),ms=re&&ra&&wi?J:jn.right):(ma=re?Kn($r,vn,"before"):Q,kn=!re&&Na&&Sn?J:Yr.right,Ba=!re&&ra&&wi?Q:jn.left,ms=re?Kn(Fn,vn,"after"):J),ye(ma,Yr.top,kn-ma,Yr.bottom),Yr.bottom<jn.top&&ye(Q,Yr.bottom,null,jn.top),ye(Ba,jn.top,ms-Ba,jn.bottom)}(!Nr||Pr(Yr,Nr)<0)&&(Nr=Yr),Pr(jn,Nr)<0&&(Nr=jn),(!hn||Pr(Yr,hn)<0)&&(hn=Yr),Pr(jn,hn)<0&&(hn=jn)}),{start:Nr,end:hn}}var Pe=t.from(),Le=t.to();if(Pe.line==Le.line)Ce(Pe.line,Pe.ch,Le.ch);else{var Ve=Et(i,Pe.line),et=Et(i,Le.line),ut=Tn(Ve)==Tn(et),vt=Ce(Pe.line,Pe.ch,ut?Ve.text.length+1:null).end,St=Ce(Le.line,ut?0:null,Le.ch).start;ut&&(vt.top<St.top-2?(ye(vt.right,vt.top,null,vt.bottom),ye(Q,St.top,St.left,St.bottom)):ye(vt.right,vt.top,St.left-vt.right,vt.bottom)),vt.bottom<St.top&&ye(Q,vt.bottom,null,St.top)}n.appendChild(S)}function nn(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()||Qi(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function xo(e){e.state.focused||(e.display.input.focus(),Ci(e))}function Ga(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Qi(e))},100)}function Ci(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(le(e,"focus",e,t),e.state.focused=!0,z(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),P&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),nn(e)}function Qi(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(le(e,"blur",e,t),e.state.focused=!1,h(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function ya(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r<t.view.length;r++){var i=t.view[r],S=e.options.lineWrapping,N=void 0,Q=0;if(i.hidden)continue;if(W&&U<8){var J=i.node.offsetTop+i.node.offsetHeight;N=J-n,n=J}else{var re=i.node.getBoundingClientRect();N=re.bottom-re.top,!S&&i.text.firstChild&&(Q=i.text.firstChild.getBoundingClientRect().right-re.left-1)}var ye=i.line.height-N;if((ye>.005||ye<-.005)&&(zt(i.line,N),Va(i.line),i.rest))for(var Ce=0;Ce<i.rest.length;Ce++)Va(i.rest[Ce]);if(Q>e.display.sizerWidth){var Pe=Math.ceil(Q/tn(e.display));Pe>e.display.maxLineLength&&(e.display.maxLineLength=Pe,e.display.maxLine=i.line,e.display.maxLineChanged=!0)}}}function Va(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 ba(e,t,n){var r=n&&n.top!=null?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-za(e));var i=n&&n.bottom!=null?n.bottom:r+e.wrapper.clientHeight,S=vr(t,r),N=vr(t,i);if(n&&n.ensure){var Q=n.ensure.from.line,J=n.ensure.to.line;Q<S?(S=Q,N=vr(t,Wn(Et(t,Q))+e.wrapper.clientHeight)):Math.min(J,t.lastLine())>=N&&(S=vr(t,Wn(Et(t,J))-e.wrapper.clientHeight),N=J)}return{from:S,to:Math.max(N,S+1)}}function Qo(e,t){if(Z(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&&!T){var S=o("div","\u200B",null,`position: absolute;
top: `+(t.top-n.viewOffset-za(e.display))+`px;
height: `+(t.bottom-t.top+Re(e)+n.barHeight)+`px;
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(S),S.scrollIntoView(i),e.display.lineSpace.removeChild(S)}}function Xo(e,t,n,r){r==null&&(r=0);var i;!e.options.lineWrapping&&t==n&&(t=t.ch?tt(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,n=t.sticky=="before"?tt(t.line,t.ch+1,"before"):t);for(var S=0;S<5;S++){var N=!1,Q=or(e,t),J=!n||n==t?Q:or(e,n);i={left:Math.min(Q.left,J.left),top:Math.min(Q.top,J.top)-r,right:Math.max(Q.left,J.left),bottom:Math.max(Q.bottom,J.bottom)+r};var re=Qa(e,i),ye=e.doc.scrollTop,Ce=e.doc.scrollLeft;if(re.scrollTop!=null&&(Ji(e,re.scrollTop),Math.abs(e.doc.scrollTop-ye)>1&&(N=!0)),re.scrollLeft!=null&&(Xn(e,re.scrollLeft),Math.abs(e.doc.scrollLeft-Ce)>1&&(N=!0)),!N)break}return i}function Co(e,t){var n=Qa(e,t);n.scrollTop!=null&&Ji(e,n.scrollTop),n.scrollLeft!=null&&Xn(e,n.scrollLeft)}function Qa(e,t){var n=e.display,r=Xr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:n.scroller.scrollTop,S=te(e),N={};t.bottom-t.top>S&&(t.bottom=t.top+S);var Q=e.doc.height+me(n),J=t.top<r,re=t.bottom>Q-r;if(t.top<i)N.scrollTop=J?0:t.top;else if(t.bottom>i+S){var ye=Math.min(t.top,(re?Q:t.bottom)-S);ye!=i&&(N.scrollTop=ye)}var Ce=e.options.fixedGutter?0:n.gutters.offsetWidth,Pe=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:n.scroller.scrollLeft-Ce,Le=ve(e)-n.gutters.offsetWidth,Ve=t.right-t.left>Le;return Ve&&(t.right=t.left+Le),t.left<10?N.scrollLeft=0:t.left<Pe?N.scrollLeft=Math.max(0,t.left+Ce-(Ve?0:10)):t.right>Le+Pe-3&&(N.scrollLeft=t.right+(Ve?0:10)-Le),N}function Xa(e,t){if(t==null)return;Ea(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function Xi(e){Ea(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Yi(e,t,n){(t!=null||n!=null)&&Ea(e),t!=null&&(e.curOp.scrollLeft=t),n!=null&&(e.curOp.scrollTop=n)}function Yo(e,t){Ea(e),e.curOp.scrollToPos=t}function Ea(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=Pt(e,t.from),r=Pt(e,t.to);ua(e,n,r,t.margin)}}function ua(e,t,n,r){var i=Qa(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});Yi(e,i.scrollLeft,i.scrollTop)}function Ji(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;O||ha(e,{top:t}),Zi(e,t,!0),O&&ha(e),ca(e,100)}function Zi(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 Xn(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,dr(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function _i(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+me(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+Re(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var Si=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),Ne(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),Ne(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,W&&U<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Si.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 S=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+S)+"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}},Si.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Si.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Si.prototype.zeroWidthHack=function(){var e=l&&!w?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new fe,this.disableVert=new fe},Si.prototype.enableZeroWidthBar=function(e,t,n){e.style.pointerEvents="auto";function r(){var i=e.getBoundingClientRect(),S=n=="vert"?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1);S!=e?e.style.pointerEvents="none":t.set(1e3,r)}t.set(1e3,r)},Si.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var da=function(){};da.prototype.update=function(){return{bottom:0,right:0}},da.prototype.setScrollLeft=function(){},da.prototype.setScrollTop=function(){},da.prototype.clear=function(){};function Ni(e,t){t||(t=_i(e));var n=e.display.barWidth,r=e.display.barHeight;xa(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&ya(e),xa(e,_i(e)),n=e.display.barWidth,r=e.display.barHeight}function xa(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 Ya={native:Si,null:da};function Ca(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&h(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Ya[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Ne(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"?Xn(e,t):Ji(e,t)},e),e.display.scrollbars.addClass&&z(e.display.wrapper,e.display.scrollbars.addClass)}var Ja=0;function Ai(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:++Ja},Hn(e.curOp)}function Bi(e){var t=e.curOp;t&&Ko(t,function(n){for(var r=0;r<n.ops.length;r++)n.ops[r].cm.curOp=null;So(n)})}function So(e){for(var t=e.ops,n=0;n<t.length;n++)Jo(t[n]);for(var r=0;r<t.length;r++)Zo(t[r]);for(var i=0;i<t.length;i++)qo(t[i]);for(var S=0;S<t.length;S++)Za(t[S]);for(var N=0;N<t.length;N++)$o(t[N])}function Jo(e){var t=e.cm,n=t.display;Ao(t),e.updateMaxLine&&sa(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 Yn(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Zo(e){e.updatedDisplay=e.mustUpdate&&Ui(e.cm,e.update)}function qo(e){var t=e.cm,n=t.display;e.updatedDisplay&&ya(t),e.barMeasure=_i(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Ee(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+Re(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-ve(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Za(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Xn(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==_();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Ni(t,e.barMeasure),e.updatedDisplay&&Sr(t,e.barMeasure),e.selectionChanged&&nn(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&xo(e.cm)}function $o(e){var t=e.cm,n=t.display,r=t.doc;if(e.updatedDisplay&&Sa(t,e.update),n.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(n.wheelStartX=n.wheelStartY=null),e.scrollTop!=null&&Zi(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Xn(t,e.scrollLeft,!0,!0),e.scrollToPos){var i=Xo(t,jt(r,e.scrollToPos.from),jt(r,e.scrollToPos.to),e.scrollToPos.margin);Qo(t,i)}var S=e.maybeHiddenMarkers,N=e.maybeUnhiddenMarkers;if(S)for(var Q=0;Q<S.length;++Q)S[Q].lines.length||le(S[Q],"hide");if(N)for(var J=0;J<N.length;++J)N[J].lines.length&&le(N[J],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&le(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Rn(e,t){if(e.curOp)return t();Ai(e);try{return t()}finally{Bi(e)}}function Jr(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Ai(e);try{return t.apply(e,arguments)}finally{Bi(e)}}}function gn(e){return function(){if(this.curOp)return e.apply(this,arguments);Ai(this);try{return e.apply(this,arguments)}finally{Bi(this)}}}function Zr(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Ai(t);try{return e.apply(this,arguments)}finally{Bi(t)}}}function ca(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,G(es,e))}function es(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var n=+new Date+e.options.workTime,r=In(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(S){if(r.line>=e.display.viewFrom){var N=S.styles,Q=S.text.length>e.options.maxHighlightLength?ur(t.mode,r.state):null,J=Di(e,S,r,!0);Q&&(r.state=Q),S.styles=J.styles;var re=S.styleClasses,ye=J.classes;ye?S.styleClasses=ye:re&&(S.styleClasses=null);for(var Ce=!N||N.length!=S.styles.length||re!=ye&&(!re||!ye||re.bgClass!=ye.bgClass||re.textClass!=ye.textClass),Pe=0;!Ce&&Pe<N.length;++Pe)Ce=N[Pe]!=S.styles[Pe];Ce&&i.push(r.line),S.stateAfter=r.save(),r.nextLine()}else S.text.length<=e.options.maxHighlightLength&&pi(e,S.text,r),S.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return ca(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&Rn(e,function(){for(var S=0;S<i.length;S++)Hr(e,i[S],"text")})}var Yn=function(e,t,n){var r=e.display;this.viewport=t,this.visible=ba(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=ve(e),this.force=n,this.dims=Wr(e),this.events=[]};Yn.prototype.signal=function(e,t){ne(e,t)&&this.events.push(arguments)},Yn.prototype.finish=function(){for(var e=0;e<this.events.length;e++)le.apply(null,this.events[e])};function Ao(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Re(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Re(e)+"px",t.scrollbarsClipped=!0)}function To(e){if(e.hasFocus())return null;var t=_();if(!t||!C(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&C(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}function wo(e){if(!e||!e.activeElt||e.activeElt==_())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&C(document.body,e.anchorNode)&&C(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 Ui(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return jr(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&&Ei(e)==0)return!1;an(e)&&(jr(e),t.dims=Wr(e));var i=r.first+r.size,S=Math.max(t.visible.from-e.options.viewportMargin,r.first),N=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFrom<S&&S-n.viewFrom<20&&(S=Math.max(r.first,n.viewFrom)),n.viewTo>N&&n.viewTo-N<20&&(N=Math.min(i,n.viewTo)),Mt&&(S=yi(e.doc,S),N=_n(e.doc,N));var Q=S!=n.viewFrom||N!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;bi(e,S,N),n.viewOffset=Wn(Et(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var J=Ei(e);if(!Q&&J==0&&!t.force&&n.renderedView==n.view&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo))return!1;var re=To(e);return J>4&&(n.lineDiv.style.display="none"),Do(e,n.updateLineNumbers,t.dims),J>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,wo(re),p(n.cursorDiv),p(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,Q&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,ca(e,400)),n.updateLineNumbers=null,!0}function Sa(e,t){for(var n=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==ve(e)){if(n&&n.top!=null&&(n={top:Math.min(e.doc.height+me(e.display)-te(e),n.top)}),t.visible=ba(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=ba(e.display,e.doc,n));if(!Ui(e,t))break;ya(e);var i=_i(e);Rr(e),Ni(e,i),Sr(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 ha(e,t){var n=new Yn(e,t);if(Ui(e,n)){ya(e),Sa(e,n);var r=_i(e);Rr(e),Ni(e,r),Sr(e,r),n.finish()}}function Do(e,t,n){var r=e.display,i=e.options.lineNumbers,S=r.lineDiv,N=S.firstChild;function Q(Ve){var et=Ve.nextSibling;return P&&l&&e.display.currentWheelTarget==Ve?Ve.style.display="none":Ve.parentNode.removeChild(Ve),et}for(var J=r.view,re=r.viewFrom,ye=0;ye<J.length;ye++){var Ce=J[ye];if(!Ce.hidden)if(!Ce.node||Ce.node.parentNode!=S){var Pe=bo(e,Ce,re,n);S.insertBefore(Pe,N)}else{for(;N!=Ce.node;)N=Q(N);var Le=i&&t!=null&&t<=re&&Ce.lineNumber;Ce.changes&&(Se(Ce.changes,"gutter")>-1&&(Le=!1),vo(e,Ce,re,n)),Le&&(p(Ce.lineNumber),Ce.lineNumber.appendChild(document.createTextNode(Br(e.options,re)))),N=Ce.node.nextSibling}re+=Ce.size}for(;N;)N=Q(N)}function Aa(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Sr(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+Re(e)+"px"}function dr(e){var t=e.display,n=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var r=xn(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,S=r+"px",N=0;N<n.length;N++)if(!n[N].hidden){e.options.fixedGutter&&(n[N].gutter&&(n[N].gutter.style.left=S),n[N].gutterBackground&&(n[N].gutterBackground.style.left=S));var Q=n[N].alignable;if(Q)for(var J=0;J<Q.length;J++)Q[J].style.left=S}e.options.fixedGutter&&(t.gutters.style.left=r+i+"px")}function an(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=Br(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")),S=i.firstChild.offsetWidth,N=i.offsetWidth-S;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(S,r.lineGutter.offsetWidth-N)+1,r.lineNumWidth=r.lineNumInnerWidth+N,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",Aa(e.display),!0}return!1}function On(e,t){for(var n=[],r=!1,i=0;i<e.length;i++){var S=e[i],N=null;if(typeof S!="string"&&(N=S.style,S=S.className),S=="CodeMirror-linenumbers")if(t)r=!0;else continue;n.push({className:S,style:N})}return t&&!r&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function qi(e){var t=e.gutters,n=e.gutterSpecs;p(t),e.lineGutter=null;for(var r=0;r<n.length;++r){var i=n[r],S=i.className,N=i.style,Q=t.appendChild(o("div",null,"CodeMirror-gutter "+S));N&&(Q.style.cssText=N),S=="CodeMirror-linenumbers"&&(e.lineGutter=Q,Q.style.width=(e.lineNumWidth||1)+"px")}t.style.display=n.length?"":"none",Aa(e)}function li(e){qi(e.display),Lr(e),dr(e)}function fa(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 S=x("div",[i.lineSpace],"CodeMirror-lines");i.mover=o("div",[S],null,"position: relative"),i.sizer=o("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=o("div",null,null,"position: absolute; height: "+ke+"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"),W&&U<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),!P&&!(O&&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=On(r.gutters,r.lineNumbers),qi(i),n.init(i)}var Ti=0,on=null;W?on=-.53:O?on=15:b?on=-.7:I&&(on=-1/3);function Ta(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 qa(e){var t=Ta(e);return t.x*=on,t.y*=on,t}function $a(e,t){var n=Ta(t),r=n.x,i=n.y,S=e.display,N=S.scroller,Q=N.scrollWidth>N.clientWidth,J=N.scrollHeight>N.clientHeight;if(!(r&&Q||i&&J))return;if(i&&l&&P){e:for(var re=t.target,ye=S.view;re!=N;re=re.parentNode)for(var Ce=0;Ce<ye.length;Ce++)if(ye[Ce].node==re){e.display.currentWheelTarget=re;break e}}if(r&&!O&&!E&&on!=null){i&&J&&Ji(e,Math.max(0,N.scrollTop+i*on)),Xn(e,Math.max(0,N.scrollLeft+r*on)),(!i||i&&J)&&ee(t),S.wheelStartX=null;return}if(i&&on!=null){var Pe=i*on,Le=e.doc.scrollTop,Ve=Le+S.wrapper.clientHeight;Pe<0?Le=Math.max(0,Le+Pe-50):Ve=Math.min(e.doc.height,Ve+Pe+50),ha(e,{top:Le,bottom:Ve})}Ti<20&&(S.wheelStartX==null?(S.wheelStartX=N.scrollLeft,S.wheelStartY=N.scrollTop,S.wheelDX=r,S.wheelDY=i,setTimeout(function(){if(S.wheelStartX==null)return;var et=N.scrollLeft-S.wheelStartX,ut=N.scrollTop-S.wheelStartY,vt=ut&&S.wheelDY&&ut/S.wheelDY||et&&S.wheelDX&&et/S.wheelDX;if(S.wheelStartX=S.wheelStartY=null,!vt)return;on=(on*Ti+vt)/(Ti+1),++Ti},200)):(S.wheelDX+=r,S.wheelDY+=i))}var Mn=function(e,t){this.ranges=e,this.primIndex=t};Mn.prototype.primary=function(){return this.ranges[this.primIndex]},Mn.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(!Ln(n.anchor,r.anchor)||!Ln(n.head,r.head))return!1}return!0},Mn.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Cr(ri(this.ranges[t].anchor),ri(this.ranges[t].head));return new Mn(e,this.primIndex)},Mn.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Mn.prototype.contains=function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(Ot(t,r.from())>=0&&Ot(e,r.to())<=0)return n}return-1};var Cr=function(e,t){this.anchor=e,this.head=t};Cr.prototype.from=function(){return zn(this.anchor,this.head)},Cr.prototype.to=function(){return hi(this.anchor,this.head)},Cr.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Jn(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort(function(Pe,Le){return Ot(Pe.from(),Le.from())}),n=Se(t,i);for(var S=1;S<t.length;S++){var N=t[S],Q=t[S-1],J=Ot(Q.to(),N.from());if(r&&!N.empty()?J>0:J>=0){var re=zn(Q.from(),N.from()),ye=hi(Q.to(),N.to()),Ce=Q.empty()?N.from()==N.head:Q.from()==Q.head;S<=n&&--n,t.splice(--S,2,new Cr(Ce?ye:re,Ce?re:ye))}}return new Mn(t,n)}function ui(e,t){return new Mn([new Cr(e,t||e)],0)}function di(e){return e.text?tt(e.from.line+e.text.length-1,R(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function eo(e,t){if(Ot(e,t.from)<0)return e;if(Ot(e,t.to)<=0)return di(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+=di(t).ch-t.to.ch),tt(n,r)}function wa(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new Cr(eo(i.anchor,t),eo(i.head,t)))}return Jn(e.cm,n,e.sel.primIndex)}function Ro(e,t,n){return e.line==t.line?tt(n.line,e.ch-t.ch+n.ch):tt(n.line+(e.line-t.line),e.ch)}function Oo(e,t,n){for(var r=[],i=tt(e.first,0),S=i,N=0;N<t.length;N++){var Q=t[N],J=Ro(Q.from,i,S),re=Ro(di(Q),i,S);if(i=Q.to,S=re,n=="around"){var ye=e.sel.ranges[N],Ce=Ot(ye.head,ye.anchor)<0;r[N]=new Cr(Ce?re:J,Ce?J:re)}else r[N]=new Cr(J,J)}return new Mn(r,e.sel.primIndex)}function Fi(e){e.doc.mode=qt(e.options,e.doc.modeOption),to(e)}function to(e){e.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,ca(e,100),e.state.modeGen++,e.curOp&&Lr(e)}function gs(e,t){return t.from.ch==0&&t.to.ch==0&&R(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function ts(e,t,n,r){function i(St){return n?n[St]:null}function S(St,yt,At){Ua(St,yt,At,r),Qr(St,"change",St,t)}function N(St,yt){for(var At=[],Bt=St;Bt<yt;++Bt)At.push(new Pi(re[Bt],i(Bt),r));return At}var Q=t.from,J=t.to,re=t.text,ye=Et(e,Q.line),Ce=Et(e,J.line),Pe=R(re),Le=i(re.length-1),Ve=J.line-Q.line;if(t.full)e.insert(0,N(0,re.length)),e.remove(re.length,e.size-re.length);else if(gs(e,t)){var et=N(0,re.length-1);S(Ce,Ce.text,Le),Ve&&e.remove(Q.line,Ve),et.length&&e.insert(Q.line,et)}else if(ye==Ce)if(re.length==1)S(ye,ye.text.slice(0,Q.ch)+Pe+ye.text.slice(J.ch),Le);else{var ut=N(1,re.length-1);ut.push(new Pi(Pe+ye.text.slice(J.ch),Le,r)),S(ye,ye.text.slice(0,Q.ch)+re[0],i(0)),e.insert(Q.line+1,ut)}else if(re.length==1)S(ye,ye.text.slice(0,Q.ch)+re[0]+Ce.text.slice(J.ch),i(0)),e.remove(Q.line+1,Ve);else{S(ye,ye.text.slice(0,Q.ch)+re[0],i(0)),S(Ce,Pe+Ce.text.slice(J.ch),Le);var vt=N(1,re.length-1);Ve>1&&e.remove(Q.line+1,Ve-1),e.insert(Q.line+1,vt)}Qr(e,"change",e,t)}function $i(e,t,n){function r(i,S,N){if(i.linked)for(var Q=0;Q<i.linked.length;++Q){var J=i.linked[Q];if(J.doc==S)continue;var re=N&&J.sharedHist;if(n&&!re)continue;t(J.doc,re),r(J.doc,i,re)}}r(e,null,!0)}function vs(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Dn(e),Fi(e),ys(e),e.options.lineWrapping||sa(e),e.options.mode=t.modeOption,Lr(e)}function ys(e){(e.doc.direction=="rtl"?z:h)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){Rn(e,function(){ys(e),Lr(e)})}function Mo(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 rs(e,t){var n={from:ri(t.from),to:di(t),text:sr(e,t.from,t.to)};return xs(e,n,t.from.line,t.to.line+1),$i(e,function(r){return xs(r,n,t.from.line,t.to.line+1)},!0),n}function bs(e){for(;e.length;){var t=R(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return bs(e.done),R(e.done);if(e.done.length&&!R(e.done).ranges)return R(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),R(e.done)}function Es(e,t,n,r){var i=e.history;i.undone.length=0;var S=+new Date,N,Q;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&i.lastModTime>S-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(N=pl(i,i.lastOp==r)))Q=R(N.changes),Ot(t.from,t.to)==0&&Ot(t.from,Q.to)==0?Q.to=di(t):N.changes.push(rs(e,t));else{var J=R(i.done);for((!J||!J.ranges)&&ko(e.sel,i.done),N={changes:[rs(e,t)],generation:i.generation},i.done.push(N);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=S,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,Q||le(e,"historyAdded")}function ml(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,S=r&&r.origin;n==i.lastSelOp||S&&i.lastSelOrigin==S&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==S||ml(e,S,R(i.done),t))?i.done[i.done.length-1]=t:ko(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=S,i.lastSelOp=n,r&&r.clearRedo!==!1&&bs(i.undone)}function ko(e,t){var n=R(t);n&&n.ranges&&n.equals(e)||t.push(e)}function xs(e,t,n,r){var i=t["spans_"+e.id],S=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(N){N.markedSpans&&((i||(i=t["spans_"+e.id]={}))[S]=N.markedSpans),++S})}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 Cs(e,t){var n=yl(e,t),r=Gn(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var S=n[i],N=r[i];if(S&&N){e:for(var Q=0;Q<N.length;++Q){for(var J=N[Q],re=0;re<S.length;++re)if(S[re].marker==J.marker)continue e;S.push(J)}}else N&&(n[i]=N)}return n}function Da(e,t,n){for(var r=[],i=0;i<e.length;++i){var S=e[i];if(S.ranges){r.push(n?Mn.prototype.deepCopy.call(S):S);continue}var N=S.changes,Q=[];r.push({changes:Q});for(var J=0;J<N.length;++J){var re=N[J],ye=void 0;if(Q.push({from:re.from,to:re.to,text:re.text}),t)for(var Ce in re)(ye=Ce.match(/^spans_(\d+)$/))&&(Se(t,Number(ye[1]))>-1&&(R(Q)[Ce]=re[Ce],delete re[Ce]))}}return r}function ns(e,t,n,r){if(r){var i=e.anchor;if(n){var S=Ot(t,i)<0;S!=Ot(n,i)<0?(i=t,t=n):S!=Ot(t,n)<0&&(t=n)}return new Cr(i,t)}else return new Cr(n||t,t)}function Lo(e,t,n,r,i){i==null&&(i=e.cm&&(e.cm.display.shift||e.extend)),Cn(e,new Mn([ns(e.sel.primary(),t,n,i)],0),r)}function Ss(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),S=0;S<e.sel.ranges.length;S++)r[S]=ns(e.sel.ranges[S],t[S],null,i);var N=Jn(e.cm,r,e.sel.primIndex);Cn(e,N,n)}function is(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,Cn(e,Jn(e.cm,i,e.sel.primIndex),r)}function As(e,t,n,r){Cn(e,ui(t,n),r)}function bl(e,t,n){var r={ranges:t.ranges,update:function(i){this.ranges=[];for(var S=0;S<i.length;S++)this.ranges[S]=new Cr(jt(e,i[S].anchor),jt(e,i[S].head))},origin:n&&n.origin};return le(e,"beforeSelectionChange",e,r),e.cm&&le(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?Jn(e.cm,r.ranges,r.ranges.length-1):t}function Ts(e,t,n){var r=e.history.done,i=R(r);i&&i.ranges?(r[r.length-1]=t,Io(e,t,n)):Cn(e,t,n)}function Cn(e,t,n){Io(e,t,n),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function Io(e,t,n){(ne(e,"beforeSelectionChange")||e.cm&&ne(e.cm,"beforeSelectionChange"))&&(t=bl(e,t,n));var r=n&&n.bias||(Ot(t.primary().head,e.sel.primary().head)<0?-1:1);ws(e,Rs(e,t,r,!0)),!(n&&n.scroll===!1)&&e.cm&&Xi(e.cm)}function ws(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,q(e.cm)),Qr(e,"cursorActivity",e)}function Ds(e){ws(e,Rs(e,e.sel,null,!1))}function Rs(e,t,n,r){for(var i,S=0;S<t.ranges.length;S++){var N=t.ranges[S],Q=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[S],J=Po(e,N.anchor,Q&&Q.anchor,n,r),re=Po(e,N.head,Q&&Q.head,n,r);(i||J!=N.anchor||re!=N.head)&&(i||(i=t.ranges.slice(0,S)),i[S]=new Cr(J,re))}return i?Jn(e.cm,i,t.primIndex):t}function Ra(e,t,n,r,i){var S=Et(e,t.line);if(S.markedSpans)for(var N=0;N<S.markedSpans.length;++N){var Q=S.markedSpans[N],J=Q.marker,re="selectLeft"in J?!J.selectLeft:J.inclusiveLeft,ye="selectRight"in J?!J.selectRight:J.inclusiveRight;if((Q.from==null||(re?Q.from<=t.ch:Q.from<t.ch))&&(Q.to==null||(ye?Q.to>=t.ch:Q.to>t.ch))){if(i&&(le(J,"beforeCursorEnter"),J.explicitlyCleared))if(S.markedSpans){--N;continue}else break;if(!J.atomic)continue;if(n){var Ce=J.find(r<0?1:-1),Pe=void 0;if((r<0?ye:re)&&(Ce=Os(e,Ce,-r,Ce&&Ce.line==t.line?S:null)),Ce&&Ce.line==t.line&&(Pe=Ot(Ce,n))&&(r<0?Pe<0:Pe>0))return Ra(e,Ce,t,r,i)}var Le=J.find(r<0?-1:1);return(r<0?re:ye)&&(Le=Os(e,Le,r,Le.line==t.line?S:null)),Le?Ra(e,Le,t,r,i):null}}return t}function Po(e,t,n,r,i){var S=r||1,N=Ra(e,t,n,S,i)||!i&&Ra(e,t,n,S,!0)||Ra(e,t,n,-S,i)||!i&&Ra(e,t,n,-S,!0);return N||(e.cantEdit=!0,tt(e.first,0))}function Os(e,t,n,r){return n<0&&t.ch==0?t.line>e.first?jt(e,tt(t.line-1)):null:n>0&&t.ch==(r||Et(e,t.line)).text.length?t.line<e.first+e.size-1?tt(t.line+1,0):null:new tt(t.line,t.ch+n)}function Ms(e){e.setSelection(tt(e.firstLine(),0),tt(e.lastLine()),_e)}function ks(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,S,N,Q){i&&(r.from=jt(e,i)),S&&(r.to=jt(e,S)),N&&(r.text=N),Q!==void 0&&(r.origin=Q)}),le(e,"beforeChange",e,r),e.cm&&le(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 Oa(e,t,n){if(e.cm){if(!e.cm.curOp)return Jr(e.cm,Oa)(e,t,n);if(e.cm.state.suppressEdits)return}if((ne(e,"beforeChange")||e.cm&&ne(e.cm,"beforeChange"))&&(t=ks(e,t,!0),!t))return;var r=Er&&!n&&dn(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)Ls(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else Ls(e,t)}function Ls(e,t){if(t.text.length==1&&t.text[0]==""&&Ot(t.from,t.to)==0)return;var n=wa(e,t);Es(e,t,n,e.cm?e.cm.curOp.id:NaN),ro(e,t,n,Gn(e,t));var r=[];$i(e,function(i,S){!S&&Se(r,i.history)==-1&&(Ns(i.history,t),r.push(i.history)),ro(i,t,null,Gn(i,t))})}function _o(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(r&&!n)return;for(var i=e.history,S,N=e.sel,Q=t=="undo"?i.done:i.undone,J=t=="undo"?i.undone:i.done,re=0;re<Q.length&&!(S=Q[re],n?S.ranges&&!S.equals(e.sel):!S.ranges);re++);if(re==Q.length)return;for(i.lastOrigin=i.lastSelOrigin=null;;)if(S=Q.pop(),S.ranges){if(ko(S,J),n&&!S.equals(e.sel)){Cn(e,S,{clearRedo:!1});return}N=S}else if(r){Q.push(S);return}else break;var ye=[];ko(N,J),J.push({changes:ye,generation:i.generation}),i.generation=S.generation||++i.maxGeneration;for(var Ce=ne(e,"beforeChange")||e.cm&&ne(e.cm,"beforeChange"),Pe=function(et){var ut=S.changes[et];if(ut.origin=t,Ce&&!ks(e,ut,!1))return Q.length=0,{};ye.push(rs(e,ut));var vt=et?wa(e,ut):R(Q);ro(e,ut,vt,Cs(e,ut)),!et&&e.cm&&e.cm.scrollIntoView({from:ut.from,to:di(ut)});var St=[];$i(e,function(yt,At){!At&&Se(St,yt.history)==-1&&(Ns(yt.history,ut),St.push(yt.history)),ro(yt,ut,null,Cs(yt,ut))})},Le=S.changes.length-1;Le>=0;--Le){var Ve=Pe(Le);if(Ve)return Ve.v}}function Is(e,t){if(t==0)return;if(e.first+=t,e.sel=new Mn(M(e.sel.ranges,function(i){return new Cr(tt(i.anchor.line+t,i.anchor.ch),tt(i.head.line+t,i.head.ch))}),e.sel.primIndex),e.cm){Lr(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)Hr(e.cm,r,"gutter")}}function ro(e,t,n,r){if(e.cm&&!e.cm.curOp)return Jr(e.cm,ro)(e,t,n,r);if(t.to.line<e.first){Is(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);Is(e,i),t={from:tt(e.first,0),to:tt(t.to.line+i,t.to.ch),text:[R(t.text)],origin:t.origin}}var S=e.lastLine();t.to.line>S&&(t={from:t.from,to:tt(S,Et(e,S).text.length),text:[t.text[0]],origin:t.origin}),t.removed=sr(e,t.from,t.to),n||(n=wa(e,t)),e.cm?El(e.cm,t,r):ts(e,t,r),Io(e,n,_e),e.cantEdit&&Po(e,tt(e.firstLine(),0))&&(e.cantEdit=!1)}function El(e,t,n){var r=e.doc,i=e.display,S=t.from,N=t.to,Q=!1,J=S.line;e.options.lineWrapping||(J=Ht(Tn(Et(r,S.line))),r.iter(J,N.line+1,function(Le){if(Le==i.maxLine)return Q=!0,!0})),r.sel.contains(t.from,t.to)>-1&&q(e),ts(r,t,n,Vn(e)),e.options.lineWrapping||(r.iter(J,S.line+t.text.length,function(Le){var Ve=oa(Le);Ve>i.maxLineLength&&(i.maxLine=Le,i.maxLineLength=Ve,i.maxLineChanged=!0,Q=!1)}),Q&&(e.curOp.updateMaxLine=!0)),na(r,S.line),ca(e,400);var re=t.text.length-(N.line-S.line)-1;t.full?Lr(e):S.line==N.line&&t.text.length==1&&!gs(e.doc,t)?Hr(e,S.line,"text"):Lr(e,S.line,N.line+1,re);var ye=ne(e,"changes"),Ce=ne(e,"change");if(Ce||ye){var Pe={from:S,to:N,text:t.text,removed:t.removed,origin:t.origin};Ce&&Qr(e,"change",e,Pe),ye&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Pe)}e.display.selForContextMenu=null}function Ma(e,t,n,r,i){var S;r||(r=n),Ot(r,n)<0&&(S=[r,n],n=S[0],r=S[1]),typeof t=="string"&&(t=e.splitLines(t)),Oa(e,{from:n,to:r,text:t,origin:i})}function Ps(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function _s(e,t,n,r){for(var i=0;i<e.length;++i){var S=e[i],N=!0;if(S.ranges){S.copied||(S=e[i]=S.deepCopy(),S.copied=!0);for(var Q=0;Q<S.ranges.length;Q++)Ps(S.ranges[Q].anchor,t,n,r),Ps(S.ranges[Q].head,t,n,r);continue}for(var J=0;J<S.changes.length;++J){var re=S.changes[J];if(n<re.from.line)re.from=tt(re.from.line+r,re.from.ch),re.to=tt(re.to.line+r,re.to.ch);else if(t<=re.to.line){N=!1;break}}N||(e.splice(0,i+1),i=0)}}function Ns(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;_s(e.done,n,r,i),_s(e.undone,n,r,i)}function no(e,t,n,r){var i=t,S=t;return typeof t=="number"?S=Et(e,fi(e,t)):i=Ht(t),i==null?null:(r(S,i)&&e.cm&&Hr(e.cm,i,n),S)}function io(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}io.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,Dt(i),Qr(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 ao(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}ao.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 S=Math.min(t,i-e),N=r.height;if(r.removeInner(e,S),this.height-=N-r.height,i==S&&(this.children.splice(n--,1),r.parent=null),(t-=S)==0)break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof io))){var Q=[];this.collapse(Q),this.children=[new io(Q)],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],S=i.chunkSize();if(e<=S){if(i.insertInner(e,t,n),i.lines&&i.lines.length>50){for(var N=i.lines.length%25+25,Q=N;Q<i.lines.length;){var J=new io(i.lines.slice(Q,Q+=25));i.height-=J.height,this.children.splice(++r,0,J),J.parent=this}i.lines=i.lines.slice(0,N),this.maybeSpill()}break}e-=S}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new ao(t);if(e.parent){e.size-=n.size,e.height-=n.height;var i=Se(e.parent.children,e);e.parent.children.splice(i+1,0,n)}else{var r=new ao(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],S=i.chunkSize();if(e<S){var N=Math.min(t,S-e);if(i.iterN(e,N,n))return!0;if((t-=N)==0)break;e=0}else e-=S}}};var oo=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};oo.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=Ht(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 S=Vi(this);zt(n,Math.max(0,n.height-S)),e&&(Rn(e,function(){Bs(e,n,-S),Hr(e,r,"widget")}),Qr(e,"lineWidgetCleared",e,this,r))},oo.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var i=Vi(this)-t;if(!i)return;Nn(this.doc,r)||zt(r,r.height+i),n&&Rn(n,function(){n.curOp.forceUpdate=!0,Bs(n,r,i),Qr(n,"lineWidgetChanged",n,e,Ht(r))})},ue(oo);function Bs(e,t,n){Wn(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Xa(e,n)}function xl(e,t,n,r){var i=new oo(e,n,r),S=e.cm;return S&&i.noHScroll&&(S.display.alignWidgets=!0),no(e,t,"widget",function(N){var Q=N.widgets||(N.widgets=[]);if(i.insertAt==null?Q.push(i):Q.splice(Math.min(Q.length-1,Math.max(0,i.insertAt)),0,i),i.line=N,S&&!Nn(e,N)){var J=Wn(N)<e.scrollTop;zt(N,N.height+Vi(i)),J&&Xa(S,i.height),S.curOp.forceUpdate=!0}return!0}),S&&Qr(S,"lineWidgetAdded",S,i,typeof t=="number"?t:Ht(t)),i}var Us=0,ea=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++Us};ea.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&Ai(e),ne(this,"clear")){var n=this.find();n&&Qr(this,"clear",n.from,n.to)}for(var r=null,i=null,S=0;S<this.lines.length;++S){var N=this.lines[S],Q=Jt(N.markedSpans,this);e&&!this.collapsed?Hr(e,Ht(N),"text"):e&&(Q.to!=null&&(i=Ht(N)),Q.from!=null&&(r=Ht(N))),N.markedSpans=Zn(N.markedSpans,Q),Q.from==null&&this.collapsed&&!Nn(this.doc,N)&&e&&zt(N,Xr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var J=0;J<this.lines.length;++J){var re=Tn(this.lines[J]),ye=oa(re);ye>e.display.maxLineLength&&(e.display.maxLine=re,e.display.maxLineLength=ye,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&Lr(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Ds(e.doc)),e&&Qr(e,"markerCleared",e,this,r,i),t&&Bi(e),this.parent&&this.parent.clear()},ea.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var n,r,i=0;i<this.lines.length;++i){var S=this.lines[i],N=Jt(S.markedSpans,this);if(N.from!=null&&(n=tt(t?S:Ht(S),N.from),e==-1))return n;if(N.to!=null&&(r=tt(t?S:Ht(S),N.to),e==1))return r}return n&&{from:n,to:r}},ea.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;if(!t||!r)return;Rn(r,function(){var i=t.line,S=Ht(t.line),N=Me(r,S);if(N&&($t(N),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!Nn(n.doc,i)&&n.height!=null){var Q=n.height;n.height=null;var J=Vi(n)-Q;J&&zt(i,i.height+J)}Qr(r,"markerChanged",r,e)})},ea.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||Se(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},ea.prototype.detachLine=function(e){if(this.lines.splice(Se(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},ue(ea);function ka(e,t,n,r,i){if(r&&r.shared)return Cl(e,t,n,r,i);if(e.cm&&!e.cm.curOp)return Jr(e.cm,ka)(e,t,n,r,i);var S=new ea(e,i),N=Ot(t,n);if(r&&j(r,S,!1),N>0||N==0&&S.clearWhenEmpty!==!1)return S;if(S.replacedWith&&(S.collapsed=!0,S.widgetNode=x("span",[S.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||S.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(S.widgetNode.insertLeft=!0)),S.collapsed){if(ga(e,t.line,t,n,S)||t.line!=n.line&&ga(e,n.line,t,n,S))throw new Error("Inserting collapsed marker partially overlapping an existing one");nr()}S.addToHistory&&Es(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var Q=t.line,J=e.cm,re;if(e.iter(Q,n.line+1,function(Ce){J&&S.collapsed&&!J.options.lineWrapping&&Tn(Ce)==J.display.maxLine&&(re=!0),S.collapsed&&Q!=t.line&&zt(Ce,0),un(Ce,new yr(S,Q==t.line?t.ch:null,Q==n.line?n.ch:null)),++Q}),S.collapsed&&e.iter(t.line,n.line+1,function(Ce){Nn(e,Ce)&&zt(Ce,0)}),S.clearOnEnter&&Ne(S,"beforeCursorEnter",function(){return S.clear()}),S.readOnly&&(Wt(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),S.collapsed&&(S.id=++Us,S.atomic=!0),J){if(re&&(J.curOp.updateMaxLine=!0),S.collapsed)Lr(J,t.line,n.line+1);else if(S.className||S.startStyle||S.endStyle||S.css||S.attributes||S.title)for(var ye=t.line;ye<=n.line;ye++)Hr(J,ye,"text");S.atomic&&Ds(J.doc),Qr(J,"markerAdded",J,S)}return S}var so=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};so.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Qr(this,"clear")},so.prototype.find=function(e,t){return this.primary.find(e,t)},ue(so);function Cl(e,t,n,r,i){r=j(r),r.shared=!1;var S=[ka(e,t,n,r,i)],N=S[0],Q=r.widgetNode;return $i(e,function(J){Q&&(r.widgetNode=Q.cloneNode(!0)),S.push(ka(J,jt(J,t),jt(J,n),r,i));for(var re=0;re<J.linked.length;++re)if(J.linked[re].isParent)return;N=R(S)}),new so(S,N)}function Fs(e){return e.findMarks(tt(e.first,0),e.clipPos(tt(e.lastLine())),function(t){return t.parent})}function Sl(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),S=e.clipPos(i.from),N=e.clipPos(i.to);if(Ot(S,N)){var Q=ka(e,S,N,r.primary,r.primary.type);r.markers.push(Q),Q.parent=r}}}function Al(e){for(var t=function(r){var i=e[r],S=[i.primary.doc];$i(i.primary.doc,function(J){return S.push(J)});for(var N=0;N<i.markers.length;N++){var Q=i.markers[N];Se(S,Q.doc)==-1&&(Q.parent=null,i.markers.splice(N--,1))}},n=0;n<e.length;n++)t(n)}var Tl=0,Bn=function(e,t,n,r,i){if(!(this instanceof Bn))return new Bn(e,t,n,r,i);n==null&&(n=0),ao.call(this,[new io([new Pi("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var S=tt(n,0);this.sel=ui(S),this.history=new Mo(null),this.id=++Tl,this.modeOption=t,this.lineSep=r,this.direction=i=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),ts(this,{from:S,to:S,text:e}),Cn(this,ui(S),_e)};Bn.prototype=B(ao.prototype,{constructor:Bn,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=Gr(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:Zr(function(e){var t=tt(this.first,0),n=this.first+this.size-1;Oa(this,{from:t,to:tt(n,Et(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Yi(this.cm,0,0),Cn(this,ui(t),_e)}),replaceRange:function(e,t,n,r){t=jt(this,t),n=n?jt(this,n):t,Ma(this,e,t,n,r)},getRange:function(e,t,n){var r=sr(this,jt(this,e),jt(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(pn(this,e))return Et(this,e)},getLineNumber:function(e){return Ht(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=Et(this,e)),Tn(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return jt(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:Zr(function(e,t,n){As(this,jt(this,typeof e=="number"?tt(e,t||0):e),null,n)}),setSelection:Zr(function(e,t,n){As(this,jt(this,e),jt(this,t||e),n)}),extendSelection:Zr(function(e,t,n){Lo(this,jt(this,e),t&&jt(this,t),n)}),extendSelections:Zr(function(e,t){Ss(this,st(this,e),t)}),extendSelectionsBy:Zr(function(e,t){var n=M(this.sel.ranges,e);Ss(this,st(this,n),t)}),setSelections:Zr(function(e,t,n){if(!e.length)return;for(var r=[],i=0;i<e.length;i++)r[i]=new Cr(jt(this,e[i].anchor),jt(this,e[i].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),Cn(this,Jn(this.cm,r,t),n)}),addSelection:Zr(function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new Cr(jt(this,e),jt(this,t||e))),Cn(this,Jn(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=sr(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=sr(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:Zr(function(e,t,n){for(var r=[],i=this.sel,S=0;S<i.ranges.length;S++){var N=i.ranges[S];r[S]={from:N.from(),to:N.to(),text:this.splitLines(e[S]),origin:n}}for(var Q=t&&t!="end"&&Oo(this,r,t),J=r.length-1;J>=0;J--)Oa(this,r[J]);Q?Ts(this,Q):this.cm&&Xi(this.cm)}),undo:Zr(function(){_o(this,"undo")}),redo:Zr(function(){_o(this,"redo")}),undoSelection:Zr(function(){_o(this,"undo",!0)}),redoSelection:Zr(function(){_o(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 Mo(this.history.maxGeneration),$i(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:Da(this.history.done),undone:Da(this.history.undone)}},setHistory:function(e){var t=this.history=new Mo(this.history.maxGeneration);t.done=Da(e.done.slice(0),null,!0),t.undone=Da(e.undone.slice(0),null,!0)},setGutterMarker:Zr(function(e,t,n){return no(this,e,"gutter",function(r){var i=r.gutterMarkers||(r.gutterMarkers={});return i[t]=n,!n&&Ze(i)&&(r.gutterMarkers=null),!0})}),clearGutter:Zr(function(e){var t=this;this.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&no(t,n,"gutter",function(){return n.gutterMarkers[e]=null,Ze(n.gutterMarkers)&&(n.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!pn(this,e))return null;if(t=e,e=Et(this,e),!e)return null}else if(t=Ht(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:Zr(function(e,t,n){return no(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(v(n).test(r[i]))return!1;r[i]+=" "+n}return!0})}),removeLineClass:Zr(function(e,t,n){return no(this,e,t=="gutter"?"gutter":"class",function(r){var i=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",S=r[i];if(S)if(n==null)r[i]=null;else{var N=S.match(v(n));if(!N)return!1;var Q=N.index+N[0].length;r[i]=S.slice(0,N.index)+(!N.index||Q==S.length?"":" ")+S.slice(Q)||null}else return!1;return!0})}),addLineWidget:Zr(function(e,t,n){return xl(this,e,t,n)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return ka(this,jt(this,e),jt(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=jt(this,e),ka(this,e,e,n,"bookmark")},findMarksAt:function(e){e=jt(this,e);var t=[],n=Et(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=jt(this,e),t=jt(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,function(S){var N=S.markedSpans;if(N)for(var Q=0;Q<N.length;Q++){var J=N[Q];!(J.to!=null&&i==e.line&&e.ch>=J.to||J.from==null&&i!=e.line||J.from!=null&&i==t.line&&J.from>=t.ch)&&(!n||n(J.marker))&&r.push(J.marker.parent||J.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 S=i.text.length+r;if(S>e)return t=e,!0;e-=S,++n}),jt(this,tt(n,t))},indexFromPos:function(e){e=jt(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 Bn(Gr(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 Bn(Gr(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}],Sl(r,Fs(this)),r},unlinkDoc:function(e){if(e instanceof Kr&&(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),Al(Fs(this));break}if(e.history==this.history){var r=[e.id];$i(e,function(i){return r.push(i.id)},!0),e.history=new Mo(null),e.history.done=Da(this.history.done,r),e.history.undone=Da(this.history.undone,r)}},iterLinkedDocs:function(e){$i(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Ct(e)},lineSeparator:function(){return this.lineSep||`
`},setDirection:Zr(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&fl(this.cm)})}),Bn.prototype.eachLine=Bn.prototype.iter;var js=0;function wl(e){var t=this;if(Ws(t),Z(t,e)||si(t.display,e))return;ee(e),W&&(js=+new Date);var n=rn(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,S=Array(i),N=0,Q=function(){++N==i&&Jr(t,function(){n=jt(t.doc,n);var Le={from:n,to:n,text:t.doc.splitLines(S.filter(function(Ve){return Ve!=null}).join(t.doc.lineSeparator())),origin:"paste"};Oa(t.doc,Le),Ts(t.doc,ui(jt(t.doc,n),jt(t.doc,di(Le))))})()},J=function(Le,Ve){if(t.options.allowDropFileTypes&&Se(t.options.allowDropFileTypes,Le.type)==-1){Q();return}var et=new FileReader;et.onerror=function(){return Q()},et.onload=function(){var ut=et.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(ut)){Q();return}S[Ve]=ut,Q()},et.readAsText(Le)},re=0;re<r.length;re++)J(r[re],re);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 ye=e.dataTransfer.getData("Text");if(ye){var Ce;if(t.state.draggingText&&!t.state.draggingText.copy&&(Ce=t.listSelections()),Io(t.doc,ui(n,n)),Ce)for(var Pe=0;Pe<Ce.length;++Pe)Ma(t.doc,"",Ce[Pe].anchor,Ce[Pe].head,"drag");t.replaceSelection(ye,"around","paste"),t.display.input.focus()}}catch(Le){}}}function Dl(e,t){if(W&&(!e.state.draggingText||+new Date-js<100)){pe(t);return}if(Z(e,t)||si(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!I){var n=o("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",E&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),E&&n.parentNode.removeChild(n)}}function Rl(e,t){var n=rn(e,t);if(!n)return;var r=document.createDocumentFragment();xi(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)),c(e.display.dragCursor,r)}function Ws(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Hs(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),n=[],r=0;r<t.length;r++){var i=t[r].CodeMirror;i&&n.push(i)}n.length&&n[0].operation(function(){for(var S=0;S<n.length;S++)e(n[S])})}var Ks=!1;function Ol(){if(Ks)return;Ml(),Ks=!0}function Ml(){var e;Ne(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Hs(kl)},100))}),Ne(window,"blur",function(){return Hs(Qi)})}function kl(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var ta={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"},lo=0;lo<10;lo++)ta[lo+48]=ta[lo+96]=String(lo);for(var No=65;No<=90;No++)ta[No]=String.fromCharCode(No);for(var uo=1;uo<=12;uo++)ta[uo+111]=ta[uo+63235]="F"+uo;var ji={};ji.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"},ji.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"},ji.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"},ji.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"]},ji.default=l?ji.macDefault:ji.pcDefault;function Ll(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var n,r,i,S,N=0;N<t.length-1;N++){var Q=t[N];if(/^(cmd|meta|m)$/i.test(Q))S=!0;else if(/^a(lt)?$/i.test(Q))n=!0;else if(/^(c|ctrl|control)$/i.test(Q))r=!0;else if(/^s(hift)?$/i.test(Q))i=!0;else throw new Error("Unrecognized modifier name: "+Q)}return n&&(e="Alt-"+e),r&&(e="Ctrl-"+e),S&&(e="Cmd-"+e),i&&(e="Shift-"+e),e}function Il(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=M(n.split(" "),Ll),S=0;S<i.length;S++){var N=void 0,Q=void 0;S==i.length-1?(Q=i.join(" "),N=r):(Q=i.slice(0,S+1).join(" "),N="...");var J=t[Q];if(!J)t[Q]=N;else if(J!=N)throw new Error("Inconsistent bindings for "+Q)}delete e[n]}for(var re in t)e[re]=t[re];return e}function La(e,t,n,r){t=Bo(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 La(e,t.fallthrough,n,r);for(var S=0;S<t.fallthrough.length;S++){var N=La(e,t.fallthrough[S],n,r);if(N)return N}}}function zs(e){var t=typeof e=="string"?e:ta[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function Gs(e,t,n){var r=e;return t.altKey&&r!="Alt"&&(e="Alt-"+e),(f?t.metaKey:t.ctrlKey)&&r!="Ctrl"&&(e="Ctrl-"+e),(f?t.ctrlKey:t.metaKey)&&r!="Mod"&&(e="Cmd-"+e),!n&&t.shiftKey&&r!="Shift"&&(e="Shift-"+e),e}function Vs(e,t){if(E&&e.keyCode==34&&e.char)return!1;var n=ta[e.keyCode];return n==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(n=e.code),Gs(n,e,t))}function Bo(e){return typeof e=="string"?ji[e]:e}function Ia(e,t){for(var n=e.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var S=t(n[i]);r.length&&Ot(S.from,R(r).to)<=0;){var N=r.pop();if(Ot(N.from,S.from)<0){S.from=N.from;break}}r.push(S)}Rn(e,function(){for(var Q=r.length-1;Q>=0;Q--)Ma(e.doc,"",r[Q].from,r[Q].to,"+delete");Xi(e)})}function as(e,t,n){var r=Xe(e.text,t+n,n);return r<0||r>e.text.length?null:r}function os(e,t,n){var r=as(e,t.ch,n);return r==null?null:new tt(t.line,r,n<0?"after":"before")}function ss(e,t,n,r,i){if(e){t.doc.direction=="rtl"&&(i=-i);var S=lt(n,t.doc.direction);if(S){var N=i<0?R(S):S[0],Q=i<0==(N.level==1),J=Q?"after":"before",re;if(N.level>0||t.doc.direction=="rtl"){var ye=Te(t,n);re=i<0?n.text.length-1:0;var Ce=Ie(t,ye,re).top;re=dt(function(Pe){return Ie(t,ye,Pe).top==Ce},i<0==(N.level==1)?N.from:N.to-1,re),J=="before"&&(re=as(n,re,1))}else re=i<0?N.to:N.from;return new tt(r,re,J)}}return new tt(r,i<0?n.text.length:0,i<0?"before":"after")}function Pl(e,t,n,r){var i=lt(t,e.doc.direction);if(!i)return os(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 S=at(i,n.ch,n.sticky),N=i[S];if(e.doc.direction=="ltr"&&N.level%2==0&&(r>0?N.to>n.ch:N.from<n.ch))return os(t,n,r);var Q=function(vt,St){return as(t,vt instanceof tt?vt.ch:vt,St)},J,re=function(vt){return e.options.lineWrapping?(J=J||Te(e,t),wt(e,t,J,vt)):{begin:0,end:t.text.length}},ye=re(n.sticky=="before"?Q(n,-1):n.ch);if(e.doc.direction=="rtl"||N.level==1){var Ce=N.level==1==r<0,Pe=Q(n,Ce?1:-1);if(Pe!=null&&(Ce?Pe<=N.to&&Pe<=ye.end:Pe>=N.from&&Pe>=ye.begin)){var Le=Ce?"before":"after";return new tt(n.line,Pe,Le)}}var Ve=function(vt,St,yt){for(var At=function(Nr,hn){return hn?new tt(n.line,Q(Nr,1),"before"):new tt(n.line,Nr,"after")};vt>=0&&vt<i.length;vt+=St){var Bt=i[vt],It=St>0==(Bt.level!=1),rr=It?yt.begin:Q(yt.end,-1);if(Bt.from<=rr&&rr<Bt.to)return At(rr,It);if(rr=It?Bt.from:Q(Bt.to,-1),yt.begin<=rr&&rr<yt.end)return At(rr,It)}},et=Ve(S+r,r,ye);if(et)return et;var ut=r>0?ye.end:Q(ye.begin,-1);return ut!=null&&!(r>0&&ut==t.text.length)&&(et=Ve(r>0?0:i.length-1,r,re(ut)),et)?et:null}var co={selectAll:Ms,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),_e)},killLine:function(e){return Ia(e,function(t){if(t.empty()){var n=Et(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:tt(t.head.line+1,0)}:{from:t.head,to:tt(t.head.line,n)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Ia(e,function(t){return{from:tt(t.from().line,0),to:jt(e.doc,tt(t.to().line+1,0))}})},delLineLeft:function(e){return Ia(e,function(t){return{from:tt(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return Ia(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 Ia(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(tt(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(tt(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return Qs(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return Xs(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")},Ue)},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")},Ue)},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/)?Xs(e,t.head):r},Ue)},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 S=n[i].from(),N=se(e.getLine(S.line),S.ch,r);t.push(F(r-N%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Rn(e,function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++){if(!t[r].empty())continue;var i=t[r].head,S=Et(e.doc,i.line).text;if(S){if(i.ch==S.length&&(i=new tt(i.line,i.ch-1)),i.ch>0)i=new tt(i.line,i.ch+1),e.replaceRange(S.charAt(i.ch-1)+S.charAt(i.ch-2),tt(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var N=Et(e.doc,i.line-1).text;N&&(i=new tt(i.line,1),e.replaceRange(S.charAt(0)+e.doc.lineSeparator()+N.charAt(N.length-1),tt(i.line-1,N.length-1),i,"+transpose"))}}n.push(new Cr(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){return Rn(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);Xi(e)})},openLine:function(e){return e.replaceSelection(`
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Qs(e,t){var n=Et(e.doc,t),r=Tn(n);return r!=n&&(t=Ht(r)),ss(!0,e,r,t,1)}function _l(e,t){var n=Et(e.doc,t),r=va(n);return r!=n&&(t=Ht(r)),ss(!0,e,n,t,-1)}function Xs(e,t){var n=Qs(e,t.line),r=Et(e.doc,n.line),i=lt(r,e.doc.direction);if(!i||i[0].level==0){var S=Math.max(n.ch,r.text.search(/\S/)),N=t.line==n.line&&t.ch<=S&&t.ch;return tt(n.line,N?0:S,n.sticky)}return n}function Uo(e,t,n){if(typeof t=="string"&&(t=co[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)!=Je}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}function Nl(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=La(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&La(t,e.options.extraKeys,n,e)||La(t,e.options.keyMap,n,e)}var Bl=new fe;function ho(e,t,n,r){var i=e.state.keySeq;if(i){if(zs(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Bl.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),Ys(e,i+" "+t,n,r))return!0}return Ys(e,t,n,r)}function Ys(e,t,n,r){var i=Nl(e,t,r);return i=="multi"&&(e.state.keySeq=t),i=="handled"&&Qr(e,"keyHandled",e,t,n),(i=="handled"||i=="multi")&&(ee(n),nn(e)),!!i}function Js(e,t){var n=Vs(t,!0);return n?t.shiftKey&&!e.state.keySeq?ho(e,"Shift-"+n,t,function(r){return Uo(e,r,!0)})||ho(e,n,t,function(r){if(typeof r=="string"?/^go[A-Z]/.test(r):r.motion)return Uo(e,r)}):ho(e,n,t,function(r){return Uo(e,r)}):!1}function Ul(e,t,n){return ho(e,"'"+n+"'",t,function(r){return Uo(e,r,!0)})}var ls=null;function Zs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=_(),Z(t,e))return;W&&U<11&&e.keyCode==27&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=n==16||e.shiftKey;var r=Js(t,e);E&&(ls=r?n:null,!r&&n==88&&!Ut&&(l?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),O&&!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;z(t,"CodeMirror-crosshair");function n(r){(r.keyCode==18||!r.altKey)&&(h(t,"CodeMirror-crosshair"),qe(document,"keyup",n),qe(document,"mouseover",n))}Ne(document,"keyup",n),Ne(document,"mouseover",n)}function qs(e){e.keyCode==16&&(this.doc.sel.shift=!1),Z(this,e)}function $s(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(si(t.display,e)||Z(t,e)||e.ctrlKey&&!e.altKey||l&&e.metaKey)return;var n=e.keyCode,r=e.charCode;if(E&&n==ls){ls=null,ee(e);return}if(E&&(!e.which||e.which<10)&&Js(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,us=function(e,t,n){this.time=e,this.pos=t,this.button=n};us.prototype.compare=function(e,t,n){return this.time+jl>e&&Ot(t,this.pos)==0&&n==this.button};var fo,po;function Wl(e,t){var n=+new Date;return po&&po.compare(n,e,t)?(fo=po=null,"triple"):fo&&fo.compare(n,e,t)?(po=new us(n,e,t),fo=null,"double"):(fo=new us(n,e,t),po=null,"single")}function el(e){var t=this,n=t.display;if(Z(t,e)||n.activeTouch&&n.input.supportsTouch())return;if(n.input.ensurePolled(),n.shift=e.shiftKey,si(n,e)){P||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));return}if(ds(t,e))return;var r=rn(t,e),i=De(e),S=r?Wl(r,i):"single";if(window.focus(),i==1&&t.state.selectingText&&t.state.selectingText(e),r&&Hl(t,i,r,S,e))return;i==1?r?zl(t,r,S,e):xe(e)==n.scroller&&ee(e):i==2?(r&&Lo(t.doc,r),setTimeout(function(){return n.input.focus()},20)):i==3&&(D?t.display.input.onContextMenu(e):Ga(t))}function Hl(e,t,n,r,i){var S="Click";return r=="double"?S="Double"+S:r=="triple"&&(S="Triple"+S),S=(t==1?"Left":t==2?"Middle":"Right")+S,ho(e,Gs(S,i),i,function(N){if(typeof N=="string"&&(N=co[N]),!N)return!1;var Q=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),Q=N(e,n)!=Je}finally{e.state.suppressEdits=!1}return Q})}function Kl(e,t,n){var r=e.getOption("configureMouse"),i=r?r(e,t,n):{};if(i.unit==null){var S=s?n.shiftKey&&n.metaKey:n.altKey;i.unit=S?"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 zl(e,t,n,r){W?setTimeout(G(xo,e),0):e.curOp.focus=_();var i=Kl(e,n,r),S=e.doc.sel,N;e.options.dragDrop&&Be&&!e.isReadOnly()&&n=="single"&&(N=S.contains(t))>-1&&(Ot((N=S.ranges[N]).from(),t)<0||t.xRel>0)&&(Ot(N.to(),t)>0||t.xRel<0)?Gl(e,r,t,i):Vl(e,r,t,i)}function Gl(e,t,n,r){var i=e.display,S=!1,N=Jr(e,function(re){P&&(i.scroller.draggable=!1),e.state.draggingText=!1,qe(i.wrapper.ownerDocument,"mouseup",N),qe(i.wrapper.ownerDocument,"mousemove",Q),qe(i.scroller,"dragstart",J),qe(i.scroller,"drop",N),S||(ee(re),r.addNew||Lo(e.doc,n,null,null,r.extend),P&&!I||W&&U==9?setTimeout(function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()},20):i.input.focus())}),Q=function(re){S=S||Math.abs(t.clientX-re.clientX)+Math.abs(t.clientY-re.clientY)>=10},J=function(){return S=!0};P&&(i.scroller.draggable=!0),e.state.draggingText=N,N.copy=!r.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop(),Ne(i.wrapper.ownerDocument,"mouseup",N),Ne(i.wrapper.ownerDocument,"mousemove",Q),Ne(i.scroller,"dragstart",J),Ne(i.scroller,"drop",N),Ga(e),setTimeout(function(){return i.input.focus()},20)}function tl(e,t,n){if(n=="char")return new Cr(t,t);if(n=="word")return e.findWordAt(t);if(n=="line")return new Cr(tt(t.line,0),jt(e.doc,tt(t.line+1,0)));var r=n(e,t);return new Cr(r.from,r.to)}function Vl(e,t,n,r){var i=e.display,S=e.doc;ee(t);var N,Q,J=S.sel,re=J.ranges;if(r.addNew&&!r.extend?(Q=S.sel.contains(n),Q>-1?N=re[Q]:N=new Cr(n,n)):(N=S.sel.primary(),Q=S.sel.primIndex),r.unit=="rectangle")r.addNew||(N=new Cr(n,n)),n=rn(e,t,!0,!0),Q=-1;else{var ye=tl(e,n,r.unit);r.extend?N=ns(N,ye.anchor,ye.head,r.extend):N=ye}r.addNew?Q==-1?(Q=re.length,Cn(S,Jn(e,re.concat([N]),Q),{scroll:!1,origin:"*mouse"})):re.length>1&&re[Q].empty()&&r.unit=="char"&&!r.extend?(Cn(S,Jn(e,re.slice(0,Q).concat(re.slice(Q+1)),0),{scroll:!1,origin:"*mouse"}),J=S.sel):is(S,Q,N,Qe):(Q=0,Cn(S,new Mn([N],0),Qe),J=S.sel);var Ce=n;function Pe(yt){if(Ot(Ce,yt)==0)return;if(Ce=yt,r.unit=="rectangle"){for(var At=[],Bt=e.options.tabSize,It=se(Et(S,n.line).text,n.ch,Bt),rr=se(Et(S,yt.line).text,yt.ch,Bt),Nr=Math.min(It,rr),hn=Math.max(It,rr),zr=Math.min(n.line,yt.line),Kn=Math.min(e.lastLine(),Math.max(n.line,yt.line));zr<=Kn;zr++){var Un=Et(S,zr).text,$r=Fe(Un,Nr,Bt);Nr==hn?At.push(new Cr(tt(zr,$r),tt(zr,$r))):Un.length>$r&&At.push(new Cr(tt(zr,$r),tt(zr,Fe(Un,hn,Bt))))}At.length||At.push(new Cr(n,n)),Cn(S,Jn(e,J.ranges.slice(0,Q).concat(At),Q),{origin:"*mouse",scroll:!1}),e.scrollIntoView(yt)}else{var Fn=N,vn=tl(e,yt,r.unit),sn=Fn.anchor,en;Ot(vn.anchor,sn)>0?(en=vn.head,sn=zn(Fn.from(),vn.anchor)):(en=vn.anchor,sn=hi(Fn.to(),vn.head));var Yr=J.ranges.slice(0);Yr[Q]=Ql(e,new Cr(jt(S,sn),en)),Cn(S,Jn(e,Yr,Q),Qe)}}var Le=i.wrapper.getBoundingClientRect(),Ve=0;function et(yt){var At=++Ve,Bt=rn(e,yt,!0,r.unit=="rectangle");if(!Bt)return;if(Ot(Bt,Ce)!=0){e.curOp.focus=_(),Pe(Bt);var It=ba(i,S);(Bt.line>=It.to||Bt.line<It.from)&&setTimeout(Jr(e,function(){Ve==At&&et(yt)}),150)}else{var rr=yt.clientY<Le.top?-20:yt.clientY>Le.bottom?20:0;rr&&setTimeout(Jr(e,function(){if(Ve!=At)return;i.scroller.scrollTop+=rr,et(yt)}),50)}}function ut(yt){e.state.selectingText=!1,Ve=Infinity,yt&&(ee(yt),i.input.focus()),qe(i.wrapper.ownerDocument,"mousemove",vt),qe(i.wrapper.ownerDocument,"mouseup",St),S.history.lastSelOrigin=null}var vt=Jr(e,function(yt){yt.buttons===0||!De(yt)?ut(yt):et(yt)}),St=Jr(e,ut);e.state.selectingText=St,Ne(i.wrapper.ownerDocument,"mousemove",vt),Ne(i.wrapper.ownerDocument,"mouseup",St)}function Ql(e,t){var n=t.anchor,r=t.head,i=Et(e.doc,n.line);if(Ot(n,r)==0&&n.sticky==r.sticky)return t;var S=lt(i);if(!S)return t;var N=at(S,n.ch,n.sticky),Q=S[N];if(Q.from!=n.ch&&Q.to!=n.ch)return t;var J=N+(Q.from==n.ch==(Q.level!=1)?0:1);if(J==0||J==S.length)return t;var re;if(r.line!=n.line)re=(r.line-n.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var ye=at(S,r.ch,r.sticky),Ce=ye-N||(r.ch-n.ch)*(Q.level==1?-1:1);ye==J-1||ye==J?re=Ce<0:re=Ce>0}var Pe=S[J+(re?-1:0)],Le=re==(Pe.level==1),Ve=Le?Pe.from:Pe.to,et=Le?"after":"before";return n.ch==Ve&&n.sticky==et?t:new Cr(new tt(n.line,Ve,et),r)}function rl(e,t,n,r){var i,S;if(t.touches)i=t.touches[0].clientX,S=t.touches[0].clientY;else try{i=t.clientX,S=t.clientY}catch(Pe){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&ee(t);var N=e.display,Q=N.lineDiv.getBoundingClientRect();if(S>Q.bottom||!ne(e,n))return ce(t);S-=Q.top-N.viewOffset;for(var J=0;J<e.display.gutterSpecs.length;++J){var re=N.gutters.childNodes[J];if(re&&re.getBoundingClientRect().right>=i){var ye=vr(e.doc,S),Ce=e.display.gutterSpecs[J];return le(e,n,e,ye,Ce.className,t),ce(t)}}}function ds(e,t){return rl(e,t,"gutterClick",!0)}function nl(e,t){if(si(e.display,t)||Xl(e,t))return;if(Z(e,t,"contextmenu"))return;D||e.display.input.onContextMenu(t)}function Xl(e,t){return ne(e,"gutterContextMenu")?rl(e,t,"gutterContextMenu",!1):!1}function il(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Xt(e)}var Pa={toString:function(){return"CodeMirror.Init"}},al={},Fo={};function Yl(e){var t=e.optionHandlers;function n(r,i,S,N){e.defaults[r]=i,S&&(t[r]=N?function(Q,J,re){re!=Pa&&S(Q,J,re)}:S)}e.defineOption=n,e.Init=Pa,n("value","",function(r,i){return r.setValue(i)},!0),n("mode",null,function(r,i){r.doc.modeOption=i,Fi(r)},!0),n("indentUnit",2,Fi,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,function(r){to(r),Xt(r),Lr(r)},!0),n("lineSeparator",null,function(r,i){if(r.doc.lineSep=i,!i)return;var S=[],N=r.doc.first;r.doc.iter(function(J){for(var re=0;;){var ye=J.text.indexOf(i,re);if(ye==-1)break;re=ye+i.length,S.push(tt(N,ye))}N++});for(var Q=S.length-1;Q>=0;Q--)Ma(r.doc,i,S[Q],tt(S[Q].line,S[Q].ch+i.length))}),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(r,i,S){r.state.specialChars=new RegExp(i.source+(i.test(" ")?"":"| "),"g"),S!=Pa&&r.refresh()}),n("specialCharPlaceholder",Tr,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",!m),n("wholeLineUpdateBefore",!0),n("theme","default",function(r){il(r),li(r)},!0),n("keyMap","default",function(r,i,S){var N=Bo(i),Q=S!=Pa&&Bo(S);Q&&Q.detach&&Q.detach(r,N),N.attach&&N.attach(r,Q||null)}),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Zl,!0),n("gutters",[],function(r,i){r.display.gutterSpecs=On(i,r.options.lineNumbers),li(r)},!0),n("fixedGutter",!0,function(r,i){r.display.gutters.style.left=i?xn(r.display)+"px":"0",r.refresh()},!0),n("coverGutterNextToScrollbar",!1,function(r){return Ni(r)},!0),n("scrollbarStyle","native",function(r){Ca(r),Ni(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=On(r.options.gutters,i),li(r)},!0),n("firstLineNumber",1,li,!0),n("lineNumberFormatter",function(r){return r},li,!0),n("showCursorWhenSelecting",!1,Rr,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,function(r,i){i=="nocursor"&&(Qi(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,Rr,!0),n("singleCursorHeightPerLine",!0,Rr,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,to,!0),n("addModeClass",!1,to,!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,to,!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!=Pa;if(!t!=!r){var i=e.display.dragFunctions,S=t?Ne:qe;S(e.display.scroller,"dragstart",i.start),S(e.display.scroller,"dragenter",i.enter),S(e.display.scroller,"dragover",i.over),S(e.display.scroller,"dragleave",i.leave),S(e.display.scroller,"drop",i.drop)}}function Zl(e){e.options.lineWrapping?(z(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(h(e.display.wrapper,"CodeMirror-wrap"),sa(e)),Dn(e),Lr(e),Xt(e),setTimeout(function(){return Ni(e)},100)}function Kr(e,t){var n=this;if(!(this instanceof Kr))return new Kr(e,t);this.options=t=t?j(t):{},j(al,t,!1);var r=t.value;typeof r=="string"?r=new Bn(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new Kr.inputStyles[t.inputStyle](this),S=this.display=new fa(e,r,i,t);S.wrapper.CodeMirror=this,il(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Ca(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 fe,keySeq:null,specialChars:null},t.autofocus&&!a&&S.input.focus(),W&&U<11&&setTimeout(function(){return n.display.input.reset(!0)},20),ql(this),Ol(),Ai(this),this.curOp.forceUpdate=!0,vs(this,r),t.autofocus&&!a||this.hasFocus()?setTimeout(function(){n.hasFocus()&&!n.state.focused&&Ci(n)},20):Qi(this);for(var N in Fo)Fo.hasOwnProperty(N)&&Fo[N](this,t[N],Pa);an(this),t.finishInit&&t.finishInit(this);for(var Q=0;Q<cs.length;++Q)cs[Q](this);Bi(this),P&&t.lineWrapping&&getComputedStyle(S.lineDiv).textRendering=="optimizelegibility"&&(S.lineDiv.style.textRendering="auto")}Kr.defaults=al,Kr.optionHandlers=Fo;function ql(e){var t=e.display;Ne(t.scroller,"mousedown",Jr(e,el)),W&&U<11?Ne(t.scroller,"dblclick",Jr(e,function(J){if(Z(e,J))return;var re=rn(e,J);if(!re||ds(e,J)||si(e.display,J))return;ee(J);var ye=e.findWordAt(re);Lo(e.doc,ye.anchor,ye.head)})):Ne(t.scroller,"dblclick",function(J){return Z(e,J)||ee(J)}),Ne(t.scroller,"contextmenu",function(J){return nl(e,J)}),Ne(t.input.getField(),"contextmenu",function(J){t.scroller.contains(J.target)||nl(e,J)});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 S(J){if(J.touches.length!=1)return!1;var re=J.touches[0];return re.radiusX<=1&&re.radiusY<=1}function N(J,re){if(re.left==null)return!0;var ye=re.left-J.left,Ce=re.top-J.top;return ye*ye+Ce*Ce>20*20}Ne(t.scroller,"touchstart",function(J){if(!Z(e,J)&&!S(J)&&!ds(e,J)){t.input.ensurePolled(),clearTimeout(n);var re=+new Date;t.activeTouch={start:re,moved:!1,prev:re-r.end<=300?r:null},J.touches.length==1&&(t.activeTouch.left=J.touches[0].pageX,t.activeTouch.top=J.touches[0].pageY)}}),Ne(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Ne(t.scroller,"touchend",function(J){var re=t.activeTouch;if(re&&!si(t,J)&&re.left!=null&&!re.moved&&new Date-re.start<300){var ye=e.coordsChar(t.activeTouch,"page"),Ce;!re.prev||N(re,re.prev)?Ce=new Cr(ye,ye):!re.prev.prev||N(re,re.prev.prev)?Ce=e.findWordAt(ye):Ce=new Cr(tt(ye.line,0),jt(e.doc,tt(ye.line+1,0))),e.setSelection(Ce.anchor,Ce.head),e.focus(),ee(J)}i()}),Ne(t.scroller,"touchcancel",i),Ne(t.scroller,"scroll",function(){t.scroller.clientHeight&&(Ji(e,t.scroller.scrollTop),Xn(e,t.scroller.scrollLeft,!0),le(e,"scroll",e))}),Ne(t.scroller,"mousewheel",function(J){return $a(e,J)}),Ne(t.scroller,"DOMMouseScroll",function(J){return $a(e,J)}),Ne(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(J){Z(e,J)||pe(J)},over:function(J){Z(e,J)||(Rl(e,J),pe(J))},start:function(J){return Dl(e,J)},drop:Jr(e,wl),leave:function(J){Z(e,J)||Ws(e)}};var Q=t.input.getField();Ne(Q,"keyup",function(J){return qs.call(e,J)}),Ne(Q,"keydown",Jr(e,Zs)),Ne(Q,"keypress",Jr(e,$s)),Ne(Q,"focus",function(J){return Ci(e,J)}),Ne(Q,"blur",function(J){return Qi(e,J)})}var cs=[];Kr.defineInitHook=function(e){return cs.push(e)};function mo(e,t,n,r){var i=e.doc,S;n==null&&(n="add"),n=="smart"&&(i.mode.indent?S=In(e,t).state:n="prev");var N=e.options.tabSize,Q=Et(i,t),J=se(Q.text,null,N);Q.stateAfter&&(Q.stateAfter=null);var re=Q.text.match(/^\s*/)[0],ye;if(!r&&!/\S/.test(Q.text))ye=0,n="not";else if(n=="smart"&&(ye=i.mode.indent(S,Q.text.slice(re.length),Q.text),ye==Je||ye>150)){if(!r)return;n="prev"}n=="prev"?t>i.first?ye=se(Et(i,t-1).text,null,N):ye=0:n=="add"?ye=J+e.options.indentUnit:n=="subtract"?ye=J-e.options.indentUnit:typeof n=="number"&&(ye=J+n),ye=Math.max(0,ye);var Ce="",Pe=0;if(e.options.indentWithTabs)for(var Le=Math.floor(ye/N);Le;--Le)Pe+=N,Ce+=" ";if(Pe<ye&&(Ce+=F(ye-Pe)),Ce!=re)return Ma(i,Ce,tt(t,0),tt(t,re.length),"+input"),Q.stateAfter=null,!0;for(var Ve=0;Ve<i.sel.ranges.length;Ve++){var et=i.sel.ranges[Ve];if(et.head.line==t&&et.head.ch<re.length){var ut=tt(t,re.length);is(i,Ve,new Cr(ut,ut));break}}}var ci=null;function jo(e){ci=e}function hs(e,t,n,r,i){var S=e.doc;e.display.shift=!1,r||(r=S.sel);var N=+new Date-200,Q=i=="paste"||e.state.pasteIncoming>N,J=Ct(t),re=null;if(Q&&r.ranges.length>1)if(ci&&ci.text.join(`
`)==t){if(r.ranges.length%ci.text.length==0){re=[];for(var ye=0;ye<ci.text.length;ye++)re.push(S.splitLines(ci.text[ye]))}}else J.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(re=M(J,function(vt){return[vt]}));for(var Ce=e.curOp.updateInput,Pe=r.ranges.length-1;Pe>=0;Pe--){var Le=r.ranges[Pe],Ve=Le.from(),et=Le.to();Le.empty()&&(n&&n>0?Ve=tt(Ve.line,Ve.ch-n):e.state.overwrite&&!Q?et=tt(et.line,Math.min(Et(S,et.line).text.length,et.ch+R(J).length)):Q&&ci&&ci.lineWise&&ci.text.join(`
`)==J.join(`
`)&&(Ve=et=tt(Ve.line,0)));var ut={from:Ve,to:et,text:re?re[Pe%re.length]:J,origin:i||(Q?"paste":e.state.cutIncoming>N?"cut":"+input")};Oa(e.doc,ut),Qr(e,"inputRead",e,ut)}t&&!Q&&sl(e,t),Xi(e),e.curOp.updateInput<2&&(e.curOp.updateInput=Ce),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function ol(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Rn(t,function(){return hs(t,n,0,null,"paste")}),!0}function sl(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 S=e.getModeAt(i.head),N=!1;if(S.electricChars){for(var Q=0;Q<S.electricChars.length;Q++)if(t.indexOf(S.electricChars.charAt(Q))>-1){N=mo(e,i.head.line,"smart");break}}else S.electricInput&&(S.electricInput.test(Et(e.doc,i.head.line).text.slice(0,i.head.ch))&&(N=mo(e,i.head.line,"smart")));N&&Qr(e,"electricInput",e,i.head.line)}}function ll(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,S={anchor:tt(i,0),head:tt(i+1,0)};n.push(S),t.push(e.getRange(S.anchor,S.head))}return{text:t,ranges:n}}function ul(e,t,n,r){e.setAttribute("autocorrect",n?"":"off"),e.setAttribute("autocapitalize",r?"":"off"),e.setAttribute("spellcheck",!!t)}function dl(){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 P?e.style.width="1000px":e.setAttribute("wrap","off"),y&&(e.style.border="1px solid black"),ul(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 S=this.options,N=S[r];if(S[r]==i&&r!="mode")return;S[r]=i,t.hasOwnProperty(r)&&Jr(this,t[r])(this,i,N),le(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"](Bo(r))},removeKeyMap:function(r){for(var i=this.state.keyMaps,S=0;S<i.length;++S)if(i[S]==r||i[S].name==r)return i.splice(S,1),!0},addOverlay:gn(function(r,i){var S=r.token?r:e.getMode(this.options,r);if(S.startState)throw new Error("Overlays may not be stateful.");K(this.state.overlays,{mode:S,modeSpec:r,opaque:i&&i.opaque,priority:i&&i.priority||0},function(N){return N.priority}),this.state.modeGen++,Lr(this)}),removeOverlay:gn(function(r){for(var i=this.state.overlays,S=0;S<i.length;++S){var N=i[S].modeSpec;if(N==r||typeof r=="string"&&N.name==r){i.splice(S,1),this.state.modeGen++,Lr(this);return}}}),indentLine:gn(function(r,i,S){typeof i!="string"&&typeof i!="number"&&(i==null?i=this.options.smartIndent?"smart":"prev":i=i?"add":"subtract"),pn(this.doc,r)&&mo(this,r,i,S)}),indentSelection:gn(function(r){for(var i=this.doc.sel.ranges,S=-1,N=0;N<i.length;N++){var Q=i[N];if(Q.empty())Q.head.line>S&&(mo(this,Q.head.line,r,!0),S=Q.head.line,N==this.doc.sel.primIndex&&Xi(this));else{var J=Q.from(),re=Q.to(),ye=Math.max(S,J.line);S=Math.min(this.lastLine(),re.line-(re.ch?0:1))+1;for(var Ce=ye;Ce<S;++Ce)mo(this,Ce,r);var Pe=this.doc.sel.ranges;J.ch==0&&i.length==Pe.length&&Pe[N].from().ch>0&&is(this.doc,N,new Cr(J,Pe[N].to()),_e)}}}),getTokenAt:function(r,i){return Mi(this,r,i)},getLineTokens:function(r,i){return Mi(this,tt(r),i,!0)},getTokenTypeAt:function(r){r=jt(this.doc,r);var i=ni(this,Et(this.doc,r.line)),S=0,N=(i.length-1)/2,Q=r.ch,J;if(Q==0)J=i[2];else for(;;){var re=S+N>>1;if((re?i[re*2-1]:0)>=Q)N=re;else if(i[re*2+1]<Q)S=re+1;else{J=i[re*2+2];break}}var ye=J?J.indexOf("overlay "):-1;return ye<0?J:ye==0?null:J.slice(0,ye-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 S=[];if(!n.hasOwnProperty(i))return S;var N=n[i],Q=this.getModeAt(r);if(typeof Q[i]=="string")N[Q[i]]&&S.push(N[Q[i]]);else if(Q[i])for(var J=0;J<Q[i].length;J++){var re=N[Q[i][J]];re&&S.push(re)}else Q.helperType&&N[Q.helperType]?S.push(N[Q.helperType]):N[Q.name]&&S.push(N[Q.name]);for(var ye=0;ye<N._global.length;ye++){var Ce=N._global[ye];Ce.pred(Q,this)&&Se(S,Ce.val)==-1&&S.push(Ce.val)}return S},getStateAfter:function(r,i){var S=this.doc;return r=fi(S,r==null?S.first+S.size-1:r),In(this,r+1,i).state},cursorCoords:function(r,i){var S,N=this.doc.sel.primary();return r==null?S=N.head:typeof r=="object"?S=jt(this.doc,r):S=r?N.from():N.to(),or(this,S,i||"page")},charCoords:function(r,i){return Ur(this,jt(this.doc,r),i||"page")},coordsChar:function(r,i){return r=ar(this,r,i||"page"),lr(this,r.left,r.top)},lineAtHeight:function(r,i){return r=ar(this,{top:r,left:0},i||"page").top,vr(this.doc,r+this.display.viewOffset)},heightAtLine:function(r,i,S){var N=!1,Q;if(typeof r=="number"){var J=this.doc.first+this.doc.size-1;r<this.doc.first?r=this.doc.first:r>J&&(r=J,N=!0),Q=Et(this.doc,r)}else Q=r;return fr(this,Q,{top:0,left:0},i||"page",S||N).top+(N?this.doc.height-Wn(Q):0)},defaultTextHeight:function(){return Xr(this.display)},defaultCharWidth:function(){return tn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,i,S,N,Q){var J=this.display;r=or(this,jt(this.doc,r));var re=r.bottom,ye=r.left;if(i.style.position="absolute",i.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(i),J.sizer.appendChild(i),N=="over")re=r.top;else if(N=="above"||N=="near"){var Ce=Math.max(J.wrapper.clientHeight,this.doc.height),Pe=Math.max(J.sizer.clientWidth,J.lineSpace.clientWidth);(N=="above"||r.bottom+i.offsetHeight>Ce)&&r.top>i.offsetHeight?re=r.top-i.offsetHeight:r.bottom+i.offsetHeight<=Ce&&(re=r.bottom),ye+i.offsetWidth>Pe&&(ye=Pe-i.offsetWidth)}i.style.top=re+"px",i.style.left=i.style.right="",Q=="right"?(ye=J.sizer.clientWidth-i.offsetWidth,i.style.right="0px"):(Q=="left"?ye=0:Q=="middle"&&(ye=(J.sizer.clientWidth-i.offsetWidth)/2),i.style.left=ye+"px"),S&&Co(this,{left:ye,top:re,right:ye+i.offsetWidth,bottom:re+i.offsetHeight})},triggerOnKeyDown:gn(Zs),triggerOnKeyPress:gn($s),triggerOnKeyUp:qs,triggerOnMouseDown:gn(el),execCommand:function(r){if(co.hasOwnProperty(r))return co[r].call(null,this)},triggerElectric:gn(function(r){sl(this,r)}),findPosH:function(r,i,S,N){var Q=1;i<0&&(Q=-1,i=-i);for(var J=jt(this.doc,r),re=0;re<i&&!(J=fs(this.doc,J,Q,S,N),J.hitSide);++re);return J},moveH:gn(function(r,i){var S=this;this.extendSelectionsBy(function(N){return S.display.shift||S.doc.extend||N.empty()?fs(S.doc,N.head,r,i,S.options.rtlMoveVisually):r<0?N.from():N.to()},Ue)}),deleteH:gn(function(r,i){var S=this.doc.sel,N=this.doc;S.somethingSelected()?N.replaceSelection("",null,"+delete"):Ia(this,function(Q){var J=fs(N,Q.head,r,i,!1);return r<0?{from:J,to:Q.head}:{from:Q.head,to:J}})}),findPosV:function(r,i,S,N){var Q=1,J=N;i<0&&(Q=-1,i=-i);for(var re=jt(this.doc,r),ye=0;ye<i;++ye){var Ce=or(this,re,"div");if(J==null?J=Ce.left:Ce.left=J,re=cl(this,Ce,Q,S),re.hitSide)break}return re},moveV:gn(function(r,i){var S=this,N=this.doc,Q=[],J=!this.display.shift&&!N.extend&&N.sel.somethingSelected();if(N.extendSelectionsBy(function(ye){if(J)return r<0?ye.from():ye.to();var Ce=or(S,ye.head,"div");ye.goalColumn!=null&&(Ce.left=ye.goalColumn),Q.push(Ce.left);var Pe=cl(S,Ce,r,i);return i=="page"&&ye==N.sel.primary()&&Xa(S,Ur(S,Pe,"div").top-Ce.top),Pe},Ue),Q.length)for(var re=0;re<N.sel.ranges.length;re++)N.sel.ranges[re].goalColumn=Q[re]}),findWordAt:function(r){var i=this.doc,S=Et(i,r.line).text,N=r.ch,Q=r.ch;if(S){var J=this.getHelper(r,"wordChars");(r.sticky=="before"||Q==S.length)&&N?--N:++Q;for(var re=S.charAt(N),ye=je(re,J)?function(Ce){return je(Ce,J)}:/\s/.test(re)?function(Ce){return/\s/.test(Ce)}:function(Ce){return!/\s/.test(Ce)&&!je(Ce)};N>0&&ye(S.charAt(N-1));)--N;for(;Q<S.length&&ye(S.charAt(Q));)++Q}return new Cr(tt(r.line,N),tt(r.line,Q))},toggleOverwrite:function(r){if(r!=null&&r==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?z(this.display.cursorDiv,"CodeMirror-overwrite"):h(this.display.cursorDiv,"CodeMirror-overwrite"),le(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==_()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:gn(function(r,i){Yi(this,r,i)}),getScrollInfo:function(){var r=this.display.scroller;return{left:r.scrollLeft,top:r.scrollTop,height:r.scrollHeight-Re(this)-this.display.barHeight,width:r.scrollWidth-Re(this)-this.display.barWidth,clientHeight:te(this),clientWidth:ve(this)}},scrollIntoView:gn(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:tt(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?Yo(this,r):ua(this,r.from,r.to,r.margin)}),setSize:gn(function(r,i){var S=this,N=function(J){return typeof J=="number"||/^\d+$/.test(String(J))?J+"px":J};r!=null&&(this.display.wrapper.style.width=N(r)),i!=null&&(this.display.wrapper.style.height=N(i)),this.options.lineWrapping&&Qt(this);var Q=this.display.viewFrom;this.doc.iter(Q,this.display.viewTo,function(J){if(J.widgets){for(var re=0;re<J.widgets.length;re++)if(J.widgets[re].noHScroll){Hr(S,Q,"widget");break}}++Q}),this.curOp.forceUpdate=!0,le(this,"refresh",this)}),operation:function(r){return Rn(this,r)},startOperation:function(){return Ai(this)},endOperation:function(){return Bi(this)},refresh:gn(function(){var r=this.display.cachedTextHeight;Lr(this),this.curOp.forceUpdate=!0,Xt(this),Yi(this,this.doc.scrollLeft,this.doc.scrollTop),Aa(this.display),(r==null||Math.abs(r-Xr(this.display))>.5||this.options.lineWrapping)&&Dn(this),le(this,"refresh",this)}),swapDoc:gn(function(r){var i=this.doc;return i.cm=null,this.state.selectingText&&this.state.selectingText(),vs(this,r),Xt(this),this.display.input.reset(),Yi(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,Qr(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}},ue(e),e.registerHelper=function(r,i,S){n.hasOwnProperty(r)||(n[r]=e[r]={_global:[]}),n[r][i]=S},e.registerGlobalHelper=function(r,i,S,N){e.registerHelper(r,i,N),n[r]._global.push({pred:S,val:N})}}function fs(e,t,n,r,i){var S=t,N=n,Q=Et(e,t.line),J=i&&e.direction=="rtl"?-n:n;function re(){var St=t.line+J;return St<e.first||St>=e.first+e.size?!1:(t=new tt(St,t.ch,t.sticky),Q=Et(e,St))}function ye(St){var yt;if(r=="codepoint"){var At=Q.text.charCodeAt(t.ch+(r>0?0:-1));isNaN(At)?yt=null:yt=new tt(t.line,Math.max(0,Math.min(Q.text.length,t.ch+n*(At>=55296&&At<56320?2:1))),-n)}else i?yt=Pl(e.cm,Q,t,n):yt=os(Q,t,n);if(yt==null)if(!St&&re())t=ss(i,e.cm,Q,t.line,J);else return!1;else t=yt;return!0}if(r=="char"||r=="codepoint")ye();else if(r=="column")ye(!0);else if(r=="word"||r=="group")for(var Ce=null,Pe=r=="group",Le=e.cm&&e.cm.getHelper(t,"wordChars"),Ve=!0;!(n<0&&!ye(!Ve));Ve=!1){var et=Q.text.charAt(t.ch)||`
`,ut=je(et,Le)?"w":Pe&&et==`
`?"n":!Pe||/\s/.test(et)?null:"p";if(Pe&&!Ve&&!ut&&(ut="s"),Ce&&Ce!=ut){n<0&&(n=1,ye(),t.sticky="after");break}if(ut&&(Ce=ut),n>0&&!ye(!Ve))break}var vt=Po(e,t,S,N,!0);return Ln(S,vt)&&(vt.hitSide=!0),vt}function cl(e,t,n,r){var i=e.doc,S=t.left,N;if(r=="page"){var Q=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),J=Math.max(Q-.5*Xr(e.display),3);N=(n>0?t.bottom:t.top)+n*J}else r=="line"&&(N=n>0?t.bottom+3:t.top-3);for(var re;!(re=lr(e,S,N),!re.outside);){if(n<0?N<=0:N>=i.height){re.hitSide=!0;break}N+=n*5}return re}var Ir=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new fe,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Ir.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;ul(i,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function S(Q){for(var J=Q.target;J;J=J.parentNode){if(J==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(J.className))break}return!1}Ne(i,"paste",function(Q){if(!S(Q)||Z(r,Q)||ol(Q,r))return;U<=11&&setTimeout(Jr(r,function(){return t.updateFromDOM()}),20)}),Ne(i,"compositionstart",function(Q){t.composing={data:Q.data,done:!1}}),Ne(i,"compositionupdate",function(Q){t.composing||(t.composing={data:Q.data,done:!1})}),Ne(i,"compositionend",function(Q){t.composing&&(Q.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Ne(i,"touchstart",function(){return n.forceCompositionEnd()}),Ne(i,"input",function(){t.composing||t.readFromDOMSoon()});function N(Q){if(!S(Q)||Z(r,Q))return;if(r.somethingSelected())jo({lineWise:!1,text:r.getSelections()}),Q.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var J=ll(r);jo({lineWise:!0,text:J.text}),Q.type=="cut"&&r.operation(function(){r.setSelections(J.ranges,0,_e),r.replaceSelection("",null,"cut")})}else return;if(Q.clipboardData){Q.clipboardData.clearData();var re=ci.text.join(`
`);if(Q.clipboardData.setData("Text",re),Q.clipboardData.getData("Text")==re){Q.preventDefault();return}}var ye=dl(),Ce=ye.firstChild;r.display.lineSpace.insertBefore(ye,r.display.lineSpace.firstChild),Ce.value=ci.text.join(`
`);var Pe=document.activeElement;oe(Ce),setTimeout(function(){r.display.lineSpace.removeChild(ye),Pe.focus(),Pe==i&&n.showPrimarySelection()},50)}Ne(i,"copy",N),Ne(i,"cut",N)},Ir.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Ir.prototype.prepareSelection=function(){var e=ti(this.cm,!1);return e.focus=document.activeElement==this.div,e},Ir.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Ir.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Ir.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 S=Wo(t,e.anchorNode,e.anchorOffset),N=Wo(t,e.focusNode,e.focusOffset);if(S&&!S.bad&&N&&!N.bad&&Ot(zn(S,N),r)==0&&Ot(hi(S,N),i)==0)return;var Q=t.display.view,J=r.line>=t.display.viewFrom&&hl(t,r)||{node:Q[0].measure.map[2],offset:0},re=i.line<t.display.viewTo&&hl(t,i);if(!re){var ye=Q[Q.length-1].measure,Ce=ye.maps?ye.maps[ye.maps.length-1]:ye.map;re={node:Ce[Ce.length-1],offset:Ce[Ce.length-2]-Ce[Ce.length-3]}}if(!J||!re){e.removeAllRanges();return}var Pe=e.rangeCount&&e.getRangeAt(0),Le;try{Le=g(J.node,J.offset,re.offset,re.node)}catch(Ve){}Le&&(!O&&t.state.focused?(e.collapse(J.node,J.offset),Le.collapsed||(e.removeAllRanges(),e.addRange(Le))):(e.removeAllRanges(),e.addRange(Le)),Pe&&e.anchorNode==null?e.addRange(Pe):O&&this.startGracePeriod()),this.rememberSelection()},Ir.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)},Ir.prototype.showMultipleSelections=function(e){c(this.cm.display.cursorDiv,e.cursors),c(this.cm.display.selectionDiv,e.selection)},Ir.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Ir.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return C(this.div,t)},Ir.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Ir.prototype.blur=function(){this.div.blur()},Ir.prototype.getField=function(){return this.div},Ir.prototype.supportsTouch=function(){return!0},Ir.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Rn(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)},Ir.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Ir.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(u&&b&&this.cm.display.gutterSpecs.length&&eu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();var n=Wo(t,e.anchorNode,e.anchorOffset),r=Wo(t,e.focusNode,e.focusOffset);n&&r&&Rn(t,function(){Cn(t.doc,ui(n,r),_e),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)})},Ir.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=tt(r.line-1,Et(e.doc,r.line-1).length)),i.ch==Et(e.doc,i.line).text.length&&i.line<e.lastLine()&&(i=tt(i.line+1,0)),r.line<t.viewFrom||i.line>t.viewTo-1)return!1;var S,N,Q;r.line==t.viewFrom||(S=_r(e,r.line))==0?(N=Ht(t.view[0].line),Q=t.view[0].node):(N=Ht(t.view[S].line),Q=t.view[S-1].node.nextSibling);var J=_r(e,i.line),re,ye;if(J==t.view.length-1?(re=t.viewTo-1,ye=t.lineDiv.lastChild):(re=Ht(t.view[J+1].line)-1,ye=t.view[J+1].node.previousSibling),!Q)return!1;for(var Ce=e.doc.splitLines(tu(e,Q,ye,N,re)),Pe=sr(e.doc,tt(N,0),tt(re,Et(e.doc,re).text.length));Ce.length>1&&Pe.length>1;)if(R(Ce)==R(Pe))Ce.pop(),Pe.pop(),re--;else if(Ce[0]==Pe[0])Ce.shift(),Pe.shift(),N++;else break;for(var Le=0,Ve=0,et=Ce[0],ut=Pe[0],vt=Math.min(et.length,ut.length);Le<vt&&et.charCodeAt(Le)==ut.charCodeAt(Le);)++Le;for(var St=R(Ce),yt=R(Pe),At=Math.min(St.length-(Ce.length==1?Le:0),yt.length-(Pe.length==1?Le:0));Ve<At&&St.charCodeAt(St.length-Ve-1)==yt.charCodeAt(yt.length-Ve-1);)++Ve;if(Ce.length==1&&Pe.length==1&&N==r.line)for(;Le&&Le>r.ch&&St.charCodeAt(St.length-Ve-1)==yt.charCodeAt(yt.length-Ve-1);)Le--,Ve++;Ce[Ce.length-1]=St.slice(0,St.length-Ve).replace(/^\u200b+/,""),Ce[0]=Ce[0].slice(Le).replace(/\u200b+$/,"");var Bt=tt(N,Le),It=tt(re,Pe.length?R(Pe).length-Ve:0);if(Ce.length>1||Ce[0]||Ot(Bt,It))return Ma(e.doc,Ce,Bt,It,"+input"),!0},Ir.prototype.ensurePolled=function(){this.forceCompositionEnd()},Ir.prototype.reset=function(){this.forceCompositionEnd()},Ir.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Ir.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)},Ir.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Rn(this.cm,function(){return Lr(e.cm)})},Ir.prototype.setUneditable=function(e){e.contentEditable="false"},Ir.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||Jr(this.cm,hs)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Ir.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Ir.prototype.onContextMenu=function(){},Ir.prototype.resetPosition=function(){},Ir.prototype.needsContentAttribute=!0;function hl(e,t){var n=Me(e,t.line);if(!n||n.hidden)return null;var r=Et(e.doc,t.line),i=ae(n,r,t.line),S=lt(r,e.doc.direction),N="left";if(S){var Q=at(S,t.ch);N=Q%2?"right":"left"}var J=it(i.map,t.ch,N);return J.offset=J.collapse=="right"?J.end:J.start,J}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function _a(e,t){return t&&(e.bad=!0),e}function tu(e,t,n,r,i){var S="",N=!1,Q=e.doc.lineSeparator(),J=!1;function re(Le){return function(Ve){return Ve.id==Le}}function ye(){N&&(S+=Q,J&&(S+=Q),N=J=!1)}function Ce(Le){Le&&(ye(),S+=Le)}function Pe(Le){if(Le.nodeType==1){var Ve=Le.getAttribute("cm-text");if(Ve){Ce(Ve);return}var et=Le.getAttribute("cm-marker"),ut;if(et){var vt=e.findMarks(tt(r,0),tt(i+1,0),re(+et));vt.length&&(ut=vt[0].find(0))&&Ce(sr(e.doc,ut.from,ut.to).join(Q));return}if(Le.getAttribute("contenteditable")=="false")return;var St=/^(pre|div|p|li|table|br)$/i.test(Le.nodeName);if(!/^br$/i.test(Le.nodeName)&&Le.textContent.length==0)return;St&&ye();for(var yt=0;yt<Le.childNodes.length;yt++)Pe(Le.childNodes[yt]);/^(pre|p)$/i.test(Le.nodeName)&&(J=!0),St&&(N=!0)}else Le.nodeType==3&&Ce(Le.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(Pe(t),t==n);)t=t.nextSibling,J=!1;return S}function Wo(e,t,n){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[n],!r)return _a(e.clipPos(tt(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 S=e.display.view[i];if(S.node==r)return ru(S,t,n)}}function ru(e,t,n){var r=e.text.firstChild,i=!1;if(!t||!C(r,t))return _a(tt(Ht(e.line),0),!0);if(t==r&&(i=!0,t=r.childNodes[n],n=0,!t)){var S=e.rest?R(e.rest):e.line;return _a(tt(Ht(S),S.text.length),i)}var N=t.nodeType==3?t:null,Q=t;for(!N&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(N=t.firstChild,n&&(n=N.nodeValue.length));Q.parentNode!=r;)Q=Q.parentNode;var J=e.measure,re=J.maps;function ye(ut,vt,St){for(var yt=-1;yt<(re?re.length:0);yt++)for(var At=yt<0?J.map:re[yt],Bt=0;Bt<At.length;Bt+=3){var It=At[Bt+2];if(It==ut||It==vt){var rr=Ht(yt<0?e.line:e.rest[yt]),Nr=At[Bt]+St;return(St<0||It!=ut)&&(Nr=At[Bt+(St?1:0)]),tt(rr,Nr)}}}var Ce=ye(N,Q,n);if(Ce)return _a(Ce,i);for(var Pe=Q.nextSibling,Le=N?N.nodeValue.length-n:0;Pe;Pe=Pe.nextSibling){if(Ce=ye(Pe,Pe.firstChild,0),Ce)return _a(tt(Ce.line,Ce.ch-Le),i);Le+=Pe.textContent.length}for(var Ve=Q.previousSibling,et=n;Ve;Ve=Ve.previousSibling){if(Ce=ye(Ve,Ve.firstChild,-1),Ce)return _a(tt(Ce.line,Ce.ch+et),i);et+=Ve.textContent.length}}var qr=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new fe,this.hasSelection=!1,this.composing=null};qr.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),y&&(i.style.width="0px"),Ne(i,"input",function(){W&&U>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()}),Ne(i,"paste",function(N){if(Z(r,N)||ol(N,r))return;r.state.pasteIncoming=+new Date,n.fastPoll()});function S(N){if(Z(r,N))return;if(r.somethingSelected())jo({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var Q=ll(r);jo({lineWise:!0,text:Q.text}),N.type=="cut"?r.setSelections(Q.ranges,null,_e):(n.prevInput="",i.value=Q.text.join(`
`),oe(i))}else return;N.type=="cut"&&(r.state.cutIncoming=+new Date)}Ne(i,"cut",S),Ne(i,"copy",S),Ne(e.scroller,"paste",function(N){if(si(e,N)||Z(r,N))return;if(!i.dispatchEvent){r.state.pasteIncoming=+new Date,n.focus();return}var Q=new Event("paste");Q.clipboardData=N.clipboardData,i.dispatchEvent(Q)}),Ne(e.lineSpace,"selectstart",function(N){si(e,N)||ee(N)}),Ne(i,"compositionstart",function(){var N=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:N,range:r.markText(N,r.getCursor("to"),{className:"CodeMirror-composing"})}}),Ne(i,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},qr.prototype.createField=function(e){this.wrapper=dl(),this.textarea=this.wrapper.firstChild},qr.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},qr.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=ti(e);if(e.options.moveInputWithCursor){var i=or(e,n.sel.primary().head,"div"),S=t.wrapper.getBoundingClientRect(),N=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+N.top-S.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+N.left-S.left))}return r},qr.prototype.showSelection=function(e){var t=this.cm,n=t.display;c(n.cursorDiv,e.cursors),c(n.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},qr.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&oe(this.textarea),W&&U>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",W&&U>=9&&(this.hasSelection=null))},qr.prototype.getField=function(){return this.textarea},qr.prototype.supportsTouch=function(){return!1},qr.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!a||_()!=this.textarea))try{this.textarea.focus()}catch(e){}},qr.prototype.blur=function(){this.textarea.blur()},qr.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},qr.prototype.receivedFocus=function(){this.slowPoll()},qr.prototype.slowPoll=function(){var e=this;if(this.pollingFast)return;this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},qr.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function n(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,n)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,n)},qr.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||ot(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(W&&U>=9&&this.hasSelection===i||l&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var S=i.charCodeAt(0);if(S==8203&&!r&&(r="\u200B"),S==8666)return this.reset(),this.cm.execCommand("undo")}for(var N=0,Q=Math.min(r.length,i.length);N<Q&&r.charCodeAt(N)==i.charCodeAt(N);)++N;return Rn(t,function(){hs(t,i.slice(N),r.length-N,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},qr.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},qr.prototype.onKeyPress=function(){W&&U>=9&&(this.hasSelection=null),this.fastPoll()},qr.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var S=rn(n,e),N=r.scroller.scrollTop;if(!S||E)return;var Q=n.options.resetSelectionOnContextMenu;Q&&n.doc.sel.contains(S)==-1&&Jr(n,Cn)(n.doc,ui(S),_e);var J=i.style.cssText,re=t.wrapper.style.cssText,ye=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",i.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(e.clientY-ye.top-5)+"px; left: "+(e.clientX-ye.left-5)+`px;
z-index: 1000; background: `+(W?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Ce;P&&(Ce=window.scrollY),r.input.focus(),P&&window.scrollTo(null,Ce),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=Le,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll);function Pe(){if(i.selectionStart!=null){var et=n.somethingSelected(),ut="\u200B"+(et?i.value:"");i.value="\u21DA",i.value=ut,t.prevInput=et?"":"\u200B",i.selectionStart=1,i.selectionEnd=ut.length,r.selForContextMenu=n.doc.sel}}function Le(){if(t.contextMenuPending!=Le)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=re,i.style.cssText=J,W&&U<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=N),i.selectionStart!=null){(!W||W&&U<9)&&Pe();var et=0,ut=function(){r.selForContextMenu==n.doc.sel&&i.selectionStart==0&&i.selectionEnd>0&&t.prevInput=="\u200B"?Jr(n,Ms)(n):et++<10?r.detectingSelectAll=setTimeout(ut,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(ut,200)}}if(W&&U>=9&&Pe(),D){pe(e);var Ve=function(){qe(window,"mouseup",Ve),setTimeout(Le,20)};Ne(window,"mouseup",Ve)}else setTimeout(Le,50)},qr.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},qr.prototype.setUneditable=function(){},qr.prototype.needsContentAttribute=!1;function nu(e,t){if(t=t?j(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=_();t.autofocus=n==e||e.getAttribute("autofocus")!=null&&n==document.body}function r(){e.value=Q.getValue()}var i;if(e.form&&(Ne(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var S=e.form;i=S.submit;try{var N=S.submit=function(){r(),S.submit=i,S.submit(),S.submit=N}}catch(J){}}t.finishInit=function(J){J.save=r,J.getTextArea=function(){return e},J.toTextArea=function(){J.toTextArea=isNaN,r(),e.parentNode.removeChild(J.getWrapperElement()),e.style.display="",e.form&&(qe(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=i))}},e.style.display="none";var Q=Kr(function(J){return e.parentNode.insertBefore(J,e.nextSibling)},t);return Q}function iu(e){e.off=qe,e.on=Ne,e.wheelEventPixels=qa,e.Doc=Bn,e.splitLines=Ct,e.countColumn=se,e.findColumn=Fe,e.isWordChar=Oe,e.Pass=Je,e.signal=le,e.Line=Pi,e.changeEnd=di,e.scrollbarModel=Ya,e.Pos=tt,e.cmpPos=Ot,e.modes=Vt,e.mimeModes=bt,e.resolveMode=Tt,e.getMode=qt,e.modeExtensions=nt,e.extendMode=Or,e.copyState=ur,e.startState=ln,e.innerMode=Ar,e.commands=co,e.keyMap=ji,e.keyName=Vs,e.isModifierKey=zs,e.lookupKey=La,e.normalizeKeyMap=Il,e.StringStream=Mr,e.SharedTextMarker=so,e.TextMarker=ea,e.LineWidget=oo,e.e_preventDefault=ee,e.e_stopPropagation=ie,e.e_stop=pe,e.addClass=z,e.contains=C,e.rmClass=h,e.keyNames=ta}Yl(Kr),$l(Kr);var au="iter insert remove copy getEditor constructor".split(" ");for(var Ho in Bn.prototype)Bn.prototype.hasOwnProperty(Ho)&&Se(au,Ho)<0&&(Kr.prototype[Ho]=function(e){return function(){return e.apply(this.doc,arguments)}}(Bn.prototype[Ho]));return ue(Bn),Kr.inputStyles={textarea:qr,contenteditable:Ir},Kr.defineMode=function(e){!Kr.defaults.mode&&e!="null"&&(Kr.defaults.mode=e),cr.apply(this,arguments)},Kr.defineMIME=Gt,Kr.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Kr.defineMIME("text/plain","null"),Kr.defineExtension=function(e,t){Kr.prototype[e]=t},Kr.defineDocExtension=function(e,t){Bn.prototype[e]=t},Kr.fromTextArea=nu,iu(Kr),Kr.version="5.58.2",Kr})},W6BS:function(Ge,We){Ge.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAA4CAYAAACohjseAAAVs0lEQVRoQ+2aa6xlZ3nff++677Xv+9zPHM/YHo+xwQ4E14GKKESkiFsSM8bYQBIEkaBEAkqbRmo/9FulSoX2Qz9GVVQJqUJBhKKA1KRJCIlowwdDDDa+jOd65syc275f1v1d1fOufYYE2ZhJZKRWXjOjvffaa6/1/p//8/yfyzuqLMuS/48P9RrA/8fZfY3B2yXQBHQpf185tBUK+SvH8uV2H/eK1/+jGfwRIBC5ks/Vq/yplq2Wqz+B/ONg5LNlrlz+Qhnot373iih+wgX/YIAivrJgjTKA9BKcYa/Uy/MnUEpD0S2AyzdKkMslZYklbwVYWZpXQSygrSVoc+4fcPzUAKtsom4xpIGiLCkMZbJGs1LkvOHPfJbrhRX5/CM/NDwJZlXiqBKlc7AEjg1aI2iVDXZpoeS9AFXlkmV1W8z+VACLE7dbMiWLE2CFADLgqig6SakCSs4jizcvAvBHMVkqxxhKkePqAs8S1mxyLUxqw6AYKLdtbMtGINpiKKUM07bc96dk9BUBykIFoNYVC/JewMkCDDh18p0so6w+GzfT+FoWC7Yl11curQpFVCoyJQsvDThP6crNdVldi0KLcwogyzJGssVrxYWXAOWzwWg84eXd92UByoK0WHEJqBCA4oC6ChstYHRJIW6lZHWQlsoYQH6rypyOLZ5Xuahx3NIi1TAvLBIcHIlUw8rfcWFLFmzhmPBUxi0NKIRdAVi5qmPAL88LrS9z/AigmHBpCcOaCIUA1BVj4ma6LCi1FkjLBZRoVRrLR9piXjhkysI2mqJxhY2lQUrDjG3iVv5k5YmgyHI1ngLPBqfUxg21nC5LbGUhHJbGUPK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JW+Yiy+MnecrtIn/VAN7uQl6t618D+GpZ9md139cY/FlZ+tV6zmsMvlqW/Vnd9/8CAe3hZpCQX/4AAAAASUVORK5CYII="},WXWZ:function(Ge,We,X){Ge.exports={wrap:"wrap___2531V",modal:"modal___2xp2g",titleWrap:"titleWrap___2wAWv",required:"required___1bxIH",title:"title___1z-An",colorGray:"colorGray___2WTHC",choiceWrap:"choiceWrap___138fi",answer:"answer___3tvn_",activeAnswer:"activeAnswer___2tZlb",deleteIcon:"deleteIcon___3kRsA",addIcon:"addIcon___fCAgt",editorWrap:"editorWrap___2bMGJ",htmlWrap:"htmlWrap___172le",radio:"radio___3dYD3",color333:"color333___kjbnX",color999:"color999___23KyG",fold:"fold___mk6fa",head:"head___2zxz9"}},Xsq0:function(Ge,We,X){Ge.exports=X.p+"static/mainbanner.0a951716.jpg"},Y1PL:function(Ge,We,X){"use strict";X.r(We),X.d(We,"ResizableTextArea",function(){return Se});var de=X("wx14"),V=X("1OyB"),O=X("vuIU"),H=X("Ji7U"),A=X("LK+K"),k=X("q1tI"),W=X("VTBJ"),U=X("rePB"),P=X("Zm9Q"),L=X("Kwbf"),b=X("c+Xe"),E=X("m+aA"),I=X("bdgK"),w=new Map;function T(_e){_e.forEach(function(Qe){var Ue,Fe=Qe.target;(Ue=w.get(Fe))===null||Ue===void 0||Ue.forEach(function(we){return we(Fe)})})}var y=new I.default(T),u=null,a=null;function l(_e,Qe){w.has(_e)||(w.set(_e,new Set),y.observe(_e)),w.get(_e).add(Qe)}function s(_e,Qe){w.has(_e)&&(w.get(_e).delete(Qe),w.get(_e).size||(y.unobserve(_e),w.delete(_e)))}var m=function(_e){Object(H.a)(Ue,_e);var Qe=Object(A.a)(Ue);function Ue(){return Object(V.a)(this,Ue),Qe.apply(this,arguments)}return Object(O.a)(Ue,[{key:"render",value:function(){return this.props.children}}]),Ue}(k.Component),d=k.createContext(null);function f(_e){var Qe=_e.children,Ue=_e.onBatchResize,Fe=k.useRef(0),we=k.useRef([]),F=k.useContext(d),R=k.useCallback(function(M,K,$){Fe.current+=1;var B=Fe.current;we.current.push({size:M,element:K,data:$}),Promise.resolve().then(function(){B===Fe.current&&(Ue==null||Ue(we.current),we.current=[])}),F==null||F(M,K,$)},[Ue,F]);return k.createElement(d.Provider,{value:R},Qe)}function D(_e){var Qe=_e.children,Ue=_e.disabled,Fe=k.useRef(null),we=k.useRef(null),F=k.useContext(d),R=k.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),M=k.isValidElement(Qe)&&Object(b.c)(Qe),K=M?Qe.ref:null,$=k.useMemo(function(){return Object(b.a)(K,Fe)},[K,Fe]),B=k.useRef(_e);B.current=_e;var ge=k.useCallback(function(Oe){var je=B.current,Ze=je.onResize,He=je.data,ze=Oe.getBoundingClientRect(),Xe=ze.width,dt=ze.height,ct=Oe.offsetWidth,gt=Oe.offsetHeight,at=Math.floor(Xe),ft=Math.floor(dt);if(R.current.width!==at||R.current.height!==ft||R.current.offsetWidth!==ct||R.current.offsetHeight!==gt){var lt={width:at,height:ft,offsetWidth:ct,offsetHeight:gt};R.current=lt;var Ye=ct===Math.round(Xe)?Xe:ct,Ne=gt===Math.round(dt)?dt:gt,ht=Object(W.a)(Object(W.a)({},lt),{},{offsetWidth:Ye,offsetHeight:Ne});F==null||F(ht,Oe,He),Ze&&Promise.resolve().then(function(){Ze(ht,Oe)})}},[]);return k.useEffect(function(){var Oe=Object(E.a)(Fe.current)||Object(E.a)(we.current);return Oe&&!Ue&&l(Oe,ge),function(){return s(Oe,ge)}},[Fe.current,Ue]),k.createElement(m,{ref:we},M?k.cloneElement(Qe,{ref:$}):Qe)}var v="rc-observer-key";function h(_e){var Qe=_e.children,Ue=Object(P.a)(Qe);return Ue.map(function(Fe,we){var F=(Fe==null?void 0:Fe.key)||"".concat(v,"-").concat(we);return k.createElement(D,Object(de.a)({},_e,{key:F}),Fe)})}h.Collection=f;var p=h,c=X("bT9E"),o=X("TSYQ"),x=X.n(o),g=`
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
`,C=["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"],_={},z;function Y(_e){var Qe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ue=_e.getAttribute("id")||_e.getAttribute("data-reactid")||_e.getAttribute("name");if(Qe&&_[Ue])return _[Ue];var Fe=window.getComputedStyle(_e),we=Fe.getPropertyValue("box-sizing")||Fe.getPropertyValue("-moz-box-sizing")||Fe.getPropertyValue("-webkit-box-sizing"),F=parseFloat(Fe.getPropertyValue("padding-bottom"))+parseFloat(Fe.getPropertyValue("padding-top")),R=parseFloat(Fe.getPropertyValue("border-bottom-width"))+parseFloat(Fe.getPropertyValue("border-top-width")),M=C.map(function($){return"".concat($,":").concat(Fe.getPropertyValue($))}).join(";"),K={sizingStyle:M,paddingSize:F,borderSize:R,boxSizing:we};return Qe&&Ue&&(_[Ue]=K),K}function oe(_e){var Qe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ue=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Fe=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;z||(z=document.createElement("textarea"),z.setAttribute("tab-index","-1"),z.setAttribute("aria-hidden","true"),document.body.appendChild(z)),_e.getAttribute("wrap")?z.setAttribute("wrap",_e.getAttribute("wrap")):z.removeAttribute("wrap");var we=Y(_e,Qe),F=we.paddingSize,R=we.borderSize,M=we.boxSizing,K=we.sizingStyle;z.setAttribute("style","".concat(K,";").concat(g)),z.value=_e.value||_e.placeholder||"";var $=Number.MIN_SAFE_INTEGER,B=Number.MAX_SAFE_INTEGER,ge=z.scrollHeight,Oe;if(M==="border-box"?ge+=R:M==="content-box"&&(ge-=F),Ue!==null||Fe!==null){z.value=" ";var je=z.scrollHeight-F;Ue!==null&&($=je*Ue,M==="border-box"&&($=$+F+R),ge=Math.max($,ge)),Fe!==null&&(B=je*Fe,M==="border-box"&&(B=B+F+R),Oe=ge>B?"":"hidden",ge=Math.min(B,ge))}return{height:ge,minHeight:$,maxHeight:B,overflowY:Oe,resize:"none"}}var G=X("Gytx"),j=X.n(G),se;(function(_e){_e[_e.NONE=0]="NONE",_e[_e.RESIZING=1]="RESIZING",_e[_e.RESIZED=2]="RESIZED"})(se||(se={}));var fe=function(_e){Object(H.a)(Ue,_e);var Qe=Object(A.a)(Ue);function Ue(Fe){var we;return Object(V.a)(this,Ue),we=Qe.call(this,Fe),we.nextFrameActionId=void 0,we.resizeFrameId=void 0,we.textArea=void 0,we.saveTextArea=function(F){we.textArea=F},we.handleResize=function(F){var R=we.state.resizeStatus,M=we.props,K=M.autoSize,$=M.onResize;if(R!==se.NONE)return;typeof $=="function"&&$(F),K&&we.resizeOnNextFrame()},we.resizeOnNextFrame=function(){cancelAnimationFrame(we.nextFrameActionId),we.nextFrameActionId=requestAnimationFrame(we.resizeTextarea)},we.resizeTextarea=function(){var F=we.props.autoSize;if(!F||!we.textArea)return;var R=F.minRows,M=F.maxRows,K=oe(we.textArea,!1,R,M);we.setState({textareaStyles:K,resizeStatus:se.RESIZING},function(){cancelAnimationFrame(we.resizeFrameId),we.resizeFrameId=requestAnimationFrame(function(){we.setState({resizeStatus:se.RESIZED},function(){we.resizeFrameId=requestAnimationFrame(function(){we.setState({resizeStatus:se.NONE}),we.fixFirefoxAutoScroll()})})})})},we.renderTextArea=function(){var F=we.props,R=F.prefixCls,M=R===void 0?"rc-textarea":R,K=F.autoSize,$=F.onResize,B=F.className,ge=F.disabled,Oe=we.state,je=Oe.textareaStyles,Ze=Oe.resizeStatus,He=Object(c.a)(we.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),ze=x()(M,B,Object(U.a)({},"".concat(M,"-disabled"),ge));"value"in He&&(He.value=He.value||"");var Xe=Object(W.a)(Object(W.a)(Object(W.a)({},we.props.style),je),Ze===se.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return k.createElement(p,{onResize:we.handleResize,disabled:!(K||$)},k.createElement("textarea",Object(de.a)({},He,{className:ze,style:Xe,ref:we.saveTextArea})))},we.state={textareaStyles:{},resizeStatus:se.NONE},we}return Object(O.a)(Ue,[{key:"componentDidUpdate",value:function(we){(we.value!==this.props.value||!j()(we.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 we=this.textArea.selectionStart,F=this.textArea.selectionEnd;this.textArea.setSelectionRange(we,F)}}catch(R){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Ue}(k.Component),Se=fe,ke=function(_e){Object(H.a)(Ue,_e);var Qe=Object(A.a)(Ue);function Ue(Fe){var we;Object(V.a)(this,Ue),we=Qe.call(this,Fe),we.resizableTextArea=void 0,we.focus=function(){we.resizableTextArea.textArea.focus()},we.saveTextArea=function(R){we.resizableTextArea=R},we.handleChange=function(R){var M=we.props.onChange;we.setValue(R.target.value,function(){we.resizableTextArea.resizeTextarea()}),M&&M(R)},we.handleKeyDown=function(R){var M=we.props,K=M.onPressEnter,$=M.onKeyDown;R.keyCode===13&&K&&K(R),$&&$(R)};var F=typeof Fe.value=="undefined"||Fe.value===null?Fe.defaultValue:Fe.value;return we.state={value:F},we}return Object(O.a)(Ue,[{key:"setValue",value:function(we,F){"value"in this.props||this.setState({value:we},F)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return k.createElement(Se,Object(de.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(we){return"value"in we?{value:we.value}:null}}]),Ue}(k.Component),Je=We.default=ke},bT9E:function(Ge,We,X){"use strict";X.d(We,"a",function(){return V});var de=X("VTBJ");function V(O,H){var A=Object(de.a)({},O);return Array.isArray(H)&&H.forEach(function(k){delete A[k]}),A}},c5Ni:function(Ge,We,X){},cRFk:function(Ge,We,X){Ge.exports=X.p+"static/RepositoryNoneData.828085a8.png"},csWT:function(Ge,We,X){Ge.exports=X.p+"static/choose.4ad1045f.svg"},dejd:function(Ge,We,X){},djh8:function(Ge,We,X){Ge.exports=X.p+"static/qrCode.d852fdfc.png"},dmUQ:function(Ge,We,X){"use strict";var de=X("Ff2n"),V=X("rePB"),O=X("1OyB"),H=X("vuIU"),A=X("Ji7U"),k=X("md7G"),W=X("foSv"),U=X("q1tI"),P=X.n(U),L=X("TSYQ"),b=X.n(L),E=X("4IlW");function I(c,o){var x=Object.keys(c);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(c);o&&(g=g.filter(function(C){return Object.getOwnPropertyDescriptor(c,C).enumerable})),x.push.apply(x,g)}return x}function w(c){for(var o=1;o<arguments.length;o++){var x=arguments[o]!=null?arguments[o]:{};o%2?I(Object(x),!0).forEach(function(g){Object(V.a)(c,g,x[g])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(x)):I(Object(x)).forEach(function(g){Object.defineProperty(c,g,Object.getOwnPropertyDescriptor(x,g))})}return c}function T(c){var o=y();return function(){var g=Object(W.a)(c),C;if(o){var _=Object(W.a)(this).constructor;C=Reflect.construct(g,arguments,_)}else C=g.apply(this,arguments);return Object(k.a)(this,C)}}function y(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(c){return!1}}function u(){}function a(c){c.preventDefault()}var l=function(o){return o.replace(/[^\w.-]+/g,"")},s=200,m=600,d=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,f=function(o){return o!=null},D=function(o,x){return x===o||typeof x=="number"&&typeof o=="number"&&isNaN(x)&&isNaN(o)},v=function(c){Object(A.a)(x,c);var o=T(x);function x(g){var C;Object(O.a)(this,x),C=o.call(this,g),C.onKeyDown=function(Y){var oe=C.props,G=oe.onKeyDown,j=oe.onPressEnter;if(Y.keyCode===E.a.UP){var se=C.getRatio(Y);C.up(Y,se,null),C.stop()}else if(Y.keyCode===E.a.DOWN){var fe=C.getRatio(Y);C.down(Y,fe,null),C.stop()}else Y.keyCode===E.a.ENTER&&j&&j(Y);if(C.recordCursorPosition(),C.lastKeyCode=Y.keyCode,G){for(var Se=arguments.length,ke=new Array(Se>1?Se-1:0),Je=1;Je<Se;Je++)ke[Je-1]=arguments[Je];G.apply(void 0,[Y].concat(ke))}},C.onKeyUp=function(Y){var oe=C.props.onKeyUp;if(C.stop(),C.recordCursorPosition(),oe){for(var G=arguments.length,j=new Array(G>1?G-1:0),se=1;se<G;se++)j[se-1]=arguments[se];oe.apply(void 0,[Y].concat(j))}},C.onChange=function(Y){var oe=C.props.onChange;C.state.focused&&(C.inputting=!0),C.rawInput=C.props.parser(C.getValueFromEvent(Y)),C.setState({inputValue:C.rawInput}),oe(C.toNumber(C.rawInput))},C.onMouseUp=function(){var Y=C.props.onMouseUp;C.recordCursorPosition(),Y&&Y.apply(void 0,arguments)},C.onFocus=function(){var Y;C.setState({focused:!0}),(Y=C.props).onFocus.apply(Y,arguments)},C.onBlur=function(){var Y=C.props.onBlur;C.inputting=!1,C.setState({focused:!1});var oe=C.getCurrentValidValue(C.state.inputValue),G=C.setValue(oe,u);if(Y){var j=C.input.value,se=C.getInputDisplayValue({focus:!1,value:G});C.input.value=se&&Number(se),Y.apply(void 0,arguments),C.input.value=j}},C.getRatio=function(Y){var oe=1;return Y.metaKey||Y.ctrlKey?oe=.1:Y.shiftKey&&(oe=10),oe},C.getFullNum=function(Y){return isNaN(Y)?Y:/e/i.test(String(Y))?Number(Y).toFixed(18).replace(/\.?0+$/,""):Y},C.getPrecision=function(Y){if(f(C.props.precision))return C.props.precision;var oe=String(Y);if(oe.indexOf("e-")>=0)return parseInt(oe.slice(oe.indexOf("e-")+2),10);var G=0;return oe.indexOf(".")>=0&&(G=oe.length-oe.indexOf(".")-1),G},C.getInputDisplayValue=function(Y){var oe=Y||C.state,G=oe.focused,j=oe.inputValue,se=oe.value,fe;G?fe=j:fe=C.toPrecisionAsStep(se),fe==null&&(fe="");var Se=C.formatWrapper(fe);return f(C.props.decimalSeparator)&&(Se=Se.toString().replace(".",C.props.decimalSeparator)),Se},C.recordCursorPosition=function(){try{C.cursorStart=C.input.selectionStart,C.cursorEnd=C.input.selectionEnd,C.currentValue=C.input.value,C.cursorBefore=C.input.value.substring(0,C.cursorStart),C.cursorAfter=C.input.value.substring(C.cursorEnd)}catch(Y){}},C.restoreByAfter=function(Y){if(Y===void 0)return!1;var oe=C.input.value,G=oe.lastIndexOf(Y);if(G===-1)return!1;var j=C.cursorBefore.length;return C.lastKeyCode===E.a.DELETE&&C.cursorBefore.charAt(j-1)===Y[0]?(C.fixCaret(j,j),!0):G+Y.length===oe.length?(C.fixCaret(G,G),!0):!1},C.partRestoreByAfter=function(Y){return Y===void 0?!1:Array.prototype.some.call(Y,function(oe,G){var j=Y.substring(G);return C.restoreByAfter(j)})},C.isNotCompleteNumber=function(Y){return isNaN(Y)||Y===""||Y===null||Y&&Y.toString().indexOf(".")===Y.toString().length-1},C.stop=function(){C.autoStepTimer&&clearTimeout(C.autoStepTimer)},C.down=function(Y,oe,G){C.pressingUpOrDown=!0,C.step("down",Y,oe,G)},C.up=function(Y,oe,G){C.pressingUpOrDown=!0,C.step("up",Y,oe,G)},C.saveInput=function(Y){C.input=Y};var _=g.value;_===void 0&&(_=g.defaultValue),C.state={focused:g.autoFocus};var z=C.getValidValue(C.toNumber(_));return C.state=w(w({},C.state),{},{inputValue:C.toPrecisionAsStep(z),value:z}),C}return Object(H.a)(x,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(C){var _=this.props,z=_.value,Y=_.onChange,oe=_.max,G=_.min,j=this.state.focused;if(C){if(!D(C.value,z)||!D(C.max,oe)||!D(C.min,G)){var se=j?z:this.getValidValue(z),fe;this.pressingUpOrDown?fe=se:this.inputting?fe=this.rawInput:fe=this.toPrecisionAsStep(se),this.setState({value:se,inputValue:fe})}var Se="value"in this.props?z:this.state.value;"max"in this.props&&C.max!==oe&&typeof Se=="number"&&Se>oe&&Y&&Y(oe),"min"in this.props&&C.min!==G&&typeof Se=="number"&&Se<G&&Y&&Y(G)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var ke=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===E.a.BACKSPACE?ke=this.cursorStart-1:this.lastKeyCode===E.a.DELETE&&(ke=this.cursorStart):ke=this.input.value.length,this.fixCaret(ke,ke)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case E.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case E.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(Je){}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(C){var _=C;return _===""?_="":this.isNotCompleteNumber(parseFloat(_))?_=this.state.value:_=this.getValidValue(_),this.toNumber(_)}},{key:"getValueFromEvent",value:function(C){var _=C.target.value.trim().replace(/。/g,".");return f(this.props.decimalSeparator)&&(_=_.replace(this.props.decimalSeparator,".")),_}},{key:"getValidValue",value:function(C){var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,Y=parseFloat(C);return isNaN(Y)?C:(Y<_&&(Y=_),Y>z&&(Y=z),Y)}},{key:"setValue",value:function(C,_){var z=this.props.precision,Y=this.isNotCompleteNumber(parseFloat(C))?null:parseFloat(C),oe=this.state.value,G=oe===void 0?null:oe,j=this.state.inputValue,se=j===void 0?null:j,fe=typeof Y=="number"?Y.toFixed(z):"".concat(Y),Se=Y!==G||fe!=="".concat(se);return"value"in this.props?(se=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:se},_)):this.setState({value:Y,inputValue:this.toPrecisionAsStep(C)},_),Se&&this.props.onChange(Y),Y}},{key:"getMaxPrecision",value:function(C){var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,z=this.props,Y=z.precision,oe=z.step;if(f(Y))return Y;var G=this.getPrecision(_),j=this.getPrecision(oe),se=this.getPrecision(C);return C?Math.max(se,G+j):G+j}},{key:"getPrecisionFactor",value:function(C){var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,z=this.getMaxPrecision(C,_);return Math.pow(10,z)}},{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(C){return this.props.formatter?this.props.formatter(C):C}},{key:"toPrecisionAsStep",value:function(C){if(this.isNotCompleteNumber(C)||C==="")return C;var _=Math.abs(this.getMaxPrecision(C));return isNaN(_)?C.toString():Number(C).toFixed(_)}},{key:"toNumber",value:function(C){var _=this.props.precision,z=this.state.focused,Y=C&&C.length>16&&z;return this.isNotCompleteNumber(C)||Y?C:f(_)?Math.round(C*Math.pow(10,_))/Math.pow(10,_):Number(C)}},{key:"upStep",value:function(C,_){var z=this.props.step,Y=this.getPrecisionFactor(C,_),oe=Math.abs(this.getMaxPrecision(C,_)),G=((Y*C+Y*z*_)/Y).toFixed(oe);return this.toNumber(G)}},{key:"downStep",value:function(C,_){var z=this.props.step,Y=this.getPrecisionFactor(C,_),oe=Math.abs(this.getMaxPrecision(C,_)),G=((Y*C-Y*z*_)/Y).toFixed(oe);return this.toNumber(G)}},{key:"step",value:function(C,_){var z=this,Y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,oe=arguments.length>3?arguments[3]:void 0;this.stop(),_&&(_.persist(),_.preventDefault());var G=this.props;if(G.disabled)return;var j=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(j))return;var se=this["".concat(C,"Step")](j,Y),fe=se>G.max||se<G.min;if(se>G.max?se=G.max:se<G.min&&(se=G.min),this.setValue(se,null),this.setState({focused:!0},function(){z.pressingUpOrDown=!1}),fe)return;this.autoStepTimer=setTimeout(function(){z[C](_,Y,!0)},oe?s:m)}},{key:"fixCaret",value:function(C,_){if(C===void 0||_===void 0||!this.input||!this.input.value)return;try{var z=this.input.selectionStart,Y=this.input.selectionEnd;(C!==z||_!==Y)&&this.input.setSelectionRange(C,_)}catch(oe){}}},{key:"render",value:function(){var C,_=this.props,z=_.prefixCls,Y=_.disabled,oe=_.readOnly,G=_.useTouch,j=_.autoComplete,se=_.upHandler,fe=_.downHandler,Se=_.className,ke=_.max,Je=_.min,_e=_.style,Qe=_.title,Ue=_.onMouseEnter,Fe=_.onMouseLeave,we=_.onMouseOver,F=_.onMouseOut,R=_.required,M=_.onClick,K=_.tabIndex,$=_.type,B=_.placeholder,ge=_.id,Oe=_.inputMode,je=_.pattern,Ze=_.step,He=_.maxLength,ze=_.autoFocus,Xe=_.name,dt=_.onPaste,ct=_.onInput,gt=Object(de.a)(_,["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"]),at=this.state,ft=at.value,lt=at.focused,Ye=b()(z,(C={},Object(V.a)(C,Se,!!Se),Object(V.a)(C,"".concat(z,"-disabled"),Y),Object(V.a)(C,"".concat(z,"-focused"),lt),C)),Ne={};Object.keys(gt).forEach(function(pe){(pe.substr(0,5)==="data-"||pe.substr(0,5)==="aria-"||pe==="role")&&(Ne[pe]=gt[pe])});var ht=!oe&&!Y,qe=this.getInputDisplayValue(null),le=(ft||ft===0)&&(isNaN(ft)||Number(ft)>=ke),Z=(ft||ft===0)&&(isNaN(ft)||Number(ft)<=Je),q=le||Y||oe,ne=Z||Y||oe,ue=b()("".concat(z,"-handler"),"".concat(z,"-handler-up"),Object(V.a)({},"".concat(z,"-handler-up-disabled"),q)),ee=b()("".concat(z,"-handler"),"".concat(z,"-handler-down"),Object(V.a)({},"".concat(z,"-handler-down-disabled"),ne)),ie=G?{onTouchStart:q?u:this.up,onTouchEnd:this.stop}:{onMouseDown:q?u:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},ce=G?{onTouchStart:ne?u:this.down,onTouchEnd:this.stop}:{onMouseDown:ne?u:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return P.a.createElement("div",{className:Ye,style:_e,title:Qe,onMouseEnter:Ue,onMouseLeave:Fe,onMouseOver:we,onMouseOut:F,onFocus:function(){return null},onBlur:function(){return null}},P.a.createElement("div",{className:"".concat(z,"-handler-wrap")},P.a.createElement("span",Object.assign({unselectable:"on"},ie,{role:"button","aria-label":"Increase Value","aria-disabled":q,className:ue}),se||P.a.createElement("span",{unselectable:"on",className:"".concat(z,"-handler-up-inner"),onClick:a})),P.a.createElement("span",Object.assign({unselectable:"on"},ce,{role:"button","aria-label":"Decrease Value","aria-disabled":ne,className:ee}),fe||P.a.createElement("span",{unselectable:"on",className:"".concat(z,"-handler-down-inner"),onClick:a}))),P.a.createElement("div",{className:"".concat(z,"-input-wrap")},P.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Je,"aria-valuemax":ke,"aria-valuenow":ft,required:R,type:$,placeholder:B,onPaste:dt,onClick:M,onMouseUp:this.onMouseUp,className:"".concat(z,"-input"),tabIndex:K,autoComplete:j,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:ht?this.onKeyDown:u,onKeyUp:ht?this.onKeyUp:u,autoFocus:ze,maxLength:He,readOnly:oe,disabled:Y,max:ke,min:Je,step:Ze,name:Xe,title:Qe,id:ge,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(qe),pattern:je,inputMode:Oe,onInput:ct},Ne))))}}]),x}(P.a.Component);v.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:d,min:-d,step:1,style:{},onChange:u,onKeyDown:u,onPressEnter:u,onFocus:u,onBlur:u,parser:l,required:!1,autoComplete:"off"};var h=v,p=We.a=h},ji0R:function(Ge,We,X){Ge.exports=X.p+"static/douyu.3e6df9ee.jpg"},k3GJ:function(Ge,We,X){"use strict";X.d(We,"a",function(){return bo});var de=X("rePB"),V=X("ODXe"),O=X("Ff2n"),H=X("VTBJ"),A=X("q1tI"),k=X("TSYQ"),W=X.n(k),U=X("Zm9Q"),P=X("6cGi"),L=X("KQm4"),b=X("xEkU"),E=X.n(b),I=X("t23M");function w(me){var Ae=Object(A.useRef)(),Re=Object(A.useRef)(!1);function ve(){for(var te=arguments.length,he=new Array(te),ae=0;ae<te;ae++)he[ae]=arguments[ae];Re.current||(E.a.cancel(Ae.current),Ae.current=E()(function(){me.apply(void 0,he)}))}return Object(A.useEffect)(function(){return function(){Re.current=!0,E.a.cancel(Ae.current)}},[]),ve}function T(me){var Ae=Object(A.useRef)([]),Re=Object(A.useState)({}),ve=Object(V.a)(Re,2),te=ve[1],he=Object(A.useRef)(typeof me=="function"?me():me),ae=w(function(){var Ee=he.current;Ae.current.forEach(function(Me){Ee=Me(Ee)}),Ae.current=[],he.current=Ee,te({})});function be(Ee){Ae.current.push(Ee),ae()}return[he.current,be]}var y=X("4IlW");function u(me,Ae){var Re,ve=me.prefixCls,te=me.id,he=me.active,ae=me.rtl,be=me.tab,Ee=be.key,Me=be.tab,Te=be.disabled,Ie=be.closeIcon,Ke=me.tabBarGutter,it=me.tabPosition,rt=me.closable,mt=me.renderWrapper,Nt=me.removeAriaLabel,$t=me.editable,Qt=me.onClick,Xt=me.onRemove,er=me.onFocus,Zt="".concat(ve,"-tab");A.useEffect(function(){return Xt},[]);var Yt={};it==="top"||it==="bottom"?Yt[ae?"marginLeft":"marginRight"]=Ke:Yt.marginBottom=Ke;var fr=$t&&rt!==!1&&!Te;function ar(Pt){if(Te)return;Qt(Pt)}function Ur(Pt){Pt.preventDefault(),Pt.stopPropagation(),$t.onEdit("remove",{key:Ee,event:Pt})}var or=A.createElement("div",{key:Ee,ref:Ae,className:W()(Zt,(Re={},Object(de.a)(Re,"".concat(Zt,"-with-remove"),fr),Object(de.a)(Re,"".concat(Zt,"-active"),he),Object(de.a)(Re,"".concat(Zt,"-disabled"),Te),Re)),style:Yt,onClick:ar},A.createElement("div",{role:"tab","aria-selected":he,id:te&&"".concat(te,"-tab-").concat(Ee),className:"".concat(Zt,"-btn"),"aria-controls":te&&"".concat(te,"-panel-").concat(Ee),"aria-disabled":Te,tabIndex:Te?null:0,onClick:function(Lt){Lt.stopPropagation(),ar(Lt)},onKeyDown:function(Lt){[y.a.SPACE,y.a.ENTER].includes(Lt.which)&&(Lt.preventDefault(),ar(Lt))},onFocus:er},Me),fr&&A.createElement("button",{type:"button","aria-label":Nt||"remove",tabIndex:0,className:"".concat(Zt,"-remove"),onClick:function(Lt){Lt.stopPropagation(),Ur(Lt)}},Ie||$t.removeIcon||"\xD7"));return mt&&(or=mt(or)),or}var a=A.forwardRef(u),l={width:0,height:0,left:0,top:0};function s(me,Ae,Re){return Object(A.useMemo)(function(){for(var ve,te=new Map,he=Ae.get((ve=me[0])===null||ve===void 0?void 0:ve.key)||l,ae=he.left+he.width,be=0;be<me.length;be+=1){var Ee=me[be].key,Me=Ae.get(Ee);if(!Me){var Te;Me=Ae.get((Te=me[be-1])===null||Te===void 0?void 0:Te.key)||l}var Ie=te.get(Ee)||Object(H.a)({},Me);Ie.right=ae-Ie.left-Ie.width,te.set(Ee,Ie)}return te},[me.map(function(ve){return ve.key}).join("_"),Ae,Re])}var m={width:0,height:0,left:0,top:0,right:0};function d(me,Ae,Re,ve,te){var he=te.tabs,ae=te.tabPosition,be=te.rtl,Ee,Me,Te;["top","bottom"].includes(ae)?(Ee="width",Me=be?"right":"left",Te=Math.abs(Ae.left)):(Ee="height",Me="top",Te=-Ae.top);var Ie=Ae[Ee],Ke=Re[Ee],it=ve[Ee],rt=Ie;return Ke+it>Ie&&(rt=Ie-it),Object(A.useMemo)(function(){if(!he.length)return[0,0];for(var mt=he.length,Nt=mt,$t=0;$t<mt;$t+=1){var Qt=me.get(he[$t].key)||m;if(Qt[Me]+Qt[Ee]>Te+rt){Nt=$t-1;break}}for(var Xt=0,er=mt-1;er>=0;er-=1){var Zt=me.get(he[er].key)||m;if(Zt[Me]<Te){Xt=er+1;break}}return[Xt,Nt]},[me,Te,rt,ae,he.map(function(mt){return mt.key}).join("_"),be])}var f=X("wx14"),D=X("1OyB"),v=X("vuIU"),h=X("JX7q"),p=X("Ji7U"),c=X("LK+K"),o=X("I8Z2"),x=X("bT9E"),g=X("2GS6"),C=X("Gytx"),_=X.n(C),z=X("U8pU"),Y=/iPhone/i,oe=/iPod/i,G=/iPad/i,j=/\bAndroid(?:.+)Mobile\b/i,se=/Android/i,fe=/\bAndroid(?:.+)SD4930UR\b/i,Se=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,ke=/Windows Phone/i,Je=/\bWindows(?:.+)ARM\b/i,_e=/BlackBerry/i,Qe=/BB10/i,Ue=/Opera Mini/i,Fe=/\b(CriOS|Chrome)(?:.+)Mobile/i,we=/Mobile(?:.+)Firefox\b/i;function F(me,Ae){return me.test(Ae)}function R(me){var Ae=me||(typeof navigator!="undefined"?navigator.userAgent:""),Re=(Ae||"").split("[FBAN");if(typeof Re[1]!="undefined"){var ve=Re,te=Object(V.a)(ve,1);Ae=te[0]}if(Re=Ae.split("Twitter"),typeof Re[1]!="undefined"){var he=Re,ae=Object(V.a)(he,1);Ae=ae[0]}var be={apple:{phone:F(Y,Ae)&&!F(ke,Ae),ipod:F(oe,Ae),tablet:!F(Y,Ae)&&F(G,Ae)&&!F(ke,Ae),device:(F(Y,Ae)||F(oe,Ae)||F(G,Ae))&&!F(ke,Ae)},amazon:{phone:F(fe,Ae),tablet:!F(fe,Ae)&&F(Se,Ae),device:F(fe,Ae)||F(Se,Ae)},android:{phone:!F(ke,Ae)&&F(fe,Ae)||!F(ke,Ae)&&F(j,Ae),tablet:!F(ke,Ae)&&!F(fe,Ae)&&!F(j,Ae)&&(F(Se,Ae)||F(se,Ae)),device:!F(ke,Ae)&&(F(fe,Ae)||F(Se,Ae)||F(j,Ae)||F(se,Ae))||F(/\bokhttp\b/i,Ae)},windows:{phone:F(ke,Ae),tablet:F(Je,Ae),device:F(ke,Ae)||F(Je,Ae)},other:{blackberry:F(_e,Ae),blackberry10:F(Qe,Ae),opera:F(Ue,Ae),firefox:F(we,Ae),chrome:F(Fe,Ae),device:F(_e,Ae)||F(Qe,Ae)||F(Ue,Ae)||F(we,Ae)||F(Fe,Ae)},any:null,phone:null,tablet:null};return be.any=be.apple.device||be.android.device||be.windows.device||be.other.device,be.phone=be.apple.phone||be.android.phone||be.windows.phone,be.tablet=be.apple.tablet||be.android.tablet||be.windows.tablet,be}var M=Object(H.a)(Object(H.a)({},R()),{},{isMobile:R}),K=M;function $(){}function B(me,Ae,Re){var ve=Ae||"";return me.key||"".concat(ve,"item_").concat(Re)}function ge(me){return"".concat(me,"-menu-")}function Oe(me,Ae){var Re=-1;A.Children.forEach(me,function(ve){Re+=1,ve&&ve.type&&ve.type.isMenuItemGroup?A.Children.forEach(ve.props.children,function(te){Re+=1,Ae(te,Re)}):Ae(ve,Re)})}function je(me,Ae,Re){if(!me||Re.find)return;A.Children.forEach(me,function(ve){if(ve){var te=ve.type;if(!te||!(te.isSubMenu||te.isMenuItem||te.isMenuItemGroup))return;Ae.indexOf(ve.key)!==-1?Re.find=!0:ve.props.children&&je(ve.props.children,Ae,Re)}})}var Ze=["defaultSelectedKeys","selectedKeys","defaultOpenKeys","openKeys","mode","getPopupContainer","onSelect","onDeselect","onDestroy","openTransitionName","openAnimation","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","triggerSubMenuAction","level","selectable","multiple","onOpenChange","visible","focusable","defaultActiveFirst","prefixCls","inlineIndent","parentMenu","title","rootPrefixCls","eventKey","active","onItemHover","onTitleMouseEnter","onTitleMouseLeave","onTitleClick","popupAlign","popupOffset","isOpen","renderMenuItem","manualRef","subMenuKey","disabled","index","isSelected","store","activeKey","builtinPlacements","overflowedIndicator","motion","attribute","value","popupClassName","inlineCollapsed","menu","theme","itemIcon","expandIcon"],He=function(Ae){var Re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ve=Ae&&typeof Ae.getBoundingClientRect=="function"&&Ae.getBoundingClientRect().width;if(ve){if(Re){var te=getComputedStyle(Ae),he=te.marginLeft,ae=te.marginRight;ve+=+he.replace("px","")+ +ae.replace("px","")}ve=+ve.toFixed(6)}return ve||0},ze=function(Ae,Re,ve){Ae&&Object(z.a)(Ae.style)==="object"&&(Ae.style[Re]=ve)},Xe=function(){return K.any},dt=X("bdgK"),ct=X("i8i4"),gt=X.n(ct),at=X("wgJM"),ft=X("l4aY"),lt=X("m+aA"),Ye=X("c+Xe"),Ne=X("zT1h"),ht=X("QC+M");function qe(me,Ae,Re){return Re?me[0]===Ae[0]:me[0]===Ae[0]&&me[1]===Ae[1]}function le(me,Ae,Re){var ve=me[Ae]||{};return Object(H.a)(Object(H.a)({},ve),Re)}function Z(me,Ae,Re,ve){for(var te=Re.points,he=Object.keys(me),ae=0;ae<he.length;ae+=1){var be=he[ae];if(qe(me[be].points,te,ve))return"".concat(Ae,"-placement-").concat(be)}return""}var q=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var me=navigator.userAgent||navigator.vendor||window.opera;return!!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(me)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(me==null?void 0:me.substr(0,4)))},ne=X("MNnm");function ue(me,Ae){var Re={};return Re[me.toLowerCase()]=Ae.toLowerCase(),Re["Webkit".concat(me)]="webkit".concat(Ae),Re["Moz".concat(me)]="moz".concat(Ae),Re["ms".concat(me)]="MS".concat(Ae),Re["O".concat(me)]="o".concat(Ae.toLowerCase()),Re}function ee(me,Ae){var Re={animationend:ue("Animation","AnimationEnd"),transitionend:ue("Transition","TransitionEnd")};return me&&("AnimationEvent"in Ae||delete Re.animationend.animation,"TransitionEvent"in Ae||delete Re.transitionend.transition),Re}var ie=ee(Object(ne.a)(),typeof window!="undefined"?window:{}),ce={};if(Object(ne.a)()){var pe=document.createElement("div");ce=pe.style}var xe={};function De(me){if(xe[me])return xe[me];var Ae=ie[me];if(Ae)for(var Re=Object.keys(Ae),ve=Re.length,te=0;te<ve;te+=1){var he=Re[te];if(Object.prototype.hasOwnProperty.call(Ae,he)&&he in ce)return xe[me]=Ae[he],xe[me]}return""}var Be=De("animationend"),$e=De("transitionend"),pt=!!(Be&&$e),xt=Be||"animationend",Ft=$e||"transitionend";function Ct(me,Ae){if(!me)return null;if(Object(z.a)(me)==="object"){var Re=Ae.replace(/-\w/g,function(ve){return ve[1].toUpperCase()});return me[Re]}return"".concat(me,"-").concat(Ae)}var ot="none",Ut="appear",Rt="enter",_t="leave",Vt="none",bt="prepare",cr="start",Gt="active",Tt="end";function qt(me){var Ae=Object(A.useRef)(!1),Re=Object(A.useState)(me),ve=Object(V.a)(Re,2),te=ve[0],he=ve[1];function ae(be){Ae.current||he(be)}return Object(A.useEffect)(function(){return function(){Ae.current=!0}},[]),[te,ae]}var nt=Object(ne.a)()?A.useLayoutEffect:A.useEffect,Or=nt,ur=function(){var me=A.useRef(null);function Ae(){at.a.cancel(me.current)}function Re(ve){var te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;Ae();var he=Object(at.a)(function(){te<=1?ve({isCanceled:function(){return he!==me.current}}):Re(ve,te-1)});me.current=he}return A.useEffect(function(){return function(){Ae()}},[]),[Re,Ae]},Ar=[bt,cr,Gt,Tt],ln=!1,Mr=!0;function Et(me){return me===Gt||me===Tt}var sr=function(me,Ae){var Re=A.useState(Vt),ve=Object(V.a)(Re,2),te=ve[0],he=ve[1],ae=ur(),be=Object(V.a)(ae,2),Ee=be[0],Me=be[1];function Te(){he(bt)}return Or(function(){if(te!==Vt&&te!==Tt){var Ie=Ar.indexOf(te),Ke=Ar[Ie+1],it=Ae(te);it===ln?he(Ke):Ee(function(rt){function mt(){if(rt.isCanceled())return;he(Ke)}it===!0?mt():Promise.resolve(it).then(mt)})}},[me,te]),A.useEffect(function(){return function(){Me()}},[]),[Te,te]},Gr=function(me){var Ae=Object(A.useRef)(),Re=Object(A.useRef)(me);Re.current=me;var ve=A.useCallback(function(ae){Re.current(ae)},[]);function te(ae){ae&&(ae.removeEventListener(Ft,ve),ae.removeEventListener(xt,ve))}function he(ae){Ae.current&&Ae.current!==ae&&te(Ae.current),ae&&ae!==Ae.current&&(ae.addEventListener(Ft,ve),ae.addEventListener(xt,ve),Ae.current=ae)}return A.useEffect(function(){return function(){te(Ae.current)}},[]),[he,te]};function zt(me,Ae,Re,ve){var te=ve.motionEnter,he=te===void 0?!0:te,ae=ve.motionAppear,be=ae===void 0?!0:ae,Ee=ve.motionLeave,Me=Ee===void 0?!0:Ee,Te=ve.motionDeadline,Ie=ve.motionLeaveImmediately,Ke=ve.onAppearPrepare,it=ve.onEnterPrepare,rt=ve.onLeavePrepare,mt=ve.onAppearStart,Nt=ve.onEnterStart,$t=ve.onLeaveStart,Qt=ve.onAppearActive,Xt=ve.onEnterActive,er=ve.onLeaveActive,Zt=ve.onAppearEnd,Yt=ve.onEnterEnd,fr=ve.onLeaveEnd,ar=ve.onVisibleChanged,Ur=qt(),or=Object(V.a)(Ur,2),Pt=or[0],Lt=or[1],lr=qt(ot),pr=Object(V.a)(lr,2),wt=pr[0],gr=pr[1],Fr=qt(null),br=Object(V.a)(Fr,2),kr=br[0],Dr=br[1],Xr=Object(A.useRef)(!1),tn=Object(A.useRef)(null),Wr=Object(A.useRef)(!1),xn=Object(A.useRef)(null);function Vn(){var Pr=Re();return Pr||xn.current}var Dn=Object(A.useRef)(!1);function rn(Pr){var wr=Vn();if(Pr&&!Pr.deadline&&Pr.target!==wr)return;var nn;wt===Ut&&Dn.current?nn=Zt==null?void 0:Zt(wr,Pr):wt===Rt&&Dn.current?nn=Yt==null?void 0:Yt(wr,Pr):wt===_t&&Dn.current&&(nn=fr==null?void 0:fr(wr,Pr)),nn!==!1&&!Wr.current&&(gr(ot),Dr(null))}var _r=Gr(rn),Lr=Object(V.a)(_r,1),Hr=Lr[0],jr=A.useMemo(function(){var Pr,wr,nn;switch(wt){case"appear":return Pr={},Object(de.a)(Pr,bt,Ke),Object(de.a)(Pr,cr,mt),Object(de.a)(Pr,Gt,Qt),Pr;case"enter":return wr={},Object(de.a)(wr,bt,it),Object(de.a)(wr,cr,Nt),Object(de.a)(wr,Gt,Xt),wr;case"leave":return nn={},Object(de.a)(nn,bt,rt),Object(de.a)(nn,cr,$t),Object(de.a)(nn,Gt,er),nn;default:return{}}},[wt]),Qn=sr(wt,function(Pr){if(Pr===bt){var wr=jr[bt];return wr?wr(Vn()):ln}if(Rr in jr){var nn;Dr(((nn=jr[Rr])===null||nn===void 0?void 0:nn.call(jr,Vn(),null))||null)}return Rr===Gt&&(Hr(Vn()),Te>0&&(clearTimeout(tn.current),tn.current=setTimeout(function(){rn({deadline:!0})},Te))),Mr}),bi=Object(V.a)(Qn,2),Ei=bi[0],Rr=bi[1],ti=Et(Rr);Dn.current=ti,Or(function(){Lt(Ae);var Pr=Xr.current;if(Xr.current=!0,!me)return;var wr;!Pr&&Ae&&be&&(wr=Ut),Pr&&Ae&&he&&(wr=Rt),(Pr&&!Ae&&Me||!Pr&&Ie&&!Ae&&Me)&&(wr=_t),wr&&(gr(wr),Ei())},[Ae]),Object(A.useEffect)(function(){(wt===Ut&&!be||wt===Rt&&!he||wt===_t&&!Me)&&gr(ot)},[be,he,Me]),Object(A.useEffect)(function(){return function(){clearTimeout(tn.current),Wr.current=!0}},[]),Object(A.useEffect)(function(){Pt!==void 0&&wt===ot&&(ar==null||ar(Pt))},[Pt,wt]);var xi=kr;return jr[bt]&&Rr===cr&&(xi=Object(H.a)({transition:"none"},xi)),[wt,Rr,xi,Pt!=null?Pt:Ae]}var Ht=function(me){Object(p.a)(Re,me);var Ae=Object(c.a)(Re);function Re(){return Object(D.a)(this,Re),Ae.apply(this,arguments)}return Object(v.a)(Re,[{key:"render",value:function(){return this.props.children}}]),Re}(A.Component),vr=Ht;function pn(me){var Ae=me;Object(z.a)(me)==="object"&&(Ae=me.transitionSupport);function Re(te){return!!(te.motionName&&Ae)}var ve=A.forwardRef(function(te,he){var ae=te.visible,be=ae===void 0?!0:ae,Ee=te.removeOnLeave,Me=Ee===void 0?!0:Ee,Te=te.forceRender,Ie=te.children,Ke=te.motionName,it=te.leavedClassName,rt=te.eventProps,mt=Re(te),Nt=Object(A.useRef)(),$t=Object(A.useRef)();function Qt(){try{return Object(lt.a)(Nt.current||$t.current)}catch(gr){return null}}var Xt=zt(mt,be,Qt,te),er=Object(V.a)(Xt,4),Zt=er[0],Yt=er[1],fr=er[2],ar=er[3],Ur=A.useRef(ar);ar&&(Ur.current=!0);var or=Object(A.useRef)(he);or.current=he;var Pt=A.useCallback(function(gr){Nt.current=gr,Object(Ye.b)(or.current,gr)},[]),Lt,lr=Object(H.a)(Object(H.a)({},rt),{},{visible:be});if(!Ie)Lt=null;else if(Zt===ot||!Re(te))ar?Lt=Ie(Object(H.a)({},lr),Pt):!Me&&Ur.current?Lt=Ie(Object(H.a)(Object(H.a)({},lr),{},{className:it}),Pt):Te?Lt=Ie(Object(H.a)(Object(H.a)({},lr),{},{style:{display:"none"}}),Pt):Lt=null;else{var pr,wt;Yt===bt?wt="prepare":Et(Yt)?wt="active":Yt===cr&&(wt="start"),Lt=Ie(Object(H.a)(Object(H.a)({},lr),{},{className:W()(Ct(Ke,Zt),(pr={},Object(de.a)(pr,Ct(Ke,"".concat(Zt,"-").concat(wt)),wt),Object(de.a)(pr,Ke,typeof Ke=="string"),pr)),style:fr}),Pt)}return A.createElement(vr,{ref:$t},Lt)});return ve.displayName="CSSMotion",ve}var Br=pn(pt),tt="add",Ot="keep",Ln="remove",ri="removed";function hi(me){var Ae;return me&&Object(z.a)(me)==="object"&&"key"in me?Ae=me:Ae={key:me},Object(H.a)(Object(H.a)({},Ae),{},{key:String(Ae.key)})}function zn(){var me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return me.map(hi)}function fi(){var me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],Re=[],ve=0,te=Ae.length,he=zn(me),ae=zn(Ae);he.forEach(function(Me){for(var Te=!1,Ie=ve;Ie<te;Ie+=1){var Ke=ae[Ie];if(Ke.key===Me.key){ve<Ie&&(Re=Re.concat(ae.slice(ve,Ie).map(function(it){return Object(H.a)(Object(H.a)({},it),{},{status:tt})})),ve=Ie),Re.push(Object(H.a)(Object(H.a)({},Ke),{},{status:Ot})),ve+=1,Te=!0;break}}Te||Re.push(Object(H.a)(Object(H.a)({},Me),{},{status:Ln}))}),ve<te&&(Re=Re.concat(ae.slice(ve).map(function(Me){return Object(H.a)(Object(H.a)({},Me),{},{status:tt})})));var be={};Re.forEach(function(Me){var Te=Me.key;be[Te]=(be[Te]||0)+1});var Ee=Object.keys(be).filter(function(Me){return be[Me]>1});return Ee.forEach(function(Me){Re=Re.filter(function(Te){var Ie=Te.key,Ke=Te.status;return Ie!==Me||Ke!==Ln}),Re.forEach(function(Te){Te.key===Me&&(Te.status=Ot)})}),Re}var jt=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function Hi(me){var Ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Br,Re=function(ve){Object(p.a)(he,ve);var te=Object(c.a)(he);function he(){var ae;return Object(D.a)(this,he),ae=te.apply(this,arguments),ae.state={keyEntities:[]},ae.removeKey=function(be){ae.setState(function(Ee){var Me=Ee.keyEntities;return{keyEntities:Me.map(function(Te){return Te.key!==be?Te:Object(H.a)(Object(H.a)({},Te),{},{status:ri})})}})},ae}return Object(v.a)(he,[{key:"render",value:function(){var be=this,Ee=this.state.keyEntities,Me=this.props,Te=Me.component,Ie=Me.children,Ke=Me.onVisibleChanged,it=Object(O.a)(Me,["component","children","onVisibleChanged"]),rt=Te||A.Fragment,mt={};return jt.forEach(function(Nt){mt[Nt]=it[Nt],delete it[Nt]}),delete it.keys,A.createElement(rt,it,Ee.map(function(Nt){var $t=Nt.status,Qt=Object(O.a)(Nt,["status"]),Xt=$t===tt||$t===Ot;return A.createElement(Ae,Object(f.a)({},mt,{key:Qt.key,visible:Xt,eventProps:Qt,onVisibleChanged:function(Zt){Ke==null||Ke(Zt,{key:Qt.key}),Zt||be.removeKey(Qt.key)}}),Ie)}))}}],[{key:"getDerivedStateFromProps",value:function(be,Ee){var Me=be.keys,Te=Ee.keyEntities,Ie=zn(Me),Ke=fi(Te,Ie);return{keyEntities:Ke.filter(function(it){var rt=Te.find(function(mt){var Nt=mt.key;return it.key===Nt});return!(rt&&rt.status===ri&&it.status===Ln)})}}}]),he}(A.Component);return Re.defaultProps={component:"div"},Re}var st=Hi(pt),yn=Br;function bn(me){var Ae=me.prefixCls,Re=me.motion,ve=me.animation,te=me.transitionName;return Re||(ve?{motionName:"".concat(Ae,"-").concat(ve)}:te?{motionName:te}:null)}function Di(me){var Ae=me.prefixCls,Re=me.visible,ve=me.zIndex,te=me.mask,he=me.maskMotion,ae=me.maskAnimation,be=me.maskTransitionName;if(!te)return null;var Ee={};return(he||be||ae)&&(Ee=Object(H.a)({motionAppear:!0},bn({motion:he,prefixCls:Ae,transitionName:be,animation:ae}))),A.createElement(yn,Object(f.a)({},Ee,{visible:Re,removeOnLeave:!0}),function(Me){var Te=Me.className;return A.createElement("div",{style:{zIndex:ve},className:W()("".concat(Ae,"-mask"),Te)})})}var ni=X("9mu1"),In=X("o0o1"),pi=X.n(In),Ri=X("HaE+"),An=["measure","align",null,"motion"],Oi=function(me,Ae){var Re=Object(A.useState)(null),ve=Object(V.a)(Re,2),te=ve[0],he=ve[1],ae=Object(A.useRef)(),be=Object(A.useRef)(!1);function Ee(Ie){be.current||he(Ie)}function Me(){at.a.cancel(ae.current)}function Te(Ie){Me(),ae.current=Object(at.a)(function(){Ee(function(Ke){switch(te){case"align":return"motion";case"motion":return"stable";default:}return Ke}),Ie==null||Ie()})}return Object(A.useEffect)(function(){Ee("measure")},[me]),Object(A.useEffect)(function(){switch(te){case"measure":Ae();break;default:}te&&(ae.current=Object(at.a)(Object(Ri.a)(pi.a.mark(function Ie(){var Ke,it;return pi.a.wrap(function(mt){for(;;)switch(mt.prev=mt.next){case 0:Ke=An.indexOf(te),it=An[Ke+1],it&&Ke!==-1&&Ee(it);case 3:case"end":return mt.stop()}},Ie)}))))},[te]),Object(A.useEffect)(function(){return function(){be.current=!0,Me()}},[]),[te,Te]},Mi=function(me){var Ae=A.useState({width:0,height:0}),Re=Object(V.a)(Ae,2),ve=Re[0],te=Re[1];function he(be){te({width:be.offsetWidth,height:be.offsetHeight})}var ae=A.useMemo(function(){var be={};if(me){var Ee=ve.width,Me=ve.height;me.indexOf("height")!==-1&&Me?be.height=Me:me.indexOf("minHeight")!==-1&&Me&&(be.minHeight=Me),me.indexOf("width")!==-1&&Ee?be.width=Ee:me.indexOf("minWidth")!==-1&&Ee&&(be.minWidth=Ee)}return be},[me,ve]);return[ae,he]},mi=A.forwardRef(function(me,Ae){var Re=me.visible,ve=me.prefixCls,te=me.className,he=me.style,ae=me.children,be=me.zIndex,Ee=me.stretch,Me=me.destroyPopupOnHide,Te=me.forceRender,Ie=me.align,Ke=me.point,it=me.getRootDomNode,rt=me.getClassNameFromAlign,mt=me.onAlign,Nt=me.onMouseEnter,$t=me.onMouseLeave,Qt=me.onMouseDown,Xt=me.onTouchStart,er=Object(A.useRef)(),Zt=Object(A.useRef)(),Yt=Object(A.useState)(),fr=Object(V.a)(Yt,2),ar=fr[0],Ur=fr[1],or=Mi(Ee),Pt=Object(V.a)(or,2),Lt=Pt[0],lr=Pt[1];function pr(){Ee&&lr(it())}var wt=Oi(Re,pr),gr=Object(V.a)(wt,2),Fr=gr[0],br=gr[1],kr=Object(A.useRef)();function Dr(){return Ke||it}function Xr(){var _r;(_r=er.current)===null||_r===void 0||_r.forceAlign()}function tn(_r,Lr){var Hr=rt(Lr);ar!==Hr&&Ur(Hr),Fr==="align"&&(ar!==Hr?Promise.resolve().then(function(){Xr()}):br(function(){var jr;(jr=kr.current)===null||jr===void 0||jr.call(kr)}),mt==null||mt(_r,Lr))}var Wr=Object(H.a)({},bn(me));["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach(function(_r){var Lr=Wr[_r];Wr[_r]=function(Hr,jr){return br(),Lr==null?void 0:Lr(Hr,jr)}});function xn(){return new Promise(function(_r){kr.current=_r})}A.useEffect(function(){!Wr.motionName&&Fr==="motion"&&br()},[Wr.motionName,Fr]),A.useImperativeHandle(Ae,function(){return{forceAlign:Xr,getElement:function(){return Zt.current}}});var Vn=Object(H.a)(Object(H.a)({},Lt),{},{zIndex:be,opacity:Fr==="motion"||Fr==="stable"||!Re?void 0:0,pointerEvents:Fr==="stable"?void 0:"none"},he),Dn=!0;(Ie==null?void 0:Ie.points)&&(Fr==="align"||Fr==="stable")&&(Dn=!1);var rn=ae;return A.Children.count(ae)>1&&(rn=A.createElement("div",{className:"".concat(ve,"-content")},ae)),A.createElement(yn,Object(f.a)({visible:Re,ref:Zt,leavedClassName:"".concat(ve,"-hidden")},Wr,{onAppearPrepare:xn,onEnterPrepare:xn,removeOnLeave:Me,forceRender:Te}),function(_r,Lr){var Hr=_r.className,jr=_r.style,Qn=W()(ve,te,ar,Hr);return A.createElement(ni.a,{target:Dr(),key:"popup",ref:er,monitorWindowResize:!0,disabled:Dn,align:Ie,onAlign:tn},A.createElement("div",{ref:Lr,className:Qn,onMouseEnter:Nt,onMouseLeave:$t,onMouseDownCapture:Qt,onTouchStartCapture:Xt,style:Object(H.a)(Object(H.a)({},jr),Vn)},rn))})});mi.displayName="PopupInner";var Pn=mi,ki=A.forwardRef(function(me,Ae){var Re=me.prefixCls,ve=me.visible,te=me.zIndex,he=me.children,ae=me.mobile;ae=ae===void 0?{}:ae;var be=ae.popupClassName,Ee=ae.popupStyle,Me=ae.popupMotion,Te=Me===void 0?{}:Me,Ie=ae.popupRender,Ke=A.useRef();A.useImperativeHandle(Ae,function(){return{forceAlign:function(){},getElement:function(){return Ke.current}}});var it=Object(H.a)({zIndex:te},Ee),rt=he;return A.Children.count(he)>1&&(rt=A.createElement("div",{className:"".concat(Re,"-content")},he)),Ie&&(rt=Ie(rt)),A.createElement(yn,Object(f.a)({visible:ve,ref:Ke,removeOnLeave:!0},Te),function(mt,Nt){var $t=mt.className,Qt=mt.style,Xt=W()(Re,be,$t);return A.createElement("div",{ref:Nt,className:Xt,style:Object(H.a)(Object(H.a)({},Qt),it)},rt)})});ki.displayName="MobilePopupInner";var na=ki,Er=["visible","mobile"],Mt=A.forwardRef(function(me,Ae){var Re=me.visible,ve=me.mobile,te=Object(O.a)(me,Er),he=Object(A.useState)(Re),ae=Object(V.a)(he,2),be=ae[0],Ee=ae[1],Me=Object(A.useState)(!1),Te=Object(V.a)(Me,2),Ie=Te[0],Ke=Te[1],it=Object(H.a)(Object(H.a)({},te),{},{visible:be});Object(A.useEffect)(function(){Ee(Re),Re&&ve&&Ke(q())},[Re,ve]);var rt=Ie?A.createElement(na,Object(f.a)({},it,{mobile:ve,ref:Ae})):A.createElement(Pn,Object(f.a)({},it,{ref:Ae}));return A.createElement("div",null,A.createElement(Di,it),rt)});Mt.displayName="Popup";var Wt=Mt,nr=A.createContext(null),yr=nr;function Jt(){}function Zn(){return""}function un(me){return me?me.ownerDocument:window.document}var Ki=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];function ia(me){var Ae=function(Re){Object(p.a)(te,Re);var ve=Object(c.a)(te);function te(he){var ae;Object(D.a)(this,te),ae=ve.call(this,he),ae.popupRef=A.createRef(),ae.triggerRef=A.createRef(),ae.attachId=void 0,ae.clickOutsideHandler=void 0,ae.touchOutsideHandler=void 0,ae.contextMenuOutsideHandler1=void 0,ae.contextMenuOutsideHandler2=void 0,ae.mouseDownTimeout=void 0,ae.focusTime=void 0,ae.preClickTime=void 0,ae.preTouchTime=void 0,ae.delayTimer=void 0,ae.hasPopupMouseDown=void 0,ae.onMouseEnter=function(Ee){var Me=ae.props.mouseEnterDelay;ae.fireEvents("onMouseEnter",Ee),ae.delaySetPopupVisible(!0,Me,Me?null:Ee)},ae.onMouseMove=function(Ee){ae.fireEvents("onMouseMove",Ee),ae.setPoint(Ee)},ae.onMouseLeave=function(Ee){ae.fireEvents("onMouseLeave",Ee),ae.delaySetPopupVisible(!1,ae.props.mouseLeaveDelay)},ae.onPopupMouseEnter=function(){ae.clearDelayTimer()},ae.onPopupMouseLeave=function(Ee){var Me;if(Ee.relatedTarget&&!Ee.relatedTarget.setTimeout&&Object(ft.a)((Me=ae.popupRef.current)===null||Me===void 0?void 0:Me.getElement(),Ee.relatedTarget))return;ae.delaySetPopupVisible(!1,ae.props.mouseLeaveDelay)},ae.onFocus=function(Ee){ae.fireEvents("onFocus",Ee),ae.clearDelayTimer(),ae.isFocusToShow()&&(ae.focusTime=Date.now(),ae.delaySetPopupVisible(!0,ae.props.focusDelay))},ae.onMouseDown=function(Ee){ae.fireEvents("onMouseDown",Ee),ae.preClickTime=Date.now()},ae.onTouchStart=function(Ee){ae.fireEvents("onTouchStart",Ee),ae.preTouchTime=Date.now()},ae.onBlur=function(Ee){ae.fireEvents("onBlur",Ee),ae.clearDelayTimer(),ae.isBlurToHide()&&ae.delaySetPopupVisible(!1,ae.props.blurDelay)},ae.onContextMenu=function(Ee){Ee.preventDefault(),ae.fireEvents("onContextMenu",Ee),ae.setPopupVisible(!0,Ee)},ae.onContextMenuClose=function(){ae.isContextMenuToShow()&&ae.close()},ae.onClick=function(Ee){if(ae.fireEvents("onClick",Ee),ae.focusTime){var Me;if(ae.preClickTime&&ae.preTouchTime?Me=Math.min(ae.preClickTime,ae.preTouchTime):ae.preClickTime?Me=ae.preClickTime:ae.preTouchTime&&(Me=ae.preTouchTime),Math.abs(Me-ae.focusTime)<20)return;ae.focusTime=0}ae.preClickTime=0,ae.preTouchTime=0,ae.isClickToShow()&&(ae.isClickToHide()||ae.isBlurToHide())&&Ee&&Ee.preventDefault&&Ee.preventDefault();var Te=!ae.state.popupVisible;(ae.isClickToHide()&&!Te||Te&&ae.isClickToShow())&&ae.setPopupVisible(!ae.state.popupVisible,Ee)},ae.onPopupMouseDown=function(){if(ae.hasPopupMouseDown=!0,clearTimeout(ae.mouseDownTimeout),ae.mouseDownTimeout=window.setTimeout(function(){ae.hasPopupMouseDown=!1},0),ae.context){var Ee;(Ee=ae.context).onPopupMouseDown.apply(Ee,arguments)}},ae.onDocumentClick=function(Ee){if(ae.props.mask&&!ae.props.maskClosable)return;var Me=Ee.target,Te=ae.getRootDomNode(),Ie=ae.getPopupDomNode();(!Object(ft.a)(Te,Me)||ae.isContextMenuOnly())&&!Object(ft.a)(Ie,Me)&&!ae.hasPopupMouseDown&&ae.close()},ae.getRootDomNode=function(){var Ee=ae.props.getTriggerDOMNode;if(Ee)return Ee(ae.triggerRef.current);try{var Me=Object(lt.a)(ae.triggerRef.current);if(Me)return Me}catch(Te){}return gt.a.findDOMNode(Object(h.a)(ae))},ae.getPopupClassNameFromAlign=function(Ee){var Me=[],Te=ae.props,Ie=Te.popupPlacement,Ke=Te.builtinPlacements,it=Te.prefixCls,rt=Te.alignPoint,mt=Te.getPopupClassNameFromAlign;return Ie&&Ke&&Me.push(Z(Ke,it,Ee,rt)),mt&&Me.push(mt(Ee)),Me.join(" ")},ae.getComponent=function(){var Ee=ae.props,Me=Ee.prefixCls,Te=Ee.destroyPopupOnHide,Ie=Ee.popupClassName,Ke=Ee.onPopupAlign,it=Ee.popupMotion,rt=Ee.popupAnimation,mt=Ee.popupTransitionName,Nt=Ee.popupStyle,$t=Ee.mask,Qt=Ee.maskAnimation,Xt=Ee.maskTransitionName,er=Ee.maskMotion,Zt=Ee.zIndex,Yt=Ee.popup,fr=Ee.stretch,ar=Ee.alignPoint,Ur=Ee.mobile,or=Ee.forceRender,Pt=ae.state,Lt=Pt.popupVisible,lr=Pt.point,pr=ae.getPopupAlign(),wt={};return ae.isMouseEnterToShow()&&(wt.onMouseEnter=ae.onPopupMouseEnter),ae.isMouseLeaveToHide()&&(wt.onMouseLeave=ae.onPopupMouseLeave),wt.onMouseDown=ae.onPopupMouseDown,wt.onTouchStart=ae.onPopupMouseDown,A.createElement(Wt,Object(f.a)({prefixCls:Me,destroyPopupOnHide:Te,visible:Lt,point:ar&&lr,className:Ie,align:pr,onAlign:Ke,animation:rt,getClassNameFromAlign:ae.getPopupClassNameFromAlign},wt,{stretch:fr,getRootDomNode:ae.getRootDomNode,style:Nt,mask:$t,zIndex:Zt,transitionName:mt,maskAnimation:Qt,maskTransitionName:Xt,maskMotion:er,ref:ae.popupRef,motion:it,mobile:Ur,forceRender:or}),typeof Yt=="function"?Yt():Yt)},ae.attachParent=function(Ee){at.a.cancel(ae.attachId);var Me=ae.props,Te=Me.getPopupContainer,Ie=Me.getDocument,Ke=ae.getRootDomNode(),it;Te?(Ke||Te.length===0)&&(it=Te(Ke)):it=Ie(ae.getRootDomNode()).body,it?it.appendChild(Ee):ae.attachId=Object(at.a)(function(){ae.attachParent(Ee)})},ae.getContainer=function(){var Ee=ae.props.getDocument,Me=Ee(ae.getRootDomNode()).createElement("div");return Me.style.position="absolute",Me.style.top="0",Me.style.left="0",Me.style.width="100%",ae.attachParent(Me),Me},ae.setPoint=function(Ee){var Me=ae.props.alignPoint;if(!Me||!Ee)return;ae.setState({point:{pageX:Ee.pageX,pageY:Ee.pageY}})},ae.handlePortalUpdate=function(){ae.state.prevPopupVisible!==ae.state.popupVisible&&ae.props.afterPopupVisibleChange(ae.state.popupVisible)},ae.triggerContextValue={onPopupMouseDown:ae.onPopupMouseDown};var be;return"popupVisible"in he?be=!!he.popupVisible:be=!!he.defaultPopupVisible,ae.state={prevPopupVisible:be,popupVisible:be},Ki.forEach(function(Ee){ae["fire".concat(Ee)]=function(Me){ae.fireEvents(Ee,Me)}}),ae}return Object(v.a)(te,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var ae=this.props,be=this.state;if(be.popupVisible){var Ee;!this.clickOutsideHandler&&(this.isClickToHide()||this.isContextMenuToShow())&&(Ee=ae.getDocument(this.getRootDomNode()),this.clickOutsideHandler=Object(Ne.a)(Ee,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(Ee=Ee||ae.getDocument(this.getRootDomNode()),this.touchOutsideHandler=Object(Ne.a)(Ee,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(Ee=Ee||ae.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=Object(Ne.a)(Ee,"scroll",this.onContextMenuClose)),!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=Object(Ne.a)(window,"blur",this.onContextMenuClose));return}this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),at.a.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var ae;return((ae=this.popupRef.current)===null||ae===void 0?void 0:ae.getElement())||null}},{key:"getPopupAlign",value:function(){var ae=this.props,be=ae.popupPlacement,Ee=ae.popupAlign,Me=ae.builtinPlacements;return be&&Me?le(Me,be,Ee):Ee}},{key:"setPopupVisible",value:function(ae,be){var Ee=this.props.alignPoint,Me=this.state.popupVisible;this.clearDelayTimer(),Me!==ae&&("popupVisible"in this.props||this.setState({popupVisible:ae,prevPopupVisible:Me}),this.props.onPopupVisibleChange(ae)),Ee&&be&&ae&&this.setPoint(be)}},{key:"delaySetPopupVisible",value:function(ae,be,Ee){var Me=this,Te=be*1e3;if(this.clearDelayTimer(),Te){var Ie=Ee?{pageX:Ee.pageX,pageY:Ee.pageY}:null;this.delayTimer=window.setTimeout(function(){Me.setPopupVisible(ae,Ie),Me.clearDelayTimer()},Te)}else this.setPopupVisible(ae,Ee)}},{key:"clearDelayTimer",value:function(){this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null)}},{key:"clearOutsideHandler",value:function(){this.clickOutsideHandler&&(this.clickOutsideHandler.remove(),this.clickOutsideHandler=null),this.contextMenuOutsideHandler1&&(this.contextMenuOutsideHandler1.remove(),this.contextMenuOutsideHandler1=null),this.contextMenuOutsideHandler2&&(this.contextMenuOutsideHandler2.remove(),this.contextMenuOutsideHandler2=null),this.touchOutsideHandler&&(this.touchOutsideHandler.remove(),this.touchOutsideHandler=null)}},{key:"createTwoChains",value:function(ae){var be=this.props.children.props,Ee=this.props;return be[ae]&&Ee[ae]?this["fire".concat(ae)]:be[ae]||Ee[ae]}},{key:"isClickToShow",value:function(){var ae=this.props,be=ae.action,Ee=ae.showAction;return be.indexOf("click")!==-1||Ee.indexOf("click")!==-1}},{key:"isContextMenuOnly",value:function(){var ae=this.props.action;return ae==="contextMenu"||ae.length===1&&ae[0]==="contextMenu"}},{key:"isContextMenuToShow",value:function(){var ae=this.props,be=ae.action,Ee=ae.showAction;return be.indexOf("contextMenu")!==-1||Ee.indexOf("contextMenu")!==-1}},{key:"isClickToHide",value:function(){var ae=this.props,be=ae.action,Ee=ae.hideAction;return be.indexOf("click")!==-1||Ee.indexOf("click")!==-1}},{key:"isMouseEnterToShow",value:function(){var ae=this.props,be=ae.action,Ee=ae.showAction;return be.indexOf("hover")!==-1||Ee.indexOf("mouseEnter")!==-1}},{key:"isMouseLeaveToHide",value:function(){var ae=this.props,be=ae.action,Ee=ae.hideAction;return be.indexOf("hover")!==-1||Ee.indexOf("mouseLeave")!==-1}},{key:"isFocusToShow",value:function(){var ae=this.props,be=ae.action,Ee=ae.showAction;return be.indexOf("focus")!==-1||Ee.indexOf("focus")!==-1}},{key:"isBlurToHide",value:function(){var ae=this.props,be=ae.action,Ee=ae.hideAction;return be.indexOf("focus")!==-1||Ee.indexOf("blur")!==-1}},{key:"forcePopupAlign",value:function(){if(this.state.popupVisible){var ae;(ae=this.popupRef.current)===null||ae===void 0||ae.forceAlign()}}},{key:"fireEvents",value:function(ae,be){var Ee=this.props.children.props[ae];Ee&&Ee(be);var Me=this.props[ae];Me&&Me(be)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var ae=this.state.popupVisible,be=this.props,Ee=be.children,Me=be.forceRender,Te=be.alignPoint,Ie=be.className,Ke=be.autoDestroy,it=A.Children.only(Ee),rt={key:"trigger"};this.isContextMenuToShow()?rt.onContextMenu=this.onContextMenu:rt.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(rt.onClick=this.onClick,rt.onMouseDown=this.onMouseDown,rt.onTouchStart=this.onTouchStart):(rt.onClick=this.createTwoChains("onClick"),rt.onMouseDown=this.createTwoChains("onMouseDown"),rt.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(rt.onMouseEnter=this.onMouseEnter,Te&&(rt.onMouseMove=this.onMouseMove)):rt.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?rt.onMouseLeave=this.onMouseLeave:rt.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(rt.onFocus=this.onFocus,rt.onBlur=this.onBlur):(rt.onFocus=this.createTwoChains("onFocus"),rt.onBlur=this.createTwoChains("onBlur"));var mt=W()(it&&it.props&&it.props.className,Ie);mt&&(rt.className=mt);var Nt=Object(H.a)({},rt);Object(Ye.c)(it)&&(Nt.ref=Object(Ye.a)(this.triggerRef,it.ref));var $t=A.cloneElement(it,Nt),Qt;return(ae||this.popupRef.current||Me)&&(Qt=A.createElement(me,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!ae&&Ke&&(Qt=null),A.createElement(yr.Provider,{value:this.triggerContextValue},$t,Qt)}}],[{key:"getDerivedStateFromProps",value:function(ae,be){var Ee=ae.popupVisible,Me={};return Ee!==void 0&&be.popupVisible!==Ee&&(Me.popupVisible=Ee,Me.prevPopupVisible=be.popupVisible),Me}}]),te}(A.Component);return Ae.contextType=yr,Ae.defaultProps={prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:Zn,getDocument:un,onPopupVisibleChange:Jt,afterPopupVisibleChange:Jt,onPopupAlign:Jt,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1},Ae}var Gn=ia(ht.a),En={adjustX:1,adjustY:1},dn={topLeft:{points:["bl","tl"],overflow:En,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:En,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:En,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:En,offset:[4,0]}},gi={topLeft:{points:["bl","tl"],overflow:En,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:En,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:En,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:En,offset:[4,0]}},ii=dn,vi=0,Li={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},qn=function(Ae,Re,ve){var te=ge(Re),he=Ae.getState();Ae.setState({defaultActiveFirst:Object(H.a)(Object(H.a)({},he.defaultActiveFirst),{},Object(de.a)({},te,ve))})},$n=function(me){Object(p.a)(Re,me);var Ae=Object(c.a)(Re);function Re(ve){var te;Object(D.a)(this,Re),te=Ae.call(this,ve),te.onDestroy=function(Te){te.props.onDestroy(Te)},te.onKeyDown=function(Te){var Ie=Te.keyCode,Ke=te.menuInstance,it=te.props.store,rt=te.getVisible();if(Ie===y.a.ENTER)return te.onTitleClick(Te),qn(it,te.props.eventKey,!0),!0;if(Ie===y.a.RIGHT)return rt?Ke.onKeyDown(Te):(te.triggerOpenChange(!0),qn(it,te.props.eventKey,!0)),!0;if(Ie===y.a.LEFT){var mt;if(rt)mt=Ke.onKeyDown(Te);else return;return mt||(te.triggerOpenChange(!1),mt=!0),mt}return rt&&(Ie===y.a.UP||Ie===y.a.DOWN)?Ke.onKeyDown(Te):void 0},te.onOpenChange=function(Te){te.props.onOpenChange(Te)},te.onPopupVisibleChange=function(Te){te.triggerOpenChange(Te,Te?"mouseenter":"mouseleave")},te.onMouseEnter=function(Te){var Ie=te.props,Ke=Ie.eventKey,it=Ie.onMouseEnter,rt=Ie.store;qn(rt,te.props.eventKey,!1),it({key:Ke,domEvent:Te})},te.onMouseLeave=function(Te){var Ie=te.props,Ke=Ie.parentMenu,it=Ie.eventKey,rt=Ie.onMouseLeave;Ke.subMenuInstance=Object(h.a)(te),rt({key:it,domEvent:Te})},te.onTitleMouseEnter=function(Te){var Ie=te.props,Ke=Ie.eventKey,it=Ie.onItemHover,rt=Ie.onTitleMouseEnter;it({key:Ke,hover:!0}),rt({key:Ke,domEvent:Te})},te.onTitleMouseLeave=function(Te){var Ie=te.props,Ke=Ie.parentMenu,it=Ie.eventKey,rt=Ie.onItemHover,mt=Ie.onTitleMouseLeave;Ke.subMenuInstance=Object(h.a)(te),rt({key:it,hover:!1}),mt({key:it,domEvent:Te})},te.onTitleClick=function(Te){var Ie=Object(h.a)(te),Ke=Ie.props;if(Ke.onTitleClick({key:Ke.eventKey,domEvent:Te}),Ke.triggerSubMenuAction==="hover")return;te.triggerOpenChange(!te.getVisible(),"click"),qn(Ke.store,te.props.eventKey,!1)},te.onSubMenuClick=function(Te){typeof te.props.onClick=="function"&&te.props.onClick(te.addKeyPath(Te))},te.onSelect=function(Te){te.props.onSelect(Te)},te.onDeselect=function(Te){te.props.onDeselect(Te)},te.getPrefixCls=function(){return"".concat(te.props.rootPrefixCls,"-submenu")},te.getActiveClassName=function(){return"".concat(te.getPrefixCls(),"-active")},te.getDisabledClassName=function(){return"".concat(te.getPrefixCls(),"-disabled")},te.getSelectedClassName=function(){return"".concat(te.getPrefixCls(),"-selected")},te.getOpenClassName=function(){return"".concat(te.props.rootPrefixCls,"-submenu-open")},te.getVisible=function(){return te.state.isOpen},te.getMode=function(){return te.state.mode},te.saveMenuInstance=function(Te){te.menuInstance=Te},te.addKeyPath=function(Te){return Object(H.a)(Object(H.a)({},Te),{},{keyPath:(Te.keyPath||[]).concat(te.props.eventKey)})},te.triggerOpenChange=function(Te,Ie){var Ke=te.props.eventKey,it=function(){te.onOpenChange({key:Ke,item:Object(h.a)(te),trigger:Ie,open:Te})};Ie==="mouseenter"?te.mouseenterTimeout=setTimeout(function(){it()},0):it()},te.isChildrenSelected=function(){var Te={find:!1};return je(te.props.children,te.props.selectedKeys,Te),Te.find},te.isInlineMode=function(){return te.getMode()==="inline"},te.adjustWidth=function(){if(!te.subMenuTitle||!te.menuInstance)return;var Te=ct.findDOMNode(te.menuInstance);if(Te.offsetWidth>=te.subMenuTitle.offsetWidth)return;Te.style.minWidth="".concat(te.subMenuTitle.offsetWidth,"px")},te.saveSubMenuTitle=function(Te){te.subMenuTitle=Te},te.getBaseProps=function(){var Te=Object(h.a)(te),Ie=Te.props,Ke=te.getMode();return{mode:Ke==="horizontal"?"vertical":Ke,visible:te.getVisible(),level:Ie.level+1,inlineIndent:Ie.inlineIndent,focusable:!1,onClick:te.onSubMenuClick,onSelect:te.onSelect,onDeselect:te.onDeselect,onDestroy:te.onDestroy,selectedKeys:Ie.selectedKeys,eventKey:"".concat(Ie.eventKey,"-menu-"),openKeys:Ie.openKeys,motion:Ie.motion,onOpenChange:te.onOpenChange,subMenuOpenDelay:Ie.subMenuOpenDelay,parentMenu:Object(h.a)(te),subMenuCloseDelay:Ie.subMenuCloseDelay,forceSubMenuRender:Ie.forceSubMenuRender,triggerSubMenuAction:Ie.triggerSubMenuAction,builtinPlacements:Ie.builtinPlacements,defaultActiveFirst:Ie.store.getState().defaultActiveFirst[ge(Ie.eventKey)],multiple:Ie.multiple,prefixCls:Ie.rootPrefixCls,id:te.internalMenuId,manualRef:te.saveMenuInstance,itemIcon:Ie.itemIcon,expandIcon:Ie.expandIcon,direction:Ie.direction}},te.getMotion=function(Te,Ie){var Ke=Object(h.a)(te),it=Ke.haveRendered,rt=te.props,mt=rt.motion,Nt=rt.rootPrefixCls,$t=Object(H.a)(Object(H.a)({},mt),{},{leavedClassName:"".concat(Nt,"-hidden"),removeOnLeave:!1,motionAppear:it||!Ie||Te!=="inline"});return $t};var he=ve.store,ae=ve.eventKey,be=he.getState(),Ee=be.defaultActiveFirst;te.isRootMenu=!1;var Me=!1;return Ee&&(Me=Ee[ae]),qn(he,ae,Me),te.state={mode:ve.mode,isOpen:ve.isOpen},te}return Object(v.a)(Re,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var te=this,he=this.props,ae=he.mode,be=he.parentMenu,Ee=he.manualRef,Me=he.isOpen,Te=function(){te.setState({mode:ae,isOpen:Me})},Ie=Me!==this.state.isOpen,Ke=ae!==this.state.mode;if((Ke||Ie)&&(at.a.cancel(this.updateStateRaf),Ke?this.updateStateRaf=Object(at.a)(Te):Te()),Ee&&Ee(this),ae!=="horizontal"||!(be==null?void 0:be.isRootMenu)||!Me)return;this.minWidthTimeout=setTimeout(function(){return te.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var te=this.props,he=te.onDestroy,ae=te.eventKey;he&&he(ae),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout),at.a.cancel(this.updateStateRaf)}},{key:"renderPopupMenu",value:function(te,he){var ae=this.getBaseProps();return A.createElement(sa,Object(f.a)({},ae,{id:this.internalMenuId,className:te,style:he}),this.props.children)}},{key:"renderChildren",value:function(){var te=this,he=this.getBaseProps(),ae=he.mode,be=he.visible,Ee=he.forceSubMenuRender,Me=he.direction,Te=this.getMotion(ae,be);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||be||Ee,!this.haveOpened)return A.createElement("div",null);var Ie=W()("".concat(he.prefixCls,"-sub"),Object(de.a)({},"".concat(he.prefixCls,"-rtl"),Me==="rtl"));return this.isInlineMode()?A.createElement(yn,Object(f.a)({visible:he.visible,forceRender:Ee},Te),function(Ke){var it=Ke.className,rt=Ke.style,mt=W()(Ie,it);return te.renderPopupMenu(mt,rt)}):this.renderPopupMenu(Ie)}},{key:"render",value:function(){var te,he,ae,be=Object(H.a)({},this.props),Ee=this.getVisible(),Me=this.getPrefixCls(),Te=this.isInlineMode(),Ie=this.getMode(),Ke=W()(Me,"".concat(Me,"-").concat(Ie),(te={},Object(de.a)(te,be.className,!!be.className),Object(de.a)(te,this.getOpenClassName(),Ee),Object(de.a)(te,this.getActiveClassName(),be.active||Ee&&!Te),Object(de.a)(te,this.getDisabledClassName(),be.disabled),Object(de.a)(te,this.getSelectedClassName(),this.isChildrenSelected()),te));this.internalMenuId||(be.eventKey?this.internalMenuId="".concat(be.eventKey,"$Menu"):(vi+=1,this.internalMenuId="$__$".concat(vi,"$Menu")));var it={},rt={},mt={};be.disabled||(it={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},rt={onClick:this.onTitleClick},mt={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var Nt={},$t=be.direction,Qt=$t==="rtl";Te&&(Qt?Nt.paddingRight=be.inlineIndent*be.level:Nt.paddingLeft=be.inlineIndent*be.level);var Xt={};this.getVisible()&&(Xt={"aria-owns":this.internalMenuId});var er=null;Ie!=="horizontal"&&(er=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(er=A.createElement(this.props.expandIcon,Object(H.a)({},this.props))));var Zt=A.createElement("div",Object(f.a)({ref:this.saveSubMenuTitle,style:Nt,className:"".concat(Me,"-title"),role:"button"},mt,rt,{"aria-expanded":Ee},Xt,{"aria-haspopup":"true",title:typeof be.title=="string"?be.title:void 0}),be.title,er||A.createElement("i",{className:"".concat(Me,"-arrow")})),Yt=this.renderChildren(),fr=((he=be.parentMenu)===null||he===void 0?void 0:he.isRootMenu)?be.parentMenu.props.getPopupContainer:function(Dr){return Dr.parentNode},ar=Li[Ie],Ur=be.popupOffset?{offset:be.popupOffset}:{},or=W()((ae={},Object(de.a)(ae,be.popupClassName,be.popupClassName&&!Te),Object(de.a)(ae,"".concat(Me,"-rtl"),Qt),ae)),Pt=be.disabled,Lt=be.triggerSubMenuAction,lr=be.subMenuOpenDelay,pr=be.forceSubMenuRender,wt=be.subMenuCloseDelay,gr=be.builtinPlacements;Ze.forEach(function(Dr){return delete be[Dr]}),delete be.onClick;var Fr=Qt?Object(H.a)(Object(H.a)({},gi),gr):Object(H.a)(Object(H.a)({},dn),gr);delete be.direction;var br=this.getBaseProps(),kr=Te?null:this.getMotion(br.mode,br.visible);return A.createElement("li",Object(f.a)({},be,it,{className:Ke,role:"menuitem"}),A.createElement(Gn,{prefixCls:Me,popupClassName:W()("".concat(Me,"-popup"),or),getPopupContainer:fr,builtinPlacements:Fr,popupPlacement:ar,popupVisible:Te?!1:Ee,popupAlign:Ur,popup:Te?null:Yt,action:Pt||Te?[]:[Lt],mouseEnterDelay:lr,mouseLeaveDelay:wt,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:pr,popupMotion:kr},Zt),Te?Yt:null)}}]),Re}(A.Component);$n.defaultProps={onMouseEnter:$,onMouseLeave:$,onTitleMouseEnter:$,onTitleMouseLeave:$,onTitleClick:$,manualRef:$,mode:"vertical",title:""};var ei=Object(o.b)(function(me,Ae){var Re=me.openKeys,ve=me.activeKey,te=me.selectedKeys,he=Ae.eventKey,ae=Ae.subMenuKey;return{isOpen:Re.indexOf(he)>-1,active:ve[ae]===he,selectedKeys:te}})($n);ei.isSubMenu=!0;var ai=ei,Ii="menuitem-overflowed",ga=.5,Tn=function(me){Object(p.a)(Re,me);var Ae=Object(c.a)(Re);function Re(){var ve;return Object(D.a)(this,Re),ve=Ae.apply(this,arguments),ve.resizeObserver=null,ve.mutationObserver=null,ve.originalTotalWidth=0,ve.overflowedItems=[],ve.menuItemSizes=[],ve.cancelFrameId=null,ve.state={lastVisibleIndex:void 0},ve.childRef=A.createRef(),ve.getMenuItemNodes=function(){var te=ve.props.prefixCls,he=ve.childRef.current;return he?[].slice.call(he.children).filter(function(ae){return ae.className.split(" ").indexOf("".concat(te,"-overflowed-submenu"))<0}):[]},ve.getOverflowedSubMenuItem=function(te,he,ae){var be=ve.props,Ee=be.overflowedIndicator,Me=be.level,Te=be.mode,Ie=be.prefixCls,Ke=be.theme;if(Me!==1||Te!=="horizontal")return null;var it=ve.props.children[0],rt=it.props,mt=rt.children,Nt=rt.title,$t=rt.style,Qt=Object(O.a)(rt,["children","title","style"]),Xt=Object(H.a)({},$t),er="".concat(te,"-overflowed-indicator"),Zt="".concat(te,"-overflowed-indicator");he.length===0&&ae!==!0?Xt=Object(H.a)(Object(H.a)({},Xt),{},{display:"none"}):ae&&(Xt=Object(H.a)(Object(H.a)({},Xt),{},{visibility:"hidden",position:"absolute"}),er="".concat(er,"-placeholder"),Zt="".concat(Zt,"-placeholder"));var Yt=Ke?"".concat(Ie,"-").concat(Ke):"",fr={};return Ze.forEach(function(ar){Qt[ar]!==void 0&&(fr[ar]=Qt[ar])}),A.createElement(ai,Object(f.a)({title:Ee,className:"".concat(Ie,"-overflowed-submenu"),popupClassName:Yt},fr,{key:er,eventKey:Zt,disabled:!1,style:Xt}),he)},ve.setChildrenWidthAndResize=function(){if(ve.props.mode!=="horizontal")return;var te=ve.childRef.current;if(!te)return;var he=te.children;if(!he||he.length===0)return;var ae=te.children[he.length-1];ze(ae,"display","inline-block");var be=ve.getMenuItemNodes(),Ee=be.filter(function(Me){return Me.className.split(" ").indexOf(Ii)>=0});Ee.forEach(function(Me){ze(Me,"display","inline-block")}),ve.menuItemSizes=be.map(function(Me){return He(Me,!0)}),Ee.forEach(function(Me){ze(Me,"display","none")}),ve.overflowedIndicatorWidth=He(te.children[te.children.length-1],!0),ve.originalTotalWidth=ve.menuItemSizes.reduce(function(Me,Te){return Me+Te},0),ve.handleResize(),ze(ae,"display","none")},ve.handleResize=function(){if(ve.props.mode!=="horizontal")return;var te=ve.childRef.current;if(!te)return;var he=He(te);ve.overflowedItems=[];var ae=0,be;ve.originalTotalWidth>he+ga&&(be=-1,ve.menuItemSizes.forEach(function(Ee){ae+=Ee,ae+ve.overflowedIndicatorWidth<=he&&(be+=1)})),ve.setState({lastVisibleIndex:be})},ve}return Object(v.a)(Re,[{key:"componentDidMount",value:function(){var te=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var he=this.childRef.current;if(!he)return;this.resizeObserver=new dt.default(function(ae){ae.forEach(function(){var be=te.cancelFrameId;cancelAnimationFrame(be),te.cancelFrameId=requestAnimationFrame(te.setChildrenWidthAndResize)})}),[].slice.call(he.children).concat(he).forEach(function(ae){te.resizeObserver.observe(ae)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){te.resizeObserver.disconnect(),[].slice.call(he.children).concat(he).forEach(function(ae){te.resizeObserver.observe(ae)}),te.setChildrenWidthAndResize()}),this.mutationObserver.observe(he,{attributes:!1,childList:!0,subTree:!1}))}}},{key:"componentWillUnmount",value:function(){this.resizeObserver&&this.resizeObserver.disconnect(),this.mutationObserver&&this.mutationObserver.disconnect(),cancelAnimationFrame(this.cancelFrameId)}},{key:"renderChildren",value:function(te){var he=this,ae=this.state.lastVisibleIndex;return(te||[]).reduce(function(be,Ee,Me){var Te=Ee;if(he.props.mode==="horizontal"){var Ie=he.getOverflowedSubMenuItem(Ee.props.eventKey,[]);ae!==void 0&&he.props.className.indexOf("".concat(he.props.prefixCls,"-root"))!==-1&&(Me>ae&&(Te=A.cloneElement(Ee,{style:{display:"none"},eventKey:"".concat(Ee.props.eventKey,"-hidden"),className:"".concat(Ii)})),Me===ae+1&&(he.overflowedItems=te.slice(ae+1).map(function(it){return A.cloneElement(it,{key:it.props.eventKey,mode:"vertical-left"})}),Ie=he.getOverflowedSubMenuItem(Ee.props.eventKey,he.overflowedItems)));var Ke=[].concat(Object(L.a)(be),[Ie,Te]);return Me===te.length-1&&Ke.push(he.getOverflowedSubMenuItem(Ee.props.eventKey,[],!0)),Ke}return[].concat(Object(L.a)(be),[Te])},[])}},{key:"render",value:function(){var te=this.props,he=te.visible,ae=te.prefixCls,be=te.overflowedIndicator,Ee=te.mode,Me=te.level,Te=te.tag,Ie=te.children,Ke=te.theme,it=Object(O.a)(te,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),rt=Te;return A.createElement(rt,Object(f.a)({ref:this.childRef},it),this.renderChildren(Ie))}}]),Re}(A.Component);Tn.defaultProps={tag:"div",className:""};var va=Tn;function zi(me){return me.length?me.every(function(Ae){return!!Ae.props.disabled}):!0}function yi(me,Ae,Re){var ve=me.getState();me.setState({activeKey:Object(H.a)(Object(H.a)({},ve.activeKey),{},Object(de.a)({},Ae,Re))})}function _n(me){return me.eventKey||"0-menu-"}function Nn(me,Ae){var Re=Ae,ve=me.children,te=me.eventKey;if(Re){var he;if(Oe(ve,function(ae,be){ae&&ae.props&&!ae.props.disabled&&Re===B(ae,te,be)&&(he=!0)}),he)return Re}return Re=null,me.defaultActiveFirst&&Oe(ve,function(ae,be){!Re&&ae&&!ae.props.disabled&&(Re=B(ae,te,be))}),Re}function aa(me){if(!me)return;var Ae=this.instanceArray.indexOf(me);Ae!==-1?this.instanceArray[Ae]=me:this.instanceArray.push(me)}var Wn=function(me){Object(p.a)(Re,me);var Ae=Object(c.a)(Re);function Re(ve){var te;return Object(D.a)(this,Re),te=Ae.call(this,ve),te.onKeyDown=function(he,ae){var be=he.keyCode,Ee;if(te.getFlatInstanceArray().forEach(function(Te){Te&&Te.props.active&&Te.onKeyDown&&(Ee=Te.onKeyDown(he))}),Ee)return 1;var Me=null;return(be===y.a.UP||be===y.a.DOWN)&&(Me=te.step(be===y.a.UP?-1:1)),Me?(he.preventDefault(),yi(te.props.store,_n(te.props),Me.props.eventKey),typeof ae=="function"&&ae(Me),1):void 0},te.onItemHover=function(he){var ae=he.key,be=he.hover;yi(te.props.store,_n(te.props),be?ae:null)},te.onDeselect=function(he){te.props.onDeselect(he)},te.onSelect=function(he){te.props.onSelect(he)},te.onClick=function(he){te.props.onClick(he)},te.onOpenChange=function(he){te.props.onOpenChange(he)},te.onDestroy=function(he){te.props.onDestroy(he)},te.getFlatInstanceArray=function(){return te.instanceArray},te.step=function(he){var ae=te.getFlatInstanceArray(),be=te.props.store.getState().activeKey[_n(te.props)],Ee=ae.length;if(!Ee)return null;he<0&&(ae=ae.concat().reverse());var Me=-1;if(ae.every(function(it,rt){return it&&it.props.eventKey===be?(Me=rt,!1):!0}),!te.props.defaultActiveFirst&&Me!==-1&&zi(ae.slice(Me,Ee-1)))return;var Te=(Me+1)%Ee,Ie=Te;do{var Ke=ae[Ie];if(!Ke||Ke.props.disabled)Ie=(Ie+1)%Ee;else return Ke}while(Ie!==Te);return null},te.renderCommonMenuItem=function(he,ae,be){var Ee=te.props.store.getState(),Me=Object(h.a)(te),Te=Me.props,Ie=B(he,Te.eventKey,ae),Ke=he.props;if(!Ke||typeof he.type=="string")return he;var it=Ie===Ee.activeKey,rt=Object(H.a)(Object(H.a)({mode:Ke.mode||Te.mode,level:Te.level,inlineIndent:Te.inlineIndent,renderMenuItem:te.renderMenuItem,rootPrefixCls:Te.prefixCls,index:ae,parentMenu:Te.parentMenu,manualRef:Ke.disabled?void 0:Object(g.a)(he.ref,aa.bind(Object(h.a)(te))),eventKey:Ie,active:!Ke.disabled&&it,multiple:Te.multiple,onClick:function(Nt){(Ke.onClick||$)(Nt),te.onClick(Nt)},onItemHover:te.onItemHover,motion:Te.motion,subMenuOpenDelay:Te.subMenuOpenDelay,subMenuCloseDelay:Te.subMenuCloseDelay,forceSubMenuRender:Te.forceSubMenuRender,onOpenChange:te.onOpenChange,onDeselect:te.onDeselect,onSelect:te.onSelect,builtinPlacements:Te.builtinPlacements,itemIcon:Ke.itemIcon||te.props.itemIcon,expandIcon:Ke.expandIcon||te.props.expandIcon},be),{},{direction:Te.direction});return(Te.mode==="inline"||Xe())&&(rt.triggerSubMenuAction="click"),A.cloneElement(he,Object(H.a)(Object(H.a)({},rt),{},{key:Ie||ae}))},te.renderMenuItem=function(he,ae,be){if(!he)return null;var Ee=te.props.store.getState(),Me={openKeys:Ee.openKeys,selectedKeys:Ee.selectedKeys,triggerSubMenuAction:te.props.triggerSubMenuAction,subMenuKey:be};return te.renderCommonMenuItem(he,ae,Me)},ve.store.setState({activeKey:Object(H.a)(Object(H.a)({},ve.store.getState().activeKey),{},Object(de.a)({},ve.eventKey,Nn(ve,ve.activeKey)))}),te.instanceArray=[],te}return Object(v.a)(Re,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(te){return this.props.visible||te.visible||this.props.className!==te.className||!_()(this.props.style,te.style)}},{key:"componentDidUpdate",value:function(te){var he=this.props,ae="activeKey"in he?he.activeKey:he.store.getState().activeKey[_n(he)],be=Nn(he,ae);if(be!==ae)yi(he.store,_n(he),be);else if("activeKey"in te){var Ee=Nn(te,te.activeKey);be!==Ee&&yi(he.store,_n(he),be)}}},{key:"render",value:function(){var te=this,he=Object(f.a)({},this.props);this.instanceArray=[];var ae=W()(he.prefixCls,he.className,"".concat(he.prefixCls,"-").concat(he.mode)),be={className:ae,role:he.role||"menu"};he.id&&(be.id=he.id),he.focusable&&(be.tabIndex=0,be.onKeyDown=this.onKeyDown);var Ee=he.prefixCls,Me=he.eventKey,Te=he.visible,Ie=he.level,Ke=he.mode,it=he.overflowedIndicator,rt=he.theme;return Ze.forEach(function(mt){return delete he[mt]}),delete he.onClick,A.createElement(va,Object(f.a)({},he,{prefixCls:Ee,mode:Ke,tag:"ul",level:Ie,theme:rt,visible:Te,overflowedIndicator:it},be),Object(U.a)(he.children).map(function(mt,Nt){return te.renderMenuItem(mt,Nt,Me||"0-menu-")}))}}]),Re}(A.Component);Wn.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:$};var oa=Object(o.b)()(Wn),sa=oa,Pi=X("Kwbf");function Ua(me,Ae,Re){var ve=me.prefixCls,te=me.motion,he=me.defaultMotions,ae=he===void 0?{}:he,be=me.openAnimation,Ee=me.openTransitionName,Me=Ae.switchingModeFromInline;if(te)return te;if(Object(z.a)(be)==="object"&&be)Object(Pi.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof be=="string")return{motionName:"".concat(ve,"-open-").concat(be)};if(Ee)return{motionName:Ee};var Te=ae[Re];return Te||(Me?null:ae.other)}var Dt=function(me){Object(p.a)(Re,me);var Ae=Object(c.a)(Re);function Re(ve){var te;Object(D.a)(this,Re),te=Ae.call(this,ve),te.onSelect=function(be){var Ee=Object(h.a)(te),Me=Ee.props;if(Me.selectable){var Te=te.store.getState(),Ie=Te.selectedKeys,Ke=be.key;Me.multiple?Ie=Ie.concat([Ke]):Ie=[Ke],"selectedKeys"in Me||te.store.setState({selectedKeys:Ie}),Me.onSelect(Object(H.a)(Object(H.a)({},be),{},{selectedKeys:Ie}))}},te.onClick=function(be){var Ee=te.getRealMenuMode(),Me=Object(h.a)(te),Te=Me.store,Ie=Me.props.onOpenChange;Ee!=="inline"&&!("openKeys"in te.props)&&(Te.setState({openKeys:[]}),Ie([])),te.props.onClick(be)},te.onKeyDown=function(be,Ee){te.innerMenu.getWrappedInstance().onKeyDown(be,Ee)},te.onOpenChange=function(be){var Ee=Object(h.a)(te),Me=Ee.props,Te=te.store.getState().openKeys.concat(),Ie=!1,Ke=function(rt){var mt=!1;if(rt.open)mt=Te.indexOf(rt.key)===-1,mt&&Te.push(rt.key);else{var Nt=Te.indexOf(rt.key);mt=Nt!==-1,mt&&Te.splice(Nt,1)}Ie=Ie||mt};Array.isArray(be)?be.forEach(Ke):Ke(be),Ie&&("openKeys"in te.props||te.store.setState({openKeys:Te}),Me.onOpenChange(Te))},te.onDeselect=function(be){var Ee=Object(h.a)(te),Me=Ee.props;if(Me.selectable){var Te=te.store.getState().selectedKeys.concat(),Ie=be.key,Ke=Te.indexOf(Ie);Ke!==-1&&Te.splice(Ke,1),"selectedKeys"in Me||te.store.setState({selectedKeys:Te}),Me.onDeselect(Object(H.a)(Object(H.a)({},be),{},{selectedKeys:Te}))}},te.onMouseEnter=function(be){te.restoreModeVerticalFromInline();var Ee=te.props.onMouseEnter;Ee&&Ee(be)},te.onTransitionEnd=function(be){var Ee=be.propertyName==="width"&&be.target===be.currentTarget,Me=be.target.className,Te=Object.prototype.toString.call(Me)==="[object SVGAnimatedString]"?Me.animVal:Me,Ie=be.propertyName==="font-size"&&Te.indexOf("anticon")>=0;(Ee||Ie)&&te.restoreModeVerticalFromInline()},te.setInnerMenu=function(be){te.innerMenu=be},te.isRootMenu=!0;var he=ve.defaultSelectedKeys,ae=ve.defaultOpenKeys;return"selectedKeys"in ve&&(he=ve.selectedKeys||[]),"openKeys"in ve&&(ae=ve.openKeys||[]),te.store=Object(o.c)({selectedKeys:he,openKeys:ae,activeKey:{"0-menu-":Nn(ve,ve.activeKey)}}),te.state={switchingModeFromInline:!1,prevProps:ve,inlineOpenKeys:[],store:te.store},te}return Object(v.a)(Re,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(te){var he=this.props,ae=he.siderCollapsed,be=he.inlineCollapsed,Ee=he.onOpenChange;(!te.inlineCollapsed&&be||!te.siderCollapsed&&ae)&&Ee([]),this.updateMiniStore(),this.updateMenuDisplay()}},{key:"updateMenuDisplay",value:function(){var te=this.props.collapsedWidth,he=this.store,ae=this.prevOpenKeys,be=this.getInlineCollapsed()&&(te===0||te==="0"||te==="0px");be?(this.prevOpenKeys=he.getState().openKeys.concat(),this.store.setState({openKeys:[]})):ae&&(this.store.setState({openKeys:ae}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var te=this.props.mode,he=this.state.switchingModeFromInline,ae=this.getInlineCollapsed();return he&&ae?"inline":ae?"vertical":te}},{key:"getInlineCollapsed",value:function(){var te=this.props,he=te.inlineCollapsed,ae=te.siderCollapsed;return ae!==void 0?ae:he}},{key:"restoreModeVerticalFromInline",value:function(){var te=this.state.switchingModeFromInline;te&&this.setState({switchingModeFromInline:!1})}},{key:"updateMiniStore",value:function(){"selectedKeys"in this.props&&this.store.setState({selectedKeys:this.props.selectedKeys||[]}),"openKeys"in this.props&&this.store.setState({openKeys:this.props.openKeys||[]})}},{key:"render",value:function(){var te=Object(H.a)({},Object(x.a)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),he=this.getRealMenuMode();return te.className+=" ".concat(te.prefixCls,"-root"),te.direction==="rtl"&&(te.className+=" ".concat(te.prefixCls,"-rtl")),te=Object(H.a)(Object(H.a)({},te),{},{mode:he,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:Ua(this.props,this.state,he)}),delete te.openAnimation,delete te.openTransitionName,A.createElement(o.a,{store:this.store},A.createElement(sa,Object(f.a)({},te,{ref:this.setInnerMenu}),this.props.children))}}],[{key:"getDerivedStateFromProps",value:function(te,he){var ae=he.prevProps,be=he.store,Ee=be.getState(),Me={},Te={prevProps:te};return ae.mode==="inline"&&te.mode!=="inline"&&(Te.switchingModeFromInline=!0),"openKeys"in te?Me.openKeys=te.openKeys||[]:((te.inlineCollapsed&&!ae.inlineCollapsed||te.siderCollapsed&&!ae.siderCollapsed)&&(Te.switchingModeFromInline=!0,Te.inlineOpenKeys=Ee.openKeys,Me.openKeys=[]),(!te.inlineCollapsed&&ae.inlineCollapsed||!te.siderCollapsed&&ae.siderCollapsed)&&(Me.openKeys=he.inlineOpenKeys,Te.inlineOpenKeys=[])),Object.keys(Me).length&&be.setState(Me),Te}}]),Re}(A.Component);Dt.defaultProps={selectable:!0,onClick:$,onSelect:$,onOpenChange:$,onDeselect:$,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:A.createElement("span",null,"\xB7\xB7\xB7")};var Kt=Dt,kt=function(me){Object(p.a)(Re,me);var Ae=Object(c.a)(Re);function Re(){var ve;return Object(D.a)(this,Re),ve=Ae.apply(this,arguments),ve.onKeyDown=function(te){var he=te.keyCode;return he===y.a.ENTER?(ve.onClick(te),!0):void 0},ve.onMouseLeave=function(te){var he=ve.props,ae=he.eventKey,be=he.onItemHover,Ee=he.onMouseLeave;be({key:ae,hover:!1}),Ee({key:ae,domEvent:te})},ve.onMouseEnter=function(te){var he=ve.props,ae=he.eventKey,be=he.onItemHover,Ee=he.onMouseEnter;be({key:ae,hover:!0}),Ee({key:ae,domEvent:te})},ve.onClick=function(te){var he=ve.props,ae=he.eventKey,be=he.multiple,Ee=he.onClick,Me=he.onSelect,Te=he.onDeselect,Ie=he.isSelected,Ke={key:ae,keyPath:[ae],item:Object(h.a)(ve),domEvent:te};Ee(Ke),be?Ie?Te(Ke):Me(Ke):Ie||Me(Ke)},ve.saveNode=function(te){ve.node=te},ve}return Object(v.a)(Re,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var te=this.props;te.onDestroy&&te.onDestroy(te.eventKey)}},{key:"getPrefixCls",value:function(){return"".concat(this.props.rootPrefixCls,"-item")}},{key:"getActiveClassName",value:function(){return"".concat(this.getPrefixCls(),"-active")}},{key:"getSelectedClassName",value:function(){return"".concat(this.getPrefixCls(),"-selected")}},{key:"getDisabledClassName",value:function(){return"".concat(this.getPrefixCls(),"-disabled")}},{key:"callRef",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"render",value:function(){var te,he=Object(H.a)({},this.props),ae=W()(this.getPrefixCls(),he.className,(te={},Object(de.a)(te,this.getActiveClassName(),!he.disabled&&he.active),Object(de.a)(te,this.getSelectedClassName(),he.isSelected),Object(de.a)(te,this.getDisabledClassName(),he.disabled),te)),be=Object(H.a)(Object(H.a)({},he.attribute),{},{title:typeof he.title=="string"?he.title:void 0,className:ae,role:he.role||"menuitem","aria-disabled":he.disabled});he.role==="option"?be=Object(H.a)(Object(H.a)({},be),{},{role:"option","aria-selected":he.isSelected}):(he.role===null||he.role==="none")&&(be.role="none");var Ee={onClick:he.disabled?null:this.onClick,onMouseLeave:he.disabled?null:this.onMouseLeave,onMouseEnter:he.disabled?null:this.onMouseEnter},Me=Object(H.a)({},he.style);he.mode==="inline"&&(he.direction==="rtl"?Me.paddingRight=he.inlineIndent*he.level:Me.paddingLeft=he.inlineIndent*he.level),Ze.forEach(function(Ie){return delete he[Ie]}),delete he.direction;var Te=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(Te=A.createElement(this.props.itemIcon,this.props)),A.createElement("li",Object(f.a)({},Object(x.a)(he,["onClick","onMouseEnter","onMouseLeave","onSelect"]),be,Ee,{style:Me,ref:this.saveNode}),he.children,Te)}}]),Re}(A.Component);kt.isMenuItem=!0,kt.defaultProps={onSelect:$,onMouseEnter:$,onMouseLeave:$,manualRef:$};var tr=Object(o.b)(function(me,Ae){var Re=me.activeKey,ve=me.selectedKeys,te=Ae.eventKey,he=Ae.subMenuKey;return{active:Re[he]===te,isSelected:Array.isArray(ve)?ve.indexOf(te)!==-1:ve===te}})(kt),mr=tr,Tr=function(me){Object(p.a)(Re,me);var Ae=Object(c.a)(Re);function Re(){var ve;return Object(D.a)(this,Re),ve=Ae.apply(this,arguments),ve.renderInnerMenuItem=function(te){var he=ve.props,ae=he.renderMenuItem,be=he.index;return ae(te,be,ve.props.subMenuKey)},ve}return Object(v.a)(Re,[{key:"render",value:function(){var te=Object(f.a)({},this.props),he=te.className,ae=he===void 0?"":he,be=te.rootPrefixCls,Ee="".concat(be,"-item-group-title"),Me="".concat(be,"-item-group-list"),Te=te.title,Ie=te.children;return Ze.forEach(function(Ke){return delete te[Ke]}),delete te.direction,A.createElement("li",Object(f.a)({},te,{onClick:function(it){return it.stopPropagation()},className:"".concat(ae," ").concat(be,"-item-group")}),A.createElement("div",{className:Ee,title:typeof Te=="string"?Te:void 0},Te),A.createElement("ul",{className:Me},A.Children.map(Ie,this.renderInnerMenuItem)))}}]),Re}(A.Component);Tr.isMenuItemGroup=!0,Tr.defaultProps={disabled:!0};var hr=Tr,Vr=function(Ae){var Re=Ae.className,ve=Ae.rootPrefixCls,te=Ae.style;return A.createElement("li",{className:"".concat(Re," ").concat(ve,"-item-divider"),style:te})};Vr.defaultProps={disabled:!0,className:"",style:{}};var wn=Vr,ir=Kt,oi=X("eDIo");function xr(me,Ae){var Re=me.prefixCls,ve=me.editable,te=me.locale,he=me.style;return!ve||ve.showAdd===!1?null:A.createElement("button",{ref:Ae,type:"button",className:"".concat(Re,"-nav-add"),style:he,"aria-label":(te==null?void 0:te.addAriaLabel)||"Add tab",onClick:function(be){ve.onEdit("add",{event:be})}},ve.addIcon||"+")}var mn=A.forwardRef(xr);function cn(me,Ae){var Re=me.prefixCls,ve=me.id,te=me.tabs,he=me.locale,ae=me.mobile,be=me.moreIcon,Ee=be===void 0?"More":be,Me=me.moreTransitionName,Te=me.style,Ie=me.className,Ke=me.editable,it=me.tabBarGutter,rt=me.rtl,mt=me.onTabClick,Nt=Object(A.useState)(!1),$t=Object(V.a)(Nt,2),Qt=$t[0],Xt=$t[1],er=Object(A.useState)(null),Zt=Object(V.a)(er,2),Yt=Zt[0],fr=Zt[1],ar="".concat(ve,"-more-popup"),Ur="".concat(Re,"-dropdown"),or=Yt!==null?"".concat(ar,"-").concat(Yt):null,Pt=he==null?void 0:he.dropdownAriaLabel,Lt=A.createElement(ir,{onClick:function(kr){var Dr=kr.key,Xr=kr.domEvent;mt(Dr,Xr),Xt(!1)},id:ar,tabIndex:-1,role:"listbox","aria-activedescendant":or,selectedKeys:[Yt],"aria-label":Pt!==void 0?Pt:"expanded dropdown"},te.map(function(br){return A.createElement(mr,{key:br.key,id:"".concat(ar,"-").concat(br.key),role:"option","aria-controls":ve&&"".concat(ve,"-panel-").concat(br.key),disabled:br.disabled},br.tab)}));function lr(br){for(var kr=te.filter(function(xn){return!xn.disabled}),Dr=kr.findIndex(function(xn){return xn.key===Yt})||0,Xr=kr.length,tn=0;tn<Xr;tn+=1){Dr=(Dr+br+Xr)%Xr;var Wr=kr[Dr];if(!Wr.disabled){fr(Wr.key);return}}}function pr(br){var kr=br.which;if(!Qt){[y.a.DOWN,y.a.SPACE,y.a.ENTER].includes(kr)&&(Xt(!0),br.preventDefault());return}switch(kr){case y.a.UP:lr(-1),br.preventDefault();break;case y.a.DOWN:lr(1),br.preventDefault();break;case y.a.ESC:Xt(!1);break;case y.a.SPACE:case y.a.ENTER:Yt!==null&&mt(Yt,br);break}}Object(A.useEffect)(function(){var br=document.getElementById(or);br&&br.scrollIntoView&&br.scrollIntoView(!1)},[Yt]),Object(A.useEffect)(function(){Qt||fr(null)},[Qt]);var wt=Object(de.a)({},rt?"marginLeft":"marginRight",it);te.length||(wt.visibility="hidden",wt.order=1);var gr=W()(Object(de.a)({},"".concat(Ur,"-rtl"),rt)),Fr=ae?null:A.createElement(oi.a,{prefixCls:Ur,overlay:Lt,trigger:["hover"],visible:Qt,transitionName:Me,onVisibleChange:Xt,overlayClassName:gr,mouseEnterDelay:.1,mouseLeaveDelay:.1},A.createElement("button",{type:"button",className:"".concat(Re,"-nav-more"),style:wt,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":ar,id:"".concat(ve,"-more"),"aria-expanded":Qt,onKeyDown:pr},Ee));return A.createElement("div",{className:W()("".concat(Re,"-nav-operations"),Ie),style:Te,ref:Ae},Fr,A.createElement(mn,{prefixCls:Re,locale:he,editable:Ke}))}var Hn=A.forwardRef(cn),Fa=Object(A.createContext)(null),Ko=.1,Gi=.01,Qr=20,go=Math.pow(.995,Qr);function vo(){var me=navigator.userAgent||navigator.vendor||window.opera;return!!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(me)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(me.substr(0,4)))}function la(me,Ae){var Re=Object(A.useState)(),ve=Object(V.a)(Re,2),te=ve[0],he=ve[1],ae=Object(A.useState)(0),be=Object(V.a)(ae,2),Ee=be[0],Me=be[1],Te=Object(A.useState)(0),Ie=Object(V.a)(Te,2),Ke=Ie[0],it=Ie[1],rt=Object(A.useState)(),mt=Object(V.a)(rt,2),Nt=mt[0],$t=mt[1],Qt=Object(A.useRef)();function Xt(Pt){var Lt=Pt.touches[0],lr=Lt.screenX,pr=Lt.screenY;he({x:lr,y:pr}),window.clearInterval(Qt.current)}function er(Pt){if(!te)return;Pt.preventDefault();var Lt=Pt.touches[0],lr=Lt.screenX,pr=Lt.screenY;he({x:lr,y:pr});var wt=lr-te.x,gr=pr-te.y;Ae(wt,gr);var Fr=Date.now();Me(Fr),it(Fr-Ee),$t({x:wt,y:gr})}function Zt(){if(!te)return;if(he(null),$t(null),Nt){var Pt=Nt.x/Ke,Lt=Nt.y/Ke,lr=Math.abs(Pt),pr=Math.abs(Lt);if(Math.max(lr,pr)<Ko)return;var wt=Pt,gr=Lt;Qt.current=window.setInterval(function(){if(Math.abs(wt)<Gi&&Math.abs(gr)<Gi){window.clearInterval(Qt.current);return}wt*=go,gr*=go,Ae(wt*Qr,gr*Qr)},Qr)}}var Yt=Object(A.useRef)(0),fr=Object(A.useRef)(!1),ar=Object(A.useRef)();function Ur(Pt){var Lt=Pt.deltaX,lr=Pt.deltaY,pr=0,wt=Math.abs(Lt),gr=Math.abs(lr);wt===gr?pr=ar.current==="x"?Lt:lr:wt>gr?(pr=Lt,ar.current="x"):(pr=lr,ar.current="y");var Fr=Date.now();Fr-Yt.current>100&&(fr.current=!1),(Ae(-pr,-pr)||fr.current)&&(Pt.preventDefault(),fr.current=!0),Yt.current=Fr}var or=Object(A.useRef)(null);or.current={onTouchStart:Xt,onTouchMove:er,onTouchEnd:Zt,onWheel:Ur},A.useEffect(function(){function Pt(wt){or.current.onTouchStart(wt)}function Lt(wt){or.current.onTouchMove(wt)}function lr(wt){or.current.onTouchEnd(wt)}function pr(wt){or.current.onWheel(wt)}return document.addEventListener("touchmove",Lt,{passive:!1}),document.addEventListener("touchend",lr,{passive:!1}),me.current.addEventListener("touchstart",Pt,{passive:!1}),me.current.addEventListener("wheel",pr),function(){document.removeEventListener("touchmove",Lt),document.removeEventListener("touchend",lr)}},[])}function zo(){var me=Object(A.useRef)(new Map);function Ae(ve){return me.current.has(ve)||me.current.set(ve,A.createRef()),me.current.get(ve)}function Re(ve){me.current.delete(ve)}return[Ae,Re]}function ja(me,Ae){var Re=A.useRef(me),ve=A.useState({}),te=Object(V.a)(ve,2),he=te[1];function ae(be){var Ee=typeof be=="function"?be(Re.current):be;Ee!==Re.current&&Ae(Ee,Re.current),Re.current=Ee,he({})}return[Re.current,ae]}var yo=function(Ae){var Re=Ae.position,ve=Ae.prefixCls,te=Ae.extra;if(!te)return null;var he,ae=te;return Re==="right"&&(he=ae.right||!ae.left&&ae||null),Re==="left"&&(he=ae.left||null),he?A.createElement("div",{className:"".concat(ve,"-extra-content")},he):null};function Wa(me,Ae){var Re,ve=A.useContext(Fa),te=ve.prefixCls,he=ve.tabs,ae=me.className,be=me.style,Ee=me.id,Me=me.animated,Te=me.activeKey,Ie=me.rtl,Ke=me.extra,it=me.editable,rt=me.locale,mt=me.tabPosition,Nt=me.tabBarGutter,$t=me.children,Qt=me.onTabClick,Xt=me.onTabScroll,er=Object(A.useRef)(),Zt=Object(A.useRef)(),Yt=Object(A.useRef)(),fr=Object(A.useRef)(),ar=zo(),Ur=Object(V.a)(ar,2),or=Ur[0],Pt=Ur[1],Lt=mt==="top"||mt==="bottom",lr=ja(0,function(Sr,dr){Lt&&Xt&&Xt({direction:Sr>dr?"left":"right"})}),pr=Object(V.a)(lr,2),wt=pr[0],gr=pr[1],Fr=ja(0,function(Sr,dr){!Lt&&Xt&&Xt({direction:Sr>dr?"top":"bottom"})}),br=Object(V.a)(Fr,2),kr=br[0],Dr=br[1],Xr=Object(A.useState)(0),tn=Object(V.a)(Xr,2),Wr=tn[0],xn=tn[1],Vn=Object(A.useState)(0),Dn=Object(V.a)(Vn,2),rn=Dn[0],_r=Dn[1],Lr=Object(A.useState)(0),Hr=Object(V.a)(Lr,2),jr=Hr[0],Qn=Hr[1],bi=Object(A.useState)(0),Ei=Object(V.a)(bi,2),Rr=Ei[0],ti=Ei[1],xi=Object(A.useState)(null),Pr=Object(V.a)(xi,2),wr=Pr[0],nn=Pr[1],xo=Object(A.useState)(null),Ga=Object(V.a)(xo,2),Ci=Ga[0],Qi=Ga[1],ya=Object(A.useState)(0),Va=Object(V.a)(ya,2),ba=Va[0],Qo=Va[1],Xo=Object(A.useState)(0),Co=Object(V.a)(Xo,2),Qa=Co[0],Xa=Co[1],Xi=T(new Map),Yi=Object(V.a)(Xi,2),Yo=Yi[0],Ea=Yi[1],ua=s(he,Yo,Wr),Ji="".concat(te,"-nav-operations-hidden"),Zi=0,Xn=0;Lt?Ie?(Zi=0,Xn=Math.max(0,Wr-wr)):(Zi=Math.min(0,wr-Wr),Xn=0):(Zi=Math.min(0,Ci-rn),Xn=0);function _i(Sr){return Sr<Zi?[Zi,!1]:Sr>Xn?[Xn,!1]:[Sr,!0]}var Si=Object(A.useRef)(),da=Object(A.useState)(),Ni=Object(V.a)(da,2),xa=Ni[0],Ya=Ni[1];function Ca(){Ya(Date.now())}function Ja(){window.clearTimeout(Si.current)}la(er,function(Sr,dr){var an=!1;function On(qi,li){qi(function(fa){var Ti=_i(fa+li),on=Object(V.a)(Ti,2),Ta=on[0],qa=on[1];return an=qa,Ta})}if(Lt){if(wr>=Wr)return an;On(gr,Sr)}else{if(Ci>=rn)return an;On(Dr,dr)}return Ja(),Ca(),an}),Object(A.useEffect)(function(){return Ja(),xa&&(Si.current=window.setTimeout(function(){Ya(0)},100)),Ja},[xa]);function Ai(){var Sr=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Te,dr=ua.get(Sr);if(!dr)return;if(Lt){var an=wt;Ie?dr.right<wt?an=dr.right:dr.right+dr.width>wt+wr&&(an=dr.right+dr.width-wr):dr.left<-wt?an=-dr.left:dr.left+dr.width>-wt+wr&&(an=-(dr.left+dr.width-wr)),Dr(0),gr(_i(an)[0])}else{var On=kr;dr.top<-kr?On=-dr.top:dr.top+dr.height>-kr+Ci&&(On=-(dr.top+dr.height-Ci)),gr(0),Dr(_i(On)[0])}}var Bi=d(ua,{width:wr,height:Ci,left:wt,top:kr},{width:jr,height:Rr},{width:ba,height:Qa},Object(H.a)(Object(H.a)({},me),{},{tabs:he})),So=Object(V.a)(Bi,2),Jo=So[0],Zo=So[1],qo=he.map(function(Sr){var dr=Sr.key;return A.createElement(a,{id:Ee,prefixCls:te,key:dr,rtl:Ie,tab:Sr,closable:Sr.closable,editable:it,active:dr===Te,tabPosition:mt,tabBarGutter:Nt,renderWrapper:$t,removeAriaLabel:rt==null?void 0:rt.removeAriaLabel,ref:or(dr),onClick:function(On){Qt(dr,On)},onRemove:function(){Pt(dr)},onFocus:function(){Ai(dr),Ca(),Ie||(er.current.scrollLeft=0),er.current.scrollTop=0}})}),Za=w(function(){var Sr,dr,an,On,qi,li,fa,Ti,on,Ta=((Sr=er.current)===null||Sr===void 0?void 0:Sr.offsetWidth)||0,qa=((dr=er.current)===null||dr===void 0?void 0:dr.offsetHeight)||0,$a=((an=fr.current)===null||an===void 0?void 0:an.offsetWidth)||0,Mn=((On=fr.current)===null||On===void 0?void 0:On.offsetHeight)||0,Cr=((qi=Yt.current)===null||qi===void 0?void 0:qi.offsetWidth)||0,Jn=((li=Yt.current)===null||li===void 0?void 0:li.offsetHeight)||0;nn(Ta),Qi(qa),Qo($a),Xa(Mn);var ui=(((fa=Zt.current)===null||fa===void 0?void 0:fa.offsetWidth)||0)-$a,di=(((Ti=Zt.current)===null||Ti===void 0?void 0:Ti.offsetHeight)||0)-Mn;xn(ui),_r(di);var eo=(on=Yt.current)===null||on===void 0?void 0:on.className.includes(Ji);Qn(ui-(eo?0:Cr)),ti(di-(eo?0:Jn)),Ea(function(){var wa=new Map;return he.forEach(function(Ro){var Oo=Ro.key,Fi=or(Oo).current;Fi&&wa.set(Oo,{width:Fi.offsetWidth,height:Fi.offsetHeight,left:Fi.offsetLeft,top:Fi.offsetTop})}),wa})}),$o=he.slice(0,Jo),Rn=he.slice(Zo+1),Jr=[].concat(Object(L.a)($o),Object(L.a)(Rn)),gn=Object(A.useState)(),Zr=Object(V.a)(gn,2),ca=Zr[0],es=Zr[1],Yn=ua.get(Te),Ao=Object(A.useRef)();function To(){E.a.cancel(Ao.current)}Object(A.useEffect)(function(){var Sr={};return Yn&&(Lt?(Ie?Sr.right=Yn.right:Sr.left=Yn.left,Sr.width=Yn.width):(Sr.top=Yn.top,Sr.height=Yn.height)),To(),Ao.current=E()(function(){es(Sr)}),To},[Yn,Lt,Ie]),Object(A.useEffect)(function(){Ai()},[Te,Yn,ua,Lt]),Object(A.useEffect)(function(){Za()},[Ie,Nt,Te,he.map(function(Sr){return Sr.key}).join("_")]);var wo=!!Jr.length,Ui="".concat(te,"-nav-wrap"),Sa,ha,Do,Aa;return Lt?Ie?(ha=wt>0,Sa=wt+wr<Wr):(Sa=wt<0,ha=-wt+wr<Wr):(Do=kr<0,Aa=-kr+Ci<rn),A.createElement("div",{ref:Ae,role:"tablist",className:W()("".concat(te,"-nav"),ae),style:be,onKeyDown:function(){Ca()}},A.createElement(yo,{position:"left",extra:Ke,prefixCls:te}),A.createElement(I.a,{onResize:Za},A.createElement("div",{className:W()(Ui,(Re={},Object(de.a)(Re,"".concat(Ui,"-ping-left"),Sa),Object(de.a)(Re,"".concat(Ui,"-ping-right"),ha),Object(de.a)(Re,"".concat(Ui,"-ping-top"),Do),Object(de.a)(Re,"".concat(Ui,"-ping-bottom"),Aa),Re)),ref:er},A.createElement(I.a,{onResize:Za},A.createElement("div",{ref:Zt,className:"".concat(te,"-nav-list"),style:{transform:"translate(".concat(wt,"px, ").concat(kr,"px)"),transition:xa?"none":void 0}},qo,A.createElement(mn,{ref:fr,prefixCls:te,locale:rt,editable:it,style:{visibility:wo?"hidden":null}}),A.createElement("div",{className:W()("".concat(te,"-ink-bar"),Object(de.a)({},"".concat(te,"-ink-bar-animated"),Me.inkBar)),style:ca}))))),A.createElement(Hn,Object.assign({},me,{ref:Yt,prefixCls:te,tabs:Jr,className:!wo&&Ji})),A.createElement(yo,{position:"right",extra:Ke,prefixCls:te}))}var Ha=A.forwardRef(Wa);function Go(me){var Ae=me.id,Re=me.activeKey,ve=me.animated,te=me.tabPosition,he=me.rtl,ae=me.destroyInactiveTabPane,be=A.useContext(Fa),Ee=be.prefixCls,Me=be.tabs,Te=ve.tabPane,Ie=Me.findIndex(function(Ke){return Ke.key===Re});return A.createElement("div",{className:W()("".concat(Ee,"-content-holder"))},A.createElement("div",{className:W()("".concat(Ee,"-content"),"".concat(Ee,"-content-").concat(te),Object(de.a)({},"".concat(Ee,"-content-animated"),Te)),style:Ie&&Te?Object(de.a)({},he?"marginRight":"marginLeft","-".concat(Ie,"00%")):null},Me.map(function(Ke){return A.cloneElement(Ke.node,{key:Ke.key,prefixCls:Ee,tabKey:Ke.key,id:Ae,animated:Te,active:Ke.key===Re,destroyInactiveTabPane:ae})})))}function bo(me){var Ae=me.prefixCls,Re=me.forceRender,ve=me.className,te=me.style,he=me.id,ae=me.active,be=me.animated,Ee=me.destroyInactiveTabPane,Me=me.tabKey,Te=me.children,Ie=A.useState(Re),Ke=Object(V.a)(Ie,2),it=Ke[0],rt=Ke[1];A.useEffect(function(){ae?rt(!0):Ee&&rt(!1)},[ae,Ee]);var mt={};return ae||(be?(mt.visibility="hidden",mt.height=0,mt.overflowY="hidden"):mt.display="none"),A.createElement("div",{id:he&&"".concat(he,"-panel-").concat(Me),role:"tabpanel",tabIndex:ae?0:-1,"aria-labelledby":he&&"".concat(he,"-tab-").concat(Me),"aria-hidden":!ae,style:Object(H.a)(Object(H.a)({},mt),te),className:W()("".concat(Ae,"-tabpane"),ae&&"".concat(Ae,"-tabpane-active"),ve)},(ae||it||Re)&&Te)}var Ka=0;function Eo(me){return Object(U.a)(me).map(function(Ae){if(A.isValidElement(Ae)){var Re=Ae.key!==void 0?String(Ae.key):void 0;return Object(H.a)(Object(H.a)({key:Re},Ae.props),{},{node:Ae})}return null}).filter(function(Ae){return Ae})}function Vo(me,Ae){var Re,ve=me.id,te=me.prefixCls,he=te===void 0?"rc-tabs":te,ae=me.className,be=me.children,Ee=me.direction,Me=me.activeKey,Te=me.defaultActiveKey,Ie=me.editable,Ke=me.animated,it=me.tabPosition,rt=it===void 0?"top":it,mt=me.tabBarGutter,Nt=me.tabBarStyle,$t=me.tabBarExtraContent,Qt=me.locale,Xt=me.moreIcon,er=me.moreTransitionName,Zt=me.destroyInactiveTabPane,Yt=me.renderTabBar,fr=me.onChange,ar=me.onTabClick,Ur=me.onTabScroll,or=Object(O.a)(me,["id","prefixCls","className","children","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll"]),Pt=Eo(be),Lt=Ee==="rtl",lr;Ke===!1?lr={inkBar:!1,tabPane:!1}:lr=Object(H.a)({inkBar:!0,tabPane:!1},Ke!==!0?Ke:null);var pr=Object(A.useState)(!1),wt=Object(V.a)(pr,2),gr=wt[0],Fr=wt[1];Object(A.useEffect)(function(){Fr(vo())},[]);var br=Object(P.a)(function(){var Rr;return(Rr=Pt[0])===null||Rr===void 0?void 0:Rr.key},{value:Me,defaultValue:Te}),kr=Object(V.a)(br,2),Dr=kr[0],Xr=kr[1],tn=Object(A.useState)(function(){return Pt.findIndex(function(Rr){return Rr.key===Dr})}),Wr=Object(V.a)(tn,2),xn=Wr[0],Vn=Wr[1];Object(A.useEffect)(function(){var Rr=Pt.findIndex(function(xi){return xi.key===Dr});if(Rr===-1){var ti;Rr=Math.max(0,Math.min(xn,Pt.length-1)),Xr((ti=Pt[Rr])===null||ti===void 0?void 0:ti.key)}Vn(Rr)},[Pt.map(function(Rr){return Rr.key}).join("_"),Dr,xn]);var Dn=Object(P.a)(null,{value:ve}),rn=Object(V.a)(Dn,2),_r=rn[0],Lr=rn[1],Hr=rt;gr&&!["left","right"].includes(rt)&&(Hr="top"),Object(A.useEffect)(function(){ve||(Lr("rc-tabs-".concat(Ka)),Ka+=1)},[]);function jr(Rr,ti){ar==null||ar(Rr,ti),Xr(Rr),fr==null||fr(Rr)}var Qn={id:_r,activeKey:Dr,animated:lr,tabPosition:Hr,rtl:Lt,mobile:gr},bi,Ei=Object(H.a)(Object(H.a)({},Qn),{},{editable:Ie,locale:Qt,moreIcon:Xt,moreTransitionName:er,tabBarGutter:mt,onTabClick:jr,onTabScroll:Ur,extra:$t,style:Nt,panes:be});return Yt?bi=Yt(Ei,Ha):bi=A.createElement(Ha,Object.assign({},Ei)),A.createElement(Fa.Provider,{value:{tabs:Pt,prefixCls:he}},A.createElement("div",Object.assign({ref:Ae,id:ve,className:W()(he,"".concat(he,"-").concat(Hr),(Re={},Object(de.a)(Re,"".concat(he,"-mobile"),gr),Object(de.a)(Re,"".concat(he,"-editable"),Ie),Object(de.a)(Re,"".concat(he,"-rtl"),Lt),Re),ae)},or),bi,A.createElement(Go,Object.assign({destroyInactiveTabPane:Zt},Qn,{animated:lr}))))}var Vi=A.forwardRef(Vo);Vi.TabPane=bo;var si=Vi,za=We.b=si},kPWJ:function(Ge,We,X){Ge.exports=X.p+"static/question.cb52bef9.gif"},kPYp:function(Ge,We){Ge.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAF8AAAAUCAYAAADr0+FaAAANEklEQVRYR8WZe5RX1XXHP/vce3/zHoaXgFp5DQyOQLRgUTEtDW1qYyVmZUGNklRdiRpKE3lHfPyc4TngIBgfC0wx1ixt1NRWal2kotbE2lbRiCIISBCGhzDAvGd+87v37K5z5zfDzMCM46pr9fw1a+45+5zz3fvs/d3fn4yr1F8Do0UIUb74UFR8Gm3IO/Wf8MThat7mOYnaDZUmN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X){},kqOp:function(Ge,We,X){"use strict";X.d(We,"a",function(){return L});var de=X("0Owb"),V=X("fWQN"),O=X("mtLc"),H=X("yKVA"),A=X("879j"),k=X("q1tI"),W=X.n(k),U=X("Ot1p"),P="\u2581",L=function(b){Object(H.a)(I,b);var E=Object(A.a)(I);function I(){var w;Object(V.a)(this,I);for(var T=arguments.length,y=new Array(T),u=0;u<T;u++)y[u]=arguments[u];return w=E.call.apply(E,[this].concat(y)),w.getChCountBeforeCursor=function(a,l){for(var s=l.line,m=0,d=0;d<s;d++)m+=a.getLine(d).split(P).length-1;var f=a.getLine(s).substring(0,l.ch);return m+=f.split(P).length-1,m},w.onCMBeforeChange=function(a,l){var s=a.getRange(l.from,l.to),m=0;if(l.text.forEach(function(v){m+=v.split(P).length-1}),s&&s.indexOf(P)!=-1){var d=s.split(P).length-1,f=w.getChCountBeforeCursor(a,l.from);console.log("\u5220\u9664".concat(d,"\u4E2A\uFF0C \u4E4B\u524D\u6709").concat(f,"\u4E2A\uFF0C\u65B0\u589E").concat(m,"\u4E2A")),w.props.deleteEmptyDisabled?l.cancel():w.props.onPlaceholderChange&&w.props.onPlaceholderChange(f,d,m)}else if(m){var D=w.getChCountBeforeCursor(a,l.from);console.log("\u65B0\u589E".concat(m,"\u4E2A\uFF0C\u4E4B\u524D\u6709").concat(D,"\u4E2A")),w.props.onPlaceholderChange&&w.props.onPlaceholderChange(D,0,m)}},w}return Object(O.a)(I,[{key:"render",value:function(){return W.a.createElement(U.a,Object(de.a)({},this.props,{onCMBeforeChange:this.onCMBeforeChange}))}}]),I}(k.Component)},l2Kq:function(Ge,We,X){Ge.exports=X.p+"static/match_ad.24dc22fd.jpg"},lZu9:function(Ge,We,X){(function(de){de(X("VrN/"),X("1eCo"),X("8EBN"))})(function(de){"use strict";de.defineMode("markdown",function(V,O){var H=de.getMode(V,"text/html"),A=H.name=="null";function k(G){if(de.findModeByName){var j=de.findModeByName(G);j&&(G=j.mime||j.mimes[0])}var se=de.getMode(V,G);return se.name=="null"?null:se}O.highlightFormatting===void 0&&(O.highlightFormatting=!1),O.maxBlockquoteDepth===void 0&&(O.maxBlockquoteDepth=0),O.taskLists===void 0&&(O.taskLists=!1),O.strikethrough===void 0&&(O.strikethrough=!1),O.emoji===void 0&&(O.emoji=!1),O.fencedCodeBlockHighlighting===void 0&&(O.fencedCodeBlockHighlighting=!0),O.fencedCodeBlockDefaultMode===void 0&&(O.fencedCodeBlockDefaultMode="text/plain"),O.xml===void 0&&(O.xml=!0),O.tokenTypeOverrides===void 0&&(O.tokenTypeOverrides={});var W={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 U in W)W.hasOwnProperty(U)&&O.tokenTypeOverrides[U]&&(W[U]=O.tokenTypeOverrides[U]);var P=/^([*\-_])(?:\s*\1){2,}\s*$/,L=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,b=/^\[(x| )\](?=\s)/i,E=O.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,I=/^ {0,3}(?:\={1,}|-{2,})\s*$/,w=/^[^#!\[\]*_\\<>` "'(~:]+/,T=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,y=/^\s*\[[^\]]+?\]:.*$/,u=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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(G,j,se){return j.f=j.inline=se,se(G,j)}function s(G,j,se){return j.f=j.block=se,se(G,j)}function m(G){return!G||!/\S/.test(G.string)}function d(G){if(G.linkTitle=!1,G.linkHref=!1,G.linkText=!1,G.em=!1,G.strong=!1,G.strikethrough=!1,G.quote=0,G.indentedCode=!1,G.f==D){var j=A;if(!j){var se=de.innerMode(H,G.htmlState);j=se.mode.name=="xml"&&se.state.tagStart===null&&!se.state.context&&se.state.tokenize.isInText}j&&(G.f=c,G.block=f,G.htmlState=null)}return G.trailingSpace=0,G.trailingSpaceNewLine=!1,G.prevLine=G.thisLine,G.thisLine={stream:null},null}function f(G,j){var se=G.column()===j.indentation,fe=m(j.prevLine.stream),Se=j.indentedCode,ke=j.prevLine.hr,Je=j.list!==!1,_e=(j.listStack[j.listStack.length-1]||0)+3;j.indentedCode=!1;var Qe=j.indentation;if(j.indentationDiff===null&&(j.indentationDiff=j.indentation,Je)){for(j.list=null;Qe<j.listStack[j.listStack.length-1];)j.listStack.pop(),j.listStack.length?j.indentation=j.listStack[j.listStack.length-1]:j.list=!1;j.list!==!1&&(j.indentationDiff=Qe-j.listStack[j.listStack.length-1])}var Ue=!fe&&!ke&&!j.prevLine.header&&(!Je||!Se)&&!j.prevLine.fencedCodeEnd,Fe=(j.list===!1||ke||fe)&&j.indentation<=_e&&G.match(P),we=null;if(j.indentationDiff>=4&&(Se||j.prevLine.fencedCodeEnd||j.prevLine.header||fe))return G.skipToEnd(),j.indentedCode=!0,W.code;if(G.eatSpace())return null;if(se&&j.indentation<=_e&&(we=G.match(E))&&we[1].length<=6)return j.quote=0,j.header=we[1].length,j.thisLine.header=!0,O.highlightFormatting&&(j.formatting="header"),j.f=j.inline,h(j);if(j.indentation<=_e&&G.eat(">"))return j.quote=se?1:j.quote+1,O.highlightFormatting&&(j.formatting="quote"),G.eatSpace(),h(j);if(!Fe&&!j.setext&&se&&j.indentation<=_e&&(we=G.match(L))){var F=we[1]?"ol":"ul";return j.indentation=Qe+G.current().length,j.list=!0,j.quote=0,j.listStack.push(j.indentation),j.em=!1,j.strong=!1,j.code=!1,j.strikethrough=!1,O.taskLists&&G.match(b,!1)&&(j.taskList=!0),j.f=j.inline,O.highlightFormatting&&(j.formatting=["list","list-"+F]),h(j)}else{if(se&&j.indentation<=_e&&(we=G.match(T,!0)))return j.quote=0,j.fencedEndRE=new RegExp(we[1]+"+ *$"),j.localMode=O.fencedCodeBlockHighlighting&&k(we[2]||O.fencedCodeBlockDefaultMode),j.localMode&&(j.localState=de.startState(j.localMode)),j.f=j.block=v,O.highlightFormatting&&(j.formatting="code-block"),j.code=-1,h(j);if(j.setext||(!Ue||!Je)&&!j.quote&&j.list===!1&&!j.code&&!Fe&&!y.test(G.string)&&(we=G.lookAhead(1))&&(we=we.match(I)))return j.setext?(j.header=j.setext,j.setext=0,G.skipToEnd(),O.highlightFormatting&&(j.formatting="header")):(j.header=we[0].charAt(0)=="="?1:2,j.setext=j.header),j.thisLine.header=!0,j.f=j.inline,h(j);if(Fe)return G.skipToEnd(),j.hr=!0,j.thisLine.hr=!0,W.hr;if(G.peek()==="[")return l(G,j,_)}return l(G,j,j.inline)}function D(G,j){var se=H.token(G,j.htmlState);if(!A){var fe=de.innerMode(H,j.htmlState);(fe.mode.name=="xml"&&fe.state.tagStart===null&&!fe.state.context&&fe.state.tokenize.isInText||j.md_inside&&G.current().indexOf(">")>-1)&&(j.f=c,j.block=f,j.htmlState=null)}return se}function v(G,j){var se=j.listStack[j.listStack.length-1]||0,fe=j.indentation<se,Se=se+3;if(j.fencedEndRE&&j.indentation<=Se&&(fe||G.match(j.fencedEndRE))){O.highlightFormatting&&(j.formatting="code-block");var ke;return fe||(ke=h(j)),j.localMode=j.localState=null,j.block=f,j.f=c,j.fencedEndRE=null,j.code=0,j.thisLine.fencedCodeEnd=!0,fe?s(G,j,j.block):ke}else return j.localMode?j.localMode.token(G,j.localState):(G.skipToEnd(),W.code)}function h(G){var j=[];if(G.formatting){j.push(W.formatting),typeof G.formatting=="string"&&(G.formatting=[G.formatting]);for(var se=0;se<G.formatting.length;se++)j.push(W.formatting+"-"+G.formatting[se]),G.formatting[se]==="header"&&j.push(W.formatting+"-"+G.formatting[se]+"-"+G.header),G.formatting[se]==="quote"&&(!O.maxBlockquoteDepth||O.maxBlockquoteDepth>=G.quote?j.push(W.formatting+"-"+G.formatting[se]+"-"+G.quote):j.push("error"))}if(G.taskOpen)return j.push("meta"),j.length?j.join(" "):null;if(G.taskClosed)return j.push("property"),j.length?j.join(" "):null;if(G.linkHref?j.push(W.linkHref,"url"):(G.strong&&j.push(W.strong),G.em&&j.push(W.em),G.strikethrough&&j.push(W.strikethrough),G.emoji&&j.push(W.emoji),G.linkText&&j.push(W.linkText),G.code&&j.push(W.code),G.image&&j.push(W.image),G.imageAltText&&j.push(W.imageAltText,"link"),G.imageMarker&&j.push(W.imageMarker)),G.header&&j.push(W.header,W.header+"-"+G.header),G.quote&&(j.push(W.quote),!O.maxBlockquoteDepth||O.maxBlockquoteDepth>=G.quote?j.push(W.quote+"-"+G.quote):j.push(W.quote+"-"+O.maxBlockquoteDepth)),G.list!==!1){var fe=(G.listStack.length-1)%3;fe?fe===1?j.push(W.list2):j.push(W.list3):j.push(W.list1)}return G.trailingSpaceNewLine?j.push("trailing-space-new-line"):G.trailingSpace&&j.push("trailing-space-"+(G.trailingSpace%2?"a":"b")),j.length?j.join(" "):null}function p(G,j){return G.match(w,!0)?h(j):void 0}function c(G,j){var se=j.text(G,j);if(typeof se!="undefined")return se;if(j.list)return j.list=null,h(j);if(j.taskList){var fe=G.match(b,!0)[1]===" ";return fe?j.taskOpen=!0:j.taskClosed=!0,O.highlightFormatting&&(j.formatting="task"),j.taskList=!1,h(j)}if(j.taskOpen=!1,j.taskClosed=!1,j.header&&G.match(/^#+$/,!0))return O.highlightFormatting&&(j.formatting="header"),h(j);var Se=G.next();if(j.linkTitle){j.linkTitle=!1;var ke=Se;Se==="("&&(ke=")"),ke=(ke+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Je="^\\s*(?:[^"+ke+"\\\\]+|\\\\\\\\|\\\\.)"+ke;if(G.match(new RegExp(Je),!0))return W.linkHref}if(Se==="`"){var _e=j.formatting;O.highlightFormatting&&(j.formatting="code"),G.eatWhile("`");var Qe=G.current().length;if(j.code==0&&(!j.quote||Qe==1))return j.code=Qe,h(j);if(Qe==j.code){var Ue=h(j);return j.code=0,Ue}else return j.formatting=_e,h(j)}else if(j.code)return h(j);if(Se==="\\"&&(G.next(),O.highlightFormatting)){var Fe=h(j),we=W.formatting+"-escape";return Fe?Fe+" "+we:we}if(Se==="!"&&G.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return j.imageMarker=!0,j.image=!0,O.highlightFormatting&&(j.formatting="image"),h(j);if(Se==="["&&j.imageMarker&&G.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return j.imageMarker=!1,j.imageAltText=!0,O.highlightFormatting&&(j.formatting="image"),h(j);if(Se==="]"&&j.imageAltText){O.highlightFormatting&&(j.formatting="image");var Fe=h(j);return j.imageAltText=!1,j.image=!1,j.inline=j.f=x,Fe}if(Se==="["&&!j.image)return j.linkText&&G.match(/^.*?\]/)||(j.linkText=!0,O.highlightFormatting&&(j.formatting="link")),h(j);if(Se==="]"&&j.linkText){O.highlightFormatting&&(j.formatting="link");var Fe=h(j);return j.linkText=!1,j.inline=j.f=G.match(/\(.*?\)| ?\[.*?\]/,!1)?x:c,Fe}if(Se==="<"&&G.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){j.f=j.inline=o,O.highlightFormatting&&(j.formatting="link");var Fe=h(j);return Fe?Fe+=" ":Fe="",Fe+W.linkInline}if(Se==="<"&&G.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){j.f=j.inline=o,O.highlightFormatting&&(j.formatting="link");var Fe=h(j);return Fe?Fe+=" ":Fe="",Fe+W.linkEmail}if(O.xml&&Se==="<"&&G.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var F=G.string.indexOf(">",G.pos);if(F!=-1){var R=G.string.substring(G.start,F);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(R)&&(j.md_inside=!0)}return G.backUp(1),j.htmlState=de.startState(H),s(G,j,D)}if(O.xml&&Se==="<"&&G.match(/^\/\w*?>/))return j.md_inside=!1,"tag";if(Se==="*"||Se==="_"){for(var M=1,K=G.pos==1?" ":G.string.charAt(G.pos-2);M<3&&G.eat(Se);)M++;var $=G.peek()||" ",B=!/\s/.test($)&&(!u.test($)||/\s/.test(K)||u.test(K)),ge=!/\s/.test(K)&&(!u.test(K)||/\s/.test($)||u.test($)),Oe=null,je=null;if(M%2&&(!j.em&&B&&(Se==="*"||!ge||u.test(K))?Oe=!0:j.em==Se&&ge&&(Se==="*"||!B||u.test($))&&(Oe=!1)),M>1&&(!j.strong&&B&&(Se==="*"||!ge||u.test(K))?je=!0:j.strong==Se&&ge&&(Se==="*"||!B||u.test($))&&(je=!1)),je!=null||Oe!=null){O.highlightFormatting&&(j.formatting=Oe==null?"strong":je==null?"em":"strong em"),Oe===!0&&(j.em=Se),je===!0&&(j.strong=Se);var Ue=h(j);return Oe===!1&&(j.em=!1),je===!1&&(j.strong=!1),Ue}}else if(Se===" "&&(G.eat("*")||G.eat("_"))){if(G.peek()===" ")return h(j);G.backUp(1)}if(O.strikethrough){if(Se==="~"&&G.eatWhile(Se)){if(j.strikethrough){O.highlightFormatting&&(j.formatting="strikethrough");var Ue=h(j);return j.strikethrough=!1,Ue}else if(G.match(/^[^\s]/,!1))return j.strikethrough=!0,O.highlightFormatting&&(j.formatting="strikethrough"),h(j)}else if(Se===" "&&G.match(/^~~/,!0)){if(G.peek()===" ")return h(j);G.backUp(2)}}if(O.emoji&&Se===":"&&G.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){j.emoji=!0,O.highlightFormatting&&(j.formatting="emoji");var Ze=h(j);return j.emoji=!1,Ze}return Se===" "&&(G.match(/^ +$/,!1)?j.trailingSpace++:j.trailingSpace&&(j.trailingSpaceNewLine=!0)),h(j)}function o(G,j){var se=G.next();if(se===">"){j.f=j.inline=c,O.highlightFormatting&&(j.formatting="link");var fe=h(j);return fe?fe+=" ":fe="",fe+W.linkInline}return G.match(/^[^>]+/,!0),W.linkInline}function x(G,j){if(G.eatSpace())return null;var se=G.next();return se==="("||se==="["?(j.f=j.inline=C(se==="("?")":"]"),O.highlightFormatting&&(j.formatting="link-string"),j.linkHref=!0,h(j)):"error"}var g={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function C(G){return function(j,se){var fe=j.next();if(fe===G){se.f=se.inline=c,O.highlightFormatting&&(se.formatting="link-string");var Se=h(se);return se.linkHref=!1,Se}return j.match(g[G]),se.linkHref=!0,h(se)}}function _(G,j){return G.match(/^([^\]\\]|\\.)*\]:/,!1)?(j.f=z,G.next(),O.highlightFormatting&&(j.formatting="link"),j.linkText=!0,h(j)):l(G,j,c)}function z(G,j){if(G.match(/^\]:/,!0)){j.f=j.inline=Y,O.highlightFormatting&&(j.formatting="link");var se=h(j);return j.linkText=!1,se}return G.match(/^([^\]\\]|\\.)+/,!0),W.linkText}function Y(G,j){return G.eatSpace()?null:(G.match(/^[^\s]+/,!0),G.peek()===void 0?j.linkTitle=!0:G.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),j.f=j.inline=c,W.linkHref+" url")}var oe={startState:function(){return{f,prevLine:{stream:null},thisLine:{stream:null},block:f,htmlState:null,indentation:0,inline:c,text:p,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(G){return{f:G.f,prevLine:G.prevLine,thisLine:G.thisLine,block:G.block,htmlState:G.htmlState&&de.copyState(H,G.htmlState),indentation:G.indentation,localMode:G.localMode,localState:G.localMode?de.copyState(G.localMode,G.localState):null,inline:G.inline,text:G.text,formatting:!1,linkText:G.linkText,linkTitle:G.linkTitle,linkHref:G.linkHref,code:G.code,em:G.em,strong:G.strong,strikethrough:G.strikethrough,emoji:G.emoji,header:G.header,setext:G.setext,hr:G.hr,taskList:G.taskList,list:G.list,listStack:G.listStack.slice(0),quote:G.quote,indentedCode:G.indentedCode,trailingSpace:G.trailingSpace,trailingSpaceNewLine:G.trailingSpaceNewLine,md_inside:G.md_inside,fencedEndRE:G.fencedEndRE}},token:function(G,j){if(j.formatting=!1,G!=j.thisLine.stream){if(j.header=0,j.hr=!1,G.match(/^\s*$/,!0))return d(j),null;if(j.prevLine=j.thisLine,j.thisLine={stream:G},j.taskList=!1,j.trailingSpace=0,j.trailingSpaceNewLine=!1,!j.localState&&(j.f=j.block,j.f!=D)){var se=G.match(/^\s*/,!0)[0].replace(/\t/g,a).length;if(j.indentation=se,j.indentationDiff=null,se>0)return null}}return j.f(G,j)},innerMode:function(G){return G.block==D?{state:G.htmlState,mode:H}:G.localState?{state:G.localState,mode:G.localMode}:{state:G,mode:oe}},indent:function(G,j,se){return G.block==D&&H.indent?H.indent(G.htmlState,j,se):G.localState&&G.localMode.indent?G.localMode.indent(G.localState,j,se):de.Pass},blankLine:d,getType:h,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return oe},"xml"),de.defineMIME("text/markdown","markdown"),de.defineMIME("text/x-markdown","markdown")})},lzim:function(Ge,We,X){"use strict";var de=X("E7E6"),V=X.n(de);X.d(We,"w",function(){return V.a});var O=X("/GNS"),H=X.n(O);X.d(We,"v",function(){return H.a});var A=X("FOrL"),k=X.n(A);X.d(We,"q",function(){return k.a});var W=X("HpTS"),U=X.n(W);X.d(We,"x",function(){return U.a});var P=X("tWlo"),L=X.n(P);X.d(We,"a",function(){return L.a});var b=X("7ZXX"),E=X.n(b);X.d(We,"l",function(){return E.a});var I=X("GABl"),w=X.n(I);X.d(We,"e",function(){return w.a});var T=X("onxn"),y=X.n(T);X.d(We,"n",function(){return y.a});var u=X("nKGa"),a=X.n(u);X.d(We,"m",function(){return a.a});var l=X("4qgm"),s=X.n(l);X.d(We,"y",function(){return s.a});var m=X("JeFH"),d=X.n(m);X.d(We,"b",function(){return d.a});var f=X("ji0R"),D=X.n(f);X.d(We,"i",function(){return D.a});var v=X("W6BS"),h=X.n(v);X.d(We,"z",function(){return h.a});var p=X("kPYp"),c=X.n(p);X.d(We,"A",function(){return c.a});var o=X("nukY"),x=X.n(o),g=X("4u4S"),C=X.n(g),_=X("yslc"),z=X.n(_),Y=X("l2Kq"),oe=X.n(Y),G=X("RMFE"),j=X.n(G);X.d(We,"o",function(){return j.a});var se=X("TGq3"),fe=X.n(se),Se=X("SMhR"),ke=X.n(Se),Je=X("8/bI"),_e=X.n(Je);X.d(We,"j",function(){return _e.a});var Qe=X("JWDV"),Ue=X.n(Qe),Fe=X("Xsq0"),we=X.n(Fe);X.d(We,"p",function(){return we.a});var F=X("Ohmc"),R=X.n(F);X.d(We,"c",function(){return R.a});var M=X("csWT"),K=X.n(M);X.d(We,"d",function(){return K.a});var $=X("7v3h"),B=X.n($);X.d(We,"k",function(){return B.a});var ge=X("cRFk"),Oe=X.n(ge);X.d(We,"u",function(){return Oe.a});var je=X("kPWJ"),Ze=X.n(je);X.d(We,"t",function(){return Ze.a});var He=X("qgvg"),ze=X.n(He);X.d(We,"r",function(){return ze.a});var Xe=X("FPkq"),dt=X.n(Xe);X.d(We,"s",function(){return dt.a});var ct=X("A/g1"),gt=X.n(ct);X.d(We,"f",function(){return gt.a});var at=X("Nmxd"),ft=X.n(at);X.d(We,"g",function(){return ft.a});var lt=X("5D2P"),Ye=X.n(lt);X.d(We,"h",function(){return Ye.a});var Ne=X("djh8"),ht=X.n(Ne),qe=X("Jq4h"),le=X.n(qe)},mepR:function(Ge,We,X){Ge.exports={flex_box_center:"flex_box_center___3PiSf",flex_space_between:"flex_space_between___3wd5O",flex_box_vertical_center:"flex_box_vertical_center___3qKIW",flex_box_center_end:"flex_box_center_end___2PBRG",flex_box_column:"flex_box_column___39GGe",bg:"bg___3lEyf",formWrap:"formWrap___1e8Z1",empty:"empty___2jgvs",list:"list___3m2Ed",fs:"fs___2PURZ",top:"top___2EfKX",left:"left___3Bk5W",title:"title___1hcE1",qs:"qs___KHjhf",qsActive:"qsActive___2FXkO",right:"right___2XWtX",bt:"bt___2mIBt",answer:"answer___1TBgK",addBtn:"addBtn___NMPyJ"}},nKGa:function(Ge,We,X){Ge.exports=X.p+"static/export_exercise-template.f7655c19.png"},nuEh:function(Ge,We,X){"use strict";var de=X("T2oS"),V=X("W9HT"),O=X("q1tI"),H=X.n(O),A=X("F8wB"),k=X.n(A),W=function(P){var L=P.loading;return L?H.a.createElement("div",{className:k.a.loading},H.a.createElement(V.a,null)):H.a.createElement(H.a.Fragment,null)};We.a=W},nukY:function(Ge,We){Ge.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALoAAABSCAYAAADjGc4eAAAMkklEQVR4Xu2dWWwcSRnHv7Yd577v+74vkgWEQCAEy6IVWuCB62GVICFIYkcsvMC+LW8LL7BIiTiEhCweInjgPrRCC2KBJTBVYzm24yRO4ty3kziJj9ie+tC/d9oaT2b67ume7irJsjdbVf19X/266quvjjaEEG8w8yukk7ZAii1gM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Ge,We,X){(function(de){de(X("VrN/"))})(function(de){"use strict";var V=de.Pos;function O(u,a){return u.line-a.line||u.ch-a.ch}var H="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",A=H+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",k=new RegExp("<(/?)(["+H+"]["+A+"]*)","g");function W(u,a,l,s){this.line=a,this.ch=l,this.cm=u,this.text=u.getLine(a),this.min=s?Math.max(s.from,u.firstLine()):u.firstLine(),this.max=s?Math.min(s.to-1,u.lastLine()):u.lastLine()}function U(u,a){var l=u.cm.getTokenTypeAt(V(u.line,a));return l&&/\btag\b/.test(l)}function P(u){return u.line>=u.max?void 0:(u.ch=0,u.text=u.cm.getLine(++u.line),!0)}function L(u){return u.line<=u.min?void 0:(u.text=u.cm.getLine(--u.line),u.ch=u.text.length,!0)}function b(u){for(;;){var a=u.text.indexOf(">",u.ch);if(a==-1){if(P(u))continue;return}if(!U(u,a+1)){u.ch=a+1;continue}var l=u.text.lastIndexOf("/",a),s=l>-1&&!/\S/.test(u.text.slice(l+1,a));return u.ch=a+1,s?"selfClose":"regular"}}function E(u){for(;;){var a=u.ch?u.text.lastIndexOf("<",u.ch-1):-1;if(a==-1){if(L(u))continue;return}if(!U(u,a+1)){u.ch=a;continue}k.lastIndex=a,u.ch=a;var l=k.exec(u.text);if(l&&l.index==a)return l}}function I(u){for(;;){k.lastIndex=u.ch;var a=k.exec(u.text);if(!a){if(P(u))continue;return}if(!U(u,a.index+1)){u.ch=a.index+1;continue}return u.ch=a.index+a[0].length,a}}function w(u){for(;;){var a=u.ch?u.text.lastIndexOf(">",u.ch-1):-1;if(a==-1){if(L(u))continue;return}if(!U(u,a+1)){u.ch=a;continue}var l=u.text.lastIndexOf("/",a),s=l>-1&&!/\S/.test(u.text.slice(l+1,a));return u.ch=a+1,s?"selfClose":"regular"}}function T(u,a){for(var l=[];;){var s=I(u),m,d=u.line,f=u.ch-(s?s[0].length:0);if(!s||!(m=b(u)))return;if(m=="selfClose")continue;if(s[1]){for(var D=l.length-1;D>=0;--D)if(l[D]==s[2]){l.length=D;break}if(D<0&&(!a||a==s[2]))return{tag:s[2],from:V(d,f),to:V(u.line,u.ch)}}else l.push(s[2])}}function y(u,a){for(var l=[];;){var s=w(u);if(!s)return;if(s=="selfClose"){E(u);continue}var m=u.line,d=u.ch,f=E(u);if(!f)return;if(f[1])l.push(f[2]);else{for(var D=l.length-1;D>=0;--D)if(l[D]==f[2]){l.length=D;break}if(D<0&&(!a||a==f[2]))return{tag:f[2],from:V(u.line,u.ch),to:V(m,d)}}}}de.registerHelper("fold","xml",function(u,a){for(var l=new W(u,a.line,0);;){var s=I(l);if(!s||l.line!=a.line)return;var m=b(l);if(!m)return;if(!s[1]&&m!="selfClose"){var d=V(l.line,l.ch),f=T(l,s[2]);return f&&O(f.from,d)>0?{from:d,to:f.from}:null}}}),de.findMatchingTag=function(u,a,l){var s=new W(u,a.line,a.ch,l);if(s.text.indexOf(">")==-1&&s.text.indexOf("<")==-1)return;var m=b(s),d=m&&V(s.line,s.ch),f=m&&E(s);if(!m||!f||O(s,a)>0)return;var D={from:V(s.line,s.ch),to:d,tag:f[2]};return m=="selfClose"?{open:D,close:null,at:"open"}:f[1]?{open:y(s,f[2]),close:D,at:"close"}:(s=new W(u,d.line,d.ch,l),{open:D,close:T(s,f[2]),at:"open"})},de.findEnclosingTag=function(u,a,l,s){for(var m=new W(u,a.line,a.ch,l);;){var d=y(m,s);if(!d)break;var f=new W(u,a.line,a.ch,l),D=T(f,d.tag);if(D)return{open:d,close:D}}},de.scanForClosingTag=function(u,a,l,s){var m=new W(u,a.line,a.ch,s?{from:0,to:s}:null);return T(m,l)}})},p5ED:function(Ge,We,X){"use strict";var de=X("+L6B"),V=X("2/Rp"),O=X("5Dmo"),H=X("3S7+"),A=X("k1fw"),k=X("9og8"),W=X("tJVT"),U=X("WmNS"),P=X.n(U),L=X("q1tI"),b=X.n(L),E=X("vHTk"),I=X.n(E),w=X("yEEn"),T=X("ZW9T"),y=X("1vsH"),u=X("V0Rq"),a=X("m3rI");We.a=function(l){var s,m,d,f,D,v,h,p=l.editOffice,c=p===void 0?"view":p,o=l.data,x=l.theme,g=l.type,C=l.filename,_=l.monacoEditor,z=l.className,Y=l.style,oe=l.close,G=l.onClose,j=l.hasMask,se=l.disabledDownload,fe=Object(L.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),Se=Object(W.a)(fe,2),ke=Se[0],Je=Se[1],_e=Object(L.useState)(""),Qe=Object(W.a)(_e,2),Ue=Qe[0],Fe=Qe[1],we=Object(L.useState)(),F=Object(W.a)(we,2),R=F[0],M=F[1],K=window.ENV==="build"?"/react/build":"",$=a.a.PROXY_SERVER||location.origin,B,ge=1024*1024,Oe=10*ge,je=Object(L.useRef)();(s=o)!==null&&s!==void 0&&s.startsWith("/api")&&g!=="txt"&&(o=(a.a.API_SERVER||location.origin)+o),g==="office"&&(B=Object(y.T)(o).filesize,B>Oe&&(g="other")),C&&_&&(_.filename=C),Object(L.useEffect)(function(){var Xe,dt,ct=(Xe=document.cookie)===null||Xe===void 0||((dt=Xe.replace(/\s/g,""))===null||dt===void 0)?void 0:dt.split(";");ct==null||ct.map(function(gt){var at=gt.split("=");at[0]==="_educoder_session"&&Fe(at[1])})},[]),Object(L.useEffect)(function(){g==="office"&&Ze()},[g,o]);var Ze=function(){var Xe=Object(k.a)(P.a.mark(function dt(){var ct,gt,at;return P.a.wrap(function(lt){for(;;)switch(lt.prev=lt.next){case 0:return console.log("data:",o),ct=o,o.startsWith("http")||(ct=location.origin+ct),gt=new URL(ct).pathname.split("/").pop(),lt.next=6,Object(u.V)({attachment_id:gt});case 6:at=lt.sent,M(at);case 8:case"end":return lt.stop()}},dt)}));return function(){return Xe.apply(this,arguments)}}(),He=function(){if(o.startsWith("http")||o.startsWith("blob:")){ze();return}Object(y.z)(C||"educoder",o,C)},ze=function(){Object(y.x)(C||"educoder",decodeURIComponent(o))};return b.a.createElement("div",{style:Object(A.a)({},Y||{}),className:"".concat(j&&I.a.bgBlack," ").concat(g?I.a.wrp:"hide")},oe&&b.a.createElement("div",{className:I.a.close,ref:je},!se&&b.a.createElement(H.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return je.current}},b.a.createElement("span",{onClick:ze},b.a.createElement("i",{className:"icon-quxiaozhiding"}))),b.a.createElement(H.a,{title:"\u5173\u95ED",getPopupContainer:function(){return je.current}},b.a.createElement("span",{className:"",onClick:G},b.a.createElement("i",{className:"icon-guanbi1"})))),b.a.createElement("div",{className:"".concat(I.a[z]," ").concat(z," ").concat(I.a.monaco," ").concat(g==="txt"?"show":"hide")},g==="txt"&&b.a.createElement(T.b,_)),g==="audio"&&b.a.createElement("audio",{src:"".concat(((m=o)===null||m===void 0?void 0:m.indexOf("http://"))>-1||((d=o)===null||d===void 0?void 0:d.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(o),autoPlay:!0}),g==="video"&&b.a.createElement(b.a.Fragment,null,((f=o)===null||f===void 0?void 0:f.indexOf("http"))>-1?b.a.createElement("video",{controls:!0,src:"".concat(o),autoPlay:!0}):b.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(o),autoPlay:!0})),g==="office"&&R&&b.a.createElement("iframe",{src:"".concat(K,"/office.html?key=").concat(R.key,"&url=").concat($+R.url,"&callbackUrl=").concat($+R.callbackUrl,"&fileType=").concat(R.fileType,"&title=").concat(R.title,"&model=").concat(c,"&officeServer=").concat(a.a.OFFICE_SERVER,"&disabledDownload=").concat(!!se)}),g==="html"&&b.a.createElement("iframe",{src:o+"&disposition=inline"}),g==="pdf"&&b.a.createElement("iframe",{src:"".concat(K,"/js/pdfview/index.html?url=").concat(o,"&disabledDownload=").concat(!!se)}),g==="image"&&b.a.createElement("img",{src:"".concat(((D=o)===null||D===void 0?void 0:D.indexOf("http://"))>-1||((v=o)===null||v===void 0?void 0:v.indexOf("https://"))>-1||(h=o)!==null&&h!==void 0&&h.startsWith("/api")?"":"data:image/png;base64,").concat(o)}),g==="other"&&b.a.createElement("div",null,b.a.createElement(V.a,{type:"primary",size:"large",onClick:He},b.a.createElement(w.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),g==="download"&&b.a.createElement(V.a,{type:"primary",size:"large",onClick:He},b.a.createElement(w.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(Ge,We,X){},qgvg:function(Ge,We){Ge.exports="data:image/gif;base64,R0lGODlhFAAQAOZVAD6Q33p6ezZto2VnaW5vcDuCxiYvNysvM1tdXzNij5eXlyg0QTA0OExOUWZnaS8zN19hYzFYf0Oi/Sg1QoeHh2JjZWZoaTdzrTRmljl5tzFZgDBWez6P3Tl4tjl8uzdxqWBiYys/VCUqL39/gHV2dy4yNScyPDJeiEpNTzk8P0CX6jc7PiYuNWlqaywwNDZtojAzNytDWScrLitAVUGb8Xl6eoWFhTp+wDNgjWRmZ4+QkFdZWzo9QIODgyo/Uzh3syg0QCczPmprbTRllW9wcSotMVJUVjZupDuEylBSVUGb8kxPUZGRkTd0rUGc82JkZUKe9j2M1zg7P4iIiEOj/yUpLQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/wtYTVA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D0iciI/PgH//v38+/r5+Pf29fTz8vHw7+7t7Ovq6ejn5uXk4+Lh4N/e3dzb2tnY19bV1NPS0dDPzs3My8rJyMfGxcTDwsHAv769vLu6ubi3trW0s7KxsK+urayrqqmop6alpKOioaCfnp2cm5qZmJeWlZSTkpGQj46NjIuKiYiHhoWEg4KBgH9+fXx7enl4d3Z1dHNycXBvbm1sa2ppaGdmZWRjYmFgX15dXFtaWVhXVlVUU1JRUE9OTUxLSklIR0ZFRENCQUA/Pj08Ozo5ODc2NTQzMjEwLy4tLCsqKSgnJiUkIyIhIB8eHRwbGhkYFxYVFBMSERAPDg0MCwoJCAcGBQQDAgEAACH5BAUyAFUALAAAAAAUABAAAAd5gFWCg4RSLoSIiVUPFlNEhAwDCIoyST1TUwGCBwM6AweJPCSYmJpVCAMMgykgFRUtFKSlilVCsreZtAS4sqaJu7yzisDBvhAKyBDEvL6Iy7jNhA7BwoklKA0NRiO30bRFOzakpqiqtItPsTWbA0wWoOcrOUuEMA6TgQAh+QQFMgBVACwAAAAAFAAQAAAHeIBVgoOEISaEiIlVExlUSIQLAgmKIidOVFQAggYCNAIGiTFRmJiaVQkCC4MzHxcXHhKkpYpVN7K3mbQFuLKmibu8s4rAwb4YpBjEvL6IyrjMhB3BwolBGxEROCq30LQsQ1CkpqiqtItNsRybAkpHoOY+PxqEQC+TgQA7"},rUJ1:function(Ge,We){const X=/[&<>"']/,de=/[&<>"']/g,V=/[<>"']|&(?!#?\w+;)/,O=/[<>"']|&(?!#?\w+;)/g,H={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},A=v=>H[v];function k(v,h){if(h){if(X.test(v))return v.replace(de,A)}else if(V.test(v))return v.replace(O,A);return v}const W=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function U(v){return v.replace(W,(h,p)=>(p=p.toLowerCase(),p==="colon"?":":p.charAt(0)==="#"?p.charAt(1)==="x"?String.fromCharCode(parseInt(p.substring(2),16)):String.fromCharCode(+p.substring(1)):""))}const P=/(^|[^\[])\^/g;function L(v,h){v=v.source||v,h=h||"";const p={replace:(c,o)=>(o=o.source||o,o=o.replace(P,"$1"),v=v.replace(c,o),p),getRegex:()=>new RegExp(v,h)};return p}const b=/[^\w:]/g,E=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function I(v,h,p){if(v){let c;try{c=decodeURIComponent(U(p)).replace(b,"").toLowerCase()}catch(o){return null}if(c.indexOf("javascript:")===0||c.indexOf("vbscript:")===0||c.indexOf("data:")===0)return null}h&&!E.test(p)&&(p=a(h,p));try{p=encodeURI(p).replace(/%25/g,"%")}catch(c){return null}return p}const w={},T=/^[^:]+:\/*[^/]*$/,y=/^([^:]+:)[\s\S]*$/,u=/^([^:]+:\/*[^/]*)[\s\S]*$/;function a(v,h){w[" "+v]||(T.test(v)?w[" "+v]=v+"/":w[" "+v]=d(v,"/",!0)),v=w[" "+v];const p=v.indexOf(":")===-1;return h.substring(0,2)==="//"?p?h:v.replace(y,"$1")+h:h.charAt(0)==="/"?p?h:v.replace(u,"$1")+h:v+h}const l={exec:function(){}};function s(v){let h=1,p,c;for(;h<arguments.length;h++){p=arguments[h];for(c in p)Object.prototype.hasOwnProperty.call(p,c)&&(v[c]=p[c])}return v}function m(v,h){const p=v.replace(/\|/g,(x,g,C)=>{let _=!1,z=g;for(;--z>=0&&C[z]==="\\";)_=!_;return _?"|":" |"}),c=p.split(/ \|/);let o=0;if(c.length>h)c.splice(h);else for(;c.length<h;)c.push("");for(;o<c.length;o++)c[o]=c[o].trim().replace(/\\\|/g,"|");return c}function d(v,h,p){const c=v.length;if(c===0)return"";let o=0;for(;o<c;){const x=v.charAt(c-o-1);if(x===h&&!p)o++;else if(x!==h&&p)o++;else break}return v.substr(0,c-o)}function f(v,h){if(v.indexOf(h[1])===-1)return-1;const p=v.length;let c=0,o=0;for(;o<p;o++)if(v[o]==="\\")o++;else if(v[o]===h[0])c++;else if(v[o]===h[1]&&(c--,c<0))return o;return-1}function D(v){v&&v.sanitize&&!v.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")}Ge.exports={escape:k,unescape:U,edit:L,cleanUrl:I,resolveUrl:a,noopTest:l,merge:s,splitCells:m,rtrim:d,findClosingBracket:f,checkSanitizeDeprecation:D}},t23M:function(Ge,We,X){"use strict";var de=X("VTBJ"),V=X("1OyB"),O=X("vuIU"),H=X("Ji7U"),A=X("LK+K"),k=X("q1tI"),W=X.n(k),U=X("m+aA"),P=X("Zm9Q"),L=X("Kwbf"),b=X("c+Xe"),E=X("bdgK"),I="rc-observer-key",w=function(T){Object(H.a)(u,T);var y=Object(A.a)(u);function u(){var a;return Object(V.a)(this,u),a=y.apply(this,arguments),a.resizeObserver=null,a.childNode=null,a.currentElement=null,a.state={width:0,height:0,offsetHeight:0,offsetWidth:0},a.onResize=function(l){var s=a.props.onResize,m=l[0].target,d=m.getBoundingClientRect(),f=d.width,D=d.height,v=m.offsetWidth,h=m.offsetHeight,p=Math.floor(f),c=Math.floor(D);if(a.state.width!==p||a.state.height!==c||a.state.offsetWidth!==v||a.state.offsetHeight!==h){var o={width:p,height:c,offsetWidth:v,offsetHeight:h};a.setState(o),s&&Promise.resolve().then(function(){s(Object(de.a)(Object(de.a)({},o),{},{offsetWidth:v,offsetHeight:h}))})}},a.setChildNode=function(l){a.childNode=l},a}return Object(O.a)(u,[{key:"componentDidMount",value:function(){this.onComponentUpdated()}},{key:"componentDidUpdate",value:function(){this.onComponentUpdated()}},{key:"componentWillUnmount",value:function(){this.destroyObserver()}},{key:"onComponentUpdated",value:function(){var l=this.props.disabled;if(l){this.destroyObserver();return}var s=Object(U.a)(this.childNode||this),m=s!==this.currentElement;m&&(this.destroyObserver(),this.currentElement=s),!this.resizeObserver&&s&&(this.resizeObserver=new E.default(this.onResize),this.resizeObserver.observe(s))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var l=this.props.children,s=Object(P.a)(l);if(s.length>1)Object(L.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(s.length===0)return Object(L.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var m=s[0];if(k.isValidElement(m)&&Object(b.c)(m)){var d=m.ref;s[0]=k.cloneElement(m,{ref:Object(b.a)(d,this.setChildNode)})}return s.length===1?s[0]:s.map(function(f,D){return!k.isValidElement(f)||"key"in f&&f.key!==null?f:k.cloneElement(f,{key:"".concat(I,"-").concat(D)})})}}]),u}(k.Component);w.displayName="ResizeObserver",We.a=w},tWlo:function(Ge,We){Ge.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZ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zxfjVFU+UjhcZCs+gp7f9nowcszMhfg17SoptSKDyym9N9cbePt8O2GrQ5pbrDRMTkwbe6MQpN6hfFRUVWa+Qb+7je23ideLAtPdGZ/cUZpw1iTsTFtFLJcBwEc2RIryHqELvW2q/qQPT4JA4AmupL5aP/Saza8A0eDU2Jvr0DrWaNkEe3L32kULmhXV+cHHR8cOvV5tcDd9f8qvm9ouAW2Zm5yhpm5uwWi9HRoRXq1UqC9zt08cDe391VUiJPyaPo+F1zddaZy80XFyLRv52v2ViPrehiJSvz6Z7rthQpZI+t6E+K91yuj+3UXnkL+7PbYxCFdiIKfgYdTcohHZ23QTnEntd8Y8AAwCTubpzlq2wWAAAAABJRU5ErkJggg=="},uIXO:function(Ge,We,X){Ge.exports={flex_box_center:"flex_box_center___1HoSW",flex_space_between:"flex_space_between___1NTlm",flex_box_vertical_center:"flex_box_vertical_center___1RREG",flex_box_center_end:"flex_box_center_end___-OJaq",flex_box_column:"flex_box_column___11ry4",modal:"modal___32KcS",main:"main___3HP_p",title:"title___1Kjif",name:"name___3ysu_",body:"body___33mTT",form:"form___2fckF",btns:"btns___3SmLH"}},ulZh:function(Ge,We,X){typeof window!="undefined"&&function(V,O){Ge.exports=O()}(this,function(){return function(de){var V={};function O(H){if(V[H])return V[H].exports;var A=V[H]={i:H,l:!1,exports:{}};return de[H].call(A.exports,A,A.exports,O),A.l=!0,A.exports}return O.m=de,O.c=V,O.d=function(H,A,k){O.o(H,A)||Object.defineProperty(H,A,{enumerable:!0,get:k})},O.r=function(H){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(H,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(H,"__esModule",{value:!0})},O.t=function(H,A){if(A&1&&(H=O(H)),A&8)return H;if(A&4&&typeof H=="object"&&H&&H.__esModule)return H;var k=Object.create(null);if(O.r(k),Object.defineProperty(k,"default",{enumerable:!0,value:H}),A&2&&typeof H!="string")for(var W in H)O.d(k,W,function(U){return H[U]}.bind(null,W));return k},O.n=function(H){var A=H&&H.__esModule?function(){return H.default}:function(){return H};return O.d(A,"a",A),A},O.o=function(H,A){return Object.prototype.hasOwnProperty.call(H,A)},O.p="/dist/",O(O.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(de,V,O){"use strict";var H=Object.prototype.hasOwnProperty,A="~";function k(){}Object.create&&(k.prototype=Object.create(null),new k().__proto__||(A=!1));function W(b,E,I){this.fn=b,this.context=E,this.once=I||!1}function U(b,E,I,w,T){if(typeof I!="function")throw new TypeError("The listener must be a function");var y=new W(I,w||b,T),u=A?A+E:E;return b._events[u]?b._events[u].fn?b._events[u]=[b._events[u],y]:b._events[u].push(y):(b._events[u]=y,b._eventsCount++),b}function P(b,E){--b._eventsCount===0?b._events=new k:delete b._events[E]}function L(){this._events=new k,this._eventsCount=0}L.prototype.eventNames=function(){var E=[],I,w;if(this._eventsCount===0)return E;for(w in I=this._events)H.call(I,w)&&E.push(A?w.slice(1):w);return Object.getOwnPropertySymbols?E.concat(Object.getOwnPropertySymbols(I)):E},L.prototype.listeners=function(E){var I=A?A+E:E,w=this._events[I];if(!w)return[];if(w.fn)return[w.fn];for(var T=0,y=w.length,u=new Array(y);T<y;T++)u[T]=w[T].fn;return u},L.prototype.listenerCount=function(E){var I=A?A+E:E,w=this._events[I];return w?w.fn?1:w.length:0},L.prototype.emit=function(E,I,w,T,y,u){var a=A?A+E:E;if(!this._events[a])return!1;var l=this._events[a],s=arguments.length,m,d;if(l.fn){l.once&&this.removeListener(E,l.fn,void 0,!0);switch(s){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,I),!0;case 3:return l.fn.call(l.context,I,w),!0;case 4:return l.fn.call(l.context,I,w,T),!0;case 5:return l.fn.call(l.context,I,w,T,y),!0;case 6:return l.fn.call(l.context,I,w,T,y,u),!0}for(d=1,m=new Array(s-1);d<s;d++)m[d-1]=arguments[d];l.fn.apply(l.context,m)}else{var f=l.length,D;for(d=0;d<f;d++){l[d].once&&this.removeListener(E,l[d].fn,void 0,!0);switch(s){case 1:l[d].fn.call(l[d].context);break;case 2:l[d].fn.call(l[d].context,I);break;case 3:l[d].fn.call(l[d].context,I,w);break;case 4:l[d].fn.call(l[d].context,I,w,T);break;default:if(!m)for(D=1,m=new Array(s-1);D<s;D++)m[D-1]=arguments[D];l[d].fn.apply(l[d].context,m)}}}return!0},L.prototype.on=function(E,I,w){return U(this,E,I,w,!1)},L.prototype.once=function(E,I,w){return U(this,E,I,w,!0)},L.prototype.removeListener=function(E,I,w,T){var y=A?A+E:E;if(!this._events[y])return this;if(!I)return P(this,y),this;var u=this._events[y];if(u.fn)u.fn===I&&(!T||u.once)&&(!w||u.context===w)&&P(this,y);else{for(var a=0,l=[],s=u.length;a<s;a++)(u[a].fn!==I||T&&!u[a].once||w&&u[a].context!==w)&&l.push(u[a]);l.length?this._events[y]=l.length===1?l[0]:l:P(this,y)}return this},L.prototype.removeAllListeners=function(E){var I;return E?(I=A?A+E:E,this._events[I]&&P(this,I)):(this._events=new k,this._eventsCount=0),this},L.prototype.off=L.prototype.removeListener,L.prototype.addListener=L.prototype.on,L.prefixed=A,L.EventEmitter=L,de.exports=L},"./node_modules/url-toolkit/src/url-toolkit.js":function(de,V,O){(function(H){var A=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,k=/^([^\/?#]*)([^]*)$/,W=/(?:\/|^)\.(?=\/)/g,U=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,P={buildAbsoluteURL:function(L,b,E){if(E=E||{},L=L.trim(),b=b.trim(),!b){if(!E.alwaysNormalize)return L;var I=P.parseURL(L);if(!I)throw new Error("Error trying to parse base URL.");return I.path=P.normalizePath(I.path),P.buildURLFromParts(I)}var w=P.parseURL(b);if(!w)throw new Error("Error trying to parse relative URL.");if(w.scheme)return E.alwaysNormalize?(w.path=P.normalizePath(w.path),P.buildURLFromParts(w)):b;var T=P.parseURL(L);if(!T)throw new Error("Error trying to parse base URL.");if(!T.netLoc&&T.path&&T.path[0]!=="/"){var y=k.exec(T.path);T.netLoc=y[1],T.path=y[2]}T.netLoc&&!T.path&&(T.path="/");var u={scheme:T.scheme,netLoc:w.netLoc,path:null,params:w.params,query:w.query,fragment:w.fragment};if(!w.netLoc&&(u.netLoc=T.netLoc,w.path[0]!=="/"))if(!w.path)u.path=T.path,w.params||(u.params=T.params,w.query||(u.query=T.query));else{var a=T.path,l=a.substring(0,a.lastIndexOf("/")+1)+w.path;u.path=P.normalizePath(l)}return u.path===null&&(u.path=E.alwaysNormalize?P.normalizePath(w.path):w.path),P.buildURLFromParts(u)},parseURL:function(L){var b=A.exec(L);return b?{scheme:b[1]||"",netLoc:b[2]||"",path:b[3]||"",params:b[4]||"",query:b[5]||"",fragment:b[6]||""}:null},normalizePath:function(L){for(L=L.split("").reverse().join("").replace(W,"");L.length!==(L=L.replace(U,"")).length;);return L.split("").reverse().join("")},buildURLFromParts:function(L){return L.scheme+L.netLoc+L.path+L.params+L.query+L.fragment}};de.exports=P})(this)},"./node_modules/webworkify-webpack/index.js":function(de,V,O){function H(E){var I={};function w(y){if(I[y])return I[y].exports;var u=I[y]={i:y,l:!1,exports:{}};return E[y].call(u.exports,u,u.exports,w),u.l=!0,u.exports}w.m=E,w.c=I,w.i=function(y){return y},w.d=function(y,u,a){w.o(y,u)||Object.defineProperty(y,u,{configurable:!1,enumerable:!0,get:a})},w.r=function(y){Object.defineProperty(y,"__esModule",{value:!0})},w.n=function(y){var u=y&&y.__esModule?function(){return y.default}:function(){return y};return w.d(u,"a",u),u},w.o=function(y,u){return Object.prototype.hasOwnProperty.call(y,u)},w.p="/",w.oe=function(y){throw console.error(y),y};var T=w(w.s=ENTRY_MODULE);return T.default||T}var A="[\\.|\\-|\\+|\\w|/|@]+",k="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+A+").*?\\)";function W(E){return(E+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function U(E){return!isNaN(1*E)}function P(E,I,w){var T={};T[w]=[];var y=I.toString(),u=y.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!u)return T;for(var a=u[1],l=new RegExp("(\\\\n|\\W)"+W(a)+k,"g"),s;s=l.exec(y);){if(s[3]==="dll-reference")continue;T[w].push(s[3])}for(l=new RegExp("\\("+W(a)+'\\("(dll-reference\\s('+A+'))"\\)\\)'+k,"g");s=l.exec(y);)E[s[2]]||(T[w].push(s[1]),E[s[2]]=O(s[1]).m),T[s[2]]=T[s[2]]||[],T[s[2]].push(s[4]);for(var m=Object.keys(T),d=0;d<m.length;d++)for(var f=0;f<T[m[d]].length;f++)U(T[m[d]][f])&&(T[m[d]][f]=1*T[m[d]][f]);return T}function L(E){var I=Object.keys(E);return I.reduce(function(w,T){return w||E[T].length>0},!1)}function b(E,I){for(var w={main:[I]},T={main:[]},y={main:{}};L(w);)for(var u=Object.keys(w),a=0;a<u.length;a++){var l=u[a],s=w[l],m=s.pop();if(y[l]=y[l]||{},y[l][m]||!E[l][m])continue;y[l][m]=!0,T[l]=T[l]||[],T[l].push(m);for(var d=P(E,E[l][m],l),f=Object.keys(d),D=0;D<f.length;D++)w[f[D]]=w[f[D]]||[],w[f[D]]=w[f[D]].concat(d[f[D]])}return T}de.exports=function(E,I){I=I||{};var w={main:O.m},T=I.all?{main:Object.keys(w.main)}:b(w,E),y="";Object.keys(T).filter(function(m){return m!=="main"}).forEach(function(m){for(var d=0;T[m][d];)d++;T[m].push(d),w[m][d]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",y=y+"var "+m+" = ("+H.toString().replace("ENTRY_MODULE",JSON.stringify(d))+")({"+T[m].map(function(f){return""+JSON.stringify(f)+": "+w[m][f].toString()}).join(",")+`});
`}),y=y+"new (("+H.toString().replace("ENTRY_MODULE",JSON.stringify(E))+")({"+T.main.map(function(m){return""+JSON.stringify(m)+": "+w.main[m].toString()}).join(",")+"}))(self);";var u=new window.Blob([y],{type:"text/javascript"});if(I.bare)return u;var a=window.URL||window.webkitURL||window.mozURL||window.msURL,l=a.createObjectURL(u),s=new window.Worker(l);return s.objectURL=l,s}},"./src/config.ts":function(de,V,O){"use strict";O.r(V),O.d(V,"hlsDefaultConfig",function(){return D}),O.d(V,"mergeConfig",function(){return h}),O.d(V,"enableStreamingMode",function(){return p});var H=O("./src/controller/abr-controller.ts"),A=O("./src/controller/audio-stream-controller.ts"),k=O("./src/controller/audio-track-controller.ts"),W=O("./src/controller/subtitle-stream-controller.ts"),U=O("./src/controller/subtitle-track-controller.ts"),P=O("./src/controller/buffer-controller.ts"),L=O("./src/controller/timeline-controller.ts"),b=O("./src/controller/cap-level-controller.ts"),E=O("./src/controller/fps-controller.ts"),I=O("./src/controller/eme-controller.ts"),w=O("./src/controller/cmcd-controller.ts"),T=O("./src/utils/xhr-loader.ts"),y=O("./src/utils/fetch-loader.ts"),u=O("./src/utils/cues.ts"),a=O("./src/utils/mediakeys-helper.ts"),l=O("./src/utils/logger.ts");function s(){return s=Object.assign||function(c){for(var o=1;o<arguments.length;o++){var x=arguments[o];for(var g in x)Object.prototype.hasOwnProperty.call(x,g)&&(c[g]=x[g])}return c},s.apply(this,arguments)}function m(c,o){var x=Object.keys(c);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(c);o&&(g=g.filter(function(C){return Object.getOwnPropertyDescriptor(c,C).enumerable})),x.push.apply(x,g)}return x}function d(c){for(var o=1;o<arguments.length;o++){var x=arguments[o]!=null?arguments[o]:{};o%2?m(Object(x),!0).forEach(function(g){f(c,g,x[g])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(x)):m(Object(x)).forEach(function(g){Object.defineProperty(c,g,Object.getOwnPropertyDescriptor(x,g))})}return c}function f(c,o,x){return o in c?Object.defineProperty(c,o,{value:x,enumerable:!0,configurable:!0,writable:!0}):c[o]=x,c}var D=d(d({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:T.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:H.default,bufferController:P.default,capLevelController:b.default,fpsController:E.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},v()),{},{subtitleStreamController:W.SubtitleStreamController,subtitleTrackController:U.default,timelineController:L.TimelineController,audioStreamController:A.default,audioTrackController:k.default,emeController:I.default,cmcdController:w.default});function v(){return{cueHandler:u.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 h(c,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 s({},c,o)}function p(c){var o=c.loader;if(o!==y.default&&o!==T.default)l.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),c.progressive=!1;else{var x=Object(y.fetchSupported)();x&&(c.loader=y.default,c.progressive=!0,c.enableSoftwareAES=!0,l.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(de,V,O){"use strict";O.r(V);var H=O("./src/polyfills/number.ts"),A=O("./src/utils/ewma-bandwidth-estimator.ts"),k=O("./src/events.ts"),W=O("./src/utils/buffer-helper.ts"),U=O("./src/errors.ts"),P=O("./src/types/loader.ts"),L=O("./src/utils/logger.ts");function b(w,T){for(var y=0;y<T.length;y++){var u=T[y];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(w,u.key,u)}}function E(w,T,y){return T&&b(w.prototype,T),y&&b(w,y),w}var I=function(){function w(y){this.hls=void 0,this.lastLoadedFragLevel=0,this._nextAutoLevel=-1,this.timer=void 0,this.onCheck=this._abandonRulesCheck.bind(this),this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this.hls=y;var u=y.config;this.bwEstimator=new A.default(u.abrEwmaSlowVoD,u.abrEwmaFastVoD,u.abrEwmaDefaultEstimate),this.registerListeners()}var T=w.prototype;return T.registerListeners=function(){var u=this.hls;u.on(k.Events.FRAG_LOADING,this.onFragLoading,this),u.on(k.Events.FRAG_LOADED,this.onFragLoaded,this),u.on(k.Events.FRAG_BUFFERED,this.onFragBuffered,this),u.on(k.Events.LEVEL_LOADED,this.onLevelLoaded,this),u.on(k.Events.ERROR,this.onError,this)},T.unregisterListeners=function(){var u=this.hls;u.off(k.Events.FRAG_LOADING,this.onFragLoading,this),u.off(k.Events.FRAG_LOADED,this.onFragLoaded,this),u.off(k.Events.FRAG_BUFFERED,this.onFragBuffered,this),u.off(k.Events.LEVEL_LOADED,this.onLevelLoaded,this),u.off(k.Events.ERROR,this.onError,this)},T.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},T.onFragLoading=function(u,a){var l=a.frag;if(l.type===P.PlaylistLevelType.MAIN&&!this.timer){var s;this.fragCurrent=l,this.partCurrent=(s=a.part)!=null?s:null,this.timer=self.setInterval(this.onCheck,100)}},T.onLevelLoaded=function(u,a){var l=this.hls.config;a.details.live?this.bwEstimator.update(l.abrEwmaSlowLive,l.abrEwmaFastLive):this.bwEstimator.update(l.abrEwmaSlowVoD,l.abrEwmaFastVoD)},T._abandonRulesCheck=function(){var u=this.fragCurrent,a=this.partCurrent,l=this.hls,s=l.autoLevelEnabled,m=l.config,d=l.media;if(!u||!d)return;var f=a?a.stats:u.stats,D=a?a.duration:u.duration;if(f.aborted){L.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!s||d.paused||!d.playbackRate||!d.readyState)return;var v=performance.now()-f.loading.start,h=Math.abs(d.playbackRate);if(v<=500*D/h)return;var p=l.levels,c=l.minAutoLevel,o=p[u.level],x=f.total||Math.max(f.loaded,Math.round(D*o.maxBitrate/8)),g=Math.max(1,f.bwEstimate?f.bwEstimate/8:f.loaded*1e3/v),C=(x-f.loaded)/g,_=d.currentTime,z=(W.BufferHelper.bufferInfo(d,_,m.maxBufferHole).end-_)/h;if(z>=2*D/h||C<=z)return;var Y=Number.POSITIVE_INFINITY,oe;for(oe=u.level-1;oe>c;oe--){var G=p[oe].maxBitrate;if(Y=D*G/(8*.8*g),Y<z)break}if(Y>=C)return;var j=this.bwEstimator.getEstimate();L.logger.warn("Fragment "+u.sn+(a?" part "+a.index:"")+" of level "+u.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+oe+`
Current BW estimate: `+(Object(H.isFiniteNumber)(j)?(j/1024).toFixed(3):"Unknown")+` Kb/s
Estimated load time for current fragment: `+C.toFixed(3)+` s
Estimated load time for the next fragment: `+Y.toFixed(3)+` s
Time to underbuffer: `+z.toFixed(3)+" s"),l.nextLoadLevel=oe,this.bwEstimator.sample(v,f.loaded),this.clearTimer(),u.loader&&(this.fragCurrent=this.partCurrent=null,u.loader.abort()),l.trigger(k.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:u,part:a,stats:f})},T.onFragLoaded=function(u,a){var l=a.frag,s=a.part;if(l.type===P.PlaylistLevelType.MAIN&&Object(H.isFiniteNumber)(l.sn)){var m=s?s.stats:l.stats,d=s?s.duration:l.duration;if(this.clearTimer(),this.lastLoadedFragLevel=l.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var f=this.hls.levels[l.level],D=(f.loaded?f.loaded.bytes:0)+m.loaded,v=(f.loaded?f.loaded.duration:0)+d;f.loaded={bytes:D,duration:v},f.realBitrate=Math.round(8*D/v)}if(l.bitrateTest){var h={stats:m,frag:l,part:s,id:l.type};this.onFragBuffered(k.Events.FRAG_BUFFERED,h),l.bitrateTest=!1}}},T.onFragBuffered=function(u,a){var l=a.frag,s=a.part,m=s?s.stats:l.stats;if(m.aborted)return;if(l.type!==P.PlaylistLevelType.MAIN||l.sn==="initSegment")return;var d=m.parsing.end-m.loading.start;this.bwEstimator.sample(d,m.loaded),m.bwEstimate=this.bwEstimator.getEstimate(),l.bitrateTest?this.bitrateTestDelay=d/1e3:this.bitrateTestDelay=0},T.onError=function(u,a){switch(a.details){case U.ErrorDetails.FRAG_LOAD_ERROR:case U.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},T.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},T.getNextABRAutoLevel=function(){var u=this.fragCurrent,a=this.partCurrent,l=this.hls,s=l.maxAutoLevel,m=l.config,d=l.minAutoLevel,f=l.media,D=a?a.duration:u?u.duration:0,v=f?f.currentTime:0,h=f&&f.playbackRate!==0?Math.abs(f.playbackRate):1,p=this.bwEstimator?this.bwEstimator.getEstimate():m.abrEwmaDefaultEstimate,c=(W.BufferHelper.bufferInfo(f,v,m.maxBufferHole).end-v)/h,o=this.findBestLevel(p,d,s,c,m.abrBandWidthFactor,m.abrBandWidthUpFactor);if(o>=0)return o;L.logger.trace((c?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var x=D?Math.min(D,m.maxStarvationDelay):m.maxStarvationDelay,g=m.abrBandWidthFactor,C=m.abrBandWidthUpFactor;if(!c){var _=this.bitrateTestDelay;if(_){var z=D?Math.min(D,m.maxLoadingDelay):m.maxLoadingDelay;x=z-_,L.logger.trace("bitrate test took "+Math.round(1e3*_)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*x)+" ms"),g=C=1}}return o=this.findBestLevel(p,d,s,c+x,g,C),Math.max(o,0)},T.findBestLevel=function(u,a,l,s,m,d){for(var f,D=this.fragCurrent,v=this.partCurrent,h=this.lastLoadedFragLevel,p=this.hls.levels,c=p[h],o=!!(c!=null&&(f=c.details)!==null&&f!==void 0&&f.live),x=c==null?void 0:c.codecSet,g=v?v.duration:D?D.duration:0,C=l;C>=a;C--){var _=p[C];if(!_||x&&_.codecSet!==x)continue;var z=_.details,Y=(v?z==null?void 0:z.partTarget:z==null?void 0:z.averagetargetduration)||g,oe=void 0;C<=h?oe=m*u:oe=d*u;var G=p[C].maxBitrate,j=G*Y/oe;if(L.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+C+"/"+Math.round(oe)+"/"+G+"/"+Y+"/"+s+"/"+j),oe>G&&(!j||o&&!this.bitrateTestDelay||j<s))return C}return-1},E(w,[{key:"nextAutoLevel",get:function(){var u=this._nextAutoLevel,a=this.bwEstimator;if(u!==-1&&(!a||!a.canEstimate()))return u;var l=this.getNextABRAutoLevel();return u!==-1&&(l=Math.min(u,l)),l},set:function(u){this._nextAutoLevel=u}}]),w}();V.default=I},"./src/controller/audio-stream-controller.ts":function(de,V,O){"use strict";O.r(V);var H=O("./src/polyfills/number.ts"),A=O("./src/controller/base-stream-controller.ts"),k=O("./src/events.ts"),W=O("./src/utils/buffer-helper.ts"),U=O("./src/controller/fragment-tracker.ts"),P=O("./src/types/level.ts"),L=O("./src/types/loader.ts"),b=O("./src/loader/fragment.ts"),E=O("./src/demux/chunk-cache.ts"),I=O("./src/demux/transmuxer-interface.ts"),w=O("./src/types/transmuxer.ts"),T=O("./src/controller/fragment-finders.ts"),y=O("./src/utils/discontinuities.ts"),u=O("./src/errors.ts"),a=O("./src/utils/logger.ts");function l(){return l=Object.assign||function(D){for(var v=1;v<arguments.length;v++){var h=arguments[v];for(var p in h)Object.prototype.hasOwnProperty.call(h,p)&&(D[p]=h[p])}return D},l.apply(this,arguments)}function s(D,v){D.prototype=Object.create(v.prototype),D.prototype.constructor=D,m(D,v)}function m(D,v){return m=Object.setPrototypeOf||function(p,c){return p.__proto__=c,p},m(D,v)}var d=100,f=function(D){s(v,D);function v(p,c){var o;return o=D.call(this,p,c,"[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 h=v.prototype;return h.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},h._registerListeners=function(){var c=this.hls;c.on(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),c.on(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this),c.on(k.Events.MANIFEST_LOADING,this.onManifestLoading,this),c.on(k.Events.LEVEL_LOADED,this.onLevelLoaded,this),c.on(k.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),c.on(k.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),c.on(k.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),c.on(k.Events.ERROR,this.onError,this),c.on(k.Events.BUFFER_RESET,this.onBufferReset,this),c.on(k.Events.BUFFER_CREATED,this.onBufferCreated,this),c.on(k.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),c.on(k.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),c.on(k.Events.FRAG_BUFFERED,this.onFragBuffered,this)},h._unregisterListeners=function(){var c=this.hls;c.off(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),c.off(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this),c.off(k.Events.MANIFEST_LOADING,this.onManifestLoading,this),c.off(k.Events.LEVEL_LOADED,this.onLevelLoaded,this),c.off(k.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),c.off(k.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),c.off(k.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),c.off(k.Events.ERROR,this.onError,this),c.off(k.Events.BUFFER_RESET,this.onBufferReset,this),c.off(k.Events.BUFFER_CREATED,this.onBufferCreated,this),c.off(k.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),c.off(k.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),c.off(k.Events.FRAG_BUFFERED,this.onFragBuffered,this)},h.onInitPtsFound=function(c,o){var x=o.frag,g=o.id,C=o.initPTS;if(g==="main"){var _=x.cc;this.initPTS[x.cc]=C,this.log("InitPTS for cc: "+_+" found from main: "+C),this.videoTrackCC=_,this.state===A.State.WAITING_INIT_PTS&&this.tick()}},h.startLoad=function(c){if(!this.levels){this.startPosition=c,this.state=A.State.STOPPED;return}var o=this.lastCurrentTime;this.stopLoad(),this.setInterval(d),this.fragLoadError=0,o>0&&c===-1?(this.log("Override startPosition with lastCurrentTime @"+o.toFixed(3)),this.state=A.State.IDLE):(this.loadedmetadata=!1,this.state=A.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=c,this.tick()},h.doTick=function(){switch(this.state){case A.State.IDLE:this.doTickIdle();break;case A.State.WAITING_TRACK:{var c,o=this.levels,x=this.trackId,g=o==null||((c=o[x])===null||c===void 0)?void 0:c.details;if(g){if(this.waitForCdnTuneIn(g))break;this.state=A.State.WAITING_INIT_PTS}break}case A.State.FRAG_LOADING_WAITING_RETRY:{var C,_=performance.now(),z=this.retryDate;(!z||_>=z||(C=this.media)!==null&&C!==void 0&&C.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=A.State.IDLE);break}case A.State.WAITING_INIT_PTS:{var Y=this.waitingData;if(Y){var oe=Y.frag,G=Y.part,j=Y.cache,se=Y.complete;if(this.initPTS[oe.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=A.State.FRAG_LOADING;var fe=j.flush(),Se={frag:oe,part:G,payload:fe,networkDetails:null};this._handleFragmentLoadProgress(Se),se&&D.prototype._handleFragmentLoadComplete.call(this,Se)}else if(this.videoTrackCC!==this.waitingVideoCC)a.logger.log("Waiting fragment cc ("+oe.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var ke=this.getLoadPosition(),Je=W.BufferHelper.bufferInfo(this.mediaBuffer,ke,this.config.maxBufferHole),_e=Object(T.fragmentWithinToleranceTest)(Je.end,this.config.maxFragLookUpTolerance,oe);_e<0&&(a.logger.log("Waiting fragment cc ("+oe.cc+") @ "+oe.start+" cancelled because another fragment at "+Je.end+" is needed"),this.clearWaitingFragment())}}else this.state=A.State.IDLE}}this.onTickEnd()},h.clearWaitingFragment=function(){var c=this.waitingData;c&&(this.fragmentTracker.removeFragment(c.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=A.State.IDLE)},h.onTickEnd=function(){var c=this.media;if(!c||!c.readyState)return;var o=this.mediaBuffer?this.mediaBuffer:c,x=o.buffered;!this.loadedmetadata&&x.length&&(this.loadedmetadata=!0),this.lastCurrentTime=c.currentTime},h.doTickIdle=function(){var c,o,x=this.hls,g=this.levels,C=this.media,_=this.trackId,z=x.config;if(!g||!g[_])return;if(!C&&(this.startFragRequested||!z.startFragPrefetch))return;var Y=g[_],oe=Y.details;if(!oe||oe.live&&this.levelLastLoaded!==_||this.waitForCdnTuneIn(oe)){this.state=A.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,b.ElementaryStreamTypes.AUDIO,L.PlaylistLevelType.AUDIO));var G=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,L.PlaylistLevelType.AUDIO);if(G===null)return;var j=G.len,se=this.getMaxBufferLength(),fe=this.audioSwitch;if(j>=se&&!fe)return;if(!fe&&this._streamEnded(G,oe)){x.trigger(k.Events.BUFFER_EOS,{type:"audio"}),this.state=A.State.ENDED;return}var Se=oe.fragments,ke=Se[0].start,Je=G.end;if(fe){var _e=this.getLoadPosition();Je=_e,oe.PTSKnown&&_e<ke&&((G.end>ke||G.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),C.currentTime=ke+.05))}var Qe=this.getNextFragment(Je,oe);if(!Qe){this.bufferFlushed=!0;return}((c=Qe.decryptdata)===null||c===void 0?void 0:c.keyFormat)==="identity"&&!((o=Qe.decryptdata)!==null&&o!==void 0&&o.key)?this.loadKey(Qe,oe):this.loadFragment(Qe,oe,Je)},h.getMaxBufferLength=function(){var c=D.prototype.getMaxBufferLength.call(this),o=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,L.PlaylistLevelType.MAIN);return o===null?c:Math.max(c,o.len)},h.onMediaDetaching=function(){this.videoBuffer=null,D.prototype.onMediaDetaching.call(this)},h.onAudioTracksUpdated=function(c,o){var x=o.audioTracks;this.resetTransmuxer(),this.levels=x.map(function(g){return new P.Level(g)})},h.onAudioTrackSwitching=function(c,o){var x=!!o.url;this.trackId=o.id;var g=this.fragCurrent;g!=null&&g.loader&&g.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),x?this.setInterval(d):this.resetTransmuxer(),x?(this.audioSwitch=!0,this.state=A.State.IDLE):this.state=A.State.STOPPED,this.tick()},h.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},h.onLevelLoaded=function(c,o){this.mainDetails=o.details},h.onAudioTrackLoaded=function(c,o){var x,g=this.levels,C=o.details,_=o.id;if(!g){this.warn("Audio tracks were reset while loading level "+_);return}this.log("Track "+_+" loaded ["+C.startSN+","+C.endSN+"],duration:"+C.totalduration);var z=g[_],Y=0;if(C.live||(x=z.details)!==null&&x!==void 0&&x.live){var oe=this.mainDetails;if(C.fragments[0]||(C.deltaUpdateFailed=!0),C.deltaUpdateFailed||!oe)return;!z.details&&C.hasProgramDateTime&&oe.hasProgramDateTime?(Object(y.alignMediaPlaylistByPDT)(C,oe),Y=C.fragments[0].start):Y=this.alignPlaylists(C,z.details)}z.details=C,this.levelLastLoaded=_,!this.startFragRequested&&(this.mainDetails||!C.live)&&this.setStartPosition(z.details,Y),this.state===A.State.WAITING_TRACK&&!this.waitForCdnTuneIn(C)&&(this.state=A.State.IDLE),this.tick()},h._handleFragmentLoadProgress=function(c){var o,x=c.frag,g=c.part,C=c.payload,_=this.config,z=this.trackId,Y=this.levels;if(!Y){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 oe=Y[z];console.assert(oe,"Audio track is defined on fragment load progress");var G=oe.details;console.assert(G,"Audio track details are defined on fragment load progress");var j=_.defaultAudioCodec||oe.audioCodec||"mp4a.40.2",se=this.transmuxer;se||(se=this.transmuxer=new I.default(this.hls,L.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var fe=this.initPTS[x.cc],Se=(o=x.initSegment)===null||o===void 0?void 0:o.data;if(fe!==void 0){var ke=!1,Je=g?g.index:-1,_e=Je!==-1,Qe=new w.ChunkMetadata(x.level,x.sn,x.stats.chunkCount,C.byteLength,Je,_e);se.push(C,Se,j,"",x,g,G.totalduration,ke,Qe,fe)}else{a.logger.log("Unknown video PTS for cc "+x.cc+", waiting for video PTS before demuxing audio frag "+x.sn+" of ["+G.startSN+" ,"+G.endSN+"],track "+z);var Ue=this.waitingData=this.waitingData||{frag:x,part:g,cache:new E.default,complete:!1},Fe=Ue.cache;Fe.push(new Uint8Array(C)),this.waitingVideoCC=this.videoTrackCC,this.state=A.State.WAITING_INIT_PTS}},h._handleFragmentLoadComplete=function(c){if(this.waitingData){this.waitingData.complete=!0;return}D.prototype._handleFragmentLoadComplete.call(this,c)},h.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},h.onBufferCreated=function(c,o){var x=o.tracks.audio;x&&(this.mediaBuffer=x.buffer),o.tracks.video&&(this.videoBuffer=o.tracks.video.buffer)},h.onFragBuffered=function(c,o){var x=o.frag,g=o.part;if(x.type!==L.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(x)){this.warn("Fragment "+x.sn+(g?" p: "+g.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(k.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(x,g)},h.onError=function(c,o){switch(o.details){case u.ErrorDetails.FRAG_LOAD_ERROR:case u.ErrorDetails.FRAG_LOAD_TIMEOUT:case u.ErrorDetails.KEY_LOAD_ERROR:case u.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(L.PlaylistLevelType.AUDIO,o);break;case u.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case u.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==A.State.ERROR&&this.state!==A.State.STOPPED&&(this.state=o.fatal?A.State.ERROR:A.State.IDLE,this.warn(o.details+" while loading frag, switching to "+this.state+" state"));break;case u.ErrorDetails.BUFFER_FULL_ERROR:if(o.parent==="audio"&&(this.state===A.State.PARSING||this.state===A.State.PARSED)){var x=!0,g=this.getFwdBufferInfo(this.mediaBuffer,L.PlaylistLevelType.AUDIO);g&&g.len>.5&&(x=!this.reduceMaxBufferLength(g.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}},h.onBufferFlushed=function(c,o){var x=o.type;x===b.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},h._handleTransmuxComplete=function(c){var o,x="audio",g=this.hls,C=c.remuxResult,_=c.chunkMeta,z=this.getCurrentContext(_);if(!z){this.warn("The loading context changed while buffering fragment "+_.sn+" of level "+_.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(_.level);return}var Y=z.frag,oe=z.part,G=C.audio,j=C.text,se=C.id3,fe=C.initSegment;if(this.fragContextChanged(Y))return;if(this.state=A.State.PARSING,this.audioSwitch&&G&&this.completeAudioSwitch(),fe!=null&&fe.tracks&&(this._bufferInitSegment(fe.tracks,Y,_),g.trigger(k.Events.FRAG_PARSING_INIT_SEGMENT,{frag:Y,id:x,tracks:fe.tracks})),G){var Se=G.startPTS,ke=G.endPTS,Je=G.startDTS,_e=G.endDTS;oe&&(oe.elementaryStreams[b.ElementaryStreamTypes.AUDIO]={startPTS:Se,endPTS:ke,startDTS:Je,endDTS:_e}),Y.setElementaryStreamInfo(b.ElementaryStreamTypes.AUDIO,Se,ke,Je,_e),this.bufferFragmentData(G,Y,oe,_)}if(se!=null&&(o=se.samples)!==null&&o!==void 0&&o.length){var Qe=l({frag:Y,id:x},se);g.trigger(k.Events.FRAG_PARSING_METADATA,Qe)}if(j){var Ue=l({frag:Y,id:x},j);g.trigger(k.Events.FRAG_PARSING_USERDATA,Ue)}},h._bufferInitSegment=function(c,o,x){if(this.state!==A.State.PARSING)return;c.video&&delete c.video;var g=c.audio;if(!g)return;g.levelCodec=g.codec,g.id="audio",this.log("Init audio buffer, container:"+g.container+", codecs[parsed]=["+g.codec+"]"),this.hls.trigger(k.Events.BUFFER_CODECS,c);var C=g.initSegment;if(C!=null&&C.byteLength){var _={type:"audio",frag:o,part:null,chunkMeta:x,parent:o.type,data:C};this.hls.trigger(k.Events.BUFFER_APPENDING,_)}this.tick()},h.loadFragment=function(c,o,x){var g=this.fragmentTracker.getState(c);this.fragCurrent=c,(this.audioSwitch||g===U.FragmentState.NOT_LOADED||g===U.FragmentState.PARTIAL)&&(c.sn==="initSegment"?this._loadInitSegment(c):o.live&&!Object(H.isFiniteNumber)(this.initPTS[c.cc])?(this.log("Waiting for video PTS in continuity counter "+c.cc+" of live stream before loading audio fragment "+c.sn+" of level "+this.trackId),this.state=A.State.WAITING_INIT_PTS):(this.startFragRequested=!0,D.prototype.loadFragment.call(this,c,o,x)))},h.completeAudioSwitch=function(){var c=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,c.trigger(k.Events.AUDIO_TRACK_SWITCHED,{id:x})},v}(A.default);V.default=f},"./src/controller/audio-track-controller.ts":function(de,V,O){"use strict";O.r(V);var H=O("./src/events.ts"),A=O("./src/errors.ts"),k=O("./src/controller/base-playlist-controller.ts"),W=O("./src/types/loader.ts");function U(I,w){for(var T=0;T<w.length;T++){var y=w[T];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(I,y.key,y)}}function P(I,w,T){return w&&U(I.prototype,w),T&&U(I,T),I}function L(I,w){I.prototype=Object.create(w.prototype),I.prototype.constructor=I,b(I,w)}function b(I,w){return b=Object.setPrototypeOf||function(y,u){return y.__proto__=u,y},b(I,w)}var E=function(I){L(w,I);function w(y){var u;return u=I.call(this,y,"[audio-track-controller]")||this,u.tracks=[],u.groupId=null,u.tracksInGroup=[],u.trackId=-1,u.trackName="",u.selectDefaultTrack=!0,u.registerListeners(),u}var T=w.prototype;return T.registerListeners=function(){var u=this.hls;u.on(H.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.on(H.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.on(H.Events.LEVEL_LOADING,this.onLevelLoading,this),u.on(H.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),u.on(H.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),u.on(H.Events.ERROR,this.onError,this)},T.unregisterListeners=function(){var u=this.hls;u.off(H.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.off(H.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.off(H.Events.LEVEL_LOADING,this.onLevelLoading,this),u.off(H.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),u.off(H.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),u.off(H.Events.ERROR,this.onError,this)},T.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,I.prototype.destroy.call(this)},T.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},T.onManifestParsed=function(u,a){this.tracks=a.audioTracks||[]},T.onAudioTrackLoaded=function(u,a){var l=a.id,s=a.details,m=this.tracksInGroup[l];if(!m){this.warn("Invalid audio track id "+l);return}var d=m.details;m.details=a.details,this.log("audioTrack "+l+" loaded ["+s.startSN+"-"+s.endSN+"]"),l===this.trackId&&(this.retryCount=0,this.playlistLoaded(l,a,d))},T.onLevelLoading=function(u,a){this.switchLevel(a.level)},T.onLevelSwitching=function(u,a){this.switchLevel(a.level)},T.switchLevel=function(u){var a=this.hls.levels[u];if(!(a!=null&&a.audioGroupIds))return;var l=a.audioGroupIds[a.urlId];if(this.groupId!==l){this.groupId=l;var s=this.tracks.filter(function(d){return!l||d.groupId===l});this.selectDefaultTrack&&!s.some(function(d){return d.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=s;var m={audioTracks:s};this.log("Updating audio tracks, "+s.length+' track(s) found in "'+l+'" group-id'),this.hls.trigger(H.Events.AUDIO_TRACKS_UPDATED,m),this.selectInitialTrack()}},T.onError=function(u,a){if(I.prototype.onError.call(this,u,a),a.fatal||!a.context)return;a.context.type===W.PlaylistContextType.AUDIO_TRACK&&a.context.id===this.trackId&&a.context.groupId===this.groupId&&this.retryLoadingOrFail(a)},T.setAudioTrack=function(u){var a=this.tracksInGroup;if(u<0||u>=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 "+u);var s=a[u],m=s.id,d=s.groupId,f=d===void 0?"":d,D=s.name,v=s.type,h=s.url;if(this.trackId=u,this.trackName=D,this.selectDefaultTrack=!1,this.hls.trigger(H.Events.AUDIO_TRACK_SWITCHING,{id:m,groupId:f,name:D,type:v,url:h}),s.details&&!s.details.live)return;var p=this.switchParams(s.url,l==null?void 0:l.details);this.loadPlaylist(p)},T.selectInitialTrack=function(){var u=this.tracksInGroup;console.assert(u.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(H.Events.ERROR,{type:A.ErrorTypes.MEDIA_ERROR,details:A.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},T.findTrackId=function(u){for(var a=this.tracksInGroup,l=0;l<a.length;l++){var s=a[l];if((!this.selectDefaultTrack||s.default)&&(!u||u===s.name))return s.id}return-1},T.loadPlaylist=function(u){var a=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(a)){var l=a.id,s=a.groupId,m=a.url;if(u)try{m=u.addDirectives(m)}catch(d){this.warn("Could not construct new URL with HLS Delivery Directives: "+d)}this.log("loading audio-track playlist for id: "+l),this.clearTimer(),this.hls.trigger(H.Events.AUDIO_TRACK_LOADING,{url:m,id:l,groupId:s,deliveryDirectives:u||null})}},P(w,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(u){this.selectDefaultTrack=!1,this.setAudioTrack(u)}}]),w}(k.default);V.default=E},"./src/controller/base-playlist-controller.ts":function(de,V,O){"use strict";O.r(V),O.d(V,"default",function(){return P});var H=O("./src/polyfills/number.ts"),A=O("./src/types/level.ts"),k=O("./src/controller/level-helper.ts"),W=O("./src/utils/logger.ts"),U=O("./src/errors.ts"),P=function(){function L(E,I){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=W.logger.log.bind(W.logger,I+":"),this.warn=W.logger.warn.bind(W.logger,I+":"),this.hls=E}var b=L.prototype;return b.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},b.onError=function(I,w){w.fatal&&w.type===U.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},b.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},b.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},b.stopLoad=function(){this.canLoad=!1,this.clearTimer()},b.switchParams=function(I,w){var T=w==null?void 0:w.renditionReports;if(T)for(var y=0;y<T.length;y++){var u=T[y],a=""+u.URI;if(a===I.substr(-a.length)){var l=parseInt(u["LAST-MSN"]),s=parseInt(u["LAST-PART"]);if(w&&this.hls.config.lowLatencyMode){var m=Math.min(w.age-w.partTarget,w.targetduration);s!==void 0&&m>w.partTarget&&(s+=1)}if(Object(H.isFiniteNumber)(l))return new A.HlsUrlParameters(l,Object(H.isFiniteNumber)(s)?s:void 0,A.HlsSkip.No)}}},b.loadPlaylist=function(I){},b.shouldLoadTrack=function(I){return this.canLoad&&I&&!!I.url&&(!I.details||I.details.live)},b.playlistLoaded=function(I,w,T){var y=this,u=w.details,a=w.stats,l=a.loading.end?Math.max(0,self.performance.now()-a.loading.end):0;if(u.advancedDateTime=Date.now()-l,u.live||T!=null&&T.live){if(u.reloaded(T),T&&this.log("live playlist "+I+" "+(u.advanced?"REFRESHED "+u.lastPartSn+"-"+u.lastPartIndex:"MISSED")),T&&u.fragments.length>0&&Object(k.mergeDetails)(T,u),!this.canLoad||!u.live)return;var s,m=void 0,d=void 0;if(u.canBlockReload&&u.endSN&&u.advanced){var f=this.hls.config.lowLatencyMode,D=u.lastPartSn,v=u.endSN,h=u.lastPartIndex,p=h!==-1,c=D===v,o=f?0:h;p?(m=c?v+1:D,d=c?o:h+1):m=v+1;var x=u.age,g=x+u.ageHeader,C=Math.min(g-u.partTarget,u.targetduration*1.5);if(C>0){if(T&&C>T.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+T.tuneInGoal+" to: "+C+" with playlist age: "+u.age),C=0;else{var _=Math.floor(C/u.targetduration);if(m+=_,d!==void 0){var z=Math.round(C%u.targetduration/u.partTarget);d+=z}this.log("CDN Tune-in age: "+u.ageHeader+"s last advanced "+x.toFixed(2)+"s goal: "+C+" skip sn "+_+" to part "+d)}u.tuneInGoal=C}if(s=this.getDeliveryDirectives(u,w.deliveryDirectives,m,d),f||!c){this.loadPlaylist(s);return}}else s=this.getDeliveryDirectives(u,w.deliveryDirectives,m,d);var Y=Object(k.computeReloadInterval)(u,a);m!==void 0&&u.canBlockReload&&(Y-=u.partTarget||1),this.log("reload live playlist "+I+" in "+Math.round(Y)+" ms"),this.timer=self.setTimeout(function(){return y.loadPlaylist(s)},Y)}else this.clearTimer()},b.getDeliveryDirectives=function(I,w,T,y){var u=Object(A.getSkipValue)(I,T);return w!=null&&w.skip&&I.deltaUpdateFailed&&(T=w.msn,y=w.part,u=A.HlsSkip.No),new A.HlsUrlParameters(T,y,u)},b.retryLoadingOrFail=function(I){var w=this,T=this.hls.config,y=this.retryCount<T.levelLoadingMaxRetry;if(y){var u;if(this.retryCount++,I.details.indexOf("LoadTimeOut")>-1&&(u=I.context)!==null&&u!==void 0&&u.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+I.details+'"'),this.loadPlaylist();else{var a=Math.min(Math.pow(2,this.retryCount)*T.levelLoadingRetryDelay,T.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return w.loadPlaylist()},a),this.warn("retry playlist loading #"+this.retryCount+" in "+a+' ms after "'+I.details+'"')}}else this.warn('cannot recover from error "'+I.details+'"'),this.clearTimer(),I.fatal=!0;return y},L}()},"./src/controller/base-stream-controller.ts":function(de,V,O){"use strict";O.r(V),O.d(V,"State",function(){return v}),O.d(V,"default",function(){return h});var H=O("./src/polyfills/number.ts"),A=O("./src/task-loop.ts"),k=O("./src/controller/fragment-tracker.ts"),W=O("./src/utils/buffer-helper.ts"),U=O("./src/utils/logger.ts"),P=O("./src/events.ts"),L=O("./src/errors.ts"),b=O("./src/types/transmuxer.ts"),E=O("./src/utils/mp4-tools.ts"),I=O("./src/utils/discontinuities.ts"),w=O("./src/controller/fragment-finders.ts"),T=O("./src/controller/level-helper.ts"),y=O("./src/loader/fragment-loader.ts"),u=O("./src/crypt/decrypter.ts"),a=O("./src/utils/time-ranges.ts"),l=O("./src/types/loader.ts");function s(p,c){for(var o=0;o<c.length;o++){var x=c[o];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(p,x.key,x)}}function m(p,c,o){return c&&s(p.prototype,c),o&&s(p,o),p}function d(p){if(p===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p}function f(p,c){p.prototype=Object.create(c.prototype),p.prototype.constructor=p,D(p,c)}function D(p,c){return D=Object.setPrototypeOf||function(x,g){return x.__proto__=g,x},D(p,c)}var v={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"},h=function(p){f(c,p);function c(x,g,C){var _;return _=p.call(this)||this,_.hls=void 0,_.fragPrevious=null,_.fragCurrent=null,_.fragmentTracker=void 0,_.transmuxer=null,_._state=v.STOPPED,_.media=void 0,_.mediaBuffer=void 0,_.config=void 0,_.bitrateTest=!1,_.lastCurrentTime=0,_.nextLoadPosition=0,_.startPosition=0,_.loadedmetadata=!1,_.fragLoadError=0,_.retryDate=0,_.levels=null,_.fragmentLoader=void 0,_.levelLastLoaded=null,_.startFragRequested=!1,_.decrypter=void 0,_.initPTS=[],_.onvseeking=null,_.onvended=null,_.logPrefix="",_.log=void 0,_.warn=void 0,_.logPrefix=C,_.log=U.logger.log.bind(U.logger,C+":"),_.warn=U.logger.warn.bind(U.logger,C+":"),_.hls=x,_.fragmentLoader=new y.default(x.config),_.fragmentTracker=g,_.config=x.config,_.decrypter=new u.default(x,x.config),x.on(P.Events.KEY_LOADED,_.onKeyLoaded,d(_)),_}var o=c.prototype;return o.doTick=function(){this.onTickEnd()},o.onTickEnd=function(){},o.startLoad=function(g){},o.stopLoad=function(){this.fragmentLoader.abort();var g=this.fragCurrent;g&&this.fragmentTracker.removeFragment(g),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=v.STOPPED},o._streamEnded=function(g,C){var _=this.fragCurrent,z=this.fragmentTracker;if(!C.live&&_&&_.sn===C.endSN&&!g.nextStart){var Y=z.getState(_);return Y===k.FragmentState.PARTIAL||Y===k.FragmentState.OK}return!1},o.onMediaAttached=function(g,C){var _=this.media=this.mediaBuffer=C.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),_.addEventListener("seeking",this.onvseeking),_.addEventListener("ended",this.onvended);var z=this.config;this.levels&&z.autoStartLoad&&this.state===v.STOPPED&&this.startLoad(z.startPosition)},o.onMediaDetaching=function(){var g=this.media;g!=null&&g.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),g&&(g.removeEventListener("seeking",this.onvseeking),g.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 g=this.config,C=this.fragCurrent,_=this.media,z=this.mediaBuffer,Y=this.state,oe=_?_.currentTime:0,G=W.BufferHelper.bufferInfo(z||_,oe,g.maxBufferHole);if(this.log("media seeking to "+(Object(H.isFiniteNumber)(oe)?oe.toFixed(3):oe)+", state: "+Y),Y===v.ENDED)this.resetLoadingState();else if(C&&!G.len){var j=g.maxFragLookUpTolerance,se=C.start-j,fe=C.start+C.duration+j,Se=oe>fe;(oe<se||Se)&&(Se&&C.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),C.loader.abort()),this.resetLoadingState())}_&&(this.lastCurrentTime=oe),!this.loadedmetadata&&!G.len&&(this.nextLoadPosition=this.startPosition=oe),this.tickImmediate()},o.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},o.onKeyLoaded=function(g,C){if(this.state!==v.KEY_LOADING||C.frag!==this.fragCurrent||!this.levels)return;this.state=v.IDLE;var _=this.levels[C.frag.level].details;_&&this.loadFragment(C.frag,_,C.frag.start)},o.onHandlerDestroying=function(){this.stopLoad(),p.prototype.onHandlerDestroying.call(this)},o.onHandlerDestroyed=function(){this.state=v.STOPPED,this.hls.off(P.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,p.prototype.onHandlerDestroyed.call(this)},o.loadKey=function(g,C){this.log("Loading key for "+g.sn+" of ["+C.startSN+"-"+C.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+g.level),this.state=v.KEY_LOADING,this.fragCurrent=g,this.hls.trigger(P.Events.KEY_LOADING,{frag:g})},o.loadFragment=function(g,C,_){this._loadFragForPlayback(g,C,_)},o._loadFragForPlayback=function(g,C,_){var z=this,Y=function(G){if(z.fragContextChanged(g)){z.warn("Fragment "+g.sn+(G.part?" p: "+G.part.index:"")+" of level "+g.level+" was dropped during download."),z.fragmentTracker.removeFragment(g);return}g.stats.chunkCount++,z._handleFragmentLoadProgress(G)};this._doFragLoad(g,C,_,Y).then(function(oe){if(!oe)return;z.fragLoadError=0;var G=z.state;if(z.fragContextChanged(g)){(G===v.FRAG_LOADING||G===v.BACKTRACKING||!z.fragCurrent&&G===v.PARSING)&&(z.fragmentTracker.removeFragment(g),z.state=v.IDLE);return}if("payload"in oe&&(z.log("Loaded fragment "+g.sn+" of level "+g.level),z.hls.trigger(P.Events.FRAG_LOADED,oe),z.state===v.BACKTRACKING)){z.fragmentTracker.backtrack(g,oe),z.resetFragmentLoading(g);return}z._handleFragmentLoadComplete(oe)}).catch(function(oe){z.warn(oe),z.resetFragmentLoading(g)})},o.flushMainBuffer=function(g,C,_){if(_===void 0&&(_=null),!(g-C))return;var z={startOffset:g,endOffset:C,type:_};this.fragLoadError=0,this.hls.trigger(P.Events.BUFFER_FLUSHING,z)},o._loadInitSegment=function(g){var C=this;this._doFragLoad(g).then(function(_){if(!_||C.fragContextChanged(g)||!C.levels)throw new Error("init load aborted");return _}).then(function(_){var z=C.hls,Y=_.payload,oe=g.decryptdata;if(Y&&Y.byteLength>0&&oe&&oe.key&&oe.iv&&oe.method==="AES-128"){var G=self.performance.now();return C.decrypter.webCryptoDecrypt(new Uint8Array(Y),oe.key.buffer,oe.iv.buffer).then(function(j){var se=self.performance.now();return z.trigger(P.Events.FRAG_DECRYPTED,{frag:g,payload:j,stats:{tstart:G,tdecrypt:se}}),_.payload=j,_})}return _}).then(function(_){var z=C.fragCurrent,Y=C.hls,oe=C.levels;if(!oe)throw new Error("init load aborted, missing levels");var G=oe[g.level].details;console.assert(G,"Level details are defined when init segment is loaded");var j=g.stats;C.state=v.IDLE,C.fragLoadError=0,g.data=new Uint8Array(_.payload),j.parsing.start=j.buffering.start=self.performance.now(),j.parsing.end=j.buffering.end=self.performance.now(),_.frag===z&&Y.trigger(P.Events.FRAG_BUFFERED,{stats:j,frag:z,part:null,id:g.type}),C.tick()}).catch(function(_){C.warn(_),C.resetFragmentLoading(g)})},o.fragContextChanged=function(g){var C=this.fragCurrent;return!g||!C||g.level!==C.level||g.sn!==C.sn||g.urlId!==C.urlId},o.fragBufferedComplete=function(g,C){var _=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+g.type+" sn: "+g.sn+(C?" part: "+C.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+g.level+" "+a.default.toString(W.BufferHelper.getBuffered(_))),this.state=v.IDLE,this.tick()},o._handleFragmentLoadComplete=function(g){var C=this.transmuxer;if(!C)return;var _=g.frag,z=g.part,Y=g.partsLoaded,oe=!Y||Y.length===0||Y.some(function(j){return!j}),G=new b.ChunkMetadata(_.level,_.sn,_.stats.chunkCount+1,0,z?z.index:-1,!oe);C.flush(G)},o._handleFragmentLoadProgress=function(g){},o._doFragLoad=function(g,C,_,z){var Y=this;if(_===void 0&&(_=null),!this.levels)throw new Error("frag load aborted, missing levels");if(_=Math.max(g.start,_||0),this.config.lowLatencyMode&&C){var oe=C.partList;if(oe&&z){_>g.end&&C.fragmentHint&&(g=C.fragmentHint);var G=this.getNextPart(oe,g,_);if(G>-1){var j=oe[G];return this.log("Loading part sn: "+g.sn+" p: "+j.index+" cc: "+g.cc+" of playlist ["+C.startSN+"-"+C.endSN+"] parts [0-"+G+"-"+(oe.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+g.level+", target: "+parseFloat(_.toFixed(3))),this.nextLoadPosition=j.start+j.duration,this.state=v.FRAG_LOADING,this.hls.trigger(P.Events.FRAG_LOADING,{frag:g,part:oe[G],targetBufferTime:_}),this.doFragPartsLoad(g,oe,G,z).catch(function(se){return Y.handleFragLoadError(se)})}else if(!g.url||this.loadedEndOfParts(oe,_))return Promise.resolve(null)}}return this.log("Loading fragment "+g.sn+" cc: "+g.cc+" "+(C?"of ["+C.startSN+"-"+C.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+g.level+", target: "+parseFloat(_.toFixed(3))),Object(H.isFiniteNumber)(g.sn)&&!this.bitrateTest&&(this.nextLoadPosition=g.start+g.duration),this.state=v.FRAG_LOADING,this.hls.trigger(P.Events.FRAG_LOADING,{frag:g,targetBufferTime:_}),this.fragmentLoader.load(g,z).catch(function(se){return Y.handleFragLoadError(se)})},o.doFragPartsLoad=function(g,C,_,z){var Y=this;return new Promise(function(oe,G){var j=[],se=function fe(Se){var ke=C[Se];Y.fragmentLoader.loadPart(g,ke,z).then(function(Je){j[ke.index]=Je;var _e=Je.part;Y.hls.trigger(P.Events.FRAG_LOADED,Je);var Qe=C[Se+1];if(Qe&&Qe.fragment===g)fe(Se+1);else return oe({frag:g,part:_e,partsLoaded:j})}).catch(G)};se(_)})},o.handleFragLoadError=function(g){var C=g.data;return C&&C.details===L.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(C.frag,C.part):this.hls.trigger(P.Events.ERROR,C),null},o._handleTransmuxerFlush=function(g){var C=this.getCurrentContext(g);if(!C||this.state!==v.PARSING){this.fragCurrent||(this.state=v.IDLE);return}var _=C.frag,z=C.part,Y=C.level,oe=self.performance.now();_.stats.parsing.end=oe,z&&(z.stats.parsing.end=oe),this.updateLevelTiming(_,z,Y,g.partial)},o.getCurrentContext=function(g){var C=this.levels,_=g.level,z=g.sn,Y=g.part;if(!C||!C[_])return this.warn("Levels object was unset while buffering fragment "+z+" of level "+_+". The current chunk will not be buffered."),null;var oe=C[_],G=Y>-1?Object(T.getPartWith)(oe,z,Y):null,j=G?G.fragment:Object(T.getFragmentWithSN)(oe,z,this.fragCurrent);return j?{frag:j,part:G,level:oe}:null},o.bufferFragmentData=function(g,C,_,z){if(!g||this.state!==v.PARSING)return;var Y=g.data1,oe=g.data2,G=Y;if(Y&&oe&&(G=Object(E.appendUint8Array)(Y,oe)),!G||!G.length)return;var j={type:g.type,frag:C,part:_,chunkMeta:z,parent:C.type,data:G};this.hls.trigger(P.Events.BUFFER_APPENDING,j),g.dropped&&g.independent&&!_&&this.flushBufferGap(C)},o.flushBufferGap=function(g){var C=this.media;if(!C)return;if(!W.BufferHelper.isBuffered(C,C.currentTime)){this.flushMainBuffer(0,g.start);return}var _=C.currentTime,z=W.BufferHelper.bufferInfo(C,_,0),Y=g.duration,oe=Math.min(this.config.maxFragLookUpTolerance*2,Y*.25),G=Math.max(Math.min(g.start-oe,z.end-oe),_+oe);g.start-G>oe&&this.flushMainBuffer(G,g.start)},o.getFwdBufferInfo=function(g,C){var _=this.config,z=this.getLoadPosition();if(!Object(H.isFiniteNumber)(z))return null;var Y=W.BufferHelper.bufferInfo(g,z,_.maxBufferHole);if(Y.len===0&&Y.nextStart!==void 0){var oe=this.fragmentTracker.getBufferedFrag(z,C);if(oe&&Y.nextStart<oe.end)return W.BufferHelper.bufferInfo(g,z,Math.max(Y.nextStart,_.maxBufferHole))}return Y},o.getMaxBufferLength=function(g){var C=this.config,_;return g?_=Math.max(8*C.maxBufferSize/g,C.maxBufferLength):_=C.maxBufferLength,Math.min(_,C.maxMaxBufferLength)},o.reduceMaxBufferLength=function(g){var C=this.config,_=g||C.maxBufferLength;return C.maxMaxBufferLength>=_?(C.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+C.maxMaxBufferLength+"s"),!0):!1},o.getNextFragment=function(g,C){var _,z,Y=C.fragments,oe=Y.length;if(!oe)return null;var G=this.config,j=Y[0].start,se;if(C.live){var fe=G.initialLiveManifestSize;if(oe<fe)return this.warn("Not enough fragments to start playback (have: "+oe+", need: "+fe+")"),null;!C.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(se=this.getInitialLiveFragment(C,Y),this.startPosition=se?this.hls.liveSyncPosition||se.start:g)}else g<=j&&(se=Y[0]);if(!se){var Se=G.lowLatencyMode?C.partEnd:C.fragmentEnd;se=this.getFragmentAtPosition(g,Se,C)}return(_=se)!==null&&_!==void 0&&_.initSegment&&!((z=se)!==null&&z!==void 0&&z.initSegment.data)&&!this.bitrateTest&&(se=se.initSegment),se},o.getNextPart=function(g,C,_){for(var z=-1,Y=!1,oe=!0,G=0,j=g.length;G<j;G++){var se=g[G];if(oe=oe&&!se.independent,z>-1&&_<se.start)break;var fe=se.loaded;!fe&&(Y||se.independent||oe)&&se.fragment===C&&(z=G),Y=fe}return z},o.loadedEndOfParts=function(g,C){var _=g[g.length-1];return _&&C>_.start&&_.loaded},o.getInitialLiveFragment=function(g,C){var _=this.fragPrevious,z=null;if(_){if(g.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+_.programDateTime),z=Object(w.findFragmentByPDT)(C,_.endProgramDateTime,this.config.maxFragLookUpTolerance)),!z){var Y=_.sn+1;if(Y>=g.startSN&&Y<=g.endSN){var oe=C[Y-g.startSN];_.cc===oe.cc&&(z=oe,this.log("Live playlist, switching playlist, load frag with next SN: "+z.sn))}z||(z=Object(w.findFragWithCC)(C,_.cc),z&&this.log("Live playlist, switching playlist, load frag with same CC: "+z.sn))}}else{var G=this.hls.liveSyncPosition;G!==null&&(z=this.getFragmentAtPosition(G,this.bitrateTest?g.fragmentEnd:g.edge,g))}return z},o.getFragmentAtPosition=function(g,C,_){var z=this.config,Y=this.fragPrevious,oe=_.fragments,G=_.endSN,j=_.fragmentHint,se=z.maxFragLookUpTolerance,fe=!!(z.lowLatencyMode&&_.partList&&j);fe&&j&&!this.bitrateTest&&(oe=oe.concat(j),G=j.sn);var Se;if(g<C){var ke=g>C-se?0:se;Se=Object(w.findFragmentByPTS)(Y,oe,g,ke)}else Se=oe[oe.length-1];if(Se){var Je=Se.sn-_.startSN,_e=Y&&Se.level===Y.level,Qe=oe[Je+1],Ue=this.fragmentTracker.getState(Se);if(Ue===k.FragmentState.BACKTRACKED){Se=null;for(var Fe=Je;oe[Fe]&&this.fragmentTracker.getState(oe[Fe])===k.FragmentState.BACKTRACKED;)Y?Se=oe[Fe--]:Se=oe[--Fe];Se||(Se=Qe)}else Y&&Se.sn===Y.sn&&!fe&&(_e&&(Se.sn<G&&this.fragmentTracker.getState(Qe)!==k.FragmentState.OK?(this.log("SN "+Se.sn+" just loaded, load next one: "+Qe.sn),Se=Qe):Se=null))}return Se},o.synchronizeToLiveEdge=function(g){var C=this.config,_=this.media;if(!_)return;var z=this.hls.liveSyncPosition,Y=_.currentTime,oe=g.fragments[0].start,G=g.edge,j=Y>=oe-C.maxFragLookUpTolerance&&Y<=G;if(z!==null&&_.duration>z&&(Y<z||!j)){var se=C.liveMaxLatencyDuration!==void 0?C.liveMaxLatencyDuration:C.liveMaxLatencyDurationCount*g.targetduration;(!j&&_.readyState<4||Y<G-se)&&(this.loadedmetadata||(this.nextLoadPosition=z),_.readyState&&(this.warn("Playback: "+Y.toFixed(3)+" is located too far from the end of live sliding playlist: "+G+", reset currentTime to : "+z.toFixed(3)),_.currentTime=z))}},o.alignPlaylists=function(g,C){var _=this.levels,z=this.levelLastLoaded,Y=this.fragPrevious,oe=z!==null?_[z]:null,G=g.fragments.length;if(!G)return this.warn("No fragments in live playlist"),0;var j=g.fragments[0].start,se=!C,fe=g.alignedSliding&&Object(H.isFiniteNumber)(j);if(se||!fe&&!j){Object(I.alignStream)(Y,oe,g);var Se=g.fragments[0].start;return this.log("Live playlist sliding: "+Se.toFixed(2)+" start-sn: "+(C?C.startSN:"na")+"->"+g.startSN+" prev-sn: "+(Y?Y.sn:"na")+" fragments: "+G),Se}return j},o.waitForCdnTuneIn=function(g){var C=3;return g.live&&g.canBlockReload&&g.tuneInGoal>Math.max(g.partHoldBack,g.partTarget*C)},o.setStartPosition=function(g,C){var _=this.startPosition;if(_<C&&(_=-1),_===-1||this.lastCurrentTime===-1){var z=g.startTimeOffset;Object(H.isFiniteNumber)(z)?(_=C+z,z<0&&(_+=g.totalduration),_=Math.min(Math.max(C,_),C+g.totalduration),this.log("Start time offset "+z+" found in playlist, adjust startPosition to "+_),this.startPosition=_):g.live?_=this.hls.liveSyncPosition||C:this.startPosition=_=0,this.lastCurrentTime=_}this.nextLoadPosition=_},o.getLoadPosition=function(){var g=this.media,C=0;return this.loadedmetadata&&g?C=g.currentTime:this.nextLoadPosition&&(C=this.nextLoadPosition),C},o.handleFragLoadAborted=function(g,C){this.transmuxer&&g.sn!=="initSegment"&&g.stats.aborted&&(this.warn("Fragment "+g.sn+(C?" part"+C.index:"")+" of level "+g.level+" was aborted"),this.resetFragmentLoading(g))},o.resetFragmentLoading=function(g){(!this.fragCurrent||!this.fragContextChanged(g))&&(this.state=v.IDLE)},o.onFragmentOrKeyLoadError=function(g,C){if(C.fatal)return;var _=C.frag;if(!_||_.type!==g)return;var z=this.fragCurrent;console.assert(z&&_.sn===z.sn&&_.level===z.level&&_.urlId===z.urlId,"Frag load error must match current frag to retry");var Y=this.config;if(this.fragLoadError+1<=Y.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(_.level))return;var oe=Math.min(Math.pow(2,this.fragLoadError)*Y.fragLoadingRetryDelay,Y.fragLoadingMaxRetryTimeout);this.warn("Fragment "+_.sn+" of "+g+" "+_.level+" failed to load, retrying in "+oe+"ms"),this.retryDate=self.performance.now()+oe,this.fragLoadError++,this.state=v.FRAG_LOADING_WAITING_RETRY}else C.levelRetry?(g===l.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=v.IDLE):(U.logger.error(C.details+" reaches max retry, redispatch as fatal ..."),C.fatal=!0,this.hls.stopLoad(),this.state=v.ERROR)},o.afterBufferFlushed=function(g,C,_){if(!g)return;var z=W.BufferHelper.getBuffered(g);this.fragmentTracker.detectEvictedFragments(C,z,_),this.state===v.ENDED&&this.resetLoadingState()},o.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=v.IDLE},o.resetLiveStartWhenNotLoaded=function(g){if(!this.loadedmetadata){this.startFragRequested=!1;var C=this.levels?this.levels[g].details:null;if(C!=null&&C.live)return this.startPosition=-1,this.setStartPosition(C,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},o.updateLevelTiming=function(g,C,_,z){var Y=this,oe=_.details;console.assert(!!oe,"level.details must be defined");var G=Object.keys(g.elementaryStreams).reduce(function(j,se){var fe=g.elementaryStreams[se];if(fe){var Se=fe.endPTS-fe.startPTS;if(Se<=0)return Y.warn("Could not parse fragment "+g.sn+" "+se+" duration reliably ("+Se+") resetting transmuxer to fallback to playlist timing"),Y.resetTransmuxer(),j||!1;var ke=z?0:Object(T.updateFragPTSDTS)(oe,g,fe.startPTS,fe.endPTS,fe.startDTS,fe.endDTS);return Y.hls.trigger(P.Events.LEVEL_PTS_UPDATED,{details:oe,level:_,drift:ke,type:se,frag:g,start:fe.startPTS,end:fe.endPTS}),!0}return j},!1);G?(this.state=v.PARSED,this.hls.trigger(P.Events.FRAG_PARSED,{frag:g,part:C})):this.resetLoadingState()},o.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},m(c,[{key:"state",get:function(){return this._state},set:function(g){var C=this._state;C!==g&&(this._state=g,this.log(C+"->"+g))}}]),c}(A.default)},"./src/controller/buffer-controller.ts":function(de,V,O){"use strict";O.r(V),O.d(V,"default",function(){return w});var H=O("./src/polyfills/number.ts"),A=O("./src/events.ts"),k=O("./src/utils/logger.ts"),W=O("./src/errors.ts"),U=O("./src/utils/buffer-helper.ts"),P=O("./src/utils/mediasource-helper.ts"),L=O("./src/loader/fragment.ts"),b=O("./src/controller/buffer-operation-queue.ts"),E=Object(P.getMediaSource)(),I=/([ha]vc.)(?:\.[^.,]+)+/,w=function(){function T(u){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,s=a.media,m=a.mediaSource;k.logger.log("[buffer-controller]: Media source opened"),s&&(a.updateMediaElementDuration(),l.trigger(A.Events.MEDIA_ATTACHED,{media:s})),m&&m.removeEventListener("sourceopen",a._onMediaSourceOpen),a.checkPendingTracks()},this._onMediaSourceClose=function(){k.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){k.logger.log("[buffer-controller]: Media source ended")},this.hls=u,this._initSourceBuffer(),this.registerListeners()}var y=T.prototype;return y.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},y.destroy=function(){this.unregisterListeners(),this.details=null},y.registerListeners=function(){var a=this.hls;a.on(A.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),a.on(A.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.on(A.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.on(A.Events.BUFFER_RESET,this.onBufferReset,this),a.on(A.Events.BUFFER_APPENDING,this.onBufferAppending,this),a.on(A.Events.BUFFER_CODECS,this.onBufferCodecs,this),a.on(A.Events.BUFFER_EOS,this.onBufferEos,this),a.on(A.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),a.on(A.Events.LEVEL_UPDATED,this.onLevelUpdated,this),a.on(A.Events.FRAG_PARSED,this.onFragParsed,this),a.on(A.Events.FRAG_CHANGED,this.onFragChanged,this)},y.unregisterListeners=function(){var a=this.hls;a.off(A.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),a.off(A.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.off(A.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.off(A.Events.BUFFER_RESET,this.onBufferReset,this),a.off(A.Events.BUFFER_APPENDING,this.onBufferAppending,this),a.off(A.Events.BUFFER_CODECS,this.onBufferCodecs,this),a.off(A.Events.BUFFER_EOS,this.onBufferEos,this),a.off(A.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),a.off(A.Events.LEVEL_UPDATED,this.onLevelUpdated,this),a.off(A.Events.FRAG_PARSED,this.onFragParsed,this),a.off(A.Events.FRAG_CHANGED,this.onFragChanged,this)},y._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new b.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},y.onManifestParsed=function(a,l){var s=2;(l.audio&&!l.video||!l.altAudio)&&(s=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=s,this.details=null,k.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},y.onMediaAttaching=function(a,l){var s=this.media=l.media;if(s&&E){var m=this.mediaSource=new E;m.addEventListener("sourceopen",this._onMediaSourceOpen),m.addEventListener("sourceended",this._onMediaSourceEnded),m.addEventListener("sourceclose",this._onMediaSourceClose),s.src=self.URL.createObjectURL(m),this._objectUrl=s.src}},y.onMediaDetaching=function(){var a=this.media,l=this.mediaSource,s=this._objectUrl;if(l){if(k.logger.log("[buffer-controller]: media source detaching"),l.readyState==="open")try{l.endOfStream()}catch(m){k.logger.warn("[buffer-controller]: onMediaDetaching: "+m.message+" while calling endOfStream")}this.onBufferReset(),l.removeEventListener("sourceopen",this._onMediaSourceOpen),l.removeEventListener("sourceended",this._onMediaSourceEnded),l.removeEventListener("sourceclose",this._onMediaSourceClose),a&&(s&&self.URL.revokeObjectURL(s),a.src===s?(a.removeAttribute("src"),a.load()):k.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(A.Events.MEDIA_DETACHED,void 0)},y.onBufferReset=function(){var a=this;this.getSourceBufferTypes().forEach(function(l){var s=a.sourceBuffer[l];try{s&&(a.removeBufferListeners(l),a.mediaSource&&a.mediaSource.removeSourceBuffer(s),a.sourceBuffer[l]=void 0)}catch(m){k.logger.warn("[buffer-controller]: Failed to reset the "+l+" buffer",m)}}),this._initSourceBuffer()},y.onBufferCodecs=function(a,l){var s=this,m=this.getSourceBufferTypes().length;if(Object.keys(l).forEach(function(d){if(m){var f=s.tracks[d];if(f&&typeof f.buffer.changeType=="function"){var D=l[d],v=D.codec,h=D.levelCodec,p=D.container,c=(f.levelCodec||f.codec).replace(I,"$1"),o=(h||v).replace(I,"$1");if(c!==o){var x=p+";codecs="+(h||v);s.appendChangeType(d,x)}}}else s.pendingTracks[d]=l[d]}),m)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},y.appendChangeType=function(a,l){var s=this,m=this.operationQueue,d={execute:function(){var D=s.sourceBuffer[a];D&&(k.logger.log("[buffer-controller]: changing "+a+" sourceBuffer type to "+l),D.changeType(l)),m.shiftAndExecuteNext(a)},onStart:function(){},onComplete:function(){},onError:function(D){k.logger.warn("[buffer-controller]: Failed to change "+a+" SourceBuffer type",D)}};m.append(d,a)},y.onBufferAppending=function(a,l){var s=this,m=this.hls,d=this.operationQueue,f=this.tracks,D=l.data,v=l.type,h=l.frag,p=l.part,c=l.chunkMeta,o=c.buffering[v],x=self.performance.now();o.start=x;var g=h.stats.buffering,C=p?p.stats.buffering:null;g.start===0&&(g.start=x),C&&C.start===0&&(C.start=x);var _=f.audio,z=v==="audio"&&c.id===1&&(_==null?void 0:_.container)==="audio/mpeg",Y={execute:function(){if(o.executeStart=self.performance.now(),z){var G=s.sourceBuffer[v];if(G){var j=h.start-G.timestampOffset;Math.abs(j)>=.1&&(k.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+h.start+" (delta: "+j+") sn: "+h.sn+")"),G.timestampOffset=h.start)}}s.appendExecutor(D,v)},onStart:function(){},onComplete:function(){var G=self.performance.now();o.executeEnd=o.end=G,g.first===0&&(g.first=G),C&&C.first===0&&(C.first=G);var j=s.sourceBuffer,se={};for(var fe in j)se[fe]=U.BufferHelper.getBuffered(j[fe]);s.appendError=0,s.hls.trigger(A.Events.BUFFER_APPENDED,{type:v,frag:h,part:p,chunkMeta:c,parent:h.type,timeRanges:se})},onError:function(G){k.logger.error("[buffer-controller]: Error encountered while trying to append to the "+v+" SourceBuffer",G);var j={type:W.ErrorTypes.MEDIA_ERROR,parent:h.type,details:W.ErrorDetails.BUFFER_APPEND_ERROR,err:G,fatal:!1};G.code===DOMException.QUOTA_EXCEEDED_ERR?j.details=W.ErrorDetails.BUFFER_FULL_ERROR:(s.appendError++,j.details=W.ErrorDetails.BUFFER_APPEND_ERROR,s.appendError>m.config.appendErrorMaxRetry&&(k.logger.error("[buffer-controller]: Failed "+m.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),j.fatal=!0)),m.trigger(A.Events.ERROR,j)}};d.append(Y,v)},y.onBufferFlushing=function(a,l){var s=this,m=this.operationQueue,d=function(D){return{execute:s.removeExecutor.bind(s,D,l.startOffset,l.endOffset),onStart:function(){},onComplete:function(){s.hls.trigger(A.Events.BUFFER_FLUSHED,{type:D})},onError:function(h){k.logger.warn("[buffer-controller]: Failed to remove from "+D+" SourceBuffer",h)}}};l.type?m.append(d(l.type),l.type):this.getSourceBufferTypes().forEach(function(f){m.append(d(f),f)})},y.onFragParsed=function(a,l){var s=this,m=l.frag,d=l.part,f=[],D=d?d.elementaryStreams:m.elementaryStreams;D[L.ElementaryStreamTypes.AUDIOVIDEO]?f.push("audiovideo"):(D[L.ElementaryStreamTypes.AUDIO]&&f.push("audio"),D[L.ElementaryStreamTypes.VIDEO]&&f.push("video"));var v=function(){var p=self.performance.now();m.stats.buffering.end=p,d&&(d.stats.buffering.end=p);var c=d?d.stats:m.stats;s.hls.trigger(A.Events.FRAG_BUFFERED,{frag:m,part:d,stats:c,id:m.type})};f.length===0&&k.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+m.type+" level: "+m.level+" sn: "+m.sn),this.blockBuffers(v,f)},y.onFragChanged=function(a,l){this.flushBackBuffer()},y.onBufferEos=function(a,l){var s=this,m=this.getSourceBufferTypes().reduce(function(d,f){var D=s.sourceBuffer[f];return(!l.type||l.type===f)&&(D&&!D.ended&&(D.ended=!0,k.logger.log("[buffer-controller]: "+f+" sourceBuffer now EOS"))),d&&!!(!D||D.ended)},!0);m&&this.blockBuffers(function(){var d=s.mediaSource;if(!d||d.readyState!=="open")return;d.endOfStream()})},y.onLevelUpdated=function(a,l){var s=l.details;if(!s.fragments.length)return;this.details=s,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},y.flushBackBuffer=function(){var a=this.hls,l=this.details,s=this.media,m=this.sourceBuffer;if(!s||l===null)return;var d=this.getSourceBufferTypes();if(!d.length)return;var f=l.live&&a.config.liveBackBufferLength!==null?a.config.liveBackBufferLength:a.config.backBufferLength;if(!Object(H.isFiniteNumber)(f)||f<0)return;var D=s.currentTime,v=l.levelTargetDuration,h=Math.max(f,v),p=Math.floor(D/v)*v-h;d.forEach(function(c){var o=m[c];if(o){var x=U.BufferHelper.getBuffered(o);x.length>0&&p>x.start(0)&&(a.trigger(A.Events.BACK_BUFFER_REACHED,{bufferEnd:p}),l.live&&a.trigger(A.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:p}),a.trigger(A.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:p,type:c}))}})},y.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var a=this.details,l=this.hls,s=this.media,m=this.mediaSource,d=a.fragments[0].start+a.totalduration,f=s.duration,D=Object(H.isFiniteNumber)(m.duration)?m.duration:0;a.live&&l.config.liveDurationInfinity?(k.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),m.duration=Infinity,this.updateSeekableRange(a)):(d>D&&d>f||!Object(H.isFiniteNumber)(f))&&(k.logger.log("[buffer-controller]: Updating Media Source duration to "+d.toFixed(3)),m.duration=d)},y.updateSeekableRange=function(a){var l=this.mediaSource,s=a.fragments,m=s.length;if(m&&a.live&&l!==null&&l!==void 0&&l.setLiveSeekableRange){var d=Math.max(0,s[0].start),f=Math.max(d,d+a.totalduration);l.setLiveSeekableRange(d,f)}},y.checkPendingTracks=function(){var a=this.bufferCodecEventsExpected,l=this.operationQueue,s=this.pendingTracks,m=Object.keys(s).length;if(m&&!a||m===2){this.createSourceBuffers(s),this.pendingTracks={};var d=this.getSourceBufferTypes();if(d.length===0){this.hls.trigger(A.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}d.forEach(function(f){l.executeNext(f)})}},y.createSourceBuffers=function(a){var l=this.sourceBuffer,s=this.mediaSource;if(!s)throw Error("createSourceBuffers called when mediaSource was null");var m=0;for(var d in a)if(!l[d]){var f=a[d];if(!f)throw Error("source buffer exists for track "+d+", however track does not");var D=f.levelCodec||f.codec,v=f.container+";codecs="+D;k.logger.log("[buffer-controller]: creating sourceBuffer("+v+")");try{var h=l[d]=s.addSourceBuffer(v),p=d;this.addBufferListener(p,"updatestart",this._onSBUpdateStart),this.addBufferListener(p,"updateend",this._onSBUpdateEnd),this.addBufferListener(p,"error",this._onSBUpdateError),this.tracks[d]={buffer:h,codec:D,container:f.container,levelCodec:f.levelCodec,id:f.id},m++}catch(c){k.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+c.message),this.hls.trigger(A.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:c,mimeType:v})}}m&&this.hls.trigger(A.Events.BUFFER_CREATED,{tracks:this.tracks})},y._onSBUpdateStart=function(a){var l=this.operationQueue,s=l.current(a);s.onStart()},y._onSBUpdateEnd=function(a){var l=this.operationQueue,s=l.current(a);s.onComplete(),l.shiftAndExecuteNext(a)},y._onSBUpdateError=function(a,l){k.logger.error("[buffer-controller]: "+a+" SourceBuffer error",l),this.hls.trigger(A.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var s=this.operationQueue.current(a);s&&s.onError(l)},y.removeExecutor=function(a,l,s){var m=this.media,d=this.mediaSource,f=this.operationQueue,D=this.sourceBuffer,v=D[a];if(!m||!d||!v){k.logger.warn("[buffer-controller]: Attempting to remove from the "+a+" SourceBuffer, but it does not exist"),f.shiftAndExecuteNext(a);return}var h=Object(H.isFiniteNumber)(m.duration)?m.duration:Infinity,p=Object(H.isFiniteNumber)(d.duration)?d.duration:Infinity,c=Math.max(0,l),o=Math.min(s,h,p);o>c?(k.logger.log("[buffer-controller]: Removing ["+c+","+o+"] from the "+a+" SourceBuffer"),console.assert(!v.updating,a+" sourceBuffer must not be updating"),v.remove(c,o)):f.shiftAndExecuteNext(a)},y.appendExecutor=function(a,l){var s=this.operationQueue,m=this.sourceBuffer,d=m[l];if(!d){k.logger.warn("[buffer-controller]: Attempting to append to the "+l+" SourceBuffer, but it does not exist"),s.shiftAndExecuteNext(l);return}d.ended=!1,console.assert(!d.updating,l+" sourceBuffer must not be updating"),d.appendBuffer(a)},y.blockBuffers=function(a,l){var s=this;if(l===void 0&&(l=this.getSourceBufferTypes()),!l.length){k.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(a);return}var m=this.operationQueue,d=l.map(function(f){return m.appendBlocker(f)});Promise.all(d).then(function(){a(),l.forEach(function(f){var D=s.sourceBuffer[f];(!D||!D.updating)&&m.shiftAndExecuteNext(f)})})},y.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},y.addBufferListener=function(a,l,s){var m=this.sourceBuffer[a];if(!m)return;var d=s.bind(this,a);this.listeners[a].push({event:l,listener:d}),m.addEventListener(l,d)},y.removeBufferListeners=function(a){var l=this.sourceBuffer[a];if(!l)return;this.listeners[a].forEach(function(s){l.removeEventListener(s.event,s.listener)})},T}()},"./src/controller/buffer-operation-queue.ts":function(de,V,O){"use strict";O.r(V),O.d(V,"default",function(){return A});var H=O("./src/utils/logger.ts"),A=function(){function k(U){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=U}var W=k.prototype;return W.append=function(P,L){var b=this.queues[L];b.push(P),b.length===1&&this.buffers[L]&&this.executeNext(L)},W.insertAbort=function(P,L){var b=this.queues[L];b.unshift(P),this.executeNext(L)},W.appendBlocker=function(P){var L,b=new Promise(function(I){L=I}),E={execute:L,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(E,P),b},W.executeNext=function(P){var L=this.buffers,b=this.queues,E=L[P],I=b[P];if(I.length){var w=I[0];try{w.execute()}catch(T){H.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),w.onError(T),(!E||!E.updating)&&(I.shift(),this.executeNext(P))}}},W.shiftAndExecuteNext=function(P){this.queues[P].shift(),this.executeNext(P)},W.current=function(P){return this.queues[P][0]},k}()},"./src/controller/cap-level-controller.ts":function(de,V,O){"use strict";O.r(V);var H=O("./src/events.ts");function A(U,P){for(var L=0;L<P.length;L++){var b=P[L];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(U,b.key,b)}}function k(U,P,L){return P&&A(U.prototype,P),L&&A(U,L),U}var W=function(){function U(L){this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.hls=void 0,this.streamController=void 0,this.clientRect=void 0,this.hls=L,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var P=U.prototype;return P.setStreamController=function(b){this.streamController=b},P.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},P.registerListeners=function(){var b=this.hls;b.on(H.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),b.on(H.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),b.on(H.Events.MANIFEST_PARSED,this.onManifestParsed,this),b.on(H.Events.BUFFER_CODECS,this.onBufferCodecs,this),b.on(H.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},P.unregisterListener=function(){var b=this.hls;b.off(H.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),b.off(H.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),b.off(H.Events.MANIFEST_PARSED,this.onManifestParsed,this),b.off(H.Events.BUFFER_CODECS,this.onBufferCodecs,this),b.off(H.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},P.onFpsDropLevelCapping=function(b,E){U.isLevelAllowed(E.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(E.droppedLevel)},P.onMediaAttaching=function(b,E){this.media=E.media instanceof HTMLVideoElement?E.media:null},P.onManifestParsed=function(b,E){var I=this.hls;this.restrictedLevels=[],this.firstLevel=E.firstLevel,I.config.capLevelToPlayerSize&&E.video&&this.startCapping()},P.onBufferCodecs=function(b,E){var I=this.hls;I.config.capLevelToPlayerSize&&E.video&&this.startCapping()},P.onMediaDetaching=function(){this.stopCapping()},P.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var b=this.hls.levels;if(b.length){var E=this.hls;E.autoLevelCapping=this.getMaxLevel(b.length-1),E.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=E.autoLevelCapping}}},P.getMaxLevel=function(b){var E=this,I=this.hls.levels;if(!I.length)return-1;var w=I.filter(function(T,y){return U.isLevelAllowed(y,E.restrictedLevels)&&y<=b});return this.clientRect=null,U.getMaxLevelByMediaSize(w,this.mediaWidth,this.mediaHeight)},P.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()},P.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},P.getDimensions=function(){if(this.clientRect)return this.clientRect;var b=this.media,E={width:0,height:0};if(b){var I=b.getBoundingClientRect();E.width=I.width,E.height=I.height,!E.width&&!E.height&&(E.width=I.right-I.left||b.width||0,E.height=I.bottom-I.top||b.height||0)}return this.clientRect=E,E},U.isLevelAllowed=function(b,E){return E===void 0&&(E=[]),E.indexOf(b)===-1},U.getMaxLevelByMediaSize=function(b,E,I){if(!b||!b.length)return-1;for(var w=function(l,s){return s?l.width!==s.width||l.height!==s.height:!0},T=b.length-1,y=0;y<b.length;y+=1){var u=b[y];if((u.width>=E||u.height>=I)&&w(u,b[y+1])){T=y;break}}return T},k(U,[{key:"mediaWidth",get:function(){return this.getDimensions().width*U.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*U.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var b=1;try{b=self.devicePixelRatio}catch(E){}return b}}]),U}();V.default=W},"./src/controller/cmcd-controller.ts":function(de,V,O){"use strict";O.r(V),O.d(V,"default",function(){return w});var H=O("./src/events.ts"),A=O("./src/types/cmcd.ts"),k=O("./src/utils/buffer-helper.ts"),W=O("./src/utils/logger.ts");function U(T,y){for(var u=0;u<y.length;u++){var a=y[u];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(T,a.key,a)}}function P(T,y,u){return y&&U(T.prototype,y),u&&U(T,u),T}function L(T,y){var u=typeof Symbol!="undefined"&&T[Symbol.iterator]||T["@@iterator"];if(u)return(u=u.call(T)).next.bind(u);if(Array.isArray(T)||(u=b(T))||y&&T&&typeof T.length=="number"){u&&(T=u);var a=0;return function(){return a>=T.length?{done:!0}:{done:!1,value:T[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 b(T,y){if(!T)return;if(typeof T=="string")return E(T,y);var u=Object.prototype.toString.call(T).slice(8,-1);if(u==="Object"&&T.constructor&&(u=T.constructor.name),u==="Map"||u==="Set")return Array.from(T);if(u==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(u))return E(T,y)}function E(T,y){(y==null||y>T.length)&&(y=T.length);for(var u=0,a=new Array(y);u<y;u++)a[u]=T[u];return a}function I(){return I=Object.assign||function(T){for(var y=1;y<arguments.length;y++){var u=arguments[y];for(var a in u)Object.prototype.hasOwnProperty.call(u,a)&&(T[a]=u[a])}return T},I.apply(this,arguments)}var w=function(){function T(u){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(m){try{a.apply(m,{ot:A.CMCDObjectType.MANIFEST,su:!a.initialized})}catch(d){W.logger.warn("Could not generate manifest CMCD data.",d)}},this.applyFragmentData=function(m){try{var d=m.frag,f=a.hls.levels[d.level],D=a.getObjectType(d),v={d:d.duration*1e3,ot:D};(D===A.CMCDObjectType.VIDEO||D===A.CMCDObjectType.AUDIO||D==A.CMCDObjectType.MUXED)&&(v.br=f.bitrate/1e3,v.tb=a.getTopBandwidth(D),v.bl=a.getBufferLength(D)),a.apply(m,v)}catch(h){W.logger.warn("Could not generate segment CMCD data.",h)}},this.hls=u;var l=this.config=u.config,s=l.cmcd;s!=null&&(l.pLoader=this.createPlaylistLoader(),l.fLoader=this.createFragmentLoader(),this.sid=s.sessionId||T.uuid(),this.cid=s.contentId,this.useHeaders=s.useHeaders===!0,this.registerListeners())}var y=T.prototype;return y.registerListeners=function(){var a=this.hls;a.on(H.Events.MEDIA_ATTACHED,this.onMediaAttached,this),a.on(H.Events.MEDIA_DETACHED,this.onMediaDetached,this),a.on(H.Events.BUFFER_CREATED,this.onBufferCreated,this)},y.unregisterListeners=function(){var a=this.hls;a.off(H.Events.MEDIA_ATTACHED,this.onMediaAttached,this),a.off(H.Events.MEDIA_DETACHED,this.onMediaDetached,this),a.off(H.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},y.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},y.onMediaAttached=function(a,l){this.media=l.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},y.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},y.onBufferCreated=function(a,l){var s,m;this.audioBuffer=(s=l.tracks.audio)===null||s===void 0?void 0:s.buffer,this.videoBuffer=(m=l.tracks.video)===null||m===void 0?void 0:m.buffer},y.createData=function(){var a;return{v:A.CMCDVersion,sf:A.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}},y.apply=function(a,l){l===void 0&&(l={}),I(l,this.createData());var s=l.ot===A.CMCDObjectType.INIT||l.ot===A.CMCDObjectType.VIDEO||l.ot===A.CMCDObjectType.MUXED;if(this.starved&&s&&(l.bs=!0,l.su=!0,this.starved=!1),l.su==null&&(l.su=this.buffering),this.useHeaders){var m=T.toHeaders(l);if(!Object.keys(m).length)return;a.headers||(a.headers={}),I(a.headers,m)}else{var d=T.toQuery(l);if(!d)return;a.url=T.appendQueryToUri(a.url,d)}},y.getObjectType=function(a){var l=a.type;return l==="subtitle"?A.CMCDObjectType.TIMED_TEXT:a.sn==="initSegment"?A.CMCDObjectType.INIT:l==="audio"?A.CMCDObjectType.AUDIO:l==="main"?this.hls.audioTracks.length?A.CMCDObjectType.VIDEO:A.CMCDObjectType.MUXED:void 0},y.getTopBandwidth=function(a){for(var l=0,s=a===A.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,m=L(s),d;!(d=m()).done;){var f=d.value;f.bitrate>l&&(l=f.bitrate)}return l>0?l:NaN},y.getBufferLength=function(a){var l=this.hls.media,s=a===A.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!s||!l)return NaN;var m=k.BufferHelper.bufferInfo(s,l.currentTime,this.config.maxBufferHole);return m.len*1e3},y.createPlaylistLoader=function(){var a=this.config.pLoader,l=this.applyPlaylistData,s=a||this.config.loader;return function(){function m(f){this.loader=void 0,this.loader=new s(f)}var d=m.prototype;return d.destroy=function(){this.loader.destroy()},d.abort=function(){this.loader.abort()},d.load=function(D,v,h){l(D),this.loader.load(D,v,h)},P(m,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),m}()},y.createFragmentLoader=function(){var a=this.config.fLoader,l=this.applyFragmentData,s=a||this.config.loader;return function(){function m(f){this.loader=void 0,this.loader=new s(f)}var d=m.prototype;return d.destroy=function(){this.loader.destroy()},d.abort=function(){this.loader.abort()},d.load=function(D,v,h){l(D),this.loader.load(D,v,h)},P(m,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),m}()},T.uuid=function(){var a=URL.createObjectURL(new Blob),l=a.toString();return URL.revokeObjectURL(a),l.substr(l.lastIndexOf("/")+1)},T.serialize=function(a){for(var l=[],s=function(z){return!Number.isNaN(z)&&z!=null&&z!==""&&z!==!1},m=function(z){return Math.round(z)},d=function(z){return m(z/100)*100},f=function(z){return encodeURIComponent(z)},D={br:m,d:m,bl:d,dl:d,mtp:d,nor:f,rtp:d,tb:m},v=Object.keys(a||{}).sort(),h=L(v),p;!(p=h()).done;){var c=p.value,o=a[c];if(!s(o))continue;if(c==="v"&&o===1)continue;if(c=="pr"&&o===1)continue;var x=D[c];x&&(o=x(o));var g=typeof o,C=void 0;c==="ot"||c==="sf"||c==="st"?C=c+"="+o:g==="boolean"?C=c:g==="number"?C=c+"="+o:C=c+"="+JSON.stringify(o),l.push(C)}return l.join(",")},T.toHeaders=function(a){for(var l=Object.keys(a),s={},m=["Object","Request","Session","Status"],d=[{},{},{},{}],f={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,v=l;D<v.length;D++){var h=v[D],p=f[h]!=null?f[h]:1;d[p][h]=a[h]}for(var c=0;c<d.length;c++){var o=T.serialize(d[c]);o&&(s["CMCD-"+m[c]]=o)}return s},T.toQuery=function(a){return"CMCD="+encodeURIComponent(T.serialize(a))},T.appendQueryToUri=function(a,l){if(!l)return a;var s=a.includes("?")?"&":"?";return""+a+s+l},T}()},"./src/controller/eme-controller.ts":function(de,V,O){"use strict";O.r(V);var H=O("./src/events.ts"),A=O("./src/errors.ts"),k=O("./src/utils/logger.ts"),W=O("./src/utils/mediakeys-helper.ts");function U(w,T){for(var y=0;y<T.length;y++){var u=T[y];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(w,u.key,u)}}function P(w,T,y){return T&&U(w.prototype,T),y&&U(w,y),w}var L=3,b=function(T,y,u){var a={audioCapabilities:[],videoCapabilities:[]};return T.forEach(function(l){a.audioCapabilities.push({contentType:'audio/mp4; codecs="'+l+'"',robustness:u.audioRobustness||""})}),y.forEach(function(l){a.videoCapabilities.push({contentType:'video/mp4; codecs="'+l+'"',robustness:u.videoRobustness||""})}),[a]},E=function(T,y,u,a){switch(T){case W.KeySystems.WIDEVINE:return b(y,u,a);default:throw new Error("Unknown key-system: "+T)}},I=function(){function w(y){this.hls=void 0,this._widevineLicenseUrl=void 0,this._licenseXhrSetup=void 0,this._licenseResponseCallback=void 0,this._emeEnabled=void 0,this._requestMediaKeySystemAccess=void 0,this._drmSystemOptions=void 0,this._config=void 0,this._mediaKeysList=[],this._media=null,this._hasSetMediaKeys=!1,this._requestLicenseFailureCount=0,this.mediaKeysPromise=null,this._onMediaEncrypted=this.onMediaEncrypted.bind(this),this.hls=y,this._config=y.config,this._widevineLicenseUrl=this._config.widevineLicenseUrl,this._licenseXhrSetup=this._config.licenseXhrSetup,this._licenseResponseCallback=this._config.licenseResponseCallback,this._emeEnabled=this._config.emeEnabled,this._requestMediaKeySystemAccess=this._config.requestMediaKeySystemAccessFunc,this._drmSystemOptions=this._config.drmSystemOptions,this._registerListeners()}var T=w.prototype;return T.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},T._registerListeners=function(){this.hls.on(H.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(H.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(H.Events.MANIFEST_PARSED,this.onManifestParsed,this)},T._unregisterListeners=function(){this.hls.off(H.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(H.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(H.Events.MANIFEST_PARSED,this.onManifestParsed,this)},T.getLicenseServerUrl=function(u){switch(u){case W.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+u+'"')},T._attemptKeySystemAccess=function(u,a,l){var s=this,m=E(u,a,l,this._drmSystemOptions);k.logger.log("Requesting encrypted media key-system access");var d=this.requestMediaKeySystemAccess(u,m);this.mediaKeysPromise=d.then(function(f){return s._onMediaKeySystemAccessObtained(u,f)}),d.catch(function(f){k.logger.error('Failed to obtain key-system "'+u+'" access:',f)})},T._onMediaKeySystemAccessObtained=function(u,a){var l=this;k.logger.log('Access for key-system "'+u+'" obtained');var s={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:a,mediaKeySystemDomain:u};this._mediaKeysList.push(s);var m=Promise.resolve().then(function(){return a.createMediaKeys()}).then(function(d){return s.mediaKeys=d,k.logger.log('Media-keys created for key-system "'+u+'"'),l._onMediaKeysCreated(),d});return m.catch(function(d){k.logger.error("Failed to create media-keys:",d)}),m},T._onMediaKeysCreated=function(){var u=this;this._mediaKeysList.forEach(function(a){a.mediaKeysSession||(a.mediaKeysSession=a.mediaKeys.createSession(),u._onNewMediaKeySession(a.mediaKeysSession))})},T._onNewMediaKeySession=function(u){var a=this;k.logger.log("New key-system session "+u.sessionId),u.addEventListener("message",function(l){a._onKeySessionMessage(u,l.message)},!1)},T._onKeySessionMessage=function(u,a){k.logger.log("Got EME message event, creating license request"),this._requestLicense(a,function(l){k.logger.log("Received license data (length: "+(l&&l.byteLength)+"), updating key-session"),u.update(l)})},T.onMediaEncrypted=function(u){var a=this;if(k.logger.log('Media is encrypted using "'+u.initDataType+'" init data type'),!this.mediaKeysPromise){k.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(H.Events.ERROR,{type:A.ErrorTypes.KEY_SYSTEM_ERROR,details:A.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var l=function(m){if(!a._media)return;a._attemptSetMediaKeys(m),a._generateRequestWithPreferredKeySession(u.initDataType,u.initData)};this.mediaKeysPromise.then(l).catch(l)},T._attemptSetMediaKeys=function(u){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){k.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(H.Events.ERROR,{type:A.ErrorTypes.KEY_SYSTEM_ERROR,details:A.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}k.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(a.mediaKeys),this._hasSetMediaKeys=!0}},T._generateRequestWithPreferredKeySession=function(u,a){var l=this,s=this._mediaKeysList[0];if(!s){k.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(H.Events.ERROR,{type:A.ErrorTypes.KEY_SYSTEM_ERROR,details:A.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(s.mediaKeysSessionInitialized){k.logger.warn("Key-Session already initialized but requested again");return}var m=s.mediaKeysSession;if(!m){k.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(H.Events.ERROR,{type:A.ErrorTypes.KEY_SYSTEM_ERROR,details:A.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!a){k.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(H.Events.ERROR,{type:A.ErrorTypes.KEY_SYSTEM_ERROR,details:A.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}k.logger.log('Generating key-session request for "'+u+'" init data type'),s.mediaKeysSessionInitialized=!0,m.generateRequest(u,a).then(function(){k.logger.debug("Key-session generation succeeded")}).catch(function(d){k.logger.error("Error generating key-session request:",d),l.hls.trigger(H.Events.ERROR,{type:A.ErrorTypes.KEY_SYSTEM_ERROR,details:A.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},T._createLicenseXhr=function(u,a,l){var s=new XMLHttpRequest;s.responseType="arraybuffer",s.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,s,u,a,l);var m=this._licenseXhrSetup;if(m)try{m.call(this.hls,s,u),m=void 0}catch(d){k.logger.error(d)}try{s.readyState||s.open("POST",u,!0),m&&m.call(this.hls,s,u)}catch(d){throw new Error("issue setting up KeySystem license XHR "+d)}return s},T._onLicenseRequestReadyStageChange=function(u,a,l,s){switch(u.readyState){case 4:if(u.status===200){this._requestLicenseFailureCount=0,k.logger.log("License request succeeded");var m=u.response,d=this._licenseResponseCallback;if(d)try{m=d.call(this.hls,u,a)}catch(D){k.logger.error(D)}s(m)}else{if(k.logger.error("License Request XHR failed ("+a+"). Status: "+u.status+" ("+u.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>L){this.hls.trigger(H.Events.ERROR,{type:A.ErrorTypes.KEY_SYSTEM_ERROR,details:A.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var f=L-this._requestLicenseFailureCount+1;k.logger.warn("Retrying license request, "+f+" attempts left"),this._requestLicense(l,s)}break}},T._generateLicenseRequestChallenge=function(u,a){switch(u.mediaKeySystemDomain){case W.KeySystems.WIDEVINE:return a}throw new Error("unsupported key-system: "+u.mediaKeySystemDomain)},T._requestLicense=function(u,a){k.logger.log("Requesting content license for key-system");var l=this._mediaKeysList[0];if(!l){k.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(H.Events.ERROR,{type:A.ErrorTypes.KEY_SYSTEM_ERROR,details:A.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var s=this.getLicenseServerUrl(l.mediaKeySystemDomain),m=this._createLicenseXhr(s,u,a);k.logger.log("Sending license request to URL: "+s);var d=this._generateLicenseRequestChallenge(l,u);m.send(d)}catch(f){k.logger.error("Failure requesting DRM license: "+f),this.hls.trigger(H.Events.ERROR,{type:A.ErrorTypes.KEY_SYSTEM_ERROR,details:A.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},T.onMediaAttached=function(u,a){if(!this._emeEnabled)return;var l=a.media;this._media=l,l.addEventListener("encrypted",this._onMediaEncrypted)},T.onMediaDetached=function(){var u=this._media,a=this._mediaKeysList;if(!u)return;u.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 u.setMediaKeys(null)}).catch(function(){})},T.onManifestParsed=function(u,a){if(!this._emeEnabled)return;var l=a.levels.map(function(m){return m.audioCodec}).filter(function(m){return!!m}),s=a.levels.map(function(m){return m.videoCodec}).filter(function(m){return!!m});this._attemptKeySystemAccess(W.KeySystems.WIDEVINE,l,s)},P(w,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),w}();V.default=I},"./src/controller/fps-controller.ts":function(de,V,O){"use strict";O.r(V);var H=O("./src/events.ts"),A=O("./src/utils/logger.ts"),k=function(){function W(P){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=P,this.registerListeners()}var U=W.prototype;return U.setStreamController=function(L){this.streamController=L},U.registerListeners=function(){this.hls.on(H.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},U.unregisterListeners=function(){this.hls.off(H.Events.MEDIA_ATTACHING,this.onMediaAttaching)},U.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},U.onMediaAttaching=function(L,b){var E=this.hls.config;if(E.capLevelOnFPSDrop){var I=b.media instanceof self.HTMLVideoElement?b.media:null;this.media=I,I&&typeof I.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),E.fpsDroppedMonitoringPeriod)}},U.checkFPS=function(L,b,E){var I=performance.now();if(b){if(this.lastTime){var w=I-this.lastTime,T=E-this.lastDroppedFrames,y=b-this.lastDecodedFrames,u=1e3*T/w,a=this.hls;if(a.trigger(H.Events.FPS_DROP,{currentDropped:T,currentDecoded:y,totalDroppedFrames:E}),u>0&&T>a.config.fpsDroppedMonitoringThreshold*y){var l=a.currentLevel;A.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(H.Events.FPS_DROP_LEVEL_CAPPING,{level:l,droppedLevel:a.currentLevel}),a.autoLevelCapping=l,this.streamController.nextLevelSwitch())}}this.lastTime=I,this.lastDroppedFrames=E,this.lastDecodedFrames=b}},U.checkFPSInterval=function(){var L=this.media;if(L)if(this.isVideoPlaybackQualityAvailable){var b=L.getVideoPlaybackQuality();this.checkFPS(L,b.totalVideoFrames,b.droppedVideoFrames)}else this.checkFPS(L,L.webkitDecodedFrameCount,L.webkitDroppedFrameCount)},W}();V.default=k},"./src/controller/fragment-finders.ts":function(de,V,O){"use strict";O.r(V),O.d(V,"findFragmentByPDT",function(){return k}),O.d(V,"findFragmentByPTS",function(){return W}),O.d(V,"fragmentWithinToleranceTest",function(){return U}),O.d(V,"pdtWithinToleranceTest",function(){return P}),O.d(V,"findFragWithCC",function(){return L});var H=O("./src/polyfills/number.ts"),A=O("./src/utils/binary-search.ts");function k(b,E,I){if(E===null||!Array.isArray(b)||!b.length||!Object(H.isFiniteNumber)(E))return null;var w=b[0].programDateTime;if(E<(w||0))return null;var T=b[b.length-1].endProgramDateTime;if(E>=(T||0))return null;I=I||0;for(var y=0;y<b.length;++y){var u=b[y];if(P(E,I,u))return u}return null}function W(b,E,I,w){I===void 0&&(I=0),w===void 0&&(w=0);var T=null;if(b?T=E[b.sn-E[0].sn+1]||null:I===0&&E[0].start===0&&(T=E[0]),T&&U(I,w,T)===0)return T;var y=A.default.search(E,U.bind(null,I,w));return y||T}function U(b,E,I){b===void 0&&(b=0),E===void 0&&(E=0);var w=Math.min(E,I.duration+(I.deltaPTS?I.deltaPTS:0));return I.start+I.duration-w<=b?1:I.start-w>b&&I.start?-1:0}function P(b,E,I){var w=Math.min(E,I.duration+(I.deltaPTS?I.deltaPTS:0))*1e3,T=I.endProgramDateTime||0;return T-w>b}function L(b,E){return A.default.search(b,function(I){return I.cc<E?1:I.cc>E?-1:0})}},"./src/controller/fragment-tracker.ts":function(de,V,O){"use strict";O.r(V),O.d(V,"FragmentState",function(){return k}),O.d(V,"FragmentTracker",function(){return W});var H=O("./src/events.ts"),A=O("./src/types/loader.ts"),k;(function(L){L.NOT_LOADED="NOT_LOADED",L.BACKTRACKED="BACKTRACKED",L.APPENDING="APPENDING",L.PARTIAL="PARTIAL",L.OK="OK"})(k||(k={}));var W=function(){function L(E){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=E,this._registerListeners()}var b=L.prototype;return b._registerListeners=function(){var I=this.hls;I.on(H.Events.BUFFER_APPENDED,this.onBufferAppended,this),I.on(H.Events.FRAG_BUFFERED,this.onFragBuffered,this),I.on(H.Events.FRAG_LOADED,this.onFragLoaded,this)},b._unregisterListeners=function(){var I=this.hls;I.off(H.Events.BUFFER_APPENDED,this.onBufferAppended,this),I.off(H.Events.FRAG_BUFFERED,this.onFragBuffered,this),I.off(H.Events.FRAG_LOADED,this.onFragLoaded,this)},b.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},b.getAppendedFrag=function(I,w){if(w===A.PlaylistLevelType.MAIN){var T=this.activeFragment,y=this.activeParts;if(!T)return null;if(y)for(var u=y.length;u--;){var a=y[u],l=a?a.end:T.appendedPTS;if(a.start<=I&&l!==void 0&&I<=l)return u>9&&(this.activeParts=y.slice(u-9)),a}else if(T.start<=I&&T.appendedPTS!==void 0&&I<=T.appendedPTS)return T}return this.getBufferedFrag(I,w)},b.getBufferedFrag=function(I,w){for(var T=this.fragments,y=Object.keys(T),u=y.length;u--;){var a=T[y[u]];if((a==null?void 0:a.body.type)===w&&a.buffered){var l=a.body;if(l.start<=I&&I<=l.end)return l}}return null},b.detectEvictedFragments=function(I,w,T){var y=this;Object.keys(this.fragments).forEach(function(u){var a=y.fragments[u];if(!a)return;if(!a.buffered){a.body.type===T&&y.removeFragment(a.body);return}var l=a.range[I];if(!l)return;l.time.some(function(s){var m=!y.isTimeBuffered(s.startPTS,s.endPTS,w);return m&&y.removeFragment(a.body),m})})},b.detectPartialFragments=function(I){var w=this,T=this.timeRanges,y=I.frag,u=I.part;if(!T||y.sn==="initSegment")return;var a=P(y),l=this.fragments[a];if(!l)return;Object.keys(T).forEach(function(s){var m=y.elementaryStreams[s];if(!m)return;var d=T[s],f=u!==null||m.partial===!0;l.range[s]=w.getBufferedTimes(y,u,f,d)}),l.backtrack=l.loaded=null,Object.keys(l.range).length?l.buffered=!0:this.removeFragment(l.body)},b.fragBuffered=function(I){var w=P(I),T=this.fragments[w];T&&(T.backtrack=T.loaded=null,T.buffered=!0)},b.getBufferedTimes=function(I,w,T,y){for(var u={time:[],partial:T},a=w?w.start:I.start,l=w?w.end:I.end,s=I.minEndPTS||l,m=I.maxStartPTS||a,d=0;d<y.length;d++){var f=y.start(d)-this.bufferPadding,D=y.end(d)+this.bufferPadding;if(m>=f&&s<=D){u.time.push({startPTS:Math.max(a,y.start(d)),endPTS:Math.min(l,y.end(d))});break}else if(a<D&&l>f)u.partial=!0,u.time.push({startPTS:Math.max(a,y.start(d)),endPTS:Math.min(l,y.end(d))});else if(l<=f)break}return u},b.getPartialFragment=function(I){var w=null,T,y,u,a=0,l=this.bufferPadding,s=this.fragments;return Object.keys(s).forEach(function(m){var d=s[m];if(!d)return;U(d)&&(y=d.body.start-l,u=d.body.end+l,I>=y&&I<=u&&(T=Math.min(I-y,u-I),a<=T&&(w=d.body,a=T)))}),w},b.getState=function(I){var w=P(I),T=this.fragments[w];return T?T.buffered?U(T)?k.PARTIAL:k.OK:T.backtrack?k.BACKTRACKED:k.APPENDING:k.NOT_LOADED},b.backtrack=function(I,w){var T=P(I),y=this.fragments[T];if(!y||y.backtrack)return null;var u=y.backtrack=w||y.loaded;return y.loaded=null,u},b.getBacktrackData=function(I){var w=P(I),T=this.fragments[w];if(T){var y,u=T.backtrack;if(u!=null&&(y=u.payload)!==null&&y!==void 0&&y.byteLength)return u;this.removeFragment(I)}return null},b.isTimeBuffered=function(I,w,T){for(var y,u,a=0;a<T.length;a++){if(y=T.start(a)-this.bufferPadding,u=T.end(a)+this.bufferPadding,I>=y&&w<=u)return!0;if(w<=y)return!1}return!1},b.onFragLoaded=function(I,w){var T=w.frag,y=w.part;if(T.sn==="initSegment"||T.bitrateTest||y)return;var u=P(T);this.fragments[u]={body:T,loaded:w,backtrack:null,buffered:!1,range:Object.create(null)}},b.onBufferAppended=function(I,w){var T=this,y=w.frag,u=w.part,a=w.timeRanges;if(y.type===A.PlaylistLevelType.MAIN)if(this.activeFragment=y,u){var l=this.activeParts;l||(this.activeParts=l=[]),l.push(u)}else this.activeParts=null;this.timeRanges=a,Object.keys(a).forEach(function(s){var m=a[s];if(T.detectEvictedFragments(s,m),!u)for(var d=0;d<m.length;d++)y.appendedPTS=Math.max(m.end(d),y.appendedPTS||0)})},b.onFragBuffered=function(I,w){this.detectPartialFragments(w)},b.hasFragment=function(I){var w=P(I);return!!this.fragments[w]},b.removeFragmentsInRange=function(I,w,T){var y=this;Object.keys(this.fragments).forEach(function(u){var a=y.fragments[u];if(!a)return;if(a.buffered){var l=a.body;l.type===T&&l.start<w&&l.end>I&&y.removeFragment(l)}})},b.removeFragment=function(I){var w=P(I);I.stats.loaded=0,I.clearElementaryStreamInfo(),delete this.fragments[w]},b.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},L}();function U(L){var b,E;return L.buffered&&(((b=L.range.video)===null||b===void 0?void 0:b.partial)||((E=L.range.audio)===null||E===void 0?void 0:E.partial))}function P(L){return L.type+"_"+L.level+"_"+L.urlId+"_"+L.sn}},"./src/controller/gap-controller.ts":function(de,V,O){"use strict";O.r(V),O.d(V,"STALL_MINIMUM_DURATION_MS",function(){return U}),O.d(V,"MAX_START_GAP_JUMP",function(){return P}),O.d(V,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return L}),O.d(V,"SKIP_BUFFER_RANGE_START",function(){return b}),O.d(V,"default",function(){return E});var H=O("./src/utils/buffer-helper.ts"),A=O("./src/errors.ts"),k=O("./src/events.ts"),W=O("./src/utils/logger.ts"),U=250,P=2,L=.1,b=.05,E=function(){function I(T,y,u,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=T,this.media=y,this.fragmentTracker=u,this.hls=a}var w=I.prototype;return w.destroy=function(){this.hls=this.fragmentTracker=this.media=null},w.poll=function(y){var u=this.config,a=this.media,l=this.stalled,s=a.currentTime,m=a.seeking,d=this.seeking&&!m,f=!this.seeking&&m;if(this.seeking=m,s!==y){if(this.moved=!0,l!==null){if(this.stallReported){var D=self.performance.now()-l;W.logger.warn("playback not stuck anymore @"+s+", after "+Math.round(D)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((f||d)&&(this.stalled=null),a.paused||a.ended||a.playbackRate===0||!H.BufferHelper.getBuffered(a).length)return;var v=H.BufferHelper.bufferInfo(a,s,0),h=v.len>0,p=v.nextStart||0;if(!h&&!p)return;if(m){var c=v.len>P,o=!p||p-s>P&&!this.fragmentTracker.getPartialFragment(s);if(c||o)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var x,g=Math.max(p,v.start||0)-s,C=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,_=C==null||((x=C.details)===null||x===void 0)?void 0:x.live,z=_?C.details.targetduration*2:P;if(g>0&&g<=z){this._trySkipBufferHole(null);return}}var Y=self.performance.now();if(l===null){this.stalled=Y;return}var oe=Y-l;!m&&oe>=U&&this._reportStall(v.len);var G=H.BufferHelper.bufferInfo(a,s,u.maxBufferHole);this._tryFixBufferStall(G,oe)},w._tryFixBufferStall=function(y,u){var a=this.config,l=this.fragmentTracker,s=this.media,m=s.currentTime,d=l.getPartialFragment(m);if(d){var f=this._trySkipBufferHole(d);if(f)return}y.len>a.maxBufferHole&&u>a.highBufferWatchdogPeriod*1e3&&(W.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},w._reportStall=function(y){var u=this.hls,a=this.media,l=this.stallReported;l||(this.stallReported=!0,W.logger.warn("Playback stalling at @"+a.currentTime+" due to low buffer (buffer="+y+")"),u.trigger(k.Events.ERROR,{type:A.ErrorTypes.MEDIA_ERROR,details:A.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:y}))},w._trySkipBufferHole=function(y){for(var u=this.config,a=this.hls,l=this.media,s=l.currentTime,m=0,d=H.BufferHelper.getBuffered(l),f=0;f<d.length;f++){var D=d.start(f);if(s+u.maxBufferHole>=m&&s<D){var v=Math.max(D+b,l.currentTime+L);return W.logger.warn("skipping hole, adjusting currentTime from "+s+" to "+v),this.moved=!0,this.stalled=null,l.currentTime=v,y&&a.trigger(k.Events.ERROR,{type:A.ErrorTypes.MEDIA_ERROR,details:A.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+s+" to "+v,frag:y}),v}m=d.end(f)}return 0},w._tryNudgeBuffer=function(){var y=this.config,u=this.hls,a=this.media,l=a.currentTime,s=(this.nudgeRetry||0)+1;if(this.nudgeRetry=s,s<y.nudgeMaxRetry){var m=l+s*y.nudgeOffset;W.logger.warn("Nudging 'currentTime' from "+l+" to "+m),a.currentTime=m,u.trigger(k.Events.ERROR,{type:A.ErrorTypes.MEDIA_ERROR,details:A.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else W.logger.error("Playhead still not moving while enough data buffered @"+l+" after "+y.nudgeMaxRetry+" nudges"),u.trigger(k.Events.ERROR,{type:A.ErrorTypes.MEDIA_ERROR,details:A.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},I}()},"./src/controller/id3-track-controller.ts":function(de,V,O){"use strict";O.r(V);var H=O("./src/events.ts"),A=O("./src/utils/texttrack-utils.ts"),k=O("./src/demux/id3.ts"),W=.25,U=function(){function P(b){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=b,this._registerListeners()}var L=P.prototype;return L.destroy=function(){this._unregisterListeners()},L._registerListeners=function(){var E=this.hls;E.on(H.Events.MEDIA_ATTACHED,this.onMediaAttached,this),E.on(H.Events.MEDIA_DETACHING,this.onMediaDetaching,this),E.on(H.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),E.on(H.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},L._unregisterListeners=function(){var E=this.hls;E.off(H.Events.MEDIA_ATTACHED,this.onMediaAttached,this),E.off(H.Events.MEDIA_DETACHING,this.onMediaDetaching,this),E.off(H.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),E.off(H.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},L.onMediaAttached=function(E,I){this.media=I.media},L.onMediaDetaching=function(){if(!this.id3Track)return;Object(A.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},L.getID3Track=function(E){if(!this.media)return;for(var I=0;I<E.length;I++){var w=E[I];if(w.kind==="metadata"&&w.label==="id3")return Object(A.sendAddTrackEvent)(w,this.media),w}return this.media.addTextTrack("metadata","id3")},L.onFragParsingMetadata=function(E,I){if(!this.media)return;var w=I.frag,T=I.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var y=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,u=0;u<T.length;u++){var a=k.getID3Frames(T[u].data);if(a){var l=T[u].pts,s=u<T.length-1?T[u+1].pts:w.end,m=s-l;m<=0&&(s=l+W);for(var d=0;d<a.length;d++){var f=a[d];if(!k.isTimeStampFrame(f)){var D=new y(l,s,"");D.value=f,this.id3Track.addCue(D)}}}}},L.onBufferFlushing=function(E,I){var w=I.startOffset,T=I.endOffset,y=I.type;if(!y||y==="audio"){var u=this.id3Track;u&&Object(A.removeCuesInRange)(u,w,T)}},P}();V.default=U},"./src/controller/latency-controller.ts":function(de,V,O){"use strict";O.r(V),O.d(V,"default",function(){return P});var H=O("./src/errors.ts"),A=O("./src/events.ts"),k=O("./src/utils/logger.ts");function W(L,b){for(var E=0;E<b.length;E++){var I=b[E];I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I&&(I.writable=!0),Object.defineProperty(L,I.key,I)}}function U(L,b,E){return b&&W(L.prototype,b),E&&W(L,E),L}var P=function(){function L(E){var I=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 I.timeupdate()},this.hls=E,this.config=E.config,this.registerListeners()}var b=L.prototype;return b.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},b.registerListeners=function(){this.hls.on(A.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(A.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(A.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(A.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(A.Events.ERROR,this.onError,this)},b.unregisterListeners=function(){this.hls.off(A.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(A.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(A.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(A.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(A.Events.ERROR,this.onError)},b.onMediaAttached=function(I,w){this.media=w.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},b.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},b.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},b.onLevelUpdated=function(I,w){var T=w.details;this.levelDetails=T,T.advanced&&this.timeupdate(),!T.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},b.onError=function(I,w){if(w.details!==H.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,k.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},b.timeupdate=function(){var I=this.media,w=this.levelDetails;if(!I||!w)return;this.currentTime=I.currentTime;var T=this.computeLatency();if(T===null)return;this._latency=T;var y=this.config,u=y.lowLatencyMode,a=y.maxLiveSyncPlaybackRate;if(!u||a===1)return;var l=this.targetLatency;if(l===null)return;var s=T-l,m=Math.min(this.maxLatency,l+w.targetduration),d=s<m;if(w.live&&d&&s>.05&&this.forwardBufferLength>1){var f=Math.min(2,Math.max(1,a)),D=Math.round(2/(1+Math.exp(-.75*s-this.edgeStalled))*20)/20;I.playbackRate=Math.min(f,Math.max(1,D))}else I.playbackRate!==1&&I.playbackRate!==0&&(I.playbackRate=1)},b.estimateLiveEdge=function(){var I=this.levelDetails;return I===null?null:I.edge+I.age},b.computeLatency=function(){var I=this.estimateLiveEdge();return I===null?null:I-this.currentTime},U(L,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var I=this.config,w=this.levelDetails;return I.liveMaxLatencyDuration!==void 0?I.liveMaxLatencyDuration:w?I.liveMaxLatencyDurationCount*w.targetduration:0}},{key:"targetLatency",get:function(){var I=this.levelDetails;if(I===null)return null;var w=I.holdBack,T=I.partHoldBack,y=I.targetduration,u=this.config,a=u.liveSyncDuration,l=u.liveSyncDurationCount,s=u.lowLatencyMode,m=this.hls.userConfig,d=s&&T||w;(m.liveSyncDuration||m.liveSyncDurationCount||d===0)&&(d=a!==void 0?a:l*y);var f=y,D=1;return d+Math.min(this.stallCount*D,f)}},{key:"liveSyncPosition",get:function(){var I=this.estimateLiveEdge(),w=this.targetLatency,T=this.levelDetails;if(I===null||w===null||T===null)return null;var y=T.edge,u=I-w-this.edgeStalled,a=y-T.totalduration,l=y-(this.config.lowLatencyMode&&T.partTarget||T.targetduration);return Math.min(Math.max(a,u),l)}},{key:"drift",get:function(){var I=this.levelDetails;return I===null?1:I.drift}},{key:"edgeStalled",get:function(){var I=this.levelDetails;if(I===null)return 0;var w=(this.config.lowLatencyMode&&I.partTarget||I.targetduration)*3;return Math.max(I.age-w,0)}},{key:"forwardBufferLength",get:function(){var I=this.media,w=this.levelDetails;if(!I||!w)return 0;var T=I.buffered.length;return T?I.buffered.end(T-1):w.edge-this.currentTime}}]),L}()},"./src/controller/level-controller.ts":function(de,V,O){"use strict";O.r(V),O.d(V,"default",function(){return u});var H=O("./src/types/level.ts"),A=O("./src/events.ts"),k=O("./src/errors.ts"),W=O("./src/utils/codecs.ts"),U=O("./src/controller/level-helper.ts"),P=O("./src/controller/base-playlist-controller.ts"),L=O("./src/types/loader.ts");function b(){return b=Object.assign||function(a){for(var l=1;l<arguments.length;l++){var s=arguments[l];for(var m in s)Object.prototype.hasOwnProperty.call(s,m)&&(a[m]=s[m])}return a},b.apply(this,arguments)}function E(a,l){for(var s=0;s<l.length;s++){var m=l[s];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(a,m.key,m)}}function I(a,l,s){return l&&E(a.prototype,l),s&&E(a,s),a}function w(a,l){a.prototype=Object.create(l.prototype),a.prototype.constructor=a,T(a,l)}function T(a,l){return T=Object.setPrototypeOf||function(m,d){return m.__proto__=d,m},T(a,l)}var y=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),u=function(a){w(l,a);function l(m){var d;return d=a.call(this,m,"[level-controller]")||this,d._levels=[],d._firstLevel=-1,d._startLevel=void 0,d.currentLevelIndex=-1,d.manualLevelIndex=-1,d.onParsedComplete=void 0,d._registerListeners(),d}var s=l.prototype;return s._registerListeners=function(){var d=this.hls;d.on(A.Events.MANIFEST_LOADED,this.onManifestLoaded,this),d.on(A.Events.LEVEL_LOADED,this.onLevelLoaded,this),d.on(A.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),d.on(A.Events.FRAG_LOADED,this.onFragLoaded,this),d.on(A.Events.ERROR,this.onError,this)},s._unregisterListeners=function(){var d=this.hls;d.off(A.Events.MANIFEST_LOADED,this.onManifestLoaded,this),d.off(A.Events.LEVEL_LOADED,this.onLevelLoaded,this),d.off(A.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),d.off(A.Events.FRAG_LOADED,this.onFragLoaded,this),d.off(A.Events.ERROR,this.onError,this)},s.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,a.prototype.destroy.call(this)},s.startLoad=function(){var d=this._levels;d.forEach(function(f){f.loadError=0}),a.prototype.startLoad.call(this)},s.onManifestLoaded=function(d,f){var D=[],v=[],h=[],p,c={},o,x=!1,g=!1,C=!1;if(f.levels.forEach(function(oe){var G=oe.attrs;x=x||!!(oe.width&&oe.height),g=g||!!oe.videoCodec,C=C||!!oe.audioCodec,y&&oe.audioCodec&&oe.audioCodec.indexOf("mp4a.40.34")!==-1&&(oe.audioCodec=void 0);var j=oe.bitrate+"-"+oe.attrs.RESOLUTION+"-"+oe.attrs.CODECS;o=c[j],o?o.url.push(oe.url):(o=new H.Level(oe),c[j]=o,D.push(o)),G&&(G.AUDIO&&Object(U.addGroupId)(o,"audio",G.AUDIO),G.SUBTITLES&&Object(U.addGroupId)(o,"text",G.SUBTITLES))}),(x||g)&&C&&(D=D.filter(function(oe){var G=oe.videoCodec,j=oe.width,se=oe.height;return!!G||!!(j&&se)})),D=D.filter(function(oe){var G=oe.audioCodec,j=oe.videoCodec;return(!G||Object(W.isCodecSupportedInMp4)(G,"audio"))&&(!j||Object(W.isCodecSupportedInMp4)(j,"video"))}),f.audioTracks&&(v=f.audioTracks.filter(function(oe){return!oe.audioCodec||Object(W.isCodecSupportedInMp4)(oe.audioCodec,"audio")}),Object(U.assignTrackIdsByGroup)(v)),f.subtitles&&(h=f.subtitles,Object(U.assignTrackIdsByGroup)(h)),D.length>0){p=D[0].bitrate,D.sort(function(oe,G){return oe.bitrate-G.bitrate}),this._levels=D;for(var _=0;_<D.length;_++)if(D[_].bitrate===p){this._firstLevel=_,this.log("manifest loaded, "+D.length+" level(s) found, first bitrate: "+p);break}var z=C&&!g,Y={levels:D,audioTracks:v,subtitleTracks:h,firstLevel:this._firstLevel,stats:f.stats,audio:C,video:g,altAudio:!z&&v.some(function(oe){return!!oe.url})};this.hls.trigger(A.Events.MANIFEST_PARSED,Y),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(A.Events.ERROR,{type:k.ErrorTypes.MEDIA_ERROR,details:k.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:f.url,reason:"no level with compatible codecs found in manifest"})},s.onError=function(d,f){if(a.prototype.onError.call(this,d,f),f.fatal)return;var D=f.context,v=this._levels[this.currentLevelIndex];if(D&&(D.type===L.PlaylistContextType.AUDIO_TRACK&&v.audioGroupIds&&D.groupId===v.audioGroupIds[v.urlId]||D.type===L.PlaylistContextType.SUBTITLE_TRACK&&v.textGroupIds&&D.groupId===v.textGroupIds[v.urlId])){this.redundantFailover(this.currentLevelIndex);return}var h=!1,p=!0,c;switch(f.details){case k.ErrorDetails.FRAG_LOAD_ERROR:case k.ErrorDetails.FRAG_LOAD_TIMEOUT:case k.ErrorDetails.KEY_LOAD_ERROR:case k.ErrorDetails.KEY_LOAD_TIMEOUT:if(f.frag){var o=this._levels[f.frag.level];o?(o.fragmentError++,o.fragmentError>this.hls.config.fragLoadingMaxRetry&&(c=f.frag.level)):c=f.frag.level}break;case k.ErrorDetails.LEVEL_LOAD_ERROR:case k.ErrorDetails.LEVEL_LOAD_TIMEOUT:D&&(D.deliveryDirectives&&(p=!1),c=D.level),h=!0;break;case k.ErrorDetails.REMUX_ALLOC_ERROR:c=f.level,h=!0;break}c!==void 0&&this.recoverLevel(f,c,h,p)},s.recoverLevel=function(d,f,D,v){var h=d.details,p=this._levels[f];if(p.loadError++,D){var c=this.retryLoadingOrFail(d);if(c)d.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(v){var o=p.url.length;if(o>1&&p.loadError<o)d.levelRetry=!0,this.redundantFailover(f);else if(this.manualLevelIndex===-1){var x=f===0?this._levels.length-1:f-1;this.currentLevelIndex!==x&&this._levels[x].loadError===0&&(this.warn(h+": switch to "+x),d.levelRetry=!0,this.hls.nextAutoLevel=x)}}},s.redundantFailover=function(d){var f=this._levels[d],D=f.url.length;if(D>1){var v=(f.urlId+1)%D;this.warn("Switching to redundant URL-id "+v),this._levels.forEach(function(h){h.urlId=v}),this.level=d}},s.onFragLoaded=function(d,f){var D=f.frag;if(D!==void 0&&D.type===L.PlaylistLevelType.MAIN){var v=this._levels[D.level];v!==void 0&&(v.fragmentError=0,v.loadError=0)}},s.onLevelLoaded=function(d,f){var D,v=f.level,h=f.details,p=this._levels[v];if(!p){var c;this.warn("Invalid level index "+v),(c=f.deliveryDirectives)!==null&&c!==void 0&&c.skip&&(h.deltaUpdateFailed=!0);return}v===this.currentLevelIndex?(p.fragmentError===0&&(p.loadError=0,this.retryCount=0),this.playlistLoaded(v,f,p.details)):(D=f.deliveryDirectives)!==null&&D!==void 0&&D.skip&&(h.deltaUpdateFailed=!0)},s.onAudioTrackSwitched=function(d,f){var D=this.hls.levels[this.currentLevelIndex];if(!D)return;if(D.audioGroupIds){for(var v=-1,h=this.hls.audioTracks[f.id].groupId,p=0;p<D.audioGroupIds.length;p++)if(D.audioGroupIds[p]===h){v=p;break}v!==D.urlId&&(D.urlId=v,this.startLoad())}},s.loadPlaylist=function(d){var f=this.currentLevelIndex,D=this._levels[f];if(this.canLoad&&D&&D.url.length>0){var v=D.urlId,h=D.url[v];if(d)try{h=d.addDirectives(h)}catch(p){this.warn("Could not construct new URL with HLS Delivery Directives: "+p)}this.log("Attempt loading level index "+f+(d?" at sn "+d.msn+" part "+d.part:"")+" with URL-id "+v+" "+h),this.clearTimer(),this.hls.trigger(A.Events.LEVEL_LOADING,{url:h,level:f,id:v,deliveryDirectives:d||null})}},s.removeLevel=function(d,f){var D=function(p,c){return c!==f},v=this._levels.filter(function(h,p){return p!==d?!0:h.url.length>1&&f!==void 0?(h.url=h.url.filter(D),h.audioGroupIds&&(h.audioGroupIds=h.audioGroupIds.filter(D)),h.textGroupIds&&(h.textGroupIds=h.textGroupIds.filter(D)),h.urlId=0,!0):!1}).map(function(h,p){var c=h.details;return c!=null&&c.fragments&&c.fragments.forEach(function(o){o.level=p}),h});this._levels=v,this.hls.trigger(A.Events.LEVELS_UPDATED,{levels:v})},I(l,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(d){var f,D=this._levels;if(D.length===0)return;if(this.currentLevelIndex===d&&(f=D[d])!==null&&f!==void 0&&f.details)return;if(d<0||d>=D.length){var v=d<0;if(this.hls.trigger(A.Events.ERROR,{type:k.ErrorTypes.OTHER_ERROR,details:k.ErrorDetails.LEVEL_SWITCH_ERROR,level:d,fatal:v,reason:"invalid level idx"}),v)return;d=Math.min(d,D.length-1)}this.clearTimer();var h=this.currentLevelIndex,p=D[h],c=D[d];this.log("switching to level "+d+" from "+h),this.currentLevelIndex=d;var o=b({},c,{level:d,maxBitrate:c.maxBitrate,uri:c.uri,urlId:c.urlId});delete o._urlId,this.hls.trigger(A.Events.LEVEL_SWITCHING,o);var x=c.details;if(!x||x.live){var g=this.switchParams(c.uri,p==null?void 0:p.details);this.loadPlaylist(g)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(d){this.manualLevelIndex=d,this._startLevel===void 0&&(this._startLevel=d),d!==-1&&(this.level=d)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(d){this._firstLevel=d}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var d=this.hls.config.startLevel;return d!==void 0?d:this._firstLevel}else return this._startLevel},set:function(d){this._startLevel=d}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(d){this.level=d,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=d)}}]),l}(P.default)},"./src/controller/level-helper.ts":function(de,V,O){"use strict";O.r(V),O.d(V,"addGroupId",function(){return k}),O.d(V,"assignTrackIdsByGroup",function(){return W}),O.d(V,"updatePTS",function(){return U}),O.d(V,"updateFragPTSDTS",function(){return L}),O.d(V,"mergeDetails",function(){return b}),O.d(V,"mapPartIntersection",function(){return E}),O.d(V,"mapFragmentIntersection",function(){return I}),O.d(V,"adjustSliding",function(){return w}),O.d(V,"addSliding",function(){return T}),O.d(V,"computeReloadInterval",function(){return y}),O.d(V,"getFragmentWithSN",function(){return u}),O.d(V,"getPartWith",function(){return a});var H=O("./src/polyfills/number.ts"),A=O("./src/utils/logger.ts");function k(l,s,m){switch(s){case"audio":l.audioGroupIds||(l.audioGroupIds=[]),l.audioGroupIds.push(m);break;case"text":l.textGroupIds||(l.textGroupIds=[]),l.textGroupIds.push(m);break}}function W(l){var s={};l.forEach(function(m){var d=m.groupId||"";m.id=s[d]=s[d]||0,s[d]++})}function U(l,s,m){var d=l[s],f=l[m];P(d,f)}function P(l,s){var m=s.startPTS;if(Object(H.isFiniteNumber)(m)){var d=0,f;s.sn>l.sn?(d=m-l.start,f=l):(d=l.start-m,f=s),f.duration!==d&&(f.duration=d)}else if(s.sn>l.sn){var D=l.cc===s.cc;D&&l.minEndPTS?s.start=l.start+(l.minEndPTS-l.start):s.start=l.start+l.duration}else s.start=Math.max(l.start-s.duration,0)}function L(l,s,m,d,f,D){var v=d-m;v<=0&&(A.logger.warn("Fragment should have a positive duration",s),d=m+s.duration,D=f+s.duration);var h=m,p=d,c=s.startPTS,o=s.endPTS;if(Object(H.isFiniteNumber)(c)){var x=Math.abs(c-m);Object(H.isFiniteNumber)(s.deltaPTS)?s.deltaPTS=Math.max(x,s.deltaPTS):s.deltaPTS=x,h=Math.max(m,c),m=Math.min(m,c),f=Math.min(f,s.startDTS),p=Math.min(d,o),d=Math.max(d,o),D=Math.max(D,s.endDTS)}s.duration=d-m;var g=m-s.start;s.appendedPTS=d,s.start=s.startPTS=m,s.maxStartPTS=h,s.startDTS=f,s.endPTS=d,s.minEndPTS=p,s.endDTS=D;var C=s.sn;if(!l||C<l.startSN||C>l.endSN)return 0;var _,z=C-l.startSN,Y=l.fragments;for(Y[z]=s,_=z;_>0;_--)P(Y[_],Y[_-1]);for(_=z;_<Y.length-1;_++)P(Y[_],Y[_+1]);return l.fragmentHint&&P(Y[Y.length-1],l.fragmentHint),l.PTSKnown=l.alignedSliding=!0,g}function b(l,s){for(var m=null,d=l.fragments,f=d.length-1;f>=0;f--){var D=d[f].initSegment;if(D){m=D;break}}l.fragmentHint&&delete l.fragmentHint.endPTS;var v=0,h;if(I(l,s,function(_,z){_.relurl&&(v=_.cc-z.cc),Object(H.isFiniteNumber)(_.startPTS)&&Object(H.isFiniteNumber)(_.endPTS)&&(z.start=z.startPTS=_.startPTS,z.startDTS=_.startDTS,z.appendedPTS=_.appendedPTS,z.maxStartPTS=_.maxStartPTS,z.endPTS=_.endPTS,z.endDTS=_.endDTS,z.minEndPTS=_.minEndPTS,z.duration=_.endPTS-_.startPTS,z.duration&&(h=z),s.PTSKnown=s.alignedSliding=!0),z.elementaryStreams=_.elementaryStreams,z.loader=_.loader,z.stats=_.stats,z.urlId=_.urlId,_.initSegment&&(z.initSegment=_.initSegment,m=_.initSegment)}),m){var p=s.fragmentHint?s.fragments.concat(s.fragmentHint):s.fragments;p.forEach(function(_){var z;(!_.initSegment||_.initSegment.relurl===((z=m)===null||z===void 0?void 0:z.relurl))&&(_.initSegment=m)})}if(s.skippedSegments&&(s.deltaUpdateFailed=s.fragments.some(function(_){return!_}),s.deltaUpdateFailed)){A.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var c=s.skippedSegments;c--;)s.fragments.shift();s.startSN=s.fragments[0].sn,s.startCC=s.fragments[0].cc}var o=s.fragments;if(v){A.logger.warn("discontinuity sliding from playlist, take drift into account");for(var x=0;x<o.length;x++)o[x].cc+=v}s.skippedSegments&&(s.startCC=s.fragments[0].cc),E(l.partList,s.partList,function(_,z){z.elementaryStreams=_.elementaryStreams,z.stats=_.stats}),h?L(s,h,h.startPTS,h.endPTS,h.startDTS,h.endDTS):w(l,s),o.length&&(s.totalduration=s.edge-o[0].start),s.driftStartTime=l.driftStartTime,s.driftStart=l.driftStart;var g=s.advancedDateTime;if(s.advanced&&g){var C=s.edge;s.driftStart||(s.driftStartTime=g,s.driftStart=C),s.driftEndTime=g,s.driftEnd=C}else s.driftEndTime=l.driftEndTime,s.driftEnd=l.driftEnd,s.advancedDateTime=l.advancedDateTime}function E(l,s,m){if(l&&s)for(var d=0,f=0,D=l.length;f<=D;f++){var v=l[f],h=s[f+d];v&&h&&v.index===h.index&&v.fragment.sn===h.fragment.sn?m(v,h):d--}}function I(l,s,m){for(var d=s.skippedSegments,f=Math.max(l.startSN,s.startSN)-s.startSN,D=(l.fragmentHint?1:0)+(d?s.endSN:Math.min(l.endSN,s.endSN))-s.startSN,v=s.startSN-l.startSN,h=s.fragmentHint?s.fragments.concat(s.fragmentHint):s.fragments,p=l.fragmentHint?l.fragments.concat(l.fragmentHint):l.fragments,c=f;c<=D;c++){var o=p[v+c],x=h[c];d&&!x&&c<d&&(x=s.fragments[c]=o),o&&x&&m(o,x)}}function w(l,s){var m=s.startSN+s.skippedSegments-l.startSN,d=l.fragments;if(m<0||m>=d.length)return;T(s,d[m].start)}function T(l,s){if(s){for(var m=l.fragments,d=l.skippedSegments;d<m.length;d++)m[d].start+=s;l.fragmentHint&&(l.fragmentHint.start+=s)}}function y(l,s){var m=1e3*l.levelTargetDuration,d=m/2,f=l.age,D=f>0&&f<m*3,v=s.loading.end-s.loading.start,h,p=l.availabilityDelay;if(l.updated===!1)if(D){var c=333*l.misses;h=Math.max(Math.min(d,v*2),c),l.availabilityDelay=(l.availabilityDelay||0)+h}else h=d;else D?(p=Math.min(p||m/2,f),l.availabilityDelay=p,h=p+m-f):h=m-v;return Math.round(h)}function u(l,s,m){if(!l||!l.details)return null;var d=l.details,f=d.fragments[s-d.startSN];return f||(f=d.fragmentHint,f&&f.sn===s?f:s<d.startSN&&m&&m.sn===s?m:null)}function a(l,s,m){if(!l||!l.details)return null;var d=l.details.partList;if(d)for(var f=d.length;f--;){var D=d[f];if(D.index===m&&D.fragment.sn===s)return D}return null}},"./src/controller/stream-controller.ts":function(de,V,O){"use strict";O.r(V),O.d(V,"default",function(){return d});var H=O("./src/polyfills/number.ts"),A=O("./src/controller/base-stream-controller.ts"),k=O("./src/is-supported.ts"),W=O("./src/events.ts"),U=O("./src/utils/buffer-helper.ts"),P=O("./src/controller/fragment-tracker.ts"),L=O("./src/types/loader.ts"),b=O("./src/loader/fragment.ts"),E=O("./src/demux/transmuxer-interface.ts"),I=O("./src/types/transmuxer.ts"),w=O("./src/controller/gap-controller.ts"),T=O("./src/errors.ts"),y=O("./src/utils/logger.ts");function u(f,D){for(var v=0;v<D.length;v++){var h=D[v];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(f,h.key,h)}}function a(f,D,v){return D&&u(f.prototype,D),v&&u(f,v),f}function l(f,D){f.prototype=Object.create(D.prototype),f.prototype.constructor=f,s(f,D)}function s(f,D){return s=Object.setPrototypeOf||function(h,p){return h.__proto__=p,h},s(f,D)}var m=100,d=function(f){l(D,f);function D(h,p){var c;return c=f.call(this,h,p,"[stream-controller]")||this,c.audioCodecSwap=!1,c.gapController=null,c.level=-1,c._forceStartLoad=!1,c.altAudio=!1,c.audioOnly=!1,c.fragPlaying=null,c.onvplaying=null,c.onvseeked=null,c.fragLastKbps=0,c.stalled=!1,c.couldBacktrack=!1,c.audioCodecSwitch=!1,c.videoBuffer=null,c._registerListeners(),c}var v=D.prototype;return v._registerListeners=function(){var p=this.hls;p.on(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),p.on(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),p.on(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),p.on(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),p.on(W.Events.LEVEL_LOADING,this.onLevelLoading,this),p.on(W.Events.LEVEL_LOADED,this.onLevelLoaded,this),p.on(W.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),p.on(W.Events.ERROR,this.onError,this),p.on(W.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),p.on(W.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),p.on(W.Events.BUFFER_CREATED,this.onBufferCreated,this),p.on(W.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),p.on(W.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),p.on(W.Events.FRAG_BUFFERED,this.onFragBuffered,this)},v._unregisterListeners=function(){var p=this.hls;p.off(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),p.off(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),p.off(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),p.off(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),p.off(W.Events.LEVEL_LOADED,this.onLevelLoaded,this),p.off(W.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),p.off(W.Events.ERROR,this.onError,this),p.off(W.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),p.off(W.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),p.off(W.Events.BUFFER_CREATED,this.onBufferCreated,this),p.off(W.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),p.off(W.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),p.off(W.Events.FRAG_BUFFERED,this.onFragBuffered,this)},v.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},v.startLoad=function(p){if(this.levels){var c=this.lastCurrentTime,o=this.hls;if(this.stopLoad(),this.setInterval(m),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}c>0&&p===-1&&(this.log("Override startPosition with lastCurrentTime @"+c.toFixed(3)),p=c),this.state=A.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=p,this.tick()}else this._forceStartLoad=!0,this.state=A.State.STOPPED},v.stopLoad=function(){this._forceStartLoad=!1,f.prototype.stopLoad.call(this)},v.doTick=function(){switch(this.state){case A.State.IDLE:this.doTickIdle();break;case A.State.WAITING_LEVEL:{var p,c=this.levels,o=this.level,x=c==null||((p=c[o])===null||p===void 0)?void 0:p.details;if(x&&(!x.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(x))break;this.state=A.State.IDLE;break}break}case A.State.FRAG_LOADING_WAITING_RETRY:{var g,C=self.performance.now(),_=this.retryDate;(!_||C>=_||(g=this.media)!==null&&g!==void 0&&g.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=A.State.IDLE)}break;default:break}this.onTickEnd()},v.onTickEnd=function(){f.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},v.doTickIdle=function(){var p,c,o=this.hls,x=this.levelLastLoaded,g=this.levels,C=this.media,_=o.config,z=o.nextLoadLevel;if(x===null||!C&&(this.startFragRequested||!_.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!g||!g[z])return;var Y=g[z];this.level=o.nextLoadLevel=z;var oe=Y.details;if(!oe||this.state===A.State.WAITING_LEVEL||oe.live&&this.levelLastLoaded!==z){this.state=A.State.WAITING_LEVEL;return}var G=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:C,L.PlaylistLevelType.MAIN);if(G===null)return;var j=G.len,se=this.getMaxBufferLength(Y.maxBitrate);if(j>=se)return;if(this._streamEnded(G,oe)){var fe={};this.altAudio&&(fe.type="video"),this.hls.trigger(W.Events.BUFFER_EOS,fe),this.state=A.State.ENDED;return}var Se=G.end,ke=this.getNextFragment(Se,oe);if(this.couldBacktrack&&!this.fragPrevious&&ke&&ke.sn!=="initSegment"){var Je=ke.sn-oe.startSN;Je>1&&(ke=oe.fragments[Je-1],this.fragmentTracker.removeFragment(ke))}if(ke&&this.fragmentTracker.getState(ke)===P.FragmentState.OK&&this.nextLoadPosition>Se){var _e=this.audioOnly&&!this.altAudio?b.ElementaryStreamTypes.AUDIO:b.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(C,_e,L.PlaylistLevelType.MAIN),ke=this.getNextFragment(this.nextLoadPosition,oe)}if(!ke)return;ke.initSegment&&!ke.initSegment.data&&!this.bitrateTest&&(ke=ke.initSegment),((p=ke.decryptdata)===null||p===void 0?void 0:p.keyFormat)==="identity"&&!((c=ke.decryptdata)!==null&&c!==void 0&&c.key)?this.loadKey(ke,oe):this.loadFragment(ke,oe,Se)},v.loadFragment=function(p,c,o){var x,g=this.fragmentTracker.getState(p);if(this.fragCurrent=p,g===P.FragmentState.BACKTRACKED){var C=this.fragmentTracker.getBacktrackData(p);if(C){this._handleFragmentLoadProgress(C),this._handleFragmentLoadComplete(C);return}else g=P.FragmentState.NOT_LOADED}g===P.FragmentState.NOT_LOADED||g===P.FragmentState.PARTIAL?p.sn==="initSegment"?this._loadInitSegment(p):this.bitrateTest?(p.bitrateTest=!0,this.log("Fragment "+p.sn+" of level "+p.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(p)):(this.startFragRequested=!0,f.prototype.loadFragment.call(this,p,c,o)):g===P.FragmentState.APPENDING?this.reduceMaxBufferLength(p.duration)&&this.fragmentTracker.removeFragment(p):((x=this.media)===null||x===void 0?void 0:x.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},v.getAppendedFrag=function(p){var c=this.fragmentTracker.getAppendedFrag(p,L.PlaylistLevelType.MAIN);return c&&"fragment"in c?c.fragment:c},v.getBufferedFrag=function(p){return this.fragmentTracker.getBufferedFrag(p,L.PlaylistLevelType.MAIN)},v.followingBufferedFrag=function(p){return p?this.getBufferedFrag(p.end+.5):null},v.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},v.nextLevelSwitch=function(){var p=this.levels,c=this.media;if(c!=null&&c.readyState){var o,x=this.getAppendedFrag(c.currentTime);if(x&&x.start>1&&this.flushMainBuffer(0,x.start-1),!c.paused&&p){var g=this.hls.nextLoadLevel,C=p[g],_=this.fragLastKbps;_&&this.fragCurrent?o=this.fragCurrent.duration*C.maxBitrate/(1e3*_)+1:o=0}else o=0;var z=this.getBufferedFrag(c.currentTime+o);if(z){var Y=this.followingBufferedFrag(z);if(Y){this.abortCurrentFrag();var oe=Y.maxStartPTS?Y.maxStartPTS:Y.start,G=Y.duration,j=Math.max(z.end,oe+Math.min(Math.max(G-this.config.maxFragLookUpTolerance,G*.5),G*.75));this.flushMainBuffer(j,Number.POSITIVE_INFINITY)}}}},v.abortCurrentFrag=function(){var p=this.fragCurrent;this.fragCurrent=null,p!=null&&p.loader&&p.loader.abort(),this.state===A.State.KEY_LOADING&&(this.state=A.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},v.flushMainBuffer=function(p,c){f.prototype.flushMainBuffer.call(this,p,c,this.altAudio?"video":null)},v.onMediaAttached=function(p,c){f.prototype.onMediaAttached.call(this,p,c);var o=c.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 w.default(this.config,o,this.fragmentTracker,this.hls)},v.onMediaDetaching=function(){var p=this.media;p&&(p.removeEventListener("playing",this.onvplaying),p.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),f.prototype.onMediaDetaching.call(this)},v.onMediaPlaying=function(){this.tick()},v.onMediaSeeked=function(){var p=this.media,c=p?p.currentTime:null;Object(H.isFiniteNumber)(c)&&this.log("Media seeked to "+c.toFixed(3)),this.tick()},v.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(W.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},v.onManifestParsed=function(p,c){var o=!1,x=!1,g;c.levels.forEach(function(C){g=C.audioCodec,g&&(g.indexOf("mp4a.40.2")!==-1&&(o=!0),g.indexOf("mp4a.40.5")!==-1&&(x=!0))}),this.audioCodecSwitch=o&&x&&!Object(k.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=c.levels,this.startFragRequested=!1},v.onLevelLoading=function(p,c){var o=this.levels;if(!o||this.state!==A.State.IDLE)return;var x=o[c.level];(!x.details||x.details.live&&this.levelLastLoaded!==c.level||this.waitForCdnTuneIn(x.details))&&(this.state=A.State.WAITING_LEVEL)},v.onLevelLoaded=function(p,c){var o,x=this.levels,g=c.level,C=c.details,_=C.totalduration;if(!x){this.warn("Levels were reset while loading level "+g);return}this.log("Level "+g+" loaded ["+C.startSN+","+C.endSN+"], cc ["+C.startCC+", "+C.endCC+"] duration:"+_);var z=this.fragCurrent;z&&(this.state===A.State.FRAG_LOADING||this.state===A.State.FRAG_LOADING_WAITING_RETRY)&&(z.level!==c.level&&z.loader&&(this.state=A.State.IDLE,z.loader.abort()));var Y=x[g],oe=0;if(C.live||(o=Y.details)!==null&&o!==void 0&&o.live){if(C.fragments[0]||(C.deltaUpdateFailed=!0),C.deltaUpdateFailed)return;oe=this.alignPlaylists(C,Y.details)}if(Y.details=C,this.levelLastLoaded=g,this.hls.trigger(W.Events.LEVEL_UPDATED,{details:C,level:g}),this.state===A.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(C))return;this.state=A.State.IDLE}this.startFragRequested?C.live&&this.synchronizeToLiveEdge(C):this.setStartPosition(C,oe),this.tick()},v._handleFragmentLoadProgress=function(p){var c,o=p.frag,x=p.part,g=p.payload,C=this.levels;if(!C){this.warn("Levels were reset while fragment load was in progress. Fragment "+o.sn+" of level "+o.level+" will not be buffered");return}var _=C[o.level],z=_.details;if(!z){this.warn("Dropping fragment "+o.sn+" of level "+o.level+" after level details were reset");return}var Y=_.videoCodec,oe=z.PTSKnown||!z.live,G=(c=o.initSegment)===null||c===void 0?void 0:c.data,j=this._getAudioCodec(_),se=this.transmuxer=this.transmuxer||new E.default(this.hls,L.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),fe=x?x.index:-1,Se=fe!==-1,ke=new I.ChunkMetadata(o.level,o.sn,o.stats.chunkCount,g.byteLength,fe,Se),Je=this.initPTS[o.cc];se.push(g,G,j,Y,o,x,z.totalduration,oe,ke,Je)},v.onAudioTrackSwitching=function(p,c){var o=this.altAudio,x=!!c.url,g=c.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 C=this.fragCurrent;C!=null&&C.loader&&(this.log("Switching to main audio track, cancel main fragment load"),C.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var _=this.hls;o&&_.trigger(W.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),_.trigger(W.Events.AUDIO_TRACK_SWITCHED,{id:g})}},v.onAudioTrackSwitched=function(p,c){var o=c.id,x=!!this.hls.audioTracks[o].url;if(x){var g=this.videoBuffer;g&&this.mediaBuffer!==g&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=g)}this.altAudio=x,this.tick()},v.onBufferCreated=function(p,c){var o=c.tracks,x,g,C=!1;for(var _ in o){var z=o[_];if(z.id==="main"){if(g=_,x=z,_==="video"){var Y=o[_];Y&&(this.videoBuffer=Y.buffer)}}else C=!0}C&&x?(this.log("Alternate track found, use "+g+".buffered to schedule main fragment loading"),this.mediaBuffer=x.buffer):this.mediaBuffer=this.media},v.onFragBuffered=function(p,c){var o=c.frag,x=c.part;if(o&&o.type!==L.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===A.State.PARSED&&(this.state=A.State.IDLE);return}var g=x?x.stats:o.stats;this.fragLastKbps=Math.round(8*g.total/(g.buffering.end-g.loading.first)),o.sn!=="initSegment"&&(this.fragPrevious=o),this.fragBufferedComplete(o,x)},v.onError=function(p,c){switch(c.details){case T.ErrorDetails.FRAG_LOAD_ERROR:case T.ErrorDetails.FRAG_LOAD_TIMEOUT:case T.ErrorDetails.KEY_LOAD_ERROR:case T.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(L.PlaylistLevelType.MAIN,c);break;case T.ErrorDetails.LEVEL_LOAD_ERROR:case T.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==A.State.ERROR&&(c.fatal?(this.warn(""+c.details),this.state=A.State.ERROR):!c.levelRetry&&this.state===A.State.WAITING_LEVEL&&(this.state=A.State.IDLE));break;case T.ErrorDetails.BUFFER_FULL_ERROR:if(c.parent==="main"&&(this.state===A.State.PARSING||this.state===A.State.PARSED)){var o=!0,x=this.getFwdBufferInfo(this.media,L.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}},v.checkBuffer=function(){var p=this.media,c=this.gapController;if(!p||!c||!p.readyState)return;var o=U.BufferHelper.getBuffered(p);!this.loadedmetadata&&o.length?(this.loadedmetadata=!0,this.seekToStartPos()):c.poll(this.lastCurrentTime),this.lastCurrentTime=p.currentTime},v.onFragLoadEmergencyAborted=function(){this.state=A.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},v.onBufferFlushed=function(p,c){var o=c.type;if(o!==b.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var x=(o===b.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(x,o,L.PlaylistLevelType.MAIN)}},v.onLevelsUpdated=function(p,c){this.levels=c.levels},v.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},v.seekToStartPos=function(){var p=this.media,c=p.currentTime,o=this.startPosition;if(o>=0&&c<o){if(p.seeking){y.logger.log("could not seek to "+o+", already seeking at "+c);return}var x=U.BufferHelper.getBuffered(p),g=x.length?x.start(0):0,C=g-o;C>0&&(C<this.config.maxBufferHole||C<this.config.maxFragLookUpTolerance)&&(y.logger.log("adjusting start position by "+C+" to match buffer start"),o+=C,this.startPosition=o),this.log("seek to target start position "+o+" from current time "+c),p.currentTime=o}},v._getAudioCodec=function(p){var c=this.config.defaultAudioCodec||p.audioCodec;return this.audioCodecSwap&&c&&(this.log("Swapping audio codec"),c.indexOf("mp4a.40.5")!==-1?c="mp4a.40.2":c="mp4a.40.5"),c},v._loadBitrateTestFrag=function(p){var c=this;this._doFragLoad(p).then(function(o){var x=c.hls;if(!o||x.nextLoadLevel||c.fragContextChanged(p))return;c.fragLoadError=0,c.state=A.State.IDLE,c.startFragRequested=!1,c.bitrateTest=!1;var g=p.stats;g.parsing.start=g.parsing.end=g.buffering.start=g.buffering.end=self.performance.now(),x.trigger(W.Events.FRAG_LOADED,o)})},v._handleTransmuxComplete=function(p){var c,o="main",x=this.hls,g=p.remuxResult,C=p.chunkMeta,_=this.getCurrentContext(C);if(!_){this.warn("The loading context changed while buffering fragment "+C.sn+" of level "+C.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(C.level);return}var z=_.frag,Y=_.part,oe=_.level,G=g.video,j=g.text,se=g.id3,fe=g.initSegment,Se=this.altAudio?void 0:g.audio;if(this.fragContextChanged(z))return;if(this.state=A.State.PARSING,fe){fe.tracks&&(this._bufferInitSegment(oe,fe.tracks,z,C),x.trigger(W.Events.FRAG_PARSING_INIT_SEGMENT,{frag:z,id:o,tracks:fe.tracks}));var ke=fe.initPTS,Je=fe.timescale;Object(H.isFiniteNumber)(ke)&&(this.initPTS[z.cc]=ke,x.trigger(W.Events.INIT_PTS_FOUND,{frag:z,id:o,initPTS:ke,timescale:Je}))}if(G&&g.independent!==!1){if(oe.details){var _e=G.startPTS,Qe=G.endPTS,Ue=G.startDTS,Fe=G.endDTS;if(Y)Y.elementaryStreams[G.type]={startPTS:_e,endPTS:Qe,startDTS:Ue,endDTS:Fe};else if(G.firstKeyFrame&&G.independent&&(this.couldBacktrack=!0),G.dropped&&G.independent){var we=this.getLoadPosition()+this.config.maxBufferHole;if(we<_e){this.backtrack(z);return}z.setElementaryStreamInfo(G.type,z.start,Qe,z.start,Fe,!0)}z.setElementaryStreamInfo(G.type,_e,Qe,Ue,Fe),this.bufferFragmentData(G,z,Y,C)}}else if(g.independent===!1){this.backtrack(z);return}if(Se){var F=Se.startPTS,R=Se.endPTS,M=Se.startDTS,K=Se.endDTS;Y&&(Y.elementaryStreams[b.ElementaryStreamTypes.AUDIO]={startPTS:F,endPTS:R,startDTS:M,endDTS:K}),z.setElementaryStreamInfo(b.ElementaryStreamTypes.AUDIO,F,R,M,K),this.bufferFragmentData(Se,z,Y,C)}if(se!=null&&(c=se.samples)!==null&&c!==void 0&&c.length){var $={frag:z,id:o,samples:se.samples};x.trigger(W.Events.FRAG_PARSING_METADATA,$)}if(j){var B={frag:z,id:o,samples:j.samples};x.trigger(W.Events.FRAG_PARSING_USERDATA,B)}},v._bufferInitSegment=function(p,c,o,x){var g=this;if(this.state!==A.State.PARSING)return;this.audioOnly=!!c.audio&&!c.video,this.altAudio&&!this.audioOnly&&delete c.audio;var C=c.audio,_=c.video,z=c.audiovideo;if(C){var Y=p.audioCodec,oe=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(Y&&(Y.indexOf("mp4a.40.5")!==-1?Y="mp4a.40.2":Y="mp4a.40.5"),C.metadata.channelCount!==1&&oe.indexOf("firefox")===-1&&(Y="mp4a.40.5")),oe.indexOf("android")!==-1&&C.container!=="audio/mpeg"&&(Y="mp4a.40.2",this.log("Android: force audio codec to "+Y)),p.audioCodec&&p.audioCodec!==Y&&this.log('Swapping manifest audio codec "'+p.audioCodec+'" for "'+Y+'"'),C.levelCodec=Y,C.id="main",this.log("Init audio buffer, container:"+C.container+", codecs[selected/level/parsed]=["+(Y||"")+"/"+(p.audioCodec||"")+"/"+C.codec+"]")}_&&(_.levelCodec=p.videoCodec,_.id="main",this.log("Init video buffer, container:"+_.container+", codecs[level/parsed]=["+(p.videoCodec||"")+"/"+_.codec+"]")),z&&this.log("Init audiovideo buffer, container:"+z.container+", codecs[level/parsed]=["+(p.attrs.CODECS||"")+"/"+z.codec+"]"),this.hls.trigger(W.Events.BUFFER_CODECS,c),Object.keys(c).forEach(function(G){var j=c[G],se=j.initSegment;se!=null&&se.byteLength&&g.hls.trigger(W.Events.BUFFER_APPENDING,{type:G,data:se,frag:o,part:null,chunkMeta:x,parent:o.type})}),this.tick()},v.backtrack=function(p){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(p);var c=this.fragmentTracker.backtrack(p);this.fragPrevious=null,this.nextLoadPosition=p.start,c?this.resetFragmentLoading(p):this.state=A.State.BACKTRACKING},v.checkFragmentChanged=function(){var p=this.media,c=null;if(p&&p.readyState>1&&p.seeking===!1){var o=p.currentTime;if(U.BufferHelper.isBuffered(p,o)?c=this.getAppendedFrag(o):U.BufferHelper.isBuffered(p,o+.1)&&(c=this.getAppendedFrag(o+.1)),c){var x=this.fragPlaying,g=c.level;(!x||c.sn!==x.sn||x.level!==g||c.urlId!==x.urlId)&&(this.hls.trigger(W.Events.FRAG_CHANGED,{frag:c}),(!x||x.level!==g)&&this.hls.trigger(W.Events.LEVEL_SWITCHED,{level:g}),this.fragPlaying=c)}}},a(D,[{key:"nextLevel",get:function(){var p=this.nextBufferedFrag;return p?p.level:-1}},{key:"currentLevel",get:function(){var p=this.media;if(p){var c=this.getAppendedFrag(p.currentTime);if(c)return c.level}return-1}},{key:"nextBufferedFrag",get:function(){var p=this.media;if(p){var c=this.getAppendedFrag(p.currentTime);return this.followingBufferedFrag(c)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),D}(A.default)},"./src/controller/subtitle-stream-controller.ts":function(de,V,O){"use strict";O.r(V),O.d(V,"SubtitleStreamController",function(){return l});var H=O("./src/events.ts"),A=O("./src/utils/logger.ts"),k=O("./src/utils/buffer-helper.ts"),W=O("./src/controller/fragment-finders.ts"),U=O("./src/utils/discontinuities.ts"),P=O("./src/controller/level-helper.ts"),L=O("./src/controller/fragment-tracker.ts"),b=O("./src/controller/base-stream-controller.ts"),E=O("./src/types/loader.ts"),I=O("./src/types/level.ts");function w(s,m){for(var d=0;d<m.length;d++){var f=m[d];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(s,f.key,f)}}function T(s,m,d){return m&&w(s.prototype,m),d&&w(s,d),s}function y(s,m){s.prototype=Object.create(m.prototype),s.prototype.constructor=s,u(s,m)}function u(s,m){return u=Object.setPrototypeOf||function(f,D){return f.__proto__=D,f},u(s,m)}var a=500,l=function(s){y(m,s);function m(f,D){var v;return v=s.call(this,f,D,"[subtitle-stream-controller]")||this,v.levels=[],v.currentTrackId=-1,v.tracksBuffered=[],v.mainDetails=null,v._registerListeners(),v}var d=m.prototype;return d.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},d._registerListeners=function(){var D=this.hls;D.on(H.Events.MEDIA_ATTACHED,this.onMediaAttached,this),D.on(H.Events.MEDIA_DETACHING,this.onMediaDetaching,this),D.on(H.Events.MANIFEST_LOADING,this.onManifestLoading,this),D.on(H.Events.LEVEL_LOADED,this.onLevelLoaded,this),D.on(H.Events.ERROR,this.onError,this),D.on(H.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),D.on(H.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),D.on(H.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),D.on(H.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),D.on(H.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},d._unregisterListeners=function(){var D=this.hls;D.off(H.Events.MEDIA_ATTACHED,this.onMediaAttached,this),D.off(H.Events.MEDIA_DETACHING,this.onMediaDetaching,this),D.off(H.Events.MANIFEST_LOADING,this.onManifestLoading,this),D.off(H.Events.LEVEL_LOADED,this.onLevelLoaded,this),D.off(H.Events.ERROR,this.onError,this),D.off(H.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),D.off(H.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),D.off(H.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),D.off(H.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),D.off(H.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},d.startLoad=function(){this.stopLoad(),this.state=b.State.IDLE,this.setInterval(a),this.tick()},d.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},d.onLevelLoaded=function(D,v){this.mainDetails=v.details},d.onSubtitleFragProcessed=function(D,v){var h=v.frag,p=v.success;if(this.fragPrevious=h,this.state=b.State.IDLE,!p)return;var c=this.tracksBuffered[this.currentTrackId];if(!c)return;for(var o,x=h.start,g=0;g<c.length;g++)if(x>=c[g].start&&x<=c[g].end){o=c[g];break}var C=h.start+h.duration;o?o.end=C:(o={start:x,end:C},c.push(o)),this.fragmentTracker.fragBuffered(h)},d.onBufferFlushing=function(D,v){var h=v.startOffset,p=v.endOffset;if(h===0&&p!==Number.POSITIVE_INFINITY){var c=this.currentTrackId,o=this.levels;if(!o.length||!o[c]||!o[c].details)return;var x=o[c].details,g=x.targetduration,C=p-g;if(C<=0)return;v.endOffsetSubtitles=Math.max(0,C),this.tracksBuffered.forEach(function(_){for(var z=0;z<_.length;){if(_[z].end<=C){_.shift();continue}else if(_[z].start<C)_[z].start=C;else break;z++}}),this.fragmentTracker.removeFragmentsInRange(h,C,E.PlaylistLevelType.SUBTITLE)}},d.onError=function(D,v){var h,p=v.frag;if(!p||p.type!==E.PlaylistLevelType.SUBTITLE)return;(h=this.fragCurrent)!==null&&h!==void 0&&h.loader&&this.fragCurrent.loader.abort(),this.state=b.State.IDLE},d.onSubtitleTracksUpdated=function(D,v){var h=this,p=v.subtitleTracks;this.tracksBuffered=[],this.levels=p.map(function(c){return new I.Level(c)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(c){h.tracksBuffered[c.id]=[]}),this.mediaBuffer=null},d.onSubtitleTrackSwitch=function(D,v){if(this.currentTrackId=v.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var h=this.levels[this.currentTrackId];h!=null&&h.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,h&&this.setInterval(a)},d.onSubtitleTrackLoaded=function(D,v){var h,p=v.details,c=v.id,o=this.currentTrackId,x=this.levels;if(!x.length)return;var g=x[o];if(c>=x.length||c!==o||!g)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,p.live||(h=g.details)!==null&&h!==void 0&&h.live){var C=this.mainDetails;if(p.deltaUpdateFailed||!C)return;var _=C.fragments[0];if(!g.details)p.hasProgramDateTime&&C.hasProgramDateTime?Object(U.alignMediaPlaylistByPDT)(p,C):_&&Object(P.addSliding)(p,_.start);else{var z=this.alignPlaylists(p,g.details);z===0&&_&&Object(P.addSliding)(p,_.start)}}if(g.details=p,this.levelLastLoaded=c,this.tick(),p.live&&!this.fragCurrent&&this.media&&this.state===b.State.IDLE){var Y=Object(W.findFragmentByPTS)(null,p.fragments,this.media.currentTime,0);Y||(this.warn("Subtitle playlist not aligned with playback"),g.details=void 0)}},d._handleFragmentLoadComplete=function(D){var v=D.frag,h=D.payload,p=v.decryptdata,c=this.hls;if(this.fragContextChanged(v))return;if(h&&h.byteLength>0&&p&&p.key&&p.iv&&p.method==="AES-128"){var o=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(h),p.key.buffer,p.iv.buffer).then(function(x){var g=performance.now();c.trigger(H.Events.FRAG_DECRYPTED,{frag:v,payload:x,stats:{tstart:o,tdecrypt:g}})})}},d.doTick=function(){if(!this.media){this.state=b.State.IDLE;return}if(this.state===b.State.IDLE){var D,v=this.currentTrackId,h=this.levels;if(!h.length||!h[v]||!h[v].details)return;var p=h[v].details,c=p.targetduration,o=this.config,x=this.media,g=k.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,x.currentTime-c,o.maxBufferHole),C=g.end,_=g.len,z=this.getMaxBufferLength()+c;if(_>z)return;console.assert(p,"Subtitle track details are defined on idle subtitle stream controller tick");var Y=p.fragments,oe=Y.length,G=p.edge,j,se=this.fragPrevious;if(C<G){var fe=o.maxFragLookUpTolerance;se&&p.hasProgramDateTime&&(j=Object(W.findFragmentByPDT)(Y,se.endProgramDateTime,fe)),j||(j=Object(W.findFragmentByPTS)(se,Y,C,fe),!j&&se&&se.start<Y[0].start&&(j=Y[0]))}else j=Y[oe-1];(D=j)!==null&&D!==void 0&&D.encrypted?(A.logger.log("Loading key for "+j.sn),this.state=b.State.KEY_LOADING,this.hls.trigger(H.Events.KEY_LOADING,{frag:j})):j&&this.fragmentTracker.getState(j)===L.FragmentState.NOT_LOADED&&this.loadFragment(j,p,C)}},d.loadFragment=function(D,v,h){this.fragCurrent=D,s.prototype.loadFragment.call(this,D,v,h)},T(m,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),m}(b.default)},"./src/controller/subtitle-track-controller.ts":function(de,V,O){"use strict";O.r(V);var H=O("./src/events.ts"),A=O("./src/utils/texttrack-utils.ts"),k=O("./src/controller/base-playlist-controller.ts"),W=O("./src/types/loader.ts");function U(w,T){for(var y=0;y<T.length;y++){var u=T[y];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(w,u.key,u)}}function P(w,T,y){return T&&U(w.prototype,T),y&&U(w,y),w}function L(w,T){w.prototype=Object.create(T.prototype),w.prototype.constructor=w,b(w,T)}function b(w,T){return b=Object.setPrototypeOf||function(u,a){return u.__proto__=a,u},b(w,T)}var E=function(w){L(T,w);function T(u){var a;return a=w.call(this,u,"[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 y=T.prototype;return y.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,w.prototype.destroy.call(this)},y.registerListeners=function(){var a=this.hls;a.on(H.Events.MEDIA_ATTACHED,this.onMediaAttached,this),a.on(H.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.on(H.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.on(H.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.on(H.Events.LEVEL_LOADING,this.onLevelLoading,this),a.on(H.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),a.on(H.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),a.on(H.Events.ERROR,this.onError,this)},y.unregisterListeners=function(){var a=this.hls;a.off(H.Events.MEDIA_ATTACHED,this.onMediaAttached,this),a.off(H.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.off(H.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.off(H.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.off(H.Events.LEVEL_LOADING,this.onLevelLoading,this),a.off(H.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),a.off(H.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),a.off(H.Events.ERROR,this.onError,this)},y.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)},y.pollTrackChange=function(a){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,a)},y.onMediaDetaching=function(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);var a=I(this.media.textTracks);a.forEach(function(l){Object(A.clearCurrentCues)(l)}),this.subtitleTrack=-1,this.media=null},y.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},y.onManifestParsed=function(a,l){this.tracks=l.subtitleTracks},y.onSubtitleTrackLoaded=function(a,l){var s=l.id,m=l.details,d=this.trackId,f=this.tracksInGroup[d];if(!f){this.warn("Invalid subtitle track id "+s);return}var D=f.details;f.details=l.details,this.log("subtitle track "+s+" loaded ["+m.startSN+"-"+m.endSN+"]"),s===this.trackId&&(this.retryCount=0,this.playlistLoaded(s,l,D))},y.onLevelLoading=function(a,l){this.switchLevel(l.level)},y.onLevelSwitching=function(a,l){this.switchLevel(l.level)},y.switchLevel=function(a){var l=this.hls.levels[a];if(!(l!=null&&l.textGroupIds))return;var s=l.textGroupIds[l.urlId];if(this.groupId!==s){var m=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,d=this.tracks.filter(function(v){return!s||v.groupId===s});this.tracksInGroup=d;var f=this.findTrackId(m==null?void 0:m.name)||this.findTrackId();this.groupId=s;var D={subtitleTracks:d};this.log("Updating subtitle tracks, "+d.length+' track(s) found in "'+s+'" group-id'),this.hls.trigger(H.Events.SUBTITLE_TRACKS_UPDATED,D),f!==-1&&this.setSubtitleTrack(f,m)}},y.findTrackId=function(a){for(var l=this.tracksInGroup,s=0;s<l.length;s++){var m=l[s];if((!this.selectDefaultTrack||m.default)&&(!a||a===m.name))return m.id}return-1},y.onError=function(a,l){if(w.prototype.onError.call(this,a,l),l.fatal||!l.context)return;l.context.type===W.PlaylistContextType.SUBTITLE_TRACK&&l.context.id===this.trackId&&l.context.groupId===this.groupId&&this.retryLoadingOrFail(l)},y.loadPlaylist=function(a){var l=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(l)){var s=l.id,m=l.groupId,d=l.url;if(a)try{d=a.addDirectives(d)}catch(f){this.warn("Could not construct new URL with HLS Delivery Directives: "+f)}this.log("Loading subtitle playlist for id "+s),this.hls.trigger(H.Events.SUBTITLE_TRACK_LOADING,{url:d,id:s,groupId:m,deliveryDirectives:a||null})}},y.toggleTrackModes=function(a){var l=this,s=this.media,m=this.subtitleDisplay,d=this.trackId;if(!s)return;var f=I(s.textTracks),D=f.filter(function(p){return p.groupId===l.groupId});if(a===-1)[].slice.call(f).forEach(function(p){p.mode="disabled"});else{var v=D[d];v&&(v.mode="disabled")}var h=D[a];h&&(h.mode=m?"showing":"hidden")},y.setSubtitleTrack=function(a,l){var s,m=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=a;return}if(this.trackId!==a&&this.toggleTrackModes(a),this.trackId===a&&(a===-1||(s=m[a])!==null&&s!==void 0&&s.details)||a<-1||a>=m.length)return;this.clearTimer();var d=m[a];if(this.log("Switching to subtitle track "+a),this.trackId=a,d){var f=d.id,D=d.groupId,v=D===void 0?"":D,h=d.name,p=d.type,c=d.url;this.hls.trigger(H.Events.SUBTITLE_TRACK_SWITCH,{id:f,groupId:v,name:h,type:p,url:c});var o=this.switchParams(d.url,l==null?void 0:l.details);this.loadPlaylist(o)}else this.hls.trigger(H.Events.SUBTITLE_TRACK_SWITCH,{id:a})},y.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var a=-1,l=I(this.media.textTracks),s=0;s<l.length;s++)if(l[s].mode==="hidden")a=s;else if(l[s].mode==="showing"){a=s;break}this.subtitleTrack!==a&&(this.subtitleTrack=a)},P(T,[{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)}}]),T}(k.default);function I(w){for(var T=[],y=0;y<w.length;y++){var u=w[y];u.kind==="subtitles"&&u.label&&T.push(w[y])}return T}V.default=E},"./src/controller/timeline-controller.ts":function(de,V,O){"use strict";O.r(V),O.d(V,"TimelineController",function(){return I});var H=O("./src/polyfills/number.ts"),A=O("./src/events.ts"),k=O("./src/utils/cea-608-parser.ts"),W=O("./src/utils/output-filter.ts"),U=O("./src/utils/webvtt-parser.ts"),P=O("./src/utils/texttrack-utils.ts"),L=O("./src/utils/imsc1-ttml-parser.ts"),b=O("./src/types/loader.ts"),E=O("./src/utils/logger.ts"),I=function(){function u(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=y(),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 s=new W.default(this,"textTrack1"),m=new W.default(this,"textTrack2"),d=new W.default(this,"textTrack3"),f=new W.default(this,"textTrack4");this.cea608Parser1=new k.default(1,s,m),this.cea608Parser2=new k.default(3,d,f)}l.on(A.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),l.on(A.Events.MEDIA_DETACHING,this.onMediaDetaching,this),l.on(A.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.on(A.Events.MANIFEST_LOADED,this.onManifestLoaded,this),l.on(A.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),l.on(A.Events.FRAG_LOADING,this.onFragLoading,this),l.on(A.Events.FRAG_LOADED,this.onFragLoaded,this),l.on(A.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),l.on(A.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),l.on(A.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),l.on(A.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),l.on(A.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var a=u.prototype;return a.destroy=function(){var s=this.hls;s.off(A.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),s.off(A.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.off(A.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.off(A.Events.MANIFEST_LOADED,this.onManifestLoaded,this),s.off(A.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),s.off(A.Events.FRAG_LOADING,this.onFragLoading,this),s.off(A.Events.FRAG_LOADED,this.onFragLoaded,this),s.off(A.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),s.off(A.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),s.off(A.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),s.off(A.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),s.off(A.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},a.addCues=function(s,m,d,f,D){for(var v=!1,h=D.length;h--;){var p=D[h],c=T(p[0],p[1],m,d);if(c>=0&&(p[0]=Math.min(p[0],m),p[1]=Math.max(p[1],d),v=!0,c/(d-m)>.5))return}if(v||D.push([m,d]),this.config.renderTextTracksNatively){var o=this.captionsTracks[s];this.Cues.newCue(o,m,d,f)}else{var x=this.Cues.newCue(null,m,d,f);this.hls.trigger(A.Events.CUES_PARSED,{type:"captions",cues:x,track:s})}},a.onInitPtsFound=function(s,m){var d=this,f=m.frag,D=m.id,v=m.initPTS,h=m.timescale,p=this.unparsedVttFrags;D==="main"&&(this.initPTS[f.cc]=v,this.timescale[f.cc]=h),p.length&&(this.unparsedVttFrags=[],p.forEach(function(c){d.onFragLoaded(A.Events.FRAG_LOADED,c)}))},a.getExistingTrack=function(s){var m=this.media;if(m)for(var d=0;d<m.textTracks.length;d++){var f=m.textTracks[d];if(f[s])return f}return null},a.createCaptionsTrack=function(s){this.config.renderTextTracksNatively?this.createNativeTrack(s):this.createNonNativeTrack(s)},a.createNativeTrack=function(s){if(this.captionsTracks[s])return;var m=this.captionsProperties,d=this.captionsTracks,f=this.media,D=m[s],v=D.label,h=D.languageCode,p=this.getExistingTrack(s);if(p)d[s]=p,Object(P.clearCurrentCues)(d[s]),Object(P.sendAddTrackEvent)(d[s],f);else{var c=this.createTextTrack("captions",v,h);c&&(c[s]=!0,d[s]=c)}},a.createNonNativeTrack=function(s){if(this.nonNativeCaptionsTracks[s])return;var m=this.captionsProperties[s];if(!m)return;var d=m.label,f={_id:s,label:d,kind:"captions",default:m.media?!!m.media.default:!1,closedCaptions:m.media};this.nonNativeCaptionsTracks[s]=f,this.hls.trigger(A.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[f]})},a.createTextTrack=function(s,m,d){var f=this.media;return f?f.addTextTrack(s,m,d):void 0},a.onMediaAttaching=function(s,m){this.media=m.media,this._cleanTracks()},a.onMediaDetaching=function(){var s=this.captionsTracks;Object.keys(s).forEach(function(m){Object(P.clearCurrentCues)(s[m]),delete s[m]}),this.nonNativeCaptionsTracks={}},a.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=y(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.timescale=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())},a._cleanTracks=function(){var s=this.media;if(!s)return;var m=s.textTracks;if(m)for(var d=0;d<m.length;d++)Object(P.clearCurrentCues)(m[d])},a.onSubtitleTracksUpdated=function(s,m){var d=this;this.textTracks=[];var f=m.subtitleTracks||[],D=f.some(function(c){return c.textCodec===L.IMSC1_CODEC});if(this.config.enableWebVTT||D&&this.config.enableIMSC1){var v=this.tracks&&f&&this.tracks.length===f.length;if(this.tracks=f||[],this.config.renderTextTracksNatively){var h=this.media?this.media.textTracks:[];this.tracks.forEach(function(c,o){var x;if(o<h.length){for(var g=null,C=0;C<h.length;C++)if(w(h[C],c)){g=h[C];break}g&&(x=g)}x?Object(P.clearCurrentCues)(x):(x=d.createTextTrack("subtitles",c.name,c.lang),x&&(x.mode="disabled")),x&&(x.groupId=c.groupId,d.textTracks.push(x))})}else if(!v&&this.tracks&&this.tracks.length){var p=this.tracks.map(function(c){return{label:c.name,kind:c.type.toLowerCase(),default:c.default,subtitleTrack:c}});this.hls.trigger(A.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:p})}}},a.onManifestLoaded=function(s,m){var d=this;this.config.enableCEA708Captions&&m.captions&&m.captions.forEach(function(f){var D=/(?:CC|SERVICE)([1-4])/.exec(f.instreamId);if(!D)return;var v="textTrack"+D[1],h=d.captionsProperties[v];if(!h)return;h.label=f.name,f.lang&&(h.languageCode=f.lang),h.media=f})},a.onFragLoading=function(s,m){var d=this.cea608Parser1,f=this.cea608Parser2,D=this.lastSn,v=this.lastPartIndex;if(!this.enabled||!(d&&f))return;if(m.frag.type===b.PlaylistLevelType.MAIN){var h,p,c=m.frag.sn,o=(h=m==null||((p=m.part)===null||p===void 0)?void 0:p.index)!=null?h:-1;c===D+1||c===D&&o===v+1||(d.reset(),f.reset()),this.lastSn=c,this.lastPartIndex=o}},a.onFragLoaded=function(s,m){var d=m.frag,f=m.payload,D=this.initPTS,v=this.unparsedVttFrags;if(d.type===b.PlaylistLevelType.SUBTITLE)if(f.byteLength){if(!Object(H.isFiniteNumber)(D[d.cc])){v.push(m),D.length&&this.hls.trigger(A.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:d,error:new Error("Missing initial subtitle PTS")});return}var h=d.decryptdata;if(h==null||h.key==null||h.method!=="AES-128"){var p=this.tracks[d.level],c=this.vttCCs;c[d.cc]||(c[d.cc]={start:d.start,prevCC:this.prevCC,new:!0},this.prevCC=d.cc),p&&p.textCodec===L.IMSC1_CODEC?this._parseIMSC1(d,f):this._parseVTTs(d,f,c)}}else this.hls.trigger(A.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:d,error:new Error("Empty subtitle payload")})},a._parseIMSC1=function(s,m){var d=this,f=this.hls;Object(L.parseIMSC1)(m,this.initPTS[s.cc],this.timescale[s.cc],function(D){d._appendCues(D,s.level),f.trigger(A.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:s})},function(D){E.logger.log("Failed to parse IMSC1: "+D),f.trigger(A.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:s,error:D})})},a._parseVTTs=function(s,m,d){var f=this,D=this.hls;Object(U.parseWebVTT)(m,this.initPTS[s.cc],this.timescale[s.cc],d,s.cc,s.start,function(v){f._appendCues(v,s.level),D.trigger(A.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:s})},function(v){f._fallbackToIMSC1(s,m),E.logger.log("Failed to parse VTT cue: "+v),D.trigger(A.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:s,error:v})})},a._fallbackToIMSC1=function(s,m){var d=this,f=this.tracks[s.level];f.textCodec||Object(L.parseIMSC1)(m,this.initPTS[s.cc],this.timescale[s.cc],function(){f.textCodec=L.IMSC1_CODEC,d._parseIMSC1(s,m)},function(){f.textCodec="wvtt"})},a._appendCues=function(s,m){var d=this.hls;if(this.config.renderTextTracksNatively){var f=this.textTracks[m];if(f.mode==="disabled")return;s.forEach(function(h){return Object(P.addCueToTrack)(f,h)})}else{var D=this.tracks[m],v=D.default?"default":"subtitles"+m;d.trigger(A.Events.CUES_PARSED,{type:"subtitles",cues:s,track:v})}},a.onFragDecrypted=function(s,m){var d=m.frag;if(d.type===b.PlaylistLevelType.SUBTITLE){if(!Object(H.isFiniteNumber)(this.initPTS[d.cc])){this.unparsedVttFrags.push(m);return}this.onFragLoaded(A.Events.FRAG_LOADED,m)}},a.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},a.onFragParsingUserdata=function(s,m){var d=this.cea608Parser1,f=this.cea608Parser2;if(!this.enabled||!(d&&f))return;for(var D=0;D<m.samples.length;D++){var v=m.samples[D].bytes;if(v){var h=this.extractCea608Data(v);d.addData(m.samples[D].pts,h[0]),f.addData(m.samples[D].pts,h[1])}}},a.onBufferFlushing=function(s,m){var d=m.startOffset,f=m.endOffset,D=m.endOffsetSubtitles,v=m.type,h=this.media;if(!h||h.currentTime<f)return;if(!v||v==="video"){var p=this.captionsTracks;Object.keys(p).forEach(function(o){return Object(P.removeCuesInRange)(p[o],d,f)})}if(this.config.renderTextTracksNatively&&(d===0&&D!==void 0)){var c=this.textTracks;Object.keys(c).forEach(function(o){return Object(P.removeCuesInRange)(c[o],d,D)})}},a.extractCea608Data=function(s){for(var m=s[0]&31,d=2,f=[[],[]],D=0;D<m;D++){var v=s[d++],h=127&s[d++],p=127&s[d++],c=(4&v)!==0,o=3&v;if(h===0&&p===0)continue;c&&((o===0||o===1)&&(f[o].push(h),f[o].push(p)))}return f},u}();function w(u,a){return u&&u.label===a.name&&!(u.textTrack1||u.textTrack2)}function T(u,a,l,s){return Math.min(a,s)-Math.max(u,l)}function y(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(de,V,O){"use strict";O.r(V),O.d(V,"default",function(){return H});var H=function(){function A(W,U){this.subtle=void 0,this.aesIV=void 0,this.subtle=W,this.aesIV=U}var k=A.prototype;return k.decrypt=function(U,P){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},P,U)},A}()},"./src/crypt/aes-decryptor.ts":function(de,V,O){"use strict";O.r(V),O.d(V,"removePadding",function(){return A}),O.d(V,"default",function(){return k});var H=O("./src/utils/typed-array.ts");function A(W){var U=W.byteLength,P=U&&new DataView(W.buffer).getUint8(U-1);return P?Object(H.sliceUint8)(W,0,U-P):W}var k=function(){function W(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}var U=W.prototype;return U.uint8ArrayToUint32Array_=function(L){for(var b=new DataView(L),E=new Uint32Array(4),I=0;I<4;I++)E[I]=b.getUint32(I*4);return E},U.initTable=function(){var L=this.sBox,b=this.invSBox,E=this.subMix,I=E[0],w=E[1],T=E[2],y=E[3],u=this.invSubMix,a=u[0],l=u[1],s=u[2],m=u[3],d=new Uint32Array(256),f=0,D=0,v=0;for(v=0;v<256;v++)v<128?d[v]=v<<1:d[v]=v<<1^283;for(v=0;v<256;v++){var h=D^D<<1^D<<2^D<<3^D<<4;h=h>>>8^h&255^99,L[f]=h,b[h]=f;var p=d[f],c=d[p],o=d[c],x=d[h]*257^h*16843008;I[f]=x<<24|x>>>8,w[f]=x<<16|x>>>16,T[f]=x<<8|x>>>24,y[f]=x,x=o*16843009^c*65537^p*257^f*16843008,a[h]=x<<24|x>>>8,l[h]=x<<16|x>>>16,s[h]=x<<8|x>>>24,m[h]=x,f?(f=p^d[d[d[o^p]]],D^=d[d[D]]):f=D=1}},U.expandKey=function(L){for(var b=this.uint8ArrayToUint32Array_(L),E=!0,I=0;I<b.length&&E;)E=b[I]===this.key[I],I++;if(E)return;this.key=b;var w=this.keySize=b.length;if(w!==4&&w!==6&&w!==8)throw new Error("Invalid aes key size="+w);var T=this.ksRows=(w+6+1)*4,y,u,a=this.keySchedule=new Uint32Array(T),l=this.invKeySchedule=new Uint32Array(T),s=this.sBox,m=this.rcon,d=this.invSubMix,f=d[0],D=d[1],v=d[2],h=d[3],p,c;for(y=0;y<T;y++){if(y<w){p=a[y]=b[y];continue}c=p,y%w===0?(c=c<<8|c>>>24,c=s[c>>>24]<<24|s[c>>>16&255]<<16|s[c>>>8&255]<<8|s[c&255],c^=m[y/w|0]<<24):w>6&&y%w===4&&(c=s[c>>>24]<<24|s[c>>>16&255]<<16|s[c>>>8&255]<<8|s[c&255]),a[y]=p=(a[y-w]^c)>>>0}for(u=0;u<T;u++)y=T-u,u&3?c=a[y]:c=a[y-4],u<4||y<=4?l[u]=c:l[u]=f[s[c>>>24]]^D[s[c>>>16&255]]^v[s[c>>>8&255]]^h[s[c&255]],l[u]=l[u]>>>0},U.networkToHostOrderSwap=function(L){return L<<24|(L&65280)<<8|(L&16711680)>>8|L>>>24},U.decrypt=function(L,b,E){for(var I=this.keySize+6,w=this.invKeySchedule,T=this.invSBox,y=this.invSubMix,u=y[0],a=y[1],l=y[2],s=y[3],m=this.uint8ArrayToUint32Array_(E),d=m[0],f=m[1],D=m[2],v=m[3],h=new Int32Array(L),p=new Int32Array(h.length),c,o,x,g,C,_,z,Y,oe,G,j,se,fe,Se,ke=this.networkToHostOrderSwap;b<h.length;){for(oe=ke(h[b]),G=ke(h[b+1]),j=ke(h[b+2]),se=ke(h[b+3]),C=oe^w[0],_=se^w[1],z=j^w[2],Y=G^w[3],fe=4,Se=1;Se<I;Se++)c=u[C>>>24]^a[_>>16&255]^l[z>>8&255]^s[Y&255]^w[fe],o=u[_>>>24]^a[z>>16&255]^l[Y>>8&255]^s[C&255]^w[fe+1],x=u[z>>>24]^a[Y>>16&255]^l[C>>8&255]^s[_&255]^w[fe+2],g=u[Y>>>24]^a[C>>16&255]^l[_>>8&255]^s[z&255]^w[fe+3],C=c,_=o,z=x,Y=g,fe=fe+4;c=T[C>>>24]<<24^T[_>>16&255]<<16^T[z>>8&255]<<8^T[Y&255]^w[fe],o=T[_>>>24]<<24^T[z>>16&255]<<16^T[Y>>8&255]<<8^T[C&255]^w[fe+1],x=T[z>>>24]<<24^T[Y>>16&255]<<16^T[C>>8&255]<<8^T[_&255]^w[fe+2],g=T[Y>>>24]<<24^T[C>>16&255]<<16^T[_>>8&255]<<8^T[z&255]^w[fe+3],p[b]=ke(c^d),p[b+1]=ke(g^f),p[b+2]=ke(x^D),p[b+3]=ke(o^v),d=oe,f=G,D=j,v=se,b=b+4}return p.buffer},W}()},"./src/crypt/decrypter.ts":function(de,V,O){"use strict";O.r(V),O.d(V,"default",function(){return b});var H=O("./src/crypt/aes-crypto.ts"),A=O("./src/crypt/fast-aes-key.ts"),k=O("./src/crypt/aes-decryptor.ts"),W=O("./src/utils/logger.ts"),U=O("./src/utils/mp4-tools.ts"),P=O("./src/utils/typed-array.ts"),L=16,b=function(){function E(w,T,y){var u=y===void 0?{}:y,a=u.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=w,this.config=T,this.removePKCS7Padding=l,l)try{var s=self.crypto;s&&(this.subtle=s.subtle||s.webkitSubtle)}catch(m){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var I=E.prototype;return I.destroy=function(){this.observer=null},I.isSync=function(){return this.config.enableSoftwareAES},I.flush=function(){var T=this.currentResult;if(!T){this.reset();return}var y=new Uint8Array(T);return this.reset(),this.removePKCS7Padding?Object(k.removePadding)(y):y},I.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},I.decrypt=function(T,y,u,a){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(T),y,u);var l=this.flush();l&&a(l.buffer)}else this.webCryptoDecrypt(new Uint8Array(T),y,u).then(a)},I.softwareDecrypt=function(T,y,u){var a=this.currentIV,l=this.currentResult,s=this.remainderData;this.logOnce("JS AES decrypt"),s&&(T=Object(U.appendUint8Array)(s,T),this.remainderData=null);var m=this.getValidChunk(T);if(!m.length)return null;a&&(u=a);var d=this.softwareDecrypter;d||(d=this.softwareDecrypter=new k.default),d.expandKey(y);var f=l;return this.currentResult=d.decrypt(m.buffer,0,u),this.currentIV=Object(P.sliceUint8)(m,-16).buffer,f||null},I.webCryptoDecrypt=function(T,y,u){var a=this,l=this.subtle;return(this.key!==y||!this.fastAesKey)&&(this.key=y,this.fastAesKey=new A.default(l,y)),this.fastAesKey.expandKey().then(function(s){if(!l)return Promise.reject(new Error("web crypto not initialized"));var m=new H.default(l,u);return m.decrypt(T.buffer,s)}).catch(function(s){return a.onWebCryptoError(s,T,y,u)})},I.onWebCryptoError=function(T,y,u,a){return W.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",T),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(y,u,a)},I.getValidChunk=function(T){var y=T,u=T.length-T.length%L;return u!==T.length&&(y=Object(P.sliceUint8)(T,0,u),this.remainderData=Object(P.sliceUint8)(T,u)),y},I.logOnce=function(T){if(!this.logEnabled)return;W.logger.log("[decrypter.ts]: "+T),this.logEnabled=!1},E}()},"./src/crypt/fast-aes-key.ts":function(de,V,O){"use strict";O.r(V),O.d(V,"default",function(){return H});var H=function(){function A(W,U){this.subtle=void 0,this.key=void 0,this.subtle=W,this.key=U}var k=A.prototype;return k.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},A}()},"./src/demux/aacdemuxer.ts":function(de,V,O){"use strict";O.r(V);var H=O("./src/demux/base-audio-demuxer.ts"),A=O("./src/demux/adts.ts"),k=O("./src/utils/logger.ts"),W=O("./src/demux/id3.ts");function U(b,E){b.prototype=Object.create(E.prototype),b.prototype.constructor=b,P(b,E)}function P(b,E){return P=Object.setPrototypeOf||function(w,T){return w.__proto__=T,w},P(b,E)}var L=function(b){U(E,b);function E(w,T){var y;return y=b.call(this)||this,y.observer=void 0,y.config=void 0,y.observer=w,y.config=T,y}var I=E.prototype;return I.resetInitSegment=function(T,y,u){b.prototype.resetInitSegment.call(this,T,y,u),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:T,duration:u,inputTimeScale:9e4,dropped:0}},E.probe=function(T){if(!T)return!1;for(var y=W.getID3Data(T,0)||[],u=y.length,a=T.length;u<a;u++)if(A.probe(T,u))return k.logger.log("ADTS sync word found !"),!0;return!1},I.canParse=function(T,y){return A.canParse(T,y)},I.appendFrame=function(T,y,u){A.initTrackConfig(T,this.observer,y,u,T.manifestCodec);var a=A.appendFrame(T,y,u,this.initPTS,this.frameIndex);if(a&&a.missing===0)return a},E}(H.default);L.minProbeByteLength=9,V.default=L},"./src/demux/adts.ts":function(de,V,O){"use strict";O.r(V),O.d(V,"getAudioConfig",function(){return W}),O.d(V,"isHeaderPattern",function(){return U}),O.d(V,"getHeaderLength",function(){return P}),O.d(V,"getFullFrameLength",function(){return L}),O.d(V,"canGetFrameLength",function(){return b}),O.d(V,"isHeader",function(){return E}),O.d(V,"canParse",function(){return I}),O.d(V,"probe",function(){return w}),O.d(V,"initTrackConfig",function(){return T}),O.d(V,"getFrameDuration",function(){return y}),O.d(V,"parseFrameHeader",function(){return u}),O.d(V,"appendFrame",function(){return a});var H=O("./src/utils/logger.ts"),A=O("./src/errors.ts"),k=O("./src/events.ts");function W(l,s,m,d){var f,D,v,h,p=navigator.userAgent.toLowerCase(),c=d,o=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];f=((s[m+2]&192)>>>6)+1;var x=(s[m+2]&60)>>>2;if(x>o.length-1){l.trigger(k.Events.ERROR,{type:A.ErrorTypes.MEDIA_ERROR,details:A.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+x});return}return v=(s[m+2]&1)<<2,v|=(s[m+3]&192)>>>6,H.logger.log("manifest codec:"+d+", ADTS type:"+f+", samplingIndex:"+x),/firefox/i.test(p)?x>=6?(f=5,h=new Array(4),D=x-3):(f=2,h=new Array(2),D=x):p.indexOf("android")!==-1?(f=2,h=new Array(2),D=x):(f=5,h=new Array(4),d&&(d.indexOf("mp4a.40.29")!==-1||d.indexOf("mp4a.40.5")!==-1)||!d&&x>=6?D=x-3:((d&&d.indexOf("mp4a.40.2")!==-1&&(x>=6&&v===1||/vivaldi/i.test(p))||!d&&v===1)&&(f=2,h=new Array(2)),D=x)),h[0]=f<<3,h[0]|=(x&14)>>1,h[1]|=(x&1)<<7,h[1]|=v<<3,f===5&&(h[1]|=(D&14)>>1,h[2]=(D&1)<<7,h[2]|=2<<2,h[3]=0),{config:h,samplerate:o[x],channelCount:v,codec:"mp4a.40."+f,manifestCodec:c}}function U(l,s){return l[s]===255&&(l[s+1]&246)===240}function P(l,s){return l[s+1]&1?7:9}function L(l,s){return(l[s+3]&3)<<11|l[s+4]<<3|(l[s+5]&224)>>>5}function b(l,s){return s+5<l.length}function E(l,s){return s+1<l.length&&U(l,s)}function I(l,s){return b(l,s)&&U(l,s)&&L(l,s)<=l.length-s}function w(l,s){if(E(l,s)){var m=P(l,s);if(s+m>=l.length)return!1;var d=L(l,s);if(d<=m)return!1;var f=s+d;return f===l.length||E(l,f)}return!1}function T(l,s,m,d,f){if(!l.samplerate){var D=W(s,m,d,f);if(!D)return;l.config=D.config,l.samplerate=D.samplerate,l.channelCount=D.channelCount,l.codec=D.codec,l.manifestCodec=D.manifestCodec,H.logger.log("parsed codec:"+l.codec+", rate:"+D.samplerate+", channels:"+D.channelCount)}}function y(l){return 1024*9e4/l}function u(l,s,m,d,f){var D=P(l,s),v=L(l,s);if(v-=D,v>0){var h=m+d*f;return{headerLength:D,frameLength:v,stamp:h}}}function a(l,s,m,d,f){var D=y(l.samplerate),v=u(s,m,d,f,D);if(v){var h=v.frameLength,p=v.headerLength,c=v.stamp,o=p+h,x=Math.max(0,m+o-s.length),g;x?(g=new Uint8Array(o-p),g.set(s.subarray(m+p,s.length),0)):g=s.subarray(m+p,m+o);var C={unit:g,pts:c};return x||l.samples.push(C),{sample:C,length:o,missing:x}}}},"./src/demux/base-audio-demuxer.ts":function(de,V,O){"use strict";O.r(V),O.d(V,"initPTSFn",function(){return L});var H=O("./src/polyfills/number.ts"),A=O("./src/demux/id3.ts"),k=O("./src/demux/dummy-demuxed-track.ts"),W=O("./src/utils/mp4-tools.ts"),U=O("./src/utils/typed-array.ts"),P=function(){function b(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var E=b.prototype;return E.resetInitSegment=function(w,T,y){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},E.resetTimeStamp=function(){},E.resetContiguity=function(){},E.canParse=function(w,T){return!1},E.appendFrame=function(w,T,y){},E.demux=function(w,T){this.cachedData&&(w=Object(W.appendUint8Array)(this.cachedData,w),this.cachedData=null);var y=A.getID3Data(w,0),u=y?y.length:0,a,l,s=this._audioTrack,m=this._id3Track,d=y?A.getTimeStamp(y):void 0,f=w.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=L(d,T)),y&&y.length>0&&m.samples.push({pts:this.initPTS,dts:this.initPTS,data:y}),l=this.initPTS;u<f;){if(this.canParse(w,u)){var D=this.appendFrame(s,w,u);D?(this.frameIndex++,l=D.sample.pts,u+=D.length,a=u):u=f}else A.canParse(w,u)?(y=A.getID3Data(w,u),m.samples.push({pts:l,dts:l,data:y}),u+=y.length,a=u):u++;if(u===f&&a!==f){var v=Object(U.sliceUint8)(w,a);this.cachedData?this.cachedData=Object(W.appendUint8Array)(this.cachedData,v):this.cachedData=v}}return{audioTrack:s,avcTrack:Object(k.dummyTrack)(),id3Track:m,textTrack:Object(k.dummyTrack)()}},E.demuxSampleAes=function(w,T,y){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},E.flush=function(w){var T=this.cachedData;return T&&(this.cachedData=null,this.demux(T,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(k.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(k.dummyTrack)()}},E.destroy=function(){},b}(),L=function(E,I){return Object(H.isFiniteNumber)(E)?E*90:I*9e4};V.default=P},"./src/demux/chunk-cache.ts":function(de,V,O){"use strict";O.r(V),O.d(V,"default",function(){return H});var H=function(){function k(){this.chunks=[],this.dataLength=0}var W=k.prototype;return W.push=function(P){this.chunks.push(P),this.dataLength+=P.length},W.flush=function(){var P=this.chunks,L=this.dataLength,b;if(P.length)P.length===1?b=P[0]:b=A(P,L);else return new Uint8Array(0);return this.reset(),b},W.reset=function(){this.chunks.length=0,this.dataLength=0},k}();function A(k,W){for(var U=new Uint8Array(W),P=0,L=0;L<k.length;L++){var b=k[L];U.set(b,P),P+=b.length}return U}},"./src/demux/dummy-demuxed-track.ts":function(de,V,O){"use strict";O.r(V),O.d(V,"dummyTrack",function(){return H});function H(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(de,V,O){"use strict";O.r(V);var H=O("./src/utils/logger.ts"),A=function(){function k(U){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=U,this.bytesAvailable=U.byteLength,this.word=0,this.bitsAvailable=0}var W=k.prototype;return W.loadWord=function(){var P=this.data,L=this.bytesAvailable,b=P.byteLength-L,E=new Uint8Array(4),I=Math.min(4,L);if(I===0)throw new Error("no bytes available");E.set(P.subarray(b,b+I)),this.word=new DataView(E.buffer).getUint32(0),this.bitsAvailable=I*8,this.bytesAvailable-=I},W.skipBits=function(P){var L;this.bitsAvailable>P?(this.word<<=P,this.bitsAvailable-=P):(P-=this.bitsAvailable,L=P>>3,P-=L>>3,this.bytesAvailable-=L,this.loadWord(),this.word<<=P,this.bitsAvailable-=P)},W.readBits=function(P){var L=Math.min(this.bitsAvailable,P),b=this.word>>>32-L;return P>32&&H.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=L,this.bitsAvailable>0?this.word<<=L:this.bytesAvailable>0&&this.loadWord(),L=P-L,L>0&&this.bitsAvailable?b<<L|this.readBits(L):b},W.skipLZ=function(){var P;for(P=0;P<this.bitsAvailable;++P)if((this.word&2147483648>>>P)!==0)return this.word<<=P,this.bitsAvailable-=P,P;return this.loadWord(),P+this.skipLZ()},W.skipUEG=function(){this.skipBits(1+this.skipLZ())},W.skipEG=function(){this.skipBits(1+this.skipLZ())},W.readUEG=function(){var P=this.skipLZ();return this.readBits(P+1)-1},W.readEG=function(){var P=this.readUEG();return 1&P?1+P>>>1:-1*(P>>>1)},W.readBoolean=function(){return this.readBits(1)===1},W.readUByte=function(){return this.readBits(8)},W.readUShort=function(){return this.readBits(16)},W.readUInt=function(){return this.readBits(32)},W.skipScalingList=function(P){for(var L=8,b=8,E,I=0;I<P;I++)b!==0&&(E=this.readEG(),b=(L+E+256)%256),L=b===0?L:b},W.readSPS=function(){var P=0,L=0,b=0,E=0,I,w,T,y=this.readUByte.bind(this),u=this.readBits.bind(this),a=this.readUEG.bind(this),l=this.readBoolean.bind(this),s=this.skipBits.bind(this),m=this.skipEG.bind(this),d=this.skipUEG.bind(this),f=this.skipScalingList.bind(this);y();var D=y();if(u(5),s(3),y(),d(),D===100||D===110||D===122||D===244||D===44||D===83||D===86||D===118||D===128){var v=a();if(v===3&&s(1),d(),d(),s(1),l())for(w=v!==3?8:12,T=0;T<w;T++)l()&&(T<6?f(16):f(64))}d();var h=a();if(h===0)a();else if(h===1)for(s(1),m(),m(),I=a(),T=0;T<I;T++)m();d(),s(1);var p=a(),c=a(),o=u(1);o===0&&s(1),s(1),l()&&(P=a(),L=a(),b=a(),E=a());var x=[1,1];if(l()&&l()){var g=y();switch(g){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=[y()<<8|y(),y()<<8|y()];break}}}return{width:Math.ceil((p+1)*16-P*2-L*2),height:(2-o)*(c+1)*16-(o?2:4)*(b+E),pixelRatio:x}},W.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},k}();V.default=A},"./src/demux/id3.ts":function(de,V,O){"use strict";O.r(V),O.d(V,"isHeader",function(){return H}),O.d(V,"isFooter",function(){return A}),O.d(V,"getID3Data",function(){return k}),O.d(V,"canParse",function(){return U}),O.d(V,"getTimeStamp",function(){return P}),O.d(V,"isTimeStampFrame",function(){return L}),O.d(V,"getID3Frames",function(){return E}),O.d(V,"decodeFrame",function(){return I}),O.d(V,"utf8ArrayToStr",function(){return a}),O.d(V,"testables",function(){return l});var H=function(f,D){return D+10<=f.length&&(f[D]===73&&f[D+1]===68&&f[D+2]===51&&(f[D+3]<255&&f[D+4]<255&&(f[D+6]<128&&f[D+7]<128&&f[D+8]<128&&f[D+9]<128)))},A=function(f,D){return D+10<=f.length&&(f[D]===51&&f[D+1]===68&&f[D+2]===73&&(f[D+3]<255&&f[D+4]<255&&(f[D+6]<128&&f[D+7]<128&&f[D+8]<128&&f[D+9]<128)))},k=function(f,D){for(var v=D,h=0;H(f,D);){h+=10;var p=W(f,D+6);h+=p,A(f,D+10)&&(h+=10),D+=h}return h>0?f.subarray(v,v+h):void 0},W=function(f,D){var v=0;return v=(f[D]&127)<<21,v|=(f[D+1]&127)<<14,v|=(f[D+2]&127)<<7,v|=f[D+3]&127,v},U=function(f,D){return H(f,D)&&W(f,D+6)+10<=f.length-D},P=function(f){for(var D=E(f),v=0;v<D.length;v++){var h=D[v];if(L(h))return u(h)}return},L=function(f){return f&&f.key==="PRIV"&&f.info==="com.apple.streaming.transportStreamTimestamp"},b=function(f){var D=String.fromCharCode(f[0],f[1],f[2],f[3]),v=W(f,4),h=10;return{type:D,size:v,data:f.subarray(h,h+v)}},E=function(f){for(var D=0,v=[];H(f,D);){var h=W(f,D+6);D+=10;for(var p=D+h;D+8<p;){var c=b(f.subarray(D)),o=I(c);o&&v.push(o),D+=c.size+10}A(f,D)&&(D+=10)}return v},I=function(f){return f.type==="PRIV"?w(f):f.type[0]==="W"?y(f):T(f)},w=function(f){if(f.size<2)return;var D=a(f.data,!0),v=new Uint8Array(f.data.subarray(D.length+1));return{key:f.type,info:D,data:v.buffer}},T=function(f){if(f.size<2)return;if(f.type==="TXXX"){var D=1,v=a(f.data.subarray(D),!0);D+=v.length+1;var h=a(f.data.subarray(D));return{key:f.type,info:v,data:h}}var p=a(f.data.subarray(1));return{key:f.type,data:p}},y=function(f){if(f.type==="WXXX"){if(f.size<2)return;var D=1,v=a(f.data.subarray(D),!0);D+=v.length+1;var h=a(f.data.subarray(D));return{key:f.type,info:v,data:h}}var p=a(f.data);return{key:f.type,data:p}},u=function(f){if(f.data.byteLength===8){var D=new Uint8Array(f.data),v=D[3]&1,h=(D[4]<<23)+(D[5]<<15)+(D[6]<<7)+D[7];return h/=45,v&&(h+=4772185884e-2),Math.round(h)}return},a=function(f,D){D===void 0&&(D=!1);var v=m();if(v){var h=v.decode(f);if(D){var p=h.indexOf("\0");return p!==-1?h.substring(0,p):h}return h.replace(/\0/g,"")}for(var c=f.length,o,x,g,C="",_=0;_<c;){if(o=f[_++],o===0&&D)return C;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:C+=String.fromCharCode(o);break;case 12:case 13:x=f[_++],C+=String.fromCharCode((o&31)<<6|x&63);break;case 14:x=f[_++],g=f[_++],C+=String.fromCharCode((o&15)<<12|(x&63)<<6|(g&63)<<0);break;default:}}return C},l={decodeTextFrame:T},s;function m(){return!s&&typeof self.TextDecoder!="undefined"&&(s=new self.TextDecoder("utf-8")),s}},"./src/demux/mp3demuxer.ts":function(de,V,O){"use strict";O.r(V);var H=O("./src/demux/base-audio-demuxer.ts"),A=O("./src/demux/id3.ts"),k=O("./src/utils/logger.ts"),W=O("./src/demux/mpegaudio.ts");function U(b,E){b.prototype=Object.create(E.prototype),b.prototype.constructor=b,P(b,E)}function P(b,E){return P=Object.setPrototypeOf||function(w,T){return w.__proto__=T,w},P(b,E)}var L=function(b){U(E,b);function E(){return b.apply(this,arguments)||this}var I=E.prototype;return I.resetInitSegment=function(T,y,u){b.prototype.resetInitSegment.call(this,T,y,u),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:T,duration:u,inputTimeScale:9e4,dropped:0}},E.probe=function(T){if(!T)return!1;for(var y=A.getID3Data(T,0)||[],u=y.length,a=T.length;u<a;u++)if(W.probe(T,u))return k.logger.log("MPEG Audio sync word found !"),!0;return!1},I.canParse=function(T,y){return W.canParse(T,y)},I.appendFrame=function(T,y,u){return this.initPTS===null?void 0:W.appendFrame(T,y,u,this.initPTS,this.frameIndex)},E}(H.default);L.minProbeByteLength=4,V.default=L},"./src/demux/mp4demuxer.ts":function(de,V,O){"use strict";O.r(V);var H=O("./src/utils/mp4-tools.ts"),A=O("./src/demux/dummy-demuxed-track.ts"),k=function(){function W(P,L){this.remainderData=null,this.config=void 0,this.config=L}var U=W.prototype;return U.resetTimeStamp=function(){},U.resetInitSegment=function(){},U.resetContiguity=function(){},W.probe=function(L){return Object(H.findBox)({data:L,start:0,end:Math.min(L.length,16384)},["moof"]).length>0},U.demux=function(L){var b=L,E=Object(A.dummyTrack)();if(this.config.progressive){this.remainderData&&(b=Object(H.appendUint8Array)(this.remainderData,L));var I=Object(H.segmentValidRange)(b);this.remainderData=I.remainder,E.samples=I.valid||new Uint8Array}else E.samples=b;return{audioTrack:Object(A.dummyTrack)(),avcTrack:E,id3Track:Object(A.dummyTrack)(),textTrack:Object(A.dummyTrack)()}},U.flush=function(){var L=Object(A.dummyTrack)();return L.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(A.dummyTrack)(),avcTrack:L,id3Track:Object(A.dummyTrack)(),textTrack:Object(A.dummyTrack)()}},U.demuxSampleAes=function(L,b,E){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},U.destroy=function(){},W}();k.minProbeByteLength=1024,V.default=k},"./src/demux/mpegaudio.ts":function(de,V,O){"use strict";O.r(V),O.d(V,"appendFrame",function(){return P}),O.d(V,"parseHeader",function(){return L}),O.d(V,"isHeaderPattern",function(){return b}),O.d(V,"isHeader",function(){return E}),O.d(V,"canParse",function(){return I}),O.d(V,"probe",function(){return w});var H=null,A=[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],k=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],W=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],U=[0,1,1,4];function P(T,y,u,a,l){if(u+24>y.length)return;var s=L(y,u);if(s&&u+s.frameLength<=y.length){var m=s.samplesPerFrame*9e4/s.sampleRate,d=a+l*m,f={unit:y.subarray(u,u+s.frameLength),pts:d,dts:d};return T.config=[],T.channelCount=s.channelCount,T.samplerate=s.sampleRate,T.samples.push(f),{sample:f,length:s.frameLength,missing:0}}}function L(T,y){var u=T[y+1]>>3&3,a=T[y+1]>>1&3,l=T[y+2]>>4&15,s=T[y+2]>>2&3;if(u!==1&&l!==0&&l!==15&&s!==3){var m=T[y+2]>>1&1,d=T[y+3]>>6,f=u===3?3-a:a===3?3:4,D=A[f*14+l-1]*1e3,v=u===3?0:u===2?1:2,h=k[v*3+s],p=d===3?1:2,c=W[u][a],o=U[a],x=c*8*o,g=Math.floor(c*D/h+m)*o;if(H===null){var C=navigator.userAgent||"",_=C.match(/Chrome\/(\d+)/i);H=_?parseInt(_[1]):0}var z=!!H&&H<=87;return z&&a===2&&D>=224e3&&d===0&&(T[y+3]=T[y+3]|128),{sampleRate:h,channelCount:p,frameLength:g,samplesPerFrame:x}}}function b(T,y){return T[y]===255&&(T[y+1]&224)===224&&(T[y+1]&6)!==0}function E(T,y){return y+1<T.length&&b(T,y)}function I(T,y){var u=4;return b(T,y)&&u<=T.length-y}function w(T,y){if(y+1<T.length&&b(T,y)){var u=4,a=L(T,y),l=u;a!=null&&a.frameLength&&(l=a.frameLength);var s=y+l;return s===T.length||E(T,s)}return!1}},"./src/demux/sample-aes.ts":function(de,V,O){"use strict";O.r(V);var H=O("./src/crypt/decrypter.ts"),A=O("./src/demux/tsdemuxer.ts"),k=function(){function W(P,L,b){this.keyData=void 0,this.decrypter=void 0,this.keyData=b,this.decrypter=new H.default(P,L,{removePKCS7Padding:!1})}var U=W.prototype;return U.decryptBuffer=function(L,b){this.decrypter.decrypt(L,this.keyData.key.buffer,this.keyData.iv.buffer,b)},U.decryptAacSample=function(L,b,E,I){var w=L[b].unit,T=w.subarray(16,w.length-w.length%16),y=T.buffer.slice(T.byteOffset,T.byteOffset+T.length),u=this;this.decryptBuffer(y,function(a){var l=new Uint8Array(a);w.set(l,16),I||u.decryptAacSamples(L,b+1,E)})},U.decryptAacSamples=function(L,b,E){for(;;b++){if(b>=L.length){E();return}if(L[b].unit.length<32)continue;var I=this.decrypter.isSync();if(this.decryptAacSample(L,b,E,I),!I)return}},U.getAvcEncryptedData=function(L){for(var b=Math.floor((L.length-48)/160)*16+16,E=new Int8Array(b),I=0,w=32;w<=L.length-16;w+=160,I+=16)E.set(L.subarray(w,w+16),I);return E},U.getAvcDecryptedUnit=function(L,b){for(var E=new Uint8Array(b),I=0,w=32;w<=L.length-16;w+=160,I+=16)L.set(E.subarray(I,I+16),w);return L},U.decryptAvcSample=function(L,b,E,I,w,T){var y=Object(A.discardEPB)(w.data),u=this.getAvcEncryptedData(y),a=this;this.decryptBuffer(u.buffer,function(l){w.data=a.getAvcDecryptedUnit(y,l),T||a.decryptAvcSamples(L,b,E+1,I)})},U.decryptAvcSamples=function(L,b,E,I){if(L instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;b++,E=0){if(b>=L.length){I();return}for(var w=L[b].units;!(E>=w.length);E++){var T=w[E];if(T.data.length<=48||T.type!==1&&T.type!==5)continue;var y=this.decrypter.isSync();if(this.decryptAvcSample(L,b,E,I,T,y),!y)return}}},W}();V.default=k},"./src/demux/transmuxer-interface.ts":function(de,V,O){"use strict";O.r(V),O.d(V,"default",function(){return w});var H=O("./node_modules/webworkify-webpack/index.js"),A=O.n(H),k=O("./src/events.ts"),W=O("./src/demux/transmuxer.ts"),U=O("./src/utils/logger.ts"),P=O("./src/errors.ts"),L=O("./src/utils/mediasource-helper.ts"),b=O("./node_modules/eventemitter3/index.js"),E=O.n(b),I=Object(L.getMediaSource)()||{isTypeSupported:function(){return!1}},w=function(){function T(u,a,l,s){var m=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=u,this.id=a,this.onTransmuxComplete=l,this.onFlush=s;var d=u.config,f=function(c,o){o=o||{},o.frag=m.frag,o.id=m.id,u.trigger(c,o)};this.observer=new b.EventEmitter,this.observer.on(k.Events.FRAG_DECRYPTED,f),this.observer.on(k.Events.ERROR,f);var D={mp4:I.isTypeSupported("video/mp4"),mpeg:I.isTypeSupported("audio/mpeg"),mp3:I.isTypeSupported('audio/mp4; codecs="mp3"')},v=navigator.vendor;if(d.enableWorker&&typeof Worker!="undefined"){U.logger.log("demuxing in webworker");var h;try{h=this.worker=H("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),h.addEventListener("message",this.onwmsg),h.onerror=function(p){u.trigger(k.Events.ERROR,{type:P.ErrorTypes.OTHER_ERROR,details:P.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(p.message+" ("+p.filename+":"+p.lineno+")")})},h.postMessage({cmd:"init",typeSupported:D,vendor:v,id:a,config:JSON.stringify(d)})}catch(p){U.logger.warn("Error in worker:",p),U.logger.error("Error while initializing DemuxerWorker, fallback to inline"),h&&self.URL.revokeObjectURL(h.objectURL),this.transmuxer=new W.default(this.observer,D,d,v,a),this.worker=null}}else this.transmuxer=new W.default(this.observer,D,d,v,a)}var y=T.prototype;return y.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 s=this.observer;s&&s.removeAllListeners(),this.observer=null},y.push=function(a,l,s,m,d,f,D,v,h,p){var c=this;h.transmuxing.start=self.performance.now();var o=this.transmuxer,x=this.worker,g=f?f.start:d.start,C=d.decryptdata,_=this.frag,z=!(_&&d.cc===_.cc),Y=!(_&&h.level===_.level),oe=_?h.sn-_.sn:-1,G=this.part?h.part-this.part.index:1,j=!Y&&(oe===1||oe===0&&G===1),se=self.performance.now();(Y||oe||d.stats.parsing.start===0)&&(d.stats.parsing.start=se),f&&(G||!j)&&(f.stats.parsing.start=se);var fe=new W.TransmuxState(z,j,v,Y,g);if(!j||z){U.logger.log("[transmuxer-interface, "+d.type+"]: Starting new transmux session for sn: "+h.sn+" p: "+h.part+" level: "+h.level+" id: "+h.id+`
discontinuity: `+z+`
trackSwitch: `+Y+`
contiguous: `+j+`
accurateTimeOffset: `+v+`
timeOffset: `+g);var Se=new W.TransmuxConfig(s,m,l,D,p);this.configureTransmuxer(Se)}if(this.frag=d,this.part=f,x)x.postMessage({cmd:"demux",data:a,decryptdata:C,chunkMeta:h,state:fe},a instanceof ArrayBuffer?[a]:[]);else if(o){var ke=o.push(a,C,h,fe);Object(W.isPromise)(ke)?ke.then(function(Je){c.handleTransmuxComplete(Je)}):this.handleTransmuxComplete(ke)}},y.flush=function(a){var l=this;a.transmuxing.start=self.performance.now();var s=this.transmuxer,m=this.worker;if(m)m.postMessage({cmd:"flush",chunkMeta:a});else if(s){var d=s.flush(a);Object(W.isPromise)(d)?d.then(function(f){l.handleFlushResult(f,a)}):this.handleFlushResult(d,a)}},y.handleFlushResult=function(a,l){var s=this;a.forEach(function(m){s.handleTransmuxComplete(m)}),this.onFlush(l)},y.onWorkerMessage=function(a){var l=a.data,s=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,s.trigger(l.event,l.data);break}}},y.configureTransmuxer=function(a){var l=this.worker,s=this.transmuxer;l?l.postMessage({cmd:"configure",config:a}):s&&s.configure(a)},y.handleTransmuxComplete=function(a){a.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(a)},T}()},"./src/demux/transmuxer-worker.ts":function(de,V,O){"use strict";O.r(V),O.d(V,"default",function(){return P});var H=O("./src/demux/transmuxer.ts"),A=O("./src/events.ts"),k=O("./src/utils/logger.ts"),W=O("./node_modules/eventemitter3/index.js"),U=O.n(W);function P(w){var T=new W.EventEmitter,y=function(a,l){w.postMessage({event:a,data:l})};T.on(A.Events.FRAG_DECRYPTED,y),T.on(A.Events.ERROR,y),w.addEventListener("message",function(u){var a=u.data;switch(a.cmd){case"init":{var l=JSON.parse(a.config);w.transmuxer=new H.default(T,a.typeSupported,l,a.vendor,a.id),Object(k.enableLogs)(l.debug),y("init",null);break}case"configure":{w.transmuxer.configure(a.config);break}case"demux":{var s=w.transmuxer.push(a.data,a.decryptdata,a.chunkMeta,a.state);Object(H.isPromise)(s)?s.then(function(f){L(w,f)}):L(w,s);break}case"flush":{var m=a.chunkMeta,d=w.transmuxer.flush(m);Object(H.isPromise)(d)?d.then(function(f){E(w,f,m)}):E(w,d,m);break}default:break}})}function L(w,T){if(I(T.remuxResult))return;var y=[],u=T.remuxResult,a=u.audio,l=u.video;a&&b(y,a),l&&b(y,l),w.postMessage({event:"transmuxComplete",data:T},y)}function b(w,T){T.data1&&w.push(T.data1.buffer),T.data2&&w.push(T.data2.buffer)}function E(w,T,y){T.forEach(function(u){L(w,u)}),w.postMessage({event:"flush",data:y})}function I(w){return!w.audio&&!w.video&&!w.text&&!w.id3&&!w.initSegment}},"./src/demux/transmuxer.ts":function(de,V,O){"use strict";O.r(V),O.d(V,"default",function(){return l}),O.d(V,"isPromise",function(){return d}),O.d(V,"TransmuxConfig",function(){return f}),O.d(V,"TransmuxState",function(){return D});var H=O("./src/events.ts"),A=O("./src/errors.ts"),k=O("./src/crypt/decrypter.ts"),W=O("./src/demux/aacdemuxer.ts"),U=O("./src/demux/mp4demuxer.ts"),P=O("./src/demux/tsdemuxer.ts"),L=O("./src/demux/mp3demuxer.ts"),b=O("./src/remux/mp4-remuxer.ts"),E=O("./src/remux/passthrough-remuxer.ts"),I=O("./src/demux/chunk-cache.ts"),w=O("./src/utils/mp4-tools.ts"),T=O("./src/utils/logger.ts"),y;try{y=self.performance.now.bind(self.performance)}catch(v){T.logger.debug("Unable to use Performance API on this environment"),y=self.Date.now}var u=[{demux:P.default,remux:b.default},{demux:U.default,remux:E.default},{demux:W.default,remux:b.default},{demux:L.default,remux:b.default}],a=1024;u.forEach(function(v){var h=v.demux;a=Math.max(a,h.minProbeByteLength)});var l=function(){function v(p,c,o,x,g){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 I.default,this.observer=p,this.typeSupported=c,this.config=o,this.vendor=x,this.id=g}var h=v.prototype;return h.configure=function(c){this.transmuxConfig=c,this.decrypter&&this.decrypter.reset()},h.push=function(c,o,x,g){var C=this,_=x.transmuxing;_.executeStart=y();var z=new Uint8Array(c),Y=this.cache,oe=this.config,G=this.currentTransmuxState,j=this.transmuxConfig;g&&(this.currentTransmuxState=g);var se=s(z,o);if(se&&se.method==="AES-128"){var fe=this.getDecrypter();if(oe.enableSoftwareAES){var Se=fe.softwareDecrypt(z,se.key.buffer,se.iv.buffer);if(!Se)return _.executeEnd=y(),m(x);z=new Uint8Array(Se)}else return this.decryptionPromise=fe.webCryptoDecrypt(z,se.key.buffer,se.iv.buffer).then(function(Oe){var je=C.push(Oe,null,x);return C.decryptionPromise=null,je}),this.decryptionPromise}var ke=g||G,Je=ke.contiguous,_e=ke.discontinuity,Qe=ke.trackSwitch,Ue=ke.accurateTimeOffset,Fe=ke.timeOffset,we=j.audioCodec,F=j.videoCodec,R=j.defaultInitPts,M=j.duration,K=j.initSegmentData;if((_e||Qe)&&this.resetInitSegment(K,we,F,M),_e&&this.resetInitialTimestamp(R),Je||this.resetContiguity(),this.needsProbing(z,_e,Qe)){if(Y.dataLength){var $=Y.flush();z=Object(w.appendUint8Array)($,z)}this.configureTransmuxer(z,j)}var B=this.transmux(z,se,Fe,Ue,x),ge=this.currentTransmuxState;return ge.contiguous=!0,ge.discontinuity=!1,ge.trackSwitch=!1,_.executeEnd=y(),B},h.flush=function(c){var o=this,x=c.transmuxing;x.executeStart=y();var g=this.decrypter,C=this.cache,_=this.currentTransmuxState,z=this.decryptionPromise;if(z)return z.then(function(){return o.flush(c)});var Y=[],oe=_.timeOffset;if(g){var G=g.flush();G&&Y.push(this.push(G,null,c))}var j=C.dataLength;C.reset();var se=this.demuxer,fe=this.remuxer;if(!se||!fe)return j>=a&&this.observer.emit(H.Events.ERROR,H.Events.ERROR,{type:A.ErrorTypes.MEDIA_ERROR,details:A.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),x.executeEnd=y(),[m(c)];var Se=se.flush(oe);return d(Se)?Se.then(function(ke){return o.flushRemux(Y,ke,c),Y}):(this.flushRemux(Y,Se,c),Y)},h.flushRemux=function(c,o,x){var g=o.audioTrack,C=o.avcTrack,_=o.id3Track,z=o.textTrack,Y=this.currentTransmuxState,oe=Y.accurateTimeOffset,G=Y.timeOffset;T.logger.log("[transmuxer.ts]: Flushed fragment "+x.sn+(x.part>-1?" p: "+x.part:"")+" of level "+x.level);var j=this.remuxer.remux(g,C,_,z,G,oe,!0,this.id);c.push({remuxResult:j,chunkMeta:x}),x.transmuxing.executeEnd=y()},h.resetInitialTimestamp=function(c){var o=this.demuxer,x=this.remuxer;if(!o||!x)return;o.resetTimeStamp(c),x.resetTimeStamp(c)},h.resetContiguity=function(){var c=this.demuxer,o=this.remuxer;if(!c||!o)return;c.resetContiguity(),o.resetNextTimestamp()},h.resetInitSegment=function(c,o,x,g){var C=this.demuxer,_=this.remuxer;if(!C||!_)return;C.resetInitSegment(o,x,g),_.resetInitSegment(c,o,x)},h.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},h.transmux=function(c,o,x,g,C){var _;return o&&o.method==="SAMPLE-AES"?_=this.transmuxSampleAes(c,o,x,g,C):_=this.transmuxUnencrypted(c,x,g,C),_},h.transmuxUnencrypted=function(c,o,x,g){var C=this.demuxer.demux(c,o,!1,!this.config.progressive),_=C.audioTrack,z=C.avcTrack,Y=C.id3Track,oe=C.textTrack,G=this.remuxer.remux(_,z,Y,oe,o,x,!1,this.id);return{remuxResult:G,chunkMeta:g}},h.transmuxSampleAes=function(c,o,x,g,C){var _=this;return this.demuxer.demuxSampleAes(c,o,x).then(function(z){var Y=_.remuxer.remux(z.audioTrack,z.avcTrack,z.id3Track,z.textTrack,x,g,!1,_.id);return{remuxResult:Y,chunkMeta:C}})},h.configureTransmuxer=function(c,o){for(var x=this.config,g=this.observer,C=this.typeSupported,_=this.vendor,z=o.audioCodec,Y=o.defaultInitPts,oe=o.duration,G=o.initSegmentData,j=o.videoCodec,se,fe=0,Se=u.length;fe<Se;fe++)if(u[fe].demux.probe(c)){se=u[fe];break}se||(T.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),se={demux:U.default,remux:E.default});var ke=this.demuxer,Je=this.remuxer,_e=se.remux,Qe=se.demux;(!Je||!(Je instanceof _e))&&(this.remuxer=new _e(g,x,C,_)),(!ke||!(ke instanceof Qe))&&(this.demuxer=new Qe(g,x,C),this.probe=Qe.probe),this.resetInitSegment(G,z,j,oe),this.resetInitialTimestamp(Y)},h.needsProbing=function(c,o,x){return!this.demuxer||!this.remuxer||o||x},h.getDecrypter=function(){var c=this.decrypter;return c||(c=this.decrypter=new k.default(this.observer,this.config)),c},v}();function s(v,h){var p=null;return v.byteLength>0&&h!=null&&h.key!=null&&h.iv!==null&&h.method!=null&&(p=h),p}var m=function(h){return{remuxResult:{},chunkMeta:h}};function d(v){return"then"in v&&v.then instanceof Function}var f=function(h,p,c,o,x){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=h,this.videoCodec=p,this.initSegmentData=c,this.duration=o,this.defaultInitPts=x},D=function(h,p,c,o,x){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=h,this.contiguous=p,this.accurateTimeOffset=c,this.trackSwitch=o,this.timeOffset=x}},"./src/demux/tsdemuxer.ts":function(de,V,O){"use strict";O.r(V),O.d(V,"discardEPB",function(){return m});var H=O("./src/demux/adts.ts"),A=O("./src/demux/mpegaudio.ts"),k=O("./src/demux/exp-golomb.ts"),W=O("./src/demux/id3.ts"),U=O("./src/demux/sample-aes.ts"),P=O("./src/events.ts"),L=O("./src/utils/mp4-tools.ts"),b=O("./src/utils/logger.ts"),E=O("./src/errors.ts"),I={video:1,audio:2,id3:3,text:4},w=function(){function d(D,v,h){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=v,this.typeSupported=h}d.probe=function(v){var h=d.syncOffset(v);return h<0?!1:(h&&b.logger.warn("MPEG2-TS detected but first sync word found @ offset "+h+", junk ahead ?"),!0)},d.syncOffset=function(v){for(var h=Math.min(1e3,v.length-3*188),p=0;p<h;){if(v[p]===71&&v[p+188]===71&&v[p+2*188]===71)return p;p++}return-1},d.createTrack=function(v,h){return{container:v==="video"||v==="audio"?"video/mp2t":void 0,type:v,id:I[v],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:v==="audio"?h:void 0}};var f=d.prototype;return f.resetInitSegment=function(v,h,p){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=d.createTrack("video",p),this._audioTrack=d.createTrack("audio",p),this._id3Track=d.createTrack("id3",p),this._txtTrack=d.createTrack("text",p),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=v,this.videoCodec=h,this._duration=p},f.resetTimeStamp=function(){},f.resetContiguity=function(){var v=this._audioTrack,h=this._avcTrack,p=this._id3Track;v&&(v.pesData=null),h&&(h.pesData=null),p&&(p.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},f.demux=function(v,h,p,c){p===void 0&&(p=!1),c===void 0&&(c=!1),p||(this.sampleAes=null);var o,x=this._avcTrack,g=this._audioTrack,C=this._id3Track,_=x.pid,z=x.pesData,Y=g.pid,oe=C.pid,G=g.pesData,j=C.pesData,se=!1,fe=this.pmtParsed,Se=this._pmtId,ke=v.length;if(this.remainderData&&(v=Object(L.appendUint8Array)(this.remainderData,v),ke=v.length,this.remainderData=null),ke<188&&!c)return this.remainderData=v,{audioTrack:g,avcTrack:x,id3Track:C,textTrack:this._txtTrack};var Je=Math.max(0,d.syncOffset(v));ke-=(ke+Je)%188,ke<v.byteLength&&!c&&(this.remainderData=new Uint8Array(v.buffer,ke,v.buffer.byteLength-ke));for(var _e=Je;_e<ke;_e+=188)if(v[_e]===71){var Qe=!!(v[_e+1]&64),Ue=((v[_e+1]&31)<<8)+v[_e+2],Fe=(v[_e+3]&48)>>4,we=void 0;if(Fe>1){if(we=_e+5+v[_e+4],we===_e+188)continue}else we=_e+4;switch(Ue){case _:Qe&&(z&&(o=a(z))&&this.parseAVCPES(o,!1),z={data:[],size:0}),z&&(z.data.push(v.subarray(we,_e+188)),z.size+=_e+188-we);break;case Y:Qe&&(G&&(o=a(G))&&(g.isAAC?this.parseAACPES(o):this.parseMPEGPES(o)),G={data:[],size:0}),G&&(G.data.push(v.subarray(we,_e+188)),G.size+=_e+188-we);break;case oe:Qe&&(j&&(o=a(j))&&this.parseID3PES(o),j={data:[],size:0}),j&&(j.data.push(v.subarray(we,_e+188)),j.size+=_e+188-we);break;case 0:Qe&&(we+=v[we]+1),Se=this._pmtId=y(v,we);break;case Se:{Qe&&(we+=v[we]+1);var F=u(v,we,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,p);_=F.avc,_>0&&(x.pid=_),Y=F.audio,Y>0&&(g.pid=Y,g.isAAC=F.isAAC),oe=F.id3,oe>0&&(C.pid=oe),se&&!fe&&(b.logger.log("reparse from beginning"),se=!1,_e=Je-188),fe=this.pmtParsed=!0;break}case 17:case 8191:break;default:se=!0;break}}else this.observer.emit(P.Events.ERROR,P.Events.ERROR,{type:E.ErrorTypes.MEDIA_ERROR,details:E.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});x.pesData=z,g.pesData=G,C.pesData=j;var R={audioTrack:g,avcTrack:x,id3Track:C,textTrack:this._txtTrack};return c&&this.extractRemainingSamples(R),R},f.flush=function(){var v=this.remainderData;this.remainderData=null;var h;return v?h=this.demux(v,-1,!1,!0):h={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(h),this.sampleAes?this.decrypt(h,this.sampleAes):h},f.extractRemainingSamples=function(v){var h=v.audioTrack,p=v.avcTrack,c=v.id3Track,o=p.pesData,x=h.pesData,g=c.pesData,C;o&&(C=a(o))?(this.parseAVCPES(C,!0),p.pesData=null):p.pesData=o,x&&(C=a(x))?(h.isAAC?this.parseAACPES(C):this.parseMPEGPES(C),h.pesData=null):(x!=null&&x.size&&b.logger.log("last AAC PES packet truncated,might overlap between fragments"),h.pesData=x),g&&(C=a(g))?(this.parseID3PES(C),c.pesData=null):c.pesData=g},f.demuxSampleAes=function(v,h,p){var c=this.demux(v,p,!0,!this.config.progressive),o=this.sampleAes=new U.default(this.observer,this.config,h);return this.decrypt(c,o)},f.decrypt=function(v,h){return new Promise(function(p){var c=v.audioTrack,o=v.avcTrack;c.samples&&c.isAAC?h.decryptAacSamples(c.samples,0,function(){o.samples?h.decryptAvcSamples(o.samples,0,0,function(){p(v)}):p(v)}):o.samples&&h.decryptAvcSamples(o.samples,0,0,function(){p(v)})})},f.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},f.parseAVCPES=function(v,h){var p=this,c=this._avcTrack,o=this.parseAVCNALu(v.data),x=!1,g=this.avcSample,C,_=!1;v.data=null,g&&o.length&&!c.audFound&&(l(g,c),g=this.avcSample=T(!1,v.pts,v.dts,"")),o.forEach(function(z){switch(z.type){case 1:{C=!0,g||(g=p.avcSample=T(!0,v.pts,v.dts,"")),x&&(g.debug+="NDR "),g.frame=!0;var Y=z.data;if(_&&Y.length>4){var oe=new k.default(Y).readSliceType();(oe===2||oe===4||oe===7||oe===9)&&(g.key=!0)}break}case 5:C=!0,g||(g=p.avcSample=T(!0,v.pts,v.dts,"")),x&&(g.debug+="IDR "),g.key=!0,g.frame=!0;break;case 6:{C=!0,x&&g&&(g.debug+="SEI ");var G=new k.default(m(z.data));G.readUByte();for(var j=0,se=0,fe=!1,Se=0;!fe&&G.bytesAvailable>1;){j=0;do Se=G.readUByte(),j+=Se;while(Se===255);se=0;do Se=G.readUByte(),se+=Se;while(Se===255);if(j===4&&G.bytesAvailable!==0){fe=!0;var ke=G.readUByte();if(ke===181){var Je=G.readUShort();if(Je===49){var _e=G.readUInt();if(_e===1195456820){var Qe=G.readUByte();if(Qe===3){for(var Ue=G.readUByte(),Fe=G.readUByte(),we=31&Ue,F=[Ue,Fe],R=0;R<we;R++)F.push(G.readUByte()),F.push(G.readUByte()),F.push(G.readUByte());s(p._txtTrack.samples,{type:3,pts:v.pts,bytes:F})}}}}}else if(j===5&&G.bytesAvailable!==0){if(fe=!0,se>16){for(var M=[],K=0;K<16;K++)M.push(G.readUByte().toString(16)),(K===3||K===5||K===7||K===9)&&M.push("-");for(var $=se-16,B=new Uint8Array($),ge=0;ge<$;ge++)B[ge]=G.readUByte();s(p._txtTrack.samples,{pts:v.pts,payloadType:j,uuid:M.join(""),userData:Object(W.utf8ArrayToStr)(B),userDataBytes:B})}}else if(se<G.bytesAvailable)for(var Oe=0;Oe<se;Oe++)G.readUByte()}break}case 7:if(C=!0,_=!0,x&&g&&(g.debug+="SPS "),!c.sps){var je=new k.default(z.data),Ze=je.readSPS();c.width=Ze.width,c.height=Ze.height,c.pixelRatio=Ze.pixelRatio,c.sps=[z.data],c.duration=p._duration;for(var He=z.data.subarray(1,4),ze="avc1.",Xe=0;Xe<3;Xe++){var dt=He[Xe].toString(16);dt.length<2&&(dt="0"+dt),ze+=dt}c.codec=ze}break;case 8:C=!0,x&&g&&(g.debug+="PPS "),c.pps||(c.pps=[z.data]);break;case 9:C=!1,c.audFound=!0,g&&l(g,c),g=p.avcSample=T(!1,v.pts,v.dts,x?"AUD ":"");break;case 12:C=!1;break;default:C=!1,g&&(g.debug+="unknown NAL "+z.type+" ");break}if(g&&C){var ct=g.units;ct.push(z)}}),h&&g&&(l(g,c),this.avcSample=null)},f.getLastNalUnit=function(){var v,h=this.avcSample,p;if(!h||h.units.length===0){var c=this._avcTrack.samples;h=c[c.length-1]}if((v=h)!==null&&v!==void 0&&v.units){var o=h.units;p=o[o.length-1]}return p},f.parseAVCNALu=function(v){var h=v.byteLength,p=this._avcTrack,c=p.naluState||0,o=c,x=[],g=0,C,_,z,Y=-1,oe=0;for(c===-1&&(Y=0,oe=v[0]&31,c=0,g=1);g<h;){if(C=v[g++],!c){c=C?0:1;continue}if(c===1){c=C?0:2;continue}if(!C)c=3;else if(C===1){if(Y>=0){var G={data:v.subarray(Y,g-c-1),type:oe};x.push(G)}else{var j=this.getLastNalUnit();if(j&&(o&&g<=4-o&&(j.state&&(j.data=j.data.subarray(0,j.data.byteLength-o))),_=g-c-1,_>0)){var se=new Uint8Array(j.data.byteLength+_);se.set(j.data,0),se.set(v.subarray(0,_),j.data.byteLength),j.data=se,j.state=0}}g<h?(z=v[g]&31,Y=g,oe=z,c=0):c=-1}else c=0}if(Y>=0&&c>=0){var fe={data:v.subarray(Y,h),type:oe,state:c};x.push(fe)}if(x.length===0){var Se=this.getLastNalUnit();if(Se){var ke=new Uint8Array(Se.data.byteLength+v.byteLength);ke.set(Se.data,0),ke.set(v,Se.data.byteLength),Se.data=ke}}return p.naluState=c,x},f.parseAACPES=function(v){var h=0,p=this._audioTrack,c=this.aacOverFlow,o=v.data;if(c){this.aacOverFlow=null;var x=c.sample.unit.byteLength,g=Math.min(c.missing,x),C=x-g;c.sample.unit.set(o.subarray(0,g),C),p.samples.push(c.sample),h=c.missing}var _,z;for(_=h,z=o.length;_<z-1&&!H.isHeader(o,_);_++);if(_!==h){var Y,oe;if(_<z-1?(Y="AAC PES did not start with ADTS header,offset:"+_,oe=!1):(Y="no ADTS header found in AAC PES",oe=!0),b.logger.warn("parsing error:"+Y),this.observer.emit(P.Events.ERROR,P.Events.ERROR,{type:E.ErrorTypes.MEDIA_ERROR,details:E.ErrorDetails.FRAG_PARSING_ERROR,fatal:oe,reason:Y}),oe)return}H.initTrackConfig(p,this.observer,o,_,this.audioCodec);var G;if(v.pts!==void 0)G=v.pts;else if(c){var j=H.getFrameDuration(p.samplerate);G=c.sample.pts+j}else{b.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var se=0;_<z;)if(H.isHeader(o,_)){if(_+5<z){var fe=H.appendFrame(p,o,_,G,se);if(fe)if(fe.missing)this.aacOverFlow=fe;else{_+=fe.length,se++;continue}}break}else _++},f.parseMPEGPES=function(v){var h=v.data,p=h.length,c=0,o=0,x=v.pts;if(x===void 0){b.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;o<p;)if(A.isHeader(h,o)){var g=A.appendFrame(this._audioTrack,h,o,x,c);if(g)o+=g.length,c++;else break}else o++},f.parseID3PES=function(v){if(v.pts===void 0){b.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(v)},d}();w.minProbeByteLength=188;function T(d,f,D,v){return{key:d,frame:!1,pts:f,dts:D,units:[],debug:v,length:0}}function y(d,f){return(d[f+10]&31)<<8|d[f+11]}function u(d,f,D,v){var h={audio:-1,avc:-1,id3:-1,isAAC:!0},p=(d[f+1]&15)<<8|d[f+2],c=f+3+p-4,o=(d[f+10]&15)<<8|d[f+11];for(f+=12+o;f<c;){var x=(d[f+1]&31)<<8|d[f+2];switch(d[f]){case 207:if(!v){b.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:h.audio===-1&&(h.audio=x);break;case 21:h.id3===-1&&(h.id3=x);break;case 219:if(!v){b.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:h.avc===-1&&(h.avc=x);break;case 3:case 4:D?h.audio===-1&&(h.audio=x,h.isAAC=!1):b.logger.log("MPEG audio found, not supported in this browser");break;case 36:b.logger.warn("Unsupported HEVC stream type found");break;default:break}f+=((d[f+3]&15)<<8|d[f+4])+5}return h}function a(d){var f=0,D,v,h,p,c,o=d.data;if(!d||d.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 g=(D[0]<<16)+(D[1]<<8)+D[2];if(g===1){if(v=(D[4]<<8)+D[5],v&&v>d.size-6)return null;var C=D[7];C&192&&(p=(D[9]&14)*536870912+(D[10]&255)*4194304+(D[11]&254)*16384+(D[12]&255)*128+(D[13]&254)/2,C&64?(c=(D[14]&14)*536870912+(D[15]&255)*4194304+(D[16]&254)*16384+(D[17]&255)*128+(D[18]&254)/2,p-c>60*9e4&&(b.logger.warn(Math.round((p-c)/9e4)+"s delta between PTS and DTS, align them"),p=c)):c=p),h=D[8];var _=h+9;if(d.size<=_)return null;d.size-=_;for(var z=new Uint8Array(d.size),Y=0,oe=o.length;Y<oe;Y++){D=o[Y];var G=D.byteLength;if(_)if(_>G){_-=G;continue}else D=D.subarray(_),G-=_,_=0;z.set(D,f),f+=G}return v&&(v-=h+3),{data:z,pts:p,dts:c,len:v}}return null}function l(d,f){if(d.units.length&&d.frame){if(d.pts===void 0){var D=f.samples,v=D.length;if(v){var h=D[v-1];d.pts=h.pts,d.dts=h.dts}else{f.dropped++;return}}f.samples.push(d)}d.debug.length&&b.logger.log(d.pts+"/"+d.dts+":"+d.debug)}function s(d,f){var D=d.length;if(D>0){if(f.pts>=d[D-1].pts)d.push(f);else for(var v=D-1;v>=0;v--)if(f.pts<d[v].pts){d.splice(v,0,f);break}}else d.push(f)}function m(d){for(var f=d.byteLength,D=[],v=1;v<f-2;)d[v]===0&&d[v+1]===0&&d[v+2]===3?(D.push(v+2),v+=2):v++;if(D.length===0)return d;var h=f-D.length,p=new Uint8Array(h),c=0;for(v=0;v<h;c++,v++)c===D[0]&&(c++,D.shift()),p[v]=d[c];return p}V.default=w},"./src/errors.ts":function(de,V,O){"use strict";O.r(V),O.d(V,"ErrorTypes",function(){return H}),O.d(V,"ErrorDetails",function(){return A});var H;(function(k){k.NETWORK_ERROR="networkError",k.MEDIA_ERROR="mediaError",k.KEY_SYSTEM_ERROR="keySystemError",k.MUX_ERROR="muxError",k.OTHER_ERROR="otherError"})(H||(H={}));var A;(function(k){k.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",k.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",k.KEY_SYSTEM_NO_SESSION="keySystemNoSession",k.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",k.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",k.MANIFEST_LOAD_ERROR="manifestLoadError",k.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",k.MANIFEST_PARSING_ERROR="manifestParsingError",k.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",k.LEVEL_EMPTY_ERROR="levelEmptyError",k.LEVEL_LOAD_ERROR="levelLoadError",k.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",k.LEVEL_SWITCH_ERROR="levelSwitchError",k.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",k.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",k.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",k.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",k.FRAG_LOAD_ERROR="fragLoadError",k.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",k.FRAG_DECRYPT_ERROR="fragDecryptError",k.FRAG_PARSING_ERROR="fragParsingError",k.REMUX_ALLOC_ERROR="remuxAllocError",k.KEY_LOAD_ERROR="keyLoadError",k.KEY_LOAD_TIMEOUT="keyLoadTimeOut",k.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",k.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",k.BUFFER_APPEND_ERROR="bufferAppendError",k.BUFFER_APPENDING_ERROR="bufferAppendingError",k.BUFFER_STALLED_ERROR="bufferStalledError",k.BUFFER_FULL_ERROR="bufferFullError",k.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",k.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",k.INTERNAL_EXCEPTION="internalException",k.INTERNAL_ABORTED="aborted",k.UNKNOWN="unknown"})(A||(A={}))},"./src/events.ts":function(de,V,O){"use strict";O.r(V),O.d(V,"Events",function(){return H});var H;(function(A){A.MEDIA_ATTACHING="hlsMediaAttaching",A.MEDIA_ATTACHED="hlsMediaAttached",A.MEDIA_DETACHING="hlsMediaDetaching",A.MEDIA_DETACHED="hlsMediaDetached",A.BUFFER_RESET="hlsBufferReset",A.BUFFER_CODECS="hlsBufferCodecs",A.BUFFER_CREATED="hlsBufferCreated",A.BUFFER_APPENDING="hlsBufferAppending",A.BUFFER_APPENDED="hlsBufferAppended",A.BUFFER_EOS="hlsBufferEos",A.BUFFER_FLUSHING="hlsBufferFlushing",A.BUFFER_FLUSHED="hlsBufferFlushed",A.MANIFEST_LOADING="hlsManifestLoading",A.MANIFEST_LOADED="hlsManifestLoaded",A.MANIFEST_PARSED="hlsManifestParsed",A.LEVEL_SWITCHING="hlsLevelSwitching",A.LEVEL_SWITCHED="hlsLevelSwitched",A.LEVEL_LOADING="hlsLevelLoading",A.LEVEL_LOADED="hlsLevelLoaded",A.LEVEL_UPDATED="hlsLevelUpdated",A.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",A.LEVELS_UPDATED="hlsLevelsUpdated",A.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",A.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",A.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",A.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",A.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",A.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",A.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",A.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",A.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",A.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",A.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",A.CUES_PARSED="hlsCuesParsed",A.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",A.INIT_PTS_FOUND="hlsInitPtsFound",A.FRAG_LOADING="hlsFragLoading",A.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",A.FRAG_LOADED="hlsFragLoaded",A.FRAG_DECRYPTED="hlsFragDecrypted",A.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",A.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",A.FRAG_PARSING_METADATA="hlsFragParsingMetadata",A.FRAG_PARSED="hlsFragParsed",A.FRAG_BUFFERED="hlsFragBuffered",A.FRAG_CHANGED="hlsFragChanged",A.FPS_DROP="hlsFpsDrop",A.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",A.ERROR="hlsError",A.DESTROYING="hlsDestroying",A.KEY_LOADING="hlsKeyLoading",A.KEY_LOADED="hlsKeyLoaded",A.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",A.BACK_BUFFER_REACHED="hlsBackBufferReached"})(H||(H={}))},"./src/hls.ts":function(de,V,O){"use strict";O.r(V),O.d(V,"default",function(){return d});var H=O("./node_modules/url-toolkit/src/url-toolkit.js"),A=O.n(H),k=O("./src/loader/playlist-loader.ts"),W=O("./src/loader/key-loader.ts"),U=O("./src/controller/id3-track-controller.ts"),P=O("./src/controller/latency-controller.ts"),L=O("./src/controller/level-controller.ts"),b=O("./src/controller/fragment-tracker.ts"),E=O("./src/controller/stream-controller.ts"),I=O("./src/is-supported.ts"),w=O("./src/utils/logger.ts"),T=O("./src/config.ts"),y=O("./node_modules/eventemitter3/index.js"),u=O.n(y),a=O("./src/events.ts"),l=O("./src/errors.ts");function s(f,D){for(var v=0;v<D.length;v++){var h=D[v];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(f,h.key,h)}}function m(f,D,v){return D&&s(f.prototype,D),v&&s(f,v),f}var d=function(){f.isSupported=function(){return Object(I.isSupported)()};function f(v){v===void 0&&(v={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new y.EventEmitter,this._autoLevelCapping=void 0,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null;var h=this.config=Object(T.mergeConfig)(f.DefaultConfig,v);this.userConfig=v,Object(w.enableLogs)(h.debug),this._autoLevelCapping=-1,h.progressive&&Object(T.enableStreamingMode)(h);var p=h.abrController,c=h.bufferController,o=h.capLevelController,x=h.fpsController,g=this.abrController=new p(this),C=this.bufferController=new c(this),_=this.capLevelController=new o(this),z=new x(this),Y=new k.default(this),oe=new W.default(this),G=new U.default(this),j=this.levelController=new L.default(this),se=new b.FragmentTracker(this),fe=this.streamController=new E.default(this,se);_.setStreamController(fe),z.setStreamController(fe);var Se=[j,fe];this.networkControllers=Se;var ke=[Y,oe,g,C,_,z,G,se];this.audioTrackController=this.createController(h.audioTrackController,null,Se),this.createController(h.audioStreamController,se,Se),this.subtitleTrackController=this.createController(h.subtitleTrackController,null,Se),this.createController(h.subtitleStreamController,se,Se),this.createController(h.timelineController,null,ke),this.emeController=this.createController(h.emeController,null,ke),this.cmcdController=this.createController(h.cmcdController,null,ke),this.latencyController=this.createController(P.default,null,ke),this.coreComponents=ke}var D=f.prototype;return D.createController=function(h,p,c){if(h){var o=p?new h(this,p):new h(this);return c&&c.push(o),o}return null},D.on=function(h,p,c){c===void 0&&(c=this),this._emitter.on(h,p,c)},D.once=function(h,p,c){c===void 0&&(c=this),this._emitter.once(h,p,c)},D.removeAllListeners=function(h){this._emitter.removeAllListeners(h)},D.off=function(h,p,c,o){c===void 0&&(c=this),this._emitter.off(h,p,c,o)},D.listeners=function(h){return this._emitter.listeners(h)},D.emit=function(h,p,c){return this._emitter.emit(h,p,c)},D.trigger=function(h,p){if(this.config.debug)return this.emit(h,h,p);try{return this.emit(h,h,p)}catch(c){w.logger.error("An internal error happened while handling event "+h+'. Error message: "'+c.message+'". Here is a stacktrace:',c),this.trigger(a.Events.ERROR,{type:l.ErrorTypes.OTHER_ERROR,details:l.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:h,error:c})}return!1},D.listenerCount=function(h){return this._emitter.listenerCount(h)},D.destroy=function(){w.logger.log("destroy"),this.trigger(a.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(h){return h.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(h){return h.destroy()}),this.coreComponents.length=0},D.attachMedia=function(h){w.logger.log("attachMedia"),this._media=h,this.trigger(a.Events.MEDIA_ATTACHING,{media:h})},D.detachMedia=function(){w.logger.log("detachMedia"),this.trigger(a.Events.MEDIA_DETACHING,void 0),this._media=null},D.loadSource=function(h){this.stopLoad();var p=this.media,c=this.url,o=this.url=H.buildAbsoluteURL(self.location.href,h,{alwaysNormalize:!0});w.logger.log("loadSource:"+o),p&&c&&c!==o&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(p)),this.trigger(a.Events.MANIFEST_LOADING,{url:h})},D.startLoad=function(h){h===void 0&&(h=-1),w.logger.log("startLoad("+h+")"),this.networkControllers.forEach(function(p){p.startLoad(h)})},D.stopLoad=function(){w.logger.log("stopLoad"),this.networkControllers.forEach(function(h){h.stopLoad()})},D.swapAudioCodec=function(){w.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},D.recoverMediaError=function(){w.logger.log("recoverMediaError");var h=this._media;this.detachMedia(),h&&this.attachMedia(h)},D.removeLevel=function(h,p){p===void 0&&(p=0),this.levelController.removeLevel(h,p)},m(f,[{key:"levels",get:function(){var h=this.levelController.levels;return h||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(h){w.logger.log("set currentLevel:"+h),this.loadLevel=h,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(h){w.logger.log("set nextLevel:"+h),this.levelController.manualLevel=h,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(h){w.logger.log("set loadLevel:"+h),this.levelController.manualLevel=h}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(h){this.levelController.nextLoadLevel=h}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(h){w.logger.log("set firstLevel:"+h),this.levelController.firstLevel=h}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(h){w.logger.log("set startLevel:"+h),h!==-1&&(h=Math.max(h,this.minAutoLevel)),this.levelController.startLevel=h}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(h){var p=!!h;p!==this.config.capLevelToPlayerSize&&(p?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=p)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(h){this._autoLevelCapping!==h&&(w.logger.log("set autoLevelCapping:"+h),this._autoLevelCapping=h)}},{key:"bandwidthEstimate",get:function(){var h=this.abrController.bwEstimator;return h?h.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var h=this.levels,p=this.config.minAutoBitrate;if(!h)return 0;for(var c=h.length,o=0;o<c;o++)if(h[o].maxBitrate>p)return o;return 0}},{key:"maxAutoLevel",get:function(){var h=this.levels,p=this.autoLevelCapping,c;return p===-1&&h&&h.length?c=h.length-1:c=p,c}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(h){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,h)}},{key:"audioTracks",get:function(){var h=this.audioTrackController;return h?h.audioTracks:[]}},{key:"audioTrack",get:function(){var h=this.audioTrackController;return h?h.audioTrack:-1},set:function(h){var p=this.audioTrackController;p&&(p.audioTrack=h)}},{key:"subtitleTracks",get:function(){var h=this.subtitleTrackController;return h?h.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var h=this.subtitleTrackController;return h?h.subtitleTrack:-1},set:function(h){var p=this.subtitleTrackController;p&&(p.subtitleTrack=h)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var h=this.subtitleTrackController;return h?h.subtitleDisplay:!1},set:function(h){var p=this.subtitleTrackController;p&&(p.subtitleDisplay=h)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(h){this.config.lowLatencyMode=h}},{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 f.defaultConfig?f.defaultConfig:T.hlsDefaultConfig},set:function(h){f.defaultConfig=h}}]),f}();d.defaultConfig=void 0},"./src/is-supported.ts":function(de,V,O){"use strict";O.r(V),O.d(V,"isSupported",function(){return k}),O.d(V,"changeTypeSupported",function(){return W});var H=O("./src/utils/mediasource-helper.ts");function A(){return self.SourceBuffer||self.WebKitSourceBuffer}function k(){var U=Object(H.getMediaSource)();if(!U)return!1;var P=A(),L=U&&typeof U.isTypeSupported=="function"&&U.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),b=!P||P.prototype&&typeof P.prototype.appendBuffer=="function"&&typeof P.prototype.remove=="function";return!!L&&!!b}function W(){var U,P=A();return typeof(P==null||((U=P.prototype)===null||U===void 0)?void 0:U.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(de,V,O){"use strict";O.r(V),O.d(V,"default",function(){return w}),O.d(V,"LoadError",function(){return y});var H=O("./src/polyfills/number.ts"),A=O("./src/errors.ts");function k(u,a){u.prototype=Object.create(a.prototype),u.prototype.constructor=u,b(u,a)}function W(u){var a=typeof Map=="function"?new Map:void 0;return W=function(s){if(s===null||!L(s))return s;if(typeof s!="function")throw new TypeError("Super expression must either be null or a function");if(typeof a!="undefined"){if(a.has(s))return a.get(s);a.set(s,m)}function m(){return U(s,arguments,E(this).constructor)}return m.prototype=Object.create(s.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),b(m,s)},W(u)}function U(u,a,l){return P()?U=Reflect.construct:U=function(m,d,f){var D=[null];D.push.apply(D,d);var v=Function.bind.apply(m,D),h=new v;return f&&b(h,f.prototype),h},U.apply(null,arguments)}function P(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(u){return!1}}function L(u){return Function.toString.call(u).indexOf("[native code]")!==-1}function b(u,a){return b=Object.setPrototypeOf||function(s,m){return s.__proto__=m,s},b(u,a)}function E(u){return E=Object.setPrototypeOf?Object.getPrototypeOf:function(l){return l.__proto__||Object.getPrototypeOf(l)},E(u)}var I=Math.pow(2,17),w=function(){function u(l){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=l}var a=u.prototype;return a.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},a.abort=function(){this.loader&&this.loader.abort()},a.load=function(s,m){var d=this,f=s.url;if(!f)return Promise.reject(new y({type:A.ErrorTypes.NETWORK_ERROR,details:A.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:s,networkDetails:null},"Fragment does not have a "+(f?"part list":"url")));this.abort();var D=this.config,v=D.fLoader,h=D.loader;return new Promise(function(p,c){d.loader&&d.loader.destroy();var o=d.loader=s.loader=v?new v(D):new h(D),x=T(s),g={timeout:D.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:D.fragLoadingMaxRetryTimeout,highWaterMark:I};s.stats=o.stats,o.load(x,g,{onSuccess:function(_,z,Y,oe){d.resetLoader(s,o),p({frag:s,part:null,payload:_.data,networkDetails:oe})},onError:function(_,z,Y){d.resetLoader(s,o),c(new y({type:A.ErrorTypes.NETWORK_ERROR,details:A.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:s,response:_,networkDetails:Y}))},onAbort:function(_,z,Y){d.resetLoader(s,o),c(new y({type:A.ErrorTypes.NETWORK_ERROR,details:A.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:s,networkDetails:Y}))},onTimeout:function(_,z,Y){d.resetLoader(s,o),c(new y({type:A.ErrorTypes.NETWORK_ERROR,details:A.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:s,networkDetails:Y}))},onProgress:function(_,z,Y,oe){m&&m({frag:s,part:null,payload:Y,networkDetails:oe})}})})},a.loadPart=function(s,m,d){var f=this;this.abort();var D=this.config,v=D.fLoader,h=D.loader;return new Promise(function(p,c){f.loader&&f.loader.destroy();var o=f.loader=s.loader=v?new v(D):new h(D),x=T(s,m),g={timeout:D.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:D.fragLoadingMaxRetryTimeout,highWaterMark:I};m.stats=o.stats,o.load(x,g,{onSuccess:function(_,z,Y,oe){f.resetLoader(s,o),f.updateStatsFromPart(s,m);var G={frag:s,part:m,payload:_.data,networkDetails:oe};d(G),p(G)},onError:function(_,z,Y){f.resetLoader(s,o),c(new y({type:A.ErrorTypes.NETWORK_ERROR,details:A.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:s,part:m,response:_,networkDetails:Y}))},onAbort:function(_,z,Y){s.stats.aborted=m.stats.aborted,f.resetLoader(s,o),c(new y({type:A.ErrorTypes.NETWORK_ERROR,details:A.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:s,part:m,networkDetails:Y}))},onTimeout:function(_,z,Y){f.resetLoader(s,o),c(new y({type:A.ErrorTypes.NETWORK_ERROR,details:A.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:s,part:m,networkDetails:Y}))}})})},a.updateStatsFromPart=function(s,m){var d=s.stats,f=m.stats,D=f.total;if(d.loaded+=f.loaded,D){var v=Math.round(s.duration/m.duration),h=Math.min(Math.round(d.loaded/D),v),p=v-h,c=p*Math.round(d.loaded/h);d.total=d.loaded+c}else d.total=Math.max(d.loaded,d.total);var o=d.loading,x=f.loading;o.start?o.first+=x.first-x.start:(o.start=x.start,o.first=x.first),o.end=x.end},a.resetLoader=function(s,m){s.loader=null,this.loader===m&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),m.destroy()},u}();function T(u,a){a===void 0&&(a=null);var l=a||u,s={frag:u,part:a,responseType:"arraybuffer",url:l.url,headers:{},rangeStart:0,rangeEnd:0},m=l.byteRangeStartOffset,d=l.byteRangeEndOffset;return Object(H.isFiniteNumber)(m)&&Object(H.isFiniteNumber)(d)&&(s.rangeStart=m,s.rangeEnd=d),s}var y=function(u){k(a,u);function a(l){for(var s,m=arguments.length,d=new Array(m>1?m-1:0),f=1;f<m;f++)d[f-1]=arguments[f];return s=u.call.apply(u,[this].concat(d))||this,s.data=void 0,s.data=l,s}return a}(W(Error))},"./src/loader/fragment.ts":function(de,V,O){"use strict";O.r(V),O.d(V,"ElementaryStreamTypes",function(){return w}),O.d(V,"BaseSegment",function(){return T}),O.d(V,"Fragment",function(){return y}),O.d(V,"Part",function(){return u});var H=O("./src/polyfills/number.ts"),A=O("./node_modules/url-toolkit/src/url-toolkit.js"),k=O.n(A),W=O("./src/utils/logger.ts"),U=O("./src/loader/level-key.ts"),P=O("./src/loader/load-stats.ts");function L(a,l){a.prototype=Object.create(l.prototype),a.prototype.constructor=a,b(a,l)}function b(a,l){return b=Object.setPrototypeOf||function(m,d){return m.__proto__=d,m},b(a,l)}function E(a,l){for(var s=0;s<l.length;s++){var m=l[s];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(a,m.key,m)}}function I(a,l,s){return l&&E(a.prototype,l),s&&E(a,s),a}var w;(function(a){a.AUDIO="audio",a.VIDEO="video",a.AUDIOVIDEO="audiovideo"})(w||(w={}));var T=function(){function a(s){var m;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(m={},m[w.AUDIO]=null,m[w.VIDEO]=null,m[w.AUDIOVIDEO]=null,m),this.baseurl=s}var l=a.prototype;return l.setByteRange=function(m,d){var f=m.split("@",2),D=[];f.length===1?D[0]=d?d.byteRangeEndOffset:0:D[0]=parseInt(f[1]),D[1]=parseInt(f[0])+D[0],this._byteRange=D},I(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(A.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(m){this._url=m}}]),a}(),y=function(a){L(l,a);function l(m,d){var f;return f=a.call(this,d)||this,f._decryptdata=null,f.rawProgramDateTime=null,f.programDateTime=null,f.tagList=[],f.duration=0,f.sn=0,f.levelkey=void 0,f.type=void 0,f.loader=null,f.level=-1,f.cc=0,f.startPTS=void 0,f.endPTS=void 0,f.appendedPTS=void 0,f.startDTS=void 0,f.endDTS=void 0,f.start=0,f.deltaPTS=void 0,f.maxStartPTS=void 0,f.minEndPTS=void 0,f.stats=new P.LoadStats,f.urlId=0,f.data=void 0,f.bitrateTest=!1,f.title=null,f.initSegment=null,f.type=m,f}var s=l.prototype;return s.createInitializationVector=function(d){for(var f=new Uint8Array(16),D=12;D<16;D++)f[D]=d>>8*(15-D)&255;return f},s.setDecryptDataFromLevelKey=function(d,f){var D=d;return(d==null?void 0:d.method)==="AES-128"&&d.uri&&!d.iv&&(D=U.LevelKey.fromURI(d.uri),D.method=d.method,D.iv=this.createInitializationVector(f),D.keyFormat="identity"),D},s.setElementaryStreamInfo=function(d,f,D,v,h,p){p===void 0&&(p=!1);var c=this.elementaryStreams,o=c[d];if(!o){c[d]={startPTS:f,endPTS:D,startDTS:v,endDTS:h,partial:p};return}o.startPTS=Math.min(o.startPTS,f),o.endPTS=Math.max(o.endPTS,D),o.startDTS=Math.min(o.startDTS,v),o.endDTS=Math.max(o.endDTS,h)},s.clearElementaryStreamInfo=function(){var d=this.elementaryStreams;d[w.AUDIO]=null,d[w.VIDEO]=null,d[w.AUDIOVIDEO]=null},I(l,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var d=this.sn;typeof d!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&W.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),d=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,d)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(H.isFiniteNumber)(this.programDateTime))return null;var d=Object(H.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+d*1e3}},{key:"encrypted",get:function(){var d;return!!((d=this.decryptdata)!==null&&d!==void 0&&d.keyFormat&&this.decryptdata.uri)}}]),l}(T),u=function(a){L(l,a);function l(s,m,d,f,D){var v;v=a.call(this,d)||this,v.fragOffset=0,v.duration=0,v.gap=!1,v.independent=!1,v.relurl=void 0,v.fragment=void 0,v.index=void 0,v.stats=new P.LoadStats,v.duration=s.decimalFloatingPoint("DURATION"),v.gap=s.bool("GAP"),v.independent=s.bool("INDEPENDENT"),v.relurl=s.enumeratedString("URI"),v.fragment=m,v.index=f;var h=s.enumeratedString("BYTERANGE");return h&&v.setByteRange(h,D),D&&(v.fragOffset=D.fragOffset+D.duration),v}return I(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 m=this.elementaryStreams;return!!(m.audio||m.video||m.audiovideo)}}]),l}(T)},"./src/loader/key-loader.ts":function(de,V,O){"use strict";O.r(V),O.d(V,"default",function(){return W});var H=O("./src/events.ts"),A=O("./src/errors.ts"),k=O("./src/utils/logger.ts"),W=function(){function U(L){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=L,this._registerListeners()}var P=U.prototype;return P._registerListeners=function(){this.hls.on(H.Events.KEY_LOADING,this.onKeyLoading,this)},P._unregisterListeners=function(){this.hls.off(H.Events.KEY_LOADING,this.onKeyLoading)},P.destroy=function(){this._unregisterListeners();for(var b in this.loaders){var E=this.loaders[b];E&&E.destroy()}this.loaders={}},P.onKeyLoading=function(b,E){var I=E.frag,w=I.type,T=this.loaders[w];if(!I.decryptdata){k.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var y=I.decryptdata.uri;if(y!==this.decrypturl||this.decryptkey===null){var u=this.hls.config;if(T&&(k.logger.warn("abort previous key loader for type:"+w),T.abort()),!y){k.logger.warn("key uri is falsy");return}var a=u.loader,l=I.loader=this.loaders[w]=new a(u);this.decrypturl=y,this.decryptkey=null;var s={url:y,frag:I,responseType:"arraybuffer"},m={timeout:u.fragLoadingTimeOut,maxRetry:0,retryDelay:u.fragLoadingRetryDelay,maxRetryDelay:u.fragLoadingMaxRetryTimeout,highWaterMark:0},d={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};l.load(s,m,d)}else this.decryptkey&&(I.decryptdata.key=this.decryptkey,this.hls.trigger(H.Events.KEY_LOADED,{frag:I}))},P.loadsuccess=function(b,E,I){var w=I.frag;if(!w.decryptdata){k.logger.error("after key load, decryptdata unset");return}this.decryptkey=w.decryptdata.key=new Uint8Array(b.data),w.loader=null,delete this.loaders[w.type],this.hls.trigger(H.Events.KEY_LOADED,{frag:w})},P.loaderror=function(b,E){var I=E.frag,w=I.loader;w&&w.abort(),delete this.loaders[I.type],this.hls.trigger(H.Events.ERROR,{type:A.ErrorTypes.NETWORK_ERROR,details:A.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:I,response:b})},P.loadtimeout=function(b,E){var I=E.frag,w=I.loader;w&&w.abort(),delete this.loaders[I.type],this.hls.trigger(H.Events.ERROR,{type:A.ErrorTypes.NETWORK_ERROR,details:A.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:I})},U}()},"./src/loader/level-details.ts":function(de,V,O){"use strict";O.r(V),O.d(V,"LevelDetails",function(){return U});var H=O("./src/polyfills/number.ts");function A(P,L){for(var b=0;b<L.length;b++){var E=L[b];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(P,E.key,E)}}function k(P,L,b){return L&&A(P.prototype,L),b&&A(P,b),P}var W=10,U=function(){function P(b){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.needSidxRanges=!1,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.fragments=[],this.url=b}var L=P.prototype;return L.reloaded=function(E){if(!E){this.advanced=!0,this.updated=!0;return}var I=this.lastPartSn-E.lastPartSn,w=this.lastPartIndex-E.lastPartIndex;this.updated=this.endSN!==E.endSN||!!w||!!I,this.advanced=this.endSN>E.endSN||I>0||I===0&&w>0,this.updated||this.advanced?this.misses=Math.floor(E.misses*.6):this.misses=E.misses+1,this.availabilityDelay=E.availabilityDelay},k(P,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(H.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||W}},{key:"drift",get:function(){var E=this.driftEndTime-this.driftStartTime;if(E>0){var I=this.driftEnd-this.driftStart;return I*1e3/E}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var E;return(E=this.partList)!==null&&E!==void 0&&E.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var E;return(E=this.fragments)!==null&&E!==void 0&&E.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 E;return(E=this.partList)!==null&&E!==void 0&&E.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var E;return(E=this.partList)!==null&&E!==void 0&&E.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),P}()},"./src/loader/level-key.ts":function(de,V,O){"use strict";O.r(V),O.d(V,"LevelKey",function(){return U});var H=O("./node_modules/url-toolkit/src/url-toolkit.js"),A=O.n(H);function k(P,L){for(var b=0;b<L.length;b++){var E=L[b];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(P,E.key,E)}}function W(P,L,b){return L&&k(P.prototype,L),b&&k(P,b),P}var U=function(){P.fromURL=function(b,E){return new P(b,E)},P.fromURI=function(b){return new P(b)};function P(L,b){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,b?this._uri=Object(H.buildAbsoluteURL)(L,b,{alwaysNormalize:!0}):this._uri=L}return W(P,[{key:"uri",get:function(){return this._uri}}]),P}()},"./src/loader/load-stats.ts":function(de,V,O){"use strict";O.r(V),O.d(V,"LoadStats",function(){return H});var H=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(de,V,O){"use strict";O.r(V),O.d(V,"default",function(){return l});var H=O("./src/polyfills/number.ts"),A=O("./node_modules/url-toolkit/src/url-toolkit.js"),k=O.n(A),W=O("./src/loader/fragment.ts"),U=O("./src/loader/level-details.ts"),P=O("./src/loader/level-key.ts"),L=O("./src/utils/attr-list.ts"),b=O("./src/utils/logger.ts"),E=O("./src/utils/codecs.ts"),I=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,w=/#EXT-X-MEDIA:(.*)/g,T=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),y=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(PLAYLIST-TYPE):(.+)/.source,/#EXT-X-(MEDIA-SEQUENCE): *(\d+)/.source,/#EXT-X-(SKIP):(.+)/.source,/#EXT-X-(TARGETDURATION): *(\d+)/.source,/#EXT-X-(KEY):(.+)/.source,/#EXT-X-(START):(.+)/.source,/#EXT-X-(ENDLIST)/.source,/#EXT-X-(DISCONTINUITY-SEQ)UENCE: *(\d+)/.source,/#EXT-X-(DIS)CONTINUITY/.source,/#EXT-X-(VERSION):(\d+)/.source,/#EXT-X-(MAP):(.+)/.source,/#EXT-X-(SERVER-CONTROL):(.+)/.source,/#EXT-X-(PART-INF):(.+)/.source,/#EXT-X-(GAP)/.source,/#EXT-X-(BITRATE):\s*(\d+)/.source,/#EXT-X-(PART):(.+)/.source,/#EXT-X-(PRELOAD-HINT):(.+)/.source,/#EXT-X-(RENDITION-REPORT):(.+)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),u=/\.(mp4|m4s|m4v|m4a)$/i;function a(D){var v,h;return u.test((v=(h=A.parseURL(D))===null||h===void 0?void 0:h.path)!=null?v:"")}var l=function(){function D(){}return D.findGroup=function(h,p){for(var c=0;c<h.length;c++){var o=h[c];if(o.id===p)return o}},D.convertAVC1ToAVCOTI=function(h){var p=h.split(".");if(p.length>2){var c=p.shift()+".";return c+=parseInt(p.shift()).toString(16),c+=("000"+parseInt(p.shift()).toString(16)).substr(-4),c}return h},D.resolve=function(h,p){return A.buildAbsoluteURL(p,h,{alwaysNormalize:!0})},D.parseMasterPlaylist=function(h,p){var c=[],o={},x=!1;I.lastIndex=0;for(var g;(g=I.exec(h))!=null;)if(g[1]){var C=new L.AttrList(g[1]),_={attrs:C,bitrate:C.decimalInteger("AVERAGE-BANDWIDTH")||C.decimalInteger("BANDWIDTH"),name:C.NAME,url:D.resolve(g[2],p)},z=C.decimalResolution("RESOLUTION");z&&(_.width=z.width,_.height=z.height),s((C.CODECS||"").split(/[ ,]+/).filter(function(oe){return oe}),_),_.videoCodec&&_.videoCodec.indexOf("avc1")!==-1&&(_.videoCodec=D.convertAVC1ToAVCOTI(_.videoCodec)),c.push(_)}else if(g[3]){var Y=new L.AttrList(g[3]);Y["DATA-ID"]&&(x=!0,o[Y["DATA-ID"]]=Y)}return{levels:c,sessionData:x?o:null}},D.parseMasterPlaylistMedia=function(h,p,c,o){o===void 0&&(o=[]);var x,g=[],C=0;for(w.lastIndex=0;(x=w.exec(h))!==null;){var _=new L.AttrList(x[1]);if(_.TYPE===c){var z={attrs:_,bitrate:0,id:C++,groupId:_["GROUP-ID"],instreamId:_["INSTREAM-ID"],name:_.NAME||_.LANGUAGE||"",type:c,default:_.bool("DEFAULT"),autoselect:_.bool("AUTOSELECT"),forced:_.bool("FORCED"),lang:_.LANGUAGE,url:_.URI?D.resolve(_.URI,p):""};if(o.length){var Y=D.findGroup(o,z.groupId)||o[0];m(z,Y,"audioCodec"),m(z,Y,"textCodec")}g.push(z)}}return g},D.parseLevelPlaylist=function(h,p,c,o,x){var g=new U.LevelDetails(p),C=g.fragments,_=null,z=0,Y=0,oe=0,G=0,j=null,se=new W.Fragment(o,p),fe,Se,ke,Je=-1,_e=!1;for(T.lastIndex=0,g.m3u8=h;(fe=T.exec(h))!==null;){_e&&(_e=!1,se=new W.Fragment(o,p),se.start=oe,se.sn=z,se.cc=G,se.level=c,_&&(se.initSegment=_,se.rawProgramDateTime=_.rawProgramDateTime));var Qe=fe[1];if(Qe){se.duration=parseFloat(Qe);var Ue=(" "+fe[2]).slice(1);se.title=Ue||null,se.tagList.push(Ue?["INF",Qe,Ue]:["INF",Qe])}else if(fe[3])Object(H.isFiniteNumber)(se.duration)&&(se.start=oe,ke&&(se.levelkey=ke),se.sn=z,se.level=c,se.cc=G,se.urlId=x,C.push(se),se.relurl=(" "+fe[3]).slice(1),f(se,j),j=se,oe+=se.duration,z++,Y=0,_e=!0);else if(fe[4]){var Fe=(" "+fe[4]).slice(1);j?se.setByteRange(Fe,j):se.setByteRange(Fe)}else if(fe[5])se.rawProgramDateTime=(" "+fe[5]).slice(1),se.tagList.push(["PROGRAM-DATE-TIME",se.rawProgramDateTime]),Je===-1&&(Je=C.length);else{if(fe=fe[0].match(y),!fe){b.logger.warn("No matches on slow regex match for level playlist!");continue}for(Se=1;Se<fe.length&&!(typeof fe[Se]!="undefined");Se++);var we=(" "+fe[Se]).slice(1),F=(" "+fe[Se+1]).slice(1),R=fe[Se+2]?(" "+fe[Se+2]).slice(1):"";switch(we){case"PLAYLIST-TYPE":g.type=F.toUpperCase();break;case"MEDIA-SEQUENCE":z=g.startSN=parseInt(F);break;case"SKIP":{var M=new L.AttrList(F),K=M.decimalInteger("SKIPPED-SEGMENTS");if(Object(H.isFiniteNumber)(K)){g.skippedSegments=K;for(var $=K;$--;)C.unshift(null);z+=K}var B=M.enumeratedString("RECENTLY-REMOVED-DATERANGES");B&&(g.recentlyRemovedDateranges=B.split(" "));break}case"TARGETDURATION":g.targetduration=parseFloat(F);break;case"VERSION":g.version=parseInt(F);break;case"EXTM3U":break;case"ENDLIST":g.live=!1;break;case"#":(F||R)&&se.tagList.push(R?[F,R]:[F]);break;case"DIS":G++;case"GAP":se.tagList.push([we]);break;case"BITRATE":se.tagList.push([we,F]);break;case"DISCONTINUITY-SEQ":G=parseInt(F);break;case"KEY":{var ge,Oe=new L.AttrList(F),je=Oe.enumeratedString("METHOD"),Ze=Oe.URI,He=Oe.hexadecimalInteger("IV"),ze=Oe.enumeratedString("KEYFORMATVERSIONS"),Xe=Oe.enumeratedString("KEYID"),dt=(ge=Oe.enumeratedString("KEYFORMAT"))!=null?ge:"identity",ct=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(ct.indexOf(dt)>-1){b.logger.warn("Keyformat "+dt+" is not supported from the manifest");continue}else if(dt!=="identity")continue;je&&(ke=P.LevelKey.fromURL(p,Ze),Ze&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(je)>=0&&(ke.method=je,ke.keyFormat=dt,Xe&&(ke.keyID=Xe),ze&&(ke.keyFormatVersions=ze),ke.iv=He));break}case"START":{var gt=new L.AttrList(F),at=gt.decimalFloatingPoint("TIME-OFFSET");Object(H.isFiniteNumber)(at)&&(g.startTimeOffset=at);break}case"MAP":{var ft=new L.AttrList(F);se.relurl=ft.URI,ft.BYTERANGE&&se.setByteRange(ft.BYTERANGE),se.level=c,se.sn="initSegment",ke&&(se.levelkey=ke),se.initSegment=null,_=se,_e=!0;break}case"SERVER-CONTROL":{var lt=new L.AttrList(F);g.canBlockReload=lt.bool("CAN-BLOCK-RELOAD"),g.canSkipUntil=lt.optionalFloat("CAN-SKIP-UNTIL",0),g.canSkipDateRanges=g.canSkipUntil>0&&lt.bool("CAN-SKIP-DATERANGES"),g.partHoldBack=lt.optionalFloat("PART-HOLD-BACK",0),g.holdBack=lt.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Ye=new L.AttrList(F);g.partTarget=Ye.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Ne=g.partList;Ne||(Ne=g.partList=[]);var ht=Y>0?Ne[Ne.length-1]:void 0,qe=Y++,le=new W.Part(new L.AttrList(F),se,p,qe,ht);Ne.push(le),se.duration+=le.duration;break}case"PRELOAD-HINT":{var Z=new L.AttrList(F);g.preloadHint=Z;break}case"RENDITION-REPORT":{var q=new L.AttrList(F);g.renditionReports=g.renditionReports||[],g.renditionReports.push(q);break}default:b.logger.warn("line parsed but not handled: "+fe);break}}}j&&!j.relurl?(C.pop(),oe-=j.duration,g.partList&&(g.fragmentHint=j)):g.partList&&(f(se,j),se.cc=G,g.fragmentHint=se);var ne=C.length,ue=C[0],ee=C[ne-1];if(oe+=g.skippedSegments*g.targetduration,oe>0&&ne&&ee){g.averagetargetduration=oe/ne;var ie=ee.sn;g.endSN=ie!=="initSegment"?ie:0,ue&&(g.startCC=ue.cc,ue.initSegment||g.fragments.every(function(ce){return ce.relurl&&a(ce.relurl)})&&(b.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),se=new W.Fragment(o,p),se.relurl=ee.relurl,se.level=c,se.sn="initSegment",ue.initSegment=se,g.needSidxRanges=!0))}else g.endSN=0,g.startCC=0;return g.fragmentHint&&(oe+=g.fragmentHint.duration),g.totalduration=oe,g.endCC=G,Je>0&&d(C,Je),g},D}();function s(D,v){["video","audio","text"].forEach(function(h){var p=D.filter(function(o){return Object(E.isCodecType)(o,h)});if(p.length){var c=p.filter(function(o){return o.lastIndexOf("avc1",0)===0||o.lastIndexOf("mp4a",0)===0});v[h+"Codec"]=c.length>0?c[0]:p[0],D=D.filter(function(o){return p.indexOf(o)===-1})}}),v.unknownCodecs=D}function m(D,v,h){var p=v[h];p&&(D[h]=p)}function d(D,v){for(var h=D[v],p=v;p--;){var c=D[p];if(!c)return;c.programDateTime=h.programDateTime-c.duration*1e3,h=c}}function f(D,v){D.rawProgramDateTime?D.programDateTime=Date.parse(D.rawProgramDateTime):v!=null&&v.programDateTime&&(D.programDateTime=v.endProgramDateTime),Object(H.isFiniteNumber)(D.programDateTime)||(D.programDateTime=null,D.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(de,V,O){"use strict";O.r(V);var H=O("./src/polyfills/number.ts"),A=O("./src/events.ts"),k=O("./src/errors.ts"),W=O("./src/utils/logger.ts"),U=O("./src/utils/mp4-tools.ts"),P=O("./src/loader/m3u8-parser.ts"),L=O("./src/types/loader.ts"),b=O("./src/utils/attr-list.ts");function E(T){var y=T.type;switch(y){case L.PlaylistContextType.AUDIO_TRACK:return L.PlaylistLevelType.AUDIO;case L.PlaylistContextType.SUBTITLE_TRACK:return L.PlaylistLevelType.SUBTITLE;default:return L.PlaylistLevelType.MAIN}}function I(T,y){var u=T.url;return(u===void 0||u.indexOf("data:")===0)&&(u=y.url),u}var w=function(){function T(u){this.hls=void 0,this.loaders=Object.create(null),this.hls=u,this.registerListeners()}var y=T.prototype;return y.registerListeners=function(){var a=this.hls;a.on(A.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.on(A.Events.LEVEL_LOADING,this.onLevelLoading,this),a.on(A.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),a.on(A.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},y.unregisterListeners=function(){var a=this.hls;a.off(A.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.off(A.Events.LEVEL_LOADING,this.onLevelLoading,this),a.off(A.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),a.off(A.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},y.createInternalLoader=function(a){var l=this.hls.config,s=l.pLoader,m=l.loader,d=s||m,f=new d(l);return a.loader=f,this.loaders[a.type]=f,f},y.getInternalLoader=function(a){return this.loaders[a.type]},y.resetInternalLoader=function(a){this.loaders[a]&&delete this.loaders[a]},y.destroyInternalLoaders=function(){for(var a in this.loaders){var l=this.loaders[a];l&&l.destroy(),this.resetInternalLoader(a)}},y.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},y.onManifestLoading=function(a,l){var s=l.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:L.PlaylistContextType.MANIFEST,url:s,deliveryDirectives:null})},y.onLevelLoading=function(a,l){var s=l.id,m=l.level,d=l.url,f=l.deliveryDirectives;this.load({id:s,groupId:null,level:m,responseType:"text",type:L.PlaylistContextType.LEVEL,url:d,deliveryDirectives:f})},y.onAudioTrackLoading=function(a,l){var s=l.id,m=l.groupId,d=l.url,f=l.deliveryDirectives;this.load({id:s,groupId:m,level:null,responseType:"text",type:L.PlaylistContextType.AUDIO_TRACK,url:d,deliveryDirectives:f})},y.onSubtitleTrackLoading=function(a,l){var s=l.id,m=l.groupId,d=l.url,f=l.deliveryDirectives;this.load({id:s,groupId:m,level:null,responseType:"text",type:L.PlaylistContextType.SUBTITLE_TRACK,url:d,deliveryDirectives:f})},y.load=function(a){var l,s=this.hls.config,m=this.getInternalLoader(a);if(m){var d=m.context;if(d&&d.url===a.url){W.logger.trace("[playlist-loader]: playlist request ongoing");return}W.logger.log("[playlist-loader]: aborting previous loader for type: "+a.type),m.abort()}var f,D,v,h;switch(a.type){case L.PlaylistContextType.MANIFEST:f=s.manifestLoadingMaxRetry,D=s.manifestLoadingTimeOut,v=s.manifestLoadingRetryDelay,h=s.manifestLoadingMaxRetryTimeout;break;case L.PlaylistContextType.LEVEL:case L.PlaylistContextType.AUDIO_TRACK:case L.PlaylistContextType.SUBTITLE_TRACK:f=0,D=s.levelLoadingTimeOut;break;default:f=s.levelLoadingMaxRetry,D=s.levelLoadingTimeOut,v=s.levelLoadingRetryDelay,h=s.levelLoadingMaxRetryTimeout;break}if(m=this.createInternalLoader(a),(l=a.deliveryDirectives)!==null&&l!==void 0&&l.part){var p;if(a.type===L.PlaylistContextType.LEVEL&&a.level!==null?p=this.hls.levels[a.level].details:a.type===L.PlaylistContextType.AUDIO_TRACK&&a.id!==null?p=this.hls.audioTracks[a.id].details:a.type===L.PlaylistContextType.SUBTITLE_TRACK&&a.id!==null&&(p=this.hls.subtitleTracks[a.id].details),p){var c=p.partTarget,o=p.targetduration;c&&o&&(D=Math.min(Math.max(c*3,o*.8)*1e3,D))}}var x={timeout:D,maxRetry:f,retryDelay:v,maxRetryDelay:h,highWaterMark:0},g={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};m.load(a,x,g)},y.loadsuccess=function(a,l,s,m){if(m===void 0&&(m=null),s.isSidxRequest){this.handleSidxRequest(a,s),this.handlePlaylistLoaded(a,l,s,m);return}this.resetInternalLoader(s.type);var d=a.data;if(d.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(a,s,"no EXTM3U delimiter",m);return}l.parsing.start=performance.now(),d.indexOf("#EXTINF:")>0||d.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(a,l,s,m):this.handleMasterPlaylist(a,l,s,m)},y.loaderror=function(a,l,s){s===void 0&&(s=null),this.handleNetworkError(l,s,!1,a)},y.loadtimeout=function(a,l,s){s===void 0&&(s=null),this.handleNetworkError(l,s,!0)},y.handleMasterPlaylist=function(a,l,s,m){var d=this.hls,f=a.data,D=I(a,s),v=P.default.parseMasterPlaylist(f,D),h=v.levels,p=v.sessionData;if(!h.length){this.handleManifestParsingError(a,s,"no level found in manifest",m);return}var c=h.map(function(z){return{id:z.attrs.AUDIO,audioCodec:z.audioCodec}}),o=h.map(function(z){return{id:z.attrs.SUBTITLES,textCodec:z.textCodec}}),x=P.default.parseMasterPlaylistMedia(f,D,"AUDIO",c),g=P.default.parseMasterPlaylistMedia(f,D,"SUBTITLES",o),C=P.default.parseMasterPlaylistMedia(f,D,"CLOSED-CAPTIONS");if(x.length){var _=x.some(function(z){return!z.url});!_&&h[0].audioCodec&&!h[0].attrs.AUDIO&&(W.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 b.AttrList({}),bitrate:0,url:""}))}d.trigger(A.Events.MANIFEST_LOADED,{levels:h,audioTracks:x,subtitles:g,captions:C,url:D,stats:l,networkDetails:m,sessionData:p})},y.handleTrackOrLevelPlaylist=function(a,l,s,m){var d=this.hls,f=s.id,D=s.level,v=s.type,h=I(a,s),p=Object(H.isFiniteNumber)(f)?f:0,c=Object(H.isFiniteNumber)(D)?D:p,o=E(s),x=P.default.parseLevelPlaylist(a.data,h,c,o,p);if(!x.fragments.length){d.trigger(A.Events.ERROR,{type:k.ErrorTypes.NETWORK_ERROR,details:k.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:h,reason:"no fragments found in level",level:typeof s.level=="number"?s.level:void 0});return}if(v===L.PlaylistContextType.MANIFEST){var g={attrs:new b.AttrList({}),bitrate:0,details:x,name:"",url:h};d.trigger(A.Events.MANIFEST_LOADED,{levels:[g],audioTracks:[],url:h,stats:l,networkDetails:m,sessionData:null})}if(l.parsing.end=performance.now(),x.needSidxRanges){var C,_=(C=x.fragments[0].initSegment)===null||C===void 0?void 0:C.url;this.load({url:_,isSidxRequest:!0,type:v,level:D,levelDetails:x,id:f,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}s.levelDetails=x,this.handlePlaylistLoaded(a,l,s,m)},y.handleSidxRequest=function(a,l){var s=Object(U.parseSegmentIndex)(new Uint8Array(a.data));if(!s)return;var m=s.references,d=l.levelDetails;m.forEach(function(f,D){var v=f.info,h=d.fragments[D];h.byteRange.length===0&&h.setByteRange(String(1+v.end-v.start)+"@"+String(v.start)),h.initSegment&&h.initSegment.setByteRange(String(s.moovEndOffset)+"@0")})},y.handleManifestParsingError=function(a,l,s,m){this.hls.trigger(A.Events.ERROR,{type:k.ErrorTypes.NETWORK_ERROR,details:k.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:l.type===L.PlaylistContextType.MANIFEST,url:a.url,reason:s,response:a,context:l,networkDetails:m})},y.handleNetworkError=function(a,l,s,m){s===void 0&&(s=!1),W.logger.warn("[playlist-loader]: A network "+(s?"timeout":"error")+" occurred while loading "+a.type+" level: "+a.level+" id: "+a.id+' group-id: "'+a.groupId+'"');var d=k.ErrorDetails.UNKNOWN,f=!1,D=this.getInternalLoader(a);switch(a.type){case L.PlaylistContextType.MANIFEST:d=s?k.ErrorDetails.MANIFEST_LOAD_TIMEOUT:k.ErrorDetails.MANIFEST_LOAD_ERROR,f=!0;break;case L.PlaylistContextType.LEVEL:d=s?k.ErrorDetails.LEVEL_LOAD_TIMEOUT:k.ErrorDetails.LEVEL_LOAD_ERROR,f=!1;break;case L.PlaylistContextType.AUDIO_TRACK:d=s?k.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:k.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,f=!1;break;case L.PlaylistContextType.SUBTITLE_TRACK:d=s?k.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:k.ErrorDetails.SUBTITLE_LOAD_ERROR,f=!1;break}D&&this.resetInternalLoader(a.type);var v={type:k.ErrorTypes.NETWORK_ERROR,details:d,fatal:f,url:a.url,loader:D,context:a,networkDetails:l};m&&(v.response=m),this.hls.trigger(A.Events.ERROR,v)},y.handlePlaylistLoaded=function(a,l,s,m){var d=s.type,f=s.level,D=s.id,v=s.groupId,h=s.loader,p=s.levelDetails,c=s.deliveryDirectives;if(!(p!=null&&p.targetduration)){this.handleManifestParsingError(a,s,"invalid target duration",m);return}if(!h)return;p.live&&(h.getCacheAge&&(p.ageHeader=h.getCacheAge()||0),(!h.getCacheAge||isNaN(p.ageHeader))&&(p.ageHeader=0));switch(d){case L.PlaylistContextType.MANIFEST:case L.PlaylistContextType.LEVEL:this.hls.trigger(A.Events.LEVEL_LOADED,{details:p,level:f||0,id:D||0,stats:l,networkDetails:m,deliveryDirectives:c});break;case L.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(A.Events.AUDIO_TRACK_LOADED,{details:p,id:D||0,groupId:v||"",stats:l,networkDetails:m,deliveryDirectives:c});break;case L.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(A.Events.SUBTITLE_TRACK_LOADED,{details:p,id:D||0,groupId:v||"",stats:l,networkDetails:m,deliveryDirectives:c});break}},T}();V.default=w},"./src/polyfills/number.ts":function(de,V,O){"use strict";O.r(V),O.d(V,"isFiniteNumber",function(){return H}),O.d(V,"MAX_SAFE_INTEGER",function(){return A});var H=Number.isFinite||function(k){return typeof k=="number"&&isFinite(k)},A=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(de,V,O){"use strict";O.r(V);var H=function(){function A(){}return A.getSilentFrame=function(W,U){switch(W){case"mp4a.40.2":if(U===1)return new Uint8Array([0,200,0,128,35,128]);if(U===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(U===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(U===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(U===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(U===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(U===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(U===2)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(U===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);break}return},A}();V.default=H},"./src/remux/mp4-generator.ts":function(de,V,O){"use strict";O.r(V);var H=Math.pow(2,32)-1,A=function(){function k(){}return k.init=function(){k.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};var U;for(U in k.types)k.types.hasOwnProperty(U)&&(k.types[U]=[U.charCodeAt(0),U.charCodeAt(1),U.charCodeAt(2),U.charCodeAt(3)]);var P=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),L=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);k.HDLR_TYPES={video:P,audio:L};var b=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),E=new Uint8Array([0,0,0,0,0,0,0,0]);k.STTS=k.STSC=k.STCO=E,k.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),k.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),k.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),k.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var I=new Uint8Array([105,115,111,109]),w=new Uint8Array([97,118,99,49]),T=new Uint8Array([0,0,0,1]);k.FTYP=k.box(k.types.ftyp,I,T,I,w),k.DINF=k.box(k.types.dinf,k.box(k.types.dref,b))},k.box=function(U){for(var P=8,L=arguments.length,b=new Array(L>1?L-1:0),E=1;E<L;E++)b[E-1]=arguments[E];for(var I=b.length,w=I;I--;)P+=b[I].byteLength;var T=new Uint8Array(P);for(T[0]=P>>24&255,T[1]=P>>16&255,T[2]=P>>8&255,T[3]=P&255,T.set(U,4),I=0,P=8;I<w;I++)T.set(b[I],P),P+=b[I].byteLength;return T},k.hdlr=function(U){return k.box(k.types.hdlr,k.HDLR_TYPES[U])},k.mdat=function(U){return k.box(k.types.mdat,U)},k.mdhd=function(U,P){P*=U;var L=Math.floor(P/(H+1)),b=Math.floor(P%(H+1));return k.box(k.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,U>>24&255,U>>16&255,U>>8&255,U&255,L>>24,L>>16&255,L>>8&255,L&255,b>>24,b>>16&255,b>>8&255,b&255,85,196,0,0]))},k.mdia=function(U){return k.box(k.types.mdia,k.mdhd(U.timescale,U.duration),k.hdlr(U.type),k.minf(U))},k.mfhd=function(U){return k.box(k.types.mfhd,new Uint8Array([0,0,0,0,U>>24,U>>16&255,U>>8&255,U&255]))},k.minf=function(U){return U.type==="audio"?k.box(k.types.minf,k.box(k.types.smhd,k.SMHD),k.DINF,k.stbl(U)):k.box(k.types.minf,k.box(k.types.vmhd,k.VMHD),k.DINF,k.stbl(U))},k.moof=function(U,P,L){return k.box(k.types.moof,k.mfhd(U),k.traf(L,P))},k.moov=function(U){for(var P=U.length,L=[];P--;)L[P]=k.trak(U[P]);return k.box.apply(null,[k.types.moov,k.mvhd(U[0].timescale,U[0].duration)].concat(L).concat(k.mvex(U)))},k.mvex=function(U){for(var P=U.length,L=[];P--;)L[P]=k.trex(U[P]);return k.box.apply(null,[k.types.mvex].concat(L))},k.mvhd=function(U,P){P*=U;var L=Math.floor(P/(H+1)),b=Math.floor(P%(H+1)),E=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,U>>24&255,U>>16&255,U>>8&255,U&255,L>>24,L>>16&255,L>>8&255,L&255,b>>24,b>>16&255,b>>8&255,b&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return k.box(k.types.mvhd,E)},k.sdtp=function(U){var P=U.samples||[],L=new Uint8Array(4+P.length),b,E;for(b=0;b<P.length;b++)E=P[b].flags,L[b+4]=E.dependsOn<<4|E.isDependedOn<<2|E.hasRedundancy;return k.box(k.types.sdtp,L)},k.stbl=function(U){return k.box(k.types.stbl,k.stsd(U),k.box(k.types.stts,k.STTS),k.box(k.types.stsc,k.STSC),k.box(k.types.stsz,k.STSZ),k.box(k.types.stco,k.STCO))},k.avc1=function(U){var P=[],L=[],b,E,I;for(b=0;b<U.sps.length;b++)E=U.sps[b],I=E.byteLength,P.push(I>>>8&255),P.push(I&255),P=P.concat(Array.prototype.slice.call(E));for(b=0;b<U.pps.length;b++)E=U.pps[b],I=E.byteLength,L.push(I>>>8&255),L.push(I&255),L=L.concat(Array.prototype.slice.call(E));var w=k.box(k.types.avcC,new Uint8Array([1,P[3],P[4],P[5],252|3,224|U.sps.length].concat(P).concat([U.pps.length]).concat(L))),T=U.width,y=U.height,u=U.pixelRatio[0],a=U.pixelRatio[1];return k.box(k.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,T>>8&255,T&255,y>>8&255,y&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),w,k.box(k.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),k.box(k.types.pasp,new Uint8Array([u>>24,u>>16&255,u>>8&255,u&255,a>>24,a>>16&255,a>>8&255,a&255])))},k.esds=function(U){var P=U.config.length;return new Uint8Array([0,0,0,0,3,23+P,0,1,0,4,15+P,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([P]).concat(U.config).concat([6,1,2]))},k.mp4a=function(U){var P=U.samplerate;return k.box(k.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,U.channelCount,0,16,0,0,0,0,P>>8&255,P&255,0,0]),k.box(k.types.esds,k.esds(U)))},k.mp3=function(U){var P=U.samplerate;return k.box(k.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,U.channelCount,0,16,0,0,0,0,P>>8&255,P&255,0,0]))},k.stsd=function(U){return U.type==="audio"?!U.isAAC&&U.codec==="mp3"?k.box(k.types.stsd,k.STSD,k.mp3(U)):k.box(k.types.stsd,k.STSD,k.mp4a(U)):k.box(k.types.stsd,k.STSD,k.avc1(U))},k.tkhd=function(U){var P=U.id,L=U.duration*U.timescale,b=U.width,E=U.height,I=Math.floor(L/(H+1)),w=Math.floor(L%(H+1));return k.box(k.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,P>>24&255,P>>16&255,P>>8&255,P&255,0,0,0,0,I>>24,I>>16&255,I>>8&255,I&255,w>>24,w>>16&255,w>>8&255,w&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,b>>8&255,b&255,0,0,E>>8&255,E&255,0,0]))},k.traf=function(U,P){var L=k.sdtp(U),b=U.id,E=Math.floor(P/(H+1)),I=Math.floor(P%(H+1));return k.box(k.types.traf,k.box(k.types.tfhd,new Uint8Array([0,0,0,0,b>>24,b>>16&255,b>>8&255,b&255])),k.box(k.types.tfdt,new Uint8Array([1,0,0,0,E>>24,E>>16&255,E>>8&255,E&255,I>>24,I>>16&255,I>>8&255,I&255])),k.trun(U,L.length+16+20+8+16+8+8),L)},k.trak=function(U){return U.duration=U.duration||4294967295,k.box(k.types.trak,k.tkhd(U),k.mdia(U))},k.trex=function(U){var P=U.id;return k.box(k.types.trex,new Uint8Array([0,0,0,0,P>>24,P>>16&255,P>>8&255,P&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},k.trun=function(U,P){var L=U.samples||[],b=L.length,E=12+16*b,I=new Uint8Array(E),w,T,y,u,a,l;for(P+=8+E,I.set([0,0,15,1,b>>>24&255,b>>>16&255,b>>>8&255,b&255,P>>>24&255,P>>>16&255,P>>>8&255,P&255],0),w=0;w<b;w++)T=L[w],y=T.duration,u=T.size,a=T.flags,l=T.cts,I.set([y>>>24&255,y>>>16&255,y>>>8&255,y&255,u>>>24&255,u>>>16&255,u>>>8&255,u&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*w);return k.box(k.types.trun,I)},k.initSegment=function(U){k.types||k.init();var P=k.moov(U),L=new Uint8Array(k.FTYP.byteLength+P.byteLength);return L.set(k.FTYP),L.set(P,k.FTYP.byteLength),L},k}();A.types=void 0,A.HDLR_TYPES=void 0,A.STTS=void 0,A.STSC=void 0,A.STCO=void 0,A.STSZ=void 0,A.VMHD=void 0,A.SMHD=void 0,A.STSD=void 0,A.FTYP=void 0,A.DINF=void 0,V.default=A},"./src/remux/mp4-remuxer.ts":function(de,V,O){"use strict";O.r(V),O.d(V,"default",function(){return l}),O.d(V,"normalizePts",function(){return s});var H=O("./src/polyfills/number.ts"),A=O("./src/remux/aac-helper.ts"),k=O("./src/remux/mp4-generator.ts"),W=O("./src/events.ts"),U=O("./src/errors.ts"),P=O("./src/utils/logger.ts"),L=O("./src/types/loader.ts"),b=O("./src/utils/timescale-conversion.ts");function E(){return E=Object.assign||function(D){for(var v=1;v<arguments.length;v++){var h=arguments[v];for(var p in h)Object.prototype.hasOwnProperty.call(h,p)&&(D[p]=h[p])}return D},E.apply(this,arguments)}var I=10*1e3,w=1024,T=1152,y=null,u=null,a=!1,l=function(){function D(h,p,c,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=h,this.config=p,this.typeSupported=c,this.ISGenerated=!1,y===null){var x=navigator.userAgent||"",g=x.match(/Chrome\/(\d+)/i);y=g?parseInt(g[1]):0}if(u===null){var C=navigator.userAgent.match(/Safari\/(\d+)/i);u=C?parseInt(C[1]):0}a=!!y&&y<75||!!u&&u<600}var v=D.prototype;return v.destroy=function(){},v.resetTimeStamp=function(p){P.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=p},v.resetNextTimestamp=function(){P.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},v.resetInitSegment=function(){P.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},v.getVideoStartPts=function(p){var c=!1,o=p.reduce(function(x,g){var C=g.pts-x;return C<-4294967296?(c=!0,s(x,g.pts)):C>0?x:g.pts},p[0].pts);return c&&P.logger.debug("PTS rollover detected"),o},v.remux=function(p,c,o,x,g,C,_,z){var Y,oe,G,j,se,fe,Se=g,ke=g,Je=p.pid>-1,_e=c.pid>-1,Qe=c.samples.length,Ue=p.samples.length>0,Fe=Qe>1,we=(!Je||Ue)&&(!_e||Fe)||this.ISGenerated||_;if(we){this.ISGenerated||(G=this.generateIS(p,c,g));var F=this.isVideoContiguous,R=-1;if(Fe&&(R=m(c.samples),!F&&this.config.forceKeyFrameOnDiscontinuity))if(fe=!0,R>0){P.logger.warn("[mp4-remuxer]: Dropped "+R+" out of "+Qe+" video samples due to a missing keyframe");var M=this.getVideoStartPts(c.samples);c.samples=c.samples.slice(R),c.dropped+=R,ke+=(c.samples[0].pts-M)/(c.timescale||9e4)}else R===-1&&(P.logger.warn("[mp4-remuxer]: No keyframe found out of "+Qe+" video samples"),fe=!1);if(this.ISGenerated){if(Ue&&Fe){var K=this.getVideoStartPts(c.samples),$=s(p.samples[0].pts,K)-K,B=$/c.inputTimeScale;Se+=Math.max(0,B),ke+=Math.max(0,-B)}if(Ue){if(p.samplerate||(P.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),G=this.generateIS(p,c,g)),oe=this.remuxAudio(p,Se,this.isAudioContiguous,C,_e||Fe||z===L.PlaylistLevelType.AUDIO?ke:void 0),Fe){var ge=oe?oe.endPTS-oe.startPTS:0;c.inputTimeScale||(P.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),G=this.generateIS(p,c,g)),Y=this.remuxVideo(c,ke,F,ge)}}else Fe&&(Y=this.remuxVideo(c,ke,F,0));Y&&(Y.firstKeyFrame=R,Y.independent=R!==-1)}}return this.ISGenerated&&(o.samples.length&&(se=this.remuxID3(o,g)),x.samples.length&&(j=this.remuxText(x,g))),{audio:oe,video:Y,initSegment:G,independent:fe,text:j,id3:se}},v.generateIS=function(p,c,o){var x=p.samples,g=c.samples,C=this.typeSupported,_={},z=!Object(H.isFiniteNumber)(this._initPTS),Y="audio/mp4",oe,G,j;if(z&&(oe=G=Infinity),p.config&&x.length&&(p.timescale=p.samplerate,p.isAAC||(C.mpeg?(Y="audio/mpeg",p.codec=""):C.mp3&&(p.codec="mp3")),_.audio={id:"audio",container:Y,codec:p.codec,initSegment:!p.isAAC&&C.mpeg?new Uint8Array(0):k.default.initSegment([p]),metadata:{channelCount:p.channelCount}},z&&(j=p.inputTimeScale,oe=G=x[0].pts-Math.round(j*o))),c.sps&&c.pps&&g.length&&(c.timescale=c.inputTimeScale,_.video={id:"main",container:"video/mp4",codec:c.codec,initSegment:k.default.initSegment([c]),metadata:{width:c.width,height:c.height}},z)){j=c.inputTimeScale;var se=this.getVideoStartPts(g),fe=Math.round(j*o);G=Math.min(G,s(g[0].dts,se)-fe),oe=Math.min(oe,se-fe)}if(Object.keys(_).length)return this.ISGenerated=!0,z&&(this._initPTS=oe,this._initDTS=G),{tracks:_,initPTS:oe,timescale:j}},v.remuxVideo=function(p,c,o,x){var g=p.inputTimeScale,C=p.samples,_=[],z=C.length,Y=this._initPTS,oe=this.nextAvcDts,G=8,j,se,fe,Se=Number.POSITIVE_INFINITY,ke=Number.NEGATIVE_INFINITY,Je=0,_e=!1;if(!o||oe===null){var Qe=c*g,Ue=C[0].pts-s(C[0].dts,C[0].pts);oe=Qe-Ue}for(var Fe=0;Fe<z;Fe++){var we=C[Fe];if(we.pts=s(we.pts-Y,oe),we.dts=s(we.dts-Y,oe),we.dts>we.pts){var F=9e4*.2;Je=Math.max(Math.min(Je,we.pts-we.dts),-1*F)}we.dts<C[Fe>0?Fe-1:Fe].dts&&(_e=!0)}_e&&C.sort(function(Ft,Ct){var ot=Ft.dts-Ct.dts,Ut=Ft.pts-Ct.pts;return ot||Ut}),se=C[0].dts,fe=C[C.length-1].dts;var R=Math.round((fe-se)/(z-1));if(Je<0){if(Je<R*-2){P.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(b.toMsFromMpegTsClock)(-R,!0)+" ms");for(var M=Je,K=0;K<z;K++)C[K].dts=M=Math.max(M,C[K].pts-R),C[K].pts=Math.max(M,C[K].pts)}else{P.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(b.toMsFromMpegTsClock)(Je,!0)+" ms to overcome this issue");for(var $=0;$<z;$++)C[$].dts=C[$].dts+Je}se=C[0].dts}if(o){var B=se-oe,ge=B>R,Oe=B<-1;if(ge||Oe){ge?P.logger.warn("AVC: "+Object(b.toMsFromMpegTsClock)(B,!0)+" ms ("+B+"dts) hole between fragments detected, filling it"):P.logger.warn("AVC: "+Object(b.toMsFromMpegTsClock)(-B,!0)+" ms ("+B+"dts) overlapping between fragments detected"),se=oe;var je=C[0].pts-B;C[0].dts=se,C[0].pts=je,P.logger.log("Video: First PTS/DTS adjusted: "+Object(b.toMsFromMpegTsClock)(je,!0)+"/"+Object(b.toMsFromMpegTsClock)(se,!0)+", delta: "+Object(b.toMsFromMpegTsClock)(B,!0)+" ms")}}a&&(se=Math.max(0,se));for(var Ze=0,He=0,ze=0;ze<z;ze++){for(var Xe=C[ze],dt=Xe.units,ct=dt.length,gt=0,at=0;at<ct;at++)gt+=dt[at].data.length;He+=gt,Ze+=ct,Xe.length=gt,Xe.dts=Math.max(Xe.dts,se),Xe.pts=Math.max(Xe.pts,Xe.dts,0),Se=Math.min(Xe.pts,Se),ke=Math.max(Xe.pts,ke)}fe=C[z-1].dts;var ft=He+4*Ze+8,lt;try{lt=new Uint8Array(ft)}catch(Ft){this.observer.emit(W.Events.ERROR,W.Events.ERROR,{type:U.ErrorTypes.MUX_ERROR,details:U.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:ft,reason:"fail allocating video mdat "+ft});return}var Ye=new DataView(lt.buffer);Ye.setUint32(0,ft),lt.set(k.default.types.mdat,4);for(var Ne=0;Ne<z;Ne++){for(var ht=C[Ne],qe=ht.units,le=0,Z=0,q=qe.length;Z<q;Z++){var ne=qe[Z],ue=ne.data,ee=ne.data.byteLength;Ye.setUint32(G,ee),G+=4,lt.set(ue,G),G+=ee,le+=4+ee}if(Ne<z-1)j=C[Ne+1].dts-ht.dts;else{var ie=this.config,ce=ht.dts-C[Ne>0?Ne-1:Ne].dts;if(ie.stretchShortVideoTrack&&this.nextAudioPts!==null){var pe=Math.floor(ie.maxBufferHole*g),xe=(x?Se+x*g:this.nextAudioPts)-ht.pts;xe>pe?(j=xe-ce,j<0&&(j=ce),P.logger.log("[mp4-remuxer]: It is approximately "+xe/90+" ms to the next segment; using duration "+j/90+" ms for the last video frame.")):j=ce}else j=ce}var De=Math.round(ht.pts-ht.dts);_.push(new d(ht.key,j,le,De))}if(_.length&&y&&y<70){var Be=_[0].flags;Be.dependsOn=2,Be.isNonSync=0}console.assert(j!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=oe=fe+j,this.isVideoContiguous=!0;var $e=k.default.moof(p.sequenceNumber++,se,E({},p,{samples:_})),pt="video",xt={data1:$e,data2:lt,startPTS:Se/g,endPTS:(ke+j)/g,startDTS:se/g,endDTS:oe/g,type:pt,hasAudio:!1,hasVideo:!0,nb:_.length,dropped:p.dropped};return p.samples=[],p.dropped=0,console.assert(lt.length,"MDAT length must not be zero"),xt},v.remuxAudio=function(p,c,o,x,g){var C=p.inputTimeScale,_=p.samplerate?p.samplerate:C,z=C/_,Y=p.isAAC?w:T,oe=Y*z,G=this._initPTS,j=!p.isAAC&&this.typeSupported.mpeg,se=[],fe=p.samples,Se=j?0:8,ke=this.nextAudioPts||-1,Je=c*C;if(this.isAudioContiguous=o=o||fe.length&&ke>0&&(x&&Math.abs(Je-ke)<9e3||Math.abs(s(fe[0].pts-G,Je)-ke)<20*oe),fe.forEach(function(ue){ue.pts=s(ue.pts-G,Je)}),!o||ke<0){if(fe=fe.filter(function(ue){return ue.pts>=0}),!fe.length)return;g===0?ke=0:x?ke=Math.max(0,Je):ke=fe[0].pts}if(p.isAAC)for(var _e=g!==void 0,Qe=this.config.maxAudioFramesDrift,Ue=0,Fe=ke;Ue<fe.length;Ue++){var we=fe[Ue],F=we.pts,R=F-Fe,M=Math.abs(1e3*R/C);if(R<=-Qe*oe&&_e)Ue===0&&(P.logger.warn("Audio frame @ "+(F/C).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*R/C)+" ms."),this.nextAudioPts=ke=Fe=F);else if(R>=Qe*oe&&M<I&&_e){var K=Math.round(R/oe);Fe=F-K*oe,Fe<0&&(K--,Fe+=oe),Ue===0&&(this.nextAudioPts=ke=Fe),P.logger.warn("[mp4-remuxer]: Injecting "+K+" audio frame @ "+(Fe/C).toFixed(3)+"s due to "+Math.round(1e3*R/C)+" ms gap.");for(var $=0;$<K;$++){var B=Math.max(Fe,0),ge=A.default.getSilentFrame(p.manifestCodec||p.codec,p.channelCount);ge||(P.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),ge=we.unit.subarray()),fe.splice(Ue,0,{unit:ge,pts:B}),Fe+=oe,Ue++}}we.pts=Fe,Fe+=oe}for(var Oe=null,je=null,Ze,He=0,ze=fe.length;ze--;)He+=fe[ze].unit.byteLength;for(var Xe=0,dt=fe.length;Xe<dt;Xe++){var ct=fe[Xe],gt=ct.unit,at=ct.pts;if(je!==null){var ft=se[Xe-1];ft.duration=Math.round((at-je)/z)}else if(o&&p.isAAC&&(at=ke),Oe=at,He>0){He+=Se;try{Ze=new Uint8Array(He)}catch(ue){this.observer.emit(W.Events.ERROR,W.Events.ERROR,{type:U.ErrorTypes.MUX_ERROR,details:U.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:He,reason:"fail allocating audio mdat "+He});return}if(!j){var lt=new DataView(Ze.buffer);lt.setUint32(0,He),Ze.set(k.default.types.mdat,4)}}else return;Ze.set(gt,Se);var Ye=gt.byteLength;Se+=Ye,se.push(new d(!0,Y,Ye,0)),je=at}var Ne=se.length;if(!Ne)return;var ht=se[se.length-1];this.nextAudioPts=ke=je+z*ht.duration;var qe=j?new Uint8Array(0):k.default.moof(p.sequenceNumber++,Oe/z,E({},p,{samples:se}));p.samples=[];var le=Oe/C,Z=ke/C,q="audio",ne={data1:qe,data2:Ze,startPTS:le,endPTS:Z,startDTS:le,endDTS:Z,type:q,hasAudio:!0,hasVideo:!1,nb:Ne};return this.isAudioContiguous=!0,console.assert(Ze.length,"MDAT length must not be zero"),ne},v.remuxEmptyAudio=function(p,c,o,x){var g=p.inputTimeScale,C=p.samplerate?p.samplerate:g,_=g/C,z=this.nextAudioPts,Y=(z!==null?z:x.startDTS*g)+this._initDTS,oe=x.endDTS*g+this._initDTS,G=_*w,j=Math.ceil((oe-Y)/G),se=A.default.getSilentFrame(p.manifestCodec||p.codec,p.channelCount);if(P.logger.warn("[mp4-remuxer]: remux empty Audio"),!se){P.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var fe=[],Se=0;Se<j;Se++){var ke=Y+Se*G;fe.push({unit:se,pts:ke,dts:ke})}return p.samples=fe,this.remuxAudio(p,c,o,!1)},v.remuxID3=function(p,c){var o=p.samples.length;if(!o)return;for(var x=p.inputTimeScale,g=this._initPTS,C=this._initDTS,_=0;_<o;_++){var z=p.samples[_];z.pts=s(z.pts-g,c*x)/x,z.dts=s(z.dts-C,c*x)/x}var Y=p.samples;return p.samples=[],{samples:Y}},v.remuxText=function(p,c){var o=p.samples.length;if(!o)return;for(var x=p.inputTimeScale,g=this._initPTS,C=0;C<o;C++){var _=p.samples[C];_.pts=s(_.pts-g,c*x)/x}p.samples.sort(function(Y,oe){return Y.pts-oe.pts});var z=p.samples;return p.samples=[],{samples:z}},D}();function s(D,v){var h;if(v===null)return D;for(v<D?h=-8589934592:h=8589934592;Math.abs(D-v)>4294967296;)D+=h;return D}function m(D){for(var v=0;v<D.length;v++)if(D[v].key)return v;return-1}var d=function(v,h,p,c){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=h,this.size=p,this.cts=c,this.flags=new f(v)},f=function(v){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=v?2:1,this.isNonSync=v?0:1}},"./src/remux/passthrough-remuxer.ts":function(de,V,O){"use strict";O.r(V);var H=O("./src/polyfills/number.ts"),A=O("./src/utils/mp4-tools.ts"),k=O("./src/loader/fragment.ts"),W=O("./src/utils/logger.ts"),U=function(){function b(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndDTS=null}var E=b.prototype;return E.destroy=function(){},E.resetTimeStamp=function(w){this.initPTS=w,this.lastEndDTS=null},E.resetNextTimestamp=function(){this.lastEndDTS=null},E.resetInitSegment=function(w,T,y){this.audioCodec=T,this.videoCodec=y,this.generateInitSegment(w),this.emitInitSegment=!0},E.generateInitSegment=function(w){var T=this.audioCodec,y=this.videoCodec;if(!w||!w.byteLength){this.initTracks=void 0,this.initData=void 0;return}var u=this.initData=Object(A.parseInitSegment)(w);T||(T=L(u.audio,k.ElementaryStreamTypes.AUDIO)),y||(y=L(u.video,k.ElementaryStreamTypes.VIDEO));var a={};u.audio&&u.video?a.audiovideo={container:"video/mp4",codec:T+","+y,initSegment:w,id:"main"}:u.audio?a.audio={container:"audio/mp4",codec:T,initSegment:w,id:"audio"}:u.video?a.video={container:"video/mp4",codec:y,initSegment:w,id:"main"}:W.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=a},E.remux=function(w,T,y,u,a){var l=this.initPTS,s=this.lastEndDTS,m={audio:void 0,video:void 0,text:u,id3:y,initSegment:void 0};Object(H.isFiniteNumber)(s)||(s=this.lastEndDTS=a||0);var d=T.samples;if(!d||!d.length)return m;var f={initPTS:void 0,timescale:1},D=this.initData;if((!D||!D.length)&&(this.generateInitSegment(d),D=this.initData),!D||!D.length)return W.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),m;this.emitInitSegment&&(f.tracks=this.initTracks,this.emitInitSegment=!1),Object(H.isFiniteNumber)(l)||(this.initPTS=f.initPTS=l=P(D,d,s));var v=Object(A.getDuration)(d,D),h=s,p=v+h;Object(A.offsetStartDTS)(D,d,l),v>0?this.lastEndDTS=p:(W.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var c=!!D.audio,o=!!D.video,x="";c&&(x+="audio"),o&&(x+="video");var g={data1:d,startPTS:h,startDTS:h,endPTS:p,endDTS:p,type:x,hasAudio:c,hasVideo:o,nb:1,dropped:0};return m.audio=g.type==="audio"?g:void 0,m.video=g.type!=="audio"?g:void 0,m.text=u,m.id3=y,m.initSegment=f,m},b}(),P=function(E,I,w){return Object(A.getStartDTS)(E,I)-w};function L(b,E){var I=b==null?void 0:b.codec;return I&&I.length>4?I:I==="hvc1"?"hvc1.1.c.L120.90":I==="av01"?"av01.0.04M.08":I==="avc1"||E===k.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}V.default=U},"./src/task-loop.ts":function(de,V,O){"use strict";O.r(V),O.d(V,"default",function(){return H});var H=function(){function A(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var k=A.prototype;return k.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},k.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},k.onHandlerDestroyed=function(){},k.hasInterval=function(){return!!this._tickInterval},k.hasNextTick=function(){return!!this._tickTimer},k.setInterval=function(U){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,U),!0)},k.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},k.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},k.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},k.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},k.doTick=function(){},A}()},"./src/types/cmcd.ts":function(de,V,O){"use strict";O.r(V),O.d(V,"CMCDVersion",function(){return H}),O.d(V,"CMCDObjectType",function(){return A}),O.d(V,"CMCDStreamingFormat",function(){return k}),O.d(V,"CMCDStreamType",function(){return W});var H=1,A;(function(U){U.MANIFEST="m",U.AUDIO="a",U.VIDEO="v",U.MUXED="av",U.INIT="i",U.CAPTION="c",U.TIMED_TEXT="tt",U.KEY="k",U.OTHER="o"})(A||(A={}));var k;(function(U){U.DASH="d",U.HLS="h",U.SMOOTH="s",U.OTHER="o"})(k||(k={}));var W;(function(U){U.VOD="v",U.LIVE="l"})(W||(W={}))},"./src/types/level.ts":function(de,V,O){"use strict";O.r(V),O.d(V,"HlsSkip",function(){return k}),O.d(V,"getSkipValue",function(){return W}),O.d(V,"HlsUrlParameters",function(){return U}),O.d(V,"Level",function(){return P});function H(L,b){for(var E=0;E<b.length;E++){var I=b[E];I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I&&(I.writable=!0),Object.defineProperty(L,I.key,I)}}function A(L,b,E){return b&&H(L.prototype,b),E&&H(L,E),L}var k;(function(L){L.No="",L.Yes="YES",L.v2="v2"})(k||(k={}));function W(L,b){var E=L.canSkipUntil,I=L.canSkipDateRanges,w=L.endSN,T=b!==void 0?b-w:0;return E&&T<E?I?k.v2:k.Yes:k.No}var U=function(){function L(E,I,w){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=E,this.part=I,this.skip=w}var b=L.prototype;return b.addDirectives=function(I){var w=new self.URL(I);return this.msn!==void 0&&w.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&w.searchParams.set("_HLS_part",this.part.toString()),this.skip&&w.searchParams.set("_HLS_skip",this.skip),w.toString()},L}(),P=function(){function L(b){this.attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.unknownCodecs=void 0,this.audioGroupIds=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.textGroupIds=void 0,this.url=void 0,this._urlId=0,this.url=[b.url],this.attrs=b.attrs,this.bitrate=b.bitrate,b.details&&(this.details=b.details),this.id=b.id||0,this.name=b.name,this.width=b.width||0,this.height=b.height||0,this.audioCodec=b.audioCodec,this.videoCodec=b.videoCodec,this.unknownCodecs=b.unknownCodecs,this.codecSet=[b.videoCodec,b.audioCodec].filter(function(E){return E}).join(",").replace(/\.[^.,]+/g,"")}return A(L,[{key:"maxBitrate",get:function(){return Math.max(this.realBitrate,this.bitrate)}},{key:"uri",get:function(){return this.url[this._urlId]||""}},{key:"urlId",get:function(){return this._urlId},set:function(E){var I=E%this.url.length;this._urlId!==I&&(this.details=void 0,this._urlId=I)}}]),L}()},"./src/types/loader.ts":function(de,V,O){"use strict";O.r(V),O.d(V,"PlaylistContextType",function(){return H}),O.d(V,"PlaylistLevelType",function(){return A});var H;(function(k){k.MANIFEST="manifest",k.LEVEL="level",k.AUDIO_TRACK="audioTrack",k.SUBTITLE_TRACK="subtitleTrack"})(H||(H={}));var A;(function(k){k.MAIN="main",k.AUDIO="audio",k.SUBTITLE="subtitle"})(A||(A={}))},"./src/types/transmuxer.ts":function(de,V,O){"use strict";O.r(V),O.d(V,"ChunkMetadata",function(){return H});var H=function(W,U,P,L,b,E){L===void 0&&(L=0),b===void 0&&(b=-1),E===void 0&&(E=!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=A(),this.buffering={audio:A(),video:A(),audiovideo:A()},this.level=W,this.sn=U,this.id=P,this.size=L,this.part=b,this.partial=E};function A(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(de,V,O){"use strict";O.r(V),O.d(V,"AttrList",function(){return k});var H=/^(\d+)x(\d+)$/,A=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,k=function(){function W(P){typeof P=="string"&&(P=W.parseAttrList(P));for(var L in P)P.hasOwnProperty(L)&&(this[L]=P[L])}var U=W.prototype;return U.decimalInteger=function(L){var b=parseInt(this[L],10);return b>Number.MAX_SAFE_INTEGER?Infinity:b},U.hexadecimalInteger=function(L){if(this[L]){var b=(this[L]||"0x").slice(2);b=(b.length&1?"0":"")+b;for(var E=new Uint8Array(b.length/2),I=0;I<b.length/2;I++)E[I]=parseInt(b.slice(I*2,I*2+2),16);return E}else return null},U.hexadecimalIntegerAsNumber=function(L){var b=parseInt(this[L],16);return b>Number.MAX_SAFE_INTEGER?Infinity:b},U.decimalFloatingPoint=function(L){return parseFloat(this[L])},U.optionalFloat=function(L,b){var E=this[L];return E?parseFloat(E):b},U.enumeratedString=function(L){return this[L]},U.bool=function(L){return this[L]==="YES"},U.decimalResolution=function(L){var b=H.exec(this[L]);return b===null?void 0:{width:parseInt(b[1],10),height:parseInt(b[2],10)}},W.parseAttrList=function(L){var b,E={},I='"';for(A.lastIndex=0;(b=A.exec(L))!==null;){var w=b[2];w.indexOf(I)===0&&w.lastIndexOf(I)===w.length-1&&(w=w.slice(1,-1)),E[b[1]]=w}return E},W}()},"./src/utils/binary-search.ts":function(de,V,O){"use strict";O.r(V);var H={search:function(k,W){for(var U=0,P=k.length-1,L=null,b=null;U<=P;){L=(U+P)/2|0,b=k[L];var E=W(b);if(E>0)U=L+1;else if(E<0)P=L-1;else return b}return null}};V.default=H},"./src/utils/buffer-helper.ts":function(de,V,O){"use strict";O.r(V),O.d(V,"BufferHelper",function(){return k});var H=O("./src/utils/logger.ts"),A={length:0,start:function(){return 0},end:function(){return 0}},k=function(){function W(){}return W.isBuffered=function(P,L){try{if(P){for(var b=W.getBuffered(P),E=0;E<b.length;E++)if(L>=b.start(E)&&L<=b.end(E))return!0}}catch(I){}return!1},W.bufferInfo=function(P,L,b){try{if(P){var E=W.getBuffered(P),I=[],w;for(w=0;w<E.length;w++)I.push({start:E.start(w),end:E.end(w)});return this.bufferedInfo(I,L,b)}}catch(T){}return{len:0,start:L,end:L,nextStart:void 0}},W.bufferedInfo=function(P,L,b){L=Math.max(0,L),P.sort(function(f,D){var v=f.start-D.start;return v||D.end-f.end});var E=[];if(b)for(var I=0;I<P.length;I++){var w=E.length;if(w){var T=E[w-1].end;P[I].start-T<b?P[I].end>T&&(E[w-1].end=P[I].end):E.push(P[I])}else E.push(P[I])}else E=P;for(var y=0,u,a=L,l=L,s=0;s<E.length;s++){var m=E[s].start,d=E[s].end;if(L+b>=m&&L<d)a=m,l=d,y=l-L;else if(L+b<m){u=m;break}}return{len:y,start:a||0,end:l||0,nextStart:u}},W.getBuffered=function(P){try{return P.buffered}catch(L){return H.logger.log("failed to get media.buffered",L),A}},W}()},"./src/utils/cea-608-parser.ts":function(de,V,O){"use strict";O.r(V),O.d(V,"Row",function(){return l}),O.d(V,"CaptionScreen",function(){return s});var H=O("./src/utils/logger.ts"),A={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},k=function(p){var c=p;return A.hasOwnProperty(p)&&(c=A[p]),String.fromCharCode(c)},W=15,U=100,P={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},L={17:2,18:4,21:6,22:8,23:10,19:13,20:15},b={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},E={25:2,26:4,29:6,30:8,31:10,27:13,28:15},I=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],w;(function(h){h[h.ERROR=0]="ERROR",h[h.TEXT=1]="TEXT",h[h.WARNING=2]="WARNING",h[h.INFO=2]="INFO",h[h.DEBUG=3]="DEBUG",h[h.DATA=3]="DATA"})(w||(w={}));var T=function(){function h(){this.time=null,this.verboseLevel=w.ERROR}var p=h.prototype;return p.log=function(o,x){this.verboseLevel>=o&&H.logger.log(this.time+" ["+o+"] "+x)},h}(),y=function(p){for(var c=[],o=0;o<p.length;o++)c.push(p[o].toString(16));return c},u=function(){function h(c,o,x,g,C){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=c||"white",this.underline=o||!1,this.italics=x||!1,this.background=g||"black",this.flash=C||!1}var p=h.prototype;return p.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},p.setStyles=function(o){for(var x=["foreground","underline","italics","background","flash"],g=0;g<x.length;g++){var C=x[g];o.hasOwnProperty(C)&&(this[C]=o[C])}},p.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},p.equals=function(o){return this.foreground===o.foreground&&this.underline===o.underline&&this.italics===o.italics&&this.background===o.background&&this.flash===o.flash},p.copy=function(o){this.foreground=o.foreground,this.underline=o.underline,this.italics=o.italics,this.background=o.background,this.flash=o.flash},p.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},h}(),a=function(){function h(c,o,x,g,C,_){this.uchar=void 0,this.penState=void 0,this.uchar=c||" ",this.penState=new u(o,x,g,C,_)}var p=h.prototype;return p.reset=function(){this.uchar=" ",this.penState.reset()},p.setChar=function(o,x){this.uchar=o,this.penState.copy(x)},p.setPenState=function(o){this.penState.copy(o)},p.equals=function(o){return this.uchar===o.uchar&&this.penState.equals(o.penState)},p.copy=function(o){this.uchar=o.uchar,this.penState.copy(o.penState)},p.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},h}(),l=function(){function h(c){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<U;o++)this.chars.push(new a);this.logger=c,this.pos=0,this.currPenState=new u}var p=h.prototype;return p.equals=function(o){for(var x=!0,g=0;g<U;g++)if(!this.chars[g].equals(o.chars[g])){x=!1;break}return x},p.copy=function(o){for(var x=0;x<U;x++)this.chars[x].copy(o.chars[x])},p.isEmpty=function(){for(var o=!0,x=0;x<U;x++)if(!this.chars[x].isEmpty()){o=!1;break}return o},p.setCursor=function(o){this.pos!==o&&(this.pos=o),this.pos<0?(this.logger.log(w.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>U&&(this.logger.log(w.DEBUG,"Too large cursor position "+this.pos),this.pos=U)},p.moveCursor=function(o){var x=this.pos+o;if(o>1)for(var g=this.pos+1;g<x+1;g++)this.chars[g].setPenState(this.currPenState);this.setCursor(x)},p.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},p.insertChar=function(o){o>=144&&this.backSpace();var x=k(o);if(this.pos>=U){this.logger.log(w.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)},p.clearFromPos=function(o){var x;for(x=o;x<U;x++)this.chars[x].reset()},p.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},p.clearToEndOfRow=function(){this.clearFromPos(this.pos)},p.getTextString=function(){for(var o=[],x=!0,g=0;g<U;g++){var C=this.chars[g].uchar;C!==" "&&(x=!1),o.push(C)}return x?"":o.join("")},p.setPenStyles=function(o){this.currPenState.setStyles(o);var x=this.chars[this.pos];x.setPenState(this.currPenState)},h}(),s=function(){function h(c){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<W;o++)this.rows.push(new l(c));this.logger=c,this.currRow=W-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var p=h.prototype;return p.reset=function(){for(var o=0;o<W;o++)this.rows[o].clear();this.currRow=W-1},p.equals=function(o){for(var x=!0,g=0;g<W;g++)if(!this.rows[g].equals(o.rows[g])){x=!1;break}return x},p.copy=function(o){for(var x=0;x<W;x++)this.rows[x].copy(o.rows[x])},p.isEmpty=function(){for(var o=!0,x=0;x<W;x++)if(!this.rows[x].isEmpty()){o=!1;break}return o},p.backSpace=function(){var o=this.rows[this.currRow];o.backSpace()},p.clearToEndOfRow=function(){var o=this.rows[this.currRow];o.clearToEndOfRow()},p.insertChar=function(o){var x=this.rows[this.currRow];x.insertChar(o)},p.setPen=function(o){var x=this.rows[this.currRow];x.setPenStyles(o)},p.moveCursor=function(o){var x=this.rows[this.currRow];x.moveCursor(o)},p.setCursor=function(o){this.logger.log(w.INFO,"setCursor: "+o);var x=this.rows[this.currRow];x.setCursor(o)},p.setPAC=function(o){this.logger.log(w.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 g=0;g<W;g++)this.rows[g].clear();var C=this.currRow+1-this.nrRollUpRows,_=this.lastOutputScreen;if(_){var z=_.rows[C].cueStartTime,Y=this.logger.time;if(z&&Y!==null&&z<Y)for(var oe=0;oe<this.nrRollUpRows;oe++)this.rows[x-this.nrRollUpRows+oe+1].copy(_.rows[C+oe])}}this.currRow=x;var G=this.rows[this.currRow];if(o.indent!==null){var j=o.indent,se=Math.max(j-1,0);G.setCursor(o.indent),o.color=G.chars[se].penState.foreground}var fe={foreground:o.color,underline:o.underline,italics:o.italics,background:"black",flash:!1};this.setPen(fe)},p.setBkgData=function(o){this.logger.log(w.INFO,"bkgData = "+JSON.stringify(o)),this.backSpace(),this.setPen(o),this.insertChar(32)},p.setRollUpRows=function(o){this.nrRollUpRows=o},p.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(w.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(w.TEXT,this.getDisplayText());var 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(w.INFO,"Rolling up")},p.getDisplayText=function(o){o=o||!1;for(var x=[],g="",C=-1,_=0;_<W;_++){var z=this.rows[_].getTextString();z&&(C=_+1,o?x.push("Row "+C+": '"+z+"'"):x.push(z.trim()))}return x.length>0&&(o?g="["+x.join(" | ")+"]":g=x.join(`
`)),g},p.getTextAndFormat=function(){return this.rows},h}(),m=function(){function h(c,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=c,this.outputFilter=o,this.mode=null,this.verbose=0,this.displayedMemory=new s(x),this.nonDisplayedMemory=new s(x),this.lastOutputScreen=new s(x),this.currRollUpRow=this.displayedMemory.rows[W-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=x}var p=h.prototype;return p.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[W-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},p.getHandler=function(){return this.outputFilter},p.setHandler=function(o){this.outputFilter=o},p.setPAC=function(o){this.writeScreen.setPAC(o)},p.setBkgData=function(o){this.writeScreen.setBkgData(o)},p.setMode=function(o){if(o===this.mode)return;this.mode=o,this.logger.log(w.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},p.insertChars=function(o){for(var x=0;x<o.length;x++)this.writeScreen.insertChar(o[x]);var g=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(w.INFO,g+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(w.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},p.ccRCL=function(){this.logger.log(w.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},p.ccBS=function(){if(this.logger.log(w.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},p.ccAOF=function(){},p.ccAON=function(){},p.ccDER=function(){this.logger.log(w.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},p.ccRU=function(o){this.logger.log(w.INFO,"RU("+o+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(o)},p.ccFON=function(){this.logger.log(w.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},p.ccRDC=function(){this.logger.log(w.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},p.ccTR=function(){this.logger.log(w.INFO,"TR"),this.setMode("MODE_TEXT")},p.ccRTD=function(){this.logger.log(w.INFO,"RTD"),this.setMode("MODE_TEXT")},p.ccEDM=function(){this.logger.log(w.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},p.ccCR=function(){this.logger.log(w.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},p.ccENM=function(){this.logger.log(w.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},p.ccEOC=function(){if(this.logger.log(w.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(w.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},p.ccTO=function(o){this.logger.log(w.INFO,"TO("+o+") - Tab Offset"),this.writeScreen.moveCursor(o)},p.ccMIDROW=function(o){var x={flash:!1};if(x.underline=o%2===1,x.italics=o>=46,x.italics)x.foreground="white";else{var g=Math.floor(o/2)-16,C=["white","green","blue","cyan","red","yellow","magenta"];x.foreground=C[g]}this.logger.log(w.INFO,"MIDROW: "+JSON.stringify(x)),this.writeScreen.setPen(x)},p.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))},p.cueSplitAtTime=function(o){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,o,this.displayedMemory),this.cueStartTime=o))},h}(),d=function(){function h(c,o,x){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var g=new T;this.channels=[null,new m(c,o,g),new m(c+1,x,g)],this.cmdHistory=v(),this.logger=g}var p=h.prototype;return p.getHandler=function(o){return this.channels[o].getHandler()},p.setHandler=function(o,x){this.channels[o].setHandler(x)},p.addData=function(o,x){var g,C,_,z=!1;this.logger.time=o;for(var Y=0;Y<x.length;Y+=2){if(C=x[Y]&127,_=x[Y+1]&127,C===0&&_===0)continue;if(this.logger.log(w.DATA,"["+y([x[Y],x[Y+1]])+"] -> ("+y([C,_])+")"),g=this.parseCmd(C,_),g||(g=this.parseMidrow(C,_)),g||(g=this.parsePAC(C,_)),g||(g=this.parseBackgroundAttributes(C,_)),!g&&(z=this.parseChars(C,_),z)){var oe=this.currentChannel;if(oe&&oe>0){var G=this.channels[oe];G.insertChars(z)}else this.logger.log(w.WARNING,"No channel found yet. TEXT-MODE?")}!g&&!z&&this.logger.log(w.WARNING,"Couldn't parse cleaned data "+y([C,_])+" orig: "+y([x[Y],x[Y+1]]))}},p.parseCmd=function(o,x){var g=this.cmdHistory,C=(o===20||o===28||o===21||o===29)&&x>=32&&x<=47,_=(o===23||o===31)&&x>=33&&x<=35;if(!(C||_))return!1;if(D(o,x,g))return f(null,null,g),this.logger.log(w.DEBUG,"Repeated command ("+y([o,x])+") is dropped"),!0;var z=o===20||o===21||o===23?1:2,Y=this.channels[z];return o===20||o===21||o===28||o===29?x===32?Y.ccRCL():x===33?Y.ccBS():x===34?Y.ccAOF():x===35?Y.ccAON():x===36?Y.ccDER():x===37?Y.ccRU(2):x===38?Y.ccRU(3):x===39?Y.ccRU(4):x===40?Y.ccFON():x===41?Y.ccRDC():x===42?Y.ccTR():x===43?Y.ccRTD():x===44?Y.ccEDM():x===45?Y.ccCR():x===46?Y.ccENM():x===47&&Y.ccEOC():Y.ccTO(x-32),f(o,x,g),this.currentChannel=z,!0},p.parseMidrow=function(o,x){var g=0;if((o===17||o===25)&&x>=32&&x<=47){if(o===17?g=1:g=2,g!==this.currentChannel)return this.logger.log(w.ERROR,"Mismatch channel in midrow parsing"),!1;var C=this.channels[g];return C?(C.ccMIDROW(x),this.logger.log(w.DEBUG,"MIDROW ("+y([o,x])+")"),!0):!1}return!1},p.parsePAC=function(o,x){var g,C=this.cmdHistory,_=(o>=17&&o<=23||o>=25&&o<=31)&&x>=64&&x<=127,z=(o===16||o===24)&&x>=64&&x<=95;if(!(_||z))return!1;if(D(o,x,C))return f(null,null,C),!0;var Y=o<=23?1:2;x>=64&&x<=95?g=Y===1?P[o]:b[o]:g=Y===1?L[o]:E[o];var oe=this.channels[Y];return oe?(oe.setPAC(this.interpretPAC(g,x)),f(o,x,C),this.currentChannel=Y,!0):!1},p.interpretPAC=function(o,x){var g,C={color:null,italics:!1,indent:null,underline:!1,row:o};return x>95?g=x-96:g=x-64,C.underline=(g&1)===1,g<=13?C.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(g/2)]:g<=15?(C.italics=!0,C.color="white"):C.indent=Math.floor((g-16)/2)*4,C},p.parseChars=function(o,x){var g,C=null,_=null;if(o>=25?(g=2,_=o-8):(g=1,_=o),_>=17&&_<=19){var z;_===17?z=x+80:_===18?z=x+112:z=x+144,this.logger.log(w.INFO,"Special char '"+k(z)+"' in channel "+g),C=[z]}else o>=32&&o<=127&&(C=x===0?[o]:[o,x]);if(C){var Y=y(C);this.logger.log(w.DEBUG,"Char codes = "+Y.join(",")),f(o,x,this.cmdHistory)}return C},p.parseBackgroundAttributes=function(o,x){var g=(o===16||o===24)&&x>=32&&x<=47,C=(o===23||o===31)&&x>=45&&x<=47;if(!(g||C))return!1;var _,z={};o===16||o===24?(_=Math.floor((x-32)/2),z.background=I[_],x%2===1&&(z.background=z.background+"_semi")):x===45?z.background="transparent":(z.foreground="black",x===47&&(z.underline=!0));var Y=o<=23?1:2,oe=this.channels[Y];return oe.setBkgData(z),f(o,x,this.cmdHistory),!0},p.reset=function(){for(var o=0;o<Object.keys(this.channels).length;o++){var x=this.channels[o];x&&x.reset()}this.cmdHistory=v()},p.cueSplitAtTime=function(o){for(var x=0;x<this.channels.length;x++){var g=this.channels[x];g&&g.cueSplitAtTime(o)}},h}();function f(h,p,c){c.a=h,c.b=p}function D(h,p,c){return c.a===h&&c.b===p}function v(){return{a:null,b:null}}V.default=d},"./src/utils/codecs.ts":function(de,V,O){"use strict";O.r(V),O.d(V,"isCodecType",function(){return A}),O.d(V,"isCodecSupportedInMp4",function(){return k});var H={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 A(W,U){var P=H[U];return!!P&&P[W.slice(0,4)]===!0}function k(W,U){return MediaSource.isTypeSupported((U||"video")+'/mp4;codecs="'+W+'"')}},"./src/utils/cues.ts":function(de,V,O){"use strict";O.r(V);var H=O("./src/utils/vttparser.ts"),A=O("./src/utils/webvtt-parser.ts"),k=O("./src/utils/texttrack-utils.ts"),W=/\s/,U={newCue:function(L,b,E,I){for(var w=[],T,y,u,a,l,s=self.VTTCue||self.TextTrackCue,m=0;m<I.rows.length;m++)if(T=I.rows[m],u=!0,a=0,l="",!T.isEmpty()){for(var d=0;d<T.chars.length;d++)W.test(T.chars[d].uchar)&&u?a++:(l+=T.chars[d].uchar,u=!1);T.cueStartTime=b,b===E&&(E+=1e-4),a>=16?a--:a++;var f=Object(H.fixLineBreaks)(l.trim()),D=Object(A.generateCueId)(b,E,f);(!L||!L.cues||!L.cues.getCueById(D))&&(y=new s(b,E,f),y.id=D,y.line=m+1,y.align="left",y.position=10+Math.min(80,Math.floor(a*8/32)*10),w.push(y))}return L&&w.length&&(w.sort(function(v,h){return v.line==="auto"||h.line==="auto"?0:v.line>8&&h.line>8?h.line-v.line:v.line-h.line}),w.forEach(function(v){return Object(k.addCueToTrack)(L,v)})),w}};V.default=U},"./src/utils/discontinuities.ts":function(de,V,O){"use strict";O.r(V),O.d(V,"findFirstFragWithCC",function(){return W}),O.d(V,"shouldAlignOnDiscontinuities",function(){return U}),O.d(V,"findDiscontinuousReferenceFrag",function(){return P}),O.d(V,"adjustSlidingStart",function(){return b}),O.d(V,"alignStream",function(){return E}),O.d(V,"alignPDT",function(){return w}),O.d(V,"alignFragmentByPDTDelta",function(){return T}),O.d(V,"alignMediaPlaylistByPDT",function(){return y});var H=O("./src/polyfills/number.ts"),A=O("./src/utils/logger.ts"),k=O("./src/controller/level-helper.ts");function W(u,a){for(var l=null,s=0,m=u.length;s<m;s++){var d=u[s];if(d&&d.cc===a){l=d;break}}return l}function U(u,a,l){return!!(a.details&&(l.endCC>l.startCC||u&&u.cc<l.startCC))}function P(u,a){var l=u.fragments,s=a.fragments;if(!s.length||!l.length){A.logger.log("No fragments to align");return}var m=W(l,s[0].cc);if(!m||m&&!m.startPTS){A.logger.log("No frag in previous level to align on");return}return m}function L(u,a){if(u){var l=u.start+a;u.start=u.startPTS=l,u.endPTS=l+u.duration}}function b(u,a){for(var l=a.fragments,s=0,m=l.length;s<m;s++)L(l[s],u);a.fragmentHint&&L(a.fragmentHint,u),a.alignedSliding=!0}function E(u,a,l){if(!a)return;I(u,l,a),!l.alignedSliding&&a.details&&w(l,a.details),!l.alignedSliding&&a.details&&!l.skippedSegments&&Object(k.adjustSliding)(a.details,l)}function I(u,a,l){if(U(u,l,a)){var s=P(l.details,a);s&&Object(H.isFiniteNumber)(s.start)&&(A.logger.log("Adjusting PTS using last level due to CC increase within current level "+a.url),b(s.start,a))}}function w(u,a){if(!a.fragments.length||!u.hasProgramDateTime||!a.hasProgramDateTime)return;var l=a.fragments[0].programDateTime,s=u.fragments[0].programDateTime,m=(s-l)/1e3+a.fragments[0].start;m&&Object(H.isFiniteNumber)(m)&&(A.logger.log("Adjusting PTS using programDateTime delta "+(s-l)+"ms, sliding:"+m.toFixed(3)+" "+u.url+" "),b(m,u))}function T(u,a){var l=u.programDateTime;if(!l)return;var s=(l-a)/1e3;u.start=u.startPTS=s,u.endPTS=s+u.duration}function y(u,a){if(!a.fragments.length||!u.hasProgramDateTime||!a.hasProgramDateTime)return;var l=a.fragments[0].programDateTime,s=a.fragments[0].start,m=l-s*1e3;u.fragments.forEach(function(d){T(d,m)}),u.fragmentHint&&T(u.fragmentHint,m),u.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(de,V,O){"use strict";O.r(V);var H=O("./src/utils/ewma.ts"),A=function(){function k(U,P,L){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=L,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new H.default(U),this.fast_=new H.default(P)}var W=k.prototype;return W.update=function(P,L){var b=this.slow_,E=this.fast_;this.slow_.halfLife!==P&&(this.slow_=new H.default(P,b.getEstimate(),b.getTotalWeight())),this.fast_.halfLife!==L&&(this.fast_=new H.default(L,E.getEstimate(),E.getTotalWeight()))},W.sample=function(P,L){P=Math.max(P,this.minDelayMs_);var b=8*L,E=P/1e3,I=b/E;this.fast_.sample(E,I),this.slow_.sample(E,I)},W.canEstimate=function(){var P=this.fast_;return P&&P.getTotalWeight()>=this.minWeight_},W.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},W.destroy=function(){},k}();V.default=A},"./src/utils/ewma.ts":function(de,V,O){"use strict";O.r(V);var H=function(){function A(W,U,P){U===void 0&&(U=0),P===void 0&&(P=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=W,this.alpha_=W?Math.exp(Math.log(.5)/W):0,this.estimate_=U,this.totalWeight_=P}var k=A.prototype;return k.sample=function(U,P){var L=Math.pow(this.alpha_,U);this.estimate_=P*(1-L)+L*this.estimate_,this.totalWeight_+=U},k.getTotalWeight=function(){return this.totalWeight_},k.getEstimate=function(){if(this.alpha_){var U=1-Math.pow(this.alpha_,this.totalWeight_);if(U)return this.estimate_/U}return this.estimate_},A}();V.default=H},"./src/utils/fetch-loader.ts":function(de,V,O){"use strict";O.r(V),O.d(V,"fetchSupported",function(){return T});var H=O("./src/polyfills/number.ts"),A=O("./src/loader/load-stats.ts"),k=O("./src/demux/chunk-cache.ts");function W(s,m){s.prototype=Object.create(m.prototype),s.prototype.constructor=s,E(s,m)}function U(s){var m=typeof Map=="function"?new Map:void 0;return U=function(f){if(f===null||!b(f))return f;if(typeof f!="function")throw new TypeError("Super expression must either be null or a function");if(typeof m!="undefined"){if(m.has(f))return m.get(f);m.set(f,D)}function D(){return P(f,arguments,I(this).constructor)}return D.prototype=Object.create(f.prototype,{constructor:{value:D,enumerable:!1,writable:!0,configurable:!0}}),E(D,f)},U(s)}function P(s,m,d){return L()?P=Reflect.construct:P=function(D,v,h){var p=[null];p.push.apply(p,v);var c=Function.bind.apply(D,p),o=new c;return h&&E(o,h.prototype),o},P.apply(null,arguments)}function L(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(s){return!1}}function b(s){return Function.toString.call(s).indexOf("[native code]")!==-1}function E(s,m){return E=Object.setPrototypeOf||function(f,D){return f.__proto__=D,f},E(s,m)}function I(s){return I=Object.setPrototypeOf?Object.getPrototypeOf:function(d){return d.__proto__||Object.getPrototypeOf(d)},I(s)}function w(){return w=Object.assign||function(s){for(var m=1;m<arguments.length;m++){var d=arguments[m];for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(s[f]=d[f])}return s},w.apply(this,arguments)}function T(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(s){}return!1}var y=function(){function s(d){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=d.fetchSetup||a,this.controller=new self.AbortController,this.stats=new A.LoadStats}var m=s.prototype;return m.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},m.abortInternal=function(){var f=this.response;(!f||!f.ok)&&(this.stats.aborted=!0,this.controller.abort())},m.abort=function(){var f;this.abortInternal(),(f=this.callbacks)!==null&&f!==void 0&&f.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},m.load=function(f,D,v){var h=this,p=this.stats;if(p.loading.start)throw new Error("Loader can only be used once.");p.loading.start=self.performance.now();var c=u(f,this.controller.signal),o=v.onProgress,x=f.responseType==="arraybuffer",g=x?"byteLength":"length";this.context=f,this.config=D,this.callbacks=v,this.request=this.fetchSetup(f,c),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){h.abortInternal(),v.onTimeout(p,f,h.response)},D.timeout),self.fetch(this.request).then(function(C){if(h.response=h.loader=C,!C.ok){var _=C.status,z=C.statusText;throw new l(z||"fetch, bad network response",_,C)}return p.loading.first=Math.max(self.performance.now(),p.loading.start),p.total=parseInt(C.headers.get("Content-Length")||"0"),o&&Object(H.isFiniteNumber)(D.highWaterMark)?h.loadProgressively(C,p,f,D.highWaterMark,o):x?C.arrayBuffer():C.text()}).then(function(C){var _=h.response;self.clearTimeout(h.requestTimeout),p.loading.end=Math.max(self.performance.now(),p.loading.first),p.loaded=p.total=C[g];var z={url:_.url,data:C};o&&!Object(H.isFiniteNumber)(D.highWaterMark)&&o(p,f,C,_),v.onSuccess(z,p,f,_)}).catch(function(C){if(self.clearTimeout(h.requestTimeout),p.aborted)return;var _=C.code||0;v.onError({code:_,text:C.message},f,C.details)})},m.getCacheAge=function(){var f=null;if(this.response){var D=this.response.headers.get("age");f=D?parseFloat(D):null}return f},m.loadProgressively=function(f,D,v,h,p){h===void 0&&(h=0);var c=new k.default,o=f.body.getReader(),x=function g(){return o.read().then(function(C){if(C.done)return c.dataLength&&p(D,v,c.flush(),f),Promise.resolve(new ArrayBuffer(0));var _=C.value,z=_.length;return D.loaded+=z,z<h||c.dataLength?(c.push(_),c.dataLength>=h&&p(D,v,c.flush(),f)):p(D,v,_,f),g()}).catch(function(){return Promise.reject()})};return x()},s}();function u(s,m){var d={method:"GET",mode:"cors",credentials:"same-origin",signal:m,headers:new self.Headers(w({},s.headers))};return s.rangeEnd&&d.headers.set("Range","bytes="+s.rangeStart+"-"+String(s.rangeEnd-1)),d}function a(s,m){return new self.Request(s.url,m)}var l=function(s){W(m,s);function m(d,f,D){var v;return v=s.call(this,d)||this,v.code=void 0,v.details=void 0,v.code=f,v.details=D,v}return m}(U(Error));V.default=y},"./src/utils/imsc1-ttml-parser.ts":function(de,V,O){"use strict";O.r(V),O.d(V,"IMSC1_CODEC",function(){return b}),O.d(V,"parseIMSC1",function(){return T});var H=O("./src/utils/mp4-tools.ts"),A=O("./src/utils/vttparser.ts"),k=O("./src/utils/vttcue.ts"),W=O("./src/demux/id3.ts"),U=O("./src/utils/timescale-conversion.ts"),P=O("./src/utils/webvtt-parser.ts");function L(){return L=Object.assign||function(h){for(var p=1;p<arguments.length;p++){var c=arguments[p];for(var o in c)Object.prototype.hasOwnProperty.call(c,o)&&(h[o]=c[o])}return h},L.apply(this,arguments)}var b="stpp.ttml.im1t",E=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,I=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,w={left:"start",center:"center",right:"end",start:"start",end:"end"};function T(h,p,c,o,x){var g=Object(H.findBox)(new Uint8Array(h),["mdat"]);if(g.length===0){x(new Error("Could not parse IMSC1 mdat"));return}var C=g[0],_=Object(W.utf8ArrayToStr)(new Uint8Array(h,C.start,C.end-C.start)),z=Object(U.toTimescaleFromScale)(p,1,c);try{o(y(_,z))}catch(Y){x(Y)}}function y(h,p){var c=new DOMParser,o=c.parseFromString(h,"text/xml"),x=o.getElementsByTagName("tt")[0];if(!x)throw new Error("Invalid ttml");var g={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},C=Object.keys(g).reduce(function(G,j){return G[j]=x.getAttribute("ttp:"+j)||g[j],G},{}),_=x.getAttribute("xml:space")!=="preserve",z=a(u(x,"styling","style")),Y=a(u(x,"layout","region")),oe=u(x,"body","[begin]");return[].map.call(oe,function(G){var j=l(G,_);if(!j||!G.hasAttribute("begin"))return null;var se=f(G.getAttribute("begin"),C),fe=f(G.getAttribute("dur"),C),Se=f(G.getAttribute("end"),C);if(se===null)throw d(G);if(Se===null){if(fe===null)throw d(G);Se=se+fe}var ke=new k.default(se-p,Se-p,j);ke.id=Object(P.generateCueId)(ke.startTime,ke.endTime,ke.text);var Je=Y[G.getAttribute("region")],_e=z[G.getAttribute("style")];ke.position=10,ke.size=80;var Qe=s(Je,_e),Ue=Qe.textAlign;if(Ue){var Fe=w[Ue];Fe&&(ke.lineAlign=Fe),ke.align=Ue}return L(ke,Qe),ke}).filter(function(G){return G!==null})}function u(h,p,c){var o=h.getElementsByTagName(p)[0];return o?[].slice.call(o.querySelectorAll(c)):[]}function a(h){return h.reduce(function(p,c){var o=c.getAttribute("xml:id");return o&&(p[o]=c),p},{})}function l(h,p){return[].slice.call(h.childNodes).reduce(function(c,o,x){var g;return o.nodeName==="br"&&x?c+`
`:(g=o.childNodes)!==null&&g!==void 0&&g.length?l(o,p):p?c+o.textContent.trim().replace(/\s+/g," "):c+o.textContent},"")}function s(h,p){var c="http://www.w3.org/ns/ttml#styling",o=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return o.reduce(function(x,g){var C=m(p,c,g)||m(h,c,g);return C&&(x[g]=C),x},{})}function m(h,p,c){return h.hasAttributeNS(p,c)?h.getAttributeNS(p,c):null}function d(h){return new Error("Could not parse ttml timestamp "+h)}function f(h,p){if(!h)return null;var c=Object(A.parseTimeStamp)(h);return c===null&&(E.test(h)?c=D(h,p):I.test(h)&&(c=v(h,p))),c}function D(h,p){var c=E.exec(h),o=(c[4]|0)+(c[5]|0)/p.subFrameRate;return(c[1]|0)*3600+(c[2]|0)*60+(c[3]|0)+o/p.frameRate}function v(h,p){var c=I.exec(h),o=Number(c[1]),x=c[2];switch(x){case"h":return o*3600;case"m":return o*60;case"ms":return o*1e3;case"f":return o/p.frameRate;case"t":return o/p.tickRate}return o}},"./src/utils/logger.ts":function(de,V,O){"use strict";O.r(V),O.d(V,"enableLogs",function(){return P}),O.d(V,"logger",function(){return L});var H=function(){},A={trace:H,debug:H,log:H,warn:H,info:H,error:H},k=A;function W(b){var E=self.console[b];return E?E.bind(self.console,"["+b+"] >"):H}function U(b){for(var E=arguments.length,I=new Array(E>1?E-1:0),w=1;w<E;w++)I[w-1]=arguments[w];I.forEach(function(T){k[T]=b[T]?b[T].bind(b):W(T)})}function P(b){if(self.console&&b===!0||typeof b=="object"){U(b,"debug","log","info","warn","error");try{k.log()}catch(E){k=A}}else k=A}var L=k},"./src/utils/mediakeys-helper.ts":function(de,V,O){"use strict";O.r(V),O.d(V,"KeySystems",function(){return H}),O.d(V,"requestMediaKeySystemAccess",function(){return A});var H;(function(k){k.WIDEVINE="com.widevine.alpha",k.PLAYREADY="com.microsoft.playready"})(H||(H={}));var A=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(de,V,O){"use strict";O.r(V),O.d(V,"getMediaSource",function(){return H});function H(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(de,V,O){"use strict";O.r(V),O.d(V,"bin2str",function(){return U}),O.d(V,"readUint16",function(){return P}),O.d(V,"readUint32",function(){return L}),O.d(V,"writeUint32",function(){return b}),O.d(V,"findBox",function(){return E}),O.d(V,"parseSegmentIndex",function(){return I}),O.d(V,"parseInitSegment",function(){return w}),O.d(V,"getStartDTS",function(){return T}),O.d(V,"getDuration",function(){return y}),O.d(V,"computeRawDurationFromSamples",function(){return u}),O.d(V,"offsetStartDTS",function(){return a}),O.d(V,"segmentValidRange",function(){return l}),O.d(V,"appendUint8Array",function(){return s});var H=O("./src/utils/typed-array.ts"),A=O("./src/loader/fragment.ts"),k=Math.pow(2,32)-1,W=[].push;function U(m){return String.fromCharCode.apply(null,m)}function P(m,d){"data"in m&&(d+=m.start,m=m.data);var f=m[d]<<8|m[d+1];return f<0?65536+f:f}function L(m,d){"data"in m&&(d+=m.start,m=m.data);var f=m[d]<<24|m[d+1]<<16|m[d+2]<<8|m[d+3];return f<0?4294967296+f:f}function b(m,d,f){"data"in m&&(d+=m.start,m=m.data),m[d]=f>>24,m[d+1]=f>>16&255,m[d+2]=f>>8&255,m[d+3]=f&255}function E(m,d){var f=[];if(!d.length)return f;var D,v,h;"data"in m?(D=m.data,v=m.start,h=m.end):(D=m,v=0,h=D.byteLength);for(var p=v;p<h;){var c=L(D,p),o=U(D.subarray(p+4,p+8)),x=c>1?p+c:h;if(o===d[0])if(d.length===1)f.push({data:D,start:p+8,end:x});else{var g=E({data:D,start:p+8,end:x},d.slice(1));g.length&&W.apply(f,g)}p=x}return f}function I(m){var d=E(m,["moov"]),f=d[0],D=f?f.end:null,v=E(m,["sidx"]);if(!v||!v[0])return null;var h=[],p=v[0],c=p.data[0],o=c===0?8:16,x=L(p,o);o+=4;var g=0,C=0;c===0?o+=8:o+=16,o+=2;var _=p.end+C,z=P(p,o);o+=2;for(var Y=0;Y<z;Y++){var oe=o,G=L(p,oe);oe+=4;var j=G&2147483647,se=(G&2147483648)>>>31;if(se===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var fe=L(p,oe);oe+=4,h.push({referenceSize:j,subsegmentDuration:fe,info:{duration:fe/x,start:_,end:_+j-1}}),_+=j,oe+=4,o=oe}return{earliestPresentationTime:g,timescale:x,version:c,referencesCount:z,references:h,moovEndOffset:D}}function w(m){for(var d=[],f=E(m,["moov","trak"]),D=0;D<f.length;D++){var v=f[D],h=E(v,["tkhd"])[0];if(h){var p=h.data[h.start],c=p===0?12:20,o=L(h,c),x=E(v,["mdia","mdhd"])[0];if(x){p=x.data[x.start],c=p===0?12:20;var g=L(x,c),C=E(v,["mdia","hdlr"])[0];if(C){var _=U(C.data.subarray(C.start+8,C.start+12)),z={soun:A.ElementaryStreamTypes.AUDIO,vide:A.ElementaryStreamTypes.VIDEO}[_];if(z){var Y=E(v,["mdia","minf","stbl","stsd"])[0],oe=void 0;Y&&(oe=U(Y.data.subarray(Y.start+12,Y.start+16))),d[o]={timescale:g,type:z},d[z]={timescale:g,id:o,codec:oe}}}}}}var G=E(m,["moov","mvex","trex"]);return G.forEach(function(j){var se=L(j,4),fe=d[se];fe&&(fe.default={duration:L(j,12),flags:L(j,20)})}),d}function T(m,d){return E(d,["moof","traf"]).reduce(function(f,D){var v=E(D,["tfdt"])[0],h=v.data[v.start],p=E(D,["tfhd"]).reduce(function(c,o){var x=L(o,4),g=m[x];if(g){var C=L(v,4);h===1&&(C*=Math.pow(2,32),C+=L(v,8));var _=g.timescale||9e4,z=C/_;if(isFinite(z)&&(c===null||z<c))return z}return c},null);return p!==null&&isFinite(p)&&(f===null||p<f)?p:f},null)||0}function y(m,d){for(var f=0,D=0,v=0,h=E(m,["moof","traf"]),p=0;p<h.length;p++){var c=h[p],o=E(c,["tfhd"])[0],x=L(o,4),g=d[x];if(!g)continue;var C=g.default,_=L(o,0)|(C==null?void 0:C.flags),z=C==null?void 0:C.duration;_&8&&(_&2?z=L(o,12):z=L(o,8));for(var Y=g.timescale||9e4,oe=E(c,["trun"]),G=0;G<oe.length;G++){if(z){var j=L(oe[G],4);f=z*j}else f=u(oe[G]);g.type===A.ElementaryStreamTypes.VIDEO?D+=f/Y:g.type===A.ElementaryStreamTypes.AUDIO&&(v+=f/Y)}}if(D===0&&v===0){var se=I(m);if(se!=null&&se.references)return se.references.reduce(function(fe,Se){return fe+Se.info.duration||0},0)}return D||v}function u(m){var d=L(m,0),f=8;d&1&&(f+=4),d&4&&(f+=4);for(var D=0,v=L(m,4),h=0;h<v;h++){if(d&256){var p=L(m,f);D+=p,f+=4}d&512&&(f+=4),d&1024&&(f+=4),d&2048&&(f+=4)}return D}function a(m,d,f){E(d,["moof","traf"]).forEach(function(D){E(D,["tfhd"]).forEach(function(v){var h=L(v,4),p=m[h];if(!p)return;var c=p.timescale||9e4;E(D,["tfdt"]).forEach(function(o){var x=o.data[o.start],g=L(o,4);if(x===0)b(o,4,g-f*c);else{g*=Math.pow(2,32),g+=L(o,8),g-=f*c,g=Math.max(g,0);var C=Math.floor(g/(k+1)),_=Math.floor(g%(k+1));b(o,4,C),b(o,8,_)}})})})}function l(m){var d={valid:null,remainder:null},f=E(m,["moof"]);if(f){if(f.length<2)return d.remainder=m,d}else return d;var D=f[f.length-1];return d.valid=Object(H.sliceUint8)(m,0,D.start-8),d.remainder=Object(H.sliceUint8)(m,D.start-8),d}function s(m,d){var f=new Uint8Array(m.length+d.length);return f.set(m),f.set(d,m.length),f}},"./src/utils/output-filter.ts":function(de,V,O){"use strict";O.r(V),O.d(V,"default",function(){return H});var H=function(){function A(W,U){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=W,this.trackName=U}var k=A.prototype;return k.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},k.newCue=function(U,P,L){(this.startTime===null||this.startTime>U)&&(this.startTime=U),this.endTime=P,this.screen=L,this.timelineController.createCaptionsTrack(this.trackName)},k.reset=function(){this.cueRanges=[]},A}()},"./src/utils/texttrack-utils.ts":function(de,V,O){"use strict";O.r(V),O.d(V,"sendAddTrackEvent",function(){return A}),O.d(V,"addCueToTrack",function(){return k}),O.d(V,"clearCurrentCues",function(){return W}),O.d(V,"removeCuesInRange",function(){return U}),O.d(V,"getCuesInRange",function(){return L});var H=O("./src/utils/logger.ts");function A(b,E){var I;try{I=new Event("addtrack")}catch(w){I=document.createEvent("Event"),I.initEvent("addtrack",!1,!1)}I.track=b,E.dispatchEvent(I)}function k(b,E){var I=b.mode;if(I==="disabled"&&(b.mode="hidden"),b.cues&&!b.cues.getCueById(E.id))try{if(b.addCue(E),!b.cues.getCueById(E.id))throw new Error("addCue is failed for: "+E)}catch(T){H.logger.debug("[texttrack-utils]: "+T);var w=new self.TextTrackCue(E.startTime,E.endTime,E.text);w.id=E.id,b.addCue(w)}I==="disabled"&&(b.mode=I)}function W(b){var E=b.mode;if(E==="disabled"&&(b.mode="hidden"),b.cues)for(var I=b.cues.length;I--;)b.removeCue(b.cues[I]);E==="disabled"&&(b.mode=E)}function U(b,E,I){var w=b.mode;if(w==="disabled"&&(b.mode="hidden"),b.cues&&b.cues.length>0)for(var T=L(b.cues,E,I),y=0;y<T.length;y++)b.removeCue(T[y]);w==="disabled"&&(b.mode=w)}function P(b,E){if(E<b[0].startTime)return 0;var I=b.length-1;if(E>b[I].endTime)return-1;for(var w=0,T=I;w<=T;){var y=Math.floor((T+w)/2);if(E<b[y].startTime)T=y-1;else if(E>b[y].startTime&&w<I)w=y+1;else return y}return b[w].startTime-E<E-b[T].startTime?w:T}function L(b,E,I){var w=[],T=P(b,E);if(T>-1)for(var y=T,u=b.length;y<u;y++){var a=b[y];if(a.startTime>=E&&a.endTime<=I)w.push(a);else if(a.startTime>I)return w}return w}},"./src/utils/time-ranges.ts":function(de,V,O){"use strict";O.r(V);var H={toString:function(k){for(var W="",U=k.length,P=0;P<U;P++)W+="["+k.start(P).toFixed(3)+","+k.end(P).toFixed(3)+"]";return W}};V.default=H},"./src/utils/timescale-conversion.ts":function(de,V,O){"use strict";O.r(V),O.d(V,"toTimescaleFromBase",function(){return A}),O.d(V,"toTimescaleFromScale",function(){return k}),O.d(V,"toMsFromMpegTsClock",function(){return W}),O.d(V,"toMpegTsClockFromTimescale",function(){return U});var H=9e4;function A(P,L,b,E){b===void 0&&(b=1),E===void 0&&(E=!1);var I=P*L*b;return E?Math.round(I):I}function k(P,L,b,E){return b===void 0&&(b=1),E===void 0&&(E=!1),A(P,L,1/b,E)}function W(P,L){return L===void 0&&(L=!1),A(P,1e3,1/H,L)}function U(P,L){return L===void 0&&(L=1),A(P,H,1/L)}},"./src/utils/typed-array.ts":function(de,V,O){"use strict";O.r(V),O.d(V,"sliceUint8",function(){return H});function H(A,k,W){return Uint8Array.prototype.slice?A.slice(k,W):new Uint8Array(Array.prototype.slice.call(A,k,W))}},"./src/utils/vttcue.ts":function(de,V,O){"use strict";O.r(V),V.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var H=["","lr","rl"],A=["start","middle","end","left","right"];function k(b,E){if(typeof E!="string")return!1;if(!Array.isArray(b))return!1;var I=E.toLowerCase();return~b.indexOf(I)?I:!1}function W(b){return k(H,b)}function U(b){return k(A,b)}function P(b){for(var E=arguments.length,I=new Array(E>1?E-1:0),w=1;w<E;w++)I[w-1]=arguments[w];for(var T=1;T<arguments.length;T++){var y=arguments[T];for(var u in y)b[u]=y[u]}return b}function L(b,E,I){var w=this,T={enumerable:!0};w.hasBeenReset=!1;var y="",u=!1,a=b,l=E,s=I,m=null,d="",f=!0,D="auto",v="start",h=50,p="middle",c=50,o="middle";Object.defineProperty(w,"id",P({},T,{get:function(){return y},set:function(g){y=""+g}})),Object.defineProperty(w,"pauseOnExit",P({},T,{get:function(){return u},set:function(g){u=!!g}})),Object.defineProperty(w,"startTime",P({},T,{get:function(){return a},set:function(g){if(typeof g!="number")throw new TypeError("Start time must be set to a number.");a=g,this.hasBeenReset=!0}})),Object.defineProperty(w,"endTime",P({},T,{get:function(){return l},set:function(g){if(typeof g!="number")throw new TypeError("End time must be set to a number.");l=g,this.hasBeenReset=!0}})),Object.defineProperty(w,"text",P({},T,{get:function(){return s},set:function(g){s=""+g,this.hasBeenReset=!0}})),Object.defineProperty(w,"region",P({},T,{get:function(){return m},set:function(g){m=g,this.hasBeenReset=!0}})),Object.defineProperty(w,"vertical",P({},T,{get:function(){return d},set:function(g){var C=W(g);if(C===!1)throw new SyntaxError("An invalid or illegal string was specified.");d=C,this.hasBeenReset=!0}})),Object.defineProperty(w,"snapToLines",P({},T,{get:function(){return f},set:function(g){f=!!g,this.hasBeenReset=!0}})),Object.defineProperty(w,"line",P({},T,{get:function(){return D},set:function(g){if(typeof g!="number"&&g!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");D=g,this.hasBeenReset=!0}})),Object.defineProperty(w,"lineAlign",P({},T,{get:function(){return v},set:function(g){var C=U(g);if(!C)throw new SyntaxError("An invalid or illegal string was specified.");v=C,this.hasBeenReset=!0}})),Object.defineProperty(w,"position",P({},T,{get:function(){return h},set:function(g){if(g<0||g>100)throw new Error("Position must be between 0 and 100.");h=g,this.hasBeenReset=!0}})),Object.defineProperty(w,"positionAlign",P({},T,{get:function(){return p},set:function(g){var C=U(g);if(!C)throw new SyntaxError("An invalid or illegal string was specified.");p=C,this.hasBeenReset=!0}})),Object.defineProperty(w,"size",P({},T,{get:function(){return c},set:function(g){if(g<0||g>100)throw new Error("Size must be between 0 and 100.");c=g,this.hasBeenReset=!0}})),Object.defineProperty(w,"align",P({},T,{get:function(){return o},set:function(g){var C=U(g);if(!C)throw new SyntaxError("An invalid or illegal string was specified.");o=C,this.hasBeenReset=!0}})),w.displayState=void 0}return L.prototype.getCueAsHTML=function(){var b=self.WebVTT;return b.convertCueToDOMTree(self,this.text)},L}()},"./src/utils/vttparser.ts":function(de,V,O){"use strict";O.r(V),O.d(V,"parseTimeStamp",function(){return k}),O.d(V,"fixLineBreaks",function(){return E}),O.d(V,"VTTParser",function(){return I});var H=O("./src/utils/vttcue.ts"),A=function(){function w(){}var T=w.prototype;return T.decode=function(u,a){if(!u)return"";if(typeof u!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(u))},w}();function k(w){function T(u,a,l,s){return(u|0)*3600+(a|0)*60+(l|0)+parseFloat(s||0)}var y=w.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return y?parseFloat(y[2])>59?T(y[2],y[3],0,y[4]):T(y[1],y[2],y[3],y[4]):null}var W=function(){function w(){this.values=Object.create(null)}var T=w.prototype;return T.set=function(u,a){!this.get(u)&&a!==""&&(this.values[u]=a)},T.get=function(u,a,l){return l?this.has(u)?this.values[u]:a[l]:this.has(u)?this.values[u]:a},T.has=function(u){return u in this.values},T.alt=function(u,a,l){for(var s=0;s<l.length;++s)if(a===l[s]){this.set(u,a);break}},T.integer=function(u,a){/^-?\d+$/.test(a)&&this.set(u,parseInt(a,10))},T.percent=function(u,a){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(a)){var l=parseFloat(a);if(l>=0&&l<=100)return this.set(u,l),!0}return!1},w}();function U(w,T,y,u){var a=u?w.split(u):[w];for(var l in a){if(typeof a[l]!="string")continue;var s=a[l].split(y);if(s.length!==2)continue;var m=s[0],d=s[1];T(m,d)}}var P=new H.default(0,0,""),L=P.align==="middle"?"middle":"center";function b(w,T,y){var u=w;function a(){var m=k(w);if(m===null)throw new Error("Malformed timestamp: "+u);return w=w.replace(/^[^\sa-zA-Z-]+/,""),m}function l(m,d){var f=new W;U(m,function(h,p){var c;switch(h){case"region":for(var o=y.length-1;o>=0;o--)if(y[o].id===p){f.set(h,y[o].region);break}break;case"vertical":f.alt(h,p,["rl","lr"]);break;case"line":c=p.split(","),f.integer(h,c[0]),f.percent(h,c[0])&&f.set("snapToLines",!1),f.alt(h,c[0],["auto"]),c.length===2&&f.alt("lineAlign",c[1],["start",L,"end"]);break;case"position":c=p.split(","),f.percent(h,c[0]),c.length===2&&f.alt("positionAlign",c[1],["start",L,"end","line-left","line-right","auto"]);break;case"size":f.percent(h,p);break;case"align":f.alt(h,p,["start",L,"end","left","right"]);break}},/:/,/\s/),d.region=f.get("region",null),d.vertical=f.get("vertical","");var D=f.get("line","auto");D==="auto"&&P.line===-1&&(D=-1),d.line=D,d.lineAlign=f.get("lineAlign","start"),d.snapToLines=f.get("snapToLines",!0),d.size=f.get("size",100),d.align=f.get("align",L);var v=f.get("position","auto");v==="auto"&&P.position===50&&(v=d.align==="start"||d.align==="left"?0:d.align==="end"||d.align==="right"?100:50),d.position=v}function s(){w=w.replace(/^\s+/,"")}if(s(),T.startTime=a(),s(),w.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+u);w=w.substr(3),s(),T.endTime=a(),s(),l(w,T)}function E(w){return w.replace(/<br(?: \/)?>/gi,`
`)}var I=function(){function w(){this.state="INITIAL",this.buffer="",this.decoder=new A,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var T=w.prototype;return T.parse=function(u){var a=this;u&&(a.buffer+=a.decoder.decode(u,{stream:!0}));function l(){var v=a.buffer,h=0;for(v=E(v);h<v.length&&v[h]!=="\r"&&v[h]!==`
`;)++h;var p=v.substr(0,h);return v[h]==="\r"&&++h,v[h]===`
`&&++h,a.buffer=v.substr(h),p}function s(v){U(v,function(h,p){},/:/)}try{var m="";if(a.state==="INITIAL"){if(!/\r\n|\n/.test(a.buffer))return this;m=l();var d=m.match(/^()?WEBVTT([ \t].*)?$/);if(!d||!d[0])throw new Error("Malformed WebVTT signature.");a.state="HEADER"}for(var f=!1;a.buffer;){if(!/\r\n|\n/.test(a.buffer))return this;f?f=!1:m=l();switch(a.state){case"HEADER":/:/.test(m)?s(m):m||(a.state="ID");continue;case"NOTE":m||(a.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(m)){a.state="NOTE";break}if(!m)continue;if(a.cue=new H.default(0,0,""),a.state="CUE",m.indexOf("-->")===-1){a.cue.id=m;continue}case"CUE":if(!a.cue){a.state="BADCUE";continue}try{b(m,a.cue,a.regionList)}catch(v){a.cue=null,a.state="BADCUE";continue}a.state="CUETEXT";continue;case"CUETEXT":{var D=m.indexOf("-->")!==-1;if(!m||D&&(f=!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+=m}continue;case"BADCUE":m||(a.state="ID")}}}catch(v){a.state==="CUETEXT"&&a.cue&&a.oncue&&a.oncue(a.cue),a.cue=null,a.state=a.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},T.flush=function(){var u=this;try{if((u.cue||u.state==="HEADER")&&(u.buffer+=`
`,u.parse()),u.state==="INITIAL"||u.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(a){u.onparsingerror&&u.onparsingerror(a)}return u.onflush&&u.onflush(),this},w}()},"./src/utils/webvtt-parser.ts":function(de,V,O){"use strict";O.r(V),O.d(V,"generateCueId",function(){return I}),O.d(V,"parseWebVTT",function(){return T});var H=O("./src/polyfills/number.ts"),A=O("./src/utils/vttparser.ts"),k=O("./src/demux/id3.ts"),W=O("./src/utils/timescale-conversion.ts"),U=O("./src/remux/mp4-remuxer.ts"),P=/\r\n|\n\r|\n|\r/g,L=function(u,a,l){return l===void 0&&(l=0),u.substr(l,a.length)===a},b=function(u){var a=parseInt(u.substr(-3)),l=parseInt(u.substr(-6,2)),s=parseInt(u.substr(-9,2)),m=u.length>9?parseInt(u.substr(0,u.indexOf(":"))):0;if(!Object(H.isFiniteNumber)(a)||!Object(H.isFiniteNumber)(l)||!Object(H.isFiniteNumber)(s)||!Object(H.isFiniteNumber)(m))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+u);return a+=1e3*l,a+=60*1e3*s,a+=60*60*1e3*m,a},E=function(u){for(var a=5381,l=u.length;l;)a=a*33^u.charCodeAt(--l);return(a>>>0).toString()};function I(y,u,a){return E(y.toString())+E(u.toString())+E(a)}var w=function(u,a,l){var s=u[a],m=u[s.prevCC];if(!m||!m.new&&s.new){u.ccOffset=u.presentationOffset=s.start,s.new=!1;return}for(;(d=m)!==null&&d!==void 0&&d.new;){var d;u.ccOffset+=s.start-m.start,s.new=!1,s=m,m=u[s.prevCC]}u.presentationOffset=l};function T(y,u,a,l,s,m,d,f){var D=new A.VTTParser,v=Object(k.utf8ArrayToStr)(new Uint8Array(y)).trim().replace(P,`
`).split(`
`),h=[],p=Object(W.toMpegTsClockFromTimescale)(u,a),c="00:00.000",o=0,x=0,g,C=!0,_=!1;D.oncue=function(z){var Y=l[s],oe=l.ccOffset,G=(o-p)/9e4;if(Y!=null&&Y.new&&(x!==void 0?oe=l.ccOffset=Y.start:w(l,s,G)),G&&(oe=G-l.presentationOffset),_){var j=z.endTime-z.startTime,se=Object(U.normalizePts)((z.startTime+oe-x)*9e4,m*9e4)/9e4;z.startTime=se,z.endTime=se+j}var fe=z.text.trim();z.text=decodeURIComponent(encodeURIComponent(fe)),z.id||(z.id=I(z.startTime,z.endTime,fe)),z.endTime>0&&h.push(z)},D.onparsingerror=function(z){g=z},D.onflush=function(){if(g){f(g);return}d(h)},v.forEach(function(z){if(C)if(L(z,"X-TIMESTAMP-MAP=")){C=!1,_=!0,z.substr(16).split(",").forEach(function(Y){L(Y,"LOCAL:")?c=Y.substr(6):L(Y,"MPEGTS:")&&(o=parseInt(Y.substr(7)))});try{x=b(c)/1e3}catch(Y){_=!1,g=Y}return}else z===""&&(C=!1);D.parse(z+`
`)}),D.flush()}},"./src/utils/xhr-loader.ts":function(de,V,O){"use strict";O.r(V);var H=O("./src/utils/logger.ts"),A=O("./src/loader/load-stats.ts"),k=/^age:\s*[\d.]+\s*$/m,W=function(){function U(L){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=void 0,this.loader=null,this.stats=void 0,this.xhrSetup=L?L.xhrSetup:null,this.stats=new A.LoadStats,this.retryDelay=0}var P=U.prototype;return P.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},P.abortInternal=function(){var b=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),b&&(b.onreadystatechange=null,b.onprogress=null,b.readyState!==4&&(this.stats.aborted=!0,b.abort()))},P.abort=function(){var b;this.abortInternal(),(b=this.callbacks)!==null&&b!==void 0&&b.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},P.load=function(b,E,I){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=b,this.config=E,this.callbacks=I,this.retryDelay=E.retryDelay,this.loadInternal()},P.loadInternal=function(){var b=this.config,E=this.context;if(!b)return;var I=this.loader=new self.XMLHttpRequest,w=this.stats;w.loading.first=0,w.loaded=0;var T=this.xhrSetup;try{if(T)try{T(I,E.url)}catch(a){I.open("GET",E.url,!0),T(I,E.url)}I.readyState||I.open("GET",E.url,!0);var y=this.context.headers;if(y)for(var u in y)I.setRequestHeader(u,y[u])}catch(a){this.callbacks.onError({code:I.status,text:a.message},E,I);return}E.rangeEnd&&I.setRequestHeader("Range","bytes="+E.rangeStart+"-"+(E.rangeEnd-1)),I.onreadystatechange=this.readystatechange.bind(this),I.onprogress=this.loadprogress.bind(this),I.responseType=E.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),b.timeout),I.send()},P.readystatechange=function(){var b=this.context,E=this.loader,I=this.stats;if(!b||!E)return;var w=E.readyState,T=this.config;if(I.aborted)return;if(w>=2)if(self.clearTimeout(this.requestTimeout),I.loading.first===0&&(I.loading.first=Math.max(self.performance.now(),I.loading.start)),w===4){E.onreadystatechange=null,E.onprogress=null;var y=E.status;if(y>=200&&y<300){I.loading.end=Math.max(self.performance.now(),I.loading.first);var u,a;if(b.responseType==="arraybuffer"?(u=E.response,a=u.byteLength):(u=E.responseText,a=u.length),I.loaded=I.total=a,!this.callbacks)return;var l=this.callbacks.onProgress;if(l&&l(I,b,u,E),!this.callbacks)return;var s={url:E.responseURL,data:u};this.callbacks.onSuccess(s,I,b,E)}else I.retry>=T.maxRetry||y>=400&&y<499?(H.logger.error(y+" while loading "+b.url),this.callbacks.onError({code:y,text:E.statusText},b,E)):(H.logger.warn(y+" while loading "+b.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,T.maxRetryDelay),I.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),T.timeout)},P.loadtimeout=function(){H.logger.warn("timeout while loading "+this.context.url);var b=this.callbacks;b&&(this.abortInternal(),b.onTimeout(this.stats,this.context,this.loader))},P.loadprogress=function(b){var E=this.stats;E.loaded=b.loaded,b.lengthComputable&&(E.total=b.total)},P.getCacheAge=function(){var b=null;if(this.loader&&k.test(this.loader.getAllResponseHeaders())){var E=this.loader.getResponseHeader("age");b=E?parseFloat(E):null}return b},U}();V.default=W}}).default})},vHTk:function(Ge,We,X){Ge.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},yslc:function(Ge,We){Ge.exports="data:image/png;base64,iVBORw0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