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.
440 lines
1.1 MiB
440 lines
1.1 MiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[160,5,7],{"+NIl":function(ht,be,Z){(function(re){re(Z("VrN/"))})(function(re){"use strict";re.defineMode("stex",function($,P){"use strict";function X(h,o){h.cmdState.push(o)}function U(h){return h.cmdState.length>0?h.cmdState[h.cmdState.length-1]:null}function k(h){var o=h.cmdState.pop();o&&o.closeBracket()}function G(h){for(var o=h.cmdState,c=o.length-1;c>=0;c--){var l=o[c];if(l.name=="DEFAULT")continue;return l}return{styleIdentifier:function(){return null}}}function H(h,o,c){return function(){this.name=h,this.bracketNo=0,this.style=o,this.styles=c,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var n={};n.importmodule=H("importmodule","tag",["string","builtin"]),n.documentclass=H("documentclass","tag",["","atom"]),n.usepackage=H("usepackage","tag",["atom"]),n.begin=H("begin","tag",["atom"]),n.end=H("end","tag",["atom"]),n.label=H("label","tag",["atom"]),n.ref=H("ref","tag",["atom"]),n.eqref=H("eqref","tag",["atom"]),n.cite=H("cite","tag",["atom"]),n.bibitem=H("bibitem","tag",["atom"]),n.Bibitem=H("Bibitem","tag",["atom"]),n.RBibitem=H("RBibitem","tag",["atom"]),n.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function D(h,o){h.f=o}function g(h,o){var c;if(h.match(/^\\[a-zA-Z@]+/)){var l=h.current().slice(1);return c=n.hasOwnProperty(l)?n[l]:n.DEFAULT,c=new c,X(o,c),D(o,m),c.style}if(h.match(/^\\[$&%#{}_]/))return"tag";if(h.match(/^\\[,;!\/\\]/))return"tag";if(h.match("\\["))return D(o,function(s,a){return p(s,a,"\\]")}),"keyword";if(h.match("\\("))return D(o,function(s,a){return p(s,a,"\\)")}),"keyword";if(h.match("$$"))return D(o,function(s,a){return p(s,a,"$$")}),"keyword";if(h.match("$"))return D(o,function(s,a){return p(s,a,"$")}),"keyword";var u=h.next();if(u=="%")return h.skipToEnd(),"comment";if(u=="}"||u=="]"){if(c=U(o),c)c.closeBracket(u),D(o,m);else return"error";return"bracket"}else return u=="{"||u=="["?(c=n.DEFAULT,c=new c,X(o,c),"bracket"):/\d/.test(u)?(h.eatWhile(/[\w.%]/),"atom"):(h.eatWhile(/[\w\-_]/),c=G(o),c.name=="begin"&&(c.argument=h.current()),c.styleIdentifier())}function p(h,o,c){if(h.eatSpace())return null;if(c&&h.match(c))return D(o,g),"keyword";if(h.match(/^\\[a-zA-Z@]+/))return"tag";if(h.match(/^[a-zA-Z]+/))return"variable-2";if(h.match(/^\\[$&%#{}_]/))return"tag";if(h.match(/^\\[,;!\/]/))return"tag";if(h.match(/^[\^_&]/))return"tag";if(h.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(h.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var l=h.next();return l=="{"||l=="}"||l=="["||l=="]"||l=="("||l==")"?"bracket":l=="%"?(h.skipToEnd(),"comment"):"error"}function m(h,o){var c=h.peek(),l;return c=="{"||c=="["?(l=U(o),l.openBracket(c),h.eat(c),D(o,g),"bracket"):/[ \t\r]/.test(c)?(h.eat(c),null):(D(o,g),k(o),g(h,o))}return{startState:function(){var h=P.inMathMode?function(o,c){return p(o,c)}:g;return{cmdState:[],f:h}},copyState:function(h){return{cmdState:h.cmdState.slice(),f:h.f}},token:function(h,o){return o.f(h,o)},blankLine:function(h){h.f=g,h.cmdState.length=0},lineComment:"%"}}),re.defineMIME("text/x-stex","stex"),re.defineMIME("text/x-latex","stex")})},"+ua5":function(ht,be,Z){},"/cxE":function(ht,be,Z){"use strict";Z.d(be,"f",function(){return P}),Z.d(be,"g",function(){return X}),Z.d(be,"h",function(){return U}),Z.d(be,"e",function(){return G}),Z.d(be,"b",function(){return H}),Z.d(be,"c",function(){return n}),Z.d(be,"d",function(){return D}),Z.d(be,"a",function(){return g});class re{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(p){setTimeout(()=>{throw p.stack?new Error(p.message+`
|
|
|
|
`+p.stack):p},0)}}emit(p){this.listeners.forEach(m=>{m(p)})}onUnexpectedError(p){this.unexpectedErrorHandler(p),this.emit(p)}onUnexpectedExternalError(p){this.unexpectedErrorHandler(p)}}const $=new re;function P(p){G(p)||$.onUnexpectedError(p);return}function X(p){G(p)||$.onUnexpectedExternalError(p);return}function U(p){if(p instanceof Error){let{name:m,message:h}=p;const o=p.stacktrace||p.stack;return{$isError:!0,name:m,message:h,stack:o}}return p}const k="Canceled";function G(p){return p instanceof Error&&p.name===k&&p.message===k}function H(){const p=new Error(k);return p.name=p.message,p}function n(p){return p?new Error(`Illegal argument: ${p}`):new Error("Illegal argument")}function D(p){return p?new Error(`Illegal state: ${p}`):new Error("Illegal state")}class g extends Error{constructor(p){super("NotSupported");p&&(this.message=p)}}},"19Vz":function(ht,be,Z){(function(re){re(Z("VrN/"))})(function(re){re.defineOption("placeholder","",function(H,n,D){var g=D&&D!=re.Init;if(n&&!g)H.on("blur",U),H.on("change",k),H.on("swapDoc",k),re.on(H.getInputField(),"compositionupdate",H.state.placeholderCompose=function(){X(H)}),k(H);else if(!n&&g){H.off("blur",U),H.off("change",k),H.off("swapDoc",k),re.off(H.getInputField(),"compositionupdate",H.state.placeholderCompose),$(H);var p=H.getWrapperElement();p.className=p.className.replace(" CodeMirror-empty","")}n&&!H.hasFocus()&&U(H)});function $(H){H.state.placeholder&&(H.state.placeholder.parentNode.removeChild(H.state.placeholder),H.state.placeholder=null)}function P(H){$(H);var n=H.state.placeholder=document.createElement("pre");n.style.cssText="height: 0; overflow: visible",n.style.direction=H.getOption("direction"),n.className="CodeMirror-placeholder CodeMirror-line-like";var D=H.getOption("placeholder");typeof D=="string"&&(D=document.createTextNode(D)),n.appendChild(D),H.display.lineSpace.insertBefore(n,H.display.lineSpace.firstChild)}function X(H){setTimeout(function(){var n=!1,D=H.getInputField();D.nodeName=="TEXTAREA"?n=!D.value:H.lineCount()==1&&(n=!/[^\u200b]/.test(D.querySelector(".CodeMirror-line").textContent)),n?P(H):$(H)},20)}function U(H){G(H)&&P(H)}function k(H){var n=H.getWrapperElement(),D=G(H);n.className=n.className.replace(" CodeMirror-empty","")+(D?" CodeMirror-empty":""),D?P(H):$(H)}function G(H){return H.lineCount()===1&&H.getLine(0)===""}})},"1eCo":function(ht,be,Z){(function(re){re(Z("VrN/"))})(function(re){"use strict";var $={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},P={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};re.defineMode("xml",function(X,U){var k=X.indentUnit,G={},H=U.htmlMode?$:P;for(var n in H)G[n]=H[n];for(var n in U)G[n]=U[n];var D,g;function p(f,w){function v(B){return w.tokenize=B,B(f,w)}var b=f.next();if(b=="<")return f.eat("!")?f.eat("[")?f.match("CDATA[")?v(o("atom","]]>")):null:f.match("--")?v(o("comment","-->")):f.match("DOCTYPE",!0,!0)?(f.eatWhile(/[\w\._\-]/),v(c(1))):null:f.eat("?")?(f.eatWhile(/[\w\._\-]/),w.tokenize=o("meta","?>"),"meta"):(D=f.eat("/")?"closeTag":"openTag",w.tokenize=m,"tag bracket");if(b=="&"){var F;return f.eat("#")?f.eat("x")?F=f.eatWhile(/[a-fA-F\d]/)&&f.eat(";"):F=f.eatWhile(/[\d]/)&&f.eat(";"):F=f.eatWhile(/[\w\.\-:]/)&&f.eat(";"),F?"atom":"error"}else return f.eatWhile(/[^&<]/),null}p.isInText=!0;function m(f,w){var v=f.next();if(v==">"||v=="/"&&f.eat(">"))return w.tokenize=p,D=v==">"?"endTag":"selfcloseTag","tag bracket";if(v=="=")return D="equals",null;if(v=="<"){w.tokenize=p,w.state=a,w.tagName=w.tagStart=null;var b=w.tokenize(f,w);return b?b+" tag error":"tag error"}else return/[\'\"]/.test(v)?(w.tokenize=h(v),w.stringStartCol=f.column(),w.tokenize(f,w)):(f.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function h(f){var w=function(v,b){for(;!v.eol();)if(v.next()==f){b.tokenize=m;break}return"string"};return w.isInAttribute=!0,w}function o(f,w){return function(v,b){for(;!v.eol();){if(v.match(w)){b.tokenize=p;break}v.next()}return f}}function c(f){return function(w,v){for(var b;(b=w.next())!=null;){if(b=="<")return v.tokenize=c(f+1),v.tokenize(w,v);if(b==">")if(f==1){v.tokenize=p;break}else return v.tokenize=c(f-1),v.tokenize(w,v)}return"meta"}}function l(f,w,v){this.prev=f.context,this.tagName=w,this.indent=f.indented,this.startOfLine=v,(G.doNotIndent.hasOwnProperty(w)||f.context&&f.context.noIndent)&&(this.noIndent=!0)}function u(f){f.context&&(f.context=f.context.prev)}function s(f,w){for(var v;;){if(!f.context)return;if(v=f.context.tagName,!G.contextGrabbers.hasOwnProperty(v)||!G.contextGrabbers[v].hasOwnProperty(w))return;u(f)}}function a(f,w,v){return f=="openTag"?(v.tagStart=w.column(),A):f=="closeTag"?E:a}function A(f,w,v){return f=="word"?(v.tagName=w.current(),g="tag",O):G.allowMissingTagName&&f=="endTag"?(g="tag bracket",O(f,w,v)):(g="error",A)}function E(f,w,v){if(f=="word"){var b=w.current();return v.context&&v.context.tagName!=b&&G.implicitlyClosed.hasOwnProperty(v.context.tagName)&&u(v),v.context&&v.context.tagName==b||G.matchClosing===!1?(g="tag",S):(g="tag error",L)}else return G.allowMissingTagName&&f=="endTag"?(g="tag bracket",S(f,w,v)):(g="error",L)}function S(f,w,v){return f!="endTag"?(g="error",S):(u(v),a)}function L(f,w,v){return g="error",S(f,w,v)}function O(f,w,v){if(f=="word")return g="attribute",C;if(f=="endTag"||f=="selfcloseTag"){var b=v.tagName,F=v.tagStart;return v.tagName=v.tagStart=null,f=="selfcloseTag"||G.autoSelfClosers.hasOwnProperty(b)?s(v,b):(s(v,b),v.context=new l(v,b,F==v.indented)),a}return g="error",O}function C(f,w,v){return f=="equals"?T:(G.allowMissing||(g="error"),O(f,w,v))}function T(f,w,v){return f=="string"?x:f=="word"&&G.allowUnquoted?(g="string",O):(g="error",O(f,w,v))}function x(f,w,v){return f=="string"?x:O(f,w,v)}return{startState:function(f){var w={tokenize:p,state:a,indented:f||0,tagName:null,tagStart:null,context:null};return f!=null&&(w.baseIndent=f),w},token:function(f,w){if(!w.tagName&&f.sol()&&(w.indented=f.indentation()),f.eatSpace())return null;D=null;var v=w.tokenize(f,w);return(v||D)&&v!="comment"&&(g=null,w.state=w.state(D||v,f,w),g&&(v=g=="error"?v+" error":g)),v},indent:function(f,w,v){var b=f.context;if(f.tokenize.isInAttribute)return f.tagStart==f.indented?f.stringStartCol+1:f.indented+k;if(b&&b.noIndent)return re.Pass;if(f.tokenize!=m&&f.tokenize!=p)return v?v.match(/^(\s*)/)[0].length:0;if(f.tagName)return G.multilineTagIndentPastTag!==!1?f.tagStart+f.tagName.length+2:f.tagStart+k*(G.multilineTagIndentFactor||1);if(G.alignCDATA&&/<!\[CDATA\[/.test(w))return 0;var F=w&&/^<(\/)?([\w_:\.-]*)/.exec(w);if(F&&F[1])for(;b;)if(b.tagName==F[2]){b=b.prev;break}else if(G.implicitlyClosed.hasOwnProperty(b.tagName))b=b.prev;else break;else if(F)for(;b;){var B=G.contextGrabbers[b.tagName];if(B&&B.hasOwnProperty(F[2]))b=b.prev;else break}for(;b&&b.prev&&!b.startOfLine;)b=b.prev;return b?b.indent+k:f.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:G.htmlMode?"html":"xml",helperType:G.htmlMode?"html":"xml",skipAttribute:function(f){f.state==T&&(f.state=O)},xmlCurrentTag:function(f){return f.tagName?{name:f.tagName,close:f.type=="closeTag"}:null},xmlCurrentContext:function(f){for(var w=[],v=f.context;v;v=v.prev)v.tagName&&w.push(v.tagName);return w.reverse()}}}),re.defineMIME("text/xml","xml"),re.defineMIME("application/xml","xml"),re.mimeModes.hasOwnProperty("text/html")||re.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"24hK":function(ht,be,Z){"use strict";Z.d(be,"a",function(){return $});class re{constructor(P){this.element=P,this.next=re.Undefined,this.prev=re.Undefined}}re.Undefined=new re(void 0);class ${constructor(){this._first=re.Undefined,this._last=re.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===re.Undefined}clear(){let P=this._first;for(;P!==re.Undefined;){const X=P.next;P.prev=re.Undefined,P.next=re.Undefined,P=X}this._first=re.Undefined,this._last=re.Undefined,this._size=0}unshift(P){return this._insert(P,!1)}push(P){return this._insert(P,!0)}_insert(P,X){const U=new re(P);if(this._first===re.Undefined)this._first=U,this._last=U;else if(X){const G=this._last;this._last=U,U.prev=G,G.next=U}else{const G=this._first;this._first=U,U.next=G,G.prev=U}this._size+=1;let k=!1;return()=>{k||(k=!0,this._remove(U))}}shift(){if(this._first===re.Undefined)return;{const P=this._first.element;return this._remove(this._first),P}}pop(){if(this._last===re.Undefined)return;{const P=this._last.element;return this._remove(this._last),P}}_remove(P){if(P.prev!==re.Undefined&&P.next!==re.Undefined){const X=P.prev;X.next=P.next,P.next.prev=X}else P.prev===re.Undefined&&P.next===re.Undefined?(this._first=re.Undefined,this._last=re.Undefined):P.next===re.Undefined?(this._last=this._last.prev,this._last.next=re.Undefined):P.prev===re.Undefined&&(this._first=this._first.next,this._first.prev=re.Undefined);this._size-=1}*[Symbol.iterator](){let P=this._first;for(;P!==re.Undefined;)yield P.element,P=P.next}}},"3/fG":function(ht,be,Z){"use strict";Z.d(be,"a",function(){return $});function re(P,X){let U;return X.length===0?U=P:U=P.replace(/\{(\d+)\}/g,function(k,G){const H=G[0];return typeof X[H]!="undefined"?X[H]:k}),U}function $(P,X,...U){return re(X,U)}},"55Ip":function(ht,be,Z){"use strict";Z.d(be,"a",function(){return s});var re=Z("Ty5D"),$=Z("dI71"),P=Z("q1tI"),X=Z.n(P),U=Z("YS25"),k=Z("17x9"),G=Z.n(k),H=Z("wx14"),n=Z("zLVn"),D=Z("9R94"),g=function(T){Object($.a)(x,T);function x(){for(var w,v=arguments.length,b=new Array(v),F=0;F<v;F++)b[F]=arguments[F];return w=T.call.apply(T,[this].concat(b))||this,w.history=Object(U.a)(w.props),w}var f=x.prototype;return f.render=function(){return X.a.createElement(re.c,{history:this.history,children:this.props.children})},x}(X.a.Component),p=function(T){Object($.a)(x,T);function x(){for(var w,v=arguments.length,b=new Array(v),F=0;F<v;F++)b[F]=arguments[F];return w=T.call.apply(T,[this].concat(b))||this,w.history=Object(U.b)(w.props),w}var f=x.prototype;return f.render=function(){return X.a.createElement(re.c,{history:this.history,children:this.props.children})},x}(X.a.Component),m=function(x,f){return typeof x=="function"?x(f):x},h=function(x,f){return typeof x=="string"?Object(U.c)(x,null,null,f):x},o=function(x){return x},c=X.a.forwardRef;typeof c=="undefined"&&(c=o);function l(T){return!!(T.metaKey||T.altKey||T.ctrlKey||T.shiftKey)}var u=c(function(T,x){var f=T.innerRef,w=T.navigate,v=T.onClick,b=Object(n.a)(T,["innerRef","navigate","onClick"]),F=b.target,B=Object(H.a)({},b,{onClick:function(j){try{v&&v(j)}catch(N){throw j.preventDefault(),N}!j.defaultPrevented&&j.button===0&&(!F||F==="_self")&&!l(j)&&(j.preventDefault(),w())}});return o!==c?B.ref=x||f:B.ref=f,X.a.createElement("a",B)}),s=c(function(T,x){var f=T.component,w=f===void 0?u:f,v=T.replace,b=T.to,F=T.innerRef,B=Object(n.a)(T,["component","replace","to","innerRef"]);return X.a.createElement(re.e.Consumer,null,function(R){R||Object(D.a)(!1);var j=R.history,N=h(m(b,R.location),R.location),y=N?j.createHref(N):"",Y=Object(H.a)({},B,{href:y,navigate:function(){var ae=m(b,R.location),ue=v?j.replace:j.push;ue(ae)}});return o!==c?Y.ref=x||F:Y.innerRef=F,X.a.createElement(w,Y)})});if(!1)var a,A;var E=function(x){return x},S=X.a.forwardRef;typeof S=="undefined"&&(S=E);function L(){for(var T=arguments.length,x=new Array(T),f=0;f<T;f++)x[f]=arguments[f];return x.filter(function(w){return w}).join(" ")}var O=S(function(T,x){var f=T["aria-current"],w=f===void 0?"page":f,v=T.activeClassName,b=v===void 0?"active":v,F=T.activeStyle,B=T.className,R=T.exact,j=T.isActive,N=T.location,y=T.sensitive,Y=T.strict,ee=T.style,ae=T.to,ue=T.innerRef,Re=Object(n.a)(T,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return X.a.createElement(re.e.Consumer,null,function(Ee){Ee||Object(D.a)(!1);var xe=N||Ee.location,Ce=h(m(ae,xe),xe),Oe=Ce.pathname,pe=Oe&&Oe.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),de=pe?Object(re.f)(xe.pathname,{path:pe,exact:R,sensitive:y,strict:Y}):null,Me=!!(j?j(de,xe):de),tt=Me?L(B,b):B,We=Me?Object(H.a)({},ee,{},F):ee,rt=Object(H.a)({"aria-current":Me&&w||null,className:tt,style:We,to:Ce},Re);return E!==S?rt.ref=x||ue:rt.innerRef=ue,X.a.createElement(s,rt)})});if(!1)var C},"5VLF":function(ht,be,Z){"use strict";var re,$;function P(X,U,k){var G=function(H,n){return X.js_beautify(H,n)};return G.js=X.js_beautify,G.css=U.css_beautify,G.html=k.html_beautify,G.js_beautify=X.js_beautify,G.css_beautify=U.css_beautify,G.html_beautify=k.html_beautify,G}!(re=[Z("6UM0"),Z("TXwP"),Z("psGv")],$=function(X,U,k){return P(X,U,k)}.apply(be,re),$!==void 0&&(ht.exports=$))},"5Y4S":function(ht,be,Z){"use strict";Z.d(be,"a",function(){return P});var re=Z("MNsG");const $=re.b.performance&&typeof re.b.performance.now=="function";class P{constructor(X){this._highResolution=$&&X,this._startTime=this._now(),this._stopTime=-1}static create(X=!0){return new P(X)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?re.b.performance.now():Date.now()}}},"6UM0":function(ht,be,Z){var re,$;(function(){var P;(function(){"use strict";var U=[function(n,D,g){var p=g(1).Beautifier,m=g(5).Options;function h(o,c){var l=new p(o,c);return l.beautify()}n.exports=h,n.exports.defaultOptions=function(){return new m}},function(n,D,g){var p=g(2).Output,m=g(3).Token,h=g(4),o=g(5).Options,c=g(7).Tokenizer,l=g(7).line_starters,u=g(7).positionable_operators,s=g(7).TOKEN;function a(y,Y){return Y.indexOf(y)!==-1}function A(y){return y.replace(/^\s+/g,"")}function E(y){for(var Y={},ee=0;ee<y.length;ee++)Y[y[ee].replace(/-/g,"_")]=y[ee];return Y}function S(y,Y){return y&&y.type===s.RESERVED&&y.text===Y}function L(y,Y){return y&&y.type===s.RESERVED&&a(y.text,Y)}var O=["case","return","do","if","throw","else","await","break","continue","async"],C=["before-newline","after-newline","preserve-newline"],T=E(C),x=[T.before_newline,T.preserve_newline],f={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function w(y,Y){if(Y.multiline_frame||Y.mode===f.ForInitializer||Y.mode===f.Conditional)return;y.remove_indent(Y.start_line_index)}function v(y){y=y.replace(h.allLineBreaks,`
|
|
`);for(var Y=[],ee=y.indexOf(`
|
|
`);ee!==-1;)Y.push(y.substring(0,ee)),y=y.substring(ee+1),ee=y.indexOf(`
|
|
`);return y.length&&Y.push(y),Y}function b(y){return y===f.ArrayLiteral}function F(y){return a(y,[f.Expression,f.ForInitializer,f.Conditional])}function B(y,Y){for(var ee=0;ee<y.length;ee++){var ae=y[ee].trim();if(ae.charAt(0)!==Y)return!1}return!0}function R(y,Y){for(var ee=0,ae=y.length,ue;ee<ae;ee++)if(ue=y[ee],ue&&ue.indexOf(Y)!==0)return!1;return!0}function j(y,Y){Y=Y||{},this._source_text=y||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new o(Y)}j.prototype.create_flags=function(y,Y){var ee=0;y&&(ee=y.indentation_level,!this._output.just_added_newline()&&y.line_indent_level>ee&&(ee=y.line_indent_level));var ae={mode:Y,parent:y,last_token:y?y.last_token:new m(s.START_BLOCK,""),last_word:y?y.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:ee,alignment:0,line_indent_level:y?y.line_indent_level:ee,start_line_index:this._output.get_line_number(),ternary_depth:0};return ae},j.prototype._reset=function(y){var Y=y.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new p(this._options,Y),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(f.BlockStatement);var ee=new c(y,this._options);return this._tokens=ee.tokenize(),y},j.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var y,Y=this._reset(this._source_text),ee=this._options.eol;this._options.eol==="auto"&&(ee=`
|
|
`,Y&&h.lineBreak.test(Y||"")&&(ee=Y.match(h.lineBreak)[0]));for(var ae=this._tokens.next();ae;)this.handle_token(ae),this._last_last_text=this._flags.last_token.text,this._flags.last_token=ae,ae=this._tokens.next();return y=this._output.get_code(ee),y},j.prototype.handle_token=function(y,Y){y.type===s.START_EXPR?this.handle_start_expr(y):y.type===s.END_EXPR?this.handle_end_expr(y):y.type===s.START_BLOCK?this.handle_start_block(y):y.type===s.END_BLOCK?this.handle_end_block(y):y.type===s.WORD?this.handle_word(y):y.type===s.RESERVED?this.handle_word(y):y.type===s.SEMICOLON?this.handle_semicolon(y):y.type===s.STRING?this.handle_string(y):y.type===s.EQUALS?this.handle_equals(y):y.type===s.OPERATOR?this.handle_operator(y):y.type===s.COMMA?this.handle_comma(y):y.type===s.BLOCK_COMMENT?this.handle_block_comment(y,Y):y.type===s.COMMENT?this.handle_comment(y,Y):y.type===s.DOT?this.handle_dot(y):y.type===s.EOF?this.handle_eof(y):y.type===s.UNKNOWN?this.handle_unknown(y,Y):this.handle_unknown(y,Y)},j.prototype.handle_whitespace_and_comments=function(y,Y){var ee=y.newlines,ae=this._options.keep_array_indentation&&b(this._flags.mode);if(y.comments_before)for(var ue=y.comments_before.next();ue;)this.handle_whitespace_and_comments(ue,Y),this.handle_token(ue,Y),ue=y.comments_before.next();if(ae)for(var Re=0;Re<ee;Re+=1)this.print_newline(Re>0,Y);else if(this._options.max_preserve_newlines&&ee>this._options.max_preserve_newlines&&(ee=this._options.max_preserve_newlines),this._options.preserve_newlines&&ee>1){this.print_newline(!1,Y);for(var Ee=1;Ee<ee;Ee+=1)this.print_newline(!0,Y)}};var N=["async","break","continue","return","throw","yield"];j.prototype.allow_wrap_or_preserved_newline=function(y,Y){if(Y=Y===void 0?!1:Y,this._output.just_added_newline())return;var ee=this._options.preserve_newlines&&y.newlines||Y,ae=a(this._flags.last_token.text,u)||a(y.text,u);if(ae){var ue=a(this._flags.last_token.text,u)&&a(this._options.operator_position,x)||a(y.text,u);ee=ee&&ue}if(ee)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(L(this._flags.last_token,N))return;this._output.set_wrap_point()}},j.prototype.print_newline=function(y,Y){if(!Y&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==s.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var ee=this._tokens.peek();this._flags.mode===f.Statement&&!(this._flags.if_block&&S(ee,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(y)&&(this._flags.multiline_frame=!0)},j.prototype.print_token_line_indentation=function(y){this._output.just_added_newline()&&(this._options.keep_array_indentation&&y.newlines&&(y.text==="["||b(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(y.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},j.prototype.print_token=function(y){if(this._output.raw){this._output.add_raw_token(y);return}if(this._options.comma_first&&y.previous&&y.previous.type===s.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var Y=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(Y),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(y),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(y),this._output.non_breaking_space=!0,this._output.add_token(y.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},j.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},j.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},j.prototype.set_mode=function(y){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,y),this._flags=this.create_flags(this._previous_flags,y),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},j.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===f.Statement&&w(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},j.prototype.start_of_object_property=function(){return this._flags.parent.mode===f.ObjectLiteral&&this._flags.mode===f.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||L(this._flags.last_token,["get","set"]))},j.prototype.start_of_statement=function(y){var Y=!1;return Y=Y||L(this._flags.last_token,["var","let","const"])&&y.type===s.WORD,Y=Y||S(this._flags.last_token,"do"),Y=Y||!(this._flags.parent.mode===f.ObjectLiteral&&this._flags.mode===f.Statement)&&L(this._flags.last_token,N)&&!y.newlines,Y=Y||S(this._flags.last_token,"else")&&!(S(y,"if")&&!y.comments_before),Y=Y||this._flags.last_token.type===s.END_EXPR&&(this._previous_flags.mode===f.ForInitializer||this._previous_flags.mode===f.Conditional),Y=Y||this._flags.last_token.type===s.WORD&&this._flags.mode===f.BlockStatement&&!this._flags.in_case&&!(y.text==="--"||y.text==="++")&&this._last_last_text!=="function"&&y.type!==s.WORD&&y.type!==s.RESERVED,Y=Y||this._flags.mode===f.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||L(this._flags.last_token,["get","set"])),Y?(this.set_mode(f.Statement),this.indent(),this.handle_whitespace_and_comments(y,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(y,L(y,["do","for","if","while"])),!0):!1},j.prototype.handle_start_expr=function(y){this.start_of_statement(y)||this.handle_whitespace_and_comments(y);var Y=f.Expression;if(y.text==="["){if(this._flags.last_token.type===s.WORD||this._flags.last_token.text===")"){L(this._flags.last_token,l)&&(this._output.space_before_token=!0),this.print_token(y),this.set_mode(Y),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}Y=f.ArrayLiteral,b(this._flags.mode)&&((this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline())),a(this._flags.last_token.type,[s.START_EXPR,s.END_EXPR,s.WORD,s.OPERATOR,s.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===s.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,Y=f.ForInitializer):a(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,Y=f.Conditional):a(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&y.whitespace_before===""?this._output.space_before_token=!1:(a(this._flags.last_token.text,l)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===s.EQUALS||this._flags.last_token.type===s.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(y);else if(this._flags.last_token.type===s.WORD){this._output.space_before_token=!1;var ee=this._tokens.peek(-3);if(this._options.space_after_named_function&&ee){var ae=this._tokens.peek(-4);L(ee,["async","function"])||ee.text==="*"&&L(ae,["async","function"])?this._output.space_before_token=!0:this._flags.mode===f.ObjectLiteral?(ee.text==="{"||ee.text===","||ee.text==="*"&&(ae.text==="{"||ae.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(y);(this._flags.last_token.type===s.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(a(this._last_last_text,["function","yield"])||this._flags.mode===f.ObjectLiteral&&a(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===s.START_BLOCK?this.print_newline():(this._flags.last_token.type===s.END_EXPR||this._flags.last_token.type===s.START_EXPR||this._flags.last_token.type===s.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===s.COMMA)&&this.allow_wrap_or_preserved_newline(y,y.newlines),this.print_token(y),this.set_mode(Y),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},j.prototype.handle_end_expr=function(y){for(;this._flags.mode===f.Statement;)this.restore_mode();this.handle_whitespace_and_comments(y),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(y,y.text==="]"&&b(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===s.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(y),this.restore_mode(),w(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===f.Conditional&&(this._previous_flags.mode=f.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},j.prototype.handle_start_block=function(y){this.handle_whitespace_and_comments(y);var Y=this._tokens.peek(),ee=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===s.END_EXPR?(this.set_mode(f.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(f.BlockStatement):ee&&(a(ee.text,[":",","])&&a(Y.type,[s.STRING,s.WORD,s.RESERVED])||a(Y.text,["get","set","..."])&&a(ee.type,[s.WORD,s.RESERVED]))?a(this._last_last_text,["class","interface"])&&!a(ee.text,[":",","])?this.set_mode(f.BlockStatement):this.set_mode(f.ObjectLiteral):this._flags.last_token.type===s.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(f.BlockStatement):a(this._flags.last_token.type,[s.EQUALS,s.START_EXPR,s.COMMA,s.OPERATOR])||L(this._flags.last_token,["return","throw","import","default"])?this.set_mode(f.ObjectLiteral):this.set_mode(f.BlockStatement),this._flags.last_token&&(L(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var ae=!Y.comments_before&&Y.text==="}",ue=ae&&this._flags.last_word==="function"&&this._flags.last_token.type===s.END_EXPR;if(this._options.brace_preserve_inline){var Re=0,Ee=null;this._flags.inline_frame=!0;do if(Re+=1,Ee=this._tokens.peek(Re-1),Ee.newlines){this._flags.inline_frame=!1;break}while(Ee.type!==s.EOF&&!(Ee.type===s.END_BLOCK&&Ee.opened===y))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&y.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==s.OPERATOR&&(ue||this._flags.last_token.type===s.EQUALS||L(this._flags.last_token,O)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(b(this._previous_flags.mode)&&(this._flags.last_token.type===s.START_EXPR||this._flags.last_token.type===s.COMMA)&&((this._flags.last_token.type===s.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===s.COMMA||this._flags.last_token.type===s.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(y),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==s.OPERATOR&&this._flags.last_token.type!==s.START_EXPR&&(this._flags.last_token.type===s.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(y),this.indent(),!ae&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},j.prototype.handle_end_block=function(y){for(this.handle_whitespace_and_comments(y);this._flags.mode===f.Statement;)this.restore_mode();var Y=this._flags.last_token.type===s.START_BLOCK;this._flags.inline_frame&&!Y?this._output.space_before_token=!0:this._options.brace_style==="expand"?Y||this.print_newline():Y||(b(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(y)},j.prototype.handle_word=function(y){if(y.type===s.RESERVED){if(a(y.text,["set","get"])&&this._flags.mode!==f.ObjectLiteral)y.type=s.WORD;else if(y.text==="import"&&a(this._tokens.peek().text,["(","."]))y.type=s.WORD;else if(a(y.text,["as","from"])&&!this._flags.import_block)y.type=s.WORD;else if(this._flags.mode===f.ObjectLiteral){var Y=this._tokens.peek();Y.text===":"&&(y.type=s.WORD)}}if(this.start_of_statement(y)?L(this._flags.last_token,["var","let","const"])&&y.type===s.WORD&&(this._flags.declaration_statement=!0):y.newlines&&!F(this._flags.mode)&&(this._flags.last_token.type!==s.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==s.EQUALS&&(this._options.preserve_newlines||!L(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(y),this.print_newline()):this.handle_whitespace_and_comments(y),this._flags.do_block&&!this._flags.do_while)if(S(y,"while")){this._output.space_before_token=!0,this.print_token(y),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&S(y,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===f.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&L(y,["case","default"])){this.print_newline(),!this._flags.case_block&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(y),this._flags.in_case=!0;return}if((this._flags.last_token.type===s.COMMA||this._flags.last_token.type===s.START_EXPR||this._flags.last_token.type===s.EQUALS||this._flags.last_token.type===s.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(y)),S(y,"function")){(a(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(a(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===s.OPERATOR))&&(!this._output.just_added_blankline()&&!y.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===s.RESERVED||this._flags.last_token.type===s.WORD?L(this._flags.last_token,["get","set","new","export"])||L(this._flags.last_token,N)?this._output.space_before_token=!0:S(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===s.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(F(this._flags.mode)||b(this._flags.mode))||this.print_newline(),this.print_token(y),this._flags.last_word=y.text;return}var ee="NONE";if(this._flags.last_token.type===s.END_BLOCK?this._previous_flags.inline_frame?ee="SPACE":L(y,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&y.newlines?ee="NEWLINE":(ee="SPACE",this._output.space_before_token=!0):ee="NEWLINE":this._flags.last_token.type===s.SEMICOLON&&this._flags.mode===f.BlockStatement?ee="NEWLINE":this._flags.last_token.type===s.SEMICOLON&&F(this._flags.mode)?ee="SPACE":this._flags.last_token.type===s.STRING?ee="NEWLINE":this._flags.last_token.type===s.RESERVED||this._flags.last_token.type===s.WORD||this._flags.last_token.text==="*"&&(a(this._last_last_text,["function","yield"])||this._flags.mode===f.ObjectLiteral&&a(this._last_last_text,["{",","]))?ee="SPACE":this._flags.last_token.type===s.START_BLOCK?this._flags.inline_frame?ee="SPACE":ee="NEWLINE":this._flags.last_token.type===s.END_EXPR&&(this._output.space_before_token=!0,ee="NEWLINE"),L(y,l)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?ee="SPACE":ee="NEWLINE"),L(y,["else","catch","finally"]))if((!(this._flags.last_token.type===s.END_BLOCK&&this._previous_flags.mode===f.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&y.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var ae=this._output.current_line;ae.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else ee==="NEWLINE"?L(this._flags.last_token,O)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&L(y,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==s.END_EXPR?(this._flags.last_token.type!==s.START_EXPR||!L(y,["var","let","const"]))&&this._flags.last_token.text!==":"&&(S(y,"if")&&S(y.previous,"else")?this._output.space_before_token=!0:this.print_newline()):L(y,l)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&b(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():ee==="SPACE"&&(this._output.space_before_token=!0);y.previous&&(y.previous.type===s.WORD||y.previous.type===s.RESERVED)&&(this._output.space_before_token=!0),this.print_token(y),this._flags.last_word=y.text,y.type===s.RESERVED&&(y.text==="do"?this._flags.do_block=!0:y.text==="if"?this._flags.if_block=!0:y.text==="import"?this._flags.import_block=!0:this._flags.import_block&&S(y,"from")&&(this._flags.import_block=!1))},j.prototype.handle_semicolon=function(y){this.start_of_statement(y)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(y);for(var Y=this._tokens.peek();this._flags.mode===f.Statement&&!(this._flags.if_block&&S(Y,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(y)},j.prototype.handle_string=function(y){y.text.startsWith("`")&&y.newlines===0&&y.whitespace_before===""&&(y.previous.text===")"||this._flags.last_token.type===s.WORD)||(this.start_of_statement(y)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(y),this._flags.last_token.type===s.RESERVED||this._flags.last_token.type===s.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===s.COMMA||this._flags.last_token.type===s.START_EXPR||this._flags.last_token.type===s.EQUALS||this._flags.last_token.type===s.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(y):y.text.startsWith("`")&&this._flags.last_token.type===s.END_EXPR&&(y.previous.text==="]"||y.previous.text===")")&&y.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(y)},j.prototype.handle_equals=function(y){this.start_of_statement(y)||this.handle_whitespace_and_comments(y),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(y),this._output.space_before_token=!0},j.prototype.handle_comma=function(y){this.handle_whitespace_and_comments(y,!0),this.print_token(y),this._output.space_before_token=!0,this._flags.declaration_statement?(F(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(y)):this._flags.mode===f.ObjectLiteral||this._flags.mode===f.Statement&&this._flags.parent.mode===f.ObjectLiteral?(this._flags.mode===f.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(y)},j.prototype.handle_operator=function(y){var Y=y.text==="*"&&(L(this._flags.last_token,["function","yield"])||a(this._flags.last_token.type,[s.START_BLOCK,s.COMMA,s.END_BLOCK,s.SEMICOLON])),ee=a(y.text,["-","+"])&&(a(this._flags.last_token.type,[s.START_BLOCK,s.START_EXPR,s.EQUALS,s.OPERATOR])||a(this._flags.last_token.text,l)||this._flags.last_token.text===",");if(!this.start_of_statement(y)){var ae=!Y;this.handle_whitespace_and_comments(y,ae)}if(y.text==="*"&&this._flags.last_token.type===s.DOT){this.print_token(y);return}if(y.text==="::"){this.print_token(y);return}if(this._flags.last_token.type===s.OPERATOR&&a(this._options.operator_position,x)&&this.allow_wrap_or_preserved_newline(y),y.text===":"&&this._flags.in_case){this.print_token(y),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==s.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0);return}var ue=!0,Re=!0,Ee=!1;if(y.text===":"?this._flags.ternary_depth===0?ue=!1:(this._flags.ternary_depth-=1,Ee=!0):y.text==="?"&&(this._flags.ternary_depth+=1),!ee&&!Y&&this._options.preserve_newlines&&a(y.text,u)){var xe=y.text===":",Ce=xe&&Ee,Oe=xe&&!Ee;switch(this._options.operator_position){case T.before_newline:this._output.space_before_token=!Oe,this.print_token(y),(!xe||Ce)&&this.allow_wrap_or_preserved_newline(y),this._output.space_before_token=!0;return;case T.after_newline:this._output.space_before_token=!0,!xe||Ce?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(y):this._output.space_before_token=!1,this.print_token(y),this._output.space_before_token=!0;return;case T.preserve_newline:Oe||this.allow_wrap_or_preserved_newline(y),ue=!(this._output.just_added_newline()||Oe),this._output.space_before_token=ue,this.print_token(y),this._output.space_before_token=!0;return}}if(Y){this.allow_wrap_or_preserved_newline(y),ue=!1;var pe=this._tokens.peek();Re=pe&&a(pe.type,[s.WORD,s.RESERVED])}else if(y.text==="...")this.allow_wrap_or_preserved_newline(y),ue=this._flags.last_token.type===s.START_BLOCK,Re=!1;else if(a(y.text,["--","++","!","~"])||ee){if((this._flags.last_token.type===s.COMMA||this._flags.last_token.type===s.START_EXPR)&&this.allow_wrap_or_preserved_newline(y),ue=!1,Re=!1,y.newlines&&(y.text==="--"||y.text==="++"||y.text==="~")){var de=L(this._flags.last_token,O)&&y.newlines;de&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(de,!0)}this._flags.last_token.text===";"&&F(this._flags.mode)&&(ue=!0),this._flags.last_token.type===s.RESERVED?ue=!0:this._flags.last_token.type===s.END_EXPR?ue=!(this._flags.last_token.text==="]"&&(y.text==="--"||y.text==="++")):this._flags.last_token.type===s.OPERATOR&&(ue=a(y.text,["--","-","++","+"])&&a(this._flags.last_token.text,["--","-","++","+"]),a(y.text,["+","-"])&&a(this._flags.last_token.text,["--","++"])&&(Re=!0)),(this._flags.mode===f.BlockStatement&&!this._flags.inline_frame||this._flags.mode===f.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||ue,this.print_token(y),this._output.space_before_token=Re},j.prototype.handle_block_comment=function(y,Y){if(this._output.raw){this._output.add_raw_token(y),y.directives&&y.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(y.directives){this.print_newline(!1,Y),this.print_token(y),y.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!h.newline.test(y.text)&&!y.newlines){this._output.space_before_token=!0,this.print_token(y),this._output.space_before_token=!0;return}else this.print_block_commment(y,Y)},j.prototype.print_block_commment=function(y,Y){var ee=v(y.text),ae,ue=!1,Re=!1,Ee=y.whitespace_before,xe=Ee.length;if(this.print_newline(!1,Y),this.print_token_line_indentation(y),this._output.add_token(ee[0]),this.print_newline(!1,Y),ee.length>1){for(ee=ee.slice(1),ue=B(ee,"*"),Re=R(ee,Ee),ue&&(this._flags.alignment=1),ae=0;ae<ee.length;ae++)ue?(this.print_token_line_indentation(y),this._output.add_token(A(ee[ae]))):Re&&ee[ae]?(this.print_token_line_indentation(y),this._output.add_token(ee[ae].substring(xe))):(this._output.current_line.set_indent(-1),this._output.add_token(ee[ae])),this.print_newline(!1,Y);this._flags.alignment=0}},j.prototype.handle_comment=function(y,Y){y.newlines?this.print_newline(!1,Y):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(y),this.print_newline(!1,Y)},j.prototype.handle_dot=function(y){this.start_of_statement(y)||this.handle_whitespace_and_comments(y,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),L(this._flags.last_token,O)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(y,this._flags.last_token.text===")"&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(y)},j.prototype.handle_unknown=function(y,Y){this.print_token(y),y.text[y.text.length-1]===`
|
|
`&&this.print_newline(!1,Y)},j.prototype.handle_eof=function(y){for(;this._flags.mode===f.Statement;)this.restore_mode();this.handle_whitespace_and_comments(y)},n.exports.Beautifier=j},function(n){function D(m){this.__parent=m,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}D.prototype.clone_empty=function(){var m=new D(this.__parent);return m.set_indent(this.__indent_count,this.__alignment_count),m},D.prototype.item=function(m){return m<0?this.__items[this.__items.length+m]:this.__items[m]},D.prototype.has_match=function(m){for(var h=this.__items.length-1;h>=0;h--)if(this.__items[h].match(m))return!0;return!1},D.prototype.set_indent=function(m,h){this.is_empty()&&(this.__indent_count=m||0,this.__alignment_count=h||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},D.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},D.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},D.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var m=this.__parent.current_line;return m.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),m.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),m.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,m.__items[0]===" "&&(m.__items.splice(0,1),m.__character_count-=1),!0}return!1},D.prototype.is_empty=function(){return this.__items.length===0},D.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},D.prototype.push=function(m){this.__items.push(m);var h=m.lastIndexOf(`
|
|
`);h!==-1?this.__character_count=m.length-h:this.__character_count+=m.length},D.prototype.pop=function(){var m=null;return this.is_empty()||(m=this.__items.pop(),this.__character_count-=m.length),m},D.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},D.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},D.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},D.prototype.toString=function(){var m="";return this.is_empty()?this.__parent.indent_empty_lines&&(m=this.__parent.get_indent_string(this.__indent_count)):(m=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),m+=this.__items.join("")),m};function g(m,h){this.__cache=[""],this.__indent_size=m.indent_size,this.__indent_string=m.indent_char,m.indent_with_tabs||(this.__indent_string=new Array(m.indent_size+1).join(m.indent_char)),h=h||"",m.indent_level>0&&(h=new Array(m.indent_level+1).join(this.__indent_string)),this.__base_string=h,this.__base_string_length=h.length}g.prototype.get_indent_size=function(m,h){var o=this.__base_string_length;return h=h||0,m<0&&(o=0),o+=m*this.__indent_size,o+=h,o},g.prototype.get_indent_string=function(m,h){var o=this.__base_string;return h=h||0,m<0&&(m=0,o=""),h+=m*this.__indent_size,this.__ensure_cache(h),o+=this.__cache[h],o},g.prototype.__ensure_cache=function(m){for(;m>=this.__cache.length;)this.__add_column()},g.prototype.__add_column=function(){var m=this.__cache.length,h=0,o="";this.__indent_size&&m>=this.__indent_size&&(h=Math.floor(m/this.__indent_size),m-=h*this.__indent_size,o=new Array(h+1).join(this.__indent_string)),m&&(o+=new Array(m+1).join(" ")),this.__cache.push(o)};function p(m,h){this.__indent_cache=new g(m,h),this.raw=!1,this._end_with_newline=m.end_with_newline,this.indent_size=m.indent_size,this.wrap_line_length=m.wrap_line_length,this.indent_empty_lines=m.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new D(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}p.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},p.prototype.get_line_number=function(){return this.__lines.length},p.prototype.get_indent_string=function(m,h){return this.__indent_cache.get_indent_string(m,h)},p.prototype.get_indent_size=function(m,h){return this.__indent_cache.get_indent_size(m,h)},p.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},p.prototype.add_new_line=function(m){return this.is_empty()||!m&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},p.prototype.get_code=function(m){this.trim(!0);var h=this.current_line.pop();h&&(h[h.length-1]===`
|
|
`&&(h=h.replace(/\n+$/g,"")),this.current_line.push(h)),this._end_with_newline&&this.__add_outputline();var o=this.__lines.join(`
|
|
`);return m!==`
|
|
`&&(o=o.replace(/[\n]/g,m)),o},p.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},p.prototype.set_indent=function(m,h){return m=m||0,h=h||0,this.next_line.set_indent(m,h),this.__lines.length>1?(this.current_line.set_indent(m,h),!0):(this.current_line.set_indent(),!1)},p.prototype.add_raw_token=function(m){for(var h=0;h<m.newlines;h++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(m.whitespace_before),this.current_line.push(m.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},p.prototype.add_token=function(m){this.__add_space_before_token(),this.current_line.push(m),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},p.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},p.prototype.remove_indent=function(m){for(var h=this.__lines.length;m<h;)this.__lines[m]._remove_indent(),m++;this.current_line._remove_wrap_indent()},p.prototype.trim=function(m){for(m=m===void 0?!1:m,this.current_line.trim();m&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},p.prototype.just_added_newline=function(){return this.current_line.is_empty()},p.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},p.prototype.ensure_empty_line_above=function(m,h){for(var o=this.__lines.length-2;o>=0;){var c=this.__lines[o];if(c.is_empty())break;if(c.item(0).indexOf(m)!==0&&c.item(-1)!==h){this.__lines.splice(o+1,0,new D(this)),this.previous_line=this.__lines[this.__lines.length-2];break}o--}},n.exports.Output=p},function(n){function D(g,p,m,h){this.type=g,this.text=p,this.comments_before=null,this.newlines=m||0,this.whitespace_before=h||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}n.exports.Token=D},function(n,D){var g="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",p="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",m="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",h="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",o="(?:\\\\u[0-9a-fA-F]{4}|["+g+m+"])",c="(?:\\\\u[0-9a-fA-F]{4}|["+p+m+h+"])*";D.identifier=new RegExp(o+c,"g"),D.identifierStart=new RegExp(o),D.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+p+m+h+"])+");var l=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;D.newline=/[\n\r\u2028\u2029]/,D.lineBreak=new RegExp(`\r
|
|
|`+D.newline.source),D.allLineBreaks=new RegExp(D.lineBreak.source,"g")},function(n,D,g){var p=g(6).Options,m=["before-newline","after-newline","preserve-newline"];function h(o){p.call(this,o,"js");var c=this.raw_options.brace_style||null;c==="expand-strict"?this.raw_options.brace_style="expand":c==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var l=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var u=0;u<l.length;u++)l[u]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=l[u];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",m),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}h.prototype=new p,n.exports.Options=h},function(n){function D(m,h){this.raw_options=g(m,h),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}D.prototype._get_array=function(m,h){var o=this.raw_options[m],c=h||[];return typeof o=="object"?o!==null&&typeof o.concat=="function"&&(c=o.concat()):typeof o=="string"&&(c=o.split(/[^a-zA-Z0-9_\/\-]+/)),c},D.prototype._get_boolean=function(m,h){var o=this.raw_options[m],c=o===void 0?!!h:!!o;return c},D.prototype._get_characters=function(m,h){var o=this.raw_options[m],c=h||"";return typeof o=="string"&&(c=o.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),c},D.prototype._get_number=function(m,h){var o=this.raw_options[m];h=parseInt(h,10),isNaN(h)&&(h=0);var c=parseInt(o,10);return isNaN(c)&&(c=h),c},D.prototype._get_selection=function(m,h,o){var c=this._get_selection_list(m,h,o);if(c.length!==1)throw new Error("Invalid Option Value: The option '"+m+`' can only be one of the following values:
|
|
`+h+`
|
|
You passed in: '`+this.raw_options[m]+"'");return c[0]},D.prototype._get_selection_list=function(m,h,o){if(!h||h.length===0)throw new Error("Selection list cannot be empty.");if(o=o||[h[0]],!this._is_valid_selection(o,h))throw new Error("Invalid Default Value!");var c=this._get_array(m,o);if(!this._is_valid_selection(c,h))throw new Error("Invalid Option Value: The option '"+m+`' can contain only the following values:
|
|
`+h+`
|
|
You passed in: '`+this.raw_options[m]+"'");return c},D.prototype._is_valid_selection=function(m,h){return m.length&&h.length&&!m.some(function(o){return h.indexOf(o)===-1})};function g(m,h){var o={};m=p(m);var c;for(c in m)c!==h&&(o[c]=m[c]);if(h&&m[h])for(c in m[h])o[c]=m[h][c];return o}function p(m){var h={},o;for(o in m){var c=o.replace(/-/g,"_");h[c]=m[o]}return h}n.exports.Options=D,n.exports.normalizeOpts=p,n.exports.mergeOpts=g},function(n,D,g){var p=g(8).InputScanner,m=g(9).Tokenizer,h=g(9).TOKEN,o=g(13).Directives,c=g(4),l=g(12).Pattern,u=g(14).TemplatablePattern;function s(B,R){return R.indexOf(B)!==-1}var a={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:h.START,RAW:h.RAW,EOF:h.EOF},A=new o(/\/\*/,/\*\//),E=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,S=/[0-9]/,L=/[^\d\.]/,O=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),C=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";C=C.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),C="\\?\\.(?!\\d) "+C,C=C.replace(/ /g,"|");var T=new RegExp(C),x="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),f=x.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),w=new RegExp("^(?:"+f.join("|")+")$"),v,b=function(B,R){m.call(this,B,R),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var j=new l(this._input),N=new u(this._input).read_options(this._options);this.__patterns={template:N,identifier:N.starting_with(c.identifier).matching(c.identifierMatch),number:j.matching(E),punct:j.matching(T),comment:j.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:j.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:j.matching(/<!--/),html_comment_end:j.matching(/-->/),include:j.starting_with(/#include/).until_after(c.lineBreak),shebang:j.starting_with(/#!/).until_after(c.lineBreak),xml:j.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:N.until(/['\\\n\r\u2028\u2029]/),double_quote:N.until(/["\\\n\r\u2028\u2029]/),template_text:N.until(/[`\\$]/),template_expression:N.until(/[`}\\]/)}};b.prototype=new m,b.prototype._is_comment=function(B){return B.type===a.COMMENT||B.type===a.BLOCK_COMMENT||B.type===a.UNKNOWN},b.prototype._is_opening=function(B){return B.type===a.START_BLOCK||B.type===a.START_EXPR},b.prototype._is_closing=function(B,R){return(B.type===a.END_BLOCK||B.type===a.END_EXPR)&&R&&(B.text==="]"&&R.text==="["||B.text===")"&&R.text==="("||B.text==="}"&&R.text==="{")},b.prototype._reset=function(){v=!1},b.prototype._get_next_token=function(B,R){var j=null;this._readWhitespace();var N=this._input.peek();return N===null?this._create_token(a.EOF,""):(j=j||this._read_non_javascript(N),j=j||this._read_string(N),j=j||this._read_word(B),j=j||this._read_singles(N),j=j||this._read_comment(N),j=j||this._read_regexp(N,B),j=j||this._read_xml(N,B),j=j||this._read_punctuation(),j=j||this._create_token(a.UNKNOWN,this._input.next()),j)},b.prototype._read_word=function(B){var R;if(R=this.__patterns.identifier.read(),R!=="")return R=R.replace(c.allLineBreaks,`
|
|
`),!(B.type===a.DOT||B.type===a.RESERVED&&(B.text==="set"||B.text==="get"))&&w.test(R)?(R==="in"||R==="of")&&(B.type===a.WORD||B.type===a.STRING)?this._create_token(a.OPERATOR,R):this._create_token(a.RESERVED,R):this._create_token(a.WORD,R);if(R=this.__patterns.number.read(),R!=="")return this._create_token(a.WORD,R)},b.prototype._read_singles=function(B){var R=null;return B==="("||B==="["?R=this._create_token(a.START_EXPR,B):B===")"||B==="]"?R=this._create_token(a.END_EXPR,B):B==="{"?R=this._create_token(a.START_BLOCK,B):B==="}"?R=this._create_token(a.END_BLOCK,B):B===";"?R=this._create_token(a.SEMICOLON,B):B==="."&&L.test(this._input.peek(1))?R=this._create_token(a.DOT,B):B===","&&(R=this._create_token(a.COMMA,B)),R&&this._input.next(),R},b.prototype._read_punctuation=function(){var B=this.__patterns.punct.read();if(B!=="")return B==="="?this._create_token(a.EQUALS,B):B==="?."?this._create_token(a.DOT,B):this._create_token(a.OPERATOR,B)},b.prototype._read_non_javascript=function(B){var R="";if(B==="#"){if(this._is_first_token()&&(R=this.__patterns.shebang.read(),R))return this._create_token(a.UNKNOWN,R.trim()+`
|
|
`);if(R=this.__patterns.include.read(),R)return this._create_token(a.UNKNOWN,R.trim()+`
|
|
`);B=this._input.next();var j="#";if(this._input.hasNext()&&this._input.testChar(S)){do B=this._input.next(),j+=B;while(this._input.hasNext()&&B!=="#"&&B!=="=");return B==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(j+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(j+="{}",this._input.next(),this._input.next())),this._create_token(a.WORD,j)}this._input.back()}else if(B==="<"&&this._is_first_token()){if(R=this.__patterns.html_comment_start.read(),R){for(;this._input.hasNext()&&!this._input.testChar(c.newline);)R+=this._input.next();return v=!0,this._create_token(a.COMMENT,R)}}else if(v&&B==="-"&&(R=this.__patterns.html_comment_end.read(),R))return v=!1,this._create_token(a.COMMENT,R);return null},b.prototype._read_comment=function(B){var R=null;if(B==="/"){var j="";if(this._input.peek(1)==="*"){j=this.__patterns.block_comment.read();var N=A.get_directives(j);N&&N.ignore==="start"&&(j+=A.readIgnored(this._input)),j=j.replace(c.allLineBreaks,`
|
|
`),R=this._create_token(a.BLOCK_COMMENT,j),R.directives=N}else this._input.peek(1)==="/"&&(j=this.__patterns.comment.read(),R=this._create_token(a.COMMENT,j))}return R},b.prototype._read_string=function(B){if(B==="`"||B==="'"||B==='"'){var R=this._input.next();return this.has_char_escapes=!1,B==="`"?R+=this._read_string_recursive("`",!0,"${"):R+=this._read_string_recursive(B),this.has_char_escapes&&this._options.unescape_strings&&(R=F(R)),this._input.peek()===B&&(R+=this._input.next()),R=R.replace(c.allLineBreaks,`
|
|
`),this._create_token(a.STRING,R)}return null},b.prototype._allow_regexp_or_xml=function(B){return B.type===a.RESERVED&&s(B.text,["return","case","throw","else","do","typeof","yield"])||B.type===a.END_EXPR&&B.text===")"&&B.opened.previous.type===a.RESERVED&&s(B.opened.previous.text,["if","while","for"])||s(B.type,[a.COMMENT,a.START_EXPR,a.START_BLOCK,a.START,a.END_BLOCK,a.OPERATOR,a.EQUALS,a.EOF,a.SEMICOLON,a.COMMA])},b.prototype._read_regexp=function(B,R){if(B==="/"&&this._allow_regexp_or_xml(R)){for(var j=this._input.next(),N=!1,y=!1;this._input.hasNext()&&(N||y||this._input.peek()!==B)&&!this._input.testChar(c.newline);)j+=this._input.peek(),N?N=!1:(N=this._input.peek()==="\\",this._input.peek()==="["?y=!0:this._input.peek()==="]"&&(y=!1)),this._input.next();return this._input.peek()===B&&(j+=this._input.next(),j+=this._input.read(c.identifier)),this._create_token(a.STRING,j)}return null},b.prototype._read_xml=function(B,R){if(this._options.e4x&&B==="<"&&this._allow_regexp_or_xml(R)){var j="",N=this.__patterns.xml.read_match();if(N){for(var y=N[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),Y=y.indexOf("{")===0,ee=0;N;){var ae=!!N[1],ue=N[2],Re=!!N[N.length-1]||ue.slice(0,8)==="![CDATA[";if(!Re&&(ue===y||Y&&ue.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(ae?--ee:++ee),j+=N[0],ee<=0)break;N=this.__patterns.xml.read_match()}return N||(j+=this._input.match(/[\s\S]*/g)[0]),j=j.replace(c.allLineBreaks,`
|
|
`),this._create_token(a.STRING,j)}}return null};function F(B){for(var R="",j=0,N=new p(B),y=null;N.hasNext();)if(y=N.match(/([\s]|[^\\]|\\\\)+/g),y&&(R+=y[0]),N.peek()==="\\"){if(N.next(),N.peek()==="x")y=N.match(/x([0-9A-Fa-f]{2})/g);else if(N.peek()==="u")y=N.match(/u([0-9A-Fa-f]{4})/g);else{R+="\\",N.hasNext()&&(R+=N.next());continue}if(!y)return B;if(j=parseInt(y[1],16),j>126&&j<=255&&y[0].indexOf("x")===0)return B;if(j>=0&&j<32){R+="\\"+y[0];continue}else j===34||j===39||j===92?R+="\\"+String.fromCharCode(j):R+=String.fromCharCode(j)}return R}b.prototype._read_string_recursive=function(B,R,j){var N,y;B==="'"?y=this.__patterns.single_quote:B==='"'?y=this.__patterns.double_quote:B==="`"?y=this.__patterns.template_text:B==="}"&&(y=this.__patterns.template_expression);for(var Y=y.read(),ee="";this._input.hasNext();){if(ee=this._input.next(),ee===B||!R&&c.newline.test(ee)){this._input.back();break}else ee==="\\"&&this._input.hasNext()?(N=this._input.peek(),N==="x"||N==="u"?this.has_char_escapes=!0:N==="\r"&&this._input.peek(1)===`
|
|
`&&this._input.next(),ee+=this._input.next()):j&&(j==="${"&&ee==="$"&&this._input.peek()==="{"&&(ee+=this._input.next()),j===ee&&(B==="`"?ee+=this._read_string_recursive("}",R,"`"):ee+=this._read_string_recursive("`",R,"${"),this._input.hasNext()&&(ee+=this._input.next())));ee+=y.read(),Y+=ee}return Y},n.exports.Tokenizer=b,n.exports.TOKEN=a,n.exports.positionable_operators=O.slice(),n.exports.line_starters=x.slice()},function(n){var D=RegExp.prototype.hasOwnProperty("sticky");function g(p){this.__input=p||"",this.__input_length=this.__input.length,this.__position=0}g.prototype.restart=function(){this.__position=0},g.prototype.back=function(){this.__position>0&&(this.__position-=1)},g.prototype.hasNext=function(){return this.__position<this.__input_length},g.prototype.next=function(){var p=null;return this.hasNext()&&(p=this.__input.charAt(this.__position),this.__position+=1),p},g.prototype.peek=function(p){var m=null;return p=p||0,p+=this.__position,p>=0&&p<this.__input_length&&(m=this.__input.charAt(p)),m},g.prototype.__match=function(p,m){p.lastIndex=m;var h=p.exec(this.__input);return h&&!(D&&p.sticky)&&(h.index!==m&&(h=null)),h},g.prototype.test=function(p,m){return m=m||0,m+=this.__position,m>=0&&m<this.__input_length?!!this.__match(p,m):!1},g.prototype.testChar=function(p,m){var h=this.peek(m);return p.lastIndex=0,h!==null&&p.test(h)},g.prototype.match=function(p){var m=this.__match(p,this.__position);return m?this.__position+=m[0].length:m=null,m},g.prototype.read=function(p,m,h){var o="",c;return p&&(c=this.match(p),c&&(o+=c[0])),m&&(c||!p)&&(o+=this.readUntil(m,h)),o},g.prototype.readUntil=function(p,m){var h="",o=this.__position;p.lastIndex=this.__position;var c=p.exec(this.__input);return c?(o=c.index,m&&(o+=c[0].length)):o=this.__input_length,h=this.__input.substring(this.__position,o),this.__position=o,h},g.prototype.readUntilAfter=function(p){return this.readUntil(p,!0)},g.prototype.get_regexp=function(p,m){var h=null,o="g";return m&&D&&(o="y"),typeof p=="string"&&p!==""?h=new RegExp(p,o):p&&(h=new RegExp(p.source,o)),h},g.prototype.get_literal_regexp=function(p){return RegExp(p.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},g.prototype.peekUntilAfter=function(p){var m=this.__position,h=this.readUntilAfter(p);return this.__position=m,h},g.prototype.lookBack=function(p){var m=this.__position-1;return m>=p.length&&this.__input.substring(m-p.length,m).toLowerCase()===p},n.exports.InputScanner=g},function(n,D,g){var p=g(8).InputScanner,m=g(3).Token,h=g(10).TokenStream,o=g(11).WhitespacePattern,c={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},l=function(u,s){this._input=new p(u),this._options=s||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new o(this._input)};l.prototype.tokenize=function(){this._input.restart(),this.__tokens=new h,this._reset();for(var u,s=new m(c.START,""),a=null,A=[],E=new h;s.type!==c.EOF;){for(u=this._get_next_token(s,a);this._is_comment(u);)E.add(u),u=this._get_next_token(s,a);E.isEmpty()||(u.comments_before=E,E=new h),u.parent=a,this._is_opening(u)?(A.push(a),a=u):a&&this._is_closing(u,a)&&(u.opened=a,a.closed=u,a=A.pop(),u.parent=a),u.previous=s,s.next=u,this.__tokens.add(u),s=u}return this.__tokens},l.prototype._is_first_token=function(){return this.__tokens.isEmpty()},l.prototype._reset=function(){},l.prototype._get_next_token=function(u,s){this._readWhitespace();var a=this._input.read(/.+/g);return a?this._create_token(c.RAW,a):this._create_token(c.EOF,"")},l.prototype._is_comment=function(u){return!1},l.prototype._is_opening=function(u){return!1},l.prototype._is_closing=function(u,s){return!1},l.prototype._create_token=function(u,s){var a=new m(u,s,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return a},l.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},n.exports.Tokenizer=l,n.exports.TOKEN=c},function(n){function D(g){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=g}D.prototype.restart=function(){this.__position=0},D.prototype.isEmpty=function(){return this.__tokens_length===0},D.prototype.hasNext=function(){return this.__position<this.__tokens_length},D.prototype.next=function(){var g=null;return this.hasNext()&&(g=this.__tokens[this.__position],this.__position+=1),g},D.prototype.peek=function(g){var p=null;return g=g||0,g+=this.__position,g>=0&&g<this.__tokens_length&&(p=this.__tokens[g]),p},D.prototype.add=function(g){this.__parent_token&&(g.parent=this.__parent_token),this.__tokens.push(g),this.__tokens_length+=1},n.exports.TokenStream=D},function(n,D,g){var p=g(12).Pattern;function m(h,o){p.call(this,h,o),o?this._line_regexp=this._input.get_regexp(o._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}m.prototype=new p,m.prototype.__set_whitespace_patterns=function(h,o){h+="\\t ",o+="\\n\\r",this._match_pattern=this._input.get_regexp("["+h+o+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+o+"]")},m.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var h=this._input.read(this._match_pattern);if(h===" ")this.whitespace_before_token=" ";else if(h){var o=this.__split(this._newline_regexp,h);this.newline_count=o.length-1,this.whitespace_before_token=o[this.newline_count]}return h},m.prototype.matching=function(h,o){var c=this._create();return c.__set_whitespace_patterns(h,o),c._update(),c},m.prototype._create=function(){return new m(this._input,this)},m.prototype.__split=function(h,o){h.lastIndex=0;for(var c=0,l=[],u=h.exec(o);u;)l.push(o.substring(c,u.index)),c=u.index+u[0].length,u=h.exec(o);return c<o.length?l.push(o.substring(c,o.length)):l.push(""),l},n.exports.WhitespacePattern=m},function(n){function D(g,p){this._input=g,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,p&&(this._starting_pattern=this._input.get_regexp(p._starting_pattern,!0),this._match_pattern=this._input.get_regexp(p._match_pattern,!0),this._until_pattern=this._input.get_regexp(p._until_pattern),this._until_after=p._until_after)}D.prototype.read=function(){var g=this._input.read(this._starting_pattern);return(!this._starting_pattern||g)&&(g+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),g},D.prototype.read_match=function(){return this._input.match(this._match_pattern)},D.prototype.until_after=function(g){var p=this._create();return p._until_after=!0,p._until_pattern=this._input.get_regexp(g),p._update(),p},D.prototype.until=function(g){var p=this._create();return p._until_after=!1,p._until_pattern=this._input.get_regexp(g),p._update(),p},D.prototype.starting_with=function(g){var p=this._create();return p._starting_pattern=this._input.get_regexp(g,!0),p._update(),p},D.prototype.matching=function(g){var p=this._create();return p._match_pattern=this._input.get_regexp(g,!0),p._update(),p},D.prototype._create=function(){return new D(this._input,this)},D.prototype._update=function(){},n.exports.Pattern=D},function(n){function D(g,p){g=typeof g=="string"?g:g.source,p=typeof p=="string"?p:p.source,this.__directives_block_pattern=new RegExp(g+/ beautify( \w+[:]\w+)+ /.source+p,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(g+/\sbeautify\signore:end\s/.source+p,"g")}D.prototype.get_directives=function(g){if(!g.match(this.__directives_block_pattern))return null;var p={};this.__directive_pattern.lastIndex=0;for(var m=this.__directive_pattern.exec(g);m;)p[m[1]]=m[2],m=this.__directive_pattern.exec(g);return p},D.prototype.readIgnored=function(g){return g.readUntilAfter(this.__directives_end_ignore_pattern)},n.exports.Directives=D},function(n,D,g){var p=g(12).Pattern,m={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function h(o,c){p.call(this,o,c),this.__template_pattern=null,this._disabled=Object.assign({},m),this._excluded=Object.assign({},m),c&&(this.__template_pattern=this._input.get_regexp(c.__template_pattern),this._excluded=Object.assign(this._excluded,c._excluded),this._disabled=Object.assign(this._disabled,c._disabled));var l=new p(o);this.__patterns={handlebars_comment:l.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:l.starting_with(/{{{/).until_after(/}}}/),handlebars:l.starting_with(/{{/).until_after(/}}/),php:l.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:l.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:l.starting_with(/{%/).until_after(/%}/),django_value:l.starting_with(/{{/).until_after(/}}/),django_comment:l.starting_with(/{#/).until_after(/#}/),smarty:l.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:l.starting_with(/{\*/).until_after(/\*}/),smarty_literal:l.starting_with(/{literal}/).until_after(/{\/literal}/)}}h.prototype=new p,h.prototype._create=function(){return new h(this._input,this)},h.prototype._update=function(){this.__set_templated_pattern()},h.prototype.disable=function(o){var c=this._create();return c._disabled[o]=!0,c._update(),c},h.prototype.read_options=function(o){var c=this._create();for(var l in m)c._disabled[l]=o.templating.indexOf(l)===-1;return c._update(),c},h.prototype.exclude=function(o){var c=this._create();return c._excluded[o]=!0,c._update(),c},h.prototype.read=function(){var o="";this._match_pattern?o=this._input.read(this._starting_pattern):o=this._input.read(this._starting_pattern,this.__template_pattern);for(var c=this._read_template();c;)this._match_pattern?c+=this._input.read(this._match_pattern):c+=this._input.readUntil(this.__template_pattern),o+=c,c=this._read_template();return this._until_after&&(o+=this._input.readUntilAfter(this._until_pattern)),o},h.prototype.__set_templated_pattern=function(){var o=[];this._disabled.php||o.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||o.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||o.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(o.push(this.__patterns.django._starting_pattern.source),o.push(this.__patterns.django_value._starting_pattern.source),o.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||o.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&o.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+o.join("|")+")")},h.prototype._read_template=function(){var o="",c=this._input.peek();if(c==="<"){var l=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&l==="?"&&(o=o||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&l==="%"&&(o=o||this.__patterns.erb.read())}else c==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(o=o||this.__patterns.handlebars_comment.read(),o=o||this.__patterns.handlebars_unescaped.read(),o=o||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(o=o||this.__patterns.django_value.read()),this._excluded.django||(o=o||this.__patterns.django_comment.read(),o=o||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(o=o||this.__patterns.smarty_comment.read(),o=o||this.__patterns.smarty_literal.read(),o=o||this.__patterns.smarty.read()));return o},n.exports.TemplatablePattern=h}],k={};function G(n){var D=k[n];if(D!==void 0)return D.exports;var g=k[n]={exports:{}};return U[n](g,g.exports,G),g.exports}var H=G(0);P=H})();var X=P;!(re=[],$=function(){return{js_beautify:X}}.apply(be,re),$!==void 0&&(ht.exports=$))})()},"746U":function(ht,be,Z){"use strict";Z.d(be,"f",function(){return re}),Z.d(be,"l",function(){return $}),Z.d(be,"k",function(){return P}),Z.d(be,"j",function(){return X}),Z.d(be,"g",function(){return U}),Z.d(be,"m",function(){return k}),Z.d(be,"h",function(){return G}),Z.d(be,"n",function(){return H}),Z.d(be,"c",function(){return n}),Z.d(be,"a",function(){return D}),Z.d(be,"i",function(){return g}),Z.d(be,"o",function(){return p}),Z.d(be,"e",function(){return o}),Z.d(be,"d",function(){return c}),Z.d(be,"p",function(){return l}),Z.d(be,"b",function(){return u});function re(s){return Array.isArray(s)}function $(s){return typeof s=="string"}function P(s){return typeof s=="object"&&s!==null&&!Array.isArray(s)&&!(s instanceof RegExp)&&!(s instanceof Date)}function X(s){return typeof s=="number"&&!isNaN(s)}function U(s){return s===!0||s===!1}function k(s){return typeof s=="undefined"}function G(s){return!H(s)}function H(s){return k(s)||s===null}function n(s,a){if(!s)throw new Error(a?`Unexpected type, expected '${a}'`:"Unexpected type")}function D(s){if(H(s))throw new Error("Assertion Failed: argument is undefined or null");return s}function g(s){return typeof s=="function"}function p(s,a){const A=Math.min(s.length,a.length);for(let E=0;E<A;E++)m(s[E],a[E])}function m(s,a){if($(a)){if(typeof s!==a)throw new Error(`argument does not match constraint: typeof ${a}`)}else if(g(a)){try{if(s instanceof a)return}catch(A){}if(!H(s)&&s.constructor===a)return;if(a.length===1&&a.call(void 0,s)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function h(s){let a=[],A=Object.getPrototypeOf(s);for(;Object.prototype!==A;)a=a.concat(Object.getOwnPropertyNames(A)),A=Object.getPrototypeOf(A);return a}function o(s){const a=[];for(const A of h(s))typeof s[A]=="function"&&a.push(A);return a}function c(s,a){const A=S=>function(){const L=Array.prototype.slice.call(arguments,0);return a(S,L)};let E={};for(const S of s)E[S]=A(S);return E}function l(s){return s===null?void 0:s}function u(s,a="Unreachable"){throw new Error(a)}},"7Cbv":function(ht,be,Z){"use strict";var re=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),$=new Uint8Array(16);function P(){if(!re)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return re($)}var X=/^(?:[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 U(m){return typeof m=="string"&&X.test(m)}for(var k=U,G=[],H=0;H<256;++H)G.push((H+256).toString(16).substr(1));function n(m){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=(G[m[h+0]]+G[m[h+1]]+G[m[h+2]]+G[m[h+3]]+"-"+G[m[h+4]]+G[m[h+5]]+"-"+G[m[h+6]]+G[m[h+7]]+"-"+G[m[h+8]]+G[m[h+9]]+"-"+G[m[h+10]]+G[m[h+11]]+G[m[h+12]]+G[m[h+13]]+G[m[h+14]]+G[m[h+15]]).toLowerCase();if(!k(o))throw TypeError("Stringified UUID is invalid");return o}var D=n;function g(m,h,o){m=m||{};var c=m.random||(m.rng||P)();if(c[6]=c[6]&15|64,c[8]=c[8]&63|128,h){o=o||0;for(var l=0;l<16;++l)h[o+l]=c[l];return h}return D(c)}var p=be.a=g},"7ahc":function(ht,be,Z){"use strict";Z.d(be,"a",function(){return A});var re=Z("k1fw"),$=Z("0Owb"),P=Z("+L6B"),X=Z("2/Rp"),U=Z("y8nQ"),k=Z("Vl3Y"),G=Z("tJVT"),H=Z("OaEy"),n=Z("2fM7"),D=Z("q1tI"),g=Z.n(D),p=Z("VrN/"),m=Z.n(p),h=Z("p77/"),o=Z.n(h),c=Z("c5Ni"),l=Z.n(c),u=n.a.Option,s={labelCol:{span:4},wrapperCol:{span:20}},a={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};be.b=function(E){var S=E.callback,L=E.onCancel,O=Object(D.useState)("python"),C=Object(G.a)(O,2),T=C[0],x=C[1];function f(v){x(a[v][1])}function w(v){S(v)}return g.a.createElement(k.a,Object($.a)({},s,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:w}),g.a.createElement(k.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},g.a.createElement(n.a,{onChange:f},Object.keys(a).map(function(v){return g.a.createElement(u,{key:v,value:v},a[v][0])}))),g.a.createElement(k.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},g.a.createElement(A,{mode:T})),g.a.createElement("div",{className:"flex-container flex-end"},g.a.createElement(X.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),g.a.createElement(X.a,{type:"ghost",onClick:L},"\u53D6\u6D88")))};function A(E){var S=E.value,L=E.onChange,O=E.mode,C=E.options,T=C===void 0?{}:C,x=Object(D.useRef)(),f=Object(D.useState)(),w=Object(G.a)(f,2),v=w[0],b=w[1];return Object(D.useEffect)(function(){if(v){function F(B){var R=B.getValue();L&&L(R)}return v.on("change",F),function(){v.off("change",F)}}},[v,L]),Object(D.useEffect)(function(){v&&v.setOption("mode",O)},[v,O]),Object(D.useEffect)(function(){v&&((S!==v.getValue()||S==="")&&setTimeout(function(){v.setValue(S||" ")},300))},[v,S]),Object(D.useEffect)(function(){if(x.current&&!v){var F=m.a.fromTextArea(x.current,Object(re.a)({mode:O,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},T));b(F)}},[x.current,v]),g.a.createElement("div",{className:"my-codemirror-container"},g.a.createElement("textarea",{ref:x}))}},"8EBN":function(ht,be,Z){(function(re){re(Z("VrN/"))})(function(re){"use strict";re.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 $=0;$<re.modeInfo.length;$++){var P=re.modeInfo[$];P.mimes&&(P.mime=P.mimes[0])}re.findModeByMIME=function(X){X=X.toLowerCase();for(var U=0;U<re.modeInfo.length;U++){var k=re.modeInfo[U];if(k.mime==X)return k;if(k.mimes){for(var G=0;G<k.mimes.length;G++)if(k.mimes[G]==X)return k}}if(/\+xml$/.test(X))return re.findModeByMIME("application/xml");if(/\+json$/.test(X))return re.findModeByMIME("application/json")},re.findModeByExtension=function(X){X=X.toLowerCase();for(var U=0;U<re.modeInfo.length;U++){var k=re.modeInfo[U];if(k.ext){for(var G=0;G<k.ext.length;G++)if(k.ext[G]==X)return k}}},re.findModeByFileName=function(X){for(var U=0;U<re.modeInfo.length;U++){var k=re.modeInfo[U];if(k.file&&k.file.test(X))return k}var G=X.lastIndexOf("."),H=G>-1&&X.substring(G+1,X.length);if(H)return re.findModeByExtension(H)},re.findModeByName=function(X){X=X.toLowerCase();for(var U=0;U<re.modeInfo.length;U++){var k=re.modeInfo[U];if(k.name.toLowerCase()==X)return k;if(k.alias){for(var G=0;G<k.alias.length;G++)if(k.alias[G].toLowerCase()==X)return k}}}})},"8HAY":function(ht,be,Z){"use strict";Z.d(be,"a",function(){return U}),Z.d(be,"b",function(){return k}),Z.d(be,"d",function(){return G}),Z.d(be,"e",function(){return H}),Z.d(be,"c",function(){return n});var re=Z("MI8n"),$=Z("pmY6"),P=Z("3/fG"),X=function(D,g,p,m){function h(o){return o instanceof p?o:new p(function(c){c(o)})}return new(p||(p=Promise))(function(o,c){function l(a){try{s(m.next(a))}catch(A){c(A)}}function u(a){try{s(m.throw(a))}catch(A){c(A)}}function s(a){a.done?o(a.value):h(a.value).then(l,u)}s((m=m.apply(D,g||[])).next())})};class U extends $.a{constructor(D,g="",p="",m=!0,h){super();this._onDidChange=this._register(new re.b),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=D,this._label=g,this._cssClass=p,this._enabled=m,this._actionCallback=h}get id(){return this._id}get label(){return this._label}set label(D){this._setLabel(D)}_setLabel(D){this._label!==D&&(this._label=D,this._onDidChange.fire({label:D}))}get tooltip(){return this._tooltip||""}set tooltip(D){this._setTooltip(D)}_setTooltip(D){this._tooltip!==D&&(this._tooltip=D,this._onDidChange.fire({tooltip:D}))}get class(){return this._cssClass}set class(D){this._setClass(D)}_setClass(D){this._cssClass!==D&&(this._cssClass=D,this._onDidChange.fire({class:D}))}get enabled(){return this._enabled}set enabled(D){this._setEnabled(D)}_setEnabled(D){this._enabled!==D&&(this._enabled=D,this._onDidChange.fire({enabled:D}))}get checked(){return this._checked}set checked(D){this._setChecked(D)}_setChecked(D){this._checked!==D&&(this._checked=D,this._onDidChange.fire({checked:D}))}run(D,g){return X(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(D))})}}class k extends $.a{constructor(){super(...arguments);this._onBeforeRun=this._register(new re.b),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new re.b),this.onDidRun=this._onDidRun.event}run(D,g){return X(this,void 0,void 0,function*(){if(!D.enabled)return;this._onBeforeRun.fire({action:D});let p;try{yield this.runAction(D,g)}catch(m){p=m}this._onDidRun.fire({action:D,error:p})})}runAction(D,g){return X(this,void 0,void 0,function*(){yield D.run(g)})}}class G extends U{constructor(D){super(G.ID,D,D?"separator text":"separator");this.checked=!1,this.enabled=!1}}G.ID="vs.actions.separator";class H{constructor(D,g,p,m){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=D,this.label=g,this.class=m,this._actions=p}get actions(){return this._actions}dispose(){}run(){return X(this,void 0,void 0,function*(){})}}class n extends U{constructor(){super(n.ID,P.a("submenu.empty","(empty)"),void 0,!1)}}n.ID="vs.actions.empty"},"8JLL":function(ht,be,Z){ht.exports={flex_box_center:"flex_box_center___15KPT",flex_space_between:"flex_space_between___1QiSE",flex_box_vertical_center:"flex_box_vertical_center___3bNXy",flex_box_center_end:"flex_box_center_end___1hLE4",flex_box_column:"flex_box_column___3CCm3",reply:"reply___eY1t0",replyList:"replyList___3g6Og",comment:"comment___LHpQl",content:"content___XWl90",commentItem:"commentItem___2Y_u_"}},"8hTe":function(ht,be,Z){ht.exports={button:"button___1wy9m"}},"9Bee":function(ht,be,Z){"use strict";var re=Z("DYRE"),$=Z("zeV3"),P=Z("+L6B"),X=Z("2/Rp"),U=Z("k1fw"),k=Z("9og8"),G=Z("tJVT"),H=Z("WmNS"),n=Z.n(H),D=Z("q1tI"),g=Z.n(D),p=Z("vg9a"),m=Z("DlQD"),h=Z.n(m),o=Z("rUJ1");function c(V,_){var I=V.match(/^(\s+)(?:```)/);if(I===null)return _;var W=I[1];return _.split(`
|
|
`).map(function(q){var z=q.match(/^\s+/);if(z===null)return q;var ge=Object(G.a)(z,1),He=ge[0];return He.length>=W.length?q.slice(W.length):q}).join(`
|
|
`)}var l=[],u=["<ul>"],s=new h.a.Renderer,a=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function A(){l.length=0,u=["<ul>"]}var E={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function S(V,_,I,W){if(_>=V.length||V[_].level<=I)return _;var q=V[_];W.push("<li><a href='#"+q.anchor+"'>"+q.text+"</a>"),_++;var z=[];return _=S(V,_,q.level,z),z.length>0&&(W.push("<ul>"),z.forEach(function(ge){W.push(ge)}),W.push("</ul>")),W.push("</li>"),_=S(V,_,I,W),_}function L(){return S(l,0,0,u),u.push("</ul>"),u.join("")}var O={heading:function(_){var I=a.exec(_);if(I)return{type:"heading",raw:I[0],depth:I[1].length,text:I[2]}},fences:function(_){var I=this.rules.block.fences.exec(_);if(I){var W=I[0],q=c(W,I[3]||""),z=I[2]?I[2].trim():I[2];if(["latex","katex","math"].indexOf(z)>=0){var ge=x(),He=q;q=ge,f[ge]={type:"block",expression:He}}return{type:"code",raw:W,lang:z,text:q}}}},C=/(?:\${2})([^\n`]+?)(?:\${2})/gi,T=0,x=function(){return"__special_katext_id_".concat(T++,"__")},f={};function w(){return f}function v(){T=0,f={}}function b(V){return V=V.replace(C,function(_,I){var W=x();return f[W]={type:"inline",expression:I},W}),V}var F=s.listitem;s.listitem=function(V){return F(b(V))};var B=s.paragraph;s.paragraph=function(V){return B(b(V))};var R=s.tablecell;s.tablecell=function(V,_){return R(b(V),_)},s.code=function(V,_,I){var W=(_||"").match(/\S*/)[0];return W?["latex","katex","math"].indexOf(W)>=0?"<p class='editormd-tex'>".concat(V,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(_,'">').concat(I?V:Object(o.escape)(V,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(I?V:Object(o.escape)(V,!0))+"</code></pre>"},s.heading=function(V,_,I){var W=this.options.headerPrefix+I.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return l.push({anchor:W,level:_,text:V}),"<h"+_+' id="'+W+'">'+V+"</h"+_+">"},h.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),h.a.use({tokenizer:O,renderer:s});var j=h.a,N=Z("SJMd"),y=Z("ulZh"),Y=Z.n(y),ee=Z("m3rI"),ae=Z("Oy/b"),ue=Z("p5ED"),Re=Z("ErOA");/*! *****************************************************************************
|
|
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 Ee=function(V,_){return(Ee=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(I,W){I.__proto__=W}||function(I,W){for(var q in W)Object.prototype.hasOwnProperty.call(W,q)&&(I[q]=W[q])})(V,_)};function xe(V,_){function I(){this.constructor=V}Ee(V,_),V.prototype=_===null?Object.create(_):(I.prototype=_.prototype,new I)}function Ce(V,_,I,W){return new(I||(I=Promise))(function(q,z){function ge(gt){try{it(W.next(gt))}catch(Ge){z(Ge)}}function He(gt){try{it(W.throw(gt))}catch(Ge){z(Ge)}}function it(gt){var Ge;gt.done?q(gt.value):(Ge=gt.value,Ge instanceof I?Ge:new I(function(wt){wt(Ge)})).then(ge,He)}it((W=W.apply(V,_||[])).next())})}function Oe(V,_){var I,W,q,z,ge={label:0,sent:function(){if(1&q[0])throw q[1];return q[1]},trys:[],ops:[]};return z={next:He(0),throw:He(1),return:He(2)},typeof Symbol=="function"&&(z[Symbol.iterator]=function(){return this}),z;function He(it){return function(gt){return function(Ge){if(I)throw new TypeError("Generator is already executing.");for(;ge;)try{if(I=1,W&&(q=2&Ge[0]?W.return:Ge[0]?W.throw||((q=W.return)&&q.call(W),0):W.next)&&!(q=q.call(W,Ge[1])).done)return q;switch(W=0,q&&(Ge=[2&Ge[0],q.value]),Ge[0]){case 0:case 1:q=Ge;break;case 4:return ge.label++,{value:Ge[1],done:!1};case 5:ge.label++,W=Ge[1],Ge=[0];continue;case 7:Ge=ge.ops.pop(),ge.trys.pop();continue;default:if(!(q=ge.trys,(q=q.length>0&&q[q.length-1])||Ge[0]!==6&&Ge[0]!==2)){ge=0;continue}if(Ge[0]===3&&(!q||Ge[1]>q[0]&&Ge[1]<q[3])){ge.label=Ge[1];break}if(Ge[0]===6&&ge.label<q[1]){ge.label=q[1],q=Ge;break}if(q&&ge.label<q[2]){ge.label=q[2],ge.ops.push(Ge);break}q[2]&&ge.ops.pop(),ge.trys.pop();continue}Ge=_.call(V,ge)}catch(wt){Ge=[6,wt],W=0}finally{I=q=0}if(5&Ge[0])throw Ge[1];return{value:Ge[0]?Ge[1]:void 0,done:!0}}([it,gt])}}}function pe(){for(var V=0,_=0,I=arguments.length;_<I;_++)V+=arguments[_].length;var W=Array(V),q=0;for(_=0;_<I;_++)for(var z=arguments[_],ge=0,He=z.length;ge<He;ge++,q++)W[q]=z[ge];return W}var de=function(){function V(){}return V.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},V.setAttributes=function(_,I){for(var W=0,q=I;W<q.length;W++){var z=q[W],ge=z[0],He=z[1];_.setAttribute(ge,He)}},V.createRect=function(_,I,W){var q=document.createElementNS("http://www.w3.org/2000/svg","rect");return q.setAttribute("width",_.toString()),q.setAttribute("height",I.toString()),W&&V.setAttributes(q,W),q},V.createLine=function(_,I,W,q,z){var ge=document.createElementNS("http://www.w3.org/2000/svg","line");return ge.setAttribute("x1",_.toString()),ge.setAttribute("y1",I.toString()),ge.setAttribute("x2",W.toString()),ge.setAttribute("y2",q.toString()),z&&V.setAttributes(ge,z),ge},V.createPolygon=function(_,I){var W=document.createElementNS("http://www.w3.org/2000/svg","polygon");return W.setAttribute("points",_),I&&V.setAttributes(W,I),W},V.createCircle=function(_,I){var W=document.createElementNS("http://www.w3.org/2000/svg","circle");return W.setAttribute("cx",(_/2).toString()),W.setAttribute("cy",(_/2).toString()),W.setAttribute("r",_.toString()),I&&V.setAttributes(W,I),W},V.createEllipse=function(_,I,W){var q=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return q.setAttribute("cx",(_/2).toString()),q.setAttribute("cy",(I/2).toString()),q.setAttribute("rx",(_/2).toString()),q.setAttribute("ry",(I/2).toString()),W&&V.setAttributes(q,W),q},V.createGroup=function(_){var I=document.createElementNS("http://www.w3.org/2000/svg","g");return _&&V.setAttributes(I,_),I},V.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},V.createMarker=function(_,I,W,q,z,ge,He){var it=document.createElementNS("http://www.w3.org/2000/svg","marker");return V.setAttributes(it,[["id",_],["orient",I],["markerWidth",W.toString()],["markerHeight",q.toString()],["refX",z.toString()],["refY",ge.toString()]]),it.appendChild(He),it},V.createText=function(_){var I=document.createElementNS("http://www.w3.org/2000/svg","text");return I.setAttribute("x","0"),I.setAttribute("y","0"),_&&V.setAttributes(I,_),I},V.createTSpan=function(_,I){var W=document.createElementNS("http://www.w3.org/2000/svg","tspan");return W.textContent=_,I&&V.setAttributes(W,I),W},V.createImage=function(_){var I=document.createElementNS("http://www.w3.org/2000/svg","image");return _&&V.setAttributes(I,_),I},V.createPoint=function(_,I){var W=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return W.x=_,W.y=I,W},V.createPath=function(_,I){var W=document.createElementNS("http://www.w3.org/2000/svg","path");return W.setAttribute("d",_),I&&V.setAttributes(W,I),W},V}(),Me=function(){function V(){}return V.addKey=function(_){V.key=_},Object.defineProperty(V,"isLicensed",{get:function(){return!!V.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(V.key)},enumerable:!1,configurable:!0}),V}(),tt=function(){function V(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return V.prototype.rasterize=function(_,I,W){var q=this;return new Promise(function(z){var ge=W!==void 0?W:document.createElement("canvas");_===null&&(q.markersOnly=!0,q.naturalSize=!1);var He=document.createElementNS("http://www.w3.org/2000/svg","svg");He.setAttribute("xmlns","http://www.w3.org/2000/svg"),He.setAttribute("width",I.width.baseVal.valueAsString),He.setAttribute("height",I.height.baseVal.valueAsString),He.setAttribute("viewBox","0 0 "+I.viewBox.baseVal.width.toString()+" "+I.viewBox.baseVal.height.toString()),He.innerHTML=I.innerHTML,q.naturalSize===!0?(He.width.baseVal.value=_.naturalWidth,He.height.baseVal.value=_.naturalHeight):q.width!==void 0&&q.height!==void 0&&(He.width.baseVal.value=q.width,He.height.baseVal.value=q.height),ge.width=He.width.baseVal.value,ge.height=He.height.baseVal.value;var it=He.outerHTML,gt=ge.getContext("2d");q.markersOnly!==!0&>.drawImage(_,0,0,ge.width,ge.height);var Ge=window.URL,wt=new Image(ge.width,ge.height);wt.setAttribute("crossOrigin","anonymous");var zt=new Blob([it],{type:"image/svg+xml"}),en=Ge.createObjectURL(zt);wt.onload=function(){gt.drawImage(wt,0,0),Ge.revokeObjectURL(en);var Wn=ge.toDataURL(q.imageType,q.imageQuality);z(Wn)},wt.src=en})},V}(),We=function(){},rt=function(){function V(_){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+_+"_"}return Object.defineProperty(V.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#ffffff",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarColor:"#eeeeee",toolbarHeight:40,toolboxColor:"#eeeeee",toolboxAccentColor:"#3080c3",undoButtonVisible:!0,redoButtonVisible:!1,zoomButtonVisible:!1,zoomOutButtonVisible:!1,clearButtonVisible:!1,resultButtonBlockVisible:!0,logoPosition:"left"}},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),V.prototype.addClass=function(_){return this.styleSheet===void 0&&this.addStyleSheet(),_.name=""+this.classNamePrefix+_.localName,this.classes.push(_),this.styleSheet.sheet.insertRule("."+_.name+" {"+_.style+"}",this.styleSheet.sheet.cssRules.length),_},V.prototype.addRule=function(_){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(_),this.styleSheet.sheet.insertRule(_.selector+" {"+_.style+"}",this.styleSheet.sheet.cssRules.length)},V.prototype.addStyleSheet=function(){var _;this.styleSheet=document.createElement("style"),((_=this.styleSheetRoot)!==null&&_!==void 0?_:document.head).appendChild(this.styleSheet),this.addRule(new st("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new st("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new st("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new Pe("fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new Pe("fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},V.prototype.removeStyleSheet=function(){var _;this.styleSheet&&(((_=this.styleSheetRoot)!==null&&_!==void 0?_:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},V}(),st=function(V,_){this.selector=V,this.style=_},Pe=function(V,_){this.localName=V,this.style=_},je=function(){function V(_,I,W,q,z){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=_,this.displayMode=I,this.markerItems=W,this.uiStyleSettings=q,this.styles=z,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return V.prototype.show=function(_){var I=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=_,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var W=document.createElement("div");W.className=this.toolbarBlockStyleClass.name,W.style.whiteSpace="nowrap",this.uiContainer.appendChild(W),this.addActionButton(W,'<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(W,'<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(W,'<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(W,'<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(W,'<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(W,'<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(W,'<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(W,'<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(z){var ge=document.createElement("div");ge.className=""+I.toolbarButtonStyleClass.name,ge.setAttribute("data-type-name",z.typeName),ge.innerHTML=z.icon,ge.addEventListener("click",function(){I.markerToolbarButtonClicked(ge,z)}),I.buttons.push(ge),I.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 q=document.createElement("div");q.className=this.toolbarBlockStyleClass.name,q.style.whiteSpace="nowrap",q.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(q),this.addActionButton(q,'<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(q,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},V.prototype.addButtonClickListener=function(_){this.buttonClickListeners.push(_)},V.prototype.removeButtonClickListener=function(_){this.buttonClickListeners.indexOf(_)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(_),1)},V.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},V.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var _=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var I=0;I<this.markerButtons.length;I++)I<_||I===_&&this.markerButtons.length-1===_?this.markerButtonBlock.appendChild(this.markerButtons[I]):(I===_&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[I]))}},V.prototype.overflowButtonClicked=function(){this.markerButtonOverflowBlock.style.display!=="none"?(this.markerButtonOverflowBlock.className=this.markerButtonOverflowBlock.className.replace(this.styles.fadeInAnimationClassName,""),this.markerButtonOverflowBlock.style.display="none"):(this.markerButtonOverflowBlock.className+=" "+this.styles.fadeInAnimationClassName,this.markerButtonOverflowBlock.style.top=this.uiContainer.offsetTop+this.overflowButton.offsetHeight+"px",this.markerButtonOverflowBlock.style.right=this.uiContainer.offsetWidth-this.overflowButton.offsetLeft-this.overflowButton.offsetWidth+2*this.uiContainer.offsetLeft+"px",this.markerButtonOverflowBlock.style.display="inline-block")},V.prototype.resetButtonStyles=function(){var _=this;this.buttons.forEach(function(I){I.className=I.className.replace(_.uiStyleSettings.toolbarButtonStyleColorsClassName?_.uiStyleSettings.toolbarButtonStyleColorsClassName:_.toolbarButtonStyleColorsClass.name,"").trim(),I.className=I.className.replace(_.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?_.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:_.toolbarActiveButtonStyleColorsClass.name,"").trim(),I.className+=" "+(_.uiStyleSettings.toolbarButtonStyleColorsClassName?_.uiStyleSettings.toolbarButtonStyleColorsClassName:_.toolbarButtonStyleColorsClass.name)})},V.prototype.addActionButton=function(_,I,W){var q=this,z=document.createElement("div");switch(z.className=""+this.toolbarButtonStyleClass.name,z.innerHTML=I,z.setAttribute("data-action",W),z.addEventListener("click",function(){q.actionToolbarButtonClicked(z,W)}),W){case"select":z.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":z.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":z.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":z.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":z.style.fill=this.uiStyleSettings.closeButtonColor}_.appendChild(z),this.buttons.push(z)},V.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Pe("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 Pe("toolbar_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Pe("toolbar-block",`
|
|
display: inline-block;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new Pe("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 Pe("toolbar-overflow-block_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`));var _=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Pe("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*_)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*_)+`px;
|
|
padding: `+_+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Pe("toolbar_button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Pe("toolbar_active_button",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new st("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new st("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`))},V.prototype.markerToolbarButtonClicked=function(_,I){this.setActiveButton(_),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(W){return W("marker",I)}),this.markerButtonOverflowBlock.style.display="none"},V.prototype.actionToolbarButtonClicked=function(_,I){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(W){return W("action",I)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},V.prototype.setActiveButton=function(_){this.resetButtonStyles(),_.className=_.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),_.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},V.prototype.setActiveMarkerButton=function(_){var I=this.markerButtons.find(function(W){return W.getAttribute("data-type-name")===_});I&&this.setActiveButton(I)},V.prototype.setCurrentMarker=function(_){var I=this;this.currentMarker=_,this.buttons.filter(function(W){return/delete|notes/.test(W.getAttribute("data-action"))}).forEach(function(W){I.currentMarker===void 0?(W.style.fillOpacity="0.4",W.style.pointerEvents="none"):(W.style.fillOpacity="1",W.style.pointerEvents="all")})},V}(),Ze=function(){function V(_,I,W,q){this.panels=[],this.panelButtons=[],this.markerjsContainer=_,this.displayMode=I,this.uiStyleSettings=W,this.styles=q,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return V.prototype.addStyles=function(){var _;this.toolboxStyleClass=this.styles.addClass(new Pe("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 Pe("toolbox_colors",`
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
`));var I=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Pe("toolbox-button-row",`
|
|
display: flex;
|
|
cursor: default;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Pe("toolbox-button-row_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Pe("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 Pe("toolbox-panel-row_colors",`
|
|
background-color: `+((_=this.uiStyleSettings.toolboxBackgroundColor)!==null&&_!==void 0?_:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new Pe("toolbox_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*I)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*I)+`px;
|
|
padding: `+I+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new Pe("toolbox-button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Pe("toolbox-active-button_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.styles.addRule(new st("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new st("."+this.toolboxButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`))},V.prototype.show=function(_){var I;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=_,this.uiContainer.className=this.toolboxStyleClass.name+" "+((I=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&I!==void 0?I:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},V.prototype.setPanelButtons=function(_){var I,W,q=this;this.panels=_,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((I=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&I!==void 0?I:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((W=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&W!==void 0?W:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(z){var ge;z.uiStyleSettings=q.uiStyleSettings;var He=document.createElement("div");He.className=q.toolboxButtonStyleClass.name+" "+((ge=q.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&ge!==void 0?ge:q.toolboxButtonStyleColorsClass.name),He.innerHTML=z.icon,He.title=z.title,He.addEventListener("click",function(){q.panelButtonClick(z)}),q.panelButtons.push(He),q.buttonRow.appendChild(He)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},V.prototype.panelButtonClick=function(_){var I=this,W=-1;if(_!==this.activePanel){W=this.panels.indexOf(_),this.panelRow.innerHTML="";var q=_.getUi();q.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(q),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=_}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){I.displayMode==="inline"?I.panelRow.style.display="none":I.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(z,ge){var He,it;z.className=I.toolboxButtonStyleClass.name+" "+(ge===W?""+((He=I.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&He!==void 0?He:I.toolboxActiveButtonStyleColorsClass.name):""+((it=I.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&it!==void 0?it:I.toolboxButtonStyleColorsClass.name))})},V}(),se=function(V,_){this.title=V,this.icon=_},_e=function(V){function _(I,W,q,z){var ge=V.call(this,I,z||'<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=W,ge.currentColor=q,ge.setCurrentColor=ge.setCurrentColor.bind(ge),ge.getColorBox=ge.getColorBox.bind(ge),ge}return xe(_,V),_.prototype.getUi=function(){var I=this,W=document.createElement("div");return W.style.overflow="hidden",W.style.whiteSpace="nowrap",this.colors.forEach(function(q){var z=I.getColorBox(q);W.appendChild(z),I.colorBoxes.push(z)}),W},_.prototype.getColorBox=function(I){var W=this,q=this.uiStyleSettings.toolbarHeight/4,z=this.uiStyleSettings.toolbarHeight-q,ge=document.createElement("div");ge.style.display="inline-block",ge.style.boxSizing="content-box",ge.style.width=z-2+"px",ge.style.height=z-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=(z+2)/2+"px",ge.style.borderColor=I===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",ge.addEventListener("click",function(){W.setCurrentColor(I,ge)});var He=document.createElement("div");return He.style.display="inline-block",He.style.width=z-2+"px",He.style.height=z-2+"px",He.style.backgroundColor=I,He.style.borderRadius=z/2+"px",I==="transparent"&&(He.style.fill=this.uiStyleSettings.toolboxAccentColor,He.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(He),ge},_.prototype.setCurrentColor=function(I,W){var q=this;this.currentColor=I,this.colorBoxes.forEach(function(z){z.style.borderColor=z===W?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(I)},_}(se),Te=function(){function V(_,I,W){this._state="new",this._isSelected=!1,this._container=_,this._overlayContainer=I,this.globalSettings=W,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(V.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),V.prototype.ownsTarget=function(_){return!1},Object.defineProperty(V.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),V.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},V.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},V.prototype.pointerDown=function(_,I){},V.prototype.dblClick=function(_,I){},V.prototype.manipulate=function(_){},V.prototype.pointerUp=function(_){this.stateChanged()},V.prototype.dispose=function(){},V.prototype.addMarkerVisualToContainer=function(_){this.container.childNodes.length>0?this.container.insertBefore(_,this.container.childNodes[0]):this.container.appendChild(_)},V.prototype.getState=function(){return{typeName:V.typeName,state:this.state,notes:this.notes}},V.prototype.restoreState=function(_){this._state=_.state,this.notes=_.notes},V.prototype.scale=function(_,I){},V.prototype.colorChanged=function(_){this.onColorChanged&&this.onColorChanged(_),this.stateChanged()},V.prototype.fillColorChanged=function(_){this.onFillColorChanged&&this.onFillColorChanged(_),this.stateChanged()},V.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var _=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),_.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(_)&&this.onStateChanged(this)}},V.typeName="MarkerBase",V}(),Ae=function(){function V(){this.findGripByVisual=this.findGripByVisual.bind(this)}return V.prototype.findGripByVisual=function(_){return this.topLeft.ownsTarget(_)?this.topLeft:this.topCenter.ownsTarget(_)?this.topCenter:this.topRight.ownsTarget(_)?this.topRight:this.centerLeft.ownsTarget(_)?this.centerLeft:this.centerRight.ownsTarget(_)?this.centerRight:this.bottomLeft.ownsTarget(_)?this.bottomLeft:this.bottomCenter.ownsTarget(_)?this.bottomCenter:this.bottomRight.ownsTarget(_)?this.bottomRight:void 0},V}(),ze=function(){function V(){this.GRIP_SIZE=10,this.visual=de.createGroup(),this.visual.appendChild(de.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(de.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return V.prototype.ownsTarget=function(_){return _===this.visual||_===this.visual.childNodes[0]||_===this.visual.childNodes[1]},V}(),Be=function(){function V(){}return V.toITransformMatrix=function(_){return{a:_.a,b:_.b,c:_.c,d:_.d,e:_.e,f:_.f}},V.toSVGMatrix=function(_,I){return _.a=I.a,_.b=I.b,_.c=I.c,_.d=I.d,_.e=I.e,_.f=I.f,_},V}(),Ue=function(V){function _(I,W,q){var z=V.call(this,I,W,q)||this;return z.left=0,z.top=0,z.width=0,z.height=0,z.defaultSize={x:50,y:20},z.offsetX=0,z.offsetY=0,z.rotationAngle=0,z.CB_DISTANCE=10,z._suppressMarkerCreateEvent=!1,z.container.transform.baseVal.appendItem(de.createTransform()),z.setupControlBox(),z}return xe(_,V),Object.defineProperty(_.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"visual",{get:function(){return this._visual},set:function(I){this._visual=I;var W=de.createTransform();this._visual.transform.baseVal.appendItem(W)},enumerable:!1,configurable:!0}),_.prototype.ownsTarget=function(I){return!!V.prototype.ownsTarget.call(this,I)||!!(this.controlGrips.findGripByVisual(I)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(I))},_.prototype.pointerDown=function(I,W){V.prototype.pointerDown.call(this,I,W),this.state==="new"&&(this.left=I.x,this.top=I.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var q=this.unrotatePoint(I);if(this.manipulationStartX=q.x,this.manipulationStartY=q.y,this.offsetX=q.x-this.left,this.offsetY=q.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(W),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(W)){this.activeGrip=this.rotatorGrip;var z=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=z.x-this.width/2,this.top=z.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"},_.prototype.pointerUp=function(I){var W=this.state;V.prototype.pointerUp.call(this,I),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(I),this._state="select",W==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},_.prototype.moveVisual=function(I){this.visual.style.transform="translate("+I.x+"px, "+I.y+"px)"},_.prototype.manipulate=function(I){var W=this.unrotatePoint(I);this.state==="creating"?this.resize(I):this.state==="move"?(this.left=this.manipulationStartLeft+(W.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(W.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(W):this.state==="rotate"&&this.rotate(I)},_.prototype.resize=function(I){var W=this.manipulationStartLeft,q=this.manipulationStartWidth,z=this.manipulationStartTop,ge=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:W=this.manipulationStartLeft+I.x-this.manipulationStartX,q=this.manipulationStartWidth+this.manipulationStartLeft-W;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:q=this.manipulationStartWidth+I.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:z=this.manipulationStartTop+I.y-this.manipulationStartY,ge=this.manipulationStartHeight+this.manipulationStartTop-z;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:ge=this.manipulationStartHeight+I.y-this.manipulationStartY}q>=0?(this.left=W,this.width=q):(this.left=W+q,this.width=-q),ge>=0?(this.top=z,this.height=ge):(this.top=z+ge,this.height=-ge),this.setSize()},_.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},_.prototype.rotate=function(I){if(Math.abs(I.x-this.centerX)>.1){var W=Math.sign(I.x-this.centerX);this.rotationAngle=180*Math.atan((I.y-this.centerY)/(I.x-this.centerX))/Math.PI+90*W,this.applyRotation()}},_.prototype.applyRotation=function(){var I=this.container.transform.baseVal.getItem(0);I.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(I,0)},_.prototype.rotatePoint=function(I){if(this.rotationAngle===0)return I;var W=this.container.getCTM(),q=de.createPoint(I.x,I.y);return{x:(q=q.matrixTransform(W)).x,y:q.y}},_.prototype.unrotatePoint=function(I){if(this.rotationAngle===0)return I;var W=this.container.getCTM();W=W.inverse();var q=de.createPoint(I.x,I.y);return{x:(q=q.matrixTransform(W)).x,y:q.y}},_.prototype.select=function(){V.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},_.prototype.deselect=function(){V.prototype.deselect.call(this),this.controlBox.style.display="none"},_.prototype.setupControlBox=function(){this.controlBox=de.createGroup();var I=de.createTransform();I.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(I),this.container.appendChild(this.controlBox),this.controlRect=de.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=de.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 Ae,this.addControlGrips(),this.controlBox.style.display="none"},_.prototype.adjustControlBox=function(){var I=this.controlBox.transform.baseVal.getItem(0);I.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(I,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()},_.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()},_.prototype.createGrip=function(){var I=new ze;return I.visual.transform.baseVal.appendItem(de.createTransform()),this.controlBox.appendChild(I.visual),I},_.prototype.positionGrips=function(){var I=this.controlGrips.topLeft.GRIP_SIZE,W=-I/2,q=W,z=(this.width+this.CB_DISTANCE)/2-I/2,ge=(this.height+this.CB_DISTANCE)/2-I/2,He=this.height+this.CB_DISTANCE-I/2,it=this.width+this.CB_DISTANCE-I/2;this.positionGrip(this.controlGrips.topLeft.visual,W,q),this.positionGrip(this.controlGrips.topCenter.visual,z,q),this.positionGrip(this.controlGrips.topRight.visual,it,q),this.positionGrip(this.controlGrips.centerLeft.visual,W,ge),this.positionGrip(this.controlGrips.centerRight.visual,it,ge),this.positionGrip(this.controlGrips.bottomLeft.visual,W,He),this.positionGrip(this.controlGrips.bottomCenter.visual,z,He),this.positionGrip(this.controlGrips.bottomRight.visual,it,He),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,z,q-3*this.CB_DISTANCE)},_.prototype.positionGrip=function(I,W,q){var z=I.transform.baseVal.getItem(0);z.setTranslate(W,q),I.transform.baseVal.replaceItem(z,0)},_.prototype.hideControlBox=function(){this.controlBox.style.display="none"},_.prototype.showControlBox=function(){this.controlBox.style.display=""},_.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:Be.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:Be.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},V.prototype.getState.call(this))},_.prototype.restoreState=function(I){V.prototype.restoreState.call(this,I);var W=I;this.left=W.left,this.top=W.top,this.width=W.width,this.height=W.height,this.rotationAngle=W.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(Be.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,W.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(Be.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,W.containerTransformMatrix))},_.prototype.scale=function(I,W){V.prototype.scale.call(this,I,W);var q=this.rotatePoint({x:this.left,y:this.top}),z=this.unrotatePoint({x:q.x*I,y:q.y*W});this.left=z.x,this.top=z.y,this.width=this.width*I,this.height=this.height*W,this.adjustControlBox()},_}(Te),Ve=function(V){function _(I,W,q){var z=V.call(this,I,W,q)||this;return z.fillColor="transparent",z.strokeColor="transparent",z.strokeWidth=0,z.strokeDasharray="",z.opacity=1,z.setStrokeColor=z.setStrokeColor.bind(z),z.setFillColor=z.setFillColor.bind(z),z.setStrokeWidth=z.setStrokeWidth.bind(z),z.setStrokeDasharray=z.setStrokeDasharray.bind(z),z.createVisual=z.createVisual.bind(z),z}return xe(_,V),_.prototype.ownsTarget=function(I){return!(!V.prototype.ownsTarget.call(this,I)&&I!==this.visual)},_.prototype.createVisual=function(){this.visual=de.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)},_.prototype.pointerDown=function(I,W){V.prototype.pointerDown.call(this,I,W),this.state==="new"&&(this.createVisual(),this.moveVisual(I),this._state="creating")},_.prototype.manipulate=function(I){V.prototype.manipulate.call(this,I)},_.prototype.resize=function(I){V.prototype.resize.call(this,I),this.setSize()},_.prototype.setSize=function(){V.prototype.setSize.call(this),de.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},_.prototype.pointerUp=function(I){V.prototype.pointerUp.call(this,I),this.setSize()},_.prototype.setStrokeColor=function(I){this.strokeColor=I,this.visual&&de.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(I),this.stateChanged()},_.prototype.setFillColor=function(I){this.fillColor=I,this.visual&&de.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},_.prototype.setStrokeWidth=function(I){this.strokeWidth=I,this.visual&&de.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},_.prototype.setStrokeDasharray=function(I){this.strokeDasharray=I,this.visual&&de.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},_.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},V.prototype.getState.call(this))},_.prototype.restoreState=function(I){var W=I;this.fillColor=W.fillColor,this.strokeColor=W.strokeColor,this.strokeWidth=W.strokeWidth,this.strokeDasharray=W.strokeDasharray,this.opacity=W.opacity,this.createVisual(),V.prototype.restoreState.call(this,I),this.setSize()},_.prototype.scale=function(I,W){V.prototype.scale.call(this,I,W),this.setSize()},_.title="Rectangle marker",_}(Ue),$e=function(V){function _(I,W,q,z){var ge=V.call(this,I,z||'<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=W,ge.currentWidth=q,ge.setCurrentWidth=ge.setCurrentWidth.bind(ge),ge}return xe(_,V),_.prototype.getUi=function(){var I=this,W=document.createElement("div");return W.style.display="flex",W.style.overflow="hidden",W.style.flexGrow="2",this.widths.forEach(function(q){var z=document.createElement("div");z.style.display="flex",z.style.flexGrow="2",z.style.alignItems="center",z.style.justifyContent="space-between",z.style.padding="5px",z.style.borderWidth="2px",z.style.borderStyle="solid",z.style.borderColor=q===I.currentWidth?I.uiStyleSettings.toolboxAccentColor:"transparent",z.addEventListener("click",function(){I.setCurrentWidth(q,z)}),W.appendChild(z);var ge=document.createElement("div");ge.innerText=q.toString(),ge.style.marginRight="5px",z.appendChild(ge);var He=document.createElement("div");He.style.minHeight="20px",He.style.flexGrow="2",He.style.display="flex",He.style.alignItems="center";var it=document.createElement("hr");it.style.minWidth="20px",it.style.border="0px",it.style.borderTop=q+"px solid "+I.uiStyleSettings.toolboxColor,it.style.flexGrow="2",He.appendChild(it),z.appendChild(He),I.widthBoxes.push(z)}),W},_.prototype.setCurrentWidth=function(I,W){var q=this;this.currentWidth=I,this.widthBoxes.forEach(function(z){z.style.borderColor=z===W?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},_}(se),Xe=function(V){function _(I,W,q,z){var ge=V.call(this,I,z||'<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=W,ge.currentStyle=q,ge.setCurrentStyle=ge.setCurrentStyle.bind(ge),ge}return xe(_,V),_.prototype.getUi=function(){var I=this,W=document.createElement("div");return W.style.display="flex",W.style.overflow="hidden",W.style.flexGrow="2",this.styles.forEach(function(q){var z=document.createElement("div");z.style.display="flex",z.style.alignItems="center",z.style.justifyContent="space-between",z.style.padding="5px",z.style.borderWidth="2px",z.style.borderStyle="solid",z.style.overflow="hidden",z.style.maxWidth=100/I.styles.length-5+"%",z.style.borderColor=q===I.currentStyle?I.uiStyleSettings.toolboxAccentColor:"transparent",z.addEventListener("click",function(){I.setCurrentStyle(q,z)}),W.appendChild(z);var ge=document.createElement("div");ge.style.minHeight="20px",ge.style.flexGrow="2",ge.style.overflow="hidden";var He=`<svg width="100" height="20">
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+I.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(q!==""?'stroke-dasharray="'+q+'"':"")+` />
|
|
</svg>`;ge.innerHTML=He,z.appendChild(ge),I.styleBoxes.push(z)}),W},_.prototype.setCurrentStyle=function(I,W){var q=this;this.currentStyle=I,this.styleBoxes.forEach(function(z){z.style.borderColor=z===W?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},_}(se),et=function(V){function _(I,W,q){var z=V.call(this,I,W,q)||this;return z.strokeColor=q.defaultColor,z.strokeWidth=q.defaultStrokeWidth,z.strokeDasharray=q.defaultStrokeDasharray,z.strokePanel=new _e("Line color",q.defaultColorSet,q.defaultColor),z.strokePanel.onColorChanged=z.setStrokeColor,z.strokeWidthPanel=new $e("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),z.strokeWidthPanel.onWidthChanged=z.setStrokeWidth,z.strokeStylePanel=new Xe("Line style",q.defaultStrokeDasharrays,q.defaultStrokeDasharray),z.strokeStylePanel.onStyleChanged=z.setStrokeDasharray,z}return xe(_,V),Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var I=V.prototype.getState.call(this);return I.typeName=_.typeName,I},_.typeName="FrameMarker",_.title="Frame marker",_.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',_}(Ve),Ie=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},nt=function(V){function _(I,W,q){var z=V.call(this,I,W,q)||this;return z.x1=0,z.y1=0,z.x2=0,z.y2=0,z.defaultLength=50,z.manipulationStartX=0,z.manipulationStartY=0,z.manipulationStartX1=0,z.manipulationStartY1=0,z.manipulationStartX2=0,z.manipulationStartY2=0,z.setupControlBox(),z}return xe(_,V),_.prototype.ownsTarget=function(I){return!!V.prototype.ownsTarget.call(this,I)||!(!this.grip1.ownsTarget(I)&&!this.grip2.ownsTarget(I))},_.prototype.pointerDown=function(I,W){V.prototype.pointerDown.call(this,I,W),this.manipulationStartX=I.x,this.manipulationStartY=I.y,this.state==="new"&&(this.x1=I.x,this.y1=I.y,this.x2=I.x,this.y2=I.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(W)?this.activeGrip=this.grip1:this.grip2.ownsTarget(W)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},_.prototype.pointerUp=function(I){var W=this.state;V.prototype.pointerUp.call(this,I),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(I),this._state="select",W==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},_.prototype.adjustVisual=function(){},_.prototype.manipulate=function(I){this.state==="creating"?this.resize(I):this.state==="move"?(this.x1=this.manipulationStartX1+I.x-this.manipulationStartX,this.y1=this.manipulationStartY1+I.y-this.manipulationStartY,this.x2=this.manipulationStartX2+I.x-this.manipulationStartX,this.y2=this.manipulationStartY2+I.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(I)},_.prototype.resize=function(I){switch(this.activeGrip){case this.grip1:this.x1=I.x,this.y1=I.y;break;case this.grip2:case void 0:this.x2=I.x,this.y2=I.y}this.adjustVisual(),this.adjustControlBox()},_.prototype.select=function(){V.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},_.prototype.deselect=function(){V.prototype.deselect.call(this),this.controlBox.style.display="none"},_.prototype.setupControlBox=function(){this.controlBox=de.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},_.prototype.adjustControlBox=function(){this.positionGrips()},_.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},_.prototype.createGrip=function(){var I=new ze;return I.visual.transform.baseVal.appendItem(de.createTransform()),this.controlBox.appendChild(I.visual),I},_.prototype.positionGrips=function(){var I=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-I/2,this.y1-I/2),this.positionGrip(this.grip2.visual,this.x2-I/2,this.y2-I/2)},_.prototype.positionGrip=function(I,W,q){var z=I.transform.baseVal.getItem(0);z.setTranslate(W,q),I.transform.baseVal.replaceItem(z,0)},_.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},V.prototype.getState.call(this))},_.prototype.restoreState=function(I){V.prototype.restoreState.call(this,I);var W=I;this.x1=W.x1,this.y1=W.y1,this.x2=W.x2,this.y2=W.y2},_.prototype.scale=function(I,W){V.prototype.scale.call(this,I,W),this.x1=this.x1*I,this.y1=this.y1*W,this.x2=this.x2*I,this.y2=this.y2*W,this.adjustVisual(),this.adjustControlBox()},_}(Te),at=function(V){function _(I,W,q){var z=V.call(this,I,W,q)||this;return z.strokeColor="transparent",z.strokeWidth=0,z.strokeDasharray="",z.setStrokeColor=z.setStrokeColor.bind(z),z.setStrokeWidth=z.setStrokeWidth.bind(z),z.setStrokeDasharray=z.setStrokeDasharray.bind(z),z.strokeColor=q.defaultColor,z.strokeWidth=q.defaultStrokeWidth,z.strokeDasharray=q.defaultStrokeDasharray,z.strokePanel=new _e("Line color",q.defaultColorSet,q.defaultColor),z.strokePanel.onColorChanged=z.setStrokeColor,z.strokeWidthPanel=new $e("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),z.strokeWidthPanel.onWidthChanged=z.setStrokeWidth,z.strokeStylePanel=new Xe("Line style",q.defaultStrokeDasharrays,q.defaultStrokeDasharray),z.strokeStylePanel.onStyleChanged=z.setStrokeDasharray,z}return xe(_,V),_.prototype.ownsTarget=function(I){return!(!V.prototype.ownsTarget.call(this,I)&&I!==this.visual&&I!==this.selectorLine&&I!==this.visibleLine)},_.prototype.createVisual=function(){this.visual=de.createGroup(),this.selectorLine=de.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=de.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)},_.prototype.pointerDown=function(I,W){V.prototype.pointerDown.call(this,I,W),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},_.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()),de.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),de.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),de.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},_.prototype.setStrokeColor=function(I){this.strokeColor=I,this.adjustVisual(),this.colorChanged(I)},_.prototype.setStrokeWidth=function(I){this.strokeWidth=I,this.adjustVisual()},_.prototype.setStrokeDasharray=function(I){this.strokeDasharray=I,this.adjustVisual(),this.stateChanged()},Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var I=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},V.prototype.getState.call(this));return I.typeName=_.typeName,I},_.prototype.restoreState=function(I){V.prototype.restoreState.call(this,I);var W=I;this.strokeColor=W.strokeColor,this.strokeWidth=W.strokeWidth,this.strokeDasharray=W.strokeDasharray,this.createVisual(),this.adjustVisual()},_.typeName="LineMarker",_.title="Line marker",_.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',_}(nt),De=function(V){function _(I,W,q,z){var ge=V.call(this,I,z||'<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=W,ge.currentFont=q,ge.setCurrentFont=ge.setCurrentFont.bind(ge),ge}return xe(_,V),_.prototype.getUi=function(){var I=this,W=document.createElement("div");return W.style.overflow="hidden",W.style.flexGrow="2",this.fonts.forEach(function(q){var z=document.createElement("div");z.style.display="inline-block",z.style.alignItems="center",z.style.justifyContent="space-between",z.style.padding="5px",z.style.borderWidth="2px",z.style.borderStyle="solid",z.style.overflow="hidden",z.style.maxWidth=100/I.fonts.length-5+"%",z.style.borderColor=q===I.currentFont?I.uiStyleSettings.toolboxAccentColor:"transparent",z.addEventListener("click",function(){I.setCurrentFont(q,z)}),W.appendChild(z);var ge=document.createElement("div");ge.style.display="flex",ge.style.minHeight="20px",ge.style.flexGrow="2",ge.style.fontFamily=q,ge.style.overflow="hidden";var He=document.createElement("div");He.style.whiteSpace="nowrap",He.style.overflow="hidden",He.style.textOverflow="ellipsis",He.innerHTML="The quick brown fox jumps over the lazy dog",ge.appendChild(He),z.appendChild(ge),I.fontBoxes.push(z)}),W},_.prototype.setCurrentFont=function(I,W){var q=this;this.currentFont=I,this.fontBoxes.forEach(function(z){z.style.borderColor=z===W?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},_}(se),ke=function(V){function _(I,W,q){var z=V.call(this,I,W,q)||this;return z.color="transparent",z.padding=5,z.DEFAULT_TEXT="your text here",z.text=z.DEFAULT_TEXT,z.isMoved=!1,z.color=q.defaultColor,z.fontFamily=q.defaultFontFamily,z.defaultSize={x:100,y:30},z.setColor=z.setColor.bind(z),z.setFont=z.setFont.bind(z),z.renderText=z.renderText.bind(z),z.sizeText=z.sizeText.bind(z),z.textEditDivClicked=z.textEditDivClicked.bind(z),z.showTextEditor=z.showTextEditor.bind(z),z.setSize=z.setSize.bind(z),z.positionTextEditor=z.positionTextEditor.bind(z),z.colorPanel=new _e("Color",q.defaultColorSet,q.defaultColor),z.colorPanel.onColorChanged=z.setColor,z.fontFamilyPanel=new De("Font",q.defaultFontFamilies,q.defaultFontFamily),z.fontFamilyPanel.onFontChanged=z.setFont,z}return xe(_,V),_.prototype.ownsTarget=function(I){if(V.prototype.ownsTarget.call(this,I)||I===this.visual||I===this.textElement||I===this.bgRectangle)return!0;var W=!1;return this.textElement.childNodes.forEach(function(q){q===I&&(W=!0)}),W},_.prototype.createVisual=function(){this.visual=de.createGroup(),this.bgRectangle=de.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=de.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(de.createTransform()),this.textElement.transform.baseVal.appendItem(de.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},_.prototype.pointerDown=function(I,W){V.prototype.pointerDown.call(this,I,W),this.isMoved=!1,this.pointerDownPoint=I,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(I),this._state="creating")},_.prototype.renderText=function(){var I=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(W){I.textElement.appendChild(de.createTSpan(W.trim()===""?" ":W.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},_.prototype.getTextScale=function(){var I=this.textElement.getBBox(),W=1;if(I.width>0&&I.height>0){var q=(1*this.width-this.width*this.padding*2/100)/I.width,z=(1*this.height-this.height*this.padding*2/100)/I.height;W=Math.min(q,z)}return W},_.prototype.getTextPosition=function(I){var W=this.textElement.getBBox(),q=0,z=0;return W.width>0&&W.height>0&&(q=(this.width-W.width*I)/2,z=this.height/2-W.height*I/2),{x:q,y:z}},_.prototype.sizeText=function(){var I=this.textElement.getBBox(),W=this.getTextScale(),q=this.getTextPosition(W);q.y-=I.y*W,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+q.x+"px, "+q.y+"px) scale("+W+", "+W+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(q.x,q.y),this.textElement.transform.baseVal.getItem(1).setScale(W,W))},_.prototype.manipulate=function(I){V.prototype.manipulate.call(this,I),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(I.x-this.pointerDownPoint.x)>5||Math.abs(I.y-this.pointerDownPoint.y)>5)},_.prototype.resize=function(I){V.prototype.resize.call(this,I),this.isMoved=!0,this.setSize(),this.sizeText()},_.prototype.setSize=function(){V.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(de.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),de.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},_.prototype.pointerUp=function(I){var W=this.state;W==="creating"&&(this._suppressMarkerCreateEvent=!0),V.prototype.pointerUp.call(this,I),this.setSize(),(W==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},_.prototype.showTextEditor=function(){var I=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(W){W.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var W=Number.parseFloat(I.textEditor.style.fontSize);I.textEditor.clientWidth>=Number.parseInt(I.textEditor.style.maxWidth)&&W>.9;)W-=.1,I.textEditor.style.fontSize=Math.max(W,.9)+"em"}),this.textEditor.addEventListener("keyup",function(W){W.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(W){if(W.clipboardData){var q=W.clipboardData.getData("text"),z=window.getSelection();if(!z.rangeCount)return!1;z.deleteFromDocument(),z.getRangeAt(0).insertNode(document.createTextNode(q)),W.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){I.textEditDivClicked(I.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},_.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var I=this.getTextScale(),W=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),q=this.textElement.getBBox(),z={x:q.width*I,y:q.height*I};W.x-=z.x/2,W.y-=z.y/2,this.textEditor.style.top=W.y+"px",this.textEditor.style.left=W.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-W.x+"px",this.textEditor.style.fontSize=Math.max(16*I,12)+"px",this.textElement.style.display="none"}},_.prototype.textEditDivClicked=function(I){this.text=I.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},_.prototype.select=function(){V.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},_.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),V.prototype.deselect.call(this)},_.prototype.dblClick=function(I,W){V.prototype.dblClick.call(this,I,W),this.showTextEditor()},_.prototype.setColor=function(I){this.textElement&&de.setAttributes(this.textElement,[["fill",I]]),this.color=I,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(I)},_.prototype.setFont=function(I){this.textElement&&de.setAttributes(this.textElement,[["font-family",I]]),this.fontFamily=I,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},_.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},_.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var I=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},V.prototype.getState.call(this));return I.typeName=_.typeName,I},_.prototype.restoreState=function(I){var W=I;this.color=W.color,this.fontFamily=W.fontFamily,this.padding=W.padding,this.text=W.text,this.createVisual(),V.prototype.restoreState.call(this,I),this.setSize()},_.prototype.scale=function(I,W){V.prototype.scale.call(this,I,W),this.setSize(),this.sizeText(),this.positionTextEditor()},_.typeName="TextMarker",_.title="Text marker",_.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>',_}(Ue),ve=function(V){function _(I,W,q){var z=V.call(this,I,W,q)||this;return z.color="transparent",z.lineWidth=3,z.drawing=!1,z.pixelRatio=1,z.color=q.defaultColor,z.lineWidth=q.defaultStrokeWidth,z.pixelRatio=q.freehandPixelRatio,z.setColor=z.setColor.bind(z),z.addCanvas=z.addCanvas.bind(z),z.finishCreation=z.finishCreation.bind(z),z.setLineWidth=z.setLineWidth.bind(z),z.colorPanel=new _e("Color",q.defaultColorSet,q.defaultColor),z.colorPanel.onColorChanged=z.setColor,z.lineWidthPanel=new $e("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),z.lineWidthPanel.onWidthChanged=z.setLineWidth,z}return xe(_,V),_.prototype.ownsTarget=function(I){return!(!V.prototype.ownsTarget.call(this,I)&&I!==this.visual&&I!==this.drawingImage)},_.prototype.createVisual=function(){this.visual=de.createGroup(),this.drawingImage=de.createImage(),this.visual.appendChild(this.drawingImage);var I=de.createTransform();this.visual.transform.baseVal.appendItem(I),this.addMarkerVisualToContainer(this.visual)},_.prototype.pointerDown=function(I,W){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(I.x,I.y),this.drawing=!0):V.prototype.pointerDown.call(this,I,W)},_.prototype.manipulate=function(I){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(I.x,I.y),this.canvasContext.stroke()):V.prototype.manipulate.call(this,I)},_.prototype.resize=function(I){V.prototype.resize.call(this,I),de.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),de.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},_.prototype.pointerUp=function(I){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):V.prototype.pointerUp.call(this,I)},_.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)},_.prototype.select=function(){this.state==="creating"&&this.finishCreation(),V.prototype.select.call(this)},_.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),V.prototype.deselect.call(this)},_.prototype.finishCreation=function(){for(var I=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),W=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],q=W[0],z=W[1],ge=W[2],He=W[3],it=!1,gt=0;gt<this.canvasElement.height;gt++)for(var Ge=0;Ge<this.canvasElement.width;Ge++)I.data[gt*this.canvasElement.width*4+4*Ge+3]>0&&(it=!0,gt<z&&(z=gt),Ge<q&&(q=Ge),gt>He&&(He=gt),Ge>ge&&(ge=Ge));if(it){this.left=q/this.pixelRatio,this.top=z/this.pixelRatio,this.width=(ge-q)/this.pixelRatio,this.height=(He-z)/this.pixelRatio;var wt=document.createElement("canvas");wt.width=ge-q,wt.height=He-z,wt.getContext("2d").putImageData(this.canvasContext.getImageData(q,z,ge-q,He-z),0,0),this.drawingImgUrl=wt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},_.prototype.setDrawingImage=function(){de.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),de.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},_.prototype.setColor=function(I){this.color=I,this.colorChanged(I)},_.prototype.setLineWidth=function(I){this.lineWidth=I},Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var I=Object.assign({drawingImgUrl:this.drawingImgUrl},V.prototype.getState.call(this));return I.typeName=_.typeName,I},_.prototype.restoreState=function(I){this.createVisual(),V.prototype.restoreState.call(this,I),this.drawingImgUrl=I.drawingImgUrl,this.setDrawingImage()},_.prototype.scale=function(I,W){V.prototype.scale.call(this,I,W),this.setDrawingImage()},_.typeName="FreehandMarker",_.title="Freehand marker",_.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>',_}(Ue),ce=function(V){function _(I,W,q){var z=V.call(this,I,q||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return z.typeBoxes=[],z.currentType=W,z.setCurrentType=z.setCurrentType.bind(z),z}return xe(_,V),_.prototype.getUi=function(){var I=this,W=document.createElement("div");W.style.display="flex",W.style.overflow="hidden",W.style.flexGrow="2";for(var q=function(He){var it="both";switch(He){case 0:it="both";break;case 1:it="start";break;case 2:it="end";break;case 3:it="none"}var gt=document.createElement("div");if(gt.style.display="flex",gt.style.flexGrow="2",gt.style.alignItems="center",gt.style.justifyContent="space-between",gt.style.padding="5px",gt.style.borderWidth="2px",gt.style.borderStyle="solid",gt.style.borderColor=it===z.currentType?z.uiStyleSettings.toolboxAccentColor:"transparent",gt.addEventListener("click",function(){I.setCurrentType(it,gt)}),W.appendChild(gt),it==="both"||it==="start"){var Ge=document.createElement("div");Ge.style.display="flex",Ge.style.alignItems="center",Ge.style.minHeight="20px",Ge.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="`+(z.uiStyleSettings!==void 0?z.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,Ge.style.marginLeft="5px",gt.appendChild(Ge)}var wt=document.createElement("div");wt.style.display="flex",wt.style.alignItems="center",wt.style.minHeight="20px",wt.style.flexGrow="2";var zt=document.createElement("hr");if(zt.style.minWidth="20px",zt.style.border="0px",zt.style.borderTop="3px solid "+(z.uiStyleSettings!==void 0?z.uiStyleSettings.toolboxColor:"#eeeeee"),zt.style.flexGrow="2",wt.appendChild(zt),gt.appendChild(wt),it==="both"||it==="end"){var en=document.createElement("div");en.style.display="flex",en.style.alignItems="center",en.style.minHeight="20px",en.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="`+(z.uiStyleSettings!==void 0?z.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,en.style.marginRight="5px",gt.appendChild(en)}z.typeBoxes.push(gt)},z=this,ge=0;ge<4;ge++)q(ge);return W},_.prototype.setCurrentType=function(I,W){var q=this;this.currentType=I,this.typeBoxes.forEach(function(z){z.style.borderColor=z===W?q.uiStyleSettings!==void 0?q.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},_}(se),fe=function(V){function _(I,W,q){var z=V.call(this,I,W,q)||this;return z.arrowType="end",z.arrowBaseHeight=10,z.arrowBaseWidth=10,z.getArrowPoints=z.getArrowPoints.bind(z),z.setArrowType=z.setArrowType.bind(z),z.arrowTypePanel=new ce("Arrow type","end"),z.arrowTypePanel.onArrowTypeChanged=z.setArrowType,z}return xe(_,V),_.prototype.ownsTarget=function(I){return!(!V.prototype.ownsTarget.call(this,I)&&I!==this.arrow1&&I!==this.arrow2)},_.prototype.getArrowPoints=function(I,W){var q=this.arrowBaseWidth+2*this.strokeWidth,z=this.arrowBaseHeight+2*this.strokeWidth;return I-q/2+","+(W+z/2)+" "+I+","+(W-z/2)+" "+(I+q/2)+","+(W+z/2)},_.prototype.createTips=function(){this.arrow1=de.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(de.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=de.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(de.createTransform()),this.visual.appendChild(this.arrow2)},_.prototype.pointerDown=function(I,W){V.prototype.pointerDown.call(this,I,W),this.state==="creating"&&this.createTips()},_.prototype.adjustVisual=function(){if(V.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",de.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),de.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var I=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),W=this.arrow1.transform.baseVal.getItem(0);W.setRotate(I,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(W,0);var q=this.arrow2.transform.baseVal.getItem(0);q.setRotate(I+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(q,0)}},_.prototype.setArrowType=function(I){this.arrowType=I,this.adjustVisual(),this.stateChanged()},Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var I=Object.assign({arrowType:this.arrowType},V.prototype.getState.call(this));return I.typeName=_.typeName,I},_.prototype.restoreState=function(I){V.prototype.restoreState.call(this,I);var W=I;this.arrowType=W.arrowType,this.createTips(),this.adjustVisual()},_.typeName="ArrowMarker",_.title="Arrow marker",_.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',_}(at),ie=function(V){function _(I,W,q){var z=V.call(this,I,W,q)||this;return z.fillColor=q.defaultFillColor,z.strokeWidth=0,z.fillPanel=new _e("Color",q.defaultColorSet,q.defaultFillColor),z.fillPanel.onColorChanged=z.setFillColor,z}return xe(_,V),Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var I=V.prototype.getState.call(this);return I.typeName=_.typeName,I},_.typeName="CoverMarker",_.title="Cover marker",_.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',_}(Ve),ne=function(V){function _(I,W,q,z){var ge=V.call(this,I,z||'<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=W,ge.currentOpacity=q,ge.setCurrentOpacity=ge.setCurrentOpacity.bind(ge),ge}return xe(_,V),_.prototype.getUi=function(){var I=this,W=document.createElement("div");return W.style.display="flex",W.style.overflow="hidden",W.style.flexGrow="2",W.style.justifyContent="space-between",this.opacities.forEach(function(q){var z=document.createElement("div");z.style.display="flex",z.style.alignItems="center",z.style.justifyContent="center",z.style.padding="5px",z.style.borderWidth="2px",z.style.borderStyle="solid",z.style.borderColor=q===I.currentOpacity?I.uiStyleSettings.toolboxAccentColor:"transparent",z.addEventListener("click",function(){I.setCurrentOpacity(q,z)}),W.appendChild(z);var ge=document.createElement("div");ge.innerText=100*q+"%",z.appendChild(ge),I.opacityBoxes.push(z)}),W},_.prototype.setCurrentOpacity=function(I,W){var q=this;this.currentOpacity=I,this.opacityBoxes.forEach(function(z){z.style.borderColor=z===W?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},_}(se),oe=function(V){function _(I,W,q){var z=V.call(this,I,W,q)||this;return z.setOpacity=z.setOpacity.bind(z),z.fillColor=q.defaultHighlightColor,z.strokeWidth=0,z.opacity=q.defaultHighlightOpacity,z.fillPanel=new _e("Color",q.defaultColorSet,z.fillColor),z.fillPanel.onColorChanged=z.setFillColor,z.opacityPanel=new ne("Opacity",q.defaultOpacitySteps,z.opacity),z.opacityPanel.onOpacityChanged=z.setOpacity,z}return xe(_,V),_.prototype.setOpacity=function(I){this.opacity=I,this.visual&&de.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var I=V.prototype.getState.call(this);return I.typeName=_.typeName,I},_.typeName="HighlightMarker",_.title="Highlight marker",_.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>',_}(ie),le='<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>',ye=function(V){function _(I,W,q){var z=V.call(this,I,W,q)||this;return z.bgColor="transparent",z.tipPosition={x:0,y:0},z.tipBase1Position={x:0,y:0},z.tipBase2Position={x:0,y:0},z.tipMoving=!1,z.color=q.defaultStrokeColor,z.bgColor=q.defaultFillColor,z.fontFamily=q.defaultFontFamily,z.defaultSize={x:100,y:30},z.setBgColor=z.setBgColor.bind(z),z.getTipPoints=z.getTipPoints.bind(z),z.positionTip=z.positionTip.bind(z),z.setTipPoints=z.setTipPoints.bind(z),z.colorPanel=new _e("Text color",q.defaultColorSet,z.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>'),z.colorPanel.onColorChanged=z.setColor,z.bgColorPanel=new _e("Fill color",q.defaultColorSet,z.bgColor,le),z.bgColorPanel.onColorChanged=z.setBgColor,z.fontFamilyPanel=new De("Font",q.defaultFontFamilies,q.defaultFontFamily),z.fontFamilyPanel.onFontChanged=z.setFont,z.tipGrip=new ze,z.tipGrip.visual.transform.baseVal.appendItem(de.createTransform()),z.controlBox.appendChild(z.tipGrip.visual),z}return xe(_,V),_.prototype.ownsTarget=function(I){return V.prototype.ownsTarget.call(this,I)||this.tipGrip.ownsTarget(I)||this.tip===I},_.prototype.createTip=function(){de.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=de.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},_.prototype.pointerDown=function(I,W){this.state==="new"&&V.prototype.pointerDown.call(this,I,W),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(W)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):V.prototype.pointerDown.call(this,I,W)},_.prototype.pointerUp=function(I){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,V.prototype.pointerUp.call(this,I);else{var W=this.state==="creating";V.prototype.pointerUp.call(this,I),this.setTipPoints(W),this.positionTip()}},_.prototype.manipulate=function(I){if(this.tipMoving){var W=this.unrotatePoint(I);this.tipPosition={x:W.x-this.manipulationStartLeft,y:W.y-this.manipulationStartTop},this.positionTip()}else V.prototype.manipulate.call(this,I)},_.prototype.setBgColor=function(I){this.bgRectangle&&this.tip&&(de.setAttributes(this.bgRectangle,[["fill",I]]),de.setAttributes(this.tip,[["fill",I]])),this.bgColor=I,this.fillColorChanged(I)},_.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},_.prototype.setTipPoints=function(I){I===void 0&&(I=!1);var W=Math.min(this.height/2,15),q=this.height/5;I&&(this.tipPosition={x:W+q/2,y:this.height+20});var z=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?z<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(q=this.width/5,W=Math.min(this.width/2,15),this.tipBase1Position={x:W,y:0},this.tipBase2Position={x:W+q,y:0}):(this.tipBase1Position={x:0,y:W},this.tipBase2Position={x:0,y:W+q}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?z<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(q=this.width/5,W=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-W-q,y:0},this.tipBase2Position={x:this.width-W,y:0}):(this.tipBase1Position={x:this.width,y:W},this.tipBase2Position={x:this.width,y:W+q}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?z<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(q=this.width/5,W=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-W-q,y:this.height},this.tipBase2Position={x:this.width-W,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-W-q},this.tipBase2Position={x:this.width,y:this.height-W}):z<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(q=this.width/5,W=Math.min(this.width/2,15),this.tipBase1Position={x:W,y:this.height},this.tipBase2Position={x:W+q,y:this.height}):(this.tipBase1Position={x:0,y:this.height-W},this.tipBase2Position={x:0,y:this.height-W-q})},_.prototype.resize=function(I){V.prototype.resize.call(this,I),this.positionTip()},_.prototype.positionTip=function(){de.setAttributes(this.tip,[["points",this.getTipPoints()]]);var I=this.tipGrip.visual.transform.baseVal.getItem(0);I.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(I,0)},Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),_.prototype.select=function(){this.positionTip(),V.prototype.select.call(this)},_.prototype.getState=function(){var I=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},V.prototype.getState.call(this));return I.typeName=_.typeName,I},_.prototype.restoreState=function(I){var W=I;this.bgColor=W.bgColor,this.tipPosition=W.tipPosition,V.prototype.restoreState.call(this,I),this.createTip(),this.setTipPoints()},_.prototype.scale=function(I,W){V.prototype.scale.call(this,I,W),this.tipPosition={x:this.tipPosition.x*I,y:this.tipPosition.y*W},this.positionTip()},_.typeName="CalloutMarker",_.title="Callout marker",_.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>',_}(ke),Le=function(V){function _(I,W,q){var z=V.call(this,I,W,q)||this;return z.fillColor="transparent",z.strokeColor="transparent",z.strokeWidth=0,z.strokeDasharray="",z.opacity=1,z.strokeColor=q.defaultColor,z.strokeWidth=q.defaultStrokeWidth,z.strokeDasharray=q.defaultStrokeDasharray,z.fillColor=q.defaultFillColor,z.setStrokeColor=z.setStrokeColor.bind(z),z.setFillColor=z.setFillColor.bind(z),z.setStrokeWidth=z.setStrokeWidth.bind(z),z.setStrokeDasharray=z.setStrokeDasharray.bind(z),z.setOpacity=z.setOpacity.bind(z),z.createVisual=z.createVisual.bind(z),z.strokePanel=new _e("Line color",pe(q.defaultColorSet,["transparent"]),q.defaultColor),z.strokePanel.onColorChanged=z.setStrokeColor,z.fillPanel=new _e("Fill color",pe(q.defaultColorSet,["transparent"]),z.fillColor,le),z.fillPanel.onColorChanged=z.setFillColor,z.strokeWidthPanel=new $e("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),z.strokeWidthPanel.onWidthChanged=z.setStrokeWidth,z.strokeStylePanel=new Xe("Line style",q.defaultStrokeDasharrays,q.defaultStrokeDasharray),z.strokeStylePanel.onStyleChanged=z.setStrokeDasharray,z.opacityPanel=new ne("Opacity",q.defaultOpacitySteps,z.opacity),z.opacityPanel.onOpacityChanged=z.setOpacity,z}return xe(_,V),_.prototype.ownsTarget=function(I){return!(!V.prototype.ownsTarget.call(this,I)&&I!==this.visual)},_.prototype.createVisual=function(){this.visual=de.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)},_.prototype.pointerDown=function(I,W){V.prototype.pointerDown.call(this,I,W),this.state==="new"&&(this.createVisual(),this.moveVisual(I),this._state="creating")},_.prototype.manipulate=function(I){V.prototype.manipulate.call(this,I)},_.prototype.resize=function(I){V.prototype.resize.call(this,I),this.setSize()},_.prototype.setSize=function(){V.prototype.setSize.call(this),de.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},_.prototype.pointerUp=function(I){V.prototype.pointerUp.call(this,I),this.setSize()},_.prototype.setStrokeColor=function(I){this.strokeColor=I,this.visual&&de.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(I),this.stateChanged()},_.prototype.setFillColor=function(I){this.fillColor=I,this.visual&&de.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(I),this.stateChanged()},_.prototype.setStrokeWidth=function(I){this.strokeWidth=I,this.visual&&de.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},_.prototype.setStrokeDasharray=function(I){this.strokeDasharray=I,this.visual&&de.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},_.prototype.setOpacity=function(I){this.opacity=I,this.visual&&de.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var I=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},V.prototype.getState.call(this));return I.typeName=_.typeName,I},_.prototype.restoreState=function(I){var W=I;this.fillColor=W.fillColor,this.strokeColor=W.strokeColor,this.strokeWidth=W.strokeWidth,this.strokeDasharray=W.strokeDasharray,this.opacity=W.opacity,this.createVisual(),V.prototype.restoreState.call(this,I),this.setSize()},_.prototype.scale=function(I,W){V.prototype.scale.call(this,I,W),this.setSize()},_.typeName="EllipseMarker",_.title="Ellipse marker",_.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>',_}(Ue),Ne=function(V){function _(I,W,q){return V.call(this,I,W,q)||this}return xe(_,V),Object.defineProperty(_.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),_.prototype.ownsTarget=function(I){return!(!V.prototype.ownsTarget.call(this,I)&&I!==this.tip1&&I!==this.tip2)},_.prototype.createTips=function(){this.tip1=de.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(de.createTransform()),this.visual.appendChild(this.tip1),this.tip2=de.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(de.createTransform()),this.visual.appendChild(this.tip2)},_.prototype.pointerDown=function(I,W){V.prototype.pointerDown.call(this,I,W),this.state==="creating"&&this.createTips()},_.prototype.adjustVisual=function(){if(V.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(de.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()]]),de.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 I=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),W=this.tip1.transform.baseVal.getItem(0);W.setRotate(I,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(W,0);var q=this.tip2.transform.baseVal.getItem(0);q.setRotate(I+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(q,0)}},Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var I=V.prototype.getState.call(this);return I.typeName=_.typeName,I},_.prototype.restoreState=function(I){V.prototype.restoreState.call(this,I),this.createTips(),this.adjustVisual()},_.typeName="MeasurementMarker",_.title="Measurement marker",_.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>',_}(at),Je=function(V){function _(I,W,q){var z=V.call(this,I,W,q)||this;return z.strokePanel.colors=q.defaultColorSet,z.fillColor="transparent",z}return xe(_,V),Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var I=V.prototype.getState.call(this);return I.typeName=_.typeName,I},_.typeName="EllipseFrameMarker",_.title="Ellipse frame marker",_.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>',_}(Le),mt=function(){function V(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(V.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),V.prototype.addUndoStep=function(_){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(_)||(this.undoStack.push(_),JSON.stringify(this.lastRedoStep)!==JSON.stringify(_)&&this.redoStack.splice(0,this.redoStack.length))},V.prototype.replaceLastUndoStep=function(_){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=_)},V.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},V.prototype.undo=function(){if(this.undoStack.length>1){var _=this.undoStack.pop();return _!==void 0&&this.redoStack.push(_),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},V.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},V}(),ft=function(V){function _(I,W,q){var z=V.call(this,I,W,q)||this;return z.strokeColor="transparent",z.strokeWidth=0,z.strokeDasharray="",z.curveX=0,z.curveY=0,z.manipulationStartCurveX=0,z.manipulationStartCurveY=0,z.setStrokeColor=z.setStrokeColor.bind(z),z.setStrokeWidth=z.setStrokeWidth.bind(z),z.setStrokeDasharray=z.setStrokeDasharray.bind(z),z.positionGrips=z.positionGrips.bind(z),z.addControlGrips=z.addControlGrips.bind(z),z.adjustVisual=z.adjustVisual.bind(z),z.setupControlBox=z.setupControlBox.bind(z),z.resize=z.resize.bind(z),z.strokeColor=q.defaultColor,z.strokeWidth=q.defaultStrokeWidth,z.strokeDasharray=q.defaultStrokeDasharray,z.strokePanel=new _e("Line color",q.defaultColorSet,q.defaultColor),z.strokePanel.onColorChanged=z.setStrokeColor,z.strokeWidthPanel=new $e("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),z.strokeWidthPanel.onWidthChanged=z.setStrokeWidth,z.strokeStylePanel=new Xe("Line style",q.defaultStrokeDasharrays,q.defaultStrokeDasharray),z.strokeStylePanel.onStyleChanged=z.setStrokeDasharray,z}return xe(_,V),_.prototype.ownsTarget=function(I){return!(!V.prototype.ownsTarget.call(this,I)&&I!==this.visual&&I!==this.selectorCurve&&I!==this.visibleCurve&&!this.curveGrip.ownsTarget(I))},_.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},_.prototype.createVisual=function(){this.visual=de.createGroup(),this.selectorCurve=de.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=de.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)},_.prototype.pointerDown=function(I,W){V.prototype.pointerDown.call(this,I,W),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=I.x,this.curveY=I.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(W)&&(this.activeGrip=this.curveGrip,this._state="resize")},_.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),de.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),de.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),de.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},_.prototype.setupControlBox=function(){V.prototype.setupControlBox.call(this),this.curveControlLine1=de.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=de.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)},_.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,V.prototype.addControlGrips.call(this)},_.prototype.positionGrips=function(){V.prototype.positionGrips.call(this);var I=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-I/2,this.curveY-I/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()))},_.prototype.manipulate=function(I){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+I.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+I.y-this.manipulationStartY),V.prototype.manipulate.call(this,I)},_.prototype.resize=function(I){this.activeGrip===this.curveGrip&&(this.curveX=I.x,this.curveY=I.y),V.prototype.resize.call(this,I),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},_.prototype.setStrokeColor=function(I){this.strokeColor=I,this.adjustVisual(),this.colorChanged(I)},_.prototype.setStrokeWidth=function(I){this.strokeWidth=I,this.adjustVisual()},_.prototype.setStrokeDasharray=function(I){this.strokeDasharray=I,this.adjustVisual()},_.prototype.scale=function(I,W){this.curveX=this.curveX*I,this.curveY=this.curveY*W,V.prototype.scale.call(this,I,W)},Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var I=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},V.prototype.getState.call(this));return I.typeName=_.typeName,I},_.prototype.restoreState=function(I){V.prototype.restoreState.call(this,I);var W=I;this.strokeColor=W.strokeColor,this.strokeWidth=W.strokeWidth,this.strokeDasharray=W.strokeDasharray,this.curveX=W.curveX,this.curveY=W.curveY,this.createVisual(),this.adjustVisual()},_.typeName="CurveMarker",_.title="Curve marker",_.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>',_}(nt),Ct=function(){function V(_,I){I===void 0&&(I=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=_,this.cancelable=I}return Object.defineProperty(V.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),V.prototype.preventDefault=function(){this._defaultPrevented=!0},V}(),xt=function(V){function _(I,W,q){var z=V.call(this,I,!1)||this;return z.dataUrl=W,z.state=q,z}return xe(_,V),_}(Ct),Qe=function(V){function _(I,W,q){q===void 0&&(q=!1);var z=V.call(this,I,q)||this;return z.marker=W,z}return xe(_,V),_}(Ct),Lt=function(){function V(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return V.prototype.addEventListener=function(_,I){this[_].push(I)},V.prototype.removeEventListener=function(_,I){var W=this[_].indexOf(I);W>-1&&this[_].splice(W,1)},V}(),vt=function(){function V(_){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Ie,this._isOpen=!1,this.undoRedoManager=new mt,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 Lt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=V.instanceCounter++,this.styles=new rt(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=_,this.targetRoot=document.body,this.width=_.clientWidth,this.height=_.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(V.prototype,"ALL_MARKER_TYPES",{get:function(){return[et,ve,fe,ke,Je,Le,oe,ye,Ne,ie,at,ft]},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[et,ve,fe,ke,Le,oe,ye]},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"BASIC_MARKER_TYPES",{get:function(){return[et,ve,fe,ke,oe]},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(_){var I=this;this._availableMarkerTypes.splice(0),_.forEach(function(W){if(typeof W=="string"){var q=I.ALL_MARKER_TYPES.find(function(z){return z.typeName===W});q!==void 0&&I._availableMarkerTypes.push(q)}else I._availableMarkerTypes.push(W)})},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(_){this._zoomLevel=_,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),V.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),Me.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},V.prototype.show=function(){var _=this;this.styles.styleSheetRoot===void 0&&We.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=We.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(I){return I(new Ct(_))})},V.prototype.render=function(){return Ce(this,void 0,void 0,function(){var _;return Oe(this,function(I){switch(I.label){case 0:return this.setCurrentMarker(),(_=new tt).naturalSize=this.renderAtNaturalSize,_.imageType=this.renderImageType,_.imageQuality=this.renderImageQuality,_.markersOnly=this.renderMarkersOnly,_.width=this.renderWidth,_.height=this.renderHeight,[4,_.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return I.sent(),[4,_.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,I.sent()]}})})},V.prototype.close=function(_){var I=this;if(_===void 0&&(_=!1),this.isOpen){var W=!1;_||this.eventListeners.beforeclose.forEach(function(q){var z=new Ct(I,!0);q(z),z.defaultPrevented&&(W=!0)}),W||(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(q){return q(new Ct(I))}),this.detachEvents(),this._isOpen=!1)}},V.prototype.addMarkersToToolbar=function(){for(var _,I=[],W=0;W<arguments.length;W++)I[W]=arguments[W];(_=this._availableMarkerTypes).push.apply(_,I)},V.prototype.addRenderEventListener=function(_){this.addEventListener("render",function(I){_(I.dataUrl,I.state)})},V.prototype.removeRenderEventListener=function(_){},V.prototype.addCloseEventListener=function(_){this.addEventListener("close",function(){_()})},V.prototype.removeCloseEventListener=function(_){},V.prototype.setupResizeObserver=function(){var _=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){_.resize(_.target.clientWidth,_.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return _.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},V.prototype.onPopupTargetResize=function(){var _=1*this.target.clientWidth/this.target.clientHeight,I=this.editorCanvas.clientWidth/_>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*_:this.editorCanvas.clientWidth,W=I<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/_;this.resize(I,W)},V.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},V.prototype.resize=function(_,I){this._isResizing=!0;var W=_/this.imageWidth,q=I/this.imageHeight;this.imageWidth=Math.round(_),this.imageHeight=Math.round(I),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(W,q),this._isResizing=!1},V.prototype.scaleMarkers=function(_,I){var W,q=this;this._currentMarker&&this._currentMarker instanceof ke?this._currentMarker.scale(_,I):(W=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(z){z!==q._currentMarker&&z.scale(_,I)}),W!==void 0&&this.setCurrentMarker(W)},V.prototype.setEditingTarget=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px"},V.prototype.setTopLeft=function(){var _=this.editingTarget.getBoundingClientRect(),I=this.editorCanvas.getBoundingClientRect();this.left=_.left-I.left,this.top=_.top-I.top},V.prototype.initMarkerCanvas=function(){this.markerImageHolder=document.createElement("div"),this.markerImageHolder.style.setProperty("touch-action","pinch-zoom"),this.markerImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.markerImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImage.style.pointerEvents="auto",this.markerImageHolder.style.position="absolute",this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.markerImageHolder.style.transformOrigin="top left",this.positionMarkerImage(),this.markerImageHolder.appendChild(this.markerImage),this.editorCanvas.appendChild(this.markerImageHolder)},V.prototype.addDefs=function(){for(var _,I=[],W=0;W<arguments.length;W++)I[W]=arguments[W];this.defs=de.createDefs(),this.addDefsToImage(),(_=this.defs).append.apply(_,I)},V.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},V.prototype.initOverlay=function(){this.overlayContainer=document.createElement("div"),this.overlayContainer.style.position="absolute",this.overlayContainer.style.left="0px",this.overlayContainer.style.top="0px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.overlayContainer.style.display="flex",this.markerImageHolder.appendChild(this.overlayContainer)},V.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},V.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},V.prototype.attachWindowEvents=function(){window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("pointerout",this.onPointerOut),window.addEventListener("pointerleave",this.onPointerUp),window.addEventListener("resize",this.onWindowResize),window.addEventListener("keyup",this.onKeyUp)},V.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},V.prototype.detachWindowEvents=function(){window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("pointerout",this.onPointerOut),window.removeEventListener("pointerleave",this.onPointerUp),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("keyup",this.onKeyUp)},V.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var _=document.createElement("a");_.href="https://markerjs.com/",_.target="_blank",_.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>',_.title="Powered by marker.js",_.style.display="grid",_.style.alignItems="center",_.style.justifyItems="center",_.style.padding="3px",_.style.width="20px",_.style.height="20px",this.logoUI.appendChild(_),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},V.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},V.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},V.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},V.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var _=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=_+"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 je(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 Ze(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},V.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},V.prototype.removeMarker=function(_){this.markerImage.removeChild(_.container),this.markers.indexOf(_)>-1&&this.markers.splice(this.markers.indexOf(_),1),_.dispose()},V.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},V.prototype.toolbarButtonClicked=function(_,I){if(_==="marker"&&I!==void 0)this.createNewMarker(I);else if(_==="action")switch(I){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},V.prototype.deleteSelectedMarker=function(){var _=this;if(this._currentMarker!==void 0){var I=!1;if(this.eventListeners.markerbeforedelete.forEach(function(q){var z=new Qe(_,_._currentMarker,!0);q(z),z.defaultPrevented&&(I=!0)}),!I){var W=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(q){return q(new Qe(_,W))})}}},V.prototype.clear=function(){var _=this,I=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(ge){var He=new Qe(_,void 0,!0);ge(He),He.defaultPrevented&&(I=!0)}),!I)){this.setCurrentMarker();for(var W=function(ge){var He=q.markers[ge];q.setCurrentMarker(q.markers[ge]),q._currentMarker.dispose(),q.markerImage.removeChild(q._currentMarker.container),q.markers.splice(q.markers.indexOf(q._currentMarker),1),q.eventListeners.markerdelete.forEach(function(it){return it(new Qe(_,He))})},q=this,z=this.markers.length-1;z>=0;z--)W(z);this.addUndoStep()}},Object.defineProperty(V.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),V.prototype.showNotesEditor=function(){var _;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=(_=this._currentMarker.notes)!==null&&_!==void 0?_:"",this.overlayContainer.appendChild(this.notesArea))},V.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},V.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},V.prototype.addUndoStep=function(){var _=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var I=this.getState(),W=this.undoRedoManager.getLastUndoStep();if(!W||W.width===I.width&&W.height===I.height){var q=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(I),q<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(z){return z(new Ct(_))})}else this.undoRedoManager.replaceLastUndoStep(I),this.eventListeners.statechange.forEach(function(z){return z(new Ct(_))})}},V.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},V.prototype.undoStep=function(){var _=this,I=this.undoRedoManager.undo();I!==void 0&&(this.restoreState(I),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(W){return W(new Ct(_))}))},V.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},V.prototype.redoStep=function(){var _=this,I=this.undoRedoManager.redo();I!==void 0&&(this.restoreState(I),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(W){return W(new Ct(_))}))},V.prototype.stepZoom=function(){var _=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=_<this.zoomSteps.length-1?this.zoomSteps[_+1]:this.zoomSteps[0]},V.prototype.panTo=function(_){this.contentDiv.scrollBy({left:this.prevPanPoint.x-_.x,top:this.prevPanPoint.y-_.y}),this.prevPanPoint=_},V.prototype.startRenderAndClose=function(){return Ce(this,void 0,void 0,function(){var _,I,W=this;return Oe(this,function(q){switch(q.label){case 0:return[4,this.render()];case 1:return _=q.sent(),I=this.getState(),this.eventListeners.render.forEach(function(z){return z(new xt(W,_,I))}),this.close(!0),[2]}})})},V.prototype.getState=function(_){_===!0&&this.setCurrentMarker();var I={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(W){return I.markers.push(W.getState())}),I},V.prototype.restoreState=function(_){var I=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);_.markers.forEach(function(W){var q=I._availableMarkerTypes.find(function(ge){return ge.typeName===W.typeName});if(q!==void 0){var z=I.addNewMarker(q);z.restoreState(W),I.markers.push(z)}}),_.width&&_.height&&(_.width!==this.imageWidth||_.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/_.width,this.imageHeight/_.height),this.eventListeners.restorestate.forEach(function(W){return W(new Ct(I))})},V.prototype.addNewMarker=function(_){var I=de.createGroup();return this.markerImage.appendChild(I),new _(I,this.overlayContainer,this.settings)},V.prototype.createNewMarker=function(_){var I,W=this;(I=typeof _=="string"?this._availableMarkerTypes.find(function(q){return q.typeName===_}):_)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(I),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(I.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(q){return q(new Qe(W,W._currentMarker))}))},V.prototype.markerCreated=function(_){var I=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(_),this.setCurrentMarker(_),_ instanceof ve&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(ve):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(W){return W(new Qe(I,I._currentMarker))})},V.prototype.colorChanged=function(_){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=_,this.settings.defaultStrokeColor=_)},V.prototype.fillColorChanged=function(_){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=_)},V.prototype.markerStateChanged=function(_){var I=this;this.eventListeners.markerchange.forEach(function(W){return W(new Qe(I,_))})},V.prototype.setCurrentMarker=function(_){var I=this;this._currentMarker!==_&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(W){return W(new Qe(I,I._currentMarker))})),this._currentMarker=_,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(W){return W(new Qe(I,I._currentMarker))}))},V.prototype.onPointerDown=function(_){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||_.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var I=this.markers.find(function(W){return W.ownsTarget(_.target)});I!==void 0?(this.setCurrentMarker(I),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(_.clientX,_.clientY),_.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:_.clientX,y:_.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(_.clientX,_.clientY))},V.prototype.onDblClick=function(_){if(this._isFocused||this.focus(),this.mode==="select"){var I=this.markers.find(function(W){return W.ownsTarget(_.target)});I!==void 0&&I!==this._currentMarker&&this.setCurrentMarker(I),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(_.clientX,_.clientY),_.target):this.setCurrentMarker()}},V.prototype.onPointerMove=function(_){this.touchPoints!==1&&_.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||_.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(_.clientX,_.clientY)):this.zoomLevel>1&&this.panTo({x:_.clientX,y:_.clientY}))},V.prototype.onPointerUp=function(_){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(_.clientX,_.clientY)),this.isDragging=!1,this.addUndoStep()},V.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},V.prototype.onKeyUp=function(_){this._currentMarker===void 0||this.notesArea!==void 0||_.key!=="Delete"&&_.key!=="Backspace"||this.deleteSelectedMarker()},V.prototype.clientToLocalCoordinates=function(_,I){var W=this.markerImage.getBoundingClientRect();return{x:(_-W.left)/this.zoomLevel,y:(I-W.top)/this.zoomLevel}},V.prototype.onWindowResize=function(){this.positionUI()},V.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var _=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=_+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},V.prototype.addLicenseKey=function(_){Me.addKey(_)},V.prototype.addEventListener=function(_,I){this.eventListeners.addEventListener(_,I)},V.prototype.removeEventListener=function(_,I){this.eventListeners.removeEventListener(_,I)},V.prototype.renderState=function(_){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(_),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(V.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),V.prototype.focus=function(){var _=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(I){return I(new Ct(_))}))},V.prototype.blur=function(){var _=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(I){return I(new Ct(_))}))},V.instanceCounter=0,V}();/* **********************************
|
|
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 Ft=function(V,_){return(Ft=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(I,W){I.__proto__=W}||function(I,W){for(var q in W)Object.prototype.hasOwnProperty.call(W,q)&&(I[q]=W[q])})(V,_)};function Pt(V,_){if(typeof _!="function"&&_!==null)throw new TypeError("Class extends value "+String(_)+" is not a constructor or null");function I(){this.constructor=V}Ft(V,_),V.prototype=_===null?Object.create(_):(I.prototype=_.prototype,new I)}function Rt(V,_,I,W){return new(I||(I=Promise))(function(q,z){function ge(gt){try{it(W.next(gt))}catch(Ge){z(Ge)}}function He(gt){try{it(W.throw(gt))}catch(Ge){z(Ge)}}function it(gt){var Ge;gt.done?q(gt.value):(Ge=gt.value,Ge instanceof I?Ge:new I(function(wt){wt(Ge)})).then(ge,He)}it((W=W.apply(V,_||[])).next())})}function mn(V,_){var I,W,q,z,ge={label:0,sent:function(){if(1&q[0])throw q[1];return q[1]},trys:[],ops:[]};return z={next:He(0),throw:He(1),return:He(2)},typeof Symbol=="function"&&(z[Symbol.iterator]=function(){return this}),z;function He(it){return function(gt){return function(Ge){if(I)throw new TypeError("Generator is already executing.");for(;ge;)try{if(I=1,W&&(q=2&Ge[0]?W.return:Ge[0]?W.throw||((q=W.return)&&q.call(W),0):W.next)&&!(q=q.call(W,Ge[1])).done)return q;switch(W=0,q&&(Ge=[2&Ge[0],q.value]),Ge[0]){case 0:case 1:q=Ge;break;case 4:return ge.label++,{value:Ge[1],done:!1};case 5:ge.label++,W=Ge[1],Ge=[0];continue;case 7:Ge=ge.ops.pop(),ge.trys.pop();continue;default:if(!(q=ge.trys,(q=q.length>0&&q[q.length-1])||Ge[0]!==6&&Ge[0]!==2)){ge=0;continue}if(Ge[0]===3&&(!q||Ge[1]>q[0]&&Ge[1]<q[3])){ge.label=Ge[1];break}if(Ge[0]===6&&ge.label<q[1]){ge.label=q[1],q=Ge;break}if(q&&ge.label<q[2]){ge.label=q[2],ge.ops.push(Ge);break}q[2]&&ge.ops.pop(),ge.trys.pop();continue}Ge=_.call(V,ge)}catch(wt){Ge=[6,wt],W=0}finally{I=q=0}if(5&Ge[0])throw Ge[1];return{value:Ge[0]?Ge[1]:void 0,done:!0}}([it,gt])}}}var sn=function(){function V(){}return V.addKey=function(_){V.key=_},Object.defineProperty(V,"isLicensed",{get:function(){return!!V.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(V.key)},enumerable:!1,configurable:!0}),V}(),bt=function(){function V(){}return V.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},V.setAttributes=function(_,I){for(var W=0,q=I;W<q.length;W++){var z=q[W],ge=z[0],He=z[1];_.setAttribute(ge,He)}},V.createRect=function(_,I,W){var q=document.createElementNS("http://www.w3.org/2000/svg","rect");return q.setAttribute("width",_.toString()),q.setAttribute("height",I.toString()),W&&V.setAttributes(q,W),q},V.createLine=function(_,I,W,q,z){var ge=document.createElementNS("http://www.w3.org/2000/svg","line");return ge.setAttribute("x1",_.toString()),ge.setAttribute("y1",I.toString()),ge.setAttribute("x2",W.toString()),ge.setAttribute("y2",q.toString()),z&&V.setAttributes(ge,z),ge},V.createPolygon=function(_,I){var W=document.createElementNS("http://www.w3.org/2000/svg","polygon");return W.setAttribute("points",_),I&&V.setAttributes(W,I),W},V.createCircle=function(_,I){var W=document.createElementNS("http://www.w3.org/2000/svg","circle");return W.setAttribute("cx",(_/2).toString()),W.setAttribute("cy",(_/2).toString()),W.setAttribute("r",_.toString()),I&&V.setAttributes(W,I),W},V.createEllipse=function(_,I,W){var q=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return q.setAttribute("cx",(_/2).toString()),q.setAttribute("cy",(I/2).toString()),q.setAttribute("rx",(_/2).toString()),q.setAttribute("ry",(I/2).toString()),W&&V.setAttributes(q,W),q},V.createGroup=function(_){var I=document.createElementNS("http://www.w3.org/2000/svg","g");return _&&V.setAttributes(I,_),I},V.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},V.createMarker=function(_,I,W,q,z,ge,He){var it=document.createElementNS("http://www.w3.org/2000/svg","marker");return V.setAttributes(it,[["id",_],["orient",I],["markerWidth",W.toString()],["markerHeight",q.toString()],["refX",z.toString()],["refY",ge.toString()]]),it.appendChild(He),it},V.createText=function(_){var I=document.createElementNS("http://www.w3.org/2000/svg","text");return I.setAttribute("x","0"),I.setAttribute("y","0"),_&&V.setAttributes(I,_),I},V.createTSpan=function(_,I){var W=document.createElementNS("http://www.w3.org/2000/svg","tspan");return W.textContent=_,I&&V.setAttributes(W,I),W},V.createImage=function(_){var I=document.createElementNS("http://www.w3.org/2000/svg","image");return _&&V.setAttributes(I,_),I},V.createPoint=function(_,I){var W=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return W.x=_,W.y=I,W},V.createPath=function(_,I){var W=document.createElementNS("http://www.w3.org/2000/svg","path");return W.setAttribute("d",_),I&&V.setAttributes(W,I),W},V.createElement=function(_,I){var W=document.createElementNS("http://www.w3.org/2000/svg",_);return I&&V.setAttributes(W,I),W},V.getHollowRectanglePath=function(_,I,W,q,z,ge,He,it){return"M"+_+","+I+"V"+(I+q)+"H"+(_+W)+"V"+I+"H"+z+"V"+ge+"H"+(z+He)+"V"+(ge+it)+"H"+z+"V"+I+"Z"},V}(),tn=function(){function V(_){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+_+"_"}return Object.defineProperty(V.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#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(V.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),V.prototype.addClass=function(_){return this.styleSheet===void 0&&this.addStyleSheet(),_.name=""+this.classNamePrefix+_.localName,this.classes.push(_),this.styleSheet.sheet.insertRule("."+_.name+" {"+_.style+"}",this.styleSheet.sheet.cssRules.length),_},V.prototype.addRule=function(_){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(_),this.styleSheet.sheet.insertRule(_.selector+" {"+_.style+"}",this.styleSheet.sheet.cssRules.length)},V.prototype.addStyleSheet=function(){var _;this.styleSheet=document.createElement("style"),((_=this.styleSheetRoot)!==null&&_!==void 0?_:document.head).appendChild(this.styleSheet),this.addRule(new _t("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new _t("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new _t("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new Tt("_fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new Tt("_fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},V.prototype.removeStyleSheet=function(){var _;this.styleSheet&&(((_=this.styleSheetRoot)!==null&&_!==void 0?_:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},V}(),_t=function(V,_){this.selector=V,this.style=_},Tt=function(V,_){this.localName=V,this.style=_},Wt=function(){function V(){this.blocks=[],this.display=""}return V.prototype.addButtonBlock=function(_){_.className=this.blockClassName,_.buttonClassName=this.buttonClassName,_.buttonColorsClassName=this.buttonColorsClassName,_.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(_)},V.prototype.addElementBlock=function(_){_.className===void 0&&(_.className=this.blockClassName),this.blocks.push(_)},V.prototype.getUI=function(){var _=document.createElement("div");return _.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,_.style.display=this.display,this.blocks.forEach(function(I){return _.appendChild(I.getUI())}),_},V}(),nn=function(){function V(){}return V.prototype.getUI=function(){var _=document.createElement("div");if(_.className=this.className,this.minWidth!==void 0&&(_.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":_.style.justifyContent="flex-start";break;case"center":_.style.justifyContent="center";break;case"end":_.style.justifyContent="flex-end"}return _.style.whiteSpace="nowrap",_},V}(),hn=function(V){function _(){var I=V!==null&&V.apply(this,arguments)||this;return I.buttons=[],I}return Pt(_,V),_.prototype.addButton=function(I){I.className=this.buttonClassName,I.colorsClassName=this.buttonColorsClassName,I.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(I)},_.prototype.getUI=function(){var I=V.prototype.getUI.call(this);return this.buttons.forEach(function(W){return I.appendChild(W.getUI())}),I},_}(nn),dt=function(){function V(_,I){this._isActive=!1,this._isHidden=!1,this._icon=_,this.title=I,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(V.prototype,"icon",{get:function(){return this._icon},set:function(_){this._icon=_,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"isActive",{get:function(){return this._isActive},set:function(_){this._isActive=_,this.adjustClassName()},enumerable:!1,configurable:!0}),V.prototype.getUI=function(){var _=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 _.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},V.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,"")))},V.prototype.hide=function(){this._isHidden=!0},V}(),ut=function(V){function _(){var I=V!==null&&V.apply(this,arguments)||this;return I.elements=[],I}return Pt(_,V),_.prototype.addElement=function(I){this.elements.push(I)},_.prototype.getUI=function(){var I=V.prototype.getUI.call(this);return this.elements.forEach(function(W){return I.appendChild(W)}),I},_}(nn),qt=function(){function V(_,I){this.horizontal=_,this.vertical=I}return Object.defineProperty(V.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),V.prototype.getVerticalLength=function(_){return _/this.ratio},V.prototype.getHorizontalLength=function(_){return _*this.ratio},V}(),Ot=function(){function V(){}return V.getIcon=function(_,I){if(_>0&&I>0){var W=new qt(_,I),q=W.ratio>=1?20:W.getHorizontalLength(20),z=W.ratio<1?20:W.getVerticalLength(20),ge=document.createElementNS("http://www.w3.org/2000/svg","svg");ge.setAttribute("xmlns","http://www.w3.org/2000/svg"),ge.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(ge);var He=bt.createDefs();ge.appendChild(He);var it=bt.createElement("clipPath",[["id","text-bg-clip"]]);He.appendChild(it);var gt=bt.createPath(bt.getHollowRectanglePath((24-q)/2,(24-z)/2,q,z,(24-q)/2+2,(24-z)/2+2,q-4,z-4));ge.appendChild(gt);var Ge=bt.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Ge.appendChild(bt.createTSpan(_+":"+I)),ge.appendChild(Ge);var wt=Ge.getBBox();bt.setAttributes(Ge,[["x",((24-wt.width)/2).toString()],["y",((24-wt.height)/2-wt.y).toString()]]);var zt=bt.createPath(bt.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(wt.width))/2,(24-Math.ceil(wt.height))/2,Math.ceil(wt.width),Math.ceil(wt.height)));return it.appendChild(zt),bt.setAttributes(gt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(ge),ge.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>'},V}(),Mt=function(V){function _(I,W,q){var z=V.call(this,I,W)||this;return z.isDropdownOpen=!1,z.onClick=z.dropdownButtonClicked,z.dropdownButtons=q,z}return Pt(_,V),_.prototype.setupDropdown=function(){var I=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(W){W.className=I.className,W.colorsClassName=I.colorsClassName,I.dropdownBlock.appendChild(W.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},_.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},_.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},_.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},_.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},_.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},_}(dt),Dt=function(){function V(_,I){this.GRIP_SIZE=10,this.color=_,this.fillColor=I,this.visual=bt.createGroup(),this.visual.appendChild(bt.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(bt.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return V.prototype.ownsTarget=function(_){return _===this.visual||_===this.visual.childNodes[0]||_===this.visual.childNodes[1]},V.prototype.setCenter=function(_,I){this.visual.childNodes.forEach(function(W){return bt.setAttributes(W,[["cx",_.toString()],["cy",I.toString()]])})},V}(),Ut=function(){function V(_,I,W,q){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=_,this.canvasHeight=I,this.margin=W,this.container=q,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(V.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(_){this._aspectRatio=_,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(_){this._isGridVisible=_,this.gridContainer&&bt.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(_){this._zoomFactor=_,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),V.prototype.open=function(){var _=this;this.cropShadeElement=bt.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=bt.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var I=0;I<this.numberOfGridLines;I++)this.horizontalGridLines.push(bt.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(bt.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(W){return _.gridContainer.appendChild(W)}),this.verticalGridLines.forEach(function(W){return _.gridContainer.appendChild(W)}),this.cropRectElement=bt.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()},V.prototype.setCropRectangle=function(_){this.cropRect=_;var I=Object.assign({},this.cropRect);this.zoomFactor!==1&&(I.width=this.cropRect.width*this.zoomFactor,I.height=this.cropRect.height*this.zoomFactor,I.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-I.width/2,I.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-I.height/2),bt.setAttributes(this.cropRectElement,[["x",I.x.toString()],["y",I.y.toString()],["width",I.width.toString()],["height",I.height.toString()]]);var W=I.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(z,ge){var He=I.y+W*(ge+1);bt.setAttributes(z,[["x1",""+I.x],["y1",""+He],["x2",""+(I.x+I.width)],["y2",""+He]])});var q=I.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(z,ge){var He=I.x+q*(ge+1);bt.setAttributes(z,[["x1",""+He],["y1",""+I.y],["x2",""+He],["y2",""+(I.y+I.height)]])}),bt.setAttributes(this.cropShadeElement,[["d",bt.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,I.x,I.y,I.width,I.height)]]),this.topLeftGrip.setCenter(I.x,I.y),this.topRightGrip.setCenter(I.x+I.width,I.y),this.bottomLeftGrip.setCenter(I.x,I.y+I.height),this.bottomRightGrip.setCenter(I.x+I.width,I.y+I.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},V.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)},V.prototype.clientToLocalCoordinates=function(_,I){var W=this.container.getBoundingClientRect();return{x:_-W.left+this.margin,y:I-W.top+this.margin}},V.prototype.onPointerDown=function(_){this.container.setPointerCapture(_.pointerId),this.previousPoint=this.clientToLocalCoordinates(_.clientX,_.clientY),this.cropRectElement===_.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(_.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(_.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(_.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(_.target)&&(this.activeGrip=this.bottomRightGrip)},V.prototype.onPointerMove=function(_){if(this.isMoving)this.move(this.clientToLocalCoordinates(_.clientX,_.clientY));else if(this.activeGrip){var I=this.clientToLocalCoordinates(_.clientX,_.clientY);this.resize(I)}_.preventDefault()},V.prototype.onPointerUp=function(_){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(_.pointerId)},V.prototype.move=function(_){var I=_.x-this.previousPoint.x,W=_.y-this.previousPoint.y;this.zoomFactor!==1&&(I=-I/this.zoomFactor,W=-W/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+I),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+W),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=_},V.prototype.resize=function(_){var I=Object.assign({},this.cropRect),W=_.x-this.previousPoint.x,q=_.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:I.x+W<this.margin&&(W=this.margin-I.x),I.x+=W,I.width=this.cropRect.x+this.cropRect.width-I.x;break;case this.bottomRightGrip:case this.topRightGrip:I.width+W>this.canvasWidth*this.zoomFactor&&(W=this.canvasWidth*this.zoomFactor-I.width),I.width+=W}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(I.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(W),I.height=this.aspectRatio.getVerticalLength(I.width)):(I.y+=q,I.height=this.cropRect.y+this.cropRect.height-I.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?I.height=this.aspectRatio.getVerticalLength(I.width):I.height+=q}I.width<10&&(I.x=this.cropRect.x,I.width=10),I.height<10&&(I.y=this.cropRect.y,I.height=10),this.previousPoint=_,I.x>=this.margin&&I.y>=this.margin&&I.x-this.margin+I.width<=this.canvasWidth&&I.y-this.margin+I.height<=this.canvasHeight&&(this.cropRect=I,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},V.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var _=this.cropRect.x+this.cropRect.width/2,I=this.cropRect.y+this.cropRect.height/2,W=this.aspectRatio.getHorizontalLength(this.cropRect.height),q=this.aspectRatio.getVerticalLength(this.cropRect.width);W/this.canvasWidth<q/this.canvasHeight?this.cropRect.width=W:this.cropRect.height=q,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=_-this.cropRect.width/2,this.cropRect.y=I-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)}},V.prototype.getRescaledRect=function(_,I,W,q,z,ge){var He=W/_,it=q/I;return{x:(z.x-ge)*He+ge,y:(z.y-ge)*it+ge,width:z.width*He,height:z.height*it}},V.prototype.scaleCanvas=function(_,I){var W=this.getRescaledRect(this.canvasWidth,this.canvasHeight,_,I,this.cropRect,this.margin);this.canvasWidth=_,this.canvasHeight=I,this.onCropChange&&this.onCropChange(W),this.setCropRectangle(W)},V}(),dn=function(){function V(_){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=_,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(V.prototype,"angle",{get:function(){return this._angle},set:function(_){this._angle=_,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),V.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},V.prototype.onPointerDown=function(_){this.controlContainer.setPointerCapture(_.pointerId),this.isDragging=!0,this.previousPoint={x:_.clientX,y:_.clientY}},V.prototype.onPointerMove=function(_){this.isDragging&&(this.onAngleChange&&this.onAngleChange((_.clientX-this.previousPoint.x)/5),this.previousPoint.x=_.clientX)},V.prototype.onPointerUp=function(_){this.isDragging&&this.onAngleChange&&this.onAngleChange((_.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(_.pointerId)},V.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var _=this.angleLabelText.getBBox();bt.setAttributes(this.angleLabelElement,[["x",((this.width-_.width)/2).toString()],["y",(this.height/2).toString()]])}},V.prototype.positionScaleShape=function(){if(this.scaleShape){var _=this.scaleShape.transform.baseVal.getItem(0);_.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(_,0)}},V.prototype.getVisual=function(){var _=document.createElementNS("http://www.w3.org/2000/svg","svg");_.setAttribute("xmlns","http://www.w3.org/2000/svg"),_.setAttribute("width",this.width+"px"),_.setAttribute("height",this.height+"px"),_.setAttribute("viewBox","0 0 "+this.width+" "+this.height),_.style.flexShrink="0",document.body.appendChild(_);for(var I="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,W=1;W<=this.width/5+10;W++){var q=W%5==0?this.height/3:this.height/6;I+="h4v"+-q+"h1v"+q}I+="v1H0Z",this.scaleShape=bt.createPath(I);var z=bt.createTransform();this.scaleShape.transform.baseVal.appendItem(z),_.appendChild(this.scaleShape),this.angleLabelElement=bt.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=bt.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var ge=bt.createTSpan("");return ge.innerHTML="°",this.angleLabelElement.appendChild(ge),_.appendChild(this.angleLabelElement),document.body.removeChild(_),_},V}(),$n=function(){function V(){this.naturalSize=!1,this.imageType="image/png"}return V.prototype.rasterize=function(_,I,W,q,z,ge,He){var it=this;return new Promise(function(gt){var Ge=document.createElement("canvas");Ge.width=_.width.baseVal.value-2*q,Ge.height=_.height.baseVal.value-2*q;var wt=1,zt=1;it.naturalSize===!0?(wt=I.naturalWidth/(_.width.baseVal.value-2*q)/ge,zt=I.naturalHeight/(_.height.baseVal.value-2*q)/He,Ge.width=I.naturalWidth/ge,Ge.height=I.naturalHeight/He):it.width!==void 0&&it.height!==void 0&&(wt=it.width/W.width,zt=it.height/W.height,Ge.width*=wt,Ge.height*=zt);var en=Ge.getContext("2d");en.translate(Ge.width/2,Ge.height/2),en.rotate(z*Math.PI/180),en.scale(ge,He),en.translate(-Ge.width/2,-Ge.height/2),en.drawImage(I,0,0,Ge.width,Ge.height);var Wn=document.createElement("canvas");Wn.width=W.width*wt,Wn.height=W.height*zt,Wn.getContext("2d").putImageData(en.getImageData((W.x-q)*wt,(W.y-q)*zt,W.width*wt,W.height*zt),0,0),gt(Wn.toDataURL(it.imageType,it.imageQuality))})},V}(),Ye=function(){function V(_){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=V.instanceCounter++,this.styles=new tn(this.instanceNo),this.target=_,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(V.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(_){this._zoomToCropEnabled=_,_?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(_){this._isGridVisible=_,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"gridLines",{get:function(){return this._gridLines},set:function(_){this._gridLines=_,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(_){this._rotationAngle=_,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"aspectRatio",{get:function(){var _;return(_=this._aspectRatio)!==null&&_!==void 0?_:this.aspectRatios[0]},set:function(_){this._aspectRatio=_},enumerable:!1,configurable:!0}),V.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},V.prototype.show=function(){this.showUI(),this.open()},V.prototype.close=function(_){_===void 0&&(_=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),_||this.closeEventListeners.forEach(function(I){return I()}),this._isOpen=!1)},V.prototype.addRenderEventListener=function(_){this.renderEventListeners.push(_)},V.prototype.removeRenderEventListener=function(_){this.renderEventListeners.indexOf(_)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(_),1)},V.prototype.addCloseEventListener=function(_){this.closeEventListeners.push(_)},V.prototype.removeCloseEventListener=function(_){this.closeEventListeners.indexOf(_)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(_),1)},V.prototype.setupResizeObserver=function(){var _=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){_.resize(_.target.clientWidth,_.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))},V.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var _=1*this.target.clientWidth/this.target.clientHeight,I=this.contentDiv.clientWidth/_>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*_:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,W=I+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/_;this.resize(I,W)}},V.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},V.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",bt.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},V.prototype.resize=function(_,I){this.imageWidth=Math.round(_),this.imageHeight=Math.round(I),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()},V.prototype.setEditingTarget=function(){var _=document.createElement("canvas");_.width=this.target.naturalWidth,_.height=this.target.naturalHeight,_.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var I=_.toDataURL();bt.setAttributes(this.editingTarget,[["href",I]]),this.setEditingTargetSize()},V.prototype.setTopLeft=function(){var _=this.target.getBoundingClientRect(),I=this.editorCanvas.getBoundingClientRect();this.left=_.left-I.left-this.CANVAS_MARGIN,this.top=_.top-I.top-this.CANVAS_MARGIN},V.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=bt.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=bt.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=bt.createGroup(),this.editingTargetRotationScaleContainer=bt.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var _=bt.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(_);var I=bt.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(I),this.editingTargetContainer=bt.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)},V.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},V.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=bt.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new Ut(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()},V.prototype.zoomToCrop=function(){if(this.cropRect){var _=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,I=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=_+"px "+I+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-_+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-I+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},V.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)},V.prototype.cropRectChanged=function(_){this.cropRect=_,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},V.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},V.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},V.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},V.prototype.showUI=function(){switch(this.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 _=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,I=this.target.offsetTop>_+this.CANVAS_MARGIN?this.target.offsetTop-(_+this.CANVAS_MARGIN):0;this.coverDiv.style.top=I+"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},V.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},V.prototype.addTopToolbar=function(){var _=this;this.topToolbar=new Wt,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 I=new hn;I.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(I);var W=[];this.aspectRatios.forEach(function(zt){var en=new dt(Ot.getIcon(zt.horizontal,zt.vertical),zt.horizontal===0&&zt.vertical===0?"FREE":zt.horizontal+":"+zt.vertical);en.onClick=function(){return _.ratioButtonClicked(zt)},W.push(en)}),this.aspectRatioButton=new Mt(Ot.getIcon(0,0),"Aspect ratio",W),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,I.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var q=new dt('<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");q.isActive=this.isGridVisible,q.onClick=function(){_.isGridVisible=!_.isGridVisible,q.isActive=_.isGridVisible},I.addButton(q);var z=new dt('<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(z.isActive=this.zoomToCropEnabled,z.onClick=function(){_.zoomToCropEnabled=!_.zoomToCropEnabled,z.isActive=_.zoomToCropEnabled},I.addButton(z),!sn.isLicensed){var ge=new ut;this.topToolbar.addElementBlock(ge);var He=document.createElement("div");He.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var it=document.createElement("a");it.style.color="currentColor",it.href="https://markerjs.com/products/cropro",it.target="_blank",it.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>',He.appendChild(it),ge.addElement(He)}var gt=new hn;gt.minWidth=3*this.toolbarHeight+"px",gt.contentAlign="end",this.topToolbar.addButtonBlock(gt);var Ge=new dt('<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");Ge.onClick=this.startRenderAndClose,gt.addButton(Ge),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Ge.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var wt=new dt('<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");wt.onClick=this.close,gt.addButton(wt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(wt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},V.prototype.addBottomToolbar=function(){var _=this;this.bottomToolbar=new Wt,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 I=new hn;I.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(I);var W=new dt('<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");W.onClick=this.rotateLeftButtonClicked,I.addButton(W);var q=new dt('<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");q.onClick=this.rotateRightButtonClicked,I.addButton(q);var z=new ut;z.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(z),this.straightener=new dn("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(gt){_.rotateBy(gt),_.straightener.angle=_.rotationAngle},z.addElement(this.straightener.getUI());var ge=new hn;ge.minWidth=2*this.toolbarHeight+"px",ge.contentAlign="end",this.bottomToolbar.addButtonBlock(ge);var He=new dt('<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");He.onClick=this.flipHorizontallyButtonClicked,ge.addButton(He);var it=new dt('<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");it.onClick=this.flipVerticallyButtonClicked,ge.addButton(it)},V.prototype.ratioButtonClicked=function(_){this.aspectRatio=_,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},V.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Ot.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},V.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new qt(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},V.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},V.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},V.prototype.restoreState=function(_){if(_){var I=this.cropLayer.getRescaledRect(_.width,_.height,this.imageWidth,this.imageHeight,_.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(I),this.cropRectChanged(I),this.flippedHorizontally=_.flippedHorizontally,this.flippedVertically=_.flippedVertically,this.applyFlip(),this.rotationAngle=_.rotationAngle,this.applyRotation()}},V.prototype.clientToLocalCoordinates=function(_,I){var W=this.cropImage.getBoundingClientRect();return{x:_-W.left,y:I-W.top}},V.prototype.onWindowResize=function(){this.positionUI()},V.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var _=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=_+"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()},V.prototype.rotateLeftButtonClicked=function(){var _=this.rotationAngle-90;this.rotationAngle%90!=0&&(_+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(_)},V.prototype.rotateRightButtonClicked=function(){var _=this.rotationAngle+90;this.rotationAngle%90!=0&&(_-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(_)},V.prototype.rotateTo=function(_){_=(_=_>180?_-360:_)<=-180?_+360:_,this.rotationAngle=_,this.applyRotation()},V.prototype.rotateBy=function(_){this.rotateTo((this.rotationAngle+_)%360)},V.prototype.applyRotation=function(){var _=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var I=this.editingTargetRotationContainer.transform.baseVal.getItem(0);I.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(I,0);var W=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/W.width,this.imageHeight/W.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=_},V.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},V.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},V.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},V.prototype.startRenderAndClose=function(){return Rt(this,void 0,void 0,function(){var _,I;return mn(this,function(W){switch(W.label){case 0:return[4,this.render()];case 1:return _=W.sent(),I=this.getState(),this.renderEventListeners.forEach(function(q){return q(_,I)}),this.close(!0),[2]}})})},V.prototype.render=function(){return Rt(this,void 0,void 0,function(){var _;return mn(this,function(I){switch(I.label){case 0:return(_=new $n).naturalSize=this.renderAtNaturalSize,_.imageType=this.renderImageType,_.imageQuality=this.renderImageQuality,_.width=this.renderWidth,_.height=this.renderHeight,this.unzoomFromCrop(),bt.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,_.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 I.sent(),[4,_.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,I.sent()]}})})},V.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Tt("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 Tt("toolbar_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Tt("toolbar-block",`
|
|
display: flex;
|
|
align-items: center;
|
|
box-sizing: content-box;
|
|
`));var _=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Tt("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.toolbarHeight-2*_)+`px;
|
|
height: `+(this.toolbarHeight-2*_)+`px;
|
|
padding: `+_+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Tt("toolbar_button_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Tt("toolbar_active_button",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
|
|
`)),this.styles.addRule(new _t("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new _t("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
|
|
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new Tt("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 Tt("toolbar_dropdown_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new Tt("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 Tt("toolbar_straightener",`
|
|
display: flex;
|
|
overflow: hidden;
|
|
justify-content: center;
|
|
height: `+(this.toolbarHeight-2*_)+`px;
|
|
padding: `+_+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new Tt("toolbar_straightener_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`))},V.instanceCounter=0,V}(),It=Z("8hTe"),mi=Z.n(It),gi=/<pre[^>]*>/g;function vi(V){var _=document.createElement("div");return _.innerHTML=V,_.childNodes.length===0?"":_.childNodes[0].nodeValue}var yi=be.a=function(V){var _=V.value,I=_===void 0?"":_,W=V.edit,q=W===void 0?!1:W,z=V.className,ge=V.showTextOnly,He=V.showLines,it=V.replaces,gt=V.zoomImg,Ge=V.hasMask,wt=V.style,zt=wt===void 0?{}:wt,en=V.stylesPrev,Wn=en===void 0?{}:en,An=String(I),Rn=Object(D.useRef)(),Qn=Object(D.useRef)(),Di=Object(D.useState)(""),yn=Object(G.a)(Di,2),Vn=yn[0],ui=yn[1],hi=Object(D.useState)("office"),Gn=Object(G.a)(hi,2),ki=Gn[0],bi=Gn[1],zi=function(){var Vt=new Ye(Qn.current);Vt.displayMode="popup",Vt.addRenderEventListener(function(){var wn=Object(k.a)(n.a.mark(function jt(cn){var $t;return n.a.wrap(function(bn){for(;;)switch(bn.prev=bn.next){case 0:return Rn.current.style.display="none",bn.next=3,Object(Re.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:cn}});case 3:$t=bn.sent,$t!=null&&$t.id&&it(Qn.current.getAttribute("src").replace(ee.a.API_SERVER,""),"/api/attachments/".concat($t==null?void 0:$t.id,"?type=").concat($t.content_type));case 5:case"end":return bn.stop()}},jt)}));return function(jt){return wn.apply(this,arguments)}}()),Vt.show()},Vi=function(){var Vt=new vt(Qn.current);Vt.settings.displayMode="popup",Vt.addEventListener("render",function(){var wn=Object(k.a)(n.a.mark(function jt(cn){var $t;return n.a.wrap(function(bn){for(;;)switch(bn.prev=bn.next){case 0:if(Rn.current.style.display="none",!Qn.current){bn.next=6;break}return bn.next=4,Object(Re.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:cn.dataUrl}});case 4:$t=bn.sent,$t!=null&&$t.id&&it(Qn.current.getAttribute("src").replace(ee.a.API_SERVER,""),"/api/attachments/".concat($t==null?void 0:$t.id,"?type=").concat($t.content_type));case 6:case"end":return bn.stop()}},jt)}));return function(jt){return wn.apply(this,arguments)}}()),Vt.show(),window.markerArea=Vt},qn=Object(D.useMemo)(function(){Rn.current&&(Rn.current.style.zIndex=-1);try{var ln=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Vt=/\"\/api\/attachments\/|\"\/attachments\/download\//g,wn=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;An=An.replace(ln,"("+ee.a.API_SERVER+"/api/attachments/").replace(Vt,'"'+ee.a.API_SERVER+"/api/attachments/").replace(wn,'"'+ee.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(ri){}var jt=j(An),cn=w();if(An.match(/\[TOC\]/)&&(jt=jt.replace("<p>[TOC]</p>",L()),A()),jt=jt.replace(/(__special_katext_id_\d+__)/g,function(ri,bn){var Dn=cn[bn],Xi=Dn.type,xi=Dn.expression;return Object(ae.renderToString)(vi(xi)||"",{displayMode:Xi==="block",throwOnError:!1,output:"html"})}),jt=jt.replace(/▁/g,"\u2581\u2581\u2581"),v(),ge){var $t=document.createElement("div");return $t.innerHTML=jt,$t.innerText}return setTimeout(function(){return dr()},500),jt},[An]),Jn=Object(D.useRef)();E.WebkitLineClamp=He,He&&(zt=Object(U.a)(Object(U.a)({},zt),E));function _i(ln){var Vt=ln.target;if(Vt.tagName.toUpperCase()==="IMG"){if(gt){var wn=Vt.getAttribute("src");ui(wn),bi("image")}}else if(Vt.tagName.toUpperCase()==="A"){var jt=Vt.getAttribute("href");if(jt.indexOf("office")>-1)ln.preventDefault(),ui(jt),bi("office");else if(jt.indexOf("application/pdf")>-1)ln.preventDefault(),ui(jt),bi("pdf");else if(jt.indexOf("text/html")>-1)ln.preventDefault(),ui(jt),bi("html");else if(jt.startsWith("#")){ln.preventDefault();var cn=document.getElementById(jt.replace("#",""));cn&&cn.scrollIntoView(!0)}}}var dr=function(){var Vt,wn=(Vt=Jn.current)===null||Vt===void 0?void 0:Vt.querySelectorAll("video");wn==null||wn.forEach(function(jt){if(jt.oncontextmenu=function(){return!1},jt.src.indexOf(".m3u8")>-1&&!jt.canPlayType("application/vnd.apple.mpegurl")){if(Y.a.isSupported()){var cn=new Y.a;cn.loadSource(jt.src),cn.attachMedia(jt)}}})};Object(D.useEffect)(function(){if(Jn.current&&qn&&(qn.match(gi)&&window.PR.prettyPrint()),Jn.current)return Jn.current.addEventListener("click",_i),function(){Jn.current.removeEventListener("click",_i),v(),A()}},[qn,Jn.current,_i]);var Ei=function(Vt){if(!q)return;Vt.target.nodeName==="IMG"?(Rn.current.style.zIndex=1,Rn.current.style.display="flex",Rn.current.style.width=Vt.target.clientWidth+"px",Rn.current.style.height=Vt.target.clientHeight+"px",Rn.current.style.top=Vt.target.offsetTop+"px",Rn.current.style.left=Vt.target.offsetLeft+"px",Qn.current.src=Vt.target.getAttribute("src")):Rn.current.style.display="none"};return g.a.createElement("div",{style:{position:"relative"}},g.a.createElement("div",{ref:Jn,style:Object(U.a)({},zt),className:"".concat(z||""," markdown-body ").concat(mi.a.mdBody),onMouseOver:Ei,dangerouslySetInnerHTML:{__html:qn}}),g.a.createElement("div",{ref:Rn,className:mi.a.button},g.a.createElement($.a,null,g.a.createElement(X.a,{onClick:function(){return zi()}},"\u88C1\u526A"),g.a.createElement(X.a,{onClick:function(){return Vi()}},"\u7F16\u8F91"))),g.a.createElement("img",{ref:Qn,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),g.a.createElement(ue.a,{close:!0,data:Vn,type:Vn!=null&&Vn.length?ki:"",style:Object(U.a)({},Wn),onClose:function(){return ui("")}}))}},"9VGf":function(ht,be,Z){"use strict";Z.d(be,"a",function(){return P});var re=Z("q1tI"),$=Z.n(re);function P(X,U){var k=Object(re.useRef)();Object(re.useEffect)(function(){k.current=X}),Object(re.useEffect)(function(){function G(){k.current()}if(U!==null){var H=setInterval(G,U);return function(){return clearInterval(H)}}},[U])}},BU3w:function(ht,be,Z){"use strict";Z.d(be,"a",function(){return k});var re=Z("MNnm"),$="rc-util-key";function P(G){if(G.attachTo)return G.attachTo;var H=document.querySelector("head");return H||document.body}function X(G){var H,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(re.a)())return null;var D=document.createElement("style");if((H=n.csp)===null||H===void 0?void 0:H.nonce){var g;D.nonce=(g=n.csp)===null||g===void 0?void 0:g.nonce}D.innerHTML=G;var p=P(n),m=p.firstChild;return n.prepend&&p.prepend?p.prepend(D):n.prepend&&m?p.insertBefore(D,m):p.appendChild(D),D}var U=new Map;function k(G,H){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},D=P(n);if(!U.has(D)){var g=X("",n),p=g.parentNode;U.set(D,p),p.removeChild(g)}var m=Array.from(U.get(D).children).find(function(u){return u.tagName==="STYLE"&&u[$]===H});if(m){var h,o;if(((h=n.csp)===null||h===void 0?void 0:h.nonce)&&m.nonce!==((o=n.csp)===null||o===void 0?void 0:o.nonce)){var c;m.nonce=(c=n.csp)===null||c===void 0?void 0:c.nonce}return m.innerHTML!==G&&(m.innerHTML=G),m}var l=X(G,n);return l[$]=H,l}},Bd2K:function(ht,be,Z){(function(re){re(Z("VrN/"),Z("osHv"))})(function(re){re.defineOption("autoCloseTags",!1,function(n,D,g){if(g!=re.Init&&g&&n.removeKeyMap("autoCloseTags"),!D)return;var p={name:"autoCloseTags"};(typeof D!="object"||D.whenClosing!==!1)&&(p["'/'"]=function(m){return k(m)}),(typeof D!="object"||D.whenOpening!==!1)&&(p["'>'"]=function(m){return X(m)}),n.addKeyMap(p)});var $=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],P=["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 X(n){if(n.getOption("disableInput"))return re.Pass;for(var D=n.listSelections(),g=[],p=n.getOption("autoCloseTags"),m=0;m<D.length;m++){if(!D[m].empty())return re.Pass;var h=D[m].head,o=n.getTokenAt(h),c=re.innerMode(n.getMode(),o.state),l=c.state,u=c.mode.xmlCurrentTag&&c.mode.xmlCurrentTag(l),s=u&&u.name;if(!s)return re.Pass;var a=c.mode.configuration=="html",A=typeof p=="object"&&p.dontCloseTags||a&&$,E=typeof p=="object"&&p.indentTags||a&&P;o.end>h.ch&&(s=s.slice(0,s.length-o.end+h.ch));var S=s.toLowerCase();if(!s||o.type=="string"&&(o.end!=h.ch||!/[\"\']/.test(o.string.charAt(o.string.length-1))||o.string.length==1)||o.type=="tag"&&u.close||o.string.indexOf("/")==h.ch-o.start-1||A&&G(A,S)>-1||H(n,c.mode.xmlCurrentContext&&c.mode.xmlCurrentContext(l)||[],s,h,!0))return re.Pass;var L=typeof p=="object"&&p.emptyTags;if(L&&G(L,s)>-1){g[m]={text:"/>",newPos:re.Pos(h.line,h.ch+2)};continue}var O=E&&G(E,S)>-1;g[m]={indent:O,text:">"+(O?`
|
|
|
|
`:"")+"</"+s+">",newPos:O?re.Pos(h.line+1,0):re.Pos(h.line,h.ch+1)}}for(var C=typeof p=="object"&&p.dontIndentOnAutoClose,m=D.length-1;m>=0;m--){var T=g[m];n.replaceRange(T.text,D[m].head,D[m].anchor,"+insert");var x=n.listSelections().slice(0);x[m]={head:T.newPos,anchor:T.newPos},n.setSelections(x),!C&&T.indent&&(n.indentLine(T.newPos.line,null,!0),n.indentLine(T.newPos.line+1,null,!0))}}function U(n,D){for(var g=n.listSelections(),p=[],m=D?"/":"</",h=n.getOption("autoCloseTags"),o=typeof h=="object"&&h.dontIndentOnSlash,c=0;c<g.length;c++){if(!g[c].empty())return re.Pass;var l=g[c].head,u=n.getTokenAt(l),s=re.innerMode(n.getMode(),u.state),a=s.state;if(D&&(u.type=="string"||u.string.charAt(0)!="<"||u.start!=l.ch-1))return re.Pass;var A,E=s.mode.name!="xml"&&n.getMode().name=="htmlmixed";if(E&&s.mode.name=="javascript")A=m+"script";else if(E&&s.mode.name=="css")A=m+"style";else{var S=s.mode.xmlCurrentContext&&s.mode.xmlCurrentContext(a);if(!S||S.length&&H(n,S,S[S.length-1],l))return re.Pass;A=m+S[S.length-1]}n.getLine(l.line).charAt(u.end)!=">"&&(A+=">"),p[c]=A}if(n.replaceSelections(p),g=n.listSelections(),!o)for(var c=0;c<g.length;c++)(c==g.length-1||g[c].head.line<g[c+1].head.line)&&n.indentLine(g[c].head.line)}function k(n){return n.getOption("disableInput")?re.Pass:U(n,!0)}re.commands.closeTag=function(n){return U(n)};function G(n,D){if(n.indexOf)return n.indexOf(D);for(var g=0,p=n.length;g<p;++g)if(n[g]==D)return g;return-1}function H(n,D,g,p,m){if(!re.scanForClosingTag)return!1;var h=Math.min(n.lastLine()+1,p.line+500),o=re.scanForClosingTag(n,p,null,h);if(!o||o.tag!=g)return!1;for(var c=m?1:0,l=D.length-1;l>=0&&D[l]==g;l--)++c;p=o.to;for(var l=1;l<c;l++){var u=re.scanForClosingTag(n,p,null,h);if(!u||u.tag!=g)return!1;p=u.to}return!0}})},BjJ7:function(ht,be,Z){"use strict";Z.d(be,"d",function(){return $}),Z.d(be,"c",function(){return P}),Z.d(be,"e",function(){return X}),Z.d(be,"b",function(){return U}),Z.d(be,"a",function(){return G});var re=Z("m3rI");function $(H){var n=!0;if(H.length>0){for(var D=0;D<H.length;D++)if(H[D].compile_success==0||!H[D].compile_success){n=!1;break}}else n=!1;return n}function P(H){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",D=[],g=0;g<H.length;g++){var p=H[g],m=n?"".concat(n,"/").concat(p.name):"".concat(p.name);D.push({title:p.name,isLeaf:!(p.type==="tree"),key:m})}return D}function X(H,n,D){for(var g=0;g<H.length;g++){var p=H[g];if(p.key===n){p.children=D;break}p.children&&X(p.children,n,D)}return H}function U(H,n,D){var g;return function(){var p=this,m=arguments,h=function(){g=null,D||H.apply(p,m)},o=D&&!g;clearTimeout(g),g=setTimeout(h,n),o&&H.apply(p,m)}}var k=!0,G=re.a.API_SERVER},"C+DQ":function(ht,be,Z){},"C/vA":function(ht,be,Z){"use strict";Z.d(be,"a",function(){return re});function re($){const P=this;let X=!1,U;return function(){return X||(X=!0,U=$.apply(P,arguments)),U}}},"Cg/j":function(ht,be,Z){"use strict";Z.d(be,"b",function(){return re}),Z.d(be,"a",function(){return $}),Z.d(be,"c",function(){return X}),Z.d(be,"d",function(){return U});var re;(function(k){k.serviceIds=new Map,k.DI_TARGET="$di$target",k.DI_DEPENDENCIES="$di$dependencies";function G(H){return H[k.DI_DEPENDENCIES]||[]}k.getServiceDependencies=G})(re||(re={}));const $=X("instantiationService");function P(k,G,H,n){G[re.DI_TARGET]===G?G[re.DI_DEPENDENCIES].push({id:k,index:H,optional:n}):(G[re.DI_DEPENDENCIES]=[{id:k,index:H,optional:n}],G[re.DI_TARGET]=G)}function X(k){if(re.serviceIds.has(k))return re.serviceIds.get(k);const G=function(H,n,D){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");P(G,H,D,!1)};return G.toString=()=>k,re.serviceIds.set(k,G),G}function U(k){return function(G,H,n){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");P(k,G,n,!0)}}},DlQD:function(ht,be,Z){(function(re,$){ht.exports=$()})(this,function(){"use strict";function re(ve,ce){for(var fe=0;fe<ce.length;fe++){var ie=ce[fe];ie.enumerable=ie.enumerable||!1,ie.configurable=!0,"value"in ie&&(ie.writable=!0),Object.defineProperty(ve,ie.key,ie)}}function $(ve,ce,fe){return ce&&re(ve.prototype,ce),fe&&re(ve,fe),ve}function P(ve,ce){if(!ve)return;if(typeof ve=="string")return X(ve,ce);var fe=Object.prototype.toString.call(ve).slice(8,-1);if(fe==="Object"&&ve.constructor&&(fe=ve.constructor.name),fe==="Map"||fe==="Set")return Array.from(ve);if(fe==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(fe))return X(ve,ce)}function X(ve,ce){(ce==null||ce>ve.length)&&(ce=ve.length);for(var fe=0,ie=new Array(ce);fe<ce;fe++)ie[fe]=ve[fe];return ie}function U(ve,ce){var fe;if(typeof Symbol=="undefined"||ve[Symbol.iterator]==null){if(Array.isArray(ve)||(fe=P(ve))||ce&&ve&&typeof ve.length=="number"){fe&&(ve=fe);var ie=0;return function(){return ie>=ve.length?{done:!0}:{done:!1,value:ve[ie++]}}}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 fe=ve[Symbol.iterator](),fe.next.bind(fe)}function k(ve,ce){return ce={exports:{}},ve(ce,ce.exports),ce.exports}var G=k(function(ve){function ce(){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 fe(ie){ve.exports.defaults=ie}ve.exports={defaults:ce(),getDefaults:ce,changeDefaults:fe}}),H=G.defaults,n=G.getDefaults,D=G.changeDefaults,g=/[&<>"']/,p=/[&<>"']/g,m=/[<>"']|&(?!#?\w+;)/,h=/[<>"']|&(?!#?\w+;)/g,o={"&":"&","<":"<",">":">",'"':""","'":"'"},c=function(ce){return o[ce]};function l(ve,ce){if(ce){if(g.test(ve))return ve.replace(p,c)}else if(m.test(ve))return ve.replace(h,c);return ve}var u=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function s(ve){return ve.replace(u,function(ce,fe){return fe=fe.toLowerCase(),fe==="colon"?":":fe.charAt(0)==="#"?fe.charAt(1)==="x"?String.fromCharCode(parseInt(fe.substring(2),16)):String.fromCharCode(+fe.substring(1)):""})}var a=/(^|[^\[])\^/g;function A(ve,ce){ve=ve.source||ve,ce=ce||"";var fe={replace:function(ne,oe){return oe=oe.source||oe,oe=oe.replace(a,"$1"),ve=ve.replace(ne,oe),fe},getRegex:function(){return new RegExp(ve,ce)}};return fe}var E=/[^\w:]/g,S=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function L(ve,ce,fe){if(ve){var ie;try{ie=decodeURIComponent(s(fe)).replace(E,"").toLowerCase()}catch(ne){return null}if(ie.indexOf("javascript:")===0||ie.indexOf("vbscript:")===0||ie.indexOf("data:")===0)return null}ce&&!S.test(fe)&&(fe=f(ce,fe));try{fe=encodeURI(fe).replace(/%25/g,"%")}catch(ne){return null}return fe}var O={},C=/^[^:]+:\/*[^/]*$/,T=/^([^:]+:)[\s\S]*$/,x=/^([^:]+:\/*[^/]*)[\s\S]*$/;function f(ve,ce){O[" "+ve]||(C.test(ve)?O[" "+ve]=ve+"/":O[" "+ve]=F(ve,"/",!0)),ve=O[" "+ve];var fe=ve.indexOf(":")===-1;return ce.substring(0,2)==="//"?fe?ce:ve.replace(T,"$1")+ce:ce.charAt(0)==="/"?fe?ce:ve.replace(x,"$1")+ce:ve+ce}var w={exec:function(){}};function v(ve){for(var ce=1,fe,ie;ce<arguments.length;ce++){fe=arguments[ce];for(ie in fe)Object.prototype.hasOwnProperty.call(fe,ie)&&(ve[ie]=fe[ie])}return ve}function b(ve,ce){var fe=ve.replace(/\|/g,function(oe,le,ye){for(var Le=!1,Ne=le;--Ne>=0&&ye[Ne]==="\\";)Le=!Le;return Le?"|":" |"}),ie=fe.split(/ \|/),ne=0;if(ie.length>ce)ie.splice(ce);else for(;ie.length<ce;)ie.push("");for(;ne<ie.length;ne++)ie[ne]=ie[ne].trim().replace(/\\\|/g,"|");return ie}function F(ve,ce,fe){var ie=ve.length;if(ie===0)return"";for(var ne=0;ne<ie;){var oe=ve.charAt(ie-ne-1);if(oe===ce&&!fe)ne++;else if(oe!==ce&&fe)ne++;else break}return ve.substr(0,ie-ne)}function B(ve,ce){if(ve.indexOf(ce[1])===-1)return-1;for(var fe=ve.length,ie=0,ne=0;ne<fe;ne++)if(ve[ne]==="\\")ne++;else if(ve[ne]===ce[0])ie++;else if(ve[ne]===ce[1]&&(ie--,ie<0))return ne;return-1}function R(ve){ve&&ve.sanitize&&!ve.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 j={escape:l,unescape:s,edit:A,cleanUrl:L,resolveUrl:f,noopTest:w,merge:v,splitCells:b,rtrim:F,findClosingBracket:B,checkSanitizeDeprecation:R},N=G.defaults,y=j.rtrim,Y=j.splitCells,ee=j.escape,ae=j.findClosingBracket;function ue(ve,ce,fe){var ie=ce.href,ne=ce.title?ee(ce.title):null,oe=ve[1].replace(/\\([\[\]])/g,"$1");return ve[0].charAt(0)!=="!"?{type:"link",raw:fe,href:ie,title:ne,text:oe}:{type:"image",raw:fe,href:ie,title:ne,text:ee(oe)}}function Re(ve,ce){var fe=ve.match(/^(\s+)(?:```)/);if(fe===null)return ce;var ie=fe[1];return ce.split(`
|
|
`).map(function(ne){var oe=ne.match(/^\s+/);if(oe===null)return ne;var le=oe[0];return le.length>=ie.length?ne.slice(ie.length):ne}).join(`
|
|
`)}var Ee=function(){function ve(fe){this.options=fe||N}var ce=ve.prototype;return ce.space=function(ie){var ne=this.rules.block.newline.exec(ie);if(ne)return ne[0].length>1?{type:"space",raw:ne[0]}:{raw:`
|
|
`}},ce.code=function(ie,ne){var oe=this.rules.block.code.exec(ie);if(oe){var le=ne[ne.length-1];if(le&&le.type==="paragraph")return{raw:oe[0],text:oe[0].trimRight()};var ye=oe[0].replace(/^ {4}/gm,"");return{type:"code",raw:oe[0],codeBlockStyle:"indented",text:this.options.pedantic?ye:y(ye,`
|
|
`)}}},ce.fences=function(ie){var ne=this.rules.block.fences.exec(ie);if(ne){var oe=ne[0],le=Re(oe,ne[3]||"");return{type:"code",raw:oe,lang:ne[2]?ne[2].trim():ne[2],text:le}}},ce.heading=function(ie){var ne=this.rules.block.heading.exec(ie);if(ne)return{type:"heading",raw:ne[0],depth:ne[1].length,text:ne[2]}},ce.nptable=function(ie){var ne=this.rules.block.nptable.exec(ie);if(ne){var oe={type:"table",header:Y(ne[1].replace(/^ *| *\| *$/g,"")),align:ne[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ne[3]?ne[3].replace(/\n$/,"").split(`
|
|
`):[],raw:ne[0]};if(oe.header.length===oe.align.length){var le=oe.align.length,ye;for(ye=0;ye<le;ye++)/^ *-+: *$/.test(oe.align[ye])?oe.align[ye]="right":/^ *:-+: *$/.test(oe.align[ye])?oe.align[ye]="center":/^ *:-+ *$/.test(oe.align[ye])?oe.align[ye]="left":oe.align[ye]=null;for(le=oe.cells.length,ye=0;ye<le;ye++)oe.cells[ye]=Y(oe.cells[ye],oe.header.length);return oe}}},ce.hr=function(ie){var ne=this.rules.block.hr.exec(ie);if(ne)return{type:"hr",raw:ne[0]}},ce.blockquote=function(ie){var ne=this.rules.block.blockquote.exec(ie);if(ne){var oe=ne[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:ne[0],text:oe}}},ce.list=function(ie){var ne=this.rules.block.list.exec(ie);if(ne){for(var oe=ne[0],le=ne[2],ye=le.length>1,Le=le[le.length-1]===")",Ne={type:"list",raw:oe,ordered:ye,start:ye?+le.slice(0,-1):"",loose:!1,items:[]},Je=ne[0].match(this.rules.block.item),mt=!1,ft,Ct,xt,Qe,Lt,vt,Ft,Pt=Je.length,Rt=0;Rt<Pt;Rt++)ft=Je[Rt],oe=ft,Ct=ft.length,ft=ft.replace(/^ *([*+-]|\d+[.)]) */,""),~ft.indexOf(`
|
|
`)&&(Ct-=ft.length,ft=this.options.pedantic?ft.replace(/^ {1,4}/gm,""):ft.replace(new RegExp("^ {1,"+Ct+"}","gm"),"")),Rt!==Pt-1&&(xt=this.rules.block.bullet.exec(Je[Rt+1])[0],(ye?xt.length===1||!Le&&xt[xt.length-1]===")":xt.length>1||this.options.smartLists&&xt!==le)&&(Qe=Je.slice(Rt+1).join(`
|
|
`),Ne.raw=Ne.raw.substring(0,Ne.raw.length-Qe.length),Rt=Pt-1)),Lt=mt||/\n\n(?!\s*$)/.test(ft),Rt!==Pt-1&&(mt=ft.charAt(ft.length-1)===`
|
|
`,Lt||(Lt=mt)),Lt&&(Ne.loose=!0),vt=/^\[[ xX]\] /.test(ft),Ft=void 0,vt&&(Ft=ft[1]!==" ",ft=ft.replace(/^\[[ xX]\] +/,"")),Ne.items.push({type:"list_item",raw:oe,task:vt,checked:Ft,loose:Lt,text:ft});return Ne}},ce.html=function(ie){var ne=this.rules.block.html.exec(ie);if(ne)return{type:this.options.sanitize?"paragraph":"html",raw:ne[0],pre:!this.options.sanitizer&&(ne[1]==="pre"||ne[1]==="script"||ne[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ne[0]):ee(ne[0]):ne[0]}},ce.def=function(ie){var ne=this.rules.block.def.exec(ie);if(ne){ne[3]&&(ne[3]=ne[3].substring(1,ne[3].length-1));var oe=ne[1].toLowerCase().replace(/\s+/g," ");return{tag:oe,raw:ne[0],href:ne[2],title:ne[3]}}},ce.table=function(ie){var ne=this.rules.block.table.exec(ie);if(ne){var oe={type:"table",header:Y(ne[1].replace(/^ *| *\| *$/g,"")),align:ne[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ne[3]?ne[3].replace(/\n$/,"").split(`
|
|
`):[]};if(oe.header.length===oe.align.length){oe.raw=ne[0];var le=oe.align.length,ye;for(ye=0;ye<le;ye++)/^ *-+: *$/.test(oe.align[ye])?oe.align[ye]="right":/^ *:-+: *$/.test(oe.align[ye])?oe.align[ye]="center":/^ *:-+ *$/.test(oe.align[ye])?oe.align[ye]="left":oe.align[ye]=null;for(le=oe.cells.length,ye=0;ye<le;ye++)oe.cells[ye]=Y(oe.cells[ye].replace(/^ *\| *| *\| *$/g,""),oe.header.length);return oe}}},ce.lheading=function(ie){var ne=this.rules.block.lheading.exec(ie);if(ne)return{type:"heading",raw:ne[0],depth:ne[2].charAt(0)==="="?1:2,text:ne[1]}},ce.paragraph=function(ie){var ne=this.rules.block.paragraph.exec(ie);if(ne)return{type:"paragraph",raw:ne[0],text:ne[1].charAt(ne[1].length-1)===`
|
|
`?ne[1].slice(0,-1):ne[1]}},ce.text=function(ie,ne){var oe=this.rules.block.text.exec(ie);if(oe){var le=ne[ne.length-1];return le&&le.type==="text"?{raw:oe[0],text:oe[0]}:{type:"text",raw:oe[0],text:oe[0]}}},ce.escape=function(ie){var ne=this.rules.inline.escape.exec(ie);if(ne)return{type:"escape",raw:ne[0],text:ee(ne[1])}},ce.tag=function(ie,ne,oe){var le=this.rules.inline.tag.exec(ie);if(le)return!ne&&/^<a /i.test(le[0])?ne=!0:ne&&/^<\/a>/i.test(le[0])&&(ne=!1),!oe&&/^<(pre|code|kbd|script)(\s|>)/i.test(le[0])?oe=!0:oe&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(le[0])&&(oe=!1),{type:this.options.sanitize?"text":"html",raw:le[0],inLink:ne,inRawBlock:oe,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(le[0]):ee(le[0]):le[0]}},ce.link=function(ie){var ne=this.rules.inline.link.exec(ie);if(ne){var oe=ae(ne[2],"()");if(oe>-1){var le=ne[0].indexOf("!")===0?5:4,ye=le+ne[1].length+oe;ne[2]=ne[2].substring(0,oe),ne[0]=ne[0].substring(0,ye).trim(),ne[3]=""}var Le=ne[2],Ne="";if(this.options.pedantic){var Je=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Le);Je?(Le=Je[1],Ne=Je[3]):Ne=""}else Ne=ne[3]?ne[3].slice(1,-1):"";Le=Le.trim().replace(/^<([\s\S]*)>$/,"$1");var mt=ue(ne,{href:Le&&Le.replace(this.rules.inline._escapes,"$1"),title:Ne&&Ne.replace(this.rules.inline._escapes,"$1")},ne[0]);return mt}},ce.reflink=function(ie,ne){var oe;if((oe=this.rules.inline.reflink.exec(ie))||(oe=this.rules.inline.nolink.exec(ie))){var le=(oe[2]||oe[1]).replace(/\s+/g," ");if(le=ne[le.toLowerCase()],!le||!le.href){var ye=oe[0].charAt(0);return{type:"text",raw:ye,text:ye}}var Le=ue(oe,le,oe[0]);return Le}},ce.strong=function(ie,ne,oe){oe===void 0&&(oe="");var le=this.rules.inline.strong.start.exec(ie);if(le&&(!le[1]||le[1]&&(oe===""||this.rules.inline.punctuation.exec(oe)))){ne=ne.slice(-1*ie.length);var ye=le[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;ye.lastIndex=0;for(var Le;(le=ye.exec(ne))!=null;)if(Le=this.rules.inline.strong.middle.exec(ne.slice(0,le.index+3)),Le)return{type:"strong",raw:ie.slice(0,Le[0].length),text:ie.slice(2,Le[0].length-2)}}},ce.em=function(ie,ne,oe){oe===void 0&&(oe="");var le=this.rules.inline.em.start.exec(ie);if(le&&(!le[1]||le[1]&&(oe===""||this.rules.inline.punctuation.exec(oe)))){ne=ne.slice(-1*ie.length);var ye=le[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;ye.lastIndex=0;for(var Le;(le=ye.exec(ne))!=null;)if(Le=this.rules.inline.em.middle.exec(ne.slice(0,le.index+2)),Le)return{type:"em",raw:ie.slice(0,Le[0].length),text:ie.slice(1,Le[0].length-1)}}},ce.codespan=function(ie){var ne=this.rules.inline.code.exec(ie);if(ne){var oe=ne[2].replace(/\n/g," "),le=/[^ ]/.test(oe),ye=oe.startsWith(" ")&&oe.endsWith(" ");return le&&ye&&(oe=oe.substring(1,oe.length-1)),oe=ee(oe,!0),{type:"codespan",raw:ne[0],text:oe}}},ce.br=function(ie){var ne=this.rules.inline.br.exec(ie);if(ne)return{type:"br",raw:ne[0]}},ce.del=function(ie){var ne=this.rules.inline.del.exec(ie);if(ne)return{type:"del",raw:ne[0],text:ne[1]}},ce.autolink=function(ie,ne){var oe=this.rules.inline.autolink.exec(ie);if(oe){var le,ye;return oe[2]==="@"?(le=ee(this.options.mangle?ne(oe[1]):oe[1]),ye="mailto:"+le):(le=ee(oe[1]),ye=le),{type:"link",raw:oe[0],text:le,href:ye,tokens:[{type:"text",raw:le,text:le}]}}},ce.url=function(ie,ne){var oe;if(oe=this.rules.inline.url.exec(ie)){var le,ye;if(oe[2]==="@")le=ee(this.options.mangle?ne(oe[0]):oe[0]),ye="mailto:"+le;else{var Le;do Le=oe[0],oe[0]=this.rules.inline._backpedal.exec(oe[0])[0];while(Le!==oe[0]);le=ee(oe[0]),oe[1]==="www."?ye="http://"+le:ye=le}return{type:"link",raw:oe[0],text:le,href:ye,tokens:[{type:"text",raw:le,text:le}]}}},ce.inlineText=function(ie,ne,oe){var le=this.rules.inline.text.exec(ie);if(le){var ye;return ne?ye=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(le[0]):ee(le[0]):le[0]:ye=ee(this.options.smartypants?oe(le[0]):le[0]),{type:"text",raw:le[0],text:ye}}},ve}(),xe=j.noopTest,Ce=j.edit,Oe=j.merge,pe={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:xe,table:xe,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};pe._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,pe._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,pe.def=Ce(pe.def).replace("label",pe._label).replace("title",pe._title).getRegex(),pe.bullet=/(?:[*+-]|\d{1,9}[.)])/,pe.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,pe.item=Ce(pe.item,"gm").replace(/bull/g,pe.bullet).getRegex(),pe.list=Ce(pe.list).replace(/bull/g,pe.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+pe.def.source+")").getRegex(),pe._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",pe._comment=/<!--(?!-?>)[\s\S]*?-->/,pe.html=Ce(pe.html,"i").replace("comment",pe._comment).replace("tag",pe._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),pe.paragraph=Ce(pe._paragraph).replace("hr",pe.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",pe._tag).getRegex(),pe.blockquote=Ce(pe.blockquote).replace("paragraph",pe.paragraph).getRegex(),pe.normal=Oe({},pe),pe.gfm=Oe({},pe.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*|$)"}),pe.gfm.nptable=Ce(pe.gfm.nptable).replace("hr",pe.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",pe._tag).getRegex(),pe.gfm.table=Ce(pe.gfm.table).replace("hr",pe.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",pe._tag).getRegex(),pe.pedantic=Oe({},pe.normal,{html:Ce(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",pe._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:xe,paragraph:Ce(pe.normal._paragraph).replace("hr",pe.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",pe.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var de={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:xe,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:xe,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};de._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",de.punctuation=Ce(de.punctuation).replace(/punctuation/g,de._punctuation).getRegex(),de._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",de._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",de.em.start=Ce(de.em.start).replace(/punctuation/g,de._punctuation).getRegex(),de.em.middle=Ce(de.em.middle).replace(/punctuation/g,de._punctuation).replace(/overlapSkip/g,de._overlapSkip).getRegex(),de.em.endAst=Ce(de.em.endAst,"g").replace(/punctuation/g,de._punctuation).getRegex(),de.em.endUnd=Ce(de.em.endUnd,"g").replace(/punctuation/g,de._punctuation).getRegex(),de.strong.start=Ce(de.strong.start).replace(/punctuation/g,de._punctuation).getRegex(),de.strong.middle=Ce(de.strong.middle).replace(/punctuation/g,de._punctuation).replace(/blockSkip/g,de._blockSkip).getRegex(),de.strong.endAst=Ce(de.strong.endAst,"g").replace(/punctuation/g,de._punctuation).getRegex(),de.strong.endUnd=Ce(de.strong.endUnd,"g").replace(/punctuation/g,de._punctuation).getRegex(),de.blockSkip=Ce(de._blockSkip,"g").getRegex(),de.overlapSkip=Ce(de._overlapSkip,"g").getRegex(),de._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,de._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,de._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])?)+(?![-_])/,de.autolink=Ce(de.autolink).replace("scheme",de._scheme).replace("email",de._email).getRegex(),de._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,de.tag=Ce(de.tag).replace("comment",pe._comment).replace("attribute",de._attribute).getRegex(),de._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,de._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,de._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,de.link=Ce(de.link).replace("label",de._label).replace("href",de._href).replace("title",de._title).getRegex(),de.reflink=Ce(de.reflink).replace("label",de._label).getRegex(),de.reflinkSearch=Ce(de.reflinkSearch,"g").replace("reflink",de.reflink).replace("nolink",de.nolink).getRegex(),de.normal=Oe({},de),de.pedantic=Oe({},de.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Ce(/^!?\[(label)\]\((.*?)\)/).replace("label",de._label).getRegex(),reflink:Ce(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",de._label).getRegex()}),de.gfm=Oe({},de.normal,{escape:Ce(de.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),de.gfm.url=Ce(de.gfm.url,"i").replace("email",de.gfm._extended_email).getRegex(),de.breaks=Oe({},de.gfm,{br:Ce(de.br).replace("{2,}","*").getRegex(),text:Ce(de.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var Me={block:pe,inline:de},tt=G.defaults,We=Me.block,rt=Me.inline;function st(ve){return ve.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 Pe(ve){var ce="",fe,ie,ne=ve.length;for(fe=0;fe<ne;fe++)ie=ve.charCodeAt(fe),Math.random()>.5&&(ie="x"+ie.toString(16)),ce+="&#"+ie+";";return ce}var je=function(){function ve(fe){this.tokens=[],this.tokens.links=Object.create(null),this.options=fe||tt,this.options.tokenizer=this.options.tokenizer||new Ee,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ie={block:We.normal,inline:rt.normal};this.options.pedantic?(ie.block=We.pedantic,ie.inline=rt.pedantic):this.options.gfm&&(ie.block=We.gfm,this.options.breaks?ie.inline=rt.breaks:ie.inline=rt.gfm),this.tokenizer.rules=ie}ve.lex=function(ie,ne){var oe=new ve(ne);return oe.lex(ie)};var ce=ve.prototype;return ce.lex=function(ie){return ie=ie.replace(/\r\n|\r/g,`
|
|
`).replace(/\t/g," "),this.blockTokens(ie,this.tokens,!0),this.inline(this.tokens),this.tokens},ce.blockTokens=function(ie,ne,oe){ne===void 0&&(ne=[]),oe===void 0&&(oe=!0),ie=ie.replace(/^ +$/gm,"");for(var le,ye,Le,Ne;ie;){if(le=this.tokenizer.space(ie)){ie=ie.substring(le.raw.length),le.type&&ne.push(le);continue}if(le=this.tokenizer.code(ie,ne)){ie=ie.substring(le.raw.length),le.type?ne.push(le):(Ne=ne[ne.length-1],Ne.raw+=`
|
|
`+le.raw,Ne.text+=`
|
|
`+le.text);continue}if(le=this.tokenizer.fences(ie)){ie=ie.substring(le.raw.length),ne.push(le);continue}if(le=this.tokenizer.heading(ie)){ie=ie.substring(le.raw.length),ne.push(le);continue}if(le=this.tokenizer.nptable(ie)){ie=ie.substring(le.raw.length),ne.push(le);continue}if(le=this.tokenizer.hr(ie)){ie=ie.substring(le.raw.length),ne.push(le);continue}if(le=this.tokenizer.blockquote(ie)){ie=ie.substring(le.raw.length),le.tokens=this.blockTokens(le.text,[],oe),ne.push(le);continue}if(le=this.tokenizer.list(ie)){for(ie=ie.substring(le.raw.length),Le=le.items.length,ye=0;ye<Le;ye++)le.items[ye].tokens=this.blockTokens(le.items[ye].text,[],!1);ne.push(le);continue}if(le=this.tokenizer.html(ie)){ie=ie.substring(le.raw.length),ne.push(le);continue}if(oe&&(le=this.tokenizer.def(ie))){ie=ie.substring(le.raw.length),this.tokens.links[le.tag]||(this.tokens.links[le.tag]={href:le.href,title:le.title});continue}if(le=this.tokenizer.table(ie)){ie=ie.substring(le.raw.length),ne.push(le);continue}if(le=this.tokenizer.lheading(ie)){ie=ie.substring(le.raw.length),ne.push(le);continue}if(oe&&(le=this.tokenizer.paragraph(ie))){ie=ie.substring(le.raw.length),ne.push(le);continue}if(le=this.tokenizer.text(ie,ne)){ie=ie.substring(le.raw.length),le.type?ne.push(le):(Ne=ne[ne.length-1],Ne.raw+=`
|
|
`+le.raw,Ne.text+=`
|
|
`+le.text);continue}if(ie){var Je="Infinite loop on byte: "+ie.charCodeAt(0);if(this.options.silent){console.error(Je);break}else throw new Error(Je)}}return ne},ce.inline=function(ie){var ne,oe,le,ye,Le,Ne,Je=ie.length;for(ne=0;ne<Je;ne++){Ne=ie[ne];switch(Ne.type){case"paragraph":case"text":case"heading":{Ne.tokens=[],this.inlineTokens(Ne.text,Ne.tokens);break}case"table":{for(Ne.tokens={header:[],cells:[]},ye=Ne.header.length,oe=0;oe<ye;oe++)Ne.tokens.header[oe]=[],this.inlineTokens(Ne.header[oe],Ne.tokens.header[oe]);for(ye=Ne.cells.length,oe=0;oe<ye;oe++)for(Le=Ne.cells[oe],Ne.tokens.cells[oe]=[],le=0;le<Le.length;le++)Ne.tokens.cells[oe][le]=[],this.inlineTokens(Le[le],Ne.tokens.cells[oe][le]);break}case"blockquote":{this.inline(Ne.tokens);break}case"list":{for(ye=Ne.items.length,oe=0;oe<ye;oe++)this.inline(Ne.items[oe].tokens);break}}}return ie},ce.inlineTokens=function(ie,ne,oe,le,ye){ne===void 0&&(ne=[]),oe===void 0&&(oe=!1),le===void 0&&(le=!1),ye===void 0&&(ye="");var Le,Ne=ie,Je;if(this.tokens.links){var mt=Object.keys(this.tokens.links);if(mt.length>0)for(;(Je=this.tokenizer.rules.inline.reflinkSearch.exec(Ne))!=null;)mt.includes(Je[0].slice(Je[0].lastIndexOf("[")+1,-1))&&(Ne=Ne.slice(0,Je.index)+"["+"a".repeat(Je[0].length-2)+"]"+Ne.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Je=this.tokenizer.rules.inline.blockSkip.exec(Ne))!=null;)Ne=Ne.slice(0,Je.index)+"["+"a".repeat(Je[0].length-2)+"]"+Ne.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;ie;){if(Le=this.tokenizer.escape(ie)){ie=ie.substring(Le.raw.length),ne.push(Le);continue}if(Le=this.tokenizer.tag(ie,oe,le)){ie=ie.substring(Le.raw.length),oe=Le.inLink,le=Le.inRawBlock,ne.push(Le);continue}if(Le=this.tokenizer.link(ie)){ie=ie.substring(Le.raw.length),Le.type==="link"&&(Le.tokens=this.inlineTokens(Le.text,[],!0,le)),ne.push(Le);continue}if(Le=this.tokenizer.reflink(ie,this.tokens.links)){ie=ie.substring(Le.raw.length),Le.type==="link"&&(Le.tokens=this.inlineTokens(Le.text,[],!0,le)),ne.push(Le);continue}if(Le=this.tokenizer.strong(ie,Ne,ye)){ie=ie.substring(Le.raw.length),Le.tokens=this.inlineTokens(Le.text,[],oe,le),ne.push(Le);continue}if(Le=this.tokenizer.em(ie,Ne,ye)){ie=ie.substring(Le.raw.length),Le.tokens=this.inlineTokens(Le.text,[],oe,le),ne.push(Le);continue}if(Le=this.tokenizer.codespan(ie)){ie=ie.substring(Le.raw.length),ne.push(Le);continue}if(Le=this.tokenizer.br(ie)){ie=ie.substring(Le.raw.length),ne.push(Le);continue}if(Le=this.tokenizer.del(ie)){ie=ie.substring(Le.raw.length),Le.tokens=this.inlineTokens(Le.text,[],oe,le),ne.push(Le);continue}if(Le=this.tokenizer.autolink(ie,Pe)){ie=ie.substring(Le.raw.length),ne.push(Le);continue}if(!oe&&(Le=this.tokenizer.url(ie,Pe))){ie=ie.substring(Le.raw.length),ne.push(Le);continue}if(Le=this.tokenizer.inlineText(ie,le,st)){ie=ie.substring(Le.raw.length),ye=Le.raw.slice(-1),ne.push(Le);continue}if(ie){var ft="Infinite loop on byte: "+ie.charCodeAt(0);if(this.options.silent){console.error(ft);break}else throw new Error(ft)}}return ne},$(ve,null,[{key:"rules",get:function(){return{block:We,inline:rt}}}]),ve}(),Ze=G.defaults,se=j.cleanUrl,_e=j.escape,Te=function(){function ve(fe){this.options=fe||Ze}var ce=ve.prototype;return ce.code=function(ie,ne,oe){var le=(ne||"").match(/\S*/)[0];if(this.options.highlight){var ye=this.options.highlight(ie,le);ye!=null&&ye!==ie&&(oe=!0,ie=ye)}return le?'<pre><code class="'+this.options.langPrefix+_e(le,!0)+'">'+(oe?ie:_e(ie,!0))+`</code></pre>
|
|
`:"<pre><code>"+(oe?ie:_e(ie,!0))+`</code></pre>
|
|
`},ce.blockquote=function(ie){return`<blockquote>
|
|
`+ie+`</blockquote>
|
|
`},ce.html=function(ie){return ie},ce.heading=function(ie,ne,oe,le){return this.options.headerIds?"<h"+ne+' id="'+this.options.headerPrefix+le.slug(oe)+'">'+ie+"</h"+ne+`>
|
|
`:"<h"+ne+">"+ie+"</h"+ne+`>
|
|
`},ce.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},ce.list=function(ie,ne,oe){var le=ne?"ol":"ul",ye=ne&&oe!==1?' start="'+oe+'"':"";return"<"+le+ye+`>
|
|
`+ie+"</"+le+`>
|
|
`},ce.listitem=function(ie){return"<li>"+ie+`</li>
|
|
`},ce.checkbox=function(ie){return"<input "+(ie?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},ce.paragraph=function(ie){return"<p>"+ie+`</p>
|
|
`},ce.table=function(ie,ne){return ne&&(ne="<tbody>"+ne+"</tbody>"),`<table>
|
|
<thead>
|
|
`+ie+`</thead>
|
|
`+ne+`</table>
|
|
`},ce.tablerow=function(ie){return`<tr>
|
|
`+ie+`</tr>
|
|
`},ce.tablecell=function(ie,ne){var oe=ne.header?"th":"td",le=ne.align?"<"+oe+' align="'+ne.align+'">':"<"+oe+">";return le+ie+"</"+oe+`>
|
|
`},ce.strong=function(ie){return"<strong>"+ie+"</strong>"},ce.em=function(ie){return"<em>"+ie+"</em>"},ce.codespan=function(ie){return"<code>"+ie+"</code>"},ce.br=function(){return this.options.xhtml?"<br/>":"<br>"},ce.del=function(ie){return"<del>"+ie+"</del>"},ce.link=function(ie,ne,oe){if(ie=se(this.options.sanitize,this.options.baseUrl,ie),ie===null)return oe;var le='<a href="'+_e(ie)+'"';return ne&&(le+=' title="'+ne+'"'),le+=">"+oe+"</a>",le},ce.image=function(ie,ne,oe){if(ie=se(this.options.sanitize,this.options.baseUrl,ie),ie===null)return oe;var le='<img src="'+ie+'" alt="'+oe+'"';return ne&&(le+=' title="'+ne+'"'),le+=this.options.xhtml?"/>":">",le},ce.text=function(ie){return ie},ve}(),Ae=function(){function ve(){}var ce=ve.prototype;return ce.strong=function(ie){return ie},ce.em=function(ie){return ie},ce.codespan=function(ie){return ie},ce.del=function(ie){return ie},ce.html=function(ie){return ie},ce.text=function(ie){return ie},ce.link=function(ie,ne,oe){return""+oe},ce.image=function(ie,ne,oe){return""+oe},ce.br=function(){return""},ve}(),ze=function(){function ve(){this.seen={}}var ce=ve.prototype;return ce.slug=function(ie){var ne=ie.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(ne)){var oe=ne;do this.seen[oe]++,ne=oe+"-"+this.seen[oe];while(this.seen.hasOwnProperty(ne))}return this.seen[ne]=0,ne},ve}(),Be=G.defaults,Ue=j.unescape,Ve=function(){function ve(fe){this.options=fe||Be,this.options.renderer=this.options.renderer||new Te,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ae,this.slugger=new ze}ve.parse=function(ie,ne){var oe=new ve(ne);return oe.parse(ie)};var ce=ve.prototype;return ce.parse=function(ie,ne){ne===void 0&&(ne=!0);var oe="",le,ye,Le,Ne,Je,mt,ft,Ct,xt,Qe,Lt,vt,Ft,Pt,Rt,mn,sn,bt,tn=ie.length;for(le=0;le<tn;le++){Qe=ie[le];switch(Qe.type){case"space":continue;case"hr":{oe+=this.renderer.hr();continue}case"heading":{oe+=this.renderer.heading(this.parseInline(Qe.tokens),Qe.depth,Ue(this.parseInline(Qe.tokens,this.textRenderer)),this.slugger);continue}case"code":{oe+=this.renderer.code(Qe.text,Qe.lang,Qe.escaped);continue}case"table":{for(Ct="",ft="",Ne=Qe.header.length,ye=0;ye<Ne;ye++)ft+=this.renderer.tablecell(this.parseInline(Qe.tokens.header[ye]),{header:!0,align:Qe.align[ye]});for(Ct+=this.renderer.tablerow(ft),xt="",Ne=Qe.cells.length,ye=0;ye<Ne;ye++){for(mt=Qe.tokens.cells[ye],ft="",Je=mt.length,Le=0;Le<Je;Le++)ft+=this.renderer.tablecell(this.parseInline(mt[Le]),{header:!1,align:Qe.align[Le]});xt+=this.renderer.tablerow(ft)}oe+=this.renderer.table(Ct,xt);continue}case"blockquote":{xt=this.parse(Qe.tokens),oe+=this.renderer.blockquote(xt);continue}case"list":{for(Lt=Qe.ordered,vt=Qe.start,Ft=Qe.loose,Ne=Qe.items.length,xt="",ye=0;ye<Ne;ye++)Rt=Qe.items[ye],mn=Rt.checked,sn=Rt.task,Pt="",Rt.task&&(bt=this.renderer.checkbox(mn),Ft?Rt.tokens.length>0&&Rt.tokens[0].type==="text"?(Rt.tokens[0].text=bt+" "+Rt.tokens[0].text,Rt.tokens[0].tokens&&Rt.tokens[0].tokens.length>0&&Rt.tokens[0].tokens[0].type==="text"&&(Rt.tokens[0].tokens[0].text=bt+" "+Rt.tokens[0].tokens[0].text)):Rt.tokens.unshift({type:"text",text:bt}):Pt+=bt),Pt+=this.parse(Rt.tokens,Ft),xt+=this.renderer.listitem(Pt,sn,mn);oe+=this.renderer.list(xt,Lt,vt);continue}case"html":{oe+=this.renderer.html(Qe.text);continue}case"paragraph":{oe+=this.renderer.paragraph(this.parseInline(Qe.tokens));continue}case"text":{for(xt=Qe.tokens?this.parseInline(Qe.tokens):Qe.text;le+1<tn&&ie[le+1].type==="text";)Qe=ie[++le],xt+=`
|
|
`+(Qe.tokens?this.parseInline(Qe.tokens):Qe.text);oe+=ne?this.renderer.paragraph(xt):xt;continue}default:{var _t='Token with "'+Qe.type+'" type was not found.';if(this.options.silent){console.error(_t);return}else throw new Error(_t)}}}return oe},ce.parseInline=function(ie,ne){ne=ne||this.renderer;var oe="",le,ye,Le=ie.length;for(le=0;le<Le;le++){ye=ie[le];switch(ye.type){case"escape":{oe+=ne.text(ye.text);break}case"html":{oe+=ne.html(ye.text);break}case"link":{oe+=ne.link(ye.href,ye.title,this.parseInline(ye.tokens,ne));break}case"image":{oe+=ne.image(ye.href,ye.title,ye.text);break}case"strong":{oe+=ne.strong(this.parseInline(ye.tokens,ne));break}case"em":{oe+=ne.em(this.parseInline(ye.tokens,ne));break}case"codespan":{oe+=ne.codespan(ye.text);break}case"br":{oe+=ne.br();break}case"del":{oe+=ne.del(this.parseInline(ye.tokens,ne));break}case"text":{oe+=ne.text(ye.text);break}default:{var Ne='Token with "'+ye.type+'" type was not found.';if(this.options.silent){console.error(Ne);return}else throw new Error(Ne)}}}return oe},ve}(),$e=j.merge,Xe=j.checkSanitizeDeprecation,et=j.escape,Ie=G.getDefaults,nt=G.changeDefaults,at=G.defaults;function De(ve,ce,fe){if(typeof ve=="undefined"||ve===null)throw new Error("marked(): input parameter is undefined or null");if(typeof ve!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(ve)+", string expected");if(typeof ce=="function"&&(fe=ce,ce=null),ce=$e({},De.defaults,ce||{}),Xe(ce),fe){var ie=ce.highlight,ne;try{ne=je.lex(ve,ce)}catch(Le){return fe(Le)}var oe=function(Ne){var Je;if(!Ne)try{Je=Ve.parse(ne,ce)}catch(mt){Ne=mt}return ce.highlight=ie,Ne?fe(Ne):fe(null,Je)};if(!ie||ie.length<3)return oe();if(delete ce.highlight,!ne.length)return oe();var le=0;De.walkTokens(ne,function(Le){Le.type==="code"&&(le++,setTimeout(function(){ie(Le.text,Le.lang,function(Ne,Je){if(Ne)return oe(Ne);Je!=null&&Je!==Le.text&&(Le.text=Je,Le.escaped=!0),le--,le===0&&oe()})},0))}),le===0&&oe();return}try{var ye=je.lex(ve,ce);return ce.walkTokens&&De.walkTokens(ye,ce.walkTokens),Ve.parse(ye,ce)}catch(Le){if(Le.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,ce.silent)return"<p>An error occurred:</p><pre>"+et(Le.message+"",!0)+"</pre>";throw Le}}De.options=De.setOptions=function(ve){return $e(De.defaults,ve),nt(De.defaults),De},De.getDefaults=Ie,De.defaults=at,De.use=function(ve){var ce=$e({},ve);if(ve.renderer&&function(){var ie=De.defaults.renderer||new Te,ne=function(ye){var Le=ie[ye];ie[ye]=function(){for(var Ne=arguments.length,Je=new Array(Ne),mt=0;mt<Ne;mt++)Je[mt]=arguments[mt];var ft=ve.renderer[ye].apply(ie,Je);return ft===!1&&(ft=Le.apply(ie,Je)),ft}};for(var oe in ve.renderer)ne(oe);ce.renderer=ie}(),ve.tokenizer&&function(){var ie=De.defaults.tokenizer||new Ee,ne=function(ye){var Le=ie[ye];ie[ye]=function(){for(var Ne=arguments.length,Je=new Array(Ne),mt=0;mt<Ne;mt++)Je[mt]=arguments[mt];var ft=ve.tokenizer[ye].apply(ie,Je);return ft===!1&&(ft=Le.apply(ie,Je)),ft}};for(var oe in ve.tokenizer)ne(oe);ce.tokenizer=ie}(),ve.walkTokens){var fe=De.defaults.walkTokens;ce.walkTokens=function(ie){ve.walkTokens(ie),fe&&fe(ie)}}De.setOptions(ce)},De.walkTokens=function(ve,ce){for(var fe=U(ve),ie;!(ie=fe()).done;){var ne=ie.value;ce(ne);switch(ne.type){case"table":{for(var oe=U(ne.tokens.header),le;!(le=oe()).done;){var ye=le.value;De.walkTokens(ye,ce)}for(var Le=U(ne.tokens.cells),Ne;!(Ne=Le()).done;)for(var Je=Ne.value,mt=U(Je),ft;!(ft=mt()).done;){var Ct=ft.value;De.walkTokens(Ct,ce)}break}case"list":{De.walkTokens(ne.items,ce);break}default:ne.tokens&&De.walkTokens(ne.tokens,ce)}}},De.Parser=Ve,De.parser=Ve.parse,De.Renderer=Te,De.TextRenderer=Ae,De.Lexer=je,De.lexer=je.lex,De.Tokenizer=Ee,De.Slugger=ze,De.parse=De;var ke=De;return ke})},ELLl:function(ht,be,Z){(function(re){re(Z("VrN/"))})(function(re){var $={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},P=re.Pos;re.defineOption("autoCloseBrackets",!1,function(o,c,l){l&&l!=re.Init&&(o.removeKeyMap(U),o.state.closeBrackets=null),c&&(k(X(c,"pairs")),o.state.closeBrackets=c,o.addKeyMap(U))});function X(o,c){return c=="pairs"&&typeof o=="string"?o:typeof o=="object"&&o[c]!=null?o[c]:$[c]}var U={Backspace:n,Enter:D};function k(o){for(var c=0;c<o.length;c++){var l=o.charAt(c),u="'"+l+"'";U[u]||(U[u]=G(l))}}k($.pairs+"`");function G(o){return function(c){return p(c,o)}}function H(o){var c=o.state.closeBrackets;if(!c||c.override)return c;var l=o.getModeAt(o.getCursor());return l.closeBrackets||c}function n(o){var c=H(o);if(!c||o.getOption("disableInput"))return re.Pass;for(var l=X(c,"pairs"),u=o.listSelections(),s=0;s<u.length;s++){if(!u[s].empty())return re.Pass;var a=m(o,u[s].head);if(!a||l.indexOf(a)%2!=0)return re.Pass}for(var s=u.length-1;s>=0;s--){var A=u[s].head;o.replaceRange("",P(A.line,A.ch-1),P(A.line,A.ch+1),"+delete")}}function D(o){var c=H(o),l=c&&X(c,"explode");if(!l||o.getOption("disableInput"))return re.Pass;for(var u=o.listSelections(),s=0;s<u.length;s++){if(!u[s].empty())return re.Pass;var a=m(o,u[s].head);if(!a||l.indexOf(a)%2!=0)return re.Pass}o.operation(function(){var A=o.lineSeparator()||`
|
|
`;o.replaceSelection(A+A,null),o.execCommand("goCharLeft"),u=o.listSelections();for(var E=0;E<u.length;E++){var S=u[E].head.line;o.indentLine(S,null,!0),o.indentLine(S+1,null,!0)}})}function g(o){var c=re.cmpPos(o.anchor,o.head)>0;return{anchor:new P(o.anchor.line,o.anchor.ch+(c?-1:1)),head:new P(o.head.line,o.head.ch+(c?1:-1))}}function p(o,c){var l=H(o);if(!l||o.getOption("disableInput"))return re.Pass;var u=X(l,"pairs"),s=u.indexOf(c);if(s==-1)return re.Pass;for(var a=X(l,"closeBefore"),A=X(l,"triples"),E=u.charAt(s+1)==c,S=o.listSelections(),L=s%2==0,O,C=0;C<S.length;C++){var T=S[C],x=T.head,f,w=o.getRange(x,P(x.line,x.ch+1));if(L&&!T.empty())f="surround";else if((E||!L)&&w==c)E&&h(o,x)?f="both":A.indexOf(c)>=0&&o.getRange(x,P(x.line,x.ch+3))==c+c+c?f="skipThree":f="skip";else if(E&&x.ch>1&&A.indexOf(c)>=0&&o.getRange(P(x.line,x.ch-2),x)==c+c){if(x.ch>2&&/\bstring/.test(o.getTokenTypeAt(P(x.line,x.ch-2))))return re.Pass;f="addFour"}else if(E){var v=x.ch==0?" ":o.getRange(P(x.line,x.ch-1),x);if(!re.isWordChar(w)&&v!=c&&!re.isWordChar(v))f="both";else return re.Pass}else if(L&&(w.length===0||/\s/.test(w)||a.indexOf(w)>-1))f="both";else return re.Pass;if(!O)O=f;else if(O!=f)return re.Pass}var b=s%2?u.charAt(s-1):c,F=s%2?c:u.charAt(s+1);o.operation(function(){if(O=="skip")o.execCommand("goCharRight");else if(O=="skipThree")for(var B=0;B<3;B++)o.execCommand("goCharRight");else if(O=="surround"){for(var R=o.getSelections(),B=0;B<R.length;B++)R[B]=b+R[B]+F;o.replaceSelections(R,"around"),R=o.listSelections().slice();for(var B=0;B<R.length;B++)R[B]=g(R[B]);o.setSelections(R)}else O=="both"?(o.replaceSelection(b+F,null),o.triggerElectric(b+F),o.execCommand("goCharLeft")):O=="addFour"&&(o.replaceSelection(b+b+b+b,"before"),o.execCommand("goCharRight"))})}function m(o,c){var l=o.getRange(P(c.line,c.ch-1),P(c.line,c.ch+1));return l.length==2?l:null}function h(o,c){var l=o.getTokenAt(P(c.line,c.ch+1));return/\bstring/.test(l.type)&&l.start==c.ch&&(c.ch==0||!/\bstring/.test(o.getTokenTypeAt(c)))}})},FWmy:function(ht,be,Z){"use strict";Z.d(be,"a",function(){return re});function re($,P){if(!$)throw new Error(P?`Assertion failed (${P})`:"Assertion Failed")}},G8my:function(ht,be,Z){ht.exports={flex:"flex___1FMOA"}},HmJG:function(ht,be,Z){},JYp7:function(ht,be,Z){"use strict";Z.d(be,"a",function(){return re});var re;(function($){function P(a){return a&&typeof a=="object"&&typeof a[Symbol.iterator]=="function"}$.is=P;const X=Object.freeze([]);function U(){return X}$.empty=U;function*k(a){yield a}$.single=k;function G(a){return a||X}$.from=G;function H(a){return!a||a[Symbol.iterator]().next().done===!0}$.isEmpty=H;function n(a){return a[Symbol.iterator]().next().value}$.first=n;function D(a,A){for(const E of a)if(A(E))return!0;return!1}$.some=D;function g(a,A){for(const E of a)if(A(E))return E;return}$.find=g;function*p(a,A){for(const E of a)A(E)&&(yield E)}$.filter=p;function*m(a,A){let E=0;for(const S of a)yield A(S,E++)}$.map=m;function*h(...a){for(const A of a)for(const E of A)yield E}$.concat=h;function*o(a){for(const A of a)for(const E of A)yield E}$.concatNested=o;function c(a,A,E){let S=E;for(const L of a)S=A(S,L);return S}$.reduce=c;function*l(a,A,E=a.length){for(A<0&&(A+=a.length),E<0?E+=a.length:E>a.length&&(E=a.length);A<E;A++)yield a[A]}$.slice=l;function u(a,A=Number.POSITIVE_INFINITY){const E=[];if(A===0)return[E,a];const S=a[Symbol.iterator]();for(let L=0;L<A;L++){const O=S.next();if(O.done)return[E,$.empty()];E.push(O.value)}return[E,{[Symbol.iterator](){return S}}]}$.consume=u;function s(a,A,E=(S,L)=>S===L){const S=a[Symbol.iterator](),L=A[Symbol.iterator]();for(;;){const O=S.next(),C=L.next();if(O.done!==C.done)return!1;if(O.done)return!0;if(!E(O.value,C.value))return!1}}$.equals=s})(re||(re={}))},JkjM:function(ht,be,Z){"use strict";Z.r(be);var re=Z("9og8"),$=Z("PpiC"),P=Z("WmNS"),X=Z.n(P),U=Z("q1tI"),k=Z.n(U),G=Z("Ty5D"),H=Z("9kvl"),n=Z("14J3"),D=Z("BMrR"),g=Z("jCWc"),p=Z("kPKH"),m=Z("+L6B"),h=Z("2/Rp"),o=Z("k1fw"),c=Z("m3rI"),l=Z("LO5M"),u=Z.n(l),s=Z("h+Ho"),a=function(Ue){var Ve,$e,Xe,et,Ie=Ue.user,nt=Ue.forumsDetail,at=Ue.globalSetting,De=Ue.loading,ke=Ue.dispatch,ve=Object($.a)(Ue,["user","forumsDetail","globalSetting","loading","dispatch"]),ce=nt.forumsDetailData||{},fe=ce.author_info,ie=ce.memo,ne=ce.recommend_shixuns,oe=function(){var le=Object(re.a)(X.a.mark(function ye(){var Le;return X.a.wrap(function(Je){for(;;)switch(Je.prev=Je.next){case 0:if(!(fe!=null&&fe.watched)){Je.next=6;break}return Je.next=3,Object(s.a)({user_id:fe.user_id});case 3:Je.t0=Je.sent,Je.next=9;break;case 6:return Je.next=8,Object(s.o)({user_id:fe.user_id});case 8:Je.t0=Je.sent;case 9:Le=Je.t0,Le&&ke({type:"forumsDetail/setForumsDetailData",payload:Object(o.a)(Object(o.a)({},nt.forumsDetailData),{},{author_info:Object(o.a)(Object(o.a)({},fe),{},{watched:!(fe!=null&&fe.watched)})})});case 11:case"end":return Je.stop()}},ye)}));return function(){return le.apply(this,arguments)}}();return k.a.createElement("section",{className:u.a.wrap},k.a.createElement("aside",{className:"ml20"},k.a.createElement("div",{className:"bg-white pt40 pb40 pl20 pr20 ".concat(u.a.head)},k.a.createElement("a",{href:"/users/".concat(fe==null?void 0:fe.login),target:"_blank"},(fe==null?void 0:fe.image_url)&&k.a.createElement("img",{src:"".concat(c.a.API_SERVER,"/images/").concat(fe==null?void 0:fe.image_url)})),k.a.createElement("div",{className:"tc font20"},fe==null?void 0:fe.username),k.a.createElement("div",{className:"tc c-grey-999"},fe==null?void 0:fe.identity),((Ve=Ie.userInfo)===null||Ve===void 0?void 0:Ve.user_id)!==(fe==null?void 0:fe.user_id)&&k.a.createElement(D.a,{justify:"center",className:"mt30 ".concat(u.a.buttonWrap)},k.a.createElement(p.a,null,k.a.createElement(h.a,{type:"primary",className:"mr10",onClick:oe},fe!=null&&fe.watched?"\u53D6\u6D88\u5173\u6CE8":"\u5173\u6CE8")),k.a.createElement(p.a,null,k.a.createElement(h.a,{ghost:!0,className:u.a.privateMessage,href:"/messages/".concat(($e=Ie.userInfo)===null||$e===void 0?void 0:$e.login,"/message_detail?target_ids=").concat(fe==null?void 0:fe.user_id),target:"_blank"},"\u79C1\u4FE1")))),!!(ie!=null&&(Xe=ie.tag)!==null&&Xe!==void 0&&Xe.length)&&k.a.createElement("div",{className:"bg-white mt10 pt40 pb40 pl20 pr20"},k.a.createElement("div",{className:"font16"},"\u8BDD\u9898\u6807\u7B7E"),k.a.createElement("div",{className:"mt30 ".concat(u.a.tag)},ie==null||((et=ie.tag)===null||et===void 0)?void 0:et.map(function(le){return k.a.createElement("a",null,le==null?void 0:le.name)}))),k.a.createElement("div",{className:"pt10 pb10 pl10 pr10"},k.a.createElement("div",{className:"font16 mb20"},"\u63A8\u8350\u5B9E\u8BAD"),k.a.createElement("div",{className:u.a.recommend},ne==null?void 0:ne.map(function(le){return k.a.createElement("div",{className:u.a.recommendItem},k.a.createElement("a",{href:"/shixuns/".concat(le.identifier,"/challenges"),target:"_blank"},k.a.createElement("img",{alt:le.id,src:"".concat(c.a.API_SERVER,"/").concat(le.image_url)})),k.a.createElement("div",{className:"".concat(u.a.flex1," ml10")},k.a.createElement("a",{href:"/shixuns/".concat(le.identifier,"/challenges"),target:"_blank",title:le.name,className:"".concat(u.a.mWidth147," multi-llipsis1e c-grey-666 mb10")},le.name),k.a.createElement("div",{className:"c-grey-999"},le.myshixuns_count," \u4EBA\u5B66\u4E60")))})))))},A=Object(H.a)(function(Be){var Ue=Be.user,Ve=Be.forumsDetail,$e=Be.loading,Xe=Be.globalSetting;return{user:Ue,forumsDetail:Ve,globalSetting:Xe,loading:$e.models.forumsDetail}})(a),E=Z("qVdP"),S=Z("jsC+"),L=Z("5Dmo"),O=Z("3S7+"),C=Z("sPJy"),T=Z("bE4q"),x=Z("lUTK"),f=Z("BvKs"),w=Z("5NDa"),v=Z("5rEg"),b=Z("2qtc"),F=Z("kLXV"),B=Z("miYZ"),R=Z("tsqr"),j=Z("55Ip"),N=Z("wd/R"),y=Z.n(N),Y=Z("9Bee"),ee=Z("oBTY"),ae=Z("tJVT"),ue=Z("Ot1p"),Re=Z("/MfK"),Ee=Z("8JLL"),xe=Z.n(Ee);y.a.lang("ZH-cn");function Ce(Be){var Ue=Be.user,Ve=Be.vlist,$e=Ve===void 0?[]:Ve,Xe=Be.dispatch,et=Be.params,Ie=Be.id,nt=Be.memo_replies,at=Be.forumsDetail;return k.a.createElement("aside",{className:xe.a.comment},$e.map(function(De,ke){var ve,ce;return k.a.createElement(D.a,{key:ke,className:xe.a.commentItem},k.a.createElement(p.a,{span:24},k.a.createElement(D.a,null,k.a.createElement(p.a,{flex:"1"},k.a.createElement("a",{href:"/users/".concat(De.user_login),target:"_blank",className:"c-light-black"},De==null?void 0:De.username),k.a.createElement("span",{className:"c-light-black ml10"},De.time)),(De.can_delete||De.user_id===((ve=Ue.userInfo)===null||ve===void 0?void 0:ve.user_id)||De.user_login===((ce=Ue.userInfo)===null||ce===void 0?void 0:ce.login))&&k.a.createElement(p.a,{className:"forums-comment-delete",style:{display:"none"}},k.a.createElement(O.a,{title:"\u5220\u9664"},k.a.createElement(Re.a,{className:"current",onClick:function(){F.a.confirm({centered:!0,width:530,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:k.a.createElement("div",{className:"font16 tc"},"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417\uFF1F"),onOk:function(){var ie=Object(re.a)(X.a.mark(function oe(){var le,ye;return X.a.wrap(function(Ne){for(;;)switch(Ne.prev=Ne.next){case 0:return Ne.next=2,Object(s.b)({id:De.id});case 2:le=Ne.sent,ye=nt.find(function(Je){return Je.id===Ie}).children.filter(function(Je){return Je.id!==De.id}),nt.find(function(Je){return Je.id===Ie}).children=ye,Xe({type:"forumsDetail/setForumsDetailData",payload:Object(o.a)(Object(o.a)({},at.forumsDetailData),{},{memo_replies:Object(ee.a)(nt)})});case 6:case"end":return Ne.stop()}},oe)}));function ne(){return ie.apply(this,arguments)}return ne}()})}}))))),k.a.createElement(p.a,null,k.a.createElement(Y.a,{value:De.content})))}))}var Oe=Ce,pe=Z("1vsH");y.a.lang("ZH-cn");var de=function(Ue,Ve){var $e=Ue.user,Xe=Ue.forumsDetail,et=Ue.globalSetting,Ie=Ue.loading,nt=Ue.dispatch,at=Ue.handleClick,De=Object($.a)(Ue,["user","forumsDetail","globalSetting","loading","dispatch","handleClick"]),ke=Xe.forumsDetailData||{},ve=ke.memo,ce=ke.memo_replies,fe=Object(G.i)(),ie=Object(U.useState)(""),ne=Object(ae.a)(ie,2),oe=ne[0],le=ne[1],ye=Object(U.useState)(""),Le=Object(ae.a)(ye,2),Ne=Le[0],Je=Le[1],mt=Object(U.useState)(-1),ft=Object(ae.a)(mt,2),Ct=ft[0],xt=ft[1],Qe=Object(U.useState)(!1),Lt=Object(ae.a)(Qe,2),vt=Lt[0],Ft=Lt[1],Pt=Object(U.useState)(1),Rt=Object(ae.a)(Pt,2),mn=Rt[0],sn=Rt[1],bt=Object(U.useState)(!1),tn=Object(ae.a)(bt,2),_t=tn[0],Tt=tn[1];Object(U.useImperativeHandle)(Ve,function(){return{onMdFouch:hn}}),Object(U.useEffect)(function(){Ft((ve==null?void 0:ve.replies_count)>10)},[ve==null?void 0:ve.replies_count]);var Wt=function(){var dt=Object(re.a)(X.a.mark(function ut(){var qt,Ot,Mt;return X.a.wrap(function(Ut){for(;;)switch(Ut.prev=Ut.next){case 0:return qt=mn+1,sn(qt),Ut.next=4,Object(s.h)({id:fe.memoId,page:qt});case 4:Ot=Ut.sent,Ot!=null&&Ot.memo_replies&&(nt({type:"forumsDetail/setForumsDetailData",payload:Object(o.a)(Object(o.a)({},Xe.forumsDetailData),{},{memo_replies:[].concat(Object(ee.a)(ce),Object(ee.a)(Ot.memo_replies))})}),Ft(((Mt=Ot.memo_replies)===null||Mt===void 0?void 0:Mt.length)===10));case 6:case"end":return Ut.stop()}},ut)}));return function(){return dt.apply(this,arguments)}}(),nn=function(ut){var qt,Ot,Mt,Dt;return Object(o.a)(Object(o.a)({},ut),{},{image_url:(qt=$e.userInfo)===null||qt===void 0?void 0:qt.image_url,children:[],user_id:(Ot=$e.userInfo)===null||Ot===void 0?void 0:Ot.user_id,user_login:(Mt=$e.userInfo)===null||Mt===void 0?void 0:Mt.login,username:(Dt=$e.userInfo)===null||Dt===void 0?void 0:Dt.username,time:"".concat(Object(pe.bb)((new Date().getTime()-new Date(ut.created_at).getTime())/1e3),"\u524D")})},hn=function(){Tt(!0)};return k.a.createElement("section",{className:xe.a.wrap},!!(ce!=null&&ce.length)&&k.a.createElement("aside",{className:xe.a.content},k.a.createElement("div",{style:{padding:"10px 15px 5px 15px",justifyContent:"space-between",display:"flex"}},k.a.createElement("span",null,"\u5168\u90E8\u56DE\u590D\uFF08",ve.replies_count,"\uFF09")),k.a.createElement("aside",{className:xe.a.replyList},ce==null?void 0:ce.map(function(dt,ut){var qt;return k.a.createElement(D.a,{gutter:[12,12],key:ut},k.a.createElement(p.a,{flex:"40px"},k.a.createElement("a",{href:"/users/".concat(dt.user_login),target:"_blank"},k.a.createElement("img",{alt:"\u7528\u6237\u5934\u50CF",width:"50",height:"50",src:"".concat(c.a.IMG_SERVER,"/images/").concat(dt==null?void 0:dt.image_url)}))),k.a.createElement(p.a,{flex:"1"},k.a.createElement(D.a,{align:"middle"},k.a.createElement(p.a,{span:24},k.a.createElement("a",{href:"/users/".concat(dt.user_login),target:"_blank"},k.a.createElement("span",{className:"c-light-black"},dt==null?void 0:dt.username)),k.a.createElement("span",{className:"c-light-black ml10"},dt.time)),k.a.createElement(p.a,{span:24},k.a.createElement("div",{onClick:at},k.a.createElement(Y.a,{value:dt.content}))),!!(dt!=null&&(qt=dt.children)!==null&&qt!==void 0&&qt.length)&&k.a.createElement(Oe,{user:$e,id:dt==null?void 0:dt.id,vlist:dt==null?void 0:dt.children,dispatch:nt,params:fe,memo_replies:ce,forumsDetail:Xe}),k.a.createElement(p.a,{span:24,className:"mt5 c-light-black"},Ct===ut?k.a.createElement("aside",null,k.a.createElement(ue.a,{onChange:function(Mt){Je(Mt)},height:150,isFocus:!0,placeholder:"\u6211\u8981\u56DE\u590D..."}),k.a.createElement(D.a,null,k.a.createElement(p.a,{span:24,className:"tr"},k.a.createElement(h.a,{type:"primary",size:"large",onClick:Object(re.a)(X.a.mark(function Ot(){var Mt;return X.a.wrap(function(Ut){for(;;)switch(Ut.prev=Ut.next){case 0:if(!(Ne==="")){Ut.next=4;break}R.b.error("\u8BF7\u8F93\u5165\u5185\u5BB9"),Ut.next=9;break;case 4:return Ut.next=6,Object(s.k)({parent_id:dt.id,content:Ne});case 6:Mt=Ut.sent,Je(null),Mt&&(xt(-1),ce.find(function(dn){return dn.id===Mt.parent_id}).children.push(nn(Mt)),nt({type:"forumsDetail/setForumsDetailData",payload:Object(o.a)(Object(o.a)({},Xe.forumsDetailData),{},{memo:Object(o.a)(Object(o.a)({},ve),{},{replies_count:ve.replies_count+1}),memo_replies:Object(ee.a)(ce)})}));case 9:case"end":return Ut.stop()}},Ot)}))},"\u53D1\u9001")))):k.a.createElement("div",{className:"tr"},k.a.createElement("span",{className:"iconfont icon-huifu1 mr15 ml30 current",onClick:function(){return xt(ut)}}),k.a.createElement(O.a,{title:dt.user_praise?"\u53D6\u6D88\u70B9\u8D5E":"\u70B9\u8D5E"},k.a.createElement("span",{className:dt.user_praise?"c-orange":"c-gery-888"},k.a.createElement("i",{className:"iconfont icon-dianzan mr3 current",onClick:Object(re.a)(X.a.mark(function Ot(){var Mt;return X.a.wrap(function(Ut){for(;;)switch(Ut.prev=Ut.next){case 0:return Ut.next=2,Object(s.i)({id:dt.id,container_type:"Memo",type:dt.user_praise?0:1});case 2:Mt=Ut.sent,(Mt==null?void 0:Mt.praise_count)>=0&&(ce.find(function(dn){return dn.id===dt.id}).user_praise=!dt.user_praise,ce.find(function(dn){return dn.id===dt.id}).praise_count=Mt==null?void 0:Mt.praise_count,nt({type:"forumsDetail/setForumsDetailData",payload:Object(o.a)(Object(o.a)({},Xe.forumsDetailData),{},{memo_replies:Object(ee.a)(ce)})}));case 4:case"end":return Ut.stop()}},Ot)}))}),dt.praise_count>0?dt.praise_count:"")))))))}))),vt&&k.a.createElement("aside",{className:"bg-white pb20",style:{display:"flex",justifyContent:"center"}},k.a.createElement(D.a,{justify:"space-between"},k.a.createElement(p.a,null),k.a.createElement(p.a,null,vt&&k.a.createElement("a",{className:"c-black",onClick:Wt},"\u67E5\u770B\u66F4\u591A\u8BC4\u8BBA")))),k.a.createElement("aside",{className:xe.a.reply},k.a.createElement(ue.a,{onBlur:function(){return Tt(!1)},isFocus:_t,defaultValue:oe,id:"writeForumsReviewId",onChange:function(ut){le(ut)},placeholder:"\u6211\u8981\u56DE\u590D...",height:240}),k.a.createElement(D.a,null,k.a.createElement(p.a,{flex:"1"}),k.a.createElement(p.a,null,k.a.createElement(h.a,{type:"primary",size:"large",onClick:Object(re.a)(X.a.mark(function dt(){var ut;return X.a.wrap(function(Ot){for(;;)switch(Ot.prev=Ot.next){case 0:if(!(oe==="")){Ot.next=4;break}R.b.error("\u8BF7\u8F93\u5165\u5185\u5BB9"),Ot.next=9;break;case 4:return Ot.next=6,Object(s.k)({parent_id:ve.id,content:oe});case 6:ut=Ot.sent,le(null),ut&&nt({type:"forumsDetail/setForumsDetailData",payload:Object(o.a)(Object(o.a)({},Xe.forumsDetailData),{},{memo:Object(o.a)(Object(o.a)({},ve),{},{replies_count:ve.replies_count+1}),memo_replies:[nn(ut)].concat(Object(ee.a)(ce))})});case 9:case"end":return Ot.stop()}},dt)}))},"\u53D1\u9001")))))},Me=Object(H.a)(function(Be){var Ue=Be.user,Ve=Be.forumsDetail,$e=Be.loading,Xe=Be.globalSetting;return{user:Ue,forumsDetail:Ve,globalSetting:Xe,loading:$e.models.forumsDetail}},null,null,{forwardRef:!0})(Object(U.forwardRef)(de)),tt=Z("smFo"),We=Z.n(tt),rt=Z("RCxd"),st=Z("kaH+"),Pe=Z("dhSg"),je={5:"\u6280\u672F\u5206\u4EAB",3:"\u64CD\u4F5C\u6307\u5357",16:"\u901A\u77E5\u516C\u544A"},Ze=function(Ue){var Ve,$e,Xe,et,Ie,nt=Ue.user,at=Ue.forumsDetail,De=Ue.globalSetting,ke=Ue.loading,ve=Ue.dispatch,ce=Object($.a)(Ue,["user","forumsDetail","globalSetting","loading","dispatch"]),fe=at.forumsDetailData||{},ie=fe.author_info,ne=fe.memo,oe=fe.attachments_list,le=Object(U.useRef)(),ye=Object(U.useRef)(),Le=function(){var Qe=Object(re.a)(X.a.mark(function Lt(){var vt,Ft;return X.a.wrap(function(Rt){for(;;)switch(Rt.prev=Rt.next){case 0:return vt={id:ne.id,sticky:ne.sticky?0:1},Rt.next=3,Object(s.m)(vt);case 3:Ft=Rt.sent,(Ft==null?void 0:Ft.status)===0&&ve({type:"forumsDetail/setForumsDetailData",payload:Object(o.a)(Object(o.a)({},at.forumsDetailData),{},{memo:Object(o.a)(Object(o.a)({},ne),{},{sticky:!(ne!=null&&ne.sticky)})})});case 5:case"end":return Rt.stop()}},Lt)}));return function(){return Qe.apply(this,arguments)}}(),Ne=function(){var Qe=Object(re.a)(X.a.mark(function Lt(){var vt;return X.a.wrap(function(Pt){for(;;)switch(Pt.prev=Pt.next){case 0:return Pt.next=2,Object(s.b)({id:ne==null?void 0:ne.id});case 2:vt=Pt.sent,(vt==null?void 0:vt.status)===0&&(R.b.success("\u5220\u9664\u6210\u529F"),H.d.push("/forums")),(vt==null?void 0:vt.status)===-1&&H.d.push("/forums");case 5:case"end":return Pt.stop()}},Lt)}));return function(){return Qe.apply(this,arguments)}}(),Je=function(){var Qe=Object(re.a)(X.a.mark(function Lt(){return X.a.wrap(function(Ft){for(;;)switch(Ft.prev=Ft.next){case 0:F.a.confirm({centered:!0,width:530,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u5956\u52B1\u8BBE\u7F6E",content:k.a.createElement("div",{className:"font14 tc"},k.a.createElement(v.a,{defaultValue:le.current,onChange:function(Rt){return le.current=Rt.target.value}})),onOk:function(){var Pt=Object(re.a)(X.a.mark(function mn(){var sn;return X.a.wrap(function(tn){for(;;)switch(tn.prev=tn.next){case 0:return tn.next=2,Object(s.l)({id:ne==null?void 0:ne.id,container_type:"Memo",score:le.current?Number(le.current):0,user_id:ie==null?void 0:ie.user_id});case 2:if(sn=tn.sent,le.current=null,!((sn==null?void 0:sn.code)>0)){tn.next=8;break}return ve({type:"forumsDetail/setForumsDetailData",payload:Object(o.a)(Object(o.a)({},at.forumsDetailData),{},{memo:Object(o.a)(Object(o.a)({},ne),{},{reward:sn==null?void 0:sn.code})})}),R.b.success("\u5956\u52B1\u6210\u529F"),tn.abrupt("return");case 8:R.b.success("\u5956\u52B1\u5931\u8D25\uFF0C\u8BF7\u8054\u7CFB\u7CFB\u7EDF\u7BA1\u7406\u5458\uFF01");case 9:case"end":return tn.stop()}},mn)}));function Rt(){return Pt.apply(this,arguments)}return Rt}()});case 1:case"end":return Ft.stop()}},Lt)}));return function(){return Qe.apply(this,arguments)}}(),mt=function(){ye.current.onMdFouch&&ye.current.onMdFouch()},ft=function(){var Qe=Object(re.a)(X.a.mark(function Lt(){var vt;return X.a.wrap(function(Pt){for(;;)switch(Pt.prev=Pt.next){case 0:return Pt.next=2,Object(s.i)({id:ne.id,container_type:"Memo",type:1});case 2:vt=Pt.sent,(vt==null?void 0:vt.praise_count)>=0&&ve({type:"forumsDetail/setForumsDetailData",payload:Object(o.a)(Object(o.a)({},at.forumsDetailData),{},{memo:Object(o.a)(Object(o.a)({},ne),{},{user_praise:!(ne!=null&&ne.user_praise),memo_praise_count:vt==null?void 0:vt.praise_count})})});case 4:case"end":return Pt.stop()}},Lt)}));return function(){return Qe.apply(this,arguments)}}(),Ct=k.a.createElement(f.a,{className:We.a.menu},((Ve=nt.userInfo)===null||Ve===void 0?void 0:Ve.admin)&&(ne==null?void 0:ne.sticky)&&k.a.createElement(f.a.Item,null,k.a.createElement("a",{onClick:function(){return Le()}},"\u53D6\u6D88\u7F6E\u9876")),(($e=nt.userInfo)===null||$e===void 0?void 0:$e.admin)&&!(ne!=null&&ne.sticky)&&k.a.createElement(f.a.Item,null,k.a.createElement("a",{onClick:function(){return Le()}},"\u7F6E\xA0\xA0\u9876")),k.a.createElement(f.a.Item,null,k.a.createElement(j.a,{to:"/forums/".concat(ne==null?void 0:ne.id,"/edit")},"\u7F16\xA0\xA0\u8F91")),k.a.createElement(f.a.Item,null,k.a.createElement("a",{onClick:function(){F.a.confirm({title:"\u63D0\u793A",icon:k.a.createElement(rt.a,null),content:"\u5E16\u5B50\u5C06\u88AB\u5220\u9664\uFF0C\u65E0\u6CD5\u6062\u590D\u3002\u662F\u5426\u786E\u8BA4\u5220\u9664\uFF1F",okText:"\u786E\u8BA4",onOk:function(){Ne()},cancelText:"\u53D6\u6D88"})}},"\u5220\xA0\xA0\u9664"))),xt=function(Lt){var vt=Lt.target,Ft=vt.nodeName,Pt=vt.src;Ft==="IMG"&&(Pe.a.publish("preview-image",Pt),console.log("src:",Pt))};return Object(U.useEffect)(function(){},[]),k.a.createElement("section",{className:We.a.wrap},k.a.createElement(T.a,{separator:"/",className:"mb5"},k.a.createElement(T.a.Item,null,k.a.createElement(j.a,{to:"/forums/categories/".concat(ne==null?void 0:ne.forum_id)},je[ne==null?void 0:ne.forum_id])),k.a.createElement(T.a.Item,null,"\u8BE6\u60C5")),k.a.createElement("header",{className:"bg-white pt40 pb40 pl30 pr30 ".concat(We.a.header)},k.a.createElement(D.a,{align:"middle"},k.a.createElement(p.a,{flex:1,className:"font24 mb5"},k.a.createElement("span",{className:We.a.title},ne==null?void 0:ne.subject),(ne==null?void 0:ne.sticky)&&k.a.createElement("span",{className:We.a.top},"\u7F6E\u9876"),!!(ne!=null&&ne.reward)&&k.a.createElement(O.a,{placement:"bottom",title:"\u83B7\u5F97\u5E73\u53F0\u5956\u52B1\u91D1\u5E01\uFF1A".concat(ne==null?void 0:ne.reward)},k.a.createElement("span",{className:"ml10 c-orange-ff7"},k.a.createElement("i",{className:"iconfont icon-gift font16 mr5"}),k.a.createElement("span",{className:"font14"},ne==null?void 0:ne.reward)))),k.a.createElement(p.a,null,(((Xe=nt.userInfo)===null||Xe===void 0?void 0:Xe.admin)||((et=nt.userInfo)===null||et===void 0?void 0:et.user_id)===(ie==null?void 0:ie.user_id))&&k.a.createElement(S.a,{overlay:Ct},k.a.createElement("i",{className:"fa fa-bars font-16 current c-grey-bcb"})))),k.a.createElement(D.a,{align:"middle",className:"font14"},k.a.createElement(p.a,{flex:1,className:"c-grey-999"},k.a.createElement("span",null,y()(ne==null?void 0:ne.time).fromNow()," \u53D1\u5E03")),k.a.createElement(p.a,{className:"c-grey-999"},((Ie=nt.userInfo)===null||Ie===void 0?void 0:Ie.admin)&&k.a.createElement(O.a,{placement:"bottom",title:"\u5E16\u5B50\u5956\u52B1"},k.a.createElement("span",{className:"current pr10 ".concat(We.a.line),onClick:Je},k.a.createElement("i",{className:"iconfont icon-jiangli font18 mr5"}))),k.a.createElement("span",{className:"pr10 pl10 ".concat(ne!=null&&ne.replies_count?We.a.line:"")},k.a.createElement("i",{className:"iconfont icon-liulanyan font18 mr5"}),ne==null?void 0:ne.viewed_count),!!(ne!=null&&ne.replies_count)&&k.a.createElement(O.a,{placement:"bottom",title:"\u5199\u8BC4\u8BBA"},k.a.createElement("span",{className:"current pl10",onClick:mt},k.a.createElement("i",{className:"iconfont icon-huifu1 font18 mr5"}),ne==null?void 0:ne.replies_count))))),k.a.createElement("main",{className:"bg-white pt40 pb40 pl40 pr40"},k.a.createElement("div",{onClick:xt},k.a.createElement(Y.a,{value:ne==null?void 0:ne.content})),k.a.createElement("div",{className:"bg-white pl40 pr40 mt40"},k.a.createElement("div",{className:"mt10 mb20 ".concat(We.a.flexCenter)},k.a.createElement("div",{className:"".concat(We.a.like," ").concat(ne!=null&&ne.user_praise?"":We.a.canLike),onClick:ft},k.a.createElement("i",{className:"iconfont icon-dianzan font18"}),k.a.createElement("br",null),k.a.createElement("span",null,ne==null?void 0:ne.memo_praise_count)))),!!(oe!=null&&oe.length)&&k.a.createElement("div",{className:"mt40"},oe==null?void 0:oe.map(function(Qe){return k.a.createElement("div",{className:"c-grey-888 ".concat(We.a.flexCenter)},k.a.createElement("i",{className:"iconfont icon-fujian mr10 font14 c-green-29b"}),k.a.createElement("a",{href:Qe==null?void 0:Qe.url,title:Qe==null?void 0:Qe.title,className:"".concat(We.a.attachmentName," mr10")},Qe==null?void 0:Qe.title),k.a.createElement("span",{className:"font12 c-grey-666 mt3"},Qe==null?void 0:Qe.filesize))}))),k.a.createElement(Me,{ref:ye,handleClick:xt}),k.a.createElement(st.a,null))},se=Object(H.a)(function(Be){var Ue=Be.user,Ve=Be.forumsDetail,$e=Be.loading,Xe=Be.globalSetting;return{user:Ue,forumsDetail:Ve,globalSetting:Xe,loading:$e.effects}})(Ze),_e=Z("G8my"),Te=Z.n(_e),Ae=function(Ue){var Ve=Ue.forumsDetail,$e=Ue.globalSetting,Xe=Ue.loading,et=Ue.dispatch,Ie=Object($.a)(Ue,["forumsDetail","globalSetting","loading","dispatch"]),nt=Object(G.i)();Object(U.useEffect)(function(){at()},[nt.memoId]);var at=function(){var De=Object(re.a)(X.a.mark(function ke(){return X.a.wrap(function(ce){for(;;)switch(ce.prev=ce.next){case 0:et({type:"forumsDetail/getForumsDetailData",payload:{id:nt.memoId}});case 1:case"end":return ce.stop()}},ke)}));return function(){return De.apply(this,arguments)}}();return k.a.createElement("section",{className:"edu-container mb20 mt30 ".concat(Te.a.flex)},k.a.createElement(se,null),k.a.createElement(A,null))},ze=be.default=Object(H.a)(function(Be){var Ue=Be.forumsDetail,Ve=Be.loading,$e=Be.globalSetting;return{forumsDetail:Ue,globalSetting:$e,loading:Ve.models.forumsDetail}})(Ae)},LO5M:function(ht,be,Z){ht.exports={wrap:"wrap___1d4rP",head:"head___1_Uzf",recommendItem:"recommendItem___IStR9",buttonWrap:"buttonWrap___3dpFm",privateMessage:"privateMessage___24GfS",flex1:"flex1___3wIqQ",mWidth147:"mWidth147___3ODny"}},LdHM:function(ht,be,Z){"use strict";Z.d(be,"b",function(){return a}),Z.d(be,"a",function(){return E});var re=Z("1OyB"),$=Z("vuIU"),P=Z("Ji7U"),X=Z("LK+K"),U=Z("q1tI"),k=Z("rePB"),G=Z("Ff2n"),H=Z("ODXe"),n=Z("4IlW"),D=Z("bX4T"),g=Z("YrtM"),p=Z("TSYQ"),m=Z.n(p),h=Z("+nKL"),o=Z("8OUc"),c=function(Y,ee){var ae=Y.prefixCls,ue=Y.id,Re=Y.flattenOptions,Ee=Y.childrenAsData,xe=Y.values,Ce=Y.searchValue,Oe=Y.multiple,pe=Y.defaultActiveFirstOption,de=Y.height,Me=Y.itemHeight,tt=Y.notFoundContent,We=Y.open,rt=Y.menuItemSelectedIcon,st=Y.virtual,Pe=Y.onSelect,je=Y.onToggleOpen,Ze=Y.onActiveValue,se=Y.onScroll,_e=Y.onMouseEnter,Te="".concat(ae,"-item"),Ae=Object(g.a)(function(){return Re},[We,Re],function(ke,ve){return ve[0]&&ke[1]!==ve[1]}),ze=U.useRef(null),Be=function(ve){ve.preventDefault()},Ue=function(ve){ze.current&&ze.current.scrollTo({index:ve})},Ve=function(ve){for(var ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,fe=Ae.length,ie=0;ie<fe;ie+=1){var ne=(ve+ie*ce+fe)%fe,oe=Ae[ne],le=oe.group,ye=oe.data;if(!le&&!ye.disabled)return ne}return-1},$e=U.useState(function(){return Ve(0)}),Xe=Object(H.a)($e,2),et=Xe[0],Ie=Xe[1],nt=function(ve){Ie(ve);var ce=Ae[ve];if(!ce){Ze(null,-1);return}Ze(ce.data.value,ve)};U.useEffect(function(){nt(pe!==!1?Ve(0):-1)},[Ae.length,Ce]),U.useEffect(function(){var ke=setTimeout(function(){if(!Oe&&We&&xe.size===1){var ve=Array.from(xe)[0],ce=Ae.findIndex(function(fe){var ie=fe.data;return ie.value===ve});nt(ce),Ue(ce)}});return function(){return clearTimeout(ke)}},[We]);var at=function(ve){ve!==void 0&&Pe(ve,{selected:!xe.has(ve)}),Oe||je(!1)};if(U.useImperativeHandle(ee,function(){return{onKeyDown:function(ve){var ce=ve.which;switch(ce){case n.a.UP:case n.a.DOWN:{var fe=0;if(ce===n.a.UP?fe=-1:ce===n.a.DOWN&&(fe=1),fe!==0){var ie=Ve(et+fe,fe);Ue(ie),nt(ie)}break}case n.a.ENTER:{var ne=Ae[et];ne&&!ne.data.disabled?at(ne.data.value):at(void 0),We&&ve.preventDefault();break}case n.a.ESC:je(!1)}},onKeyUp:function(){},scrollTo:function(ve){Ue(ve)}}}),Ae.length===0)return U.createElement("div",{role:"listbox",id:"".concat(ue,"_list"),className:"".concat(Te,"-empty"),onMouseDown:Be},tt);function De(ke){var ve=Ae[ke];if(!ve)return null;var ce=ve.data||{},fe=ce.value,ie=ce.label,ne=ce.children,oe=Object(D.a)(ce,!0),le=Ee?ne:ie;return ve?U.createElement("div",Object.assign({"aria-label":typeof le=="string"?le:null},oe,{key:ke,role:"option",id:"".concat(ue,"_list_").concat(ke),"aria-selected":xe.has(fe)}),fe):null}return U.createElement(U.Fragment,null,U.createElement("div",{role:"listbox",id:"".concat(ue,"_list"),style:{height:0,width:0,overflow:"hidden"}},De(et-1),De(et),De(et+1)),U.createElement(h.a,{itemKey:"key",ref:ze,data:Ae,height:de,itemHeight:Me,fullHeight:!1,onMouseDown:Be,onScroll:se,virtual:st,onMouseEnter:_e},function(ke,ve){var ce,fe=ke.group,ie=ke.groupOption,ne=ke.data,oe=ne.label,le=ne.key;if(fe)return U.createElement("div",{className:m()(Te,"".concat(Te,"-group"))},oe!==void 0?oe:le);var ye=ne.disabled,Le=ne.value,Ne=ne.title,Je=ne.children,mt=ne.style,ft=ne.className,Ct=Object(G.a)(ne,["disabled","value","title","children","style","className"]),xt=xe.has(Le),Qe="".concat(Te,"-option"),Lt=m()(Te,Qe,ft,(ce={},Object(k.a)(ce,"".concat(Qe,"-grouped"),ie),Object(k.a)(ce,"".concat(Qe,"-active"),et===ve&&!ye),Object(k.a)(ce,"".concat(Qe,"-disabled"),ye),Object(k.a)(ce,"".concat(Qe,"-selected"),xt),ce)),vt=Ee?Je:oe,Ft=!rt||typeof rt=="function"||xt;return U.createElement("div",Object.assign({},Ct,{"aria-selected":xt,className:Lt,title:Ne,onMouseMove:function(){if(et===ve||ye)return;nt(ve)},onClick:function(){ye||at(Le)},style:mt}),U.createElement("div",{className:"".concat(Qe,"-content")},vt||Le),U.isValidElement(rt)||xt,Ft&&U.createElement(o.a,{className:"".concat(Te,"-option-state"),customizeIcon:rt,customizeIconProps:{isSelected:xt}},xt?"\u2713":null))}))},l=U.forwardRef(c);l.displayName="OptionList";var u=l,s=function(){return null};s.isSelectOption=!0;var a=s,A=function(){return null};A.isSelectOptGroup=!0;var E=A,S=Z("VTBJ"),L=Z("Zm9Q");function O(y){var Y=y.key,ee=y.props,ae=ee.children,ue=ee.value,Re=Object(G.a)(ee,["children","value"]);return Object(S.a)({key:Y,value:ue!==void 0?ue:Y,children:ae},Re)}function C(y){var Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(L.a)(y).map(function(ee,ae){if(!U.isValidElement(ee)||!ee.type)return null;var ue=ee.type.isSelectOptGroup,Re=ee.key,Ee=ee.props,xe=Ee.children,Ce=Object(G.a)(Ee,["children"]);return Y||!ue?O(ee):Object(S.a)(Object(S.a)({key:"__RC_SELECT_GRP__".concat(Re===null?ae:Re,"__"),label:Re},Ce),{},{options:C(xe)})}).filter(function(ee){return ee})}var T=Z("2Qr1"),x=Z("qNPg"),f=Z("U8pU"),w=Z("Kwbf"),v=Z("WKfj");function b(y){var Y=y.mode,ee=y.options,ae=y.children,ue=y.backfill,Re=y.allowClear,Ee=y.placeholder,xe=y.getInputElement,Ce=y.showSearch,Oe=y.onSearch,pe=y.defaultOpen,de=y.autoFocus,Me=y.labelInValue,tt=y.value,We=y.inputValue,rt=y.optionLabelProp,st=Y==="multiple"||Y==="tags",Pe=Ce!==void 0?Ce:st||Y==="combobox",je=ee||C(ae);if(Object(w.a)(Y!=="tags"||je.every(function(Te){return!Te.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),Y==="tags"||Y==="combobox"){var Ze=je.some(function(Te){return Te.options?Te.options.some(function(Ae){return typeof("value"in Ae?Ae.value:Ae.key)=="number"}):typeof("value"in Te?Te.value:Te.key)=="number"});Object(w.a)(!Ze,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(w.a)(Y!=="combobox"||!rt,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(w.a)(Y==="combobox"||!ue,"`backfill` only works with `combobox` mode."),Object(w.a)(Y==="combobox"||!xe,"`getInputElement` only work with `combobox` mode."),Object(w.b)(Y!=="combobox"||!xe||!Re||!Ee,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Oe&&!Pe&&Y!=="combobox"&&Y!=="tags"&&Object(w.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(w.b)(!pe||de,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),tt!=null){var se=Object(v.d)(tt);Object(w.a)(!Me||se.every(function(Te){return Object(f.a)(Te)==="object"&&("key"in Te||"value"in Te)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(w.a)(!st||Array.isArray(tt),"`value` should be array when `mode` is `multiple` or `tags`")}if(ae){var _e=null;Object(L.a)(ae).some(function(Te){if(!U.isValidElement(Te)||!Te.type)return!1;var Ae=Te.type;if(Ae.isSelectOption)return!1;if(Ae.isSelectOptGroup){var ze=Object(L.a)(Te.props.children).every(function(Be){return!U.isValidElement(Be)||!Te.type||Be.type.isSelectOption?!0:(_e=Be.type,!1)});return!ze}return _e=Ae,!0}),_e&&Object(w.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(_e.displayName||_e.name||_e,"`.")),Object(w.a)(We===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var F=b,B=Object(x.a)({prefixCls:"rc-select",components:{optionList:u},convertChildrenToData:C,flattenOptions:T.d,getLabeledValue:T.e,filterOptions:T.b,isValueDisabled:T.g,findValueOption:T.c,warningProps:F,fillOptionsWithMissingValue:T.a}),R=function(y){Object(P.a)(ee,y);var Y=Object(X.a)(ee);function ee(){var ae;return Object(re.a)(this,ee),ae=Y.apply(this,arguments),ae.selectRef=U.createRef(),ae.focus=function(){ae.selectRef.current.focus()},ae.blur=function(){ae.selectRef.current.blur()},ae}return Object($.a)(ee,[{key:"render",value:function(){return U.createElement(B,Object.assign({ref:this.selectRef},this.props))}}]),ee}(U.Component);R.Option=a,R.OptGroup=E;var j=R,N=be.c=j},M8RZ:function(ht,be,Z){"use strict";Z.d(be,"a",function(){return n});var re=Z("fWQN"),$=Z("mtLc"),P=Z("yKVA"),X=Z("879j"),U=Z("q1tI"),k=Z.n(U),G=Z("i8i4"),H=Z.n(G),n=function(D){Object(P.a)(p,D);var g=Object(X.a)(p);function p(m){var h;Object(re.a)(this,p),h=g.call(this,m);var o=window.document;return h.node=o.createElement("div"),o.body.appendChild(h.node),h}return Object($.a)(p,[{key:"render",value:function(){var h=this.props.children;return Object(G.createPortal)(h,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),p}(k.a.Component)},MI8n:function(ht,be,Z){"use strict";Z.d(be,"c",function(){return U}),Z.d(be,"b",function(){return n}),Z.d(be,"e",function(){return D}),Z.d(be,"a",function(){return g}),Z.d(be,"d",function(){return p}),Z.d(be,"f",function(){return m});var re=Z("/cxE"),$=Z("pmY6"),P=Z("24hK"),X=Z("5Y4S"),U;(function(h){h.None=()=>$.a.None;function o(b){return(F,B=null,R)=>{let j=!1,N;return N=b(y=>j?void 0:(N?N.dispose():j=!0,F.call(B,y)),null,R),j&&N.dispose(),N}}h.once=o;function c(b,F){return E((B,R=null,j)=>b(N=>B.call(R,F(N)),null,j))}h.map=c;function l(b,F){return E((B,R=null,j)=>b(N=>{F(N),B.call(R,N)},null,j))}h.forEach=l;function u(b,F){return E((B,R=null,j)=>b(N=>F(N)&&B.call(R,N),null,j))}h.filter=u;function s(b){return b}h.signal=s;function a(...b){return(F,B=null,R)=>Object($.e)(...b.map(j=>j(N=>F.call(B,N),null,R)))}h.any=a;function A(b,F,B){let R=B;return c(b,j=>(R=F(R,j),R))}h.reduce=A;function E(b){let F;const B=new n({onFirstListenerAdd(){F=b(B.fire,B)},onLastListenerRemove(){F.dispose()}});return B.event}function S(b,F,B=100,R=!1,j){let N,y,Y,ee=0;const ae=new n({leakWarningThreshold:j,onFirstListenerAdd(){N=b(ue=>{ee++,y=F(y,ue),R&&!Y&&(ae.fire(y),y=void 0),clearTimeout(Y),Y=setTimeout(()=>{const Re=y;y=void 0,Y=void 0,(!R||ee>1)&&ae.fire(Re),ee=0},B)})},onLastListenerRemove(){N.dispose()}});return ae.event}h.debounce=S;function L(b,F=(B,R)=>B===R){let B=!0,R;return u(b,j=>{const N=B||!F(j,R);return B=!1,R=j,N})}h.latch=L;function O(b,F){return[h.filter(b,F),h.filter(b,B=>!F(B))]}h.split=O;function C(b,F=!1,B=[]){let R=B.slice(),j=b(Y=>{R?R.push(Y):y.fire(Y)});const N=()=>{R&&R.forEach(Y=>y.fire(Y)),R=null},y=new n({onFirstListenerAdd(){j||(j=b(Y=>y.fire(Y)))},onFirstListenerDidAdd(){R&&(F?setTimeout(N):N())},onLastListenerRemove(){j&&j.dispose(),j=null}});return y.event}h.buffer=C;class T{constructor(b){this.event=b}map(b){return new T(c(this.event,b))}forEach(b){return new T(l(this.event,b))}filter(b){return new T(u(this.event,b))}reduce(b,F){return new T(A(this.event,b,F))}latch(){return new T(L(this.event))}debounce(b,F=100,B=!1,R){return new T(S(this.event,b,F,B,R))}on(b,F,B){return this.event(b,F,B)}once(b,F,B){return o(this.event)(b,F,B)}}function x(b){return new T(b)}h.chain=x;function f(b,F,B=R=>R){const R=(...Y)=>y.fire(B(...Y)),j=()=>b.on(F,R),N=()=>b.removeListener(F,R),y=new n({onFirstListenerAdd:j,onLastListenerRemove:N});return y.event}h.fromNodeEventEmitter=f;function w(b,F,B=R=>R){const R=(...Y)=>y.fire(B(...Y)),j=()=>b.addEventListener(F,R),N=()=>b.removeEventListener(F,R),y=new n({onFirstListenerAdd:j,onLastListenerRemove:N});return y.event}h.fromDOMEventEmitter=w;function v(b){return new Promise(F=>o(b)(F))}h.toPromise=v})(U||(U={}));class k{constructor(h){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${h}_${k._idPool++}`}start(h){this._stopWatch=new X.a(!0),this._listenerCount=h}stop(){if(this._stopWatch){const h=this._stopWatch.elapsed();this._elapsedOverall+=h,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${h.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}k._idPool=0;let G=-1;class H{constructor(h,o=Math.random().toString(18).slice(2,5)){this.customThreshold=h,this.name=o,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(h){let o=G;if(typeof this.customThreshold=="number"&&(o=this.customThreshold),o<=0||h<o)return;this._stacks||(this._stacks=new Map);const c=new Error().stack.split(`
|
|
`).slice(3).join(`
|
|
`),l=this._stacks.get(c)||0;if(this._stacks.set(c,l+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=o*.5;let u,s=0;for(const[a,A]of this._stacks)(!u||s<A)&&(u=a,s=A);console.warn(`[${this.name}] potential listener LEAK detected, having ${h} listeners already. MOST frequent listener (${s}):`),console.warn(u)}return()=>{const u=this._stacks.get(c)||0;this._stacks.set(c,u-1)}}}class n{constructor(h){var o;this._disposed=!1,this._options=h,this._leakageMon=G>0?new H(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((o=this._options)===null||o===void 0?void 0:o._profName)?new k(this._options._profName):void 0}get event(){return this._event||(this._event=(h,o,c)=>{var l;this._listeners||(this._listeners=new P.a);const u=this._listeners.isEmpty();u&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const s=this._listeners.push(o?[h,o]:h);u&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,h,o);const a=(l=this._leakageMon)===null||l===void 0?void 0:l.check(this._listeners.size),A=Object($.i)(()=>{if(a&&a(),!this._disposed&&(s(),this._options&&this._options.onLastListenerRemove)){const E=this._listeners&&!this._listeners.isEmpty();E||this._options.onLastListenerRemove(this)}});return c instanceof $.b?c.add(A):Array.isArray(c)&&c.push(A),A}),this._event}fire(h){var o,c;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new P.a);for(let l of this._listeners)this._deliveryQueue.push([l,h]);for((o=this._perfMon)===null||o===void 0||o.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[l,u]=this._deliveryQueue.shift();try{typeof l=="function"?l.call(void 0,u):l[0].call(l[1],u)}catch(s){Object(re.f)(s)}}(c=this._perfMon)===null||c===void 0||c.stop()}}dispose(){var h,o,c,l,u;this._disposed||(this._disposed=!0,(h=this._listeners)===null||h===void 0||h.clear(),(o=this._deliveryQueue)===null||o===void 0||o.clear(),(l=(c=this._options)===null||c===void 0?void 0:c.onLastListenerRemove)===null||l===void 0||l.call(c),(u=this._leakageMon)===null||u===void 0||u.dispose())}}class D extends n{constructor(h){super(h);this._isPaused=0,this._eventQueue=new P.a,this._mergeFn=h==null?void 0:h.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const h=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(h))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(h){this._listeners&&(this._isPaused!==0?this._eventQueue.push(h):super.fire(h))}}class g extends D{constructor(h){var o;super(h);this._delay=(o=h.delay)!==null&&o!==void 0?o:100}fire(h){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(h)}}class p{constructor(){this.buffers=[]}wrapEvent(h){return(o,c,l)=>h(u=>{const s=this.buffers[this.buffers.length-1];s?s.push(()=>o.call(c,u)):o.call(c,u)},void 0,l)}bufferEvents(h){const o=[];this.buffers.push(o);const c=h();return this.buffers.pop(),o.forEach(l=>l()),c}}class m{constructor(){this.listening=!1,this.inputEvent=U.None,this.inputEventListener=$.a.None,this.emitter=new n({onFirstListenerDidAdd:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onLastListenerRemove:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(h){this.inputEvent=h,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=h(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},MNsG:function(ht,be,Z){"use strict";(function(re,$){Z.d(be,"b",function(){return c}),Z.d(be,"i",function(){return a}),Z.d(be,"f",function(){return A}),Z.d(be,"d",function(){return E}),Z.d(be,"g",function(){return S}),Z.d(be,"h",function(){return L}),Z.d(be,"c",function(){return O}),Z.d(be,"k",function(){return C}),Z.d(be,"j",function(){return T}),Z.d(be,"a",function(){return x}),Z.d(be,"e",function(){return v});var P;const X="en";let U=!1,k=!1,G=!1,H=!1,n=!1,D=!1,g=!1,p,m=X,h,o;const c=typeof self=="object"?self:typeof re=="object"?re:{};let l;typeof c.vscode!="undefined"&&typeof c.vscode.process!="undefined"?l=c.vscode.process:typeof $!="undefined"&&(l=$);const u=typeof((P=l==null?void 0:l.versions)===null||P===void 0?void 0:P.electron)=="string"&&l.type==="renderer";if(typeof navigator=="object"&&!u)o=navigator.userAgent,U=o.indexOf("Windows")>=0,k=o.indexOf("Macintosh")>=0,g=(o.indexOf("Macintosh")>=0||o.indexOf("iPad")>=0||o.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,G=o.indexOf("Linux")>=0,D=!0,p=navigator.language,m=p;else if(typeof l=="object"){U=l.platform==="win32",k=l.platform==="darwin",G=l.platform==="linux",H=G&&!!l.env.SNAP&&!!l.env.SNAP_REVISION,p=X,m=X;const b=l.env.VSCODE_NLS_CONFIG;if(b)try{const F=JSON.parse(b),B=F.availableLanguages["*"];p=F.locale,m=B||X,h=F._translationsConfigFile}catch(F){}n=!0}else console.error("Unable to resolve platform.");let s=0;k?s=1:U?s=3:G&&(s=2);const a=U,A=k,E=G,S=n,L=D,O=g,C=o,T=function(){if(c.setImmediate)return c.setImmediate.bind(c);if(typeof c.postMessage=="function"&&!c.importScripts){let B=[];c.addEventListener("message",j=>{if(j.data&&j.data.vscodeSetImmediateId)for(let N=0,y=B.length;N<y;N++){const Y=B[N];if(Y.id===j.data.vscodeSetImmediateId){B.splice(N,1),Y.callback();return}}});let R=0;return j=>{const N=++R;B.push({id:N,callback:j}),c.postMessage({vscodeSetImmediateId:N},"*")}}if(typeof(l==null?void 0:l.nextTick)=="function")return l.nextTick.bind(l);const F=Promise.resolve();return B=>F.then(B)}(),x=k||g?2:U?1:3;let f=!0,w=!1;function v(){if(!w){w=!0;const b=new Uint8Array(2);b[0]=1,b[1]=2;const F=new Uint16Array(b.buffer);f=F[0]===(2<<8)+1}return f}}).call(this,Z("IyRk"),Z("Q2Ig"))},N0LK:function(ht,be,Z){"use strict";Z.d(be,"C",function(){return re}),Z.d(be,"v",function(){return P}),Z.d(be,"s",function(){return X}),Z.d(be,"t",function(){return U}),Z.d(be,"U",function(){return k}),Z.d(be,"J",function(){return G}),Z.d(be,"O",function(){return H}),Z.d(be,"p",function(){return n}),Z.d(be,"T",function(){return D}),Z.d(be,"q",function(){return g}),Z.d(be,"N",function(){return p}),Z.d(be,"M",function(){return m}),Z.d(be,"Q",function(){return h}),Z.d(be,"u",function(){return o}),Z.d(be,"x",function(){return c}),Z.d(be,"I",function(){return l}),Z.d(be,"f",function(){return u}),Z.d(be,"h",function(){return s}),Z.d(be,"g",function(){return a}),Z.d(be,"i",function(){return A}),Z.d(be,"G",function(){return E}),Z.d(be,"H",function(){return S}),Z.d(be,"r",function(){return L}),Z.d(be,"R",function(){return O}),Z.d(be,"d",function(){return C}),Z.d(be,"e",function(){return T}),Z.d(be,"E",function(){return x}),Z.d(be,"F",function(){return f}),Z.d(be,"j",function(){return w}),Z.d(be,"z",function(){return v}),Z.d(be,"K",function(){return F}),Z.d(be,"L",function(){return B}),Z.d(be,"m",function(){return j}),Z.d(be,"k",function(){return y}),Z.d(be,"A",function(){return ee}),Z.d(be,"a",function(){return ae}),Z.d(be,"n",function(){return ue}),Z.d(be,"l",function(){return Re}),Z.d(be,"D",function(){return Ee}),Z.d(be,"B",function(){return xe}),Z.d(be,"b",function(){return Ce}),Z.d(be,"S",function(){return Oe}),Z.d(be,"o",function(){return pe}),Z.d(be,"P",function(){return de}),Z.d(be,"w",function(){return Me}),Z.d(be,"c",function(){return tt}),Z.d(be,"y",function(){return st});function re(se){return!se||typeof se!="string"?!0:se.trim().length===0}const $=/{(\d+)}/g;function P(se,..._e){return _e.length===0?se:se.replace($,function(Te,Ae){const ze=parseInt(Ae,10);return isNaN(ze)||ze<0||ze>=_e.length?Te:_e[ze]})}function X(se){return se.replace(/[<>&]/g,function(_e){switch(_e){case"<":return"<";case">":return">";case"&":return"&";default:return _e}})}function U(se){return se.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function k(se,_e=" "){const Te=G(se,_e);return H(Te,_e)}function G(se,_e){if(!se||!_e)return se;const Te=_e.length;if(Te===0||se.length===0)return se;let Ae=0;for(;se.indexOf(_e,Ae)===Ae;)Ae=Ae+Te;return se.substring(Ae)}function H(se,_e){if(!se||!_e)return se;const Te=_e.length,Ae=se.length;if(Te===0||Ae===0)return se;let ze=Ae,Be=-1;for(;!(Be=se.lastIndexOf(_e,ze-1),Be===-1||Be+Te!==ze);){if(Be===0)return"";ze=Be}return se.substring(0,ze)}function n(se){return se.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function D(se){return se.replace(/\*/g,"")}function g(se,_e,Te={}){if(!se)throw new Error("Cannot create regex from empty string");_e||(se=U(se)),Te.wholeWord&&(/\B/.test(se.charAt(0))||(se="\\b"+se),/\B/.test(se.charAt(se.length-1))||(se=se+"\\b"));let Ae="";return Te.global&&(Ae+="g"),Te.matchCase||(Ae+="i"),Te.multiline&&(Ae+="m"),Te.unicode&&(Ae+="u"),new RegExp(se,Ae)}function p(se){if(se.source==="^"||se.source==="^$"||se.source==="$"||se.source==="^\\s*$")return!1;const _e=se.exec("");return!!(_e&&se.lastIndex===0)}function m(se){return(se.global?"g":"")+(se.ignoreCase?"i":"")+(se.multiline?"m":"")+(se.unicode?"u":"")}function h(se){return se.split(/\r\n|\r|\n/)}function o(se){for(let _e=0,Te=se.length;_e<Te;_e++){const Ae=se.charCodeAt(_e);if(Ae!==32&&Ae!==9)return _e}return-1}function c(se,_e=0,Te=se.length){for(let Ae=_e;Ae<Te;Ae++){const ze=se.charCodeAt(Ae);if(ze!==32&&ze!==9)return se.substring(_e,Ae)}return se.substring(_e,Te)}function l(se,_e=se.length-1){for(let Te=_e;Te>=0;Te--){const Ae=se.charCodeAt(Te);if(Ae!==32&&Ae!==9)return Te}return-1}function u(se,_e){return se<_e?-1:se>_e?1:0}function s(se,_e,Te=0,Ae=se.length,ze=0,Be=_e.length){for(;Te<Ae&&ze<Be;Te++,ze++){let $e=se.charCodeAt(Te),Xe=_e.charCodeAt(ze);if($e<Xe)return-1;if($e>Xe)return 1}const Ue=Ae-Te,Ve=Be-ze;return Ue<Ve?-1:Ue>Ve?1:0}function a(se,_e){return A(se,_e,0,se.length,0,_e.length)}function A(se,_e,Te=0,Ae=se.length,ze=0,Be=_e.length){for(;Te<Ae&&ze<Be;Te++,ze++){let $e=se.charCodeAt(Te),Xe=_e.charCodeAt(ze);if($e===Xe)continue;if($e>=128||Xe>=128)return s(se.toLowerCase(),_e.toLowerCase(),Te,Ae,ze,Be);E($e)&&($e-=32),E(Xe)&&(Xe-=32);const et=$e-Xe;if(et===0)continue;return et}const Ue=Ae-Te,Ve=Be-ze;return Ue<Ve?-1:Ue>Ve?1:0}function E(se){return se>=97&&se<=122}function S(se){return se>=65&&se<=90}function L(se,_e){return se.length===_e.length&&A(se,_e)===0}function O(se,_e){const Te=_e.length;return _e.length>se.length?!1:A(se,_e,0,Te)===0}function C(se,_e){let Te,Ae=Math.min(se.length,_e.length);for(Te=0;Te<Ae;Te++)if(se.charCodeAt(Te)!==_e.charCodeAt(Te))return Te;return Ae}function T(se,_e){let Te,Ae=Math.min(se.length,_e.length);const ze=se.length-1,Be=_e.length-1;for(Te=0;Te<Ae;Te++)if(se.charCodeAt(ze-Te)!==_e.charCodeAt(Be-Te))return Te;return Ae}function x(se){return 55296<=se&&se<=56319}function f(se){return 56320<=se&&se<=57343}function w(se,_e){return(se-55296<<10)+(_e-56320)+65536}function v(se,_e,Te){const Ae=se.charCodeAt(Te);if(x(Ae)&&Te+1<_e){const ze=se.charCodeAt(Te+1);if(f(ze))return w(Ae,ze)}return Ae}function b(se,_e){const Te=se.charCodeAt(_e-1);if(f(Te)&&_e>1){const Ae=se.charCodeAt(_e-2);if(x(Ae))return w(Ae,Te)}return Te}function F(se,_e){const Te=We.getInstance(),Ae=_e,ze=se.length,Be=v(se,ze,_e);_e+=Be>=65536?2:1;let Ue=Te.getGraphemeBreakType(Be);for(;_e<ze;){const Ve=v(se,ze,_e),$e=Te.getGraphemeBreakType(Ve);if(tt(Ue,$e))break;_e+=Ve>=65536?2:1,Ue=$e}return _e-Ae}function B(se,_e){const Te=We.getInstance(),Ae=_e,ze=b(se,_e);_e-=ze>=65536?2:1;let Be=Te.getGraphemeBreakType(ze);for(;_e>0;){const Ue=b(se,_e),Ve=Te.getGraphemeBreakType(Ue);if(tt(Ve,Be))break;_e-=Ue>=65536?2:1,Be=Ve}return Ae-_e}const R=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/;function j(se){return R.test(se)}const N=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDED6])/;function y(se){return N.test(se)}const Y=/^[\t\n\r\x20-\x7E]*$/;function ee(se){return Y.test(se)}const ae=/[\u2028\u2029]/;function ue(se){return ae.test(se)}function Re(se){for(let _e=0,Te=se.length;_e<Te;_e++)if(Ee(se.charCodeAt(_e)))return!0;return!1}function Ee(se){return se=+se,se>=11904&&se<=55215||se>=63744&&se<=64255||se>=65281&&se<=65374}function xe(se){return se>=127462&&se<=127487||se===8986||se===8987||se===9200||se===9203||se>=9728&&se<=10175||se===11088||se===11093||se>=127744&&se<=128591||se>=128640&&se<=128764||se>=128992&&se<=129003||se>=129280&&se<=129535||se>=129648&&se<=129750}const Ce=String.fromCharCode(65279);function Oe(se){return!!(se&&se.length>0&&se.charCodeAt(0)===65279)}function pe(se,_e=!1){return se?(_e&&(se=se.replace(/\\./g,"")),se.toLowerCase()!==se):!1}function de(se){const _e=90-65+1;return se=se%(2*_e),se<_e?String.fromCharCode(97+se):String.fromCharCode(65+se-_e)}function Me(se){const _e=We.getInstance();return _e.getGraphemeBreakType(se)}function tt(se,_e){return se===0?_e!==5&&_e!==7:se===2&&_e===3?!1:se===4||se===2||se===3||(_e===4||_e===2||_e===3)?!0:se===8&&(_e===8||_e===9||_e===11||_e===12)||((se===11||se===9)&&(_e===9||_e===10)||((se===12||se===10)&&_e===10||(_e===5||_e===13||(_e===7||(se===1||se===13&&_e===14)))))?!1:!(se===6&&_e===6)}class We{constructor(){this._data=rt()}static getInstance(){return We._INSTANCE||(We._INSTANCE=new We),We._INSTANCE}getGraphemeBreakType(se){if(se<32)return se===10?3:se===13?2:4;if(se<127)return 0;const _e=this._data,Te=_e.length/3;let Ae=1;for(;Ae<=Te;)if(se<_e[3*Ae])Ae=2*Ae;else if(se>_e[3*Ae+1])Ae=2*Ae+1;else return _e[3*Ae+2];return 0}}We._INSTANCE=null;function rt(){return JSON.parse("[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]")}function st(se,_e){if(se===0)return 0;const Te=Pe(se,_e);if(Te!==void 0)return Te;const Ae=b(_e,se);return se-=je(Ae),se}function Pe(se,_e){let Te=b(_e,se);for(se-=je(Te);Ze(Te)||Te===65039||Te===8419;){if(se===0)return;Te=b(_e,se),se-=je(Te)}if(!xe(Te))return;if(se>=0){const Ae=b(_e,se);Ae===8205&&(se-=je(Ae))}return se}function je(se){return se>=65536?2:1}function Ze(se){return 127995<=se&&se<=127999}},Ot1p:function(ht,be,Z){"use strict";var re=Z("2qtc"),$=Z("kLXV"),P=Z("rAM+"),X=Z("miYZ"),U=Z("tsqr"),k=Z("9og8"),G=Z("tJVT"),H=Z("jrin"),n=Z("WmNS"),D=Z.n(n),g=Z("q1tI"),p=Z.n(g),m=Z("VrN/"),h=Z.n(m),o=Z("bdgK"),c=Z("p77/"),l=Z("Bd2K"),u=Z("ELLl"),s=Z("19Vz"),a=Z("lZu9"),A=Z("+NIl"),E=Z("kSUc"),S=Z("9Bee"),L=function(ye){var Le=ye.value,Ne=Le===void 0?"":Le,Je=ye.className,mt=ye.showTextOnly,ft=ye.showLines,Ct=ye.style,xt=Ct===void 0?{}:Ct,Qe=Object(g.useMemo)(function(){return""},[Ne]);return p.a.createElement(p.a.Fragment,null,p.a.createElement("div",{dangerouslySetInnerHTML:{__html:Qe}}))},O=Z("0Owb"),C=Z("dejd"),T=Z("C+DQ"),x=Z("1vsH"),f=Z("m3rI"),w=[{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 v(ye){var Le=ye.onActionCallback,Ne=ye.title,Je=ye.icon,mt=ye.actionName,ft=ye.className,Ct=ft===void 0?"":ft,xt=ye.children;function Qe(){Le(mt)}return p.a.createElement("a",{title:Ne,className:Ct,onClick:Qe},p.a.createElement("i",{className:"md-iconfont ".concat(Je)}),xt)}var b=function(ye){var Le=ye.watch,Ne=ye.showNullButton,Je=ye.onActionCallback,mt=ye.fullScreen,ft=ye.insertTemp,Ct=ye.hidetoolBar,xt=ye.uuid,Qe=ye.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(x.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(x.F)("_educoder_session"),"&key=").concat(xt,"&api=").concat(encodeURIComponent(f.a.PROXY_SERVER)));var Lt=[].concat(w,[{title:"".concat(Le?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Le?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return p.a.createElement("ul",{className:"markdown-toolbar-container"},!Ct&&Lt.map(function(vt,Ft){return p.a.createElement("li",{key:Ft},vt.actionName?p.a.createElement(v,Object(O.a)({},vt,{onActionCallback:Je})):p.a.createElement("span",{className:"v-line"}))}),Ne?p.a.createElement("li",null,p.a.createElement(v,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:Je},p.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,ft&&p.a.createElement("li",null,p.a.createElement(v,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(ft),onActionCallback:Je},p.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),p.a.createElement("li",{className:"btn-full-screen"},p.a.createElement(v,{icon:"".concat(mt?"icon-shrink":"icon-enlarge"),title:mt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:Je})))},F=Z("M8RZ"),B=Z("+L6B"),R=Z("2/Rp"),j=Z("y8nQ"),N=Z("Vl3Y"),y=Z("5NDa"),Y=Z("5rEg"),ee={labelCol:{span:4},wrapperCol:{span:20}},ae=function(ye){var Le=ye.callback,Ne=ye.onCancel;function Je(mt){Le(mt)}return p.a.createElement(N.a,Object(O.a)({},ee,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Je}),p.a.createElement(N.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},p.a.createElement(Y.a,null)),p.a.createElement(N.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},p.a.createElement(Y.a,null)),p.a.createElement("div",{className:"flex-container flex-end"},p.a.createElement(R.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(R.a,{type:"ghost",onClick:Ne},"\u53D6\u6D88")))},ue=Z("7ahc"),Re=Z("HmJG"),Ee=Z("BjJ7"),xe=N.a.useForm,Ce={width:280,marginRight:10},Oe={labelCol:{span:5},wrapperCol:{span:19}},pe=function(ye){var Le=ye.callback,Ne=ye.onCancel,Je=xe(),mt=Object(G.a)(Je,1),ft=mt[0];function Ct(Lt){Le(Lt)}function xt(Lt,vt){if(Lt.status===-1){U.b.error(Lt.message);return}ft.setFieldsValue({src:"/api/attachments/".concat(Lt.id),type:vt.type})}function Qe(Lt){var vt=Lt.target.files[0];Me(vt,xt)}return p.a.createElement(N.a,Object(O.a)({form:ft},Oe,{className:"upload-image-panel",onFinish:Ct}),p.a.createElement(N.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},p.a.createElement("div",{className:"flex-container"},p.a.createElement(N.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},p.a.createElement(Y.a,{style:Ce})),p.a.createElement(de,{onFileChange:Qe}))),p.a.createElement(N.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},p.a.createElement(Y.a,{style:{width:264}})),p.a.createElement(N.a.Item,{style:{textAlign:"right"}},p.a.createElement(R.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(R.a,{type:"ghost",onClick:Ne},"\u53D6\u6D88")))};function de(ye){var Le=ye.onFileChange;return p.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",p.a.createElement("input",{type:"file",onChange:Le}))}function Me(ye,Le){if(!ye)throw new String("\u6CA1\u6709\u6587\u4EF6");var Ne=new FormData;Ne.append("editormd-image-file",ye),Ne.append("file_param_name","editormd-image-file"),Ne.append("byxhr","true");var Je=new window.XMLHttpRequest;Je.withCredentials=!0,Je.addEventListener("load",function(mt){Le(JSON.parse(mt.target.responseText),ye)},!1),Je.addEventListener("error",function(mt){console.error(mt)},!1),Je.open("POST","".concat(Ee.a,"/api/attachments.json")),Je.send(Ne)}var tt=Z("giR+"),We=Z("fyUT"),rt=Z("7Kak"),st=Z("9yH6"),Pe=st.a.Group,je={margin:"0 8px"},Ze=function(ye){var Le=ye.callback,Ne=ye.onCancel;function Je(mt){Le(mt)}return p.a.createElement(N.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Je},p.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},p.a.createElement("span",{style:je},"\u5355\u5143\u683C\u6570\uFF1A"),p.a.createElement("span",{style:je},"\u884C\u6570"),p.a.createElement(N.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},p.a.createElement(We.a,null)),p.a.createElement("span",{style:je},"\u5217\u6570"),p.a.createElement(N.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},p.a.createElement(We.a,null))),p.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},p.a.createElement("span",{style:je},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),p.a.createElement(N.a.Item,{name:"align"},p.a.createElement(Pe,null,p.a.createElement(st.a,{value:"default"},p.a.createElement("i",{className:"fa fa-align-justify"})),p.a.createElement(st.a,{value:"left"},p.a.createElement("i",{className:"fa fa-align-left"})),p.a.createElement(st.a,{value:"center"},p.a.createElement("i",{className:"fa fa-align-center"})),p.a.createElement(st.a,{value:"right"},p.a.createElement("i",{className:"fa fa-align-right"}))))),p.a.createElement("div",{className:"flex-container flex-end"},p.a.createElement(R.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(R.a,{type:"ghost",onClick:Ne},"\u53D6\u6D88")))},se=Z("ErOA"),_e=Z("7Cbv"),Te="link",Ae="upload-image",ze="code-block",Be="add-table",Ue="------------",Ve={default:Ue,left:":".concat(Ue),center:":".concat(Ue,":"),right:"".concat(Ue,":")},$e=Z("9VGf"),Xe,et;function Ie(){}var nt=0,at=1e4,De="\u2581",ke=`
|
|
**\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 ve(ye){return/^\d+$/.test(ye)?"".concat(ye,"px"):ye}var ce=navigator.platform.toUpperCase().indexOf("MAC")>=0,fe=ce?"Cmd":"Ctrl",ie=["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"],ne=(Xe={},Object(H.a)(Xe,fe+"-B","bold"),Object(H.a)(Xe,fe+"-I","italic"),Xe),oe=(et={},Object(H.a)(et,Te,"\u6DFB\u52A0\u94FE\u63A5"),Object(H.a)(et,ze,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(H.a)(et,Ae,"\u6DFB\u52A0\u6587\u4EF6"),Object(H.a)(et,Be,"\u6DFB\u52A0\u8868\u683C"),et),le=be.a=function(ye){var Le=ye.defaultValue,Ne=Le===void 0?"":Le,Je=ye.onChange,mt=ye.width,ft=mt===void 0?"100%":mt,Ct=ye.height,xt=Ct===void 0?400:Ct,Qe=ye.miniToolbar,Lt=Qe===void 0?!1:Qe,vt=ye.isFocus,Ft=vt===void 0?!1:vt,Pt=ye.watch,Rt=ye.insertTemp,mn=ye.mode,sn=mn===void 0?"markdown":mn,bt=ye.id,tn=bt===void 0?"markdown-editor-id":bt,_t=ye.showResizeBar,Tt=_t===void 0?!1:_t,Wt=ye.noStorage,nn=Wt===void 0?!1:Wt,hn=ye.showNullButton,dt=hn===void 0?!1:hn,ut=ye.hidetoolBar,qt=ut===void 0?!1:ut,Ot=ye.fullScreen,Mt=Ot===void 0?!1:Ot,Dt=ye.onBlur,Ut=ye.onCMBeforeChange,dn=ye.onFullScreen,$n=ye.className,Ye=$n===void 0?"":$n,It=ye.disablePaste,mi=It===void 0?!1:It,gi=ye.placeholder,vi=gi===void 0?"":gi,yi=ye.values,V=yi===void 0?"":yi,_=Object(g.useState)(null),I=Object(G.a)(_,2),W=I[0],q=I[1],z=Object(g.useState)(Ne),ge=Object(G.a)(z,2),He=ge[0],it=ge[1],gt=Object(g.useState)(Pt),Ge=Object(G.a)(gt,2),wt=Ge[0],zt=Ge[1],en=Object(g.useState)(Mt),Wn=Object(G.a)(en,2),An=Wn[0],Rn=Wn[1],Qn=Object(g.useState)(""),Di=Object(G.a)(Qn,2),yn=Di[0],Vn=Di[1],ui=Object(g.useState)(0),hi=Object(G.a)(ui,2),Gn=hi[0],ki=hi[1],bi=Object(g.useState)(xt),zi=Object(G.a)(bi,2),Vi=zi[0],qn=zi[1],Jn=Object(g.useState)(!1),_i=Object(G.a)(Jn,2),dr=_i[0],Ei=_i[1],ln=Object(g.useRef)(Object(_e.a)()),Vt=Object(g.useRef)(!1),wn=Object(g.useRef)(),jt=Object(g.useRef)(),cn=Object(g.useRef)(),$t=Object(g.useRef)(),ri=Object(g.useRef)(),bn=function(){var yt=Object(k.a)(D.a.mark(function kt(){var St,Bt;return D.a.wrap(function(Zt){for(;;)switch(Zt.prev=Zt.next){case 0:return Zt.next=2,Object(se.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:ln.current}});case 2:Bt=Zt.sent,Bt!=null&&(St=Bt.attachments)!==null&&St!==void 0&&St.length&&(console.log("cm:",W,jt),Bt.attachments.map(function(Gt){Gt.content_type.indexOf("image")>-1?W.replaceSelection(".concat(Gt.content_type,")")):Gt.content_type.indexOf("video")>-1?W.replaceSelection('<video width="100%" controls src="'.concat(f.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):Gt.content_type.indexOf("pdf")>-1?W.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(Gt.id,"?type=").concat(Gt.content_type,'&disposition=inline" target="_blank">').concat(Gt.name,"</a>")):W.replaceSelection("[".concat(Gt.name,"](").concat(f.a.API_SERVER,"/api/attachments/").concat(Gt.id,"?type=").concat(Gt.content_type,")"))}));case 4:case"end":return Zt.stop()}},kt)}));return function(){return yt.apply(this,arguments)}}();Object(g.useEffect)(function(){it(V),W==null||W.setValue(V)},[V]),Object(g.useEffect)(function(){dn==null||dn(An)},[An]),Object(g.useEffect)(function(){if(jt.current){var yt=h.a.fromTextArea(jt.current,{mode:sn,lineNumbers:!Lt,lineWrapping:!0,value:Ne,autoCloseTags:!0,autoCloseBrackets:!0});Ft&&yt.focus();function kt(St,Bt){if(mi){Bt.preventDefault();return}var Kt=Bt.clipboardData;if(Kt){var Zt=Kt.types.toString(),Gt=Kt.items;if(Zt==="Files"||Kt.types.indexOf("Files")>-1){if(Bt.preventDefault(),sn=="stex")return;try{var gn,Pn=Gt[1];((gn=Gt[0])===null||gn===void 0?void 0:gn.kind)==="file"&&(Pn=Gt[0]);var Ht=Pn.getAsFile(),di=Ht.name.split(".").pop();Me(Ht,function(Xt){if(Xt.id){var Nn,On,Zn;(Ht==null||((Nn=Ht.type)===null||Nn===void 0)?void 0:Nn.indexOf("image"))>-1?yt.replaceSelection(".concat(Xt.content_type,")")):(Ht==null||((On=Ht.type)===null||On===void 0)?void 0:On.indexOf("video"))>-1?yt.replaceSelection('<video width="100%" controls src="'.concat(f.a.API_SERVER,"/api/attachments/").concat(Xt.id,'"></video>')):(Ht==null||((Zn=Ht.type)===null||Zn===void 0)?void 0:Zn.indexOf("pdf"))>-1?yt.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(Xt.id,"?type=").concat(Ht.type,'&disposition=inline" target="_blank">').concat(Ht.name,"</a>")):ie.includes(di)?yt.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(Xt.id,'?type=office&disposition=inline" target="_blank">').concat(Ht.name,"</a>")):yt.replaceSelection("[".concat(Ht.name,"](").concat(f.a.API_SERVER,"/api/attachments/").concat(Xt.id,"?type=").concat(Xt.content_type,")"))}else(Xt==null?void 0:Xt.status)===401&&(document.location.href="/user/login")})}catch(Xt){U.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return yt.on("paste",kt),yt.on("dragleave",function(St,Bt){cn.current.classList.remove("mouse-hover-md")}),yt.on("dragover",function(St,Bt){cn.current.classList.add("mouse-hover-md")}),yt.on("drop",function(St,Bt){cn.current.classList.add("mouse-hover-md");var Kt;if(Kt=Bt.dataTransfer.files,Kt.length>0){Bt.preventDefault(),Bt.stopPropagation();for(var Zt=function(Pn){var Ht=Kt[Pn],di=Ht.name.split(".").pop();Me(Ht,function(Xt){if(Xt.id){var Nn,On,Zn;(Ht==null||((Nn=Ht.type)===null||Nn===void 0)?void 0:Nn.indexOf("image"))>-1?yt.replaceSelection(".concat(Xt.content_type,")")):(Ht==null||((On=Ht.type)===null||On===void 0)?void 0:On.indexOf("video"))>-1?yt.replaceSelection('<video width="100%" controls src="'.concat(f.a.API_SERVER,"/api/attachments/").concat(Xt.id,'"></video>')):(Ht==null||((Zn=Ht.type)===null||Zn===void 0)?void 0:Zn.indexOf("pdf"))>-1?yt.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(Xt.id,"?type=").concat(Ht.type,'&disposition=inline" target="_blank">').concat(Ht.name,"</a>")):ie.includes(di)?yt.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(Xt.id,'?type=office&disposition=inline" target="_blank">').concat(Ht.name,"</a>")):yt.replaceSelection("[".concat(Ht.name,"](").concat(f.a.API_SERVER,"/api/attachments/").concat(Xt.id,"?type=").concat(Xt.content_type,")"))}else(Xt==null?void 0:Xt.status)===401&&(document.location.href="/user/login")})},Gt=0;Gt<Kt.length;Gt++)Zt(Gt)}}),q(yt),function(){yt.off("paste",kt)}}},[]);var Dn=Object(g.useCallback)(function(){if(cn.current)try{}catch(yt){console.log(yt,"---- to set md editor body height")}},[Vi,cn,An]);Object(g.useEffect)(function(){function yt(){var St=new o.default(function(Bt){var Kt=Object(P.a)(Bt),Zt;try{for(Kt.s();!(Zt=Kt.n()).done;){var Gt=Zt.value;(Gt.target.offsetHeight>0||Gt.target.offsetWidth>0)&&(Dn(),W.setSize("100%","100%"),W.refresh())}}catch(gn){Kt.e(gn)}finally{Kt.f()}});return St.observe(jt.current.parentElement),St}if(W){var kt=yt();return function(){kt.unobserve(jt.current.parentElement)}}},[W,Dn]),Object(g.useEffect)(function(){if(W){for(var yt=[],kt=function(){var Gt=Bt[St];Kt=Object(G.a)(Gt,2);var gn=Kt[0],Pn=Kt[1],Ht=Object(H.a)({},gn,function(){Xi(Pn)});yt.push(Ht),W.addKeyMap(Ht)},St=0,Bt=Object.entries(ne);St<Bt.length;St++){var Kt;kt()}return wn.current=setInterval(function(){Vt.current&&bn()},4e3),function(){clearInterval(wn.current);var Zt=Object(P.a)(yt),Gt;try{for(Zt.s();!(Gt=Zt.n()).done;){var gn=Gt.value;W.removeKeyMap(gn)}}catch(Pn){Zt.e(Pn)}finally{Zt.f()}}}},[W]),Object(g.useEffect)(function(){Mt!==An&&Rn(Mt)},[Mt]),Object($e.a)(function(){if(!nn&&Gn>0){var yt=new Date().getTime(),kt=window.sessionStorage.getItem(tn);yt>=Gn+at&&(!kt||kt!==He)&&(window.sessionStorage.setItem(tn,He),Ei(!0))}},at),Object(g.useEffect)(function(){zt(Pt)},[W,Pt]),Object(g.useEffect)(function(){W&&(Ft&&W.focus())},[W,Ft]),Object(g.useEffect)(function(){if(wt&&W){var yt=W.getScrollerElement();function kt(St){var Bt=St.target;if(ri.current){var Kt=Bt.scrollTop/Bt.scrollHeight;ri.current.scrollTop=ri.current.scrollHeight*Kt}}return yt.addEventListener("scroll",kt),function(){yt.removeEventListener("scroll",kt)}}},[W,wt]),Object(g.useEffect)(function(){if(W&&Ut){function yt(kt,St){Ut(kt,St)}return W.on("beforeChange",yt),function(){W.off("beforeChange",yt)}}},[W,Ut]),Object(g.useEffect)(function(){if(W&&Dt){function yt(){Dt(W.getValue())}return W.on("blur",yt),function(){W.off("blur",yt)}}},[W,Dt]),Object(g.useEffect)(function(){if(W){function yt(kt){var St=kt.getValue();it(St),ki(new Date().getTime()),kt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Je&&Je(St)}return W.on("change",yt),function(){W.off("change",yt)}}},[W,Je]),Object(g.useEffect)(function(){W&&(Ne==null?(W.setValue(""),it("")):Ne!==W.getValue()&&(W.setValue(Ne),it(Ne),W.setCursor(W.lineCount(),0)))},[W,Ne]);var Xi=Object(g.useCallback)(function(yt){var kt=W.getCursor(),St=W.getSelection(),Bt=St.split(`
|
|
`);switch(yt){case"bold":return W.replaceSelection("**"+St+"**"),St===""&&W.setCursor(kt.line,kt.ch+2),W.focus();case"italic":return W.replaceSelection("*"+St+"*"),St===""&&W.setCursor(kt.line,kt.ch+1),W.focus();case"code":return W.replaceSelection("`"+St+"`"),St===""&&W.setCursor(kt.line,kt.ch+1),W.focus();case"inline-latex":return W.replaceSelection("`$$"+St+"$$`"),St===""&&W.setCursor(kt.line,kt.ch+3),W.focus();case"latex":return W.replaceSelection("```latex\n"+St+"\n```"),W.setCursor(kt.line+1,St.length+1),W.focus();case"line-break":return W.replaceSelection(`<br/>
|
|
`),W.focus();case"list-ul":return St===""?W.replaceSelection("- "+St):W.replaceSelection(Bt.map(function(Kt){return Kt===""?"":"- ".concat(Kt)}).join(`
|
|
`)),W.focus();case"list-ol":return St===""?W.replaceSelection("1. "+St):W.replaceSelection(Bt.map(function(Kt,Zt){return Kt===""?"":"".concat(Zt+1,". ").concat(Kt)}).join(`
|
|
`)),W.focus();case"add-null-ch":return St===""&&W.setCursor(kt.line,kt.ch+1),W.replaceSelection(De),W.focus();case"inster-template-1":return St===""&&W.setCursor(kt.line,kt.ch),W.replaceSelection(ke),W.focus();case"eraser":return W.setValue(""),W.focus();case"trigger-watch":return zt(!wt),W.focus();case"trigger-full-screen":return Rn(!An),W.focus();case Te:Vn(Te);return;case ze:Vn(ze);return;case Ae:Vn(Ae);return;case Be:Vn(Be);return;default:throw new Error}},[W,wt,An]),xi=Object(g.useCallback)(function(yt){Vn("");switch(yn){case Te:var kt=yt.title,St=yt.link;return W.replaceSelection("[".concat(kt,"](").concat(St,")")),W.focus();case ze:var Bt=yt.language,Kt=yt.content;return W.replaceSelection(["```"+Bt,Kt,"```"].join(`
|
|
`)),W.focus();case Ae:var Zt=yt.src,Gt=yt.alt;return Gt?W.replaceSelection(".concat(Zt,' "').concat(Gt,'" )')):W.replaceSelection("")),W.focus();case Be:for(var gn=yt.row,Pn=yt.col,Ht=yt.align,di=`
|
|
`,Xt=0;Xt<gn;Xt++){for(var Nn=[],On=[],Zn=0;Zn<Pn;Zn++)Xt===1&&On.push(Ve[Ht]),Nn.push(" ");Xt===1&&(di+="| ".concat(On.join(" | "),` |
|
|
`)),di+="| ".concat(Nn.join(Pn===1?"":" | "),` |
|
|
`)}return W.replaceSelection(di+`
|
|
`),W.focus();default:throw new Error}},[W,yn]),cr=Object(g.useMemo)(function(){switch(yn){case Te:return p.a.createElement(ae,{callback:xi,onCancel:Ti});case ze:return p.a.createElement(ue.b,{callback:xi,onCancel:Ti});case Ae:return p.a.createElement(pe,{callback:xi,onCancel:Ti});case Be:return p.a.createElement(Ze,{callback:xi,onCancel:Ti});default:return null}},[yn]);function Ti(){Vn("")}Object(g.useEffect)(function(){if($t.current){var yt=$t.current,kt=!1,St=0;function Bt(Gt){kt=!0,St=Gt.pageY}function Kt(){kt=!1}function Zt(Gt){if(kt){var gn=Gt.pageY-St;gn<0&&(gn=0),gn>300&&(gn=300);var Pn=xt+gn+"px";qn(Pn)}}return yt.addEventListener("mousedown",Bt),document.addEventListener("mousemove",Zt),document.addEventListener("mouseup",Kt),function(){yt.removeEventListener("mousedown",Bt),document.removeEventListener("mousemove",Zt),document.removeEventListener("mouseup",Kt)}}},[W,$t]),Object(g.useEffect)(function(){qn(xt)},[xt]);var ai=ve(ft),fr=ve(Vi),ei={width:ai,height:fr},pr=Object(g.useMemo)(function(){if(Gn){var yt=new Date(Gn),kt=yt.getHours(),St=yt.getMinutes(),Bt=yt.getSeconds();return kt=kt<10?"0"+kt:kt,St=St<10?"0"+St:St,Bt=Bt<10?"0"+Bt:Bt,"".concat(kt,":").concat(St,":").concat(Bt)}return 0},[Gn]);function jr(){window.sessionStorage.removeItem(tn),Ei(!1),ki(0)}function Mi(){Ei(!1),ki(0),W.setValue(window.sessionStorage.getItem(tn))}function ua(yt,kt){var St=W.getValue();St=St.replace(yt,kt),it(St),W==null||W.setValue(St)}return p.a.createElement(g.Fragment,null,p.a.createElement("div",{className:"markdown-editor-wrapper",ref:cn},p.a.createElement("div",{className:"markdown-editor-container ".concat(Ye," ").concat(wt?"on-preview":""," ").concat(Lt?"mini":""," ").concat(An?"full-screen":""),style:ei},p.a.createElement(b,{insertTemp:Rt,watch:wt,fullScreen:An,showNullButton:dt,onActionCallback:Xi,hidetoolBar:qt,uuid:ln.current,setOpenPhones:function(){Vt.current=!0}}),p.a.createElement("div",{className:"markdown-editor-body"},p.a.createElement("div",{className:"codemirror-container"},p.a.createElement("textarea",{ref:jt,placeholder:vi})),wt?p.a.createElement("div",{ref:ri,className:"preview-container"},sn==="stex"&&p.a.createElement(L,{value:He}),sn!=="stex"&&p.a.createElement(S.a,{edit:!0,value:He,replaces:ua})):null))),Tt?p.a.createElement("a",{ref:$t,className:"editor-resize"}):null,p.a.createElement(F.a,null,oe[yn]?p.a.createElement($.a,{centered:!0,title:oe[yn],visible:!0,onCancel:Ti,footer:null,className:"markdown-popup-form"},cr):null))}},SJMd:function(ht,be){/**
|
|
* @license
|
|
* Copyright (C) 2006 Google Inc.
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/var Z,re,$,P=!1,X,U;window.PR_SHOULD_USE_CONTINUATION=!0;var k,G;(function(){var H=window,n=["break,continue,do,else,for,if,return,while"],D=[n,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],g=[D,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],p=[g,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],m=[g,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],h=[g,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],o="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",c=[g,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],l="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",u=[n,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],s=[n,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],a=[n,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],A=[p,h,m,c,l,u,s,a],E=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,S="str",L="kwd",O="com",C="typ",T="lit",x="pun",f="pln",w="tag",v="dec",b="src",F="atn",B="atv",R="nocode",j="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function N(Pe){for(var je=0,Ze=!1,se=!1,_e=0,Te=Pe.length;_e<Te;++_e){var Ae=Pe[_e];if(Ae.ignoreCase)se=!0;else if(/[a-z]/i.test(Ae.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Ze=!0,se=!1;break}}var ze={b:8,t:9,n:10,v:11,f:12,r:13};function Be(et){var Ie=et.charCodeAt(0);if(Ie!==92)return Ie;var nt=et.charAt(1);return Ie=ze[nt],Ie||("0"<=nt&&nt<="7"?parseInt(et.substring(1),8):nt==="u"||nt==="x"?parseInt(et.substring(2),16):et.charCodeAt(1))}function Ue(et){if(et<32)return(et<16?"\\x0":"\\x")+et.toString(16);var Ie=String.fromCharCode(et);return Ie==="\\"||Ie==="-"||Ie==="]"||Ie==="^"?"\\"+Ie:Ie}function Ve(et){var Ie=et.substring(1,et.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")),nt=[],at=Ie[0]==="^",De=["["];at&&De.push("^");for(var ke=at?1:0,ve=Ie.length;ke<ve;++ke){var ce=Ie[ke];if(/\\[bdsw]/i.test(ce))De.push(ce);else{var fe=Be(ce),ie;ke+2<ve&&Ie[ke+1]==="-"?(ie=Be(Ie[ke+2]),ke+=2):ie=fe,nt.push([fe,ie]),ie<65||fe>122||(ie<65||fe>90||nt.push([Math.max(65,fe)|32,Math.min(ie,90)|32]),ie<97||fe>122||nt.push([Math.max(97,fe)&~32,Math.min(ie,122)&~32]))}}nt.sort(function(ye,Le){return ye[0]-Le[0]||Le[1]-ye[1]});for(var ne=[],oe=[],ke=0;ke<nt.length;++ke){var le=nt[ke];le[0]<=oe[1]+1?oe[1]=Math.max(oe[1],le[1]):ne.push(oe=le)}for(var ke=0;ke<ne.length;++ke){var le=ne[ke];De.push(Ue(le[0])),le[1]>le[0]&&(le[1]+1>le[0]&&De.push("-"),De.push(Ue(le[1])))}return De.push("]"),De.join("")}function $e(et){for(var Ie=et.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")),nt=Ie.length,at=[],De=0,ke=0;De<nt;++De){var ve=Ie[De];if(ve==="(")++ke;else if(ve.charAt(0)==="\\"){var ce=+ve.substring(1);ce&&(ce<=ke?at[ce]=-1:Ie[De]=Ue(ce))}}for(var De=1;De<at.length;++De)at[De]===-1&&(at[De]=++je);for(var De=0,ke=0;De<nt;++De){var ve=Ie[De];if(ve==="(")++ke,at[ke]||(Ie[De]="(?:");else if(ve.charAt(0)==="\\"){var ce=+ve.substring(1);ce&&ce<=ke&&(Ie[De]="\\"+at[ce])}}for(var De=0;De<nt;++De)Ie[De]==="^"&&Ie[De+1]!=="^"&&(Ie[De]="");if(et.ignoreCase&&Ze)for(var De=0;De<nt;++De){var ve=Ie[De],fe=ve.charAt(0);ve.length>=2&&fe==="["?Ie[De]=Ve(ve):fe!=="\\"&&(Ie[De]=ve.replace(/[a-zA-Z]/g,function(oe){var le=oe.charCodeAt(0);return"["+String.fromCharCode(le&~32,le|32)+"]"}))}return Ie.join("")}for(var Xe=[],_e=0,Te=Pe.length;_e<Te;++_e){var Ae=Pe[_e];if(Ae.global||Ae.multiline)throw new Error(""+Ae);Xe.push("(?:"+$e(Ae)+")")}return new RegExp(Xe.join("|"),se?"gi":"g")}function y(Pe,je){var Ze=/(?:^|\s)nocode(?:\s|$)/,se=[],_e=0,Te=[],Ae=0;function ze(Be){var Ue=Be.nodeType;if(Ue==1){if(Ze.test(Be.className))return;for(var Ve=Be.firstChild;Ve;Ve=Ve.nextSibling)ze(Ve);var $e=Be.nodeName.toLowerCase();($e==="br"||$e==="li")&&(se[Ae]=`
|
|
`,Te[Ae<<1]=_e++,Te[Ae++<<1|1]=Be)}else if(Ue==3||Ue==4){var Xe=Be.nodeValue;Xe.length&&(je?Xe=Xe.replace(/\r\n?/g,`
|
|
`):Xe=Xe.replace(/[ \t\r\n]+/g," "),se[Ae]=Xe,Te[Ae<<1]=_e,_e+=Xe.length,Te[Ae++<<1|1]=Be)}}return ze(Pe),{sourceCode:se.join("").replace(/\n$/,""),spans:Te}}function Y(Pe,je,Ze,se,_e){if(!Ze)return;var Te={sourceNode:Pe,pre:1,langExtension:null,numberLines:null,sourceCode:Ze,spans:null,basePos:je,decorations:null};se(Te),_e.push.apply(_e,Te.decorations)}var ee=/\S/;function ae(Pe){for(var je=void 0,Ze=Pe.firstChild;Ze;Ze=Ze.nextSibling){var se=Ze.nodeType;je=se===1?je?Pe:Ze:se===3&&ee.test(Ze.nodeValue)?Pe:je}return je===Pe?void 0:je}function ue(Pe,je){var Ze={},se;(function(){for(var Ae=Pe.concat(je),ze=[],Be={},Ue=0,Ve=Ae.length;Ue<Ve;++Ue){var $e=Ae[Ue],Xe=$e[3];if(Xe)for(var et=Xe.length;--et>=0;)Ze[Xe.charAt(et)]=$e;var Ie=$e[1],nt=""+Ie;Be.hasOwnProperty(nt)||(ze.push(Ie),Be[nt]=null)}ze.push(/[\0-\uffff]/),se=N(ze)})();var _e=je.length,Te=function(Ae){for(var ze=Ae.sourceCode,Be=Ae.basePos,Ue=Ae.sourceNode,Ve=[Be,f],$e=0,Xe=ze.match(se)||[],et={},Ie=0,nt=Xe.length;Ie<nt;++Ie){var at=Xe[Ie],De=et[at],ke=void 0,ve;if(typeof De=="string")ve=!1;else{var ce=Ze[at.charAt(0)];if(ce)ke=at.match(ce[1]),De=ce[0];else{for(var fe=0;fe<_e;++fe)if(ce=je[fe],ke=at.match(ce[1]),ke){De=ce[0];break}ke||(De=f)}ve=De.length>=5&&De.substring(0,5)==="lang-",ve&&!(ke&&typeof ke[1]=="string")&&(ve=!1,De=b),ve||(et[at]=De)}var ie=$e;if($e+=at.length,!ve)Ve.push(Be+ie,De);else{var ne=ke[1],oe=at.indexOf(ne),le=oe+ne.length;ke[2]&&(le=at.length-ke[2].length,oe=le-ne.length);var ye=De.substring(5);Y(Ue,Be+ie,at.substring(0,oe),Te,Ve),Y(Ue,Be+ie+oe,ne,de(ye,ne),Ve),Y(Ue,Be+ie+le,at.substring(le),Te,Ve)}}Ae.decorations=Ve};return Te}function Re(Pe){var je=[],Ze=[];Pe.tripleQuotedStrings?je.push([S,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Pe.multiLineStrings?je.push([S,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):je.push([S,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Pe.verbatimStrings&&Ze.push([S,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var se=Pe.hashComments;se&&(Pe.cStyleComments?(se>1?je.push([O,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):je.push([O,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Ze.push([S,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):je.push([O,/^#[^\r\n]*/,null,"#"])),Pe.cStyleComments&&(Ze.push([O,/^\/\/[^\r\n]*/,null]),Ze.push([O,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var _e=Pe.regexLiterals;if(_e){var Te=_e>1?"":`
|
|
\r`,Ae=Te?".":"[\\S\\s]",ze="/(?=[^/*"+Te+"])(?:[^/\\x5B\\x5C"+Te+"]|\\x5C"+Ae+"|\\x5B(?:[^\\x5C\\x5D"+Te+"]|\\x5C"+Ae+")*(?:\\x5D|$))+/";Ze.push(["lang-regex",RegExp("^"+j+"("+ze+")")])}var Be=Pe.types;Be&&Ze.push([C,Be]);var Ue=(""+Pe.keywords).replace(/^ | $/g,"");Ue.length&&Ze.push([L,new RegExp("^(?:"+Ue.replace(/[\s,]+/g,"|")+")\\b"),null]),je.push([f,/^\s+/,null,` \r
|
|
\xA0`]);var Ve="^.[^\\s\\w.$@'\"`/\\\\]*";return Pe.regexLiterals&&(Ve+="(?!s*/)"),Ze.push([T,/^@[a-z_$][a-z_$@0-9]*/i,null],[C,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[f,/^[a-z_$][a-z_$@0-9]*/i,null],[T,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[f,/^\\[\s\S]?/,null],[x,new RegExp(Ve),null]),ue(je,Ze)}var Ee=Re({keywords:A,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function xe(Pe,je,Ze){for(var se=/(?:^|\s)nocode(?:\s|$)/,_e=/\r\n?|\n/,Te=Pe.ownerDocument,Ae=Te.createElement("li");Pe.firstChild;)Ae.appendChild(Pe.firstChild);var ze=[Ae];function Be(Ie){var nt=Ie.nodeType;if(nt==1&&!se.test(Ie.className))if(Ie.nodeName==="br")Ue(Ie),Ie.parentNode&&Ie.parentNode.removeChild(Ie);else for(var at=Ie.firstChild;at;at=at.nextSibling)Be(at);else if((nt==3||nt==4)&&Ze){var De=Ie.nodeValue,ke=De.match(_e);if(ke){var ve=De.substring(0,ke.index);Ie.nodeValue=ve;var ce=De.substring(ke.index+ke[0].length);if(ce){var fe=Ie.parentNode;fe.insertBefore(Te.createTextNode(ce),Ie.nextSibling)}Ue(Ie),ve||Ie.parentNode.removeChild(Ie)}}}function Ue(Ie){for(;!Ie.nextSibling;)if(Ie=Ie.parentNode,!Ie)return;function nt(ke,ve){var ce=ve?ke.cloneNode(!1):ke,fe=ke.parentNode;if(fe){var ie=nt(fe,1),ne=ke.nextSibling;ie.appendChild(ce);for(var oe=ne;oe;oe=ne)ne=oe.nextSibling,ie.appendChild(oe)}return ce}for(var at=nt(Ie.nextSibling,0),De;(De=at.parentNode)&&De.nodeType===1;)at=De;ze.push(at)}for(var Ve=0;Ve<ze.length;++Ve)Be(ze[Ve]);je===(je|0)&&ze[0].setAttribute("value",je);var $e=Te.createElement("ol");$e.className="linenums";for(var Xe=Math.max(0,je-1|0)||0,Ve=0,et=ze.length;Ve<et;++Ve)Ae=ze[Ve],Ae.className="L"+(Ve+Xe)%10,Ae.firstChild||Ae.appendChild(Te.createTextNode("\xA0")),$e.appendChild(Ae);Pe.appendChild($e)}function Ce(Pe){var je=/\bMSIE\s(\d+)/.exec(navigator.userAgent);je=je&&+je[1]<=8;var Ze=/\n/g,se=Pe.sourceCode,_e=se.length,Te=0,Ae=Pe.spans,ze=Ae.length,Be=0,Ue=Pe.decorations,Ve=Ue.length,$e=0;Ue[Ve]=_e;var Xe,et;for(et=Xe=0;et<Ve;)Ue[et]!==Ue[et+2]?(Ue[Xe++]=Ue[et++],Ue[Xe++]=Ue[et++]):et+=2;for(Ve=Xe,et=Xe=0;et<Ve;){for(var Ie=Ue[et],nt=Ue[et+1],at=et+2;at+2<=Ve&&Ue[at+1]===nt;)at+=2;Ue[Xe++]=Ie,Ue[Xe++]=nt,et=at}Ve=Ue.length=Xe;var De=Pe.sourceNode,ke="";De&&(ke=De.style.display,De.style.display="none");try{for(var ve=null;Be<ze;){var ce=Ae[Be],fe=Ae[Be+2]||_e,ie=Ue[$e+2]||_e,at=Math.min(fe,ie),ne=Ae[Be+1],oe;if(ne.nodeType!==1&&(oe=se.substring(Te,at))){je&&(oe=oe.replace(Ze,"\r")),ne.nodeValue=oe;var le=ne.ownerDocument,ye=le.createElement("span");ye.className=Ue[$e+1];var Le=ne.parentNode;Le.replaceChild(ye,ne),ye.appendChild(ne),Te<fe&&(Ae[Be+1]=ne=le.createTextNode(se.substring(at,fe)),Le.insertBefore(ne,ye.nextSibling))}Te=at,Te>=fe&&(Be+=2),Te>=ie&&($e+=2)}}finally{De&&(De.style.display=ke)}}var Oe={};function pe(Pe,je){for(var Ze=je.length;--Ze>=0;){var se=je[Ze];Oe.hasOwnProperty(se)?H.console&&console.warn("cannot override language handler %s",se):Oe[se]=Pe}}function de(Pe,je){return Pe&&Oe.hasOwnProperty(Pe)||(Pe=/^\s*</.test(je)?"default-markup":"default-code"),Oe[Pe]}pe(Ee,["default-code"]),pe(ue([],[[f,/^[^<?]+/],[v,/^<!\w[^>]*(?:>|$)/],[O,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[x,/^(?:<[%?]|[%?]>)/],["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"]),pe(ue([[f,/^[\s]+/,null,` \r
|
|
`],[B,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[w,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[F,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[x,/^[=<>\/]+/],["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"]),pe(ue([],[[B,/^[\s\S]+/]]),["uq.val"]),pe(Re({keywords:p,hashComments:!0,cStyleComments:!0,types:E}),["c","cc","cpp","cxx","cyc","m"]),pe(Re({keywords:"null,true,false"}),["json"]),pe(Re({keywords:h,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:E}),["cs"]),pe(Re({keywords:m,cStyleComments:!0}),["java"]),pe(Re({keywords:a,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),pe(Re({keywords:u,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),pe(Re({keywords:l,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),pe(Re({keywords:s,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),pe(Re({keywords:c,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),pe(Re({keywords:o,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),pe(ue([],[[S,/^[\s\S]+/]]),["regex"]);function Me(Pe){var je=Pe.langExtension;try{var Ze=y(Pe.sourceNode,Pe.pre),se=Ze.sourceCode;Pe.sourceCode=se,Pe.spans=Ze.spans,Pe.basePos=0,de(je,se)(Pe),Ce(Pe)}catch(_e){H.console&&console.log(_e&&_e.stack||_e)}}function tt(Pe,je,Ze){var se=Ze||!1,_e=je||null,Te=document.createElement("div");Te.innerHTML="<pre>"+Pe+"</pre>",Te=Te.firstChild,se&&xe(Te,se,!0);var Ae={langExtension:_e,numberLines:se,sourceNode:Te,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return Me(Ae),Te.innerHTML}function We(Pe,je){var Ze=je||document.body,se=Ze.ownerDocument||document;function _e(ce){return Ze.getElementsByTagName(ce)}for(var Te=[_e("pre"),_e("code"),_e("xmp")],Ae=[],ze=0;ze<Te.length;++ze)for(var Be=0,Ue=Te[ze].length;Be<Ue;++Be)Ae.push(Te[ze][Be]);Te=null;var Ve=Date;Ve.now||(Ve={now:function(){return+new Date}});var $e=0,Xe=/\blang(?:uage)?-([\w.]+)(?!\S)/,et=/\bprettyprint\b/,Ie=/\bprettyprinted\b/,nt=/pre|xmp/i,at=/^code$/i,De=/^(?:pre|code|xmp)$/i,ke={};function ve(){for(var ce=H.PR_SHOULD_USE_CONTINUATION?Ve.now()+250:Infinity;$e<Ae.length&&Ve.now()<ce;$e++){for(var fe=Ae[$e],ie=ke,ne=fe;ne=ne.previousSibling;){var oe=ne.nodeType,le=(oe===7||oe===8)&&ne.nodeValue;if(le?!/^\??prettify\b/.test(le):oe!==3||/\S/.test(ne.nodeValue))break;if(le){ie={},le.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Pt,Rt,mn){ie[Rt]=mn});break}}var ye=fe.className;if((ie!==ke||et.test(ye))&&!Ie.test(ye)){for(var Le=!1,Ne=fe.parentNode;Ne;Ne=Ne.parentNode){var Je=Ne.tagName;if(De.test(Je)&&Ne.className&&et.test(Ne.className)){Le=!0;break}}if(!Le){fe.className+=" prettyprinted";var mt=ie.lang;if(!mt){mt=ye.match(Xe);var ft;!mt&&(ft=ae(fe))&&at.test(ft.tagName)&&(mt=ft.className.match(Xe)),mt&&(mt=mt[1])}var Ct;if(nt.test(fe.tagName))Ct=1;else{var xt=fe.currentStyle,Qe=se.defaultView,Lt=xt?xt.whiteSpace:Qe&&Qe.getComputedStyle?Qe.getComputedStyle(fe,null).getPropertyValue("white-space"):0;Ct=Lt&&Lt.substring(0,3)==="pre"}var vt=ie.linenums;(vt=vt==="true"||+vt)||(vt=ye.match(/\blinenums\b(?::(\d+))?/),vt=vt?vt[1]&&vt[1].length?+vt[1]:!0:!1),vt&&xe(fe,vt,Ct);var Ft={langExtension:mt,sourceNode:fe,numberLines:vt,pre:Ct,sourceCode:null,basePos:null,spans:null,decorations:null};Me(Ft)}}}$e<Ae.length?H.setTimeout(ve,250):typeof Pe=="function"&&Pe()}ve()}var rt=H.PR={createSimpleLexer:ue,registerLangHandler:pe,sourceDecorator:Re,PR_ATTRIB_NAME:F,PR_ATTRIB_VALUE:B,PR_COMMENT:O,PR_DECLARATION:v,PR_KEYWORD:L,PR_LITERAL:T,PR_NOCODE:R,PR_PLAIN:f,PR_PUNCTUATION:x,PR_SOURCE:b,PR_STRING:S,PR_TAG:w,PR_TYPE:C,prettyPrintOne:P?H.prettyPrintOne=tt:k=tt,prettyPrint:G=P?H.prettyPrint=We:G=We},st=H.define;typeof st=="function"&&st.amd&&st("google-code-prettify",[],function(){return rt})})()},T8No:function(ht,be,Z){"use strict";Z.d(be,"a",function(){return G}),Z.d(be,"e",function(){return H}),Z.d(be,"c",function(){return x}),Z.d(be,"b",function(){return f}),Z.d(be,"d",function(){return w}),Z.d(be,"f",function(){return F});var re=Z("MNsG"),$=Z("N0LK"),P=Z("Cg/j");let X=re.k||"";const U=new Map;U.set("false",!1),U.set("true",!0),U.set("isMac",re.f),U.set("isLinux",re.d),U.set("isWindows",re.i),U.set("isWeb",re.h),U.set("isMacNative",re.f&&!re.h),U.set("isEdge",X.indexOf("Edg/")>=0),U.set("isFirefox",X.indexOf("Firefox")>=0),U.set("isChrome",X.indexOf("Chrome")>=0),U.set("isSafari",X.indexOf("Safari")>=0);const k=Object.prototype.hasOwnProperty;class G{static has(R){return p.create(R)}static equals(R,j){return m.create(R,j)}static regex(R,j){return S.create(R,j)}static not(R){return l.create(R)}static and(...R){return C.create(R,null)}static or(...R){return T.create(R,null,!0)}static deserialize(R,j=!1){return R?this._deserializeOrExpression(R,j):void 0}static _deserializeOrExpression(R,j){let N=R.split("||");return T.create(N.map(y=>this._deserializeAndExpression(y,j)),null,!0)}static _deserializeAndExpression(R,j){let N=R.split("&&");return C.create(N.map(y=>this._deserializeOne(y,j)),null)}static _deserializeOne(R,j){if(R=R.trim(),R.indexOf("!=")>=0){let N=R.split("!=");return c.create(N[0].trim(),this._deserializeValue(N[1],j))}if(R.indexOf("==")>=0){let N=R.split("==");return m.create(N[0].trim(),this._deserializeValue(N[1],j))}if(R.indexOf("=~")>=0){let N=R.split("=~");return S.create(N[0].trim(),this._deserializeRegexValue(N[1],j))}if(R.indexOf(" in ")>=0){let N=R.split(" in ");return h.create(N[0].trim(),N[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(R)){const N=R.split(">=");return a.create(N[0].trim(),N[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(R)){const N=R.split(">");return s.create(N[0].trim(),N[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(R)){const N=R.split("<=");return E.create(N[0].trim(),N[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(R)){const N=R.split("<");return A.create(N[0].trim(),N[1].trim())}return/^\!\s*/.test(R)?l.create(R.substr(1).trim()):p.create(R)}static _deserializeValue(R,j){if(R=R.trim(),R==="true")return!0;if(R==="false")return!1;let N=/^'([^']*)'$/.exec(R);return N?N[1].trim():R}static _deserializeRegexValue(R,j){if(Object($.C)(R)){if(j)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let N=R.indexOf("/"),y=R.lastIndexOf("/");if(N===y||N<0){if(j)throw new Error(`bad regexp-value '${R}', missing /-enclosure`);return console.warn(`bad regexp-value '${R}', missing /-enclosure`),null}let Y=R.slice(N+1,y),ee=R[y+1]==="i"?"i":"";try{return new RegExp(Y,ee)}catch(ae){if(j)throw new Error(`bad regexp-value '${R}', parse error: ${ae}`);return console.warn(`bad regexp-value '${R}', parse error: ${ae}`),null}}}function H(R,j){const N=R?R.substituteConstants():void 0,y=j?j.substituteConstants():void 0;return!N&&!y?!0:!N||!y?!1:N.equals(y)}function n(R,j){return R.cmp(j)}class D{constructor(){this.type=0}cmp(R){return this.type-R.type}equals(R){return R.type===this.type}substituteConstants(){return this}evaluate(R){return!1}serialize(){return"false"}keys(){return[]}negate(){return g.INSTANCE}}D.INSTANCE=new D;class g{constructor(){this.type=1}cmp(R){return this.type-R.type}equals(R){return R.type===this.type}substituteConstants(){return this}evaluate(R){return!0}serialize(){return"true"}keys(){return[]}negate(){return D.INSTANCE}}g.INSTANCE=new g;class p{constructor(R,j){this.key=R,this.negated=j,this.type=2}static create(R,j=null){const N=U.get(R);return typeof N=="boolean"?N?g.INSTANCE:D.INSTANCE:new p(R,j)}cmp(R){return R.type!==this.type?this.type-R.type:v(this.key,R.key)}equals(R){return R.type===this.type?this.key===R.key:!1}substituteConstants(){const R=U.get(this.key);return typeof R=="boolean"?R?g.INSTANCE:D.INSTANCE:this}evaluate(R){return!!R.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=l.create(this.key,this)),this.negated}}class m{constructor(R,j,N){this.key=R,this.value=j,this.negated=N,this.type=4}static create(R,j,N=null){if(typeof j=="boolean")return j?p.create(R,N):l.create(R,N);const y=U.get(R);if(typeof y=="boolean"){const Y=y?"true":"false";return j===Y?g.INSTANCE:D.INSTANCE}return new m(R,j,N)}cmp(R){return R.type!==this.type?this.type-R.type:b(this.key,this.value,R.key,R.value)}equals(R){return R.type===this.type?this.key===R.key&&this.value===R.value:!1}substituteConstants(){const R=U.get(this.key);if(typeof R=="boolean"){const j=R?"true":"false";return this.value===j?g.INSTANCE:D.INSTANCE}return this}evaluate(R){return R.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=c.create(this.key,this.value,this)),this.negated}}class h{constructor(R,j){this.key=R,this.valueKey=j,this.type=10,this.negated=null}static create(R,j){return new h(R,j)}cmp(R){return R.type!==this.type?this.type-R.type:b(this.key,this.valueKey,R.key,R.valueKey)}equals(R){return R.type===this.type?this.key===R.key&&this.valueKey===R.valueKey:!1}substituteConstants(){return this}evaluate(R){const j=R.getValue(this.valueKey),N=R.getValue(this.key);return Array.isArray(j)?j.indexOf(N)>=0:typeof N=="string"&&typeof j=="object"&&j!==null?k.call(j,N):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=o.create(this)),this.negated}}class o{constructor(R){this._actual=R,this.type=11}static create(R){return new o(R)}cmp(R){return R.type!==this.type?this.type-R.type:this._actual.cmp(R._actual)}equals(R){return R.type===this.type?this._actual.equals(R._actual):!1}substituteConstants(){return this}evaluate(R){return!this._actual.evaluate(R)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class c{constructor(R,j,N){this.key=R,this.value=j,this.negated=N,this.type=5}static create(R,j,N=null){if(typeof j=="boolean")return j?l.create(R,N):p.create(R,N);const y=U.get(R);if(typeof y=="boolean"){const Y=y?"true":"false";return j===Y?D.INSTANCE:g.INSTANCE}return new c(R,j,N)}cmp(R){return R.type!==this.type?this.type-R.type:b(this.key,this.value,R.key,R.value)}equals(R){return R.type===this.type?this.key===R.key&&this.value===R.value:!1}substituteConstants(){const R=U.get(this.key);if(typeof R=="boolean"){const j=R?"true":"false";return this.value===j?D.INSTANCE:g.INSTANCE}return this}evaluate(R){return R.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=m.create(this.key,this.value,this)),this.negated}}class l{constructor(R,j){this.key=R,this.negated=j,this.type=3}static create(R,j=null){const N=U.get(R);return typeof N=="boolean"?N?D.INSTANCE:g.INSTANCE:new l(R,j)}cmp(R){return R.type!==this.type?this.type-R.type:v(this.key,R.key)}equals(R){return R.type===this.type?this.key===R.key:!1}substituteConstants(){const R=U.get(this.key);return typeof R=="boolean"?R?D.INSTANCE:g.INSTANCE:this}evaluate(R){return!R.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=p.create(this.key,this)),this.negated}}function u(R,j){if(typeof R=="string"){const N=parseFloat(R);isNaN(N)||(R=N)}return typeof R=="string"||typeof R=="number"?j(R):D.INSTANCE}class s{constructor(R,j,N){this.key=R,this.value=j,this.negated=N,this.type=12}static create(R,j,N=null){return u(j,y=>new s(R,y,N))}cmp(R){return R.type!==this.type?this.type-R.type:b(this.key,this.value,R.key,R.value)}equals(R){return R.type===this.type?this.key===R.key&&this.value===R.value:!1}substituteConstants(){return this}evaluate(R){return typeof this.value=="string"?!1:parseFloat(R.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=E.create(this.key,this.value,this)),this.negated}}class a{constructor(R,j,N){this.key=R,this.value=j,this.negated=N,this.type=13}static create(R,j,N=null){return u(j,y=>new a(R,y,N))}cmp(R){return R.type!==this.type?this.type-R.type:b(this.key,this.value,R.key,R.value)}equals(R){return R.type===this.type?this.key===R.key&&this.value===R.value:!1}substituteConstants(){return this}evaluate(R){return typeof this.value=="string"?!1:parseFloat(R.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=A.create(this.key,this.value,this)),this.negated}}class A{constructor(R,j,N){this.key=R,this.value=j,this.negated=N,this.type=14}static create(R,j,N=null){return u(j,y=>new A(R,y,N))}cmp(R){return R.type!==this.type?this.type-R.type:b(this.key,this.value,R.key,R.value)}equals(R){return R.type===this.type?this.key===R.key&&this.value===R.value:!1}substituteConstants(){return this}evaluate(R){return typeof this.value=="string"?!1:parseFloat(R.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=a.create(this.key,this.value,this)),this.negated}}class E{constructor(R,j,N){this.key=R,this.value=j,this.negated=N,this.type=15}static create(R,j,N=null){return u(j,y=>new E(R,y,N))}cmp(R){return R.type!==this.type?this.type-R.type:b(this.key,this.value,R.key,R.value)}equals(R){return R.type===this.type?this.key===R.key&&this.value===R.value:!1}substituteConstants(){return this}evaluate(R){return typeof this.value=="string"?!1:parseFloat(R.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=s.create(this.key,this.value,this)),this.negated}}class S{constructor(R,j){this.key=R,this.regexp=j,this.type=7,this.negated=null}static create(R,j){return new S(R,j)}cmp(R){if(R.type!==this.type)return this.type-R.type;if(this.key<R.key)return-1;if(this.key>R.key)return 1;const j=this.regexp?this.regexp.source:"",N=R.regexp?R.regexp.source:"";return j<N?-1:j>N?1:0}equals(R){if(R.type===this.type){const j=this.regexp?this.regexp.source:"",N=R.regexp?R.regexp.source:"";return this.key===R.key&&j===N}return!1}substituteConstants(){return this}evaluate(R){let j=R.getValue(this.key);return this.regexp?this.regexp.test(j):!1}serialize(){const R=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${R}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=L.create(this)),this.negated}}class L{constructor(R){this._actual=R,this.type=8}static create(R){return new L(R)}cmp(R){return R.type!==this.type?this.type-R.type:this._actual.cmp(R._actual)}equals(R){return R.type===this.type?this._actual.equals(R._actual):!1}substituteConstants(){return this}evaluate(R){return!this._actual.evaluate(R)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function O(R){let j=null;for(let N=0,y=R.length;N<y;N++){const Y=R[N].substituteConstants();if(R[N]!==Y&&j===null){j=[];for(let ee=0;ee<N;ee++)j[ee]=R[ee]}j!==null&&(j[N]=Y)}return j===null?R:j}class C{constructor(R,j){this.expr=R,this.negated=j,this.type=6}static create(R,j){return C._normalizeArr(R,j)}cmp(R){if(R.type!==this.type)return this.type-R.type;if(this.expr.length<R.expr.length)return-1;if(this.expr.length>R.expr.length)return 1;for(let j=0,N=this.expr.length;j<N;j++){const y=n(this.expr[j],R.expr[j]);if(y!==0)return y}return 0}equals(R){if(R.type===this.type){if(this.expr.length!==R.expr.length)return!1;for(let j=0,N=this.expr.length;j<N;j++)if(!this.expr[j].equals(R.expr[j]))return!1;return!0}return!1}substituteConstants(){const R=O(this.expr);return R===this.expr?this:C.create(R,this.negated)}evaluate(R){for(let j=0,N=this.expr.length;j<N;j++)if(!this.expr[j].evaluate(R))return!1;return!0}static _normalizeArr(R,j){const N=[];let y=!1;for(const Y of R){if(!Y)continue;if(Y.type===1){y=!0;continue}if(Y.type===0)return D.INSTANCE;if(Y.type===6){N.push(...Y.expr);continue}N.push(Y)}if(N.length===0&&y)return g.INSTANCE;if(N.length===0)return;if(N.length===1)return N[0];N.sort(n);for(let Y=1;Y<N.length;Y++)N[Y-1].equals(N[Y])&&(N.splice(Y,1),Y--);if(N.length===1)return N[0];for(;N.length>1;){const Y=N[N.length-1];if(Y.type!==9)break;N.pop();const ee=N.pop(),ae=N.length===0,ue=T.create(Y.expr.map(Re=>C.create([Re,ee],null)),null,ae);ue&&(N.push(ue),N.sort(n))}return N.length===1?N[0]:new C(N,j)}serialize(){return this.expr.map(R=>R.serialize()).join(" && ")}keys(){const R=[];for(let j of this.expr)R.push(...j.keys());return R}negate(){if(!this.negated){const R=[];for(let j of this.expr)R.push(j.negate());this.negated=T.create(R,this,!0)}return this.negated}}class T{constructor(R,j){this.expr=R,this.negated=j,this.type=9}static create(R,j,N){return T._normalizeArr(R,j,N)}cmp(R){if(R.type!==this.type)return this.type-R.type;if(this.expr.length<R.expr.length)return-1;if(this.expr.length>R.expr.length)return 1;for(let j=0,N=this.expr.length;j<N;j++){const y=n(this.expr[j],R.expr[j]);if(y!==0)return y}return 0}equals(R){if(R.type===this.type){if(this.expr.length!==R.expr.length)return!1;for(let j=0,N=this.expr.length;j<N;j++)if(!this.expr[j].equals(R.expr[j]))return!1;return!0}return!1}substituteConstants(){const R=O(this.expr);return R===this.expr?this:T.create(R,this.negated,!1)}evaluate(R){for(let j=0,N=this.expr.length;j<N;j++)if(this.expr[j].evaluate(R))return!0;return!1}static _normalizeArr(R,j,N){let y=[],Y=!1;if(R){for(let ee=0,ae=R.length;ee<ae;ee++){const ue=R[ee];if(!ue)continue;if(ue.type===0){Y=!0;continue}if(ue.type===1)return g.INSTANCE;if(ue.type===9){y=y.concat(ue.expr);continue}y.push(ue)}if(y.length===0&&Y)return D.INSTANCE;y.sort(n)}if(y.length===0)return;if(y.length===1)return y[0];for(let ee=1;ee<y.length;ee++)y[ee-1].equals(y[ee])&&(y.splice(ee,1),ee--);if(y.length===1)return y[0];if(N){for(let ee=0;ee<y.length;ee++)for(let ae=ee+1;ae<y.length;ae++)F(y[ee],y[ae])&&(y.splice(ae,1),ae--);if(y.length===1)return y[0]}return new T(y,j)}serialize(){return this.expr.map(R=>R.serialize()).join(" || ")}keys(){const R=[];for(let j of this.expr)R.push(...j.keys());return R}negate(){if(!this.negated){let R=[];for(let j of this.expr)R.push(j.negate());for(;R.length>1;){const j=R.shift(),N=R.shift(),y=[];for(const ee of B(j))for(const ae of B(N))y.push(C.create([ee,ae],null));const Y=R.length===0;R.unshift(T.create(y,null,Y))}this.negated=R[0]}return this.negated}}class x extends p{constructor(R,j,N){super(R,null);this._defaultValue=j,typeof N=="object"?x._info.push(Object.assign(Object.assign({},N),{key:R})):N!==!0&&x._info.push({key:R,description:N,type:j!=null?typeof j:void 0})}static all(){return x._info.values()}bindTo(R){return R.createKey(this.key,this._defaultValue)}getValue(R){return R.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(R){return m.create(this.key,R)}}x._info=[];const f=Object(P.c)("contextKeyService"),w="setContext";function v(R,j){return R<j?-1:R>j?1:0}function b(R,j,N,y){return R<N?-1:R>N?1:j<y?-1:j>y?1:0}function F(R,j){if(j.type===6&&R.type!==9&&R.type!==6){for(const Y of j.expr)if(R.equals(Y))return!0}const N=R.negate(),y=B(N).concat(B(j));y.sort(n);for(let Y=0;Y<y.length;Y++){const ee=y[Y],ae=ee.negate();for(let ue=Y+1;ue<y.length;ue++){const Re=y[ue];if(ae.equals(Re))return!0}}return!1}function B(R){return R.type===9?R.expr:[R]}},TXwP:function(ht,be,Z){var re,$;(function(){var P;(function(){"use strict";var U=[,,function(n){function D(m){this.__parent=m,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}D.prototype.clone_empty=function(){var m=new D(this.__parent);return m.set_indent(this.__indent_count,this.__alignment_count),m},D.prototype.item=function(m){return m<0?this.__items[this.__items.length+m]:this.__items[m]},D.prototype.has_match=function(m){for(var h=this.__items.length-1;h>=0;h--)if(this.__items[h].match(m))return!0;return!1},D.prototype.set_indent=function(m,h){this.is_empty()&&(this.__indent_count=m||0,this.__alignment_count=h||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},D.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},D.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},D.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var m=this.__parent.current_line;return m.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),m.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),m.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,m.__items[0]===" "&&(m.__items.splice(0,1),m.__character_count-=1),!0}return!1},D.prototype.is_empty=function(){return this.__items.length===0},D.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},D.prototype.push=function(m){this.__items.push(m);var h=m.lastIndexOf(`
|
|
`);h!==-1?this.__character_count=m.length-h:this.__character_count+=m.length},D.prototype.pop=function(){var m=null;return this.is_empty()||(m=this.__items.pop(),this.__character_count-=m.length),m},D.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},D.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},D.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},D.prototype.toString=function(){var m="";return this.is_empty()?this.__parent.indent_empty_lines&&(m=this.__parent.get_indent_string(this.__indent_count)):(m=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),m+=this.__items.join("")),m};function g(m,h){this.__cache=[""],this.__indent_size=m.indent_size,this.__indent_string=m.indent_char,m.indent_with_tabs||(this.__indent_string=new Array(m.indent_size+1).join(m.indent_char)),h=h||"",m.indent_level>0&&(h=new Array(m.indent_level+1).join(this.__indent_string)),this.__base_string=h,this.__base_string_length=h.length}g.prototype.get_indent_size=function(m,h){var o=this.__base_string_length;return h=h||0,m<0&&(o=0),o+=m*this.__indent_size,o+=h,o},g.prototype.get_indent_string=function(m,h){var o=this.__base_string;return h=h||0,m<0&&(m=0,o=""),h+=m*this.__indent_size,this.__ensure_cache(h),o+=this.__cache[h],o},g.prototype.__ensure_cache=function(m){for(;m>=this.__cache.length;)this.__add_column()},g.prototype.__add_column=function(){var m=this.__cache.length,h=0,o="";this.__indent_size&&m>=this.__indent_size&&(h=Math.floor(m/this.__indent_size),m-=h*this.__indent_size,o=new Array(h+1).join(this.__indent_string)),m&&(o+=new Array(m+1).join(" ")),this.__cache.push(o)};function p(m,h){this.__indent_cache=new g(m,h),this.raw=!1,this._end_with_newline=m.end_with_newline,this.indent_size=m.indent_size,this.wrap_line_length=m.wrap_line_length,this.indent_empty_lines=m.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new D(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}p.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},p.prototype.get_line_number=function(){return this.__lines.length},p.prototype.get_indent_string=function(m,h){return this.__indent_cache.get_indent_string(m,h)},p.prototype.get_indent_size=function(m,h){return this.__indent_cache.get_indent_size(m,h)},p.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},p.prototype.add_new_line=function(m){return this.is_empty()||!m&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},p.prototype.get_code=function(m){this.trim(!0);var h=this.current_line.pop();h&&(h[h.length-1]===`
|
|
`&&(h=h.replace(/\n+$/g,"")),this.current_line.push(h)),this._end_with_newline&&this.__add_outputline();var o=this.__lines.join(`
|
|
`);return m!==`
|
|
`&&(o=o.replace(/[\n]/g,m)),o},p.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},p.prototype.set_indent=function(m,h){return m=m||0,h=h||0,this.next_line.set_indent(m,h),this.__lines.length>1?(this.current_line.set_indent(m,h),!0):(this.current_line.set_indent(),!1)},p.prototype.add_raw_token=function(m){for(var h=0;h<m.newlines;h++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(m.whitespace_before),this.current_line.push(m.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},p.prototype.add_token=function(m){this.__add_space_before_token(),this.current_line.push(m),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},p.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},p.prototype.remove_indent=function(m){for(var h=this.__lines.length;m<h;)this.__lines[m]._remove_indent(),m++;this.current_line._remove_wrap_indent()},p.prototype.trim=function(m){for(m=m===void 0?!1:m,this.current_line.trim();m&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},p.prototype.just_added_newline=function(){return this.current_line.is_empty()},p.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},p.prototype.ensure_empty_line_above=function(m,h){for(var o=this.__lines.length-2;o>=0;){var c=this.__lines[o];if(c.is_empty())break;if(c.item(0).indexOf(m)!==0&&c.item(-1)!==h){this.__lines.splice(o+1,0,new D(this)),this.previous_line=this.__lines[this.__lines.length-2];break}o--}},n.exports.Output=p},,,,function(n){function D(m,h){this.raw_options=g(m,h),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}D.prototype._get_array=function(m,h){var o=this.raw_options[m],c=h||[];return typeof o=="object"?o!==null&&typeof o.concat=="function"&&(c=o.concat()):typeof o=="string"&&(c=o.split(/[^a-zA-Z0-9_\/\-]+/)),c},D.prototype._get_boolean=function(m,h){var o=this.raw_options[m],c=o===void 0?!!h:!!o;return c},D.prototype._get_characters=function(m,h){var o=this.raw_options[m],c=h||"";return typeof o=="string"&&(c=o.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),c},D.prototype._get_number=function(m,h){var o=this.raw_options[m];h=parseInt(h,10),isNaN(h)&&(h=0);var c=parseInt(o,10);return isNaN(c)&&(c=h),c},D.prototype._get_selection=function(m,h,o){var c=this._get_selection_list(m,h,o);if(c.length!==1)throw new Error("Invalid Option Value: The option '"+m+`' can only be one of the following values:
|
|
`+h+`
|
|
You passed in: '`+this.raw_options[m]+"'");return c[0]},D.prototype._get_selection_list=function(m,h,o){if(!h||h.length===0)throw new Error("Selection list cannot be empty.");if(o=o||[h[0]],!this._is_valid_selection(o,h))throw new Error("Invalid Default Value!");var c=this._get_array(m,o);if(!this._is_valid_selection(c,h))throw new Error("Invalid Option Value: The option '"+m+`' can contain only the following values:
|
|
`+h+`
|
|
You passed in: '`+this.raw_options[m]+"'");return c},D.prototype._is_valid_selection=function(m,h){return m.length&&h.length&&!m.some(function(o){return h.indexOf(o)===-1})};function g(m,h){var o={};m=p(m);var c;for(c in m)c!==h&&(o[c]=m[c]);if(h&&m[h])for(c in m[h])o[c]=m[h][c];return o}function p(m){var h={},o;for(o in m){var c=o.replace(/-/g,"_");h[c]=m[o]}return h}n.exports.Options=D,n.exports.normalizeOpts=p,n.exports.mergeOpts=g},,function(n){var D=RegExp.prototype.hasOwnProperty("sticky");function g(p){this.__input=p||"",this.__input_length=this.__input.length,this.__position=0}g.prototype.restart=function(){this.__position=0},g.prototype.back=function(){this.__position>0&&(this.__position-=1)},g.prototype.hasNext=function(){return this.__position<this.__input_length},g.prototype.next=function(){var p=null;return this.hasNext()&&(p=this.__input.charAt(this.__position),this.__position+=1),p},g.prototype.peek=function(p){var m=null;return p=p||0,p+=this.__position,p>=0&&p<this.__input_length&&(m=this.__input.charAt(p)),m},g.prototype.__match=function(p,m){p.lastIndex=m;var h=p.exec(this.__input);return h&&!(D&&p.sticky)&&(h.index!==m&&(h=null)),h},g.prototype.test=function(p,m){return m=m||0,m+=this.__position,m>=0&&m<this.__input_length?!!this.__match(p,m):!1},g.prototype.testChar=function(p,m){var h=this.peek(m);return p.lastIndex=0,h!==null&&p.test(h)},g.prototype.match=function(p){var m=this.__match(p,this.__position);return m?this.__position+=m[0].length:m=null,m},g.prototype.read=function(p,m,h){var o="",c;return p&&(c=this.match(p),c&&(o+=c[0])),m&&(c||!p)&&(o+=this.readUntil(m,h)),o},g.prototype.readUntil=function(p,m){var h="",o=this.__position;p.lastIndex=this.__position;var c=p.exec(this.__input);return c?(o=c.index,m&&(o+=c[0].length)):o=this.__input_length,h=this.__input.substring(this.__position,o),this.__position=o,h},g.prototype.readUntilAfter=function(p){return this.readUntil(p,!0)},g.prototype.get_regexp=function(p,m){var h=null,o="g";return m&&D&&(o="y"),typeof p=="string"&&p!==""?h=new RegExp(p,o):p&&(h=new RegExp(p.source,o)),h},g.prototype.get_literal_regexp=function(p){return RegExp(p.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},g.prototype.peekUntilAfter=function(p){var m=this.__position,h=this.readUntilAfter(p);return this.__position=m,h},g.prototype.lookBack=function(p){var m=this.__position-1;return m>=p.length&&this.__input.substring(m-p.length,m).toLowerCase()===p},n.exports.InputScanner=g},,,,,function(n){function D(g,p){g=typeof g=="string"?g:g.source,p=typeof p=="string"?p:p.source,this.__directives_block_pattern=new RegExp(g+/ beautify( \w+[:]\w+)+ /.source+p,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(g+/\sbeautify\signore:end\s/.source+p,"g")}D.prototype.get_directives=function(g){if(!g.match(this.__directives_block_pattern))return null;var p={};this.__directive_pattern.lastIndex=0;for(var m=this.__directive_pattern.exec(g);m;)p[m[1]]=m[2],m=this.__directive_pattern.exec(g);return p},D.prototype.readIgnored=function(g){return g.readUntilAfter(this.__directives_end_ignore_pattern)},n.exports.Directives=D},,function(n,D,g){var p=g(16).Beautifier,m=g(17).Options;function h(o,c){var l=new p(o,c);return l.beautify()}n.exports=h,n.exports.defaultOptions=function(){return new m}},function(n,D,g){var p=g(17).Options,m=g(2).Output,h=g(8).InputScanner,o=g(13).Directives,c=new o(/\/\*/,/\*\//),l=/\r\n|[\r\n]/,u=/\r\n|[\r\n]/g,s=/\s/,a=/(?:\s|\n)+/g,A=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,E=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function S(L,O){this._source_text=L||"",this._options=new p(O),this._ch=null,this._input=null,this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}S.prototype.eatString=function(L){var O="";for(this._ch=this._input.next();this._ch;){if(O+=this._ch,this._ch==="\\")O+=this._input.next();else if(L.indexOf(this._ch)!==-1||this._ch===`
|
|
`)break;this._ch=this._input.next()}return O},S.prototype.eatWhitespace=function(L){for(var O=s.test(this._input.peek()),C=0;s.test(this._input.peek());)this._ch=this._input.next(),L&&this._ch===`
|
|
`&&((C===0||C<this._options.max_preserve_newlines)&&(C++,this._output.add_new_line(!0)));return O},S.prototype.foundNestedPseudoClass=function(){for(var L=0,O=1,C=this._input.peek(O);C;){if(C==="{")return!0;if(C==="(")L+=1;else if(C===")"){if(L===0)return!1;L-=1}else if(C===";"||C==="}")return!1;O++,C=this._input.peek(O)}return!1},S.prototype.print_string=function(L){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(L)},S.prototype.preserveSingleSpace=function(L){L&&(this._output.space_before_token=!0)},S.prototype.indent=function(){this._indentLevel++},S.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},S.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var L=this._source_text,O=this._options.eol;O==="auto"&&(O=`
|
|
`,L&&l.test(L||"")&&(O=L.match(l)[0])),L=L.replace(u,`
|
|
`);var C=L.match(/^[\t ]*/)[0];this._output=new m(this._options,C),this._input=new h(L),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var T=0,x=!1,f=!1,w=!1,v=!1,b=!1,F=!1,B=this._ch,R=!1,j,N,y;j=this._input.read(a),N=j!=="",y=B,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),B=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var Y=this._input.read(A),ee=c.get_directives(Y);ee&&ee.ignore==="start"&&(Y+=c.readIgnored(this._input)),this.print_string(Y),this.eatWhitespace(!0),this._output.add_new_line()}else if(this._ch==="/"&&this._input.peek()==="/")this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(E)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(N),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var ae=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);ae.match(/[ :]$/)&&(ae=this.eatString(": ").replace(/\s$/,""),this.print_string(ae),this._output.space_before_token=!0),ae=ae.replace(/\s$/,""),ae==="extend"?v=!0:ae==="import"&&(b=!0),ae in this.NESTED_AT_RULE?(this._nestedLevel+=1,ae in this.CONDITIONAL_GROUP_RULE&&(w=!0)):!x&&T===0&&ae.indexOf(":")!==-1&&(f=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(N),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")f&&(f=!1,this.outdent()),w?(w=!1,x=this._indentLevel>=this._nestedLevel):x=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&x&&(this._output.previous_line&&this._output.previous_line.item(-1)!=="{"&&this._output.ensure_empty_line_above("/",",")),this._output.space_before_token=!0,this._options.brace_style==="expand"?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(y==="("?this._output.space_before_token=!1:y!==","&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if(this._ch==="}")this.outdent(),this._output.add_new_line(),y==="{"&&this._output.trim(!0),b=!1,v=!1,f&&(this.outdent(),f=!1),this.print_string(this._ch),x=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&(this._input.peek()!=="}"&&this._output.add_new_line(!0)),this._input.peek()===")"&&(this._output.trim(!0),this._options.brace_style==="expand"&&this._output.add_new_line(!0));else if(this._ch===":"){for(var ue=0;ue<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;ue++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[ue])){R=!0;break}(x||w)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!v&&T===0?(this.print_string(":"),f||(f=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):(this._input.lookBack(" ")&&(this._output.space_before_token=!0),this._input.peek()===":"?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":"))}else if(this._ch==='"'||this._ch==="'"){var Re=y==='"'||y==="'";this.preserveSingleSpace(Re||N),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")R=!1,T===0?(f&&(this.outdent(),f=!1),v=!1,b=!1,this.print_string(this._ch),this.eatWhitespace(!0),this._input.peek()!=="/"&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0);else if(this._ch==="(")if(this._input.lookBack("url"))this.print_string(this._ch),this.eatWhitespace(),T++,this.indent(),this._ch=this._input.next(),this._ch===")"||this._ch==='"'||this._ch==="'"?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),T&&(T--,this.outdent()));else{var Ee=!1;this._input.lookBack("with")&&(Ee=!0),this.preserveSingleSpace(N||Ee),this.print_string(this._ch),f&&y==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),F=!0):(this.eatWhitespace(),T++,this.indent())}else if(this._ch===")")T&&(T--,this.outdent()),F&&this._input.peek()===";"&&this._options.selector_separator_newline&&(F=!1,this.outdent(),this._output.add_new_line()),this.print_string(this._ch);else if(this._ch===",")this.print_string(this._ch),this.eatWhitespace(!0),this._options.selector_separator_newline&&(!f||F)&&T===0&&!b&&!v?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!f&&T===0)this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&s.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(N),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),s.test(this._ch)&&(this._ch="");else if(this._ch==="!"&&!this._input.lookBack("\\"))this._output.space_before_token=!0,this.print_string(this._ch);else{var xe=y==='"'||y==="'";this.preserveSingleSpace(xe||N),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
|
|
`&&R&&this._output.add_new_line()}var Ce=this._output.get_code(O);return Ce},n.exports.Beautifier=S},function(n,D,g){var p=g(6).Options;function m(h){p.call(this,h,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var o=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||o;var c=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var l=0;l<c.length;l++)c[l]!=="expand"?this.brace_style="collapse":this.brace_style=c[l]}m.prototype=new p,n.exports.Options=m}],k={};function G(n){var D=k[n];if(D!==void 0)return D.exports;var g=k[n]={exports:{}};return U[n](g,g.exports,G),g.exports}var H=G(15);P=H})();var X=P;!(re=[],$=function(){return{css_beautify:X}}.apply(be,re),$!==void 0&&(ht.exports=$))})()},UZu5:function(ht,be,Z){},Vhoy:function(ht,be,Z){"use strict";Z.d(be,"d",function(){return X}),Z.d(be,"e",function(){return U}),Z.d(be,"c",function(){return k}),Z.d(be,"b",function(){return G}),Z.d(be,"a",function(){return H});var re=Z("MI8n");class ${constructor(){this._icons=new Map,this._onDidRegister=new re.b}add(n){const D=this._icons.get(n.id);D?n.description?D.description=n.description:console.error(`Duplicate registration of codicon ${n.id}`):(this._icons.set(n.id,n),this._onDidRegister.fire(n))}get(n){return this._icons.get(n)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}}const P=new $,X=P;function U(n,D){return new G(n,D)}function k(n){return n?n.replace(/\$\((.*?)\)/g,(D,g)=>` ${g} `).trim():""}class G{constructor(n,D,g){this.id=n,this.definition=D,this.description=g,P.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var H;(function(n){n.iconNameSegment="[A-Za-z0-9]+",n.iconNameExpression="[A-Za-z0-9\\-]+",n.iconModifierExpression="~[A-Za-z]+";const D=new RegExp(`^(${n.iconNameExpression})(${n.iconModifierExpression})?$`);function g(h){if(h instanceof G)return["codicon","codicon-"+h.id];const o=D.exec(h.id);if(!o)return g(G.error);let[,c,l]=o;const u=["codicon","codicon-"+c];return l&&u.push("codicon-modifier-"+l.substr(1)),u}n.asClassNameArray=g;function p(h){return g(h).join(" ")}n.asClassName=p;function m(h){return"."+g(h).join(".")}n.asCSSSelector=m})(H||(H={})),function(n){n.add=new n("add",{fontCharacter:"\\ea60"}),n.plus=new n("plus",n.add.definition),n.gistNew=new n("gist-new",n.add.definition),n.repoCreate=new n("repo-create",n.add.definition),n.lightbulb=new n("lightbulb",{fontCharacter:"\\ea61"}),n.lightBulb=new n("light-bulb",{fontCharacter:"\\ea61"}),n.repo=new n("repo",{fontCharacter:"\\ea62"}),n.repoDelete=new n("repo-delete",{fontCharacter:"\\ea62"}),n.gistFork=new n("gist-fork",{fontCharacter:"\\ea63"}),n.repoForked=new n("repo-forked",{fontCharacter:"\\ea63"}),n.gitPullRequest=new n("git-pull-request",{fontCharacter:"\\ea64"}),n.gitPullRequestAbandoned=new n("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),n.recordKeys=new n("record-keys",{fontCharacter:"\\ea65"}),n.keyboard=new n("keyboard",{fontCharacter:"\\ea65"}),n.tag=new n("tag",{fontCharacter:"\\ea66"}),n.tagAdd=new n("tag-add",{fontCharacter:"\\ea66"}),n.tagRemove=new n("tag-remove",{fontCharacter:"\\ea66"}),n.person=new n("person",{fontCharacter:"\\ea67"}),n.personFollow=new n("person-follow",{fontCharacter:"\\ea67"}),n.personOutline=new n("person-outline",{fontCharacter:"\\ea67"}),n.personFilled=new n("person-filled",{fontCharacter:"\\ea67"}),n.gitBranch=new n("git-branch",{fontCharacter:"\\ea68"}),n.gitBranchCreate=new n("git-branch-create",{fontCharacter:"\\ea68"}),n.gitBranchDelete=new n("git-branch-delete",{fontCharacter:"\\ea68"}),n.sourceControl=new n("source-control",{fontCharacter:"\\ea68"}),n.mirror=new n("mirror",{fontCharacter:"\\ea69"}),n.mirrorPublic=new n("mirror-public",{fontCharacter:"\\ea69"}),n.star=new n("star",{fontCharacter:"\\ea6a"}),n.starAdd=new n("star-add",{fontCharacter:"\\ea6a"}),n.starDelete=new n("star-delete",{fontCharacter:"\\ea6a"}),n.starEmpty=new n("star-empty",{fontCharacter:"\\ea6a"}),n.comment=new n("comment",{fontCharacter:"\\ea6b"}),n.commentAdd=new n("comment-add",{fontCharacter:"\\ea6b"}),n.alert=new n("alert",{fontCharacter:"\\ea6c"}),n.warning=new n("warning",{fontCharacter:"\\ea6c"}),n.search=new n("search",{fontCharacter:"\\ea6d"}),n.searchSave=new n("search-save",{fontCharacter:"\\ea6d"}),n.logOut=new n("log-out",{fontCharacter:"\\ea6e"}),n.signOut=new n("sign-out",{fontCharacter:"\\ea6e"}),n.logIn=new n("log-in",{fontCharacter:"\\ea6f"}),n.signIn=new n("sign-in",{fontCharacter:"\\ea6f"}),n.eye=new n("eye",{fontCharacter:"\\ea70"}),n.eyeUnwatch=new n("eye-unwatch",{fontCharacter:"\\ea70"}),n.eyeWatch=new n("eye-watch",{fontCharacter:"\\ea70"}),n.circleFilled=new n("circle-filled",{fontCharacter:"\\ea71"}),n.primitiveDot=new n("primitive-dot",{fontCharacter:"\\ea71"}),n.closeDirty=new n("close-dirty",{fontCharacter:"\\ea71"}),n.debugBreakpoint=new n("debug-breakpoint",{fontCharacter:"\\ea71"}),n.debugBreakpointDisabled=new n("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),n.debugHint=new n("debug-hint",{fontCharacter:"\\ea71"}),n.primitiveSquare=new n("primitive-square",{fontCharacter:"\\ea72"}),n.edit=new n("edit",{fontCharacter:"\\ea73"}),n.pencil=new n("pencil",{fontCharacter:"\\ea73"}),n.info=new n("info",{fontCharacter:"\\ea74"}),n.issueOpened=new n("issue-opened",{fontCharacter:"\\ea74"}),n.gistPrivate=new n("gist-private",{fontCharacter:"\\ea75"}),n.gitForkPrivate=new n("git-fork-private",{fontCharacter:"\\ea75"}),n.lock=new n("lock",{fontCharacter:"\\ea75"}),n.mirrorPrivate=new n("mirror-private",{fontCharacter:"\\ea75"}),n.close=new n("close",{fontCharacter:"\\ea76"}),n.removeClose=new n("remove-close",{fontCharacter:"\\ea76"}),n.x=new n("x",{fontCharacter:"\\ea76"}),n.repoSync=new n("repo-sync",{fontCharacter:"\\ea77"}),n.sync=new n("sync",{fontCharacter:"\\ea77"}),n.clone=new n("clone",{fontCharacter:"\\ea78"}),n.desktopDownload=new n("desktop-download",{fontCharacter:"\\ea78"}),n.beaker=new n("beaker",{fontCharacter:"\\ea79"}),n.microscope=new n("microscope",{fontCharacter:"\\ea79"}),n.vm=new n("vm",{fontCharacter:"\\ea7a"}),n.deviceDesktop=new n("device-desktop",{fontCharacter:"\\ea7a"}),n.file=new n("file",{fontCharacter:"\\ea7b"}),n.fileText=new n("file-text",{fontCharacter:"\\ea7b"}),n.more=new n("more",{fontCharacter:"\\ea7c"}),n.ellipsis=new n("ellipsis",{fontCharacter:"\\ea7c"}),n.kebabHorizontal=new n("kebab-horizontal",{fontCharacter:"\\ea7c"}),n.mailReply=new n("mail-reply",{fontCharacter:"\\ea7d"}),n.reply=new n("reply",{fontCharacter:"\\ea7d"}),n.organization=new n("organization",{fontCharacter:"\\ea7e"}),n.organizationFilled=new n("organization-filled",{fontCharacter:"\\ea7e"}),n.organizationOutline=new n("organization-outline",{fontCharacter:"\\ea7e"}),n.newFile=new n("new-file",{fontCharacter:"\\ea7f"}),n.fileAdd=new n("file-add",{fontCharacter:"\\ea7f"}),n.newFolder=new n("new-folder",{fontCharacter:"\\ea80"}),n.fileDirectoryCreate=new n("file-directory-create",{fontCharacter:"\\ea80"}),n.trash=new n("trash",{fontCharacter:"\\ea81"}),n.trashcan=new n("trashcan",{fontCharacter:"\\ea81"}),n.history=new n("history",{fontCharacter:"\\ea82"}),n.clock=new n("clock",{fontCharacter:"\\ea82"}),n.folder=new n("folder",{fontCharacter:"\\ea83"}),n.fileDirectory=new n("file-directory",{fontCharacter:"\\ea83"}),n.symbolFolder=new n("symbol-folder",{fontCharacter:"\\ea83"}),n.logoGithub=new n("logo-github",{fontCharacter:"\\ea84"}),n.markGithub=new n("mark-github",{fontCharacter:"\\ea84"}),n.github=new n("github",{fontCharacter:"\\ea84"}),n.terminal=new n("terminal",{fontCharacter:"\\ea85"}),n.console=new n("console",{fontCharacter:"\\ea85"}),n.repl=new n("repl",{fontCharacter:"\\ea85"}),n.zap=new n("zap",{fontCharacter:"\\ea86"}),n.symbolEvent=new n("symbol-event",{fontCharacter:"\\ea86"}),n.error=new n("error",{fontCharacter:"\\ea87"}),n.stop=new n("stop",{fontCharacter:"\\ea87"}),n.variable=new n("variable",{fontCharacter:"\\ea88"}),n.symbolVariable=new n("symbol-variable",{fontCharacter:"\\ea88"}),n.array=new n("array",{fontCharacter:"\\ea8a"}),n.symbolArray=new n("symbol-array",{fontCharacter:"\\ea8a"}),n.symbolModule=new n("symbol-module",{fontCharacter:"\\ea8b"}),n.symbolPackage=new n("symbol-package",{fontCharacter:"\\ea8b"}),n.symbolNamespace=new n("symbol-namespace",{fontCharacter:"\\ea8b"}),n.symbolObject=new n("symbol-object",{fontCharacter:"\\ea8b"}),n.symbolMethod=new n("symbol-method",{fontCharacter:"\\ea8c"}),n.symbolFunction=new n("symbol-function",{fontCharacter:"\\ea8c"}),n.symbolConstructor=new n("symbol-constructor",{fontCharacter:"\\ea8c"}),n.symbolBoolean=new n("symbol-boolean",{fontCharacter:"\\ea8f"}),n.symbolNull=new n("symbol-null",{fontCharacter:"\\ea8f"}),n.symbolNumeric=new n("symbol-numeric",{fontCharacter:"\\ea90"}),n.symbolNumber=new n("symbol-number",{fontCharacter:"\\ea90"}),n.symbolStructure=new n("symbol-structure",{fontCharacter:"\\ea91"}),n.symbolStruct=new n("symbol-struct",{fontCharacter:"\\ea91"}),n.symbolParameter=new n("symbol-parameter",{fontCharacter:"\\ea92"}),n.symbolTypeParameter=new n("symbol-type-parameter",{fontCharacter:"\\ea92"}),n.symbolKey=new n("symbol-key",{fontCharacter:"\\ea93"}),n.symbolText=new n("symbol-text",{fontCharacter:"\\ea93"}),n.symbolReference=new n("symbol-reference",{fontCharacter:"\\ea94"}),n.goToFile=new n("go-to-file",{fontCharacter:"\\ea94"}),n.symbolEnum=new n("symbol-enum",{fontCharacter:"\\ea95"}),n.symbolValue=new n("symbol-value",{fontCharacter:"\\ea95"}),n.symbolRuler=new n("symbol-ruler",{fontCharacter:"\\ea96"}),n.symbolUnit=new n("symbol-unit",{fontCharacter:"\\ea96"}),n.activateBreakpoints=new n("activate-breakpoints",{fontCharacter:"\\ea97"}),n.archive=new n("archive",{fontCharacter:"\\ea98"}),n.arrowBoth=new n("arrow-both",{fontCharacter:"\\ea99"}),n.arrowDown=new n("arrow-down",{fontCharacter:"\\ea9a"}),n.arrowLeft=new n("arrow-left",{fontCharacter:"\\ea9b"}),n.arrowRight=new n("arrow-right",{fontCharacter:"\\ea9c"}),n.arrowSmallDown=new n("arrow-small-down",{fontCharacter:"\\ea9d"}),n.arrowSmallLeft=new n("arrow-small-left",{fontCharacter:"\\ea9e"}),n.arrowSmallRight=new n("arrow-small-right",{fontCharacter:"\\ea9f"}),n.arrowSmallUp=new n("arrow-small-up",{fontCharacter:"\\eaa0"}),n.arrowUp=new n("arrow-up",{fontCharacter:"\\eaa1"}),n.bell=new n("bell",{fontCharacter:"\\eaa2"}),n.bold=new n("bold",{fontCharacter:"\\eaa3"}),n.book=new n("book",{fontCharacter:"\\eaa4"}),n.bookmark=new n("bookmark",{fontCharacter:"\\eaa5"}),n.debugBreakpointConditionalUnverified=new n("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),n.debugBreakpointConditional=new n("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),n.debugBreakpointConditionalDisabled=new n("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),n.debugBreakpointDataUnverified=new n("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),n.debugBreakpointData=new n("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),n.debugBreakpointDataDisabled=new n("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),n.debugBreakpointLogUnverified=new n("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),n.debugBreakpointLog=new n("debug-breakpoint-log",{fontCharacter:"\\eaab"}),n.debugBreakpointLogDisabled=new n("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),n.briefcase=new n("briefcase",{fontCharacter:"\\eaac"}),n.broadcast=new n("broadcast",{fontCharacter:"\\eaad"}),n.browser=new n("browser",{fontCharacter:"\\eaae"}),n.bug=new n("bug",{fontCharacter:"\\eaaf"}),n.calendar=new n("calendar",{fontCharacter:"\\eab0"}),n.caseSensitive=new n("case-sensitive",{fontCharacter:"\\eab1"}),n.check=new n("check",{fontCharacter:"\\eab2"}),n.checklist=new n("checklist",{fontCharacter:"\\eab3"}),n.chevronDown=new n("chevron-down",{fontCharacter:"\\eab4"}),n.dropDownButton=new n("drop-down-button",n.chevronDown.definition),n.chevronLeft=new n("chevron-left",{fontCharacter:"\\eab5"}),n.chevronRight=new n("chevron-right",{fontCharacter:"\\eab6"}),n.chevronUp=new n("chevron-up",{fontCharacter:"\\eab7"}),n.chromeClose=new n("chrome-close",{fontCharacter:"\\eab8"}),n.chromeMaximize=new n("chrome-maximize",{fontCharacter:"\\eab9"}),n.chromeMinimize=new n("chrome-minimize",{fontCharacter:"\\eaba"}),n.chromeRestore=new n("chrome-restore",{fontCharacter:"\\eabb"}),n.circleOutline=new n("circle-outline",{fontCharacter:"\\eabc"}),n.debugBreakpointUnverified=new n("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),n.circleSlash=new n("circle-slash",{fontCharacter:"\\eabd"}),n.circuitBoard=new n("circuit-board",{fontCharacter:"\\eabe"}),n.clearAll=new n("clear-all",{fontCharacter:"\\eabf"}),n.clippy=new n("clippy",{fontCharacter:"\\eac0"}),n.closeAll=new n("close-all",{fontCharacter:"\\eac1"}),n.cloudDownload=new n("cloud-download",{fontCharacter:"\\eac2"}),n.cloudUpload=new n("cloud-upload",{fontCharacter:"\\eac3"}),n.code=new n("code",{fontCharacter:"\\eac4"}),n.collapseAll=new n("collapse-all",{fontCharacter:"\\eac5"}),n.colorMode=new n("color-mode",{fontCharacter:"\\eac6"}),n.commentDiscussion=new n("comment-discussion",{fontCharacter:"\\eac7"}),n.compareChanges=new n("compare-changes",{fontCharacter:"\\eafd"}),n.creditCard=new n("credit-card",{fontCharacter:"\\eac9"}),n.dash=new n("dash",{fontCharacter:"\\eacc"}),n.dashboard=new n("dashboard",{fontCharacter:"\\eacd"}),n.database=new n("database",{fontCharacter:"\\eace"}),n.debugContinue=new n("debug-continue",{fontCharacter:"\\eacf"}),n.debugDisconnect=new n("debug-disconnect",{fontCharacter:"\\ead0"}),n.debugPause=new n("debug-pause",{fontCharacter:"\\ead1"}),n.debugRestart=new n("debug-restart",{fontCharacter:"\\ead2"}),n.debugStart=new n("debug-start",{fontCharacter:"\\ead3"}),n.debugStepInto=new n("debug-step-into",{fontCharacter:"\\ead4"}),n.debugStepOut=new n("debug-step-out",{fontCharacter:"\\ead5"}),n.debugStepOver=new n("debug-step-over",{fontCharacter:"\\ead6"}),n.debugStop=new n("debug-stop",{fontCharacter:"\\ead7"}),n.debug=new n("debug",{fontCharacter:"\\ead8"}),n.deviceCameraVideo=new n("device-camera-video",{fontCharacter:"\\ead9"}),n.deviceCamera=new n("device-camera",{fontCharacter:"\\eada"}),n.deviceMobile=new n("device-mobile",{fontCharacter:"\\eadb"}),n.diffAdded=new n("diff-added",{fontCharacter:"\\eadc"}),n.diffIgnored=new n("diff-ignored",{fontCharacter:"\\eadd"}),n.diffModified=new n("diff-modified",{fontCharacter:"\\eade"}),n.diffRemoved=new n("diff-removed",{fontCharacter:"\\eadf"}),n.diffRenamed=new n("diff-renamed",{fontCharacter:"\\eae0"}),n.diff=new n("diff",{fontCharacter:"\\eae1"}),n.discard=new n("discard",{fontCharacter:"\\eae2"}),n.editorLayout=new n("editor-layout",{fontCharacter:"\\eae3"}),n.emptyWindow=new n("empty-window",{fontCharacter:"\\eae4"}),n.exclude=new n("exclude",{fontCharacter:"\\eae5"}),n.extensions=new n("extensions",{fontCharacter:"\\eae6"}),n.eyeClosed=new n("eye-closed",{fontCharacter:"\\eae7"}),n.fileBinary=new n("file-binary",{fontCharacter:"\\eae8"}),n.fileCode=new n("file-code",{fontCharacter:"\\eae9"}),n.fileMedia=new n("file-media",{fontCharacter:"\\eaea"}),n.filePdf=new n("file-pdf",{fontCharacter:"\\eaeb"}),n.fileSubmodule=new n("file-submodule",{fontCharacter:"\\eaec"}),n.fileSymlinkDirectory=new n("file-symlink-directory",{fontCharacter:"\\eaed"}),n.fileSymlinkFile=new n("file-symlink-file",{fontCharacter:"\\eaee"}),n.fileZip=new n("file-zip",{fontCharacter:"\\eaef"}),n.files=new n("files",{fontCharacter:"\\eaf0"}),n.filter=new n("filter",{fontCharacter:"\\eaf1"}),n.flame=new n("flame",{fontCharacter:"\\eaf2"}),n.foldDown=new n("fold-down",{fontCharacter:"\\eaf3"}),n.foldUp=new n("fold-up",{fontCharacter:"\\eaf4"}),n.fold=new n("fold",{fontCharacter:"\\eaf5"}),n.folderActive=new n("folder-active",{fontCharacter:"\\eaf6"}),n.folderOpened=new n("folder-opened",{fontCharacter:"\\eaf7"}),n.gear=new n("gear",{fontCharacter:"\\eaf8"}),n.gift=new n("gift",{fontCharacter:"\\eaf9"}),n.gistSecret=new n("gist-secret",{fontCharacter:"\\eafa"}),n.gist=new n("gist",{fontCharacter:"\\eafb"}),n.gitCommit=new n("git-commit",{fontCharacter:"\\eafc"}),n.gitCompare=new n("git-compare",{fontCharacter:"\\eafd"}),n.gitMerge=new n("git-merge",{fontCharacter:"\\eafe"}),n.githubAction=new n("github-action",{fontCharacter:"\\eaff"}),n.githubAlt=new n("github-alt",{fontCharacter:"\\eb00"}),n.globe=new n("globe",{fontCharacter:"\\eb01"}),n.grabber=new n("grabber",{fontCharacter:"\\eb02"}),n.graph=new n("graph",{fontCharacter:"\\eb03"}),n.gripper=new n("gripper",{fontCharacter:"\\eb04"}),n.heart=new n("heart",{fontCharacter:"\\eb05"}),n.home=new n("home",{fontCharacter:"\\eb06"}),n.horizontalRule=new n("horizontal-rule",{fontCharacter:"\\eb07"}),n.hubot=new n("hubot",{fontCharacter:"\\eb08"}),n.inbox=new n("inbox",{fontCharacter:"\\eb09"}),n.issueClosed=new n("issue-closed",{fontCharacter:"\\eba4"}),n.issueReopened=new n("issue-reopened",{fontCharacter:"\\eb0b"}),n.issues=new n("issues",{fontCharacter:"\\eb0c"}),n.italic=new n("italic",{fontCharacter:"\\eb0d"}),n.jersey=new n("jersey",{fontCharacter:"\\eb0e"}),n.json=new n("json",{fontCharacter:"\\eb0f"}),n.kebabVertical=new n("kebab-vertical",{fontCharacter:"\\eb10"}),n.key=new n("key",{fontCharacter:"\\eb11"}),n.law=new n("law",{fontCharacter:"\\eb12"}),n.lightbulbAutofix=new n("lightbulb-autofix",{fontCharacter:"\\eb13"}),n.linkExternal=new n("link-external",{fontCharacter:"\\eb14"}),n.link=new n("link",{fontCharacter:"\\eb15"}),n.listOrdered=new n("list-ordered",{fontCharacter:"\\eb16"}),n.listUnordered=new n("list-unordered",{fontCharacter:"\\eb17"}),n.liveShare=new n("live-share",{fontCharacter:"\\eb18"}),n.loading=new n("loading",{fontCharacter:"\\eb19"}),n.location=new n("location",{fontCharacter:"\\eb1a"}),n.mailRead=new n("mail-read",{fontCharacter:"\\eb1b"}),n.mail=new n("mail",{fontCharacter:"\\eb1c"}),n.markdown=new n("markdown",{fontCharacter:"\\eb1d"}),n.megaphone=new n("megaphone",{fontCharacter:"\\eb1e"}),n.mention=new n("mention",{fontCharacter:"\\eb1f"}),n.milestone=new n("milestone",{fontCharacter:"\\eb20"}),n.mortarBoard=new n("mortar-board",{fontCharacter:"\\eb21"}),n.move=new n("move",{fontCharacter:"\\eb22"}),n.multipleWindows=new n("multiple-windows",{fontCharacter:"\\eb23"}),n.mute=new n("mute",{fontCharacter:"\\eb24"}),n.noNewline=new n("no-newline",{fontCharacter:"\\eb25"}),n.note=new n("note",{fontCharacter:"\\eb26"}),n.octoface=new n("octoface",{fontCharacter:"\\eb27"}),n.openPreview=new n("open-preview",{fontCharacter:"\\eb28"}),n.package_=new n("package",{fontCharacter:"\\eb29"}),n.paintcan=new n("paintcan",{fontCharacter:"\\eb2a"}),n.pin=new n("pin",{fontCharacter:"\\eb2b"}),n.play=new n("play",{fontCharacter:"\\eb2c"}),n.run=new n("run",{fontCharacter:"\\eb2c"}),n.plug=new n("plug",{fontCharacter:"\\eb2d"}),n.preserveCase=new n("preserve-case",{fontCharacter:"\\eb2e"}),n.preview=new n("preview",{fontCharacter:"\\eb2f"}),n.project=new n("project",{fontCharacter:"\\eb30"}),n.pulse=new n("pulse",{fontCharacter:"\\eb31"}),n.question=new n("question",{fontCharacter:"\\eb32"}),n.quote=new n("quote",{fontCharacter:"\\eb33"}),n.radioTower=new n("radio-tower",{fontCharacter:"\\eb34"}),n.reactions=new n("reactions",{fontCharacter:"\\eb35"}),n.references=new n("references",{fontCharacter:"\\eb36"}),n.refresh=new n("refresh",{fontCharacter:"\\eb37"}),n.regex=new n("regex",{fontCharacter:"\\eb38"}),n.remoteExplorer=new n("remote-explorer",{fontCharacter:"\\eb39"}),n.remote=new n("remote",{fontCharacter:"\\eb3a"}),n.remove=new n("remove",{fontCharacter:"\\eb3b"}),n.replaceAll=new n("replace-all",{fontCharacter:"\\eb3c"}),n.replace=new n("replace",{fontCharacter:"\\eb3d"}),n.repoClone=new n("repo-clone",{fontCharacter:"\\eb3e"}),n.repoForcePush=new n("repo-force-push",{fontCharacter:"\\eb3f"}),n.repoPull=new n("repo-pull",{fontCharacter:"\\eb40"}),n.repoPush=new n("repo-push",{fontCharacter:"\\eb41"}),n.report=new n("report",{fontCharacter:"\\eb42"}),n.requestChanges=new n("request-changes",{fontCharacter:"\\eb43"}),n.rocket=new n("rocket",{fontCharacter:"\\eb44"}),n.rootFolderOpened=new n("root-folder-opened",{fontCharacter:"\\eb45"}),n.rootFolder=new n("root-folder",{fontCharacter:"\\eb46"}),n.rss=new n("rss",{fontCharacter:"\\eb47"}),n.ruby=new n("ruby",{fontCharacter:"\\eb48"}),n.saveAll=new n("save-all",{fontCharacter:"\\eb49"}),n.saveAs=new n("save-as",{fontCharacter:"\\eb4a"}),n.save=new n("save",{fontCharacter:"\\eb4b"}),n.screenFull=new n("screen-full",{fontCharacter:"\\eb4c"}),n.screenNormal=new n("screen-normal",{fontCharacter:"\\eb4d"}),n.searchStop=new n("search-stop",{fontCharacter:"\\eb4e"}),n.server=new n("server",{fontCharacter:"\\eb50"}),n.settingsGear=new n("settings-gear",{fontCharacter:"\\eb51"}),n.settings=new n("settings",{fontCharacter:"\\eb52"}),n.shield=new n("shield",{fontCharacter:"\\eb53"}),n.smiley=new n("smiley",{fontCharacter:"\\eb54"}),n.sortPrecedence=new n("sort-precedence",{fontCharacter:"\\eb55"}),n.splitHorizontal=new n("split-horizontal",{fontCharacter:"\\eb56"}),n.splitVertical=new n("split-vertical",{fontCharacter:"\\eb57"}),n.squirrel=new n("squirrel",{fontCharacter:"\\eb58"}),n.starFull=new n("star-full",{fontCharacter:"\\eb59"}),n.starHalf=new n("star-half",{fontCharacter:"\\eb5a"}),n.symbolClass=new n("symbol-class",{fontCharacter:"\\eb5b"}),n.symbolColor=new n("symbol-color",{fontCharacter:"\\eb5c"}),n.symbolConstant=new n("symbol-constant",{fontCharacter:"\\eb5d"}),n.symbolEnumMember=new n("symbol-enum-member",{fontCharacter:"\\eb5e"}),n.symbolField=new n("symbol-field",{fontCharacter:"\\eb5f"}),n.symbolFile=new n("symbol-file",{fontCharacter:"\\eb60"}),n.symbolInterface=new n("symbol-interface",{fontCharacter:"\\eb61"}),n.symbolKeyword=new n("symbol-keyword",{fontCharacter:"\\eb62"}),n.symbolMisc=new n("symbol-misc",{fontCharacter:"\\eb63"}),n.symbolOperator=new n("symbol-operator",{fontCharacter:"\\eb64"}),n.symbolProperty=new n("symbol-property",{fontCharacter:"\\eb65"}),n.wrench=new n("wrench",{fontCharacter:"\\eb65"}),n.wrenchSubaction=new n("wrench-subaction",{fontCharacter:"\\eb65"}),n.symbolSnippet=new n("symbol-snippet",{fontCharacter:"\\eb66"}),n.tasklist=new n("tasklist",{fontCharacter:"\\eb67"}),n.telescope=new n("telescope",{fontCharacter:"\\eb68"}),n.textSize=new n("text-size",{fontCharacter:"\\eb69"}),n.threeBars=new n("three-bars",{fontCharacter:"\\eb6a"}),n.thumbsdown=new n("thumbsdown",{fontCharacter:"\\eb6b"}),n.thumbsup=new n("thumbsup",{fontCharacter:"\\eb6c"}),n.tools=new n("tools",{fontCharacter:"\\eb6d"}),n.triangleDown=new n("triangle-down",{fontCharacter:"\\eb6e"}),n.triangleLeft=new n("triangle-left",{fontCharacter:"\\eb6f"}),n.triangleRight=new n("triangle-right",{fontCharacter:"\\eb70"}),n.triangleUp=new n("triangle-up",{fontCharacter:"\\eb71"}),n.twitter=new n("twitter",{fontCharacter:"\\eb72"}),n.unfold=new n("unfold",{fontCharacter:"\\eb73"}),n.unlock=new n("unlock",{fontCharacter:"\\eb74"}),n.unmute=new n("unmute",{fontCharacter:"\\eb75"}),n.unverified=new n("unverified",{fontCharacter:"\\eb76"}),n.verified=new n("verified",{fontCharacter:"\\eb77"}),n.versions=new n("versions",{fontCharacter:"\\eb78"}),n.vmActive=new n("vm-active",{fontCharacter:"\\eb79"}),n.vmOutline=new n("vm-outline",{fontCharacter:"\\eb7a"}),n.vmRunning=new n("vm-running",{fontCharacter:"\\eb7b"}),n.watch=new n("watch",{fontCharacter:"\\eb7c"}),n.whitespace=new n("whitespace",{fontCharacter:"\\eb7d"}),n.wholeWord=new n("whole-word",{fontCharacter:"\\eb7e"}),n.window=new n("window",{fontCharacter:"\\eb7f"}),n.wordWrap=new n("word-wrap",{fontCharacter:"\\eb80"}),n.zoomIn=new n("zoom-in",{fontCharacter:"\\eb81"}),n.zoomOut=new n("zoom-out",{fontCharacter:"\\eb82"}),n.listFilter=new n("list-filter",{fontCharacter:"\\eb83"}),n.listFlat=new n("list-flat",{fontCharacter:"\\eb84"}),n.listSelection=new n("list-selection",{fontCharacter:"\\eb85"}),n.selection=new n("selection",{fontCharacter:"\\eb85"}),n.listTree=new n("list-tree",{fontCharacter:"\\eb86"}),n.debugBreakpointFunctionUnverified=new n("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),n.debugBreakpointFunction=new n("debug-breakpoint-function",{fontCharacter:"\\eb88"}),n.debugBreakpointFunctionDisabled=new n("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),n.debugStackframeActive=new n("debug-stackframe-active",{fontCharacter:"\\eb89"}),n.debugStackframeDot=new n("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),n.debugStackframe=new n("debug-stackframe",{fontCharacter:"\\eb8b"}),n.debugStackframeFocused=new n("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),n.debugBreakpointUnsupported=new n("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),n.symbolString=new n("symbol-string",{fontCharacter:"\\eb8d"}),n.debugReverseContinue=new n("debug-reverse-continue",{fontCharacter:"\\eb8e"}),n.debugStepBack=new n("debug-step-back",{fontCharacter:"\\eb8f"}),n.debugRestartFrame=new n("debug-restart-frame",{fontCharacter:"\\eb90"}),n.callIncoming=new n("call-incoming",{fontCharacter:"\\eb92"}),n.callOutgoing=new n("call-outgoing",{fontCharacter:"\\eb93"}),n.menu=new n("menu",{fontCharacter:"\\eb94"}),n.expandAll=new n("expand-all",{fontCharacter:"\\eb95"}),n.feedback=new n("feedback",{fontCharacter:"\\eb96"}),n.groupByRefType=new n("group-by-ref-type",{fontCharacter:"\\eb97"}),n.ungroupByRefType=new n("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),n.account=new n("account",{fontCharacter:"\\eb99"}),n.bellDot=new n("bell-dot",{fontCharacter:"\\eb9a"}),n.debugConsole=new n("debug-console",{fontCharacter:"\\eb9b"}),n.library=new n("library",{fontCharacter:"\\eb9c"}),n.output=new n("output",{fontCharacter:"\\eb9d"}),n.runAll=new n("run-all",{fontCharacter:"\\eb9e"}),n.syncIgnored=new n("sync-ignored",{fontCharacter:"\\eb9f"}),n.pinned=new n("pinned",{fontCharacter:"\\eba0"}),n.githubInverted=new n("github-inverted",{fontCharacter:"\\eba1"}),n.debugAlt=new n("debug-alt",{fontCharacter:"\\eb91"}),n.serverProcess=new n("server-process",{fontCharacter:"\\eba2"}),n.serverEnvironment=new n("server-environment",{fontCharacter:"\\eba3"}),n.pass=new n("pass",{fontCharacter:"\\eba4"}),n.stopCircle=new n("stop-circle",{fontCharacter:"\\eba5"}),n.playCircle=new n("play-circle",{fontCharacter:"\\eba6"}),n.record=new n("record",{fontCharacter:"\\eba7"}),n.debugAltSmall=new n("debug-alt-small",{fontCharacter:"\\eba8"}),n.vmConnect=new n("vm-connect",{fontCharacter:"\\eba9"}),n.cloud=new n("cloud",{fontCharacter:"\\ebaa"}),n.merge=new n("merge",{fontCharacter:"\\ebab"}),n.exportIcon=new n("export",{fontCharacter:"\\ebac"}),n.graphLeft=new n("graph-left",{fontCharacter:"\\ebad"}),n.magnet=new n("magnet",{fontCharacter:"\\ebae"}),n.notebook=new n("notebook",{fontCharacter:"\\ebaf"}),n.redo=new n("redo",{fontCharacter:"\\ebb0"}),n.checkAll=new n("check-all",{fontCharacter:"\\ebb1"}),n.pinnedDirty=new n("pinned-dirty",{fontCharacter:"\\ebb2"}),n.passFilled=new n("pass-filled",{fontCharacter:"\\ebb3"}),n.circleLargeFilled=new n("circle-large-filled",{fontCharacter:"\\ebb4"}),n.circleLargeOutline=new n("circle-large-outline",{fontCharacter:"\\ebb5"}),n.combine=new n("combine",{fontCharacter:"\\ebb6"}),n.gather=new n("gather",{fontCharacter:"\\ebb6"}),n.table=new n("table",{fontCharacter:"\\ebb7"}),n.variableGroup=new n("variable-group",{fontCharacter:"\\ebb8"}),n.typeHierarchy=new n("type-hierarchy",{fontCharacter:"\\ebb9"}),n.typeHierarchySub=new n("type-hierarchy-sub",{fontCharacter:"\\ebba"}),n.typeHierarchySuper=new n("type-hierarchy-super",{fontCharacter:"\\ebbb"}),n.gitPullRequestCreate=new n("git-pull-request-create",{fontCharacter:"\\ebbc"}),n.runAbove=new n("run-above",{fontCharacter:"\\ebbd"}),n.runBelow=new n("run-below",{fontCharacter:"\\ebbe"}),n.notebookTemplate=new n("notebook-template",{fontCharacter:"\\ebbf"}),n.debugRerun=new n("debug-rerun",{fontCharacter:"\\ebc0"}),n.workspaceTrusted=new n("workspace-trusted",{fontCharacter:"\\ebc1"}),n.workspaceUntrusted=new n("workspace-untrusted",{fontCharacter:"\\ebc2"}),n.workspaceUnspecified=new n("workspace-unspecified",{fontCharacter:"\\ebc3"}),n.terminalCmd=new n("terminal-cmd",{fontCharacter:"\\ebc4"}),n.terminalDebian=new n("terminal-debian",{fontCharacter:"\\ebc5"}),n.terminalLinux=new n("terminal-linux",{fontCharacter:"\\ebc6"}),n.terminalPowershell=new n("terminal-powershell",{fontCharacter:"\\ebc7"}),n.terminalTmux=new n("terminal-tmux",{fontCharacter:"\\ebc8"}),n.terminalUbuntu=new n("terminal-ubuntu",{fontCharacter:"\\ebc9"}),n.terminalBash=new n("terminal-bash",{fontCharacter:"\\ebca"}),n.arrowSwap=new n("arrow-swap",{fontCharacter:"\\ebcb"}),n.copy=new n("copy",{fontCharacter:"\\ebcc"}),n.personAdd=new n("person-add",{fontCharacter:"\\ebcd"}),n.filterFilled=new n("filter-filled",{fontCharacter:"\\ebce"}),n.wand=new n("wand",{fontCharacter:"\\ebcf"}),n.debugLineByLine=new n("debug-line-by-line",{fontCharacter:"\\ebd0"}),n.inspect=new n("inspect",{fontCharacter:"\\ebd1"}),n.layers=new n("layers",{fontCharacter:"\\ebd2"}),n.layersDot=new n("layers-dot",{fontCharacter:"\\ebd3"}),n.layersActive=new n("layers-active",{fontCharacter:"\\ebd4"}),n.compass=new n("compass",{fontCharacter:"\\ebd5"}),n.compassDot=new n("compass-dot",{fontCharacter:"\\ebd6"}),n.compassActive=new n("compass-active",{fontCharacter:"\\ebd7"}),n.azure=new n("azure",{fontCharacter:"\\ebd8"}),n.issueDraft=new n("issue-draft",{fontCharacter:"\\ebd9"}),n.gitPullRequestClosed=new n("git-pull-request-closed",{fontCharacter:"\\ebda"}),n.gitPullRequestDraft=new n("git-pull-request-draft",{fontCharacter:"\\ebdb"}),n.debugAll=new n("debug-all",{fontCharacter:"\\ebdc"}),n.debugCoverage=new n("debug-coverage",{fontCharacter:"\\ebdd"}),n.runErrors=new n("run-errors",{fontCharacter:"\\ebde"}),n.folderLibrary=new n("folder-library",{fontCharacter:"\\ebdf"}),n.debugContinueSmall=new n("debug-continue-small",{fontCharacter:"\\ebe0"}),n.beakerStop=new n("beaker-stop",{fontCharacter:"\\ebe1"}),n.graphLine=new n("graph-line",{fontCharacter:"\\ebe2"}),n.graphScatter=new n("graph-scatter",{fontCharacter:"\\ebe3"}),n.pieChart=new n("pie-chart",{fontCharacter:"\\ebe4"}),n.bracket=new n("bracket",n.json.definition),n.bracketDot=new n("bracket-dot",{fontCharacter:"\\ebe5"}),n.bracketError=new n("bracket-error",{fontCharacter:"\\ebe6"}),n.lockSmall=new n("lock-small",{fontCharacter:"\\ebe7"}),n.azureDevops=new n("azure-devops",{fontCharacter:"\\ebe8"}),n.verifiedFilled=new n("verified-filled",{fontCharacter:"\\ebe9"})}(G||(G={}))},"VrN/":function(ht,be,Z){(function(re,$){ht.exports=$()})(this,function(){"use strict";var re=navigator.userAgent,$=navigator.platform,P=/gecko\/\d/i.test(re),X=/MSIE \d/.test(re),U=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(re),k=/Edge\/(\d+)/.exec(re),G=X||U||k,H=G&&(X?document.documentMode||6:+(k||U)[1]),n=!k&&/WebKit\//.test(re),D=n&&/Qt\/\d+\.\d+/.test(re),g=!k&&/Chrome\//.test(re),p=/Opera\//.test(re),m=/Apple Computer/.test(navigator.vendor),h=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(re),o=/PhantomJS/.test(re),c=!k&&/AppleWebKit/.test(re)&&/Mobile\/\w+/.test(re),l=/Android/.test(re),u=c||l||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(re),s=c||/Mac/.test($),a=/\bCrOS\b/.test(re),A=/win/i.test($),E=p&&re.match(/Version\/(\d*\.\d*)/);E&&(E=Number(E[1])),E&&E>=15&&(p=!1,n=!0);var S=s&&(D||p&&(E==null||E<12.11)),L=P||G&&H>=9;function O(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var C=function(e,t){var r=e.className,i=O(t).exec(r);if(i){var d=r.slice(i.index+i[0].length);e.className=r.slice(0,i.index)+(d?i[1]+d:"")}};function T(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function x(e,t){return T(e).appendChild(t)}function f(e,t,r,i){var d=document.createElement(e);if(r&&(d.className=r),i&&(d.style.cssText=i),typeof t=="string")d.appendChild(document.createTextNode(t));else if(t)for(var M=0;M<t.length;++M)d.appendChild(t[M]);return d}function w(e,t,r,i){var d=f(e,t,r,i);return d.setAttribute("role","presentation"),d}var v;document.createRange?v=function(e,t,r,i){var d=document.createRange();return d.setEnd(i||e,r),d.setStart(e,t),d}:v=function(e,t,r){var i=document.body.createTextRange();try{i.moveToElementText(e.parentNode)}catch(d){return i}return i.collapse(!0),i.moveEnd("character",r),i.moveStart("character",t),i};function b(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function F(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function B(e,t){var r=e.className;O(t).test(r)||(e.className+=(r?" ":"")+t)}function R(e,t){for(var r=e.split(" "),i=0;i<r.length;i++)r[i]&&!O(r[i]).test(t)&&(t+=" "+r[i]);return t}var j=function(e){e.select()};c?j=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:G&&(j=function(e){try{e.select()}catch(t){}});function N(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function y(e,t,r){t||(t={});for(var i in e)e.hasOwnProperty(i)&&(r!==!1||!t.hasOwnProperty(i))&&(t[i]=e[i]);return t}function Y(e,t,r,i,d){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var M=i||0,K=d||0;;){var J=e.indexOf(" ",M);if(J<0||J>=t)return K+(t-M);K+=J-M,K+=r-K%r,M=J+1}}var ee=function(){this.id=null,this.f=null,this.time=0,this.handler=N(this.onTimeout,this)};ee.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},ee.prototype.set=function(e,t){this.f=t;var r=+new Date+e;(!this.id||r<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=r)};function ae(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r;return-1}var ue=50,Re={toString:function(){return"CodeMirror.Pass"}},Ee={scroll:!1},xe={origin:"*mouse"},Ce={origin:"+move"};function Oe(e,t,r){for(var i=0,d=0;;){var M=e.indexOf(" ",i);M==-1&&(M=e.length);var K=M-i;if(M==e.length||d+K>=t)return i+Math.min(K,t-d);if(d+=M-i,d+=r-d%r,i=M+1,d>=t)return i}}var pe=[""];function de(e){for(;pe.length<=e;)pe.push(Me(pe)+" ");return pe[e]}function Me(e){return e[e.length-1]}function tt(e,t){for(var r=[],i=0;i<e.length;i++)r[i]=t(e[i],i);return r}function We(e,t,r){for(var i=0,d=r(t);i<e.length&&r(e[i])<=d;)i++;e.splice(i,0,t)}function rt(){}function st(e,t){var r;return Object.create?r=Object.create(e):(rt.prototype=e,r=new rt),t&&y(t,r),r}var Pe=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function je(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Pe.test(e))}function Ze(e,t){return t?t.source.indexOf("\\w")>-1&&je(e)?!0:t.test(e):je(e)}function se(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var _e=/[\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 Te(e){return e.charCodeAt(0)>=768&&_e.test(e)}function Ae(e,t,r){for(;(r<0?t>0:t<e.length)&&Te(e.charAt(t));)t+=r;return t}function ze(e,t,r){for(var i=t>r?-1:1;;){if(t==r)return t;var d=(t+r)/2,M=i<0?Math.ceil(d):Math.floor(d);if(M==t)return e(M)?t:r;e(M)?r=M:t=M+i}}function Be(e,t,r,i){if(!e)return i(t,r,"ltr",0);for(var d=!1,M=0;M<e.length;++M){var K=e[M];(K.from<r&&K.to>t||t==r&&K.to==t)&&(i(Math.max(K.from,t),Math.min(K.to,r),K.level==1?"rtl":"ltr",M),d=!0)}d||i(t,r,"ltr")}var Ue=null;function Ve(e,t,r){var i;Ue=null;for(var d=0;d<e.length;++d){var M=e[d];if(M.from<t&&M.to>t)return d;M.to==t&&(M.from!=M.to&&r=="before"?i=d:Ue=d),M.from==t&&(M.from!=M.to&&r!="before"?i=d:Ue=d)}return i!=null?i:Ue}var $e=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function r(te){return te<=247?e.charAt(te):1424<=te&&te<=1524?"R":1536<=te&&te<=1785?t.charAt(te-1536):1774<=te&&te<=2220?"r":8192<=te&&te<=8203?"w":te==8204?"b":"L"}var i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,d=/[stwN]/,M=/[LRr]/,K=/[Lb1n]/,J=/[1n]/;function Q(te,he,me){this.level=te,this.from=he,this.to=me}return function(te,he){var me=he=="ltr"?"L":"R";if(te.length==0||he=="ltr"&&!i.test(te))return!1;for(var Se=te.length,we=[],Fe=0;Fe<Se;++Fe)we.push(r(te.charCodeAt(Fe)));for(var Ke=0,qe=me;Ke<Se;++Ke){var ot=we[Ke];ot=="m"?we[Ke]=qe:qe=ot}for(var ct=0,lt=me;ct<Se;++ct){var pt=we[ct];pt=="1"&<=="r"?we[ct]="n":M.test(pt)&&(lt=pt,pt=="r"&&(we[ct]="R"))}for(var At=1,Et=we[0];At<Se-1;++At){var Nt=we[At];Nt=="+"&&Et=="1"&&we[At+1]=="1"?we[At]="1":Nt==","&&Et==we[At+1]&&(Et=="1"||Et=="n")&&(we[At]=Et),Et=Nt}for(var Qt=0;Qt<Se;++Qt){var xn=we[Qt];if(xn==",")we[Qt]="N";else if(xn=="%"){var an=void 0;for(an=Qt+1;an<Se&&we[an]=="%";++an);for(var zn=Qt&&we[Qt-1]=="!"||an<Se&&we[an]=="1"?"1":"N",Bn=Qt;Bn<an;++Bn)we[Bn]=zn;Qt=an-1}}for(var fn=0,jn=me;fn<Se;++fn){var Cn=we[fn];jn=="L"&&Cn=="1"?we[fn]="L":M.test(Cn)&&(jn=Cn)}for(var vn=0;vn<Se;++vn)if(d.test(we[vn])){var pn=void 0;for(pn=vn+1;pn<Se&&d.test(we[pn]);++pn);for(var on=(vn?we[vn-1]:me)=="L",Hn=(pn<Se?we[pn]:me)=="L",ur=on==Hn?on?"L":"R":me,Ii=vn;Ii<pn;++Ii)we[Ii]=ur;vn=pn-1}for(var In=[],li,Tn=0;Tn<Se;)if(K.test(we[Tn])){var Va=Tn;for(++Tn;Tn<Se&&K.test(we[Tn]);++Tn);In.push(new Q(0,Va,Tn))}else{var pi=Tn,Gi=In.length,Ki=he=="rtl"?1:0;for(++Tn;Tn<Se&&we[Tn]!="L";++Tn);for(var Mn=pi;Mn<Tn;)if(J.test(we[Mn])){pi<Mn&&(In.splice(Gi,0,new Q(1,pi,Mn)),Gi+=Ki);var hr=Mn;for(++Mn;Mn<Tn&&J.test(we[Mn]);++Mn);In.splice(Gi,0,new Q(2,hr,Mn)),Gi+=Ki,pi=Mn}else++Mn;pi<Tn&&In.splice(Gi,0,new Q(1,pi,Tn))}return he=="ltr"&&(In[0].level==1&&(li=te.match(/^\s+/))&&(In[0].from=li[0].length,In.unshift(new Q(0,0,li[0].length))),Me(In).level==1&&(li=te.match(/\s+$/))&&(Me(In).to-=li[0].length,In.push(new Q(0,Se-li[0].length,Se)))),he=="rtl"?In.reverse():In}}();function Xe(e,t){var r=e.order;return r==null&&(r=e.order=$e(e.text,t)),r}var et=[],Ie=function(e,t,r){if(e.addEventListener)e.addEventListener(t,r,!1);else if(e.attachEvent)e.attachEvent("on"+t,r);else{var i=e._handlers||(e._handlers={});i[t]=(i[t]||et).concat(r)}};function nt(e,t){return e._handlers&&e._handlers[t]||et}function at(e,t,r){if(e.removeEventListener)e.removeEventListener(t,r,!1);else if(e.detachEvent)e.detachEvent("on"+t,r);else{var i=e._handlers,d=i&&i[t];if(d){var M=ae(d,r);M>-1&&(i[t]=d.slice(0,M).concat(d.slice(M+1)))}}}function De(e,t){var r=nt(e,t);if(!r.length)return;for(var i=Array.prototype.slice.call(arguments,2),d=0;d<r.length;++d)r[d].apply(null,i)}function ke(e,t,r){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),De(e,r||t.type,e,t),oe(t)||t.codemirrorIgnore}function ve(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var r=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),i=0;i<t.length;++i)ae(r,t[i])==-1&&r.push(t[i])}function ce(e,t){return nt(e,t).length>0}function fe(e){e.prototype.on=function(t,r){Ie(this,t,r)},e.prototype.off=function(t,r){at(this,t,r)}}function ie(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ne(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function oe(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function le(e){ie(e),ne(e)}function ye(e){return e.target||e.srcElement}function Le(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),s&&e.ctrlKey&&t==1&&(t=3),t}var Ne=function(){if(G&&H<9)return!1;var e=f("div");return"draggable"in e||"dragDrop"in e}(),Je;function mt(e){if(Je==null){var t=f("span","\u200B");x(e,f("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Je=t.offsetWidth<=1&&t.offsetHeight>2&&!(G&&H<8))}var r=Je?f("span","\u200B"):f("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}var ft;function Ct(e){if(ft!=null)return ft;var t=x(e,document.createTextNode("A\u062EA")),r=v(t,0,1).getBoundingClientRect(),i=v(t,1,2).getBoundingClientRect();return T(e),!r||r.left==r.right?!1:ft=i.right-r.right<3}var xt=`
|
|
|
|
b`.split(/\n/).length!=3?function(e){for(var t=0,r=[],i=e.length;t<=i;){var d=e.indexOf(`
|
|
`,t);d==-1&&(d=e.length);var M=e.slice(t,e.charAt(d-1)=="\r"?d-1:d),K=M.indexOf("\r");K!=-1?(r.push(M.slice(0,K)),t+=K+1):(r.push(M),t=d+1)}return r}:function(e){return e.split(/\r\n?|\n/)},Qe=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(r){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Lt=function(){var e=f("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),vt=null;function Ft(e){if(vt!=null)return vt;var t=x(e,f("span","x")),r=t.getBoundingClientRect(),i=v(t,0,1).getBoundingClientRect();return vt=Math.abs(r.left-i.left)>1}var Pt={},Rt={};function mn(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Pt[e]=t}function sn(e,t){Rt[e]=t}function bt(e){if(typeof e=="string"&&Rt.hasOwnProperty(e))e=Rt[e];else if(e&&typeof e.name=="string"&&Rt.hasOwnProperty(e.name)){var t=Rt[e.name];typeof t=="string"&&(t={name:t}),e=st(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return bt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return bt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function tn(e,t){t=bt(t);var r=Pt[t.name];if(!r)return tn(e,"text/plain");var i=r(e,t);if(_t.hasOwnProperty(t.name)){var d=_t[t.name];for(var M in d){if(!d.hasOwnProperty(M))continue;i.hasOwnProperty(M)&&(i["_"+M]=i[M]),i[M]=d[M]}}if(i.name=t.name,t.helperType&&(i.helperType=t.helperType),t.modeProps)for(var K in t.modeProps)i[K]=t.modeProps[K];return i}var _t={};function Tt(e,t){var r=_t.hasOwnProperty(e)?_t[e]:_t[e]={};y(t,r)}function Wt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var r={};for(var i in t){var d=t[i];d instanceof Array&&(d=d.concat([])),r[i]=d}return r}function nn(e,t){for(var r;e.innerMode&&!(r=e.innerMode(t),!r||r.mode==e);)t=r.state,e=r.mode;return r||{mode:e,state:t}}function hn(e,t,r){return e.startState?e.startState(t,r):!0}var dt=function(e,t,r){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=r};dt.prototype.eol=function(){return this.pos>=this.string.length},dt.prototype.sol=function(){return this.pos==this.lineStart},dt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},dt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},dt.prototype.eat=function(e){var t=this.string.charAt(this.pos),r;if(typeof e=="string"?r=t==e:r=t&&(e.test?e.test(t):e(t)),r)return++this.pos,t},dt.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},dt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},dt.prototype.skipToEnd=function(){this.pos=this.string.length},dt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},dt.prototype.backUp=function(e){this.pos-=e},dt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Y(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Y(this.string,this.lineStart,this.tabSize):0)},dt.prototype.indentation=function(){return Y(this.string,null,this.tabSize)-(this.lineStart?Y(this.string,this.lineStart,this.tabSize):0)},dt.prototype.match=function(e,t,r){if(typeof e=="string"){var i=function(K){return r?K.toLowerCase():K},d=this.string.substr(this.pos,e.length);if(i(d)==i(e))return t!==!1&&(this.pos+=e.length),!0}else{var M=this.string.slice(this.pos).match(e);return M&&M.index>0?null:(M&&t!==!1&&(this.pos+=M[0].length),M)}},dt.prototype.current=function(){return this.string.slice(this.start,this.pos)},dt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},dt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},dt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function ut(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var r=e;!r.lines;)for(var i=0;;++i){var d=r.children[i],M=d.chunkSize();if(t<M){r=d;break}t-=M}return r.lines[t]}function qt(e,t,r){var i=[],d=t.line;return e.iter(t.line,r.line+1,function(M){var K=M.text;d==r.line&&(K=K.slice(0,r.ch)),d==t.line&&(K=K.slice(t.ch)),i.push(K),++d}),i}function Ot(e,t,r){var i=[];return e.iter(t,r,function(d){i.push(d.text)}),i}function Mt(e,t){var r=t-e.height;if(r)for(var i=e;i;i=i.parent)i.height+=r}function Dt(e){if(e.parent==null)return null;for(var t=e.parent,r=ae(t.lines,e),i=t.parent;i;t=i,i=i.parent)for(var d=0;!(i.children[d]==t);++d)r+=i.children[d].chunkSize();return r+t.first}function Ut(e,t){var r=e.first;e:do{for(var i=0;i<e.children.length;++i){var d=e.children[i],M=d.height;if(t<M){e=d;continue e}t-=M,r+=d.chunkSize()}return r}while(!e.lines);for(var K=0;K<e.lines.length;++K){var J=e.lines[K],Q=J.height;if(t<Q)break;t-=Q}return r+K}function dn(e,t){return t>=e.first&&t<e.first+e.size}function $n(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function Ye(e,t,r){if(r===void 0&&(r=null),!(this instanceof Ye))return new Ye(e,t,r);this.line=e,this.ch=t,this.sticky=r}function It(e,t){return e.line-t.line||e.ch-t.ch}function mi(e,t){return e.sticky==t.sticky&&It(e,t)==0}function gi(e){return Ye(e.line,e.ch)}function vi(e,t){return It(e,t)<0?t:e}function yi(e,t){return It(e,t)<0?e:t}function V(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function _(e,t){if(t.line<e.first)return Ye(e.first,0);var r=e.first+e.size-1;return t.line>r?Ye(r,ut(e,r).text.length):I(t,ut(e,t.line).text.length)}function I(e,t){var r=e.ch;return r==null||r>t?Ye(e.line,t):r<0?Ye(e.line,0):e}function W(e,t){for(var r=[],i=0;i<t.length;i++)r[i]=_(e,t[i]);return r}var q=function(e,t){this.state=e,this.lookAhead=t},z=function(e,t,r,i){this.state=t,this.doc=e,this.line=r,this.maxLookAhead=i||0,this.baseTokens=null,this.baseTokenPos=1};z.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},z.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}},z.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},z.fromSaved=function(e,t,r){return t instanceof q?new z(e,Wt(e.mode,t.state),r,t.lookAhead):new z(e,Wt(e.mode,t),r)},z.prototype.save=function(e){var t=e!==!1?Wt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new q(t,this.maxLookAhead):t};function ge(e,t,r,i){var d=[e.state.modeGen],M={};An(e,t.text,e.doc.mode,r,function(te,he){return d.push(te,he)},M,i);for(var K=r.state,J=function(te){r.baseTokens=d;var he=e.state.overlays[te],me=1,Se=0;r.state=!0,An(e,t.text,he.mode,r,function(we,Fe){for(var Ke=me;Se<we;){var qe=d[me];qe>we&&d.splice(me,1,we,d[me+1],qe),me+=2,Se=Math.min(we,qe)}if(!Fe)return;if(he.opaque)d.splice(Ke,me-Ke,we,"overlay "+Fe),me=Ke+2;else for(;Ke<me;Ke+=2){var ot=d[Ke+1];d[Ke+1]=(ot?ot+" ":"")+"overlay "+Fe}},M),r.state=K,r.baseTokens=null,r.baseTokenPos=1},Q=0;Q<e.state.overlays.length;++Q)J(Q);return{styles:d,classes:M.bgClass||M.textClass?M:null}}function He(e,t,r){if(!t.styles||t.styles[0]!=e.state.modeGen){var i=it(e,Dt(t)),d=t.text.length>e.options.maxHighlightLength&&Wt(e.doc.mode,i.state),M=ge(e,t,i);d&&(i.state=d),t.stateAfter=i.save(!d),t.styles=M.styles,M.classes?t.styleClasses=M.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function it(e,t,r){var i=e.doc,d=e.display;if(!i.mode.startState)return new z(i,!0,t);var M=Rn(e,t,r),K=M>i.first&&ut(i,M-1).stateAfter,J=K?z.fromSaved(i,K,M):new z(i,hn(i.mode),M);return i.iter(M,t,function(Q){gt(e,Q.text,J);var te=J.line;Q.stateAfter=te==t-1||te%5==0||te>=d.viewFrom&&te<d.viewTo?J.save():null,J.nextLine()}),r&&(i.modeFrontier=J.line),J}function gt(e,t,r,i){var d=e.doc.mode,M=new dt(t,e.options.tabSize,r);for(M.start=M.pos=i||0,t==""&&Ge(d,r.state);!M.eol();)wt(d,M,r.state),M.start=M.pos}function Ge(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var r=nn(e,t);if(r.mode.blankLine)return r.mode.blankLine(r.state)}function wt(e,t,r,i){for(var d=0;d<10;d++){i&&(i[0]=nn(e,r).mode);var M=e.token(t,r);if(t.pos>t.start)return M}throw new Error("Mode "+e.name+" failed to advance stream.")}var zt=function(e,t,r){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=r};function en(e,t,r,i){var d=e.doc,M=d.mode,K;t=_(d,t);var J=ut(d,t.line),Q=it(e,t.line,r),te=new dt(J.text,e.options.tabSize,Q),he;for(i&&(he=[]);(i||te.pos<t.ch)&&!te.eol();)te.start=te.pos,K=wt(M,te,Q.state),i&&he.push(new zt(te,K,Wt(d.mode,Q.state)));return i?he:new zt(te,K,Q.state)}function Wn(e,t){if(e)for(;;){var r=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!r)break;e=e.slice(0,r.index)+e.slice(r.index+r[0].length);var i=r[1]?"bgClass":"textClass";t[i]==null?t[i]=r[2]:new RegExp("(?:^|\\s)"+r[2]+"(?:$|\\s)").test(t[i])||(t[i]+=" "+r[2])}return e}function An(e,t,r,i,d,M,K){var J=r.flattenSpans;J==null&&(J=e.options.flattenSpans);var Q=0,te=null,he=new dt(t,e.options.tabSize,i),me,Se=e.options.addModeClass&&[null];for(t==""&&Wn(Ge(r,i.state),M);!he.eol();){if(he.pos>e.options.maxHighlightLength?(J=!1,K&>(e,t,i,he.pos),he.pos=t.length,me=null):me=Wn(wt(r,he,i.state,Se),M),Se){var we=Se[0].name;we&&(me="m-"+(me?we+" "+me:we))}if(!J||te!=me){for(;Q<he.start;)Q=Math.min(he.start,Q+5e3),d(Q,te);te=me}he.start=he.pos}for(;Q<he.pos;){var Fe=Math.min(he.pos,Q+5e3);d(Fe,te),Q=Fe}}function Rn(e,t,r){for(var i,d,M=e.doc,K=r?-1:t-(e.doc.mode.innerMode?1e3:100),J=t;J>K;--J){if(J<=M.first)return M.first;var Q=ut(M,J-1),te=Q.stateAfter;if(te&&(!r||J+(te instanceof q?te.lookAhead:0)<=M.modeFrontier))return J;var he=Y(Q.text,null,e.options.tabSize);(d==null||i>he)&&(d=J-1,i=he)}return d}function Qn(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var r=e.first,i=t-1;i>r;i--){var d=ut(e,i).stateAfter;if(d&&(!(d instanceof q)||i+d.lookAhead<t)){r=i+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,r)}var Di=!1,yn=!1;function Vn(){Di=!0}function ui(){yn=!0}function hi(e,t,r){this.marker=e,this.from=t,this.to=r}function Gn(e,t){if(e)for(var r=0;r<e.length;++r){var i=e[r];if(i.marker==t)return i}}function ki(e,t){for(var r,i=0;i<e.length;++i)e[i]!=t&&(r||(r=[])).push(e[i]);return r}function bi(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function zi(e,t,r){var i;if(e)for(var d=0;d<e.length;++d){var M=e[d],K=M.marker,J=M.from==null||(K.inclusiveLeft?M.from<=t:M.from<t);if(J||M.from==t&&K.type=="bookmark"&&(!r||!M.marker.insertLeft)){var Q=M.to==null||(K.inclusiveRight?M.to>=t:M.to>t);(i||(i=[])).push(new hi(K,M.from,Q?null:M.to))}}return i}function Vi(e,t,r){var i;if(e)for(var d=0;d<e.length;++d){var M=e[d],K=M.marker,J=M.to==null||(K.inclusiveRight?M.to>=t:M.to>t);if(J||M.from==t&&K.type=="bookmark"&&(!r||M.marker.insertLeft)){var Q=M.from==null||(K.inclusiveLeft?M.from<=t:M.from<t);(i||(i=[])).push(new hi(K,Q?null:M.from-t,M.to==null?null:M.to-t))}}return i}function qn(e,t){if(t.full)return null;var r=dn(e,t.from.line)&&ut(e,t.from.line).markedSpans,i=dn(e,t.to.line)&&ut(e,t.to.line).markedSpans;if(!r&&!i)return null;var d=t.from.ch,M=t.to.ch,K=It(t.from,t.to)==0,J=zi(r,d,K),Q=Vi(i,M,K),te=t.text.length==1,he=Me(t.text).length+(te?d:0);if(J)for(var me=0;me<J.length;++me){var Se=J[me];if(Se.to==null){var we=Gn(Q,Se.marker);we?te&&(Se.to=we.to==null?null:we.to+he):Se.to=d}}if(Q)for(var Fe=0;Fe<Q.length;++Fe){var Ke=Q[Fe];if(Ke.to!=null&&(Ke.to+=he),Ke.from==null){var qe=Gn(J,Ke.marker);qe||(Ke.from=he,te&&(J||(J=[])).push(Ke))}else Ke.from+=he,te&&(J||(J=[])).push(Ke)}J&&(J=Jn(J)),Q&&Q!=J&&(Q=Jn(Q));var ot=[J];if(!te){var ct=t.text.length-2,lt;if(ct>0&&J)for(var pt=0;pt<J.length;++pt)J[pt].to==null&&(lt||(lt=[])).push(new hi(J[pt].marker,null,null));for(var At=0;At<ct;++At)ot.push(lt);ot.push(Q)}return ot}function Jn(e){for(var t=0;t<e.length;++t){var r=e[t];r.from!=null&&r.from==r.to&&r.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function _i(e,t,r){var i=null;if(e.iter(t.line,r.line+1,function(we){if(we.markedSpans)for(var Fe=0;Fe<we.markedSpans.length;++Fe){var Ke=we.markedSpans[Fe].marker;Ke.readOnly&&(!i||ae(i,Ke)==-1)&&(i||(i=[])).push(Ke)}}),!i)return null;for(var d=[{from:t,to:r}],M=0;M<i.length;++M)for(var K=i[M],J=K.find(0),Q=0;Q<d.length;++Q){var te=d[Q];if(It(te.to,J.from)<0||It(te.from,J.to)>0)continue;var he=[Q,1],me=It(te.from,J.from),Se=It(te.to,J.to);(me<0||!K.inclusiveLeft&&!me)&&he.push({from:te.from,to:J.from}),(Se>0||!K.inclusiveRight&&!Se)&&he.push({from:J.to,to:te.to}),d.splice.apply(d,he),Q+=he.length-3}return d}function dr(e){var t=e.markedSpans;if(!t)return;for(var r=0;r<t.length;++r)t[r].marker.detachLine(e);e.markedSpans=null}function Ei(e,t){if(!t)return;for(var r=0;r<t.length;++r)t[r].marker.attachLine(e);e.markedSpans=t}function ln(e){return e.inclusiveLeft?-1:0}function Vt(e){return e.inclusiveRight?1:0}function wn(e,t){var r=e.lines.length-t.lines.length;if(r!=0)return r;var i=e.find(),d=t.find(),M=It(i.from,d.from)||ln(e)-ln(t);if(M)return-M;var K=It(i.to,d.to)||Vt(e)-Vt(t);return K||t.id-e.id}function jt(e,t){var r=yn&&e.markedSpans,i;if(r)for(var d=void 0,M=0;M<r.length;++M)d=r[M],d.marker.collapsed&&(t?d.from:d.to)==null&&(!i||wn(i,d.marker)<0)&&(i=d.marker);return i}function cn(e){return jt(e,!0)}function $t(e){return jt(e,!1)}function ri(e,t){var r=yn&&e.markedSpans,i;if(r)for(var d=0;d<r.length;++d){var M=r[d];M.marker.collapsed&&(M.from==null||M.from<t)&&(M.to==null||M.to>t)&&(!i||wn(i,M.marker)<0)&&(i=M.marker)}return i}function bn(e,t,r,i,d){var M=ut(e,t),K=yn&&M.markedSpans;if(K)for(var J=0;J<K.length;++J){var Q=K[J];if(!Q.marker.collapsed)continue;var te=Q.marker.find(0),he=It(te.from,r)||ln(Q.marker)-ln(d),me=It(te.to,i)||Vt(Q.marker)-Vt(d);if(he>=0&&me<=0||he<=0&&me>=0)continue;if(he<=0&&(Q.marker.inclusiveRight&&d.inclusiveLeft?It(te.to,r)>=0:It(te.to,r)>0)||he>=0&&(Q.marker.inclusiveRight&&d.inclusiveLeft?It(te.from,i)<=0:It(te.from,i)<0))return!0}}function Dn(e){for(var t;t=cn(e);)e=t.find(-1,!0).line;return e}function Xi(e){for(var t;t=$t(e);)e=t.find(1,!0).line;return e}function xi(e){for(var t,r;t=$t(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}function cr(e,t){var r=ut(e,t),i=Dn(r);return r==i?t:Dt(i)}function Ti(e,t){if(t>e.lastLine())return t;var r=ut(e,t),i;if(!ai(e,r))return t;for(;i=$t(r);)r=i.find(1,!0).line;return Dt(r)+1}function ai(e,t){var r=yn&&t.markedSpans;if(r)for(var i=void 0,d=0;d<r.length;++d){if(i=r[d],!i.marker.collapsed)continue;if(i.from==null)return!0;if(i.marker.widgetNode)continue;if(i.from==0&&i.marker.inclusiveLeft&&fr(e,t,i))return!0}}function fr(e,t,r){if(r.to==null){var i=r.marker.find(1,!0);return fr(e,i.line,Gn(i.line.markedSpans,r.marker))}if(r.marker.inclusiveRight&&r.to==t.text.length)return!0;for(var d=void 0,M=0;M<t.markedSpans.length;++M)if(d=t.markedSpans[M],d.marker.collapsed&&!d.marker.widgetNode&&d.from==r.to&&(d.to==null||d.to!=r.from)&&(d.marker.inclusiveLeft||r.marker.inclusiveRight)&&fr(e,t,d))return!0}function ei(e){e=Dn(e);for(var t=0,r=e.parent,i=0;i<r.lines.length;++i){var d=r.lines[i];if(d==e)break;t+=d.height}for(var M=r.parent;M;r=M,M=r.parent)for(var K=0;K<M.children.length;++K){var J=M.children[K];if(J==r)break;t+=J.height}return t}function pr(e){if(e.height==0)return 0;for(var t=e.text.length,r,i=e;r=cn(i);){var d=r.find(0,!0);i=d.from.line,t+=d.from.ch-d.to.ch}for(i=e;r=$t(i);){var M=r.find(0,!0);t-=i.text.length-M.from.ch,i=M.to.line,t+=i.text.length-M.to.ch}return t}function jr(e){var t=e.display,r=e.doc;t.maxLine=ut(r,r.first),t.maxLineLength=pr(t.maxLine),t.maxLineChanged=!0,r.iter(function(i){var d=pr(i);d>t.maxLineLength&&(t.maxLineLength=d,t.maxLine=i)})}var Mi=function(e,t,r){this.text=e,Ei(this,t),this.height=r?r(this):1};Mi.prototype.lineNo=function(){return Dt(this)},fe(Mi);function ua(e,t,r,i){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),dr(e),Ei(e,r);var d=i?i(e):1;d!=e.height&&Mt(e,d)}function yt(e){e.parent=null,dr(e)}var kt={},St={};function Bt(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?St:kt;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function Kt(e,t){var r=w("span",null,null,n?"padding-right: .1px":null),i={pre:w("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var d=0;d<=(t.rest?t.rest.length:0);d++){var M=d?t.rest[d-1]:t.line,K=void 0;i.pos=0,i.addToken=Gt,Ct(e.display.measure)&&(K=Xe(M,e.doc.direction))&&(i.addToken=Pn(i.addToken,K)),i.map=[];var J=t!=e.display.externalMeasured&&Dt(M);di(M,i,He(e,M,J)),M.styleClasses&&(M.styleClasses.bgClass&&(i.bgClass=R(M.styleClasses.bgClass,i.bgClass||"")),M.styleClasses.textClass&&(i.textClass=R(M.styleClasses.textClass,i.textClass||""))),i.map.length==0&&i.map.push(0,0,i.content.appendChild(mt(e.display.measure))),d==0?(t.measure.map=i.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(i.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(n){var Q=i.content.lastChild;(/\bcm-tab\b/.test(Q.className)||Q.querySelector&&Q.querySelector(".cm-tab"))&&(i.content.className="cm-tab-wrap-hack")}return De(e,"renderLine",e,t.line,i.pre),i.pre.className&&(i.textClass=R(i.pre.className,i.textClass||"")),i}function Zt(e){var t=f("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Gt(e,t,r,i,d,M,K){if(!t)return;var J=e.splitSpaces?gn(t,e.trailingSpace):t,Q=e.cm.state.specialChars,te=!1,he;if(!Q.test(t))e.col+=t.length,he=document.createTextNode(J),e.map.push(e.pos,e.pos+t.length,he),G&&H<9&&(te=!0),e.pos+=t.length;else{he=document.createDocumentFragment();for(var me=0;;){Q.lastIndex=me;var Se=Q.exec(t),we=Se?Se.index-me:t.length-me;if(we){var Fe=document.createTextNode(J.slice(me,me+we));G&&H<9?he.appendChild(f("span",[Fe])):he.appendChild(Fe),e.map.push(e.pos,e.pos+we,Fe),e.col+=we,e.pos+=we}if(!Se)break;me+=we+1;var Ke=void 0;if(Se[0]==" "){var qe=e.cm.options.tabSize,ot=qe-e.col%qe;Ke=he.appendChild(f("span",de(ot),"cm-tab")),Ke.setAttribute("role","presentation"),Ke.setAttribute("cm-text"," "),e.col+=ot}else Se[0]=="\r"||Se[0]==`
|
|
`?(Ke=he.appendChild(f("span",Se[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Ke.setAttribute("cm-text",Se[0]),e.col+=1):(Ke=e.cm.options.specialCharPlaceholder(Se[0]),Ke.setAttribute("cm-text",Se[0]),G&&H<9?he.appendChild(f("span",[Ke])):he.appendChild(Ke),e.col+=1);e.map.push(e.pos,e.pos+1,Ke),e.pos++}}if(e.trailingSpace=J.charCodeAt(t.length-1)==32,r||i||d||te||M||K){var ct=r||"";i&&(ct+=i),d&&(ct+=d);var lt=f("span",[he],ct,M);if(K)for(var pt in K)K.hasOwnProperty(pt)&&pt!="style"&&pt!="class"&<.setAttribute(pt,K[pt]);return e.content.appendChild(lt)}e.content.appendChild(he)}function gn(e,t){if(e.length>1&&!/ /.test(e))return e;for(var r=t,i="",d=0;d<e.length;d++){var M=e.charAt(d);M==" "&&r&&(d==e.length-1||e.charCodeAt(d+1)==32)&&(M="\xA0"),i+=M,r=M==" "}return i}function Pn(e,t){return function(r,i,d,M,K,J,Q){d=d?d+" cm-force-border":"cm-force-border";for(var te=r.pos,he=te+i.length;;){for(var me=void 0,Se=0;Se<t.length&&!(me=t[Se],me.to>te&&me.from<=te);Se++);if(me.to>=he)return e(r,i,d,M,K,J,Q);e(r,i.slice(0,me.to-te),d,M,null,J,Q),M=null,i=i.slice(me.to-te),te=me.to}}}function Ht(e,t,r,i){var d=!i&&r.widgetNode;d&&e.map.push(e.pos,e.pos+t,d),!i&&e.cm.display.input.needsContentAttribute&&(d||(d=e.content.appendChild(document.createElement("span"))),d.setAttribute("cm-marker",r.id)),d&&(e.cm.display.input.setUneditable(d),e.content.appendChild(d)),e.pos+=t,e.trailingSpace=!1}function di(e,t,r){var i=e.markedSpans,d=e.text,M=0;if(!i){for(var K=1;K<r.length;K+=2)t.addToken(t,d.slice(M,M=r[K]),Bt(r[K+1],t.cm.options));return}for(var J=d.length,Q=0,te=1,he="",me,Se,we=0,Fe,Ke,qe,ot,ct;;){if(we==Q){Fe=Ke=qe=Se="",ct=null,ot=null,we=Infinity;for(var lt=[],pt=void 0,At=0;At<i.length;++At){var Et=i[At],Nt=Et.marker;if(Nt.type=="bookmark"&&Et.from==Q&&Nt.widgetNode)lt.push(Nt);else if(Et.from<=Q&&(Et.to==null||Et.to>Q||Nt.collapsed&&Et.to==Q&&Et.from==Q)){if(Et.to!=null&&Et.to!=Q&&we>Et.to&&(we=Et.to,Ke=""),Nt.className&&(Fe+=" "+Nt.className),Nt.css&&(Se=(Se?Se+";":"")+Nt.css),Nt.startStyle&&Et.from==Q&&(qe+=" "+Nt.startStyle),Nt.endStyle&&Et.to==we&&(pt||(pt=[])).push(Nt.endStyle,Et.to),Nt.title&&((ct||(ct={})).title=Nt.title),Nt.attributes)for(var Qt in Nt.attributes)(ct||(ct={}))[Qt]=Nt.attributes[Qt];Nt.collapsed&&(!ot||wn(ot.marker,Nt)<0)&&(ot=Et)}else Et.from>Q&&we>Et.from&&(we=Et.from)}if(pt)for(var xn=0;xn<pt.length;xn+=2)pt[xn+1]==we&&(Ke+=" "+pt[xn]);if(!ot||ot.from==Q)for(var an=0;an<lt.length;++an)Ht(t,0,lt[an]);if(ot&&(ot.from||0)==Q){if(Ht(t,(ot.to==null?J+1:ot.to)-Q,ot.marker,ot.from==null),ot.to==null)return;ot.to==Q&&(ot=!1)}}if(Q>=J)break;for(var zn=Math.min(J,we);;){if(he){var Bn=Q+he.length;if(!ot){var fn=Bn>zn?he.slice(0,zn-Q):he;t.addToken(t,fn,me?me+Fe:Fe,qe,Q+fn.length==we?Ke:"",Se,ct)}if(Bn>=zn){he=he.slice(zn-Q),Q=zn;break}Q=Bn,qe=""}he=d.slice(M,M=r[te++]),me=Bt(r[te++],t.cm.options)}}}function Xt(e,t,r){this.line=t,this.rest=xi(t),this.size=this.rest?Dt(Me(this.rest))-r+1:1,this.node=this.text=null,this.hidden=ai(e,t)}function Nn(e,t,r){for(var i=[],d,M=t;M<r;M=d){var K=new Xt(e.doc,ut(e.doc,M),M);d=M+K.size,i.push(K)}return i}var On=null;function Zn(e){On?On.ops.push(e):e.ownsGroup=On={ops:[e],delayedCallbacks:[]}}function Lo(e){var t=e.delayedCallbacks,r=0;do{for(;r<t.length;r++)t[r].call(null);for(var i=0;i<e.ops.length;i++){var d=e.ops[i];if(d.cursorActivityHandlers)for(;d.cursorActivityCalled<d.cursorActivityHandlers.length;)d.cursorActivityHandlers[d.cursorActivityCalled++].call(null,d.cm)}}while(r<t.length)}function Io(e,t){var r=e.ownsGroup;if(!r)return;try{Lo(r)}finally{On=null,t(r)}}var mr=null;function Sn(e,t){var r=nt(e,t);if(!r.length)return;var i=Array.prototype.slice.call(arguments,2),d;On?d=On.delayedCallbacks:mr?d=mr:(d=mr=[],setTimeout(Do,0));for(var M=function(J){d.push(function(){return r[J].apply(null,i)})},K=0;K<r.length;++K)M(K)}function Do(){var e=mr;mr=null;for(var t=0;t<e.length;++t)e[t]()}function Ya(e,t,r,i){for(var d=0;d<t.changes.length;d++){var M=t.changes[d];M=="text"?Mo(e,t):M=="gutter"?Ja(e,t,r,i):M=="class"?ha(e,t):M=="widget"&&Po(e,t,i)}t.changes=null}function gr(e){return e.node==e.text&&(e.node=f("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),G&&H<8&&(e.node.style.zIndex=2)),e.node}function ko(e,t){var r=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(r&&(r+=" CodeMirror-linebackground"),t.background)r?t.background.className=r:(t.background.parentNode.removeChild(t.background),t.background=null);else if(r){var i=gr(t);t.background=i.insertBefore(f("div",null,r),i.firstChild),e.display.input.setUneditable(t.background)}}function $a(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):Kt(e,t)}function Mo(e,t){var r=t.text.className,i=$a(e,t);t.text==t.node&&(t.node=i.pre),t.text.parentNode.replaceChild(i.pre,t.text),t.text=i.pre,i.bgClass!=t.bgClass||i.textClass!=t.textClass?(t.bgClass=i.bgClass,t.textClass=i.textClass,ha(e,t)):r&&(t.text.className=r)}function ha(e,t){ko(e,t),t.line.wrapClass?gr(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var r=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=r||""}function Ja(e,t,r,i){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 d=gr(t);t.gutterBackground=f("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px; width: "+i.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),d.insertBefore(t.gutterBackground,t.text)}var M=t.line.gutterMarkers;if(e.options.lineNumbers||M){var K=gr(t),J=t.gutter=f("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px");if(e.display.input.setUneditable(J),K.insertBefore(J,t.text),t.line.gutterClass&&(J.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!M||!M["CodeMirror-linenumbers"])&&(t.lineNumber=J.appendChild(f("div",$n(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+i.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),M)for(var Q=0;Q<e.display.gutterSpecs.length;++Q){var te=e.display.gutterSpecs[Q].className,he=M.hasOwnProperty(te)&&M[te];he&&J.appendChild(f("div",[he],"CodeMirror-gutter-elt","left: "+i.gutterLeft[te]+"px; width: "+i.gutterWidth[te]+"px"))}}}function Po(e,t,r){t.alignable&&(t.alignable=null);for(var i=O("CodeMirror-linewidget"),d=t.node.firstChild,M=void 0;d;d=M)M=d.nextSibling,i.test(d.className)&&t.node.removeChild(d);Za(e,t,r)}function No(e,t,r,i){var d=$a(e,t);return t.text=t.node=d.pre,d.bgClass&&(t.bgClass=d.bgClass),d.textClass&&(t.textClass=d.textClass),ha(e,t),Ja(e,t,r,i),Za(e,t,i),t.node}function Za(e,t,r){if(Qa(e,t.line,t,r,!0),t.rest)for(var i=0;i<t.rest.length;i++)Qa(e,t.rest[i],t,r,!1)}function Qa(e,t,r,i,d){if(!t.widgets)return;for(var M=gr(r),K=0,J=t.widgets;K<J.length;++K){var Q=J[K],te=f("div",[Q.node],"CodeMirror-linewidget"+(Q.className?" "+Q.className:""));Q.handleMouseEvents||te.setAttribute("cm-ignore-events","true"),Fo(Q,te,r,i),e.display.input.setUneditable(te),d&&Q.above?M.insertBefore(te,r.gutter||r.text):M.appendChild(te),Sn(Q,"redraw")}}function Fo(e,t,r,i){if(e.noHScroll){(r.alignable||(r.alignable=[])).push(t);var d=i.wrapperWidth;t.style.left=i.fixedPos+"px",e.coverGutter||(d-=i.gutterTotalWidth,t.style.paddingLeft=i.gutterTotalWidth+"px"),t.style.width=d+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-i.gutterTotalWidth+"px"))}function vr(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!b(document.body,e.node)){var r="position: relative;";e.coverGutter&&(r+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(r+="width: "+t.display.wrapper.clientWidth+"px;"),x(t.display.measure,f("div",[e.node],null,r))}return e.height=e.node.parentNode.offsetHeight}function ci(e,t){for(var r=ye(t);r!=e.wrapper;r=r.parentNode)if(!r||r.nodeType==1&&r.getAttribute("cm-ignore-events")=="true"||r.parentNode==e.sizer&&r!=e.mover)return!0}function Hr(e){return e.lineSpace.offsetTop}function da(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function qa(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=x(e.measure,f("pre","x","CodeMirror-line-like")),r=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,i={left:parseInt(r.paddingLeft),right:parseInt(r.paddingRight)};return!isNaN(i.left)&&!isNaN(i.right)&&(e.cachedPaddingH=i),i}function si(e){return ue-e.display.nativeBarWidth}function Pi(e){return e.display.scroller.clientWidth-si(e)-e.display.barWidth}function ca(e){return e.display.scroller.clientHeight-si(e)-e.display.barHeight}function Uo(e,t,r){var i=e.options.lineWrapping,d=i&&Pi(e);if(!t.measure.heights||i&&t.measure.width!=d){var M=t.measure.heights=[];if(i){t.measure.width=d;for(var K=t.text.firstChild.getClientRects(),J=0;J<K.length-1;J++){var Q=K[J],te=K[J+1];Math.abs(Q.bottom-te.bottom)>2&&M.push((Q.bottom+te.top)/2-r.top)}}M.push(r.bottom-r.top)}}function es(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var i=0;i<e.rest.length;i++)if(e.rest[i]==t)return{map:e.measure.maps[i],cache:e.measure.caches[i]};for(var d=0;d<e.rest.length;d++)if(Dt(e.rest[d])>r)return{map:e.measure.maps[d],cache:e.measure.caches[d],before:!0}}function Bo(e,t){t=Dn(t);var r=Dt(t),i=e.display.externalMeasured=new Xt(e.doc,t,r);i.lineN=r;var d=i.built=Kt(e,i);return i.text=d.pre,x(e.display.lineMeasure,d.pre),i}function ts(e,t,r,i){return oi(e,Yi(e,t),r,i)}function fa(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Ui(e,t)];var r=e.display.externalMeasured;if(r&&t>=r.lineN&&t<r.lineN+r.size)return r}function Yi(e,t){var r=Dt(t),i=fa(e,r);i&&!i.text?i=null:i&&i.changes&&(Ya(e,i,r,ba(e)),e.curOp.forceUpdate=!0),i||(i=Bo(e,t));var d=es(i,t,r);return{line:t,view:i,rect:null,map:d.map,cache:d.cache,before:d.before,hasHeights:!1}}function oi(e,t,r,i,d){t.before&&(r=-1);var M=r+(i||""),K;return t.cache.hasOwnProperty(M)?K=t.cache[M]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Uo(e,t.view,t.rect),t.hasHeights=!0),K=Ho(e,t,r,i),K.bogus||(t.cache[M]=K)),{left:K.left,right:K.right,top:d?K.rtop:K.top,bottom:d?K.rbottom:K.bottom}}var ns={left:0,right:0,top:0,bottom:0};function is(e,t,r){for(var i,d,M,K,J,Q,te=0;te<e.length;te+=3)if(J=e[te],Q=e[te+1],t<J?(d=0,M=1,K="left"):t<Q?(d=t-J,M=d+1):(te==e.length-3||t==Q&&e[te+3]>t)&&(M=Q-J,d=M-1,t>=Q&&(K="right")),d!=null){if(i=e[te+2],J==Q&&r==(i.insertLeft?"left":"right")&&(K=r),r=="left"&&d==0)for(;te&&e[te-2]==e[te-3]&&e[te-1].insertLeft;)i=e[(te-=3)+2],K="left";if(r=="right"&&d==Q-J)for(;te<e.length-3&&e[te+3]==e[te+4]&&!e[te+5].insertLeft;)i=e[(te+=3)+2],K="right";break}return{node:i,start:d,end:M,collapse:K,coverStart:J,coverEnd:Q}}function jo(e,t){var r=ns;if(t=="left")for(var i=0;i<e.length&&!((r=e[i]).left!=r.right);i++);else for(var d=e.length-1;d>=0&&!((r=e[d]).left!=r.right);d--);return r}function Ho(e,t,r,i){var d=is(t.map,r,i),M=d.node,K=d.start,J=d.end,Q=d.collapse,te;if(M.nodeType==3){for(var he=0;he<4;he++){for(;K&&Te(t.line.text.charAt(d.coverStart+K));)--K;for(;d.coverStart+J<d.coverEnd&&Te(t.line.text.charAt(d.coverStart+J));)++J;if(G&&H<9&&K==0&&J==d.coverEnd-d.coverStart?te=M.parentNode.getBoundingClientRect():te=jo(v(M,K,J).getClientRects(),i),te.left||te.right||K==0)break;J=K,K=K-1,Q="right"}G&&H<11&&(te=Wo(e.display.measure,te))}else{K>0&&(Q=i="right");var me;e.options.lineWrapping&&(me=M.getClientRects()).length>1?te=me[i=="right"?me.length-1:0]:te=M.getBoundingClientRect()}if(G&&H<9&&!K&&(!te||!te.left&&!te.right)){var Se=M.parentNode.getClientRects()[0];Se?te={left:Se.left,right:Se.left+Ji(e.display),top:Se.top,bottom:Se.bottom}:te=ns}for(var we=te.top-t.rect.top,Fe=te.bottom-t.rect.top,Ke=(we+Fe)/2,qe=t.view.measure.heights,ot=0;ot<qe.length-1&&!(Ke<qe[ot]);ot++);var ct=ot?qe[ot-1]:0,lt=qe[ot],pt={left:(Q=="right"?te.right:te.left)-t.rect.left,right:(Q=="left"?te.left:te.right)-t.rect.left,top:ct,bottom:lt};return!te.left&&!te.right&&(pt.bogus=!0),e.options.singleCursorHeightPerLine||(pt.rtop=we,pt.rbottom=Fe),pt}function Wo(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Ft(e))return t;var r=screen.logicalXDPI/screen.deviceXDPI,i=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*r,right:t.right*r,top:t.top*i,bottom:t.bottom*i}}function rs(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 as(e){e.display.externalMeasure=null,T(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)rs(e.display.view[t])}function yr(e){as(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function ss(){return g&&l?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function os(){return g&&l?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function pa(e){var t=0;if(e.widgets)for(var r=0;r<e.widgets.length;++r)e.widgets[r].above&&(t+=vr(e.widgets[r]));return t}function Wr(e,t,r,i,d){if(!d){var M=pa(t);r.top+=M,r.bottom+=M}if(i=="line")return r;i||(i="local");var K=ei(t);if(i=="local"?K+=Hr(e.display):K-=e.display.viewOffset,i=="page"||i=="window"){var J=e.display.lineSpace.getBoundingClientRect();K+=J.top+(i=="window"?0:os());var Q=J.left+(i=="window"?0:ss());r.left+=Q,r.right+=Q}return r.top+=K,r.bottom+=K,r}function ls(e,t,r){if(r=="div")return t;var i=t.left,d=t.top;if(r=="page")i-=ss(),d-=os();else if(r=="local"||!r){var M=e.display.sizer.getBoundingClientRect();i+=M.left,d+=M.top}var K=e.display.lineSpace.getBoundingClientRect();return{left:i-K.left,top:d-K.top}}function ma(e,t,r,i,d){return i||(i=ut(e.doc,t.line)),Wr(e,i,ts(e,i,t.ch,d),r)}function ti(e,t,r,i,d,M){i=i||ut(e.doc,t.line),d||(d=Yi(e,i));function K(Fe,Ke){var qe=oi(e,d,Fe,Ke?"right":"left",M);return Ke?qe.left=qe.right:qe.right=qe.left,Wr(e,i,qe,r)}var J=Xe(i,e.doc.direction),Q=t.ch,te=t.sticky;if(Q>=i.text.length?(Q=i.text.length,te="before"):Q<=0&&(Q=0,te="after"),!J)return K(te=="before"?Q-1:Q,te=="before");function he(Fe,Ke,qe){var ot=J[Ke],ct=ot.level==1;return K(qe?Fe-1:Fe,ct!=qe)}var me=Ve(J,Q,te),Se=Ue,we=he(Q,me,te=="before");return Se!=null&&(we.other=he(Q,Se,te!="before")),we}function us(e,t){var r=0;t=_(e.doc,t),e.options.lineWrapping||(r=Ji(e.display)*t.ch);var i=ut(e.doc,t.line),d=ei(i)+Hr(e.display);return{left:r,right:r,top:d,bottom:d+i.height}}function ga(e,t,r,i,d){var M=Ye(e,t,r);return M.xRel=d,i&&(M.outside=i),M}function va(e,t,r){var i=e.doc;if(r+=e.display.viewOffset,r<0)return ga(i.first,0,null,-1,-1);var d=Ut(i,r),M=i.first+i.size-1;if(d>M)return ga(i.first+i.size-1,ut(i,M).text.length,null,1,1);t<0&&(t=0);for(var K=ut(i,d);;){var J=Go(e,K,d,t,r),Q=ri(K,J.ch+(J.xRel>0||J.outside>0?1:0));if(!Q)return J;var te=Q.find(1);if(te.line==d)return te;K=ut(i,d=te.line)}}function hs(e,t,r,i){i-=pa(t);var d=t.text.length,M=ze(function(K){return oi(e,r,K-1).bottom<=i},d,0);return d=ze(function(K){return oi(e,r,K).top>i},M,d),{begin:M,end:d}}function ds(e,t,r,i){r||(r=Yi(e,t));var d=Wr(e,t,oi(e,r,i),"line").top;return hs(e,t,r,d)}function ya(e,t,r,i){return e.bottom<=r?!1:e.top>r?!0:(i?e.left:e.right)>t}function Go(e,t,r,i,d){d-=ei(t);var M=Yi(e,t),K=pa(t),J=0,Q=t.text.length,te=!0,he=Xe(t,e.doc.direction);if(he){var me=(e.options.lineWrapping?zo:Ko)(e,t,r,M,he,i,d);te=me.level!=1,J=te?me.from:me.to-1,Q=te?me.to:me.from-1}var Se=null,we=null,Fe=ze(function(At){var Et=oi(e,M,At);return Et.top+=K,Et.bottom+=K,ya(Et,i,d,!1)?(Et.top<=d&&Et.left<=i&&(Se=At,we=Et),!0):!1},J,Q),Ke,qe,ot=!1;if(we){var ct=i-we.left<we.right-i,lt=ct==te;Fe=Se+(lt?0:1),qe=lt?"after":"before",Ke=ct?we.left:we.right}else{!te&&(Fe==Q||Fe==J)&&Fe++,qe=Fe==0?"after":Fe==t.text.length?"before":oi(e,M,Fe-(te?1:0)).bottom+K<=d==te?"after":"before";var pt=ti(e,Ye(r,Fe,qe),"line",t,M);Ke=pt.left,ot=d<pt.top?-1:d>=pt.bottom?1:0}return Fe=Ae(t.text,Fe,1),ga(r,Fe,qe,ot,i-Ke)}function Ko(e,t,r,i,d,M,K){var J=ze(function(me){var Se=d[me],we=Se.level!=1;return ya(ti(e,Ye(r,we?Se.to:Se.from,we?"before":"after"),"line",t,i),M,K,!0)},0,d.length-1),Q=d[J];if(J>0){var te=Q.level!=1,he=ti(e,Ye(r,te?Q.from:Q.to,te?"after":"before"),"line",t,i);ya(he,M,K,!0)&&he.top>K&&(Q=d[J-1])}return Q}function zo(e,t,r,i,d,M,K){var J=hs(e,t,i,K),Q=J.begin,te=J.end;/\s/.test(t.text.charAt(te-1))&&te--;for(var he=null,me=null,Se=0;Se<d.length;Se++){var we=d[Se];if(we.from>=te||we.to<=Q)continue;var Fe=we.level!=1,Ke=oi(e,i,Fe?Math.min(te,we.to)-1:Math.max(Q,we.from)).right,qe=Ke<M?M-Ke+1e9:Ke-M;(!he||me>qe)&&(he=we,me=qe)}return he||(he=d[d.length-1]),he.from<Q&&(he={from:Q,to:he.to,level:he.level}),he.to>te&&(he={from:he.from,to:te,level:he.level}),he}var Ni;function $i(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Ni==null){Ni=f("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Ni.appendChild(document.createTextNode("x")),Ni.appendChild(f("br"));Ni.appendChild(document.createTextNode("x"))}x(e.measure,Ni);var r=Ni.offsetHeight/50;return r>3&&(e.cachedTextHeight=r),T(e.measure),r||1}function Ji(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=f("span","xxxxxxxxxx"),r=f("pre",[t],"CodeMirror-line-like");x(e.measure,r);var i=t.getBoundingClientRect(),d=(i.right-i.left)/10;return d>2&&(e.cachedCharWidth=d),d||10}function ba(e){for(var t=e.display,r={},i={},d=t.gutters.clientLeft,M=t.gutters.firstChild,K=0;M;M=M.nextSibling,++K){var J=e.display.gutterSpecs[K].className;r[J]=M.offsetLeft+M.clientLeft+d,i[J]=M.clientWidth}return{fixedPos:_a(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:i,wrapperWidth:t.wrapper.clientWidth}}function _a(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function cs(e){var t=$i(e.display),r=e.options.lineWrapping,i=r&&Math.max(5,e.display.scroller.clientWidth/Ji(e.display)-3);return function(d){if(ai(e.doc,d))return 0;var M=0;if(d.widgets)for(var K=0;K<d.widgets.length;K++)d.widgets[K].height&&(M+=d.widgets[K].height);return r?M+(Math.ceil(d.text.length/i)||1)*t:M+t}}function Ea(e){var t=e.doc,r=cs(e);t.iter(function(i){var d=r(i);d!=i.height&&Mt(i,d)})}function Fi(e,t,r,i){var d=e.display;if(!r&&ye(t).getAttribute("cm-not-content")=="true")return null;var M,K,J=d.lineSpace.getBoundingClientRect();try{M=t.clientX-J.left,K=t.clientY-J.top}catch(me){return null}var Q=va(e,M,K),te;if(i&&Q.xRel>0&&(te=ut(e.doc,Q.line).text).length==Q.ch){var he=Y(te,te.length,e.options.tabSize)-te.length;Q=Ye(Q.line,Math.max(0,Math.round((M-qa(e.display).left)/Ji(e.display))-he))}return Q}function Ui(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var r=e.display.view,i=0;i<r.length;i++)if(t-=r[i].size,t<0)return i}function Fn(e,t,r,i){t==null&&(t=e.doc.first),r==null&&(r=e.doc.first+e.doc.size),i||(i=0);var d=e.display;if(i&&r<d.viewTo&&(d.updateLineNumbers==null||d.updateLineNumbers>t)&&(d.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=d.viewTo)yn&&cr(e.doc,t)<d.viewTo&&Si(e);else if(r<=d.viewFrom)yn&&Ti(e.doc,r+i)>d.viewFrom?Si(e):(d.viewFrom+=i,d.viewTo+=i);else if(t<=d.viewFrom&&r>=d.viewTo)Si(e);else if(t<=d.viewFrom){var M=Gr(e,r,r+i,1);M?(d.view=d.view.slice(M.index),d.viewFrom=M.lineN,d.viewTo+=i):Si(e)}else if(r>=d.viewTo){var K=Gr(e,t,t,-1);K?(d.view=d.view.slice(0,K.index),d.viewTo=K.lineN):Si(e)}else{var J=Gr(e,t,t,-1),Q=Gr(e,r,r+i,1);J&&Q?(d.view=d.view.slice(0,J.index).concat(Nn(e,J.lineN,Q.lineN)).concat(d.view.slice(Q.index)),d.viewTo+=i):Si(e)}var te=d.externalMeasured;te&&(r<te.lineN?te.lineN+=i:t<te.lineN+te.size&&(d.externalMeasured=null))}function wi(e,t,r){e.curOp.viewChanged=!0;var i=e.display,d=e.display.externalMeasured;if(d&&t>=d.lineN&&t<d.lineN+d.size&&(i.externalMeasured=null),t<i.viewFrom||t>=i.viewTo)return;var M=i.view[Ui(e,t)];if(M.node==null)return;var K=M.changes||(M.changes=[]);ae(K,r)==-1&&K.push(r)}function Si(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Gr(e,t,r,i){var d=Ui(e,t),M,K=e.display.view;if(!yn||r==e.doc.first+e.doc.size)return{index:d,lineN:r};for(var J=e.display.viewFrom,Q=0;Q<d;Q++)J+=K[Q].size;if(J!=t){if(i>0){if(d==K.length-1)return null;M=J+K[d].size-t,d++}else M=J-t;t+=M,r+=M}for(;cr(e.doc,r)!=r;){if(d==(i<0?0:K.length-1))return null;r+=i*K[d-(i<0?1:0)].size,d+=i}return{index:d,lineN:r}}function Vo(e,t,r){var i=e.display,d=i.view;d.length==0||t>=i.viewTo||r<=i.viewFrom?(i.view=Nn(e,t,r),i.viewFrom=t):(i.viewFrom>t?i.view=Nn(e,t,i.viewFrom).concat(i.view):i.viewFrom<t&&(i.view=i.view.slice(Ui(e,t))),i.viewFrom=t,i.viewTo<r?i.view=i.view.concat(Nn(e,i.viewTo,r)):i.viewTo>r&&(i.view=i.view.slice(0,Ui(e,r)))),i.viewTo=r}function fs(e){for(var t=e.display.view,r=0,i=0;i<t.length;i++){var d=t[i];!d.hidden&&(!d.node||d.changes)&&++r}return r}function br(e){e.display.input.showSelection(e.display.input.prepareSelection())}function ps(e,t){t===void 0&&(t=!0);for(var r=e.doc,i={},d=i.cursors=document.createDocumentFragment(),M=i.selection=document.createDocumentFragment(),K=0;K<r.sel.ranges.length;K++){if(!t&&K==r.sel.primIndex)continue;var J=r.sel.ranges[K];if(J.from().line>=e.display.viewTo||J.to().line<e.display.viewFrom)continue;var Q=J.empty();(Q||e.options.showCursorWhenSelecting)&&ms(e,J.head,d),Q||Xo(e,J,M)}return i}function ms(e,t,r){var i=ti(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),d=r.appendChild(f("div","\xA0","CodeMirror-cursor"));if(d.style.left=i.left+"px",d.style.top=i.top+"px",d.style.height=Math.max(0,i.bottom-i.top)*e.options.cursorHeight+"px",i.other){var M=r.appendChild(f("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));M.style.display="",M.style.left=i.other.left+"px",M.style.top=i.other.top+"px",M.style.height=(i.other.bottom-i.other.top)*.85+"px"}}function Kr(e,t){return e.top-t.top||e.left-t.left}function Xo(e,t,r){var i=e.display,d=e.doc,M=document.createDocumentFragment(),K=qa(e.display),J=K.left,Q=Math.max(i.sizerWidth,Pi(e)-i.sizer.offsetLeft)-K.right,te=d.direction=="ltr";function he(lt,pt,At,Et){pt<0&&(pt=0),pt=Math.round(pt),Et=Math.round(Et),M.appendChild(f("div",null,"CodeMirror-selected","position: absolute; left: "+lt+`px;
|
|
top: `+pt+"px; width: "+(At==null?Q-lt:At)+`px;
|
|
height: `+(Et-pt)+"px"))}function me(lt,pt,At){var Et=ut(d,lt),Nt=Et.text.length,Qt,xn;function an(fn,jn){return ma(e,Ye(lt,fn),"div",Et,jn)}function zn(fn,jn,Cn){var vn=ds(e,Et,null,fn),pn=jn=="ltr"==(Cn=="after")?"left":"right",on=Cn=="after"?vn.begin:vn.end-(/\s/.test(Et.text.charAt(vn.end-1))?2:1);return an(on,pn)[pn]}var Bn=Xe(Et,d.direction);return Be(Bn,pt||0,At==null?Nt:At,function(fn,jn,Cn,vn){var pn=Cn=="ltr",on=an(fn,pn?"left":"right"),Hn=an(jn-1,pn?"right":"left"),ur=pt==null&&fn==0,Ii=At==null&&jn==Nt,In=vn==0,li=!Bn||vn==Bn.length-1;if(Hn.top-on.top<=3){var Tn=(te?ur:Ii)&&In,Va=(te?Ii:ur)&&li,pi=Tn?J:(pn?on:Hn).left,Gi=Va?Q:(pn?Hn:on).right;he(pi,on.top,Gi-pi,on.bottom)}else{var Ki,Mn,hr,Xa;pn?(Ki=te&&ur&&In?J:on.left,Mn=te?Q:zn(fn,Cn,"before"),hr=te?J:zn(jn,Cn,"after"),Xa=te&&Ii&&li?Q:Hn.right):(Ki=te?zn(fn,Cn,"before"):J,Mn=!te&&ur&&In?Q:on.right,hr=!te&&Ii&&li?J:Hn.left,Xa=te?zn(jn,Cn,"after"):Q),he(Ki,on.top,Mn-Ki,on.bottom),on.bottom<Hn.top&&he(J,on.bottom,null,Hn.top),he(hr,Hn.top,Xa-hr,Hn.bottom)}(!Qt||Kr(on,Qt)<0)&&(Qt=on),Kr(Hn,Qt)<0&&(Qt=Hn),(!xn||Kr(on,xn)<0)&&(xn=on),Kr(Hn,xn)<0&&(xn=Hn)}),{start:Qt,end:xn}}var Se=t.from(),we=t.to();if(Se.line==we.line)me(Se.line,Se.ch,we.ch);else{var Fe=ut(d,Se.line),Ke=ut(d,we.line),qe=Dn(Fe)==Dn(Ke),ot=me(Se.line,Se.ch,qe?Fe.text.length+1:null).end,ct=me(we.line,qe?0:null,we.ch).start;qe&&(ot.top<ct.top-2?(he(ot.right,ot.top,null,ot.bottom),he(J,ct.top,ct.left,ct.bottom)):he(ot.right,ot.top,ct.left-ot.right,ot.bottom)),ot.bottom<ct.top&&he(J,ot.bottom,null,ct.top)}r.appendChild(M)}function xa(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var r=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Zi(e),t.cursorDiv.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function gs(e){e.state.focused||(e.display.input.focus(),Ta(e))}function vs(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Zi(e))},100)}function Ta(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(De(e,"focus",e,t),e.state.focused=!0,B(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),n&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),xa(e)}function Zi(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(De(e,"blur",e,t),e.state.focused=!1,C(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function zr(e){for(var t=e.display,r=t.lineDiv.offsetTop,i=0;i<t.view.length;i++){var d=t.view[i],M=e.options.lineWrapping,K=void 0,J=0;if(d.hidden)continue;if(G&&H<8){var Q=d.node.offsetTop+d.node.offsetHeight;K=Q-r,r=Q}else{var te=d.node.getBoundingClientRect();K=te.bottom-te.top,!M&&d.text.firstChild&&(J=d.text.firstChild.getBoundingClientRect().right-te.left-1)}var he=d.line.height-K;if((he>.005||he<-.005)&&(Mt(d.line,K),ys(d.line),d.rest))for(var me=0;me<d.rest.length;me++)ys(d.rest[me]);if(J>e.display.sizerWidth){var Se=Math.ceil(J/Ji(e.display));Se>e.display.maxLineLength&&(e.display.maxLineLength=Se,e.display.maxLine=d.line,e.display.maxLineChanged=!0)}}}function ys(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var r=e.widgets[t],i=r.node.parentNode;i&&(r.height=i.offsetHeight)}}function Vr(e,t,r){var i=r&&r.top!=null?Math.max(0,r.top):e.scroller.scrollTop;i=Math.floor(i-Hr(e));var d=r&&r.bottom!=null?r.bottom:i+e.wrapper.clientHeight,M=Ut(t,i),K=Ut(t,d);if(r&&r.ensure){var J=r.ensure.from.line,Q=r.ensure.to.line;J<M?(M=J,K=Ut(t,ei(ut(t,J))+e.wrapper.clientHeight)):Math.min(Q,t.lastLine())>=K&&(M=Ut(t,ei(ut(t,Q))-e.wrapper.clientHeight),K=Q)}return{from:M,to:Math.max(K,M+1)}}function Yo(e,t){if(ke(e,"scrollCursorIntoView"))return;var r=e.display,i=r.sizer.getBoundingClientRect(),d=null;if(t.top+i.top<0?d=!0:t.bottom+i.top>(window.innerHeight||document.documentElement.clientHeight)&&(d=!1),d!=null&&!o){var M=f("div","\u200B",null,`position: absolute;
|
|
top: `+(t.top-r.viewOffset-Hr(e.display))+`px;
|
|
height: `+(t.bottom-t.top+si(e)+r.barHeight)+`px;
|
|
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(M),M.scrollIntoView(d),e.display.lineSpace.removeChild(M)}}function $o(e,t,r,i){i==null&&(i=0);var d;!e.options.lineWrapping&&t==r&&(t=t.ch?Ye(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,r=t.sticky=="before"?Ye(t.line,t.ch+1,"before"):t);for(var M=0;M<5;M++){var K=!1,J=ti(e,t),Q=!r||r==t?J:ti(e,r);d={left:Math.min(J.left,Q.left),top:Math.min(J.top,Q.top)-i,right:Math.max(J.left,Q.left),bottom:Math.max(J.bottom,Q.bottom)+i};var te=wa(e,d),he=e.doc.scrollTop,me=e.doc.scrollLeft;if(te.scrollTop!=null&&(Er(e,te.scrollTop),Math.abs(e.doc.scrollTop-he)>1&&(K=!0)),te.scrollLeft!=null&&(Bi(e,te.scrollLeft),Math.abs(e.doc.scrollLeft-me)>1&&(K=!0)),!K)break}return d}function Jo(e,t){var r=wa(e,t);r.scrollTop!=null&&Er(e,r.scrollTop),r.scrollLeft!=null&&Bi(e,r.scrollLeft)}function wa(e,t){var r=e.display,i=$i(e.display);t.top<0&&(t.top=0);var d=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:r.scroller.scrollTop,M=ca(e),K={};t.bottom-t.top>M&&(t.bottom=t.top+M);var J=e.doc.height+da(r),Q=t.top<i,te=t.bottom>J-i;if(t.top<d)K.scrollTop=Q?0:t.top;else if(t.bottom>d+M){var he=Math.min(t.top,(te?J:t.bottom)-M);he!=d&&(K.scrollTop=he)}var me=e.options.fixedGutter?0:r.gutters.offsetWidth,Se=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:r.scroller.scrollLeft-me,we=Pi(e)-r.gutters.offsetWidth,Fe=t.right-t.left>we;return Fe&&(t.right=t.left+we),t.left<10?K.scrollLeft=0:t.left<Se?K.scrollLeft=Math.max(0,t.left+me-(Fe?0:10)):t.right>we+Se-3&&(K.scrollLeft=t.right+(Fe?0:10)-we),K}function Sa(e,t){if(t==null)return;Xr(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function Qi(e){Xr(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function _r(e,t,r){(t!=null||r!=null)&&Xr(e),t!=null&&(e.curOp.scrollLeft=t),r!=null&&(e.curOp.scrollTop=r)}function Zo(e,t){Xr(e),e.curOp.scrollToPos=t}function Xr(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var r=us(e,t.from),i=us(e,t.to);bs(e,r,i,t.margin)}}function bs(e,t,r,i){var d=wa(e,{left:Math.min(t.left,r.left),top:Math.min(t.top,r.top)-i,right:Math.max(t.right,r.right),bottom:Math.max(t.bottom,r.bottom)+i});_r(e,d.scrollLeft,d.scrollTop)}function Er(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;P||Aa(e,{top:t}),_s(e,t,!0),P&&Aa(e),wr(e,100)}function _s(e,t,r){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!r)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function Bi(e,t,r,i){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!i)return;e.doc.scrollLeft=t,Ss(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function xr(e){var t=e.display,r=t.gutters.offsetWidth,i=Math.round(e.doc.height+da(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?r:0,docHeight:i,scrollHeight:i+si(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}var ji=function(e,t,r){this.cm=r;var i=this.vert=f("div",[f("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),d=this.horiz=f("div",[f("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");i.tabIndex=d.tabIndex=-1,e(i),e(d),Ie(i,"scroll",function(){i.clientHeight&&t(i.scrollTop,"vertical")}),Ie(d,"scroll",function(){d.clientWidth&&t(d.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,G&&H<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};ji.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,i=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?i+"px":"0";var d=e.viewHeight-(t?i:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+d)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=r?i+"px":"0",this.horiz.style.left=e.barLeft+"px";var M=e.viewWidth-e.barLeft-(r?i:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+M)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(i==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?i:0,bottom:t?i:0}},ji.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},ji.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},ji.prototype.zeroWidthHack=function(){var e=s&&!h?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new ee,this.disableVert=new ee},ji.prototype.enableZeroWidthBar=function(e,t,r){e.style.pointerEvents="auto";function i(){var d=e.getBoundingClientRect(),M=r=="vert"?document.elementFromPoint(d.right-1,(d.top+d.bottom)/2):document.elementFromPoint((d.right+d.left)/2,d.bottom-1);M!=e?e.style.pointerEvents="none":t.set(1e3,i)}t.set(1e3,i)},ji.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Tr=function(){};Tr.prototype.update=function(){return{bottom:0,right:0}},Tr.prototype.setScrollLeft=function(){},Tr.prototype.setScrollTop=function(){},Tr.prototype.clear=function(){};function qi(e,t){t||(t=xr(e));var r=e.display.barWidth,i=e.display.barHeight;Es(e,t);for(var d=0;d<4&&r!=e.display.barWidth||i!=e.display.barHeight;d++)r!=e.display.barWidth&&e.options.lineWrapping&&zr(e),Es(e,xr(e)),r=e.display.barWidth,i=e.display.barHeight}function Es(e,t){var r=e.display,i=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=i.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=i.bottom)+"px",r.heightForcer.style.borderBottom=i.bottom+"px solid transparent",i.right&&i.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=i.bottom+"px",r.scrollbarFiller.style.width=i.right+"px"):r.scrollbarFiller.style.display="",i.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=i.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}var xs={native:ji,null:Tr};function Ts(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&C(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new xs[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Ie(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,r){r=="horizontal"?Bi(e,t):Er(e,t)},e),e.display.scrollbars.addClass&&B(e.display.wrapper,e.display.scrollbars.addClass)}var Qo=0;function Hi(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:++Qo},Zn(e.curOp)}function Wi(e){var t=e.curOp;t&&Io(t,function(r){for(var i=0;i<r.ops.length;i++)r.ops[i].cm.curOp=null;qo(r)})}function qo(e){for(var t=e.ops,r=0;r<t.length;r++)el(t[r]);for(var i=0;i<t.length;i++)tl(t[i]);for(var d=0;d<t.length;d++)nl(t[d]);for(var M=0;M<t.length;M++)il(t[M]);for(var K=0;K<t.length;K++)rl(t[K])}function el(e){var t=e.cm,r=t.display;sl(t),e.updateMaxLine&&jr(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<r.viewFrom||e.scrollToPos.to.line>=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Yr(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&Ca(e.cm,e.update)}function nl(e){var t=e.cm,r=t.display;e.updatedDisplay&&zr(t),e.barMeasure=xr(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=ts(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+si(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-Pi(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function il(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Bi(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var r=e.focus&&e.focus==F();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,r),(e.updatedDisplay||e.startHeight!=t.doc.height)&&qi(t,e.barMeasure),e.updatedDisplay&&Oa(t,e.barMeasure),e.selectionChanged&&xa(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),r&&gs(e.cm)}function rl(e){var t=e.cm,r=t.display,i=t.doc;if(e.updatedDisplay&&ws(t,e.update),r.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(r.wheelStartX=r.wheelStartY=null),e.scrollTop!=null&&_s(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Bi(t,e.scrollLeft,!0,!0),e.scrollToPos){var d=$o(t,_(i,e.scrollToPos.from),_(i,e.scrollToPos.to),e.scrollToPos.margin);Yo(t,d)}var M=e.maybeHiddenMarkers,K=e.maybeUnhiddenMarkers;if(M)for(var J=0;J<M.length;++J)M[J].lines.length||De(M[J],"hide");if(K)for(var Q=0;Q<K.length;++Q)K[Q].lines.length&&De(K[Q],"unhide");r.wrapper.offsetHeight&&(i.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&De(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Kn(e,t){if(e.curOp)return t();Hi(e);try{return t()}finally{Wi(e)}}function _n(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Hi(e);try{return t.apply(e,arguments)}finally{Wi(e)}}}function kn(e){return function(){if(this.curOp)return e.apply(this,arguments);Hi(this);try{return e.apply(this,arguments)}finally{Wi(this)}}}function En(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Hi(t);try{return e.apply(this,arguments)}finally{Wi(t)}}}function wr(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,N(al,e))}function al(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var r=+new Date+e.options.workTime,i=it(e,t.highlightFrontier),d=[];t.iter(i.line,Math.min(t.first+t.size,e.display.viewTo+500),function(M){if(i.line>=e.display.viewFrom){var K=M.styles,J=M.text.length>e.options.maxHighlightLength?Wt(t.mode,i.state):null,Q=ge(e,M,i,!0);J&&(i.state=J),M.styles=Q.styles;var te=M.styleClasses,he=Q.classes;he?M.styleClasses=he:te&&(M.styleClasses=null);for(var me=!K||K.length!=M.styles.length||te!=he&&(!te||!he||te.bgClass!=he.bgClass||te.textClass!=he.textClass),Se=0;!me&&Se<K.length;++Se)me=K[Se]!=M.styles[Se];me&&d.push(i.line),M.stateAfter=i.save(),i.nextLine()}else M.text.length<=e.options.maxHighlightLength&>(e,M.text,i),M.stateAfter=i.line%5==0?i.save():null,i.nextLine();if(+new Date>r)return wr(e,e.options.workDelay),!0}),t.highlightFrontier=i.line,t.modeFrontier=Math.max(t.modeFrontier,i.line),d.length&&Kn(e,function(){for(var M=0;M<d.length;M++)wi(e,d[M],"text")})}var Yr=function(e,t,r){var i=e.display;this.viewport=t,this.visible=Vr(i,e.doc,t),this.editorIsHidden=!i.wrapper.offsetWidth,this.wrapperHeight=i.wrapper.clientHeight,this.wrapperWidth=i.wrapper.clientWidth,this.oldDisplayWidth=Pi(e),this.force=r,this.dims=ba(e),this.events=[]};Yr.prototype.signal=function(e,t){ce(e,t)&&this.events.push(arguments)},Yr.prototype.finish=function(){for(var e=0;e<this.events.length;e++)De.apply(null,this.events[e])};function sl(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=si(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=si(e)+"px",t.scrollbarsClipped=!0)}function ol(e){if(e.hasFocus())return null;var t=F();if(!t||!b(e.display.lineDiv,t))return null;var r={activeElt:t};if(window.getSelection){var i=window.getSelection();i.anchorNode&&i.extend&&b(e.display.lineDiv,i.anchorNode)&&(r.anchorNode=i.anchorNode,r.anchorOffset=i.anchorOffset,r.focusNode=i.focusNode,r.focusOffset=i.focusOffset)}return r}function ll(e){if(!e||!e.activeElt||e.activeElt==F())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&b(document.body,e.anchorNode)&&b(document.body,e.focusNode)){var t=window.getSelection(),r=document.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),t.removeAllRanges(),t.addRange(r),t.extend(e.focusNode,e.focusOffset)}}function Ca(e,t){var r=e.display,i=e.doc;if(t.editorIsHidden)return Si(e),!1;if(!t.force&&t.visible.from>=r.viewFrom&&t.visible.to<=r.viewTo&&(r.updateLineNumbers==null||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&fs(e)==0)return!1;Cs(e)&&(Si(e),t.dims=ba(e));var d=i.first+i.size,M=Math.max(t.visible.from-e.options.viewportMargin,i.first),K=Math.min(d,t.visible.to+e.options.viewportMargin);r.viewFrom<M&&M-r.viewFrom<20&&(M=Math.max(i.first,r.viewFrom)),r.viewTo>K&&r.viewTo-K<20&&(K=Math.min(d,r.viewTo)),yn&&(M=cr(e.doc,M),K=Ti(e.doc,K));var J=M!=r.viewFrom||K!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;Vo(e,M,K),r.viewOffset=ei(ut(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var Q=fs(e);if(!J&&Q==0&&!t.force&&r.renderedView==r.view&&(r.updateLineNumbers==null||r.updateLineNumbers>=r.viewTo))return!1;var te=ol(e);return Q>4&&(r.lineDiv.style.display="none"),ul(e,r.updateLineNumbers,t.dims),Q>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,ll(te),T(r.cursorDiv),T(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,J&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,wr(e,400)),r.updateLineNumbers=null,!0}function ws(e,t){for(var r=t.viewport,i=!0;;i=!1){if(!i||!e.options.lineWrapping||t.oldDisplayWidth==Pi(e)){if(r&&r.top!=null&&(r={top:Math.min(e.doc.height+da(e.display)-ca(e),r.top)}),t.visible=Vr(e.display,e.doc,r),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else i&&(t.visible=Vr(e.display,e.doc,r));if(!Ca(e,t))break;zr(e);var d=xr(e);br(e),qi(e,d),Oa(e,d),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 Aa(e,t){var r=new Yr(e,t);if(Ca(e,r)){zr(e),ws(e,r);var i=xr(e);br(e),qi(e,i),Oa(e,i),r.finish()}}function ul(e,t,r){var i=e.display,d=e.options.lineNumbers,M=i.lineDiv,K=M.firstChild;function J(Fe){var Ke=Fe.nextSibling;return n&&s&&e.display.currentWheelTarget==Fe?Fe.style.display="none":Fe.parentNode.removeChild(Fe),Ke}for(var Q=i.view,te=i.viewFrom,he=0;he<Q.length;he++){var me=Q[he];if(!me.hidden)if(!me.node||me.node.parentNode!=M){var Se=No(e,me,te,r);M.insertBefore(Se,K)}else{for(;K!=me.node;)K=J(K);var we=d&&t!=null&&t<=te&&me.lineNumber;me.changes&&(ae(me.changes,"gutter")>-1&&(we=!1),Ya(e,me,te,r)),we&&(T(me.lineNumber),me.lineNumber.appendChild(document.createTextNode($n(e.options,te)))),K=me.node.nextSibling}te+=me.size}for(;K;)K=J(K)}function Ra(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Oa(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+si(e)+"px"}function Ss(e){var t=e.display,r=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var i=_a(t)-t.scroller.scrollLeft+e.doc.scrollLeft,d=t.gutters.offsetWidth,M=i+"px",K=0;K<r.length;K++)if(!r[K].hidden){e.options.fixedGutter&&(r[K].gutter&&(r[K].gutter.style.left=M),r[K].gutterBackground&&(r[K].gutterBackground.style.left=M));var J=r[K].alignable;if(J)for(var Q=0;Q<J.length;Q++)J[Q].style.left=M}e.options.fixedGutter&&(t.gutters.style.left=i+d+"px")}function Cs(e){if(!e.options.lineNumbers)return!1;var t=e.doc,r=$n(e.options,t.first+t.size-1),i=e.display;if(r.length!=i.lineNumChars){var d=i.measure.appendChild(f("div",[f("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt")),M=d.firstChild.offsetWidth,K=d.offsetWidth-M;return i.lineGutter.style.width="",i.lineNumInnerWidth=Math.max(M,i.lineGutter.offsetWidth-K)+1,i.lineNumWidth=i.lineNumInnerWidth+K,i.lineNumChars=i.lineNumInnerWidth?r.length:-1,i.lineGutter.style.width=i.lineNumWidth+"px",Ra(e.display),!0}return!1}function La(e,t){for(var r=[],i=!1,d=0;d<e.length;d++){var M=e[d],K=null;if(typeof M!="string"&&(K=M.style,M=M.className),M=="CodeMirror-linenumbers")if(t)i=!0;else continue;r.push({className:M,style:K})}return t&&!i&&r.push({className:"CodeMirror-linenumbers",style:null}),r}function As(e){var t=e.gutters,r=e.gutterSpecs;T(t),e.lineGutter=null;for(var i=0;i<r.length;++i){var d=r[i],M=d.className,K=d.style,J=t.appendChild(f("div",null,"CodeMirror-gutter "+M));K&&(J.style.cssText=K),M=="CodeMirror-linenumbers"&&(e.lineGutter=J,J.style.width=(e.lineNumWidth||1)+"px")}t.style.display=r.length?"":"none",Ra(e)}function Sr(e){As(e.display),Fn(e),Ss(e)}function hl(e,t,r,i){var d=this;this.input=r,d.scrollbarFiller=f("div",null,"CodeMirror-scrollbar-filler"),d.scrollbarFiller.setAttribute("cm-not-content","true"),d.gutterFiller=f("div",null,"CodeMirror-gutter-filler"),d.gutterFiller.setAttribute("cm-not-content","true"),d.lineDiv=w("div",null,"CodeMirror-code"),d.selectionDiv=f("div",null,null,"position: relative; z-index: 1"),d.cursorDiv=f("div",null,"CodeMirror-cursors"),d.measure=f("div",null,"CodeMirror-measure"),d.lineMeasure=f("div",null,"CodeMirror-measure"),d.lineSpace=w("div",[d.measure,d.lineMeasure,d.selectionDiv,d.cursorDiv,d.lineDiv],null,"position: relative; outline: none");var M=w("div",[d.lineSpace],"CodeMirror-lines");d.mover=f("div",[M],null,"position: relative"),d.sizer=f("div",[d.mover],"CodeMirror-sizer"),d.sizerWidth=null,d.heightForcer=f("div",null,null,"position: absolute; height: "+ue+"px; width: 1px;"),d.gutters=f("div",null,"CodeMirror-gutters"),d.lineGutter=null,d.scroller=f("div",[d.sizer,d.heightForcer,d.gutters],"CodeMirror-scroll"),d.scroller.setAttribute("tabIndex","-1"),d.wrapper=f("div",[d.scrollbarFiller,d.gutterFiller,d.scroller],"CodeMirror"),G&&H<8&&(d.gutters.style.zIndex=-1,d.scroller.style.paddingRight=0),!n&&!(P&&u)&&(d.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(d.wrapper):e(d.wrapper)),d.viewFrom=d.viewTo=t.first,d.reportedViewFrom=d.reportedViewTo=t.first,d.view=[],d.renderedView=null,d.externalMeasured=null,d.viewOffset=0,d.lastWrapHeight=d.lastWrapWidth=0,d.updateLineNumbers=null,d.nativeBarWidth=d.barHeight=d.barWidth=0,d.scrollbarsClipped=!1,d.lineNumWidth=d.lineNumInnerWidth=d.lineNumChars=null,d.alignWidgets=!1,d.cachedCharWidth=d.cachedTextHeight=d.cachedPaddingH=null,d.maxLine=null,d.maxLineLength=0,d.maxLineChanged=!1,d.wheelDX=d.wheelDY=d.wheelStartX=d.wheelStartY=null,d.shift=!1,d.selForContextMenu=null,d.activeTouch=null,d.gutterSpecs=La(i.gutters,i.lineNumbers),As(d),r.init(d)}var $r=0,Xn=null;G?Xn=-.53:P?Xn=15:g?Xn=-.7:m&&(Xn=-1/3);function Rs(e){var t=e.wheelDeltaX,r=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),r==null&&e.detail&&e.axis==e.VERTICAL_AXIS?r=e.detail:r==null&&(r=e.wheelDelta),{x:t,y:r}}function dl(e){var t=Rs(e);return t.x*=Xn,t.y*=Xn,t}function Os(e,t){var r=Rs(t),i=r.x,d=r.y,M=e.display,K=M.scroller,J=K.scrollWidth>K.clientWidth,Q=K.scrollHeight>K.clientHeight;if(!(i&&J||d&&Q))return;if(d&&s&&n){e:for(var te=t.target,he=M.view;te!=K;te=te.parentNode)for(var me=0;me<he.length;me++)if(he[me].node==te){e.display.currentWheelTarget=te;break e}}if(i&&!P&&!p&&Xn!=null){d&&Q&&Er(e,Math.max(0,K.scrollTop+d*Xn)),Bi(e,Math.max(0,K.scrollLeft+i*Xn)),(!d||d&&Q)&&ie(t),M.wheelStartX=null;return}if(d&&Xn!=null){var Se=d*Xn,we=e.doc.scrollTop,Fe=we+M.wrapper.clientHeight;Se<0?we=Math.max(0,we+Se-50):Fe=Math.min(e.doc.height,Fe+Se+50),Aa(e,{top:we,bottom:Fe})}$r<20&&(M.wheelStartX==null?(M.wheelStartX=K.scrollLeft,M.wheelStartY=K.scrollTop,M.wheelDX=i,M.wheelDY=d,setTimeout(function(){if(M.wheelStartX==null)return;var Ke=K.scrollLeft-M.wheelStartX,qe=K.scrollTop-M.wheelStartY,ot=qe&&M.wheelDY&&qe/M.wheelDY||Ke&&M.wheelDX&&Ke/M.wheelDX;if(M.wheelStartX=M.wheelStartY=null,!ot)return;Xn=(Xn*$r+ot)/($r+1),++$r},200)):(M.wheelDX+=i,M.wheelDY+=d))}var Yn=function(e,t){this.ranges=e,this.primIndex=t};Yn.prototype.primary=function(){return this.ranges[this.primIndex]},Yn.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var r=this.ranges[t],i=e.ranges[t];if(!mi(r.anchor,i.anchor)||!mi(r.head,i.head))return!1}return!0},Yn.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Yt(gi(this.ranges[t].anchor),gi(this.ranges[t].head));return new Yn(e,this.primIndex)},Yn.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Yn.prototype.contains=function(e,t){t||(t=e);for(var r=0;r<this.ranges.length;r++){var i=this.ranges[r];if(It(t,i.from())>=0&&It(e,i.to())<=0)return r}return-1};var Yt=function(e,t){this.anchor=e,this.head=t};Yt.prototype.from=function(){return yi(this.anchor,this.head)},Yt.prototype.to=function(){return vi(this.anchor,this.head)},Yt.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function ni(e,t,r){var i=e&&e.options.selectionsMayTouch,d=t[r];t.sort(function(Se,we){return It(Se.from(),we.from())}),r=ae(t,d);for(var M=1;M<t.length;M++){var K=t[M],J=t[M-1],Q=It(J.to(),K.from());if(i&&!K.empty()?Q>0:Q>=0){var te=yi(J.from(),K.from()),he=vi(J.to(),K.to()),me=J.empty()?K.from()==K.head:J.from()==J.head;M<=r&&--r,t.splice(--M,2,new Yt(me?he:te,me?te:he))}}return new Yn(t,r)}function Ci(e,t){return new Yn([new Yt(e,t||e)],0)}function Ai(e){return e.text?Ye(e.from.line+e.text.length-1,Me(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Ls(e,t){if(It(e,t.from)<0)return e;if(It(e,t.to)<=0)return Ai(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,i=e.ch;return e.line==t.to.line&&(i+=Ai(t).ch-t.to.ch),Ye(r,i)}function Ia(e,t){for(var r=[],i=0;i<e.sel.ranges.length;i++){var d=e.sel.ranges[i];r.push(new Yt(Ls(d.anchor,t),Ls(d.head,t)))}return ni(e.cm,r,e.sel.primIndex)}function Is(e,t,r){return e.line==t.line?Ye(r.line,e.ch-t.ch+r.ch):Ye(r.line+(e.line-t.line),e.ch)}function cl(e,t,r){for(var i=[],d=Ye(e.first,0),M=d,K=0;K<t.length;K++){var J=t[K],Q=Is(J.from,d,M),te=Is(Ai(J),d,M);if(d=J.to,M=te,r=="around"){var he=e.sel.ranges[K],me=It(he.head,he.anchor)<0;i[K]=new Yt(me?te:Q,me?Q:te)}else i[K]=new Yt(Q,Q)}return new Yn(i,e.sel.primIndex)}function Da(e){e.doc.mode=tn(e.options,e.doc.modeOption),Cr(e)}function Cr(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,wr(e,100),e.state.modeGen++,e.curOp&&Fn(e)}function Ds(e,t){return t.from.ch==0&&t.to.ch==0&&Me(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function ka(e,t,r,i){function d(ct){return r?r[ct]:null}function M(ct,lt,pt){ua(ct,lt,pt,i),Sn(ct,"change",ct,t)}function K(ct,lt){for(var pt=[],At=ct;At<lt;++At)pt.push(new Mi(te[At],d(At),i));return pt}var J=t.from,Q=t.to,te=t.text,he=ut(e,J.line),me=ut(e,Q.line),Se=Me(te),we=d(te.length-1),Fe=Q.line-J.line;if(t.full)e.insert(0,K(0,te.length)),e.remove(te.length,e.size-te.length);else if(Ds(e,t)){var Ke=K(0,te.length-1);M(me,me.text,we),Fe&&e.remove(J.line,Fe),Ke.length&&e.insert(J.line,Ke)}else if(he==me)if(te.length==1)M(he,he.text.slice(0,J.ch)+Se+he.text.slice(Q.ch),we);else{var qe=K(1,te.length-1);qe.push(new Mi(Se+he.text.slice(Q.ch),we,i)),M(he,he.text.slice(0,J.ch)+te[0],d(0)),e.insert(J.line+1,qe)}else if(te.length==1)M(he,he.text.slice(0,J.ch)+te[0]+me.text.slice(Q.ch),d(0)),e.remove(J.line+1,Fe);else{M(he,he.text.slice(0,J.ch)+te[0],d(0)),M(me,Se+me.text.slice(Q.ch),we);var ot=K(1,te.length-1);Fe>1&&e.remove(J.line+1,Fe-1),e.insert(J.line+1,ot)}Sn(e,"change",e,t)}function Ri(e,t,r){function i(d,M,K){if(d.linked)for(var J=0;J<d.linked.length;++J){var Q=d.linked[J];if(Q.doc==M)continue;var te=K&&Q.sharedHist;if(r&&!te)continue;t(Q.doc,te),i(Q.doc,d,te)}}i(e,null,!0)}function ks(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Ea(e),Da(e),Ms(e),e.options.lineWrapping||jr(e),e.options.mode=t.modeOption,Fn(e)}function Ms(e){(e.doc.direction=="rtl"?B:C)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){Kn(e,function(){Ms(e),Fn(e)})}function Jr(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 Ma(e,t){var r={from:gi(t.from),to:Ai(t),text:qt(e,t.from,t.to)};return Fs(e,r,t.from.line,t.to.line+1),Ri(e,function(i){return Fs(i,r,t.from.line,t.to.line+1)},!0),r}function Ps(e){for(;e.length;){var t=Me(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return Ps(e.done),Me(e.done);if(e.done.length&&!Me(e.done).ranges)return Me(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),Me(e.done)}function Ns(e,t,r,i){var d=e.history;d.undone.length=0;var M=+new Date,K,J;if((d.lastOp==i||d.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&d.lastModTime>M-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(K=pl(d,d.lastOp==i)))J=Me(K.changes),It(t.from,t.to)==0&&It(t.from,J.to)==0?J.to=Ai(t):K.changes.push(Ma(e,t));else{var Q=Me(d.done);for((!Q||!Q.ranges)&&Zr(e.sel,d.done),K={changes:[Ma(e,t)],generation:d.generation},d.done.push(K);d.done.length>d.undoDepth;)d.done.shift(),d.done[0].ranges||d.done.shift()}d.done.push(r),d.generation=++d.maxGeneration,d.lastModTime=d.lastSelTime=M,d.lastOp=d.lastSelOp=i,d.lastOrigin=d.lastSelOrigin=t.origin,J||De(e,"historyAdded")}function ml(e,t,r,i){var d=t.charAt(0);return d=="*"||d=="+"&&r.ranges.length==i.ranges.length&&r.somethingSelected()==i.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,r,i){var d=e.history,M=i&&i.origin;r==d.lastSelOp||M&&d.lastSelOrigin==M&&(d.lastModTime==d.lastSelTime&&d.lastOrigin==M||ml(e,M,Me(d.done),t))?d.done[d.done.length-1]=t:Zr(t,d.done),d.lastSelTime=+new Date,d.lastSelOrigin=M,d.lastSelOp=r,i&&i.clearRedo!==!1&&Ps(d.undone)}function Zr(e,t){var r=Me(t);r&&r.ranges&&r.equals(e)||t.push(e)}function Fs(e,t,r,i){var d=t["spans_"+e.id],M=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,i),function(K){K.markedSpans&&((d||(d=t["spans_"+e.id]={}))[M]=K.markedSpans),++M})}function vl(e){if(!e)return null;for(var t,r=0;r<e.length;++r)e[r].marker.explicitlyCleared?t||(t=e.slice(0,r)):t&&t.push(e[r]);return t?t.length?t:null:e}function yl(e,t){var r=t["spans_"+e.id];if(!r)return null;for(var i=[],d=0;d<t.text.length;++d)i.push(vl(r[d]));return i}function Us(e,t){var r=yl(e,t),i=qn(e,t);if(!r)return i;if(!i)return r;for(var d=0;d<r.length;++d){var M=r[d],K=i[d];if(M&&K){e:for(var J=0;J<K.length;++J){for(var Q=K[J],te=0;te<M.length;++te)if(M[te].marker==Q.marker)continue e;M.push(Q)}}else K&&(r[d]=K)}return r}function er(e,t,r){for(var i=[],d=0;d<e.length;++d){var M=e[d];if(M.ranges){i.push(r?Yn.prototype.deepCopy.call(M):M);continue}var K=M.changes,J=[];i.push({changes:J});for(var Q=0;Q<K.length;++Q){var te=K[Q],he=void 0;if(J.push({from:te.from,to:te.to,text:te.text}),t)for(var me in te)(he=me.match(/^spans_(\d+)$/))&&(ae(t,Number(he[1]))>-1&&(Me(J)[me]=te[me],delete te[me]))}}return i}function Pa(e,t,r,i){if(i){var d=e.anchor;if(r){var M=It(t,d)<0;M!=It(r,d)<0?(d=t,t=r):M!=It(t,r)<0&&(t=r)}return new Yt(d,t)}else return new Yt(r||t,t)}function Qr(e,t,r,i,d){d==null&&(d=e.cm&&(e.cm.display.shift||e.extend)),Ln(e,new Yn([Pa(e.sel.primary(),t,r,d)],0),i)}function Bs(e,t,r){for(var i=[],d=e.cm&&(e.cm.display.shift||e.extend),M=0;M<e.sel.ranges.length;M++)i[M]=Pa(e.sel.ranges[M],t[M],null,d);var K=ni(e.cm,i,e.sel.primIndex);Ln(e,K,r)}function Na(e,t,r,i){var d=e.sel.ranges.slice(0);d[t]=r,Ln(e,ni(e.cm,d,e.sel.primIndex),i)}function js(e,t,r,i){Ln(e,Ci(t,r),i)}function bl(e,t,r){var i={ranges:t.ranges,update:function(d){this.ranges=[];for(var M=0;M<d.length;M++)this.ranges[M]=new Yt(_(e,d[M].anchor),_(e,d[M].head))},origin:r&&r.origin};return De(e,"beforeSelectionChange",e,i),e.cm&&De(e.cm,"beforeSelectionChange",e.cm,i),i.ranges!=t.ranges?ni(e.cm,i.ranges,i.ranges.length-1):t}function Hs(e,t,r){var i=e.history.done,d=Me(i);d&&d.ranges?(i[i.length-1]=t,qr(e,t,r)):Ln(e,t,r)}function Ln(e,t,r){qr(e,t,r),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,r)}function qr(e,t,r){(ce(e,"beforeSelectionChange")||e.cm&&ce(e.cm,"beforeSelectionChange"))&&(t=bl(e,t,r));var i=r&&r.bias||(It(t.primary().head,e.sel.primary().head)<0?-1:1);Ws(e,Ks(e,t,i,!0)),!(r&&r.scroll===!1)&&e.cm&&Qi(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,ve(e.cm)),Sn(e,"cursorActivity",e)}function Gs(e){Ws(e,Ks(e,e.sel,null,!1))}function Ks(e,t,r,i){for(var d,M=0;M<t.ranges.length;M++){var K=t.ranges[M],J=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[M],Q=ea(e,K.anchor,J&&J.anchor,r,i),te=ea(e,K.head,J&&J.head,r,i);(d||Q!=K.anchor||te!=K.head)&&(d||(d=t.ranges.slice(0,M)),d[M]=new Yt(Q,te))}return d?ni(e.cm,d,t.primIndex):t}function tr(e,t,r,i,d){var M=ut(e,t.line);if(M.markedSpans)for(var K=0;K<M.markedSpans.length;++K){var J=M.markedSpans[K],Q=J.marker,te="selectLeft"in Q?!Q.selectLeft:Q.inclusiveLeft,he="selectRight"in Q?!Q.selectRight:Q.inclusiveRight;if((J.from==null||(te?J.from<=t.ch:J.from<t.ch))&&(J.to==null||(he?J.to>=t.ch:J.to>t.ch))){if(d&&(De(Q,"beforeCursorEnter"),Q.explicitlyCleared))if(M.markedSpans){--K;continue}else break;if(!Q.atomic)continue;if(r){var me=Q.find(i<0?1:-1),Se=void 0;if((i<0?he:te)&&(me=zs(e,me,-i,me&&me.line==t.line?M:null)),me&&me.line==t.line&&(Se=It(me,r))&&(i<0?Se<0:Se>0))return tr(e,me,t,i,d)}var we=Q.find(i<0?-1:1);return(i<0?te:he)&&(we=zs(e,we,i,we.line==t.line?M:null)),we?tr(e,we,t,i,d):null}}return t}function ea(e,t,r,i,d){var M=i||1,K=tr(e,t,r,M,d)||!d&&tr(e,t,r,M,!0)||tr(e,t,r,-M,d)||!d&&tr(e,t,r,-M,!0);return K||(e.cantEdit=!0,Ye(e.first,0))}function zs(e,t,r,i){return r<0&&t.ch==0?t.line>e.first?_(e,Ye(t.line-1)):null:r>0&&t.ch==(i||ut(e,t.line)).text.length?t.line<e.first+e.size-1?Ye(t.line+1,0):null:new Ye(t.line,t.ch+r)}function Vs(e){e.setSelection(Ye(e.firstLine(),0),Ye(e.lastLine()),Ee)}function Xs(e,t,r){var i={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return i.canceled=!0}};return r&&(i.update=function(d,M,K,J){d&&(i.from=_(e,d)),M&&(i.to=_(e,M)),K&&(i.text=K),J!==void 0&&(i.origin=J)}),De(e,"beforeChange",e,i),e.cm&&De(e.cm,"beforeChange",e.cm,i),i.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:i.from,to:i.to,text:i.text,origin:i.origin}}function nr(e,t,r){if(e.cm){if(!e.cm.curOp)return _n(e.cm,nr)(e,t,r);if(e.cm.state.suppressEdits)return}if((ce(e,"beforeChange")||e.cm&&ce(e.cm,"beforeChange"))&&(t=Xs(e,t,!0),!t))return;var i=Di&&!r&&_i(e,t.from,t.to);if(i)for(var d=i.length-1;d>=0;--d)Ys(e,{from:i[d].from,to:i[d].to,text:d?[""]:t.text,origin:t.origin});else Ys(e,t)}function Ys(e,t){if(t.text.length==1&&t.text[0]==""&&It(t.from,t.to)==0)return;var r=Ia(e,t);Ns(e,t,r,e.cm?e.cm.curOp.id:NaN),Ar(e,t,r,qn(e,t));var i=[];Ri(e,function(d,M){!M&&ae(i,d.history)==-1&&(Qs(d.history,t),i.push(d.history)),Ar(d,t,null,qn(d,t))})}function ta(e,t,r){var i=e.cm&&e.cm.state.suppressEdits;if(i&&!r)return;for(var d=e.history,M,K=e.sel,J=t=="undo"?d.done:d.undone,Q=t=="undo"?d.undone:d.done,te=0;te<J.length&&!(M=J[te],r?M.ranges&&!M.equals(e.sel):!M.ranges);te++);if(te==J.length)return;for(d.lastOrigin=d.lastSelOrigin=null;;)if(M=J.pop(),M.ranges){if(Zr(M,Q),r&&!M.equals(e.sel)){Ln(e,M,{clearRedo:!1});return}K=M}else if(i){J.push(M);return}else break;var he=[];Zr(K,Q),Q.push({changes:he,generation:d.generation}),d.generation=M.generation||++d.maxGeneration;for(var me=ce(e,"beforeChange")||e.cm&&ce(e.cm,"beforeChange"),Se=function(Ke){var qe=M.changes[Ke];if(qe.origin=t,me&&!Xs(e,qe,!1))return J.length=0,{};he.push(Ma(e,qe));var ot=Ke?Ia(e,qe):Me(J);Ar(e,qe,ot,Us(e,qe)),!Ke&&e.cm&&e.cm.scrollIntoView({from:qe.from,to:Ai(qe)});var ct=[];Ri(e,function(lt,pt){!pt&&ae(ct,lt.history)==-1&&(Qs(lt.history,qe),ct.push(lt.history)),Ar(lt,qe,null,Us(lt,qe))})},we=M.changes.length-1;we>=0;--we){var Fe=Se(we);if(Fe)return Fe.v}}function $s(e,t){if(t==0)return;if(e.first+=t,e.sel=new Yn(tt(e.sel.ranges,function(d){return new Yt(Ye(d.anchor.line+t,d.anchor.ch),Ye(d.head.line+t,d.head.ch))}),e.sel.primIndex),e.cm){Fn(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,i=r.viewFrom;i<r.viewTo;i++)wi(e.cm,i,"gutter")}}function Ar(e,t,r,i){if(e.cm&&!e.cm.curOp)return _n(e.cm,Ar)(e,t,r,i);if(t.to.line<e.first){$s(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 d=t.text.length-1-(e.first-t.from.line);$s(e,d),t={from:Ye(e.first,0),to:Ye(t.to.line+d,t.to.ch),text:[Me(t.text)],origin:t.origin}}var M=e.lastLine();t.to.line>M&&(t={from:t.from,to:Ye(M,ut(e,M).text.length),text:[t.text[0]],origin:t.origin}),t.removed=qt(e,t.from,t.to),r||(r=Ia(e,t)),e.cm?_l(e.cm,t,i):ka(e,t,i),qr(e,r,Ee),e.cantEdit&&ea(e,Ye(e.firstLine(),0))&&(e.cantEdit=!1)}function _l(e,t,r){var i=e.doc,d=e.display,M=t.from,K=t.to,J=!1,Q=M.line;e.options.lineWrapping||(Q=Dt(Dn(ut(i,M.line))),i.iter(Q,K.line+1,function(we){if(we==d.maxLine)return J=!0,!0})),i.sel.contains(t.from,t.to)>-1&&ve(e),ka(i,t,r,cs(e)),e.options.lineWrapping||(i.iter(Q,M.line+t.text.length,function(we){var Fe=pr(we);Fe>d.maxLineLength&&(d.maxLine=we,d.maxLineLength=Fe,d.maxLineChanged=!0,J=!1)}),J&&(e.curOp.updateMaxLine=!0)),Qn(i,M.line),wr(e,400);var te=t.text.length-(K.line-M.line)-1;t.full?Fn(e):M.line==K.line&&t.text.length==1&&!Ds(e.doc,t)?wi(e,M.line,"text"):Fn(e,M.line,K.line+1,te);var he=ce(e,"changes"),me=ce(e,"change");if(me||he){var Se={from:M,to:K,text:t.text,removed:t.removed,origin:t.origin};me&&Sn(e,"change",e,Se),he&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Se)}e.display.selForContextMenu=null}function ir(e,t,r,i,d){var M;i||(i=r),It(i,r)<0&&(M=[i,r],r=M[0],i=M[1]),typeof t=="string"&&(t=e.splitLines(t)),nr(e,{from:r,to:i,text:t,origin:d})}function Js(e,t,r,i){r<e.line?e.line+=i:t<e.line&&(e.line=t,e.ch=0)}function Zs(e,t,r,i){for(var d=0;d<e.length;++d){var M=e[d],K=!0;if(M.ranges){M.copied||(M=e[d]=M.deepCopy(),M.copied=!0);for(var J=0;J<M.ranges.length;J++)Js(M.ranges[J].anchor,t,r,i),Js(M.ranges[J].head,t,r,i);continue}for(var Q=0;Q<M.changes.length;++Q){var te=M.changes[Q];if(r<te.from.line)te.from=Ye(te.from.line+i,te.from.ch),te.to=Ye(te.to.line+i,te.to.ch);else if(t<=te.to.line){K=!1;break}}K||(e.splice(0,d+1),d=0)}}function Qs(e,t){var r=t.from.line,i=t.to.line,d=t.text.length-(i-r)-1;Zs(e.done,r,i,d),Zs(e.undone,r,i,d)}function Rr(e,t,r,i){var d=t,M=t;return typeof t=="number"?M=ut(e,V(e,t)):d=Dt(t),d==null?null:(i(M,d)&&e.cm&&wi(e.cm,d,r),M)}function Or(e){this.lines=e,this.parent=null;for(var t=0,r=0;r<e.length;++r)e[r].parent=this,t+=e[r].height;this.height=t}Or.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var r=e,i=e+t;r<i;++r){var d=this.lines[r];this.height-=d.height,yt(d),Sn(d,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,r){this.height+=r,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var i=0;i<t.length;++i)t[i].parent=this},iterN:function(e,t,r){for(var i=e+t;e<i;++e)if(r(this.lines[e]))return!0}};function Lr(e){this.children=e;for(var t=0,r=0,i=0;i<e.length;++i){var d=e[i];t+=d.chunkSize(),r+=d.height,d.parent=this}this.size=t,this.height=r,this.parent=null}Lr.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var r=0;r<this.children.length;++r){var i=this.children[r],d=i.chunkSize();if(e<d){var M=Math.min(t,d-e),K=i.height;if(i.removeInner(e,M),this.height-=K-i.height,d==M&&(this.children.splice(r--,1),i.parent=null),(t-=M)==0)break;e=0}else e-=d}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Or))){var J=[];this.collapse(J),this.children=[new Or(J)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,r){this.size+=t.length,this.height+=r;for(var i=0;i<this.children.length;++i){var d=this.children[i],M=d.chunkSize();if(e<=M){if(d.insertInner(e,t,r),d.lines&&d.lines.length>50){for(var K=d.lines.length%25+25,J=K;J<d.lines.length;){var Q=new Or(d.lines.slice(J,J+=25));d.height-=Q.height,this.children.splice(++i,0,Q),Q.parent=this}d.lines=d.lines.slice(0,K),this.maybeSpill()}break}e-=M}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),r=new Lr(t);if(e.parent){e.size-=r.size,e.height-=r.height;var d=ae(e.parent.children,e);e.parent.children.splice(d+1,0,r)}else{var i=new Lr(e.children);i.parent=e,e.children=[i,r],e=i}r.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,r){for(var i=0;i<this.children.length;++i){var d=this.children[i],M=d.chunkSize();if(e<M){var K=Math.min(t,M-e);if(d.iterN(e,K,r))return!0;if((t-=K)==0)break;e=0}else e-=M}}};var Ir=function(e,t,r){if(r)for(var i in r)r.hasOwnProperty(i)&&(this[i]=r[i]);this.doc=e,this.node=t};Ir.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,r=this.line,i=Dt(r);if(i==null||!t)return;for(var d=0;d<t.length;++d)t[d]==this&&t.splice(d--,1);t.length||(r.widgets=null);var M=vr(this);Mt(r,Math.max(0,r.height-M)),e&&(Kn(e,function(){qs(e,r,-M),wi(e,i,"widget")}),Sn(e,"lineWidgetCleared",e,this,i))},Ir.prototype.changed=function(){var e=this,t=this.height,r=this.doc.cm,i=this.line;this.height=null;var d=vr(this)-t;if(!d)return;ai(this.doc,i)||Mt(i,i.height+d),r&&Kn(r,function(){r.curOp.forceUpdate=!0,qs(r,i,d),Sn(r,"lineWidgetChanged",r,e,Dt(i))})},fe(Ir);function qs(e,t,r){ei(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Sa(e,r)}function El(e,t,r,i){var d=new Ir(e,r,i),M=e.cm;return M&&d.noHScroll&&(M.display.alignWidgets=!0),Rr(e,t,"widget",function(K){var J=K.widgets||(K.widgets=[]);if(d.insertAt==null?J.push(d):J.splice(Math.min(J.length-1,Math.max(0,d.insertAt)),0,d),d.line=K,M&&!ai(e,K)){var Q=ei(K)<e.scrollTop;Mt(K,K.height+vr(d)),Q&&Sa(M,d.height),M.curOp.forceUpdate=!0}return!0}),M&&Sn(M,"lineWidgetAdded",M,d,typeof t=="number"?t:Dt(t)),d}var eo=0,Oi=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++eo};Oi.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&Hi(e),ce(this,"clear")){var r=this.find();r&&Sn(this,"clear",r.from,r.to)}for(var i=null,d=null,M=0;M<this.lines.length;++M){var K=this.lines[M],J=Gn(K.markedSpans,this);e&&!this.collapsed?wi(e,Dt(K),"text"):e&&(J.to!=null&&(d=Dt(K)),J.from!=null&&(i=Dt(K))),K.markedSpans=ki(K.markedSpans,J),J.from==null&&this.collapsed&&!ai(this.doc,K)&&e&&Mt(K,$i(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var Q=0;Q<this.lines.length;++Q){var te=Dn(this.lines[Q]),he=pr(te);he>e.display.maxLineLength&&(e.display.maxLine=te,e.display.maxLineLength=he,e.display.maxLineChanged=!0)}i!=null&&e&&this.collapsed&&Fn(e,i,d+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Gs(e.doc)),e&&Sn(e,"markerCleared",e,this,i,d),t&&Wi(e),this.parent&&this.parent.clear()},Oi.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var r,i,d=0;d<this.lines.length;++d){var M=this.lines[d],K=Gn(M.markedSpans,this);if(K.from!=null&&(r=Ye(t?M:Dt(M),K.from),e==-1))return r;if(K.to!=null&&(i=Ye(t?M:Dt(M),K.to),e==1))return i}return r&&{from:r,to:i}},Oi.prototype.changed=function(){var e=this,t=this.find(-1,!0),r=this,i=this.doc.cm;if(!t||!i)return;Kn(i,function(){var d=t.line,M=Dt(t.line),K=fa(i,M);if(K&&(rs(K),i.curOp.selectionChanged=i.curOp.forceUpdate=!0),i.curOp.updateMaxLine=!0,!ai(r.doc,d)&&r.height!=null){var J=r.height;r.height=null;var Q=vr(r)-J;Q&&Mt(d,d.height+Q)}Sn(i,"markerChanged",i,e)})},Oi.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||ae(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Oi.prototype.detachLine=function(e){if(this.lines.splice(ae(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},fe(Oi);function rr(e,t,r,i,d){if(i&&i.shared)return xl(e,t,r,i,d);if(e.cm&&!e.cm.curOp)return _n(e.cm,rr)(e,t,r,i,d);var M=new Oi(e,d),K=It(t,r);if(i&&y(i,M,!1),K>0||K==0&&M.clearWhenEmpty!==!1)return M;if(M.replacedWith&&(M.collapsed=!0,M.widgetNode=w("span",[M.replacedWith],"CodeMirror-widget"),i.handleMouseEvents||M.widgetNode.setAttribute("cm-ignore-events","true"),i.insertLeft&&(M.widgetNode.insertLeft=!0)),M.collapsed){if(bn(e,t.line,t,r,M)||t.line!=r.line&&bn(e,r.line,t,r,M))throw new Error("Inserting collapsed marker partially overlapping an existing one");ui()}M.addToHistory&&Ns(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var J=t.line,Q=e.cm,te;if(e.iter(J,r.line+1,function(me){Q&&M.collapsed&&!Q.options.lineWrapping&&Dn(me)==Q.display.maxLine&&(te=!0),M.collapsed&&J!=t.line&&Mt(me,0),bi(me,new hi(M,J==t.line?t.ch:null,J==r.line?r.ch:null)),++J}),M.collapsed&&e.iter(t.line,r.line+1,function(me){ai(e,me)&&Mt(me,0)}),M.clearOnEnter&&Ie(M,"beforeCursorEnter",function(){return M.clear()}),M.readOnly&&(Vn(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),M.collapsed&&(M.id=++eo,M.atomic=!0),Q){if(te&&(Q.curOp.updateMaxLine=!0),M.collapsed)Fn(Q,t.line,r.line+1);else if(M.className||M.startStyle||M.endStyle||M.css||M.attributes||M.title)for(var he=t.line;he<=r.line;he++)wi(Q,he,"text");M.atomic&&Gs(Q.doc),Sn(Q,"markerAdded",Q,M)}return M}var Dr=function(e,t){this.markers=e,this.primary=t;for(var r=0;r<e.length;++r)e[r].parent=this};Dr.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Sn(this,"clear")},Dr.prototype.find=function(e,t){return this.primary.find(e,t)},fe(Dr);function xl(e,t,r,i,d){i=y(i),i.shared=!1;var M=[rr(e,t,r,i,d)],K=M[0],J=i.widgetNode;return Ri(e,function(Q){J&&(i.widgetNode=J.cloneNode(!0)),M.push(rr(Q,_(Q,t),_(Q,r),i,d));for(var te=0;te<Q.linked.length;++te)if(Q.linked[te].isParent)return;K=Me(M)}),new Dr(M,K)}function to(e){return e.findMarks(Ye(e.first,0),e.clipPos(Ye(e.lastLine())),function(t){return t.parent})}function Tl(e,t){for(var r=0;r<t.length;r++){var i=t[r],d=i.find(),M=e.clipPos(d.from),K=e.clipPos(d.to);if(It(M,K)){var J=rr(e,M,K,i.primary,i.primary.type);i.markers.push(J),J.parent=i}}}function wl(e){for(var t=function(i){var d=e[i],M=[d.primary.doc];Ri(d.primary.doc,function(Q){return M.push(Q)});for(var K=0;K<d.markers.length;K++){var J=d.markers[K];ae(M,J.doc)==-1&&(J.parent=null,d.markers.splice(K--,1))}},r=0;r<e.length;r++)t(r)}var Sl=0,Un=function(e,t,r,i,d){if(!(this instanceof Un))return new Un(e,t,r,i,d);r==null&&(r=0),Lr.call(this,[new Or([new Mi("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=r;var M=Ye(r,0);this.sel=Ci(M),this.history=new Jr(null),this.id=++Sl,this.modeOption=t,this.lineSep=i,this.direction=d=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),ka(this,{from:M,to:M,text:e}),Ln(this,Ci(M),Ee)};Un.prototype=st(Lr.prototype,{constructor:Un,iter:function(e,t,r){r?this.iterN(e-this.first,t-e,r):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var r=0,i=0;i<t.length;++i)r+=t[i].height;this.insertInner(e-this.first,t,r)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Ot(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:En(function(e){var t=Ye(this.first,0),r=this.first+this.size-1;nr(this,{from:t,to:Ye(r,ut(this,r).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&_r(this.cm,0,0),Ln(this,Ci(t),Ee)}),replaceRange:function(e,t,r,i){t=_(this,t),r=r?_(this,r):t,ir(this,e,t,r,i)},getRange:function(e,t,r){var i=qt(this,_(this,e),_(this,t));return r===!1?i:i.join(r||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(dn(this,e))return ut(this,e)},getLineNumber:function(e){return Dt(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=ut(this,e)),Dn(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return _(this,e)},getCursor:function(e){var t=this.sel.primary(),r;return e==null||e=="head"?r=t.head:e=="anchor"?r=t.anchor:e=="end"||e=="to"||e===!1?r=t.to():r=t.from(),r},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:En(function(e,t,r){js(this,_(this,typeof e=="number"?Ye(e,t||0):e),null,r)}),setSelection:En(function(e,t,r){js(this,_(this,e),_(this,t||e),r)}),extendSelection:En(function(e,t,r){Qr(this,_(this,e),t&&_(this,t),r)}),extendSelections:En(function(e,t){Bs(this,W(this,e),t)}),extendSelectionsBy:En(function(e,t){var r=tt(this.sel.ranges,e);Bs(this,W(this,r),t)}),setSelections:En(function(e,t,r){if(!e.length)return;for(var i=[],d=0;d<e.length;d++)i[d]=new Yt(_(this,e[d].anchor),_(this,e[d].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),Ln(this,ni(this.cm,i,t),r)}),addSelection:En(function(e,t,r){var i=this.sel.ranges.slice(0);i.push(new Yt(_(this,e),_(this,t||e))),Ln(this,ni(this.cm,i,i.length-1),r)}),getSelection:function(e){for(var t=this.sel.ranges,r,i=0;i<t.length;i++){var d=qt(this,t[i].from(),t[i].to());r=r?r.concat(d):d}return e===!1?r:r.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],r=this.sel.ranges,i=0;i<r.length;i++){var d=qt(this,r[i].from(),r[i].to());e!==!1&&(d=d.join(e||this.lineSeparator())),t[i]=d}return t},replaceSelection:function(e,t,r){for(var i=[],d=0;d<this.sel.ranges.length;d++)i[d]=e;this.replaceSelections(i,t,r||"+input")},replaceSelections:En(function(e,t,r){for(var i=[],d=this.sel,M=0;M<d.ranges.length;M++){var K=d.ranges[M];i[M]={from:K.from(),to:K.to(),text:this.splitLines(e[M]),origin:r}}for(var J=t&&t!="end"&&cl(this,i,t),Q=i.length-1;Q>=0;Q--)nr(this,i[Q]);J?Hs(this,J):this.cm&&Qi(this.cm)}),undo:En(function(){ta(this,"undo")}),redo:En(function(){ta(this,"redo")}),undoSelection:En(function(){ta(this,"undo",!0)}),redoSelection:En(function(){ta(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,r=0,i=0;i<e.done.length;i++)e.done[i].ranges||++t;for(var d=0;d<e.undone.length;d++)e.undone[d].ranges||++r;return{undo:t,redo:r}},clearHistory:function(){var e=this;this.history=new Jr(this.history.maxGeneration),Ri(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:er(this.history.done),undone:er(this.history.undone)}},setHistory:function(e){var t=this.history=new Jr(this.history.maxGeneration);t.done=er(e.done.slice(0),null,!0),t.undone=er(e.undone.slice(0),null,!0)},setGutterMarker:En(function(e,t,r){return Rr(this,e,"gutter",function(i){var d=i.gutterMarkers||(i.gutterMarkers={});return d[t]=r,!r&&se(d)&&(i.gutterMarkers=null),!0})}),clearGutter:En(function(e){var t=this;this.iter(function(r){r.gutterMarkers&&r.gutterMarkers[e]&&Rr(t,r,"gutter",function(){return r.gutterMarkers[e]=null,se(r.gutterMarkers)&&(r.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!dn(this,e))return null;if(t=e,e=ut(this,e),!e)return null}else if(t=Dt(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:En(function(e,t,r){return Rr(this,e,t=="gutter"?"gutter":"class",function(i){var d=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!i[d])i[d]=r;else{if(O(r).test(i[d]))return!1;i[d]+=" "+r}return!0})}),removeLineClass:En(function(e,t,r){return Rr(this,e,t=="gutter"?"gutter":"class",function(i){var d=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",M=i[d];if(M)if(r==null)i[d]=null;else{var K=M.match(O(r));if(!K)return!1;var J=K.index+K[0].length;i[d]=M.slice(0,K.index)+(!K.index||J==M.length?"":" ")+M.slice(J)||null}else return!1;return!0})}),addLineWidget:En(function(e,t,r){return El(this,e,t,r)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,r){return rr(this,_(this,e),_(this,t),r,r&&r.type||"range")},setBookmark:function(e,t){var r={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=_(this,e),rr(this,e,e,r,"bookmark")},findMarksAt:function(e){e=_(this,e);var t=[],r=ut(this,e.line).markedSpans;if(r)for(var i=0;i<r.length;++i){var d=r[i];(d.from==null||d.from<=e.ch)&&(d.to==null||d.to>=e.ch)&&t.push(d.marker.parent||d.marker)}return t},findMarks:function(e,t,r){e=_(this,e),t=_(this,t);var i=[],d=e.line;return this.iter(e.line,t.line+1,function(M){var K=M.markedSpans;if(K)for(var J=0;J<K.length;J++){var Q=K[J];!(Q.to!=null&&d==e.line&&e.ch>=Q.to||Q.from==null&&d!=e.line||Q.from!=null&&d==t.line&&Q.from>=t.ch)&&(!r||r(Q.marker))&&i.push(Q.marker.parent||Q.marker)}++d}),i},getAllMarks:function(){var e=[];return this.iter(function(t){var r=t.markedSpans;if(r)for(var i=0;i<r.length;++i)r[i].from!=null&&e.push(r[i].marker)}),e},posFromIndex:function(e){var t,r=this.first,i=this.lineSeparator().length;return this.iter(function(d){var M=d.text.length+i;if(M>e)return t=e,!0;e-=M,++r}),_(this,Ye(r,t))},indexFromPos:function(e){e=_(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var r=this.lineSeparator().length;return this.iter(this.first,e.line,function(i){t+=i.text.length+r}),t},copy:function(e){var t=new Un(Ot(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,r=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<r&&(r=e.to);var i=new Un(Ot(this,t,r),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(i.history=this.history),(this.linked||(this.linked=[])).push({doc:i,sharedHist:e.sharedHist}),i.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Tl(i,to(this)),i},unlinkDoc:function(e){if(e instanceof rn&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var r=this.linked[t];if(r.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),wl(to(this));break}if(e.history==this.history){var i=[e.id];Ri(e,function(d){return i.push(d.id)},!0),e.history=new Jr(null),e.history.done=er(this.history.done,i),e.history.undone=er(this.history.undone,i)}},iterLinkedDocs:function(e){Ri(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):xt(e)},lineSeparator:function(){return this.lineSep||`
|
|
`},setDirection:En(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)})}),Un.prototype.eachLine=Un.prototype.iter;var no=0;function Cl(e){var t=this;if(io(t),ke(t,e)||ci(t.display,e))return;ie(e),G&&(no=+new Date);var r=Fi(t,e,!0),i=e.dataTransfer.files;if(!r||t.isReadOnly())return;if(i&&i.length&&window.FileReader&&window.File)for(var d=i.length,M=Array(d),K=0,J=function(){++K==d&&_n(t,function(){r=_(t.doc,r);var we={from:r,to:r,text:t.doc.splitLines(M.filter(function(Fe){return Fe!=null}).join(t.doc.lineSeparator())),origin:"paste"};nr(t.doc,we),Hs(t.doc,Ci(_(t.doc,r),_(t.doc,Ai(we))))})()},Q=function(we,Fe){if(t.options.allowDropFileTypes&&ae(t.options.allowDropFileTypes,we.type)==-1){J();return}var Ke=new FileReader;Ke.onerror=function(){return J()},Ke.onload=function(){var qe=Ke.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(qe)){J();return}M[Fe]=qe,J()},Ke.readAsText(we)},te=0;te<i.length;te++)Q(i[te],te);else{if(t.state.draggingText&&t.doc.sel.contains(r)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var he=e.dataTransfer.getData("Text");if(he){var me;if(t.state.draggingText&&!t.state.draggingText.copy&&(me=t.listSelections()),qr(t.doc,Ci(r,r)),me)for(var Se=0;Se<me.length;++Se)ir(t.doc,"",me[Se].anchor,me[Se].head,"drag");t.replaceSelection(he,"around","paste"),t.display.input.focus()}}catch(we){}}}function Al(e,t){if(G&&(!e.state.draggingText||+new Date-no<100)){le(t);return}if(ke(e,t)||ci(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!m){var r=f("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",p&&(r.width=r.height=1,e.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),p&&r.parentNode.removeChild(r)}}function Rl(e,t){var r=Fi(e,t);if(!r)return;var i=document.createDocumentFragment();ms(e,r,i),e.display.dragCursor||(e.display.dragCursor=f("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),x(e.display.dragCursor,i)}function io(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function ro(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),r=[],i=0;i<t.length;i++){var d=t[i].CodeMirror;d&&r.push(d)}r.length&&r[0].operation(function(){for(var M=0;M<r.length;M++)e(r[M])})}var ao=!1;function Ol(){if(ao)return;Ll(),ao=!0}function Ll(){var e;Ie(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,ro(Il)},100))}),Ie(window,"blur",function(){return ro(Zi)})}function Il(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Li={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"},kr=0;kr<10;kr++)Li[kr+48]=Li[kr+96]=String(kr);for(var na=65;na<=90;na++)Li[na]=String.fromCharCode(na);for(var Mr=1;Mr<=12;Mr++)Li[Mr+111]=Li[Mr+63235]="F"+Mr;var fi={};fi.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"},fi.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"},fi.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"},fi.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"]},fi.default=s?fi.macDefault:fi.pcDefault;function Dl(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var r,i,d,M,K=0;K<t.length-1;K++){var J=t[K];if(/^(cmd|meta|m)$/i.test(J))M=!0;else if(/^a(lt)?$/i.test(J))r=!0;else if(/^(c|ctrl|control)$/i.test(J))i=!0;else if(/^s(hift)?$/i.test(J))d=!0;else throw new Error("Unrecognized modifier name: "+J)}return r&&(e="Alt-"+e),i&&(e="Ctrl-"+e),M&&(e="Cmd-"+e),d&&(e="Shift-"+e),e}function kl(e){var t={};for(var r in e)if(e.hasOwnProperty(r)){var i=e[r];if(/^(name|fallthrough|(de|at)tach)$/.test(r))continue;if(i=="..."){delete e[r];continue}for(var d=tt(r.split(" "),Dl),M=0;M<d.length;M++){var K=void 0,J=void 0;M==d.length-1?(J=d.join(" "),K=i):(J=d.slice(0,M+1).join(" "),K="...");var Q=t[J];if(!Q)t[J]=K;else if(Q!=K)throw new Error("Inconsistent bindings for "+J)}delete e[r]}for(var te in t)e[te]=t[te];return e}function ar(e,t,r,i){t=ia(t);var d=t.call?t.call(e,i):t[e];if(d===!1)return"nothing";if(d==="...")return"multi";if(d!=null&&r(d))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return ar(e,t.fallthrough,r,i);for(var M=0;M<t.fallthrough.length;M++){var K=ar(e,t.fallthrough[M],r,i);if(K)return K}}}function so(e){var t=typeof e=="string"?e:Li[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function oo(e,t,r){var i=e;return t.altKey&&i!="Alt"&&(e="Alt-"+e),(S?t.metaKey:t.ctrlKey)&&i!="Ctrl"&&(e="Ctrl-"+e),(S?t.ctrlKey:t.metaKey)&&i!="Mod"&&(e="Cmd-"+e),!r&&t.shiftKey&&i!="Shift"&&(e="Shift-"+e),e}function lo(e,t){if(p&&e.keyCode==34&&e.char)return!1;var r=Li[e.keyCode];return r==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(r=e.code),oo(r,e,t))}function ia(e){return typeof e=="string"?fi[e]:e}function sr(e,t){for(var r=e.doc.sel.ranges,i=[],d=0;d<r.length;d++){for(var M=t(r[d]);i.length&&It(M.from,Me(i).to)<=0;){var K=i.pop();if(It(K.from,M.from)<0){M.from=K.from;break}}i.push(M)}Kn(e,function(){for(var J=i.length-1;J>=0;J--)ir(e.doc,"",i[J].from,i[J].to,"+delete");Qi(e)})}function Fa(e,t,r){var i=Ae(e.text,t+r,r);return i<0||i>e.text.length?null:i}function Ua(e,t,r){var i=Fa(e,t.ch,r);return i==null?null:new Ye(t.line,i,r<0?"after":"before")}function Ba(e,t,r,i,d){if(e){t.doc.direction=="rtl"&&(d=-d);var M=Xe(r,t.doc.direction);if(M){var K=d<0?Me(M):M[0],J=d<0==(K.level==1),Q=J?"after":"before",te;if(K.level>0||t.doc.direction=="rtl"){var he=Yi(t,r);te=d<0?r.text.length-1:0;var me=oi(t,he,te).top;te=ze(function(Se){return oi(t,he,Se).top==me},d<0==(K.level==1)?K.from:K.to-1,te),Q=="before"&&(te=Fa(r,te,1))}else te=d<0?K.to:K.from;return new Ye(i,te,Q)}}return new Ye(i,d<0?r.text.length:0,d<0?"before":"after")}function Ml(e,t,r,i){var d=Xe(t,e.doc.direction);if(!d)return Ua(t,r,i);r.ch>=t.text.length?(r.ch=t.text.length,r.sticky="before"):r.ch<=0&&(r.ch=0,r.sticky="after");var M=Ve(d,r.ch,r.sticky),K=d[M];if(e.doc.direction=="ltr"&&K.level%2==0&&(i>0?K.to>r.ch:K.from<r.ch))return Ua(t,r,i);var J=function(ot,ct){return Fa(t,ot instanceof Ye?ot.ch:ot,ct)},Q,te=function(ot){return e.options.lineWrapping?(Q=Q||Yi(e,t),ds(e,t,Q,ot)):{begin:0,end:t.text.length}},he=te(r.sticky=="before"?J(r,-1):r.ch);if(e.doc.direction=="rtl"||K.level==1){var me=K.level==1==i<0,Se=J(r,me?1:-1);if(Se!=null&&(me?Se<=K.to&&Se<=he.end:Se>=K.from&&Se>=he.begin)){var we=me?"before":"after";return new Ye(r.line,Se,we)}}var Fe=function(ot,ct,lt){for(var pt=function(Qt,xn){return xn?new Ye(r.line,J(Qt,1),"before"):new Ye(r.line,Qt,"after")};ot>=0&&ot<d.length;ot+=ct){var At=d[ot],Et=ct>0==(At.level!=1),Nt=Et?lt.begin:J(lt.end,-1);if(At.from<=Nt&&Nt<At.to)return pt(Nt,Et);if(Nt=Et?At.from:J(At.to,-1),lt.begin<=Nt&&Nt<lt.end)return pt(Nt,Et)}},Ke=Fe(M+i,i,he);if(Ke)return Ke;var qe=i>0?he.end:J(he.begin,-1);return qe!=null&&!(i>0&&qe==t.text.length)&&(Ke=Fe(i>0?0:d.length-1,i,te(qe)),Ke)?Ke:null}var Pr={selectAll:Vs,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Ee)},killLine:function(e){return sr(e,function(t){if(t.empty()){var r=ut(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line<e.lastLine()?{from:t.head,to:Ye(t.head.line+1,0)}:{from:t.head,to:Ye(t.head.line,r)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return sr(e,function(t){return{from:Ye(t.from().line,0),to:_(e.doc,Ye(t.to().line+1,0))}})},delLineLeft:function(e){return sr(e,function(t){return{from:Ye(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return sr(e,function(t){var r=e.charCoords(t.head,"div").top+5,i=e.coordsChar({left:0,top:r},"div");return{from:i,to:t.from()}})},delWrappedLineRight:function(e){return sr(e,function(t){var r=e.charCoords(t.head,"div").top+5,i=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div");return{from:t.from(),to:i}})},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(Ye(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(Ye(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return uo(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return ho(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Pl(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div")},Ce)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:r},"div")},Ce)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5,i=e.coordsChar({left:0,top:r},"div");return i.ch<e.getLine(i.line).search(/\S/)?ho(e,t.head):i},Ce)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],r=e.listSelections(),i=e.options.tabSize,d=0;d<r.length;d++){var M=r[d].from(),K=Y(e.getLine(M.line),M.ch,i);t.push(de(i-K%i))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Kn(e,function(){for(var t=e.listSelections(),r=[],i=0;i<t.length;i++){if(!t[i].empty())continue;var d=t[i].head,M=ut(e.doc,d.line).text;if(M){if(d.ch==M.length&&(d=new Ye(d.line,d.ch-1)),d.ch>0)d=new Ye(d.line,d.ch+1),e.replaceRange(M.charAt(d.ch-1)+M.charAt(d.ch-2),Ye(d.line,d.ch-2),d,"+transpose");else if(d.line>e.doc.first){var K=ut(e.doc,d.line-1).text;K&&(d=new Ye(d.line,1),e.replaceRange(M.charAt(0)+e.doc.lineSeparator()+K.charAt(K.length-1),Ye(d.line-1,K.length-1),d,"+transpose"))}}r.push(new Yt(d,d))}e.setSelections(r)})},newlineAndIndent:function(e){return Kn(e,function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange(e.doc.lineSeparator(),t[r].anchor,t[r].head,"+input");t=e.listSelections();for(var i=0;i<t.length;i++)e.indentLine(t[i].from().line,null,!0);Qi(e)})},openLine:function(e){return e.replaceSelection(`
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function uo(e,t){var r=ut(e.doc,t),i=Dn(r);return i!=r&&(t=Dt(i)),Ba(!0,e,i,t,1)}function Pl(e,t){var r=ut(e.doc,t),i=Xi(r);return i!=r&&(t=Dt(i)),Ba(!0,e,r,t,-1)}function ho(e,t){var r=uo(e,t.line),i=ut(e.doc,r.line),d=Xe(i,e.doc.direction);if(!d||d[0].level==0){var M=Math.max(r.ch,i.text.search(/\S/)),K=t.line==r.line&&t.ch<=M&&t.ch;return Ye(r.line,K?0:M,r.sticky)}return r}function ra(e,t,r){if(typeof t=="string"&&(t=Pr[t],!t))return!1;e.display.input.ensurePolled();var i=e.display.shift,d=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r&&(e.display.shift=!1),d=t(e)!=Re}finally{e.display.shift=i,e.state.suppressEdits=!1}return d}function Nl(e,t,r){for(var i=0;i<e.state.keyMaps.length;i++){var d=ar(t,e.state.keyMaps[i],r,e);if(d)return d}return e.options.extraKeys&&ar(t,e.options.extraKeys,r,e)||ar(t,e.options.keyMap,r,e)}var Fl=new ee;function Nr(e,t,r,i){var d=e.state.keySeq;if(d){if(so(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Fl.set(50,function(){e.state.keySeq==d&&(e.state.keySeq=null,e.display.input.reset())}),co(e,d+" "+t,r,i))return!0}return co(e,t,r,i)}function co(e,t,r,i){var d=Nl(e,t,i);return d=="multi"&&(e.state.keySeq=t),d=="handled"&&Sn(e,"keyHandled",e,t,r),(d=="handled"||d=="multi")&&(ie(r),xa(e)),!!d}function fo(e,t){var r=lo(t,!0);return r?t.shiftKey&&!e.state.keySeq?Nr(e,"Shift-"+r,t,function(i){return ra(e,i,!0)})||Nr(e,r,t,function(i){if(typeof i=="string"?/^go[A-Z]/.test(i):i.motion)return ra(e,i)}):Nr(e,r,t,function(i){return ra(e,i)}):!1}function Ul(e,t,r){return Nr(e,"'"+r+"'",t,function(i){return ra(e,i,!0)})}var ja=null;function po(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=F(),ke(t,e))return;G&&H<11&&e.keyCode==27&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=r==16||e.shiftKey;var i=fo(t,e);p&&(ja=i?r:null,!i&&r==88&&!Lt&&(s?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),P&&!s&&!i&&r==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),r==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Bl(t)}function Bl(e){var t=e.display.lineDiv;B(t,"CodeMirror-crosshair");function r(i){(i.keyCode==18||!i.altKey)&&(C(t,"CodeMirror-crosshair"),at(document,"keyup",r),at(document,"mouseover",r))}Ie(document,"keyup",r),Ie(document,"mouseover",r)}function mo(e){e.keyCode==16&&(this.doc.sel.shift=!1),ke(this,e)}function go(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(ci(t.display,e)||ke(t,e)||e.ctrlKey&&!e.altKey||s&&e.metaKey)return;var r=e.keyCode,i=e.charCode;if(p&&r==ja){ja=null,ie(e);return}if(p&&(!e.which||e.which<10)&&fo(t,e))return;var d=String.fromCharCode(i==null?r:i);if(d=="\b")return;if(Ul(t,e,d))return;t.display.input.onKeyPress(e)}var jl=400,Ha=function(e,t,r){this.time=e,this.pos=t,this.button=r};Ha.prototype.compare=function(e,t,r){return this.time+jl>e&&It(t,this.pos)==0&&r==this.button};var Fr,Ur;function Hl(e,t){var r=+new Date;return Ur&&Ur.compare(r,e,t)?(Fr=Ur=null,"triple"):Fr&&Fr.compare(r,e,t)?(Ur=new Ha(r,e,t),Fr=null,"double"):(Fr=new Ha(r,e,t),Ur=null,"single")}function vo(e){var t=this,r=t.display;if(ke(t,e)||r.activeTouch&&r.input.supportsTouch())return;if(r.input.ensurePolled(),r.shift=e.shiftKey,ci(r,e)){n||(r.scroller.draggable=!1,setTimeout(function(){return r.scroller.draggable=!0},100));return}if(Wa(t,e))return;var i=Fi(t,e),d=Le(e),M=i?Hl(i,d):"single";if(window.focus(),d==1&&t.state.selectingText&&t.state.selectingText(e),i&&Wl(t,d,i,M,e))return;d==1?i?Kl(t,i,M,e):ye(e)==r.scroller&&ie(e):d==2?(i&&Qr(t.doc,i),setTimeout(function(){return r.input.focus()},20)):d==3&&(L?t.display.input.onContextMenu(e):vs(t))}function Wl(e,t,r,i,d){var M="Click";return i=="double"?M="Double"+M:i=="triple"&&(M="Triple"+M),M=(t==1?"Left":t==2?"Middle":"Right")+M,Nr(e,oo(M,d),d,function(K){if(typeof K=="string"&&(K=Pr[K]),!K)return!1;var J=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),J=K(e,r)!=Re}finally{e.state.suppressEdits=!1}return J})}function Gl(e,t,r){var i=e.getOption("configureMouse"),d=i?i(e,t,r):{};if(d.unit==null){var M=a?r.shiftKey&&r.metaKey:r.altKey;d.unit=M?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(d.extend==null||e.doc.extend)&&(d.extend=e.doc.extend||r.shiftKey),d.addNew==null&&(d.addNew=s?r.metaKey:r.ctrlKey),d.moveOnDrag==null&&(d.moveOnDrag=!(s?r.altKey:r.ctrlKey)),d}function Kl(e,t,r,i){G?setTimeout(N(gs,e),0):e.curOp.focus=F();var d=Gl(e,r,i),M=e.doc.sel,K;e.options.dragDrop&&Ne&&!e.isReadOnly()&&r=="single"&&(K=M.contains(t))>-1&&(It((K=M.ranges[K]).from(),t)<0||t.xRel>0)&&(It(K.to(),t)>0||t.xRel<0)?zl(e,i,t,d):Vl(e,i,t,d)}function zl(e,t,r,i){var d=e.display,M=!1,K=_n(e,function(te){n&&(d.scroller.draggable=!1),e.state.draggingText=!1,at(d.wrapper.ownerDocument,"mouseup",K),at(d.wrapper.ownerDocument,"mousemove",J),at(d.scroller,"dragstart",Q),at(d.scroller,"drop",K),M||(ie(te),i.addNew||Qr(e.doc,r,null,null,i.extend),n&&!m||G&&H==9?setTimeout(function(){d.wrapper.ownerDocument.body.focus({preventScroll:!0}),d.input.focus()},20):d.input.focus())}),J=function(te){M=M||Math.abs(t.clientX-te.clientX)+Math.abs(t.clientY-te.clientY)>=10},Q=function(){return M=!0};n&&(d.scroller.draggable=!0),e.state.draggingText=K,K.copy=!i.moveOnDrag,d.scroller.dragDrop&&d.scroller.dragDrop(),Ie(d.wrapper.ownerDocument,"mouseup",K),Ie(d.wrapper.ownerDocument,"mousemove",J),Ie(d.scroller,"dragstart",Q),Ie(d.scroller,"drop",K),vs(e),setTimeout(function(){return d.input.focus()},20)}function yo(e,t,r){if(r=="char")return new Yt(t,t);if(r=="word")return e.findWordAt(t);if(r=="line")return new Yt(Ye(t.line,0),_(e.doc,Ye(t.line+1,0)));var i=r(e,t);return new Yt(i.from,i.to)}function Vl(e,t,r,i){var d=e.display,M=e.doc;ie(t);var K,J,Q=M.sel,te=Q.ranges;if(i.addNew&&!i.extend?(J=M.sel.contains(r),J>-1?K=te[J]:K=new Yt(r,r)):(K=M.sel.primary(),J=M.sel.primIndex),i.unit=="rectangle")i.addNew||(K=new Yt(r,r)),r=Fi(e,t,!0,!0),J=-1;else{var he=yo(e,r,i.unit);i.extend?K=Pa(K,he.anchor,he.head,i.extend):K=he}i.addNew?J==-1?(J=te.length,Ln(M,ni(e,te.concat([K]),J),{scroll:!1,origin:"*mouse"})):te.length>1&&te[J].empty()&&i.unit=="char"&&!i.extend?(Ln(M,ni(e,te.slice(0,J).concat(te.slice(J+1)),0),{scroll:!1,origin:"*mouse"}),Q=M.sel):Na(M,J,K,xe):(J=0,Ln(M,new Yn([K],0),xe),Q=M.sel);var me=r;function Se(lt){if(It(me,lt)==0)return;if(me=lt,i.unit=="rectangle"){for(var pt=[],At=e.options.tabSize,Et=Y(ut(M,r.line).text,r.ch,At),Nt=Y(ut(M,lt.line).text,lt.ch,At),Qt=Math.min(Et,Nt),xn=Math.max(Et,Nt),an=Math.min(r.line,lt.line),zn=Math.min(e.lastLine(),Math.max(r.line,lt.line));an<=zn;an++){var Bn=ut(M,an).text,fn=Oe(Bn,Qt,At);Qt==xn?pt.push(new Yt(Ye(an,fn),Ye(an,fn))):Bn.length>fn&&pt.push(new Yt(Ye(an,fn),Ye(an,Oe(Bn,xn,At))))}pt.length||pt.push(new Yt(r,r)),Ln(M,ni(e,Q.ranges.slice(0,J).concat(pt),J),{origin:"*mouse",scroll:!1}),e.scrollIntoView(lt)}else{var jn=K,Cn=yo(e,lt,i.unit),vn=jn.anchor,pn;It(Cn.anchor,vn)>0?(pn=Cn.head,vn=yi(jn.from(),Cn.anchor)):(pn=Cn.anchor,vn=vi(jn.to(),Cn.head));var on=Q.ranges.slice(0);on[J]=Xl(e,new Yt(_(M,vn),pn)),Ln(M,ni(e,on,J),xe)}}var we=d.wrapper.getBoundingClientRect(),Fe=0;function Ke(lt){var pt=++Fe,At=Fi(e,lt,!0,i.unit=="rectangle");if(!At)return;if(It(At,me)!=0){e.curOp.focus=F(),Se(At);var Et=Vr(d,M);(At.line>=Et.to||At.line<Et.from)&&setTimeout(_n(e,function(){Fe==pt&&Ke(lt)}),150)}else{var Nt=lt.clientY<we.top?-20:lt.clientY>we.bottom?20:0;Nt&&setTimeout(_n(e,function(){if(Fe!=pt)return;d.scroller.scrollTop+=Nt,Ke(lt)}),50)}}function qe(lt){e.state.selectingText=!1,Fe=Infinity,lt&&(ie(lt),d.input.focus()),at(d.wrapper.ownerDocument,"mousemove",ot),at(d.wrapper.ownerDocument,"mouseup",ct),M.history.lastSelOrigin=null}var ot=_n(e,function(lt){lt.buttons===0||!Le(lt)?qe(lt):Ke(lt)}),ct=_n(e,qe);e.state.selectingText=ct,Ie(d.wrapper.ownerDocument,"mousemove",ot),Ie(d.wrapper.ownerDocument,"mouseup",ct)}function Xl(e,t){var r=t.anchor,i=t.head,d=ut(e.doc,r.line);if(It(r,i)==0&&r.sticky==i.sticky)return t;var M=Xe(d);if(!M)return t;var K=Ve(M,r.ch,r.sticky),J=M[K];if(J.from!=r.ch&&J.to!=r.ch)return t;var Q=K+(J.from==r.ch==(J.level!=1)?0:1);if(Q==0||Q==M.length)return t;var te;if(i.line!=r.line)te=(i.line-r.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var he=Ve(M,i.ch,i.sticky),me=he-K||(i.ch-r.ch)*(J.level==1?-1:1);he==Q-1||he==Q?te=me<0:te=me>0}var Se=M[Q+(te?-1:0)],we=te==(Se.level==1),Fe=we?Se.from:Se.to,Ke=we?"after":"before";return r.ch==Fe&&r.sticky==Ke?t:new Yt(new Ye(r.line,Fe,Ke),i)}function bo(e,t,r,i){var d,M;if(t.touches)d=t.touches[0].clientX,M=t.touches[0].clientY;else try{d=t.clientX,M=t.clientY}catch(Se){return!1}if(d>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;i&&ie(t);var K=e.display,J=K.lineDiv.getBoundingClientRect();if(M>J.bottom||!ce(e,r))return oe(t);M-=J.top-K.viewOffset;for(var Q=0;Q<e.display.gutterSpecs.length;++Q){var te=K.gutters.childNodes[Q];if(te&&te.getBoundingClientRect().right>=d){var he=Ut(e.doc,M),me=e.display.gutterSpecs[Q];return De(e,r,e,he,me.className,t),oe(t)}}}function Wa(e,t){return bo(e,t,"gutterClick",!0)}function _o(e,t){if(ci(e.display,t)||Yl(e,t))return;if(ke(e,t,"contextmenu"))return;L||e.display.input.onContextMenu(t)}function Yl(e,t){return ce(e,"gutterContextMenu")?bo(e,t,"gutterContextMenu",!1):!1}function Eo(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),yr(e)}var or={toString:function(){return"CodeMirror.Init"}},xo={},aa={};function $l(e){var t=e.optionHandlers;function r(i,d,M,K){e.defaults[i]=d,M&&(t[i]=K?function(J,Q,te){te!=or&&M(J,Q,te)}:M)}e.defineOption=r,e.Init=or,r("value","",function(i,d){return i.setValue(d)},!0),r("mode",null,function(i,d){i.doc.modeOption=d,Da(i)},!0),r("indentUnit",2,Da,!0),r("indentWithTabs",!1),r("smartIndent",!0),r("tabSize",4,function(i){Cr(i),yr(i),Fn(i)},!0),r("lineSeparator",null,function(i,d){if(i.doc.lineSep=d,!d)return;var M=[],K=i.doc.first;i.doc.iter(function(Q){for(var te=0;;){var he=Q.text.indexOf(d,te);if(he==-1)break;te=he+d.length,M.push(Ye(K,he))}K++});for(var J=M.length-1;J>=0;J--)ir(i.doc,d,M[J],Ye(M[J].line,M[J].ch+d.length))}),r("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(i,d,M){i.state.specialChars=new RegExp(d.source+(d.test(" ")?"":"| "),"g"),M!=or&&i.refresh()}),r("specialCharPlaceholder",Zt,function(i){return i.refresh()},!0),r("electricChars",!0),r("inputStyle",u?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),r("spellcheck",!1,function(i,d){return i.getInputField().spellcheck=d},!0),r("autocorrect",!1,function(i,d){return i.getInputField().autocorrect=d},!0),r("autocapitalize",!1,function(i,d){return i.getInputField().autocapitalize=d},!0),r("rtlMoveVisually",!A),r("wholeLineUpdateBefore",!0),r("theme","default",function(i){Eo(i),Sr(i)},!0),r("keyMap","default",function(i,d,M){var K=ia(d),J=M!=or&&ia(M);J&&J.detach&&J.detach(i,K),K.attach&&K.attach(i,J||null)}),r("extraKeys",null),r("configureMouse",null),r("lineWrapping",!1,Zl,!0),r("gutters",[],function(i,d){i.display.gutterSpecs=La(d,i.options.lineNumbers),Sr(i)},!0),r("fixedGutter",!0,function(i,d){i.display.gutters.style.left=d?_a(i.display)+"px":"0",i.refresh()},!0),r("coverGutterNextToScrollbar",!1,function(i){return qi(i)},!0),r("scrollbarStyle","native",function(i){Ts(i),qi(i),i.display.scrollbars.setScrollTop(i.doc.scrollTop),i.display.scrollbars.setScrollLeft(i.doc.scrollLeft)},!0),r("lineNumbers",!1,function(i,d){i.display.gutterSpecs=La(i.options.gutters,d),Sr(i)},!0),r("firstLineNumber",1,Sr,!0),r("lineNumberFormatter",function(i){return i},Sr,!0),r("showCursorWhenSelecting",!1,br,!0),r("resetSelectionOnContextMenu",!0),r("lineWiseCopyCut",!0),r("pasteLinesPerSelection",!0),r("selectionsMayTouch",!1),r("readOnly",!1,function(i,d){d=="nocursor"&&(Zi(i),i.display.input.blur()),i.display.input.readOnlyChanged(d)}),r("screenReaderLabel",null,function(i,d){d=d===""?null:d,i.display.input.screenReaderLabelChanged(d)}),r("disableInput",!1,function(i,d){d||i.display.input.reset()},!0),r("dragDrop",!0,Jl),r("allowDropFileTypes",null),r("cursorBlinkRate",530),r("cursorScrollMargin",0),r("cursorHeight",1,br,!0),r("singleCursorHeightPerLine",!0,br,!0),r("workTime",100),r("workDelay",100),r("flattenSpans",!0,Cr,!0),r("addModeClass",!1,Cr,!0),r("pollInterval",100),r("undoDepth",200,function(i,d){return i.doc.history.undoDepth=d}),r("historyEventDelay",1250),r("viewportMargin",10,function(i){return i.refresh()},!0),r("maxHighlightLength",1e4,Cr,!0),r("moveInputWithCursor",!0,function(i,d){d||i.display.input.resetPosition()}),r("tabindex",null,function(i,d){return i.display.input.getField().tabIndex=d||""}),r("autofocus",null),r("direction","ltr",function(i,d){return i.doc.setDirection(d)},!0),r("phrases",null)}function Jl(e,t,r){var i=r&&r!=or;if(!t!=!i){var d=e.display.dragFunctions,M=t?Ie:at;M(e.display.scroller,"dragstart",d.start),M(e.display.scroller,"dragenter",d.enter),M(e.display.scroller,"dragover",d.over),M(e.display.scroller,"dragleave",d.leave),M(e.display.scroller,"drop",d.drop)}}function Zl(e){e.options.lineWrapping?(B(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(C(e.display.wrapper,"CodeMirror-wrap"),jr(e)),Ea(e),Fn(e),yr(e),setTimeout(function(){return qi(e)},100)}function rn(e,t){var r=this;if(!(this instanceof rn))return new rn(e,t);this.options=t=t?y(t):{},y(xo,t,!1);var i=t.value;typeof i=="string"?i=new Un(i,t.mode,null,t.lineSeparator,t.direction):t.mode&&(i.modeOption=t.mode),this.doc=i;var d=new rn.inputStyles[t.inputStyle](this),M=this.display=new hl(e,i,d,t);M.wrapper.CodeMirror=this,Eo(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Ts(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new ee,keySeq:null,specialChars:null},t.autofocus&&!u&&M.input.focus(),G&&H<11&&setTimeout(function(){return r.display.input.reset(!0)},20),Ql(this),Ol(),Hi(this),this.curOp.forceUpdate=!0,ks(this,i),t.autofocus&&!u||this.hasFocus()?setTimeout(function(){r.hasFocus()&&!r.state.focused&&Ta(r)},20):Zi(this);for(var K in aa)aa.hasOwnProperty(K)&&aa[K](this,t[K],or);Cs(this),t.finishInit&&t.finishInit(this);for(var J=0;J<Ga.length;++J)Ga[J](this);Wi(this),n&&t.lineWrapping&&getComputedStyle(M.lineDiv).textRendering=="optimizelegibility"&&(M.lineDiv.style.textRendering="auto")}rn.defaults=xo,rn.optionHandlers=aa;function Ql(e){var t=e.display;Ie(t.scroller,"mousedown",_n(e,vo)),G&&H<11?Ie(t.scroller,"dblclick",_n(e,function(Q){if(ke(e,Q))return;var te=Fi(e,Q);if(!te||Wa(e,Q)||ci(e.display,Q))return;ie(Q);var he=e.findWordAt(te);Qr(e.doc,he.anchor,he.head)})):Ie(t.scroller,"dblclick",function(Q){return ke(e,Q)||ie(Q)}),Ie(t.scroller,"contextmenu",function(Q){return _o(e,Q)}),Ie(t.input.getField(),"contextmenu",function(Q){t.scroller.contains(Q.target)||_o(e,Q)});var r,i={end:0};function d(){t.activeTouch&&(r=setTimeout(function(){return t.activeTouch=null},1e3),i=t.activeTouch,i.end=+new Date)}function M(Q){if(Q.touches.length!=1)return!1;var te=Q.touches[0];return te.radiusX<=1&&te.radiusY<=1}function K(Q,te){if(te.left==null)return!0;var he=te.left-Q.left,me=te.top-Q.top;return he*he+me*me>20*20}Ie(t.scroller,"touchstart",function(Q){if(!ke(e,Q)&&!M(Q)&&!Wa(e,Q)){t.input.ensurePolled(),clearTimeout(r);var te=+new Date;t.activeTouch={start:te,moved:!1,prev:te-i.end<=300?i:null},Q.touches.length==1&&(t.activeTouch.left=Q.touches[0].pageX,t.activeTouch.top=Q.touches[0].pageY)}}),Ie(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Ie(t.scroller,"touchend",function(Q){var te=t.activeTouch;if(te&&!ci(t,Q)&&te.left!=null&&!te.moved&&new Date-te.start<300){var he=e.coordsChar(t.activeTouch,"page"),me;!te.prev||K(te,te.prev)?me=new Yt(he,he):!te.prev.prev||K(te,te.prev.prev)?me=e.findWordAt(he):me=new Yt(Ye(he.line,0),_(e.doc,Ye(he.line+1,0))),e.setSelection(me.anchor,me.head),e.focus(),ie(Q)}d()}),Ie(t.scroller,"touchcancel",d),Ie(t.scroller,"scroll",function(){t.scroller.clientHeight&&(Er(e,t.scroller.scrollTop),Bi(e,t.scroller.scrollLeft,!0),De(e,"scroll",e))}),Ie(t.scroller,"mousewheel",function(Q){return Os(e,Q)}),Ie(t.scroller,"DOMMouseScroll",function(Q){return Os(e,Q)}),Ie(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(Q){ke(e,Q)||le(Q)},over:function(Q){ke(e,Q)||(Rl(e,Q),le(Q))},start:function(Q){return Al(e,Q)},drop:_n(e,Cl),leave:function(Q){ke(e,Q)||io(e)}};var J=t.input.getField();Ie(J,"keyup",function(Q){return mo.call(e,Q)}),Ie(J,"keydown",_n(e,po)),Ie(J,"keypress",_n(e,go)),Ie(J,"focus",function(Q){return Ta(e,Q)}),Ie(J,"blur",function(Q){return Zi(e,Q)})}var Ga=[];rn.defineInitHook=function(e){return Ga.push(e)};function Br(e,t,r,i){var d=e.doc,M;r==null&&(r="add"),r=="smart"&&(d.mode.indent?M=it(e,t).state:r="prev");var K=e.options.tabSize,J=ut(d,t),Q=Y(J.text,null,K);J.stateAfter&&(J.stateAfter=null);var te=J.text.match(/^\s*/)[0],he;if(!i&&!/\S/.test(J.text))he=0,r="not";else if(r=="smart"&&(he=d.mode.indent(M,J.text.slice(te.length),J.text),he==Re||he>150)){if(!i)return;r="prev"}r=="prev"?t>d.first?he=Y(ut(d,t-1).text,null,K):he=0:r=="add"?he=Q+e.options.indentUnit:r=="subtract"?he=Q-e.options.indentUnit:typeof r=="number"&&(he=Q+r),he=Math.max(0,he);var me="",Se=0;if(e.options.indentWithTabs)for(var we=Math.floor(he/K);we;--we)Se+=K,me+=" ";if(Se<he&&(me+=de(he-Se)),me!=te)return ir(d,me,Ye(t,0),Ye(t,te.length),"+input"),J.stateAfter=null,!0;for(var Fe=0;Fe<d.sel.ranges.length;Fe++){var Ke=d.sel.ranges[Fe];if(Ke.head.line==t&&Ke.head.ch<te.length){var qe=Ye(t,te.length);Na(d,Fe,new Yt(qe,qe));break}}}var ii=null;function sa(e){ii=e}function Ka(e,t,r,i,d){var M=e.doc;e.display.shift=!1,i||(i=M.sel);var K=+new Date-200,J=d=="paste"||e.state.pasteIncoming>K,Q=xt(t),te=null;if(J&&i.ranges.length>1)if(ii&&ii.text.join(`
|
|
`)==t){if(i.ranges.length%ii.text.length==0){te=[];for(var he=0;he<ii.text.length;he++)te.push(M.splitLines(ii.text[he]))}}else Q.length==i.ranges.length&&e.options.pasteLinesPerSelection&&(te=tt(Q,function(ot){return[ot]}));for(var me=e.curOp.updateInput,Se=i.ranges.length-1;Se>=0;Se--){var we=i.ranges[Se],Fe=we.from(),Ke=we.to();we.empty()&&(r&&r>0?Fe=Ye(Fe.line,Fe.ch-r):e.state.overwrite&&!J?Ke=Ye(Ke.line,Math.min(ut(M,Ke.line).text.length,Ke.ch+Me(Q).length)):J&&ii&&ii.lineWise&&ii.text.join(`
|
|
`)==Q.join(`
|
|
`)&&(Fe=Ke=Ye(Fe.line,0)));var qe={from:Fe,to:Ke,text:te?te[Se%te.length]:Q,origin:d||(J?"paste":e.state.cutIncoming>K?"cut":"+input")};nr(e.doc,qe),Sn(e,"inputRead",e,qe)}t&&!J&&wo(e,t),Qi(e),e.curOp.updateInput<2&&(e.curOp.updateInput=me),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function To(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Kn(t,function(){return Ka(t,r,0,null,"paste")}),!0}function wo(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var r=e.doc.sel,i=r.ranges.length-1;i>=0;i--){var d=r.ranges[i];if(d.head.ch>100||i&&r.ranges[i-1].head.line==d.head.line)continue;var M=e.getModeAt(d.head),K=!1;if(M.electricChars){for(var J=0;J<M.electricChars.length;J++)if(t.indexOf(M.electricChars.charAt(J))>-1){K=Br(e,d.head.line,"smart");break}}else M.electricInput&&(M.electricInput.test(ut(e.doc,d.head.line).text.slice(0,d.head.ch))&&(K=Br(e,d.head.line,"smart")));K&&Sn(e,"electricInput",e,d.head.line)}}function So(e){for(var t=[],r=[],i=0;i<e.doc.sel.ranges.length;i++){var d=e.doc.sel.ranges[i].head.line,M={anchor:Ye(d,0),head:Ye(d+1,0)};r.push(M),t.push(e.getRange(M.anchor,M.head))}return{text:t,ranges:r}}function Co(e,t,r,i){e.setAttribute("autocorrect",r?"":"off"),e.setAttribute("autocapitalize",i?"":"off"),e.setAttribute("spellcheck",!!t)}function Ao(){var e=f("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=f("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return n?e.style.width="1000px":e.setAttribute("wrap","off"),c&&(e.style.border="1px solid black"),Co(e),t}function ql(e){var t=e.optionHandlers,r=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(i,d){var M=this.options,K=M[i];if(M[i]==d&&i!="mode")return;M[i]=d,t.hasOwnProperty(i)&&_n(this,t[i])(this,d,K),De(this,"optionChange",this,i)},getOption:function(i){return this.options[i]},getDoc:function(){return this.doc},addKeyMap:function(i,d){this.state.keyMaps[d?"push":"unshift"](ia(i))},removeKeyMap:function(i){for(var d=this.state.keyMaps,M=0;M<d.length;++M)if(d[M]==i||d[M].name==i)return d.splice(M,1),!0},addOverlay:kn(function(i,d){var M=i.token?i:e.getMode(this.options,i);if(M.startState)throw new Error("Overlays may not be stateful.");We(this.state.overlays,{mode:M,modeSpec:i,opaque:d&&d.opaque,priority:d&&d.priority||0},function(K){return K.priority}),this.state.modeGen++,Fn(this)}),removeOverlay:kn(function(i){for(var d=this.state.overlays,M=0;M<d.length;++M){var K=d[M].modeSpec;if(K==i||typeof i=="string"&&K.name==i){d.splice(M,1),this.state.modeGen++,Fn(this);return}}}),indentLine:kn(function(i,d,M){typeof d!="string"&&typeof d!="number"&&(d==null?d=this.options.smartIndent?"smart":"prev":d=d?"add":"subtract"),dn(this.doc,i)&&Br(this,i,d,M)}),indentSelection:kn(function(i){for(var d=this.doc.sel.ranges,M=-1,K=0;K<d.length;K++){var J=d[K];if(J.empty())J.head.line>M&&(Br(this,J.head.line,i,!0),M=J.head.line,K==this.doc.sel.primIndex&&Qi(this));else{var Q=J.from(),te=J.to(),he=Math.max(M,Q.line);M=Math.min(this.lastLine(),te.line-(te.ch?0:1))+1;for(var me=he;me<M;++me)Br(this,me,i);var Se=this.doc.sel.ranges;Q.ch==0&&d.length==Se.length&&Se[K].from().ch>0&&Na(this.doc,K,new Yt(Q,Se[K].to()),Ee)}}}),getTokenAt:function(i,d){return en(this,i,d)},getLineTokens:function(i,d){return en(this,Ye(i),d,!0)},getTokenTypeAt:function(i){i=_(this.doc,i);var d=He(this,ut(this.doc,i.line)),M=0,K=(d.length-1)/2,J=i.ch,Q;if(J==0)Q=d[2];else for(;;){var te=M+K>>1;if((te?d[te*2-1]:0)>=J)K=te;else if(d[te*2+1]<J)M=te+1;else{Q=d[te*2+2];break}}var he=Q?Q.indexOf("overlay "):-1;return he<0?Q:he==0?null:Q.slice(0,he-1)},getModeAt:function(i){var d=this.doc.mode;return d.innerMode?e.innerMode(d,this.getTokenAt(i).state).mode:d},getHelper:function(i,d){return this.getHelpers(i,d)[0]},getHelpers:function(i,d){var M=[];if(!r.hasOwnProperty(d))return M;var K=r[d],J=this.getModeAt(i);if(typeof J[d]=="string")K[J[d]]&&M.push(K[J[d]]);else if(J[d])for(var Q=0;Q<J[d].length;Q++){var te=K[J[d][Q]];te&&M.push(te)}else J.helperType&&K[J.helperType]?M.push(K[J.helperType]):K[J.name]&&M.push(K[J.name]);for(var he=0;he<K._global.length;he++){var me=K._global[he];me.pred(J,this)&&ae(M,me.val)==-1&&M.push(me.val)}return M},getStateAfter:function(i,d){var M=this.doc;return i=V(M,i==null?M.first+M.size-1:i),it(this,i+1,d).state},cursorCoords:function(i,d){var M,K=this.doc.sel.primary();return i==null?M=K.head:typeof i=="object"?M=_(this.doc,i):M=i?K.from():K.to(),ti(this,M,d||"page")},charCoords:function(i,d){return ma(this,_(this.doc,i),d||"page")},coordsChar:function(i,d){return i=ls(this,i,d||"page"),va(this,i.left,i.top)},lineAtHeight:function(i,d){return i=ls(this,{top:i,left:0},d||"page").top,Ut(this.doc,i+this.display.viewOffset)},heightAtLine:function(i,d,M){var K=!1,J;if(typeof i=="number"){var Q=this.doc.first+this.doc.size-1;i<this.doc.first?i=this.doc.first:i>Q&&(i=Q,K=!0),J=ut(this.doc,i)}else J=i;return Wr(this,J,{top:0,left:0},d||"page",M||K).top+(K?this.doc.height-ei(J):0)},defaultTextHeight:function(){return $i(this.display)},defaultCharWidth:function(){return Ji(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(i,d,M,K,J){var Q=this.display;i=ti(this,_(this.doc,i));var te=i.bottom,he=i.left;if(d.style.position="absolute",d.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(d),Q.sizer.appendChild(d),K=="over")te=i.top;else if(K=="above"||K=="near"){var me=Math.max(Q.wrapper.clientHeight,this.doc.height),Se=Math.max(Q.sizer.clientWidth,Q.lineSpace.clientWidth);(K=="above"||i.bottom+d.offsetHeight>me)&&i.top>d.offsetHeight?te=i.top-d.offsetHeight:i.bottom+d.offsetHeight<=me&&(te=i.bottom),he+d.offsetWidth>Se&&(he=Se-d.offsetWidth)}d.style.top=te+"px",d.style.left=d.style.right="",J=="right"?(he=Q.sizer.clientWidth-d.offsetWidth,d.style.right="0px"):(J=="left"?he=0:J=="middle"&&(he=(Q.sizer.clientWidth-d.offsetWidth)/2),d.style.left=he+"px"),M&&Jo(this,{left:he,top:te,right:he+d.offsetWidth,bottom:te+d.offsetHeight})},triggerOnKeyDown:kn(po),triggerOnKeyPress:kn(go),triggerOnKeyUp:mo,triggerOnMouseDown:kn(vo),execCommand:function(i){if(Pr.hasOwnProperty(i))return Pr[i].call(null,this)},triggerElectric:kn(function(i){wo(this,i)}),findPosH:function(i,d,M,K){var J=1;d<0&&(J=-1,d=-d);for(var Q=_(this.doc,i),te=0;te<d&&!(Q=za(this.doc,Q,J,M,K),Q.hitSide);++te);return Q},moveH:kn(function(i,d){var M=this;this.extendSelectionsBy(function(K){return M.display.shift||M.doc.extend||K.empty()?za(M.doc,K.head,i,d,M.options.rtlMoveVisually):i<0?K.from():K.to()},Ce)}),deleteH:kn(function(i,d){var M=this.doc.sel,K=this.doc;M.somethingSelected()?K.replaceSelection("",null,"+delete"):sr(this,function(J){var Q=za(K,J.head,i,d,!1);return i<0?{from:Q,to:J.head}:{from:J.head,to:Q}})}),findPosV:function(i,d,M,K){var J=1,Q=K;d<0&&(J=-1,d=-d);for(var te=_(this.doc,i),he=0;he<d;++he){var me=ti(this,te,"div");if(Q==null?Q=me.left:me.left=Q,te=Ro(this,me,J,M),te.hitSide)break}return te},moveV:kn(function(i,d){var M=this,K=this.doc,J=[],Q=!this.display.shift&&!K.extend&&K.sel.somethingSelected();if(K.extendSelectionsBy(function(he){if(Q)return i<0?he.from():he.to();var me=ti(M,he.head,"div");he.goalColumn!=null&&(me.left=he.goalColumn),J.push(me.left);var Se=Ro(M,me,i,d);return d=="page"&&he==K.sel.primary()&&Sa(M,ma(M,Se,"div").top-me.top),Se},Ce),J.length)for(var te=0;te<K.sel.ranges.length;te++)K.sel.ranges[te].goalColumn=J[te]}),findWordAt:function(i){var d=this.doc,M=ut(d,i.line).text,K=i.ch,J=i.ch;if(M){var Q=this.getHelper(i,"wordChars");(i.sticky=="before"||J==M.length)&&K?--K:++J;for(var te=M.charAt(K),he=Ze(te,Q)?function(me){return Ze(me,Q)}:/\s/.test(te)?function(me){return/\s/.test(me)}:function(me){return!/\s/.test(me)&&!Ze(me)};K>0&&he(M.charAt(K-1));)--K;for(;J<M.length&&he(M.charAt(J));)++J}return new Yt(Ye(i.line,K),Ye(i.line,J))},toggleOverwrite:function(i){if(i!=null&&i==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?B(this.display.cursorDiv,"CodeMirror-overwrite"):C(this.display.cursorDiv,"CodeMirror-overwrite"),De(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==F()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:kn(function(i,d){_r(this,i,d)}),getScrollInfo:function(){var i=this.display.scroller;return{left:i.scrollLeft,top:i.scrollTop,height:i.scrollHeight-si(this)-this.display.barHeight,width:i.scrollWidth-si(this)-this.display.barWidth,clientHeight:ca(this),clientWidth:Pi(this)}},scrollIntoView:kn(function(i,d){i==null?(i={from:this.doc.sel.primary().head,to:null},d==null&&(d=this.options.cursorScrollMargin)):typeof i=="number"?i={from:Ye(i,0),to:null}:i.from==null&&(i={from:i,to:null}),i.to||(i.to=i.from),i.margin=d||0,i.from.line!=null?Zo(this,i):bs(this,i.from,i.to,i.margin)}),setSize:kn(function(i,d){var M=this,K=function(Q){return typeof Q=="number"||/^\d+$/.test(String(Q))?Q+"px":Q};i!=null&&(this.display.wrapper.style.width=K(i)),d!=null&&(this.display.wrapper.style.height=K(d)),this.options.lineWrapping&&as(this);var J=this.display.viewFrom;this.doc.iter(J,this.display.viewTo,function(Q){if(Q.widgets){for(var te=0;te<Q.widgets.length;te++)if(Q.widgets[te].noHScroll){wi(M,J,"widget");break}}++J}),this.curOp.forceUpdate=!0,De(this,"refresh",this)}),operation:function(i){return Kn(this,i)},startOperation:function(){return Hi(this)},endOperation:function(){return Wi(this)},refresh:kn(function(){var i=this.display.cachedTextHeight;Fn(this),this.curOp.forceUpdate=!0,yr(this),_r(this,this.doc.scrollLeft,this.doc.scrollTop),Ra(this.display),(i==null||Math.abs(i-$i(this.display))>.5||this.options.lineWrapping)&&Ea(this),De(this,"refresh",this)}),swapDoc:kn(function(i){var d=this.doc;return d.cm=null,this.state.selectingText&&this.state.selectingText(),ks(this,i),yr(this),this.display.input.reset(),_r(this,i.scrollLeft,i.scrollTop),this.curOp.forceScroll=!0,Sn(this,"swapDoc",this,d),d}),phrase:function(i){var d=this.options.phrases;return d&&Object.prototype.hasOwnProperty.call(d,i)?d[i]:i},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}},fe(e),e.registerHelper=function(i,d,M){r.hasOwnProperty(i)||(r[i]=e[i]={_global:[]}),r[i][d]=M},e.registerGlobalHelper=function(i,d,M,K){e.registerHelper(i,d,K),r[i]._global.push({pred:M,val:K})}}function za(e,t,r,i,d){var M=t,K=r,J=ut(e,t.line),Q=d&&e.direction=="rtl"?-r:r;function te(){var ct=t.line+Q;return ct<e.first||ct>=e.first+e.size?!1:(t=new Ye(ct,t.ch,t.sticky),J=ut(e,ct))}function he(ct){var lt;if(i=="codepoint"){var pt=J.text.charCodeAt(t.ch+(i>0?0:-1));isNaN(pt)?lt=null:lt=new Ye(t.line,Math.max(0,Math.min(J.text.length,t.ch+r*(pt>=55296&&pt<56320?2:1))),-r)}else d?lt=Ml(e.cm,J,t,r):lt=Ua(J,t,r);if(lt==null)if(!ct&&te())t=Ba(d,e.cm,J,t.line,Q);else return!1;else t=lt;return!0}if(i=="char"||i=="codepoint")he();else if(i=="column")he(!0);else if(i=="word"||i=="group")for(var me=null,Se=i=="group",we=e.cm&&e.cm.getHelper(t,"wordChars"),Fe=!0;!(r<0&&!he(!Fe));Fe=!1){var Ke=J.text.charAt(t.ch)||`
|
|
`,qe=Ze(Ke,we)?"w":Se&&Ke==`
|
|
`?"n":!Se||/\s/.test(Ke)?null:"p";if(Se&&!Fe&&!qe&&(qe="s"),me&&me!=qe){r<0&&(r=1,he(),t.sticky="after");break}if(qe&&(me=qe),r>0&&!he(!Fe))break}var ot=ea(e,t,M,K,!0);return mi(M,ot)&&(ot.hitSide=!0),ot}function Ro(e,t,r,i){var d=e.doc,M=t.left,K;if(i=="page"){var J=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),Q=Math.max(J-.5*$i(e.display),3);K=(r>0?t.bottom:t.top)+r*Q}else i=="line"&&(K=r>0?t.bottom+3:t.top-3);for(var te;!(te=va(e,M,K),!te.outside);){if(r<0?K<=0:K>=d.height){te.hitSide=!0;break}K+=r*5}return te}var Jt=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new ee,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Jt.prototype.init=function(e){var t=this,r=this,i=r.cm,d=r.div=e.lineDiv;Co(d,i.options.spellcheck,i.options.autocorrect,i.options.autocapitalize);function M(J){for(var Q=J.target;Q;Q=Q.parentNode){if(Q==d)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(Q.className))break}return!1}Ie(d,"paste",function(J){if(!M(J)||ke(i,J)||To(J,i))return;H<=11&&setTimeout(_n(i,function(){return t.updateFromDOM()}),20)}),Ie(d,"compositionstart",function(J){t.composing={data:J.data,done:!1}}),Ie(d,"compositionupdate",function(J){t.composing||(t.composing={data:J.data,done:!1})}),Ie(d,"compositionend",function(J){t.composing&&(J.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Ie(d,"touchstart",function(){return r.forceCompositionEnd()}),Ie(d,"input",function(){t.composing||t.readFromDOMSoon()});function K(J){if(!M(J)||ke(i,J))return;if(i.somethingSelected())sa({lineWise:!1,text:i.getSelections()}),J.type=="cut"&&i.replaceSelection("",null,"cut");else if(i.options.lineWiseCopyCut){var Q=So(i);sa({lineWise:!0,text:Q.text}),J.type=="cut"&&i.operation(function(){i.setSelections(Q.ranges,0,Ee),i.replaceSelection("",null,"cut")})}else return;if(J.clipboardData){J.clipboardData.clearData();var te=ii.text.join(`
|
|
`);if(J.clipboardData.setData("Text",te),J.clipboardData.getData("Text")==te){J.preventDefault();return}}var he=Ao(),me=he.firstChild;i.display.lineSpace.insertBefore(he,i.display.lineSpace.firstChild),me.value=ii.text.join(`
|
|
`);var Se=document.activeElement;j(me),setTimeout(function(){i.display.lineSpace.removeChild(he),Se.focus(),Se==d&&r.showPrimarySelection()},50)}Ie(d,"copy",K),Ie(d,"cut",K)},Jt.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Jt.prototype.prepareSelection=function(){var e=ps(this.cm,!1);return e.focus=document.activeElement==this.div,e},Jt.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Jt.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Jt.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,r=t.doc.sel.primary(),i=r.from(),d=r.to();if(t.display.viewTo==t.display.viewFrom||i.line>=t.display.viewTo||d.line<t.display.viewFrom){e.removeAllRanges();return}var M=oa(t,e.anchorNode,e.anchorOffset),K=oa(t,e.focusNode,e.focusOffset);if(M&&!M.bad&&K&&!K.bad&&It(yi(M,K),i)==0&&It(vi(M,K),d)==0)return;var J=t.display.view,Q=i.line>=t.display.viewFrom&&Oo(t,i)||{node:J[0].measure.map[2],offset:0},te=d.line<t.display.viewTo&&Oo(t,d);if(!te){var he=J[J.length-1].measure,me=he.maps?he.maps[he.maps.length-1]:he.map;te={node:me[me.length-1],offset:me[me.length-2]-me[me.length-3]}}if(!Q||!te){e.removeAllRanges();return}var Se=e.rangeCount&&e.getRangeAt(0),we;try{we=v(Q.node,Q.offset,te.offset,te.node)}catch(Fe){}we&&(!P&&t.state.focused?(e.collapse(Q.node,Q.offset),we.collapsed||(e.removeAllRanges(),e.addRange(we))):(e.removeAllRanges(),e.addRange(we)),Se&&e.anchorNode==null?e.addRange(Se):P&&this.startGracePeriod()),this.rememberSelection()},Jt.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)},Jt.prototype.showMultipleSelections=function(e){x(this.cm.display.cursorDiv,e.cursors),x(this.cm.display.selectionDiv,e.selection)},Jt.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Jt.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return b(this.div,t)},Jt.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Jt.prototype.blur=function(){this.div.blur()},Jt.prototype.getField=function(){return this.div},Jt.prototype.supportsTouch=function(){return!0},Jt.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Kn(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)},Jt.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Jt.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(l&&g&&this.cm.display.gutterSpecs.length&&eu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();var r=oa(t,e.anchorNode,e.anchorOffset),i=oa(t,e.focusNode,e.focusOffset);r&&i&&Kn(t,function(){Ln(t.doc,Ci(r,i),Ee),(r.bad||i.bad)&&(t.curOp.selectionChanged=!0)})},Jt.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,r=e.doc.sel.primary(),i=r.from(),d=r.to();if(i.ch==0&&i.line>e.firstLine()&&(i=Ye(i.line-1,ut(e.doc,i.line-1).length)),d.ch==ut(e.doc,d.line).text.length&&d.line<e.lastLine()&&(d=Ye(d.line+1,0)),i.line<t.viewFrom||d.line>t.viewTo-1)return!1;var M,K,J;i.line==t.viewFrom||(M=Ui(e,i.line))==0?(K=Dt(t.view[0].line),J=t.view[0].node):(K=Dt(t.view[M].line),J=t.view[M-1].node.nextSibling);var Q=Ui(e,d.line),te,he;if(Q==t.view.length-1?(te=t.viewTo-1,he=t.lineDiv.lastChild):(te=Dt(t.view[Q+1].line)-1,he=t.view[Q+1].node.previousSibling),!J)return!1;for(var me=e.doc.splitLines(tu(e,J,he,K,te)),Se=qt(e.doc,Ye(K,0),Ye(te,ut(e.doc,te).text.length));me.length>1&&Se.length>1;)if(Me(me)==Me(Se))me.pop(),Se.pop(),te--;else if(me[0]==Se[0])me.shift(),Se.shift(),K++;else break;for(var we=0,Fe=0,Ke=me[0],qe=Se[0],ot=Math.min(Ke.length,qe.length);we<ot&&Ke.charCodeAt(we)==qe.charCodeAt(we);)++we;for(var ct=Me(me),lt=Me(Se),pt=Math.min(ct.length-(me.length==1?we:0),lt.length-(Se.length==1?we:0));Fe<pt&&ct.charCodeAt(ct.length-Fe-1)==lt.charCodeAt(lt.length-Fe-1);)++Fe;if(me.length==1&&Se.length==1&&K==i.line)for(;we&&we>i.ch&&ct.charCodeAt(ct.length-Fe-1)==lt.charCodeAt(lt.length-Fe-1);)we--,Fe++;me[me.length-1]=ct.slice(0,ct.length-Fe).replace(/^\u200b+/,""),me[0]=me[0].slice(we).replace(/\u200b+$/,"");var At=Ye(K,we),Et=Ye(te,Se.length?Me(Se).length-Fe:0);if(me.length>1||me[0]||It(At,Et))return ir(e.doc,me,At,Et,"+input"),!0},Jt.prototype.ensurePolled=function(){this.forceCompositionEnd()},Jt.prototype.reset=function(){this.forceCompositionEnd()},Jt.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Jt.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)},Jt.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Kn(this.cm,function(){return Fn(e.cm)})},Jt.prototype.setUneditable=function(e){e.contentEditable="false"},Jt.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||_n(this.cm,Ka)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Jt.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Jt.prototype.onContextMenu=function(){},Jt.prototype.resetPosition=function(){},Jt.prototype.needsContentAttribute=!0;function Oo(e,t){var r=fa(e,t.line);if(!r||r.hidden)return null;var i=ut(e.doc,t.line),d=es(r,i,t.line),M=Xe(i,e.doc.direction),K="left";if(M){var J=Ve(M,t.ch);K=J%2?"right":"left"}var Q=is(d.map,t.ch,K);return Q.offset=Q.collapse=="right"?Q.end:Q.start,Q}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function lr(e,t){return t&&(e.bad=!0),e}function tu(e,t,r,i,d){var M="",K=!1,J=e.doc.lineSeparator(),Q=!1;function te(we){return function(Fe){return Fe.id==we}}function he(){K&&(M+=J,Q&&(M+=J),K=Q=!1)}function me(we){we&&(he(),M+=we)}function Se(we){if(we.nodeType==1){var Fe=we.getAttribute("cm-text");if(Fe){me(Fe);return}var Ke=we.getAttribute("cm-marker"),qe;if(Ke){var ot=e.findMarks(Ye(i,0),Ye(d+1,0),te(+Ke));ot.length&&(qe=ot[0].find(0))&&me(qt(e.doc,qe.from,qe.to).join(J));return}if(we.getAttribute("contenteditable")=="false")return;var ct=/^(pre|div|p|li|table|br)$/i.test(we.nodeName);if(!/^br$/i.test(we.nodeName)&&we.textContent.length==0)return;ct&&he();for(var lt=0;lt<we.childNodes.length;lt++)Se(we.childNodes[lt]);/^(pre|p)$/i.test(we.nodeName)&&(Q=!0),ct&&(K=!0)}else we.nodeType==3&&me(we.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(Se(t),t==r);)t=t.nextSibling,Q=!1;return M}function oa(e,t,r){var i;if(t==e.display.lineDiv){if(i=e.display.lineDiv.childNodes[r],!i)return lr(e.clipPos(Ye(e.display.viewTo-1)),!0);t=null,r=0}else for(i=t;;i=i.parentNode){if(!i||i==e.display.lineDiv)return null;if(i.parentNode&&i.parentNode==e.display.lineDiv)break}for(var d=0;d<e.display.view.length;d++){var M=e.display.view[d];if(M.node==i)return nu(M,t,r)}}function nu(e,t,r){var i=e.text.firstChild,d=!1;if(!t||!b(i,t))return lr(Ye(Dt(e.line),0),!0);if(t==i&&(d=!0,t=i.childNodes[r],r=0,!t)){var M=e.rest?Me(e.rest):e.line;return lr(Ye(Dt(M),M.text.length),d)}var K=t.nodeType==3?t:null,J=t;for(!K&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(K=t.firstChild,r&&(r=K.nodeValue.length));J.parentNode!=i;)J=J.parentNode;var Q=e.measure,te=Q.maps;function he(qe,ot,ct){for(var lt=-1;lt<(te?te.length:0);lt++)for(var pt=lt<0?Q.map:te[lt],At=0;At<pt.length;At+=3){var Et=pt[At+2];if(Et==qe||Et==ot){var Nt=Dt(lt<0?e.line:e.rest[lt]),Qt=pt[At]+ct;return(ct<0||Et!=qe)&&(Qt=pt[At+(ct?1:0)]),Ye(Nt,Qt)}}}var me=he(K,J,r);if(me)return lr(me,d);for(var Se=J.nextSibling,we=K?K.nodeValue.length-r:0;Se;Se=Se.nextSibling){if(me=he(Se,Se.firstChild,0),me)return lr(Ye(me.line,me.ch-we),d);we+=Se.textContent.length}for(var Fe=J.previousSibling,Ke=r;Fe;Fe=Fe.previousSibling){if(me=he(Fe,Fe.firstChild,-1),me)return lr(Ye(me.line,me.ch+Ke),d);Ke+=Fe.textContent.length}}var un=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new ee,this.hasSelection=!1,this.composing=null};un.prototype.init=function(e){var t=this,r=this,i=this.cm;this.createField(e);var d=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),c&&(d.style.width="0px"),Ie(d,"input",function(){G&&H>=9&&t.hasSelection&&(t.hasSelection=null),r.poll()}),Ie(d,"paste",function(K){if(ke(i,K)||To(K,i))return;i.state.pasteIncoming=+new Date,r.fastPoll()});function M(K){if(ke(i,K))return;if(i.somethingSelected())sa({lineWise:!1,text:i.getSelections()});else if(i.options.lineWiseCopyCut){var J=So(i);sa({lineWise:!0,text:J.text}),K.type=="cut"?i.setSelections(J.ranges,null,Ee):(r.prevInput="",d.value=J.text.join(`
|
|
`),j(d))}else return;K.type=="cut"&&(i.state.cutIncoming=+new Date)}Ie(d,"cut",M),Ie(d,"copy",M),Ie(e.scroller,"paste",function(K){if(ci(e,K)||ke(i,K))return;if(!d.dispatchEvent){i.state.pasteIncoming=+new Date,r.focus();return}var J=new Event("paste");J.clipboardData=K.clipboardData,d.dispatchEvent(J)}),Ie(e.lineSpace,"selectstart",function(K){ci(e,K)||ie(K)}),Ie(d,"compositionstart",function(){var K=i.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:K,range:i.markText(K,i.getCursor("to"),{className:"CodeMirror-composing"})}}),Ie(d,"compositionend",function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)})},un.prototype.createField=function(e){this.wrapper=Ao(),this.textarea=this.wrapper.firstChild},un.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},un.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,i=ps(e);if(e.options.moveInputWithCursor){var d=ti(e,r.sel.primary().head,"div"),M=t.wrapper.getBoundingClientRect(),K=t.lineDiv.getBoundingClientRect();i.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,d.top+K.top-M.top)),i.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,d.left+K.left-M.left))}return i},un.prototype.showSelection=function(e){var t=this.cm,r=t.display;x(r.cursorDiv,e.cursors),x(r.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},un.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var r=t.getSelection();this.textarea.value=r,t.state.focused&&j(this.textarea),G&&H>=9&&(this.hasSelection=r)}else e||(this.prevInput=this.textarea.value="",G&&H>=9&&(this.hasSelection=null))},un.prototype.getField=function(){return this.textarea},un.prototype.supportsTouch=function(){return!1},un.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!u||F()!=this.textarea))try{this.textarea.focus()}catch(e){}},un.prototype.blur=function(){this.textarea.blur()},un.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},un.prototype.receivedFocus=function(){this.slowPoll()},un.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()})},un.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function r(){var i=t.poll();!i&&!e?(e=!0,t.polling.set(60,r)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,r)},un.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,i=this.prevInput;if(this.contextMenuPending||!t.state.focused||Qe(r)&&!i&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var d=r.value;if(d==i&&!t.somethingSelected())return!1;if(G&&H>=9&&this.hasSelection===d||s&&/[\uf700-\uf7ff]/.test(d))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var M=d.charCodeAt(0);if(M==8203&&!i&&(i="\u200B"),M==8666)return this.reset(),this.cm.execCommand("undo")}for(var K=0,J=Math.min(i.length,d.length);K<J&&i.charCodeAt(K)==d.charCodeAt(K);)++K;return Kn(t,function(){Ka(t,d.slice(K),i.length-K,null,e.composing?"*compose":null),d.length>1e3||d.indexOf(`
|
|
`)>-1?r.value=e.prevInput="":e.prevInput=d,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},un.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},un.prototype.onKeyPress=function(){G&&H>=9&&(this.hasSelection=null),this.fastPoll()},un.prototype.onContextMenu=function(e){var t=this,r=t.cm,i=r.display,d=t.textarea;t.contextMenuPending&&t.contextMenuPending();var M=Fi(r,e),K=i.scroller.scrollTop;if(!M||p)return;var J=r.options.resetSelectionOnContextMenu;J&&r.doc.sel.contains(M)==-1&&_n(r,Ln)(r.doc,Ci(M),Ee);var Q=d.style.cssText,te=t.wrapper.style.cssText,he=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",d.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(e.clientY-he.top-5)+"px; left: "+(e.clientX-he.left-5)+`px;
|
|
z-index: 1000; background: `+(G?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var me;n&&(me=window.scrollY),i.input.focus(),n&&window.scrollTo(null,me),i.input.reset(),r.somethingSelected()||(d.value=t.prevInput=" "),t.contextMenuPending=we,i.selForContextMenu=r.doc.sel,clearTimeout(i.detectingSelectAll);function Se(){if(d.selectionStart!=null){var Ke=r.somethingSelected(),qe="\u200B"+(Ke?d.value:"");d.value="\u21DA",d.value=qe,t.prevInput=Ke?"":"\u200B",d.selectionStart=1,d.selectionEnd=qe.length,i.selForContextMenu=r.doc.sel}}function we(){if(t.contextMenuPending!=we)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=te,d.style.cssText=Q,G&&H<9&&i.scrollbars.setScrollTop(i.scroller.scrollTop=K),d.selectionStart!=null){(!G||G&&H<9)&&Se();var Ke=0,qe=function(){i.selForContextMenu==r.doc.sel&&d.selectionStart==0&&d.selectionEnd>0&&t.prevInput=="\u200B"?_n(r,Vs)(r):Ke++<10?i.detectingSelectAll=setTimeout(qe,500):(i.selForContextMenu=null,i.input.reset())};i.detectingSelectAll=setTimeout(qe,200)}}if(G&&H>=9&&Se(),L){le(e);var Fe=function(){at(window,"mouseup",Fe),setTimeout(we,20)};Ie(window,"mouseup",Fe)}else setTimeout(we,50)},un.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},un.prototype.setUneditable=function(){},un.prototype.needsContentAttribute=!1;function iu(e,t){if(t=t?y(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var r=F();t.autofocus=r==e||e.getAttribute("autofocus")!=null&&r==document.body}function i(){e.value=J.getValue()}var d;if(e.form&&(Ie(e.form,"submit",i),!t.leaveSubmitMethodAlone)){var M=e.form;d=M.submit;try{var K=M.submit=function(){i(),M.submit=d,M.submit(),M.submit=K}}catch(Q){}}t.finishInit=function(Q){Q.save=i,Q.getTextArea=function(){return e},Q.toTextArea=function(){Q.toTextArea=isNaN,i(),e.parentNode.removeChild(Q.getWrapperElement()),e.style.display="",e.form&&(at(e.form,"submit",i),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=d))}},e.style.display="none";var J=rn(function(Q){return e.parentNode.insertBefore(Q,e.nextSibling)},t);return J}function ru(e){e.off=at,e.on=Ie,e.wheelEventPixels=dl,e.Doc=Un,e.splitLines=xt,e.countColumn=Y,e.findColumn=Oe,e.isWordChar=je,e.Pass=Re,e.signal=De,e.Line=Mi,e.changeEnd=Ai,e.scrollbarModel=xs,e.Pos=Ye,e.cmpPos=It,e.modes=Pt,e.mimeModes=Rt,e.resolveMode=bt,e.getMode=tn,e.modeExtensions=_t,e.extendMode=Tt,e.copyState=Wt,e.startState=hn,e.innerMode=nn,e.commands=Pr,e.keyMap=fi,e.keyName=lo,e.isModifierKey=so,e.lookupKey=ar,e.normalizeKeyMap=kl,e.StringStream=dt,e.SharedTextMarker=Dr,e.TextMarker=Oi,e.LineWidget=Ir,e.e_preventDefault=ie,e.e_stopPropagation=ne,e.e_stop=le,e.addClass=B,e.contains=b,e.rmClass=C,e.keyNames=Li}$l(rn),ql(rn);var au="iter insert remove copy getEditor constructor".split(" ");for(var la in Un.prototype)Un.prototype.hasOwnProperty(la)&&ae(au,la)<0&&(rn.prototype[la]=function(e){return function(){return e.apply(this.doc,arguments)}}(Un.prototype[la]));return fe(Un),rn.inputStyles={textarea:un,contenteditable:Jt},rn.defineMode=function(e){!rn.defaults.mode&&e!="null"&&(rn.defaults.mode=e),mn.apply(this,arguments)},rn.defineMIME=sn,rn.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),rn.defineMIME("text/plain","null"),rn.defineExtension=function(e,t){rn.prototype[e]=t},rn.defineDocExtension=function(e,t){Un.prototype[e]=t},rn.fromTextArea=iu,ru(rn),rn.version="5.58.2",rn})},Y1PL:function(ht,be,Z){"use strict";Z.r(be),Z.d(be,"ResizableTextArea",function(){return ae});var re=Z("wx14"),$=Z("1OyB"),P=Z("vuIU"),X=Z("Ji7U"),U=Z("LK+K"),k=Z("q1tI"),G=Z("VTBJ"),H=Z("rePB"),n=Z("Zm9Q"),D=Z("Kwbf"),g=Z("c+Xe"),p=Z("m+aA"),m=Z("bdgK"),h=new Map;function o(Ee){Ee.forEach(function(xe){var Ce,Oe=xe.target;(Ce=h.get(Oe))===null||Ce===void 0||Ce.forEach(function(pe){return pe(Oe)})})}var c=new m.default(o),l=null,u=null;function s(Ee,xe){h.has(Ee)||(h.set(Ee,new Set),c.observe(Ee)),h.get(Ee).add(xe)}function a(Ee,xe){h.has(Ee)&&(h.get(Ee).delete(xe),h.get(Ee).size||(c.unobserve(Ee),h.delete(Ee)))}var A=function(Ee){Object(X.a)(Ce,Ee);var xe=Object(U.a)(Ce);function Ce(){return Object($.a)(this,Ce),xe.apply(this,arguments)}return Object(P.a)(Ce,[{key:"render",value:function(){return this.props.children}}]),Ce}(k.Component),E=k.createContext(null);function S(Ee){var xe=Ee.children,Ce=Ee.onBatchResize,Oe=k.useRef(0),pe=k.useRef([]),de=k.useContext(E),Me=k.useCallback(function(tt,We,rt){Oe.current+=1;var st=Oe.current;pe.current.push({size:tt,element:We,data:rt}),Promise.resolve().then(function(){st===Oe.current&&(Ce==null||Ce(pe.current),pe.current=[])}),de==null||de(tt,We,rt)},[Ce,de]);return k.createElement(E.Provider,{value:Me},xe)}function L(Ee){var xe=Ee.children,Ce=Ee.disabled,Oe=k.useRef(null),pe=k.useRef(null),de=k.useContext(E),Me=k.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),tt=k.isValidElement(xe)&&Object(g.c)(xe),We=tt?xe.ref:null,rt=k.useMemo(function(){return Object(g.a)(We,Oe)},[We,Oe]),st=k.useRef(Ee);st.current=Ee;var Pe=k.useCallback(function(je){var Ze=st.current,se=Ze.onResize,_e=Ze.data,Te=je.getBoundingClientRect(),Ae=Te.width,ze=Te.height,Be=je.offsetWidth,Ue=je.offsetHeight,Ve=Math.floor(Ae),$e=Math.floor(ze);if(Me.current.width!==Ve||Me.current.height!==$e||Me.current.offsetWidth!==Be||Me.current.offsetHeight!==Ue){var Xe={width:Ve,height:$e,offsetWidth:Be,offsetHeight:Ue};Me.current=Xe;var et=Be===Math.round(Ae)?Ae:Be,Ie=Ue===Math.round(ze)?ze:Ue,nt=Object(G.a)(Object(G.a)({},Xe),{},{offsetWidth:et,offsetHeight:Ie});de==null||de(nt,je,_e),se&&Promise.resolve().then(function(){se(nt,je)})}},[]);return k.useEffect(function(){var je=Object(p.a)(Oe.current)||Object(p.a)(pe.current);return je&&!Ce&&s(je,Pe),function(){return a(je,Pe)}},[Oe.current,Ce]),k.createElement(A,{ref:pe},tt?k.cloneElement(xe,{ref:rt}):xe)}var O="rc-observer-key";function C(Ee){var xe=Ee.children,Ce=Object(n.a)(xe);return Ce.map(function(Oe,pe){var de=(Oe==null?void 0:Oe.key)||"".concat(O,"-").concat(pe);return k.createElement(L,Object(re.a)({},Ee,{key:de}),Oe)})}C.Collection=S;var T=C,x=Z("bT9E"),f=Z("TSYQ"),w=Z.n(f),v=`
|
|
min-height:0 !important;
|
|
max-height:none !important;
|
|
height:0 !important;
|
|
visibility:hidden !important;
|
|
overflow:hidden !important;
|
|
position:absolute !important;
|
|
z-index:-1000 !important;
|
|
top:0 !important;
|
|
right:0 !important
|
|
`,b=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],F={},B;function R(Ee){var xe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ce=Ee.getAttribute("id")||Ee.getAttribute("data-reactid")||Ee.getAttribute("name");if(xe&&F[Ce])return F[Ce];var Oe=window.getComputedStyle(Ee),pe=Oe.getPropertyValue("box-sizing")||Oe.getPropertyValue("-moz-box-sizing")||Oe.getPropertyValue("-webkit-box-sizing"),de=parseFloat(Oe.getPropertyValue("padding-bottom"))+parseFloat(Oe.getPropertyValue("padding-top")),Me=parseFloat(Oe.getPropertyValue("border-bottom-width"))+parseFloat(Oe.getPropertyValue("border-top-width")),tt=b.map(function(rt){return"".concat(rt,":").concat(Oe.getPropertyValue(rt))}).join(";"),We={sizingStyle:tt,paddingSize:de,borderSize:Me,boxSizing:pe};return xe&&Ce&&(F[Ce]=We),We}function j(Ee){var xe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ce=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Oe=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;B||(B=document.createElement("textarea"),B.setAttribute("tab-index","-1"),B.setAttribute("aria-hidden","true"),document.body.appendChild(B)),Ee.getAttribute("wrap")?B.setAttribute("wrap",Ee.getAttribute("wrap")):B.removeAttribute("wrap");var pe=R(Ee,xe),de=pe.paddingSize,Me=pe.borderSize,tt=pe.boxSizing,We=pe.sizingStyle;B.setAttribute("style","".concat(We,";").concat(v)),B.value=Ee.value||Ee.placeholder||"";var rt=Number.MIN_SAFE_INTEGER,st=Number.MAX_SAFE_INTEGER,Pe=B.scrollHeight,je;if(tt==="border-box"?Pe+=Me:tt==="content-box"&&(Pe-=de),Ce!==null||Oe!==null){B.value=" ";var Ze=B.scrollHeight-de;Ce!==null&&(rt=Ze*Ce,tt==="border-box"&&(rt=rt+de+Me),Pe=Math.max(rt,Pe)),Oe!==null&&(st=Ze*Oe,tt==="border-box"&&(st=st+de+Me),je=Pe>st?"":"hidden",Pe=Math.min(st,Pe))}return{height:Pe,minHeight:rt,maxHeight:st,overflowY:je,resize:"none"}}var N=Z("Gytx"),y=Z.n(N),Y;(function(Ee){Ee[Ee.NONE=0]="NONE",Ee[Ee.RESIZING=1]="RESIZING",Ee[Ee.RESIZED=2]="RESIZED"})(Y||(Y={}));var ee=function(Ee){Object(X.a)(Ce,Ee);var xe=Object(U.a)(Ce);function Ce(Oe){var pe;return Object($.a)(this,Ce),pe=xe.call(this,Oe),pe.nextFrameActionId=void 0,pe.resizeFrameId=void 0,pe.textArea=void 0,pe.saveTextArea=function(de){pe.textArea=de},pe.handleResize=function(de){var Me=pe.state.resizeStatus,tt=pe.props,We=tt.autoSize,rt=tt.onResize;if(Me!==Y.NONE)return;typeof rt=="function"&&rt(de),We&&pe.resizeOnNextFrame()},pe.resizeOnNextFrame=function(){cancelAnimationFrame(pe.nextFrameActionId),pe.nextFrameActionId=requestAnimationFrame(pe.resizeTextarea)},pe.resizeTextarea=function(){var de=pe.props.autoSize;if(!de||!pe.textArea)return;var Me=de.minRows,tt=de.maxRows,We=j(pe.textArea,!1,Me,tt);pe.setState({textareaStyles:We,resizeStatus:Y.RESIZING},function(){cancelAnimationFrame(pe.resizeFrameId),pe.resizeFrameId=requestAnimationFrame(function(){pe.setState({resizeStatus:Y.RESIZED},function(){pe.resizeFrameId=requestAnimationFrame(function(){pe.setState({resizeStatus:Y.NONE}),pe.fixFirefoxAutoScroll()})})})})},pe.renderTextArea=function(){var de=pe.props,Me=de.prefixCls,tt=Me===void 0?"rc-textarea":Me,We=de.autoSize,rt=de.onResize,st=de.className,Pe=de.disabled,je=pe.state,Ze=je.textareaStyles,se=je.resizeStatus,_e=Object(x.a)(pe.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Te=w()(tt,st,Object(H.a)({},"".concat(tt,"-disabled"),Pe));"value"in _e&&(_e.value=_e.value||"");var Ae=Object(G.a)(Object(G.a)(Object(G.a)({},pe.props.style),Ze),se===Y.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return k.createElement(T,{onResize:pe.handleResize,disabled:!(We||rt)},k.createElement("textarea",Object(re.a)({},_e,{className:Te,style:Ae,ref:pe.saveTextArea})))},pe.state={textareaStyles:{},resizeStatus:Y.NONE},pe}return Object(P.a)(Ce,[{key:"componentDidUpdate",value:function(pe){(pe.value!==this.props.value||!y()(pe.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 pe=this.textArea.selectionStart,de=this.textArea.selectionEnd;this.textArea.setSelectionRange(pe,de)}}catch(Me){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Ce}(k.Component),ae=ee,ue=function(Ee){Object(X.a)(Ce,Ee);var xe=Object(U.a)(Ce);function Ce(Oe){var pe;Object($.a)(this,Ce),pe=xe.call(this,Oe),pe.resizableTextArea=void 0,pe.focus=function(){pe.resizableTextArea.textArea.focus()},pe.saveTextArea=function(Me){pe.resizableTextArea=Me},pe.handleChange=function(Me){var tt=pe.props.onChange;pe.setValue(Me.target.value,function(){pe.resizableTextArea.resizeTextarea()}),tt&&tt(Me)},pe.handleKeyDown=function(Me){var tt=pe.props,We=tt.onPressEnter,rt=tt.onKeyDown;Me.keyCode===13&&We&&We(Me),rt&&rt(Me)};var de=typeof Oe.value=="undefined"||Oe.value===null?Oe.defaultValue:Oe.value;return pe.state={value:de},pe}return Object(P.a)(Ce,[{key:"setValue",value:function(pe,de){"value"in this.props||this.setState({value:pe},de)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return k.createElement(ae,Object(re.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(pe){return"value"in pe?{value:pe.value}:null}}]),Ce}(k.Component),Re=be.default=ue},ZW9T:function(ht,be,Z){"use strict";Z.d(be,"a",function(){return N});var re=Z("k1fw"),$=Z("oBTY"),P=Z("miYZ"),X=Z("tsqr"),U=Z("rAM+"),k=Z("tJVT"),G=Z("PpiC"),H=Z("q1tI"),n=Z.n(H),D=Z("bdgK"),g=Z("9og8"),p=Z("WmNS"),m=Z.n(p),h={keywords:["print","auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while"]},o={quickKey:[{label:"main",content:["public static void main(String[] args) {"," $0","}"].join(`
|
|
`)},{label:"System.out.println",content:["System.out.println($0)"].join(`
|
|
`)},{label:"System.out.print",content:["System.out.print($0)"].join(`
|
|
`)}],keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"]},c={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","friend","gcnew","generic","goto","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],quickKey:[{label:"ifelse",content:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
|
|
`)},{label:"include",content:"include<$0>"},{label:"printf",content:"printf($0)"},{label:"system",content:'system("$0")'},{label:"main",content:["int main () {"," $0","}"].join(`
|
|
`)},{label:"if",content:["if () {"," $0","}"].join(`
|
|
`)},{label:"for",content:["for(int j=0 ; j<10; j++){"," $0","}"].join(`
|
|
`)},{label:"trycatch",content:["try{"," $0","}catch(ExceptionName e){","}"].join(`
|
|
`)},{label:"using namespace std;",content:["using namespace std;"].join(`
|
|
`)},{label:"include <iostream>",content:["#include <iostream>"].join(`
|
|
`)},{label:"include <vector>",content:["#include <vector>"].join(`
|
|
`)},{label:"include <cstdio>",content:["#include <cstdio>"].join(`
|
|
`)},{label:"include <cstring>",content:["#include <cstring>"].join(`
|
|
`)},{label:"include <sstream>",content:["#include <sstream>"].join(`
|
|
`)},{label:"include <fstream>",content:["#include <fstream>"].join(`
|
|
`)},{label:"include <map>",content:["#include <map>"].join(`
|
|
`)},{label:"include <string>",content:["#include <string>"].join(`
|
|
`)},{label:"include <cmath>",content:["#include <cmath>"].join(`
|
|
`)}]},l={keywords:["and","as","assert","break","class","continue","def","del","elif","else","except","exec","finally","for","from","global","if","import","in","is","lambda","None","not","or","pass","raise","return","self","try","while","with","yield","int","float","long","complex","hex","abs","all","any","apply","basestring","bin","bool","buffer","bytearray","callable","chr","classmethod","cmp","coerce","compile","complex","delattr","dict","dir","divmod","enumerate","eval","execfile","file","filter","format","frozenset","getattr","globals","hasattr","hash","help","id","input","intern","isinstance","issubclass","iter","len","locals","list","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","reversed","range","raw_input","reduce","reload","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","unichr","unicode","vars","xrange","zip","True","False","__dict__","__methods__","__members__","__class__","__bases__","__name__","__mro__","__subclasses__","__init__","__import__"],quickKey:[{label:"print",content:["print($0)"].join(`
|
|
`)}]},u=Z("5VLF"),s=Z.n(u),a={languages:["c","abap","apex","azcli","bat","cameligo","clojure","coffee","cpp","csharp","csp","css","dockerfile","fsharp","go","graphql","handlebars","html","ini","java","javascript","json","kotlin","less","lua","markdown","mips","msdax","mysql","objective-c","pascal","pascaligo","perl","pgsql","php","postiats","powerquery","powershell","pug","python","r","razor","redis","redshift","restructuredtext","ruby","rust","sb","scheme","scss","shell","solidity","sophia","sql","st","swift","tcl","twig","vb","xml","yaml'"],tables:{users:["name","id","email","phone","password"],roles:["id","name","order","created_at","updated_at","deleted_at"]}},A=function(Y,ee){return ee.map(function(ae){return{label:ae,kind:Y.languages.CompletionItemKind.Keyword,insertText:ae}})},E=function(Y){return Object.keys(a.tables).map(function(ee){return{label:ee,kind:Y.languages.CompletionItemKind.Variable,insertText:ee}})},S=function(Y,ee){var ae=a.tables[Y];return ae?ae.map(function(ue){return{label:ue,kind:ee.languages.CompletionItemKind.Field,insertText:ue}}):[]};function L(y,Y,ee,ae,ue){var Re=Y.getWordUntilPosition(ee),Ee={startLineNumber:ee.lineNumber,endLineNumber:ee.lineNumber,startColumn:Re.startColumn,endColumn:Re.endColumn},xe=ae.map(function(Ce){return{label:Ce,kind:y.languages.CompletionItemKind.Keyword,insertText:Ce,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ee}});return ue.map(function(Ce){xe.push(Object(re.a)(Object(re.a)({},Ce),{},{range:Ee}))}),xe}var O=function(y){a.languages.map(function(ue){return y.languages.registerDocumentFormattingEditProvider(ue,{provideDocumentFormattingEdits:function(Ee,xe,Ce){return Object(g.a)(m.a.mark(function Oe(){var pe;return m.a.wrap(function(Me){for(;;)switch(Me.prev=Me.next){case 0:return pe=s()(Ee.getValue(),{indent_size:"2",indent_char:" ",max_preserve_newlines:"2",preserve_newlines:!0,keep_array_indentation:!0,break_chained_methods:!1,indent_scripts:"normal",brace_style:"collapse",space_before_conditional:!0,unescape_strings:!1,jslint_happy:!1,end_with_newline:!0,wrap_line_length:"0",indent_inner_html:!1,comma_first:!1,e4x:!1,indent_empty_lines:!1}),Me.abrupt("return",[{range:Ee.getFullModelRange(),text:pe}]);case 2:case"end":return Me.stop()}},Oe)}))()}}),ue});var Y=c.quickKey.map(function(ue){return{label:ue.label,kind:y.languages.CompletionItemKind.Method,insertText:ue.content,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),ee=l.quickKey.map(function(ue){return{label:ue.label,kind:y.languages.CompletionItemKind.Method,insertText:ue.content,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),ae=o.quickKey.map(function(ue){return{label:ue.label,kind:y.languages.CompletionItemKind.Method,insertText:ue.content,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet}});y.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(Re,Ee){var xe=Re.getWordUntilPosition(Ee),Ce={startLineNumber:Ee.lineNumber,endLineNumber:Ee.lineNumber,startColumn:xe.startColumn,endColumn:xe.endColumn},Oe=Re.getLineContent(Ee.lineNumber).substring(xe.startColumn-2,xe.endColumn);return{suggestions:[].concat(Object($.a)(c.keywords.map(function(pe){return{label:pe,kind:y.languages.CompletionItemKind.Function,documentation:pe,insertText:pe,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ce}})),Object($.a)(c.quickKey.map(function(pe){return{label:pe.label,kind:y.languages.CompletionItemKind.Function,documentation:pe.content,insertText:Oe.startsWith("#")?pe.content.replace(/#/,""):pe.content,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ce}})))}}}),y.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(Re,Ee){var xe=Re.getWordUntilPosition(Ee),Ce={startLineNumber:Ee.lineNumber,endLineNumber:Ee.lineNumber,startColumn:xe.startColumn,endColumn:xe.endColumn};return{suggestions:Object($.a)(h.keywords.map(function(Oe){return{label:Oe,kind:y.languages.CompletionItemKind.Function,documentation:Oe,insertText:Oe,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ce}}))}}}),y.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(Re,Ee){var xe=Re.getWordUntilPosition(Ee),Ce={startLineNumber:Ee.lineNumber,endLineNumber:Ee.lineNumber,startColumn:xe.startColumn,endColumn:xe.endColumn},Oe=Re.getLineContent(Ee.lineNumber).substring(xe.startColumn-2,xe.endColumn);return{suggestions:[].concat(Object($.a)(o.keywords.map(function(pe){return{label:pe,kind:y.languages.CompletionItemKind.Function,documentation:pe,insertText:pe,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ce}})),Object($.a)(o.quickKey.map(function(pe){return{label:pe.label,kind:y.languages.CompletionItemKind.Function,documentation:pe.content,insertText:Oe.startsWith("#")?pe.content.replace(/#/,""):pe.content,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ce}})))}}}),y.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(Re,Ee){var xe=Re.getWordUntilPosition(Ee),Ce={startLineNumber:Ee.lineNumber,endLineNumber:Ee.lineNumber,startColumn:xe.startColumn,endColumn:xe.endColumn},Oe=Re.getLineContent(Ee.lineNumber).substring(xe.startColumn-2,xe.endColumn);return{suggestions:[].concat(Object($.a)(l.keywords.map(function(pe){return{label:pe,kind:y.languages.CompletionItemKind.Function,documentation:pe,insertText:pe,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ce}})),Object($.a)(l.quickKey.map(function(pe){return{label:pe.label,kind:y.languages.CompletionItemKind.Function,documentation:pe.content,insertText:Oe.startsWith("#")?pe.content.replace(/#/,""):pe.content,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ce}})))}}})},C="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",T=Z("fjLI"),x=Z("LvDl"),f=Z("+ua5");function w(y){return/^\d+$/.test(y)?"".concat(y,"px"):y}function v(){}var b=!1,F={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python"};function B(){var y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Y=y;if(Array.isArray(y)){for(var ee=0;ee<y.length;ee++){var ae=F[y[ee]];if(ae)return ae}return Y[0]}return F[Y]||Y}var R=null,j=be.b=function(y){var Y=y.width,ee=Y===void 0?"100%":Y,ae=y.height,ue=ae===void 0?"100%":ae,Re=y.value,Ee=y.language,xe=Ee===void 0?"javascript":Ee,Ce=y.style,Oe=Ce===void 0?{}:Ce,pe=y.options,de=pe===void 0?{}:pe,Me=y.overrideServices,tt=Me===void 0?{}:Me,We=y.theme,rt=We===void 0?"vs-dark":We,st=y.onEditBlur,Pe=y.onSave,je=y.autoHeight,Ze=je===void 0?!1:je,se=y.forbidCopy,_e=se===void 0?!1:se,Te=y.onChange,Ae=Te===void 0?v:Te,ze=y.editorDidMount,Be=ze===void 0?v:ze,Ue=y.onFocus,Ve=Ue===void 0?v:Ue,$e=y.filename,Xe=$e===void 0?"educoder.txt":$e,et=y.errorLine,Ie=y.errorContent,nt=Ie===void 0?"":Ie,at=Object(G.a)(y,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),De=Object(H.useRef)(),ke=Object(H.useRef)({}),ve=Object(H.useRef)(),ce=Object(H.useRef)(),fe=Object(H.useRef)(!1),ie=Object(H.useRef)(),ne=Object(H.useState)(!1),oe=Object(k.a)(ne,2),le=oe[0],ye=oe[1];function Le(){var _t;return De.current&&(_t=new D.default(function(Tt){var Wt=Object(U.a)(Tt),nn;try{for(Wt.s();!(nn=Wt.n()).done;){var hn=nn.value;(hn.target.offsetHeight>0||hn.target.offsetWidth>0)&&ke.current.instance.layout()}}catch(dt){Wt.e(dt)}finally{Wt.f()}}),_t.observe(De.current)),_t}function Ne(){X.b.warn(decodeURIComponent(C))}var Je=function(){var Tt=ke.current.instance;if(Re!=null&&Tt&&le){var Wt=Tt.getModel();Wt&&Re!==Wt.getValue()&&(b=!0,Wt.setValue(Re),Tt.layout(),b=!1)}};Object(H.useEffect)(function(){ce.current&&clearTimeout(ce.current),ce.current=setTimeout(function(){Je()},500)},[Re,le,ke.current]),Object(H.useEffect)(function(){if(et&&ke.current&&ke.current.instance){var _t=ke.current.instance;_t.changeViewZones(function(Wt){var nn=document.createElement("div");nn.style.padding="10px 20px",nn.style.width="calc(100% - 20px)",nn.className="my-error-line-wrp",nn.innerHTML=nt,Wt.addZone({afterLineNumber:et||11,heightInLines:3,domNode:nn})});var Tt={domNode:null,getId:function(){return"my.overlay.widget"},getDomNode:function(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.innerHTML="",this.domNode.style.width="100%",this.domNode.style.padding="20px 100px",this.domNode.style.right="0px",this.domNode.style.top="50px",this.domNode.style.position="relative",this.domNode.style.color="#333"),this.domNode},getPosition:function(){return null}};_t.addOverlayWidget(Tt),_t.revealPositionInCenter({lineNumber:20,column:1})}},[et,ke.current,le]);function mt(){var _t=ke.current.instance;if(_t){var Tt=_t.getSelection(),Wt=ke.current.pastePos||{},nn=new R.Range(Wt.startLineNumber||Tt.endLineNumber,Wt.startColumn||Tt.endColumn,Wt.endLineNumber||Tt.endLineNumber,Wt.endColumn||Tt.endColumn);setTimeout(function(){_t.executeEdits("",[{range:nn,text:""}])},300)}}function ft(_t){(window.navigator.platform.match("Mac")?_t.metaKey:_t.ctrlKey)&&_t.keyCode==83&&(_t.preventDefault(),Pe())}var Ct=function(){if(Ze&&ke.current.instance){var Tt=ke.current.instance.getContentHeight();bt(Tt<ue?ue:Tt)}else bt(ue)};function xt(_t){var Tt=document.createEvent("MouseEvents");Tt.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),_t.dispatchEvent(Tt)}function Qe(_t,Tt){var Wt=window.URL||window.webkitURL||window,nn=new Blob([Tt]),hn=document.createElementNS("http://www.w3.org/1999/xhtml","a");hn.href=Wt.createObjectURL(nn),hn.download=_t,xt(hn)}Object(H.useEffect)(function(){Ct()},[Ct]),Object(H.useEffect)(function(){De.current&&!le&&Promise.all([Z.e(15),Z.e(27)]).then(Z.t.bind(null,"M/lh",7)).then(function(_t){try{R=_t,ke.current.instance=R.editor.create(De.current,{value:Re,language:B(xe),theme:rt,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},tt);var Tt=ke.current.instance,Wt=T.d._menuItems,nn=Object($.a)(Wt).find(function(Ot){return Ot[0]._debugName=="EditorContext"}),hn=nn[1],dt=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],ut=function(Mt,Dt){var Ut=Mt._first;do{var dn,$n,Ye=Dt.includes((dn=Ut.element)===null||dn===void 0||(($n=dn.command)===null||$n===void 0)?void 0:$n.id);Ye&&Mt._remove(Ut)}while(Ut=Ut.next)};if(Be(Tt,R),setTimeout(function(){Ct(),ke.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){Qe(Xe||"educoder.txt",Tt.getValue())}}),Tt.getDomNode().addEventListener("input",function(){ve.current.autoFormat&&Tt.getAction("editor.action.formatDocument").run()})},500),ke.current.subscription=Tt.onDidChangeModelContent(function(Ot){fe.current?clearTimeout(ie.current):(Ct(),Ae(Tt.getValue(),Ot)),ie.current=setTimeout(function(){fe.current=!1},500)}),window.Monaco||O(R,B(xe)),_e&&(ut(hn,dt),De.current.classList.add("noCopyPaste"),Tt.onKeyDown(function(Ot){var Mt=Ot.keyCode,Dt=Ot.ctrlKey,Ut=Ot.metaKey;(Mt===33||Mt===52)&&(Ut||Dt)&&(Ne(),Ot.preventDefault())})),window.Monaco=R,st&&Tt.onDidBlurEditorWidget(function(){st(Tt.getValue())}),Ve&&Tt.onDidFocusEditorText(function(){Ve(Tt.getValue())}),_e){Tt.addCommand(R.KeyMod.CtrlCmd|R.KeyCode.KEY_V,function(){return Ne(),null}),Tt.onDidPaste(function(Ot){ke.current.pastePos=Ot});try{window.addEventListener("paste",mt)}catch(Ot){}}var qt=Le();return ye(!0),function(){var Ot=ke.current.instance;Ot.dispose();var Mt=Ot.getModel();Mt&&Mt.dispose(),ke.current.subscription&&ke.current.subscription.dispose(),_e&&window.removeEventListener("paste",mt),qt.unobserve(De.current)}}catch(Ot){}})},[]),Object(H.useEffect)(function(){var _t=ke.current.instance;if(_t&&le)return document.addEventListener("keydown",ft,!1),function(){document.removeEventListener("keydown",ft)}},[Pe,le]),Object(H.useEffect)(function(){var _t=ke.current.instance;if(_t&&le){var Tt=B(xe);R.editor.setModelLanguage(_t.getModel(),Tt),console.log("language:",xe,_t.getModel(),Tt)}},[xe,le]),Object(H.useEffect)(function(){var _t=ke.current.instance;_t&&le&&R.editor.setTheme(rt)},[rt,le]),Object(H.useEffect)(function(){var _t=ke.current.instance;ve.current=de,_t&&le&&(_t.updateOptions(Object(re.a)({},de)),setTimeout(function(){_t.getModel().updateOptions(Object(re.a)({},de))},200))},[JSON.stringify(de),le]),Object(H.useEffect)(function(){var _t=ke.current.instance;_t&&le&&_t.layout()},[ee,ue,le]);var Lt=Object(H.useState)(w(ee)),vt=Object(k.a)(Lt,2),Ft=vt[0],Pt=vt[1],Rt=Object(H.useState)(w(ue)),mn=Object(k.a)(Rt,2),sn=mn[0],bt=mn[1],tn=Object(re.a)(Object(re.a)({},Oe),{},{width:Ft,height:sn});return n.a.createElement("div",{className:"my-monaco-editor",ref:De,style:tn})};function N(y){var Y=y.width,ee=Y===void 0?"100%":Y,ae=y.height,ue=ae===void 0?"100%":ae,Re=y.original,Ee=y.modified,xe=y.language,Ce=y.options,Oe=Ce===void 0?{}:Ce,pe=Object(H.useRef)(),de=Object(H.useState)(null),Me=Object(k.a)(de,2),tt=Me[0],We=Me[1];function rt(Ze){var se;return pe.current&&(se=new D.default(function(_e){var Te=Object(U.a)(_e),Ae;try{for(Te.s();!(Ae=Te.n()).done;){var ze=Ae.value;(ze.target.offsetHeight>0||ze.target.offsetWidth>0)&&Ze.layout()}}catch(Be){Te.e(Be)}finally{Te.f()}}),se.observe(pe.current)),se}Object(H.useEffect)(function(){pe.current&&Promise.all([Z.e(15),Z.e(27)]).then(Z.t.bind(null,"M/lh",7)).then(function(Ze){R=Ze;var se=R.editor.createDiffEditor(pe.current,Object(re.a)(Object(re.a)({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",ignoreTrimWhitespace:!1,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},Oe),{},{wordWrap:!0}));We(se);var _e=rt(se);return function(){se.dispose();var Te=se.getModel();Te&&Te.dispose(),_e.unobserve(pe.current)}})},[]),Object(H.useEffect)(function(){tt&&tt.setModel({original:R.editor.createModel(Re,xe),modified:R.editor.createModel(Ee,xe)})},[Re,Ee,xe,tt]);var st=w(ee),Pe=w(ue),je={width:st,height:Pe};return n.a.createElement("div",{className:"my-diff-editor",ref:pe,style:je})}},ZpRC:function(ht,be,Z){"use strict";function re(g){return typeof g=="object"&&g!=null&&g.nodeType===1}function $(g,p){return(!p||g!=="hidden")&&g!=="visible"&&g!=="clip"}function P(g,p){if(g.clientHeight<g.scrollHeight||g.clientWidth<g.scrollWidth){var m=getComputedStyle(g,null);return $(m.overflowY,p)||$(m.overflowX,p)||function(h){var o=function(c){if(!c.ownerDocument||!c.ownerDocument.defaultView)return null;try{return c.ownerDocument.defaultView.frameElement}catch(l){return null}}(h);return!!o&&(o.clientHeight<h.scrollHeight||o.clientWidth<h.scrollWidth)}(g)}return!1}function X(g,p,m,h,o,c,l,u){return c<g&&l>p||c>g&&l<p?0:c<=g&&u<=m||l>=p&&u>=m?c-g-h:l>p&&u<m||c<g&&u>m?l-p+o:0}var U=function(g,p){var m=window,h=p.scrollMode,o=p.block,c=p.inline,l=p.boundary,u=p.skipOverflowHiddenElements,s=typeof l=="function"?l:function(Ze){return Ze!==l};if(!re(g))throw new TypeError("Invalid target");for(var a=document.scrollingElement||document.documentElement,A=[],E=g;re(E)&&s(E);){if((E=E.parentElement)===a){A.push(E);break}E!=null&&E===document.body&&P(E)&&!P(document.documentElement)||E!=null&&P(E,u)&&A.push(E)}for(var S=m.visualViewport?m.visualViewport.width:innerWidth,L=m.visualViewport?m.visualViewport.height:innerHeight,O=window.scrollX||pageXOffset,C=window.scrollY||pageYOffset,T=g.getBoundingClientRect(),x=T.height,f=T.width,w=T.top,v=T.right,b=T.bottom,F=T.left,B=o==="start"||o==="nearest"?w:o==="end"?b:w+x/2,R=c==="center"?F+f/2:c==="end"?v:F,j=[],N=0;N<A.length;N++){var y=A[N],Y=y.getBoundingClientRect(),ee=Y.height,ae=Y.width,ue=Y.top,Re=Y.right,Ee=Y.bottom,xe=Y.left;if(h==="if-needed"&&w>=0&&F>=0&&b<=L&&v<=S&&w>=ue&&b<=Ee&&F>=xe&&v<=Re)return j;var Ce=getComputedStyle(y),Oe=parseInt(Ce.borderLeftWidth,10),pe=parseInt(Ce.borderTopWidth,10),de=parseInt(Ce.borderRightWidth,10),Me=parseInt(Ce.borderBottomWidth,10),tt=0,We=0,rt="offsetWidth"in y?y.offsetWidth-y.clientWidth-Oe-de:0,st="offsetHeight"in y?y.offsetHeight-y.clientHeight-pe-Me:0;if(a===y)tt=o==="start"?B:o==="end"?B-L:o==="nearest"?X(C,C+L,L,pe,Me,C+B,C+B+x,x):B-L/2,We=c==="start"?R:c==="center"?R-S/2:c==="end"?R-S:X(O,O+S,S,Oe,de,O+R,O+R+f,f),tt=Math.max(0,tt+C),We=Math.max(0,We+O);else{tt=o==="start"?B-ue-pe:o==="end"?B-Ee+Me+st:o==="nearest"?X(ue,Ee,ee,pe,Me+st,B,B+x,x):B-(ue+ee/2)+st/2,We=c==="start"?R-xe-Oe:c==="center"?R-(xe+ae/2)+rt/2:c==="end"?R-Re+de+rt:X(xe,Re,ae,Oe,de+rt,R,R+f,f);var Pe=y.scrollLeft,je=y.scrollTop;B+=je-(tt=Math.max(0,Math.min(je+tt,y.scrollHeight-ee+st))),R+=Pe-(We=Math.max(0,Math.min(Pe+We,y.scrollWidth-ae+rt)))}j.push({el:y,top:tt,left:We})}return j};function k(g){return g===Object(g)&&Object.keys(g).length!==0}function G(g,p){p===void 0&&(p="auto");var m="scrollBehavior"in document.body.style;g.forEach(function(h){var o=h.el,c=h.top,l=h.left;o.scroll&&m?o.scroll({top:c,left:l,behavior:p}):(o.scrollTop=c,o.scrollLeft=l)})}function H(g){return g===!1?{block:"end",inline:"nearest"}:k(g)?g:{block:"start",inline:"nearest"}}function n(g,p){var m=!g.ownerDocument.documentElement.contains(g);if(k(p)&&typeof p.behavior=="function")return p.behavior(m?[]:U(g,p));if(m)return;var h=H(p);return G(U(g,h),h.behavior)}var D=be.a=n},bT9E:function(ht,be,Z){"use strict";Z.d(be,"a",function(){return $});var re=Z("VTBJ");function $(P,X){var U=Object(re.a)({},P);return Array.isArray(X)&&X.forEach(function(k){delete U[k]}),U}},c5Ni:function(ht,be,Z){},dejd:function(ht,be,Z){},dmUQ:function(ht,be,Z){"use strict";var re=Z("Ff2n"),$=Z("rePB"),P=Z("1OyB"),X=Z("vuIU"),U=Z("Ji7U"),k=Z("md7G"),G=Z("foSv"),H=Z("q1tI"),n=Z.n(H),D=Z("TSYQ"),g=Z.n(D),p=Z("4IlW");function m(x,f){var w=Object.keys(x);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(x);f&&(v=v.filter(function(b){return Object.getOwnPropertyDescriptor(x,b).enumerable})),w.push.apply(w,v)}return w}function h(x){for(var f=1;f<arguments.length;f++){var w=arguments[f]!=null?arguments[f]:{};f%2?m(Object(w),!0).forEach(function(v){Object($.a)(x,v,w[v])}):Object.getOwnPropertyDescriptors?Object.defineProperties(x,Object.getOwnPropertyDescriptors(w)):m(Object(w)).forEach(function(v){Object.defineProperty(x,v,Object.getOwnPropertyDescriptor(w,v))})}return x}function o(x){var f=c();return function(){var v=Object(G.a)(x),b;if(f){var F=Object(G.a)(this).constructor;b=Reflect.construct(v,arguments,F)}else b=v.apply(this,arguments);return Object(k.a)(this,b)}}function c(){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(x){return!1}}function l(){}function u(x){x.preventDefault()}var s=function(f){return f.replace(/[^\w.-]+/g,"")},a=200,A=600,E=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,S=function(f){return f!=null},L=function(f,w){return w===f||typeof w=="number"&&typeof f=="number"&&isNaN(w)&&isNaN(f)},O=function(x){Object(U.a)(w,x);var f=o(w);function w(v){var b;Object(P.a)(this,w),b=f.call(this,v),b.onKeyDown=function(R){var j=b.props,N=j.onKeyDown,y=j.onPressEnter;if(R.keyCode===p.a.UP){var Y=b.getRatio(R);b.up(R,Y,null),b.stop()}else if(R.keyCode===p.a.DOWN){var ee=b.getRatio(R);b.down(R,ee,null),b.stop()}else R.keyCode===p.a.ENTER&&y&&y(R);if(b.recordCursorPosition(),b.lastKeyCode=R.keyCode,N){for(var ae=arguments.length,ue=new Array(ae>1?ae-1:0),Re=1;Re<ae;Re++)ue[Re-1]=arguments[Re];N.apply(void 0,[R].concat(ue))}},b.onKeyUp=function(R){var j=b.props.onKeyUp;if(b.stop(),b.recordCursorPosition(),j){for(var N=arguments.length,y=new Array(N>1?N-1:0),Y=1;Y<N;Y++)y[Y-1]=arguments[Y];j.apply(void 0,[R].concat(y))}},b.onChange=function(R){var j=b.props.onChange;b.state.focused&&(b.inputting=!0),b.rawInput=b.props.parser(b.getValueFromEvent(R)),b.setState({inputValue:b.rawInput}),j(b.toNumber(b.rawInput))},b.onMouseUp=function(){var R=b.props.onMouseUp;b.recordCursorPosition(),R&&R.apply(void 0,arguments)},b.onFocus=function(){var R;b.setState({focused:!0}),(R=b.props).onFocus.apply(R,arguments)},b.onBlur=function(){var R=b.props.onBlur;b.inputting=!1,b.setState({focused:!1});var j=b.getCurrentValidValue(b.state.inputValue),N=b.setValue(j,l);if(R){var y=b.input.value,Y=b.getInputDisplayValue({focus:!1,value:N});b.input.value=Y&&Number(Y),R.apply(void 0,arguments),b.input.value=y}},b.getRatio=function(R){var j=1;return R.metaKey||R.ctrlKey?j=.1:R.shiftKey&&(j=10),j},b.getFullNum=function(R){return isNaN(R)?R:/e/i.test(String(R))?Number(R).toFixed(18).replace(/\.?0+$/,""):R},b.getPrecision=function(R){if(S(b.props.precision))return b.props.precision;var j=String(R);if(j.indexOf("e-")>=0)return parseInt(j.slice(j.indexOf("e-")+2),10);var N=0;return j.indexOf(".")>=0&&(N=j.length-j.indexOf(".")-1),N},b.getInputDisplayValue=function(R){var j=R||b.state,N=j.focused,y=j.inputValue,Y=j.value,ee;N?ee=y:ee=b.toPrecisionAsStep(Y),ee==null&&(ee="");var ae=b.formatWrapper(ee);return S(b.props.decimalSeparator)&&(ae=ae.toString().replace(".",b.props.decimalSeparator)),ae},b.recordCursorPosition=function(){try{b.cursorStart=b.input.selectionStart,b.cursorEnd=b.input.selectionEnd,b.currentValue=b.input.value,b.cursorBefore=b.input.value.substring(0,b.cursorStart),b.cursorAfter=b.input.value.substring(b.cursorEnd)}catch(R){}},b.restoreByAfter=function(R){if(R===void 0)return!1;var j=b.input.value,N=j.lastIndexOf(R);if(N===-1)return!1;var y=b.cursorBefore.length;return b.lastKeyCode===p.a.DELETE&&b.cursorBefore.charAt(y-1)===R[0]?(b.fixCaret(y,y),!0):N+R.length===j.length?(b.fixCaret(N,N),!0):!1},b.partRestoreByAfter=function(R){return R===void 0?!1:Array.prototype.some.call(R,function(j,N){var y=R.substring(N);return b.restoreByAfter(y)})},b.isNotCompleteNumber=function(R){return isNaN(R)||R===""||R===null||R&&R.toString().indexOf(".")===R.toString().length-1},b.stop=function(){b.autoStepTimer&&clearTimeout(b.autoStepTimer)},b.down=function(R,j,N){b.pressingUpOrDown=!0,b.step("down",R,j,N)},b.up=function(R,j,N){b.pressingUpOrDown=!0,b.step("up",R,j,N)},b.saveInput=function(R){b.input=R};var F=v.value;F===void 0&&(F=v.defaultValue),b.state={focused:v.autoFocus};var B=b.getValidValue(b.toNumber(F));return b.state=h(h({},b.state),{},{inputValue:b.toPrecisionAsStep(B),value:B}),b}return Object(X.a)(w,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(b){var F=this.props,B=F.value,R=F.onChange,j=F.max,N=F.min,y=this.state.focused;if(b){if(!L(b.value,B)||!L(b.max,j)||!L(b.min,N)){var Y=y?B:this.getValidValue(B),ee;this.pressingUpOrDown?ee=Y:this.inputting?ee=this.rawInput:ee=this.toPrecisionAsStep(Y),this.setState({value:Y,inputValue:ee})}var ae="value"in this.props?B:this.state.value;"max"in this.props&&b.max!==j&&typeof ae=="number"&&ae>j&&R&&R(j),"min"in this.props&&b.min!==N&&typeof ae=="number"&&ae<N&&R&&R(N)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var ue=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===p.a.BACKSPACE?ue=this.cursorStart-1:this.lastKeyCode===p.a.DELETE&&(ue=this.cursorStart):ue=this.input.value.length,this.fixCaret(ue,ue)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case p.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case p.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(Re){}if(this.lastKeyCode=null,!this.pressingUpOrDown)return;this.props.focusOnUpDown&&this.state.focused&&(document.activeElement!==this.input&&this.focus())}},{key:"componentWillUnmount",value:function(){this.stop()}},{key:"getCurrentValidValue",value:function(b){var F=b;return F===""?F="":this.isNotCompleteNumber(parseFloat(F))?F=this.state.value:F=this.getValidValue(F),this.toNumber(F)}},{key:"getValueFromEvent",value:function(b){var F=b.target.value.trim().replace(/。/g,".");return S(this.props.decimalSeparator)&&(F=F.replace(this.props.decimalSeparator,".")),F}},{key:"getValidValue",value:function(b){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,B=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,R=parseFloat(b);return isNaN(R)?b:(R<F&&(R=F),R>B&&(R=B),R)}},{key:"setValue",value:function(b,F){var B=this.props.precision,R=this.isNotCompleteNumber(parseFloat(b))?null:parseFloat(b),j=this.state.value,N=j===void 0?null:j,y=this.state.inputValue,Y=y===void 0?null:y,ee=typeof R=="number"?R.toFixed(B):"".concat(R),ae=R!==N||ee!=="".concat(Y);return"value"in this.props?(Y=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:Y},F)):this.setState({value:R,inputValue:this.toPrecisionAsStep(b)},F),ae&&this.props.onChange(R),R}},{key:"getMaxPrecision",value:function(b){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,B=this.props,R=B.precision,j=B.step;if(S(R))return R;var N=this.getPrecision(F),y=this.getPrecision(j),Y=this.getPrecision(b);return b?Math.max(Y,N+y):N+y}},{key:"getPrecisionFactor",value:function(b){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,B=this.getMaxPrecision(b,F);return Math.pow(10,B)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(b){return this.props.formatter?this.props.formatter(b):b}},{key:"toPrecisionAsStep",value:function(b){if(this.isNotCompleteNumber(b)||b==="")return b;var F=Math.abs(this.getMaxPrecision(b));return isNaN(F)?b.toString():Number(b).toFixed(F)}},{key:"toNumber",value:function(b){var F=this.props.precision,B=this.state.focused,R=b&&b.length>16&&B;return this.isNotCompleteNumber(b)||R?b:S(F)?Math.round(b*Math.pow(10,F))/Math.pow(10,F):Number(b)}},{key:"upStep",value:function(b,F){var B=this.props.step,R=this.getPrecisionFactor(b,F),j=Math.abs(this.getMaxPrecision(b,F)),N=((R*b+R*B*F)/R).toFixed(j);return this.toNumber(N)}},{key:"downStep",value:function(b,F){var B=this.props.step,R=this.getPrecisionFactor(b,F),j=Math.abs(this.getMaxPrecision(b,F)),N=((R*b-R*B*F)/R).toFixed(j);return this.toNumber(N)}},{key:"step",value:function(b,F){var B=this,R=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,j=arguments.length>3?arguments[3]:void 0;this.stop(),F&&(F.persist(),F.preventDefault());var N=this.props;if(N.disabled)return;var y=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(y))return;var Y=this["".concat(b,"Step")](y,R),ee=Y>N.max||Y<N.min;if(Y>N.max?Y=N.max:Y<N.min&&(Y=N.min),this.setValue(Y,null),this.setState({focused:!0},function(){B.pressingUpOrDown=!1}),ee)return;this.autoStepTimer=setTimeout(function(){B[b](F,R,!0)},j?a:A)}},{key:"fixCaret",value:function(b,F){if(b===void 0||F===void 0||!this.input||!this.input.value)return;try{var B=this.input.selectionStart,R=this.input.selectionEnd;(b!==B||F!==R)&&this.input.setSelectionRange(b,F)}catch(j){}}},{key:"render",value:function(){var b,F=this.props,B=F.prefixCls,R=F.disabled,j=F.readOnly,N=F.useTouch,y=F.autoComplete,Y=F.upHandler,ee=F.downHandler,ae=F.className,ue=F.max,Re=F.min,Ee=F.style,xe=F.title,Ce=F.onMouseEnter,Oe=F.onMouseLeave,pe=F.onMouseOver,de=F.onMouseOut,Me=F.required,tt=F.onClick,We=F.tabIndex,rt=F.type,st=F.placeholder,Pe=F.id,je=F.inputMode,Ze=F.pattern,se=F.step,_e=F.maxLength,Te=F.autoFocus,Ae=F.name,ze=F.onPaste,Be=F.onInput,Ue=Object(re.a)(F,["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"]),Ve=this.state,$e=Ve.value,Xe=Ve.focused,et=g()(B,(b={},Object($.a)(b,ae,!!ae),Object($.a)(b,"".concat(B,"-disabled"),R),Object($.a)(b,"".concat(B,"-focused"),Xe),b)),Ie={};Object.keys(Ue).forEach(function(le){(le.substr(0,5)==="data-"||le.substr(0,5)==="aria-"||le==="role")&&(Ie[le]=Ue[le])});var nt=!j&&!R,at=this.getInputDisplayValue(null),De=($e||$e===0)&&(isNaN($e)||Number($e)>=ue),ke=($e||$e===0)&&(isNaN($e)||Number($e)<=Re),ve=De||R||j,ce=ke||R||j,fe=g()("".concat(B,"-handler"),"".concat(B,"-handler-up"),Object($.a)({},"".concat(B,"-handler-up-disabled"),ve)),ie=g()("".concat(B,"-handler"),"".concat(B,"-handler-down"),Object($.a)({},"".concat(B,"-handler-down-disabled"),ce)),ne=N?{onTouchStart:ve?l:this.up,onTouchEnd:this.stop}:{onMouseDown:ve?l:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},oe=N?{onTouchStart:ce?l:this.down,onTouchEnd:this.stop}:{onMouseDown:ce?l:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return n.a.createElement("div",{className:et,style:Ee,title:xe,onMouseEnter:Ce,onMouseLeave:Oe,onMouseOver:pe,onMouseOut:de,onFocus:function(){return null},onBlur:function(){return null}},n.a.createElement("div",{className:"".concat(B,"-handler-wrap")},n.a.createElement("span",Object.assign({unselectable:"on"},ne,{role:"button","aria-label":"Increase Value","aria-disabled":ve,className:fe}),Y||n.a.createElement("span",{unselectable:"on",className:"".concat(B,"-handler-up-inner"),onClick:u})),n.a.createElement("span",Object.assign({unselectable:"on"},oe,{role:"button","aria-label":"Decrease Value","aria-disabled":ce,className:ie}),ee||n.a.createElement("span",{unselectable:"on",className:"".concat(B,"-handler-down-inner"),onClick:u}))),n.a.createElement("div",{className:"".concat(B,"-input-wrap")},n.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Re,"aria-valuemax":ue,"aria-valuenow":$e,required:Me,type:rt,placeholder:st,onPaste:ze,onClick:tt,onMouseUp:this.onMouseUp,className:"".concat(B,"-input"),tabIndex:We,autoComplete:y,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:nt?this.onKeyDown:l,onKeyUp:nt?this.onKeyUp:l,autoFocus:Te,maxLength:_e,readOnly:j,disabled:R,max:ue,min:Re,step:se,name:Ae,title:xe,id:Pe,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(at),pattern:Ze,inputMode:je,onInput:Be},Ie))))}}]),w}(n.a.Component);O.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:E,min:-E,step:1,style:{},onChange:l,onKeyDown:l,onPressEnter:l,onFocus:l,onBlur:l,parser:s,required:!1,autoComplete:"off"};var C=O,T=be.a=C},fjLI:function(ht,be,Z){"use strict";Z.d(be,"f",function(){return m}),Z.d(be,"b",function(){return h}),Z.d(be,"a",function(){return o}),Z.d(be,"d",function(){return c}),Z.d(be,"e",function(){return l}),Z.d(be,"c",function(){return u});var re=Z("8HAY"),$=Z("Vhoy"),P=Z("MI8n"),X=Z("JYp7"),U=Z("pmY6"),k=Z("24hK"),G=Z("nnTU"),H=Z("T8No"),n=Z("Cg/j"),D=Z("t9D7"),g=function(s,a,A,E){var S=arguments.length,L=S<3?a:E===null?E=Object.getOwnPropertyDescriptor(a,A):E,O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(s,a,A,E);else for(var C=s.length-1;C>=0;C--)(O=s[C])&&(L=(S<3?O(L):S>3?O(a,A,L):O(a,A))||L);return S>3&&L&&Object.defineProperty(a,A,L),L},p=function(s,a){return function(A,E){a(A,E,s)}};function m(s){return s.command!==void 0}class h{constructor(s){this.id=h._idPool++,this._debugName=s}}h._idPool=0,h.CommandPalette=new h("CommandPalette"),h.EditorContext=new h("EditorContext"),h.SimpleEditorContext=new h("SimpleEditorContext"),h.EditorContextCopy=new h("EditorContextCopy"),h.EditorContextPeek=new h("EditorContextPeek"),h.MenubarEditMenu=new h("MenubarEditMenu"),h.MenubarCopy=new h("MenubarCopy"),h.MenubarGoMenu=new h("MenubarGoMenu"),h.MenubarSelectionMenu=new h("MenubarSelectionMenu"),h.InlineCompletionsActions=new h("InlineCompletionsActions");const o=Object(n.c)("menuService"),c=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new P.b,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:s=>s===h.CommandPalette}}addCommand(s){return this.addCommands(X.a.single(s))}addCommands(s){for(const a of s)this._commands.set(a.id,a);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),Object(U.i)(()=>{let a=!1;for(const A of s)a=this._commands.delete(A.id)||a;a&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(s){return this._commands.get(s)}getCommands(){const s=new Map;return this._commands.forEach((a,A)=>s.set(A,a)),s}appendMenuItem(s,a){return this.appendMenuItems(X.a.single({id:s,item:a}))}appendMenuItems(s){const a=new Set,A=new k.a;for(const{id:E,item:S}of s){let L=this._menuItems.get(E);L||(L=new k.a,this._menuItems.set(E,L)),A.push(L.push(S)),a.add(E)}return this._onDidChangeMenu.fire(a),Object(U.i)(()=>{if(A.size>0){for(let E of A)E();this._onDidChangeMenu.fire(a),A.clear()}})}getMenuItems(s){let a;return this._menuItems.has(s)?a=[...this._menuItems.get(s)]:a=[],s===h.CommandPalette&&this._appendImplicitItems(a),a}_appendImplicitItems(s){const a=new Set;for(const A of s)m(A)&&(a.add(A.command.id),A.alt&&a.add(A.alt.id));this._commands.forEach((A,E)=>{a.has(E)||s.push({command:A})})}};class l extends re.e{constructor(s,a,A,E){super(`submenuitem.${s.submenu.id}`,typeof s.title=="string"?s.title:s.title.value,[],"submenu");this.item=s,this._menuService=a,this._contextKeyService=A,this._options=E}get actions(){const s=[],a=this._menuService.createMenu(this.item.submenu,this._contextKeyService),A=a.getActions(this._options);a.dispose();for(const[,E]of A)E.length>0&&(s.push(...E),s.push(new re.d));return s.length&&s.pop(),s}}let u=class s{constructor(a,A,E,S,L){var O,C;if(this._commandService=L,this.id=a.id,this.label=(E==null?void 0:E.renderShortTitle)&&a.shortTitle?typeof a.shortTitle=="string"?a.shortTitle:a.shortTitle.value:typeof a.title=="string"?a.title:a.title.value,this.tooltip=(C=typeof a.tooltip=="string"?a.tooltip:(O=a.tooltip)===null||O===void 0?void 0:O.value)!==null&&C!==void 0?C:"",this.enabled=!a.precondition||S.contextMatchesRules(a.precondition),this.checked=void 0,a.toggled){const T=a.toggled.condition?a.toggled:{condition:a.toggled};this.checked=S.contextMatchesRules(T.condition),this.checked&&T.tooltip&&(this.tooltip=typeof T.tooltip=="string"?T.tooltip:T.tooltip.value),T.title&&(this.label=typeof T.title=="string"?T.title:T.title.value)}this.item=a,this.alt=A?new s(A,void 0,E,S,L):void 0,this._options=E,D.d.isThemeIcon(a.icon)&&(this.class=$.a.asClassName(a.icon))}dispose(){}run(...a){var A,E;let S=[];return((A=this._options)===null||A===void 0?void 0:A.arg)&&(S=[...S,this._options.arg]),((E=this._options)===null||E===void 0?void 0:E.shouldForwardArgs)&&(S=[...S,...a]),this._commandService.executeCommand(this.id,...S)}};u=g([p(3,H.b),p(4,G.b)],u)},ic2d:function(ht,be,Z){"use strict";Z.d(be,"a",function(){return X});var re=Z("FWmy"),$=Z("746U");class P{constructor(){this.data=new Map}add(U,k){re.a($.l(U)),re.a($.k(k)),re.a(!this.data.has(U),"There is already an extension with this id"),this.data.set(U,k)}as(U){return this.data.get(U)||null}}const X=new P},kSUc:function(ht,be,Z){},"kaH+":function(ht,be,Z){"use strict";var re=Z("+L6B"),$=Z("2/Rp"),P=Z("tJVT"),X=Z("q1tI"),U=Z.n(X),k=Z("UZu5"),G=Z.n(k),H=Z("dhSg"),n=Z("rLCj"),D=Z("dF/Y"),g=Z("4i/N");be.a=function(){var p=Object(X.useState)(""),m=Object(P.a)(p,2),h=m[0],o=m[1],c=Object(X.useState)(0),l=Object(P.a)(c,2),u=l[0],s=l[1],a=Object(X.useRef)("");Object(X.useEffect)(function(){var T=H.a.subscribe("preview-image",function(x){o(x),document.body.style.overflow="hidden"});return T},[]),Object(X.useEffect)(function(){return document.addEventListener("keydown",A),function(){document.removeEventListener("keydown",A)}},[]),Object(X.useEffect)(function(){a.current=h},[h]);function A(T){T.keyCode==27&&a.current&&E()}function E(){document.body.style.overflow="auto",o("")}function S(){s(u+90)}var L=Object(X.useRef)(),O=Object(X.useRef)(),C=function(x){(x.nativeEvent.target===L.current||x.nativeEvent.target===O.current)&&E()};return U.a.createElement(X.Fragment,null,h?U.a.createElement("div",{className:"image-preview-container",ref:L,onClick:C},U.a.createElement("div",{className:"button-group"},U.a.createElement($.a,{onClick:S},"\u65CB\u8F6C",U.a.createElement(n.a,null)),U.a.createElement($.a,{href:h},"\u4E0B\u8F7D",U.a.createElement(D.a,null)),U.a.createElement($.a,{onClick:E},"\u5173\u95ED",U.a.createElement(g.a,null))),U.a.createElement("div",{className:"preview-wrp-group",ref:O},U.a.createElement("img",{className:"image-preview",src:h,alt:"\u9884\u89C8\u5927\u56FE",style:{transform:"rotate(".concat(u,"deg)")}}))):null)}},lZu9:function(ht,be,Z){(function(re){re(Z("VrN/"),Z("1eCo"),Z("8EBN"))})(function(re){"use strict";re.defineMode("markdown",function($,P){var X=re.getMode($,"text/html"),U=X.name=="null";function k(N){if(re.findModeByName){var y=re.findModeByName(N);y&&(N=y.mime||y.mimes[0])}var Y=re.getMode($,N);return Y.name=="null"?null:Y}P.highlightFormatting===void 0&&(P.highlightFormatting=!1),P.maxBlockquoteDepth===void 0&&(P.maxBlockquoteDepth=0),P.taskLists===void 0&&(P.taskLists=!1),P.strikethrough===void 0&&(P.strikethrough=!1),P.emoji===void 0&&(P.emoji=!1),P.fencedCodeBlockHighlighting===void 0&&(P.fencedCodeBlockHighlighting=!0),P.fencedCodeBlockDefaultMode===void 0&&(P.fencedCodeBlockDefaultMode="text/plain"),P.xml===void 0&&(P.xml=!0),P.tokenTypeOverrides===void 0&&(P.tokenTypeOverrides={});var G={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var H in G)G.hasOwnProperty(H)&&P.tokenTypeOverrides[H]&&(G[H]=P.tokenTypeOverrides[H]);var n=/^([*\-_])(?:\s*\1){2,}\s*$/,D=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,g=/^\[(x| )\](?=\s)/i,p=P.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,m=/^ {0,3}(?:\={1,}|-{2,})\s*$/,h=/^[^#!\[\]*_\\<>` "'(~:]+/,o=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,c=/^\s*\[[^\]]+?\]:.*$/,l=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,u=" ";function s(N,y,Y){return y.f=y.inline=Y,Y(N,y)}function a(N,y,Y){return y.f=y.block=Y,Y(N,y)}function A(N){return!N||!/\S/.test(N.string)}function E(N){if(N.linkTitle=!1,N.linkHref=!1,N.linkText=!1,N.em=!1,N.strong=!1,N.strikethrough=!1,N.quote=0,N.indentedCode=!1,N.f==L){var y=U;if(!y){var Y=re.innerMode(X,N.htmlState);y=Y.mode.name=="xml"&&Y.state.tagStart===null&&!Y.state.context&&Y.state.tokenize.isInText}y&&(N.f=x,N.block=S,N.htmlState=null)}return N.trailingSpace=0,N.trailingSpaceNewLine=!1,N.prevLine=N.thisLine,N.thisLine={stream:null},null}function S(N,y){var Y=N.column()===y.indentation,ee=A(y.prevLine.stream),ae=y.indentedCode,ue=y.prevLine.hr,Re=y.list!==!1,Ee=(y.listStack[y.listStack.length-1]||0)+3;y.indentedCode=!1;var xe=y.indentation;if(y.indentationDiff===null&&(y.indentationDiff=y.indentation,Re)){for(y.list=null;xe<y.listStack[y.listStack.length-1];)y.listStack.pop(),y.listStack.length?y.indentation=y.listStack[y.listStack.length-1]:y.list=!1;y.list!==!1&&(y.indentationDiff=xe-y.listStack[y.listStack.length-1])}var Ce=!ee&&!ue&&!y.prevLine.header&&(!Re||!ae)&&!y.prevLine.fencedCodeEnd,Oe=(y.list===!1||ue||ee)&&y.indentation<=Ee&&N.match(n),pe=null;if(y.indentationDiff>=4&&(ae||y.prevLine.fencedCodeEnd||y.prevLine.header||ee))return N.skipToEnd(),y.indentedCode=!0,G.code;if(N.eatSpace())return null;if(Y&&y.indentation<=Ee&&(pe=N.match(p))&&pe[1].length<=6)return y.quote=0,y.header=pe[1].length,y.thisLine.header=!0,P.highlightFormatting&&(y.formatting="header"),y.f=y.inline,C(y);if(y.indentation<=Ee&&N.eat(">"))return y.quote=Y?1:y.quote+1,P.highlightFormatting&&(y.formatting="quote"),N.eatSpace(),C(y);if(!Oe&&!y.setext&&Y&&y.indentation<=Ee&&(pe=N.match(D))){var de=pe[1]?"ol":"ul";return y.indentation=xe+N.current().length,y.list=!0,y.quote=0,y.listStack.push(y.indentation),y.em=!1,y.strong=!1,y.code=!1,y.strikethrough=!1,P.taskLists&&N.match(g,!1)&&(y.taskList=!0),y.f=y.inline,P.highlightFormatting&&(y.formatting=["list","list-"+de]),C(y)}else{if(Y&&y.indentation<=Ee&&(pe=N.match(o,!0)))return y.quote=0,y.fencedEndRE=new RegExp(pe[1]+"+ *$"),y.localMode=P.fencedCodeBlockHighlighting&&k(pe[2]||P.fencedCodeBlockDefaultMode),y.localMode&&(y.localState=re.startState(y.localMode)),y.f=y.block=O,P.highlightFormatting&&(y.formatting="code-block"),y.code=-1,C(y);if(y.setext||(!Ce||!Re)&&!y.quote&&y.list===!1&&!y.code&&!Oe&&!c.test(N.string)&&(pe=N.lookAhead(1))&&(pe=pe.match(m)))return y.setext?(y.header=y.setext,y.setext=0,N.skipToEnd(),P.highlightFormatting&&(y.formatting="header")):(y.header=pe[0].charAt(0)=="="?1:2,y.setext=y.header),y.thisLine.header=!0,y.f=y.inline,C(y);if(Oe)return N.skipToEnd(),y.hr=!0,y.thisLine.hr=!0,G.hr;if(N.peek()==="[")return s(N,y,F)}return s(N,y,y.inline)}function L(N,y){var Y=X.token(N,y.htmlState);if(!U){var ee=re.innerMode(X,y.htmlState);(ee.mode.name=="xml"&&ee.state.tagStart===null&&!ee.state.context&&ee.state.tokenize.isInText||y.md_inside&&N.current().indexOf(">")>-1)&&(y.f=x,y.block=S,y.htmlState=null)}return Y}function O(N,y){var Y=y.listStack[y.listStack.length-1]||0,ee=y.indentation<Y,ae=Y+3;if(y.fencedEndRE&&y.indentation<=ae&&(ee||N.match(y.fencedEndRE))){P.highlightFormatting&&(y.formatting="code-block");var ue;return ee||(ue=C(y)),y.localMode=y.localState=null,y.block=S,y.f=x,y.fencedEndRE=null,y.code=0,y.thisLine.fencedCodeEnd=!0,ee?a(N,y,y.block):ue}else return y.localMode?y.localMode.token(N,y.localState):(N.skipToEnd(),G.code)}function C(N){var y=[];if(N.formatting){y.push(G.formatting),typeof N.formatting=="string"&&(N.formatting=[N.formatting]);for(var Y=0;Y<N.formatting.length;Y++)y.push(G.formatting+"-"+N.formatting[Y]),N.formatting[Y]==="header"&&y.push(G.formatting+"-"+N.formatting[Y]+"-"+N.header),N.formatting[Y]==="quote"&&(!P.maxBlockquoteDepth||P.maxBlockquoteDepth>=N.quote?y.push(G.formatting+"-"+N.formatting[Y]+"-"+N.quote):y.push("error"))}if(N.taskOpen)return y.push("meta"),y.length?y.join(" "):null;if(N.taskClosed)return y.push("property"),y.length?y.join(" "):null;if(N.linkHref?y.push(G.linkHref,"url"):(N.strong&&y.push(G.strong),N.em&&y.push(G.em),N.strikethrough&&y.push(G.strikethrough),N.emoji&&y.push(G.emoji),N.linkText&&y.push(G.linkText),N.code&&y.push(G.code),N.image&&y.push(G.image),N.imageAltText&&y.push(G.imageAltText,"link"),N.imageMarker&&y.push(G.imageMarker)),N.header&&y.push(G.header,G.header+"-"+N.header),N.quote&&(y.push(G.quote),!P.maxBlockquoteDepth||P.maxBlockquoteDepth>=N.quote?y.push(G.quote+"-"+N.quote):y.push(G.quote+"-"+P.maxBlockquoteDepth)),N.list!==!1){var ee=(N.listStack.length-1)%3;ee?ee===1?y.push(G.list2):y.push(G.list3):y.push(G.list1)}return N.trailingSpaceNewLine?y.push("trailing-space-new-line"):N.trailingSpace&&y.push("trailing-space-"+(N.trailingSpace%2?"a":"b")),y.length?y.join(" "):null}function T(N,y){return N.match(h,!0)?C(y):void 0}function x(N,y){var Y=y.text(N,y);if(typeof Y!="undefined")return Y;if(y.list)return y.list=null,C(y);if(y.taskList){var ee=N.match(g,!0)[1]===" ";return ee?y.taskOpen=!0:y.taskClosed=!0,P.highlightFormatting&&(y.formatting="task"),y.taskList=!1,C(y)}if(y.taskOpen=!1,y.taskClosed=!1,y.header&&N.match(/^#+$/,!0))return P.highlightFormatting&&(y.formatting="header"),C(y);var ae=N.next();if(y.linkTitle){y.linkTitle=!1;var ue=ae;ae==="("&&(ue=")"),ue=(ue+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Re="^\\s*(?:[^"+ue+"\\\\]+|\\\\\\\\|\\\\.)"+ue;if(N.match(new RegExp(Re),!0))return G.linkHref}if(ae==="`"){var Ee=y.formatting;P.highlightFormatting&&(y.formatting="code"),N.eatWhile("`");var xe=N.current().length;if(y.code==0&&(!y.quote||xe==1))return y.code=xe,C(y);if(xe==y.code){var Ce=C(y);return y.code=0,Ce}else return y.formatting=Ee,C(y)}else if(y.code)return C(y);if(ae==="\\"&&(N.next(),P.highlightFormatting)){var Oe=C(y),pe=G.formatting+"-escape";return Oe?Oe+" "+pe:pe}if(ae==="!"&&N.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return y.imageMarker=!0,y.image=!0,P.highlightFormatting&&(y.formatting="image"),C(y);if(ae==="["&&y.imageMarker&&N.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return y.imageMarker=!1,y.imageAltText=!0,P.highlightFormatting&&(y.formatting="image"),C(y);if(ae==="]"&&y.imageAltText){P.highlightFormatting&&(y.formatting="image");var Oe=C(y);return y.imageAltText=!1,y.image=!1,y.inline=y.f=w,Oe}if(ae==="["&&!y.image)return y.linkText&&N.match(/^.*?\]/)||(y.linkText=!0,P.highlightFormatting&&(y.formatting="link")),C(y);if(ae==="]"&&y.linkText){P.highlightFormatting&&(y.formatting="link");var Oe=C(y);return y.linkText=!1,y.inline=y.f=N.match(/\(.*?\)| ?\[.*?\]/,!1)?w:x,Oe}if(ae==="<"&&N.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){y.f=y.inline=f,P.highlightFormatting&&(y.formatting="link");var Oe=C(y);return Oe?Oe+=" ":Oe="",Oe+G.linkInline}if(ae==="<"&&N.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){y.f=y.inline=f,P.highlightFormatting&&(y.formatting="link");var Oe=C(y);return Oe?Oe+=" ":Oe="",Oe+G.linkEmail}if(P.xml&&ae==="<"&&N.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var de=N.string.indexOf(">",N.pos);if(de!=-1){var Me=N.string.substring(N.start,de);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Me)&&(y.md_inside=!0)}return N.backUp(1),y.htmlState=re.startState(X),a(N,y,L)}if(P.xml&&ae==="<"&&N.match(/^\/\w*?>/))return y.md_inside=!1,"tag";if(ae==="*"||ae==="_"){for(var tt=1,We=N.pos==1?" ":N.string.charAt(N.pos-2);tt<3&&N.eat(ae);)tt++;var rt=N.peek()||" ",st=!/\s/.test(rt)&&(!l.test(rt)||/\s/.test(We)||l.test(We)),Pe=!/\s/.test(We)&&(!l.test(We)||/\s/.test(rt)||l.test(rt)),je=null,Ze=null;if(tt%2&&(!y.em&&st&&(ae==="*"||!Pe||l.test(We))?je=!0:y.em==ae&&Pe&&(ae==="*"||!st||l.test(rt))&&(je=!1)),tt>1&&(!y.strong&&st&&(ae==="*"||!Pe||l.test(We))?Ze=!0:y.strong==ae&&Pe&&(ae==="*"||!st||l.test(rt))&&(Ze=!1)),Ze!=null||je!=null){P.highlightFormatting&&(y.formatting=je==null?"strong":Ze==null?"em":"strong em"),je===!0&&(y.em=ae),Ze===!0&&(y.strong=ae);var Ce=C(y);return je===!1&&(y.em=!1),Ze===!1&&(y.strong=!1),Ce}}else if(ae===" "&&(N.eat("*")||N.eat("_"))){if(N.peek()===" ")return C(y);N.backUp(1)}if(P.strikethrough){if(ae==="~"&&N.eatWhile(ae)){if(y.strikethrough){P.highlightFormatting&&(y.formatting="strikethrough");var Ce=C(y);return y.strikethrough=!1,Ce}else if(N.match(/^[^\s]/,!1))return y.strikethrough=!0,P.highlightFormatting&&(y.formatting="strikethrough"),C(y)}else if(ae===" "&&N.match(/^~~/,!0)){if(N.peek()===" ")return C(y);N.backUp(2)}}if(P.emoji&&ae===":"&&N.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){y.emoji=!0,P.highlightFormatting&&(y.formatting="emoji");var se=C(y);return y.emoji=!1,se}return ae===" "&&(N.match(/^ +$/,!1)?y.trailingSpace++:y.trailingSpace&&(y.trailingSpaceNewLine=!0)),C(y)}function f(N,y){var Y=N.next();if(Y===">"){y.f=y.inline=x,P.highlightFormatting&&(y.formatting="link");var ee=C(y);return ee?ee+=" ":ee="",ee+G.linkInline}return N.match(/^[^>]+/,!0),G.linkInline}function w(N,y){if(N.eatSpace())return null;var Y=N.next();return Y==="("||Y==="["?(y.f=y.inline=b(Y==="("?")":"]"),P.highlightFormatting&&(y.formatting="link-string"),y.linkHref=!0,C(y)):"error"}var v={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function b(N){return function(y,Y){var ee=y.next();if(ee===N){Y.f=Y.inline=x,P.highlightFormatting&&(Y.formatting="link-string");var ae=C(Y);return Y.linkHref=!1,ae}return y.match(v[N]),Y.linkHref=!0,C(Y)}}function F(N,y){return N.match(/^([^\]\\]|\\.)*\]:/,!1)?(y.f=B,N.next(),P.highlightFormatting&&(y.formatting="link"),y.linkText=!0,C(y)):s(N,y,x)}function B(N,y){if(N.match(/^\]:/,!0)){y.f=y.inline=R,P.highlightFormatting&&(y.formatting="link");var Y=C(y);return y.linkText=!1,Y}return N.match(/^([^\]\\]|\\.)+/,!0),G.linkText}function R(N,y){return N.eatSpace()?null:(N.match(/^[^\s]+/,!0),N.peek()===void 0?y.linkTitle=!0:N.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),y.f=y.inline=x,G.linkHref+" url")}var j={startState:function(){return{f:S,prevLine:{stream:null},thisLine:{stream:null},block:S,htmlState:null,indentation:0,inline:x,text:T,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(N){return{f:N.f,prevLine:N.prevLine,thisLine:N.thisLine,block:N.block,htmlState:N.htmlState&&re.copyState(X,N.htmlState),indentation:N.indentation,localMode:N.localMode,localState:N.localMode?re.copyState(N.localMode,N.localState):null,inline:N.inline,text:N.text,formatting:!1,linkText:N.linkText,linkTitle:N.linkTitle,linkHref:N.linkHref,code:N.code,em:N.em,strong:N.strong,strikethrough:N.strikethrough,emoji:N.emoji,header:N.header,setext:N.setext,hr:N.hr,taskList:N.taskList,list:N.list,listStack:N.listStack.slice(0),quote:N.quote,indentedCode:N.indentedCode,trailingSpace:N.trailingSpace,trailingSpaceNewLine:N.trailingSpaceNewLine,md_inside:N.md_inside,fencedEndRE:N.fencedEndRE}},token:function(N,y){if(y.formatting=!1,N!=y.thisLine.stream){if(y.header=0,y.hr=!1,N.match(/^\s*$/,!0))return E(y),null;if(y.prevLine=y.thisLine,y.thisLine={stream:N},y.taskList=!1,y.trailingSpace=0,y.trailingSpaceNewLine=!1,!y.localState&&(y.f=y.block,y.f!=L)){var Y=N.match(/^\s*/,!0)[0].replace(/\t/g,u).length;if(y.indentation=Y,y.indentationDiff=null,Y>0)return null}}return y.f(N,y)},innerMode:function(N){return N.block==L?{state:N.htmlState,mode:X}:N.localState?{state:N.localState,mode:N.localMode}:{state:N,mode:j}},indent:function(N,y,Y){return N.block==L&&X.indent?X.indent(N.htmlState,y,Y):N.localState&&N.localMode.indent?N.localMode.indent(N.localState,y,Y):re.Pass},blankLine:E,getType:C,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return j},"xml"),re.defineMIME("text/markdown","markdown"),re.defineMIME("text/x-markdown","markdown")})},nEHx:function(ht,be,Z){"use strict";Z.d(be,"a",function(){return re});var re;(function($){$.DARK="dark",$.LIGHT="light",$.HIGH_CONTRAST="hc"})(re||(re={}))},nnTU:function(ht,be,Z){"use strict";Z.d(be,"b",function(){return G}),Z.d(be,"a",function(){return H});var re=Z("MI8n"),$=Z("JYp7"),P=Z("pmY6"),X=Z("24hK"),U=Z("746U"),k=Z("Cg/j");const G=Object(k.c)("commandService"),H=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new re.b,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(n,D){if(!n)throw new Error("invalid command");if(typeof n=="string"){if(!D)throw new Error("invalid command");return this.registerCommand({id:n,handler:D})}if(n.description){const o=[];for(let l of n.description.args)o.push(l.constraint);const c=n.handler;n.handler=function(l,...u){return Object(U.o)(u,o),c(l,...u)}}const{id:g}=n;let p=this._commands.get(g);p||(p=new X.a,this._commands.set(g,p));let m=p.unshift(n),h=Object(P.i)(()=>{m();const o=this._commands.get(g);(o==null?void 0:o.isEmpty())&&this._commands.delete(g)});return this._onDidRegisterCommand.fire(g),h}registerCommandAlias(n,D){return H.registerCommand(n,(g,...p)=>g.get(G).executeCommand(D,...p))}getCommand(n){const D=this._commands.get(n);return!D||D.isEmpty()?void 0:$.a.first(D)}getCommands(){const n=new Map;for(const D of this._commands.keys()){const g=this.getCommand(D);g&&n.set(D,g)}return n}};H.registerCommand("noop",()=>{})},osHv:function(ht,be,Z){(function(re){re(Z("VrN/"))})(function(re){"use strict";var $=re.Pos;function P(l,u){return l.line-u.line||l.ch-u.ch}var X="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",U=X+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",k=new RegExp("<(/?)(["+X+"]["+U+"]*)","g");function G(l,u,s,a){this.line=u,this.ch=s,this.cm=l,this.text=l.getLine(u),this.min=a?Math.max(a.from,l.firstLine()):l.firstLine(),this.max=a?Math.min(a.to-1,l.lastLine()):l.lastLine()}function H(l,u){var s=l.cm.getTokenTypeAt($(l.line,u));return s&&/\btag\b/.test(s)}function n(l){return l.line>=l.max?void 0:(l.ch=0,l.text=l.cm.getLine(++l.line),!0)}function D(l){return l.line<=l.min?void 0:(l.text=l.cm.getLine(--l.line),l.ch=l.text.length,!0)}function g(l){for(;;){var u=l.text.indexOf(">",l.ch);if(u==-1){if(n(l))continue;return}if(!H(l,u+1)){l.ch=u+1;continue}var s=l.text.lastIndexOf("/",u),a=s>-1&&!/\S/.test(l.text.slice(s+1,u));return l.ch=u+1,a?"selfClose":"regular"}}function p(l){for(;;){var u=l.ch?l.text.lastIndexOf("<",l.ch-1):-1;if(u==-1){if(D(l))continue;return}if(!H(l,u+1)){l.ch=u;continue}k.lastIndex=u,l.ch=u;var s=k.exec(l.text);if(s&&s.index==u)return s}}function m(l){for(;;){k.lastIndex=l.ch;var u=k.exec(l.text);if(!u){if(n(l))continue;return}if(!H(l,u.index+1)){l.ch=u.index+1;continue}return l.ch=u.index+u[0].length,u}}function h(l){for(;;){var u=l.ch?l.text.lastIndexOf(">",l.ch-1):-1;if(u==-1){if(D(l))continue;return}if(!H(l,u+1)){l.ch=u;continue}var s=l.text.lastIndexOf("/",u),a=s>-1&&!/\S/.test(l.text.slice(s+1,u));return l.ch=u+1,a?"selfClose":"regular"}}function o(l,u){for(var s=[];;){var a=m(l),A,E=l.line,S=l.ch-(a?a[0].length:0);if(!a||!(A=g(l)))return;if(A=="selfClose")continue;if(a[1]){for(var L=s.length-1;L>=0;--L)if(s[L]==a[2]){s.length=L;break}if(L<0&&(!u||u==a[2]))return{tag:a[2],from:$(E,S),to:$(l.line,l.ch)}}else s.push(a[2])}}function c(l,u){for(var s=[];;){var a=h(l);if(!a)return;if(a=="selfClose"){p(l);continue}var A=l.line,E=l.ch,S=p(l);if(!S)return;if(S[1])s.push(S[2]);else{for(var L=s.length-1;L>=0;--L)if(s[L]==S[2]){s.length=L;break}if(L<0&&(!u||u==S[2]))return{tag:S[2],from:$(l.line,l.ch),to:$(A,E)}}}}re.registerHelper("fold","xml",function(l,u){for(var s=new G(l,u.line,0);;){var a=m(s);if(!a||s.line!=u.line)return;var A=g(s);if(!A)return;if(!a[1]&&A!="selfClose"){var E=$(s.line,s.ch),S=o(s,a[2]);return S&&P(S.from,E)>0?{from:E,to:S.from}:null}}}),re.findMatchingTag=function(l,u,s){var a=new G(l,u.line,u.ch,s);if(a.text.indexOf(">")==-1&&a.text.indexOf("<")==-1)return;var A=g(a),E=A&&$(a.line,a.ch),S=A&&p(a);if(!A||!S||P(a,u)>0)return;var L={from:$(a.line,a.ch),to:E,tag:S[2]};return A=="selfClose"?{open:L,close:null,at:"open"}:S[1]?{open:c(a,S[2]),close:L,at:"close"}:(a=new G(l,E.line,E.ch,s),{open:L,close:o(a,S[2]),at:"open"})},re.findEnclosingTag=function(l,u,s,a){for(var A=new G(l,u.line,u.ch,s);;){var E=c(A,a);if(!E)break;var S=new G(l,u.line,u.ch,s),L=o(S,E.tag);if(L)return{open:E,close:L}}},re.scanForClosingTag=function(l,u,s,a){var A=new G(l,u.line,u.ch,a?{from:0,to:a}:null);return o(A,s)}})},p5ED:function(ht,be,Z){"use strict";var re=Z("+L6B"),$=Z("2/Rp"),P=Z("5Dmo"),X=Z("3S7+"),U=Z("k1fw"),k=Z("tJVT"),G=Z("q1tI"),H=Z.n(G),n=Z("vHTk"),D=Z.n(n),g=Z("yEEn"),p=Z("ZW9T"),m=Z("1vsH");be.a=function(h){var o=h.name,c=h.data,l=h.theme,u=h.type,s=h.filename,a=h.monacoEditor,A=h.className,E=h.style,S=h.close,L=h.onClose,O=h.hasMask,C=Object(G.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),T=Object(k.a)(C,2),x=T[0],f=T[1],w=Object(G.useState)(""),v=Object(k.a)(w,2),b=v[0],F=v[1],B,R=1024*1024,j=10*R,N=Object(G.useRef)();u==="office"&&(B=Object(m.T)(c).filesize,B>j&&(u="other")),s&&(a.filename=s),Object(G.useEffect)(function(){var ee,ae,ue=(ee=document.cookie)===null||ee===void 0||((ae=ee.replace(/\s/g,""))===null||ae===void 0)?void 0:ae.split(";");ue==null||ue.map(function(Re){var Ee=Re.split("=");Ee[0]==="_educoder_session"&&F(Ee[1])})},[]);var y=function(){if(c.startsWith("http")||c.startsWith("/")){Y();return}Object(m.z)(s||"educoder",c,s)},Y=function(){Object(m.x)(s||o,c)};return console.log("data:",c,"fileanme:",s," name:",o),H.a.createElement("div",{style:Object(U.a)({},E||{}),className:"".concat(O&&D.a.bgBlack," ").concat(u?D.a.wrp:"hide")},S&&H.a.createElement("div",{className:D.a.close,ref:N},H.a.createElement(X.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return N.current}},H.a.createElement("span",{onClick:Y},H.a.createElement("i",{className:"icon-quxiaozhiding"}))),H.a.createElement(X.a,{title:"\u5173\u95ED",getPopupContainer:function(){return N.current}},H.a.createElement("span",{className:"",onClick:L},H.a.createElement("i",{className:"icon-guanbi1"})))),H.a.createElement("div",{className:"".concat(D.a[A]," ").concat(A," ").concat(D.a.monaco," ").concat(u==="txt"?"show":"hide")},u==="txt"&&H.a.createElement(p.b,a)),u==="audio"&&H.a.createElement("audio",{src:"".concat(c!=null&&c.startsWith("/")||(c==null?void 0:c.indexOf("https://"))>-1?c:"data:audio/mp3;base64,").concat(c),autoPlay:!0}),u==="video"&&H.a.createElement(H.a.Fragment,null,c!=null&&c.startsWith("/")?H.a.createElement("video",{controls:!0,src:"".concat(c),autoPlay:!0}):H.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(c),autoPlay:!0})),u==="html"&&H.a.createElement("iframe",{src:c+"&disposition=inline"}),u==="pdf"&&H.a.createElement("embed",{className:D.a.embed,src:c}),u==="image"&&H.a.createElement(H.a.Fragment,null,H.a.createElement("img",{src:"".concat(c!=null&&c.startsWith("/")||(c==null?void 0:c.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(c)})),u==="other"&&H.a.createElement("div",null,H.a.createElement($.a,{type:"primary",size:"large",onClick:y},H.a.createElement(g.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),(u==="download"||u==="office")&&H.a.createElement($.a,{type:"primary",size:"large",onClick:y},H.a.createElement(g.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(ht,be,Z){},pmY6:function(ht,be,Z){"use strict";Z.d(be,"h",function(){return D}),Z.d(be,"g",function(){return p}),Z.d(be,"f",function(){return m}),Z.d(be,"e",function(){return h}),Z.d(be,"i",function(){return o}),Z.d(be,"b",function(){return c}),Z.d(be,"a",function(){return l}),Z.d(be,"d",function(){return u}),Z.d(be,"c",function(){return s});var re=Z("C/vA"),$=Z("JYp7");const P=!1;let X=null;function U(a){X=a}if(P){const a="__is_disposable_tracked__";U(new class{trackDisposable(A){const E=new Error("Potentially leaked disposable").stack;setTimeout(()=>{A[a]||console.log(E)},3e3)}setParent(A,E){if(A&&A!==l.None)try{A[a]=!0}catch(S){}}markAsDisposed(A){if(A&&A!==l.None)try{A[a]=!0}catch(E){}}markAsSingleton(A){}})}function k(a){return X==null||X.trackDisposable(a),a}function G(a){X==null||X.markAsDisposed(a)}function H(a,A){X==null||X.setParent(a,A)}function n(a,A){if(!X)return;for(const E of a)X.setParent(E,A)}function D(a){return X==null||X.markAsSingleton(a),a}class g extends Error{constructor(a){super(`Encountered errors while disposing of store. Errors: [${a.join(", ")}]`);this.errors=a}}function p(a){return typeof a.dispose=="function"&&a.dispose.length===0}function m(a){if($.a.is(a)){let A=[];for(const E of a)if(E)try{E.dispose()}catch(S){A.push(S)}if(A.length===1)throw A[0];if(A.length>1)throw new g(A);return Array.isArray(a)?[]:a}else if(a)return a.dispose(),a}function h(...a){const A=o(()=>m(a));return n(a,A),A}function o(a){const A=k({dispose:Object(re.a)(()=>{G(A),a()})});return A}class c{constructor(){this._toDispose=new Set,this._isDisposed=!1,k(this)}dispose(){if(this._isDisposed)return;G(this),this._isDisposed=!0,this.clear()}clear(){try{m(this._toDispose.values())}finally{this._toDispose.clear()}}add(a){if(!a)return a;if(a===this)throw new Error("Cannot register a disposable on itself!");return H(a,this),this._isDisposed?c.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(a),a}}c.DISABLE_DISPOSED_WARNING=!1;class l{constructor(){this._store=new c,k(this),H(this._store,this)}dispose(){G(this),this._store.dispose()}_register(a){if(a===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(a)}}l.None=Object.freeze({dispose(){}});class u{constructor(){this._isDisposed=!1,k(this)}get value(){return this._isDisposed?void 0:this._value}set value(a){var A;if(this._isDisposed||a===this._value)return;(A=this._value)===null||A===void 0||A.dispose(),a&&H(a,this),this._value=a}clear(){this.value=void 0}dispose(){var a;this._isDisposed=!0,G(this),(a=this._value)===null||a===void 0||a.dispose(),this._value=void 0}clearAndLeak(){const a=this._value;return this._value=void 0,a&&H(a,null),a}}class s{constructor(a){this.object=a}dispose(){}}},psGv:function(ht,be,Z){var re,$;(function(){var P;(function(){"use strict";var G=[,,function(g){function p(o){this.__parent=o,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}p.prototype.clone_empty=function(){var o=new p(this.__parent);return o.set_indent(this.__indent_count,this.__alignment_count),o},p.prototype.item=function(o){return o<0?this.__items[this.__items.length+o]:this.__items[o]},p.prototype.has_match=function(o){for(var c=this.__items.length-1;c>=0;c--)if(this.__items[c].match(o))return!0;return!1},p.prototype.set_indent=function(o,c){this.is_empty()&&(this.__indent_count=o||0,this.__alignment_count=c||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},p.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},p.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},p.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var o=this.__parent.current_line;return o.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),o.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),o.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,o.__items[0]===" "&&(o.__items.splice(0,1),o.__character_count-=1),!0}return!1},p.prototype.is_empty=function(){return this.__items.length===0},p.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},p.prototype.push=function(o){this.__items.push(o);var c=o.lastIndexOf(`
|
|
`);c!==-1?this.__character_count=o.length-c:this.__character_count+=o.length},p.prototype.pop=function(){var o=null;return this.is_empty()||(o=this.__items.pop(),this.__character_count-=o.length),o},p.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},p.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},p.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},p.prototype.toString=function(){var o="";return this.is_empty()?this.__parent.indent_empty_lines&&(o=this.__parent.get_indent_string(this.__indent_count)):(o=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),o+=this.__items.join("")),o};function m(o,c){this.__cache=[""],this.__indent_size=o.indent_size,this.__indent_string=o.indent_char,o.indent_with_tabs||(this.__indent_string=new Array(o.indent_size+1).join(o.indent_char)),c=c||"",o.indent_level>0&&(c=new Array(o.indent_level+1).join(this.__indent_string)),this.__base_string=c,this.__base_string_length=c.length}m.prototype.get_indent_size=function(o,c){var l=this.__base_string_length;return c=c||0,o<0&&(l=0),l+=o*this.__indent_size,l+=c,l},m.prototype.get_indent_string=function(o,c){var l=this.__base_string;return c=c||0,o<0&&(o=0,l=""),c+=o*this.__indent_size,this.__ensure_cache(c),l+=this.__cache[c],l},m.prototype.__ensure_cache=function(o){for(;o>=this.__cache.length;)this.__add_column()},m.prototype.__add_column=function(){var o=this.__cache.length,c=0,l="";this.__indent_size&&o>=this.__indent_size&&(c=Math.floor(o/this.__indent_size),o-=c*this.__indent_size,l=new Array(c+1).join(this.__indent_string)),o&&(l+=new Array(o+1).join(" ")),this.__cache.push(l)};function h(o,c){this.__indent_cache=new m(o,c),this.raw=!1,this._end_with_newline=o.end_with_newline,this.indent_size=o.indent_size,this.wrap_line_length=o.wrap_line_length,this.indent_empty_lines=o.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new p(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}h.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},h.prototype.get_line_number=function(){return this.__lines.length},h.prototype.get_indent_string=function(o,c){return this.__indent_cache.get_indent_string(o,c)},h.prototype.get_indent_size=function(o,c){return this.__indent_cache.get_indent_size(o,c)},h.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},h.prototype.add_new_line=function(o){return this.is_empty()||!o&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},h.prototype.get_code=function(o){this.trim(!0);var c=this.current_line.pop();c&&(c[c.length-1]===`
|
|
`&&(c=c.replace(/\n+$/g,"")),this.current_line.push(c)),this._end_with_newline&&this.__add_outputline();var l=this.__lines.join(`
|
|
`);return o!==`
|
|
`&&(l=l.replace(/[\n]/g,o)),l},h.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},h.prototype.set_indent=function(o,c){return o=o||0,c=c||0,this.next_line.set_indent(o,c),this.__lines.length>1?(this.current_line.set_indent(o,c),!0):(this.current_line.set_indent(),!1)},h.prototype.add_raw_token=function(o){for(var c=0;c<o.newlines;c++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(o.whitespace_before),this.current_line.push(o.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},h.prototype.add_token=function(o){this.__add_space_before_token(),this.current_line.push(o),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},h.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},h.prototype.remove_indent=function(o){for(var c=this.__lines.length;o<c;)this.__lines[o]._remove_indent(),o++;this.current_line._remove_wrap_indent()},h.prototype.trim=function(o){for(o=o===void 0?!1:o,this.current_line.trim();o&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},h.prototype.just_added_newline=function(){return this.current_line.is_empty()},h.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},h.prototype.ensure_empty_line_above=function(o,c){for(var l=this.__lines.length-2;l>=0;){var u=this.__lines[l];if(u.is_empty())break;if(u.item(0).indexOf(o)!==0&&u.item(-1)!==c){this.__lines.splice(l+1,0,new p(this)),this.previous_line=this.__lines[this.__lines.length-2];break}l--}},g.exports.Output=h},function(g){function p(m,h,o,c){this.type=m,this.text=h,this.comments_before=null,this.newlines=o||0,this.whitespace_before=c||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}g.exports.Token=p},,,function(g){function p(o,c){this.raw_options=m(o,c),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}p.prototype._get_array=function(o,c){var l=this.raw_options[o],u=c||[];return typeof l=="object"?l!==null&&typeof l.concat=="function"&&(u=l.concat()):typeof l=="string"&&(u=l.split(/[^a-zA-Z0-9_\/\-]+/)),u},p.prototype._get_boolean=function(o,c){var l=this.raw_options[o],u=l===void 0?!!c:!!l;return u},p.prototype._get_characters=function(o,c){var l=this.raw_options[o],u=c||"";return typeof l=="string"&&(u=l.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),u},p.prototype._get_number=function(o,c){var l=this.raw_options[o];c=parseInt(c,10),isNaN(c)&&(c=0);var u=parseInt(l,10);return isNaN(u)&&(u=c),u},p.prototype._get_selection=function(o,c,l){var u=this._get_selection_list(o,c,l);if(u.length!==1)throw new Error("Invalid Option Value: The option '"+o+`' can only be one of the following values:
|
|
`+c+`
|
|
You passed in: '`+this.raw_options[o]+"'");return u[0]},p.prototype._get_selection_list=function(o,c,l){if(!c||c.length===0)throw new Error("Selection list cannot be empty.");if(l=l||[c[0]],!this._is_valid_selection(l,c))throw new Error("Invalid Default Value!");var u=this._get_array(o,l);if(!this._is_valid_selection(u,c))throw new Error("Invalid Option Value: The option '"+o+`' can contain only the following values:
|
|
`+c+`
|
|
You passed in: '`+this.raw_options[o]+"'");return u},p.prototype._is_valid_selection=function(o,c){return o.length&&c.length&&!o.some(function(l){return c.indexOf(l)===-1})};function m(o,c){var l={};o=h(o);var u;for(u in o)u!==c&&(l[u]=o[u]);if(c&&o[c])for(u in o[c])l[u]=o[c][u];return l}function h(o){var c={},l;for(l in o){var u=l.replace(/-/g,"_");c[u]=o[l]}return c}g.exports.Options=p,g.exports.normalizeOpts=h,g.exports.mergeOpts=m},,function(g){var p=RegExp.prototype.hasOwnProperty("sticky");function m(h){this.__input=h||"",this.__input_length=this.__input.length,this.__position=0}m.prototype.restart=function(){this.__position=0},m.prototype.back=function(){this.__position>0&&(this.__position-=1)},m.prototype.hasNext=function(){return this.__position<this.__input_length},m.prototype.next=function(){var h=null;return this.hasNext()&&(h=this.__input.charAt(this.__position),this.__position+=1),h},m.prototype.peek=function(h){var o=null;return h=h||0,h+=this.__position,h>=0&&h<this.__input_length&&(o=this.__input.charAt(h)),o},m.prototype.__match=function(h,o){h.lastIndex=o;var c=h.exec(this.__input);return c&&!(p&&h.sticky)&&(c.index!==o&&(c=null)),c},m.prototype.test=function(h,o){return o=o||0,o+=this.__position,o>=0&&o<this.__input_length?!!this.__match(h,o):!1},m.prototype.testChar=function(h,o){var c=this.peek(o);return h.lastIndex=0,c!==null&&h.test(c)},m.prototype.match=function(h){var o=this.__match(h,this.__position);return o?this.__position+=o[0].length:o=null,o},m.prototype.read=function(h,o,c){var l="",u;return h&&(u=this.match(h),u&&(l+=u[0])),o&&(u||!h)&&(l+=this.readUntil(o,c)),l},m.prototype.readUntil=function(h,o){var c="",l=this.__position;h.lastIndex=this.__position;var u=h.exec(this.__input);return u?(l=u.index,o&&(l+=u[0].length)):l=this.__input_length,c=this.__input.substring(this.__position,l),this.__position=l,c},m.prototype.readUntilAfter=function(h){return this.readUntil(h,!0)},m.prototype.get_regexp=function(h,o){var c=null,l="g";return o&&p&&(l="y"),typeof h=="string"&&h!==""?c=new RegExp(h,l):h&&(c=new RegExp(h.source,l)),c},m.prototype.get_literal_regexp=function(h){return RegExp(h.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},m.prototype.peekUntilAfter=function(h){var o=this.__position,c=this.readUntilAfter(h);return this.__position=o,c},m.prototype.lookBack=function(h){var o=this.__position-1;return o>=h.length&&this.__input.substring(o-h.length,o).toLowerCase()===h},g.exports.InputScanner=m},function(g,p,m){var h=m(8).InputScanner,o=m(3).Token,c=m(10).TokenStream,l=m(11).WhitespacePattern,u={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},s=function(a,A){this._input=new h(a),this._options=A||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new l(this._input)};s.prototype.tokenize=function(){this._input.restart(),this.__tokens=new c,this._reset();for(var a,A=new o(u.START,""),E=null,S=[],L=new c;A.type!==u.EOF;){for(a=this._get_next_token(A,E);this._is_comment(a);)L.add(a),a=this._get_next_token(A,E);L.isEmpty()||(a.comments_before=L,L=new c),a.parent=E,this._is_opening(a)?(S.push(E),E=a):E&&this._is_closing(a,E)&&(a.opened=E,E.closed=a,E=S.pop(),a.parent=E),a.previous=A,A.next=a,this.__tokens.add(a),A=a}return this.__tokens},s.prototype._is_first_token=function(){return this.__tokens.isEmpty()},s.prototype._reset=function(){},s.prototype._get_next_token=function(a,A){this._readWhitespace();var E=this._input.read(/.+/g);return E?this._create_token(u.RAW,E):this._create_token(u.EOF,"")},s.prototype._is_comment=function(a){return!1},s.prototype._is_opening=function(a){return!1},s.prototype._is_closing=function(a,A){return!1},s.prototype._create_token=function(a,A){var E=new o(a,A,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return E},s.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},g.exports.Tokenizer=s,g.exports.TOKEN=u},function(g){function p(m){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=m}p.prototype.restart=function(){this.__position=0},p.prototype.isEmpty=function(){return this.__tokens_length===0},p.prototype.hasNext=function(){return this.__position<this.__tokens_length},p.prototype.next=function(){var m=null;return this.hasNext()&&(m=this.__tokens[this.__position],this.__position+=1),m},p.prototype.peek=function(m){var h=null;return m=m||0,m+=this.__position,m>=0&&m<this.__tokens_length&&(h=this.__tokens[m]),h},p.prototype.add=function(m){this.__parent_token&&(m.parent=this.__parent_token),this.__tokens.push(m),this.__tokens_length+=1},g.exports.TokenStream=p},function(g,p,m){var h=m(12).Pattern;function o(c,l){h.call(this,c,l),l?this._line_regexp=this._input.get_regexp(l._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}o.prototype=new h,o.prototype.__set_whitespace_patterns=function(c,l){c+="\\t ",l+="\\n\\r",this._match_pattern=this._input.get_regexp("["+c+l+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+l+"]")},o.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var c=this._input.read(this._match_pattern);if(c===" ")this.whitespace_before_token=" ";else if(c){var l=this.__split(this._newline_regexp,c);this.newline_count=l.length-1,this.whitespace_before_token=l[this.newline_count]}return c},o.prototype.matching=function(c,l){var u=this._create();return u.__set_whitespace_patterns(c,l),u._update(),u},o.prototype._create=function(){return new o(this._input,this)},o.prototype.__split=function(c,l){c.lastIndex=0;for(var u=0,s=[],a=c.exec(l);a;)s.push(l.substring(u,a.index)),u=a.index+a[0].length,a=c.exec(l);return u<l.length?s.push(l.substring(u,l.length)):s.push(""),s},g.exports.WhitespacePattern=o},function(g){function p(m,h){this._input=m,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,h&&(this._starting_pattern=this._input.get_regexp(h._starting_pattern,!0),this._match_pattern=this._input.get_regexp(h._match_pattern,!0),this._until_pattern=this._input.get_regexp(h._until_pattern),this._until_after=h._until_after)}p.prototype.read=function(){var m=this._input.read(this._starting_pattern);return(!this._starting_pattern||m)&&(m+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),m},p.prototype.read_match=function(){return this._input.match(this._match_pattern)},p.prototype.until_after=function(m){var h=this._create();return h._until_after=!0,h._until_pattern=this._input.get_regexp(m),h._update(),h},p.prototype.until=function(m){var h=this._create();return h._until_after=!1,h._until_pattern=this._input.get_regexp(m),h._update(),h},p.prototype.starting_with=function(m){var h=this._create();return h._starting_pattern=this._input.get_regexp(m,!0),h._update(),h},p.prototype.matching=function(m){var h=this._create();return h._match_pattern=this._input.get_regexp(m,!0),h._update(),h},p.prototype._create=function(){return new p(this._input,this)},p.prototype._update=function(){},g.exports.Pattern=p},function(g){function p(m,h){m=typeof m=="string"?m:m.source,h=typeof h=="string"?h:h.source,this.__directives_block_pattern=new RegExp(m+/ beautify( \w+[:]\w+)+ /.source+h,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(m+/\sbeautify\signore:end\s/.source+h,"g")}p.prototype.get_directives=function(m){if(!m.match(this.__directives_block_pattern))return null;var h={};this.__directive_pattern.lastIndex=0;for(var o=this.__directive_pattern.exec(m);o;)h[o[1]]=o[2],o=this.__directive_pattern.exec(m);return h},p.prototype.readIgnored=function(m){return m.readUntilAfter(this.__directives_end_ignore_pattern)},g.exports.Directives=p},function(g,p,m){var h=m(12).Pattern,o={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function c(l,u){h.call(this,l,u),this.__template_pattern=null,this._disabled=Object.assign({},o),this._excluded=Object.assign({},o),u&&(this.__template_pattern=this._input.get_regexp(u.__template_pattern),this._excluded=Object.assign(this._excluded,u._excluded),this._disabled=Object.assign(this._disabled,u._disabled));var s=new h(l);this.__patterns={handlebars_comment:s.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:s.starting_with(/{{{/).until_after(/}}}/),handlebars:s.starting_with(/{{/).until_after(/}}/),php:s.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:s.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:s.starting_with(/{%/).until_after(/%}/),django_value:s.starting_with(/{{/).until_after(/}}/),django_comment:s.starting_with(/{#/).until_after(/#}/),smarty:s.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:s.starting_with(/{\*/).until_after(/\*}/),smarty_literal:s.starting_with(/{literal}/).until_after(/{\/literal}/)}}c.prototype=new h,c.prototype._create=function(){return new c(this._input,this)},c.prototype._update=function(){this.__set_templated_pattern()},c.prototype.disable=function(l){var u=this._create();return u._disabled[l]=!0,u._update(),u},c.prototype.read_options=function(l){var u=this._create();for(var s in o)u._disabled[s]=l.templating.indexOf(s)===-1;return u._update(),u},c.prototype.exclude=function(l){var u=this._create();return u._excluded[l]=!0,u._update(),u},c.prototype.read=function(){var l="";this._match_pattern?l=this._input.read(this._starting_pattern):l=this._input.read(this._starting_pattern,this.__template_pattern);for(var u=this._read_template();u;)this._match_pattern?u+=this._input.read(this._match_pattern):u+=this._input.readUntil(this.__template_pattern),l+=u,u=this._read_template();return this._until_after&&(l+=this._input.readUntilAfter(this._until_pattern)),l},c.prototype.__set_templated_pattern=function(){var l=[];this._disabled.php||l.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||l.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||l.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(l.push(this.__patterns.django._starting_pattern.source),l.push(this.__patterns.django_value._starting_pattern.source),l.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||l.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&l.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+l.join("|")+")")},c.prototype._read_template=function(){var l="",u=this._input.peek();if(u==="<"){var s=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&s==="?"&&(l=l||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&s==="%"&&(l=l||this.__patterns.erb.read())}else u==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(l=l||this.__patterns.handlebars_comment.read(),l=l||this.__patterns.handlebars_unescaped.read(),l=l||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(l=l||this.__patterns.django_value.read()),this._excluded.django||(l=l||this.__patterns.django_comment.read(),l=l||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(l=l||this.__patterns.smarty_comment.read(),l=l||this.__patterns.smarty_literal.read(),l=l||this.__patterns.smarty.read()));return l},g.exports.TemplatablePattern=c},,,,function(g,p,m){var h=m(19).Beautifier,o=m(20).Options;function c(l,u,s,a){var A=new h(l,u,s,a);return A.beautify()}g.exports=c,g.exports.defaultOptions=function(){return new o}},function(g,p,m){var h=m(20).Options,o=m(2).Output,c=m(21).Tokenizer,l=m(21).TOKEN,u=/\r\n|[\r\n]/,s=/\r\n|[\r\n]/g,a=function(w,v){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=w.max_preserve_newlines,this.preserve_newlines=w.preserve_newlines,this._output=new o(w,v)};a.prototype.current_line_has_match=function(w){return this._output.current_line.has_match(w)},a.prototype.set_space_before_token=function(w,v){this._output.space_before_token=w,this._output.non_breaking_space=v},a.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},a.prototype.add_raw_token=function(w){this._output.add_raw_token(w)},a.prototype.print_preserved_newlines=function(w){var v=0;w.type!==l.TEXT&&w.previous.type!==l.TEXT&&(v=w.newlines?1:0),this.preserve_newlines&&(v=w.newlines<this.max_preserve_newlines+1?w.newlines:this.max_preserve_newlines+1);for(var b=0;b<v;b++)this.print_newline(b>0);return v!==0},a.prototype.traverse_whitespace=function(w){return w.whitespace_before||w.newlines?(this.print_preserved_newlines(w)||(this._output.space_before_token=!0),!0):!1},a.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},a.prototype.print_newline=function(w){this._output.add_new_line(w)},a.prototype.print_token=function(w){w.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(w.text))},a.prototype.indent=function(){this.indent_level++},a.prototype.get_full_indent=function(w){return w=this.indent_level+(w||0),w<1?"":this._output.get_indent_string(w)};var A=function(w){for(var v=null,b=w.next;b.type!==l.EOF&&w.closed!==b;){if(b.type===l.ATTRIBUTE&&b.text==="type"){b.next&&b.next.type===l.EQUALS&&b.next.next&&b.next.next.type===l.VALUE&&(v=b.next.next.text);break}b=b.next}return v},E=function(w,v){var b=null,F=null;return v.closed?(w==="script"?b="text/javascript":w==="style"&&(b="text/css"),b=A(v)||b,b.search("text/css")>-1?F="css":b.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?F="javascript":b.search(/(text|application|dojo)\/(x-)?(html)/)>-1?F="html":b.search(/test\/null/)>-1&&(F="null"),F):null};function S(w,v){return v.indexOf(w)!==-1}function L(w,v,b){this.parent=w||null,this.tag=v?v.tag_name:"",this.indent_level=b||0,this.parser_token=v||null}function O(w){this._printer=w,this._current_frame=null}O.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},O.prototype.record_tag=function(w){var v=new L(this._current_frame,w,this._printer.indent_level);this._current_frame=v},O.prototype._try_pop_frame=function(w){var v=null;return w&&(v=w.parser_token,this._printer.indent_level=w.indent_level,this._current_frame=w.parent),v},O.prototype._get_frame=function(w,v){for(var b=this._current_frame;b&&!(w.indexOf(b.tag)!==-1);){if(v&&v.indexOf(b.tag)!==-1){b=null;break}b=b.parent}return b},O.prototype.try_pop=function(w,v){var b=this._get_frame([w],v);return this._try_pop_frame(b)},O.prototype.indent_to_tag=function(w){var v=this._get_frame(w);v&&(this._printer.indent_level=v.indent_level)};function C(w,v,b,F){this._source_text=w||"",v=v||{},this._js_beautify=b,this._css_beautify=F,this._tag_stack=null;var B=new h(v,"html");this._options=B,this._is_wrap_attributes_force=this._options.wrap_attributes.substr(0,"force".length)==="force",this._is_wrap_attributes_force_expand_multiline=this._options.wrap_attributes==="force-expand-multiline",this._is_wrap_attributes_force_aligned=this._options.wrap_attributes==="force-aligned",this._is_wrap_attributes_aligned_multiple=this._options.wrap_attributes==="aligned-multiple",this._is_wrap_attributes_preserve=this._options.wrap_attributes.substr(0,"preserve".length)==="preserve",this._is_wrap_attributes_preserve_aligned=this._options.wrap_attributes==="preserve-aligned"}C.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var w=this._source_text,v=this._options.eol;this._options.eol==="auto"&&(v=`
|
|
`,w&&u.test(w)&&(v=w.match(u)[0])),w=w.replace(s,`
|
|
`);var b=w.match(/^[\t ]*/)[0],F={text:"",type:""},B=new T,R=new a(this._options,b),j=new c(w,this._options).tokenize();this._tag_stack=new O(R);for(var N=null,y=j.next();y.type!==l.EOF;)y.type===l.TAG_OPEN||y.type===l.COMMENT?(N=this._handle_tag_open(R,y,B,F),B=N):y.type===l.ATTRIBUTE||y.type===l.EQUALS||y.type===l.VALUE||y.type===l.TEXT&&!B.tag_complete?N=this._handle_inside_tag(R,y,B,j):y.type===l.TAG_CLOSE?N=this._handle_tag_close(R,y,B):y.type===l.TEXT?N=this._handle_text(R,y,B):R.add_raw_token(y),F=N,y=j.next();var Y=R._output.get_code(v);return Y},C.prototype._handle_tag_close=function(w,v,b){var F={text:v.text,type:v.type};return w.alignment_size=0,b.tag_complete=!0,w.set_space_before_token(v.newlines||v.whitespace_before!=="",!0),b.is_unformatted?w.add_raw_token(v):(b.tag_start_char==="<"&&(w.set_space_before_token(v.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&b.has_wrapped_attrs&&w.print_newline(!1)),w.print_token(v)),b.indent_content&&!(b.is_unformatted||b.is_content_unformatted)&&(w.indent(),b.indent_content=!1),!b.is_inline_element&&!(b.is_unformatted||b.is_content_unformatted)&&w.set_wrap_point(),F},C.prototype._handle_inside_tag=function(w,v,b,F){var B=b.has_wrapped_attrs,R={text:v.text,type:v.type};if(w.set_space_before_token(v.newlines||v.whitespace_before!=="",!0),b.is_unformatted)w.add_raw_token(v);else if(b.tag_start_char==="{"&&v.type===l.TEXT)w.print_preserved_newlines(v)?(v.newlines=0,w.add_raw_token(v)):w.print_token(v);else{if(v.type===l.ATTRIBUTE?(w.set_space_before_token(!0),b.attr_count+=1):(v.type===l.EQUALS||v.type===l.VALUE&&v.previous.type===l.EQUALS)&&w.set_space_before_token(!1),v.type===l.ATTRIBUTE&&b.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(w.traverse_whitespace(v),B=B||v.newlines!==0),this._is_wrap_attributes_force)){var j=b.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&b.attr_count===1){var N=!0,y=0,Y;do{if(Y=F.peek(y),Y.type===l.ATTRIBUTE){N=!1;break}y+=1}while(y<4&&Y.type!==l.EOF&&Y.type!==l.TAG_CLOSE);j=!N}j&&(w.print_newline(!1),B=!0)}w.print_token(v),B=B||w.previous_token_wrapped(),b.has_wrapped_attrs=B}return R},C.prototype._handle_text=function(w,v,b){var F={text:v.text,type:"TK_CONTENT"};return b.custom_beautifier_name?this._print_custom_beatifier_text(w,v,b):b.is_unformatted||b.is_content_unformatted?w.add_raw_token(v):(w.traverse_whitespace(v),w.print_token(v)),F},C.prototype._print_custom_beatifier_text=function(w,v,b){var F=this;if(v.text!==""){var B=v.text,R,j=1,N="",y="";b.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?R=this._js_beautify:b.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?R=this._css_beautify:b.custom_beautifier_name==="html"&&(R=function(Ee,xe){var Ce=new C(Ee,xe,F._js_beautify,F._css_beautify);return Ce.beautify()}),this._options.indent_scripts==="keep"?j=0:this._options.indent_scripts==="separate"&&(j=-w.indent_level);var Y=w.get_full_indent(j);if(B=B.replace(/\n[ \t]*$/,""),b.custom_beautifier_name!=="html"&&B[0]==="<"&&B.match(/^(<!--|<!\[CDATA\[)/)){var ee=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(B);if(!ee){w.add_raw_token(v);return}N=Y+ee[1]+`
|
|
`,B=ee[4],ee[5]&&(y=Y+ee[5]),B=B.replace(/\n[ \t]*$/,""),(ee[2]||ee[3].indexOf(`
|
|
`)!==-1)&&(ee=ee[3].match(/[ \t]+$/),ee&&(v.whitespace_before=ee[0]))}if(B)if(R){var ae=function(){this.eol=`
|
|
`};ae.prototype=this._options.raw_options;var ue=new ae;B=R(Y+B,ue)}else{var Re=v.whitespace_before;Re&&(B=B.replace(new RegExp(`
|
|
(`+Re+")?","g"),`
|
|
`)),B=Y+B.replace(/\n/g,`
|
|
`+Y)}N&&(B?B=N+B+`
|
|
`+y:B=N+y),w.print_newline(!1),B&&(v.text=B,v.whitespace_before="",v.newlines=0,w.add_raw_token(v),w.print_newline(!0))}},C.prototype._handle_tag_open=function(w,v,b,F){var B=this._get_tag_open_token(v);return(b.is_unformatted||b.is_content_unformatted)&&!b.is_empty_element&&v.type===l.TAG_OPEN&&v.text.indexOf("</")===0?(w.add_raw_token(v),B.start_tag_token=this._tag_stack.try_pop(B.tag_name)):(w.traverse_whitespace(v),this._set_tag_position(w,v,B,b,F),B.is_inline_element||w.set_wrap_point(),w.print_token(v)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(B.alignment_size=v.text.length+1),!B.tag_complete&&!B.is_unformatted&&(w.alignment_size=B.alignment_size),B};var T=function(w,v){if(this.parent=w||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",!v)this.tag_complete=!0;else{var b;this.tag_start_char=v.text[0],this.text=v.text,this.tag_start_char==="<"?(b=v.text.match(/^<([^\s>]*)/),this.tag_check=b?b[1]:""):(b=v.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=b?b[1]:"",(v.text.startsWith("{{#>")||v.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&v.next!==null?this.tag_check=v.next.text.split(" ")[0]:this.tag_check=v.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),v.type===l.COMMENT&&(this.tag_complete=!0),this.is_start_tag=this.tag_check.charAt(0)!=="/",this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||v.closed&&v.closed.text==="/>";var F=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(F=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(F)))}};C.prototype._get_tag_open_token=function(w){var v=new T(this._tag_stack.get_parser_token(),w);return v.alignment_size=this._options.wrap_attributes_indent_size,v.is_end_tag=v.is_end_tag||S(v.tag_check,this._options.void_elements),v.is_empty_element=v.tag_complete||v.is_start_tag&&v.is_end_tag,v.is_unformatted=!v.tag_complete&&S(v.tag_check,this._options.unformatted),v.is_content_unformatted=!v.is_empty_element&&S(v.tag_check,this._options.content_unformatted),v.is_inline_element=S(v.tag_name,this._options.inline)||v.tag_name.includes("-")||v.tag_start_char==="{",v},C.prototype._set_tag_position=function(w,v,b,F,B){if(b.is_empty_element||(b.is_end_tag?b.start_tag_token=this._tag_stack.try_pop(b.tag_name):(this._do_optional_end_element(b)&&(b.is_inline_element||w.print_newline(!1)),this._tag_stack.record_tag(b),(b.tag_name==="script"||b.tag_name==="style")&&!(b.is_unformatted||b.is_content_unformatted)&&(b.custom_beautifier_name=E(b.tag_check,v)))),S(b.tag_check,this._options.extra_liners)&&(w.print_newline(!1),w._output.just_added_blankline()||w.print_newline(!0)),b.is_empty_element){if(b.tag_start_char==="{"&&b.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),b.indent_content=!0;var R=w.current_line_has_match(/{{#if/);R||w.print_newline(!1)}b.tag_name==="!--"&&B.type===l.TAG_CLOSE&&F.is_end_tag&&b.text.indexOf(`
|
|
`)===-1||(b.is_inline_element||b.is_unformatted||w.print_newline(!1),this._calcluate_parent_multiline(w,b))}else if(b.is_end_tag){var j=!1;j=b.start_tag_token&&b.start_tag_token.multiline_content,j=j||!b.is_inline_element&&!(F.is_inline_element||F.is_unformatted)&&!(B.type===l.TAG_CLOSE&&b.start_tag_token===F)&&B.type!=="TK_CONTENT",(b.is_content_unformatted||b.is_unformatted)&&(j=!1),j&&w.print_newline(!1)}else b.indent_content=!b.custom_beautifier_name,b.tag_start_char==="<"&&(b.tag_name==="html"?b.indent_content=this._options.indent_inner_html:b.tag_name==="head"?b.indent_content=this._options.indent_head_inner_html:b.tag_name==="body"&&(b.indent_content=this._options.indent_body_inner_html)),!(b.is_inline_element||b.is_unformatted)&&(B.type!=="TK_CONTENT"||b.is_content_unformatted)&&w.print_newline(!1),this._calcluate_parent_multiline(w,b)},C.prototype._calcluate_parent_multiline=function(w,v){v.parent&&w._output.just_added_newline()&&!((v.is_inline_element||v.is_unformatted)&&v.parent.is_inline_element)&&(v.parent.multiline_content=!0)};var x=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","nav","ol","p","pre","section","table","ul"],f=["a","audio","del","ins","map","noscript","video"];C.prototype._do_optional_end_element=function(w){var v=null;if(w.is_empty_element||!w.is_start_tag||!w.parent)return;if(w.tag_name==="body")v=v||this._tag_stack.try_pop("head");else if(w.tag_name==="li")v=v||this._tag_stack.try_pop("li",["ol","ul"]);else if(w.tag_name==="dd"||w.tag_name==="dt")v=v||this._tag_stack.try_pop("dt",["dl"]),v=v||this._tag_stack.try_pop("dd",["dl"]);else if(w.parent.tag_name==="p"&&x.indexOf(w.tag_name)!==-1){var b=w.parent.parent;(!b||f.indexOf(b.tag_name)===-1)&&(v=v||this._tag_stack.try_pop("p"))}else w.tag_name==="rp"||w.tag_name==="rt"?(v=v||this._tag_stack.try_pop("rt",["ruby","rtc"]),v=v||this._tag_stack.try_pop("rp",["ruby","rtc"])):w.tag_name==="optgroup"?v=v||this._tag_stack.try_pop("optgroup",["select"]):w.tag_name==="option"?v=v||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):w.tag_name==="colgroup"?v=v||this._tag_stack.try_pop("caption",["table"]):w.tag_name==="thead"?(v=v||this._tag_stack.try_pop("caption",["table"]),v=v||this._tag_stack.try_pop("colgroup",["table"])):w.tag_name==="tbody"||w.tag_name==="tfoot"?(v=v||this._tag_stack.try_pop("caption",["table"]),v=v||this._tag_stack.try_pop("colgroup",["table"]),v=v||this._tag_stack.try_pop("thead",["table"]),v=v||this._tag_stack.try_pop("tbody",["table"])):w.tag_name==="tr"?(v=v||this._tag_stack.try_pop("caption",["table"]),v=v||this._tag_stack.try_pop("colgroup",["table"]),v=v||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(w.tag_name==="th"||w.tag_name==="td")&&(v=v||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),v=v||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return w.parent=this._tag_stack.get_parser_token(),v},g.exports.Beautifier=C},function(g,p,m){var h=m(6).Options;function o(c){h.call(this,c,"html"),this.templating.length===1&&this.templating[0]==="auto"&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}o.prototype=new h,g.exports.Options=o},function(g,p,m){var h=m(9).Tokenizer,o=m(9).TOKEN,c=m(13).Directives,l=m(14).TemplatablePattern,u=m(12).Pattern,s={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:o.START,RAW:o.RAW,EOF:o.EOF},a=new c(/<\!--/,/-->/),A=function(E,S){h.call(this,E,S),this._current_tag_name="";var L=new l(this._input).read_options(this._options),O=new u(this._input);if(this.__patterns={word:L.until(/[\n\r\t <]/),single_quote:L.until_after(/'/),double_quote:L.until_after(/"/),attribute:L.until(/[\n\r\t =>]|\/>/),element_name:L.until(/[\n\r\t >\/]/),handlebars_comment:O.starting_with(/{{!--/).until_after(/--}}/),handlebars:O.starting_with(/{{/).until_after(/}}/),handlebars_open:O.until(/[\n\r\t }]/),handlebars_raw_close:O.until(/}}/),comment:O.starting_with(/<!--/).until_after(/-->/),cdata:O.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:O.starting_with(/<!\[/).until_after(/]>/),processing:O.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var C=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=O.matching(C).until_after(C)}};A.prototype=new h,A.prototype._is_comment=function(E){return!1},A.prototype._is_opening=function(E){return E.type===s.TAG_OPEN},A.prototype._is_closing=function(E,S){return E.type===s.TAG_CLOSE&&S&&((E.text===">"||E.text==="/>")&&S.text[0]==="<"||E.text==="}}"&&S.text[0]==="{"&&S.text[1]==="{")},A.prototype._reset=function(){this._current_tag_name=""},A.prototype._get_next_token=function(E,S){var L=null;this._readWhitespace();var O=this._input.peek();return O===null?this._create_token(s.EOF,""):(L=L||this._read_open_handlebars(O,S),L=L||this._read_attribute(O,E,S),L=L||this._read_close(O,S),L=L||this._read_raw_content(O,E,S),L=L||this._read_content_word(O),L=L||this._read_comment_or_cdata(O),L=L||this._read_processing(O),L=L||this._read_open(O,S),L=L||this._create_token(s.UNKNOWN,this._input.next()),L)},A.prototype._read_comment_or_cdata=function(E){var S=null,L=null,O=null;if(E==="<"){var C=this._input.peek(1);C==="!"&&(L=this.__patterns.comment.read(),L?(O=a.get_directives(L),O&&O.ignore==="start"&&(L+=a.readIgnored(this._input))):L=this.__patterns.cdata.read()),L&&(S=this._create_token(s.COMMENT,L),S.directives=O)}return S},A.prototype._read_processing=function(E){var S=null,L=null,O=null;if(E==="<"){var C=this._input.peek(1);(C==="!"||C==="?")&&(L=this.__patterns.conditional_comment.read(),L=L||this.__patterns.processing.read()),L&&(S=this._create_token(s.COMMENT,L),S.directives=O)}return S},A.prototype._read_open=function(E,S){var L=null,O=null;return S||E==="<"&&(L=this._input.next(),this._input.peek()==="/"&&(L+=this._input.next()),L+=this.__patterns.element_name.read(),O=this._create_token(s.TAG_OPEN,L)),O},A.prototype._read_open_handlebars=function(E,S){var L=null,O=null;return S||this._options.indent_handlebars&&E==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(L=this.__patterns.handlebars_comment.read(),L=L||this.__patterns.handlebars.read(),O=this._create_token(s.COMMENT,L)):(L=this.__patterns.handlebars_open.read(),O=this._create_token(s.TAG_OPEN,L))),O},A.prototype._read_close=function(E,S){var L=null,O=null;return S&&(S.text[0]==="<"&&(E===">"||E==="/"&&this._input.peek(1)===">")?(L=this._input.next(),E==="/"&&(L+=this._input.next()),O=this._create_token(s.TAG_CLOSE,L)):S.text[0]==="{"&&E==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),O=this._create_token(s.TAG_CLOSE,"}}"))),O},A.prototype._read_attribute=function(E,S,L){var O=null,C="";if(L&&L.text[0]==="<")if(E==="=")O=this._create_token(s.EQUALS,this._input.next());else if(E==='"'||E==="'"){var T=this._input.next();E==='"'?T+=this.__patterns.double_quote.read():T+=this.__patterns.single_quote.read(),O=this._create_token(s.VALUE,T)}else C=this.__patterns.attribute.read(),C&&(S.type===s.EQUALS?O=this._create_token(s.VALUE,C):O=this._create_token(s.ATTRIBUTE,C));return O},A.prototype._is_content_unformatted=function(E){return this._options.void_elements.indexOf(E)===-1&&(this._options.content_unformatted.indexOf(E)!==-1||this._options.unformatted.indexOf(E)!==-1)},A.prototype._read_raw_content=function(E,S,L){var O="";if(L&&L.text[0]==="{")O=this.__patterns.handlebars_raw_close.read();else if(S.type===s.TAG_CLOSE&&S.opened.text[0]==="<"&&S.text[0]!=="/"){var C=S.opened.text.substr(1).toLowerCase();if(C==="script"||C==="style"){var T=this._read_comment_or_cdata(E);if(T)return T.type=s.TEXT,T;O=this._input.readUntil(new RegExp("</"+C+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(C)&&(O=this._input.readUntil(new RegExp("</"+C+"[\\n\\r\\t ]*?>","ig")))}return O?this._create_token(s.TEXT,O):null},A.prototype._read_content_word=function(E){var S="";if(this._options.unformatted_content_delimiter&&(E===this._options.unformatted_content_delimiter[0]&&(S=this.__patterns.unformatted_content_delimiter.read())),S||(S=this.__patterns.word.read()),S)return this._create_token(s.TEXT,S)},g.exports.Tokenizer=A,g.exports.TOKEN=s}],H={};function n(g){var p=H[g];if(p!==void 0)return p.exports;var m=H[g]={exports:{}};return G[g](m,m.exports,n),m.exports}var D=n(18);P=D})();var X=P;if(!0)!(re=[Z,Z("6UM0"),Z("TXwP")],$=function(G){var H=Z("6UM0"),n=Z("TXwP");return{html_beautify:function(D,g){return X(D,g,H.js_beautify,n.css_beautify)}}}.apply(be,re),$!==void 0&&(ht.exports=$));else var U,k})()},"rAM+":function(ht,be,Z){"use strict";Z.d(be,"a",function(){return $});var re=Z("Qw5x");function $(P,X){var U;if(typeof Symbol=="undefined"||P[Symbol.iterator]==null){if(Array.isArray(P)||(U=Object(re.a)(P))||X&&P&&typeof P.length=="number"){U&&(P=U);var k=0,G=function(){};return{s:G,n:function(){return k>=P.length?{done:!0}:{done:!1,value:P[k++]}},e:function(p){throw p},f:G}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var H=!0,n=!1,D;return{s:function(){U=P[Symbol.iterator]()},n:function(){var p=U.next();return H=p.done,p},e:function(p){n=!0,D=p},f:function(){try{!H&&U.return!=null&&U.return()}finally{if(n)throw D}}}}},rUJ1:function(ht,be){const Z=/[&<>"']/,re=/[&<>"']/g,$=/[<>"']|&(?!#?\w+;)/,P=/[<>"']|&(?!#?\w+;)/g,X={"&":"&","<":"<",">":">",'"':""","'":"'"},U=O=>X[O];function k(O,C){if(C){if(Z.test(O))return O.replace(re,U)}else if($.test(O))return O.replace(P,U);return O}const G=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function H(O){return O.replace(G,(C,T)=>(T=T.toLowerCase(),T==="colon"?":":T.charAt(0)==="#"?T.charAt(1)==="x"?String.fromCharCode(parseInt(T.substring(2),16)):String.fromCharCode(+T.substring(1)):""))}const n=/(^|[^\[])\^/g;function D(O,C){O=O.source||O,C=C||"";const T={replace:(x,f)=>(f=f.source||f,f=f.replace(n,"$1"),O=O.replace(x,f),T),getRegex:()=>new RegExp(O,C)};return T}const g=/[^\w:]/g,p=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function m(O,C,T){if(O){let x;try{x=decodeURIComponent(H(T)).replace(g,"").toLowerCase()}catch(f){return null}if(x.indexOf("javascript:")===0||x.indexOf("vbscript:")===0||x.indexOf("data:")===0)return null}C&&!p.test(T)&&(T=u(C,T));try{T=encodeURI(T).replace(/%25/g,"%")}catch(x){return null}return T}const h={},o=/^[^:]+:\/*[^/]*$/,c=/^([^:]+:)[\s\S]*$/,l=/^([^:]+:\/*[^/]*)[\s\S]*$/;function u(O,C){h[" "+O]||(o.test(O)?h[" "+O]=O+"/":h[" "+O]=E(O,"/",!0)),O=h[" "+O];const T=O.indexOf(":")===-1;return C.substring(0,2)==="//"?T?C:O.replace(c,"$1")+C:C.charAt(0)==="/"?T?C:O.replace(l,"$1")+C:O+C}const s={exec:function(){}};function a(O){let C=1,T,x;for(;C<arguments.length;C++){T=arguments[C];for(x in T)Object.prototype.hasOwnProperty.call(T,x)&&(O[x]=T[x])}return O}function A(O,C){const T=O.replace(/\|/g,(w,v,b)=>{let F=!1,B=v;for(;--B>=0&&b[B]==="\\";)F=!F;return F?"|":" |"}),x=T.split(/ \|/);let f=0;if(x.length>C)x.splice(C);else for(;x.length<C;)x.push("");for(;f<x.length;f++)x[f]=x[f].trim().replace(/\\\|/g,"|");return x}function E(O,C,T){const x=O.length;if(x===0)return"";let f=0;for(;f<x;){const w=O.charAt(x-f-1);if(w===C&&!T)f++;else if(w!==C&&T)f++;else break}return O.substr(0,x-f)}function S(O,C){if(O.indexOf(C[1])===-1)return-1;const T=O.length;let x=0,f=0;for(;f<T;f++)if(O[f]==="\\")f++;else if(O[f]===C[0])x++;else if(O[f]===C[1]&&(x--,x<0))return f;return-1}function L(O){O&&O.sanitize&&!O.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}ht.exports={escape:k,unescape:H,edit:D,cleanUrl:m,resolveUrl:u,noopTest:s,merge:a,splitCells:A,rtrim:E,findClosingBracket:S,checkSanitizeDeprecation:L}},smFo:function(ht,be,Z){ht.exports={wrap:"wrap___1xSvp",header:"header___1niV1",title:"title____shwY",menu:"menu___2Y-rd",top:"top___1_d5Y",line:"line___1kciD",flexCenter:"flexCenter___3bP7s",like:"like___3lXjz",canLike:"canLike___AuDmL",attachmentName:"attachmentName___2SteY"}},t9D7:function(ht,be,Z){"use strict";Z.d(be,"b",function(){return G}),Z.d(be,"g",function(){return n}),Z.d(be,"d",function(){return D}),Z.d(be,"e",function(){return g}),Z.d(be,"a",function(){return p}),Z.d(be,"f",function(){return o}),Z.d(be,"c",function(){return c});var re=Z("Vhoy"),$=Z("MI8n"),P=Z("pmY6"),X=Z("Cg/j"),U=Z("ic2d"),k=Z("nEHx");const G=Object(X.c)("themeService");var H;(function(l){function u(s){return s&&typeof s=="object"&&typeof s.id=="string"}l.isThemeColor=u})(H||(H={}));function n(l){return{id:l}}var D;(function(l){function u(L){return L&&typeof L=="object"&&typeof L.id=="string"&&(typeof L.color=="undefined"||H.isThemeColor(L.color))}l.isThemeIcon=u;const s=new RegExp(`^\\$\\((${re.a.iconNameExpression}(?:${re.a.iconModifierExpression})?)\\)$`);function a(L){const O=s.exec(L);if(!O)return;let[,C]=O;return{id:C}}l.fromString=a;function A(L,O){let C=L.id;const T=C.lastIndexOf("~");return T!==-1&&(C=C.substring(0,T)),O&&(C=`${C}~${O}`),{id:C}}l.modify=A;function E(L,O){var C,T;return L.id===O.id&&((C=L.color)===null||C===void 0?void 0:C.id)===((T=O.color)===null||T===void 0?void 0:T.id)}l.isEqual=E;function S(L,O){return{id:L.id,color:O?n(O):void 0}}l.asThemeIcon=S,l.asClassNameArray=re.a.asClassNameArray,l.asClassName=re.a.asClassName,l.asCSSSelector=re.a.asCSSSelector})(D||(D={}));function g(l){switch(l){case k.a.DARK:return"vs-dark";case k.a.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const p={ThemingContribution:"base.contributions.theming"};class m{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new $.b}onColorThemeChange(l){return this.themingParticipants.push(l),this.onThemingParticipantAddedEmitter.fire(l),Object(P.i)(()=>{const u=this.themingParticipants.indexOf(l);this.themingParticipants.splice(u,1)})}getThemingParticipants(){return this.themingParticipants}}let h=new m;U.a.add(p.ThemingContribution,h);function o(l){return h.onColorThemeChange(l)}class c extends P.a{constructor(l){super();this.themeService=l,this.theme=l.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(u=>this.onThemeChange(u)))}onThemeChange(l){this.theme=l,this.updateStyles()}updateStyles(){}}},ulZh:function(ht,be,Z){typeof window!="undefined"&&function($,P){ht.exports=P()}(this,function(){return function(re){var $={};function P(X){if($[X])return $[X].exports;var U=$[X]={i:X,l:!1,exports:{}};return re[X].call(U.exports,U,U.exports,P),U.l=!0,U.exports}return P.m=re,P.c=$,P.d=function(X,U,k){P.o(X,U)||Object.defineProperty(X,U,{enumerable:!0,get:k})},P.r=function(X){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(X,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(X,"__esModule",{value:!0})},P.t=function(X,U){if(U&1&&(X=P(X)),U&8)return X;if(U&4&&typeof X=="object"&&X&&X.__esModule)return X;var k=Object.create(null);if(P.r(k),Object.defineProperty(k,"default",{enumerable:!0,value:X}),U&2&&typeof X!="string")for(var G in X)P.d(k,G,function(H){return X[H]}.bind(null,G));return k},P.n=function(X){var U=X&&X.__esModule?function(){return X.default}:function(){return X};return P.d(U,"a",U),U},P.o=function(X,U){return Object.prototype.hasOwnProperty.call(X,U)},P.p="/dist/",P(P.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(re,$,P){"use strict";var X=Object.prototype.hasOwnProperty,U="~";function k(){}Object.create&&(k.prototype=Object.create(null),new k().__proto__||(U=!1));function G(g,p,m){this.fn=g,this.context=p,this.once=m||!1}function H(g,p,m,h,o){if(typeof m!="function")throw new TypeError("The listener must be a function");var c=new G(m,h||g,o),l=U?U+p:p;return g._events[l]?g._events[l].fn?g._events[l]=[g._events[l],c]:g._events[l].push(c):(g._events[l]=c,g._eventsCount++),g}function n(g,p){--g._eventsCount===0?g._events=new k:delete g._events[p]}function D(){this._events=new k,this._eventsCount=0}D.prototype.eventNames=function(){var p=[],m,h;if(this._eventsCount===0)return p;for(h in m=this._events)X.call(m,h)&&p.push(U?h.slice(1):h);return Object.getOwnPropertySymbols?p.concat(Object.getOwnPropertySymbols(m)):p},D.prototype.listeners=function(p){var m=U?U+p:p,h=this._events[m];if(!h)return[];if(h.fn)return[h.fn];for(var o=0,c=h.length,l=new Array(c);o<c;o++)l[o]=h[o].fn;return l},D.prototype.listenerCount=function(p){var m=U?U+p:p,h=this._events[m];return h?h.fn?1:h.length:0},D.prototype.emit=function(p,m,h,o,c,l){var u=U?U+p:p;if(!this._events[u])return!1;var s=this._events[u],a=arguments.length,A,E;if(s.fn){s.once&&this.removeListener(p,s.fn,void 0,!0);switch(a){case 1:return s.fn.call(s.context),!0;case 2:return s.fn.call(s.context,m),!0;case 3:return s.fn.call(s.context,m,h),!0;case 4:return s.fn.call(s.context,m,h,o),!0;case 5:return s.fn.call(s.context,m,h,o,c),!0;case 6:return s.fn.call(s.context,m,h,o,c,l),!0}for(E=1,A=new Array(a-1);E<a;E++)A[E-1]=arguments[E];s.fn.apply(s.context,A)}else{var S=s.length,L;for(E=0;E<S;E++){s[E].once&&this.removeListener(p,s[E].fn,void 0,!0);switch(a){case 1:s[E].fn.call(s[E].context);break;case 2:s[E].fn.call(s[E].context,m);break;case 3:s[E].fn.call(s[E].context,m,h);break;case 4:s[E].fn.call(s[E].context,m,h,o);break;default:if(!A)for(L=1,A=new Array(a-1);L<a;L++)A[L-1]=arguments[L];s[E].fn.apply(s[E].context,A)}}}return!0},D.prototype.on=function(p,m,h){return H(this,p,m,h,!1)},D.prototype.once=function(p,m,h){return H(this,p,m,h,!0)},D.prototype.removeListener=function(p,m,h,o){var c=U?U+p:p;if(!this._events[c])return this;if(!m)return n(this,c),this;var l=this._events[c];if(l.fn)l.fn===m&&(!o||l.once)&&(!h||l.context===h)&&n(this,c);else{for(var u=0,s=[],a=l.length;u<a;u++)(l[u].fn!==m||o&&!l[u].once||h&&l[u].context!==h)&&s.push(l[u]);s.length?this._events[c]=s.length===1?s[0]:s:n(this,c)}return this},D.prototype.removeAllListeners=function(p){var m;return p?(m=U?U+p:p,this._events[m]&&n(this,m)):(this._events=new k,this._eventsCount=0),this},D.prototype.off=D.prototype.removeListener,D.prototype.addListener=D.prototype.on,D.prefixed=U,D.EventEmitter=D,re.exports=D},"./node_modules/url-toolkit/src/url-toolkit.js":function(re,$,P){(function(X){var U=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,k=/^([^\/?#]*)([^]*)$/,G=/(?:\/|^)\.(?=\/)/g,H=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,n={buildAbsoluteURL:function(D,g,p){if(p=p||{},D=D.trim(),g=g.trim(),!g){if(!p.alwaysNormalize)return D;var m=n.parseURL(D);if(!m)throw new Error("Error trying to parse base URL.");return m.path=n.normalizePath(m.path),n.buildURLFromParts(m)}var h=n.parseURL(g);if(!h)throw new Error("Error trying to parse relative URL.");if(h.scheme)return p.alwaysNormalize?(h.path=n.normalizePath(h.path),n.buildURLFromParts(h)):g;var o=n.parseURL(D);if(!o)throw new Error("Error trying to parse base URL.");if(!o.netLoc&&o.path&&o.path[0]!=="/"){var c=k.exec(o.path);o.netLoc=c[1],o.path=c[2]}o.netLoc&&!o.path&&(o.path="/");var l={scheme:o.scheme,netLoc:h.netLoc,path:null,params:h.params,query:h.query,fragment:h.fragment};if(!h.netLoc&&(l.netLoc=o.netLoc,h.path[0]!=="/"))if(!h.path)l.path=o.path,h.params||(l.params=o.params,h.query||(l.query=o.query));else{var u=o.path,s=u.substring(0,u.lastIndexOf("/")+1)+h.path;l.path=n.normalizePath(s)}return l.path===null&&(l.path=p.alwaysNormalize?n.normalizePath(h.path):h.path),n.buildURLFromParts(l)},parseURL:function(D){var g=U.exec(D);return g?{scheme:g[1]||"",netLoc:g[2]||"",path:g[3]||"",params:g[4]||"",query:g[5]||"",fragment:g[6]||""}:null},normalizePath:function(D){for(D=D.split("").reverse().join("").replace(G,"");D.length!==(D=D.replace(H,"")).length;);return D.split("").reverse().join("")},buildURLFromParts:function(D){return D.scheme+D.netLoc+D.path+D.params+D.query+D.fragment}};re.exports=n})(this)},"./node_modules/webworkify-webpack/index.js":function(re,$,P){function X(p){var m={};function h(c){if(m[c])return m[c].exports;var l=m[c]={i:c,l:!1,exports:{}};return p[c].call(l.exports,l,l.exports,h),l.l=!0,l.exports}h.m=p,h.c=m,h.i=function(c){return c},h.d=function(c,l,u){h.o(c,l)||Object.defineProperty(c,l,{configurable:!1,enumerable:!0,get:u})},h.r=function(c){Object.defineProperty(c,"__esModule",{value:!0})},h.n=function(c){var l=c&&c.__esModule?function(){return c.default}:function(){return c};return h.d(l,"a",l),l},h.o=function(c,l){return Object.prototype.hasOwnProperty.call(c,l)},h.p="/",h.oe=function(c){throw console.error(c),c};var o=h(h.s=ENTRY_MODULE);return o.default||o}var U="[\\.|\\-|\\+|\\w|/|@]+",k="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+U+").*?\\)";function G(p){return(p+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function H(p){return!isNaN(1*p)}function n(p,m,h){var o={};o[h]=[];var c=m.toString(),l=c.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!l)return o;for(var u=l[1],s=new RegExp("(\\\\n|\\W)"+G(u)+k,"g"),a;a=s.exec(c);){if(a[3]==="dll-reference")continue;o[h].push(a[3])}for(s=new RegExp("\\("+G(u)+'\\("(dll-reference\\s('+U+'))"\\)\\)'+k,"g");a=s.exec(c);)p[a[2]]||(o[h].push(a[1]),p[a[2]]=P(a[1]).m),o[a[2]]=o[a[2]]||[],o[a[2]].push(a[4]);for(var A=Object.keys(o),E=0;E<A.length;E++)for(var S=0;S<o[A[E]].length;S++)H(o[A[E]][S])&&(o[A[E]][S]=1*o[A[E]][S]);return o}function D(p){var m=Object.keys(p);return m.reduce(function(h,o){return h||p[o].length>0},!1)}function g(p,m){for(var h={main:[m]},o={main:[]},c={main:{}};D(h);)for(var l=Object.keys(h),u=0;u<l.length;u++){var s=l[u],a=h[s],A=a.pop();if(c[s]=c[s]||{},c[s][A]||!p[s][A])continue;c[s][A]=!0,o[s]=o[s]||[],o[s].push(A);for(var E=n(p,p[s][A],s),S=Object.keys(E),L=0;L<S.length;L++)h[S[L]]=h[S[L]]||[],h[S[L]]=h[S[L]].concat(E[S[L]])}return o}re.exports=function(p,m){m=m||{};var h={main:P.m},o=m.all?{main:Object.keys(h.main)}:g(h,p),c="";Object.keys(o).filter(function(A){return A!=="main"}).forEach(function(A){for(var E=0;o[A][E];)E++;o[A].push(E),h[A][E]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",c=c+"var "+A+" = ("+X.toString().replace("ENTRY_MODULE",JSON.stringify(E))+")({"+o[A].map(function(S){return""+JSON.stringify(S)+": "+h[A][S].toString()}).join(",")+`});
|
|
`}),c=c+"new (("+X.toString().replace("ENTRY_MODULE",JSON.stringify(p))+")({"+o.main.map(function(A){return""+JSON.stringify(A)+": "+h.main[A].toString()}).join(",")+"}))(self);";var l=new window.Blob([c],{type:"text/javascript"});if(m.bare)return l;var u=window.URL||window.webkitURL||window.mozURL||window.msURL,s=u.createObjectURL(l),a=new window.Worker(s);return a.objectURL=s,a}},"./src/config.ts":function(re,$,P){"use strict";P.r($),P.d($,"hlsDefaultConfig",function(){return L}),P.d($,"mergeConfig",function(){return C}),P.d($,"enableStreamingMode",function(){return T});var X=P("./src/controller/abr-controller.ts"),U=P("./src/controller/audio-stream-controller.ts"),k=P("./src/controller/audio-track-controller.ts"),G=P("./src/controller/subtitle-stream-controller.ts"),H=P("./src/controller/subtitle-track-controller.ts"),n=P("./src/controller/buffer-controller.ts"),D=P("./src/controller/timeline-controller.ts"),g=P("./src/controller/cap-level-controller.ts"),p=P("./src/controller/fps-controller.ts"),m=P("./src/controller/eme-controller.ts"),h=P("./src/controller/cmcd-controller.ts"),o=P("./src/utils/xhr-loader.ts"),c=P("./src/utils/fetch-loader.ts"),l=P("./src/utils/cues.ts"),u=P("./src/utils/mediakeys-helper.ts"),s=P("./src/utils/logger.ts");function a(){return a=Object.assign||function(x){for(var f=1;f<arguments.length;f++){var w=arguments[f];for(var v in w)Object.prototype.hasOwnProperty.call(w,v)&&(x[v]=w[v])}return x},a.apply(this,arguments)}function A(x,f){var w=Object.keys(x);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(x);f&&(v=v.filter(function(b){return Object.getOwnPropertyDescriptor(x,b).enumerable})),w.push.apply(w,v)}return w}function E(x){for(var f=1;f<arguments.length;f++){var w=arguments[f]!=null?arguments[f]:{};f%2?A(Object(w),!0).forEach(function(v){S(x,v,w[v])}):Object.getOwnPropertyDescriptors?Object.defineProperties(x,Object.getOwnPropertyDescriptors(w)):A(Object(w)).forEach(function(v){Object.defineProperty(x,v,Object.getOwnPropertyDescriptor(w,v))})}return x}function S(x,f,w){return f in x?Object.defineProperty(x,f,{value:w,enumerable:!0,configurable:!0,writable:!0}):x[f]=w,x}var L=E(E({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:Infinity,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:Infinity,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:o.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:X.default,bufferController:n.default,capLevelController:g.default,fpsController:p.default,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystemOptions:{},requestMediaKeySystemAccessFunc:u.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},O()),{},{subtitleStreamController:G.SubtitleStreamController,subtitleTrackController:H.default,timelineController:D.TimelineController,audioStreamController:U.default,audioTrackController:k.default,emeController:m.default,cmcdController:h.default});function O(){return{cueHandler:l.default,enableCEA708Captions:!0,enableWebVTT:!0,enableIMSC1:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function C(x,f){if((f.liveSyncDurationCount||f.liveMaxLatencyDurationCount)&&(f.liveSyncDuration||f.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(f.liveMaxLatencyDurationCount!==void 0&&(f.liveSyncDurationCount===void 0||f.liveMaxLatencyDurationCount<=f.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(f.liveMaxLatencyDuration!==void 0&&(f.liveSyncDuration===void 0||f.liveMaxLatencyDuration<=f.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return a({},x,f)}function T(x){var f=x.loader;if(f!==c.default&&f!==o.default)s.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),x.progressive=!1;else{var w=Object(c.fetchSupported)();w&&(x.loader=c.default,x.progressive=!0,x.enableSoftwareAES=!0,s.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(re,$,P){"use strict";P.r($);var X=P("./src/polyfills/number.ts"),U=P("./src/utils/ewma-bandwidth-estimator.ts"),k=P("./src/events.ts"),G=P("./src/utils/buffer-helper.ts"),H=P("./src/errors.ts"),n=P("./src/types/loader.ts"),D=P("./src/utils/logger.ts");function g(h,o){for(var c=0;c<o.length;c++){var l=o[c];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(h,l.key,l)}}function p(h,o,c){return o&&g(h.prototype,o),c&&g(h,c),h}var m=function(){function h(c){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=c;var l=c.config;this.bwEstimator=new U.default(l.abrEwmaSlowVoD,l.abrEwmaFastVoD,l.abrEwmaDefaultEstimate),this.registerListeners()}var o=h.prototype;return o.registerListeners=function(){var l=this.hls;l.on(k.Events.FRAG_LOADING,this.onFragLoading,this),l.on(k.Events.FRAG_LOADED,this.onFragLoaded,this),l.on(k.Events.FRAG_BUFFERED,this.onFragBuffered,this),l.on(k.Events.LEVEL_LOADED,this.onLevelLoaded,this),l.on(k.Events.ERROR,this.onError,this)},o.unregisterListeners=function(){var l=this.hls;l.off(k.Events.FRAG_LOADING,this.onFragLoading,this),l.off(k.Events.FRAG_LOADED,this.onFragLoaded,this),l.off(k.Events.FRAG_BUFFERED,this.onFragBuffered,this),l.off(k.Events.LEVEL_LOADED,this.onLevelLoaded,this),l.off(k.Events.ERROR,this.onError,this)},o.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},o.onFragLoading=function(l,u){var s=u.frag;if(s.type===n.PlaylistLevelType.MAIN&&!this.timer){var a;this.fragCurrent=s,this.partCurrent=(a=u.part)!=null?a:null,this.timer=self.setInterval(this.onCheck,100)}},o.onLevelLoaded=function(l,u){var s=this.hls.config;u.details.live?this.bwEstimator.update(s.abrEwmaSlowLive,s.abrEwmaFastLive):this.bwEstimator.update(s.abrEwmaSlowVoD,s.abrEwmaFastVoD)},o._abandonRulesCheck=function(){var l=this.fragCurrent,u=this.partCurrent,s=this.hls,a=s.autoLevelEnabled,A=s.config,E=s.media;if(!l||!E)return;var S=u?u.stats:l.stats,L=u?u.duration:l.duration;if(S.aborted){D.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!a||E.paused||!E.playbackRate||!E.readyState)return;var O=performance.now()-S.loading.start,C=Math.abs(E.playbackRate);if(O<=500*L/C)return;var T=s.levels,x=s.minAutoLevel,f=T[l.level],w=S.total||Math.max(S.loaded,Math.round(L*f.maxBitrate/8)),v=Math.max(1,S.bwEstimate?S.bwEstimate/8:S.loaded*1e3/O),b=(w-S.loaded)/v,F=E.currentTime,B=(G.BufferHelper.bufferInfo(E,F,A.maxBufferHole).end-F)/C;if(B>=2*L/C||b<=B)return;var R=Number.POSITIVE_INFINITY,j;for(j=l.level-1;j>x;j--){var N=T[j].maxBitrate;if(R=L*N/(8*.8*v),R<B)break}if(R>=b)return;var y=this.bwEstimator.getEstimate();D.logger.warn("Fragment "+l.sn+(u?" part "+u.index:"")+" of level "+l.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+j+`
|
|
Current BW estimate: `+(Object(X.isFiniteNumber)(y)?(y/1024).toFixed(3):"Unknown")+` Kb/s
|
|
Estimated load time for current fragment: `+b.toFixed(3)+` s
|
|
Estimated load time for the next fragment: `+R.toFixed(3)+` s
|
|
Time to underbuffer: `+B.toFixed(3)+" s"),s.nextLoadLevel=j,this.bwEstimator.sample(O,S.loaded),this.clearTimer(),l.loader&&(this.fragCurrent=this.partCurrent=null,l.loader.abort()),s.trigger(k.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:l,part:u,stats:S})},o.onFragLoaded=function(l,u){var s=u.frag,a=u.part;if(s.type===n.PlaylistLevelType.MAIN&&Object(X.isFiniteNumber)(s.sn)){var A=a?a.stats:s.stats,E=a?a.duration:s.duration;if(this.clearTimer(),this.lastLoadedFragLevel=s.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var S=this.hls.levels[s.level],L=(S.loaded?S.loaded.bytes:0)+A.loaded,O=(S.loaded?S.loaded.duration:0)+E;S.loaded={bytes:L,duration:O},S.realBitrate=Math.round(8*L/O)}if(s.bitrateTest){var C={stats:A,frag:s,part:a,id:s.type};this.onFragBuffered(k.Events.FRAG_BUFFERED,C),s.bitrateTest=!1}}},o.onFragBuffered=function(l,u){var s=u.frag,a=u.part,A=a?a.stats:s.stats;if(A.aborted)return;if(s.type!==n.PlaylistLevelType.MAIN||s.sn==="initSegment")return;var E=A.parsing.end-A.loading.start;this.bwEstimator.sample(E,A.loaded),A.bwEstimate=this.bwEstimator.getEstimate(),s.bitrateTest?this.bitrateTestDelay=E/1e3:this.bitrateTestDelay=0},o.onError=function(l,u){switch(u.details){case H.ErrorDetails.FRAG_LOAD_ERROR:case H.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},o.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},o.getNextABRAutoLevel=function(){var l=this.fragCurrent,u=this.partCurrent,s=this.hls,a=s.maxAutoLevel,A=s.config,E=s.minAutoLevel,S=s.media,L=u?u.duration:l?l.duration:0,O=S?S.currentTime:0,C=S&&S.playbackRate!==0?Math.abs(S.playbackRate):1,T=this.bwEstimator?this.bwEstimator.getEstimate():A.abrEwmaDefaultEstimate,x=(G.BufferHelper.bufferInfo(S,O,A.maxBufferHole).end-O)/C,f=this.findBestLevel(T,E,a,x,A.abrBandWidthFactor,A.abrBandWidthUpFactor);if(f>=0)return f;D.logger.trace((x?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var w=L?Math.min(L,A.maxStarvationDelay):A.maxStarvationDelay,v=A.abrBandWidthFactor,b=A.abrBandWidthUpFactor;if(!x){var F=this.bitrateTestDelay;if(F){var B=L?Math.min(L,A.maxLoadingDelay):A.maxLoadingDelay;w=B-F,D.logger.trace("bitrate test took "+Math.round(1e3*F)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*w)+" ms"),v=b=1}}return f=this.findBestLevel(T,E,a,x+w,v,b),Math.max(f,0)},o.findBestLevel=function(l,u,s,a,A,E){for(var S,L=this.fragCurrent,O=this.partCurrent,C=this.lastLoadedFragLevel,T=this.hls.levels,x=T[C],f=!!(x!=null&&(S=x.details)!==null&&S!==void 0&&S.live),w=x==null?void 0:x.codecSet,v=O?O.duration:L?L.duration:0,b=s;b>=u;b--){var F=T[b];if(!F||w&&F.codecSet!==w)continue;var B=F.details,R=(O?B==null?void 0:B.partTarget:B==null?void 0:B.averagetargetduration)||v,j=void 0;b<=C?j=A*l:j=E*l;var N=T[b].maxBitrate,y=N*R/j;if(D.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+b+"/"+Math.round(j)+"/"+N+"/"+R+"/"+a+"/"+y),j>N&&(!y||f&&!this.bitrateTestDelay||y<a))return b}return-1},p(h,[{key:"nextAutoLevel",get:function(){var l=this._nextAutoLevel,u=this.bwEstimator;if(l!==-1&&(!u||!u.canEstimate()))return l;var s=this.getNextABRAutoLevel();return l!==-1&&(s=Math.min(l,s)),s},set:function(l){this._nextAutoLevel=l}}]),h}();$.default=m},"./src/controller/audio-stream-controller.ts":function(re,$,P){"use strict";P.r($);var X=P("./src/polyfills/number.ts"),U=P("./src/controller/base-stream-controller.ts"),k=P("./src/events.ts"),G=P("./src/utils/buffer-helper.ts"),H=P("./src/controller/fragment-tracker.ts"),n=P("./src/types/level.ts"),D=P("./src/types/loader.ts"),g=P("./src/loader/fragment.ts"),p=P("./src/demux/chunk-cache.ts"),m=P("./src/demux/transmuxer-interface.ts"),h=P("./src/types/transmuxer.ts"),o=P("./src/controller/fragment-finders.ts"),c=P("./src/utils/discontinuities.ts"),l=P("./src/errors.ts"),u=P("./src/utils/logger.ts");function s(){return s=Object.assign||function(L){for(var O=1;O<arguments.length;O++){var C=arguments[O];for(var T in C)Object.prototype.hasOwnProperty.call(C,T)&&(L[T]=C[T])}return L},s.apply(this,arguments)}function a(L,O){L.prototype=Object.create(O.prototype),L.prototype.constructor=L,A(L,O)}function A(L,O){return A=Object.setPrototypeOf||function(T,x){return T.__proto__=x,T},A(L,O)}var E=100,S=function(L){a(O,L);function O(T,x){var f;return f=L.call(this,T,x,"[audio-stream-controller]")||this,f.videoBuffer=null,f.videoTrackCC=-1,f.waitingVideoCC=-1,f.audioSwitch=!1,f.trackId=-1,f.waitingData=null,f.mainDetails=null,f.bufferFlushed=!1,f._registerListeners(),f}var C=O.prototype;return C.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},C._registerListeners=function(){var x=this.hls;x.on(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),x.on(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this),x.on(k.Events.MANIFEST_LOADING,this.onManifestLoading,this),x.on(k.Events.LEVEL_LOADED,this.onLevelLoaded,this),x.on(k.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),x.on(k.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),x.on(k.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),x.on(k.Events.ERROR,this.onError,this),x.on(k.Events.BUFFER_RESET,this.onBufferReset,this),x.on(k.Events.BUFFER_CREATED,this.onBufferCreated,this),x.on(k.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),x.on(k.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),x.on(k.Events.FRAG_BUFFERED,this.onFragBuffered,this)},C._unregisterListeners=function(){var x=this.hls;x.off(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),x.off(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this),x.off(k.Events.MANIFEST_LOADING,this.onManifestLoading,this),x.off(k.Events.LEVEL_LOADED,this.onLevelLoaded,this),x.off(k.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),x.off(k.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),x.off(k.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),x.off(k.Events.ERROR,this.onError,this),x.off(k.Events.BUFFER_RESET,this.onBufferReset,this),x.off(k.Events.BUFFER_CREATED,this.onBufferCreated,this),x.off(k.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),x.off(k.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),x.off(k.Events.FRAG_BUFFERED,this.onFragBuffered,this)},C.onInitPtsFound=function(x,f){var w=f.frag,v=f.id,b=f.initPTS;if(v==="main"){var F=w.cc;this.initPTS[w.cc]=b,this.log("InitPTS for cc: "+F+" found from main: "+b),this.videoTrackCC=F,this.state===U.State.WAITING_INIT_PTS&&this.tick()}},C.startLoad=function(x){if(!this.levels){this.startPosition=x,this.state=U.State.STOPPED;return}var f=this.lastCurrentTime;this.stopLoad(),this.setInterval(E),this.fragLoadError=0,f>0&&x===-1?(this.log("Override startPosition with lastCurrentTime @"+f.toFixed(3)),this.state=U.State.IDLE):(this.loadedmetadata=!1,this.state=U.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=x,this.tick()},C.doTick=function(){switch(this.state){case U.State.IDLE:this.doTickIdle();break;case U.State.WAITING_TRACK:{var x,f=this.levels,w=this.trackId,v=f==null||((x=f[w])===null||x===void 0)?void 0:x.details;if(v){if(this.waitForCdnTuneIn(v))break;this.state=U.State.WAITING_INIT_PTS}break}case U.State.FRAG_LOADING_WAITING_RETRY:{var b,F=performance.now(),B=this.retryDate;(!B||F>=B||(b=this.media)!==null&&b!==void 0&&b.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=U.State.IDLE);break}case U.State.WAITING_INIT_PTS:{var R=this.waitingData;if(R){var j=R.frag,N=R.part,y=R.cache,Y=R.complete;if(this.initPTS[j.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=U.State.FRAG_LOADING;var ee=y.flush(),ae={frag:j,part:N,payload:ee,networkDetails:null};this._handleFragmentLoadProgress(ae),Y&&L.prototype._handleFragmentLoadComplete.call(this,ae)}else if(this.videoTrackCC!==this.waitingVideoCC)u.logger.log("Waiting fragment cc ("+j.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var ue=this.getLoadPosition(),Re=G.BufferHelper.bufferInfo(this.mediaBuffer,ue,this.config.maxBufferHole),Ee=Object(o.fragmentWithinToleranceTest)(Re.end,this.config.maxFragLookUpTolerance,j);Ee<0&&(u.logger.log("Waiting fragment cc ("+j.cc+") @ "+j.start+" cancelled because another fragment at "+Re.end+" is needed"),this.clearWaitingFragment())}}else this.state=U.State.IDLE}}this.onTickEnd()},C.clearWaitingFragment=function(){var x=this.waitingData;x&&(this.fragmentTracker.removeFragment(x.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=U.State.IDLE)},C.onTickEnd=function(){var x=this.media;if(!x||!x.readyState)return;var f=this.mediaBuffer?this.mediaBuffer:x,w=f.buffered;!this.loadedmetadata&&w.length&&(this.loadedmetadata=!0),this.lastCurrentTime=x.currentTime},C.doTickIdle=function(){var x,f,w=this.hls,v=this.levels,b=this.media,F=this.trackId,B=w.config;if(!v||!v[F])return;if(!b&&(this.startFragRequested||!B.startFragPrefetch))return;var R=v[F],j=R.details;if(!j||j.live&&this.levelLastLoaded!==F||this.waitForCdnTuneIn(j)){this.state=U.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,g.ElementaryStreamTypes.AUDIO,D.PlaylistLevelType.AUDIO));var N=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,D.PlaylistLevelType.AUDIO);if(N===null)return;var y=N.len,Y=this.getMaxBufferLength(),ee=this.audioSwitch;if(y>=Y&&!ee)return;if(!ee&&this._streamEnded(N,j)){w.trigger(k.Events.BUFFER_EOS,{type:"audio"}),this.state=U.State.ENDED;return}var ae=j.fragments,ue=ae[0].start,Re=N.end;if(ee){var Ee=this.getLoadPosition();Re=Ee,j.PTSKnown&&Ee<ue&&((N.end>ue||N.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),b.currentTime=ue+.05))}var xe=this.getNextFragment(Re,j);if(!xe){this.bufferFlushed=!0;return}((x=xe.decryptdata)===null||x===void 0?void 0:x.keyFormat)==="identity"&&!((f=xe.decryptdata)!==null&&f!==void 0&&f.key)?this.loadKey(xe,j):this.loadFragment(xe,j,Re)},C.getMaxBufferLength=function(){var x=L.prototype.getMaxBufferLength.call(this),f=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,D.PlaylistLevelType.MAIN);return f===null?x:Math.max(x,f.len)},C.onMediaDetaching=function(){this.videoBuffer=null,L.prototype.onMediaDetaching.call(this)},C.onAudioTracksUpdated=function(x,f){var w=f.audioTracks;this.resetTransmuxer(),this.levels=w.map(function(v){return new n.Level(v)})},C.onAudioTrackSwitching=function(x,f){var w=!!f.url;this.trackId=f.id;var v=this.fragCurrent;v!=null&&v.loader&&v.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),w?this.setInterval(E):this.resetTransmuxer(),w?(this.audioSwitch=!0,this.state=U.State.IDLE):this.state=U.State.STOPPED,this.tick()},C.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},C.onLevelLoaded=function(x,f){this.mainDetails=f.details},C.onAudioTrackLoaded=function(x,f){var w,v=this.levels,b=f.details,F=f.id;if(!v){this.warn("Audio tracks were reset while loading level "+F);return}this.log("Track "+F+" loaded ["+b.startSN+","+b.endSN+"],duration:"+b.totalduration);var B=v[F],R=0;if(b.live||(w=B.details)!==null&&w!==void 0&&w.live){var j=this.mainDetails;if(b.fragments[0]||(b.deltaUpdateFailed=!0),b.deltaUpdateFailed||!j)return;!B.details&&b.hasProgramDateTime&&j.hasProgramDateTime?(Object(c.alignMediaPlaylistByPDT)(b,j),R=b.fragments[0].start):R=this.alignPlaylists(b,B.details)}B.details=b,this.levelLastLoaded=F,!this.startFragRequested&&(this.mainDetails||!b.live)&&this.setStartPosition(B.details,R),this.state===U.State.WAITING_TRACK&&!this.waitForCdnTuneIn(b)&&(this.state=U.State.IDLE),this.tick()},C._handleFragmentLoadProgress=function(x){var f,w=x.frag,v=x.part,b=x.payload,F=this.config,B=this.trackId,R=this.levels;if(!R){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+w.sn+" of level "+w.level+" will not be buffered");return}var j=R[B];console.assert(j,"Audio track is defined on fragment load progress");var N=j.details;console.assert(N,"Audio track details are defined on fragment load progress");var y=F.defaultAudioCodec||j.audioCodec||"mp4a.40.2",Y=this.transmuxer;Y||(Y=this.transmuxer=new m.default(this.hls,D.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var ee=this.initPTS[w.cc],ae=(f=w.initSegment)===null||f===void 0?void 0:f.data;if(ee!==void 0){var ue=!1,Re=v?v.index:-1,Ee=Re!==-1,xe=new h.ChunkMetadata(w.level,w.sn,w.stats.chunkCount,b.byteLength,Re,Ee);Y.push(b,ae,y,"",w,v,N.totalduration,ue,xe,ee)}else{u.logger.log("Unknown video PTS for cc "+w.cc+", waiting for video PTS before demuxing audio frag "+w.sn+" of ["+N.startSN+" ,"+N.endSN+"],track "+B);var Ce=this.waitingData=this.waitingData||{frag:w,part:v,cache:new p.default,complete:!1},Oe=Ce.cache;Oe.push(new Uint8Array(b)),this.waitingVideoCC=this.videoTrackCC,this.state=U.State.WAITING_INIT_PTS}},C._handleFragmentLoadComplete=function(x){if(this.waitingData){this.waitingData.complete=!0;return}L.prototype._handleFragmentLoadComplete.call(this,x)},C.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},C.onBufferCreated=function(x,f){var w=f.tracks.audio;w&&(this.mediaBuffer=w.buffer),f.tracks.video&&(this.videoBuffer=f.tracks.video.buffer)},C.onFragBuffered=function(x,f){var w=f.frag,v=f.part;if(w.type!==D.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(w)){this.warn("Fragment "+w.sn+(v?" p: "+v.index:"")+" of level "+w.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}w.sn!=="initSegment"&&(this.fragPrevious=w,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(k.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(w,v)},C.onError=function(x,f){switch(f.details){case l.ErrorDetails.FRAG_LOAD_ERROR:case l.ErrorDetails.FRAG_LOAD_TIMEOUT:case l.ErrorDetails.KEY_LOAD_ERROR:case l.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(D.PlaylistLevelType.AUDIO,f);break;case l.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case l.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==U.State.ERROR&&this.state!==U.State.STOPPED&&(this.state=f.fatal?U.State.ERROR:U.State.IDLE,this.warn(f.details+" while loading frag, switching to "+this.state+" state"));break;case l.ErrorDetails.BUFFER_FULL_ERROR:if(f.parent==="audio"&&(this.state===U.State.PARSING||this.state===U.State.PARSED)){var w=!0,v=this.getFwdBufferInfo(this.mediaBuffer,D.PlaylistLevelType.AUDIO);v&&v.len>.5&&(w=!this.reduceMaxBufferLength(v.len)),w&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,L.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},C.onBufferFlushed=function(x,f){var w=f.type;w===g.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},C._handleTransmuxComplete=function(x){var f,w="audio",v=this.hls,b=x.remuxResult,F=x.chunkMeta,B=this.getCurrentContext(F);if(!B){this.warn("The loading context changed while buffering fragment "+F.sn+" of level "+F.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(F.level);return}var R=B.frag,j=B.part,N=b.audio,y=b.text,Y=b.id3,ee=b.initSegment;if(this.fragContextChanged(R))return;if(this.state=U.State.PARSING,this.audioSwitch&&N&&this.completeAudioSwitch(),ee!=null&&ee.tracks&&(this._bufferInitSegment(ee.tracks,R,F),v.trigger(k.Events.FRAG_PARSING_INIT_SEGMENT,{frag:R,id:w,tracks:ee.tracks})),N){var ae=N.startPTS,ue=N.endPTS,Re=N.startDTS,Ee=N.endDTS;j&&(j.elementaryStreams[g.ElementaryStreamTypes.AUDIO]={startPTS:ae,endPTS:ue,startDTS:Re,endDTS:Ee}),R.setElementaryStreamInfo(g.ElementaryStreamTypes.AUDIO,ae,ue,Re,Ee),this.bufferFragmentData(N,R,j,F)}if(Y!=null&&(f=Y.samples)!==null&&f!==void 0&&f.length){var xe=s({frag:R,id:w},Y);v.trigger(k.Events.FRAG_PARSING_METADATA,xe)}if(y){var Ce=s({frag:R,id:w},y);v.trigger(k.Events.FRAG_PARSING_USERDATA,Ce)}},C._bufferInitSegment=function(x,f,w){if(this.state!==U.State.PARSING)return;x.video&&delete x.video;var v=x.audio;if(!v)return;v.levelCodec=v.codec,v.id="audio",this.log("Init audio buffer, container:"+v.container+", codecs[parsed]=["+v.codec+"]"),this.hls.trigger(k.Events.BUFFER_CODECS,x);var b=v.initSegment;if(b!=null&&b.byteLength){var F={type:"audio",frag:f,part:null,chunkMeta:w,parent:f.type,data:b};this.hls.trigger(k.Events.BUFFER_APPENDING,F)}this.tick()},C.loadFragment=function(x,f,w){var v=this.fragmentTracker.getState(x);this.fragCurrent=x,(this.audioSwitch||v===H.FragmentState.NOT_LOADED||v===H.FragmentState.PARTIAL)&&(x.sn==="initSegment"?this._loadInitSegment(x):f.live&&!Object(X.isFiniteNumber)(this.initPTS[x.cc])?(this.log("Waiting for video PTS in continuity counter "+x.cc+" of live stream before loading audio fragment "+x.sn+" of level "+this.trackId),this.state=U.State.WAITING_INIT_PTS):(this.startFragRequested=!0,L.prototype.loadFragment.call(this,x,f,w)))},C.completeAudioSwitch=function(){var x=this.hls,f=this.media,w=this.trackId;f&&(this.log("Switching audio track : flushing all audio"),L.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,x.trigger(k.Events.AUDIO_TRACK_SWITCHED,{id:w})},O}(U.default);$.default=S},"./src/controller/audio-track-controller.ts":function(re,$,P){"use strict";P.r($);var X=P("./src/events.ts"),U=P("./src/errors.ts"),k=P("./src/controller/base-playlist-controller.ts"),G=P("./src/types/loader.ts");function H(m,h){for(var o=0;o<h.length;o++){var c=h[o];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(m,c.key,c)}}function n(m,h,o){return h&&H(m.prototype,h),o&&H(m,o),m}function D(m,h){m.prototype=Object.create(h.prototype),m.prototype.constructor=m,g(m,h)}function g(m,h){return g=Object.setPrototypeOf||function(c,l){return c.__proto__=l,c},g(m,h)}var p=function(m){D(h,m);function h(c){var l;return l=m.call(this,c,"[audio-track-controller]")||this,l.tracks=[],l.groupId=null,l.tracksInGroup=[],l.trackId=-1,l.trackName="",l.selectDefaultTrack=!0,l.registerListeners(),l}var o=h.prototype;return o.registerListeners=function(){var l=this.hls;l.on(X.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.on(X.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.on(X.Events.LEVEL_LOADING,this.onLevelLoading,this),l.on(X.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),l.on(X.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),l.on(X.Events.ERROR,this.onError,this)},o.unregisterListeners=function(){var l=this.hls;l.off(X.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.off(X.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.off(X.Events.LEVEL_LOADING,this.onLevelLoading,this),l.off(X.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),l.off(X.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),l.off(X.Events.ERROR,this.onError,this)},o.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,m.prototype.destroy.call(this)},o.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},o.onManifestParsed=function(l,u){this.tracks=u.audioTracks||[]},o.onAudioTrackLoaded=function(l,u){var s=u.id,a=u.details,A=this.tracksInGroup[s];if(!A){this.warn("Invalid audio track id "+s);return}var E=A.details;A.details=u.details,this.log("audioTrack "+s+" loaded ["+a.startSN+"-"+a.endSN+"]"),s===this.trackId&&(this.retryCount=0,this.playlistLoaded(s,u,E))},o.onLevelLoading=function(l,u){this.switchLevel(u.level)},o.onLevelSwitching=function(l,u){this.switchLevel(u.level)},o.switchLevel=function(l){var u=this.hls.levels[l];if(!(u!=null&&u.audioGroupIds))return;var s=u.audioGroupIds[u.urlId];if(this.groupId!==s){this.groupId=s;var a=this.tracks.filter(function(E){return!s||E.groupId===s});this.selectDefaultTrack&&!a.some(function(E){return E.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=a;var A={audioTracks:a};this.log("Updating audio tracks, "+a.length+' track(s) found in "'+s+'" group-id'),this.hls.trigger(X.Events.AUDIO_TRACKS_UPDATED,A),this.selectInitialTrack()}},o.onError=function(l,u){if(m.prototype.onError.call(this,l,u),u.fatal||!u.context)return;u.context.type===G.PlaylistContextType.AUDIO_TRACK&&u.context.id===this.trackId&&u.context.groupId===this.groupId&&this.retryLoadingOrFail(u)},o.setAudioTrack=function(l){var u=this.tracksInGroup;if(l<0||l>=u.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var s=u[this.trackId];this.log("Now switching to audio-track index "+l);var a=u[l],A=a.id,E=a.groupId,S=E===void 0?"":E,L=a.name,O=a.type,C=a.url;if(this.trackId=l,this.trackName=L,this.selectDefaultTrack=!1,this.hls.trigger(X.Events.AUDIO_TRACK_SWITCHING,{id:A,groupId:S,name:L,type:O,url:C}),a.details&&!a.details.live)return;var T=this.switchParams(a.url,s==null?void 0:s.details);this.loadPlaylist(T)},o.selectInitialTrack=function(){var l=this.tracksInGroup;console.assert(l.length,"Initial audio track should be selected when tracks are known");var u=this.trackName,s=this.findTrackId(u)||this.findTrackId();s!==-1?this.setAudioTrack(s):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(X.Events.ERROR,{type:U.ErrorTypes.MEDIA_ERROR,details:U.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},o.findTrackId=function(l){for(var u=this.tracksInGroup,s=0;s<u.length;s++){var a=u[s];if((!this.selectDefaultTrack||a.default)&&(!l||l===a.name))return a.id}return-1},o.loadPlaylist=function(l){var u=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(u)){var s=u.id,a=u.groupId,A=u.url;if(l)try{A=l.addDirectives(A)}catch(E){this.warn("Could not construct new URL with HLS Delivery Directives: "+E)}this.log("loading audio-track playlist for id: "+s),this.clearTimer(),this.hls.trigger(X.Events.AUDIO_TRACK_LOADING,{url:A,id:s,groupId:a,deliveryDirectives:l||null})}},n(h,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(l){this.selectDefaultTrack=!1,this.setAudioTrack(l)}}]),h}(k.default);$.default=p},"./src/controller/base-playlist-controller.ts":function(re,$,P){"use strict";P.r($),P.d($,"default",function(){return n});var X=P("./src/polyfills/number.ts"),U=P("./src/types/level.ts"),k=P("./src/controller/level-helper.ts"),G=P("./src/utils/logger.ts"),H=P("./src/errors.ts"),n=function(){function D(p,m){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=G.logger.log.bind(G.logger,m+":"),this.warn=G.logger.warn.bind(G.logger,m+":"),this.hls=p}var g=D.prototype;return g.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},g.onError=function(m,h){h.fatal&&h.type===H.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},g.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},g.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},g.stopLoad=function(){this.canLoad=!1,this.clearTimer()},g.switchParams=function(m,h){var o=h==null?void 0:h.renditionReports;if(o)for(var c=0;c<o.length;c++){var l=o[c],u=""+l.URI;if(u===m.substr(-u.length)){var s=parseInt(l["LAST-MSN"]),a=parseInt(l["LAST-PART"]);if(h&&this.hls.config.lowLatencyMode){var A=Math.min(h.age-h.partTarget,h.targetduration);a!==void 0&&A>h.partTarget&&(a+=1)}if(Object(X.isFiniteNumber)(s))return new U.HlsUrlParameters(s,Object(X.isFiniteNumber)(a)?a:void 0,U.HlsSkip.No)}}},g.loadPlaylist=function(m){},g.shouldLoadTrack=function(m){return this.canLoad&&m&&!!m.url&&(!m.details||m.details.live)},g.playlistLoaded=function(m,h,o){var c=this,l=h.details,u=h.stats,s=u.loading.end?Math.max(0,self.performance.now()-u.loading.end):0;if(l.advancedDateTime=Date.now()-s,l.live||o!=null&&o.live){if(l.reloaded(o),o&&this.log("live playlist "+m+" "+(l.advanced?"REFRESHED "+l.lastPartSn+"-"+l.lastPartIndex:"MISSED")),o&&l.fragments.length>0&&Object(k.mergeDetails)(o,l),!this.canLoad||!l.live)return;var a,A=void 0,E=void 0;if(l.canBlockReload&&l.endSN&&l.advanced){var S=this.hls.config.lowLatencyMode,L=l.lastPartSn,O=l.endSN,C=l.lastPartIndex,T=C!==-1,x=L===O,f=S?0:C;T?(A=x?O+1:L,E=x?f:C+1):A=O+1;var w=l.age,v=w+l.ageHeader,b=Math.min(v-l.partTarget,l.targetduration*1.5);if(b>0){if(o&&b>o.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+o.tuneInGoal+" to: "+b+" with playlist age: "+l.age),b=0;else{var F=Math.floor(b/l.targetduration);if(A+=F,E!==void 0){var B=Math.round(b%l.targetduration/l.partTarget);E+=B}this.log("CDN Tune-in age: "+l.ageHeader+"s last advanced "+w.toFixed(2)+"s goal: "+b+" skip sn "+F+" to part "+E)}l.tuneInGoal=b}if(a=this.getDeliveryDirectives(l,h.deliveryDirectives,A,E),S||!x){this.loadPlaylist(a);return}}else a=this.getDeliveryDirectives(l,h.deliveryDirectives,A,E);var R=Object(k.computeReloadInterval)(l,u);A!==void 0&&l.canBlockReload&&(R-=l.partTarget||1),this.log("reload live playlist "+m+" in "+Math.round(R)+" ms"),this.timer=self.setTimeout(function(){return c.loadPlaylist(a)},R)}else this.clearTimer()},g.getDeliveryDirectives=function(m,h,o,c){var l=Object(U.getSkipValue)(m,o);return h!=null&&h.skip&&m.deltaUpdateFailed&&(o=h.msn,c=h.part,l=U.HlsSkip.No),new U.HlsUrlParameters(o,c,l)},g.retryLoadingOrFail=function(m){var h=this,o=this.hls.config,c=this.retryCount<o.levelLoadingMaxRetry;if(c){var l;if(this.retryCount++,m.details.indexOf("LoadTimeOut")>-1&&(l=m.context)!==null&&l!==void 0&&l.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+m.details+'"'),this.loadPlaylist();else{var u=Math.min(Math.pow(2,this.retryCount)*o.levelLoadingRetryDelay,o.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return h.loadPlaylist()},u),this.warn("retry playlist loading #"+this.retryCount+" in "+u+' ms after "'+m.details+'"')}}else this.warn('cannot recover from error "'+m.details+'"'),this.clearTimer(),m.fatal=!0;return c},D}()},"./src/controller/base-stream-controller.ts":function(re,$,P){"use strict";P.r($),P.d($,"State",function(){return O}),P.d($,"default",function(){return C});var X=P("./src/polyfills/number.ts"),U=P("./src/task-loop.ts"),k=P("./src/controller/fragment-tracker.ts"),G=P("./src/utils/buffer-helper.ts"),H=P("./src/utils/logger.ts"),n=P("./src/events.ts"),D=P("./src/errors.ts"),g=P("./src/types/transmuxer.ts"),p=P("./src/utils/mp4-tools.ts"),m=P("./src/utils/discontinuities.ts"),h=P("./src/controller/fragment-finders.ts"),o=P("./src/controller/level-helper.ts"),c=P("./src/loader/fragment-loader.ts"),l=P("./src/crypt/decrypter.ts"),u=P("./src/utils/time-ranges.ts"),s=P("./src/types/loader.ts");function a(T,x){for(var f=0;f<x.length;f++){var w=x[f];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(T,w.key,w)}}function A(T,x,f){return x&&a(T.prototype,x),f&&a(T,f),T}function E(T){if(T===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return T}function S(T,x){T.prototype=Object.create(x.prototype),T.prototype.constructor=T,L(T,x)}function L(T,x){return L=Object.setPrototypeOf||function(w,v){return w.__proto__=v,w},L(T,x)}var O={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",BACKTRACKING:"BACKTRACKING",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"},C=function(T){S(x,T);function x(w,v,b){var F;return F=T.call(this)||this,F.hls=void 0,F.fragPrevious=null,F.fragCurrent=null,F.fragmentTracker=void 0,F.transmuxer=null,F._state=O.STOPPED,F.media=void 0,F.mediaBuffer=void 0,F.config=void 0,F.bitrateTest=!1,F.lastCurrentTime=0,F.nextLoadPosition=0,F.startPosition=0,F.loadedmetadata=!1,F.fragLoadError=0,F.retryDate=0,F.levels=null,F.fragmentLoader=void 0,F.levelLastLoaded=null,F.startFragRequested=!1,F.decrypter=void 0,F.initPTS=[],F.onvseeking=null,F.onvended=null,F.logPrefix="",F.log=void 0,F.warn=void 0,F.logPrefix=b,F.log=H.logger.log.bind(H.logger,b+":"),F.warn=H.logger.warn.bind(H.logger,b+":"),F.hls=w,F.fragmentLoader=new c.default(w.config),F.fragmentTracker=v,F.config=w.config,F.decrypter=new l.default(w,w.config),w.on(n.Events.KEY_LOADED,F.onKeyLoaded,E(F)),F}var f=x.prototype;return f.doTick=function(){this.onTickEnd()},f.onTickEnd=function(){},f.startLoad=function(v){},f.stopLoad=function(){this.fragmentLoader.abort();var v=this.fragCurrent;v&&this.fragmentTracker.removeFragment(v),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=O.STOPPED},f._streamEnded=function(v,b){var F=this.fragCurrent,B=this.fragmentTracker;if(!b.live&&F&&F.sn===b.endSN&&!v.nextStart){var R=B.getState(F);return R===k.FragmentState.PARTIAL||R===k.FragmentState.OK}return!1},f.onMediaAttached=function(v,b){var F=this.media=this.mediaBuffer=b.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),F.addEventListener("seeking",this.onvseeking),F.addEventListener("ended",this.onvended);var B=this.config;this.levels&&B.autoStartLoad&&this.state===O.STOPPED&&this.startLoad(B.startPosition)},f.onMediaDetaching=function(){var v=this.media;v!=null&&v.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),v&&(v.removeEventListener("seeking",this.onvseeking),v.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},f.onMediaSeeking=function(){var v=this.config,b=this.fragCurrent,F=this.media,B=this.mediaBuffer,R=this.state,j=F?F.currentTime:0,N=G.BufferHelper.bufferInfo(B||F,j,v.maxBufferHole);if(this.log("media seeking to "+(Object(X.isFiniteNumber)(j)?j.toFixed(3):j)+", state: "+R),R===O.ENDED)this.resetLoadingState();else if(b&&!N.len){var y=v.maxFragLookUpTolerance,Y=b.start-y,ee=b.start+b.duration+y,ae=j>ee;(j<Y||ae)&&(ae&&b.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),b.loader.abort()),this.resetLoadingState())}F&&(this.lastCurrentTime=j),!this.loadedmetadata&&!N.len&&(this.nextLoadPosition=this.startPosition=j),this.tickImmediate()},f.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},f.onKeyLoaded=function(v,b){if(this.state!==O.KEY_LOADING||b.frag!==this.fragCurrent||!this.levels)return;this.state=O.IDLE;var F=this.levels[b.frag.level].details;F&&this.loadFragment(b.frag,F,b.frag.start)},f.onHandlerDestroying=function(){this.stopLoad(),T.prototype.onHandlerDestroying.call(this)},f.onHandlerDestroyed=function(){this.state=O.STOPPED,this.hls.off(n.Events.KEY_LOADED,this.onKeyLoaded,this),this.fragmentLoader&&this.fragmentLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.fragmentLoader=this.fragmentTracker=null,T.prototype.onHandlerDestroyed.call(this)},f.loadKey=function(v,b){this.log("Loading key for "+v.sn+" of ["+b.startSN+"-"+b.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+v.level),this.state=O.KEY_LOADING,this.fragCurrent=v,this.hls.trigger(n.Events.KEY_LOADING,{frag:v})},f.loadFragment=function(v,b,F){this._loadFragForPlayback(v,b,F)},f._loadFragForPlayback=function(v,b,F){var B=this,R=function(N){if(B.fragContextChanged(v)){B.warn("Fragment "+v.sn+(N.part?" p: "+N.part.index:"")+" of level "+v.level+" was dropped during download."),B.fragmentTracker.removeFragment(v);return}v.stats.chunkCount++,B._handleFragmentLoadProgress(N)};this._doFragLoad(v,b,F,R).then(function(j){if(!j)return;B.fragLoadError=0;var N=B.state;if(B.fragContextChanged(v)){(N===O.FRAG_LOADING||N===O.BACKTRACKING||!B.fragCurrent&&N===O.PARSING)&&(B.fragmentTracker.removeFragment(v),B.state=O.IDLE);return}if("payload"in j&&(B.log("Loaded fragment "+v.sn+" of level "+v.level),B.hls.trigger(n.Events.FRAG_LOADED,j),B.state===O.BACKTRACKING)){B.fragmentTracker.backtrack(v,j),B.resetFragmentLoading(v);return}B._handleFragmentLoadComplete(j)}).catch(function(j){B.warn(j),B.resetFragmentLoading(v)})},f.flushMainBuffer=function(v,b,F){if(F===void 0&&(F=null),!(v-b))return;var B={startOffset:v,endOffset:b,type:F};this.fragLoadError=0,this.hls.trigger(n.Events.BUFFER_FLUSHING,B)},f._loadInitSegment=function(v){var b=this;this._doFragLoad(v).then(function(F){if(!F||b.fragContextChanged(v)||!b.levels)throw new Error("init load aborted");return F}).then(function(F){var B=b.hls,R=F.payload,j=v.decryptdata;if(R&&R.byteLength>0&&j&&j.key&&j.iv&&j.method==="AES-128"){var N=self.performance.now();return b.decrypter.webCryptoDecrypt(new Uint8Array(R),j.key.buffer,j.iv.buffer).then(function(y){var Y=self.performance.now();return B.trigger(n.Events.FRAG_DECRYPTED,{frag:v,payload:y,stats:{tstart:N,tdecrypt:Y}}),F.payload=y,F})}return F}).then(function(F){var B=b.fragCurrent,R=b.hls,j=b.levels;if(!j)throw new Error("init load aborted, missing levels");var N=j[v.level].details;console.assert(N,"Level details are defined when init segment is loaded");var y=v.stats;b.state=O.IDLE,b.fragLoadError=0,v.data=new Uint8Array(F.payload),y.parsing.start=y.buffering.start=self.performance.now(),y.parsing.end=y.buffering.end=self.performance.now(),F.frag===B&&R.trigger(n.Events.FRAG_BUFFERED,{stats:y,frag:B,part:null,id:v.type}),b.tick()}).catch(function(F){b.warn(F),b.resetFragmentLoading(v)})},f.fragContextChanged=function(v){var b=this.fragCurrent;return!v||!b||v.level!==b.level||v.sn!==b.sn||v.urlId!==b.urlId},f.fragBufferedComplete=function(v,b){var F=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+v.type+" sn: "+v.sn+(b?" part: "+b.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+v.level+" "+u.default.toString(G.BufferHelper.getBuffered(F))),this.state=O.IDLE,this.tick()},f._handleFragmentLoadComplete=function(v){var b=this.transmuxer;if(!b)return;var F=v.frag,B=v.part,R=v.partsLoaded,j=!R||R.length===0||R.some(function(y){return!y}),N=new g.ChunkMetadata(F.level,F.sn,F.stats.chunkCount+1,0,B?B.index:-1,!j);b.flush(N)},f._handleFragmentLoadProgress=function(v){},f._doFragLoad=function(v,b,F,B){var R=this;if(F===void 0&&(F=null),!this.levels)throw new Error("frag load aborted, missing levels");if(F=Math.max(v.start,F||0),this.config.lowLatencyMode&&b){var j=b.partList;if(j&&B){F>v.end&&b.fragmentHint&&(v=b.fragmentHint);var N=this.getNextPart(j,v,F);if(N>-1){var y=j[N];return this.log("Loading part sn: "+v.sn+" p: "+y.index+" cc: "+v.cc+" of playlist ["+b.startSN+"-"+b.endSN+"] parts [0-"+N+"-"+(j.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+v.level+", target: "+parseFloat(F.toFixed(3))),this.nextLoadPosition=y.start+y.duration,this.state=O.FRAG_LOADING,this.hls.trigger(n.Events.FRAG_LOADING,{frag:v,part:j[N],targetBufferTime:F}),this.doFragPartsLoad(v,j,N,B).catch(function(Y){return R.handleFragLoadError(Y)})}else if(!v.url||this.loadedEndOfParts(j,F))return Promise.resolve(null)}}return this.log("Loading fragment "+v.sn+" cc: "+v.cc+" "+(b?"of ["+b.startSN+"-"+b.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+v.level+", target: "+parseFloat(F.toFixed(3))),Object(X.isFiniteNumber)(v.sn)&&!this.bitrateTest&&(this.nextLoadPosition=v.start+v.duration),this.state=O.FRAG_LOADING,this.hls.trigger(n.Events.FRAG_LOADING,{frag:v,targetBufferTime:F}),this.fragmentLoader.load(v,B).catch(function(Y){return R.handleFragLoadError(Y)})},f.doFragPartsLoad=function(v,b,F,B){var R=this;return new Promise(function(j,N){var y=[],Y=function ee(ae){var ue=b[ae];R.fragmentLoader.loadPart(v,ue,B).then(function(Re){y[ue.index]=Re;var Ee=Re.part;R.hls.trigger(n.Events.FRAG_LOADED,Re);var xe=b[ae+1];if(xe&&xe.fragment===v)ee(ae+1);else return j({frag:v,part:Ee,partsLoaded:y})}).catch(N)};Y(F)})},f.handleFragLoadError=function(v){var b=v.data;return b&&b.details===D.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(b.frag,b.part):this.hls.trigger(n.Events.ERROR,b),null},f._handleTransmuxerFlush=function(v){var b=this.getCurrentContext(v);if(!b||this.state!==O.PARSING){this.fragCurrent||(this.state=O.IDLE);return}var F=b.frag,B=b.part,R=b.level,j=self.performance.now();F.stats.parsing.end=j,B&&(B.stats.parsing.end=j),this.updateLevelTiming(F,B,R,v.partial)},f.getCurrentContext=function(v){var b=this.levels,F=v.level,B=v.sn,R=v.part;if(!b||!b[F])return this.warn("Levels object was unset while buffering fragment "+B+" of level "+F+". The current chunk will not be buffered."),null;var j=b[F],N=R>-1?Object(o.getPartWith)(j,B,R):null,y=N?N.fragment:Object(o.getFragmentWithSN)(j,B,this.fragCurrent);return y?{frag:y,part:N,level:j}:null},f.bufferFragmentData=function(v,b,F,B){if(!v||this.state!==O.PARSING)return;var R=v.data1,j=v.data2,N=R;if(R&&j&&(N=Object(p.appendUint8Array)(R,j)),!N||!N.length)return;var y={type:v.type,frag:b,part:F,chunkMeta:B,parent:b.type,data:N};this.hls.trigger(n.Events.BUFFER_APPENDING,y),v.dropped&&v.independent&&!F&&this.flushBufferGap(b)},f.flushBufferGap=function(v){var b=this.media;if(!b)return;if(!G.BufferHelper.isBuffered(b,b.currentTime)){this.flushMainBuffer(0,v.start);return}var F=b.currentTime,B=G.BufferHelper.bufferInfo(b,F,0),R=v.duration,j=Math.min(this.config.maxFragLookUpTolerance*2,R*.25),N=Math.max(Math.min(v.start-j,B.end-j),F+j);v.start-N>j&&this.flushMainBuffer(N,v.start)},f.getFwdBufferInfo=function(v,b){var F=this.config,B=this.getLoadPosition();if(!Object(X.isFiniteNumber)(B))return null;var R=G.BufferHelper.bufferInfo(v,B,F.maxBufferHole);if(R.len===0&&R.nextStart!==void 0){var j=this.fragmentTracker.getBufferedFrag(B,b);if(j&&R.nextStart<j.end)return G.BufferHelper.bufferInfo(v,B,Math.max(R.nextStart,F.maxBufferHole))}return R},f.getMaxBufferLength=function(v){var b=this.config,F;return v?F=Math.max(8*b.maxBufferSize/v,b.maxBufferLength):F=b.maxBufferLength,Math.min(F,b.maxMaxBufferLength)},f.reduceMaxBufferLength=function(v){var b=this.config,F=v||b.maxBufferLength;return b.maxMaxBufferLength>=F?(b.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+b.maxMaxBufferLength+"s"),!0):!1},f.getNextFragment=function(v,b){var F,B,R=b.fragments,j=R.length;if(!j)return null;var N=this.config,y=R[0].start,Y;if(b.live){var ee=N.initialLiveManifestSize;if(j<ee)return this.warn("Not enough fragments to start playback (have: "+j+", need: "+ee+")"),null;!b.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(Y=this.getInitialLiveFragment(b,R),this.startPosition=Y?this.hls.liveSyncPosition||Y.start:v)}else v<=y&&(Y=R[0]);if(!Y){var ae=N.lowLatencyMode?b.partEnd:b.fragmentEnd;Y=this.getFragmentAtPosition(v,ae,b)}return(F=Y)!==null&&F!==void 0&&F.initSegment&&!((B=Y)!==null&&B!==void 0&&B.initSegment.data)&&!this.bitrateTest&&(Y=Y.initSegment),Y},f.getNextPart=function(v,b,F){for(var B=-1,R=!1,j=!0,N=0,y=v.length;N<y;N++){var Y=v[N];if(j=j&&!Y.independent,B>-1&&F<Y.start)break;var ee=Y.loaded;!ee&&(R||Y.independent||j)&&Y.fragment===b&&(B=N),R=ee}return B},f.loadedEndOfParts=function(v,b){var F=v[v.length-1];return F&&b>F.start&&F.loaded},f.getInitialLiveFragment=function(v,b){var F=this.fragPrevious,B=null;if(F){if(v.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+F.programDateTime),B=Object(h.findFragmentByPDT)(b,F.endProgramDateTime,this.config.maxFragLookUpTolerance)),!B){var R=F.sn+1;if(R>=v.startSN&&R<=v.endSN){var j=b[R-v.startSN];F.cc===j.cc&&(B=j,this.log("Live playlist, switching playlist, load frag with next SN: "+B.sn))}B||(B=Object(h.findFragWithCC)(b,F.cc),B&&this.log("Live playlist, switching playlist, load frag with same CC: "+B.sn))}}else{var N=this.hls.liveSyncPosition;N!==null&&(B=this.getFragmentAtPosition(N,this.bitrateTest?v.fragmentEnd:v.edge,v))}return B},f.getFragmentAtPosition=function(v,b,F){var B=this.config,R=this.fragPrevious,j=F.fragments,N=F.endSN,y=F.fragmentHint,Y=B.maxFragLookUpTolerance,ee=!!(B.lowLatencyMode&&F.partList&&y);ee&&y&&!this.bitrateTest&&(j=j.concat(y),N=y.sn);var ae;if(v<b){var ue=v>b-Y?0:Y;ae=Object(h.findFragmentByPTS)(R,j,v,ue)}else ae=j[j.length-1];if(ae){var Re=ae.sn-F.startSN,Ee=R&&ae.level===R.level,xe=j[Re+1],Ce=this.fragmentTracker.getState(ae);if(Ce===k.FragmentState.BACKTRACKED){ae=null;for(var Oe=Re;j[Oe]&&this.fragmentTracker.getState(j[Oe])===k.FragmentState.BACKTRACKED;)R?ae=j[Oe--]:ae=j[--Oe];ae||(ae=xe)}else R&&ae.sn===R.sn&&!ee&&(Ee&&(ae.sn<N&&this.fragmentTracker.getState(xe)!==k.FragmentState.OK?(this.log("SN "+ae.sn+" just loaded, load next one: "+xe.sn),ae=xe):ae=null))}return ae},f.synchronizeToLiveEdge=function(v){var b=this.config,F=this.media;if(!F)return;var B=this.hls.liveSyncPosition,R=F.currentTime,j=v.fragments[0].start,N=v.edge,y=R>=j-b.maxFragLookUpTolerance&&R<=N;if(B!==null&&F.duration>B&&(R<B||!y)){var Y=b.liveMaxLatencyDuration!==void 0?b.liveMaxLatencyDuration:b.liveMaxLatencyDurationCount*v.targetduration;(!y&&F.readyState<4||R<N-Y)&&(this.loadedmetadata||(this.nextLoadPosition=B),F.readyState&&(this.warn("Playback: "+R.toFixed(3)+" is located too far from the end of live sliding playlist: "+N+", reset currentTime to : "+B.toFixed(3)),F.currentTime=B))}},f.alignPlaylists=function(v,b){var F=this.levels,B=this.levelLastLoaded,R=this.fragPrevious,j=B!==null?F[B]:null,N=v.fragments.length;if(!N)return this.warn("No fragments in live playlist"),0;var y=v.fragments[0].start,Y=!b,ee=v.alignedSliding&&Object(X.isFiniteNumber)(y);if(Y||!ee&&!y){Object(m.alignStream)(R,j,v);var ae=v.fragments[0].start;return this.log("Live playlist sliding: "+ae.toFixed(2)+" start-sn: "+(b?b.startSN:"na")+"->"+v.startSN+" prev-sn: "+(R?R.sn:"na")+" fragments: "+N),ae}return y},f.waitForCdnTuneIn=function(v){var b=3;return v.live&&v.canBlockReload&&v.tuneInGoal>Math.max(v.partHoldBack,v.partTarget*b)},f.setStartPosition=function(v,b){var F=this.startPosition;if(F<b&&(F=-1),F===-1||this.lastCurrentTime===-1){var B=v.startTimeOffset;Object(X.isFiniteNumber)(B)?(F=b+B,B<0&&(F+=v.totalduration),F=Math.min(Math.max(b,F),b+v.totalduration),this.log("Start time offset "+B+" found in playlist, adjust startPosition to "+F),this.startPosition=F):v.live?F=this.hls.liveSyncPosition||b:this.startPosition=F=0,this.lastCurrentTime=F}this.nextLoadPosition=F},f.getLoadPosition=function(){var v=this.media,b=0;return this.loadedmetadata&&v?b=v.currentTime:this.nextLoadPosition&&(b=this.nextLoadPosition),b},f.handleFragLoadAborted=function(v,b){this.transmuxer&&v.sn!=="initSegment"&&v.stats.aborted&&(this.warn("Fragment "+v.sn+(b?" part"+b.index:"")+" of level "+v.level+" was aborted"),this.resetFragmentLoading(v))},f.resetFragmentLoading=function(v){(!this.fragCurrent||!this.fragContextChanged(v))&&(this.state=O.IDLE)},f.onFragmentOrKeyLoadError=function(v,b){if(b.fatal)return;var F=b.frag;if(!F||F.type!==v)return;var B=this.fragCurrent;console.assert(B&&F.sn===B.sn&&F.level===B.level&&F.urlId===B.urlId,"Frag load error must match current frag to retry");var R=this.config;if(this.fragLoadError+1<=R.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(F.level))return;var j=Math.min(Math.pow(2,this.fragLoadError)*R.fragLoadingRetryDelay,R.fragLoadingMaxRetryTimeout);this.warn("Fragment "+F.sn+" of "+v+" "+F.level+" failed to load, retrying in "+j+"ms"),this.retryDate=self.performance.now()+j,this.fragLoadError++,this.state=O.FRAG_LOADING_WAITING_RETRY}else b.levelRetry?(v===s.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=O.IDLE):(H.logger.error(b.details+" reaches max retry, redispatch as fatal ..."),b.fatal=!0,this.hls.stopLoad(),this.state=O.ERROR)},f.afterBufferFlushed=function(v,b,F){if(!v)return;var B=G.BufferHelper.getBuffered(v);this.fragmentTracker.detectEvictedFragments(b,B,F),this.state===O.ENDED&&this.resetLoadingState()},f.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=O.IDLE},f.resetLiveStartWhenNotLoaded=function(v){if(!this.loadedmetadata){this.startFragRequested=!1;var b=this.levels?this.levels[v].details:null;if(b!=null&&b.live)return this.startPosition=-1,this.setStartPosition(b,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},f.updateLevelTiming=function(v,b,F,B){var R=this,j=F.details;console.assert(!!j,"level.details must be defined");var N=Object.keys(v.elementaryStreams).reduce(function(y,Y){var ee=v.elementaryStreams[Y];if(ee){var ae=ee.endPTS-ee.startPTS;if(ae<=0)return R.warn("Could not parse fragment "+v.sn+" "+Y+" duration reliably ("+ae+") resetting transmuxer to fallback to playlist timing"),R.resetTransmuxer(),y||!1;var ue=B?0:Object(o.updateFragPTSDTS)(j,v,ee.startPTS,ee.endPTS,ee.startDTS,ee.endDTS);return R.hls.trigger(n.Events.LEVEL_PTS_UPDATED,{details:j,level:F,drift:ue,type:Y,frag:v,start:ee.startPTS,end:ee.endPTS}),!0}return y},!1);N?(this.state=O.PARSED,this.hls.trigger(n.Events.FRAG_PARSED,{frag:v,part:b})):this.resetLoadingState()},f.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},A(x,[{key:"state",get:function(){return this._state},set:function(v){var b=this._state;b!==v&&(this._state=v,this.log(b+"->"+v))}}]),x}(U.default)},"./src/controller/buffer-controller.ts":function(re,$,P){"use strict";P.r($),P.d($,"default",function(){return h});var X=P("./src/polyfills/number.ts"),U=P("./src/events.ts"),k=P("./src/utils/logger.ts"),G=P("./src/errors.ts"),H=P("./src/utils/buffer-helper.ts"),n=P("./src/utils/mediasource-helper.ts"),D=P("./src/loader/fragment.ts"),g=P("./src/controller/buffer-operation-queue.ts"),p=Object(n.getMediaSource)(),m=/([ha]vc.)(?:\.[^.,]+)+/,h=function(){function o(l){var u=this;this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var s=u.hls,a=u.media,A=u.mediaSource;k.logger.log("[buffer-controller]: Media source opened"),a&&(u.updateMediaElementDuration(),s.trigger(U.Events.MEDIA_ATTACHED,{media:a})),A&&A.removeEventListener("sourceopen",u._onMediaSourceOpen),u.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=l,this._initSourceBuffer(),this.registerListeners()}var c=o.prototype;return c.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},c.destroy=function(){this.unregisterListeners(),this.details=null},c.registerListeners=function(){var u=this.hls;u.on(U.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),u.on(U.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.on(U.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.on(U.Events.BUFFER_RESET,this.onBufferReset,this),u.on(U.Events.BUFFER_APPENDING,this.onBufferAppending,this),u.on(U.Events.BUFFER_CODECS,this.onBufferCodecs,this),u.on(U.Events.BUFFER_EOS,this.onBufferEos,this),u.on(U.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),u.on(U.Events.LEVEL_UPDATED,this.onLevelUpdated,this),u.on(U.Events.FRAG_PARSED,this.onFragParsed,this),u.on(U.Events.FRAG_CHANGED,this.onFragChanged,this)},c.unregisterListeners=function(){var u=this.hls;u.off(U.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),u.off(U.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.off(U.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.off(U.Events.BUFFER_RESET,this.onBufferReset,this),u.off(U.Events.BUFFER_APPENDING,this.onBufferAppending,this),u.off(U.Events.BUFFER_CODECS,this.onBufferCodecs,this),u.off(U.Events.BUFFER_EOS,this.onBufferEos,this),u.off(U.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),u.off(U.Events.LEVEL_UPDATED,this.onLevelUpdated,this),u.off(U.Events.FRAG_PARSED,this.onFragParsed,this),u.off(U.Events.FRAG_CHANGED,this.onFragChanged,this)},c._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new g.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},c.onManifestParsed=function(u,s){var a=2;(s.audio&&!s.video||!s.altAudio)&&(a=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=a,this.details=null,k.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},c.onMediaAttaching=function(u,s){var a=this.media=s.media;if(a&&p){var A=this.mediaSource=new p;A.addEventListener("sourceopen",this._onMediaSourceOpen),A.addEventListener("sourceended",this._onMediaSourceEnded),A.addEventListener("sourceclose",this._onMediaSourceClose),a.src=self.URL.createObjectURL(A),this._objectUrl=a.src}},c.onMediaDetaching=function(){var u=this.media,s=this.mediaSource,a=this._objectUrl;if(s){if(k.logger.log("[buffer-controller]: media source detaching"),s.readyState==="open")try{s.endOfStream()}catch(A){k.logger.warn("[buffer-controller]: onMediaDetaching: "+A.message+" while calling endOfStream")}this.onBufferReset(),s.removeEventListener("sourceopen",this._onMediaSourceOpen),s.removeEventListener("sourceended",this._onMediaSourceEnded),s.removeEventListener("sourceclose",this._onMediaSourceClose),u&&(a&&self.URL.revokeObjectURL(a),u.src===a?(u.removeAttribute("src"),u.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(U.Events.MEDIA_DETACHED,void 0)},c.onBufferReset=function(){var u=this;this.getSourceBufferTypes().forEach(function(s){var a=u.sourceBuffer[s];try{a&&(u.removeBufferListeners(s),u.mediaSource&&u.mediaSource.removeSourceBuffer(a),u.sourceBuffer[s]=void 0)}catch(A){k.logger.warn("[buffer-controller]: Failed to reset the "+s+" buffer",A)}}),this._initSourceBuffer()},c.onBufferCodecs=function(u,s){var a=this,A=this.getSourceBufferTypes().length;if(Object.keys(s).forEach(function(E){if(A){var S=a.tracks[E];if(S&&typeof S.buffer.changeType=="function"){var L=s[E],O=L.codec,C=L.levelCodec,T=L.container,x=(S.levelCodec||S.codec).replace(m,"$1"),f=(C||O).replace(m,"$1");if(x!==f){var w=T+";codecs="+(C||O);a.appendChangeType(E,w)}}}else a.pendingTracks[E]=s[E]}),A)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},c.appendChangeType=function(u,s){var a=this,A=this.operationQueue,E={execute:function(){var L=a.sourceBuffer[u];L&&(k.logger.log("[buffer-controller]: changing "+u+" sourceBuffer type to "+s),L.changeType(s)),A.shiftAndExecuteNext(u)},onStart:function(){},onComplete:function(){},onError:function(L){k.logger.warn("[buffer-controller]: Failed to change "+u+" SourceBuffer type",L)}};A.append(E,u)},c.onBufferAppending=function(u,s){var a=this,A=this.hls,E=this.operationQueue,S=this.tracks,L=s.data,O=s.type,C=s.frag,T=s.part,x=s.chunkMeta,f=x.buffering[O],w=self.performance.now();f.start=w;var v=C.stats.buffering,b=T?T.stats.buffering:null;v.start===0&&(v.start=w),b&&b.start===0&&(b.start=w);var F=S.audio,B=O==="audio"&&x.id===1&&(F==null?void 0:F.container)==="audio/mpeg",R={execute:function(){if(f.executeStart=self.performance.now(),B){var N=a.sourceBuffer[O];if(N){var y=C.start-N.timestampOffset;Math.abs(y)>=.1&&(k.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+C.start+" (delta: "+y+") sn: "+C.sn+")"),N.timestampOffset=C.start)}}a.appendExecutor(L,O)},onStart:function(){},onComplete:function(){var N=self.performance.now();f.executeEnd=f.end=N,v.first===0&&(v.first=N),b&&b.first===0&&(b.first=N);var y=a.sourceBuffer,Y={};for(var ee in y)Y[ee]=H.BufferHelper.getBuffered(y[ee]);a.appendError=0,a.hls.trigger(U.Events.BUFFER_APPENDED,{type:O,frag:C,part:T,chunkMeta:x,parent:C.type,timeRanges:Y})},onError:function(N){k.logger.error("[buffer-controller]: Error encountered while trying to append to the "+O+" SourceBuffer",N);var y={type:G.ErrorTypes.MEDIA_ERROR,parent:C.type,details:G.ErrorDetails.BUFFER_APPEND_ERROR,err:N,fatal:!1};N.code===DOMException.QUOTA_EXCEEDED_ERR?y.details=G.ErrorDetails.BUFFER_FULL_ERROR:(a.appendError++,y.details=G.ErrorDetails.BUFFER_APPEND_ERROR,a.appendError>A.config.appendErrorMaxRetry&&(k.logger.error("[buffer-controller]: Failed "+A.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),y.fatal=!0)),A.trigger(U.Events.ERROR,y)}};E.append(R,O)},c.onBufferFlushing=function(u,s){var a=this,A=this.operationQueue,E=function(L){return{execute:a.removeExecutor.bind(a,L,s.startOffset,s.endOffset),onStart:function(){},onComplete:function(){a.hls.trigger(U.Events.BUFFER_FLUSHED,{type:L})},onError:function(C){k.logger.warn("[buffer-controller]: Failed to remove from "+L+" SourceBuffer",C)}}};s.type?A.append(E(s.type),s.type):this.getSourceBufferTypes().forEach(function(S){A.append(E(S),S)})},c.onFragParsed=function(u,s){var a=this,A=s.frag,E=s.part,S=[],L=E?E.elementaryStreams:A.elementaryStreams;L[D.ElementaryStreamTypes.AUDIOVIDEO]?S.push("audiovideo"):(L[D.ElementaryStreamTypes.AUDIO]&&S.push("audio"),L[D.ElementaryStreamTypes.VIDEO]&&S.push("video"));var O=function(){var T=self.performance.now();A.stats.buffering.end=T,E&&(E.stats.buffering.end=T);var x=E?E.stats:A.stats;a.hls.trigger(U.Events.FRAG_BUFFERED,{frag:A,part:E,stats:x,id:A.type})};S.length===0&&k.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+A.type+" level: "+A.level+" sn: "+A.sn),this.blockBuffers(O,S)},c.onFragChanged=function(u,s){this.flushBackBuffer()},c.onBufferEos=function(u,s){var a=this,A=this.getSourceBufferTypes().reduce(function(E,S){var L=a.sourceBuffer[S];return(!s.type||s.type===S)&&(L&&!L.ended&&(L.ended=!0,k.logger.log("[buffer-controller]: "+S+" sourceBuffer now EOS"))),E&&!!(!L||L.ended)},!0);A&&this.blockBuffers(function(){var E=a.mediaSource;if(!E||E.readyState!=="open")return;E.endOfStream()})},c.onLevelUpdated=function(u,s){var a=s.details;if(!a.fragments.length)return;this.details=a,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},c.flushBackBuffer=function(){var u=this.hls,s=this.details,a=this.media,A=this.sourceBuffer;if(!a||s===null)return;var E=this.getSourceBufferTypes();if(!E.length)return;var S=s.live&&u.config.liveBackBufferLength!==null?u.config.liveBackBufferLength:u.config.backBufferLength;if(!Object(X.isFiniteNumber)(S)||S<0)return;var L=a.currentTime,O=s.levelTargetDuration,C=Math.max(S,O),T=Math.floor(L/O)*O-C;E.forEach(function(x){var f=A[x];if(f){var w=H.BufferHelper.getBuffered(f);w.length>0&&T>w.start(0)&&(u.trigger(U.Events.BACK_BUFFER_REACHED,{bufferEnd:T}),s.live&&u.trigger(U.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:T}),u.trigger(U.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:T,type:x}))}})},c.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var u=this.details,s=this.hls,a=this.media,A=this.mediaSource,E=u.fragments[0].start+u.totalduration,S=a.duration,L=Object(X.isFiniteNumber)(A.duration)?A.duration:0;u.live&&s.config.liveDurationInfinity?(k.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),A.duration=Infinity,this.updateSeekableRange(u)):(E>L&&E>S||!Object(X.isFiniteNumber)(S))&&(k.logger.log("[buffer-controller]: Updating Media Source duration to "+E.toFixed(3)),A.duration=E)},c.updateSeekableRange=function(u){var s=this.mediaSource,a=u.fragments,A=a.length;if(A&&u.live&&s!==null&&s!==void 0&&s.setLiveSeekableRange){var E=Math.max(0,a[0].start),S=Math.max(E,E+u.totalduration);s.setLiveSeekableRange(E,S)}},c.checkPendingTracks=function(){var u=this.bufferCodecEventsExpected,s=this.operationQueue,a=this.pendingTracks,A=Object.keys(a).length;if(A&&!u||A===2){this.createSourceBuffers(a),this.pendingTracks={};var E=this.getSourceBufferTypes();if(E.length===0){this.hls.trigger(U.Events.ERROR,{type:G.ErrorTypes.MEDIA_ERROR,details:G.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}E.forEach(function(S){s.executeNext(S)})}},c.createSourceBuffers=function(u){var s=this.sourceBuffer,a=this.mediaSource;if(!a)throw Error("createSourceBuffers called when mediaSource was null");var A=0;for(var E in u)if(!s[E]){var S=u[E];if(!S)throw Error("source buffer exists for track "+E+", however track does not");var L=S.levelCodec||S.codec,O=S.container+";codecs="+L;k.logger.log("[buffer-controller]: creating sourceBuffer("+O+")");try{var C=s[E]=a.addSourceBuffer(O),T=E;this.addBufferListener(T,"updatestart",this._onSBUpdateStart),this.addBufferListener(T,"updateend",this._onSBUpdateEnd),this.addBufferListener(T,"error",this._onSBUpdateError),this.tracks[E]={buffer:C,codec:L,container:S.container,levelCodec:S.levelCodec,id:S.id},A++}catch(x){k.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+x.message),this.hls.trigger(U.Events.ERROR,{type:G.ErrorTypes.MEDIA_ERROR,details:G.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:x,mimeType:O})}}A&&this.hls.trigger(U.Events.BUFFER_CREATED,{tracks:this.tracks})},c._onSBUpdateStart=function(u){var s=this.operationQueue,a=s.current(u);a.onStart()},c._onSBUpdateEnd=function(u){var s=this.operationQueue,a=s.current(u);a.onComplete(),s.shiftAndExecuteNext(u)},c._onSBUpdateError=function(u,s){k.logger.error("[buffer-controller]: "+u+" SourceBuffer error",s),this.hls.trigger(U.Events.ERROR,{type:G.ErrorTypes.MEDIA_ERROR,details:G.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var a=this.operationQueue.current(u);a&&a.onError(s)},c.removeExecutor=function(u,s,a){var A=this.media,E=this.mediaSource,S=this.operationQueue,L=this.sourceBuffer,O=L[u];if(!A||!E||!O){k.logger.warn("[buffer-controller]: Attempting to remove from the "+u+" SourceBuffer, but it does not exist"),S.shiftAndExecuteNext(u);return}var C=Object(X.isFiniteNumber)(A.duration)?A.duration:Infinity,T=Object(X.isFiniteNumber)(E.duration)?E.duration:Infinity,x=Math.max(0,s),f=Math.min(a,C,T);f>x?(k.logger.log("[buffer-controller]: Removing ["+x+","+f+"] from the "+u+" SourceBuffer"),console.assert(!O.updating,u+" sourceBuffer must not be updating"),O.remove(x,f)):S.shiftAndExecuteNext(u)},c.appendExecutor=function(u,s){var a=this.operationQueue,A=this.sourceBuffer,E=A[s];if(!E){k.logger.warn("[buffer-controller]: Attempting to append to the "+s+" SourceBuffer, but it does not exist"),a.shiftAndExecuteNext(s);return}E.ended=!1,console.assert(!E.updating,s+" sourceBuffer must not be updating"),E.appendBuffer(u)},c.blockBuffers=function(u,s){var a=this;if(s===void 0&&(s=this.getSourceBufferTypes()),!s.length){k.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(u);return}var A=this.operationQueue,E=s.map(function(S){return A.appendBlocker(S)});Promise.all(E).then(function(){u(),s.forEach(function(S){var L=a.sourceBuffer[S];(!L||!L.updating)&&A.shiftAndExecuteNext(S)})})},c.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},c.addBufferListener=function(u,s,a){var A=this.sourceBuffer[u];if(!A)return;var E=a.bind(this,u);this.listeners[u].push({event:s,listener:E}),A.addEventListener(s,E)},c.removeBufferListeners=function(u){var s=this.sourceBuffer[u];if(!s)return;this.listeners[u].forEach(function(a){s.removeEventListener(a.event,a.listener)})},o}()},"./src/controller/buffer-operation-queue.ts":function(re,$,P){"use strict";P.r($),P.d($,"default",function(){return U});var X=P("./src/utils/logger.ts"),U=function(){function k(H){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=H}var G=k.prototype;return G.append=function(n,D){var g=this.queues[D];g.push(n),g.length===1&&this.buffers[D]&&this.executeNext(D)},G.insertAbort=function(n,D){var g=this.queues[D];g.unshift(n),this.executeNext(D)},G.appendBlocker=function(n){var D,g=new Promise(function(m){D=m}),p={execute:D,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(p,n),g},G.executeNext=function(n){var D=this.buffers,g=this.queues,p=D[n],m=g[n];if(m.length){var h=m[0];try{h.execute()}catch(o){X.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),h.onError(o),(!p||!p.updating)&&(m.shift(),this.executeNext(n))}}},G.shiftAndExecuteNext=function(n){this.queues[n].shift(),this.executeNext(n)},G.current=function(n){return this.queues[n][0]},k}()},"./src/controller/cap-level-controller.ts":function(re,$,P){"use strict";P.r($);var X=P("./src/events.ts");function U(H,n){for(var D=0;D<n.length;D++){var g=n[D];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(H,g.key,g)}}function k(H,n,D){return n&&U(H.prototype,n),D&&U(H,D),H}var G=function(){function H(D){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=D,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var n=H.prototype;return n.setStreamController=function(g){this.streamController=g},n.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},n.registerListeners=function(){var g=this.hls;g.on(X.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),g.on(X.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),g.on(X.Events.MANIFEST_PARSED,this.onManifestParsed,this),g.on(X.Events.BUFFER_CODECS,this.onBufferCodecs,this),g.on(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},n.unregisterListener=function(){var g=this.hls;g.off(X.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),g.off(X.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),g.off(X.Events.MANIFEST_PARSED,this.onManifestParsed,this),g.off(X.Events.BUFFER_CODECS,this.onBufferCodecs,this),g.off(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},n.onFpsDropLevelCapping=function(g,p){H.isLevelAllowed(p.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(p.droppedLevel)},n.onMediaAttaching=function(g,p){this.media=p.media instanceof HTMLVideoElement?p.media:null},n.onManifestParsed=function(g,p){var m=this.hls;this.restrictedLevels=[],this.firstLevel=p.firstLevel,m.config.capLevelToPlayerSize&&p.video&&this.startCapping()},n.onBufferCodecs=function(g,p){var m=this.hls;m.config.capLevelToPlayerSize&&p.video&&this.startCapping()},n.onMediaDetaching=function(){this.stopCapping()},n.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var g=this.hls.levels;if(g.length){var p=this.hls;p.autoLevelCapping=this.getMaxLevel(g.length-1),p.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=p.autoLevelCapping}}},n.getMaxLevel=function(g){var p=this,m=this.hls.levels;if(!m.length)return-1;var h=m.filter(function(o,c){return H.isLevelAllowed(c,p.restrictedLevels)&&c<=g});return this.clientRect=null,H.getMaxLevelByMediaSize(h,this.mediaWidth,this.mediaHeight)},n.startCapping=function(){if(this.timer)return;this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize()},n.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},n.getDimensions=function(){if(this.clientRect)return this.clientRect;var g=this.media,p={width:0,height:0};if(g){var m=g.getBoundingClientRect();p.width=m.width,p.height=m.height,!p.width&&!p.height&&(p.width=m.right-m.left||g.width||0,p.height=m.bottom-m.top||g.height||0)}return this.clientRect=p,p},H.isLevelAllowed=function(g,p){return p===void 0&&(p=[]),p.indexOf(g)===-1},H.getMaxLevelByMediaSize=function(g,p,m){if(!g||!g.length)return-1;for(var h=function(s,a){return a?s.width!==a.width||s.height!==a.height:!0},o=g.length-1,c=0;c<g.length;c+=1){var l=g[c];if((l.width>=p||l.height>=m)&&h(l,g[c+1])){o=c;break}}return o},k(H,[{key:"mediaWidth",get:function(){return this.getDimensions().width*H.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*H.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var g=1;try{g=self.devicePixelRatio}catch(p){}return g}}]),H}();$.default=G},"./src/controller/cmcd-controller.ts":function(re,$,P){"use strict";P.r($),P.d($,"default",function(){return h});var X=P("./src/events.ts"),U=P("./src/types/cmcd.ts"),k=P("./src/utils/buffer-helper.ts"),G=P("./src/utils/logger.ts");function H(o,c){for(var l=0;l<c.length;l++){var u=c[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(o,u.key,u)}}function n(o,c,l){return c&&H(o.prototype,c),l&&H(o,l),o}function D(o,c){var l=typeof Symbol!="undefined"&&o[Symbol.iterator]||o["@@iterator"];if(l)return(l=l.call(o)).next.bind(l);if(Array.isArray(o)||(l=g(o))||c&&o&&typeof o.length=="number"){l&&(o=l);var u=0;return function(){return u>=o.length?{done:!0}:{done:!1,value:o[u++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function g(o,c){if(!o)return;if(typeof o=="string")return p(o,c);var l=Object.prototype.toString.call(o).slice(8,-1);if(l==="Object"&&o.constructor&&(l=o.constructor.name),l==="Map"||l==="Set")return Array.from(o);if(l==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l))return p(o,c)}function p(o,c){(c==null||c>o.length)&&(c=o.length);for(var l=0,u=new Array(c);l<c;l++)u[l]=o[l];return u}function m(){return m=Object.assign||function(o){for(var c=1;c<arguments.length;c++){var l=arguments[c];for(var u in l)Object.prototype.hasOwnProperty.call(l,u)&&(o[u]=l[u])}return o},m.apply(this,arguments)}var h=function(){function o(l){var u=this;this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=function(){u.initialized&&(u.starved=!0),u.buffering=!0},this.onPlaying=function(){u.initialized||(u.initialized=!0),u.buffering=!1},this.applyPlaylistData=function(A){try{u.apply(A,{ot:U.CMCDObjectType.MANIFEST,su:!u.initialized})}catch(E){G.logger.warn("Could not generate manifest CMCD data.",E)}},this.applyFragmentData=function(A){try{var E=A.frag,S=u.hls.levels[E.level],L=u.getObjectType(E),O={d:E.duration*1e3,ot:L};(L===U.CMCDObjectType.VIDEO||L===U.CMCDObjectType.AUDIO||L==U.CMCDObjectType.MUXED)&&(O.br=S.bitrate/1e3,O.tb=u.getTopBandwidth(L),O.bl=u.getBufferLength(L)),u.apply(A,O)}catch(C){G.logger.warn("Could not generate segment CMCD data.",C)}},this.hls=l;var s=this.config=l.config,a=s.cmcd;a!=null&&(s.pLoader=this.createPlaylistLoader(),s.fLoader=this.createFragmentLoader(),this.sid=a.sessionId||o.uuid(),this.cid=a.contentId,this.useHeaders=a.useHeaders===!0,this.registerListeners())}var c=o.prototype;return c.registerListeners=function(){var u=this.hls;u.on(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.on(X.Events.MEDIA_DETACHED,this.onMediaDetached,this),u.on(X.Events.BUFFER_CREATED,this.onBufferCreated,this)},c.unregisterListeners=function(){var u=this.hls;u.off(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.off(X.Events.MEDIA_DETACHED,this.onMediaDetached,this),u.off(X.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},c.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},c.onMediaAttached=function(u,s){this.media=s.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},c.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},c.onBufferCreated=function(u,s){var a,A;this.audioBuffer=(a=s.tracks.audio)===null||a===void 0?void 0:a.buffer,this.videoBuffer=(A=s.tracks.video)===null||A===void 0?void 0:A.buffer},c.createData=function(){var u;return{v:U.CMCDVersion,sf:U.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(u=this.media)===null||u===void 0?void 0:u.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},c.apply=function(u,s){s===void 0&&(s={}),m(s,this.createData());var a=s.ot===U.CMCDObjectType.INIT||s.ot===U.CMCDObjectType.VIDEO||s.ot===U.CMCDObjectType.MUXED;if(this.starved&&a&&(s.bs=!0,s.su=!0,this.starved=!1),s.su==null&&(s.su=this.buffering),this.useHeaders){var A=o.toHeaders(s);if(!Object.keys(A).length)return;u.headers||(u.headers={}),m(u.headers,A)}else{var E=o.toQuery(s);if(!E)return;u.url=o.appendQueryToUri(u.url,E)}},c.getObjectType=function(u){var s=u.type;return s==="subtitle"?U.CMCDObjectType.TIMED_TEXT:u.sn==="initSegment"?U.CMCDObjectType.INIT:s==="audio"?U.CMCDObjectType.AUDIO:s==="main"?this.hls.audioTracks.length?U.CMCDObjectType.VIDEO:U.CMCDObjectType.MUXED:void 0},c.getTopBandwidth=function(u){for(var s=0,a=u===U.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,A=D(a),E;!(E=A()).done;){var S=E.value;S.bitrate>s&&(s=S.bitrate)}return s>0?s:NaN},c.getBufferLength=function(u){var s=this.hls.media,a=u===U.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!a||!s)return NaN;var A=k.BufferHelper.bufferInfo(a,s.currentTime,this.config.maxBufferHole);return A.len*1e3},c.createPlaylistLoader=function(){var u=this.config.pLoader,s=this.applyPlaylistData,a=u||this.config.loader;return function(){function A(S){this.loader=void 0,this.loader=new a(S)}var E=A.prototype;return E.destroy=function(){this.loader.destroy()},E.abort=function(){this.loader.abort()},E.load=function(L,O,C){s(L),this.loader.load(L,O,C)},n(A,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),A}()},c.createFragmentLoader=function(){var u=this.config.fLoader,s=this.applyFragmentData,a=u||this.config.loader;return function(){function A(S){this.loader=void 0,this.loader=new a(S)}var E=A.prototype;return E.destroy=function(){this.loader.destroy()},E.abort=function(){this.loader.abort()},E.load=function(L,O,C){s(L),this.loader.load(L,O,C)},n(A,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),A}()},o.uuid=function(){var u=URL.createObjectURL(new Blob),s=u.toString();return URL.revokeObjectURL(u),s.substr(s.lastIndexOf("/")+1)},o.serialize=function(u){for(var s=[],a=function(B){return!Number.isNaN(B)&&B!=null&&B!==""&&B!==!1},A=function(B){return Math.round(B)},E=function(B){return A(B/100)*100},S=function(B){return encodeURIComponent(B)},L={br:A,d:A,bl:E,dl:E,mtp:E,nor:S,rtp:E,tb:A},O=Object.keys(u||{}).sort(),C=D(O),T;!(T=C()).done;){var x=T.value,f=u[x];if(!a(f))continue;if(x==="v"&&f===1)continue;if(x=="pr"&&f===1)continue;var w=L[x];w&&(f=w(f));var v=typeof f,b=void 0;x==="ot"||x==="sf"||x==="st"?b=x+"="+f:v==="boolean"?b=x:v==="number"?b=x+"="+f:b=x+"="+JSON.stringify(f),s.push(b)}return s.join(",")},o.toHeaders=function(u){for(var s=Object.keys(u),a={},A=["Object","Request","Session","Status"],E=[{},{},{},{}],S={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},L=0,O=s;L<O.length;L++){var C=O[L],T=S[C]!=null?S[C]:1;E[T][C]=u[C]}for(var x=0;x<E.length;x++){var f=o.serialize(E[x]);f&&(a["CMCD-"+A[x]]=f)}return a},o.toQuery=function(u){return"CMCD="+encodeURIComponent(o.serialize(u))},o.appendQueryToUri=function(u,s){if(!s)return u;var a=u.includes("?")?"&":"?";return""+u+a+s},o}()},"./src/controller/eme-controller.ts":function(re,$,P){"use strict";P.r($);var X=P("./src/events.ts"),U=P("./src/errors.ts"),k=P("./src/utils/logger.ts"),G=P("./src/utils/mediakeys-helper.ts");function H(h,o){for(var c=0;c<o.length;c++){var l=o[c];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(h,l.key,l)}}function n(h,o,c){return o&&H(h.prototype,o),c&&H(h,c),h}var D=3,g=function(o,c,l){var u={audioCapabilities:[],videoCapabilities:[]};return o.forEach(function(s){u.audioCapabilities.push({contentType:'audio/mp4; codecs="'+s+'"',robustness:l.audioRobustness||""})}),c.forEach(function(s){u.videoCapabilities.push({contentType:'video/mp4; codecs="'+s+'"',robustness:l.videoRobustness||""})}),[u]},p=function(o,c,l,u){switch(o){case G.KeySystems.WIDEVINE:return g(c,l,u);default:throw new Error("Unknown key-system: "+o)}},m=function(){function h(c){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=c,this._config=c.config,this._widevineLicenseUrl=this._config.widevineLicenseUrl,this._licenseXhrSetup=this._config.licenseXhrSetup,this._licenseResponseCallback=this._config.licenseResponseCallback,this._emeEnabled=this._config.emeEnabled,this._requestMediaKeySystemAccess=this._config.requestMediaKeySystemAccessFunc,this._drmSystemOptions=this._config.drmSystemOptions,this._registerListeners()}var o=h.prototype;return o.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},o._registerListeners=function(){this.hls.on(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(X.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(X.Events.MANIFEST_PARSED,this.onManifestParsed,this)},o._unregisterListeners=function(){this.hls.off(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(X.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(X.Events.MANIFEST_PARSED,this.onManifestParsed,this)},o.getLicenseServerUrl=function(l){switch(l){case G.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+l+'"')},o._attemptKeySystemAccess=function(l,u,s){var a=this,A=p(l,u,s,this._drmSystemOptions);k.logger.log("Requesting encrypted media key-system access");var E=this.requestMediaKeySystemAccess(l,A);this.mediaKeysPromise=E.then(function(S){return a._onMediaKeySystemAccessObtained(l,S)}),E.catch(function(S){k.logger.error('Failed to obtain key-system "'+l+'" access:',S)})},o._onMediaKeySystemAccessObtained=function(l,u){var s=this;k.logger.log('Access for key-system "'+l+'" obtained');var a={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:u,mediaKeySystemDomain:l};this._mediaKeysList.push(a);var A=Promise.resolve().then(function(){return u.createMediaKeys()}).then(function(E){return a.mediaKeys=E,k.logger.log('Media-keys created for key-system "'+l+'"'),s._onMediaKeysCreated(),E});return A.catch(function(E){k.logger.error("Failed to create media-keys:",E)}),A},o._onMediaKeysCreated=function(){var l=this;this._mediaKeysList.forEach(function(u){u.mediaKeysSession||(u.mediaKeysSession=u.mediaKeys.createSession(),l._onNewMediaKeySession(u.mediaKeysSession))})},o._onNewMediaKeySession=function(l){var u=this;k.logger.log("New key-system session "+l.sessionId),l.addEventListener("message",function(s){u._onKeySessionMessage(l,s.message)},!1)},o._onKeySessionMessage=function(l,u){k.logger.log("Got EME message event, creating license request"),this._requestLicense(u,function(s){k.logger.log("Received license data (length: "+(s&&s.byteLength)+"), updating key-session"),l.update(s)})},o.onMediaEncrypted=function(l){var u=this;if(k.logger.log('Media is encrypted using "'+l.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(X.Events.ERROR,{type:U.ErrorTypes.KEY_SYSTEM_ERROR,details:U.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var s=function(A){if(!u._media)return;u._attemptSetMediaKeys(A),u._generateRequestWithPreferredKeySession(l.initDataType,l.initData)};this.mediaKeysPromise.then(s).catch(s)},o._attemptSetMediaKeys=function(l){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var u=this._mediaKeysList[0];if(!u||!u.mediaKeys){k.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(X.Events.ERROR,{type:U.ErrorTypes.KEY_SYSTEM_ERROR,details:U.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}k.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(u.mediaKeys),this._hasSetMediaKeys=!0}},o._generateRequestWithPreferredKeySession=function(l,u){var s=this,a=this._mediaKeysList[0];if(!a){k.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(X.Events.ERROR,{type:U.ErrorTypes.KEY_SYSTEM_ERROR,details:U.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(a.mediaKeysSessionInitialized){k.logger.warn("Key-Session already initialized but requested again");return}var A=a.mediaKeysSession;if(!A){k.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(X.Events.ERROR,{type:U.ErrorTypes.KEY_SYSTEM_ERROR,details:U.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!u){k.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(X.Events.ERROR,{type:U.ErrorTypes.KEY_SYSTEM_ERROR,details:U.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}k.logger.log('Generating key-session request for "'+l+'" init data type'),a.mediaKeysSessionInitialized=!0,A.generateRequest(l,u).then(function(){k.logger.debug("Key-session generation succeeded")}).catch(function(E){k.logger.error("Error generating key-session request:",E),s.hls.trigger(X.Events.ERROR,{type:U.ErrorTypes.KEY_SYSTEM_ERROR,details:U.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},o._createLicenseXhr=function(l,u,s){var a=new XMLHttpRequest;a.responseType="arraybuffer",a.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,a,l,u,s);var A=this._licenseXhrSetup;if(A)try{A.call(this.hls,a,l),A=void 0}catch(E){k.logger.error(E)}try{a.readyState||a.open("POST",l,!0),A&&A.call(this.hls,a,l)}catch(E){throw new Error("issue setting up KeySystem license XHR "+E)}return a},o._onLicenseRequestReadyStageChange=function(l,u,s,a){switch(l.readyState){case 4:if(l.status===200){this._requestLicenseFailureCount=0,k.logger.log("License request succeeded");var A=l.response,E=this._licenseResponseCallback;if(E)try{A=E.call(this.hls,l,u)}catch(L){k.logger.error(L)}a(A)}else{if(k.logger.error("License Request XHR failed ("+u+"). Status: "+l.status+" ("+l.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>D){this.hls.trigger(X.Events.ERROR,{type:U.ErrorTypes.KEY_SYSTEM_ERROR,details:U.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var S=D-this._requestLicenseFailureCount+1;k.logger.warn("Retrying license request, "+S+" attempts left"),this._requestLicense(s,a)}break}},o._generateLicenseRequestChallenge=function(l,u){switch(l.mediaKeySystemDomain){case G.KeySystems.WIDEVINE:return u}throw new Error("unsupported key-system: "+l.mediaKeySystemDomain)},o._requestLicense=function(l,u){k.logger.log("Requesting content license for key-system");var s=this._mediaKeysList[0];if(!s){k.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(X.Events.ERROR,{type:U.ErrorTypes.KEY_SYSTEM_ERROR,details:U.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var a=this.getLicenseServerUrl(s.mediaKeySystemDomain),A=this._createLicenseXhr(a,l,u);k.logger.log("Sending license request to URL: "+a);var E=this._generateLicenseRequestChallenge(s,l);A.send(E)}catch(S){k.logger.error("Failure requesting DRM license: "+S),this.hls.trigger(X.Events.ERROR,{type:U.ErrorTypes.KEY_SYSTEM_ERROR,details:U.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},o.onMediaAttached=function(l,u){if(!this._emeEnabled)return;var s=u.media;this._media=s,s.addEventListener("encrypted",this._onMediaEncrypted)},o.onMediaDetached=function(){var l=this._media,u=this._mediaKeysList;if(!l)return;l.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(u.map(function(s){if(s.mediaKeysSession)return s.mediaKeysSession.close().catch(function(){})})).then(function(){return l.setMediaKeys(null)}).catch(function(){})},o.onManifestParsed=function(l,u){if(!this._emeEnabled)return;var s=u.levels.map(function(A){return A.audioCodec}).filter(function(A){return!!A}),a=u.levels.map(function(A){return A.videoCodec}).filter(function(A){return!!A});this._attemptKeySystemAccess(G.KeySystems.WIDEVINE,s,a)},n(h,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),h}();$.default=m},"./src/controller/fps-controller.ts":function(re,$,P){"use strict";P.r($);var X=P("./src/events.ts"),U=P("./src/utils/logger.ts"),k=function(){function G(n){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=n,this.registerListeners()}var H=G.prototype;return H.setStreamController=function(D){this.streamController=D},H.registerListeners=function(){this.hls.on(X.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},H.unregisterListeners=function(){this.hls.off(X.Events.MEDIA_ATTACHING,this.onMediaAttaching)},H.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},H.onMediaAttaching=function(D,g){var p=this.hls.config;if(p.capLevelOnFPSDrop){var m=g.media instanceof self.HTMLVideoElement?g.media:null;this.media=m,m&&typeof m.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),p.fpsDroppedMonitoringPeriod)}},H.checkFPS=function(D,g,p){var m=performance.now();if(g){if(this.lastTime){var h=m-this.lastTime,o=p-this.lastDroppedFrames,c=g-this.lastDecodedFrames,l=1e3*o/h,u=this.hls;if(u.trigger(X.Events.FPS_DROP,{currentDropped:o,currentDecoded:c,totalDroppedFrames:p}),l>0&&o>u.config.fpsDroppedMonitoringThreshold*c){var s=u.currentLevel;U.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+s),s>0&&(u.autoLevelCapping===-1||u.autoLevelCapping>=s)&&(s=s-1,u.trigger(X.Events.FPS_DROP_LEVEL_CAPPING,{level:s,droppedLevel:u.currentLevel}),u.autoLevelCapping=s,this.streamController.nextLevelSwitch())}}this.lastTime=m,this.lastDroppedFrames=p,this.lastDecodedFrames=g}},H.checkFPSInterval=function(){var D=this.media;if(D)if(this.isVideoPlaybackQualityAvailable){var g=D.getVideoPlaybackQuality();this.checkFPS(D,g.totalVideoFrames,g.droppedVideoFrames)}else this.checkFPS(D,D.webkitDecodedFrameCount,D.webkitDroppedFrameCount)},G}();$.default=k},"./src/controller/fragment-finders.ts":function(re,$,P){"use strict";P.r($),P.d($,"findFragmentByPDT",function(){return k}),P.d($,"findFragmentByPTS",function(){return G}),P.d($,"fragmentWithinToleranceTest",function(){return H}),P.d($,"pdtWithinToleranceTest",function(){return n}),P.d($,"findFragWithCC",function(){return D});var X=P("./src/polyfills/number.ts"),U=P("./src/utils/binary-search.ts");function k(g,p,m){if(p===null||!Array.isArray(g)||!g.length||!Object(X.isFiniteNumber)(p))return null;var h=g[0].programDateTime;if(p<(h||0))return null;var o=g[g.length-1].endProgramDateTime;if(p>=(o||0))return null;m=m||0;for(var c=0;c<g.length;++c){var l=g[c];if(n(p,m,l))return l}return null}function G(g,p,m,h){m===void 0&&(m=0),h===void 0&&(h=0);var o=null;if(g?o=p[g.sn-p[0].sn+1]||null:m===0&&p[0].start===0&&(o=p[0]),o&&H(m,h,o)===0)return o;var c=U.default.search(p,H.bind(null,m,h));return c||o}function H(g,p,m){g===void 0&&(g=0),p===void 0&&(p=0);var h=Math.min(p,m.duration+(m.deltaPTS?m.deltaPTS:0));return m.start+m.duration-h<=g?1:m.start-h>g&&m.start?-1:0}function n(g,p,m){var h=Math.min(p,m.duration+(m.deltaPTS?m.deltaPTS:0))*1e3,o=m.endProgramDateTime||0;return o-h>g}function D(g,p){return U.default.search(g,function(m){return m.cc<p?1:m.cc>p?-1:0})}},"./src/controller/fragment-tracker.ts":function(re,$,P){"use strict";P.r($),P.d($,"FragmentState",function(){return k}),P.d($,"FragmentTracker",function(){return G});var X=P("./src/events.ts"),U=P("./src/types/loader.ts"),k;(function(D){D.NOT_LOADED="NOT_LOADED",D.BACKTRACKED="BACKTRACKED",D.APPENDING="APPENDING",D.PARTIAL="PARTIAL",D.OK="OK"})(k||(k={}));var G=function(){function D(p){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=p,this._registerListeners()}var g=D.prototype;return g._registerListeners=function(){var m=this.hls;m.on(X.Events.BUFFER_APPENDED,this.onBufferAppended,this),m.on(X.Events.FRAG_BUFFERED,this.onFragBuffered,this),m.on(X.Events.FRAG_LOADED,this.onFragLoaded,this)},g._unregisterListeners=function(){var m=this.hls;m.off(X.Events.BUFFER_APPENDED,this.onBufferAppended,this),m.off(X.Events.FRAG_BUFFERED,this.onFragBuffered,this),m.off(X.Events.FRAG_LOADED,this.onFragLoaded,this)},g.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},g.getAppendedFrag=function(m,h){if(h===U.PlaylistLevelType.MAIN){var o=this.activeFragment,c=this.activeParts;if(!o)return null;if(c)for(var l=c.length;l--;){var u=c[l],s=u?u.end:o.appendedPTS;if(u.start<=m&&s!==void 0&&m<=s)return l>9&&(this.activeParts=c.slice(l-9)),u}else if(o.start<=m&&o.appendedPTS!==void 0&&m<=o.appendedPTS)return o}return this.getBufferedFrag(m,h)},g.getBufferedFrag=function(m,h){for(var o=this.fragments,c=Object.keys(o),l=c.length;l--;){var u=o[c[l]];if((u==null?void 0:u.body.type)===h&&u.buffered){var s=u.body;if(s.start<=m&&m<=s.end)return s}}return null},g.detectEvictedFragments=function(m,h,o){var c=this;Object.keys(this.fragments).forEach(function(l){var u=c.fragments[l];if(!u)return;if(!u.buffered){u.body.type===o&&c.removeFragment(u.body);return}var s=u.range[m];if(!s)return;s.time.some(function(a){var A=!c.isTimeBuffered(a.startPTS,a.endPTS,h);return A&&c.removeFragment(u.body),A})})},g.detectPartialFragments=function(m){var h=this,o=this.timeRanges,c=m.frag,l=m.part;if(!o||c.sn==="initSegment")return;var u=n(c),s=this.fragments[u];if(!s)return;Object.keys(o).forEach(function(a){var A=c.elementaryStreams[a];if(!A)return;var E=o[a],S=l!==null||A.partial===!0;s.range[a]=h.getBufferedTimes(c,l,S,E)}),s.backtrack=s.loaded=null,Object.keys(s.range).length?s.buffered=!0:this.removeFragment(s.body)},g.fragBuffered=function(m){var h=n(m),o=this.fragments[h];o&&(o.backtrack=o.loaded=null,o.buffered=!0)},g.getBufferedTimes=function(m,h,o,c){for(var l={time:[],partial:o},u=h?h.start:m.start,s=h?h.end:m.end,a=m.minEndPTS||s,A=m.maxStartPTS||u,E=0;E<c.length;E++){var S=c.start(E)-this.bufferPadding,L=c.end(E)+this.bufferPadding;if(A>=S&&a<=L){l.time.push({startPTS:Math.max(u,c.start(E)),endPTS:Math.min(s,c.end(E))});break}else if(u<L&&s>S)l.partial=!0,l.time.push({startPTS:Math.max(u,c.start(E)),endPTS:Math.min(s,c.end(E))});else if(s<=S)break}return l},g.getPartialFragment=function(m){var h=null,o,c,l,u=0,s=this.bufferPadding,a=this.fragments;return Object.keys(a).forEach(function(A){var E=a[A];if(!E)return;H(E)&&(c=E.body.start-s,l=E.body.end+s,m>=c&&m<=l&&(o=Math.min(m-c,l-m),u<=o&&(h=E.body,u=o)))}),h},g.getState=function(m){var h=n(m),o=this.fragments[h];return o?o.buffered?H(o)?k.PARTIAL:k.OK:o.backtrack?k.BACKTRACKED:k.APPENDING:k.NOT_LOADED},g.backtrack=function(m,h){var o=n(m),c=this.fragments[o];if(!c||c.backtrack)return null;var l=c.backtrack=h||c.loaded;return c.loaded=null,l},g.getBacktrackData=function(m){var h=n(m),o=this.fragments[h];if(o){var c,l=o.backtrack;if(l!=null&&(c=l.payload)!==null&&c!==void 0&&c.byteLength)return l;this.removeFragment(m)}return null},g.isTimeBuffered=function(m,h,o){for(var c,l,u=0;u<o.length;u++){if(c=o.start(u)-this.bufferPadding,l=o.end(u)+this.bufferPadding,m>=c&&h<=l)return!0;if(h<=c)return!1}return!1},g.onFragLoaded=function(m,h){var o=h.frag,c=h.part;if(o.sn==="initSegment"||o.bitrateTest||c)return;var l=n(o);this.fragments[l]={body:o,loaded:h,backtrack:null,buffered:!1,range:Object.create(null)}},g.onBufferAppended=function(m,h){var o=this,c=h.frag,l=h.part,u=h.timeRanges;if(c.type===U.PlaylistLevelType.MAIN)if(this.activeFragment=c,l){var s=this.activeParts;s||(this.activeParts=s=[]),s.push(l)}else this.activeParts=null;this.timeRanges=u,Object.keys(u).forEach(function(a){var A=u[a];if(o.detectEvictedFragments(a,A),!l)for(var E=0;E<A.length;E++)c.appendedPTS=Math.max(A.end(E),c.appendedPTS||0)})},g.onFragBuffered=function(m,h){this.detectPartialFragments(h)},g.hasFragment=function(m){var h=n(m);return!!this.fragments[h]},g.removeFragmentsInRange=function(m,h,o){var c=this;Object.keys(this.fragments).forEach(function(l){var u=c.fragments[l];if(!u)return;if(u.buffered){var s=u.body;s.type===o&&s.start<h&&s.end>m&&c.removeFragment(s)}})},g.removeFragment=function(m){var h=n(m);m.stats.loaded=0,m.clearElementaryStreamInfo(),delete this.fragments[h]},g.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},D}();function H(D){var g,p;return D.buffered&&(((g=D.range.video)===null||g===void 0?void 0:g.partial)||((p=D.range.audio)===null||p===void 0?void 0:p.partial))}function n(D){return D.type+"_"+D.level+"_"+D.urlId+"_"+D.sn}},"./src/controller/gap-controller.ts":function(re,$,P){"use strict";P.r($),P.d($,"STALL_MINIMUM_DURATION_MS",function(){return H}),P.d($,"MAX_START_GAP_JUMP",function(){return n}),P.d($,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return D}),P.d($,"SKIP_BUFFER_RANGE_START",function(){return g}),P.d($,"default",function(){return p});var X=P("./src/utils/buffer-helper.ts"),U=P("./src/errors.ts"),k=P("./src/events.ts"),G=P("./src/utils/logger.ts"),H=250,n=2,D=.1,g=.05,p=function(){function m(o,c,l,u){this.config=void 0,this.media=void 0,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=o,this.media=c,this.fragmentTracker=l,this.hls=u}var h=m.prototype;return h.destroy=function(){this.hls=this.fragmentTracker=this.media=null},h.poll=function(c){var l=this.config,u=this.media,s=this.stalled,a=u.currentTime,A=u.seeking,E=this.seeking&&!A,S=!this.seeking&&A;if(this.seeking=A,a!==c){if(this.moved=!0,s!==null){if(this.stallReported){var L=self.performance.now()-s;G.logger.warn("playback not stuck anymore @"+a+", after "+Math.round(L)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((S||E)&&(this.stalled=null),u.paused||u.ended||u.playbackRate===0||!X.BufferHelper.getBuffered(u).length)return;var O=X.BufferHelper.bufferInfo(u,a,0),C=O.len>0,T=O.nextStart||0;if(!C&&!T)return;if(A){var x=O.len>n,f=!T||T-a>n&&!this.fragmentTracker.getPartialFragment(a);if(x||f)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var w,v=Math.max(T,O.start||0)-a,b=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,F=b==null||((w=b.details)===null||w===void 0)?void 0:w.live,B=F?b.details.targetduration*2:n;if(v>0&&v<=B){this._trySkipBufferHole(null);return}}var R=self.performance.now();if(s===null){this.stalled=R;return}var j=R-s;!A&&j>=H&&this._reportStall(O.len);var N=X.BufferHelper.bufferInfo(u,a,l.maxBufferHole);this._tryFixBufferStall(N,j)},h._tryFixBufferStall=function(c,l){var u=this.config,s=this.fragmentTracker,a=this.media,A=a.currentTime,E=s.getPartialFragment(A);if(E){var S=this._trySkipBufferHole(E);if(S)return}c.len>u.maxBufferHole&&l>u.highBufferWatchdogPeriod*1e3&&(G.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},h._reportStall=function(c){var l=this.hls,u=this.media,s=this.stallReported;s||(this.stallReported=!0,G.logger.warn("Playback stalling at @"+u.currentTime+" due to low buffer (buffer="+c+")"),l.trigger(k.Events.ERROR,{type:U.ErrorTypes.MEDIA_ERROR,details:U.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:c}))},h._trySkipBufferHole=function(c){for(var l=this.config,u=this.hls,s=this.media,a=s.currentTime,A=0,E=X.BufferHelper.getBuffered(s),S=0;S<E.length;S++){var L=E.start(S);if(a+l.maxBufferHole>=A&&a<L){var O=Math.max(L+g,s.currentTime+D);return G.logger.warn("skipping hole, adjusting currentTime from "+a+" to "+O),this.moved=!0,this.stalled=null,s.currentTime=O,c&&u.trigger(k.Events.ERROR,{type:U.ErrorTypes.MEDIA_ERROR,details:U.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+a+" to "+O,frag:c}),O}A=E.end(S)}return 0},h._tryNudgeBuffer=function(){var c=this.config,l=this.hls,u=this.media,s=u.currentTime,a=(this.nudgeRetry||0)+1;if(this.nudgeRetry=a,a<c.nudgeMaxRetry){var A=s+a*c.nudgeOffset;G.logger.warn("Nudging 'currentTime' from "+s+" to "+A),u.currentTime=A,l.trigger(k.Events.ERROR,{type:U.ErrorTypes.MEDIA_ERROR,details:U.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else G.logger.error("Playhead still not moving while enough data buffered @"+s+" after "+c.nudgeMaxRetry+" nudges"),l.trigger(k.Events.ERROR,{type:U.ErrorTypes.MEDIA_ERROR,details:U.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},m}()},"./src/controller/id3-track-controller.ts":function(re,$,P){"use strict";P.r($);var X=P("./src/events.ts"),U=P("./src/utils/texttrack-utils.ts"),k=P("./src/demux/id3.ts"),G=.25,H=function(){function n(g){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=g,this._registerListeners()}var D=n.prototype;return D.destroy=function(){this._unregisterListeners()},D._registerListeners=function(){var p=this.hls;p.on(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),p.on(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this),p.on(X.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),p.on(X.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},D._unregisterListeners=function(){var p=this.hls;p.off(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),p.off(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this),p.off(X.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),p.off(X.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},D.onMediaAttached=function(p,m){this.media=m.media},D.onMediaDetaching=function(){if(!this.id3Track)return;Object(U.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},D.getID3Track=function(p){if(!this.media)return;for(var m=0;m<p.length;m++){var h=p[m];if(h.kind==="metadata"&&h.label==="id3")return Object(U.sendAddTrackEvent)(h,this.media),h}return this.media.addTextTrack("metadata","id3")},D.onFragParsingMetadata=function(p,m){if(!this.media)return;var h=m.frag,o=m.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var c=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,l=0;l<o.length;l++){var u=k.getID3Frames(o[l].data);if(u){var s=o[l].pts,a=l<o.length-1?o[l+1].pts:h.end,A=a-s;A<=0&&(a=s+G);for(var E=0;E<u.length;E++){var S=u[E];if(!k.isTimeStampFrame(S)){var L=new c(s,a,"");L.value=S,this.id3Track.addCue(L)}}}}},D.onBufferFlushing=function(p,m){var h=m.startOffset,o=m.endOffset,c=m.type;if(!c||c==="audio"){var l=this.id3Track;l&&Object(U.removeCuesInRange)(l,h,o)}},n}();$.default=H},"./src/controller/latency-controller.ts":function(re,$,P){"use strict";P.r($),P.d($,"default",function(){return n});var X=P("./src/errors.ts"),U=P("./src/events.ts"),k=P("./src/utils/logger.ts");function G(D,g){for(var p=0;p<g.length;p++){var m=g[p];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(D,m.key,m)}}function H(D,g,p){return g&&G(D.prototype,g),p&&G(D,p),D}var n=function(){function D(p){var m=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 m.timeupdate()},this.hls=p,this.config=p.config,this.registerListeners()}var g=D.prototype;return g.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},g.registerListeners=function(){this.hls.on(U.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(U.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(U.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(U.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(U.Events.ERROR,this.onError,this)},g.unregisterListeners=function(){this.hls.off(U.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(U.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(U.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(U.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(U.Events.ERROR,this.onError)},g.onMediaAttached=function(m,h){this.media=h.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},g.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},g.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},g.onLevelUpdated=function(m,h){var o=h.details;this.levelDetails=o,o.advanced&&this.timeupdate(),!o.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},g.onError=function(m,h){if(h.details!==X.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,k.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},g.timeupdate=function(){var m=this.media,h=this.levelDetails;if(!m||!h)return;this.currentTime=m.currentTime;var o=this.computeLatency();if(o===null)return;this._latency=o;var c=this.config,l=c.lowLatencyMode,u=c.maxLiveSyncPlaybackRate;if(!l||u===1)return;var s=this.targetLatency;if(s===null)return;var a=o-s,A=Math.min(this.maxLatency,s+h.targetduration),E=a<A;if(h.live&&E&&a>.05&&this.forwardBufferLength>1){var S=Math.min(2,Math.max(1,u)),L=Math.round(2/(1+Math.exp(-.75*a-this.edgeStalled))*20)/20;m.playbackRate=Math.min(S,Math.max(1,L))}else m.playbackRate!==1&&m.playbackRate!==0&&(m.playbackRate=1)},g.estimateLiveEdge=function(){var m=this.levelDetails;return m===null?null:m.edge+m.age},g.computeLatency=function(){var m=this.estimateLiveEdge();return m===null?null:m-this.currentTime},H(D,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var m=this.config,h=this.levelDetails;return m.liveMaxLatencyDuration!==void 0?m.liveMaxLatencyDuration:h?m.liveMaxLatencyDurationCount*h.targetduration:0}},{key:"targetLatency",get:function(){var m=this.levelDetails;if(m===null)return null;var h=m.holdBack,o=m.partHoldBack,c=m.targetduration,l=this.config,u=l.liveSyncDuration,s=l.liveSyncDurationCount,a=l.lowLatencyMode,A=this.hls.userConfig,E=a&&o||h;(A.liveSyncDuration||A.liveSyncDurationCount||E===0)&&(E=u!==void 0?u:s*c);var S=c,L=1;return E+Math.min(this.stallCount*L,S)}},{key:"liveSyncPosition",get:function(){var m=this.estimateLiveEdge(),h=this.targetLatency,o=this.levelDetails;if(m===null||h===null||o===null)return null;var c=o.edge,l=m-h-this.edgeStalled,u=c-o.totalduration,s=c-(this.config.lowLatencyMode&&o.partTarget||o.targetduration);return Math.min(Math.max(u,l),s)}},{key:"drift",get:function(){var m=this.levelDetails;return m===null?1:m.drift}},{key:"edgeStalled",get:function(){var m=this.levelDetails;if(m===null)return 0;var h=(this.config.lowLatencyMode&&m.partTarget||m.targetduration)*3;return Math.max(m.age-h,0)}},{key:"forwardBufferLength",get:function(){var m=this.media,h=this.levelDetails;if(!m||!h)return 0;var o=m.buffered.length;return o?m.buffered.end(o-1):h.edge-this.currentTime}}]),D}()},"./src/controller/level-controller.ts":function(re,$,P){"use strict";P.r($),P.d($,"default",function(){return l});var X=P("./src/types/level.ts"),U=P("./src/events.ts"),k=P("./src/errors.ts"),G=P("./src/utils/codecs.ts"),H=P("./src/controller/level-helper.ts"),n=P("./src/controller/base-playlist-controller.ts"),D=P("./src/types/loader.ts");function g(){return g=Object.assign||function(u){for(var s=1;s<arguments.length;s++){var a=arguments[s];for(var A in a)Object.prototype.hasOwnProperty.call(a,A)&&(u[A]=a[A])}return u},g.apply(this,arguments)}function p(u,s){for(var a=0;a<s.length;a++){var A=s[a];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(u,A.key,A)}}function m(u,s,a){return s&&p(u.prototype,s),a&&p(u,a),u}function h(u,s){u.prototype=Object.create(s.prototype),u.prototype.constructor=u,o(u,s)}function o(u,s){return o=Object.setPrototypeOf||function(A,E){return A.__proto__=E,A},o(u,s)}var c=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),l=function(u){h(s,u);function s(A){var E;return E=u.call(this,A,"[level-controller]")||this,E._levels=[],E._firstLevel=-1,E._startLevel=void 0,E.currentLevelIndex=-1,E.manualLevelIndex=-1,E.onParsedComplete=void 0,E._registerListeners(),E}var a=s.prototype;return a._registerListeners=function(){var E=this.hls;E.on(U.Events.MANIFEST_LOADED,this.onManifestLoaded,this),E.on(U.Events.LEVEL_LOADED,this.onLevelLoaded,this),E.on(U.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),E.on(U.Events.FRAG_LOADED,this.onFragLoaded,this),E.on(U.Events.ERROR,this.onError,this)},a._unregisterListeners=function(){var E=this.hls;E.off(U.Events.MANIFEST_LOADED,this.onManifestLoaded,this),E.off(U.Events.LEVEL_LOADED,this.onLevelLoaded,this),E.off(U.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),E.off(U.Events.FRAG_LOADED,this.onFragLoaded,this),E.off(U.Events.ERROR,this.onError,this)},a.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,u.prototype.destroy.call(this)},a.startLoad=function(){var E=this._levels;E.forEach(function(S){S.loadError=0}),u.prototype.startLoad.call(this)},a.onManifestLoaded=function(E,S){var L=[],O=[],C=[],T,x={},f,w=!1,v=!1,b=!1;if(S.levels.forEach(function(j){var N=j.attrs;w=w||!!(j.width&&j.height),v=v||!!j.videoCodec,b=b||!!j.audioCodec,c&&j.audioCodec&&j.audioCodec.indexOf("mp4a.40.34")!==-1&&(j.audioCodec=void 0);var y=j.bitrate+"-"+j.attrs.RESOLUTION+"-"+j.attrs.CODECS;f=x[y],f?f.url.push(j.url):(f=new X.Level(j),x[y]=f,L.push(f)),N&&(N.AUDIO&&Object(H.addGroupId)(f,"audio",N.AUDIO),N.SUBTITLES&&Object(H.addGroupId)(f,"text",N.SUBTITLES))}),(w||v)&&b&&(L=L.filter(function(j){var N=j.videoCodec,y=j.width,Y=j.height;return!!N||!!(y&&Y)})),L=L.filter(function(j){var N=j.audioCodec,y=j.videoCodec;return(!N||Object(G.isCodecSupportedInMp4)(N,"audio"))&&(!y||Object(G.isCodecSupportedInMp4)(y,"video"))}),S.audioTracks&&(O=S.audioTracks.filter(function(j){return!j.audioCodec||Object(G.isCodecSupportedInMp4)(j.audioCodec,"audio")}),Object(H.assignTrackIdsByGroup)(O)),S.subtitles&&(C=S.subtitles,Object(H.assignTrackIdsByGroup)(C)),L.length>0){T=L[0].bitrate,L.sort(function(j,N){return j.bitrate-N.bitrate}),this._levels=L;for(var F=0;F<L.length;F++)if(L[F].bitrate===T){this._firstLevel=F,this.log("manifest loaded, "+L.length+" level(s) found, first bitrate: "+T);break}var B=b&&!v,R={levels:L,audioTracks:O,subtitleTracks:C,firstLevel:this._firstLevel,stats:S.stats,audio:b,video:v,altAudio:!B&&O.some(function(j){return!!j.url})};this.hls.trigger(U.Events.MANIFEST_PARSED,R),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(U.Events.ERROR,{type:k.ErrorTypes.MEDIA_ERROR,details:k.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:S.url,reason:"no level with compatible codecs found in manifest"})},a.onError=function(E,S){if(u.prototype.onError.call(this,E,S),S.fatal)return;var L=S.context,O=this._levels[this.currentLevelIndex];if(L&&(L.type===D.PlaylistContextType.AUDIO_TRACK&&O.audioGroupIds&&L.groupId===O.audioGroupIds[O.urlId]||L.type===D.PlaylistContextType.SUBTITLE_TRACK&&O.textGroupIds&&L.groupId===O.textGroupIds[O.urlId])){this.redundantFailover(this.currentLevelIndex);return}var C=!1,T=!0,x;switch(S.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(S.frag){var f=this._levels[S.frag.level];f?(f.fragmentError++,f.fragmentError>this.hls.config.fragLoadingMaxRetry&&(x=S.frag.level)):x=S.frag.level}break;case k.ErrorDetails.LEVEL_LOAD_ERROR:case k.ErrorDetails.LEVEL_LOAD_TIMEOUT:L&&(L.deliveryDirectives&&(T=!1),x=L.level),C=!0;break;case k.ErrorDetails.REMUX_ALLOC_ERROR:x=S.level,C=!0;break}x!==void 0&&this.recoverLevel(S,x,C,T)},a.recoverLevel=function(E,S,L,O){var C=E.details,T=this._levels[S];if(T.loadError++,L){var x=this.retryLoadingOrFail(E);if(x)E.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(O){var f=T.url.length;if(f>1&&T.loadError<f)E.levelRetry=!0,this.redundantFailover(S);else if(this.manualLevelIndex===-1){var w=S===0?this._levels.length-1:S-1;this.currentLevelIndex!==w&&this._levels[w].loadError===0&&(this.warn(C+": switch to "+w),E.levelRetry=!0,this.hls.nextAutoLevel=w)}}},a.redundantFailover=function(E){var S=this._levels[E],L=S.url.length;if(L>1){var O=(S.urlId+1)%L;this.warn("Switching to redundant URL-id "+O),this._levels.forEach(function(C){C.urlId=O}),this.level=E}},a.onFragLoaded=function(E,S){var L=S.frag;if(L!==void 0&&L.type===D.PlaylistLevelType.MAIN){var O=this._levels[L.level];O!==void 0&&(O.fragmentError=0,O.loadError=0)}},a.onLevelLoaded=function(E,S){var L,O=S.level,C=S.details,T=this._levels[O];if(!T){var x;this.warn("Invalid level index "+O),(x=S.deliveryDirectives)!==null&&x!==void 0&&x.skip&&(C.deltaUpdateFailed=!0);return}O===this.currentLevelIndex?(T.fragmentError===0&&(T.loadError=0,this.retryCount=0),this.playlistLoaded(O,S,T.details)):(L=S.deliveryDirectives)!==null&&L!==void 0&&L.skip&&(C.deltaUpdateFailed=!0)},a.onAudioTrackSwitched=function(E,S){var L=this.hls.levels[this.currentLevelIndex];if(!L)return;if(L.audioGroupIds){for(var O=-1,C=this.hls.audioTracks[S.id].groupId,T=0;T<L.audioGroupIds.length;T++)if(L.audioGroupIds[T]===C){O=T;break}O!==L.urlId&&(L.urlId=O,this.startLoad())}},a.loadPlaylist=function(E){var S=this.currentLevelIndex,L=this._levels[S];if(this.canLoad&&L&&L.url.length>0){var O=L.urlId,C=L.url[O];if(E)try{C=E.addDirectives(C)}catch(T){this.warn("Could not construct new URL with HLS Delivery Directives: "+T)}this.log("Attempt loading level index "+S+(E?" at sn "+E.msn+" part "+E.part:"")+" with URL-id "+O+" "+C),this.clearTimer(),this.hls.trigger(U.Events.LEVEL_LOADING,{url:C,level:S,id:O,deliveryDirectives:E||null})}},a.removeLevel=function(E,S){var L=function(T,x){return x!==S},O=this._levels.filter(function(C,T){return T!==E?!0:C.url.length>1&&S!==void 0?(C.url=C.url.filter(L),C.audioGroupIds&&(C.audioGroupIds=C.audioGroupIds.filter(L)),C.textGroupIds&&(C.textGroupIds=C.textGroupIds.filter(L)),C.urlId=0,!0):!1}).map(function(C,T){var x=C.details;return x!=null&&x.fragments&&x.fragments.forEach(function(f){f.level=T}),C});this._levels=O,this.hls.trigger(U.Events.LEVELS_UPDATED,{levels:O})},m(s,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(E){var S,L=this._levels;if(L.length===0)return;if(this.currentLevelIndex===E&&(S=L[E])!==null&&S!==void 0&&S.details)return;if(E<0||E>=L.length){var O=E<0;if(this.hls.trigger(U.Events.ERROR,{type:k.ErrorTypes.OTHER_ERROR,details:k.ErrorDetails.LEVEL_SWITCH_ERROR,level:E,fatal:O,reason:"invalid level idx"}),O)return;E=Math.min(E,L.length-1)}this.clearTimer();var C=this.currentLevelIndex,T=L[C],x=L[E];this.log("switching to level "+E+" from "+C),this.currentLevelIndex=E;var f=g({},x,{level:E,maxBitrate:x.maxBitrate,uri:x.uri,urlId:x.urlId});delete f._urlId,this.hls.trigger(U.Events.LEVEL_SWITCHING,f);var w=x.details;if(!w||w.live){var v=this.switchParams(x.uri,T==null?void 0:T.details);this.loadPlaylist(v)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(E){this.manualLevelIndex=E,this._startLevel===void 0&&(this._startLevel=E),E!==-1&&(this.level=E)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(E){this._firstLevel=E}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var E=this.hls.config.startLevel;return E!==void 0?E:this._firstLevel}else return this._startLevel},set:function(E){this._startLevel=E}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(E){this.level=E,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=E)}}]),s}(n.default)},"./src/controller/level-helper.ts":function(re,$,P){"use strict";P.r($),P.d($,"addGroupId",function(){return k}),P.d($,"assignTrackIdsByGroup",function(){return G}),P.d($,"updatePTS",function(){return H}),P.d($,"updateFragPTSDTS",function(){return D}),P.d($,"mergeDetails",function(){return g}),P.d($,"mapPartIntersection",function(){return p}),P.d($,"mapFragmentIntersection",function(){return m}),P.d($,"adjustSliding",function(){return h}),P.d($,"addSliding",function(){return o}),P.d($,"computeReloadInterval",function(){return c}),P.d($,"getFragmentWithSN",function(){return l}),P.d($,"getPartWith",function(){return u});var X=P("./src/polyfills/number.ts"),U=P("./src/utils/logger.ts");function k(s,a,A){switch(a){case"audio":s.audioGroupIds||(s.audioGroupIds=[]),s.audioGroupIds.push(A);break;case"text":s.textGroupIds||(s.textGroupIds=[]),s.textGroupIds.push(A);break}}function G(s){var a={};s.forEach(function(A){var E=A.groupId||"";A.id=a[E]=a[E]||0,a[E]++})}function H(s,a,A){var E=s[a],S=s[A];n(E,S)}function n(s,a){var A=a.startPTS;if(Object(X.isFiniteNumber)(A)){var E=0,S;a.sn>s.sn?(E=A-s.start,S=s):(E=s.start-A,S=a),S.duration!==E&&(S.duration=E)}else if(a.sn>s.sn){var L=s.cc===a.cc;L&&s.minEndPTS?a.start=s.start+(s.minEndPTS-s.start):a.start=s.start+s.duration}else a.start=Math.max(s.start-a.duration,0)}function D(s,a,A,E,S,L){var O=E-A;O<=0&&(U.logger.warn("Fragment should have a positive duration",a),E=A+a.duration,L=S+a.duration);var C=A,T=E,x=a.startPTS,f=a.endPTS;if(Object(X.isFiniteNumber)(x)){var w=Math.abs(x-A);Object(X.isFiniteNumber)(a.deltaPTS)?a.deltaPTS=Math.max(w,a.deltaPTS):a.deltaPTS=w,C=Math.max(A,x),A=Math.min(A,x),S=Math.min(S,a.startDTS),T=Math.min(E,f),E=Math.max(E,f),L=Math.max(L,a.endDTS)}a.duration=E-A;var v=A-a.start;a.appendedPTS=E,a.start=a.startPTS=A,a.maxStartPTS=C,a.startDTS=S,a.endPTS=E,a.minEndPTS=T,a.endDTS=L;var b=a.sn;if(!s||b<s.startSN||b>s.endSN)return 0;var F,B=b-s.startSN,R=s.fragments;for(R[B]=a,F=B;F>0;F--)n(R[F],R[F-1]);for(F=B;F<R.length-1;F++)n(R[F],R[F+1]);return s.fragmentHint&&n(R[R.length-1],s.fragmentHint),s.PTSKnown=s.alignedSliding=!0,v}function g(s,a){for(var A=null,E=s.fragments,S=E.length-1;S>=0;S--){var L=E[S].initSegment;if(L){A=L;break}}s.fragmentHint&&delete s.fragmentHint.endPTS;var O=0,C;if(m(s,a,function(F,B){F.relurl&&(O=F.cc-B.cc),Object(X.isFiniteNumber)(F.startPTS)&&Object(X.isFiniteNumber)(F.endPTS)&&(B.start=B.startPTS=F.startPTS,B.startDTS=F.startDTS,B.appendedPTS=F.appendedPTS,B.maxStartPTS=F.maxStartPTS,B.endPTS=F.endPTS,B.endDTS=F.endDTS,B.minEndPTS=F.minEndPTS,B.duration=F.endPTS-F.startPTS,B.duration&&(C=B),a.PTSKnown=a.alignedSliding=!0),B.elementaryStreams=F.elementaryStreams,B.loader=F.loader,B.stats=F.stats,B.urlId=F.urlId,F.initSegment&&(B.initSegment=F.initSegment,A=F.initSegment)}),A){var T=a.fragmentHint?a.fragments.concat(a.fragmentHint):a.fragments;T.forEach(function(F){var B;(!F.initSegment||F.initSegment.relurl===((B=A)===null||B===void 0?void 0:B.relurl))&&(F.initSegment=A)})}if(a.skippedSegments&&(a.deltaUpdateFailed=a.fragments.some(function(F){return!F}),a.deltaUpdateFailed)){U.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var x=a.skippedSegments;x--;)a.fragments.shift();a.startSN=a.fragments[0].sn,a.startCC=a.fragments[0].cc}var f=a.fragments;if(O){U.logger.warn("discontinuity sliding from playlist, take drift into account");for(var w=0;w<f.length;w++)f[w].cc+=O}a.skippedSegments&&(a.startCC=a.fragments[0].cc),p(s.partList,a.partList,function(F,B){B.elementaryStreams=F.elementaryStreams,B.stats=F.stats}),C?D(a,C,C.startPTS,C.endPTS,C.startDTS,C.endDTS):h(s,a),f.length&&(a.totalduration=a.edge-f[0].start),a.driftStartTime=s.driftStartTime,a.driftStart=s.driftStart;var v=a.advancedDateTime;if(a.advanced&&v){var b=a.edge;a.driftStart||(a.driftStartTime=v,a.driftStart=b),a.driftEndTime=v,a.driftEnd=b}else a.driftEndTime=s.driftEndTime,a.driftEnd=s.driftEnd,a.advancedDateTime=s.advancedDateTime}function p(s,a,A){if(s&&a)for(var E=0,S=0,L=s.length;S<=L;S++){var O=s[S],C=a[S+E];O&&C&&O.index===C.index&&O.fragment.sn===C.fragment.sn?A(O,C):E--}}function m(s,a,A){for(var E=a.skippedSegments,S=Math.max(s.startSN,a.startSN)-a.startSN,L=(s.fragmentHint?1:0)+(E?a.endSN:Math.min(s.endSN,a.endSN))-a.startSN,O=a.startSN-s.startSN,C=a.fragmentHint?a.fragments.concat(a.fragmentHint):a.fragments,T=s.fragmentHint?s.fragments.concat(s.fragmentHint):s.fragments,x=S;x<=L;x++){var f=T[O+x],w=C[x];E&&!w&&x<E&&(w=a.fragments[x]=f),f&&w&&A(f,w)}}function h(s,a){var A=a.startSN+a.skippedSegments-s.startSN,E=s.fragments;if(A<0||A>=E.length)return;o(a,E[A].start)}function o(s,a){if(a){for(var A=s.fragments,E=s.skippedSegments;E<A.length;E++)A[E].start+=a;s.fragmentHint&&(s.fragmentHint.start+=a)}}function c(s,a){var A=1e3*s.levelTargetDuration,E=A/2,S=s.age,L=S>0&&S<A*3,O=a.loading.end-a.loading.start,C,T=s.availabilityDelay;if(s.updated===!1)if(L){var x=333*s.misses;C=Math.max(Math.min(E,O*2),x),s.availabilityDelay=(s.availabilityDelay||0)+C}else C=E;else L?(T=Math.min(T||A/2,S),s.availabilityDelay=T,C=T+A-S):C=A-O;return Math.round(C)}function l(s,a,A){if(!s||!s.details)return null;var E=s.details,S=E.fragments[a-E.startSN];return S||(S=E.fragmentHint,S&&S.sn===a?S:a<E.startSN&&A&&A.sn===a?A:null)}function u(s,a,A){if(!s||!s.details)return null;var E=s.details.partList;if(E)for(var S=E.length;S--;){var L=E[S];if(L.index===A&&L.fragment.sn===a)return L}return null}},"./src/controller/stream-controller.ts":function(re,$,P){"use strict";P.r($),P.d($,"default",function(){return E});var X=P("./src/polyfills/number.ts"),U=P("./src/controller/base-stream-controller.ts"),k=P("./src/is-supported.ts"),G=P("./src/events.ts"),H=P("./src/utils/buffer-helper.ts"),n=P("./src/controller/fragment-tracker.ts"),D=P("./src/types/loader.ts"),g=P("./src/loader/fragment.ts"),p=P("./src/demux/transmuxer-interface.ts"),m=P("./src/types/transmuxer.ts"),h=P("./src/controller/gap-controller.ts"),o=P("./src/errors.ts"),c=P("./src/utils/logger.ts");function l(S,L){for(var O=0;O<L.length;O++){var C=L[O];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(S,C.key,C)}}function u(S,L,O){return L&&l(S.prototype,L),O&&l(S,O),S}function s(S,L){S.prototype=Object.create(L.prototype),S.prototype.constructor=S,a(S,L)}function a(S,L){return a=Object.setPrototypeOf||function(C,T){return C.__proto__=T,C},a(S,L)}var A=100,E=function(S){s(L,S);function L(C,T){var x;return x=S.call(this,C,T,"[stream-controller]")||this,x.audioCodecSwap=!1,x.gapController=null,x.level=-1,x._forceStartLoad=!1,x.altAudio=!1,x.audioOnly=!1,x.fragPlaying=null,x.onvplaying=null,x.onvseeked=null,x.fragLastKbps=0,x.stalled=!1,x.couldBacktrack=!1,x.audioCodecSwitch=!1,x.videoBuffer=null,x._registerListeners(),x}var O=L.prototype;return O._registerListeners=function(){var T=this.hls;T.on(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),T.on(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),T.on(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),T.on(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),T.on(G.Events.LEVEL_LOADING,this.onLevelLoading,this),T.on(G.Events.LEVEL_LOADED,this.onLevelLoaded,this),T.on(G.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),T.on(G.Events.ERROR,this.onError,this),T.on(G.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),T.on(G.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),T.on(G.Events.BUFFER_CREATED,this.onBufferCreated,this),T.on(G.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),T.on(G.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),T.on(G.Events.FRAG_BUFFERED,this.onFragBuffered,this)},O._unregisterListeners=function(){var T=this.hls;T.off(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),T.off(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),T.off(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),T.off(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),T.off(G.Events.LEVEL_LOADED,this.onLevelLoaded,this),T.off(G.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),T.off(G.Events.ERROR,this.onError,this),T.off(G.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),T.off(G.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),T.off(G.Events.BUFFER_CREATED,this.onBufferCreated,this),T.off(G.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),T.off(G.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),T.off(G.Events.FRAG_BUFFERED,this.onFragBuffered,this)},O.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},O.startLoad=function(T){if(this.levels){var x=this.lastCurrentTime,f=this.hls;if(this.stopLoad(),this.setInterval(A),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var w=f.startLevel;w===-1&&(f.config.testBandwidth?(w=0,this.bitrateTest=!0):w=f.nextAutoLevel),this.level=f.nextLoadLevel=w,this.loadedmetadata=!1}x>0&&T===-1&&(this.log("Override startPosition with lastCurrentTime @"+x.toFixed(3)),T=x),this.state=U.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=T,this.tick()}else this._forceStartLoad=!0,this.state=U.State.STOPPED},O.stopLoad=function(){this._forceStartLoad=!1,S.prototype.stopLoad.call(this)},O.doTick=function(){switch(this.state){case U.State.IDLE:this.doTickIdle();break;case U.State.WAITING_LEVEL:{var T,x=this.levels,f=this.level,w=x==null||((T=x[f])===null||T===void 0)?void 0:T.details;if(w&&(!w.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(w))break;this.state=U.State.IDLE;break}break}case U.State.FRAG_LOADING_WAITING_RETRY:{var v,b=self.performance.now(),F=this.retryDate;(!F||b>=F||(v=this.media)!==null&&v!==void 0&&v.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=U.State.IDLE)}break;default:break}this.onTickEnd()},O.onTickEnd=function(){S.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},O.doTickIdle=function(){var T,x,f=this.hls,w=this.levelLastLoaded,v=this.levels,b=this.media,F=f.config,B=f.nextLoadLevel;if(w===null||!b&&(this.startFragRequested||!F.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!v||!v[B])return;var R=v[B];this.level=f.nextLoadLevel=B;var j=R.details;if(!j||this.state===U.State.WAITING_LEVEL||j.live&&this.levelLastLoaded!==B){this.state=U.State.WAITING_LEVEL;return}var N=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:b,D.PlaylistLevelType.MAIN);if(N===null)return;var y=N.len,Y=this.getMaxBufferLength(R.maxBitrate);if(y>=Y)return;if(this._streamEnded(N,j)){var ee={};this.altAudio&&(ee.type="video"),this.hls.trigger(G.Events.BUFFER_EOS,ee),this.state=U.State.ENDED;return}var ae=N.end,ue=this.getNextFragment(ae,j);if(this.couldBacktrack&&!this.fragPrevious&&ue&&ue.sn!=="initSegment"){var Re=ue.sn-j.startSN;Re>1&&(ue=j.fragments[Re-1],this.fragmentTracker.removeFragment(ue))}if(ue&&this.fragmentTracker.getState(ue)===n.FragmentState.OK&&this.nextLoadPosition>ae){var Ee=this.audioOnly&&!this.altAudio?g.ElementaryStreamTypes.AUDIO:g.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(b,Ee,D.PlaylistLevelType.MAIN),ue=this.getNextFragment(this.nextLoadPosition,j)}if(!ue)return;ue.initSegment&&!ue.initSegment.data&&!this.bitrateTest&&(ue=ue.initSegment),((T=ue.decryptdata)===null||T===void 0?void 0:T.keyFormat)==="identity"&&!((x=ue.decryptdata)!==null&&x!==void 0&&x.key)?this.loadKey(ue,j):this.loadFragment(ue,j,ae)},O.loadFragment=function(T,x,f){var w,v=this.fragmentTracker.getState(T);if(this.fragCurrent=T,v===n.FragmentState.BACKTRACKED){var b=this.fragmentTracker.getBacktrackData(T);if(b){this._handleFragmentLoadProgress(b),this._handleFragmentLoadComplete(b);return}else v=n.FragmentState.NOT_LOADED}v===n.FragmentState.NOT_LOADED||v===n.FragmentState.PARTIAL?T.sn==="initSegment"?this._loadInitSegment(T):this.bitrateTest?(T.bitrateTest=!0,this.log("Fragment "+T.sn+" of level "+T.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(T)):(this.startFragRequested=!0,S.prototype.loadFragment.call(this,T,x,f)):v===n.FragmentState.APPENDING?this.reduceMaxBufferLength(T.duration)&&this.fragmentTracker.removeFragment(T):((w=this.media)===null||w===void 0?void 0:w.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},O.getAppendedFrag=function(T){var x=this.fragmentTracker.getAppendedFrag(T,D.PlaylistLevelType.MAIN);return x&&"fragment"in x?x.fragment:x},O.getBufferedFrag=function(T){return this.fragmentTracker.getBufferedFrag(T,D.PlaylistLevelType.MAIN)},O.followingBufferedFrag=function(T){return T?this.getBufferedFrag(T.end+.5):null},O.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},O.nextLevelSwitch=function(){var T=this.levels,x=this.media;if(x!=null&&x.readyState){var f,w=this.getAppendedFrag(x.currentTime);if(w&&w.start>1&&this.flushMainBuffer(0,w.start-1),!x.paused&&T){var v=this.hls.nextLoadLevel,b=T[v],F=this.fragLastKbps;F&&this.fragCurrent?f=this.fragCurrent.duration*b.maxBitrate/(1e3*F)+1:f=0}else f=0;var B=this.getBufferedFrag(x.currentTime+f);if(B){var R=this.followingBufferedFrag(B);if(R){this.abortCurrentFrag();var j=R.maxStartPTS?R.maxStartPTS:R.start,N=R.duration,y=Math.max(B.end,j+Math.min(Math.max(N-this.config.maxFragLookUpTolerance,N*.5),N*.75));this.flushMainBuffer(y,Number.POSITIVE_INFINITY)}}}},O.abortCurrentFrag=function(){var T=this.fragCurrent;this.fragCurrent=null,T!=null&&T.loader&&T.loader.abort(),this.state===U.State.KEY_LOADING&&(this.state=U.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},O.flushMainBuffer=function(T,x){S.prototype.flushMainBuffer.call(this,T,x,this.altAudio?"video":null)},O.onMediaAttached=function(T,x){S.prototype.onMediaAttached.call(this,T,x);var f=x.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),f.addEventListener("playing",this.onvplaying),f.addEventListener("seeked",this.onvseeked),this.gapController=new h.default(this.config,f,this.fragmentTracker,this.hls)},O.onMediaDetaching=function(){var T=this.media;T&&(T.removeEventListener("playing",this.onvplaying),T.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),S.prototype.onMediaDetaching.call(this)},O.onMediaPlaying=function(){this.tick()},O.onMediaSeeked=function(){var T=this.media,x=T?T.currentTime:null;Object(X.isFiniteNumber)(x)&&this.log("Media seeked to "+x.toFixed(3)),this.tick()},O.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(G.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},O.onManifestParsed=function(T,x){var f=!1,w=!1,v;x.levels.forEach(function(b){v=b.audioCodec,v&&(v.indexOf("mp4a.40.2")!==-1&&(f=!0),v.indexOf("mp4a.40.5")!==-1&&(w=!0))}),this.audioCodecSwitch=f&&w&&!Object(k.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=x.levels,this.startFragRequested=!1},O.onLevelLoading=function(T,x){var f=this.levels;if(!f||this.state!==U.State.IDLE)return;var w=f[x.level];(!w.details||w.details.live&&this.levelLastLoaded!==x.level||this.waitForCdnTuneIn(w.details))&&(this.state=U.State.WAITING_LEVEL)},O.onLevelLoaded=function(T,x){var f,w=this.levels,v=x.level,b=x.details,F=b.totalduration;if(!w){this.warn("Levels were reset while loading level "+v);return}this.log("Level "+v+" loaded ["+b.startSN+","+b.endSN+"], cc ["+b.startCC+", "+b.endCC+"] duration:"+F);var B=this.fragCurrent;B&&(this.state===U.State.FRAG_LOADING||this.state===U.State.FRAG_LOADING_WAITING_RETRY)&&(B.level!==x.level&&B.loader&&(this.state=U.State.IDLE,B.loader.abort()));var R=w[v],j=0;if(b.live||(f=R.details)!==null&&f!==void 0&&f.live){if(b.fragments[0]||(b.deltaUpdateFailed=!0),b.deltaUpdateFailed)return;j=this.alignPlaylists(b,R.details)}if(R.details=b,this.levelLastLoaded=v,this.hls.trigger(G.Events.LEVEL_UPDATED,{details:b,level:v}),this.state===U.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(b))return;this.state=U.State.IDLE}this.startFragRequested?b.live&&this.synchronizeToLiveEdge(b):this.setStartPosition(b,j),this.tick()},O._handleFragmentLoadProgress=function(T){var x,f=T.frag,w=T.part,v=T.payload,b=this.levels;if(!b){this.warn("Levels were reset while fragment load was in progress. Fragment "+f.sn+" of level "+f.level+" will not be buffered");return}var F=b[f.level],B=F.details;if(!B){this.warn("Dropping fragment "+f.sn+" of level "+f.level+" after level details were reset");return}var R=F.videoCodec,j=B.PTSKnown||!B.live,N=(x=f.initSegment)===null||x===void 0?void 0:x.data,y=this._getAudioCodec(F),Y=this.transmuxer=this.transmuxer||new p.default(this.hls,D.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),ee=w?w.index:-1,ae=ee!==-1,ue=new m.ChunkMetadata(f.level,f.sn,f.stats.chunkCount,v.byteLength,ee,ae),Re=this.initPTS[f.cc];Y.push(v,N,y,R,f,w,B.totalduration,j,ue,Re)},O.onAudioTrackSwitching=function(T,x){var f=this.altAudio,w=!!x.url,v=x.id;if(!w){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var b=this.fragCurrent;b!=null&&b.loader&&(this.log("Switching to main audio track, cancel main fragment load"),b.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var F=this.hls;f&&F.trigger(G.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),F.trigger(G.Events.AUDIO_TRACK_SWITCHED,{id:v})}},O.onAudioTrackSwitched=function(T,x){var f=x.id,w=!!this.hls.audioTracks[f].url;if(w){var v=this.videoBuffer;v&&this.mediaBuffer!==v&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=v)}this.altAudio=w,this.tick()},O.onBufferCreated=function(T,x){var f=x.tracks,w,v,b=!1;for(var F in f){var B=f[F];if(B.id==="main"){if(v=F,w=B,F==="video"){var R=f[F];R&&(this.videoBuffer=R.buffer)}}else b=!0}b&&w?(this.log("Alternate track found, use "+v+".buffered to schedule main fragment loading"),this.mediaBuffer=w.buffer):this.mediaBuffer=this.media},O.onFragBuffered=function(T,x){var f=x.frag,w=x.part;if(f&&f.type!==D.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(f)){this.warn("Fragment "+f.sn+(w?" p: "+w.index:"")+" of level "+f.level+" finished buffering, but was aborted. state: "+this.state),this.state===U.State.PARSED&&(this.state=U.State.IDLE);return}var v=w?w.stats:f.stats;this.fragLastKbps=Math.round(8*v.total/(v.buffering.end-v.loading.first)),f.sn!=="initSegment"&&(this.fragPrevious=f),this.fragBufferedComplete(f,w)},O.onError=function(T,x){switch(x.details){case o.ErrorDetails.FRAG_LOAD_ERROR:case o.ErrorDetails.FRAG_LOAD_TIMEOUT:case o.ErrorDetails.KEY_LOAD_ERROR:case o.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(D.PlaylistLevelType.MAIN,x);break;case o.ErrorDetails.LEVEL_LOAD_ERROR:case o.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==U.State.ERROR&&(x.fatal?(this.warn(""+x.details),this.state=U.State.ERROR):!x.levelRetry&&this.state===U.State.WAITING_LEVEL&&(this.state=U.State.IDLE));break;case o.ErrorDetails.BUFFER_FULL_ERROR:if(x.parent==="main"&&(this.state===U.State.PARSING||this.state===U.State.PARSED)){var f=!0,w=this.getFwdBufferInfo(this.media,D.PlaylistLevelType.MAIN);w&&w.len>.5&&(f=!this.reduceMaxBufferLength(w.len)),f&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},O.checkBuffer=function(){var T=this.media,x=this.gapController;if(!T||!x||!T.readyState)return;var f=H.BufferHelper.getBuffered(T);!this.loadedmetadata&&f.length?(this.loadedmetadata=!0,this.seekToStartPos()):x.poll(this.lastCurrentTime),this.lastCurrentTime=T.currentTime},O.onFragLoadEmergencyAborted=function(){this.state=U.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},O.onBufferFlushed=function(T,x){var f=x.type;if(f!==g.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var w=(f===g.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(w,f,D.PlaylistLevelType.MAIN)}},O.onLevelsUpdated=function(T,x){this.levels=x.levels},O.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},O.seekToStartPos=function(){var T=this.media,x=T.currentTime,f=this.startPosition;if(f>=0&&x<f){if(T.seeking){c.logger.log("could not seek to "+f+", already seeking at "+x);return}var w=H.BufferHelper.getBuffered(T),v=w.length?w.start(0):0,b=v-f;b>0&&(b<this.config.maxBufferHole||b<this.config.maxFragLookUpTolerance)&&(c.logger.log("adjusting start position by "+b+" to match buffer start"),f+=b,this.startPosition=f),this.log("seek to target start position "+f+" from current time "+x),T.currentTime=f}},O._getAudioCodec=function(T){var x=this.config.defaultAudioCodec||T.audioCodec;return this.audioCodecSwap&&x&&(this.log("Swapping audio codec"),x.indexOf("mp4a.40.5")!==-1?x="mp4a.40.2":x="mp4a.40.5"),x},O._loadBitrateTestFrag=function(T){var x=this;this._doFragLoad(T).then(function(f){var w=x.hls;if(!f||w.nextLoadLevel||x.fragContextChanged(T))return;x.fragLoadError=0,x.state=U.State.IDLE,x.startFragRequested=!1,x.bitrateTest=!1;var v=T.stats;v.parsing.start=v.parsing.end=v.buffering.start=v.buffering.end=self.performance.now(),w.trigger(G.Events.FRAG_LOADED,f)})},O._handleTransmuxComplete=function(T){var x,f="main",w=this.hls,v=T.remuxResult,b=T.chunkMeta,F=this.getCurrentContext(b);if(!F){this.warn("The loading context changed while buffering fragment "+b.sn+" of level "+b.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(b.level);return}var B=F.frag,R=F.part,j=F.level,N=v.video,y=v.text,Y=v.id3,ee=v.initSegment,ae=this.altAudio?void 0:v.audio;if(this.fragContextChanged(B))return;if(this.state=U.State.PARSING,ee){ee.tracks&&(this._bufferInitSegment(j,ee.tracks,B,b),w.trigger(G.Events.FRAG_PARSING_INIT_SEGMENT,{frag:B,id:f,tracks:ee.tracks}));var ue=ee.initPTS,Re=ee.timescale;Object(X.isFiniteNumber)(ue)&&(this.initPTS[B.cc]=ue,w.trigger(G.Events.INIT_PTS_FOUND,{frag:B,id:f,initPTS:ue,timescale:Re}))}if(N&&v.independent!==!1){if(j.details){var Ee=N.startPTS,xe=N.endPTS,Ce=N.startDTS,Oe=N.endDTS;if(R)R.elementaryStreams[N.type]={startPTS:Ee,endPTS:xe,startDTS:Ce,endDTS:Oe};else if(N.firstKeyFrame&&N.independent&&(this.couldBacktrack=!0),N.dropped&&N.independent){var pe=this.getLoadPosition()+this.config.maxBufferHole;if(pe<Ee){this.backtrack(B);return}B.setElementaryStreamInfo(N.type,B.start,xe,B.start,Oe,!0)}B.setElementaryStreamInfo(N.type,Ee,xe,Ce,Oe),this.bufferFragmentData(N,B,R,b)}}else if(v.independent===!1){this.backtrack(B);return}if(ae){var de=ae.startPTS,Me=ae.endPTS,tt=ae.startDTS,We=ae.endDTS;R&&(R.elementaryStreams[g.ElementaryStreamTypes.AUDIO]={startPTS:de,endPTS:Me,startDTS:tt,endDTS:We}),B.setElementaryStreamInfo(g.ElementaryStreamTypes.AUDIO,de,Me,tt,We),this.bufferFragmentData(ae,B,R,b)}if(Y!=null&&(x=Y.samples)!==null&&x!==void 0&&x.length){var rt={frag:B,id:f,samples:Y.samples};w.trigger(G.Events.FRAG_PARSING_METADATA,rt)}if(y){var st={frag:B,id:f,samples:y.samples};w.trigger(G.Events.FRAG_PARSING_USERDATA,st)}},O._bufferInitSegment=function(T,x,f,w){var v=this;if(this.state!==U.State.PARSING)return;this.audioOnly=!!x.audio&&!x.video,this.altAudio&&!this.audioOnly&&delete x.audio;var b=x.audio,F=x.video,B=x.audiovideo;if(b){var R=T.audioCodec,j=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(R&&(R.indexOf("mp4a.40.5")!==-1?R="mp4a.40.2":R="mp4a.40.5"),b.metadata.channelCount!==1&&j.indexOf("firefox")===-1&&(R="mp4a.40.5")),j.indexOf("android")!==-1&&b.container!=="audio/mpeg"&&(R="mp4a.40.2",this.log("Android: force audio codec to "+R)),T.audioCodec&&T.audioCodec!==R&&this.log('Swapping manifest audio codec "'+T.audioCodec+'" for "'+R+'"'),b.levelCodec=R,b.id="main",this.log("Init audio buffer, container:"+b.container+", codecs[selected/level/parsed]=["+(R||"")+"/"+(T.audioCodec||"")+"/"+b.codec+"]")}F&&(F.levelCodec=T.videoCodec,F.id="main",this.log("Init video buffer, container:"+F.container+", codecs[level/parsed]=["+(T.videoCodec||"")+"/"+F.codec+"]")),B&&this.log("Init audiovideo buffer, container:"+B.container+", codecs[level/parsed]=["+(T.attrs.CODECS||"")+"/"+B.codec+"]"),this.hls.trigger(G.Events.BUFFER_CODECS,x),Object.keys(x).forEach(function(N){var y=x[N],Y=y.initSegment;Y!=null&&Y.byteLength&&v.hls.trigger(G.Events.BUFFER_APPENDING,{type:N,data:Y,frag:f,part:null,chunkMeta:w,parent:f.type})}),this.tick()},O.backtrack=function(T){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(T);var x=this.fragmentTracker.backtrack(T);this.fragPrevious=null,this.nextLoadPosition=T.start,x?this.resetFragmentLoading(T):this.state=U.State.BACKTRACKING},O.checkFragmentChanged=function(){var T=this.media,x=null;if(T&&T.readyState>1&&T.seeking===!1){var f=T.currentTime;if(H.BufferHelper.isBuffered(T,f)?x=this.getAppendedFrag(f):H.BufferHelper.isBuffered(T,f+.1)&&(x=this.getAppendedFrag(f+.1)),x){var w=this.fragPlaying,v=x.level;(!w||x.sn!==w.sn||w.level!==v||x.urlId!==w.urlId)&&(this.hls.trigger(G.Events.FRAG_CHANGED,{frag:x}),(!w||w.level!==v)&&this.hls.trigger(G.Events.LEVEL_SWITCHED,{level:v}),this.fragPlaying=x)}}},u(L,[{key:"nextLevel",get:function(){var T=this.nextBufferedFrag;return T?T.level:-1}},{key:"currentLevel",get:function(){var T=this.media;if(T){var x=this.getAppendedFrag(T.currentTime);if(x)return x.level}return-1}},{key:"nextBufferedFrag",get:function(){var T=this.media;if(T){var x=this.getAppendedFrag(T.currentTime);return this.followingBufferedFrag(x)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),L}(U.default)},"./src/controller/subtitle-stream-controller.ts":function(re,$,P){"use strict";P.r($),P.d($,"SubtitleStreamController",function(){return s});var X=P("./src/events.ts"),U=P("./src/utils/logger.ts"),k=P("./src/utils/buffer-helper.ts"),G=P("./src/controller/fragment-finders.ts"),H=P("./src/utils/discontinuities.ts"),n=P("./src/controller/level-helper.ts"),D=P("./src/controller/fragment-tracker.ts"),g=P("./src/controller/base-stream-controller.ts"),p=P("./src/types/loader.ts"),m=P("./src/types/level.ts");function h(a,A){for(var E=0;E<A.length;E++){var S=A[E];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(a,S.key,S)}}function o(a,A,E){return A&&h(a.prototype,A),E&&h(a,E),a}function c(a,A){a.prototype=Object.create(A.prototype),a.prototype.constructor=a,l(a,A)}function l(a,A){return l=Object.setPrototypeOf||function(S,L){return S.__proto__=L,S},l(a,A)}var u=500,s=function(a){c(A,a);function A(S,L){var O;return O=a.call(this,S,L,"[subtitle-stream-controller]")||this,O.levels=[],O.currentTrackId=-1,O.tracksBuffered=[],O.mainDetails=null,O._registerListeners(),O}var E=A.prototype;return E.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},E._registerListeners=function(){var L=this.hls;L.on(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),L.on(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this),L.on(X.Events.MANIFEST_LOADING,this.onManifestLoading,this),L.on(X.Events.LEVEL_LOADED,this.onLevelLoaded,this),L.on(X.Events.ERROR,this.onError,this),L.on(X.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),L.on(X.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),L.on(X.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),L.on(X.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),L.on(X.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},E._unregisterListeners=function(){var L=this.hls;L.off(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),L.off(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this),L.off(X.Events.MANIFEST_LOADING,this.onManifestLoading,this),L.off(X.Events.LEVEL_LOADED,this.onLevelLoaded,this),L.off(X.Events.ERROR,this.onError,this),L.off(X.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),L.off(X.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),L.off(X.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),L.off(X.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),L.off(X.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},E.startLoad=function(){this.stopLoad(),this.state=g.State.IDLE,this.setInterval(u),this.tick()},E.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},E.onLevelLoaded=function(L,O){this.mainDetails=O.details},E.onSubtitleFragProcessed=function(L,O){var C=O.frag,T=O.success;if(this.fragPrevious=C,this.state=g.State.IDLE,!T)return;var x=this.tracksBuffered[this.currentTrackId];if(!x)return;for(var f,w=C.start,v=0;v<x.length;v++)if(w>=x[v].start&&w<=x[v].end){f=x[v];break}var b=C.start+C.duration;f?f.end=b:(f={start:w,end:b},x.push(f)),this.fragmentTracker.fragBuffered(C)},E.onBufferFlushing=function(L,O){var C=O.startOffset,T=O.endOffset;if(C===0&&T!==Number.POSITIVE_INFINITY){var x=this.currentTrackId,f=this.levels;if(!f.length||!f[x]||!f[x].details)return;var w=f[x].details,v=w.targetduration,b=T-v;if(b<=0)return;O.endOffsetSubtitles=Math.max(0,b),this.tracksBuffered.forEach(function(F){for(var B=0;B<F.length;){if(F[B].end<=b){F.shift();continue}else if(F[B].start<b)F[B].start=b;else break;B++}}),this.fragmentTracker.removeFragmentsInRange(C,b,p.PlaylistLevelType.SUBTITLE)}},E.onError=function(L,O){var C,T=O.frag;if(!T||T.type!==p.PlaylistLevelType.SUBTITLE)return;(C=this.fragCurrent)!==null&&C!==void 0&&C.loader&&this.fragCurrent.loader.abort(),this.state=g.State.IDLE},E.onSubtitleTracksUpdated=function(L,O){var C=this,T=O.subtitleTracks;this.tracksBuffered=[],this.levels=T.map(function(x){return new m.Level(x)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(x){C.tracksBuffered[x.id]=[]}),this.mediaBuffer=null},E.onSubtitleTrackSwitch=function(L,O){if(this.currentTrackId=O.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var C=this.levels[this.currentTrackId];C!=null&&C.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,C&&this.setInterval(u)},E.onSubtitleTrackLoaded=function(L,O){var C,T=O.details,x=O.id,f=this.currentTrackId,w=this.levels;if(!w.length)return;var v=w[f];if(x>=w.length||x!==f||!v)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,T.live||(C=v.details)!==null&&C!==void 0&&C.live){var b=this.mainDetails;if(T.deltaUpdateFailed||!b)return;var F=b.fragments[0];if(!v.details)T.hasProgramDateTime&&b.hasProgramDateTime?Object(H.alignMediaPlaylistByPDT)(T,b):F&&Object(n.addSliding)(T,F.start);else{var B=this.alignPlaylists(T,v.details);B===0&&F&&Object(n.addSliding)(T,F.start)}}if(v.details=T,this.levelLastLoaded=x,this.tick(),T.live&&!this.fragCurrent&&this.media&&this.state===g.State.IDLE){var R=Object(G.findFragmentByPTS)(null,T.fragments,this.media.currentTime,0);R||(this.warn("Subtitle playlist not aligned with playback"),v.details=void 0)}},E._handleFragmentLoadComplete=function(L){var O=L.frag,C=L.payload,T=O.decryptdata,x=this.hls;if(this.fragContextChanged(O))return;if(C&&C.byteLength>0&&T&&T.key&&T.iv&&T.method==="AES-128"){var f=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(C),T.key.buffer,T.iv.buffer).then(function(w){var v=performance.now();x.trigger(X.Events.FRAG_DECRYPTED,{frag:O,payload:w,stats:{tstart:f,tdecrypt:v}})})}},E.doTick=function(){if(!this.media){this.state=g.State.IDLE;return}if(this.state===g.State.IDLE){var L,O=this.currentTrackId,C=this.levels;if(!C.length||!C[O]||!C[O].details)return;var T=C[O].details,x=T.targetduration,f=this.config,w=this.media,v=k.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,w.currentTime-x,f.maxBufferHole),b=v.end,F=v.len,B=this.getMaxBufferLength()+x;if(F>B)return;console.assert(T,"Subtitle track details are defined on idle subtitle stream controller tick");var R=T.fragments,j=R.length,N=T.edge,y,Y=this.fragPrevious;if(b<N){var ee=f.maxFragLookUpTolerance;Y&&T.hasProgramDateTime&&(y=Object(G.findFragmentByPDT)(R,Y.endProgramDateTime,ee)),y||(y=Object(G.findFragmentByPTS)(Y,R,b,ee),!y&&Y&&Y.start<R[0].start&&(y=R[0]))}else y=R[j-1];(L=y)!==null&&L!==void 0&&L.encrypted?(U.logger.log("Loading key for "+y.sn),this.state=g.State.KEY_LOADING,this.hls.trigger(X.Events.KEY_LOADING,{frag:y})):y&&this.fragmentTracker.getState(y)===D.FragmentState.NOT_LOADED&&this.loadFragment(y,T,b)}},E.loadFragment=function(L,O,C){this.fragCurrent=L,a.prototype.loadFragment.call(this,L,O,C)},o(A,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),A}(g.default)},"./src/controller/subtitle-track-controller.ts":function(re,$,P){"use strict";P.r($);var X=P("./src/events.ts"),U=P("./src/utils/texttrack-utils.ts"),k=P("./src/controller/base-playlist-controller.ts"),G=P("./src/types/loader.ts");function H(h,o){for(var c=0;c<o.length;c++){var l=o[c];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(h,l.key,l)}}function n(h,o,c){return o&&H(h.prototype,o),c&&H(h,c),h}function D(h,o){h.prototype=Object.create(o.prototype),h.prototype.constructor=h,g(h,o)}function g(h,o){return g=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},g(h,o)}var p=function(h){D(o,h);function o(l){var u;return u=h.call(this,l,"[subtitle-track-controller]")||this,u.media=null,u.tracks=[],u.groupId=null,u.tracksInGroup=[],u.trackId=-1,u.selectDefaultTrack=!0,u.queuedDefaultTrack=-1,u.trackChangeListener=function(){return u.onTextTracksChanged()},u.asyncPollTrackChange=function(){return u.pollTrackChange(0)},u.useTextTrackPolling=!1,u.subtitlePollingInterval=-1,u.subtitleDisplay=!0,u.registerListeners(),u}var c=o.prototype;return c.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,h.prototype.destroy.call(this)},c.registerListeners=function(){var u=this.hls;u.on(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.on(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.on(X.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.on(X.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.on(X.Events.LEVEL_LOADING,this.onLevelLoading,this),u.on(X.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),u.on(X.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),u.on(X.Events.ERROR,this.onError,this)},c.unregisterListeners=function(){var u=this.hls;u.off(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.off(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.off(X.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.off(X.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.off(X.Events.LEVEL_LOADING,this.onLevelLoading,this),u.off(X.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),u.off(X.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),u.off(X.Events.ERROR,this.onError,this)},c.onMediaAttached=function(u,s){if(this.media=s.media,!this.media)return;this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange)},c.pollTrackChange=function(u){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,u)},c.onMediaDetaching=function(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);var u=m(this.media.textTracks);u.forEach(function(s){Object(U.clearCurrentCues)(s)}),this.subtitleTrack=-1,this.media=null},c.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},c.onManifestParsed=function(u,s){this.tracks=s.subtitleTracks},c.onSubtitleTrackLoaded=function(u,s){var a=s.id,A=s.details,E=this.trackId,S=this.tracksInGroup[E];if(!S){this.warn("Invalid subtitle track id "+a);return}var L=S.details;S.details=s.details,this.log("subtitle track "+a+" loaded ["+A.startSN+"-"+A.endSN+"]"),a===this.trackId&&(this.retryCount=0,this.playlistLoaded(a,s,L))},c.onLevelLoading=function(u,s){this.switchLevel(s.level)},c.onLevelSwitching=function(u,s){this.switchLevel(s.level)},c.switchLevel=function(u){var s=this.hls.levels[u];if(!(s!=null&&s.textGroupIds))return;var a=s.textGroupIds[s.urlId];if(this.groupId!==a){var A=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,E=this.tracks.filter(function(O){return!a||O.groupId===a});this.tracksInGroup=E;var S=this.findTrackId(A==null?void 0:A.name)||this.findTrackId();this.groupId=a;var L={subtitleTracks:E};this.log("Updating subtitle tracks, "+E.length+' track(s) found in "'+a+'" group-id'),this.hls.trigger(X.Events.SUBTITLE_TRACKS_UPDATED,L),S!==-1&&this.setSubtitleTrack(S,A)}},c.findTrackId=function(u){for(var s=this.tracksInGroup,a=0;a<s.length;a++){var A=s[a];if((!this.selectDefaultTrack||A.default)&&(!u||u===A.name))return A.id}return-1},c.onError=function(u,s){if(h.prototype.onError.call(this,u,s),s.fatal||!s.context)return;s.context.type===G.PlaylistContextType.SUBTITLE_TRACK&&s.context.id===this.trackId&&s.context.groupId===this.groupId&&this.retryLoadingOrFail(s)},c.loadPlaylist=function(u){var s=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(s)){var a=s.id,A=s.groupId,E=s.url;if(u)try{E=u.addDirectives(E)}catch(S){this.warn("Could not construct new URL with HLS Delivery Directives: "+S)}this.log("Loading subtitle playlist for id "+a),this.hls.trigger(X.Events.SUBTITLE_TRACK_LOADING,{url:E,id:a,groupId:A,deliveryDirectives:u||null})}},c.toggleTrackModes=function(u){var s=this,a=this.media,A=this.subtitleDisplay,E=this.trackId;if(!a)return;var S=m(a.textTracks),L=S.filter(function(T){return T.groupId===s.groupId});if(u===-1)[].slice.call(S).forEach(function(T){T.mode="disabled"});else{var O=L[E];O&&(O.mode="disabled")}var C=L[u];C&&(C.mode=A?"showing":"hidden")},c.setSubtitleTrack=function(u,s){var a,A=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=u;return}if(this.trackId!==u&&this.toggleTrackModes(u),this.trackId===u&&(u===-1||(a=A[u])!==null&&a!==void 0&&a.details)||u<-1||u>=A.length)return;this.clearTimer();var E=A[u];if(this.log("Switching to subtitle track "+u),this.trackId=u,E){var S=E.id,L=E.groupId,O=L===void 0?"":L,C=E.name,T=E.type,x=E.url;this.hls.trigger(X.Events.SUBTITLE_TRACK_SWITCH,{id:S,groupId:O,name:C,type:T,url:x});var f=this.switchParams(E.url,s==null?void 0:s.details);this.loadPlaylist(f)}else this.hls.trigger(X.Events.SUBTITLE_TRACK_SWITCH,{id:u})},c.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var u=-1,s=m(this.media.textTracks),a=0;a<s.length;a++)if(s[a].mode==="hidden")u=a;else if(s[a].mode==="showing"){u=a;break}this.subtitleTrack!==u&&(this.subtitleTrack=u)},n(o,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(u){this.selectDefaultTrack=!1;var s=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(u,s)}}]),o}(k.default);function m(h){for(var o=[],c=0;c<h.length;c++){var l=h[c];l.kind==="subtitles"&&l.label&&o.push(h[c])}return o}$.default=p},"./src/controller/timeline-controller.ts":function(re,$,P){"use strict";P.r($),P.d($,"TimelineController",function(){return m});var X=P("./src/polyfills/number.ts"),U=P("./src/events.ts"),k=P("./src/utils/cea-608-parser.ts"),G=P("./src/utils/output-filter.ts"),H=P("./src/utils/webvtt-parser.ts"),n=P("./src/utils/texttrack-utils.ts"),D=P("./src/utils/imsc1-ttml-parser.ts"),g=P("./src/types/loader.ts"),p=P("./src/utils/logger.ts"),m=function(){function l(s){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.timescale=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=c(),this.captionsProperties=void 0,this.hls=s,this.config=s.config,this.Cues=s.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){var a=new G.default(this,"textTrack1"),A=new G.default(this,"textTrack2"),E=new G.default(this,"textTrack3"),S=new G.default(this,"textTrack4");this.cea608Parser1=new k.default(1,a,A),this.cea608Parser2=new k.default(3,E,S)}s.on(U.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),s.on(U.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.on(U.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(U.Events.MANIFEST_LOADED,this.onManifestLoaded,this),s.on(U.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),s.on(U.Events.FRAG_LOADING,this.onFragLoading,this),s.on(U.Events.FRAG_LOADED,this.onFragLoaded,this),s.on(U.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),s.on(U.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),s.on(U.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),s.on(U.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),s.on(U.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var u=l.prototype;return u.destroy=function(){var a=this.hls;a.off(U.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),a.off(U.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.off(U.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.off(U.Events.MANIFEST_LOADED,this.onManifestLoaded,this),a.off(U.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),a.off(U.Events.FRAG_LOADING,this.onFragLoading,this),a.off(U.Events.FRAG_LOADED,this.onFragLoaded,this),a.off(U.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),a.off(U.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),a.off(U.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),a.off(U.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),a.off(U.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},u.addCues=function(a,A,E,S,L){for(var O=!1,C=L.length;C--;){var T=L[C],x=o(T[0],T[1],A,E);if(x>=0&&(T[0]=Math.min(T[0],A),T[1]=Math.max(T[1],E),O=!0,x/(E-A)>.5))return}if(O||L.push([A,E]),this.config.renderTextTracksNatively){var f=this.captionsTracks[a];this.Cues.newCue(f,A,E,S)}else{var w=this.Cues.newCue(null,A,E,S);this.hls.trigger(U.Events.CUES_PARSED,{type:"captions",cues:w,track:a})}},u.onInitPtsFound=function(a,A){var E=this,S=A.frag,L=A.id,O=A.initPTS,C=A.timescale,T=this.unparsedVttFrags;L==="main"&&(this.initPTS[S.cc]=O,this.timescale[S.cc]=C),T.length&&(this.unparsedVttFrags=[],T.forEach(function(x){E.onFragLoaded(U.Events.FRAG_LOADED,x)}))},u.getExistingTrack=function(a){var A=this.media;if(A)for(var E=0;E<A.textTracks.length;E++){var S=A.textTracks[E];if(S[a])return S}return null},u.createCaptionsTrack=function(a){this.config.renderTextTracksNatively?this.createNativeTrack(a):this.createNonNativeTrack(a)},u.createNativeTrack=function(a){if(this.captionsTracks[a])return;var A=this.captionsProperties,E=this.captionsTracks,S=this.media,L=A[a],O=L.label,C=L.languageCode,T=this.getExistingTrack(a);if(T)E[a]=T,Object(n.clearCurrentCues)(E[a]),Object(n.sendAddTrackEvent)(E[a],S);else{var x=this.createTextTrack("captions",O,C);x&&(x[a]=!0,E[a]=x)}},u.createNonNativeTrack=function(a){if(this.nonNativeCaptionsTracks[a])return;var A=this.captionsProperties[a];if(!A)return;var E=A.label,S={_id:a,label:E,kind:"captions",default:A.media?!!A.media.default:!1,closedCaptions:A.media};this.nonNativeCaptionsTracks[a]=S,this.hls.trigger(U.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[S]})},u.createTextTrack=function(a,A,E){var S=this.media;return S?S.addTextTrack(a,A,E):void 0},u.onMediaAttaching=function(a,A){this.media=A.media,this._cleanTracks()},u.onMediaDetaching=function(){var a=this.captionsTracks;Object.keys(a).forEach(function(A){Object(n.clearCurrentCues)(a[A]),delete a[A]}),this.nonNativeCaptionsTracks={}},u.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=c(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.timescale=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())},u._cleanTracks=function(){var a=this.media;if(!a)return;var A=a.textTracks;if(A)for(var E=0;E<A.length;E++)Object(n.clearCurrentCues)(A[E])},u.onSubtitleTracksUpdated=function(a,A){var E=this;this.textTracks=[];var S=A.subtitleTracks||[],L=S.some(function(x){return x.textCodec===D.IMSC1_CODEC});if(this.config.enableWebVTT||L&&this.config.enableIMSC1){var O=this.tracks&&S&&this.tracks.length===S.length;if(this.tracks=S||[],this.config.renderTextTracksNatively){var C=this.media?this.media.textTracks:[];this.tracks.forEach(function(x,f){var w;if(f<C.length){for(var v=null,b=0;b<C.length;b++)if(h(C[b],x)){v=C[b];break}v&&(w=v)}w?Object(n.clearCurrentCues)(w):(w=E.createTextTrack("subtitles",x.name,x.lang),w&&(w.mode="disabled")),w&&(w.groupId=x.groupId,E.textTracks.push(w))})}else if(!O&&this.tracks&&this.tracks.length){var T=this.tracks.map(function(x){return{label:x.name,kind:x.type.toLowerCase(),default:x.default,subtitleTrack:x}});this.hls.trigger(U.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:T})}}},u.onManifestLoaded=function(a,A){var E=this;this.config.enableCEA708Captions&&A.captions&&A.captions.forEach(function(S){var L=/(?:CC|SERVICE)([1-4])/.exec(S.instreamId);if(!L)return;var O="textTrack"+L[1],C=E.captionsProperties[O];if(!C)return;C.label=S.name,S.lang&&(C.languageCode=S.lang),C.media=S})},u.onFragLoading=function(a,A){var E=this.cea608Parser1,S=this.cea608Parser2,L=this.lastSn,O=this.lastPartIndex;if(!this.enabled||!(E&&S))return;if(A.frag.type===g.PlaylistLevelType.MAIN){var C,T,x=A.frag.sn,f=(C=A==null||((T=A.part)===null||T===void 0)?void 0:T.index)!=null?C:-1;x===L+1||x===L&&f===O+1||(E.reset(),S.reset()),this.lastSn=x,this.lastPartIndex=f}},u.onFragLoaded=function(a,A){var E=A.frag,S=A.payload,L=this.initPTS,O=this.unparsedVttFrags;if(E.type===g.PlaylistLevelType.SUBTITLE)if(S.byteLength){if(!Object(X.isFiniteNumber)(L[E.cc])){O.push(A),L.length&&this.hls.trigger(U.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:E,error:new Error("Missing initial subtitle PTS")});return}var C=E.decryptdata;if(C==null||C.key==null||C.method!=="AES-128"){var T=this.tracks[E.level],x=this.vttCCs;x[E.cc]||(x[E.cc]={start:E.start,prevCC:this.prevCC,new:!0},this.prevCC=E.cc),T&&T.textCodec===D.IMSC1_CODEC?this._parseIMSC1(E,S):this._parseVTTs(E,S,x)}}else this.hls.trigger(U.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:E,error:new Error("Empty subtitle payload")})},u._parseIMSC1=function(a,A){var E=this,S=this.hls;Object(D.parseIMSC1)(A,this.initPTS[a.cc],this.timescale[a.cc],function(L){E._appendCues(L,a.level),S.trigger(U.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:a})},function(L){p.logger.log("Failed to parse IMSC1: "+L),S.trigger(U.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:a,error:L})})},u._parseVTTs=function(a,A,E){var S=this,L=this.hls;Object(H.parseWebVTT)(A,this.initPTS[a.cc],this.timescale[a.cc],E,a.cc,a.start,function(O){S._appendCues(O,a.level),L.trigger(U.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:a})},function(O){S._fallbackToIMSC1(a,A),p.logger.log("Failed to parse VTT cue: "+O),L.trigger(U.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:a,error:O})})},u._fallbackToIMSC1=function(a,A){var E=this,S=this.tracks[a.level];S.textCodec||Object(D.parseIMSC1)(A,this.initPTS[a.cc],this.timescale[a.cc],function(){S.textCodec=D.IMSC1_CODEC,E._parseIMSC1(a,A)},function(){S.textCodec="wvtt"})},u._appendCues=function(a,A){var E=this.hls;if(this.config.renderTextTracksNatively){var S=this.textTracks[A];if(S.mode==="disabled")return;a.forEach(function(C){return Object(n.addCueToTrack)(S,C)})}else{var L=this.tracks[A],O=L.default?"default":"subtitles"+A;E.trigger(U.Events.CUES_PARSED,{type:"subtitles",cues:a,track:O})}},u.onFragDecrypted=function(a,A){var E=A.frag;if(E.type===g.PlaylistLevelType.SUBTITLE){if(!Object(X.isFiniteNumber)(this.initPTS[E.cc])){this.unparsedVttFrags.push(A);return}this.onFragLoaded(U.Events.FRAG_LOADED,A)}},u.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},u.onFragParsingUserdata=function(a,A){var E=this.cea608Parser1,S=this.cea608Parser2;if(!this.enabled||!(E&&S))return;for(var L=0;L<A.samples.length;L++){var O=A.samples[L].bytes;if(O){var C=this.extractCea608Data(O);E.addData(A.samples[L].pts,C[0]),S.addData(A.samples[L].pts,C[1])}}},u.onBufferFlushing=function(a,A){var E=A.startOffset,S=A.endOffset,L=A.endOffsetSubtitles,O=A.type,C=this.media;if(!C||C.currentTime<S)return;if(!O||O==="video"){var T=this.captionsTracks;Object.keys(T).forEach(function(f){return Object(n.removeCuesInRange)(T[f],E,S)})}if(this.config.renderTextTracksNatively&&(E===0&&L!==void 0)){var x=this.textTracks;Object.keys(x).forEach(function(f){return Object(n.removeCuesInRange)(x[f],E,L)})}},u.extractCea608Data=function(a){for(var A=a[0]&31,E=2,S=[[],[]],L=0;L<A;L++){var O=a[E++],C=127&a[E++],T=127&a[E++],x=(4&O)!==0,f=3&O;if(C===0&&T===0)continue;x&&((f===0||f===1)&&(S[f].push(C),S[f].push(T)))}return S},l}();function h(l,u){return l&&l.label===u.name&&!(l.textTrack1||l.textTrack2)}function o(l,u,s,a){return Math.min(u,a)-Math.max(l,s)}function c(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(re,$,P){"use strict";P.r($),P.d($,"default",function(){return X});var X=function(){function U(G,H){this.subtle=void 0,this.aesIV=void 0,this.subtle=G,this.aesIV=H}var k=U.prototype;return k.decrypt=function(H,n){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},n,H)},U}()},"./src/crypt/aes-decryptor.ts":function(re,$,P){"use strict";P.r($),P.d($,"removePadding",function(){return U}),P.d($,"default",function(){return k});var X=P("./src/utils/typed-array.ts");function U(G){var H=G.byteLength,n=H&&new DataView(G.buffer).getUint8(H-1);return n?Object(X.sliceUint8)(G,0,H-n):G}var k=function(){function G(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}var H=G.prototype;return H.uint8ArrayToUint32Array_=function(D){for(var g=new DataView(D),p=new Uint32Array(4),m=0;m<4;m++)p[m]=g.getUint32(m*4);return p},H.initTable=function(){var D=this.sBox,g=this.invSBox,p=this.subMix,m=p[0],h=p[1],o=p[2],c=p[3],l=this.invSubMix,u=l[0],s=l[1],a=l[2],A=l[3],E=new Uint32Array(256),S=0,L=0,O=0;for(O=0;O<256;O++)O<128?E[O]=O<<1:E[O]=O<<1^283;for(O=0;O<256;O++){var C=L^L<<1^L<<2^L<<3^L<<4;C=C>>>8^C&255^99,D[S]=C,g[C]=S;var T=E[S],x=E[T],f=E[x],w=E[C]*257^C*16843008;m[S]=w<<24|w>>>8,h[S]=w<<16|w>>>16,o[S]=w<<8|w>>>24,c[S]=w,w=f*16843009^x*65537^T*257^S*16843008,u[C]=w<<24|w>>>8,s[C]=w<<16|w>>>16,a[C]=w<<8|w>>>24,A[C]=w,S?(S=T^E[E[E[f^T]]],L^=E[E[L]]):S=L=1}},H.expandKey=function(D){for(var g=this.uint8ArrayToUint32Array_(D),p=!0,m=0;m<g.length&&p;)p=g[m]===this.key[m],m++;if(p)return;this.key=g;var h=this.keySize=g.length;if(h!==4&&h!==6&&h!==8)throw new Error("Invalid aes key size="+h);var o=this.ksRows=(h+6+1)*4,c,l,u=this.keySchedule=new Uint32Array(o),s=this.invKeySchedule=new Uint32Array(o),a=this.sBox,A=this.rcon,E=this.invSubMix,S=E[0],L=E[1],O=E[2],C=E[3],T,x;for(c=0;c<o;c++){if(c<h){T=u[c]=g[c];continue}x=T,c%h===0?(x=x<<8|x>>>24,x=a[x>>>24]<<24|a[x>>>16&255]<<16|a[x>>>8&255]<<8|a[x&255],x^=A[c/h|0]<<24):h>6&&c%h===4&&(x=a[x>>>24]<<24|a[x>>>16&255]<<16|a[x>>>8&255]<<8|a[x&255]),u[c]=T=(u[c-h]^x)>>>0}for(l=0;l<o;l++)c=o-l,l&3?x=u[c]:x=u[c-4],l<4||c<=4?s[l]=x:s[l]=S[a[x>>>24]]^L[a[x>>>16&255]]^O[a[x>>>8&255]]^C[a[x&255]],s[l]=s[l]>>>0},H.networkToHostOrderSwap=function(D){return D<<24|(D&65280)<<8|(D&16711680)>>8|D>>>24},H.decrypt=function(D,g,p){for(var m=this.keySize+6,h=this.invKeySchedule,o=this.invSBox,c=this.invSubMix,l=c[0],u=c[1],s=c[2],a=c[3],A=this.uint8ArrayToUint32Array_(p),E=A[0],S=A[1],L=A[2],O=A[3],C=new Int32Array(D),T=new Int32Array(C.length),x,f,w,v,b,F,B,R,j,N,y,Y,ee,ae,ue=this.networkToHostOrderSwap;g<C.length;){for(j=ue(C[g]),N=ue(C[g+1]),y=ue(C[g+2]),Y=ue(C[g+3]),b=j^h[0],F=Y^h[1],B=y^h[2],R=N^h[3],ee=4,ae=1;ae<m;ae++)x=l[b>>>24]^u[F>>16&255]^s[B>>8&255]^a[R&255]^h[ee],f=l[F>>>24]^u[B>>16&255]^s[R>>8&255]^a[b&255]^h[ee+1],w=l[B>>>24]^u[R>>16&255]^s[b>>8&255]^a[F&255]^h[ee+2],v=l[R>>>24]^u[b>>16&255]^s[F>>8&255]^a[B&255]^h[ee+3],b=x,F=f,B=w,R=v,ee=ee+4;x=o[b>>>24]<<24^o[F>>16&255]<<16^o[B>>8&255]<<8^o[R&255]^h[ee],f=o[F>>>24]<<24^o[B>>16&255]<<16^o[R>>8&255]<<8^o[b&255]^h[ee+1],w=o[B>>>24]<<24^o[R>>16&255]<<16^o[b>>8&255]<<8^o[F&255]^h[ee+2],v=o[R>>>24]<<24^o[b>>16&255]<<16^o[F>>8&255]<<8^o[B&255]^h[ee+3],T[g]=ue(x^E),T[g+1]=ue(v^S),T[g+2]=ue(w^L),T[g+3]=ue(f^O),E=j,S=N,L=y,O=Y,g=g+4}return T.buffer},G}()},"./src/crypt/decrypter.ts":function(re,$,P){"use strict";P.r($),P.d($,"default",function(){return g});var X=P("./src/crypt/aes-crypto.ts"),U=P("./src/crypt/fast-aes-key.ts"),k=P("./src/crypt/aes-decryptor.ts"),G=P("./src/utils/logger.ts"),H=P("./src/utils/mp4-tools.ts"),n=P("./src/utils/typed-array.ts"),D=16,g=function(){function p(h,o,c){var l=c===void 0?{}:c,u=l.removePKCS7Padding,s=u===void 0?!0:u;if(this.logEnabled=!0,this.observer=void 0,this.config=void 0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.observer=h,this.config=o,this.removePKCS7Padding=s,s)try{var a=self.crypto;a&&(this.subtle=a.subtle||a.webkitSubtle)}catch(A){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var m=p.prototype;return m.destroy=function(){this.observer=null},m.isSync=function(){return this.config.enableSoftwareAES},m.flush=function(){var o=this.currentResult;if(!o){this.reset();return}var c=new Uint8Array(o);return this.reset(),this.removePKCS7Padding?Object(k.removePadding)(c):c},m.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},m.decrypt=function(o,c,l,u){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(o),c,l);var s=this.flush();s&&u(s.buffer)}else this.webCryptoDecrypt(new Uint8Array(o),c,l).then(u)},m.softwareDecrypt=function(o,c,l){var u=this.currentIV,s=this.currentResult,a=this.remainderData;this.logOnce("JS AES decrypt"),a&&(o=Object(H.appendUint8Array)(a,o),this.remainderData=null);var A=this.getValidChunk(o);if(!A.length)return null;u&&(l=u);var E=this.softwareDecrypter;E||(E=this.softwareDecrypter=new k.default),E.expandKey(c);var S=s;return this.currentResult=E.decrypt(A.buffer,0,l),this.currentIV=Object(n.sliceUint8)(A,-16).buffer,S||null},m.webCryptoDecrypt=function(o,c,l){var u=this,s=this.subtle;return(this.key!==c||!this.fastAesKey)&&(this.key=c,this.fastAesKey=new U.default(s,c)),this.fastAesKey.expandKey().then(function(a){if(!s)return Promise.reject(new Error("web crypto not initialized"));var A=new X.default(s,l);return A.decrypt(o.buffer,a)}).catch(function(a){return u.onWebCryptoError(a,o,c,l)})},m.onWebCryptoError=function(o,c,l,u){return G.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",o),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(c,l,u)},m.getValidChunk=function(o){var c=o,l=o.length-o.length%D;return l!==o.length&&(c=Object(n.sliceUint8)(o,0,l),this.remainderData=Object(n.sliceUint8)(o,l)),c},m.logOnce=function(o){if(!this.logEnabled)return;G.logger.log("[decrypter.ts]: "+o),this.logEnabled=!1},p}()},"./src/crypt/fast-aes-key.ts":function(re,$,P){"use strict";P.r($),P.d($,"default",function(){return X});var X=function(){function U(G,H){this.subtle=void 0,this.key=void 0,this.subtle=G,this.key=H}var k=U.prototype;return k.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},U}()},"./src/demux/aacdemuxer.ts":function(re,$,P){"use strict";P.r($);var X=P("./src/demux/base-audio-demuxer.ts"),U=P("./src/demux/adts.ts"),k=P("./src/utils/logger.ts"),G=P("./src/demux/id3.ts");function H(g,p){g.prototype=Object.create(p.prototype),g.prototype.constructor=g,n(g,p)}function n(g,p){return n=Object.setPrototypeOf||function(h,o){return h.__proto__=o,h},n(g,p)}var D=function(g){H(p,g);function p(h,o){var c;return c=g.call(this)||this,c.observer=void 0,c.config=void 0,c.observer=h,c.config=o,c}var m=p.prototype;return m.resetInitSegment=function(o,c,l){g.prototype.resetInitSegment.call(this,o,c,l),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:o,duration:l,inputTimeScale:9e4,dropped:0}},p.probe=function(o){if(!o)return!1;for(var c=G.getID3Data(o,0)||[],l=c.length,u=o.length;l<u;l++)if(U.probe(o,l))return k.logger.log("ADTS sync word found !"),!0;return!1},m.canParse=function(o,c){return U.canParse(o,c)},m.appendFrame=function(o,c,l){U.initTrackConfig(o,this.observer,c,l,o.manifestCodec);var u=U.appendFrame(o,c,l,this.initPTS,this.frameIndex);if(u&&u.missing===0)return u},p}(X.default);D.minProbeByteLength=9,$.default=D},"./src/demux/adts.ts":function(re,$,P){"use strict";P.r($),P.d($,"getAudioConfig",function(){return G}),P.d($,"isHeaderPattern",function(){return H}),P.d($,"getHeaderLength",function(){return n}),P.d($,"getFullFrameLength",function(){return D}),P.d($,"canGetFrameLength",function(){return g}),P.d($,"isHeader",function(){return p}),P.d($,"canParse",function(){return m}),P.d($,"probe",function(){return h}),P.d($,"initTrackConfig",function(){return o}),P.d($,"getFrameDuration",function(){return c}),P.d($,"parseFrameHeader",function(){return l}),P.d($,"appendFrame",function(){return u});var X=P("./src/utils/logger.ts"),U=P("./src/errors.ts"),k=P("./src/events.ts");function G(s,a,A,E){var S,L,O,C,T=navigator.userAgent.toLowerCase(),x=E,f=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];S=((a[A+2]&192)>>>6)+1;var w=(a[A+2]&60)>>>2;if(w>f.length-1){s.trigger(k.Events.ERROR,{type:U.ErrorTypes.MEDIA_ERROR,details:U.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+w});return}return O=(a[A+2]&1)<<2,O|=(a[A+3]&192)>>>6,X.logger.log("manifest codec:"+E+", ADTS type:"+S+", samplingIndex:"+w),/firefox/i.test(T)?w>=6?(S=5,C=new Array(4),L=w-3):(S=2,C=new Array(2),L=w):T.indexOf("android")!==-1?(S=2,C=new Array(2),L=w):(S=5,C=new Array(4),E&&(E.indexOf("mp4a.40.29")!==-1||E.indexOf("mp4a.40.5")!==-1)||!E&&w>=6?L=w-3:((E&&E.indexOf("mp4a.40.2")!==-1&&(w>=6&&O===1||/vivaldi/i.test(T))||!E&&O===1)&&(S=2,C=new Array(2)),L=w)),C[0]=S<<3,C[0]|=(w&14)>>1,C[1]|=(w&1)<<7,C[1]|=O<<3,S===5&&(C[1]|=(L&14)>>1,C[2]=(L&1)<<7,C[2]|=2<<2,C[3]=0),{config:C,samplerate:f[w],channelCount:O,codec:"mp4a.40."+S,manifestCodec:x}}function H(s,a){return s[a]===255&&(s[a+1]&246)===240}function n(s,a){return s[a+1]&1?7:9}function D(s,a){return(s[a+3]&3)<<11|s[a+4]<<3|(s[a+5]&224)>>>5}function g(s,a){return a+5<s.length}function p(s,a){return a+1<s.length&&H(s,a)}function m(s,a){return g(s,a)&&H(s,a)&&D(s,a)<=s.length-a}function h(s,a){if(p(s,a)){var A=n(s,a);if(a+A>=s.length)return!1;var E=D(s,a);if(E<=A)return!1;var S=a+E;return S===s.length||p(s,S)}return!1}function o(s,a,A,E,S){if(!s.samplerate){var L=G(a,A,E,S);if(!L)return;s.config=L.config,s.samplerate=L.samplerate,s.channelCount=L.channelCount,s.codec=L.codec,s.manifestCodec=L.manifestCodec,X.logger.log("parsed codec:"+s.codec+", rate:"+L.samplerate+", channels:"+L.channelCount)}}function c(s){return 1024*9e4/s}function l(s,a,A,E,S){var L=n(s,a),O=D(s,a);if(O-=L,O>0){var C=A+E*S;return{headerLength:L,frameLength:O,stamp:C}}}function u(s,a,A,E,S){var L=c(s.samplerate),O=l(a,A,E,S,L);if(O){var C=O.frameLength,T=O.headerLength,x=O.stamp,f=T+C,w=Math.max(0,A+f-a.length),v;w?(v=new Uint8Array(f-T),v.set(a.subarray(A+T,a.length),0)):v=a.subarray(A+T,A+f);var b={unit:v,pts:x};return w||s.samples.push(b),{sample:b,length:f,missing:w}}}},"./src/demux/base-audio-demuxer.ts":function(re,$,P){"use strict";P.r($),P.d($,"initPTSFn",function(){return D});var X=P("./src/polyfills/number.ts"),U=P("./src/demux/id3.ts"),k=P("./src/demux/dummy-demuxed-track.ts"),G=P("./src/utils/mp4-tools.ts"),H=P("./src/utils/typed-array.ts"),n=function(){function g(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var p=g.prototype;return p.resetInitSegment=function(h,o,c){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},p.resetTimeStamp=function(){},p.resetContiguity=function(){},p.canParse=function(h,o){return!1},p.appendFrame=function(h,o,c){},p.demux=function(h,o){this.cachedData&&(h=Object(G.appendUint8Array)(this.cachedData,h),this.cachedData=null);var c=U.getID3Data(h,0),l=c?c.length:0,u,s,a=this._audioTrack,A=this._id3Track,E=c?U.getTimeStamp(c):void 0,S=h.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=D(E,o)),c&&c.length>0&&A.samples.push({pts:this.initPTS,dts:this.initPTS,data:c}),s=this.initPTS;l<S;){if(this.canParse(h,l)){var L=this.appendFrame(a,h,l);L?(this.frameIndex++,s=L.sample.pts,l+=L.length,u=l):l=S}else U.canParse(h,l)?(c=U.getID3Data(h,l),A.samples.push({pts:s,dts:s,data:c}),l+=c.length,u=l):l++;if(l===S&&u!==S){var O=Object(H.sliceUint8)(h,u);this.cachedData?this.cachedData=Object(G.appendUint8Array)(this.cachedData,O):this.cachedData=O}}return{audioTrack:a,avcTrack:Object(k.dummyTrack)(),id3Track:A,textTrack:Object(k.dummyTrack)()}},p.demuxSampleAes=function(h,o,c){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},p.flush=function(h){var o=this.cachedData;return o&&(this.cachedData=null,this.demux(o,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(k.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(k.dummyTrack)()}},p.destroy=function(){},g}(),D=function(p,m){return Object(X.isFiniteNumber)(p)?p*90:m*9e4};$.default=n},"./src/demux/chunk-cache.ts":function(re,$,P){"use strict";P.r($),P.d($,"default",function(){return X});var X=function(){function k(){this.chunks=[],this.dataLength=0}var G=k.prototype;return G.push=function(n){this.chunks.push(n),this.dataLength+=n.length},G.flush=function(){var n=this.chunks,D=this.dataLength,g;if(n.length)n.length===1?g=n[0]:g=U(n,D);else return new Uint8Array(0);return this.reset(),g},G.reset=function(){this.chunks.length=0,this.dataLength=0},k}();function U(k,G){for(var H=new Uint8Array(G),n=0,D=0;D<k.length;D++){var g=k[D];H.set(g,n),n+=g.length}return H}},"./src/demux/dummy-demuxed-track.ts":function(re,$,P){"use strict";P.r($),P.d($,"dummyTrack",function(){return X});function X(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(re,$,P){"use strict";P.r($);var X=P("./src/utils/logger.ts"),U=function(){function k(H){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=H,this.bytesAvailable=H.byteLength,this.word=0,this.bitsAvailable=0}var G=k.prototype;return G.loadWord=function(){var n=this.data,D=this.bytesAvailable,g=n.byteLength-D,p=new Uint8Array(4),m=Math.min(4,D);if(m===0)throw new Error("no bytes available");p.set(n.subarray(g,g+m)),this.word=new DataView(p.buffer).getUint32(0),this.bitsAvailable=m*8,this.bytesAvailable-=m},G.skipBits=function(n){var D;this.bitsAvailable>n?(this.word<<=n,this.bitsAvailable-=n):(n-=this.bitsAvailable,D=n>>3,n-=D>>3,this.bytesAvailable-=D,this.loadWord(),this.word<<=n,this.bitsAvailable-=n)},G.readBits=function(n){var D=Math.min(this.bitsAvailable,n),g=this.word>>>32-D;return n>32&&X.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=D,this.bitsAvailable>0?this.word<<=D:this.bytesAvailable>0&&this.loadWord(),D=n-D,D>0&&this.bitsAvailable?g<<D|this.readBits(D):g},G.skipLZ=function(){var n;for(n=0;n<this.bitsAvailable;++n)if((this.word&2147483648>>>n)!==0)return this.word<<=n,this.bitsAvailable-=n,n;return this.loadWord(),n+this.skipLZ()},G.skipUEG=function(){this.skipBits(1+this.skipLZ())},G.skipEG=function(){this.skipBits(1+this.skipLZ())},G.readUEG=function(){var n=this.skipLZ();return this.readBits(n+1)-1},G.readEG=function(){var n=this.readUEG();return 1&n?1+n>>>1:-1*(n>>>1)},G.readBoolean=function(){return this.readBits(1)===1},G.readUByte=function(){return this.readBits(8)},G.readUShort=function(){return this.readBits(16)},G.readUInt=function(){return this.readBits(32)},G.skipScalingList=function(n){for(var D=8,g=8,p,m=0;m<n;m++)g!==0&&(p=this.readEG(),g=(D+p+256)%256),D=g===0?D:g},G.readSPS=function(){var n=0,D=0,g=0,p=0,m,h,o,c=this.readUByte.bind(this),l=this.readBits.bind(this),u=this.readUEG.bind(this),s=this.readBoolean.bind(this),a=this.skipBits.bind(this),A=this.skipEG.bind(this),E=this.skipUEG.bind(this),S=this.skipScalingList.bind(this);c();var L=c();if(l(5),a(3),c(),E(),L===100||L===110||L===122||L===244||L===44||L===83||L===86||L===118||L===128){var O=u();if(O===3&&a(1),E(),E(),a(1),s())for(h=O!==3?8:12,o=0;o<h;o++)s()&&(o<6?S(16):S(64))}E();var C=u();if(C===0)u();else if(C===1)for(a(1),A(),A(),m=u(),o=0;o<m;o++)A();E(),a(1);var T=u(),x=u(),f=l(1);f===0&&a(1),a(1),s()&&(n=u(),D=u(),g=u(),p=u());var w=[1,1];if(s()&&s()){var v=c();switch(v){case 1:w=[1,1];break;case 2:w=[12,11];break;case 3:w=[10,11];break;case 4:w=[16,11];break;case 5:w=[40,33];break;case 6:w=[24,11];break;case 7:w=[20,11];break;case 8:w=[32,11];break;case 9:w=[80,33];break;case 10:w=[18,11];break;case 11:w=[15,11];break;case 12:w=[64,33];break;case 13:w=[160,99];break;case 14:w=[4,3];break;case 15:w=[3,2];break;case 16:w=[2,1];break;case 255:{w=[c()<<8|c(),c()<<8|c()];break}}}return{width:Math.ceil((T+1)*16-n*2-D*2),height:(2-f)*(x+1)*16-(f?2:4)*(g+p),pixelRatio:w}},G.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},k}();$.default=U},"./src/demux/id3.ts":function(re,$,P){"use strict";P.r($),P.d($,"isHeader",function(){return X}),P.d($,"isFooter",function(){return U}),P.d($,"getID3Data",function(){return k}),P.d($,"canParse",function(){return H}),P.d($,"getTimeStamp",function(){return n}),P.d($,"isTimeStampFrame",function(){return D}),P.d($,"getID3Frames",function(){return p}),P.d($,"decodeFrame",function(){return m}),P.d($,"utf8ArrayToStr",function(){return u}),P.d($,"testables",function(){return s});var X=function(S,L){return L+10<=S.length&&(S[L]===73&&S[L+1]===68&&S[L+2]===51&&(S[L+3]<255&&S[L+4]<255&&(S[L+6]<128&&S[L+7]<128&&S[L+8]<128&&S[L+9]<128)))},U=function(S,L){return L+10<=S.length&&(S[L]===51&&S[L+1]===68&&S[L+2]===73&&(S[L+3]<255&&S[L+4]<255&&(S[L+6]<128&&S[L+7]<128&&S[L+8]<128&&S[L+9]<128)))},k=function(S,L){for(var O=L,C=0;X(S,L);){C+=10;var T=G(S,L+6);C+=T,U(S,L+10)&&(C+=10),L+=C}return C>0?S.subarray(O,O+C):void 0},G=function(S,L){var O=0;return O=(S[L]&127)<<21,O|=(S[L+1]&127)<<14,O|=(S[L+2]&127)<<7,O|=S[L+3]&127,O},H=function(S,L){return X(S,L)&&G(S,L+6)+10<=S.length-L},n=function(S){for(var L=p(S),O=0;O<L.length;O++){var C=L[O];if(D(C))return l(C)}return},D=function(S){return S&&S.key==="PRIV"&&S.info==="com.apple.streaming.transportStreamTimestamp"},g=function(S){var L=String.fromCharCode(S[0],S[1],S[2],S[3]),O=G(S,4),C=10;return{type:L,size:O,data:S.subarray(C,C+O)}},p=function(S){for(var L=0,O=[];X(S,L);){var C=G(S,L+6);L+=10;for(var T=L+C;L+8<T;){var x=g(S.subarray(L)),f=m(x);f&&O.push(f),L+=x.size+10}U(S,L)&&(L+=10)}return O},m=function(S){return S.type==="PRIV"?h(S):S.type[0]==="W"?c(S):o(S)},h=function(S){if(S.size<2)return;var L=u(S.data,!0),O=new Uint8Array(S.data.subarray(L.length+1));return{key:S.type,info:L,data:O.buffer}},o=function(S){if(S.size<2)return;if(S.type==="TXXX"){var L=1,O=u(S.data.subarray(L),!0);L+=O.length+1;var C=u(S.data.subarray(L));return{key:S.type,info:O,data:C}}var T=u(S.data.subarray(1));return{key:S.type,data:T}},c=function(S){if(S.type==="WXXX"){if(S.size<2)return;var L=1,O=u(S.data.subarray(L),!0);L+=O.length+1;var C=u(S.data.subarray(L));return{key:S.type,info:O,data:C}}var T=u(S.data);return{key:S.type,data:T}},l=function(S){if(S.data.byteLength===8){var L=new Uint8Array(S.data),O=L[3]&1,C=(L[4]<<23)+(L[5]<<15)+(L[6]<<7)+L[7];return C/=45,O&&(C+=4772185884e-2),Math.round(C)}return},u=function(S,L){L===void 0&&(L=!1);var O=A();if(O){var C=O.decode(S);if(L){var T=C.indexOf("\0");return T!==-1?C.substring(0,T):C}return C.replace(/\0/g,"")}for(var x=S.length,f,w,v,b="",F=0;F<x;){if(f=S[F++],f===0&&L)return b;if(f===0||f===3)continue;switch(f>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:b+=String.fromCharCode(f);break;case 12:case 13:w=S[F++],b+=String.fromCharCode((f&31)<<6|w&63);break;case 14:w=S[F++],v=S[F++],b+=String.fromCharCode((f&15)<<12|(w&63)<<6|(v&63)<<0);break;default:}}return b},s={decodeTextFrame:o},a;function A(){return!a&&typeof self.TextDecoder!="undefined"&&(a=new self.TextDecoder("utf-8")),a}},"./src/demux/mp3demuxer.ts":function(re,$,P){"use strict";P.r($);var X=P("./src/demux/base-audio-demuxer.ts"),U=P("./src/demux/id3.ts"),k=P("./src/utils/logger.ts"),G=P("./src/demux/mpegaudio.ts");function H(g,p){g.prototype=Object.create(p.prototype),g.prototype.constructor=g,n(g,p)}function n(g,p){return n=Object.setPrototypeOf||function(h,o){return h.__proto__=o,h},n(g,p)}var D=function(g){H(p,g);function p(){return g.apply(this,arguments)||this}var m=p.prototype;return m.resetInitSegment=function(o,c,l){g.prototype.resetInitSegment.call(this,o,c,l),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:o,duration:l,inputTimeScale:9e4,dropped:0}},p.probe=function(o){if(!o)return!1;for(var c=U.getID3Data(o,0)||[],l=c.length,u=o.length;l<u;l++)if(G.probe(o,l))return k.logger.log("MPEG Audio sync word found !"),!0;return!1},m.canParse=function(o,c){return G.canParse(o,c)},m.appendFrame=function(o,c,l){return this.initPTS===null?void 0:G.appendFrame(o,c,l,this.initPTS,this.frameIndex)},p}(X.default);D.minProbeByteLength=4,$.default=D},"./src/demux/mp4demuxer.ts":function(re,$,P){"use strict";P.r($);var X=P("./src/utils/mp4-tools.ts"),U=P("./src/demux/dummy-demuxed-track.ts"),k=function(){function G(n,D){this.remainderData=null,this.config=void 0,this.config=D}var H=G.prototype;return H.resetTimeStamp=function(){},H.resetInitSegment=function(){},H.resetContiguity=function(){},G.probe=function(D){return Object(X.findBox)({data:D,start:0,end:Math.min(D.length,16384)},["moof"]).length>0},H.demux=function(D){var g=D,p=Object(U.dummyTrack)();if(this.config.progressive){this.remainderData&&(g=Object(X.appendUint8Array)(this.remainderData,D));var m=Object(X.segmentValidRange)(g);this.remainderData=m.remainder,p.samples=m.valid||new Uint8Array}else p.samples=g;return{audioTrack:Object(U.dummyTrack)(),avcTrack:p,id3Track:Object(U.dummyTrack)(),textTrack:Object(U.dummyTrack)()}},H.flush=function(){var D=Object(U.dummyTrack)();return D.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(U.dummyTrack)(),avcTrack:D,id3Track:Object(U.dummyTrack)(),textTrack:Object(U.dummyTrack)()}},H.demuxSampleAes=function(D,g,p){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},H.destroy=function(){},G}();k.minProbeByteLength=1024,$.default=k},"./src/demux/mpegaudio.ts":function(re,$,P){"use strict";P.r($),P.d($,"appendFrame",function(){return n}),P.d($,"parseHeader",function(){return D}),P.d($,"isHeaderPattern",function(){return g}),P.d($,"isHeader",function(){return p}),P.d($,"canParse",function(){return m}),P.d($,"probe",function(){return h});var X=null,U=[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],G=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],H=[0,1,1,4];function n(o,c,l,u,s){if(l+24>c.length)return;var a=D(c,l);if(a&&l+a.frameLength<=c.length){var A=a.samplesPerFrame*9e4/a.sampleRate,E=u+s*A,S={unit:c.subarray(l,l+a.frameLength),pts:E,dts:E};return o.config=[],o.channelCount=a.channelCount,o.samplerate=a.sampleRate,o.samples.push(S),{sample:S,length:a.frameLength,missing:0}}}function D(o,c){var l=o[c+1]>>3&3,u=o[c+1]>>1&3,s=o[c+2]>>4&15,a=o[c+2]>>2&3;if(l!==1&&s!==0&&s!==15&&a!==3){var A=o[c+2]>>1&1,E=o[c+3]>>6,S=l===3?3-u:u===3?3:4,L=U[S*14+s-1]*1e3,O=l===3?0:l===2?1:2,C=k[O*3+a],T=E===3?1:2,x=G[l][u],f=H[u],w=x*8*f,v=Math.floor(x*L/C+A)*f;if(X===null){var b=navigator.userAgent||"",F=b.match(/Chrome\/(\d+)/i);X=F?parseInt(F[1]):0}var B=!!X&&X<=87;return B&&u===2&&L>=224e3&&E===0&&(o[c+3]=o[c+3]|128),{sampleRate:C,channelCount:T,frameLength:v,samplesPerFrame:w}}}function g(o,c){return o[c]===255&&(o[c+1]&224)===224&&(o[c+1]&6)!==0}function p(o,c){return c+1<o.length&&g(o,c)}function m(o,c){var l=4;return g(o,c)&&l<=o.length-c}function h(o,c){if(c+1<o.length&&g(o,c)){var l=4,u=D(o,c),s=l;u!=null&&u.frameLength&&(s=u.frameLength);var a=c+s;return a===o.length||p(o,a)}return!1}},"./src/demux/sample-aes.ts":function(re,$,P){"use strict";P.r($);var X=P("./src/crypt/decrypter.ts"),U=P("./src/demux/tsdemuxer.ts"),k=function(){function G(n,D,g){this.keyData=void 0,this.decrypter=void 0,this.keyData=g,this.decrypter=new X.default(n,D,{removePKCS7Padding:!1})}var H=G.prototype;return H.decryptBuffer=function(D,g){this.decrypter.decrypt(D,this.keyData.key.buffer,this.keyData.iv.buffer,g)},H.decryptAacSample=function(D,g,p,m){var h=D[g].unit,o=h.subarray(16,h.length-h.length%16),c=o.buffer.slice(o.byteOffset,o.byteOffset+o.length),l=this;this.decryptBuffer(c,function(u){var s=new Uint8Array(u);h.set(s,16),m||l.decryptAacSamples(D,g+1,p)})},H.decryptAacSamples=function(D,g,p){for(;;g++){if(g>=D.length){p();return}if(D[g].unit.length<32)continue;var m=this.decrypter.isSync();if(this.decryptAacSample(D,g,p,m),!m)return}},H.getAvcEncryptedData=function(D){for(var g=Math.floor((D.length-48)/160)*16+16,p=new Int8Array(g),m=0,h=32;h<=D.length-16;h+=160,m+=16)p.set(D.subarray(h,h+16),m);return p},H.getAvcDecryptedUnit=function(D,g){for(var p=new Uint8Array(g),m=0,h=32;h<=D.length-16;h+=160,m+=16)D.set(p.subarray(m,m+16),h);return D},H.decryptAvcSample=function(D,g,p,m,h,o){var c=Object(U.discardEPB)(h.data),l=this.getAvcEncryptedData(c),u=this;this.decryptBuffer(l.buffer,function(s){h.data=u.getAvcDecryptedUnit(c,s),o||u.decryptAvcSamples(D,g,p+1,m)})},H.decryptAvcSamples=function(D,g,p,m){if(D instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;g++,p=0){if(g>=D.length){m();return}for(var h=D[g].units;!(p>=h.length);p++){var o=h[p];if(o.data.length<=48||o.type!==1&&o.type!==5)continue;var c=this.decrypter.isSync();if(this.decryptAvcSample(D,g,p,m,o,c),!c)return}}},G}();$.default=k},"./src/demux/transmuxer-interface.ts":function(re,$,P){"use strict";P.r($),P.d($,"default",function(){return h});var X=P("./node_modules/webworkify-webpack/index.js"),U=P.n(X),k=P("./src/events.ts"),G=P("./src/demux/transmuxer.ts"),H=P("./src/utils/logger.ts"),n=P("./src/errors.ts"),D=P("./src/utils/mediasource-helper.ts"),g=P("./node_modules/eventemitter3/index.js"),p=P.n(g),m=Object(D.getMediaSource)()||{isTypeSupported:function(){return!1}},h=function(){function o(l,u,s,a){var A=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.hls=l,this.id=u,this.onTransmuxComplete=s,this.onFlush=a;var E=l.config,S=function(x,f){f=f||{},f.frag=A.frag,f.id=A.id,l.trigger(x,f)};this.observer=new g.EventEmitter,this.observer.on(k.Events.FRAG_DECRYPTED,S),this.observer.on(k.Events.ERROR,S);var L={mp4:m.isTypeSupported("video/mp4"),mpeg:m.isTypeSupported("audio/mpeg"),mp3:m.isTypeSupported('audio/mp4; codecs="mp3"')},O=navigator.vendor;if(E.enableWorker&&typeof Worker!="undefined"){H.logger.log("demuxing in webworker");var C;try{C=this.worker=X("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),C.addEventListener("message",this.onwmsg),C.onerror=function(T){l.trigger(k.Events.ERROR,{type:n.ErrorTypes.OTHER_ERROR,details:n.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(T.message+" ("+T.filename+":"+T.lineno+")")})},C.postMessage({cmd:"init",typeSupported:L,vendor:O,id:u,config:JSON.stringify(E)})}catch(T){H.logger.warn("Error in worker:",T),H.logger.error("Error while initializing DemuxerWorker, fallback to inline"),C&&self.URL.revokeObjectURL(C.objectURL),this.transmuxer=new G.default(this.observer,L,E,O,u),this.worker=null}}else this.transmuxer=new G.default(this.observer,L,E,O,u)}var c=o.prototype;return c.destroy=function(){var u=this.worker;if(u)u.removeEventListener("message",this.onwmsg),u.terminate(),this.worker=null;else{var s=this.transmuxer;s&&(s.destroy(),this.transmuxer=null)}var a=this.observer;a&&a.removeAllListeners(),this.observer=null},c.push=function(u,s,a,A,E,S,L,O,C,T){var x=this;C.transmuxing.start=self.performance.now();var f=this.transmuxer,w=this.worker,v=S?S.start:E.start,b=E.decryptdata,F=this.frag,B=!(F&&E.cc===F.cc),R=!(F&&C.level===F.level),j=F?C.sn-F.sn:-1,N=this.part?C.part-this.part.index:1,y=!R&&(j===1||j===0&&N===1),Y=self.performance.now();(R||j||E.stats.parsing.start===0)&&(E.stats.parsing.start=Y),S&&(N||!y)&&(S.stats.parsing.start=Y);var ee=new G.TransmuxState(B,y,O,R,v);if(!y||B){H.logger.log("[transmuxer-interface, "+E.type+"]: Starting new transmux session for sn: "+C.sn+" p: "+C.part+" level: "+C.level+" id: "+C.id+`
|
|
discontinuity: `+B+`
|
|
trackSwitch: `+R+`
|
|
contiguous: `+y+`
|
|
accurateTimeOffset: `+O+`
|
|
timeOffset: `+v);var ae=new G.TransmuxConfig(a,A,s,L,T);this.configureTransmuxer(ae)}if(this.frag=E,this.part=S,w)w.postMessage({cmd:"demux",data:u,decryptdata:b,chunkMeta:C,state:ee},u instanceof ArrayBuffer?[u]:[]);else if(f){var ue=f.push(u,b,C,ee);Object(G.isPromise)(ue)?ue.then(function(Re){x.handleTransmuxComplete(Re)}):this.handleTransmuxComplete(ue)}},c.flush=function(u){var s=this;u.transmuxing.start=self.performance.now();var a=this.transmuxer,A=this.worker;if(A)A.postMessage({cmd:"flush",chunkMeta:u});else if(a){var E=a.flush(u);Object(G.isPromise)(E)?E.then(function(S){s.handleFlushResult(S,u)}):this.handleFlushResult(E,u)}},c.handleFlushResult=function(u,s){var a=this;u.forEach(function(A){a.handleTransmuxComplete(A)}),this.onFlush(s)},c.onWorkerMessage=function(u){var s=u.data,a=this.hls;switch(s.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(s.data);break}case"flush":{this.onFlush(s.data);break}default:{s.data=s.data||{},s.data.frag=this.frag,s.data.id=this.id,a.trigger(s.event,s.data);break}}},c.configureTransmuxer=function(u){var s=this.worker,a=this.transmuxer;s?s.postMessage({cmd:"configure",config:u}):a&&a.configure(u)},c.handleTransmuxComplete=function(u){u.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(u)},o}()},"./src/demux/transmuxer-worker.ts":function(re,$,P){"use strict";P.r($),P.d($,"default",function(){return n});var X=P("./src/demux/transmuxer.ts"),U=P("./src/events.ts"),k=P("./src/utils/logger.ts"),G=P("./node_modules/eventemitter3/index.js"),H=P.n(G);function n(h){var o=new G.EventEmitter,c=function(u,s){h.postMessage({event:u,data:s})};o.on(U.Events.FRAG_DECRYPTED,c),o.on(U.Events.ERROR,c),h.addEventListener("message",function(l){var u=l.data;switch(u.cmd){case"init":{var s=JSON.parse(u.config);h.transmuxer=new X.default(o,u.typeSupported,s,u.vendor,u.id),Object(k.enableLogs)(s.debug),c("init",null);break}case"configure":{h.transmuxer.configure(u.config);break}case"demux":{var a=h.transmuxer.push(u.data,u.decryptdata,u.chunkMeta,u.state);Object(X.isPromise)(a)?a.then(function(S){D(h,S)}):D(h,a);break}case"flush":{var A=u.chunkMeta,E=h.transmuxer.flush(A);Object(X.isPromise)(E)?E.then(function(S){p(h,S,A)}):p(h,E,A);break}default:break}})}function D(h,o){if(m(o.remuxResult))return;var c=[],l=o.remuxResult,u=l.audio,s=l.video;u&&g(c,u),s&&g(c,s),h.postMessage({event:"transmuxComplete",data:o},c)}function g(h,o){o.data1&&h.push(o.data1.buffer),o.data2&&h.push(o.data2.buffer)}function p(h,o,c){o.forEach(function(l){D(h,l)}),h.postMessage({event:"flush",data:c})}function m(h){return!h.audio&&!h.video&&!h.text&&!h.id3&&!h.initSegment}},"./src/demux/transmuxer.ts":function(re,$,P){"use strict";P.r($),P.d($,"default",function(){return s}),P.d($,"isPromise",function(){return E}),P.d($,"TransmuxConfig",function(){return S}),P.d($,"TransmuxState",function(){return L});var X=P("./src/events.ts"),U=P("./src/errors.ts"),k=P("./src/crypt/decrypter.ts"),G=P("./src/demux/aacdemuxer.ts"),H=P("./src/demux/mp4demuxer.ts"),n=P("./src/demux/tsdemuxer.ts"),D=P("./src/demux/mp3demuxer.ts"),g=P("./src/remux/mp4-remuxer.ts"),p=P("./src/remux/passthrough-remuxer.ts"),m=P("./src/demux/chunk-cache.ts"),h=P("./src/utils/mp4-tools.ts"),o=P("./src/utils/logger.ts"),c;try{c=self.performance.now.bind(self.performance)}catch(O){o.logger.debug("Unable to use Performance API on this environment"),c=self.Date.now}var l=[{demux:n.default,remux:g.default},{demux:H.default,remux:p.default},{demux:G.default,remux:g.default},{demux:D.default,remux:g.default}],u=1024;l.forEach(function(O){var C=O.demux;u=Math.max(u,C.minProbeByteLength)});var s=function(){function O(T,x,f,w,v){this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.cache=new m.default,this.observer=T,this.typeSupported=x,this.config=f,this.vendor=w,this.id=v}var C=O.prototype;return C.configure=function(x){this.transmuxConfig=x,this.decrypter&&this.decrypter.reset()},C.push=function(x,f,w,v){var b=this,F=w.transmuxing;F.executeStart=c();var B=new Uint8Array(x),R=this.cache,j=this.config,N=this.currentTransmuxState,y=this.transmuxConfig;v&&(this.currentTransmuxState=v);var Y=a(B,f);if(Y&&Y.method==="AES-128"){var ee=this.getDecrypter();if(j.enableSoftwareAES){var ae=ee.softwareDecrypt(B,Y.key.buffer,Y.iv.buffer);if(!ae)return F.executeEnd=c(),A(w);B=new Uint8Array(ae)}else return this.decryptionPromise=ee.webCryptoDecrypt(B,Y.key.buffer,Y.iv.buffer).then(function(je){var Ze=b.push(je,null,w);return b.decryptionPromise=null,Ze}),this.decryptionPromise}var ue=v||N,Re=ue.contiguous,Ee=ue.discontinuity,xe=ue.trackSwitch,Ce=ue.accurateTimeOffset,Oe=ue.timeOffset,pe=y.audioCodec,de=y.videoCodec,Me=y.defaultInitPts,tt=y.duration,We=y.initSegmentData;if((Ee||xe)&&this.resetInitSegment(We,pe,de,tt),Ee&&this.resetInitialTimestamp(Me),Re||this.resetContiguity(),this.needsProbing(B,Ee,xe)){if(R.dataLength){var rt=R.flush();B=Object(h.appendUint8Array)(rt,B)}this.configureTransmuxer(B,y)}var st=this.transmux(B,Y,Oe,Ce,w),Pe=this.currentTransmuxState;return Pe.contiguous=!0,Pe.discontinuity=!1,Pe.trackSwitch=!1,F.executeEnd=c(),st},C.flush=function(x){var f=this,w=x.transmuxing;w.executeStart=c();var v=this.decrypter,b=this.cache,F=this.currentTransmuxState,B=this.decryptionPromise;if(B)return B.then(function(){return f.flush(x)});var R=[],j=F.timeOffset;if(v){var N=v.flush();N&&R.push(this.push(N,null,x))}var y=b.dataLength;b.reset();var Y=this.demuxer,ee=this.remuxer;if(!Y||!ee)return y>=u&&this.observer.emit(X.Events.ERROR,X.Events.ERROR,{type:U.ErrorTypes.MEDIA_ERROR,details:U.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),w.executeEnd=c(),[A(x)];var ae=Y.flush(j);return E(ae)?ae.then(function(ue){return f.flushRemux(R,ue,x),R}):(this.flushRemux(R,ae,x),R)},C.flushRemux=function(x,f,w){var v=f.audioTrack,b=f.avcTrack,F=f.id3Track,B=f.textTrack,R=this.currentTransmuxState,j=R.accurateTimeOffset,N=R.timeOffset;o.logger.log("[transmuxer.ts]: Flushed fragment "+w.sn+(w.part>-1?" p: "+w.part:"")+" of level "+w.level);var y=this.remuxer.remux(v,b,F,B,N,j,!0,this.id);x.push({remuxResult:y,chunkMeta:w}),w.transmuxing.executeEnd=c()},C.resetInitialTimestamp=function(x){var f=this.demuxer,w=this.remuxer;if(!f||!w)return;f.resetTimeStamp(x),w.resetTimeStamp(x)},C.resetContiguity=function(){var x=this.demuxer,f=this.remuxer;if(!x||!f)return;x.resetContiguity(),f.resetNextTimestamp()},C.resetInitSegment=function(x,f,w,v){var b=this.demuxer,F=this.remuxer;if(!b||!F)return;b.resetInitSegment(f,w,v),F.resetInitSegment(x,f,w)},C.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},C.transmux=function(x,f,w,v,b){var F;return f&&f.method==="SAMPLE-AES"?F=this.transmuxSampleAes(x,f,w,v,b):F=this.transmuxUnencrypted(x,w,v,b),F},C.transmuxUnencrypted=function(x,f,w,v){var b=this.demuxer.demux(x,f,!1,!this.config.progressive),F=b.audioTrack,B=b.avcTrack,R=b.id3Track,j=b.textTrack,N=this.remuxer.remux(F,B,R,j,f,w,!1,this.id);return{remuxResult:N,chunkMeta:v}},C.transmuxSampleAes=function(x,f,w,v,b){var F=this;return this.demuxer.demuxSampleAes(x,f,w).then(function(B){var R=F.remuxer.remux(B.audioTrack,B.avcTrack,B.id3Track,B.textTrack,w,v,!1,F.id);return{remuxResult:R,chunkMeta:b}})},C.configureTransmuxer=function(x,f){for(var w=this.config,v=this.observer,b=this.typeSupported,F=this.vendor,B=f.audioCodec,R=f.defaultInitPts,j=f.duration,N=f.initSegmentData,y=f.videoCodec,Y,ee=0,ae=l.length;ee<ae;ee++)if(l[ee].demux.probe(x)){Y=l[ee];break}Y||(o.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),Y={demux:H.default,remux:p.default});var ue=this.demuxer,Re=this.remuxer,Ee=Y.remux,xe=Y.demux;(!Re||!(Re instanceof Ee))&&(this.remuxer=new Ee(v,w,b,F)),(!ue||!(ue instanceof xe))&&(this.demuxer=new xe(v,w,b),this.probe=xe.probe),this.resetInitSegment(N,B,y,j),this.resetInitialTimestamp(R)},C.needsProbing=function(x,f,w){return!this.demuxer||!this.remuxer||f||w},C.getDecrypter=function(){var x=this.decrypter;return x||(x=this.decrypter=new k.default(this.observer,this.config)),x},O}();function a(O,C){var T=null;return O.byteLength>0&&C!=null&&C.key!=null&&C.iv!==null&&C.method!=null&&(T=C),T}var A=function(C){return{remuxResult:{},chunkMeta:C}};function E(O){return"then"in O&&O.then instanceof Function}var S=function(C,T,x,f,w){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=C,this.videoCodec=T,this.initSegmentData=x,this.duration=f,this.defaultInitPts=w},L=function(C,T,x,f,w){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=C,this.contiguous=T,this.accurateTimeOffset=x,this.trackSwitch=f,this.timeOffset=w}},"./src/demux/tsdemuxer.ts":function(re,$,P){"use strict";P.r($),P.d($,"discardEPB",function(){return A});var X=P("./src/demux/adts.ts"),U=P("./src/demux/mpegaudio.ts"),k=P("./src/demux/exp-golomb.ts"),G=P("./src/demux/id3.ts"),H=P("./src/demux/sample-aes.ts"),n=P("./src/events.ts"),D=P("./src/utils/mp4-tools.ts"),g=P("./src/utils/logger.ts"),p=P("./src/errors.ts"),m={video:1,audio:2,id3:3,text:4},h=function(){function E(L,O,C){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=L,this.config=O,this.typeSupported=C}E.probe=function(O){var C=E.syncOffset(O);return C<0?!1:(C&&g.logger.warn("MPEG2-TS detected but first sync word found @ offset "+C+", junk ahead ?"),!0)},E.syncOffset=function(O){for(var C=Math.min(1e3,O.length-3*188),T=0;T<C;){if(O[T]===71&&O[T+188]===71&&O[T+2*188]===71)return T;T++}return-1},E.createTrack=function(O,C){return{container:O==="video"||O==="audio"?"video/mp2t":void 0,type:O,id:m[O],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:O==="audio"?C:void 0}};var S=E.prototype;return S.resetInitSegment=function(O,C,T){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=E.createTrack("video",T),this._audioTrack=E.createTrack("audio",T),this._id3Track=E.createTrack("id3",T),this._txtTrack=E.createTrack("text",T),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=O,this.videoCodec=C,this._duration=T},S.resetTimeStamp=function(){},S.resetContiguity=function(){var O=this._audioTrack,C=this._avcTrack,T=this._id3Track;O&&(O.pesData=null),C&&(C.pesData=null),T&&(T.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},S.demux=function(O,C,T,x){T===void 0&&(T=!1),x===void 0&&(x=!1),T||(this.sampleAes=null);var f,w=this._avcTrack,v=this._audioTrack,b=this._id3Track,F=w.pid,B=w.pesData,R=v.pid,j=b.pid,N=v.pesData,y=b.pesData,Y=!1,ee=this.pmtParsed,ae=this._pmtId,ue=O.length;if(this.remainderData&&(O=Object(D.appendUint8Array)(this.remainderData,O),ue=O.length,this.remainderData=null),ue<188&&!x)return this.remainderData=O,{audioTrack:v,avcTrack:w,id3Track:b,textTrack:this._txtTrack};var Re=Math.max(0,E.syncOffset(O));ue-=(ue+Re)%188,ue<O.byteLength&&!x&&(this.remainderData=new Uint8Array(O.buffer,ue,O.buffer.byteLength-ue));for(var Ee=Re;Ee<ue;Ee+=188)if(O[Ee]===71){var xe=!!(O[Ee+1]&64),Ce=((O[Ee+1]&31)<<8)+O[Ee+2],Oe=(O[Ee+3]&48)>>4,pe=void 0;if(Oe>1){if(pe=Ee+5+O[Ee+4],pe===Ee+188)continue}else pe=Ee+4;switch(Ce){case F:xe&&(B&&(f=u(B))&&this.parseAVCPES(f,!1),B={data:[],size:0}),B&&(B.data.push(O.subarray(pe,Ee+188)),B.size+=Ee+188-pe);break;case R:xe&&(N&&(f=u(N))&&(v.isAAC?this.parseAACPES(f):this.parseMPEGPES(f)),N={data:[],size:0}),N&&(N.data.push(O.subarray(pe,Ee+188)),N.size+=Ee+188-pe);break;case j:xe&&(y&&(f=u(y))&&this.parseID3PES(f),y={data:[],size:0}),y&&(y.data.push(O.subarray(pe,Ee+188)),y.size+=Ee+188-pe);break;case 0:xe&&(pe+=O[pe]+1),ae=this._pmtId=c(O,pe);break;case ae:{xe&&(pe+=O[pe]+1);var de=l(O,pe,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,T);F=de.avc,F>0&&(w.pid=F),R=de.audio,R>0&&(v.pid=R,v.isAAC=de.isAAC),j=de.id3,j>0&&(b.pid=j),Y&&!ee&&(g.logger.log("reparse from beginning"),Y=!1,Ee=Re-188),ee=this.pmtParsed=!0;break}case 17:case 8191:break;default:Y=!0;break}}else this.observer.emit(n.Events.ERROR,n.Events.ERROR,{type:p.ErrorTypes.MEDIA_ERROR,details:p.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});w.pesData=B,v.pesData=N,b.pesData=y;var Me={audioTrack:v,avcTrack:w,id3Track:b,textTrack:this._txtTrack};return x&&this.extractRemainingSamples(Me),Me},S.flush=function(){var O=this.remainderData;this.remainderData=null;var C;return O?C=this.demux(O,-1,!1,!0):C={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(C),this.sampleAes?this.decrypt(C,this.sampleAes):C},S.extractRemainingSamples=function(O){var C=O.audioTrack,T=O.avcTrack,x=O.id3Track,f=T.pesData,w=C.pesData,v=x.pesData,b;f&&(b=u(f))?(this.parseAVCPES(b,!0),T.pesData=null):T.pesData=f,w&&(b=u(w))?(C.isAAC?this.parseAACPES(b):this.parseMPEGPES(b),C.pesData=null):(w!=null&&w.size&&g.logger.log("last AAC PES packet truncated,might overlap between fragments"),C.pesData=w),v&&(b=u(v))?(this.parseID3PES(b),x.pesData=null):x.pesData=v},S.demuxSampleAes=function(O,C,T){var x=this.demux(O,T,!0,!this.config.progressive),f=this.sampleAes=new H.default(this.observer,this.config,C);return this.decrypt(x,f)},S.decrypt=function(O,C){return new Promise(function(T){var x=O.audioTrack,f=O.avcTrack;x.samples&&x.isAAC?C.decryptAacSamples(x.samples,0,function(){f.samples?C.decryptAvcSamples(f.samples,0,0,function(){T(O)}):T(O)}):f.samples&&C.decryptAvcSamples(f.samples,0,0,function(){T(O)})})},S.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},S.parseAVCPES=function(O,C){var T=this,x=this._avcTrack,f=this.parseAVCNALu(O.data),w=!1,v=this.avcSample,b,F=!1;O.data=null,v&&f.length&&!x.audFound&&(s(v,x),v=this.avcSample=o(!1,O.pts,O.dts,"")),f.forEach(function(B){switch(B.type){case 1:{b=!0,v||(v=T.avcSample=o(!0,O.pts,O.dts,"")),w&&(v.debug+="NDR "),v.frame=!0;var R=B.data;if(F&&R.length>4){var j=new k.default(R).readSliceType();(j===2||j===4||j===7||j===9)&&(v.key=!0)}break}case 5:b=!0,v||(v=T.avcSample=o(!0,O.pts,O.dts,"")),w&&(v.debug+="IDR "),v.key=!0,v.frame=!0;break;case 6:{b=!0,w&&v&&(v.debug+="SEI ");var N=new k.default(A(B.data));N.readUByte();for(var y=0,Y=0,ee=!1,ae=0;!ee&&N.bytesAvailable>1;){y=0;do ae=N.readUByte(),y+=ae;while(ae===255);Y=0;do ae=N.readUByte(),Y+=ae;while(ae===255);if(y===4&&N.bytesAvailable!==0){ee=!0;var ue=N.readUByte();if(ue===181){var Re=N.readUShort();if(Re===49){var Ee=N.readUInt();if(Ee===1195456820){var xe=N.readUByte();if(xe===3){for(var Ce=N.readUByte(),Oe=N.readUByte(),pe=31&Ce,de=[Ce,Oe],Me=0;Me<pe;Me++)de.push(N.readUByte()),de.push(N.readUByte()),de.push(N.readUByte());a(T._txtTrack.samples,{type:3,pts:O.pts,bytes:de})}}}}}else if(y===5&&N.bytesAvailable!==0){if(ee=!0,Y>16){for(var tt=[],We=0;We<16;We++)tt.push(N.readUByte().toString(16)),(We===3||We===5||We===7||We===9)&&tt.push("-");for(var rt=Y-16,st=new Uint8Array(rt),Pe=0;Pe<rt;Pe++)st[Pe]=N.readUByte();a(T._txtTrack.samples,{pts:O.pts,payloadType:y,uuid:tt.join(""),userData:Object(G.utf8ArrayToStr)(st),userDataBytes:st})}}else if(Y<N.bytesAvailable)for(var je=0;je<Y;je++)N.readUByte()}break}case 7:if(b=!0,F=!0,w&&v&&(v.debug+="SPS "),!x.sps){var Ze=new k.default(B.data),se=Ze.readSPS();x.width=se.width,x.height=se.height,x.pixelRatio=se.pixelRatio,x.sps=[B.data],x.duration=T._duration;for(var _e=B.data.subarray(1,4),Te="avc1.",Ae=0;Ae<3;Ae++){var ze=_e[Ae].toString(16);ze.length<2&&(ze="0"+ze),Te+=ze}x.codec=Te}break;case 8:b=!0,w&&v&&(v.debug+="PPS "),x.pps||(x.pps=[B.data]);break;case 9:b=!1,x.audFound=!0,v&&s(v,x),v=T.avcSample=o(!1,O.pts,O.dts,w?"AUD ":"");break;case 12:b=!1;break;default:b=!1,v&&(v.debug+="unknown NAL "+B.type+" ");break}if(v&&b){var Be=v.units;Be.push(B)}}),C&&v&&(s(v,x),this.avcSample=null)},S.getLastNalUnit=function(){var O,C=this.avcSample,T;if(!C||C.units.length===0){var x=this._avcTrack.samples;C=x[x.length-1]}if((O=C)!==null&&O!==void 0&&O.units){var f=C.units;T=f[f.length-1]}return T},S.parseAVCNALu=function(O){var C=O.byteLength,T=this._avcTrack,x=T.naluState||0,f=x,w=[],v=0,b,F,B,R=-1,j=0;for(x===-1&&(R=0,j=O[0]&31,x=0,v=1);v<C;){if(b=O[v++],!x){x=b?0:1;continue}if(x===1){x=b?0:2;continue}if(!b)x=3;else if(b===1){if(R>=0){var N={data:O.subarray(R,v-x-1),type:j};w.push(N)}else{var y=this.getLastNalUnit();if(y&&(f&&v<=4-f&&(y.state&&(y.data=y.data.subarray(0,y.data.byteLength-f))),F=v-x-1,F>0)){var Y=new Uint8Array(y.data.byteLength+F);Y.set(y.data,0),Y.set(O.subarray(0,F),y.data.byteLength),y.data=Y,y.state=0}}v<C?(B=O[v]&31,R=v,j=B,x=0):x=-1}else x=0}if(R>=0&&x>=0){var ee={data:O.subarray(R,C),type:j,state:x};w.push(ee)}if(w.length===0){var ae=this.getLastNalUnit();if(ae){var ue=new Uint8Array(ae.data.byteLength+O.byteLength);ue.set(ae.data,0),ue.set(O,ae.data.byteLength),ae.data=ue}}return T.naluState=x,w},S.parseAACPES=function(O){var C=0,T=this._audioTrack,x=this.aacOverFlow,f=O.data;if(x){this.aacOverFlow=null;var w=x.sample.unit.byteLength,v=Math.min(x.missing,w),b=w-v;x.sample.unit.set(f.subarray(0,v),b),T.samples.push(x.sample),C=x.missing}var F,B;for(F=C,B=f.length;F<B-1&&!X.isHeader(f,F);F++);if(F!==C){var R,j;if(F<B-1?(R="AAC PES did not start with ADTS header,offset:"+F,j=!1):(R="no ADTS header found in AAC PES",j=!0),g.logger.warn("parsing error:"+R),this.observer.emit(n.Events.ERROR,n.Events.ERROR,{type:p.ErrorTypes.MEDIA_ERROR,details:p.ErrorDetails.FRAG_PARSING_ERROR,fatal:j,reason:R}),j)return}X.initTrackConfig(T,this.observer,f,F,this.audioCodec);var N;if(O.pts!==void 0)N=O.pts;else if(x){var y=X.getFrameDuration(T.samplerate);N=x.sample.pts+y}else{g.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var Y=0;F<B;)if(X.isHeader(f,F)){if(F+5<B){var ee=X.appendFrame(T,f,F,N,Y);if(ee)if(ee.missing)this.aacOverFlow=ee;else{F+=ee.length,Y++;continue}}break}else F++},S.parseMPEGPES=function(O){var C=O.data,T=C.length,x=0,f=0,w=O.pts;if(w===void 0){g.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;f<T;)if(U.isHeader(C,f)){var v=U.appendFrame(this._audioTrack,C,f,w,x);if(v)f+=v.length,x++;else break}else f++},S.parseID3PES=function(O){if(O.pts===void 0){g.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(O)},E}();h.minProbeByteLength=188;function o(E,S,L,O){return{key:E,frame:!1,pts:S,dts:L,units:[],debug:O,length:0}}function c(E,S){return(E[S+10]&31)<<8|E[S+11]}function l(E,S,L,O){var C={audio:-1,avc:-1,id3:-1,isAAC:!0},T=(E[S+1]&15)<<8|E[S+2],x=S+3+T-4,f=(E[S+10]&15)<<8|E[S+11];for(S+=12+f;S<x;){var w=(E[S+1]&31)<<8|E[S+2];switch(E[S]){case 207:if(!O){g.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:C.audio===-1&&(C.audio=w);break;case 21:C.id3===-1&&(C.id3=w);break;case 219:if(!O){g.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:C.avc===-1&&(C.avc=w);break;case 3:case 4:L?C.audio===-1&&(C.audio=w,C.isAAC=!1):g.logger.log("MPEG audio found, not supported in this browser");break;case 36:g.logger.warn("Unsupported HEVC stream type found");break;default:break}S+=((E[S+3]&15)<<8|E[S+4])+5}return C}function u(E){var S=0,L,O,C,T,x,f=E.data;if(!E||E.size===0)return null;for(;f[0].length<19&&f.length>1;){var w=new Uint8Array(f[0].length+f[1].length);w.set(f[0]),w.set(f[1],f[0].length),f[0]=w,f.splice(1,1)}L=f[0];var v=(L[0]<<16)+(L[1]<<8)+L[2];if(v===1){if(O=(L[4]<<8)+L[5],O&&O>E.size-6)return null;var b=L[7];b&192&&(T=(L[9]&14)*536870912+(L[10]&255)*4194304+(L[11]&254)*16384+(L[12]&255)*128+(L[13]&254)/2,b&64?(x=(L[14]&14)*536870912+(L[15]&255)*4194304+(L[16]&254)*16384+(L[17]&255)*128+(L[18]&254)/2,T-x>60*9e4&&(g.logger.warn(Math.round((T-x)/9e4)+"s delta between PTS and DTS, align them"),T=x)):x=T),C=L[8];var F=C+9;if(E.size<=F)return null;E.size-=F;for(var B=new Uint8Array(E.size),R=0,j=f.length;R<j;R++){L=f[R];var N=L.byteLength;if(F)if(F>N){F-=N;continue}else L=L.subarray(F),N-=F,F=0;B.set(L,S),S+=N}return O&&(O-=C+3),{data:B,pts:T,dts:x,len:O}}return null}function s(E,S){if(E.units.length&&E.frame){if(E.pts===void 0){var L=S.samples,O=L.length;if(O){var C=L[O-1];E.pts=C.pts,E.dts=C.dts}else{S.dropped++;return}}S.samples.push(E)}E.debug.length&&g.logger.log(E.pts+"/"+E.dts+":"+E.debug)}function a(E,S){var L=E.length;if(L>0){if(S.pts>=E[L-1].pts)E.push(S);else for(var O=L-1;O>=0;O--)if(S.pts<E[O].pts){E.splice(O,0,S);break}}else E.push(S)}function A(E){for(var S=E.byteLength,L=[],O=1;O<S-2;)E[O]===0&&E[O+1]===0&&E[O+2]===3?(L.push(O+2),O+=2):O++;if(L.length===0)return E;var C=S-L.length,T=new Uint8Array(C),x=0;for(O=0;O<C;x++,O++)x===L[0]&&(x++,L.shift()),T[O]=E[x];return T}$.default=h},"./src/errors.ts":function(re,$,P){"use strict";P.r($),P.d($,"ErrorTypes",function(){return X}),P.d($,"ErrorDetails",function(){return U});var X;(function(k){k.NETWORK_ERROR="networkError",k.MEDIA_ERROR="mediaError",k.KEY_SYSTEM_ERROR="keySystemError",k.MUX_ERROR="muxError",k.OTHER_ERROR="otherError"})(X||(X={}));var U;(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"})(U||(U={}))},"./src/events.ts":function(re,$,P){"use strict";P.r($),P.d($,"Events",function(){return X});var X;(function(U){U.MEDIA_ATTACHING="hlsMediaAttaching",U.MEDIA_ATTACHED="hlsMediaAttached",U.MEDIA_DETACHING="hlsMediaDetaching",U.MEDIA_DETACHED="hlsMediaDetached",U.BUFFER_RESET="hlsBufferReset",U.BUFFER_CODECS="hlsBufferCodecs",U.BUFFER_CREATED="hlsBufferCreated",U.BUFFER_APPENDING="hlsBufferAppending",U.BUFFER_APPENDED="hlsBufferAppended",U.BUFFER_EOS="hlsBufferEos",U.BUFFER_FLUSHING="hlsBufferFlushing",U.BUFFER_FLUSHED="hlsBufferFlushed",U.MANIFEST_LOADING="hlsManifestLoading",U.MANIFEST_LOADED="hlsManifestLoaded",U.MANIFEST_PARSED="hlsManifestParsed",U.LEVEL_SWITCHING="hlsLevelSwitching",U.LEVEL_SWITCHED="hlsLevelSwitched",U.LEVEL_LOADING="hlsLevelLoading",U.LEVEL_LOADED="hlsLevelLoaded",U.LEVEL_UPDATED="hlsLevelUpdated",U.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",U.LEVELS_UPDATED="hlsLevelsUpdated",U.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",U.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",U.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",U.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",U.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",U.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",U.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",U.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",U.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",U.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",U.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",U.CUES_PARSED="hlsCuesParsed",U.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",U.INIT_PTS_FOUND="hlsInitPtsFound",U.FRAG_LOADING="hlsFragLoading",U.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",U.FRAG_LOADED="hlsFragLoaded",U.FRAG_DECRYPTED="hlsFragDecrypted",U.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",U.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",U.FRAG_PARSING_METADATA="hlsFragParsingMetadata",U.FRAG_PARSED="hlsFragParsed",U.FRAG_BUFFERED="hlsFragBuffered",U.FRAG_CHANGED="hlsFragChanged",U.FPS_DROP="hlsFpsDrop",U.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",U.ERROR="hlsError",U.DESTROYING="hlsDestroying",U.KEY_LOADING="hlsKeyLoading",U.KEY_LOADED="hlsKeyLoaded",U.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",U.BACK_BUFFER_REACHED="hlsBackBufferReached"})(X||(X={}))},"./src/hls.ts":function(re,$,P){"use strict";P.r($),P.d($,"default",function(){return E});var X=P("./node_modules/url-toolkit/src/url-toolkit.js"),U=P.n(X),k=P("./src/loader/playlist-loader.ts"),G=P("./src/loader/key-loader.ts"),H=P("./src/controller/id3-track-controller.ts"),n=P("./src/controller/latency-controller.ts"),D=P("./src/controller/level-controller.ts"),g=P("./src/controller/fragment-tracker.ts"),p=P("./src/controller/stream-controller.ts"),m=P("./src/is-supported.ts"),h=P("./src/utils/logger.ts"),o=P("./src/config.ts"),c=P("./node_modules/eventemitter3/index.js"),l=P.n(c),u=P("./src/events.ts"),s=P("./src/errors.ts");function a(S,L){for(var O=0;O<L.length;O++){var C=L[O];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(S,C.key,C)}}function A(S,L,O){return L&&a(S.prototype,L),O&&a(S,O),S}var E=function(){S.isSupported=function(){return Object(m.isSupported)()};function S(O){O===void 0&&(O={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new c.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 C=this.config=Object(o.mergeConfig)(S.DefaultConfig,O);this.userConfig=O,Object(h.enableLogs)(C.debug),this._autoLevelCapping=-1,C.progressive&&Object(o.enableStreamingMode)(C);var T=C.abrController,x=C.bufferController,f=C.capLevelController,w=C.fpsController,v=this.abrController=new T(this),b=this.bufferController=new x(this),F=this.capLevelController=new f(this),B=new w(this),R=new k.default(this),j=new G.default(this),N=new H.default(this),y=this.levelController=new D.default(this),Y=new g.FragmentTracker(this),ee=this.streamController=new p.default(this,Y);F.setStreamController(ee),B.setStreamController(ee);var ae=[y,ee];this.networkControllers=ae;var ue=[R,j,v,b,F,B,N,Y];this.audioTrackController=this.createController(C.audioTrackController,null,ae),this.createController(C.audioStreamController,Y,ae),this.subtitleTrackController=this.createController(C.subtitleTrackController,null,ae),this.createController(C.subtitleStreamController,Y,ae),this.createController(C.timelineController,null,ue),this.emeController=this.createController(C.emeController,null,ue),this.cmcdController=this.createController(C.cmcdController,null,ue),this.latencyController=this.createController(n.default,null,ue),this.coreComponents=ue}var L=S.prototype;return L.createController=function(C,T,x){if(C){var f=T?new C(this,T):new C(this);return x&&x.push(f),f}return null},L.on=function(C,T,x){x===void 0&&(x=this),this._emitter.on(C,T,x)},L.once=function(C,T,x){x===void 0&&(x=this),this._emitter.once(C,T,x)},L.removeAllListeners=function(C){this._emitter.removeAllListeners(C)},L.off=function(C,T,x,f){x===void 0&&(x=this),this._emitter.off(C,T,x,f)},L.listeners=function(C){return this._emitter.listeners(C)},L.emit=function(C,T,x){return this._emitter.emit(C,T,x)},L.trigger=function(C,T){if(this.config.debug)return this.emit(C,C,T);try{return this.emit(C,C,T)}catch(x){h.logger.error("An internal error happened while handling event "+C+'. Error message: "'+x.message+'". Here is a stacktrace:',x),this.trigger(u.Events.ERROR,{type:s.ErrorTypes.OTHER_ERROR,details:s.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:C,error:x})}return!1},L.listenerCount=function(C){return this._emitter.listenerCount(C)},L.destroy=function(){h.logger.log("destroy"),this.trigger(u.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(C){return C.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(C){return C.destroy()}),this.coreComponents.length=0},L.attachMedia=function(C){h.logger.log("attachMedia"),this._media=C,this.trigger(u.Events.MEDIA_ATTACHING,{media:C})},L.detachMedia=function(){h.logger.log("detachMedia"),this.trigger(u.Events.MEDIA_DETACHING,void 0),this._media=null},L.loadSource=function(C){this.stopLoad();var T=this.media,x=this.url,f=this.url=X.buildAbsoluteURL(self.location.href,C,{alwaysNormalize:!0});h.logger.log("loadSource:"+f),T&&x&&x!==f&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(T)),this.trigger(u.Events.MANIFEST_LOADING,{url:C})},L.startLoad=function(C){C===void 0&&(C=-1),h.logger.log("startLoad("+C+")"),this.networkControllers.forEach(function(T){T.startLoad(C)})},L.stopLoad=function(){h.logger.log("stopLoad"),this.networkControllers.forEach(function(C){C.stopLoad()})},L.swapAudioCodec=function(){h.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},L.recoverMediaError=function(){h.logger.log("recoverMediaError");var C=this._media;this.detachMedia(),C&&this.attachMedia(C)},L.removeLevel=function(C,T){T===void 0&&(T=0),this.levelController.removeLevel(C,T)},A(S,[{key:"levels",get:function(){var C=this.levelController.levels;return C||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(C){h.logger.log("set currentLevel:"+C),this.loadLevel=C,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(C){h.logger.log("set nextLevel:"+C),this.levelController.manualLevel=C,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(C){h.logger.log("set loadLevel:"+C),this.levelController.manualLevel=C}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(C){this.levelController.nextLoadLevel=C}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(C){h.logger.log("set firstLevel:"+C),this.levelController.firstLevel=C}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(C){h.logger.log("set startLevel:"+C),C!==-1&&(C=Math.max(C,this.minAutoLevel)),this.levelController.startLevel=C}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(C){var T=!!C;T!==this.config.capLevelToPlayerSize&&(T?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=T)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(C){this._autoLevelCapping!==C&&(h.logger.log("set autoLevelCapping:"+C),this._autoLevelCapping=C)}},{key:"bandwidthEstimate",get:function(){var C=this.abrController.bwEstimator;return C?C.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var C=this.levels,T=this.config.minAutoBitrate;if(!C)return 0;for(var x=C.length,f=0;f<x;f++)if(C[f].maxBitrate>T)return f;return 0}},{key:"maxAutoLevel",get:function(){var C=this.levels,T=this.autoLevelCapping,x;return T===-1&&C&&C.length?x=C.length-1:x=T,x}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(C){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,C)}},{key:"audioTracks",get:function(){var C=this.audioTrackController;return C?C.audioTracks:[]}},{key:"audioTrack",get:function(){var C=this.audioTrackController;return C?C.audioTrack:-1},set:function(C){var T=this.audioTrackController;T&&(T.audioTrack=C)}},{key:"subtitleTracks",get:function(){var C=this.subtitleTrackController;return C?C.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var C=this.subtitleTrackController;return C?C.subtitleTrack:-1},set:function(C){var T=this.subtitleTrackController;T&&(T.subtitleTrack=C)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var C=this.subtitleTrackController;return C?C.subtitleDisplay:!1},set:function(C){var T=this.subtitleTrackController;T&&(T.subtitleDisplay=C)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(C){this.config.lowLatencyMode=C}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}],[{key:"version",get:function(){return"1.1.2"}},{key:"Events",get:function(){return u.Events}},{key:"ErrorTypes",get:function(){return s.ErrorTypes}},{key:"ErrorDetails",get:function(){return s.ErrorDetails}},{key:"DefaultConfig",get:function(){return S.defaultConfig?S.defaultConfig:o.hlsDefaultConfig},set:function(C){S.defaultConfig=C}}]),S}();E.defaultConfig=void 0},"./src/is-supported.ts":function(re,$,P){"use strict";P.r($),P.d($,"isSupported",function(){return k}),P.d($,"changeTypeSupported",function(){return G});var X=P("./src/utils/mediasource-helper.ts");function U(){return self.SourceBuffer||self.WebKitSourceBuffer}function k(){var H=Object(X.getMediaSource)();if(!H)return!1;var n=U(),D=H&&typeof H.isTypeSupported=="function"&&H.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),g=!n||n.prototype&&typeof n.prototype.appendBuffer=="function"&&typeof n.prototype.remove=="function";return!!D&&!!g}function G(){var H,n=U();return typeof(n==null||((H=n.prototype)===null||H===void 0)?void 0:H.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(re,$,P){"use strict";P.r($),P.d($,"default",function(){return h}),P.d($,"LoadError",function(){return c});var X=P("./src/polyfills/number.ts"),U=P("./src/errors.ts");function k(l,u){l.prototype=Object.create(u.prototype),l.prototype.constructor=l,g(l,u)}function G(l){var u=typeof Map=="function"?new Map:void 0;return G=function(a){if(a===null||!D(a))return a;if(typeof a!="function")throw new TypeError("Super expression must either be null or a function");if(typeof u!="undefined"){if(u.has(a))return u.get(a);u.set(a,A)}function A(){return H(a,arguments,p(this).constructor)}return A.prototype=Object.create(a.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),g(A,a)},G(l)}function H(l,u,s){return n()?H=Reflect.construct:H=function(A,E,S){var L=[null];L.push.apply(L,E);var O=Function.bind.apply(A,L),C=new O;return S&&g(C,S.prototype),C},H.apply(null,arguments)}function n(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(l){return!1}}function D(l){return Function.toString.call(l).indexOf("[native code]")!==-1}function g(l,u){return g=Object.setPrototypeOf||function(a,A){return a.__proto__=A,a},g(l,u)}function p(l){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(s){return s.__proto__||Object.getPrototypeOf(s)},p(l)}var m=Math.pow(2,17),h=function(){function l(s){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=s}var u=l.prototype;return u.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},u.abort=function(){this.loader&&this.loader.abort()},u.load=function(a,A){var E=this,S=a.url;if(!S)return Promise.reject(new c({type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:a,networkDetails:null},"Fragment does not have a "+(S?"part list":"url")));this.abort();var L=this.config,O=L.fLoader,C=L.loader;return new Promise(function(T,x){E.loader&&E.loader.destroy();var f=E.loader=a.loader=O?new O(L):new C(L),w=o(a),v={timeout:L.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:L.fragLoadingMaxRetryTimeout,highWaterMark:m};a.stats=f.stats,f.load(w,v,{onSuccess:function(F,B,R,j){E.resetLoader(a,f),T({frag:a,part:null,payload:F.data,networkDetails:j})},onError:function(F,B,R){E.resetLoader(a,f),x(new c({type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:a,response:F,networkDetails:R}))},onAbort:function(F,B,R){E.resetLoader(a,f),x(new c({type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:a,networkDetails:R}))},onTimeout:function(F,B,R){E.resetLoader(a,f),x(new c({type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:a,networkDetails:R}))},onProgress:function(F,B,R,j){A&&A({frag:a,part:null,payload:R,networkDetails:j})}})})},u.loadPart=function(a,A,E){var S=this;this.abort();var L=this.config,O=L.fLoader,C=L.loader;return new Promise(function(T,x){S.loader&&S.loader.destroy();var f=S.loader=a.loader=O?new O(L):new C(L),w=o(a,A),v={timeout:L.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:L.fragLoadingMaxRetryTimeout,highWaterMark:m};A.stats=f.stats,f.load(w,v,{onSuccess:function(F,B,R,j){S.resetLoader(a,f),S.updateStatsFromPart(a,A);var N={frag:a,part:A,payload:F.data,networkDetails:j};E(N),T(N)},onError:function(F,B,R){S.resetLoader(a,f),x(new c({type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:a,part:A,response:F,networkDetails:R}))},onAbort:function(F,B,R){a.stats.aborted=A.stats.aborted,S.resetLoader(a,f),x(new c({type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:a,part:A,networkDetails:R}))},onTimeout:function(F,B,R){S.resetLoader(a,f),x(new c({type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:a,part:A,networkDetails:R}))}})})},u.updateStatsFromPart=function(a,A){var E=a.stats,S=A.stats,L=S.total;if(E.loaded+=S.loaded,L){var O=Math.round(a.duration/A.duration),C=Math.min(Math.round(E.loaded/L),O),T=O-C,x=T*Math.round(E.loaded/C);E.total=E.loaded+x}else E.total=Math.max(E.loaded,E.total);var f=E.loading,w=S.loading;f.start?f.first+=w.first-w.start:(f.start=w.start,f.first=w.first),f.end=w.end},u.resetLoader=function(a,A){a.loader=null,this.loader===A&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),A.destroy()},l}();function o(l,u){u===void 0&&(u=null);var s=u||l,a={frag:l,part:u,responseType:"arraybuffer",url:s.url,headers:{},rangeStart:0,rangeEnd:0},A=s.byteRangeStartOffset,E=s.byteRangeEndOffset;return Object(X.isFiniteNumber)(A)&&Object(X.isFiniteNumber)(E)&&(a.rangeStart=A,a.rangeEnd=E),a}var c=function(l){k(u,l);function u(s){for(var a,A=arguments.length,E=new Array(A>1?A-1:0),S=1;S<A;S++)E[S-1]=arguments[S];return a=l.call.apply(l,[this].concat(E))||this,a.data=void 0,a.data=s,a}return u}(G(Error))},"./src/loader/fragment.ts":function(re,$,P){"use strict";P.r($),P.d($,"ElementaryStreamTypes",function(){return h}),P.d($,"BaseSegment",function(){return o}),P.d($,"Fragment",function(){return c}),P.d($,"Part",function(){return l});var X=P("./src/polyfills/number.ts"),U=P("./node_modules/url-toolkit/src/url-toolkit.js"),k=P.n(U),G=P("./src/utils/logger.ts"),H=P("./src/loader/level-key.ts"),n=P("./src/loader/load-stats.ts");function D(u,s){u.prototype=Object.create(s.prototype),u.prototype.constructor=u,g(u,s)}function g(u,s){return g=Object.setPrototypeOf||function(A,E){return A.__proto__=E,A},g(u,s)}function p(u,s){for(var a=0;a<s.length;a++){var A=s[a];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(u,A.key,A)}}function m(u,s,a){return s&&p(u.prototype,s),a&&p(u,a),u}var h;(function(u){u.AUDIO="audio",u.VIDEO="video",u.AUDIOVIDEO="audiovideo"})(h||(h={}));var o=function(){function u(a){var A;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(A={},A[h.AUDIO]=null,A[h.VIDEO]=null,A[h.AUDIOVIDEO]=null,A),this.baseurl=a}var s=u.prototype;return s.setByteRange=function(A,E){var S=A.split("@",2),L=[];S.length===1?L[0]=E?E.byteRangeEndOffset:0:L[0]=parseInt(S[1]),L[1]=parseInt(S[0])+L[0],this._byteRange=L},m(u,[{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Object(U.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(A){this._url=A}}]),u}(),c=function(u){D(s,u);function s(A,E){var S;return S=u.call(this,E)||this,S._decryptdata=null,S.rawProgramDateTime=null,S.programDateTime=null,S.tagList=[],S.duration=0,S.sn=0,S.levelkey=void 0,S.type=void 0,S.loader=null,S.level=-1,S.cc=0,S.startPTS=void 0,S.endPTS=void 0,S.appendedPTS=void 0,S.startDTS=void 0,S.endDTS=void 0,S.start=0,S.deltaPTS=void 0,S.maxStartPTS=void 0,S.minEndPTS=void 0,S.stats=new n.LoadStats,S.urlId=0,S.data=void 0,S.bitrateTest=!1,S.title=null,S.initSegment=null,S.type=A,S}var a=s.prototype;return a.createInitializationVector=function(E){for(var S=new Uint8Array(16),L=12;L<16;L++)S[L]=E>>8*(15-L)&255;return S},a.setDecryptDataFromLevelKey=function(E,S){var L=E;return(E==null?void 0:E.method)==="AES-128"&&E.uri&&!E.iv&&(L=H.LevelKey.fromURI(E.uri),L.method=E.method,L.iv=this.createInitializationVector(S),L.keyFormat="identity"),L},a.setElementaryStreamInfo=function(E,S,L,O,C,T){T===void 0&&(T=!1);var x=this.elementaryStreams,f=x[E];if(!f){x[E]={startPTS:S,endPTS:L,startDTS:O,endDTS:C,partial:T};return}f.startPTS=Math.min(f.startPTS,S),f.endPTS=Math.max(f.endPTS,L),f.startDTS=Math.min(f.startDTS,O),f.endDTS=Math.max(f.endDTS,C)},a.clearElementaryStreamInfo=function(){var E=this.elementaryStreams;E[h.AUDIO]=null,E[h.VIDEO]=null,E[h.AUDIOVIDEO]=null},m(s,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var E=this.sn;typeof E!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&G.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),E=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,E)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(X.isFiniteNumber)(this.programDateTime))return null;var E=Object(X.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+E*1e3}},{key:"encrypted",get:function(){var E;return!!((E=this.decryptdata)!==null&&E!==void 0&&E.keyFormat&&this.decryptdata.uri)}}]),s}(o),l=function(u){D(s,u);function s(a,A,E,S,L){var O;O=u.call(this,E)||this,O.fragOffset=0,O.duration=0,O.gap=!1,O.independent=!1,O.relurl=void 0,O.fragment=void 0,O.index=void 0,O.stats=new n.LoadStats,O.duration=a.decimalFloatingPoint("DURATION"),O.gap=a.bool("GAP"),O.independent=a.bool("INDEPENDENT"),O.relurl=a.enumeratedString("URI"),O.fragment=A,O.index=S;var C=a.enumeratedString("BYTERANGE");return C&&O.setByteRange(C,L),L&&(O.fragOffset=L.fragOffset+L.duration),O}return m(s,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var A=this.elementaryStreams;return!!(A.audio||A.video||A.audiovideo)}}]),s}(o)},"./src/loader/key-loader.ts":function(re,$,P){"use strict";P.r($),P.d($,"default",function(){return G});var X=P("./src/events.ts"),U=P("./src/errors.ts"),k=P("./src/utils/logger.ts"),G=function(){function H(D){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=D,this._registerListeners()}var n=H.prototype;return n._registerListeners=function(){this.hls.on(X.Events.KEY_LOADING,this.onKeyLoading,this)},n._unregisterListeners=function(){this.hls.off(X.Events.KEY_LOADING,this.onKeyLoading)},n.destroy=function(){this._unregisterListeners();for(var g in this.loaders){var p=this.loaders[g];p&&p.destroy()}this.loaders={}},n.onKeyLoading=function(g,p){var m=p.frag,h=m.type,o=this.loaders[h];if(!m.decryptdata){k.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var c=m.decryptdata.uri;if(c!==this.decrypturl||this.decryptkey===null){var l=this.hls.config;if(o&&(k.logger.warn("abort previous key loader for type:"+h),o.abort()),!c){k.logger.warn("key uri is falsy");return}var u=l.loader,s=m.loader=this.loaders[h]=new u(l);this.decrypturl=c,this.decryptkey=null;var a={url:c,frag:m,responseType:"arraybuffer"},A={timeout:l.fragLoadingTimeOut,maxRetry:0,retryDelay:l.fragLoadingRetryDelay,maxRetryDelay:l.fragLoadingMaxRetryTimeout,highWaterMark:0},E={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};s.load(a,A,E)}else this.decryptkey&&(m.decryptdata.key=this.decryptkey,this.hls.trigger(X.Events.KEY_LOADED,{frag:m}))},n.loadsuccess=function(g,p,m){var h=m.frag;if(!h.decryptdata){k.logger.error("after key load, decryptdata unset");return}this.decryptkey=h.decryptdata.key=new Uint8Array(g.data),h.loader=null,delete this.loaders[h.type],this.hls.trigger(X.Events.KEY_LOADED,{frag:h})},n.loaderror=function(g,p){var m=p.frag,h=m.loader;h&&h.abort(),delete this.loaders[m.type],this.hls.trigger(X.Events.ERROR,{type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:m,response:g})},n.loadtimeout=function(g,p){var m=p.frag,h=m.loader;h&&h.abort(),delete this.loaders[m.type],this.hls.trigger(X.Events.ERROR,{type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:m})},H}()},"./src/loader/level-details.ts":function(re,$,P){"use strict";P.r($),P.d($,"LevelDetails",function(){return H});var X=P("./src/polyfills/number.ts");function U(n,D){for(var g=0;g<D.length;g++){var p=D[g];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(n,p.key,p)}}function k(n,D,g){return D&&U(n.prototype,D),g&&U(n,g),n}var G=10,H=function(){function n(g){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.needSidxRanges=!1,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.fragments=[],this.url=g}var D=n.prototype;return D.reloaded=function(p){if(!p){this.advanced=!0,this.updated=!0;return}var m=this.lastPartSn-p.lastPartSn,h=this.lastPartIndex-p.lastPartIndex;this.updated=this.endSN!==p.endSN||!!h||!!m,this.advanced=this.endSN>p.endSN||m>0||m===0&&h>0,this.updated||this.advanced?this.misses=Math.floor(p.misses*.6):this.misses=p.misses+1,this.availabilityDelay=p.availabilityDelay},k(n,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(X.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||G}},{key:"drift",get:function(){var p=this.driftEndTime-this.driftStartTime;if(p>0){var m=this.driftEnd-this.driftStart;return m*1e3/p}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var p;return(p=this.partList)!==null&&p!==void 0&&p.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var p;return(p=this.fragments)!==null&&p!==void 0&&p.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 p;return(p=this.partList)!==null&&p!==void 0&&p.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var p;return(p=this.partList)!==null&&p!==void 0&&p.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),n}()},"./src/loader/level-key.ts":function(re,$,P){"use strict";P.r($),P.d($,"LevelKey",function(){return H});var X=P("./node_modules/url-toolkit/src/url-toolkit.js"),U=P.n(X);function k(n,D){for(var g=0;g<D.length;g++){var p=D[g];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(n,p.key,p)}}function G(n,D,g){return D&&k(n.prototype,D),g&&k(n,g),n}var H=function(){n.fromURL=function(g,p){return new n(g,p)},n.fromURI=function(g){return new n(g)};function n(D,g){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,g?this._uri=Object(X.buildAbsoluteURL)(D,g,{alwaysNormalize:!0}):this._uri=D}return G(n,[{key:"uri",get:function(){return this._uri}}]),n}()},"./src/loader/load-stats.ts":function(re,$,P){"use strict";P.r($),P.d($,"LoadStats",function(){return X});var X=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(re,$,P){"use strict";P.r($),P.d($,"default",function(){return s});var X=P("./src/polyfills/number.ts"),U=P("./node_modules/url-toolkit/src/url-toolkit.js"),k=P.n(U),G=P("./src/loader/fragment.ts"),H=P("./src/loader/level-details.ts"),n=P("./src/loader/level-key.ts"),D=P("./src/utils/attr-list.ts"),g=P("./src/utils/logger.ts"),p=P("./src/utils/codecs.ts"),m=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,h=/#EXT-X-MEDIA:(.*)/g,o=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),c=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(PLAYLIST-TYPE):(.+)/.source,/#EXT-X-(MEDIA-SEQUENCE): *(\d+)/.source,/#EXT-X-(SKIP):(.+)/.source,/#EXT-X-(TARGETDURATION): *(\d+)/.source,/#EXT-X-(KEY):(.+)/.source,/#EXT-X-(START):(.+)/.source,/#EXT-X-(ENDLIST)/.source,/#EXT-X-(DISCONTINUITY-SEQ)UENCE: *(\d+)/.source,/#EXT-X-(DIS)CONTINUITY/.source,/#EXT-X-(VERSION):(\d+)/.source,/#EXT-X-(MAP):(.+)/.source,/#EXT-X-(SERVER-CONTROL):(.+)/.source,/#EXT-X-(PART-INF):(.+)/.source,/#EXT-X-(GAP)/.source,/#EXT-X-(BITRATE):\s*(\d+)/.source,/#EXT-X-(PART):(.+)/.source,/#EXT-X-(PRELOAD-HINT):(.+)/.source,/#EXT-X-(RENDITION-REPORT):(.+)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),l=/\.(mp4|m4s|m4v|m4a)$/i;function u(L){var O,C;return l.test((O=(C=U.parseURL(L))===null||C===void 0?void 0:C.path)!=null?O:"")}var s=function(){function L(){}return L.findGroup=function(C,T){for(var x=0;x<C.length;x++){var f=C[x];if(f.id===T)return f}},L.convertAVC1ToAVCOTI=function(C){var T=C.split(".");if(T.length>2){var x=T.shift()+".";return x+=parseInt(T.shift()).toString(16),x+=("000"+parseInt(T.shift()).toString(16)).substr(-4),x}return C},L.resolve=function(C,T){return U.buildAbsoluteURL(T,C,{alwaysNormalize:!0})},L.parseMasterPlaylist=function(C,T){var x=[],f={},w=!1;m.lastIndex=0;for(var v;(v=m.exec(C))!=null;)if(v[1]){var b=new D.AttrList(v[1]),F={attrs:b,bitrate:b.decimalInteger("AVERAGE-BANDWIDTH")||b.decimalInteger("BANDWIDTH"),name:b.NAME,url:L.resolve(v[2],T)},B=b.decimalResolution("RESOLUTION");B&&(F.width=B.width,F.height=B.height),a((b.CODECS||"").split(/[ ,]+/).filter(function(j){return j}),F),F.videoCodec&&F.videoCodec.indexOf("avc1")!==-1&&(F.videoCodec=L.convertAVC1ToAVCOTI(F.videoCodec)),x.push(F)}else if(v[3]){var R=new D.AttrList(v[3]);R["DATA-ID"]&&(w=!0,f[R["DATA-ID"]]=R)}return{levels:x,sessionData:w?f:null}},L.parseMasterPlaylistMedia=function(C,T,x,f){f===void 0&&(f=[]);var w,v=[],b=0;for(h.lastIndex=0;(w=h.exec(C))!==null;){var F=new D.AttrList(w[1]);if(F.TYPE===x){var B={attrs:F,bitrate:0,id:b++,groupId:F["GROUP-ID"],instreamId:F["INSTREAM-ID"],name:F.NAME||F.LANGUAGE||"",type:x,default:F.bool("DEFAULT"),autoselect:F.bool("AUTOSELECT"),forced:F.bool("FORCED"),lang:F.LANGUAGE,url:F.URI?L.resolve(F.URI,T):""};if(f.length){var R=L.findGroup(f,B.groupId)||f[0];A(B,R,"audioCodec"),A(B,R,"textCodec")}v.push(B)}}return v},L.parseLevelPlaylist=function(C,T,x,f,w){var v=new H.LevelDetails(T),b=v.fragments,F=null,B=0,R=0,j=0,N=0,y=null,Y=new G.Fragment(f,T),ee,ae,ue,Re=-1,Ee=!1;for(o.lastIndex=0,v.m3u8=C;(ee=o.exec(C))!==null;){Ee&&(Ee=!1,Y=new G.Fragment(f,T),Y.start=j,Y.sn=B,Y.cc=N,Y.level=x,F&&(Y.initSegment=F,Y.rawProgramDateTime=F.rawProgramDateTime));var xe=ee[1];if(xe){Y.duration=parseFloat(xe);var Ce=(" "+ee[2]).slice(1);Y.title=Ce||null,Y.tagList.push(Ce?["INF",xe,Ce]:["INF",xe])}else if(ee[3])Object(X.isFiniteNumber)(Y.duration)&&(Y.start=j,ue&&(Y.levelkey=ue),Y.sn=B,Y.level=x,Y.cc=N,Y.urlId=w,b.push(Y),Y.relurl=(" "+ee[3]).slice(1),S(Y,y),y=Y,j+=Y.duration,B++,R=0,Ee=!0);else if(ee[4]){var Oe=(" "+ee[4]).slice(1);y?Y.setByteRange(Oe,y):Y.setByteRange(Oe)}else if(ee[5])Y.rawProgramDateTime=(" "+ee[5]).slice(1),Y.tagList.push(["PROGRAM-DATE-TIME",Y.rawProgramDateTime]),Re===-1&&(Re=b.length);else{if(ee=ee[0].match(c),!ee){g.logger.warn("No matches on slow regex match for level playlist!");continue}for(ae=1;ae<ee.length&&!(typeof ee[ae]!="undefined");ae++);var pe=(" "+ee[ae]).slice(1),de=(" "+ee[ae+1]).slice(1),Me=ee[ae+2]?(" "+ee[ae+2]).slice(1):"";switch(pe){case"PLAYLIST-TYPE":v.type=de.toUpperCase();break;case"MEDIA-SEQUENCE":B=v.startSN=parseInt(de);break;case"SKIP":{var tt=new D.AttrList(de),We=tt.decimalInteger("SKIPPED-SEGMENTS");if(Object(X.isFiniteNumber)(We)){v.skippedSegments=We;for(var rt=We;rt--;)b.unshift(null);B+=We}var st=tt.enumeratedString("RECENTLY-REMOVED-DATERANGES");st&&(v.recentlyRemovedDateranges=st.split(" "));break}case"TARGETDURATION":v.targetduration=parseFloat(de);break;case"VERSION":v.version=parseInt(de);break;case"EXTM3U":break;case"ENDLIST":v.live=!1;break;case"#":(de||Me)&&Y.tagList.push(Me?[de,Me]:[de]);break;case"DIS":N++;case"GAP":Y.tagList.push([pe]);break;case"BITRATE":Y.tagList.push([pe,de]);break;case"DISCONTINUITY-SEQ":N=parseInt(de);break;case"KEY":{var Pe,je=new D.AttrList(de),Ze=je.enumeratedString("METHOD"),se=je.URI,_e=je.hexadecimalInteger("IV"),Te=je.enumeratedString("KEYFORMATVERSIONS"),Ae=je.enumeratedString("KEYID"),ze=(Pe=je.enumeratedString("KEYFORMAT"))!=null?Pe:"identity",Be=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(Be.indexOf(ze)>-1){g.logger.warn("Keyformat "+ze+" is not supported from the manifest");continue}else if(ze!=="identity")continue;Ze&&(ue=n.LevelKey.fromURL(T,se),se&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Ze)>=0&&(ue.method=Ze,ue.keyFormat=ze,Ae&&(ue.keyID=Ae),Te&&(ue.keyFormatVersions=Te),ue.iv=_e));break}case"START":{var Ue=new D.AttrList(de),Ve=Ue.decimalFloatingPoint("TIME-OFFSET");Object(X.isFiniteNumber)(Ve)&&(v.startTimeOffset=Ve);break}case"MAP":{var $e=new D.AttrList(de);Y.relurl=$e.URI,$e.BYTERANGE&&Y.setByteRange($e.BYTERANGE),Y.level=x,Y.sn="initSegment",ue&&(Y.levelkey=ue),Y.initSegment=null,F=Y,Ee=!0;break}case"SERVER-CONTROL":{var Xe=new D.AttrList(de);v.canBlockReload=Xe.bool("CAN-BLOCK-RELOAD"),v.canSkipUntil=Xe.optionalFloat("CAN-SKIP-UNTIL",0),v.canSkipDateRanges=v.canSkipUntil>0&&Xe.bool("CAN-SKIP-DATERANGES"),v.partHoldBack=Xe.optionalFloat("PART-HOLD-BACK",0),v.holdBack=Xe.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var et=new D.AttrList(de);v.partTarget=et.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Ie=v.partList;Ie||(Ie=v.partList=[]);var nt=R>0?Ie[Ie.length-1]:void 0,at=R++,De=new G.Part(new D.AttrList(de),Y,T,at,nt);Ie.push(De),Y.duration+=De.duration;break}case"PRELOAD-HINT":{var ke=new D.AttrList(de);v.preloadHint=ke;break}case"RENDITION-REPORT":{var ve=new D.AttrList(de);v.renditionReports=v.renditionReports||[],v.renditionReports.push(ve);break}default:g.logger.warn("line parsed but not handled: "+ee);break}}}y&&!y.relurl?(b.pop(),j-=y.duration,v.partList&&(v.fragmentHint=y)):v.partList&&(S(Y,y),Y.cc=N,v.fragmentHint=Y);var ce=b.length,fe=b[0],ie=b[ce-1];if(j+=v.skippedSegments*v.targetduration,j>0&&ce&&ie){v.averagetargetduration=j/ce;var ne=ie.sn;v.endSN=ne!=="initSegment"?ne:0,fe&&(v.startCC=fe.cc,fe.initSegment||v.fragments.every(function(oe){return oe.relurl&&u(oe.relurl)})&&(g.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),Y=new G.Fragment(f,T),Y.relurl=ie.relurl,Y.level=x,Y.sn="initSegment",fe.initSegment=Y,v.needSidxRanges=!0))}else v.endSN=0,v.startCC=0;return v.fragmentHint&&(j+=v.fragmentHint.duration),v.totalduration=j,v.endCC=N,Re>0&&E(b,Re),v},L}();function a(L,O){["video","audio","text"].forEach(function(C){var T=L.filter(function(f){return Object(p.isCodecType)(f,C)});if(T.length){var x=T.filter(function(f){return f.lastIndexOf("avc1",0)===0||f.lastIndexOf("mp4a",0)===0});O[C+"Codec"]=x.length>0?x[0]:T[0],L=L.filter(function(f){return T.indexOf(f)===-1})}}),O.unknownCodecs=L}function A(L,O,C){var T=O[C];T&&(L[C]=T)}function E(L,O){for(var C=L[O],T=O;T--;){var x=L[T];if(!x)return;x.programDateTime=C.programDateTime-x.duration*1e3,C=x}}function S(L,O){L.rawProgramDateTime?L.programDateTime=Date.parse(L.rawProgramDateTime):O!=null&&O.programDateTime&&(L.programDateTime=O.endProgramDateTime),Object(X.isFiniteNumber)(L.programDateTime)||(L.programDateTime=null,L.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(re,$,P){"use strict";P.r($);var X=P("./src/polyfills/number.ts"),U=P("./src/events.ts"),k=P("./src/errors.ts"),G=P("./src/utils/logger.ts"),H=P("./src/utils/mp4-tools.ts"),n=P("./src/loader/m3u8-parser.ts"),D=P("./src/types/loader.ts"),g=P("./src/utils/attr-list.ts");function p(o){var c=o.type;switch(c){case D.PlaylistContextType.AUDIO_TRACK:return D.PlaylistLevelType.AUDIO;case D.PlaylistContextType.SUBTITLE_TRACK:return D.PlaylistLevelType.SUBTITLE;default:return D.PlaylistLevelType.MAIN}}function m(o,c){var l=o.url;return(l===void 0||l.indexOf("data:")===0)&&(l=c.url),l}var h=function(){function o(l){this.hls=void 0,this.loaders=Object.create(null),this.hls=l,this.registerListeners()}var c=o.prototype;return c.registerListeners=function(){var u=this.hls;u.on(U.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.on(U.Events.LEVEL_LOADING,this.onLevelLoading,this),u.on(U.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),u.on(U.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},c.unregisterListeners=function(){var u=this.hls;u.off(U.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.off(U.Events.LEVEL_LOADING,this.onLevelLoading,this),u.off(U.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),u.off(U.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},c.createInternalLoader=function(u){var s=this.hls.config,a=s.pLoader,A=s.loader,E=a||A,S=new E(s);return u.loader=S,this.loaders[u.type]=S,S},c.getInternalLoader=function(u){return this.loaders[u.type]},c.resetInternalLoader=function(u){this.loaders[u]&&delete this.loaders[u]},c.destroyInternalLoaders=function(){for(var u in this.loaders){var s=this.loaders[u];s&&s.destroy(),this.resetInternalLoader(u)}},c.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},c.onManifestLoading=function(u,s){var a=s.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:D.PlaylistContextType.MANIFEST,url:a,deliveryDirectives:null})},c.onLevelLoading=function(u,s){var a=s.id,A=s.level,E=s.url,S=s.deliveryDirectives;this.load({id:a,groupId:null,level:A,responseType:"text",type:D.PlaylistContextType.LEVEL,url:E,deliveryDirectives:S})},c.onAudioTrackLoading=function(u,s){var a=s.id,A=s.groupId,E=s.url,S=s.deliveryDirectives;this.load({id:a,groupId:A,level:null,responseType:"text",type:D.PlaylistContextType.AUDIO_TRACK,url:E,deliveryDirectives:S})},c.onSubtitleTrackLoading=function(u,s){var a=s.id,A=s.groupId,E=s.url,S=s.deliveryDirectives;this.load({id:a,groupId:A,level:null,responseType:"text",type:D.PlaylistContextType.SUBTITLE_TRACK,url:E,deliveryDirectives:S})},c.load=function(u){var s,a=this.hls.config,A=this.getInternalLoader(u);if(A){var E=A.context;if(E&&E.url===u.url){G.logger.trace("[playlist-loader]: playlist request ongoing");return}G.logger.log("[playlist-loader]: aborting previous loader for type: "+u.type),A.abort()}var S,L,O,C;switch(u.type){case D.PlaylistContextType.MANIFEST:S=a.manifestLoadingMaxRetry,L=a.manifestLoadingTimeOut,O=a.manifestLoadingRetryDelay,C=a.manifestLoadingMaxRetryTimeout;break;case D.PlaylistContextType.LEVEL:case D.PlaylistContextType.AUDIO_TRACK:case D.PlaylistContextType.SUBTITLE_TRACK:S=0,L=a.levelLoadingTimeOut;break;default:S=a.levelLoadingMaxRetry,L=a.levelLoadingTimeOut,O=a.levelLoadingRetryDelay,C=a.levelLoadingMaxRetryTimeout;break}if(A=this.createInternalLoader(u),(s=u.deliveryDirectives)!==null&&s!==void 0&&s.part){var T;if(u.type===D.PlaylistContextType.LEVEL&&u.level!==null?T=this.hls.levels[u.level].details:u.type===D.PlaylistContextType.AUDIO_TRACK&&u.id!==null?T=this.hls.audioTracks[u.id].details:u.type===D.PlaylistContextType.SUBTITLE_TRACK&&u.id!==null&&(T=this.hls.subtitleTracks[u.id].details),T){var x=T.partTarget,f=T.targetduration;x&&f&&(L=Math.min(Math.max(x*3,f*.8)*1e3,L))}}var w={timeout:L,maxRetry:S,retryDelay:O,maxRetryDelay:C,highWaterMark:0},v={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};A.load(u,w,v)},c.loadsuccess=function(u,s,a,A){if(A===void 0&&(A=null),a.isSidxRequest){this.handleSidxRequest(u,a),this.handlePlaylistLoaded(u,s,a,A);return}this.resetInternalLoader(a.type);var E=u.data;if(E.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(u,a,"no EXTM3U delimiter",A);return}s.parsing.start=performance.now(),E.indexOf("#EXTINF:")>0||E.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(u,s,a,A):this.handleMasterPlaylist(u,s,a,A)},c.loaderror=function(u,s,a){a===void 0&&(a=null),this.handleNetworkError(s,a,!1,u)},c.loadtimeout=function(u,s,a){a===void 0&&(a=null),this.handleNetworkError(s,a,!0)},c.handleMasterPlaylist=function(u,s,a,A){var E=this.hls,S=u.data,L=m(u,a),O=n.default.parseMasterPlaylist(S,L),C=O.levels,T=O.sessionData;if(!C.length){this.handleManifestParsingError(u,a,"no level found in manifest",A);return}var x=C.map(function(B){return{id:B.attrs.AUDIO,audioCodec:B.audioCodec}}),f=C.map(function(B){return{id:B.attrs.SUBTITLES,textCodec:B.textCodec}}),w=n.default.parseMasterPlaylistMedia(S,L,"AUDIO",x),v=n.default.parseMasterPlaylistMedia(S,L,"SUBTITLES",f),b=n.default.parseMasterPlaylistMedia(S,L,"CLOSED-CAPTIONS");if(w.length){var F=w.some(function(B){return!B.url});!F&&C[0].audioCodec&&!C[0].attrs.AUDIO&&(G.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),w.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new g.AttrList({}),bitrate:0,url:""}))}E.trigger(U.Events.MANIFEST_LOADED,{levels:C,audioTracks:w,subtitles:v,captions:b,url:L,stats:s,networkDetails:A,sessionData:T})},c.handleTrackOrLevelPlaylist=function(u,s,a,A){var E=this.hls,S=a.id,L=a.level,O=a.type,C=m(u,a),T=Object(X.isFiniteNumber)(S)?S:0,x=Object(X.isFiniteNumber)(L)?L:T,f=p(a),w=n.default.parseLevelPlaylist(u.data,C,x,f,T);if(!w.fragments.length){E.trigger(U.Events.ERROR,{type:k.ErrorTypes.NETWORK_ERROR,details:k.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:C,reason:"no fragments found in level",level:typeof a.level=="number"?a.level:void 0});return}if(O===D.PlaylistContextType.MANIFEST){var v={attrs:new g.AttrList({}),bitrate:0,details:w,name:"",url:C};E.trigger(U.Events.MANIFEST_LOADED,{levels:[v],audioTracks:[],url:C,stats:s,networkDetails:A,sessionData:null})}if(s.parsing.end=performance.now(),w.needSidxRanges){var b,F=(b=w.fragments[0].initSegment)===null||b===void 0?void 0:b.url;this.load({url:F,isSidxRequest:!0,type:O,level:L,levelDetails:w,id:S,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}a.levelDetails=w,this.handlePlaylistLoaded(u,s,a,A)},c.handleSidxRequest=function(u,s){var a=Object(H.parseSegmentIndex)(new Uint8Array(u.data));if(!a)return;var A=a.references,E=s.levelDetails;A.forEach(function(S,L){var O=S.info,C=E.fragments[L];C.byteRange.length===0&&C.setByteRange(String(1+O.end-O.start)+"@"+String(O.start)),C.initSegment&&C.initSegment.setByteRange(String(a.moovEndOffset)+"@0")})},c.handleManifestParsingError=function(u,s,a,A){this.hls.trigger(U.Events.ERROR,{type:k.ErrorTypes.NETWORK_ERROR,details:k.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:s.type===D.PlaylistContextType.MANIFEST,url:u.url,reason:a,response:u,context:s,networkDetails:A})},c.handleNetworkError=function(u,s,a,A){a===void 0&&(a=!1),G.logger.warn("[playlist-loader]: A network "+(a?"timeout":"error")+" occurred while loading "+u.type+" level: "+u.level+" id: "+u.id+' group-id: "'+u.groupId+'"');var E=k.ErrorDetails.UNKNOWN,S=!1,L=this.getInternalLoader(u);switch(u.type){case D.PlaylistContextType.MANIFEST:E=a?k.ErrorDetails.MANIFEST_LOAD_TIMEOUT:k.ErrorDetails.MANIFEST_LOAD_ERROR,S=!0;break;case D.PlaylistContextType.LEVEL:E=a?k.ErrorDetails.LEVEL_LOAD_TIMEOUT:k.ErrorDetails.LEVEL_LOAD_ERROR,S=!1;break;case D.PlaylistContextType.AUDIO_TRACK:E=a?k.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:k.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,S=!1;break;case D.PlaylistContextType.SUBTITLE_TRACK:E=a?k.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:k.ErrorDetails.SUBTITLE_LOAD_ERROR,S=!1;break}L&&this.resetInternalLoader(u.type);var O={type:k.ErrorTypes.NETWORK_ERROR,details:E,fatal:S,url:u.url,loader:L,context:u,networkDetails:s};A&&(O.response=A),this.hls.trigger(U.Events.ERROR,O)},c.handlePlaylistLoaded=function(u,s,a,A){var E=a.type,S=a.level,L=a.id,O=a.groupId,C=a.loader,T=a.levelDetails,x=a.deliveryDirectives;if(!(T!=null&&T.targetduration)){this.handleManifestParsingError(u,a,"invalid target duration",A);return}if(!C)return;T.live&&(C.getCacheAge&&(T.ageHeader=C.getCacheAge()||0),(!C.getCacheAge||isNaN(T.ageHeader))&&(T.ageHeader=0));switch(E){case D.PlaylistContextType.MANIFEST:case D.PlaylistContextType.LEVEL:this.hls.trigger(U.Events.LEVEL_LOADED,{details:T,level:S||0,id:L||0,stats:s,networkDetails:A,deliveryDirectives:x});break;case D.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(U.Events.AUDIO_TRACK_LOADED,{details:T,id:L||0,groupId:O||"",stats:s,networkDetails:A,deliveryDirectives:x});break;case D.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(U.Events.SUBTITLE_TRACK_LOADED,{details:T,id:L||0,groupId:O||"",stats:s,networkDetails:A,deliveryDirectives:x});break}},o}();$.default=h},"./src/polyfills/number.ts":function(re,$,P){"use strict";P.r($),P.d($,"isFiniteNumber",function(){return X}),P.d($,"MAX_SAFE_INTEGER",function(){return U});var X=Number.isFinite||function(k){return typeof k=="number"&&isFinite(k)},U=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(re,$,P){"use strict";P.r($);var X=function(){function U(){}return U.getSilentFrame=function(G,H){switch(G){case"mp4a.40.2":if(H===1)return new Uint8Array([0,200,0,128,35,128]);if(H===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(H===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(H===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(H===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(H===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(H===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(H===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(H===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},U}();$.default=X},"./src/remux/mp4-generator.ts":function(re,$,P){"use strict";P.r($);var X=Math.pow(2,32)-1,U=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 H;for(H in k.types)k.types.hasOwnProperty(H)&&(k.types[H]=[H.charCodeAt(0),H.charCodeAt(1),H.charCodeAt(2),H.charCodeAt(3)]);var n=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),D=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:n,audio:D};var g=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),p=new Uint8Array([0,0,0,0,0,0,0,0]);k.STTS=k.STSC=k.STCO=p,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 m=new Uint8Array([105,115,111,109]),h=new Uint8Array([97,118,99,49]),o=new Uint8Array([0,0,0,1]);k.FTYP=k.box(k.types.ftyp,m,o,m,h),k.DINF=k.box(k.types.dinf,k.box(k.types.dref,g))},k.box=function(H){for(var n=8,D=arguments.length,g=new Array(D>1?D-1:0),p=1;p<D;p++)g[p-1]=arguments[p];for(var m=g.length,h=m;m--;)n+=g[m].byteLength;var o=new Uint8Array(n);for(o[0]=n>>24&255,o[1]=n>>16&255,o[2]=n>>8&255,o[3]=n&255,o.set(H,4),m=0,n=8;m<h;m++)o.set(g[m],n),n+=g[m].byteLength;return o},k.hdlr=function(H){return k.box(k.types.hdlr,k.HDLR_TYPES[H])},k.mdat=function(H){return k.box(k.types.mdat,H)},k.mdhd=function(H,n){n*=H;var D=Math.floor(n/(X+1)),g=Math.floor(n%(X+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,H>>24&255,H>>16&255,H>>8&255,H&255,D>>24,D>>16&255,D>>8&255,D&255,g>>24,g>>16&255,g>>8&255,g&255,85,196,0,0]))},k.mdia=function(H){return k.box(k.types.mdia,k.mdhd(H.timescale,H.duration),k.hdlr(H.type),k.minf(H))},k.mfhd=function(H){return k.box(k.types.mfhd,new Uint8Array([0,0,0,0,H>>24,H>>16&255,H>>8&255,H&255]))},k.minf=function(H){return H.type==="audio"?k.box(k.types.minf,k.box(k.types.smhd,k.SMHD),k.DINF,k.stbl(H)):k.box(k.types.minf,k.box(k.types.vmhd,k.VMHD),k.DINF,k.stbl(H))},k.moof=function(H,n,D){return k.box(k.types.moof,k.mfhd(H),k.traf(D,n))},k.moov=function(H){for(var n=H.length,D=[];n--;)D[n]=k.trak(H[n]);return k.box.apply(null,[k.types.moov,k.mvhd(H[0].timescale,H[0].duration)].concat(D).concat(k.mvex(H)))},k.mvex=function(H){for(var n=H.length,D=[];n--;)D[n]=k.trex(H[n]);return k.box.apply(null,[k.types.mvex].concat(D))},k.mvhd=function(H,n){n*=H;var D=Math.floor(n/(X+1)),g=Math.floor(n%(X+1)),p=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,H>>24&255,H>>16&255,H>>8&255,H&255,D>>24,D>>16&255,D>>8&255,D&255,g>>24,g>>16&255,g>>8&255,g&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return k.box(k.types.mvhd,p)},k.sdtp=function(H){var n=H.samples||[],D=new Uint8Array(4+n.length),g,p;for(g=0;g<n.length;g++)p=n[g].flags,D[g+4]=p.dependsOn<<4|p.isDependedOn<<2|p.hasRedundancy;return k.box(k.types.sdtp,D)},k.stbl=function(H){return k.box(k.types.stbl,k.stsd(H),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(H){var n=[],D=[],g,p,m;for(g=0;g<H.sps.length;g++)p=H.sps[g],m=p.byteLength,n.push(m>>>8&255),n.push(m&255),n=n.concat(Array.prototype.slice.call(p));for(g=0;g<H.pps.length;g++)p=H.pps[g],m=p.byteLength,D.push(m>>>8&255),D.push(m&255),D=D.concat(Array.prototype.slice.call(p));var h=k.box(k.types.avcC,new Uint8Array([1,n[3],n[4],n[5],252|3,224|H.sps.length].concat(n).concat([H.pps.length]).concat(D))),o=H.width,c=H.height,l=H.pixelRatio[0],u=H.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,o>>8&255,o&255,c>>8&255,c&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),h,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([l>>24,l>>16&255,l>>8&255,l&255,u>>24,u>>16&255,u>>8&255,u&255])))},k.esds=function(H){var n=H.config.length;return new Uint8Array([0,0,0,0,3,23+n,0,1,0,4,15+n,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([n]).concat(H.config).concat([6,1,2]))},k.mp4a=function(H){var n=H.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,H.channelCount,0,16,0,0,0,0,n>>8&255,n&255,0,0]),k.box(k.types.esds,k.esds(H)))},k.mp3=function(H){var n=H.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,H.channelCount,0,16,0,0,0,0,n>>8&255,n&255,0,0]))},k.stsd=function(H){return H.type==="audio"?!H.isAAC&&H.codec==="mp3"?k.box(k.types.stsd,k.STSD,k.mp3(H)):k.box(k.types.stsd,k.STSD,k.mp4a(H)):k.box(k.types.stsd,k.STSD,k.avc1(H))},k.tkhd=function(H){var n=H.id,D=H.duration*H.timescale,g=H.width,p=H.height,m=Math.floor(D/(X+1)),h=Math.floor(D%(X+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,n>>24&255,n>>16&255,n>>8&255,n&255,0,0,0,0,m>>24,m>>16&255,m>>8&255,m&255,h>>24,h>>16&255,h>>8&255,h&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,g>>8&255,g&255,0,0,p>>8&255,p&255,0,0]))},k.traf=function(H,n){var D=k.sdtp(H),g=H.id,p=Math.floor(n/(X+1)),m=Math.floor(n%(X+1));return k.box(k.types.traf,k.box(k.types.tfhd,new Uint8Array([0,0,0,0,g>>24,g>>16&255,g>>8&255,g&255])),k.box(k.types.tfdt,new Uint8Array([1,0,0,0,p>>24,p>>16&255,p>>8&255,p&255,m>>24,m>>16&255,m>>8&255,m&255])),k.trun(H,D.length+16+20+8+16+8+8),D)},k.trak=function(H){return H.duration=H.duration||4294967295,k.box(k.types.trak,k.tkhd(H),k.mdia(H))},k.trex=function(H){var n=H.id;return k.box(k.types.trex,new Uint8Array([0,0,0,0,n>>24,n>>16&255,n>>8&255,n&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},k.trun=function(H,n){var D=H.samples||[],g=D.length,p=12+16*g,m=new Uint8Array(p),h,o,c,l,u,s;for(n+=8+p,m.set([0,0,15,1,g>>>24&255,g>>>16&255,g>>>8&255,g&255,n>>>24&255,n>>>16&255,n>>>8&255,n&255],0),h=0;h<g;h++)o=D[h],c=o.duration,l=o.size,u=o.flags,s=o.cts,m.set([c>>>24&255,c>>>16&255,c>>>8&255,c&255,l>>>24&255,l>>>16&255,l>>>8&255,l&255,u.isLeading<<2|u.dependsOn,u.isDependedOn<<6|u.hasRedundancy<<4|u.paddingValue<<1|u.isNonSync,u.degradPrio&240<<8,u.degradPrio&15,s>>>24&255,s>>>16&255,s>>>8&255,s&255],12+16*h);return k.box(k.types.trun,m)},k.initSegment=function(H){k.types||k.init();var n=k.moov(H),D=new Uint8Array(k.FTYP.byteLength+n.byteLength);return D.set(k.FTYP),D.set(n,k.FTYP.byteLength),D},k}();U.types=void 0,U.HDLR_TYPES=void 0,U.STTS=void 0,U.STSC=void 0,U.STCO=void 0,U.STSZ=void 0,U.VMHD=void 0,U.SMHD=void 0,U.STSD=void 0,U.FTYP=void 0,U.DINF=void 0,$.default=U},"./src/remux/mp4-remuxer.ts":function(re,$,P){"use strict";P.r($),P.d($,"default",function(){return s}),P.d($,"normalizePts",function(){return a});var X=P("./src/polyfills/number.ts"),U=P("./src/remux/aac-helper.ts"),k=P("./src/remux/mp4-generator.ts"),G=P("./src/events.ts"),H=P("./src/errors.ts"),n=P("./src/utils/logger.ts"),D=P("./src/types/loader.ts"),g=P("./src/utils/timescale-conversion.ts");function p(){return p=Object.assign||function(L){for(var O=1;O<arguments.length;O++){var C=arguments[O];for(var T in C)Object.prototype.hasOwnProperty.call(C,T)&&(L[T]=C[T])}return L},p.apply(this,arguments)}var m=10*1e3,h=1024,o=1152,c=null,l=null,u=!1,s=function(){function L(C,T,x,f){if(f===void 0&&(f=""),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=C,this.config=T,this.typeSupported=x,this.ISGenerated=!1,c===null){var w=navigator.userAgent||"",v=w.match(/Chrome\/(\d+)/i);c=v?parseInt(v[1]):0}if(l===null){var b=navigator.userAgent.match(/Safari\/(\d+)/i);l=b?parseInt(b[1]):0}u=!!c&&c<75||!!l&&l<600}var O=L.prototype;return O.destroy=function(){},O.resetTimeStamp=function(T){n.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=T},O.resetNextTimestamp=function(){n.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},O.resetInitSegment=function(){n.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},O.getVideoStartPts=function(T){var x=!1,f=T.reduce(function(w,v){var b=v.pts-w;return b<-4294967296?(x=!0,a(w,v.pts)):b>0?w:v.pts},T[0].pts);return x&&n.logger.debug("PTS rollover detected"),f},O.remux=function(T,x,f,w,v,b,F,B){var R,j,N,y,Y,ee,ae=v,ue=v,Re=T.pid>-1,Ee=x.pid>-1,xe=x.samples.length,Ce=T.samples.length>0,Oe=xe>1,pe=(!Re||Ce)&&(!Ee||Oe)||this.ISGenerated||F;if(pe){this.ISGenerated||(N=this.generateIS(T,x,v));var de=this.isVideoContiguous,Me=-1;if(Oe&&(Me=A(x.samples),!de&&this.config.forceKeyFrameOnDiscontinuity))if(ee=!0,Me>0){n.logger.warn("[mp4-remuxer]: Dropped "+Me+" out of "+xe+" video samples due to a missing keyframe");var tt=this.getVideoStartPts(x.samples);x.samples=x.samples.slice(Me),x.dropped+=Me,ue+=(x.samples[0].pts-tt)/(x.timescale||9e4)}else Me===-1&&(n.logger.warn("[mp4-remuxer]: No keyframe found out of "+xe+" video samples"),ee=!1);if(this.ISGenerated){if(Ce&&Oe){var We=this.getVideoStartPts(x.samples),rt=a(T.samples[0].pts,We)-We,st=rt/x.inputTimeScale;ae+=Math.max(0,st),ue+=Math.max(0,-st)}if(Ce){if(T.samplerate||(n.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),N=this.generateIS(T,x,v)),j=this.remuxAudio(T,ae,this.isAudioContiguous,b,Ee||Oe||B===D.PlaylistLevelType.AUDIO?ue:void 0),Oe){var Pe=j?j.endPTS-j.startPTS:0;x.inputTimeScale||(n.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),N=this.generateIS(T,x,v)),R=this.remuxVideo(x,ue,de,Pe)}}else Oe&&(R=this.remuxVideo(x,ue,de,0));R&&(R.firstKeyFrame=Me,R.independent=Me!==-1)}}return this.ISGenerated&&(f.samples.length&&(Y=this.remuxID3(f,v)),w.samples.length&&(y=this.remuxText(w,v))),{audio:j,video:R,initSegment:N,independent:ee,text:y,id3:Y}},O.generateIS=function(T,x,f){var w=T.samples,v=x.samples,b=this.typeSupported,F={},B=!Object(X.isFiniteNumber)(this._initPTS),R="audio/mp4",j,N,y;if(B&&(j=N=Infinity),T.config&&w.length&&(T.timescale=T.samplerate,T.isAAC||(b.mpeg?(R="audio/mpeg",T.codec=""):b.mp3&&(T.codec="mp3")),F.audio={id:"audio",container:R,codec:T.codec,initSegment:!T.isAAC&&b.mpeg?new Uint8Array(0):k.default.initSegment([T]),metadata:{channelCount:T.channelCount}},B&&(y=T.inputTimeScale,j=N=w[0].pts-Math.round(y*f))),x.sps&&x.pps&&v.length&&(x.timescale=x.inputTimeScale,F.video={id:"main",container:"video/mp4",codec:x.codec,initSegment:k.default.initSegment([x]),metadata:{width:x.width,height:x.height}},B)){y=x.inputTimeScale;var Y=this.getVideoStartPts(v),ee=Math.round(y*f);N=Math.min(N,a(v[0].dts,Y)-ee),j=Math.min(j,Y-ee)}if(Object.keys(F).length)return this.ISGenerated=!0,B&&(this._initPTS=j,this._initDTS=N),{tracks:F,initPTS:j,timescale:y}},O.remuxVideo=function(T,x,f,w){var v=T.inputTimeScale,b=T.samples,F=[],B=b.length,R=this._initPTS,j=this.nextAvcDts,N=8,y,Y,ee,ae=Number.POSITIVE_INFINITY,ue=Number.NEGATIVE_INFINITY,Re=0,Ee=!1;if(!f||j===null){var xe=x*v,Ce=b[0].pts-a(b[0].dts,b[0].pts);j=xe-Ce}for(var Oe=0;Oe<B;Oe++){var pe=b[Oe];if(pe.pts=a(pe.pts-R,j),pe.dts=a(pe.dts-R,j),pe.dts>pe.pts){var de=9e4*.2;Re=Math.max(Math.min(Re,pe.pts-pe.dts),-1*de)}pe.dts<b[Oe>0?Oe-1:Oe].dts&&(Ee=!0)}Ee&&b.sort(function(Ct,xt){var Qe=Ct.dts-xt.dts,Lt=Ct.pts-xt.pts;return Qe||Lt}),Y=b[0].dts,ee=b[b.length-1].dts;var Me=Math.round((ee-Y)/(B-1));if(Re<0){if(Re<Me*-2){n.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(g.toMsFromMpegTsClock)(-Me,!0)+" ms");for(var tt=Re,We=0;We<B;We++)b[We].dts=tt=Math.max(tt,b[We].pts-Me),b[We].pts=Math.max(tt,b[We].pts)}else{n.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(g.toMsFromMpegTsClock)(Re,!0)+" ms to overcome this issue");for(var rt=0;rt<B;rt++)b[rt].dts=b[rt].dts+Re}Y=b[0].dts}if(f){var st=Y-j,Pe=st>Me,je=st<-1;if(Pe||je){Pe?n.logger.warn("AVC: "+Object(g.toMsFromMpegTsClock)(st,!0)+" ms ("+st+"dts) hole between fragments detected, filling it"):n.logger.warn("AVC: "+Object(g.toMsFromMpegTsClock)(-st,!0)+" ms ("+st+"dts) overlapping between fragments detected"),Y=j;var Ze=b[0].pts-st;b[0].dts=Y,b[0].pts=Ze,n.logger.log("Video: First PTS/DTS adjusted: "+Object(g.toMsFromMpegTsClock)(Ze,!0)+"/"+Object(g.toMsFromMpegTsClock)(Y,!0)+", delta: "+Object(g.toMsFromMpegTsClock)(st,!0)+" ms")}}u&&(Y=Math.max(0,Y));for(var se=0,_e=0,Te=0;Te<B;Te++){for(var Ae=b[Te],ze=Ae.units,Be=ze.length,Ue=0,Ve=0;Ve<Be;Ve++)Ue+=ze[Ve].data.length;_e+=Ue,se+=Be,Ae.length=Ue,Ae.dts=Math.max(Ae.dts,Y),Ae.pts=Math.max(Ae.pts,Ae.dts,0),ae=Math.min(Ae.pts,ae),ue=Math.max(Ae.pts,ue)}ee=b[B-1].dts;var $e=_e+4*se+8,Xe;try{Xe=new Uint8Array($e)}catch(Ct){this.observer.emit(G.Events.ERROR,G.Events.ERROR,{type:H.ErrorTypes.MUX_ERROR,details:H.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:$e,reason:"fail allocating video mdat "+$e});return}var et=new DataView(Xe.buffer);et.setUint32(0,$e),Xe.set(k.default.types.mdat,4);for(var Ie=0;Ie<B;Ie++){for(var nt=b[Ie],at=nt.units,De=0,ke=0,ve=at.length;ke<ve;ke++){var ce=at[ke],fe=ce.data,ie=ce.data.byteLength;et.setUint32(N,ie),N+=4,Xe.set(fe,N),N+=ie,De+=4+ie}if(Ie<B-1)y=b[Ie+1].dts-nt.dts;else{var ne=this.config,oe=nt.dts-b[Ie>0?Ie-1:Ie].dts;if(ne.stretchShortVideoTrack&&this.nextAudioPts!==null){var le=Math.floor(ne.maxBufferHole*v),ye=(w?ae+w*v:this.nextAudioPts)-nt.pts;ye>le?(y=ye-oe,y<0&&(y=oe),n.logger.log("[mp4-remuxer]: It is approximately "+ye/90+" ms to the next segment; using duration "+y/90+" ms for the last video frame.")):y=oe}else y=oe}var Le=Math.round(nt.pts-nt.dts);F.push(new E(nt.key,y,De,Le))}if(F.length&&c&&c<70){var Ne=F[0].flags;Ne.dependsOn=2,Ne.isNonSync=0}console.assert(y!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=j=ee+y,this.isVideoContiguous=!0;var Je=k.default.moof(T.sequenceNumber++,Y,p({},T,{samples:F})),mt="video",ft={data1:Je,data2:Xe,startPTS:ae/v,endPTS:(ue+y)/v,startDTS:Y/v,endDTS:j/v,type:mt,hasAudio:!1,hasVideo:!0,nb:F.length,dropped:T.dropped};return T.samples=[],T.dropped=0,console.assert(Xe.length,"MDAT length must not be zero"),ft},O.remuxAudio=function(T,x,f,w,v){var b=T.inputTimeScale,F=T.samplerate?T.samplerate:b,B=b/F,R=T.isAAC?h:o,j=R*B,N=this._initPTS,y=!T.isAAC&&this.typeSupported.mpeg,Y=[],ee=T.samples,ae=y?0:8,ue=this.nextAudioPts||-1,Re=x*b;if(this.isAudioContiguous=f=f||ee.length&&ue>0&&(w&&Math.abs(Re-ue)<9e3||Math.abs(a(ee[0].pts-N,Re)-ue)<20*j),ee.forEach(function(fe){fe.pts=a(fe.pts-N,Re)}),!f||ue<0){if(ee=ee.filter(function(fe){return fe.pts>=0}),!ee.length)return;v===0?ue=0:w?ue=Math.max(0,Re):ue=ee[0].pts}if(T.isAAC)for(var Ee=v!==void 0,xe=this.config.maxAudioFramesDrift,Ce=0,Oe=ue;Ce<ee.length;Ce++){var pe=ee[Ce],de=pe.pts,Me=de-Oe,tt=Math.abs(1e3*Me/b);if(Me<=-xe*j&&Ee)Ce===0&&(n.logger.warn("Audio frame @ "+(de/b).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*Me/b)+" ms."),this.nextAudioPts=ue=Oe=de);else if(Me>=xe*j&&tt<m&&Ee){var We=Math.round(Me/j);Oe=de-We*j,Oe<0&&(We--,Oe+=j),Ce===0&&(this.nextAudioPts=ue=Oe),n.logger.warn("[mp4-remuxer]: Injecting "+We+" audio frame @ "+(Oe/b).toFixed(3)+"s due to "+Math.round(1e3*Me/b)+" ms gap.");for(var rt=0;rt<We;rt++){var st=Math.max(Oe,0),Pe=U.default.getSilentFrame(T.manifestCodec||T.codec,T.channelCount);Pe||(n.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),Pe=pe.unit.subarray()),ee.splice(Ce,0,{unit:Pe,pts:st}),Oe+=j,Ce++}}pe.pts=Oe,Oe+=j}for(var je=null,Ze=null,se,_e=0,Te=ee.length;Te--;)_e+=ee[Te].unit.byteLength;for(var Ae=0,ze=ee.length;Ae<ze;Ae++){var Be=ee[Ae],Ue=Be.unit,Ve=Be.pts;if(Ze!==null){var $e=Y[Ae-1];$e.duration=Math.round((Ve-Ze)/B)}else if(f&&T.isAAC&&(Ve=ue),je=Ve,_e>0){_e+=ae;try{se=new Uint8Array(_e)}catch(fe){this.observer.emit(G.Events.ERROR,G.Events.ERROR,{type:H.ErrorTypes.MUX_ERROR,details:H.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:_e,reason:"fail allocating audio mdat "+_e});return}if(!y){var Xe=new DataView(se.buffer);Xe.setUint32(0,_e),se.set(k.default.types.mdat,4)}}else return;se.set(Ue,ae);var et=Ue.byteLength;ae+=et,Y.push(new E(!0,R,et,0)),Ze=Ve}var Ie=Y.length;if(!Ie)return;var nt=Y[Y.length-1];this.nextAudioPts=ue=Ze+B*nt.duration;var at=y?new Uint8Array(0):k.default.moof(T.sequenceNumber++,je/B,p({},T,{samples:Y}));T.samples=[];var De=je/b,ke=ue/b,ve="audio",ce={data1:at,data2:se,startPTS:De,endPTS:ke,startDTS:De,endDTS:ke,type:ve,hasAudio:!0,hasVideo:!1,nb:Ie};return this.isAudioContiguous=!0,console.assert(se.length,"MDAT length must not be zero"),ce},O.remuxEmptyAudio=function(T,x,f,w){var v=T.inputTimeScale,b=T.samplerate?T.samplerate:v,F=v/b,B=this.nextAudioPts,R=(B!==null?B:w.startDTS*v)+this._initDTS,j=w.endDTS*v+this._initDTS,N=F*h,y=Math.ceil((j-R)/N),Y=U.default.getSilentFrame(T.manifestCodec||T.codec,T.channelCount);if(n.logger.warn("[mp4-remuxer]: remux empty Audio"),!Y){n.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var ee=[],ae=0;ae<y;ae++){var ue=R+ae*N;ee.push({unit:Y,pts:ue,dts:ue})}return T.samples=ee,this.remuxAudio(T,x,f,!1)},O.remuxID3=function(T,x){var f=T.samples.length;if(!f)return;for(var w=T.inputTimeScale,v=this._initPTS,b=this._initDTS,F=0;F<f;F++){var B=T.samples[F];B.pts=a(B.pts-v,x*w)/w,B.dts=a(B.dts-b,x*w)/w}var R=T.samples;return T.samples=[],{samples:R}},O.remuxText=function(T,x){var f=T.samples.length;if(!f)return;for(var w=T.inputTimeScale,v=this._initPTS,b=0;b<f;b++){var F=T.samples[b];F.pts=a(F.pts-v,x*w)/w}T.samples.sort(function(R,j){return R.pts-j.pts});var B=T.samples;return T.samples=[],{samples:B}},L}();function a(L,O){var C;if(O===null)return L;for(O<L?C=-8589934592:C=8589934592;Math.abs(L-O)>4294967296;)L+=C;return L}function A(L){for(var O=0;O<L.length;O++)if(L[O].key)return O;return-1}var E=function(O,C,T,x){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=C,this.size=T,this.cts=x,this.flags=new S(O)},S=function(O){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=O?2:1,this.isNonSync=O?0:1}},"./src/remux/passthrough-remuxer.ts":function(re,$,P){"use strict";P.r($);var X=P("./src/polyfills/number.ts"),U=P("./src/utils/mp4-tools.ts"),k=P("./src/loader/fragment.ts"),G=P("./src/utils/logger.ts"),H=function(){function g(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndDTS=null}var p=g.prototype;return p.destroy=function(){},p.resetTimeStamp=function(h){this.initPTS=h,this.lastEndDTS=null},p.resetNextTimestamp=function(){this.lastEndDTS=null},p.resetInitSegment=function(h,o,c){this.audioCodec=o,this.videoCodec=c,this.generateInitSegment(h),this.emitInitSegment=!0},p.generateInitSegment=function(h){var o=this.audioCodec,c=this.videoCodec;if(!h||!h.byteLength){this.initTracks=void 0,this.initData=void 0;return}var l=this.initData=Object(U.parseInitSegment)(h);o||(o=D(l.audio,k.ElementaryStreamTypes.AUDIO)),c||(c=D(l.video,k.ElementaryStreamTypes.VIDEO));var u={};l.audio&&l.video?u.audiovideo={container:"video/mp4",codec:o+","+c,initSegment:h,id:"main"}:l.audio?u.audio={container:"audio/mp4",codec:o,initSegment:h,id:"audio"}:l.video?u.video={container:"video/mp4",codec:c,initSegment:h,id:"main"}:G.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=u},p.remux=function(h,o,c,l,u){var s=this.initPTS,a=this.lastEndDTS,A={audio:void 0,video:void 0,text:l,id3:c,initSegment:void 0};Object(X.isFiniteNumber)(a)||(a=this.lastEndDTS=u||0);var E=o.samples;if(!E||!E.length)return A;var S={initPTS:void 0,timescale:1},L=this.initData;if((!L||!L.length)&&(this.generateInitSegment(E),L=this.initData),!L||!L.length)return G.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),A;this.emitInitSegment&&(S.tracks=this.initTracks,this.emitInitSegment=!1),Object(X.isFiniteNumber)(s)||(this.initPTS=S.initPTS=s=n(L,E,a));var O=Object(U.getDuration)(E,L),C=a,T=O+C;Object(U.offsetStartDTS)(L,E,s),O>0?this.lastEndDTS=T:(G.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var x=!!L.audio,f=!!L.video,w="";x&&(w+="audio"),f&&(w+="video");var v={data1:E,startPTS:C,startDTS:C,endPTS:T,endDTS:T,type:w,hasAudio:x,hasVideo:f,nb:1,dropped:0};return A.audio=v.type==="audio"?v:void 0,A.video=v.type!=="audio"?v:void 0,A.text=l,A.id3=c,A.initSegment=S,A},g}(),n=function(p,m,h){return Object(U.getStartDTS)(p,m)-h};function D(g,p){var m=g==null?void 0:g.codec;return m&&m.length>4?m:m==="hvc1"?"hvc1.1.c.L120.90":m==="av01"?"av01.0.04M.08":m==="avc1"||p===k.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}$.default=H},"./src/task-loop.ts":function(re,$,P){"use strict";P.r($),P.d($,"default",function(){return X});var X=function(){function U(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var k=U.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(H){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,H),!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(){},U}()},"./src/types/cmcd.ts":function(re,$,P){"use strict";P.r($),P.d($,"CMCDVersion",function(){return X}),P.d($,"CMCDObjectType",function(){return U}),P.d($,"CMCDStreamingFormat",function(){return k}),P.d($,"CMCDStreamType",function(){return G});var X=1,U;(function(H){H.MANIFEST="m",H.AUDIO="a",H.VIDEO="v",H.MUXED="av",H.INIT="i",H.CAPTION="c",H.TIMED_TEXT="tt",H.KEY="k",H.OTHER="o"})(U||(U={}));var k;(function(H){H.DASH="d",H.HLS="h",H.SMOOTH="s",H.OTHER="o"})(k||(k={}));var G;(function(H){H.VOD="v",H.LIVE="l"})(G||(G={}))},"./src/types/level.ts":function(re,$,P){"use strict";P.r($),P.d($,"HlsSkip",function(){return k}),P.d($,"getSkipValue",function(){return G}),P.d($,"HlsUrlParameters",function(){return H}),P.d($,"Level",function(){return n});function X(D,g){for(var p=0;p<g.length;p++){var m=g[p];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(D,m.key,m)}}function U(D,g,p){return g&&X(D.prototype,g),p&&X(D,p),D}var k;(function(D){D.No="",D.Yes="YES",D.v2="v2"})(k||(k={}));function G(D,g){var p=D.canSkipUntil,m=D.canSkipDateRanges,h=D.endSN,o=g!==void 0?g-h:0;return p&&o<p?m?k.v2:k.Yes:k.No}var H=function(){function D(p,m,h){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=p,this.part=m,this.skip=h}var g=D.prototype;return g.addDirectives=function(m){var h=new self.URL(m);return this.msn!==void 0&&h.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&h.searchParams.set("_HLS_part",this.part.toString()),this.skip&&h.searchParams.set("_HLS_skip",this.skip),h.toString()},D}(),n=function(){function D(g){this.attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.unknownCodecs=void 0,this.audioGroupIds=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.textGroupIds=void 0,this.url=void 0,this._urlId=0,this.url=[g.url],this.attrs=g.attrs,this.bitrate=g.bitrate,g.details&&(this.details=g.details),this.id=g.id||0,this.name=g.name,this.width=g.width||0,this.height=g.height||0,this.audioCodec=g.audioCodec,this.videoCodec=g.videoCodec,this.unknownCodecs=g.unknownCodecs,this.codecSet=[g.videoCodec,g.audioCodec].filter(function(p){return p}).join(",").replace(/\.[^.,]+/g,"")}return U(D,[{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(p){var m=p%this.url.length;this._urlId!==m&&(this.details=void 0,this._urlId=m)}}]),D}()},"./src/types/loader.ts":function(re,$,P){"use strict";P.r($),P.d($,"PlaylistContextType",function(){return X}),P.d($,"PlaylistLevelType",function(){return U});var X;(function(k){k.MANIFEST="manifest",k.LEVEL="level",k.AUDIO_TRACK="audioTrack",k.SUBTITLE_TRACK="subtitleTrack"})(X||(X={}));var U;(function(k){k.MAIN="main",k.AUDIO="audio",k.SUBTITLE="subtitle"})(U||(U={}))},"./src/types/transmuxer.ts":function(re,$,P){"use strict";P.r($),P.d($,"ChunkMetadata",function(){return X});var X=function(G,H,n,D,g,p){D===void 0&&(D=0),g===void 0&&(g=-1),p===void 0&&(p=!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=U(),this.buffering={audio:U(),video:U(),audiovideo:U()},this.level=G,this.sn=H,this.id=n,this.size=D,this.part=g,this.partial=p};function U(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(re,$,P){"use strict";P.r($),P.d($,"AttrList",function(){return k});var X=/^(\d+)x(\d+)$/,U=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,k=function(){function G(n){typeof n=="string"&&(n=G.parseAttrList(n));for(var D in n)n.hasOwnProperty(D)&&(this[D]=n[D])}var H=G.prototype;return H.decimalInteger=function(D){var g=parseInt(this[D],10);return g>Number.MAX_SAFE_INTEGER?Infinity:g},H.hexadecimalInteger=function(D){if(this[D]){var g=(this[D]||"0x").slice(2);g=(g.length&1?"0":"")+g;for(var p=new Uint8Array(g.length/2),m=0;m<g.length/2;m++)p[m]=parseInt(g.slice(m*2,m*2+2),16);return p}else return null},H.hexadecimalIntegerAsNumber=function(D){var g=parseInt(this[D],16);return g>Number.MAX_SAFE_INTEGER?Infinity:g},H.decimalFloatingPoint=function(D){return parseFloat(this[D])},H.optionalFloat=function(D,g){var p=this[D];return p?parseFloat(p):g},H.enumeratedString=function(D){return this[D]},H.bool=function(D){return this[D]==="YES"},H.decimalResolution=function(D){var g=X.exec(this[D]);return g===null?void 0:{width:parseInt(g[1],10),height:parseInt(g[2],10)}},G.parseAttrList=function(D){var g,p={},m='"';for(U.lastIndex=0;(g=U.exec(D))!==null;){var h=g[2];h.indexOf(m)===0&&h.lastIndexOf(m)===h.length-1&&(h=h.slice(1,-1)),p[g[1]]=h}return p},G}()},"./src/utils/binary-search.ts":function(re,$,P){"use strict";P.r($);var X={search:function(k,G){for(var H=0,n=k.length-1,D=null,g=null;H<=n;){D=(H+n)/2|0,g=k[D];var p=G(g);if(p>0)H=D+1;else if(p<0)n=D-1;else return g}return null}};$.default=X},"./src/utils/buffer-helper.ts":function(re,$,P){"use strict";P.r($),P.d($,"BufferHelper",function(){return k});var X=P("./src/utils/logger.ts"),U={length:0,start:function(){return 0},end:function(){return 0}},k=function(){function G(){}return G.isBuffered=function(n,D){try{if(n){for(var g=G.getBuffered(n),p=0;p<g.length;p++)if(D>=g.start(p)&&D<=g.end(p))return!0}}catch(m){}return!1},G.bufferInfo=function(n,D,g){try{if(n){var p=G.getBuffered(n),m=[],h;for(h=0;h<p.length;h++)m.push({start:p.start(h),end:p.end(h)});return this.bufferedInfo(m,D,g)}}catch(o){}return{len:0,start:D,end:D,nextStart:void 0}},G.bufferedInfo=function(n,D,g){D=Math.max(0,D),n.sort(function(S,L){var O=S.start-L.start;return O||L.end-S.end});var p=[];if(g)for(var m=0;m<n.length;m++){var h=p.length;if(h){var o=p[h-1].end;n[m].start-o<g?n[m].end>o&&(p[h-1].end=n[m].end):p.push(n[m])}else p.push(n[m])}else p=n;for(var c=0,l,u=D,s=D,a=0;a<p.length;a++){var A=p[a].start,E=p[a].end;if(D+g>=A&&D<E)u=A,s=E,c=s-D;else if(D+g<A){l=A;break}}return{len:c,start:u||0,end:s||0,nextStart:l}},G.getBuffered=function(n){try{return n.buffered}catch(D){return X.logger.log("failed to get media.buffered",D),U}},G}()},"./src/utils/cea-608-parser.ts":function(re,$,P){"use strict";P.r($),P.d($,"Row",function(){return s}),P.d($,"CaptionScreen",function(){return a});var X=P("./src/utils/logger.ts"),U={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(T){var x=T;return U.hasOwnProperty(T)&&(x=U[T]),String.fromCharCode(x)},G=15,H=100,n={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},D={17:2,18:4,21:6,22:8,23:10,19:13,20:15},g={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},p={25:2,26:4,29:6,30:8,31:10,27:13,28:15},m=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],h;(function(C){C[C.ERROR=0]="ERROR",C[C.TEXT=1]="TEXT",C[C.WARNING=2]="WARNING",C[C.INFO=2]="INFO",C[C.DEBUG=3]="DEBUG",C[C.DATA=3]="DATA"})(h||(h={}));var o=function(){function C(){this.time=null,this.verboseLevel=h.ERROR}var T=C.prototype;return T.log=function(f,w){this.verboseLevel>=f&&X.logger.log(this.time+" ["+f+"] "+w)},C}(),c=function(T){for(var x=[],f=0;f<T.length;f++)x.push(T[f].toString(16));return x},l=function(){function C(x,f,w,v,b){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=x||"white",this.underline=f||!1,this.italics=w||!1,this.background=v||"black",this.flash=b||!1}var T=C.prototype;return T.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},T.setStyles=function(f){for(var w=["foreground","underline","italics","background","flash"],v=0;v<w.length;v++){var b=w[v];f.hasOwnProperty(b)&&(this[b]=f[b])}},T.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},T.equals=function(f){return this.foreground===f.foreground&&this.underline===f.underline&&this.italics===f.italics&&this.background===f.background&&this.flash===f.flash},T.copy=function(f){this.foreground=f.foreground,this.underline=f.underline,this.italics=f.italics,this.background=f.background,this.flash=f.flash},T.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},C}(),u=function(){function C(x,f,w,v,b,F){this.uchar=void 0,this.penState=void 0,this.uchar=x||" ",this.penState=new l(f,w,v,b,F)}var T=C.prototype;return T.reset=function(){this.uchar=" ",this.penState.reset()},T.setChar=function(f,w){this.uchar=f,this.penState.copy(w)},T.setPenState=function(f){this.penState.copy(f)},T.equals=function(f){return this.uchar===f.uchar&&this.penState.equals(f.penState)},T.copy=function(f){this.uchar=f.uchar,this.penState.copy(f.penState)},T.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},C}(),s=function(){function C(x){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var f=0;f<H;f++)this.chars.push(new u);this.logger=x,this.pos=0,this.currPenState=new l}var T=C.prototype;return T.equals=function(f){for(var w=!0,v=0;v<H;v++)if(!this.chars[v].equals(f.chars[v])){w=!1;break}return w},T.copy=function(f){for(var w=0;w<H;w++)this.chars[w].copy(f.chars[w])},T.isEmpty=function(){for(var f=!0,w=0;w<H;w++)if(!this.chars[w].isEmpty()){f=!1;break}return f},T.setCursor=function(f){this.pos!==f&&(this.pos=f),this.pos<0?(this.logger.log(h.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>H&&(this.logger.log(h.DEBUG,"Too large cursor position "+this.pos),this.pos=H)},T.moveCursor=function(f){var w=this.pos+f;if(f>1)for(var v=this.pos+1;v<w+1;v++)this.chars[v].setPenState(this.currPenState);this.setCursor(w)},T.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},T.insertChar=function(f){f>=144&&this.backSpace();var w=k(f);if(this.pos>=H){this.logger.log(h.ERROR,"Cannot insert "+f.toString(16)+" ("+w+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(w,this.currPenState),this.moveCursor(1)},T.clearFromPos=function(f){var w;for(w=f;w<H;w++)this.chars[w].reset()},T.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},T.clearToEndOfRow=function(){this.clearFromPos(this.pos)},T.getTextString=function(){for(var f=[],w=!0,v=0;v<H;v++){var b=this.chars[v].uchar;b!==" "&&(w=!1),f.push(b)}return w?"":f.join("")},T.setPenStyles=function(f){this.currPenState.setStyles(f);var w=this.chars[this.pos];w.setPenState(this.currPenState)},C}(),a=function(){function C(x){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var f=0;f<G;f++)this.rows.push(new s(x));this.logger=x,this.currRow=G-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var T=C.prototype;return T.reset=function(){for(var f=0;f<G;f++)this.rows[f].clear();this.currRow=G-1},T.equals=function(f){for(var w=!0,v=0;v<G;v++)if(!this.rows[v].equals(f.rows[v])){w=!1;break}return w},T.copy=function(f){for(var w=0;w<G;w++)this.rows[w].copy(f.rows[w])},T.isEmpty=function(){for(var f=!0,w=0;w<G;w++)if(!this.rows[w].isEmpty()){f=!1;break}return f},T.backSpace=function(){var f=this.rows[this.currRow];f.backSpace()},T.clearToEndOfRow=function(){var f=this.rows[this.currRow];f.clearToEndOfRow()},T.insertChar=function(f){var w=this.rows[this.currRow];w.insertChar(f)},T.setPen=function(f){var w=this.rows[this.currRow];w.setPenStyles(f)},T.moveCursor=function(f){var w=this.rows[this.currRow];w.moveCursor(f)},T.setCursor=function(f){this.logger.log(h.INFO,"setCursor: "+f);var w=this.rows[this.currRow];w.setCursor(f)},T.setPAC=function(f){this.logger.log(h.INFO,"pacData = "+JSON.stringify(f));var w=f.row-1;if(this.nrRollUpRows&&w<this.nrRollUpRows-1&&(w=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==w){for(var v=0;v<G;v++)this.rows[v].clear();var b=this.currRow+1-this.nrRollUpRows,F=this.lastOutputScreen;if(F){var B=F.rows[b].cueStartTime,R=this.logger.time;if(B&&R!==null&&B<R)for(var j=0;j<this.nrRollUpRows;j++)this.rows[w-this.nrRollUpRows+j+1].copy(F.rows[b+j])}}this.currRow=w;var N=this.rows[this.currRow];if(f.indent!==null){var y=f.indent,Y=Math.max(y-1,0);N.setCursor(f.indent),f.color=N.chars[Y].penState.foreground}var ee={foreground:f.color,underline:f.underline,italics:f.italics,background:"black",flash:!1};this.setPen(ee)},T.setBkgData=function(f){this.logger.log(h.INFO,"bkgData = "+JSON.stringify(f)),this.backSpace(),this.setPen(f),this.insertChar(32)},T.setRollUpRows=function(f){this.nrRollUpRows=f},T.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(h.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(h.TEXT,this.getDisplayText());var f=this.currRow+1-this.nrRollUpRows,w=this.rows.splice(f,1)[0];w.clear(),this.rows.splice(this.currRow,0,w),this.logger.log(h.INFO,"Rolling up")},T.getDisplayText=function(f){f=f||!1;for(var w=[],v="",b=-1,F=0;F<G;F++){var B=this.rows[F].getTextString();B&&(b=F+1,f?w.push("Row "+b+": '"+B+"'"):w.push(B.trim()))}return w.length>0&&(f?v="["+w.join(" | ")+"]":v=w.join(`
|
|
`)),v},T.getTextAndFormat=function(){return this.rows},C}(),A=function(){function C(x,f,w){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=x,this.outputFilter=f,this.mode=null,this.verbose=0,this.displayedMemory=new a(w),this.nonDisplayedMemory=new a(w),this.lastOutputScreen=new a(w),this.currRollUpRow=this.displayedMemory.rows[G-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=w}var T=C.prototype;return T.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[G-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},T.getHandler=function(){return this.outputFilter},T.setHandler=function(f){this.outputFilter=f},T.setPAC=function(f){this.writeScreen.setPAC(f)},T.setBkgData=function(f){this.writeScreen.setBkgData(f)},T.setMode=function(f){if(f===this.mode)return;this.mode=f,this.logger.log(h.INFO,"MODE="+f),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=f},T.insertChars=function(f){for(var w=0;w<f.length;w++)this.writeScreen.insertChar(f[w]);var v=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(h.INFO,v+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(h.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},T.ccRCL=function(){this.logger.log(h.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},T.ccBS=function(){if(this.logger.log(h.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},T.ccAOF=function(){},T.ccAON=function(){},T.ccDER=function(){this.logger.log(h.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},T.ccRU=function(f){this.logger.log(h.INFO,"RU("+f+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(f)},T.ccFON=function(){this.logger.log(h.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},T.ccRDC=function(){this.logger.log(h.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},T.ccTR=function(){this.logger.log(h.INFO,"TR"),this.setMode("MODE_TEXT")},T.ccRTD=function(){this.logger.log(h.INFO,"RTD"),this.setMode("MODE_TEXT")},T.ccEDM=function(){this.logger.log(h.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},T.ccCR=function(){this.logger.log(h.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},T.ccENM=function(){this.logger.log(h.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},T.ccEOC=function(){if(this.logger.log(h.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var f=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=f,this.writeScreen=this.nonDisplayedMemory,this.logger.log(h.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},T.ccTO=function(f){this.logger.log(h.INFO,"TO("+f+") - Tab Offset"),this.writeScreen.moveCursor(f)},T.ccMIDROW=function(f){var w={flash:!1};if(w.underline=f%2===1,w.italics=f>=46,w.italics)w.foreground="white";else{var v=Math.floor(f/2)-16,b=["white","green","blue","cyan","red","yellow","magenta"];w.foreground=b[v]}this.logger.log(h.INFO,"MIDROW: "+JSON.stringify(w)),this.writeScreen.setPen(w)},T.outputDataUpdate=function(f){f===void 0&&(f=!1);var w=this.logger.time;if(w===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=w:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,w,this.lastOutputScreen),f&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:w),this.lastOutputScreen.copy(this.displayedMemory))},T.cueSplitAtTime=function(f){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,f,this.displayedMemory),this.cueStartTime=f))},C}(),E=function(){function C(x,f,w){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var v=new o;this.channels=[null,new A(x,f,v),new A(x+1,w,v)],this.cmdHistory=O(),this.logger=v}var T=C.prototype;return T.getHandler=function(f){return this.channels[f].getHandler()},T.setHandler=function(f,w){this.channels[f].setHandler(w)},T.addData=function(f,w){var v,b,F,B=!1;this.logger.time=f;for(var R=0;R<w.length;R+=2){if(b=w[R]&127,F=w[R+1]&127,b===0&&F===0)continue;if(this.logger.log(h.DATA,"["+c([w[R],w[R+1]])+"] -> ("+c([b,F])+")"),v=this.parseCmd(b,F),v||(v=this.parseMidrow(b,F)),v||(v=this.parsePAC(b,F)),v||(v=this.parseBackgroundAttributes(b,F)),!v&&(B=this.parseChars(b,F),B)){var j=this.currentChannel;if(j&&j>0){var N=this.channels[j];N.insertChars(B)}else this.logger.log(h.WARNING,"No channel found yet. TEXT-MODE?")}!v&&!B&&this.logger.log(h.WARNING,"Couldn't parse cleaned data "+c([b,F])+" orig: "+c([w[R],w[R+1]]))}},T.parseCmd=function(f,w){var v=this.cmdHistory,b=(f===20||f===28||f===21||f===29)&&w>=32&&w<=47,F=(f===23||f===31)&&w>=33&&w<=35;if(!(b||F))return!1;if(L(f,w,v))return S(null,null,v),this.logger.log(h.DEBUG,"Repeated command ("+c([f,w])+") is dropped"),!0;var B=f===20||f===21||f===23?1:2,R=this.channels[B];return f===20||f===21||f===28||f===29?w===32?R.ccRCL():w===33?R.ccBS():w===34?R.ccAOF():w===35?R.ccAON():w===36?R.ccDER():w===37?R.ccRU(2):w===38?R.ccRU(3):w===39?R.ccRU(4):w===40?R.ccFON():w===41?R.ccRDC():w===42?R.ccTR():w===43?R.ccRTD():w===44?R.ccEDM():w===45?R.ccCR():w===46?R.ccENM():w===47&&R.ccEOC():R.ccTO(w-32),S(f,w,v),this.currentChannel=B,!0},T.parseMidrow=function(f,w){var v=0;if((f===17||f===25)&&w>=32&&w<=47){if(f===17?v=1:v=2,v!==this.currentChannel)return this.logger.log(h.ERROR,"Mismatch channel in midrow parsing"),!1;var b=this.channels[v];return b?(b.ccMIDROW(w),this.logger.log(h.DEBUG,"MIDROW ("+c([f,w])+")"),!0):!1}return!1},T.parsePAC=function(f,w){var v,b=this.cmdHistory,F=(f>=17&&f<=23||f>=25&&f<=31)&&w>=64&&w<=127,B=(f===16||f===24)&&w>=64&&w<=95;if(!(F||B))return!1;if(L(f,w,b))return S(null,null,b),!0;var R=f<=23?1:2;w>=64&&w<=95?v=R===1?n[f]:g[f]:v=R===1?D[f]:p[f];var j=this.channels[R];return j?(j.setPAC(this.interpretPAC(v,w)),S(f,w,b),this.currentChannel=R,!0):!1},T.interpretPAC=function(f,w){var v,b={color:null,italics:!1,indent:null,underline:!1,row:f};return w>95?v=w-96:v=w-64,b.underline=(v&1)===1,v<=13?b.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(v/2)]:v<=15?(b.italics=!0,b.color="white"):b.indent=Math.floor((v-16)/2)*4,b},T.parseChars=function(f,w){var v,b=null,F=null;if(f>=25?(v=2,F=f-8):(v=1,F=f),F>=17&&F<=19){var B;F===17?B=w+80:F===18?B=w+112:B=w+144,this.logger.log(h.INFO,"Special char '"+k(B)+"' in channel "+v),b=[B]}else f>=32&&f<=127&&(b=w===0?[f]:[f,w]);if(b){var R=c(b);this.logger.log(h.DEBUG,"Char codes = "+R.join(",")),S(f,w,this.cmdHistory)}return b},T.parseBackgroundAttributes=function(f,w){var v=(f===16||f===24)&&w>=32&&w<=47,b=(f===23||f===31)&&w>=45&&w<=47;if(!(v||b))return!1;var F,B={};f===16||f===24?(F=Math.floor((w-32)/2),B.background=m[F],w%2===1&&(B.background=B.background+"_semi")):w===45?B.background="transparent":(B.foreground="black",w===47&&(B.underline=!0));var R=f<=23?1:2,j=this.channels[R];return j.setBkgData(B),S(f,w,this.cmdHistory),!0},T.reset=function(){for(var f=0;f<Object.keys(this.channels).length;f++){var w=this.channels[f];w&&w.reset()}this.cmdHistory=O()},T.cueSplitAtTime=function(f){for(var w=0;w<this.channels.length;w++){var v=this.channels[w];v&&v.cueSplitAtTime(f)}},C}();function S(C,T,x){x.a=C,x.b=T}function L(C,T,x){return x.a===C&&x.b===T}function O(){return{a:null,b:null}}$.default=E},"./src/utils/codecs.ts":function(re,$,P){"use strict";P.r($),P.d($,"isCodecType",function(){return U}),P.d($,"isCodecSupportedInMp4",function(){return k});var X={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 U(G,H){var n=X[H];return!!n&&n[G.slice(0,4)]===!0}function k(G,H){return MediaSource.isTypeSupported((H||"video")+'/mp4;codecs="'+G+'"')}},"./src/utils/cues.ts":function(re,$,P){"use strict";P.r($);var X=P("./src/utils/vttparser.ts"),U=P("./src/utils/webvtt-parser.ts"),k=P("./src/utils/texttrack-utils.ts"),G=/\s/,H={newCue:function(D,g,p,m){for(var h=[],o,c,l,u,s,a=self.VTTCue||self.TextTrackCue,A=0;A<m.rows.length;A++)if(o=m.rows[A],l=!0,u=0,s="",!o.isEmpty()){for(var E=0;E<o.chars.length;E++)G.test(o.chars[E].uchar)&&l?u++:(s+=o.chars[E].uchar,l=!1);o.cueStartTime=g,g===p&&(p+=1e-4),u>=16?u--:u++;var S=Object(X.fixLineBreaks)(s.trim()),L=Object(U.generateCueId)(g,p,S);(!D||!D.cues||!D.cues.getCueById(L))&&(c=new a(g,p,S),c.id=L,c.line=A+1,c.align="left",c.position=10+Math.min(80,Math.floor(u*8/32)*10),h.push(c))}return D&&h.length&&(h.sort(function(O,C){return O.line==="auto"||C.line==="auto"?0:O.line>8&&C.line>8?C.line-O.line:O.line-C.line}),h.forEach(function(O){return Object(k.addCueToTrack)(D,O)})),h}};$.default=H},"./src/utils/discontinuities.ts":function(re,$,P){"use strict";P.r($),P.d($,"findFirstFragWithCC",function(){return G}),P.d($,"shouldAlignOnDiscontinuities",function(){return H}),P.d($,"findDiscontinuousReferenceFrag",function(){return n}),P.d($,"adjustSlidingStart",function(){return g}),P.d($,"alignStream",function(){return p}),P.d($,"alignPDT",function(){return h}),P.d($,"alignFragmentByPDTDelta",function(){return o}),P.d($,"alignMediaPlaylistByPDT",function(){return c});var X=P("./src/polyfills/number.ts"),U=P("./src/utils/logger.ts"),k=P("./src/controller/level-helper.ts");function G(l,u){for(var s=null,a=0,A=l.length;a<A;a++){var E=l[a];if(E&&E.cc===u){s=E;break}}return s}function H(l,u,s){return!!(u.details&&(s.endCC>s.startCC||l&&l.cc<s.startCC))}function n(l,u){var s=l.fragments,a=u.fragments;if(!a.length||!s.length){U.logger.log("No fragments to align");return}var A=G(s,a[0].cc);if(!A||A&&!A.startPTS){U.logger.log("No frag in previous level to align on");return}return A}function D(l,u){if(l){var s=l.start+u;l.start=l.startPTS=s,l.endPTS=s+l.duration}}function g(l,u){for(var s=u.fragments,a=0,A=s.length;a<A;a++)D(s[a],l);u.fragmentHint&&D(u.fragmentHint,l),u.alignedSliding=!0}function p(l,u,s){if(!u)return;m(l,s,u),!s.alignedSliding&&u.details&&h(s,u.details),!s.alignedSliding&&u.details&&!s.skippedSegments&&Object(k.adjustSliding)(u.details,s)}function m(l,u,s){if(H(l,s,u)){var a=n(s.details,u);a&&Object(X.isFiniteNumber)(a.start)&&(U.logger.log("Adjusting PTS using last level due to CC increase within current level "+u.url),g(a.start,u))}}function h(l,u){if(!u.fragments.length||!l.hasProgramDateTime||!u.hasProgramDateTime)return;var s=u.fragments[0].programDateTime,a=l.fragments[0].programDateTime,A=(a-s)/1e3+u.fragments[0].start;A&&Object(X.isFiniteNumber)(A)&&(U.logger.log("Adjusting PTS using programDateTime delta "+(a-s)+"ms, sliding:"+A.toFixed(3)+" "+l.url+" "),g(A,l))}function o(l,u){var s=l.programDateTime;if(!s)return;var a=(s-u)/1e3;l.start=l.startPTS=a,l.endPTS=a+l.duration}function c(l,u){if(!u.fragments.length||!l.hasProgramDateTime||!u.hasProgramDateTime)return;var s=u.fragments[0].programDateTime,a=u.fragments[0].start,A=s-a*1e3;l.fragments.forEach(function(E){o(E,A)}),l.fragmentHint&&o(l.fragmentHint,A),l.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(re,$,P){"use strict";P.r($);var X=P("./src/utils/ewma.ts"),U=function(){function k(H,n,D){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=D,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new X.default(H),this.fast_=new X.default(n)}var G=k.prototype;return G.update=function(n,D){var g=this.slow_,p=this.fast_;this.slow_.halfLife!==n&&(this.slow_=new X.default(n,g.getEstimate(),g.getTotalWeight())),this.fast_.halfLife!==D&&(this.fast_=new X.default(D,p.getEstimate(),p.getTotalWeight()))},G.sample=function(n,D){n=Math.max(n,this.minDelayMs_);var g=8*D,p=n/1e3,m=g/p;this.fast_.sample(p,m),this.slow_.sample(p,m)},G.canEstimate=function(){var n=this.fast_;return n&&n.getTotalWeight()>=this.minWeight_},G.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},G.destroy=function(){},k}();$.default=U},"./src/utils/ewma.ts":function(re,$,P){"use strict";P.r($);var X=function(){function U(G,H,n){H===void 0&&(H=0),n===void 0&&(n=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=G,this.alpha_=G?Math.exp(Math.log(.5)/G):0,this.estimate_=H,this.totalWeight_=n}var k=U.prototype;return k.sample=function(H,n){var D=Math.pow(this.alpha_,H);this.estimate_=n*(1-D)+D*this.estimate_,this.totalWeight_+=H},k.getTotalWeight=function(){return this.totalWeight_},k.getEstimate=function(){if(this.alpha_){var H=1-Math.pow(this.alpha_,this.totalWeight_);if(H)return this.estimate_/H}return this.estimate_},U}();$.default=X},"./src/utils/fetch-loader.ts":function(re,$,P){"use strict";P.r($),P.d($,"fetchSupported",function(){return o});var X=P("./src/polyfills/number.ts"),U=P("./src/loader/load-stats.ts"),k=P("./src/demux/chunk-cache.ts");function G(a,A){a.prototype=Object.create(A.prototype),a.prototype.constructor=a,p(a,A)}function H(a){var A=typeof Map=="function"?new Map:void 0;return H=function(S){if(S===null||!g(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,L)}function L(){return n(S,arguments,m(this).constructor)}return L.prototype=Object.create(S.prototype,{constructor:{value:L,enumerable:!1,writable:!0,configurable:!0}}),p(L,S)},H(a)}function n(a,A,E){return D()?n=Reflect.construct:n=function(L,O,C){var T=[null];T.push.apply(T,O);var x=Function.bind.apply(L,T),f=new x;return C&&p(f,C.prototype),f},n.apply(null,arguments)}function D(){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(a){return!1}}function g(a){return Function.toString.call(a).indexOf("[native code]")!==-1}function p(a,A){return p=Object.setPrototypeOf||function(S,L){return S.__proto__=L,S},p(a,A)}function m(a){return m=Object.setPrototypeOf?Object.getPrototypeOf:function(E){return E.__proto__||Object.getPrototypeOf(E)},m(a)}function h(){return h=Object.assign||function(a){for(var A=1;A<arguments.length;A++){var E=arguments[A];for(var S in E)Object.prototype.hasOwnProperty.call(E,S)&&(a[S]=E[S])}return a},h.apply(this,arguments)}function o(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(a){}return!1}var c=function(){function a(E){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=E.fetchSetup||u,this.controller=new self.AbortController,this.stats=new U.LoadStats}var A=a.prototype;return A.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},A.abortInternal=function(){var S=this.response;(!S||!S.ok)&&(this.stats.aborted=!0,this.controller.abort())},A.abort=function(){var S;this.abortInternal(),(S=this.callbacks)!==null&&S!==void 0&&S.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},A.load=function(S,L,O){var C=this,T=this.stats;if(T.loading.start)throw new Error("Loader can only be used once.");T.loading.start=self.performance.now();var x=l(S,this.controller.signal),f=O.onProgress,w=S.responseType==="arraybuffer",v=w?"byteLength":"length";this.context=S,this.config=L,this.callbacks=O,this.request=this.fetchSetup(S,x),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){C.abortInternal(),O.onTimeout(T,S,C.response)},L.timeout),self.fetch(this.request).then(function(b){if(C.response=C.loader=b,!b.ok){var F=b.status,B=b.statusText;throw new s(B||"fetch, bad network response",F,b)}return T.loading.first=Math.max(self.performance.now(),T.loading.start),T.total=parseInt(b.headers.get("Content-Length")||"0"),f&&Object(X.isFiniteNumber)(L.highWaterMark)?C.loadProgressively(b,T,S,L.highWaterMark,f):w?b.arrayBuffer():b.text()}).then(function(b){var F=C.response;self.clearTimeout(C.requestTimeout),T.loading.end=Math.max(self.performance.now(),T.loading.first),T.loaded=T.total=b[v];var B={url:F.url,data:b};f&&!Object(X.isFiniteNumber)(L.highWaterMark)&&f(T,S,b,F),O.onSuccess(B,T,S,F)}).catch(function(b){if(self.clearTimeout(C.requestTimeout),T.aborted)return;var F=b.code||0;O.onError({code:F,text:b.message},S,b.details)})},A.getCacheAge=function(){var S=null;if(this.response){var L=this.response.headers.get("age");S=L?parseFloat(L):null}return S},A.loadProgressively=function(S,L,O,C,T){C===void 0&&(C=0);var x=new k.default,f=S.body.getReader(),w=function v(){return f.read().then(function(b){if(b.done)return x.dataLength&&T(L,O,x.flush(),S),Promise.resolve(new ArrayBuffer(0));var F=b.value,B=F.length;return L.loaded+=B,B<C||x.dataLength?(x.push(F),x.dataLength>=C&&T(L,O,x.flush(),S)):T(L,O,F,S),v()}).catch(function(){return Promise.reject()})};return w()},a}();function l(a,A){var E={method:"GET",mode:"cors",credentials:"same-origin",signal:A,headers:new self.Headers(h({},a.headers))};return a.rangeEnd&&E.headers.set("Range","bytes="+a.rangeStart+"-"+String(a.rangeEnd-1)),E}function u(a,A){return new self.Request(a.url,A)}var s=function(a){G(A,a);function A(E,S,L){var O;return O=a.call(this,E)||this,O.code=void 0,O.details=void 0,O.code=S,O.details=L,O}return A}(H(Error));$.default=c},"./src/utils/imsc1-ttml-parser.ts":function(re,$,P){"use strict";P.r($),P.d($,"IMSC1_CODEC",function(){return g}),P.d($,"parseIMSC1",function(){return o});var X=P("./src/utils/mp4-tools.ts"),U=P("./src/utils/vttparser.ts"),k=P("./src/utils/vttcue.ts"),G=P("./src/demux/id3.ts"),H=P("./src/utils/timescale-conversion.ts"),n=P("./src/utils/webvtt-parser.ts");function D(){return D=Object.assign||function(C){for(var T=1;T<arguments.length;T++){var x=arguments[T];for(var f in x)Object.prototype.hasOwnProperty.call(x,f)&&(C[f]=x[f])}return C},D.apply(this,arguments)}var g="stpp.ttml.im1t",p=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,m=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,h={left:"start",center:"center",right:"end",start:"start",end:"end"};function o(C,T,x,f,w){var v=Object(X.findBox)(new Uint8Array(C),["mdat"]);if(v.length===0){w(new Error("Could not parse IMSC1 mdat"));return}var b=v[0],F=Object(G.utf8ArrayToStr)(new Uint8Array(C,b.start,b.end-b.start)),B=Object(H.toTimescaleFromScale)(T,1,x);try{f(c(F,B))}catch(R){w(R)}}function c(C,T){var x=new DOMParser,f=x.parseFromString(C,"text/xml"),w=f.getElementsByTagName("tt")[0];if(!w)throw new Error("Invalid ttml");var v={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},b=Object.keys(v).reduce(function(N,y){return N[y]=w.getAttribute("ttp:"+y)||v[y],N},{}),F=w.getAttribute("xml:space")!=="preserve",B=u(l(w,"styling","style")),R=u(l(w,"layout","region")),j=l(w,"body","[begin]");return[].map.call(j,function(N){var y=s(N,F);if(!y||!N.hasAttribute("begin"))return null;var Y=S(N.getAttribute("begin"),b),ee=S(N.getAttribute("dur"),b),ae=S(N.getAttribute("end"),b);if(Y===null)throw E(N);if(ae===null){if(ee===null)throw E(N);ae=Y+ee}var ue=new k.default(Y-T,ae-T,y);ue.id=Object(n.generateCueId)(ue.startTime,ue.endTime,ue.text);var Re=R[N.getAttribute("region")],Ee=B[N.getAttribute("style")];ue.position=10,ue.size=80;var xe=a(Re,Ee),Ce=xe.textAlign;if(Ce){var Oe=h[Ce];Oe&&(ue.lineAlign=Oe),ue.align=Ce}return D(ue,xe),ue}).filter(function(N){return N!==null})}function l(C,T,x){var f=C.getElementsByTagName(T)[0];return f?[].slice.call(f.querySelectorAll(x)):[]}function u(C){return C.reduce(function(T,x){var f=x.getAttribute("xml:id");return f&&(T[f]=x),T},{})}function s(C,T){return[].slice.call(C.childNodes).reduce(function(x,f,w){var v;return f.nodeName==="br"&&w?x+`
|
|
`:(v=f.childNodes)!==null&&v!==void 0&&v.length?s(f,T):T?x+f.textContent.trim().replace(/\s+/g," "):x+f.textContent},"")}function a(C,T){var x="http://www.w3.org/ns/ttml#styling",f=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return f.reduce(function(w,v){var b=A(T,x,v)||A(C,x,v);return b&&(w[v]=b),w},{})}function A(C,T,x){return C.hasAttributeNS(T,x)?C.getAttributeNS(T,x):null}function E(C){return new Error("Could not parse ttml timestamp "+C)}function S(C,T){if(!C)return null;var x=Object(U.parseTimeStamp)(C);return x===null&&(p.test(C)?x=L(C,T):m.test(C)&&(x=O(C,T))),x}function L(C,T){var x=p.exec(C),f=(x[4]|0)+(x[5]|0)/T.subFrameRate;return(x[1]|0)*3600+(x[2]|0)*60+(x[3]|0)+f/T.frameRate}function O(C,T){var x=m.exec(C),f=Number(x[1]),w=x[2];switch(w){case"h":return f*3600;case"m":return f*60;case"ms":return f*1e3;case"f":return f/T.frameRate;case"t":return f/T.tickRate}return f}},"./src/utils/logger.ts":function(re,$,P){"use strict";P.r($),P.d($,"enableLogs",function(){return n}),P.d($,"logger",function(){return D});var X=function(){},U={trace:X,debug:X,log:X,warn:X,info:X,error:X},k=U;function G(g){var p=self.console[g];return p?p.bind(self.console,"["+g+"] >"):X}function H(g){for(var p=arguments.length,m=new Array(p>1?p-1:0),h=1;h<p;h++)m[h-1]=arguments[h];m.forEach(function(o){k[o]=g[o]?g[o].bind(g):G(o)})}function n(g){if(self.console&&g===!0||typeof g=="object"){H(g,"debug","log","info","warn","error");try{k.log()}catch(p){k=U}}else k=U}var D=k},"./src/utils/mediakeys-helper.ts":function(re,$,P){"use strict";P.r($),P.d($,"KeySystems",function(){return X}),P.d($,"requestMediaKeySystemAccess",function(){return U});var X;(function(k){k.WIDEVINE="com.widevine.alpha",k.PLAYREADY="com.microsoft.playready"})(X||(X={}));var U=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(re,$,P){"use strict";P.r($),P.d($,"getMediaSource",function(){return X});function X(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(re,$,P){"use strict";P.r($),P.d($,"bin2str",function(){return H}),P.d($,"readUint16",function(){return n}),P.d($,"readUint32",function(){return D}),P.d($,"writeUint32",function(){return g}),P.d($,"findBox",function(){return p}),P.d($,"parseSegmentIndex",function(){return m}),P.d($,"parseInitSegment",function(){return h}),P.d($,"getStartDTS",function(){return o}),P.d($,"getDuration",function(){return c}),P.d($,"computeRawDurationFromSamples",function(){return l}),P.d($,"offsetStartDTS",function(){return u}),P.d($,"segmentValidRange",function(){return s}),P.d($,"appendUint8Array",function(){return a});var X=P("./src/utils/typed-array.ts"),U=P("./src/loader/fragment.ts"),k=Math.pow(2,32)-1,G=[].push;function H(A){return String.fromCharCode.apply(null,A)}function n(A,E){"data"in A&&(E+=A.start,A=A.data);var S=A[E]<<8|A[E+1];return S<0?65536+S:S}function D(A,E){"data"in A&&(E+=A.start,A=A.data);var S=A[E]<<24|A[E+1]<<16|A[E+2]<<8|A[E+3];return S<0?4294967296+S:S}function g(A,E,S){"data"in A&&(E+=A.start,A=A.data),A[E]=S>>24,A[E+1]=S>>16&255,A[E+2]=S>>8&255,A[E+3]=S&255}function p(A,E){var S=[];if(!E.length)return S;var L,O,C;"data"in A?(L=A.data,O=A.start,C=A.end):(L=A,O=0,C=L.byteLength);for(var T=O;T<C;){var x=D(L,T),f=H(L.subarray(T+4,T+8)),w=x>1?T+x:C;if(f===E[0])if(E.length===1)S.push({data:L,start:T+8,end:w});else{var v=p({data:L,start:T+8,end:w},E.slice(1));v.length&&G.apply(S,v)}T=w}return S}function m(A){var E=p(A,["moov"]),S=E[0],L=S?S.end:null,O=p(A,["sidx"]);if(!O||!O[0])return null;var C=[],T=O[0],x=T.data[0],f=x===0?8:16,w=D(T,f);f+=4;var v=0,b=0;x===0?f+=8:f+=16,f+=2;var F=T.end+b,B=n(T,f);f+=2;for(var R=0;R<B;R++){var j=f,N=D(T,j);j+=4;var y=N&2147483647,Y=(N&2147483648)>>>31;if(Y===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var ee=D(T,j);j+=4,C.push({referenceSize:y,subsegmentDuration:ee,info:{duration:ee/w,start:F,end:F+y-1}}),F+=y,j+=4,f=j}return{earliestPresentationTime:v,timescale:w,version:x,referencesCount:B,references:C,moovEndOffset:L}}function h(A){for(var E=[],S=p(A,["moov","trak"]),L=0;L<S.length;L++){var O=S[L],C=p(O,["tkhd"])[0];if(C){var T=C.data[C.start],x=T===0?12:20,f=D(C,x),w=p(O,["mdia","mdhd"])[0];if(w){T=w.data[w.start],x=T===0?12:20;var v=D(w,x),b=p(O,["mdia","hdlr"])[0];if(b){var F=H(b.data.subarray(b.start+8,b.start+12)),B={soun:U.ElementaryStreamTypes.AUDIO,vide:U.ElementaryStreamTypes.VIDEO}[F];if(B){var R=p(O,["mdia","minf","stbl","stsd"])[0],j=void 0;R&&(j=H(R.data.subarray(R.start+12,R.start+16))),E[f]={timescale:v,type:B},E[B]={timescale:v,id:f,codec:j}}}}}}var N=p(A,["moov","mvex","trex"]);return N.forEach(function(y){var Y=D(y,4),ee=E[Y];ee&&(ee.default={duration:D(y,12),flags:D(y,20)})}),E}function o(A,E){return p(E,["moof","traf"]).reduce(function(S,L){var O=p(L,["tfdt"])[0],C=O.data[O.start],T=p(L,["tfhd"]).reduce(function(x,f){var w=D(f,4),v=A[w];if(v){var b=D(O,4);C===1&&(b*=Math.pow(2,32),b+=D(O,8));var F=v.timescale||9e4,B=b/F;if(isFinite(B)&&(x===null||B<x))return B}return x},null);return T!==null&&isFinite(T)&&(S===null||T<S)?T:S},null)||0}function c(A,E){for(var S=0,L=0,O=0,C=p(A,["moof","traf"]),T=0;T<C.length;T++){var x=C[T],f=p(x,["tfhd"])[0],w=D(f,4),v=E[w];if(!v)continue;var b=v.default,F=D(f,0)|(b==null?void 0:b.flags),B=b==null?void 0:b.duration;F&8&&(F&2?B=D(f,12):B=D(f,8));for(var R=v.timescale||9e4,j=p(x,["trun"]),N=0;N<j.length;N++){if(B){var y=D(j[N],4);S=B*y}else S=l(j[N]);v.type===U.ElementaryStreamTypes.VIDEO?L+=S/R:v.type===U.ElementaryStreamTypes.AUDIO&&(O+=S/R)}}if(L===0&&O===0){var Y=m(A);if(Y!=null&&Y.references)return Y.references.reduce(function(ee,ae){return ee+ae.info.duration||0},0)}return L||O}function l(A){var E=D(A,0),S=8;E&1&&(S+=4),E&4&&(S+=4);for(var L=0,O=D(A,4),C=0;C<O;C++){if(E&256){var T=D(A,S);L+=T,S+=4}E&512&&(S+=4),E&1024&&(S+=4),E&2048&&(S+=4)}return L}function u(A,E,S){p(E,["moof","traf"]).forEach(function(L){p(L,["tfhd"]).forEach(function(O){var C=D(O,4),T=A[C];if(!T)return;var x=T.timescale||9e4;p(L,["tfdt"]).forEach(function(f){var w=f.data[f.start],v=D(f,4);if(w===0)g(f,4,v-S*x);else{v*=Math.pow(2,32),v+=D(f,8),v-=S*x,v=Math.max(v,0);var b=Math.floor(v/(k+1)),F=Math.floor(v%(k+1));g(f,4,b),g(f,8,F)}})})})}function s(A){var E={valid:null,remainder:null},S=p(A,["moof"]);if(S){if(S.length<2)return E.remainder=A,E}else return E;var L=S[S.length-1];return E.valid=Object(X.sliceUint8)(A,0,L.start-8),E.remainder=Object(X.sliceUint8)(A,L.start-8),E}function a(A,E){var S=new Uint8Array(A.length+E.length);return S.set(A),S.set(E,A.length),S}},"./src/utils/output-filter.ts":function(re,$,P){"use strict";P.r($),P.d($,"default",function(){return X});var X=function(){function U(G,H){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=G,this.trackName=H}var k=U.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(H,n,D){(this.startTime===null||this.startTime>H)&&(this.startTime=H),this.endTime=n,this.screen=D,this.timelineController.createCaptionsTrack(this.trackName)},k.reset=function(){this.cueRanges=[]},U}()},"./src/utils/texttrack-utils.ts":function(re,$,P){"use strict";P.r($),P.d($,"sendAddTrackEvent",function(){return U}),P.d($,"addCueToTrack",function(){return k}),P.d($,"clearCurrentCues",function(){return G}),P.d($,"removeCuesInRange",function(){return H}),P.d($,"getCuesInRange",function(){return D});var X=P("./src/utils/logger.ts");function U(g,p){var m;try{m=new Event("addtrack")}catch(h){m=document.createEvent("Event"),m.initEvent("addtrack",!1,!1)}m.track=g,p.dispatchEvent(m)}function k(g,p){var m=g.mode;if(m==="disabled"&&(g.mode="hidden"),g.cues&&!g.cues.getCueById(p.id))try{if(g.addCue(p),!g.cues.getCueById(p.id))throw new Error("addCue is failed for: "+p)}catch(o){X.logger.debug("[texttrack-utils]: "+o);var h=new self.TextTrackCue(p.startTime,p.endTime,p.text);h.id=p.id,g.addCue(h)}m==="disabled"&&(g.mode=m)}function G(g){var p=g.mode;if(p==="disabled"&&(g.mode="hidden"),g.cues)for(var m=g.cues.length;m--;)g.removeCue(g.cues[m]);p==="disabled"&&(g.mode=p)}function H(g,p,m){var h=g.mode;if(h==="disabled"&&(g.mode="hidden"),g.cues&&g.cues.length>0)for(var o=D(g.cues,p,m),c=0;c<o.length;c++)g.removeCue(o[c]);h==="disabled"&&(g.mode=h)}function n(g,p){if(p<g[0].startTime)return 0;var m=g.length-1;if(p>g[m].endTime)return-1;for(var h=0,o=m;h<=o;){var c=Math.floor((o+h)/2);if(p<g[c].startTime)o=c-1;else if(p>g[c].startTime&&h<m)h=c+1;else return c}return g[h].startTime-p<p-g[o].startTime?h:o}function D(g,p,m){var h=[],o=n(g,p);if(o>-1)for(var c=o,l=g.length;c<l;c++){var u=g[c];if(u.startTime>=p&&u.endTime<=m)h.push(u);else if(u.startTime>m)return h}return h}},"./src/utils/time-ranges.ts":function(re,$,P){"use strict";P.r($);var X={toString:function(k){for(var G="",H=k.length,n=0;n<H;n++)G+="["+k.start(n).toFixed(3)+","+k.end(n).toFixed(3)+"]";return G}};$.default=X},"./src/utils/timescale-conversion.ts":function(re,$,P){"use strict";P.r($),P.d($,"toTimescaleFromBase",function(){return U}),P.d($,"toTimescaleFromScale",function(){return k}),P.d($,"toMsFromMpegTsClock",function(){return G}),P.d($,"toMpegTsClockFromTimescale",function(){return H});var X=9e4;function U(n,D,g,p){g===void 0&&(g=1),p===void 0&&(p=!1);var m=n*D*g;return p?Math.round(m):m}function k(n,D,g,p){return g===void 0&&(g=1),p===void 0&&(p=!1),U(n,D,1/g,p)}function G(n,D){return D===void 0&&(D=!1),U(n,1e3,1/X,D)}function H(n,D){return D===void 0&&(D=1),U(n,X,1/D)}},"./src/utils/typed-array.ts":function(re,$,P){"use strict";P.r($),P.d($,"sliceUint8",function(){return X});function X(U,k,G){return Uint8Array.prototype.slice?U.slice(k,G):new Uint8Array(Array.prototype.slice.call(U,k,G))}},"./src/utils/vttcue.ts":function(re,$,P){"use strict";P.r($),$.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var X=["","lr","rl"],U=["start","middle","end","left","right"];function k(g,p){if(typeof p!="string")return!1;if(!Array.isArray(g))return!1;var m=p.toLowerCase();return~g.indexOf(m)?m:!1}function G(g){return k(X,g)}function H(g){return k(U,g)}function n(g){for(var p=arguments.length,m=new Array(p>1?p-1:0),h=1;h<p;h++)m[h-1]=arguments[h];for(var o=1;o<arguments.length;o++){var c=arguments[o];for(var l in c)g[l]=c[l]}return g}function D(g,p,m){var h=this,o={enumerable:!0};h.hasBeenReset=!1;var c="",l=!1,u=g,s=p,a=m,A=null,E="",S=!0,L="auto",O="start",C=50,T="middle",x=50,f="middle";Object.defineProperty(h,"id",n({},o,{get:function(){return c},set:function(v){c=""+v}})),Object.defineProperty(h,"pauseOnExit",n({},o,{get:function(){return l},set:function(v){l=!!v}})),Object.defineProperty(h,"startTime",n({},o,{get:function(){return u},set:function(v){if(typeof v!="number")throw new TypeError("Start time must be set to a number.");u=v,this.hasBeenReset=!0}})),Object.defineProperty(h,"endTime",n({},o,{get:function(){return s},set:function(v){if(typeof v!="number")throw new TypeError("End time must be set to a number.");s=v,this.hasBeenReset=!0}})),Object.defineProperty(h,"text",n({},o,{get:function(){return a},set:function(v){a=""+v,this.hasBeenReset=!0}})),Object.defineProperty(h,"region",n({},o,{get:function(){return A},set:function(v){A=v,this.hasBeenReset=!0}})),Object.defineProperty(h,"vertical",n({},o,{get:function(){return E},set:function(v){var b=G(v);if(b===!1)throw new SyntaxError("An invalid or illegal string was specified.");E=b,this.hasBeenReset=!0}})),Object.defineProperty(h,"snapToLines",n({},o,{get:function(){return S},set:function(v){S=!!v,this.hasBeenReset=!0}})),Object.defineProperty(h,"line",n({},o,{get:function(){return L},set:function(v){if(typeof v!="number"&&v!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");L=v,this.hasBeenReset=!0}})),Object.defineProperty(h,"lineAlign",n({},o,{get:function(){return O},set:function(v){var b=H(v);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");O=b,this.hasBeenReset=!0}})),Object.defineProperty(h,"position",n({},o,{get:function(){return C},set:function(v){if(v<0||v>100)throw new Error("Position must be between 0 and 100.");C=v,this.hasBeenReset=!0}})),Object.defineProperty(h,"positionAlign",n({},o,{get:function(){return T},set:function(v){var b=H(v);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");T=b,this.hasBeenReset=!0}})),Object.defineProperty(h,"size",n({},o,{get:function(){return x},set:function(v){if(v<0||v>100)throw new Error("Size must be between 0 and 100.");x=v,this.hasBeenReset=!0}})),Object.defineProperty(h,"align",n({},o,{get:function(){return f},set:function(v){var b=H(v);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");f=b,this.hasBeenReset=!0}})),h.displayState=void 0}return D.prototype.getCueAsHTML=function(){var g=self.WebVTT;return g.convertCueToDOMTree(self,this.text)},D}()},"./src/utils/vttparser.ts":function(re,$,P){"use strict";P.r($),P.d($,"parseTimeStamp",function(){return k}),P.d($,"fixLineBreaks",function(){return p}),P.d($,"VTTParser",function(){return m});var X=P("./src/utils/vttcue.ts"),U=function(){function h(){}var o=h.prototype;return o.decode=function(l,u){if(!l)return"";if(typeof l!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(l))},h}();function k(h){function o(l,u,s,a){return(l|0)*3600+(u|0)*60+(s|0)+parseFloat(a||0)}var c=h.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return c?parseFloat(c[2])>59?o(c[2],c[3],0,c[4]):o(c[1],c[2],c[3],c[4]):null}var G=function(){function h(){this.values=Object.create(null)}var o=h.prototype;return o.set=function(l,u){!this.get(l)&&u!==""&&(this.values[l]=u)},o.get=function(l,u,s){return s?this.has(l)?this.values[l]:u[s]:this.has(l)?this.values[l]:u},o.has=function(l){return l in this.values},o.alt=function(l,u,s){for(var a=0;a<s.length;++a)if(u===s[a]){this.set(l,u);break}},o.integer=function(l,u){/^-?\d+$/.test(u)&&this.set(l,parseInt(u,10))},o.percent=function(l,u){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(u)){var s=parseFloat(u);if(s>=0&&s<=100)return this.set(l,s),!0}return!1},h}();function H(h,o,c,l){var u=l?h.split(l):[h];for(var s in u){if(typeof u[s]!="string")continue;var a=u[s].split(c);if(a.length!==2)continue;var A=a[0],E=a[1];o(A,E)}}var n=new X.default(0,0,""),D=n.align==="middle"?"middle":"center";function g(h,o,c){var l=h;function u(){var A=k(h);if(A===null)throw new Error("Malformed timestamp: "+l);return h=h.replace(/^[^\sa-zA-Z-]+/,""),A}function s(A,E){var S=new G;H(A,function(C,T){var x;switch(C){case"region":for(var f=c.length-1;f>=0;f--)if(c[f].id===T){S.set(C,c[f].region);break}break;case"vertical":S.alt(C,T,["rl","lr"]);break;case"line":x=T.split(","),S.integer(C,x[0]),S.percent(C,x[0])&&S.set("snapToLines",!1),S.alt(C,x[0],["auto"]),x.length===2&&S.alt("lineAlign",x[1],["start",D,"end"]);break;case"position":x=T.split(","),S.percent(C,x[0]),x.length===2&&S.alt("positionAlign",x[1],["start",D,"end","line-left","line-right","auto"]);break;case"size":S.percent(C,T);break;case"align":S.alt(C,T,["start",D,"end","left","right"]);break}},/:/,/\s/),E.region=S.get("region",null),E.vertical=S.get("vertical","");var L=S.get("line","auto");L==="auto"&&n.line===-1&&(L=-1),E.line=L,E.lineAlign=S.get("lineAlign","start"),E.snapToLines=S.get("snapToLines",!0),E.size=S.get("size",100),E.align=S.get("align",D);var O=S.get("position","auto");O==="auto"&&n.position===50&&(O=E.align==="start"||E.align==="left"?0:E.align==="end"||E.align==="right"?100:50),E.position=O}function a(){h=h.replace(/^\s+/,"")}if(a(),o.startTime=u(),a(),h.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+l);h=h.substr(3),a(),o.endTime=u(),a(),s(h,o)}function p(h){return h.replace(/<br(?: \/)?>/gi,`
|
|
`)}var m=function(){function h(){this.state="INITIAL",this.buffer="",this.decoder=new U,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var o=h.prototype;return o.parse=function(l){var u=this;l&&(u.buffer+=u.decoder.decode(l,{stream:!0}));function s(){var O=u.buffer,C=0;for(O=p(O);C<O.length&&O[C]!=="\r"&&O[C]!==`
|
|
`;)++C;var T=O.substr(0,C);return O[C]==="\r"&&++C,O[C]===`
|
|
`&&++C,u.buffer=O.substr(C),T}function a(O){H(O,function(C,T){},/:/)}try{var A="";if(u.state==="INITIAL"){if(!/\r\n|\n/.test(u.buffer))return this;A=s();var E=A.match(/^()?WEBVTT([ \t].*)?$/);if(!E||!E[0])throw new Error("Malformed WebVTT signature.");u.state="HEADER"}for(var S=!1;u.buffer;){if(!/\r\n|\n/.test(u.buffer))return this;S?S=!1:A=s();switch(u.state){case"HEADER":/:/.test(A)?a(A):A||(u.state="ID");continue;case"NOTE":A||(u.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(A)){u.state="NOTE";break}if(!A)continue;if(u.cue=new X.default(0,0,""),u.state="CUE",A.indexOf("-->")===-1){u.cue.id=A;continue}case"CUE":if(!u.cue){u.state="BADCUE";continue}try{g(A,u.cue,u.regionList)}catch(O){u.cue=null,u.state="BADCUE";continue}u.state="CUETEXT";continue;case"CUETEXT":{var L=A.indexOf("-->")!==-1;if(!A||L&&(S=!0)){u.oncue&&u.cue&&u.oncue(u.cue),u.cue=null,u.state="ID";continue}if(u.cue===null)continue;u.cue.text&&(u.cue.text+=`
|
|
`),u.cue.text+=A}continue;case"BADCUE":A||(u.state="ID")}}}catch(O){u.state==="CUETEXT"&&u.cue&&u.oncue&&u.oncue(u.cue),u.cue=null,u.state=u.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},o.flush=function(){var l=this;try{if((l.cue||l.state==="HEADER")&&(l.buffer+=`
|
|
|
|
`,l.parse()),l.state==="INITIAL"||l.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(u){l.onparsingerror&&l.onparsingerror(u)}return l.onflush&&l.onflush(),this},h}()},"./src/utils/webvtt-parser.ts":function(re,$,P){"use strict";P.r($),P.d($,"generateCueId",function(){return m}),P.d($,"parseWebVTT",function(){return o});var X=P("./src/polyfills/number.ts"),U=P("./src/utils/vttparser.ts"),k=P("./src/demux/id3.ts"),G=P("./src/utils/timescale-conversion.ts"),H=P("./src/remux/mp4-remuxer.ts"),n=/\r\n|\n\r|\n|\r/g,D=function(l,u,s){return s===void 0&&(s=0),l.substr(s,u.length)===u},g=function(l){var u=parseInt(l.substr(-3)),s=parseInt(l.substr(-6,2)),a=parseInt(l.substr(-9,2)),A=l.length>9?parseInt(l.substr(0,l.indexOf(":"))):0;if(!Object(X.isFiniteNumber)(u)||!Object(X.isFiniteNumber)(s)||!Object(X.isFiniteNumber)(a)||!Object(X.isFiniteNumber)(A))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+l);return u+=1e3*s,u+=60*1e3*a,u+=60*60*1e3*A,u},p=function(l){for(var u=5381,s=l.length;s;)u=u*33^l.charCodeAt(--s);return(u>>>0).toString()};function m(c,l,u){return p(c.toString())+p(l.toString())+p(u)}var h=function(l,u,s){var a=l[u],A=l[a.prevCC];if(!A||!A.new&&a.new){l.ccOffset=l.presentationOffset=a.start,a.new=!1;return}for(;(E=A)!==null&&E!==void 0&&E.new;){var E;l.ccOffset+=a.start-A.start,a.new=!1,a=A,A=l[a.prevCC]}l.presentationOffset=s};function o(c,l,u,s,a,A,E,S){var L=new U.VTTParser,O=Object(k.utf8ArrayToStr)(new Uint8Array(c)).trim().replace(n,`
|
|
`).split(`
|
|
`),C=[],T=Object(G.toMpegTsClockFromTimescale)(l,u),x="00:00.000",f=0,w=0,v,b=!0,F=!1;L.oncue=function(B){var R=s[a],j=s.ccOffset,N=(f-T)/9e4;if(R!=null&&R.new&&(w!==void 0?j=s.ccOffset=R.start:h(s,a,N)),N&&(j=N-s.presentationOffset),F){var y=B.endTime-B.startTime,Y=Object(H.normalizePts)((B.startTime+j-w)*9e4,A*9e4)/9e4;B.startTime=Y,B.endTime=Y+y}var ee=B.text.trim();B.text=decodeURIComponent(encodeURIComponent(ee)),B.id||(B.id=m(B.startTime,B.endTime,ee)),B.endTime>0&&C.push(B)},L.onparsingerror=function(B){v=B},L.onflush=function(){if(v){S(v);return}E(C)},O.forEach(function(B){if(b)if(D(B,"X-TIMESTAMP-MAP=")){b=!1,F=!0,B.substr(16).split(",").forEach(function(R){D(R,"LOCAL:")?x=R.substr(6):D(R,"MPEGTS:")&&(f=parseInt(R.substr(7)))});try{w=g(x)/1e3}catch(R){F=!1,v=R}return}else B===""&&(b=!1);L.parse(B+`
|
|
`)}),L.flush()}},"./src/utils/xhr-loader.ts":function(re,$,P){"use strict";P.r($);var X=P("./src/utils/logger.ts"),U=P("./src/loader/load-stats.ts"),k=/^age:\s*[\d.]+\s*$/m,G=function(){function H(D){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=D?D.xhrSetup:null,this.stats=new U.LoadStats,this.retryDelay=0}var n=H.prototype;return n.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},n.abortInternal=function(){var g=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),g&&(g.onreadystatechange=null,g.onprogress=null,g.readyState!==4&&(this.stats.aborted=!0,g.abort()))},n.abort=function(){var g;this.abortInternal(),(g=this.callbacks)!==null&&g!==void 0&&g.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},n.load=function(g,p,m){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=g,this.config=p,this.callbacks=m,this.retryDelay=p.retryDelay,this.loadInternal()},n.loadInternal=function(){var g=this.config,p=this.context;if(!g)return;var m=this.loader=new self.XMLHttpRequest,h=this.stats;h.loading.first=0,h.loaded=0;var o=this.xhrSetup;try{if(o)try{o(m,p.url)}catch(u){m.open("GET",p.url,!0),o(m,p.url)}m.readyState||m.open("GET",p.url,!0);var c=this.context.headers;if(c)for(var l in c)m.setRequestHeader(l,c[l])}catch(u){this.callbacks.onError({code:m.status,text:u.message},p,m);return}p.rangeEnd&&m.setRequestHeader("Range","bytes="+p.rangeStart+"-"+(p.rangeEnd-1)),m.onreadystatechange=this.readystatechange.bind(this),m.onprogress=this.loadprogress.bind(this),m.responseType=p.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),g.timeout),m.send()},n.readystatechange=function(){var g=this.context,p=this.loader,m=this.stats;if(!g||!p)return;var h=p.readyState,o=this.config;if(m.aborted)return;if(h>=2)if(self.clearTimeout(this.requestTimeout),m.loading.first===0&&(m.loading.first=Math.max(self.performance.now(),m.loading.start)),h===4){p.onreadystatechange=null,p.onprogress=null;var c=p.status;if(c>=200&&c<300){m.loading.end=Math.max(self.performance.now(),m.loading.first);var l,u;if(g.responseType==="arraybuffer"?(l=p.response,u=l.byteLength):(l=p.responseText,u=l.length),m.loaded=m.total=u,!this.callbacks)return;var s=this.callbacks.onProgress;if(s&&s(m,g,l,p),!this.callbacks)return;var a={url:p.responseURL,data:l};this.callbacks.onSuccess(a,m,g,p)}else m.retry>=o.maxRetry||c>=400&&c<499?(X.logger.error(c+" while loading "+g.url),this.callbacks.onError({code:c,text:p.statusText},g,p)):(X.logger.warn(c+" while loading "+g.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,o.maxRetryDelay),m.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),o.timeout)},n.loadtimeout=function(){X.logger.warn("timeout while loading "+this.context.url);var g=this.callbacks;g&&(this.abortInternal(),g.onTimeout(this.stats,this.context,this.loader))},n.loadprogress=function(g){var p=this.stats;p.loaded=g.loaded,g.lengthComputable&&(p.total=g.total)},n.getCacheAge=function(){var g=null;if(this.loader&&k.test(this.loader.getAllResponseHeaders())){var p=this.loader.getResponseHeader("age");g=p?parseFloat(p):null}return g},H}();$.default=G}}).default})},vHTk:function(ht,be,Z){ht.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}}}]);
|