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([[161,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(u,o){u.cmdState.push(o)}function U(u){return u.cmdState.length>0?u.cmdState[u.cmdState.length-1]:null}function k(u){var o=u.cmdState.pop();o&&o.closeBracket()}function G(u){for(var o=u.cmdState,f=o.length-1;f>=0;f--){var l=o[f];if(l.name=="DEFAULT")continue;return l}return{styleIdentifier:function(){return null}}}function W(u,o,f){return function(){this.name=u,this.bracketNo=0,this.style=o,this.styles=f,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=W("importmodule","tag",["string","builtin"]),n.documentclass=W("documentclass","tag",["","atom"]),n.usepackage=W("usepackage","tag",["atom"]),n.begin=W("begin","tag",["atom"]),n.end=W("end","tag",["atom"]),n.label=W("label","tag",["atom"]),n.ref=W("ref","tag",["atom"]),n.eqref=W("eqref","tag",["atom"]),n.cite=W("cite","tag",["atom"]),n.bibitem=W("bibitem","tag",["atom"]),n.Bibitem=W("Bibitem","tag",["atom"]),n.RBibitem=W("RBibitem","tag",["atom"]),n.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function D(u,o){u.f=o}function g(u,o){var f;if(u.match(/^\\[a-zA-Z@]+/)){var l=u.current().slice(1);return f=n.hasOwnProperty(l)?n[l]:n.DEFAULT,f=new f,X(o,f),D(o,m),f.style}if(u.match(/^\\[$&%#{}_]/))return"tag";if(u.match(/^\\[,;!\/\\]/))return"tag";if(u.match("\\["))return D(o,function(a,s){return p(a,s,"\\]")}),"keyword";if(u.match("\\("))return D(o,function(a,s){return p(a,s,"\\)")}),"keyword";if(u.match("$$"))return D(o,function(a,s){return p(a,s,"$$")}),"keyword";if(u.match("$"))return D(o,function(a,s){return p(a,s,"$")}),"keyword";var h=u.next();if(h=="%")return u.skipToEnd(),"comment";if(h=="}"||h=="]"){if(f=U(o),f)f.closeBracket(h),D(o,m);else return"error";return"bracket"}else return h=="{"||h=="["?(f=n.DEFAULT,f=new f,X(o,f),"bracket"):/\d/.test(h)?(u.eatWhile(/[\w.%]/),"atom"):(u.eatWhile(/[\w\-_]/),f=G(o),f.name=="begin"&&(f.argument=u.current()),f.styleIdentifier())}function p(u,o,f){if(u.eatSpace())return null;if(f&&u.match(f))return D(o,g),"keyword";if(u.match(/^\\[a-zA-Z@]+/))return"tag";if(u.match(/^[a-zA-Z]+/))return"variable-2";if(u.match(/^\\[$&%#{}_]/))return"tag";if(u.match(/^\\[,;!\/]/))return"tag";if(u.match(/^[\^_&]/))return"tag";if(u.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(u.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var l=u.next();return l=="{"||l=="}"||l=="["||l=="]"||l=="("||l==")"?"bracket":l=="%"?(u.skipToEnd(),"comment"):"error"}function m(u,o){var f=u.peek(),l;return f=="{"||f=="["?(l=U(o),l.openBracket(f),u.eat(f),D(o,g),"bracket"):/[ \t\r]/.test(f)?(u.eat(f),null):(D(o,g),k(o),g(u,o))}return{startState:function(){var u=P.inMathMode?function(o,f){return p(o,f)}:g;return{cmdState:[],f:u}},copyState:function(u){return{cmdState:u.cmdState.slice(),f:u.f}},token:function(u,o){return o.f(u,o)},blankLine:function(u){u.f=g,u.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 W}),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:u}=p;const o=p.stacktrace||p.stack;return{$isError:!0,name:m,message:u,stack:o}}return p}const k="Canceled";function G(p){return p instanceof Error&&p.name===k&&p.message===k}function W(){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(W,n,D){var g=D&&D!=re.Init;if(n&&!g)W.on("blur",U),W.on("change",k),W.on("swapDoc",k),re.on(W.getInputField(),"compositionupdate",W.state.placeholderCompose=function(){X(W)}),k(W);else if(!n&&g){W.off("blur",U),W.off("change",k),W.off("swapDoc",k),re.off(W.getInputField(),"compositionupdate",W.state.placeholderCompose),$(W);var p=W.getWrapperElement();p.className=p.className.replace(" CodeMirror-empty","")}n&&!W.hasFocus()&&U(W)});function $(W){W.state.placeholder&&(W.state.placeholder.parentNode.removeChild(W.state.placeholder),W.state.placeholder=null)}function P(W){$(W);var n=W.state.placeholder=document.createElement("pre");n.style.cssText="height: 0; overflow: visible",n.style.direction=W.getOption("direction"),n.className="CodeMirror-placeholder CodeMirror-line-like";var D=W.getOption("placeholder");typeof D=="string"&&(D=document.createTextNode(D)),n.appendChild(D),W.display.lineSpace.insertBefore(n,W.display.lineSpace.firstChild)}function X(W){setTimeout(function(){var n=!1,D=W.getInputField();D.nodeName=="TEXTAREA"?n=!D.value:W.lineCount()==1&&(n=!/[^\u200b]/.test(D.querySelector(".CodeMirror-line").textContent)),n?P(W):$(W)},20)}function U(W){G(W)&&P(W)}function k(W){var n=W.getWrapperElement(),D=G(W);n.className=n.className.replace(" CodeMirror-empty","")+(D?" CodeMirror-empty":""),D?P(W):$(W)}function G(W){return W.lineCount()===1&&W.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={},W=U.htmlMode?$:P;for(var n in W)G[n]=W[n];for(var n in U)G[n]=U[n];var D,g;function p(c,w){function v(B){return w.tokenize=B,B(c,w)}var y=c.next();if(y=="<")return c.eat("!")?c.eat("[")?c.match("CDATA[")?v(o("atom","]]>")):null:c.match("--")?v(o("comment","-->")):c.match("DOCTYPE",!0,!0)?(c.eatWhile(/[\w\._\-]/),v(f(1))):null:c.eat("?")?(c.eatWhile(/[\w\._\-]/),w.tokenize=o("meta","?>"),"meta"):(D=c.eat("/")?"closeTag":"openTag",w.tokenize=m,"tag bracket");if(y=="&"){var F;return c.eat("#")?c.eat("x")?F=c.eatWhile(/[a-fA-F\d]/)&&c.eat(";"):F=c.eatWhile(/[\d]/)&&c.eat(";"):F=c.eatWhile(/[\w\.\-:]/)&&c.eat(";"),F?"atom":"error"}else return c.eatWhile(/[^&<]/),null}p.isInText=!0;function m(c,w){var v=c.next();if(v==">"||v=="/"&&c.eat(">"))return w.tokenize=p,D=v==">"?"endTag":"selfcloseTag","tag bracket";if(v=="=")return D="equals",null;if(v=="<"){w.tokenize=p,w.state=s,w.tagName=w.tagStart=null;var y=w.tokenize(c,w);return y?y+" tag error":"tag error"}else return/[\'\"]/.test(v)?(w.tokenize=u(v),w.stringStartCol=c.column(),w.tokenize(c,w)):(c.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function u(c){var w=function(v,y){for(;!v.eol();)if(v.next()==c){y.tokenize=m;break}return"string"};return w.isInAttribute=!0,w}function o(c,w){return function(v,y){for(;!v.eol();){if(v.match(w)){y.tokenize=p;break}v.next()}return c}}function f(c){return function(w,v){for(var y;(y=w.next())!=null;){if(y=="<")return v.tokenize=f(c+1),v.tokenize(w,v);if(y==">")if(c==1){v.tokenize=p;break}else return v.tokenize=f(c-1),v.tokenize(w,v)}return"meta"}}function l(c,w,v){this.prev=c.context,this.tagName=w,this.indent=c.indented,this.startOfLine=v,(G.doNotIndent.hasOwnProperty(w)||c.context&&c.context.noIndent)&&(this.noIndent=!0)}function h(c){c.context&&(c.context=c.context.prev)}function a(c,w){for(var v;;){if(!c.context)return;if(v=c.context.tagName,!G.contextGrabbers.hasOwnProperty(v)||!G.contextGrabbers[v].hasOwnProperty(w))return;h(c)}}function s(c,w,v){return c=="openTag"?(v.tagStart=w.column(),A):c=="closeTag"?E:s}function A(c,w,v){return c=="word"?(v.tagName=w.current(),g="tag",O):G.allowMissingTagName&&c=="endTag"?(g="tag bracket",O(c,w,v)):(g="error",A)}function E(c,w,v){if(c=="word"){var y=w.current();return v.context&&v.context.tagName!=y&&G.implicitlyClosed.hasOwnProperty(v.context.tagName)&&h(v),v.context&&v.context.tagName==y||G.matchClosing===!1?(g="tag",S):(g="tag error",L)}else return G.allowMissingTagName&&c=="endTag"?(g="tag bracket",S(c,w,v)):(g="error",L)}function S(c,w,v){return c!="endTag"?(g="error",S):(h(v),s)}function L(c,w,v){return g="error",S(c,w,v)}function O(c,w,v){if(c=="word")return g="attribute",C;if(c=="endTag"||c=="selfcloseTag"){var y=v.tagName,F=v.tagStart;return v.tagName=v.tagStart=null,c=="selfcloseTag"||G.autoSelfClosers.hasOwnProperty(y)?a(v,y):(a(v,y),v.context=new l(v,y,F==v.indented)),s}return g="error",O}function C(c,w,v){return c=="equals"?T:(G.allowMissing||(g="error"),O(c,w,v))}function T(c,w,v){return c=="string"?x:c=="word"&&G.allowUnquoted?(g="string",O):(g="error",O(c,w,v))}function x(c,w,v){return c=="string"?x:O(c,w,v)}return{startState:function(c){var w={tokenize:p,state:s,indented:c||0,tagName:null,tagStart:null,context:null};return c!=null&&(w.baseIndent=c),w},token:function(c,w){if(!w.tagName&&c.sol()&&(w.indented=c.indentation()),c.eatSpace())return null;D=null;var v=w.tokenize(c,w);return(v||D)&&v!="comment"&&(g=null,w.state=w.state(D||v,c,w),g&&(v=g=="error"?v+" error":g)),v},indent:function(c,w,v){var y=c.context;if(c.tokenize.isInAttribute)return c.tagStart==c.indented?c.stringStartCol+1:c.indented+k;if(y&&y.noIndent)return re.Pass;if(c.tokenize!=m&&c.tokenize!=p)return v?v.match(/^(\s*)/)[0].length:0;if(c.tagName)return G.multilineTagIndentPastTag!==!1?c.tagStart+c.tagName.length+2:c.tagStart+k*(G.multilineTagIndentFactor||1);if(G.alignCDATA&&/<!\[CDATA\[/.test(w))return 0;var F=w&&/^<(\/)?([\w_:\.-]*)/.exec(w);if(F&&F[1])for(;y;)if(y.tagName==F[2]){y=y.prev;break}else if(G.implicitlyClosed.hasOwnProperty(y.tagName))y=y.prev;else break;else if(F)for(;y;){var B=G.contextGrabbers[y.tagName];if(B&&B.hasOwnProperty(F[2]))y=y.prev;else break}for(;y&&y.prev&&!y.startOfLine;)y=y.prev;return y?y.indent+k:c.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:G.htmlMode?"html":"xml",helperType:G.htmlMode?"html":"xml",skipAttribute:function(c){c.state==T&&(c.state=O)},xmlCurrentTag:function(c){return c.tagName?{name:c.tagName,close:c.type=="closeTag"}:null},xmlCurrentContext:function(c){for(var w=[],v=c.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 W=G[0];return typeof X[W]!="undefined"?X[W]:k}),U}function $(P,X,...U){return re(X,U)}},"55Ip":function(ht,be,Z){"use strict";Z.d(be,"a",function(){return a});var re=Z("Ty5D"),$=Z("dI71"),P=Z("q1tI"),X=Z.n(P),U=Z("YS25"),k=Z("17x9"),G=Z.n(k),W=Z("wx14"),n=Z("zLVn"),D=Z("9R94"),g=function(T){Object($.a)(x,T);function x(){for(var w,v=arguments.length,y=new Array(v),F=0;F<v;F++)y[F]=arguments[F];return w=T.call.apply(T,[this].concat(y))||this,w.history=Object(U.a)(w.props),w}var c=x.prototype;return c.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,y=new Array(v),F=0;F<v;F++)y[F]=arguments[F];return w=T.call.apply(T,[this].concat(y))||this,w.history=Object(U.b)(w.props),w}var c=x.prototype;return c.render=function(){return X.a.createElement(re.c,{history:this.history,children:this.props.children})},x}(X.a.Component),m=function(x,c){return typeof x=="function"?x(c):x},u=function(x,c){return typeof x=="string"?Object(U.c)(x,null,null,c):x},o=function(x){return x},f=X.a.forwardRef;typeof f=="undefined"&&(f=o);function l(T){return!!(T.metaKey||T.altKey||T.ctrlKey||T.shiftKey)}var h=f(function(T,x){var c=T.innerRef,w=T.navigate,v=T.onClick,y=Object(n.a)(T,["innerRef","navigate","onClick"]),F=y.target,B=Object(W.a)({},y,{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!==f?B.ref=x||c:B.ref=c,X.a.createElement("a",B)}),a=f(function(T,x){var c=T.component,w=c===void 0?h:c,v=T.replace,y=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=u(m(y,R.location),R.location),b=N?j.createHref(N):"",Y=Object(W.a)({},B,{href:b,navigate:function(){var ae=m(y,R.location),ue=v?j.replace:j.push;ue(ae)}});return o!==f?Y.ref=x||F:Y.innerRef=F,X.a.createElement(w,Y)})});if(!1)var s,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),c=0;c<T;c++)x[c]=arguments[c];return x.filter(function(w){return w}).join(" ")}var O=S(function(T,x){var c=T["aria-current"],w=c===void 0?"page":c,v=T.activeClassName,y=v===void 0?"active":v,F=T.activeStyle,B=T.className,R=T.exact,j=T.isActive,N=T.location,b=T.sensitive,Y=T.strict,ee=T.style,ae=T.to,ue=T.innerRef,Oe=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,Ae=u(m(ae,xe),xe),Re=Ae.pathname,pe=Re&&Re.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),he=pe?Object(re.f)(xe.pathname,{path:pe,exact:R,sensitive:b,strict:Y}):null,ke=!!(j?j(he,xe):he),et=ke?L(B,y):B,We=ke?Object(W.a)({},ee,{},F):ee,nt=Object(W.a)({"aria-current":ke&&w||null,className:et,style:We,to:Ae},Oe);return E!==S?nt.ref=x||ue:nt.innerRef=ue,X.a.createElement(a,nt)})});if(!1)var C},"5VLF":function(ht,be,Z){"use strict";var re,$;function P(X,U,k){var G=function(W,n){return X.js_beautify(W,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 u(o,f){var l=new p(o,f);return l.beautify()}n.exports=u,n.exports.defaultOptions=function(){return new m}},function(n,D,g){var p=g(2).Output,m=g(3).Token,u=g(4),o=g(5).Options,f=g(7).Tokenizer,l=g(7).line_starters,h=g(7).positionable_operators,a=g(7).TOKEN;function s(b,Y){return Y.indexOf(b)!==-1}function A(b){return b.replace(/^\s+/g,"")}function E(b){for(var Y={},ee=0;ee<b.length;ee++)Y[b[ee].replace(/-/g,"_")]=b[ee];return Y}function S(b,Y){return b&&b.type===a.RESERVED&&b.text===Y}function L(b,Y){return b&&b.type===a.RESERVED&&s(b.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],c={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function w(b,Y){if(Y.multiline_frame||Y.mode===c.ForInitializer||Y.mode===c.Conditional)return;b.remove_indent(Y.start_line_index)}function v(b){b=b.replace(u.allLineBreaks,`
|
|
`);for(var Y=[],ee=b.indexOf(`
|
|
`);ee!==-1;)Y.push(b.substring(0,ee)),b=b.substring(ee+1),ee=b.indexOf(`
|
|
`);return b.length&&Y.push(b),Y}function y(b){return b===c.ArrayLiteral}function F(b){return s(b,[c.Expression,c.ForInitializer,c.Conditional])}function B(b,Y){for(var ee=0;ee<b.length;ee++){var ae=b[ee].trim();if(ae.charAt(0)!==Y)return!1}return!0}function R(b,Y){for(var ee=0,ae=b.length,ue;ee<ae;ee++)if(ue=b[ee],ue&&ue.indexOf(Y)!==0)return!1;return!0}function j(b,Y){Y=Y||{},this._source_text=b||"",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(b,Y){var ee=0;b&&(ee=b.indentation_level,!this._output.just_added_newline()&&b.line_indent_level>ee&&(ee=b.line_indent_level));var ae={mode:Y,parent:b,last_token:b?b.last_token:new m(a.START_BLOCK,""),last_word:b?b.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:b?b.line_indent_level:ee,start_line_index:this._output.get_line_number(),ternary_depth:0};return ae},j.prototype._reset=function(b){var Y=b.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(c.BlockStatement);var ee=new f(b,this._options);return this._tokens=ee.tokenize(),b},j.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var b,Y=this._reset(this._source_text),ee=this._options.eol;this._options.eol==="auto"&&(ee=`
|
|
`,Y&&u.lineBreak.test(Y||"")&&(ee=Y.match(u.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 b=this._output.get_code(ee),b},j.prototype.handle_token=function(b,Y){b.type===a.START_EXPR?this.handle_start_expr(b):b.type===a.END_EXPR?this.handle_end_expr(b):b.type===a.START_BLOCK?this.handle_start_block(b):b.type===a.END_BLOCK?this.handle_end_block(b):b.type===a.WORD?this.handle_word(b):b.type===a.RESERVED?this.handle_word(b):b.type===a.SEMICOLON?this.handle_semicolon(b):b.type===a.STRING?this.handle_string(b):b.type===a.EQUALS?this.handle_equals(b):b.type===a.OPERATOR?this.handle_operator(b):b.type===a.COMMA?this.handle_comma(b):b.type===a.BLOCK_COMMENT?this.handle_block_comment(b,Y):b.type===a.COMMENT?this.handle_comment(b,Y):b.type===a.DOT?this.handle_dot(b):b.type===a.EOF?this.handle_eof(b):b.type===a.UNKNOWN?this.handle_unknown(b,Y):this.handle_unknown(b,Y)},j.prototype.handle_whitespace_and_comments=function(b,Y){var ee=b.newlines,ae=this._options.keep_array_indentation&&y(this._flags.mode);if(b.comments_before)for(var ue=b.comments_before.next();ue;)this.handle_whitespace_and_comments(ue,Y),this.handle_token(ue,Y),ue=b.comments_before.next();if(ae)for(var Oe=0;Oe<ee;Oe+=1)this.print_newline(Oe>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(b,Y){if(Y=Y===void 0?!1:Y,this._output.just_added_newline())return;var ee=this._options.preserve_newlines&&b.newlines||Y,ae=s(this._flags.last_token.text,h)||s(b.text,h);if(ae){var ue=s(this._flags.last_token.text,h)&&s(this._options.operator_position,x)||s(b.text,h);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(b,Y){if(!Y&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==a.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var ee=this._tokens.peek();this._flags.mode===c.Statement&&!(this._flags.if_block&&S(ee,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(b)&&(this._flags.multiline_frame=!0)},j.prototype.print_token_line_indentation=function(b){this._output.just_added_newline()&&(this._options.keep_array_indentation&&b.newlines&&(b.text==="["||y(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(b.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(b){if(this._output.raw){this._output.add_raw_token(b);return}if(this._options.comma_first&&b.previous&&b.previous.type===a.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(b),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(b),this._output.non_breaking_space=!0,this._output.add_token(b.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(b){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,b),this._flags=this.create_flags(this._previous_flags,b),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===c.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===c.ObjectLiteral&&this._flags.mode===c.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||L(this._flags.last_token,["get","set"]))},j.prototype.start_of_statement=function(b){var Y=!1;return Y=Y||L(this._flags.last_token,["var","let","const"])&&b.type===a.WORD,Y=Y||S(this._flags.last_token,"do"),Y=Y||!(this._flags.parent.mode===c.ObjectLiteral&&this._flags.mode===c.Statement)&&L(this._flags.last_token,N)&&!b.newlines,Y=Y||S(this._flags.last_token,"else")&&!(S(b,"if")&&!b.comments_before),Y=Y||this._flags.last_token.type===a.END_EXPR&&(this._previous_flags.mode===c.ForInitializer||this._previous_flags.mode===c.Conditional),Y=Y||this._flags.last_token.type===a.WORD&&this._flags.mode===c.BlockStatement&&!this._flags.in_case&&!(b.text==="--"||b.text==="++")&&this._last_last_text!=="function"&&b.type!==a.WORD&&b.type!==a.RESERVED,Y=Y||this._flags.mode===c.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||L(this._flags.last_token,["get","set"])),Y?(this.set_mode(c.Statement),this.indent(),this.handle_whitespace_and_comments(b,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(b,L(b,["do","for","if","while"])),!0):!1},j.prototype.handle_start_expr=function(b){this.start_of_statement(b)||this.handle_whitespace_and_comments(b);var Y=c.Expression;if(b.text==="["){if(this._flags.last_token.type===a.WORD||this._flags.last_token.text===")"){L(this._flags.last_token,l)&&(this._output.space_before_token=!0),this.print_token(b),this.set_mode(Y),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}Y=c.ArrayLiteral,y(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())),s(this._flags.last_token.type,[a.START_EXPR,a.END_EXPR,a.WORD,a.OPERATOR,a.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===a.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,Y=c.ForInitializer):s(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,Y=c.Conditional):s(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&b.whitespace_before===""?this._output.space_before_token=!1:(s(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===a.EQUALS||this._flags.last_token.type===a.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(b);else if(this._flags.last_token.type===a.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===c.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(b);(this._flags.last_token.type===a.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(s(this._last_last_text,["function","yield"])||this._flags.mode===c.ObjectLiteral&&s(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===a.START_BLOCK?this.print_newline():(this._flags.last_token.type===a.END_EXPR||this._flags.last_token.type===a.START_EXPR||this._flags.last_token.type===a.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===a.COMMA)&&this.allow_wrap_or_preserved_newline(b,b.newlines),this.print_token(b),this.set_mode(Y),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},j.prototype.handle_end_expr=function(b){for(;this._flags.mode===c.Statement;)this.restore_mode();this.handle_whitespace_and_comments(b),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(b,b.text==="]"&&y(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===a.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(b),this.restore_mode(),w(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===c.Conditional&&(this._previous_flags.mode=c.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},j.prototype.handle_start_block=function(b){this.handle_whitespace_and_comments(b);var Y=this._tokens.peek(),ee=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===a.END_EXPR?(this.set_mode(c.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(c.BlockStatement):ee&&(s(ee.text,[":",","])&&s(Y.type,[a.STRING,a.WORD,a.RESERVED])||s(Y.text,["get","set","..."])&&s(ee.type,[a.WORD,a.RESERVED]))?s(this._last_last_text,["class","interface"])&&!s(ee.text,[":",","])?this.set_mode(c.BlockStatement):this.set_mode(c.ObjectLiteral):this._flags.last_token.type===a.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(c.BlockStatement):s(this._flags.last_token.type,[a.EQUALS,a.START_EXPR,a.COMMA,a.OPERATOR])||L(this._flags.last_token,["return","throw","import","default"])?this.set_mode(c.ObjectLiteral):this.set_mode(c.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===a.END_EXPR;if(this._options.brace_preserve_inline){var Oe=0,Ee=null;this._flags.inline_frame=!0;do if(Oe+=1,Ee=this._tokens.peek(Oe-1),Ee.newlines){this._flags.inline_frame=!1;break}while(Ee.type!==a.EOF&&!(Ee.type===a.END_BLOCK&&Ee.opened===b))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&b.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==a.OPERATOR&&(ue||this._flags.last_token.type===a.EQUALS||L(this._flags.last_token,O)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(y(this._previous_flags.mode)&&(this._flags.last_token.type===a.START_EXPR||this._flags.last_token.type===a.COMMA)&&((this._flags.last_token.type===a.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===a.COMMA||this._flags.last_token.type===a.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(b),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==a.OPERATOR&&this._flags.last_token.type!==a.START_EXPR&&(this._flags.last_token.type===a.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(b),this.indent(),!ae&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},j.prototype.handle_end_block=function(b){for(this.handle_whitespace_and_comments(b);this._flags.mode===c.Statement;)this.restore_mode();var Y=this._flags.last_token.type===a.START_BLOCK;this._flags.inline_frame&&!Y?this._output.space_before_token=!0:this._options.brace_style==="expand"?Y||this.print_newline():Y||(y(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(b)},j.prototype.handle_word=function(b){if(b.type===a.RESERVED){if(s(b.text,["set","get"])&&this._flags.mode!==c.ObjectLiteral)b.type=a.WORD;else if(b.text==="import"&&s(this._tokens.peek().text,["(","."]))b.type=a.WORD;else if(s(b.text,["as","from"])&&!this._flags.import_block)b.type=a.WORD;else if(this._flags.mode===c.ObjectLiteral){var Y=this._tokens.peek();Y.text===":"&&(b.type=a.WORD)}}if(this.start_of_statement(b)?L(this._flags.last_token,["var","let","const"])&&b.type===a.WORD&&(this._flags.declaration_statement=!0):b.newlines&&!F(this._flags.mode)&&(this._flags.last_token.type!==a.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==a.EQUALS&&(this._options.preserve_newlines||!L(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(b),this.print_newline()):this.handle_whitespace_and_comments(b),this._flags.do_block&&!this._flags.do_while)if(S(b,"while")){this._output.space_before_token=!0,this.print_token(b),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(b,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===c.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&L(b,["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(b),this._flags.in_case=!0;return}if((this._flags.last_token.type===a.COMMA||this._flags.last_token.type===a.START_EXPR||this._flags.last_token.type===a.EQUALS||this._flags.last_token.type===a.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(b)),S(b,"function")){(s(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(s(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===a.OPERATOR))&&(!this._output.just_added_blankline()&&!b.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===a.RESERVED||this._flags.last_token.type===a.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===a.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(F(this._flags.mode)||y(this._flags.mode))||this.print_newline(),this.print_token(b),this._flags.last_word=b.text;return}var ee="NONE";if(this._flags.last_token.type===a.END_BLOCK?this._previous_flags.inline_frame?ee="SPACE":L(b,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&b.newlines?ee="NEWLINE":(ee="SPACE",this._output.space_before_token=!0):ee="NEWLINE":this._flags.last_token.type===a.SEMICOLON&&this._flags.mode===c.BlockStatement?ee="NEWLINE":this._flags.last_token.type===a.SEMICOLON&&F(this._flags.mode)?ee="SPACE":this._flags.last_token.type===a.STRING?ee="NEWLINE":this._flags.last_token.type===a.RESERVED||this._flags.last_token.type===a.WORD||this._flags.last_token.text==="*"&&(s(this._last_last_text,["function","yield"])||this._flags.mode===c.ObjectLiteral&&s(this._last_last_text,["{",","]))?ee="SPACE":this._flags.last_token.type===a.START_BLOCK?this._flags.inline_frame?ee="SPACE":ee="NEWLINE":this._flags.last_token.type===a.END_EXPR&&(this._output.space_before_token=!0,ee="NEWLINE"),L(b,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(b,["else","catch","finally"]))if((!(this._flags.last_token.type===a.END_BLOCK&&this._previous_flags.mode===c.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&b.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(b,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==a.END_EXPR?(this._flags.last_token.type!==a.START_EXPR||!L(b,["var","let","const"]))&&this._flags.last_token.text!==":"&&(S(b,"if")&&S(b.previous,"else")?this._output.space_before_token=!0:this.print_newline()):L(b,l)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&y(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():ee==="SPACE"&&(this._output.space_before_token=!0);b.previous&&(b.previous.type===a.WORD||b.previous.type===a.RESERVED)&&(this._output.space_before_token=!0),this.print_token(b),this._flags.last_word=b.text,b.type===a.RESERVED&&(b.text==="do"?this._flags.do_block=!0:b.text==="if"?this._flags.if_block=!0:b.text==="import"?this._flags.import_block=!0:this._flags.import_block&&S(b,"from")&&(this._flags.import_block=!1))},j.prototype.handle_semicolon=function(b){this.start_of_statement(b)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(b);for(var Y=this._tokens.peek();this._flags.mode===c.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(b)},j.prototype.handle_string=function(b){b.text.startsWith("`")&&b.newlines===0&&b.whitespace_before===""&&(b.previous.text===")"||this._flags.last_token.type===a.WORD)||(this.start_of_statement(b)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(b),this._flags.last_token.type===a.RESERVED||this._flags.last_token.type===a.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===a.COMMA||this._flags.last_token.type===a.START_EXPR||this._flags.last_token.type===a.EQUALS||this._flags.last_token.type===a.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(b):b.text.startsWith("`")&&this._flags.last_token.type===a.END_EXPR&&(b.previous.text==="]"||b.previous.text===")")&&b.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(b)},j.prototype.handle_equals=function(b){this.start_of_statement(b)||this.handle_whitespace_and_comments(b),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(b),this._output.space_before_token=!0},j.prototype.handle_comma=function(b){this.handle_whitespace_and_comments(b,!0),this.print_token(b),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(b)):this._flags.mode===c.ObjectLiteral||this._flags.mode===c.Statement&&this._flags.parent.mode===c.ObjectLiteral?(this._flags.mode===c.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(b)},j.prototype.handle_operator=function(b){var Y=b.text==="*"&&(L(this._flags.last_token,["function","yield"])||s(this._flags.last_token.type,[a.START_BLOCK,a.COMMA,a.END_BLOCK,a.SEMICOLON])),ee=s(b.text,["-","+"])&&(s(this._flags.last_token.type,[a.START_BLOCK,a.START_EXPR,a.EQUALS,a.OPERATOR])||s(this._flags.last_token.text,l)||this._flags.last_token.text===",");if(!this.start_of_statement(b)){var ae=!Y;this.handle_whitespace_and_comments(b,ae)}if(b.text==="*"&&this._flags.last_token.type===a.DOT){this.print_token(b);return}if(b.text==="::"){this.print_token(b);return}if(this._flags.last_token.type===a.OPERATOR&&s(this._options.operator_position,x)&&this.allow_wrap_or_preserved_newline(b),b.text===":"&&this._flags.in_case){this.print_token(b),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==a.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,Oe=!0,Ee=!1;if(b.text===":"?this._flags.ternary_depth===0?ue=!1:(this._flags.ternary_depth-=1,Ee=!0):b.text==="?"&&(this._flags.ternary_depth+=1),!ee&&!Y&&this._options.preserve_newlines&&s(b.text,h)){var xe=b.text===":",Ae=xe&&Ee,Re=xe&&!Ee;switch(this._options.operator_position){case T.before_newline:this._output.space_before_token=!Re,this.print_token(b),(!xe||Ae)&&this.allow_wrap_or_preserved_newline(b),this._output.space_before_token=!0;return;case T.after_newline:this._output.space_before_token=!0,!xe||Ae?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(b):this._output.space_before_token=!1,this.print_token(b),this._output.space_before_token=!0;return;case T.preserve_newline:Re||this.allow_wrap_or_preserved_newline(b),ue=!(this._output.just_added_newline()||Re),this._output.space_before_token=ue,this.print_token(b),this._output.space_before_token=!0;return}}if(Y){this.allow_wrap_or_preserved_newline(b),ue=!1;var pe=this._tokens.peek();Oe=pe&&s(pe.type,[a.WORD,a.RESERVED])}else if(b.text==="...")this.allow_wrap_or_preserved_newline(b),ue=this._flags.last_token.type===a.START_BLOCK,Oe=!1;else if(s(b.text,["--","++","!","~"])||ee){if((this._flags.last_token.type===a.COMMA||this._flags.last_token.type===a.START_EXPR)&&this.allow_wrap_or_preserved_newline(b),ue=!1,Oe=!1,b.newlines&&(b.text==="--"||b.text==="++"||b.text==="~")){var he=L(this._flags.last_token,O)&&b.newlines;he&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(he,!0)}this._flags.last_token.text===";"&&F(this._flags.mode)&&(ue=!0),this._flags.last_token.type===a.RESERVED?ue=!0:this._flags.last_token.type===a.END_EXPR?ue=!(this._flags.last_token.text==="]"&&(b.text==="--"||b.text==="++")):this._flags.last_token.type===a.OPERATOR&&(ue=s(b.text,["--","-","++","+"])&&s(this._flags.last_token.text,["--","-","++","+"]),s(b.text,["+","-"])&&s(this._flags.last_token.text,["--","++"])&&(Oe=!0)),(this._flags.mode===c.BlockStatement&&!this._flags.inline_frame||this._flags.mode===c.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(b),this._output.space_before_token=Oe},j.prototype.handle_block_comment=function(b,Y){if(this._output.raw){this._output.add_raw_token(b),b.directives&&b.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(b.directives){this.print_newline(!1,Y),this.print_token(b),b.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!u.newline.test(b.text)&&!b.newlines){this._output.space_before_token=!0,this.print_token(b),this._output.space_before_token=!0;return}else this.print_block_commment(b,Y)},j.prototype.print_block_commment=function(b,Y){var ee=v(b.text),ae,ue=!1,Oe=!1,Ee=b.whitespace_before,xe=Ee.length;if(this.print_newline(!1,Y),this.print_token_line_indentation(b),this._output.add_token(ee[0]),this.print_newline(!1,Y),ee.length>1){for(ee=ee.slice(1),ue=B(ee,"*"),Oe=R(ee,Ee),ue&&(this._flags.alignment=1),ae=0;ae<ee.length;ae++)ue?(this.print_token_line_indentation(b),this._output.add_token(A(ee[ae]))):Oe&&ee[ae]?(this.print_token_line_indentation(b),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(b,Y){b.newlines?this.print_newline(!1,Y):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(b),this.print_newline(!1,Y)},j.prototype.handle_dot=function(b){this.start_of_statement(b)||this.handle_whitespace_and_comments(b,!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(b,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(b)},j.prototype.handle_unknown=function(b,Y){this.print_token(b),b.text[b.text.length-1]===`
|
|
`&&this.print_newline(!1,Y)},j.prototype.handle_eof=function(b){for(;this._flags.mode===c.Statement;)this.restore_mode();this.handle_whitespace_and_comments(b)},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 u=this.__items.length-1;u>=0;u--)if(this.__items[u].match(m))return!0;return!1},D.prototype.set_indent=function(m,u){this.is_empty()&&(this.__indent_count=m||0,this.__alignment_count=u||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 u=m.lastIndexOf(`
|
|
`);u!==-1?this.__character_count=m.length-u: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,u){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)),u=u||"",m.indent_level>0&&(u=new Array(m.indent_level+1).join(this.__indent_string)),this.__base_string=u,this.__base_string_length=u.length}g.prototype.get_indent_size=function(m,u){var o=this.__base_string_length;return u=u||0,m<0&&(o=0),o+=m*this.__indent_size,o+=u,o},g.prototype.get_indent_string=function(m,u){var o=this.__base_string;return u=u||0,m<0&&(m=0,o=""),u+=m*this.__indent_size,this.__ensure_cache(u),o+=this.__cache[u],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,u=0,o="";this.__indent_size&&m>=this.__indent_size&&(u=Math.floor(m/this.__indent_size),m-=u*this.__indent_size,o=new Array(u+1).join(this.__indent_string)),m&&(o+=new Array(m+1).join(" ")),this.__cache.push(o)};function p(m,u){this.__indent_cache=new g(m,u),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,u){return this.__indent_cache.get_indent_string(m,u)},p.prototype.get_indent_size=function(m,u){return this.__indent_cache.get_indent_size(m,u)},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 u=this.current_line.pop();u&&(u[u.length-1]===`
|
|
`&&(u=u.replace(/\n+$/g,"")),this.current_line.push(u)),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,u){return m=m||0,u=u||0,this.next_line.set_indent(m,u),this.__lines.length>1?(this.current_line.set_indent(m,u),!0):(this.current_line.set_indent(),!1)},p.prototype.add_raw_token=function(m){for(var u=0;u<m.newlines;u++)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 u=this.__lines.length;m<u;)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,u){for(var o=this.__lines.length-2;o>=0;){var f=this.__lines[o];if(f.is_empty())break;if(f.item(0).indexOf(m)!==0&&f.item(-1)!==u){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,u){this.type=g,this.text=p,this.comments_before=null,this.newlines=m||0,this.whitespace_before=u||"",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",u="\\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+"])",f="(?:\\\\u[0-9a-fA-F]{4}|["+p+m+u+"])*";D.identifier=new RegExp(o+f,"g"),D.identifierStart=new RegExp(o),D.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+p+m+u+"])+");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 u(o){p.call(this,o,"js");var f=this.raw_options.brace_style||null;f==="expand-strict"?this.raw_options.brace_style="expand":f==="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 h=0;h<l.length;h++)l[h]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=l[h];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)}u.prototype=new p,n.exports.Options=u},function(n){function D(m,u){this.raw_options=g(m,u),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,u){var o=this.raw_options[m],f=u||[];return typeof o=="object"?o!==null&&typeof o.concat=="function"&&(f=o.concat()):typeof o=="string"&&(f=o.split(/[^a-zA-Z0-9_\/\-]+/)),f},D.prototype._get_boolean=function(m,u){var o=this.raw_options[m],f=o===void 0?!!u:!!o;return f},D.prototype._get_characters=function(m,u){var o=this.raw_options[m],f=u||"";return typeof o=="string"&&(f=o.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),f},D.prototype._get_number=function(m,u){var o=this.raw_options[m];u=parseInt(u,10),isNaN(u)&&(u=0);var f=parseInt(o,10);return isNaN(f)&&(f=u),f},D.prototype._get_selection=function(m,u,o){var f=this._get_selection_list(m,u,o);if(f.length!==1)throw new Error("Invalid Option Value: The option '"+m+`' can only be one of the following values:
|
|
`+u+`
|
|
You passed in: '`+this.raw_options[m]+"'");return f[0]},D.prototype._get_selection_list=function(m,u,o){if(!u||u.length===0)throw new Error("Selection list cannot be empty.");if(o=o||[u[0]],!this._is_valid_selection(o,u))throw new Error("Invalid Default Value!");var f=this._get_array(m,o);if(!this._is_valid_selection(f,u))throw new Error("Invalid Option Value: The option '"+m+`' can contain only the following values:
|
|
`+u+`
|
|
You passed in: '`+this.raw_options[m]+"'");return f},D.prototype._is_valid_selection=function(m,u){return m.length&&u.length&&!m.some(function(o){return u.indexOf(o)===-1})};function g(m,u){var o={};m=p(m);var f;for(f in m)f!==u&&(o[f]=m[f]);if(u&&m[u])for(f in m[u])o[f]=m[u][f];return o}function p(m){var u={},o;for(o in m){var f=o.replace(/-/g,"_");u[f]=m[o]}return u}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,u=g(9).TOKEN,o=g(13).Directives,f=g(4),l=g(12).Pattern,h=g(14).TemplatablePattern;function a(B,R){return R.indexOf(B)!==-1}var s={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:u.START,RAW:u.RAW,EOF:u.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(","),c=x.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),w=new RegExp("^(?:"+c.join("|")+")$"),v,y=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 h(this._input).read_options(this._options);this.__patterns={template:N,identifier:N.starting_with(f.identifier).matching(f.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(f.lineBreak),shebang:j.starting_with(/#!/).until_after(f.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(/[`}\\]/)}};y.prototype=new m,y.prototype._is_comment=function(B){return B.type===s.COMMENT||B.type===s.BLOCK_COMMENT||B.type===s.UNKNOWN},y.prototype._is_opening=function(B){return B.type===s.START_BLOCK||B.type===s.START_EXPR},y.prototype._is_closing=function(B,R){return(B.type===s.END_BLOCK||B.type===s.END_EXPR)&&R&&(B.text==="]"&&R.text==="["||B.text===")"&&R.text==="("||B.text==="}"&&R.text==="{")},y.prototype._reset=function(){v=!1},y.prototype._get_next_token=function(B,R){var j=null;this._readWhitespace();var N=this._input.peek();return N===null?this._create_token(s.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(s.UNKNOWN,this._input.next()),j)},y.prototype._read_word=function(B){var R;if(R=this.__patterns.identifier.read(),R!=="")return R=R.replace(f.allLineBreaks,`
|
|
`),!(B.type===s.DOT||B.type===s.RESERVED&&(B.text==="set"||B.text==="get"))&&w.test(R)?(R==="in"||R==="of")&&(B.type===s.WORD||B.type===s.STRING)?this._create_token(s.OPERATOR,R):this._create_token(s.RESERVED,R):this._create_token(s.WORD,R);if(R=this.__patterns.number.read(),R!=="")return this._create_token(s.WORD,R)},y.prototype._read_singles=function(B){var R=null;return B==="("||B==="["?R=this._create_token(s.START_EXPR,B):B===")"||B==="]"?R=this._create_token(s.END_EXPR,B):B==="{"?R=this._create_token(s.START_BLOCK,B):B==="}"?R=this._create_token(s.END_BLOCK,B):B===";"?R=this._create_token(s.SEMICOLON,B):B==="."&&L.test(this._input.peek(1))?R=this._create_token(s.DOT,B):B===","&&(R=this._create_token(s.COMMA,B)),R&&this._input.next(),R},y.prototype._read_punctuation=function(){var B=this.__patterns.punct.read();if(B!=="")return B==="="?this._create_token(s.EQUALS,B):B==="?."?this._create_token(s.DOT,B):this._create_token(s.OPERATOR,B)},y.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(s.UNKNOWN,R.trim()+`
|
|
`);if(R=this.__patterns.include.read(),R)return this._create_token(s.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(s.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(f.newline);)R+=this._input.next();return v=!0,this._create_token(s.COMMENT,R)}}else if(v&&B==="-"&&(R=this.__patterns.html_comment_end.read(),R))return v=!1,this._create_token(s.COMMENT,R);return null},y.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(f.allLineBreaks,`
|
|
`),R=this._create_token(s.BLOCK_COMMENT,j),R.directives=N}else this._input.peek(1)==="/"&&(j=this.__patterns.comment.read(),R=this._create_token(s.COMMENT,j))}return R},y.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(f.allLineBreaks,`
|
|
`),this._create_token(s.STRING,R)}return null},y.prototype._allow_regexp_or_xml=function(B){return B.type===s.RESERVED&&a(B.text,["return","case","throw","else","do","typeof","yield"])||B.type===s.END_EXPR&&B.text===")"&&B.opened.previous.type===s.RESERVED&&a(B.opened.previous.text,["if","while","for"])||a(B.type,[s.COMMENT,s.START_EXPR,s.START_BLOCK,s.START,s.END_BLOCK,s.OPERATOR,s.EQUALS,s.EOF,s.SEMICOLON,s.COMMA])},y.prototype._read_regexp=function(B,R){if(B==="/"&&this._allow_regexp_or_xml(R)){for(var j=this._input.next(),N=!1,b=!1;this._input.hasNext()&&(N||b||this._input.peek()!==B)&&!this._input.testChar(f.newline);)j+=this._input.peek(),N?N=!1:(N=this._input.peek()==="\\",this._input.peek()==="["?b=!0:this._input.peek()==="]"&&(b=!1)),this._input.next();return this._input.peek()===B&&(j+=this._input.next(),j+=this._input.read(f.identifier)),this._create_token(s.STRING,j)}return null},y.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 b=N[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),Y=b.indexOf("{")===0,ee=0;N;){var ae=!!N[1],ue=N[2],Oe=!!N[N.length-1]||ue.slice(0,8)==="![CDATA[";if(!Oe&&(ue===b||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(f.allLineBreaks,`
|
|
`),this._create_token(s.STRING,j)}}return null};function F(B){for(var R="",j=0,N=new p(B),b=null;N.hasNext();)if(b=N.match(/([\s]|[^\\]|\\\\)+/g),b&&(R+=b[0]),N.peek()==="\\"){if(N.next(),N.peek()==="x")b=N.match(/x([0-9A-Fa-f]{2})/g);else if(N.peek()==="u")b=N.match(/u([0-9A-Fa-f]{4})/g);else{R+="\\",N.hasNext()&&(R+=N.next());continue}if(!b)return B;if(j=parseInt(b[1],16),j>126&&j<=255&&b[0].indexOf("x")===0)return B;if(j>=0&&j<32){R+="\\"+b[0];continue}else j===34||j===39||j===92?R+="\\"+String.fromCharCode(j):R+=String.fromCharCode(j)}return R}y.prototype._read_string_recursive=function(B,R,j){var N,b;B==="'"?b=this.__patterns.single_quote:B==='"'?b=this.__patterns.double_quote:B==="`"?b=this.__patterns.template_text:B==="}"&&(b=this.__patterns.template_expression);for(var Y=b.read(),ee="";this._input.hasNext();){if(ee=this._input.next(),ee===B||!R&&f.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+=b.read(),Y+=ee}return Y},n.exports.Tokenizer=y,n.exports.TOKEN=s,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 u=p.exec(this.__input);return u&&!(D&&p.sticky)&&(u.index!==m&&(u=null)),u},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 u=this.peek(m);return p.lastIndex=0,u!==null&&p.test(u)},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,u){var o="",f;return p&&(f=this.match(p),f&&(o+=f[0])),m&&(f||!p)&&(o+=this.readUntil(m,u)),o},g.prototype.readUntil=function(p,m){var u="",o=this.__position;p.lastIndex=this.__position;var f=p.exec(this.__input);return f?(o=f.index,m&&(o+=f[0].length)):o=this.__input_length,u=this.__input.substring(this.__position,o),this.__position=o,u},g.prototype.readUntilAfter=function(p){return this.readUntil(p,!0)},g.prototype.get_regexp=function(p,m){var u=null,o="g";return m&&D&&(o="y"),typeof p=="string"&&p!==""?u=new RegExp(p,o):p&&(u=new RegExp(p.source,o)),u},g.prototype.get_literal_regexp=function(p){return RegExp(p.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},g.prototype.peekUntilAfter=function(p){var m=this.__position,u=this.readUntilAfter(p);return this.__position=m,u},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,u=g(10).TokenStream,o=g(11).WhitespacePattern,f={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},l=function(h,a){this._input=new p(h),this._options=a||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new o(this._input)};l.prototype.tokenize=function(){this._input.restart(),this.__tokens=new u,this._reset();for(var h,a=new m(f.START,""),s=null,A=[],E=new u;a.type!==f.EOF;){for(h=this._get_next_token(a,s);this._is_comment(h);)E.add(h),h=this._get_next_token(a,s);E.isEmpty()||(h.comments_before=E,E=new u),h.parent=s,this._is_opening(h)?(A.push(s),s=h):s&&this._is_closing(h,s)&&(h.opened=s,s.closed=h,s=A.pop(),h.parent=s),h.previous=a,a.next=h,this.__tokens.add(h),a=h}return this.__tokens},l.prototype._is_first_token=function(){return this.__tokens.isEmpty()},l.prototype._reset=function(){},l.prototype._get_next_token=function(h,a){this._readWhitespace();var s=this._input.read(/.+/g);return s?this._create_token(f.RAW,s):this._create_token(f.EOF,"")},l.prototype._is_comment=function(h){return!1},l.prototype._is_opening=function(h){return!1},l.prototype._is_closing=function(h,a){return!1},l.prototype._create_token=function(h,a){var s=new m(h,a,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return s},l.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},n.exports.Tokenizer=l,n.exports.TOKEN=f},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(u,o){p.call(this,u,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(u,o){u+="\\t ",o+="\\n\\r",this._match_pattern=this._input.get_regexp("["+u+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 u=this._input.read(this._match_pattern);if(u===" ")this.whitespace_before_token=" ";else if(u){var o=this.__split(this._newline_regexp,u);this.newline_count=o.length-1,this.whitespace_before_token=o[this.newline_count]}return u},m.prototype.matching=function(u,o){var f=this._create();return f.__set_whitespace_patterns(u,o),f._update(),f},m.prototype._create=function(){return new m(this._input,this)},m.prototype.__split=function(u,o){u.lastIndex=0;for(var f=0,l=[],h=u.exec(o);h;)l.push(o.substring(f,h.index)),f=h.index+h[0].length,h=u.exec(o);return f<o.length?l.push(o.substring(f,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 u(o,f){p.call(this,o,f),this.__template_pattern=null,this._disabled=Object.assign({},m),this._excluded=Object.assign({},m),f&&(this.__template_pattern=this._input.get_regexp(f.__template_pattern),this._excluded=Object.assign(this._excluded,f._excluded),this._disabled=Object.assign(this._disabled,f._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}/)}}u.prototype=new p,u.prototype._create=function(){return new u(this._input,this)},u.prototype._update=function(){this.__set_templated_pattern()},u.prototype.disable=function(o){var f=this._create();return f._disabled[o]=!0,f._update(),f},u.prototype.read_options=function(o){var f=this._create();for(var l in m)f._disabled[l]=o.templating.indexOf(l)===-1;return f._update(),f},u.prototype.exclude=function(o){var f=this._create();return f._excluded[o]=!0,f._update(),f},u.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 f=this._read_template();f;)this._match_pattern?f+=this._input.read(this._match_pattern):f+=this._input.readUntil(this.__template_pattern),o+=f,f=this._read_template();return this._until_after&&(o+=this._input.readUntilAfter(this._until_pattern)),o},u.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("|")+")")},u.prototype._read_template=function(){var o="",f=this._input.peek();if(f==="<"){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 f==="{"&&(!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=u}],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 W=G(0);P=W})();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 W}),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 f}),Z.d(be,"p",function(){return l}),Z.d(be,"b",function(){return h});function re(a){return Array.isArray(a)}function $(a){return typeof a=="string"}function P(a){return typeof a=="object"&&a!==null&&!Array.isArray(a)&&!(a instanceof RegExp)&&!(a instanceof Date)}function X(a){return typeof a=="number"&&!isNaN(a)}function U(a){return a===!0||a===!1}function k(a){return typeof a=="undefined"}function G(a){return!W(a)}function W(a){return k(a)||a===null}function n(a,s){if(!a)throw new Error(s?`Unexpected type, expected '${s}'`:"Unexpected type")}function D(a){if(W(a))throw new Error("Assertion Failed: argument is undefined or null");return a}function g(a){return typeof a=="function"}function p(a,s){const A=Math.min(a.length,s.length);for(let E=0;E<A;E++)m(a[E],s[E])}function m(a,s){if($(s)){if(typeof a!==s)throw new Error(`argument does not match constraint: typeof ${s}`)}else if(g(s)){try{if(a instanceof s)return}catch(A){}if(!W(a)&&a.constructor===s)return;if(s.length===1&&s.call(void 0,a)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function u(a){let s=[],A=Object.getPrototypeOf(a);for(;Object.prototype!==A;)s=s.concat(Object.getOwnPropertyNames(A)),A=Object.getPrototypeOf(A);return s}function o(a){const s=[];for(const A of u(a))typeof a[A]=="function"&&s.push(A);return s}function f(a,s){const A=S=>function(){const L=Array.prototype.slice.call(arguments,0);return s(S,L)};let E={};for(const S of a)E[S]=A(S);return E}function l(a){return a===null?void 0:a}function h(a,s="Unreachable"){throw new Error(s)}},"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=[],W=0;W<256;++W)G.push((W+256).toString(16).substr(1));function n(m){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=(G[m[u+0]]+G[m[u+1]]+G[m[u+2]]+G[m[u+3]]+"-"+G[m[u+4]]+G[m[u+5]]+"-"+G[m[u+6]]+G[m[u+7]]+"-"+G[m[u+8]]+G[m[u+9]]+"-"+G[m[u+10]]+G[m[u+11]]+G[m[u+12]]+G[m[u+13]]+G[m[u+14]]+G[m[u+15]]).toLowerCase();if(!k(o))throw TypeError("Stringified UUID is invalid");return o}var D=n;function g(m,u,o){m=m||{};var f=m.random||(m.rng||P)();if(f[6]=f[6]&15|64,f[8]=f[8]&63|128,u){o=o||0;for(var l=0;l<16;++l)u[o+l]=f[l];return u}return D(f)}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"),W=Z("OaEy"),n=Z("2fM7"),D=Z("q1tI"),g=Z.n(D),p=Z("VrN/"),m=Z.n(p),u=Z("p77/"),o=Z.n(u),f=Z("c5Ni"),l=Z.n(f),h=n.a.Option,a={labelCol:{span:4},wrapperCol:{span:20}},s={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};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 c(v){x(s[v][1])}function w(v){S(v)}return g.a.createElement(k.a,Object($.a)({},a,{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:c},Object.keys(s).map(function(v){return g.a.createElement(h,{key:v,value:v},s[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)(),c=Object(D.useState)(),w=Object(G.a)(c,2),v=w[0],y=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));y(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("."),W=G>-1&&X.substring(G+1,X.length);if(W)return re.findModeByExtension(W)},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 W}),Z.d(be,"c",function(){return n});var re=Z("MI8n"),$=Z("pmY6"),P=Z("3/fG"),X=function(D,g,p,m){function u(o){return o instanceof p?o:new p(function(f){f(o)})}return new(p||(p=Promise))(function(o,f){function l(s){try{a(m.next(s))}catch(A){f(A)}}function h(s){try{a(m.throw(s))}catch(A){f(A)}}function a(s){s.done?o(s.value):u(s.value).then(l,h)}a((m=m.apply(D,g||[])).next())})};class U extends $.a{constructor(D,g="",p="",m=!0,u){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=u}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 W{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"),W=Z("WmNS"),n=Z.n(W),D=Z("q1tI"),g=Z.n(D),p=Z("vg9a"),m=Z("DlQD"),u=Z.n(m),o=Z("rUJ1");function f(V,_){var I=V.match(/^(\s+)(?:```)/);if(I===null)return _;var H=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>=H.length?q.slice(H.length):q}).join(`
|
|
`)}var l=[],h=["<ul>"],a=new u.a.Renderer,s=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function A(){l.length=0,h=["<ul>"]}var E={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function S(V,_,I,H){if(_>=V.length||V[_].level<=I)return _;var q=V[_];H.push("<li><a href='#"+q.anchor+"'>"+q.text+"</a>"),_++;var z=[];return _=S(V,_,q.level,z),z.length>0&&(H.push("<ul>"),z.forEach(function(ge){H.push(ge)}),H.push("</ul>")),H.push("</li>"),_=S(V,_,I,H),_}function L(){return S(l,0,0,h),h.push("</ul>"),h.join("")}var O={heading:function(_){var I=s.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 H=I[0],q=f(H,I[3]||""),z=I[2]?I[2].trim():I[2];if(["latex","katex","math"].indexOf(z)>=0){var ge=x(),He=q;q=ge,c[ge]={type:"block",expression:He}}return{type:"code",raw:H,lang:z,text:q}}}},C=/(?:\${2})([^\n`]+?)(?:\${2})/gi,T=0,x=function(){return"__special_katext_id_".concat(T++,"__")},c={};function w(){return c}function v(){T=0,c={}}function y(V){return V=V.replace(C,function(_,I){var H=x();return c[H]={type:"inline",expression:I},H}),V}var F=a.listitem;a.listitem=function(V){return F(y(V))};var B=a.paragraph;a.paragraph=function(V){return B(y(V))};var R=a.tablecell;a.tablecell=function(V,_){return R(y(V),_)},a.code=function(V,_,I){var H=(_||"").match(/\S*/)[0];return H?["latex","katex","math"].indexOf(H)>=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>"},a.heading=function(V,_,I){var H=this.options.headerPrefix+I.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return l.push({anchor:H,level:_,text:V}),"<h"+_+' id="'+H+'">'+V+"</h"+_+">"},u.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),u.a.use({tokenizer:O,renderer:a});var j=u.a,N=Z("SJMd"),b=Z("ulZh"),Y=Z.n(b),ee=Z("m3rI"),ae=Z("Oy/b"),ue=Z("p5ED"),Oe=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,H){I.__proto__=H}||function(I,H){for(var q in H)Object.prototype.hasOwnProperty.call(H,q)&&(I[q]=H[q])})(V,_)};function xe(V,_){function I(){this.constructor=V}Ee(V,_),V.prototype=_===null?Object.create(_):(I.prototype=_.prototype,new I)}function Ae(V,_,I,H){return new(I||(I=Promise))(function(q,z){function ge(gt){try{rt(H.next(gt))}catch(ze){z(ze)}}function He(gt){try{rt(H.throw(gt))}catch(ze){z(ze)}}function rt(gt){var ze;gt.done?q(gt.value):(ze=gt.value,ze instanceof I?ze:new I(function(wt){wt(ze)})).then(ge,He)}rt((H=H.apply(V,_||[])).next())})}function Re(V,_){var I,H,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(rt){return function(gt){return function(ze){if(I)throw new TypeError("Generator is already executing.");for(;ge;)try{if(I=1,H&&(q=2&ze[0]?H.return:ze[0]?H.throw||((q=H.return)&&q.call(H),0):H.next)&&!(q=q.call(H,ze[1])).done)return q;switch(H=0,q&&(ze=[2&ze[0],q.value]),ze[0]){case 0:case 1:q=ze;break;case 4:return ge.label++,{value:ze[1],done:!1};case 5:ge.label++,H=ze[1],ze=[0];continue;case 7:ze=ge.ops.pop(),ge.trys.pop();continue;default:if(!(q=ge.trys,(q=q.length>0&&q[q.length-1])||ze[0]!==6&&ze[0]!==2)){ge=0;continue}if(ze[0]===3&&(!q||ze[1]>q[0]&&ze[1]<q[3])){ge.label=ze[1];break}if(ze[0]===6&&ge.label<q[1]){ge.label=q[1],q=ze;break}if(q&&ge.label<q[2]){ge.label=q[2],ge.ops.push(ze);break}q[2]&&ge.ops.pop(),ge.trys.pop();continue}ze=_.call(V,ge)}catch(wt){ze=[6,wt],H=0}finally{I=q=0}if(5&ze[0])throw ze[1];return{value:ze[0]?ze[1]:void 0,done:!0}}([rt,gt])}}}function pe(){for(var V=0,_=0,I=arguments.length;_<I;_++)V+=arguments[_].length;var H=Array(V),q=0;for(_=0;_<I;_++)for(var z=arguments[_],ge=0,He=z.length;ge<He;ge++,q++)H[q]=z[ge];return H}var he=function(){function V(){}return V.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},V.setAttributes=function(_,I){for(var H=0,q=I;H<q.length;H++){var z=q[H],ge=z[0],He=z[1];_.setAttribute(ge,He)}},V.createRect=function(_,I,H){var q=document.createElementNS("http://www.w3.org/2000/svg","rect");return q.setAttribute("width",_.toString()),q.setAttribute("height",I.toString()),H&&V.setAttributes(q,H),q},V.createLine=function(_,I,H,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",H.toString()),ge.setAttribute("y2",q.toString()),z&&V.setAttributes(ge,z),ge},V.createPolygon=function(_,I){var H=document.createElementNS("http://www.w3.org/2000/svg","polygon");return H.setAttribute("points",_),I&&V.setAttributes(H,I),H},V.createCircle=function(_,I){var H=document.createElementNS("http://www.w3.org/2000/svg","circle");return H.setAttribute("cx",(_/2).toString()),H.setAttribute("cy",(_/2).toString()),H.setAttribute("r",_.toString()),I&&V.setAttributes(H,I),H},V.createEllipse=function(_,I,H){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()),H&&V.setAttributes(q,H),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,H,q,z,ge,He){var rt=document.createElementNS("http://www.w3.org/2000/svg","marker");return V.setAttributes(rt,[["id",_],["orient",I],["markerWidth",H.toString()],["markerHeight",q.toString()],["refX",z.toString()],["refY",ge.toString()]]),rt.appendChild(He),rt},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 H=document.createElementNS("http://www.w3.org/2000/svg","tspan");return H.textContent=_,I&&V.setAttributes(H,I),H},V.createImage=function(_){var I=document.createElementNS("http://www.w3.org/2000/svg","image");return _&&V.setAttributes(I,_),I},V.createPoint=function(_,I){var H=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return H.x=_,H.y=I,H},V.createPath=function(_,I){var H=document.createElementNS("http://www.w3.org/2000/svg","path");return H.setAttribute("d",_),I&&V.setAttributes(H,I),H},V}(),ke=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}(),et=function(){function V(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return V.prototype.rasterize=function(_,I,H){var q=this;return new Promise(function(z){var ge=H!==void 0?H: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 rt=He.outerHTML,gt=ge.getContext("2d");q.markersOnly!==!0&>.drawImage(_,0,0,ge.width,ge.height);var ze=window.URL,wt=new Image(ge.width,ge.height);wt.setAttribute("crossOrigin","anonymous");var zt=new Blob([rt],{type:"image/svg+xml"}),en=ze.createObjectURL(zt);wt.onload=function(){gt.drawImage(wt,0,0),ze.revokeObjectURL(en);var Wn=ge.toDataURL(q.imageType,q.imageQuality);z(Wn)},wt.src=en})},V}(),We=function(){},nt=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 at("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new at("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new at("@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}(),at=function(V,_){this.selector=V,this.style=_},Pe=function(V,_){this.localName=V,this.style=_},je=function(){function V(_,I,H,q,z){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=_,this.displayMode=I,this.markerItems=H,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 H=document.createElement("div");H.className=this.toolbarBlockStyleClass.name,H.style.whiteSpace="nowrap",this.uiContainer.appendChild(H),this.addActionButton(H,'<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(H,'<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(H,'<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(H,'<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(H,'<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(H,'<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(H,'<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(H,'<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,H){var q=this,z=document.createElement("div");switch(z.className=""+this.toolbarButtonStyleClass.name,z.innerHTML=I,z.setAttribute("data-action",H),z.addEventListener("click",function(){q.actionToolbarButtonClicked(z,H)}),H){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 at("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new at("."+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(H){return H("marker",I)}),this.markerButtonOverflowBlock.style.display="none"},V.prototype.actionToolbarButtonClicked=function(_,I){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(H){return H("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(H){return H.getAttribute("data-type-name")===_});I&&this.setActiveButton(I)},V.prototype.setCurrentMarker=function(_){var I=this;this.currentMarker=_,this.buttons.filter(function(H){return/delete|notes/.test(H.getAttribute("data-action"))}).forEach(function(H){I.currentMarker===void 0?(H.style.fillOpacity="0.4",H.style.pointerEvents="none"):(H.style.fillOpacity="1",H.style.pointerEvents="all")})},V}(),$e=function(){function V(_,I,H,q){this.panels=[],this.panelButtons=[],this.markerjsContainer=_,this.displayMode=I,this.uiStyleSettings=H,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 at("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new at("."+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,H,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+" "+((H=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&H!==void 0?H: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,H=-1;if(_!==this.activePanel){H=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,rt;z.className=I.toolboxButtonStyleClass.name+" "+(ge===H?""+((He=I.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&He!==void 0?He:I.toolboxActiveButtonStyleColorsClass.name):""+((rt=I.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&rt!==void 0?rt:I.toolboxButtonStyleColorsClass.name))})},V}(),se=function(V,_){this.title=V,this.icon=_},_e=function(V){function _(I,H,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=H,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,H=document.createElement("div");return H.style.overflow="hidden",H.style.whiteSpace="nowrap",this.colors.forEach(function(q){var z=I.getColorBox(q);H.appendChild(z),I.colorBoxes.push(z)}),H},_.prototype.getColorBox=function(I){var H=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(){H.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,H){var q=this;this.currentColor=I,this.colorBoxes.forEach(function(z){z.style.borderColor=z===H?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(I)},_}(se),Te=function(){function V(_,I,H){this._state="new",this._isSelected=!1,this._container=_,this._overlayContainer=I,this.globalSettings=H,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}(),Se=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}(),Ge=function(){function V(){this.GRIP_SIZE=10,this.visual=he.createGroup(),this.visual.appendChild(he.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(he.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}(),Ne=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}(),Fe=function(V){function _(I,H,q){var z=V.call(this,I,H,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(he.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 H=he.createTransform();this._visual.transform.baseVal.appendItem(H)},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,H){V.prototype.pointerDown.call(this,I,H),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(H),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(H)){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 H=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",H==="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 H=this.unrotatePoint(I);this.state==="creating"?this.resize(I):this.state==="move"?(this.left=this.manipulationStartLeft+(H.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(H.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(H):this.state==="rotate"&&this.rotate(I)},_.prototype.resize=function(I){var H=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:H=this.manipulationStartLeft+I.x-this.manipulationStartX,q=this.manipulationStartWidth+this.manipulationStartLeft-H;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=H,this.width=q):(this.left=H+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 H=Math.sign(I.x-this.centerX);this.rotationAngle=180*Math.atan((I.y-this.centerY)/(I.x-this.centerX))/Math.PI+90*H,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 H=this.container.getCTM(),q=he.createPoint(I.x,I.y);return{x:(q=q.matrixTransform(H)).x,y:q.y}},_.prototype.unrotatePoint=function(I){if(this.rotationAngle===0)return I;var H=this.container.getCTM();H=H.inverse();var q=he.createPoint(I.x,I.y);return{x:(q=q.matrixTransform(H)).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=he.createGroup();var I=he.createTransform();I.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(I),this.container.appendChild(this.controlBox),this.controlRect=he.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=he.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 Se,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 Ge;return I.visual.transform.baseVal.appendItem(he.createTransform()),this.controlBox.appendChild(I.visual),I},_.prototype.positionGrips=function(){var I=this.controlGrips.topLeft.GRIP_SIZE,H=-I/2,q=H,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,rt=this.width+this.CB_DISTANCE-I/2;this.positionGrip(this.controlGrips.topLeft.visual,H,q),this.positionGrip(this.controlGrips.topCenter.visual,z,q),this.positionGrip(this.controlGrips.topRight.visual,rt,q),this.positionGrip(this.controlGrips.centerLeft.visual,H,ge),this.positionGrip(this.controlGrips.centerRight.visual,rt,ge),this.positionGrip(this.controlGrips.bottomLeft.visual,H,He),this.positionGrip(this.controlGrips.bottomCenter.visual,z,He),this.positionGrip(this.controlGrips.bottomRight.visual,rt,He),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,z,q-3*this.CB_DISTANCE)},_.prototype.positionGrip=function(I,H,q){var z=I.transform.baseVal.getItem(0);z.setTranslate(H,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:Ne.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:Ne.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},V.prototype.getState.call(this))},_.prototype.restoreState=function(I){V.prototype.restoreState.call(this,I);var H=I;this.left=H.left,this.top=H.top,this.width=H.width,this.height=H.height,this.rotationAngle=H.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(Ne.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,H.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(Ne.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,H.containerTransformMatrix))},_.prototype.scale=function(I,H){V.prototype.scale.call(this,I,H);var q=this.rotatePoint({x:this.left,y:this.top}),z=this.unrotatePoint({x:q.x*I,y:q.y*H});this.left=z.x,this.top=z.y,this.width=this.width*I,this.height=this.height*H,this.adjustControlBox()},_}(Te),Ke=function(V){function _(I,H,q){var z=V.call(this,I,H,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=he.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,H){V.prototype.pointerDown.call(this,I,H),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),he.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&&he.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(I),this.stateChanged()},_.prototype.setFillColor=function(I){this.fillColor=I,this.visual&&he.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},_.prototype.setStrokeWidth=function(I){this.strokeWidth=I,this.visual&&he.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},_.prototype.setStrokeDasharray=function(I){this.strokeDasharray=I,this.visual&&he.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 H=I;this.fillColor=H.fillColor,this.strokeColor=H.strokeColor,this.strokeWidth=H.strokeWidth,this.strokeDasharray=H.strokeDasharray,this.opacity=H.opacity,this.createVisual(),V.prototype.restoreState.call(this,I),this.setSize()},_.prototype.scale=function(I,H){V.prototype.scale.call(this,I,H),this.setSize()},_.title="Rectangle marker",_}(Fe),Je=function(V){function _(I,H,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=H,ge.currentWidth=q,ge.setCurrentWidth=ge.setCurrentWidth.bind(ge),ge}return xe(_,V),_.prototype.getUi=function(){var I=this,H=document.createElement("div");return H.style.display="flex",H.style.overflow="hidden",H.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)}),H.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 rt=document.createElement("hr");rt.style.minWidth="20px",rt.style.border="0px",rt.style.borderTop=q+"px solid "+I.uiStyleSettings.toolboxColor,rt.style.flexGrow="2",He.appendChild(rt),z.appendChild(He),I.widthBoxes.push(z)}),H},_.prototype.setCurrentWidth=function(I,H){var q=this;this.currentWidth=I,this.widthBoxes.forEach(function(z){z.style.borderColor=z===H?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},_}(se),Ve=function(V){function _(I,H,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=H,ge.currentStyle=q,ge.setCurrentStyle=ge.setCurrentStyle.bind(ge),ge}return xe(_,V),_.prototype.getUi=function(){var I=this,H=document.createElement("div");return H.style.display="flex",H.style.overflow="hidden",H.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)}),H.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)}),H},_.prototype.setCurrentStyle=function(I,H){var q=this;this.currentStyle=I,this.styleBoxes.forEach(function(z){z.style.borderColor=z===H?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},_}(se),tt=function(V){function _(I,H,q){var z=V.call(this,I,H,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 Je("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),z.strokeWidthPanel.onWidthChanged=z.setStrokeWidth,z.strokeStylePanel=new Ve("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>',_}(Ke),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},it=function(V){function _(I,H,q){var z=V.call(this,I,H,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,H){V.prototype.pointerDown.call(this,I,H),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(H)?this.activeGrip=this.grip1:this.grip2.ownsTarget(H)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},_.prototype.pointerUp=function(I){var H=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",H==="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=he.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 Ge;return I.visual.transform.baseVal.appendItem(he.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,H,q){var z=I.transform.baseVal.getItem(0);z.setTranslate(H,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 H=I;this.x1=H.x1,this.y1=H.y1,this.x2=H.x2,this.y2=H.y2},_.prototype.scale=function(I,H){V.prototype.scale.call(this,I,H),this.x1=this.x1*I,this.y1=this.y1*H,this.x2=this.x2*I,this.y2=this.y2*H,this.adjustVisual(),this.adjustControlBox()},_}(Te),st=function(V){function _(I,H,q){var z=V.call(this,I,H,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 Je("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),z.strokeWidthPanel.onWidthChanged=z.setStrokeWidth,z.strokeStylePanel=new Ve("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=he.createGroup(),this.selectorLine=he.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=he.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,H){V.prototype.pointerDown.call(this,I,H),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()),he.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),he.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),he.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 H=I;this.strokeColor=H.strokeColor,this.strokeWidth=H.strokeWidth,this.strokeDasharray=H.strokeDasharray,this.createVisual(),this.adjustVisual()},_.typeName="LineMarker",_.title="Line marker",_.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',_}(it),De=function(V){function _(I,H,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=H,ge.currentFont=q,ge.setCurrentFont=ge.setCurrentFont.bind(ge),ge}return xe(_,V),_.prototype.getUi=function(){var I=this,H=document.createElement("div");return H.style.overflow="hidden",H.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)}),H.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)}),H},_.prototype.setCurrentFont=function(I,H){var q=this;this.currentFont=I,this.fontBoxes.forEach(function(z){z.style.borderColor=z===H?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},_}(se),Me=function(V){function _(I,H,q){var z=V.call(this,I,H,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 H=!1;return this.textElement.childNodes.forEach(function(q){q===I&&(H=!0)}),H},_.prototype.createVisual=function(){this.visual=he.createGroup(),this.bgRectangle=he.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=he.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(he.createTransform()),this.textElement.transform.baseVal.appendItem(he.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},_.prototype.pointerDown=function(I,H){V.prototype.pointerDown.call(this,I,H),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(H){I.textElement.appendChild(he.createTSpan(H.trim()===""?" ":H.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},_.prototype.getTextScale=function(){var I=this.textElement.getBBox(),H=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;H=Math.min(q,z)}return H},_.prototype.getTextPosition=function(I){var H=this.textElement.getBBox(),q=0,z=0;return H.width>0&&H.height>0&&(q=(this.width-H.width*I)/2,z=this.height/2-H.height*I/2),{x:q,y:z}},_.prototype.sizeText=function(){var I=this.textElement.getBBox(),H=this.getTextScale(),q=this.getTextPosition(H);q.y-=I.y*H,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+q.x+"px, "+q.y+"px) scale("+H+", "+H+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(q.x,q.y),this.textElement.transform.baseVal.getItem(1).setScale(H,H))},_.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&&(he.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),he.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},_.prototype.pointerUp=function(I){var H=this.state;H==="creating"&&(this._suppressMarkerCreateEvent=!0),V.prototype.pointerUp.call(this,I),this.setSize(),(H==="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(H){H.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var H=Number.parseFloat(I.textEditor.style.fontSize);I.textEditor.clientWidth>=Number.parseInt(I.textEditor.style.maxWidth)&&H>.9;)H-=.1,I.textEditor.style.fontSize=Math.max(H,.9)+"em"}),this.textEditor.addEventListener("keyup",function(H){H.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(H){if(H.clipboardData){var q=H.clipboardData.getData("text"),z=window.getSelection();if(!z.rangeCount)return!1;z.deleteFromDocument(),z.getRangeAt(0).insertNode(document.createTextNode(q)),H.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(),H=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};H.x-=z.x/2,H.y-=z.y/2,this.textEditor.style.top=H.y+"px",this.textEditor.style.left=H.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-H.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,H){V.prototype.dblClick.call(this,I,H),this.showTextEditor()},_.prototype.setColor=function(I){this.textElement&&he.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&&he.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 H=I;this.color=H.color,this.fontFamily=H.fontFamily,this.padding=H.padding,this.text=H.text,this.createVisual(),V.prototype.restoreState.call(this,I),this.setSize()},_.prototype.scale=function(I,H){V.prototype.scale.call(this,I,H),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>',_}(Fe),ve=function(V){function _(I,H,q){var z=V.call(this,I,H,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 Je("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=he.createGroup(),this.drawingImage=he.createImage(),this.visual.appendChild(this.drawingImage);var I=he.createTransform();this.visual.transform.baseVal.appendItem(I),this.addMarkerVisualToContainer(this.visual)},_.prototype.pointerDown=function(I,H){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,H)},_.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),he.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),he.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),H=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],q=H[0],z=H[1],ge=H[2],He=H[3],rt=!1,gt=0;gt<this.canvasElement.height;gt++)for(var ze=0;ze<this.canvasElement.width;ze++)I.data[gt*this.canvasElement.width*4+4*ze+3]>0&&(rt=!0,gt<z&&(z=gt),ze<q&&(q=ze),gt>He&&(He=gt),ze>ge&&(ge=ze));if(rt){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(){he.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),he.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,H){V.prototype.scale.call(this,I,H),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>',_}(Fe),ce=function(V){function _(I,H,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=H,z.setCurrentType=z.setCurrentType.bind(z),z}return xe(_,V),_.prototype.getUi=function(){var I=this,H=document.createElement("div");H.style.display="flex",H.style.overflow="hidden",H.style.flexGrow="2";for(var q=function(He){var rt="both";switch(He){case 0:rt="both";break;case 1:rt="start";break;case 2:rt="end";break;case 3:rt="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=rt===z.currentType?z.uiStyleSettings.toolboxAccentColor:"transparent",gt.addEventListener("click",function(){I.setCurrentType(rt,gt)}),H.appendChild(gt),rt==="both"||rt==="start"){var ze=document.createElement("div");ze.style.display="flex",ze.style.alignItems="center",ze.style.minHeight="20px",ze.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>`,ze.style.marginLeft="5px",gt.appendChild(ze)}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),rt==="both"||rt==="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 H},_.prototype.setCurrentType=function(I,H){var q=this;this.currentType=I,this.typeBoxes.forEach(function(z){z.style.borderColor=z===H?q.uiStyleSettings!==void 0?q.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},_}(se),fe=function(V){function _(I,H,q){var z=V.call(this,I,H,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,H){var q=this.arrowBaseWidth+2*this.strokeWidth,z=this.arrowBaseHeight+2*this.strokeWidth;return I-q/2+","+(H+z/2)+" "+I+","+(H-z/2)+" "+(I+q/2)+","+(H+z/2)},_.prototype.createTips=function(){this.arrow1=he.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(he.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=he.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(he.createTransform()),this.visual.appendChild(this.arrow2)},_.prototype.pointerDown=function(I,H){V.prototype.pointerDown.call(this,I,H),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",he.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),he.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),H=this.arrow1.transform.baseVal.getItem(0);H.setRotate(I,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(H,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 H=I;this.arrowType=H.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>',_}(st),ie=function(V){function _(I,H,q){var z=V.call(this,I,H,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>',_}(Ke),ne=function(V){function _(I,H,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=H,ge.currentOpacity=q,ge.setCurrentOpacity=ge.setCurrentOpacity.bind(ge),ge}return xe(_,V),_.prototype.getUi=function(){var I=this,H=document.createElement("div");return H.style.display="flex",H.style.overflow="hidden",H.style.flexGrow="2",H.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)}),H.appendChild(z);var ge=document.createElement("div");ge.innerText=100*q+"%",z.appendChild(ge),I.opacityBoxes.push(z)}),H},_.prototype.setCurrentOpacity=function(I,H){var q=this;this.currentOpacity=I,this.opacityBoxes.forEach(function(z){z.style.borderColor=z===H?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},_}(se),oe=function(V){function _(I,H,q){var z=V.call(this,I,H,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&&he.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,H,q){var z=V.call(this,I,H,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 Ge,z.tipGrip.visual.transform.baseVal.appendItem(he.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(){he.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=he.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},_.prototype.pointerDown=function(I,H){this.state==="new"&&V.prototype.pointerDown.call(this,I,H),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(H)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):V.prototype.pointerDown.call(this,I,H)},_.prototype.pointerUp=function(I){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,V.prototype.pointerUp.call(this,I);else{var H=this.state==="creating";V.prototype.pointerUp.call(this,I),this.setTipPoints(H),this.positionTip()}},_.prototype.manipulate=function(I){if(this.tipMoving){var H=this.unrotatePoint(I);this.tipPosition={x:H.x-this.manipulationStartLeft,y:H.y-this.manipulationStartTop},this.positionTip()}else V.prototype.manipulate.call(this,I)},_.prototype.setBgColor=function(I){this.bgRectangle&&this.tip&&(he.setAttributes(this.bgRectangle,[["fill",I]]),he.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 H=Math.min(this.height/2,15),q=this.height/5;I&&(this.tipPosition={x:H+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,H=Math.min(this.width/2,15),this.tipBase1Position={x:H,y:0},this.tipBase2Position={x:H+q,y:0}):(this.tipBase1Position={x:0,y:H},this.tipBase2Position={x:0,y:H+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,H=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-H-q,y:0},this.tipBase2Position={x:this.width-H,y:0}):(this.tipBase1Position={x:this.width,y:H},this.tipBase2Position={x:this.width,y:H+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,H=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-H-q,y:this.height},this.tipBase2Position={x:this.width-H,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-H-q},this.tipBase2Position={x:this.width,y:this.height-H}):z<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(q=this.width/5,H=Math.min(this.width/2,15),this.tipBase1Position={x:H,y:this.height},this.tipBase2Position={x:H+q,y:this.height}):(this.tipBase1Position={x:0,y:this.height-H},this.tipBase2Position={x:0,y:this.height-H-q})},_.prototype.resize=function(I){V.prototype.resize.call(this,I),this.positionTip()},_.prototype.positionTip=function(){he.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 H=I;this.bgColor=H.bgColor,this.tipPosition=H.tipPosition,V.prototype.restoreState.call(this,I),this.createTip(),this.setTipPoints()},_.prototype.scale=function(I,H){V.prototype.scale.call(this,I,H),this.tipPosition={x:this.tipPosition.x*I,y:this.tipPosition.y*H},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>',_}(Me),Le=function(V){function _(I,H,q){var z=V.call(this,I,H,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 Je("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),z.strokeWidthPanel.onWidthChanged=z.setStrokeWidth,z.strokeStylePanel=new Ve("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=he.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,H){V.prototype.pointerDown.call(this,I,H),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),he.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&&he.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(I),this.stateChanged()},_.prototype.setFillColor=function(I){this.fillColor=I,this.visual&&he.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(I),this.stateChanged()},_.prototype.setStrokeWidth=function(I){this.strokeWidth=I,this.visual&&he.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},_.prototype.setStrokeDasharray=function(I){this.strokeDasharray=I,this.visual&&he.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},_.prototype.setOpacity=function(I){this.opacity=I,this.visual&&he.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 H=I;this.fillColor=H.fillColor,this.strokeColor=H.strokeColor,this.strokeWidth=H.strokeWidth,this.strokeDasharray=H.strokeDasharray,this.opacity=H.opacity,this.createVisual(),V.prototype.restoreState.call(this,I),this.setSize()},_.prototype.scale=function(I,H){V.prototype.scale.call(this,I,H),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>',_}(Fe),Ue=function(V){function _(I,H,q){return V.call(this,I,H,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=he.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(he.createTransform()),this.visual.appendChild(this.tip1),this.tip2=he.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(he.createTransform()),this.visual.appendChild(this.tip2)},_.prototype.pointerDown=function(I,H){V.prototype.pointerDown.call(this,I,H),this.state==="creating"&&this.createTips()},_.prototype.adjustVisual=function(){if(V.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(he.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()]]),he.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),H=this.tip1.transform.baseVal.getItem(0);H.setRotate(I,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(H,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>',_}(st),Ze=function(V){function _(I,H,q){var z=V.call(this,I,H,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,H,q){var z=V.call(this,I,H,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 Je("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),z.strokeWidthPanel.onWidthChanged=z.setStrokeWidth,z.strokeStylePanel=new Ve("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=he.createGroup(),this.selectorCurve=he.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=he.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,H){V.prototype.pointerDown.call(this,I,H),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(H)&&(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()),he.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),he.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),he.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},_.prototype.setupControlBox=function(){V.prototype.setupControlBox.call(this),this.curveControlLine1=he.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=he.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,H){this.curveX=this.curveX*I,this.curveY=this.curveY*H,V.prototype.scale.call(this,I,H)},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 H=I;this.strokeColor=H.strokeColor,this.strokeWidth=H.strokeWidth,this.strokeDasharray=H.strokeDasharray,this.curveX=H.curveX,this.curveY=H.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>',_}(it),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,H,q){var z=V.call(this,I,!1)||this;return z.dataUrl=H,z.state=q,z}return xe(_,V),_}(Ct),Qe=function(V){function _(I,H,q){q===void 0&&(q=!1);var z=V.call(this,I,q)||this;return z.marker=H,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 H=this[_].indexOf(I);H>-1&&this[_].splice(H,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 nt(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[tt,ve,fe,Me,Ze,Le,oe,ye,Ue,ie,st,ft]},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[tt,ve,fe,Me,Le,oe,ye]},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"BASIC_MARKER_TYPES",{get:function(){return[tt,ve,fe,Me,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(H){if(typeof H=="string"){var q=I.ALL_MARKER_TYPES.find(function(z){return z.typeName===H});q!==void 0&&I._availableMarkerTypes.push(q)}else I._availableMarkerTypes.push(H)})},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(),ke.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 Ae(this,void 0,void 0,function(){var _;return Re(this,function(I){switch(I.label){case 0:return this.setCurrentMarker(),(_=new et).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 H=!1;_||this.eventListeners.beforeclose.forEach(function(q){var z=new Ct(I,!0);q(z),z.defaultPrevented&&(H=!0)}),H||(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=[],H=0;H<arguments.length;H++)I[H]=arguments[H];(_=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,H=I<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/_;this.resize(I,H)},V.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},V.prototype.resize=function(_,I){this._isResizing=!0;var H=_/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(H,q),this._isResizing=!1},V.prototype.scaleMarkers=function(_,I){var H,q=this;this._currentMarker&&this._currentMarker instanceof Me?this._currentMarker.scale(_,I):(H=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(z){z!==q._currentMarker&&z.scale(_,I)}),H!==void 0&&this.setCurrentMarker(H)},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=[],H=0;H<arguments.length;H++)I[H]=arguments[H];this.defs=he.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 $e(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 H=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(_,H))})}}},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 H=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(rt){return rt(new Qe(_,He))})},q=this,z=this.markers.length-1;z>=0;z--)H(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(),H=this.undoRedoManager.getLastUndoStep();if(!H||H.width===I.width&&H.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(H){return H(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(H){return H(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 Ae(this,void 0,void 0,function(){var _,I,H=this;return Re(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(H,_,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(H){return I.markers.push(H.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(H){var q=I._availableMarkerTypes.find(function(ge){return ge.typeName===H.typeName});if(q!==void 0){var z=I.addNewMarker(q);z.restoreState(H),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(H){return H(new Ct(I))})},V.prototype.addNewMarker=function(_){var I=he.createGroup();return this.markerImage.appendChild(I),new _(I,this.overlayContainer,this.settings)},V.prototype.createNewMarker=function(_){var I,H=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(H,H._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(H){return H(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(H){return H(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(H){return H(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(H){return H(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(H){return H.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(H){return H.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 H=this.markerImage.getBoundingClientRect();return{x:(_-H.left)/this.zoomLevel,y:(I-H.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(_){ke.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,H){I.__proto__=H}||function(I,H){for(var q in H)Object.prototype.hasOwnProperty.call(H,q)&&(I[q]=H[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,H){return new(I||(I=Promise))(function(q,z){function ge(gt){try{rt(H.next(gt))}catch(ze){z(ze)}}function He(gt){try{rt(H.throw(gt))}catch(ze){z(ze)}}function rt(gt){var ze;gt.done?q(gt.value):(ze=gt.value,ze instanceof I?ze:new I(function(wt){wt(ze)})).then(ge,He)}rt((H=H.apply(V,_||[])).next())})}function mn(V,_){var I,H,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(rt){return function(gt){return function(ze){if(I)throw new TypeError("Generator is already executing.");for(;ge;)try{if(I=1,H&&(q=2&ze[0]?H.return:ze[0]?H.throw||((q=H.return)&&q.call(H),0):H.next)&&!(q=q.call(H,ze[1])).done)return q;switch(H=0,q&&(ze=[2&ze[0],q.value]),ze[0]){case 0:case 1:q=ze;break;case 4:return ge.label++,{value:ze[1],done:!1};case 5:ge.label++,H=ze[1],ze=[0];continue;case 7:ze=ge.ops.pop(),ge.trys.pop();continue;default:if(!(q=ge.trys,(q=q.length>0&&q[q.length-1])||ze[0]!==6&&ze[0]!==2)){ge=0;continue}if(ze[0]===3&&(!q||ze[1]>q[0]&&ze[1]<q[3])){ge.label=ze[1];break}if(ze[0]===6&&ge.label<q[1]){ge.label=q[1],q=ze;break}if(q&&ge.label<q[2]){ge.label=q[2],ge.ops.push(ze);break}q[2]&&ge.ops.pop(),ge.trys.pop();continue}ze=_.call(V,ge)}catch(wt){ze=[6,wt],H=0}finally{I=q=0}if(5&ze[0])throw ze[1];return{value:ze[0]?ze[1]:void 0,done:!0}}([rt,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 H=0,q=I;H<q.length;H++){var z=q[H],ge=z[0],He=z[1];_.setAttribute(ge,He)}},V.createRect=function(_,I,H){var q=document.createElementNS("http://www.w3.org/2000/svg","rect");return q.setAttribute("width",_.toString()),q.setAttribute("height",I.toString()),H&&V.setAttributes(q,H),q},V.createLine=function(_,I,H,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",H.toString()),ge.setAttribute("y2",q.toString()),z&&V.setAttributes(ge,z),ge},V.createPolygon=function(_,I){var H=document.createElementNS("http://www.w3.org/2000/svg","polygon");return H.setAttribute("points",_),I&&V.setAttributes(H,I),H},V.createCircle=function(_,I){var H=document.createElementNS("http://www.w3.org/2000/svg","circle");return H.setAttribute("cx",(_/2).toString()),H.setAttribute("cy",(_/2).toString()),H.setAttribute("r",_.toString()),I&&V.setAttributes(H,I),H},V.createEllipse=function(_,I,H){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()),H&&V.setAttributes(q,H),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,H,q,z,ge,He){var rt=document.createElementNS("http://www.w3.org/2000/svg","marker");return V.setAttributes(rt,[["id",_],["orient",I],["markerWidth",H.toString()],["markerHeight",q.toString()],["refX",z.toString()],["refY",ge.toString()]]),rt.appendChild(He),rt},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 H=document.createElementNS("http://www.w3.org/2000/svg","tspan");return H.textContent=_,I&&V.setAttributes(H,I),H},V.createImage=function(_){var I=document.createElementNS("http://www.w3.org/2000/svg","image");return _&&V.setAttributes(I,_),I},V.createPoint=function(_,I){var H=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return H.x=_,H.y=I,H},V.createPath=function(_,I){var H=document.createElementNS("http://www.w3.org/2000/svg","path");return H.setAttribute("d",_),I&&V.setAttributes(H,I),H},V.createElement=function(_,I){var H=document.createElementNS("http://www.w3.org/2000/svg",_);return I&&V.setAttributes(H,I),H},V.getHollowRectanglePath=function(_,I,H,q,z,ge,He,rt){return"M"+_+","+I+"V"+(I+q)+"H"+(_+H)+"V"+I+"H"+z+"V"+ge+"H"+(z+He)+"V"+(ge+rt)+"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(H){return I.appendChild(H.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(H){return I.appendChild(H)}),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 H=new qt(_,I),q=H.ratio>=1?20:H.getHorizontalLength(20),z=H.ratio<1?20:H.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 rt=bt.createElement("clipPath",[["id","text-bg-clip"]]);He.appendChild(rt);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 ze=bt.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);ze.appendChild(bt.createTSpan(_+":"+I)),ge.appendChild(ze);var wt=ze.getBBox();bt.setAttributes(ze,[["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 rt.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,H,q){var z=V.call(this,I,H)||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(H){H.className=I.className,H.colorsClassName=I.colorsClassName,I.dropdownBlock.appendChild(H.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(H){return bt.setAttributes(H,[["cx",_.toString()],["cy",I.toString()]])})},V}(),Ut=function(){function V(_,I,H,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=H,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(H){return _.gridContainer.appendChild(H)}),this.verticalGridLines.forEach(function(H){return _.gridContainer.appendChild(H)}),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 H=I.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(z,ge){var He=I.y+H*(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 H=this.container.getBoundingClientRect();return{x:_-H.left+this.margin,y:I-H.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,H=_.y-this.previousPoint.y;this.zoomFactor!==1&&(I=-I/this.zoomFactor,H=-H/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+H),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),H=_.x-this.previousPoint.x,q=_.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:I.x+H<this.margin&&(H=this.margin-I.x),I.x+=H,I.width=this.cropRect.x+this.cropRect.width-I.x;break;case this.bottomRightGrip:case this.topRightGrip:I.width+H>this.canvasWidth*this.zoomFactor&&(H=this.canvasWidth*this.zoomFactor-I.width),I.width+=H}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(H),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,H=this.aspectRatio.getHorizontalLength(this.cropRect.height),q=this.aspectRatio.getVerticalLength(this.cropRect.width);H/this.canvasWidth<q/this.canvasHeight?this.cropRect.width=H: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,H,q,z,ge){var He=H/_,rt=q/I;return{x:(z.x-ge)*He+ge,y:(z.y-ge)*rt+ge,width:z.width*He,height:z.height*rt}},V.prototype.scaleCanvas=function(_,I){var H=this.getRescaledRect(this.canvasWidth,this.canvasHeight,_,I,this.cropRect,this.margin);this.canvasWidth=_,this.canvasHeight=I,this.onCropChange&&this.onCropChange(H),this.setCropRectangle(H)},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,H=1;H<=this.width/5+10;H++){var q=H%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,H,q,z,ge,He){var rt=this;return new Promise(function(gt){var ze=document.createElement("canvas");ze.width=_.width.baseVal.value-2*q,ze.height=_.height.baseVal.value-2*q;var wt=1,zt=1;rt.naturalSize===!0?(wt=I.naturalWidth/(_.width.baseVal.value-2*q)/ge,zt=I.naturalHeight/(_.height.baseVal.value-2*q)/He,ze.width=I.naturalWidth/ge,ze.height=I.naturalHeight/He):rt.width!==void 0&&rt.height!==void 0&&(wt=rt.width/H.width,zt=rt.height/H.height,ze.width*=wt,ze.height*=zt);var en=ze.getContext("2d");en.translate(ze.width/2,ze.height/2),en.rotate(z*Math.PI/180),en.scale(ge,He),en.translate(-ze.width/2,-ze.height/2),en.drawImage(I,0,0,ze.width,ze.height);var Wn=document.createElement("canvas");Wn.width=H.width*wt,Wn.height=H.height*zt,Wn.getContext("2d").putImageData(en.getImageData((H.x-q)*wt,(H.y-q)*zt,H.width*wt,H.height*zt),0,0),gt(Wn.toDataURL(rt.imageType,rt.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,H=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,H)}},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 H=[];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)},H.push(en)}),this.aspectRatioButton=new Mt(Ot.getIcon(0,0),"Aspect ratio",H),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 rt=document.createElement("a");rt.style.color="currentColor",rt.href="https://markerjs.com/products/cropro",rt.target="_blank",rt.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(rt),ge.addElement(He)}var gt=new hn;gt.minWidth=3*this.toolbarHeight+"px",gt.contentAlign="end",this.topToolbar.addButtonBlock(gt);var ze=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");ze.onClick=this.startRenderAndClose,gt.addButton(ze),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(ze.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 H=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");H.onClick=this.rotateLeftButtonClicked,I.addButton(H);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 rt=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");rt.onClick=this.flipVerticallyButtonClicked,ge.addButton(rt)},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 H=this.cropImage.getBoundingClientRect();return{x:_-H.left,y:I-H.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 H=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/H.width,this.imageHeight/H.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(H){switch(H.label){case 0:return[4,this.render()];case 1:return _=H.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?"":_,H=V.edit,q=H===void 0?!1:H,z=V.className,ge=V.showTextOnly,He=V.showLines,rt=V.replaces,gt=V.zoomImg,ze=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(Oe.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&&rt(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(Oe.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&&rt(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 W=setInterval(G,U);return function(){return clearInterval(W)}}},[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 W=document.querySelector("head");return W||document.body}function X(G){var W,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(re.a)())return null;var D=document.createElement("style");if((W=n.csp)===null||W===void 0?void 0:W.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,W){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(h){return h.tagName==="STYLE"&&h[$]===W});if(m){var u,o;if(((u=n.csp)===null||u===void 0?void 0:u.nonce)&&m.nonce!==((o=n.csp)===null||o===void 0?void 0:o.nonce)){var f;m.nonce=(f=n.csp)===null||f===void 0?void 0:f.nonce}return m.innerHTML!==G&&(m.innerHTML=G),m}var l=X(G,n);return l[$]=W,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 u=D[m].head,o=n.getTokenAt(u),f=re.innerMode(n.getMode(),o.state),l=f.state,h=f.mode.xmlCurrentTag&&f.mode.xmlCurrentTag(l),a=h&&h.name;if(!a)return re.Pass;var s=f.mode.configuration=="html",A=typeof p=="object"&&p.dontCloseTags||s&&$,E=typeof p=="object"&&p.indentTags||s&&P;o.end>u.ch&&(a=a.slice(0,a.length-o.end+u.ch));var S=a.toLowerCase();if(!a||o.type=="string"&&(o.end!=u.ch||!/[\"\']/.test(o.string.charAt(o.string.length-1))||o.string.length==1)||o.type=="tag"&&h.close||o.string.indexOf("/")==u.ch-o.start-1||A&&G(A,S)>-1||W(n,f.mode.xmlCurrentContext&&f.mode.xmlCurrentContext(l)||[],a,u,!0))return re.Pass;var L=typeof p=="object"&&p.emptyTags;if(L&&G(L,a)>-1){g[m]={text:"/>",newPos:re.Pos(u.line,u.ch+2)};continue}var O=E&&G(E,S)>-1;g[m]={indent:O,text:">"+(O?`
|
|
|
|
`:"")+"</"+a+">",newPos:O?re.Pos(u.line+1,0):re.Pos(u.line,u.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?"/":"</",u=n.getOption("autoCloseTags"),o=typeof u=="object"&&u.dontIndentOnSlash,f=0;f<g.length;f++){if(!g[f].empty())return re.Pass;var l=g[f].head,h=n.getTokenAt(l),a=re.innerMode(n.getMode(),h.state),s=a.state;if(D&&(h.type=="string"||h.string.charAt(0)!="<"||h.start!=l.ch-1))return re.Pass;var A,E=a.mode.name!="xml"&&n.getMode().name=="htmlmixed";if(E&&a.mode.name=="javascript")A=m+"script";else if(E&&a.mode.name=="css")A=m+"style";else{var S=a.mode.xmlCurrentContext&&a.mode.xmlCurrentContext(s);if(!S||S.length&&W(n,S,S[S.length-1],l))return re.Pass;A=m+S[S.length-1]}n.getLine(l.line).charAt(h.end)!=">"&&(A+=">"),p[f]=A}if(n.replaceSelections(p),g=n.listSelections(),!o)for(var f=0;f<g.length;f++)(f==g.length-1||g[f].head.line<g[f+1].head.line)&&n.indentLine(g[f].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 W(n,D,g,p,m){if(!re.scanForClosingTag)return!1;var u=Math.min(n.lastLine()+1,p.line+500),o=re.scanForClosingTag(n,p,null,u);if(!o||o.tag!=g)return!1;for(var f=m?1:0,l=D.length-1;l>=0&&D[l]==g;l--)++f;p=o.to;for(var l=1;l<f;l++){var h=re.scanForClosingTag(n,p,null,u);if(!h||h.tag!=g)return!1;p=h.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 $(W){var n=!0;if(W.length>0){for(var D=0;D<W.length;D++)if(W[D].compile_success==0||!W[D].compile_success){n=!1;break}}else n=!1;return n}function P(W){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",D=[],g=0;g<W.length;g++){var p=W[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(W,n,D){for(var g=0;g<W.length;g++){var p=W[g];if(p.key===n){p.children=D;break}p.children&&X(p.children,n,D)}return W}function U(W,n,D){var g;return function(){var p=this,m=arguments,u=function(){g=null,D||W.apply(p,m)},o=D&&!g;clearTimeout(g),g=setTimeout(u,n),o&&W.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(W){return W[k.DI_DEPENDENCIES]||[]}k.getServiceDependencies=G})(re||(re={}));const $=X("instantiationService");function P(k,G,W,n){G[re.DI_TARGET]===G?G[re.DI_DEPENDENCIES].push({id:k,index:W,optional:n}):(G[re.DI_DEPENDENCIES]=[{id:k,index:W,optional:n}],G[re.DI_TARGET]=G)}function X(k){if(re.serviceIds.has(k))return re.serviceIds.get(k);const G=function(W,n,D){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");P(G,W,D,!1)};return G.toString=()=>k,re.serviceIds.set(k,G),G}function U(k){return function(G,W,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}}),W=G.defaults,n=G.getDefaults,D=G.changeDefaults,g=/[&<>"']/,p=/[&<>"']/g,m=/[<>"']|&(?!#?\w+;)/,u=/[<>"']|&(?!#?\w+;)/g,o={"&":"&","<":"<",">":">",'"':""","'":"'"},f=function(ce){return o[ce]};function l(ve,ce){if(ce){if(g.test(ve))return ve.replace(p,f)}else if(m.test(ve))return ve.replace(u,f);return ve}var h=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function a(ve){return ve.replace(h,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 s=/(^|[^\[])\^/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(s,"$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(a(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=c(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 c(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 y(ve,ce){var fe=ve.replace(/\|/g,function(oe,le,ye){for(var Le=!1,Ue=le;--Ue>=0&&ye[Ue]==="\\";)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:a,edit:A,cleanUrl:L,resolveUrl:c,noopTest:w,merge:v,splitCells:y,rtrim:F,findClosingBracket:B,checkSanitizeDeprecation:R},N=G.defaults,b=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 Oe(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:b(ye,`
|
|
`)}}},ce.fences=function(ie){var ne=this.rules.block.fences.exec(ie);if(ne){var oe=ne[0],le=Oe(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]===")",Ue={type:"list",raw:oe,ordered:ye,start:ye?+le.slice(0,-1):"",loose:!1,items:[]},Ze=ne[0].match(this.rules.block.item),mt=!1,ft,Ct,xt,Qe,Lt,vt,Ft,Pt=Ze.length,Rt=0;Rt<Pt;Rt++)ft=Ze[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(Ze[Rt+1])[0],(ye?xt.length===1||!Le&&xt[xt.length-1]===")":xt.length>1||this.options.smartLists&&xt!==le)&&(Qe=Ze.slice(Rt+1).join(`
|
|
`),Ue.raw=Ue.raw.substring(0,Ue.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&&(Ue.loose=!0),vt=/^\[[ xX]\] /.test(ft),Ft=void 0,vt&&(Ft=ft[1]!==" ",ft=ft.replace(/^\[[ xX]\] +/,"")),Ue.items.push({type:"list_item",raw:oe,task:vt,checked:Ft,loose:Lt,text:ft});return Ue}},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],Ue="";if(this.options.pedantic){var Ze=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Le);Ze?(Le=Ze[1],Ue=Ze[3]):Ue=""}else Ue=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:Ue&&Ue.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,Ae=j.edit,Re=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=Ae(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=Ae(pe.item,"gm").replace(/bull/g,pe.bullet).getRegex(),pe.list=Ae(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=Ae(pe.html,"i").replace("comment",pe._comment).replace("tag",pe._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),pe.paragraph=Ae(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=Ae(pe.blockquote).replace("paragraph",pe.paragraph).getRegex(),pe.normal=Re({},pe),pe.gfm=Re({},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=Ae(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=Ae(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=Re({},pe.normal,{html:Ae(`^ *(?: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:Ae(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 he={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])/};he._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",he.punctuation=Ae(he.punctuation).replace(/punctuation/g,he._punctuation).getRegex(),he._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",he._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",he.em.start=Ae(he.em.start).replace(/punctuation/g,he._punctuation).getRegex(),he.em.middle=Ae(he.em.middle).replace(/punctuation/g,he._punctuation).replace(/overlapSkip/g,he._overlapSkip).getRegex(),he.em.endAst=Ae(he.em.endAst,"g").replace(/punctuation/g,he._punctuation).getRegex(),he.em.endUnd=Ae(he.em.endUnd,"g").replace(/punctuation/g,he._punctuation).getRegex(),he.strong.start=Ae(he.strong.start).replace(/punctuation/g,he._punctuation).getRegex(),he.strong.middle=Ae(he.strong.middle).replace(/punctuation/g,he._punctuation).replace(/blockSkip/g,he._blockSkip).getRegex(),he.strong.endAst=Ae(he.strong.endAst,"g").replace(/punctuation/g,he._punctuation).getRegex(),he.strong.endUnd=Ae(he.strong.endUnd,"g").replace(/punctuation/g,he._punctuation).getRegex(),he.blockSkip=Ae(he._blockSkip,"g").getRegex(),he.overlapSkip=Ae(he._overlapSkip,"g").getRegex(),he._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,he._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,he._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])?)+(?![-_])/,he.autolink=Ae(he.autolink).replace("scheme",he._scheme).replace("email",he._email).getRegex(),he._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,he.tag=Ae(he.tag).replace("comment",pe._comment).replace("attribute",he._attribute).getRegex(),he._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,he._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,he._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,he.link=Ae(he.link).replace("label",he._label).replace("href",he._href).replace("title",he._title).getRegex(),he.reflink=Ae(he.reflink).replace("label",he._label).getRegex(),he.reflinkSearch=Ae(he.reflinkSearch,"g").replace("reflink",he.reflink).replace("nolink",he.nolink).getRegex(),he.normal=Re({},he),he.pedantic=Re({},he.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Ae(/^!?\[(label)\]\((.*?)\)/).replace("label",he._label).getRegex(),reflink:Ae(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",he._label).getRegex()}),he.gfm=Re({},he.normal,{escape:Ae(he.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),he.gfm.url=Ae(he.gfm.url,"i").replace("email",he.gfm._extended_email).getRegex(),he.breaks=Re({},he.gfm,{br:Ae(he.br).replace("{2,}","*").getRegex(),text:Ae(he.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var ke={block:pe,inline:he},et=G.defaults,We=ke.block,nt=ke.inline;function at(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||et,this.options.tokenizer=this.options.tokenizer||new Ee,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ie={block:We.normal,inline:nt.normal};this.options.pedantic?(ie.block=We.pedantic,ie.inline=nt.pedantic):this.options.gfm&&(ie.block=We.gfm,this.options.breaks?ie.inline=nt.breaks:ie.inline=nt.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,Ue;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):(Ue=ne[ne.length-1],Ue.raw+=`
|
|
`+le.raw,Ue.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):(Ue=ne[ne.length-1],Ue.raw+=`
|
|
`+le.raw,Ue.text+=`
|
|
`+le.text);continue}if(ie){var Ze="Infinite loop on byte: "+ie.charCodeAt(0);if(this.options.silent){console.error(Ze);break}else throw new Error(Ze)}}return ne},ce.inline=function(ie){var ne,oe,le,ye,Le,Ue,Ze=ie.length;for(ne=0;ne<Ze;ne++){Ue=ie[ne];switch(Ue.type){case"paragraph":case"text":case"heading":{Ue.tokens=[],this.inlineTokens(Ue.text,Ue.tokens);break}case"table":{for(Ue.tokens={header:[],cells:[]},ye=Ue.header.length,oe=0;oe<ye;oe++)Ue.tokens.header[oe]=[],this.inlineTokens(Ue.header[oe],Ue.tokens.header[oe]);for(ye=Ue.cells.length,oe=0;oe<ye;oe++)for(Le=Ue.cells[oe],Ue.tokens.cells[oe]=[],le=0;le<Le.length;le++)Ue.tokens.cells[oe][le]=[],this.inlineTokens(Le[le],Ue.tokens.cells[oe][le]);break}case"blockquote":{this.inline(Ue.tokens);break}case"list":{for(ye=Ue.items.length,oe=0;oe<ye;oe++)this.inline(Ue.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,Ue=ie,Ze;if(this.tokens.links){var mt=Object.keys(this.tokens.links);if(mt.length>0)for(;(Ze=this.tokenizer.rules.inline.reflinkSearch.exec(Ue))!=null;)mt.includes(Ze[0].slice(Ze[0].lastIndexOf("[")+1,-1))&&(Ue=Ue.slice(0,Ze.index)+"["+"a".repeat(Ze[0].length-2)+"]"+Ue.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Ze=this.tokenizer.rules.inline.blockSkip.exec(Ue))!=null;)Ue=Ue.slice(0,Ze.index)+"["+"a".repeat(Ze[0].length-2)+"]"+Ue.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,Ue,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,Ue,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,at)){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:nt}}}]),ve}(),$e=G.defaults,se=j.cleanUrl,_e=j.escape,Te=function(){function ve(fe){this.options=fe||$e}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}(),Se=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}(),Ge=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}(),Ne=G.defaults,Fe=j.unescape,Ke=function(){function ve(fe){this.options=fe||Ne,this.options.renderer=this.options.renderer||new Te,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Se,this.slugger=new Ge}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,Ue,Ze,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,Fe(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="",Ue=Qe.header.length,ye=0;ye<Ue;ye++)ft+=this.renderer.tablecell(this.parseInline(Qe.tokens.header[ye]),{header:!0,align:Qe.align[ye]});for(Ct+=this.renderer.tablerow(ft),xt="",Ue=Qe.cells.length,ye=0;ye<Ue;ye++){for(mt=Qe.tokens.cells[ye],ft="",Ze=mt.length,Le=0;Le<Ze;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,Ue=Qe.items.length,xt="",ye=0;ye<Ue;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 Ue='Token with "'+ye.type+'" type was not found.';if(this.options.silent){console.error(Ue);return}else throw new Error(Ue)}}}return oe},ve}(),Je=j.merge,Ve=j.checkSanitizeDeprecation,tt=j.escape,Ie=G.getDefaults,it=G.changeDefaults,st=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=Je({},De.defaults,ce||{}),Ve(ce),fe){var ie=ce.highlight,ne;try{ne=je.lex(ve,ce)}catch(Le){return fe(Le)}var oe=function(Ue){var Ze;if(!Ue)try{Ze=Ke.parse(ne,ce)}catch(mt){Ue=mt}return ce.highlight=ie,Ue?fe(Ue):fe(null,Ze)};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(Ue,Ze){if(Ue)return oe(Ue);Ze!=null&&Ze!==Le.text&&(Le.text=Ze,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),Ke.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>"+tt(Le.message+"",!0)+"</pre>";throw Le}}De.options=De.setOptions=function(ve){return Je(De.defaults,ve),it(De.defaults),De},De.getDefaults=Ie,De.defaults=st,De.use=function(ve){var ce=Je({},ve);if(ve.renderer&&function(){var ie=De.defaults.renderer||new Te,ne=function(ye){var Le=ie[ye];ie[ye]=function(){for(var Ue=arguments.length,Ze=new Array(Ue),mt=0;mt<Ue;mt++)Ze[mt]=arguments[mt];var ft=ve.renderer[ye].apply(ie,Ze);return ft===!1&&(ft=Le.apply(ie,Ze)),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 Ue=arguments.length,Ze=new Array(Ue),mt=0;mt<Ue;mt++)Ze[mt]=arguments[mt];var ft=ve.tokenizer[ye].apply(ie,Ze);return ft===!1&&(ft=Le.apply(ie,Ze)),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),Ue;!(Ue=Le()).done;)for(var Ze=Ue.value,mt=U(Ze),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=Ke,De.parser=Ke.parse,De.Renderer=Te,De.TextRenderer=Se,De.Lexer=je,De.lexer=je.lex,De.Tokenizer=Ee,De.Slugger=Ge,De.parse=De;var Me=De;return Me})},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,f,l){l&&l!=re.Init&&(o.removeKeyMap(U),o.state.closeBrackets=null),f&&(k(X(f,"pairs")),o.state.closeBrackets=f,o.addKeyMap(U))});function X(o,f){return f=="pairs"&&typeof o=="string"?o:typeof o=="object"&&o[f]!=null?o[f]:$[f]}var U={Backspace:n,Enter:D};function k(o){for(var f=0;f<o.length;f++){var l=o.charAt(f),h="'"+l+"'";U[h]||(U[h]=G(l))}}k($.pairs+"`");function G(o){return function(f){return p(f,o)}}function W(o){var f=o.state.closeBrackets;if(!f||f.override)return f;var l=o.getModeAt(o.getCursor());return l.closeBrackets||f}function n(o){var f=W(o);if(!f||o.getOption("disableInput"))return re.Pass;for(var l=X(f,"pairs"),h=o.listSelections(),a=0;a<h.length;a++){if(!h[a].empty())return re.Pass;var s=m(o,h[a].head);if(!s||l.indexOf(s)%2!=0)return re.Pass}for(var a=h.length-1;a>=0;a--){var A=h[a].head;o.replaceRange("",P(A.line,A.ch-1),P(A.line,A.ch+1),"+delete")}}function D(o){var f=W(o),l=f&&X(f,"explode");if(!l||o.getOption("disableInput"))return re.Pass;for(var h=o.listSelections(),a=0;a<h.length;a++){if(!h[a].empty())return re.Pass;var s=m(o,h[a].head);if(!s||l.indexOf(s)%2!=0)return re.Pass}o.operation(function(){var A=o.lineSeparator()||`
|
|
`;o.replaceSelection(A+A,null),o.execCommand("goCharLeft"),h=o.listSelections();for(var E=0;E<h.length;E++){var S=h[E].head.line;o.indentLine(S,null,!0),o.indentLine(S+1,null,!0)}})}function g(o){var f=re.cmpPos(o.anchor,o.head)>0;return{anchor:new P(o.anchor.line,o.anchor.ch+(f?-1:1)),head:new P(o.head.line,o.head.ch+(f?1:-1))}}function p(o,f){var l=W(o);if(!l||o.getOption("disableInput"))return re.Pass;var h=X(l,"pairs"),a=h.indexOf(f);if(a==-1)return re.Pass;for(var s=X(l,"closeBefore"),A=X(l,"triples"),E=h.charAt(a+1)==f,S=o.listSelections(),L=a%2==0,O,C=0;C<S.length;C++){var T=S[C],x=T.head,c,w=o.getRange(x,P(x.line,x.ch+1));if(L&&!T.empty())c="surround";else if((E||!L)&&w==f)E&&u(o,x)?c="both":A.indexOf(f)>=0&&o.getRange(x,P(x.line,x.ch+3))==f+f+f?c="skipThree":c="skip";else if(E&&x.ch>1&&A.indexOf(f)>=0&&o.getRange(P(x.line,x.ch-2),x)==f+f){if(x.ch>2&&/\bstring/.test(o.getTokenTypeAt(P(x.line,x.ch-2))))return re.Pass;c="addFour"}else if(E){var v=x.ch==0?" ":o.getRange(P(x.line,x.ch-1),x);if(!re.isWordChar(w)&&v!=f&&!re.isWordChar(v))c="both";else return re.Pass}else if(L&&(w.length===0||/\s/.test(w)||s.indexOf(w)>-1))c="both";else return re.Pass;if(!O)O=c;else if(O!=c)return re.Pass}var y=a%2?h.charAt(a-1):f,F=a%2?f:h.charAt(a+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]=y+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(y+F,null),o.triggerElectric(y+F),o.execCommand("goCharLeft")):O=="addFour"&&(o.replaceSelection(y+y+y+y,"before"),o.execCommand("goCharRight"))})}function m(o,f){var l=o.getRange(P(f.line,f.ch-1),P(f.line,f.ch+1));return l.length==2?l:null}function u(o,f){var l=o.getTokenAt(P(f.line,f.ch+1));return/\bstring/.test(l.type)&&l.start==f.ch&&(f.ch==0||!/\bstring/.test(o.getTokenTypeAt(f)))}})},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(s){return s&&typeof s=="object"&&typeof s[Symbol.iterator]=="function"}$.is=P;const X=Object.freeze([]);function U(){return X}$.empty=U;function*k(s){yield s}$.single=k;function G(s){return s||X}$.from=G;function W(s){return!s||s[Symbol.iterator]().next().done===!0}$.isEmpty=W;function n(s){return s[Symbol.iterator]().next().value}$.first=n;function D(s,A){for(const E of s)if(A(E))return!0;return!1}$.some=D;function g(s,A){for(const E of s)if(A(E))return E;return}$.find=g;function*p(s,A){for(const E of s)A(E)&&(yield E)}$.filter=p;function*m(s,A){let E=0;for(const S of s)yield A(S,E++)}$.map=m;function*u(...s){for(const A of s)for(const E of A)yield E}$.concat=u;function*o(s){for(const A of s)for(const E of A)yield E}$.concatNested=o;function f(s,A,E){let S=E;for(const L of s)S=A(S,L);return S}$.reduce=f;function*l(s,A,E=s.length){for(A<0&&(A+=s.length),E<0?E+=s.length:E>s.length&&(E=s.length);A<E;A++)yield s[A]}$.slice=l;function h(s,A=Number.POSITIVE_INFINITY){const E=[];if(A===0)return[E,s];const S=s[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=h;function a(s,A,E=(S,L)=>S===L){const S=s[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=a})(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"),W=Z("9kvl"),n=Z("14J3"),D=Z("BMrR"),g=Z("jCWc"),p=Z("kPKH"),m=Z("+L6B"),u=Z("2/Rp"),o=Z("k1fw"),f=Z("m3rI"),l=Z("LO5M"),h=Z.n(l),a=Z("h+Ho"),s=function(Fe){var Ke,Je,Ve,tt,Ie=Fe.user,it=Fe.forumsDetail,st=Fe.globalSetting,De=Fe.loading,Me=Fe.dispatch,ve=Object($.a)(Fe,["user","forumsDetail","globalSetting","loading","dispatch"]),ce=it.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(Ze){for(;;)switch(Ze.prev=Ze.next){case 0:if(!(fe!=null&&fe.watched)){Ze.next=6;break}return Ze.next=3,Object(a.a)({user_id:fe.user_id});case 3:Ze.t0=Ze.sent,Ze.next=9;break;case 6:return Ze.next=8,Object(a.o)({user_id:fe.user_id});case 8:Ze.t0=Ze.sent;case 9:Le=Ze.t0,Le&&Me({type:"forumsDetail/setForumsDetailData",payload:Object(o.a)(Object(o.a)({},it.forumsDetailData),{},{author_info:Object(o.a)(Object(o.a)({},fe),{},{watched:!(fe!=null&&fe.watched)})})});case 11:case"end":return Ze.stop()}},ye)}));return function(){return le.apply(this,arguments)}}();return k.a.createElement("section",{className:h.a.wrap},k.a.createElement("aside",{className:"ml20"},k.a.createElement("div",{className:"bg-white pt40 pb40 pl20 pr20 ".concat(h.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(f.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),((Ke=Ie.userInfo)===null||Ke===void 0?void 0:Ke.user_id)!==(fe==null?void 0:fe.user_id)&&k.a.createElement(D.a,{justify:"center",className:"mt30 ".concat(h.a.buttonWrap)},k.a.createElement(p.a,null,k.a.createElement(u.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(u.a,{ghost:!0,className:h.a.privateMessage,href:"/messages/".concat((Je=Ie.userInfo)===null||Je===void 0?void 0:Je.login,"/message_detail?target_ids=").concat(fe==null?void 0:fe.user_id),target:"_blank"},"\u79C1\u4FE1")))),!!(ie!=null&&(Ve=ie.tag)!==null&&Ve!==void 0&&Ve.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(h.a.tag)},ie==null||((tt=ie.tag)===null||tt===void 0)?void 0:tt.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:h.a.recommend},ne==null?void 0:ne.map(function(le){return k.a.createElement("div",{className:h.a.recommendItem},k.a.createElement("a",{href:"/shixuns/".concat(le.identifier,"/challenges"),target:"_blank"},k.a.createElement("img",{alt:le.id,src:"".concat(f.a.API_SERVER,"/").concat(le.image_url)})),k.a.createElement("div",{className:"".concat(h.a.flex1," ml10")},k.a.createElement("a",{href:"/shixuns/".concat(le.identifier,"/challenges"),target:"_blank",title:le.name,className:"".concat(h.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(W.a)(function(Ne){var Fe=Ne.user,Ke=Ne.forumsDetail,Je=Ne.loading,Ve=Ne.globalSetting;return{user:Fe,forumsDetail:Ke,globalSetting:Ve,loading:Je.models.forumsDetail}})(s),E=Z("qVdP"),S=Z("jsC+"),L=Z("5Dmo"),O=Z("3S7+"),C=Z("sPJy"),T=Z("bE4q"),x=Z("lUTK"),c=Z("BvKs"),w=Z("5NDa"),v=Z("5rEg"),y=Z("2qtc"),F=Z("kLXV"),B=Z("miYZ"),R=Z("tsqr"),j=Z("55Ip"),N=Z("wd/R"),b=Z.n(N),Y=Z("9Bee"),ee=Z("oBTY"),ae=Z("tJVT"),ue=Z("Ot1p"),Oe=Z("/MfK"),Ee=Z("8JLL"),xe=Z.n(Ee);b.a.lang("ZH-cn");function Ae(Ne){var Fe=Ne.user,Ke=Ne.vlist,Je=Ke===void 0?[]:Ke,Ve=Ne.dispatch,tt=Ne.params,Ie=Ne.id,it=Ne.memo_replies,st=Ne.forumsDetail;return k.a.createElement("aside",{className:xe.a.comment},Je.map(function(De,Me){var ve,ce;return k.a.createElement(D.a,{key:Me,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=Fe.userInfo)===null||ve===void 0?void 0:ve.user_id)||De.user_login===((ce=Fe.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(Oe.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(Ue){for(;;)switch(Ue.prev=Ue.next){case 0:return Ue.next=2,Object(a.b)({id:De.id});case 2:le=Ue.sent,ye=it.find(function(Ze){return Ze.id===Ie}).children.filter(function(Ze){return Ze.id!==De.id}),it.find(function(Ze){return Ze.id===Ie}).children=ye,Ve({type:"forumsDetail/setForumsDetailData",payload:Object(o.a)(Object(o.a)({},st.forumsDetailData),{},{memo_replies:Object(ee.a)(it)})});case 6:case"end":return Ue.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 Re=Ae,pe=Z("1vsH");b.a.lang("ZH-cn");var he=function(Fe,Ke){var Je=Fe.user,Ve=Fe.forumsDetail,tt=Fe.globalSetting,Ie=Fe.loading,it=Fe.dispatch,st=Fe.handleClick,De=Object($.a)(Fe,["user","forumsDetail","globalSetting","loading","dispatch","handleClick"]),Me=Ve.forumsDetailData||{},ve=Me.memo,ce=Me.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),Ue=Le[0],Ze=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)(Ke,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(a.h)({id:fe.memoId,page:qt});case 4:Ot=Ut.sent,Ot!=null&&Ot.memo_replies&&(it({type:"forumsDetail/setForumsDetailData",payload:Object(o.a)(Object(o.a)({},Ve.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=Je.userInfo)===null||qt===void 0?void 0:qt.image_url,children:[],user_id:(Ot=Je.userInfo)===null||Ot===void 0?void 0:Ot.user_id,user_login:(Mt=Je.userInfo)===null||Mt===void 0?void 0:Mt.login,username:(Dt=Je.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(f.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:st},k.a.createElement(Y.a,{value:dt.content}))),!!(dt!=null&&(qt=dt.children)!==null&&qt!==void 0&&qt.length)&&k.a.createElement(Re,{user:Je,id:dt==null?void 0:dt.id,vlist:dt==null?void 0:dt.children,dispatch:it,params:fe,memo_replies:ce,forumsDetail:Ve}),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){Ze(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(u.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(!(Ue==="")){Ut.next=4;break}R.b.error("\u8BF7\u8F93\u5165\u5185\u5BB9"),Ut.next=9;break;case 4:return Ut.next=6,Object(a.k)({parent_id:dt.id,content:Ue});case 6:Mt=Ut.sent,Ze(null),Mt&&(xt(-1),ce.find(function(dn){return dn.id===Mt.parent_id}).children.push(nn(Mt)),it({type:"forumsDetail/setForumsDetailData",payload:Object(o.a)(Object(o.a)({},Ve.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(a.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,it({type:"forumsDetail/setForumsDetailData",payload:Object(o.a)(Object(o.a)({},Ve.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(u.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(a.k)({parent_id:ve.id,content:oe});case 6:ut=Ot.sent,le(null),ut&&it({type:"forumsDetail/setForumsDetailData",payload:Object(o.a)(Object(o.a)({},Ve.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")))))},ke=Object(W.a)(function(Ne){var Fe=Ne.user,Ke=Ne.forumsDetail,Je=Ne.loading,Ve=Ne.globalSetting;return{user:Fe,forumsDetail:Ke,globalSetting:Ve,loading:Je.models.forumsDetail}},null,null,{forwardRef:!0})(Object(U.forwardRef)(he)),et=Z("smFo"),We=Z.n(et),nt=Z("RCxd"),at=Z("kaH+"),Pe=Z("dhSg"),je={5:"\u6280\u672F\u5206\u4EAB",3:"\u64CD\u4F5C\u6307\u5357",16:"\u901A\u77E5\u516C\u544A"},$e=function(Fe){var Ke,Je,Ve,tt,Ie,it=Fe.user,st=Fe.forumsDetail,De=Fe.globalSetting,Me=Fe.loading,ve=Fe.dispatch,ce=Object($.a)(Fe,["user","forumsDetail","globalSetting","loading","dispatch"]),fe=st.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(a.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)({},st.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)}}(),Ue=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(a.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"),W.d.push("/forums")),(vt==null?void 0:vt.status)===-1&&W.d.push("/forums");case 5:case"end":return Pt.stop()}},Lt)}));return function(){return Qe.apply(this,arguments)}}(),Ze=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(a.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)({},st.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(a.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)({},st.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(c.a,{className:We.a.menu},((Ke=it.userInfo)===null||Ke===void 0?void 0:Ke.admin)&&(ne==null?void 0:ne.sticky)&&k.a.createElement(c.a.Item,null,k.a.createElement("a",{onClick:function(){return Le()}},"\u53D6\u6D88\u7F6E\u9876")),((Je=it.userInfo)===null||Je===void 0?void 0:Je.admin)&&!(ne!=null&&ne.sticky)&&k.a.createElement(c.a.Item,null,k.a.createElement("a",{onClick:function(){return Le()}},"\u7F6E\xA0\xA0\u9876")),k.a.createElement(c.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(c.a.Item,null,k.a.createElement("a",{onClick:function(){F.a.confirm({title:"\u63D0\u793A",icon:k.a.createElement(nt.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(){Ue()},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,(((Ve=it.userInfo)===null||Ve===void 0?void 0:Ve.admin)||((tt=it.userInfo)===null||tt===void 0?void 0:tt.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,b()(ne==null?void 0:ne.time).fromNow()," \u53D1\u5E03")),k.a.createElement(p.a,{className:"c-grey-999"},((Ie=it.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:Ze},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(ke,{ref:ye,handleClick:xt}),k.a.createElement(at.a,null))},se=Object(W.a)(function(Ne){var Fe=Ne.user,Ke=Ne.forumsDetail,Je=Ne.loading,Ve=Ne.globalSetting;return{user:Fe,forumsDetail:Ke,globalSetting:Ve,loading:Je.effects}})($e),_e=Z("G8my"),Te=Z.n(_e),Se=function(Fe){var Ke=Fe.forumsDetail,Je=Fe.globalSetting,Ve=Fe.loading,tt=Fe.dispatch,Ie=Object($.a)(Fe,["forumsDetail","globalSetting","loading","dispatch"]),it=Object(G.i)();Object(U.useEffect)(function(){st()},[it.memoId]);var st=function(){var De=Object(re.a)(X.a.mark(function Me(){return X.a.wrap(function(ce){for(;;)switch(ce.prev=ce.next){case 0:tt({type:"forumsDetail/getForumsDetailData",payload:{id:it.memoId}});case 1:case"end":return ce.stop()}},Me)}));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))},Ge=be.default=Object(W.a)(function(Ne){var Fe=Ne.forumsDetail,Ke=Ne.loading,Je=Ne.globalSetting;return{forumsDetail:Fe,globalSetting:Je,loading:Ke.models.forumsDetail}})(Se)},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 s}),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"),W=Z("ODXe"),n=Z("4IlW"),D=Z("bX4T"),g=Z("YrtM"),p=Z("TSYQ"),m=Z.n(p),u=Z("+nKL"),o=Z("8OUc"),f=function(Y,ee){var ae=Y.prefixCls,ue=Y.id,Oe=Y.flattenOptions,Ee=Y.childrenAsData,xe=Y.values,Ae=Y.searchValue,Re=Y.multiple,pe=Y.defaultActiveFirstOption,he=Y.height,ke=Y.itemHeight,et=Y.notFoundContent,We=Y.open,nt=Y.menuItemSelectedIcon,at=Y.virtual,Pe=Y.onSelect,je=Y.onToggleOpen,$e=Y.onActiveValue,se=Y.onScroll,_e=Y.onMouseEnter,Te="".concat(ae,"-item"),Se=Object(g.a)(function(){return Oe},[We,Oe],function(Me,ve){return ve[0]&&Me[1]!==ve[1]}),Ge=U.useRef(null),Ne=function(ve){ve.preventDefault()},Fe=function(ve){Ge.current&&Ge.current.scrollTo({index:ve})},Ke=function(ve){for(var ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,fe=Se.length,ie=0;ie<fe;ie+=1){var ne=(ve+ie*ce+fe)%fe,oe=Se[ne],le=oe.group,ye=oe.data;if(!le&&!ye.disabled)return ne}return-1},Je=U.useState(function(){return Ke(0)}),Ve=Object(W.a)(Je,2),tt=Ve[0],Ie=Ve[1],it=function(ve){Ie(ve);var ce=Se[ve];if(!ce){$e(null,-1);return}$e(ce.data.value,ve)};U.useEffect(function(){it(pe!==!1?Ke(0):-1)},[Se.length,Ae]),U.useEffect(function(){var Me=setTimeout(function(){if(!Re&&We&&xe.size===1){var ve=Array.from(xe)[0],ce=Se.findIndex(function(fe){var ie=fe.data;return ie.value===ve});it(ce),Fe(ce)}});return function(){return clearTimeout(Me)}},[We]);var st=function(ve){ve!==void 0&&Pe(ve,{selected:!xe.has(ve)}),Re||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=Ke(tt+fe,fe);Fe(ie),it(ie)}break}case n.a.ENTER:{var ne=Se[tt];ne&&!ne.data.disabled?st(ne.data.value):st(void 0),We&&ve.preventDefault();break}case n.a.ESC:je(!1)}},onKeyUp:function(){},scrollTo:function(ve){Fe(ve)}}}),Se.length===0)return U.createElement("div",{role:"listbox",id:"".concat(ue,"_list"),className:"".concat(Te,"-empty"),onMouseDown:Ne},et);function De(Me){var ve=Se[Me];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:Me,role:"option",id:"".concat(ue,"_list_").concat(Me),"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(tt-1),De(tt),De(tt+1)),U.createElement(u.a,{itemKey:"key",ref:Ge,data:Se,height:he,itemHeight:ke,fullHeight:!1,onMouseDown:Ne,onScroll:se,virtual:at,onMouseEnter:_e},function(Me,ve){var ce,fe=Me.group,ie=Me.groupOption,ne=Me.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,Ue=ne.title,Ze=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"),tt===ve&&!ye),Object(k.a)(ce,"".concat(Qe,"-disabled"),ye),Object(k.a)(ce,"".concat(Qe,"-selected"),xt),ce)),vt=Ee?Ze:oe,Ft=!nt||typeof nt=="function"||xt;return U.createElement("div",Object.assign({},Ct,{"aria-selected":xt,className:Lt,title:Ue,onMouseMove:function(){if(tt===ve||ye)return;it(ve)},onClick:function(){ye||st(Le)},style:mt}),U.createElement("div",{className:"".concat(Qe,"-content")},vt||Le),U.isValidElement(nt)||xt,Ft&&U.createElement(o.a,{className:"".concat(Te,"-option-state"),customizeIcon:nt,customizeIconProps:{isSelected:xt}},xt?"\u2713":null))}))},l=U.forwardRef(f);l.displayName="OptionList";var h=l,a=function(){return null};a.isSelectOption=!0;var s=a,A=function(){return null};A.isSelectOptGroup=!0;var E=A,S=Z("VTBJ"),L=Z("Zm9Q");function O(b){var Y=b.key,ee=b.props,ae=ee.children,ue=ee.value,Oe=Object(G.a)(ee,["children","value"]);return Object(S.a)({key:Y,value:ue!==void 0?ue:Y,children:ae},Oe)}function C(b){var Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(L.a)(b).map(function(ee,ae){if(!U.isValidElement(ee)||!ee.type)return null;var ue=ee.type.isSelectOptGroup,Oe=ee.key,Ee=ee.props,xe=Ee.children,Ae=Object(G.a)(Ee,["children"]);return Y||!ue?O(ee):Object(S.a)(Object(S.a)({key:"__RC_SELECT_GRP__".concat(Oe===null?ae:Oe,"__"),label:Oe},Ae),{},{options:C(xe)})}).filter(function(ee){return ee})}var T=Z("2Qr1"),x=Z("qNPg"),c=Z("U8pU"),w=Z("Kwbf"),v=Z("WKfj");function y(b){var Y=b.mode,ee=b.options,ae=b.children,ue=b.backfill,Oe=b.allowClear,Ee=b.placeholder,xe=b.getInputElement,Ae=b.showSearch,Re=b.onSearch,pe=b.defaultOpen,he=b.autoFocus,ke=b.labelInValue,et=b.value,We=b.inputValue,nt=b.optionLabelProp,at=Y==="multiple"||Y==="tags",Pe=Ae!==void 0?Ae:at||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 $e=je.some(function(Te){return Te.options?Te.options.some(function(Se){return typeof("value"in Se?Se.value:Se.key)=="number"}):typeof("value"in Te?Te.value:Te.key)=="number"});Object(w.a)(!$e,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(w.a)(Y!=="combobox"||!nt,"`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||!Oe||!Ee,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Re&&!Pe&&Y!=="combobox"&&Y!=="tags"&&Object(w.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(w.b)(!pe||he,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),et!=null){var se=Object(v.d)(et);Object(w.a)(!ke||se.every(function(Te){return Object(c.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)(!at||Array.isArray(et),"`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 Se=Te.type;if(Se.isSelectOption)return!1;if(Se.isSelectOptGroup){var Ge=Object(L.a)(Te.props.children).every(function(Ne){return!U.isValidElement(Ne)||!Te.type||Ne.type.isSelectOption?!0:(_e=Ne.type,!1)});return!Ge}return _e=Se,!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=y,B=Object(x.a)({prefixCls:"rc-select",components:{optionList:h},convertChildrenToData:C,flattenOptions:T.d,getLabeledValue:T.e,filterOptions:T.b,isValueDisabled:T.g,findValueOption:T.c,warningProps:F,fillOptionsWithMissingValue:T.a}),R=function(b){Object(P.a)(ee,b);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=s,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"),W=Z.n(G),n=function(D){Object(P.a)(p,D);var g=Object(X.a)(p);function p(m){var u;Object(re.a)(this,p),u=g.call(this,m);var o=window.document;return u.node=o.createElement("div"),o.body.appendChild(u.node),u}return Object($.a)(p,[{key:"render",value:function(){var u=this.props.children;return Object(G.createPortal)(u,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(u){u.None=()=>$.a.None;function o(y){return(F,B=null,R)=>{let j=!1,N;return N=y(b=>j?void 0:(N?N.dispose():j=!0,F.call(B,b)),null,R),j&&N.dispose(),N}}u.once=o;function f(y,F){return E((B,R=null,j)=>y(N=>B.call(R,F(N)),null,j))}u.map=f;function l(y,F){return E((B,R=null,j)=>y(N=>{F(N),B.call(R,N)},null,j))}u.forEach=l;function h(y,F){return E((B,R=null,j)=>y(N=>F(N)&&B.call(R,N),null,j))}u.filter=h;function a(y){return y}u.signal=a;function s(...y){return(F,B=null,R)=>Object($.e)(...y.map(j=>j(N=>F.call(B,N),null,R)))}u.any=s;function A(y,F,B){let R=B;return f(y,j=>(R=F(R,j),R))}u.reduce=A;function E(y){let F;const B=new n({onFirstListenerAdd(){F=y(B.fire,B)},onLastListenerRemove(){F.dispose()}});return B.event}function S(y,F,B=100,R=!1,j){let N,b,Y,ee=0;const ae=new n({leakWarningThreshold:j,onFirstListenerAdd(){N=y(ue=>{ee++,b=F(b,ue),R&&!Y&&(ae.fire(b),b=void 0),clearTimeout(Y),Y=setTimeout(()=>{const Oe=b;b=void 0,Y=void 0,(!R||ee>1)&&ae.fire(Oe),ee=0},B)})},onLastListenerRemove(){N.dispose()}});return ae.event}u.debounce=S;function L(y,F=(B,R)=>B===R){let B=!0,R;return h(y,j=>{const N=B||!F(j,R);return B=!1,R=j,N})}u.latch=L;function O(y,F){return[u.filter(y,F),u.filter(y,B=>!F(B))]}u.split=O;function C(y,F=!1,B=[]){let R=B.slice(),j=y(Y=>{R?R.push(Y):b.fire(Y)});const N=()=>{R&&R.forEach(Y=>b.fire(Y)),R=null},b=new n({onFirstListenerAdd(){j||(j=y(Y=>b.fire(Y)))},onFirstListenerDidAdd(){R&&(F?setTimeout(N):N())},onLastListenerRemove(){j&&j.dispose(),j=null}});return b.event}u.buffer=C;class T{constructor(y){this.event=y}map(y){return new T(f(this.event,y))}forEach(y){return new T(l(this.event,y))}filter(y){return new T(h(this.event,y))}reduce(y,F){return new T(A(this.event,y,F))}latch(){return new T(L(this.event))}debounce(y,F=100,B=!1,R){return new T(S(this.event,y,F,B,R))}on(y,F,B){return this.event(y,F,B)}once(y,F,B){return o(this.event)(y,F,B)}}function x(y){return new T(y)}u.chain=x;function c(y,F,B=R=>R){const R=(...Y)=>b.fire(B(...Y)),j=()=>y.on(F,R),N=()=>y.removeListener(F,R),b=new n({onFirstListenerAdd:j,onLastListenerRemove:N});return b.event}u.fromNodeEventEmitter=c;function w(y,F,B=R=>R){const R=(...Y)=>b.fire(B(...Y)),j=()=>y.addEventListener(F,R),N=()=>y.removeEventListener(F,R),b=new n({onFirstListenerAdd:j,onLastListenerRemove:N});return b.event}u.fromDOMEventEmitter=w;function v(y){return new Promise(F=>o(y)(F))}u.toPromise=v})(U||(U={}));class k{constructor(u){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${u}_${k._idPool++}`}start(u){this._stopWatch=new X.a(!0),this._listenerCount=u}stop(){if(this._stopWatch){const u=this._stopWatch.elapsed();this._elapsedOverall+=u,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${u.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 W{constructor(u,o=Math.random().toString(18).slice(2,5)){this.customThreshold=u,this.name=o,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(u){let o=G;if(typeof this.customThreshold=="number"&&(o=this.customThreshold),o<=0||u<o)return;this._stacks||(this._stacks=new Map);const f=new Error().stack.split(`
|
|
`).slice(3).join(`
|
|
`),l=this._stacks.get(f)||0;if(this._stacks.set(f,l+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=o*.5;let h,a=0;for(const[s,A]of this._stacks)(!h||a<A)&&(h=s,a=A);console.warn(`[${this.name}] potential listener LEAK detected, having ${u} listeners already. MOST frequent listener (${a}):`),console.warn(h)}return()=>{const h=this._stacks.get(f)||0;this._stacks.set(f,h-1)}}}class n{constructor(u){var o;this._disposed=!1,this._options=u,this._leakageMon=G>0?new W(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=(u,o,f)=>{var l;this._listeners||(this._listeners=new P.a);const h=this._listeners.isEmpty();h&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const a=this._listeners.push(o?[u,o]:u);h&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,u,o);const s=(l=this._leakageMon)===null||l===void 0?void 0:l.check(this._listeners.size),A=Object($.i)(()=>{if(s&&s(),!this._disposed&&(a(),this._options&&this._options.onLastListenerRemove)){const E=this._listeners&&!this._listeners.isEmpty();E||this._options.onLastListenerRemove(this)}});return f instanceof $.b?f.add(A):Array.isArray(f)&&f.push(A),A}),this._event}fire(u){var o,f;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new P.a);for(let l of this._listeners)this._deliveryQueue.push([l,u]);for((o=this._perfMon)===null||o===void 0||o.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[l,h]=this._deliveryQueue.shift();try{typeof l=="function"?l.call(void 0,h):l[0].call(l[1],h)}catch(a){Object(re.f)(a)}}(f=this._perfMon)===null||f===void 0||f.stop()}}dispose(){var u,o,f,l,h;this._disposed||(this._disposed=!0,(u=this._listeners)===null||u===void 0||u.clear(),(o=this._deliveryQueue)===null||o===void 0||o.clear(),(l=(f=this._options)===null||f===void 0?void 0:f.onLastListenerRemove)===null||l===void 0||l.call(f),(h=this._leakageMon)===null||h===void 0||h.dispose())}}class D extends n{constructor(u){super(u);this._isPaused=0,this._eventQueue=new P.a,this._mergeFn=u==null?void 0:u.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const u=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(u))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(u){this._listeners&&(this._isPaused!==0?this._eventQueue.push(u):super.fire(u))}}class g extends D{constructor(u){var o;super(u);this._delay=(o=u.delay)!==null&&o!==void 0?o:100}fire(u){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(u)}}class p{constructor(){this.buffers=[]}wrapEvent(u){return(o,f,l)=>u(h=>{const a=this.buffers[this.buffers.length-1];a?a.push(()=>o.call(f,h)):o.call(f,h)},void 0,l)}bufferEvents(u){const o=[];this.buffers.push(o);const f=u();return this.buffers.pop(),o.forEach(l=>l()),f}}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(u){this.inputEvent=u,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=u(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 f}),Z.d(be,"i",function(){return s}),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,W=!1,n=!1,D=!1,g=!1,p,m=X,u,o;const f=typeof self=="object"?self:typeof re=="object"?re:{};let l;typeof f.vscode!="undefined"&&typeof f.vscode.process!="undefined"?l=f.vscode.process:typeof $!="undefined"&&(l=$);const h=typeof((P=l==null?void 0:l.versions)===null||P===void 0?void 0:P.electron)=="string"&&l.type==="renderer";if(typeof navigator=="object"&&!h)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",W=G&&!!l.env.SNAP&&!!l.env.SNAP_REVISION,p=X,m=X;const y=l.env.VSCODE_NLS_CONFIG;if(y)try{const F=JSON.parse(y),B=F.availableLanguages["*"];p=F.locale,m=B||X,u=F._translationsConfigFile}catch(F){}n=!0}else console.error("Unable to resolve platform.");let a=0;k?a=1:U?a=3:G&&(a=2);const s=U,A=k,E=G,S=n,L=D,O=g,C=o,T=function(){if(f.setImmediate)return f.setImmediate.bind(f);if(typeof f.postMessage=="function"&&!f.importScripts){let B=[];f.addEventListener("message",j=>{if(j.data&&j.data.vscodeSetImmediateId)for(let N=0,b=B.length;N<b;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}),f.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 c=!0,w=!1;function v(){if(!w){w=!0;const y=new Uint8Array(2);y[0]=1,y[1]=2;const F=new Uint16Array(y.buffer);c=F[0]===(2<<8)+1}return c}}).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 W}),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 u}),Z.d(be,"u",function(){return o}),Z.d(be,"x",function(){return f}),Z.d(be,"I",function(){return l}),Z.d(be,"f",function(){return h}),Z.d(be,"h",function(){return a}),Z.d(be,"g",function(){return s}),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 c}),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 b}),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 Oe}),Z.d(be,"D",function(){return Ee}),Z.d(be,"B",function(){return xe}),Z.d(be,"b",function(){return Ae}),Z.d(be,"S",function(){return Re}),Z.d(be,"o",function(){return pe}),Z.d(be,"P",function(){return he}),Z.d(be,"w",function(){return ke}),Z.d(be,"c",function(){return et}),Z.d(be,"y",function(){return at});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,Se){const Ge=parseInt(Se,10);return isNaN(Ge)||Ge<0||Ge>=_e.length?Te:_e[Ge]})}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 W(Te,_e)}function G(se,_e){if(!se||!_e)return se;const Te=_e.length;if(Te===0||se.length===0)return se;let Se=0;for(;se.indexOf(_e,Se)===Se;)Se=Se+Te;return se.substring(Se)}function W(se,_e){if(!se||!_e)return se;const Te=_e.length,Se=se.length;if(Te===0||Se===0)return se;let Ge=Se,Ne=-1;for(;!(Ne=se.lastIndexOf(_e,Ge-1),Ne===-1||Ne+Te!==Ge);){if(Ne===0)return"";Ge=Ne}return se.substring(0,Ge)}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 Se="";return Te.global&&(Se+="g"),Te.matchCase||(Se+="i"),Te.multiline&&(Se+="m"),Te.unicode&&(Se+="u"),new RegExp(se,Se)}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 u(se){return se.split(/\r\n|\r|\n/)}function o(se){for(let _e=0,Te=se.length;_e<Te;_e++){const Se=se.charCodeAt(_e);if(Se!==32&&Se!==9)return _e}return-1}function f(se,_e=0,Te=se.length){for(let Se=_e;Se<Te;Se++){const Ge=se.charCodeAt(Se);if(Ge!==32&&Ge!==9)return se.substring(_e,Se)}return se.substring(_e,Te)}function l(se,_e=se.length-1){for(let Te=_e;Te>=0;Te--){const Se=se.charCodeAt(Te);if(Se!==32&&Se!==9)return Te}return-1}function h(se,_e){return se<_e?-1:se>_e?1:0}function a(se,_e,Te=0,Se=se.length,Ge=0,Ne=_e.length){for(;Te<Se&&Ge<Ne;Te++,Ge++){let Je=se.charCodeAt(Te),Ve=_e.charCodeAt(Ge);if(Je<Ve)return-1;if(Je>Ve)return 1}const Fe=Se-Te,Ke=Ne-Ge;return Fe<Ke?-1:Fe>Ke?1:0}function s(se,_e){return A(se,_e,0,se.length,0,_e.length)}function A(se,_e,Te=0,Se=se.length,Ge=0,Ne=_e.length){for(;Te<Se&&Ge<Ne;Te++,Ge++){let Je=se.charCodeAt(Te),Ve=_e.charCodeAt(Ge);if(Je===Ve)continue;if(Je>=128||Ve>=128)return a(se.toLowerCase(),_e.toLowerCase(),Te,Se,Ge,Ne);E(Je)&&(Je-=32),E(Ve)&&(Ve-=32);const tt=Je-Ve;if(tt===0)continue;return tt}const Fe=Se-Te,Ke=Ne-Ge;return Fe<Ke?-1:Fe>Ke?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,Se=Math.min(se.length,_e.length);for(Te=0;Te<Se;Te++)if(se.charCodeAt(Te)!==_e.charCodeAt(Te))return Te;return Se}function T(se,_e){let Te,Se=Math.min(se.length,_e.length);const Ge=se.length-1,Ne=_e.length-1;for(Te=0;Te<Se;Te++)if(se.charCodeAt(Ge-Te)!==_e.charCodeAt(Ne-Te))return Te;return Se}function x(se){return 55296<=se&&se<=56319}function c(se){return 56320<=se&&se<=57343}function w(se,_e){return(se-55296<<10)+(_e-56320)+65536}function v(se,_e,Te){const Se=se.charCodeAt(Te);if(x(Se)&&Te+1<_e){const Ge=se.charCodeAt(Te+1);if(c(Ge))return w(Se,Ge)}return Se}function y(se,_e){const Te=se.charCodeAt(_e-1);if(c(Te)&&_e>1){const Se=se.charCodeAt(_e-2);if(x(Se))return w(Se,Te)}return Te}function F(se,_e){const Te=We.getInstance(),Se=_e,Ge=se.length,Ne=v(se,Ge,_e);_e+=Ne>=65536?2:1;let Fe=Te.getGraphemeBreakType(Ne);for(;_e<Ge;){const Ke=v(se,Ge,_e),Je=Te.getGraphemeBreakType(Ke);if(et(Fe,Je))break;_e+=Ke>=65536?2:1,Fe=Je}return _e-Se}function B(se,_e){const Te=We.getInstance(),Se=_e,Ge=y(se,_e);_e-=Ge>=65536?2:1;let Ne=Te.getGraphemeBreakType(Ge);for(;_e>0;){const Fe=y(se,_e),Ke=Te.getGraphemeBreakType(Fe);if(et(Ke,Ne))break;_e-=Fe>=65536?2:1,Ne=Ke}return Se-_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 b(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 Oe(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 Ae=String.fromCharCode(65279);function Re(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 he(se){const _e=90-65+1;return se=se%(2*_e),se<_e?String.fromCharCode(97+se):String.fromCharCode(65+se-_e)}function ke(se){const _e=We.getInstance();return _e.getGraphemeBreakType(se)}function et(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=nt()}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 Se=1;for(;Se<=Te;)if(se<_e[3*Se])Se=2*Se;else if(se>_e[3*Se+1])Se=2*Se+1;else return _e[3*Se+2];return 0}}We._INSTANCE=null;function nt(){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 at(se,_e){if(se===0)return 0;const Te=Pe(se,_e);if(Te!==void 0)return Te;const Se=y(_e,se);return se-=je(Se),se}function Pe(se,_e){let Te=y(_e,se);for(se-=je(Te);$e(Te)||Te===65039||Te===8419;){if(se===0)return;Te=y(_e,se),se-=je(Te)}if(!xe(Te))return;if(se>=0){const Se=y(_e,se);Se===8205&&(se-=je(Se))}return se}function je(se){return se>=65536?2:1}function $e(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"),W=Z("jrin"),n=Z("WmNS"),D=Z.n(n),g=Z("q1tI"),p=Z.n(g),m=Z("VrN/"),u=Z.n(m),o=Z("bdgK"),f=Z("p77/"),l=Z("Bd2K"),h=Z("ELLl"),a=Z("19Vz"),s=Z("lZu9"),A=Z("+NIl"),E=Z("kSUc"),S=Z("9Bee"),L=function(ye){var Le=ye.value,Ue=Le===void 0?"":Le,Ze=ye.className,mt=ye.showTextOnly,ft=ye.showLines,Ct=ye.style,xt=Ct===void 0?{}:Ct,Qe=Object(g.useMemo)(function(){return""},[Ue]);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"),c=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,Ue=ye.title,Ze=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:Ue,className:Ct,onClick:Qe},p.a.createElement("i",{className:"md-iconfont ".concat(Ze)}),xt)}var y=function(ye){var Le=ye.watch,Ue=ye.showNullButton,Ze=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(c.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:Ze})):p.a.createElement("span",{className:"v-line"}))}),Ue?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:Ze},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:Ze},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:Ze})))},F=Z("M8RZ"),B=Z("+L6B"),R=Z("2/Rp"),j=Z("y8nQ"),N=Z("Vl3Y"),b=Z("5NDa"),Y=Z("5rEg"),ee={labelCol:{span:4},wrapperCol:{span:20}},ae=function(ye){var Le=ye.callback,Ue=ye.onCancel;function Ze(mt){Le(mt)}return p.a.createElement(N.a,Object(O.a)({},ee,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Ze}),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:Ue},"\u53D6\u6D88")))},ue=Z("7ahc"),Oe=Z("HmJG"),Ee=Z("BjJ7"),xe=N.a.useForm,Ae={width:280,marginRight:10},Re={labelCol:{span:5},wrapperCol:{span:19}},pe=function(ye){var Le=ye.callback,Ue=ye.onCancel,Ze=xe(),mt=Object(G.a)(Ze,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];ke(vt,xt)}return p.a.createElement(N.a,Object(O.a)({form:ft},Re,{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:Ae})),p.a.createElement(he,{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:Ue},"\u53D6\u6D88")))};function he(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 ke(ye,Le){if(!ye)throw new String("\u6CA1\u6709\u6587\u4EF6");var Ue=new FormData;Ue.append("editormd-image-file",ye),Ue.append("file_param_name","editormd-image-file"),Ue.append("byxhr","true");var Ze=new window.XMLHttpRequest;Ze.withCredentials=!0,Ze.addEventListener("load",function(mt){Le(JSON.parse(mt.target.responseText),ye)},!1),Ze.addEventListener("error",function(mt){console.error(mt)},!1),Ze.open("POST","".concat(Ee.a,"/api/attachments.json")),Ze.send(Ue)}var et=Z("giR+"),We=Z("fyUT"),nt=Z("7Kak"),at=Z("9yH6"),Pe=at.a.Group,je={margin:"0 8px"},$e=function(ye){var Le=ye.callback,Ue=ye.onCancel;function Ze(mt){Le(mt)}return p.a.createElement(N.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Ze},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(at.a,{value:"default"},p.a.createElement("i",{className:"fa fa-align-justify"})),p.a.createElement(at.a,{value:"left"},p.a.createElement("i",{className:"fa fa-align-left"})),p.a.createElement(at.a,{value:"center"},p.a.createElement("i",{className:"fa fa-align-center"})),p.a.createElement(at.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:Ue},"\u53D6\u6D88")))},se=Z("ErOA"),_e=Z("7Cbv"),Te="link",Se="upload-image",Ge="code-block",Ne="add-table",Fe="------------",Ke={default:Fe,left:":".concat(Fe),center:":".concat(Fe,":"),right:"".concat(Fe,":")},Je=Z("9VGf"),Ve,tt;function Ie(){}var it=0,st=1e4,De="\u2581",Me=`
|
|
**\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=(Ve={},Object(W.a)(Ve,fe+"-B","bold"),Object(W.a)(Ve,fe+"-I","italic"),Ve),oe=(tt={},Object(W.a)(tt,Te,"\u6DFB\u52A0\u94FE\u63A5"),Object(W.a)(tt,Ge,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(W.a)(tt,Se,"\u6DFB\u52A0\u6587\u4EF6"),Object(W.a)(tt,Ne,"\u6DFB\u52A0\u8868\u683C"),tt),le=be.a=function(ye){var Le=ye.defaultValue,Ue=Le===void 0?"":Le,Ze=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),H=I[0],q=I[1],z=Object(g.useState)(Ue),ge=Object(G.a)(z,2),He=ge[0],rt=ge[1],gt=Object(g.useState)(Pt),ze=Object(G.a)(gt,2),wt=ze[0],zt=ze[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:",H,jt),Bt.attachments.map(function(Gt){Gt.content_type.indexOf("image")>-1?H.replaceSelection(".concat(Gt.content_type,")")):Gt.content_type.indexOf("video")>-1?H.replaceSelection('<video width="100%" controls src="'.concat(c.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):Gt.content_type.indexOf("pdf")>-1?H.replaceSelection('<a href="'.concat(c.a.API_SERVER,"/api/attachments/").concat(Gt.id,"?type=").concat(Gt.content_type,'&disposition=inline" target="_blank">').concat(Gt.name,"</a>")):H.replaceSelection("[".concat(Gt.name,"](").concat(c.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(){rt(V),H==null||H.setValue(V)},[V]),Object(g.useEffect)(function(){dn==null||dn(An)},[An]),Object(g.useEffect)(function(){if(jt.current){var yt=u.a.fromTextArea(jt.current,{mode:sn,lineNumbers:!Lt,lineWrapping:!0,value:Ue,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();ke(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(c.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(c.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(c.a.API_SERVER,"/api/attachments/").concat(Xt.id,'?type=office&disposition=inline" target="_blank">').concat(Ht.name,"</a>")):yt.replaceSelection("[".concat(Ht.name,"](").concat(c.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();ke(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(c.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(c.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(c.a.API_SERVER,"/api/attachments/").concat(Xt.id,'?type=office&disposition=inline" target="_blank">').concat(Ht.name,"</a>")):yt.replaceSelection("[".concat(Ht.name,"](").concat(c.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(),H.setSize("100%","100%"),H.refresh())}}catch(gn){Kt.e(gn)}finally{Kt.f()}});return St.observe(jt.current.parentElement),St}if(H){var kt=yt();return function(){kt.unobserve(jt.current.parentElement)}}},[H,Dn]),Object(g.useEffect)(function(){if(H){for(var yt=[],kt=function(){var Gt=Bt[St];Kt=Object(G.a)(Gt,2);var gn=Kt[0],Pn=Kt[1],Ht=Object(W.a)({},gn,function(){Xi(Pn)});yt.push(Ht),H.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;H.removeKeyMap(gn)}}catch(Pn){Zt.e(Pn)}finally{Zt.f()}}}},[H]),Object(g.useEffect)(function(){Mt!==An&&Rn(Mt)},[Mt]),Object(Je.a)(function(){if(!nn&&Gn>0){var yt=new Date().getTime(),kt=window.sessionStorage.getItem(tn);yt>=Gn+st&&(!kt||kt!==He)&&(window.sessionStorage.setItem(tn,He),Ei(!0))}},st),Object(g.useEffect)(function(){zt(Pt)},[H,Pt]),Object(g.useEffect)(function(){H&&(Ft&&H.focus())},[H,Ft]),Object(g.useEffect)(function(){if(wt&&H){var yt=H.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)}}},[H,wt]),Object(g.useEffect)(function(){if(H&&Ut){function yt(kt,St){Ut(kt,St)}return H.on("beforeChange",yt),function(){H.off("beforeChange",yt)}}},[H,Ut]),Object(g.useEffect)(function(){if(H&&Dt){function yt(){Dt(H.getValue())}return H.on("blur",yt),function(){H.off("blur",yt)}}},[H,Dt]),Object(g.useEffect)(function(){if(H){function yt(kt){var St=kt.getValue();rt(St),ki(new Date().getTime()),kt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Ze&&Ze(St)}return H.on("change",yt),function(){H.off("change",yt)}}},[H,Ze]),Object(g.useEffect)(function(){H&&(Ue==null?(H.setValue(""),rt("")):Ue!==H.getValue()&&(H.setValue(Ue),rt(Ue),H.setCursor(H.lineCount(),0)))},[H,Ue]);var Xi=Object(g.useCallback)(function(yt){var kt=H.getCursor(),St=H.getSelection(),Bt=St.split(`
|
|
`);switch(yt){case"bold":return H.replaceSelection("**"+St+"**"),St===""&&H.setCursor(kt.line,kt.ch+2),H.focus();case"italic":return H.replaceSelection("*"+St+"*"),St===""&&H.setCursor(kt.line,kt.ch+1),H.focus();case"code":return H.replaceSelection("`"+St+"`"),St===""&&H.setCursor(kt.line,kt.ch+1),H.focus();case"inline-latex":return H.replaceSelection("`$$"+St+"$$`"),St===""&&H.setCursor(kt.line,kt.ch+3),H.focus();case"latex":return H.replaceSelection("```latex\n"+St+"\n```"),H.setCursor(kt.line+1,St.length+1),H.focus();case"line-break":return H.replaceSelection(`<br/>
|
|
`),H.focus();case"list-ul":return St===""?H.replaceSelection("- "+St):H.replaceSelection(Bt.map(function(Kt){return Kt===""?"":"- ".concat(Kt)}).join(`
|
|
`)),H.focus();case"list-ol":return St===""?H.replaceSelection("1. "+St):H.replaceSelection(Bt.map(function(Kt,Zt){return Kt===""?"":"".concat(Zt+1,". ").concat(Kt)}).join(`
|
|
`)),H.focus();case"add-null-ch":return St===""&&H.setCursor(kt.line,kt.ch+1),H.replaceSelection(De),H.focus();case"inster-template-1":return St===""&&H.setCursor(kt.line,kt.ch),H.replaceSelection(Me),H.focus();case"eraser":return H.setValue(""),H.focus();case"trigger-watch":return zt(!wt),H.focus();case"trigger-full-screen":return Rn(!An),H.focus();case Te:Vn(Te);return;case Ge:Vn(Ge);return;case Se:Vn(Se);return;case Ne:Vn(Ne);return;default:throw new Error}},[H,wt,An]),xi=Object(g.useCallback)(function(yt){Vn("");switch(yn){case Te:var kt=yt.title,St=yt.link;return H.replaceSelection("[".concat(kt,"](").concat(St,")")),H.focus();case Ge:var Bt=yt.language,Kt=yt.content;return H.replaceSelection(["```"+Bt,Kt,"```"].join(`
|
|
`)),H.focus();case Se:var Zt=yt.src,Gt=yt.alt;return Gt?H.replaceSelection(".concat(Zt,' "').concat(Gt,'" )')):H.replaceSelection("")),H.focus();case Ne: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(Ke[Ht]),Nn.push(" ");Xt===1&&(di+="| ".concat(On.join(" | "),` |
|
|
`)),di+="| ".concat(Nn.join(Pn===1?"":" | "),` |
|
|
`)}return H.replaceSelection(di+`
|
|
`),H.focus();default:throw new Error}},[H,yn]),cr=Object(g.useMemo)(function(){switch(yn){case Te:return p.a.createElement(ae,{callback:xi,onCancel:Ti});case Ge:return p.a.createElement(ue.b,{callback:xi,onCancel:Ti});case Se:return p.a.createElement(pe,{callback:xi,onCancel:Ti});case Ne:return p.a.createElement($e,{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)}}},[H,$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),H.setValue(window.sessionStorage.getItem(tn))}function ua(yt,kt){var St=H.getValue();St=St.replace(yt,kt),rt(St),H==null||H.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(y,{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 W=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"],u=[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",f=[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",h=[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"],a=[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"],s=[n,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],A=[p,u,m,f,l,h,a,s],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",c="pln",w="tag",v="dec",y="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,$e=!1,se=!1,_e=0,Te=Pe.length;_e<Te;++_e){var Se=Pe[_e];if(Se.ignoreCase)se=!0;else if(/[a-z]/i.test(Se.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){$e=!0,se=!1;break}}var Ge={b:8,t:9,n:10,v:11,f:12,r:13};function Ne(tt){var Ie=tt.charCodeAt(0);if(Ie!==92)return Ie;var it=tt.charAt(1);return Ie=Ge[it],Ie||("0"<=it&&it<="7"?parseInt(tt.substring(1),8):it==="u"||it==="x"?parseInt(tt.substring(2),16):tt.charCodeAt(1))}function Fe(tt){if(tt<32)return(tt<16?"\\x0":"\\x")+tt.toString(16);var Ie=String.fromCharCode(tt);return Ie==="\\"||Ie==="-"||Ie==="]"||Ie==="^"?"\\"+Ie:Ie}function Ke(tt){var Ie=tt.substring(1,tt.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")),it=[],st=Ie[0]==="^",De=["["];st&&De.push("^");for(var Me=st?1:0,ve=Ie.length;Me<ve;++Me){var ce=Ie[Me];if(/\\[bdsw]/i.test(ce))De.push(ce);else{var fe=Ne(ce),ie;Me+2<ve&&Ie[Me+1]==="-"?(ie=Ne(Ie[Me+2]),Me+=2):ie=fe,it.push([fe,ie]),ie<65||fe>122||(ie<65||fe>90||it.push([Math.max(65,fe)|32,Math.min(ie,90)|32]),ie<97||fe>122||it.push([Math.max(97,fe)&~32,Math.min(ie,122)&~32]))}}it.sort(function(ye,Le){return ye[0]-Le[0]||Le[1]-ye[1]});for(var ne=[],oe=[],Me=0;Me<it.length;++Me){var le=it[Me];le[0]<=oe[1]+1?oe[1]=Math.max(oe[1],le[1]):ne.push(oe=le)}for(var Me=0;Me<ne.length;++Me){var le=ne[Me];De.push(Fe(le[0])),le[1]>le[0]&&(le[1]+1>le[0]&&De.push("-"),De.push(Fe(le[1])))}return De.push("]"),De.join("")}function Je(tt){for(var Ie=tt.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")),it=Ie.length,st=[],De=0,Me=0;De<it;++De){var ve=Ie[De];if(ve==="(")++Me;else if(ve.charAt(0)==="\\"){var ce=+ve.substring(1);ce&&(ce<=Me?st[ce]=-1:Ie[De]=Fe(ce))}}for(var De=1;De<st.length;++De)st[De]===-1&&(st[De]=++je);for(var De=0,Me=0;De<it;++De){var ve=Ie[De];if(ve==="(")++Me,st[Me]||(Ie[De]="(?:");else if(ve.charAt(0)==="\\"){var ce=+ve.substring(1);ce&&ce<=Me&&(Ie[De]="\\"+st[ce])}}for(var De=0;De<it;++De)Ie[De]==="^"&&Ie[De+1]!=="^"&&(Ie[De]="");if(tt.ignoreCase&&$e)for(var De=0;De<it;++De){var ve=Ie[De],fe=ve.charAt(0);ve.length>=2&&fe==="["?Ie[De]=Ke(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 Ve=[],_e=0,Te=Pe.length;_e<Te;++_e){var Se=Pe[_e];if(Se.global||Se.multiline)throw new Error(""+Se);Ve.push("(?:"+Je(Se)+")")}return new RegExp(Ve.join("|"),se?"gi":"g")}function b(Pe,je){var $e=/(?:^|\s)nocode(?:\s|$)/,se=[],_e=0,Te=[],Se=0;function Ge(Ne){var Fe=Ne.nodeType;if(Fe==1){if($e.test(Ne.className))return;for(var Ke=Ne.firstChild;Ke;Ke=Ke.nextSibling)Ge(Ke);var Je=Ne.nodeName.toLowerCase();(Je==="br"||Je==="li")&&(se[Se]=`
|
|
`,Te[Se<<1]=_e++,Te[Se++<<1|1]=Ne)}else if(Fe==3||Fe==4){var Ve=Ne.nodeValue;Ve.length&&(je?Ve=Ve.replace(/\r\n?/g,`
|
|
`):Ve=Ve.replace(/[ \t\r\n]+/g," "),se[Se]=Ve,Te[Se<<1]=_e,_e+=Ve.length,Te[Se++<<1|1]=Ne)}}return Ge(Pe),{sourceCode:se.join("").replace(/\n$/,""),spans:Te}}function Y(Pe,je,$e,se,_e){if(!$e)return;var Te={sourceNode:Pe,pre:1,langExtension:null,numberLines:null,sourceCode:$e,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,$e=Pe.firstChild;$e;$e=$e.nextSibling){var se=$e.nodeType;je=se===1?je?Pe:$e:se===3&&ee.test($e.nodeValue)?Pe:je}return je===Pe?void 0:je}function ue(Pe,je){var $e={},se;(function(){for(var Se=Pe.concat(je),Ge=[],Ne={},Fe=0,Ke=Se.length;Fe<Ke;++Fe){var Je=Se[Fe],Ve=Je[3];if(Ve)for(var tt=Ve.length;--tt>=0;)$e[Ve.charAt(tt)]=Je;var Ie=Je[1],it=""+Ie;Ne.hasOwnProperty(it)||(Ge.push(Ie),Ne[it]=null)}Ge.push(/[\0-\uffff]/),se=N(Ge)})();var _e=je.length,Te=function(Se){for(var Ge=Se.sourceCode,Ne=Se.basePos,Fe=Se.sourceNode,Ke=[Ne,c],Je=0,Ve=Ge.match(se)||[],tt={},Ie=0,it=Ve.length;Ie<it;++Ie){var st=Ve[Ie],De=tt[st],Me=void 0,ve;if(typeof De=="string")ve=!1;else{var ce=$e[st.charAt(0)];if(ce)Me=st.match(ce[1]),De=ce[0];else{for(var fe=0;fe<_e;++fe)if(ce=je[fe],Me=st.match(ce[1]),Me){De=ce[0];break}Me||(De=c)}ve=De.length>=5&&De.substring(0,5)==="lang-",ve&&!(Me&&typeof Me[1]=="string")&&(ve=!1,De=y),ve||(tt[st]=De)}var ie=Je;if(Je+=st.length,!ve)Ke.push(Ne+ie,De);else{var ne=Me[1],oe=st.indexOf(ne),le=oe+ne.length;Me[2]&&(le=st.length-Me[2].length,oe=le-ne.length);var ye=De.substring(5);Y(Fe,Ne+ie,st.substring(0,oe),Te,Ke),Y(Fe,Ne+ie+oe,ne,he(ye,ne),Ke),Y(Fe,Ne+ie+le,st.substring(le),Te,Ke)}}Se.decorations=Ke};return Te}function Oe(Pe){var je=[],$e=[];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&&$e.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,"#"]),$e.push([S,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):je.push([O,/^#[^\r\n]*/,null,"#"])),Pe.cStyleComments&&($e.push([O,/^\/\/[^\r\n]*/,null]),$e.push([O,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var _e=Pe.regexLiterals;if(_e){var Te=_e>1?"":`
|
|
\r`,Se=Te?".":"[\\S\\s]",Ge="/(?=[^/*"+Te+"])(?:[^/\\x5B\\x5C"+Te+"]|\\x5C"+Se+"|\\x5B(?:[^\\x5C\\x5D"+Te+"]|\\x5C"+Se+")*(?:\\x5D|$))+/";$e.push(["lang-regex",RegExp("^"+j+"("+Ge+")")])}var Ne=Pe.types;Ne&&$e.push([C,Ne]);var Fe=(""+Pe.keywords).replace(/^ | $/g,"");Fe.length&&$e.push([L,new RegExp("^(?:"+Fe.replace(/[\s,]+/g,"|")+")\\b"),null]),je.push([c,/^\s+/,null,` \r
|
|
\xA0`]);var Ke="^.[^\\s\\w.$@'\"`/\\\\]*";return Pe.regexLiterals&&(Ke+="(?!s*/)"),$e.push([T,/^@[a-z_$][a-z_$@0-9]*/i,null],[C,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[c,/^[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"],[c,/^\\[\s\S]?/,null],[x,new RegExp(Ke),null]),ue(je,$e)}var Ee=Oe({keywords:A,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function xe(Pe,je,$e){for(var se=/(?:^|\s)nocode(?:\s|$)/,_e=/\r\n?|\n/,Te=Pe.ownerDocument,Se=Te.createElement("li");Pe.firstChild;)Se.appendChild(Pe.firstChild);var Ge=[Se];function Ne(Ie){var it=Ie.nodeType;if(it==1&&!se.test(Ie.className))if(Ie.nodeName==="br")Fe(Ie),Ie.parentNode&&Ie.parentNode.removeChild(Ie);else for(var st=Ie.firstChild;st;st=st.nextSibling)Ne(st);else if((it==3||it==4)&&$e){var De=Ie.nodeValue,Me=De.match(_e);if(Me){var ve=De.substring(0,Me.index);Ie.nodeValue=ve;var ce=De.substring(Me.index+Me[0].length);if(ce){var fe=Ie.parentNode;fe.insertBefore(Te.createTextNode(ce),Ie.nextSibling)}Fe(Ie),ve||Ie.parentNode.removeChild(Ie)}}}function Fe(Ie){for(;!Ie.nextSibling;)if(Ie=Ie.parentNode,!Ie)return;function it(Me,ve){var ce=ve?Me.cloneNode(!1):Me,fe=Me.parentNode;if(fe){var ie=it(fe,1),ne=Me.nextSibling;ie.appendChild(ce);for(var oe=ne;oe;oe=ne)ne=oe.nextSibling,ie.appendChild(oe)}return ce}for(var st=it(Ie.nextSibling,0),De;(De=st.parentNode)&&De.nodeType===1;)st=De;Ge.push(st)}for(var Ke=0;Ke<Ge.length;++Ke)Ne(Ge[Ke]);je===(je|0)&&Ge[0].setAttribute("value",je);var Je=Te.createElement("ol");Je.className="linenums";for(var Ve=Math.max(0,je-1|0)||0,Ke=0,tt=Ge.length;Ke<tt;++Ke)Se=Ge[Ke],Se.className="L"+(Ke+Ve)%10,Se.firstChild||Se.appendChild(Te.createTextNode("\xA0")),Je.appendChild(Se);Pe.appendChild(Je)}function Ae(Pe){var je=/\bMSIE\s(\d+)/.exec(navigator.userAgent);je=je&&+je[1]<=8;var $e=/\n/g,se=Pe.sourceCode,_e=se.length,Te=0,Se=Pe.spans,Ge=Se.length,Ne=0,Fe=Pe.decorations,Ke=Fe.length,Je=0;Fe[Ke]=_e;var Ve,tt;for(tt=Ve=0;tt<Ke;)Fe[tt]!==Fe[tt+2]?(Fe[Ve++]=Fe[tt++],Fe[Ve++]=Fe[tt++]):tt+=2;for(Ke=Ve,tt=Ve=0;tt<Ke;){for(var Ie=Fe[tt],it=Fe[tt+1],st=tt+2;st+2<=Ke&&Fe[st+1]===it;)st+=2;Fe[Ve++]=Ie,Fe[Ve++]=it,tt=st}Ke=Fe.length=Ve;var De=Pe.sourceNode,Me="";De&&(Me=De.style.display,De.style.display="none");try{for(var ve=null;Ne<Ge;){var ce=Se[Ne],fe=Se[Ne+2]||_e,ie=Fe[Je+2]||_e,st=Math.min(fe,ie),ne=Se[Ne+1],oe;if(ne.nodeType!==1&&(oe=se.substring(Te,st))){je&&(oe=oe.replace($e,"\r")),ne.nodeValue=oe;var le=ne.ownerDocument,ye=le.createElement("span");ye.className=Fe[Je+1];var Le=ne.parentNode;Le.replaceChild(ye,ne),ye.appendChild(ne),Te<fe&&(Se[Ne+1]=ne=le.createTextNode(se.substring(st,fe)),Le.insertBefore(ne,ye.nextSibling))}Te=st,Te>=fe&&(Ne+=2),Te>=ie&&(Je+=2)}}finally{De&&(De.style.display=Me)}}var Re={};function pe(Pe,je){for(var $e=je.length;--$e>=0;){var se=je[$e];Re.hasOwnProperty(se)?W.console&&console.warn("cannot override language handler %s",se):Re[se]=Pe}}function he(Pe,je){return Pe&&Re.hasOwnProperty(Pe)||(Pe=/^\s*</.test(je)?"default-markup":"default-code"),Re[Pe]}pe(Ee,["default-code"]),pe(ue([],[[c,/^[^<?]+/],[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([[c,/^[\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(Oe({keywords:p,hashComments:!0,cStyleComments:!0,types:E}),["c","cc","cpp","cxx","cyc","m"]),pe(Oe({keywords:"null,true,false"}),["json"]),pe(Oe({keywords:u,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:E}),["cs"]),pe(Oe({keywords:m,cStyleComments:!0}),["java"]),pe(Oe({keywords:s,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),pe(Oe({keywords:h,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),pe(Oe({keywords:l,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),pe(Oe({keywords:a,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),pe(Oe({keywords:f,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),pe(Oe({keywords:o,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),pe(ue([],[[S,/^[\s\S]+/]]),["regex"]);function ke(Pe){var je=Pe.langExtension;try{var $e=b(Pe.sourceNode,Pe.pre),se=$e.sourceCode;Pe.sourceCode=se,Pe.spans=$e.spans,Pe.basePos=0,he(je,se)(Pe),Ae(Pe)}catch(_e){W.console&&console.log(_e&&_e.stack||_e)}}function et(Pe,je,$e){var se=$e||!1,_e=je||null,Te=document.createElement("div");Te.innerHTML="<pre>"+Pe+"</pre>",Te=Te.firstChild,se&&xe(Te,se,!0);var Se={langExtension:_e,numberLines:se,sourceNode:Te,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return ke(Se),Te.innerHTML}function We(Pe,je){var $e=je||document.body,se=$e.ownerDocument||document;function _e(ce){return $e.getElementsByTagName(ce)}for(var Te=[_e("pre"),_e("code"),_e("xmp")],Se=[],Ge=0;Ge<Te.length;++Ge)for(var Ne=0,Fe=Te[Ge].length;Ne<Fe;++Ne)Se.push(Te[Ge][Ne]);Te=null;var Ke=Date;Ke.now||(Ke={now:function(){return+new Date}});var Je=0,Ve=/\blang(?:uage)?-([\w.]+)(?!\S)/,tt=/\bprettyprint\b/,Ie=/\bprettyprinted\b/,it=/pre|xmp/i,st=/^code$/i,De=/^(?:pre|code|xmp)$/i,Me={};function ve(){for(var ce=W.PR_SHOULD_USE_CONTINUATION?Ke.now()+250:Infinity;Je<Se.length&&Ke.now()<ce;Je++){for(var fe=Se[Je],ie=Me,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!==Me||tt.test(ye))&&!Ie.test(ye)){for(var Le=!1,Ue=fe.parentNode;Ue;Ue=Ue.parentNode){var Ze=Ue.tagName;if(De.test(Ze)&&Ue.className&&tt.test(Ue.className)){Le=!0;break}}if(!Le){fe.className+=" prettyprinted";var mt=ie.lang;if(!mt){mt=ye.match(Ve);var ft;!mt&&(ft=ae(fe))&&st.test(ft.tagName)&&(mt=ft.className.match(Ve)),mt&&(mt=mt[1])}var Ct;if(it.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};ke(Ft)}}}Je<Se.length?W.setTimeout(ve,250):typeof Pe=="function"&&Pe()}ve()}var nt=W.PR={createSimpleLexer:ue,registerLangHandler:pe,sourceDecorator:Oe,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:c,PR_PUNCTUATION:x,PR_SOURCE:y,PR_STRING:S,PR_TAG:w,PR_TYPE:C,prettyPrintOne:P?W.prettyPrintOne=et:k=et,prettyPrint:G=P?W.prettyPrint=We:G=We},at=W.define;typeof at=="function"&&at.amd&&at("google-code-prettify",[],function(){return nt})})()},T8No:function(ht,be,Z){"use strict";Z.d(be,"a",function(){return G}),Z.d(be,"e",function(){return W}),Z.d(be,"c",function(){return x}),Z.d(be,"b",function(){return c}),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(b=>this._deserializeAndExpression(b,j)),null,!0)}static _deserializeAndExpression(R,j){let N=R.split("&&");return C.create(N.map(b=>this._deserializeOne(b,j)),null)}static _deserializeOne(R,j){if(R=R.trim(),R.indexOf("!=")>=0){let N=R.split("!=");return f.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 u.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 a.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("/"),b=R.lastIndexOf("/");if(N===b||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,b),ee=R[b+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 W(R,j){const N=R?R.substituteConstants():void 0,b=j?j.substituteConstants():void 0;return!N&&!b?!0:!N||!b?!1:N.equals(b)}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 b=U.get(R);if(typeof b=="boolean"){const Y=b?"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:y(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=f.create(this.key,this.value,this)),this.negated}}class u{constructor(R,j){this.key=R,this.valueKey=j,this.type=10,this.negated=null}static create(R,j){return new u(R,j)}cmp(R){return R.type!==this.type?this.type-R.type:y(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 f{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 b=U.get(R);if(typeof b=="boolean"){const Y=b?"true":"false";return j===Y?D.INSTANCE:g.INSTANCE}return new f(R,j,N)}cmp(R){return R.type!==this.type?this.type-R.type:y(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 h(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 a{constructor(R,j,N){this.key=R,this.value=j,this.negated=N,this.type=12}static create(R,j,N=null){return h(j,b=>new a(R,b,N))}cmp(R){return R.type!==this.type?this.type-R.type:y(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 s{constructor(R,j,N){this.key=R,this.value=j,this.negated=N,this.type=13}static create(R,j,N=null){return h(j,b=>new s(R,b,N))}cmp(R){return R.type!==this.type?this.type-R.type:y(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 h(j,b=>new A(R,b,N))}cmp(R){return R.type!==this.type?this.type-R.type:y(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 E{constructor(R,j,N){this.key=R,this.value=j,this.negated=N,this.type=15}static create(R,j,N=null){return h(j,b=>new E(R,b,N))}cmp(R){return R.type!==this.type?this.type-R.type:y(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 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,b=R.length;N<b;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 b=n(this.expr[j],R.expr[j]);if(b!==0)return b}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 b=!1;for(const Y of R){if(!Y)continue;if(Y.type===1){b=!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&&b)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(Oe=>C.create([Oe,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 b=n(this.expr[j],R.expr[j]);if(b!==0)return b}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 b=[],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){b=b.concat(ue.expr);continue}b.push(ue)}if(b.length===0&&Y)return D.INSTANCE;b.sort(n)}if(b.length===0)return;if(b.length===1)return b[0];for(let ee=1;ee<b.length;ee++)b[ee-1].equals(b[ee])&&(b.splice(ee,1),ee--);if(b.length===1)return b[0];if(N){for(let ee=0;ee<b.length;ee++)for(let ae=ee+1;ae<b.length;ae++)F(b[ee],b[ae])&&(b.splice(ae,1),ae--);if(b.length===1)return b[0]}return new T(b,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(),b=[];for(const ee of B(j))for(const ae of B(N))b.push(C.create([ee,ae],null));const Y=R.length===0;R.unshift(T.create(b,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 c=Object(P.c)("contextKeyService"),w="setContext";function v(R,j){return R<j?-1:R>j?1:0}function y(R,j,N,b){return R<N?-1:R>N?1:j<b?-1:j>b?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(),b=B(N).concat(B(j));b.sort(n);for(let Y=0;Y<b.length;Y++){const ee=b[Y],ae=ee.negate();for(let ue=Y+1;ue<b.length;ue++){const Oe=b[ue];if(ae.equals(Oe))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 u=this.__items.length-1;u>=0;u--)if(this.__items[u].match(m))return!0;return!1},D.prototype.set_indent=function(m,u){this.is_empty()&&(this.__indent_count=m||0,this.__alignment_count=u||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 u=m.lastIndexOf(`
|
|
`);u!==-1?this.__character_count=m.length-u: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,u){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)),u=u||"",m.indent_level>0&&(u=new Array(m.indent_level+1).join(this.__indent_string)),this.__base_string=u,this.__base_string_length=u.length}g.prototype.get_indent_size=function(m,u){var o=this.__base_string_length;return u=u||0,m<0&&(o=0),o+=m*this.__indent_size,o+=u,o},g.prototype.get_indent_string=function(m,u){var o=this.__base_string;return u=u||0,m<0&&(m=0,o=""),u+=m*this.__indent_size,this.__ensure_cache(u),o+=this.__cache[u],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,u=0,o="";this.__indent_size&&m>=this.__indent_size&&(u=Math.floor(m/this.__indent_size),m-=u*this.__indent_size,o=new Array(u+1).join(this.__indent_string)),m&&(o+=new Array(m+1).join(" ")),this.__cache.push(o)};function p(m,u){this.__indent_cache=new g(m,u),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,u){return this.__indent_cache.get_indent_string(m,u)},p.prototype.get_indent_size=function(m,u){return this.__indent_cache.get_indent_size(m,u)},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 u=this.current_line.pop();u&&(u[u.length-1]===`
|
|
`&&(u=u.replace(/\n+$/g,"")),this.current_line.push(u)),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,u){return m=m||0,u=u||0,this.next_line.set_indent(m,u),this.__lines.length>1?(this.current_line.set_indent(m,u),!0):(this.current_line.set_indent(),!1)},p.prototype.add_raw_token=function(m){for(var u=0;u<m.newlines;u++)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 u=this.__lines.length;m<u;)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,u){for(var o=this.__lines.length-2;o>=0;){var f=this.__lines[o];if(f.is_empty())break;if(f.item(0).indexOf(m)!==0&&f.item(-1)!==u){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,u){this.raw_options=g(m,u),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,u){var o=this.raw_options[m],f=u||[];return typeof o=="object"?o!==null&&typeof o.concat=="function"&&(f=o.concat()):typeof o=="string"&&(f=o.split(/[^a-zA-Z0-9_\/\-]+/)),f},D.prototype._get_boolean=function(m,u){var o=this.raw_options[m],f=o===void 0?!!u:!!o;return f},D.prototype._get_characters=function(m,u){var o=this.raw_options[m],f=u||"";return typeof o=="string"&&(f=o.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),f},D.prototype._get_number=function(m,u){var o=this.raw_options[m];u=parseInt(u,10),isNaN(u)&&(u=0);var f=parseInt(o,10);return isNaN(f)&&(f=u),f},D.prototype._get_selection=function(m,u,o){var f=this._get_selection_list(m,u,o);if(f.length!==1)throw new Error("Invalid Option Value: The option '"+m+`' can only be one of the following values:
|
|
`+u+`
|
|
You passed in: '`+this.raw_options[m]+"'");return f[0]},D.prototype._get_selection_list=function(m,u,o){if(!u||u.length===0)throw new Error("Selection list cannot be empty.");if(o=o||[u[0]],!this._is_valid_selection(o,u))throw new Error("Invalid Default Value!");var f=this._get_array(m,o);if(!this._is_valid_selection(f,u))throw new Error("Invalid Option Value: The option '"+m+`' can contain only the following values:
|
|
`+u+`
|
|
You passed in: '`+this.raw_options[m]+"'");return f},D.prototype._is_valid_selection=function(m,u){return m.length&&u.length&&!m.some(function(o){return u.indexOf(o)===-1})};function g(m,u){var o={};m=p(m);var f;for(f in m)f!==u&&(o[f]=m[f]);if(u&&m[u])for(f in m[u])o[f]=m[u][f];return o}function p(m){var u={},o;for(o in m){var f=o.replace(/-/g,"_");u[f]=m[o]}return u}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 u=p.exec(this.__input);return u&&!(D&&p.sticky)&&(u.index!==m&&(u=null)),u},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 u=this.peek(m);return p.lastIndex=0,u!==null&&p.test(u)},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,u){var o="",f;return p&&(f=this.match(p),f&&(o+=f[0])),m&&(f||!p)&&(o+=this.readUntil(m,u)),o},g.prototype.readUntil=function(p,m){var u="",o=this.__position;p.lastIndex=this.__position;var f=p.exec(this.__input);return f?(o=f.index,m&&(o+=f[0].length)):o=this.__input_length,u=this.__input.substring(this.__position,o),this.__position=o,u},g.prototype.readUntilAfter=function(p){return this.readUntil(p,!0)},g.prototype.get_regexp=function(p,m){var u=null,o="g";return m&&D&&(o="y"),typeof p=="string"&&p!==""?u=new RegExp(p,o):p&&(u=new RegExp(p.source,o)),u},g.prototype.get_literal_regexp=function(p){return RegExp(p.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},g.prototype.peekUntilAfter=function(p){var m=this.__position,u=this.readUntilAfter(p);return this.__position=m,u},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 u(o,f){var l=new p(o,f);return l.beautify()}n.exports=u,n.exports.defaultOptions=function(){return new m}},function(n,D,g){var p=g(17).Options,m=g(2).Output,u=g(8).InputScanner,o=g(13).Directives,f=new o(/\/\*/,/\*\//),l=/\r\n|[\r\n]/,h=/\r\n|[\r\n]/g,a=/\s/,s=/(?:\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=a.test(this._input.peek()),C=0;a.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(h,`
|
|
`);var C=L.match(/^[\t ]*/)[0];this._output=new m(this._options,C),this._input=new u(L),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var T=0,x=!1,c=!1,w=!1,v=!1,y=!1,F=!1,B=this._ch,R=!1,j,N,b;j=this._input.read(s),N=j!=="",b=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=f.get_directives(Y);ee&&ee.ignore==="start"&&(Y+=f.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"&&(y=!0),ae in this.NESTED_AT_RULE?(this._nestedLevel+=1,ae in this.CONDITIONAL_GROUP_RULE&&(w=!0)):!x&&T===0&&ae.indexOf(":")!==-1&&(c=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(N),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")c&&(c=!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)):(b==="("?this._output.space_before_token=!1:b!==","&&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(),b==="{"&&this._output.trim(!0),y=!1,v=!1,c&&(this.outdent(),c=!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(":"),c||(c=!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 Oe=b==='"'||b==="'";this.preserveSingleSpace(Oe||N),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")R=!1,T===0?(c&&(this.outdent(),c=!1),v=!1,y=!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),c&&b==="$"&&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&&(!c||F)&&T===0&&!y&&!v?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!c&&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&&a.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("="),a.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=b==='"'||b==="'";this.preserveSingleSpace(xe||N),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
|
|
`&&R&&this._output.add_new_line()}var Ae=this._output.get_code(O);return Ae},n.exports.Beautifier=S},function(n,D,g){var p=g(6).Options;function m(u){p.call(this,u,"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 f=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var l=0;l<f.length;l++)f[l]!=="expand"?this.brace_style="collapse":this.brace_style=f[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 W=G(15);P=W})();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 W});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 W;(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(u){if(u instanceof G)return["codicon","codicon-"+u.id];const o=D.exec(u.id);if(!o)return g(G.error);let[,f,l]=o;const h=["codicon","codicon-"+f];return l&&h.push("codicon-modifier-"+l.substr(1)),h}n.asClassNameArray=g;function p(u){return g(u).join(" ")}n.asClassName=p;function m(u){return"."+g(u).join(".")}n.asCSSSelector=m})(W||(W={})),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,W=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),u=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(re),o=/PhantomJS/.test(re),f=!k&&/AppleWebKit/.test(re)&&/Mobile\/\w+/.test(re),l=/Android/.test(re),h=f||l||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(re),a=f||/Mac/.test($),s=/\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=a&&(D||p&&(E==null||E<12.11)),L=P||G&&W>=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 c(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=c(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 y(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()};f?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 b(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,Oe={toString:function(){return"CodeMirror.Pass"}},Ee={scroll:!1},xe={origin:"*mouse"},Ae={origin:"+move"};function Re(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 he(e){for(;pe.length<=e;)pe.push(ke(pe)+" ");return pe[e]}function ke(e){return e[e.length-1]}function et(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 nt(){}function at(e,t){var r;return Object.create?r=Object.create(e):(nt.prototype=e,r=new nt),t&&b(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 $e(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 Se(e,t,r){for(;(r<0?t>0:t<e.length)&&Te(e.charAt(t));)t+=r;return t}function Ge(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 Ne(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 Fe=null;function Ke(e,t,r){var i;Fe=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:Fe=d),M.from==t&&(M.from!=M.to&&r!="before"?i=d:Fe=d)}return i!=null?i:Fe}var Je=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,de,me){this.level=te,this.from=de,this.to=me}return function(te,de){var me=de=="ltr"?"L":"R";if(te.length==0||de=="ltr"&&!i.test(te))return!1;for(var Ce=te.length,we=[],Be=0;Be<Ce;++Be)we.push(r(te.charCodeAt(Be)));for(var Xe=0,qe=me;Xe<Ce;++Xe){var ot=we[Xe];ot=="m"?we[Xe]=qe:qe=ot}for(var ct=0,lt=me;ct<Ce;++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<Ce-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<Ce;++Qt){var xn=we[Qt];if(xn==",")we[Qt]="N";else if(xn=="%"){var an=void 0;for(an=Qt+1;an<Ce&&we[an]=="%";++an);for(var zn=Qt&&we[Qt-1]=="!"||an<Ce&&we[an]=="1"?"1":"N",Bn=Qt;Bn<an;++Bn)we[Bn]=zn;Qt=an-1}}for(var fn=0,jn=me;fn<Ce;++fn){var Cn=we[fn];jn=="L"&&Cn=="1"?we[fn]="L":M.test(Cn)&&(jn=Cn)}for(var vn=0;vn<Ce;++vn)if(d.test(we[vn])){var pn=void 0;for(pn=vn+1;pn<Ce&&d.test(we[pn]);++pn);for(var on=(vn?we[vn-1]:me)=="L",Hn=(pn<Ce?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<Ce;)if(K.test(we[Tn])){var Va=Tn;for(++Tn;Tn<Ce&&K.test(we[Tn]);++Tn);In.push(new Q(0,Va,Tn))}else{var pi=Tn,Gi=In.length,Ki=de=="rtl"?1:0;for(++Tn;Tn<Ce&&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 de=="ltr"&&(In[0].level==1&&(li=te.match(/^\s+/))&&(In[0].from=li[0].length,In.unshift(new Q(0,0,li[0].length))),ke(In).level==1&&(li=te.match(/\s+$/))&&(ke(In).to-=li[0].length,In.push(new Q(0,Ce-li[0].length,Ce)))),de=="rtl"?In.reverse():In}}();function Ve(e,t){var r=e.order;return r==null&&(r=e.order=Je(e.text,t)),r}var tt=[],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]||tt).concat(r)}};function it(e,t){return e._handlers&&e._handlers[t]||tt}function st(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=it(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 Me(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 it(e,t).length>0}function fe(e){e.prototype.on=function(t,r){Ie(this,t,r)},e.prototype.off=function(t,r){st(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)),a&&e.ctrlKey&&t==1&&(t=3),t}var Ue=function(){if(G&&W<9)return!1;var e=c("div");return"draggable"in e||"dragDrop"in e}(),Ze;function mt(e){if(Ze==null){var t=c("span","\u200B");x(e,c("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Ze=t.offsetWidth<=1&&t.offsetHeight>2&&!(G&&W<8))}var r=Ze?c("span","\u200B"):c("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=c("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,c("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=at(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]={};b(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 H(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,de){return d.push(te,de)},M,i);for(var K=r.state,J=function(te){r.baseTokens=d;var de=e.state.overlays[te],me=1,Ce=0;r.state=!0,An(e,t.text,de.mode,r,function(we,Be){for(var Xe=me;Ce<we;){var qe=d[me];qe>we&&d.splice(me,1,we,d[me+1],qe),me+=2,Ce=Math.min(we,qe)}if(!Be)return;if(de.opaque)d.splice(Xe,me-Xe,we,"overlay "+Be),me=Xe+2;else for(;Xe<me;Xe+=2){var ot=d[Xe+1];d[Xe+1]=(ot?ot+" ":"")+"overlay "+Be}},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=rt(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 rt(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==""&&ze(d,r.state);!M.eol();)wt(d,M,r.state),M.start=M.pos}function ze(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=rt(e,t.line,r),te=new dt(J.text,e.options.tabSize,Q),de;for(i&&(de=[]);(i||te.pos<t.ch)&&!te.eol();)te.start=te.pos,K=wt(M,te,Q.state),i&&de.push(new zt(te,K,Wt(d.mode,Q.state)));return i?de: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,de=new dt(t,e.options.tabSize,i),me,Ce=e.options.addModeClass&&[null];for(t==""&&Wn(ze(r,i.state),M);!de.eol();){if(de.pos>e.options.maxHighlightLength?(J=!1,K&>(e,t,i,de.pos),de.pos=t.length,me=null):me=Wn(wt(r,de,i.state,Ce),M),Ce){var we=Ce[0].name;we&&(me="m-"+(me?we+" "+me:we))}if(!J||te!=me){for(;Q<de.start;)Q=Math.min(de.start,Q+5e3),d(Q,te);te=me}de.start=de.pos}for(;Q<de.pos;){var Be=Math.min(de.pos,Q+5e3);d(Be,te),Q=Be}}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 de=Y(Q.text,null,e.options.tabSize);(d==null||i>de)&&(d=J-1,i=de)}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,de=ke(t.text).length+(te?d:0);if(J)for(var me=0;me<J.length;++me){var Ce=J[me];if(Ce.to==null){var we=Gn(Q,Ce.marker);we?te&&(Ce.to=we.to==null?null:we.to+de):Ce.to=d}}if(Q)for(var Be=0;Be<Q.length;++Be){var Xe=Q[Be];if(Xe.to!=null&&(Xe.to+=de),Xe.from==null){var qe=Gn(J,Xe.marker);qe||(Xe.from=de,te&&(J||(J=[])).push(Xe))}else Xe.from+=de,te&&(J||(J=[])).push(Xe)}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 Be=0;Be<we.markedSpans.length;++Be){var Xe=we.markedSpans[Be].marker;Xe.readOnly&&(!i||ae(i,Xe)==-1)&&(i||(i=[])).push(Xe)}}),!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 de=[Q,1],me=It(te.from,J.from),Ce=It(te.to,J.to);(me<0||!K.inclusiveLeft&&!me)&&de.push({from:te.from,to:J.from}),(Ce>0||!K.inclusiveRight&&!Ce)&&de.push({from:J.to,to:te.to}),d.splice.apply(d,de),Q+=de.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),de=It(te.from,r)||ln(Q.marker)-ln(d),me=It(te.to,i)||Vt(Q.marker)-Vt(d);if(de>=0&&me<=0||de<=0&&me>=0)continue;if(de<=0&&(Q.marker.inclusiveRight&&d.inclusiveLeft?It(te.to,r)>=0:It(te.to,r)>0)||de>=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=Ve(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=c("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,de;if(!Q.test(t))e.col+=t.length,de=document.createTextNode(J),e.map.push(e.pos,e.pos+t.length,de),G&&W<9&&(te=!0),e.pos+=t.length;else{de=document.createDocumentFragment();for(var me=0;;){Q.lastIndex=me;var Ce=Q.exec(t),we=Ce?Ce.index-me:t.length-me;if(we){var Be=document.createTextNode(J.slice(me,me+we));G&&W<9?de.appendChild(c("span",[Be])):de.appendChild(Be),e.map.push(e.pos,e.pos+we,Be),e.col+=we,e.pos+=we}if(!Ce)break;me+=we+1;var Xe=void 0;if(Ce[0]==" "){var qe=e.cm.options.tabSize,ot=qe-e.col%qe;Xe=de.appendChild(c("span",he(ot),"cm-tab")),Xe.setAttribute("role","presentation"),Xe.setAttribute("cm-text"," "),e.col+=ot}else Ce[0]=="\r"||Ce[0]==`
|
|
`?(Xe=de.appendChild(c("span",Ce[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Xe.setAttribute("cm-text",Ce[0]),e.col+=1):(Xe=e.cm.options.specialCharPlaceholder(Ce[0]),Xe.setAttribute("cm-text",Ce[0]),G&&W<9?de.appendChild(c("span",[Xe])):de.appendChild(Xe),e.col+=1);e.map.push(e.pos,e.pos+1,Xe),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=c("span",[de],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(de)}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,de=te+i.length;;){for(var me=void 0,Ce=0;Ce<t.length&&!(me=t[Ce],me.to>te&&me.from<=te);Ce++);if(me.to>=de)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,de="",me,Ce,we=0,Be,Xe,qe,ot,ct;;){if(we==Q){Be=Xe=qe=Ce="",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,Xe=""),Nt.className&&(Be+=" "+Nt.className),Nt.css&&(Ce=(Ce?Ce+";":"")+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&&(Xe+=" "+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(de){var Bn=Q+de.length;if(!ot){var fn=Bn>zn?de.slice(0,zn-Q):de;t.addToken(t,fn,me?me+Be:Be,qe,Q+fn.length==we?Xe:"",Ce,ct)}if(Bn>=zn){de=de.slice(zn-Q),Q=zn;break}Q=Bn,qe=""}de=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(ke(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=it(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=c("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),G&&W<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(c("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=c("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=c("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(c("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,de=M.hasOwnProperty(te)&&M[te];de&&J.appendChild(c("div",[de],"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=c("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(!y(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,c("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,c("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 de=0;de<4;de++){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&&W<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&&W<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&&W<9&&!K&&(!te||!te.left&&!te.right)){var Ce=M.parentNode.getClientRects()[0];Ce?te={left:Ce.left,right:Ce.left+Ji(e.display),top:Ce.top,bottom:Ce.bottom}:te=ns}for(var we=te.top-t.rect.top,Be=te.bottom-t.rect.top,Xe=(we+Be)/2,qe=t.view.measure.heights,ot=0;ot<qe.length-1&&!(Xe<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=Be),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(Be,Xe){var qe=oi(e,d,Be,Xe?"right":"left",M);return Xe?qe.left=qe.right:qe.right=qe.left,Wr(e,i,qe,r)}var J=Ve(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 de(Be,Xe,qe){var ot=J[Xe],ct=ot.level==1;return K(qe?Be-1:Be,ct!=qe)}var me=Ke(J,Q,te),Ce=Fe,we=de(Q,me,te=="before");return Ce!=null&&(we.other=de(Q,Ce,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=Ge(function(K){return oi(e,r,K-1).bottom<=i},d,0);return d=Ge(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,de=Ve(t,e.doc.direction);if(de){var me=(e.options.lineWrapping?zo:Ko)(e,t,r,M,de,i,d);te=me.level!=1,J=te?me.from:me.to-1,Q=te?me.to:me.from-1}var Ce=null,we=null,Be=Ge(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&&(Ce=At,we=Et),!0):!1},J,Q),Xe,qe,ot=!1;if(we){var ct=i-we.left<we.right-i,lt=ct==te;Be=Ce+(lt?0:1),qe=lt?"after":"before",Xe=ct?we.left:we.right}else{!te&&(Be==Q||Be==J)&&Be++,qe=Be==0?"after":Be==t.text.length?"before":oi(e,M,Be-(te?1:0)).bottom+K<=d==te?"after":"before";var pt=ti(e,Ye(r,Be,qe),"line",t,M);Xe=pt.left,ot=d<pt.top?-1:d>=pt.bottom?1:0}return Be=Se(t.text,Be,1),ga(r,Be,qe,ot,i-Xe)}function Ko(e,t,r,i,d,M,K){var J=Ge(function(me){var Ce=d[me],we=Ce.level!=1;return ya(ti(e,Ye(r,we?Ce.to:Ce.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,de=ti(e,Ye(r,te?Q.from:Q.to,te?"after":"before"),"line",t,i);ya(de,M,K,!0)&&de.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 de=null,me=null,Ce=0;Ce<d.length;Ce++){var we=d[Ce];if(we.from>=te||we.to<=Q)continue;var Be=we.level!=1,Xe=oi(e,i,Be?Math.min(te,we.to)-1:Math.max(Q,we.from)).right,qe=Xe<M?M-Xe+1e9:Xe-M;(!de||me>qe)&&(de=we,me=qe)}return de||(de=d[d.length-1]),de.from<Q&&(de={from:Q,to:de.to,level:de.level}),de.to>te&&(de={from:de.from,to:te,level:de.level}),de}var Ni;function $i(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Ni==null){Ni=c("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Ni.appendChild(document.createTextNode("x")),Ni.appendChild(c("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=c("span","xxxxxxxxxx"),r=c("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 de=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))-de))}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(c("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(c("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 de(lt,pt,At,Et){pt<0&&(pt=0),pt=Math.round(pt),Et=Math.round(Et),M.appendChild(c("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=Ve(Et,d.direction);return Ne(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;de(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),de(Ki,on.top,Mn-Ki,on.bottom),on.bottom<Hn.top&&de(J,on.bottom,null,Hn.top),de(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 Ce=t.from(),we=t.to();if(Ce.line==we.line)me(Ce.line,Ce.ch,we.ch);else{var Be=ut(d,Ce.line),Xe=ut(d,we.line),qe=Dn(Be)==Dn(Xe),ot=me(Ce.line,Ce.ch,qe?Be.text.length+1:null).end,ct=me(we.line,qe?0:null,we.ch).start;qe&&(ot.top<ct.top-2?(de(ot.right,ot.top,null,ot.bottom),de(J,ct.top,ct.left,ct.bottom)):de(ot.right,ot.top,ct.left-ot.right,ot.bottom)),ot.bottom<ct.top&&de(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&&W<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 de=d.line.height-K;if((de>.005||de<-.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 Ce=Math.ceil(J/Ji(e.display));Ce>e.display.maxLineLength&&(e.display.maxLineLength=Ce,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(Me(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=c("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),de=e.doc.scrollTop,me=e.doc.scrollLeft;if(te.scrollTop!=null&&(Er(e,te.scrollTop),Math.abs(e.doc.scrollTop-de)>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 de=Math.min(t.top,(te?J:t.bottom)-M);de!=d&&(K.scrollTop=de)}var me=e.options.fixedGutter?0:r.gutters.offsetWidth,Ce=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:r.scroller.scrollLeft-me,we=Pi(e)-r.gutters.offsetWidth,Be=t.right-t.left>we;return Be&&(t.right=t.left+we),t.left<10?K.scrollLeft=0:t.left<Ce?K.scrollLeft=Math.max(0,t.left+me-(Be?0:10)):t.right>we+Ce-3&&(K.scrollLeft=t.right+(Be?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=c("div",[c("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),d=this.horiz=c("div",[c("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&&W<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=a&&!u?"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=rt(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,de=Q.classes;de?M.styleClasses=de:te&&(M.styleClasses=null);for(var me=!K||K.length!=M.styles.length||te!=de&&(!te||!de||te.bgClass!=de.bgClass||te.textClass!=de.textClass),Ce=0;!me&&Ce<K.length;++Ce)me=K[Ce]!=M.styles[Ce];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||!y(e.display.lineDiv,t))return null;var r={activeElt:t};if(window.getSelection){var i=window.getSelection();i.anchorNode&&i.extend&&y(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&&y(document.body,e.anchorNode)&&y(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(Be){var Xe=Be.nextSibling;return n&&a&&e.display.currentWheelTarget==Be?Be.style.display="none":Be.parentNode.removeChild(Be),Xe}for(var Q=i.view,te=i.viewFrom,de=0;de<Q.length;de++){var me=Q[de];if(!me.hidden)if(!me.node||me.node.parentNode!=M){var Ce=No(e,me,te,r);M.insertBefore(Ce,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(c("div",[c("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(c("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=c("div",null,"CodeMirror-scrollbar-filler"),d.scrollbarFiller.setAttribute("cm-not-content","true"),d.gutterFiller=c("div",null,"CodeMirror-gutter-filler"),d.gutterFiller.setAttribute("cm-not-content","true"),d.lineDiv=w("div",null,"CodeMirror-code"),d.selectionDiv=c("div",null,null,"position: relative; z-index: 1"),d.cursorDiv=c("div",null,"CodeMirror-cursors"),d.measure=c("div",null,"CodeMirror-measure"),d.lineMeasure=c("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=c("div",[M],null,"position: relative"),d.sizer=c("div",[d.mover],"CodeMirror-sizer"),d.sizerWidth=null,d.heightForcer=c("div",null,null,"position: absolute; height: "+ue+"px; width: 1px;"),d.gutters=c("div",null,"CodeMirror-gutters"),d.lineGutter=null,d.scroller=c("div",[d.sizer,d.heightForcer,d.gutters],"CodeMirror-scroll"),d.scroller.setAttribute("tabIndex","-1"),d.wrapper=c("div",[d.scrollbarFiller,d.gutterFiller,d.scroller],"CodeMirror"),G&&W<8&&(d.gutters.style.zIndex=-1,d.scroller.style.paddingRight=0),!n&&!(P&&h)&&(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&&a&&n){e:for(var te=t.target,de=M.view;te!=K;te=te.parentNode)for(var me=0;me<de.length;me++)if(de[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 Ce=d*Xn,we=e.doc.scrollTop,Be=we+M.wrapper.clientHeight;Ce<0?we=Math.max(0,we+Ce-50):Be=Math.min(e.doc.height,Be+Ce+50),Aa(e,{top:we,bottom:Be})}$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 Xe=K.scrollLeft-M.wheelStartX,qe=K.scrollTop-M.wheelStartY,ot=qe&&M.wheelDY&&qe/M.wheelDY||Xe&&M.wheelDX&&Xe/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(Ce,we){return It(Ce.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()),de=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?de:te,me?te:de))}}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,ke(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 de=e.sel.ranges[K],me=It(de.head,de.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&&ke(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,de=ut(e,J.line),me=ut(e,Q.line),Ce=ke(te),we=d(te.length-1),Be=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 Xe=K(0,te.length-1);M(me,me.text,we),Be&&e.remove(J.line,Be),Xe.length&&e.insert(J.line,Xe)}else if(de==me)if(te.length==1)M(de,de.text.slice(0,J.ch)+Ce+de.text.slice(Q.ch),we);else{var qe=K(1,te.length-1);qe.push(new Mi(Ce+de.text.slice(Q.ch),we,i)),M(de,de.text.slice(0,J.ch)+te[0],d(0)),e.insert(J.line+1,qe)}else if(te.length==1)M(de,de.text.slice(0,J.ch)+te[0]+me.text.slice(Q.ch),d(0)),e.remove(J.line+1,Be);else{M(de,de.text.slice(0,J.ch)+te[0],d(0)),M(me,Ce+me.text.slice(Q.ch),we);var ot=K(1,te.length-1);Be>1&&e.remove(J.line+1,Be-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=ke(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return Ps(e.done),ke(e.done);if(e.done.length&&!ke(e.done).ranges)return ke(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),ke(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=ke(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=ke(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,ke(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=ke(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],de=void 0;if(J.push({from:te.from,to:te.to,text:te.text}),t)for(var me in te)(de=me.match(/^spans_(\d+)$/))&&(ae(t,Number(de[1]))>-1&&(ke(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=ke(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,de="selectRight"in Q?!Q.selectRight:Q.inclusiveRight;if((J.from==null||(te?J.from<=t.ch:J.from<t.ch))&&(J.to==null||(de?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),Ce=void 0;if((i<0?de:te)&&(me=zs(e,me,-i,me&&me.line==t.line?M:null)),me&&me.line==t.line&&(Ce=It(me,r))&&(i<0?Ce<0:Ce>0))return tr(e,me,t,i,d)}var we=Q.find(i<0?-1:1);return(i<0?te:de)&&(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 de=[];Zr(K,Q),Q.push({changes:de,generation:d.generation}),d.generation=M.generation||++d.maxGeneration;for(var me=ce(e,"beforeChange")||e.cm&&ce(e.cm,"beforeChange"),Ce=function(Xe){var qe=M.changes[Xe];if(qe.origin=t,me&&!Xs(e,qe,!1))return J.length=0,{};de.push(Ma(e,qe));var ot=Xe?Ia(e,qe):ke(J);Ar(e,qe,ot,Us(e,qe)),!Xe&&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 Be=Ce(we);if(Be)return Be.v}}function $s(e,t){if(t==0)return;if(e.first+=t,e.sel=new Yn(et(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:[ke(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 Be=pr(we);Be>d.maxLineLength&&(d.maxLine=we,d.maxLineLength=Be,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 de=ce(e,"changes"),me=ce(e,"change");if(me||de){var Ce={from:M,to:K,text:t.text,removed:t.removed,origin:t.origin};me&&Sn(e,"change",e,Ce),de&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Ce)}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]),de=pr(te);de>e.display.maxLineLength&&(e.display.maxLine=te,e.display.maxLineLength=de,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&&b(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 de=t.line;de<=r.line;de++)wi(Q,de,"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=b(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=ke(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=at(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,H(this,e),t)}),extendSelectionsBy:En(function(e,t){var r=et(this.sel.ranges,e);Bs(this,H(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),Me(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(Be){return Be!=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,Be){if(t.options.allowDropFileTypes&&ae(t.options.allowDropFileTypes,we.type)==-1){J();return}var Xe=new FileReader;Xe.onerror=function(){return J()},Xe.onload=function(){var qe=Xe.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(qe)){J();return}M[Be]=qe,J()},Xe.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 de=e.dataTransfer.getData("Text");if(de){var me;if(t.state.draggingText&&!t.state.draggingText.copy&&(me=t.listSelections()),qr(t.doc,Ci(r,r)),me)for(var Ce=0;Ce<me.length;++Ce)ir(t.doc,"",me[Ce].anchor,me[Ce].head,"drag");t.replaceSelection(de,"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(Me(e,t)||ci(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!m){var r=c("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=c("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=a?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=et(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,ke(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=Se(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=Ve(r,t.doc.direction);if(M){var K=d<0?ke(M):M[0],J=d<0==(K.level==1),Q=J?"after":"before",te;if(K.level>0||t.doc.direction=="rtl"){var de=Yi(t,r);te=d<0?r.text.length-1:0;var me=oi(t,de,te).top;te=Ge(function(Ce){return oi(t,de,Ce).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=Ve(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=Ke(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}},de=te(r.sticky=="before"?J(r,-1):r.ch);if(e.doc.direction=="rtl"||K.level==1){var me=K.level==1==i<0,Ce=J(r,me?1:-1);if(Ce!=null&&(me?Ce<=K.to&&Ce<=de.end:Ce>=K.from&&Ce>=de.begin)){var we=me?"before":"after";return new Ye(r.line,Ce,we)}}var Be=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)}},Xe=Be(M+i,i,de);if(Xe)return Xe;var qe=i>0?de.end:J(de.begin,-1);return qe!=null&&!(i>0&&qe==t.text.length)&&(Xe=Be(i>0?0:d.length-1,i,te(qe)),Xe)?Xe: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")},Ae)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:r},"div")},Ae)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5,i=e.coordsChar({left:0,top:r},"div");return i.ch<e.getLine(i.line).search(/\S/)?ho(e,t.head):i},Ae)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],r=e.listSelections(),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(he(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=Ve(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)!=Oe}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(),Me(t,e))return;G&&W<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&&(a?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),P&&!a&&!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"),st(document,"keyup",r),st(document,"mouseover",r))}Ie(document,"keyup",r),Ie(document,"mouseover",r)}function mo(e){e.keyCode==16&&(this.doc.sel.shift=!1),Me(this,e)}function go(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(ci(t.display,e)||Me(t,e)||e.ctrlKey&&!e.altKey||a&&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(Me(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)!=Oe}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=s?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=a?r.metaKey:r.ctrlKey),d.moveOnDrag==null&&(d.moveOnDrag=!(a?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&&Ue&&!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,st(d.wrapper.ownerDocument,"mouseup",K),st(d.wrapper.ownerDocument,"mousemove",J),st(d.scroller,"dragstart",Q),st(d.scroller,"drop",K),M||(ie(te),i.addNew||Qr(e.doc,r,null,null,i.extend),n&&!m||G&&W==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 de=yo(e,r,i.unit);i.extend?K=Pa(K,de.anchor,de.head,i.extend):K=de}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 Ce(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=Re(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,Re(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(),Be=0;function Xe(lt){var pt=++Be,At=Fi(e,lt,!0,i.unit=="rectangle");if(!At)return;if(It(At,me)!=0){e.curOp.focus=F(),Ce(At);var Et=Vr(d,M);(At.line>=Et.to||At.line<Et.from)&&setTimeout(_n(e,function(){Be==pt&&Xe(lt)}),150)}else{var Nt=lt.clientY<we.top?-20:lt.clientY>we.bottom?20:0;Nt&&setTimeout(_n(e,function(){if(Be!=pt)return;d.scroller.scrollTop+=Nt,Xe(lt)}),50)}}function qe(lt){e.state.selectingText=!1,Be=Infinity,lt&&(ie(lt),d.input.focus()),st(d.wrapper.ownerDocument,"mousemove",ot),st(d.wrapper.ownerDocument,"mouseup",ct),M.history.lastSelOrigin=null}var ot=_n(e,function(lt){lt.buttons===0||!Le(lt)?qe(lt):Xe(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=Ve(d);if(!M)return t;var K=Ke(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 de=Ke(M,i.ch,i.sticky),me=de-K||(i.ch-r.ch)*(J.level==1?-1:1);de==Q-1||de==Q?te=me<0:te=me>0}var Ce=M[Q+(te?-1:0)],we=te==(Ce.level==1),Be=we?Ce.from:Ce.to,Xe=we?"after":"before";return r.ch==Be&&r.sticky==Xe?t:new Yt(new Ye(r.line,Be,Xe),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(Ce){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 de=Ut(e.doc,M),me=e.display.gutterSpecs[Q];return De(e,r,e,de,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(Me(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 de=Q.text.indexOf(d,te);if(de==-1)break;te=de+d.length,M.push(Ye(K,de))}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",h?"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:st;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?b(t):{},b(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&&!h&&M.input.focus(),G&&W<11&&setTimeout(function(){return r.display.input.reset(!0)},20),Ql(this),Ol(),Hi(this),this.curOp.forceUpdate=!0,ks(this,i),t.autofocus&&!h||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&&W<11?Ie(t.scroller,"dblclick",_n(e,function(Q){if(Me(e,Q))return;var te=Fi(e,Q);if(!te||Wa(e,Q)||ci(e.display,Q))return;ie(Q);var de=e.findWordAt(te);Qr(e.doc,de.anchor,de.head)})):Ie(t.scroller,"dblclick",function(Q){return Me(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 de=te.left-Q.left,me=te.top-Q.top;return de*de+me*me>20*20}Ie(t.scroller,"touchstart",function(Q){if(!Me(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 de=e.coordsChar(t.activeTouch,"page"),me;!te.prev||K(te,te.prev)?me=new Yt(de,de):!te.prev.prev||K(te,te.prev.prev)?me=e.findWordAt(de):me=new Yt(Ye(de.line,0),_(e.doc,Ye(de.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){Me(e,Q)||le(Q)},over:function(Q){Me(e,Q)||(Rl(e,Q),le(Q))},start:function(Q){return Al(e,Q)},drop:_n(e,Cl),leave:function(Q){Me(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=rt(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],de;if(!i&&!/\S/.test(J.text))de=0,r="not";else if(r=="smart"&&(de=d.mode.indent(M,J.text.slice(te.length),J.text),de==Oe||de>150)){if(!i)return;r="prev"}r=="prev"?t>d.first?de=Y(ut(d,t-1).text,null,K):de=0:r=="add"?de=Q+e.options.indentUnit:r=="subtract"?de=Q-e.options.indentUnit:typeof r=="number"&&(de=Q+r),de=Math.max(0,de);var me="",Ce=0;if(e.options.indentWithTabs)for(var we=Math.floor(de/K);we;--we)Ce+=K,me+=" ";if(Ce<de&&(me+=he(de-Ce)),me!=te)return ir(d,me,Ye(t,0),Ye(t,te.length),"+input"),J.stateAfter=null,!0;for(var Be=0;Be<d.sel.ranges.length;Be++){var Xe=d.sel.ranges[Be];if(Xe.head.line==t&&Xe.head.ch<te.length){var qe=Ye(t,te.length);Na(d,Be,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 de=0;de<ii.text.length;de++)te.push(M.splitLines(ii.text[de]))}}else Q.length==i.ranges.length&&e.options.pasteLinesPerSelection&&(te=et(Q,function(ot){return[ot]}));for(var me=e.curOp.updateInput,Ce=i.ranges.length-1;Ce>=0;Ce--){var we=i.ranges[Ce],Be=we.from(),Xe=we.to();we.empty()&&(r&&r>0?Be=Ye(Be.line,Be.ch-r):e.state.overwrite&&!J?Xe=Ye(Xe.line,Math.min(ut(M,Xe.line).text.length,Xe.ch+ke(Q).length)):J&&ii&&ii.lineWise&&ii.text.join(`
|
|
`)==Q.join(`
|
|
`)&&(Be=Xe=Ye(Be.line,0)));var qe={from:Be,to:Xe,text:te?te[Ce%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=c("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=c("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return n?e.style.width="1000px":e.setAttribute("wrap","off"),f&&(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(),de=Math.max(M,Q.line);M=Math.min(this.lastLine(),te.line-(te.ch?0:1))+1;for(var me=de;me<M;++me)Br(this,me,i);var Ce=this.doc.sel.ranges;Q.ch==0&&d.length==Ce.length&&Ce[K].from().ch>0&&Na(this.doc,K,new Yt(Q,Ce[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 de=Q?Q.indexOf("overlay "):-1;return de<0?Q:de==0?null:Q.slice(0,de-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 de=0;de<K._global.length;de++){var me=K._global[de];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),rt(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,de=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),Ce=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),de+d.offsetWidth>Ce&&(de=Ce-d.offsetWidth)}d.style.top=te+"px",d.style.left=d.style.right="",J=="right"?(de=Q.sizer.clientWidth-d.offsetWidth,d.style.right="0px"):(J=="left"?de=0:J=="middle"&&(de=(Q.sizer.clientWidth-d.offsetWidth)/2),d.style.left=de+"px"),M&&Jo(this,{left:de,top:te,right:de+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()},Ae)}),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),de=0;de<d;++de){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(de){if(Q)return i<0?de.from():de.to();var me=ti(M,de.head,"div");de.goalColumn!=null&&(me.left=de.goalColumn),J.push(me.left);var Ce=Ro(M,me,i,d);return d=="page"&&de==K.sel.primary()&&Sa(M,ma(M,Ce,"div").top-me.top),Ce},Ae),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),de=$e(te,Q)?function(me){return $e(me,Q)}:/\s/.test(te)?function(me){return/\s/.test(me)}:function(me){return!/\s/.test(me)&&!$e(me)};K>0&&de(M.charAt(K-1));)--K;for(;J<M.length&&de(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 de(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")de();else if(i=="column")de(!0);else if(i=="word"||i=="group")for(var me=null,Ce=i=="group",we=e.cm&&e.cm.getHelper(t,"wordChars"),Be=!0;!(r<0&&!de(!Be));Be=!1){var Xe=J.text.charAt(t.ch)||`
|
|
`,qe=$e(Xe,we)?"w":Ce&&Xe==`
|
|
`?"n":!Ce||/\s/.test(Xe)?null:"p";if(Ce&&!Be&&!qe&&(qe="s"),me&&me!=qe){r<0&&(r=1,de(),t.sticky="after");break}if(qe&&(me=qe),r>0&&!de(!Be))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)||Me(i,J)||To(J,i))return;W<=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)||Me(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 de=Ao(),me=de.firstChild;i.display.lineSpace.insertBefore(de,i.display.lineSpace.firstChild),me.value=ii.text.join(`
|
|
`);var Ce=document.activeElement;j(me),setTimeout(function(){i.display.lineSpace.removeChild(de),Ce.focus(),Ce==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 de=J[J.length-1].measure,me=de.maps?de.maps[de.maps.length-1]:de.map;te={node:me[me.length-1],offset:me[me.length-2]-me[me.length-3]}}if(!Q||!te){e.removeAllRanges();return}var Ce=e.rangeCount&&e.getRangeAt(0),we;try{we=v(Q.node,Q.offset,te.offset,te.node)}catch(Be){}we&&(!P&&t.state.focused?(e.collapse(Q.node,Q.offset),we.collapsed||(e.removeAllRanges(),e.addRange(we))):(e.removeAllRanges(),e.addRange(we)),Ce&&e.anchorNode==null?e.addRange(Ce):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 y(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,de;if(Q==t.view.length-1?(te=t.viewTo-1,de=t.lineDiv.lastChild):(te=Dt(t.view[Q+1].line)-1,de=t.view[Q+1].node.previousSibling),!J)return!1;for(var me=e.doc.splitLines(tu(e,J,de,K,te)),Ce=qt(e.doc,Ye(K,0),Ye(te,ut(e.doc,te).text.length));me.length>1&&Ce.length>1;)if(ke(me)==ke(Ce))me.pop(),Ce.pop(),te--;else if(me[0]==Ce[0])me.shift(),Ce.shift(),K++;else break;for(var we=0,Be=0,Xe=me[0],qe=Ce[0],ot=Math.min(Xe.length,qe.length);we<ot&&Xe.charCodeAt(we)==qe.charCodeAt(we);)++we;for(var ct=ke(me),lt=ke(Ce),pt=Math.min(ct.length-(me.length==1?we:0),lt.length-(Ce.length==1?we:0));Be<pt&&ct.charCodeAt(ct.length-Be-1)==lt.charCodeAt(lt.length-Be-1);)++Be;if(me.length==1&&Ce.length==1&&K==i.line)for(;we&&we>i.ch&&ct.charCodeAt(ct.length-Be-1)==lt.charCodeAt(lt.length-Be-1);)we--,Be++;me[me.length-1]=ct.slice(0,ct.length-Be).replace(/^\u200b+/,""),me[0]=me[0].slice(we).replace(/\u200b+$/,"");var At=Ye(K,we),Et=Ye(te,Ce.length?ke(Ce).length-Be: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=Ve(i,e.doc.direction),K="left";if(M){var J=Ke(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(Be){return Be.id==we}}function de(){K&&(M+=J,Q&&(M+=J),K=Q=!1)}function me(we){we&&(de(),M+=we)}function Ce(we){if(we.nodeType==1){var Be=we.getAttribute("cm-text");if(Be){me(Be);return}var Xe=we.getAttribute("cm-marker"),qe;if(Xe){var ot=e.findMarks(Ye(i,0),Ye(d+1,0),te(+Xe));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&&de();for(var lt=0;lt<we.childNodes.length;lt++)Ce(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(;!(Ce(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||!y(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?ke(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 de(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=de(K,J,r);if(me)return lr(me,d);for(var Ce=J.nextSibling,we=K?K.nodeValue.length-r:0;Ce;Ce=Ce.nextSibling){if(me=de(Ce,Ce.firstChild,0),me)return lr(Ye(me.line,me.ch-we),d);we+=Ce.textContent.length}for(var Be=J.previousSibling,Xe=r;Be;Be=Be.previousSibling){if(me=de(Be,Be.firstChild,-1),me)return lr(Ye(me.line,me.ch+Xe),d);Xe+=Be.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),f&&(d.style.width="0px"),Ie(d,"input",function(){G&&W>=9&&t.hasSelection&&(t.hasSelection=null),r.poll()}),Ie(d,"paste",function(K){if(Me(i,K)||To(K,i))return;i.state.pasteIncoming=+new Date,r.fastPoll()});function M(K){if(Me(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)||Me(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&&W>=9&&(this.hasSelection=r)}else e||(this.prevInput=this.textarea.value="",G&&W>=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"&&(!h||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&&W>=9&&this.hasSelection===d||a&&/[\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&&W>=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,de=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",d.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(e.clientY-de.top-5)+"px; left: "+(e.clientX-de.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 Ce(){if(d.selectionStart!=null){var Xe=r.somethingSelected(),qe="\u200B"+(Xe?d.value:"");d.value="\u21DA",d.value=qe,t.prevInput=Xe?"":"\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&&W<9&&i.scrollbars.setScrollTop(i.scroller.scrollTop=K),d.selectionStart!=null){(!G||G&&W<9)&&Ce();var Xe=0,qe=function(){i.selForContextMenu==r.doc.sel&&d.selectionStart==0&&d.selectionEnd>0&&t.prevInput=="\u200B"?_n(r,Vs)(r):Xe++<10?i.detectingSelectAll=setTimeout(qe,500):(i.selForContextMenu=null,i.input.reset())};i.detectingSelectAll=setTimeout(qe,200)}}if(G&&W>=9&&Ce(),L){le(e);var Be=function(){st(window,"mouseup",Be),setTimeout(we,20)};Ie(window,"mouseup",Be)}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?b(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&&(st(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=st,e.on=Ie,e.wheelEventPixels=dl,e.Doc=Un,e.splitLines=xt,e.countColumn=Y,e.findColumn=Re,e.isWordChar=je,e.Pass=Oe,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=y,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"),W=Z("rePB"),n=Z("Zm9Q"),D=Z("Kwbf"),g=Z("c+Xe"),p=Z("m+aA"),m=Z("bdgK"),u=new Map;function o(Ee){Ee.forEach(function(xe){var Ae,Re=xe.target;(Ae=u.get(Re))===null||Ae===void 0||Ae.forEach(function(pe){return pe(Re)})})}var f=new m.default(o),l=null,h=null;function a(Ee,xe){u.has(Ee)||(u.set(Ee,new Set),f.observe(Ee)),u.get(Ee).add(xe)}function s(Ee,xe){u.has(Ee)&&(u.get(Ee).delete(xe),u.get(Ee).size||(f.unobserve(Ee),u.delete(Ee)))}var A=function(Ee){Object(X.a)(Ae,Ee);var xe=Object(U.a)(Ae);function Ae(){return Object($.a)(this,Ae),xe.apply(this,arguments)}return Object(P.a)(Ae,[{key:"render",value:function(){return this.props.children}}]),Ae}(k.Component),E=k.createContext(null);function S(Ee){var xe=Ee.children,Ae=Ee.onBatchResize,Re=k.useRef(0),pe=k.useRef([]),he=k.useContext(E),ke=k.useCallback(function(et,We,nt){Re.current+=1;var at=Re.current;pe.current.push({size:et,element:We,data:nt}),Promise.resolve().then(function(){at===Re.current&&(Ae==null||Ae(pe.current),pe.current=[])}),he==null||he(et,We,nt)},[Ae,he]);return k.createElement(E.Provider,{value:ke},xe)}function L(Ee){var xe=Ee.children,Ae=Ee.disabled,Re=k.useRef(null),pe=k.useRef(null),he=k.useContext(E),ke=k.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),et=k.isValidElement(xe)&&Object(g.c)(xe),We=et?xe.ref:null,nt=k.useMemo(function(){return Object(g.a)(We,Re)},[We,Re]),at=k.useRef(Ee);at.current=Ee;var Pe=k.useCallback(function(je){var $e=at.current,se=$e.onResize,_e=$e.data,Te=je.getBoundingClientRect(),Se=Te.width,Ge=Te.height,Ne=je.offsetWidth,Fe=je.offsetHeight,Ke=Math.floor(Se),Je=Math.floor(Ge);if(ke.current.width!==Ke||ke.current.height!==Je||ke.current.offsetWidth!==Ne||ke.current.offsetHeight!==Fe){var Ve={width:Ke,height:Je,offsetWidth:Ne,offsetHeight:Fe};ke.current=Ve;var tt=Ne===Math.round(Se)?Se:Ne,Ie=Fe===Math.round(Ge)?Ge:Fe,it=Object(G.a)(Object(G.a)({},Ve),{},{offsetWidth:tt,offsetHeight:Ie});he==null||he(it,je,_e),se&&Promise.resolve().then(function(){se(it,je)})}},[]);return k.useEffect(function(){var je=Object(p.a)(Re.current)||Object(p.a)(pe.current);return je&&!Ae&&a(je,Pe),function(){return s(je,Pe)}},[Re.current,Ae]),k.createElement(A,{ref:pe},et?k.cloneElement(xe,{ref:nt}):xe)}var O="rc-observer-key";function C(Ee){var xe=Ee.children,Ae=Object(n.a)(xe);return Ae.map(function(Re,pe){var he=(Re==null?void 0:Re.key)||"".concat(O,"-").concat(pe);return k.createElement(L,Object(re.a)({},Ee,{key:he}),Re)})}C.Collection=S;var T=C,x=Z("bT9E"),c=Z("TSYQ"),w=Z.n(c),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
|
|
`,y=["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,Ae=Ee.getAttribute("id")||Ee.getAttribute("data-reactid")||Ee.getAttribute("name");if(xe&&F[Ae])return F[Ae];var Re=window.getComputedStyle(Ee),pe=Re.getPropertyValue("box-sizing")||Re.getPropertyValue("-moz-box-sizing")||Re.getPropertyValue("-webkit-box-sizing"),he=parseFloat(Re.getPropertyValue("padding-bottom"))+parseFloat(Re.getPropertyValue("padding-top")),ke=parseFloat(Re.getPropertyValue("border-bottom-width"))+parseFloat(Re.getPropertyValue("border-top-width")),et=y.map(function(nt){return"".concat(nt,":").concat(Re.getPropertyValue(nt))}).join(";"),We={sizingStyle:et,paddingSize:he,borderSize:ke,boxSizing:pe};return xe&&Ae&&(F[Ae]=We),We}function j(Ee){var xe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ae=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Re=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),he=pe.paddingSize,ke=pe.borderSize,et=pe.boxSizing,We=pe.sizingStyle;B.setAttribute("style","".concat(We,";").concat(v)),B.value=Ee.value||Ee.placeholder||"";var nt=Number.MIN_SAFE_INTEGER,at=Number.MAX_SAFE_INTEGER,Pe=B.scrollHeight,je;if(et==="border-box"?Pe+=ke:et==="content-box"&&(Pe-=he),Ae!==null||Re!==null){B.value=" ";var $e=B.scrollHeight-he;Ae!==null&&(nt=$e*Ae,et==="border-box"&&(nt=nt+he+ke),Pe=Math.max(nt,Pe)),Re!==null&&(at=$e*Re,et==="border-box"&&(at=at+he+ke),je=Pe>at?"":"hidden",Pe=Math.min(at,Pe))}return{height:Pe,minHeight:nt,maxHeight:at,overflowY:je,resize:"none"}}var N=Z("Gytx"),b=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)(Ae,Ee);var xe=Object(U.a)(Ae);function Ae(Re){var pe;return Object($.a)(this,Ae),pe=xe.call(this,Re),pe.nextFrameActionId=void 0,pe.resizeFrameId=void 0,pe.textArea=void 0,pe.saveTextArea=function(he){pe.textArea=he},pe.handleResize=function(he){var ke=pe.state.resizeStatus,et=pe.props,We=et.autoSize,nt=et.onResize;if(ke!==Y.NONE)return;typeof nt=="function"&&nt(he),We&&pe.resizeOnNextFrame()},pe.resizeOnNextFrame=function(){cancelAnimationFrame(pe.nextFrameActionId),pe.nextFrameActionId=requestAnimationFrame(pe.resizeTextarea)},pe.resizeTextarea=function(){var he=pe.props.autoSize;if(!he||!pe.textArea)return;var ke=he.minRows,et=he.maxRows,We=j(pe.textArea,!1,ke,et);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 he=pe.props,ke=he.prefixCls,et=ke===void 0?"rc-textarea":ke,We=he.autoSize,nt=he.onResize,at=he.className,Pe=he.disabled,je=pe.state,$e=je.textareaStyles,se=je.resizeStatus,_e=Object(x.a)(pe.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Te=w()(et,at,Object(W.a)({},"".concat(et,"-disabled"),Pe));"value"in _e&&(_e.value=_e.value||"");var Se=Object(G.a)(Object(G.a)(Object(G.a)({},pe.props.style),$e),se===Y.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return k.createElement(T,{onResize:pe.handleResize,disabled:!(We||nt)},k.createElement("textarea",Object(re.a)({},_e,{className:Te,style:Se,ref:pe.saveTextArea})))},pe.state={textareaStyles:{},resizeStatus:Y.NONE},pe}return Object(P.a)(Ae,[{key:"componentDidUpdate",value:function(pe){(pe.value!==this.props.value||!b()(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,he=this.textArea.selectionEnd;this.textArea.setSelectionRange(pe,he)}}catch(ke){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Ae}(k.Component),ae=ee,ue=function(Ee){Object(X.a)(Ae,Ee);var xe=Object(U.a)(Ae);function Ae(Re){var pe;Object($.a)(this,Ae),pe=xe.call(this,Re),pe.resizableTextArea=void 0,pe.focus=function(){pe.resizableTextArea.textArea.focus()},pe.saveTextArea=function(ke){pe.resizableTextArea=ke},pe.handleChange=function(ke){var et=pe.props.onChange;pe.setValue(ke.target.value,function(){pe.resizableTextArea.resizeTextarea()}),et&&et(ke)},pe.handleKeyDown=function(ke){var et=pe.props,We=et.onPressEnter,nt=et.onKeyDown;ke.keyCode===13&&We&&We(ke),nt&&nt(ke)};var he=typeof Re.value=="undefined"||Re.value===null?Re.defaultValue:Re.value;return pe.state={value:he},pe}return Object(P.a)(Ae,[{key:"setValue",value:function(pe,he){"value"in this.props||this.setState({value:pe},he)}},{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}}]),Ae}(k.Component),Oe=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"),W=Z("q1tI"),n=Z.n(W),D=Z("bdgK"),g=Z("9og8"),p=Z("WmNS"),m=Z.n(p),u={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"]},f={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(`
|
|
`)}]},h=Z("5VLF"),a=Z.n(h),s={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(s.tables).map(function(ee){return{label:ee,kind:Y.languages.CompletionItemKind.Variable,insertText:ee}})},S=function(Y,ee){var ae=s.tables[Y];return ae?ae.map(function(ue){return{label:ue,kind:ee.languages.CompletionItemKind.Field,insertText:ue}}):[]};function L(b,Y,ee,ae,ue){var Oe=Y.getWordUntilPosition(ee),Ee={startLineNumber:ee.lineNumber,endLineNumber:ee.lineNumber,startColumn:Oe.startColumn,endColumn:Oe.endColumn},xe=ae.map(function(Ae){return{label:Ae,kind:b.languages.CompletionItemKind.Keyword,insertText:Ae,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ee}});return ue.map(function(Ae){xe.push(Object(re.a)(Object(re.a)({},Ae),{},{range:Ee}))}),xe}var O=function(b){s.languages.map(function(ue){return b.languages.registerDocumentFormattingEditProvider(ue,{provideDocumentFormattingEdits:function(Ee,xe,Ae){return Object(g.a)(m.a.mark(function Re(){var pe;return m.a.wrap(function(ke){for(;;)switch(ke.prev=ke.next){case 0:return pe=a()(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}),ke.abrupt("return",[{range:Ee.getFullModelRange(),text:pe}]);case 2:case"end":return ke.stop()}},Re)}))()}}),ue});var Y=f.quickKey.map(function(ue){return{label:ue.label,kind:b.languages.CompletionItemKind.Method,insertText:ue.content,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),ee=l.quickKey.map(function(ue){return{label:ue.label,kind:b.languages.CompletionItemKind.Method,insertText:ue.content,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),ae=o.quickKey.map(function(ue){return{label:ue.label,kind:b.languages.CompletionItemKind.Method,insertText:ue.content,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet}});b.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(Oe,Ee){var xe=Oe.getWordUntilPosition(Ee),Ae={startLineNumber:Ee.lineNumber,endLineNumber:Ee.lineNumber,startColumn:xe.startColumn,endColumn:xe.endColumn},Re=Oe.getLineContent(Ee.lineNumber).substring(xe.startColumn-2,xe.endColumn);return{suggestions:[].concat(Object($.a)(f.keywords.map(function(pe){return{label:pe,kind:b.languages.CompletionItemKind.Function,documentation:pe,insertText:pe,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ae}})),Object($.a)(f.quickKey.map(function(pe){return{label:pe.label,kind:b.languages.CompletionItemKind.Function,documentation:pe.content,insertText:Re.startsWith("#")?pe.content.replace(/#/,""):pe.content,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ae}})))}}}),b.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(Oe,Ee){var xe=Oe.getWordUntilPosition(Ee),Ae={startLineNumber:Ee.lineNumber,endLineNumber:Ee.lineNumber,startColumn:xe.startColumn,endColumn:xe.endColumn};return{suggestions:Object($.a)(u.keywords.map(function(Re){return{label:Re,kind:b.languages.CompletionItemKind.Function,documentation:Re,insertText:Re,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ae}}))}}}),b.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(Oe,Ee){var xe=Oe.getWordUntilPosition(Ee),Ae={startLineNumber:Ee.lineNumber,endLineNumber:Ee.lineNumber,startColumn:xe.startColumn,endColumn:xe.endColumn},Re=Oe.getLineContent(Ee.lineNumber).substring(xe.startColumn-2,xe.endColumn);return{suggestions:[].concat(Object($.a)(o.keywords.map(function(pe){return{label:pe,kind:b.languages.CompletionItemKind.Function,documentation:pe,insertText:pe,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ae}})),Object($.a)(o.quickKey.map(function(pe){return{label:pe.label,kind:b.languages.CompletionItemKind.Function,documentation:pe.content,insertText:Re.startsWith("#")?pe.content.replace(/#/,""):pe.content,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ae}})))}}}),b.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(Oe,Ee){var xe=Oe.getWordUntilPosition(Ee),Ae={startLineNumber:Ee.lineNumber,endLineNumber:Ee.lineNumber,startColumn:xe.startColumn,endColumn:xe.endColumn},Re=Oe.getLineContent(Ee.lineNumber).substring(xe.startColumn-2,xe.endColumn);return{suggestions:[].concat(Object($.a)(l.keywords.map(function(pe){return{label:pe,kind:b.languages.CompletionItemKind.Function,documentation:pe,insertText:pe,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ae}})),Object($.a)(l.quickKey.map(function(pe){return{label:pe.label,kind:b.languages.CompletionItemKind.Function,documentation:pe.content,insertText:Re.startsWith("#")?pe.content.replace(/#/,""):pe.content,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ae}})))}}})},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"),c=Z("+ua5");function w(b){return/^\d+$/.test(b)?"".concat(b,"px"):b}function v(){}var y=!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 b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Y=b;if(Array.isArray(b)){for(var ee=0;ee<b.length;ee++){var ae=F[b[ee]];if(ae)return ae}return Y[0]}return F[Y]||Y}var R=null,j=be.b=function(b){var Y=b.width,ee=Y===void 0?"100%":Y,ae=b.height,ue=ae===void 0?"100%":ae,Oe=b.value,Ee=b.language,xe=Ee===void 0?"javascript":Ee,Ae=b.style,Re=Ae===void 0?{}:Ae,pe=b.options,he=pe===void 0?{}:pe,ke=b.overrideServices,et=ke===void 0?{}:ke,We=b.theme,nt=We===void 0?"vs-dark":We,at=b.onEditBlur,Pe=b.onSave,je=b.autoHeight,$e=je===void 0?!1:je,se=b.forbidCopy,_e=se===void 0?!1:se,Te=b.onChange,Se=Te===void 0?v:Te,Ge=b.editorDidMount,Ne=Ge===void 0?v:Ge,Fe=b.onFocus,Ke=Fe===void 0?v:Fe,Je=b.filename,Ve=Je===void 0?"educoder.txt":Je,tt=b.errorLine,Ie=b.errorContent,it=Ie===void 0?"":Ie,st=Object(G.a)(b,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),De=Object(W.useRef)(),Me=Object(W.useRef)({}),ve=Object(W.useRef)(),ce=Object(W.useRef)(),fe=Object(W.useRef)(!1),ie=Object(W.useRef)(),ne=Object(W.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)&&Me.current.instance.layout()}}catch(dt){Wt.e(dt)}finally{Wt.f()}}),_t.observe(De.current)),_t}function Ue(){X.b.warn(decodeURIComponent(C))}var Ze=function(){var Tt=Me.current.instance;if(Oe!=null&&Tt&&le){var Wt=Tt.getModel();Wt&&Oe!==Wt.getValue()&&(y=!0,Wt.setValue(Oe),Tt.layout(),y=!1)}};Object(W.useEffect)(function(){ce.current&&clearTimeout(ce.current),ce.current=setTimeout(function(){Ze()},500)},[Oe,le,Me.current]),Object(W.useEffect)(function(){if(tt&&Me.current&&Me.current.instance){var _t=Me.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=it,Wt.addZone({afterLineNumber:tt||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})}},[tt,Me.current,le]);function mt(){var _t=Me.current.instance;if(_t){var Tt=_t.getSelection(),Wt=Me.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($e&&Me.current.instance){var Tt=Me.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(W.useEffect)(function(){Ct()},[Ct]),Object(W.useEffect)(function(){De.current&&!le&&Promise.all([Z.e(16),Z.e(28)]).then(Z.t.bind(null,"M/lh",7)).then(function(_t){try{R=_t,Me.current.instance=R.editor.create(De.current,{value:Oe,language:B(xe),theme:nt,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},et);var Tt=Me.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(Ne(Tt,R),setTimeout(function(){Ct(),Me.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){Qe(Ve||"educoder.txt",Tt.getValue())}}),Tt.getDomNode().addEventListener("input",function(){ve.current.autoFormat&&Tt.getAction("editor.action.formatDocument").run()})},500),Me.current.subscription=Tt.onDidChangeModelContent(function(Ot){fe.current?clearTimeout(ie.current):(Ct(),Se(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)&&(Ue(),Ot.preventDefault())})),window.Monaco=R,at&&Tt.onDidBlurEditorWidget(function(){at(Tt.getValue())}),Ke&&Tt.onDidFocusEditorText(function(){Ke(Tt.getValue())}),_e){Tt.addCommand(R.KeyMod.CtrlCmd|R.KeyCode.KEY_V,function(){return Ue(),null}),Tt.onDidPaste(function(Ot){Me.current.pastePos=Ot});try{window.addEventListener("paste",mt)}catch(Ot){}}var qt=Le();return ye(!0),function(){var Ot=Me.current.instance;Ot.dispose();var Mt=Ot.getModel();Mt&&Mt.dispose(),Me.current.subscription&&Me.current.subscription.dispose(),_e&&window.removeEventListener("paste",mt),qt.unobserve(De.current)}}catch(Ot){}})},[]),Object(W.useEffect)(function(){var _t=Me.current.instance;if(_t&&le)return document.addEventListener("keydown",ft,!1),function(){document.removeEventListener("keydown",ft)}},[Pe,le]),Object(W.useEffect)(function(){var _t=Me.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(W.useEffect)(function(){var _t=Me.current.instance;_t&&le&&R.editor.setTheme(nt)},[nt,le]),Object(W.useEffect)(function(){var _t=Me.current.instance;ve.current=he,_t&&le&&(_t.updateOptions(Object(re.a)({},he)),setTimeout(function(){_t.getModel().updateOptions(Object(re.a)({},he))},200))},[JSON.stringify(he),le]),Object(W.useEffect)(function(){var _t=Me.current.instance;_t&&le&&_t.layout()},[ee,ue,le]);var Lt=Object(W.useState)(w(ee)),vt=Object(k.a)(Lt,2),Ft=vt[0],Pt=vt[1],Rt=Object(W.useState)(w(ue)),mn=Object(k.a)(Rt,2),sn=mn[0],bt=mn[1],tn=Object(re.a)(Object(re.a)({},Re),{},{width:Ft,height:sn});return n.a.createElement("div",{className:"my-monaco-editor",ref:De,style:tn})};function N(b){var Y=b.width,ee=Y===void 0?"100%":Y,ae=b.height,ue=ae===void 0?"100%":ae,Oe=b.original,Ee=b.modified,xe=b.language,Ae=b.options,Re=Ae===void 0?{}:Ae,pe=Object(W.useRef)(),he=Object(W.useState)(null),ke=Object(k.a)(he,2),et=ke[0],We=ke[1];function nt($e){var se;return pe.current&&(se=new D.default(function(_e){var Te=Object(U.a)(_e),Se;try{for(Te.s();!(Se=Te.n()).done;){var Ge=Se.value;(Ge.target.offsetHeight>0||Ge.target.offsetWidth>0)&&$e.layout()}}catch(Ne){Te.e(Ne)}finally{Te.f()}}),se.observe(pe.current)),se}Object(W.useEffect)(function(){pe.current&&Promise.all([Z.e(16),Z.e(28)]).then(Z.t.bind(null,"M/lh",7)).then(function($e){R=$e;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},Re),{},{wordWrap:!0}));We(se);var _e=nt(se);return function(){se.dispose();var Te=se.getModel();Te&&Te.dispose(),_e.unobserve(pe.current)}})},[]),Object(W.useEffect)(function(){et&&et.setModel({original:R.editor.createModel(Oe,xe),modified:R.editor.createModel(Ee,xe)})},[Oe,Ee,xe,et]);var at=w(ee),Pe=w(ue),je={width:at,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(u){var o=function(f){if(!f.ownerDocument||!f.ownerDocument.defaultView)return null;try{return f.ownerDocument.defaultView.frameElement}catch(l){return null}}(u);return!!o&&(o.clientHeight<u.scrollHeight||o.clientWidth<u.scrollWidth)}(g)}return!1}function X(g,p,m,u,o,f,l,h){return f<g&&l>p||f>g&&l<p?0:f<=g&&h<=m||l>=p&&h>=m?f-g-u:l>p&&h<m||f<g&&h>m?l-p+o:0}var U=function(g,p){var m=window,u=p.scrollMode,o=p.block,f=p.inline,l=p.boundary,h=p.skipOverflowHiddenElements,a=typeof l=="function"?l:function($e){return $e!==l};if(!re(g))throw new TypeError("Invalid target");for(var s=document.scrollingElement||document.documentElement,A=[],E=g;re(E)&&a(E);){if((E=E.parentElement)===s){A.push(E);break}E!=null&&E===document.body&&P(E)&&!P(document.documentElement)||E!=null&&P(E,h)&&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,c=T.width,w=T.top,v=T.right,y=T.bottom,F=T.left,B=o==="start"||o==="nearest"?w:o==="end"?y:w+x/2,R=f==="center"?F+c/2:f==="end"?v:F,j=[],N=0;N<A.length;N++){var b=A[N],Y=b.getBoundingClientRect(),ee=Y.height,ae=Y.width,ue=Y.top,Oe=Y.right,Ee=Y.bottom,xe=Y.left;if(u==="if-needed"&&w>=0&&F>=0&&y<=L&&v<=S&&w>=ue&&y<=Ee&&F>=xe&&v<=Oe)return j;var Ae=getComputedStyle(b),Re=parseInt(Ae.borderLeftWidth,10),pe=parseInt(Ae.borderTopWidth,10),he=parseInt(Ae.borderRightWidth,10),ke=parseInt(Ae.borderBottomWidth,10),et=0,We=0,nt="offsetWidth"in b?b.offsetWidth-b.clientWidth-Re-he:0,at="offsetHeight"in b?b.offsetHeight-b.clientHeight-pe-ke:0;if(s===b)et=o==="start"?B:o==="end"?B-L:o==="nearest"?X(C,C+L,L,pe,ke,C+B,C+B+x,x):B-L/2,We=f==="start"?R:f==="center"?R-S/2:f==="end"?R-S:X(O,O+S,S,Re,he,O+R,O+R+c,c),et=Math.max(0,et+C),We=Math.max(0,We+O);else{et=o==="start"?B-ue-pe:o==="end"?B-Ee+ke+at:o==="nearest"?X(ue,Ee,ee,pe,ke+at,B,B+x,x):B-(ue+ee/2)+at/2,We=f==="start"?R-xe-Re:f==="center"?R-(xe+ae/2)+nt/2:f==="end"?R-Oe+he+nt:X(xe,Oe,ae,Re,he+nt,R,R+c,c);var Pe=b.scrollLeft,je=b.scrollTop;B+=je-(et=Math.max(0,Math.min(je+et,b.scrollHeight-ee+at))),R+=Pe-(We=Math.max(0,Math.min(Pe+We,b.scrollWidth-ae+nt)))}j.push({el:b,top:et,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(u){var o=u.el,f=u.top,l=u.left;o.scroll&&m?o.scroll({top:f,left:l,behavior:p}):(o.scrollTop=f,o.scrollLeft=l)})}function W(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 u=W(p);return G(U(g,u),u.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"),W=Z("q1tI"),n=Z.n(W),D=Z("TSYQ"),g=Z.n(D),p=Z("4IlW");function m(x,c){var w=Object.keys(x);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(x);c&&(v=v.filter(function(y){return Object.getOwnPropertyDescriptor(x,y).enumerable})),w.push.apply(w,v)}return w}function u(x){for(var c=1;c<arguments.length;c++){var w=arguments[c]!=null?arguments[c]:{};c%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 c=f();return function(){var v=Object(G.a)(x),y;if(c){var F=Object(G.a)(this).constructor;y=Reflect.construct(v,arguments,F)}else y=v.apply(this,arguments);return Object(k.a)(this,y)}}function f(){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 h(x){x.preventDefault()}var a=function(c){return c.replace(/[^\w.-]+/g,"")},s=200,A=600,E=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,S=function(c){return c!=null},L=function(c,w){return w===c||typeof w=="number"&&typeof c=="number"&&isNaN(w)&&isNaN(c)},O=function(x){Object(U.a)(w,x);var c=o(w);function w(v){var y;Object(P.a)(this,w),y=c.call(this,v),y.onKeyDown=function(R){var j=y.props,N=j.onKeyDown,b=j.onPressEnter;if(R.keyCode===p.a.UP){var Y=y.getRatio(R);y.up(R,Y,null),y.stop()}else if(R.keyCode===p.a.DOWN){var ee=y.getRatio(R);y.down(R,ee,null),y.stop()}else R.keyCode===p.a.ENTER&&b&&b(R);if(y.recordCursorPosition(),y.lastKeyCode=R.keyCode,N){for(var ae=arguments.length,ue=new Array(ae>1?ae-1:0),Oe=1;Oe<ae;Oe++)ue[Oe-1]=arguments[Oe];N.apply(void 0,[R].concat(ue))}},y.onKeyUp=function(R){var j=y.props.onKeyUp;if(y.stop(),y.recordCursorPosition(),j){for(var N=arguments.length,b=new Array(N>1?N-1:0),Y=1;Y<N;Y++)b[Y-1]=arguments[Y];j.apply(void 0,[R].concat(b))}},y.onChange=function(R){var j=y.props.onChange;y.state.focused&&(y.inputting=!0),y.rawInput=y.props.parser(y.getValueFromEvent(R)),y.setState({inputValue:y.rawInput}),j(y.toNumber(y.rawInput))},y.onMouseUp=function(){var R=y.props.onMouseUp;y.recordCursorPosition(),R&&R.apply(void 0,arguments)},y.onFocus=function(){var R;y.setState({focused:!0}),(R=y.props).onFocus.apply(R,arguments)},y.onBlur=function(){var R=y.props.onBlur;y.inputting=!1,y.setState({focused:!1});var j=y.getCurrentValidValue(y.state.inputValue),N=y.setValue(j,l);if(R){var b=y.input.value,Y=y.getInputDisplayValue({focus:!1,value:N});y.input.value=Y&&Number(Y),R.apply(void 0,arguments),y.input.value=b}},y.getRatio=function(R){var j=1;return R.metaKey||R.ctrlKey?j=.1:R.shiftKey&&(j=10),j},y.getFullNum=function(R){return isNaN(R)?R:/e/i.test(String(R))?Number(R).toFixed(18).replace(/\.?0+$/,""):R},y.getPrecision=function(R){if(S(y.props.precision))return y.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},y.getInputDisplayValue=function(R){var j=R||y.state,N=j.focused,b=j.inputValue,Y=j.value,ee;N?ee=b:ee=y.toPrecisionAsStep(Y),ee==null&&(ee="");var ae=y.formatWrapper(ee);return S(y.props.decimalSeparator)&&(ae=ae.toString().replace(".",y.props.decimalSeparator)),ae},y.recordCursorPosition=function(){try{y.cursorStart=y.input.selectionStart,y.cursorEnd=y.input.selectionEnd,y.currentValue=y.input.value,y.cursorBefore=y.input.value.substring(0,y.cursorStart),y.cursorAfter=y.input.value.substring(y.cursorEnd)}catch(R){}},y.restoreByAfter=function(R){if(R===void 0)return!1;var j=y.input.value,N=j.lastIndexOf(R);if(N===-1)return!1;var b=y.cursorBefore.length;return y.lastKeyCode===p.a.DELETE&&y.cursorBefore.charAt(b-1)===R[0]?(y.fixCaret(b,b),!0):N+R.length===j.length?(y.fixCaret(N,N),!0):!1},y.partRestoreByAfter=function(R){return R===void 0?!1:Array.prototype.some.call(R,function(j,N){var b=R.substring(N);return y.restoreByAfter(b)})},y.isNotCompleteNumber=function(R){return isNaN(R)||R===""||R===null||R&&R.toString().indexOf(".")===R.toString().length-1},y.stop=function(){y.autoStepTimer&&clearTimeout(y.autoStepTimer)},y.down=function(R,j,N){y.pressingUpOrDown=!0,y.step("down",R,j,N)},y.up=function(R,j,N){y.pressingUpOrDown=!0,y.step("up",R,j,N)},y.saveInput=function(R){y.input=R};var F=v.value;F===void 0&&(F=v.defaultValue),y.state={focused:v.autoFocus};var B=y.getValidValue(y.toNumber(F));return y.state=u(u({},y.state),{},{inputValue:y.toPrecisionAsStep(B),value:B}),y}return Object(X.a)(w,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(y){var F=this.props,B=F.value,R=F.onChange,j=F.max,N=F.min,b=this.state.focused;if(y){if(!L(y.value,B)||!L(y.max,j)||!L(y.min,N)){var Y=b?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&&y.max!==j&&typeof ae=="number"&&ae>j&&R&&R(j),"min"in this.props&&y.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(Oe){}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(y){var F=y;return F===""?F="":this.isNotCompleteNumber(parseFloat(F))?F=this.state.value:F=this.getValidValue(F),this.toNumber(F)}},{key:"getValueFromEvent",value:function(y){var F=y.target.value.trim().replace(/。/g,".");return S(this.props.decimalSeparator)&&(F=F.replace(this.props.decimalSeparator,".")),F}},{key:"getValidValue",value:function(y){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(y);return isNaN(R)?y:(R<F&&(R=F),R>B&&(R=B),R)}},{key:"setValue",value:function(y,F){var B=this.props.precision,R=this.isNotCompleteNumber(parseFloat(y))?null:parseFloat(y),j=this.state.value,N=j===void 0?null:j,b=this.state.inputValue,Y=b===void 0?null:b,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(y)},F),ae&&this.props.onChange(R),R}},{key:"getMaxPrecision",value:function(y){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),b=this.getPrecision(j),Y=this.getPrecision(y);return y?Math.max(Y,N+b):N+b}},{key:"getPrecisionFactor",value:function(y){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,B=this.getMaxPrecision(y,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(y){return this.props.formatter?this.props.formatter(y):y}},{key:"toPrecisionAsStep",value:function(y){if(this.isNotCompleteNumber(y)||y==="")return y;var F=Math.abs(this.getMaxPrecision(y));return isNaN(F)?y.toString():Number(y).toFixed(F)}},{key:"toNumber",value:function(y){var F=this.props.precision,B=this.state.focused,R=y&&y.length>16&&B;return this.isNotCompleteNumber(y)||R?y:S(F)?Math.round(y*Math.pow(10,F))/Math.pow(10,F):Number(y)}},{key:"upStep",value:function(y,F){var B=this.props.step,R=this.getPrecisionFactor(y,F),j=Math.abs(this.getMaxPrecision(y,F)),N=((R*y+R*B*F)/R).toFixed(j);return this.toNumber(N)}},{key:"downStep",value:function(y,F){var B=this.props.step,R=this.getPrecisionFactor(y,F),j=Math.abs(this.getMaxPrecision(y,F)),N=((R*y-R*B*F)/R).toFixed(j);return this.toNumber(N)}},{key:"step",value:function(y,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 b=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(b))return;var Y=this["".concat(y,"Step")](b,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[y](F,R,!0)},j?s:A)}},{key:"fixCaret",value:function(y,F){if(y===void 0||F===void 0||!this.input||!this.input.value)return;try{var B=this.input.selectionStart,R=this.input.selectionEnd;(y!==B||F!==R)&&this.input.setSelectionRange(y,F)}catch(j){}}},{key:"render",value:function(){var y,F=this.props,B=F.prefixCls,R=F.disabled,j=F.readOnly,N=F.useTouch,b=F.autoComplete,Y=F.upHandler,ee=F.downHandler,ae=F.className,ue=F.max,Oe=F.min,Ee=F.style,xe=F.title,Ae=F.onMouseEnter,Re=F.onMouseLeave,pe=F.onMouseOver,he=F.onMouseOut,ke=F.required,et=F.onClick,We=F.tabIndex,nt=F.type,at=F.placeholder,Pe=F.id,je=F.inputMode,$e=F.pattern,se=F.step,_e=F.maxLength,Te=F.autoFocus,Se=F.name,Ge=F.onPaste,Ne=F.onInput,Fe=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"]),Ke=this.state,Je=Ke.value,Ve=Ke.focused,tt=g()(B,(y={},Object($.a)(y,ae,!!ae),Object($.a)(y,"".concat(B,"-disabled"),R),Object($.a)(y,"".concat(B,"-focused"),Ve),y)),Ie={};Object.keys(Fe).forEach(function(le){(le.substr(0,5)==="data-"||le.substr(0,5)==="aria-"||le==="role")&&(Ie[le]=Fe[le])});var it=!j&&!R,st=this.getInputDisplayValue(null),De=(Je||Je===0)&&(isNaN(Je)||Number(Je)>=ue),Me=(Je||Je===0)&&(isNaN(Je)||Number(Je)<=Oe),ve=De||R||j,ce=Me||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:tt,style:Ee,title:xe,onMouseEnter:Ae,onMouseLeave:Re,onMouseOver:pe,onMouseOut:he,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:h})),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:h}))),n.a.createElement("div",{className:"".concat(B,"-input-wrap")},n.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Oe,"aria-valuemax":ue,"aria-valuenow":Je,required:ke,type:nt,placeholder:at,onPaste:Ge,onClick:et,onMouseUp:this.onMouseUp,className:"".concat(B,"-input"),tabIndex:We,autoComplete:b,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:it?this.onKeyDown:l,onKeyUp:it?this.onKeyUp:l,autoFocus:Te,maxLength:_e,readOnly:j,disabled:R,max:ue,min:Oe,step:se,name:Se,title:xe,id:Pe,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(st),pattern:$e,inputMode:je,onInput:Ne},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:a,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 u}),Z.d(be,"a",function(){return o}),Z.d(be,"d",function(){return f}),Z.d(be,"e",function(){return l}),Z.d(be,"c",function(){return h});var re=Z("8HAY"),$=Z("Vhoy"),P=Z("MI8n"),X=Z("JYp7"),U=Z("pmY6"),k=Z("24hK"),G=Z("nnTU"),W=Z("T8No"),n=Z("Cg/j"),D=Z("t9D7"),g=function(a,s,A,E){var S=arguments.length,L=S<3?s:E===null?E=Object.getOwnPropertyDescriptor(s,A):E,O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(a,s,A,E);else for(var C=a.length-1;C>=0;C--)(O=a[C])&&(L=(S<3?O(L):S>3?O(s,A,L):O(s,A))||L);return S>3&&L&&Object.defineProperty(s,A,L),L},p=function(a,s){return function(A,E){s(A,E,a)}};function m(a){return a.command!==void 0}class u{constructor(a){this.id=u._idPool++,this._debugName=a}}u._idPool=0,u.CommandPalette=new u("CommandPalette"),u.EditorContext=new u("EditorContext"),u.SimpleEditorContext=new u("SimpleEditorContext"),u.EditorContextCopy=new u("EditorContextCopy"),u.EditorContextPeek=new u("EditorContextPeek"),u.MenubarEditMenu=new u("MenubarEditMenu"),u.MenubarCopy=new u("MenubarCopy"),u.MenubarGoMenu=new u("MenubarGoMenu"),u.MenubarSelectionMenu=new u("MenubarSelectionMenu"),u.InlineCompletionsActions=new u("InlineCompletionsActions");const o=Object(n.c)("menuService"),f=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new P.b,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:a=>a===u.CommandPalette}}addCommand(a){return this.addCommands(X.a.single(a))}addCommands(a){for(const s of a)this._commands.set(s.id,s);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),Object(U.i)(()=>{let s=!1;for(const A of a)s=this._commands.delete(A.id)||s;s&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(a){return this._commands.get(a)}getCommands(){const a=new Map;return this._commands.forEach((s,A)=>a.set(A,s)),a}appendMenuItem(a,s){return this.appendMenuItems(X.a.single({id:a,item:s}))}appendMenuItems(a){const s=new Set,A=new k.a;for(const{id:E,item:S}of a){let L=this._menuItems.get(E);L||(L=new k.a,this._menuItems.set(E,L)),A.push(L.push(S)),s.add(E)}return this._onDidChangeMenu.fire(s),Object(U.i)(()=>{if(A.size>0){for(let E of A)E();this._onDidChangeMenu.fire(s),A.clear()}})}getMenuItems(a){let s;return this._menuItems.has(a)?s=[...this._menuItems.get(a)]:s=[],a===u.CommandPalette&&this._appendImplicitItems(s),s}_appendImplicitItems(a){const s=new Set;for(const A of a)m(A)&&(s.add(A.command.id),A.alt&&s.add(A.alt.id));this._commands.forEach((A,E)=>{s.has(E)||a.push({command:A})})}};class l extends re.e{constructor(a,s,A,E){super(`submenuitem.${a.submenu.id}`,typeof a.title=="string"?a.title:a.title.value,[],"submenu");this.item=a,this._menuService=s,this._contextKeyService=A,this._options=E}get actions(){const a=[],s=this._menuService.createMenu(this.item.submenu,this._contextKeyService),A=s.getActions(this._options);s.dispose();for(const[,E]of A)E.length>0&&(a.push(...E),a.push(new re.d));return a.length&&a.pop(),a}}let h=class a{constructor(s,A,E,S,L){var O,C;if(this._commandService=L,this.id=s.id,this.label=(E==null?void 0:E.renderShortTitle)&&s.shortTitle?typeof s.shortTitle=="string"?s.shortTitle:s.shortTitle.value:typeof s.title=="string"?s.title:s.title.value,this.tooltip=(C=typeof s.tooltip=="string"?s.tooltip:(O=s.tooltip)===null||O===void 0?void 0:O.value)!==null&&C!==void 0?C:"",this.enabled=!s.precondition||S.contextMatchesRules(s.precondition),this.checked=void 0,s.toggled){const T=s.toggled.condition?s.toggled:{condition:s.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=s,this.alt=A?new a(A,void 0,E,S,L):void 0,this._options=E,D.d.isThemeIcon(s.icon)&&(this.class=$.a.asClassName(s.icon))}dispose(){}run(...s){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,...s]),this._commandService.executeCommand(this.id,...S)}};h=g([p(3,W.b),p(4,G.b)],h)},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),W=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),u=m[0],o=m[1],f=Object(X.useState)(0),l=Object(P.a)(f,2),h=l[0],a=l[1],s=Object(X.useRef)("");Object(X.useEffect)(function(){var T=W.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(){s.current=u},[u]);function A(T){T.keyCode==27&&s.current&&E()}function E(){document.body.style.overflow="auto",o("")}function S(){a(h+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,u?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:u},"\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:u,alt:"\u9884\u89C8\u5927\u56FE",style:{transform:"rotate(".concat(h,"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 b=re.findModeByName(N);b&&(N=b.mime||b.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 W in G)G.hasOwnProperty(W)&&P.tokenTypeOverrides[W]&&(G[W]=P.tokenTypeOverrides[W]);var n=/^([*\-_])(?:\s*\1){2,}\s*$/,D=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,g=/^\[(x| )\](?=\s)/i,p=P.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,m=/^ {0,3}(?:\={1,}|-{2,})\s*$/,u=/^[^#!\[\]*_\\<>` "'(~:]+/,o=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,f=/^\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]/,h=" ";function a(N,b,Y){return b.f=b.inline=Y,Y(N,b)}function s(N,b,Y){return b.f=b.block=Y,Y(N,b)}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 b=U;if(!b){var Y=re.innerMode(X,N.htmlState);b=Y.mode.name=="xml"&&Y.state.tagStart===null&&!Y.state.context&&Y.state.tokenize.isInText}b&&(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,b){var Y=N.column()===b.indentation,ee=A(b.prevLine.stream),ae=b.indentedCode,ue=b.prevLine.hr,Oe=b.list!==!1,Ee=(b.listStack[b.listStack.length-1]||0)+3;b.indentedCode=!1;var xe=b.indentation;if(b.indentationDiff===null&&(b.indentationDiff=b.indentation,Oe)){for(b.list=null;xe<b.listStack[b.listStack.length-1];)b.listStack.pop(),b.listStack.length?b.indentation=b.listStack[b.listStack.length-1]:b.list=!1;b.list!==!1&&(b.indentationDiff=xe-b.listStack[b.listStack.length-1])}var Ae=!ee&&!ue&&!b.prevLine.header&&(!Oe||!ae)&&!b.prevLine.fencedCodeEnd,Re=(b.list===!1||ue||ee)&&b.indentation<=Ee&&N.match(n),pe=null;if(b.indentationDiff>=4&&(ae||b.prevLine.fencedCodeEnd||b.prevLine.header||ee))return N.skipToEnd(),b.indentedCode=!0,G.code;if(N.eatSpace())return null;if(Y&&b.indentation<=Ee&&(pe=N.match(p))&&pe[1].length<=6)return b.quote=0,b.header=pe[1].length,b.thisLine.header=!0,P.highlightFormatting&&(b.formatting="header"),b.f=b.inline,C(b);if(b.indentation<=Ee&&N.eat(">"))return b.quote=Y?1:b.quote+1,P.highlightFormatting&&(b.formatting="quote"),N.eatSpace(),C(b);if(!Re&&!b.setext&&Y&&b.indentation<=Ee&&(pe=N.match(D))){var he=pe[1]?"ol":"ul";return b.indentation=xe+N.current().length,b.list=!0,b.quote=0,b.listStack.push(b.indentation),b.em=!1,b.strong=!1,b.code=!1,b.strikethrough=!1,P.taskLists&&N.match(g,!1)&&(b.taskList=!0),b.f=b.inline,P.highlightFormatting&&(b.formatting=["list","list-"+he]),C(b)}else{if(Y&&b.indentation<=Ee&&(pe=N.match(o,!0)))return b.quote=0,b.fencedEndRE=new RegExp(pe[1]+"+ *$"),b.localMode=P.fencedCodeBlockHighlighting&&k(pe[2]||P.fencedCodeBlockDefaultMode),b.localMode&&(b.localState=re.startState(b.localMode)),b.f=b.block=O,P.highlightFormatting&&(b.formatting="code-block"),b.code=-1,C(b);if(b.setext||(!Ae||!Oe)&&!b.quote&&b.list===!1&&!b.code&&!Re&&!f.test(N.string)&&(pe=N.lookAhead(1))&&(pe=pe.match(m)))return b.setext?(b.header=b.setext,b.setext=0,N.skipToEnd(),P.highlightFormatting&&(b.formatting="header")):(b.header=pe[0].charAt(0)=="="?1:2,b.setext=b.header),b.thisLine.header=!0,b.f=b.inline,C(b);if(Re)return N.skipToEnd(),b.hr=!0,b.thisLine.hr=!0,G.hr;if(N.peek()==="[")return a(N,b,F)}return a(N,b,b.inline)}function L(N,b){var Y=X.token(N,b.htmlState);if(!U){var ee=re.innerMode(X,b.htmlState);(ee.mode.name=="xml"&&ee.state.tagStart===null&&!ee.state.context&&ee.state.tokenize.isInText||b.md_inside&&N.current().indexOf(">")>-1)&&(b.f=x,b.block=S,b.htmlState=null)}return Y}function O(N,b){var Y=b.listStack[b.listStack.length-1]||0,ee=b.indentation<Y,ae=Y+3;if(b.fencedEndRE&&b.indentation<=ae&&(ee||N.match(b.fencedEndRE))){P.highlightFormatting&&(b.formatting="code-block");var ue;return ee||(ue=C(b)),b.localMode=b.localState=null,b.block=S,b.f=x,b.fencedEndRE=null,b.code=0,b.thisLine.fencedCodeEnd=!0,ee?s(N,b,b.block):ue}else return b.localMode?b.localMode.token(N,b.localState):(N.skipToEnd(),G.code)}function C(N){var b=[];if(N.formatting){b.push(G.formatting),typeof N.formatting=="string"&&(N.formatting=[N.formatting]);for(var Y=0;Y<N.formatting.length;Y++)b.push(G.formatting+"-"+N.formatting[Y]),N.formatting[Y]==="header"&&b.push(G.formatting+"-"+N.formatting[Y]+"-"+N.header),N.formatting[Y]==="quote"&&(!P.maxBlockquoteDepth||P.maxBlockquoteDepth>=N.quote?b.push(G.formatting+"-"+N.formatting[Y]+"-"+N.quote):b.push("error"))}if(N.taskOpen)return b.push("meta"),b.length?b.join(" "):null;if(N.taskClosed)return b.push("property"),b.length?b.join(" "):null;if(N.linkHref?b.push(G.linkHref,"url"):(N.strong&&b.push(G.strong),N.em&&b.push(G.em),N.strikethrough&&b.push(G.strikethrough),N.emoji&&b.push(G.emoji),N.linkText&&b.push(G.linkText),N.code&&b.push(G.code),N.image&&b.push(G.image),N.imageAltText&&b.push(G.imageAltText,"link"),N.imageMarker&&b.push(G.imageMarker)),N.header&&b.push(G.header,G.header+"-"+N.header),N.quote&&(b.push(G.quote),!P.maxBlockquoteDepth||P.maxBlockquoteDepth>=N.quote?b.push(G.quote+"-"+N.quote):b.push(G.quote+"-"+P.maxBlockquoteDepth)),N.list!==!1){var ee=(N.listStack.length-1)%3;ee?ee===1?b.push(G.list2):b.push(G.list3):b.push(G.list1)}return N.trailingSpaceNewLine?b.push("trailing-space-new-line"):N.trailingSpace&&b.push("trailing-space-"+(N.trailingSpace%2?"a":"b")),b.length?b.join(" "):null}function T(N,b){return N.match(u,!0)?C(b):void 0}function x(N,b){var Y=b.text(N,b);if(typeof Y!="undefined")return Y;if(b.list)return b.list=null,C(b);if(b.taskList){var ee=N.match(g,!0)[1]===" ";return ee?b.taskOpen=!0:b.taskClosed=!0,P.highlightFormatting&&(b.formatting="task"),b.taskList=!1,C(b)}if(b.taskOpen=!1,b.taskClosed=!1,b.header&&N.match(/^#+$/,!0))return P.highlightFormatting&&(b.formatting="header"),C(b);var ae=N.next();if(b.linkTitle){b.linkTitle=!1;var ue=ae;ae==="("&&(ue=")"),ue=(ue+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Oe="^\\s*(?:[^"+ue+"\\\\]+|\\\\\\\\|\\\\.)"+ue;if(N.match(new RegExp(Oe),!0))return G.linkHref}if(ae==="`"){var Ee=b.formatting;P.highlightFormatting&&(b.formatting="code"),N.eatWhile("`");var xe=N.current().length;if(b.code==0&&(!b.quote||xe==1))return b.code=xe,C(b);if(xe==b.code){var Ae=C(b);return b.code=0,Ae}else return b.formatting=Ee,C(b)}else if(b.code)return C(b);if(ae==="\\"&&(N.next(),P.highlightFormatting)){var Re=C(b),pe=G.formatting+"-escape";return Re?Re+" "+pe:pe}if(ae==="!"&&N.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return b.imageMarker=!0,b.image=!0,P.highlightFormatting&&(b.formatting="image"),C(b);if(ae==="["&&b.imageMarker&&N.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return b.imageMarker=!1,b.imageAltText=!0,P.highlightFormatting&&(b.formatting="image"),C(b);if(ae==="]"&&b.imageAltText){P.highlightFormatting&&(b.formatting="image");var Re=C(b);return b.imageAltText=!1,b.image=!1,b.inline=b.f=w,Re}if(ae==="["&&!b.image)return b.linkText&&N.match(/^.*?\]/)||(b.linkText=!0,P.highlightFormatting&&(b.formatting="link")),C(b);if(ae==="]"&&b.linkText){P.highlightFormatting&&(b.formatting="link");var Re=C(b);return b.linkText=!1,b.inline=b.f=N.match(/\(.*?\)| ?\[.*?\]/,!1)?w:x,Re}if(ae==="<"&&N.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){b.f=b.inline=c,P.highlightFormatting&&(b.formatting="link");var Re=C(b);return Re?Re+=" ":Re="",Re+G.linkInline}if(ae==="<"&&N.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){b.f=b.inline=c,P.highlightFormatting&&(b.formatting="link");var Re=C(b);return Re?Re+=" ":Re="",Re+G.linkEmail}if(P.xml&&ae==="<"&&N.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var he=N.string.indexOf(">",N.pos);if(he!=-1){var ke=N.string.substring(N.start,he);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(ke)&&(b.md_inside=!0)}return N.backUp(1),b.htmlState=re.startState(X),s(N,b,L)}if(P.xml&&ae==="<"&&N.match(/^\/\w*?>/))return b.md_inside=!1,"tag";if(ae==="*"||ae==="_"){for(var et=1,We=N.pos==1?" ":N.string.charAt(N.pos-2);et<3&&N.eat(ae);)et++;var nt=N.peek()||" ",at=!/\s/.test(nt)&&(!l.test(nt)||/\s/.test(We)||l.test(We)),Pe=!/\s/.test(We)&&(!l.test(We)||/\s/.test(nt)||l.test(nt)),je=null,$e=null;if(et%2&&(!b.em&&at&&(ae==="*"||!Pe||l.test(We))?je=!0:b.em==ae&&Pe&&(ae==="*"||!at||l.test(nt))&&(je=!1)),et>1&&(!b.strong&&at&&(ae==="*"||!Pe||l.test(We))?$e=!0:b.strong==ae&&Pe&&(ae==="*"||!at||l.test(nt))&&($e=!1)),$e!=null||je!=null){P.highlightFormatting&&(b.formatting=je==null?"strong":$e==null?"em":"strong em"),je===!0&&(b.em=ae),$e===!0&&(b.strong=ae);var Ae=C(b);return je===!1&&(b.em=!1),$e===!1&&(b.strong=!1),Ae}}else if(ae===" "&&(N.eat("*")||N.eat("_"))){if(N.peek()===" ")return C(b);N.backUp(1)}if(P.strikethrough){if(ae==="~"&&N.eatWhile(ae)){if(b.strikethrough){P.highlightFormatting&&(b.formatting="strikethrough");var Ae=C(b);return b.strikethrough=!1,Ae}else if(N.match(/^[^\s]/,!1))return b.strikethrough=!0,P.highlightFormatting&&(b.formatting="strikethrough"),C(b)}else if(ae===" "&&N.match(/^~~/,!0)){if(N.peek()===" ")return C(b);N.backUp(2)}}if(P.emoji&&ae===":"&&N.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){b.emoji=!0,P.highlightFormatting&&(b.formatting="emoji");var se=C(b);return b.emoji=!1,se}return ae===" "&&(N.match(/^ +$/,!1)?b.trailingSpace++:b.trailingSpace&&(b.trailingSpaceNewLine=!0)),C(b)}function c(N,b){var Y=N.next();if(Y===">"){b.f=b.inline=x,P.highlightFormatting&&(b.formatting="link");var ee=C(b);return ee?ee+=" ":ee="",ee+G.linkInline}return N.match(/^[^>]+/,!0),G.linkInline}function w(N,b){if(N.eatSpace())return null;var Y=N.next();return Y==="("||Y==="["?(b.f=b.inline=y(Y==="("?")":"]"),P.highlightFormatting&&(b.formatting="link-string"),b.linkHref=!0,C(b)):"error"}var v={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function y(N){return function(b,Y){var ee=b.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 b.match(v[N]),Y.linkHref=!0,C(Y)}}function F(N,b){return N.match(/^([^\]\\]|\\.)*\]:/,!1)?(b.f=B,N.next(),P.highlightFormatting&&(b.formatting="link"),b.linkText=!0,C(b)):a(N,b,x)}function B(N,b){if(N.match(/^\]:/,!0)){b.f=b.inline=R,P.highlightFormatting&&(b.formatting="link");var Y=C(b);return b.linkText=!1,Y}return N.match(/^([^\]\\]|\\.)+/,!0),G.linkText}function R(N,b){return N.eatSpace()?null:(N.match(/^[^\s]+/,!0),N.peek()===void 0?b.linkTitle=!0:N.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),b.f=b.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,b){if(b.formatting=!1,N!=b.thisLine.stream){if(b.header=0,b.hr=!1,N.match(/^\s*$/,!0))return E(b),null;if(b.prevLine=b.thisLine,b.thisLine={stream:N},b.taskList=!1,b.trailingSpace=0,b.trailingSpaceNewLine=!1,!b.localState&&(b.f=b.block,b.f!=L)){var Y=N.match(/^\s*/,!0)[0].replace(/\t/g,h).length;if(b.indentation=Y,b.indentationDiff=null,Y>0)return null}}return b.f(N,b)},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,b,Y){return N.block==L&&X.indent?X.indent(N.htmlState,b,Y):N.localState&&N.localMode.indent?N.localMode.indent(N.localState,b,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 W});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"),W=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 f=n.handler;n.handler=function(l,...h){return Object(U.o)(h,o),f(l,...h)}}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),u=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),u}registerCommandAlias(n,D){return W.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}};W.registerCommand("noop",()=>{})},osHv:function(ht,be,Z){(function(re){re(Z("VrN/"))})(function(re){"use strict";var $=re.Pos;function P(l,h){return l.line-h.line||l.ch-h.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,h,a,s){this.line=h,this.ch=a,this.cm=l,this.text=l.getLine(h),this.min=s?Math.max(s.from,l.firstLine()):l.firstLine(),this.max=s?Math.min(s.to-1,l.lastLine()):l.lastLine()}function W(l,h){var a=l.cm.getTokenTypeAt($(l.line,h));return a&&/\btag\b/.test(a)}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 h=l.text.indexOf(">",l.ch);if(h==-1){if(n(l))continue;return}if(!W(l,h+1)){l.ch=h+1;continue}var a=l.text.lastIndexOf("/",h),s=a>-1&&!/\S/.test(l.text.slice(a+1,h));return l.ch=h+1,s?"selfClose":"regular"}}function p(l){for(;;){var h=l.ch?l.text.lastIndexOf("<",l.ch-1):-1;if(h==-1){if(D(l))continue;return}if(!W(l,h+1)){l.ch=h;continue}k.lastIndex=h,l.ch=h;var a=k.exec(l.text);if(a&&a.index==h)return a}}function m(l){for(;;){k.lastIndex=l.ch;var h=k.exec(l.text);if(!h){if(n(l))continue;return}if(!W(l,h.index+1)){l.ch=h.index+1;continue}return l.ch=h.index+h[0].length,h}}function u(l){for(;;){var h=l.ch?l.text.lastIndexOf(">",l.ch-1):-1;if(h==-1){if(D(l))continue;return}if(!W(l,h+1)){l.ch=h;continue}var a=l.text.lastIndexOf("/",h),s=a>-1&&!/\S/.test(l.text.slice(a+1,h));return l.ch=h+1,s?"selfClose":"regular"}}function o(l,h){for(var a=[];;){var s=m(l),A,E=l.line,S=l.ch-(s?s[0].length:0);if(!s||!(A=g(l)))return;if(A=="selfClose")continue;if(s[1]){for(var L=a.length-1;L>=0;--L)if(a[L]==s[2]){a.length=L;break}if(L<0&&(!h||h==s[2]))return{tag:s[2],from:$(E,S),to:$(l.line,l.ch)}}else a.push(s[2])}}function f(l,h){for(var a=[];;){var s=u(l);if(!s)return;if(s=="selfClose"){p(l);continue}var A=l.line,E=l.ch,S=p(l);if(!S)return;if(S[1])a.push(S[2]);else{for(var L=a.length-1;L>=0;--L)if(a[L]==S[2]){a.length=L;break}if(L<0&&(!h||h==S[2]))return{tag:S[2],from:$(l.line,l.ch),to:$(A,E)}}}}re.registerHelper("fold","xml",function(l,h){for(var a=new G(l,h.line,0);;){var s=m(a);if(!s||a.line!=h.line)return;var A=g(a);if(!A)return;if(!s[1]&&A!="selfClose"){var E=$(a.line,a.ch),S=o(a,s[2]);return S&&P(S.from,E)>0?{from:E,to:S.from}:null}}}),re.findMatchingTag=function(l,h,a){var s=new G(l,h.line,h.ch,a);if(s.text.indexOf(">")==-1&&s.text.indexOf("<")==-1)return;var A=g(s),E=A&&$(s.line,s.ch),S=A&&p(s);if(!A||!S||P(s,h)>0)return;var L={from:$(s.line,s.ch),to:E,tag:S[2]};return A=="selfClose"?{open:L,close:null,at:"open"}:S[1]?{open:f(s,S[2]),close:L,at:"close"}:(s=new G(l,E.line,E.ch,a),{open:L,close:o(s,S[2]),at:"open"})},re.findEnclosingTag=function(l,h,a,s){for(var A=new G(l,h.line,h.ch,a);;){var E=f(A,s);if(!E)break;var S=new G(l,h.line,h.ch,a),L=o(S,E.tag);if(L)return{open:E,close:L}}},re.scanForClosingTag=function(l,h,a,s){var A=new G(l,h.line,h.ch,s?{from:0,to:s}:null);return o(A,a)}})},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("9og8"),G=Z("tJVT"),W=Z("WmNS"),n=Z.n(W),D=Z("q1tI"),g=Z.n(D),p=Z("vHTk"),m=Z.n(p),u=Z("yEEn"),o=Z("ZW9T"),f=Z("1vsH"),l=Z("V0Rq"),h=Z("m3rI");be.a=function(a){var s,A,E,S,L,O,C,T=a.editOffice,x=T===void 0?"view":T,c=a.data,w=a.theme,v=a.type,y=a.filename,F=a.monacoEditor,B=a.className,R=a.style,j=a.close,N=a.onClose,b=a.hasMask,Y=a.disabledDownload,ee=Object(D.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),ae=Object(G.a)(ee,2),ue=ae[0],Oe=ae[1],Ee=Object(D.useState)(""),xe=Object(G.a)(Ee,2),Ae=xe[0],Re=xe[1],pe=Object(D.useState)(),he=Object(G.a)(pe,2),ke=he[0],et=he[1],We=window.ENV==="build"?"/react/build":"",nt=h.a.PROXY_SERVER||location.origin,at,Pe=1024*1024,je=10*Pe,$e=Object(D.useRef)();(s=c)!==null&&s!==void 0&&s.startsWith("/api")&&v!=="txt"&&(c=h.a.API_SERVER+c),v==="office"&&(at=Object(f.T)(c).filesize,at>je&&(v="other")),y&&F&&(F.filename=y),Object(D.useEffect)(function(){var Se,Ge,Ne=(Se=document.cookie)===null||Se===void 0||((Ge=Se.replace(/\s/g,""))===null||Ge===void 0)?void 0:Ge.split(";");Ne==null||Ne.map(function(Fe){var Ke=Fe.split("=");Ke[0]==="_educoder_session"&&Re(Ke[1])})},[]),Object(D.useEffect)(function(){v==="office"&&se()},[v,c]);var se=function(){var Se=Object(k.a)(n.a.mark(function Ge(){var Ne,Fe,Ke;return n.a.wrap(function(Ve){for(;;)switch(Ve.prev=Ve.next){case 0:return console.log("data:",c),Ne=c,c.startsWith("http")||(Ne=location.origin+Ne),Fe=new URL(Ne).pathname.split("/").pop(),Ve.next=6,Object(l.V)({attachment_id:Fe});case 6:Ke=Ve.sent,et(Ke);case 8:case"end":return Ve.stop()}},Ge)}));return function(){return Se.apply(this,arguments)}}(),_e=function(){if(c.startsWith("http")||c.startsWith("blob:")){Te();return}Object(f.z)(y||"educoder",c,y)},Te=function(){Object(f.x)(y||"educoder",decodeURIComponent(c))};return g.a.createElement("div",{style:Object(U.a)({},R||{}),className:"".concat(b&&m.a.bgBlack," ").concat(v?m.a.wrp:"hide")},j&&g.a.createElement("div",{className:m.a.close,ref:$e},!Y&&g.a.createElement(X.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return $e.current}},g.a.createElement("span",{onClick:Te},g.a.createElement("i",{className:"icon-quxiaozhiding"}))),g.a.createElement(X.a,{title:"\u5173\u95ED",getPopupContainer:function(){return $e.current}},g.a.createElement("span",{className:"",onClick:N},g.a.createElement("i",{className:"icon-guanbi1"})))),g.a.createElement("div",{className:"".concat(m.a[B]," ").concat(B," ").concat(m.a.monaco," ").concat(v==="txt"?"show":"hide")},v==="txt"&&g.a.createElement(o.b,F)),v==="audio"&&g.a.createElement("audio",{src:"".concat(((A=c)===null||A===void 0?void 0:A.indexOf("http://"))>-1||((E=c)===null||E===void 0?void 0:E.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(c),autoPlay:!0}),v==="video"&&g.a.createElement(g.a.Fragment,null,((S=c)===null||S===void 0?void 0:S.indexOf("http"))>-1?g.a.createElement("video",{controls:!0,src:"".concat(c),autoPlay:!0}):g.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(c),autoPlay:!0})),v==="office"&&ke&&g.a.createElement("iframe",{src:"".concat(We,"/office.html?key=").concat(ke.key,"&url=").concat(nt+ke.url,"&callbackUrl=").concat(nt+ke.callbackUrl,"&fileType=").concat(ke.fileType,"&title=").concat(ke.title,"&model=").concat(x,"&officeServer=").concat(h.a.OFFICE_SERVER,"&disabledDownload=").concat(!!Y)}),v==="html"&&g.a.createElement("iframe",{src:c+"&disposition=inline"}),v==="pdf"&&g.a.createElement("iframe",{src:"".concat(We,"/js/pdfview/index.html?url=").concat(c,"&disabledDownload=").concat(!!Y)}),v==="image"&&g.a.createElement("img",{src:"".concat(((L=c)===null||L===void 0?void 0:L.indexOf("http://"))>-1||((O=c)===null||O===void 0?void 0:O.indexOf("https://"))>-1||(C=c)!==null&&C!==void 0&&C.startsWith("/api")?"":"data:image/png;base64,").concat(c)}),v==="other"&&g.a.createElement("div",null,g.a.createElement($.a,{type:"primary",size:"large",onClick:_e},g.a.createElement(u.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),v==="download"&&g.a.createElement($.a,{type:"primary",size:"large",onClick:_e},g.a.createElement(u.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 u}),Z.d(be,"i",function(){return o}),Z.d(be,"b",function(){return f}),Z.d(be,"a",function(){return l}),Z.d(be,"d",function(){return h}),Z.d(be,"c",function(){return a});var re=Z("C/vA"),$=Z("JYp7");const P=!1;let X=null;function U(s){X=s}if(P){const s="__is_disposable_tracked__";U(new class{trackDisposable(A){const E=new Error("Potentially leaked disposable").stack;setTimeout(()=>{A[s]||console.log(E)},3e3)}setParent(A,E){if(A&&A!==l.None)try{A[s]=!0}catch(S){}}markAsDisposed(A){if(A&&A!==l.None)try{A[s]=!0}catch(E){}}markAsSingleton(A){}})}function k(s){return X==null||X.trackDisposable(s),s}function G(s){X==null||X.markAsDisposed(s)}function W(s,A){X==null||X.setParent(s,A)}function n(s,A){if(!X)return;for(const E of s)X.setParent(E,A)}function D(s){return X==null||X.markAsSingleton(s),s}class g extends Error{constructor(s){super(`Encountered errors while disposing of store. Errors: [${s.join(", ")}]`);this.errors=s}}function p(s){return typeof s.dispose=="function"&&s.dispose.length===0}function m(s){if($.a.is(s)){let A=[];for(const E of s)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(s)?[]:s}else if(s)return s.dispose(),s}function u(...s){const A=o(()=>m(s));return n(s,A),A}function o(s){const A=k({dispose:Object(re.a)(()=>{G(A),s()})});return A}class f{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(s){if(!s)return s;if(s===this)throw new Error("Cannot register a disposable on itself!");return W(s,this),this._isDisposed?f.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(s),s}}f.DISABLE_DISPOSED_WARNING=!1;class l{constructor(){this._store=new f,k(this),W(this._store,this)}dispose(){G(this),this._store.dispose()}_register(s){if(s===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(s)}}l.None=Object.freeze({dispose(){}});class h{constructor(){this._isDisposed=!1,k(this)}get value(){return this._isDisposed?void 0:this._value}set value(s){var A;if(this._isDisposed||s===this._value)return;(A=this._value)===null||A===void 0||A.dispose(),s&&W(s,this),this._value=s}clear(){this.value=void 0}dispose(){var s;this._isDisposed=!0,G(this),(s=this._value)===null||s===void 0||s.dispose(),this._value=void 0}clearAndLeak(){const s=this._value;return this._value=void 0,s&&W(s,null),s}}class a{constructor(s){this.object=s}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 f=this.__items.length-1;f>=0;f--)if(this.__items[f].match(o))return!0;return!1},p.prototype.set_indent=function(o,f){this.is_empty()&&(this.__indent_count=o||0,this.__alignment_count=f||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 f=o.lastIndexOf(`
|
|
`);f!==-1?this.__character_count=o.length-f: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,f){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)),f=f||"",o.indent_level>0&&(f=new Array(o.indent_level+1).join(this.__indent_string)),this.__base_string=f,this.__base_string_length=f.length}m.prototype.get_indent_size=function(o,f){var l=this.__base_string_length;return f=f||0,o<0&&(l=0),l+=o*this.__indent_size,l+=f,l},m.prototype.get_indent_string=function(o,f){var l=this.__base_string;return f=f||0,o<0&&(o=0,l=""),f+=o*this.__indent_size,this.__ensure_cache(f),l+=this.__cache[f],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,f=0,l="";this.__indent_size&&o>=this.__indent_size&&(f=Math.floor(o/this.__indent_size),o-=f*this.__indent_size,l=new Array(f+1).join(this.__indent_string)),o&&(l+=new Array(o+1).join(" ")),this.__cache.push(l)};function u(o,f){this.__indent_cache=new m(o,f),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()}u.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},u.prototype.get_line_number=function(){return this.__lines.length},u.prototype.get_indent_string=function(o,f){return this.__indent_cache.get_indent_string(o,f)},u.prototype.get_indent_size=function(o,f){return this.__indent_cache.get_indent_size(o,f)},u.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},u.prototype.add_new_line=function(o){return this.is_empty()||!o&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},u.prototype.get_code=function(o){this.trim(!0);var f=this.current_line.pop();f&&(f[f.length-1]===`
|
|
`&&(f=f.replace(/\n+$/g,"")),this.current_line.push(f)),this._end_with_newline&&this.__add_outputline();var l=this.__lines.join(`
|
|
`);return o!==`
|
|
`&&(l=l.replace(/[\n]/g,o)),l},u.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},u.prototype.set_indent=function(o,f){return o=o||0,f=f||0,this.next_line.set_indent(o,f),this.__lines.length>1?(this.current_line.set_indent(o,f),!0):(this.current_line.set_indent(),!1)},u.prototype.add_raw_token=function(o){for(var f=0;f<o.newlines;f++)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},u.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()},u.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(" "))},u.prototype.remove_indent=function(o){for(var f=this.__lines.length;o<f;)this.__lines[o]._remove_indent(),o++;this.current_line._remove_wrap_indent()},u.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},u.prototype.just_added_newline=function(){return this.current_line.is_empty()},u.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},u.prototype.ensure_empty_line_above=function(o,f){for(var l=this.__lines.length-2;l>=0;){var h=this.__lines[l];if(h.is_empty())break;if(h.item(0).indexOf(o)!==0&&h.item(-1)!==f){this.__lines.splice(l+1,0,new p(this)),this.previous_line=this.__lines[this.__lines.length-2];break}l--}},g.exports.Output=u},function(g){function p(m,u,o,f){this.type=m,this.text=u,this.comments_before=null,this.newlines=o||0,this.whitespace_before=f||"",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,f){this.raw_options=m(o,f),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,f){var l=this.raw_options[o],h=f||[];return typeof l=="object"?l!==null&&typeof l.concat=="function"&&(h=l.concat()):typeof l=="string"&&(h=l.split(/[^a-zA-Z0-9_\/\-]+/)),h},p.prototype._get_boolean=function(o,f){var l=this.raw_options[o],h=l===void 0?!!f:!!l;return h},p.prototype._get_characters=function(o,f){var l=this.raw_options[o],h=f||"";return typeof l=="string"&&(h=l.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),h},p.prototype._get_number=function(o,f){var l=this.raw_options[o];f=parseInt(f,10),isNaN(f)&&(f=0);var h=parseInt(l,10);return isNaN(h)&&(h=f),h},p.prototype._get_selection=function(o,f,l){var h=this._get_selection_list(o,f,l);if(h.length!==1)throw new Error("Invalid Option Value: The option '"+o+`' can only be one of the following values:
|
|
`+f+`
|
|
You passed in: '`+this.raw_options[o]+"'");return h[0]},p.prototype._get_selection_list=function(o,f,l){if(!f||f.length===0)throw new Error("Selection list cannot be empty.");if(l=l||[f[0]],!this._is_valid_selection(l,f))throw new Error("Invalid Default Value!");var h=this._get_array(o,l);if(!this._is_valid_selection(h,f))throw new Error("Invalid Option Value: The option '"+o+`' can contain only the following values:
|
|
`+f+`
|
|
You passed in: '`+this.raw_options[o]+"'");return h},p.prototype._is_valid_selection=function(o,f){return o.length&&f.length&&!o.some(function(l){return f.indexOf(l)===-1})};function m(o,f){var l={};o=u(o);var h;for(h in o)h!==f&&(l[h]=o[h]);if(f&&o[f])for(h in o[f])l[h]=o[f][h];return l}function u(o){var f={},l;for(l in o){var h=l.replace(/-/g,"_");f[h]=o[l]}return f}g.exports.Options=p,g.exports.normalizeOpts=u,g.exports.mergeOpts=m},,function(g){var p=RegExp.prototype.hasOwnProperty("sticky");function m(u){this.__input=u||"",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 u=null;return this.hasNext()&&(u=this.__input.charAt(this.__position),this.__position+=1),u},m.prototype.peek=function(u){var o=null;return u=u||0,u+=this.__position,u>=0&&u<this.__input_length&&(o=this.__input.charAt(u)),o},m.prototype.__match=function(u,o){u.lastIndex=o;var f=u.exec(this.__input);return f&&!(p&&u.sticky)&&(f.index!==o&&(f=null)),f},m.prototype.test=function(u,o){return o=o||0,o+=this.__position,o>=0&&o<this.__input_length?!!this.__match(u,o):!1},m.prototype.testChar=function(u,o){var f=this.peek(o);return u.lastIndex=0,f!==null&&u.test(f)},m.prototype.match=function(u){var o=this.__match(u,this.__position);return o?this.__position+=o[0].length:o=null,o},m.prototype.read=function(u,o,f){var l="",h;return u&&(h=this.match(u),h&&(l+=h[0])),o&&(h||!u)&&(l+=this.readUntil(o,f)),l},m.prototype.readUntil=function(u,o){var f="",l=this.__position;u.lastIndex=this.__position;var h=u.exec(this.__input);return h?(l=h.index,o&&(l+=h[0].length)):l=this.__input_length,f=this.__input.substring(this.__position,l),this.__position=l,f},m.prototype.readUntilAfter=function(u){return this.readUntil(u,!0)},m.prototype.get_regexp=function(u,o){var f=null,l="g";return o&&p&&(l="y"),typeof u=="string"&&u!==""?f=new RegExp(u,l):u&&(f=new RegExp(u.source,l)),f},m.prototype.get_literal_regexp=function(u){return RegExp(u.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},m.prototype.peekUntilAfter=function(u){var o=this.__position,f=this.readUntilAfter(u);return this.__position=o,f},m.prototype.lookBack=function(u){var o=this.__position-1;return o>=u.length&&this.__input.substring(o-u.length,o).toLowerCase()===u},g.exports.InputScanner=m},function(g,p,m){var u=m(8).InputScanner,o=m(3).Token,f=m(10).TokenStream,l=m(11).WhitespacePattern,h={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},a=function(s,A){this._input=new u(s),this._options=A||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new l(this._input)};a.prototype.tokenize=function(){this._input.restart(),this.__tokens=new f,this._reset();for(var s,A=new o(h.START,""),E=null,S=[],L=new f;A.type!==h.EOF;){for(s=this._get_next_token(A,E);this._is_comment(s);)L.add(s),s=this._get_next_token(A,E);L.isEmpty()||(s.comments_before=L,L=new f),s.parent=E,this._is_opening(s)?(S.push(E),E=s):E&&this._is_closing(s,E)&&(s.opened=E,E.closed=s,E=S.pop(),s.parent=E),s.previous=A,A.next=s,this.__tokens.add(s),A=s}return this.__tokens},a.prototype._is_first_token=function(){return this.__tokens.isEmpty()},a.prototype._reset=function(){},a.prototype._get_next_token=function(s,A){this._readWhitespace();var E=this._input.read(/.+/g);return E?this._create_token(h.RAW,E):this._create_token(h.EOF,"")},a.prototype._is_comment=function(s){return!1},a.prototype._is_opening=function(s){return!1},a.prototype._is_closing=function(s,A){return!1},a.prototype._create_token=function(s,A){var E=new o(s,A,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return E},a.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},g.exports.Tokenizer=a,g.exports.TOKEN=h},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 u=null;return m=m||0,m+=this.__position,m>=0&&m<this.__tokens_length&&(u=this.__tokens[m]),u},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 u=m(12).Pattern;function o(f,l){u.call(this,f,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 u,o.prototype.__set_whitespace_patterns=function(f,l){f+="\\t ",l+="\\n\\r",this._match_pattern=this._input.get_regexp("["+f+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 f=this._input.read(this._match_pattern);if(f===" ")this.whitespace_before_token=" ";else if(f){var l=this.__split(this._newline_regexp,f);this.newline_count=l.length-1,this.whitespace_before_token=l[this.newline_count]}return f},o.prototype.matching=function(f,l){var h=this._create();return h.__set_whitespace_patterns(f,l),h._update(),h},o.prototype._create=function(){return new o(this._input,this)},o.prototype.__split=function(f,l){f.lastIndex=0;for(var h=0,a=[],s=f.exec(l);s;)a.push(l.substring(h,s.index)),h=s.index+s[0].length,s=f.exec(l);return h<l.length?a.push(l.substring(h,l.length)):a.push(""),a},g.exports.WhitespacePattern=o},function(g){function p(m,u){this._input=m,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,u&&(this._starting_pattern=this._input.get_regexp(u._starting_pattern,!0),this._match_pattern=this._input.get_regexp(u._match_pattern,!0),this._until_pattern=this._input.get_regexp(u._until_pattern),this._until_after=u._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 u=this._create();return u._until_after=!0,u._until_pattern=this._input.get_regexp(m),u._update(),u},p.prototype.until=function(m){var u=this._create();return u._until_after=!1,u._until_pattern=this._input.get_regexp(m),u._update(),u},p.prototype.starting_with=function(m){var u=this._create();return u._starting_pattern=this._input.get_regexp(m,!0),u._update(),u},p.prototype.matching=function(m){var u=this._create();return u._match_pattern=this._input.get_regexp(m,!0),u._update(),u},p.prototype._create=function(){return new p(this._input,this)},p.prototype._update=function(){},g.exports.Pattern=p},function(g){function p(m,u){m=typeof m=="string"?m:m.source,u=typeof u=="string"?u:u.source,this.__directives_block_pattern=new RegExp(m+/ beautify( \w+[:]\w+)+ /.source+u,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(m+/\sbeautify\signore:end\s/.source+u,"g")}p.prototype.get_directives=function(m){if(!m.match(this.__directives_block_pattern))return null;var u={};this.__directive_pattern.lastIndex=0;for(var o=this.__directive_pattern.exec(m);o;)u[o[1]]=o[2],o=this.__directive_pattern.exec(m);return u},p.prototype.readIgnored=function(m){return m.readUntilAfter(this.__directives_end_ignore_pattern)},g.exports.Directives=p},function(g,p,m){var u=m(12).Pattern,o={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function f(l,h){u.call(this,l,h),this.__template_pattern=null,this._disabled=Object.assign({},o),this._excluded=Object.assign({},o),h&&(this.__template_pattern=this._input.get_regexp(h.__template_pattern),this._excluded=Object.assign(this._excluded,h._excluded),this._disabled=Object.assign(this._disabled,h._disabled));var a=new u(l);this.__patterns={handlebars_comment:a.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:a.starting_with(/{{{/).until_after(/}}}/),handlebars:a.starting_with(/{{/).until_after(/}}/),php:a.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:a.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:a.starting_with(/{%/).until_after(/%}/),django_value:a.starting_with(/{{/).until_after(/}}/),django_comment:a.starting_with(/{#/).until_after(/#}/),smarty:a.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:a.starting_with(/{\*/).until_after(/\*}/),smarty_literal:a.starting_with(/{literal}/).until_after(/{\/literal}/)}}f.prototype=new u,f.prototype._create=function(){return new f(this._input,this)},f.prototype._update=function(){this.__set_templated_pattern()},f.prototype.disable=function(l){var h=this._create();return h._disabled[l]=!0,h._update(),h},f.prototype.read_options=function(l){var h=this._create();for(var a in o)h._disabled[a]=l.templating.indexOf(a)===-1;return h._update(),h},f.prototype.exclude=function(l){var h=this._create();return h._excluded[l]=!0,h._update(),h},f.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 h=this._read_template();h;)this._match_pattern?h+=this._input.read(this._match_pattern):h+=this._input.readUntil(this.__template_pattern),l+=h,h=this._read_template();return this._until_after&&(l+=this._input.readUntilAfter(this._until_pattern)),l},f.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("|")+")")},f.prototype._read_template=function(){var l="",h=this._input.peek();if(h==="<"){var a=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&a==="?"&&(l=l||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&a==="%"&&(l=l||this.__patterns.erb.read())}else h==="{"&&(!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=f},,,,function(g,p,m){var u=m(19).Beautifier,o=m(20).Options;function f(l,h,a,s){var A=new u(l,h,a,s);return A.beautify()}g.exports=f,g.exports.defaultOptions=function(){return new o}},function(g,p,m){var u=m(20).Options,o=m(2).Output,f=m(21).Tokenizer,l=m(21).TOKEN,h=/\r\n|[\r\n]/,a=/\r\n|[\r\n]/g,s=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)};s.prototype.current_line_has_match=function(w){return this._output.current_line.has_match(w)},s.prototype.set_space_before_token=function(w,v){this._output.space_before_token=w,this._output.non_breaking_space=v},s.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},s.prototype.add_raw_token=function(w){this._output.add_raw_token(w)},s.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 y=0;y<v;y++)this.print_newline(y>0);return v!==0},s.prototype.traverse_whitespace=function(w){return w.whitespace_before||w.newlines?(this.print_preserved_newlines(w)||(this._output.space_before_token=!0),!0):!1},s.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},s.prototype.print_newline=function(w){this._output.add_new_line(w)},s.prototype.print_token=function(w){w.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(w.text))},s.prototype.indent=function(){this.indent_level++},s.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,y=w.next;y.type!==l.EOF&&w.closed!==y;){if(y.type===l.ATTRIBUTE&&y.text==="type"){y.next&&y.next.type===l.EQUALS&&y.next.next&&y.next.next.type===l.VALUE&&(v=y.next.next.text);break}y=y.next}return v},E=function(w,v){var y=null,F=null;return v.closed?(w==="script"?y="text/javascript":w==="style"&&(y="text/css"),y=A(v)||y,y.search("text/css")>-1?F="css":y.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?F="javascript":y.search(/(text|application|dojo)\/(x-)?(html)/)>-1?F="html":y.search(/test\/null/)>-1&&(F="null"),F):null};function S(w,v){return v.indexOf(w)!==-1}function L(w,v,y){this.parent=w||null,this.tag=v?v.tag_name:"",this.indent_level=y||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 y=this._current_frame;y&&!(w.indexOf(y.tag)!==-1);){if(v&&v.indexOf(y.tag)!==-1){y=null;break}y=y.parent}return y},O.prototype.try_pop=function(w,v){var y=this._get_frame([w],v);return this._try_pop_frame(y)},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,y,F){this._source_text=w||"",v=v||{},this._js_beautify=y,this._css_beautify=F,this._tag_stack=null;var B=new u(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&&h.test(w)&&(v=w.match(h)[0])),w=w.replace(a,`
|
|
`);var y=w.match(/^[\t ]*/)[0],F={text:"",type:""},B=new T,R=new s(this._options,y),j=new f(w,this._options).tokenize();this._tag_stack=new O(R);for(var N=null,b=j.next();b.type!==l.EOF;)b.type===l.TAG_OPEN||b.type===l.COMMENT?(N=this._handle_tag_open(R,b,B,F),B=N):b.type===l.ATTRIBUTE||b.type===l.EQUALS||b.type===l.VALUE||b.type===l.TEXT&&!B.tag_complete?N=this._handle_inside_tag(R,b,B,j):b.type===l.TAG_CLOSE?N=this._handle_tag_close(R,b,B):b.type===l.TEXT?N=this._handle_text(R,b,B):R.add_raw_token(b),F=N,b=j.next();var Y=R._output.get_code(v);return Y},C.prototype._handle_tag_close=function(w,v,y){var F={text:v.text,type:v.type};return w.alignment_size=0,y.tag_complete=!0,w.set_space_before_token(v.newlines||v.whitespace_before!=="",!0),y.is_unformatted?w.add_raw_token(v):(y.tag_start_char==="<"&&(w.set_space_before_token(v.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&y.has_wrapped_attrs&&w.print_newline(!1)),w.print_token(v)),y.indent_content&&!(y.is_unformatted||y.is_content_unformatted)&&(w.indent(),y.indent_content=!1),!y.is_inline_element&&!(y.is_unformatted||y.is_content_unformatted)&&w.set_wrap_point(),F},C.prototype._handle_inside_tag=function(w,v,y,F){var B=y.has_wrapped_attrs,R={text:v.text,type:v.type};if(w.set_space_before_token(v.newlines||v.whitespace_before!=="",!0),y.is_unformatted)w.add_raw_token(v);else if(y.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),y.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&&y.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=y.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&y.attr_count===1){var N=!0,b=0,Y;do{if(Y=F.peek(b),Y.type===l.ATTRIBUTE){N=!1;break}b+=1}while(b<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(),y.has_wrapped_attrs=B}return R},C.prototype._handle_text=function(w,v,y){var F={text:v.text,type:"TK_CONTENT"};return y.custom_beautifier_name?this._print_custom_beatifier_text(w,v,y):y.is_unformatted||y.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,y){var F=this;if(v.text!==""){var B=v.text,R,j=1,N="",b="";y.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?R=this._js_beautify:y.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?R=this._css_beautify:y.custom_beautifier_name==="html"&&(R=function(Ee,xe){var Ae=new C(Ee,xe,F._js_beautify,F._css_beautify);return Ae.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]*$/,""),y.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]&&(b=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 Oe=v.whitespace_before;Oe&&(B=B.replace(new RegExp(`
|
|
(`+Oe+")?","g"),`
|
|
`)),B=Y+B.replace(/\n/g,`
|
|
`+Y)}N&&(B?B=N+B+`
|
|
`+b:B=N+b),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,y,F){var B=this._get_tag_open_token(v);return(y.is_unformatted||y.is_content_unformatted)&&!y.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,y,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 y;this.tag_start_char=v.text[0],this.text=v.text,this.tag_start_char==="<"?(y=v.text.match(/^<([^\s>]*)/),this.tag_check=y?y[1]:""):(y=v.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=y?y[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,y,F,B){if(y.is_empty_element||(y.is_end_tag?y.start_tag_token=this._tag_stack.try_pop(y.tag_name):(this._do_optional_end_element(y)&&(y.is_inline_element||w.print_newline(!1)),this._tag_stack.record_tag(y),(y.tag_name==="script"||y.tag_name==="style")&&!(y.is_unformatted||y.is_content_unformatted)&&(y.custom_beautifier_name=E(y.tag_check,v)))),S(y.tag_check,this._options.extra_liners)&&(w.print_newline(!1),w._output.just_added_blankline()||w.print_newline(!0)),y.is_empty_element){if(y.tag_start_char==="{"&&y.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),y.indent_content=!0;var R=w.current_line_has_match(/{{#if/);R||w.print_newline(!1)}y.tag_name==="!--"&&B.type===l.TAG_CLOSE&&F.is_end_tag&&y.text.indexOf(`
|
|
`)===-1||(y.is_inline_element||y.is_unformatted||w.print_newline(!1),this._calcluate_parent_multiline(w,y))}else if(y.is_end_tag){var j=!1;j=y.start_tag_token&&y.start_tag_token.multiline_content,j=j||!y.is_inline_element&&!(F.is_inline_element||F.is_unformatted)&&!(B.type===l.TAG_CLOSE&&y.start_tag_token===F)&&B.type!=="TK_CONTENT",(y.is_content_unformatted||y.is_unformatted)&&(j=!1),j&&w.print_newline(!1)}else y.indent_content=!y.custom_beautifier_name,y.tag_start_char==="<"&&(y.tag_name==="html"?y.indent_content=this._options.indent_inner_html:y.tag_name==="head"?y.indent_content=this._options.indent_head_inner_html:y.tag_name==="body"&&(y.indent_content=this._options.indent_body_inner_html)),!(y.is_inline_element||y.is_unformatted)&&(B.type!=="TK_CONTENT"||y.is_content_unformatted)&&w.print_newline(!1),this._calcluate_parent_multiline(w,y)},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"],c=["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 y=w.parent.parent;(!y||c.indexOf(y.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 u=m(6).Options;function o(f){u.call(this,f,"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 u,g.exports.Options=o},function(g,p,m){var u=m(9).Tokenizer,o=m(9).TOKEN,f=m(13).Directives,l=m(14).TemplatablePattern,h=m(12).Pattern,a={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},s=new f(/<\!--/,/-->/),A=function(E,S){u.call(this,E,S),this._current_tag_name="";var L=new l(this._input).read_options(this._options),O=new h(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 u,A.prototype._is_comment=function(E){return!1},A.prototype._is_opening=function(E){return E.type===a.TAG_OPEN},A.prototype._is_closing=function(E,S){return E.type===a.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(a.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(a.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=s.get_directives(L),O&&O.ignore==="start"&&(L+=s.readIgnored(this._input))):L=this.__patterns.cdata.read()),L&&(S=this._create_token(a.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(a.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(a.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(a.COMMENT,L)):(L=this.__patterns.handlebars_open.read(),O=this._create_token(a.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(a.TAG_CLOSE,L)):S.text[0]==="{"&&E==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),O=this._create_token(a.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(a.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(a.VALUE,T)}else C=this.__patterns.attribute.read(),C&&(S.type===a.EQUALS?O=this._create_token(a.VALUE,C):O=this._create_token(a.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===a.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=a.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(a.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(a.TEXT,S)},g.exports.Tokenizer=A,g.exports.TOKEN=a}],W={};function n(g){var p=W[g];if(p!==void 0)return p.exports;var m=W[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 W=Z("6UM0"),n=Z("TXwP");return{html_beautify:function(D,g){return X(D,g,W.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 W=!0,n=!1,D;return{s:function(){U=P[Symbol.iterator]()},n:function(){var p=U.next();return W=p.done,p},e:function(p){n=!0,D=p},f:function(){try{!W&&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 W(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,c)=>(c=c.source||c,c=c.replace(n,"$1"),O=O.replace(x,c),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(W(T)).replace(g,"").toLowerCase()}catch(c){return null}if(x.indexOf("javascript:")===0||x.indexOf("vbscript:")===0||x.indexOf("data:")===0)return null}C&&!p.test(T)&&(T=h(C,T));try{T=encodeURI(T).replace(/%25/g,"%")}catch(x){return null}return T}const u={},o=/^[^:]+:\/*[^/]*$/,f=/^([^:]+:)[\s\S]*$/,l=/^([^:]+:\/*[^/]*)[\s\S]*$/;function h(O,C){u[" "+O]||(o.test(O)?u[" "+O]=O+"/":u[" "+O]=E(O,"/",!0)),O=u[" "+O];const T=O.indexOf(":")===-1;return C.substring(0,2)==="//"?T?C:O.replace(f,"$1")+C:C.charAt(0)==="/"?T?C:O.replace(l,"$1")+C:O+C}const a={exec:function(){}};function s(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,y)=>{let F=!1,B=v;for(;--B>=0&&y[B]==="\\";)F=!F;return F?"|":" |"}),x=T.split(/ \|/);let c=0;if(x.length>C)x.splice(C);else for(;x.length<C;)x.push("");for(;c<x.length;c++)x[c]=x[c].trim().replace(/\\\|/g,"|");return x}function E(O,C,T){const x=O.length;if(x===0)return"";let c=0;for(;c<x;){const w=O.charAt(x-c-1);if(w===C&&!T)c++;else if(w!==C&&T)c++;else break}return O.substr(0,x-c)}function S(O,C){if(O.indexOf(C[1])===-1)return-1;const T=O.length;let x=0,c=0;for(;c<T;c++)if(O[c]==="\\")c++;else if(O[c]===C[0])x++;else if(O[c]===C[1]&&(x--,x<0))return c;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:W,edit:D,cleanUrl:m,resolveUrl:h,noopTest:a,merge:s,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 f});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 W;(function(l){function h(a){return a&&typeof a=="object"&&typeof a.id=="string"}l.isThemeColor=h})(W||(W={}));function n(l){return{id:l}}var D;(function(l){function h(L){return L&&typeof L=="object"&&typeof L.id=="string"&&(typeof L.color=="undefined"||W.isThemeColor(L.color))}l.isThemeIcon=h;const a=new RegExp(`^\\$\\((${re.a.iconNameExpression}(?:${re.a.iconModifierExpression})?)\\)$`);function s(L){const O=a.exec(L);if(!O)return;let[,C]=O;return{id:C}}l.fromString=s;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 h=this.themingParticipants.indexOf(l);this.themingParticipants.splice(h,1)})}getThemingParticipants(){return this.themingParticipants}}let u=new m;U.a.add(p.ThemingContribution,u);function o(l){return u.onColorThemeChange(l)}class f extends P.a{constructor(l){super();this.themeService=l,this.theme=l.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(h=>this.onThemeChange(h)))}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(W){return X[W]}.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 W(g,p,m,u,o){if(typeof m!="function")throw new TypeError("The listener must be a function");var f=new G(m,u||g,o),l=U?U+p:p;return g._events[l]?g._events[l].fn?g._events[l]=[g._events[l],f]:g._events[l].push(f):(g._events[l]=f,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,u;if(this._eventsCount===0)return p;for(u in m=this._events)X.call(m,u)&&p.push(U?u.slice(1):u);return Object.getOwnPropertySymbols?p.concat(Object.getOwnPropertySymbols(m)):p},D.prototype.listeners=function(p){var m=U?U+p:p,u=this._events[m];if(!u)return[];if(u.fn)return[u.fn];for(var o=0,f=u.length,l=new Array(f);o<f;o++)l[o]=u[o].fn;return l},D.prototype.listenerCount=function(p){var m=U?U+p:p,u=this._events[m];return u?u.fn?1:u.length:0},D.prototype.emit=function(p,m,u,o,f,l){var h=U?U+p:p;if(!this._events[h])return!1;var a=this._events[h],s=arguments.length,A,E;if(a.fn){a.once&&this.removeListener(p,a.fn,void 0,!0);switch(s){case 1:return a.fn.call(a.context),!0;case 2:return a.fn.call(a.context,m),!0;case 3:return a.fn.call(a.context,m,u),!0;case 4:return a.fn.call(a.context,m,u,o),!0;case 5:return a.fn.call(a.context,m,u,o,f),!0;case 6:return a.fn.call(a.context,m,u,o,f,l),!0}for(E=1,A=new Array(s-1);E<s;E++)A[E-1]=arguments[E];a.fn.apply(a.context,A)}else{var S=a.length,L;for(E=0;E<S;E++){a[E].once&&this.removeListener(p,a[E].fn,void 0,!0);switch(s){case 1:a[E].fn.call(a[E].context);break;case 2:a[E].fn.call(a[E].context,m);break;case 3:a[E].fn.call(a[E].context,m,u);break;case 4:a[E].fn.call(a[E].context,m,u,o);break;default:if(!A)for(L=1,A=new Array(s-1);L<s;L++)A[L-1]=arguments[L];a[E].fn.apply(a[E].context,A)}}}return!0},D.prototype.on=function(p,m,u){return W(this,p,m,u,!1)},D.prototype.once=function(p,m,u){return W(this,p,m,u,!0)},D.prototype.removeListener=function(p,m,u,o){var f=U?U+p:p;if(!this._events[f])return this;if(!m)return n(this,f),this;var l=this._events[f];if(l.fn)l.fn===m&&(!o||l.once)&&(!u||l.context===u)&&n(this,f);else{for(var h=0,a=[],s=l.length;h<s;h++)(l[h].fn!==m||o&&!l[h].once||u&&l[h].context!==u)&&a.push(l[h]);a.length?this._events[f]=a.length===1?a[0]:a:n(this,f)}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,W=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/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 u=n.parseURL(g);if(!u)throw new Error("Error trying to parse relative URL.");if(u.scheme)return p.alwaysNormalize?(u.path=n.normalizePath(u.path),n.buildURLFromParts(u)):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 f=k.exec(o.path);o.netLoc=f[1],o.path=f[2]}o.netLoc&&!o.path&&(o.path="/");var l={scheme:o.scheme,netLoc:u.netLoc,path:null,params:u.params,query:u.query,fragment:u.fragment};if(!u.netLoc&&(l.netLoc=o.netLoc,u.path[0]!=="/"))if(!u.path)l.path=o.path,u.params||(l.params=o.params,u.query||(l.query=o.query));else{var h=o.path,a=h.substring(0,h.lastIndexOf("/")+1)+u.path;l.path=n.normalizePath(a)}return l.path===null&&(l.path=p.alwaysNormalize?n.normalizePath(u.path):u.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(W,"")).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 u(f){if(m[f])return m[f].exports;var l=m[f]={i:f,l:!1,exports:{}};return p[f].call(l.exports,l,l.exports,u),l.l=!0,l.exports}u.m=p,u.c=m,u.i=function(f){return f},u.d=function(f,l,h){u.o(f,l)||Object.defineProperty(f,l,{configurable:!1,enumerable:!0,get:h})},u.r=function(f){Object.defineProperty(f,"__esModule",{value:!0})},u.n=function(f){var l=f&&f.__esModule?function(){return f.default}:function(){return f};return u.d(l,"a",l),l},u.o=function(f,l){return Object.prototype.hasOwnProperty.call(f,l)},u.p="/",u.oe=function(f){throw console.error(f),f};var o=u(u.s=ENTRY_MODULE);return o.default||o}var U="[\\.|\\-|\\+|\\w|/|@]+",k="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+U+").*?\\)";function G(p){return(p+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function W(p){return!isNaN(1*p)}function n(p,m,u){var o={};o[u]=[];var f=m.toString(),l=f.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!l)return o;for(var h=l[1],a=new RegExp("(\\\\n|\\W)"+G(h)+k,"g"),s;s=a.exec(f);){if(s[3]==="dll-reference")continue;o[u].push(s[3])}for(a=new RegExp("\\("+G(h)+'\\("(dll-reference\\s('+U+'))"\\)\\)'+k,"g");s=a.exec(f);)p[s[2]]||(o[u].push(s[1]),p[s[2]]=P(s[1]).m),o[s[2]]=o[s[2]]||[],o[s[2]].push(s[4]);for(var A=Object.keys(o),E=0;E<A.length;E++)for(var S=0;S<o[A[E]].length;S++)W(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(u,o){return u||p[o].length>0},!1)}function g(p,m){for(var u={main:[m]},o={main:[]},f={main:{}};D(u);)for(var l=Object.keys(u),h=0;h<l.length;h++){var a=l[h],s=u[a],A=s.pop();if(f[a]=f[a]||{},f[a][A]||!p[a][A])continue;f[a][A]=!0,o[a]=o[a]||[],o[a].push(A);for(var E=n(p,p[a][A],a),S=Object.keys(E),L=0;L<S.length;L++)u[S[L]]=u[S[L]]||[],u[S[L]]=u[S[L]].concat(E[S[L]])}return o}re.exports=function(p,m){m=m||{};var u={main:P.m},o=m.all?{main:Object.keys(u.main)}:g(u,p),f="";Object.keys(o).filter(function(A){return A!=="main"}).forEach(function(A){for(var E=0;o[A][E];)E++;o[A].push(E),u[A][E]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",f=f+"var "+A+" = ("+X.toString().replace("ENTRY_MODULE",JSON.stringify(E))+")({"+o[A].map(function(S){return""+JSON.stringify(S)+": "+u[A][S].toString()}).join(",")+`});
|
|
`}),f=f+"new (("+X.toString().replace("ENTRY_MODULE",JSON.stringify(p))+")({"+o.main.map(function(A){return""+JSON.stringify(A)+": "+u.main[A].toString()}).join(",")+"}))(self);";var l=new window.Blob([f],{type:"text/javascript"});if(m.bare)return l;var h=window.URL||window.webkitURL||window.mozURL||window.msURL,a=h.createObjectURL(l),s=new window.Worker(a);return s.objectURL=a,s}},"./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"),W=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"),u=P("./src/controller/cmcd-controller.ts"),o=P("./src/utils/xhr-loader.ts"),f=P("./src/utils/fetch-loader.ts"),l=P("./src/utils/cues.ts"),h=P("./src/utils/mediakeys-helper.ts"),a=P("./src/utils/logger.ts");function s(){return s=Object.assign||function(x){for(var c=1;c<arguments.length;c++){var w=arguments[c];for(var v in w)Object.prototype.hasOwnProperty.call(w,v)&&(x[v]=w[v])}return x},s.apply(this,arguments)}function A(x,c){var w=Object.keys(x);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(x);c&&(v=v.filter(function(y){return Object.getOwnPropertyDescriptor(x,y).enumerable})),w.push.apply(w,v)}return w}function E(x){for(var c=1;c<arguments.length;c++){var w=arguments[c]!=null?arguments[c]:{};c%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,c,w){return c in x?Object.defineProperty(x,c,{value:w,enumerable:!0,configurable:!0,writable:!0}):x[c]=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:h.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},O()),{},{subtitleStreamController:G.SubtitleStreamController,subtitleTrackController:W.default,timelineController:D.TimelineController,audioStreamController:U.default,audioTrackController:k.default,emeController:m.default,cmcdController:u.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,c){if((c.liveSyncDurationCount||c.liveMaxLatencyDurationCount)&&(c.liveSyncDuration||c.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(c.liveMaxLatencyDurationCount!==void 0&&(c.liveSyncDurationCount===void 0||c.liveMaxLatencyDurationCount<=c.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(c.liveMaxLatencyDuration!==void 0&&(c.liveSyncDuration===void 0||c.liveMaxLatencyDuration<=c.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return s({},x,c)}function T(x){var c=x.loader;if(c!==f.default&&c!==o.default)a.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),x.progressive=!1;else{var w=Object(f.fetchSupported)();w&&(x.loader=f.default,x.progressive=!0,x.enableSoftwareAES=!0,a.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"),W=P("./src/errors.ts"),n=P("./src/types/loader.ts"),D=P("./src/utils/logger.ts");function g(u,o){for(var f=0;f<o.length;f++){var l=o[f];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(u,l.key,l)}}function p(u,o,f){return o&&g(u.prototype,o),f&&g(u,f),u}var m=function(){function u(f){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=f;var l=f.config;this.bwEstimator=new U.default(l.abrEwmaSlowVoD,l.abrEwmaFastVoD,l.abrEwmaDefaultEstimate),this.registerListeners()}var o=u.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,h){var a=h.frag;if(a.type===n.PlaylistLevelType.MAIN&&!this.timer){var s;this.fragCurrent=a,this.partCurrent=(s=h.part)!=null?s:null,this.timer=self.setInterval(this.onCheck,100)}},o.onLevelLoaded=function(l,h){var a=this.hls.config;h.details.live?this.bwEstimator.update(a.abrEwmaSlowLive,a.abrEwmaFastLive):this.bwEstimator.update(a.abrEwmaSlowVoD,a.abrEwmaFastVoD)},o._abandonRulesCheck=function(){var l=this.fragCurrent,h=this.partCurrent,a=this.hls,s=a.autoLevelEnabled,A=a.config,E=a.media;if(!l||!E)return;var S=h?h.stats:l.stats,L=h?h.duration:l.duration;if(S.aborted){D.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!s||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=a.levels,x=a.minAutoLevel,c=T[l.level],w=S.total||Math.max(S.loaded,Math.round(L*c.maxBitrate/8)),v=Math.max(1,S.bwEstimate?S.bwEstimate/8:S.loaded*1e3/O),y=(w-S.loaded)/v,F=E.currentTime,B=(G.BufferHelper.bufferInfo(E,F,A.maxBufferHole).end-F)/C;if(B>=2*L/C||y<=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>=y)return;var b=this.bwEstimator.getEstimate();D.logger.warn("Fragment "+l.sn+(h?" part "+h.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)(b)?(b/1024).toFixed(3):"Unknown")+` Kb/s
|
|
Estimated load time for current fragment: `+y.toFixed(3)+` s
|
|
Estimated load time for the next fragment: `+R.toFixed(3)+` s
|
|
Time to underbuffer: `+B.toFixed(3)+" s"),a.nextLoadLevel=j,this.bwEstimator.sample(O,S.loaded),this.clearTimer(),l.loader&&(this.fragCurrent=this.partCurrent=null,l.loader.abort()),a.trigger(k.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:l,part:h,stats:S})},o.onFragLoaded=function(l,h){var a=h.frag,s=h.part;if(a.type===n.PlaylistLevelType.MAIN&&Object(X.isFiniteNumber)(a.sn)){var A=s?s.stats:a.stats,E=s?s.duration:a.duration;if(this.clearTimer(),this.lastLoadedFragLevel=a.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var S=this.hls.levels[a.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(a.bitrateTest){var C={stats:A,frag:a,part:s,id:a.type};this.onFragBuffered(k.Events.FRAG_BUFFERED,C),a.bitrateTest=!1}}},o.onFragBuffered=function(l,h){var a=h.frag,s=h.part,A=s?s.stats:a.stats;if(A.aborted)return;if(a.type!==n.PlaylistLevelType.MAIN||a.sn==="initSegment")return;var E=A.parsing.end-A.loading.start;this.bwEstimator.sample(E,A.loaded),A.bwEstimate=this.bwEstimator.getEstimate(),a.bitrateTest?this.bitrateTestDelay=E/1e3:this.bitrateTestDelay=0},o.onError=function(l,h){switch(h.details){case W.ErrorDetails.FRAG_LOAD_ERROR:case W.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,h=this.partCurrent,a=this.hls,s=a.maxAutoLevel,A=a.config,E=a.minAutoLevel,S=a.media,L=h?h.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,c=this.findBestLevel(T,E,s,x,A.abrBandWidthFactor,A.abrBandWidthUpFactor);if(c>=0)return c;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,y=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=y=1}}return c=this.findBestLevel(T,E,s,x+w,v,y),Math.max(c,0)},o.findBestLevel=function(l,h,a,s,A,E){for(var S,L=this.fragCurrent,O=this.partCurrent,C=this.lastLoadedFragLevel,T=this.hls.levels,x=T[C],c=!!(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,y=a;y>=h;y--){var F=T[y];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;y<=C?j=A*l:j=E*l;var N=T[y].maxBitrate,b=N*R/j;if(D.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+y+"/"+Math.round(j)+"/"+N+"/"+R+"/"+s+"/"+b),j>N&&(!b||c&&!this.bitrateTestDelay||b<s))return y}return-1},p(u,[{key:"nextAutoLevel",get:function(){var l=this._nextAutoLevel,h=this.bwEstimator;if(l!==-1&&(!h||!h.canEstimate()))return l;var a=this.getNextABRAutoLevel();return l!==-1&&(a=Math.min(l,a)),a},set:function(l){this._nextAutoLevel=l}}]),u}();$.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"),W=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"),u=P("./src/types/transmuxer.ts"),o=P("./src/controller/fragment-finders.ts"),f=P("./src/utils/discontinuities.ts"),l=P("./src/errors.ts"),h=P("./src/utils/logger.ts");function a(){return a=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},a.apply(this,arguments)}function s(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){s(O,L);function O(T,x){var c;return c=L.call(this,T,x,"[audio-stream-controller]")||this,c.videoBuffer=null,c.videoTrackCC=-1,c.waitingVideoCC=-1,c.audioSwitch=!1,c.trackId=-1,c.waitingData=null,c.mainDetails=null,c.bufferFlushed=!1,c._registerListeners(),c}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,c){var w=c.frag,v=c.id,y=c.initPTS;if(v==="main"){var F=w.cc;this.initPTS[w.cc]=y,this.log("InitPTS for cc: "+F+" found from main: "+y),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 c=this.lastCurrentTime;this.stopLoad(),this.setInterval(E),this.fragLoadError=0,c>0&&x===-1?(this.log("Override startPosition with lastCurrentTime @"+c.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,c=this.levels,w=this.trackId,v=c==null||((x=c[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 y,F=performance.now(),B=this.retryDate;(!B||F>=B||(y=this.media)!==null&&y!==void 0&&y.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,b=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=b.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)h.logger.log("Waiting fragment cc ("+j.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var ue=this.getLoadPosition(),Oe=G.BufferHelper.bufferInfo(this.mediaBuffer,ue,this.config.maxBufferHole),Ee=Object(o.fragmentWithinToleranceTest)(Oe.end,this.config.maxFragLookUpTolerance,j);Ee<0&&(h.logger.log("Waiting fragment cc ("+j.cc+") @ "+j.start+" cancelled because another fragment at "+Oe.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 c=this.mediaBuffer?this.mediaBuffer:x,w=c.buffered;!this.loadedmetadata&&w.length&&(this.loadedmetadata=!0),this.lastCurrentTime=x.currentTime},C.doTickIdle=function(){var x,c,w=this.hls,v=this.levels,y=this.media,F=this.trackId,B=w.config;if(!v||!v[F])return;if(!y&&(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 b=N.len,Y=this.getMaxBufferLength(),ee=this.audioSwitch;if(b>=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,Oe=N.end;if(ee){var Ee=this.getLoadPosition();Oe=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"),y.currentTime=ue+.05))}var xe=this.getNextFragment(Oe,j);if(!xe){this.bufferFlushed=!0;return}((x=xe.decryptdata)===null||x===void 0?void 0:x.keyFormat)==="identity"&&!((c=xe.decryptdata)!==null&&c!==void 0&&c.key)?this.loadKey(xe,j):this.loadFragment(xe,j,Oe)},C.getMaxBufferLength=function(){var x=L.prototype.getMaxBufferLength.call(this),c=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,D.PlaylistLevelType.MAIN);return c===null?x:Math.max(x,c.len)},C.onMediaDetaching=function(){this.videoBuffer=null,L.prototype.onMediaDetaching.call(this)},C.onAudioTracksUpdated=function(x,c){var w=c.audioTracks;this.resetTransmuxer(),this.levels=w.map(function(v){return new n.Level(v)})},C.onAudioTrackSwitching=function(x,c){var w=!!c.url;this.trackId=c.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,c){this.mainDetails=c.details},C.onAudioTrackLoaded=function(x,c){var w,v=this.levels,y=c.details,F=c.id;if(!v){this.warn("Audio tracks were reset while loading level "+F);return}this.log("Track "+F+" loaded ["+y.startSN+","+y.endSN+"],duration:"+y.totalduration);var B=v[F],R=0;if(y.live||(w=B.details)!==null&&w!==void 0&&w.live){var j=this.mainDetails;if(y.fragments[0]||(y.deltaUpdateFailed=!0),y.deltaUpdateFailed||!j)return;!B.details&&y.hasProgramDateTime&&j.hasProgramDateTime?(Object(f.alignMediaPlaylistByPDT)(y,j),R=y.fragments[0].start):R=this.alignPlaylists(y,B.details)}B.details=y,this.levelLastLoaded=F,!this.startFragRequested&&(this.mainDetails||!y.live)&&this.setStartPosition(B.details,R),this.state===U.State.WAITING_TRACK&&!this.waitForCdnTuneIn(y)&&(this.state=U.State.IDLE),this.tick()},C._handleFragmentLoadProgress=function(x){var c,w=x.frag,v=x.part,y=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 b=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=(c=w.initSegment)===null||c===void 0?void 0:c.data;if(ee!==void 0){var ue=!1,Oe=v?v.index:-1,Ee=Oe!==-1,xe=new u.ChunkMetadata(w.level,w.sn,w.stats.chunkCount,y.byteLength,Oe,Ee);Y.push(y,ae,b,"",w,v,N.totalduration,ue,xe,ee)}else{h.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 Ae=this.waitingData=this.waitingData||{frag:w,part:v,cache:new p.default,complete:!1},Re=Ae.cache;Re.push(new Uint8Array(y)),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,c){var w=c.tracks.audio;w&&(this.mediaBuffer=w.buffer),c.tracks.video&&(this.videoBuffer=c.tracks.video.buffer)},C.onFragBuffered=function(x,c){var w=c.frag,v=c.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,c){switch(c.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,c);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=c.fatal?U.State.ERROR:U.State.IDLE,this.warn(c.details+" while loading frag, switching to "+this.state+" state"));break;case l.ErrorDetails.BUFFER_FULL_ERROR:if(c.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,c){var w=c.type;w===g.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},C._handleTransmuxComplete=function(x){var c,w="audio",v=this.hls,y=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=y.audio,b=y.text,Y=y.id3,ee=y.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,Oe=N.startDTS,Ee=N.endDTS;j&&(j.elementaryStreams[g.ElementaryStreamTypes.AUDIO]={startPTS:ae,endPTS:ue,startDTS:Oe,endDTS:Ee}),R.setElementaryStreamInfo(g.ElementaryStreamTypes.AUDIO,ae,ue,Oe,Ee),this.bufferFragmentData(N,R,j,F)}if(Y!=null&&(c=Y.samples)!==null&&c!==void 0&&c.length){var xe=a({frag:R,id:w},Y);v.trigger(k.Events.FRAG_PARSING_METADATA,xe)}if(b){var Ae=a({frag:R,id:w},b);v.trigger(k.Events.FRAG_PARSING_USERDATA,Ae)}},C._bufferInitSegment=function(x,c,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 y=v.initSegment;if(y!=null&&y.byteLength){var F={type:"audio",frag:c,part:null,chunkMeta:w,parent:c.type,data:y};this.hls.trigger(k.Events.BUFFER_APPENDING,F)}this.tick()},C.loadFragment=function(x,c,w){var v=this.fragmentTracker.getState(x);this.fragCurrent=x,(this.audioSwitch||v===W.FragmentState.NOT_LOADED||v===W.FragmentState.PARTIAL)&&(x.sn==="initSegment"?this._loadInitSegment(x):c.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,c,w)))},C.completeAudioSwitch=function(){var x=this.hls,c=this.media,w=this.trackId;c&&(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 W(m,u){for(var o=0;o<u.length;o++){var f=u[o];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(m,f.key,f)}}function n(m,u,o){return u&&W(m.prototype,u),o&&W(m,o),m}function D(m,u){m.prototype=Object.create(u.prototype),m.prototype.constructor=m,g(m,u)}function g(m,u){return g=Object.setPrototypeOf||function(f,l){return f.__proto__=l,f},g(m,u)}var p=function(m){D(u,m);function u(f){var l;return l=m.call(this,f,"[audio-track-controller]")||this,l.tracks=[],l.groupId=null,l.tracksInGroup=[],l.trackId=-1,l.trackName="",l.selectDefaultTrack=!0,l.registerListeners(),l}var o=u.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,h){this.tracks=h.audioTracks||[]},o.onAudioTrackLoaded=function(l,h){var a=h.id,s=h.details,A=this.tracksInGroup[a];if(!A){this.warn("Invalid audio track id "+a);return}var E=A.details;A.details=h.details,this.log("audioTrack "+a+" loaded ["+s.startSN+"-"+s.endSN+"]"),a===this.trackId&&(this.retryCount=0,this.playlistLoaded(a,h,E))},o.onLevelLoading=function(l,h){this.switchLevel(h.level)},o.onLevelSwitching=function(l,h){this.switchLevel(h.level)},o.switchLevel=function(l){var h=this.hls.levels[l];if(!(h!=null&&h.audioGroupIds))return;var a=h.audioGroupIds[h.urlId];if(this.groupId!==a){this.groupId=a;var s=this.tracks.filter(function(E){return!a||E.groupId===a});this.selectDefaultTrack&&!s.some(function(E){return E.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=s;var A={audioTracks:s};this.log("Updating audio tracks, "+s.length+' track(s) found in "'+a+'" group-id'),this.hls.trigger(X.Events.AUDIO_TRACKS_UPDATED,A),this.selectInitialTrack()}},o.onError=function(l,h){if(m.prototype.onError.call(this,l,h),h.fatal||!h.context)return;h.context.type===G.PlaylistContextType.AUDIO_TRACK&&h.context.id===this.trackId&&h.context.groupId===this.groupId&&this.retryLoadingOrFail(h)},o.setAudioTrack=function(l){var h=this.tracksInGroup;if(l<0||l>=h.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var a=h[this.trackId];this.log("Now switching to audio-track index "+l);var s=h[l],A=s.id,E=s.groupId,S=E===void 0?"":E,L=s.name,O=s.type,C=s.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}),s.details&&!s.details.live)return;var T=this.switchParams(s.url,a==null?void 0:a.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 h=this.trackName,a=this.findTrackId(h)||this.findTrackId();a!==-1?this.setAudioTrack(a):(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 h=this.tracksInGroup,a=0;a<h.length;a++){var s=h[a];if((!this.selectDefaultTrack||s.default)&&(!l||l===s.name))return s.id}return-1},o.loadPlaylist=function(l){var h=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(h)){var a=h.id,s=h.groupId,A=h.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: "+a),this.clearTimer(),this.hls.trigger(X.Events.AUDIO_TRACK_LOADING,{url:A,id:a,groupId:s,deliveryDirectives:l||null})}},n(u,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(l){this.selectDefaultTrack=!1,this.setAudioTrack(l)}}]),u}(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"),W=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,u){u.fatal&&u.type===W.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,u){var o=u==null?void 0:u.renditionReports;if(o)for(var f=0;f<o.length;f++){var l=o[f],h=""+l.URI;if(h===m.substr(-h.length)){var a=parseInt(l["LAST-MSN"]),s=parseInt(l["LAST-PART"]);if(u&&this.hls.config.lowLatencyMode){var A=Math.min(u.age-u.partTarget,u.targetduration);s!==void 0&&A>u.partTarget&&(s+=1)}if(Object(X.isFiniteNumber)(a))return new U.HlsUrlParameters(a,Object(X.isFiniteNumber)(s)?s: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,u,o){var f=this,l=u.details,h=u.stats,a=h.loading.end?Math.max(0,self.performance.now()-h.loading.end):0;if(l.advancedDateTime=Date.now()-a,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 s,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,c=S?0:C;T?(A=x?O+1:L,E=x?c:C+1):A=O+1;var w=l.age,v=w+l.ageHeader,y=Math.min(v-l.partTarget,l.targetduration*1.5);if(y>0){if(o&&y>o.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+o.tuneInGoal+" to: "+y+" with playlist age: "+l.age),y=0;else{var F=Math.floor(y/l.targetduration);if(A+=F,E!==void 0){var B=Math.round(y%l.targetduration/l.partTarget);E+=B}this.log("CDN Tune-in age: "+l.ageHeader+"s last advanced "+w.toFixed(2)+"s goal: "+y+" skip sn "+F+" to part "+E)}l.tuneInGoal=y}if(s=this.getDeliveryDirectives(l,u.deliveryDirectives,A,E),S||!x){this.loadPlaylist(s);return}}else s=this.getDeliveryDirectives(l,u.deliveryDirectives,A,E);var R=Object(k.computeReloadInterval)(l,h);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 f.loadPlaylist(s)},R)}else this.clearTimer()},g.getDeliveryDirectives=function(m,u,o,f){var l=Object(U.getSkipValue)(m,o);return u!=null&&u.skip&&m.deltaUpdateFailed&&(o=u.msn,f=u.part,l=U.HlsSkip.No),new U.HlsUrlParameters(o,f,l)},g.retryLoadingOrFail=function(m){var u=this,o=this.hls.config,f=this.retryCount<o.levelLoadingMaxRetry;if(f){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 h=Math.min(Math.pow(2,this.retryCount)*o.levelLoadingRetryDelay,o.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return u.loadPlaylist()},h),this.warn("retry playlist loading #"+this.retryCount+" in "+h+' ms after "'+m.details+'"')}}else this.warn('cannot recover from error "'+m.details+'"'),this.clearTimer(),m.fatal=!0;return f},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"),W=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"),u=P("./src/controller/fragment-finders.ts"),o=P("./src/controller/level-helper.ts"),f=P("./src/loader/fragment-loader.ts"),l=P("./src/crypt/decrypter.ts"),h=P("./src/utils/time-ranges.ts"),a=P("./src/types/loader.ts");function s(T,x){for(var c=0;c<x.length;c++){var w=x[c];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(T,w.key,w)}}function A(T,x,c){return x&&s(T.prototype,x),c&&s(T,c),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,y){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=y,F.log=W.logger.log.bind(W.logger,y+":"),F.warn=W.logger.warn.bind(W.logger,y+":"),F.hls=w,F.fragmentLoader=new f.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 c=x.prototype;return c.doTick=function(){this.onTickEnd()},c.onTickEnd=function(){},c.startLoad=function(v){},c.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},c._streamEnded=function(v,y){var F=this.fragCurrent,B=this.fragmentTracker;if(!y.live&&F&&F.sn===y.endSN&&!v.nextStart){var R=B.getState(F);return R===k.FragmentState.PARTIAL||R===k.FragmentState.OK}return!1},c.onMediaAttached=function(v,y){var F=this.media=this.mediaBuffer=y.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)},c.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()},c.onMediaSeeking=function(){var v=this.config,y=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(y&&!N.len){var b=v.maxFragLookUpTolerance,Y=y.start-b,ee=y.start+y.duration+b,ae=j>ee;(j<Y||ae)&&(ae&&y.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),y.loader.abort()),this.resetLoadingState())}F&&(this.lastCurrentTime=j),!this.loadedmetadata&&!N.len&&(this.nextLoadPosition=this.startPosition=j),this.tickImmediate()},c.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},c.onKeyLoaded=function(v,y){if(this.state!==O.KEY_LOADING||y.frag!==this.fragCurrent||!this.levels)return;this.state=O.IDLE;var F=this.levels[y.frag.level].details;F&&this.loadFragment(y.frag,F,y.frag.start)},c.onHandlerDestroying=function(){this.stopLoad(),T.prototype.onHandlerDestroying.call(this)},c.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)},c.loadKey=function(v,y){this.log("Loading key for "+v.sn+" of ["+y.startSN+"-"+y.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})},c.loadFragment=function(v,y,F){this._loadFragForPlayback(v,y,F)},c._loadFragForPlayback=function(v,y,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,y,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)})},c.flushMainBuffer=function(v,y,F){if(F===void 0&&(F=null),!(v-y))return;var B={startOffset:v,endOffset:y,type:F};this.fragLoadError=0,this.hls.trigger(n.Events.BUFFER_FLUSHING,B)},c._loadInitSegment=function(v){var y=this;this._doFragLoad(v).then(function(F){if(!F||y.fragContextChanged(v)||!y.levels)throw new Error("init load aborted");return F}).then(function(F){var B=y.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 y.decrypter.webCryptoDecrypt(new Uint8Array(R),j.key.buffer,j.iv.buffer).then(function(b){var Y=self.performance.now();return B.trigger(n.Events.FRAG_DECRYPTED,{frag:v,payload:b,stats:{tstart:N,tdecrypt:Y}}),F.payload=b,F})}return F}).then(function(F){var B=y.fragCurrent,R=y.hls,j=y.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 b=v.stats;y.state=O.IDLE,y.fragLoadError=0,v.data=new Uint8Array(F.payload),b.parsing.start=b.buffering.start=self.performance.now(),b.parsing.end=b.buffering.end=self.performance.now(),F.frag===B&&R.trigger(n.Events.FRAG_BUFFERED,{stats:b,frag:B,part:null,id:v.type}),y.tick()}).catch(function(F){y.warn(F),y.resetFragmentLoading(v)})},c.fragContextChanged=function(v){var y=this.fragCurrent;return!v||!y||v.level!==y.level||v.sn!==y.sn||v.urlId!==y.urlId},c.fragBufferedComplete=function(v,y){var F=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+v.type+" sn: "+v.sn+(y?" part: "+y.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+v.level+" "+h.default.toString(G.BufferHelper.getBuffered(F))),this.state=O.IDLE,this.tick()},c._handleFragmentLoadComplete=function(v){var y=this.transmuxer;if(!y)return;var F=v.frag,B=v.part,R=v.partsLoaded,j=!R||R.length===0||R.some(function(b){return!b}),N=new g.ChunkMetadata(F.level,F.sn,F.stats.chunkCount+1,0,B?B.index:-1,!j);y.flush(N)},c._handleFragmentLoadProgress=function(v){},c._doFragLoad=function(v,y,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&&y){var j=y.partList;if(j&&B){F>v.end&&y.fragmentHint&&(v=y.fragmentHint);var N=this.getNextPart(j,v,F);if(N>-1){var b=j[N];return this.log("Loading part sn: "+v.sn+" p: "+b.index+" cc: "+v.cc+" of playlist ["+y.startSN+"-"+y.endSN+"] parts [0-"+N+"-"+(j.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+v.level+", target: "+parseFloat(F.toFixed(3))),this.nextLoadPosition=b.start+b.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+" "+(y?"of ["+y.startSN+"-"+y.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)})},c.doFragPartsLoad=function(v,y,F,B){var R=this;return new Promise(function(j,N){var b=[],Y=function ee(ae){var ue=y[ae];R.fragmentLoader.loadPart(v,ue,B).then(function(Oe){b[ue.index]=Oe;var Ee=Oe.part;R.hls.trigger(n.Events.FRAG_LOADED,Oe);var xe=y[ae+1];if(xe&&xe.fragment===v)ee(ae+1);else return j({frag:v,part:Ee,partsLoaded:b})}).catch(N)};Y(F)})},c.handleFragLoadError=function(v){var y=v.data;return y&&y.details===D.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(y.frag,y.part):this.hls.trigger(n.Events.ERROR,y),null},c._handleTransmuxerFlush=function(v){var y=this.getCurrentContext(v);if(!y||this.state!==O.PARSING){this.fragCurrent||(this.state=O.IDLE);return}var F=y.frag,B=y.part,R=y.level,j=self.performance.now();F.stats.parsing.end=j,B&&(B.stats.parsing.end=j),this.updateLevelTiming(F,B,R,v.partial)},c.getCurrentContext=function(v){var y=this.levels,F=v.level,B=v.sn,R=v.part;if(!y||!y[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=y[F],N=R>-1?Object(o.getPartWith)(j,B,R):null,b=N?N.fragment:Object(o.getFragmentWithSN)(j,B,this.fragCurrent);return b?{frag:b,part:N,level:j}:null},c.bufferFragmentData=function(v,y,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 b={type:v.type,frag:y,part:F,chunkMeta:B,parent:y.type,data:N};this.hls.trigger(n.Events.BUFFER_APPENDING,b),v.dropped&&v.independent&&!F&&this.flushBufferGap(y)},c.flushBufferGap=function(v){var y=this.media;if(!y)return;if(!G.BufferHelper.isBuffered(y,y.currentTime)){this.flushMainBuffer(0,v.start);return}var F=y.currentTime,B=G.BufferHelper.bufferInfo(y,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)},c.getFwdBufferInfo=function(v,y){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,y);if(j&&R.nextStart<j.end)return G.BufferHelper.bufferInfo(v,B,Math.max(R.nextStart,F.maxBufferHole))}return R},c.getMaxBufferLength=function(v){var y=this.config,F;return v?F=Math.max(8*y.maxBufferSize/v,y.maxBufferLength):F=y.maxBufferLength,Math.min(F,y.maxMaxBufferLength)},c.reduceMaxBufferLength=function(v){var y=this.config,F=v||y.maxBufferLength;return y.maxMaxBufferLength>=F?(y.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+y.maxMaxBufferLength+"s"),!0):!1},c.getNextFragment=function(v,y){var F,B,R=y.fragments,j=R.length;if(!j)return null;var N=this.config,b=R[0].start,Y;if(y.live){var ee=N.initialLiveManifestSize;if(j<ee)return this.warn("Not enough fragments to start playback (have: "+j+", need: "+ee+")"),null;!y.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(Y=this.getInitialLiveFragment(y,R),this.startPosition=Y?this.hls.liveSyncPosition||Y.start:v)}else v<=b&&(Y=R[0]);if(!Y){var ae=N.lowLatencyMode?y.partEnd:y.fragmentEnd;Y=this.getFragmentAtPosition(v,ae,y)}return(F=Y)!==null&&F!==void 0&&F.initSegment&&!((B=Y)!==null&&B!==void 0&&B.initSegment.data)&&!this.bitrateTest&&(Y=Y.initSegment),Y},c.getNextPart=function(v,y,F){for(var B=-1,R=!1,j=!0,N=0,b=v.length;N<b;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===y&&(B=N),R=ee}return B},c.loadedEndOfParts=function(v,y){var F=v[v.length-1];return F&&y>F.start&&F.loaded},c.getInitialLiveFragment=function(v,y){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(u.findFragmentByPDT)(y,F.endProgramDateTime,this.config.maxFragLookUpTolerance)),!B){var R=F.sn+1;if(R>=v.startSN&&R<=v.endSN){var j=y[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(u.findFragWithCC)(y,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},c.getFragmentAtPosition=function(v,y,F){var B=this.config,R=this.fragPrevious,j=F.fragments,N=F.endSN,b=F.fragmentHint,Y=B.maxFragLookUpTolerance,ee=!!(B.lowLatencyMode&&F.partList&&b);ee&&b&&!this.bitrateTest&&(j=j.concat(b),N=b.sn);var ae;if(v<y){var ue=v>y-Y?0:Y;ae=Object(u.findFragmentByPTS)(R,j,v,ue)}else ae=j[j.length-1];if(ae){var Oe=ae.sn-F.startSN,Ee=R&&ae.level===R.level,xe=j[Oe+1],Ae=this.fragmentTracker.getState(ae);if(Ae===k.FragmentState.BACKTRACKED){ae=null;for(var Re=Oe;j[Re]&&this.fragmentTracker.getState(j[Re])===k.FragmentState.BACKTRACKED;)R?ae=j[Re--]:ae=j[--Re];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},c.synchronizeToLiveEdge=function(v){var y=this.config,F=this.media;if(!F)return;var B=this.hls.liveSyncPosition,R=F.currentTime,j=v.fragments[0].start,N=v.edge,b=R>=j-y.maxFragLookUpTolerance&&R<=N;if(B!==null&&F.duration>B&&(R<B||!b)){var Y=y.liveMaxLatencyDuration!==void 0?y.liveMaxLatencyDuration:y.liveMaxLatencyDurationCount*v.targetduration;(!b&&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))}},c.alignPlaylists=function(v,y){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 b=v.fragments[0].start,Y=!y,ee=v.alignedSliding&&Object(X.isFiniteNumber)(b);if(Y||!ee&&!b){Object(m.alignStream)(R,j,v);var ae=v.fragments[0].start;return this.log("Live playlist sliding: "+ae.toFixed(2)+" start-sn: "+(y?y.startSN:"na")+"->"+v.startSN+" prev-sn: "+(R?R.sn:"na")+" fragments: "+N),ae}return b},c.waitForCdnTuneIn=function(v){var y=3;return v.live&&v.canBlockReload&&v.tuneInGoal>Math.max(v.partHoldBack,v.partTarget*y)},c.setStartPosition=function(v,y){var F=this.startPosition;if(F<y&&(F=-1),F===-1||this.lastCurrentTime===-1){var B=v.startTimeOffset;Object(X.isFiniteNumber)(B)?(F=y+B,B<0&&(F+=v.totalduration),F=Math.min(Math.max(y,F),y+v.totalduration),this.log("Start time offset "+B+" found in playlist, adjust startPosition to "+F),this.startPosition=F):v.live?F=this.hls.liveSyncPosition||y:this.startPosition=F=0,this.lastCurrentTime=F}this.nextLoadPosition=F},c.getLoadPosition=function(){var v=this.media,y=0;return this.loadedmetadata&&v?y=v.currentTime:this.nextLoadPosition&&(y=this.nextLoadPosition),y},c.handleFragLoadAborted=function(v,y){this.transmuxer&&v.sn!=="initSegment"&&v.stats.aborted&&(this.warn("Fragment "+v.sn+(y?" part"+y.index:"")+" of level "+v.level+" was aborted"),this.resetFragmentLoading(v))},c.resetFragmentLoading=function(v){(!this.fragCurrent||!this.fragContextChanged(v))&&(this.state=O.IDLE)},c.onFragmentOrKeyLoadError=function(v,y){if(y.fatal)return;var F=y.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 y.levelRetry?(v===a.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=O.IDLE):(W.logger.error(y.details+" reaches max retry, redispatch as fatal ..."),y.fatal=!0,this.hls.stopLoad(),this.state=O.ERROR)},c.afterBufferFlushed=function(v,y,F){if(!v)return;var B=G.BufferHelper.getBuffered(v);this.fragmentTracker.detectEvictedFragments(y,B,F),this.state===O.ENDED&&this.resetLoadingState()},c.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=O.IDLE},c.resetLiveStartWhenNotLoaded=function(v){if(!this.loadedmetadata){this.startFragRequested=!1;var y=this.levels?this.levels[v].details:null;if(y!=null&&y.live)return this.startPosition=-1,this.setStartPosition(y,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},c.updateLevelTiming=function(v,y,F,B){var R=this,j=F.details;console.assert(!!j,"level.details must be defined");var N=Object.keys(v.elementaryStreams).reduce(function(b,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(),b||!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 b},!1);N?(this.state=O.PARSED,this.hls.trigger(n.Events.FRAG_PARSED,{frag:v,part:y})):this.resetLoadingState()},c.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},A(x,[{key:"state",get:function(){return this._state},set:function(v){var y=this._state;y!==v&&(this._state=v,this.log(y+"->"+v))}}]),x}(U.default)},"./src/controller/buffer-controller.ts":function(re,$,P){"use strict";P.r($),P.d($,"default",function(){return u});var X=P("./src/polyfills/number.ts"),U=P("./src/events.ts"),k=P("./src/utils/logger.ts"),G=P("./src/errors.ts"),W=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.)(?:\.[^.,]+)+/,u=function(){function o(l){var h=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 a=h.hls,s=h.media,A=h.mediaSource;k.logger.log("[buffer-controller]: Media source opened"),s&&(h.updateMediaElementDuration(),a.trigger(U.Events.MEDIA_ATTACHED,{media:s})),A&&A.removeEventListener("sourceopen",h._onMediaSourceOpen),h.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 f=o.prototype;return f.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},f.destroy=function(){this.unregisterListeners(),this.details=null},f.registerListeners=function(){var h=this.hls;h.on(U.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),h.on(U.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.on(U.Events.MANIFEST_PARSED,this.onManifestParsed,this),h.on(U.Events.BUFFER_RESET,this.onBufferReset,this),h.on(U.Events.BUFFER_APPENDING,this.onBufferAppending,this),h.on(U.Events.BUFFER_CODECS,this.onBufferCodecs,this),h.on(U.Events.BUFFER_EOS,this.onBufferEos,this),h.on(U.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),h.on(U.Events.LEVEL_UPDATED,this.onLevelUpdated,this),h.on(U.Events.FRAG_PARSED,this.onFragParsed,this),h.on(U.Events.FRAG_CHANGED,this.onFragChanged,this)},f.unregisterListeners=function(){var h=this.hls;h.off(U.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),h.off(U.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.off(U.Events.MANIFEST_PARSED,this.onManifestParsed,this),h.off(U.Events.BUFFER_RESET,this.onBufferReset,this),h.off(U.Events.BUFFER_APPENDING,this.onBufferAppending,this),h.off(U.Events.BUFFER_CODECS,this.onBufferCodecs,this),h.off(U.Events.BUFFER_EOS,this.onBufferEos,this),h.off(U.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),h.off(U.Events.LEVEL_UPDATED,this.onLevelUpdated,this),h.off(U.Events.FRAG_PARSED,this.onFragParsed,this),h.off(U.Events.FRAG_CHANGED,this.onFragChanged,this)},f._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new g.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},f.onManifestParsed=function(h,a){var s=2;(a.audio&&!a.video||!a.altAudio)&&(s=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=s,this.details=null,k.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},f.onMediaAttaching=function(h,a){var s=this.media=a.media;if(s&&p){var A=this.mediaSource=new p;A.addEventListener("sourceopen",this._onMediaSourceOpen),A.addEventListener("sourceended",this._onMediaSourceEnded),A.addEventListener("sourceclose",this._onMediaSourceClose),s.src=self.URL.createObjectURL(A),this._objectUrl=s.src}},f.onMediaDetaching=function(){var h=this.media,a=this.mediaSource,s=this._objectUrl;if(a){if(k.logger.log("[buffer-controller]: media source detaching"),a.readyState==="open")try{a.endOfStream()}catch(A){k.logger.warn("[buffer-controller]: onMediaDetaching: "+A.message+" while calling endOfStream")}this.onBufferReset(),a.removeEventListener("sourceopen",this._onMediaSourceOpen),a.removeEventListener("sourceended",this._onMediaSourceEnded),a.removeEventListener("sourceclose",this._onMediaSourceClose),h&&(s&&self.URL.revokeObjectURL(s),h.src===s?(h.removeAttribute("src"),h.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)},f.onBufferReset=function(){var h=this;this.getSourceBufferTypes().forEach(function(a){var s=h.sourceBuffer[a];try{s&&(h.removeBufferListeners(a),h.mediaSource&&h.mediaSource.removeSourceBuffer(s),h.sourceBuffer[a]=void 0)}catch(A){k.logger.warn("[buffer-controller]: Failed to reset the "+a+" buffer",A)}}),this._initSourceBuffer()},f.onBufferCodecs=function(h,a){var s=this,A=this.getSourceBufferTypes().length;if(Object.keys(a).forEach(function(E){if(A){var S=s.tracks[E];if(S&&typeof S.buffer.changeType=="function"){var L=a[E],O=L.codec,C=L.levelCodec,T=L.container,x=(S.levelCodec||S.codec).replace(m,"$1"),c=(C||O).replace(m,"$1");if(x!==c){var w=T+";codecs="+(C||O);s.appendChangeType(E,w)}}}else s.pendingTracks[E]=a[E]}),A)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},f.appendChangeType=function(h,a){var s=this,A=this.operationQueue,E={execute:function(){var L=s.sourceBuffer[h];L&&(k.logger.log("[buffer-controller]: changing "+h+" sourceBuffer type to "+a),L.changeType(a)),A.shiftAndExecuteNext(h)},onStart:function(){},onComplete:function(){},onError:function(L){k.logger.warn("[buffer-controller]: Failed to change "+h+" SourceBuffer type",L)}};A.append(E,h)},f.onBufferAppending=function(h,a){var s=this,A=this.hls,E=this.operationQueue,S=this.tracks,L=a.data,O=a.type,C=a.frag,T=a.part,x=a.chunkMeta,c=x.buffering[O],w=self.performance.now();c.start=w;var v=C.stats.buffering,y=T?T.stats.buffering:null;v.start===0&&(v.start=w),y&&y.start===0&&(y.start=w);var F=S.audio,B=O==="audio"&&x.id===1&&(F==null?void 0:F.container)==="audio/mpeg",R={execute:function(){if(c.executeStart=self.performance.now(),B){var N=s.sourceBuffer[O];if(N){var b=C.start-N.timestampOffset;Math.abs(b)>=.1&&(k.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+C.start+" (delta: "+b+") sn: "+C.sn+")"),N.timestampOffset=C.start)}}s.appendExecutor(L,O)},onStart:function(){},onComplete:function(){var N=self.performance.now();c.executeEnd=c.end=N,v.first===0&&(v.first=N),y&&y.first===0&&(y.first=N);var b=s.sourceBuffer,Y={};for(var ee in b)Y[ee]=W.BufferHelper.getBuffered(b[ee]);s.appendError=0,s.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 b={type:G.ErrorTypes.MEDIA_ERROR,parent:C.type,details:G.ErrorDetails.BUFFER_APPEND_ERROR,err:N,fatal:!1};N.code===DOMException.QUOTA_EXCEEDED_ERR?b.details=G.ErrorDetails.BUFFER_FULL_ERROR:(s.appendError++,b.details=G.ErrorDetails.BUFFER_APPEND_ERROR,s.appendError>A.config.appendErrorMaxRetry&&(k.logger.error("[buffer-controller]: Failed "+A.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),b.fatal=!0)),A.trigger(U.Events.ERROR,b)}};E.append(R,O)},f.onBufferFlushing=function(h,a){var s=this,A=this.operationQueue,E=function(L){return{execute:s.removeExecutor.bind(s,L,a.startOffset,a.endOffset),onStart:function(){},onComplete:function(){s.hls.trigger(U.Events.BUFFER_FLUSHED,{type:L})},onError:function(C){k.logger.warn("[buffer-controller]: Failed to remove from "+L+" SourceBuffer",C)}}};a.type?A.append(E(a.type),a.type):this.getSourceBufferTypes().forEach(function(S){A.append(E(S),S)})},f.onFragParsed=function(h,a){var s=this,A=a.frag,E=a.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;s.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)},f.onFragChanged=function(h,a){this.flushBackBuffer()},f.onBufferEos=function(h,a){var s=this,A=this.getSourceBufferTypes().reduce(function(E,S){var L=s.sourceBuffer[S];return(!a.type||a.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=s.mediaSource;if(!E||E.readyState!=="open")return;E.endOfStream()})},f.onLevelUpdated=function(h,a){var s=a.details;if(!s.fragments.length)return;this.details=s,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},f.flushBackBuffer=function(){var h=this.hls,a=this.details,s=this.media,A=this.sourceBuffer;if(!s||a===null)return;var E=this.getSourceBufferTypes();if(!E.length)return;var S=a.live&&h.config.liveBackBufferLength!==null?h.config.liveBackBufferLength:h.config.backBufferLength;if(!Object(X.isFiniteNumber)(S)||S<0)return;var L=s.currentTime,O=a.levelTargetDuration,C=Math.max(S,O),T=Math.floor(L/O)*O-C;E.forEach(function(x){var c=A[x];if(c){var w=W.BufferHelper.getBuffered(c);w.length>0&&T>w.start(0)&&(h.trigger(U.Events.BACK_BUFFER_REACHED,{bufferEnd:T}),a.live&&h.trigger(U.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:T}),h.trigger(U.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:T,type:x}))}})},f.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var h=this.details,a=this.hls,s=this.media,A=this.mediaSource,E=h.fragments[0].start+h.totalduration,S=s.duration,L=Object(X.isFiniteNumber)(A.duration)?A.duration:0;h.live&&a.config.liveDurationInfinity?(k.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),A.duration=Infinity,this.updateSeekableRange(h)):(E>L&&E>S||!Object(X.isFiniteNumber)(S))&&(k.logger.log("[buffer-controller]: Updating Media Source duration to "+E.toFixed(3)),A.duration=E)},f.updateSeekableRange=function(h){var a=this.mediaSource,s=h.fragments,A=s.length;if(A&&h.live&&a!==null&&a!==void 0&&a.setLiveSeekableRange){var E=Math.max(0,s[0].start),S=Math.max(E,E+h.totalduration);a.setLiveSeekableRange(E,S)}},f.checkPendingTracks=function(){var h=this.bufferCodecEventsExpected,a=this.operationQueue,s=this.pendingTracks,A=Object.keys(s).length;if(A&&!h||A===2){this.createSourceBuffers(s),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){a.executeNext(S)})}},f.createSourceBuffers=function(h){var a=this.sourceBuffer,s=this.mediaSource;if(!s)throw Error("createSourceBuffers called when mediaSource was null");var A=0;for(var E in h)if(!a[E]){var S=h[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=a[E]=s.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})},f._onSBUpdateStart=function(h){var a=this.operationQueue,s=a.current(h);s.onStart()},f._onSBUpdateEnd=function(h){var a=this.operationQueue,s=a.current(h);s.onComplete(),a.shiftAndExecuteNext(h)},f._onSBUpdateError=function(h,a){k.logger.error("[buffer-controller]: "+h+" SourceBuffer error",a),this.hls.trigger(U.Events.ERROR,{type:G.ErrorTypes.MEDIA_ERROR,details:G.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var s=this.operationQueue.current(h);s&&s.onError(a)},f.removeExecutor=function(h,a,s){var A=this.media,E=this.mediaSource,S=this.operationQueue,L=this.sourceBuffer,O=L[h];if(!A||!E||!O){k.logger.warn("[buffer-controller]: Attempting to remove from the "+h+" SourceBuffer, but it does not exist"),S.shiftAndExecuteNext(h);return}var C=Object(X.isFiniteNumber)(A.duration)?A.duration:Infinity,T=Object(X.isFiniteNumber)(E.duration)?E.duration:Infinity,x=Math.max(0,a),c=Math.min(s,C,T);c>x?(k.logger.log("[buffer-controller]: Removing ["+x+","+c+"] from the "+h+" SourceBuffer"),console.assert(!O.updating,h+" sourceBuffer must not be updating"),O.remove(x,c)):S.shiftAndExecuteNext(h)},f.appendExecutor=function(h,a){var s=this.operationQueue,A=this.sourceBuffer,E=A[a];if(!E){k.logger.warn("[buffer-controller]: Attempting to append to the "+a+" SourceBuffer, but it does not exist"),s.shiftAndExecuteNext(a);return}E.ended=!1,console.assert(!E.updating,a+" sourceBuffer must not be updating"),E.appendBuffer(h)},f.blockBuffers=function(h,a){var s=this;if(a===void 0&&(a=this.getSourceBufferTypes()),!a.length){k.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(h);return}var A=this.operationQueue,E=a.map(function(S){return A.appendBlocker(S)});Promise.all(E).then(function(){h(),a.forEach(function(S){var L=s.sourceBuffer[S];(!L||!L.updating)&&A.shiftAndExecuteNext(S)})})},f.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},f.addBufferListener=function(h,a,s){var A=this.sourceBuffer[h];if(!A)return;var E=s.bind(this,h);this.listeners[h].push({event:a,listener:E}),A.addEventListener(a,E)},f.removeBufferListeners=function(h){var a=this.sourceBuffer[h];if(!a)return;this.listeners[h].forEach(function(s){a.removeEventListener(s.event,s.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(W){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=W}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 u=m[0];try{u.execute()}catch(o){X.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),u.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(W,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(W,g.key,g)}}function k(W,n,D){return n&&U(W.prototype,n),D&&U(W,D),W}var G=function(){function W(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=W.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){W.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 u=m.filter(function(o,f){return W.isLevelAllowed(f,p.restrictedLevels)&&f<=g});return this.clientRect=null,W.getMaxLevelByMediaSize(u,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},W.isLevelAllowed=function(g,p){return p===void 0&&(p=[]),p.indexOf(g)===-1},W.getMaxLevelByMediaSize=function(g,p,m){if(!g||!g.length)return-1;for(var u=function(a,s){return s?a.width!==s.width||a.height!==s.height:!0},o=g.length-1,f=0;f<g.length;f+=1){var l=g[f];if((l.width>=p||l.height>=m)&&u(l,g[f+1])){o=f;break}}return o},k(W,[{key:"mediaWidth",get:function(){return this.getDimensions().width*W.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*W.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var g=1;try{g=self.devicePixelRatio}catch(p){}return g}}]),W}();$.default=G},"./src/controller/cmcd-controller.ts":function(re,$,P){"use strict";P.r($),P.d($,"default",function(){return u});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 W(o,f){for(var l=0;l<f.length;l++){var h=f[l];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(o,h.key,h)}}function n(o,f,l){return f&&W(o.prototype,f),l&&W(o,l),o}function D(o,f){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))||f&&o&&typeof o.length=="number"){l&&(o=l);var h=0;return function(){return h>=o.length?{done:!0}:{done:!1,value:o[h++]}}}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,f){if(!o)return;if(typeof o=="string")return p(o,f);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,f)}function p(o,f){(f==null||f>o.length)&&(f=o.length);for(var l=0,h=new Array(f);l<f;l++)h[l]=o[l];return h}function m(){return m=Object.assign||function(o){for(var f=1;f<arguments.length;f++){var l=arguments[f];for(var h in l)Object.prototype.hasOwnProperty.call(l,h)&&(o[h]=l[h])}return o},m.apply(this,arguments)}var u=function(){function o(l){var h=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(){h.initialized&&(h.starved=!0),h.buffering=!0},this.onPlaying=function(){h.initialized||(h.initialized=!0),h.buffering=!1},this.applyPlaylistData=function(A){try{h.apply(A,{ot:U.CMCDObjectType.MANIFEST,su:!h.initialized})}catch(E){G.logger.warn("Could not generate manifest CMCD data.",E)}},this.applyFragmentData=function(A){try{var E=A.frag,S=h.hls.levels[E.level],L=h.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=h.getTopBandwidth(L),O.bl=h.getBufferLength(L)),h.apply(A,O)}catch(C){G.logger.warn("Could not generate segment CMCD data.",C)}},this.hls=l;var a=this.config=l.config,s=a.cmcd;s!=null&&(a.pLoader=this.createPlaylistLoader(),a.fLoader=this.createFragmentLoader(),this.sid=s.sessionId||o.uuid(),this.cid=s.contentId,this.useHeaders=s.useHeaders===!0,this.registerListeners())}var f=o.prototype;return f.registerListeners=function(){var h=this.hls;h.on(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.on(X.Events.MEDIA_DETACHED,this.onMediaDetached,this),h.on(X.Events.BUFFER_CREATED,this.onBufferCreated,this)},f.unregisterListeners=function(){var h=this.hls;h.off(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.off(X.Events.MEDIA_DETACHED,this.onMediaDetached,this),h.off(X.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},f.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},f.onMediaAttached=function(h,a){this.media=a.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},f.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},f.onBufferCreated=function(h,a){var s,A;this.audioBuffer=(s=a.tracks.audio)===null||s===void 0?void 0:s.buffer,this.videoBuffer=(A=a.tracks.video)===null||A===void 0?void 0:A.buffer},f.createData=function(){var h;return{v:U.CMCDVersion,sf:U.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(h=this.media)===null||h===void 0?void 0:h.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},f.apply=function(h,a){a===void 0&&(a={}),m(a,this.createData());var s=a.ot===U.CMCDObjectType.INIT||a.ot===U.CMCDObjectType.VIDEO||a.ot===U.CMCDObjectType.MUXED;if(this.starved&&s&&(a.bs=!0,a.su=!0,this.starved=!1),a.su==null&&(a.su=this.buffering),this.useHeaders){var A=o.toHeaders(a);if(!Object.keys(A).length)return;h.headers||(h.headers={}),m(h.headers,A)}else{var E=o.toQuery(a);if(!E)return;h.url=o.appendQueryToUri(h.url,E)}},f.getObjectType=function(h){var a=h.type;return a==="subtitle"?U.CMCDObjectType.TIMED_TEXT:h.sn==="initSegment"?U.CMCDObjectType.INIT:a==="audio"?U.CMCDObjectType.AUDIO:a==="main"?this.hls.audioTracks.length?U.CMCDObjectType.VIDEO:U.CMCDObjectType.MUXED:void 0},f.getTopBandwidth=function(h){for(var a=0,s=h===U.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,A=D(s),E;!(E=A()).done;){var S=E.value;S.bitrate>a&&(a=S.bitrate)}return a>0?a:NaN},f.getBufferLength=function(h){var a=this.hls.media,s=h===U.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!s||!a)return NaN;var A=k.BufferHelper.bufferInfo(s,a.currentTime,this.config.maxBufferHole);return A.len*1e3},f.createPlaylistLoader=function(){var h=this.config.pLoader,a=this.applyPlaylistData,s=h||this.config.loader;return function(){function A(S){this.loader=void 0,this.loader=new s(S)}var E=A.prototype;return E.destroy=function(){this.loader.destroy()},E.abort=function(){this.loader.abort()},E.load=function(L,O,C){a(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}()},f.createFragmentLoader=function(){var h=this.config.fLoader,a=this.applyFragmentData,s=h||this.config.loader;return function(){function A(S){this.loader=void 0,this.loader=new s(S)}var E=A.prototype;return E.destroy=function(){this.loader.destroy()},E.abort=function(){this.loader.abort()},E.load=function(L,O,C){a(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 h=URL.createObjectURL(new Blob),a=h.toString();return URL.revokeObjectURL(h),a.substr(a.lastIndexOf("/")+1)},o.serialize=function(h){for(var a=[],s=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(h||{}).sort(),C=D(O),T;!(T=C()).done;){var x=T.value,c=h[x];if(!s(c))continue;if(x==="v"&&c===1)continue;if(x=="pr"&&c===1)continue;var w=L[x];w&&(c=w(c));var v=typeof c,y=void 0;x==="ot"||x==="sf"||x==="st"?y=x+"="+c:v==="boolean"?y=x:v==="number"?y=x+"="+c:y=x+"="+JSON.stringify(c),a.push(y)}return a.join(",")},o.toHeaders=function(h){for(var a=Object.keys(h),s={},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=a;L<O.length;L++){var C=O[L],T=S[C]!=null?S[C]:1;E[T][C]=h[C]}for(var x=0;x<E.length;x++){var c=o.serialize(E[x]);c&&(s["CMCD-"+A[x]]=c)}return s},o.toQuery=function(h){return"CMCD="+encodeURIComponent(o.serialize(h))},o.appendQueryToUri=function(h,a){if(!a)return h;var s=h.includes("?")?"&":"?";return""+h+s+a},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 W(u,o){for(var f=0;f<o.length;f++){var l=o[f];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(u,l.key,l)}}function n(u,o,f){return o&&W(u.prototype,o),f&&W(u,f),u}var D=3,g=function(o,f,l){var h={audioCapabilities:[],videoCapabilities:[]};return o.forEach(function(a){h.audioCapabilities.push({contentType:'audio/mp4; codecs="'+a+'"',robustness:l.audioRobustness||""})}),f.forEach(function(a){h.videoCapabilities.push({contentType:'video/mp4; codecs="'+a+'"',robustness:l.videoRobustness||""})}),[h]},p=function(o,f,l,h){switch(o){case G.KeySystems.WIDEVINE:return g(f,l,h);default:throw new Error("Unknown key-system: "+o)}},m=function(){function u(f){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=f,this._config=f.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=u.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,h,a){var s=this,A=p(l,h,a,this._drmSystemOptions);k.logger.log("Requesting encrypted media key-system access");var E=this.requestMediaKeySystemAccess(l,A);this.mediaKeysPromise=E.then(function(S){return s._onMediaKeySystemAccessObtained(l,S)}),E.catch(function(S){k.logger.error('Failed to obtain key-system "'+l+'" access:',S)})},o._onMediaKeySystemAccessObtained=function(l,h){var a=this;k.logger.log('Access for key-system "'+l+'" obtained');var s={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:h,mediaKeySystemDomain:l};this._mediaKeysList.push(s);var A=Promise.resolve().then(function(){return h.createMediaKeys()}).then(function(E){return s.mediaKeys=E,k.logger.log('Media-keys created for key-system "'+l+'"'),a._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(h){h.mediaKeysSession||(h.mediaKeysSession=h.mediaKeys.createSession(),l._onNewMediaKeySession(h.mediaKeysSession))})},o._onNewMediaKeySession=function(l){var h=this;k.logger.log("New key-system session "+l.sessionId),l.addEventListener("message",function(a){h._onKeySessionMessage(l,a.message)},!1)},o._onKeySessionMessage=function(l,h){k.logger.log("Got EME message event, creating license request"),this._requestLicense(h,function(a){k.logger.log("Received license data (length: "+(a&&a.byteLength)+"), updating key-session"),l.update(a)})},o.onMediaEncrypted=function(l){var h=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 a=function(A){if(!h._media)return;h._attemptSetMediaKeys(A),h._generateRequestWithPreferredKeySession(l.initDataType,l.initData)};this.mediaKeysPromise.then(a).catch(a)},o._attemptSetMediaKeys=function(l){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var h=this._mediaKeysList[0];if(!h||!h.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(h.mediaKeys),this._hasSetMediaKeys=!0}},o._generateRequestWithPreferredKeySession=function(l,h){var a=this,s=this._mediaKeysList[0];if(!s){k.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(X.Events.ERROR,{type:U.ErrorTypes.KEY_SYSTEM_ERROR,details:U.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(s.mediaKeysSessionInitialized){k.logger.warn("Key-Session already initialized but requested again");return}var A=s.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(!h){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'),s.mediaKeysSessionInitialized=!0,A.generateRequest(l,h).then(function(){k.logger.debug("Key-session generation succeeded")}).catch(function(E){k.logger.error("Error generating key-session request:",E),a.hls.trigger(X.Events.ERROR,{type:U.ErrorTypes.KEY_SYSTEM_ERROR,details:U.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},o._createLicenseXhr=function(l,h,a){var s=new XMLHttpRequest;s.responseType="arraybuffer",s.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,s,l,h,a);var A=this._licenseXhrSetup;if(A)try{A.call(this.hls,s,l),A=void 0}catch(E){k.logger.error(E)}try{s.readyState||s.open("POST",l,!0),A&&A.call(this.hls,s,l)}catch(E){throw new Error("issue setting up KeySystem license XHR "+E)}return s},o._onLicenseRequestReadyStageChange=function(l,h,a,s){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,h)}catch(L){k.logger.error(L)}s(A)}else{if(k.logger.error("License Request XHR failed ("+h+"). 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(a,s)}break}},o._generateLicenseRequestChallenge=function(l,h){switch(l.mediaKeySystemDomain){case G.KeySystems.WIDEVINE:return h}throw new Error("unsupported key-system: "+l.mediaKeySystemDomain)},o._requestLicense=function(l,h){k.logger.log("Requesting content license for key-system");var a=this._mediaKeysList[0];if(!a){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 s=this.getLicenseServerUrl(a.mediaKeySystemDomain),A=this._createLicenseXhr(s,l,h);k.logger.log("Sending license request to URL: "+s);var E=this._generateLicenseRequestChallenge(a,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,h){if(!this._emeEnabled)return;var a=h.media;this._media=a,a.addEventListener("encrypted",this._onMediaEncrypted)},o.onMediaDetached=function(){var l=this._media,h=this._mediaKeysList;if(!l)return;l.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(h.map(function(a){if(a.mediaKeysSession)return a.mediaKeysSession.close().catch(function(){})})).then(function(){return l.setMediaKeys(null)}).catch(function(){})},o.onManifestParsed=function(l,h){if(!this._emeEnabled)return;var a=h.levels.map(function(A){return A.audioCodec}).filter(function(A){return!!A}),s=h.levels.map(function(A){return A.videoCodec}).filter(function(A){return!!A});this._attemptKeySystemAccess(G.KeySystems.WIDEVINE,a,s)},n(u,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),u}();$.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 W=G.prototype;return W.setStreamController=function(D){this.streamController=D},W.registerListeners=function(){this.hls.on(X.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},W.unregisterListeners=function(){this.hls.off(X.Events.MEDIA_ATTACHING,this.onMediaAttaching)},W.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},W.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)}},W.checkFPS=function(D,g,p){var m=performance.now();if(g){if(this.lastTime){var u=m-this.lastTime,o=p-this.lastDroppedFrames,f=g-this.lastDecodedFrames,l=1e3*o/u,h=this.hls;if(h.trigger(X.Events.FPS_DROP,{currentDropped:o,currentDecoded:f,totalDroppedFrames:p}),l>0&&o>h.config.fpsDroppedMonitoringThreshold*f){var a=h.currentLevel;U.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+a),a>0&&(h.autoLevelCapping===-1||h.autoLevelCapping>=a)&&(a=a-1,h.trigger(X.Events.FPS_DROP_LEVEL_CAPPING,{level:a,droppedLevel:h.currentLevel}),h.autoLevelCapping=a,this.streamController.nextLevelSwitch())}}this.lastTime=m,this.lastDroppedFrames=p,this.lastDecodedFrames=g}},W.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 W}),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 u=g[0].programDateTime;if(p<(u||0))return null;var o=g[g.length-1].endProgramDateTime;if(p>=(o||0))return null;m=m||0;for(var f=0;f<g.length;++f){var l=g[f];if(n(p,m,l))return l}return null}function G(g,p,m,u){m===void 0&&(m=0),u===void 0&&(u=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&&W(m,u,o)===0)return o;var f=U.default.search(p,W.bind(null,m,u));return f||o}function W(g,p,m){g===void 0&&(g=0),p===void 0&&(p=0);var u=Math.min(p,m.duration+(m.deltaPTS?m.deltaPTS:0));return m.start+m.duration-u<=g?1:m.start-u>g&&m.start?-1:0}function n(g,p,m){var u=Math.min(p,m.duration+(m.deltaPTS?m.deltaPTS:0))*1e3,o=m.endProgramDateTime||0;return o-u>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,u){if(u===U.PlaylistLevelType.MAIN){var o=this.activeFragment,f=this.activeParts;if(!o)return null;if(f)for(var l=f.length;l--;){var h=f[l],a=h?h.end:o.appendedPTS;if(h.start<=m&&a!==void 0&&m<=a)return l>9&&(this.activeParts=f.slice(l-9)),h}else if(o.start<=m&&o.appendedPTS!==void 0&&m<=o.appendedPTS)return o}return this.getBufferedFrag(m,u)},g.getBufferedFrag=function(m,u){for(var o=this.fragments,f=Object.keys(o),l=f.length;l--;){var h=o[f[l]];if((h==null?void 0:h.body.type)===u&&h.buffered){var a=h.body;if(a.start<=m&&m<=a.end)return a}}return null},g.detectEvictedFragments=function(m,u,o){var f=this;Object.keys(this.fragments).forEach(function(l){var h=f.fragments[l];if(!h)return;if(!h.buffered){h.body.type===o&&f.removeFragment(h.body);return}var a=h.range[m];if(!a)return;a.time.some(function(s){var A=!f.isTimeBuffered(s.startPTS,s.endPTS,u);return A&&f.removeFragment(h.body),A})})},g.detectPartialFragments=function(m){var u=this,o=this.timeRanges,f=m.frag,l=m.part;if(!o||f.sn==="initSegment")return;var h=n(f),a=this.fragments[h];if(!a)return;Object.keys(o).forEach(function(s){var A=f.elementaryStreams[s];if(!A)return;var E=o[s],S=l!==null||A.partial===!0;a.range[s]=u.getBufferedTimes(f,l,S,E)}),a.backtrack=a.loaded=null,Object.keys(a.range).length?a.buffered=!0:this.removeFragment(a.body)},g.fragBuffered=function(m){var u=n(m),o=this.fragments[u];o&&(o.backtrack=o.loaded=null,o.buffered=!0)},g.getBufferedTimes=function(m,u,o,f){for(var l={time:[],partial:o},h=u?u.start:m.start,a=u?u.end:m.end,s=m.minEndPTS||a,A=m.maxStartPTS||h,E=0;E<f.length;E++){var S=f.start(E)-this.bufferPadding,L=f.end(E)+this.bufferPadding;if(A>=S&&s<=L){l.time.push({startPTS:Math.max(h,f.start(E)),endPTS:Math.min(a,f.end(E))});break}else if(h<L&&a>S)l.partial=!0,l.time.push({startPTS:Math.max(h,f.start(E)),endPTS:Math.min(a,f.end(E))});else if(a<=S)break}return l},g.getPartialFragment=function(m){var u=null,o,f,l,h=0,a=this.bufferPadding,s=this.fragments;return Object.keys(s).forEach(function(A){var E=s[A];if(!E)return;W(E)&&(f=E.body.start-a,l=E.body.end+a,m>=f&&m<=l&&(o=Math.min(m-f,l-m),h<=o&&(u=E.body,h=o)))}),u},g.getState=function(m){var u=n(m),o=this.fragments[u];return o?o.buffered?W(o)?k.PARTIAL:k.OK:o.backtrack?k.BACKTRACKED:k.APPENDING:k.NOT_LOADED},g.backtrack=function(m,u){var o=n(m),f=this.fragments[o];if(!f||f.backtrack)return null;var l=f.backtrack=u||f.loaded;return f.loaded=null,l},g.getBacktrackData=function(m){var u=n(m),o=this.fragments[u];if(o){var f,l=o.backtrack;if(l!=null&&(f=l.payload)!==null&&f!==void 0&&f.byteLength)return l;this.removeFragment(m)}return null},g.isTimeBuffered=function(m,u,o){for(var f,l,h=0;h<o.length;h++){if(f=o.start(h)-this.bufferPadding,l=o.end(h)+this.bufferPadding,m>=f&&u<=l)return!0;if(u<=f)return!1}return!1},g.onFragLoaded=function(m,u){var o=u.frag,f=u.part;if(o.sn==="initSegment"||o.bitrateTest||f)return;var l=n(o);this.fragments[l]={body:o,loaded:u,backtrack:null,buffered:!1,range:Object.create(null)}},g.onBufferAppended=function(m,u){var o=this,f=u.frag,l=u.part,h=u.timeRanges;if(f.type===U.PlaylistLevelType.MAIN)if(this.activeFragment=f,l){var a=this.activeParts;a||(this.activeParts=a=[]),a.push(l)}else this.activeParts=null;this.timeRanges=h,Object.keys(h).forEach(function(s){var A=h[s];if(o.detectEvictedFragments(s,A),!l)for(var E=0;E<A.length;E++)f.appendedPTS=Math.max(A.end(E),f.appendedPTS||0)})},g.onFragBuffered=function(m,u){this.detectPartialFragments(u)},g.hasFragment=function(m){var u=n(m);return!!this.fragments[u]},g.removeFragmentsInRange=function(m,u,o){var f=this;Object.keys(this.fragments).forEach(function(l){var h=f.fragments[l];if(!h)return;if(h.buffered){var a=h.body;a.type===o&&a.start<u&&a.end>m&&f.removeFragment(a)}})},g.removeFragment=function(m){var u=n(m);m.stats.loaded=0,m.clearElementaryStreamInfo(),delete this.fragments[u]},g.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},D}();function W(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 W}),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"),W=250,n=2,D=.1,g=.05,p=function(){function m(o,f,l,h){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=f,this.fragmentTracker=l,this.hls=h}var u=m.prototype;return u.destroy=function(){this.hls=this.fragmentTracker=this.media=null},u.poll=function(f){var l=this.config,h=this.media,a=this.stalled,s=h.currentTime,A=h.seeking,E=this.seeking&&!A,S=!this.seeking&&A;if(this.seeking=A,s!==f){if(this.moved=!0,a!==null){if(this.stallReported){var L=self.performance.now()-a;G.logger.warn("playback not stuck anymore @"+s+", after "+Math.round(L)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((S||E)&&(this.stalled=null),h.paused||h.ended||h.playbackRate===0||!X.BufferHelper.getBuffered(h).length)return;var O=X.BufferHelper.bufferInfo(h,s,0),C=O.len>0,T=O.nextStart||0;if(!C&&!T)return;if(A){var x=O.len>n,c=!T||T-s>n&&!this.fragmentTracker.getPartialFragment(s);if(x||c)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var w,v=Math.max(T,O.start||0)-s,y=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,F=y==null||((w=y.details)===null||w===void 0)?void 0:w.live,B=F?y.details.targetduration*2:n;if(v>0&&v<=B){this._trySkipBufferHole(null);return}}var R=self.performance.now();if(a===null){this.stalled=R;return}var j=R-a;!A&&j>=W&&this._reportStall(O.len);var N=X.BufferHelper.bufferInfo(h,s,l.maxBufferHole);this._tryFixBufferStall(N,j)},u._tryFixBufferStall=function(f,l){var h=this.config,a=this.fragmentTracker,s=this.media,A=s.currentTime,E=a.getPartialFragment(A);if(E){var S=this._trySkipBufferHole(E);if(S)return}f.len>h.maxBufferHole&&l>h.highBufferWatchdogPeriod*1e3&&(G.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},u._reportStall=function(f){var l=this.hls,h=this.media,a=this.stallReported;a||(this.stallReported=!0,G.logger.warn("Playback stalling at @"+h.currentTime+" due to low buffer (buffer="+f+")"),l.trigger(k.Events.ERROR,{type:U.ErrorTypes.MEDIA_ERROR,details:U.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:f}))},u._trySkipBufferHole=function(f){for(var l=this.config,h=this.hls,a=this.media,s=a.currentTime,A=0,E=X.BufferHelper.getBuffered(a),S=0;S<E.length;S++){var L=E.start(S);if(s+l.maxBufferHole>=A&&s<L){var O=Math.max(L+g,a.currentTime+D);return G.logger.warn("skipping hole, adjusting currentTime from "+s+" to "+O),this.moved=!0,this.stalled=null,a.currentTime=O,f&&h.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 "+s+" to "+O,frag:f}),O}A=E.end(S)}return 0},u._tryNudgeBuffer=function(){var f=this.config,l=this.hls,h=this.media,a=h.currentTime,s=(this.nudgeRetry||0)+1;if(this.nudgeRetry=s,s<f.nudgeMaxRetry){var A=a+s*f.nudgeOffset;G.logger.warn("Nudging 'currentTime' from "+a+" to "+A),h.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 @"+a+" after "+f.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,W=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 u=p[m];if(u.kind==="metadata"&&u.label==="id3")return Object(U.sendAddTrackEvent)(u,this.media),u}return this.media.addTextTrack("metadata","id3")},D.onFragParsingMetadata=function(p,m){if(!this.media)return;var u=m.frag,o=m.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var f=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,l=0;l<o.length;l++){var h=k.getID3Frames(o[l].data);if(h){var a=o[l].pts,s=l<o.length-1?o[l+1].pts:u.end,A=s-a;A<=0&&(s=a+G);for(var E=0;E<h.length;E++){var S=h[E];if(!k.isTimeStampFrame(S)){var L=new f(a,s,"");L.value=S,this.id3Track.addCue(L)}}}}},D.onBufferFlushing=function(p,m){var u=m.startOffset,o=m.endOffset,f=m.type;if(!f||f==="audio"){var l=this.id3Track;l&&Object(U.removeCuesInRange)(l,u,o)}},n}();$.default=W},"./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 W(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,u){this.media=u.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,u){var o=u.details;this.levelDetails=o,o.advanced&&this.timeupdate(),!o.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},g.onError=function(m,u){if(u.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,u=this.levelDetails;if(!m||!u)return;this.currentTime=m.currentTime;var o=this.computeLatency();if(o===null)return;this._latency=o;var f=this.config,l=f.lowLatencyMode,h=f.maxLiveSyncPlaybackRate;if(!l||h===1)return;var a=this.targetLatency;if(a===null)return;var s=o-a,A=Math.min(this.maxLatency,a+u.targetduration),E=s<A;if(u.live&&E&&s>.05&&this.forwardBufferLength>1){var S=Math.min(2,Math.max(1,h)),L=Math.round(2/(1+Math.exp(-.75*s-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},W(D,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var m=this.config,u=this.levelDetails;return m.liveMaxLatencyDuration!==void 0?m.liveMaxLatencyDuration:u?m.liveMaxLatencyDurationCount*u.targetduration:0}},{key:"targetLatency",get:function(){var m=this.levelDetails;if(m===null)return null;var u=m.holdBack,o=m.partHoldBack,f=m.targetduration,l=this.config,h=l.liveSyncDuration,a=l.liveSyncDurationCount,s=l.lowLatencyMode,A=this.hls.userConfig,E=s&&o||u;(A.liveSyncDuration||A.liveSyncDurationCount||E===0)&&(E=h!==void 0?h:a*f);var S=f,L=1;return E+Math.min(this.stallCount*L,S)}},{key:"liveSyncPosition",get:function(){var m=this.estimateLiveEdge(),u=this.targetLatency,o=this.levelDetails;if(m===null||u===null||o===null)return null;var f=o.edge,l=m-u-this.edgeStalled,h=f-o.totalduration,a=f-(this.config.lowLatencyMode&&o.partTarget||o.targetduration);return Math.min(Math.max(h,l),a)}},{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 u=(this.config.lowLatencyMode&&m.partTarget||m.targetduration)*3;return Math.max(m.age-u,0)}},{key:"forwardBufferLength",get:function(){var m=this.media,u=this.levelDetails;if(!m||!u)return 0;var o=m.buffered.length;return o?m.buffered.end(o-1):u.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"),W=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(h){for(var a=1;a<arguments.length;a++){var s=arguments[a];for(var A in s)Object.prototype.hasOwnProperty.call(s,A)&&(h[A]=s[A])}return h},g.apply(this,arguments)}function p(h,a){for(var s=0;s<a.length;s++){var A=a[s];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(h,A.key,A)}}function m(h,a,s){return a&&p(h.prototype,a),s&&p(h,s),h}function u(h,a){h.prototype=Object.create(a.prototype),h.prototype.constructor=h,o(h,a)}function o(h,a){return o=Object.setPrototypeOf||function(A,E){return A.__proto__=E,A},o(h,a)}var f=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),l=function(h){u(a,h);function a(A){var E;return E=h.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 s=a.prototype;return s._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)},s._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)},s.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,h.prototype.destroy.call(this)},s.startLoad=function(){var E=this._levels;E.forEach(function(S){S.loadError=0}),h.prototype.startLoad.call(this)},s.onManifestLoaded=function(E,S){var L=[],O=[],C=[],T,x={},c,w=!1,v=!1,y=!1;if(S.levels.forEach(function(j){var N=j.attrs;w=w||!!(j.width&&j.height),v=v||!!j.videoCodec,y=y||!!j.audioCodec,f&&j.audioCodec&&j.audioCodec.indexOf("mp4a.40.34")!==-1&&(j.audioCodec=void 0);var b=j.bitrate+"-"+j.attrs.RESOLUTION+"-"+j.attrs.CODECS;c=x[b],c?c.url.push(j.url):(c=new X.Level(j),x[b]=c,L.push(c)),N&&(N.AUDIO&&Object(W.addGroupId)(c,"audio",N.AUDIO),N.SUBTITLES&&Object(W.addGroupId)(c,"text",N.SUBTITLES))}),(w||v)&&y&&(L=L.filter(function(j){var N=j.videoCodec,b=j.width,Y=j.height;return!!N||!!(b&&Y)})),L=L.filter(function(j){var N=j.audioCodec,b=j.videoCodec;return(!N||Object(G.isCodecSupportedInMp4)(N,"audio"))&&(!b||Object(G.isCodecSupportedInMp4)(b,"video"))}),S.audioTracks&&(O=S.audioTracks.filter(function(j){return!j.audioCodec||Object(G.isCodecSupportedInMp4)(j.audioCodec,"audio")}),Object(W.assignTrackIdsByGroup)(O)),S.subtitles&&(C=S.subtitles,Object(W.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=y&&!v,R={levels:L,audioTracks:O,subtitleTracks:C,firstLevel:this._firstLevel,stats:S.stats,audio:y,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"})},s.onError=function(E,S){if(h.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 c=this._levels[S.frag.level];c?(c.fragmentError++,c.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)},s.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 c=T.url.length;if(c>1&&T.loadError<c)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)}}},s.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}},s.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)}},s.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)},s.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())}},s.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})}},s.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(c){c.level=T}),C});this._levels=O,this.hls.trigger(U.Events.LEVELS_UPDATED,{levels:O})},m(a,[{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 c=g({},x,{level:E,maxBitrate:x.maxBitrate,uri:x.uri,urlId:x.urlId});delete c._urlId,this.hls.trigger(U.Events.LEVEL_SWITCHING,c);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)}}]),a}(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 W}),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 u}),P.d($,"addSliding",function(){return o}),P.d($,"computeReloadInterval",function(){return f}),P.d($,"getFragmentWithSN",function(){return l}),P.d($,"getPartWith",function(){return h});var X=P("./src/polyfills/number.ts"),U=P("./src/utils/logger.ts");function k(a,s,A){switch(s){case"audio":a.audioGroupIds||(a.audioGroupIds=[]),a.audioGroupIds.push(A);break;case"text":a.textGroupIds||(a.textGroupIds=[]),a.textGroupIds.push(A);break}}function G(a){var s={};a.forEach(function(A){var E=A.groupId||"";A.id=s[E]=s[E]||0,s[E]++})}function W(a,s,A){var E=a[s],S=a[A];n(E,S)}function n(a,s){var A=s.startPTS;if(Object(X.isFiniteNumber)(A)){var E=0,S;s.sn>a.sn?(E=A-a.start,S=a):(E=a.start-A,S=s),S.duration!==E&&(S.duration=E)}else if(s.sn>a.sn){var L=a.cc===s.cc;L&&a.minEndPTS?s.start=a.start+(a.minEndPTS-a.start):s.start=a.start+a.duration}else s.start=Math.max(a.start-s.duration,0)}function D(a,s,A,E,S,L){var O=E-A;O<=0&&(U.logger.warn("Fragment should have a positive duration",s),E=A+s.duration,L=S+s.duration);var C=A,T=E,x=s.startPTS,c=s.endPTS;if(Object(X.isFiniteNumber)(x)){var w=Math.abs(x-A);Object(X.isFiniteNumber)(s.deltaPTS)?s.deltaPTS=Math.max(w,s.deltaPTS):s.deltaPTS=w,C=Math.max(A,x),A=Math.min(A,x),S=Math.min(S,s.startDTS),T=Math.min(E,c),E=Math.max(E,c),L=Math.max(L,s.endDTS)}s.duration=E-A;var v=A-s.start;s.appendedPTS=E,s.start=s.startPTS=A,s.maxStartPTS=C,s.startDTS=S,s.endPTS=E,s.minEndPTS=T,s.endDTS=L;var y=s.sn;if(!a||y<a.startSN||y>a.endSN)return 0;var F,B=y-a.startSN,R=a.fragments;for(R[B]=s,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 a.fragmentHint&&n(R[R.length-1],a.fragmentHint),a.PTSKnown=a.alignedSliding=!0,v}function g(a,s){for(var A=null,E=a.fragments,S=E.length-1;S>=0;S--){var L=E[S].initSegment;if(L){A=L;break}}a.fragmentHint&&delete a.fragmentHint.endPTS;var O=0,C;if(m(a,s,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),s.PTSKnown=s.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=s.fragmentHint?s.fragments.concat(s.fragmentHint):s.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(s.skippedSegments&&(s.deltaUpdateFailed=s.fragments.some(function(F){return!F}),s.deltaUpdateFailed)){U.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var x=s.skippedSegments;x--;)s.fragments.shift();s.startSN=s.fragments[0].sn,s.startCC=s.fragments[0].cc}var c=s.fragments;if(O){U.logger.warn("discontinuity sliding from playlist, take drift into account");for(var w=0;w<c.length;w++)c[w].cc+=O}s.skippedSegments&&(s.startCC=s.fragments[0].cc),p(a.partList,s.partList,function(F,B){B.elementaryStreams=F.elementaryStreams,B.stats=F.stats}),C?D(s,C,C.startPTS,C.endPTS,C.startDTS,C.endDTS):u(a,s),c.length&&(s.totalduration=s.edge-c[0].start),s.driftStartTime=a.driftStartTime,s.driftStart=a.driftStart;var v=s.advancedDateTime;if(s.advanced&&v){var y=s.edge;s.driftStart||(s.driftStartTime=v,s.driftStart=y),s.driftEndTime=v,s.driftEnd=y}else s.driftEndTime=a.driftEndTime,s.driftEnd=a.driftEnd,s.advancedDateTime=a.advancedDateTime}function p(a,s,A){if(a&&s)for(var E=0,S=0,L=a.length;S<=L;S++){var O=a[S],C=s[S+E];O&&C&&O.index===C.index&&O.fragment.sn===C.fragment.sn?A(O,C):E--}}function m(a,s,A){for(var E=s.skippedSegments,S=Math.max(a.startSN,s.startSN)-s.startSN,L=(a.fragmentHint?1:0)+(E?s.endSN:Math.min(a.endSN,s.endSN))-s.startSN,O=s.startSN-a.startSN,C=s.fragmentHint?s.fragments.concat(s.fragmentHint):s.fragments,T=a.fragmentHint?a.fragments.concat(a.fragmentHint):a.fragments,x=S;x<=L;x++){var c=T[O+x],w=C[x];E&&!w&&x<E&&(w=s.fragments[x]=c),c&&w&&A(c,w)}}function u(a,s){var A=s.startSN+s.skippedSegments-a.startSN,E=a.fragments;if(A<0||A>=E.length)return;o(s,E[A].start)}function o(a,s){if(s){for(var A=a.fragments,E=a.skippedSegments;E<A.length;E++)A[E].start+=s;a.fragmentHint&&(a.fragmentHint.start+=s)}}function f(a,s){var A=1e3*a.levelTargetDuration,E=A/2,S=a.age,L=S>0&&S<A*3,O=s.loading.end-s.loading.start,C,T=a.availabilityDelay;if(a.updated===!1)if(L){var x=333*a.misses;C=Math.max(Math.min(E,O*2),x),a.availabilityDelay=(a.availabilityDelay||0)+C}else C=E;else L?(T=Math.min(T||A/2,S),a.availabilityDelay=T,C=T+A-S):C=A-O;return Math.round(C)}function l(a,s,A){if(!a||!a.details)return null;var E=a.details,S=E.fragments[s-E.startSN];return S||(S=E.fragmentHint,S&&S.sn===s?S:s<E.startSN&&A&&A.sn===s?A:null)}function h(a,s,A){if(!a||!a.details)return null;var E=a.details.partList;if(E)for(var S=E.length;S--;){var L=E[S];if(L.index===A&&L.fragment.sn===s)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"),W=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"),u=P("./src/controller/gap-controller.ts"),o=P("./src/errors.ts"),f=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 h(S,L,O){return L&&l(S.prototype,L),O&&l(S,O),S}function a(S,L){S.prototype=Object.create(L.prototype),S.prototype.constructor=S,s(S,L)}function s(S,L){return s=Object.setPrototypeOf||function(C,T){return C.__proto__=T,C},s(S,L)}var A=100,E=function(S){a(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,c=this.hls;if(this.stopLoad(),this.setInterval(A),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var w=c.startLevel;w===-1&&(c.config.testBandwidth?(w=0,this.bitrateTest=!0):w=c.nextAutoLevel),this.level=c.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,c=this.level,w=x==null||((T=x[c])===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,y=self.performance.now(),F=this.retryDate;(!F||y>=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,c=this.hls,w=this.levelLastLoaded,v=this.levels,y=this.media,F=c.config,B=c.nextLoadLevel;if(w===null||!y&&(this.startFragRequested||!F.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!v||!v[B])return;var R=v[B];this.level=c.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:y,D.PlaylistLevelType.MAIN);if(N===null)return;var b=N.len,Y=this.getMaxBufferLength(R.maxBitrate);if(b>=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 Oe=ue.sn-j.startSN;Oe>1&&(ue=j.fragments[Oe-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(y,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,c){var w,v=this.fragmentTracker.getState(T);if(this.fragCurrent=T,v===n.FragmentState.BACKTRACKED){var y=this.fragmentTracker.getBacktrackData(T);if(y){this._handleFragmentLoadProgress(y),this._handleFragmentLoadComplete(y);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,c)):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 c,w=this.getAppendedFrag(x.currentTime);if(w&&w.start>1&&this.flushMainBuffer(0,w.start-1),!x.paused&&T){var v=this.hls.nextLoadLevel,y=T[v],F=this.fragLastKbps;F&&this.fragCurrent?c=this.fragCurrent.duration*y.maxBitrate/(1e3*F)+1:c=0}else c=0;var B=this.getBufferedFrag(x.currentTime+c);if(B){var R=this.followingBufferedFrag(B);if(R){this.abortCurrentFrag();var j=R.maxStartPTS?R.maxStartPTS:R.start,N=R.duration,b=Math.max(B.end,j+Math.min(Math.max(N-this.config.maxFragLookUpTolerance,N*.5),N*.75));this.flushMainBuffer(b,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 c=x.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),c.addEventListener("playing",this.onvplaying),c.addEventListener("seeked",this.onvseeked),this.gapController=new u.default(this.config,c,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 c=!1,w=!1,v;x.levels.forEach(function(y){v=y.audioCodec,v&&(v.indexOf("mp4a.40.2")!==-1&&(c=!0),v.indexOf("mp4a.40.5")!==-1&&(w=!0))}),this.audioCodecSwitch=c&&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 c=this.levels;if(!c||this.state!==U.State.IDLE)return;var w=c[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 c,w=this.levels,v=x.level,y=x.details,F=y.totalduration;if(!w){this.warn("Levels were reset while loading level "+v);return}this.log("Level "+v+" loaded ["+y.startSN+","+y.endSN+"], cc ["+y.startCC+", "+y.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(y.live||(c=R.details)!==null&&c!==void 0&&c.live){if(y.fragments[0]||(y.deltaUpdateFailed=!0),y.deltaUpdateFailed)return;j=this.alignPlaylists(y,R.details)}if(R.details=y,this.levelLastLoaded=v,this.hls.trigger(G.Events.LEVEL_UPDATED,{details:y,level:v}),this.state===U.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(y))return;this.state=U.State.IDLE}this.startFragRequested?y.live&&this.synchronizeToLiveEdge(y):this.setStartPosition(y,j),this.tick()},O._handleFragmentLoadProgress=function(T){var x,c=T.frag,w=T.part,v=T.payload,y=this.levels;if(!y){this.warn("Levels were reset while fragment load was in progress. Fragment "+c.sn+" of level "+c.level+" will not be buffered");return}var F=y[c.level],B=F.details;if(!B){this.warn("Dropping fragment "+c.sn+" of level "+c.level+" after level details were reset");return}var R=F.videoCodec,j=B.PTSKnown||!B.live,N=(x=c.initSegment)===null||x===void 0?void 0:x.data,b=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(c.level,c.sn,c.stats.chunkCount,v.byteLength,ee,ae),Oe=this.initPTS[c.cc];Y.push(v,N,b,R,c,w,B.totalduration,j,ue,Oe)},O.onAudioTrackSwitching=function(T,x){var c=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 y=this.fragCurrent;y!=null&&y.loader&&(this.log("Switching to main audio track, cancel main fragment load"),y.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var F=this.hls;c&&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 c=x.id,w=!!this.hls.audioTracks[c].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 c=x.tracks,w,v,y=!1;for(var F in c){var B=c[F];if(B.id==="main"){if(v=F,w=B,F==="video"){var R=c[F];R&&(this.videoBuffer=R.buffer)}}else y=!0}y&&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 c=x.frag,w=x.part;if(c&&c.type!==D.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(c)){this.warn("Fragment "+c.sn+(w?" p: "+w.index:"")+" of level "+c.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:c.stats;this.fragLastKbps=Math.round(8*v.total/(v.buffering.end-v.loading.first)),c.sn!=="initSegment"&&(this.fragPrevious=c),this.fragBufferedComplete(c,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 c=!0,w=this.getFwdBufferInfo(this.media,D.PlaylistLevelType.MAIN);w&&w.len>.5&&(c=!this.reduceMaxBufferLength(w.len)),c&&(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 c=W.BufferHelper.getBuffered(T);!this.loadedmetadata&&c.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 c=x.type;if(c!==g.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var w=(c===g.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(w,c,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,c=this.startPosition;if(c>=0&&x<c){if(T.seeking){f.logger.log("could not seek to "+c+", already seeking at "+x);return}var w=W.BufferHelper.getBuffered(T),v=w.length?w.start(0):0,y=v-c;y>0&&(y<this.config.maxBufferHole||y<this.config.maxFragLookUpTolerance)&&(f.logger.log("adjusting start position by "+y+" to match buffer start"),c+=y,this.startPosition=c),this.log("seek to target start position "+c+" from current time "+x),T.currentTime=c}},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(c){var w=x.hls;if(!c||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,c)})},O._handleTransmuxComplete=function(T){var x,c="main",w=this.hls,v=T.remuxResult,y=T.chunkMeta,F=this.getCurrentContext(y);if(!F){this.warn("The loading context changed while buffering fragment "+y.sn+" of level "+y.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(y.level);return}var B=F.frag,R=F.part,j=F.level,N=v.video,b=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,y),w.trigger(G.Events.FRAG_PARSING_INIT_SEGMENT,{frag:B,id:c,tracks:ee.tracks}));var ue=ee.initPTS,Oe=ee.timescale;Object(X.isFiniteNumber)(ue)&&(this.initPTS[B.cc]=ue,w.trigger(G.Events.INIT_PTS_FOUND,{frag:B,id:c,initPTS:ue,timescale:Oe}))}if(N&&v.independent!==!1){if(j.details){var Ee=N.startPTS,xe=N.endPTS,Ae=N.startDTS,Re=N.endDTS;if(R)R.elementaryStreams[N.type]={startPTS:Ee,endPTS:xe,startDTS:Ae,endDTS:Re};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,Re,!0)}B.setElementaryStreamInfo(N.type,Ee,xe,Ae,Re),this.bufferFragmentData(N,B,R,y)}}else if(v.independent===!1){this.backtrack(B);return}if(ae){var he=ae.startPTS,ke=ae.endPTS,et=ae.startDTS,We=ae.endDTS;R&&(R.elementaryStreams[g.ElementaryStreamTypes.AUDIO]={startPTS:he,endPTS:ke,startDTS:et,endDTS:We}),B.setElementaryStreamInfo(g.ElementaryStreamTypes.AUDIO,he,ke,et,We),this.bufferFragmentData(ae,B,R,y)}if(Y!=null&&(x=Y.samples)!==null&&x!==void 0&&x.length){var nt={frag:B,id:c,samples:Y.samples};w.trigger(G.Events.FRAG_PARSING_METADATA,nt)}if(b){var at={frag:B,id:c,samples:b.samples};w.trigger(G.Events.FRAG_PARSING_USERDATA,at)}},O._bufferInitSegment=function(T,x,c,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 y=x.audio,F=x.video,B=x.audiovideo;if(y){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"),y.metadata.channelCount!==1&&j.indexOf("firefox")===-1&&(R="mp4a.40.5")),j.indexOf("android")!==-1&&y.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+'"'),y.levelCodec=R,y.id="main",this.log("Init audio buffer, container:"+y.container+", codecs[selected/level/parsed]=["+(R||"")+"/"+(T.audioCodec||"")+"/"+y.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 b=x[N],Y=b.initSegment;Y!=null&&Y.byteLength&&v.hls.trigger(G.Events.BUFFER_APPENDING,{type:N,data:Y,frag:c,part:null,chunkMeta:w,parent:c.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 c=T.currentTime;if(W.BufferHelper.isBuffered(T,c)?x=this.getAppendedFrag(c):W.BufferHelper.isBuffered(T,c+.1)&&(x=this.getAppendedFrag(c+.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)}}},h(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 a});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"),W=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 u(s,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(s,S.key,S)}}function o(s,A,E){return A&&u(s.prototype,A),E&&u(s,E),s}function f(s,A){s.prototype=Object.create(A.prototype),s.prototype.constructor=s,l(s,A)}function l(s,A){return l=Object.setPrototypeOf||function(S,L){return S.__proto__=L,S},l(s,A)}var h=500,a=function(s){f(A,s);function A(S,L){var O;return O=s.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(h),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 c,w=C.start,v=0;v<x.length;v++)if(w>=x[v].start&&w<=x[v].end){c=x[v];break}var y=C.start+C.duration;c?c.end=y:(c={start:w,end:y},x.push(c)),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,c=this.levels;if(!c.length||!c[x]||!c[x].details)return;var w=c[x].details,v=w.targetduration,y=T-v;if(y<=0)return;O.endOffsetSubtitles=Math.max(0,y),this.tracksBuffered.forEach(function(F){for(var B=0;B<F.length;){if(F[B].end<=y){F.shift();continue}else if(F[B].start<y)F[B].start=y;else break;B++}}),this.fragmentTracker.removeFragmentsInRange(C,y,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(h)},E.onSubtitleTrackLoaded=function(L,O){var C,T=O.details,x=O.id,c=this.currentTrackId,w=this.levels;if(!w.length)return;var v=w[c];if(x>=w.length||x!==c||!v)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,T.live||(C=v.details)!==null&&C!==void 0&&C.live){var y=this.mainDetails;if(T.deltaUpdateFailed||!y)return;var F=y.fragments[0];if(!v.details)T.hasProgramDateTime&&y.hasProgramDateTime?Object(W.alignMediaPlaylistByPDT)(T,y):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 c=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:c,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,c=this.config,w=this.media,v=k.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,w.currentTime-x,c.maxBufferHole),y=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,b,Y=this.fragPrevious;if(y<N){var ee=c.maxFragLookUpTolerance;Y&&T.hasProgramDateTime&&(b=Object(G.findFragmentByPDT)(R,Y.endProgramDateTime,ee)),b||(b=Object(G.findFragmentByPTS)(Y,R,y,ee),!b&&Y&&Y.start<R[0].start&&(b=R[0]))}else b=R[j-1];(L=b)!==null&&L!==void 0&&L.encrypted?(U.logger.log("Loading key for "+b.sn),this.state=g.State.KEY_LOADING,this.hls.trigger(X.Events.KEY_LOADING,{frag:b})):b&&this.fragmentTracker.getState(b)===D.FragmentState.NOT_LOADED&&this.loadFragment(b,T,y)}},E.loadFragment=function(L,O,C){this.fragCurrent=L,s.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 W(u,o){for(var f=0;f<o.length;f++){var l=o[f];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(u,l.key,l)}}function n(u,o,f){return o&&W(u.prototype,o),f&&W(u,f),u}function D(u,o){u.prototype=Object.create(o.prototype),u.prototype.constructor=u,g(u,o)}function g(u,o){return g=Object.setPrototypeOf||function(l,h){return l.__proto__=h,l},g(u,o)}var p=function(u){D(o,u);function o(l){var h;return h=u.call(this,l,"[subtitle-track-controller]")||this,h.media=null,h.tracks=[],h.groupId=null,h.tracksInGroup=[],h.trackId=-1,h.selectDefaultTrack=!0,h.queuedDefaultTrack=-1,h.trackChangeListener=function(){return h.onTextTracksChanged()},h.asyncPollTrackChange=function(){return h.pollTrackChange(0)},h.useTextTrackPolling=!1,h.subtitlePollingInterval=-1,h.subtitleDisplay=!0,h.registerListeners(),h}var f=o.prototype;return f.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,u.prototype.destroy.call(this)},f.registerListeners=function(){var h=this.hls;h.on(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.on(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.on(X.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.on(X.Events.MANIFEST_PARSED,this.onManifestParsed,this),h.on(X.Events.LEVEL_LOADING,this.onLevelLoading,this),h.on(X.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),h.on(X.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),h.on(X.Events.ERROR,this.onError,this)},f.unregisterListeners=function(){var h=this.hls;h.off(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.off(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.off(X.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.off(X.Events.MANIFEST_PARSED,this.onManifestParsed,this),h.off(X.Events.LEVEL_LOADING,this.onLevelLoading,this),h.off(X.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),h.off(X.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),h.off(X.Events.ERROR,this.onError,this)},f.onMediaAttached=function(h,a){if(this.media=a.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)},f.pollTrackChange=function(h){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,h)},f.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 h=m(this.media.textTracks);h.forEach(function(a){Object(U.clearCurrentCues)(a)}),this.subtitleTrack=-1,this.media=null},f.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},f.onManifestParsed=function(h,a){this.tracks=a.subtitleTracks},f.onSubtitleTrackLoaded=function(h,a){var s=a.id,A=a.details,E=this.trackId,S=this.tracksInGroup[E];if(!S){this.warn("Invalid subtitle track id "+s);return}var L=S.details;S.details=a.details,this.log("subtitle track "+s+" loaded ["+A.startSN+"-"+A.endSN+"]"),s===this.trackId&&(this.retryCount=0,this.playlistLoaded(s,a,L))},f.onLevelLoading=function(h,a){this.switchLevel(a.level)},f.onLevelSwitching=function(h,a){this.switchLevel(a.level)},f.switchLevel=function(h){var a=this.hls.levels[h];if(!(a!=null&&a.textGroupIds))return;var s=a.textGroupIds[a.urlId];if(this.groupId!==s){var A=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,E=this.tracks.filter(function(O){return!s||O.groupId===s});this.tracksInGroup=E;var S=this.findTrackId(A==null?void 0:A.name)||this.findTrackId();this.groupId=s;var L={subtitleTracks:E};this.log("Updating subtitle tracks, "+E.length+' track(s) found in "'+s+'" group-id'),this.hls.trigger(X.Events.SUBTITLE_TRACKS_UPDATED,L),S!==-1&&this.setSubtitleTrack(S,A)}},f.findTrackId=function(h){for(var a=this.tracksInGroup,s=0;s<a.length;s++){var A=a[s];if((!this.selectDefaultTrack||A.default)&&(!h||h===A.name))return A.id}return-1},f.onError=function(h,a){if(u.prototype.onError.call(this,h,a),a.fatal||!a.context)return;a.context.type===G.PlaylistContextType.SUBTITLE_TRACK&&a.context.id===this.trackId&&a.context.groupId===this.groupId&&this.retryLoadingOrFail(a)},f.loadPlaylist=function(h){var a=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(a)){var s=a.id,A=a.groupId,E=a.url;if(h)try{E=h.addDirectives(E)}catch(S){this.warn("Could not construct new URL with HLS Delivery Directives: "+S)}this.log("Loading subtitle playlist for id "+s),this.hls.trigger(X.Events.SUBTITLE_TRACK_LOADING,{url:E,id:s,groupId:A,deliveryDirectives:h||null})}},f.toggleTrackModes=function(h){var a=this,s=this.media,A=this.subtitleDisplay,E=this.trackId;if(!s)return;var S=m(s.textTracks),L=S.filter(function(T){return T.groupId===a.groupId});if(h===-1)[].slice.call(S).forEach(function(T){T.mode="disabled"});else{var O=L[E];O&&(O.mode="disabled")}var C=L[h];C&&(C.mode=A?"showing":"hidden")},f.setSubtitleTrack=function(h,a){var s,A=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=h;return}if(this.trackId!==h&&this.toggleTrackModes(h),this.trackId===h&&(h===-1||(s=A[h])!==null&&s!==void 0&&s.details)||h<-1||h>=A.length)return;this.clearTimer();var E=A[h];if(this.log("Switching to subtitle track "+h),this.trackId=h,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 c=this.switchParams(E.url,a==null?void 0:a.details);this.loadPlaylist(c)}else this.hls.trigger(X.Events.SUBTITLE_TRACK_SWITCH,{id:h})},f.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var h=-1,a=m(this.media.textTracks),s=0;s<a.length;s++)if(a[s].mode==="hidden")h=s;else if(a[s].mode==="showing"){h=s;break}this.subtitleTrack!==h&&(this.subtitleTrack=h)},n(o,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(h){this.selectDefaultTrack=!1;var a=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(h,a)}}]),o}(k.default);function m(u){for(var o=[],f=0;f<u.length;f++){var l=u[f];l.kind==="subtitles"&&l.label&&o.push(u[f])}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"),W=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(a){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=f(),this.captionsProperties=void 0,this.hls=a,this.config=a.config,this.Cues=a.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){var s=new 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,s,A),this.cea608Parser2=new k.default(3,E,S)}a.on(U.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),a.on(U.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.on(U.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.on(U.Events.MANIFEST_LOADED,this.onManifestLoaded,this),a.on(U.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),a.on(U.Events.FRAG_LOADING,this.onFragLoading,this),a.on(U.Events.FRAG_LOADED,this.onFragLoaded,this),a.on(U.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),a.on(U.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),a.on(U.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),a.on(U.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),a.on(U.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var h=l.prototype;return h.destroy=function(){var s=this.hls;s.off(U.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),s.off(U.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.off(U.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.off(U.Events.MANIFEST_LOADED,this.onManifestLoaded,this),s.off(U.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),s.off(U.Events.FRAG_LOADING,this.onFragLoading,this),s.off(U.Events.FRAG_LOADED,this.onFragLoaded,this),s.off(U.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),s.off(U.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),s.off(U.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),s.off(U.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),s.off(U.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},h.addCues=function(s,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 c=this.captionsTracks[s];this.Cues.newCue(c,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:s})}},h.onInitPtsFound=function(s,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)}))},h.getExistingTrack=function(s){var A=this.media;if(A)for(var E=0;E<A.textTracks.length;E++){var S=A.textTracks[E];if(S[s])return S}return null},h.createCaptionsTrack=function(s){this.config.renderTextTracksNatively?this.createNativeTrack(s):this.createNonNativeTrack(s)},h.createNativeTrack=function(s){if(this.captionsTracks[s])return;var A=this.captionsProperties,E=this.captionsTracks,S=this.media,L=A[s],O=L.label,C=L.languageCode,T=this.getExistingTrack(s);if(T)E[s]=T,Object(n.clearCurrentCues)(E[s]),Object(n.sendAddTrackEvent)(E[s],S);else{var x=this.createTextTrack("captions",O,C);x&&(x[s]=!0,E[s]=x)}},h.createNonNativeTrack=function(s){if(this.nonNativeCaptionsTracks[s])return;var A=this.captionsProperties[s];if(!A)return;var E=A.label,S={_id:s,label:E,kind:"captions",default:A.media?!!A.media.default:!1,closedCaptions:A.media};this.nonNativeCaptionsTracks[s]=S,this.hls.trigger(U.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[S]})},h.createTextTrack=function(s,A,E){var S=this.media;return S?S.addTextTrack(s,A,E):void 0},h.onMediaAttaching=function(s,A){this.media=A.media,this._cleanTracks()},h.onMediaDetaching=function(){var s=this.captionsTracks;Object.keys(s).forEach(function(A){Object(n.clearCurrentCues)(s[A]),delete s[A]}),this.nonNativeCaptionsTracks={}},h.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=f(),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())},h._cleanTracks=function(){var s=this.media;if(!s)return;var A=s.textTracks;if(A)for(var E=0;E<A.length;E++)Object(n.clearCurrentCues)(A[E])},h.onSubtitleTracksUpdated=function(s,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,c){var w;if(c<C.length){for(var v=null,y=0;y<C.length;y++)if(u(C[y],x)){v=C[y];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})}}},h.onManifestLoaded=function(s,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})},h.onFragLoading=function(s,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,c=(C=A==null||((T=A.part)===null||T===void 0)?void 0:T.index)!=null?C:-1;x===L+1||x===L&&c===O+1||(E.reset(),S.reset()),this.lastSn=x,this.lastPartIndex=c}},h.onFragLoaded=function(s,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")})},h._parseIMSC1=function(s,A){var E=this,S=this.hls;Object(D.parseIMSC1)(A,this.initPTS[s.cc],this.timescale[s.cc],function(L){E._appendCues(L,s.level),S.trigger(U.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:s})},function(L){p.logger.log("Failed to parse IMSC1: "+L),S.trigger(U.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:s,error:L})})},h._parseVTTs=function(s,A,E){var S=this,L=this.hls;Object(W.parseWebVTT)(A,this.initPTS[s.cc],this.timescale[s.cc],E,s.cc,s.start,function(O){S._appendCues(O,s.level),L.trigger(U.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:s})},function(O){S._fallbackToIMSC1(s,A),p.logger.log("Failed to parse VTT cue: "+O),L.trigger(U.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:s,error:O})})},h._fallbackToIMSC1=function(s,A){var E=this,S=this.tracks[s.level];S.textCodec||Object(D.parseIMSC1)(A,this.initPTS[s.cc],this.timescale[s.cc],function(){S.textCodec=D.IMSC1_CODEC,E._parseIMSC1(s,A)},function(){S.textCodec="wvtt"})},h._appendCues=function(s,A){var E=this.hls;if(this.config.renderTextTracksNatively){var S=this.textTracks[A];if(S.mode==="disabled")return;s.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:s,track:O})}},h.onFragDecrypted=function(s,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)}},h.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},h.onFragParsingUserdata=function(s,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])}}},h.onBufferFlushing=function(s,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(c){return Object(n.removeCuesInRange)(T[c],E,S)})}if(this.config.renderTextTracksNatively&&(E===0&&L!==void 0)){var x=this.textTracks;Object.keys(x).forEach(function(c){return Object(n.removeCuesInRange)(x[c],E,L)})}},h.extractCea608Data=function(s){for(var A=s[0]&31,E=2,S=[[],[]],L=0;L<A;L++){var O=s[E++],C=127&s[E++],T=127&s[E++],x=(4&O)!==0,c=3&O;if(C===0&&T===0)continue;x&&((c===0||c===1)&&(S[c].push(C),S[c].push(T)))}return S},l}();function u(l,h){return l&&l.label===h.name&&!(l.textTrack1||l.textTrack2)}function o(l,h,a,s){return Math.min(h,s)-Math.max(l,a)}function f(){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,W){this.subtle=void 0,this.aesIV=void 0,this.subtle=G,this.aesIV=W}var k=U.prototype;return k.decrypt=function(W,n){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},n,W)},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 W=G.byteLength,n=W&&new DataView(G.buffer).getUint8(W-1);return n?Object(X.sliceUint8)(G,0,W-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 W=G.prototype;return W.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},W.initTable=function(){var D=this.sBox,g=this.invSBox,p=this.subMix,m=p[0],u=p[1],o=p[2],f=p[3],l=this.invSubMix,h=l[0],a=l[1],s=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],c=E[x],w=E[C]*257^C*16843008;m[S]=w<<24|w>>>8,u[S]=w<<16|w>>>16,o[S]=w<<8|w>>>24,f[S]=w,w=c*16843009^x*65537^T*257^S*16843008,h[C]=w<<24|w>>>8,a[C]=w<<16|w>>>16,s[C]=w<<8|w>>>24,A[C]=w,S?(S=T^E[E[E[c^T]]],L^=E[E[L]]):S=L=1}},W.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 u=this.keySize=g.length;if(u!==4&&u!==6&&u!==8)throw new Error("Invalid aes key size="+u);var o=this.ksRows=(u+6+1)*4,f,l,h=this.keySchedule=new Uint32Array(o),a=this.invKeySchedule=new Uint32Array(o),s=this.sBox,A=this.rcon,E=this.invSubMix,S=E[0],L=E[1],O=E[2],C=E[3],T,x;for(f=0;f<o;f++){if(f<u){T=h[f]=g[f];continue}x=T,f%u===0?(x=x<<8|x>>>24,x=s[x>>>24]<<24|s[x>>>16&255]<<16|s[x>>>8&255]<<8|s[x&255],x^=A[f/u|0]<<24):u>6&&f%u===4&&(x=s[x>>>24]<<24|s[x>>>16&255]<<16|s[x>>>8&255]<<8|s[x&255]),h[f]=T=(h[f-u]^x)>>>0}for(l=0;l<o;l++)f=o-l,l&3?x=h[f]:x=h[f-4],l<4||f<=4?a[l]=x:a[l]=S[s[x>>>24]]^L[s[x>>>16&255]]^O[s[x>>>8&255]]^C[s[x&255]],a[l]=a[l]>>>0},W.networkToHostOrderSwap=function(D){return D<<24|(D&65280)<<8|(D&16711680)>>8|D>>>24},W.decrypt=function(D,g,p){for(var m=this.keySize+6,u=this.invKeySchedule,o=this.invSBox,f=this.invSubMix,l=f[0],h=f[1],a=f[2],s=f[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,c,w,v,y,F,B,R,j,N,b,Y,ee,ae,ue=this.networkToHostOrderSwap;g<C.length;){for(j=ue(C[g]),N=ue(C[g+1]),b=ue(C[g+2]),Y=ue(C[g+3]),y=j^u[0],F=Y^u[1],B=b^u[2],R=N^u[3],ee=4,ae=1;ae<m;ae++)x=l[y>>>24]^h[F>>16&255]^a[B>>8&255]^s[R&255]^u[ee],c=l[F>>>24]^h[B>>16&255]^a[R>>8&255]^s[y&255]^u[ee+1],w=l[B>>>24]^h[R>>16&255]^a[y>>8&255]^s[F&255]^u[ee+2],v=l[R>>>24]^h[y>>16&255]^a[F>>8&255]^s[B&255]^u[ee+3],y=x,F=c,B=w,R=v,ee=ee+4;x=o[y>>>24]<<24^o[F>>16&255]<<16^o[B>>8&255]<<8^o[R&255]^u[ee],c=o[F>>>24]<<24^o[B>>16&255]<<16^o[R>>8&255]<<8^o[y&255]^u[ee+1],w=o[B>>>24]<<24^o[R>>16&255]<<16^o[y>>8&255]<<8^o[F&255]^u[ee+2],v=o[R>>>24]<<24^o[y>>16&255]<<16^o[F>>8&255]<<8^o[B&255]^u[ee+3],T[g]=ue(x^E),T[g+1]=ue(v^S),T[g+2]=ue(w^L),T[g+3]=ue(c^O),E=j,S=N,L=b,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"),W=P("./src/utils/mp4-tools.ts"),n=P("./src/utils/typed-array.ts"),D=16,g=function(){function p(u,o,f){var l=f===void 0?{}:f,h=l.removePKCS7Padding,a=h===void 0?!0:h;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=u,this.config=o,this.removePKCS7Padding=a,a)try{var s=self.crypto;s&&(this.subtle=s.subtle||s.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 f=new Uint8Array(o);return this.reset(),this.removePKCS7Padding?Object(k.removePadding)(f):f},m.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},m.decrypt=function(o,f,l,h){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(o),f,l);var a=this.flush();a&&h(a.buffer)}else this.webCryptoDecrypt(new Uint8Array(o),f,l).then(h)},m.softwareDecrypt=function(o,f,l){var h=this.currentIV,a=this.currentResult,s=this.remainderData;this.logOnce("JS AES decrypt"),s&&(o=Object(W.appendUint8Array)(s,o),this.remainderData=null);var A=this.getValidChunk(o);if(!A.length)return null;h&&(l=h);var E=this.softwareDecrypter;E||(E=this.softwareDecrypter=new k.default),E.expandKey(f);var S=a;return this.currentResult=E.decrypt(A.buffer,0,l),this.currentIV=Object(n.sliceUint8)(A,-16).buffer,S||null},m.webCryptoDecrypt=function(o,f,l){var h=this,a=this.subtle;return(this.key!==f||!this.fastAesKey)&&(this.key=f,this.fastAesKey=new U.default(a,f)),this.fastAesKey.expandKey().then(function(s){if(!a)return Promise.reject(new Error("web crypto not initialized"));var A=new X.default(a,l);return A.decrypt(o.buffer,s)}).catch(function(s){return h.onWebCryptoError(s,o,f,l)})},m.onWebCryptoError=function(o,f,l,h){return G.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",o),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(f,l,h)},m.getValidChunk=function(o){var f=o,l=o.length-o.length%D;return l!==o.length&&(f=Object(n.sliceUint8)(o,0,l),this.remainderData=Object(n.sliceUint8)(o,l)),f},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,W){this.subtle=void 0,this.key=void 0,this.subtle=G,this.key=W}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 W(g,p){g.prototype=Object.create(p.prototype),g.prototype.constructor=g,n(g,p)}function n(g,p){return n=Object.setPrototypeOf||function(u,o){return u.__proto__=o,u},n(g,p)}var D=function(g){W(p,g);function p(u,o){var f;return f=g.call(this)||this,f.observer=void 0,f.config=void 0,f.observer=u,f.config=o,f}var m=p.prototype;return m.resetInitSegment=function(o,f,l){g.prototype.resetInitSegment.call(this,o,f,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 f=G.getID3Data(o,0)||[],l=f.length,h=o.length;l<h;l++)if(U.probe(o,l))return k.logger.log("ADTS sync word found !"),!0;return!1},m.canParse=function(o,f){return U.canParse(o,f)},m.appendFrame=function(o,f,l){U.initTrackConfig(o,this.observer,f,l,o.manifestCodec);var h=U.appendFrame(o,f,l,this.initPTS,this.frameIndex);if(h&&h.missing===0)return h},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 W}),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 u}),P.d($,"initTrackConfig",function(){return o}),P.d($,"getFrameDuration",function(){return f}),P.d($,"parseFrameHeader",function(){return l}),P.d($,"appendFrame",function(){return h});var X=P("./src/utils/logger.ts"),U=P("./src/errors.ts"),k=P("./src/events.ts");function G(a,s,A,E){var S,L,O,C,T=navigator.userAgent.toLowerCase(),x=E,c=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];S=((s[A+2]&192)>>>6)+1;var w=(s[A+2]&60)>>>2;if(w>c.length-1){a.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=(s[A+2]&1)<<2,O|=(s[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:c[w],channelCount:O,codec:"mp4a.40."+S,manifestCodec:x}}function W(a,s){return a[s]===255&&(a[s+1]&246)===240}function n(a,s){return a[s+1]&1?7:9}function D(a,s){return(a[s+3]&3)<<11|a[s+4]<<3|(a[s+5]&224)>>>5}function g(a,s){return s+5<a.length}function p(a,s){return s+1<a.length&&W(a,s)}function m(a,s){return g(a,s)&&W(a,s)&&D(a,s)<=a.length-s}function u(a,s){if(p(a,s)){var A=n(a,s);if(s+A>=a.length)return!1;var E=D(a,s);if(E<=A)return!1;var S=s+E;return S===a.length||p(a,S)}return!1}function o(a,s,A,E,S){if(!a.samplerate){var L=G(s,A,E,S);if(!L)return;a.config=L.config,a.samplerate=L.samplerate,a.channelCount=L.channelCount,a.codec=L.codec,a.manifestCodec=L.manifestCodec,X.logger.log("parsed codec:"+a.codec+", rate:"+L.samplerate+", channels:"+L.channelCount)}}function f(a){return 1024*9e4/a}function l(a,s,A,E,S){var L=n(a,s),O=D(a,s);if(O-=L,O>0){var C=A+E*S;return{headerLength:L,frameLength:O,stamp:C}}}function h(a,s,A,E,S){var L=f(a.samplerate),O=l(s,A,E,S,L);if(O){var C=O.frameLength,T=O.headerLength,x=O.stamp,c=T+C,w=Math.max(0,A+c-s.length),v;w?(v=new Uint8Array(c-T),v.set(s.subarray(A+T,s.length),0)):v=s.subarray(A+T,A+c);var y={unit:v,pts:x};return w||a.samples.push(y),{sample:y,length:c,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"),W=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(u,o,f){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},p.resetTimeStamp=function(){},p.resetContiguity=function(){},p.canParse=function(u,o){return!1},p.appendFrame=function(u,o,f){},p.demux=function(u,o){this.cachedData&&(u=Object(G.appendUint8Array)(this.cachedData,u),this.cachedData=null);var f=U.getID3Data(u,0),l=f?f.length:0,h,a,s=this._audioTrack,A=this._id3Track,E=f?U.getTimeStamp(f):void 0,S=u.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=D(E,o)),f&&f.length>0&&A.samples.push({pts:this.initPTS,dts:this.initPTS,data:f}),a=this.initPTS;l<S;){if(this.canParse(u,l)){var L=this.appendFrame(s,u,l);L?(this.frameIndex++,a=L.sample.pts,l+=L.length,h=l):l=S}else U.canParse(u,l)?(f=U.getID3Data(u,l),A.samples.push({pts:a,dts:a,data:f}),l+=f.length,h=l):l++;if(l===S&&h!==S){var O=Object(W.sliceUint8)(u,h);this.cachedData?this.cachedData=Object(G.appendUint8Array)(this.cachedData,O):this.cachedData=O}}return{audioTrack:s,avcTrack:Object(k.dummyTrack)(),id3Track:A,textTrack:Object(k.dummyTrack)()}},p.demuxSampleAes=function(u,o,f){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},p.flush=function(u){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 W=new Uint8Array(G),n=0,D=0;D<k.length;D++){var g=k[D];W.set(g,n),n+=g.length}return W}},"./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(W){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=W,this.bytesAvailable=W.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,u,o,f=this.readUByte.bind(this),l=this.readBits.bind(this),h=this.readUEG.bind(this),a=this.readBoolean.bind(this),s=this.skipBits.bind(this),A=this.skipEG.bind(this),E=this.skipUEG.bind(this),S=this.skipScalingList.bind(this);f();var L=f();if(l(5),s(3),f(),E(),L===100||L===110||L===122||L===244||L===44||L===83||L===86||L===118||L===128){var O=h();if(O===3&&s(1),E(),E(),s(1),a())for(u=O!==3?8:12,o=0;o<u;o++)a()&&(o<6?S(16):S(64))}E();var C=h();if(C===0)h();else if(C===1)for(s(1),A(),A(),m=h(),o=0;o<m;o++)A();E(),s(1);var T=h(),x=h(),c=l(1);c===0&&s(1),s(1),a()&&(n=h(),D=h(),g=h(),p=h());var w=[1,1];if(a()&&a()){var v=f();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=[f()<<8|f(),f()<<8|f()];break}}}return{width:Math.ceil((T+1)*16-n*2-D*2),height:(2-c)*(x+1)*16-(c?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 W}),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 h}),P.d($,"testables",function(){return a});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},W=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)),c=m(x);c&&O.push(c),L+=x.size+10}U(S,L)&&(L+=10)}return O},m=function(S){return S.type==="PRIV"?u(S):S.type[0]==="W"?f(S):o(S)},u=function(S){if(S.size<2)return;var L=h(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=h(S.data.subarray(L),!0);L+=O.length+1;var C=h(S.data.subarray(L));return{key:S.type,info:O,data:C}}var T=h(S.data.subarray(1));return{key:S.type,data:T}},f=function(S){if(S.type==="WXXX"){if(S.size<2)return;var L=1,O=h(S.data.subarray(L),!0);L+=O.length+1;var C=h(S.data.subarray(L));return{key:S.type,info:O,data:C}}var T=h(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},h=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,c,w,v,y="",F=0;F<x;){if(c=S[F++],c===0&&L)return y;if(c===0||c===3)continue;switch(c>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:y+=String.fromCharCode(c);break;case 12:case 13:w=S[F++],y+=String.fromCharCode((c&31)<<6|w&63);break;case 14:w=S[F++],v=S[F++],y+=String.fromCharCode((c&15)<<12|(w&63)<<6|(v&63)<<0);break;default:}}return y},a={decodeTextFrame:o},s;function A(){return!s&&typeof self.TextDecoder!="undefined"&&(s=new self.TextDecoder("utf-8")),s}},"./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 W(g,p){g.prototype=Object.create(p.prototype),g.prototype.constructor=g,n(g,p)}function n(g,p){return n=Object.setPrototypeOf||function(u,o){return u.__proto__=o,u},n(g,p)}var D=function(g){W(p,g);function p(){return g.apply(this,arguments)||this}var m=p.prototype;return m.resetInitSegment=function(o,f,l){g.prototype.resetInitSegment.call(this,o,f,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 f=U.getID3Data(o,0)||[],l=f.length,h=o.length;l<h;l++)if(G.probe(o,l))return k.logger.log("MPEG Audio sync word found !"),!0;return!1},m.canParse=function(o,f){return G.canParse(o,f)},m.appendFrame=function(o,f,l){return this.initPTS===null?void 0:G.appendFrame(o,f,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 W=G.prototype;return W.resetTimeStamp=function(){},W.resetInitSegment=function(){},W.resetContiguity=function(){},G.probe=function(D){return Object(X.findBox)({data:D,start:0,end:Math.min(D.length,16384)},["moof"]).length>0},W.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)()}},W.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)()}},W.demuxSampleAes=function(D,g,p){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},W.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 u});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]],W=[0,1,1,4];function n(o,f,l,h,a){if(l+24>f.length)return;var s=D(f,l);if(s&&l+s.frameLength<=f.length){var A=s.samplesPerFrame*9e4/s.sampleRate,E=h+a*A,S={unit:f.subarray(l,l+s.frameLength),pts:E,dts:E};return o.config=[],o.channelCount=s.channelCount,o.samplerate=s.sampleRate,o.samples.push(S),{sample:S,length:s.frameLength,missing:0}}}function D(o,f){var l=o[f+1]>>3&3,h=o[f+1]>>1&3,a=o[f+2]>>4&15,s=o[f+2]>>2&3;if(l!==1&&a!==0&&a!==15&&s!==3){var A=o[f+2]>>1&1,E=o[f+3]>>6,S=l===3?3-h:h===3?3:4,L=U[S*14+a-1]*1e3,O=l===3?0:l===2?1:2,C=k[O*3+s],T=E===3?1:2,x=G[l][h],c=W[h],w=x*8*c,v=Math.floor(x*L/C+A)*c;if(X===null){var y=navigator.userAgent||"",F=y.match(/Chrome\/(\d+)/i);X=F?parseInt(F[1]):0}var B=!!X&&X<=87;return B&&h===2&&L>=224e3&&E===0&&(o[f+3]=o[f+3]|128),{sampleRate:C,channelCount:T,frameLength:v,samplesPerFrame:w}}}function g(o,f){return o[f]===255&&(o[f+1]&224)===224&&(o[f+1]&6)!==0}function p(o,f){return f+1<o.length&&g(o,f)}function m(o,f){var l=4;return g(o,f)&&l<=o.length-f}function u(o,f){if(f+1<o.length&&g(o,f)){var l=4,h=D(o,f),a=l;h!=null&&h.frameLength&&(a=h.frameLength);var s=f+a;return s===o.length||p(o,s)}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 W=G.prototype;return W.decryptBuffer=function(D,g){this.decrypter.decrypt(D,this.keyData.key.buffer,this.keyData.iv.buffer,g)},W.decryptAacSample=function(D,g,p,m){var u=D[g].unit,o=u.subarray(16,u.length-u.length%16),f=o.buffer.slice(o.byteOffset,o.byteOffset+o.length),l=this;this.decryptBuffer(f,function(h){var a=new Uint8Array(h);u.set(a,16),m||l.decryptAacSamples(D,g+1,p)})},W.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}},W.getAvcEncryptedData=function(D){for(var g=Math.floor((D.length-48)/160)*16+16,p=new Int8Array(g),m=0,u=32;u<=D.length-16;u+=160,m+=16)p.set(D.subarray(u,u+16),m);return p},W.getAvcDecryptedUnit=function(D,g){for(var p=new Uint8Array(g),m=0,u=32;u<=D.length-16;u+=160,m+=16)D.set(p.subarray(m,m+16),u);return D},W.decryptAvcSample=function(D,g,p,m,u,o){var f=Object(U.discardEPB)(u.data),l=this.getAvcEncryptedData(f),h=this;this.decryptBuffer(l.buffer,function(a){u.data=h.getAvcDecryptedUnit(f,a),o||h.decryptAvcSamples(D,g,p+1,m)})},W.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 u=D[g].units;!(p>=u.length);p++){var o=u[p];if(o.data.length<=48||o.type!==1&&o.type!==5)continue;var f=this.decrypter.isSync();if(this.decryptAvcSample(D,g,p,m,o,f),!f)return}}},G}();$.default=k},"./src/demux/transmuxer-interface.ts":function(re,$,P){"use strict";P.r($),P.d($,"default",function(){return u});var X=P("./node_modules/webworkify-webpack/index.js"),U=P.n(X),k=P("./src/events.ts"),G=P("./src/demux/transmuxer.ts"),W=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}},u=function(){function o(l,h,a,s){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=h,this.onTransmuxComplete=a,this.onFlush=s;var E=l.config,S=function(x,c){c=c||{},c.frag=A.frag,c.id=A.id,l.trigger(x,c)};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"){W.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:h,config:JSON.stringify(E)})}catch(T){W.logger.warn("Error in worker:",T),W.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,h),this.worker=null}}else this.transmuxer=new G.default(this.observer,L,E,O,h)}var f=o.prototype;return f.destroy=function(){var h=this.worker;if(h)h.removeEventListener("message",this.onwmsg),h.terminate(),this.worker=null;else{var a=this.transmuxer;a&&(a.destroy(),this.transmuxer=null)}var s=this.observer;s&&s.removeAllListeners(),this.observer=null},f.push=function(h,a,s,A,E,S,L,O,C,T){var x=this;C.transmuxing.start=self.performance.now();var c=this.transmuxer,w=this.worker,v=S?S.start:E.start,y=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,b=!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||!b)&&(S.stats.parsing.start=Y);var ee=new G.TransmuxState(B,b,O,R,v);if(!b||B){W.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: `+b+`
|
|
accurateTimeOffset: `+O+`
|
|
timeOffset: `+v);var ae=new G.TransmuxConfig(s,A,a,L,T);this.configureTransmuxer(ae)}if(this.frag=E,this.part=S,w)w.postMessage({cmd:"demux",data:h,decryptdata:y,chunkMeta:C,state:ee},h instanceof ArrayBuffer?[h]:[]);else if(c){var ue=c.push(h,y,C,ee);Object(G.isPromise)(ue)?ue.then(function(Oe){x.handleTransmuxComplete(Oe)}):this.handleTransmuxComplete(ue)}},f.flush=function(h){var a=this;h.transmuxing.start=self.performance.now();var s=this.transmuxer,A=this.worker;if(A)A.postMessage({cmd:"flush",chunkMeta:h});else if(s){var E=s.flush(h);Object(G.isPromise)(E)?E.then(function(S){a.handleFlushResult(S,h)}):this.handleFlushResult(E,h)}},f.handleFlushResult=function(h,a){var s=this;h.forEach(function(A){s.handleTransmuxComplete(A)}),this.onFlush(a)},f.onWorkerMessage=function(h){var a=h.data,s=this.hls;switch(a.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(a.data);break}case"flush":{this.onFlush(a.data);break}default:{a.data=a.data||{},a.data.frag=this.frag,a.data.id=this.id,s.trigger(a.event,a.data);break}}},f.configureTransmuxer=function(h){var a=this.worker,s=this.transmuxer;a?a.postMessage({cmd:"configure",config:h}):s&&s.configure(h)},f.handleTransmuxComplete=function(h){h.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(h)},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"),W=P.n(G);function n(u){var o=new G.EventEmitter,f=function(h,a){u.postMessage({event:h,data:a})};o.on(U.Events.FRAG_DECRYPTED,f),o.on(U.Events.ERROR,f),u.addEventListener("message",function(l){var h=l.data;switch(h.cmd){case"init":{var a=JSON.parse(h.config);u.transmuxer=new X.default(o,h.typeSupported,a,h.vendor,h.id),Object(k.enableLogs)(a.debug),f("init",null);break}case"configure":{u.transmuxer.configure(h.config);break}case"demux":{var s=u.transmuxer.push(h.data,h.decryptdata,h.chunkMeta,h.state);Object(X.isPromise)(s)?s.then(function(S){D(u,S)}):D(u,s);break}case"flush":{var A=h.chunkMeta,E=u.transmuxer.flush(A);Object(X.isPromise)(E)?E.then(function(S){p(u,S,A)}):p(u,E,A);break}default:break}})}function D(u,o){if(m(o.remuxResult))return;var f=[],l=o.remuxResult,h=l.audio,a=l.video;h&&g(f,h),a&&g(f,a),u.postMessage({event:"transmuxComplete",data:o},f)}function g(u,o){o.data1&&u.push(o.data1.buffer),o.data2&&u.push(o.data2.buffer)}function p(u,o,f){o.forEach(function(l){D(u,l)}),u.postMessage({event:"flush",data:f})}function m(u){return!u.audio&&!u.video&&!u.text&&!u.id3&&!u.initSegment}},"./src/demux/transmuxer.ts":function(re,$,P){"use strict";P.r($),P.d($,"default",function(){return a}),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"),W=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"),u=P("./src/utils/mp4-tools.ts"),o=P("./src/utils/logger.ts"),f;try{f=self.performance.now.bind(self.performance)}catch(O){o.logger.debug("Unable to use Performance API on this environment"),f=self.Date.now}var l=[{demux:n.default,remux:g.default},{demux:W.default,remux:p.default},{demux:G.default,remux:g.default},{demux:D.default,remux:g.default}],h=1024;l.forEach(function(O){var C=O.demux;h=Math.max(h,C.minProbeByteLength)});var a=function(){function O(T,x,c,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=c,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,c,w,v){var y=this,F=w.transmuxing;F.executeStart=f();var B=new Uint8Array(x),R=this.cache,j=this.config,N=this.currentTransmuxState,b=this.transmuxConfig;v&&(this.currentTransmuxState=v);var Y=s(B,c);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=f(),A(w);B=new Uint8Array(ae)}else return this.decryptionPromise=ee.webCryptoDecrypt(B,Y.key.buffer,Y.iv.buffer).then(function(je){var $e=y.push(je,null,w);return y.decryptionPromise=null,$e}),this.decryptionPromise}var ue=v||N,Oe=ue.contiguous,Ee=ue.discontinuity,xe=ue.trackSwitch,Ae=ue.accurateTimeOffset,Re=ue.timeOffset,pe=b.audioCodec,he=b.videoCodec,ke=b.defaultInitPts,et=b.duration,We=b.initSegmentData;if((Ee||xe)&&this.resetInitSegment(We,pe,he,et),Ee&&this.resetInitialTimestamp(ke),Oe||this.resetContiguity(),this.needsProbing(B,Ee,xe)){if(R.dataLength){var nt=R.flush();B=Object(u.appendUint8Array)(nt,B)}this.configureTransmuxer(B,b)}var at=this.transmux(B,Y,Re,Ae,w),Pe=this.currentTransmuxState;return Pe.contiguous=!0,Pe.discontinuity=!1,Pe.trackSwitch=!1,F.executeEnd=f(),at},C.flush=function(x){var c=this,w=x.transmuxing;w.executeStart=f();var v=this.decrypter,y=this.cache,F=this.currentTransmuxState,B=this.decryptionPromise;if(B)return B.then(function(){return c.flush(x)});var R=[],j=F.timeOffset;if(v){var N=v.flush();N&&R.push(this.push(N,null,x))}var b=y.dataLength;y.reset();var Y=this.demuxer,ee=this.remuxer;if(!Y||!ee)return b>=h&&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=f(),[A(x)];var ae=Y.flush(j);return E(ae)?ae.then(function(ue){return c.flushRemux(R,ue,x),R}):(this.flushRemux(R,ae,x),R)},C.flushRemux=function(x,c,w){var v=c.audioTrack,y=c.avcTrack,F=c.id3Track,B=c.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 b=this.remuxer.remux(v,y,F,B,N,j,!0,this.id);x.push({remuxResult:b,chunkMeta:w}),w.transmuxing.executeEnd=f()},C.resetInitialTimestamp=function(x){var c=this.demuxer,w=this.remuxer;if(!c||!w)return;c.resetTimeStamp(x),w.resetTimeStamp(x)},C.resetContiguity=function(){var x=this.demuxer,c=this.remuxer;if(!x||!c)return;x.resetContiguity(),c.resetNextTimestamp()},C.resetInitSegment=function(x,c,w,v){var y=this.demuxer,F=this.remuxer;if(!y||!F)return;y.resetInitSegment(c,w,v),F.resetInitSegment(x,c,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,c,w,v,y){var F;return c&&c.method==="SAMPLE-AES"?F=this.transmuxSampleAes(x,c,w,v,y):F=this.transmuxUnencrypted(x,w,v,y),F},C.transmuxUnencrypted=function(x,c,w,v){var y=this.demuxer.demux(x,c,!1,!this.config.progressive),F=y.audioTrack,B=y.avcTrack,R=y.id3Track,j=y.textTrack,N=this.remuxer.remux(F,B,R,j,c,w,!1,this.id);return{remuxResult:N,chunkMeta:v}},C.transmuxSampleAes=function(x,c,w,v,y){var F=this;return this.demuxer.demuxSampleAes(x,c,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:y}})},C.configureTransmuxer=function(x,c){for(var w=this.config,v=this.observer,y=this.typeSupported,F=this.vendor,B=c.audioCodec,R=c.defaultInitPts,j=c.duration,N=c.initSegmentData,b=c.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:W.default,remux:p.default});var ue=this.demuxer,Oe=this.remuxer,Ee=Y.remux,xe=Y.demux;(!Oe||!(Oe instanceof Ee))&&(this.remuxer=new Ee(v,w,y,F)),(!ue||!(ue instanceof xe))&&(this.demuxer=new xe(v,w,y),this.probe=xe.probe),this.resetInitSegment(N,B,b,j),this.resetInitialTimestamp(R)},C.needsProbing=function(x,c,w){return!this.demuxer||!this.remuxer||c||w},C.getDecrypter=function(){var x=this.decrypter;return x||(x=this.decrypter=new k.default(this.observer,this.config)),x},O}();function s(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,c,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=c,this.defaultInitPts=w},L=function(C,T,x,c,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=c,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"),W=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},u=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 c,w=this._avcTrack,v=this._audioTrack,y=this._id3Track,F=w.pid,B=w.pesData,R=v.pid,j=y.pid,N=v.pesData,b=y.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:y,textTrack:this._txtTrack};var Oe=Math.max(0,E.syncOffset(O));ue-=(ue+Oe)%188,ue<O.byteLength&&!x&&(this.remainderData=new Uint8Array(O.buffer,ue,O.buffer.byteLength-ue));for(var Ee=Oe;Ee<ue;Ee+=188)if(O[Ee]===71){var xe=!!(O[Ee+1]&64),Ae=((O[Ee+1]&31)<<8)+O[Ee+2],Re=(O[Ee+3]&48)>>4,pe=void 0;if(Re>1){if(pe=Ee+5+O[Ee+4],pe===Ee+188)continue}else pe=Ee+4;switch(Ae){case F:xe&&(B&&(c=h(B))&&this.parseAVCPES(c,!1),B={data:[],size:0}),B&&(B.data.push(O.subarray(pe,Ee+188)),B.size+=Ee+188-pe);break;case R:xe&&(N&&(c=h(N))&&(v.isAAC?this.parseAACPES(c):this.parseMPEGPES(c)),N={data:[],size:0}),N&&(N.data.push(O.subarray(pe,Ee+188)),N.size+=Ee+188-pe);break;case j:xe&&(b&&(c=h(b))&&this.parseID3PES(c),b={data:[],size:0}),b&&(b.data.push(O.subarray(pe,Ee+188)),b.size+=Ee+188-pe);break;case 0:xe&&(pe+=O[pe]+1),ae=this._pmtId=f(O,pe);break;case ae:{xe&&(pe+=O[pe]+1);var he=l(O,pe,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,T);F=he.avc,F>0&&(w.pid=F),R=he.audio,R>0&&(v.pid=R,v.isAAC=he.isAAC),j=he.id3,j>0&&(y.pid=j),Y&&!ee&&(g.logger.log("reparse from beginning"),Y=!1,Ee=Oe-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,y.pesData=b;var ke={audioTrack:v,avcTrack:w,id3Track:y,textTrack:this._txtTrack};return x&&this.extractRemainingSamples(ke),ke},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,c=T.pesData,w=C.pesData,v=x.pesData,y;c&&(y=h(c))?(this.parseAVCPES(y,!0),T.pesData=null):T.pesData=c,w&&(y=h(w))?(C.isAAC?this.parseAACPES(y):this.parseMPEGPES(y),C.pesData=null):(w!=null&&w.size&&g.logger.log("last AAC PES packet truncated,might overlap between fragments"),C.pesData=w),v&&(y=h(v))?(this.parseID3PES(y),x.pesData=null):x.pesData=v},S.demuxSampleAes=function(O,C,T){var x=this.demux(O,T,!0,!this.config.progressive),c=this.sampleAes=new W.default(this.observer,this.config,C);return this.decrypt(x,c)},S.decrypt=function(O,C){return new Promise(function(T){var x=O.audioTrack,c=O.avcTrack;x.samples&&x.isAAC?C.decryptAacSamples(x.samples,0,function(){c.samples?C.decryptAvcSamples(c.samples,0,0,function(){T(O)}):T(O)}):c.samples&&C.decryptAvcSamples(c.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,c=this.parseAVCNALu(O.data),w=!1,v=this.avcSample,y,F=!1;O.data=null,v&&c.length&&!x.audFound&&(a(v,x),v=this.avcSample=o(!1,O.pts,O.dts,"")),c.forEach(function(B){switch(B.type){case 1:{y=!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:y=!0,v||(v=T.avcSample=o(!0,O.pts,O.dts,"")),w&&(v.debug+="IDR "),v.key=!0,v.frame=!0;break;case 6:{y=!0,w&&v&&(v.debug+="SEI ");var N=new k.default(A(B.data));N.readUByte();for(var b=0,Y=0,ee=!1,ae=0;!ee&&N.bytesAvailable>1;){b=0;do ae=N.readUByte(),b+=ae;while(ae===255);Y=0;do ae=N.readUByte(),Y+=ae;while(ae===255);if(b===4&&N.bytesAvailable!==0){ee=!0;var ue=N.readUByte();if(ue===181){var Oe=N.readUShort();if(Oe===49){var Ee=N.readUInt();if(Ee===1195456820){var xe=N.readUByte();if(xe===3){for(var Ae=N.readUByte(),Re=N.readUByte(),pe=31&Ae,he=[Ae,Re],ke=0;ke<pe;ke++)he.push(N.readUByte()),he.push(N.readUByte()),he.push(N.readUByte());s(T._txtTrack.samples,{type:3,pts:O.pts,bytes:he})}}}}}else if(b===5&&N.bytesAvailable!==0){if(ee=!0,Y>16){for(var et=[],We=0;We<16;We++)et.push(N.readUByte().toString(16)),(We===3||We===5||We===7||We===9)&&et.push("-");for(var nt=Y-16,at=new Uint8Array(nt),Pe=0;Pe<nt;Pe++)at[Pe]=N.readUByte();s(T._txtTrack.samples,{pts:O.pts,payloadType:b,uuid:et.join(""),userData:Object(G.utf8ArrayToStr)(at),userDataBytes:at})}}else if(Y<N.bytesAvailable)for(var je=0;je<Y;je++)N.readUByte()}break}case 7:if(y=!0,F=!0,w&&v&&(v.debug+="SPS "),!x.sps){var $e=new k.default(B.data),se=$e.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.",Se=0;Se<3;Se++){var Ge=_e[Se].toString(16);Ge.length<2&&(Ge="0"+Ge),Te+=Ge}x.codec=Te}break;case 8:y=!0,w&&v&&(v.debug+="PPS "),x.pps||(x.pps=[B.data]);break;case 9:y=!1,x.audFound=!0,v&&a(v,x),v=T.avcSample=o(!1,O.pts,O.dts,w?"AUD ":"");break;case 12:y=!1;break;default:y=!1,v&&(v.debug+="unknown NAL "+B.type+" ");break}if(v&&y){var Ne=v.units;Ne.push(B)}}),C&&v&&(a(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 c=C.units;T=c[c.length-1]}return T},S.parseAVCNALu=function(O){var C=O.byteLength,T=this._avcTrack,x=T.naluState||0,c=x,w=[],v=0,y,F,B,R=-1,j=0;for(x===-1&&(R=0,j=O[0]&31,x=0,v=1);v<C;){if(y=O[v++],!x){x=y?0:1;continue}if(x===1){x=y?0:2;continue}if(!y)x=3;else if(y===1){if(R>=0){var N={data:O.subarray(R,v-x-1),type:j};w.push(N)}else{var b=this.getLastNalUnit();if(b&&(c&&v<=4-c&&(b.state&&(b.data=b.data.subarray(0,b.data.byteLength-c))),F=v-x-1,F>0)){var Y=new Uint8Array(b.data.byteLength+F);Y.set(b.data,0),Y.set(O.subarray(0,F),b.data.byteLength),b.data=Y,b.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,c=O.data;if(x){this.aacOverFlow=null;var w=x.sample.unit.byteLength,v=Math.min(x.missing,w),y=w-v;x.sample.unit.set(c.subarray(0,v),y),T.samples.push(x.sample),C=x.missing}var F,B;for(F=C,B=c.length;F<B-1&&!X.isHeader(c,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,c,F,this.audioCodec);var N;if(O.pts!==void 0)N=O.pts;else if(x){var b=X.getFrameDuration(T.samplerate);N=x.sample.pts+b}else{g.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var Y=0;F<B;)if(X.isHeader(c,F)){if(F+5<B){var ee=X.appendFrame(T,c,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,c=0,w=O.pts;if(w===void 0){g.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;c<T;)if(U.isHeader(C,c)){var v=U.appendFrame(this._audioTrack,C,c,w,x);if(v)c+=v.length,x++;else break}else c++},S.parseID3PES=function(O){if(O.pts===void 0){g.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(O)},E}();u.minProbeByteLength=188;function o(E,S,L,O){return{key:E,frame:!1,pts:S,dts:L,units:[],debug:O,length:0}}function f(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,c=(E[S+10]&15)<<8|E[S+11];for(S+=12+c;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 h(E){var S=0,L,O,C,T,x,c=E.data;if(!E||E.size===0)return null;for(;c[0].length<19&&c.length>1;){var w=new Uint8Array(c[0].length+c[1].length);w.set(c[0]),w.set(c[1],c[0].length),c[0]=w,c.splice(1,1)}L=c[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 y=L[7];y&192&&(T=(L[9]&14)*536870912+(L[10]&255)*4194304+(L[11]&254)*16384+(L[12]&255)*128+(L[13]&254)/2,y&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=c.length;R<j;R++){L=c[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 a(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 s(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=u},"./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"),W=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"),u=P("./src/utils/logger.ts"),o=P("./src/config.ts"),f=P("./node_modules/eventemitter3/index.js"),l=P.n(f),h=P("./src/events.ts"),a=P("./src/errors.ts");function s(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&&s(S.prototype,L),O&&s(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 f.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(u.enableLogs)(C.debug),this._autoLevelCapping=-1,C.progressive&&Object(o.enableStreamingMode)(C);var T=C.abrController,x=C.bufferController,c=C.capLevelController,w=C.fpsController,v=this.abrController=new T(this),y=this.bufferController=new x(this),F=this.capLevelController=new c(this),B=new w(this),R=new k.default(this),j=new G.default(this),N=new W.default(this),b=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=[b,ee];this.networkControllers=ae;var ue=[R,j,v,y,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 c=T?new C(this,T):new C(this);return x&&x.push(c),c}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,c){x===void 0&&(x=this),this._emitter.off(C,T,x,c)},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){u.logger.error("An internal error happened while handling event "+C+'. Error message: "'+x.message+'". Here is a stacktrace:',x),this.trigger(h.Events.ERROR,{type:a.ErrorTypes.OTHER_ERROR,details:a.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:C,error:x})}return!1},L.listenerCount=function(C){return this._emitter.listenerCount(C)},L.destroy=function(){u.logger.log("destroy"),this.trigger(h.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){u.logger.log("attachMedia"),this._media=C,this.trigger(h.Events.MEDIA_ATTACHING,{media:C})},L.detachMedia=function(){u.logger.log("detachMedia"),this.trigger(h.Events.MEDIA_DETACHING,void 0),this._media=null},L.loadSource=function(C){this.stopLoad();var T=this.media,x=this.url,c=this.url=X.buildAbsoluteURL(self.location.href,C,{alwaysNormalize:!0});u.logger.log("loadSource:"+c),T&&x&&x!==c&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(T)),this.trigger(h.Events.MANIFEST_LOADING,{url:C})},L.startLoad=function(C){C===void 0&&(C=-1),u.logger.log("startLoad("+C+")"),this.networkControllers.forEach(function(T){T.startLoad(C)})},L.stopLoad=function(){u.logger.log("stopLoad"),this.networkControllers.forEach(function(C){C.stopLoad()})},L.swapAudioCodec=function(){u.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},L.recoverMediaError=function(){u.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){u.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){u.logger.log("set nextLevel:"+C),this.levelController.manualLevel=C,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(C){u.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){u.logger.log("set firstLevel:"+C),this.levelController.firstLevel=C}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(C){u.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&&(u.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,c=0;c<x;c++)if(C[c].maxBitrate>T)return c;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 h.Events}},{key:"ErrorTypes",get:function(){return a.ErrorTypes}},{key:"ErrorDetails",get:function(){return a.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 W=Object(X.getMediaSource)();if(!W)return!1;var n=U(),D=W&&typeof W.isTypeSupported=="function"&&W.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 W,n=U();return typeof(n==null||((W=n.prototype)===null||W===void 0)?void 0:W.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(re,$,P){"use strict";P.r($),P.d($,"default",function(){return u}),P.d($,"LoadError",function(){return f});var X=P("./src/polyfills/number.ts"),U=P("./src/errors.ts");function k(l,h){l.prototype=Object.create(h.prototype),l.prototype.constructor=l,g(l,h)}function G(l){var h=typeof Map=="function"?new Map:void 0;return G=function(s){if(s===null||!D(s))return s;if(typeof s!="function")throw new TypeError("Super expression must either be null or a function");if(typeof h!="undefined"){if(h.has(s))return h.get(s);h.set(s,A)}function A(){return W(s,arguments,p(this).constructor)}return A.prototype=Object.create(s.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),g(A,s)},G(l)}function W(l,h,a){return n()?W=Reflect.construct:W=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},W.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,h){return g=Object.setPrototypeOf||function(s,A){return s.__proto__=A,s},g(l,h)}function p(l){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)},p(l)}var m=Math.pow(2,17),u=function(){function l(a){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=a}var h=l.prototype;return h.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},h.abort=function(){this.loader&&this.loader.abort()},h.load=function(s,A){var E=this,S=s.url;if(!S)return Promise.reject(new f({type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:s,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 c=E.loader=s.loader=O?new O(L):new C(L),w=o(s),v={timeout:L.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:L.fragLoadingMaxRetryTimeout,highWaterMark:m};s.stats=c.stats,c.load(w,v,{onSuccess:function(F,B,R,j){E.resetLoader(s,c),T({frag:s,part:null,payload:F.data,networkDetails:j})},onError:function(F,B,R){E.resetLoader(s,c),x(new f({type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:s,response:F,networkDetails:R}))},onAbort:function(F,B,R){E.resetLoader(s,c),x(new f({type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:s,networkDetails:R}))},onTimeout:function(F,B,R){E.resetLoader(s,c),x(new f({type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:s,networkDetails:R}))},onProgress:function(F,B,R,j){A&&A({frag:s,part:null,payload:R,networkDetails:j})}})})},h.loadPart=function(s,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 c=S.loader=s.loader=O?new O(L):new C(L),w=o(s,A),v={timeout:L.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:L.fragLoadingMaxRetryTimeout,highWaterMark:m};A.stats=c.stats,c.load(w,v,{onSuccess:function(F,B,R,j){S.resetLoader(s,c),S.updateStatsFromPart(s,A);var N={frag:s,part:A,payload:F.data,networkDetails:j};E(N),T(N)},onError:function(F,B,R){S.resetLoader(s,c),x(new f({type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:s,part:A,response:F,networkDetails:R}))},onAbort:function(F,B,R){s.stats.aborted=A.stats.aborted,S.resetLoader(s,c),x(new f({type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:s,part:A,networkDetails:R}))},onTimeout:function(F,B,R){S.resetLoader(s,c),x(new f({type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:s,part:A,networkDetails:R}))}})})},h.updateStatsFromPart=function(s,A){var E=s.stats,S=A.stats,L=S.total;if(E.loaded+=S.loaded,L){var O=Math.round(s.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 c=E.loading,w=S.loading;c.start?c.first+=w.first-w.start:(c.start=w.start,c.first=w.first),c.end=w.end},h.resetLoader=function(s,A){s.loader=null,this.loader===A&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),A.destroy()},l}();function o(l,h){h===void 0&&(h=null);var a=h||l,s={frag:l,part:h,responseType:"arraybuffer",url:a.url,headers:{},rangeStart:0,rangeEnd:0},A=a.byteRangeStartOffset,E=a.byteRangeEndOffset;return Object(X.isFiniteNumber)(A)&&Object(X.isFiniteNumber)(E)&&(s.rangeStart=A,s.rangeEnd=E),s}var f=function(l){k(h,l);function h(a){for(var s,A=arguments.length,E=new Array(A>1?A-1:0),S=1;S<A;S++)E[S-1]=arguments[S];return s=l.call.apply(l,[this].concat(E))||this,s.data=void 0,s.data=a,s}return h}(G(Error))},"./src/loader/fragment.ts":function(re,$,P){"use strict";P.r($),P.d($,"ElementaryStreamTypes",function(){return u}),P.d($,"BaseSegment",function(){return o}),P.d($,"Fragment",function(){return f}),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"),W=P("./src/loader/level-key.ts"),n=P("./src/loader/load-stats.ts");function D(h,a){h.prototype=Object.create(a.prototype),h.prototype.constructor=h,g(h,a)}function g(h,a){return g=Object.setPrototypeOf||function(A,E){return A.__proto__=E,A},g(h,a)}function p(h,a){for(var s=0;s<a.length;s++){var A=a[s];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(h,A.key,A)}}function m(h,a,s){return a&&p(h.prototype,a),s&&p(h,s),h}var u;(function(h){h.AUDIO="audio",h.VIDEO="video",h.AUDIOVIDEO="audiovideo"})(u||(u={}));var o=function(){function h(s){var A;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(A={},A[u.AUDIO]=null,A[u.VIDEO]=null,A[u.AUDIOVIDEO]=null,A),this.baseurl=s}var a=h.prototype;return a.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(h,[{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}}]),h}(),f=function(h){D(a,h);function a(A,E){var S;return S=h.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 s=a.prototype;return s.createInitializationVector=function(E){for(var S=new Uint8Array(16),L=12;L<16;L++)S[L]=E>>8*(15-L)&255;return S},s.setDecryptDataFromLevelKey=function(E,S){var L=E;return(E==null?void 0:E.method)==="AES-128"&&E.uri&&!E.iv&&(L=W.LevelKey.fromURI(E.uri),L.method=E.method,L.iv=this.createInitializationVector(S),L.keyFormat="identity"),L},s.setElementaryStreamInfo=function(E,S,L,O,C,T){T===void 0&&(T=!1);var x=this.elementaryStreams,c=x[E];if(!c){x[E]={startPTS:S,endPTS:L,startDTS:O,endDTS:C,partial:T};return}c.startPTS=Math.min(c.startPTS,S),c.endPTS=Math.max(c.endPTS,L),c.startDTS=Math.min(c.startDTS,O),c.endDTS=Math.max(c.endDTS,C)},s.clearElementaryStreamInfo=function(){var E=this.elementaryStreams;E[u.AUDIO]=null,E[u.VIDEO]=null,E[u.AUDIOVIDEO]=null},m(a,[{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)}}]),a}(o),l=function(h){D(a,h);function a(s,A,E,S,L){var O;O=h.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=s.decimalFloatingPoint("DURATION"),O.gap=s.bool("GAP"),O.independent=s.bool("INDEPENDENT"),O.relurl=s.enumeratedString("URI"),O.fragment=A,O.index=S;var C=s.enumeratedString("BYTERANGE");return C&&O.setByteRange(C,L),L&&(O.fragOffset=L.fragOffset+L.duration),O}return m(a,[{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)}}]),a}(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 W(D){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=D,this._registerListeners()}var n=W.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,u=m.type,o=this.loaders[u];if(!m.decryptdata){k.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var f=m.decryptdata.uri;if(f!==this.decrypturl||this.decryptkey===null){var l=this.hls.config;if(o&&(k.logger.warn("abort previous key loader for type:"+u),o.abort()),!f){k.logger.warn("key uri is falsy");return}var h=l.loader,a=m.loader=this.loaders[u]=new h(l);this.decrypturl=f,this.decryptkey=null;var s={url:f,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)};a.load(s,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 u=m.frag;if(!u.decryptdata){k.logger.error("after key load, decryptdata unset");return}this.decryptkey=u.decryptdata.key=new Uint8Array(g.data),u.loader=null,delete this.loaders[u.type],this.hls.trigger(X.Events.KEY_LOADED,{frag:u})},n.loaderror=function(g,p){var m=p.frag,u=m.loader;u&&u.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,u=m.loader;u&&u.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})},W}()},"./src/loader/level-details.ts":function(re,$,P){"use strict";P.r($),P.d($,"LevelDetails",function(){return W});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,W=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,u=this.lastPartIndex-p.lastPartIndex;this.updated=this.endSN!==p.endSN||!!u||!!m,this.advanced=this.endSN>p.endSN||m>0||m===0&&u>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 W});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 W=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 a});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"),W=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,u=/#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"),f=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 h(L){var O,C;return l.test((O=(C=U.parseURL(L))===null||C===void 0?void 0:C.path)!=null?O:"")}var a=function(){function L(){}return L.findGroup=function(C,T){for(var x=0;x<C.length;x++){var c=C[x];if(c.id===T)return c}},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=[],c={},w=!1;m.lastIndex=0;for(var v;(v=m.exec(C))!=null;)if(v[1]){var y=new D.AttrList(v[1]),F={attrs:y,bitrate:y.decimalInteger("AVERAGE-BANDWIDTH")||y.decimalInteger("BANDWIDTH"),name:y.NAME,url:L.resolve(v[2],T)},B=y.decimalResolution("RESOLUTION");B&&(F.width=B.width,F.height=B.height),s((y.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,c[R["DATA-ID"]]=R)}return{levels:x,sessionData:w?c:null}},L.parseMasterPlaylistMedia=function(C,T,x,c){c===void 0&&(c=[]);var w,v=[],y=0;for(u.lastIndex=0;(w=u.exec(C))!==null;){var F=new D.AttrList(w[1]);if(F.TYPE===x){var B={attrs:F,bitrate:0,id:y++,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(c.length){var R=L.findGroup(c,B.groupId)||c[0];A(B,R,"audioCodec"),A(B,R,"textCodec")}v.push(B)}}return v},L.parseLevelPlaylist=function(C,T,x,c,w){var v=new W.LevelDetails(T),y=v.fragments,F=null,B=0,R=0,j=0,N=0,b=null,Y=new G.Fragment(c,T),ee,ae,ue,Oe=-1,Ee=!1;for(o.lastIndex=0,v.m3u8=C;(ee=o.exec(C))!==null;){Ee&&(Ee=!1,Y=new G.Fragment(c,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 Ae=(" "+ee[2]).slice(1);Y.title=Ae||null,Y.tagList.push(Ae?["INF",xe,Ae]:["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,y.push(Y),Y.relurl=(" "+ee[3]).slice(1),S(Y,b),b=Y,j+=Y.duration,B++,R=0,Ee=!0);else if(ee[4]){var Re=(" "+ee[4]).slice(1);b?Y.setByteRange(Re,b):Y.setByteRange(Re)}else if(ee[5])Y.rawProgramDateTime=(" "+ee[5]).slice(1),Y.tagList.push(["PROGRAM-DATE-TIME",Y.rawProgramDateTime]),Oe===-1&&(Oe=y.length);else{if(ee=ee[0].match(f),!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),he=(" "+ee[ae+1]).slice(1),ke=ee[ae+2]?(" "+ee[ae+2]).slice(1):"";switch(pe){case"PLAYLIST-TYPE":v.type=he.toUpperCase();break;case"MEDIA-SEQUENCE":B=v.startSN=parseInt(he);break;case"SKIP":{var et=new D.AttrList(he),We=et.decimalInteger("SKIPPED-SEGMENTS");if(Object(X.isFiniteNumber)(We)){v.skippedSegments=We;for(var nt=We;nt--;)y.unshift(null);B+=We}var at=et.enumeratedString("RECENTLY-REMOVED-DATERANGES");at&&(v.recentlyRemovedDateranges=at.split(" "));break}case"TARGETDURATION":v.targetduration=parseFloat(he);break;case"VERSION":v.version=parseInt(he);break;case"EXTM3U":break;case"ENDLIST":v.live=!1;break;case"#":(he||ke)&&Y.tagList.push(ke?[he,ke]:[he]);break;case"DIS":N++;case"GAP":Y.tagList.push([pe]);break;case"BITRATE":Y.tagList.push([pe,he]);break;case"DISCONTINUITY-SEQ":N=parseInt(he);break;case"KEY":{var Pe,je=new D.AttrList(he),$e=je.enumeratedString("METHOD"),se=je.URI,_e=je.hexadecimalInteger("IV"),Te=je.enumeratedString("KEYFORMATVERSIONS"),Se=je.enumeratedString("KEYID"),Ge=(Pe=je.enumeratedString("KEYFORMAT"))!=null?Pe:"identity",Ne=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(Ne.indexOf(Ge)>-1){g.logger.warn("Keyformat "+Ge+" is not supported from the manifest");continue}else if(Ge!=="identity")continue;$e&&(ue=n.LevelKey.fromURL(T,se),se&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf($e)>=0&&(ue.method=$e,ue.keyFormat=Ge,Se&&(ue.keyID=Se),Te&&(ue.keyFormatVersions=Te),ue.iv=_e));break}case"START":{var Fe=new D.AttrList(he),Ke=Fe.decimalFloatingPoint("TIME-OFFSET");Object(X.isFiniteNumber)(Ke)&&(v.startTimeOffset=Ke);break}case"MAP":{var Je=new D.AttrList(he);Y.relurl=Je.URI,Je.BYTERANGE&&Y.setByteRange(Je.BYTERANGE),Y.level=x,Y.sn="initSegment",ue&&(Y.levelkey=ue),Y.initSegment=null,F=Y,Ee=!0;break}case"SERVER-CONTROL":{var Ve=new D.AttrList(he);v.canBlockReload=Ve.bool("CAN-BLOCK-RELOAD"),v.canSkipUntil=Ve.optionalFloat("CAN-SKIP-UNTIL",0),v.canSkipDateRanges=v.canSkipUntil>0&&Ve.bool("CAN-SKIP-DATERANGES"),v.partHoldBack=Ve.optionalFloat("PART-HOLD-BACK",0),v.holdBack=Ve.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var tt=new D.AttrList(he);v.partTarget=tt.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Ie=v.partList;Ie||(Ie=v.partList=[]);var it=R>0?Ie[Ie.length-1]:void 0,st=R++,De=new G.Part(new D.AttrList(he),Y,T,st,it);Ie.push(De),Y.duration+=De.duration;break}case"PRELOAD-HINT":{var Me=new D.AttrList(he);v.preloadHint=Me;break}case"RENDITION-REPORT":{var ve=new D.AttrList(he);v.renditionReports=v.renditionReports||[],v.renditionReports.push(ve);break}default:g.logger.warn("line parsed but not handled: "+ee);break}}}b&&!b.relurl?(y.pop(),j-=b.duration,v.partList&&(v.fragmentHint=b)):v.partList&&(S(Y,b),Y.cc=N,v.fragmentHint=Y);var ce=y.length,fe=y[0],ie=y[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&&h(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(c,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,Oe>0&&E(y,Oe),v},L}();function s(L,O){["video","audio","text"].forEach(function(C){var T=L.filter(function(c){return Object(p.isCodecType)(c,C)});if(T.length){var x=T.filter(function(c){return c.lastIndexOf("avc1",0)===0||c.lastIndexOf("mp4a",0)===0});O[C+"Codec"]=x.length>0?x[0]:T[0],L=L.filter(function(c){return T.indexOf(c)===-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"),W=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 f=o.type;switch(f){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,f){var l=o.url;return(l===void 0||l.indexOf("data:")===0)&&(l=f.url),l}var u=function(){function o(l){this.hls=void 0,this.loaders=Object.create(null),this.hls=l,this.registerListeners()}var f=o.prototype;return f.registerListeners=function(){var h=this.hls;h.on(U.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.on(U.Events.LEVEL_LOADING,this.onLevelLoading,this),h.on(U.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),h.on(U.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},f.unregisterListeners=function(){var h=this.hls;h.off(U.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.off(U.Events.LEVEL_LOADING,this.onLevelLoading,this),h.off(U.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),h.off(U.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},f.createInternalLoader=function(h){var a=this.hls.config,s=a.pLoader,A=a.loader,E=s||A,S=new E(a);return h.loader=S,this.loaders[h.type]=S,S},f.getInternalLoader=function(h){return this.loaders[h.type]},f.resetInternalLoader=function(h){this.loaders[h]&&delete this.loaders[h]},f.destroyInternalLoaders=function(){for(var h in this.loaders){var a=this.loaders[h];a&&a.destroy(),this.resetInternalLoader(h)}},f.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},f.onManifestLoading=function(h,a){var s=a.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:D.PlaylistContextType.MANIFEST,url:s,deliveryDirectives:null})},f.onLevelLoading=function(h,a){var s=a.id,A=a.level,E=a.url,S=a.deliveryDirectives;this.load({id:s,groupId:null,level:A,responseType:"text",type:D.PlaylistContextType.LEVEL,url:E,deliveryDirectives:S})},f.onAudioTrackLoading=function(h,a){var s=a.id,A=a.groupId,E=a.url,S=a.deliveryDirectives;this.load({id:s,groupId:A,level:null,responseType:"text",type:D.PlaylistContextType.AUDIO_TRACK,url:E,deliveryDirectives:S})},f.onSubtitleTrackLoading=function(h,a){var s=a.id,A=a.groupId,E=a.url,S=a.deliveryDirectives;this.load({id:s,groupId:A,level:null,responseType:"text",type:D.PlaylistContextType.SUBTITLE_TRACK,url:E,deliveryDirectives:S})},f.load=function(h){var a,s=this.hls.config,A=this.getInternalLoader(h);if(A){var E=A.context;if(E&&E.url===h.url){G.logger.trace("[playlist-loader]: playlist request ongoing");return}G.logger.log("[playlist-loader]: aborting previous loader for type: "+h.type),A.abort()}var S,L,O,C;switch(h.type){case D.PlaylistContextType.MANIFEST:S=s.manifestLoadingMaxRetry,L=s.manifestLoadingTimeOut,O=s.manifestLoadingRetryDelay,C=s.manifestLoadingMaxRetryTimeout;break;case D.PlaylistContextType.LEVEL:case D.PlaylistContextType.AUDIO_TRACK:case D.PlaylistContextType.SUBTITLE_TRACK:S=0,L=s.levelLoadingTimeOut;break;default:S=s.levelLoadingMaxRetry,L=s.levelLoadingTimeOut,O=s.levelLoadingRetryDelay,C=s.levelLoadingMaxRetryTimeout;break}if(A=this.createInternalLoader(h),(a=h.deliveryDirectives)!==null&&a!==void 0&&a.part){var T;if(h.type===D.PlaylistContextType.LEVEL&&h.level!==null?T=this.hls.levels[h.level].details:h.type===D.PlaylistContextType.AUDIO_TRACK&&h.id!==null?T=this.hls.audioTracks[h.id].details:h.type===D.PlaylistContextType.SUBTITLE_TRACK&&h.id!==null&&(T=this.hls.subtitleTracks[h.id].details),T){var x=T.partTarget,c=T.targetduration;x&&c&&(L=Math.min(Math.max(x*3,c*.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(h,w,v)},f.loadsuccess=function(h,a,s,A){if(A===void 0&&(A=null),s.isSidxRequest){this.handleSidxRequest(h,s),this.handlePlaylistLoaded(h,a,s,A);return}this.resetInternalLoader(s.type);var E=h.data;if(E.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(h,s,"no EXTM3U delimiter",A);return}a.parsing.start=performance.now(),E.indexOf("#EXTINF:")>0||E.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(h,a,s,A):this.handleMasterPlaylist(h,a,s,A)},f.loaderror=function(h,a,s){s===void 0&&(s=null),this.handleNetworkError(a,s,!1,h)},f.loadtimeout=function(h,a,s){s===void 0&&(s=null),this.handleNetworkError(a,s,!0)},f.handleMasterPlaylist=function(h,a,s,A){var E=this.hls,S=h.data,L=m(h,s),O=n.default.parseMasterPlaylist(S,L),C=O.levels,T=O.sessionData;if(!C.length){this.handleManifestParsingError(h,s,"no level found in manifest",A);return}var x=C.map(function(B){return{id:B.attrs.AUDIO,audioCodec:B.audioCodec}}),c=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",c),y=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:y,url:L,stats:a,networkDetails:A,sessionData:T})},f.handleTrackOrLevelPlaylist=function(h,a,s,A){var E=this.hls,S=s.id,L=s.level,O=s.type,C=m(h,s),T=Object(X.isFiniteNumber)(S)?S:0,x=Object(X.isFiniteNumber)(L)?L:T,c=p(s),w=n.default.parseLevelPlaylist(h.data,C,x,c,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 s.level=="number"?s.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:a,networkDetails:A,sessionData:null})}if(a.parsing.end=performance.now(),w.needSidxRanges){var y,F=(y=w.fragments[0].initSegment)===null||y===void 0?void 0:y.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}s.levelDetails=w,this.handlePlaylistLoaded(h,a,s,A)},f.handleSidxRequest=function(h,a){var s=Object(W.parseSegmentIndex)(new Uint8Array(h.data));if(!s)return;var A=s.references,E=a.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(s.moovEndOffset)+"@0")})},f.handleManifestParsingError=function(h,a,s,A){this.hls.trigger(U.Events.ERROR,{type:k.ErrorTypes.NETWORK_ERROR,details:k.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:a.type===D.PlaylistContextType.MANIFEST,url:h.url,reason:s,response:h,context:a,networkDetails:A})},f.handleNetworkError=function(h,a,s,A){s===void 0&&(s=!1),G.logger.warn("[playlist-loader]: A network "+(s?"timeout":"error")+" occurred while loading "+h.type+" level: "+h.level+" id: "+h.id+' group-id: "'+h.groupId+'"');var E=k.ErrorDetails.UNKNOWN,S=!1,L=this.getInternalLoader(h);switch(h.type){case D.PlaylistContextType.MANIFEST:E=s?k.ErrorDetails.MANIFEST_LOAD_TIMEOUT:k.ErrorDetails.MANIFEST_LOAD_ERROR,S=!0;break;case D.PlaylistContextType.LEVEL:E=s?k.ErrorDetails.LEVEL_LOAD_TIMEOUT:k.ErrorDetails.LEVEL_LOAD_ERROR,S=!1;break;case D.PlaylistContextType.AUDIO_TRACK:E=s?k.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:k.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,S=!1;break;case D.PlaylistContextType.SUBTITLE_TRACK:E=s?k.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:k.ErrorDetails.SUBTITLE_LOAD_ERROR,S=!1;break}L&&this.resetInternalLoader(h.type);var O={type:k.ErrorTypes.NETWORK_ERROR,details:E,fatal:S,url:h.url,loader:L,context:h,networkDetails:a};A&&(O.response=A),this.hls.trigger(U.Events.ERROR,O)},f.handlePlaylistLoaded=function(h,a,s,A){var E=s.type,S=s.level,L=s.id,O=s.groupId,C=s.loader,T=s.levelDetails,x=s.deliveryDirectives;if(!(T!=null&&T.targetduration)){this.handleManifestParsingError(h,s,"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:a,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:a,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:a,networkDetails:A,deliveryDirectives:x});break}},o}();$.default=u},"./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,W){switch(G){case"mp4a.40.2":if(W===1)return new Uint8Array([0,200,0,128,35,128]);if(W===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(W===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(W===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(W===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(W===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(W===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(W===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(W===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 W;for(W in k.types)k.types.hasOwnProperty(W)&&(k.types[W]=[W.charCodeAt(0),W.charCodeAt(1),W.charCodeAt(2),W.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]),u=new Uint8Array([97,118,99,49]),o=new Uint8Array([0,0,0,1]);k.FTYP=k.box(k.types.ftyp,m,o,m,u),k.DINF=k.box(k.types.dinf,k.box(k.types.dref,g))},k.box=function(W){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,u=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(W,4),m=0,n=8;m<u;m++)o.set(g[m],n),n+=g[m].byteLength;return o},k.hdlr=function(W){return k.box(k.types.hdlr,k.HDLR_TYPES[W])},k.mdat=function(W){return k.box(k.types.mdat,W)},k.mdhd=function(W,n){n*=W;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,W>>24&255,W>>16&255,W>>8&255,W&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(W){return k.box(k.types.mdia,k.mdhd(W.timescale,W.duration),k.hdlr(W.type),k.minf(W))},k.mfhd=function(W){return k.box(k.types.mfhd,new Uint8Array([0,0,0,0,W>>24,W>>16&255,W>>8&255,W&255]))},k.minf=function(W){return W.type==="audio"?k.box(k.types.minf,k.box(k.types.smhd,k.SMHD),k.DINF,k.stbl(W)):k.box(k.types.minf,k.box(k.types.vmhd,k.VMHD),k.DINF,k.stbl(W))},k.moof=function(W,n,D){return k.box(k.types.moof,k.mfhd(W),k.traf(D,n))},k.moov=function(W){for(var n=W.length,D=[];n--;)D[n]=k.trak(W[n]);return k.box.apply(null,[k.types.moov,k.mvhd(W[0].timescale,W[0].duration)].concat(D).concat(k.mvex(W)))},k.mvex=function(W){for(var n=W.length,D=[];n--;)D[n]=k.trex(W[n]);return k.box.apply(null,[k.types.mvex].concat(D))},k.mvhd=function(W,n){n*=W;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,W>>24&255,W>>16&255,W>>8&255,W&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(W){var n=W.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(W){return k.box(k.types.stbl,k.stsd(W),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(W){var n=[],D=[],g,p,m;for(g=0;g<W.sps.length;g++)p=W.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<W.pps.length;g++)p=W.pps[g],m=p.byteLength,D.push(m>>>8&255),D.push(m&255),D=D.concat(Array.prototype.slice.call(p));var u=k.box(k.types.avcC,new Uint8Array([1,n[3],n[4],n[5],252|3,224|W.sps.length].concat(n).concat([W.pps.length]).concat(D))),o=W.width,f=W.height,l=W.pixelRatio[0],h=W.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,f>>8&255,f&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]),u,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,h>>24,h>>16&255,h>>8&255,h&255])))},k.esds=function(W){var n=W.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(W.config).concat([6,1,2]))},k.mp4a=function(W){var n=W.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,W.channelCount,0,16,0,0,0,0,n>>8&255,n&255,0,0]),k.box(k.types.esds,k.esds(W)))},k.mp3=function(W){var n=W.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,W.channelCount,0,16,0,0,0,0,n>>8&255,n&255,0,0]))},k.stsd=function(W){return W.type==="audio"?!W.isAAC&&W.codec==="mp3"?k.box(k.types.stsd,k.STSD,k.mp3(W)):k.box(k.types.stsd,k.STSD,k.mp4a(W)):k.box(k.types.stsd,k.STSD,k.avc1(W))},k.tkhd=function(W){var n=W.id,D=W.duration*W.timescale,g=W.width,p=W.height,m=Math.floor(D/(X+1)),u=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,u>>24,u>>16&255,u>>8&255,u&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(W,n){var D=k.sdtp(W),g=W.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(W,D.length+16+20+8+16+8+8),D)},k.trak=function(W){return W.duration=W.duration||4294967295,k.box(k.types.trak,k.tkhd(W),k.mdia(W))},k.trex=function(W){var n=W.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(W,n){var D=W.samples||[],g=D.length,p=12+16*g,m=new Uint8Array(p),u,o,f,l,h,a;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),u=0;u<g;u++)o=D[u],f=o.duration,l=o.size,h=o.flags,a=o.cts,m.set([f>>>24&255,f>>>16&255,f>>>8&255,f&255,l>>>24&255,l>>>16&255,l>>>8&255,l&255,h.isLeading<<2|h.dependsOn,h.isDependedOn<<6|h.hasRedundancy<<4|h.paddingValue<<1|h.isNonSync,h.degradPrio&240<<8,h.degradPrio&15,a>>>24&255,a>>>16&255,a>>>8&255,a&255],12+16*u);return k.box(k.types.trun,m)},k.initSegment=function(W){k.types||k.init();var n=k.moov(W),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 a}),P.d($,"normalizePts",function(){return s});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"),W=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,u=1024,o=1152,f=null,l=null,h=!1,a=function(){function L(C,T,x,c){if(c===void 0&&(c=""),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,f===null){var w=navigator.userAgent||"",v=w.match(/Chrome\/(\d+)/i);f=v?parseInt(v[1]):0}if(l===null){var y=navigator.userAgent.match(/Safari\/(\d+)/i);l=y?parseInt(y[1]):0}h=!!f&&f<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,c=T.reduce(function(w,v){var y=v.pts-w;return y<-4294967296?(x=!0,s(w,v.pts)):y>0?w:v.pts},T[0].pts);return x&&n.logger.debug("PTS rollover detected"),c},O.remux=function(T,x,c,w,v,y,F,B){var R,j,N,b,Y,ee,ae=v,ue=v,Oe=T.pid>-1,Ee=x.pid>-1,xe=x.samples.length,Ae=T.samples.length>0,Re=xe>1,pe=(!Oe||Ae)&&(!Ee||Re)||this.ISGenerated||F;if(pe){this.ISGenerated||(N=this.generateIS(T,x,v));var he=this.isVideoContiguous,ke=-1;if(Re&&(ke=A(x.samples),!he&&this.config.forceKeyFrameOnDiscontinuity))if(ee=!0,ke>0){n.logger.warn("[mp4-remuxer]: Dropped "+ke+" out of "+xe+" video samples due to a missing keyframe");var et=this.getVideoStartPts(x.samples);x.samples=x.samples.slice(ke),x.dropped+=ke,ue+=(x.samples[0].pts-et)/(x.timescale||9e4)}else ke===-1&&(n.logger.warn("[mp4-remuxer]: No keyframe found out of "+xe+" video samples"),ee=!1);if(this.ISGenerated){if(Ae&&Re){var We=this.getVideoStartPts(x.samples),nt=s(T.samples[0].pts,We)-We,at=nt/x.inputTimeScale;ae+=Math.max(0,at),ue+=Math.max(0,-at)}if(Ae){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,y,Ee||Re||B===D.PlaylistLevelType.AUDIO?ue:void 0),Re){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,he,Pe)}}else Re&&(R=this.remuxVideo(x,ue,he,0));R&&(R.firstKeyFrame=ke,R.independent=ke!==-1)}}return this.ISGenerated&&(c.samples.length&&(Y=this.remuxID3(c,v)),w.samples.length&&(b=this.remuxText(w,v))),{audio:j,video:R,initSegment:N,independent:ee,text:b,id3:Y}},O.generateIS=function(T,x,c){var w=T.samples,v=x.samples,y=this.typeSupported,F={},B=!Object(X.isFiniteNumber)(this._initPTS),R="audio/mp4",j,N,b;if(B&&(j=N=Infinity),T.config&&w.length&&(T.timescale=T.samplerate,T.isAAC||(y.mpeg?(R="audio/mpeg",T.codec=""):y.mp3&&(T.codec="mp3")),F.audio={id:"audio",container:R,codec:T.codec,initSegment:!T.isAAC&&y.mpeg?new Uint8Array(0):k.default.initSegment([T]),metadata:{channelCount:T.channelCount}},B&&(b=T.inputTimeScale,j=N=w[0].pts-Math.round(b*c))),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)){b=x.inputTimeScale;var Y=this.getVideoStartPts(v),ee=Math.round(b*c);N=Math.min(N,s(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:b}},O.remuxVideo=function(T,x,c,w){var v=T.inputTimeScale,y=T.samples,F=[],B=y.length,R=this._initPTS,j=this.nextAvcDts,N=8,b,Y,ee,ae=Number.POSITIVE_INFINITY,ue=Number.NEGATIVE_INFINITY,Oe=0,Ee=!1;if(!c||j===null){var xe=x*v,Ae=y[0].pts-s(y[0].dts,y[0].pts);j=xe-Ae}for(var Re=0;Re<B;Re++){var pe=y[Re];if(pe.pts=s(pe.pts-R,j),pe.dts=s(pe.dts-R,j),pe.dts>pe.pts){var he=9e4*.2;Oe=Math.max(Math.min(Oe,pe.pts-pe.dts),-1*he)}pe.dts<y[Re>0?Re-1:Re].dts&&(Ee=!0)}Ee&&y.sort(function(Ct,xt){var Qe=Ct.dts-xt.dts,Lt=Ct.pts-xt.pts;return Qe||Lt}),Y=y[0].dts,ee=y[y.length-1].dts;var ke=Math.round((ee-Y)/(B-1));if(Oe<0){if(Oe<ke*-2){n.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(g.toMsFromMpegTsClock)(-ke,!0)+" ms");for(var et=Oe,We=0;We<B;We++)y[We].dts=et=Math.max(et,y[We].pts-ke),y[We].pts=Math.max(et,y[We].pts)}else{n.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(g.toMsFromMpegTsClock)(Oe,!0)+" ms to overcome this issue");for(var nt=0;nt<B;nt++)y[nt].dts=y[nt].dts+Oe}Y=y[0].dts}if(c){var at=Y-j,Pe=at>ke,je=at<-1;if(Pe||je){Pe?n.logger.warn("AVC: "+Object(g.toMsFromMpegTsClock)(at,!0)+" ms ("+at+"dts) hole between fragments detected, filling it"):n.logger.warn("AVC: "+Object(g.toMsFromMpegTsClock)(-at,!0)+" ms ("+at+"dts) overlapping between fragments detected"),Y=j;var $e=y[0].pts-at;y[0].dts=Y,y[0].pts=$e,n.logger.log("Video: First PTS/DTS adjusted: "+Object(g.toMsFromMpegTsClock)($e,!0)+"/"+Object(g.toMsFromMpegTsClock)(Y,!0)+", delta: "+Object(g.toMsFromMpegTsClock)(at,!0)+" ms")}}h&&(Y=Math.max(0,Y));for(var se=0,_e=0,Te=0;Te<B;Te++){for(var Se=y[Te],Ge=Se.units,Ne=Ge.length,Fe=0,Ke=0;Ke<Ne;Ke++)Fe+=Ge[Ke].data.length;_e+=Fe,se+=Ne,Se.length=Fe,Se.dts=Math.max(Se.dts,Y),Se.pts=Math.max(Se.pts,Se.dts,0),ae=Math.min(Se.pts,ae),ue=Math.max(Se.pts,ue)}ee=y[B-1].dts;var Je=_e+4*se+8,Ve;try{Ve=new Uint8Array(Je)}catch(Ct){this.observer.emit(G.Events.ERROR,G.Events.ERROR,{type:W.ErrorTypes.MUX_ERROR,details:W.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Je,reason:"fail allocating video mdat "+Je});return}var tt=new DataView(Ve.buffer);tt.setUint32(0,Je),Ve.set(k.default.types.mdat,4);for(var Ie=0;Ie<B;Ie++){for(var it=y[Ie],st=it.units,De=0,Me=0,ve=st.length;Me<ve;Me++){var ce=st[Me],fe=ce.data,ie=ce.data.byteLength;tt.setUint32(N,ie),N+=4,Ve.set(fe,N),N+=ie,De+=4+ie}if(Ie<B-1)b=y[Ie+1].dts-it.dts;else{var ne=this.config,oe=it.dts-y[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)-it.pts;ye>le?(b=ye-oe,b<0&&(b=oe),n.logger.log("[mp4-remuxer]: It is approximately "+ye/90+" ms to the next segment; using duration "+b/90+" ms for the last video frame.")):b=oe}else b=oe}var Le=Math.round(it.pts-it.dts);F.push(new E(it.key,b,De,Le))}if(F.length&&f&&f<70){var Ue=F[0].flags;Ue.dependsOn=2,Ue.isNonSync=0}console.assert(b!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=j=ee+b,this.isVideoContiguous=!0;var Ze=k.default.moof(T.sequenceNumber++,Y,p({},T,{samples:F})),mt="video",ft={data1:Ze,data2:Ve,startPTS:ae/v,endPTS:(ue+b)/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(Ve.length,"MDAT length must not be zero"),ft},O.remuxAudio=function(T,x,c,w,v){var y=T.inputTimeScale,F=T.samplerate?T.samplerate:y,B=y/F,R=T.isAAC?u:o,j=R*B,N=this._initPTS,b=!T.isAAC&&this.typeSupported.mpeg,Y=[],ee=T.samples,ae=b?0:8,ue=this.nextAudioPts||-1,Oe=x*y;if(this.isAudioContiguous=c=c||ee.length&&ue>0&&(w&&Math.abs(Oe-ue)<9e3||Math.abs(s(ee[0].pts-N,Oe)-ue)<20*j),ee.forEach(function(fe){fe.pts=s(fe.pts-N,Oe)}),!c||ue<0){if(ee=ee.filter(function(fe){return fe.pts>=0}),!ee.length)return;v===0?ue=0:w?ue=Math.max(0,Oe):ue=ee[0].pts}if(T.isAAC)for(var Ee=v!==void 0,xe=this.config.maxAudioFramesDrift,Ae=0,Re=ue;Ae<ee.length;Ae++){var pe=ee[Ae],he=pe.pts,ke=he-Re,et=Math.abs(1e3*ke/y);if(ke<=-xe*j&&Ee)Ae===0&&(n.logger.warn("Audio frame @ "+(he/y).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*ke/y)+" ms."),this.nextAudioPts=ue=Re=he);else if(ke>=xe*j&&et<m&&Ee){var We=Math.round(ke/j);Re=he-We*j,Re<0&&(We--,Re+=j),Ae===0&&(this.nextAudioPts=ue=Re),n.logger.warn("[mp4-remuxer]: Injecting "+We+" audio frame @ "+(Re/y).toFixed(3)+"s due to "+Math.round(1e3*ke/y)+" ms gap.");for(var nt=0;nt<We;nt++){var at=Math.max(Re,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(Ae,0,{unit:Pe,pts:at}),Re+=j,Ae++}}pe.pts=Re,Re+=j}for(var je=null,$e=null,se,_e=0,Te=ee.length;Te--;)_e+=ee[Te].unit.byteLength;for(var Se=0,Ge=ee.length;Se<Ge;Se++){var Ne=ee[Se],Fe=Ne.unit,Ke=Ne.pts;if($e!==null){var Je=Y[Se-1];Je.duration=Math.round((Ke-$e)/B)}else if(c&&T.isAAC&&(Ke=ue),je=Ke,_e>0){_e+=ae;try{se=new Uint8Array(_e)}catch(fe){this.observer.emit(G.Events.ERROR,G.Events.ERROR,{type:W.ErrorTypes.MUX_ERROR,details:W.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:_e,reason:"fail allocating audio mdat "+_e});return}if(!b){var Ve=new DataView(se.buffer);Ve.setUint32(0,_e),se.set(k.default.types.mdat,4)}}else return;se.set(Fe,ae);var tt=Fe.byteLength;ae+=tt,Y.push(new E(!0,R,tt,0)),$e=Ke}var Ie=Y.length;if(!Ie)return;var it=Y[Y.length-1];this.nextAudioPts=ue=$e+B*it.duration;var st=b?new Uint8Array(0):k.default.moof(T.sequenceNumber++,je/B,p({},T,{samples:Y}));T.samples=[];var De=je/y,Me=ue/y,ve="audio",ce={data1:st,data2:se,startPTS:De,endPTS:Me,startDTS:De,endDTS:Me,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,c,w){var v=T.inputTimeScale,y=T.samplerate?T.samplerate:v,F=v/y,B=this.nextAudioPts,R=(B!==null?B:w.startDTS*v)+this._initDTS,j=w.endDTS*v+this._initDTS,N=F*u,b=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<b;ae++){var ue=R+ae*N;ee.push({unit:Y,pts:ue,dts:ue})}return T.samples=ee,this.remuxAudio(T,x,c,!1)},O.remuxID3=function(T,x){var c=T.samples.length;if(!c)return;for(var w=T.inputTimeScale,v=this._initPTS,y=this._initDTS,F=0;F<c;F++){var B=T.samples[F];B.pts=s(B.pts-v,x*w)/w,B.dts=s(B.dts-y,x*w)/w}var R=T.samples;return T.samples=[],{samples:R}},O.remuxText=function(T,x){var c=T.samples.length;if(!c)return;for(var w=T.inputTimeScale,v=this._initPTS,y=0;y<c;y++){var F=T.samples[y];F.pts=s(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 s(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"),W=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(u){this.initPTS=u,this.lastEndDTS=null},p.resetNextTimestamp=function(){this.lastEndDTS=null},p.resetInitSegment=function(u,o,f){this.audioCodec=o,this.videoCodec=f,this.generateInitSegment(u),this.emitInitSegment=!0},p.generateInitSegment=function(u){var o=this.audioCodec,f=this.videoCodec;if(!u||!u.byteLength){this.initTracks=void 0,this.initData=void 0;return}var l=this.initData=Object(U.parseInitSegment)(u);o||(o=D(l.audio,k.ElementaryStreamTypes.AUDIO)),f||(f=D(l.video,k.ElementaryStreamTypes.VIDEO));var h={};l.audio&&l.video?h.audiovideo={container:"video/mp4",codec:o+","+f,initSegment:u,id:"main"}:l.audio?h.audio={container:"audio/mp4",codec:o,initSegment:u,id:"audio"}:l.video?h.video={container:"video/mp4",codec:f,initSegment:u,id:"main"}:G.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=h},p.remux=function(u,o,f,l,h){var a=this.initPTS,s=this.lastEndDTS,A={audio:void 0,video:void 0,text:l,id3:f,initSegment:void 0};Object(X.isFiniteNumber)(s)||(s=this.lastEndDTS=h||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)(a)||(this.initPTS=S.initPTS=a=n(L,E,s));var O=Object(U.getDuration)(E,L),C=s,T=O+C;Object(U.offsetStartDTS)(L,E,a),O>0?this.lastEndDTS=T:(G.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var x=!!L.audio,c=!!L.video,w="";x&&(w+="audio"),c&&(w+="video");var v={data1:E,startPTS:C,startDTS:C,endPTS:T,endDTS:T,type:w,hasAudio:x,hasVideo:c,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=f,A.initSegment=S,A},g}(),n=function(p,m,u){return Object(U.getStartDTS)(p,m)-u};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=W},"./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(W){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,W),!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(W){W.MANIFEST="m",W.AUDIO="a",W.VIDEO="v",W.MUXED="av",W.INIT="i",W.CAPTION="c",W.TIMED_TEXT="tt",W.KEY="k",W.OTHER="o"})(U||(U={}));var k;(function(W){W.DASH="d",W.HLS="h",W.SMOOTH="s",W.OTHER="o"})(k||(k={}));var G;(function(W){W.VOD="v",W.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 W}),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,u=D.endSN,o=g!==void 0?g-u:0;return p&&o<p?m?k.v2:k.Yes:k.No}var W=function(){function D(p,m,u){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=p,this.part=m,this.skip=u}var g=D.prototype;return g.addDirectives=function(m){var u=new self.URL(m);return this.msn!==void 0&&u.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&u.searchParams.set("_HLS_part",this.part.toString()),this.skip&&u.searchParams.set("_HLS_skip",this.skip),u.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,W,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=W,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 W=G.prototype;return W.decimalInteger=function(D){var g=parseInt(this[D],10);return g>Number.MAX_SAFE_INTEGER?Infinity:g},W.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},W.hexadecimalIntegerAsNumber=function(D){var g=parseInt(this[D],16);return g>Number.MAX_SAFE_INTEGER?Infinity:g},W.decimalFloatingPoint=function(D){return parseFloat(this[D])},W.optionalFloat=function(D,g){var p=this[D];return p?parseFloat(p):g},W.enumeratedString=function(D){return this[D]},W.bool=function(D){return this[D]==="YES"},W.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 u=g[2];u.indexOf(m)===0&&u.lastIndexOf(m)===u.length-1&&(u=u.slice(1,-1)),p[g[1]]=u}return p},G}()},"./src/utils/binary-search.ts":function(re,$,P){"use strict";P.r($);var X={search:function(k,G){for(var W=0,n=k.length-1,D=null,g=null;W<=n;){D=(W+n)/2|0,g=k[D];var p=G(g);if(p>0)W=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=[],u;for(u=0;u<p.length;u++)m.push({start:p.start(u),end:p.end(u)});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 u=p.length;if(u){var o=p[u-1].end;n[m].start-o<g?n[m].end>o&&(p[u-1].end=n[m].end):p.push(n[m])}else p.push(n[m])}else p=n;for(var f=0,l,h=D,a=D,s=0;s<p.length;s++){var A=p[s].start,E=p[s].end;if(D+g>=A&&D<E)h=A,a=E,f=a-D;else if(D+g<A){l=A;break}}return{len:f,start:h||0,end:a||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 a}),P.d($,"CaptionScreen",function(){return s});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,W=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"],u;(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"})(u||(u={}));var o=function(){function C(){this.time=null,this.verboseLevel=u.ERROR}var T=C.prototype;return T.log=function(c,w){this.verboseLevel>=c&&X.logger.log(this.time+" ["+c+"] "+w)},C}(),f=function(T){for(var x=[],c=0;c<T.length;c++)x.push(T[c].toString(16));return x},l=function(){function C(x,c,w,v,y){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=c||!1,this.italics=w||!1,this.background=v||"black",this.flash=y||!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(c){for(var w=["foreground","underline","italics","background","flash"],v=0;v<w.length;v++){var y=w[v];c.hasOwnProperty(y)&&(this[y]=c[y])}},T.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},T.equals=function(c){return this.foreground===c.foreground&&this.underline===c.underline&&this.italics===c.italics&&this.background===c.background&&this.flash===c.flash},T.copy=function(c){this.foreground=c.foreground,this.underline=c.underline,this.italics=c.italics,this.background=c.background,this.flash=c.flash},T.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},C}(),h=function(){function C(x,c,w,v,y,F){this.uchar=void 0,this.penState=void 0,this.uchar=x||" ",this.penState=new l(c,w,v,y,F)}var T=C.prototype;return T.reset=function(){this.uchar=" ",this.penState.reset()},T.setChar=function(c,w){this.uchar=c,this.penState.copy(w)},T.setPenState=function(c){this.penState.copy(c)},T.equals=function(c){return this.uchar===c.uchar&&this.penState.equals(c.penState)},T.copy=function(c){this.uchar=c.uchar,this.penState.copy(c.penState)},T.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},C}(),a=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 c=0;c<W;c++)this.chars.push(new h);this.logger=x,this.pos=0,this.currPenState=new l}var T=C.prototype;return T.equals=function(c){for(var w=!0,v=0;v<W;v++)if(!this.chars[v].equals(c.chars[v])){w=!1;break}return w},T.copy=function(c){for(var w=0;w<W;w++)this.chars[w].copy(c.chars[w])},T.isEmpty=function(){for(var c=!0,w=0;w<W;w++)if(!this.chars[w].isEmpty()){c=!1;break}return c},T.setCursor=function(c){this.pos!==c&&(this.pos=c),this.pos<0?(this.logger.log(u.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>W&&(this.logger.log(u.DEBUG,"Too large cursor position "+this.pos),this.pos=W)},T.moveCursor=function(c){var w=this.pos+c;if(c>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(c){c>=144&&this.backSpace();var w=k(c);if(this.pos>=W){this.logger.log(u.ERROR,"Cannot insert "+c.toString(16)+" ("+w+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(w,this.currPenState),this.moveCursor(1)},T.clearFromPos=function(c){var w;for(w=c;w<W;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 c=[],w=!0,v=0;v<W;v++){var y=this.chars[v].uchar;y!==" "&&(w=!1),c.push(y)}return w?"":c.join("")},T.setPenStyles=function(c){this.currPenState.setStyles(c);var w=this.chars[this.pos];w.setPenState(this.currPenState)},C}(),s=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 c=0;c<G;c++)this.rows.push(new a(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 c=0;c<G;c++)this.rows[c].clear();this.currRow=G-1},T.equals=function(c){for(var w=!0,v=0;v<G;v++)if(!this.rows[v].equals(c.rows[v])){w=!1;break}return w},T.copy=function(c){for(var w=0;w<G;w++)this.rows[w].copy(c.rows[w])},T.isEmpty=function(){for(var c=!0,w=0;w<G;w++)if(!this.rows[w].isEmpty()){c=!1;break}return c},T.backSpace=function(){var c=this.rows[this.currRow];c.backSpace()},T.clearToEndOfRow=function(){var c=this.rows[this.currRow];c.clearToEndOfRow()},T.insertChar=function(c){var w=this.rows[this.currRow];w.insertChar(c)},T.setPen=function(c){var w=this.rows[this.currRow];w.setPenStyles(c)},T.moveCursor=function(c){var w=this.rows[this.currRow];w.moveCursor(c)},T.setCursor=function(c){this.logger.log(u.INFO,"setCursor: "+c);var w=this.rows[this.currRow];w.setCursor(c)},T.setPAC=function(c){this.logger.log(u.INFO,"pacData = "+JSON.stringify(c));var w=c.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 y=this.currRow+1-this.nrRollUpRows,F=this.lastOutputScreen;if(F){var B=F.rows[y].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[y+j])}}this.currRow=w;var N=this.rows[this.currRow];if(c.indent!==null){var b=c.indent,Y=Math.max(b-1,0);N.setCursor(c.indent),c.color=N.chars[Y].penState.foreground}var ee={foreground:c.color,underline:c.underline,italics:c.italics,background:"black",flash:!1};this.setPen(ee)},T.setBkgData=function(c){this.logger.log(u.INFO,"bkgData = "+JSON.stringify(c)),this.backSpace(),this.setPen(c),this.insertChar(32)},T.setRollUpRows=function(c){this.nrRollUpRows=c},T.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(u.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(u.TEXT,this.getDisplayText());var c=this.currRow+1-this.nrRollUpRows,w=this.rows.splice(c,1)[0];w.clear(),this.rows.splice(this.currRow,0,w),this.logger.log(u.INFO,"Rolling up")},T.getDisplayText=function(c){c=c||!1;for(var w=[],v="",y=-1,F=0;F<G;F++){var B=this.rows[F].getTextString();B&&(y=F+1,c?w.push("Row "+y+": '"+B+"'"):w.push(B.trim()))}return w.length>0&&(c?v="["+w.join(" | ")+"]":v=w.join(`
|
|
`)),v},T.getTextAndFormat=function(){return this.rows},C}(),A=function(){function C(x,c,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=c,this.mode=null,this.verbose=0,this.displayedMemory=new s(w),this.nonDisplayedMemory=new s(w),this.lastOutputScreen=new s(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(c){this.outputFilter=c},T.setPAC=function(c){this.writeScreen.setPAC(c)},T.setBkgData=function(c){this.writeScreen.setBkgData(c)},T.setMode=function(c){if(c===this.mode)return;this.mode=c,this.logger.log(u.INFO,"MODE="+c),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=c},T.insertChars=function(c){for(var w=0;w<c.length;w++)this.writeScreen.insertChar(c[w]);var v=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(u.INFO,v+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(u.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},T.ccRCL=function(){this.logger.log(u.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},T.ccBS=function(){if(this.logger.log(u.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(u.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},T.ccRU=function(c){this.logger.log(u.INFO,"RU("+c+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(c)},T.ccFON=function(){this.logger.log(u.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},T.ccRDC=function(){this.logger.log(u.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},T.ccTR=function(){this.logger.log(u.INFO,"TR"),this.setMode("MODE_TEXT")},T.ccRTD=function(){this.logger.log(u.INFO,"RTD"),this.setMode("MODE_TEXT")},T.ccEDM=function(){this.logger.log(u.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},T.ccCR=function(){this.logger.log(u.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},T.ccENM=function(){this.logger.log(u.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},T.ccEOC=function(){if(this.logger.log(u.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var c=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=c,this.writeScreen=this.nonDisplayedMemory,this.logger.log(u.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},T.ccTO=function(c){this.logger.log(u.INFO,"TO("+c+") - Tab Offset"),this.writeScreen.moveCursor(c)},T.ccMIDROW=function(c){var w={flash:!1};if(w.underline=c%2===1,w.italics=c>=46,w.italics)w.foreground="white";else{var v=Math.floor(c/2)-16,y=["white","green","blue","cyan","red","yellow","magenta"];w.foreground=y[v]}this.logger.log(u.INFO,"MIDROW: "+JSON.stringify(w)),this.writeScreen.setPen(w)},T.outputDataUpdate=function(c){c===void 0&&(c=!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),c&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:w),this.lastOutputScreen.copy(this.displayedMemory))},T.cueSplitAtTime=function(c){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,c,this.displayedMemory),this.cueStartTime=c))},C}(),E=function(){function C(x,c,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,c,v),new A(x+1,w,v)],this.cmdHistory=O(),this.logger=v}var T=C.prototype;return T.getHandler=function(c){return this.channels[c].getHandler()},T.setHandler=function(c,w){this.channels[c].setHandler(w)},T.addData=function(c,w){var v,y,F,B=!1;this.logger.time=c;for(var R=0;R<w.length;R+=2){if(y=w[R]&127,F=w[R+1]&127,y===0&&F===0)continue;if(this.logger.log(u.DATA,"["+f([w[R],w[R+1]])+"] -> ("+f([y,F])+")"),v=this.parseCmd(y,F),v||(v=this.parseMidrow(y,F)),v||(v=this.parsePAC(y,F)),v||(v=this.parseBackgroundAttributes(y,F)),!v&&(B=this.parseChars(y,F),B)){var j=this.currentChannel;if(j&&j>0){var N=this.channels[j];N.insertChars(B)}else this.logger.log(u.WARNING,"No channel found yet. TEXT-MODE?")}!v&&!B&&this.logger.log(u.WARNING,"Couldn't parse cleaned data "+f([y,F])+" orig: "+f([w[R],w[R+1]]))}},T.parseCmd=function(c,w){var v=this.cmdHistory,y=(c===20||c===28||c===21||c===29)&&w>=32&&w<=47,F=(c===23||c===31)&&w>=33&&w<=35;if(!(y||F))return!1;if(L(c,w,v))return S(null,null,v),this.logger.log(u.DEBUG,"Repeated command ("+f([c,w])+") is dropped"),!0;var B=c===20||c===21||c===23?1:2,R=this.channels[B];return c===20||c===21||c===28||c===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(c,w,v),this.currentChannel=B,!0},T.parseMidrow=function(c,w){var v=0;if((c===17||c===25)&&w>=32&&w<=47){if(c===17?v=1:v=2,v!==this.currentChannel)return this.logger.log(u.ERROR,"Mismatch channel in midrow parsing"),!1;var y=this.channels[v];return y?(y.ccMIDROW(w),this.logger.log(u.DEBUG,"MIDROW ("+f([c,w])+")"),!0):!1}return!1},T.parsePAC=function(c,w){var v,y=this.cmdHistory,F=(c>=17&&c<=23||c>=25&&c<=31)&&w>=64&&w<=127,B=(c===16||c===24)&&w>=64&&w<=95;if(!(F||B))return!1;if(L(c,w,y))return S(null,null,y),!0;var R=c<=23?1:2;w>=64&&w<=95?v=R===1?n[c]:g[c]:v=R===1?D[c]:p[c];var j=this.channels[R];return j?(j.setPAC(this.interpretPAC(v,w)),S(c,w,y),this.currentChannel=R,!0):!1},T.interpretPAC=function(c,w){var v,y={color:null,italics:!1,indent:null,underline:!1,row:c};return w>95?v=w-96:v=w-64,y.underline=(v&1)===1,v<=13?y.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(v/2)]:v<=15?(y.italics=!0,y.color="white"):y.indent=Math.floor((v-16)/2)*4,y},T.parseChars=function(c,w){var v,y=null,F=null;if(c>=25?(v=2,F=c-8):(v=1,F=c),F>=17&&F<=19){var B;F===17?B=w+80:F===18?B=w+112:B=w+144,this.logger.log(u.INFO,"Special char '"+k(B)+"' in channel "+v),y=[B]}else c>=32&&c<=127&&(y=w===0?[c]:[c,w]);if(y){var R=f(y);this.logger.log(u.DEBUG,"Char codes = "+R.join(",")),S(c,w,this.cmdHistory)}return y},T.parseBackgroundAttributes=function(c,w){var v=(c===16||c===24)&&w>=32&&w<=47,y=(c===23||c===31)&&w>=45&&w<=47;if(!(v||y))return!1;var F,B={};c===16||c===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=c<=23?1:2,j=this.channels[R];return j.setBkgData(B),S(c,w,this.cmdHistory),!0},T.reset=function(){for(var c=0;c<Object.keys(this.channels).length;c++){var w=this.channels[c];w&&w.reset()}this.cmdHistory=O()},T.cueSplitAtTime=function(c){for(var w=0;w<this.channels.length;w++){var v=this.channels[w];v&&v.cueSplitAtTime(c)}},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,W){var n=X[W];return!!n&&n[G.slice(0,4)]===!0}function k(G,W){return MediaSource.isTypeSupported((W||"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/,W={newCue:function(D,g,p,m){for(var u=[],o,f,l,h,a,s=self.VTTCue||self.TextTrackCue,A=0;A<m.rows.length;A++)if(o=m.rows[A],l=!0,h=0,a="",!o.isEmpty()){for(var E=0;E<o.chars.length;E++)G.test(o.chars[E].uchar)&&l?h++:(a+=o.chars[E].uchar,l=!1);o.cueStartTime=g,g===p&&(p+=1e-4),h>=16?h--:h++;var S=Object(X.fixLineBreaks)(a.trim()),L=Object(U.generateCueId)(g,p,S);(!D||!D.cues||!D.cues.getCueById(L))&&(f=new s(g,p,S),f.id=L,f.line=A+1,f.align="left",f.position=10+Math.min(80,Math.floor(h*8/32)*10),u.push(f))}return D&&u.length&&(u.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}),u.forEach(function(O){return Object(k.addCueToTrack)(D,O)})),u}};$.default=W},"./src/utils/discontinuities.ts":function(re,$,P){"use strict";P.r($),P.d($,"findFirstFragWithCC",function(){return G}),P.d($,"shouldAlignOnDiscontinuities",function(){return W}),P.d($,"findDiscontinuousReferenceFrag",function(){return n}),P.d($,"adjustSlidingStart",function(){return g}),P.d($,"alignStream",function(){return p}),P.d($,"alignPDT",function(){return u}),P.d($,"alignFragmentByPDTDelta",function(){return o}),P.d($,"alignMediaPlaylistByPDT",function(){return f});var X=P("./src/polyfills/number.ts"),U=P("./src/utils/logger.ts"),k=P("./src/controller/level-helper.ts");function G(l,h){for(var a=null,s=0,A=l.length;s<A;s++){var E=l[s];if(E&&E.cc===h){a=E;break}}return a}function W(l,h,a){return!!(h.details&&(a.endCC>a.startCC||l&&l.cc<a.startCC))}function n(l,h){var a=l.fragments,s=h.fragments;if(!s.length||!a.length){U.logger.log("No fragments to align");return}var A=G(a,s[0].cc);if(!A||A&&!A.startPTS){U.logger.log("No frag in previous level to align on");return}return A}function D(l,h){if(l){var a=l.start+h;l.start=l.startPTS=a,l.endPTS=a+l.duration}}function g(l,h){for(var a=h.fragments,s=0,A=a.length;s<A;s++)D(a[s],l);h.fragmentHint&&D(h.fragmentHint,l),h.alignedSliding=!0}function p(l,h,a){if(!h)return;m(l,a,h),!a.alignedSliding&&h.details&&u(a,h.details),!a.alignedSliding&&h.details&&!a.skippedSegments&&Object(k.adjustSliding)(h.details,a)}function m(l,h,a){if(W(l,a,h)){var s=n(a.details,h);s&&Object(X.isFiniteNumber)(s.start)&&(U.logger.log("Adjusting PTS using last level due to CC increase within current level "+h.url),g(s.start,h))}}function u(l,h){if(!h.fragments.length||!l.hasProgramDateTime||!h.hasProgramDateTime)return;var a=h.fragments[0].programDateTime,s=l.fragments[0].programDateTime,A=(s-a)/1e3+h.fragments[0].start;A&&Object(X.isFiniteNumber)(A)&&(U.logger.log("Adjusting PTS using programDateTime delta "+(s-a)+"ms, sliding:"+A.toFixed(3)+" "+l.url+" "),g(A,l))}function o(l,h){var a=l.programDateTime;if(!a)return;var s=(a-h)/1e3;l.start=l.startPTS=s,l.endPTS=s+l.duration}function f(l,h){if(!h.fragments.length||!l.hasProgramDateTime||!h.hasProgramDateTime)return;var a=h.fragments[0].programDateTime,s=h.fragments[0].start,A=a-s*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(W,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(W),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,W,n){W===void 0&&(W=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_=W,this.totalWeight_=n}var k=U.prototype;return k.sample=function(W,n){var D=Math.pow(this.alpha_,W);this.estimate_=n*(1-D)+D*this.estimate_,this.totalWeight_+=W},k.getTotalWeight=function(){return this.totalWeight_},k.getEstimate=function(){if(this.alpha_){var W=1-Math.pow(this.alpha_,this.totalWeight_);if(W)return this.estimate_/W}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(s,A){s.prototype=Object.create(A.prototype),s.prototype.constructor=s,p(s,A)}function W(s){var A=typeof Map=="function"?new Map:void 0;return W=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)},W(s)}function n(s,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),c=new x;return C&&p(c,C.prototype),c},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(s){return!1}}function g(s){return Function.toString.call(s).indexOf("[native code]")!==-1}function p(s,A){return p=Object.setPrototypeOf||function(S,L){return S.__proto__=L,S},p(s,A)}function m(s){return m=Object.setPrototypeOf?Object.getPrototypeOf:function(E){return E.__proto__||Object.getPrototypeOf(E)},m(s)}function u(){return u=Object.assign||function(s){for(var A=1;A<arguments.length;A++){var E=arguments[A];for(var S in E)Object.prototype.hasOwnProperty.call(E,S)&&(s[S]=E[S])}return s},u.apply(this,arguments)}function o(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(s){}return!1}var f=function(){function s(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||h,this.controller=new self.AbortController,this.stats=new U.LoadStats}var A=s.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),c=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(y){if(C.response=C.loader=y,!y.ok){var F=y.status,B=y.statusText;throw new a(B||"fetch, bad network response",F,y)}return T.loading.first=Math.max(self.performance.now(),T.loading.start),T.total=parseInt(y.headers.get("Content-Length")||"0"),c&&Object(X.isFiniteNumber)(L.highWaterMark)?C.loadProgressively(y,T,S,L.highWaterMark,c):w?y.arrayBuffer():y.text()}).then(function(y){var F=C.response;self.clearTimeout(C.requestTimeout),T.loading.end=Math.max(self.performance.now(),T.loading.first),T.loaded=T.total=y[v];var B={url:F.url,data:y};c&&!Object(X.isFiniteNumber)(L.highWaterMark)&&c(T,S,y,F),O.onSuccess(B,T,S,F)}).catch(function(y){if(self.clearTimeout(C.requestTimeout),T.aborted)return;var F=y.code||0;O.onError({code:F,text:y.message},S,y.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,c=S.body.getReader(),w=function v(){return c.read().then(function(y){if(y.done)return x.dataLength&&T(L,O,x.flush(),S),Promise.resolve(new ArrayBuffer(0));var F=y.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()},s}();function l(s,A){var E={method:"GET",mode:"cors",credentials:"same-origin",signal:A,headers:new self.Headers(u({},s.headers))};return s.rangeEnd&&E.headers.set("Range","bytes="+s.rangeStart+"-"+String(s.rangeEnd-1)),E}function h(s,A){return new self.Request(s.url,A)}var a=function(s){G(A,s);function A(E,S,L){var O;return O=s.call(this,E)||this,O.code=void 0,O.details=void 0,O.code=S,O.details=L,O}return A}(W(Error));$.default=f},"./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"),W=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 c in x)Object.prototype.hasOwnProperty.call(x,c)&&(C[c]=x[c])}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)$/,u={left:"start",center:"center",right:"end",start:"start",end:"end"};function o(C,T,x,c,w){var v=Object(X.findBox)(new Uint8Array(C),["mdat"]);if(v.length===0){w(new Error("Could not parse IMSC1 mdat"));return}var y=v[0],F=Object(G.utf8ArrayToStr)(new Uint8Array(C,y.start,y.end-y.start)),B=Object(W.toTimescaleFromScale)(T,1,x);try{c(f(F,B))}catch(R){w(R)}}function f(C,T){var x=new DOMParser,c=x.parseFromString(C,"text/xml"),w=c.getElementsByTagName("tt")[0];if(!w)throw new Error("Invalid ttml");var v={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},y=Object.keys(v).reduce(function(N,b){return N[b]=w.getAttribute("ttp:"+b)||v[b],N},{}),F=w.getAttribute("xml:space")!=="preserve",B=h(l(w,"styling","style")),R=h(l(w,"layout","region")),j=l(w,"body","[begin]");return[].map.call(j,function(N){var b=a(N,F);if(!b||!N.hasAttribute("begin"))return null;var Y=S(N.getAttribute("begin"),y),ee=S(N.getAttribute("dur"),y),ae=S(N.getAttribute("end"),y);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,b);ue.id=Object(n.generateCueId)(ue.startTime,ue.endTime,ue.text);var Oe=R[N.getAttribute("region")],Ee=B[N.getAttribute("style")];ue.position=10,ue.size=80;var xe=s(Oe,Ee),Ae=xe.textAlign;if(Ae){var Re=u[Ae];Re&&(ue.lineAlign=Re),ue.align=Ae}return D(ue,xe),ue}).filter(function(N){return N!==null})}function l(C,T,x){var c=C.getElementsByTagName(T)[0];return c?[].slice.call(c.querySelectorAll(x)):[]}function h(C){return C.reduce(function(T,x){var c=x.getAttribute("xml:id");return c&&(T[c]=x),T},{})}function a(C,T){return[].slice.call(C.childNodes).reduce(function(x,c,w){var v;return c.nodeName==="br"&&w?x+`
|
|
`:(v=c.childNodes)!==null&&v!==void 0&&v.length?a(c,T):T?x+c.textContent.trim().replace(/\s+/g," "):x+c.textContent},"")}function s(C,T){var x="http://www.w3.org/ns/ttml#styling",c=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return c.reduce(function(w,v){var y=A(T,x,v)||A(C,x,v);return y&&(w[v]=y),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),c=(x[4]|0)+(x[5]|0)/T.subFrameRate;return(x[1]|0)*3600+(x[2]|0)*60+(x[3]|0)+c/T.frameRate}function O(C,T){var x=m.exec(C),c=Number(x[1]),w=x[2];switch(w){case"h":return c*3600;case"m":return c*60;case"ms":return c*1e3;case"f":return c/T.frameRate;case"t":return c/T.tickRate}return c}},"./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 W(g){for(var p=arguments.length,m=new Array(p>1?p-1:0),u=1;u<p;u++)m[u-1]=arguments[u];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"){W(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 W}),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 u}),P.d($,"getStartDTS",function(){return o}),P.d($,"getDuration",function(){return f}),P.d($,"computeRawDurationFromSamples",function(){return l}),P.d($,"offsetStartDTS",function(){return h}),P.d($,"segmentValidRange",function(){return a}),P.d($,"appendUint8Array",function(){return s});var X=P("./src/utils/typed-array.ts"),U=P("./src/loader/fragment.ts"),k=Math.pow(2,32)-1,G=[].push;function W(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),c=W(L.subarray(T+4,T+8)),w=x>1?T+x:C;if(c===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],c=x===0?8:16,w=D(T,c);c+=4;var v=0,y=0;x===0?c+=8:c+=16,c+=2;var F=T.end+y,B=n(T,c);c+=2;for(var R=0;R<B;R++){var j=c,N=D(T,j);j+=4;var b=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:b,subsegmentDuration:ee,info:{duration:ee/w,start:F,end:F+b-1}}),F+=b,j+=4,c=j}return{earliestPresentationTime:v,timescale:w,version:x,referencesCount:B,references:C,moovEndOffset:L}}function u(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,c=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),y=p(O,["mdia","hdlr"])[0];if(y){var F=W(y.data.subarray(y.start+8,y.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=W(R.data.subarray(R.start+12,R.start+16))),E[c]={timescale:v,type:B},E[B]={timescale:v,id:c,codec:j}}}}}}var N=p(A,["moov","mvex","trex"]);return N.forEach(function(b){var Y=D(b,4),ee=E[Y];ee&&(ee.default={duration:D(b,12),flags:D(b,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,c){var w=D(c,4),v=A[w];if(v){var y=D(O,4);C===1&&(y*=Math.pow(2,32),y+=D(O,8));var F=v.timescale||9e4,B=y/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 f(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],c=p(x,["tfhd"])[0],w=D(c,4),v=E[w];if(!v)continue;var y=v.default,F=D(c,0)|(y==null?void 0:y.flags),B=y==null?void 0:y.duration;F&8&&(F&2?B=D(c,12):B=D(c,8));for(var R=v.timescale||9e4,j=p(x,["trun"]),N=0;N<j.length;N++){if(B){var b=D(j[N],4);S=B*b}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 h(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(c){var w=c.data[c.start],v=D(c,4);if(w===0)g(c,4,v-S*x);else{v*=Math.pow(2,32),v+=D(c,8),v-=S*x,v=Math.max(v,0);var y=Math.floor(v/(k+1)),F=Math.floor(v%(k+1));g(c,4,y),g(c,8,F)}})})})}function a(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 s(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,W){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=G,this.trackName=W}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(W,n,D){(this.startTime===null||this.startTime>W)&&(this.startTime=W),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 W}),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(u){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 u=new self.TextTrackCue(p.startTime,p.endTime,p.text);u.id=p.id,g.addCue(u)}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 W(g,p,m){var u=g.mode;if(u==="disabled"&&(g.mode="hidden"),g.cues&&g.cues.length>0)for(var o=D(g.cues,p,m),f=0;f<o.length;f++)g.removeCue(o[f]);u==="disabled"&&(g.mode=u)}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 u=0,o=m;u<=o;){var f=Math.floor((o+u)/2);if(p<g[f].startTime)o=f-1;else if(p>g[f].startTime&&u<m)u=f+1;else return f}return g[u].startTime-p<p-g[o].startTime?u:o}function D(g,p,m){var u=[],o=n(g,p);if(o>-1)for(var f=o,l=g.length;f<l;f++){var h=g[f];if(h.startTime>=p&&h.endTime<=m)u.push(h);else if(h.startTime>m)return u}return u}},"./src/utils/time-ranges.ts":function(re,$,P){"use strict";P.r($);var X={toString:function(k){for(var G="",W=k.length,n=0;n<W;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 W});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 W(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 W(g){return k(U,g)}function n(g){for(var p=arguments.length,m=new Array(p>1?p-1:0),u=1;u<p;u++)m[u-1]=arguments[u];for(var o=1;o<arguments.length;o++){var f=arguments[o];for(var l in f)g[l]=f[l]}return g}function D(g,p,m){var u=this,o={enumerable:!0};u.hasBeenReset=!1;var f="",l=!1,h=g,a=p,s=m,A=null,E="",S=!0,L="auto",O="start",C=50,T="middle",x=50,c="middle";Object.defineProperty(u,"id",n({},o,{get:function(){return f},set:function(v){f=""+v}})),Object.defineProperty(u,"pauseOnExit",n({},o,{get:function(){return l},set:function(v){l=!!v}})),Object.defineProperty(u,"startTime",n({},o,{get:function(){return h},set:function(v){if(typeof v!="number")throw new TypeError("Start time must be set to a number.");h=v,this.hasBeenReset=!0}})),Object.defineProperty(u,"endTime",n({},o,{get:function(){return a},set:function(v){if(typeof v!="number")throw new TypeError("End time must be set to a number.");a=v,this.hasBeenReset=!0}})),Object.defineProperty(u,"text",n({},o,{get:function(){return s},set:function(v){s=""+v,this.hasBeenReset=!0}})),Object.defineProperty(u,"region",n({},o,{get:function(){return A},set:function(v){A=v,this.hasBeenReset=!0}})),Object.defineProperty(u,"vertical",n({},o,{get:function(){return E},set:function(v){var y=G(v);if(y===!1)throw new SyntaxError("An invalid or illegal string was specified.");E=y,this.hasBeenReset=!0}})),Object.defineProperty(u,"snapToLines",n({},o,{get:function(){return S},set:function(v){S=!!v,this.hasBeenReset=!0}})),Object.defineProperty(u,"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(u,"lineAlign",n({},o,{get:function(){return O},set:function(v){var y=W(v);if(!y)throw new SyntaxError("An invalid or illegal string was specified.");O=y,this.hasBeenReset=!0}})),Object.defineProperty(u,"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(u,"positionAlign",n({},o,{get:function(){return T},set:function(v){var y=W(v);if(!y)throw new SyntaxError("An invalid or illegal string was specified.");T=y,this.hasBeenReset=!0}})),Object.defineProperty(u,"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(u,"align",n({},o,{get:function(){return c},set:function(v){var y=W(v);if(!y)throw new SyntaxError("An invalid or illegal string was specified.");c=y,this.hasBeenReset=!0}})),u.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 u(){}var o=u.prototype;return o.decode=function(l,h){if(!l)return"";if(typeof l!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(l))},u}();function k(u){function o(l,h,a,s){return(l|0)*3600+(h|0)*60+(a|0)+parseFloat(s||0)}var f=u.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return f?parseFloat(f[2])>59?o(f[2],f[3],0,f[4]):o(f[1],f[2],f[3],f[4]):null}var G=function(){function u(){this.values=Object.create(null)}var o=u.prototype;return o.set=function(l,h){!this.get(l)&&h!==""&&(this.values[l]=h)},o.get=function(l,h,a){return a?this.has(l)?this.values[l]:h[a]:this.has(l)?this.values[l]:h},o.has=function(l){return l in this.values},o.alt=function(l,h,a){for(var s=0;s<a.length;++s)if(h===a[s]){this.set(l,h);break}},o.integer=function(l,h){/^-?\d+$/.test(h)&&this.set(l,parseInt(h,10))},o.percent=function(l,h){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(h)){var a=parseFloat(h);if(a>=0&&a<=100)return this.set(l,a),!0}return!1},u}();function W(u,o,f,l){var h=l?u.split(l):[u];for(var a in h){if(typeof h[a]!="string")continue;var s=h[a].split(f);if(s.length!==2)continue;var A=s[0],E=s[1];o(A,E)}}var n=new X.default(0,0,""),D=n.align==="middle"?"middle":"center";function g(u,o,f){var l=u;function h(){var A=k(u);if(A===null)throw new Error("Malformed timestamp: "+l);return u=u.replace(/^[^\sa-zA-Z-]+/,""),A}function a(A,E){var S=new G;W(A,function(C,T){var x;switch(C){case"region":for(var c=f.length-1;c>=0;c--)if(f[c].id===T){S.set(C,f[c].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 s(){u=u.replace(/^\s+/,"")}if(s(),o.startTime=h(),s(),u.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+l);u=u.substr(3),s(),o.endTime=h(),s(),a(u,o)}function p(u){return u.replace(/<br(?: \/)?>/gi,`
|
|
`)}var m=function(){function u(){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=u.prototype;return o.parse=function(l){var h=this;l&&(h.buffer+=h.decoder.decode(l,{stream:!0}));function a(){var O=h.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,h.buffer=O.substr(C),T}function s(O){W(O,function(C,T){},/:/)}try{var A="";if(h.state==="INITIAL"){if(!/\r\n|\n/.test(h.buffer))return this;A=a();var E=A.match(/^()?WEBVTT([ \t].*)?$/);if(!E||!E[0])throw new Error("Malformed WebVTT signature.");h.state="HEADER"}for(var S=!1;h.buffer;){if(!/\r\n|\n/.test(h.buffer))return this;S?S=!1:A=a();switch(h.state){case"HEADER":/:/.test(A)?s(A):A||(h.state="ID");continue;case"NOTE":A||(h.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(A)){h.state="NOTE";break}if(!A)continue;if(h.cue=new X.default(0,0,""),h.state="CUE",A.indexOf("-->")===-1){h.cue.id=A;continue}case"CUE":if(!h.cue){h.state="BADCUE";continue}try{g(A,h.cue,h.regionList)}catch(O){h.cue=null,h.state="BADCUE";continue}h.state="CUETEXT";continue;case"CUETEXT":{var L=A.indexOf("-->")!==-1;if(!A||L&&(S=!0)){h.oncue&&h.cue&&h.oncue(h.cue),h.cue=null,h.state="ID";continue}if(h.cue===null)continue;h.cue.text&&(h.cue.text+=`
|
|
`),h.cue.text+=A}continue;case"BADCUE":A||(h.state="ID")}}}catch(O){h.state==="CUETEXT"&&h.cue&&h.oncue&&h.oncue(h.cue),h.cue=null,h.state=h.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(h){l.onparsingerror&&l.onparsingerror(h)}return l.onflush&&l.onflush(),this},u}()},"./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"),W=P("./src/remux/mp4-remuxer.ts"),n=/\r\n|\n\r|\n|\r/g,D=function(l,h,a){return a===void 0&&(a=0),l.substr(a,h.length)===h},g=function(l){var h=parseInt(l.substr(-3)),a=parseInt(l.substr(-6,2)),s=parseInt(l.substr(-9,2)),A=l.length>9?parseInt(l.substr(0,l.indexOf(":"))):0;if(!Object(X.isFiniteNumber)(h)||!Object(X.isFiniteNumber)(a)||!Object(X.isFiniteNumber)(s)||!Object(X.isFiniteNumber)(A))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+l);return h+=1e3*a,h+=60*1e3*s,h+=60*60*1e3*A,h},p=function(l){for(var h=5381,a=l.length;a;)h=h*33^l.charCodeAt(--a);return(h>>>0).toString()};function m(f,l,h){return p(f.toString())+p(l.toString())+p(h)}var u=function(l,h,a){var s=l[h],A=l[s.prevCC];if(!A||!A.new&&s.new){l.ccOffset=l.presentationOffset=s.start,s.new=!1;return}for(;(E=A)!==null&&E!==void 0&&E.new;){var E;l.ccOffset+=s.start-A.start,s.new=!1,s=A,A=l[s.prevCC]}l.presentationOffset=a};function o(f,l,h,a,s,A,E,S){var L=new U.VTTParser,O=Object(k.utf8ArrayToStr)(new Uint8Array(f)).trim().replace(n,`
|
|
`).split(`
|
|
`),C=[],T=Object(G.toMpegTsClockFromTimescale)(l,h),x="00:00.000",c=0,w=0,v,y=!0,F=!1;L.oncue=function(B){var R=a[s],j=a.ccOffset,N=(c-T)/9e4;if(R!=null&&R.new&&(w!==void 0?j=a.ccOffset=R.start:u(a,s,N)),N&&(j=N-a.presentationOffset),F){var b=B.endTime-B.startTime,Y=Object(W.normalizePts)((B.startTime+j-w)*9e4,A*9e4)/9e4;B.startTime=Y,B.endTime=Y+b}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(y)if(D(B,"X-TIMESTAMP-MAP=")){y=!1,F=!0,B.substr(16).split(",").forEach(function(R){D(R,"LOCAL:")?x=R.substr(6):D(R,"MPEGTS:")&&(c=parseInt(R.substr(7)))});try{w=g(x)/1e3}catch(R){F=!1,v=R}return}else B===""&&(y=!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 W(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=W.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,u=this.stats;u.loading.first=0,u.loaded=0;var o=this.xhrSetup;try{if(o)try{o(m,p.url)}catch(h){m.open("GET",p.url,!0),o(m,p.url)}m.readyState||m.open("GET",p.url,!0);var f=this.context.headers;if(f)for(var l in f)m.setRequestHeader(l,f[l])}catch(h){this.callbacks.onError({code:m.status,text:h.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 u=p.readyState,o=this.config;if(m.aborted)return;if(u>=2)if(self.clearTimeout(this.requestTimeout),m.loading.first===0&&(m.loading.first=Math.max(self.performance.now(),m.loading.start)),u===4){p.onreadystatechange=null,p.onprogress=null;var f=p.status;if(f>=200&&f<300){m.loading.end=Math.max(self.performance.now(),m.loading.first);var l,h;if(g.responseType==="arraybuffer"?(l=p.response,h=l.byteLength):(l=p.responseText,h=l.length),m.loaded=m.total=h,!this.callbacks)return;var a=this.callbacks.onProgress;if(a&&a(m,g,l,p),!this.callbacks)return;var s={url:p.responseURL,data:l};this.callbacks.onSuccess(s,m,g,p)}else m.retry>=o.maxRetry||f>=400&&f<499?(X.logger.error(f+" while loading "+g.url),this.callbacks.onError({code:f,text:p.statusText},g,p)):(X.logger.warn(f+" 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},W}();$.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"}}}]);
|