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.
445 lines
1.2 MiB
445 lines
1.2 MiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[284,5,6,7,9,12],{"+NIl":function(Ze,Se,q){(function(le){le(q("VrN/"))})(function(le){"use strict";le.defineMode("stex",function(Y,N){"use strict";function $(u,l){u.cmdState.push(l)}function H(u){return u.cmdState.length>0?u.cmdState[u.cmdState.length-1]:null}function M(u){var l=u.cmdState.pop();l&&l.closeBracket()}function K(u){for(var l=u.cmdState,d=l.length-1;d>=0;d--){var o=l[d];if(o.name=="DEFAULT")continue;return o}return{styleIdentifier:function(){return null}}}function G(u,l,d){return function(){this.name=u,this.bracketNo=0,this.style=l,this.styles=d,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=G("importmodule","tag",["string","builtin"]),n.documentclass=G("documentclass","tag",["","atom"]),n.usepackage=G("usepackage","tag",["atom"]),n.begin=G("begin","tag",["atom"]),n.end=G("end","tag",["atom"]),n.label=G("label","tag",["atom"]),n.ref=G("ref","tag",["atom"]),n.eqref=G("eqref","tag",["atom"]),n.cite=G("cite","tag",["atom"]),n.bibitem=G("bibitem","tag",["atom"]),n.Bibitem=G("Bibitem","tag",["atom"]),n.RBibitem=G("RBibitem","tag",["atom"]),n.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function O(u,l){u.f=l}function v(u,l){var d;if(u.match(/^\\[a-zA-Z@]+/)){var o=u.current().slice(1);return d=n.hasOwnProperty(o)?n[o]:n.DEFAULT,d=new d,$(l,d),O(l,m),d.style}if(u.match(/^\\[$&%#{}_]/))return"tag";if(u.match(/^\\[,;!\/\\]/))return"tag";if(u.match("\\["))return O(l,function(s,a){return p(s,a,"\\]")}),"keyword";if(u.match("\\("))return O(l,function(s,a){return p(s,a,"\\)")}),"keyword";if(u.match("$$"))return O(l,function(s,a){return p(s,a,"$$")}),"keyword";if(u.match("$"))return O(l,function(s,a){return p(s,a,"$")}),"keyword";var h=u.next();if(h=="%")return u.skipToEnd(),"comment";if(h=="}"||h=="]"){if(d=H(l),d)d.closeBracket(h),O(l,m);else return"error";return"bracket"}else return h=="{"||h=="["?(d=n.DEFAULT,d=new d,$(l,d),"bracket"):/\d/.test(h)?(u.eatWhile(/[\w.%]/),"atom"):(u.eatWhile(/[\w\-_]/),d=K(l),d.name=="begin"&&(d.argument=u.current()),d.styleIdentifier())}function p(u,l,d){if(u.eatSpace())return null;if(d&&u.match(d))return O(l,v),"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 o=u.next();return o=="{"||o=="}"||o=="["||o=="]"||o=="("||o==")"?"bracket":o=="%"?(u.skipToEnd(),"comment"):"error"}function m(u,l){var d=u.peek(),o;return d=="{"||d=="["?(o=H(l),o.openBracket(d),u.eat(d),O(l,v),"bracket"):/[ \t\r]/.test(d)?(u.eat(d),null):(O(l,v),M(l),v(u,l))}return{startState:function(){var u=N.inMathMode?function(l,d){return p(l,d)}:v;return{cmdState:[],f:u}},copyState:function(u){return{cmdState:u.cmdState.slice(),f:u.f}},token:function(u,l){return l.f(u,l)},blankLine:function(u){u.f=v,u.cmdState.length=0},lineComment:"%"}}),le.defineMIME("text/x-stex","stex"),le.defineMIME("text/x-latex","stex")})},"+ua5":function(Ze,Se,q){},"/cxE":function(Ze,Se,q){"use strict";q.d(Se,"f",function(){return N}),q.d(Se,"g",function(){return $}),q.d(Se,"h",function(){return H}),q.d(Se,"e",function(){return K}),q.d(Se,"b",function(){return G}),q.d(Se,"c",function(){return n}),q.d(Se,"d",function(){return O}),q.d(Se,"a",function(){return v});class le{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 Y=new le;function N(p){K(p)||Y.onUnexpectedError(p);return}function $(p){K(p)||Y.onUnexpectedExternalError(p);return}function H(p){if(p instanceof Error){let{name:m,message:u}=p;const l=p.stacktrace||p.stack;return{$isError:!0,name:m,message:u,stack:l}}return p}const M="Canceled";function K(p){return p instanceof Error&&p.name===M&&p.message===M}function G(){const p=new Error(M);return p.name=p.message,p}function n(p){return p?new Error(`Illegal argument: ${p}`):new Error("Illegal argument")}function O(p){return p?new Error(`Illegal state: ${p}`):new Error("Illegal state")}class v extends Error{constructor(p){super("NotSupported");p&&(this.message=p)}}},"19Vz":function(Ze,Se,q){(function(le){le(q("VrN/"))})(function(le){le.defineOption("placeholder","",function(G,n,O){var v=O&&O!=le.Init;if(n&&!v)G.on("blur",H),G.on("change",M),G.on("swapDoc",M),le.on(G.getInputField(),"compositionupdate",G.state.placeholderCompose=function(){$(G)}),M(G);else if(!n&&v){G.off("blur",H),G.off("change",M),G.off("swapDoc",M),le.off(G.getInputField(),"compositionupdate",G.state.placeholderCompose),Y(G);var p=G.getWrapperElement();p.className=p.className.replace(" CodeMirror-empty","")}n&&!G.hasFocus()&&H(G)});function Y(G){G.state.placeholder&&(G.state.placeholder.parentNode.removeChild(G.state.placeholder),G.state.placeholder=null)}function N(G){Y(G);var n=G.state.placeholder=document.createElement("pre");n.style.cssText="height: 0; overflow: visible",n.style.direction=G.getOption("direction"),n.className="CodeMirror-placeholder CodeMirror-line-like";var O=G.getOption("placeholder");typeof O=="string"&&(O=document.createTextNode(O)),n.appendChild(O),G.display.lineSpace.insertBefore(n,G.display.lineSpace.firstChild)}function $(G){setTimeout(function(){var n=!1,O=G.getInputField();O.nodeName=="TEXTAREA"?n=!O.value:G.lineCount()==1&&(n=!/[^\u200b]/.test(O.querySelector(".CodeMirror-line").textContent)),n?N(G):Y(G)},20)}function H(G){K(G)&&N(G)}function M(G){var n=G.getWrapperElement(),O=K(G);n.className=n.className.replace(" CodeMirror-empty","")+(O?" CodeMirror-empty":""),O?N(G):Y(G)}function K(G){return G.lineCount()===1&&G.getLine(0)===""}})},"1eCo":function(Ze,Se,q){(function(le){le(q("VrN/"))})(function(le){"use strict";var Y={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},N={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};le.defineMode("xml",function($,H){var M=$.indentUnit,K={},G=H.htmlMode?Y:N;for(var n in G)K[n]=G[n];for(var n in H)K[n]=H[n];var O,v;function p(f,w){function y(U){return w.tokenize=U,U(f,w)}var _=f.next();if(_=="<")return f.eat("!")?f.eat("[")?f.match("CDATA[")?y(l("atom","]]>")):null:f.match("--")?y(l("comment","-->")):f.match("DOCTYPE",!0,!0)?(f.eatWhile(/[\w\._\-]/),y(d(1))):null:f.eat("?")?(f.eatWhile(/[\w\._\-]/),w.tokenize=l("meta","?>"),"meta"):(O=f.eat("/")?"closeTag":"openTag",w.tokenize=m,"tag bracket");if(_=="&"){var j;return f.eat("#")?f.eat("x")?j=f.eatWhile(/[a-fA-F\d]/)&&f.eat(";"):j=f.eatWhile(/[\d]/)&&f.eat(";"):j=f.eatWhile(/[\w\.\-:]/)&&f.eat(";"),j?"atom":"error"}else return f.eatWhile(/[^&<]/),null}p.isInText=!0;function m(f,w){var y=f.next();if(y==">"||y=="/"&&f.eat(">"))return w.tokenize=p,O=y==">"?"endTag":"selfcloseTag","tag bracket";if(y=="=")return O="equals",null;if(y=="<"){w.tokenize=p,w.state=a,w.tagName=w.tagStart=null;var _=w.tokenize(f,w);return _?_+" tag error":"tag error"}else return/[\'\"]/.test(y)?(w.tokenize=u(y),w.stringStartCol=f.column(),w.tokenize(f,w)):(f.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function u(f){var w=function(y,_){for(;!y.eol();)if(y.next()==f){_.tokenize=m;break}return"string"};return w.isInAttribute=!0,w}function l(f,w){return function(y,_){for(;!y.eol();){if(y.match(w)){_.tokenize=p;break}y.next()}return f}}function d(f){return function(w,y){for(var _;(_=w.next())!=null;){if(_=="<")return y.tokenize=d(f+1),y.tokenize(w,y);if(_==">")if(f==1){y.tokenize=p;break}else return y.tokenize=d(f-1),y.tokenize(w,y)}return"meta"}}function o(f,w,y){this.prev=f.context,this.tagName=w,this.indent=f.indented,this.startOfLine=y,(K.doNotIndent.hasOwnProperty(w)||f.context&&f.context.noIndent)&&(this.noIndent=!0)}function h(f){f.context&&(f.context=f.context.prev)}function s(f,w){for(var y;;){if(!f.context)return;if(y=f.context.tagName,!K.contextGrabbers.hasOwnProperty(y)||!K.contextGrabbers[y].hasOwnProperty(w))return;h(f)}}function a(f,w,y){return f=="openTag"?(y.tagStart=w.column(),A):f=="closeTag"?E:a}function A(f,w,y){return f=="word"?(y.tagName=w.current(),v="tag",L):K.allowMissingTagName&&f=="endTag"?(v="tag bracket",L(f,w,y)):(v="error",A)}function E(f,w,y){if(f=="word"){var _=w.current();return y.context&&y.context.tagName!=_&&K.implicitlyClosed.hasOwnProperty(y.context.tagName)&&h(y),y.context&&y.context.tagName==_||K.matchClosing===!1?(v="tag",T):(v="tag error",k)}else return K.allowMissingTagName&&f=="endTag"?(v="tag bracket",T(f,w,y)):(v="error",k)}function T(f,w,y){return f!="endTag"?(v="error",T):(h(y),a)}function k(f,w,y){return v="error",T(f,w,y)}function L(f,w,y){if(f=="word")return v="attribute",S;if(f=="endTag"||f=="selfcloseTag"){var _=y.tagName,j=y.tagStart;return y.tagName=y.tagStart=null,f=="selfcloseTag"||K.autoSelfClosers.hasOwnProperty(_)?s(y,_):(s(y,_),y.context=new o(y,_,j==y.indented)),a}return v="error",L}function S(f,w,y){return f=="equals"?R:(K.allowMissing||(v="error"),L(f,w,y))}function R(f,w,y){return f=="string"?C:f=="word"&&K.allowUnquoted?(v="string",L):(v="error",L(f,w,y))}function C(f,w,y){return f=="string"?C:L(f,w,y)}return{startState:function(f){var w={tokenize:p,state:a,indented:f||0,tagName:null,tagStart:null,context:null};return f!=null&&(w.baseIndent=f),w},token:function(f,w){if(!w.tagName&&f.sol()&&(w.indented=f.indentation()),f.eatSpace())return null;O=null;var y=w.tokenize(f,w);return(y||O)&&y!="comment"&&(v=null,w.state=w.state(O||y,f,w),v&&(y=v=="error"?y+" error":v)),y},indent:function(f,w,y){var _=f.context;if(f.tokenize.isInAttribute)return f.tagStart==f.indented?f.stringStartCol+1:f.indented+M;if(_&&_.noIndent)return le.Pass;if(f.tokenize!=m&&f.tokenize!=p)return y?y.match(/^(\s*)/)[0].length:0;if(f.tagName)return K.multilineTagIndentPastTag!==!1?f.tagStart+f.tagName.length+2:f.tagStart+M*(K.multilineTagIndentFactor||1);if(K.alignCDATA&&/<!\[CDATA\[/.test(w))return 0;var j=w&&/^<(\/)?([\w_:\.-]*)/.exec(w);if(j&&j[1])for(;_;)if(_.tagName==j[2]){_=_.prev;break}else if(K.implicitlyClosed.hasOwnProperty(_.tagName))_=_.prev;else break;else if(j)for(;_;){var U=K.contextGrabbers[_.tagName];if(U&&U.hasOwnProperty(j[2]))_=_.prev;else break}for(;_&&_.prev&&!_.startOfLine;)_=_.prev;return _?_.indent+M:f.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:K.htmlMode?"html":"xml",helperType:K.htmlMode?"html":"xml",skipAttribute:function(f){f.state==R&&(f.state=L)},xmlCurrentTag:function(f){return f.tagName?{name:f.tagName,close:f.type=="closeTag"}:null},xmlCurrentContext:function(f){for(var w=[],y=f.context;y;y=y.prev)y.tagName&&w.push(y.tagName);return w.reverse()}}}),le.defineMIME("text/xml","xml"),le.defineMIME("application/xml","xml"),le.mimeModes.hasOwnProperty("text/html")||le.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"24hK":function(Ze,Se,q){"use strict";q.d(Se,"a",function(){return Y});class le{constructor(N){this.element=N,this.next=le.Undefined,this.prev=le.Undefined}}le.Undefined=new le(void 0);class Y{constructor(){this._first=le.Undefined,this._last=le.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===le.Undefined}clear(){let N=this._first;for(;N!==le.Undefined;){const $=N.next;N.prev=le.Undefined,N.next=le.Undefined,N=$}this._first=le.Undefined,this._last=le.Undefined,this._size=0}unshift(N){return this._insert(N,!1)}push(N){return this._insert(N,!0)}_insert(N,$){const H=new le(N);if(this._first===le.Undefined)this._first=H,this._last=H;else if($){const K=this._last;this._last=H,H.prev=K,K.next=H}else{const K=this._first;this._first=H,H.next=K,K.prev=H}this._size+=1;let M=!1;return()=>{M||(M=!0,this._remove(H))}}shift(){if(this._first===le.Undefined)return;{const N=this._first.element;return this._remove(this._first),N}}pop(){if(this._last===le.Undefined)return;{const N=this._last.element;return this._remove(this._last),N}}_remove(N){if(N.prev!==le.Undefined&&N.next!==le.Undefined){const $=N.prev;$.next=N.next,N.next.prev=$}else N.prev===le.Undefined&&N.next===le.Undefined?(this._first=le.Undefined,this._last=le.Undefined):N.next===le.Undefined?(this._last=this._last.prev,this._last.next=le.Undefined):N.prev===le.Undefined&&(this._first=this._first.next,this._first.prev=le.Undefined);this._size-=1}*[Symbol.iterator](){let N=this._first;for(;N!==le.Undefined;)yield N.element,N=N.next}}},"3/fG":function(Ze,Se,q){"use strict";q.d(Se,"a",function(){return Y});function le(N,$){let H;return $.length===0?H=N:H=N.replace(/\{(\d+)\}/g,function(M,K){const G=K[0];return typeof $[G]!="undefined"?$[G]:M}),H}function Y(N,$,...H){return le($,H)}},"5VLF":function(Ze,Se,q){"use strict";var le,Y;function N($,H,M){var K=function(G,n){return $.js_beautify(G,n)};return K.js=$.js_beautify,K.css=H.css_beautify,K.html=M.html_beautify,K.js_beautify=$.js_beautify,K.css_beautify=H.css_beautify,K.html_beautify=M.html_beautify,K}!(le=[q("6UM0"),q("TXwP"),q("psGv")],Y=function($,H,M){return N($,H,M)}.apply(Se,le),Y!==void 0&&(Ze.exports=Y))},"5Y4S":function(Ze,Se,q){"use strict";q.d(Se,"a",function(){return N});var le=q("MNsG");const Y=le.b.performance&&typeof le.b.performance.now=="function";class N{constructor($){this._highResolution=Y&&$,this._startTime=this._now(),this._stopTime=-1}static create($=!0){return new N($)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?le.b.performance.now():Date.now()}}},"6UM0":function(Ze,Se,q){var le,Y;(function(){var N;(function(){"use strict";var H=[function(n,O,v){var p=v(1).Beautifier,m=v(5).Options;function u(l,d){var o=new p(l,d);return o.beautify()}n.exports=u,n.exports.defaultOptions=function(){return new m}},function(n,O,v){var p=v(2).Output,m=v(3).Token,u=v(4),l=v(5).Options,d=v(7).Tokenizer,o=v(7).line_starters,h=v(7).positionable_operators,s=v(7).TOKEN;function a(g,W){return W.indexOf(g)!==-1}function A(g){return g.replace(/^\s+/g,"")}function E(g){for(var W={},J=0;J<g.length;J++)W[g[J].replace(/-/g,"_")]=g[J];return W}function T(g,W){return g&&g.type===s.RESERVED&&g.text===W}function k(g,W){return g&&g.type===s.RESERVED&&a(g.text,W)}var L=["case","return","do","if","throw","else","await","break","continue","async"],S=["before-newline","after-newline","preserve-newline"],R=E(S),C=[R.before_newline,R.preserve_newline],f={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function w(g,W){if(W.multiline_frame||W.mode===f.ForInitializer||W.mode===f.Conditional)return;g.remove_indent(W.start_line_index)}function y(g){g=g.replace(u.allLineBreaks,`
|
|
`);for(var W=[],J=g.indexOf(`
|
|
`);J!==-1;)W.push(g.substring(0,J)),g=g.substring(J+1),J=g.indexOf(`
|
|
`);return g.length&&W.push(g),W}function _(g){return g===f.ArrayLiteral}function j(g){return a(g,[f.Expression,f.ForInitializer,f.Conditional])}function U(g,W){for(var J=0;J<g.length;J++){var oe=g[J].trim();if(oe.charAt(0)!==W)return!1}return!0}function x(g,W){for(var J=0,oe=g.length,fe;J<oe;J++)if(fe=g[J],fe&&fe.indexOf(W)!==0)return!1;return!0}function F(g,W){W=W||{},this._source_text=g||"",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 l(W)}F.prototype.create_flags=function(g,W){var J=0;g&&(J=g.indentation_level,!this._output.just_added_newline()&&g.line_indent_level>J&&(J=g.line_indent_level));var oe={mode:W,parent:g,last_token:g?g.last_token:new m(s.START_BLOCK,""),last_word:g?g.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:J,alignment:0,line_indent_level:g?g.line_indent_level:J,start_line_index:this._output.get_line_number(),ternary_depth:0};return oe},F.prototype._reset=function(g){var W=g.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new p(this._options,W),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(f.BlockStatement);var J=new d(g,this._options);return this._tokens=J.tokenize(),g},F.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var g,W=this._reset(this._source_text),J=this._options.eol;this._options.eol==="auto"&&(J=`
|
|
`,W&&u.lineBreak.test(W||"")&&(J=W.match(u.lineBreak)[0]));for(var oe=this._tokens.next();oe;)this.handle_token(oe),this._last_last_text=this._flags.last_token.text,this._flags.last_token=oe,oe=this._tokens.next();return g=this._output.get_code(J),g},F.prototype.handle_token=function(g,W){g.type===s.START_EXPR?this.handle_start_expr(g):g.type===s.END_EXPR?this.handle_end_expr(g):g.type===s.START_BLOCK?this.handle_start_block(g):g.type===s.END_BLOCK?this.handle_end_block(g):g.type===s.WORD?this.handle_word(g):g.type===s.RESERVED?this.handle_word(g):g.type===s.SEMICOLON?this.handle_semicolon(g):g.type===s.STRING?this.handle_string(g):g.type===s.EQUALS?this.handle_equals(g):g.type===s.OPERATOR?this.handle_operator(g):g.type===s.COMMA?this.handle_comma(g):g.type===s.BLOCK_COMMENT?this.handle_block_comment(g,W):g.type===s.COMMENT?this.handle_comment(g,W):g.type===s.DOT?this.handle_dot(g):g.type===s.EOF?this.handle_eof(g):g.type===s.UNKNOWN?this.handle_unknown(g,W):this.handle_unknown(g,W)},F.prototype.handle_whitespace_and_comments=function(g,W){var J=g.newlines,oe=this._options.keep_array_indentation&&_(this._flags.mode);if(g.comments_before)for(var fe=g.comments_before.next();fe;)this.handle_whitespace_and_comments(fe,W),this.handle_token(fe,W),fe=g.comments_before.next();if(oe)for(var Re=0;Re<J;Re+=1)this.print_newline(Re>0,W);else if(this._options.max_preserve_newlines&&J>this._options.max_preserve_newlines&&(J=this._options.max_preserve_newlines),this._options.preserve_newlines&&J>1){this.print_newline(!1,W);for(var be=1;be<J;be+=1)this.print_newline(!0,W)}};var D=["async","break","continue","return","throw","yield"];F.prototype.allow_wrap_or_preserved_newline=function(g,W){if(W=W===void 0?!1:W,this._output.just_added_newline())return;var J=this._options.preserve_newlines&&g.newlines||W,oe=a(this._flags.last_token.text,h)||a(g.text,h);if(oe){var fe=a(this._flags.last_token.text,h)&&a(this._options.operator_position,C)||a(g.text,h);J=J&&fe}if(J)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(k(this._flags.last_token,D))return;this._output.set_wrap_point()}},F.prototype.print_newline=function(g,W){if(!W&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==s.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var J=this._tokens.peek();this._flags.mode===f.Statement&&!(this._flags.if_block&&T(J,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(g)&&(this._flags.multiline_frame=!0)},F.prototype.print_token_line_indentation=function(g){this._output.just_added_newline()&&(this._options.keep_array_indentation&&g.newlines&&(g.text==="["||_(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(g.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))},F.prototype.print_token=function(g){if(this._output.raw){this._output.add_raw_token(g);return}if(this._options.comma_first&&g.previous&&g.previous.type===s.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var W=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(W),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(g),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(g),this._output.non_breaking_space=!0,this._output.add_token(g.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},F.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},F.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))},F.prototype.set_mode=function(g){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,g),this._flags=this.create_flags(this._previous_flags,g),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},F.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===f.Statement&&w(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},F.prototype.start_of_object_property=function(){return this._flags.parent.mode===f.ObjectLiteral&&this._flags.mode===f.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||k(this._flags.last_token,["get","set"]))},F.prototype.start_of_statement=function(g){var W=!1;return W=W||k(this._flags.last_token,["var","let","const"])&&g.type===s.WORD,W=W||T(this._flags.last_token,"do"),W=W||!(this._flags.parent.mode===f.ObjectLiteral&&this._flags.mode===f.Statement)&&k(this._flags.last_token,D)&&!g.newlines,W=W||T(this._flags.last_token,"else")&&!(T(g,"if")&&!g.comments_before),W=W||this._flags.last_token.type===s.END_EXPR&&(this._previous_flags.mode===f.ForInitializer||this._previous_flags.mode===f.Conditional),W=W||this._flags.last_token.type===s.WORD&&this._flags.mode===f.BlockStatement&&!this._flags.in_case&&!(g.text==="--"||g.text==="++")&&this._last_last_text!=="function"&&g.type!==s.WORD&&g.type!==s.RESERVED,W=W||this._flags.mode===f.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||k(this._flags.last_token,["get","set"])),W?(this.set_mode(f.Statement),this.indent(),this.handle_whitespace_and_comments(g,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(g,k(g,["do","for","if","while"])),!0):!1},F.prototype.handle_start_expr=function(g){this.start_of_statement(g)||this.handle_whitespace_and_comments(g);var W=f.Expression;if(g.text==="["){if(this._flags.last_token.type===s.WORD||this._flags.last_token.text===")"){k(this._flags.last_token,o)&&(this._output.space_before_token=!0),this.print_token(g),this.set_mode(W),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}W=f.ArrayLiteral,_(this._flags.mode)&&((this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline())),a(this._flags.last_token.type,[s.START_EXPR,s.END_EXPR,s.WORD,s.OPERATOR,s.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===s.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,W=f.ForInitializer):a(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,W=f.Conditional):a(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&g.whitespace_before===""?this._output.space_before_token=!1:(a(this._flags.last_token.text,o)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===s.EQUALS||this._flags.last_token.type===s.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(g);else if(this._flags.last_token.type===s.WORD){this._output.space_before_token=!1;var J=this._tokens.peek(-3);if(this._options.space_after_named_function&&J){var oe=this._tokens.peek(-4);k(J,["async","function"])||J.text==="*"&&k(oe,["async","function"])?this._output.space_before_token=!0:this._flags.mode===f.ObjectLiteral?(J.text==="{"||J.text===","||J.text==="*"&&(oe.text==="{"||oe.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(g);(this._flags.last_token.type===s.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(a(this._last_last_text,["function","yield"])||this._flags.mode===f.ObjectLiteral&&a(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===s.START_BLOCK?this.print_newline():(this._flags.last_token.type===s.END_EXPR||this._flags.last_token.type===s.START_EXPR||this._flags.last_token.type===s.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===s.COMMA)&&this.allow_wrap_or_preserved_newline(g,g.newlines),this.print_token(g),this.set_mode(W),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},F.prototype.handle_end_expr=function(g){for(;this._flags.mode===f.Statement;)this.restore_mode();this.handle_whitespace_and_comments(g),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(g,g.text==="]"&&_(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===s.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(g),this.restore_mode(),w(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===f.Conditional&&(this._previous_flags.mode=f.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},F.prototype.handle_start_block=function(g){this.handle_whitespace_and_comments(g);var W=this._tokens.peek(),J=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===s.END_EXPR?(this.set_mode(f.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(f.BlockStatement):J&&(a(J.text,[":",","])&&a(W.type,[s.STRING,s.WORD,s.RESERVED])||a(W.text,["get","set","..."])&&a(J.type,[s.WORD,s.RESERVED]))?a(this._last_last_text,["class","interface"])&&!a(J.text,[":",","])?this.set_mode(f.BlockStatement):this.set_mode(f.ObjectLiteral):this._flags.last_token.type===s.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(f.BlockStatement):a(this._flags.last_token.type,[s.EQUALS,s.START_EXPR,s.COMMA,s.OPERATOR])||k(this._flags.last_token,["return","throw","import","default"])?this.set_mode(f.ObjectLiteral):this.set_mode(f.BlockStatement),this._flags.last_token&&(k(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var oe=!W.comments_before&&W.text==="}",fe=oe&&this._flags.last_word==="function"&&this._flags.last_token.type===s.END_EXPR;if(this._options.brace_preserve_inline){var Re=0,be=null;this._flags.inline_frame=!0;do if(Re+=1,be=this._tokens.peek(Re-1),be.newlines){this._flags.inline_frame=!1;break}while(be.type!==s.EOF&&!(be.type===s.END_BLOCK&&be.opened===g))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&g.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==s.OPERATOR&&(fe||this._flags.last_token.type===s.EQUALS||k(this._flags.last_token,L)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(_(this._previous_flags.mode)&&(this._flags.last_token.type===s.START_EXPR||this._flags.last_token.type===s.COMMA)&&((this._flags.last_token.type===s.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===s.COMMA||this._flags.last_token.type===s.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(g),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==s.OPERATOR&&this._flags.last_token.type!==s.START_EXPR&&(this._flags.last_token.type===s.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(g),this.indent(),!oe&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},F.prototype.handle_end_block=function(g){for(this.handle_whitespace_and_comments(g);this._flags.mode===f.Statement;)this.restore_mode();var W=this._flags.last_token.type===s.START_BLOCK;this._flags.inline_frame&&!W?this._output.space_before_token=!0:this._options.brace_style==="expand"?W||this.print_newline():W||(_(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(g)},F.prototype.handle_word=function(g){if(g.type===s.RESERVED){if(a(g.text,["set","get"])&&this._flags.mode!==f.ObjectLiteral)g.type=s.WORD;else if(g.text==="import"&&a(this._tokens.peek().text,["(","."]))g.type=s.WORD;else if(a(g.text,["as","from"])&&!this._flags.import_block)g.type=s.WORD;else if(this._flags.mode===f.ObjectLiteral){var W=this._tokens.peek();W.text===":"&&(g.type=s.WORD)}}if(this.start_of_statement(g)?k(this._flags.last_token,["var","let","const"])&&g.type===s.WORD&&(this._flags.declaration_statement=!0):g.newlines&&!j(this._flags.mode)&&(this._flags.last_token.type!==s.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==s.EQUALS&&(this._options.preserve_newlines||!k(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(g),this.print_newline()):this.handle_whitespace_and_comments(g),this._flags.do_block&&!this._flags.do_while)if(T(g,"while")){this._output.space_before_token=!0,this.print_token(g),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&&T(g,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===f.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&k(g,["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(g),this._flags.in_case=!0;return}if((this._flags.last_token.type===s.COMMA||this._flags.last_token.type===s.START_EXPR||this._flags.last_token.type===s.EQUALS||this._flags.last_token.type===s.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(g)),T(g,"function")){(a(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(a(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===s.OPERATOR))&&(!this._output.just_added_blankline()&&!g.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===s.RESERVED||this._flags.last_token.type===s.WORD?k(this._flags.last_token,["get","set","new","export"])||k(this._flags.last_token,D)?this._output.space_before_token=!0:T(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===s.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(j(this._flags.mode)||_(this._flags.mode))||this.print_newline(),this.print_token(g),this._flags.last_word=g.text;return}var J="NONE";if(this._flags.last_token.type===s.END_BLOCK?this._previous_flags.inline_frame?J="SPACE":k(g,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&g.newlines?J="NEWLINE":(J="SPACE",this._output.space_before_token=!0):J="NEWLINE":this._flags.last_token.type===s.SEMICOLON&&this._flags.mode===f.BlockStatement?J="NEWLINE":this._flags.last_token.type===s.SEMICOLON&&j(this._flags.mode)?J="SPACE":this._flags.last_token.type===s.STRING?J="NEWLINE":this._flags.last_token.type===s.RESERVED||this._flags.last_token.type===s.WORD||this._flags.last_token.text==="*"&&(a(this._last_last_text,["function","yield"])||this._flags.mode===f.ObjectLiteral&&a(this._last_last_text,["{",","]))?J="SPACE":this._flags.last_token.type===s.START_BLOCK?this._flags.inline_frame?J="SPACE":J="NEWLINE":this._flags.last_token.type===s.END_EXPR&&(this._output.space_before_token=!0,J="NEWLINE"),k(g,o)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?J="SPACE":J="NEWLINE"),k(g,["else","catch","finally"]))if((!(this._flags.last_token.type===s.END_BLOCK&&this._previous_flags.mode===f.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&g.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var oe=this._output.current_line;oe.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else J==="NEWLINE"?k(this._flags.last_token,L)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&k(g,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==s.END_EXPR?(this._flags.last_token.type!==s.START_EXPR||!k(g,["var","let","const"]))&&this._flags.last_token.text!==":"&&(T(g,"if")&&T(g.previous,"else")?this._output.space_before_token=!0:this.print_newline()):k(g,o)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&_(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():J==="SPACE"&&(this._output.space_before_token=!0);g.previous&&(g.previous.type===s.WORD||g.previous.type===s.RESERVED)&&(this._output.space_before_token=!0),this.print_token(g),this._flags.last_word=g.text,g.type===s.RESERVED&&(g.text==="do"?this._flags.do_block=!0:g.text==="if"?this._flags.if_block=!0:g.text==="import"?this._flags.import_block=!0:this._flags.import_block&&T(g,"from")&&(this._flags.import_block=!1))},F.prototype.handle_semicolon=function(g){this.start_of_statement(g)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(g);for(var W=this._tokens.peek();this._flags.mode===f.Statement&&!(this._flags.if_block&&T(W,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(g)},F.prototype.handle_string=function(g){g.text.startsWith("`")&&g.newlines===0&&g.whitespace_before===""&&(g.previous.text===")"||this._flags.last_token.type===s.WORD)||(this.start_of_statement(g)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(g),this._flags.last_token.type===s.RESERVED||this._flags.last_token.type===s.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===s.COMMA||this._flags.last_token.type===s.START_EXPR||this._flags.last_token.type===s.EQUALS||this._flags.last_token.type===s.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(g):g.text.startsWith("`")&&this._flags.last_token.type===s.END_EXPR&&(g.previous.text==="]"||g.previous.text===")")&&g.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(g)},F.prototype.handle_equals=function(g){this.start_of_statement(g)||this.handle_whitespace_and_comments(g),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(g),this._output.space_before_token=!0},F.prototype.handle_comma=function(g){this.handle_whitespace_and_comments(g,!0),this.print_token(g),this._output.space_before_token=!0,this._flags.declaration_statement?(j(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(g)):this._flags.mode===f.ObjectLiteral||this._flags.mode===f.Statement&&this._flags.parent.mode===f.ObjectLiteral?(this._flags.mode===f.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(g)},F.prototype.handle_operator=function(g){var W=g.text==="*"&&(k(this._flags.last_token,["function","yield"])||a(this._flags.last_token.type,[s.START_BLOCK,s.COMMA,s.END_BLOCK,s.SEMICOLON])),J=a(g.text,["-","+"])&&(a(this._flags.last_token.type,[s.START_BLOCK,s.START_EXPR,s.EQUALS,s.OPERATOR])||a(this._flags.last_token.text,o)||this._flags.last_token.text===",");if(!this.start_of_statement(g)){var oe=!W;this.handle_whitespace_and_comments(g,oe)}if(g.text==="*"&&this._flags.last_token.type===s.DOT){this.print_token(g);return}if(g.text==="::"){this.print_token(g);return}if(this._flags.last_token.type===s.OPERATOR&&a(this._options.operator_position,C)&&this.allow_wrap_or_preserved_newline(g),g.text===":"&&this._flags.in_case){this.print_token(g),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==s.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0);return}var fe=!0,Re=!0,be=!1;if(g.text===":"?this._flags.ternary_depth===0?fe=!1:(this._flags.ternary_depth-=1,be=!0):g.text==="?"&&(this._flags.ternary_depth+=1),!J&&!W&&this._options.preserve_newlines&&a(g.text,h)){var Le=g.text===":",Ce=Le&&be,Te=Le&&!be;switch(this._options.operator_position){case R.before_newline:this._output.space_before_token=!Te,this.print_token(g),(!Le||Ce)&&this.allow_wrap_or_preserved_newline(g),this._output.space_before_token=!0;return;case R.after_newline:this._output.space_before_token=!0,!Le||Ce?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(g):this._output.space_before_token=!1,this.print_token(g),this._output.space_before_token=!0;return;case R.preserve_newline:Te||this.allow_wrap_or_preserved_newline(g),fe=!(this._output.just_added_newline()||Te),this._output.space_before_token=fe,this.print_token(g),this._output.space_before_token=!0;return}}if(W){this.allow_wrap_or_preserved_newline(g),fe=!1;var ve=this._tokens.peek();Re=ve&&a(ve.type,[s.WORD,s.RESERVED])}else if(g.text==="...")this.allow_wrap_or_preserved_newline(g),fe=this._flags.last_token.type===s.START_BLOCK,Re=!1;else if(a(g.text,["--","++","!","~"])||J){if((this._flags.last_token.type===s.COMMA||this._flags.last_token.type===s.START_EXPR)&&this.allow_wrap_or_preserved_newline(g),fe=!1,Re=!1,g.newlines&&(g.text==="--"||g.text==="++"||g.text==="~")){var X=k(this._flags.last_token,L)&&g.newlines;X&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(X,!0)}this._flags.last_token.text===";"&&j(this._flags.mode)&&(fe=!0),this._flags.last_token.type===s.RESERVED?fe=!0:this._flags.last_token.type===s.END_EXPR?fe=!(this._flags.last_token.text==="]"&&(g.text==="--"||g.text==="++")):this._flags.last_token.type===s.OPERATOR&&(fe=a(g.text,["--","-","++","+"])&&a(this._flags.last_token.text,["--","-","++","+"]),a(g.text,["+","-"])&&a(this._flags.last_token.text,["--","++"])&&(Re=!0)),(this._flags.mode===f.BlockStatement&&!this._flags.inline_frame||this._flags.mode===f.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||fe,this.print_token(g),this._output.space_before_token=Re},F.prototype.handle_block_comment=function(g,W){if(this._output.raw){this._output.add_raw_token(g),g.directives&&g.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(g.directives){this.print_newline(!1,W),this.print_token(g),g.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!u.newline.test(g.text)&&!g.newlines){this._output.space_before_token=!0,this.print_token(g),this._output.space_before_token=!0;return}else this.print_block_commment(g,W)},F.prototype.print_block_commment=function(g,W){var J=y(g.text),oe,fe=!1,Re=!1,be=g.whitespace_before,Le=be.length;if(this.print_newline(!1,W),this.print_token_line_indentation(g),this._output.add_token(J[0]),this.print_newline(!1,W),J.length>1){for(J=J.slice(1),fe=U(J,"*"),Re=x(J,be),fe&&(this._flags.alignment=1),oe=0;oe<J.length;oe++)fe?(this.print_token_line_indentation(g),this._output.add_token(A(J[oe]))):Re&&J[oe]?(this.print_token_line_indentation(g),this._output.add_token(J[oe].substring(Le))):(this._output.current_line.set_indent(-1),this._output.add_token(J[oe])),this.print_newline(!1,W);this._flags.alignment=0}},F.prototype.handle_comment=function(g,W){g.newlines?this.print_newline(!1,W):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(g),this.print_newline(!1,W)},F.prototype.handle_dot=function(g){this.start_of_statement(g)||this.handle_whitespace_and_comments(g,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),k(this._flags.last_token,L)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(g,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(g)},F.prototype.handle_unknown=function(g,W){this.print_token(g),g.text[g.text.length-1]===`
|
|
`&&this.print_newline(!1,W)},F.prototype.handle_eof=function(g){for(;this._flags.mode===f.Statement;)this.restore_mode();this.handle_whitespace_and_comments(g)},n.exports.Beautifier=F},function(n){function O(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=[]}O.prototype.clone_empty=function(){var m=new O(this.__parent);return m.set_indent(this.__indent_count,this.__alignment_count),m},O.prototype.item=function(m){return m<0?this.__items[this.__items.length+m]:this.__items[m]},O.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},O.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))},O.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)},O.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},O.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},O.prototype.is_empty=function(){return this.__items.length===0},O.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},O.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},O.prototype.pop=function(){var m=null;return this.is_empty()||(m=this.__items.pop(),this.__character_count-=m.length),m},O.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},O.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},O.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},O.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 v(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}v.prototype.get_indent_size=function(m,u){var l=this.__base_string_length;return u=u||0,m<0&&(l=0),l+=m*this.__indent_size,l+=u,l},v.prototype.get_indent_string=function(m,u){var l=this.__base_string;return u=u||0,m<0&&(m=0,l=""),u+=m*this.__indent_size,this.__ensure_cache(u),l+=this.__cache[u],l},v.prototype.__ensure_cache=function(m){for(;m>=this.__cache.length;)this.__add_column()},v.prototype.__add_column=function(){var m=this.__cache.length,u=0,l="";this.__indent_size&&m>=this.__indent_size&&(u=Math.floor(m/this.__indent_size),m-=u*this.__indent_size,l=new Array(u+1).join(this.__indent_string)),m&&(l+=new Array(m+1).join(" ")),this.__cache.push(l)};function p(m,u){this.__indent_cache=new v(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 O(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 l=this.__lines.join(`
|
|
`);return m!==`
|
|
`&&(l=l.replace(/[\n]/g,m)),l},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 l=this.__lines.length-2;l>=0;){var d=this.__lines[l];if(d.is_empty())break;if(d.item(0).indexOf(m)!==0&&d.item(-1)!==u){this.__lines.splice(l+1,0,new O(this)),this.previous_line=this.__lines[this.__lines.length-2];break}l--}},n.exports.Output=p},function(n){function O(v,p,m,u){this.type=v,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=O},function(n,O){var v="\\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",l="(?:\\\\u[0-9a-fA-F]{4}|["+v+m+"])",d="(?:\\\\u[0-9a-fA-F]{4}|["+p+m+u+"])*";O.identifier=new RegExp(l+d,"g"),O.identifierStart=new RegExp(l),O.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+p+m+u+"])+");var o=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;O.newline=/[\n\r\u2028\u2029]/,O.lineBreak=new RegExp(`\r
|
|
|`+O.newline.source),O.allLineBreaks=new RegExp(O.lineBreak.source,"g")},function(n,O,v){var p=v(6).Options,m=["before-newline","after-newline","preserve-newline"];function u(l){p.call(this,l,"js");var d=this.raw_options.brace_style||null;d==="expand-strict"?this.raw_options.brace_style="expand":d==="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 o=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<o.length;h++)o[h]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=o[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 O(m,u){this.raw_options=v(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"])}O.prototype._get_array=function(m,u){var l=this.raw_options[m],d=u||[];return typeof l=="object"?l!==null&&typeof l.concat=="function"&&(d=l.concat()):typeof l=="string"&&(d=l.split(/[^a-zA-Z0-9_\/\-]+/)),d},O.prototype._get_boolean=function(m,u){var l=this.raw_options[m],d=l===void 0?!!u:!!l;return d},O.prototype._get_characters=function(m,u){var l=this.raw_options[m],d=u||"";return typeof l=="string"&&(d=l.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),d},O.prototype._get_number=function(m,u){var l=this.raw_options[m];u=parseInt(u,10),isNaN(u)&&(u=0);var d=parseInt(l,10);return isNaN(d)&&(d=u),d},O.prototype._get_selection=function(m,u,l){var d=this._get_selection_list(m,u,l);if(d.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 d[0]},O.prototype._get_selection_list=function(m,u,l){if(!u||u.length===0)throw new Error("Selection list cannot be empty.");if(l=l||[u[0]],!this._is_valid_selection(l,u))throw new Error("Invalid Default Value!");var d=this._get_array(m,l);if(!this._is_valid_selection(d,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 d},O.prototype._is_valid_selection=function(m,u){return m.length&&u.length&&!m.some(function(l){return u.indexOf(l)===-1})};function v(m,u){var l={};m=p(m);var d;for(d in m)d!==u&&(l[d]=m[d]);if(u&&m[u])for(d in m[u])l[d]=m[u][d];return l}function p(m){var u={},l;for(l in m){var d=l.replace(/-/g,"_");u[d]=m[l]}return u}n.exports.Options=O,n.exports.normalizeOpts=p,n.exports.mergeOpts=v},function(n,O,v){var p=v(8).InputScanner,m=v(9).Tokenizer,u=v(9).TOKEN,l=v(13).Directives,d=v(4),o=v(12).Pattern,h=v(14).TemplatablePattern;function s(U,x){return x.indexOf(U)!==-1}var a={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:u.START,RAW:u.RAW,EOF:u.EOF},A=new l(/\/\*/,/\*\//),E=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,T=/[0-9]/,k=/[^\d\.]/,L=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),S=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";S=S.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),S="\\?\\.(?!\\d) "+S,S=S.replace(/ /g,"|");var R=new RegExp(S),C="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),f=C.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),w=new RegExp("^(?:"+f.join("|")+")$"),y,_=function(U,x){m.call(this,U,x),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var F=new o(this._input),D=new h(this._input).read_options(this._options);this.__patterns={template:D,identifier:D.starting_with(d.identifier).matching(d.identifierMatch),number:F.matching(E),punct:F.matching(R),comment:F.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:F.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:F.matching(/<!--/),html_comment_end:F.matching(/-->/),include:F.starting_with(/#include/).until_after(d.lineBreak),shebang:F.starting_with(/#!/).until_after(d.lineBreak),xml:F.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:D.until(/['\\\n\r\u2028\u2029]/),double_quote:D.until(/["\\\n\r\u2028\u2029]/),template_text:D.until(/[`\\$]/),template_expression:D.until(/[`}\\]/)}};_.prototype=new m,_.prototype._is_comment=function(U){return U.type===a.COMMENT||U.type===a.BLOCK_COMMENT||U.type===a.UNKNOWN},_.prototype._is_opening=function(U){return U.type===a.START_BLOCK||U.type===a.START_EXPR},_.prototype._is_closing=function(U,x){return(U.type===a.END_BLOCK||U.type===a.END_EXPR)&&x&&(U.text==="]"&&x.text==="["||U.text===")"&&x.text==="("||U.text==="}"&&x.text==="{")},_.prototype._reset=function(){y=!1},_.prototype._get_next_token=function(U,x){var F=null;this._readWhitespace();var D=this._input.peek();return D===null?this._create_token(a.EOF,""):(F=F||this._read_non_javascript(D),F=F||this._read_string(D),F=F||this._read_word(U),F=F||this._read_singles(D),F=F||this._read_comment(D),F=F||this._read_regexp(D,U),F=F||this._read_xml(D,U),F=F||this._read_punctuation(),F=F||this._create_token(a.UNKNOWN,this._input.next()),F)},_.prototype._read_word=function(U){var x;if(x=this.__patterns.identifier.read(),x!=="")return x=x.replace(d.allLineBreaks,`
|
|
`),!(U.type===a.DOT||U.type===a.RESERVED&&(U.text==="set"||U.text==="get"))&&w.test(x)?(x==="in"||x==="of")&&(U.type===a.WORD||U.type===a.STRING)?this._create_token(a.OPERATOR,x):this._create_token(a.RESERVED,x):this._create_token(a.WORD,x);if(x=this.__patterns.number.read(),x!=="")return this._create_token(a.WORD,x)},_.prototype._read_singles=function(U){var x=null;return U==="("||U==="["?x=this._create_token(a.START_EXPR,U):U===")"||U==="]"?x=this._create_token(a.END_EXPR,U):U==="{"?x=this._create_token(a.START_BLOCK,U):U==="}"?x=this._create_token(a.END_BLOCK,U):U===";"?x=this._create_token(a.SEMICOLON,U):U==="."&&k.test(this._input.peek(1))?x=this._create_token(a.DOT,U):U===","&&(x=this._create_token(a.COMMA,U)),x&&this._input.next(),x},_.prototype._read_punctuation=function(){var U=this.__patterns.punct.read();if(U!=="")return U==="="?this._create_token(a.EQUALS,U):U==="?."?this._create_token(a.DOT,U):this._create_token(a.OPERATOR,U)},_.prototype._read_non_javascript=function(U){var x="";if(U==="#"){if(this._is_first_token()&&(x=this.__patterns.shebang.read(),x))return this._create_token(a.UNKNOWN,x.trim()+`
|
|
`);if(x=this.__patterns.include.read(),x)return this._create_token(a.UNKNOWN,x.trim()+`
|
|
`);U=this._input.next();var F="#";if(this._input.hasNext()&&this._input.testChar(T)){do U=this._input.next(),F+=U;while(this._input.hasNext()&&U!=="#"&&U!=="=");return U==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(F+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(F+="{}",this._input.next(),this._input.next())),this._create_token(a.WORD,F)}this._input.back()}else if(U==="<"&&this._is_first_token()){if(x=this.__patterns.html_comment_start.read(),x){for(;this._input.hasNext()&&!this._input.testChar(d.newline);)x+=this._input.next();return y=!0,this._create_token(a.COMMENT,x)}}else if(y&&U==="-"&&(x=this.__patterns.html_comment_end.read(),x))return y=!1,this._create_token(a.COMMENT,x);return null},_.prototype._read_comment=function(U){var x=null;if(U==="/"){var F="";if(this._input.peek(1)==="*"){F=this.__patterns.block_comment.read();var D=A.get_directives(F);D&&D.ignore==="start"&&(F+=A.readIgnored(this._input)),F=F.replace(d.allLineBreaks,`
|
|
`),x=this._create_token(a.BLOCK_COMMENT,F),x.directives=D}else this._input.peek(1)==="/"&&(F=this.__patterns.comment.read(),x=this._create_token(a.COMMENT,F))}return x},_.prototype._read_string=function(U){if(U==="`"||U==="'"||U==='"'){var x=this._input.next();return this.has_char_escapes=!1,U==="`"?x+=this._read_string_recursive("`",!0,"${"):x+=this._read_string_recursive(U),this.has_char_escapes&&this._options.unescape_strings&&(x=j(x)),this._input.peek()===U&&(x+=this._input.next()),x=x.replace(d.allLineBreaks,`
|
|
`),this._create_token(a.STRING,x)}return null},_.prototype._allow_regexp_or_xml=function(U){return U.type===a.RESERVED&&s(U.text,["return","case","throw","else","do","typeof","yield"])||U.type===a.END_EXPR&&U.text===")"&&U.opened.previous.type===a.RESERVED&&s(U.opened.previous.text,["if","while","for"])||s(U.type,[a.COMMENT,a.START_EXPR,a.START_BLOCK,a.START,a.END_BLOCK,a.OPERATOR,a.EQUALS,a.EOF,a.SEMICOLON,a.COMMA])},_.prototype._read_regexp=function(U,x){if(U==="/"&&this._allow_regexp_or_xml(x)){for(var F=this._input.next(),D=!1,g=!1;this._input.hasNext()&&(D||g||this._input.peek()!==U)&&!this._input.testChar(d.newline);)F+=this._input.peek(),D?D=!1:(D=this._input.peek()==="\\",this._input.peek()==="["?g=!0:this._input.peek()==="]"&&(g=!1)),this._input.next();return this._input.peek()===U&&(F+=this._input.next(),F+=this._input.read(d.identifier)),this._create_token(a.STRING,F)}return null},_.prototype._read_xml=function(U,x){if(this._options.e4x&&U==="<"&&this._allow_regexp_or_xml(x)){var F="",D=this.__patterns.xml.read_match();if(D){for(var g=D[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),W=g.indexOf("{")===0,J=0;D;){var oe=!!D[1],fe=D[2],Re=!!D[D.length-1]||fe.slice(0,8)==="![CDATA[";if(!Re&&(fe===g||W&&fe.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(oe?--J:++J),F+=D[0],J<=0)break;D=this.__patterns.xml.read_match()}return D||(F+=this._input.match(/[\s\S]*/g)[0]),F=F.replace(d.allLineBreaks,`
|
|
`),this._create_token(a.STRING,F)}}return null};function j(U){for(var x="",F=0,D=new p(U),g=null;D.hasNext();)if(g=D.match(/([\s]|[^\\]|\\\\)+/g),g&&(x+=g[0]),D.peek()==="\\"){if(D.next(),D.peek()==="x")g=D.match(/x([0-9A-Fa-f]{2})/g);else if(D.peek()==="u")g=D.match(/u([0-9A-Fa-f]{4})/g);else{x+="\\",D.hasNext()&&(x+=D.next());continue}if(!g)return U;if(F=parseInt(g[1],16),F>126&&F<=255&&g[0].indexOf("x")===0)return U;if(F>=0&&F<32){x+="\\"+g[0];continue}else F===34||F===39||F===92?x+="\\"+String.fromCharCode(F):x+=String.fromCharCode(F)}return x}_.prototype._read_string_recursive=function(U,x,F){var D,g;U==="'"?g=this.__patterns.single_quote:U==='"'?g=this.__patterns.double_quote:U==="`"?g=this.__patterns.template_text:U==="}"&&(g=this.__patterns.template_expression);for(var W=g.read(),J="";this._input.hasNext();){if(J=this._input.next(),J===U||!x&&d.newline.test(J)){this._input.back();break}else J==="\\"&&this._input.hasNext()?(D=this._input.peek(),D==="x"||D==="u"?this.has_char_escapes=!0:D==="\r"&&this._input.peek(1)===`
|
|
`&&this._input.next(),J+=this._input.next()):F&&(F==="${"&&J==="$"&&this._input.peek()==="{"&&(J+=this._input.next()),F===J&&(U==="`"?J+=this._read_string_recursive("}",x,"`"):J+=this._read_string_recursive("`",x,"${"),this._input.hasNext()&&(J+=this._input.next())));J+=g.read(),W+=J}return W},n.exports.Tokenizer=_,n.exports.TOKEN=a,n.exports.positionable_operators=L.slice(),n.exports.line_starters=C.slice()},function(n){var O=RegExp.prototype.hasOwnProperty("sticky");function v(p){this.__input=p||"",this.__input_length=this.__input.length,this.__position=0}v.prototype.restart=function(){this.__position=0},v.prototype.back=function(){this.__position>0&&(this.__position-=1)},v.prototype.hasNext=function(){return this.__position<this.__input_length},v.prototype.next=function(){var p=null;return this.hasNext()&&(p=this.__input.charAt(this.__position),this.__position+=1),p},v.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},v.prototype.__match=function(p,m){p.lastIndex=m;var u=p.exec(this.__input);return u&&!(O&&p.sticky)&&(u.index!==m&&(u=null)),u},v.prototype.test=function(p,m){return m=m||0,m+=this.__position,m>=0&&m<this.__input_length?!!this.__match(p,m):!1},v.prototype.testChar=function(p,m){var u=this.peek(m);return p.lastIndex=0,u!==null&&p.test(u)},v.prototype.match=function(p){var m=this.__match(p,this.__position);return m?this.__position+=m[0].length:m=null,m},v.prototype.read=function(p,m,u){var l="",d;return p&&(d=this.match(p),d&&(l+=d[0])),m&&(d||!p)&&(l+=this.readUntil(m,u)),l},v.prototype.readUntil=function(p,m){var u="",l=this.__position;p.lastIndex=this.__position;var d=p.exec(this.__input);return d?(l=d.index,m&&(l+=d[0].length)):l=this.__input_length,u=this.__input.substring(this.__position,l),this.__position=l,u},v.prototype.readUntilAfter=function(p){return this.readUntil(p,!0)},v.prototype.get_regexp=function(p,m){var u=null,l="g";return m&&O&&(l="y"),typeof p=="string"&&p!==""?u=new RegExp(p,l):p&&(u=new RegExp(p.source,l)),u},v.prototype.get_literal_regexp=function(p){return RegExp(p.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},v.prototype.peekUntilAfter=function(p){var m=this.__position,u=this.readUntilAfter(p);return this.__position=m,u},v.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=v},function(n,O,v){var p=v(8).InputScanner,m=v(3).Token,u=v(10).TokenStream,l=v(11).WhitespacePattern,d={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},o=function(h,s){this._input=new p(h),this._options=s||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new l(this._input)};o.prototype.tokenize=function(){this._input.restart(),this.__tokens=new u,this._reset();for(var h,s=new m(d.START,""),a=null,A=[],E=new u;s.type!==d.EOF;){for(h=this._get_next_token(s,a);this._is_comment(h);)E.add(h),h=this._get_next_token(s,a);E.isEmpty()||(h.comments_before=E,E=new u),h.parent=a,this._is_opening(h)?(A.push(a),a=h):a&&this._is_closing(h,a)&&(h.opened=a,a.closed=h,a=A.pop(),h.parent=a),h.previous=s,s.next=h,this.__tokens.add(h),s=h}return this.__tokens},o.prototype._is_first_token=function(){return this.__tokens.isEmpty()},o.prototype._reset=function(){},o.prototype._get_next_token=function(h,s){this._readWhitespace();var a=this._input.read(/.+/g);return a?this._create_token(d.RAW,a):this._create_token(d.EOF,"")},o.prototype._is_comment=function(h){return!1},o.prototype._is_opening=function(h){return!1},o.prototype._is_closing=function(h,s){return!1},o.prototype._create_token=function(h,s){var a=new m(h,s,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return a},o.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},n.exports.Tokenizer=o,n.exports.TOKEN=d},function(n){function O(v){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=v}O.prototype.restart=function(){this.__position=0},O.prototype.isEmpty=function(){return this.__tokens_length===0},O.prototype.hasNext=function(){return this.__position<this.__tokens_length},O.prototype.next=function(){var v=null;return this.hasNext()&&(v=this.__tokens[this.__position],this.__position+=1),v},O.prototype.peek=function(v){var p=null;return v=v||0,v+=this.__position,v>=0&&v<this.__tokens_length&&(p=this.__tokens[v]),p},O.prototype.add=function(v){this.__parent_token&&(v.parent=this.__parent_token),this.__tokens.push(v),this.__tokens_length+=1},n.exports.TokenStream=O},function(n,O,v){var p=v(12).Pattern;function m(u,l){p.call(this,u,l),l?this._line_regexp=this._input.get_regexp(l._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,l){u+="\\t ",l+="\\n\\r",this._match_pattern=this._input.get_regexp("["+u+l+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+l+"]")},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 l=this.__split(this._newline_regexp,u);this.newline_count=l.length-1,this.whitespace_before_token=l[this.newline_count]}return u},m.prototype.matching=function(u,l){var d=this._create();return d.__set_whitespace_patterns(u,l),d._update(),d},m.prototype._create=function(){return new m(this._input,this)},m.prototype.__split=function(u,l){u.lastIndex=0;for(var d=0,o=[],h=u.exec(l);h;)o.push(l.substring(d,h.index)),d=h.index+h[0].length,h=u.exec(l);return d<l.length?o.push(l.substring(d,l.length)):o.push(""),o},n.exports.WhitespacePattern=m},function(n){function O(v,p){this._input=v,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)}O.prototype.read=function(){var v=this._input.read(this._starting_pattern);return(!this._starting_pattern||v)&&(v+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),v},O.prototype.read_match=function(){return this._input.match(this._match_pattern)},O.prototype.until_after=function(v){var p=this._create();return p._until_after=!0,p._until_pattern=this._input.get_regexp(v),p._update(),p},O.prototype.until=function(v){var p=this._create();return p._until_after=!1,p._until_pattern=this._input.get_regexp(v),p._update(),p},O.prototype.starting_with=function(v){var p=this._create();return p._starting_pattern=this._input.get_regexp(v,!0),p._update(),p},O.prototype.matching=function(v){var p=this._create();return p._match_pattern=this._input.get_regexp(v,!0),p._update(),p},O.prototype._create=function(){return new O(this._input,this)},O.prototype._update=function(){},n.exports.Pattern=O},function(n){function O(v,p){v=typeof v=="string"?v:v.source,p=typeof p=="string"?p:p.source,this.__directives_block_pattern=new RegExp(v+/ beautify( \w+[:]\w+)+ /.source+p,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(v+/\sbeautify\signore:end\s/.source+p,"g")}O.prototype.get_directives=function(v){if(!v.match(this.__directives_block_pattern))return null;var p={};this.__directive_pattern.lastIndex=0;for(var m=this.__directive_pattern.exec(v);m;)p[m[1]]=m[2],m=this.__directive_pattern.exec(v);return p},O.prototype.readIgnored=function(v){return v.readUntilAfter(this.__directives_end_ignore_pattern)},n.exports.Directives=O},function(n,O,v){var p=v(12).Pattern,m={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function u(l,d){p.call(this,l,d),this.__template_pattern=null,this._disabled=Object.assign({},m),this._excluded=Object.assign({},m),d&&(this.__template_pattern=this._input.get_regexp(d.__template_pattern),this._excluded=Object.assign(this._excluded,d._excluded),this._disabled=Object.assign(this._disabled,d._disabled));var o=new p(l);this.__patterns={handlebars_comment:o.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:o.starting_with(/{{{/).until_after(/}}}/),handlebars:o.starting_with(/{{/).until_after(/}}/),php:o.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:o.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:o.starting_with(/{%/).until_after(/%}/),django_value:o.starting_with(/{{/).until_after(/}}/),django_comment:o.starting_with(/{#/).until_after(/#}/),smarty:o.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:o.starting_with(/{\*/).until_after(/\*}/),smarty_literal:o.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(l){var d=this._create();return d._disabled[l]=!0,d._update(),d},u.prototype.read_options=function(l){var d=this._create();for(var o in m)d._disabled[o]=l.templating.indexOf(o)===-1;return d._update(),d},u.prototype.exclude=function(l){var d=this._create();return d._excluded[l]=!0,d._update(),d},u.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 d=this._read_template();d;)this._match_pattern?d+=this._input.read(this._match_pattern):d+=this._input.readUntil(this.__template_pattern),l+=d,d=this._read_template();return this._until_after&&(l+=this._input.readUntilAfter(this._until_pattern)),l},u.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("|")+")")},u.prototype._read_template=function(){var l="",d=this._input.peek();if(d==="<"){var o=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&o==="?"&&(l=l||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&o==="%"&&(l=l||this.__patterns.erb.read())}else d==="{"&&(!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},n.exports.TemplatablePattern=u}],M={};function K(n){var O=M[n];if(O!==void 0)return O.exports;var v=M[n]={exports:{}};return H[n](v,v.exports,K),v.exports}var G=K(0);N=G})();var $=N;!(le=[],Y=function(){return{js_beautify:$}}.apply(Se,le),Y!==void 0&&(Ze.exports=Y))})()},"746U":function(Ze,Se,q){"use strict";q.d(Se,"f",function(){return le}),q.d(Se,"l",function(){return Y}),q.d(Se,"k",function(){return N}),q.d(Se,"j",function(){return $}),q.d(Se,"g",function(){return H}),q.d(Se,"m",function(){return M}),q.d(Se,"h",function(){return K}),q.d(Se,"n",function(){return G}),q.d(Se,"c",function(){return n}),q.d(Se,"a",function(){return O}),q.d(Se,"i",function(){return v}),q.d(Se,"o",function(){return p}),q.d(Se,"e",function(){return l}),q.d(Se,"d",function(){return d}),q.d(Se,"p",function(){return o}),q.d(Se,"b",function(){return h});function le(s){return Array.isArray(s)}function Y(s){return typeof s=="string"}function N(s){return typeof s=="object"&&s!==null&&!Array.isArray(s)&&!(s instanceof RegExp)&&!(s instanceof Date)}function $(s){return typeof s=="number"&&!isNaN(s)}function H(s){return s===!0||s===!1}function M(s){return typeof s=="undefined"}function K(s){return!G(s)}function G(s){return M(s)||s===null}function n(s,a){if(!s)throw new Error(a?`Unexpected type, expected '${a}'`:"Unexpected type")}function O(s){if(G(s))throw new Error("Assertion Failed: argument is undefined or null");return s}function v(s){return typeof s=="function"}function p(s,a){const A=Math.min(s.length,a.length);for(let E=0;E<A;E++)m(s[E],a[E])}function m(s,a){if(Y(a)){if(typeof s!==a)throw new Error(`argument does not match constraint: typeof ${a}`)}else if(v(a)){try{if(s instanceof a)return}catch(A){}if(!G(s)&&s.constructor===a)return;if(a.length===1&&a.call(void 0,s)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function u(s){let a=[],A=Object.getPrototypeOf(s);for(;Object.prototype!==A;)a=a.concat(Object.getOwnPropertyNames(A)),A=Object.getPrototypeOf(A);return a}function l(s){const a=[];for(const A of u(s))typeof s[A]=="function"&&a.push(A);return a}function d(s,a){const A=T=>function(){const k=Array.prototype.slice.call(arguments,0);return a(T,k)};let E={};for(const T of s)E[T]=A(T);return E}function o(s){return s===null?void 0:s}function h(s,a="Unreachable"){throw new Error(a)}},"7Cbv":function(Ze,Se,q){"use strict";var le=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),Y=new Uint8Array(16);function N(){if(!le)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return le(Y)}var $=/^(?:[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 H(m){return typeof m=="string"&&$.test(m)}for(var M=H,K=[],G=0;G<256;++G)K.push((G+256).toString(16).substr(1));function n(m){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,l=(K[m[u+0]]+K[m[u+1]]+K[m[u+2]]+K[m[u+3]]+"-"+K[m[u+4]]+K[m[u+5]]+"-"+K[m[u+6]]+K[m[u+7]]+"-"+K[m[u+8]]+K[m[u+9]]+"-"+K[m[u+10]]+K[m[u+11]]+K[m[u+12]]+K[m[u+13]]+K[m[u+14]]+K[m[u+15]]).toLowerCase();if(!M(l))throw TypeError("Stringified UUID is invalid");return l}var O=n;function v(m,u,l){m=m||{};var d=m.random||(m.rng||N)();if(d[6]=d[6]&15|64,d[8]=d[8]&63|128,u){l=l||0;for(var o=0;o<16;++o)u[l+o]=d[o];return u}return O(d)}var p=Se.a=v},"7ahc":function(Ze,Se,q){"use strict";q.d(Se,"a",function(){return A});var le=q("k1fw"),Y=q("0Owb"),N=q("+L6B"),$=q("2/Rp"),H=q("y8nQ"),M=q("Vl3Y"),K=q("tJVT"),G=q("OaEy"),n=q("2fM7"),O=q("q1tI"),v=q.n(O),p=q("VrN/"),m=q.n(p),u=q("p77/"),l=q.n(u),d=q("c5Ni"),o=q.n(d),h=n.a.Option,s={labelCol:{span:4},wrapperCol:{span:20}},a={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};Se.b=function(E){var T=E.callback,k=E.onCancel,L=Object(O.useState)("python"),S=Object(K.a)(L,2),R=S[0],C=S[1];function f(y){C(a[y][1])}function w(y){T(y)}return v.a.createElement(M.a,Object(Y.a)({},s,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:w}),v.a.createElement(M.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},v.a.createElement(n.a,{onChange:f},Object.keys(a).map(function(y){return v.a.createElement(h,{key:y,value:y},a[y][0])}))),v.a.createElement(M.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},v.a.createElement(A,{mode:R})),v.a.createElement("div",{className:"flex-container flex-end"},v.a.createElement($.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),v.a.createElement($.a,{type:"ghost",onClick:k},"\u53D6\u6D88")))};function A(E){var T=E.value,k=E.onChange,L=E.mode,S=E.options,R=S===void 0?{}:S,C=Object(O.useRef)(),f=Object(O.useState)(),w=Object(K.a)(f,2),y=w[0],_=w[1];return Object(O.useEffect)(function(){if(y){function j(U){var x=U.getValue();k&&k(x)}return y.on("change",j),function(){y.off("change",j)}}},[y,k]),Object(O.useEffect)(function(){y&&y.setOption("mode",L)},[y,L]),Object(O.useEffect)(function(){y&&((T!==y.getValue()||T==="")&&setTimeout(function(){y.setValue(T||" ")},300))},[y,T]),Object(O.useEffect)(function(){if(C.current&&!y){var j=m.a.fromTextArea(C.current,Object(le.a)({mode:L,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},R));_(j)}},[C.current,y]),v.a.createElement("div",{className:"my-codemirror-container"},v.a.createElement("textarea",{ref:C}))}},"8EBN":function(Ze,Se,q){(function(le){le(q("VrN/"))})(function(le){"use strict";le.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 Y=0;Y<le.modeInfo.length;Y++){var N=le.modeInfo[Y];N.mimes&&(N.mime=N.mimes[0])}le.findModeByMIME=function($){$=$.toLowerCase();for(var H=0;H<le.modeInfo.length;H++){var M=le.modeInfo[H];if(M.mime==$)return M;if(M.mimes){for(var K=0;K<M.mimes.length;K++)if(M.mimes[K]==$)return M}}if(/\+xml$/.test($))return le.findModeByMIME("application/xml");if(/\+json$/.test($))return le.findModeByMIME("application/json")},le.findModeByExtension=function($){$=$.toLowerCase();for(var H=0;H<le.modeInfo.length;H++){var M=le.modeInfo[H];if(M.ext){for(var K=0;K<M.ext.length;K++)if(M.ext[K]==$)return M}}},le.findModeByFileName=function($){for(var H=0;H<le.modeInfo.length;H++){var M=le.modeInfo[H];if(M.file&&M.file.test($))return M}var K=$.lastIndexOf("."),G=K>-1&&$.substring(K+1,$.length);if(G)return le.findModeByExtension(G)},le.findModeByName=function($){$=$.toLowerCase();for(var H=0;H<le.modeInfo.length;H++){var M=le.modeInfo[H];if(M.name.toLowerCase()==$)return M;if(M.alias){for(var K=0;K<M.alias.length;K++)if(M.alias[K].toLowerCase()==$)return M}}}})},"8HAY":function(Ze,Se,q){"use strict";q.d(Se,"a",function(){return H}),q.d(Se,"b",function(){return M}),q.d(Se,"d",function(){return K}),q.d(Se,"e",function(){return G}),q.d(Se,"c",function(){return n});var le=q("MI8n"),Y=q("pmY6"),N=q("3/fG"),$=function(O,v,p,m){function u(l){return l instanceof p?l:new p(function(d){d(l)})}return new(p||(p=Promise))(function(l,d){function o(a){try{s(m.next(a))}catch(A){d(A)}}function h(a){try{s(m.throw(a))}catch(A){d(A)}}function s(a){a.done?l(a.value):u(a.value).then(o,h)}s((m=m.apply(O,v||[])).next())})};class H extends Y.a{constructor(O,v="",p="",m=!0,u){super();this._onDidChange=this._register(new le.b),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=O,this._label=v,this._cssClass=p,this._enabled=m,this._actionCallback=u}get id(){return this._id}get label(){return this._label}set label(O){this._setLabel(O)}_setLabel(O){this._label!==O&&(this._label=O,this._onDidChange.fire({label:O}))}get tooltip(){return this._tooltip||""}set tooltip(O){this._setTooltip(O)}_setTooltip(O){this._tooltip!==O&&(this._tooltip=O,this._onDidChange.fire({tooltip:O}))}get class(){return this._cssClass}set class(O){this._setClass(O)}_setClass(O){this._cssClass!==O&&(this._cssClass=O,this._onDidChange.fire({class:O}))}get enabled(){return this._enabled}set enabled(O){this._setEnabled(O)}_setEnabled(O){this._enabled!==O&&(this._enabled=O,this._onDidChange.fire({enabled:O}))}get checked(){return this._checked}set checked(O){this._setChecked(O)}_setChecked(O){this._checked!==O&&(this._checked=O,this._onDidChange.fire({checked:O}))}run(O,v){return $(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(O))})}}class M extends Y.a{constructor(){super(...arguments);this._onBeforeRun=this._register(new le.b),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new le.b),this.onDidRun=this._onDidRun.event}run(O,v){return $(this,void 0,void 0,function*(){if(!O.enabled)return;this._onBeforeRun.fire({action:O});let p;try{yield this.runAction(O,v)}catch(m){p=m}this._onDidRun.fire({action:O,error:p})})}runAction(O,v){return $(this,void 0,void 0,function*(){yield O.run(v)})}}class K extends H{constructor(O){super(K.ID,O,O?"separator text":"separator");this.checked=!1,this.enabled=!1}}K.ID="vs.actions.separator";class G{constructor(O,v,p,m){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=O,this.label=v,this.class=m,this._actions=p}get actions(){return this._actions}dispose(){}run(){return $(this,void 0,void 0,function*(){})}}class n extends H{constructor(){super(n.ID,N.a("submenu.empty","(empty)"),void 0,!1)}}n.ID="vs.actions.empty"},"8hTe":function(Ze,Se,q){Ze.exports={button:"button___1wy9m"}},"9Bee":function(Ze,Se,q){"use strict";var le=q("DYRE"),Y=q("zeV3"),N=q("+L6B"),$=q("2/Rp"),H=q("k1fw"),M=q("9og8"),K=q("tJVT"),G=q("WmNS"),n=q.n(G),O=q("q1tI"),v=q.n(O),p=q("vg9a"),m=q("DlQD"),u=q.n(m),l=q("rUJ1");function d(ce,ee){var ne=ce.match(/^(\s+)(?:```)/);if(ne===null)return ee;var se=ne[1];return ee.split(`
|
|
`).map(function(de){var re=de.match(/^\s+/);if(re===null)return de;var ae=Object(K.a)(re,1),pe=ae[0];return pe.length>=se.length?de.slice(se.length):de}).join(`
|
|
`)}var o=[],h=["<ul>"],s=new u.a.Renderer,a=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function A(){o.length=0,h=["<ul>"]}var E={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function T(ce,ee,ne,se){if(ee>=ce.length||ce[ee].level<=ne)return ee;var de=ce[ee];se.push("<li><a href='#"+de.anchor+"'>"+de.text+"</a>"),ee++;var re=[];return ee=T(ce,ee,de.level,re),re.length>0&&(se.push("<ul>"),re.forEach(function(ae){se.push(ae)}),se.push("</ul>")),se.push("</li>"),ee=T(ce,ee,ne,se),ee}function k(){return T(o,0,0,h),h.push("</ul>"),h.join("")}var L={heading:function(ee){var ne=a.exec(ee);if(ne)return{type:"heading",raw:ne[0],depth:ne[1].length,text:ne[2]}},fences:function(ee){var ne=this.rules.block.fences.exec(ee);if(ne){var se=ne[0],de=d(se,ne[3]||""),re=ne[2]?ne[2].trim():ne[2];if(["latex","katex","math"].indexOf(re)>=0){var ae=C(),pe=de;de=ae,f[ae]={type:"block",expression:pe}}return{type:"code",raw:se,lang:re,text:de}}}},S=/(?:\${2})([^\n`]+?)(?:\${2})/gi,R=0,C=function(){return"__special_katext_id_".concat(R++,"__")},f={};function w(){return f}function y(){R=0,f={}}function _(ce){return ce=ce.replace(S,function(ee,ne){var se=C();return f[se]={type:"inline",expression:ne},se}),ce}var j=s.listitem;s.listitem=function(ce){return j(_(ce))};var U=s.paragraph;s.paragraph=function(ce){return U(_(ce))};var x=s.tablecell;s.tablecell=function(ce,ee){return x(_(ce),ee)},s.code=function(ce,ee,ne){var se=(ee||"").match(/\S*/)[0];return se?["latex","katex","math"].indexOf(se)>=0?"<p class='editormd-tex'>".concat(ce,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(ee,'">').concat(ne?ce:Object(l.escape)(ce,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(ne?ce:Object(l.escape)(ce,!0))+"</code></pre>"},s.heading=function(ce,ee,ne){var se=this.options.headerPrefix+ne.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return o.push({anchor:se,level:ee,text:ce}),"<h"+ee+' id="'+se+'">'+ce+"</h"+ee+">"},u.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),u.a.use({tokenizer:L,renderer:s});var F=u.a,D=q("SJMd"),g=q("ulZh"),W=q.n(g),J=q("m3rI"),oe=q("Oy/b"),fe=q("p5ED"),Re=q("ErOA"),be=q("STEk");/* **********************************
|
|
cropro version 1.2.0
|
|
@license SEE LICENSE IN LICENSE
|
|
|
|
copyright Alan Mendelevich
|
|
see README and LICENSE for details
|
|
********************************** *//*! *****************************************************************************
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
purpose with or without fee is hereby granted.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
***************************************************************************** */var Le=function(ce,ee){return(Le=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(ne,se){ne.__proto__=se}||function(ne,se){for(var de in se)Object.prototype.hasOwnProperty.call(se,de)&&(ne[de]=se[de])})(ce,ee)};function Ce(ce,ee){if(typeof ee!="function"&&ee!==null)throw new TypeError("Class extends value "+String(ee)+" is not a constructor or null");function ne(){this.constructor=ce}Le(ce,ee),ce.prototype=ee===null?Object.create(ee):(ne.prototype=ee.prototype,new ne)}function Te(ce,ee,ne,se){return new(ne||(ne=Promise))(function(de,re){function ae(_e){try{ge(se.next(_e))}catch(Oe){re(Oe)}}function pe(_e){try{ge(se.throw(_e))}catch(Oe){re(Oe)}}function ge(_e){var Oe;_e.done?de(_e.value):(Oe=_e.value,Oe instanceof ne?Oe:new ne(function(Pe){Pe(Oe)})).then(ae,pe)}ge((se=se.apply(ce,ee||[])).next())})}function ve(ce,ee){var ne,se,de,re,ae={label:0,sent:function(){if(1&de[0])throw de[1];return de[1]},trys:[],ops:[]};return re={next:pe(0),throw:pe(1),return:pe(2)},typeof Symbol=="function"&&(re[Symbol.iterator]=function(){return this}),re;function pe(ge){return function(_e){return function(Oe){if(ne)throw new TypeError("Generator is already executing.");for(;ae;)try{if(ne=1,se&&(de=2&Oe[0]?se.return:Oe[0]?se.throw||((de=se.return)&&de.call(se),0):se.next)&&!(de=de.call(se,Oe[1])).done)return de;switch(se=0,de&&(Oe=[2&Oe[0],de.value]),Oe[0]){case 0:case 1:de=Oe;break;case 4:return ae.label++,{value:Oe[1],done:!1};case 5:ae.label++,se=Oe[1],Oe=[0];continue;case 7:Oe=ae.ops.pop(),ae.trys.pop();continue;default:if(!(de=ae.trys,(de=de.length>0&&de[de.length-1])||Oe[0]!==6&&Oe[0]!==2)){ae=0;continue}if(Oe[0]===3&&(!de||Oe[1]>de[0]&&Oe[1]<de[3])){ae.label=Oe[1];break}if(Oe[0]===6&&ae.label<de[1]){ae.label=de[1],de=Oe;break}if(de&&ae.label<de[2]){ae.label=de[2],ae.ops.push(Oe);break}de[2]&&ae.ops.pop(),ae.trys.pop();continue}Oe=ee.call(ce,ae)}catch(Pe){Oe=[6,Pe],se=0}finally{ne=de=0}if(5&Oe[0])throw Oe[1];return{value:Oe[0]?Oe[1]:void 0,done:!0}}([ge,_e])}}}var X=function(){function ce(){}return ce.addKey=function(ee){ce.key=ee},Object.defineProperty(ce,"isLicensed",{get:function(){return!!ce.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(ce.key)},enumerable:!1,configurable:!0}),ce}(),b=function(){function ce(){}return ce.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},ce.setAttributes=function(ee,ne){for(var se=0,de=ne;se<de.length;se++){var re=de[se],ae=re[0],pe=re[1];ee.setAttribute(ae,pe)}},ce.createRect=function(ee,ne,se){var de=document.createElementNS("http://www.w3.org/2000/svg","rect");return de.setAttribute("width",ee.toString()),de.setAttribute("height",ne.toString()),se&&ce.setAttributes(de,se),de},ce.createLine=function(ee,ne,se,de,re){var ae=document.createElementNS("http://www.w3.org/2000/svg","line");return ae.setAttribute("x1",ee.toString()),ae.setAttribute("y1",ne.toString()),ae.setAttribute("x2",se.toString()),ae.setAttribute("y2",de.toString()),re&&ce.setAttributes(ae,re),ae},ce.createPolygon=function(ee,ne){var se=document.createElementNS("http://www.w3.org/2000/svg","polygon");return se.setAttribute("points",ee),ne&&ce.setAttributes(se,ne),se},ce.createCircle=function(ee,ne){var se=document.createElementNS("http://www.w3.org/2000/svg","circle");return se.setAttribute("cx",(ee/2).toString()),se.setAttribute("cy",(ee/2).toString()),se.setAttribute("r",ee.toString()),ne&&ce.setAttributes(se,ne),se},ce.createEllipse=function(ee,ne,se){var de=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return de.setAttribute("cx",(ee/2).toString()),de.setAttribute("cy",(ne/2).toString()),de.setAttribute("rx",(ee/2).toString()),de.setAttribute("ry",(ne/2).toString()),se&&ce.setAttributes(de,se),de},ce.createGroup=function(ee){var ne=document.createElementNS("http://www.w3.org/2000/svg","g");return ee&&ce.setAttributes(ne,ee),ne},ce.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},ce.createMarker=function(ee,ne,se,de,re,ae,pe){var ge=document.createElementNS("http://www.w3.org/2000/svg","marker");return ce.setAttributes(ge,[["id",ee],["orient",ne],["markerWidth",se.toString()],["markerHeight",de.toString()],["refX",re.toString()],["refY",ae.toString()]]),ge.appendChild(pe),ge},ce.createText=function(ee){var ne=document.createElementNS("http://www.w3.org/2000/svg","text");return ne.setAttribute("x","0"),ne.setAttribute("y","0"),ee&&ce.setAttributes(ne,ee),ne},ce.createTSpan=function(ee,ne){var se=document.createElementNS("http://www.w3.org/2000/svg","tspan");return se.textContent=ee,ne&&ce.setAttributes(se,ne),se},ce.createImage=function(ee){var ne=document.createElementNS("http://www.w3.org/2000/svg","image");return ee&&ce.setAttributes(ne,ee),ne},ce.createPoint=function(ee,ne){var se=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return se.x=ee,se.y=ne,se},ce.createPath=function(ee,ne){var se=document.createElementNS("http://www.w3.org/2000/svg","path");return se.setAttribute("d",ee),ne&&ce.setAttributes(se,ne),se},ce.createElement=function(ee,ne){var se=document.createElementNS("http://www.w3.org/2000/svg",ee);return ne&&ce.setAttributes(se,ne),se},ce.getHollowRectanglePath=function(ee,ne,se,de,re,ae,pe,ge){return"M"+ee+","+ne+"V"+(ne+de)+"H"+(ee+se)+"V"+ne+"H"+re+"V"+ae+"H"+(re+pe)+"V"+(ae+ge)+"H"+re+"V"+ne+"Z"},ce}(),I=function(){function ce(ee){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+ee+"_"}return Object.defineProperty(ce.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(ce.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(ce.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),ce.prototype.addClass=function(ee){return this.styleSheet===void 0&&this.addStyleSheet(),ee.name=""+this.classNamePrefix+ee.localName,this.classes.push(ee),this.styleSheet.sheet.insertRule("."+ee.name+" {"+ee.style+"}",this.styleSheet.sheet.cssRules.length),ee},ce.prototype.addRule=function(ee){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(ee),this.styleSheet.sheet.insertRule(ee.selector+" {"+ee.style+"}",this.styleSheet.sheet.cssRules.length)},ce.prototype.addStyleSheet=function(){var ee;this.styleSheet=document.createElement("style"),((ee=this.styleSheetRoot)!==null&&ee!==void 0?ee:document.head).appendChild(this.styleSheet),this.addRule(new B("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new B("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new B("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new Q("_fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new Q("_fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},ce.prototype.removeStyleSheet=function(){var ee;this.styleSheet&&(((ee=this.styleSheetRoot)!==null&&ee!==void 0?ee:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},ce}(),B=function(ce,ee){this.selector=ce,this.style=ee},Q=function(ce,ee){this.localName=ce,this.style=ee},z=function(){function ce(){this.blocks=[],this.display=""}return ce.prototype.addButtonBlock=function(ee){ee.className=this.blockClassName,ee.buttonClassName=this.buttonClassName,ee.buttonColorsClassName=this.buttonColorsClassName,ee.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(ee)},ce.prototype.addElementBlock=function(ee){ee.className===void 0&&(ee.className=this.blockClassName),this.blocks.push(ee)},ce.prototype.getUI=function(){var ee=document.createElement("div");return ee.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,ee.style.display=this.display,this.blocks.forEach(function(ne){return ee.appendChild(ne.getUI())}),ee},ce}(),he=function(){function ce(){}return ce.prototype.getUI=function(){var ee=document.createElement("div");if(ee.className=this.className,this.minWidth!==void 0&&(ee.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":ee.style.justifyContent="flex-start";break;case"center":ee.style.justifyContent="center";break;case"end":ee.style.justifyContent="flex-end"}return ee.style.whiteSpace="nowrap",ee},ce}(),xe=function(ce){function ee(){var ne=ce!==null&&ce.apply(this,arguments)||this;return ne.buttons=[],ne}return Ce(ee,ce),ee.prototype.addButton=function(ne){ne.className=this.buttonClassName,ne.colorsClassName=this.buttonColorsClassName,ne.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(ne)},ee.prototype.getUI=function(){var ne=ce.prototype.getUI.call(this);return this.buttons.forEach(function(se){return ne.appendChild(se.getUI())}),ne},ee}(he),Ie=function(){function ce(ee,ne){this._isActive=!1,this._isHidden=!1,this._icon=ee,this.title=ne,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(ce.prototype,"icon",{get:function(){return this._icon},set:function(ee){this._icon=ee,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"isActive",{get:function(){return this._isActive},set:function(ee){this._isActive=ee,this.adjustClassName()},enumerable:!1,configurable:!0}),ce.prototype.getUI=function(){var ee=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 ee.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},ce.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,"")))},ce.prototype.hide=function(){this._isHidden=!0},ce}(),ue=function(ce){function ee(){var ne=ce!==null&&ce.apply(this,arguments)||this;return ne.elements=[],ne}return Ce(ee,ce),ee.prototype.addElement=function(ne){this.elements.push(ne)},ee.prototype.getUI=function(){var ne=ce.prototype.getUI.call(this);return this.elements.forEach(function(se){return ne.appendChild(se)}),ne},ee}(he),me=function(){function ce(ee,ne){this.horizontal=ee,this.vertical=ne}return Object.defineProperty(ce.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),ce.prototype.getVerticalLength=function(ee){return ee/this.ratio},ce.prototype.getHorizontalLength=function(ee){return ee*this.ratio},ce}(),we=function(){function ce(){}return ce.getIcon=function(ee,ne){if(ee>0&&ne>0){var se=new me(ee,ne),de=se.ratio>=1?20:se.getHorizontalLength(20),re=se.ratio<1?20:se.getVerticalLength(20),ae=document.createElementNS("http://www.w3.org/2000/svg","svg");ae.setAttribute("xmlns","http://www.w3.org/2000/svg"),ae.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(ae);var pe=b.createDefs();ae.appendChild(pe);var ge=b.createElement("clipPath",[["id","text-bg-clip"]]);pe.appendChild(ge);var _e=b.createPath(b.getHollowRectanglePath((24-de)/2,(24-re)/2,de,re,(24-de)/2+2,(24-re)/2+2,de-4,re-4));ae.appendChild(_e);var Oe=b.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Oe.appendChild(b.createTSpan(ee+":"+ne)),ae.appendChild(Oe);var Pe=Oe.getBBox();b.setAttributes(Oe,[["x",((24-Pe.width)/2).toString()],["y",((24-Pe.height)/2-Pe.y).toString()]]);var ze=b.createPath(b.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Pe.width))/2,(24-Math.ceil(Pe.height))/2,Math.ceil(Pe.width),Math.ceil(Pe.height)));return ge.appendChild(ze),b.setAttributes(_e,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(ae),ae.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>'},ce}(),Ae=function(ce){function ee(ne,se,de){var re=ce.call(this,ne,se)||this;return re.isDropdownOpen=!1,re.onClick=re.dropdownButtonClicked,re.dropdownButtons=de,re}return Ce(ee,ce),ee.prototype.setupDropdown=function(){var ne=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(se){se.className=ne.className,se.colorsClassName=ne.colorsClassName,ne.dropdownBlock.appendChild(se.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},ee.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},ee.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},ee.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},ee.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},ee.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},ee}(Ie),Ne=function(){function ce(ee,ne){this.GRIP_SIZE=10,this.color=ee,this.fillColor=ne,this.visual=b.createGroup(),this.visual.appendChild(b.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(b.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return ce.prototype.ownsTarget=function(ee){return ee===this.visual||ee===this.visual.childNodes[0]||ee===this.visual.childNodes[1]},ce.prototype.setCenter=function(ee,ne){this.visual.childNodes.forEach(function(se){return b.setAttributes(se,[["cx",ee.toString()],["cy",ne.toString()]])})},ce}(),Be=function(){function ce(ee,ne,se,de){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=ee,this.canvasHeight=ne,this.margin=se,this.container=de,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(ce.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(ee){this._aspectRatio=ee,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(ee){this._isGridVisible=ee,this.gridContainer&&b.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(ee){this._zoomFactor=ee,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),ce.prototype.open=function(){var ee=this;this.cropShadeElement=b.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=b.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var ne=0;ne<this.numberOfGridLines;ne++)this.horizontalGridLines.push(b.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(b.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(se){return ee.gridContainer.appendChild(se)}),this.verticalGridLines.forEach(function(se){return ee.gridContainer.appendChild(se)}),this.cropRectElement=b.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Ne(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Ne(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Ne(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Ne(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},ce.prototype.setCropRectangle=function(ee){this.cropRect=ee;var ne=Object.assign({},this.cropRect);this.zoomFactor!==1&&(ne.width=this.cropRect.width*this.zoomFactor,ne.height=this.cropRect.height*this.zoomFactor,ne.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-ne.width/2,ne.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-ne.height/2),b.setAttributes(this.cropRectElement,[["x",ne.x.toString()],["y",ne.y.toString()],["width",ne.width.toString()],["height",ne.height.toString()]]);var se=ne.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(re,ae){var pe=ne.y+se*(ae+1);b.setAttributes(re,[["x1",""+ne.x],["y1",""+pe],["x2",""+(ne.x+ne.width)],["y2",""+pe]])});var de=ne.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(re,ae){var pe=ne.x+de*(ae+1);b.setAttributes(re,[["x1",""+pe],["y1",""+ne.y],["x2",""+pe],["y2",""+(ne.y+ne.height)]])}),b.setAttributes(this.cropShadeElement,[["d",b.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,ne.x,ne.y,ne.width,ne.height)]]),this.topLeftGrip.setCenter(ne.x,ne.y),this.topRightGrip.setCenter(ne.x+ne.width,ne.y),this.bottomLeftGrip.setCenter(ne.x,ne.y+ne.height),this.bottomRightGrip.setCenter(ne.x+ne.width,ne.y+ne.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},ce.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)},ce.prototype.clientToLocalCoordinates=function(ee,ne){var se=this.container.getBoundingClientRect();return{x:ee-se.left+this.margin,y:ne-se.top+this.margin}},ce.prototype.onPointerDown=function(ee){this.container.setPointerCapture(ee.pointerId),this.previousPoint=this.clientToLocalCoordinates(ee.clientX,ee.clientY),this.cropRectElement===ee.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(ee.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(ee.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(ee.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(ee.target)&&(this.activeGrip=this.bottomRightGrip)},ce.prototype.onPointerMove=function(ee){if(this.isMoving)this.move(this.clientToLocalCoordinates(ee.clientX,ee.clientY));else if(this.activeGrip){var ne=this.clientToLocalCoordinates(ee.clientX,ee.clientY);this.resize(ne)}ee.preventDefault()},ce.prototype.onPointerUp=function(ee){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(ee.pointerId)},ce.prototype.move=function(ee){var ne=ee.x-this.previousPoint.x,se=ee.y-this.previousPoint.y;this.zoomFactor!==1&&(ne=-ne/this.zoomFactor,se=-se/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+ne),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+se),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=ee},ce.prototype.resize=function(ee){var ne=Object.assign({},this.cropRect),se=ee.x-this.previousPoint.x,de=ee.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:ne.x+se<this.margin&&(se=this.margin-ne.x),ne.x+=se,ne.width=this.cropRect.x+this.cropRect.width-ne.x;break;case this.bottomRightGrip:case this.topRightGrip:ne.width+se>this.canvasWidth*this.zoomFactor&&(se=this.canvasWidth*this.zoomFactor-ne.width),ne.width+=se}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(ne.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(se),ne.height=this.aspectRatio.getVerticalLength(ne.width)):(ne.y+=de,ne.height=this.cropRect.y+this.cropRect.height-ne.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?ne.height=this.aspectRatio.getVerticalLength(ne.width):ne.height+=de}ne.width<10&&(ne.x=this.cropRect.x,ne.width=10),ne.height<10&&(ne.y=this.cropRect.y,ne.height=10),this.previousPoint=ee,ne.x>=this.margin&&ne.y>=this.margin&&ne.x-this.margin+ne.width<=this.canvasWidth&&ne.y-this.margin+ne.height<=this.canvasHeight&&(this.cropRect=ne,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},ce.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var ee=this.cropRect.x+this.cropRect.width/2,ne=this.cropRect.y+this.cropRect.height/2,se=this.aspectRatio.getHorizontalLength(this.cropRect.height),de=this.aspectRatio.getVerticalLength(this.cropRect.width);se/this.canvasWidth<de/this.canvasHeight?this.cropRect.width=se:this.cropRect.height=de,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=ee-this.cropRect.width/2,this.cropRect.y=ne-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)}},ce.prototype.getRescaledRect=function(ee,ne,se,de,re,ae){var pe=se/ee,ge=de/ne;return{x:(re.x-ae)*pe+ae,y:(re.y-ae)*ge+ae,width:re.width*pe,height:re.height*ge}},ce.prototype.scaleCanvas=function(ee,ne){var se=this.getRescaledRect(this.canvasWidth,this.canvasHeight,ee,ne,this.cropRect,this.margin);this.canvasWidth=ee,this.canvasHeight=ne,this.onCropChange&&this.onCropChange(se),this.setCropRectangle(se)},ce}(),Ke=function(){function ce(ee){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=ee,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(ce.prototype,"angle",{get:function(){return this._angle},set:function(ee){this._angle=ee,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),ce.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},ce.prototype.onPointerDown=function(ee){this.controlContainer.setPointerCapture(ee.pointerId),this.isDragging=!0,this.previousPoint={x:ee.clientX,y:ee.clientY}},ce.prototype.onPointerMove=function(ee){this.isDragging&&(this.onAngleChange&&this.onAngleChange((ee.clientX-this.previousPoint.x)/5),this.previousPoint.x=ee.clientX)},ce.prototype.onPointerUp=function(ee){this.isDragging&&this.onAngleChange&&this.onAngleChange((ee.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(ee.pointerId)},ce.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var ee=this.angleLabelText.getBBox();b.setAttributes(this.angleLabelElement,[["x",((this.width-ee.width)/2).toString()],["y",(this.height/2).toString()]])}},ce.prototype.positionScaleShape=function(){if(this.scaleShape){var ee=this.scaleShape.transform.baseVal.getItem(0);ee.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(ee,0)}},ce.prototype.getVisual=function(){var ee=document.createElementNS("http://www.w3.org/2000/svg","svg");ee.setAttribute("xmlns","http://www.w3.org/2000/svg"),ee.setAttribute("width",this.width+"px"),ee.setAttribute("height",this.height+"px"),ee.setAttribute("viewBox","0 0 "+this.width+" "+this.height),ee.style.flexShrink="0",document.body.appendChild(ee);for(var ne="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,se=1;se<=this.width/5+10;se++){var de=se%5==0?this.height/3:this.height/6;ne+="h4v"+-de+"h1v"+de}ne+="v1H0Z",this.scaleShape=b.createPath(ne);var re=b.createTransform();this.scaleShape.transform.baseVal.appendItem(re),ee.appendChild(this.scaleShape),this.angleLabelElement=b.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=b.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var ae=b.createTSpan("");return ae.innerHTML="°",this.angleLabelElement.appendChild(ae),ee.appendChild(this.angleLabelElement),document.body.removeChild(ee),ee},ce}(),Ge=function(){function ce(){this.naturalSize=!1,this.imageType="image/png"}return ce.prototype.rasterize=function(ee,ne,se,de,re,ae,pe){var ge=this;return new Promise(function(_e){var Oe=document.createElement("canvas");Oe.width=ee.width.baseVal.value-2*de,Oe.height=ee.height.baseVal.value-2*de;var Pe=1,ze=1;ge.naturalSize===!0?(Pe=ne.naturalWidth/(ee.width.baseVal.value-2*de)/ae,ze=ne.naturalHeight/(ee.height.baseVal.value-2*de)/pe,Oe.width=ne.naturalWidth/ae,Oe.height=ne.naturalHeight/pe):ge.width!==void 0&&ge.height!==void 0&&(Pe=ge.width/se.width,ze=ge.height/se.height,Oe.width*=Pe,Oe.height*=ze);var et=Oe.getContext("2d");et.translate(Oe.width/2,Oe.height/2),et.rotate(re*Math.PI/180),et.scale(ae,pe),et.translate(-Oe.width/2,-Oe.height/2),et.drawImage(ne,0,0,Oe.width,Oe.height);var nt=document.createElement("canvas");nt.width=se.width*Pe,nt.height=se.height*ze,nt.getContext("2d").putImageData(et.getImageData((se.x-de)*Pe,(se.y-de)*ze,se.width*Pe,se.height*ze),0,0),_e(nt.toDataURL(ge.imageType,ge.imageQuality))})},ce}(),$e=function(){function ce(ee){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=ce.instanceCounter++,this.styles=new I(this.instanceNo),this.target=ee,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(ce.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(ee){this._zoomToCropEnabled=ee,ee?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(ee){this._isGridVisible=ee,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"gridLines",{get:function(){return this._gridLines},set:function(ee){this._gridLines=ee,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(ee){this._rotationAngle=ee,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"aspectRatio",{get:function(){var ee;return(ee=this._aspectRatio)!==null&&ee!==void 0?ee:this.aspectRatios[0]},set:function(ee){this._aspectRatio=ee},enumerable:!1,configurable:!0}),ce.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},ce.prototype.show=function(){this.showUI(),this.open()},ce.prototype.close=function(ee){ee===void 0&&(ee=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),ee||this.closeEventListeners.forEach(function(ne){return ne()}),this._isOpen=!1)},ce.prototype.addRenderEventListener=function(ee){this.renderEventListeners.push(ee)},ce.prototype.removeRenderEventListener=function(ee){this.renderEventListeners.indexOf(ee)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(ee),1)},ce.prototype.addCloseEventListener=function(ee){this.closeEventListeners.push(ee)},ce.prototype.removeCloseEventListener=function(ee){this.closeEventListeners.indexOf(ee)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(ee),1)},ce.prototype.setupResizeObserver=function(){var ee=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){ee.resize(ee.target.clientWidth,ee.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))},ce.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var ee=1*this.target.clientWidth/this.target.clientHeight,ne=this.contentDiv.clientWidth/ee>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*ee:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,se=ne+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/ee;this.resize(ne,se)}},ce.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},ce.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",b.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},ce.prototype.resize=function(ee,ne){this.imageWidth=Math.round(ee),this.imageHeight=Math.round(ne),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()},ce.prototype.setEditingTarget=function(){var ee=document.createElement("canvas");ee.width=this.target.naturalWidth,ee.height=this.target.naturalHeight,ee.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var ne=ee.toDataURL();b.setAttributes(this.editingTarget,[["href",ne]]),this.setEditingTargetSize()},ce.prototype.setTopLeft=function(){var ee=this.target.getBoundingClientRect(),ne=this.editorCanvas.getBoundingClientRect();this.left=ee.left-ne.left-this.CANVAS_MARGIN,this.top=ee.top-ne.top-this.CANVAS_MARGIN},ce.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=b.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=b.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=b.createGroup(),this.editingTargetRotationScaleContainer=b.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var ee=b.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(ee);var ne=b.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(ne),this.editingTargetContainer=b.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)},ce.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},ce.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=b.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new Be(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()},ce.prototype.zoomToCrop=function(){if(this.cropRect){var ee=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,ne=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=ee+"px "+ne+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-ee+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-ne+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},ce.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)},ce.prototype.cropRectChanged=function(ee){this.cropRect=ee,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},ce.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},ce.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"},ce.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},ce.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 ee=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,ne=this.target.offsetTop>ee+this.CANVAS_MARGIN?this.target.offsetTop-(ee+this.CANVAS_MARGIN):0;this.coverDiv.style.top=ne+"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},ce.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},ce.prototype.addTopToolbar=function(){var ee=this;this.topToolbar=new z,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 ne=new xe;ne.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(ne);var se=[];this.aspectRatios.forEach(function(ze){var et=new Ie(we.getIcon(ze.horizontal,ze.vertical),ze.horizontal===0&&ze.vertical===0?"FREE":ze.horizontal+":"+ze.vertical);et.onClick=function(){return ee.ratioButtonClicked(ze)},se.push(et)}),this.aspectRatioButton=new Ae(we.getIcon(0,0),"Aspect ratio",se),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,ne.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var de=new Ie('<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");de.isActive=this.isGridVisible,de.onClick=function(){ee.isGridVisible=!ee.isGridVisible,de.isActive=ee.isGridVisible},ne.addButton(de);var re=new Ie('<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(re.isActive=this.zoomToCropEnabled,re.onClick=function(){ee.zoomToCropEnabled=!ee.zoomToCropEnabled,re.isActive=ee.zoomToCropEnabled},ne.addButton(re),!X.isLicensed){var ae=new ue;this.topToolbar.addElementBlock(ae);var pe=document.createElement("div");pe.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var ge=document.createElement("a");ge.style.color="currentColor",ge.href="https://markerjs.com/products/cropro",ge.target="_blank",ge.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>',pe.appendChild(ge),ae.addElement(pe)}var _e=new xe;_e.minWidth=3*this.toolbarHeight+"px",_e.contentAlign="end",this.topToolbar.addButtonBlock(_e);var Oe=new Ie('<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");Oe.onClick=this.startRenderAndClose,_e.addButton(Oe),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Oe.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Pe=new Ie('<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");Pe.onClick=this.close,_e.addButton(Pe),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Pe.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},ce.prototype.addBottomToolbar=function(){var ee=this;this.bottomToolbar=new z,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 ne=new xe;ne.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(ne);var se=new Ie('<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");se.onClick=this.rotateLeftButtonClicked,ne.addButton(se);var de=new Ie('<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");de.onClick=this.rotateRightButtonClicked,ne.addButton(de);var re=new ue;re.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(re),this.straightener=new Ke("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(_e){ee.rotateBy(_e),ee.straightener.angle=ee.rotationAngle},re.addElement(this.straightener.getUI());var ae=new xe;ae.minWidth=2*this.toolbarHeight+"px",ae.contentAlign="end",this.bottomToolbar.addButtonBlock(ae);var pe=new Ie('<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");pe.onClick=this.flipHorizontallyButtonClicked,ae.addButton(pe);var ge=new Ie('<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");ge.onClick=this.flipVerticallyButtonClicked,ae.addButton(ge)},ce.prototype.ratioButtonClicked=function(ee){this.aspectRatio=ee,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},ce.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=we.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},ce.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new me(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},ce.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},ce.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},ce.prototype.restoreState=function(ee){if(ee){var ne=this.cropLayer.getRescaledRect(ee.width,ee.height,this.imageWidth,this.imageHeight,ee.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(ne),this.cropRectChanged(ne),this.flippedHorizontally=ee.flippedHorizontally,this.flippedVertically=ee.flippedVertically,this.applyFlip(),this.rotationAngle=ee.rotationAngle,this.applyRotation()}},ce.prototype.clientToLocalCoordinates=function(ee,ne){var se=this.cropImage.getBoundingClientRect();return{x:ee-se.left,y:ne-se.top}},ce.prototype.onWindowResize=function(){this.positionUI()},ce.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var ee=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=ee+"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()},ce.prototype.rotateLeftButtonClicked=function(){var ee=this.rotationAngle-90;this.rotationAngle%90!=0&&(ee+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(ee)},ce.prototype.rotateRightButtonClicked=function(){var ee=this.rotationAngle+90;this.rotationAngle%90!=0&&(ee-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(ee)},ce.prototype.rotateTo=function(ee){ee=(ee=ee>180?ee-360:ee)<=-180?ee+360:ee,this.rotationAngle=ee,this.applyRotation()},ce.prototype.rotateBy=function(ee){this.rotateTo((this.rotationAngle+ee)%360)},ce.prototype.applyRotation=function(){var ee=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var ne=this.editingTargetRotationContainer.transform.baseVal.getItem(0);ne.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(ne,0);var se=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/se.width,this.imageHeight/se.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=ee},ce.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},ce.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},ce.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},ce.prototype.startRenderAndClose=function(){return Te(this,void 0,void 0,function(){var ee,ne;return ve(this,function(se){switch(se.label){case 0:return[4,this.render()];case 1:return ee=se.sent(),ne=this.getState(),this.renderEventListeners.forEach(function(de){return de(ee,ne)}),this.close(!0),[2]}})})},ce.prototype.render=function(){return Te(this,void 0,void 0,function(){var ee;return ve(this,function(ne){switch(ne.label){case 0:return(ee=new Ge).naturalSize=this.renderAtNaturalSize,ee.imageType=this.renderImageType,ee.imageQuality=this.renderImageQuality,ee.width=this.renderWidth,ee.height=this.renderHeight,this.unzoomFromCrop(),b.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,ee.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 ne.sent(),[4,ee.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,ne.sent()]}})})},ce.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Q("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 Q("toolbar_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Q("toolbar-block",`
|
|
display: flex;
|
|
align-items: center;
|
|
box-sizing: content-box;
|
|
`));var ee=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Q("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.toolbarHeight-2*ee)+`px;
|
|
height: `+(this.toolbarHeight-2*ee)+`px;
|
|
padding: `+ee+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Q("toolbar_button_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Q("toolbar_active_button",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
|
|
`)),this.styles.addRule(new B("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new B("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
|
|
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new Q("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 Q("toolbar_dropdown_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new Q("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 Q("toolbar_straightener",`
|
|
display: flex;
|
|
overflow: hidden;
|
|
justify-content: center;
|
|
height: `+(this.toolbarHeight-2*ee)+`px;
|
|
padding: `+ee+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new Q("toolbar_straightener_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`))},ce.instanceCounter=0,ce}(),je=q("8hTe"),We=q.n(je),Me=/<pre[^>]*>/g;function tt(ce){var ee=document.createElement("div");return ee.innerHTML=ce,ee.childNodes.length===0?"":ee.childNodes[0].nodeValue}var rt=Se.a=function(ce){var ee=ce.value,ne=ee===void 0?"":ee,se=ce.edit,de=se===void 0?!1:se,re=ce.className,ae=ce.showTextOnly,pe=ce.showLines,ge=ce.replaces,_e=ce.zoomImg,Oe=ce.hasMask,Pe=ce.style,ze=Pe===void 0?{}:Pe,et=ce.stylesPrev,nt=et===void 0?{}:et,_t=String(ne),lt=Object(O.useRef)(),at=Object(O.useRef)(),Rt=Object(O.useState)(""),ot=Object(K.a)(Rt,2),Et=ot[0],xt=ot[1],Ye=Object(O.useState)("office"),Qt=Object(K.a)(Ye,2),nn=Qt[0],Kt=Qt[1],Pt=function(){var Ot=new $e(at.current);Ot.displayMode="popup",Ot.addRenderEventListener(function(){var It=Object(M.a)(n.a.mark(function pt(gt){var Ct;return n.a.wrap(function(Ht){for(;;)switch(Ht.prev=Ht.next){case 0:return lt.current.style.display="none",Ht.next=3,Object(Re.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:gt}});case 3:Ct=Ht.sent,Ct!=null&&Ct.id&&ge(at.current.getAttribute("src").replace(J.a.API_SERVER,""),"/api/attachments/".concat(Ct==null?void 0:Ct.id,"?type=").concat(Ct.content_type));case 5:case"end":return Ht.stop()}},pt)}));return function(pt){return It.apply(this,arguments)}}()),Ot.show()},dt=function(){var Ot=new be.a(at.current);Ot.settings.displayMode="popup",Ot.addEventListener("render",function(){var It=Object(M.a)(n.a.mark(function pt(gt){var Ct;return n.a.wrap(function(Ht){for(;;)switch(Ht.prev=Ht.next){case 0:if(lt.current.style.display="none",!at.current){Ht.next=6;break}return Ht.next=4,Object(Re.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:gt.dataUrl}});case 4:Ct=Ht.sent,Ct!=null&&Ct.id&&ge(at.current.getAttribute("src").replace(J.a.API_SERVER,""),"/api/attachments/".concat(Ct==null?void 0:Ct.id,"?type=").concat(Ct.content_type));case 6:case"end":return Ht.stop()}},pt)}));return function(pt){return It.apply(this,arguments)}}()),Ot.show(),window.markerArea=Ot},yt=Object(O.useMemo)(function(){lt.current&&(lt.current.style.zIndex=-1);try{var qe=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Ot=/\"\/api\/attachments\/|\"\/attachments\/download\//g,It=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;_t=_t.replace(qe,"("+J.a.API_SERVER+"/api/attachments/").replace(Ot,'"'+J.a.API_SERVER+"/api/attachments/").replace(It,'"'+J.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
|
|
`)}catch(sn){}var pt=F(_t),gt=w();if(_t.match(/\[TOC\]/)&&(pt=pt.replace("<p>[TOC]</p>",k()),A()),pt=pt.replace(/(__special_katext_id_\d+__)/g,function(sn,Ht){var He=gt[Ht],mt=He.type,rr=He.expression;return Object(oe.renderToString)(tt(rr)||"",{displayMode:mt==="block",throwOnError:!1,output:"html"})}),pt=pt.replace(/▁/g,"\u2581\u2581\u2581"),y(),ae){var Ct=document.createElement("div");return Ct.innerHTML=pt,Ct.innerText}return setTimeout(function(){return hn()},500),pt},[_t]),Tt=Object(O.useRef)();E.WebkitLineClamp=pe,pe&&(ze=Object(H.a)(Object(H.a)({},ze),E));function Nt(qe){var Ot=qe.target;if(Ot.tagName.toUpperCase()==="IMG"){if(_e){var It=Ot.getAttribute("src");xt(It),Kt("image")}}else if(Ot.tagName.toUpperCase()==="A"){var pt=Ot.getAttribute("href");if(pt.indexOf("office")>-1)qe.preventDefault(),xt(pt),Kt("office");else if(pt.indexOf("application/pdf")>-1)qe.preventDefault(),xt(pt),Kt("pdf");else if(pt.indexOf("text/html")>-1)qe.preventDefault(),xt(pt),Kt("html");else if(pt.startsWith("#")){qe.preventDefault();var gt=document.getElementById(pt.replace("#",""));gt&>.scrollIntoView(!0)}}}var hn=function(){var Ot,It=(Ot=Tt.current)===null||Ot===void 0?void 0:Ot.querySelectorAll("video");It==null||It.forEach(function(pt){if(pt.oncontextmenu=function(){return!1},pt.src.indexOf(".m3u8")>-1&&!pt.canPlayType("application/vnd.apple.mpegurl")){if(W.a.isSupported()){var gt=new W.a;gt.loadSource(pt.src),gt.attachMedia(pt)}}})};Object(O.useEffect)(function(){if(Tt.current&&yt&&(yt.match(Me)&&window.PR.prettyPrint()),Tt.current)return Tt.current.addEventListener("click",Nt),function(){Tt.current.removeEventListener("click",Nt),y(),A()}},[yt,Tt.current,Nt]);var Ut=function(Ot){if(!de)return;Ot.target.nodeName==="IMG"?(lt.current.style.zIndex=1,lt.current.style.display="flex",lt.current.style.width=Ot.target.clientWidth+"px",lt.current.style.height=Ot.target.clientHeight+"px",lt.current.style.top=Ot.target.offsetTop+"px",lt.current.style.left=Ot.target.offsetLeft+"px",at.current.src=Ot.target.getAttribute("src")):lt.current.style.display="none"};return v.a.createElement("div",{style:{position:"relative"}},v.a.createElement("div",{ref:Tt,style:Object(H.a)({},ze),className:"".concat(re||""," markdown-body ").concat(We.a.mdBody),onMouseOver:Ut,dangerouslySetInnerHTML:{__html:yt}}),v.a.createElement("div",{ref:lt,className:We.a.button},v.a.createElement(Y.a,null,v.a.createElement($.a,{onClick:function(){return Pt()}},"\u88C1\u526A"),v.a.createElement($.a,{onClick:function(){return dt()}},"\u7F16\u8F91"))),v.a.createElement("img",{ref:at,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),v.a.createElement(fe.a,{close:!0,data:Et,type:Et!=null&&Et.length?nn:"",style:Object(H.a)({},nt),onClose:function(){return xt("")}}))}},"9VGf":function(Ze,Se,q){"use strict";q.d(Se,"a",function(){return N});var le=q("q1tI"),Y=q.n(le);function N($,H){var M=Object(le.useRef)();Object(le.useEffect)(function(){M.current=$}),Object(le.useEffect)(function(){function K(){M.current()}if(H!==null){var G=setInterval(K,H);return function(){return clearInterval(G)}}},[H])}},BU3w:function(Ze,Se,q){"use strict";q.d(Se,"a",function(){return M});var le=q("MNnm"),Y="rc-util-key";function N(K){if(K.attachTo)return K.attachTo;var G=document.querySelector("head");return G||document.body}function $(K){var G,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(le.a)())return null;var O=document.createElement("style");if((G=n.csp)===null||G===void 0?void 0:G.nonce){var v;O.nonce=(v=n.csp)===null||v===void 0?void 0:v.nonce}O.innerHTML=K;var p=N(n),m=p.firstChild;return n.prepend&&p.prepend?p.prepend(O):n.prepend&&m?p.insertBefore(O,m):p.appendChild(O),O}var H=new Map;function M(K,G){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},O=N(n);if(!H.has(O)){var v=$("",n),p=v.parentNode;H.set(O,p),p.removeChild(v)}var m=Array.from(H.get(O).children).find(function(h){return h.tagName==="STYLE"&&h[Y]===G});if(m){var u,l;if(((u=n.csp)===null||u===void 0?void 0:u.nonce)&&m.nonce!==((l=n.csp)===null||l===void 0?void 0:l.nonce)){var d;m.nonce=(d=n.csp)===null||d===void 0?void 0:d.nonce}return m.innerHTML!==K&&(m.innerHTML=K),m}var o=$(K,n);return o[Y]=G,o}},Bd2K:function(Ze,Se,q){(function(le){le(q("VrN/"),q("osHv"))})(function(le){le.defineOption("autoCloseTags",!1,function(n,O,v){if(v!=le.Init&&v&&n.removeKeyMap("autoCloseTags"),!O)return;var p={name:"autoCloseTags"};(typeof O!="object"||O.whenClosing!==!1)&&(p["'/'"]=function(m){return M(m)}),(typeof O!="object"||O.whenOpening!==!1)&&(p["'>'"]=function(m){return $(m)}),n.addKeyMap(p)});var Y=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],N=["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 $(n){if(n.getOption("disableInput"))return le.Pass;for(var O=n.listSelections(),v=[],p=n.getOption("autoCloseTags"),m=0;m<O.length;m++){if(!O[m].empty())return le.Pass;var u=O[m].head,l=n.getTokenAt(u),d=le.innerMode(n.getMode(),l.state),o=d.state,h=d.mode.xmlCurrentTag&&d.mode.xmlCurrentTag(o),s=h&&h.name;if(!s)return le.Pass;var a=d.mode.configuration=="html",A=typeof p=="object"&&p.dontCloseTags||a&&Y,E=typeof p=="object"&&p.indentTags||a&&N;l.end>u.ch&&(s=s.slice(0,s.length-l.end+u.ch));var T=s.toLowerCase();if(!s||l.type=="string"&&(l.end!=u.ch||!/[\"\']/.test(l.string.charAt(l.string.length-1))||l.string.length==1)||l.type=="tag"&&h.close||l.string.indexOf("/")==u.ch-l.start-1||A&&K(A,T)>-1||G(n,d.mode.xmlCurrentContext&&d.mode.xmlCurrentContext(o)||[],s,u,!0))return le.Pass;var k=typeof p=="object"&&p.emptyTags;if(k&&K(k,s)>-1){v[m]={text:"/>",newPos:le.Pos(u.line,u.ch+2)};continue}var L=E&&K(E,T)>-1;v[m]={indent:L,text:">"+(L?`
|
|
|
|
`:"")+"</"+s+">",newPos:L?le.Pos(u.line+1,0):le.Pos(u.line,u.ch+1)}}for(var S=typeof p=="object"&&p.dontIndentOnAutoClose,m=O.length-1;m>=0;m--){var R=v[m];n.replaceRange(R.text,O[m].head,O[m].anchor,"+insert");var C=n.listSelections().slice(0);C[m]={head:R.newPos,anchor:R.newPos},n.setSelections(C),!S&&R.indent&&(n.indentLine(R.newPos.line,null,!0),n.indentLine(R.newPos.line+1,null,!0))}}function H(n,O){for(var v=n.listSelections(),p=[],m=O?"/":"</",u=n.getOption("autoCloseTags"),l=typeof u=="object"&&u.dontIndentOnSlash,d=0;d<v.length;d++){if(!v[d].empty())return le.Pass;var o=v[d].head,h=n.getTokenAt(o),s=le.innerMode(n.getMode(),h.state),a=s.state;if(O&&(h.type=="string"||h.string.charAt(0)!="<"||h.start!=o.ch-1))return le.Pass;var A,E=s.mode.name!="xml"&&n.getMode().name=="htmlmixed";if(E&&s.mode.name=="javascript")A=m+"script";else if(E&&s.mode.name=="css")A=m+"style";else{var T=s.mode.xmlCurrentContext&&s.mode.xmlCurrentContext(a);if(!T||T.length&&G(n,T,T[T.length-1],o))return le.Pass;A=m+T[T.length-1]}n.getLine(o.line).charAt(h.end)!=">"&&(A+=">"),p[d]=A}if(n.replaceSelections(p),v=n.listSelections(),!l)for(var d=0;d<v.length;d++)(d==v.length-1||v[d].head.line<v[d+1].head.line)&&n.indentLine(v[d].head.line)}function M(n){return n.getOption("disableInput")?le.Pass:H(n,!0)}le.commands.closeTag=function(n){return H(n)};function K(n,O){if(n.indexOf)return n.indexOf(O);for(var v=0,p=n.length;v<p;++v)if(n[v]==O)return v;return-1}function G(n,O,v,p,m){if(!le.scanForClosingTag)return!1;var u=Math.min(n.lastLine()+1,p.line+500),l=le.scanForClosingTag(n,p,null,u);if(!l||l.tag!=v)return!1;for(var d=m?1:0,o=O.length-1;o>=0&&O[o]==v;o--)++d;p=l.to;for(var o=1;o<d;o++){var h=le.scanForClosingTag(n,p,null,u);if(!h||h.tag!=v)return!1;p=h.to}return!0}})},BjJ7:function(Ze,Se,q){"use strict";q.d(Se,"d",function(){return Y}),q.d(Se,"c",function(){return N}),q.d(Se,"e",function(){return $}),q.d(Se,"b",function(){return H}),q.d(Se,"a",function(){return K});var le=q("m3rI");function Y(G){var n=!0;if(G.length>0){for(var O=0;O<G.length;O++)if(G[O].compile_success==0||!G[O].compile_success){n=!1;break}}else n=!1;return n}function N(G){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",O=[],v=0;v<G.length;v++){var p=G[v],m=n?"".concat(n,"/").concat(p.name):"".concat(p.name);O.push({title:p.name,isLeaf:!(p.type==="tree"),key:m})}return O}function $(G,n,O){for(var v=0;v<G.length;v++){var p=G[v];if(p.key===n){p.children=O;break}p.children&&$(p.children,n,O)}return G}function H(G,n,O){var v;return function(){var p=this,m=arguments,u=function(){v=null,O||G.apply(p,m)},l=O&&!v;clearTimeout(v),v=setTimeout(u,n),l&&G.apply(p,m)}}var M=!0,K=le.a.API_SERVER},"C+DQ":function(Ze,Se,q){},"C/vA":function(Ze,Se,q){"use strict";q.d(Se,"a",function(){return le});function le(Y){const N=this;let $=!1,H;return function(){return $||($=!0,H=Y.apply(N,arguments)),H}}},"Cg/j":function(Ze,Se,q){"use strict";q.d(Se,"b",function(){return le}),q.d(Se,"a",function(){return Y}),q.d(Se,"c",function(){return $}),q.d(Se,"d",function(){return H});var le;(function(M){M.serviceIds=new Map,M.DI_TARGET="$di$target",M.DI_DEPENDENCIES="$di$dependencies";function K(G){return G[M.DI_DEPENDENCIES]||[]}M.getServiceDependencies=K})(le||(le={}));const Y=$("instantiationService");function N(M,K,G,n){K[le.DI_TARGET]===K?K[le.DI_DEPENDENCIES].push({id:M,index:G,optional:n}):(K[le.DI_DEPENDENCIES]=[{id:M,index:G,optional:n}],K[le.DI_TARGET]=K)}function $(M){if(le.serviceIds.has(M))return le.serviceIds.get(M);const K=function(G,n,O){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");N(K,G,O,!1)};return K.toString=()=>M,le.serviceIds.set(M,K),K}function H(M){return function(K,G,n){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");N(M,K,n,!0)}}},DlQD:function(Ze,Se,q){(function(le,Y){Ze.exports=Y()})(this,function(){"use strict";function le(ne,se){for(var de=0;de<se.length;de++){var re=se[de];re.enumerable=re.enumerable||!1,re.configurable=!0,"value"in re&&(re.writable=!0),Object.defineProperty(ne,re.key,re)}}function Y(ne,se,de){return se&&le(ne.prototype,se),de&&le(ne,de),ne}function N(ne,se){if(!ne)return;if(typeof ne=="string")return $(ne,se);var de=Object.prototype.toString.call(ne).slice(8,-1);if(de==="Object"&&ne.constructor&&(de=ne.constructor.name),de==="Map"||de==="Set")return Array.from(ne);if(de==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(de))return $(ne,se)}function $(ne,se){(se==null||se>ne.length)&&(se=ne.length);for(var de=0,re=new Array(se);de<se;de++)re[de]=ne[de];return re}function H(ne,se){var de;if(typeof Symbol=="undefined"||ne[Symbol.iterator]==null){if(Array.isArray(ne)||(de=N(ne))||se&&ne&&typeof ne.length=="number"){de&&(ne=de);var re=0;return function(){return re>=ne.length?{done:!0}:{done:!1,value:ne[re++]}}}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 de=ne[Symbol.iterator](),de.next.bind(de)}function M(ne,se){return se={exports:{}},ne(se,se.exports),se.exports}var K=M(function(ne){function se(){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 de(re){ne.exports.defaults=re}ne.exports={defaults:se(),getDefaults:se,changeDefaults:de}}),G=K.defaults,n=K.getDefaults,O=K.changeDefaults,v=/[&<>"']/,p=/[&<>"']/g,m=/[<>"']|&(?!#?\w+;)/,u=/[<>"']|&(?!#?\w+;)/g,l={"&":"&","<":"<",">":">",'"':""","'":"'"},d=function(se){return l[se]};function o(ne,se){if(se){if(v.test(ne))return ne.replace(p,d)}else if(m.test(ne))return ne.replace(u,d);return ne}var h=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function s(ne){return ne.replace(h,function(se,de){return de=de.toLowerCase(),de==="colon"?":":de.charAt(0)==="#"?de.charAt(1)==="x"?String.fromCharCode(parseInt(de.substring(2),16)):String.fromCharCode(+de.substring(1)):""})}var a=/(^|[^\[])\^/g;function A(ne,se){ne=ne.source||ne,se=se||"";var de={replace:function(ae,pe){return pe=pe.source||pe,pe=pe.replace(a,"$1"),ne=ne.replace(ae,pe),de},getRegex:function(){return new RegExp(ne,se)}};return de}var E=/[^\w:]/g,T=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function k(ne,se,de){if(ne){var re;try{re=decodeURIComponent(s(de)).replace(E,"").toLowerCase()}catch(ae){return null}if(re.indexOf("javascript:")===0||re.indexOf("vbscript:")===0||re.indexOf("data:")===0)return null}se&&!T.test(de)&&(de=f(se,de));try{de=encodeURI(de).replace(/%25/g,"%")}catch(ae){return null}return de}var L={},S=/^[^:]+:\/*[^/]*$/,R=/^([^:]+:)[\s\S]*$/,C=/^([^:]+:\/*[^/]*)[\s\S]*$/;function f(ne,se){L[" "+ne]||(S.test(ne)?L[" "+ne]=ne+"/":L[" "+ne]=j(ne,"/",!0)),ne=L[" "+ne];var de=ne.indexOf(":")===-1;return se.substring(0,2)==="//"?de?se:ne.replace(R,"$1")+se:se.charAt(0)==="/"?de?se:ne.replace(C,"$1")+se:ne+se}var w={exec:function(){}};function y(ne){for(var se=1,de,re;se<arguments.length;se++){de=arguments[se];for(re in de)Object.prototype.hasOwnProperty.call(de,re)&&(ne[re]=de[re])}return ne}function _(ne,se){var de=ne.replace(/\|/g,function(pe,ge,_e){for(var Oe=!1,Pe=ge;--Pe>=0&&_e[Pe]==="\\";)Oe=!Oe;return Oe?"|":" |"}),re=de.split(/ \|/),ae=0;if(re.length>se)re.splice(se);else for(;re.length<se;)re.push("");for(;ae<re.length;ae++)re[ae]=re[ae].trim().replace(/\\\|/g,"|");return re}function j(ne,se,de){var re=ne.length;if(re===0)return"";for(var ae=0;ae<re;){var pe=ne.charAt(re-ae-1);if(pe===se&&!de)ae++;else if(pe!==se&&de)ae++;else break}return ne.substr(0,re-ae)}function U(ne,se){if(ne.indexOf(se[1])===-1)return-1;for(var de=ne.length,re=0,ae=0;ae<de;ae++)if(ne[ae]==="\\")ae++;else if(ne[ae]===se[0])re++;else if(ne[ae]===se[1]&&(re--,re<0))return ae;return-1}function x(ne){ne&&ne.sanitize&&!ne.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 F={escape:o,unescape:s,edit:A,cleanUrl:k,resolveUrl:f,noopTest:w,merge:y,splitCells:_,rtrim:j,findClosingBracket:U,checkSanitizeDeprecation:x},D=K.defaults,g=F.rtrim,W=F.splitCells,J=F.escape,oe=F.findClosingBracket;function fe(ne,se,de){var re=se.href,ae=se.title?J(se.title):null,pe=ne[1].replace(/\\([\[\]])/g,"$1");return ne[0].charAt(0)!=="!"?{type:"link",raw:de,href:re,title:ae,text:pe}:{type:"image",raw:de,href:re,title:ae,text:J(pe)}}function Re(ne,se){var de=ne.match(/^(\s+)(?:```)/);if(de===null)return se;var re=de[1];return se.split(`
|
|
`).map(function(ae){var pe=ae.match(/^\s+/);if(pe===null)return ae;var ge=pe[0];return ge.length>=re.length?ae.slice(re.length):ae}).join(`
|
|
`)}var be=function(){function ne(de){this.options=de||D}var se=ne.prototype;return se.space=function(re){var ae=this.rules.block.newline.exec(re);if(ae)return ae[0].length>1?{type:"space",raw:ae[0]}:{raw:`
|
|
`}},se.code=function(re,ae){var pe=this.rules.block.code.exec(re);if(pe){var ge=ae[ae.length-1];if(ge&&ge.type==="paragraph")return{raw:pe[0],text:pe[0].trimRight()};var _e=pe[0].replace(/^ {4}/gm,"");return{type:"code",raw:pe[0],codeBlockStyle:"indented",text:this.options.pedantic?_e:g(_e,`
|
|
`)}}},se.fences=function(re){var ae=this.rules.block.fences.exec(re);if(ae){var pe=ae[0],ge=Re(pe,ae[3]||"");return{type:"code",raw:pe,lang:ae[2]?ae[2].trim():ae[2],text:ge}}},se.heading=function(re){var ae=this.rules.block.heading.exec(re);if(ae)return{type:"heading",raw:ae[0],depth:ae[1].length,text:ae[2]}},se.nptable=function(re){var ae=this.rules.block.nptable.exec(re);if(ae){var pe={type:"table",header:W(ae[1].replace(/^ *| *\| *$/g,"")),align:ae[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ae[3]?ae[3].replace(/\n$/,"").split(`
|
|
`):[],raw:ae[0]};if(pe.header.length===pe.align.length){var ge=pe.align.length,_e;for(_e=0;_e<ge;_e++)/^ *-+: *$/.test(pe.align[_e])?pe.align[_e]="right":/^ *:-+: *$/.test(pe.align[_e])?pe.align[_e]="center":/^ *:-+ *$/.test(pe.align[_e])?pe.align[_e]="left":pe.align[_e]=null;for(ge=pe.cells.length,_e=0;_e<ge;_e++)pe.cells[_e]=W(pe.cells[_e],pe.header.length);return pe}}},se.hr=function(re){var ae=this.rules.block.hr.exec(re);if(ae)return{type:"hr",raw:ae[0]}},se.blockquote=function(re){var ae=this.rules.block.blockquote.exec(re);if(ae){var pe=ae[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:ae[0],text:pe}}},se.list=function(re){var ae=this.rules.block.list.exec(re);if(ae){for(var pe=ae[0],ge=ae[2],_e=ge.length>1,Oe=ge[ge.length-1]===")",Pe={type:"list",raw:pe,ordered:_e,start:_e?+ge.slice(0,-1):"",loose:!1,items:[]},ze=ae[0].match(this.rules.block.item),et=!1,nt,_t,lt,at,Rt,ot,Et,xt=ze.length,Ye=0;Ye<xt;Ye++)nt=ze[Ye],pe=nt,_t=nt.length,nt=nt.replace(/^ *([*+-]|\d+[.)]) */,""),~nt.indexOf(`
|
|
`)&&(_t-=nt.length,nt=this.options.pedantic?nt.replace(/^ {1,4}/gm,""):nt.replace(new RegExp("^ {1,"+_t+"}","gm"),"")),Ye!==xt-1&&(lt=this.rules.block.bullet.exec(ze[Ye+1])[0],(_e?lt.length===1||!Oe&<[lt.length-1]===")":lt.length>1||this.options.smartLists&<!==ge)&&(at=ze.slice(Ye+1).join(`
|
|
`),Pe.raw=Pe.raw.substring(0,Pe.raw.length-at.length),Ye=xt-1)),Rt=et||/\n\n(?!\s*$)/.test(nt),Ye!==xt-1&&(et=nt.charAt(nt.length-1)===`
|
|
`,Rt||(Rt=et)),Rt&&(Pe.loose=!0),ot=/^\[[ xX]\] /.test(nt),Et=void 0,ot&&(Et=nt[1]!==" ",nt=nt.replace(/^\[[ xX]\] +/,"")),Pe.items.push({type:"list_item",raw:pe,task:ot,checked:Et,loose:Rt,text:nt});return Pe}},se.html=function(re){var ae=this.rules.block.html.exec(re);if(ae)return{type:this.options.sanitize?"paragraph":"html",raw:ae[0],pre:!this.options.sanitizer&&(ae[1]==="pre"||ae[1]==="script"||ae[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ae[0]):J(ae[0]):ae[0]}},se.def=function(re){var ae=this.rules.block.def.exec(re);if(ae){ae[3]&&(ae[3]=ae[3].substring(1,ae[3].length-1));var pe=ae[1].toLowerCase().replace(/\s+/g," ");return{tag:pe,raw:ae[0],href:ae[2],title:ae[3]}}},se.table=function(re){var ae=this.rules.block.table.exec(re);if(ae){var pe={type:"table",header:W(ae[1].replace(/^ *| *\| *$/g,"")),align:ae[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ae[3]?ae[3].replace(/\n$/,"").split(`
|
|
`):[]};if(pe.header.length===pe.align.length){pe.raw=ae[0];var ge=pe.align.length,_e;for(_e=0;_e<ge;_e++)/^ *-+: *$/.test(pe.align[_e])?pe.align[_e]="right":/^ *:-+: *$/.test(pe.align[_e])?pe.align[_e]="center":/^ *:-+ *$/.test(pe.align[_e])?pe.align[_e]="left":pe.align[_e]=null;for(ge=pe.cells.length,_e=0;_e<ge;_e++)pe.cells[_e]=W(pe.cells[_e].replace(/^ *\| *| *\| *$/g,""),pe.header.length);return pe}}},se.lheading=function(re){var ae=this.rules.block.lheading.exec(re);if(ae)return{type:"heading",raw:ae[0],depth:ae[2].charAt(0)==="="?1:2,text:ae[1]}},se.paragraph=function(re){var ae=this.rules.block.paragraph.exec(re);if(ae)return{type:"paragraph",raw:ae[0],text:ae[1].charAt(ae[1].length-1)===`
|
|
`?ae[1].slice(0,-1):ae[1]}},se.text=function(re,ae){var pe=this.rules.block.text.exec(re);if(pe){var ge=ae[ae.length-1];return ge&&ge.type==="text"?{raw:pe[0],text:pe[0]}:{type:"text",raw:pe[0],text:pe[0]}}},se.escape=function(re){var ae=this.rules.inline.escape.exec(re);if(ae)return{type:"escape",raw:ae[0],text:J(ae[1])}},se.tag=function(re,ae,pe){var ge=this.rules.inline.tag.exec(re);if(ge)return!ae&&/^<a /i.test(ge[0])?ae=!0:ae&&/^<\/a>/i.test(ge[0])&&(ae=!1),!pe&&/^<(pre|code|kbd|script)(\s|>)/i.test(ge[0])?pe=!0:pe&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(ge[0])&&(pe=!1),{type:this.options.sanitize?"text":"html",raw:ge[0],inLink:ae,inRawBlock:pe,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ge[0]):J(ge[0]):ge[0]}},se.link=function(re){var ae=this.rules.inline.link.exec(re);if(ae){var pe=oe(ae[2],"()");if(pe>-1){var ge=ae[0].indexOf("!")===0?5:4,_e=ge+ae[1].length+pe;ae[2]=ae[2].substring(0,pe),ae[0]=ae[0].substring(0,_e).trim(),ae[3]=""}var Oe=ae[2],Pe="";if(this.options.pedantic){var ze=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Oe);ze?(Oe=ze[1],Pe=ze[3]):Pe=""}else Pe=ae[3]?ae[3].slice(1,-1):"";Oe=Oe.trim().replace(/^<([\s\S]*)>$/,"$1");var et=fe(ae,{href:Oe&&Oe.replace(this.rules.inline._escapes,"$1"),title:Pe&&Pe.replace(this.rules.inline._escapes,"$1")},ae[0]);return et}},se.reflink=function(re,ae){var pe;if((pe=this.rules.inline.reflink.exec(re))||(pe=this.rules.inline.nolink.exec(re))){var ge=(pe[2]||pe[1]).replace(/\s+/g," ");if(ge=ae[ge.toLowerCase()],!ge||!ge.href){var _e=pe[0].charAt(0);return{type:"text",raw:_e,text:_e}}var Oe=fe(pe,ge,pe[0]);return Oe}},se.strong=function(re,ae,pe){pe===void 0&&(pe="");var ge=this.rules.inline.strong.start.exec(re);if(ge&&(!ge[1]||ge[1]&&(pe===""||this.rules.inline.punctuation.exec(pe)))){ae=ae.slice(-1*re.length);var _e=ge[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;_e.lastIndex=0;for(var Oe;(ge=_e.exec(ae))!=null;)if(Oe=this.rules.inline.strong.middle.exec(ae.slice(0,ge.index+3)),Oe)return{type:"strong",raw:re.slice(0,Oe[0].length),text:re.slice(2,Oe[0].length-2)}}},se.em=function(re,ae,pe){pe===void 0&&(pe="");var ge=this.rules.inline.em.start.exec(re);if(ge&&(!ge[1]||ge[1]&&(pe===""||this.rules.inline.punctuation.exec(pe)))){ae=ae.slice(-1*re.length);var _e=ge[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;_e.lastIndex=0;for(var Oe;(ge=_e.exec(ae))!=null;)if(Oe=this.rules.inline.em.middle.exec(ae.slice(0,ge.index+2)),Oe)return{type:"em",raw:re.slice(0,Oe[0].length),text:re.slice(1,Oe[0].length-1)}}},se.codespan=function(re){var ae=this.rules.inline.code.exec(re);if(ae){var pe=ae[2].replace(/\n/g," "),ge=/[^ ]/.test(pe),_e=pe.startsWith(" ")&&pe.endsWith(" ");return ge&&_e&&(pe=pe.substring(1,pe.length-1)),pe=J(pe,!0),{type:"codespan",raw:ae[0],text:pe}}},se.br=function(re){var ae=this.rules.inline.br.exec(re);if(ae)return{type:"br",raw:ae[0]}},se.del=function(re){var ae=this.rules.inline.del.exec(re);if(ae)return{type:"del",raw:ae[0],text:ae[1]}},se.autolink=function(re,ae){var pe=this.rules.inline.autolink.exec(re);if(pe){var ge,_e;return pe[2]==="@"?(ge=J(this.options.mangle?ae(pe[1]):pe[1]),_e="mailto:"+ge):(ge=J(pe[1]),_e=ge),{type:"link",raw:pe[0],text:ge,href:_e,tokens:[{type:"text",raw:ge,text:ge}]}}},se.url=function(re,ae){var pe;if(pe=this.rules.inline.url.exec(re)){var ge,_e;if(pe[2]==="@")ge=J(this.options.mangle?ae(pe[0]):pe[0]),_e="mailto:"+ge;else{var Oe;do Oe=pe[0],pe[0]=this.rules.inline._backpedal.exec(pe[0])[0];while(Oe!==pe[0]);ge=J(pe[0]),pe[1]==="www."?_e="http://"+ge:_e=ge}return{type:"link",raw:pe[0],text:ge,href:_e,tokens:[{type:"text",raw:ge,text:ge}]}}},se.inlineText=function(re,ae,pe){var ge=this.rules.inline.text.exec(re);if(ge){var _e;return ae?_e=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ge[0]):J(ge[0]):ge[0]:_e=J(this.options.smartypants?pe(ge[0]):ge[0]),{type:"text",raw:ge[0],text:_e}}},ne}(),Le=F.noopTest,Ce=F.edit,Te=F.merge,ve={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:Le,table:Le,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};ve._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,ve._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ve.def=Ce(ve.def).replace("label",ve._label).replace("title",ve._title).getRegex(),ve.bullet=/(?:[*+-]|\d{1,9}[.)])/,ve.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,ve.item=Ce(ve.item,"gm").replace(/bull/g,ve.bullet).getRegex(),ve.list=Ce(ve.list).replace(/bull/g,ve.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ve.def.source+")").getRegex(),ve._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",ve._comment=/<!--(?!-?>)[\s\S]*?-->/,ve.html=Ce(ve.html,"i").replace("comment",ve._comment).replace("tag",ve._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ve.paragraph=Ce(ve._paragraph).replace("hr",ve.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",ve._tag).getRegex(),ve.blockquote=Ce(ve.blockquote).replace("paragraph",ve.paragraph).getRegex(),ve.normal=Te({},ve),ve.gfm=Te({},ve.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*|$)"}),ve.gfm.nptable=Ce(ve.gfm.nptable).replace("hr",ve.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",ve._tag).getRegex(),ve.gfm.table=Ce(ve.gfm.table).replace("hr",ve.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",ve._tag).getRegex(),ve.pedantic=Te({},ve.normal,{html:Ce(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ve._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:Le,paragraph:Ce(ve.normal._paragraph).replace("hr",ve.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",ve.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var X={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Le,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:Le,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};X._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",X.punctuation=Ce(X.punctuation).replace(/punctuation/g,X._punctuation).getRegex(),X._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",X._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",X.em.start=Ce(X.em.start).replace(/punctuation/g,X._punctuation).getRegex(),X.em.middle=Ce(X.em.middle).replace(/punctuation/g,X._punctuation).replace(/overlapSkip/g,X._overlapSkip).getRegex(),X.em.endAst=Ce(X.em.endAst,"g").replace(/punctuation/g,X._punctuation).getRegex(),X.em.endUnd=Ce(X.em.endUnd,"g").replace(/punctuation/g,X._punctuation).getRegex(),X.strong.start=Ce(X.strong.start).replace(/punctuation/g,X._punctuation).getRegex(),X.strong.middle=Ce(X.strong.middle).replace(/punctuation/g,X._punctuation).replace(/blockSkip/g,X._blockSkip).getRegex(),X.strong.endAst=Ce(X.strong.endAst,"g").replace(/punctuation/g,X._punctuation).getRegex(),X.strong.endUnd=Ce(X.strong.endUnd,"g").replace(/punctuation/g,X._punctuation).getRegex(),X.blockSkip=Ce(X._blockSkip,"g").getRegex(),X.overlapSkip=Ce(X._overlapSkip,"g").getRegex(),X._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,X._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,X._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])?)+(?![-_])/,X.autolink=Ce(X.autolink).replace("scheme",X._scheme).replace("email",X._email).getRegex(),X._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,X.tag=Ce(X.tag).replace("comment",ve._comment).replace("attribute",X._attribute).getRegex(),X._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,X._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,X._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,X.link=Ce(X.link).replace("label",X._label).replace("href",X._href).replace("title",X._title).getRegex(),X.reflink=Ce(X.reflink).replace("label",X._label).getRegex(),X.reflinkSearch=Ce(X.reflinkSearch,"g").replace("reflink",X.reflink).replace("nolink",X.nolink).getRegex(),X.normal=Te({},X),X.pedantic=Te({},X.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Ce(/^!?\[(label)\]\((.*?)\)/).replace("label",X._label).getRegex(),reflink:Ce(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",X._label).getRegex()}),X.gfm=Te({},X.normal,{escape:Ce(X.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),X.gfm.url=Ce(X.gfm.url,"i").replace("email",X.gfm._extended_email).getRegex(),X.breaks=Te({},X.gfm,{br:Ce(X.br).replace("{2,}","*").getRegex(),text:Ce(X.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var b={block:ve,inline:X},I=K.defaults,B=b.block,Q=b.inline;function z(ne){return ne.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 he(ne){var se="",de,re,ae=ne.length;for(de=0;de<ae;de++)re=ne.charCodeAt(de),Math.random()>.5&&(re="x"+re.toString(16)),se+="&#"+re+";";return se}var xe=function(){function ne(de){this.tokens=[],this.tokens.links=Object.create(null),this.options=de||I,this.options.tokenizer=this.options.tokenizer||new be,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var re={block:B.normal,inline:Q.normal};this.options.pedantic?(re.block=B.pedantic,re.inline=Q.pedantic):this.options.gfm&&(re.block=B.gfm,this.options.breaks?re.inline=Q.breaks:re.inline=Q.gfm),this.tokenizer.rules=re}ne.lex=function(re,ae){var pe=new ne(ae);return pe.lex(re)};var se=ne.prototype;return se.lex=function(re){return re=re.replace(/\r\n|\r/g,`
|
|
`).replace(/\t/g," "),this.blockTokens(re,this.tokens,!0),this.inline(this.tokens),this.tokens},se.blockTokens=function(re,ae,pe){ae===void 0&&(ae=[]),pe===void 0&&(pe=!0),re=re.replace(/^ +$/gm,"");for(var ge,_e,Oe,Pe;re;){if(ge=this.tokenizer.space(re)){re=re.substring(ge.raw.length),ge.type&&ae.push(ge);continue}if(ge=this.tokenizer.code(re,ae)){re=re.substring(ge.raw.length),ge.type?ae.push(ge):(Pe=ae[ae.length-1],Pe.raw+=`
|
|
`+ge.raw,Pe.text+=`
|
|
`+ge.text);continue}if(ge=this.tokenizer.fences(re)){re=re.substring(ge.raw.length),ae.push(ge);continue}if(ge=this.tokenizer.heading(re)){re=re.substring(ge.raw.length),ae.push(ge);continue}if(ge=this.tokenizer.nptable(re)){re=re.substring(ge.raw.length),ae.push(ge);continue}if(ge=this.tokenizer.hr(re)){re=re.substring(ge.raw.length),ae.push(ge);continue}if(ge=this.tokenizer.blockquote(re)){re=re.substring(ge.raw.length),ge.tokens=this.blockTokens(ge.text,[],pe),ae.push(ge);continue}if(ge=this.tokenizer.list(re)){for(re=re.substring(ge.raw.length),Oe=ge.items.length,_e=0;_e<Oe;_e++)ge.items[_e].tokens=this.blockTokens(ge.items[_e].text,[],!1);ae.push(ge);continue}if(ge=this.tokenizer.html(re)){re=re.substring(ge.raw.length),ae.push(ge);continue}if(pe&&(ge=this.tokenizer.def(re))){re=re.substring(ge.raw.length),this.tokens.links[ge.tag]||(this.tokens.links[ge.tag]={href:ge.href,title:ge.title});continue}if(ge=this.tokenizer.table(re)){re=re.substring(ge.raw.length),ae.push(ge);continue}if(ge=this.tokenizer.lheading(re)){re=re.substring(ge.raw.length),ae.push(ge);continue}if(pe&&(ge=this.tokenizer.paragraph(re))){re=re.substring(ge.raw.length),ae.push(ge);continue}if(ge=this.tokenizer.text(re,ae)){re=re.substring(ge.raw.length),ge.type?ae.push(ge):(Pe=ae[ae.length-1],Pe.raw+=`
|
|
`+ge.raw,Pe.text+=`
|
|
`+ge.text);continue}if(re){var ze="Infinite loop on byte: "+re.charCodeAt(0);if(this.options.silent){console.error(ze);break}else throw new Error(ze)}}return ae},se.inline=function(re){var ae,pe,ge,_e,Oe,Pe,ze=re.length;for(ae=0;ae<ze;ae++){Pe=re[ae];switch(Pe.type){case"paragraph":case"text":case"heading":{Pe.tokens=[],this.inlineTokens(Pe.text,Pe.tokens);break}case"table":{for(Pe.tokens={header:[],cells:[]},_e=Pe.header.length,pe=0;pe<_e;pe++)Pe.tokens.header[pe]=[],this.inlineTokens(Pe.header[pe],Pe.tokens.header[pe]);for(_e=Pe.cells.length,pe=0;pe<_e;pe++)for(Oe=Pe.cells[pe],Pe.tokens.cells[pe]=[],ge=0;ge<Oe.length;ge++)Pe.tokens.cells[pe][ge]=[],this.inlineTokens(Oe[ge],Pe.tokens.cells[pe][ge]);break}case"blockquote":{this.inline(Pe.tokens);break}case"list":{for(_e=Pe.items.length,pe=0;pe<_e;pe++)this.inline(Pe.items[pe].tokens);break}}}return re},se.inlineTokens=function(re,ae,pe,ge,_e){ae===void 0&&(ae=[]),pe===void 0&&(pe=!1),ge===void 0&&(ge=!1),_e===void 0&&(_e="");var Oe,Pe=re,ze;if(this.tokens.links){var et=Object.keys(this.tokens.links);if(et.length>0)for(;(ze=this.tokenizer.rules.inline.reflinkSearch.exec(Pe))!=null;)et.includes(ze[0].slice(ze[0].lastIndexOf("[")+1,-1))&&(Pe=Pe.slice(0,ze.index)+"["+"a".repeat(ze[0].length-2)+"]"+Pe.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(ze=this.tokenizer.rules.inline.blockSkip.exec(Pe))!=null;)Pe=Pe.slice(0,ze.index)+"["+"a".repeat(ze[0].length-2)+"]"+Pe.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;re;){if(Oe=this.tokenizer.escape(re)){re=re.substring(Oe.raw.length),ae.push(Oe);continue}if(Oe=this.tokenizer.tag(re,pe,ge)){re=re.substring(Oe.raw.length),pe=Oe.inLink,ge=Oe.inRawBlock,ae.push(Oe);continue}if(Oe=this.tokenizer.link(re)){re=re.substring(Oe.raw.length),Oe.type==="link"&&(Oe.tokens=this.inlineTokens(Oe.text,[],!0,ge)),ae.push(Oe);continue}if(Oe=this.tokenizer.reflink(re,this.tokens.links)){re=re.substring(Oe.raw.length),Oe.type==="link"&&(Oe.tokens=this.inlineTokens(Oe.text,[],!0,ge)),ae.push(Oe);continue}if(Oe=this.tokenizer.strong(re,Pe,_e)){re=re.substring(Oe.raw.length),Oe.tokens=this.inlineTokens(Oe.text,[],pe,ge),ae.push(Oe);continue}if(Oe=this.tokenizer.em(re,Pe,_e)){re=re.substring(Oe.raw.length),Oe.tokens=this.inlineTokens(Oe.text,[],pe,ge),ae.push(Oe);continue}if(Oe=this.tokenizer.codespan(re)){re=re.substring(Oe.raw.length),ae.push(Oe);continue}if(Oe=this.tokenizer.br(re)){re=re.substring(Oe.raw.length),ae.push(Oe);continue}if(Oe=this.tokenizer.del(re)){re=re.substring(Oe.raw.length),Oe.tokens=this.inlineTokens(Oe.text,[],pe,ge),ae.push(Oe);continue}if(Oe=this.tokenizer.autolink(re,he)){re=re.substring(Oe.raw.length),ae.push(Oe);continue}if(!pe&&(Oe=this.tokenizer.url(re,he))){re=re.substring(Oe.raw.length),ae.push(Oe);continue}if(Oe=this.tokenizer.inlineText(re,ge,z)){re=re.substring(Oe.raw.length),_e=Oe.raw.slice(-1),ae.push(Oe);continue}if(re){var nt="Infinite loop on byte: "+re.charCodeAt(0);if(this.options.silent){console.error(nt);break}else throw new Error(nt)}}return ae},Y(ne,null,[{key:"rules",get:function(){return{block:B,inline:Q}}}]),ne}(),Ie=K.defaults,ue=F.cleanUrl,me=F.escape,we=function(){function ne(de){this.options=de||Ie}var se=ne.prototype;return se.code=function(re,ae,pe){var ge=(ae||"").match(/\S*/)[0];if(this.options.highlight){var _e=this.options.highlight(re,ge);_e!=null&&_e!==re&&(pe=!0,re=_e)}return ge?'<pre><code class="'+this.options.langPrefix+me(ge,!0)+'">'+(pe?re:me(re,!0))+`</code></pre>
|
|
`:"<pre><code>"+(pe?re:me(re,!0))+`</code></pre>
|
|
`},se.blockquote=function(re){return`<blockquote>
|
|
`+re+`</blockquote>
|
|
`},se.html=function(re){return re},se.heading=function(re,ae,pe,ge){return this.options.headerIds?"<h"+ae+' id="'+this.options.headerPrefix+ge.slug(pe)+'">'+re+"</h"+ae+`>
|
|
`:"<h"+ae+">"+re+"</h"+ae+`>
|
|
`},se.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},se.list=function(re,ae,pe){var ge=ae?"ol":"ul",_e=ae&&pe!==1?' start="'+pe+'"':"";return"<"+ge+_e+`>
|
|
`+re+"</"+ge+`>
|
|
`},se.listitem=function(re){return"<li>"+re+`</li>
|
|
`},se.checkbox=function(re){return"<input "+(re?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},se.paragraph=function(re){return"<p>"+re+`</p>
|
|
`},se.table=function(re,ae){return ae&&(ae="<tbody>"+ae+"</tbody>"),`<table>
|
|
<thead>
|
|
`+re+`</thead>
|
|
`+ae+`</table>
|
|
`},se.tablerow=function(re){return`<tr>
|
|
`+re+`</tr>
|
|
`},se.tablecell=function(re,ae){var pe=ae.header?"th":"td",ge=ae.align?"<"+pe+' align="'+ae.align+'">':"<"+pe+">";return ge+re+"</"+pe+`>
|
|
`},se.strong=function(re){return"<strong>"+re+"</strong>"},se.em=function(re){return"<em>"+re+"</em>"},se.codespan=function(re){return"<code>"+re+"</code>"},se.br=function(){return this.options.xhtml?"<br/>":"<br>"},se.del=function(re){return"<del>"+re+"</del>"},se.link=function(re,ae,pe){if(re=ue(this.options.sanitize,this.options.baseUrl,re),re===null)return pe;var ge='<a href="'+me(re)+'"';return ae&&(ge+=' title="'+ae+'"'),ge+=">"+pe+"</a>",ge},se.image=function(re,ae,pe){if(re=ue(this.options.sanitize,this.options.baseUrl,re),re===null)return pe;var ge='<img src="'+re+'" alt="'+pe+'"';return ae&&(ge+=' title="'+ae+'"'),ge+=this.options.xhtml?"/>":">",ge},se.text=function(re){return re},ne}(),Ae=function(){function ne(){}var se=ne.prototype;return se.strong=function(re){return re},se.em=function(re){return re},se.codespan=function(re){return re},se.del=function(re){return re},se.html=function(re){return re},se.text=function(re){return re},se.link=function(re,ae,pe){return""+pe},se.image=function(re,ae,pe){return""+pe},se.br=function(){return""},ne}(),Ne=function(){function ne(){this.seen={}}var se=ne.prototype;return se.slug=function(re){var ae=re.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(ae)){var pe=ae;do this.seen[pe]++,ae=pe+"-"+this.seen[pe];while(this.seen.hasOwnProperty(ae))}return this.seen[ae]=0,ae},ne}(),Be=K.defaults,Ke=F.unescape,Ge=function(){function ne(de){this.options=de||Be,this.options.renderer=this.options.renderer||new we,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ae,this.slugger=new Ne}ne.parse=function(re,ae){var pe=new ne(ae);return pe.parse(re)};var se=ne.prototype;return se.parse=function(re,ae){ae===void 0&&(ae=!0);var pe="",ge,_e,Oe,Pe,ze,et,nt,_t,lt,at,Rt,ot,Et,xt,Ye,Qt,nn,Kt,Pt=re.length;for(ge=0;ge<Pt;ge++){at=re[ge];switch(at.type){case"space":continue;case"hr":{pe+=this.renderer.hr();continue}case"heading":{pe+=this.renderer.heading(this.parseInline(at.tokens),at.depth,Ke(this.parseInline(at.tokens,this.textRenderer)),this.slugger);continue}case"code":{pe+=this.renderer.code(at.text,at.lang,at.escaped);continue}case"table":{for(_t="",nt="",Pe=at.header.length,_e=0;_e<Pe;_e++)nt+=this.renderer.tablecell(this.parseInline(at.tokens.header[_e]),{header:!0,align:at.align[_e]});for(_t+=this.renderer.tablerow(nt),lt="",Pe=at.cells.length,_e=0;_e<Pe;_e++){for(et=at.tokens.cells[_e],nt="",ze=et.length,Oe=0;Oe<ze;Oe++)nt+=this.renderer.tablecell(this.parseInline(et[Oe]),{header:!1,align:at.align[Oe]});lt+=this.renderer.tablerow(nt)}pe+=this.renderer.table(_t,lt);continue}case"blockquote":{lt=this.parse(at.tokens),pe+=this.renderer.blockquote(lt);continue}case"list":{for(Rt=at.ordered,ot=at.start,Et=at.loose,Pe=at.items.length,lt="",_e=0;_e<Pe;_e++)Ye=at.items[_e],Qt=Ye.checked,nn=Ye.task,xt="",Ye.task&&(Kt=this.renderer.checkbox(Qt),Et?Ye.tokens.length>0&&Ye.tokens[0].type==="text"?(Ye.tokens[0].text=Kt+" "+Ye.tokens[0].text,Ye.tokens[0].tokens&&Ye.tokens[0].tokens.length>0&&Ye.tokens[0].tokens[0].type==="text"&&(Ye.tokens[0].tokens[0].text=Kt+" "+Ye.tokens[0].tokens[0].text)):Ye.tokens.unshift({type:"text",text:Kt}):xt+=Kt),xt+=this.parse(Ye.tokens,Et),lt+=this.renderer.listitem(xt,nn,Qt);pe+=this.renderer.list(lt,Rt,ot);continue}case"html":{pe+=this.renderer.html(at.text);continue}case"paragraph":{pe+=this.renderer.paragraph(this.parseInline(at.tokens));continue}case"text":{for(lt=at.tokens?this.parseInline(at.tokens):at.text;ge+1<Pt&&re[ge+1].type==="text";)at=re[++ge],lt+=`
|
|
`+(at.tokens?this.parseInline(at.tokens):at.text);pe+=ae?this.renderer.paragraph(lt):lt;continue}default:{var dt='Token with "'+at.type+'" type was not found.';if(this.options.silent){console.error(dt);return}else throw new Error(dt)}}}return pe},se.parseInline=function(re,ae){ae=ae||this.renderer;var pe="",ge,_e,Oe=re.length;for(ge=0;ge<Oe;ge++){_e=re[ge];switch(_e.type){case"escape":{pe+=ae.text(_e.text);break}case"html":{pe+=ae.html(_e.text);break}case"link":{pe+=ae.link(_e.href,_e.title,this.parseInline(_e.tokens,ae));break}case"image":{pe+=ae.image(_e.href,_e.title,_e.text);break}case"strong":{pe+=ae.strong(this.parseInline(_e.tokens,ae));break}case"em":{pe+=ae.em(this.parseInline(_e.tokens,ae));break}case"codespan":{pe+=ae.codespan(_e.text);break}case"br":{pe+=ae.br();break}case"del":{pe+=ae.del(this.parseInline(_e.tokens,ae));break}case"text":{pe+=ae.text(_e.text);break}default:{var Pe='Token with "'+_e.type+'" type was not found.';if(this.options.silent){console.error(Pe);return}else throw new Error(Pe)}}}return pe},ne}(),$e=F.merge,je=F.checkSanitizeDeprecation,We=F.escape,Me=K.getDefaults,tt=K.changeDefaults,rt=K.defaults;function ce(ne,se,de){if(typeof ne=="undefined"||ne===null)throw new Error("marked(): input parameter is undefined or null");if(typeof ne!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(ne)+", string expected");if(typeof se=="function"&&(de=se,se=null),se=$e({},ce.defaults,se||{}),je(se),de){var re=se.highlight,ae;try{ae=xe.lex(ne,se)}catch(Oe){return de(Oe)}var pe=function(Pe){var ze;if(!Pe)try{ze=Ge.parse(ae,se)}catch(et){Pe=et}return se.highlight=re,Pe?de(Pe):de(null,ze)};if(!re||re.length<3)return pe();if(delete se.highlight,!ae.length)return pe();var ge=0;ce.walkTokens(ae,function(Oe){Oe.type==="code"&&(ge++,setTimeout(function(){re(Oe.text,Oe.lang,function(Pe,ze){if(Pe)return pe(Pe);ze!=null&&ze!==Oe.text&&(Oe.text=ze,Oe.escaped=!0),ge--,ge===0&&pe()})},0))}),ge===0&&pe();return}try{var _e=xe.lex(ne,se);return se.walkTokens&&ce.walkTokens(_e,se.walkTokens),Ge.parse(_e,se)}catch(Oe){if(Oe.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,se.silent)return"<p>An error occurred:</p><pre>"+We(Oe.message+"",!0)+"</pre>";throw Oe}}ce.options=ce.setOptions=function(ne){return $e(ce.defaults,ne),tt(ce.defaults),ce},ce.getDefaults=Me,ce.defaults=rt,ce.use=function(ne){var se=$e({},ne);if(ne.renderer&&function(){var re=ce.defaults.renderer||new we,ae=function(_e){var Oe=re[_e];re[_e]=function(){for(var Pe=arguments.length,ze=new Array(Pe),et=0;et<Pe;et++)ze[et]=arguments[et];var nt=ne.renderer[_e].apply(re,ze);return nt===!1&&(nt=Oe.apply(re,ze)),nt}};for(var pe in ne.renderer)ae(pe);se.renderer=re}(),ne.tokenizer&&function(){var re=ce.defaults.tokenizer||new be,ae=function(_e){var Oe=re[_e];re[_e]=function(){for(var Pe=arguments.length,ze=new Array(Pe),et=0;et<Pe;et++)ze[et]=arguments[et];var nt=ne.tokenizer[_e].apply(re,ze);return nt===!1&&(nt=Oe.apply(re,ze)),nt}};for(var pe in ne.tokenizer)ae(pe);se.tokenizer=re}(),ne.walkTokens){var de=ce.defaults.walkTokens;se.walkTokens=function(re){ne.walkTokens(re),de&&de(re)}}ce.setOptions(se)},ce.walkTokens=function(ne,se){for(var de=H(ne),re;!(re=de()).done;){var ae=re.value;se(ae);switch(ae.type){case"table":{for(var pe=H(ae.tokens.header),ge;!(ge=pe()).done;){var _e=ge.value;ce.walkTokens(_e,se)}for(var Oe=H(ae.tokens.cells),Pe;!(Pe=Oe()).done;)for(var ze=Pe.value,et=H(ze),nt;!(nt=et()).done;){var _t=nt.value;ce.walkTokens(_t,se)}break}case"list":{ce.walkTokens(ae.items,se);break}default:ae.tokens&&ce.walkTokens(ae.tokens,se)}}},ce.Parser=Ge,ce.parser=Ge.parse,ce.Renderer=we,ce.TextRenderer=Ae,ce.Lexer=xe,ce.lexer=xe.lex,ce.Tokenizer=be,ce.Slugger=Ne,ce.parse=ce;var ee=ce;return ee})},ELLl:function(Ze,Se,q){(function(le){le(q("VrN/"))})(function(le){var Y={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},N=le.Pos;le.defineOption("autoCloseBrackets",!1,function(l,d,o){o&&o!=le.Init&&(l.removeKeyMap(H),l.state.closeBrackets=null),d&&(M($(d,"pairs")),l.state.closeBrackets=d,l.addKeyMap(H))});function $(l,d){return d=="pairs"&&typeof l=="string"?l:typeof l=="object"&&l[d]!=null?l[d]:Y[d]}var H={Backspace:n,Enter:O};function M(l){for(var d=0;d<l.length;d++){var o=l.charAt(d),h="'"+o+"'";H[h]||(H[h]=K(o))}}M(Y.pairs+"`");function K(l){return function(d){return p(d,l)}}function G(l){var d=l.state.closeBrackets;if(!d||d.override)return d;var o=l.getModeAt(l.getCursor());return o.closeBrackets||d}function n(l){var d=G(l);if(!d||l.getOption("disableInput"))return le.Pass;for(var o=$(d,"pairs"),h=l.listSelections(),s=0;s<h.length;s++){if(!h[s].empty())return le.Pass;var a=m(l,h[s].head);if(!a||o.indexOf(a)%2!=0)return le.Pass}for(var s=h.length-1;s>=0;s--){var A=h[s].head;l.replaceRange("",N(A.line,A.ch-1),N(A.line,A.ch+1),"+delete")}}function O(l){var d=G(l),o=d&&$(d,"explode");if(!o||l.getOption("disableInput"))return le.Pass;for(var h=l.listSelections(),s=0;s<h.length;s++){if(!h[s].empty())return le.Pass;var a=m(l,h[s].head);if(!a||o.indexOf(a)%2!=0)return le.Pass}l.operation(function(){var A=l.lineSeparator()||`
|
|
`;l.replaceSelection(A+A,null),l.execCommand("goCharLeft"),h=l.listSelections();for(var E=0;E<h.length;E++){var T=h[E].head.line;l.indentLine(T,null,!0),l.indentLine(T+1,null,!0)}})}function v(l){var d=le.cmpPos(l.anchor,l.head)>0;return{anchor:new N(l.anchor.line,l.anchor.ch+(d?-1:1)),head:new N(l.head.line,l.head.ch+(d?1:-1))}}function p(l,d){var o=G(l);if(!o||l.getOption("disableInput"))return le.Pass;var h=$(o,"pairs"),s=h.indexOf(d);if(s==-1)return le.Pass;for(var a=$(o,"closeBefore"),A=$(o,"triples"),E=h.charAt(s+1)==d,T=l.listSelections(),k=s%2==0,L,S=0;S<T.length;S++){var R=T[S],C=R.head,f,w=l.getRange(C,N(C.line,C.ch+1));if(k&&!R.empty())f="surround";else if((E||!k)&&w==d)E&&u(l,C)?f="both":A.indexOf(d)>=0&&l.getRange(C,N(C.line,C.ch+3))==d+d+d?f="skipThree":f="skip";else if(E&&C.ch>1&&A.indexOf(d)>=0&&l.getRange(N(C.line,C.ch-2),C)==d+d){if(C.ch>2&&/\bstring/.test(l.getTokenTypeAt(N(C.line,C.ch-2))))return le.Pass;f="addFour"}else if(E){var y=C.ch==0?" ":l.getRange(N(C.line,C.ch-1),C);if(!le.isWordChar(w)&&y!=d&&!le.isWordChar(y))f="both";else return le.Pass}else if(k&&(w.length===0||/\s/.test(w)||a.indexOf(w)>-1))f="both";else return le.Pass;if(!L)L=f;else if(L!=f)return le.Pass}var _=s%2?h.charAt(s-1):d,j=s%2?d:h.charAt(s+1);l.operation(function(){if(L=="skip")l.execCommand("goCharRight");else if(L=="skipThree")for(var U=0;U<3;U++)l.execCommand("goCharRight");else if(L=="surround"){for(var x=l.getSelections(),U=0;U<x.length;U++)x[U]=_+x[U]+j;l.replaceSelections(x,"around"),x=l.listSelections().slice();for(var U=0;U<x.length;U++)x[U]=v(x[U]);l.setSelections(x)}else L=="both"?(l.replaceSelection(_+j,null),l.triggerElectric(_+j),l.execCommand("goCharLeft")):L=="addFour"&&(l.replaceSelection(_+_+_+_,"before"),l.execCommand("goCharRight"))})}function m(l,d){var o=l.getRange(N(d.line,d.ch-1),N(d.line,d.ch+1));return o.length==2?o:null}function u(l,d){var o=l.getTokenAt(N(d.line,d.ch+1));return/\bstring/.test(o.type)&&o.start==d.ch&&(d.ch==0||!/\bstring/.test(l.getTokenTypeAt(d)))}})},FWmy:function(Ze,Se,q){"use strict";q.d(Se,"a",function(){return le});function le(Y,N){if(!Y)throw new Error(N?`Assertion failed (${N})`:"Assertion Failed")}},GfqC:function(Ze,Se,q){"use strict";var le=q("q1tI"),Y=q.n(le),N=q("TSYQ"),$=q.n(N);function H(F,D){var g="cannot "+F.method+" "+F.action+" "+D.status+"'",W=new Error(g);return W.status=D.status,W.method=F.method,W.url=F.action,W}function M(F){var D=F.responseText||F.response;if(!D)return D;try{return JSON.parse(D)}catch(g){return D}}function K(F){var D=new XMLHttpRequest;F.onProgress&&D.upload&&(D.upload.onprogress=function(oe){oe.total>0&&(oe.percent=oe.loaded/oe.total*100),F.onProgress(oe)});var g=new FormData;F.data&&Object.keys(F.data).forEach(function(J){var oe=F.data[J];if(Array.isArray(oe)){oe.forEach(function(fe){g.append(J+"[]",fe)});return}g.append(J,F.data[J])}),F.file instanceof Blob?g.append(F.filename,F.file,F.file.name):g.append(F.filename,F.file),D.onerror=function(oe){F.onError(oe)},D.onload=function(){return D.status<200||D.status>=300?F.onError(H(F,D),M(D)):F.onSuccess(M(D),D)},D.open(F.method,F.action,!0),F.withCredentials&&"withCredentials"in D&&(D.withCredentials=!0);var W=F.headers||{};return W["X-Requested-With"]!==null&&D.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(W).forEach(function(J){W[J]!==null&&D.setRequestHeader(J,W[J])}),D.send(g),{abort:function(){D.abort()}}}var G=+new Date,n=0;function O(){return"rc-upload-"+G+"-"+ ++n}function v(F,D){return F.indexOf(D,F.length-D.length)!==-1}var p=function(F,D){if(F&&D){var g=Array.isArray(D)?D:D.split(","),W=F.name||"",J=F.type||"",oe=J.replace(/\/.*$/,"");return g.some(function(fe){var Re=fe.trim();return Re.charAt(0)==="."?v(W.toLowerCase(),Re.toLowerCase()):/\/\*$/.test(Re)?oe===Re.replace(/\/.*$/,""):J===Re})}return!0};function m(F,D){var g=F.createReader(),W=[];function J(){g.readEntries(function(oe){var fe=Array.prototype.slice.apply(oe);W=W.concat(fe);var Re=!fe.length;Re?D(W):J()})}J()}var u=function(D,g,W){var J=function oe(fe,Re){Re=Re||"",fe.isFile?fe.file(function(be){W(be)&&(fe.fullPath&&!be.webkitRelativePath&&(Object.defineProperties(be,{webkitRelativePath:{writable:!0}}),be.webkitRelativePath=fe.fullPath.replace(/^\//,""),Object.defineProperties(be,{webkitRelativePath:{writable:!1}})),g([be]))}):fe.isDirectory&&m(fe,function(be){be.forEach(function(Le){oe(Le,""+Re+fe.name+"/")})})};D.forEach(function(oe){J(oe.webkitGetAsEntry())})},l=u,d=Object.assign||function(F){for(var D=1;D<arguments.length;D++){var g=arguments[D];for(var W in g)Object.prototype.hasOwnProperty.call(g,W)&&(F[W]=g[W])}return F},o=function(){function F(D,g){var W=[],J=!0,oe=!1,fe=void 0;try{for(var Re=D[Symbol.iterator](),be;!(J=(be=Re.next()).done)&&!(W.push(be.value),g&&W.length===g);J=!0);}catch(Le){oe=!0,fe=Le}finally{try{!J&&Re.return&&Re.return()}finally{if(oe)throw fe}}return W}return function(D,g){if(Array.isArray(D))return D;if(Symbol.iterator in Object(D))return F(D,g);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),h=function(){function F(D,g){for(var W=0;W<g.length;W++){var J=g[W];J.enumerable=J.enumerable||!1,J.configurable=!0,"value"in J&&(J.writable=!0),Object.defineProperty(D,J.key,J)}}return function(D,g,W){return g&&F(D.prototype,g),W&&F(D,W),D}}();function s(F,D,g){return D in F?Object.defineProperty(F,D,{value:g,enumerable:!0,configurable:!0,writable:!0}):F[D]=g,F}function a(F,D){var g={};for(var W in F){if(D.indexOf(W)>=0)continue;if(!Object.prototype.hasOwnProperty.call(F,W))continue;g[W]=F[W]}return g}function A(F,D){if(!(F instanceof D))throw new TypeError("Cannot call a class as a function")}function E(F,D){if(!F)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return D&&(typeof D=="object"||typeof D=="function")?D:F}function T(F,D){if(typeof D!="function"&&D!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof D);F.prototype=Object.create(D&&D.prototype,{constructor:{value:F,enumerable:!1,writable:!0,configurable:!0}}),D&&(Object.setPrototypeOf?Object.setPrototypeOf(F,D):F.__proto__=D)}var k=function(D){return Object.keys(D).reduce(function(g,W){return(W.substr(0,5)==="data-"||W.substr(0,5)==="aria-"||W==="role")&&(g[W]=D[W]),g},{})},L=function(F){T(D,F);function D(){var g,W,J,oe;A(this,D);for(var fe=arguments.length,Re=Array(fe),be=0;be<fe;be++)Re[be]=arguments[be];return oe=(W=(J=E(this,(g=D.__proto__||Object.getPrototypeOf(D)).call.apply(g,[this].concat(Re))),J),J.state={uid:O()},J.reqs={},J.onChange=function(Le){var Ce=Le.target.files;J.uploadFiles(Ce),J.reset()},J.onClick=function(Le){var Ce=J.fileInput;if(!Ce)return;var Te=J.props,ve=Te.children,X=Te.onClick;ve&&ve.type==="button"&&(Ce.parentNode.focus(),Ce.parentNode.querySelector("button").blur()),Ce.click(),X&&X(Le)},J.onKeyDown=function(Le){Le.key==="Enter"&&J.onClick()},J.onFileDrop=function(Le){var Ce=J.props.multiple;if(Le.preventDefault(),Le.type==="dragover")return;if(J.props.directory)l(Array.prototype.slice.call(Le.dataTransfer.items),J.uploadFiles,function(ve){return p(ve,J.props.accept)});else{var Te=Array.prototype.slice.call(Le.dataTransfer.files).filter(function(ve){return p(ve,J.props.accept)});Ce===!1&&(Te=Te.slice(0,1)),J.uploadFiles(Te)}},J.uploadFiles=function(Le){var Ce=Array.prototype.slice.call(Le);Ce.map(function(Te){return Te.uid=O(),Te}).forEach(function(Te){J.upload(Te,Ce)})},J.saveFileInput=function(Le){J.fileInput=Le},W),E(J,oe)}return h(D,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"upload",value:function(W,J){var oe=this,fe=this.props;if(!fe.beforeUpload)return setTimeout(function(){return oe.post(W)},0);var Re=fe.beforeUpload(W,J);Re&&Re.then?Re.then(function(be){var Le=Object.prototype.toString.call(be);return Le==="[object File]"||Le==="[object Blob]"?oe.post(be):oe.post(W)}).catch(function(be){console.log(be)}):Re!==!1&&setTimeout(function(){return oe.post(W)},0);return}},{key:"post",value:function(W){var J=this;if(!this._isMounted)return;var oe=this.props,fe=oe.onStart,Re=oe.onProgress,be=oe.transformFile,Le=be===void 0?function(Ce){return Ce}:be;new Promise(function(Ce){var Te=oe.action;return typeof Te=="function"&&(Te=Te(W)),Ce(Te)}).then(function(Ce){var Te=W.uid,ve=oe.customRequest||K,X=Promise.resolve(Le(W)).then(function(b){var I=oe.data;return typeof I=="function"&&(I=I(b)),Promise.all([b,I])}).catch(function(b){console.error(b)});X.then(function(b){var I=o(b,2),B=I[0],Q=I[1],z={action:Ce,filename:oe.name,data:Q,file:B,headers:oe.headers,withCredentials:oe.withCredentials,method:oe.method||"post",onProgress:Re?function(he){Re(he,W)}:null,onSuccess:function(xe,Ie){delete J.reqs[Te],oe.onSuccess(xe,W,Ie)},onError:function(xe,Ie){delete J.reqs[Te],oe.onError(xe,Ie,W)}};fe(W),J.reqs[Te]=ve(z)})})}},{key:"reset",value:function(){this.setState({uid:O()})}},{key:"abort",value:function(W){var J=this.reqs;if(W){var oe=W;W&&W.uid&&(oe=W.uid),J[oe]&&J[oe].abort&&J[oe].abort(),delete J[oe]}else Object.keys(J).forEach(function(fe){J[fe]&&J[fe].abort&&J[fe].abort(),delete J[fe]})}},{key:"render",value:function(){var W,J=this.props,oe=J.component,fe=J.prefixCls,Re=J.className,be=J.disabled,Le=J.id,Ce=J.style,Te=J.multiple,ve=J.accept,X=J.children,b=J.directory,I=J.openFileDialogOnClick,B=J.onMouseEnter,Q=J.onMouseLeave,z=a(J,["component","prefixCls","className","disabled","id","style","multiple","accept","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave"]),he=$()((W={},s(W,fe,!0),s(W,fe+"-disabled",be),s(W,Re,Re),W)),xe=be?{}:{onClick:I?this.onClick:function(){},onKeyDown:I?this.onKeyDown:function(){},onMouseEnter:B,onMouseLeave:Q,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:"0"};return Y.a.createElement(oe,d({},xe,{className:he,role:"button",style:Ce}),Y.a.createElement("input",d({},k(z),{id:Le,type:"file",ref:this.saveFileInput,onClick:function(ue){return ue.stopPropagation()},key:this.state.uid,style:{display:"none"},accept:ve,directory:b?"directory":null,webkitdirectory:b?"webkitdirectory":null,multiple:Te,onChange:this.onChange})),X)}}]),D}(le.Component),S=L,R=Object.assign||function(F){for(var D=1;D<arguments.length;D++){var g=arguments[D];for(var W in g)Object.prototype.hasOwnProperty.call(g,W)&&(F[W]=g[W])}return F},C=function(){function F(D,g){for(var W=0;W<g.length;W++){var J=g[W];J.enumerable=J.enumerable||!1,J.configurable=!0,"value"in J&&(J.writable=!0),Object.defineProperty(D,J.key,J)}}return function(D,g,W){return g&&F(D.prototype,g),W&&F(D,W),D}}();function f(F,D){if(!(F instanceof D))throw new TypeError("Cannot call a class as a function")}function w(F,D){if(!F)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return D&&(typeof D=="object"||typeof D=="function")?D:F}function y(F,D){if(typeof D!="function"&&D!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof D);F.prototype=Object.create(D&&D.prototype,{constructor:{value:F,enumerable:!1,writable:!0,configurable:!0}}),D&&(Object.setPrototypeOf?Object.setPrototypeOf(F,D):F.__proto__=D)}function _(){}var j=function(F){y(D,F);function D(){var g,W,J,oe;f(this,D);for(var fe=arguments.length,Re=Array(fe),be=0;be<fe;be++)Re[be]=arguments[be];return oe=(W=(J=w(this,(g=D.__proto__||Object.getPrototypeOf(D)).call.apply(g,[this].concat(Re))),J),J.saveUploader=function(Le){J.uploader=Le},W),w(J,oe)}return C(D,[{key:"abort",value:function(W){this.uploader.abort(W)}},{key:"render",value:function(){return Y.a.createElement(S,R({},this.props,{ref:this.saveUploader}))}}]),D}(le.Component);j.defaultProps={component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:_,onError:_,onSuccess:_,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0};var U=j,x=Se.a=U},HmJG:function(Ze,Se,q){},JYp7:function(Ze,Se,q){"use strict";q.d(Se,"a",function(){return le});var le;(function(Y){function N(a){return a&&typeof a=="object"&&typeof a[Symbol.iterator]=="function"}Y.is=N;const $=Object.freeze([]);function H(){return $}Y.empty=H;function*M(a){yield a}Y.single=M;function K(a){return a||$}Y.from=K;function G(a){return!a||a[Symbol.iterator]().next().done===!0}Y.isEmpty=G;function n(a){return a[Symbol.iterator]().next().value}Y.first=n;function O(a,A){for(const E of a)if(A(E))return!0;return!1}Y.some=O;function v(a,A){for(const E of a)if(A(E))return E;return}Y.find=v;function*p(a,A){for(const E of a)A(E)&&(yield E)}Y.filter=p;function*m(a,A){let E=0;for(const T of a)yield A(T,E++)}Y.map=m;function*u(...a){for(const A of a)for(const E of A)yield E}Y.concat=u;function*l(a){for(const A of a)for(const E of A)yield E}Y.concatNested=l;function d(a,A,E){let T=E;for(const k of a)T=A(T,k);return T}Y.reduce=d;function*o(a,A,E=a.length){for(A<0&&(A+=a.length),E<0?E+=a.length:E>a.length&&(E=a.length);A<E;A++)yield a[A]}Y.slice=o;function h(a,A=Number.POSITIVE_INFINITY){const E=[];if(A===0)return[E,a];const T=a[Symbol.iterator]();for(let k=0;k<A;k++){const L=T.next();if(L.done)return[E,Y.empty()];E.push(L.value)}return[E,{[Symbol.iterator](){return T}}]}Y.consume=h;function s(a,A,E=(T,k)=>T===k){const T=a[Symbol.iterator](),k=A[Symbol.iterator]();for(;;){const L=T.next(),S=k.next();if(L.done!==S.done)return!1;if(L.done)return!0;if(!E(L.value,S.value))return!1}}Y.equals=s})(le||(le={}))},LdHM:function(Ze,Se,q){"use strict";q.d(Se,"b",function(){return a}),q.d(Se,"a",function(){return E});var le=q("1OyB"),Y=q("vuIU"),N=q("Ji7U"),$=q("LK+K"),H=q("q1tI"),M=q("rePB"),K=q("Ff2n"),G=q("ODXe"),n=q("4IlW"),O=q("bX4T"),v=q("YrtM"),p=q("TSYQ"),m=q.n(p),u=q("+nKL"),l=q("8OUc"),d=function(W,J){var oe=W.prefixCls,fe=W.id,Re=W.flattenOptions,be=W.childrenAsData,Le=W.values,Ce=W.searchValue,Te=W.multiple,ve=W.defaultActiveFirstOption,X=W.height,b=W.itemHeight,I=W.notFoundContent,B=W.open,Q=W.menuItemSelectedIcon,z=W.virtual,he=W.onSelect,xe=W.onToggleOpen,Ie=W.onActiveValue,ue=W.onScroll,me=W.onMouseEnter,we="".concat(oe,"-item"),Ae=Object(v.a)(function(){return Re},[B,Re],function(ee,ne){return ne[0]&&ee[1]!==ne[1]}),Ne=H.useRef(null),Be=function(ne){ne.preventDefault()},Ke=function(ne){Ne.current&&Ne.current.scrollTo({index:ne})},Ge=function(ne){for(var se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,de=Ae.length,re=0;re<de;re+=1){var ae=(ne+re*se+de)%de,pe=Ae[ae],ge=pe.group,_e=pe.data;if(!ge&&!_e.disabled)return ae}return-1},$e=H.useState(function(){return Ge(0)}),je=Object(G.a)($e,2),We=je[0],Me=je[1],tt=function(ne){Me(ne);var se=Ae[ne];if(!se){Ie(null,-1);return}Ie(se.data.value,ne)};H.useEffect(function(){tt(ve!==!1?Ge(0):-1)},[Ae.length,Ce]),H.useEffect(function(){var ee=setTimeout(function(){if(!Te&&B&&Le.size===1){var ne=Array.from(Le)[0],se=Ae.findIndex(function(de){var re=de.data;return re.value===ne});tt(se),Ke(se)}});return function(){return clearTimeout(ee)}},[B]);var rt=function(ne){ne!==void 0&&he(ne,{selected:!Le.has(ne)}),Te||xe(!1)};if(H.useImperativeHandle(J,function(){return{onKeyDown:function(ne){var se=ne.which;switch(se){case n.a.UP:case n.a.DOWN:{var de=0;if(se===n.a.UP?de=-1:se===n.a.DOWN&&(de=1),de!==0){var re=Ge(We+de,de);Ke(re),tt(re)}break}case n.a.ENTER:{var ae=Ae[We];ae&&!ae.data.disabled?rt(ae.data.value):rt(void 0),B&&ne.preventDefault();break}case n.a.ESC:xe(!1)}},onKeyUp:function(){},scrollTo:function(ne){Ke(ne)}}}),Ae.length===0)return H.createElement("div",{role:"listbox",id:"".concat(fe,"_list"),className:"".concat(we,"-empty"),onMouseDown:Be},I);function ce(ee){var ne=Ae[ee];if(!ne)return null;var se=ne.data||{},de=se.value,re=se.label,ae=se.children,pe=Object(O.a)(se,!0),ge=be?ae:re;return ne?H.createElement("div",Object.assign({"aria-label":typeof ge=="string"?ge:null},pe,{key:ee,role:"option",id:"".concat(fe,"_list_").concat(ee),"aria-selected":Le.has(de)}),de):null}return H.createElement(H.Fragment,null,H.createElement("div",{role:"listbox",id:"".concat(fe,"_list"),style:{height:0,width:0,overflow:"hidden"}},ce(We-1),ce(We),ce(We+1)),H.createElement(u.a,{itemKey:"key",ref:Ne,data:Ae,height:X,itemHeight:b,fullHeight:!1,onMouseDown:Be,onScroll:ue,virtual:z,onMouseEnter:me},function(ee,ne){var se,de=ee.group,re=ee.groupOption,ae=ee.data,pe=ae.label,ge=ae.key;if(de)return H.createElement("div",{className:m()(we,"".concat(we,"-group"))},pe!==void 0?pe:ge);var _e=ae.disabled,Oe=ae.value,Pe=ae.title,ze=ae.children,et=ae.style,nt=ae.className,_t=Object(K.a)(ae,["disabled","value","title","children","style","className"]),lt=Le.has(Oe),at="".concat(we,"-option"),Rt=m()(we,at,nt,(se={},Object(M.a)(se,"".concat(at,"-grouped"),re),Object(M.a)(se,"".concat(at,"-active"),We===ne&&!_e),Object(M.a)(se,"".concat(at,"-disabled"),_e),Object(M.a)(se,"".concat(at,"-selected"),lt),se)),ot=be?ze:pe,Et=!Q||typeof Q=="function"||lt;return H.createElement("div",Object.assign({},_t,{"aria-selected":lt,className:Rt,title:Pe,onMouseMove:function(){if(We===ne||_e)return;tt(ne)},onClick:function(){_e||rt(Oe)},style:et}),H.createElement("div",{className:"".concat(at,"-content")},ot||Oe),H.isValidElement(Q)||lt,Et&&H.createElement(l.a,{className:"".concat(we,"-option-state"),customizeIcon:Q,customizeIconProps:{isSelected:lt}},lt?"\u2713":null))}))},o=H.forwardRef(d);o.displayName="OptionList";var h=o,s=function(){return null};s.isSelectOption=!0;var a=s,A=function(){return null};A.isSelectOptGroup=!0;var E=A,T=q("VTBJ"),k=q("Zm9Q");function L(g){var W=g.key,J=g.props,oe=J.children,fe=J.value,Re=Object(K.a)(J,["children","value"]);return Object(T.a)({key:W,value:fe!==void 0?fe:W,children:oe},Re)}function S(g){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(k.a)(g).map(function(J,oe){if(!H.isValidElement(J)||!J.type)return null;var fe=J.type.isSelectOptGroup,Re=J.key,be=J.props,Le=be.children,Ce=Object(K.a)(be,["children"]);return W||!fe?L(J):Object(T.a)(Object(T.a)({key:"__RC_SELECT_GRP__".concat(Re===null?oe:Re,"__"),label:Re},Ce),{},{options:S(Le)})}).filter(function(J){return J})}var R=q("2Qr1"),C=q("qNPg"),f=q("U8pU"),w=q("Kwbf"),y=q("WKfj");function _(g){var W=g.mode,J=g.options,oe=g.children,fe=g.backfill,Re=g.allowClear,be=g.placeholder,Le=g.getInputElement,Ce=g.showSearch,Te=g.onSearch,ve=g.defaultOpen,X=g.autoFocus,b=g.labelInValue,I=g.value,B=g.inputValue,Q=g.optionLabelProp,z=W==="multiple"||W==="tags",he=Ce!==void 0?Ce:z||W==="combobox",xe=J||S(oe);if(Object(w.a)(W!=="tags"||xe.every(function(we){return!we.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),W==="tags"||W==="combobox"){var Ie=xe.some(function(we){return we.options?we.options.some(function(Ae){return typeof("value"in Ae?Ae.value:Ae.key)=="number"}):typeof("value"in we?we.value:we.key)=="number"});Object(w.a)(!Ie,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(w.a)(W!=="combobox"||!Q,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(w.a)(W==="combobox"||!fe,"`backfill` only works with `combobox` mode."),Object(w.a)(W==="combobox"||!Le,"`getInputElement` only work with `combobox` mode."),Object(w.b)(W!=="combobox"||!Le||!Re||!be,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Te&&!he&&W!=="combobox"&&W!=="tags"&&Object(w.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(w.b)(!ve||X,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),I!=null){var ue=Object(y.d)(I);Object(w.a)(!b||ue.every(function(we){return Object(f.a)(we)==="object"&&("key"in we||"value"in we)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(w.a)(!z||Array.isArray(I),"`value` should be array when `mode` is `multiple` or `tags`")}if(oe){var me=null;Object(k.a)(oe).some(function(we){if(!H.isValidElement(we)||!we.type)return!1;var Ae=we.type;if(Ae.isSelectOption)return!1;if(Ae.isSelectOptGroup){var Ne=Object(k.a)(we.props.children).every(function(Be){return!H.isValidElement(Be)||!we.type||Be.type.isSelectOption?!0:(me=Be.type,!1)});return!Ne}return me=Ae,!0}),me&&Object(w.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(me.displayName||me.name||me,"`.")),Object(w.a)(B===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var j=_,U=Object(C.a)({prefixCls:"rc-select",components:{optionList:h},convertChildrenToData:S,flattenOptions:R.d,getLabeledValue:R.e,filterOptions:R.b,isValueDisabled:R.g,findValueOption:R.c,warningProps:j,fillOptionsWithMissingValue:R.a}),x=function(g){Object(N.a)(J,g);var W=Object($.a)(J);function J(){var oe;return Object(le.a)(this,J),oe=W.apply(this,arguments),oe.selectRef=H.createRef(),oe.focus=function(){oe.selectRef.current.focus()},oe.blur=function(){oe.selectRef.current.blur()},oe}return Object(Y.a)(J,[{key:"render",value:function(){return H.createElement(U,Object.assign({ref:this.selectRef},this.props))}}]),J}(H.Component);x.Option=a,x.OptGroup=E;var F=x,D=Se.c=F},M8RZ:function(Ze,Se,q){"use strict";q.d(Se,"a",function(){return n});var le=q("fWQN"),Y=q("mtLc"),N=q("yKVA"),$=q("879j"),H=q("q1tI"),M=q.n(H),K=q("i8i4"),G=q.n(K),n=function(O){Object(N.a)(p,O);var v=Object($.a)(p);function p(m){var u;Object(le.a)(this,p),u=v.call(this,m);var l=window.document;return u.node=l.createElement("div"),l.body.appendChild(u.node),u}return Object(Y.a)(p,[{key:"render",value:function(){var u=this.props.children;return Object(K.createPortal)(u,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),p}(M.a.Component)},MI8n:function(Ze,Se,q){"use strict";q.d(Se,"c",function(){return H}),q.d(Se,"b",function(){return n}),q.d(Se,"e",function(){return O}),q.d(Se,"a",function(){return v}),q.d(Se,"d",function(){return p}),q.d(Se,"f",function(){return m});var le=q("/cxE"),Y=q("pmY6"),N=q("24hK"),$=q("5Y4S"),H;(function(u){u.None=()=>Y.a.None;function l(_){return(j,U=null,x)=>{let F=!1,D;return D=_(g=>F?void 0:(D?D.dispose():F=!0,j.call(U,g)),null,x),F&&D.dispose(),D}}u.once=l;function d(_,j){return E((U,x=null,F)=>_(D=>U.call(x,j(D)),null,F))}u.map=d;function o(_,j){return E((U,x=null,F)=>_(D=>{j(D),U.call(x,D)},null,F))}u.forEach=o;function h(_,j){return E((U,x=null,F)=>_(D=>j(D)&&U.call(x,D),null,F))}u.filter=h;function s(_){return _}u.signal=s;function a(..._){return(j,U=null,x)=>Object(Y.e)(..._.map(F=>F(D=>j.call(U,D),null,x)))}u.any=a;function A(_,j,U){let x=U;return d(_,F=>(x=j(x,F),x))}u.reduce=A;function E(_){let j;const U=new n({onFirstListenerAdd(){j=_(U.fire,U)},onLastListenerRemove(){j.dispose()}});return U.event}function T(_,j,U=100,x=!1,F){let D,g,W,J=0;const oe=new n({leakWarningThreshold:F,onFirstListenerAdd(){D=_(fe=>{J++,g=j(g,fe),x&&!W&&(oe.fire(g),g=void 0),clearTimeout(W),W=setTimeout(()=>{const Re=g;g=void 0,W=void 0,(!x||J>1)&&oe.fire(Re),J=0},U)})},onLastListenerRemove(){D.dispose()}});return oe.event}u.debounce=T;function k(_,j=(U,x)=>U===x){let U=!0,x;return h(_,F=>{const D=U||!j(F,x);return U=!1,x=F,D})}u.latch=k;function L(_,j){return[u.filter(_,j),u.filter(_,U=>!j(U))]}u.split=L;function S(_,j=!1,U=[]){let x=U.slice(),F=_(W=>{x?x.push(W):g.fire(W)});const D=()=>{x&&x.forEach(W=>g.fire(W)),x=null},g=new n({onFirstListenerAdd(){F||(F=_(W=>g.fire(W)))},onFirstListenerDidAdd(){x&&(j?setTimeout(D):D())},onLastListenerRemove(){F&&F.dispose(),F=null}});return g.event}u.buffer=S;class R{constructor(_){this.event=_}map(_){return new R(d(this.event,_))}forEach(_){return new R(o(this.event,_))}filter(_){return new R(h(this.event,_))}reduce(_,j){return new R(A(this.event,_,j))}latch(){return new R(k(this.event))}debounce(_,j=100,U=!1,x){return new R(T(this.event,_,j,U,x))}on(_,j,U){return this.event(_,j,U)}once(_,j,U){return l(this.event)(_,j,U)}}function C(_){return new R(_)}u.chain=C;function f(_,j,U=x=>x){const x=(...W)=>g.fire(U(...W)),F=()=>_.on(j,x),D=()=>_.removeListener(j,x),g=new n({onFirstListenerAdd:F,onLastListenerRemove:D});return g.event}u.fromNodeEventEmitter=f;function w(_,j,U=x=>x){const x=(...W)=>g.fire(U(...W)),F=()=>_.addEventListener(j,x),D=()=>_.removeEventListener(j,x),g=new n({onFirstListenerAdd:F,onLastListenerRemove:D});return g.event}u.fromDOMEventEmitter=w;function y(_){return new Promise(j=>l(_)(j))}u.toPromise=y})(H||(H={}));class M{constructor(u){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${u}_${M._idPool++}`}start(u){this._stopWatch=new $.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}}}M._idPool=0;let K=-1;class G{constructor(u,l=Math.random().toString(18).slice(2,5)){this.customThreshold=u,this.name=l,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(u){let l=K;if(typeof this.customThreshold=="number"&&(l=this.customThreshold),l<=0||u<l)return;this._stacks||(this._stacks=new Map);const d=new Error().stack.split(`
|
|
`).slice(3).join(`
|
|
`),o=this._stacks.get(d)||0;if(this._stacks.set(d,o+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=l*.5;let h,s=0;for(const[a,A]of this._stacks)(!h||s<A)&&(h=a,s=A);console.warn(`[${this.name}] potential listener LEAK detected, having ${u} listeners already. MOST frequent listener (${s}):`),console.warn(h)}return()=>{const h=this._stacks.get(d)||0;this._stacks.set(d,h-1)}}}class n{constructor(u){var l;this._disposed=!1,this._options=u,this._leakageMon=K>0?new G(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((l=this._options)===null||l===void 0?void 0:l._profName)?new M(this._options._profName):void 0}get event(){return this._event||(this._event=(u,l,d)=>{var o;this._listeners||(this._listeners=new N.a);const h=this._listeners.isEmpty();h&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const s=this._listeners.push(l?[u,l]:u);h&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,u,l);const a=(o=this._leakageMon)===null||o===void 0?void 0:o.check(this._listeners.size),A=Object(Y.i)(()=>{if(a&&a(),!this._disposed&&(s(),this._options&&this._options.onLastListenerRemove)){const E=this._listeners&&!this._listeners.isEmpty();E||this._options.onLastListenerRemove(this)}});return d instanceof Y.b?d.add(A):Array.isArray(d)&&d.push(A),A}),this._event}fire(u){var l,d;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new N.a);for(let o of this._listeners)this._deliveryQueue.push([o,u]);for((l=this._perfMon)===null||l===void 0||l.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[o,h]=this._deliveryQueue.shift();try{typeof o=="function"?o.call(void 0,h):o[0].call(o[1],h)}catch(s){Object(le.f)(s)}}(d=this._perfMon)===null||d===void 0||d.stop()}}dispose(){var u,l,d,o,h;this._disposed||(this._disposed=!0,(u=this._listeners)===null||u===void 0||u.clear(),(l=this._deliveryQueue)===null||l===void 0||l.clear(),(o=(d=this._options)===null||d===void 0?void 0:d.onLastListenerRemove)===null||o===void 0||o.call(d),(h=this._leakageMon)===null||h===void 0||h.dispose())}}class O extends n{constructor(u){super(u);this._isPaused=0,this._eventQueue=new N.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 v extends O{constructor(u){var l;super(u);this._delay=(l=u.delay)!==null&&l!==void 0?l: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(l,d,o)=>u(h=>{const s=this.buffers[this.buffers.length-1];s?s.push(()=>l.call(d,h)):l.call(d,h)},void 0,o)}bufferEvents(u){const l=[];this.buffers.push(l);const d=u();return this.buffers.pop(),l.forEach(o=>o()),d}}class m{constructor(){this.listening=!1,this.inputEvent=H.None,this.inputEventListener=Y.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(Ze,Se,q){"use strict";(function(le,Y){q.d(Se,"b",function(){return d}),q.d(Se,"i",function(){return a}),q.d(Se,"f",function(){return A}),q.d(Se,"d",function(){return E}),q.d(Se,"g",function(){return T}),q.d(Se,"h",function(){return k}),q.d(Se,"c",function(){return L}),q.d(Se,"k",function(){return S}),q.d(Se,"j",function(){return R}),q.d(Se,"a",function(){return C}),q.d(Se,"e",function(){return y});var N;const $="en";let H=!1,M=!1,K=!1,G=!1,n=!1,O=!1,v=!1,p,m=$,u,l;const d=typeof self=="object"?self:typeof le=="object"?le:{};let o;typeof d.vscode!="undefined"&&typeof d.vscode.process!="undefined"?o=d.vscode.process:typeof Y!="undefined"&&(o=Y);const h=typeof((N=o==null?void 0:o.versions)===null||N===void 0?void 0:N.electron)=="string"&&o.type==="renderer";if(typeof navigator=="object"&&!h)l=navigator.userAgent,H=l.indexOf("Windows")>=0,M=l.indexOf("Macintosh")>=0,v=(l.indexOf("Macintosh")>=0||l.indexOf("iPad")>=0||l.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,K=l.indexOf("Linux")>=0,O=!0,p=navigator.language,m=p;else if(typeof o=="object"){H=o.platform==="win32",M=o.platform==="darwin",K=o.platform==="linux",G=K&&!!o.env.SNAP&&!!o.env.SNAP_REVISION,p=$,m=$;const _=o.env.VSCODE_NLS_CONFIG;if(_)try{const j=JSON.parse(_),U=j.availableLanguages["*"];p=j.locale,m=U||$,u=j._translationsConfigFile}catch(j){}n=!0}else console.error("Unable to resolve platform.");let s=0;M?s=1:H?s=3:K&&(s=2);const a=H,A=M,E=K,T=n,k=O,L=v,S=l,R=function(){if(d.setImmediate)return d.setImmediate.bind(d);if(typeof d.postMessage=="function"&&!d.importScripts){let U=[];d.addEventListener("message",F=>{if(F.data&&F.data.vscodeSetImmediateId)for(let D=0,g=U.length;D<g;D++){const W=U[D];if(W.id===F.data.vscodeSetImmediateId){U.splice(D,1),W.callback();return}}});let x=0;return F=>{const D=++x;U.push({id:D,callback:F}),d.postMessage({vscodeSetImmediateId:D},"*")}}if(typeof(o==null?void 0:o.nextTick)=="function")return o.nextTick.bind(o);const j=Promise.resolve();return U=>j.then(U)}(),C=M||v?2:H?1:3;let f=!0,w=!1;function y(){if(!w){w=!0;const _=new Uint8Array(2);_[0]=1,_[1]=2;const j=new Uint16Array(_.buffer);f=j[0]===(2<<8)+1}return f}}).call(this,q("IyRk"),q("Q2Ig"))},N0LK:function(Ze,Se,q){"use strict";q.d(Se,"C",function(){return le}),q.d(Se,"v",function(){return N}),q.d(Se,"s",function(){return $}),q.d(Se,"t",function(){return H}),q.d(Se,"U",function(){return M}),q.d(Se,"J",function(){return K}),q.d(Se,"O",function(){return G}),q.d(Se,"p",function(){return n}),q.d(Se,"T",function(){return O}),q.d(Se,"q",function(){return v}),q.d(Se,"N",function(){return p}),q.d(Se,"M",function(){return m}),q.d(Se,"Q",function(){return u}),q.d(Se,"u",function(){return l}),q.d(Se,"x",function(){return d}),q.d(Se,"I",function(){return o}),q.d(Se,"f",function(){return h}),q.d(Se,"h",function(){return s}),q.d(Se,"g",function(){return a}),q.d(Se,"i",function(){return A}),q.d(Se,"G",function(){return E}),q.d(Se,"H",function(){return T}),q.d(Se,"r",function(){return k}),q.d(Se,"R",function(){return L}),q.d(Se,"d",function(){return S}),q.d(Se,"e",function(){return R}),q.d(Se,"E",function(){return C}),q.d(Se,"F",function(){return f}),q.d(Se,"j",function(){return w}),q.d(Se,"z",function(){return y}),q.d(Se,"K",function(){return j}),q.d(Se,"L",function(){return U}),q.d(Se,"m",function(){return F}),q.d(Se,"k",function(){return g}),q.d(Se,"A",function(){return J}),q.d(Se,"a",function(){return oe}),q.d(Se,"n",function(){return fe}),q.d(Se,"l",function(){return Re}),q.d(Se,"D",function(){return be}),q.d(Se,"B",function(){return Le}),q.d(Se,"b",function(){return Ce}),q.d(Se,"S",function(){return Te}),q.d(Se,"o",function(){return ve}),q.d(Se,"P",function(){return X}),q.d(Se,"w",function(){return b}),q.d(Se,"c",function(){return I}),q.d(Se,"y",function(){return z});function le(ue){return!ue||typeof ue!="string"?!0:ue.trim().length===0}const Y=/{(\d+)}/g;function N(ue,...me){return me.length===0?ue:ue.replace(Y,function(we,Ae){const Ne=parseInt(Ae,10);return isNaN(Ne)||Ne<0||Ne>=me.length?we:me[Ne]})}function $(ue){return ue.replace(/[<>&]/g,function(me){switch(me){case"<":return"<";case">":return">";case"&":return"&";default:return me}})}function H(ue){return ue.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function M(ue,me=" "){const we=K(ue,me);return G(we,me)}function K(ue,me){if(!ue||!me)return ue;const we=me.length;if(we===0||ue.length===0)return ue;let Ae=0;for(;ue.indexOf(me,Ae)===Ae;)Ae=Ae+we;return ue.substring(Ae)}function G(ue,me){if(!ue||!me)return ue;const we=me.length,Ae=ue.length;if(we===0||Ae===0)return ue;let Ne=Ae,Be=-1;for(;!(Be=ue.lastIndexOf(me,Ne-1),Be===-1||Be+we!==Ne);){if(Be===0)return"";Ne=Be}return ue.substring(0,Ne)}function n(ue){return ue.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function O(ue){return ue.replace(/\*/g,"")}function v(ue,me,we={}){if(!ue)throw new Error("Cannot create regex from empty string");me||(ue=H(ue)),we.wholeWord&&(/\B/.test(ue.charAt(0))||(ue="\\b"+ue),/\B/.test(ue.charAt(ue.length-1))||(ue=ue+"\\b"));let Ae="";return we.global&&(Ae+="g"),we.matchCase||(Ae+="i"),we.multiline&&(Ae+="m"),we.unicode&&(Ae+="u"),new RegExp(ue,Ae)}function p(ue){if(ue.source==="^"||ue.source==="^$"||ue.source==="$"||ue.source==="^\\s*$")return!1;const me=ue.exec("");return!!(me&&ue.lastIndex===0)}function m(ue){return(ue.global?"g":"")+(ue.ignoreCase?"i":"")+(ue.multiline?"m":"")+(ue.unicode?"u":"")}function u(ue){return ue.split(/\r\n|\r|\n/)}function l(ue){for(let me=0,we=ue.length;me<we;me++){const Ae=ue.charCodeAt(me);if(Ae!==32&&Ae!==9)return me}return-1}function d(ue,me=0,we=ue.length){for(let Ae=me;Ae<we;Ae++){const Ne=ue.charCodeAt(Ae);if(Ne!==32&&Ne!==9)return ue.substring(me,Ae)}return ue.substring(me,we)}function o(ue,me=ue.length-1){for(let we=me;we>=0;we--){const Ae=ue.charCodeAt(we);if(Ae!==32&&Ae!==9)return we}return-1}function h(ue,me){return ue<me?-1:ue>me?1:0}function s(ue,me,we=0,Ae=ue.length,Ne=0,Be=me.length){for(;we<Ae&&Ne<Be;we++,Ne++){let $e=ue.charCodeAt(we),je=me.charCodeAt(Ne);if($e<je)return-1;if($e>je)return 1}const Ke=Ae-we,Ge=Be-Ne;return Ke<Ge?-1:Ke>Ge?1:0}function a(ue,me){return A(ue,me,0,ue.length,0,me.length)}function A(ue,me,we=0,Ae=ue.length,Ne=0,Be=me.length){for(;we<Ae&&Ne<Be;we++,Ne++){let $e=ue.charCodeAt(we),je=me.charCodeAt(Ne);if($e===je)continue;if($e>=128||je>=128)return s(ue.toLowerCase(),me.toLowerCase(),we,Ae,Ne,Be);E($e)&&($e-=32),E(je)&&(je-=32);const We=$e-je;if(We===0)continue;return We}const Ke=Ae-we,Ge=Be-Ne;return Ke<Ge?-1:Ke>Ge?1:0}function E(ue){return ue>=97&&ue<=122}function T(ue){return ue>=65&&ue<=90}function k(ue,me){return ue.length===me.length&&A(ue,me)===0}function L(ue,me){const we=me.length;return me.length>ue.length?!1:A(ue,me,0,we)===0}function S(ue,me){let we,Ae=Math.min(ue.length,me.length);for(we=0;we<Ae;we++)if(ue.charCodeAt(we)!==me.charCodeAt(we))return we;return Ae}function R(ue,me){let we,Ae=Math.min(ue.length,me.length);const Ne=ue.length-1,Be=me.length-1;for(we=0;we<Ae;we++)if(ue.charCodeAt(Ne-we)!==me.charCodeAt(Be-we))return we;return Ae}function C(ue){return 55296<=ue&&ue<=56319}function f(ue){return 56320<=ue&&ue<=57343}function w(ue,me){return(ue-55296<<10)+(me-56320)+65536}function y(ue,me,we){const Ae=ue.charCodeAt(we);if(C(Ae)&&we+1<me){const Ne=ue.charCodeAt(we+1);if(f(Ne))return w(Ae,Ne)}return Ae}function _(ue,me){const we=ue.charCodeAt(me-1);if(f(we)&&me>1){const Ae=ue.charCodeAt(me-2);if(C(Ae))return w(Ae,we)}return we}function j(ue,me){const we=B.getInstance(),Ae=me,Ne=ue.length,Be=y(ue,Ne,me);me+=Be>=65536?2:1;let Ke=we.getGraphemeBreakType(Be);for(;me<Ne;){const Ge=y(ue,Ne,me),$e=we.getGraphemeBreakType(Ge);if(I(Ke,$e))break;me+=Ge>=65536?2:1,Ke=$e}return me-Ae}function U(ue,me){const we=B.getInstance(),Ae=me,Ne=_(ue,me);me-=Ne>=65536?2:1;let Be=we.getGraphemeBreakType(Ne);for(;me>0;){const Ke=_(ue,me),Ge=we.getGraphemeBreakType(Ke);if(I(Ge,Be))break;me-=Ke>=65536?2:1,Be=Ge}return Ae-me}const x=/(?:[\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 F(ue){return x.test(ue)}const D=/(?:[\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 g(ue){return D.test(ue)}const W=/^[\t\n\r\x20-\x7E]*$/;function J(ue){return W.test(ue)}const oe=/[\u2028\u2029]/;function fe(ue){return oe.test(ue)}function Re(ue){for(let me=0,we=ue.length;me<we;me++)if(be(ue.charCodeAt(me)))return!0;return!1}function be(ue){return ue=+ue,ue>=11904&&ue<=55215||ue>=63744&&ue<=64255||ue>=65281&&ue<=65374}function Le(ue){return ue>=127462&&ue<=127487||ue===8986||ue===8987||ue===9200||ue===9203||ue>=9728&&ue<=10175||ue===11088||ue===11093||ue>=127744&&ue<=128591||ue>=128640&&ue<=128764||ue>=128992&&ue<=129003||ue>=129280&&ue<=129535||ue>=129648&&ue<=129750}const Ce=String.fromCharCode(65279);function Te(ue){return!!(ue&&ue.length>0&&ue.charCodeAt(0)===65279)}function ve(ue,me=!1){return ue?(me&&(ue=ue.replace(/\\./g,"")),ue.toLowerCase()!==ue):!1}function X(ue){const me=90-65+1;return ue=ue%(2*me),ue<me?String.fromCharCode(97+ue):String.fromCharCode(65+ue-me)}function b(ue){const me=B.getInstance();return me.getGraphemeBreakType(ue)}function I(ue,me){return ue===0?me!==5&&me!==7:ue===2&&me===3?!1:ue===4||ue===2||ue===3||(me===4||me===2||me===3)?!0:ue===8&&(me===8||me===9||me===11||me===12)||((ue===11||ue===9)&&(me===9||me===10)||((ue===12||ue===10)&&me===10||(me===5||me===13||(me===7||(ue===1||ue===13&&me===14)))))?!1:!(ue===6&&me===6)}class B{constructor(){this._data=Q()}static getInstance(){return B._INSTANCE||(B._INSTANCE=new B),B._INSTANCE}getGraphemeBreakType(ue){if(ue<32)return ue===10?3:ue===13?2:4;if(ue<127)return 0;const me=this._data,we=me.length/3;let Ae=1;for(;Ae<=we;)if(ue<me[3*Ae])Ae=2*Ae;else if(ue>me[3*Ae+1])Ae=2*Ae+1;else return me[3*Ae+2];return 0}}B._INSTANCE=null;function Q(){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 z(ue,me){if(ue===0)return 0;const we=he(ue,me);if(we!==void 0)return we;const Ae=_(me,ue);return ue-=xe(Ae),ue}function he(ue,me){let we=_(me,ue);for(ue-=xe(we);Ie(we)||we===65039||we===8419;){if(ue===0)return;we=_(me,ue),ue-=xe(we)}if(!Le(we))return;if(ue>=0){const Ae=_(me,ue);Ae===8205&&(ue-=xe(Ae))}return ue}function xe(ue){return ue>=65536?2:1}function Ie(ue){return 127995<=ue&&ue<=127999}},Ot1p:function(Ze,Se,q){"use strict";var le=q("2qtc"),Y=q("kLXV"),N=q("rAM+"),$=q("miYZ"),H=q("tsqr"),M=q("9og8"),K=q("tJVT"),G=q("jrin"),n=q("WmNS"),O=q.n(n),v=q("q1tI"),p=q.n(v),m=q("VrN/"),u=q.n(m),l=q("bdgK"),d=q("p77/"),o=q("Bd2K"),h=q("ELLl"),s=q("19Vz"),a=q("lZu9"),A=q("+NIl"),E=q("kSUc"),T=q("9Bee"),k=function(_e){var Oe=_e.value,Pe=Oe===void 0?"":Oe,ze=_e.className,et=_e.showTextOnly,nt=_e.showLines,_t=_e.style,lt=_t===void 0?{}:_t,at=Object(v.useMemo)(function(){return""},[Pe]);return p.a.createElement(p.a.Fragment,null,p.a.createElement("div",{dangerouslySetInnerHTML:{__html:at}}))},L=q("0Owb"),S=q("dejd"),R=q("C+DQ"),C=q("1vsH"),f=q("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 y(_e){var Oe=_e.onActionCallback,Pe=_e.title,ze=_e.icon,et=_e.actionName,nt=_e.className,_t=nt===void 0?"":nt,lt=_e.children;function at(){Oe(et)}return p.a.createElement("a",{title:Pe,className:_t,onClick:at},p.a.createElement("i",{className:"md-iconfont ".concat(ze)}),lt)}var _=function(_e){var Oe=_e.watch,Pe=_e.showNullButton,ze=_e.onActionCallback,et=_e.fullScreen,nt=_e.insertTemp,_t=_e.hidetoolBar,lt=_e.uuid,at=_e.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(C.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(C.F)("_educoder_session"),"&key=").concat(lt,"&api=").concat(encodeURIComponent(f.a.PROXY_SERVER)));var Rt=[].concat(w,[{title:"".concat(Oe?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Oe?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return p.a.createElement("ul",{className:"markdown-toolbar-container"},!_t&&Rt.map(function(ot,Et){return p.a.createElement("li",{key:Et},ot.actionName?p.a.createElement(y,Object(L.a)({},ot,{onActionCallback:ze})):p.a.createElement("span",{className:"v-line"}))}),Pe?p.a.createElement("li",null,p.a.createElement(y,{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,nt&&p.a.createElement("li",null,p.a.createElement(y,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(nt),onActionCallback:ze},p.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),p.a.createElement("li",{className:"btn-full-screen"},p.a.createElement(y,{icon:"".concat(et?"icon-shrink":"icon-enlarge"),title:et?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:ze})))},j=q("M8RZ"),U=q("+L6B"),x=q("2/Rp"),F=q("y8nQ"),D=q("Vl3Y"),g=q("5NDa"),W=q("5rEg"),J={labelCol:{span:4},wrapperCol:{span:20}},oe=function(_e){var Oe=_e.callback,Pe=_e.onCancel;function ze(et){Oe(et)}return p.a.createElement(D.a,Object(L.a)({},J,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:ze}),p.a.createElement(D.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},p.a.createElement(W.a,null)),p.a.createElement(D.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},p.a.createElement(W.a,null)),p.a.createElement("div",{className:"flex-container flex-end"},p.a.createElement(x.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(x.a,{type:"ghost",onClick:Pe},"\u53D6\u6D88")))},fe=q("7ahc"),Re=q("HmJG"),be=q("BjJ7"),Le=D.a.useForm,Ce={width:280,marginRight:10},Te={labelCol:{span:5},wrapperCol:{span:19}},ve=function(_e){var Oe=_e.callback,Pe=_e.onCancel,ze=Le(),et=Object(K.a)(ze,1),nt=et[0];function _t(Rt){Oe(Rt)}function lt(Rt,ot){if(Rt.status===-1){H.b.error(Rt.message);return}nt.setFieldsValue({src:"/api/attachments/".concat(Rt.id),type:ot.type})}function at(Rt){var ot=Rt.target.files[0];b(ot,lt)}return p.a.createElement(D.a,Object(L.a)({form:nt},Te,{className:"upload-image-panel",onFinish:_t}),p.a.createElement(D.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},p.a.createElement("div",{className:"flex-container"},p.a.createElement(D.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},p.a.createElement(W.a,{style:Ce})),p.a.createElement(X,{onFileChange:at}))),p.a.createElement(D.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},p.a.createElement(W.a,{style:{width:264}})),p.a.createElement(D.a.Item,{style:{textAlign:"right"}},p.a.createElement(x.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(x.a,{type:"ghost",onClick:Pe},"\u53D6\u6D88")))};function X(_e){var Oe=_e.onFileChange;return p.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",p.a.createElement("input",{type:"file",onChange:Oe}))}function b(_e,Oe){if(!_e)throw new String("\u6CA1\u6709\u6587\u4EF6");var Pe=new FormData;Pe.append("editormd-image-file",_e),Pe.append("file_param_name","editormd-image-file"),Pe.append("byxhr","true");var ze=new window.XMLHttpRequest;ze.withCredentials=!0,ze.addEventListener("load",function(et){Oe(JSON.parse(et.target.responseText),_e)},!1),ze.addEventListener("error",function(et){console.error(et)},!1),ze.open("POST","".concat(be.a,"/api/attachments.json")),ze.send(Pe)}var I=q("giR+"),B=q("fyUT"),Q=q("7Kak"),z=q("9yH6"),he=z.a.Group,xe={margin:"0 8px"},Ie=function(_e){var Oe=_e.callback,Pe=_e.onCancel;function ze(et){Oe(et)}return p.a.createElement(D.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:xe},"\u5355\u5143\u683C\u6570\uFF1A"),p.a.createElement("span",{style:xe},"\u884C\u6570"),p.a.createElement(D.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},p.a.createElement(B.a,null)),p.a.createElement("span",{style:xe},"\u5217\u6570"),p.a.createElement(D.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},p.a.createElement(B.a,null))),p.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},p.a.createElement("span",{style:xe},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),p.a.createElement(D.a.Item,{name:"align"},p.a.createElement(he,null,p.a.createElement(z.a,{value:"default"},p.a.createElement("i",{className:"fa fa-align-justify"})),p.a.createElement(z.a,{value:"left"},p.a.createElement("i",{className:"fa fa-align-left"})),p.a.createElement(z.a,{value:"center"},p.a.createElement("i",{className:"fa fa-align-center"})),p.a.createElement(z.a,{value:"right"},p.a.createElement("i",{className:"fa fa-align-right"}))))),p.a.createElement("div",{className:"flex-container flex-end"},p.a.createElement(x.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(x.a,{type:"ghost",onClick:Pe},"\u53D6\u6D88")))},ue=q("ErOA"),me=q("7Cbv"),we="link",Ae="upload-image",Ne="code-block",Be="add-table",Ke="------------",Ge={default:Ke,left:":".concat(Ke),center:":".concat(Ke,":"),right:"".concat(Ke,":")},$e=q("9VGf"),je,We;function Me(){}var tt=0,rt=1e4,ce="\u2581",ee=`
|
|
**\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 ne(_e){return/^\d+$/.test(_e)?"".concat(_e,"px"):_e}var se=navigator.platform.toUpperCase().indexOf("MAC")>=0,de=se?"Cmd":"Ctrl",re=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"],ae=(je={},Object(G.a)(je,de+"-B","bold"),Object(G.a)(je,de+"-I","italic"),je),pe=(We={},Object(G.a)(We,we,"\u6DFB\u52A0\u94FE\u63A5"),Object(G.a)(We,Ne,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(G.a)(We,Ae,"\u6DFB\u52A0\u6587\u4EF6"),Object(G.a)(We,Be,"\u6DFB\u52A0\u8868\u683C"),We),ge=Se.a=function(_e){var Oe=_e.defaultValue,Pe=Oe===void 0?"":Oe,ze=_e.onChange,et=_e.width,nt=et===void 0?"100%":et,_t=_e.height,lt=_t===void 0?400:_t,at=_e.miniToolbar,Rt=at===void 0?!1:at,ot=_e.isFocus,Et=ot===void 0?!1:ot,xt=_e.watch,Ye=_e.insertTemp,Qt=_e.mode,nn=Qt===void 0?"markdown":Qt,Kt=_e.id,Pt=Kt===void 0?"markdown-editor-id":Kt,dt=_e.showResizeBar,yt=dt===void 0?!1:dt,Tt=_e.noStorage,Nt=Tt===void 0?!1:Tt,hn=_e.showNullButton,Ut=hn===void 0?!1:hn,qe=_e.hidetoolBar,Ot=qe===void 0?!1:qe,It=_e.fullScreen,pt=It===void 0?!1:It,gt=_e.onBlur,Ct=_e.onCMBeforeChange,sn=_e.onFullScreen,Ht=_e.className,He=Ht===void 0?"":Ht,mt=_e.disablePaste,rr=mt===void 0?!1:mt,_r=_e.placeholder,Er=_r===void 0?"":_r,ir=_e.values,xr=ir===void 0?"":ir,bt=Object(v.useState)(null),Ai=Object(K.a)(bt,2),Ve=Ai[0],Tr=Ai[1],Cn=Object(v.useState)(Pe),Vr=Object(K.a)(Cn,2),ar=Vr[0],Rn=Vr[1],Xr=Object(v.useState)(xt),Yr=Object(K.a)(Xr,2),On=Yr[0],$r=Yr[1],Ri=Object(v.useState)(pt),Jr=Object(K.a)(Ri,2),Ln=Jr[0],Oi=Jr[1],aa=Object(v.useState)(""),Qr=Object(K.a)(aa,2),cn=Qr[0],Xn=Qr[1],sa=Object(v.useState)(0),sr=Object(K.a)(sa,2),In=sr[0],Zr=sr[1],oa=Object(v.useState)(lt),Li=Object(K.a)(oa,2),Ii=Li[0],wr=Li[1],Di=Object(v.useState)(!1),ki=Object(K.a)(Di,2),la=ki[0],Sr=ki[1],or=Object(v.useRef)(Object(me.a)()),lr=Object(v.useRef)(!1),Cr=Object(v.useRef)(),jn=Object(v.useRef)(),Hn=Object(v.useRef)(),Wn=Object(v.useRef)(),Ar=Object(v.useRef)(),Mi=function(){var ut=Object(M.a)(O.a.mark(function vt(){var ct,St;return O.a.wrap(function(Bt){for(;;)switch(Bt.prev=Bt.next){case 0:return Bt.next=2,Object(ue.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:or.current}});case 2:St=Bt.sent,St!=null&&(ct=St.attachments)!==null&&ct!==void 0&&ct.length&&(console.log("cm:",Ve,jn),St.attachments.map(function(Lt){Lt.content_type.indexOf("image")>-1?Ve.replaceSelection(".concat(Lt.content_type,")")):Lt.content_type.indexOf("video")>-1?Ve.replaceSelection('<video width="100%" controls src="'.concat(f.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):Lt.content_type.indexOf("pdf")>-1?Ve.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(Lt.id,"?type=").concat(Lt.content_type,'&disposition=inline" target="_blank">').concat(Lt.name,"</a>")):Ve.replaceSelection("[".concat(Lt.name,"](").concat(f.a.API_SERVER,"/api/attachments/").concat(Lt.id,"?type=").concat(Lt.content_type,")"))}));case 4:case"end":return Bt.stop()}},vt)}));return function(){return ut.apply(this,arguments)}}();Object(v.useEffect)(function(){Rn(xr),Ve==null||Ve.setValue(xr)},[xr]),Object(v.useEffect)(function(){sn==null||sn(Ln)},[Ln]),Object(v.useEffect)(function(){if(jn.current){var ut=u.a.fromTextArea(jn.current,{mode:nn,lineNumbers:!Rt,lineWrapping:!0,value:Pe,autoCloseTags:!0,autoCloseBrackets:!0});Et&&ut.focus();function vt(ct,St){if(rr){St.preventDefault();return}var Dt=St.clipboardData;if(Dt){var Bt=Dt.types.toString(),Lt=Dt.items;if(Bt==="Files"||Dt.types.indexOf("Files")>-1){if(St.preventDefault(),nn=="stex")return;try{var $t,pn=Lt[1];(($t=Lt[0])===null||$t===void 0?void 0:$t.kind)==="file"&&(pn=Lt[0]);var At=pn.getAsFile(),Gn=At.name.split(".").pop();b(At,function(kt){if(kt.id){var mn,on,An;(At==null||((mn=At.type)===null||mn===void 0)?void 0:mn.indexOf("image"))>-1?ut.replaceSelection(".concat(kt.content_type,")")):(At==null||((on=At.type)===null||on===void 0)?void 0:on.indexOf("video"))>-1?ut.replaceSelection('<video width="100%" controls src="'.concat(f.a.API_SERVER,"/api/attachments/").concat(kt.id,'"></video>')):(At==null||((An=At.type)===null||An===void 0)?void 0:An.indexOf("pdf"))>-1?ut.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(kt.id,"?type=").concat(At.type,'&disposition=inline" target="_blank">').concat(At.name,"</a>")):re.includes(Gn)?ut.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(kt.id,'?type=office&disposition=inline" target="_blank">').concat(At.name,"</a>")):ut.replaceSelection("[".concat(At.name,"](").concat(f.a.API_SERVER,"/api/attachments/").concat(kt.id,"?type=").concat(kt.content_type,")"))}else(kt==null?void 0:kt.status)===401&&(document.location.href="/user/login")})}catch(kt){H.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return ut.on("paste",vt),ut.on("dragleave",function(ct,St){Hn.current.classList.remove("mouse-hover-md")}),ut.on("dragover",function(ct,St){Hn.current.classList.add("mouse-hover-md")}),ut.on("drop",function(ct,St){Hn.current.classList.add("mouse-hover-md");var Dt;if(Dt=St.dataTransfer.files,Dt.length>0){St.preventDefault(),St.stopPropagation();for(var Bt=function(pn){var At=Dt[pn],Gn=At.name.split(".").pop();b(At,function(kt){if(kt.id){var mn,on,An;(At==null||((mn=At.type)===null||mn===void 0)?void 0:mn.indexOf("image"))>-1?ut.replaceSelection(".concat(kt.content_type,")")):(At==null||((on=At.type)===null||on===void 0)?void 0:on.indexOf("video"))>-1?ut.replaceSelection('<video width="100%" controls src="'.concat(f.a.API_SERVER,"/api/attachments/").concat(kt.id,'"></video>')):(At==null||((An=At.type)===null||An===void 0)?void 0:An.indexOf("pdf"))>-1?ut.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(kt.id,"?type=").concat(At.type,'&disposition=inline" target="_blank">').concat(At.name,"</a>")):re.includes(Gn)?ut.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(kt.id,'?type=office&disposition=inline" target="_blank">').concat(At.name,"</a>")):ut.replaceSelection("[".concat(At.name,"](").concat(f.a.API_SERVER,"/api/attachments/").concat(kt.id,"?type=").concat(kt.content_type,")"))}else(kt==null?void 0:kt.status)===401&&(document.location.href="/user/login")})},Lt=0;Lt<Dt.length;Lt++)Bt(Lt)}}),Tr(ut),function(){ut.off("paste",vt)}}},[]);var Tn=Object(v.useCallback)(function(){if(Hn.current)try{}catch(ut){console.log(ut,"---- to set md editor body height")}},[Ii,Hn,Ln]);Object(v.useEffect)(function(){function ut(){var ct=new l.default(function(St){var Dt=Object(N.a)(St),Bt;try{for(Dt.s();!(Bt=Dt.n()).done;){var Lt=Bt.value;(Lt.target.offsetHeight>0||Lt.target.offsetWidth>0)&&(Tn(),Ve.setSize("100%","100%"),Ve.refresh())}}catch($t){Dt.e($t)}finally{Dt.f()}});return ct.observe(jn.current.parentElement),ct}if(Ve){var vt=ut();return function(){vt.unobserve(jn.current.parentElement)}}},[Ve,Tn]),Object(v.useEffect)(function(){if(Ve){for(var ut=[],vt=function(){var Lt=St[ct];Dt=Object(K.a)(Lt,2);var $t=Dt[0],pn=Dt[1],At=Object(G.a)({},$t,function(){Pi(pn)});ut.push(At),Ve.addKeyMap(At)},ct=0,St=Object.entries(ae);ct<St.length;ct++){var Dt;vt()}return Cr.current=setInterval(function(){lr.current&&Mi()},4e3),function(){clearInterval(Cr.current);var Bt=Object(N.a)(ut),Lt;try{for(Bt.s();!(Lt=Bt.n()).done;){var $t=Lt.value;Ve.removeKeyMap($t)}}catch(pn){Bt.e(pn)}finally{Bt.f()}}}},[Ve]),Object(v.useEffect)(function(){pt!==Ln&&Oi(pt)},[pt]),Object($e.a)(function(){if(!Nt&&In>0){var ut=new Date().getTime(),vt=window.sessionStorage.getItem(Pt);ut>=In+rt&&(!vt||vt!==ar)&&(window.sessionStorage.setItem(Pt,ar),Sr(!0))}},rt),Object(v.useEffect)(function(){$r(xt)},[Ve,xt]),Object(v.useEffect)(function(){Ve&&(Et&&Ve.focus())},[Ve,Et]),Object(v.useEffect)(function(){if(On&&Ve){var ut=Ve.getScrollerElement();function vt(ct){var St=ct.target;if(Ar.current){var Dt=St.scrollTop/St.scrollHeight;Ar.current.scrollTop=Ar.current.scrollHeight*Dt}}return ut.addEventListener("scroll",vt),function(){ut.removeEventListener("scroll",vt)}}},[Ve,On]),Object(v.useEffect)(function(){if(Ve&&Ct){function ut(vt,ct){Ct(vt,ct)}return Ve.on("beforeChange",ut),function(){Ve.off("beforeChange",ut)}}},[Ve,Ct]),Object(v.useEffect)(function(){if(Ve&>){function ut(){gt(Ve.getValue())}return Ve.on("blur",ut),function(){Ve.off("blur",ut)}}},[Ve,gt]),Object(v.useEffect)(function(){if(Ve){function ut(vt){var ct=vt.getValue();Rn(ct),Zr(new Date().getTime()),vt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),ze&&ze(ct)}return Ve.on("change",ut),function(){Ve.off("change",ut)}}},[Ve,ze]),Object(v.useEffect)(function(){Ve&&(Pe==null?(Ve.setValue(""),Rn("")):Pe!==Ve.getValue()&&(Ve.setValue(Pe),Rn(Pe),Ve.setCursor(Ve.lineCount(),0)))},[Ve,Pe]);var Pi=Object(v.useCallback)(function(ut){var vt=Ve.getCursor(),ct=Ve.getSelection(),St=ct.split(`
|
|
`);switch(ut){case"bold":return Ve.replaceSelection("**"+ct+"**"),ct===""&&Ve.setCursor(vt.line,vt.ch+2),Ve.focus();case"italic":return Ve.replaceSelection("*"+ct+"*"),ct===""&&Ve.setCursor(vt.line,vt.ch+1),Ve.focus();case"code":return Ve.replaceSelection("`"+ct+"`"),ct===""&&Ve.setCursor(vt.line,vt.ch+1),Ve.focus();case"inline-latex":return Ve.replaceSelection("`$$"+ct+"$$`"),ct===""&&Ve.setCursor(vt.line,vt.ch+3),Ve.focus();case"latex":return Ve.replaceSelection("```latex\n"+ct+"\n```"),Ve.setCursor(vt.line+1,ct.length+1),Ve.focus();case"line-break":return Ve.replaceSelection(`<br/>
|
|
`),Ve.focus();case"list-ul":return ct===""?Ve.replaceSelection("- "+ct):Ve.replaceSelection(St.map(function(Dt){return Dt===""?"":"- ".concat(Dt)}).join(`
|
|
`)),Ve.focus();case"list-ol":return ct===""?Ve.replaceSelection("1. "+ct):Ve.replaceSelection(St.map(function(Dt,Bt){return Dt===""?"":"".concat(Bt+1,". ").concat(Dt)}).join(`
|
|
`)),Ve.focus();case"add-null-ch":return ct===""&&Ve.setCursor(vt.line,vt.ch+1),Ve.replaceSelection(ce),Ve.focus();case"inster-template-1":return ct===""&&Ve.setCursor(vt.line,vt.ch),Ve.replaceSelection(ee),Ve.focus();case"eraser":return Ve.setValue(""),Ve.focus();case"trigger-watch":return $r(!On),Ve.focus();case"trigger-full-screen":return Oi(!Ln),Ve.focus();case we:Xn(we);return;case Ne:Xn(Ne);return;case Ae:Xn(Ae);return;case Be:Xn(Be);return;default:throw new Error}},[Ve,On,Ln]),Rr=Object(v.useCallback)(function(ut){Xn("");switch(cn){case we:var vt=ut.title,ct=ut.link;return Ve.replaceSelection("[".concat(vt,"](").concat(ct,")")),Ve.focus();case Ne:var St=ut.language,Dt=ut.content;return Ve.replaceSelection(["```"+St,Dt,"```"].join(`
|
|
`)),Ve.focus();case Ae:var Bt=ut.src,Lt=ut.alt;return Lt?Ve.replaceSelection(".concat(Bt,' "').concat(Lt,'" )')):Ve.replaceSelection("")),Ve.focus();case Be:for(var $t=ut.row,pn=ut.col,At=ut.align,Gn=`
|
|
`,kt=0;kt<$t;kt++){for(var mn=[],on=[],An=0;An<pn;An++)kt===1&&on.push(Ge[At]),mn.push(" ");kt===1&&(Gn+="| ".concat(on.join(" | "),` |
|
|
`)),Gn+="| ".concat(mn.join(pn===1?"":" | "),` |
|
|
`)}return Ve.replaceSelection(Gn+`
|
|
`),Ve.focus();default:throw new Error}},[Ve,cn]),qr=Object(v.useMemo)(function(){switch(cn){case we:return p.a.createElement(oe,{callback:Rr,onCancel:Yn});case Ne:return p.a.createElement(fe.b,{callback:Rr,onCancel:Yn});case Ae:return p.a.createElement(ve,{callback:Rr,onCancel:Yn});case Be:return p.a.createElement(Ie,{callback:Rr,onCancel:Yn});default:return null}},[cn]);function Yn(){Xn("")}Object(v.useEffect)(function(){if(Wn.current){var ut=Wn.current,vt=!1,ct=0;function St(Lt){vt=!0,ct=Lt.pageY}function Dt(){vt=!1}function Bt(Lt){if(vt){var $t=Lt.pageY-ct;$t<0&&($t=0),$t>300&&($t=300);var pn=lt+$t+"px";wr(pn)}}return ut.addEventListener("mousedown",St),document.addEventListener("mousemove",Bt),document.addEventListener("mouseup",Dt),function(){ut.removeEventListener("mousedown",St),document.removeEventListener("mousemove",Bt),document.removeEventListener("mouseup",Dt)}}},[Ve,Wn]),Object(v.useEffect)(function(){wr(lt)},[lt]);var Nn=ne(nt),ei=ne(Ii),Dn={width:Nn,height:ei},ti=Object(v.useMemo)(function(){if(In){var ut=new Date(In),vt=ut.getHours(),ct=ut.getMinutes(),St=ut.getSeconds();return vt=vt<10?"0"+vt:vt,ct=ct<10?"0"+ct:ct,St=St<10?"0"+St:St,"".concat(vt,":").concat(ct,":").concat(St)}return 0},[In]);function Ni(){window.sessionStorage.removeItem(Pt),Sr(!1),Zr(0)}function ur(){Sr(!1),Zr(0),Ve.setValue(window.sessionStorage.getItem(Pt))}function ua(ut,vt){var ct=Ve.getValue();ct=ct.replace(ut,vt),Rn(ct),Ve==null||Ve.setValue(ct)}return p.a.createElement(v.Fragment,null,p.a.createElement("div",{className:"markdown-editor-wrapper",ref:Hn},p.a.createElement("div",{className:"markdown-editor-container ".concat(He," ").concat(On?"on-preview":""," ").concat(Rt?"mini":""," ").concat(Ln?"full-screen":""),style:Dn},p.a.createElement(_,{insertTemp:Ye,watch:On,fullScreen:Ln,showNullButton:Ut,onActionCallback:Pi,hidetoolBar:Ot,uuid:or.current,setOpenPhones:function(){lr.current=!0}}),p.a.createElement("div",{className:"markdown-editor-body"},p.a.createElement("div",{className:"codemirror-container"},p.a.createElement("textarea",{ref:jn,placeholder:Er})),On?p.a.createElement("div",{ref:Ar,className:"preview-container"},nn==="stex"&&p.a.createElement(k,{value:ar}),nn!=="stex"&&p.a.createElement(T.a,{edit:!0,value:ar,replaces:ua})):null))),yt?p.a.createElement("a",{ref:Wn,className:"editor-resize"}):null,p.a.createElement(j.a,null,pe[cn]?p.a.createElement(Y.a,{centered:!0,title:pe[cn],visible:!0,onCancel:Yn,footer:null,className:"markdown-popup-form"},qr):null))}},SJMd:function(Ze,Se){/**
|
|
* @license
|
|
* Copyright (C) 2006 Google Inc.
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/var q,le,Y,N=!1,$,H;window.PR_SHOULD_USE_CONTINUATION=!0;var M,K;(function(){var G=window,n=["break,continue,do,else,for,if,return,while"],O=[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"],v=[O,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],p=[v,"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=[v,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],u=[v,"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"],l="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",d=[v,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],o="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"],s=[n,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],a=[n,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],A=[p,u,m,d,o,h,s,a],E=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,T="str",k="kwd",L="com",S="typ",R="lit",C="pun",f="pln",w="tag",y="dec",_="src",j="atn",U="atv",x="nocode",F="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function D(he){for(var xe=0,Ie=!1,ue=!1,me=0,we=he.length;me<we;++me){var Ae=he[me];if(Ae.ignoreCase)ue=!0;else if(/[a-z]/i.test(Ae.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Ie=!0,ue=!1;break}}var Ne={b:8,t:9,n:10,v:11,f:12,r:13};function Be(We){var Me=We.charCodeAt(0);if(Me!==92)return Me;var tt=We.charAt(1);return Me=Ne[tt],Me||("0"<=tt&&tt<="7"?parseInt(We.substring(1),8):tt==="u"||tt==="x"?parseInt(We.substring(2),16):We.charCodeAt(1))}function Ke(We){if(We<32)return(We<16?"\\x0":"\\x")+We.toString(16);var Me=String.fromCharCode(We);return Me==="\\"||Me==="-"||Me==="]"||Me==="^"?"\\"+Me:Me}function Ge(We){var Me=We.substring(1,We.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")),tt=[],rt=Me[0]==="^",ce=["["];rt&&ce.push("^");for(var ee=rt?1:0,ne=Me.length;ee<ne;++ee){var se=Me[ee];if(/\\[bdsw]/i.test(se))ce.push(se);else{var de=Be(se),re;ee+2<ne&&Me[ee+1]==="-"?(re=Be(Me[ee+2]),ee+=2):re=de,tt.push([de,re]),re<65||de>122||(re<65||de>90||tt.push([Math.max(65,de)|32,Math.min(re,90)|32]),re<97||de>122||tt.push([Math.max(97,de)&~32,Math.min(re,122)&~32]))}}tt.sort(function(_e,Oe){return _e[0]-Oe[0]||Oe[1]-_e[1]});for(var ae=[],pe=[],ee=0;ee<tt.length;++ee){var ge=tt[ee];ge[0]<=pe[1]+1?pe[1]=Math.max(pe[1],ge[1]):ae.push(pe=ge)}for(var ee=0;ee<ae.length;++ee){var ge=ae[ee];ce.push(Ke(ge[0])),ge[1]>ge[0]&&(ge[1]+1>ge[0]&&ce.push("-"),ce.push(Ke(ge[1])))}return ce.push("]"),ce.join("")}function $e(We){for(var Me=We.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")),tt=Me.length,rt=[],ce=0,ee=0;ce<tt;++ce){var ne=Me[ce];if(ne==="(")++ee;else if(ne.charAt(0)==="\\"){var se=+ne.substring(1);se&&(se<=ee?rt[se]=-1:Me[ce]=Ke(se))}}for(var ce=1;ce<rt.length;++ce)rt[ce]===-1&&(rt[ce]=++xe);for(var ce=0,ee=0;ce<tt;++ce){var ne=Me[ce];if(ne==="(")++ee,rt[ee]||(Me[ce]="(?:");else if(ne.charAt(0)==="\\"){var se=+ne.substring(1);se&&se<=ee&&(Me[ce]="\\"+rt[se])}}for(var ce=0;ce<tt;++ce)Me[ce]==="^"&&Me[ce+1]!=="^"&&(Me[ce]="");if(We.ignoreCase&&Ie)for(var ce=0;ce<tt;++ce){var ne=Me[ce],de=ne.charAt(0);ne.length>=2&&de==="["?Me[ce]=Ge(ne):de!=="\\"&&(Me[ce]=ne.replace(/[a-zA-Z]/g,function(pe){var ge=pe.charCodeAt(0);return"["+String.fromCharCode(ge&~32,ge|32)+"]"}))}return Me.join("")}for(var je=[],me=0,we=he.length;me<we;++me){var Ae=he[me];if(Ae.global||Ae.multiline)throw new Error(""+Ae);je.push("(?:"+$e(Ae)+")")}return new RegExp(je.join("|"),ue?"gi":"g")}function g(he,xe){var Ie=/(?:^|\s)nocode(?:\s|$)/,ue=[],me=0,we=[],Ae=0;function Ne(Be){var Ke=Be.nodeType;if(Ke==1){if(Ie.test(Be.className))return;for(var Ge=Be.firstChild;Ge;Ge=Ge.nextSibling)Ne(Ge);var $e=Be.nodeName.toLowerCase();($e==="br"||$e==="li")&&(ue[Ae]=`
|
|
`,we[Ae<<1]=me++,we[Ae++<<1|1]=Be)}else if(Ke==3||Ke==4){var je=Be.nodeValue;je.length&&(xe?je=je.replace(/\r\n?/g,`
|
|
`):je=je.replace(/[ \t\r\n]+/g," "),ue[Ae]=je,we[Ae<<1]=me,me+=je.length,we[Ae++<<1|1]=Be)}}return Ne(he),{sourceCode:ue.join("").replace(/\n$/,""),spans:we}}function W(he,xe,Ie,ue,me){if(!Ie)return;var we={sourceNode:he,pre:1,langExtension:null,numberLines:null,sourceCode:Ie,spans:null,basePos:xe,decorations:null};ue(we),me.push.apply(me,we.decorations)}var J=/\S/;function oe(he){for(var xe=void 0,Ie=he.firstChild;Ie;Ie=Ie.nextSibling){var ue=Ie.nodeType;xe=ue===1?xe?he:Ie:ue===3&&J.test(Ie.nodeValue)?he:xe}return xe===he?void 0:xe}function fe(he,xe){var Ie={},ue;(function(){for(var Ae=he.concat(xe),Ne=[],Be={},Ke=0,Ge=Ae.length;Ke<Ge;++Ke){var $e=Ae[Ke],je=$e[3];if(je)for(var We=je.length;--We>=0;)Ie[je.charAt(We)]=$e;var Me=$e[1],tt=""+Me;Be.hasOwnProperty(tt)||(Ne.push(Me),Be[tt]=null)}Ne.push(/[\0-\uffff]/),ue=D(Ne)})();var me=xe.length,we=function(Ae){for(var Ne=Ae.sourceCode,Be=Ae.basePos,Ke=Ae.sourceNode,Ge=[Be,f],$e=0,je=Ne.match(ue)||[],We={},Me=0,tt=je.length;Me<tt;++Me){var rt=je[Me],ce=We[rt],ee=void 0,ne;if(typeof ce=="string")ne=!1;else{var se=Ie[rt.charAt(0)];if(se)ee=rt.match(se[1]),ce=se[0];else{for(var de=0;de<me;++de)if(se=xe[de],ee=rt.match(se[1]),ee){ce=se[0];break}ee||(ce=f)}ne=ce.length>=5&&ce.substring(0,5)==="lang-",ne&&!(ee&&typeof ee[1]=="string")&&(ne=!1,ce=_),ne||(We[rt]=ce)}var re=$e;if($e+=rt.length,!ne)Ge.push(Be+re,ce);else{var ae=ee[1],pe=rt.indexOf(ae),ge=pe+ae.length;ee[2]&&(ge=rt.length-ee[2].length,pe=ge-ae.length);var _e=ce.substring(5);W(Ke,Be+re,rt.substring(0,pe),we,Ge),W(Ke,Be+re+pe,ae,X(_e,ae),Ge),W(Ke,Be+re+ge,rt.substring(ge),we,Ge)}}Ae.decorations=Ge};return we}function Re(he){var xe=[],Ie=[];he.tripleQuotedStrings?xe.push([T,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):he.multiLineStrings?xe.push([T,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):xe.push([T,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),he.verbatimStrings&&Ie.push([T,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var ue=he.hashComments;ue&&(he.cStyleComments?(ue>1?xe.push([L,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):xe.push([L,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Ie.push([T,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):xe.push([L,/^#[^\r\n]*/,null,"#"])),he.cStyleComments&&(Ie.push([L,/^\/\/[^\r\n]*/,null]),Ie.push([L,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var me=he.regexLiterals;if(me){var we=me>1?"":`
|
|
\r`,Ae=we?".":"[\\S\\s]",Ne="/(?=[^/*"+we+"])(?:[^/\\x5B\\x5C"+we+"]|\\x5C"+Ae+"|\\x5B(?:[^\\x5C\\x5D"+we+"]|\\x5C"+Ae+")*(?:\\x5D|$))+/";Ie.push(["lang-regex",RegExp("^"+F+"("+Ne+")")])}var Be=he.types;Be&&Ie.push([S,Be]);var Ke=(""+he.keywords).replace(/^ | $/g,"");Ke.length&&Ie.push([k,new RegExp("^(?:"+Ke.replace(/[\s,]+/g,"|")+")\\b"),null]),xe.push([f,/^\s+/,null,` \r
|
|
\xA0`]);var Ge="^.[^\\s\\w.$@'\"`/\\\\]*";return he.regexLiterals&&(Ge+="(?!s*/)"),Ie.push([R,/^@[a-z_$][a-z_$@0-9]*/i,null],[S,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[f,/^[a-z_$][a-z_$@0-9]*/i,null],[R,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[f,/^\\[\s\S]?/,null],[C,new RegExp(Ge),null]),fe(xe,Ie)}var be=Re({keywords:A,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Le(he,xe,Ie){for(var ue=/(?:^|\s)nocode(?:\s|$)/,me=/\r\n?|\n/,we=he.ownerDocument,Ae=we.createElement("li");he.firstChild;)Ae.appendChild(he.firstChild);var Ne=[Ae];function Be(Me){var tt=Me.nodeType;if(tt==1&&!ue.test(Me.className))if(Me.nodeName==="br")Ke(Me),Me.parentNode&&Me.parentNode.removeChild(Me);else for(var rt=Me.firstChild;rt;rt=rt.nextSibling)Be(rt);else if((tt==3||tt==4)&&Ie){var ce=Me.nodeValue,ee=ce.match(me);if(ee){var ne=ce.substring(0,ee.index);Me.nodeValue=ne;var se=ce.substring(ee.index+ee[0].length);if(se){var de=Me.parentNode;de.insertBefore(we.createTextNode(se),Me.nextSibling)}Ke(Me),ne||Me.parentNode.removeChild(Me)}}}function Ke(Me){for(;!Me.nextSibling;)if(Me=Me.parentNode,!Me)return;function tt(ee,ne){var se=ne?ee.cloneNode(!1):ee,de=ee.parentNode;if(de){var re=tt(de,1),ae=ee.nextSibling;re.appendChild(se);for(var pe=ae;pe;pe=ae)ae=pe.nextSibling,re.appendChild(pe)}return se}for(var rt=tt(Me.nextSibling,0),ce;(ce=rt.parentNode)&&ce.nodeType===1;)rt=ce;Ne.push(rt)}for(var Ge=0;Ge<Ne.length;++Ge)Be(Ne[Ge]);xe===(xe|0)&&Ne[0].setAttribute("value",xe);var $e=we.createElement("ol");$e.className="linenums";for(var je=Math.max(0,xe-1|0)||0,Ge=0,We=Ne.length;Ge<We;++Ge)Ae=Ne[Ge],Ae.className="L"+(Ge+je)%10,Ae.firstChild||Ae.appendChild(we.createTextNode("\xA0")),$e.appendChild(Ae);he.appendChild($e)}function Ce(he){var xe=/\bMSIE\s(\d+)/.exec(navigator.userAgent);xe=xe&&+xe[1]<=8;var Ie=/\n/g,ue=he.sourceCode,me=ue.length,we=0,Ae=he.spans,Ne=Ae.length,Be=0,Ke=he.decorations,Ge=Ke.length,$e=0;Ke[Ge]=me;var je,We;for(We=je=0;We<Ge;)Ke[We]!==Ke[We+2]?(Ke[je++]=Ke[We++],Ke[je++]=Ke[We++]):We+=2;for(Ge=je,We=je=0;We<Ge;){for(var Me=Ke[We],tt=Ke[We+1],rt=We+2;rt+2<=Ge&&Ke[rt+1]===tt;)rt+=2;Ke[je++]=Me,Ke[je++]=tt,We=rt}Ge=Ke.length=je;var ce=he.sourceNode,ee="";ce&&(ee=ce.style.display,ce.style.display="none");try{for(var ne=null;Be<Ne;){var se=Ae[Be],de=Ae[Be+2]||me,re=Ke[$e+2]||me,rt=Math.min(de,re),ae=Ae[Be+1],pe;if(ae.nodeType!==1&&(pe=ue.substring(we,rt))){xe&&(pe=pe.replace(Ie,"\r")),ae.nodeValue=pe;var ge=ae.ownerDocument,_e=ge.createElement("span");_e.className=Ke[$e+1];var Oe=ae.parentNode;Oe.replaceChild(_e,ae),_e.appendChild(ae),we<de&&(Ae[Be+1]=ae=ge.createTextNode(ue.substring(rt,de)),Oe.insertBefore(ae,_e.nextSibling))}we=rt,we>=de&&(Be+=2),we>=re&&($e+=2)}}finally{ce&&(ce.style.display=ee)}}var Te={};function ve(he,xe){for(var Ie=xe.length;--Ie>=0;){var ue=xe[Ie];Te.hasOwnProperty(ue)?G.console&&console.warn("cannot override language handler %s",ue):Te[ue]=he}}function X(he,xe){return he&&Te.hasOwnProperty(he)||(he=/^\s*</.test(xe)?"default-markup":"default-code"),Te[he]}ve(be,["default-code"]),ve(fe([],[[f,/^[^<?]+/],[y,/^<!\w[^>]*(?:>|$)/],[L,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[C,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),ve(fe([[f,/^[\s]+/,null,` \r
|
|
`],[U,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[w,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[j,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[C,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),ve(fe([],[[U,/^[\s\S]+/]]),["uq.val"]),ve(Re({keywords:p,hashComments:!0,cStyleComments:!0,types:E}),["c","cc","cpp","cxx","cyc","m"]),ve(Re({keywords:"null,true,false"}),["json"]),ve(Re({keywords:u,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:E}),["cs"]),ve(Re({keywords:m,cStyleComments:!0}),["java"]),ve(Re({keywords:a,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),ve(Re({keywords:h,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),ve(Re({keywords:o,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),ve(Re({keywords:s,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),ve(Re({keywords:d,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),ve(Re({keywords:l,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),ve(fe([],[[T,/^[\s\S]+/]]),["regex"]);function b(he){var xe=he.langExtension;try{var Ie=g(he.sourceNode,he.pre),ue=Ie.sourceCode;he.sourceCode=ue,he.spans=Ie.spans,he.basePos=0,X(xe,ue)(he),Ce(he)}catch(me){G.console&&console.log(me&&me.stack||me)}}function I(he,xe,Ie){var ue=Ie||!1,me=xe||null,we=document.createElement("div");we.innerHTML="<pre>"+he+"</pre>",we=we.firstChild,ue&&Le(we,ue,!0);var Ae={langExtension:me,numberLines:ue,sourceNode:we,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return b(Ae),we.innerHTML}function B(he,xe){var Ie=xe||document.body,ue=Ie.ownerDocument||document;function me(se){return Ie.getElementsByTagName(se)}for(var we=[me("pre"),me("code"),me("xmp")],Ae=[],Ne=0;Ne<we.length;++Ne)for(var Be=0,Ke=we[Ne].length;Be<Ke;++Be)Ae.push(we[Ne][Be]);we=null;var Ge=Date;Ge.now||(Ge={now:function(){return+new Date}});var $e=0,je=/\blang(?:uage)?-([\w.]+)(?!\S)/,We=/\bprettyprint\b/,Me=/\bprettyprinted\b/,tt=/pre|xmp/i,rt=/^code$/i,ce=/^(?:pre|code|xmp)$/i,ee={};function ne(){for(var se=G.PR_SHOULD_USE_CONTINUATION?Ge.now()+250:Infinity;$e<Ae.length&&Ge.now()<se;$e++){for(var de=Ae[$e],re=ee,ae=de;ae=ae.previousSibling;){var pe=ae.nodeType,ge=(pe===7||pe===8)&&ae.nodeValue;if(ge?!/^\??prettify\b/.test(ge):pe!==3||/\S/.test(ae.nodeValue))break;if(ge){re={},ge.replace(/\b(\w+)=([\w:.%+-]+)/g,function(xt,Ye,Qt){re[Ye]=Qt});break}}var _e=de.className;if((re!==ee||We.test(_e))&&!Me.test(_e)){for(var Oe=!1,Pe=de.parentNode;Pe;Pe=Pe.parentNode){var ze=Pe.tagName;if(ce.test(ze)&&Pe.className&&We.test(Pe.className)){Oe=!0;break}}if(!Oe){de.className+=" prettyprinted";var et=re.lang;if(!et){et=_e.match(je);var nt;!et&&(nt=oe(de))&&rt.test(nt.tagName)&&(et=nt.className.match(je)),et&&(et=et[1])}var _t;if(tt.test(de.tagName))_t=1;else{var lt=de.currentStyle,at=ue.defaultView,Rt=lt?lt.whiteSpace:at&&at.getComputedStyle?at.getComputedStyle(de,null).getPropertyValue("white-space"):0;_t=Rt&&Rt.substring(0,3)==="pre"}var ot=re.linenums;(ot=ot==="true"||+ot)||(ot=_e.match(/\blinenums\b(?::(\d+))?/),ot=ot?ot[1]&&ot[1].length?+ot[1]:!0:!1),ot&&Le(de,ot,_t);var Et={langExtension:et,sourceNode:de,numberLines:ot,pre:_t,sourceCode:null,basePos:null,spans:null,decorations:null};b(Et)}}}$e<Ae.length?G.setTimeout(ne,250):typeof he=="function"&&he()}ne()}var Q=G.PR={createSimpleLexer:fe,registerLangHandler:ve,sourceDecorator:Re,PR_ATTRIB_NAME:j,PR_ATTRIB_VALUE:U,PR_COMMENT:L,PR_DECLARATION:y,PR_KEYWORD:k,PR_LITERAL:R,PR_NOCODE:x,PR_PLAIN:f,PR_PUNCTUATION:C,PR_SOURCE:_,PR_STRING:T,PR_TAG:w,PR_TYPE:S,prettyPrintOne:N?G.prettyPrintOne=I:M=I,prettyPrint:K=N?G.prettyPrint=B:K=B},z=G.define;typeof z=="function"&&z.amd&&z("google-code-prettify",[],function(){return Q})})()},STEk:function(Ze,Se,q){"use strict";q.d(Se,"a",function(){return ve});/*! *****************************************************************************
|
|
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 le=function(X,b){return(le=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(I,B){I.__proto__=B}||function(I,B){for(var Q in B)Object.prototype.hasOwnProperty.call(B,Q)&&(I[Q]=B[Q])})(X,b)};function Y(X,b){function I(){this.constructor=X}le(X,b),X.prototype=b===null?Object.create(b):(I.prototype=b.prototype,new I)}function N(X,b,I,B){return new(I||(I=Promise))(function(Q,z){function he(ue){try{Ie(B.next(ue))}catch(me){z(me)}}function xe(ue){try{Ie(B.throw(ue))}catch(me){z(me)}}function Ie(ue){var me;ue.done?Q(ue.value):(me=ue.value,me instanceof I?me:new I(function(we){we(me)})).then(he,xe)}Ie((B=B.apply(X,b||[])).next())})}function $(X,b){var I,B,Q,z,he={label:0,sent:function(){if(1&Q[0])throw Q[1];return Q[1]},trys:[],ops:[]};return z={next:xe(0),throw:xe(1),return:xe(2)},typeof Symbol=="function"&&(z[Symbol.iterator]=function(){return this}),z;function xe(Ie){return function(ue){return function(me){if(I)throw new TypeError("Generator is already executing.");for(;he;)try{if(I=1,B&&(Q=2&me[0]?B.return:me[0]?B.throw||((Q=B.return)&&Q.call(B),0):B.next)&&!(Q=Q.call(B,me[1])).done)return Q;switch(B=0,Q&&(me=[2&me[0],Q.value]),me[0]){case 0:case 1:Q=me;break;case 4:return he.label++,{value:me[1],done:!1};case 5:he.label++,B=me[1],me=[0];continue;case 7:me=he.ops.pop(),he.trys.pop();continue;default:if(!(Q=he.trys,(Q=Q.length>0&&Q[Q.length-1])||me[0]!==6&&me[0]!==2)){he=0;continue}if(me[0]===3&&(!Q||me[1]>Q[0]&&me[1]<Q[3])){he.label=me[1];break}if(me[0]===6&&he.label<Q[1]){he.label=Q[1],Q=me;break}if(Q&&he.label<Q[2]){he.label=Q[2],he.ops.push(me);break}Q[2]&&he.ops.pop(),he.trys.pop();continue}me=b.call(X,he)}catch(we){me=[6,we],B=0}finally{I=Q=0}if(5&me[0])throw me[1];return{value:me[0]?me[1]:void 0,done:!0}}([Ie,ue])}}}function H(){for(var X=0,b=0,I=arguments.length;b<I;b++)X+=arguments[b].length;var B=Array(X),Q=0;for(b=0;b<I;b++)for(var z=arguments[b],he=0,xe=z.length;he<xe;he++,Q++)B[Q]=z[he];return B}var M=function(){function X(){}return X.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},X.setAttributes=function(b,I){for(var B=0,Q=I;B<Q.length;B++){var z=Q[B],he=z[0],xe=z[1];b.setAttribute(he,xe)}},X.createRect=function(b,I,B){var Q=document.createElementNS("http://www.w3.org/2000/svg","rect");return Q.setAttribute("width",b.toString()),Q.setAttribute("height",I.toString()),B&&X.setAttributes(Q,B),Q},X.createLine=function(b,I,B,Q,z){var he=document.createElementNS("http://www.w3.org/2000/svg","line");return he.setAttribute("x1",b.toString()),he.setAttribute("y1",I.toString()),he.setAttribute("x2",B.toString()),he.setAttribute("y2",Q.toString()),z&&X.setAttributes(he,z),he},X.createPolygon=function(b,I){var B=document.createElementNS("http://www.w3.org/2000/svg","polygon");return B.setAttribute("points",b),I&&X.setAttributes(B,I),B},X.createCircle=function(b,I){var B=document.createElementNS("http://www.w3.org/2000/svg","circle");return B.setAttribute("cx",(b/2).toString()),B.setAttribute("cy",(b/2).toString()),B.setAttribute("r",b.toString()),I&&X.setAttributes(B,I),B},X.createEllipse=function(b,I,B){var Q=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return Q.setAttribute("cx",(b/2).toString()),Q.setAttribute("cy",(I/2).toString()),Q.setAttribute("rx",(b/2).toString()),Q.setAttribute("ry",(I/2).toString()),B&&X.setAttributes(Q,B),Q},X.createGroup=function(b){var I=document.createElementNS("http://www.w3.org/2000/svg","g");return b&&X.setAttributes(I,b),I},X.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},X.createMarker=function(b,I,B,Q,z,he,xe){var Ie=document.createElementNS("http://www.w3.org/2000/svg","marker");return X.setAttributes(Ie,[["id",b],["orient",I],["markerWidth",B.toString()],["markerHeight",Q.toString()],["refX",z.toString()],["refY",he.toString()]]),Ie.appendChild(xe),Ie},X.createText=function(b){var I=document.createElementNS("http://www.w3.org/2000/svg","text");return I.setAttribute("x","0"),I.setAttribute("y","0"),b&&X.setAttributes(I,b),I},X.createTSpan=function(b,I){var B=document.createElementNS("http://www.w3.org/2000/svg","tspan");return B.textContent=b,I&&X.setAttributes(B,I),B},X.createImage=function(b){var I=document.createElementNS("http://www.w3.org/2000/svg","image");return b&&X.setAttributes(I,b),I},X.createPoint=function(b,I){var B=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return B.x=b,B.y=I,B},X.createPath=function(b,I){var B=document.createElementNS("http://www.w3.org/2000/svg","path");return B.setAttribute("d",b),I&&X.setAttributes(B,I),B},X}(),K=function(){function X(){}return X.addKey=function(b){X.key=b},Object.defineProperty(X,"isLicensed",{get:function(){return!!X.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(X.key)},enumerable:!1,configurable:!0}),X}(),G=function(){function X(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return X.prototype.rasterize=function(b,I,B){var Q=this;return new Promise(function(z){var he=B!==void 0?B:document.createElement("canvas");b===null&&(Q.markersOnly=!0,Q.naturalSize=!1);var xe=document.createElementNS("http://www.w3.org/2000/svg","svg");xe.setAttribute("xmlns","http://www.w3.org/2000/svg"),xe.setAttribute("width",I.width.baseVal.valueAsString),xe.setAttribute("height",I.height.baseVal.valueAsString),xe.setAttribute("viewBox","0 0 "+I.viewBox.baseVal.width.toString()+" "+I.viewBox.baseVal.height.toString()),xe.innerHTML=I.innerHTML,Q.naturalSize===!0?(xe.width.baseVal.value=b.naturalWidth,xe.height.baseVal.value=b.naturalHeight):Q.width!==void 0&&Q.height!==void 0&&(xe.width.baseVal.value=Q.width,xe.height.baseVal.value=Q.height),he.width=xe.width.baseVal.value,he.height=xe.height.baseVal.value;var Ie=xe.outerHTML,ue=he.getContext("2d");Q.markersOnly!==!0&&ue.drawImage(b,0,0,he.width,he.height);var me=window.URL,we=new Image(he.width,he.height);we.setAttribute("crossOrigin","anonymous");var Ae=new Blob([Ie],{type:"image/svg+xml"}),Ne=me.createObjectURL(Ae);we.onload=function(){ue.drawImage(we,0,0),me.revokeObjectURL(Ne);var Be=he.toDataURL(Q.imageType,Q.imageQuality);z(Be)},we.src=Ne})},X}(),n=function(){},O=function(){function X(b){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+b+"_"}return Object.defineProperty(X.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(X.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(X.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),X.prototype.addClass=function(b){return this.styleSheet===void 0&&this.addStyleSheet(),b.name=""+this.classNamePrefix+b.localName,this.classes.push(b),this.styleSheet.sheet.insertRule("."+b.name+" {"+b.style+"}",this.styleSheet.sheet.cssRules.length),b},X.prototype.addRule=function(b){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(b),this.styleSheet.sheet.insertRule(b.selector+" {"+b.style+"}",this.styleSheet.sheet.cssRules.length)},X.prototype.addStyleSheet=function(){var b;this.styleSheet=document.createElement("style"),((b=this.styleSheetRoot)!==null&&b!==void 0?b:document.head).appendChild(this.styleSheet),this.addRule(new v("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new v("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new v("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new p("fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new p("fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},X.prototype.removeStyleSheet=function(){var b;this.styleSheet&&(((b=this.styleSheetRoot)!==null&&b!==void 0?b:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},X}(),v=function(X,b){this.selector=X,this.style=b},p=function(X,b){this.localName=X,this.style=b},m=function(){function X(b,I,B,Q,z){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=b,this.displayMode=I,this.markerItems=B,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 X.prototype.show=function(b){var I=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=b,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var B=document.createElement("div");B.className=this.toolbarBlockStyleClass.name,B.style.whiteSpace="nowrap",this.uiContainer.appendChild(B),this.addActionButton(B,'<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(B,'<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(B,'<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(B,'<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(B,'<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(B,'<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(B,'<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(B,'<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 he=document.createElement("div");he.className=""+I.toolbarButtonStyleClass.name,he.setAttribute("data-type-name",z.typeName),he.innerHTML=z.icon,he.addEventListener("click",function(){I.markerToolbarButtonClicked(he,z)}),I.buttons.push(he),I.markerButtons.push(he)}),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()},X.prototype.addButtonClickListener=function(b){this.buttonClickListeners.push(b)},X.prototype.removeButtonClickListener=function(b){this.buttonClickListeners.indexOf(b)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(b),1)},X.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},X.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var b=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<b||I===b&&this.markerButtons.length-1===b?this.markerButtonBlock.appendChild(this.markerButtons[I]):(I===b&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[I]))}},X.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")},X.prototype.resetButtonStyles=function(){var b=this;this.buttons.forEach(function(I){I.className=I.className.replace(b.uiStyleSettings.toolbarButtonStyleColorsClassName?b.uiStyleSettings.toolbarButtonStyleColorsClassName:b.toolbarButtonStyleColorsClass.name,"").trim(),I.className=I.className.replace(b.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?b.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:b.toolbarActiveButtonStyleColorsClass.name,"").trim(),I.className+=" "+(b.uiStyleSettings.toolbarButtonStyleColorsClassName?b.uiStyleSettings.toolbarButtonStyleColorsClassName:b.toolbarButtonStyleColorsClass.name)})},X.prototype.addActionButton=function(b,I,B){var Q=this,z=document.createElement("div");switch(z.className=""+this.toolbarButtonStyleClass.name,z.innerHTML=I,z.setAttribute("data-action",B),z.addEventListener("click",function(){Q.actionToolbarButtonClicked(z,B)}),B){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}b.appendChild(z),this.buttons.push(z)},X.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new p("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 p("toolbar_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new p("toolbar-block",`
|
|
display: inline-block;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new p("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 p("toolbar-overflow-block_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`));var b=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new p("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*b)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*b)+`px;
|
|
padding: `+b+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new p("toolbar_button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new p("toolbar_active_button",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new v("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new v("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`))},X.prototype.markerToolbarButtonClicked=function(b,I){this.setActiveButton(b),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(B){return B("marker",I)}),this.markerButtonOverflowBlock.style.display="none"},X.prototype.actionToolbarButtonClicked=function(b,I){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(B){return B("action",I)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},X.prototype.setActiveButton=function(b){this.resetButtonStyles(),b.className=b.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),b.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},X.prototype.setActiveMarkerButton=function(b){var I=this.markerButtons.find(function(B){return B.getAttribute("data-type-name")===b});I&&this.setActiveButton(I)},X.prototype.setCurrentMarker=function(b){var I=this;this.currentMarker=b,this.buttons.filter(function(B){return/delete|notes/.test(B.getAttribute("data-action"))}).forEach(function(B){I.currentMarker===void 0?(B.style.fillOpacity="0.4",B.style.pointerEvents="none"):(B.style.fillOpacity="1",B.style.pointerEvents="all")})},X}(),u=function(){function X(b,I,B,Q){this.panels=[],this.panelButtons=[],this.markerjsContainer=b,this.displayMode=I,this.uiStyleSettings=B,this.styles=Q,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return X.prototype.addStyles=function(){var b;this.toolboxStyleClass=this.styles.addClass(new p("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 p("toolbox_colors",`
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
`));var I=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new p("toolbox-button-row",`
|
|
display: flex;
|
|
cursor: default;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new p("toolbox-button-row_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new p("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 p("toolbox-panel-row_colors",`
|
|
background-color: `+((b=this.uiStyleSettings.toolboxBackgroundColor)!==null&&b!==void 0?b:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new p("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 p("toolbox-button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new p("toolbox-active-button_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.styles.addRule(new v("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new v("."+this.toolboxButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`))},X.prototype.show=function(b){var I;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=b,this.uiContainer.className=this.toolboxStyleClass.name+" "+((I=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&I!==void 0?I:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},X.prototype.setPanelButtons=function(b){var I,B,Q=this;this.panels=b,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+" "+((B=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&B!==void 0?B:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(z){var he;z.uiStyleSettings=Q.uiStyleSettings;var xe=document.createElement("div");xe.className=Q.toolboxButtonStyleClass.name+" "+((he=Q.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&he!==void 0?he:Q.toolboxButtonStyleColorsClass.name),xe.innerHTML=z.icon,xe.title=z.title,xe.addEventListener("click",function(){Q.panelButtonClick(z)}),Q.panelButtons.push(xe),Q.buttonRow.appendChild(xe)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},X.prototype.panelButtonClick=function(b){var I=this,B=-1;if(b!==this.activePanel){B=this.panels.indexOf(b),this.panelRow.innerHTML="";var Q=b.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=b}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,he){var xe,Ie;z.className=I.toolboxButtonStyleClass.name+" "+(he===B?""+((xe=I.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&xe!==void 0?xe:I.toolboxActiveButtonStyleColorsClass.name):""+((Ie=I.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Ie!==void 0?Ie:I.toolboxButtonStyleColorsClass.name))})},X}(),l=function(X,b){this.title=X,this.icon=b},d=function(X){function b(I,B,Q,z){var he=X.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 he.colors=[],he.addTransparent=!1,he.colorBoxes=[],he.colors=B,he.currentColor=Q,he.setCurrentColor=he.setCurrentColor.bind(he),he.getColorBox=he.getColorBox.bind(he),he}return Y(b,X),b.prototype.getUi=function(){var I=this,B=document.createElement("div");return B.style.overflow="hidden",B.style.whiteSpace="nowrap",this.colors.forEach(function(Q){var z=I.getColorBox(Q);B.appendChild(z),I.colorBoxes.push(z)}),B},b.prototype.getColorBox=function(I){var B=this,Q=this.uiStyleSettings.toolbarHeight/4,z=this.uiStyleSettings.toolbarHeight-Q,he=document.createElement("div");he.style.display="inline-block",he.style.boxSizing="content-box",he.style.width=z-2+"px",he.style.height=z-2+"px",he.style.padding="1px",he.style.marginRight="2px",he.style.marginBottom="2px",he.style.borderWidth="2px",he.style.borderStyle="solid",he.style.borderRadius=(z+2)/2+"px",he.style.borderColor=I===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",he.addEventListener("click",function(){B.setCurrentColor(I,he)});var xe=document.createElement("div");return xe.style.display="inline-block",xe.style.width=z-2+"px",xe.style.height=z-2+"px",xe.style.backgroundColor=I,xe.style.borderRadius=z/2+"px",I==="transparent"&&(xe.style.fill=this.uiStyleSettings.toolboxAccentColor,xe.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>`),he.appendChild(xe),he},b.prototype.setCurrentColor=function(I,B){var Q=this;this.currentColor=I,this.colorBoxes.forEach(function(z){z.style.borderColor=z===B?Q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(I)},b}(l),o=function(){function X(b,I,B){this._state="new",this._isSelected=!1,this._container=b,this._overlayContainer=I,this.globalSettings=B,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(X.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),X.prototype.ownsTarget=function(b){return!1},Object.defineProperty(X.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),X.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},X.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},X.prototype.pointerDown=function(b,I){},X.prototype.dblClick=function(b,I){},X.prototype.manipulate=function(b){},X.prototype.pointerUp=function(b){this.stateChanged()},X.prototype.dispose=function(){},X.prototype.addMarkerVisualToContainer=function(b){this.container.childNodes.length>0?this.container.insertBefore(b,this.container.childNodes[0]):this.container.appendChild(b)},X.prototype.getState=function(){return{typeName:X.typeName,state:this.state,notes:this.notes}},X.prototype.restoreState=function(b){this._state=b.state,this.notes=b.notes},X.prototype.scale=function(b,I){},X.prototype.colorChanged=function(b){this.onColorChanged&&this.onColorChanged(b),this.stateChanged()},X.prototype.fillColorChanged=function(b){this.onFillColorChanged&&this.onFillColorChanged(b),this.stateChanged()},X.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var b=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),b.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(b)&&this.onStateChanged(this)}},X.typeName="MarkerBase",X}(),h=function(){function X(){this.findGripByVisual=this.findGripByVisual.bind(this)}return X.prototype.findGripByVisual=function(b){return this.topLeft.ownsTarget(b)?this.topLeft:this.topCenter.ownsTarget(b)?this.topCenter:this.topRight.ownsTarget(b)?this.topRight:this.centerLeft.ownsTarget(b)?this.centerLeft:this.centerRight.ownsTarget(b)?this.centerRight:this.bottomLeft.ownsTarget(b)?this.bottomLeft:this.bottomCenter.ownsTarget(b)?this.bottomCenter:this.bottomRight.ownsTarget(b)?this.bottomRight:void 0},X}(),s=function(){function X(){this.GRIP_SIZE=10,this.visual=M.createGroup(),this.visual.appendChild(M.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(M.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return X.prototype.ownsTarget=function(b){return b===this.visual||b===this.visual.childNodes[0]||b===this.visual.childNodes[1]},X}(),a=function(){function X(){}return X.toITransformMatrix=function(b){return{a:b.a,b:b.b,c:b.c,d:b.d,e:b.e,f:b.f}},X.toSVGMatrix=function(b,I){return b.a=I.a,b.b=I.b,b.c=I.c,b.d=I.d,b.e=I.e,b.f=I.f,b},X}(),A=function(X){function b(I,B,Q){var z=X.call(this,I,B,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(M.createTransform()),z.setupControlBox(),z}return Y(b,X),Object.defineProperty(b.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"visual",{get:function(){return this._visual},set:function(I){this._visual=I;var B=M.createTransform();this._visual.transform.baseVal.appendItem(B)},enumerable:!1,configurable:!0}),b.prototype.ownsTarget=function(I){return!!X.prototype.ownsTarget.call(this,I)||!!(this.controlGrips.findGripByVisual(I)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(I))},b.prototype.pointerDown=function(I,B){X.prototype.pointerDown.call(this,I,B),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(B),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(B)){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 he=this.container.transform.baseVal.getItem(0);he.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(he,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},b.prototype.pointerUp=function(I){var B=this.state;X.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",B==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},b.prototype.moveVisual=function(I){this.visual.style.transform="translate("+I.x+"px, "+I.y+"px)"},b.prototype.manipulate=function(I){var B=this.unrotatePoint(I);this.state==="creating"?this.resize(I):this.state==="move"?(this.left=this.manipulationStartLeft+(B.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(B.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(B):this.state==="rotate"&&this.rotate(I)},b.prototype.resize=function(I){var B=this.manipulationStartLeft,Q=this.manipulationStartWidth,z=this.manipulationStartTop,he=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:B=this.manipulationStartLeft+I.x-this.manipulationStartX,Q=this.manipulationStartWidth+this.manipulationStartLeft-B;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,he=this.manipulationStartHeight+this.manipulationStartTop-z;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:he=this.manipulationStartHeight+I.y-this.manipulationStartY}Q>=0?(this.left=B,this.width=Q):(this.left=B+Q,this.width=-Q),he>=0?(this.top=z,this.height=he):(this.top=z+he,this.height=-he),this.setSize()},b.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},b.prototype.rotate=function(I){if(Math.abs(I.x-this.centerX)>.1){var B=Math.sign(I.x-this.centerX);this.rotationAngle=180*Math.atan((I.y-this.centerY)/(I.x-this.centerX))/Math.PI+90*B,this.applyRotation()}},b.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)},b.prototype.rotatePoint=function(I){if(this.rotationAngle===0)return I;var B=this.container.getCTM(),Q=M.createPoint(I.x,I.y);return{x:(Q=Q.matrixTransform(B)).x,y:Q.y}},b.prototype.unrotatePoint=function(I){if(this.rotationAngle===0)return I;var B=this.container.getCTM();B=B.inverse();var Q=M.createPoint(I.x,I.y);return{x:(Q=Q.matrixTransform(B)).x,y:Q.y}},b.prototype.select=function(){X.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},b.prototype.deselect=function(){X.prototype.deselect.call(this),this.controlBox.style.display="none"},b.prototype.setupControlBox=function(){this.controlBox=M.createGroup();var I=M.createTransform();I.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(I),this.container.appendChild(this.controlBox),this.controlRect=M.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=M.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 h,this.addControlGrips(),this.controlBox.style.display="none"},b.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()},b.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()},b.prototype.createGrip=function(){var I=new s;return I.visual.transform.baseVal.appendItem(M.createTransform()),this.controlBox.appendChild(I.visual),I},b.prototype.positionGrips=function(){var I=this.controlGrips.topLeft.GRIP_SIZE,B=-I/2,Q=B,z=(this.width+this.CB_DISTANCE)/2-I/2,he=(this.height+this.CB_DISTANCE)/2-I/2,xe=this.height+this.CB_DISTANCE-I/2,Ie=this.width+this.CB_DISTANCE-I/2;this.positionGrip(this.controlGrips.topLeft.visual,B,Q),this.positionGrip(this.controlGrips.topCenter.visual,z,Q),this.positionGrip(this.controlGrips.topRight.visual,Ie,Q),this.positionGrip(this.controlGrips.centerLeft.visual,B,he),this.positionGrip(this.controlGrips.centerRight.visual,Ie,he),this.positionGrip(this.controlGrips.bottomLeft.visual,B,xe),this.positionGrip(this.controlGrips.bottomCenter.visual,z,xe),this.positionGrip(this.controlGrips.bottomRight.visual,Ie,xe),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,z,Q-3*this.CB_DISTANCE)},b.prototype.positionGrip=function(I,B,Q){var z=I.transform.baseVal.getItem(0);z.setTranslate(B,Q),I.transform.baseVal.replaceItem(z,0)},b.prototype.hideControlBox=function(){this.controlBox.style.display="none"},b.prototype.showControlBox=function(){this.controlBox.style.display=""},b.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:a.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:a.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},X.prototype.getState.call(this))},b.prototype.restoreState=function(I){X.prototype.restoreState.call(this,I);var B=I;this.left=B.left,this.top=B.top,this.width=B.width,this.height=B.height,this.rotationAngle=B.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(a.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,B.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(a.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,B.containerTransformMatrix))},b.prototype.scale=function(I,B){X.prototype.scale.call(this,I,B);var Q=this.rotatePoint({x:this.left,y:this.top}),z=this.unrotatePoint({x:Q.x*I,y:Q.y*B});this.left=z.x,this.top=z.y,this.width=this.width*I,this.height=this.height*B,this.adjustControlBox()},b}(o),E=function(X){function b(I,B,Q){var z=X.call(this,I,B,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 Y(b,X),b.prototype.ownsTarget=function(I){return!(!X.prototype.ownsTarget.call(this,I)&&I!==this.visual)},b.prototype.createVisual=function(){this.visual=M.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)},b.prototype.pointerDown=function(I,B){X.prototype.pointerDown.call(this,I,B),this.state==="new"&&(this.createVisual(),this.moveVisual(I),this._state="creating")},b.prototype.manipulate=function(I){X.prototype.manipulate.call(this,I)},b.prototype.resize=function(I){X.prototype.resize.call(this,I),this.setSize()},b.prototype.setSize=function(){X.prototype.setSize.call(this),M.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},b.prototype.pointerUp=function(I){X.prototype.pointerUp.call(this,I),this.setSize()},b.prototype.setStrokeColor=function(I){this.strokeColor=I,this.visual&&M.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(I),this.stateChanged()},b.prototype.setFillColor=function(I){this.fillColor=I,this.visual&&M.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},b.prototype.setStrokeWidth=function(I){this.strokeWidth=I,this.visual&&M.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},b.prototype.setStrokeDasharray=function(I){this.strokeDasharray=I,this.visual&&M.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},b.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},X.prototype.getState.call(this))},b.prototype.restoreState=function(I){var B=I;this.fillColor=B.fillColor,this.strokeColor=B.strokeColor,this.strokeWidth=B.strokeWidth,this.strokeDasharray=B.strokeDasharray,this.opacity=B.opacity,this.createVisual(),X.prototype.restoreState.call(this,I),this.setSize()},b.prototype.scale=function(I,B){X.prototype.scale.call(this,I,B),this.setSize()},b.title="Rectangle marker",b}(A),T=function(X){function b(I,B,Q,z){var he=X.call(this,I,z||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return he.widths=[],he.widthBoxes=[],he.widths=B,he.currentWidth=Q,he.setCurrentWidth=he.setCurrentWidth.bind(he),he}return Y(b,X),b.prototype.getUi=function(){var I=this,B=document.createElement("div");return B.style.display="flex",B.style.overflow="hidden",B.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)}),B.appendChild(z);var he=document.createElement("div");he.innerText=Q.toString(),he.style.marginRight="5px",z.appendChild(he);var xe=document.createElement("div");xe.style.minHeight="20px",xe.style.flexGrow="2",xe.style.display="flex",xe.style.alignItems="center";var Ie=document.createElement("hr");Ie.style.minWidth="20px",Ie.style.border="0px",Ie.style.borderTop=Q+"px solid "+I.uiStyleSettings.toolboxColor,Ie.style.flexGrow="2",xe.appendChild(Ie),z.appendChild(xe),I.widthBoxes.push(z)}),B},b.prototype.setCurrentWidth=function(I,B){var Q=this;this.currentWidth=I,this.widthBoxes.forEach(function(z){z.style.borderColor=z===B?Q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},b}(l),k=function(X){function b(I,B,Q,z){var he=X.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 he.styles=[],he.styleBoxes=[],he.styles=B,he.currentStyle=Q,he.setCurrentStyle=he.setCurrentStyle.bind(he),he}return Y(b,X),b.prototype.getUi=function(){var I=this,B=document.createElement("div");return B.style.display="flex",B.style.overflow="hidden",B.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)}),B.appendChild(z);var he=document.createElement("div");he.style.minHeight="20px",he.style.flexGrow="2",he.style.overflow="hidden";var xe=`<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>`;he.innerHTML=xe,z.appendChild(he),I.styleBoxes.push(z)}),B},b.prototype.setCurrentStyle=function(I,B){var Q=this;this.currentStyle=I,this.styleBoxes.forEach(function(z){z.style.borderColor=z===B?Q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},b}(l),L=function(X){function b(I,B,Q){var z=X.call(this,I,B,Q)||this;return z.strokeColor=Q.defaultColor,z.strokeWidth=Q.defaultStrokeWidth,z.strokeDasharray=Q.defaultStrokeDasharray,z.strokePanel=new d("Line color",Q.defaultColorSet,Q.defaultColor),z.strokePanel.onColorChanged=z.setStrokeColor,z.strokeWidthPanel=new T("Line width",Q.defaultStrokeWidths,Q.defaultStrokeWidth),z.strokeWidthPanel.onWidthChanged=z.setStrokeWidth,z.strokeStylePanel=new k("Line style",Q.defaultStrokeDasharrays,Q.defaultStrokeDasharray),z.strokeStylePanel.onStyleChanged=z.setStrokeDasharray,z}return Y(b,X),Object.defineProperty(b.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),b.prototype.getState=function(){var I=X.prototype.getState.call(this);return I.typeName=b.typeName,I},b.typeName="FrameMarker",b.title="Frame marker",b.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',b}(E),S=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},R=function(X){function b(I,B,Q){var z=X.call(this,I,B,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 Y(b,X),b.prototype.ownsTarget=function(I){return!!X.prototype.ownsTarget.call(this,I)||!(!this.grip1.ownsTarget(I)&&!this.grip2.ownsTarget(I))},b.prototype.pointerDown=function(I,B){X.prototype.pointerDown.call(this,I,B),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(B)?this.activeGrip=this.grip1:this.grip2.ownsTarget(B)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},b.prototype.pointerUp=function(I){var B=this.state;X.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",B==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},b.prototype.adjustVisual=function(){},b.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)},b.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()},b.prototype.select=function(){X.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},b.prototype.deselect=function(){X.prototype.deselect.call(this),this.controlBox.style.display="none"},b.prototype.setupControlBox=function(){this.controlBox=M.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},b.prototype.adjustControlBox=function(){this.positionGrips()},b.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},b.prototype.createGrip=function(){var I=new s;return I.visual.transform.baseVal.appendItem(M.createTransform()),this.controlBox.appendChild(I.visual),I},b.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)},b.prototype.positionGrip=function(I,B,Q){var z=I.transform.baseVal.getItem(0);z.setTranslate(B,Q),I.transform.baseVal.replaceItem(z,0)},b.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},X.prototype.getState.call(this))},b.prototype.restoreState=function(I){X.prototype.restoreState.call(this,I);var B=I;this.x1=B.x1,this.y1=B.y1,this.x2=B.x2,this.y2=B.y2},b.prototype.scale=function(I,B){X.prototype.scale.call(this,I,B),this.x1=this.x1*I,this.y1=this.y1*B,this.x2=this.x2*I,this.y2=this.y2*B,this.adjustVisual(),this.adjustControlBox()},b}(o),C=function(X){function b(I,B,Q){var z=X.call(this,I,B,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 d("Line color",Q.defaultColorSet,Q.defaultColor),z.strokePanel.onColorChanged=z.setStrokeColor,z.strokeWidthPanel=new T("Line width",Q.defaultStrokeWidths,Q.defaultStrokeWidth),z.strokeWidthPanel.onWidthChanged=z.setStrokeWidth,z.strokeStylePanel=new k("Line style",Q.defaultStrokeDasharrays,Q.defaultStrokeDasharray),z.strokeStylePanel.onStyleChanged=z.setStrokeDasharray,z}return Y(b,X),b.prototype.ownsTarget=function(I){return!(!X.prototype.ownsTarget.call(this,I)&&I!==this.visual&&I!==this.selectorLine&&I!==this.visibleLine)},b.prototype.createVisual=function(){this.visual=M.createGroup(),this.selectorLine=M.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=M.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)},b.prototype.pointerDown=function(I,B){X.prototype.pointerDown.call(this,I,B),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},b.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()),M.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),M.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),M.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},b.prototype.setStrokeColor=function(I){this.strokeColor=I,this.adjustVisual(),this.colorChanged(I)},b.prototype.setStrokeWidth=function(I){this.strokeWidth=I,this.adjustVisual()},b.prototype.setStrokeDasharray=function(I){this.strokeDasharray=I,this.adjustVisual(),this.stateChanged()},Object.defineProperty(b.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),b.prototype.getState=function(){var I=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},X.prototype.getState.call(this));return I.typeName=b.typeName,I},b.prototype.restoreState=function(I){X.prototype.restoreState.call(this,I);var B=I;this.strokeColor=B.strokeColor,this.strokeWidth=B.strokeWidth,this.strokeDasharray=B.strokeDasharray,this.createVisual(),this.adjustVisual()},b.typeName="LineMarker",b.title="Line marker",b.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',b}(R),f=function(X){function b(I,B,Q,z){var he=X.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 he.fonts=[],he.fontBoxes=[],he.fonts=B,he.currentFont=Q,he.setCurrentFont=he.setCurrentFont.bind(he),he}return Y(b,X),b.prototype.getUi=function(){var I=this,B=document.createElement("div");return B.style.overflow="hidden",B.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)}),B.appendChild(z);var he=document.createElement("div");he.style.display="flex",he.style.minHeight="20px",he.style.flexGrow="2",he.style.fontFamily=Q,he.style.overflow="hidden";var xe=document.createElement("div");xe.style.whiteSpace="nowrap",xe.style.overflow="hidden",xe.style.textOverflow="ellipsis",xe.innerHTML="The quick brown fox jumps over the lazy dog",he.appendChild(xe),z.appendChild(he),I.fontBoxes.push(z)}),B},b.prototype.setCurrentFont=function(I,B){var Q=this;this.currentFont=I,this.fontBoxes.forEach(function(z){z.style.borderColor=z===B?Q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},b}(l),w=function(X){function b(I,B,Q){var z=X.call(this,I,B,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 d("Color",Q.defaultColorSet,Q.defaultColor),z.colorPanel.onColorChanged=z.setColor,z.fontFamilyPanel=new f("Font",Q.defaultFontFamilies,Q.defaultFontFamily),z.fontFamilyPanel.onFontChanged=z.setFont,z}return Y(b,X),b.prototype.ownsTarget=function(I){if(X.prototype.ownsTarget.call(this,I)||I===this.visual||I===this.textElement||I===this.bgRectangle)return!0;var B=!1;return this.textElement.childNodes.forEach(function(Q){Q===I&&(B=!0)}),B},b.prototype.createVisual=function(){this.visual=M.createGroup(),this.bgRectangle=M.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=M.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(M.createTransform()),this.textElement.transform.baseVal.appendItem(M.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},b.prototype.pointerDown=function(I,B){X.prototype.pointerDown.call(this,I,B),this.isMoved=!1,this.pointerDownPoint=I,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(I),this._state="creating")},b.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(B){I.textElement.appendChild(M.createTSpan(B.trim()===""?" ":B.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},b.prototype.getTextScale=function(){var I=this.textElement.getBBox(),B=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;B=Math.min(Q,z)}return B},b.prototype.getTextPosition=function(I){var B=this.textElement.getBBox(),Q=0,z=0;return B.width>0&&B.height>0&&(Q=(this.width-B.width*I)/2,z=this.height/2-B.height*I/2),{x:Q,y:z}},b.prototype.sizeText=function(){var I=this.textElement.getBBox(),B=this.getTextScale(),Q=this.getTextPosition(B);Q.y-=I.y*B,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+Q.x+"px, "+Q.y+"px) scale("+B+", "+B+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(Q.x,Q.y),this.textElement.transform.baseVal.getItem(1).setScale(B,B))},b.prototype.manipulate=function(I){X.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)},b.prototype.resize=function(I){X.prototype.resize.call(this,I),this.isMoved=!0,this.setSize(),this.sizeText()},b.prototype.setSize=function(){X.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(M.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),M.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},b.prototype.pointerUp=function(I){var B=this.state;B==="creating"&&(this._suppressMarkerCreateEvent=!0),X.prototype.pointerUp.call(this,I),this.setSize(),(B==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},b.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(B){B.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var B=Number.parseFloat(I.textEditor.style.fontSize);I.textEditor.clientWidth>=Number.parseInt(I.textEditor.style.maxWidth)&&B>.9;)B-=.1,I.textEditor.style.fontSize=Math.max(B,.9)+"em"}),this.textEditor.addEventListener("keyup",function(B){B.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(B){if(B.clipboardData){var Q=B.clipboardData.getData("text"),z=window.getSelection();if(!z.rangeCount)return!1;z.deleteFromDocument(),z.getRangeAt(0).insertNode(document.createTextNode(Q)),B.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")},b.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var I=this.getTextScale(),B=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};B.x-=z.x/2,B.y-=z.y/2,this.textEditor.style.top=B.y+"px",this.textEditor.style.left=B.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-B.x+"px",this.textEditor.style.fontSize=Math.max(16*I,12)+"px",this.textElement.style.display="none"}},b.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()},b.prototype.select=function(){X.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},b.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),X.prototype.deselect.call(this)},b.prototype.dblClick=function(I,B){X.prototype.dblClick.call(this,I,B),this.showTextEditor()},b.prototype.setColor=function(I){this.textElement&&M.setAttributes(this.textElement,[["fill",I]]),this.color=I,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(I)},b.prototype.setFont=function(I){this.textElement&&M.setAttributes(this.textElement,[["font-family",I]]),this.fontFamily=I,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},b.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},b.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(b.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),b.prototype.getState=function(){var I=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},X.prototype.getState.call(this));return I.typeName=b.typeName,I},b.prototype.restoreState=function(I){var B=I;this.color=B.color,this.fontFamily=B.fontFamily,this.padding=B.padding,this.text=B.text,this.createVisual(),X.prototype.restoreState.call(this,I),this.setSize()},b.prototype.scale=function(I,B){X.prototype.scale.call(this,I,B),this.setSize(),this.sizeText(),this.positionTextEditor()},b.typeName="TextMarker",b.title="Text marker",b.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>',b}(A),y=function(X){function b(I,B,Q){var z=X.call(this,I,B,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 d("Color",Q.defaultColorSet,Q.defaultColor),z.colorPanel.onColorChanged=z.setColor,z.lineWidthPanel=new T("Line width",Q.defaultStrokeWidths,Q.defaultStrokeWidth),z.lineWidthPanel.onWidthChanged=z.setLineWidth,z}return Y(b,X),b.prototype.ownsTarget=function(I){return!(!X.prototype.ownsTarget.call(this,I)&&I!==this.visual&&I!==this.drawingImage)},b.prototype.createVisual=function(){this.visual=M.createGroup(),this.drawingImage=M.createImage(),this.visual.appendChild(this.drawingImage);var I=M.createTransform();this.visual.transform.baseVal.appendItem(I),this.addMarkerVisualToContainer(this.visual)},b.prototype.pointerDown=function(I,B){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):X.prototype.pointerDown.call(this,I,B)},b.prototype.manipulate=function(I){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(I.x,I.y),this.canvasContext.stroke()):X.prototype.manipulate.call(this,I)},b.prototype.resize=function(I){X.prototype.resize.call(this,I),M.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),M.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},b.prototype.pointerUp=function(I){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):X.prototype.pointerUp.call(this,I)},b.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)},b.prototype.select=function(){this.state==="creating"&&this.finishCreation(),X.prototype.select.call(this)},b.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),X.prototype.deselect.call(this)},b.prototype.finishCreation=function(){for(var I=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),B=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],Q=B[0],z=B[1],he=B[2],xe=B[3],Ie=!1,ue=0;ue<this.canvasElement.height;ue++)for(var me=0;me<this.canvasElement.width;me++)I.data[ue*this.canvasElement.width*4+4*me+3]>0&&(Ie=!0,ue<z&&(z=ue),me<Q&&(Q=me),ue>xe&&(xe=ue),me>he&&(he=me));if(Ie){this.left=Q/this.pixelRatio,this.top=z/this.pixelRatio,this.width=(he-Q)/this.pixelRatio,this.height=(xe-z)/this.pixelRatio;var we=document.createElement("canvas");we.width=he-Q,we.height=xe-z,we.getContext("2d").putImageData(this.canvasContext.getImageData(Q,z,he-Q,xe-z),0,0),this.drawingImgUrl=we.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},b.prototype.setDrawingImage=function(){M.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),M.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},b.prototype.setColor=function(I){this.color=I,this.colorChanged(I)},b.prototype.setLineWidth=function(I){this.lineWidth=I},Object.defineProperty(b.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),b.prototype.getState=function(){var I=Object.assign({drawingImgUrl:this.drawingImgUrl},X.prototype.getState.call(this));return I.typeName=b.typeName,I},b.prototype.restoreState=function(I){this.createVisual(),X.prototype.restoreState.call(this,I),this.drawingImgUrl=I.drawingImgUrl,this.setDrawingImage()},b.prototype.scale=function(I,B){X.prototype.scale.call(this,I,B),this.setDrawingImage()},b.typeName="FreehandMarker",b.title="Freehand marker",b.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>',b}(A),_=function(X){function b(I,B,Q){var z=X.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=B,z.setCurrentType=z.setCurrentType.bind(z),z}return Y(b,X),b.prototype.getUi=function(){var I=this,B=document.createElement("div");B.style.display="flex",B.style.overflow="hidden",B.style.flexGrow="2";for(var Q=function(xe){var Ie="both";switch(xe){case 0:Ie="both";break;case 1:Ie="start";break;case 2:Ie="end";break;case 3:Ie="none"}var ue=document.createElement("div");if(ue.style.display="flex",ue.style.flexGrow="2",ue.style.alignItems="center",ue.style.justifyContent="space-between",ue.style.padding="5px",ue.style.borderWidth="2px",ue.style.borderStyle="solid",ue.style.borderColor=Ie===z.currentType?z.uiStyleSettings.toolboxAccentColor:"transparent",ue.addEventListener("click",function(){I.setCurrentType(Ie,ue)}),B.appendChild(ue),Ie==="both"||Ie==="start"){var me=document.createElement("div");me.style.display="flex",me.style.alignItems="center",me.style.minHeight="20px",me.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>`,me.style.marginLeft="5px",ue.appendChild(me)}var we=document.createElement("div");we.style.display="flex",we.style.alignItems="center",we.style.minHeight="20px",we.style.flexGrow="2";var Ae=document.createElement("hr");if(Ae.style.minWidth="20px",Ae.style.border="0px",Ae.style.borderTop="3px solid "+(z.uiStyleSettings!==void 0?z.uiStyleSettings.toolboxColor:"#eeeeee"),Ae.style.flexGrow="2",we.appendChild(Ae),ue.appendChild(we),Ie==="both"||Ie==="end"){var Ne=document.createElement("div");Ne.style.display="flex",Ne.style.alignItems="center",Ne.style.minHeight="20px",Ne.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>`,Ne.style.marginRight="5px",ue.appendChild(Ne)}z.typeBoxes.push(ue)},z=this,he=0;he<4;he++)Q(he);return B},b.prototype.setCurrentType=function(I,B){var Q=this;this.currentType=I,this.typeBoxes.forEach(function(z){z.style.borderColor=z===B?Q.uiStyleSettings!==void 0?Q.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},b}(l),j=function(X){function b(I,B,Q){var z=X.call(this,I,B,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 _("Arrow type","end"),z.arrowTypePanel.onArrowTypeChanged=z.setArrowType,z}return Y(b,X),b.prototype.ownsTarget=function(I){return!(!X.prototype.ownsTarget.call(this,I)&&I!==this.arrow1&&I!==this.arrow2)},b.prototype.getArrowPoints=function(I,B){var Q=this.arrowBaseWidth+2*this.strokeWidth,z=this.arrowBaseHeight+2*this.strokeWidth;return I-Q/2+","+(B+z/2)+" "+I+","+(B-z/2)+" "+(I+Q/2)+","+(B+z/2)},b.prototype.createTips=function(){this.arrow1=M.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(M.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=M.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(M.createTransform()),this.visual.appendChild(this.arrow2)},b.prototype.pointerDown=function(I,B){X.prototype.pointerDown.call(this,I,B),this.state==="creating"&&this.createTips()},b.prototype.adjustVisual=function(){if(X.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",M.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),M.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),B=this.arrow1.transform.baseVal.getItem(0);B.setRotate(I,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(B,0);var Q=this.arrow2.transform.baseVal.getItem(0);Q.setRotate(I+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(Q,0)}},b.prototype.setArrowType=function(I){this.arrowType=I,this.adjustVisual(),this.stateChanged()},Object.defineProperty(b.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),b.prototype.getState=function(){var I=Object.assign({arrowType:this.arrowType},X.prototype.getState.call(this));return I.typeName=b.typeName,I},b.prototype.restoreState=function(I){X.prototype.restoreState.call(this,I);var B=I;this.arrowType=B.arrowType,this.createTips(),this.adjustVisual()},b.typeName="ArrowMarker",b.title="Arrow marker",b.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',b}(C),U=function(X){function b(I,B,Q){var z=X.call(this,I,B,Q)||this;return z.fillColor=Q.defaultFillColor,z.strokeWidth=0,z.fillPanel=new d("Color",Q.defaultColorSet,Q.defaultFillColor),z.fillPanel.onColorChanged=z.setFillColor,z}return Y(b,X),Object.defineProperty(b.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),b.prototype.getState=function(){var I=X.prototype.getState.call(this);return I.typeName=b.typeName,I},b.typeName="CoverMarker",b.title="Cover marker",b.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',b}(E),x=function(X){function b(I,B,Q,z){var he=X.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 he.opacities=[],he.opacityBoxes=[],he.opacities=B,he.currentOpacity=Q,he.setCurrentOpacity=he.setCurrentOpacity.bind(he),he}return Y(b,X),b.prototype.getUi=function(){var I=this,B=document.createElement("div");return B.style.display="flex",B.style.overflow="hidden",B.style.flexGrow="2",B.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)}),B.appendChild(z);var he=document.createElement("div");he.innerText=100*Q+"%",z.appendChild(he),I.opacityBoxes.push(z)}),B},b.prototype.setCurrentOpacity=function(I,B){var Q=this;this.currentOpacity=I,this.opacityBoxes.forEach(function(z){z.style.borderColor=z===B?Q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},b}(l),F=function(X){function b(I,B,Q){var z=X.call(this,I,B,Q)||this;return z.setOpacity=z.setOpacity.bind(z),z.fillColor=Q.defaultHighlightColor,z.strokeWidth=0,z.opacity=Q.defaultHighlightOpacity,z.fillPanel=new d("Color",Q.defaultColorSet,z.fillColor),z.fillPanel.onColorChanged=z.setFillColor,z.opacityPanel=new x("Opacity",Q.defaultOpacitySteps,z.opacity),z.opacityPanel.onOpacityChanged=z.setOpacity,z}return Y(b,X),b.prototype.setOpacity=function(I){this.opacity=I,this.visual&&M.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(b.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),b.prototype.getState=function(){var I=X.prototype.getState.call(this);return I.typeName=b.typeName,I},b.typeName="HighlightMarker",b.title="Highlight marker",b.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>',b}(U),D='<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>',g=function(X){function b(I,B,Q){var z=X.call(this,I,B,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 d("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 d("Fill color",Q.defaultColorSet,z.bgColor,D),z.bgColorPanel.onColorChanged=z.setBgColor,z.fontFamilyPanel=new f("Font",Q.defaultFontFamilies,Q.defaultFontFamily),z.fontFamilyPanel.onFontChanged=z.setFont,z.tipGrip=new s,z.tipGrip.visual.transform.baseVal.appendItem(M.createTransform()),z.controlBox.appendChild(z.tipGrip.visual),z}return Y(b,X),b.prototype.ownsTarget=function(I){return X.prototype.ownsTarget.call(this,I)||this.tipGrip.ownsTarget(I)||this.tip===I},b.prototype.createTip=function(){M.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=M.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},b.prototype.pointerDown=function(I,B){this.state==="new"&&X.prototype.pointerDown.call(this,I,B),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(B)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):X.prototype.pointerDown.call(this,I,B)},b.prototype.pointerUp=function(I){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,X.prototype.pointerUp.call(this,I);else{var B=this.state==="creating";X.prototype.pointerUp.call(this,I),this.setTipPoints(B),this.positionTip()}},b.prototype.manipulate=function(I){if(this.tipMoving){var B=this.unrotatePoint(I);this.tipPosition={x:B.x-this.manipulationStartLeft,y:B.y-this.manipulationStartTop},this.positionTip()}else X.prototype.manipulate.call(this,I)},b.prototype.setBgColor=function(I){this.bgRectangle&&this.tip&&(M.setAttributes(this.bgRectangle,[["fill",I]]),M.setAttributes(this.tip,[["fill",I]])),this.bgColor=I,this.fillColorChanged(I)},b.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},b.prototype.setTipPoints=function(I){I===void 0&&(I=!1);var B=Math.min(this.height/2,15),Q=this.height/5;I&&(this.tipPosition={x:B+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,B=Math.min(this.width/2,15),this.tipBase1Position={x:B,y:0},this.tipBase2Position={x:B+Q,y:0}):(this.tipBase1Position={x:0,y:B},this.tipBase2Position={x:0,y:B+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,B=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-B-Q,y:0},this.tipBase2Position={x:this.width-B,y:0}):(this.tipBase1Position={x:this.width,y:B},this.tipBase2Position={x:this.width,y:B+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,B=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-B-Q,y:this.height},this.tipBase2Position={x:this.width-B,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-B-Q},this.tipBase2Position={x:this.width,y:this.height-B}):z<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(Q=this.width/5,B=Math.min(this.width/2,15),this.tipBase1Position={x:B,y:this.height},this.tipBase2Position={x:B+Q,y:this.height}):(this.tipBase1Position={x:0,y:this.height-B},this.tipBase2Position={x:0,y:this.height-B-Q})},b.prototype.resize=function(I){X.prototype.resize.call(this,I),this.positionTip()},b.prototype.positionTip=function(){M.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(b.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),b.prototype.select=function(){this.positionTip(),X.prototype.select.call(this)},b.prototype.getState=function(){var I=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},X.prototype.getState.call(this));return I.typeName=b.typeName,I},b.prototype.restoreState=function(I){var B=I;this.bgColor=B.bgColor,this.tipPosition=B.tipPosition,X.prototype.restoreState.call(this,I),this.createTip(),this.setTipPoints()},b.prototype.scale=function(I,B){X.prototype.scale.call(this,I,B),this.tipPosition={x:this.tipPosition.x*I,y:this.tipPosition.y*B},this.positionTip()},b.typeName="CalloutMarker",b.title="Callout marker",b.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>',b}(w),W=function(X){function b(I,B,Q){var z=X.call(this,I,B,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 d("Line color",H(Q.defaultColorSet,["transparent"]),Q.defaultColor),z.strokePanel.onColorChanged=z.setStrokeColor,z.fillPanel=new d("Fill color",H(Q.defaultColorSet,["transparent"]),z.fillColor,D),z.fillPanel.onColorChanged=z.setFillColor,z.strokeWidthPanel=new T("Line width",Q.defaultStrokeWidths,Q.defaultStrokeWidth),z.strokeWidthPanel.onWidthChanged=z.setStrokeWidth,z.strokeStylePanel=new k("Line style",Q.defaultStrokeDasharrays,Q.defaultStrokeDasharray),z.strokeStylePanel.onStyleChanged=z.setStrokeDasharray,z.opacityPanel=new x("Opacity",Q.defaultOpacitySteps,z.opacity),z.opacityPanel.onOpacityChanged=z.setOpacity,z}return Y(b,X),b.prototype.ownsTarget=function(I){return!(!X.prototype.ownsTarget.call(this,I)&&I!==this.visual)},b.prototype.createVisual=function(){this.visual=M.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)},b.prototype.pointerDown=function(I,B){X.prototype.pointerDown.call(this,I,B),this.state==="new"&&(this.createVisual(),this.moveVisual(I),this._state="creating")},b.prototype.manipulate=function(I){X.prototype.manipulate.call(this,I)},b.prototype.resize=function(I){X.prototype.resize.call(this,I),this.setSize()},b.prototype.setSize=function(){X.prototype.setSize.call(this),M.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},b.prototype.pointerUp=function(I){X.prototype.pointerUp.call(this,I),this.setSize()},b.prototype.setStrokeColor=function(I){this.strokeColor=I,this.visual&&M.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(I),this.stateChanged()},b.prototype.setFillColor=function(I){this.fillColor=I,this.visual&&M.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(I),this.stateChanged()},b.prototype.setStrokeWidth=function(I){this.strokeWidth=I,this.visual&&M.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},b.prototype.setStrokeDasharray=function(I){this.strokeDasharray=I,this.visual&&M.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},b.prototype.setOpacity=function(I){this.opacity=I,this.visual&&M.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(b.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),b.prototype.getState=function(){var I=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},X.prototype.getState.call(this));return I.typeName=b.typeName,I},b.prototype.restoreState=function(I){var B=I;this.fillColor=B.fillColor,this.strokeColor=B.strokeColor,this.strokeWidth=B.strokeWidth,this.strokeDasharray=B.strokeDasharray,this.opacity=B.opacity,this.createVisual(),X.prototype.restoreState.call(this,I),this.setSize()},b.prototype.scale=function(I,B){X.prototype.scale.call(this,I,B),this.setSize()},b.typeName="EllipseMarker",b.title="Ellipse marker",b.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>',b}(A),J=function(X){function b(I,B,Q){return X.call(this,I,B,Q)||this}return Y(b,X),Object.defineProperty(b.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),b.prototype.ownsTarget=function(I){return!(!X.prototype.ownsTarget.call(this,I)&&I!==this.tip1&&I!==this.tip2)},b.prototype.createTips=function(){this.tip1=M.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(M.createTransform()),this.visual.appendChild(this.tip1),this.tip2=M.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(M.createTransform()),this.visual.appendChild(this.tip2)},b.prototype.pointerDown=function(I,B){X.prototype.pointerDown.call(this,I,B),this.state==="creating"&&this.createTips()},b.prototype.adjustVisual=function(){if(X.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(M.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()]]),M.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),B=this.tip1.transform.baseVal.getItem(0);B.setRotate(I,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(B,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(b.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),b.prototype.getState=function(){var I=X.prototype.getState.call(this);return I.typeName=b.typeName,I},b.prototype.restoreState=function(I){X.prototype.restoreState.call(this,I),this.createTips(),this.adjustVisual()},b.typeName="MeasurementMarker",b.title="Measurement marker",b.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>',b}(C),oe=function(X){function b(I,B,Q){var z=X.call(this,I,B,Q)||this;return z.strokePanel.colors=Q.defaultColorSet,z.fillColor="transparent",z}return Y(b,X),Object.defineProperty(b.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),b.prototype.getState=function(){var I=X.prototype.getState.call(this);return I.typeName=b.typeName,I},b.typeName="EllipseFrameMarker",b.title="Ellipse frame marker",b.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>',b}(W),fe=function(){function X(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(X.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),X.prototype.addUndoStep=function(b){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(b)||(this.undoStack.push(b),JSON.stringify(this.lastRedoStep)!==JSON.stringify(b)&&this.redoStack.splice(0,this.redoStack.length))},X.prototype.replaceLastUndoStep=function(b){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=b)},X.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},X.prototype.undo=function(){if(this.undoStack.length>1){var b=this.undoStack.pop();return b!==void 0&&this.redoStack.push(b),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},X.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},X}(),Re=function(X){function b(I,B,Q){var z=X.call(this,I,B,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 d("Line color",Q.defaultColorSet,Q.defaultColor),z.strokePanel.onColorChanged=z.setStrokeColor,z.strokeWidthPanel=new T("Line width",Q.defaultStrokeWidths,Q.defaultStrokeWidth),z.strokeWidthPanel.onWidthChanged=z.setStrokeWidth,z.strokeStylePanel=new k("Line style",Q.defaultStrokeDasharrays,Q.defaultStrokeDasharray),z.strokeStylePanel.onStyleChanged=z.setStrokeDasharray,z}return Y(b,X),b.prototype.ownsTarget=function(I){return!(!X.prototype.ownsTarget.call(this,I)&&I!==this.visual&&I!==this.selectorCurve&&I!==this.visibleCurve&&!this.curveGrip.ownsTarget(I))},b.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},b.prototype.createVisual=function(){this.visual=M.createGroup(),this.selectorCurve=M.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=M.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)},b.prototype.pointerDown=function(I,B){X.prototype.pointerDown.call(this,I,B),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(B)&&(this.activeGrip=this.curveGrip,this._state="resize")},b.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),M.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),M.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),M.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},b.prototype.setupControlBox=function(){X.prototype.setupControlBox.call(this),this.curveControlLine1=M.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=M.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)},b.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,X.prototype.addControlGrips.call(this)},b.prototype.positionGrips=function(){X.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()))},b.prototype.manipulate=function(I){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+I.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+I.y-this.manipulationStartY),X.prototype.manipulate.call(this,I)},b.prototype.resize=function(I){this.activeGrip===this.curveGrip&&(this.curveX=I.x,this.curveY=I.y),X.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)},b.prototype.setStrokeColor=function(I){this.strokeColor=I,this.adjustVisual(),this.colorChanged(I)},b.prototype.setStrokeWidth=function(I){this.strokeWidth=I,this.adjustVisual()},b.prototype.setStrokeDasharray=function(I){this.strokeDasharray=I,this.adjustVisual()},b.prototype.scale=function(I,B){this.curveX=this.curveX*I,this.curveY=this.curveY*B,X.prototype.scale.call(this,I,B)},Object.defineProperty(b.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),b.prototype.getState=function(){var I=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},X.prototype.getState.call(this));return I.typeName=b.typeName,I},b.prototype.restoreState=function(I){X.prototype.restoreState.call(this,I);var B=I;this.strokeColor=B.strokeColor,this.strokeWidth=B.strokeWidth,this.strokeDasharray=B.strokeDasharray,this.curveX=B.curveX,this.curveY=B.curveY,this.createVisual(),this.adjustVisual()},b.typeName="CurveMarker",b.title="Curve marker",b.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>',b}(R),be=function(){function X(b,I){I===void 0&&(I=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=b,this.cancelable=I}return Object.defineProperty(X.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),X.prototype.preventDefault=function(){this._defaultPrevented=!0},X}(),Le=function(X){function b(I,B,Q){var z=X.call(this,I,!1)||this;return z.dataUrl=B,z.state=Q,z}return Y(b,X),b}(be),Ce=function(X){function b(I,B,Q){Q===void 0&&(Q=!1);var z=X.call(this,I,Q)||this;return z.marker=B,z}return Y(b,X),b}(be),Te=function(){function X(){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 X.prototype.addEventListener=function(b,I){this[b].push(I)},X.prototype.removeEventListener=function(b,I){var B=this[b].indexOf(I);B>-1&&this[b].splice(B,1)},X}(),ve=function(){function X(b){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new S,this._isOpen=!1,this.undoRedoManager=new fe,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 Te,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=X.instanceCounter++,this.styles=new O(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=b,this.targetRoot=document.body,this.width=b.clientWidth,this.height=b.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(X.prototype,"ALL_MARKER_TYPES",{get:function(){return[L,y,j,w,oe,W,F,g,J,U,C,Re]},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[L,y,j,w,W,F,g]},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"BASIC_MARKER_TYPES",{get:function(){return[L,y,j,w,F]},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(b){var I=this;this._availableMarkerTypes.splice(0),b.forEach(function(B){if(typeof B=="string"){var Q=I.ALL_MARKER_TYPES.find(function(z){return z.typeName===B});Q!==void 0&&I._availableMarkerTypes.push(Q)}else I._availableMarkerTypes.push(B)})},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(b){this._zoomLevel=b,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(X.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),X.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),K.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},X.prototype.show=function(){var b=this;this.styles.styleSheetRoot===void 0&&n.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=n.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(I){return I(new be(b))})},X.prototype.render=function(){return N(this,void 0,void 0,function(){var b;return $(this,function(I){switch(I.label){case 0:return this.setCurrentMarker(),(b=new G).naturalSize=this.renderAtNaturalSize,b.imageType=this.renderImageType,b.imageQuality=this.renderImageQuality,b.markersOnly=this.renderMarkersOnly,b.width=this.renderWidth,b.height=this.renderHeight,[4,b.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return I.sent(),[4,b.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,I.sent()]}})})},X.prototype.close=function(b){var I=this;if(b===void 0&&(b=!1),this.isOpen){var B=!1;b||this.eventListeners.beforeclose.forEach(function(Q){var z=new be(I,!0);Q(z),z.defaultPrevented&&(B=!0)}),B||(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 be(I))}),this.detachEvents(),this._isOpen=!1)}},X.prototype.addMarkersToToolbar=function(){for(var b,I=[],B=0;B<arguments.length;B++)I[B]=arguments[B];(b=this._availableMarkerTypes).push.apply(b,I)},X.prototype.addRenderEventListener=function(b){this.addEventListener("render",function(I){b(I.dataUrl,I.state)})},X.prototype.removeRenderEventListener=function(b){},X.prototype.addCloseEventListener=function(b){this.addEventListener("close",function(){b()})},X.prototype.removeCloseEventListener=function(b){},X.prototype.setupResizeObserver=function(){var b=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){b.resize(b.target.clientWidth,b.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return b.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},X.prototype.onPopupTargetResize=function(){var b=1*this.target.clientWidth/this.target.clientHeight,I=this.editorCanvas.clientWidth/b>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*b:this.editorCanvas.clientWidth,B=I<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/b;this.resize(I,B)},X.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},X.prototype.resize=function(b,I){this._isResizing=!0;var B=b/this.imageWidth,Q=I/this.imageHeight;this.imageWidth=Math.round(b),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(B,Q),this._isResizing=!1},X.prototype.scaleMarkers=function(b,I){var B,Q=this;this._currentMarker&&this._currentMarker instanceof w?this._currentMarker.scale(b,I):(B=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(z){z!==Q._currentMarker&&z.scale(b,I)}),B!==void 0&&this.setCurrentMarker(B)},X.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"},X.prototype.setTopLeft=function(){var b=this.editingTarget.getBoundingClientRect(),I=this.editorCanvas.getBoundingClientRect();this.left=b.left-I.left,this.top=b.top-I.top},X.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)},X.prototype.addDefs=function(){for(var b,I=[],B=0;B<arguments.length;B++)I[B]=arguments[B];this.defs=M.createDefs(),this.addDefsToImage(),(b=this.defs).append.apply(b,I)},X.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},X.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)},X.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},X.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},X.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)},X.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},X.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)},X.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 b=document.createElement("a");b.href="https://markerjs.com/",b.target="_blank",b.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>',b.title="Powered by marker.js",b.style.display="grid",b.style.alignItems="center",b.style.justifyItems="center",b.style.padding="3px",b.style.width="20px",b.style.height="20px",this.logoUI.appendChild(b),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},X.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")},X.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"},X.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},X.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 b=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=b+"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 m(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 u(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},X.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},X.prototype.removeMarker=function(b){this.markerImage.removeChild(b.container),this.markers.indexOf(b)>-1&&this.markers.splice(this.markers.indexOf(b),1),b.dispose()},X.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())},X.prototype.toolbarButtonClicked=function(b,I){if(b==="marker"&&I!==void 0)this.createNewMarker(I);else if(b==="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()}},X.prototype.deleteSelectedMarker=function(){var b=this;if(this._currentMarker!==void 0){var I=!1;if(this.eventListeners.markerbeforedelete.forEach(function(Q){var z=new Ce(b,b._currentMarker,!0);Q(z),z.defaultPrevented&&(I=!0)}),!I){var B=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 Ce(b,B))})}}},X.prototype.clear=function(){var b=this,I=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(he){var xe=new Ce(b,void 0,!0);he(xe),xe.defaultPrevented&&(I=!0)}),!I)){this.setCurrentMarker();for(var B=function(he){var xe=Q.markers[he];Q.setCurrentMarker(Q.markers[he]),Q._currentMarker.dispose(),Q.markerImage.removeChild(Q._currentMarker.container),Q.markers.splice(Q.markers.indexOf(Q._currentMarker),1),Q.eventListeners.markerdelete.forEach(function(Ie){return Ie(new Ce(b,xe))})},Q=this,z=this.markers.length-1;z>=0;z--)B(z);this.addUndoStep()}},Object.defineProperty(X.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),X.prototype.showNotesEditor=function(){var b;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=(b=this._currentMarker.notes)!==null&&b!==void 0?b:"",this.overlayContainer.appendChild(this.notesArea))},X.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)},X.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},X.prototype.addUndoStep=function(){var b=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var I=this.getState(),B=this.undoRedoManager.getLastUndoStep();if(!B||B.width===I.width&&B.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 be(b))})}else this.undoRedoManager.replaceLastUndoStep(I),this.eventListeners.statechange.forEach(function(z){return z(new be(b))})}},X.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},X.prototype.undoStep=function(){var b=this,I=this.undoRedoManager.undo();I!==void 0&&(this.restoreState(I),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(B){return B(new be(b))}))},X.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},X.prototype.redoStep=function(){var b=this,I=this.undoRedoManager.redo();I!==void 0&&(this.restoreState(I),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(B){return B(new be(b))}))},X.prototype.stepZoom=function(){var b=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=b<this.zoomSteps.length-1?this.zoomSteps[b+1]:this.zoomSteps[0]},X.prototype.panTo=function(b){this.contentDiv.scrollBy({left:this.prevPanPoint.x-b.x,top:this.prevPanPoint.y-b.y}),this.prevPanPoint=b},X.prototype.startRenderAndClose=function(){return N(this,void 0,void 0,function(){var b,I,B=this;return $(this,function(Q){switch(Q.label){case 0:return[4,this.render()];case 1:return b=Q.sent(),I=this.getState(),this.eventListeners.render.forEach(function(z){return z(new Le(B,b,I))}),this.close(!0),[2]}})})},X.prototype.getState=function(b){b===!0&&this.setCurrentMarker();var I={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(B){return I.markers.push(B.getState())}),I},X.prototype.restoreState=function(b){var I=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);b.markers.forEach(function(B){var Q=I._availableMarkerTypes.find(function(he){return he.typeName===B.typeName});if(Q!==void 0){var z=I.addNewMarker(Q);z.restoreState(B),I.markers.push(z)}}),b.width&&b.height&&(b.width!==this.imageWidth||b.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/b.width,this.imageHeight/b.height),this.eventListeners.restorestate.forEach(function(B){return B(new be(I))})},X.prototype.addNewMarker=function(b){var I=M.createGroup();return this.markerImage.appendChild(I),new b(I,this.overlayContainer,this.settings)},X.prototype.createNewMarker=function(b){var I,B=this;(I=typeof b=="string"?this._availableMarkerTypes.find(function(Q){return Q.typeName===b}):b)&&(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 Ce(B,B._currentMarker))}))},X.prototype.markerCreated=function(b){var I=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(b),this.setCurrentMarker(b),b instanceof y&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(y):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(B){return B(new Ce(I,I._currentMarker))})},X.prototype.colorChanged=function(b){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=b,this.settings.defaultStrokeColor=b)},X.prototype.fillColorChanged=function(b){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=b)},X.prototype.markerStateChanged=function(b){var I=this;this.eventListeners.markerchange.forEach(function(B){return B(new Ce(I,b))})},X.prototype.setCurrentMarker=function(b){var I=this;this._currentMarker!==b&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(B){return B(new Ce(I,I._currentMarker))})),this._currentMarker=b,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(B){return B(new Ce(I,I._currentMarker))}))},X.prototype.onPointerDown=function(b){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||b.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(B){return B.ownsTarget(b.target)});I!==void 0?(this.setCurrentMarker(I),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(b.clientX,b.clientY),b.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:b.clientX,y:b.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(b.clientX,b.clientY))},X.prototype.onDblClick=function(b){if(this._isFocused||this.focus(),this.mode==="select"){var I=this.markers.find(function(B){return B.ownsTarget(b.target)});I!==void 0&&I!==this._currentMarker&&this.setCurrentMarker(I),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(b.clientX,b.clientY),b.target):this.setCurrentMarker()}},X.prototype.onPointerMove=function(b){this.touchPoints!==1&&b.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||b.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(b.clientX,b.clientY)):this.zoomLevel>1&&this.panTo({x:b.clientX,y:b.clientY}))},X.prototype.onPointerUp=function(b){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(b.clientX,b.clientY)),this.isDragging=!1,this.addUndoStep()},X.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},X.prototype.onKeyUp=function(b){this._currentMarker===void 0||this.notesArea!==void 0||b.key!=="Delete"&&b.key!=="Backspace"||this.deleteSelectedMarker()},X.prototype.clientToLocalCoordinates=function(b,I){var B=this.markerImage.getBoundingClientRect();return{x:(b-B.left)/this.zoomLevel,y:(I-B.top)/this.zoomLevel}},X.prototype.onWindowResize=function(){this.positionUI()},X.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var b=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=b+"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()},X.prototype.addLicenseKey=function(b){K.addKey(b)},X.prototype.addEventListener=function(b,I){this.eventListeners.addEventListener(b,I)},X.prototype.removeEventListener=function(b,I){this.eventListeners.removeEventListener(b,I)},X.prototype.renderState=function(b){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(b),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(X.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),X.prototype.focus=function(){var b=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 be(b))}))},X.prototype.blur=function(){var b=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(I){return I(new be(b))}))},X.instanceCounter=0,X}()},"T+//":function(Ze,Se,q){"use strict";q.r(Se);var le=q("Q9mQ"),Y=q("diRs"),N=q("2qtc"),$=q("kLXV"),H=q("miYZ"),M=q("tsqr"),K=q("9og8"),G=q("tJVT"),n=q("B9cy"),O=q("Ol7k"),v=q("lUTK"),p=q("BvKs"),m=q("WmNS"),u=q.n(m),l=q("q1tI"),d=q.n(l),o=q("m3rI"),h=q("p0QG"),s=q.n(h),a=q("ErOA"),A=q("9kvl"),E=q("RCxd"),T=q("xGfz"),k=q("xKgJ"),L=q("5NDa"),S=q("5rEg");function R(Te){var ve=Te.user,X=Te.CategoryId,b=Te.IsShow,I=Te.setIsShow,B=Te.dispatch,Q=Te.init,z=Object(l.useState)(),he=Object(G.a)(z,2),xe=he[0],Ie=he[1];return d.a.createElement($.a,{title:X?"\u65B0\u5EFA\u4E09\u7EA7\u7C7B\u76EE":"\u65B0\u5EFA\u4E8C\u7EA7\u7C7B\u76EE",width:424,onCancel:function(){I(!1)},onOk:Object(K.a)(u.a.mark(function ue(){var me;return u.a.wrap(function(Ae){for(;;)switch(Ae.prev=Ae.next){case 0:if(xe){Ae.next=3;break}return M.b.error("\u680F\u76EE\u540D\u4E0D\u80FD\u4E3A\u7A7A"),Ae.abrupt("return");case 3:return Ae.next=5,Object(a.a)("/api/programas.json",{method:"post",body:{name:xe,parent_id:X}});case 5:me=Ae.sent,me.status===0&&(M.b.info("\u521B\u5EFA\u6210\u529F"),I(!1),Ie(""),Q());case 7:case"end":return Ae.stop()}},ue)})),visible:b},d.a.createElement(S.a,{value:xe,onChange:function(me){return Ie(me.target.value)},placeholder:"\u8BF7\u8F93\u5165\u4E0D\u8D85\u8FC710\u4E2A\u6C49\u5B57\u7684\u540D\u79F0",maxLength:10}))}var C=Object(A.a)(function(Te){var ve=Te.user;return{user:ve}})(R);function f(Te){var ve=Te.user,X=Te.CategoryId,b=Te.name,I=Te.IsShow,B=Te.setIsShow,Q=Te.dispatch,z=Te.init,he=Object(l.useState)(),xe=Object(G.a)(he,2),Ie=xe[0],ue=xe[1];return Object(l.useEffect)(function(){ue(b)},[b]),d.a.createElement($.a,{title:"\u76EE\u5F55\u91CD\u547D\u540D",width:424,onCancel:function(){B(!1)},onOk:Object(K.a)(u.a.mark(function me(){var we;return u.a.wrap(function(Ne){for(;;)switch(Ne.prev=Ne.next){case 0:if(Ie){Ne.next=3;break}return M.b.error("\u680F\u76EE\u540D\u4E0D\u80FD\u4E3A\u7A7A"),Ne.abrupt("return");case 3:return Ne.next=5,Object(a.a)("/api/programas/".concat(X,"/rename.json"),{method:"put",body:{name:Ie,id:X}});case 5:we=Ne.sent,we.status===0&&(M.b.info("\u4FEE\u6539\u6210\u529F"),B(!1),ue(""),z());case 7:case"end":return Ne.stop()}},me)})),visible:I},d.a.createElement(S.a,{value:Ie,onChange:function(we){return ue(we.target.value)},placeholder:"\u8BF7\u8F93\u5165\u4E0D\u8D85\u8FC710\u4E2A\u6C49\u5B57\u7684\u540D\u79F0",maxLength:10}))}var w=Object(A.a)(function(Te){var ve=Te.user;return{user:ve}})(f),y=q("+L6B"),_=q("2/Rp"),j=q("9Bee");function U(Te){var ve,X,b,I,B=Te.user,Q=Te.ItemData,z=Te.setIssee,he=Te.dispatch,xe=Te.init;return d.a.createElement("div",null,d.a.createElement("div",{style:{textAlign:"right"}},Object(k.w)()&&d.a.createElement(_.a,{onClick:function(){return z(!1)}},"\u7F16\u8F91")),d.a.createElement(j.a,{value:Q.content}),(Q==null||((ve=Q.attachment)===null||ve===void 0)?void 0:ve.id)&&d.a.createElement("div",null,d.a.createElement("a",{href:Q==null||((X=Q.attachment)===null||X===void 0)?void 0:X.url,target:"_self",download:Q==null||((b=Q.attachment)===null||b===void 0)?void 0:b.title},d.a.createElement("i",{style:{color:"#29BD8B"},className:"font-14 color-green iconfont icon-fujian mr8"}),d.a.createElement("span",{style:{color:"#000000"}},Q==null||((I=Q.attachment)===null||I===void 0)?void 0:I.title))))}var x=Object(A.a)(function(Te){var ve=Te.user;return{user:ve}})(U),F=q("DZo9"),D=q("8z0m"),g=q("Ot1p"),W=q("hJwl");function J(Te){var ve=Te.user,X=Te.ItemData,b=Te.setIssee,I=Te.CategoryId,B=Te.dispatch,Q=Te.init,z=Object(l.useState)([]),he=Object(G.a)(z,2),xe=he[0],Ie=he[1],ue=Object(l.useState)(X.content),me=Object(G.a)(ue,2),we=me[0],Ae=me[1];function Ne(){var je,We=[];return X==null||((je=X.attachments)===null||je===void 0)||je.map(function(Me){var tt={uid:Me==null?void 0:Me.id,name:Me.title,response:{id:Me.id}};We.push(tt)}),We}var Be={name:"file",multiple:!0,action:o.a.API_SERVER+"/api/attachments.json",defaultFileList:Ne(),onRemove:function(We){Object(W.t)({id:We.uid})},onChange:function(We){console.log("info",We);var Me=We.file.status;Me!=="uploading",Me==="removed"&&Ie(We.fileList),Me==="done"?(Ie(We.fileList),M.b.success("".concat(We.file.name," \u6587\u4EF6\u4E0A\u4F20\u6210\u529F"))):Me==="error"&&M.b.error("".concat(We.file.name," \u6587\u4EF6\u4E0A\u4F20\u5931\u8D25"))},beforeUpload:function(We){var Me=We.size/1024/1024<150;return Me||M.b.info("\u6587\u4EF6\u5927\u5C0F\u5FC5\u987B\u5C0F\u4E8E150MB"),Me}};function Ke(){return Ge.apply(this,arguments)}function Ge(){return Ge=Object(K.a)(u.a.mark(function je(){var We;return u.a.wrap(function(tt){for(;;)switch(tt.prev=tt.next){case 0:return tt.next=2,Object(a.a)("/api/programas/".concat(I,"/update_content.json"),{method:"put",body:{id:I,content:we,attachment_id:$e(xe)}});case 2:We=tt.sent,We&&(M.b.info("\u63D0\u4EA4\u6210\u529F"),b(!0));case 4:case"end":return tt.stop()}},je)})),Ge.apply(this,arguments)}function $e(je){var We;return je&&je.map(function(Me){We=Me.response.id}),We}return d.a.createElement("div",null,d.a.createElement(g.a,{defaultValue:we,onChange:function(We){return Ae(We)}}),d.a.createElement(D.a,Be,d.a.createElement(_.a,{className:"uploadBtn"},"\u4E0A\u4F20\u9644\u4EF6"),"(\u5355\u4E2A\u6587\u4EF6150M\u4EE5\u5185)"),d.a.createElement("p",{style:{marginTop:"10px"}},d.a.createElement(_.a,{style:{width:"90px"},onClick:function(){return Ke()}},"\u63D0\u4EA4"),d.a.createElement(_.a,{style:{marginLeft:"30px",width:"90px"},type:"primary",onClick:function(){return b(!0)}},"\u53D6\u6D88")))}var oe=Object(A.a)(function(Te){var ve=Te.user;return{user:ve}})(J),fe=p.a.SubMenu,Re=O.a.Content,be=O.a.Sider;function Le(Te){var ve,X=Te.user,b=Te.dispatch,I=Te.globalSetting,B=Object(l.useState)(),Q=Object(G.a)(B,2),z=Q[0],he=Q[1],xe=Object(l.useState)(!1),Ie=Object(G.a)(xe,2),ue=Ie[0],me=Ie[1],we=Object(l.useState)(),Ae=Object(G.a)(we,2),Ne=Ae[0],Be=Ae[1],Ke=Object(l.useState)(),Ge=Object(G.a)(Ke,2),$e=Ge[0],je=Ge[1],We=Object(l.useState)(!1),Me=Object(G.a)(We,2),tt=Me[0],rt=Me[1],ce=Object(l.useState)(""),ee=Object(G.a)(ce,2),ne=ee[0],se=ee[1],de=Object(l.useState)(""),re=Object(G.a)(de,2),ae=re[0],pe=re[1],ge=Object(l.useState)(!0),_e=Object(G.a)(ge,2),Oe=_e[0],Pe=_e[1];Object(l.useEffect)(function(){ze()},[]),console.log("globalSetting",I);function ze(){return et.apply(this,arguments)}function et(){return et=Object(K.a)(u.a.mark(function ot(){var Et;return u.a.wrap(function(Ye){for(;;)switch(Ye.prev=Ye.next){case 0:return Ye.next=2,Object(a.a)("/api/programas.json",{method:"get"});case 2:Et=Ye.sent,Et&&Be(Et==null?void 0:Et.programas);case 4:case"end":return Ye.stop()}},ot)})),et.apply(this,arguments)}var nt=function(){var ot=Object(K.a)(u.a.mark(function Et(xt,Ye,Qt){var nn;return u.a.wrap(function(Pt){for(;;)switch(Pt.prev=Pt.next){case 0:Pt.t0=xt,Pt.next=Pt.t0===1?3:Pt.t0===2?6:Pt.t0===3?10:Pt.t0===4?15:17;break;case 3:return je(Ye==null?void 0:Ye.id),me(!0),Pt.abrupt("break",17);case 6:return je(Ye==null?void 0:Ye.id),rt(!0),se(Ye==null?void 0:Ye.name),Pt.abrupt("break",17);case 10:return Pt.next=12,Object(a.a)("/api/programas/".concat(Ye==null?void 0:Ye.id,"/top.json"),{method:"post",body:{id:Ye==null?void 0:Ye.id}});case 12:return nn=Pt.sent,nn.status===0&&ze(),Pt.abrupt("break",17);case 15:return _t(d.a.createElement("p",null,"\u5220\u9664\u4E4B\u540E\u4E0D\u80FD\u6062\u590D,",d.a.createElement("br",null),"\u662F\u5426\u786E\u8BA4\u5220\u9664?"),Object(K.a)(u.a.mark(function dt(){var yt;return u.a.wrap(function(Nt){for(;;)switch(Nt.prev=Nt.next){case 0:return Nt.next=2,Object(a.a)("/api/programas/".concat(Ye==null?void 0:Ye.id,".json"),{method:"delete",body:{id:Ye==null?void 0:Ye.id}});case 2:yt=Nt.sent,yt.status===0&&(M.b.info("\u5220\u9664\u6210\u529F"),ze());case 4:case"end":return Nt.stop()}},dt)}))),Pt.abrupt("break",17);case 17:case"end":return Pt.stop()}},Et)}));return function(xt,Ye,Qt){return ot.apply(this,arguments)}}(),_t=function(Et,xt){$.a.confirm({centered:!0,title:"\u63D0\u793A",icon:d.a.createElement(E.a,null),content:Et,okText:"\u786E\u8BA4",onOk:function(){return xt()},cancelText:"\u53D6\u6D88"})},lt=function(Et,xt){return d.a.createElement("div",{className:s.a.leftMenuActions},xt===1&&d.a.createElement("p",{className:"current",onClick:function(){return nt(1,Et,xt)}},"\u65B0\u5EFA"),d.a.createElement("p",{className:"current",onClick:function(){return nt(2,Et,xt)}},"\u91CD\u547D\u540D"),d.a.createElement("p",{className:"current",onClick:function(){return nt(3,Et,xt)}},"\u7F6E\u9876"),d.a.createElement("p",{className:"current",onClick:function(){return nt(4,Et,xt)}},"\u5220\u9664"))};function at(){return Rt.apply(this,arguments)}function Rt(){return Rt=Object(K.a)(u.a.mark(function ot(){var Et;return u.a.wrap(function(Ye){for(;;)switch(Ye.prev=Ye.next){case 0:return Ye.next=2,Object(a.a)("/api/programas/".concat($e,"/content.json"),{method:"get",params:{id:$e}});case 2:Et=Ye.sent,Et&&pe(Et);case 4:case"end":return Ye.stop()}},ot)})),Rt.apply(this,arguments)}return d.a.createElement("div",{style:{marginBottom:"40px"}},d.a.createElement("img",{style:{width:"100%"},src:o.a.IMG_SERVER+"/".concat(I==null||((ve=I.setting)===null||ve===void 0)?void 0:ve.shixun_banner_url)}),d.a.createElement("div",{className:"edu-container minH500",style:{display:"flex",width:"1200px"}},d.a.createElement(be,{width:244,className:s.a.leftMenus,style:{background:"none",marginTop:"20px",height:"auto"}},d.a.createElement(p.a,{mode:"inline"},Ne==null?void 0:Ne.map(function(ot,Et){if((ot==null?void 0:ot.children.length)>0){var xt;return d.a.createElement(fe,{title:d.a.createElement("span",{className:"font16"},d.a.createElement("span",null,ot.name),!Object(k.w)()&&d.a.createElement("span",null),Object(k.w)()&&d.a.createElement(Y.a,{placement:"right",content:function(){return lt(ot,1)},trigger:"hover"},d.a.createElement("span",{className:["iconfont icon-sandian",s.a.actions].join(" ")})))},ot==null||((xt=ot.children)===null||xt===void 0)?void 0:xt.map(function(Ye,Qt){return d.a.createElement(p.a.Item,{className:s.a===null||s.a===void 0?void 0:s.a.SubMentItem,onClick:function(){je(Ye==null?void 0:Ye.id),$e=Ye==null?void 0:Ye.id,at()}},d.a.createElement("span",{style:{flex:"1"}},Ye==null?void 0:Ye.name),Object(k.w)()&&d.a.createElement(Y.a,{placement:"right",content:function(){return lt(Ye,2)},trigger:"hover"},d.a.createElement("span",{className:["iconfont icon-sandian",s.a.actions].join(" ")})))}))}else return d.a.createElement(p.a.Item,{className:s.a===null||s.a===void 0?void 0:s.a.SubMentItem,onClick:function(){je(ot==null?void 0:ot.id),$e=ot==null?void 0:ot.id,at()}},d.a.createElement("span",{style:{flex:"1"}},ot==null?void 0:ot.name),Object(k.w)()&&d.a.createElement(Y.a,{placement:"right",content:function(){return lt(ot,1)},trigger:"hover"},d.a.createElement("span",{className:["iconfont icon-sandian",s.a.actions].join(" ")})))}),d.a.createElement(p.a.Item,{onClick:function(){je(""),$e="",me(!0)},style:{color:"#0152d9",fontSize:"16px",height:"40px",display:"flex",alignItems:"center"},icon:d.a.createElement(T.a,{style:{color:"#0152d9",fontSize:"16px"}})},"\u65B0\u589E\u4E8C\u7EA7\u7C7B\u76EE"))),d.a.createElement("div",{style:{width:"937px",marginLeft:"17px",background:"#fff",padding:"20px"}},Oe&&d.a.createElement(x,{ItemData:ae,setIssee:Pe}),Oe===!1&&d.a.createElement(oe,{ItemData:ae,setIssee:Pe,CategoryId:$e}))),d.a.createElement(C,{CategoryId:$e,IsShow:ue,setIsShow:me,init:ze}),d.a.createElement(w,{CategoryId:$e,name:ne,IsShow:tt,setIsShow:rt,init:ze}))}var Ce=Se.default=Object(A.a)(function(Te){var ve=Te.user,X=Te.globalSetting;return{user:ve,globalSetting:X}})(Le)},T8No:function(Ze,Se,q){"use strict";q.d(Se,"a",function(){return K}),q.d(Se,"e",function(){return G}),q.d(Se,"c",function(){return C}),q.d(Se,"b",function(){return f}),q.d(Se,"d",function(){return w}),q.d(Se,"f",function(){return j});var le=q("MNsG"),Y=q("N0LK"),N=q("Cg/j");let $=le.k||"";const H=new Map;H.set("false",!1),H.set("true",!0),H.set("isMac",le.f),H.set("isLinux",le.d),H.set("isWindows",le.i),H.set("isWeb",le.h),H.set("isMacNative",le.f&&!le.h),H.set("isEdge",$.indexOf("Edg/")>=0),H.set("isFirefox",$.indexOf("Firefox")>=0),H.set("isChrome",$.indexOf("Chrome")>=0),H.set("isSafari",$.indexOf("Safari")>=0);const M=Object.prototype.hasOwnProperty;class K{static has(x){return p.create(x)}static equals(x,F){return m.create(x,F)}static regex(x,F){return T.create(x,F)}static not(x){return o.create(x)}static and(...x){return S.create(x,null)}static or(...x){return R.create(x,null,!0)}static deserialize(x,F=!1){return x?this._deserializeOrExpression(x,F):void 0}static _deserializeOrExpression(x,F){let D=x.split("||");return R.create(D.map(g=>this._deserializeAndExpression(g,F)),null,!0)}static _deserializeAndExpression(x,F){let D=x.split("&&");return S.create(D.map(g=>this._deserializeOne(g,F)),null)}static _deserializeOne(x,F){if(x=x.trim(),x.indexOf("!=")>=0){let D=x.split("!=");return d.create(D[0].trim(),this._deserializeValue(D[1],F))}if(x.indexOf("==")>=0){let D=x.split("==");return m.create(D[0].trim(),this._deserializeValue(D[1],F))}if(x.indexOf("=~")>=0){let D=x.split("=~");return T.create(D[0].trim(),this._deserializeRegexValue(D[1],F))}if(x.indexOf(" in ")>=0){let D=x.split(" in ");return u.create(D[0].trim(),D[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(x)){const D=x.split(">=");return a.create(D[0].trim(),D[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(x)){const D=x.split(">");return s.create(D[0].trim(),D[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(x)){const D=x.split("<=");return E.create(D[0].trim(),D[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(x)){const D=x.split("<");return A.create(D[0].trim(),D[1].trim())}return/^\!\s*/.test(x)?o.create(x.substr(1).trim()):p.create(x)}static _deserializeValue(x,F){if(x=x.trim(),x==="true")return!0;if(x==="false")return!1;let D=/^'([^']*)'$/.exec(x);return D?D[1].trim():x}static _deserializeRegexValue(x,F){if(Object(Y.C)(x)){if(F)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let D=x.indexOf("/"),g=x.lastIndexOf("/");if(D===g||D<0){if(F)throw new Error(`bad regexp-value '${x}', missing /-enclosure`);return console.warn(`bad regexp-value '${x}', missing /-enclosure`),null}let W=x.slice(D+1,g),J=x[g+1]==="i"?"i":"";try{return new RegExp(W,J)}catch(oe){if(F)throw new Error(`bad regexp-value '${x}', parse error: ${oe}`);return console.warn(`bad regexp-value '${x}', parse error: ${oe}`),null}}}function G(x,F){const D=x?x.substituteConstants():void 0,g=F?F.substituteConstants():void 0;return!D&&!g?!0:!D||!g?!1:D.equals(g)}function n(x,F){return x.cmp(F)}class O{constructor(){this.type=0}cmp(x){return this.type-x.type}equals(x){return x.type===this.type}substituteConstants(){return this}evaluate(x){return!1}serialize(){return"false"}keys(){return[]}negate(){return v.INSTANCE}}O.INSTANCE=new O;class v{constructor(){this.type=1}cmp(x){return this.type-x.type}equals(x){return x.type===this.type}substituteConstants(){return this}evaluate(x){return!0}serialize(){return"true"}keys(){return[]}negate(){return O.INSTANCE}}v.INSTANCE=new v;class p{constructor(x,F){this.key=x,this.negated=F,this.type=2}static create(x,F=null){const D=H.get(x);return typeof D=="boolean"?D?v.INSTANCE:O.INSTANCE:new p(x,F)}cmp(x){return x.type!==this.type?this.type-x.type:y(this.key,x.key)}equals(x){return x.type===this.type?this.key===x.key:!1}substituteConstants(){const x=H.get(this.key);return typeof x=="boolean"?x?v.INSTANCE:O.INSTANCE:this}evaluate(x){return!!x.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=o.create(this.key,this)),this.negated}}class m{constructor(x,F,D){this.key=x,this.value=F,this.negated=D,this.type=4}static create(x,F,D=null){if(typeof F=="boolean")return F?p.create(x,D):o.create(x,D);const g=H.get(x);if(typeof g=="boolean"){const W=g?"true":"false";return F===W?v.INSTANCE:O.INSTANCE}return new m(x,F,D)}cmp(x){return x.type!==this.type?this.type-x.type:_(this.key,this.value,x.key,x.value)}equals(x){return x.type===this.type?this.key===x.key&&this.value===x.value:!1}substituteConstants(){const x=H.get(this.key);if(typeof x=="boolean"){const F=x?"true":"false";return this.value===F?v.INSTANCE:O.INSTANCE}return this}evaluate(x){return x.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=d.create(this.key,this.value,this)),this.negated}}class u{constructor(x,F){this.key=x,this.valueKey=F,this.type=10,this.negated=null}static create(x,F){return new u(x,F)}cmp(x){return x.type!==this.type?this.type-x.type:_(this.key,this.valueKey,x.key,x.valueKey)}equals(x){return x.type===this.type?this.key===x.key&&this.valueKey===x.valueKey:!1}substituteConstants(){return this}evaluate(x){const F=x.getValue(this.valueKey),D=x.getValue(this.key);return Array.isArray(F)?F.indexOf(D)>=0:typeof D=="string"&&typeof F=="object"&&F!==null?M.call(F,D):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=l.create(this)),this.negated}}class l{constructor(x){this._actual=x,this.type=11}static create(x){return new l(x)}cmp(x){return x.type!==this.type?this.type-x.type:this._actual.cmp(x._actual)}equals(x){return x.type===this.type?this._actual.equals(x._actual):!1}substituteConstants(){return this}evaluate(x){return!this._actual.evaluate(x)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class d{constructor(x,F,D){this.key=x,this.value=F,this.negated=D,this.type=5}static create(x,F,D=null){if(typeof F=="boolean")return F?o.create(x,D):p.create(x,D);const g=H.get(x);if(typeof g=="boolean"){const W=g?"true":"false";return F===W?O.INSTANCE:v.INSTANCE}return new d(x,F,D)}cmp(x){return x.type!==this.type?this.type-x.type:_(this.key,this.value,x.key,x.value)}equals(x){return x.type===this.type?this.key===x.key&&this.value===x.value:!1}substituteConstants(){const x=H.get(this.key);if(typeof x=="boolean"){const F=x?"true":"false";return this.value===F?O.INSTANCE:v.INSTANCE}return this}evaluate(x){return x.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 o{constructor(x,F){this.key=x,this.negated=F,this.type=3}static create(x,F=null){const D=H.get(x);return typeof D=="boolean"?D?O.INSTANCE:v.INSTANCE:new o(x,F)}cmp(x){return x.type!==this.type?this.type-x.type:y(this.key,x.key)}equals(x){return x.type===this.type?this.key===x.key:!1}substituteConstants(){const x=H.get(this.key);return typeof x=="boolean"?x?O.INSTANCE:v.INSTANCE:this}evaluate(x){return!x.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(x,F){if(typeof x=="string"){const D=parseFloat(x);isNaN(D)||(x=D)}return typeof x=="string"||typeof x=="number"?F(x):O.INSTANCE}class s{constructor(x,F,D){this.key=x,this.value=F,this.negated=D,this.type=12}static create(x,F,D=null){return h(F,g=>new s(x,g,D))}cmp(x){return x.type!==this.type?this.type-x.type:_(this.key,this.value,x.key,x.value)}equals(x){return x.type===this.type?this.key===x.key&&this.value===x.value:!1}substituteConstants(){return this}evaluate(x){return typeof this.value=="string"?!1:parseFloat(x.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=E.create(this.key,this.value,this)),this.negated}}class a{constructor(x,F,D){this.key=x,this.value=F,this.negated=D,this.type=13}static create(x,F,D=null){return h(F,g=>new a(x,g,D))}cmp(x){return x.type!==this.type?this.type-x.type:_(this.key,this.value,x.key,x.value)}equals(x){return x.type===this.type?this.key===x.key&&this.value===x.value:!1}substituteConstants(){return this}evaluate(x){return typeof this.value=="string"?!1:parseFloat(x.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(x,F,D){this.key=x,this.value=F,this.negated=D,this.type=14}static create(x,F,D=null){return h(F,g=>new A(x,g,D))}cmp(x){return x.type!==this.type?this.type-x.type:_(this.key,this.value,x.key,x.value)}equals(x){return x.type===this.type?this.key===x.key&&this.value===x.value:!1}substituteConstants(){return this}evaluate(x){return typeof this.value=="string"?!1:parseFloat(x.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=a.create(this.key,this.value,this)),this.negated}}class E{constructor(x,F,D){this.key=x,this.value=F,this.negated=D,this.type=15}static create(x,F,D=null){return h(F,g=>new E(x,g,D))}cmp(x){return x.type!==this.type?this.type-x.type:_(this.key,this.value,x.key,x.value)}equals(x){return x.type===this.type?this.key===x.key&&this.value===x.value:!1}substituteConstants(){return this}evaluate(x){return typeof this.value=="string"?!1:parseFloat(x.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 T{constructor(x,F){this.key=x,this.regexp=F,this.type=7,this.negated=null}static create(x,F){return new T(x,F)}cmp(x){if(x.type!==this.type)return this.type-x.type;if(this.key<x.key)return-1;if(this.key>x.key)return 1;const F=this.regexp?this.regexp.source:"",D=x.regexp?x.regexp.source:"";return F<D?-1:F>D?1:0}equals(x){if(x.type===this.type){const F=this.regexp?this.regexp.source:"",D=x.regexp?x.regexp.source:"";return this.key===x.key&&F===D}return!1}substituteConstants(){return this}evaluate(x){let F=x.getValue(this.key);return this.regexp?this.regexp.test(F):!1}serialize(){const x=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${x}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=k.create(this)),this.negated}}class k{constructor(x){this._actual=x,this.type=8}static create(x){return new k(x)}cmp(x){return x.type!==this.type?this.type-x.type:this._actual.cmp(x._actual)}equals(x){return x.type===this.type?this._actual.equals(x._actual):!1}substituteConstants(){return this}evaluate(x){return!this._actual.evaluate(x)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function L(x){let F=null;for(let D=0,g=x.length;D<g;D++){const W=x[D].substituteConstants();if(x[D]!==W&&F===null){F=[];for(let J=0;J<D;J++)F[J]=x[J]}F!==null&&(F[D]=W)}return F===null?x:F}class S{constructor(x,F){this.expr=x,this.negated=F,this.type=6}static create(x,F){return S._normalizeArr(x,F)}cmp(x){if(x.type!==this.type)return this.type-x.type;if(this.expr.length<x.expr.length)return-1;if(this.expr.length>x.expr.length)return 1;for(let F=0,D=this.expr.length;F<D;F++){const g=n(this.expr[F],x.expr[F]);if(g!==0)return g}return 0}equals(x){if(x.type===this.type){if(this.expr.length!==x.expr.length)return!1;for(let F=0,D=this.expr.length;F<D;F++)if(!this.expr[F].equals(x.expr[F]))return!1;return!0}return!1}substituteConstants(){const x=L(this.expr);return x===this.expr?this:S.create(x,this.negated)}evaluate(x){for(let F=0,D=this.expr.length;F<D;F++)if(!this.expr[F].evaluate(x))return!1;return!0}static _normalizeArr(x,F){const D=[];let g=!1;for(const W of x){if(!W)continue;if(W.type===1){g=!0;continue}if(W.type===0)return O.INSTANCE;if(W.type===6){D.push(...W.expr);continue}D.push(W)}if(D.length===0&&g)return v.INSTANCE;if(D.length===0)return;if(D.length===1)return D[0];D.sort(n);for(let W=1;W<D.length;W++)D[W-1].equals(D[W])&&(D.splice(W,1),W--);if(D.length===1)return D[0];for(;D.length>1;){const W=D[D.length-1];if(W.type!==9)break;D.pop();const J=D.pop(),oe=D.length===0,fe=R.create(W.expr.map(Re=>S.create([Re,J],null)),null,oe);fe&&(D.push(fe),D.sort(n))}return D.length===1?D[0]:new S(D,F)}serialize(){return this.expr.map(x=>x.serialize()).join(" && ")}keys(){const x=[];for(let F of this.expr)x.push(...F.keys());return x}negate(){if(!this.negated){const x=[];for(let F of this.expr)x.push(F.negate());this.negated=R.create(x,this,!0)}return this.negated}}class R{constructor(x,F){this.expr=x,this.negated=F,this.type=9}static create(x,F,D){return R._normalizeArr(x,F,D)}cmp(x){if(x.type!==this.type)return this.type-x.type;if(this.expr.length<x.expr.length)return-1;if(this.expr.length>x.expr.length)return 1;for(let F=0,D=this.expr.length;F<D;F++){const g=n(this.expr[F],x.expr[F]);if(g!==0)return g}return 0}equals(x){if(x.type===this.type){if(this.expr.length!==x.expr.length)return!1;for(let F=0,D=this.expr.length;F<D;F++)if(!this.expr[F].equals(x.expr[F]))return!1;return!0}return!1}substituteConstants(){const x=L(this.expr);return x===this.expr?this:R.create(x,this.negated,!1)}evaluate(x){for(let F=0,D=this.expr.length;F<D;F++)if(this.expr[F].evaluate(x))return!0;return!1}static _normalizeArr(x,F,D){let g=[],W=!1;if(x){for(let J=0,oe=x.length;J<oe;J++){const fe=x[J];if(!fe)continue;if(fe.type===0){W=!0;continue}if(fe.type===1)return v.INSTANCE;if(fe.type===9){g=g.concat(fe.expr);continue}g.push(fe)}if(g.length===0&&W)return O.INSTANCE;g.sort(n)}if(g.length===0)return;if(g.length===1)return g[0];for(let J=1;J<g.length;J++)g[J-1].equals(g[J])&&(g.splice(J,1),J--);if(g.length===1)return g[0];if(D){for(let J=0;J<g.length;J++)for(let oe=J+1;oe<g.length;oe++)j(g[J],g[oe])&&(g.splice(oe,1),oe--);if(g.length===1)return g[0]}return new R(g,F)}serialize(){return this.expr.map(x=>x.serialize()).join(" || ")}keys(){const x=[];for(let F of this.expr)x.push(...F.keys());return x}negate(){if(!this.negated){let x=[];for(let F of this.expr)x.push(F.negate());for(;x.length>1;){const F=x.shift(),D=x.shift(),g=[];for(const J of U(F))for(const oe of U(D))g.push(S.create([J,oe],null));const W=x.length===0;x.unshift(R.create(g,null,W))}this.negated=x[0]}return this.negated}}class C extends p{constructor(x,F,D){super(x,null);this._defaultValue=F,typeof D=="object"?C._info.push(Object.assign(Object.assign({},D),{key:x})):D!==!0&&C._info.push({key:x,description:D,type:F!=null?typeof F:void 0})}static all(){return C._info.values()}bindTo(x){return x.createKey(this.key,this._defaultValue)}getValue(x){return x.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(x){return m.create(this.key,x)}}C._info=[];const f=Object(N.c)("contextKeyService"),w="setContext";function y(x,F){return x<F?-1:x>F?1:0}function _(x,F,D,g){return x<D?-1:x>D?1:F<g?-1:F>g?1:0}function j(x,F){if(F.type===6&&x.type!==9&&x.type!==6){for(const W of F.expr)if(x.equals(W))return!0}const D=x.negate(),g=U(D).concat(U(F));g.sort(n);for(let W=0;W<g.length;W++){const J=g[W],oe=J.negate();for(let fe=W+1;fe<g.length;fe++){const Re=g[fe];if(oe.equals(Re))return!0}}return!1}function U(x){return x.type===9?x.expr:[x]}},TXwP:function(Ze,Se,q){var le,Y;(function(){var N;(function(){"use strict";var H=[,,function(n){function O(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=[]}O.prototype.clone_empty=function(){var m=new O(this.__parent);return m.set_indent(this.__indent_count,this.__alignment_count),m},O.prototype.item=function(m){return m<0?this.__items[this.__items.length+m]:this.__items[m]},O.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},O.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))},O.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)},O.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},O.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},O.prototype.is_empty=function(){return this.__items.length===0},O.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},O.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},O.prototype.pop=function(){var m=null;return this.is_empty()||(m=this.__items.pop(),this.__character_count-=m.length),m},O.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},O.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},O.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},O.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 v(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}v.prototype.get_indent_size=function(m,u){var l=this.__base_string_length;return u=u||0,m<0&&(l=0),l+=m*this.__indent_size,l+=u,l},v.prototype.get_indent_string=function(m,u){var l=this.__base_string;return u=u||0,m<0&&(m=0,l=""),u+=m*this.__indent_size,this.__ensure_cache(u),l+=this.__cache[u],l},v.prototype.__ensure_cache=function(m){for(;m>=this.__cache.length;)this.__add_column()},v.prototype.__add_column=function(){var m=this.__cache.length,u=0,l="";this.__indent_size&&m>=this.__indent_size&&(u=Math.floor(m/this.__indent_size),m-=u*this.__indent_size,l=new Array(u+1).join(this.__indent_string)),m&&(l+=new Array(m+1).join(" ")),this.__cache.push(l)};function p(m,u){this.__indent_cache=new v(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 O(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 l=this.__lines.join(`
|
|
`);return m!==`
|
|
`&&(l=l.replace(/[\n]/g,m)),l},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 l=this.__lines.length-2;l>=0;){var d=this.__lines[l];if(d.is_empty())break;if(d.item(0).indexOf(m)!==0&&d.item(-1)!==u){this.__lines.splice(l+1,0,new O(this)),this.previous_line=this.__lines[this.__lines.length-2];break}l--}},n.exports.Output=p},,,,function(n){function O(m,u){this.raw_options=v(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"])}O.prototype._get_array=function(m,u){var l=this.raw_options[m],d=u||[];return typeof l=="object"?l!==null&&typeof l.concat=="function"&&(d=l.concat()):typeof l=="string"&&(d=l.split(/[^a-zA-Z0-9_\/\-]+/)),d},O.prototype._get_boolean=function(m,u){var l=this.raw_options[m],d=l===void 0?!!u:!!l;return d},O.prototype._get_characters=function(m,u){var l=this.raw_options[m],d=u||"";return typeof l=="string"&&(d=l.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),d},O.prototype._get_number=function(m,u){var l=this.raw_options[m];u=parseInt(u,10),isNaN(u)&&(u=0);var d=parseInt(l,10);return isNaN(d)&&(d=u),d},O.prototype._get_selection=function(m,u,l){var d=this._get_selection_list(m,u,l);if(d.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 d[0]},O.prototype._get_selection_list=function(m,u,l){if(!u||u.length===0)throw new Error("Selection list cannot be empty.");if(l=l||[u[0]],!this._is_valid_selection(l,u))throw new Error("Invalid Default Value!");var d=this._get_array(m,l);if(!this._is_valid_selection(d,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 d},O.prototype._is_valid_selection=function(m,u){return m.length&&u.length&&!m.some(function(l){return u.indexOf(l)===-1})};function v(m,u){var l={};m=p(m);var d;for(d in m)d!==u&&(l[d]=m[d]);if(u&&m[u])for(d in m[u])l[d]=m[u][d];return l}function p(m){var u={},l;for(l in m){var d=l.replace(/-/g,"_");u[d]=m[l]}return u}n.exports.Options=O,n.exports.normalizeOpts=p,n.exports.mergeOpts=v},,function(n){var O=RegExp.prototype.hasOwnProperty("sticky");function v(p){this.__input=p||"",this.__input_length=this.__input.length,this.__position=0}v.prototype.restart=function(){this.__position=0},v.prototype.back=function(){this.__position>0&&(this.__position-=1)},v.prototype.hasNext=function(){return this.__position<this.__input_length},v.prototype.next=function(){var p=null;return this.hasNext()&&(p=this.__input.charAt(this.__position),this.__position+=1),p},v.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},v.prototype.__match=function(p,m){p.lastIndex=m;var u=p.exec(this.__input);return u&&!(O&&p.sticky)&&(u.index!==m&&(u=null)),u},v.prototype.test=function(p,m){return m=m||0,m+=this.__position,m>=0&&m<this.__input_length?!!this.__match(p,m):!1},v.prototype.testChar=function(p,m){var u=this.peek(m);return p.lastIndex=0,u!==null&&p.test(u)},v.prototype.match=function(p){var m=this.__match(p,this.__position);return m?this.__position+=m[0].length:m=null,m},v.prototype.read=function(p,m,u){var l="",d;return p&&(d=this.match(p),d&&(l+=d[0])),m&&(d||!p)&&(l+=this.readUntil(m,u)),l},v.prototype.readUntil=function(p,m){var u="",l=this.__position;p.lastIndex=this.__position;var d=p.exec(this.__input);return d?(l=d.index,m&&(l+=d[0].length)):l=this.__input_length,u=this.__input.substring(this.__position,l),this.__position=l,u},v.prototype.readUntilAfter=function(p){return this.readUntil(p,!0)},v.prototype.get_regexp=function(p,m){var u=null,l="g";return m&&O&&(l="y"),typeof p=="string"&&p!==""?u=new RegExp(p,l):p&&(u=new RegExp(p.source,l)),u},v.prototype.get_literal_regexp=function(p){return RegExp(p.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},v.prototype.peekUntilAfter=function(p){var m=this.__position,u=this.readUntilAfter(p);return this.__position=m,u},v.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=v},,,,,function(n){function O(v,p){v=typeof v=="string"?v:v.source,p=typeof p=="string"?p:p.source,this.__directives_block_pattern=new RegExp(v+/ beautify( \w+[:]\w+)+ /.source+p,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(v+/\sbeautify\signore:end\s/.source+p,"g")}O.prototype.get_directives=function(v){if(!v.match(this.__directives_block_pattern))return null;var p={};this.__directive_pattern.lastIndex=0;for(var m=this.__directive_pattern.exec(v);m;)p[m[1]]=m[2],m=this.__directive_pattern.exec(v);return p},O.prototype.readIgnored=function(v){return v.readUntilAfter(this.__directives_end_ignore_pattern)},n.exports.Directives=O},,function(n,O,v){var p=v(16).Beautifier,m=v(17).Options;function u(l,d){var o=new p(l,d);return o.beautify()}n.exports=u,n.exports.defaultOptions=function(){return new m}},function(n,O,v){var p=v(17).Options,m=v(2).Output,u=v(8).InputScanner,l=v(13).Directives,d=new l(/\/\*/,/\*\//),o=/\r\n|[\r\n]/,h=/\r\n|[\r\n]/g,s=/\s/,a=/(?:\s|\n)+/g,A=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,E=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function T(k,L){this._source_text=k||"",this._options=new p(L),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"]}T.prototype.eatString=function(k){var L="";for(this._ch=this._input.next();this._ch;){if(L+=this._ch,this._ch==="\\")L+=this._input.next();else if(k.indexOf(this._ch)!==-1||this._ch===`
|
|
`)break;this._ch=this._input.next()}return L},T.prototype.eatWhitespace=function(k){for(var L=s.test(this._input.peek()),S=0;s.test(this._input.peek());)this._ch=this._input.next(),k&&this._ch===`
|
|
`&&((S===0||S<this._options.max_preserve_newlines)&&(S++,this._output.add_new_line(!0)));return L},T.prototype.foundNestedPseudoClass=function(){for(var k=0,L=1,S=this._input.peek(L);S;){if(S==="{")return!0;if(S==="(")k+=1;else if(S===")"){if(k===0)return!1;k-=1}else if(S===";"||S==="}")return!1;L++,S=this._input.peek(L)}return!1},T.prototype.print_string=function(k){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(k)},T.prototype.preserveSingleSpace=function(k){k&&(this._output.space_before_token=!0)},T.prototype.indent=function(){this._indentLevel++},T.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},T.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var k=this._source_text,L=this._options.eol;L==="auto"&&(L=`
|
|
`,k&&o.test(k||"")&&(L=k.match(o)[0])),k=k.replace(h,`
|
|
`);var S=k.match(/^[\t ]*/)[0];this._output=new m(this._options,S),this._input=new u(k),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var R=0,C=!1,f=!1,w=!1,y=!1,_=!1,j=!1,U=this._ch,x=!1,F,D,g;F=this._input.read(a),D=F!=="",g=U,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),U=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var W=this._input.read(A),J=d.get_directives(W);J&&J.ignore==="start"&&(W+=d.readIgnored(this._input)),this.print_string(W),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(D),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var oe=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);oe.match(/[ :]$/)&&(oe=this.eatString(": ").replace(/\s$/,""),this.print_string(oe),this._output.space_before_token=!0),oe=oe.replace(/\s$/,""),oe==="extend"?y=!0:oe==="import"&&(_=!0),oe in this.NESTED_AT_RULE?(this._nestedLevel+=1,oe in this.CONDITIONAL_GROUP_RULE&&(w=!0)):!C&&R===0&&oe.indexOf(":")!==-1&&(f=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(D),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")f&&(f=!1,this.outdent()),w?(w=!1,C=this._indentLevel>=this._nestedLevel):C=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&C&&(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)):(g==="("?this._output.space_before_token=!1:g!==","&&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(),g==="{"&&this._output.trim(!0),_=!1,y=!1,f&&(this.outdent(),f=!1),this.print_string(this._ch),C=!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 fe=0;fe<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;fe++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[fe])){x=!0;break}(C||w)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!y&&R===0?(this.print_string(":"),f||(f=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):(this._input.lookBack(" ")&&(this._output.space_before_token=!0),this._input.peek()===":"?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":"))}else if(this._ch==='"'||this._ch==="'"){var Re=g==='"'||g==="'";this.preserveSingleSpace(Re||D),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")x=!1,R===0?(f&&(this.outdent(),f=!1),y=!1,_=!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(),R++,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(")")),R&&(R--,this.outdent()));else{var be=!1;this._input.lookBack("with")&&(be=!0),this.preserveSingleSpace(D||be),this.print_string(this._ch),f&&g==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),j=!0):(this.eatWhitespace(),R++,this.indent())}else if(this._ch===")")R&&(R--,this.outdent()),j&&this._input.peek()===";"&&this._options.selector_separator_newline&&(j=!1,this.outdent(),this._output.add_new_line()),this.print_string(this._ch);else if(this._ch===",")this.print_string(this._ch),this.eatWhitespace(!0),this._options.selector_separator_newline&&(!f||j)&&R===0&&!_&&!y?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!f&&R===0)this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&s.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(D),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),s.test(this._ch)&&(this._ch="");else if(this._ch==="!"&&!this._input.lookBack("\\"))this._output.space_before_token=!0,this.print_string(this._ch);else{var Le=g==='"'||g==="'";this.preserveSingleSpace(Le||D),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
|
|
`&&x&&this._output.add_new_line()}var Ce=this._output.get_code(L);return Ce},n.exports.Beautifier=T},function(n,O,v){var p=v(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 l=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||l;var d=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var o=0;o<d.length;o++)d[o]!=="expand"?this.brace_style="collapse":this.brace_style=d[o]}m.prototype=new p,n.exports.Options=m}],M={};function K(n){var O=M[n];if(O!==void 0)return O.exports;var v=M[n]={exports:{}};return H[n](v,v.exports,K),v.exports}var G=K(15);N=G})();var $=N;!(le=[],Y=function(){return{css_beautify:$}}.apply(Se,le),Y!==void 0&&(Ze.exports=Y))})()},Vhoy:function(Ze,Se,q){"use strict";q.d(Se,"d",function(){return $}),q.d(Se,"e",function(){return H}),q.d(Se,"c",function(){return M}),q.d(Se,"b",function(){return K}),q.d(Se,"a",function(){return G});var le=q("MI8n");class Y{constructor(){this._icons=new Map,this._onDidRegister=new le.b}add(n){const O=this._icons.get(n.id);O?n.description?O.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 N=new Y,$=N;function H(n,O){return new K(n,O)}function M(n){return n?n.replace(/\$\((.*?)\)/g,(O,v)=>` ${v} `).trim():""}class K{constructor(n,O,v){this.id=n,this.definition=O,this.description=v,N.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var G;(function(n){n.iconNameSegment="[A-Za-z0-9]+",n.iconNameExpression="[A-Za-z0-9\\-]+",n.iconModifierExpression="~[A-Za-z]+";const O=new RegExp(`^(${n.iconNameExpression})(${n.iconModifierExpression})?$`);function v(u){if(u instanceof K)return["codicon","codicon-"+u.id];const l=O.exec(u.id);if(!l)return v(K.error);let[,d,o]=l;const h=["codicon","codicon-"+d];return o&&h.push("codicon-modifier-"+o.substr(1)),h}n.asClassNameArray=v;function p(u){return v(u).join(" ")}n.asClassName=p;function m(u){return"."+v(u).join(".")}n.asCSSSelector=m})(G||(G={})),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"})}(K||(K={}))},"VrN/":function(Ze,Se,q){(function(le,Y){Ze.exports=Y()})(this,function(){"use strict";var le=navigator.userAgent,Y=navigator.platform,N=/gecko\/\d/i.test(le),$=/MSIE \d/.test(le),H=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(le),M=/Edge\/(\d+)/.exec(le),K=$||H||M,G=K&&($?document.documentMode||6:+(M||H)[1]),n=!M&&/WebKit\//.test(le),O=n&&/Qt\/\d+\.\d+/.test(le),v=!M&&/Chrome\//.test(le),p=/Opera\//.test(le),m=/Apple Computer/.test(navigator.vendor),u=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(le),l=/PhantomJS/.test(le),d=!M&&/AppleWebKit/.test(le)&&/Mobile\/\w+/.test(le),o=/Android/.test(le),h=d||o||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(le),s=d||/Mac/.test(Y),a=/\bCrOS\b/.test(le),A=/win/i.test(Y),E=p&&le.match(/Version\/(\d*\.\d*)/);E&&(E=Number(E[1])),E&&E>=15&&(p=!1,n=!0);var T=s&&(O||p&&(E==null||E<12.11)),k=N||K&&G>=9;function L(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var S=function(e,t){var i=e.className,r=L(t).exec(i);if(r){var c=i.slice(r.index+r[0].length);e.className=i.slice(0,r.index)+(c?r[1]+c:"")}};function R(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function C(e,t){return R(e).appendChild(t)}function f(e,t,i,r){var c=document.createElement(e);if(i&&(c.className=i),r&&(c.style.cssText=r),typeof t=="string")c.appendChild(document.createTextNode(t));else if(t)for(var P=0;P<t.length;++P)c.appendChild(t[P]);return c}function w(e,t,i,r){var c=f(e,t,i,r);return c.setAttribute("role","presentation"),c}var y;document.createRange?y=function(e,t,i,r){var c=document.createRange();return c.setEnd(r||e,i),c.setStart(e,t),c}:y=function(e,t,i){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(c){return r}return r.collapse(!0),r.moveEnd("character",i),r.moveStart("character",t),r};function _(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 j(){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 U(e,t){var i=e.className;L(t).test(i)||(e.className+=(i?" ":"")+t)}function x(e,t){for(var i=e.split(" "),r=0;r<i.length;r++)i[r]&&!L(i[r]).test(t)&&(t+=" "+i[r]);return t}var F=function(e){e.select()};d?F=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:K&&(F=function(e){try{e.select()}catch(t){}});function D(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function g(e,t,i){t||(t={});for(var r in e)e.hasOwnProperty(r)&&(i!==!1||!t.hasOwnProperty(r))&&(t[r]=e[r]);return t}function W(e,t,i,r,c){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var P=r||0,V=c||0;;){var Z=e.indexOf(" ",P);if(Z<0||Z>=t)return V+(t-P);V+=Z-P,V+=i-V%i,P=Z+1}}var J=function(){this.id=null,this.f=null,this.time=0,this.handler=D(this.onTimeout,this)};J.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},J.prototype.set=function(e,t){this.f=t;var i=+new Date+e;(!this.id||i<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=i)};function oe(e,t){for(var i=0;i<e.length;++i)if(e[i]==t)return i;return-1}var fe=50,Re={toString:function(){return"CodeMirror.Pass"}},be={scroll:!1},Le={origin:"*mouse"},Ce={origin:"+move"};function Te(e,t,i){for(var r=0,c=0;;){var P=e.indexOf(" ",r);P==-1&&(P=e.length);var V=P-r;if(P==e.length||c+V>=t)return r+Math.min(V,t-c);if(c+=P-r,c+=i-c%i,r=P+1,c>=t)return r}}var ve=[""];function X(e){for(;ve.length<=e;)ve.push(b(ve)+" ");return ve[e]}function b(e){return e[e.length-1]}function I(e,t){for(var i=[],r=0;r<e.length;r++)i[r]=t(e[r],r);return i}function B(e,t,i){for(var r=0,c=i(t);r<e.length&&i(e[r])<=c;)r++;e.splice(r,0,t)}function Q(){}function z(e,t){var i;return Object.create?i=Object.create(e):(Q.prototype=e,i=new Q),t&&g(t,i),i}var he=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function xe(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||he.test(e))}function Ie(e,t){return t?t.source.indexOf("\\w")>-1&&xe(e)?!0:t.test(e):xe(e)}function ue(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var me=/[\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 we(e){return e.charCodeAt(0)>=768&&me.test(e)}function Ae(e,t,i){for(;(i<0?t>0:t<e.length)&&we(e.charAt(t));)t+=i;return t}function Ne(e,t,i){for(var r=t>i?-1:1;;){if(t==i)return t;var c=(t+i)/2,P=r<0?Math.ceil(c):Math.floor(c);if(P==t)return e(P)?t:i;e(P)?i=P:t=P+r}}function Be(e,t,i,r){if(!e)return r(t,i,"ltr",0);for(var c=!1,P=0;P<e.length;++P){var V=e[P];(V.from<i&&V.to>t||t==i&&V.to==t)&&(r(Math.max(V.from,t),Math.min(V.to,i),V.level==1?"rtl":"ltr",P),c=!0)}c||r(t,i,"ltr")}var Ke=null;function Ge(e,t,i){var r;Ke=null;for(var c=0;c<e.length;++c){var P=e[c];if(P.from<t&&P.to>t)return c;P.to==t&&(P.from!=P.to&&i=="before"?r=c:Ke=c),P.from==t&&(P.from!=P.to&&i!="before"?r=c:Ke=c)}return r!=null?r:Ke}var $e=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function i(ie){return ie<=247?e.charAt(ie):1424<=ie&&ie<=1524?"R":1536<=ie&&ie<=1785?t.charAt(ie-1536):1774<=ie&&ie<=2220?"r":8192<=ie&&ie<=8203?"w":ie==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,c=/[stwN]/,P=/[LRr]/,V=/[Lb1n]/,Z=/[1n]/;function te(ie,ye,Ee){this.level=ie,this.from=ye,this.to=Ee}return function(ie,ye){var Ee=ye=="ltr"?"L":"R";if(ie.length==0||ye=="ltr"&&!r.test(ie))return!1;for(var ke=ie.length,De=[],Fe=0;Fe<ke;++Fe)De.push(i(ie.charCodeAt(Fe)));for(var Ue=0,Xe=Ee;Ue<ke;++Ue){var Je=De[Ue];Je=="m"?De[Ue]=Xe:Xe=Je}for(var it=0,Qe=Ee;it<ke;++it){var st=De[it];st=="1"&&Qe=="r"?De[it]="n":P.test(st)&&(Qe=st,st=="r"&&(De[it]="R"))}for(var ft=1,ht=De[0];ft<ke-1;++ft){var wt=De[ft];wt=="+"&&ht=="1"&&De[ft+1]=="1"?De[ft]="1":wt==","&&ht==De[ft+1]&&(ht=="1"||ht=="n")&&(De[ft]=ht),ht=wt}for(var jt=0;jt<ke;++jt){var en=De[jt];if(en==",")De[jt]="N";else if(en=="%"){var Gt=void 0;for(Gt=jt+1;Gt<ke&&De[Gt]=="%";++Gt);for(var xn=jt&&De[jt-1]=="!"||Gt<ke&&De[Gt]=="1"?"1":"N",yn=jt;yn<Gt;++yn)De[yn]=xn;jt=Gt-1}}for(var Xt=0,bn=Ee;Xt<ke;++Xt){var an=De[Xt];bn=="L"&&an=="1"?De[Xt]="L":P.test(an)&&(bn=an)}for(var Jt=0;Jt<ke;++Jt)if(c.test(De[Jt])){var Yt=void 0;for(Yt=Jt+1;Yt<ke&&c.test(De[Yt]);++Yt);for(var zt=(Jt?De[Jt-1]:Ee)=="L",_n=(Yt<ke?De[Yt]:Ee)=="L",zr=zt==_n?zt?"L":"R":Ee,nr=Jt;nr<Yt;++nr)De[nr]=zr;Jt=Yt-1}for(var un=[],Bn,tn=0;tn<ke;)if(V.test(De[tn])){var Va=tn;for(++tn;tn<ke&&V.test(De[tn]);++tn);un.push(new te(0,Va,tn))}else{var Vn=tn,yr=un.length,br=ye=="rtl"?1:0;for(++tn;tn<ke&&De[tn]!="L";++tn);for(var fn=Vn;fn<tn;)if(Z.test(De[fn])){Vn<fn&&(un.splice(yr,0,new te(1,Vn,fn)),yr+=br);var Kr=fn;for(++fn;fn<tn&&Z.test(De[fn]);++fn);un.splice(yr,0,new te(2,Kr,fn)),yr+=br,Vn=fn}else++fn;Vn<tn&&un.splice(yr,0,new te(1,Vn,tn))}return ye=="ltr"&&(un[0].level==1&&(Bn=ie.match(/^\s+/))&&(un[0].from=Bn[0].length,un.unshift(new te(0,0,Bn[0].length))),b(un).level==1&&(Bn=ie.match(/\s+$/))&&(b(un).to-=Bn[0].length,un.push(new te(0,ke-Bn[0].length,ke)))),ye=="rtl"?un.reverse():un}}();function je(e,t){var i=e.order;return i==null&&(i=e.order=$e(e.text,t)),i}var We=[],Me=function(e,t,i){if(e.addEventListener)e.addEventListener(t,i,!1);else if(e.attachEvent)e.attachEvent("on"+t,i);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||We).concat(i)}};function tt(e,t){return e._handlers&&e._handlers[t]||We}function rt(e,t,i){if(e.removeEventListener)e.removeEventListener(t,i,!1);else if(e.detachEvent)e.detachEvent("on"+t,i);else{var r=e._handlers,c=r&&r[t];if(c){var P=oe(c,i);P>-1&&(r[t]=c.slice(0,P).concat(c.slice(P+1)))}}}function ce(e,t){var i=tt(e,t);if(!i.length)return;for(var r=Array.prototype.slice.call(arguments,2),c=0;c<i.length;++c)i[c].apply(null,r)}function ee(e,t,i){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),ce(e,i||t.type,e,t),pe(t)||t.codemirrorIgnore}function ne(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var i=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)oe(i,t[r])==-1&&i.push(t[r])}function se(e,t){return tt(e,t).length>0}function de(e){e.prototype.on=function(t,i){Me(this,t,i)},e.prototype.off=function(t,i){rt(this,t,i)}}function re(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ae(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function pe(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function ge(e){re(e),ae(e)}function _e(e){return e.target||e.srcElement}function Oe(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),s&&e.ctrlKey&&t==1&&(t=3),t}var Pe=function(){if(K&&G<9)return!1;var e=f("div");return"draggable"in e||"dragDrop"in e}(),ze;function et(e){if(ze==null){var t=f("span","\u200B");C(e,f("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(ze=t.offsetWidth<=1&&t.offsetHeight>2&&!(K&&G<8))}var i=ze?f("span","\u200B"):f("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}var nt;function _t(e){if(nt!=null)return nt;var t=C(e,document.createTextNode("A\u062EA")),i=y(t,0,1).getBoundingClientRect(),r=y(t,1,2).getBoundingClientRect();return R(e),!i||i.left==i.right?!1:nt=r.right-i.right<3}var lt=`
|
|
|
|
b`.split(/\n/).length!=3?function(e){for(var t=0,i=[],r=e.length;t<=r;){var c=e.indexOf(`
|
|
`,t);c==-1&&(c=e.length);var P=e.slice(t,e.charAt(c-1)=="\r"?c-1:c),V=P.indexOf("\r");V!=-1?(i.push(P.slice(0,V)),t+=V+1):(i.push(P),t=c+1)}return i}:function(e){return e.split(/\r\n?|\n/)},at=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(i){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Rt=function(){var e=f("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),ot=null;function Et(e){if(ot!=null)return ot;var t=C(e,f("span","x")),i=t.getBoundingClientRect(),r=y(t,0,1).getBoundingClientRect();return ot=Math.abs(i.left-r.left)>1}var xt={},Ye={};function Qt(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),xt[e]=t}function nn(e,t){Ye[e]=t}function Kt(e){if(typeof e=="string"&&Ye.hasOwnProperty(e))e=Ye[e];else if(e&&typeof e.name=="string"&&Ye.hasOwnProperty(e.name)){var t=Ye[e.name];typeof t=="string"&&(t={name:t}),e=z(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Kt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Kt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Pt(e,t){t=Kt(t);var i=xt[t.name];if(!i)return Pt(e,"text/plain");var r=i(e,t);if(dt.hasOwnProperty(t.name)){var c=dt[t.name];for(var P in c){if(!c.hasOwnProperty(P))continue;r.hasOwnProperty(P)&&(r["_"+P]=r[P]),r[P]=c[P]}}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var V in t.modeProps)r[V]=t.modeProps[V];return r}var dt={};function yt(e,t){var i=dt.hasOwnProperty(e)?dt[e]:dt[e]={};g(t,i)}function Tt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var i={};for(var r in t){var c=t[r];c instanceof Array&&(c=c.concat([])),i[r]=c}return i}function Nt(e,t){for(var i;e.innerMode&&!(i=e.innerMode(t),!i||i.mode==e);)t=i.state,e=i.mode;return i||{mode:e,state:t}}function hn(e,t,i){return e.startState?e.startState(t,i):!0}var Ut=function(e,t,i){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=i};Ut.prototype.eol=function(){return this.pos>=this.string.length},Ut.prototype.sol=function(){return this.pos==this.lineStart},Ut.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ut.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Ut.prototype.eat=function(e){var t=this.string.charAt(this.pos),i;if(typeof e=="string"?i=t==e:i=t&&(e.test?e.test(t):e(t)),i)return++this.pos,t},Ut.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Ut.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Ut.prototype.skipToEnd=function(){this.pos=this.string.length},Ut.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ut.prototype.backUp=function(e){this.pos-=e},Ut.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=W(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?W(this.string,this.lineStart,this.tabSize):0)},Ut.prototype.indentation=function(){return W(this.string,null,this.tabSize)-(this.lineStart?W(this.string,this.lineStart,this.tabSize):0)},Ut.prototype.match=function(e,t,i){if(typeof e=="string"){var r=function(V){return i?V.toLowerCase():V},c=this.string.substr(this.pos,e.length);if(r(c)==r(e))return t!==!1&&(this.pos+=e.length),!0}else{var P=this.string.slice(this.pos).match(e);return P&&P.index>0?null:(P&&t!==!1&&(this.pos+=P[0].length),P)}},Ut.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ut.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Ut.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Ut.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function qe(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 i=e;!i.lines;)for(var r=0;;++r){var c=i.children[r],P=c.chunkSize();if(t<P){i=c;break}t-=P}return i.lines[t]}function Ot(e,t,i){var r=[],c=t.line;return e.iter(t.line,i.line+1,function(P){var V=P.text;c==i.line&&(V=V.slice(0,i.ch)),c==t.line&&(V=V.slice(t.ch)),r.push(V),++c}),r}function It(e,t,i){var r=[];return e.iter(t,i,function(c){r.push(c.text)}),r}function pt(e,t){var i=t-e.height;if(i)for(var r=e;r;r=r.parent)r.height+=i}function gt(e){if(e.parent==null)return null;for(var t=e.parent,i=oe(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var c=0;!(r.children[c]==t);++c)i+=r.children[c].chunkSize();return i+t.first}function Ct(e,t){var i=e.first;e:do{for(var r=0;r<e.children.length;++r){var c=e.children[r],P=c.height;if(t<P){e=c;continue e}t-=P,i+=c.chunkSize()}return i}while(!e.lines);for(var V=0;V<e.lines.length;++V){var Z=e.lines[V],te=Z.height;if(t<te)break;t-=te}return i+V}function sn(e,t){return t>=e.first&&t<e.first+e.size}function Ht(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function He(e,t,i){if(i===void 0&&(i=null),!(this instanceof He))return new He(e,t,i);this.line=e,this.ch=t,this.sticky=i}function mt(e,t){return e.line-t.line||e.ch-t.ch}function rr(e,t){return e.sticky==t.sticky&&mt(e,t)==0}function _r(e){return He(e.line,e.ch)}function Er(e,t){return mt(e,t)<0?t:e}function ir(e,t){return mt(e,t)<0?e:t}function xr(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function bt(e,t){if(t.line<e.first)return He(e.first,0);var i=e.first+e.size-1;return t.line>i?He(i,qe(e,i).text.length):Ai(t,qe(e,t.line).text.length)}function Ai(e,t){var i=e.ch;return i==null||i>t?He(e.line,t):i<0?He(e.line,0):e}function Ve(e,t){for(var i=[],r=0;r<t.length;r++)i[r]=bt(e,t[r]);return i}var Tr=function(e,t){this.state=e,this.lookAhead=t},Cn=function(e,t,i,r){this.state=t,this.doc=e,this.line=i,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};Cn.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Cn.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}},Cn.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Cn.fromSaved=function(e,t,i){return t instanceof Tr?new Cn(e,Tt(e.mode,t.state),i,t.lookAhead):new Cn(e,Tt(e.mode,t),i)},Cn.prototype.save=function(e){var t=e!==!1?Tt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Tr(t,this.maxLookAhead):t};function Vr(e,t,i,r){var c=[e.state.modeGen],P={};Ln(e,t.text,e.doc.mode,i,function(ie,ye){return c.push(ie,ye)},P,r);for(var V=i.state,Z=function(ie){i.baseTokens=c;var ye=e.state.overlays[ie],Ee=1,ke=0;i.state=!0,Ln(e,t.text,ye.mode,i,function(De,Fe){for(var Ue=Ee;ke<De;){var Xe=c[Ee];Xe>De&&c.splice(Ee,1,De,c[Ee+1],Xe),Ee+=2,ke=Math.min(De,Xe)}if(!Fe)return;if(ye.opaque)c.splice(Ue,Ee-Ue,De,"overlay "+Fe),Ee=Ue+2;else for(;Ue<Ee;Ue+=2){var Je=c[Ue+1];c[Ue+1]=(Je?Je+" ":"")+"overlay "+Fe}},P),i.state=V,i.baseTokens=null,i.baseTokenPos=1},te=0;te<e.state.overlays.length;++te)Z(te);return{styles:c,classes:P.bgClass||P.textClass?P:null}}function ar(e,t,i){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=Rn(e,gt(t)),c=t.text.length>e.options.maxHighlightLength&&Tt(e.doc.mode,r.state),P=Vr(e,t,r);c&&(r.state=c),t.stateAfter=r.save(!c),t.styles=P.styles,P.classes?t.styleClasses=P.classes:t.styleClasses&&(t.styleClasses=null),i===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Rn(e,t,i){var r=e.doc,c=e.display;if(!r.mode.startState)return new Cn(r,!0,t);var P=Oi(e,t,i),V=P>r.first&&qe(r,P-1).stateAfter,Z=V?Cn.fromSaved(r,V,P):new Cn(r,hn(r.mode),P);return r.iter(P,t,function(te){Xr(e,te.text,Z);var ie=Z.line;te.stateAfter=ie==t-1||ie%5==0||ie>=c.viewFrom&&ie<c.viewTo?Z.save():null,Z.nextLine()}),i&&(r.modeFrontier=Z.line),Z}function Xr(e,t,i,r){var c=e.doc.mode,P=new Ut(t,e.options.tabSize,i);for(P.start=P.pos=r||0,t==""&&Yr(c,i.state);!P.eol();)On(c,P,i.state),P.start=P.pos}function Yr(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var i=Nt(e,t);if(i.mode.blankLine)return i.mode.blankLine(i.state)}function On(e,t,i,r){for(var c=0;c<10;c++){r&&(r[0]=Nt(e,i).mode);var P=e.token(t,i);if(t.pos>t.start)return P}throw new Error("Mode "+e.name+" failed to advance stream.")}var $r=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function Ri(e,t,i,r){var c=e.doc,P=c.mode,V;t=bt(c,t);var Z=qe(c,t.line),te=Rn(e,t.line,i),ie=new Ut(Z.text,e.options.tabSize,te),ye;for(r&&(ye=[]);(r||ie.pos<t.ch)&&!ie.eol();)ie.start=ie.pos,V=On(P,ie,te.state),r&&ye.push(new $r(ie,V,Tt(c.mode,te.state)));return r?ye:new $r(ie,V,te.state)}function Jr(e,t){if(e)for(;;){var i=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!i)break;e=e.slice(0,i.index)+e.slice(i.index+i[0].length);var r=i[1]?"bgClass":"textClass";t[r]==null?t[r]=i[2]:new RegExp("(?:^|\\s)"+i[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+i[2])}return e}function Ln(e,t,i,r,c,P,V){var Z=i.flattenSpans;Z==null&&(Z=e.options.flattenSpans);var te=0,ie=null,ye=new Ut(t,e.options.tabSize,r),Ee,ke=e.options.addModeClass&&[null];for(t==""&&Jr(Yr(i,r.state),P);!ye.eol();){if(ye.pos>e.options.maxHighlightLength?(Z=!1,V&&Xr(e,t,r,ye.pos),ye.pos=t.length,Ee=null):Ee=Jr(On(i,ye,r.state,ke),P),ke){var De=ke[0].name;De&&(Ee="m-"+(Ee?De+" "+Ee:De))}if(!Z||ie!=Ee){for(;te<ye.start;)te=Math.min(ye.start,te+5e3),c(te,ie);ie=Ee}ye.start=ye.pos}for(;te<ye.pos;){var Fe=Math.min(ye.pos,te+5e3);c(Fe,ie),te=Fe}}function Oi(e,t,i){for(var r,c,P=e.doc,V=i?-1:t-(e.doc.mode.innerMode?1e3:100),Z=t;Z>V;--Z){if(Z<=P.first)return P.first;var te=qe(P,Z-1),ie=te.stateAfter;if(ie&&(!i||Z+(ie instanceof Tr?ie.lookAhead:0)<=P.modeFrontier))return Z;var ye=W(te.text,null,e.options.tabSize);(c==null||r>ye)&&(c=Z-1,r=ye)}return c}function aa(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var i=e.first,r=t-1;r>i;r--){var c=qe(e,r).stateAfter;if(c&&(!(c instanceof Tr)||r+c.lookAhead<t)){i=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,i)}var Qr=!1,cn=!1;function Xn(){Qr=!0}function sa(){cn=!0}function sr(e,t,i){this.marker=e,this.from=t,this.to=i}function In(e,t){if(e)for(var i=0;i<e.length;++i){var r=e[i];if(r.marker==t)return r}}function Zr(e,t){for(var i,r=0;r<e.length;++r)e[r]!=t&&(i||(i=[])).push(e[r]);return i}function oa(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function Li(e,t,i){var r;if(e)for(var c=0;c<e.length;++c){var P=e[c],V=P.marker,Z=P.from==null||(V.inclusiveLeft?P.from<=t:P.from<t);if(Z||P.from==t&&V.type=="bookmark"&&(!i||!P.marker.insertLeft)){var te=P.to==null||(V.inclusiveRight?P.to>=t:P.to>t);(r||(r=[])).push(new sr(V,P.from,te?null:P.to))}}return r}function Ii(e,t,i){var r;if(e)for(var c=0;c<e.length;++c){var P=e[c],V=P.marker,Z=P.to==null||(V.inclusiveRight?P.to>=t:P.to>t);if(Z||P.from==t&&V.type=="bookmark"&&(!i||P.marker.insertLeft)){var te=P.from==null||(V.inclusiveLeft?P.from<=t:P.from<t);(r||(r=[])).push(new sr(V,te?null:P.from-t,P.to==null?null:P.to-t))}}return r}function wr(e,t){if(t.full)return null;var i=sn(e,t.from.line)&&qe(e,t.from.line).markedSpans,r=sn(e,t.to.line)&&qe(e,t.to.line).markedSpans;if(!i&&!r)return null;var c=t.from.ch,P=t.to.ch,V=mt(t.from,t.to)==0,Z=Li(i,c,V),te=Ii(r,P,V),ie=t.text.length==1,ye=b(t.text).length+(ie?c:0);if(Z)for(var Ee=0;Ee<Z.length;++Ee){var ke=Z[Ee];if(ke.to==null){var De=In(te,ke.marker);De?ie&&(ke.to=De.to==null?null:De.to+ye):ke.to=c}}if(te)for(var Fe=0;Fe<te.length;++Fe){var Ue=te[Fe];if(Ue.to!=null&&(Ue.to+=ye),Ue.from==null){var Xe=In(Z,Ue.marker);Xe||(Ue.from=ye,ie&&(Z||(Z=[])).push(Ue))}else Ue.from+=ye,ie&&(Z||(Z=[])).push(Ue)}Z&&(Z=Di(Z)),te&&te!=Z&&(te=Di(te));var Je=[Z];if(!ie){var it=t.text.length-2,Qe;if(it>0&&Z)for(var st=0;st<Z.length;++st)Z[st].to==null&&(Qe||(Qe=[])).push(new sr(Z[st].marker,null,null));for(var ft=0;ft<it;++ft)Je.push(Qe);Je.push(te)}return Je}function Di(e){for(var t=0;t<e.length;++t){var i=e[t];i.from!=null&&i.from==i.to&&i.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function ki(e,t,i){var r=null;if(e.iter(t.line,i.line+1,function(De){if(De.markedSpans)for(var Fe=0;Fe<De.markedSpans.length;++Fe){var Ue=De.markedSpans[Fe].marker;Ue.readOnly&&(!r||oe(r,Ue)==-1)&&(r||(r=[])).push(Ue)}}),!r)return null;for(var c=[{from:t,to:i}],P=0;P<r.length;++P)for(var V=r[P],Z=V.find(0),te=0;te<c.length;++te){var ie=c[te];if(mt(ie.to,Z.from)<0||mt(ie.from,Z.to)>0)continue;var ye=[te,1],Ee=mt(ie.from,Z.from),ke=mt(ie.to,Z.to);(Ee<0||!V.inclusiveLeft&&!Ee)&&ye.push({from:ie.from,to:Z.from}),(ke>0||!V.inclusiveRight&&!ke)&&ye.push({from:Z.to,to:ie.to}),c.splice.apply(c,ye),te+=ye.length-3}return c}function la(e){var t=e.markedSpans;if(!t)return;for(var i=0;i<t.length;++i)t[i].marker.detachLine(e);e.markedSpans=null}function Sr(e,t){if(!t)return;for(var i=0;i<t.length;++i)t[i].marker.attachLine(e);e.markedSpans=t}function or(e){return e.inclusiveLeft?-1:0}function lr(e){return e.inclusiveRight?1:0}function Cr(e,t){var i=e.lines.length-t.lines.length;if(i!=0)return i;var r=e.find(),c=t.find(),P=mt(r.from,c.from)||or(e)-or(t);if(P)return-P;var V=mt(r.to,c.to)||lr(e)-lr(t);return V||t.id-e.id}function jn(e,t){var i=cn&&e.markedSpans,r;if(i)for(var c=void 0,P=0;P<i.length;++P)c=i[P],c.marker.collapsed&&(t?c.from:c.to)==null&&(!r||Cr(r,c.marker)<0)&&(r=c.marker);return r}function Hn(e){return jn(e,!0)}function Wn(e){return jn(e,!1)}function Ar(e,t){var i=cn&&e.markedSpans,r;if(i)for(var c=0;c<i.length;++c){var P=i[c];P.marker.collapsed&&(P.from==null||P.from<t)&&(P.to==null||P.to>t)&&(!r||Cr(r,P.marker)<0)&&(r=P.marker)}return r}function Mi(e,t,i,r,c){var P=qe(e,t),V=cn&&P.markedSpans;if(V)for(var Z=0;Z<V.length;++Z){var te=V[Z];if(!te.marker.collapsed)continue;var ie=te.marker.find(0),ye=mt(ie.from,i)||or(te.marker)-or(c),Ee=mt(ie.to,r)||lr(te.marker)-lr(c);if(ye>=0&&Ee<=0||ye<=0&&Ee>=0)continue;if(ye<=0&&(te.marker.inclusiveRight&&c.inclusiveLeft?mt(ie.to,i)>=0:mt(ie.to,i)>0)||ye>=0&&(te.marker.inclusiveRight&&c.inclusiveLeft?mt(ie.from,r)<=0:mt(ie.from,r)<0))return!0}}function Tn(e){for(var t;t=Hn(e);)e=t.find(-1,!0).line;return e}function Pi(e){for(var t;t=Wn(e);)e=t.find(1,!0).line;return e}function Rr(e){for(var t,i;t=Wn(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function qr(e,t){var i=qe(e,t),r=Tn(i);return i==r?t:gt(r)}function Yn(e,t){if(t>e.lastLine())return t;var i=qe(e,t),r;if(!Nn(e,i))return t;for(;r=Wn(i);)i=r.find(1,!0).line;return gt(i)+1}function Nn(e,t){var i=cn&&t.markedSpans;if(i)for(var r=void 0,c=0;c<i.length;++c){if(r=i[c],!r.marker.collapsed)continue;if(r.from==null)return!0;if(r.marker.widgetNode)continue;if(r.from==0&&r.marker.inclusiveLeft&&ei(e,t,r))return!0}}function ei(e,t,i){if(i.to==null){var r=i.marker.find(1,!0);return ei(e,r.line,In(r.line.markedSpans,i.marker))}if(i.marker.inclusiveRight&&i.to==t.text.length)return!0;for(var c=void 0,P=0;P<t.markedSpans.length;++P)if(c=t.markedSpans[P],c.marker.collapsed&&!c.marker.widgetNode&&c.from==i.to&&(c.to==null||c.to!=i.from)&&(c.marker.inclusiveLeft||i.marker.inclusiveRight)&&ei(e,t,c))return!0}function Dn(e){e=Tn(e);for(var t=0,i=e.parent,r=0;r<i.lines.length;++r){var c=i.lines[r];if(c==e)break;t+=c.height}for(var P=i.parent;P;i=P,P=i.parent)for(var V=0;V<P.children.length;++V){var Z=P.children[V];if(Z==i)break;t+=Z.height}return t}function ti(e){if(e.height==0)return 0;for(var t=e.text.length,i,r=e;i=Hn(r);){var c=i.find(0,!0);r=c.from.line,t+=c.from.ch-c.to.ch}for(r=e;i=Wn(r);){var P=i.find(0,!0);t-=r.text.length-P.from.ch,r=P.to.line,t+=r.text.length-P.to.ch}return t}function Ni(e){var t=e.display,i=e.doc;t.maxLine=qe(i,i.first),t.maxLineLength=ti(t.maxLine),t.maxLineChanged=!0,i.iter(function(r){var c=ti(r);c>t.maxLineLength&&(t.maxLineLength=c,t.maxLine=r)})}var ur=function(e,t,i){this.text=e,Sr(this,t),this.height=i?i(this):1};ur.prototype.lineNo=function(){return gt(this)},de(ur);function ua(e,t,i,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),la(e),Sr(e,i);var c=r?r(e):1;c!=e.height&&pt(e,c)}function ut(e){e.parent=null,la(e)}var vt={},ct={};function St(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?ct:vt;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function Dt(e,t){var i=w("span",null,null,n?"padding-right: .1px":null),r={pre:w("pre",[i],"CodeMirror-line"),content:i,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var c=0;c<=(t.rest?t.rest.length:0);c++){var P=c?t.rest[c-1]:t.line,V=void 0;r.pos=0,r.addToken=Lt,_t(e.display.measure)&&(V=je(P,e.doc.direction))&&(r.addToken=pn(r.addToken,V)),r.map=[];var Z=t!=e.display.externalMeasured&>(P);Gn(P,r,ar(e,P,Z)),P.styleClasses&&(P.styleClasses.bgClass&&(r.bgClass=x(P.styleClasses.bgClass,r.bgClass||"")),P.styleClasses.textClass&&(r.textClass=x(P.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(et(e.display.measure))),c==0?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(n){var te=r.content.lastChild;(/\bcm-tab\b/.test(te.className)||te.querySelector&&te.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return ce(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=x(r.pre.className,r.textClass||"")),r}function Bt(e){var t=f("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Lt(e,t,i,r,c,P,V){if(!t)return;var Z=e.splitSpaces?$t(t,e.trailingSpace):t,te=e.cm.state.specialChars,ie=!1,ye;if(!te.test(t))e.col+=t.length,ye=document.createTextNode(Z),e.map.push(e.pos,e.pos+t.length,ye),K&&G<9&&(ie=!0),e.pos+=t.length;else{ye=document.createDocumentFragment();for(var Ee=0;;){te.lastIndex=Ee;var ke=te.exec(t),De=ke?ke.index-Ee:t.length-Ee;if(De){var Fe=document.createTextNode(Z.slice(Ee,Ee+De));K&&G<9?ye.appendChild(f("span",[Fe])):ye.appendChild(Fe),e.map.push(e.pos,e.pos+De,Fe),e.col+=De,e.pos+=De}if(!ke)break;Ee+=De+1;var Ue=void 0;if(ke[0]==" "){var Xe=e.cm.options.tabSize,Je=Xe-e.col%Xe;Ue=ye.appendChild(f("span",X(Je),"cm-tab")),Ue.setAttribute("role","presentation"),Ue.setAttribute("cm-text"," "),e.col+=Je}else ke[0]=="\r"||ke[0]==`
|
|
`?(Ue=ye.appendChild(f("span",ke[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Ue.setAttribute("cm-text",ke[0]),e.col+=1):(Ue=e.cm.options.specialCharPlaceholder(ke[0]),Ue.setAttribute("cm-text",ke[0]),K&&G<9?ye.appendChild(f("span",[Ue])):ye.appendChild(Ue),e.col+=1);e.map.push(e.pos,e.pos+1,Ue),e.pos++}}if(e.trailingSpace=Z.charCodeAt(t.length-1)==32,i||r||c||ie||P||V){var it=i||"";r&&(it+=r),c&&(it+=c);var Qe=f("span",[ye],it,P);if(V)for(var st in V)V.hasOwnProperty(st)&&st!="style"&&st!="class"&&Qe.setAttribute(st,V[st]);return e.content.appendChild(Qe)}e.content.appendChild(ye)}function $t(e,t){if(e.length>1&&!/ /.test(e))return e;for(var i=t,r="",c=0;c<e.length;c++){var P=e.charAt(c);P==" "&&i&&(c==e.length-1||e.charCodeAt(c+1)==32)&&(P="\xA0"),r+=P,i=P==" "}return r}function pn(e,t){return function(i,r,c,P,V,Z,te){c=c?c+" cm-force-border":"cm-force-border";for(var ie=i.pos,ye=ie+r.length;;){for(var Ee=void 0,ke=0;ke<t.length&&!(Ee=t[ke],Ee.to>ie&&Ee.from<=ie);ke++);if(Ee.to>=ye)return e(i,r,c,P,V,Z,te);e(i,r.slice(0,Ee.to-ie),c,P,null,Z,te),P=null,r=r.slice(Ee.to-ie),ie=Ee.to}}}function At(e,t,i,r){var c=!r&&i.widgetNode;c&&e.map.push(e.pos,e.pos+t,c),!r&&e.cm.display.input.needsContentAttribute&&(c||(c=e.content.appendChild(document.createElement("span"))),c.setAttribute("cm-marker",i.id)),c&&(e.cm.display.input.setUneditable(c),e.content.appendChild(c)),e.pos+=t,e.trailingSpace=!1}function Gn(e,t,i){var r=e.markedSpans,c=e.text,P=0;if(!r){for(var V=1;V<i.length;V+=2)t.addToken(t,c.slice(P,P=i[V]),St(i[V+1],t.cm.options));return}for(var Z=c.length,te=0,ie=1,ye="",Ee,ke,De=0,Fe,Ue,Xe,Je,it;;){if(De==te){Fe=Ue=Xe=ke="",it=null,Je=null,De=Infinity;for(var Qe=[],st=void 0,ft=0;ft<r.length;++ft){var ht=r[ft],wt=ht.marker;if(wt.type=="bookmark"&&ht.from==te&&wt.widgetNode)Qe.push(wt);else if(ht.from<=te&&(ht.to==null||ht.to>te||wt.collapsed&&ht.to==te&&ht.from==te)){if(ht.to!=null&&ht.to!=te&&De>ht.to&&(De=ht.to,Ue=""),wt.className&&(Fe+=" "+wt.className),wt.css&&(ke=(ke?ke+";":"")+wt.css),wt.startStyle&&ht.from==te&&(Xe+=" "+wt.startStyle),wt.endStyle&&ht.to==De&&(st||(st=[])).push(wt.endStyle,ht.to),wt.title&&((it||(it={})).title=wt.title),wt.attributes)for(var jt in wt.attributes)(it||(it={}))[jt]=wt.attributes[jt];wt.collapsed&&(!Je||Cr(Je.marker,wt)<0)&&(Je=ht)}else ht.from>te&&De>ht.from&&(De=ht.from)}if(st)for(var en=0;en<st.length;en+=2)st[en+1]==De&&(Ue+=" "+st[en]);if(!Je||Je.from==te)for(var Gt=0;Gt<Qe.length;++Gt)At(t,0,Qe[Gt]);if(Je&&(Je.from||0)==te){if(At(t,(Je.to==null?Z+1:Je.to)-te,Je.marker,Je.from==null),Je.to==null)return;Je.to==te&&(Je=!1)}}if(te>=Z)break;for(var xn=Math.min(Z,De);;){if(ye){var yn=te+ye.length;if(!Je){var Xt=yn>xn?ye.slice(0,xn-te):ye;t.addToken(t,Xt,Ee?Ee+Fe:Fe,Xe,te+Xt.length==De?Ue:"",ke,it)}if(yn>=xn){ye=ye.slice(xn-te),te=xn;break}te=yn,Xe=""}ye=c.slice(P,P=i[ie++]),Ee=St(i[ie++],t.cm.options)}}}function kt(e,t,i){this.line=t,this.rest=Rr(t),this.size=this.rest?gt(b(this.rest))-i+1:1,this.node=this.text=null,this.hidden=Nn(e,t)}function mn(e,t,i){for(var r=[],c,P=t;P<i;P=c){var V=new kt(e.doc,qe(e.doc,P),P);c=P+V.size,r.push(V)}return r}var on=null;function An(e){on?on.ops.push(e):e.ownsGroup=on={ops:[e],delayedCallbacks:[]}}function Lo(e){var t=e.delayedCallbacks,i=0;do{for(;i<t.length;i++)t[i].call(null);for(var r=0;r<e.ops.length;r++){var c=e.ops[r];if(c.cursorActivityHandlers)for(;c.cursorActivityCalled<c.cursorActivityHandlers.length;)c.cursorActivityHandlers[c.cursorActivityCalled++].call(null,c.cm)}}while(i<t.length)}function Io(e,t){var i=e.ownsGroup;if(!i)return;try{Lo(i)}finally{on=null,t(i)}}var ni=null;function rn(e,t){var i=tt(e,t);if(!i.length)return;var r=Array.prototype.slice.call(arguments,2),c;on?c=on.delayedCallbacks:ni?c=ni:(c=ni=[],setTimeout(Do,0));for(var P=function(Z){c.push(function(){return i[Z].apply(null,r)})},V=0;V<i.length;++V)P(V)}function Do(){var e=ni;ni=null;for(var t=0;t<e.length;++t)e[t]()}function Ya(e,t,i,r){for(var c=0;c<t.changes.length;c++){var P=t.changes[c];P=="text"?Mo(e,t):P=="gutter"?Ja(e,t,i,r):P=="class"?ha(e,t):P=="widget"&&Po(e,t,r)}t.changes=null}function ri(e){return e.node==e.text&&(e.node=f("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),K&&G<8&&(e.node.style.zIndex=2)),e.node}function ko(e,t){var i=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(i&&(i+=" CodeMirror-linebackground"),t.background)i?t.background.className=i:(t.background.parentNode.removeChild(t.background),t.background=null);else if(i){var r=ri(t);t.background=r.insertBefore(f("div",null,i),r.firstChild),e.display.input.setUneditable(t.background)}}function $a(e,t){var i=e.display.externalMeasured;return i&&i.line==t.line?(e.display.externalMeasured=null,t.measure=i.measure,i.built):Dt(e,t)}function Mo(e,t){var i=t.text.className,r=$a(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,ha(e,t)):i&&(t.text.className=i)}function ha(e,t){ko(e,t),t.line.wrapClass?ri(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var i=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=i||""}function Ja(e,t,i,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var c=ri(t);t.gutterBackground=f("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),c.insertBefore(t.gutterBackground,t.text)}var P=t.line.gutterMarkers;if(e.options.lineNumbers||P){var V=ri(t),Z=t.gutter=f("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(e.display.input.setUneditable(Z),V.insertBefore(Z,t.text),t.line.gutterClass&&(Z.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!P||!P["CodeMirror-linenumbers"])&&(t.lineNumber=Z.appendChild(f("div",Ht(e.options,i),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),P)for(var te=0;te<e.display.gutterSpecs.length;++te){var ie=e.display.gutterSpecs[te].className,ye=P.hasOwnProperty(ie)&&P[ie];ye&&Z.appendChild(f("div",[ye],"CodeMirror-gutter-elt","left: "+r.gutterLeft[ie]+"px; width: "+r.gutterWidth[ie]+"px"))}}}function Po(e,t,i){t.alignable&&(t.alignable=null);for(var r=L("CodeMirror-linewidget"),c=t.node.firstChild,P=void 0;c;c=P)P=c.nextSibling,r.test(c.className)&&t.node.removeChild(c);Qa(e,t,i)}function No(e,t,i,r){var c=$a(e,t);return t.text=t.node=c.pre,c.bgClass&&(t.bgClass=c.bgClass),c.textClass&&(t.textClass=c.textClass),ha(e,t),Ja(e,t,i,r),Qa(e,t,r),t.node}function Qa(e,t,i){if(Za(e,t.line,t,i,!0),t.rest)for(var r=0;r<t.rest.length;r++)Za(e,t.rest[r],t,i,!1)}function Za(e,t,i,r,c){if(!t.widgets)return;for(var P=ri(i),V=0,Z=t.widgets;V<Z.length;++V){var te=Z[V],ie=f("div",[te.node],"CodeMirror-linewidget"+(te.className?" "+te.className:""));te.handleMouseEvents||ie.setAttribute("cm-ignore-events","true"),Fo(te,ie,i,r),e.display.input.setUneditable(ie),c&&te.above?P.insertBefore(ie,i.gutter||i.text):P.appendChild(ie),rn(te,"redraw")}}function Fo(e,t,i,r){if(e.noHScroll){(i.alignable||(i.alignable=[])).push(t);var c=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(c-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=c+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function ii(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!_(document.body,e.node)){var i="position: relative;";e.coverGutter&&(i+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(i+="width: "+t.display.wrapper.clientWidth+"px;"),C(t.display.measure,f("div",[e.node],null,i))}return e.height=e.node.parentNode.offsetHeight}function zn(e,t){for(var i=_e(t);i!=e.wrapper;i=i.parentNode)if(!i||i.nodeType==1&&i.getAttribute("cm-ignore-events")=="true"||i.parentNode==e.sizer&&i!=e.mover)return!0}function Fi(e){return e.lineSpace.offsetTop}function ca(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function qa(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=C(e.measure,f("pre","x","CodeMirror-line-like")),i=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(i.paddingLeft),right:parseInt(i.paddingRight)};return!isNaN(r.left)&&!isNaN(r.right)&&(e.cachedPaddingH=r),r}function Fn(e){return fe-e.display.nativeBarWidth}function hr(e){return e.display.scroller.clientWidth-Fn(e)-e.display.barWidth}function da(e){return e.display.scroller.clientHeight-Fn(e)-e.display.barHeight}function Uo(e,t,i){var r=e.options.lineWrapping,c=r&&hr(e);if(!t.measure.heights||r&&t.measure.width!=c){var P=t.measure.heights=[];if(r){t.measure.width=c;for(var V=t.text.firstChild.getClientRects(),Z=0;Z<V.length-1;Z++){var te=V[Z],ie=V[Z+1];Math.abs(te.bottom-ie.bottom)>2&&P.push((te.bottom+ie.top)/2-i.top)}}P.push(i.bottom-i.top)}}function es(e,t,i){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var c=0;c<e.rest.length;c++)if(gt(e.rest[c])>i)return{map:e.measure.maps[c],cache:e.measure.caches[c],before:!0}}function Bo(e,t){t=Tn(t);var i=gt(t),r=e.display.externalMeasured=new kt(e.doc,t,i);r.lineN=i;var c=r.built=Dt(e,r);return r.text=c.pre,C(e.display.lineMeasure,c.pre),r}function ts(e,t,i,r){return Un(e,Or(e,t),i,r)}function fa(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[fr(e,t)];var i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size)return i}function Or(e,t){var i=gt(t),r=fa(e,i);r&&!r.text?r=null:r&&r.changes&&(Ya(e,r,i,ba(e)),e.curOp.forceUpdate=!0),r||(r=Bo(e,t));var c=es(r,t,i);return{line:t,view:r,rect:null,map:c.map,cache:c.cache,before:c.before,hasHeights:!1}}function Un(e,t,i,r,c){t.before&&(i=-1);var P=i+(r||""),V;return t.cache.hasOwnProperty(P)?V=t.cache[P]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Uo(e,t.view,t.rect),t.hasHeights=!0),V=Ho(e,t,i,r),V.bogus||(t.cache[P]=V)),{left:V.left,right:V.right,top:c?V.rtop:V.top,bottom:c?V.rbottom:V.bottom}}var ns={left:0,right:0,top:0,bottom:0};function rs(e,t,i){for(var r,c,P,V,Z,te,ie=0;ie<e.length;ie+=3)if(Z=e[ie],te=e[ie+1],t<Z?(c=0,P=1,V="left"):t<te?(c=t-Z,P=c+1):(ie==e.length-3||t==te&&e[ie+3]>t)&&(P=te-Z,c=P-1,t>=te&&(V="right")),c!=null){if(r=e[ie+2],Z==te&&i==(r.insertLeft?"left":"right")&&(V=i),i=="left"&&c==0)for(;ie&&e[ie-2]==e[ie-3]&&e[ie-1].insertLeft;)r=e[(ie-=3)+2],V="left";if(i=="right"&&c==te-Z)for(;ie<e.length-3&&e[ie+3]==e[ie+4]&&!e[ie+5].insertLeft;)r=e[(ie+=3)+2],V="right";break}return{node:r,start:c,end:P,collapse:V,coverStart:Z,coverEnd:te}}function jo(e,t){var i=ns;if(t=="left")for(var r=0;r<e.length&&!((i=e[r]).left!=i.right);r++);else for(var c=e.length-1;c>=0&&!((i=e[c]).left!=i.right);c--);return i}function Ho(e,t,i,r){var c=rs(t.map,i,r),P=c.node,V=c.start,Z=c.end,te=c.collapse,ie;if(P.nodeType==3){for(var ye=0;ye<4;ye++){for(;V&&we(t.line.text.charAt(c.coverStart+V));)--V;for(;c.coverStart+Z<c.coverEnd&&we(t.line.text.charAt(c.coverStart+Z));)++Z;if(K&&G<9&&V==0&&Z==c.coverEnd-c.coverStart?ie=P.parentNode.getBoundingClientRect():ie=jo(y(P,V,Z).getClientRects(),r),ie.left||ie.right||V==0)break;Z=V,V=V-1,te="right"}K&&G<11&&(ie=Wo(e.display.measure,ie))}else{V>0&&(te=r="right");var Ee;e.options.lineWrapping&&(Ee=P.getClientRects()).length>1?ie=Ee[r=="right"?Ee.length-1:0]:ie=P.getBoundingClientRect()}if(K&&G<9&&!V&&(!ie||!ie.left&&!ie.right)){var ke=P.parentNode.getClientRects()[0];ke?ie={left:ke.left,right:ke.left+Ir(e.display),top:ke.top,bottom:ke.bottom}:ie=ns}for(var De=ie.top-t.rect.top,Fe=ie.bottom-t.rect.top,Ue=(De+Fe)/2,Xe=t.view.measure.heights,Je=0;Je<Xe.length-1&&!(Ue<Xe[Je]);Je++);var it=Je?Xe[Je-1]:0,Qe=Xe[Je],st={left:(te=="right"?ie.right:ie.left)-t.rect.left,right:(te=="left"?ie.left:ie.right)-t.rect.left,top:it,bottom:Qe};return!ie.left&&!ie.right&&(st.bogus=!0),e.options.singleCursorHeightPerLine||(st.rtop=De,st.rbottom=Fe),st}function Wo(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Et(e))return t;var i=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*i,right:t.right*i,top:t.top*r,bottom:t.bottom*r}}function is(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,R(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)is(e.display.view[t])}function ai(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 v&&o?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function os(){return v&&o?-(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 i=0;i<e.widgets.length;++i)e.widgets[i].above&&(t+=ii(e.widgets[i]));return t}function Ui(e,t,i,r,c){if(!c){var P=pa(t);i.top+=P,i.bottom+=P}if(r=="line")return i;r||(r="local");var V=Dn(t);if(r=="local"?V+=Fi(e.display):V-=e.display.viewOffset,r=="page"||r=="window"){var Z=e.display.lineSpace.getBoundingClientRect();V+=Z.top+(r=="window"?0:os());var te=Z.left+(r=="window"?0:ss());i.left+=te,i.right+=te}return i.top+=V,i.bottom+=V,i}function ls(e,t,i){if(i=="div")return t;var r=t.left,c=t.top;if(i=="page")r-=ss(),c-=os();else if(i=="local"||!i){var P=e.display.sizer.getBoundingClientRect();r+=P.left,c+=P.top}var V=e.display.lineSpace.getBoundingClientRect();return{left:r-V.left,top:c-V.top}}function ma(e,t,i,r,c){return r||(r=qe(e.doc,t.line)),Ui(e,r,ts(e,r,t.ch,c),i)}function kn(e,t,i,r,c,P){r=r||qe(e.doc,t.line),c||(c=Or(e,r));function V(Fe,Ue){var Xe=Un(e,c,Fe,Ue?"right":"left",P);return Ue?Xe.left=Xe.right:Xe.right=Xe.left,Ui(e,r,Xe,i)}var Z=je(r,e.doc.direction),te=t.ch,ie=t.sticky;if(te>=r.text.length?(te=r.text.length,ie="before"):te<=0&&(te=0,ie="after"),!Z)return V(ie=="before"?te-1:te,ie=="before");function ye(Fe,Ue,Xe){var Je=Z[Ue],it=Je.level==1;return V(Xe?Fe-1:Fe,it!=Xe)}var Ee=Ge(Z,te,ie),ke=Ke,De=ye(te,Ee,ie=="before");return ke!=null&&(De.other=ye(te,ke,ie!="before")),De}function us(e,t){var i=0;t=bt(e.doc,t),e.options.lineWrapping||(i=Ir(e.display)*t.ch);var r=qe(e.doc,t.line),c=Dn(r)+Fi(e.display);return{left:i,right:i,top:c,bottom:c+r.height}}function ga(e,t,i,r,c){var P=He(e,t,i);return P.xRel=c,r&&(P.outside=r),P}function va(e,t,i){var r=e.doc;if(i+=e.display.viewOffset,i<0)return ga(r.first,0,null,-1,-1);var c=Ct(r,i),P=r.first+r.size-1;if(c>P)return ga(r.first+r.size-1,qe(r,P).text.length,null,1,1);t<0&&(t=0);for(var V=qe(r,c);;){var Z=Go(e,V,c,t,i),te=Ar(V,Z.ch+(Z.xRel>0||Z.outside>0?1:0));if(!te)return Z;var ie=te.find(1);if(ie.line==c)return ie;V=qe(r,c=ie.line)}}function hs(e,t,i,r){r-=pa(t);var c=t.text.length,P=Ne(function(V){return Un(e,i,V-1).bottom<=r},c,0);return c=Ne(function(V){return Un(e,i,V).top>r},P,c),{begin:P,end:c}}function cs(e,t,i,r){i||(i=Or(e,t));var c=Ui(e,t,Un(e,i,r),"line").top;return hs(e,t,i,c)}function ya(e,t,i,r){return e.bottom<=i?!1:e.top>i?!0:(r?e.left:e.right)>t}function Go(e,t,i,r,c){c-=Dn(t);var P=Or(e,t),V=pa(t),Z=0,te=t.text.length,ie=!0,ye=je(t,e.doc.direction);if(ye){var Ee=(e.options.lineWrapping?Ko:zo)(e,t,i,P,ye,r,c);ie=Ee.level!=1,Z=ie?Ee.from:Ee.to-1,te=ie?Ee.to:Ee.from-1}var ke=null,De=null,Fe=Ne(function(ft){var ht=Un(e,P,ft);return ht.top+=V,ht.bottom+=V,ya(ht,r,c,!1)?(ht.top<=c&&ht.left<=r&&(ke=ft,De=ht),!0):!1},Z,te),Ue,Xe,Je=!1;if(De){var it=r-De.left<De.right-r,Qe=it==ie;Fe=ke+(Qe?0:1),Xe=Qe?"after":"before",Ue=it?De.left:De.right}else{!ie&&(Fe==te||Fe==Z)&&Fe++,Xe=Fe==0?"after":Fe==t.text.length?"before":Un(e,P,Fe-(ie?1:0)).bottom+V<=c==ie?"after":"before";var st=kn(e,He(i,Fe,Xe),"line",t,P);Ue=st.left,Je=c<st.top?-1:c>=st.bottom?1:0}return Fe=Ae(t.text,Fe,1),ga(i,Fe,Xe,Je,r-Ue)}function zo(e,t,i,r,c,P,V){var Z=Ne(function(Ee){var ke=c[Ee],De=ke.level!=1;return ya(kn(e,He(i,De?ke.to:ke.from,De?"before":"after"),"line",t,r),P,V,!0)},0,c.length-1),te=c[Z];if(Z>0){var ie=te.level!=1,ye=kn(e,He(i,ie?te.from:te.to,ie?"after":"before"),"line",t,r);ya(ye,P,V,!0)&&ye.top>V&&(te=c[Z-1])}return te}function Ko(e,t,i,r,c,P,V){var Z=hs(e,t,r,V),te=Z.begin,ie=Z.end;/\s/.test(t.text.charAt(ie-1))&&ie--;for(var ye=null,Ee=null,ke=0;ke<c.length;ke++){var De=c[ke];if(De.from>=ie||De.to<=te)continue;var Fe=De.level!=1,Ue=Un(e,r,Fe?Math.min(ie,De.to)-1:Math.max(te,De.from)).right,Xe=Ue<P?P-Ue+1e9:Ue-P;(!ye||Ee>Xe)&&(ye=De,Ee=Xe)}return ye||(ye=c[c.length-1]),ye.from<te&&(ye={from:te,to:ye.to,level:ye.level}),ye.to>ie&&(ye={from:ye.from,to:ie,level:ye.level}),ye}var cr;function Lr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(cr==null){cr=f("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)cr.appendChild(document.createTextNode("x")),cr.appendChild(f("br"));cr.appendChild(document.createTextNode("x"))}C(e.measure,cr);var i=cr.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),R(e.measure),i||1}function Ir(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=f("span","xxxxxxxxxx"),i=f("pre",[t],"CodeMirror-line-like");C(e.measure,i);var r=t.getBoundingClientRect(),c=(r.right-r.left)/10;return c>2&&(e.cachedCharWidth=c),c||10}function ba(e){for(var t=e.display,i={},r={},c=t.gutters.clientLeft,P=t.gutters.firstChild,V=0;P;P=P.nextSibling,++V){var Z=e.display.gutterSpecs[V].className;i[Z]=P.offsetLeft+P.clientLeft+c,r[Z]=P.clientWidth}return{fixedPos:_a(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function _a(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function ds(e){var t=Lr(e.display),i=e.options.lineWrapping,r=i&&Math.max(5,e.display.scroller.clientWidth/Ir(e.display)-3);return function(c){if(Nn(e.doc,c))return 0;var P=0;if(c.widgets)for(var V=0;V<c.widgets.length;V++)c.widgets[V].height&&(P+=c.widgets[V].height);return i?P+(Math.ceil(c.text.length/r)||1)*t:P+t}}function Ea(e){var t=e.doc,i=ds(e);t.iter(function(r){var c=i(r);c!=r.height&&pt(r,c)})}function dr(e,t,i,r){var c=e.display;if(!i&&_e(t).getAttribute("cm-not-content")=="true")return null;var P,V,Z=c.lineSpace.getBoundingClientRect();try{P=t.clientX-Z.left,V=t.clientY-Z.top}catch(Ee){return null}var te=va(e,P,V),ie;if(r&&te.xRel>0&&(ie=qe(e.doc,te.line).text).length==te.ch){var ye=W(ie,ie.length,e.options.tabSize)-ie.length;te=He(te.line,Math.max(0,Math.round((P-qa(e.display).left)/Ir(e.display))-ye))}return te}function fr(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var i=e.display.view,r=0;r<i.length;r++)if(t-=i[r].size,t<0)return r}function gn(e,t,i,r){t==null&&(t=e.doc.first),i==null&&(i=e.doc.first+e.doc.size),r||(r=0);var c=e.display;if(r&&i<c.viewTo&&(c.updateLineNumbers==null||c.updateLineNumbers>t)&&(c.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=c.viewTo)cn&&qr(e.doc,t)<c.viewTo&&Jn(e);else if(i<=c.viewFrom)cn&&Yn(e.doc,i+r)>c.viewFrom?Jn(e):(c.viewFrom+=r,c.viewTo+=r);else if(t<=c.viewFrom&&i>=c.viewTo)Jn(e);else if(t<=c.viewFrom){var P=Bi(e,i,i+r,1);P?(c.view=c.view.slice(P.index),c.viewFrom=P.lineN,c.viewTo+=r):Jn(e)}else if(i>=c.viewTo){var V=Bi(e,t,t,-1);V?(c.view=c.view.slice(0,V.index),c.viewTo=V.lineN):Jn(e)}else{var Z=Bi(e,t,t,-1),te=Bi(e,i,i+r,1);Z&&te?(c.view=c.view.slice(0,Z.index).concat(mn(e,Z.lineN,te.lineN)).concat(c.view.slice(te.index)),c.viewTo+=r):Jn(e)}var ie=c.externalMeasured;ie&&(i<ie.lineN?ie.lineN+=r:t<ie.lineN+ie.size&&(c.externalMeasured=null))}function $n(e,t,i){e.curOp.viewChanged=!0;var r=e.display,c=e.display.externalMeasured;if(c&&t>=c.lineN&&t<c.lineN+c.size&&(r.externalMeasured=null),t<r.viewFrom||t>=r.viewTo)return;var P=r.view[fr(e,t)];if(P.node==null)return;var V=P.changes||(P.changes=[]);oe(V,i)==-1&&V.push(i)}function Jn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Bi(e,t,i,r){var c=fr(e,t),P,V=e.display.view;if(!cn||i==e.doc.first+e.doc.size)return{index:c,lineN:i};for(var Z=e.display.viewFrom,te=0;te<c;te++)Z+=V[te].size;if(Z!=t){if(r>0){if(c==V.length-1)return null;P=Z+V[c].size-t,c++}else P=Z-t;t+=P,i+=P}for(;qr(e.doc,i)!=i;){if(c==(r<0?0:V.length-1))return null;i+=r*V[c-(r<0?1:0)].size,c+=r}return{index:c,lineN:i}}function Vo(e,t,i){var r=e.display,c=r.view;c.length==0||t>=r.viewTo||i<=r.viewFrom?(r.view=mn(e,t,i),r.viewFrom=t):(r.viewFrom>t?r.view=mn(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(fr(e,t))),r.viewFrom=t,r.viewTo<i?r.view=r.view.concat(mn(e,r.viewTo,i)):r.viewTo>i&&(r.view=r.view.slice(0,fr(e,i)))),r.viewTo=i}function fs(e){for(var t=e.display.view,i=0,r=0;r<t.length;r++){var c=t[r];!c.hidden&&(!c.node||c.changes)&&++i}return i}function si(e){e.display.input.showSelection(e.display.input.prepareSelection())}function ps(e,t){t===void 0&&(t=!0);for(var i=e.doc,r={},c=r.cursors=document.createDocumentFragment(),P=r.selection=document.createDocumentFragment(),V=0;V<i.sel.ranges.length;V++){if(!t&&V==i.sel.primIndex)continue;var Z=i.sel.ranges[V];if(Z.from().line>=e.display.viewTo||Z.to().line<e.display.viewFrom)continue;var te=Z.empty();(te||e.options.showCursorWhenSelecting)&&ms(e,Z.head,c),te||Xo(e,Z,P)}return r}function ms(e,t,i){var r=kn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),c=i.appendChild(f("div","\xA0","CodeMirror-cursor"));if(c.style.left=r.left+"px",c.style.top=r.top+"px",c.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",r.other){var P=i.appendChild(f("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));P.style.display="",P.style.left=r.other.left+"px",P.style.top=r.other.top+"px",P.style.height=(r.other.bottom-r.other.top)*.85+"px"}}function ji(e,t){return e.top-t.top||e.left-t.left}function Xo(e,t,i){var r=e.display,c=e.doc,P=document.createDocumentFragment(),V=qa(e.display),Z=V.left,te=Math.max(r.sizerWidth,hr(e)-r.sizer.offsetLeft)-V.right,ie=c.direction=="ltr";function ye(Qe,st,ft,ht){st<0&&(st=0),st=Math.round(st),ht=Math.round(ht),P.appendChild(f("div",null,"CodeMirror-selected","position: absolute; left: "+Qe+`px;
|
|
top: `+st+"px; width: "+(ft==null?te-Qe:ft)+`px;
|
|
height: `+(ht-st)+"px"))}function Ee(Qe,st,ft){var ht=qe(c,Qe),wt=ht.text.length,jt,en;function Gt(Xt,bn){return ma(e,He(Qe,Xt),"div",ht,bn)}function xn(Xt,bn,an){var Jt=cs(e,ht,null,Xt),Yt=bn=="ltr"==(an=="after")?"left":"right",zt=an=="after"?Jt.begin:Jt.end-(/\s/.test(ht.text.charAt(Jt.end-1))?2:1);return Gt(zt,Yt)[Yt]}var yn=je(ht,c.direction);return Be(yn,st||0,ft==null?wt:ft,function(Xt,bn,an,Jt){var Yt=an=="ltr",zt=Gt(Xt,Yt?"left":"right"),_n=Gt(bn-1,Yt?"right":"left"),zr=st==null&&Xt==0,nr=ft==null&&bn==wt,un=Jt==0,Bn=!yn||Jt==yn.length-1;if(_n.top-zt.top<=3){var tn=(ie?zr:nr)&&un,Va=(ie?nr:zr)&&Bn,Vn=tn?Z:(Yt?zt:_n).left,yr=Va?te:(Yt?_n:zt).right;ye(Vn,zt.top,yr-Vn,zt.bottom)}else{var br,fn,Kr,Xa;Yt?(br=ie&&zr&&un?Z:zt.left,fn=ie?te:xn(Xt,an,"before"),Kr=ie?Z:xn(bn,an,"after"),Xa=ie&&nr&&Bn?te:_n.right):(br=ie?xn(Xt,an,"before"):Z,fn=!ie&&zr&&un?te:zt.right,Kr=!ie&&nr&&Bn?Z:_n.left,Xa=ie?xn(bn,an,"after"):te),ye(br,zt.top,fn-br,zt.bottom),zt.bottom<_n.top&&ye(Z,zt.bottom,null,_n.top),ye(Kr,_n.top,Xa-Kr,_n.bottom)}(!jt||ji(zt,jt)<0)&&(jt=zt),ji(_n,jt)<0&&(jt=_n),(!en||ji(zt,en)<0)&&(en=zt),ji(_n,en)<0&&(en=_n)}),{start:jt,end:en}}var ke=t.from(),De=t.to();if(ke.line==De.line)Ee(ke.line,ke.ch,De.ch);else{var Fe=qe(c,ke.line),Ue=qe(c,De.line),Xe=Tn(Fe)==Tn(Ue),Je=Ee(ke.line,ke.ch,Xe?Fe.text.length+1:null).end,it=Ee(De.line,Xe?0:null,De.ch).start;Xe&&(Je.top<it.top-2?(ye(Je.right,Je.top,null,Je.bottom),ye(Z,it.top,it.left,it.bottom)):ye(Je.right,Je.top,it.left-Je.right,Je.bottom)),Je.bottom<it.top&&ye(Z,Je.bottom,null,it.top)}i.appendChild(P)}function xa(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var i=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Dr(e),t.cursorDiv.style.visibility=(i=!i)?"":"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,Dr(e))},100)}function Ta(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(ce(e,"focus",e,t),e.state.focused=!0,U(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 Dr(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(ce(e,"blur",e,t),e.state.focused=!1,S(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Hi(e){for(var t=e.display,i=t.lineDiv.offsetTop,r=0;r<t.view.length;r++){var c=t.view[r],P=e.options.lineWrapping,V=void 0,Z=0;if(c.hidden)continue;if(K&&G<8){var te=c.node.offsetTop+c.node.offsetHeight;V=te-i,i=te}else{var ie=c.node.getBoundingClientRect();V=ie.bottom-ie.top,!P&&c.text.firstChild&&(Z=c.text.firstChild.getBoundingClientRect().right-ie.left-1)}var ye=c.line.height-V;if((ye>.005||ye<-.005)&&(pt(c.line,V),ys(c.line),c.rest))for(var Ee=0;Ee<c.rest.length;Ee++)ys(c.rest[Ee]);if(Z>e.display.sizerWidth){var ke=Math.ceil(Z/Ir(e.display));ke>e.display.maxLineLength&&(e.display.maxLineLength=ke,e.display.maxLine=c.line,e.display.maxLineChanged=!0)}}}function ys(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var i=e.widgets[t],r=i.node.parentNode;r&&(i.height=r.offsetHeight)}}function Wi(e,t,i){var r=i&&i.top!=null?Math.max(0,i.top):e.scroller.scrollTop;r=Math.floor(r-Fi(e));var c=i&&i.bottom!=null?i.bottom:r+e.wrapper.clientHeight,P=Ct(t,r),V=Ct(t,c);if(i&&i.ensure){var Z=i.ensure.from.line,te=i.ensure.to.line;Z<P?(P=Z,V=Ct(t,Dn(qe(t,Z))+e.wrapper.clientHeight)):Math.min(te,t.lastLine())>=V&&(P=Ct(t,Dn(qe(t,te))-e.wrapper.clientHeight),V=te)}return{from:P,to:Math.max(V,P+1)}}function Yo(e,t){if(ee(e,"scrollCursorIntoView"))return;var i=e.display,r=i.sizer.getBoundingClientRect(),c=null;if(t.top+r.top<0?c=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(c=!1),c!=null&&!l){var P=f("div","\u200B",null,`position: absolute;
|
|
top: `+(t.top-i.viewOffset-Fi(e.display))+`px;
|
|
height: `+(t.bottom-t.top+Fn(e)+i.barHeight)+`px;
|
|
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(P),P.scrollIntoView(c),e.display.lineSpace.removeChild(P)}}function $o(e,t,i,r){r==null&&(r=0);var c;!e.options.lineWrapping&&t==i&&(t=t.ch?He(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,i=t.sticky=="before"?He(t.line,t.ch+1,"before"):t);for(var P=0;P<5;P++){var V=!1,Z=kn(e,t),te=!i||i==t?Z:kn(e,i);c={left:Math.min(Z.left,te.left),top:Math.min(Z.top,te.top)-r,right:Math.max(Z.left,te.left),bottom:Math.max(Z.bottom,te.bottom)+r};var ie=wa(e,c),ye=e.doc.scrollTop,Ee=e.doc.scrollLeft;if(ie.scrollTop!=null&&(li(e,ie.scrollTop),Math.abs(e.doc.scrollTop-ye)>1&&(V=!0)),ie.scrollLeft!=null&&(pr(e,ie.scrollLeft),Math.abs(e.doc.scrollLeft-Ee)>1&&(V=!0)),!V)break}return c}function Jo(e,t){var i=wa(e,t);i.scrollTop!=null&&li(e,i.scrollTop),i.scrollLeft!=null&&pr(e,i.scrollLeft)}function wa(e,t){var i=e.display,r=Lr(e.display);t.top<0&&(t.top=0);var c=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:i.scroller.scrollTop,P=da(e),V={};t.bottom-t.top>P&&(t.bottom=t.top+P);var Z=e.doc.height+ca(i),te=t.top<r,ie=t.bottom>Z-r;if(t.top<c)V.scrollTop=te?0:t.top;else if(t.bottom>c+P){var ye=Math.min(t.top,(ie?Z:t.bottom)-P);ye!=c&&(V.scrollTop=ye)}var Ee=e.options.fixedGutter?0:i.gutters.offsetWidth,ke=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-Ee,De=hr(e)-i.gutters.offsetWidth,Fe=t.right-t.left>De;return Fe&&(t.right=t.left+De),t.left<10?V.scrollLeft=0:t.left<ke?V.scrollLeft=Math.max(0,t.left+Ee-(Fe?0:10)):t.right>De+ke-3&&(V.scrollLeft=t.right+(Fe?0:10)-De),V}function Sa(e,t){if(t==null)return;Gi(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function kr(e){Gi(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function oi(e,t,i){(t!=null||i!=null)&&Gi(e),t!=null&&(e.curOp.scrollLeft=t),i!=null&&(e.curOp.scrollTop=i)}function Qo(e,t){Gi(e),e.curOp.scrollToPos=t}function Gi(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var i=us(e,t.from),r=us(e,t.to);bs(e,i,r,t.margin)}}function bs(e,t,i,r){var c=wa(e,{left:Math.min(t.left,i.left),top:Math.min(t.top,i.top)-r,right:Math.max(t.right,i.right),bottom:Math.max(t.bottom,i.bottom)+r});oi(e,c.scrollLeft,c.scrollTop)}function li(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;N||Aa(e,{top:t}),_s(e,t,!0),N&&Aa(e),ci(e,100)}function _s(e,t,i){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!i)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function pr(e,t,i,r){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(i?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)return;e.doc.scrollLeft=t,Ss(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function ui(e){var t=e.display,i=t.gutters.offsetWidth,r=Math.round(e.doc.height+ca(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?i:0,docHeight:r,scrollHeight:r+Fn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var mr=function(e,t,i){this.cm=i;var r=this.vert=f("div",[f("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),c=this.horiz=f("div",[f("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=c.tabIndex=-1,e(r),e(c),Me(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),Me(c,"scroll",function(){c.clientWidth&&t(c.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,K&&G<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};mr.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,i=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(i){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var c=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+c)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=i?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var P=e.viewWidth-e.barLeft-(i?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+P)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:i?r:0,bottom:t?r:0}},mr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},mr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},mr.prototype.zeroWidthHack=function(){var e=s&&!u?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new J,this.disableVert=new J},mr.prototype.enableZeroWidthBar=function(e,t,i){e.style.pointerEvents="auto";function r(){var c=e.getBoundingClientRect(),P=i=="vert"?document.elementFromPoint(c.right-1,(c.top+c.bottom)/2):document.elementFromPoint((c.right+c.left)/2,c.bottom-1);P!=e?e.style.pointerEvents="none":t.set(1e3,r)}t.set(1e3,r)},mr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var hi=function(){};hi.prototype.update=function(){return{bottom:0,right:0}},hi.prototype.setScrollLeft=function(){},hi.prototype.setScrollTop=function(){},hi.prototype.clear=function(){};function Mr(e,t){t||(t=ui(e));var i=e.display.barWidth,r=e.display.barHeight;Es(e,t);for(var c=0;c<4&&i!=e.display.barWidth||r!=e.display.barHeight;c++)i!=e.display.barWidth&&e.options.lineWrapping&&Hi(e),Es(e,ui(e)),i=e.display.barWidth,r=e.display.barHeight}function Es(e,t){var i=e.display,r=i.scrollbars.update(t);i.sizer.style.paddingRight=(i.barWidth=r.right)+"px",i.sizer.style.paddingBottom=(i.barHeight=r.bottom)+"px",i.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(i.scrollbarFiller.style.display="block",i.scrollbarFiller.style.height=r.bottom+"px",i.scrollbarFiller.style.width=r.right+"px"):i.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(i.gutterFiller.style.display="block",i.gutterFiller.style.height=r.bottom+"px",i.gutterFiller.style.width=t.gutterWidth+"px"):i.gutterFiller.style.display=""}var xs={native:mr,null:hi};function Ts(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&S(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),Me(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,i){i=="horizontal"?pr(e,t):li(e,t)},e),e.display.scrollbars.addClass&&U(e.display.wrapper,e.display.scrollbars.addClass)}var Zo=0;function gr(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:++Zo},An(e.curOp)}function vr(e){var t=e.curOp;t&&Io(t,function(i){for(var r=0;r<i.ops.length;r++)i.ops[r].cm.curOp=null;qo(i)})}function qo(e){for(var t=e.ops,i=0;i<t.length;i++)el(t[i]);for(var r=0;r<t.length;r++)tl(t[r]);for(var c=0;c<t.length;c++)nl(t[c]);for(var P=0;P<t.length;P++)rl(t[P]);for(var V=0;V<t.length;V++)il(t[V])}function el(e){var t=e.cm,i=t.display;sl(t),e.updateMaxLine&&Ni(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<i.viewFrom||e.scrollToPos.to.line>=i.viewTo)||i.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new zi(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,i=t.display;e.updatedDisplay&&Hi(t),e.barMeasure=ui(t),i.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=ts(t,i.maxLine,i.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(i.scroller.clientWidth,i.sizer.offsetLeft+e.adjustWidthTo+Fn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-hr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=i.input.prepareSelection())}function rl(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&pr(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var i=e.focus&&e.focus==j();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,i),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Mr(t,e.barMeasure),e.updatedDisplay&&Oa(t,e.barMeasure),e.selectionChanged&&xa(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),i&&gs(e.cm)}function il(e){var t=e.cm,i=t.display,r=t.doc;if(e.updatedDisplay&&ws(t,e.update),i.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(i.wheelStartX=i.wheelStartY=null),e.scrollTop!=null&&_s(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&pr(t,e.scrollLeft,!0,!0),e.scrollToPos){var c=$o(t,bt(r,e.scrollToPos.from),bt(r,e.scrollToPos.to),e.scrollToPos.margin);Yo(t,c)}var P=e.maybeHiddenMarkers,V=e.maybeUnhiddenMarkers;if(P)for(var Z=0;Z<P.length;++Z)P[Z].lines.length||ce(P[Z],"hide");if(V)for(var te=0;te<V.length;++te)V[te].lines.length&&ce(V[te],"unhide");i.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&ce(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function En(e,t){if(e.curOp)return t();gr(e);try{return t()}finally{vr(e)}}function Zt(e,t){return function(){if(e.curOp)return t.apply(e,arguments);gr(e);try{return t.apply(e,arguments)}finally{vr(e)}}}function dn(e){return function(){if(this.curOp)return e.apply(this,arguments);gr(this);try{return e.apply(this,arguments)}finally{vr(this)}}}function qt(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);gr(t);try{return e.apply(this,arguments)}finally{vr(t)}}}function ci(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,D(al,e))}function al(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var i=+new Date+e.options.workTime,r=Rn(e,t.highlightFrontier),c=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(P){if(r.line>=e.display.viewFrom){var V=P.styles,Z=P.text.length>e.options.maxHighlightLength?Tt(t.mode,r.state):null,te=Vr(e,P,r,!0);Z&&(r.state=Z),P.styles=te.styles;var ie=P.styleClasses,ye=te.classes;ye?P.styleClasses=ye:ie&&(P.styleClasses=null);for(var Ee=!V||V.length!=P.styles.length||ie!=ye&&(!ie||!ye||ie.bgClass!=ye.bgClass||ie.textClass!=ye.textClass),ke=0;!Ee&&ke<V.length;++ke)Ee=V[ke]!=P.styles[ke];Ee&&c.push(r.line),P.stateAfter=r.save(),r.nextLine()}else P.text.length<=e.options.maxHighlightLength&&Xr(e,P.text,r),P.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>i)return ci(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),c.length&&En(e,function(){for(var P=0;P<c.length;P++)$n(e,c[P],"text")})}var zi=function(e,t,i){var r=e.display;this.viewport=t,this.visible=Wi(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=hr(e),this.force=i,this.dims=ba(e),this.events=[]};zi.prototype.signal=function(e,t){se(e,t)&&this.events.push(arguments)},zi.prototype.finish=function(){for(var e=0;e<this.events.length;e++)ce.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=Fn(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Fn(e)+"px",t.scrollbarsClipped=!0)}function ol(e){if(e.hasFocus())return null;var t=j();if(!t||!_(e.display.lineDiv,t))return null;var i={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&_(e.display.lineDiv,r.anchorNode)&&(i.anchorNode=r.anchorNode,i.anchorOffset=r.anchorOffset,i.focusNode=r.focusNode,i.focusOffset=r.focusOffset)}return i}function ll(e){if(!e||!e.activeElt||e.activeElt==j())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&_(document.body,e.anchorNode)&&_(document.body,e.focusNode)){var t=window.getSelection(),i=document.createRange();i.setEnd(e.anchorNode,e.anchorOffset),i.collapse(!1),t.removeAllRanges(),t.addRange(i),t.extend(e.focusNode,e.focusOffset)}}function Ca(e,t){var i=e.display,r=e.doc;if(t.editorIsHidden)return Jn(e),!1;if(!t.force&&t.visible.from>=i.viewFrom&&t.visible.to<=i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo)&&i.renderedView==i.view&&fs(e)==0)return!1;Cs(e)&&(Jn(e),t.dims=ba(e));var c=r.first+r.size,P=Math.max(t.visible.from-e.options.viewportMargin,r.first),V=Math.min(c,t.visible.to+e.options.viewportMargin);i.viewFrom<P&&P-i.viewFrom<20&&(P=Math.max(r.first,i.viewFrom)),i.viewTo>V&&i.viewTo-V<20&&(V=Math.min(c,i.viewTo)),cn&&(P=qr(e.doc,P),V=Yn(e.doc,V));var Z=P!=i.viewFrom||V!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;Vo(e,P,V),i.viewOffset=Dn(qe(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var te=fs(e);if(!Z&&te==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var ie=ol(e);return te>4&&(i.lineDiv.style.display="none"),ul(e,i.updateLineNumbers,t.dims),te>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,ll(ie),R(i.cursorDiv),R(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,Z&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,ci(e,400)),i.updateLineNumbers=null,!0}function ws(e,t){for(var i=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==hr(e)){if(i&&i.top!=null&&(i={top:Math.min(e.doc.height+ca(e.display)-da(e),i.top)}),t.visible=Wi(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=Wi(e.display,e.doc,i));if(!Ca(e,t))break;Hi(e);var c=ui(e);si(e),Mr(e,c),Oa(e,c),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 i=new zi(e,t);if(Ca(e,i)){Hi(e),ws(e,i);var r=ui(e);si(e),Mr(e,r),Oa(e,r),i.finish()}}function ul(e,t,i){var r=e.display,c=e.options.lineNumbers,P=r.lineDiv,V=P.firstChild;function Z(Fe){var Ue=Fe.nextSibling;return n&&s&&e.display.currentWheelTarget==Fe?Fe.style.display="none":Fe.parentNode.removeChild(Fe),Ue}for(var te=r.view,ie=r.viewFrom,ye=0;ye<te.length;ye++){var Ee=te[ye];if(!Ee.hidden)if(!Ee.node||Ee.node.parentNode!=P){var ke=No(e,Ee,ie,i);P.insertBefore(ke,V)}else{for(;V!=Ee.node;)V=Z(V);var De=c&&t!=null&&t<=ie&&Ee.lineNumber;Ee.changes&&(oe(Ee.changes,"gutter")>-1&&(De=!1),Ya(e,Ee,ie,i)),De&&(R(Ee.lineNumber),Ee.lineNumber.appendChild(document.createTextNode(Ht(e.options,ie)))),V=Ee.node.nextSibling}ie+=Ee.size}for(;V;)V=Z(V)}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+Fn(e)+"px"}function Ss(e){var t=e.display,i=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var r=_a(t)-t.scroller.scrollLeft+e.doc.scrollLeft,c=t.gutters.offsetWidth,P=r+"px",V=0;V<i.length;V++)if(!i[V].hidden){e.options.fixedGutter&&(i[V].gutter&&(i[V].gutter.style.left=P),i[V].gutterBackground&&(i[V].gutterBackground.style.left=P));var Z=i[V].alignable;if(Z)for(var te=0;te<Z.length;te++)Z[te].style.left=P}e.options.fixedGutter&&(t.gutters.style.left=r+c+"px")}function Cs(e){if(!e.options.lineNumbers)return!1;var t=e.doc,i=Ht(e.options,t.first+t.size-1),r=e.display;if(i.length!=r.lineNumChars){var c=r.measure.appendChild(f("div",[f("div",i)],"CodeMirror-linenumber CodeMirror-gutter-elt")),P=c.firstChild.offsetWidth,V=c.offsetWidth-P;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(P,r.lineGutter.offsetWidth-V)+1,r.lineNumWidth=r.lineNumInnerWidth+V,r.lineNumChars=r.lineNumInnerWidth?i.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",Ra(e.display),!0}return!1}function La(e,t){for(var i=[],r=!1,c=0;c<e.length;c++){var P=e[c],V=null;if(typeof P!="string"&&(V=P.style,P=P.className),P=="CodeMirror-linenumbers")if(t)r=!0;else continue;i.push({className:P,style:V})}return t&&!r&&i.push({className:"CodeMirror-linenumbers",style:null}),i}function As(e){var t=e.gutters,i=e.gutterSpecs;R(t),e.lineGutter=null;for(var r=0;r<i.length;++r){var c=i[r],P=c.className,V=c.style,Z=t.appendChild(f("div",null,"CodeMirror-gutter "+P));V&&(Z.style.cssText=V),P=="CodeMirror-linenumbers"&&(e.lineGutter=Z,Z.style.width=(e.lineNumWidth||1)+"px")}t.style.display=i.length?"":"none",Ra(e)}function di(e){As(e.display),gn(e),Ss(e)}function hl(e,t,i,r){var c=this;this.input=i,c.scrollbarFiller=f("div",null,"CodeMirror-scrollbar-filler"),c.scrollbarFiller.setAttribute("cm-not-content","true"),c.gutterFiller=f("div",null,"CodeMirror-gutter-filler"),c.gutterFiller.setAttribute("cm-not-content","true"),c.lineDiv=w("div",null,"CodeMirror-code"),c.selectionDiv=f("div",null,null,"position: relative; z-index: 1"),c.cursorDiv=f("div",null,"CodeMirror-cursors"),c.measure=f("div",null,"CodeMirror-measure"),c.lineMeasure=f("div",null,"CodeMirror-measure"),c.lineSpace=w("div",[c.measure,c.lineMeasure,c.selectionDiv,c.cursorDiv,c.lineDiv],null,"position: relative; outline: none");var P=w("div",[c.lineSpace],"CodeMirror-lines");c.mover=f("div",[P],null,"position: relative"),c.sizer=f("div",[c.mover],"CodeMirror-sizer"),c.sizerWidth=null,c.heightForcer=f("div",null,null,"position: absolute; height: "+fe+"px; width: 1px;"),c.gutters=f("div",null,"CodeMirror-gutters"),c.lineGutter=null,c.scroller=f("div",[c.sizer,c.heightForcer,c.gutters],"CodeMirror-scroll"),c.scroller.setAttribute("tabIndex","-1"),c.wrapper=f("div",[c.scrollbarFiller,c.gutterFiller,c.scroller],"CodeMirror"),K&&G<8&&(c.gutters.style.zIndex=-1,c.scroller.style.paddingRight=0),!n&&!(N&&h)&&(c.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(c.wrapper):e(c.wrapper)),c.viewFrom=c.viewTo=t.first,c.reportedViewFrom=c.reportedViewTo=t.first,c.view=[],c.renderedView=null,c.externalMeasured=null,c.viewOffset=0,c.lastWrapHeight=c.lastWrapWidth=0,c.updateLineNumbers=null,c.nativeBarWidth=c.barHeight=c.barWidth=0,c.scrollbarsClipped=!1,c.lineNumWidth=c.lineNumInnerWidth=c.lineNumChars=null,c.alignWidgets=!1,c.cachedCharWidth=c.cachedTextHeight=c.cachedPaddingH=null,c.maxLine=null,c.maxLineLength=0,c.maxLineChanged=!1,c.wheelDX=c.wheelDY=c.wheelStartX=c.wheelStartY=null,c.shift=!1,c.selForContextMenu=null,c.activeTouch=null,c.gutterSpecs=La(r.gutters,r.lineNumbers),As(c),i.init(c)}var Ki=0,wn=null;K?wn=-.53:N?wn=15:v?wn=-.7:m&&(wn=-1/3);function Rs(e){var t=e.wheelDeltaX,i=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),i==null&&e.detail&&e.axis==e.VERTICAL_AXIS?i=e.detail:i==null&&(i=e.wheelDelta),{x:t,y:i}}function cl(e){var t=Rs(e);return t.x*=wn,t.y*=wn,t}function Os(e,t){var i=Rs(t),r=i.x,c=i.y,P=e.display,V=P.scroller,Z=V.scrollWidth>V.clientWidth,te=V.scrollHeight>V.clientHeight;if(!(r&&Z||c&&te))return;if(c&&s&&n){e:for(var ie=t.target,ye=P.view;ie!=V;ie=ie.parentNode)for(var Ee=0;Ee<ye.length;Ee++)if(ye[Ee].node==ie){e.display.currentWheelTarget=ie;break e}}if(r&&!N&&!p&&wn!=null){c&&te&&li(e,Math.max(0,V.scrollTop+c*wn)),pr(e,Math.max(0,V.scrollLeft+r*wn)),(!c||c&&te)&&re(t),P.wheelStartX=null;return}if(c&&wn!=null){var ke=c*wn,De=e.doc.scrollTop,Fe=De+P.wrapper.clientHeight;ke<0?De=Math.max(0,De+ke-50):Fe=Math.min(e.doc.height,Fe+ke+50),Aa(e,{top:De,bottom:Fe})}Ki<20&&(P.wheelStartX==null?(P.wheelStartX=V.scrollLeft,P.wheelStartY=V.scrollTop,P.wheelDX=r,P.wheelDY=c,setTimeout(function(){if(P.wheelStartX==null)return;var Ue=V.scrollLeft-P.wheelStartX,Xe=V.scrollTop-P.wheelStartY,Je=Xe&&P.wheelDY&&Xe/P.wheelDY||Ue&&P.wheelDX&&Ue/P.wheelDX;if(P.wheelStartX=P.wheelStartY=null,!Je)return;wn=(wn*Ki+Je)/(Ki+1),++Ki},200)):(P.wheelDX+=r,P.wheelDY+=c))}var Sn=function(e,t){this.ranges=e,this.primIndex=t};Sn.prototype.primary=function(){return this.ranges[this.primIndex]},Sn.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 i=this.ranges[t],r=e.ranges[t];if(!rr(i.anchor,r.anchor)||!rr(i.head,r.head))return!1}return!0},Sn.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Mt(_r(this.ranges[t].anchor),_r(this.ranges[t].head));return new Sn(e,this.primIndex)},Sn.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Sn.prototype.contains=function(e,t){t||(t=e);for(var i=0;i<this.ranges.length;i++){var r=this.ranges[i];if(mt(t,r.from())>=0&&mt(e,r.to())<=0)return i}return-1};var Mt=function(e,t){this.anchor=e,this.head=t};Mt.prototype.from=function(){return ir(this.anchor,this.head)},Mt.prototype.to=function(){return Er(this.anchor,this.head)},Mt.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Mn(e,t,i){var r=e&&e.options.selectionsMayTouch,c=t[i];t.sort(function(ke,De){return mt(ke.from(),De.from())}),i=oe(t,c);for(var P=1;P<t.length;P++){var V=t[P],Z=t[P-1],te=mt(Z.to(),V.from());if(r&&!V.empty()?te>0:te>=0){var ie=ir(Z.from(),V.from()),ye=Er(Z.to(),V.to()),Ee=Z.empty()?V.from()==V.head:Z.from()==Z.head;P<=i&&--i,t.splice(--P,2,new Mt(Ee?ye:ie,Ee?ie:ye))}}return new Sn(t,i)}function Qn(e,t){return new Sn([new Mt(e,t||e)],0)}function Zn(e){return e.text?He(e.from.line+e.text.length-1,b(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Ls(e,t){if(mt(e,t.from)<0)return e;if(mt(e,t.to)<=0)return Zn(t);var i=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=Zn(t).ch-t.to.ch),He(i,r)}function Ia(e,t){for(var i=[],r=0;r<e.sel.ranges.length;r++){var c=e.sel.ranges[r];i.push(new Mt(Ls(c.anchor,t),Ls(c.head,t)))}return Mn(e.cm,i,e.sel.primIndex)}function Is(e,t,i){return e.line==t.line?He(i.line,e.ch-t.ch+i.ch):He(i.line+(e.line-t.line),e.ch)}function dl(e,t,i){for(var r=[],c=He(e.first,0),P=c,V=0;V<t.length;V++){var Z=t[V],te=Is(Z.from,c,P),ie=Is(Zn(Z),c,P);if(c=Z.to,P=ie,i=="around"){var ye=e.sel.ranges[V],Ee=mt(ye.head,ye.anchor)<0;r[V]=new Mt(Ee?ie:te,Ee?te:ie)}else r[V]=new Mt(te,te)}return new Sn(r,e.sel.primIndex)}function Da(e){e.doc.mode=Pt(e.options,e.doc.modeOption),fi(e)}function fi(e){e.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,ci(e,100),e.state.modeGen++,e.curOp&&gn(e)}function Ds(e,t){return t.from.ch==0&&t.to.ch==0&&b(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function ka(e,t,i,r){function c(it){return i?i[it]:null}function P(it,Qe,st){ua(it,Qe,st,r),rn(it,"change",it,t)}function V(it,Qe){for(var st=[],ft=it;ft<Qe;++ft)st.push(new ur(ie[ft],c(ft),r));return st}var Z=t.from,te=t.to,ie=t.text,ye=qe(e,Z.line),Ee=qe(e,te.line),ke=b(ie),De=c(ie.length-1),Fe=te.line-Z.line;if(t.full)e.insert(0,V(0,ie.length)),e.remove(ie.length,e.size-ie.length);else if(Ds(e,t)){var Ue=V(0,ie.length-1);P(Ee,Ee.text,De),Fe&&e.remove(Z.line,Fe),Ue.length&&e.insert(Z.line,Ue)}else if(ye==Ee)if(ie.length==1)P(ye,ye.text.slice(0,Z.ch)+ke+ye.text.slice(te.ch),De);else{var Xe=V(1,ie.length-1);Xe.push(new ur(ke+ye.text.slice(te.ch),De,r)),P(ye,ye.text.slice(0,Z.ch)+ie[0],c(0)),e.insert(Z.line+1,Xe)}else if(ie.length==1)P(ye,ye.text.slice(0,Z.ch)+ie[0]+Ee.text.slice(te.ch),c(0)),e.remove(Z.line+1,Fe);else{P(ye,ye.text.slice(0,Z.ch)+ie[0],c(0)),P(Ee,ke+Ee.text.slice(te.ch),De);var Je=V(1,ie.length-1);Fe>1&&e.remove(Z.line+1,Fe-1),e.insert(Z.line+1,Je)}rn(e,"change",e,t)}function qn(e,t,i){function r(c,P,V){if(c.linked)for(var Z=0;Z<c.linked.length;++Z){var te=c.linked[Z];if(te.doc==P)continue;var ie=V&&te.sharedHist;if(i&&!ie)continue;t(te.doc,ie),r(te.doc,c,ie)}}r(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||Ni(e),e.options.mode=t.modeOption,gn(e)}function Ms(e){(e.doc.direction=="rtl"?U:S)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){En(e,function(){Ms(e),gn(e)})}function Vi(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 i={from:_r(t.from),to:Zn(t),text:Ot(e,t.from,t.to)};return Fs(e,i,t.from.line,t.to.line+1),qn(e,function(r){return Fs(r,i,t.from.line,t.to.line+1)},!0),i}function Ps(e){for(;e.length;){var t=b(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return Ps(e.done),b(e.done);if(e.done.length&&!b(e.done).ranges)return b(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),b(e.done)}function Ns(e,t,i,r){var c=e.history;c.undone.length=0;var P=+new Date,V,Z;if((c.lastOp==r||c.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&c.lastModTime>P-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(V=pl(c,c.lastOp==r)))Z=b(V.changes),mt(t.from,t.to)==0&&mt(t.from,Z.to)==0?Z.to=Zn(t):V.changes.push(Ma(e,t));else{var te=b(c.done);for((!te||!te.ranges)&&Xi(e.sel,c.done),V={changes:[Ma(e,t)],generation:c.generation},c.done.push(V);c.done.length>c.undoDepth;)c.done.shift(),c.done[0].ranges||c.done.shift()}c.done.push(i),c.generation=++c.maxGeneration,c.lastModTime=c.lastSelTime=P,c.lastOp=c.lastSelOp=r,c.lastOrigin=c.lastSelOrigin=t.origin,Z||ce(e,"historyAdded")}function ml(e,t,i,r){var c=t.charAt(0);return c=="*"||c=="+"&&i.ranges.length==r.ranges.length&&i.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,i,r){var c=e.history,P=r&&r.origin;i==c.lastSelOp||P&&c.lastSelOrigin==P&&(c.lastModTime==c.lastSelTime&&c.lastOrigin==P||ml(e,P,b(c.done),t))?c.done[c.done.length-1]=t:Xi(t,c.done),c.lastSelTime=+new Date,c.lastSelOrigin=P,c.lastSelOp=i,r&&r.clearRedo!==!1&&Ps(c.undone)}function Xi(e,t){var i=b(t);i&&i.ranges&&i.equals(e)||t.push(e)}function Fs(e,t,i,r){var c=t["spans_"+e.id],P=0;e.iter(Math.max(e.first,i),Math.min(e.first+e.size,r),function(V){V.markedSpans&&((c||(c=t["spans_"+e.id]={}))[P]=V.markedSpans),++P})}function vl(e){if(!e)return null;for(var t,i=0;i<e.length;++i)e[i].marker.explicitlyCleared?t||(t=e.slice(0,i)):t&&t.push(e[i]);return t?t.length?t:null:e}function yl(e,t){var i=t["spans_"+e.id];if(!i)return null;for(var r=[],c=0;c<t.text.length;++c)r.push(vl(i[c]));return r}function Us(e,t){var i=yl(e,t),r=wr(e,t);if(!i)return r;if(!r)return i;for(var c=0;c<i.length;++c){var P=i[c],V=r[c];if(P&&V){e:for(var Z=0;Z<V.length;++Z){for(var te=V[Z],ie=0;ie<P.length;++ie)if(P[ie].marker==te.marker)continue e;P.push(te)}}else V&&(i[c]=V)}return i}function Pr(e,t,i){for(var r=[],c=0;c<e.length;++c){var P=e[c];if(P.ranges){r.push(i?Sn.prototype.deepCopy.call(P):P);continue}var V=P.changes,Z=[];r.push({changes:Z});for(var te=0;te<V.length;++te){var ie=V[te],ye=void 0;if(Z.push({from:ie.from,to:ie.to,text:ie.text}),t)for(var Ee in ie)(ye=Ee.match(/^spans_(\d+)$/))&&(oe(t,Number(ye[1]))>-1&&(b(Z)[Ee]=ie[Ee],delete ie[Ee]))}}return r}function Pa(e,t,i,r){if(r){var c=e.anchor;if(i){var P=mt(t,c)<0;P!=mt(i,c)<0?(c=t,t=i):P!=mt(t,i)<0&&(t=i)}return new Mt(c,t)}else return new Mt(i||t,t)}function Yi(e,t,i,r,c){c==null&&(c=e.cm&&(e.cm.display.shift||e.extend)),ln(e,new Sn([Pa(e.sel.primary(),t,i,c)],0),r)}function Bs(e,t,i){for(var r=[],c=e.cm&&(e.cm.display.shift||e.extend),P=0;P<e.sel.ranges.length;P++)r[P]=Pa(e.sel.ranges[P],t[P],null,c);var V=Mn(e.cm,r,e.sel.primIndex);ln(e,V,i)}function Na(e,t,i,r){var c=e.sel.ranges.slice(0);c[t]=i,ln(e,Mn(e.cm,c,e.sel.primIndex),r)}function js(e,t,i,r){ln(e,Qn(t,i),r)}function bl(e,t,i){var r={ranges:t.ranges,update:function(c){this.ranges=[];for(var P=0;P<c.length;P++)this.ranges[P]=new Mt(bt(e,c[P].anchor),bt(e,c[P].head))},origin:i&&i.origin};return ce(e,"beforeSelectionChange",e,r),e.cm&&ce(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?Mn(e.cm,r.ranges,r.ranges.length-1):t}function Hs(e,t,i){var r=e.history.done,c=b(r);c&&c.ranges?(r[r.length-1]=t,$i(e,t,i)):ln(e,t,i)}function ln(e,t,i){$i(e,t,i),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,i)}function $i(e,t,i){(se(e,"beforeSelectionChange")||e.cm&&se(e.cm,"beforeSelectionChange"))&&(t=bl(e,t,i));var r=i&&i.bias||(mt(t.primary().head,e.sel.primary().head)<0?-1:1);Ws(e,zs(e,t,r,!0)),!(i&&i.scroll===!1)&&e.cm&&kr(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,ne(e.cm)),rn(e,"cursorActivity",e)}function Gs(e){Ws(e,zs(e,e.sel,null,!1))}function zs(e,t,i,r){for(var c,P=0;P<t.ranges.length;P++){var V=t.ranges[P],Z=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[P],te=Ji(e,V.anchor,Z&&Z.anchor,i,r),ie=Ji(e,V.head,Z&&Z.head,i,r);(c||te!=V.anchor||ie!=V.head)&&(c||(c=t.ranges.slice(0,P)),c[P]=new Mt(te,ie))}return c?Mn(e.cm,c,t.primIndex):t}function Nr(e,t,i,r,c){var P=qe(e,t.line);if(P.markedSpans)for(var V=0;V<P.markedSpans.length;++V){var Z=P.markedSpans[V],te=Z.marker,ie="selectLeft"in te?!te.selectLeft:te.inclusiveLeft,ye="selectRight"in te?!te.selectRight:te.inclusiveRight;if((Z.from==null||(ie?Z.from<=t.ch:Z.from<t.ch))&&(Z.to==null||(ye?Z.to>=t.ch:Z.to>t.ch))){if(c&&(ce(te,"beforeCursorEnter"),te.explicitlyCleared))if(P.markedSpans){--V;continue}else break;if(!te.atomic)continue;if(i){var Ee=te.find(r<0?1:-1),ke=void 0;if((r<0?ye:ie)&&(Ee=Ks(e,Ee,-r,Ee&&Ee.line==t.line?P:null)),Ee&&Ee.line==t.line&&(ke=mt(Ee,i))&&(r<0?ke<0:ke>0))return Nr(e,Ee,t,r,c)}var De=te.find(r<0?-1:1);return(r<0?ie:ye)&&(De=Ks(e,De,r,De.line==t.line?P:null)),De?Nr(e,De,t,r,c):null}}return t}function Ji(e,t,i,r,c){var P=r||1,V=Nr(e,t,i,P,c)||!c&&Nr(e,t,i,P,!0)||Nr(e,t,i,-P,c)||!c&&Nr(e,t,i,-P,!0);return V||(e.cantEdit=!0,He(e.first,0))}function Ks(e,t,i,r){return i<0&&t.ch==0?t.line>e.first?bt(e,He(t.line-1)):null:i>0&&t.ch==(r||qe(e,t.line)).text.length?t.line<e.first+e.size-1?He(t.line+1,0):null:new He(t.line,t.ch+i)}function Vs(e){e.setSelection(He(e.firstLine(),0),He(e.lastLine()),be)}function Xs(e,t,i){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return i&&(r.update=function(c,P,V,Z){c&&(r.from=bt(e,c)),P&&(r.to=bt(e,P)),V&&(r.text=V),Z!==void 0&&(r.origin=Z)}),ce(e,"beforeChange",e,r),e.cm&&ce(e.cm,"beforeChange",e.cm,r),r.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function Fr(e,t,i){if(e.cm){if(!e.cm.curOp)return Zt(e.cm,Fr)(e,t,i);if(e.cm.state.suppressEdits)return}if((se(e,"beforeChange")||e.cm&&se(e.cm,"beforeChange"))&&(t=Xs(e,t,!0),!t))return;var r=Qr&&!i&&ki(e,t.from,t.to);if(r)for(var c=r.length-1;c>=0;--c)Ys(e,{from:r[c].from,to:r[c].to,text:c?[""]:t.text,origin:t.origin});else Ys(e,t)}function Ys(e,t){if(t.text.length==1&&t.text[0]==""&&mt(t.from,t.to)==0)return;var i=Ia(e,t);Ns(e,t,i,e.cm?e.cm.curOp.id:NaN),pi(e,t,i,wr(e,t));var r=[];qn(e,function(c,P){!P&&oe(r,c.history)==-1&&(Zs(c.history,t),r.push(c.history)),pi(c,t,null,wr(c,t))})}function Qi(e,t,i){var r=e.cm&&e.cm.state.suppressEdits;if(r&&!i)return;for(var c=e.history,P,V=e.sel,Z=t=="undo"?c.done:c.undone,te=t=="undo"?c.undone:c.done,ie=0;ie<Z.length&&!(P=Z[ie],i?P.ranges&&!P.equals(e.sel):!P.ranges);ie++);if(ie==Z.length)return;for(c.lastOrigin=c.lastSelOrigin=null;;)if(P=Z.pop(),P.ranges){if(Xi(P,te),i&&!P.equals(e.sel)){ln(e,P,{clearRedo:!1});return}V=P}else if(r){Z.push(P);return}else break;var ye=[];Xi(V,te),te.push({changes:ye,generation:c.generation}),c.generation=P.generation||++c.maxGeneration;for(var Ee=se(e,"beforeChange")||e.cm&&se(e.cm,"beforeChange"),ke=function(Ue){var Xe=P.changes[Ue];if(Xe.origin=t,Ee&&!Xs(e,Xe,!1))return Z.length=0,{};ye.push(Ma(e,Xe));var Je=Ue?Ia(e,Xe):b(Z);pi(e,Xe,Je,Us(e,Xe)),!Ue&&e.cm&&e.cm.scrollIntoView({from:Xe.from,to:Zn(Xe)});var it=[];qn(e,function(Qe,st){!st&&oe(it,Qe.history)==-1&&(Zs(Qe.history,Xe),it.push(Qe.history)),pi(Qe,Xe,null,Us(Qe,Xe))})},De=P.changes.length-1;De>=0;--De){var Fe=ke(De);if(Fe)return Fe.v}}function $s(e,t){if(t==0)return;if(e.first+=t,e.sel=new Sn(I(e.sel.ranges,function(c){return new Mt(He(c.anchor.line+t,c.anchor.ch),He(c.head.line+t,c.head.ch))}),e.sel.primIndex),e.cm){gn(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,r=i.viewFrom;r<i.viewTo;r++)$n(e.cm,r,"gutter")}}function pi(e,t,i,r){if(e.cm&&!e.cm.curOp)return Zt(e.cm,pi)(e,t,i,r);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 c=t.text.length-1-(e.first-t.from.line);$s(e,c),t={from:He(e.first,0),to:He(t.to.line+c,t.to.ch),text:[b(t.text)],origin:t.origin}}var P=e.lastLine();t.to.line>P&&(t={from:t.from,to:He(P,qe(e,P).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Ot(e,t.from,t.to),i||(i=Ia(e,t)),e.cm?_l(e.cm,t,r):ka(e,t,r),$i(e,i,be),e.cantEdit&&Ji(e,He(e.firstLine(),0))&&(e.cantEdit=!1)}function _l(e,t,i){var r=e.doc,c=e.display,P=t.from,V=t.to,Z=!1,te=P.line;e.options.lineWrapping||(te=gt(Tn(qe(r,P.line))),r.iter(te,V.line+1,function(De){if(De==c.maxLine)return Z=!0,!0})),r.sel.contains(t.from,t.to)>-1&&ne(e),ka(r,t,i,ds(e)),e.options.lineWrapping||(r.iter(te,P.line+t.text.length,function(De){var Fe=ti(De);Fe>c.maxLineLength&&(c.maxLine=De,c.maxLineLength=Fe,c.maxLineChanged=!0,Z=!1)}),Z&&(e.curOp.updateMaxLine=!0)),aa(r,P.line),ci(e,400);var ie=t.text.length-(V.line-P.line)-1;t.full?gn(e):P.line==V.line&&t.text.length==1&&!Ds(e.doc,t)?$n(e,P.line,"text"):gn(e,P.line,V.line+1,ie);var ye=se(e,"changes"),Ee=se(e,"change");if(Ee||ye){var ke={from:P,to:V,text:t.text,removed:t.removed,origin:t.origin};Ee&&rn(e,"change",e,ke),ye&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(ke)}e.display.selForContextMenu=null}function Ur(e,t,i,r,c){var P;r||(r=i),mt(r,i)<0&&(P=[r,i],i=P[0],r=P[1]),typeof t=="string"&&(t=e.splitLines(t)),Fr(e,{from:i,to:r,text:t,origin:c})}function Js(e,t,i,r){i<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function Qs(e,t,i,r){for(var c=0;c<e.length;++c){var P=e[c],V=!0;if(P.ranges){P.copied||(P=e[c]=P.deepCopy(),P.copied=!0);for(var Z=0;Z<P.ranges.length;Z++)Js(P.ranges[Z].anchor,t,i,r),Js(P.ranges[Z].head,t,i,r);continue}for(var te=0;te<P.changes.length;++te){var ie=P.changes[te];if(i<ie.from.line)ie.from=He(ie.from.line+r,ie.from.ch),ie.to=He(ie.to.line+r,ie.to.ch);else if(t<=ie.to.line){V=!1;break}}V||(e.splice(0,c+1),c=0)}}function Zs(e,t){var i=t.from.line,r=t.to.line,c=t.text.length-(r-i)-1;Qs(e.done,i,r,c),Qs(e.undone,i,r,c)}function mi(e,t,i,r){var c=t,P=t;return typeof t=="number"?P=qe(e,xr(e,t)):c=gt(t),c==null?null:(r(P,c)&&e.cm&&$n(e.cm,c,i),P)}function gi(e){this.lines=e,this.parent=null;for(var t=0,i=0;i<e.length;++i)e[i].parent=this,t+=e[i].height;this.height=t}gi.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var i=e,r=e+t;i<r;++i){var c=this.lines[i];this.height-=c.height,ut(c),rn(c,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,i){this.height+=i,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,i){for(var r=e+t;e<r;++e)if(i(this.lines[e]))return!0}};function vi(e){this.children=e;for(var t=0,i=0,r=0;r<e.length;++r){var c=e[r];t+=c.chunkSize(),i+=c.height,c.parent=this}this.size=t,this.height=i,this.parent=null}vi.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var i=0;i<this.children.length;++i){var r=this.children[i],c=r.chunkSize();if(e<c){var P=Math.min(t,c-e),V=r.height;if(r.removeInner(e,P),this.height-=V-r.height,c==P&&(this.children.splice(i--,1),r.parent=null),(t-=P)==0)break;e=0}else e-=c}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof gi))){var Z=[];this.collapse(Z),this.children=[new gi(Z)],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,i){this.size+=t.length,this.height+=i;for(var r=0;r<this.children.length;++r){var c=this.children[r],P=c.chunkSize();if(e<=P){if(c.insertInner(e,t,i),c.lines&&c.lines.length>50){for(var V=c.lines.length%25+25,Z=V;Z<c.lines.length;){var te=new gi(c.lines.slice(Z,Z+=25));c.height-=te.height,this.children.splice(++r,0,te),te.parent=this}c.lines=c.lines.slice(0,V),this.maybeSpill()}break}e-=P}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),i=new vi(t);if(e.parent){e.size-=i.size,e.height-=i.height;var c=oe(e.parent.children,e);e.parent.children.splice(c+1,0,i)}else{var r=new vi(e.children);r.parent=e,e.children=[r,i],e=r}i.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,i){for(var r=0;r<this.children.length;++r){var c=this.children[r],P=c.chunkSize();if(e<P){var V=Math.min(t,P-e);if(c.iterN(e,V,i))return!0;if((t-=V)==0)break;e=0}else e-=P}}};var yi=function(e,t,i){if(i)for(var r in i)i.hasOwnProperty(r)&&(this[r]=i[r]);this.doc=e,this.node=t};yi.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,i=this.line,r=gt(i);if(r==null||!t)return;for(var c=0;c<t.length;++c)t[c]==this&&t.splice(c--,1);t.length||(i.widgets=null);var P=ii(this);pt(i,Math.max(0,i.height-P)),e&&(En(e,function(){qs(e,i,-P),$n(e,r,"widget")}),rn(e,"lineWidgetCleared",e,this,r))},yi.prototype.changed=function(){var e=this,t=this.height,i=this.doc.cm,r=this.line;this.height=null;var c=ii(this)-t;if(!c)return;Nn(this.doc,r)||pt(r,r.height+c),i&&En(i,function(){i.curOp.forceUpdate=!0,qs(i,r,c),rn(i,"lineWidgetChanged",i,e,gt(r))})},de(yi);function qs(e,t,i){Dn(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Sa(e,i)}function El(e,t,i,r){var c=new yi(e,i,r),P=e.cm;return P&&c.noHScroll&&(P.display.alignWidgets=!0),mi(e,t,"widget",function(V){var Z=V.widgets||(V.widgets=[]);if(c.insertAt==null?Z.push(c):Z.splice(Math.min(Z.length-1,Math.max(0,c.insertAt)),0,c),c.line=V,P&&!Nn(e,V)){var te=Dn(V)<e.scrollTop;pt(V,V.height+ii(c)),te&&Sa(P,c.height),P.curOp.forceUpdate=!0}return!0}),P&&rn(P,"lineWidgetAdded",P,c,typeof t=="number"?t:gt(t)),c}var eo=0,er=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++eo};er.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&gr(e),se(this,"clear")){var i=this.find();i&&rn(this,"clear",i.from,i.to)}for(var r=null,c=null,P=0;P<this.lines.length;++P){var V=this.lines[P],Z=In(V.markedSpans,this);e&&!this.collapsed?$n(e,gt(V),"text"):e&&(Z.to!=null&&(c=gt(V)),Z.from!=null&&(r=gt(V))),V.markedSpans=Zr(V.markedSpans,Z),Z.from==null&&this.collapsed&&!Nn(this.doc,V)&&e&&pt(V,Lr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var te=0;te<this.lines.length;++te){var ie=Tn(this.lines[te]),ye=ti(ie);ye>e.display.maxLineLength&&(e.display.maxLine=ie,e.display.maxLineLength=ye,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&gn(e,r,c+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Gs(e.doc)),e&&rn(e,"markerCleared",e,this,r,c),t&&vr(e),this.parent&&this.parent.clear()},er.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var i,r,c=0;c<this.lines.length;++c){var P=this.lines[c],V=In(P.markedSpans,this);if(V.from!=null&&(i=He(t?P:gt(P),V.from),e==-1))return i;if(V.to!=null&&(r=He(t?P:gt(P),V.to),e==1))return r}return i&&{from:i,to:r}},er.prototype.changed=function(){var e=this,t=this.find(-1,!0),i=this,r=this.doc.cm;if(!t||!r)return;En(r,function(){var c=t.line,P=gt(t.line),V=fa(r,P);if(V&&(is(V),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!Nn(i.doc,c)&&i.height!=null){var Z=i.height;i.height=null;var te=ii(i)-Z;te&&pt(c,c.height+te)}rn(r,"markerChanged",r,e)})},er.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||oe(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},er.prototype.detachLine=function(e){if(this.lines.splice(oe(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},de(er);function Br(e,t,i,r,c){if(r&&r.shared)return xl(e,t,i,r,c);if(e.cm&&!e.cm.curOp)return Zt(e.cm,Br)(e,t,i,r,c);var P=new er(e,c),V=mt(t,i);if(r&&g(r,P,!1),V>0||V==0&&P.clearWhenEmpty!==!1)return P;if(P.replacedWith&&(P.collapsed=!0,P.widgetNode=w("span",[P.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||P.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(P.widgetNode.insertLeft=!0)),P.collapsed){if(Mi(e,t.line,t,i,P)||t.line!=i.line&&Mi(e,i.line,t,i,P))throw new Error("Inserting collapsed marker partially overlapping an existing one");sa()}P.addToHistory&&Ns(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var Z=t.line,te=e.cm,ie;if(e.iter(Z,i.line+1,function(Ee){te&&P.collapsed&&!te.options.lineWrapping&&Tn(Ee)==te.display.maxLine&&(ie=!0),P.collapsed&&Z!=t.line&&pt(Ee,0),oa(Ee,new sr(P,Z==t.line?t.ch:null,Z==i.line?i.ch:null)),++Z}),P.collapsed&&e.iter(t.line,i.line+1,function(Ee){Nn(e,Ee)&&pt(Ee,0)}),P.clearOnEnter&&Me(P,"beforeCursorEnter",function(){return P.clear()}),P.readOnly&&(Xn(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),P.collapsed&&(P.id=++eo,P.atomic=!0),te){if(ie&&(te.curOp.updateMaxLine=!0),P.collapsed)gn(te,t.line,i.line+1);else if(P.className||P.startStyle||P.endStyle||P.css||P.attributes||P.title)for(var ye=t.line;ye<=i.line;ye++)$n(te,ye,"text");P.atomic&&Gs(te.doc),rn(te,"markerAdded",te,P)}return P}var bi=function(e,t){this.markers=e,this.primary=t;for(var i=0;i<e.length;++i)e[i].parent=this};bi.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();rn(this,"clear")},bi.prototype.find=function(e,t){return this.primary.find(e,t)},de(bi);function xl(e,t,i,r,c){r=g(r),r.shared=!1;var P=[Br(e,t,i,r,c)],V=P[0],Z=r.widgetNode;return qn(e,function(te){Z&&(r.widgetNode=Z.cloneNode(!0)),P.push(Br(te,bt(te,t),bt(te,i),r,c));for(var ie=0;ie<te.linked.length;++ie)if(te.linked[ie].isParent)return;V=b(P)}),new bi(P,V)}function to(e){return e.findMarks(He(e.first,0),e.clipPos(He(e.lastLine())),function(t){return t.parent})}function Tl(e,t){for(var i=0;i<t.length;i++){var r=t[i],c=r.find(),P=e.clipPos(c.from),V=e.clipPos(c.to);if(mt(P,V)){var Z=Br(e,P,V,r.primary,r.primary.type);r.markers.push(Z),Z.parent=r}}}function wl(e){for(var t=function(r){var c=e[r],P=[c.primary.doc];qn(c.primary.doc,function(te){return P.push(te)});for(var V=0;V<c.markers.length;V++){var Z=c.markers[V];oe(P,Z.doc)==-1&&(Z.parent=null,c.markers.splice(V--,1))}},i=0;i<e.length;i++)t(i)}var Sl=0,vn=function(e,t,i,r,c){if(!(this instanceof vn))return new vn(e,t,i,r,c);i==null&&(i=0),vi.call(this,[new gi([new ur("",null)])]),this.first=i,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=i;var P=He(i,0);this.sel=Qn(P),this.history=new Vi(null),this.id=++Sl,this.modeOption=t,this.lineSep=r,this.direction=c=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),ka(this,{from:P,to:P,text:e}),ln(this,Qn(P),be)};vn.prototype=z(vi.prototype,{constructor:vn,iter:function(e,t,i){i?this.iterN(e-this.first,t-e,i):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var i=0,r=0;r<t.length;++r)i+=t[r].height;this.insertInner(e-this.first,t,i)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=It(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:qt(function(e){var t=He(this.first,0),i=this.first+this.size-1;Fr(this,{from:t,to:He(i,qe(this,i).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&oi(this.cm,0,0),ln(this,Qn(t),be)}),replaceRange:function(e,t,i,r){t=bt(this,t),i=i?bt(this,i):t,Ur(this,e,t,i,r)},getRange:function(e,t,i){var r=Ot(this,bt(this,e),bt(this,t));return i===!1?r:r.join(i||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(sn(this,e))return qe(this,e)},getLineNumber:function(e){return gt(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=qe(this,e)),Tn(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return bt(this,e)},getCursor:function(e){var t=this.sel.primary(),i;return e==null||e=="head"?i=t.head:e=="anchor"?i=t.anchor:e=="end"||e=="to"||e===!1?i=t.to():i=t.from(),i},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:qt(function(e,t,i){js(this,bt(this,typeof e=="number"?He(e,t||0):e),null,i)}),setSelection:qt(function(e,t,i){js(this,bt(this,e),bt(this,t||e),i)}),extendSelection:qt(function(e,t,i){Yi(this,bt(this,e),t&&bt(this,t),i)}),extendSelections:qt(function(e,t){Bs(this,Ve(this,e),t)}),extendSelectionsBy:qt(function(e,t){var i=I(this.sel.ranges,e);Bs(this,Ve(this,i),t)}),setSelections:qt(function(e,t,i){if(!e.length)return;for(var r=[],c=0;c<e.length;c++)r[c]=new Mt(bt(this,e[c].anchor),bt(this,e[c].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),ln(this,Mn(this.cm,r,t),i)}),addSelection:qt(function(e,t,i){var r=this.sel.ranges.slice(0);r.push(new Mt(bt(this,e),bt(this,t||e))),ln(this,Mn(this.cm,r,r.length-1),i)}),getSelection:function(e){for(var t=this.sel.ranges,i,r=0;r<t.length;r++){var c=Ot(this,t[r].from(),t[r].to());i=i?i.concat(c):c}return e===!1?i:i.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],i=this.sel.ranges,r=0;r<i.length;r++){var c=Ot(this,i[r].from(),i[r].to());e!==!1&&(c=c.join(e||this.lineSeparator())),t[r]=c}return t},replaceSelection:function(e,t,i){for(var r=[],c=0;c<this.sel.ranges.length;c++)r[c]=e;this.replaceSelections(r,t,i||"+input")},replaceSelections:qt(function(e,t,i){for(var r=[],c=this.sel,P=0;P<c.ranges.length;P++){var V=c.ranges[P];r[P]={from:V.from(),to:V.to(),text:this.splitLines(e[P]),origin:i}}for(var Z=t&&t!="end"&&dl(this,r,t),te=r.length-1;te>=0;te--)Fr(this,r[te]);Z?Hs(this,Z):this.cm&&kr(this.cm)}),undo:qt(function(){Qi(this,"undo")}),redo:qt(function(){Qi(this,"redo")}),undoSelection:qt(function(){Qi(this,"undo",!0)}),redoSelection:qt(function(){Qi(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,i=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var c=0;c<e.undone.length;c++)e.undone[c].ranges||++i;return{undo:t,redo:i}},clearHistory:function(){var e=this;this.history=new Vi(this.history.maxGeneration),qn(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:Pr(this.history.done),undone:Pr(this.history.undone)}},setHistory:function(e){var t=this.history=new Vi(this.history.maxGeneration);t.done=Pr(e.done.slice(0),null,!0),t.undone=Pr(e.undone.slice(0),null,!0)},setGutterMarker:qt(function(e,t,i){return mi(this,e,"gutter",function(r){var c=r.gutterMarkers||(r.gutterMarkers={});return c[t]=i,!i&&ue(c)&&(r.gutterMarkers=null),!0})}),clearGutter:qt(function(e){var t=this;this.iter(function(i){i.gutterMarkers&&i.gutterMarkers[e]&&mi(t,i,"gutter",function(){return i.gutterMarkers[e]=null,ue(i.gutterMarkers)&&(i.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!sn(this,e))return null;if(t=e,e=qe(this,e),!e)return null}else if(t=gt(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:qt(function(e,t,i){return mi(this,e,t=="gutter"?"gutter":"class",function(r){var c=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!r[c])r[c]=i;else{if(L(i).test(r[c]))return!1;r[c]+=" "+i}return!0})}),removeLineClass:qt(function(e,t,i){return mi(this,e,t=="gutter"?"gutter":"class",function(r){var c=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",P=r[c];if(P)if(i==null)r[c]=null;else{var V=P.match(L(i));if(!V)return!1;var Z=V.index+V[0].length;r[c]=P.slice(0,V.index)+(!V.index||Z==P.length?"":" ")+P.slice(Z)||null}else return!1;return!0})}),addLineWidget:qt(function(e,t,i){return El(this,e,t,i)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,i){return Br(this,bt(this,e),bt(this,t),i,i&&i.type||"range")},setBookmark:function(e,t){var i={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=bt(this,e),Br(this,e,e,i,"bookmark")},findMarksAt:function(e){e=bt(this,e);var t=[],i=qe(this,e.line).markedSpans;if(i)for(var r=0;r<i.length;++r){var c=i[r];(c.from==null||c.from<=e.ch)&&(c.to==null||c.to>=e.ch)&&t.push(c.marker.parent||c.marker)}return t},findMarks:function(e,t,i){e=bt(this,e),t=bt(this,t);var r=[],c=e.line;return this.iter(e.line,t.line+1,function(P){var V=P.markedSpans;if(V)for(var Z=0;Z<V.length;Z++){var te=V[Z];!(te.to!=null&&c==e.line&&e.ch>=te.to||te.from==null&&c!=e.line||te.from!=null&&c==t.line&&te.from>=t.ch)&&(!i||i(te.marker))&&r.push(te.marker.parent||te.marker)}++c}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var i=t.markedSpans;if(i)for(var r=0;r<i.length;++r)i[r].from!=null&&e.push(i[r].marker)}),e},posFromIndex:function(e){var t,i=this.first,r=this.lineSeparator().length;return this.iter(function(c){var P=c.text.length+r;if(P>e)return t=e,!0;e-=P,++i}),bt(this,He(i,t))},indexFromPos:function(e){e=bt(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var i=this.lineSeparator().length;return this.iter(this.first,e.line,function(r){t+=r.text.length+i}),t},copy:function(e){var t=new vn(It(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,i=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<i&&(i=e.to);var r=new vn(It(this,t,i),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Tl(r,to(this)),r},unlinkDoc:function(e){if(e instanceof Wt&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var i=this.linked[t];if(i.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),wl(to(this));break}if(e.history==this.history){var r=[e.id];qn(e,function(c){return r.push(c.id)},!0),e.history=new Vi(null),e.history.done=Pr(this.history.done,r),e.history.undone=Pr(this.history.undone,r)}},iterLinkedDocs:function(e){qn(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):lt(e)},lineSeparator:function(){return this.lineSep||`
|
|
`},setDirection:qt(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)})}),vn.prototype.eachLine=vn.prototype.iter;var no=0;function Cl(e){var t=this;if(ro(t),ee(t,e)||zn(t.display,e))return;re(e),K&&(no=+new Date);var i=dr(t,e,!0),r=e.dataTransfer.files;if(!i||t.isReadOnly())return;if(r&&r.length&&window.FileReader&&window.File)for(var c=r.length,P=Array(c),V=0,Z=function(){++V==c&&Zt(t,function(){i=bt(t.doc,i);var De={from:i,to:i,text:t.doc.splitLines(P.filter(function(Fe){return Fe!=null}).join(t.doc.lineSeparator())),origin:"paste"};Fr(t.doc,De),Hs(t.doc,Qn(bt(t.doc,i),bt(t.doc,Zn(De))))})()},te=function(De,Fe){if(t.options.allowDropFileTypes&&oe(t.options.allowDropFileTypes,De.type)==-1){Z();return}var Ue=new FileReader;Ue.onerror=function(){return Z()},Ue.onload=function(){var Xe=Ue.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Xe)){Z();return}P[Fe]=Xe,Z()},Ue.readAsText(De)},ie=0;ie<r.length;ie++)te(r[ie],ie);else{if(t.state.draggingText&&t.doc.sel.contains(i)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var ye=e.dataTransfer.getData("Text");if(ye){var Ee;if(t.state.draggingText&&!t.state.draggingText.copy&&(Ee=t.listSelections()),$i(t.doc,Qn(i,i)),Ee)for(var ke=0;ke<Ee.length;++ke)Ur(t.doc,"",Ee[ke].anchor,Ee[ke].head,"drag");t.replaceSelection(ye,"around","paste"),t.display.input.focus()}}catch(De){}}}function Al(e,t){if(K&&(!e.state.draggingText||+new Date-no<100)){ge(t);return}if(ee(e,t)||zn(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!m){var i=f("img",null,null,"position: fixed; left: 0; top: 0;");i.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",p&&(i.width=i.height=1,e.display.wrapper.appendChild(i),i._top=i.offsetTop),t.dataTransfer.setDragImage(i,0,0),p&&i.parentNode.removeChild(i)}}function Rl(e,t){var i=dr(e,t);if(!i)return;var r=document.createDocumentFragment();ms(e,i,r),e.display.dragCursor||(e.display.dragCursor=f("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),C(e.display.dragCursor,r)}function ro(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function io(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),i=[],r=0;r<t.length;r++){var c=t[r].CodeMirror;c&&i.push(c)}i.length&&i[0].operation(function(){for(var P=0;P<i.length;P++)e(i[P])})}var ao=!1;function Ol(){if(ao)return;Ll(),ao=!0}function Ll(){var e;Me(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,io(Il)},100))}),Me(window,"blur",function(){return io(Dr)})}function Il(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var tr={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"},_i=0;_i<10;_i++)tr[_i+48]=tr[_i+96]=String(_i);for(var Zi=65;Zi<=90;Zi++)tr[Zi]=String.fromCharCode(Zi);for(var Ei=1;Ei<=12;Ei++)tr[Ei+111]=tr[Ei+63235]="F"+Ei;var Kn={};Kn.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"},Kn.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"},Kn.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"},Kn.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"]},Kn.default=s?Kn.macDefault:Kn.pcDefault;function Dl(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var i,r,c,P,V=0;V<t.length-1;V++){var Z=t[V];if(/^(cmd|meta|m)$/i.test(Z))P=!0;else if(/^a(lt)?$/i.test(Z))i=!0;else if(/^(c|ctrl|control)$/i.test(Z))r=!0;else if(/^s(hift)?$/i.test(Z))c=!0;else throw new Error("Unrecognized modifier name: "+Z)}return i&&(e="Alt-"+e),r&&(e="Ctrl-"+e),P&&(e="Cmd-"+e),c&&(e="Shift-"+e),e}function kl(e){var t={};for(var i in e)if(e.hasOwnProperty(i)){var r=e[i];if(/^(name|fallthrough|(de|at)tach)$/.test(i))continue;if(r=="..."){delete e[i];continue}for(var c=I(i.split(" "),Dl),P=0;P<c.length;P++){var V=void 0,Z=void 0;P==c.length-1?(Z=c.join(" "),V=r):(Z=c.slice(0,P+1).join(" "),V="...");var te=t[Z];if(!te)t[Z]=V;else if(te!=V)throw new Error("Inconsistent bindings for "+Z)}delete e[i]}for(var ie in t)e[ie]=t[ie];return e}function jr(e,t,i,r){t=qi(t);var c=t.call?t.call(e,r):t[e];if(c===!1)return"nothing";if(c==="...")return"multi";if(c!=null&&i(c))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return jr(e,t.fallthrough,i,r);for(var P=0;P<t.fallthrough.length;P++){var V=jr(e,t.fallthrough[P],i,r);if(V)return V}}}function so(e){var t=typeof e=="string"?e:tr[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function oo(e,t,i){var r=e;return t.altKey&&r!="Alt"&&(e="Alt-"+e),(T?t.metaKey:t.ctrlKey)&&r!="Ctrl"&&(e="Ctrl-"+e),(T?t.ctrlKey:t.metaKey)&&r!="Mod"&&(e="Cmd-"+e),!i&&t.shiftKey&&r!="Shift"&&(e="Shift-"+e),e}function lo(e,t){if(p&&e.keyCode==34&&e.char)return!1;var i=tr[e.keyCode];return i==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(i=e.code),oo(i,e,t))}function qi(e){return typeof e=="string"?Kn[e]:e}function Hr(e,t){for(var i=e.doc.sel.ranges,r=[],c=0;c<i.length;c++){for(var P=t(i[c]);r.length&&mt(P.from,b(r).to)<=0;){var V=r.pop();if(mt(V.from,P.from)<0){P.from=V.from;break}}r.push(P)}En(e,function(){for(var Z=r.length-1;Z>=0;Z--)Ur(e.doc,"",r[Z].from,r[Z].to,"+delete");kr(e)})}function Fa(e,t,i){var r=Ae(e.text,t+i,i);return r<0||r>e.text.length?null:r}function Ua(e,t,i){var r=Fa(e,t.ch,i);return r==null?null:new He(t.line,r,i<0?"after":"before")}function Ba(e,t,i,r,c){if(e){t.doc.direction=="rtl"&&(c=-c);var P=je(i,t.doc.direction);if(P){var V=c<0?b(P):P[0],Z=c<0==(V.level==1),te=Z?"after":"before",ie;if(V.level>0||t.doc.direction=="rtl"){var ye=Or(t,i);ie=c<0?i.text.length-1:0;var Ee=Un(t,ye,ie).top;ie=Ne(function(ke){return Un(t,ye,ke).top==Ee},c<0==(V.level==1)?V.from:V.to-1,ie),te=="before"&&(ie=Fa(i,ie,1))}else ie=c<0?V.to:V.from;return new He(r,ie,te)}}return new He(r,c<0?i.text.length:0,c<0?"before":"after")}function Ml(e,t,i,r){var c=je(t,e.doc.direction);if(!c)return Ua(t,i,r);i.ch>=t.text.length?(i.ch=t.text.length,i.sticky="before"):i.ch<=0&&(i.ch=0,i.sticky="after");var P=Ge(c,i.ch,i.sticky),V=c[P];if(e.doc.direction=="ltr"&&V.level%2==0&&(r>0?V.to>i.ch:V.from<i.ch))return Ua(t,i,r);var Z=function(Je,it){return Fa(t,Je instanceof He?Je.ch:Je,it)},te,ie=function(Je){return e.options.lineWrapping?(te=te||Or(e,t),cs(e,t,te,Je)):{begin:0,end:t.text.length}},ye=ie(i.sticky=="before"?Z(i,-1):i.ch);if(e.doc.direction=="rtl"||V.level==1){var Ee=V.level==1==r<0,ke=Z(i,Ee?1:-1);if(ke!=null&&(Ee?ke<=V.to&&ke<=ye.end:ke>=V.from&&ke>=ye.begin)){var De=Ee?"before":"after";return new He(i.line,ke,De)}}var Fe=function(Je,it,Qe){for(var st=function(jt,en){return en?new He(i.line,Z(jt,1),"before"):new He(i.line,jt,"after")};Je>=0&&Je<c.length;Je+=it){var ft=c[Je],ht=it>0==(ft.level!=1),wt=ht?Qe.begin:Z(Qe.end,-1);if(ft.from<=wt&&wt<ft.to)return st(wt,ht);if(wt=ht?ft.from:Z(ft.to,-1),Qe.begin<=wt&&wt<Qe.end)return st(wt,ht)}},Ue=Fe(P+r,r,ye);if(Ue)return Ue;var Xe=r>0?ye.end:Z(ye.begin,-1);return Xe!=null&&!(r>0&&Xe==t.text.length)&&(Ue=Fe(r>0?0:c.length-1,r,ie(Xe)),Ue)?Ue:null}var xi={selectAll:Vs,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),be)},killLine:function(e){return Hr(e,function(t){if(t.empty()){var i=qe(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line<e.lastLine()?{from:t.head,to:He(t.head.line+1,0)}:{from:t.head,to:He(t.head.line,i)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Hr(e,function(t){return{from:He(t.from().line,0),to:bt(e.doc,He(t.to().line+1,0))}})},delLineLeft:function(e){return Hr(e,function(t){return{from:He(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return Hr(e,function(t){var i=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:i},"div");return{from:r,to:t.from()}})},delWrappedLineRight:function(e){return Hr(e,function(t){var i=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div");return{from:t.from(),to:r}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(He(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(He(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 i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div")},Ce)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:i},"div")},Ce)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:i},"div");return r.ch<e.getLine(r.line).search(/\S/)?ho(e,t.head):r},Ce)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],i=e.listSelections(),r=e.options.tabSize,c=0;c<i.length;c++){var P=i[c].from(),V=W(e.getLine(P.line),P.ch,r);t.push(X(r-V%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return En(e,function(){for(var t=e.listSelections(),i=[],r=0;r<t.length;r++){if(!t[r].empty())continue;var c=t[r].head,P=qe(e.doc,c.line).text;if(P){if(c.ch==P.length&&(c=new He(c.line,c.ch-1)),c.ch>0)c=new He(c.line,c.ch+1),e.replaceRange(P.charAt(c.ch-1)+P.charAt(c.ch-2),He(c.line,c.ch-2),c,"+transpose");else if(c.line>e.doc.first){var V=qe(e.doc,c.line-1).text;V&&(c=new He(c.line,1),e.replaceRange(P.charAt(0)+e.doc.lineSeparator()+V.charAt(V.length-1),He(c.line-1,V.length-1),c,"+transpose"))}}i.push(new Mt(c,c))}e.setSelections(i)})},newlineAndIndent:function(e){return En(e,function(){for(var t=e.listSelections(),i=t.length-1;i>=0;i--)e.replaceRange(e.doc.lineSeparator(),t[i].anchor,t[i].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);kr(e)})},openLine:function(e){return e.replaceSelection(`
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function uo(e,t){var i=qe(e.doc,t),r=Tn(i);return r!=i&&(t=gt(r)),Ba(!0,e,r,t,1)}function Pl(e,t){var i=qe(e.doc,t),r=Pi(i);return r!=i&&(t=gt(r)),Ba(!0,e,i,t,-1)}function ho(e,t){var i=uo(e,t.line),r=qe(e.doc,i.line),c=je(r,e.doc.direction);if(!c||c[0].level==0){var P=Math.max(i.ch,r.text.search(/\S/)),V=t.line==i.line&&t.ch<=P&&t.ch;return He(i.line,V?0:P,i.sticky)}return i}function ea(e,t,i){if(typeof t=="string"&&(t=xi[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,c=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),i&&(e.display.shift=!1),c=t(e)!=Re}finally{e.display.shift=r,e.state.suppressEdits=!1}return c}function Nl(e,t,i){for(var r=0;r<e.state.keyMaps.length;r++){var c=jr(t,e.state.keyMaps[r],i,e);if(c)return c}return e.options.extraKeys&&jr(t,e.options.extraKeys,i,e)||jr(t,e.options.keyMap,i,e)}var Fl=new J;function Ti(e,t,i,r){var c=e.state.keySeq;if(c){if(so(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Fl.set(50,function(){e.state.keySeq==c&&(e.state.keySeq=null,e.display.input.reset())}),co(e,c+" "+t,i,r))return!0}return co(e,t,i,r)}function co(e,t,i,r){var c=Nl(e,t,r);return c=="multi"&&(e.state.keySeq=t),c=="handled"&&rn(e,"keyHandled",e,t,i),(c=="handled"||c=="multi")&&(re(i),xa(e)),!!c}function fo(e,t){var i=lo(t,!0);return i?t.shiftKey&&!e.state.keySeq?Ti(e,"Shift-"+i,t,function(r){return ea(e,r,!0)})||Ti(e,i,t,function(r){if(typeof r=="string"?/^go[A-Z]/.test(r):r.motion)return ea(e,r)}):Ti(e,i,t,function(r){return ea(e,r)}):!1}function Ul(e,t,i){return Ti(e,"'"+i+"'",t,function(r){return ea(e,r,!0)})}var ja=null;function po(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=j(),ee(t,e))return;K&&G<11&&e.keyCode==27&&(e.returnValue=!1);var i=e.keyCode;t.display.shift=i==16||e.shiftKey;var r=fo(t,e);p&&(ja=r?i:null,!r&&i==88&&!Rt&&(s?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),N&&!s&&!r&&i==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),i==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Bl(t)}function Bl(e){var t=e.display.lineDiv;U(t,"CodeMirror-crosshair");function i(r){(r.keyCode==18||!r.altKey)&&(S(t,"CodeMirror-crosshair"),rt(document,"keyup",i),rt(document,"mouseover",i))}Me(document,"keyup",i),Me(document,"mouseover",i)}function mo(e){e.keyCode==16&&(this.doc.sel.shift=!1),ee(this,e)}function go(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(zn(t.display,e)||ee(t,e)||e.ctrlKey&&!e.altKey||s&&e.metaKey)return;var i=e.keyCode,r=e.charCode;if(p&&i==ja){ja=null,re(e);return}if(p&&(!e.which||e.which<10)&&fo(t,e))return;var c=String.fromCharCode(r==null?i:r);if(c=="\b")return;if(Ul(t,e,c))return;t.display.input.onKeyPress(e)}var jl=400,Ha=function(e,t,i){this.time=e,this.pos=t,this.button=i};Ha.prototype.compare=function(e,t,i){return this.time+jl>e&&mt(t,this.pos)==0&&i==this.button};var wi,Si;function Hl(e,t){var i=+new Date;return Si&&Si.compare(i,e,t)?(wi=Si=null,"triple"):wi&&wi.compare(i,e,t)?(Si=new Ha(i,e,t),wi=null,"double"):(wi=new Ha(i,e,t),Si=null,"single")}function vo(e){var t=this,i=t.display;if(ee(t,e)||i.activeTouch&&i.input.supportsTouch())return;if(i.input.ensurePolled(),i.shift=e.shiftKey,zn(i,e)){n||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(Wa(t,e))return;var r=dr(t,e),c=Oe(e),P=r?Hl(r,c):"single";if(window.focus(),c==1&&t.state.selectingText&&t.state.selectingText(e),r&&Wl(t,c,r,P,e))return;c==1?r?zl(t,r,P,e):_e(e)==i.scroller&&re(e):c==2?(r&&Yi(t.doc,r),setTimeout(function(){return i.input.focus()},20)):c==3&&(k?t.display.input.onContextMenu(e):vs(t))}function Wl(e,t,i,r,c){var P="Click";return r=="double"?P="Double"+P:r=="triple"&&(P="Triple"+P),P=(t==1?"Left":t==2?"Middle":"Right")+P,Ti(e,oo(P,c),c,function(V){if(typeof V=="string"&&(V=xi[V]),!V)return!1;var Z=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),Z=V(e,i)!=Re}finally{e.state.suppressEdits=!1}return Z})}function Gl(e,t,i){var r=e.getOption("configureMouse"),c=r?r(e,t,i):{};if(c.unit==null){var P=a?i.shiftKey&&i.metaKey:i.altKey;c.unit=P?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(c.extend==null||e.doc.extend)&&(c.extend=e.doc.extend||i.shiftKey),c.addNew==null&&(c.addNew=s?i.metaKey:i.ctrlKey),c.moveOnDrag==null&&(c.moveOnDrag=!(s?i.altKey:i.ctrlKey)),c}function zl(e,t,i,r){K?setTimeout(D(gs,e),0):e.curOp.focus=j();var c=Gl(e,i,r),P=e.doc.sel,V;e.options.dragDrop&&Pe&&!e.isReadOnly()&&i=="single"&&(V=P.contains(t))>-1&&(mt((V=P.ranges[V]).from(),t)<0||t.xRel>0)&&(mt(V.to(),t)>0||t.xRel<0)?Kl(e,r,t,c):Vl(e,r,t,c)}function Kl(e,t,i,r){var c=e.display,P=!1,V=Zt(e,function(ie){n&&(c.scroller.draggable=!1),e.state.draggingText=!1,rt(c.wrapper.ownerDocument,"mouseup",V),rt(c.wrapper.ownerDocument,"mousemove",Z),rt(c.scroller,"dragstart",te),rt(c.scroller,"drop",V),P||(re(ie),r.addNew||Yi(e.doc,i,null,null,r.extend),n&&!m||K&&G==9?setTimeout(function(){c.wrapper.ownerDocument.body.focus({preventScroll:!0}),c.input.focus()},20):c.input.focus())}),Z=function(ie){P=P||Math.abs(t.clientX-ie.clientX)+Math.abs(t.clientY-ie.clientY)>=10},te=function(){return P=!0};n&&(c.scroller.draggable=!0),e.state.draggingText=V,V.copy=!r.moveOnDrag,c.scroller.dragDrop&&c.scroller.dragDrop(),Me(c.wrapper.ownerDocument,"mouseup",V),Me(c.wrapper.ownerDocument,"mousemove",Z),Me(c.scroller,"dragstart",te),Me(c.scroller,"drop",V),vs(e),setTimeout(function(){return c.input.focus()},20)}function yo(e,t,i){if(i=="char")return new Mt(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new Mt(He(t.line,0),bt(e.doc,He(t.line+1,0)));var r=i(e,t);return new Mt(r.from,r.to)}function Vl(e,t,i,r){var c=e.display,P=e.doc;re(t);var V,Z,te=P.sel,ie=te.ranges;if(r.addNew&&!r.extend?(Z=P.sel.contains(i),Z>-1?V=ie[Z]:V=new Mt(i,i)):(V=P.sel.primary(),Z=P.sel.primIndex),r.unit=="rectangle")r.addNew||(V=new Mt(i,i)),i=dr(e,t,!0,!0),Z=-1;else{var ye=yo(e,i,r.unit);r.extend?V=Pa(V,ye.anchor,ye.head,r.extend):V=ye}r.addNew?Z==-1?(Z=ie.length,ln(P,Mn(e,ie.concat([V]),Z),{scroll:!1,origin:"*mouse"})):ie.length>1&&ie[Z].empty()&&r.unit=="char"&&!r.extend?(ln(P,Mn(e,ie.slice(0,Z).concat(ie.slice(Z+1)),0),{scroll:!1,origin:"*mouse"}),te=P.sel):Na(P,Z,V,Le):(Z=0,ln(P,new Sn([V],0),Le),te=P.sel);var Ee=i;function ke(Qe){if(mt(Ee,Qe)==0)return;if(Ee=Qe,r.unit=="rectangle"){for(var st=[],ft=e.options.tabSize,ht=W(qe(P,i.line).text,i.ch,ft),wt=W(qe(P,Qe.line).text,Qe.ch,ft),jt=Math.min(ht,wt),en=Math.max(ht,wt),Gt=Math.min(i.line,Qe.line),xn=Math.min(e.lastLine(),Math.max(i.line,Qe.line));Gt<=xn;Gt++){var yn=qe(P,Gt).text,Xt=Te(yn,jt,ft);jt==en?st.push(new Mt(He(Gt,Xt),He(Gt,Xt))):yn.length>Xt&&st.push(new Mt(He(Gt,Xt),He(Gt,Te(yn,en,ft))))}st.length||st.push(new Mt(i,i)),ln(P,Mn(e,te.ranges.slice(0,Z).concat(st),Z),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Qe)}else{var bn=V,an=yo(e,Qe,r.unit),Jt=bn.anchor,Yt;mt(an.anchor,Jt)>0?(Yt=an.head,Jt=ir(bn.from(),an.anchor)):(Yt=an.anchor,Jt=Er(bn.to(),an.head));var zt=te.ranges.slice(0);zt[Z]=Xl(e,new Mt(bt(P,Jt),Yt)),ln(P,Mn(e,zt,Z),Le)}}var De=c.wrapper.getBoundingClientRect(),Fe=0;function Ue(Qe){var st=++Fe,ft=dr(e,Qe,!0,r.unit=="rectangle");if(!ft)return;if(mt(ft,Ee)!=0){e.curOp.focus=j(),ke(ft);var ht=Wi(c,P);(ft.line>=ht.to||ft.line<ht.from)&&setTimeout(Zt(e,function(){Fe==st&&Ue(Qe)}),150)}else{var wt=Qe.clientY<De.top?-20:Qe.clientY>De.bottom?20:0;wt&&setTimeout(Zt(e,function(){if(Fe!=st)return;c.scroller.scrollTop+=wt,Ue(Qe)}),50)}}function Xe(Qe){e.state.selectingText=!1,Fe=Infinity,Qe&&(re(Qe),c.input.focus()),rt(c.wrapper.ownerDocument,"mousemove",Je),rt(c.wrapper.ownerDocument,"mouseup",it),P.history.lastSelOrigin=null}var Je=Zt(e,function(Qe){Qe.buttons===0||!Oe(Qe)?Xe(Qe):Ue(Qe)}),it=Zt(e,Xe);e.state.selectingText=it,Me(c.wrapper.ownerDocument,"mousemove",Je),Me(c.wrapper.ownerDocument,"mouseup",it)}function Xl(e,t){var i=t.anchor,r=t.head,c=qe(e.doc,i.line);if(mt(i,r)==0&&i.sticky==r.sticky)return t;var P=je(c);if(!P)return t;var V=Ge(P,i.ch,i.sticky),Z=P[V];if(Z.from!=i.ch&&Z.to!=i.ch)return t;var te=V+(Z.from==i.ch==(Z.level!=1)?0:1);if(te==0||te==P.length)return t;var ie;if(r.line!=i.line)ie=(r.line-i.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var ye=Ge(P,r.ch,r.sticky),Ee=ye-V||(r.ch-i.ch)*(Z.level==1?-1:1);ye==te-1||ye==te?ie=Ee<0:ie=Ee>0}var ke=P[te+(ie?-1:0)],De=ie==(ke.level==1),Fe=De?ke.from:ke.to,Ue=De?"after":"before";return i.ch==Fe&&i.sticky==Ue?t:new Mt(new He(i.line,Fe,Ue),r)}function bo(e,t,i,r){var c,P;if(t.touches)c=t.touches[0].clientX,P=t.touches[0].clientY;else try{c=t.clientX,P=t.clientY}catch(ke){return!1}if(c>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&re(t);var V=e.display,Z=V.lineDiv.getBoundingClientRect();if(P>Z.bottom||!se(e,i))return pe(t);P-=Z.top-V.viewOffset;for(var te=0;te<e.display.gutterSpecs.length;++te){var ie=V.gutters.childNodes[te];if(ie&&ie.getBoundingClientRect().right>=c){var ye=Ct(e.doc,P),Ee=e.display.gutterSpecs[te];return ce(e,i,e,ye,Ee.className,t),pe(t)}}}function Wa(e,t){return bo(e,t,"gutterClick",!0)}function _o(e,t){if(zn(e.display,t)||Yl(e,t))return;if(ee(e,t,"contextmenu"))return;k||e.display.input.onContextMenu(t)}function Yl(e,t){return se(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-"),ai(e)}var Wr={toString:function(){return"CodeMirror.Init"}},xo={},ta={};function $l(e){var t=e.optionHandlers;function i(r,c,P,V){e.defaults[r]=c,P&&(t[r]=V?function(Z,te,ie){ie!=Wr&&P(Z,te,ie)}:P)}e.defineOption=i,e.Init=Wr,i("value","",function(r,c){return r.setValue(c)},!0),i("mode",null,function(r,c){r.doc.modeOption=c,Da(r)},!0),i("indentUnit",2,Da,!0),i("indentWithTabs",!1),i("smartIndent",!0),i("tabSize",4,function(r){fi(r),ai(r),gn(r)},!0),i("lineSeparator",null,function(r,c){if(r.doc.lineSep=c,!c)return;var P=[],V=r.doc.first;r.doc.iter(function(te){for(var ie=0;;){var ye=te.text.indexOf(c,ie);if(ye==-1)break;ie=ye+c.length,P.push(He(V,ye))}V++});for(var Z=P.length-1;Z>=0;Z--)Ur(r.doc,c,P[Z],He(P[Z].line,P[Z].ch+c.length))}),i("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(r,c,P){r.state.specialChars=new RegExp(c.source+(c.test(" ")?"":"| "),"g"),P!=Wr&&r.refresh()}),i("specialCharPlaceholder",Bt,function(r){return r.refresh()},!0),i("electricChars",!0),i("inputStyle",h?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),i("spellcheck",!1,function(r,c){return r.getInputField().spellcheck=c},!0),i("autocorrect",!1,function(r,c){return r.getInputField().autocorrect=c},!0),i("autocapitalize",!1,function(r,c){return r.getInputField().autocapitalize=c},!0),i("rtlMoveVisually",!A),i("wholeLineUpdateBefore",!0),i("theme","default",function(r){Eo(r),di(r)},!0),i("keyMap","default",function(r,c,P){var V=qi(c),Z=P!=Wr&&qi(P);Z&&Z.detach&&Z.detach(r,V),V.attach&&V.attach(r,Z||null)}),i("extraKeys",null),i("configureMouse",null),i("lineWrapping",!1,Ql,!0),i("gutters",[],function(r,c){r.display.gutterSpecs=La(c,r.options.lineNumbers),di(r)},!0),i("fixedGutter",!0,function(r,c){r.display.gutters.style.left=c?_a(r.display)+"px":"0",r.refresh()},!0),i("coverGutterNextToScrollbar",!1,function(r){return Mr(r)},!0),i("scrollbarStyle","native",function(r){Ts(r),Mr(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),i("lineNumbers",!1,function(r,c){r.display.gutterSpecs=La(r.options.gutters,c),di(r)},!0),i("firstLineNumber",1,di,!0),i("lineNumberFormatter",function(r){return r},di,!0),i("showCursorWhenSelecting",!1,si,!0),i("resetSelectionOnContextMenu",!0),i("lineWiseCopyCut",!0),i("pasteLinesPerSelection",!0),i("selectionsMayTouch",!1),i("readOnly",!1,function(r,c){c=="nocursor"&&(Dr(r),r.display.input.blur()),r.display.input.readOnlyChanged(c)}),i("screenReaderLabel",null,function(r,c){c=c===""?null:c,r.display.input.screenReaderLabelChanged(c)}),i("disableInput",!1,function(r,c){c||r.display.input.reset()},!0),i("dragDrop",!0,Jl),i("allowDropFileTypes",null),i("cursorBlinkRate",530),i("cursorScrollMargin",0),i("cursorHeight",1,si,!0),i("singleCursorHeightPerLine",!0,si,!0),i("workTime",100),i("workDelay",100),i("flattenSpans",!0,fi,!0),i("addModeClass",!1,fi,!0),i("pollInterval",100),i("undoDepth",200,function(r,c){return r.doc.history.undoDepth=c}),i("historyEventDelay",1250),i("viewportMargin",10,function(r){return r.refresh()},!0),i("maxHighlightLength",1e4,fi,!0),i("moveInputWithCursor",!0,function(r,c){c||r.display.input.resetPosition()}),i("tabindex",null,function(r,c){return r.display.input.getField().tabIndex=c||""}),i("autofocus",null),i("direction","ltr",function(r,c){return r.doc.setDirection(c)},!0),i("phrases",null)}function Jl(e,t,i){var r=i&&i!=Wr;if(!t!=!r){var c=e.display.dragFunctions,P=t?Me:rt;P(e.display.scroller,"dragstart",c.start),P(e.display.scroller,"dragenter",c.enter),P(e.display.scroller,"dragover",c.over),P(e.display.scroller,"dragleave",c.leave),P(e.display.scroller,"drop",c.drop)}}function Ql(e){e.options.lineWrapping?(U(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(S(e.display.wrapper,"CodeMirror-wrap"),Ni(e)),Ea(e),gn(e),ai(e),setTimeout(function(){return Mr(e)},100)}function Wt(e,t){var i=this;if(!(this instanceof Wt))return new Wt(e,t);this.options=t=t?g(t):{},g(xo,t,!1);var r=t.value;typeof r=="string"?r=new vn(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var c=new Wt.inputStyles[t.inputStyle](this),P=this.display=new hl(e,r,c,t);P.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 J,keySeq:null,specialChars:null},t.autofocus&&!h&&P.input.focus(),K&&G<11&&setTimeout(function(){return i.display.input.reset(!0)},20),Zl(this),Ol(),gr(this),this.curOp.forceUpdate=!0,ks(this,r),t.autofocus&&!h||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&Ta(i)},20):Dr(this);for(var V in ta)ta.hasOwnProperty(V)&&ta[V](this,t[V],Wr);Cs(this),t.finishInit&&t.finishInit(this);for(var Z=0;Z<Ga.length;++Z)Ga[Z](this);vr(this),n&&t.lineWrapping&&getComputedStyle(P.lineDiv).textRendering=="optimizelegibility"&&(P.lineDiv.style.textRendering="auto")}Wt.defaults=xo,Wt.optionHandlers=ta;function Zl(e){var t=e.display;Me(t.scroller,"mousedown",Zt(e,vo)),K&&G<11?Me(t.scroller,"dblclick",Zt(e,function(te){if(ee(e,te))return;var ie=dr(e,te);if(!ie||Wa(e,te)||zn(e.display,te))return;re(te);var ye=e.findWordAt(ie);Yi(e.doc,ye.anchor,ye.head)})):Me(t.scroller,"dblclick",function(te){return ee(e,te)||re(te)}),Me(t.scroller,"contextmenu",function(te){return _o(e,te)}),Me(t.input.getField(),"contextmenu",function(te){t.scroller.contains(te.target)||_o(e,te)});var i,r={end:0};function c(){t.activeTouch&&(i=setTimeout(function(){return t.activeTouch=null},1e3),r=t.activeTouch,r.end=+new Date)}function P(te){if(te.touches.length!=1)return!1;var ie=te.touches[0];return ie.radiusX<=1&&ie.radiusY<=1}function V(te,ie){if(ie.left==null)return!0;var ye=ie.left-te.left,Ee=ie.top-te.top;return ye*ye+Ee*Ee>20*20}Me(t.scroller,"touchstart",function(te){if(!ee(e,te)&&!P(te)&&!Wa(e,te)){t.input.ensurePolled(),clearTimeout(i);var ie=+new Date;t.activeTouch={start:ie,moved:!1,prev:ie-r.end<=300?r:null},te.touches.length==1&&(t.activeTouch.left=te.touches[0].pageX,t.activeTouch.top=te.touches[0].pageY)}}),Me(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Me(t.scroller,"touchend",function(te){var ie=t.activeTouch;if(ie&&!zn(t,te)&&ie.left!=null&&!ie.moved&&new Date-ie.start<300){var ye=e.coordsChar(t.activeTouch,"page"),Ee;!ie.prev||V(ie,ie.prev)?Ee=new Mt(ye,ye):!ie.prev.prev||V(ie,ie.prev.prev)?Ee=e.findWordAt(ye):Ee=new Mt(He(ye.line,0),bt(e.doc,He(ye.line+1,0))),e.setSelection(Ee.anchor,Ee.head),e.focus(),re(te)}c()}),Me(t.scroller,"touchcancel",c),Me(t.scroller,"scroll",function(){t.scroller.clientHeight&&(li(e,t.scroller.scrollTop),pr(e,t.scroller.scrollLeft,!0),ce(e,"scroll",e))}),Me(t.scroller,"mousewheel",function(te){return Os(e,te)}),Me(t.scroller,"DOMMouseScroll",function(te){return Os(e,te)}),Me(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(te){ee(e,te)||ge(te)},over:function(te){ee(e,te)||(Rl(e,te),ge(te))},start:function(te){return Al(e,te)},drop:Zt(e,Cl),leave:function(te){ee(e,te)||ro(e)}};var Z=t.input.getField();Me(Z,"keyup",function(te){return mo.call(e,te)}),Me(Z,"keydown",Zt(e,po)),Me(Z,"keypress",Zt(e,go)),Me(Z,"focus",function(te){return Ta(e,te)}),Me(Z,"blur",function(te){return Dr(e,te)})}var Ga=[];Wt.defineInitHook=function(e){return Ga.push(e)};function Ci(e,t,i,r){var c=e.doc,P;i==null&&(i="add"),i=="smart"&&(c.mode.indent?P=Rn(e,t).state:i="prev");var V=e.options.tabSize,Z=qe(c,t),te=W(Z.text,null,V);Z.stateAfter&&(Z.stateAfter=null);var ie=Z.text.match(/^\s*/)[0],ye;if(!r&&!/\S/.test(Z.text))ye=0,i="not";else if(i=="smart"&&(ye=c.mode.indent(P,Z.text.slice(ie.length),Z.text),ye==Re||ye>150)){if(!r)return;i="prev"}i=="prev"?t>c.first?ye=W(qe(c,t-1).text,null,V):ye=0:i=="add"?ye=te+e.options.indentUnit:i=="subtract"?ye=te-e.options.indentUnit:typeof i=="number"&&(ye=te+i),ye=Math.max(0,ye);var Ee="",ke=0;if(e.options.indentWithTabs)for(var De=Math.floor(ye/V);De;--De)ke+=V,Ee+=" ";if(ke<ye&&(Ee+=X(ye-ke)),Ee!=ie)return Ur(c,Ee,He(t,0),He(t,ie.length),"+input"),Z.stateAfter=null,!0;for(var Fe=0;Fe<c.sel.ranges.length;Fe++){var Ue=c.sel.ranges[Fe];if(Ue.head.line==t&&Ue.head.ch<ie.length){var Xe=He(t,ie.length);Na(c,Fe,new Mt(Xe,Xe));break}}}var Pn=null;function na(e){Pn=e}function za(e,t,i,r,c){var P=e.doc;e.display.shift=!1,r||(r=P.sel);var V=+new Date-200,Z=c=="paste"||e.state.pasteIncoming>V,te=lt(t),ie=null;if(Z&&r.ranges.length>1)if(Pn&&Pn.text.join(`
|
|
`)==t){if(r.ranges.length%Pn.text.length==0){ie=[];for(var ye=0;ye<Pn.text.length;ye++)ie.push(P.splitLines(Pn.text[ye]))}}else te.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(ie=I(te,function(Je){return[Je]}));for(var Ee=e.curOp.updateInput,ke=r.ranges.length-1;ke>=0;ke--){var De=r.ranges[ke],Fe=De.from(),Ue=De.to();De.empty()&&(i&&i>0?Fe=He(Fe.line,Fe.ch-i):e.state.overwrite&&!Z?Ue=He(Ue.line,Math.min(qe(P,Ue.line).text.length,Ue.ch+b(te).length)):Z&&Pn&&Pn.lineWise&&Pn.text.join(`
|
|
`)==te.join(`
|
|
`)&&(Fe=Ue=He(Fe.line,0)));var Xe={from:Fe,to:Ue,text:ie?ie[ke%ie.length]:te,origin:c||(Z?"paste":e.state.cutIncoming>V?"cut":"+input")};Fr(e.doc,Xe),rn(e,"inputRead",e,Xe)}t&&!Z&&wo(e,t),kr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=Ee),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function To(e,t){var i=e.clipboardData&&e.clipboardData.getData("Text");if(i)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&En(t,function(){return za(t,i,0,null,"paste")}),!0}function wo(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var i=e.doc.sel,r=i.ranges.length-1;r>=0;r--){var c=i.ranges[r];if(c.head.ch>100||r&&i.ranges[r-1].head.line==c.head.line)continue;var P=e.getModeAt(c.head),V=!1;if(P.electricChars){for(var Z=0;Z<P.electricChars.length;Z++)if(t.indexOf(P.electricChars.charAt(Z))>-1){V=Ci(e,c.head.line,"smart");break}}else P.electricInput&&(P.electricInput.test(qe(e.doc,c.head.line).text.slice(0,c.head.ch))&&(V=Ci(e,c.head.line,"smart")));V&&rn(e,"electricInput",e,c.head.line)}}function So(e){for(var t=[],i=[],r=0;r<e.doc.sel.ranges.length;r++){var c=e.doc.sel.ranges[r].head.line,P={anchor:He(c,0),head:He(c+1,0)};i.push(P),t.push(e.getRange(P.anchor,P.head))}return{text:t,ranges:i}}function Co(e,t,i,r){e.setAttribute("autocorrect",i?"":"off"),e.setAttribute("autocapitalize",r?"":"off"),e.setAttribute("spellcheck",!!t)}function Ao(){var e=f("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=f("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return n?e.style.width="1000px":e.setAttribute("wrap","off"),d&&(e.style.border="1px solid black"),Co(e),t}function ql(e){var t=e.optionHandlers,i=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(r,c){var P=this.options,V=P[r];if(P[r]==c&&r!="mode")return;P[r]=c,t.hasOwnProperty(r)&&Zt(this,t[r])(this,c,V),ce(this,"optionChange",this,r)},getOption:function(r){return this.options[r]},getDoc:function(){return this.doc},addKeyMap:function(r,c){this.state.keyMaps[c?"push":"unshift"](qi(r))},removeKeyMap:function(r){for(var c=this.state.keyMaps,P=0;P<c.length;++P)if(c[P]==r||c[P].name==r)return c.splice(P,1),!0},addOverlay:dn(function(r,c){var P=r.token?r:e.getMode(this.options,r);if(P.startState)throw new Error("Overlays may not be stateful.");B(this.state.overlays,{mode:P,modeSpec:r,opaque:c&&c.opaque,priority:c&&c.priority||0},function(V){return V.priority}),this.state.modeGen++,gn(this)}),removeOverlay:dn(function(r){for(var c=this.state.overlays,P=0;P<c.length;++P){var V=c[P].modeSpec;if(V==r||typeof r=="string"&&V.name==r){c.splice(P,1),this.state.modeGen++,gn(this);return}}}),indentLine:dn(function(r,c,P){typeof c!="string"&&typeof c!="number"&&(c==null?c=this.options.smartIndent?"smart":"prev":c=c?"add":"subtract"),sn(this.doc,r)&&Ci(this,r,c,P)}),indentSelection:dn(function(r){for(var c=this.doc.sel.ranges,P=-1,V=0;V<c.length;V++){var Z=c[V];if(Z.empty())Z.head.line>P&&(Ci(this,Z.head.line,r,!0),P=Z.head.line,V==this.doc.sel.primIndex&&kr(this));else{var te=Z.from(),ie=Z.to(),ye=Math.max(P,te.line);P=Math.min(this.lastLine(),ie.line-(ie.ch?0:1))+1;for(var Ee=ye;Ee<P;++Ee)Ci(this,Ee,r);var ke=this.doc.sel.ranges;te.ch==0&&c.length==ke.length&&ke[V].from().ch>0&&Na(this.doc,V,new Mt(te,ke[V].to()),be)}}}),getTokenAt:function(r,c){return Ri(this,r,c)},getLineTokens:function(r,c){return Ri(this,He(r),c,!0)},getTokenTypeAt:function(r){r=bt(this.doc,r);var c=ar(this,qe(this.doc,r.line)),P=0,V=(c.length-1)/2,Z=r.ch,te;if(Z==0)te=c[2];else for(;;){var ie=P+V>>1;if((ie?c[ie*2-1]:0)>=Z)V=ie;else if(c[ie*2+1]<Z)P=ie+1;else{te=c[ie*2+2];break}}var ye=te?te.indexOf("overlay "):-1;return ye<0?te:ye==0?null:te.slice(0,ye-1)},getModeAt:function(r){var c=this.doc.mode;return c.innerMode?e.innerMode(c,this.getTokenAt(r).state).mode:c},getHelper:function(r,c){return this.getHelpers(r,c)[0]},getHelpers:function(r,c){var P=[];if(!i.hasOwnProperty(c))return P;var V=i[c],Z=this.getModeAt(r);if(typeof Z[c]=="string")V[Z[c]]&&P.push(V[Z[c]]);else if(Z[c])for(var te=0;te<Z[c].length;te++){var ie=V[Z[c][te]];ie&&P.push(ie)}else Z.helperType&&V[Z.helperType]?P.push(V[Z.helperType]):V[Z.name]&&P.push(V[Z.name]);for(var ye=0;ye<V._global.length;ye++){var Ee=V._global[ye];Ee.pred(Z,this)&&oe(P,Ee.val)==-1&&P.push(Ee.val)}return P},getStateAfter:function(r,c){var P=this.doc;return r=xr(P,r==null?P.first+P.size-1:r),Rn(this,r+1,c).state},cursorCoords:function(r,c){var P,V=this.doc.sel.primary();return r==null?P=V.head:typeof r=="object"?P=bt(this.doc,r):P=r?V.from():V.to(),kn(this,P,c||"page")},charCoords:function(r,c){return ma(this,bt(this.doc,r),c||"page")},coordsChar:function(r,c){return r=ls(this,r,c||"page"),va(this,r.left,r.top)},lineAtHeight:function(r,c){return r=ls(this,{top:r,left:0},c||"page").top,Ct(this.doc,r+this.display.viewOffset)},heightAtLine:function(r,c,P){var V=!1,Z;if(typeof r=="number"){var te=this.doc.first+this.doc.size-1;r<this.doc.first?r=this.doc.first:r>te&&(r=te,V=!0),Z=qe(this.doc,r)}else Z=r;return Ui(this,Z,{top:0,left:0},c||"page",P||V).top+(V?this.doc.height-Dn(Z):0)},defaultTextHeight:function(){return Lr(this.display)},defaultCharWidth:function(){return Ir(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,c,P,V,Z){var te=this.display;r=kn(this,bt(this.doc,r));var ie=r.bottom,ye=r.left;if(c.style.position="absolute",c.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(c),te.sizer.appendChild(c),V=="over")ie=r.top;else if(V=="above"||V=="near"){var Ee=Math.max(te.wrapper.clientHeight,this.doc.height),ke=Math.max(te.sizer.clientWidth,te.lineSpace.clientWidth);(V=="above"||r.bottom+c.offsetHeight>Ee)&&r.top>c.offsetHeight?ie=r.top-c.offsetHeight:r.bottom+c.offsetHeight<=Ee&&(ie=r.bottom),ye+c.offsetWidth>ke&&(ye=ke-c.offsetWidth)}c.style.top=ie+"px",c.style.left=c.style.right="",Z=="right"?(ye=te.sizer.clientWidth-c.offsetWidth,c.style.right="0px"):(Z=="left"?ye=0:Z=="middle"&&(ye=(te.sizer.clientWidth-c.offsetWidth)/2),c.style.left=ye+"px"),P&&Jo(this,{left:ye,top:ie,right:ye+c.offsetWidth,bottom:ie+c.offsetHeight})},triggerOnKeyDown:dn(po),triggerOnKeyPress:dn(go),triggerOnKeyUp:mo,triggerOnMouseDown:dn(vo),execCommand:function(r){if(xi.hasOwnProperty(r))return xi[r].call(null,this)},triggerElectric:dn(function(r){wo(this,r)}),findPosH:function(r,c,P,V){var Z=1;c<0&&(Z=-1,c=-c);for(var te=bt(this.doc,r),ie=0;ie<c&&!(te=Ka(this.doc,te,Z,P,V),te.hitSide);++ie);return te},moveH:dn(function(r,c){var P=this;this.extendSelectionsBy(function(V){return P.display.shift||P.doc.extend||V.empty()?Ka(P.doc,V.head,r,c,P.options.rtlMoveVisually):r<0?V.from():V.to()},Ce)}),deleteH:dn(function(r,c){var P=this.doc.sel,V=this.doc;P.somethingSelected()?V.replaceSelection("",null,"+delete"):Hr(this,function(Z){var te=Ka(V,Z.head,r,c,!1);return r<0?{from:te,to:Z.head}:{from:Z.head,to:te}})}),findPosV:function(r,c,P,V){var Z=1,te=V;c<0&&(Z=-1,c=-c);for(var ie=bt(this.doc,r),ye=0;ye<c;++ye){var Ee=kn(this,ie,"div");if(te==null?te=Ee.left:Ee.left=te,ie=Ro(this,Ee,Z,P),ie.hitSide)break}return ie},moveV:dn(function(r,c){var P=this,V=this.doc,Z=[],te=!this.display.shift&&!V.extend&&V.sel.somethingSelected();if(V.extendSelectionsBy(function(ye){if(te)return r<0?ye.from():ye.to();var Ee=kn(P,ye.head,"div");ye.goalColumn!=null&&(Ee.left=ye.goalColumn),Z.push(Ee.left);var ke=Ro(P,Ee,r,c);return c=="page"&&ye==V.sel.primary()&&Sa(P,ma(P,ke,"div").top-Ee.top),ke},Ce),Z.length)for(var ie=0;ie<V.sel.ranges.length;ie++)V.sel.ranges[ie].goalColumn=Z[ie]}),findWordAt:function(r){var c=this.doc,P=qe(c,r.line).text,V=r.ch,Z=r.ch;if(P){var te=this.getHelper(r,"wordChars");(r.sticky=="before"||Z==P.length)&&V?--V:++Z;for(var ie=P.charAt(V),ye=Ie(ie,te)?function(Ee){return Ie(Ee,te)}:/\s/.test(ie)?function(Ee){return/\s/.test(Ee)}:function(Ee){return!/\s/.test(Ee)&&!Ie(Ee)};V>0&&ye(P.charAt(V-1));)--V;for(;Z<P.length&&ye(P.charAt(Z));)++Z}return new Mt(He(r.line,V),He(r.line,Z))},toggleOverwrite:function(r){if(r!=null&&r==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?U(this.display.cursorDiv,"CodeMirror-overwrite"):S(this.display.cursorDiv,"CodeMirror-overwrite"),ce(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==j()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:dn(function(r,c){oi(this,r,c)}),getScrollInfo:function(){var r=this.display.scroller;return{left:r.scrollLeft,top:r.scrollTop,height:r.scrollHeight-Fn(this)-this.display.barHeight,width:r.scrollWidth-Fn(this)-this.display.barWidth,clientHeight:da(this),clientWidth:hr(this)}},scrollIntoView:dn(function(r,c){r==null?(r={from:this.doc.sel.primary().head,to:null},c==null&&(c=this.options.cursorScrollMargin)):typeof r=="number"?r={from:He(r,0),to:null}:r.from==null&&(r={from:r,to:null}),r.to||(r.to=r.from),r.margin=c||0,r.from.line!=null?Qo(this,r):bs(this,r.from,r.to,r.margin)}),setSize:dn(function(r,c){var P=this,V=function(te){return typeof te=="number"||/^\d+$/.test(String(te))?te+"px":te};r!=null&&(this.display.wrapper.style.width=V(r)),c!=null&&(this.display.wrapper.style.height=V(c)),this.options.lineWrapping&&as(this);var Z=this.display.viewFrom;this.doc.iter(Z,this.display.viewTo,function(te){if(te.widgets){for(var ie=0;ie<te.widgets.length;ie++)if(te.widgets[ie].noHScroll){$n(P,Z,"widget");break}}++Z}),this.curOp.forceUpdate=!0,ce(this,"refresh",this)}),operation:function(r){return En(this,r)},startOperation:function(){return gr(this)},endOperation:function(){return vr(this)},refresh:dn(function(){var r=this.display.cachedTextHeight;gn(this),this.curOp.forceUpdate=!0,ai(this),oi(this,this.doc.scrollLeft,this.doc.scrollTop),Ra(this.display),(r==null||Math.abs(r-Lr(this.display))>.5||this.options.lineWrapping)&&Ea(this),ce(this,"refresh",this)}),swapDoc:dn(function(r){var c=this.doc;return c.cm=null,this.state.selectingText&&this.state.selectingText(),ks(this,r),ai(this),this.display.input.reset(),oi(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,rn(this,"swapDoc",this,c),c}),phrase:function(r){var c=this.options.phrases;return c&&Object.prototype.hasOwnProperty.call(c,r)?c[r]:r},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},de(e),e.registerHelper=function(r,c,P){i.hasOwnProperty(r)||(i[r]=e[r]={_global:[]}),i[r][c]=P},e.registerGlobalHelper=function(r,c,P,V){e.registerHelper(r,c,V),i[r]._global.push({pred:P,val:V})}}function Ka(e,t,i,r,c){var P=t,V=i,Z=qe(e,t.line),te=c&&e.direction=="rtl"?-i:i;function ie(){var it=t.line+te;return it<e.first||it>=e.first+e.size?!1:(t=new He(it,t.ch,t.sticky),Z=qe(e,it))}function ye(it){var Qe;if(r=="codepoint"){var st=Z.text.charCodeAt(t.ch+(r>0?0:-1));isNaN(st)?Qe=null:Qe=new He(t.line,Math.max(0,Math.min(Z.text.length,t.ch+i*(st>=55296&&st<56320?2:1))),-i)}else c?Qe=Ml(e.cm,Z,t,i):Qe=Ua(Z,t,i);if(Qe==null)if(!it&&ie())t=Ba(c,e.cm,Z,t.line,te);else return!1;else t=Qe;return!0}if(r=="char"||r=="codepoint")ye();else if(r=="column")ye(!0);else if(r=="word"||r=="group")for(var Ee=null,ke=r=="group",De=e.cm&&e.cm.getHelper(t,"wordChars"),Fe=!0;!(i<0&&!ye(!Fe));Fe=!1){var Ue=Z.text.charAt(t.ch)||`
|
|
`,Xe=Ie(Ue,De)?"w":ke&&Ue==`
|
|
`?"n":!ke||/\s/.test(Ue)?null:"p";if(ke&&!Fe&&!Xe&&(Xe="s"),Ee&&Ee!=Xe){i<0&&(i=1,ye(),t.sticky="after");break}if(Xe&&(Ee=Xe),i>0&&!ye(!Fe))break}var Je=Ji(e,t,P,V,!0);return rr(P,Je)&&(Je.hitSide=!0),Je}function Ro(e,t,i,r){var c=e.doc,P=t.left,V;if(r=="page"){var Z=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),te=Math.max(Z-.5*Lr(e.display),3);V=(i>0?t.bottom:t.top)+i*te}else r=="line"&&(V=i>0?t.bottom+3:t.top-3);for(var ie;!(ie=va(e,P,V),!ie.outside);){if(i<0?V<=0:V>=c.height){ie.hitSide=!0;break}V+=i*5}return ie}var Ft=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new J,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Ft.prototype.init=function(e){var t=this,i=this,r=i.cm,c=i.div=e.lineDiv;Co(c,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function P(Z){for(var te=Z.target;te;te=te.parentNode){if(te==c)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(te.className))break}return!1}Me(c,"paste",function(Z){if(!P(Z)||ee(r,Z)||To(Z,r))return;G<=11&&setTimeout(Zt(r,function(){return t.updateFromDOM()}),20)}),Me(c,"compositionstart",function(Z){t.composing={data:Z.data,done:!1}}),Me(c,"compositionupdate",function(Z){t.composing||(t.composing={data:Z.data,done:!1})}),Me(c,"compositionend",function(Z){t.composing&&(Z.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Me(c,"touchstart",function(){return i.forceCompositionEnd()}),Me(c,"input",function(){t.composing||t.readFromDOMSoon()});function V(Z){if(!P(Z)||ee(r,Z))return;if(r.somethingSelected())na({lineWise:!1,text:r.getSelections()}),Z.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var te=So(r);na({lineWise:!0,text:te.text}),Z.type=="cut"&&r.operation(function(){r.setSelections(te.ranges,0,be),r.replaceSelection("",null,"cut")})}else return;if(Z.clipboardData){Z.clipboardData.clearData();var ie=Pn.text.join(`
|
|
`);if(Z.clipboardData.setData("Text",ie),Z.clipboardData.getData("Text")==ie){Z.preventDefault();return}}var ye=Ao(),Ee=ye.firstChild;r.display.lineSpace.insertBefore(ye,r.display.lineSpace.firstChild),Ee.value=Pn.text.join(`
|
|
`);var ke=document.activeElement;F(Ee),setTimeout(function(){r.display.lineSpace.removeChild(ye),ke.focus(),ke==c&&i.showPrimarySelection()},50)}Me(c,"copy",V),Me(c,"cut",V)},Ft.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Ft.prototype.prepareSelection=function(){var e=ps(this.cm,!1);return e.focus=document.activeElement==this.div,e},Ft.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Ft.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Ft.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,i=t.doc.sel.primary(),r=i.from(),c=i.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||c.line<t.display.viewFrom){e.removeAllRanges();return}var P=ra(t,e.anchorNode,e.anchorOffset),V=ra(t,e.focusNode,e.focusOffset);if(P&&!P.bad&&V&&!V.bad&&mt(ir(P,V),r)==0&&mt(Er(P,V),c)==0)return;var Z=t.display.view,te=r.line>=t.display.viewFrom&&Oo(t,r)||{node:Z[0].measure.map[2],offset:0},ie=c.line<t.display.viewTo&&Oo(t,c);if(!ie){var ye=Z[Z.length-1].measure,Ee=ye.maps?ye.maps[ye.maps.length-1]:ye.map;ie={node:Ee[Ee.length-1],offset:Ee[Ee.length-2]-Ee[Ee.length-3]}}if(!te||!ie){e.removeAllRanges();return}var ke=e.rangeCount&&e.getRangeAt(0),De;try{De=y(te.node,te.offset,ie.offset,ie.node)}catch(Fe){}De&&(!N&&t.state.focused?(e.collapse(te.node,te.offset),De.collapsed||(e.removeAllRanges(),e.addRange(De))):(e.removeAllRanges(),e.addRange(De)),ke&&e.anchorNode==null?e.addRange(ke):N&&this.startGracePeriod()),this.rememberSelection()},Ft.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)},Ft.prototype.showMultipleSelections=function(e){C(this.cm.display.cursorDiv,e.cursors),C(this.cm.display.selectionDiv,e.selection)},Ft.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Ft.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return _(this.div,t)},Ft.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Ft.prototype.blur=function(){this.div.blur()},Ft.prototype.getField=function(){return this.div},Ft.prototype.supportsTouch=function(){return!0},Ft.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():En(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)},Ft.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Ft.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(o&&v&&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 i=ra(t,e.anchorNode,e.anchorOffset),r=ra(t,e.focusNode,e.focusOffset);i&&r&&En(t,function(){ln(t.doc,Qn(i,r),be),(i.bad||r.bad)&&(t.curOp.selectionChanged=!0)})},Ft.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,i=e.doc.sel.primary(),r=i.from(),c=i.to();if(r.ch==0&&r.line>e.firstLine()&&(r=He(r.line-1,qe(e.doc,r.line-1).length)),c.ch==qe(e.doc,c.line).text.length&&c.line<e.lastLine()&&(c=He(c.line+1,0)),r.line<t.viewFrom||c.line>t.viewTo-1)return!1;var P,V,Z;r.line==t.viewFrom||(P=fr(e,r.line))==0?(V=gt(t.view[0].line),Z=t.view[0].node):(V=gt(t.view[P].line),Z=t.view[P-1].node.nextSibling);var te=fr(e,c.line),ie,ye;if(te==t.view.length-1?(ie=t.viewTo-1,ye=t.lineDiv.lastChild):(ie=gt(t.view[te+1].line)-1,ye=t.view[te+1].node.previousSibling),!Z)return!1;for(var Ee=e.doc.splitLines(tu(e,Z,ye,V,ie)),ke=Ot(e.doc,He(V,0),He(ie,qe(e.doc,ie).text.length));Ee.length>1&&ke.length>1;)if(b(Ee)==b(ke))Ee.pop(),ke.pop(),ie--;else if(Ee[0]==ke[0])Ee.shift(),ke.shift(),V++;else break;for(var De=0,Fe=0,Ue=Ee[0],Xe=ke[0],Je=Math.min(Ue.length,Xe.length);De<Je&&Ue.charCodeAt(De)==Xe.charCodeAt(De);)++De;for(var it=b(Ee),Qe=b(ke),st=Math.min(it.length-(Ee.length==1?De:0),Qe.length-(ke.length==1?De:0));Fe<st&&it.charCodeAt(it.length-Fe-1)==Qe.charCodeAt(Qe.length-Fe-1);)++Fe;if(Ee.length==1&&ke.length==1&&V==r.line)for(;De&&De>r.ch&&it.charCodeAt(it.length-Fe-1)==Qe.charCodeAt(Qe.length-Fe-1);)De--,Fe++;Ee[Ee.length-1]=it.slice(0,it.length-Fe).replace(/^\u200b+/,""),Ee[0]=Ee[0].slice(De).replace(/\u200b+$/,"");var ft=He(V,De),ht=He(ie,ke.length?b(ke).length-Fe:0);if(Ee.length>1||Ee[0]||mt(ft,ht))return Ur(e.doc,Ee,ft,ht,"+input"),!0},Ft.prototype.ensurePolled=function(){this.forceCompositionEnd()},Ft.prototype.reset=function(){this.forceCompositionEnd()},Ft.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Ft.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)},Ft.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&En(this.cm,function(){return gn(e.cm)})},Ft.prototype.setUneditable=function(e){e.contentEditable="false"},Ft.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||Zt(this.cm,za)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Ft.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Ft.prototype.onContextMenu=function(){},Ft.prototype.resetPosition=function(){},Ft.prototype.needsContentAttribute=!0;function Oo(e,t){var i=fa(e,t.line);if(!i||i.hidden)return null;var r=qe(e.doc,t.line),c=es(i,r,t.line),P=je(r,e.doc.direction),V="left";if(P){var Z=Ge(P,t.ch);V=Z%2?"right":"left"}var te=rs(c.map,t.ch,V);return te.offset=te.collapse=="right"?te.end:te.start,te}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Gr(e,t){return t&&(e.bad=!0),e}function tu(e,t,i,r,c){var P="",V=!1,Z=e.doc.lineSeparator(),te=!1;function ie(De){return function(Fe){return Fe.id==De}}function ye(){V&&(P+=Z,te&&(P+=Z),V=te=!1)}function Ee(De){De&&(ye(),P+=De)}function ke(De){if(De.nodeType==1){var Fe=De.getAttribute("cm-text");if(Fe){Ee(Fe);return}var Ue=De.getAttribute("cm-marker"),Xe;if(Ue){var Je=e.findMarks(He(r,0),He(c+1,0),ie(+Ue));Je.length&&(Xe=Je[0].find(0))&&Ee(Ot(e.doc,Xe.from,Xe.to).join(Z));return}if(De.getAttribute("contenteditable")=="false")return;var it=/^(pre|div|p|li|table|br)$/i.test(De.nodeName);if(!/^br$/i.test(De.nodeName)&&De.textContent.length==0)return;it&&ye();for(var Qe=0;Qe<De.childNodes.length;Qe++)ke(De.childNodes[Qe]);/^(pre|p)$/i.test(De.nodeName)&&(te=!0),it&&(V=!0)}else De.nodeType==3&&Ee(De.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(ke(t),t==i);)t=t.nextSibling,te=!1;return P}function ra(e,t,i){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[i],!r)return Gr(e.clipPos(He(e.display.viewTo-1)),!0);t=null,i=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var c=0;c<e.display.view.length;c++){var P=e.display.view[c];if(P.node==r)return nu(P,t,i)}}function nu(e,t,i){var r=e.text.firstChild,c=!1;if(!t||!_(r,t))return Gr(He(gt(e.line),0),!0);if(t==r&&(c=!0,t=r.childNodes[i],i=0,!t)){var P=e.rest?b(e.rest):e.line;return Gr(He(gt(P),P.text.length),c)}var V=t.nodeType==3?t:null,Z=t;for(!V&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(V=t.firstChild,i&&(i=V.nodeValue.length));Z.parentNode!=r;)Z=Z.parentNode;var te=e.measure,ie=te.maps;function ye(Xe,Je,it){for(var Qe=-1;Qe<(ie?ie.length:0);Qe++)for(var st=Qe<0?te.map:ie[Qe],ft=0;ft<st.length;ft+=3){var ht=st[ft+2];if(ht==Xe||ht==Je){var wt=gt(Qe<0?e.line:e.rest[Qe]),jt=st[ft]+it;return(it<0||ht!=Xe)&&(jt=st[ft+(it?1:0)]),He(wt,jt)}}}var Ee=ye(V,Z,i);if(Ee)return Gr(Ee,c);for(var ke=Z.nextSibling,De=V?V.nodeValue.length-i:0;ke;ke=ke.nextSibling){if(Ee=ye(ke,ke.firstChild,0),Ee)return Gr(He(Ee.line,Ee.ch-De),c);De+=ke.textContent.length}for(var Fe=Z.previousSibling,Ue=i;Fe;Fe=Fe.previousSibling){if(Ee=ye(Fe,Fe.firstChild,-1),Ee)return Gr(He(Ee.line,Ee.ch+Ue),c);Ue+=Fe.textContent.length}}var Vt=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new J,this.hasSelection=!1,this.composing=null};Vt.prototype.init=function(e){var t=this,i=this,r=this.cm;this.createField(e);var c=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),d&&(c.style.width="0px"),Me(c,"input",function(){K&&G>=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),Me(c,"paste",function(V){if(ee(r,V)||To(V,r))return;r.state.pasteIncoming=+new Date,i.fastPoll()});function P(V){if(ee(r,V))return;if(r.somethingSelected())na({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var Z=So(r);na({lineWise:!0,text:Z.text}),V.type=="cut"?r.setSelections(Z.ranges,null,be):(i.prevInput="",c.value=Z.text.join(`
|
|
`),F(c))}else return;V.type=="cut"&&(r.state.cutIncoming=+new Date)}Me(c,"cut",P),Me(c,"copy",P),Me(e.scroller,"paste",function(V){if(zn(e,V)||ee(r,V))return;if(!c.dispatchEvent){r.state.pasteIncoming=+new Date,i.focus();return}var Z=new Event("paste");Z.clipboardData=V.clipboardData,c.dispatchEvent(Z)}),Me(e.lineSpace,"selectstart",function(V){zn(e,V)||re(V)}),Me(c,"compositionstart",function(){var V=r.getCursor("from");i.composing&&i.composing.range.clear(),i.composing={start:V,range:r.markText(V,r.getCursor("to"),{className:"CodeMirror-composing"})}}),Me(c,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},Vt.prototype.createField=function(e){this.wrapper=Ao(),this.textarea=this.wrapper.firstChild},Vt.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Vt.prototype.prepareSelection=function(){var e=this.cm,t=e.display,i=e.doc,r=ps(e);if(e.options.moveInputWithCursor){var c=kn(e,i.sel.primary().head,"div"),P=t.wrapper.getBoundingClientRect(),V=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,c.top+V.top-P.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,c.left+V.left-P.left))}return r},Vt.prototype.showSelection=function(e){var t=this.cm,i=t.display;C(i.cursorDiv,e.cursors),C(i.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Vt.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var i=t.getSelection();this.textarea.value=i,t.state.focused&&F(this.textarea),K&&G>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",K&&G>=9&&(this.hasSelection=null))},Vt.prototype.getField=function(){return this.textarea},Vt.prototype.supportsTouch=function(){return!1},Vt.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!h||j()!=this.textarea))try{this.textarea.focus()}catch(e){}},Vt.prototype.blur=function(){this.textarea.blur()},Vt.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Vt.prototype.receivedFocus=function(){this.slowPoll()},Vt.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()})},Vt.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function i(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,i)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,i)},Vt.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||at(i)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var c=i.value;if(c==r&&!t.somethingSelected())return!1;if(K&&G>=9&&this.hasSelection===c||s&&/[\uf700-\uf7ff]/.test(c))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var P=c.charCodeAt(0);if(P==8203&&!r&&(r="\u200B"),P==8666)return this.reset(),this.cm.execCommand("undo")}for(var V=0,Z=Math.min(r.length,c.length);V<Z&&r.charCodeAt(V)==c.charCodeAt(V);)++V;return En(t,function(){za(t,c.slice(V),r.length-V,null,e.composing?"*compose":null),c.length>1e3||c.indexOf(`
|
|
`)>-1?i.value=e.prevInput="":e.prevInput=c,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Vt.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Vt.prototype.onKeyPress=function(){K&&G>=9&&(this.hasSelection=null),this.fastPoll()},Vt.prototype.onContextMenu=function(e){var t=this,i=t.cm,r=i.display,c=t.textarea;t.contextMenuPending&&t.contextMenuPending();var P=dr(i,e),V=r.scroller.scrollTop;if(!P||p)return;var Z=i.options.resetSelectionOnContextMenu;Z&&i.doc.sel.contains(P)==-1&&Zt(i,ln)(i.doc,Qn(P),be);var te=c.style.cssText,ie=t.wrapper.style.cssText,ye=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",c.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(e.clientY-ye.top-5)+"px; left: "+(e.clientX-ye.left-5)+`px;
|
|
z-index: 1000; background: `+(K?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Ee;n&&(Ee=window.scrollY),r.input.focus(),n&&window.scrollTo(null,Ee),r.input.reset(),i.somethingSelected()||(c.value=t.prevInput=" "),t.contextMenuPending=De,r.selForContextMenu=i.doc.sel,clearTimeout(r.detectingSelectAll);function ke(){if(c.selectionStart!=null){var Ue=i.somethingSelected(),Xe="\u200B"+(Ue?c.value:"");c.value="\u21DA",c.value=Xe,t.prevInput=Ue?"":"\u200B",c.selectionStart=1,c.selectionEnd=Xe.length,r.selForContextMenu=i.doc.sel}}function De(){if(t.contextMenuPending!=De)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=ie,c.style.cssText=te,K&&G<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=V),c.selectionStart!=null){(!K||K&&G<9)&&ke();var Ue=0,Xe=function(){r.selForContextMenu==i.doc.sel&&c.selectionStart==0&&c.selectionEnd>0&&t.prevInput=="\u200B"?Zt(i,Vs)(i):Ue++<10?r.detectingSelectAll=setTimeout(Xe,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(Xe,200)}}if(K&&G>=9&&ke(),k){ge(e);var Fe=function(){rt(window,"mouseup",Fe),setTimeout(De,20)};Me(window,"mouseup",Fe)}else setTimeout(De,50)},Vt.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Vt.prototype.setUneditable=function(){},Vt.prototype.needsContentAttribute=!1;function ru(e,t){if(t=t?g(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 i=j();t.autofocus=i==e||e.getAttribute("autofocus")!=null&&i==document.body}function r(){e.value=Z.getValue()}var c;if(e.form&&(Me(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var P=e.form;c=P.submit;try{var V=P.submit=function(){r(),P.submit=c,P.submit(),P.submit=V}}catch(te){}}t.finishInit=function(te){te.save=r,te.getTextArea=function(){return e},te.toTextArea=function(){te.toTextArea=isNaN,r(),e.parentNode.removeChild(te.getWrapperElement()),e.style.display="",e.form&&(rt(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=c))}},e.style.display="none";var Z=Wt(function(te){return e.parentNode.insertBefore(te,e.nextSibling)},t);return Z}function iu(e){e.off=rt,e.on=Me,e.wheelEventPixels=cl,e.Doc=vn,e.splitLines=lt,e.countColumn=W,e.findColumn=Te,e.isWordChar=xe,e.Pass=Re,e.signal=ce,e.Line=ur,e.changeEnd=Zn,e.scrollbarModel=xs,e.Pos=He,e.cmpPos=mt,e.modes=xt,e.mimeModes=Ye,e.resolveMode=Kt,e.getMode=Pt,e.modeExtensions=dt,e.extendMode=yt,e.copyState=Tt,e.startState=hn,e.innerMode=Nt,e.commands=xi,e.keyMap=Kn,e.keyName=lo,e.isModifierKey=so,e.lookupKey=jr,e.normalizeKeyMap=kl,e.StringStream=Ut,e.SharedTextMarker=bi,e.TextMarker=er,e.LineWidget=yi,e.e_preventDefault=re,e.e_stopPropagation=ae,e.e_stop=ge,e.addClass=U,e.contains=_,e.rmClass=S,e.keyNames=tr}$l(Wt),ql(Wt);var au="iter insert remove copy getEditor constructor".split(" ");for(var ia in vn.prototype)vn.prototype.hasOwnProperty(ia)&&oe(au,ia)<0&&(Wt.prototype[ia]=function(e){return function(){return e.apply(this.doc,arguments)}}(vn.prototype[ia]));return de(vn),Wt.inputStyles={textarea:Vt,contenteditable:Ft},Wt.defineMode=function(e){!Wt.defaults.mode&&e!="null"&&(Wt.defaults.mode=e),Qt.apply(this,arguments)},Wt.defineMIME=nn,Wt.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Wt.defineMIME("text/plain","null"),Wt.defineExtension=function(e,t){Wt.prototype[e]=t},Wt.defineDocExtension=function(e,t){vn.prototype[e]=t},Wt.fromTextArea=ru,iu(Wt),Wt.version="5.58.2",Wt})},Y1PL:function(Ze,Se,q){"use strict";q.r(Se),q.d(Se,"ResizableTextArea",function(){return oe});var le=q("wx14"),Y=q("1OyB"),N=q("vuIU"),$=q("Ji7U"),H=q("LK+K"),M=q("q1tI"),K=q("VTBJ"),G=q("rePB"),n=q("Zm9Q"),O=q("Kwbf"),v=q("c+Xe"),p=q("m+aA"),m=q("bdgK"),u=new Map;function l(be){be.forEach(function(Le){var Ce,Te=Le.target;(Ce=u.get(Te))===null||Ce===void 0||Ce.forEach(function(ve){return ve(Te)})})}var d=new m.default(l),o=null,h=null;function s(be,Le){u.has(be)||(u.set(be,new Set),d.observe(be)),u.get(be).add(Le)}function a(be,Le){u.has(be)&&(u.get(be).delete(Le),u.get(be).size||(d.unobserve(be),u.delete(be)))}var A=function(be){Object($.a)(Ce,be);var Le=Object(H.a)(Ce);function Ce(){return Object(Y.a)(this,Ce),Le.apply(this,arguments)}return Object(N.a)(Ce,[{key:"render",value:function(){return this.props.children}}]),Ce}(M.Component),E=M.createContext(null);function T(be){var Le=be.children,Ce=be.onBatchResize,Te=M.useRef(0),ve=M.useRef([]),X=M.useContext(E),b=M.useCallback(function(I,B,Q){Te.current+=1;var z=Te.current;ve.current.push({size:I,element:B,data:Q}),Promise.resolve().then(function(){z===Te.current&&(Ce==null||Ce(ve.current),ve.current=[])}),X==null||X(I,B,Q)},[Ce,X]);return M.createElement(E.Provider,{value:b},Le)}function k(be){var Le=be.children,Ce=be.disabled,Te=M.useRef(null),ve=M.useRef(null),X=M.useContext(E),b=M.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),I=M.isValidElement(Le)&&Object(v.c)(Le),B=I?Le.ref:null,Q=M.useMemo(function(){return Object(v.a)(B,Te)},[B,Te]),z=M.useRef(be);z.current=be;var he=M.useCallback(function(xe){var Ie=z.current,ue=Ie.onResize,me=Ie.data,we=xe.getBoundingClientRect(),Ae=we.width,Ne=we.height,Be=xe.offsetWidth,Ke=xe.offsetHeight,Ge=Math.floor(Ae),$e=Math.floor(Ne);if(b.current.width!==Ge||b.current.height!==$e||b.current.offsetWidth!==Be||b.current.offsetHeight!==Ke){var je={width:Ge,height:$e,offsetWidth:Be,offsetHeight:Ke};b.current=je;var We=Be===Math.round(Ae)?Ae:Be,Me=Ke===Math.round(Ne)?Ne:Ke,tt=Object(K.a)(Object(K.a)({},je),{},{offsetWidth:We,offsetHeight:Me});X==null||X(tt,xe,me),ue&&Promise.resolve().then(function(){ue(tt,xe)})}},[]);return M.useEffect(function(){var xe=Object(p.a)(Te.current)||Object(p.a)(ve.current);return xe&&!Ce&&s(xe,he),function(){return a(xe,he)}},[Te.current,Ce]),M.createElement(A,{ref:ve},I?M.cloneElement(Le,{ref:Q}):Le)}var L="rc-observer-key";function S(be){var Le=be.children,Ce=Object(n.a)(Le);return Ce.map(function(Te,ve){var X=(Te==null?void 0:Te.key)||"".concat(L,"-").concat(ve);return M.createElement(k,Object(le.a)({},be,{key:X}),Te)})}S.Collection=T;var R=S,C=q("bT9E"),f=q("TSYQ"),w=q.n(f),y=`
|
|
min-height:0 !important;
|
|
max-height:none !important;
|
|
height:0 !important;
|
|
visibility:hidden !important;
|
|
overflow:hidden !important;
|
|
position:absolute !important;
|
|
z-index:-1000 !important;
|
|
top:0 !important;
|
|
right:0 !important
|
|
`,_=["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"],j={},U;function x(be){var Le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ce=be.getAttribute("id")||be.getAttribute("data-reactid")||be.getAttribute("name");if(Le&&j[Ce])return j[Ce];var Te=window.getComputedStyle(be),ve=Te.getPropertyValue("box-sizing")||Te.getPropertyValue("-moz-box-sizing")||Te.getPropertyValue("-webkit-box-sizing"),X=parseFloat(Te.getPropertyValue("padding-bottom"))+parseFloat(Te.getPropertyValue("padding-top")),b=parseFloat(Te.getPropertyValue("border-bottom-width"))+parseFloat(Te.getPropertyValue("border-top-width")),I=_.map(function(Q){return"".concat(Q,":").concat(Te.getPropertyValue(Q))}).join(";"),B={sizingStyle:I,paddingSize:X,borderSize:b,boxSizing:ve};return Le&&Ce&&(j[Ce]=B),B}function F(be){var Le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ce=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Te=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;U||(U=document.createElement("textarea"),U.setAttribute("tab-index","-1"),U.setAttribute("aria-hidden","true"),document.body.appendChild(U)),be.getAttribute("wrap")?U.setAttribute("wrap",be.getAttribute("wrap")):U.removeAttribute("wrap");var ve=x(be,Le),X=ve.paddingSize,b=ve.borderSize,I=ve.boxSizing,B=ve.sizingStyle;U.setAttribute("style","".concat(B,";").concat(y)),U.value=be.value||be.placeholder||"";var Q=Number.MIN_SAFE_INTEGER,z=Number.MAX_SAFE_INTEGER,he=U.scrollHeight,xe;if(I==="border-box"?he+=b:I==="content-box"&&(he-=X),Ce!==null||Te!==null){U.value=" ";var Ie=U.scrollHeight-X;Ce!==null&&(Q=Ie*Ce,I==="border-box"&&(Q=Q+X+b),he=Math.max(Q,he)),Te!==null&&(z=Ie*Te,I==="border-box"&&(z=z+X+b),xe=he>z?"":"hidden",he=Math.min(z,he))}return{height:he,minHeight:Q,maxHeight:z,overflowY:xe,resize:"none"}}var D=q("Gytx"),g=q.n(D),W;(function(be){be[be.NONE=0]="NONE",be[be.RESIZING=1]="RESIZING",be[be.RESIZED=2]="RESIZED"})(W||(W={}));var J=function(be){Object($.a)(Ce,be);var Le=Object(H.a)(Ce);function Ce(Te){var ve;return Object(Y.a)(this,Ce),ve=Le.call(this,Te),ve.nextFrameActionId=void 0,ve.resizeFrameId=void 0,ve.textArea=void 0,ve.saveTextArea=function(X){ve.textArea=X},ve.handleResize=function(X){var b=ve.state.resizeStatus,I=ve.props,B=I.autoSize,Q=I.onResize;if(b!==W.NONE)return;typeof Q=="function"&&Q(X),B&&ve.resizeOnNextFrame()},ve.resizeOnNextFrame=function(){cancelAnimationFrame(ve.nextFrameActionId),ve.nextFrameActionId=requestAnimationFrame(ve.resizeTextarea)},ve.resizeTextarea=function(){var X=ve.props.autoSize;if(!X||!ve.textArea)return;var b=X.minRows,I=X.maxRows,B=F(ve.textArea,!1,b,I);ve.setState({textareaStyles:B,resizeStatus:W.RESIZING},function(){cancelAnimationFrame(ve.resizeFrameId),ve.resizeFrameId=requestAnimationFrame(function(){ve.setState({resizeStatus:W.RESIZED},function(){ve.resizeFrameId=requestAnimationFrame(function(){ve.setState({resizeStatus:W.NONE}),ve.fixFirefoxAutoScroll()})})})})},ve.renderTextArea=function(){var X=ve.props,b=X.prefixCls,I=b===void 0?"rc-textarea":b,B=X.autoSize,Q=X.onResize,z=X.className,he=X.disabled,xe=ve.state,Ie=xe.textareaStyles,ue=xe.resizeStatus,me=Object(C.a)(ve.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),we=w()(I,z,Object(G.a)({},"".concat(I,"-disabled"),he));"value"in me&&(me.value=me.value||"");var Ae=Object(K.a)(Object(K.a)(Object(K.a)({},ve.props.style),Ie),ue===W.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return M.createElement(R,{onResize:ve.handleResize,disabled:!(B||Q)},M.createElement("textarea",Object(le.a)({},me,{className:we,style:Ae,ref:ve.saveTextArea})))},ve.state={textareaStyles:{},resizeStatus:W.NONE},ve}return Object(N.a)(Ce,[{key:"componentDidUpdate",value:function(ve){(ve.value!==this.props.value||!g()(ve.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 ve=this.textArea.selectionStart,X=this.textArea.selectionEnd;this.textArea.setSelectionRange(ve,X)}}catch(b){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Ce}(M.Component),oe=J,fe=function(be){Object($.a)(Ce,be);var Le=Object(H.a)(Ce);function Ce(Te){var ve;Object(Y.a)(this,Ce),ve=Le.call(this,Te),ve.resizableTextArea=void 0,ve.focus=function(){ve.resizableTextArea.textArea.focus()},ve.saveTextArea=function(b){ve.resizableTextArea=b},ve.handleChange=function(b){var I=ve.props.onChange;ve.setValue(b.target.value,function(){ve.resizableTextArea.resizeTextarea()}),I&&I(b)},ve.handleKeyDown=function(b){var I=ve.props,B=I.onPressEnter,Q=I.onKeyDown;b.keyCode===13&&B&&B(b),Q&&Q(b)};var X=typeof Te.value=="undefined"||Te.value===null?Te.defaultValue:Te.value;return ve.state={value:X},ve}return Object(N.a)(Ce,[{key:"setValue",value:function(ve,X){"value"in this.props||this.setState({value:ve},X)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return M.createElement(oe,Object(le.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(ve){return"value"in ve?{value:ve.value}:null}}]),Ce}(M.Component),Re=Se.default=fe},ZW9T:function(Ze,Se,q){"use strict";q.d(Se,"a",function(){return D});var le=q("k1fw"),Y=q("oBTY"),N=q("miYZ"),$=q("tsqr"),H=q("rAM+"),M=q("tJVT"),K=q("PpiC"),G=q("q1tI"),n=q.n(G),O=q("bdgK"),v=q("9og8"),p=q("WmNS"),m=q.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"]},l={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"]},d={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(`
|
|
`)}]},o={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=q("5VLF"),s=q.n(h),a={languages:["c","abap","apex","azcli","bat","cameligo","clojure","coffee","cpp","csharp","csp","css","dockerfile","fsharp","go","graphql","handlebars","html","ini","java","javascript","json","kotlin","less","lua","markdown","mips","msdax","mysql","objective-c","pascal","pascaligo","perl","pgsql","php","postiats","powerquery","powershell","pug","python","r","razor","redis","redshift","restructuredtext","ruby","rust","sb","scheme","scss","shell","solidity","sophia","sql","st","swift","tcl","twig","vb","xml","yaml'"],tables:{users:["name","id","email","phone","password"],roles:["id","name","order","created_at","updated_at","deleted_at"]}},A=function(W,J){return J.map(function(oe){return{label:oe,kind:W.languages.CompletionItemKind.Keyword,insertText:oe}})},E=function(W){return Object.keys(a.tables).map(function(J){return{label:J,kind:W.languages.CompletionItemKind.Variable,insertText:J}})},T=function(W,J){var oe=a.tables[W];return oe?oe.map(function(fe){return{label:fe,kind:J.languages.CompletionItemKind.Field,insertText:fe}}):[]};function k(g,W,J,oe,fe){var Re=W.getWordUntilPosition(J),be={startLineNumber:J.lineNumber,endLineNumber:J.lineNumber,startColumn:Re.startColumn,endColumn:Re.endColumn},Le=oe.map(function(Ce){return{label:Ce,kind:g.languages.CompletionItemKind.Keyword,insertText:Ce,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:be}});return fe.map(function(Ce){Le.push(Object(le.a)(Object(le.a)({},Ce),{},{range:be}))}),Le}var L=function(g){a.languages.map(function(fe){return g.languages.registerDocumentFormattingEditProvider(fe,{provideDocumentFormattingEdits:function(be,Le,Ce){return Object(v.a)(m.a.mark(function Te(){var ve;return m.a.wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return ve=s()(be.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}),b.abrupt("return",[{range:be.getFullModelRange(),text:ve}]);case 2:case"end":return b.stop()}},Te)}))()}}),fe});var W=d.quickKey.map(function(fe){return{label:fe.label,kind:g.languages.CompletionItemKind.Method,insertText:fe.content,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),J=o.quickKey.map(function(fe){return{label:fe.label,kind:g.languages.CompletionItemKind.Method,insertText:fe.content,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),oe=l.quickKey.map(function(fe){return{label:fe.label,kind:g.languages.CompletionItemKind.Method,insertText:fe.content,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet}});g.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(Re,be){var Le=Re.getWordUntilPosition(be),Ce={startLineNumber:be.lineNumber,endLineNumber:be.lineNumber,startColumn:Le.startColumn,endColumn:Le.endColumn},Te=Re.getLineContent(be.lineNumber).substring(Le.startColumn-2,Le.endColumn);return{suggestions:[].concat(Object(Y.a)(d.keywords.map(function(ve){return{label:ve,kind:g.languages.CompletionItemKind.Function,documentation:ve,insertText:ve,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ce}})),Object(Y.a)(d.quickKey.map(function(ve){return{label:ve.label,kind:g.languages.CompletionItemKind.Function,documentation:ve.content,insertText:Te.startsWith("#")?ve.content.replace(/#/,""):ve.content,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ce}})))}}}),g.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(Re,be){var Le=Re.getWordUntilPosition(be),Ce={startLineNumber:be.lineNumber,endLineNumber:be.lineNumber,startColumn:Le.startColumn,endColumn:Le.endColumn};return{suggestions:Object(Y.a)(u.keywords.map(function(Te){return{label:Te,kind:g.languages.CompletionItemKind.Function,documentation:Te,insertText:Te,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ce}}))}}}),g.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(Re,be){var Le=Re.getWordUntilPosition(be),Ce={startLineNumber:be.lineNumber,endLineNumber:be.lineNumber,startColumn:Le.startColumn,endColumn:Le.endColumn},Te=Re.getLineContent(be.lineNumber).substring(Le.startColumn-2,Le.endColumn);return{suggestions:[].concat(Object(Y.a)(l.keywords.map(function(ve){return{label:ve,kind:g.languages.CompletionItemKind.Function,documentation:ve,insertText:ve,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ce}})),Object(Y.a)(l.quickKey.map(function(ve){return{label:ve.label,kind:g.languages.CompletionItemKind.Function,documentation:ve.content,insertText:Te.startsWith("#")?ve.content.replace(/#/,""):ve.content,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ce}})))}}}),g.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(Re,be){var Le=Re.getWordUntilPosition(be),Ce={startLineNumber:be.lineNumber,endLineNumber:be.lineNumber,startColumn:Le.startColumn,endColumn:Le.endColumn},Te=Re.getLineContent(be.lineNumber).substring(Le.startColumn-2,Le.endColumn);return{suggestions:[].concat(Object(Y.a)(o.keywords.map(function(ve){return{label:ve,kind:g.languages.CompletionItemKind.Function,documentation:ve,insertText:ve,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ce}})),Object(Y.a)(o.quickKey.map(function(ve){return{label:ve.label,kind:g.languages.CompletionItemKind.Function,documentation:ve.content,insertText:Te.startsWith("#")?ve.content.replace(/#/,""):ve.content,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ce}})))}}})},S="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",R=q("fjLI"),C=q("LvDl"),f=q("+ua5");function w(g){return/^\d+$/.test(g)?"".concat(g,"px"):g}function y(){}var _=!1,j={"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 U(){var g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],W=g;if(Array.isArray(g)){for(var J=0;J<g.length;J++){var oe=j[g[J]];if(oe)return oe}return W[0]}return j[W]||W}var x=null,F=Se.b=function(g){var W=g.width,J=W===void 0?"100%":W,oe=g.height,fe=oe===void 0?"100%":oe,Re=g.value,be=g.language,Le=be===void 0?"javascript":be,Ce=g.style,Te=Ce===void 0?{}:Ce,ve=g.options,X=ve===void 0?{}:ve,b=g.overrideServices,I=b===void 0?{}:b,B=g.theme,Q=B===void 0?"vs-dark":B,z=g.onEditBlur,he=g.onSave,xe=g.autoHeight,Ie=xe===void 0?!1:xe,ue=g.forbidCopy,me=ue===void 0?!1:ue,we=g.onChange,Ae=we===void 0?y:we,Ne=g.editorDidMount,Be=Ne===void 0?y:Ne,Ke=g.onFocus,Ge=Ke===void 0?y:Ke,$e=g.filename,je=$e===void 0?"educoder.txt":$e,We=g.errorLine,Me=g.errorContent,tt=Me===void 0?"":Me,rt=Object(K.a)(g,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),ce=Object(G.useRef)(),ee=Object(G.useRef)({}),ne=Object(G.useRef)(),se=Object(G.useRef)(),de=Object(G.useRef)(!1),re=Object(G.useRef)(),ae=Object(G.useState)(!1),pe=Object(M.a)(ae,2),ge=pe[0],_e=pe[1];function Oe(){var dt;return ce.current&&(dt=new O.default(function(yt){var Tt=Object(H.a)(yt),Nt;try{for(Tt.s();!(Nt=Tt.n()).done;){var hn=Nt.value;(hn.target.offsetHeight>0||hn.target.offsetWidth>0)&&ee.current.instance.layout()}}catch(Ut){Tt.e(Ut)}finally{Tt.f()}}),dt.observe(ce.current)),dt}function Pe(){$.b.warn(decodeURIComponent(S))}var ze=function(){var yt=ee.current.instance;if(Re!=null&&yt&&ge){var Tt=yt.getModel();Tt&&Re!==Tt.getValue()&&(_=!0,Tt.setValue(Re),yt.layout(),_=!1)}};Object(G.useEffect)(function(){se.current&&clearTimeout(se.current),se.current=setTimeout(function(){ze()},500)},[Re,ge,ee.current]),Object(G.useEffect)(function(){if(We&&ee.current&&ee.current.instance){var dt=ee.current.instance;dt.changeViewZones(function(Tt){var Nt=document.createElement("div");Nt.style.padding="10px 20px",Nt.style.width="calc(100% - 20px)",Nt.className="my-error-line-wrp",Nt.innerHTML=tt,Tt.addZone({afterLineNumber:We||11,heightInLines:3,domNode:Nt})});var yt={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}};dt.addOverlayWidget(yt),dt.revealPositionInCenter({lineNumber:20,column:1})}},[We,ee.current,ge]);function et(){var dt=ee.current.instance;if(dt){var yt=dt.getSelection(),Tt=ee.current.pastePos||{},Nt=new x.Range(Tt.startLineNumber||yt.endLineNumber,Tt.startColumn||yt.endColumn,Tt.endLineNumber||yt.endLineNumber,Tt.endColumn||yt.endColumn);setTimeout(function(){dt.executeEdits("",[{range:Nt,text:""}])},300)}}function nt(dt){(window.navigator.platform.match("Mac")?dt.metaKey:dt.ctrlKey)&&dt.keyCode==83&&(dt.preventDefault(),he())}var _t=function(){if(Ie&&ee.current.instance){var yt=ee.current.instance.getContentHeight();Kt(yt<fe?fe:yt)}else Kt(fe)};function lt(dt){var yt=document.createEvent("MouseEvents");yt.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),dt.dispatchEvent(yt)}function at(dt,yt){var Tt=window.URL||window.webkitURL||window,Nt=new Blob([yt]),hn=document.createElementNS("http://www.w3.org/1999/xhtml","a");hn.href=Tt.createObjectURL(Nt),hn.download=dt,lt(hn)}Object(G.useEffect)(function(){_t()},[_t]),Object(G.useEffect)(function(){ce.current&&!ge&&Promise.all([q.e(18),q.e(29)]).then(q.t.bind(null,"M/lh",7)).then(function(dt){try{x=dt,ee.current.instance=x.editor.create(ce.current,{value:Re,language:U(Le),theme:Q,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},I);var yt=ee.current.instance,Tt=R.d._menuItems,Nt=Object(Y.a)(Tt).find(function(It){return It[0]._debugName=="EditorContext"}),hn=Nt[1],Ut=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],qe=function(pt,gt){var Ct=pt._first;do{var sn,Ht,He=gt.includes((sn=Ct.element)===null||sn===void 0||((Ht=sn.command)===null||Ht===void 0)?void 0:Ht.id);He&&pt._remove(Ct)}while(Ct=Ct.next)};if(Be(yt,x),setTimeout(function(){_t(),ee.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){at(je||"educoder.txt",yt.getValue())}}),yt.getDomNode().addEventListener("input",function(){ne.current.autoFormat&&yt.getAction("editor.action.formatDocument").run()})},500),ee.current.subscription=yt.onDidChangeModelContent(function(It){de.current?clearTimeout(re.current):(_t(),Ae(yt.getValue(),It)),re.current=setTimeout(function(){de.current=!1},500)}),window.Monaco||L(x,U(Le)),me&&(qe(hn,Ut),ce.current.classList.add("noCopyPaste"),yt.onKeyDown(function(It){var pt=It.keyCode,gt=It.ctrlKey,Ct=It.metaKey;(pt===33||pt===52)&&(Ct||gt)&&(Pe(),It.preventDefault())})),window.Monaco=x,z&&yt.onDidBlurEditorWidget(function(){z(yt.getValue())}),Ge&&yt.onDidFocusEditorText(function(){Ge(yt.getValue())}),me){yt.addCommand(x.KeyMod.CtrlCmd|x.KeyCode.KEY_V,function(){return Pe(),null}),yt.onDidPaste(function(It){ee.current.pastePos=It});try{window.addEventListener("paste",et)}catch(It){}}var Ot=Oe();return _e(!0),function(){var It=ee.current.instance;It.dispose();var pt=It.getModel();pt&&pt.dispose(),ee.current.subscription&&ee.current.subscription.dispose(),me&&window.removeEventListener("paste",et),Ot.unobserve(ce.current)}}catch(It){}})},[]),Object(G.useEffect)(function(){var dt=ee.current.instance;if(dt&&ge)return document.addEventListener("keydown",nt,!1),function(){document.removeEventListener("keydown",nt)}},[he,ge]),Object(G.useEffect)(function(){var dt=ee.current.instance;if(dt&&ge){var yt=U(Le);x.editor.setModelLanguage(dt.getModel(),yt),console.log("language:",Le,dt.getModel(),yt)}},[Le,ge]),Object(G.useEffect)(function(){var dt=ee.current.instance;dt&&ge&&x.editor.setTheme(Q)},[Q,ge]),Object(G.useEffect)(function(){var dt=ee.current.instance;ne.current=X,dt&&ge&&(dt.updateOptions(Object(le.a)({},X)),setTimeout(function(){dt.getModel().updateOptions(Object(le.a)({},X))},200))},[JSON.stringify(X),ge]),Object(G.useEffect)(function(){var dt=ee.current.instance;dt&&ge&&dt.layout()},[J,fe,ge]);var Rt=Object(G.useState)(w(J)),ot=Object(M.a)(Rt,2),Et=ot[0],xt=ot[1],Ye=Object(G.useState)(w(fe)),Qt=Object(M.a)(Ye,2),nn=Qt[0],Kt=Qt[1],Pt=Object(le.a)(Object(le.a)({},Te),{},{width:Et,height:nn});return n.a.createElement("div",{className:"my-monaco-editor",ref:ce,style:Pt})};function D(g){var W=g.width,J=W===void 0?"100%":W,oe=g.height,fe=oe===void 0?"100%":oe,Re=g.original,be=g.modified,Le=g.language,Ce=g.options,Te=Ce===void 0?{}:Ce,ve=Object(G.useRef)(),X=Object(G.useState)(null),b=Object(M.a)(X,2),I=b[0],B=b[1];function Q(Ie){var ue;return ve.current&&(ue=new O.default(function(me){var we=Object(H.a)(me),Ae;try{for(we.s();!(Ae=we.n()).done;){var Ne=Ae.value;(Ne.target.offsetHeight>0||Ne.target.offsetWidth>0)&&Ie.layout()}}catch(Be){we.e(Be)}finally{we.f()}}),ue.observe(ve.current)),ue}Object(G.useEffect)(function(){ve.current&&Promise.all([q.e(18),q.e(29)]).then(q.t.bind(null,"M/lh",7)).then(function(Ie){x=Ie;var ue=x.editor.createDiffEditor(ve.current,Object(le.a)(Object(le.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},Te),{},{wordWrap:!0}));B(ue);var me=Q(ue);return function(){ue.dispose();var we=ue.getModel();we&&we.dispose(),me.unobserve(ve.current)}})},[]),Object(G.useEffect)(function(){I&&I.setModel({original:x.editor.createModel(Re,Le),modified:x.editor.createModel(be,Le)})},[Re,be,Le,I]);var z=w(J),he=w(fe),xe={width:z,height:he};return n.a.createElement("div",{className:"my-diff-editor",ref:ve,style:xe})}},Zss7:function(Ze,Se,q){var le;(function(Y){var N=/^\s+/,$=/\s+$/,H=0,M=Y.round,K=Y.min,G=Y.max,n=Y.random;function O(b,I){if(b=b||"",I=I||{},b instanceof O)return b;if(!(this instanceof O))return new O(b,I);var B=v(b);this._originalInput=b,this._r=B.r,this._g=B.g,this._b=B.b,this._a=B.a,this._roundA=M(100*this._a)/100,this._format=I.format||B.format,this._gradientType=I.gradientType,this._r<1&&(this._r=M(this._r)),this._g<1&&(this._g=M(this._g)),this._b<1&&(this._b=M(this._b)),this._ok=B.ok,this._tc_id=H++}O.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var b=this.toRgb();return(b.r*299+b.g*587+b.b*114)/1e3},getLuminance:function(){var b=this.toRgb(),I,B,Q,z,he,xe;return I=b.r/255,B=b.g/255,Q=b.b/255,I<=.03928?z=I/12.92:z=Y.pow((I+.055)/1.055,2.4),B<=.03928?he=B/12.92:he=Y.pow((B+.055)/1.055,2.4),Q<=.03928?xe=Q/12.92:xe=Y.pow((Q+.055)/1.055,2.4),.2126*z+.7152*he+.0722*xe},setAlpha:function(b){return this._a=F(b),this._roundA=M(100*this._a)/100,this},toHsv:function(){var b=l(this._r,this._g,this._b);return{h:b.h*360,s:b.s,v:b.v,a:this._a}},toHsvString:function(){var b=l(this._r,this._g,this._b),I=M(b.h*360),B=M(b.s*100),Q=M(b.v*100);return this._a==1?"hsv("+I+", "+B+"%, "+Q+"%)":"hsva("+I+", "+B+"%, "+Q+"%, "+this._roundA+")"},toHsl:function(){var b=m(this._r,this._g,this._b);return{h:b.h*360,s:b.s,l:b.l,a:this._a}},toHslString:function(){var b=m(this._r,this._g,this._b),I=M(b.h*360),B=M(b.s*100),Q=M(b.l*100);return this._a==1?"hsl("+I+", "+B+"%, "+Q+"%)":"hsla("+I+", "+B+"%, "+Q+"%, "+this._roundA+")"},toHex:function(b){return o(this._r,this._g,this._b,b)},toHexString:function(b){return"#"+this.toHex(b)},toHex8:function(b){return h(this._r,this._g,this._b,this._a,b)},toHex8String:function(b){return"#"+this.toHex8(b)},toRgb:function(){return{r:M(this._r),g:M(this._g),b:M(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+M(this._r)+", "+M(this._g)+", "+M(this._b)+")":"rgba("+M(this._r)+", "+M(this._g)+", "+M(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:M(D(this._r,255)*100)+"%",g:M(D(this._g,255)*100)+"%",b:M(D(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+M(D(this._r,255)*100)+"%, "+M(D(this._g,255)*100)+"%, "+M(D(this._b,255)*100)+"%)":"rgba("+M(D(this._r,255)*100)+"%, "+M(D(this._g,255)*100)+"%, "+M(D(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:U[o(this._r,this._g,this._b,!0)]||!1},toFilter:function(b){var I="#"+s(this._r,this._g,this._b,this._a),B=I,Q=this._gradientType?"GradientType = 1, ":"";if(b){var z=O(b);B="#"+s(z._r,z._g,z._b,z._a)}return"progid:DXImageTransform.Microsoft.gradient("+Q+"startColorstr="+I+",endColorstr="+B+")"},toString:function(b){var I=!!b;b=b||this._format;var B=!1,Q=this._a<1&&this._a>=0,z=!I&&Q&&(b==="hex"||b==="hex6"||b==="hex3"||b==="hex4"||b==="hex8"||b==="name");return z?b==="name"&&this._a===0?this.toName():this.toRgbString():(b==="rgb"&&(B=this.toRgbString()),b==="prgb"&&(B=this.toPercentageRgbString()),(b==="hex"||b==="hex6")&&(B=this.toHexString()),b==="hex3"&&(B=this.toHexString(!0)),b==="hex4"&&(B=this.toHex8String(!0)),b==="hex8"&&(B=this.toHex8String()),b==="name"&&(B=this.toName()),b==="hsl"&&(B=this.toHslString()),b==="hsv"&&(B=this.toHsvString()),B||this.toHexString())},clone:function(){return O(this.toString())},_applyModification:function(b,I){var B=b.apply(null,[this].concat([].slice.call(I)));return this._r=B._r,this._g=B._g,this._b=B._b,this.setAlpha(B._a),this},lighten:function(){return this._applyModification(T,arguments)},brighten:function(){return this._applyModification(k,arguments)},darken:function(){return this._applyModification(L,arguments)},desaturate:function(){return this._applyModification(a,arguments)},saturate:function(){return this._applyModification(A,arguments)},greyscale:function(){return this._applyModification(E,arguments)},spin:function(){return this._applyModification(S,arguments)},_applyCombination:function(b,I){return b.apply(null,[this].concat([].slice.call(I)))},analogous:function(){return this._applyCombination(y,arguments)},complement:function(){return this._applyCombination(R,arguments)},monochromatic:function(){return this._applyCombination(_,arguments)},splitcomplement:function(){return this._applyCombination(w,arguments)},triad:function(){return this._applyCombination(C,arguments)},tetrad:function(){return this._applyCombination(f,arguments)}},O.fromRatio=function(b,I){if(typeof b=="object"){var B={};for(var Q in b)b.hasOwnProperty(Q)&&(Q==="a"?B[Q]=b[Q]:B[Q]=Re(b[Q]));b=B}return O(b,I)};function v(b){var I={r:0,g:0,b:0},B=1,Q=null,z=null,he=null,xe=!1,Ie=!1;return typeof b=="string"&&(b=ve(b)),typeof b=="object"&&(Te(b.r)&&Te(b.g)&&Te(b.b)?(I=p(b.r,b.g,b.b),xe=!0,Ie=String(b.r).substr(-1)==="%"?"prgb":"rgb"):Te(b.h)&&Te(b.s)&&Te(b.v)?(Q=Re(b.s),z=Re(b.v),I=d(b.h,Q,z),xe=!0,Ie="hsv"):Te(b.h)&&Te(b.s)&&Te(b.l)&&(Q=Re(b.s),he=Re(b.l),I=u(b.h,Q,he),xe=!0,Ie="hsl"),b.hasOwnProperty("a")&&(B=b.a)),B=F(B),{ok:xe,format:b.format||Ie,r:K(255,G(I.r,0)),g:K(255,G(I.g,0)),b:K(255,G(I.b,0)),a:B}}function p(b,I,B){return{r:D(b,255)*255,g:D(I,255)*255,b:D(B,255)*255}}function m(b,I,B){b=D(b,255),I=D(I,255),B=D(B,255);var Q=G(b,I,B),z=K(b,I,B),he,xe,Ie=(Q+z)/2;if(Q==z)he=xe=0;else{var ue=Q-z;xe=Ie>.5?ue/(2-Q-z):ue/(Q+z);switch(Q){case b:he=(I-B)/ue+(I<B?6:0);break;case I:he=(B-b)/ue+2;break;case B:he=(b-I)/ue+4;break}he/=6}return{h:he,s:xe,l:Ie}}function u(b,I,B){var Q,z,he;b=D(b,360),I=D(I,100),B=D(B,100);function xe(me,we,Ae){return Ae<0&&(Ae+=1),Ae>1&&(Ae-=1),Ae<1/6?me+(we-me)*6*Ae:Ae<1/2?we:Ae<2/3?me+(we-me)*(2/3-Ae)*6:me}if(I===0)Q=z=he=B;else{var Ie=B<.5?B*(1+I):B+I-B*I,ue=2*B-Ie;Q=xe(ue,Ie,b+1/3),z=xe(ue,Ie,b),he=xe(ue,Ie,b-1/3)}return{r:Q*255,g:z*255,b:he*255}}function l(b,I,B){b=D(b,255),I=D(I,255),B=D(B,255);var Q=G(b,I,B),z=K(b,I,B),he,xe,Ie=Q,ue=Q-z;if(xe=Q===0?0:ue/Q,Q==z)he=0;else{switch(Q){case b:he=(I-B)/ue+(I<B?6:0);break;case I:he=(B-b)/ue+2;break;case B:he=(b-I)/ue+4;break}he/=6}return{h:he,s:xe,v:Ie}}function d(b,I,B){b=D(b,360)*6,I=D(I,100),B=D(B,100);var Q=Y.floor(b),z=b-Q,he=B*(1-I),xe=B*(1-z*I),Ie=B*(1-(1-z)*I),ue=Q%6,me=[B,xe,he,he,Ie,B][ue],we=[Ie,B,B,xe,he,he][ue],Ae=[he,he,Ie,B,B,xe][ue];return{r:me*255,g:we*255,b:Ae*255}}function o(b,I,B,Q){var z=[fe(M(b).toString(16)),fe(M(I).toString(16)),fe(M(B).toString(16))];return Q&&z[0].charAt(0)==z[0].charAt(1)&&z[1].charAt(0)==z[1].charAt(1)&&z[2].charAt(0)==z[2].charAt(1)?z[0].charAt(0)+z[1].charAt(0)+z[2].charAt(0):z.join("")}function h(b,I,B,Q,z){var he=[fe(M(b).toString(16)),fe(M(I).toString(16)),fe(M(B).toString(16)),fe(be(Q))];return z&&he[0].charAt(0)==he[0].charAt(1)&&he[1].charAt(0)==he[1].charAt(1)&&he[2].charAt(0)==he[2].charAt(1)&&he[3].charAt(0)==he[3].charAt(1)?he[0].charAt(0)+he[1].charAt(0)+he[2].charAt(0)+he[3].charAt(0):he.join("")}function s(b,I,B,Q){var z=[fe(be(Q)),fe(M(b).toString(16)),fe(M(I).toString(16)),fe(M(B).toString(16))];return z.join("")}O.equals=function(b,I){return!b||!I?!1:O(b).toRgbString()==O(I).toRgbString()},O.random=function(){return O.fromRatio({r:n(),g:n(),b:n()})};function a(b,I){I=I===0?0:I||10;var B=O(b).toHsl();return B.s-=I/100,B.s=g(B.s),O(B)}function A(b,I){I=I===0?0:I||10;var B=O(b).toHsl();return B.s+=I/100,B.s=g(B.s),O(B)}function E(b){return O(b).desaturate(100)}function T(b,I){I=I===0?0:I||10;var B=O(b).toHsl();return B.l+=I/100,B.l=g(B.l),O(B)}function k(b,I){I=I===0?0:I||10;var B=O(b).toRgb();return B.r=G(0,K(255,B.r-M(255*-(I/100)))),B.g=G(0,K(255,B.g-M(255*-(I/100)))),B.b=G(0,K(255,B.b-M(255*-(I/100)))),O(B)}function L(b,I){I=I===0?0:I||10;var B=O(b).toHsl();return B.l-=I/100,B.l=g(B.l),O(B)}function S(b,I){var B=O(b).toHsl(),Q=(B.h+I)%360;return B.h=Q<0?360+Q:Q,O(B)}function R(b){var I=O(b).toHsl();return I.h=(I.h+180)%360,O(I)}function C(b){var I=O(b).toHsl(),B=I.h;return[O(b),O({h:(B+120)%360,s:I.s,l:I.l}),O({h:(B+240)%360,s:I.s,l:I.l})]}function f(b){var I=O(b).toHsl(),B=I.h;return[O(b),O({h:(B+90)%360,s:I.s,l:I.l}),O({h:(B+180)%360,s:I.s,l:I.l}),O({h:(B+270)%360,s:I.s,l:I.l})]}function w(b){var I=O(b).toHsl(),B=I.h;return[O(b),O({h:(B+72)%360,s:I.s,l:I.l}),O({h:(B+216)%360,s:I.s,l:I.l})]}function y(b,I,B){I=I||6,B=B||30;var Q=O(b).toHsl(),z=360/B,he=[O(b)];for(Q.h=(Q.h-(z*I>>1)+720)%360;--I;)Q.h=(Q.h+z)%360,he.push(O(Q));return he}function _(b,I){I=I||6;for(var B=O(b).toHsv(),Q=B.h,z=B.s,he=B.v,xe=[],Ie=1/I;I--;)xe.push(O({h:Q,s:z,v:he})),he=(he+Ie)%1;return xe}O.mix=function(b,I,B){B=B===0?0:B||50;var Q=O(b).toRgb(),z=O(I).toRgb(),he=B/100,xe={r:(z.r-Q.r)*he+Q.r,g:(z.g-Q.g)*he+Q.g,b:(z.b-Q.b)*he+Q.b,a:(z.a-Q.a)*he+Q.a};return O(xe)},O.readability=function(b,I){var B=O(b),Q=O(I);return(Y.max(B.getLuminance(),Q.getLuminance())+.05)/(Y.min(B.getLuminance(),Q.getLuminance())+.05)},O.isReadable=function(b,I,B){var Q=O.readability(b,I),z,he;he=!1,z=X(B);switch(z.level+z.size){case"AAsmall":case"AAAlarge":he=Q>=4.5;break;case"AAlarge":he=Q>=3;break;case"AAAsmall":he=Q>=7;break}return he},O.mostReadable=function(b,I,B){var Q=null,z=0,he,xe,Ie,ue;B=B||{},xe=B.includeFallbackColors,Ie=B.level,ue=B.size;for(var me=0;me<I.length;me++)he=O.readability(b,I[me]),he>z&&(z=he,Q=O(I[me]));return O.isReadable(b,Q,{level:Ie,size:ue})||!xe?Q:(B.includeFallbackColors=!1,O.mostReadable(b,["#fff","#000"],B))};var j=O.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},U=O.hexNames=x(j);function x(b){var I={};for(var B in b)b.hasOwnProperty(B)&&(I[b[B]]=B);return I}function F(b){return b=parseFloat(b),(isNaN(b)||b<0||b>1)&&(b=1),b}function D(b,I){J(b)&&(b="100%");var B=oe(b);return b=K(I,G(0,parseFloat(b))),B&&(b=parseInt(b*I,10)/100),Y.abs(b-I)<1e-6?1:b%I/parseFloat(I)}function g(b){return K(1,G(0,b))}function W(b){return parseInt(b,16)}function J(b){return typeof b=="string"&&b.indexOf(".")!=-1&&parseFloat(b)===1}function oe(b){return typeof b=="string"&&b.indexOf("%")!=-1}function fe(b){return b.length==1?"0"+b:""+b}function Re(b){return b<=1&&(b=b*100+"%"),b}function be(b){return Y.round(parseFloat(b)*255).toString(16)}function Le(b){return W(b)/255}var Ce=function(){var b="[-\\+]?\\d+%?",I="[-\\+]?\\d*\\.\\d+%?",B="(?:"+I+")|(?:"+b+")",Q="[\\s|\\(]+("+B+")[,|\\s]+("+B+")[,|\\s]+("+B+")\\s*\\)?",z="[\\s|\\(]+("+B+")[,|\\s]+("+B+")[,|\\s]+("+B+")[,|\\s]+("+B+")\\s*\\)?";return{CSS_UNIT:new RegExp(B),rgb:new RegExp("rgb"+Q),rgba:new RegExp("rgba"+z),hsl:new RegExp("hsl"+Q),hsla:new RegExp("hsla"+z),hsv:new RegExp("hsv"+Q),hsva:new RegExp("hsva"+z),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function Te(b){return!!Ce.CSS_UNIT.exec(b)}function ve(b){b=b.replace(N,"").replace($,"").toLowerCase();var I=!1;if(j[b])b=j[b],I=!0;else if(b=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var B;return(B=Ce.rgb.exec(b))?{r:B[1],g:B[2],b:B[3]}:(B=Ce.rgba.exec(b))?{r:B[1],g:B[2],b:B[3],a:B[4]}:(B=Ce.hsl.exec(b))?{h:B[1],s:B[2],l:B[3]}:(B=Ce.hsla.exec(b))?{h:B[1],s:B[2],l:B[3],a:B[4]}:(B=Ce.hsv.exec(b))?{h:B[1],s:B[2],v:B[3]}:(B=Ce.hsva.exec(b))?{h:B[1],s:B[2],v:B[3],a:B[4]}:(B=Ce.hex8.exec(b))?{r:W(B[1]),g:W(B[2]),b:W(B[3]),a:Le(B[4]),format:I?"name":"hex8"}:(B=Ce.hex6.exec(b))?{r:W(B[1]),g:W(B[2]),b:W(B[3]),format:I?"name":"hex"}:(B=Ce.hex4.exec(b))?{r:W(B[1]+""+B[1]),g:W(B[2]+""+B[2]),b:W(B[3]+""+B[3]),a:Le(B[4]+""+B[4]),format:I?"name":"hex8"}:(B=Ce.hex3.exec(b))?{r:W(B[1]+""+B[1]),g:W(B[2]+""+B[2]),b:W(B[3]+""+B[3]),format:I?"name":"hex"}:!1}function X(b){var I,B;return b=b||{level:"AA",size:"small"},I=(b.level||"AA").toUpperCase(),B=(b.size||"small").toLowerCase(),I!=="AA"&&I!=="AAA"&&(I="AA"),B!=="small"&&B!=="large"&&(B="small"),{level:I,size:B}}Ze.exports?Ze.exports=O:!(le=function(){return O}.call(Se,q,Se,Ze),le!==void 0&&(Ze.exports=le))})(Math)},bT9E:function(Ze,Se,q){"use strict";q.d(Se,"a",function(){return Y});var le=q("VTBJ");function Y(N,$){var H=Object(le.a)({},N);return Array.isArray($)&&$.forEach(function(M){delete H[M]}),H}},c5Ni:function(Ze,Se,q){},dejd:function(Ze,Se,q){},dmUQ:function(Ze,Se,q){"use strict";var le=q("Ff2n"),Y=q("rePB"),N=q("1OyB"),$=q("vuIU"),H=q("Ji7U"),M=q("md7G"),K=q("foSv"),G=q("q1tI"),n=q.n(G),O=q("TSYQ"),v=q.n(O),p=q("4IlW");function m(C,f){var w=Object.keys(C);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(C);f&&(y=y.filter(function(_){return Object.getOwnPropertyDescriptor(C,_).enumerable})),w.push.apply(w,y)}return w}function u(C){for(var f=1;f<arguments.length;f++){var w=arguments[f]!=null?arguments[f]:{};f%2?m(Object(w),!0).forEach(function(y){Object(Y.a)(C,y,w[y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(C,Object.getOwnPropertyDescriptors(w)):m(Object(w)).forEach(function(y){Object.defineProperty(C,y,Object.getOwnPropertyDescriptor(w,y))})}return C}function l(C){var f=d();return function(){var y=Object(K.a)(C),_;if(f){var j=Object(K.a)(this).constructor;_=Reflect.construct(y,arguments,j)}else _=y.apply(this,arguments);return Object(M.a)(this,_)}}function d(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(C){return!1}}function o(){}function h(C){C.preventDefault()}var s=function(f){return f.replace(/[^\w.-]+/g,"")},a=200,A=600,E=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,T=function(f){return f!=null},k=function(f,w){return w===f||typeof w=="number"&&typeof f=="number"&&isNaN(w)&&isNaN(f)},L=function(C){Object(H.a)(w,C);var f=l(w);function w(y){var _;Object(N.a)(this,w),_=f.call(this,y),_.onKeyDown=function(x){var F=_.props,D=F.onKeyDown,g=F.onPressEnter;if(x.keyCode===p.a.UP){var W=_.getRatio(x);_.up(x,W,null),_.stop()}else if(x.keyCode===p.a.DOWN){var J=_.getRatio(x);_.down(x,J,null),_.stop()}else x.keyCode===p.a.ENTER&&g&&g(x);if(_.recordCursorPosition(),_.lastKeyCode=x.keyCode,D){for(var oe=arguments.length,fe=new Array(oe>1?oe-1:0),Re=1;Re<oe;Re++)fe[Re-1]=arguments[Re];D.apply(void 0,[x].concat(fe))}},_.onKeyUp=function(x){var F=_.props.onKeyUp;if(_.stop(),_.recordCursorPosition(),F){for(var D=arguments.length,g=new Array(D>1?D-1:0),W=1;W<D;W++)g[W-1]=arguments[W];F.apply(void 0,[x].concat(g))}},_.onChange=function(x){var F=_.props.onChange;_.state.focused&&(_.inputting=!0),_.rawInput=_.props.parser(_.getValueFromEvent(x)),_.setState({inputValue:_.rawInput}),F(_.toNumber(_.rawInput))},_.onMouseUp=function(){var x=_.props.onMouseUp;_.recordCursorPosition(),x&&x.apply(void 0,arguments)},_.onFocus=function(){var x;_.setState({focused:!0}),(x=_.props).onFocus.apply(x,arguments)},_.onBlur=function(){var x=_.props.onBlur;_.inputting=!1,_.setState({focused:!1});var F=_.getCurrentValidValue(_.state.inputValue),D=_.setValue(F,o);if(x){var g=_.input.value,W=_.getInputDisplayValue({focus:!1,value:D});_.input.value=W&&Number(W),x.apply(void 0,arguments),_.input.value=g}},_.getRatio=function(x){var F=1;return x.metaKey||x.ctrlKey?F=.1:x.shiftKey&&(F=10),F},_.getFullNum=function(x){return isNaN(x)?x:/e/i.test(String(x))?Number(x).toFixed(18).replace(/\.?0+$/,""):x},_.getPrecision=function(x){if(T(_.props.precision))return _.props.precision;var F=String(x);if(F.indexOf("e-")>=0)return parseInt(F.slice(F.indexOf("e-")+2),10);var D=0;return F.indexOf(".")>=0&&(D=F.length-F.indexOf(".")-1),D},_.getInputDisplayValue=function(x){var F=x||_.state,D=F.focused,g=F.inputValue,W=F.value,J;D?J=g:J=_.toPrecisionAsStep(W),J==null&&(J="");var oe=_.formatWrapper(J);return T(_.props.decimalSeparator)&&(oe=oe.toString().replace(".",_.props.decimalSeparator)),oe},_.recordCursorPosition=function(){try{_.cursorStart=_.input.selectionStart,_.cursorEnd=_.input.selectionEnd,_.currentValue=_.input.value,_.cursorBefore=_.input.value.substring(0,_.cursorStart),_.cursorAfter=_.input.value.substring(_.cursorEnd)}catch(x){}},_.restoreByAfter=function(x){if(x===void 0)return!1;var F=_.input.value,D=F.lastIndexOf(x);if(D===-1)return!1;var g=_.cursorBefore.length;return _.lastKeyCode===p.a.DELETE&&_.cursorBefore.charAt(g-1)===x[0]?(_.fixCaret(g,g),!0):D+x.length===F.length?(_.fixCaret(D,D),!0):!1},_.partRestoreByAfter=function(x){return x===void 0?!1:Array.prototype.some.call(x,function(F,D){var g=x.substring(D);return _.restoreByAfter(g)})},_.isNotCompleteNumber=function(x){return isNaN(x)||x===""||x===null||x&&x.toString().indexOf(".")===x.toString().length-1},_.stop=function(){_.autoStepTimer&&clearTimeout(_.autoStepTimer)},_.down=function(x,F,D){_.pressingUpOrDown=!0,_.step("down",x,F,D)},_.up=function(x,F,D){_.pressingUpOrDown=!0,_.step("up",x,F,D)},_.saveInput=function(x){_.input=x};var j=y.value;j===void 0&&(j=y.defaultValue),_.state={focused:y.autoFocus};var U=_.getValidValue(_.toNumber(j));return _.state=u(u({},_.state),{},{inputValue:_.toPrecisionAsStep(U),value:U}),_}return Object($.a)(w,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(_){var j=this.props,U=j.value,x=j.onChange,F=j.max,D=j.min,g=this.state.focused;if(_){if(!k(_.value,U)||!k(_.max,F)||!k(_.min,D)){var W=g?U:this.getValidValue(U),J;this.pressingUpOrDown?J=W:this.inputting?J=this.rawInput:J=this.toPrecisionAsStep(W),this.setState({value:W,inputValue:J})}var oe="value"in this.props?U:this.state.value;"max"in this.props&&_.max!==F&&typeof oe=="number"&&oe>F&&x&&x(F),"min"in this.props&&_.min!==D&&typeof oe=="number"&&oe<D&&x&&x(D)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var fe=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===p.a.BACKSPACE?fe=this.cursorStart-1:this.lastKeyCode===p.a.DELETE&&(fe=this.cursorStart):fe=this.input.value.length,this.fixCaret(fe,fe)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case p.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case p.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(Re){}if(this.lastKeyCode=null,!this.pressingUpOrDown)return;this.props.focusOnUpDown&&this.state.focused&&(document.activeElement!==this.input&&this.focus())}},{key:"componentWillUnmount",value:function(){this.stop()}},{key:"getCurrentValidValue",value:function(_){var j=_;return j===""?j="":this.isNotCompleteNumber(parseFloat(j))?j=this.state.value:j=this.getValidValue(j),this.toNumber(j)}},{key:"getValueFromEvent",value:function(_){var j=_.target.value.trim().replace(/。/g,".");return T(this.props.decimalSeparator)&&(j=j.replace(this.props.decimalSeparator,".")),j}},{key:"getValidValue",value:function(_){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,U=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,x=parseFloat(_);return isNaN(x)?_:(x<j&&(x=j),x>U&&(x=U),x)}},{key:"setValue",value:function(_,j){var U=this.props.precision,x=this.isNotCompleteNumber(parseFloat(_))?null:parseFloat(_),F=this.state.value,D=F===void 0?null:F,g=this.state.inputValue,W=g===void 0?null:g,J=typeof x=="number"?x.toFixed(U):"".concat(x),oe=x!==D||J!=="".concat(W);return"value"in this.props?(W=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:W},j)):this.setState({value:x,inputValue:this.toPrecisionAsStep(_)},j),oe&&this.props.onChange(x),x}},{key:"getMaxPrecision",value:function(_){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,U=this.props,x=U.precision,F=U.step;if(T(x))return x;var D=this.getPrecision(j),g=this.getPrecision(F),W=this.getPrecision(_);return _?Math.max(W,D+g):D+g}},{key:"getPrecisionFactor",value:function(_){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,U=this.getMaxPrecision(_,j);return Math.pow(10,U)}},{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(_){return this.props.formatter?this.props.formatter(_):_}},{key:"toPrecisionAsStep",value:function(_){if(this.isNotCompleteNumber(_)||_==="")return _;var j=Math.abs(this.getMaxPrecision(_));return isNaN(j)?_.toString():Number(_).toFixed(j)}},{key:"toNumber",value:function(_){var j=this.props.precision,U=this.state.focused,x=_&&_.length>16&&U;return this.isNotCompleteNumber(_)||x?_:T(j)?Math.round(_*Math.pow(10,j))/Math.pow(10,j):Number(_)}},{key:"upStep",value:function(_,j){var U=this.props.step,x=this.getPrecisionFactor(_,j),F=Math.abs(this.getMaxPrecision(_,j)),D=((x*_+x*U*j)/x).toFixed(F);return this.toNumber(D)}},{key:"downStep",value:function(_,j){var U=this.props.step,x=this.getPrecisionFactor(_,j),F=Math.abs(this.getMaxPrecision(_,j)),D=((x*_-x*U*j)/x).toFixed(F);return this.toNumber(D)}},{key:"step",value:function(_,j){var U=this,x=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,F=arguments.length>3?arguments[3]:void 0;this.stop(),j&&(j.persist(),j.preventDefault());var D=this.props;if(D.disabled)return;var g=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(g))return;var W=this["".concat(_,"Step")](g,x),J=W>D.max||W<D.min;if(W>D.max?W=D.max:W<D.min&&(W=D.min),this.setValue(W,null),this.setState({focused:!0},function(){U.pressingUpOrDown=!1}),J)return;this.autoStepTimer=setTimeout(function(){U[_](j,x,!0)},F?a:A)}},{key:"fixCaret",value:function(_,j){if(_===void 0||j===void 0||!this.input||!this.input.value)return;try{var U=this.input.selectionStart,x=this.input.selectionEnd;(_!==U||j!==x)&&this.input.setSelectionRange(_,j)}catch(F){}}},{key:"render",value:function(){var _,j=this.props,U=j.prefixCls,x=j.disabled,F=j.readOnly,D=j.useTouch,g=j.autoComplete,W=j.upHandler,J=j.downHandler,oe=j.className,fe=j.max,Re=j.min,be=j.style,Le=j.title,Ce=j.onMouseEnter,Te=j.onMouseLeave,ve=j.onMouseOver,X=j.onMouseOut,b=j.required,I=j.onClick,B=j.tabIndex,Q=j.type,z=j.placeholder,he=j.id,xe=j.inputMode,Ie=j.pattern,ue=j.step,me=j.maxLength,we=j.autoFocus,Ae=j.name,Ne=j.onPaste,Be=j.onInput,Ke=Object(le.a)(j,["prefixCls","disabled","readOnly","useTouch","autoComplete","upHandler","downHandler","className","max","min","style","title","onMouseEnter","onMouseLeave","onMouseOver","onMouseOut","required","onClick","tabIndex","type","placeholder","id","inputMode","pattern","step","maxLength","autoFocus","name","onPaste","onInput"]),Ge=this.state,$e=Ge.value,je=Ge.focused,We=v()(U,(_={},Object(Y.a)(_,oe,!!oe),Object(Y.a)(_,"".concat(U,"-disabled"),x),Object(Y.a)(_,"".concat(U,"-focused"),je),_)),Me={};Object.keys(Ke).forEach(function(ge){(ge.substr(0,5)==="data-"||ge.substr(0,5)==="aria-"||ge==="role")&&(Me[ge]=Ke[ge])});var tt=!F&&!x,rt=this.getInputDisplayValue(null),ce=($e||$e===0)&&(isNaN($e)||Number($e)>=fe),ee=($e||$e===0)&&(isNaN($e)||Number($e)<=Re),ne=ce||x||F,se=ee||x||F,de=v()("".concat(U,"-handler"),"".concat(U,"-handler-up"),Object(Y.a)({},"".concat(U,"-handler-up-disabled"),ne)),re=v()("".concat(U,"-handler"),"".concat(U,"-handler-down"),Object(Y.a)({},"".concat(U,"-handler-down-disabled"),se)),ae=D?{onTouchStart:ne?o:this.up,onTouchEnd:this.stop}:{onMouseDown:ne?o:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},pe=D?{onTouchStart:se?o:this.down,onTouchEnd:this.stop}:{onMouseDown:se?o:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return n.a.createElement("div",{className:We,style:be,title:Le,onMouseEnter:Ce,onMouseLeave:Te,onMouseOver:ve,onMouseOut:X,onFocus:function(){return null},onBlur:function(){return null}},n.a.createElement("div",{className:"".concat(U,"-handler-wrap")},n.a.createElement("span",Object.assign({unselectable:"on"},ae,{role:"button","aria-label":"Increase Value","aria-disabled":ne,className:de}),W||n.a.createElement("span",{unselectable:"on",className:"".concat(U,"-handler-up-inner"),onClick:h})),n.a.createElement("span",Object.assign({unselectable:"on"},pe,{role:"button","aria-label":"Decrease Value","aria-disabled":se,className:re}),J||n.a.createElement("span",{unselectable:"on",className:"".concat(U,"-handler-down-inner"),onClick:h}))),n.a.createElement("div",{className:"".concat(U,"-input-wrap")},n.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Re,"aria-valuemax":fe,"aria-valuenow":$e,required:b,type:Q,placeholder:z,onPaste:Ne,onClick:I,onMouseUp:this.onMouseUp,className:"".concat(U,"-input"),tabIndex:B,autoComplete:g,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:tt?this.onKeyDown:o,onKeyUp:tt?this.onKeyUp:o,autoFocus:we,maxLength:me,readOnly:F,disabled:x,max:fe,min:Re,step:ue,name:Ae,title:Le,id:he,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(rt),pattern:Ie,inputMode:xe,onInput:Be},Me))))}}]),w}(n.a.Component);L.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:E,min:-E,step:1,style:{},onChange:o,onKeyDown:o,onPressEnter:o,onFocus:o,onBlur:o,parser:s,required:!1,autoComplete:"off"};var S=L,R=Se.a=S},fjLI:function(Ze,Se,q){"use strict";q.d(Se,"f",function(){return m}),q.d(Se,"b",function(){return u}),q.d(Se,"a",function(){return l}),q.d(Se,"d",function(){return d}),q.d(Se,"e",function(){return o}),q.d(Se,"c",function(){return h});var le=q("8HAY"),Y=q("Vhoy"),N=q("MI8n"),$=q("JYp7"),H=q("pmY6"),M=q("24hK"),K=q("nnTU"),G=q("T8No"),n=q("Cg/j"),O=q("t9D7"),v=function(s,a,A,E){var T=arguments.length,k=T<3?a:E===null?E=Object.getOwnPropertyDescriptor(a,A):E,L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(s,a,A,E);else for(var S=s.length-1;S>=0;S--)(L=s[S])&&(k=(T<3?L(k):T>3?L(a,A,k):L(a,A))||k);return T>3&&k&&Object.defineProperty(a,A,k),k},p=function(s,a){return function(A,E){a(A,E,s)}};function m(s){return s.command!==void 0}class u{constructor(s){this.id=u._idPool++,this._debugName=s}}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 l=Object(n.c)("menuService"),d=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new N.b,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:s=>s===u.CommandPalette}}addCommand(s){return this.addCommands($.a.single(s))}addCommands(s){for(const a of s)this._commands.set(a.id,a);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),Object(H.i)(()=>{let a=!1;for(const A of s)a=this._commands.delete(A.id)||a;a&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(s){return this._commands.get(s)}getCommands(){const s=new Map;return this._commands.forEach((a,A)=>s.set(A,a)),s}appendMenuItem(s,a){return this.appendMenuItems($.a.single({id:s,item:a}))}appendMenuItems(s){const a=new Set,A=new M.a;for(const{id:E,item:T}of s){let k=this._menuItems.get(E);k||(k=new M.a,this._menuItems.set(E,k)),A.push(k.push(T)),a.add(E)}return this._onDidChangeMenu.fire(a),Object(H.i)(()=>{if(A.size>0){for(let E of A)E();this._onDidChangeMenu.fire(a),A.clear()}})}getMenuItems(s){let a;return this._menuItems.has(s)?a=[...this._menuItems.get(s)]:a=[],s===u.CommandPalette&&this._appendImplicitItems(a),a}_appendImplicitItems(s){const a=new Set;for(const A of s)m(A)&&(a.add(A.command.id),A.alt&&a.add(A.alt.id));this._commands.forEach((A,E)=>{a.has(E)||s.push({command:A})})}};class o extends le.e{constructor(s,a,A,E){super(`submenuitem.${s.submenu.id}`,typeof s.title=="string"?s.title:s.title.value,[],"submenu");this.item=s,this._menuService=a,this._contextKeyService=A,this._options=E}get actions(){const s=[],a=this._menuService.createMenu(this.item.submenu,this._contextKeyService),A=a.getActions(this._options);a.dispose();for(const[,E]of A)E.length>0&&(s.push(...E),s.push(new le.d));return s.length&&s.pop(),s}}let h=class s{constructor(a,A,E,T,k){var L,S;if(this._commandService=k,this.id=a.id,this.label=(E==null?void 0:E.renderShortTitle)&&a.shortTitle?typeof a.shortTitle=="string"?a.shortTitle:a.shortTitle.value:typeof a.title=="string"?a.title:a.title.value,this.tooltip=(S=typeof a.tooltip=="string"?a.tooltip:(L=a.tooltip)===null||L===void 0?void 0:L.value)!==null&&S!==void 0?S:"",this.enabled=!a.precondition||T.contextMatchesRules(a.precondition),this.checked=void 0,a.toggled){const R=a.toggled.condition?a.toggled:{condition:a.toggled};this.checked=T.contextMatchesRules(R.condition),this.checked&&R.tooltip&&(this.tooltip=typeof R.tooltip=="string"?R.tooltip:R.tooltip.value),R.title&&(this.label=typeof R.title=="string"?R.title:R.title.value)}this.item=a,this.alt=A?new s(A,void 0,E,T,k):void 0,this._options=E,O.d.isThemeIcon(a.icon)&&(this.class=Y.a.asClassName(a.icon))}dispose(){}run(...a){var A,E;let T=[];return((A=this._options)===null||A===void 0?void 0:A.arg)&&(T=[...T,this._options.arg]),((E=this._options)===null||E===void 0?void 0:E.shouldForwardArgs)&&(T=[...T,...a]),this._commandService.executeCommand(this.id,...T)}};h=v([p(3,G.b),p(4,K.b)],h)},h78n:function(Ze,Se,q){"use strict";q.d(Se,"a",function(){return _});var le=q("q1tI"),Y=q.n(le),N=q("TSYQ"),$=q.n(N),H={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},M=function(x){var F=x.map(function(){return Object(le.useRef)()}),D=Object(le.useRef)();return Object(le.useEffect)(function(){var g=Date.now(),W=!1;Object.keys(F).forEach(function(J){var oe=F[J].current;if(!oe)return;W=!0;var fe=oe.style;fe.transitionDuration=".3s, .3s, .3s, .06s",D.current&&g-D.current<100&&(fe.transitionDuration="0s, 0s")}),W&&(D.current=Date.now())}),[F]};function K(){return K=Object.assign||function(U){for(var x=1;x<arguments.length;x++){var F=arguments[x];for(var D in F)Object.prototype.hasOwnProperty.call(F,D)&&(U[D]=F[D])}return U},K.apply(this,arguments)}function G(U,x){return m(U)||p(U,x)||O(U,x)||n()}function n(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function O(U,x){if(!U)return;if(typeof U=="string")return v(U,x);var F=Object.prototype.toString.call(U).slice(8,-1);if(F==="Object"&&U.constructor&&(F=U.constructor.name),F==="Map"||F==="Set")return Array.from(U);if(F==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(F))return v(U,x)}function v(U,x){(x==null||x>U.length)&&(x=U.length);for(var F=0,D=new Array(x);F<x;F++)D[F]=U[F];return D}function p(U,x){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(U)))return;var F=[],D=!0,g=!1,W=void 0;try{for(var J=U[Symbol.iterator](),oe;!(D=(oe=J.next()).done)&&!(F.push(oe.value),x&&F.length===x);D=!0);}catch(fe){g=!0,W=fe}finally{try{!D&&J.return!=null&&J.return()}finally{if(g)throw W}}return F}function m(U){if(Array.isArray(U))return U}function u(U,x){if(U==null)return{};var F=l(U,x),D,g;if(Object.getOwnPropertySymbols){var W=Object.getOwnPropertySymbols(U);for(g=0;g<W.length;g++){if(D=W[g],x.indexOf(D)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(U,D))continue;F[D]=U[D]}}return F}function l(U,x){if(U==null)return{};var F={},D=Object.keys(U),g,W;for(W=0;W<D.length;W++){if(g=D[W],x.indexOf(g)>=0)continue;F[g]=U[g]}return F}var d=function(x){var F=x.className,D=x.percent,g=x.prefixCls,W=x.strokeColor,J=x.strokeLinecap,oe=x.strokeWidth,fe=x.style,Re=x.trailColor,be=x.trailWidth,Le=x.transition,Ce=u(x,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete Ce.gapPosition;var Te=Array.isArray(D)?D:[D],ve=Array.isArray(W)?W:[W],X=M(Te),b=G(X,1),I=b[0],B=oe/2,Q=100-oe/2,z="M ".concat(J==="round"?B:0,",").concat(B,`
|
|
L `).concat(J==="round"?Q:100,",").concat(B),he="0 0 100 ".concat(oe),xe=0;return Y.a.createElement("svg",K({className:$()("".concat(g,"-line"),F),viewBox:he,preserveAspectRatio:"none",style:fe},Ce),Y.a.createElement("path",{className:"".concat(g,"-line-trail"),d:z,strokeLinecap:J,stroke:Re,strokeWidth:be||oe,fillOpacity:"0"}),Te.map(function(Ie,ue){var me={strokeDasharray:"".concat(Ie,"px, 100px"),strokeDashoffset:"-".concat(xe,"px"),transition:Le||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},we=ve[ue]||ve[ve.length-1];return xe+=Ie,Y.a.createElement("path",{key:ue,className:"".concat(g,"-line-path"),d:z,strokeLinecap:J,stroke:we,strokeWidth:oe,fillOpacity:"0",ref:I[ue],style:me})}))};d.defaultProps=H;var o=d;function h(){return h=Object.assign||function(U){for(var x=1;x<arguments.length;x++){var F=arguments[x];for(var D in F)Object.prototype.hasOwnProperty.call(F,D)&&(U[D]=F[D])}return U},h.apply(this,arguments)}function s(U,x){return k(U)||T(U,x)||A(U,x)||a()}function a(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function A(U,x){if(!U)return;if(typeof U=="string")return E(U,x);var F=Object.prototype.toString.call(U).slice(8,-1);if(F==="Object"&&U.constructor&&(F=U.constructor.name),F==="Map"||F==="Set")return Array.from(U);if(F==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(F))return E(U,x)}function E(U,x){(x==null||x>U.length)&&(x=U.length);for(var F=0,D=new Array(x);F<x;F++)D[F]=U[F];return D}function T(U,x){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(U)))return;var F=[],D=!0,g=!1,W=void 0;try{for(var J=U[Symbol.iterator](),oe;!(D=(oe=J.next()).done)&&!(F.push(oe.value),x&&F.length===x);D=!0);}catch(fe){g=!0,W=fe}finally{try{!D&&J.return!=null&&J.return()}finally{if(g)throw W}}return F}function k(U){if(Array.isArray(U))return U}function L(U,x){if(U==null)return{};var F=S(U,x),D,g;if(Object.getOwnPropertySymbols){var W=Object.getOwnPropertySymbols(U);for(g=0;g<W.length;g++){if(D=W[g],x.indexOf(D)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(U,D))continue;F[D]=U[D]}}return F}function S(U,x){if(U==null)return{};var F={},D=Object.keys(U),g,W;for(W=0;W<D.length;W++){if(g=D[W],x.indexOf(g)>=0)continue;F[g]=U[g]}return F}var R=0;function C(U){return+U.replace("%","")}function f(U){return Array.isArray(U)?U:[U]}function w(U,x,F,D){var g=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,W=arguments.length>5?arguments[5]:void 0,J=50-D/2,oe=0,fe=-J,Re=0,be=-2*J;switch(W){case"left":oe=-J,fe=0,Re=2*J,be=0;break;case"right":oe=J,fe=0,Re=-2*J,be=0;break;case"bottom":fe=J,be=2*J;break;default:}var Le="M 50,50 m ".concat(oe,",").concat(fe,`
|
|
a `).concat(J,",").concat(J," 0 1 1 ").concat(Re,",").concat(-be,`
|
|
a `).concat(J,",").concat(J," 0 1 1 ").concat(-Re,",").concat(be),Ce=Math.PI*2*J,Te={stroke:F,strokeDasharray:"".concat(x/100*(Ce-g),"px ").concat(Ce,"px"),strokeDashoffset:"-".concat(g/2+U/100*(Ce-g),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:Le,pathStyle:Te}}var y=function(x){var F=x.prefixCls,D=x.strokeWidth,g=x.trailWidth,W=x.gapDegree,J=x.gapPosition,oe=x.trailColor,fe=x.strokeLinecap,Re=x.style,be=x.className,Le=x.strokeColor,Ce=x.percent,Te=L(x,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),ve=Object(le.useMemo)(function(){return R+=1,R},[]),X=w(0,100,oe,D,W,J),b=X.pathString,I=X.pathStyle,B=f(Ce),Q=f(Le),z=Q.find(function(me){return Object.prototype.toString.call(me)==="[object Object]"}),he=M(B),xe=s(he,1),Ie=xe[0],ue=function(){var we=0;return B.map(function(Ae,Ne){var Be=Q[Ne]||Q[Q.length-1],Ke=Object.prototype.toString.call(Be)==="[object Object]"?"url(#".concat(F,"-gradient-").concat(ve,")"):"",Ge=w(we,Ae,Be,D,W,J);return we+=Ae,Y.a.createElement("path",{key:Ne,className:"".concat(F,"-circle-path"),d:Ge.pathString,stroke:Ke,strokeLinecap:fe,strokeWidth:D,opacity:Ae===0?0:1,fillOpacity:"0",style:Ge.pathStyle,ref:Ie[Ne]})})};return Y.a.createElement("svg",h({className:$()("".concat(F,"-circle"),be),viewBox:"0 0 100 100",style:Re},Te),z&&Y.a.createElement("defs",null,Y.a.createElement("linearGradient",{id:"".concat(F,"-gradient-").concat(ve),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(z).sort(function(me,we){return C(me)-C(we)}).map(function(me,we){return Y.a.createElement("stop",{key:we,offset:me,stopColor:z[me]})}))),Y.a.createElement("path",{className:"".concat(F,"-circle-trail"),d:b,stroke:oe,strokeLinecap:fe,strokeWidth:g||D,fillOpacity:"0",style:I}),ue().reverse())};y.defaultProps=H;var _=y,j={Line:o,Circle:_}},ic2d:function(Ze,Se,q){"use strict";q.d(Se,"a",function(){return $});var le=q("FWmy"),Y=q("746U");class N{constructor(){this.data=new Map}add(H,M){le.a(Y.l(H)),le.a(Y.k(M)),le.a(!this.data.has(H),"There is already an extension with this id"),this.data.set(H,M)}as(H){return this.data.get(H)||null}}const $=new N},kSUc:function(Ze,Se,q){},lZu9:function(Ze,Se,q){(function(le){le(q("VrN/"),q("1eCo"),q("8EBN"))})(function(le){"use strict";le.defineMode("markdown",function(Y,N){var $=le.getMode(Y,"text/html"),H=$.name=="null";function M(D){if(le.findModeByName){var g=le.findModeByName(D);g&&(D=g.mime||g.mimes[0])}var W=le.getMode(Y,D);return W.name=="null"?null:W}N.highlightFormatting===void 0&&(N.highlightFormatting=!1),N.maxBlockquoteDepth===void 0&&(N.maxBlockquoteDepth=0),N.taskLists===void 0&&(N.taskLists=!1),N.strikethrough===void 0&&(N.strikethrough=!1),N.emoji===void 0&&(N.emoji=!1),N.fencedCodeBlockHighlighting===void 0&&(N.fencedCodeBlockHighlighting=!0),N.fencedCodeBlockDefaultMode===void 0&&(N.fencedCodeBlockDefaultMode="text/plain"),N.xml===void 0&&(N.xml=!0),N.tokenTypeOverrides===void 0&&(N.tokenTypeOverrides={});var K={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 G in K)K.hasOwnProperty(G)&&N.tokenTypeOverrides[G]&&(K[G]=N.tokenTypeOverrides[G]);var n=/^([*\-_])(?:\s*\1){2,}\s*$/,O=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,v=/^\[(x| )\](?=\s)/i,p=N.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,m=/^ {0,3}(?:\={1,}|-{2,})\s*$/,u=/^[^#!\[\]*_\\<>` "'(~:]+/,l=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,d=/^\s*\[[^\]]+?\]:.*$/,o=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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 s(D,g,W){return g.f=g.inline=W,W(D,g)}function a(D,g,W){return g.f=g.block=W,W(D,g)}function A(D){return!D||!/\S/.test(D.string)}function E(D){if(D.linkTitle=!1,D.linkHref=!1,D.linkText=!1,D.em=!1,D.strong=!1,D.strikethrough=!1,D.quote=0,D.indentedCode=!1,D.f==k){var g=H;if(!g){var W=le.innerMode($,D.htmlState);g=W.mode.name=="xml"&&W.state.tagStart===null&&!W.state.context&&W.state.tokenize.isInText}g&&(D.f=C,D.block=T,D.htmlState=null)}return D.trailingSpace=0,D.trailingSpaceNewLine=!1,D.prevLine=D.thisLine,D.thisLine={stream:null},null}function T(D,g){var W=D.column()===g.indentation,J=A(g.prevLine.stream),oe=g.indentedCode,fe=g.prevLine.hr,Re=g.list!==!1,be=(g.listStack[g.listStack.length-1]||0)+3;g.indentedCode=!1;var Le=g.indentation;if(g.indentationDiff===null&&(g.indentationDiff=g.indentation,Re)){for(g.list=null;Le<g.listStack[g.listStack.length-1];)g.listStack.pop(),g.listStack.length?g.indentation=g.listStack[g.listStack.length-1]:g.list=!1;g.list!==!1&&(g.indentationDiff=Le-g.listStack[g.listStack.length-1])}var Ce=!J&&!fe&&!g.prevLine.header&&(!Re||!oe)&&!g.prevLine.fencedCodeEnd,Te=(g.list===!1||fe||J)&&g.indentation<=be&&D.match(n),ve=null;if(g.indentationDiff>=4&&(oe||g.prevLine.fencedCodeEnd||g.prevLine.header||J))return D.skipToEnd(),g.indentedCode=!0,K.code;if(D.eatSpace())return null;if(W&&g.indentation<=be&&(ve=D.match(p))&&ve[1].length<=6)return g.quote=0,g.header=ve[1].length,g.thisLine.header=!0,N.highlightFormatting&&(g.formatting="header"),g.f=g.inline,S(g);if(g.indentation<=be&&D.eat(">"))return g.quote=W?1:g.quote+1,N.highlightFormatting&&(g.formatting="quote"),D.eatSpace(),S(g);if(!Te&&!g.setext&&W&&g.indentation<=be&&(ve=D.match(O))){var X=ve[1]?"ol":"ul";return g.indentation=Le+D.current().length,g.list=!0,g.quote=0,g.listStack.push(g.indentation),g.em=!1,g.strong=!1,g.code=!1,g.strikethrough=!1,N.taskLists&&D.match(v,!1)&&(g.taskList=!0),g.f=g.inline,N.highlightFormatting&&(g.formatting=["list","list-"+X]),S(g)}else{if(W&&g.indentation<=be&&(ve=D.match(l,!0)))return g.quote=0,g.fencedEndRE=new RegExp(ve[1]+"+ *$"),g.localMode=N.fencedCodeBlockHighlighting&&M(ve[2]||N.fencedCodeBlockDefaultMode),g.localMode&&(g.localState=le.startState(g.localMode)),g.f=g.block=L,N.highlightFormatting&&(g.formatting="code-block"),g.code=-1,S(g);if(g.setext||(!Ce||!Re)&&!g.quote&&g.list===!1&&!g.code&&!Te&&!d.test(D.string)&&(ve=D.lookAhead(1))&&(ve=ve.match(m)))return g.setext?(g.header=g.setext,g.setext=0,D.skipToEnd(),N.highlightFormatting&&(g.formatting="header")):(g.header=ve[0].charAt(0)=="="?1:2,g.setext=g.header),g.thisLine.header=!0,g.f=g.inline,S(g);if(Te)return D.skipToEnd(),g.hr=!0,g.thisLine.hr=!0,K.hr;if(D.peek()==="[")return s(D,g,j)}return s(D,g,g.inline)}function k(D,g){var W=$.token(D,g.htmlState);if(!H){var J=le.innerMode($,g.htmlState);(J.mode.name=="xml"&&J.state.tagStart===null&&!J.state.context&&J.state.tokenize.isInText||g.md_inside&&D.current().indexOf(">")>-1)&&(g.f=C,g.block=T,g.htmlState=null)}return W}function L(D,g){var W=g.listStack[g.listStack.length-1]||0,J=g.indentation<W,oe=W+3;if(g.fencedEndRE&&g.indentation<=oe&&(J||D.match(g.fencedEndRE))){N.highlightFormatting&&(g.formatting="code-block");var fe;return J||(fe=S(g)),g.localMode=g.localState=null,g.block=T,g.f=C,g.fencedEndRE=null,g.code=0,g.thisLine.fencedCodeEnd=!0,J?a(D,g,g.block):fe}else return g.localMode?g.localMode.token(D,g.localState):(D.skipToEnd(),K.code)}function S(D){var g=[];if(D.formatting){g.push(K.formatting),typeof D.formatting=="string"&&(D.formatting=[D.formatting]);for(var W=0;W<D.formatting.length;W++)g.push(K.formatting+"-"+D.formatting[W]),D.formatting[W]==="header"&&g.push(K.formatting+"-"+D.formatting[W]+"-"+D.header),D.formatting[W]==="quote"&&(!N.maxBlockquoteDepth||N.maxBlockquoteDepth>=D.quote?g.push(K.formatting+"-"+D.formatting[W]+"-"+D.quote):g.push("error"))}if(D.taskOpen)return g.push("meta"),g.length?g.join(" "):null;if(D.taskClosed)return g.push("property"),g.length?g.join(" "):null;if(D.linkHref?g.push(K.linkHref,"url"):(D.strong&&g.push(K.strong),D.em&&g.push(K.em),D.strikethrough&&g.push(K.strikethrough),D.emoji&&g.push(K.emoji),D.linkText&&g.push(K.linkText),D.code&&g.push(K.code),D.image&&g.push(K.image),D.imageAltText&&g.push(K.imageAltText,"link"),D.imageMarker&&g.push(K.imageMarker)),D.header&&g.push(K.header,K.header+"-"+D.header),D.quote&&(g.push(K.quote),!N.maxBlockquoteDepth||N.maxBlockquoteDepth>=D.quote?g.push(K.quote+"-"+D.quote):g.push(K.quote+"-"+N.maxBlockquoteDepth)),D.list!==!1){var J=(D.listStack.length-1)%3;J?J===1?g.push(K.list2):g.push(K.list3):g.push(K.list1)}return D.trailingSpaceNewLine?g.push("trailing-space-new-line"):D.trailingSpace&&g.push("trailing-space-"+(D.trailingSpace%2?"a":"b")),g.length?g.join(" "):null}function R(D,g){return D.match(u,!0)?S(g):void 0}function C(D,g){var W=g.text(D,g);if(typeof W!="undefined")return W;if(g.list)return g.list=null,S(g);if(g.taskList){var J=D.match(v,!0)[1]===" ";return J?g.taskOpen=!0:g.taskClosed=!0,N.highlightFormatting&&(g.formatting="task"),g.taskList=!1,S(g)}if(g.taskOpen=!1,g.taskClosed=!1,g.header&&D.match(/^#+$/,!0))return N.highlightFormatting&&(g.formatting="header"),S(g);var oe=D.next();if(g.linkTitle){g.linkTitle=!1;var fe=oe;oe==="("&&(fe=")"),fe=(fe+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Re="^\\s*(?:[^"+fe+"\\\\]+|\\\\\\\\|\\\\.)"+fe;if(D.match(new RegExp(Re),!0))return K.linkHref}if(oe==="`"){var be=g.formatting;N.highlightFormatting&&(g.formatting="code"),D.eatWhile("`");var Le=D.current().length;if(g.code==0&&(!g.quote||Le==1))return g.code=Le,S(g);if(Le==g.code){var Ce=S(g);return g.code=0,Ce}else return g.formatting=be,S(g)}else if(g.code)return S(g);if(oe==="\\"&&(D.next(),N.highlightFormatting)){var Te=S(g),ve=K.formatting+"-escape";return Te?Te+" "+ve:ve}if(oe==="!"&&D.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return g.imageMarker=!0,g.image=!0,N.highlightFormatting&&(g.formatting="image"),S(g);if(oe==="["&&g.imageMarker&&D.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return g.imageMarker=!1,g.imageAltText=!0,N.highlightFormatting&&(g.formatting="image"),S(g);if(oe==="]"&&g.imageAltText){N.highlightFormatting&&(g.formatting="image");var Te=S(g);return g.imageAltText=!1,g.image=!1,g.inline=g.f=w,Te}if(oe==="["&&!g.image)return g.linkText&&D.match(/^.*?\]/)||(g.linkText=!0,N.highlightFormatting&&(g.formatting="link")),S(g);if(oe==="]"&&g.linkText){N.highlightFormatting&&(g.formatting="link");var Te=S(g);return g.linkText=!1,g.inline=g.f=D.match(/\(.*?\)| ?\[.*?\]/,!1)?w:C,Te}if(oe==="<"&&D.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){g.f=g.inline=f,N.highlightFormatting&&(g.formatting="link");var Te=S(g);return Te?Te+=" ":Te="",Te+K.linkInline}if(oe==="<"&&D.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){g.f=g.inline=f,N.highlightFormatting&&(g.formatting="link");var Te=S(g);return Te?Te+=" ":Te="",Te+K.linkEmail}if(N.xml&&oe==="<"&&D.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var X=D.string.indexOf(">",D.pos);if(X!=-1){var b=D.string.substring(D.start,X);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(b)&&(g.md_inside=!0)}return D.backUp(1),g.htmlState=le.startState($),a(D,g,k)}if(N.xml&&oe==="<"&&D.match(/^\/\w*?>/))return g.md_inside=!1,"tag";if(oe==="*"||oe==="_"){for(var I=1,B=D.pos==1?" ":D.string.charAt(D.pos-2);I<3&&D.eat(oe);)I++;var Q=D.peek()||" ",z=!/\s/.test(Q)&&(!o.test(Q)||/\s/.test(B)||o.test(B)),he=!/\s/.test(B)&&(!o.test(B)||/\s/.test(Q)||o.test(Q)),xe=null,Ie=null;if(I%2&&(!g.em&&z&&(oe==="*"||!he||o.test(B))?xe=!0:g.em==oe&&he&&(oe==="*"||!z||o.test(Q))&&(xe=!1)),I>1&&(!g.strong&&z&&(oe==="*"||!he||o.test(B))?Ie=!0:g.strong==oe&&he&&(oe==="*"||!z||o.test(Q))&&(Ie=!1)),Ie!=null||xe!=null){N.highlightFormatting&&(g.formatting=xe==null?"strong":Ie==null?"em":"strong em"),xe===!0&&(g.em=oe),Ie===!0&&(g.strong=oe);var Ce=S(g);return xe===!1&&(g.em=!1),Ie===!1&&(g.strong=!1),Ce}}else if(oe===" "&&(D.eat("*")||D.eat("_"))){if(D.peek()===" ")return S(g);D.backUp(1)}if(N.strikethrough){if(oe==="~"&&D.eatWhile(oe)){if(g.strikethrough){N.highlightFormatting&&(g.formatting="strikethrough");var Ce=S(g);return g.strikethrough=!1,Ce}else if(D.match(/^[^\s]/,!1))return g.strikethrough=!0,N.highlightFormatting&&(g.formatting="strikethrough"),S(g)}else if(oe===" "&&D.match(/^~~/,!0)){if(D.peek()===" ")return S(g);D.backUp(2)}}if(N.emoji&&oe===":"&&D.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){g.emoji=!0,N.highlightFormatting&&(g.formatting="emoji");var ue=S(g);return g.emoji=!1,ue}return oe===" "&&(D.match(/^ +$/,!1)?g.trailingSpace++:g.trailingSpace&&(g.trailingSpaceNewLine=!0)),S(g)}function f(D,g){var W=D.next();if(W===">"){g.f=g.inline=C,N.highlightFormatting&&(g.formatting="link");var J=S(g);return J?J+=" ":J="",J+K.linkInline}return D.match(/^[^>]+/,!0),K.linkInline}function w(D,g){if(D.eatSpace())return null;var W=D.next();return W==="("||W==="["?(g.f=g.inline=_(W==="("?")":"]"),N.highlightFormatting&&(g.formatting="link-string"),g.linkHref=!0,S(g)):"error"}var y={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function _(D){return function(g,W){var J=g.next();if(J===D){W.f=W.inline=C,N.highlightFormatting&&(W.formatting="link-string");var oe=S(W);return W.linkHref=!1,oe}return g.match(y[D]),W.linkHref=!0,S(W)}}function j(D,g){return D.match(/^([^\]\\]|\\.)*\]:/,!1)?(g.f=U,D.next(),N.highlightFormatting&&(g.formatting="link"),g.linkText=!0,S(g)):s(D,g,C)}function U(D,g){if(D.match(/^\]:/,!0)){g.f=g.inline=x,N.highlightFormatting&&(g.formatting="link");var W=S(g);return g.linkText=!1,W}return D.match(/^([^\]\\]|\\.)+/,!0),K.linkText}function x(D,g){return D.eatSpace()?null:(D.match(/^[^\s]+/,!0),D.peek()===void 0?g.linkTitle=!0:D.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),g.f=g.inline=C,K.linkHref+" url")}var F={startState:function(){return{f:T,prevLine:{stream:null},thisLine:{stream:null},block:T,htmlState:null,indentation:0,inline:C,text:R,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(D){return{f:D.f,prevLine:D.prevLine,thisLine:D.thisLine,block:D.block,htmlState:D.htmlState&&le.copyState($,D.htmlState),indentation:D.indentation,localMode:D.localMode,localState:D.localMode?le.copyState(D.localMode,D.localState):null,inline:D.inline,text:D.text,formatting:!1,linkText:D.linkText,linkTitle:D.linkTitle,linkHref:D.linkHref,code:D.code,em:D.em,strong:D.strong,strikethrough:D.strikethrough,emoji:D.emoji,header:D.header,setext:D.setext,hr:D.hr,taskList:D.taskList,list:D.list,listStack:D.listStack.slice(0),quote:D.quote,indentedCode:D.indentedCode,trailingSpace:D.trailingSpace,trailingSpaceNewLine:D.trailingSpaceNewLine,md_inside:D.md_inside,fencedEndRE:D.fencedEndRE}},token:function(D,g){if(g.formatting=!1,D!=g.thisLine.stream){if(g.header=0,g.hr=!1,D.match(/^\s*$/,!0))return E(g),null;if(g.prevLine=g.thisLine,g.thisLine={stream:D},g.taskList=!1,g.trailingSpace=0,g.trailingSpaceNewLine=!1,!g.localState&&(g.f=g.block,g.f!=k)){var W=D.match(/^\s*/,!0)[0].replace(/\t/g,h).length;if(g.indentation=W,g.indentationDiff=null,W>0)return null}}return g.f(D,g)},innerMode:function(D){return D.block==k?{state:D.htmlState,mode:$}:D.localState?{state:D.localState,mode:D.localMode}:{state:D,mode:F}},indent:function(D,g,W){return D.block==k&&$.indent?$.indent(D.htmlState,g,W):D.localState&&D.localMode.indent?D.localMode.indent(D.localState,g,W):le.Pass},blankLine:E,getType:S,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return F},"xml"),le.defineMIME("text/markdown","markdown"),le.defineMIME("text/x-markdown","markdown")})},nEHx:function(Ze,Se,q){"use strict";q.d(Se,"a",function(){return le});var le;(function(Y){Y.DARK="dark",Y.LIGHT="light",Y.HIGH_CONTRAST="hc"})(le||(le={}))},nnTU:function(Ze,Se,q){"use strict";q.d(Se,"b",function(){return K}),q.d(Se,"a",function(){return G});var le=q("MI8n"),Y=q("JYp7"),N=q("pmY6"),$=q("24hK"),H=q("746U"),M=q("Cg/j");const K=Object(M.c)("commandService"),G=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new le.b,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(n,O){if(!n)throw new Error("invalid command");if(typeof n=="string"){if(!O)throw new Error("invalid command");return this.registerCommand({id:n,handler:O})}if(n.description){const l=[];for(let o of n.description.args)l.push(o.constraint);const d=n.handler;n.handler=function(o,...h){return Object(H.o)(h,l),d(o,...h)}}const{id:v}=n;let p=this._commands.get(v);p||(p=new $.a,this._commands.set(v,p));let m=p.unshift(n),u=Object(N.i)(()=>{m();const l=this._commands.get(v);(l==null?void 0:l.isEmpty())&&this._commands.delete(v)});return this._onDidRegisterCommand.fire(v),u}registerCommandAlias(n,O){return G.registerCommand(n,(v,...p)=>v.get(K).executeCommand(O,...p))}getCommand(n){const O=this._commands.get(n);return!O||O.isEmpty()?void 0:Y.a.first(O)}getCommands(){const n=new Map;for(const O of this._commands.keys()){const v=this.getCommand(O);v&&n.set(O,v)}return n}};G.registerCommand("noop",()=>{})},osHv:function(Ze,Se,q){(function(le){le(q("VrN/"))})(function(le){"use strict";var Y=le.Pos;function N(o,h){return o.line-h.line||o.ch-h.ch}var $="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",H=$+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",M=new RegExp("<(/?)(["+$+"]["+H+"]*)","g");function K(o,h,s,a){this.line=h,this.ch=s,this.cm=o,this.text=o.getLine(h),this.min=a?Math.max(a.from,o.firstLine()):o.firstLine(),this.max=a?Math.min(a.to-1,o.lastLine()):o.lastLine()}function G(o,h){var s=o.cm.getTokenTypeAt(Y(o.line,h));return s&&/\btag\b/.test(s)}function n(o){return o.line>=o.max?void 0:(o.ch=0,o.text=o.cm.getLine(++o.line),!0)}function O(o){return o.line<=o.min?void 0:(o.text=o.cm.getLine(--o.line),o.ch=o.text.length,!0)}function v(o){for(;;){var h=o.text.indexOf(">",o.ch);if(h==-1){if(n(o))continue;return}if(!G(o,h+1)){o.ch=h+1;continue}var s=o.text.lastIndexOf("/",h),a=s>-1&&!/\S/.test(o.text.slice(s+1,h));return o.ch=h+1,a?"selfClose":"regular"}}function p(o){for(;;){var h=o.ch?o.text.lastIndexOf("<",o.ch-1):-1;if(h==-1){if(O(o))continue;return}if(!G(o,h+1)){o.ch=h;continue}M.lastIndex=h,o.ch=h;var s=M.exec(o.text);if(s&&s.index==h)return s}}function m(o){for(;;){M.lastIndex=o.ch;var h=M.exec(o.text);if(!h){if(n(o))continue;return}if(!G(o,h.index+1)){o.ch=h.index+1;continue}return o.ch=h.index+h[0].length,h}}function u(o){for(;;){var h=o.ch?o.text.lastIndexOf(">",o.ch-1):-1;if(h==-1){if(O(o))continue;return}if(!G(o,h+1)){o.ch=h;continue}var s=o.text.lastIndexOf("/",h),a=s>-1&&!/\S/.test(o.text.slice(s+1,h));return o.ch=h+1,a?"selfClose":"regular"}}function l(o,h){for(var s=[];;){var a=m(o),A,E=o.line,T=o.ch-(a?a[0].length:0);if(!a||!(A=v(o)))return;if(A=="selfClose")continue;if(a[1]){for(var k=s.length-1;k>=0;--k)if(s[k]==a[2]){s.length=k;break}if(k<0&&(!h||h==a[2]))return{tag:a[2],from:Y(E,T),to:Y(o.line,o.ch)}}else s.push(a[2])}}function d(o,h){for(var s=[];;){var a=u(o);if(!a)return;if(a=="selfClose"){p(o);continue}var A=o.line,E=o.ch,T=p(o);if(!T)return;if(T[1])s.push(T[2]);else{for(var k=s.length-1;k>=0;--k)if(s[k]==T[2]){s.length=k;break}if(k<0&&(!h||h==T[2]))return{tag:T[2],from:Y(o.line,o.ch),to:Y(A,E)}}}}le.registerHelper("fold","xml",function(o,h){for(var s=new K(o,h.line,0);;){var a=m(s);if(!a||s.line!=h.line)return;var A=v(s);if(!A)return;if(!a[1]&&A!="selfClose"){var E=Y(s.line,s.ch),T=l(s,a[2]);return T&&N(T.from,E)>0?{from:E,to:T.from}:null}}}),le.findMatchingTag=function(o,h,s){var a=new K(o,h.line,h.ch,s);if(a.text.indexOf(">")==-1&&a.text.indexOf("<")==-1)return;var A=v(a),E=A&&Y(a.line,a.ch),T=A&&p(a);if(!A||!T||N(a,h)>0)return;var k={from:Y(a.line,a.ch),to:E,tag:T[2]};return A=="selfClose"?{open:k,close:null,at:"open"}:T[1]?{open:d(a,T[2]),close:k,at:"close"}:(a=new K(o,E.line,E.ch,s),{open:k,close:l(a,T[2]),at:"open"})},le.findEnclosingTag=function(o,h,s,a){for(var A=new K(o,h.line,h.ch,s);;){var E=d(A,a);if(!E)break;var T=new K(o,h.line,h.ch,s),k=l(T,E.tag);if(k)return{open:E,close:k}}},le.scanForClosingTag=function(o,h,s,a){var A=new K(o,h.line,h.ch,a?{from:0,to:a}:null);return l(A,s)}})},p0QG:function(Ze,Se,q){Ze.exports={flex_box_center:"flex_box_center___2axlI",flex_space_between:"flex_space_between___F6m1U",flex_box_vertical_center:"flex_box_vertical_center___2GovZ",flex_box_center_end:"flex_box_center_end___2h9j0",flex_box_column:"flex_box_column___1kuIs",SubMentItem:"SubMentItem___34z-Y",MenuItem:"MenuItem___1bbPM",wrp:"wrp___3LRhb",classroomInfo:"classroomInfo___Ohxoq",title:"title___22ZLP",titleLeft:"titleLeft___1MP-h",titleRight:"titleRight___3zsz9",classroomUser:"classroomUser___1ePAN",headPic:"headPic___2lEg_",teacherInfo:"teacherInfo___3C0Dn",classroomDesc:"classroomDesc____QVZX",classroomDescBg:"classroomDescBg___1e7L7",joinCouses:"joinCouses___2G4vP",bg:"bg___2QojS",leftMenus:"leftMenus___34tjX",titleSelected:"titleSelected___K6QwW",menuText:"menuText___3qMqH",totalCount:"totalCount___R2q38",actions:"actions___26Ww0",task_count:"task_count___3UQ1V",container:"container___2EGM4",leftMenuActions:"leftMenuActions___3_J-1"}},p5ED:function(Ze,Se,q){"use strict";var le=q("+L6B"),Y=q("2/Rp"),N=q("5Dmo"),$=q("3S7+"),H=q("k1fw"),M=q("9og8"),K=q("tJVT"),G=q("WmNS"),n=q.n(G),O=q("q1tI"),v=q.n(O),p=q("vHTk"),m=q.n(p),u=q("yEEn"),l=q("ZW9T"),d=q("1vsH"),o=q("V0Rq"),h=q("m3rI");Se.a=function(s){var a,A,E,T,k,L,S,R=s.editOffice,C=R===void 0?"view":R,f=s.data,w=s.theme,y=s.type,_=s.filename,j=s.monacoEditor,U=s.className,x=s.style,F=s.close,D=s.onClose,g=s.hasMask,W=s.disabledDownload,J=Object(O.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),oe=Object(K.a)(J,2),fe=oe[0],Re=oe[1],be=Object(O.useState)(""),Le=Object(K.a)(be,2),Ce=Le[0],Te=Le[1],ve=Object(O.useState)(),X=Object(K.a)(ve,2),b=X[0],I=X[1],B=window.ENV==="build"?"/react/build":"",Q=h.a.PROXY_SERVER||location.origin,z,he=1024*1024,xe=10*he,Ie=Object(O.useRef)();(a=f)!==null&&a!==void 0&&a.startsWith("/api")&&y!=="txt"&&(f=(h.a.API_SERVER||location.origin)+f),y==="office"&&(z=Object(d.T)(f).filesize,z>xe&&(y="other")),_&&j&&(j.filename=_),Object(O.useEffect)(function(){var Ae,Ne,Be=(Ae=document.cookie)===null||Ae===void 0||((Ne=Ae.replace(/\s/g,""))===null||Ne===void 0)?void 0:Ne.split(";");Be==null||Be.map(function(Ke){var Ge=Ke.split("=");Ge[0]==="_educoder_session"&&Te(Ge[1])})},[]),Object(O.useEffect)(function(){y==="office"&&ue()},[y,f]);var ue=function(){var Ae=Object(M.a)(n.a.mark(function Ne(){var Be,Ke,Ge;return n.a.wrap(function(je){for(;;)switch(je.prev=je.next){case 0:return console.log("data:",f),Be=f,f.startsWith("http")||(Be=location.origin+Be),Ke=new URL(Be).pathname.split("/").pop(),je.next=6,Object(o.V)({attachment_id:Ke});case 6:Ge=je.sent,I(Ge);case 8:case"end":return je.stop()}},Ne)}));return function(){return Ae.apply(this,arguments)}}(),me=function(){if(f.startsWith("http")||f.startsWith("blob:")){we();return}Object(d.z)(_||"educoder",f,_)},we=function(){Object(d.x)(_||"educoder",decodeURIComponent(f))};return v.a.createElement("div",{style:Object(H.a)({},x||{}),className:"".concat(g&&m.a.bgBlack," ").concat(y?m.a.wrp:"hide")},F&&v.a.createElement("div",{className:m.a.close,ref:Ie},!W&&v.a.createElement($.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return Ie.current}},v.a.createElement("span",{onClick:we},v.a.createElement("i",{className:"icon-quxiaozhiding"}))),v.a.createElement($.a,{title:"\u5173\u95ED",getPopupContainer:function(){return Ie.current}},v.a.createElement("span",{className:"",onClick:D},v.a.createElement("i",{className:"icon-guanbi1"})))),v.a.createElement("div",{className:"".concat(m.a[U]," ").concat(U," ").concat(m.a.monaco," ").concat(y==="txt"?"show":"hide")},y==="txt"&&v.a.createElement(l.b,j)),y==="audio"&&v.a.createElement("audio",{src:"".concat(((A=f)===null||A===void 0?void 0:A.indexOf("http://"))>-1||((E=f)===null||E===void 0?void 0:E.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(f),autoPlay:!0}),y==="video"&&v.a.createElement(v.a.Fragment,null,((T=f)===null||T===void 0?void 0:T.indexOf("http"))>-1?v.a.createElement("video",{controls:!0,src:"".concat(f),autoPlay:!0}):v.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(f),autoPlay:!0})),y==="office"&&b&&v.a.createElement("iframe",{src:"".concat(B,"/office.html?key=").concat(b.key,"&url=").concat(Q+b.url,"&callbackUrl=").concat(Q+b.callbackUrl,"&fileType=").concat(b.fileType,"&title=").concat(b.title,"&model=").concat(C,"&officeServer=").concat(h.a.OFFICE_SERVER,"&disabledDownload=").concat(!!W)}),y==="html"&&v.a.createElement("iframe",{src:f+"&disposition=inline"}),y==="pdf"&&v.a.createElement("iframe",{src:"".concat(B,"/js/pdfview/index.html?url=").concat(f,"&disabledDownload=").concat(!!W)}),y==="image"&&v.a.createElement("img",{src:"".concat(((k=f)===null||k===void 0?void 0:k.indexOf("http://"))>-1||((L=f)===null||L===void 0?void 0:L.indexOf("https://"))>-1||(S=f)!==null&&S!==void 0&&S.startsWith("/api")?"":"data:image/png;base64,").concat(f)}),y==="other"&&v.a.createElement("div",null,v.a.createElement(Y.a,{type:"primary",size:"large",onClick:me},v.a.createElement(u.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),y==="download"&&v.a.createElement(Y.a,{type:"primary",size:"large",onClick:me},v.a.createElement(u.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(Ze,Se,q){},pmY6:function(Ze,Se,q){"use strict";q.d(Se,"h",function(){return O}),q.d(Se,"g",function(){return p}),q.d(Se,"f",function(){return m}),q.d(Se,"e",function(){return u}),q.d(Se,"i",function(){return l}),q.d(Se,"b",function(){return d}),q.d(Se,"a",function(){return o}),q.d(Se,"d",function(){return h}),q.d(Se,"c",function(){return s});var le=q("C/vA"),Y=q("JYp7");const N=!1;let $=null;function H(a){$=a}if(N){const a="__is_disposable_tracked__";H(new class{trackDisposable(A){const E=new Error("Potentially leaked disposable").stack;setTimeout(()=>{A[a]||console.log(E)},3e3)}setParent(A,E){if(A&&A!==o.None)try{A[a]=!0}catch(T){}}markAsDisposed(A){if(A&&A!==o.None)try{A[a]=!0}catch(E){}}markAsSingleton(A){}})}function M(a){return $==null||$.trackDisposable(a),a}function K(a){$==null||$.markAsDisposed(a)}function G(a,A){$==null||$.setParent(a,A)}function n(a,A){if(!$)return;for(const E of a)$.setParent(E,A)}function O(a){return $==null||$.markAsSingleton(a),a}class v extends Error{constructor(a){super(`Encountered errors while disposing of store. Errors: [${a.join(", ")}]`);this.errors=a}}function p(a){return typeof a.dispose=="function"&&a.dispose.length===0}function m(a){if(Y.a.is(a)){let A=[];for(const E of a)if(E)try{E.dispose()}catch(T){A.push(T)}if(A.length===1)throw A[0];if(A.length>1)throw new v(A);return Array.isArray(a)?[]:a}else if(a)return a.dispose(),a}function u(...a){const A=l(()=>m(a));return n(a,A),A}function l(a){const A=M({dispose:Object(le.a)(()=>{K(A),a()})});return A}class d{constructor(){this._toDispose=new Set,this._isDisposed=!1,M(this)}dispose(){if(this._isDisposed)return;K(this),this._isDisposed=!0,this.clear()}clear(){try{m(this._toDispose.values())}finally{this._toDispose.clear()}}add(a){if(!a)return a;if(a===this)throw new Error("Cannot register a disposable on itself!");return G(a,this),this._isDisposed?d.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(a),a}}d.DISABLE_DISPOSED_WARNING=!1;class o{constructor(){this._store=new d,M(this),G(this._store,this)}dispose(){K(this),this._store.dispose()}_register(a){if(a===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(a)}}o.None=Object.freeze({dispose(){}});class h{constructor(){this._isDisposed=!1,M(this)}get value(){return this._isDisposed?void 0:this._value}set value(a){var A;if(this._isDisposed||a===this._value)return;(A=this._value)===null||A===void 0||A.dispose(),a&&G(a,this),this._value=a}clear(){this.value=void 0}dispose(){var a;this._isDisposed=!0,K(this),(a=this._value)===null||a===void 0||a.dispose(),this._value=void 0}clearAndLeak(){const a=this._value;return this._value=void 0,a&&G(a,null),a}}class s{constructor(a){this.object=a}dispose(){}}},psGv:function(Ze,Se,q){var le,Y;(function(){var N;(function(){"use strict";var K=[,,function(v){function p(l){this.__parent=l,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 l=new p(this.__parent);return l.set_indent(this.__indent_count,this.__alignment_count),l},p.prototype.item=function(l){return l<0?this.__items[this.__items.length+l]:this.__items[l]},p.prototype.has_match=function(l){for(var d=this.__items.length-1;d>=0;d--)if(this.__items[d].match(l))return!0;return!1},p.prototype.set_indent=function(l,d){this.is_empty()&&(this.__indent_count=l||0,this.__alignment_count=d||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 l=this.__parent.current_line;return l.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),l.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),l.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,l.__items[0]===" "&&(l.__items.splice(0,1),l.__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(l){this.__items.push(l);var d=l.lastIndexOf(`
|
|
`);d!==-1?this.__character_count=l.length-d:this.__character_count+=l.length},p.prototype.pop=function(){var l=null;return this.is_empty()||(l=this.__items.pop(),this.__character_count-=l.length),l},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 l="";return this.is_empty()?this.__parent.indent_empty_lines&&(l=this.__parent.get_indent_string(this.__indent_count)):(l=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),l+=this.__items.join("")),l};function m(l,d){this.__cache=[""],this.__indent_size=l.indent_size,this.__indent_string=l.indent_char,l.indent_with_tabs||(this.__indent_string=new Array(l.indent_size+1).join(l.indent_char)),d=d||"",l.indent_level>0&&(d=new Array(l.indent_level+1).join(this.__indent_string)),this.__base_string=d,this.__base_string_length=d.length}m.prototype.get_indent_size=function(l,d){var o=this.__base_string_length;return d=d||0,l<0&&(o=0),o+=l*this.__indent_size,o+=d,o},m.prototype.get_indent_string=function(l,d){var o=this.__base_string;return d=d||0,l<0&&(l=0,o=""),d+=l*this.__indent_size,this.__ensure_cache(d),o+=this.__cache[d],o},m.prototype.__ensure_cache=function(l){for(;l>=this.__cache.length;)this.__add_column()},m.prototype.__add_column=function(){var l=this.__cache.length,d=0,o="";this.__indent_size&&l>=this.__indent_size&&(d=Math.floor(l/this.__indent_size),l-=d*this.__indent_size,o=new Array(d+1).join(this.__indent_string)),l&&(o+=new Array(l+1).join(" ")),this.__cache.push(o)};function u(l,d){this.__indent_cache=new m(l,d),this.raw=!1,this._end_with_newline=l.end_with_newline,this.indent_size=l.indent_size,this.wrap_line_length=l.wrap_line_length,this.indent_empty_lines=l.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(l,d){return this.__indent_cache.get_indent_string(l,d)},u.prototype.get_indent_size=function(l,d){return this.__indent_cache.get_indent_size(l,d)},u.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},u.prototype.add_new_line=function(l){return this.is_empty()||!l&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},u.prototype.get_code=function(l){this.trim(!0);var d=this.current_line.pop();d&&(d[d.length-1]===`
|
|
`&&(d=d.replace(/\n+$/g,"")),this.current_line.push(d)),this._end_with_newline&&this.__add_outputline();var o=this.__lines.join(`
|
|
`);return l!==`
|
|
`&&(o=o.replace(/[\n]/g,l)),o},u.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},u.prototype.set_indent=function(l,d){return l=l||0,d=d||0,this.next_line.set_indent(l,d),this.__lines.length>1?(this.current_line.set_indent(l,d),!0):(this.current_line.set_indent(),!1)},u.prototype.add_raw_token=function(l){for(var d=0;d<l.newlines;d++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(l.whitespace_before),this.current_line.push(l.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},u.prototype.add_token=function(l){this.__add_space_before_token(),this.current_line.push(l),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(l){for(var d=this.__lines.length;l<d;)this.__lines[l]._remove_indent(),l++;this.current_line._remove_wrap_indent()},u.prototype.trim=function(l){for(l=l===void 0?!1:l,this.current_line.trim();l&&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(l,d){for(var o=this.__lines.length-2;o>=0;){var h=this.__lines[o];if(h.is_empty())break;if(h.item(0).indexOf(l)!==0&&h.item(-1)!==d){this.__lines.splice(o+1,0,new p(this)),this.previous_line=this.__lines[this.__lines.length-2];break}o--}},v.exports.Output=u},function(v){function p(m,u,l,d){this.type=m,this.text=u,this.comments_before=null,this.newlines=l||0,this.whitespace_before=d||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}v.exports.Token=p},,,function(v){function p(l,d){this.raw_options=m(l,d),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(l,d){var o=this.raw_options[l],h=d||[];return typeof o=="object"?o!==null&&typeof o.concat=="function"&&(h=o.concat()):typeof o=="string"&&(h=o.split(/[^a-zA-Z0-9_\/\-]+/)),h},p.prototype._get_boolean=function(l,d){var o=this.raw_options[l],h=o===void 0?!!d:!!o;return h},p.prototype._get_characters=function(l,d){var o=this.raw_options[l],h=d||"";return typeof o=="string"&&(h=o.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),h},p.prototype._get_number=function(l,d){var o=this.raw_options[l];d=parseInt(d,10),isNaN(d)&&(d=0);var h=parseInt(o,10);return isNaN(h)&&(h=d),h},p.prototype._get_selection=function(l,d,o){var h=this._get_selection_list(l,d,o);if(h.length!==1)throw new Error("Invalid Option Value: The option '"+l+`' can only be one of the following values:
|
|
`+d+`
|
|
You passed in: '`+this.raw_options[l]+"'");return h[0]},p.prototype._get_selection_list=function(l,d,o){if(!d||d.length===0)throw new Error("Selection list cannot be empty.");if(o=o||[d[0]],!this._is_valid_selection(o,d))throw new Error("Invalid Default Value!");var h=this._get_array(l,o);if(!this._is_valid_selection(h,d))throw new Error("Invalid Option Value: The option '"+l+`' can contain only the following values:
|
|
`+d+`
|
|
You passed in: '`+this.raw_options[l]+"'");return h},p.prototype._is_valid_selection=function(l,d){return l.length&&d.length&&!l.some(function(o){return d.indexOf(o)===-1})};function m(l,d){var o={};l=u(l);var h;for(h in l)h!==d&&(o[h]=l[h]);if(d&&l[d])for(h in l[d])o[h]=l[d][h];return o}function u(l){var d={},o;for(o in l){var h=o.replace(/-/g,"_");d[h]=l[o]}return d}v.exports.Options=p,v.exports.normalizeOpts=u,v.exports.mergeOpts=m},,function(v){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 l=null;return u=u||0,u+=this.__position,u>=0&&u<this.__input_length&&(l=this.__input.charAt(u)),l},m.prototype.__match=function(u,l){u.lastIndex=l;var d=u.exec(this.__input);return d&&!(p&&u.sticky)&&(d.index!==l&&(d=null)),d},m.prototype.test=function(u,l){return l=l||0,l+=this.__position,l>=0&&l<this.__input_length?!!this.__match(u,l):!1},m.prototype.testChar=function(u,l){var d=this.peek(l);return u.lastIndex=0,d!==null&&u.test(d)},m.prototype.match=function(u){var l=this.__match(u,this.__position);return l?this.__position+=l[0].length:l=null,l},m.prototype.read=function(u,l,d){var o="",h;return u&&(h=this.match(u),h&&(o+=h[0])),l&&(h||!u)&&(o+=this.readUntil(l,d)),o},m.prototype.readUntil=function(u,l){var d="",o=this.__position;u.lastIndex=this.__position;var h=u.exec(this.__input);return h?(o=h.index,l&&(o+=h[0].length)):o=this.__input_length,d=this.__input.substring(this.__position,o),this.__position=o,d},m.prototype.readUntilAfter=function(u){return this.readUntil(u,!0)},m.prototype.get_regexp=function(u,l){var d=null,o="g";return l&&p&&(o="y"),typeof u=="string"&&u!==""?d=new RegExp(u,o):u&&(d=new RegExp(u.source,o)),d},m.prototype.get_literal_regexp=function(u){return RegExp(u.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},m.prototype.peekUntilAfter=function(u){var l=this.__position,d=this.readUntilAfter(u);return this.__position=l,d},m.prototype.lookBack=function(u){var l=this.__position-1;return l>=u.length&&this.__input.substring(l-u.length,l).toLowerCase()===u},v.exports.InputScanner=m},function(v,p,m){var u=m(8).InputScanner,l=m(3).Token,d=m(10).TokenStream,o=m(11).WhitespacePattern,h={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},s=function(a,A){this._input=new u(a),this._options=A||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new o(this._input)};s.prototype.tokenize=function(){this._input.restart(),this.__tokens=new d,this._reset();for(var a,A=new l(h.START,""),E=null,T=[],k=new d;A.type!==h.EOF;){for(a=this._get_next_token(A,E);this._is_comment(a);)k.add(a),a=this._get_next_token(A,E);k.isEmpty()||(a.comments_before=k,k=new d),a.parent=E,this._is_opening(a)?(T.push(E),E=a):E&&this._is_closing(a,E)&&(a.opened=E,E.closed=a,E=T.pop(),a.parent=E),a.previous=A,A.next=a,this.__tokens.add(a),A=a}return this.__tokens},s.prototype._is_first_token=function(){return this.__tokens.isEmpty()},s.prototype._reset=function(){},s.prototype._get_next_token=function(a,A){this._readWhitespace();var E=this._input.read(/.+/g);return E?this._create_token(h.RAW,E):this._create_token(h.EOF,"")},s.prototype._is_comment=function(a){return!1},s.prototype._is_opening=function(a){return!1},s.prototype._is_closing=function(a,A){return!1},s.prototype._create_token=function(a,A){var E=new l(a,A,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return E},s.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},v.exports.Tokenizer=s,v.exports.TOKEN=h},function(v){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},v.exports.TokenStream=p},function(v,p,m){var u=m(12).Pattern;function l(d,o){u.call(this,d,o),o?this._line_regexp=this._input.get_regexp(o._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}l.prototype=new u,l.prototype.__set_whitespace_patterns=function(d,o){d+="\\t ",o+="\\n\\r",this._match_pattern=this._input.get_regexp("["+d+o+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+o+"]")},l.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var d=this._input.read(this._match_pattern);if(d===" ")this.whitespace_before_token=" ";else if(d){var o=this.__split(this._newline_regexp,d);this.newline_count=o.length-1,this.whitespace_before_token=o[this.newline_count]}return d},l.prototype.matching=function(d,o){var h=this._create();return h.__set_whitespace_patterns(d,o),h._update(),h},l.prototype._create=function(){return new l(this._input,this)},l.prototype.__split=function(d,o){d.lastIndex=0;for(var h=0,s=[],a=d.exec(o);a;)s.push(o.substring(h,a.index)),h=a.index+a[0].length,a=d.exec(o);return h<o.length?s.push(o.substring(h,o.length)):s.push(""),s},v.exports.WhitespacePattern=l},function(v){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(){},v.exports.Pattern=p},function(v){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 l=this.__directive_pattern.exec(m);l;)u[l[1]]=l[2],l=this.__directive_pattern.exec(m);return u},p.prototype.readIgnored=function(m){return m.readUntilAfter(this.__directives_end_ignore_pattern)},v.exports.Directives=p},function(v,p,m){var u=m(12).Pattern,l={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function d(o,h){u.call(this,o,h),this.__template_pattern=null,this._disabled=Object.assign({},l),this._excluded=Object.assign({},l),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 s=new u(o);this.__patterns={handlebars_comment:s.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:s.starting_with(/{{{/).until_after(/}}}/),handlebars:s.starting_with(/{{/).until_after(/}}/),php:s.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:s.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:s.starting_with(/{%/).until_after(/%}/),django_value:s.starting_with(/{{/).until_after(/}}/),django_comment:s.starting_with(/{#/).until_after(/#}/),smarty:s.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:s.starting_with(/{\*/).until_after(/\*}/),smarty_literal:s.starting_with(/{literal}/).until_after(/{\/literal}/)}}d.prototype=new u,d.prototype._create=function(){return new d(this._input,this)},d.prototype._update=function(){this.__set_templated_pattern()},d.prototype.disable=function(o){var h=this._create();return h._disabled[o]=!0,h._update(),h},d.prototype.read_options=function(o){var h=this._create();for(var s in l)h._disabled[s]=o.templating.indexOf(s)===-1;return h._update(),h},d.prototype.exclude=function(o){var h=this._create();return h._excluded[o]=!0,h._update(),h},d.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 h=this._read_template();h;)this._match_pattern?h+=this._input.read(this._match_pattern):h+=this._input.readUntil(this.__template_pattern),o+=h,h=this._read_template();return this._until_after&&(o+=this._input.readUntilAfter(this._until_pattern)),o},d.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("|")+")")},d.prototype._read_template=function(){var o="",h=this._input.peek();if(h==="<"){var s=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&s==="?"&&(o=o||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&s==="%"&&(o=o||this.__patterns.erb.read())}else h==="{"&&(!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},v.exports.TemplatablePattern=d},,,,function(v,p,m){var u=m(19).Beautifier,l=m(20).Options;function d(o,h,s,a){var A=new u(o,h,s,a);return A.beautify()}v.exports=d,v.exports.defaultOptions=function(){return new l}},function(v,p,m){var u=m(20).Options,l=m(2).Output,d=m(21).Tokenizer,o=m(21).TOKEN,h=/\r\n|[\r\n]/,s=/\r\n|[\r\n]/g,a=function(w,y){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 l(w,y)};a.prototype.current_line_has_match=function(w){return this._output.current_line.has_match(w)},a.prototype.set_space_before_token=function(w,y){this._output.space_before_token=w,this._output.non_breaking_space=y},a.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},a.prototype.add_raw_token=function(w){this._output.add_raw_token(w)},a.prototype.print_preserved_newlines=function(w){var y=0;w.type!==o.TEXT&&w.previous.type!==o.TEXT&&(y=w.newlines?1:0),this.preserve_newlines&&(y=w.newlines<this.max_preserve_newlines+1?w.newlines:this.max_preserve_newlines+1);for(var _=0;_<y;_++)this.print_newline(_>0);return y!==0},a.prototype.traverse_whitespace=function(w){return w.whitespace_before||w.newlines?(this.print_preserved_newlines(w)||(this._output.space_before_token=!0),!0):!1},a.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},a.prototype.print_newline=function(w){this._output.add_new_line(w)},a.prototype.print_token=function(w){w.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(w.text))},a.prototype.indent=function(){this.indent_level++},a.prototype.get_full_indent=function(w){return w=this.indent_level+(w||0),w<1?"":this._output.get_indent_string(w)};var A=function(w){for(var y=null,_=w.next;_.type!==o.EOF&&w.closed!==_;){if(_.type===o.ATTRIBUTE&&_.text==="type"){_.next&&_.next.type===o.EQUALS&&_.next.next&&_.next.next.type===o.VALUE&&(y=_.next.next.text);break}_=_.next}return y},E=function(w,y){var _=null,j=null;return y.closed?(w==="script"?_="text/javascript":w==="style"&&(_="text/css"),_=A(y)||_,_.search("text/css")>-1?j="css":_.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?j="javascript":_.search(/(text|application|dojo)\/(x-)?(html)/)>-1?j="html":_.search(/test\/null/)>-1&&(j="null"),j):null};function T(w,y){return y.indexOf(w)!==-1}function k(w,y,_){this.parent=w||null,this.tag=y?y.tag_name:"",this.indent_level=_||0,this.parser_token=y||null}function L(w){this._printer=w,this._current_frame=null}L.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},L.prototype.record_tag=function(w){var y=new k(this._current_frame,w,this._printer.indent_level);this._current_frame=y},L.prototype._try_pop_frame=function(w){var y=null;return w&&(y=w.parser_token,this._printer.indent_level=w.indent_level,this._current_frame=w.parent),y},L.prototype._get_frame=function(w,y){for(var _=this._current_frame;_&&!(w.indexOf(_.tag)!==-1);){if(y&&y.indexOf(_.tag)!==-1){_=null;break}_=_.parent}return _},L.prototype.try_pop=function(w,y){var _=this._get_frame([w],y);return this._try_pop_frame(_)},L.prototype.indent_to_tag=function(w){var y=this._get_frame(w);y&&(this._printer.indent_level=y.indent_level)};function S(w,y,_,j){this._source_text=w||"",y=y||{},this._js_beautify=_,this._css_beautify=j,this._tag_stack=null;var U=new u(y,"html");this._options=U,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"}S.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var w=this._source_text,y=this._options.eol;this._options.eol==="auto"&&(y=`
|
|
`,w&&h.test(w)&&(y=w.match(h)[0])),w=w.replace(s,`
|
|
`);var _=w.match(/^[\t ]*/)[0],j={text:"",type:""},U=new R,x=new a(this._options,_),F=new d(w,this._options).tokenize();this._tag_stack=new L(x);for(var D=null,g=F.next();g.type!==o.EOF;)g.type===o.TAG_OPEN||g.type===o.COMMENT?(D=this._handle_tag_open(x,g,U,j),U=D):g.type===o.ATTRIBUTE||g.type===o.EQUALS||g.type===o.VALUE||g.type===o.TEXT&&!U.tag_complete?D=this._handle_inside_tag(x,g,U,F):g.type===o.TAG_CLOSE?D=this._handle_tag_close(x,g,U):g.type===o.TEXT?D=this._handle_text(x,g,U):x.add_raw_token(g),j=D,g=F.next();var W=x._output.get_code(y);return W},S.prototype._handle_tag_close=function(w,y,_){var j={text:y.text,type:y.type};return w.alignment_size=0,_.tag_complete=!0,w.set_space_before_token(y.newlines||y.whitespace_before!=="",!0),_.is_unformatted?w.add_raw_token(y):(_.tag_start_char==="<"&&(w.set_space_before_token(y.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&_.has_wrapped_attrs&&w.print_newline(!1)),w.print_token(y)),_.indent_content&&!(_.is_unformatted||_.is_content_unformatted)&&(w.indent(),_.indent_content=!1),!_.is_inline_element&&!(_.is_unformatted||_.is_content_unformatted)&&w.set_wrap_point(),j},S.prototype._handle_inside_tag=function(w,y,_,j){var U=_.has_wrapped_attrs,x={text:y.text,type:y.type};if(w.set_space_before_token(y.newlines||y.whitespace_before!=="",!0),_.is_unformatted)w.add_raw_token(y);else if(_.tag_start_char==="{"&&y.type===o.TEXT)w.print_preserved_newlines(y)?(y.newlines=0,w.add_raw_token(y)):w.print_token(y);else{if(y.type===o.ATTRIBUTE?(w.set_space_before_token(!0),_.attr_count+=1):(y.type===o.EQUALS||y.type===o.VALUE&&y.previous.type===o.EQUALS)&&w.set_space_before_token(!1),y.type===o.ATTRIBUTE&&_.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(w.traverse_whitespace(y),U=U||y.newlines!==0),this._is_wrap_attributes_force)){var F=_.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&_.attr_count===1){var D=!0,g=0,W;do{if(W=j.peek(g),W.type===o.ATTRIBUTE){D=!1;break}g+=1}while(g<4&&W.type!==o.EOF&&W.type!==o.TAG_CLOSE);F=!D}F&&(w.print_newline(!1),U=!0)}w.print_token(y),U=U||w.previous_token_wrapped(),_.has_wrapped_attrs=U}return x},S.prototype._handle_text=function(w,y,_){var j={text:y.text,type:"TK_CONTENT"};return _.custom_beautifier_name?this._print_custom_beatifier_text(w,y,_):_.is_unformatted||_.is_content_unformatted?w.add_raw_token(y):(w.traverse_whitespace(y),w.print_token(y)),j},S.prototype._print_custom_beatifier_text=function(w,y,_){var j=this;if(y.text!==""){var U=y.text,x,F=1,D="",g="";_.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?x=this._js_beautify:_.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?x=this._css_beautify:_.custom_beautifier_name==="html"&&(x=function(be,Le){var Ce=new S(be,Le,j._js_beautify,j._css_beautify);return Ce.beautify()}),this._options.indent_scripts==="keep"?F=0:this._options.indent_scripts==="separate"&&(F=-w.indent_level);var W=w.get_full_indent(F);if(U=U.replace(/\n[ \t]*$/,""),_.custom_beautifier_name!=="html"&&U[0]==="<"&&U.match(/^(<!--|<!\[CDATA\[)/)){var J=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(U);if(!J){w.add_raw_token(y);return}D=W+J[1]+`
|
|
`,U=J[4],J[5]&&(g=W+J[5]),U=U.replace(/\n[ \t]*$/,""),(J[2]||J[3].indexOf(`
|
|
`)!==-1)&&(J=J[3].match(/[ \t]+$/),J&&(y.whitespace_before=J[0]))}if(U)if(x){var oe=function(){this.eol=`
|
|
`};oe.prototype=this._options.raw_options;var fe=new oe;U=x(W+U,fe)}else{var Re=y.whitespace_before;Re&&(U=U.replace(new RegExp(`
|
|
(`+Re+")?","g"),`
|
|
`)),U=W+U.replace(/\n/g,`
|
|
`+W)}D&&(U?U=D+U+`
|
|
`+g:U=D+g),w.print_newline(!1),U&&(y.text=U,y.whitespace_before="",y.newlines=0,w.add_raw_token(y),w.print_newline(!0))}},S.prototype._handle_tag_open=function(w,y,_,j){var U=this._get_tag_open_token(y);return(_.is_unformatted||_.is_content_unformatted)&&!_.is_empty_element&&y.type===o.TAG_OPEN&&y.text.indexOf("</")===0?(w.add_raw_token(y),U.start_tag_token=this._tag_stack.try_pop(U.tag_name)):(w.traverse_whitespace(y),this._set_tag_position(w,y,U,_,j),U.is_inline_element||w.set_wrap_point(),w.print_token(y)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(U.alignment_size=y.text.length+1),!U.tag_complete&&!U.is_unformatted&&(w.alignment_size=U.alignment_size),U};var R=function(w,y){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="",!y)this.tag_complete=!0;else{var _;this.tag_start_char=y.text[0],this.text=y.text,this.tag_start_char==="<"?(_=y.text.match(/^<([^\s>]*)/),this.tag_check=_?_[1]:""):(_=y.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=_?_[1]:"",(y.text.startsWith("{{#>")||y.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&y.next!==null?this.tag_check=y.next.text.split(" ")[0]:this.tag_check=y.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),y.type===o.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||y.closed&&y.closed.text==="/>";var j=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(j=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(j)))}};S.prototype._get_tag_open_token=function(w){var y=new R(this._tag_stack.get_parser_token(),w);return y.alignment_size=this._options.wrap_attributes_indent_size,y.is_end_tag=y.is_end_tag||T(y.tag_check,this._options.void_elements),y.is_empty_element=y.tag_complete||y.is_start_tag&&y.is_end_tag,y.is_unformatted=!y.tag_complete&&T(y.tag_check,this._options.unformatted),y.is_content_unformatted=!y.is_empty_element&&T(y.tag_check,this._options.content_unformatted),y.is_inline_element=T(y.tag_name,this._options.inline)||y.tag_name.includes("-")||y.tag_start_char==="{",y},S.prototype._set_tag_position=function(w,y,_,j,U){if(_.is_empty_element||(_.is_end_tag?_.start_tag_token=this._tag_stack.try_pop(_.tag_name):(this._do_optional_end_element(_)&&(_.is_inline_element||w.print_newline(!1)),this._tag_stack.record_tag(_),(_.tag_name==="script"||_.tag_name==="style")&&!(_.is_unformatted||_.is_content_unformatted)&&(_.custom_beautifier_name=E(_.tag_check,y)))),T(_.tag_check,this._options.extra_liners)&&(w.print_newline(!1),w._output.just_added_blankline()||w.print_newline(!0)),_.is_empty_element){if(_.tag_start_char==="{"&&_.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),_.indent_content=!0;var x=w.current_line_has_match(/{{#if/);x||w.print_newline(!1)}_.tag_name==="!--"&&U.type===o.TAG_CLOSE&&j.is_end_tag&&_.text.indexOf(`
|
|
`)===-1||(_.is_inline_element||_.is_unformatted||w.print_newline(!1),this._calcluate_parent_multiline(w,_))}else if(_.is_end_tag){var F=!1;F=_.start_tag_token&&_.start_tag_token.multiline_content,F=F||!_.is_inline_element&&!(j.is_inline_element||j.is_unformatted)&&!(U.type===o.TAG_CLOSE&&_.start_tag_token===j)&&U.type!=="TK_CONTENT",(_.is_content_unformatted||_.is_unformatted)&&(F=!1),F&&w.print_newline(!1)}else _.indent_content=!_.custom_beautifier_name,_.tag_start_char==="<"&&(_.tag_name==="html"?_.indent_content=this._options.indent_inner_html:_.tag_name==="head"?_.indent_content=this._options.indent_head_inner_html:_.tag_name==="body"&&(_.indent_content=this._options.indent_body_inner_html)),!(_.is_inline_element||_.is_unformatted)&&(U.type!=="TK_CONTENT"||_.is_content_unformatted)&&w.print_newline(!1),this._calcluate_parent_multiline(w,_)},S.prototype._calcluate_parent_multiline=function(w,y){y.parent&&w._output.just_added_newline()&&!((y.is_inline_element||y.is_unformatted)&&y.parent.is_inline_element)&&(y.parent.multiline_content=!0)};var C=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","nav","ol","p","pre","section","table","ul"],f=["a","audio","del","ins","map","noscript","video"];S.prototype._do_optional_end_element=function(w){var y=null;if(w.is_empty_element||!w.is_start_tag||!w.parent)return;if(w.tag_name==="body")y=y||this._tag_stack.try_pop("head");else if(w.tag_name==="li")y=y||this._tag_stack.try_pop("li",["ol","ul"]);else if(w.tag_name==="dd"||w.tag_name==="dt")y=y||this._tag_stack.try_pop("dt",["dl"]),y=y||this._tag_stack.try_pop("dd",["dl"]);else if(w.parent.tag_name==="p"&&C.indexOf(w.tag_name)!==-1){var _=w.parent.parent;(!_||f.indexOf(_.tag_name)===-1)&&(y=y||this._tag_stack.try_pop("p"))}else w.tag_name==="rp"||w.tag_name==="rt"?(y=y||this._tag_stack.try_pop("rt",["ruby","rtc"]),y=y||this._tag_stack.try_pop("rp",["ruby","rtc"])):w.tag_name==="optgroup"?y=y||this._tag_stack.try_pop("optgroup",["select"]):w.tag_name==="option"?y=y||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):w.tag_name==="colgroup"?y=y||this._tag_stack.try_pop("caption",["table"]):w.tag_name==="thead"?(y=y||this._tag_stack.try_pop("caption",["table"]),y=y||this._tag_stack.try_pop("colgroup",["table"])):w.tag_name==="tbody"||w.tag_name==="tfoot"?(y=y||this._tag_stack.try_pop("caption",["table"]),y=y||this._tag_stack.try_pop("colgroup",["table"]),y=y||this._tag_stack.try_pop("thead",["table"]),y=y||this._tag_stack.try_pop("tbody",["table"])):w.tag_name==="tr"?(y=y||this._tag_stack.try_pop("caption",["table"]),y=y||this._tag_stack.try_pop("colgroup",["table"]),y=y||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(w.tag_name==="th"||w.tag_name==="td")&&(y=y||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),y=y||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return w.parent=this._tag_stack.get_parser_token(),y},v.exports.Beautifier=S},function(v,p,m){var u=m(6).Options;function l(d){u.call(this,d,"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"])}l.prototype=new u,v.exports.Options=l},function(v,p,m){var u=m(9).Tokenizer,l=m(9).TOKEN,d=m(13).Directives,o=m(14).TemplatablePattern,h=m(12).Pattern,s={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:l.START,RAW:l.RAW,EOF:l.EOF},a=new d(/<\!--/,/-->/),A=function(E,T){u.call(this,E,T),this._current_tag_name="";var k=new o(this._input).read_options(this._options),L=new h(this._input);if(this.__patterns={word:k.until(/[\n\r\t <]/),single_quote:k.until_after(/'/),double_quote:k.until_after(/"/),attribute:k.until(/[\n\r\t =>]|\/>/),element_name:k.until(/[\n\r\t >\/]/),handlebars_comment:L.starting_with(/{{!--/).until_after(/--}}/),handlebars:L.starting_with(/{{/).until_after(/}}/),handlebars_open:L.until(/[\n\r\t }]/),handlebars_raw_close:L.until(/}}/),comment:L.starting_with(/<!--/).until_after(/-->/),cdata:L.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:L.starting_with(/<!\[/).until_after(/]>/),processing:L.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 S=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=L.matching(S).until_after(S)}};A.prototype=new u,A.prototype._is_comment=function(E){return!1},A.prototype._is_opening=function(E){return E.type===s.TAG_OPEN},A.prototype._is_closing=function(E,T){return E.type===s.TAG_CLOSE&&T&&((E.text===">"||E.text==="/>")&&T.text[0]==="<"||E.text==="}}"&&T.text[0]==="{"&&T.text[1]==="{")},A.prototype._reset=function(){this._current_tag_name=""},A.prototype._get_next_token=function(E,T){var k=null;this._readWhitespace();var L=this._input.peek();return L===null?this._create_token(s.EOF,""):(k=k||this._read_open_handlebars(L,T),k=k||this._read_attribute(L,E,T),k=k||this._read_close(L,T),k=k||this._read_raw_content(L,E,T),k=k||this._read_content_word(L),k=k||this._read_comment_or_cdata(L),k=k||this._read_processing(L),k=k||this._read_open(L,T),k=k||this._create_token(s.UNKNOWN,this._input.next()),k)},A.prototype._read_comment_or_cdata=function(E){var T=null,k=null,L=null;if(E==="<"){var S=this._input.peek(1);S==="!"&&(k=this.__patterns.comment.read(),k?(L=a.get_directives(k),L&&L.ignore==="start"&&(k+=a.readIgnored(this._input))):k=this.__patterns.cdata.read()),k&&(T=this._create_token(s.COMMENT,k),T.directives=L)}return T},A.prototype._read_processing=function(E){var T=null,k=null,L=null;if(E==="<"){var S=this._input.peek(1);(S==="!"||S==="?")&&(k=this.__patterns.conditional_comment.read(),k=k||this.__patterns.processing.read()),k&&(T=this._create_token(s.COMMENT,k),T.directives=L)}return T},A.prototype._read_open=function(E,T){var k=null,L=null;return T||E==="<"&&(k=this._input.next(),this._input.peek()==="/"&&(k+=this._input.next()),k+=this.__patterns.element_name.read(),L=this._create_token(s.TAG_OPEN,k)),L},A.prototype._read_open_handlebars=function(E,T){var k=null,L=null;return T||this._options.indent_handlebars&&E==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(k=this.__patterns.handlebars_comment.read(),k=k||this.__patterns.handlebars.read(),L=this._create_token(s.COMMENT,k)):(k=this.__patterns.handlebars_open.read(),L=this._create_token(s.TAG_OPEN,k))),L},A.prototype._read_close=function(E,T){var k=null,L=null;return T&&(T.text[0]==="<"&&(E===">"||E==="/"&&this._input.peek(1)===">")?(k=this._input.next(),E==="/"&&(k+=this._input.next()),L=this._create_token(s.TAG_CLOSE,k)):T.text[0]==="{"&&E==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),L=this._create_token(s.TAG_CLOSE,"}}"))),L},A.prototype._read_attribute=function(E,T,k){var L=null,S="";if(k&&k.text[0]==="<")if(E==="=")L=this._create_token(s.EQUALS,this._input.next());else if(E==='"'||E==="'"){var R=this._input.next();E==='"'?R+=this.__patterns.double_quote.read():R+=this.__patterns.single_quote.read(),L=this._create_token(s.VALUE,R)}else S=this.__patterns.attribute.read(),S&&(T.type===s.EQUALS?L=this._create_token(s.VALUE,S):L=this._create_token(s.ATTRIBUTE,S));return L},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,T,k){var L="";if(k&&k.text[0]==="{")L=this.__patterns.handlebars_raw_close.read();else if(T.type===s.TAG_CLOSE&&T.opened.text[0]==="<"&&T.text[0]!=="/"){var S=T.opened.text.substr(1).toLowerCase();if(S==="script"||S==="style"){var R=this._read_comment_or_cdata(E);if(R)return R.type=s.TEXT,R;L=this._input.readUntil(new RegExp("</"+S+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(S)&&(L=this._input.readUntil(new RegExp("</"+S+"[\\n\\r\\t ]*?>","ig")))}return L?this._create_token(s.TEXT,L):null},A.prototype._read_content_word=function(E){var T="";if(this._options.unformatted_content_delimiter&&(E===this._options.unformatted_content_delimiter[0]&&(T=this.__patterns.unformatted_content_delimiter.read())),T||(T=this.__patterns.word.read()),T)return this._create_token(s.TEXT,T)},v.exports.Tokenizer=A,v.exports.TOKEN=s}],G={};function n(v){var p=G[v];if(p!==void 0)return p.exports;var m=G[v]={exports:{}};return K[v](m,m.exports,n),m.exports}var O=n(18);N=O})();var $=N;if(!0)!(le=[q,q("6UM0"),q("TXwP")],Y=function(K){var G=q("6UM0"),n=q("TXwP");return{html_beautify:function(O,v){return $(O,v,G.js_beautify,n.css_beautify)}}}.apply(Se,le),Y!==void 0&&(Ze.exports=Y));else var H,M})()},"rAM+":function(Ze,Se,q){"use strict";q.d(Se,"a",function(){return Y});var le=q("Qw5x");function Y(N,$){var H;if(typeof Symbol=="undefined"||N[Symbol.iterator]==null){if(Array.isArray(N)||(H=Object(le.a)(N))||$&&N&&typeof N.length=="number"){H&&(N=H);var M=0,K=function(){};return{s:K,n:function(){return M>=N.length?{done:!0}:{done:!1,value:N[M++]}},e:function(p){throw p},f:K}}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 G=!0,n=!1,O;return{s:function(){H=N[Symbol.iterator]()},n:function(){var p=H.next();return G=p.done,p},e:function(p){n=!0,O=p},f:function(){try{!G&&H.return!=null&&H.return()}finally{if(n)throw O}}}}},rUJ1:function(Ze,Se){const q=/[&<>"']/,le=/[&<>"']/g,Y=/[<>"']|&(?!#?\w+;)/,N=/[<>"']|&(?!#?\w+;)/g,$={"&":"&","<":"<",">":">",'"':""","'":"'"},H=L=>$[L];function M(L,S){if(S){if(q.test(L))return L.replace(le,H)}else if(Y.test(L))return L.replace(N,H);return L}const K=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function G(L){return L.replace(K,(S,R)=>(R=R.toLowerCase(),R==="colon"?":":R.charAt(0)==="#"?R.charAt(1)==="x"?String.fromCharCode(parseInt(R.substring(2),16)):String.fromCharCode(+R.substring(1)):""))}const n=/(^|[^\[])\^/g;function O(L,S){L=L.source||L,S=S||"";const R={replace:(C,f)=>(f=f.source||f,f=f.replace(n,"$1"),L=L.replace(C,f),R),getRegex:()=>new RegExp(L,S)};return R}const v=/[^\w:]/g,p=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function m(L,S,R){if(L){let C;try{C=decodeURIComponent(G(R)).replace(v,"").toLowerCase()}catch(f){return null}if(C.indexOf("javascript:")===0||C.indexOf("vbscript:")===0||C.indexOf("data:")===0)return null}S&&!p.test(R)&&(R=h(S,R));try{R=encodeURI(R).replace(/%25/g,"%")}catch(C){return null}return R}const u={},l=/^[^:]+:\/*[^/]*$/,d=/^([^:]+:)[\s\S]*$/,o=/^([^:]+:\/*[^/]*)[\s\S]*$/;function h(L,S){u[" "+L]||(l.test(L)?u[" "+L]=L+"/":u[" "+L]=E(L,"/",!0)),L=u[" "+L];const R=L.indexOf(":")===-1;return S.substring(0,2)==="//"?R?S:L.replace(d,"$1")+S:S.charAt(0)==="/"?R?S:L.replace(o,"$1")+S:L+S}const s={exec:function(){}};function a(L){let S=1,R,C;for(;S<arguments.length;S++){R=arguments[S];for(C in R)Object.prototype.hasOwnProperty.call(R,C)&&(L[C]=R[C])}return L}function A(L,S){const R=L.replace(/\|/g,(w,y,_)=>{let j=!1,U=y;for(;--U>=0&&_[U]==="\\";)j=!j;return j?"|":" |"}),C=R.split(/ \|/);let f=0;if(C.length>S)C.splice(S);else for(;C.length<S;)C.push("");for(;f<C.length;f++)C[f]=C[f].trim().replace(/\\\|/g,"|");return C}function E(L,S,R){const C=L.length;if(C===0)return"";let f=0;for(;f<C;){const w=L.charAt(C-f-1);if(w===S&&!R)f++;else if(w!==S&&R)f++;else break}return L.substr(0,C-f)}function T(L,S){if(L.indexOf(S[1])===-1)return-1;const R=L.length;let C=0,f=0;for(;f<R;f++)if(L[f]==="\\")f++;else if(L[f]===S[0])C++;else if(L[f]===S[1]&&(C--,C<0))return f;return-1}function k(L){L&&L.sanitize&&!L.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")}Ze.exports={escape:M,unescape:G,edit:O,cleanUrl:m,resolveUrl:h,noopTest:s,merge:a,splitCells:A,rtrim:E,findClosingBracket:T,checkSanitizeDeprecation:k}},t9D7:function(Ze,Se,q){"use strict";q.d(Se,"b",function(){return K}),q.d(Se,"g",function(){return n}),q.d(Se,"d",function(){return O}),q.d(Se,"e",function(){return v}),q.d(Se,"a",function(){return p}),q.d(Se,"f",function(){return l}),q.d(Se,"c",function(){return d});var le=q("Vhoy"),Y=q("MI8n"),N=q("pmY6"),$=q("Cg/j"),H=q("ic2d"),M=q("nEHx");const K=Object($.c)("themeService");var G;(function(o){function h(s){return s&&typeof s=="object"&&typeof s.id=="string"}o.isThemeColor=h})(G||(G={}));function n(o){return{id:o}}var O;(function(o){function h(k){return k&&typeof k=="object"&&typeof k.id=="string"&&(typeof k.color=="undefined"||G.isThemeColor(k.color))}o.isThemeIcon=h;const s=new RegExp(`^\\$\\((${le.a.iconNameExpression}(?:${le.a.iconModifierExpression})?)\\)$`);function a(k){const L=s.exec(k);if(!L)return;let[,S]=L;return{id:S}}o.fromString=a;function A(k,L){let S=k.id;const R=S.lastIndexOf("~");return R!==-1&&(S=S.substring(0,R)),L&&(S=`${S}~${L}`),{id:S}}o.modify=A;function E(k,L){var S,R;return k.id===L.id&&((S=k.color)===null||S===void 0?void 0:S.id)===((R=L.color)===null||R===void 0?void 0:R.id)}o.isEqual=E;function T(k,L){return{id:k.id,color:L?n(L):void 0}}o.asThemeIcon=T,o.asClassNameArray=le.a.asClassNameArray,o.asClassName=le.a.asClassName,o.asCSSSelector=le.a.asCSSSelector})(O||(O={}));function v(o){switch(o){case M.a.DARK:return"vs-dark";case M.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 Y.b}onColorThemeChange(o){return this.themingParticipants.push(o),this.onThemingParticipantAddedEmitter.fire(o),Object(N.i)(()=>{const h=this.themingParticipants.indexOf(o);this.themingParticipants.splice(h,1)})}getThemingParticipants(){return this.themingParticipants}}let u=new m;H.a.add(p.ThemingContribution,u);function l(o){return u.onColorThemeChange(o)}class d extends N.a{constructor(o){super();this.themeService=o,this.theme=o.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(h=>this.onThemeChange(h)))}onThemeChange(o){this.theme=o,this.updateStyles()}updateStyles(){}}},ulZh:function(Ze,Se,q){typeof window!="undefined"&&function(Y,N){Ze.exports=N()}(this,function(){return function(le){var Y={};function N($){if(Y[$])return Y[$].exports;var H=Y[$]={i:$,l:!1,exports:{}};return le[$].call(H.exports,H,H.exports,N),H.l=!0,H.exports}return N.m=le,N.c=Y,N.d=function($,H,M){N.o($,H)||Object.defineProperty($,H,{enumerable:!0,get:M})},N.r=function($){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty($,Symbol.toStringTag,{value:"Module"}),Object.defineProperty($,"__esModule",{value:!0})},N.t=function($,H){if(H&1&&($=N($)),H&8)return $;if(H&4&&typeof $=="object"&&$&&$.__esModule)return $;var M=Object.create(null);if(N.r(M),Object.defineProperty(M,"default",{enumerable:!0,value:$}),H&2&&typeof $!="string")for(var K in $)N.d(M,K,function(G){return $[G]}.bind(null,K));return M},N.n=function($){var H=$&&$.__esModule?function(){return $.default}:function(){return $};return N.d(H,"a",H),H},N.o=function($,H){return Object.prototype.hasOwnProperty.call($,H)},N.p="/dist/",N(N.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(le,Y,N){"use strict";var $=Object.prototype.hasOwnProperty,H="~";function M(){}Object.create&&(M.prototype=Object.create(null),new M().__proto__||(H=!1));function K(v,p,m){this.fn=v,this.context=p,this.once=m||!1}function G(v,p,m,u,l){if(typeof m!="function")throw new TypeError("The listener must be a function");var d=new K(m,u||v,l),o=H?H+p:p;return v._events[o]?v._events[o].fn?v._events[o]=[v._events[o],d]:v._events[o].push(d):(v._events[o]=d,v._eventsCount++),v}function n(v,p){--v._eventsCount===0?v._events=new M:delete v._events[p]}function O(){this._events=new M,this._eventsCount=0}O.prototype.eventNames=function(){var p=[],m,u;if(this._eventsCount===0)return p;for(u in m=this._events)$.call(m,u)&&p.push(H?u.slice(1):u);return Object.getOwnPropertySymbols?p.concat(Object.getOwnPropertySymbols(m)):p},O.prototype.listeners=function(p){var m=H?H+p:p,u=this._events[m];if(!u)return[];if(u.fn)return[u.fn];for(var l=0,d=u.length,o=new Array(d);l<d;l++)o[l]=u[l].fn;return o},O.prototype.listenerCount=function(p){var m=H?H+p:p,u=this._events[m];return u?u.fn?1:u.length:0},O.prototype.emit=function(p,m,u,l,d,o){var h=H?H+p:p;if(!this._events[h])return!1;var s=this._events[h],a=arguments.length,A,E;if(s.fn){s.once&&this.removeListener(p,s.fn,void 0,!0);switch(a){case 1:return s.fn.call(s.context),!0;case 2:return s.fn.call(s.context,m),!0;case 3:return s.fn.call(s.context,m,u),!0;case 4:return s.fn.call(s.context,m,u,l),!0;case 5:return s.fn.call(s.context,m,u,l,d),!0;case 6:return s.fn.call(s.context,m,u,l,d,o),!0}for(E=1,A=new Array(a-1);E<a;E++)A[E-1]=arguments[E];s.fn.apply(s.context,A)}else{var T=s.length,k;for(E=0;E<T;E++){s[E].once&&this.removeListener(p,s[E].fn,void 0,!0);switch(a){case 1:s[E].fn.call(s[E].context);break;case 2:s[E].fn.call(s[E].context,m);break;case 3:s[E].fn.call(s[E].context,m,u);break;case 4:s[E].fn.call(s[E].context,m,u,l);break;default:if(!A)for(k=1,A=new Array(a-1);k<a;k++)A[k-1]=arguments[k];s[E].fn.apply(s[E].context,A)}}}return!0},O.prototype.on=function(p,m,u){return G(this,p,m,u,!1)},O.prototype.once=function(p,m,u){return G(this,p,m,u,!0)},O.prototype.removeListener=function(p,m,u,l){var d=H?H+p:p;if(!this._events[d])return this;if(!m)return n(this,d),this;var o=this._events[d];if(o.fn)o.fn===m&&(!l||o.once)&&(!u||o.context===u)&&n(this,d);else{for(var h=0,s=[],a=o.length;h<a;h++)(o[h].fn!==m||l&&!o[h].once||u&&o[h].context!==u)&&s.push(o[h]);s.length?this._events[d]=s.length===1?s[0]:s:n(this,d)}return this},O.prototype.removeAllListeners=function(p){var m;return p?(m=H?H+p:p,this._events[m]&&n(this,m)):(this._events=new M,this._eventsCount=0),this},O.prototype.off=O.prototype.removeListener,O.prototype.addListener=O.prototype.on,O.prefixed=H,O.EventEmitter=O,le.exports=O},"./node_modules/url-toolkit/src/url-toolkit.js":function(le,Y,N){(function($){var H=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,M=/^([^\/?#]*)([^]*)$/,K=/(?:\/|^)\.(?=\/)/g,G=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,n={buildAbsoluteURL:function(O,v,p){if(p=p||{},O=O.trim(),v=v.trim(),!v){if(!p.alwaysNormalize)return O;var m=n.parseURL(O);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(v);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)):v;var l=n.parseURL(O);if(!l)throw new Error("Error trying to parse base URL.");if(!l.netLoc&&l.path&&l.path[0]!=="/"){var d=M.exec(l.path);l.netLoc=d[1],l.path=d[2]}l.netLoc&&!l.path&&(l.path="/");var o={scheme:l.scheme,netLoc:u.netLoc,path:null,params:u.params,query:u.query,fragment:u.fragment};if(!u.netLoc&&(o.netLoc=l.netLoc,u.path[0]!=="/"))if(!u.path)o.path=l.path,u.params||(o.params=l.params,u.query||(o.query=l.query));else{var h=l.path,s=h.substring(0,h.lastIndexOf("/")+1)+u.path;o.path=n.normalizePath(s)}return o.path===null&&(o.path=p.alwaysNormalize?n.normalizePath(u.path):u.path),n.buildURLFromParts(o)},parseURL:function(O){var v=H.exec(O);return v?{scheme:v[1]||"",netLoc:v[2]||"",path:v[3]||"",params:v[4]||"",query:v[5]||"",fragment:v[6]||""}:null},normalizePath:function(O){for(O=O.split("").reverse().join("").replace(K,"");O.length!==(O=O.replace(G,"")).length;);return O.split("").reverse().join("")},buildURLFromParts:function(O){return O.scheme+O.netLoc+O.path+O.params+O.query+O.fragment}};le.exports=n})(this)},"./node_modules/webworkify-webpack/index.js":function(le,Y,N){function $(p){var m={};function u(d){if(m[d])return m[d].exports;var o=m[d]={i:d,l:!1,exports:{}};return p[d].call(o.exports,o,o.exports,u),o.l=!0,o.exports}u.m=p,u.c=m,u.i=function(d){return d},u.d=function(d,o,h){u.o(d,o)||Object.defineProperty(d,o,{configurable:!1,enumerable:!0,get:h})},u.r=function(d){Object.defineProperty(d,"__esModule",{value:!0})},u.n=function(d){var o=d&&d.__esModule?function(){return d.default}:function(){return d};return u.d(o,"a",o),o},u.o=function(d,o){return Object.prototype.hasOwnProperty.call(d,o)},u.p="/",u.oe=function(d){throw console.error(d),d};var l=u(u.s=ENTRY_MODULE);return l.default||l}var H="[\\.|\\-|\\+|\\w|/|@]+",M="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+H+").*?\\)";function K(p){return(p+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function G(p){return!isNaN(1*p)}function n(p,m,u){var l={};l[u]=[];var d=m.toString(),o=d.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!o)return l;for(var h=o[1],s=new RegExp("(\\\\n|\\W)"+K(h)+M,"g"),a;a=s.exec(d);){if(a[3]==="dll-reference")continue;l[u].push(a[3])}for(s=new RegExp("\\("+K(h)+'\\("(dll-reference\\s('+H+'))"\\)\\)'+M,"g");a=s.exec(d);)p[a[2]]||(l[u].push(a[1]),p[a[2]]=N(a[1]).m),l[a[2]]=l[a[2]]||[],l[a[2]].push(a[4]);for(var A=Object.keys(l),E=0;E<A.length;E++)for(var T=0;T<l[A[E]].length;T++)G(l[A[E]][T])&&(l[A[E]][T]=1*l[A[E]][T]);return l}function O(p){var m=Object.keys(p);return m.reduce(function(u,l){return u||p[l].length>0},!1)}function v(p,m){for(var u={main:[m]},l={main:[]},d={main:{}};O(u);)for(var o=Object.keys(u),h=0;h<o.length;h++){var s=o[h],a=u[s],A=a.pop();if(d[s]=d[s]||{},d[s][A]||!p[s][A])continue;d[s][A]=!0,l[s]=l[s]||[],l[s].push(A);for(var E=n(p,p[s][A],s),T=Object.keys(E),k=0;k<T.length;k++)u[T[k]]=u[T[k]]||[],u[T[k]]=u[T[k]].concat(E[T[k]])}return l}le.exports=function(p,m){m=m||{};var u={main:N.m},l=m.all?{main:Object.keys(u.main)}:v(u,p),d="";Object.keys(l).filter(function(A){return A!=="main"}).forEach(function(A){for(var E=0;l[A][E];)E++;l[A].push(E),u[A][E]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",d=d+"var "+A+" = ("+$.toString().replace("ENTRY_MODULE",JSON.stringify(E))+")({"+l[A].map(function(T){return""+JSON.stringify(T)+": "+u[A][T].toString()}).join(",")+`});
|
|
`}),d=d+"new (("+$.toString().replace("ENTRY_MODULE",JSON.stringify(p))+")({"+l.main.map(function(A){return""+JSON.stringify(A)+": "+u.main[A].toString()}).join(",")+"}))(self);";var o=new window.Blob([d],{type:"text/javascript"});if(m.bare)return o;var h=window.URL||window.webkitURL||window.mozURL||window.msURL,s=h.createObjectURL(o),a=new window.Worker(s);return a.objectURL=s,a}},"./src/config.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"hlsDefaultConfig",function(){return k}),N.d(Y,"mergeConfig",function(){return S}),N.d(Y,"enableStreamingMode",function(){return R});var $=N("./src/controller/abr-controller.ts"),H=N("./src/controller/audio-stream-controller.ts"),M=N("./src/controller/audio-track-controller.ts"),K=N("./src/controller/subtitle-stream-controller.ts"),G=N("./src/controller/subtitle-track-controller.ts"),n=N("./src/controller/buffer-controller.ts"),O=N("./src/controller/timeline-controller.ts"),v=N("./src/controller/cap-level-controller.ts"),p=N("./src/controller/fps-controller.ts"),m=N("./src/controller/eme-controller.ts"),u=N("./src/controller/cmcd-controller.ts"),l=N("./src/utils/xhr-loader.ts"),d=N("./src/utils/fetch-loader.ts"),o=N("./src/utils/cues.ts"),h=N("./src/utils/mediakeys-helper.ts"),s=N("./src/utils/logger.ts");function a(){return a=Object.assign||function(C){for(var f=1;f<arguments.length;f++){var w=arguments[f];for(var y in w)Object.prototype.hasOwnProperty.call(w,y)&&(C[y]=w[y])}return C},a.apply(this,arguments)}function A(C,f){var w=Object.keys(C);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(C);f&&(y=y.filter(function(_){return Object.getOwnPropertyDescriptor(C,_).enumerable})),w.push.apply(w,y)}return w}function E(C){for(var f=1;f<arguments.length;f++){var w=arguments[f]!=null?arguments[f]:{};f%2?A(Object(w),!0).forEach(function(y){T(C,y,w[y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(C,Object.getOwnPropertyDescriptors(w)):A(Object(w)).forEach(function(y){Object.defineProperty(C,y,Object.getOwnPropertyDescriptor(w,y))})}return C}function T(C,f,w){return f in C?Object.defineProperty(C,f,{value:w,enumerable:!0,configurable:!0,writable:!0}):C[f]=w,C}var k=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:l.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:$.default,bufferController:n.default,capLevelController:v.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},L()),{},{subtitleStreamController:K.SubtitleStreamController,subtitleTrackController:G.default,timelineController:O.TimelineController,audioStreamController:H.default,audioTrackController:M.default,emeController:m.default,cmcdController:u.default});function L(){return{cueHandler:o.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 S(C,f){if((f.liveSyncDurationCount||f.liveMaxLatencyDurationCount)&&(f.liveSyncDuration||f.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(f.liveMaxLatencyDurationCount!==void 0&&(f.liveSyncDurationCount===void 0||f.liveMaxLatencyDurationCount<=f.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(f.liveMaxLatencyDuration!==void 0&&(f.liveSyncDuration===void 0||f.liveMaxLatencyDuration<=f.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return a({},C,f)}function R(C){var f=C.loader;if(f!==d.default&&f!==l.default)s.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),C.progressive=!1;else{var w=Object(d.fetchSupported)();w&&(C.loader=d.default,C.progressive=!0,C.enableSoftwareAES=!0,s.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(le,Y,N){"use strict";N.r(Y);var $=N("./src/polyfills/number.ts"),H=N("./src/utils/ewma-bandwidth-estimator.ts"),M=N("./src/events.ts"),K=N("./src/utils/buffer-helper.ts"),G=N("./src/errors.ts"),n=N("./src/types/loader.ts"),O=N("./src/utils/logger.ts");function v(u,l){for(var d=0;d<l.length;d++){var o=l[d];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(u,o.key,o)}}function p(u,l,d){return l&&v(u.prototype,l),d&&v(u,d),u}var m=function(){function u(d){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=d;var o=d.config;this.bwEstimator=new H.default(o.abrEwmaSlowVoD,o.abrEwmaFastVoD,o.abrEwmaDefaultEstimate),this.registerListeners()}var l=u.prototype;return l.registerListeners=function(){var o=this.hls;o.on(M.Events.FRAG_LOADING,this.onFragLoading,this),o.on(M.Events.FRAG_LOADED,this.onFragLoaded,this),o.on(M.Events.FRAG_BUFFERED,this.onFragBuffered,this),o.on(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),o.on(M.Events.ERROR,this.onError,this)},l.unregisterListeners=function(){var o=this.hls;o.off(M.Events.FRAG_LOADING,this.onFragLoading,this),o.off(M.Events.FRAG_LOADED,this.onFragLoaded,this),o.off(M.Events.FRAG_BUFFERED,this.onFragBuffered,this),o.off(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),o.off(M.Events.ERROR,this.onError,this)},l.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},l.onFragLoading=function(o,h){var s=h.frag;if(s.type===n.PlaylistLevelType.MAIN&&!this.timer){var a;this.fragCurrent=s,this.partCurrent=(a=h.part)!=null?a:null,this.timer=self.setInterval(this.onCheck,100)}},l.onLevelLoaded=function(o,h){var s=this.hls.config;h.details.live?this.bwEstimator.update(s.abrEwmaSlowLive,s.abrEwmaFastLive):this.bwEstimator.update(s.abrEwmaSlowVoD,s.abrEwmaFastVoD)},l._abandonRulesCheck=function(){var o=this.fragCurrent,h=this.partCurrent,s=this.hls,a=s.autoLevelEnabled,A=s.config,E=s.media;if(!o||!E)return;var T=h?h.stats:o.stats,k=h?h.duration:o.duration;if(T.aborted){O.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!a||E.paused||!E.playbackRate||!E.readyState)return;var L=performance.now()-T.loading.start,S=Math.abs(E.playbackRate);if(L<=500*k/S)return;var R=s.levels,C=s.minAutoLevel,f=R[o.level],w=T.total||Math.max(T.loaded,Math.round(k*f.maxBitrate/8)),y=Math.max(1,T.bwEstimate?T.bwEstimate/8:T.loaded*1e3/L),_=(w-T.loaded)/y,j=E.currentTime,U=(K.BufferHelper.bufferInfo(E,j,A.maxBufferHole).end-j)/S;if(U>=2*k/S||_<=U)return;var x=Number.POSITIVE_INFINITY,F;for(F=o.level-1;F>C;F--){var D=R[F].maxBitrate;if(x=k*D/(8*.8*y),x<U)break}if(x>=_)return;var g=this.bwEstimator.getEstimate();O.logger.warn("Fragment "+o.sn+(h?" part "+h.index:"")+" of level "+o.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+F+`
|
|
Current BW estimate: `+(Object($.isFiniteNumber)(g)?(g/1024).toFixed(3):"Unknown")+` Kb/s
|
|
Estimated load time for current fragment: `+_.toFixed(3)+` s
|
|
Estimated load time for the next fragment: `+x.toFixed(3)+` s
|
|
Time to underbuffer: `+U.toFixed(3)+" s"),s.nextLoadLevel=F,this.bwEstimator.sample(L,T.loaded),this.clearTimer(),o.loader&&(this.fragCurrent=this.partCurrent=null,o.loader.abort()),s.trigger(M.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:o,part:h,stats:T})},l.onFragLoaded=function(o,h){var s=h.frag,a=h.part;if(s.type===n.PlaylistLevelType.MAIN&&Object($.isFiniteNumber)(s.sn)){var A=a?a.stats:s.stats,E=a?a.duration:s.duration;if(this.clearTimer(),this.lastLoadedFragLevel=s.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var T=this.hls.levels[s.level],k=(T.loaded?T.loaded.bytes:0)+A.loaded,L=(T.loaded?T.loaded.duration:0)+E;T.loaded={bytes:k,duration:L},T.realBitrate=Math.round(8*k/L)}if(s.bitrateTest){var S={stats:A,frag:s,part:a,id:s.type};this.onFragBuffered(M.Events.FRAG_BUFFERED,S),s.bitrateTest=!1}}},l.onFragBuffered=function(o,h){var s=h.frag,a=h.part,A=a?a.stats:s.stats;if(A.aborted)return;if(s.type!==n.PlaylistLevelType.MAIN||s.sn==="initSegment")return;var E=A.parsing.end-A.loading.start;this.bwEstimator.sample(E,A.loaded),A.bwEstimate=this.bwEstimator.getEstimate(),s.bitrateTest?this.bitrateTestDelay=E/1e3:this.bitrateTestDelay=0},l.onError=function(o,h){switch(h.details){case G.ErrorDetails.FRAG_LOAD_ERROR:case G.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},l.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},l.getNextABRAutoLevel=function(){var o=this.fragCurrent,h=this.partCurrent,s=this.hls,a=s.maxAutoLevel,A=s.config,E=s.minAutoLevel,T=s.media,k=h?h.duration:o?o.duration:0,L=T?T.currentTime:0,S=T&&T.playbackRate!==0?Math.abs(T.playbackRate):1,R=this.bwEstimator?this.bwEstimator.getEstimate():A.abrEwmaDefaultEstimate,C=(K.BufferHelper.bufferInfo(T,L,A.maxBufferHole).end-L)/S,f=this.findBestLevel(R,E,a,C,A.abrBandWidthFactor,A.abrBandWidthUpFactor);if(f>=0)return f;O.logger.trace((C?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var w=k?Math.min(k,A.maxStarvationDelay):A.maxStarvationDelay,y=A.abrBandWidthFactor,_=A.abrBandWidthUpFactor;if(!C){var j=this.bitrateTestDelay;if(j){var U=k?Math.min(k,A.maxLoadingDelay):A.maxLoadingDelay;w=U-j,O.logger.trace("bitrate test took "+Math.round(1e3*j)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*w)+" ms"),y=_=1}}return f=this.findBestLevel(R,E,a,C+w,y,_),Math.max(f,0)},l.findBestLevel=function(o,h,s,a,A,E){for(var T,k=this.fragCurrent,L=this.partCurrent,S=this.lastLoadedFragLevel,R=this.hls.levels,C=R[S],f=!!(C!=null&&(T=C.details)!==null&&T!==void 0&&T.live),w=C==null?void 0:C.codecSet,y=L?L.duration:k?k.duration:0,_=s;_>=h;_--){var j=R[_];if(!j||w&&j.codecSet!==w)continue;var U=j.details,x=(L?U==null?void 0:U.partTarget:U==null?void 0:U.averagetargetduration)||y,F=void 0;_<=S?F=A*o:F=E*o;var D=R[_].maxBitrate,g=D*x/F;if(O.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+_+"/"+Math.round(F)+"/"+D+"/"+x+"/"+a+"/"+g),F>D&&(!g||f&&!this.bitrateTestDelay||g<a))return _}return-1},p(u,[{key:"nextAutoLevel",get:function(){var o=this._nextAutoLevel,h=this.bwEstimator;if(o!==-1&&(!h||!h.canEstimate()))return o;var s=this.getNextABRAutoLevel();return o!==-1&&(s=Math.min(o,s)),s},set:function(o){this._nextAutoLevel=o}}]),u}();Y.default=m},"./src/controller/audio-stream-controller.ts":function(le,Y,N){"use strict";N.r(Y);var $=N("./src/polyfills/number.ts"),H=N("./src/controller/base-stream-controller.ts"),M=N("./src/events.ts"),K=N("./src/utils/buffer-helper.ts"),G=N("./src/controller/fragment-tracker.ts"),n=N("./src/types/level.ts"),O=N("./src/types/loader.ts"),v=N("./src/loader/fragment.ts"),p=N("./src/demux/chunk-cache.ts"),m=N("./src/demux/transmuxer-interface.ts"),u=N("./src/types/transmuxer.ts"),l=N("./src/controller/fragment-finders.ts"),d=N("./src/utils/discontinuities.ts"),o=N("./src/errors.ts"),h=N("./src/utils/logger.ts");function s(){return s=Object.assign||function(k){for(var L=1;L<arguments.length;L++){var S=arguments[L];for(var R in S)Object.prototype.hasOwnProperty.call(S,R)&&(k[R]=S[R])}return k},s.apply(this,arguments)}function a(k,L){k.prototype=Object.create(L.prototype),k.prototype.constructor=k,A(k,L)}function A(k,L){return A=Object.setPrototypeOf||function(R,C){return R.__proto__=C,R},A(k,L)}var E=100,T=function(k){a(L,k);function L(R,C){var f;return f=k.call(this,R,C,"[audio-stream-controller]")||this,f.videoBuffer=null,f.videoTrackCC=-1,f.waitingVideoCC=-1,f.audioSwitch=!1,f.trackId=-1,f.waitingData=null,f.mainDetails=null,f.bufferFlushed=!1,f._registerListeners(),f}var S=L.prototype;return S.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},S._registerListeners=function(){var C=this.hls;C.on(M.Events.MEDIA_ATTACHED,this.onMediaAttached,this),C.on(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),C.on(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),C.on(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),C.on(M.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),C.on(M.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),C.on(M.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),C.on(M.Events.ERROR,this.onError,this),C.on(M.Events.BUFFER_RESET,this.onBufferReset,this),C.on(M.Events.BUFFER_CREATED,this.onBufferCreated,this),C.on(M.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),C.on(M.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),C.on(M.Events.FRAG_BUFFERED,this.onFragBuffered,this)},S._unregisterListeners=function(){var C=this.hls;C.off(M.Events.MEDIA_ATTACHED,this.onMediaAttached,this),C.off(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),C.off(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),C.off(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),C.off(M.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),C.off(M.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),C.off(M.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),C.off(M.Events.ERROR,this.onError,this),C.off(M.Events.BUFFER_RESET,this.onBufferReset,this),C.off(M.Events.BUFFER_CREATED,this.onBufferCreated,this),C.off(M.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),C.off(M.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),C.off(M.Events.FRAG_BUFFERED,this.onFragBuffered,this)},S.onInitPtsFound=function(C,f){var w=f.frag,y=f.id,_=f.initPTS;if(y==="main"){var j=w.cc;this.initPTS[w.cc]=_,this.log("InitPTS for cc: "+j+" found from main: "+_),this.videoTrackCC=j,this.state===H.State.WAITING_INIT_PTS&&this.tick()}},S.startLoad=function(C){if(!this.levels){this.startPosition=C,this.state=H.State.STOPPED;return}var f=this.lastCurrentTime;this.stopLoad(),this.setInterval(E),this.fragLoadError=0,f>0&&C===-1?(this.log("Override startPosition with lastCurrentTime @"+f.toFixed(3)),this.state=H.State.IDLE):(this.loadedmetadata=!1,this.state=H.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=C,this.tick()},S.doTick=function(){switch(this.state){case H.State.IDLE:this.doTickIdle();break;case H.State.WAITING_TRACK:{var C,f=this.levels,w=this.trackId,y=f==null||((C=f[w])===null||C===void 0)?void 0:C.details;if(y){if(this.waitForCdnTuneIn(y))break;this.state=H.State.WAITING_INIT_PTS}break}case H.State.FRAG_LOADING_WAITING_RETRY:{var _,j=performance.now(),U=this.retryDate;(!U||j>=U||(_=this.media)!==null&&_!==void 0&&_.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=H.State.IDLE);break}case H.State.WAITING_INIT_PTS:{var x=this.waitingData;if(x){var F=x.frag,D=x.part,g=x.cache,W=x.complete;if(this.initPTS[F.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=H.State.FRAG_LOADING;var J=g.flush(),oe={frag:F,part:D,payload:J,networkDetails:null};this._handleFragmentLoadProgress(oe),W&&k.prototype._handleFragmentLoadComplete.call(this,oe)}else if(this.videoTrackCC!==this.waitingVideoCC)h.logger.log("Waiting fragment cc ("+F.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var fe=this.getLoadPosition(),Re=K.BufferHelper.bufferInfo(this.mediaBuffer,fe,this.config.maxBufferHole),be=Object(l.fragmentWithinToleranceTest)(Re.end,this.config.maxFragLookUpTolerance,F);be<0&&(h.logger.log("Waiting fragment cc ("+F.cc+") @ "+F.start+" cancelled because another fragment at "+Re.end+" is needed"),this.clearWaitingFragment())}}else this.state=H.State.IDLE}}this.onTickEnd()},S.clearWaitingFragment=function(){var C=this.waitingData;C&&(this.fragmentTracker.removeFragment(C.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=H.State.IDLE)},S.onTickEnd=function(){var C=this.media;if(!C||!C.readyState)return;var f=this.mediaBuffer?this.mediaBuffer:C,w=f.buffered;!this.loadedmetadata&&w.length&&(this.loadedmetadata=!0),this.lastCurrentTime=C.currentTime},S.doTickIdle=function(){var C,f,w=this.hls,y=this.levels,_=this.media,j=this.trackId,U=w.config;if(!y||!y[j])return;if(!_&&(this.startFragRequested||!U.startFragPrefetch))return;var x=y[j],F=x.details;if(!F||F.live&&this.levelLastLoaded!==j||this.waitForCdnTuneIn(F)){this.state=H.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,v.ElementaryStreamTypes.AUDIO,O.PlaylistLevelType.AUDIO));var D=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,O.PlaylistLevelType.AUDIO);if(D===null)return;var g=D.len,W=this.getMaxBufferLength(),J=this.audioSwitch;if(g>=W&&!J)return;if(!J&&this._streamEnded(D,F)){w.trigger(M.Events.BUFFER_EOS,{type:"audio"}),this.state=H.State.ENDED;return}var oe=F.fragments,fe=oe[0].start,Re=D.end;if(J){var be=this.getLoadPosition();Re=be,F.PTSKnown&&be<fe&&((D.end>fe||D.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),_.currentTime=fe+.05))}var Le=this.getNextFragment(Re,F);if(!Le){this.bufferFlushed=!0;return}((C=Le.decryptdata)===null||C===void 0?void 0:C.keyFormat)==="identity"&&!((f=Le.decryptdata)!==null&&f!==void 0&&f.key)?this.loadKey(Le,F):this.loadFragment(Le,F,Re)},S.getMaxBufferLength=function(){var C=k.prototype.getMaxBufferLength.call(this),f=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,O.PlaylistLevelType.MAIN);return f===null?C:Math.max(C,f.len)},S.onMediaDetaching=function(){this.videoBuffer=null,k.prototype.onMediaDetaching.call(this)},S.onAudioTracksUpdated=function(C,f){var w=f.audioTracks;this.resetTransmuxer(),this.levels=w.map(function(y){return new n.Level(y)})},S.onAudioTrackSwitching=function(C,f){var w=!!f.url;this.trackId=f.id;var y=this.fragCurrent;y!=null&&y.loader&&y.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),w?this.setInterval(E):this.resetTransmuxer(),w?(this.audioSwitch=!0,this.state=H.State.IDLE):this.state=H.State.STOPPED,this.tick()},S.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},S.onLevelLoaded=function(C,f){this.mainDetails=f.details},S.onAudioTrackLoaded=function(C,f){var w,y=this.levels,_=f.details,j=f.id;if(!y){this.warn("Audio tracks were reset while loading level "+j);return}this.log("Track "+j+" loaded ["+_.startSN+","+_.endSN+"],duration:"+_.totalduration);var U=y[j],x=0;if(_.live||(w=U.details)!==null&&w!==void 0&&w.live){var F=this.mainDetails;if(_.fragments[0]||(_.deltaUpdateFailed=!0),_.deltaUpdateFailed||!F)return;!U.details&&_.hasProgramDateTime&&F.hasProgramDateTime?(Object(d.alignMediaPlaylistByPDT)(_,F),x=_.fragments[0].start):x=this.alignPlaylists(_,U.details)}U.details=_,this.levelLastLoaded=j,!this.startFragRequested&&(this.mainDetails||!_.live)&&this.setStartPosition(U.details,x),this.state===H.State.WAITING_TRACK&&!this.waitForCdnTuneIn(_)&&(this.state=H.State.IDLE),this.tick()},S._handleFragmentLoadProgress=function(C){var f,w=C.frag,y=C.part,_=C.payload,j=this.config,U=this.trackId,x=this.levels;if(!x){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 F=x[U];console.assert(F,"Audio track is defined on fragment load progress");var D=F.details;console.assert(D,"Audio track details are defined on fragment load progress");var g=j.defaultAudioCodec||F.audioCodec||"mp4a.40.2",W=this.transmuxer;W||(W=this.transmuxer=new m.default(this.hls,O.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var J=this.initPTS[w.cc],oe=(f=w.initSegment)===null||f===void 0?void 0:f.data;if(J!==void 0){var fe=!1,Re=y?y.index:-1,be=Re!==-1,Le=new u.ChunkMetadata(w.level,w.sn,w.stats.chunkCount,_.byteLength,Re,be);W.push(_,oe,g,"",w,y,D.totalduration,fe,Le,J)}else{h.logger.log("Unknown video PTS for cc "+w.cc+", waiting for video PTS before demuxing audio frag "+w.sn+" of ["+D.startSN+" ,"+D.endSN+"],track "+U);var Ce=this.waitingData=this.waitingData||{frag:w,part:y,cache:new p.default,complete:!1},Te=Ce.cache;Te.push(new Uint8Array(_)),this.waitingVideoCC=this.videoTrackCC,this.state=H.State.WAITING_INIT_PTS}},S._handleFragmentLoadComplete=function(C){if(this.waitingData){this.waitingData.complete=!0;return}k.prototype._handleFragmentLoadComplete.call(this,C)},S.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},S.onBufferCreated=function(C,f){var w=f.tracks.audio;w&&(this.mediaBuffer=w.buffer),f.tracks.video&&(this.videoBuffer=f.tracks.video.buffer)},S.onFragBuffered=function(C,f){var w=f.frag,y=f.part;if(w.type!==O.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(w)){this.warn("Fragment "+w.sn+(y?" p: "+y.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(M.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(w,y)},S.onError=function(C,f){switch(f.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(O.PlaylistLevelType.AUDIO,f);break;case o.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case o.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==H.State.ERROR&&this.state!==H.State.STOPPED&&(this.state=f.fatal?H.State.ERROR:H.State.IDLE,this.warn(f.details+" while loading frag, switching to "+this.state+" state"));break;case o.ErrorDetails.BUFFER_FULL_ERROR:if(f.parent==="audio"&&(this.state===H.State.PARSING||this.state===H.State.PARSED)){var w=!0,y=this.getFwdBufferInfo(this.mediaBuffer,O.PlaylistLevelType.AUDIO);y&&y.len>.5&&(w=!this.reduceMaxBufferLength(y.len)),w&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,k.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},S.onBufferFlushed=function(C,f){var w=f.type;w===v.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},S._handleTransmuxComplete=function(C){var f,w="audio",y=this.hls,_=C.remuxResult,j=C.chunkMeta,U=this.getCurrentContext(j);if(!U){this.warn("The loading context changed while buffering fragment "+j.sn+" of level "+j.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(j.level);return}var x=U.frag,F=U.part,D=_.audio,g=_.text,W=_.id3,J=_.initSegment;if(this.fragContextChanged(x))return;if(this.state=H.State.PARSING,this.audioSwitch&&D&&this.completeAudioSwitch(),J!=null&&J.tracks&&(this._bufferInitSegment(J.tracks,x,j),y.trigger(M.Events.FRAG_PARSING_INIT_SEGMENT,{frag:x,id:w,tracks:J.tracks})),D){var oe=D.startPTS,fe=D.endPTS,Re=D.startDTS,be=D.endDTS;F&&(F.elementaryStreams[v.ElementaryStreamTypes.AUDIO]={startPTS:oe,endPTS:fe,startDTS:Re,endDTS:be}),x.setElementaryStreamInfo(v.ElementaryStreamTypes.AUDIO,oe,fe,Re,be),this.bufferFragmentData(D,x,F,j)}if(W!=null&&(f=W.samples)!==null&&f!==void 0&&f.length){var Le=s({frag:x,id:w},W);y.trigger(M.Events.FRAG_PARSING_METADATA,Le)}if(g){var Ce=s({frag:x,id:w},g);y.trigger(M.Events.FRAG_PARSING_USERDATA,Ce)}},S._bufferInitSegment=function(C,f,w){if(this.state!==H.State.PARSING)return;C.video&&delete C.video;var y=C.audio;if(!y)return;y.levelCodec=y.codec,y.id="audio",this.log("Init audio buffer, container:"+y.container+", codecs[parsed]=["+y.codec+"]"),this.hls.trigger(M.Events.BUFFER_CODECS,C);var _=y.initSegment;if(_!=null&&_.byteLength){var j={type:"audio",frag:f,part:null,chunkMeta:w,parent:f.type,data:_};this.hls.trigger(M.Events.BUFFER_APPENDING,j)}this.tick()},S.loadFragment=function(C,f,w){var y=this.fragmentTracker.getState(C);this.fragCurrent=C,(this.audioSwitch||y===G.FragmentState.NOT_LOADED||y===G.FragmentState.PARTIAL)&&(C.sn==="initSegment"?this._loadInitSegment(C):f.live&&!Object($.isFiniteNumber)(this.initPTS[C.cc])?(this.log("Waiting for video PTS in continuity counter "+C.cc+" of live stream before loading audio fragment "+C.sn+" of level "+this.trackId),this.state=H.State.WAITING_INIT_PTS):(this.startFragRequested=!0,k.prototype.loadFragment.call(this,C,f,w)))},S.completeAudioSwitch=function(){var C=this.hls,f=this.media,w=this.trackId;f&&(this.log("Switching audio track : flushing all audio"),k.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,C.trigger(M.Events.AUDIO_TRACK_SWITCHED,{id:w})},L}(H.default);Y.default=T},"./src/controller/audio-track-controller.ts":function(le,Y,N){"use strict";N.r(Y);var $=N("./src/events.ts"),H=N("./src/errors.ts"),M=N("./src/controller/base-playlist-controller.ts"),K=N("./src/types/loader.ts");function G(m,u){for(var l=0;l<u.length;l++){var d=u[l];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(m,d.key,d)}}function n(m,u,l){return u&&G(m.prototype,u),l&&G(m,l),m}function O(m,u){m.prototype=Object.create(u.prototype),m.prototype.constructor=m,v(m,u)}function v(m,u){return v=Object.setPrototypeOf||function(d,o){return d.__proto__=o,d},v(m,u)}var p=function(m){O(u,m);function u(d){var o;return o=m.call(this,d,"[audio-track-controller]")||this,o.tracks=[],o.groupId=null,o.tracksInGroup=[],o.trackId=-1,o.trackName="",o.selectDefaultTrack=!0,o.registerListeners(),o}var l=u.prototype;return l.registerListeners=function(){var o=this.hls;o.on($.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.on($.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.on($.Events.LEVEL_LOADING,this.onLevelLoading,this),o.on($.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),o.on($.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),o.on($.Events.ERROR,this.onError,this)},l.unregisterListeners=function(){var o=this.hls;o.off($.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.off($.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.off($.Events.LEVEL_LOADING,this.onLevelLoading,this),o.off($.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),o.off($.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),o.off($.Events.ERROR,this.onError,this)},l.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,m.prototype.destroy.call(this)},l.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},l.onManifestParsed=function(o,h){this.tracks=h.audioTracks||[]},l.onAudioTrackLoaded=function(o,h){var s=h.id,a=h.details,A=this.tracksInGroup[s];if(!A){this.warn("Invalid audio track id "+s);return}var E=A.details;A.details=h.details,this.log("audioTrack "+s+" loaded ["+a.startSN+"-"+a.endSN+"]"),s===this.trackId&&(this.retryCount=0,this.playlistLoaded(s,h,E))},l.onLevelLoading=function(o,h){this.switchLevel(h.level)},l.onLevelSwitching=function(o,h){this.switchLevel(h.level)},l.switchLevel=function(o){var h=this.hls.levels[o];if(!(h!=null&&h.audioGroupIds))return;var s=h.audioGroupIds[h.urlId];if(this.groupId!==s){this.groupId=s;var a=this.tracks.filter(function(E){return!s||E.groupId===s});this.selectDefaultTrack&&!a.some(function(E){return E.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=a;var A={audioTracks:a};this.log("Updating audio tracks, "+a.length+' track(s) found in "'+s+'" group-id'),this.hls.trigger($.Events.AUDIO_TRACKS_UPDATED,A),this.selectInitialTrack()}},l.onError=function(o,h){if(m.prototype.onError.call(this,o,h),h.fatal||!h.context)return;h.context.type===K.PlaylistContextType.AUDIO_TRACK&&h.context.id===this.trackId&&h.context.groupId===this.groupId&&this.retryLoadingOrFail(h)},l.setAudioTrack=function(o){var h=this.tracksInGroup;if(o<0||o>=h.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var s=h[this.trackId];this.log("Now switching to audio-track index "+o);var a=h[o],A=a.id,E=a.groupId,T=E===void 0?"":E,k=a.name,L=a.type,S=a.url;if(this.trackId=o,this.trackName=k,this.selectDefaultTrack=!1,this.hls.trigger($.Events.AUDIO_TRACK_SWITCHING,{id:A,groupId:T,name:k,type:L,url:S}),a.details&&!a.details.live)return;var R=this.switchParams(a.url,s==null?void 0:s.details);this.loadPlaylist(R)},l.selectInitialTrack=function(){var o=this.tracksInGroup;console.assert(o.length,"Initial audio track should be selected when tracks are known");var h=this.trackName,s=this.findTrackId(h)||this.findTrackId();s!==-1?this.setAudioTrack(s):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger($.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},l.findTrackId=function(o){for(var h=this.tracksInGroup,s=0;s<h.length;s++){var a=h[s];if((!this.selectDefaultTrack||a.default)&&(!o||o===a.name))return a.id}return-1},l.loadPlaylist=function(o){var h=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(h)){var s=h.id,a=h.groupId,A=h.url;if(o)try{A=o.addDirectives(A)}catch(E){this.warn("Could not construct new URL with HLS Delivery Directives: "+E)}this.log("loading audio-track playlist for id: "+s),this.clearTimer(),this.hls.trigger($.Events.AUDIO_TRACK_LOADING,{url:A,id:s,groupId:a,deliveryDirectives:o||null})}},n(u,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(o){this.selectDefaultTrack=!1,this.setAudioTrack(o)}}]),u}(M.default);Y.default=p},"./src/controller/base-playlist-controller.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return n});var $=N("./src/polyfills/number.ts"),H=N("./src/types/level.ts"),M=N("./src/controller/level-helper.ts"),K=N("./src/utils/logger.ts"),G=N("./src/errors.ts"),n=function(){function O(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=K.logger.log.bind(K.logger,m+":"),this.warn=K.logger.warn.bind(K.logger,m+":"),this.hls=p}var v=O.prototype;return v.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},v.onError=function(m,u){u.fatal&&u.type===G.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},v.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},v.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},v.stopLoad=function(){this.canLoad=!1,this.clearTimer()},v.switchParams=function(m,u){var l=u==null?void 0:u.renditionReports;if(l)for(var d=0;d<l.length;d++){var o=l[d],h=""+o.URI;if(h===m.substr(-h.length)){var s=parseInt(o["LAST-MSN"]),a=parseInt(o["LAST-PART"]);if(u&&this.hls.config.lowLatencyMode){var A=Math.min(u.age-u.partTarget,u.targetduration);a!==void 0&&A>u.partTarget&&(a+=1)}if(Object($.isFiniteNumber)(s))return new H.HlsUrlParameters(s,Object($.isFiniteNumber)(a)?a:void 0,H.HlsSkip.No)}}},v.loadPlaylist=function(m){},v.shouldLoadTrack=function(m){return this.canLoad&&m&&!!m.url&&(!m.details||m.details.live)},v.playlistLoaded=function(m,u,l){var d=this,o=u.details,h=u.stats,s=h.loading.end?Math.max(0,self.performance.now()-h.loading.end):0;if(o.advancedDateTime=Date.now()-s,o.live||l!=null&&l.live){if(o.reloaded(l),l&&this.log("live playlist "+m+" "+(o.advanced?"REFRESHED "+o.lastPartSn+"-"+o.lastPartIndex:"MISSED")),l&&o.fragments.length>0&&Object(M.mergeDetails)(l,o),!this.canLoad||!o.live)return;var a,A=void 0,E=void 0;if(o.canBlockReload&&o.endSN&&o.advanced){var T=this.hls.config.lowLatencyMode,k=o.lastPartSn,L=o.endSN,S=o.lastPartIndex,R=S!==-1,C=k===L,f=T?0:S;R?(A=C?L+1:k,E=C?f:S+1):A=L+1;var w=o.age,y=w+o.ageHeader,_=Math.min(y-o.partTarget,o.targetduration*1.5);if(_>0){if(l&&_>l.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+l.tuneInGoal+" to: "+_+" with playlist age: "+o.age),_=0;else{var j=Math.floor(_/o.targetduration);if(A+=j,E!==void 0){var U=Math.round(_%o.targetduration/o.partTarget);E+=U}this.log("CDN Tune-in age: "+o.ageHeader+"s last advanced "+w.toFixed(2)+"s goal: "+_+" skip sn "+j+" to part "+E)}o.tuneInGoal=_}if(a=this.getDeliveryDirectives(o,u.deliveryDirectives,A,E),T||!C){this.loadPlaylist(a);return}}else a=this.getDeliveryDirectives(o,u.deliveryDirectives,A,E);var x=Object(M.computeReloadInterval)(o,h);A!==void 0&&o.canBlockReload&&(x-=o.partTarget||1),this.log("reload live playlist "+m+" in "+Math.round(x)+" ms"),this.timer=self.setTimeout(function(){return d.loadPlaylist(a)},x)}else this.clearTimer()},v.getDeliveryDirectives=function(m,u,l,d){var o=Object(H.getSkipValue)(m,l);return u!=null&&u.skip&&m.deltaUpdateFailed&&(l=u.msn,d=u.part,o=H.HlsSkip.No),new H.HlsUrlParameters(l,d,o)},v.retryLoadingOrFail=function(m){var u=this,l=this.hls.config,d=this.retryCount<l.levelLoadingMaxRetry;if(d){var o;if(this.retryCount++,m.details.indexOf("LoadTimeOut")>-1&&(o=m.context)!==null&&o!==void 0&&o.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+m.details+'"'),this.loadPlaylist();else{var h=Math.min(Math.pow(2,this.retryCount)*l.levelLoadingRetryDelay,l.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 d},O}()},"./src/controller/base-stream-controller.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"State",function(){return L}),N.d(Y,"default",function(){return S});var $=N("./src/polyfills/number.ts"),H=N("./src/task-loop.ts"),M=N("./src/controller/fragment-tracker.ts"),K=N("./src/utils/buffer-helper.ts"),G=N("./src/utils/logger.ts"),n=N("./src/events.ts"),O=N("./src/errors.ts"),v=N("./src/types/transmuxer.ts"),p=N("./src/utils/mp4-tools.ts"),m=N("./src/utils/discontinuities.ts"),u=N("./src/controller/fragment-finders.ts"),l=N("./src/controller/level-helper.ts"),d=N("./src/loader/fragment-loader.ts"),o=N("./src/crypt/decrypter.ts"),h=N("./src/utils/time-ranges.ts"),s=N("./src/types/loader.ts");function a(R,C){for(var f=0;f<C.length;f++){var w=C[f];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(R,w.key,w)}}function A(R,C,f){return C&&a(R.prototype,C),f&&a(R,f),R}function E(R){if(R===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return R}function T(R,C){R.prototype=Object.create(C.prototype),R.prototype.constructor=R,k(R,C)}function k(R,C){return k=Object.setPrototypeOf||function(w,y){return w.__proto__=y,w},k(R,C)}var L={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"},S=function(R){T(C,R);function C(w,y,_){var j;return j=R.call(this)||this,j.hls=void 0,j.fragPrevious=null,j.fragCurrent=null,j.fragmentTracker=void 0,j.transmuxer=null,j._state=L.STOPPED,j.media=void 0,j.mediaBuffer=void 0,j.config=void 0,j.bitrateTest=!1,j.lastCurrentTime=0,j.nextLoadPosition=0,j.startPosition=0,j.loadedmetadata=!1,j.fragLoadError=0,j.retryDate=0,j.levels=null,j.fragmentLoader=void 0,j.levelLastLoaded=null,j.startFragRequested=!1,j.decrypter=void 0,j.initPTS=[],j.onvseeking=null,j.onvended=null,j.logPrefix="",j.log=void 0,j.warn=void 0,j.logPrefix=_,j.log=G.logger.log.bind(G.logger,_+":"),j.warn=G.logger.warn.bind(G.logger,_+":"),j.hls=w,j.fragmentLoader=new d.default(w.config),j.fragmentTracker=y,j.config=w.config,j.decrypter=new o.default(w,w.config),w.on(n.Events.KEY_LOADED,j.onKeyLoaded,E(j)),j}var f=C.prototype;return f.doTick=function(){this.onTickEnd()},f.onTickEnd=function(){},f.startLoad=function(y){},f.stopLoad=function(){this.fragmentLoader.abort();var y=this.fragCurrent;y&&this.fragmentTracker.removeFragment(y),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=L.STOPPED},f._streamEnded=function(y,_){var j=this.fragCurrent,U=this.fragmentTracker;if(!_.live&&j&&j.sn===_.endSN&&!y.nextStart){var x=U.getState(j);return x===M.FragmentState.PARTIAL||x===M.FragmentState.OK}return!1},f.onMediaAttached=function(y,_){var j=this.media=this.mediaBuffer=_.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),j.addEventListener("seeking",this.onvseeking),j.addEventListener("ended",this.onvended);var U=this.config;this.levels&&U.autoStartLoad&&this.state===L.STOPPED&&this.startLoad(U.startPosition)},f.onMediaDetaching=function(){var y=this.media;y!=null&&y.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),y&&(y.removeEventListener("seeking",this.onvseeking),y.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},f.onMediaSeeking=function(){var y=this.config,_=this.fragCurrent,j=this.media,U=this.mediaBuffer,x=this.state,F=j?j.currentTime:0,D=K.BufferHelper.bufferInfo(U||j,F,y.maxBufferHole);if(this.log("media seeking to "+(Object($.isFiniteNumber)(F)?F.toFixed(3):F)+", state: "+x),x===L.ENDED)this.resetLoadingState();else if(_&&!D.len){var g=y.maxFragLookUpTolerance,W=_.start-g,J=_.start+_.duration+g,oe=F>J;(F<W||oe)&&(oe&&_.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),_.loader.abort()),this.resetLoadingState())}j&&(this.lastCurrentTime=F),!this.loadedmetadata&&!D.len&&(this.nextLoadPosition=this.startPosition=F),this.tickImmediate()},f.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},f.onKeyLoaded=function(y,_){if(this.state!==L.KEY_LOADING||_.frag!==this.fragCurrent||!this.levels)return;this.state=L.IDLE;var j=this.levels[_.frag.level].details;j&&this.loadFragment(_.frag,j,_.frag.start)},f.onHandlerDestroying=function(){this.stopLoad(),R.prototype.onHandlerDestroying.call(this)},f.onHandlerDestroyed=function(){this.state=L.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,R.prototype.onHandlerDestroyed.call(this)},f.loadKey=function(y,_){this.log("Loading key for "+y.sn+" of ["+_.startSN+"-"+_.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+y.level),this.state=L.KEY_LOADING,this.fragCurrent=y,this.hls.trigger(n.Events.KEY_LOADING,{frag:y})},f.loadFragment=function(y,_,j){this._loadFragForPlayback(y,_,j)},f._loadFragForPlayback=function(y,_,j){var U=this,x=function(D){if(U.fragContextChanged(y)){U.warn("Fragment "+y.sn+(D.part?" p: "+D.part.index:"")+" of level "+y.level+" was dropped during download."),U.fragmentTracker.removeFragment(y);return}y.stats.chunkCount++,U._handleFragmentLoadProgress(D)};this._doFragLoad(y,_,j,x).then(function(F){if(!F)return;U.fragLoadError=0;var D=U.state;if(U.fragContextChanged(y)){(D===L.FRAG_LOADING||D===L.BACKTRACKING||!U.fragCurrent&&D===L.PARSING)&&(U.fragmentTracker.removeFragment(y),U.state=L.IDLE);return}if("payload"in F&&(U.log("Loaded fragment "+y.sn+" of level "+y.level),U.hls.trigger(n.Events.FRAG_LOADED,F),U.state===L.BACKTRACKING)){U.fragmentTracker.backtrack(y,F),U.resetFragmentLoading(y);return}U._handleFragmentLoadComplete(F)}).catch(function(F){U.warn(F),U.resetFragmentLoading(y)})},f.flushMainBuffer=function(y,_,j){if(j===void 0&&(j=null),!(y-_))return;var U={startOffset:y,endOffset:_,type:j};this.fragLoadError=0,this.hls.trigger(n.Events.BUFFER_FLUSHING,U)},f._loadInitSegment=function(y){var _=this;this._doFragLoad(y).then(function(j){if(!j||_.fragContextChanged(y)||!_.levels)throw new Error("init load aborted");return j}).then(function(j){var U=_.hls,x=j.payload,F=y.decryptdata;if(x&&x.byteLength>0&&F&&F.key&&F.iv&&F.method==="AES-128"){var D=self.performance.now();return _.decrypter.webCryptoDecrypt(new Uint8Array(x),F.key.buffer,F.iv.buffer).then(function(g){var W=self.performance.now();return U.trigger(n.Events.FRAG_DECRYPTED,{frag:y,payload:g,stats:{tstart:D,tdecrypt:W}}),j.payload=g,j})}return j}).then(function(j){var U=_.fragCurrent,x=_.hls,F=_.levels;if(!F)throw new Error("init load aborted, missing levels");var D=F[y.level].details;console.assert(D,"Level details are defined when init segment is loaded");var g=y.stats;_.state=L.IDLE,_.fragLoadError=0,y.data=new Uint8Array(j.payload),g.parsing.start=g.buffering.start=self.performance.now(),g.parsing.end=g.buffering.end=self.performance.now(),j.frag===U&&x.trigger(n.Events.FRAG_BUFFERED,{stats:g,frag:U,part:null,id:y.type}),_.tick()}).catch(function(j){_.warn(j),_.resetFragmentLoading(y)})},f.fragContextChanged=function(y){var _=this.fragCurrent;return!y||!_||y.level!==_.level||y.sn!==_.sn||y.urlId!==_.urlId},f.fragBufferedComplete=function(y,_){var j=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+y.type+" sn: "+y.sn+(_?" part: "+_.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+y.level+" "+h.default.toString(K.BufferHelper.getBuffered(j))),this.state=L.IDLE,this.tick()},f._handleFragmentLoadComplete=function(y){var _=this.transmuxer;if(!_)return;var j=y.frag,U=y.part,x=y.partsLoaded,F=!x||x.length===0||x.some(function(g){return!g}),D=new v.ChunkMetadata(j.level,j.sn,j.stats.chunkCount+1,0,U?U.index:-1,!F);_.flush(D)},f._handleFragmentLoadProgress=function(y){},f._doFragLoad=function(y,_,j,U){var x=this;if(j===void 0&&(j=null),!this.levels)throw new Error("frag load aborted, missing levels");if(j=Math.max(y.start,j||0),this.config.lowLatencyMode&&_){var F=_.partList;if(F&&U){j>y.end&&_.fragmentHint&&(y=_.fragmentHint);var D=this.getNextPart(F,y,j);if(D>-1){var g=F[D];return this.log("Loading part sn: "+y.sn+" p: "+g.index+" cc: "+y.cc+" of playlist ["+_.startSN+"-"+_.endSN+"] parts [0-"+D+"-"+(F.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+y.level+", target: "+parseFloat(j.toFixed(3))),this.nextLoadPosition=g.start+g.duration,this.state=L.FRAG_LOADING,this.hls.trigger(n.Events.FRAG_LOADING,{frag:y,part:F[D],targetBufferTime:j}),this.doFragPartsLoad(y,F,D,U).catch(function(W){return x.handleFragLoadError(W)})}else if(!y.url||this.loadedEndOfParts(F,j))return Promise.resolve(null)}}return this.log("Loading fragment "+y.sn+" cc: "+y.cc+" "+(_?"of ["+_.startSN+"-"+_.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+y.level+", target: "+parseFloat(j.toFixed(3))),Object($.isFiniteNumber)(y.sn)&&!this.bitrateTest&&(this.nextLoadPosition=y.start+y.duration),this.state=L.FRAG_LOADING,this.hls.trigger(n.Events.FRAG_LOADING,{frag:y,targetBufferTime:j}),this.fragmentLoader.load(y,U).catch(function(W){return x.handleFragLoadError(W)})},f.doFragPartsLoad=function(y,_,j,U){var x=this;return new Promise(function(F,D){var g=[],W=function J(oe){var fe=_[oe];x.fragmentLoader.loadPart(y,fe,U).then(function(Re){g[fe.index]=Re;var be=Re.part;x.hls.trigger(n.Events.FRAG_LOADED,Re);var Le=_[oe+1];if(Le&&Le.fragment===y)J(oe+1);else return F({frag:y,part:be,partsLoaded:g})}).catch(D)};W(j)})},f.handleFragLoadError=function(y){var _=y.data;return _&&_.details===O.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(_.frag,_.part):this.hls.trigger(n.Events.ERROR,_),null},f._handleTransmuxerFlush=function(y){var _=this.getCurrentContext(y);if(!_||this.state!==L.PARSING){this.fragCurrent||(this.state=L.IDLE);return}var j=_.frag,U=_.part,x=_.level,F=self.performance.now();j.stats.parsing.end=F,U&&(U.stats.parsing.end=F),this.updateLevelTiming(j,U,x,y.partial)},f.getCurrentContext=function(y){var _=this.levels,j=y.level,U=y.sn,x=y.part;if(!_||!_[j])return this.warn("Levels object was unset while buffering fragment "+U+" of level "+j+". The current chunk will not be buffered."),null;var F=_[j],D=x>-1?Object(l.getPartWith)(F,U,x):null,g=D?D.fragment:Object(l.getFragmentWithSN)(F,U,this.fragCurrent);return g?{frag:g,part:D,level:F}:null},f.bufferFragmentData=function(y,_,j,U){if(!y||this.state!==L.PARSING)return;var x=y.data1,F=y.data2,D=x;if(x&&F&&(D=Object(p.appendUint8Array)(x,F)),!D||!D.length)return;var g={type:y.type,frag:_,part:j,chunkMeta:U,parent:_.type,data:D};this.hls.trigger(n.Events.BUFFER_APPENDING,g),y.dropped&&y.independent&&!j&&this.flushBufferGap(_)},f.flushBufferGap=function(y){var _=this.media;if(!_)return;if(!K.BufferHelper.isBuffered(_,_.currentTime)){this.flushMainBuffer(0,y.start);return}var j=_.currentTime,U=K.BufferHelper.bufferInfo(_,j,0),x=y.duration,F=Math.min(this.config.maxFragLookUpTolerance*2,x*.25),D=Math.max(Math.min(y.start-F,U.end-F),j+F);y.start-D>F&&this.flushMainBuffer(D,y.start)},f.getFwdBufferInfo=function(y,_){var j=this.config,U=this.getLoadPosition();if(!Object($.isFiniteNumber)(U))return null;var x=K.BufferHelper.bufferInfo(y,U,j.maxBufferHole);if(x.len===0&&x.nextStart!==void 0){var F=this.fragmentTracker.getBufferedFrag(U,_);if(F&&x.nextStart<F.end)return K.BufferHelper.bufferInfo(y,U,Math.max(x.nextStart,j.maxBufferHole))}return x},f.getMaxBufferLength=function(y){var _=this.config,j;return y?j=Math.max(8*_.maxBufferSize/y,_.maxBufferLength):j=_.maxBufferLength,Math.min(j,_.maxMaxBufferLength)},f.reduceMaxBufferLength=function(y){var _=this.config,j=y||_.maxBufferLength;return _.maxMaxBufferLength>=j?(_.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+_.maxMaxBufferLength+"s"),!0):!1},f.getNextFragment=function(y,_){var j,U,x=_.fragments,F=x.length;if(!F)return null;var D=this.config,g=x[0].start,W;if(_.live){var J=D.initialLiveManifestSize;if(F<J)return this.warn("Not enough fragments to start playback (have: "+F+", need: "+J+")"),null;!_.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(W=this.getInitialLiveFragment(_,x),this.startPosition=W?this.hls.liveSyncPosition||W.start:y)}else y<=g&&(W=x[0]);if(!W){var oe=D.lowLatencyMode?_.partEnd:_.fragmentEnd;W=this.getFragmentAtPosition(y,oe,_)}return(j=W)!==null&&j!==void 0&&j.initSegment&&!((U=W)!==null&&U!==void 0&&U.initSegment.data)&&!this.bitrateTest&&(W=W.initSegment),W},f.getNextPart=function(y,_,j){for(var U=-1,x=!1,F=!0,D=0,g=y.length;D<g;D++){var W=y[D];if(F=F&&!W.independent,U>-1&&j<W.start)break;var J=W.loaded;!J&&(x||W.independent||F)&&W.fragment===_&&(U=D),x=J}return U},f.loadedEndOfParts=function(y,_){var j=y[y.length-1];return j&&_>j.start&&j.loaded},f.getInitialLiveFragment=function(y,_){var j=this.fragPrevious,U=null;if(j){if(y.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+j.programDateTime),U=Object(u.findFragmentByPDT)(_,j.endProgramDateTime,this.config.maxFragLookUpTolerance)),!U){var x=j.sn+1;if(x>=y.startSN&&x<=y.endSN){var F=_[x-y.startSN];j.cc===F.cc&&(U=F,this.log("Live playlist, switching playlist, load frag with next SN: "+U.sn))}U||(U=Object(u.findFragWithCC)(_,j.cc),U&&this.log("Live playlist, switching playlist, load frag with same CC: "+U.sn))}}else{var D=this.hls.liveSyncPosition;D!==null&&(U=this.getFragmentAtPosition(D,this.bitrateTest?y.fragmentEnd:y.edge,y))}return U},f.getFragmentAtPosition=function(y,_,j){var U=this.config,x=this.fragPrevious,F=j.fragments,D=j.endSN,g=j.fragmentHint,W=U.maxFragLookUpTolerance,J=!!(U.lowLatencyMode&&j.partList&&g);J&&g&&!this.bitrateTest&&(F=F.concat(g),D=g.sn);var oe;if(y<_){var fe=y>_-W?0:W;oe=Object(u.findFragmentByPTS)(x,F,y,fe)}else oe=F[F.length-1];if(oe){var Re=oe.sn-j.startSN,be=x&&oe.level===x.level,Le=F[Re+1],Ce=this.fragmentTracker.getState(oe);if(Ce===M.FragmentState.BACKTRACKED){oe=null;for(var Te=Re;F[Te]&&this.fragmentTracker.getState(F[Te])===M.FragmentState.BACKTRACKED;)x?oe=F[Te--]:oe=F[--Te];oe||(oe=Le)}else x&&oe.sn===x.sn&&!J&&(be&&(oe.sn<D&&this.fragmentTracker.getState(Le)!==M.FragmentState.OK?(this.log("SN "+oe.sn+" just loaded, load next one: "+Le.sn),oe=Le):oe=null))}return oe},f.synchronizeToLiveEdge=function(y){var _=this.config,j=this.media;if(!j)return;var U=this.hls.liveSyncPosition,x=j.currentTime,F=y.fragments[0].start,D=y.edge,g=x>=F-_.maxFragLookUpTolerance&&x<=D;if(U!==null&&j.duration>U&&(x<U||!g)){var W=_.liveMaxLatencyDuration!==void 0?_.liveMaxLatencyDuration:_.liveMaxLatencyDurationCount*y.targetduration;(!g&&j.readyState<4||x<D-W)&&(this.loadedmetadata||(this.nextLoadPosition=U),j.readyState&&(this.warn("Playback: "+x.toFixed(3)+" is located too far from the end of live sliding playlist: "+D+", reset currentTime to : "+U.toFixed(3)),j.currentTime=U))}},f.alignPlaylists=function(y,_){var j=this.levels,U=this.levelLastLoaded,x=this.fragPrevious,F=U!==null?j[U]:null,D=y.fragments.length;if(!D)return this.warn("No fragments in live playlist"),0;var g=y.fragments[0].start,W=!_,J=y.alignedSliding&&Object($.isFiniteNumber)(g);if(W||!J&&!g){Object(m.alignStream)(x,F,y);var oe=y.fragments[0].start;return this.log("Live playlist sliding: "+oe.toFixed(2)+" start-sn: "+(_?_.startSN:"na")+"->"+y.startSN+" prev-sn: "+(x?x.sn:"na")+" fragments: "+D),oe}return g},f.waitForCdnTuneIn=function(y){var _=3;return y.live&&y.canBlockReload&&y.tuneInGoal>Math.max(y.partHoldBack,y.partTarget*_)},f.setStartPosition=function(y,_){var j=this.startPosition;if(j<_&&(j=-1),j===-1||this.lastCurrentTime===-1){var U=y.startTimeOffset;Object($.isFiniteNumber)(U)?(j=_+U,U<0&&(j+=y.totalduration),j=Math.min(Math.max(_,j),_+y.totalduration),this.log("Start time offset "+U+" found in playlist, adjust startPosition to "+j),this.startPosition=j):y.live?j=this.hls.liveSyncPosition||_:this.startPosition=j=0,this.lastCurrentTime=j}this.nextLoadPosition=j},f.getLoadPosition=function(){var y=this.media,_=0;return this.loadedmetadata&&y?_=y.currentTime:this.nextLoadPosition&&(_=this.nextLoadPosition),_},f.handleFragLoadAborted=function(y,_){this.transmuxer&&y.sn!=="initSegment"&&y.stats.aborted&&(this.warn("Fragment "+y.sn+(_?" part"+_.index:"")+" of level "+y.level+" was aborted"),this.resetFragmentLoading(y))},f.resetFragmentLoading=function(y){(!this.fragCurrent||!this.fragContextChanged(y))&&(this.state=L.IDLE)},f.onFragmentOrKeyLoadError=function(y,_){if(_.fatal)return;var j=_.frag;if(!j||j.type!==y)return;var U=this.fragCurrent;console.assert(U&&j.sn===U.sn&&j.level===U.level&&j.urlId===U.urlId,"Frag load error must match current frag to retry");var x=this.config;if(this.fragLoadError+1<=x.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(j.level))return;var F=Math.min(Math.pow(2,this.fragLoadError)*x.fragLoadingRetryDelay,x.fragLoadingMaxRetryTimeout);this.warn("Fragment "+j.sn+" of "+y+" "+j.level+" failed to load, retrying in "+F+"ms"),this.retryDate=self.performance.now()+F,this.fragLoadError++,this.state=L.FRAG_LOADING_WAITING_RETRY}else _.levelRetry?(y===s.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=L.IDLE):(G.logger.error(_.details+" reaches max retry, redispatch as fatal ..."),_.fatal=!0,this.hls.stopLoad(),this.state=L.ERROR)},f.afterBufferFlushed=function(y,_,j){if(!y)return;var U=K.BufferHelper.getBuffered(y);this.fragmentTracker.detectEvictedFragments(_,U,j),this.state===L.ENDED&&this.resetLoadingState()},f.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=L.IDLE},f.resetLiveStartWhenNotLoaded=function(y){if(!this.loadedmetadata){this.startFragRequested=!1;var _=this.levels?this.levels[y].details:null;if(_!=null&&_.live)return this.startPosition=-1,this.setStartPosition(_,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},f.updateLevelTiming=function(y,_,j,U){var x=this,F=j.details;console.assert(!!F,"level.details must be defined");var D=Object.keys(y.elementaryStreams).reduce(function(g,W){var J=y.elementaryStreams[W];if(J){var oe=J.endPTS-J.startPTS;if(oe<=0)return x.warn("Could not parse fragment "+y.sn+" "+W+" duration reliably ("+oe+") resetting transmuxer to fallback to playlist timing"),x.resetTransmuxer(),g||!1;var fe=U?0:Object(l.updateFragPTSDTS)(F,y,J.startPTS,J.endPTS,J.startDTS,J.endDTS);return x.hls.trigger(n.Events.LEVEL_PTS_UPDATED,{details:F,level:j,drift:fe,type:W,frag:y,start:J.startPTS,end:J.endPTS}),!0}return g},!1);D?(this.state=L.PARSED,this.hls.trigger(n.Events.FRAG_PARSED,{frag:y,part:_})):this.resetLoadingState()},f.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},A(C,[{key:"state",get:function(){return this._state},set:function(y){var _=this._state;_!==y&&(this._state=y,this.log(_+"->"+y))}}]),C}(H.default)},"./src/controller/buffer-controller.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return u});var $=N("./src/polyfills/number.ts"),H=N("./src/events.ts"),M=N("./src/utils/logger.ts"),K=N("./src/errors.ts"),G=N("./src/utils/buffer-helper.ts"),n=N("./src/utils/mediasource-helper.ts"),O=N("./src/loader/fragment.ts"),v=N("./src/controller/buffer-operation-queue.ts"),p=Object(n.getMediaSource)(),m=/([ha]vc.)(?:\.[^.,]+)+/,u=function(){function l(o){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 s=h.hls,a=h.media,A=h.mediaSource;M.logger.log("[buffer-controller]: Media source opened"),a&&(h.updateMediaElementDuration(),s.trigger(H.Events.MEDIA_ATTACHED,{media:a})),A&&A.removeEventListener("sourceopen",h._onMediaSourceOpen),h.checkPendingTracks()},this._onMediaSourceClose=function(){M.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){M.logger.log("[buffer-controller]: Media source ended")},this.hls=o,this._initSourceBuffer(),this.registerListeners()}var d=l.prototype;return d.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},d.destroy=function(){this.unregisterListeners(),this.details=null},d.registerListeners=function(){var h=this.hls;h.on(H.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),h.on(H.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.on(H.Events.MANIFEST_PARSED,this.onManifestParsed,this),h.on(H.Events.BUFFER_RESET,this.onBufferReset,this),h.on(H.Events.BUFFER_APPENDING,this.onBufferAppending,this),h.on(H.Events.BUFFER_CODECS,this.onBufferCodecs,this),h.on(H.Events.BUFFER_EOS,this.onBufferEos,this),h.on(H.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),h.on(H.Events.LEVEL_UPDATED,this.onLevelUpdated,this),h.on(H.Events.FRAG_PARSED,this.onFragParsed,this),h.on(H.Events.FRAG_CHANGED,this.onFragChanged,this)},d.unregisterListeners=function(){var h=this.hls;h.off(H.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),h.off(H.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.off(H.Events.MANIFEST_PARSED,this.onManifestParsed,this),h.off(H.Events.BUFFER_RESET,this.onBufferReset,this),h.off(H.Events.BUFFER_APPENDING,this.onBufferAppending,this),h.off(H.Events.BUFFER_CODECS,this.onBufferCodecs,this),h.off(H.Events.BUFFER_EOS,this.onBufferEos,this),h.off(H.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),h.off(H.Events.LEVEL_UPDATED,this.onLevelUpdated,this),h.off(H.Events.FRAG_PARSED,this.onFragParsed,this),h.off(H.Events.FRAG_CHANGED,this.onFragChanged,this)},d._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new v.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},d.onManifestParsed=function(h,s){var a=2;(s.audio&&!s.video||!s.altAudio)&&(a=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=a,this.details=null,M.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},d.onMediaAttaching=function(h,s){var a=this.media=s.media;if(a&&p){var A=this.mediaSource=new p;A.addEventListener("sourceopen",this._onMediaSourceOpen),A.addEventListener("sourceended",this._onMediaSourceEnded),A.addEventListener("sourceclose",this._onMediaSourceClose),a.src=self.URL.createObjectURL(A),this._objectUrl=a.src}},d.onMediaDetaching=function(){var h=this.media,s=this.mediaSource,a=this._objectUrl;if(s){if(M.logger.log("[buffer-controller]: media source detaching"),s.readyState==="open")try{s.endOfStream()}catch(A){M.logger.warn("[buffer-controller]: onMediaDetaching: "+A.message+" while calling endOfStream")}this.onBufferReset(),s.removeEventListener("sourceopen",this._onMediaSourceOpen),s.removeEventListener("sourceended",this._onMediaSourceEnded),s.removeEventListener("sourceclose",this._onMediaSourceClose),h&&(a&&self.URL.revokeObjectURL(a),h.src===a?(h.removeAttribute("src"),h.load()):M.logger.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(H.Events.MEDIA_DETACHED,void 0)},d.onBufferReset=function(){var h=this;this.getSourceBufferTypes().forEach(function(s){var a=h.sourceBuffer[s];try{a&&(h.removeBufferListeners(s),h.mediaSource&&h.mediaSource.removeSourceBuffer(a),h.sourceBuffer[s]=void 0)}catch(A){M.logger.warn("[buffer-controller]: Failed to reset the "+s+" buffer",A)}}),this._initSourceBuffer()},d.onBufferCodecs=function(h,s){var a=this,A=this.getSourceBufferTypes().length;if(Object.keys(s).forEach(function(E){if(A){var T=a.tracks[E];if(T&&typeof T.buffer.changeType=="function"){var k=s[E],L=k.codec,S=k.levelCodec,R=k.container,C=(T.levelCodec||T.codec).replace(m,"$1"),f=(S||L).replace(m,"$1");if(C!==f){var w=R+";codecs="+(S||L);a.appendChangeType(E,w)}}}else a.pendingTracks[E]=s[E]}),A)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},d.appendChangeType=function(h,s){var a=this,A=this.operationQueue,E={execute:function(){var k=a.sourceBuffer[h];k&&(M.logger.log("[buffer-controller]: changing "+h+" sourceBuffer type to "+s),k.changeType(s)),A.shiftAndExecuteNext(h)},onStart:function(){},onComplete:function(){},onError:function(k){M.logger.warn("[buffer-controller]: Failed to change "+h+" SourceBuffer type",k)}};A.append(E,h)},d.onBufferAppending=function(h,s){var a=this,A=this.hls,E=this.operationQueue,T=this.tracks,k=s.data,L=s.type,S=s.frag,R=s.part,C=s.chunkMeta,f=C.buffering[L],w=self.performance.now();f.start=w;var y=S.stats.buffering,_=R?R.stats.buffering:null;y.start===0&&(y.start=w),_&&_.start===0&&(_.start=w);var j=T.audio,U=L==="audio"&&C.id===1&&(j==null?void 0:j.container)==="audio/mpeg",x={execute:function(){if(f.executeStart=self.performance.now(),U){var D=a.sourceBuffer[L];if(D){var g=S.start-D.timestampOffset;Math.abs(g)>=.1&&(M.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+S.start+" (delta: "+g+") sn: "+S.sn+")"),D.timestampOffset=S.start)}}a.appendExecutor(k,L)},onStart:function(){},onComplete:function(){var D=self.performance.now();f.executeEnd=f.end=D,y.first===0&&(y.first=D),_&&_.first===0&&(_.first=D);var g=a.sourceBuffer,W={};for(var J in g)W[J]=G.BufferHelper.getBuffered(g[J]);a.appendError=0,a.hls.trigger(H.Events.BUFFER_APPENDED,{type:L,frag:S,part:R,chunkMeta:C,parent:S.type,timeRanges:W})},onError:function(D){M.logger.error("[buffer-controller]: Error encountered while trying to append to the "+L+" SourceBuffer",D);var g={type:K.ErrorTypes.MEDIA_ERROR,parent:S.type,details:K.ErrorDetails.BUFFER_APPEND_ERROR,err:D,fatal:!1};D.code===DOMException.QUOTA_EXCEEDED_ERR?g.details=K.ErrorDetails.BUFFER_FULL_ERROR:(a.appendError++,g.details=K.ErrorDetails.BUFFER_APPEND_ERROR,a.appendError>A.config.appendErrorMaxRetry&&(M.logger.error("[buffer-controller]: Failed "+A.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),g.fatal=!0)),A.trigger(H.Events.ERROR,g)}};E.append(x,L)},d.onBufferFlushing=function(h,s){var a=this,A=this.operationQueue,E=function(k){return{execute:a.removeExecutor.bind(a,k,s.startOffset,s.endOffset),onStart:function(){},onComplete:function(){a.hls.trigger(H.Events.BUFFER_FLUSHED,{type:k})},onError:function(S){M.logger.warn("[buffer-controller]: Failed to remove from "+k+" SourceBuffer",S)}}};s.type?A.append(E(s.type),s.type):this.getSourceBufferTypes().forEach(function(T){A.append(E(T),T)})},d.onFragParsed=function(h,s){var a=this,A=s.frag,E=s.part,T=[],k=E?E.elementaryStreams:A.elementaryStreams;k[O.ElementaryStreamTypes.AUDIOVIDEO]?T.push("audiovideo"):(k[O.ElementaryStreamTypes.AUDIO]&&T.push("audio"),k[O.ElementaryStreamTypes.VIDEO]&&T.push("video"));var L=function(){var R=self.performance.now();A.stats.buffering.end=R,E&&(E.stats.buffering.end=R);var C=E?E.stats:A.stats;a.hls.trigger(H.Events.FRAG_BUFFERED,{frag:A,part:E,stats:C,id:A.type})};T.length===0&&M.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+A.type+" level: "+A.level+" sn: "+A.sn),this.blockBuffers(L,T)},d.onFragChanged=function(h,s){this.flushBackBuffer()},d.onBufferEos=function(h,s){var a=this,A=this.getSourceBufferTypes().reduce(function(E,T){var k=a.sourceBuffer[T];return(!s.type||s.type===T)&&(k&&!k.ended&&(k.ended=!0,M.logger.log("[buffer-controller]: "+T+" sourceBuffer now EOS"))),E&&!!(!k||k.ended)},!0);A&&this.blockBuffers(function(){var E=a.mediaSource;if(!E||E.readyState!=="open")return;E.endOfStream()})},d.onLevelUpdated=function(h,s){var a=s.details;if(!a.fragments.length)return;this.details=a,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},d.flushBackBuffer=function(){var h=this.hls,s=this.details,a=this.media,A=this.sourceBuffer;if(!a||s===null)return;var E=this.getSourceBufferTypes();if(!E.length)return;var T=s.live&&h.config.liveBackBufferLength!==null?h.config.liveBackBufferLength:h.config.backBufferLength;if(!Object($.isFiniteNumber)(T)||T<0)return;var k=a.currentTime,L=s.levelTargetDuration,S=Math.max(T,L),R=Math.floor(k/L)*L-S;E.forEach(function(C){var f=A[C];if(f){var w=G.BufferHelper.getBuffered(f);w.length>0&&R>w.start(0)&&(h.trigger(H.Events.BACK_BUFFER_REACHED,{bufferEnd:R}),s.live&&h.trigger(H.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:R}),h.trigger(H.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:R,type:C}))}})},d.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var h=this.details,s=this.hls,a=this.media,A=this.mediaSource,E=h.fragments[0].start+h.totalduration,T=a.duration,k=Object($.isFiniteNumber)(A.duration)?A.duration:0;h.live&&s.config.liveDurationInfinity?(M.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),A.duration=Infinity,this.updateSeekableRange(h)):(E>k&&E>T||!Object($.isFiniteNumber)(T))&&(M.logger.log("[buffer-controller]: Updating Media Source duration to "+E.toFixed(3)),A.duration=E)},d.updateSeekableRange=function(h){var s=this.mediaSource,a=h.fragments,A=a.length;if(A&&h.live&&s!==null&&s!==void 0&&s.setLiveSeekableRange){var E=Math.max(0,a[0].start),T=Math.max(E,E+h.totalduration);s.setLiveSeekableRange(E,T)}},d.checkPendingTracks=function(){var h=this.bufferCodecEventsExpected,s=this.operationQueue,a=this.pendingTracks,A=Object.keys(a).length;if(A&&!h||A===2){this.createSourceBuffers(a),this.pendingTracks={};var E=this.getSourceBufferTypes();if(E.length===0){this.hls.trigger(H.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}E.forEach(function(T){s.executeNext(T)})}},d.createSourceBuffers=function(h){var s=this.sourceBuffer,a=this.mediaSource;if(!a)throw Error("createSourceBuffers called when mediaSource was null");var A=0;for(var E in h)if(!s[E]){var T=h[E];if(!T)throw Error("source buffer exists for track "+E+", however track does not");var k=T.levelCodec||T.codec,L=T.container+";codecs="+k;M.logger.log("[buffer-controller]: creating sourceBuffer("+L+")");try{var S=s[E]=a.addSourceBuffer(L),R=E;this.addBufferListener(R,"updatestart",this._onSBUpdateStart),this.addBufferListener(R,"updateend",this._onSBUpdateEnd),this.addBufferListener(R,"error",this._onSBUpdateError),this.tracks[E]={buffer:S,codec:k,container:T.container,levelCodec:T.levelCodec,id:T.id},A++}catch(C){M.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+C.message),this.hls.trigger(H.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:C,mimeType:L})}}A&&this.hls.trigger(H.Events.BUFFER_CREATED,{tracks:this.tracks})},d._onSBUpdateStart=function(h){var s=this.operationQueue,a=s.current(h);a.onStart()},d._onSBUpdateEnd=function(h){var s=this.operationQueue,a=s.current(h);a.onComplete(),s.shiftAndExecuteNext(h)},d._onSBUpdateError=function(h,s){M.logger.error("[buffer-controller]: "+h+" SourceBuffer error",s),this.hls.trigger(H.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var a=this.operationQueue.current(h);a&&a.onError(s)},d.removeExecutor=function(h,s,a){var A=this.media,E=this.mediaSource,T=this.operationQueue,k=this.sourceBuffer,L=k[h];if(!A||!E||!L){M.logger.warn("[buffer-controller]: Attempting to remove from the "+h+" SourceBuffer, but it does not exist"),T.shiftAndExecuteNext(h);return}var S=Object($.isFiniteNumber)(A.duration)?A.duration:Infinity,R=Object($.isFiniteNumber)(E.duration)?E.duration:Infinity,C=Math.max(0,s),f=Math.min(a,S,R);f>C?(M.logger.log("[buffer-controller]: Removing ["+C+","+f+"] from the "+h+" SourceBuffer"),console.assert(!L.updating,h+" sourceBuffer must not be updating"),L.remove(C,f)):T.shiftAndExecuteNext(h)},d.appendExecutor=function(h,s){var a=this.operationQueue,A=this.sourceBuffer,E=A[s];if(!E){M.logger.warn("[buffer-controller]: Attempting to append to the "+s+" SourceBuffer, but it does not exist"),a.shiftAndExecuteNext(s);return}E.ended=!1,console.assert(!E.updating,s+" sourceBuffer must not be updating"),E.appendBuffer(h)},d.blockBuffers=function(h,s){var a=this;if(s===void 0&&(s=this.getSourceBufferTypes()),!s.length){M.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(h);return}var A=this.operationQueue,E=s.map(function(T){return A.appendBlocker(T)});Promise.all(E).then(function(){h(),s.forEach(function(T){var k=a.sourceBuffer[T];(!k||!k.updating)&&A.shiftAndExecuteNext(T)})})},d.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},d.addBufferListener=function(h,s,a){var A=this.sourceBuffer[h];if(!A)return;var E=a.bind(this,h);this.listeners[h].push({event:s,listener:E}),A.addEventListener(s,E)},d.removeBufferListeners=function(h){var s=this.sourceBuffer[h];if(!s)return;this.listeners[h].forEach(function(a){s.removeEventListener(a.event,a.listener)})},l}()},"./src/controller/buffer-operation-queue.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return H});var $=N("./src/utils/logger.ts"),H=function(){function M(G){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=G}var K=M.prototype;return K.append=function(n,O){var v=this.queues[O];v.push(n),v.length===1&&this.buffers[O]&&this.executeNext(O)},K.insertAbort=function(n,O){var v=this.queues[O];v.unshift(n),this.executeNext(O)},K.appendBlocker=function(n){var O,v=new Promise(function(m){O=m}),p={execute:O,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(p,n),v},K.executeNext=function(n){var O=this.buffers,v=this.queues,p=O[n],m=v[n];if(m.length){var u=m[0];try{u.execute()}catch(l){$.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),u.onError(l),(!p||!p.updating)&&(m.shift(),this.executeNext(n))}}},K.shiftAndExecuteNext=function(n){this.queues[n].shift(),this.executeNext(n)},K.current=function(n){return this.queues[n][0]},M}()},"./src/controller/cap-level-controller.ts":function(le,Y,N){"use strict";N.r(Y);var $=N("./src/events.ts");function H(G,n){for(var O=0;O<n.length;O++){var v=n[O];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(G,v.key,v)}}function M(G,n,O){return n&&H(G.prototype,n),O&&H(G,O),G}var K=function(){function G(O){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=O,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var n=G.prototype;return n.setStreamController=function(v){this.streamController=v},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 v=this.hls;v.on($.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),v.on($.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),v.on($.Events.MANIFEST_PARSED,this.onManifestParsed,this),v.on($.Events.BUFFER_CODECS,this.onBufferCodecs,this),v.on($.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},n.unregisterListener=function(){var v=this.hls;v.off($.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),v.off($.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),v.off($.Events.MANIFEST_PARSED,this.onManifestParsed,this),v.off($.Events.BUFFER_CODECS,this.onBufferCodecs,this),v.off($.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},n.onFpsDropLevelCapping=function(v,p){G.isLevelAllowed(p.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(p.droppedLevel)},n.onMediaAttaching=function(v,p){this.media=p.media instanceof HTMLVideoElement?p.media:null},n.onManifestParsed=function(v,p){var m=this.hls;this.restrictedLevels=[],this.firstLevel=p.firstLevel,m.config.capLevelToPlayerSize&&p.video&&this.startCapping()},n.onBufferCodecs=function(v,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 v=this.hls.levels;if(v.length){var p=this.hls;p.autoLevelCapping=this.getMaxLevel(v.length-1),p.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=p.autoLevelCapping}}},n.getMaxLevel=function(v){var p=this,m=this.hls.levels;if(!m.length)return-1;var u=m.filter(function(l,d){return G.isLevelAllowed(d,p.restrictedLevels)&&d<=v});return this.clientRect=null,G.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 v=this.media,p={width:0,height:0};if(v){var m=v.getBoundingClientRect();p.width=m.width,p.height=m.height,!p.width&&!p.height&&(p.width=m.right-m.left||v.width||0,p.height=m.bottom-m.top||v.height||0)}return this.clientRect=p,p},G.isLevelAllowed=function(v,p){return p===void 0&&(p=[]),p.indexOf(v)===-1},G.getMaxLevelByMediaSize=function(v,p,m){if(!v||!v.length)return-1;for(var u=function(s,a){return a?s.width!==a.width||s.height!==a.height:!0},l=v.length-1,d=0;d<v.length;d+=1){var o=v[d];if((o.width>=p||o.height>=m)&&u(o,v[d+1])){l=d;break}}return l},M(G,[{key:"mediaWidth",get:function(){return this.getDimensions().width*G.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*G.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var v=1;try{v=self.devicePixelRatio}catch(p){}return v}}]),G}();Y.default=K},"./src/controller/cmcd-controller.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return u});var $=N("./src/events.ts"),H=N("./src/types/cmcd.ts"),M=N("./src/utils/buffer-helper.ts"),K=N("./src/utils/logger.ts");function G(l,d){for(var o=0;o<d.length;o++){var h=d[o];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(l,h.key,h)}}function n(l,d,o){return d&&G(l.prototype,d),o&&G(l,o),l}function O(l,d){var o=typeof Symbol!="undefined"&&l[Symbol.iterator]||l["@@iterator"];if(o)return(o=o.call(l)).next.bind(o);if(Array.isArray(l)||(o=v(l))||d&&l&&typeof l.length=="number"){o&&(l=o);var h=0;return function(){return h>=l.length?{done:!0}:{done:!1,value:l[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 v(l,d){if(!l)return;if(typeof l=="string")return p(l,d);var o=Object.prototype.toString.call(l).slice(8,-1);if(o==="Object"&&l.constructor&&(o=l.constructor.name),o==="Map"||o==="Set")return Array.from(l);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return p(l,d)}function p(l,d){(d==null||d>l.length)&&(d=l.length);for(var o=0,h=new Array(d);o<d;o++)h[o]=l[o];return h}function m(){return m=Object.assign||function(l){for(var d=1;d<arguments.length;d++){var o=arguments[d];for(var h in o)Object.prototype.hasOwnProperty.call(o,h)&&(l[h]=o[h])}return l},m.apply(this,arguments)}var u=function(){function l(o){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:H.CMCDObjectType.MANIFEST,su:!h.initialized})}catch(E){K.logger.warn("Could not generate manifest CMCD data.",E)}},this.applyFragmentData=function(A){try{var E=A.frag,T=h.hls.levels[E.level],k=h.getObjectType(E),L={d:E.duration*1e3,ot:k};(k===H.CMCDObjectType.VIDEO||k===H.CMCDObjectType.AUDIO||k==H.CMCDObjectType.MUXED)&&(L.br=T.bitrate/1e3,L.tb=h.getTopBandwidth(k),L.bl=h.getBufferLength(k)),h.apply(A,L)}catch(S){K.logger.warn("Could not generate segment CMCD data.",S)}},this.hls=o;var s=this.config=o.config,a=s.cmcd;a!=null&&(s.pLoader=this.createPlaylistLoader(),s.fLoader=this.createFragmentLoader(),this.sid=a.sessionId||l.uuid(),this.cid=a.contentId,this.useHeaders=a.useHeaders===!0,this.registerListeners())}var d=l.prototype;return d.registerListeners=function(){var h=this.hls;h.on($.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.on($.Events.MEDIA_DETACHED,this.onMediaDetached,this),h.on($.Events.BUFFER_CREATED,this.onBufferCreated,this)},d.unregisterListeners=function(){var h=this.hls;h.off($.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.off($.Events.MEDIA_DETACHED,this.onMediaDetached,this),h.off($.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},d.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},d.onMediaAttached=function(h,s){this.media=s.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},d.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},d.onBufferCreated=function(h,s){var a,A;this.audioBuffer=(a=s.tracks.audio)===null||a===void 0?void 0:a.buffer,this.videoBuffer=(A=s.tracks.video)===null||A===void 0?void 0:A.buffer},d.createData=function(){var h;return{v:H.CMCDVersion,sf:H.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}},d.apply=function(h,s){s===void 0&&(s={}),m(s,this.createData());var a=s.ot===H.CMCDObjectType.INIT||s.ot===H.CMCDObjectType.VIDEO||s.ot===H.CMCDObjectType.MUXED;if(this.starved&&a&&(s.bs=!0,s.su=!0,this.starved=!1),s.su==null&&(s.su=this.buffering),this.useHeaders){var A=l.toHeaders(s);if(!Object.keys(A).length)return;h.headers||(h.headers={}),m(h.headers,A)}else{var E=l.toQuery(s);if(!E)return;h.url=l.appendQueryToUri(h.url,E)}},d.getObjectType=function(h){var s=h.type;return s==="subtitle"?H.CMCDObjectType.TIMED_TEXT:h.sn==="initSegment"?H.CMCDObjectType.INIT:s==="audio"?H.CMCDObjectType.AUDIO:s==="main"?this.hls.audioTracks.length?H.CMCDObjectType.VIDEO:H.CMCDObjectType.MUXED:void 0},d.getTopBandwidth=function(h){for(var s=0,a=h===H.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,A=O(a),E;!(E=A()).done;){var T=E.value;T.bitrate>s&&(s=T.bitrate)}return s>0?s:NaN},d.getBufferLength=function(h){var s=this.hls.media,a=h===H.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!a||!s)return NaN;var A=M.BufferHelper.bufferInfo(a,s.currentTime,this.config.maxBufferHole);return A.len*1e3},d.createPlaylistLoader=function(){var h=this.config.pLoader,s=this.applyPlaylistData,a=h||this.config.loader;return function(){function A(T){this.loader=void 0,this.loader=new a(T)}var E=A.prototype;return E.destroy=function(){this.loader.destroy()},E.abort=function(){this.loader.abort()},E.load=function(k,L,S){s(k),this.loader.load(k,L,S)},n(A,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),A}()},d.createFragmentLoader=function(){var h=this.config.fLoader,s=this.applyFragmentData,a=h||this.config.loader;return function(){function A(T){this.loader=void 0,this.loader=new a(T)}var E=A.prototype;return E.destroy=function(){this.loader.destroy()},E.abort=function(){this.loader.abort()},E.load=function(k,L,S){s(k),this.loader.load(k,L,S)},n(A,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),A}()},l.uuid=function(){var h=URL.createObjectURL(new Blob),s=h.toString();return URL.revokeObjectURL(h),s.substr(s.lastIndexOf("/")+1)},l.serialize=function(h){for(var s=[],a=function(U){return!Number.isNaN(U)&&U!=null&&U!==""&&U!==!1},A=function(U){return Math.round(U)},E=function(U){return A(U/100)*100},T=function(U){return encodeURIComponent(U)},k={br:A,d:A,bl:E,dl:E,mtp:E,nor:T,rtp:E,tb:A},L=Object.keys(h||{}).sort(),S=O(L),R;!(R=S()).done;){var C=R.value,f=h[C];if(!a(f))continue;if(C==="v"&&f===1)continue;if(C=="pr"&&f===1)continue;var w=k[C];w&&(f=w(f));var y=typeof f,_=void 0;C==="ot"||C==="sf"||C==="st"?_=C+"="+f:y==="boolean"?_=C:y==="number"?_=C+"="+f:_=C+"="+JSON.stringify(f),s.push(_)}return s.join(",")},l.toHeaders=function(h){for(var s=Object.keys(h),a={},A=["Object","Request","Session","Status"],E=[{},{},{},{}],T={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},k=0,L=s;k<L.length;k++){var S=L[k],R=T[S]!=null?T[S]:1;E[R][S]=h[S]}for(var C=0;C<E.length;C++){var f=l.serialize(E[C]);f&&(a["CMCD-"+A[C]]=f)}return a},l.toQuery=function(h){return"CMCD="+encodeURIComponent(l.serialize(h))},l.appendQueryToUri=function(h,s){if(!s)return h;var a=h.includes("?")?"&":"?";return""+h+a+s},l}()},"./src/controller/eme-controller.ts":function(le,Y,N){"use strict";N.r(Y);var $=N("./src/events.ts"),H=N("./src/errors.ts"),M=N("./src/utils/logger.ts"),K=N("./src/utils/mediakeys-helper.ts");function G(u,l){for(var d=0;d<l.length;d++){var o=l[d];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(u,o.key,o)}}function n(u,l,d){return l&&G(u.prototype,l),d&&G(u,d),u}var O=3,v=function(l,d,o){var h={audioCapabilities:[],videoCapabilities:[]};return l.forEach(function(s){h.audioCapabilities.push({contentType:'audio/mp4; codecs="'+s+'"',robustness:o.audioRobustness||""})}),d.forEach(function(s){h.videoCapabilities.push({contentType:'video/mp4; codecs="'+s+'"',robustness:o.videoRobustness||""})}),[h]},p=function(l,d,o,h){switch(l){case K.KeySystems.WIDEVINE:return v(d,o,h);default:throw new Error("Unknown key-system: "+l)}},m=function(){function u(d){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=d,this._config=d.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 l=u.prototype;return l.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},l._registerListeners=function(){this.hls.on($.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on($.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on($.Events.MANIFEST_PARSED,this.onManifestParsed,this)},l._unregisterListeners=function(){this.hls.off($.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off($.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off($.Events.MANIFEST_PARSED,this.onManifestParsed,this)},l.getLicenseServerUrl=function(o){switch(o){case K.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+o+'"')},l._attemptKeySystemAccess=function(o,h,s){var a=this,A=p(o,h,s,this._drmSystemOptions);M.logger.log("Requesting encrypted media key-system access");var E=this.requestMediaKeySystemAccess(o,A);this.mediaKeysPromise=E.then(function(T){return a._onMediaKeySystemAccessObtained(o,T)}),E.catch(function(T){M.logger.error('Failed to obtain key-system "'+o+'" access:',T)})},l._onMediaKeySystemAccessObtained=function(o,h){var s=this;M.logger.log('Access for key-system "'+o+'" obtained');var a={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:h,mediaKeySystemDomain:o};this._mediaKeysList.push(a);var A=Promise.resolve().then(function(){return h.createMediaKeys()}).then(function(E){return a.mediaKeys=E,M.logger.log('Media-keys created for key-system "'+o+'"'),s._onMediaKeysCreated(),E});return A.catch(function(E){M.logger.error("Failed to create media-keys:",E)}),A},l._onMediaKeysCreated=function(){var o=this;this._mediaKeysList.forEach(function(h){h.mediaKeysSession||(h.mediaKeysSession=h.mediaKeys.createSession(),o._onNewMediaKeySession(h.mediaKeysSession))})},l._onNewMediaKeySession=function(o){var h=this;M.logger.log("New key-system session "+o.sessionId),o.addEventListener("message",function(s){h._onKeySessionMessage(o,s.message)},!1)},l._onKeySessionMessage=function(o,h){M.logger.log("Got EME message event, creating license request"),this._requestLicense(h,function(s){M.logger.log("Received license data (length: "+(s&&s.byteLength)+"), updating key-session"),o.update(s)})},l.onMediaEncrypted=function(o){var h=this;if(M.logger.log('Media is encrypted using "'+o.initDataType+'" init data type'),!this.mediaKeysPromise){M.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger($.Events.ERROR,{type:H.ErrorTypes.KEY_SYSTEM_ERROR,details:H.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var s=function(A){if(!h._media)return;h._attemptSetMediaKeys(A),h._generateRequestWithPreferredKeySession(o.initDataType,o.initData)};this.mediaKeysPromise.then(s).catch(s)},l._attemptSetMediaKeys=function(o){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){M.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger($.Events.ERROR,{type:H.ErrorTypes.KEY_SYSTEM_ERROR,details:H.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}M.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(h.mediaKeys),this._hasSetMediaKeys=!0}},l._generateRequestWithPreferredKeySession=function(o,h){var s=this,a=this._mediaKeysList[0];if(!a){M.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger($.Events.ERROR,{type:H.ErrorTypes.KEY_SYSTEM_ERROR,details:H.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(a.mediaKeysSessionInitialized){M.logger.warn("Key-Session already initialized but requested again");return}var A=a.mediaKeysSession;if(!A){M.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger($.Events.ERROR,{type:H.ErrorTypes.KEY_SYSTEM_ERROR,details:H.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!h){M.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger($.Events.ERROR,{type:H.ErrorTypes.KEY_SYSTEM_ERROR,details:H.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}M.logger.log('Generating key-session request for "'+o+'" init data type'),a.mediaKeysSessionInitialized=!0,A.generateRequest(o,h).then(function(){M.logger.debug("Key-session generation succeeded")}).catch(function(E){M.logger.error("Error generating key-session request:",E),s.hls.trigger($.Events.ERROR,{type:H.ErrorTypes.KEY_SYSTEM_ERROR,details:H.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},l._createLicenseXhr=function(o,h,s){var a=new XMLHttpRequest;a.responseType="arraybuffer",a.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,a,o,h,s);var A=this._licenseXhrSetup;if(A)try{A.call(this.hls,a,o),A=void 0}catch(E){M.logger.error(E)}try{a.readyState||a.open("POST",o,!0),A&&A.call(this.hls,a,o)}catch(E){throw new Error("issue setting up KeySystem license XHR "+E)}return a},l._onLicenseRequestReadyStageChange=function(o,h,s,a){switch(o.readyState){case 4:if(o.status===200){this._requestLicenseFailureCount=0,M.logger.log("License request succeeded");var A=o.response,E=this._licenseResponseCallback;if(E)try{A=E.call(this.hls,o,h)}catch(k){M.logger.error(k)}a(A)}else{if(M.logger.error("License Request XHR failed ("+h+"). Status: "+o.status+" ("+o.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>O){this.hls.trigger($.Events.ERROR,{type:H.ErrorTypes.KEY_SYSTEM_ERROR,details:H.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var T=O-this._requestLicenseFailureCount+1;M.logger.warn("Retrying license request, "+T+" attempts left"),this._requestLicense(s,a)}break}},l._generateLicenseRequestChallenge=function(o,h){switch(o.mediaKeySystemDomain){case K.KeySystems.WIDEVINE:return h}throw new Error("unsupported key-system: "+o.mediaKeySystemDomain)},l._requestLicense=function(o,h){M.logger.log("Requesting content license for key-system");var s=this._mediaKeysList[0];if(!s){M.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger($.Events.ERROR,{type:H.ErrorTypes.KEY_SYSTEM_ERROR,details:H.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var a=this.getLicenseServerUrl(s.mediaKeySystemDomain),A=this._createLicenseXhr(a,o,h);M.logger.log("Sending license request to URL: "+a);var E=this._generateLicenseRequestChallenge(s,o);A.send(E)}catch(T){M.logger.error("Failure requesting DRM license: "+T),this.hls.trigger($.Events.ERROR,{type:H.ErrorTypes.KEY_SYSTEM_ERROR,details:H.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},l.onMediaAttached=function(o,h){if(!this._emeEnabled)return;var s=h.media;this._media=s,s.addEventListener("encrypted",this._onMediaEncrypted)},l.onMediaDetached=function(){var o=this._media,h=this._mediaKeysList;if(!o)return;o.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(h.map(function(s){if(s.mediaKeysSession)return s.mediaKeysSession.close().catch(function(){})})).then(function(){return o.setMediaKeys(null)}).catch(function(){})},l.onManifestParsed=function(o,h){if(!this._emeEnabled)return;var s=h.levels.map(function(A){return A.audioCodec}).filter(function(A){return!!A}),a=h.levels.map(function(A){return A.videoCodec}).filter(function(A){return!!A});this._attemptKeySystemAccess(K.KeySystems.WIDEVINE,s,a)},n(u,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),u}();Y.default=m},"./src/controller/fps-controller.ts":function(le,Y,N){"use strict";N.r(Y);var $=N("./src/events.ts"),H=N("./src/utils/logger.ts"),M=function(){function K(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 G=K.prototype;return G.setStreamController=function(O){this.streamController=O},G.registerListeners=function(){this.hls.on($.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},G.unregisterListeners=function(){this.hls.off($.Events.MEDIA_ATTACHING,this.onMediaAttaching)},G.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},G.onMediaAttaching=function(O,v){var p=this.hls.config;if(p.capLevelOnFPSDrop){var m=v.media instanceof self.HTMLVideoElement?v.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)}},G.checkFPS=function(O,v,p){var m=performance.now();if(v){if(this.lastTime){var u=m-this.lastTime,l=p-this.lastDroppedFrames,d=v-this.lastDecodedFrames,o=1e3*l/u,h=this.hls;if(h.trigger($.Events.FPS_DROP,{currentDropped:l,currentDecoded:d,totalDroppedFrames:p}),o>0&&l>h.config.fpsDroppedMonitoringThreshold*d){var s=h.currentLevel;H.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+s),s>0&&(h.autoLevelCapping===-1||h.autoLevelCapping>=s)&&(s=s-1,h.trigger($.Events.FPS_DROP_LEVEL_CAPPING,{level:s,droppedLevel:h.currentLevel}),h.autoLevelCapping=s,this.streamController.nextLevelSwitch())}}this.lastTime=m,this.lastDroppedFrames=p,this.lastDecodedFrames=v}},G.checkFPSInterval=function(){var O=this.media;if(O)if(this.isVideoPlaybackQualityAvailable){var v=O.getVideoPlaybackQuality();this.checkFPS(O,v.totalVideoFrames,v.droppedVideoFrames)}else this.checkFPS(O,O.webkitDecodedFrameCount,O.webkitDroppedFrameCount)},K}();Y.default=M},"./src/controller/fragment-finders.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"findFragmentByPDT",function(){return M}),N.d(Y,"findFragmentByPTS",function(){return K}),N.d(Y,"fragmentWithinToleranceTest",function(){return G}),N.d(Y,"pdtWithinToleranceTest",function(){return n}),N.d(Y,"findFragWithCC",function(){return O});var $=N("./src/polyfills/number.ts"),H=N("./src/utils/binary-search.ts");function M(v,p,m){if(p===null||!Array.isArray(v)||!v.length||!Object($.isFiniteNumber)(p))return null;var u=v[0].programDateTime;if(p<(u||0))return null;var l=v[v.length-1].endProgramDateTime;if(p>=(l||0))return null;m=m||0;for(var d=0;d<v.length;++d){var o=v[d];if(n(p,m,o))return o}return null}function K(v,p,m,u){m===void 0&&(m=0),u===void 0&&(u=0);var l=null;if(v?l=p[v.sn-p[0].sn+1]||null:m===0&&p[0].start===0&&(l=p[0]),l&&G(m,u,l)===0)return l;var d=H.default.search(p,G.bind(null,m,u));return d||l}function G(v,p,m){v===void 0&&(v=0),p===void 0&&(p=0);var u=Math.min(p,m.duration+(m.deltaPTS?m.deltaPTS:0));return m.start+m.duration-u<=v?1:m.start-u>v&&m.start?-1:0}function n(v,p,m){var u=Math.min(p,m.duration+(m.deltaPTS?m.deltaPTS:0))*1e3,l=m.endProgramDateTime||0;return l-u>v}function O(v,p){return H.default.search(v,function(m){return m.cc<p?1:m.cc>p?-1:0})}},"./src/controller/fragment-tracker.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"FragmentState",function(){return M}),N.d(Y,"FragmentTracker",function(){return K});var $=N("./src/events.ts"),H=N("./src/types/loader.ts"),M;(function(O){O.NOT_LOADED="NOT_LOADED",O.BACKTRACKED="BACKTRACKED",O.APPENDING="APPENDING",O.PARTIAL="PARTIAL",O.OK="OK"})(M||(M={}));var K=function(){function O(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 v=O.prototype;return v._registerListeners=function(){var m=this.hls;m.on($.Events.BUFFER_APPENDED,this.onBufferAppended,this),m.on($.Events.FRAG_BUFFERED,this.onFragBuffered,this),m.on($.Events.FRAG_LOADED,this.onFragLoaded,this)},v._unregisterListeners=function(){var m=this.hls;m.off($.Events.BUFFER_APPENDED,this.onBufferAppended,this),m.off($.Events.FRAG_BUFFERED,this.onFragBuffered,this),m.off($.Events.FRAG_LOADED,this.onFragLoaded,this)},v.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},v.getAppendedFrag=function(m,u){if(u===H.PlaylistLevelType.MAIN){var l=this.activeFragment,d=this.activeParts;if(!l)return null;if(d)for(var o=d.length;o--;){var h=d[o],s=h?h.end:l.appendedPTS;if(h.start<=m&&s!==void 0&&m<=s)return o>9&&(this.activeParts=d.slice(o-9)),h}else if(l.start<=m&&l.appendedPTS!==void 0&&m<=l.appendedPTS)return l}return this.getBufferedFrag(m,u)},v.getBufferedFrag=function(m,u){for(var l=this.fragments,d=Object.keys(l),o=d.length;o--;){var h=l[d[o]];if((h==null?void 0:h.body.type)===u&&h.buffered){var s=h.body;if(s.start<=m&&m<=s.end)return s}}return null},v.detectEvictedFragments=function(m,u,l){var d=this;Object.keys(this.fragments).forEach(function(o){var h=d.fragments[o];if(!h)return;if(!h.buffered){h.body.type===l&&d.removeFragment(h.body);return}var s=h.range[m];if(!s)return;s.time.some(function(a){var A=!d.isTimeBuffered(a.startPTS,a.endPTS,u);return A&&d.removeFragment(h.body),A})})},v.detectPartialFragments=function(m){var u=this,l=this.timeRanges,d=m.frag,o=m.part;if(!l||d.sn==="initSegment")return;var h=n(d),s=this.fragments[h];if(!s)return;Object.keys(l).forEach(function(a){var A=d.elementaryStreams[a];if(!A)return;var E=l[a],T=o!==null||A.partial===!0;s.range[a]=u.getBufferedTimes(d,o,T,E)}),s.backtrack=s.loaded=null,Object.keys(s.range).length?s.buffered=!0:this.removeFragment(s.body)},v.fragBuffered=function(m){var u=n(m),l=this.fragments[u];l&&(l.backtrack=l.loaded=null,l.buffered=!0)},v.getBufferedTimes=function(m,u,l,d){for(var o={time:[],partial:l},h=u?u.start:m.start,s=u?u.end:m.end,a=m.minEndPTS||s,A=m.maxStartPTS||h,E=0;E<d.length;E++){var T=d.start(E)-this.bufferPadding,k=d.end(E)+this.bufferPadding;if(A>=T&&a<=k){o.time.push({startPTS:Math.max(h,d.start(E)),endPTS:Math.min(s,d.end(E))});break}else if(h<k&&s>T)o.partial=!0,o.time.push({startPTS:Math.max(h,d.start(E)),endPTS:Math.min(s,d.end(E))});else if(s<=T)break}return o},v.getPartialFragment=function(m){var u=null,l,d,o,h=0,s=this.bufferPadding,a=this.fragments;return Object.keys(a).forEach(function(A){var E=a[A];if(!E)return;G(E)&&(d=E.body.start-s,o=E.body.end+s,m>=d&&m<=o&&(l=Math.min(m-d,o-m),h<=l&&(u=E.body,h=l)))}),u},v.getState=function(m){var u=n(m),l=this.fragments[u];return l?l.buffered?G(l)?M.PARTIAL:M.OK:l.backtrack?M.BACKTRACKED:M.APPENDING:M.NOT_LOADED},v.backtrack=function(m,u){var l=n(m),d=this.fragments[l];if(!d||d.backtrack)return null;var o=d.backtrack=u||d.loaded;return d.loaded=null,o},v.getBacktrackData=function(m){var u=n(m),l=this.fragments[u];if(l){var d,o=l.backtrack;if(o!=null&&(d=o.payload)!==null&&d!==void 0&&d.byteLength)return o;this.removeFragment(m)}return null},v.isTimeBuffered=function(m,u,l){for(var d,o,h=0;h<l.length;h++){if(d=l.start(h)-this.bufferPadding,o=l.end(h)+this.bufferPadding,m>=d&&u<=o)return!0;if(u<=d)return!1}return!1},v.onFragLoaded=function(m,u){var l=u.frag,d=u.part;if(l.sn==="initSegment"||l.bitrateTest||d)return;var o=n(l);this.fragments[o]={body:l,loaded:u,backtrack:null,buffered:!1,range:Object.create(null)}},v.onBufferAppended=function(m,u){var l=this,d=u.frag,o=u.part,h=u.timeRanges;if(d.type===H.PlaylistLevelType.MAIN)if(this.activeFragment=d,o){var s=this.activeParts;s||(this.activeParts=s=[]),s.push(o)}else this.activeParts=null;this.timeRanges=h,Object.keys(h).forEach(function(a){var A=h[a];if(l.detectEvictedFragments(a,A),!o)for(var E=0;E<A.length;E++)d.appendedPTS=Math.max(A.end(E),d.appendedPTS||0)})},v.onFragBuffered=function(m,u){this.detectPartialFragments(u)},v.hasFragment=function(m){var u=n(m);return!!this.fragments[u]},v.removeFragmentsInRange=function(m,u,l){var d=this;Object.keys(this.fragments).forEach(function(o){var h=d.fragments[o];if(!h)return;if(h.buffered){var s=h.body;s.type===l&&s.start<u&&s.end>m&&d.removeFragment(s)}})},v.removeFragment=function(m){var u=n(m);m.stats.loaded=0,m.clearElementaryStreamInfo(),delete this.fragments[u]},v.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},O}();function G(O){var v,p;return O.buffered&&(((v=O.range.video)===null||v===void 0?void 0:v.partial)||((p=O.range.audio)===null||p===void 0?void 0:p.partial))}function n(O){return O.type+"_"+O.level+"_"+O.urlId+"_"+O.sn}},"./src/controller/gap-controller.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"STALL_MINIMUM_DURATION_MS",function(){return G}),N.d(Y,"MAX_START_GAP_JUMP",function(){return n}),N.d(Y,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return O}),N.d(Y,"SKIP_BUFFER_RANGE_START",function(){return v}),N.d(Y,"default",function(){return p});var $=N("./src/utils/buffer-helper.ts"),H=N("./src/errors.ts"),M=N("./src/events.ts"),K=N("./src/utils/logger.ts"),G=250,n=2,O=.1,v=.05,p=function(){function m(l,d,o,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=l,this.media=d,this.fragmentTracker=o,this.hls=h}var u=m.prototype;return u.destroy=function(){this.hls=this.fragmentTracker=this.media=null},u.poll=function(d){var o=this.config,h=this.media,s=this.stalled,a=h.currentTime,A=h.seeking,E=this.seeking&&!A,T=!this.seeking&&A;if(this.seeking=A,a!==d){if(this.moved=!0,s!==null){if(this.stallReported){var k=self.performance.now()-s;K.logger.warn("playback not stuck anymore @"+a+", after "+Math.round(k)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((T||E)&&(this.stalled=null),h.paused||h.ended||h.playbackRate===0||!$.BufferHelper.getBuffered(h).length)return;var L=$.BufferHelper.bufferInfo(h,a,0),S=L.len>0,R=L.nextStart||0;if(!S&&!R)return;if(A){var C=L.len>n,f=!R||R-a>n&&!this.fragmentTracker.getPartialFragment(a);if(C||f)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var w,y=Math.max(R,L.start||0)-a,_=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,j=_==null||((w=_.details)===null||w===void 0)?void 0:w.live,U=j?_.details.targetduration*2:n;if(y>0&&y<=U){this._trySkipBufferHole(null);return}}var x=self.performance.now();if(s===null){this.stalled=x;return}var F=x-s;!A&&F>=G&&this._reportStall(L.len);var D=$.BufferHelper.bufferInfo(h,a,o.maxBufferHole);this._tryFixBufferStall(D,F)},u._tryFixBufferStall=function(d,o){var h=this.config,s=this.fragmentTracker,a=this.media,A=a.currentTime,E=s.getPartialFragment(A);if(E){var T=this._trySkipBufferHole(E);if(T)return}d.len>h.maxBufferHole&&o>h.highBufferWatchdogPeriod*1e3&&(K.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},u._reportStall=function(d){var o=this.hls,h=this.media,s=this.stallReported;s||(this.stallReported=!0,K.logger.warn("Playback stalling at @"+h.currentTime+" due to low buffer (buffer="+d+")"),o.trigger(M.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:d}))},u._trySkipBufferHole=function(d){for(var o=this.config,h=this.hls,s=this.media,a=s.currentTime,A=0,E=$.BufferHelper.getBuffered(s),T=0;T<E.length;T++){var k=E.start(T);if(a+o.maxBufferHole>=A&&a<k){var L=Math.max(k+v,s.currentTime+O);return K.logger.warn("skipping hole, adjusting currentTime from "+a+" to "+L),this.moved=!0,this.stalled=null,s.currentTime=L,d&&h.trigger(M.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+a+" to "+L,frag:d}),L}A=E.end(T)}return 0},u._tryNudgeBuffer=function(){var d=this.config,o=this.hls,h=this.media,s=h.currentTime,a=(this.nudgeRetry||0)+1;if(this.nudgeRetry=a,a<d.nudgeMaxRetry){var A=s+a*d.nudgeOffset;K.logger.warn("Nudging 'currentTime' from "+s+" to "+A),h.currentTime=A,o.trigger(M.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else K.logger.error("Playhead still not moving while enough data buffered @"+s+" after "+d.nudgeMaxRetry+" nudges"),o.trigger(M.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},m}()},"./src/controller/id3-track-controller.ts":function(le,Y,N){"use strict";N.r(Y);var $=N("./src/events.ts"),H=N("./src/utils/texttrack-utils.ts"),M=N("./src/demux/id3.ts"),K=.25,G=function(){function n(v){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=v,this._registerListeners()}var O=n.prototype;return O.destroy=function(){this._unregisterListeners()},O._registerListeners=function(){var p=this.hls;p.on($.Events.MEDIA_ATTACHED,this.onMediaAttached,this),p.on($.Events.MEDIA_DETACHING,this.onMediaDetaching,this),p.on($.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),p.on($.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},O._unregisterListeners=function(){var p=this.hls;p.off($.Events.MEDIA_ATTACHED,this.onMediaAttached,this),p.off($.Events.MEDIA_DETACHING,this.onMediaDetaching,this),p.off($.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),p.off($.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},O.onMediaAttached=function(p,m){this.media=m.media},O.onMediaDetaching=function(){if(!this.id3Track)return;Object(H.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},O.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(H.sendAddTrackEvent)(u,this.media),u}return this.media.addTextTrack("metadata","id3")},O.onFragParsingMetadata=function(p,m){if(!this.media)return;var u=m.frag,l=m.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var d=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,o=0;o<l.length;o++){var h=M.getID3Frames(l[o].data);if(h){var s=l[o].pts,a=o<l.length-1?l[o+1].pts:u.end,A=a-s;A<=0&&(a=s+K);for(var E=0;E<h.length;E++){var T=h[E];if(!M.isTimeStampFrame(T)){var k=new d(s,a,"");k.value=T,this.id3Track.addCue(k)}}}}},O.onBufferFlushing=function(p,m){var u=m.startOffset,l=m.endOffset,d=m.type;if(!d||d==="audio"){var o=this.id3Track;o&&Object(H.removeCuesInRange)(o,u,l)}},n}();Y.default=G},"./src/controller/latency-controller.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return n});var $=N("./src/errors.ts"),H=N("./src/events.ts"),M=N("./src/utils/logger.ts");function K(O,v){for(var p=0;p<v.length;p++){var m=v[p];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(O,m.key,m)}}function G(O,v,p){return v&&K(O.prototype,v),p&&K(O,p),O}var n=function(){function O(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 v=O.prototype;return v.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},v.registerListeners=function(){this.hls.on(H.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(H.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(H.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(H.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(H.Events.ERROR,this.onError,this)},v.unregisterListeners=function(){this.hls.off(H.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(H.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(H.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(H.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(H.Events.ERROR,this.onError)},v.onMediaAttached=function(m,u){this.media=u.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},v.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},v.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},v.onLevelUpdated=function(m,u){var l=u.details;this.levelDetails=l,l.advanced&&this.timeupdate(),!l.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},v.onError=function(m,u){if(u.details!==$.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,M.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},v.timeupdate=function(){var m=this.media,u=this.levelDetails;if(!m||!u)return;this.currentTime=m.currentTime;var l=this.computeLatency();if(l===null)return;this._latency=l;var d=this.config,o=d.lowLatencyMode,h=d.maxLiveSyncPlaybackRate;if(!o||h===1)return;var s=this.targetLatency;if(s===null)return;var a=l-s,A=Math.min(this.maxLatency,s+u.targetduration),E=a<A;if(u.live&&E&&a>.05&&this.forwardBufferLength>1){var T=Math.min(2,Math.max(1,h)),k=Math.round(2/(1+Math.exp(-.75*a-this.edgeStalled))*20)/20;m.playbackRate=Math.min(T,Math.max(1,k))}else m.playbackRate!==1&&m.playbackRate!==0&&(m.playbackRate=1)},v.estimateLiveEdge=function(){var m=this.levelDetails;return m===null?null:m.edge+m.age},v.computeLatency=function(){var m=this.estimateLiveEdge();return m===null?null:m-this.currentTime},G(O,[{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,l=m.partHoldBack,d=m.targetduration,o=this.config,h=o.liveSyncDuration,s=o.liveSyncDurationCount,a=o.lowLatencyMode,A=this.hls.userConfig,E=a&&l||u;(A.liveSyncDuration||A.liveSyncDurationCount||E===0)&&(E=h!==void 0?h:s*d);var T=d,k=1;return E+Math.min(this.stallCount*k,T)}},{key:"liveSyncPosition",get:function(){var m=this.estimateLiveEdge(),u=this.targetLatency,l=this.levelDetails;if(m===null||u===null||l===null)return null;var d=l.edge,o=m-u-this.edgeStalled,h=d-l.totalduration,s=d-(this.config.lowLatencyMode&&l.partTarget||l.targetduration);return Math.min(Math.max(h,o),s)}},{key:"drift",get:function(){var m=this.levelDetails;return m===null?1:m.drift}},{key:"edgeStalled",get:function(){var m=this.levelDetails;if(m===null)return 0;var 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 l=m.buffered.length;return l?m.buffered.end(l-1):u.edge-this.currentTime}}]),O}()},"./src/controller/level-controller.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return o});var $=N("./src/types/level.ts"),H=N("./src/events.ts"),M=N("./src/errors.ts"),K=N("./src/utils/codecs.ts"),G=N("./src/controller/level-helper.ts"),n=N("./src/controller/base-playlist-controller.ts"),O=N("./src/types/loader.ts");function v(){return v=Object.assign||function(h){for(var s=1;s<arguments.length;s++){var a=arguments[s];for(var A in a)Object.prototype.hasOwnProperty.call(a,A)&&(h[A]=a[A])}return h},v.apply(this,arguments)}function p(h,s){for(var a=0;a<s.length;a++){var A=s[a];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(h,A.key,A)}}function m(h,s,a){return s&&p(h.prototype,s),a&&p(h,a),h}function u(h,s){h.prototype=Object.create(s.prototype),h.prototype.constructor=h,l(h,s)}function l(h,s){return l=Object.setPrototypeOf||function(A,E){return A.__proto__=E,A},l(h,s)}var d=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),o=function(h){u(s,h);function s(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 a=s.prototype;return a._registerListeners=function(){var E=this.hls;E.on(H.Events.MANIFEST_LOADED,this.onManifestLoaded,this),E.on(H.Events.LEVEL_LOADED,this.onLevelLoaded,this),E.on(H.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),E.on(H.Events.FRAG_LOADED,this.onFragLoaded,this),E.on(H.Events.ERROR,this.onError,this)},a._unregisterListeners=function(){var E=this.hls;E.off(H.Events.MANIFEST_LOADED,this.onManifestLoaded,this),E.off(H.Events.LEVEL_LOADED,this.onLevelLoaded,this),E.off(H.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),E.off(H.Events.FRAG_LOADED,this.onFragLoaded,this),E.off(H.Events.ERROR,this.onError,this)},a.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,h.prototype.destroy.call(this)},a.startLoad=function(){var E=this._levels;E.forEach(function(T){T.loadError=0}),h.prototype.startLoad.call(this)},a.onManifestLoaded=function(E,T){var k=[],L=[],S=[],R,C={},f,w=!1,y=!1,_=!1;if(T.levels.forEach(function(F){var D=F.attrs;w=w||!!(F.width&&F.height),y=y||!!F.videoCodec,_=_||!!F.audioCodec,d&&F.audioCodec&&F.audioCodec.indexOf("mp4a.40.34")!==-1&&(F.audioCodec=void 0);var g=F.bitrate+"-"+F.attrs.RESOLUTION+"-"+F.attrs.CODECS;f=C[g],f?f.url.push(F.url):(f=new $.Level(F),C[g]=f,k.push(f)),D&&(D.AUDIO&&Object(G.addGroupId)(f,"audio",D.AUDIO),D.SUBTITLES&&Object(G.addGroupId)(f,"text",D.SUBTITLES))}),(w||y)&&_&&(k=k.filter(function(F){var D=F.videoCodec,g=F.width,W=F.height;return!!D||!!(g&&W)})),k=k.filter(function(F){var D=F.audioCodec,g=F.videoCodec;return(!D||Object(K.isCodecSupportedInMp4)(D,"audio"))&&(!g||Object(K.isCodecSupportedInMp4)(g,"video"))}),T.audioTracks&&(L=T.audioTracks.filter(function(F){return!F.audioCodec||Object(K.isCodecSupportedInMp4)(F.audioCodec,"audio")}),Object(G.assignTrackIdsByGroup)(L)),T.subtitles&&(S=T.subtitles,Object(G.assignTrackIdsByGroup)(S)),k.length>0){R=k[0].bitrate,k.sort(function(F,D){return F.bitrate-D.bitrate}),this._levels=k;for(var j=0;j<k.length;j++)if(k[j].bitrate===R){this._firstLevel=j,this.log("manifest loaded, "+k.length+" level(s) found, first bitrate: "+R);break}var U=_&&!y,x={levels:k,audioTracks:L,subtitleTracks:S,firstLevel:this._firstLevel,stats:T.stats,audio:_,video:y,altAudio:!U&&L.some(function(F){return!!F.url})};this.hls.trigger(H.Events.MANIFEST_PARSED,x),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(H.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:T.url,reason:"no level with compatible codecs found in manifest"})},a.onError=function(E,T){if(h.prototype.onError.call(this,E,T),T.fatal)return;var k=T.context,L=this._levels[this.currentLevelIndex];if(k&&(k.type===O.PlaylistContextType.AUDIO_TRACK&&L.audioGroupIds&&k.groupId===L.audioGroupIds[L.urlId]||k.type===O.PlaylistContextType.SUBTITLE_TRACK&&L.textGroupIds&&k.groupId===L.textGroupIds[L.urlId])){this.redundantFailover(this.currentLevelIndex);return}var S=!1,R=!0,C;switch(T.details){case M.ErrorDetails.FRAG_LOAD_ERROR:case M.ErrorDetails.FRAG_LOAD_TIMEOUT:case M.ErrorDetails.KEY_LOAD_ERROR:case M.ErrorDetails.KEY_LOAD_TIMEOUT:if(T.frag){var f=this._levels[T.frag.level];f?(f.fragmentError++,f.fragmentError>this.hls.config.fragLoadingMaxRetry&&(C=T.frag.level)):C=T.frag.level}break;case M.ErrorDetails.LEVEL_LOAD_ERROR:case M.ErrorDetails.LEVEL_LOAD_TIMEOUT:k&&(k.deliveryDirectives&&(R=!1),C=k.level),S=!0;break;case M.ErrorDetails.REMUX_ALLOC_ERROR:C=T.level,S=!0;break}C!==void 0&&this.recoverLevel(T,C,S,R)},a.recoverLevel=function(E,T,k,L){var S=E.details,R=this._levels[T];if(R.loadError++,k){var C=this.retryLoadingOrFail(E);if(C)E.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(L){var f=R.url.length;if(f>1&&R.loadError<f)E.levelRetry=!0,this.redundantFailover(T);else if(this.manualLevelIndex===-1){var w=T===0?this._levels.length-1:T-1;this.currentLevelIndex!==w&&this._levels[w].loadError===0&&(this.warn(S+": switch to "+w),E.levelRetry=!0,this.hls.nextAutoLevel=w)}}},a.redundantFailover=function(E){var T=this._levels[E],k=T.url.length;if(k>1){var L=(T.urlId+1)%k;this.warn("Switching to redundant URL-id "+L),this._levels.forEach(function(S){S.urlId=L}),this.level=E}},a.onFragLoaded=function(E,T){var k=T.frag;if(k!==void 0&&k.type===O.PlaylistLevelType.MAIN){var L=this._levels[k.level];L!==void 0&&(L.fragmentError=0,L.loadError=0)}},a.onLevelLoaded=function(E,T){var k,L=T.level,S=T.details,R=this._levels[L];if(!R){var C;this.warn("Invalid level index "+L),(C=T.deliveryDirectives)!==null&&C!==void 0&&C.skip&&(S.deltaUpdateFailed=!0);return}L===this.currentLevelIndex?(R.fragmentError===0&&(R.loadError=0,this.retryCount=0),this.playlistLoaded(L,T,R.details)):(k=T.deliveryDirectives)!==null&&k!==void 0&&k.skip&&(S.deltaUpdateFailed=!0)},a.onAudioTrackSwitched=function(E,T){var k=this.hls.levels[this.currentLevelIndex];if(!k)return;if(k.audioGroupIds){for(var L=-1,S=this.hls.audioTracks[T.id].groupId,R=0;R<k.audioGroupIds.length;R++)if(k.audioGroupIds[R]===S){L=R;break}L!==k.urlId&&(k.urlId=L,this.startLoad())}},a.loadPlaylist=function(E){var T=this.currentLevelIndex,k=this._levels[T];if(this.canLoad&&k&&k.url.length>0){var L=k.urlId,S=k.url[L];if(E)try{S=E.addDirectives(S)}catch(R){this.warn("Could not construct new URL with HLS Delivery Directives: "+R)}this.log("Attempt loading level index "+T+(E?" at sn "+E.msn+" part "+E.part:"")+" with URL-id "+L+" "+S),this.clearTimer(),this.hls.trigger(H.Events.LEVEL_LOADING,{url:S,level:T,id:L,deliveryDirectives:E||null})}},a.removeLevel=function(E,T){var k=function(R,C){return C!==T},L=this._levels.filter(function(S,R){return R!==E?!0:S.url.length>1&&T!==void 0?(S.url=S.url.filter(k),S.audioGroupIds&&(S.audioGroupIds=S.audioGroupIds.filter(k)),S.textGroupIds&&(S.textGroupIds=S.textGroupIds.filter(k)),S.urlId=0,!0):!1}).map(function(S,R){var C=S.details;return C!=null&&C.fragments&&C.fragments.forEach(function(f){f.level=R}),S});this._levels=L,this.hls.trigger(H.Events.LEVELS_UPDATED,{levels:L})},m(s,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(E){var T,k=this._levels;if(k.length===0)return;if(this.currentLevelIndex===E&&(T=k[E])!==null&&T!==void 0&&T.details)return;if(E<0||E>=k.length){var L=E<0;if(this.hls.trigger(H.Events.ERROR,{type:M.ErrorTypes.OTHER_ERROR,details:M.ErrorDetails.LEVEL_SWITCH_ERROR,level:E,fatal:L,reason:"invalid level idx"}),L)return;E=Math.min(E,k.length-1)}this.clearTimer();var S=this.currentLevelIndex,R=k[S],C=k[E];this.log("switching to level "+E+" from "+S),this.currentLevelIndex=E;var f=v({},C,{level:E,maxBitrate:C.maxBitrate,uri:C.uri,urlId:C.urlId});delete f._urlId,this.hls.trigger(H.Events.LEVEL_SWITCHING,f);var w=C.details;if(!w||w.live){var y=this.switchParams(C.uri,R==null?void 0:R.details);this.loadPlaylist(y)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(E){this.manualLevelIndex=E,this._startLevel===void 0&&(this._startLevel=E),E!==-1&&(this.level=E)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(E){this._firstLevel=E}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var E=this.hls.config.startLevel;return E!==void 0?E:this._firstLevel}else return this._startLevel},set:function(E){this._startLevel=E}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(E){this.level=E,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=E)}}]),s}(n.default)},"./src/controller/level-helper.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"addGroupId",function(){return M}),N.d(Y,"assignTrackIdsByGroup",function(){return K}),N.d(Y,"updatePTS",function(){return G}),N.d(Y,"updateFragPTSDTS",function(){return O}),N.d(Y,"mergeDetails",function(){return v}),N.d(Y,"mapPartIntersection",function(){return p}),N.d(Y,"mapFragmentIntersection",function(){return m}),N.d(Y,"adjustSliding",function(){return u}),N.d(Y,"addSliding",function(){return l}),N.d(Y,"computeReloadInterval",function(){return d}),N.d(Y,"getFragmentWithSN",function(){return o}),N.d(Y,"getPartWith",function(){return h});var $=N("./src/polyfills/number.ts"),H=N("./src/utils/logger.ts");function M(s,a,A){switch(a){case"audio":s.audioGroupIds||(s.audioGroupIds=[]),s.audioGroupIds.push(A);break;case"text":s.textGroupIds||(s.textGroupIds=[]),s.textGroupIds.push(A);break}}function K(s){var a={};s.forEach(function(A){var E=A.groupId||"";A.id=a[E]=a[E]||0,a[E]++})}function G(s,a,A){var E=s[a],T=s[A];n(E,T)}function n(s,a){var A=a.startPTS;if(Object($.isFiniteNumber)(A)){var E=0,T;a.sn>s.sn?(E=A-s.start,T=s):(E=s.start-A,T=a),T.duration!==E&&(T.duration=E)}else if(a.sn>s.sn){var k=s.cc===a.cc;k&&s.minEndPTS?a.start=s.start+(s.minEndPTS-s.start):a.start=s.start+s.duration}else a.start=Math.max(s.start-a.duration,0)}function O(s,a,A,E,T,k){var L=E-A;L<=0&&(H.logger.warn("Fragment should have a positive duration",a),E=A+a.duration,k=T+a.duration);var S=A,R=E,C=a.startPTS,f=a.endPTS;if(Object($.isFiniteNumber)(C)){var w=Math.abs(C-A);Object($.isFiniteNumber)(a.deltaPTS)?a.deltaPTS=Math.max(w,a.deltaPTS):a.deltaPTS=w,S=Math.max(A,C),A=Math.min(A,C),T=Math.min(T,a.startDTS),R=Math.min(E,f),E=Math.max(E,f),k=Math.max(k,a.endDTS)}a.duration=E-A;var y=A-a.start;a.appendedPTS=E,a.start=a.startPTS=A,a.maxStartPTS=S,a.startDTS=T,a.endPTS=E,a.minEndPTS=R,a.endDTS=k;var _=a.sn;if(!s||_<s.startSN||_>s.endSN)return 0;var j,U=_-s.startSN,x=s.fragments;for(x[U]=a,j=U;j>0;j--)n(x[j],x[j-1]);for(j=U;j<x.length-1;j++)n(x[j],x[j+1]);return s.fragmentHint&&n(x[x.length-1],s.fragmentHint),s.PTSKnown=s.alignedSliding=!0,y}function v(s,a){for(var A=null,E=s.fragments,T=E.length-1;T>=0;T--){var k=E[T].initSegment;if(k){A=k;break}}s.fragmentHint&&delete s.fragmentHint.endPTS;var L=0,S;if(m(s,a,function(j,U){j.relurl&&(L=j.cc-U.cc),Object($.isFiniteNumber)(j.startPTS)&&Object($.isFiniteNumber)(j.endPTS)&&(U.start=U.startPTS=j.startPTS,U.startDTS=j.startDTS,U.appendedPTS=j.appendedPTS,U.maxStartPTS=j.maxStartPTS,U.endPTS=j.endPTS,U.endDTS=j.endDTS,U.minEndPTS=j.minEndPTS,U.duration=j.endPTS-j.startPTS,U.duration&&(S=U),a.PTSKnown=a.alignedSliding=!0),U.elementaryStreams=j.elementaryStreams,U.loader=j.loader,U.stats=j.stats,U.urlId=j.urlId,j.initSegment&&(U.initSegment=j.initSegment,A=j.initSegment)}),A){var R=a.fragmentHint?a.fragments.concat(a.fragmentHint):a.fragments;R.forEach(function(j){var U;(!j.initSegment||j.initSegment.relurl===((U=A)===null||U===void 0?void 0:U.relurl))&&(j.initSegment=A)})}if(a.skippedSegments&&(a.deltaUpdateFailed=a.fragments.some(function(j){return!j}),a.deltaUpdateFailed)){H.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var C=a.skippedSegments;C--;)a.fragments.shift();a.startSN=a.fragments[0].sn,a.startCC=a.fragments[0].cc}var f=a.fragments;if(L){H.logger.warn("discontinuity sliding from playlist, take drift into account");for(var w=0;w<f.length;w++)f[w].cc+=L}a.skippedSegments&&(a.startCC=a.fragments[0].cc),p(s.partList,a.partList,function(j,U){U.elementaryStreams=j.elementaryStreams,U.stats=j.stats}),S?O(a,S,S.startPTS,S.endPTS,S.startDTS,S.endDTS):u(s,a),f.length&&(a.totalduration=a.edge-f[0].start),a.driftStartTime=s.driftStartTime,a.driftStart=s.driftStart;var y=a.advancedDateTime;if(a.advanced&&y){var _=a.edge;a.driftStart||(a.driftStartTime=y,a.driftStart=_),a.driftEndTime=y,a.driftEnd=_}else a.driftEndTime=s.driftEndTime,a.driftEnd=s.driftEnd,a.advancedDateTime=s.advancedDateTime}function p(s,a,A){if(s&&a)for(var E=0,T=0,k=s.length;T<=k;T++){var L=s[T],S=a[T+E];L&&S&&L.index===S.index&&L.fragment.sn===S.fragment.sn?A(L,S):E--}}function m(s,a,A){for(var E=a.skippedSegments,T=Math.max(s.startSN,a.startSN)-a.startSN,k=(s.fragmentHint?1:0)+(E?a.endSN:Math.min(s.endSN,a.endSN))-a.startSN,L=a.startSN-s.startSN,S=a.fragmentHint?a.fragments.concat(a.fragmentHint):a.fragments,R=s.fragmentHint?s.fragments.concat(s.fragmentHint):s.fragments,C=T;C<=k;C++){var f=R[L+C],w=S[C];E&&!w&&C<E&&(w=a.fragments[C]=f),f&&w&&A(f,w)}}function u(s,a){var A=a.startSN+a.skippedSegments-s.startSN,E=s.fragments;if(A<0||A>=E.length)return;l(a,E[A].start)}function l(s,a){if(a){for(var A=s.fragments,E=s.skippedSegments;E<A.length;E++)A[E].start+=a;s.fragmentHint&&(s.fragmentHint.start+=a)}}function d(s,a){var A=1e3*s.levelTargetDuration,E=A/2,T=s.age,k=T>0&&T<A*3,L=a.loading.end-a.loading.start,S,R=s.availabilityDelay;if(s.updated===!1)if(k){var C=333*s.misses;S=Math.max(Math.min(E,L*2),C),s.availabilityDelay=(s.availabilityDelay||0)+S}else S=E;else k?(R=Math.min(R||A/2,T),s.availabilityDelay=R,S=R+A-T):S=A-L;return Math.round(S)}function o(s,a,A){if(!s||!s.details)return null;var E=s.details,T=E.fragments[a-E.startSN];return T||(T=E.fragmentHint,T&&T.sn===a?T:a<E.startSN&&A&&A.sn===a?A:null)}function h(s,a,A){if(!s||!s.details)return null;var E=s.details.partList;if(E)for(var T=E.length;T--;){var k=E[T];if(k.index===A&&k.fragment.sn===a)return k}return null}},"./src/controller/stream-controller.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return E});var $=N("./src/polyfills/number.ts"),H=N("./src/controller/base-stream-controller.ts"),M=N("./src/is-supported.ts"),K=N("./src/events.ts"),G=N("./src/utils/buffer-helper.ts"),n=N("./src/controller/fragment-tracker.ts"),O=N("./src/types/loader.ts"),v=N("./src/loader/fragment.ts"),p=N("./src/demux/transmuxer-interface.ts"),m=N("./src/types/transmuxer.ts"),u=N("./src/controller/gap-controller.ts"),l=N("./src/errors.ts"),d=N("./src/utils/logger.ts");function o(T,k){for(var L=0;L<k.length;L++){var S=k[L];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(T,S.key,S)}}function h(T,k,L){return k&&o(T.prototype,k),L&&o(T,L),T}function s(T,k){T.prototype=Object.create(k.prototype),T.prototype.constructor=T,a(T,k)}function a(T,k){return a=Object.setPrototypeOf||function(S,R){return S.__proto__=R,S},a(T,k)}var A=100,E=function(T){s(k,T);function k(S,R){var C;return C=T.call(this,S,R,"[stream-controller]")||this,C.audioCodecSwap=!1,C.gapController=null,C.level=-1,C._forceStartLoad=!1,C.altAudio=!1,C.audioOnly=!1,C.fragPlaying=null,C.onvplaying=null,C.onvseeked=null,C.fragLastKbps=0,C.stalled=!1,C.couldBacktrack=!1,C.audioCodecSwitch=!1,C.videoBuffer=null,C._registerListeners(),C}var L=k.prototype;return L._registerListeners=function(){var R=this.hls;R.on(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),R.on(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),R.on(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),R.on(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),R.on(K.Events.LEVEL_LOADING,this.onLevelLoading,this),R.on(K.Events.LEVEL_LOADED,this.onLevelLoaded,this),R.on(K.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),R.on(K.Events.ERROR,this.onError,this),R.on(K.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),R.on(K.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),R.on(K.Events.BUFFER_CREATED,this.onBufferCreated,this),R.on(K.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),R.on(K.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),R.on(K.Events.FRAG_BUFFERED,this.onFragBuffered,this)},L._unregisterListeners=function(){var R=this.hls;R.off(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),R.off(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),R.off(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),R.off(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),R.off(K.Events.LEVEL_LOADED,this.onLevelLoaded,this),R.off(K.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),R.off(K.Events.ERROR,this.onError,this),R.off(K.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),R.off(K.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),R.off(K.Events.BUFFER_CREATED,this.onBufferCreated,this),R.off(K.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),R.off(K.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),R.off(K.Events.FRAG_BUFFERED,this.onFragBuffered,this)},L.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},L.startLoad=function(R){if(this.levels){var C=this.lastCurrentTime,f=this.hls;if(this.stopLoad(),this.setInterval(A),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var w=f.startLevel;w===-1&&(f.config.testBandwidth?(w=0,this.bitrateTest=!0):w=f.nextAutoLevel),this.level=f.nextLoadLevel=w,this.loadedmetadata=!1}C>0&&R===-1&&(this.log("Override startPosition with lastCurrentTime @"+C.toFixed(3)),R=C),this.state=H.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=R,this.tick()}else this._forceStartLoad=!0,this.state=H.State.STOPPED},L.stopLoad=function(){this._forceStartLoad=!1,T.prototype.stopLoad.call(this)},L.doTick=function(){switch(this.state){case H.State.IDLE:this.doTickIdle();break;case H.State.WAITING_LEVEL:{var R,C=this.levels,f=this.level,w=C==null||((R=C[f])===null||R===void 0)?void 0:R.details;if(w&&(!w.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(w))break;this.state=H.State.IDLE;break}break}case H.State.FRAG_LOADING_WAITING_RETRY:{var y,_=self.performance.now(),j=this.retryDate;(!j||_>=j||(y=this.media)!==null&&y!==void 0&&y.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=H.State.IDLE)}break;default:break}this.onTickEnd()},L.onTickEnd=function(){T.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},L.doTickIdle=function(){var R,C,f=this.hls,w=this.levelLastLoaded,y=this.levels,_=this.media,j=f.config,U=f.nextLoadLevel;if(w===null||!_&&(this.startFragRequested||!j.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!y||!y[U])return;var x=y[U];this.level=f.nextLoadLevel=U;var F=x.details;if(!F||this.state===H.State.WAITING_LEVEL||F.live&&this.levelLastLoaded!==U){this.state=H.State.WAITING_LEVEL;return}var D=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:_,O.PlaylistLevelType.MAIN);if(D===null)return;var g=D.len,W=this.getMaxBufferLength(x.maxBitrate);if(g>=W)return;if(this._streamEnded(D,F)){var J={};this.altAudio&&(J.type="video"),this.hls.trigger(K.Events.BUFFER_EOS,J),this.state=H.State.ENDED;return}var oe=D.end,fe=this.getNextFragment(oe,F);if(this.couldBacktrack&&!this.fragPrevious&&fe&&fe.sn!=="initSegment"){var Re=fe.sn-F.startSN;Re>1&&(fe=F.fragments[Re-1],this.fragmentTracker.removeFragment(fe))}if(fe&&this.fragmentTracker.getState(fe)===n.FragmentState.OK&&this.nextLoadPosition>oe){var be=this.audioOnly&&!this.altAudio?v.ElementaryStreamTypes.AUDIO:v.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(_,be,O.PlaylistLevelType.MAIN),fe=this.getNextFragment(this.nextLoadPosition,F)}if(!fe)return;fe.initSegment&&!fe.initSegment.data&&!this.bitrateTest&&(fe=fe.initSegment),((R=fe.decryptdata)===null||R===void 0?void 0:R.keyFormat)==="identity"&&!((C=fe.decryptdata)!==null&&C!==void 0&&C.key)?this.loadKey(fe,F):this.loadFragment(fe,F,oe)},L.loadFragment=function(R,C,f){var w,y=this.fragmentTracker.getState(R);if(this.fragCurrent=R,y===n.FragmentState.BACKTRACKED){var _=this.fragmentTracker.getBacktrackData(R);if(_){this._handleFragmentLoadProgress(_),this._handleFragmentLoadComplete(_);return}else y=n.FragmentState.NOT_LOADED}y===n.FragmentState.NOT_LOADED||y===n.FragmentState.PARTIAL?R.sn==="initSegment"?this._loadInitSegment(R):this.bitrateTest?(R.bitrateTest=!0,this.log("Fragment "+R.sn+" of level "+R.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(R)):(this.startFragRequested=!0,T.prototype.loadFragment.call(this,R,C,f)):y===n.FragmentState.APPENDING?this.reduceMaxBufferLength(R.duration)&&this.fragmentTracker.removeFragment(R):((w=this.media)===null||w===void 0?void 0:w.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},L.getAppendedFrag=function(R){var C=this.fragmentTracker.getAppendedFrag(R,O.PlaylistLevelType.MAIN);return C&&"fragment"in C?C.fragment:C},L.getBufferedFrag=function(R){return this.fragmentTracker.getBufferedFrag(R,O.PlaylistLevelType.MAIN)},L.followingBufferedFrag=function(R){return R?this.getBufferedFrag(R.end+.5):null},L.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},L.nextLevelSwitch=function(){var R=this.levels,C=this.media;if(C!=null&&C.readyState){var f,w=this.getAppendedFrag(C.currentTime);if(w&&w.start>1&&this.flushMainBuffer(0,w.start-1),!C.paused&&R){var y=this.hls.nextLoadLevel,_=R[y],j=this.fragLastKbps;j&&this.fragCurrent?f=this.fragCurrent.duration*_.maxBitrate/(1e3*j)+1:f=0}else f=0;var U=this.getBufferedFrag(C.currentTime+f);if(U){var x=this.followingBufferedFrag(U);if(x){this.abortCurrentFrag();var F=x.maxStartPTS?x.maxStartPTS:x.start,D=x.duration,g=Math.max(U.end,F+Math.min(Math.max(D-this.config.maxFragLookUpTolerance,D*.5),D*.75));this.flushMainBuffer(g,Number.POSITIVE_INFINITY)}}}},L.abortCurrentFrag=function(){var R=this.fragCurrent;this.fragCurrent=null,R!=null&&R.loader&&R.loader.abort(),this.state===H.State.KEY_LOADING&&(this.state=H.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},L.flushMainBuffer=function(R,C){T.prototype.flushMainBuffer.call(this,R,C,this.altAudio?"video":null)},L.onMediaAttached=function(R,C){T.prototype.onMediaAttached.call(this,R,C);var f=C.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),f.addEventListener("playing",this.onvplaying),f.addEventListener("seeked",this.onvseeked),this.gapController=new u.default(this.config,f,this.fragmentTracker,this.hls)},L.onMediaDetaching=function(){var R=this.media;R&&(R.removeEventListener("playing",this.onvplaying),R.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),T.prototype.onMediaDetaching.call(this)},L.onMediaPlaying=function(){this.tick()},L.onMediaSeeked=function(){var R=this.media,C=R?R.currentTime:null;Object($.isFiniteNumber)(C)&&this.log("Media seeked to "+C.toFixed(3)),this.tick()},L.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(K.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},L.onManifestParsed=function(R,C){var f=!1,w=!1,y;C.levels.forEach(function(_){y=_.audioCodec,y&&(y.indexOf("mp4a.40.2")!==-1&&(f=!0),y.indexOf("mp4a.40.5")!==-1&&(w=!0))}),this.audioCodecSwitch=f&&w&&!Object(M.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=C.levels,this.startFragRequested=!1},L.onLevelLoading=function(R,C){var f=this.levels;if(!f||this.state!==H.State.IDLE)return;var w=f[C.level];(!w.details||w.details.live&&this.levelLastLoaded!==C.level||this.waitForCdnTuneIn(w.details))&&(this.state=H.State.WAITING_LEVEL)},L.onLevelLoaded=function(R,C){var f,w=this.levels,y=C.level,_=C.details,j=_.totalduration;if(!w){this.warn("Levels were reset while loading level "+y);return}this.log("Level "+y+" loaded ["+_.startSN+","+_.endSN+"], cc ["+_.startCC+", "+_.endCC+"] duration:"+j);var U=this.fragCurrent;U&&(this.state===H.State.FRAG_LOADING||this.state===H.State.FRAG_LOADING_WAITING_RETRY)&&(U.level!==C.level&&U.loader&&(this.state=H.State.IDLE,U.loader.abort()));var x=w[y],F=0;if(_.live||(f=x.details)!==null&&f!==void 0&&f.live){if(_.fragments[0]||(_.deltaUpdateFailed=!0),_.deltaUpdateFailed)return;F=this.alignPlaylists(_,x.details)}if(x.details=_,this.levelLastLoaded=y,this.hls.trigger(K.Events.LEVEL_UPDATED,{details:_,level:y}),this.state===H.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(_))return;this.state=H.State.IDLE}this.startFragRequested?_.live&&this.synchronizeToLiveEdge(_):this.setStartPosition(_,F),this.tick()},L._handleFragmentLoadProgress=function(R){var C,f=R.frag,w=R.part,y=R.payload,_=this.levels;if(!_){this.warn("Levels were reset while fragment load was in progress. Fragment "+f.sn+" of level "+f.level+" will not be buffered");return}var j=_[f.level],U=j.details;if(!U){this.warn("Dropping fragment "+f.sn+" of level "+f.level+" after level details were reset");return}var x=j.videoCodec,F=U.PTSKnown||!U.live,D=(C=f.initSegment)===null||C===void 0?void 0:C.data,g=this._getAudioCodec(j),W=this.transmuxer=this.transmuxer||new p.default(this.hls,O.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),J=w?w.index:-1,oe=J!==-1,fe=new m.ChunkMetadata(f.level,f.sn,f.stats.chunkCount,y.byteLength,J,oe),Re=this.initPTS[f.cc];W.push(y,D,g,x,f,w,U.totalduration,F,fe,Re)},L.onAudioTrackSwitching=function(R,C){var f=this.altAudio,w=!!C.url,y=C.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 _=this.fragCurrent;_!=null&&_.loader&&(this.log("Switching to main audio track, cancel main fragment load"),_.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var j=this.hls;f&&j.trigger(K.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),j.trigger(K.Events.AUDIO_TRACK_SWITCHED,{id:y})}},L.onAudioTrackSwitched=function(R,C){var f=C.id,w=!!this.hls.audioTracks[f].url;if(w){var y=this.videoBuffer;y&&this.mediaBuffer!==y&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=y)}this.altAudio=w,this.tick()},L.onBufferCreated=function(R,C){var f=C.tracks,w,y,_=!1;for(var j in f){var U=f[j];if(U.id==="main"){if(y=j,w=U,j==="video"){var x=f[j];x&&(this.videoBuffer=x.buffer)}}else _=!0}_&&w?(this.log("Alternate track found, use "+y+".buffered to schedule main fragment loading"),this.mediaBuffer=w.buffer):this.mediaBuffer=this.media},L.onFragBuffered=function(R,C){var f=C.frag,w=C.part;if(f&&f.type!==O.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(f)){this.warn("Fragment "+f.sn+(w?" p: "+w.index:"")+" of level "+f.level+" finished buffering, but was aborted. state: "+this.state),this.state===H.State.PARSED&&(this.state=H.State.IDLE);return}var y=w?w.stats:f.stats;this.fragLastKbps=Math.round(8*y.total/(y.buffering.end-y.loading.first)),f.sn!=="initSegment"&&(this.fragPrevious=f),this.fragBufferedComplete(f,w)},L.onError=function(R,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(O.PlaylistLevelType.MAIN,C);break;case l.ErrorDetails.LEVEL_LOAD_ERROR:case l.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==H.State.ERROR&&(C.fatal?(this.warn(""+C.details),this.state=H.State.ERROR):!C.levelRetry&&this.state===H.State.WAITING_LEVEL&&(this.state=H.State.IDLE));break;case l.ErrorDetails.BUFFER_FULL_ERROR:if(C.parent==="main"&&(this.state===H.State.PARSING||this.state===H.State.PARSED)){var f=!0,w=this.getFwdBufferInfo(this.media,O.PlaylistLevelType.MAIN);w&&w.len>.5&&(f=!this.reduceMaxBufferLength(w.len)),f&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},L.checkBuffer=function(){var R=this.media,C=this.gapController;if(!R||!C||!R.readyState)return;var f=G.BufferHelper.getBuffered(R);!this.loadedmetadata&&f.length?(this.loadedmetadata=!0,this.seekToStartPos()):C.poll(this.lastCurrentTime),this.lastCurrentTime=R.currentTime},L.onFragLoadEmergencyAborted=function(){this.state=H.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},L.onBufferFlushed=function(R,C){var f=C.type;if(f!==v.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var w=(f===v.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(w,f,O.PlaylistLevelType.MAIN)}},L.onLevelsUpdated=function(R,C){this.levels=C.levels},L.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},L.seekToStartPos=function(){var R=this.media,C=R.currentTime,f=this.startPosition;if(f>=0&&C<f){if(R.seeking){d.logger.log("could not seek to "+f+", already seeking at "+C);return}var w=G.BufferHelper.getBuffered(R),y=w.length?w.start(0):0,_=y-f;_>0&&(_<this.config.maxBufferHole||_<this.config.maxFragLookUpTolerance)&&(d.logger.log("adjusting start position by "+_+" to match buffer start"),f+=_,this.startPosition=f),this.log("seek to target start position "+f+" from current time "+C),R.currentTime=f}},L._getAudioCodec=function(R){var C=this.config.defaultAudioCodec||R.audioCodec;return this.audioCodecSwap&&C&&(this.log("Swapping audio codec"),C.indexOf("mp4a.40.5")!==-1?C="mp4a.40.2":C="mp4a.40.5"),C},L._loadBitrateTestFrag=function(R){var C=this;this._doFragLoad(R).then(function(f){var w=C.hls;if(!f||w.nextLoadLevel||C.fragContextChanged(R))return;C.fragLoadError=0,C.state=H.State.IDLE,C.startFragRequested=!1,C.bitrateTest=!1;var y=R.stats;y.parsing.start=y.parsing.end=y.buffering.start=y.buffering.end=self.performance.now(),w.trigger(K.Events.FRAG_LOADED,f)})},L._handleTransmuxComplete=function(R){var C,f="main",w=this.hls,y=R.remuxResult,_=R.chunkMeta,j=this.getCurrentContext(_);if(!j){this.warn("The loading context changed while buffering fragment "+_.sn+" of level "+_.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(_.level);return}var U=j.frag,x=j.part,F=j.level,D=y.video,g=y.text,W=y.id3,J=y.initSegment,oe=this.altAudio?void 0:y.audio;if(this.fragContextChanged(U))return;if(this.state=H.State.PARSING,J){J.tracks&&(this._bufferInitSegment(F,J.tracks,U,_),w.trigger(K.Events.FRAG_PARSING_INIT_SEGMENT,{frag:U,id:f,tracks:J.tracks}));var fe=J.initPTS,Re=J.timescale;Object($.isFiniteNumber)(fe)&&(this.initPTS[U.cc]=fe,w.trigger(K.Events.INIT_PTS_FOUND,{frag:U,id:f,initPTS:fe,timescale:Re}))}if(D&&y.independent!==!1){if(F.details){var be=D.startPTS,Le=D.endPTS,Ce=D.startDTS,Te=D.endDTS;if(x)x.elementaryStreams[D.type]={startPTS:be,endPTS:Le,startDTS:Ce,endDTS:Te};else if(D.firstKeyFrame&&D.independent&&(this.couldBacktrack=!0),D.dropped&&D.independent){var ve=this.getLoadPosition()+this.config.maxBufferHole;if(ve<be){this.backtrack(U);return}U.setElementaryStreamInfo(D.type,U.start,Le,U.start,Te,!0)}U.setElementaryStreamInfo(D.type,be,Le,Ce,Te),this.bufferFragmentData(D,U,x,_)}}else if(y.independent===!1){this.backtrack(U);return}if(oe){var X=oe.startPTS,b=oe.endPTS,I=oe.startDTS,B=oe.endDTS;x&&(x.elementaryStreams[v.ElementaryStreamTypes.AUDIO]={startPTS:X,endPTS:b,startDTS:I,endDTS:B}),U.setElementaryStreamInfo(v.ElementaryStreamTypes.AUDIO,X,b,I,B),this.bufferFragmentData(oe,U,x,_)}if(W!=null&&(C=W.samples)!==null&&C!==void 0&&C.length){var Q={frag:U,id:f,samples:W.samples};w.trigger(K.Events.FRAG_PARSING_METADATA,Q)}if(g){var z={frag:U,id:f,samples:g.samples};w.trigger(K.Events.FRAG_PARSING_USERDATA,z)}},L._bufferInitSegment=function(R,C,f,w){var y=this;if(this.state!==H.State.PARSING)return;this.audioOnly=!!C.audio&&!C.video,this.altAudio&&!this.audioOnly&&delete C.audio;var _=C.audio,j=C.video,U=C.audiovideo;if(_){var x=R.audioCodec,F=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(x&&(x.indexOf("mp4a.40.5")!==-1?x="mp4a.40.2":x="mp4a.40.5"),_.metadata.channelCount!==1&&F.indexOf("firefox")===-1&&(x="mp4a.40.5")),F.indexOf("android")!==-1&&_.container!=="audio/mpeg"&&(x="mp4a.40.2",this.log("Android: force audio codec to "+x)),R.audioCodec&&R.audioCodec!==x&&this.log('Swapping manifest audio codec "'+R.audioCodec+'" for "'+x+'"'),_.levelCodec=x,_.id="main",this.log("Init audio buffer, container:"+_.container+", codecs[selected/level/parsed]=["+(x||"")+"/"+(R.audioCodec||"")+"/"+_.codec+"]")}j&&(j.levelCodec=R.videoCodec,j.id="main",this.log("Init video buffer, container:"+j.container+", codecs[level/parsed]=["+(R.videoCodec||"")+"/"+j.codec+"]")),U&&this.log("Init audiovideo buffer, container:"+U.container+", codecs[level/parsed]=["+(R.attrs.CODECS||"")+"/"+U.codec+"]"),this.hls.trigger(K.Events.BUFFER_CODECS,C),Object.keys(C).forEach(function(D){var g=C[D],W=g.initSegment;W!=null&&W.byteLength&&y.hls.trigger(K.Events.BUFFER_APPENDING,{type:D,data:W,frag:f,part:null,chunkMeta:w,parent:f.type})}),this.tick()},L.backtrack=function(R){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(R);var C=this.fragmentTracker.backtrack(R);this.fragPrevious=null,this.nextLoadPosition=R.start,C?this.resetFragmentLoading(R):this.state=H.State.BACKTRACKING},L.checkFragmentChanged=function(){var R=this.media,C=null;if(R&&R.readyState>1&&R.seeking===!1){var f=R.currentTime;if(G.BufferHelper.isBuffered(R,f)?C=this.getAppendedFrag(f):G.BufferHelper.isBuffered(R,f+.1)&&(C=this.getAppendedFrag(f+.1)),C){var w=this.fragPlaying,y=C.level;(!w||C.sn!==w.sn||w.level!==y||C.urlId!==w.urlId)&&(this.hls.trigger(K.Events.FRAG_CHANGED,{frag:C}),(!w||w.level!==y)&&this.hls.trigger(K.Events.LEVEL_SWITCHED,{level:y}),this.fragPlaying=C)}}},h(k,[{key:"nextLevel",get:function(){var R=this.nextBufferedFrag;return R?R.level:-1}},{key:"currentLevel",get:function(){var R=this.media;if(R){var C=this.getAppendedFrag(R.currentTime);if(C)return C.level}return-1}},{key:"nextBufferedFrag",get:function(){var R=this.media;if(R){var C=this.getAppendedFrag(R.currentTime);return this.followingBufferedFrag(C)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),k}(H.default)},"./src/controller/subtitle-stream-controller.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"SubtitleStreamController",function(){return s});var $=N("./src/events.ts"),H=N("./src/utils/logger.ts"),M=N("./src/utils/buffer-helper.ts"),K=N("./src/controller/fragment-finders.ts"),G=N("./src/utils/discontinuities.ts"),n=N("./src/controller/level-helper.ts"),O=N("./src/controller/fragment-tracker.ts"),v=N("./src/controller/base-stream-controller.ts"),p=N("./src/types/loader.ts"),m=N("./src/types/level.ts");function u(a,A){for(var E=0;E<A.length;E++){var T=A[E];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(a,T.key,T)}}function l(a,A,E){return A&&u(a.prototype,A),E&&u(a,E),a}function d(a,A){a.prototype=Object.create(A.prototype),a.prototype.constructor=a,o(a,A)}function o(a,A){return o=Object.setPrototypeOf||function(T,k){return T.__proto__=k,T},o(a,A)}var h=500,s=function(a){d(A,a);function A(T,k){var L;return L=a.call(this,T,k,"[subtitle-stream-controller]")||this,L.levels=[],L.currentTrackId=-1,L.tracksBuffered=[],L.mainDetails=null,L._registerListeners(),L}var E=A.prototype;return E.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},E._registerListeners=function(){var k=this.hls;k.on($.Events.MEDIA_ATTACHED,this.onMediaAttached,this),k.on($.Events.MEDIA_DETACHING,this.onMediaDetaching,this),k.on($.Events.MANIFEST_LOADING,this.onManifestLoading,this),k.on($.Events.LEVEL_LOADED,this.onLevelLoaded,this),k.on($.Events.ERROR,this.onError,this),k.on($.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),k.on($.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),k.on($.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),k.on($.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),k.on($.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},E._unregisterListeners=function(){var k=this.hls;k.off($.Events.MEDIA_ATTACHED,this.onMediaAttached,this),k.off($.Events.MEDIA_DETACHING,this.onMediaDetaching,this),k.off($.Events.MANIFEST_LOADING,this.onManifestLoading,this),k.off($.Events.LEVEL_LOADED,this.onLevelLoaded,this),k.off($.Events.ERROR,this.onError,this),k.off($.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),k.off($.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),k.off($.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),k.off($.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),k.off($.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},E.startLoad=function(){this.stopLoad(),this.state=v.State.IDLE,this.setInterval(h),this.tick()},E.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},E.onLevelLoaded=function(k,L){this.mainDetails=L.details},E.onSubtitleFragProcessed=function(k,L){var S=L.frag,R=L.success;if(this.fragPrevious=S,this.state=v.State.IDLE,!R)return;var C=this.tracksBuffered[this.currentTrackId];if(!C)return;for(var f,w=S.start,y=0;y<C.length;y++)if(w>=C[y].start&&w<=C[y].end){f=C[y];break}var _=S.start+S.duration;f?f.end=_:(f={start:w,end:_},C.push(f)),this.fragmentTracker.fragBuffered(S)},E.onBufferFlushing=function(k,L){var S=L.startOffset,R=L.endOffset;if(S===0&&R!==Number.POSITIVE_INFINITY){var C=this.currentTrackId,f=this.levels;if(!f.length||!f[C]||!f[C].details)return;var w=f[C].details,y=w.targetduration,_=R-y;if(_<=0)return;L.endOffsetSubtitles=Math.max(0,_),this.tracksBuffered.forEach(function(j){for(var U=0;U<j.length;){if(j[U].end<=_){j.shift();continue}else if(j[U].start<_)j[U].start=_;else break;U++}}),this.fragmentTracker.removeFragmentsInRange(S,_,p.PlaylistLevelType.SUBTITLE)}},E.onError=function(k,L){var S,R=L.frag;if(!R||R.type!==p.PlaylistLevelType.SUBTITLE)return;(S=this.fragCurrent)!==null&&S!==void 0&&S.loader&&this.fragCurrent.loader.abort(),this.state=v.State.IDLE},E.onSubtitleTracksUpdated=function(k,L){var S=this,R=L.subtitleTracks;this.tracksBuffered=[],this.levels=R.map(function(C){return new m.Level(C)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(C){S.tracksBuffered[C.id]=[]}),this.mediaBuffer=null},E.onSubtitleTrackSwitch=function(k,L){if(this.currentTrackId=L.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var S=this.levels[this.currentTrackId];S!=null&&S.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,S&&this.setInterval(h)},E.onSubtitleTrackLoaded=function(k,L){var S,R=L.details,C=L.id,f=this.currentTrackId,w=this.levels;if(!w.length)return;var y=w[f];if(C>=w.length||C!==f||!y)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,R.live||(S=y.details)!==null&&S!==void 0&&S.live){var _=this.mainDetails;if(R.deltaUpdateFailed||!_)return;var j=_.fragments[0];if(!y.details)R.hasProgramDateTime&&_.hasProgramDateTime?Object(G.alignMediaPlaylistByPDT)(R,_):j&&Object(n.addSliding)(R,j.start);else{var U=this.alignPlaylists(R,y.details);U===0&&j&&Object(n.addSliding)(R,j.start)}}if(y.details=R,this.levelLastLoaded=C,this.tick(),R.live&&!this.fragCurrent&&this.media&&this.state===v.State.IDLE){var x=Object(K.findFragmentByPTS)(null,R.fragments,this.media.currentTime,0);x||(this.warn("Subtitle playlist not aligned with playback"),y.details=void 0)}},E._handleFragmentLoadComplete=function(k){var L=k.frag,S=k.payload,R=L.decryptdata,C=this.hls;if(this.fragContextChanged(L))return;if(S&&S.byteLength>0&&R&&R.key&&R.iv&&R.method==="AES-128"){var f=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(S),R.key.buffer,R.iv.buffer).then(function(w){var y=performance.now();C.trigger($.Events.FRAG_DECRYPTED,{frag:L,payload:w,stats:{tstart:f,tdecrypt:y}})})}},E.doTick=function(){if(!this.media){this.state=v.State.IDLE;return}if(this.state===v.State.IDLE){var k,L=this.currentTrackId,S=this.levels;if(!S.length||!S[L]||!S[L].details)return;var R=S[L].details,C=R.targetduration,f=this.config,w=this.media,y=M.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,w.currentTime-C,f.maxBufferHole),_=y.end,j=y.len,U=this.getMaxBufferLength()+C;if(j>U)return;console.assert(R,"Subtitle track details are defined on idle subtitle stream controller tick");var x=R.fragments,F=x.length,D=R.edge,g,W=this.fragPrevious;if(_<D){var J=f.maxFragLookUpTolerance;W&&R.hasProgramDateTime&&(g=Object(K.findFragmentByPDT)(x,W.endProgramDateTime,J)),g||(g=Object(K.findFragmentByPTS)(W,x,_,J),!g&&W&&W.start<x[0].start&&(g=x[0]))}else g=x[F-1];(k=g)!==null&&k!==void 0&&k.encrypted?(H.logger.log("Loading key for "+g.sn),this.state=v.State.KEY_LOADING,this.hls.trigger($.Events.KEY_LOADING,{frag:g})):g&&this.fragmentTracker.getState(g)===O.FragmentState.NOT_LOADED&&this.loadFragment(g,R,_)}},E.loadFragment=function(k,L,S){this.fragCurrent=k,a.prototype.loadFragment.call(this,k,L,S)},l(A,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),A}(v.default)},"./src/controller/subtitle-track-controller.ts":function(le,Y,N){"use strict";N.r(Y);var $=N("./src/events.ts"),H=N("./src/utils/texttrack-utils.ts"),M=N("./src/controller/base-playlist-controller.ts"),K=N("./src/types/loader.ts");function G(u,l){for(var d=0;d<l.length;d++){var o=l[d];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(u,o.key,o)}}function n(u,l,d){return l&&G(u.prototype,l),d&&G(u,d),u}function O(u,l){u.prototype=Object.create(l.prototype),u.prototype.constructor=u,v(u,l)}function v(u,l){return v=Object.setPrototypeOf||function(o,h){return o.__proto__=h,o},v(u,l)}var p=function(u){O(l,u);function l(o){var h;return h=u.call(this,o,"[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 d=l.prototype;return d.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,u.prototype.destroy.call(this)},d.registerListeners=function(){var h=this.hls;h.on($.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.on($.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.on($.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.on($.Events.MANIFEST_PARSED,this.onManifestParsed,this),h.on($.Events.LEVEL_LOADING,this.onLevelLoading,this),h.on($.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),h.on($.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),h.on($.Events.ERROR,this.onError,this)},d.unregisterListeners=function(){var h=this.hls;h.off($.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.off($.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.off($.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.off($.Events.MANIFEST_PARSED,this.onManifestParsed,this),h.off($.Events.LEVEL_LOADING,this.onLevelLoading,this),h.off($.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),h.off($.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),h.off($.Events.ERROR,this.onError,this)},d.onMediaAttached=function(h,s){if(this.media=s.media,!this.media)return;this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange)},d.pollTrackChange=function(h){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,h)},d.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(s){Object(H.clearCurrentCues)(s)}),this.subtitleTrack=-1,this.media=null},d.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},d.onManifestParsed=function(h,s){this.tracks=s.subtitleTracks},d.onSubtitleTrackLoaded=function(h,s){var a=s.id,A=s.details,E=this.trackId,T=this.tracksInGroup[E];if(!T){this.warn("Invalid subtitle track id "+a);return}var k=T.details;T.details=s.details,this.log("subtitle track "+a+" loaded ["+A.startSN+"-"+A.endSN+"]"),a===this.trackId&&(this.retryCount=0,this.playlistLoaded(a,s,k))},d.onLevelLoading=function(h,s){this.switchLevel(s.level)},d.onLevelSwitching=function(h,s){this.switchLevel(s.level)},d.switchLevel=function(h){var s=this.hls.levels[h];if(!(s!=null&&s.textGroupIds))return;var a=s.textGroupIds[s.urlId];if(this.groupId!==a){var A=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,E=this.tracks.filter(function(L){return!a||L.groupId===a});this.tracksInGroup=E;var T=this.findTrackId(A==null?void 0:A.name)||this.findTrackId();this.groupId=a;var k={subtitleTracks:E};this.log("Updating subtitle tracks, "+E.length+' track(s) found in "'+a+'" group-id'),this.hls.trigger($.Events.SUBTITLE_TRACKS_UPDATED,k),T!==-1&&this.setSubtitleTrack(T,A)}},d.findTrackId=function(h){for(var s=this.tracksInGroup,a=0;a<s.length;a++){var A=s[a];if((!this.selectDefaultTrack||A.default)&&(!h||h===A.name))return A.id}return-1},d.onError=function(h,s){if(u.prototype.onError.call(this,h,s),s.fatal||!s.context)return;s.context.type===K.PlaylistContextType.SUBTITLE_TRACK&&s.context.id===this.trackId&&s.context.groupId===this.groupId&&this.retryLoadingOrFail(s)},d.loadPlaylist=function(h){var s=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(s)){var a=s.id,A=s.groupId,E=s.url;if(h)try{E=h.addDirectives(E)}catch(T){this.warn("Could not construct new URL with HLS Delivery Directives: "+T)}this.log("Loading subtitle playlist for id "+a),this.hls.trigger($.Events.SUBTITLE_TRACK_LOADING,{url:E,id:a,groupId:A,deliveryDirectives:h||null})}},d.toggleTrackModes=function(h){var s=this,a=this.media,A=this.subtitleDisplay,E=this.trackId;if(!a)return;var T=m(a.textTracks),k=T.filter(function(R){return R.groupId===s.groupId});if(h===-1)[].slice.call(T).forEach(function(R){R.mode="disabled"});else{var L=k[E];L&&(L.mode="disabled")}var S=k[h];S&&(S.mode=A?"showing":"hidden")},d.setSubtitleTrack=function(h,s){var a,A=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=h;return}if(this.trackId!==h&&this.toggleTrackModes(h),this.trackId===h&&(h===-1||(a=A[h])!==null&&a!==void 0&&a.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 T=E.id,k=E.groupId,L=k===void 0?"":k,S=E.name,R=E.type,C=E.url;this.hls.trigger($.Events.SUBTITLE_TRACK_SWITCH,{id:T,groupId:L,name:S,type:R,url:C});var f=this.switchParams(E.url,s==null?void 0:s.details);this.loadPlaylist(f)}else this.hls.trigger($.Events.SUBTITLE_TRACK_SWITCH,{id:h})},d.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var h=-1,s=m(this.media.textTracks),a=0;a<s.length;a++)if(s[a].mode==="hidden")h=a;else if(s[a].mode==="showing"){h=a;break}this.subtitleTrack!==h&&(this.subtitleTrack=h)},n(l,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(h){this.selectDefaultTrack=!1;var s=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(h,s)}}]),l}(M.default);function m(u){for(var l=[],d=0;d<u.length;d++){var o=u[d];o.kind==="subtitles"&&o.label&&l.push(u[d])}return l}Y.default=p},"./src/controller/timeline-controller.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"TimelineController",function(){return m});var $=N("./src/polyfills/number.ts"),H=N("./src/events.ts"),M=N("./src/utils/cea-608-parser.ts"),K=N("./src/utils/output-filter.ts"),G=N("./src/utils/webvtt-parser.ts"),n=N("./src/utils/texttrack-utils.ts"),O=N("./src/utils/imsc1-ttml-parser.ts"),v=N("./src/types/loader.ts"),p=N("./src/utils/logger.ts"),m=function(){function o(s){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.timescale=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=d(),this.captionsProperties=void 0,this.hls=s,this.config=s.config,this.Cues=s.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){var a=new K.default(this,"textTrack1"),A=new K.default(this,"textTrack2"),E=new K.default(this,"textTrack3"),T=new K.default(this,"textTrack4");this.cea608Parser1=new M.default(1,a,A),this.cea608Parser2=new M.default(3,E,T)}s.on(H.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),s.on(H.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.on(H.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(H.Events.MANIFEST_LOADED,this.onManifestLoaded,this),s.on(H.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),s.on(H.Events.FRAG_LOADING,this.onFragLoading,this),s.on(H.Events.FRAG_LOADED,this.onFragLoaded,this),s.on(H.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),s.on(H.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),s.on(H.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),s.on(H.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),s.on(H.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var h=o.prototype;return h.destroy=function(){var a=this.hls;a.off(H.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),a.off(H.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.off(H.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.off(H.Events.MANIFEST_LOADED,this.onManifestLoaded,this),a.off(H.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),a.off(H.Events.FRAG_LOADING,this.onFragLoading,this),a.off(H.Events.FRAG_LOADED,this.onFragLoaded,this),a.off(H.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),a.off(H.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),a.off(H.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),a.off(H.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),a.off(H.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},h.addCues=function(a,A,E,T,k){for(var L=!1,S=k.length;S--;){var R=k[S],C=l(R[0],R[1],A,E);if(C>=0&&(R[0]=Math.min(R[0],A),R[1]=Math.max(R[1],E),L=!0,C/(E-A)>.5))return}if(L||k.push([A,E]),this.config.renderTextTracksNatively){var f=this.captionsTracks[a];this.Cues.newCue(f,A,E,T)}else{var w=this.Cues.newCue(null,A,E,T);this.hls.trigger(H.Events.CUES_PARSED,{type:"captions",cues:w,track:a})}},h.onInitPtsFound=function(a,A){var E=this,T=A.frag,k=A.id,L=A.initPTS,S=A.timescale,R=this.unparsedVttFrags;k==="main"&&(this.initPTS[T.cc]=L,this.timescale[T.cc]=S),R.length&&(this.unparsedVttFrags=[],R.forEach(function(C){E.onFragLoaded(H.Events.FRAG_LOADED,C)}))},h.getExistingTrack=function(a){var A=this.media;if(A)for(var E=0;E<A.textTracks.length;E++){var T=A.textTracks[E];if(T[a])return T}return null},h.createCaptionsTrack=function(a){this.config.renderTextTracksNatively?this.createNativeTrack(a):this.createNonNativeTrack(a)},h.createNativeTrack=function(a){if(this.captionsTracks[a])return;var A=this.captionsProperties,E=this.captionsTracks,T=this.media,k=A[a],L=k.label,S=k.languageCode,R=this.getExistingTrack(a);if(R)E[a]=R,Object(n.clearCurrentCues)(E[a]),Object(n.sendAddTrackEvent)(E[a],T);else{var C=this.createTextTrack("captions",L,S);C&&(C[a]=!0,E[a]=C)}},h.createNonNativeTrack=function(a){if(this.nonNativeCaptionsTracks[a])return;var A=this.captionsProperties[a];if(!A)return;var E=A.label,T={_id:a,label:E,kind:"captions",default:A.media?!!A.media.default:!1,closedCaptions:A.media};this.nonNativeCaptionsTracks[a]=T,this.hls.trigger(H.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[T]})},h.createTextTrack=function(a,A,E){var T=this.media;return T?T.addTextTrack(a,A,E):void 0},h.onMediaAttaching=function(a,A){this.media=A.media,this._cleanTracks()},h.onMediaDetaching=function(){var a=this.captionsTracks;Object.keys(a).forEach(function(A){Object(n.clearCurrentCues)(a[A]),delete a[A]}),this.nonNativeCaptionsTracks={}},h.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=d(),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 a=this.media;if(!a)return;var A=a.textTracks;if(A)for(var E=0;E<A.length;E++)Object(n.clearCurrentCues)(A[E])},h.onSubtitleTracksUpdated=function(a,A){var E=this;this.textTracks=[];var T=A.subtitleTracks||[],k=T.some(function(C){return C.textCodec===O.IMSC1_CODEC});if(this.config.enableWebVTT||k&&this.config.enableIMSC1){var L=this.tracks&&T&&this.tracks.length===T.length;if(this.tracks=T||[],this.config.renderTextTracksNatively){var S=this.media?this.media.textTracks:[];this.tracks.forEach(function(C,f){var w;if(f<S.length){for(var y=null,_=0;_<S.length;_++)if(u(S[_],C)){y=S[_];break}y&&(w=y)}w?Object(n.clearCurrentCues)(w):(w=E.createTextTrack("subtitles",C.name,C.lang),w&&(w.mode="disabled")),w&&(w.groupId=C.groupId,E.textTracks.push(w))})}else if(!L&&this.tracks&&this.tracks.length){var R=this.tracks.map(function(C){return{label:C.name,kind:C.type.toLowerCase(),default:C.default,subtitleTrack:C}});this.hls.trigger(H.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:R})}}},h.onManifestLoaded=function(a,A){var E=this;this.config.enableCEA708Captions&&A.captions&&A.captions.forEach(function(T){var k=/(?:CC|SERVICE)([1-4])/.exec(T.instreamId);if(!k)return;var L="textTrack"+k[1],S=E.captionsProperties[L];if(!S)return;S.label=T.name,T.lang&&(S.languageCode=T.lang),S.media=T})},h.onFragLoading=function(a,A){var E=this.cea608Parser1,T=this.cea608Parser2,k=this.lastSn,L=this.lastPartIndex;if(!this.enabled||!(E&&T))return;if(A.frag.type===v.PlaylistLevelType.MAIN){var S,R,C=A.frag.sn,f=(S=A==null||((R=A.part)===null||R===void 0)?void 0:R.index)!=null?S:-1;C===k+1||C===k&&f===L+1||(E.reset(),T.reset()),this.lastSn=C,this.lastPartIndex=f}},h.onFragLoaded=function(a,A){var E=A.frag,T=A.payload,k=this.initPTS,L=this.unparsedVttFrags;if(E.type===v.PlaylistLevelType.SUBTITLE)if(T.byteLength){if(!Object($.isFiniteNumber)(k[E.cc])){L.push(A),k.length&&this.hls.trigger(H.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:E,error:new Error("Missing initial subtitle PTS")});return}var S=E.decryptdata;if(S==null||S.key==null||S.method!=="AES-128"){var R=this.tracks[E.level],C=this.vttCCs;C[E.cc]||(C[E.cc]={start:E.start,prevCC:this.prevCC,new:!0},this.prevCC=E.cc),R&&R.textCodec===O.IMSC1_CODEC?this._parseIMSC1(E,T):this._parseVTTs(E,T,C)}}else this.hls.trigger(H.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:E,error:new Error("Empty subtitle payload")})},h._parseIMSC1=function(a,A){var E=this,T=this.hls;Object(O.parseIMSC1)(A,this.initPTS[a.cc],this.timescale[a.cc],function(k){E._appendCues(k,a.level),T.trigger(H.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:a})},function(k){p.logger.log("Failed to parse IMSC1: "+k),T.trigger(H.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:a,error:k})})},h._parseVTTs=function(a,A,E){var T=this,k=this.hls;Object(G.parseWebVTT)(A,this.initPTS[a.cc],this.timescale[a.cc],E,a.cc,a.start,function(L){T._appendCues(L,a.level),k.trigger(H.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:a})},function(L){T._fallbackToIMSC1(a,A),p.logger.log("Failed to parse VTT cue: "+L),k.trigger(H.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:a,error:L})})},h._fallbackToIMSC1=function(a,A){var E=this,T=this.tracks[a.level];T.textCodec||Object(O.parseIMSC1)(A,this.initPTS[a.cc],this.timescale[a.cc],function(){T.textCodec=O.IMSC1_CODEC,E._parseIMSC1(a,A)},function(){T.textCodec="wvtt"})},h._appendCues=function(a,A){var E=this.hls;if(this.config.renderTextTracksNatively){var T=this.textTracks[A];if(T.mode==="disabled")return;a.forEach(function(S){return Object(n.addCueToTrack)(T,S)})}else{var k=this.tracks[A],L=k.default?"default":"subtitles"+A;E.trigger(H.Events.CUES_PARSED,{type:"subtitles",cues:a,track:L})}},h.onFragDecrypted=function(a,A){var E=A.frag;if(E.type===v.PlaylistLevelType.SUBTITLE){if(!Object($.isFiniteNumber)(this.initPTS[E.cc])){this.unparsedVttFrags.push(A);return}this.onFragLoaded(H.Events.FRAG_LOADED,A)}},h.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},h.onFragParsingUserdata=function(a,A){var E=this.cea608Parser1,T=this.cea608Parser2;if(!this.enabled||!(E&&T))return;for(var k=0;k<A.samples.length;k++){var L=A.samples[k].bytes;if(L){var S=this.extractCea608Data(L);E.addData(A.samples[k].pts,S[0]),T.addData(A.samples[k].pts,S[1])}}},h.onBufferFlushing=function(a,A){var E=A.startOffset,T=A.endOffset,k=A.endOffsetSubtitles,L=A.type,S=this.media;if(!S||S.currentTime<T)return;if(!L||L==="video"){var R=this.captionsTracks;Object.keys(R).forEach(function(f){return Object(n.removeCuesInRange)(R[f],E,T)})}if(this.config.renderTextTracksNatively&&(E===0&&k!==void 0)){var C=this.textTracks;Object.keys(C).forEach(function(f){return Object(n.removeCuesInRange)(C[f],E,k)})}},h.extractCea608Data=function(a){for(var A=a[0]&31,E=2,T=[[],[]],k=0;k<A;k++){var L=a[E++],S=127&a[E++],R=127&a[E++],C=(4&L)!==0,f=3&L;if(S===0&&R===0)continue;C&&((f===0||f===1)&&(T[f].push(S),T[f].push(R)))}return T},o}();function u(o,h){return o&&o.label===h.name&&!(o.textTrack1||o.textTrack2)}function l(o,h,s,a){return Math.min(h,a)-Math.max(o,s)}function d(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return $});var $=function(){function H(K,G){this.subtle=void 0,this.aesIV=void 0,this.subtle=K,this.aesIV=G}var M=H.prototype;return M.decrypt=function(G,n){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},n,G)},H}()},"./src/crypt/aes-decryptor.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"removePadding",function(){return H}),N.d(Y,"default",function(){return M});var $=N("./src/utils/typed-array.ts");function H(K){var G=K.byteLength,n=G&&new DataView(K.buffer).getUint8(G-1);return n?Object($.sliceUint8)(K,0,G-n):K}var M=function(){function K(){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 G=K.prototype;return G.uint8ArrayToUint32Array_=function(O){for(var v=new DataView(O),p=new Uint32Array(4),m=0;m<4;m++)p[m]=v.getUint32(m*4);return p},G.initTable=function(){var O=this.sBox,v=this.invSBox,p=this.subMix,m=p[0],u=p[1],l=p[2],d=p[3],o=this.invSubMix,h=o[0],s=o[1],a=o[2],A=o[3],E=new Uint32Array(256),T=0,k=0,L=0;for(L=0;L<256;L++)L<128?E[L]=L<<1:E[L]=L<<1^283;for(L=0;L<256;L++){var S=k^k<<1^k<<2^k<<3^k<<4;S=S>>>8^S&255^99,O[T]=S,v[S]=T;var R=E[T],C=E[R],f=E[C],w=E[S]*257^S*16843008;m[T]=w<<24|w>>>8,u[T]=w<<16|w>>>16,l[T]=w<<8|w>>>24,d[T]=w,w=f*16843009^C*65537^R*257^T*16843008,h[S]=w<<24|w>>>8,s[S]=w<<16|w>>>16,a[S]=w<<8|w>>>24,A[S]=w,T?(T=R^E[E[E[f^R]]],k^=E[E[k]]):T=k=1}},G.expandKey=function(O){for(var v=this.uint8ArrayToUint32Array_(O),p=!0,m=0;m<v.length&&p;)p=v[m]===this.key[m],m++;if(p)return;this.key=v;var u=this.keySize=v.length;if(u!==4&&u!==6&&u!==8)throw new Error("Invalid aes key size="+u);var l=this.ksRows=(u+6+1)*4,d,o,h=this.keySchedule=new Uint32Array(l),s=this.invKeySchedule=new Uint32Array(l),a=this.sBox,A=this.rcon,E=this.invSubMix,T=E[0],k=E[1],L=E[2],S=E[3],R,C;for(d=0;d<l;d++){if(d<u){R=h[d]=v[d];continue}C=R,d%u===0?(C=C<<8|C>>>24,C=a[C>>>24]<<24|a[C>>>16&255]<<16|a[C>>>8&255]<<8|a[C&255],C^=A[d/u|0]<<24):u>6&&d%u===4&&(C=a[C>>>24]<<24|a[C>>>16&255]<<16|a[C>>>8&255]<<8|a[C&255]),h[d]=R=(h[d-u]^C)>>>0}for(o=0;o<l;o++)d=l-o,o&3?C=h[d]:C=h[d-4],o<4||d<=4?s[o]=C:s[o]=T[a[C>>>24]]^k[a[C>>>16&255]]^L[a[C>>>8&255]]^S[a[C&255]],s[o]=s[o]>>>0},G.networkToHostOrderSwap=function(O){return O<<24|(O&65280)<<8|(O&16711680)>>8|O>>>24},G.decrypt=function(O,v,p){for(var m=this.keySize+6,u=this.invKeySchedule,l=this.invSBox,d=this.invSubMix,o=d[0],h=d[1],s=d[2],a=d[3],A=this.uint8ArrayToUint32Array_(p),E=A[0],T=A[1],k=A[2],L=A[3],S=new Int32Array(O),R=new Int32Array(S.length),C,f,w,y,_,j,U,x,F,D,g,W,J,oe,fe=this.networkToHostOrderSwap;v<S.length;){for(F=fe(S[v]),D=fe(S[v+1]),g=fe(S[v+2]),W=fe(S[v+3]),_=F^u[0],j=W^u[1],U=g^u[2],x=D^u[3],J=4,oe=1;oe<m;oe++)C=o[_>>>24]^h[j>>16&255]^s[U>>8&255]^a[x&255]^u[J],f=o[j>>>24]^h[U>>16&255]^s[x>>8&255]^a[_&255]^u[J+1],w=o[U>>>24]^h[x>>16&255]^s[_>>8&255]^a[j&255]^u[J+2],y=o[x>>>24]^h[_>>16&255]^s[j>>8&255]^a[U&255]^u[J+3],_=C,j=f,U=w,x=y,J=J+4;C=l[_>>>24]<<24^l[j>>16&255]<<16^l[U>>8&255]<<8^l[x&255]^u[J],f=l[j>>>24]<<24^l[U>>16&255]<<16^l[x>>8&255]<<8^l[_&255]^u[J+1],w=l[U>>>24]<<24^l[x>>16&255]<<16^l[_>>8&255]<<8^l[j&255]^u[J+2],y=l[x>>>24]<<24^l[_>>16&255]<<16^l[j>>8&255]<<8^l[U&255]^u[J+3],R[v]=fe(C^E),R[v+1]=fe(y^T),R[v+2]=fe(w^k),R[v+3]=fe(f^L),E=F,T=D,k=g,L=W,v=v+4}return R.buffer},K}()},"./src/crypt/decrypter.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return v});var $=N("./src/crypt/aes-crypto.ts"),H=N("./src/crypt/fast-aes-key.ts"),M=N("./src/crypt/aes-decryptor.ts"),K=N("./src/utils/logger.ts"),G=N("./src/utils/mp4-tools.ts"),n=N("./src/utils/typed-array.ts"),O=16,v=function(){function p(u,l,d){var o=d===void 0?{}:d,h=o.removePKCS7Padding,s=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=l,this.removePKCS7Padding=s,s)try{var a=self.crypto;a&&(this.subtle=a.subtle||a.webkitSubtle)}catch(A){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var m=p.prototype;return m.destroy=function(){this.observer=null},m.isSync=function(){return this.config.enableSoftwareAES},m.flush=function(){var l=this.currentResult;if(!l){this.reset();return}var d=new Uint8Array(l);return this.reset(),this.removePKCS7Padding?Object(M.removePadding)(d):d},m.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},m.decrypt=function(l,d,o,h){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(l),d,o);var s=this.flush();s&&h(s.buffer)}else this.webCryptoDecrypt(new Uint8Array(l),d,o).then(h)},m.softwareDecrypt=function(l,d,o){var h=this.currentIV,s=this.currentResult,a=this.remainderData;this.logOnce("JS AES decrypt"),a&&(l=Object(G.appendUint8Array)(a,l),this.remainderData=null);var A=this.getValidChunk(l);if(!A.length)return null;h&&(o=h);var E=this.softwareDecrypter;E||(E=this.softwareDecrypter=new M.default),E.expandKey(d);var T=s;return this.currentResult=E.decrypt(A.buffer,0,o),this.currentIV=Object(n.sliceUint8)(A,-16).buffer,T||null},m.webCryptoDecrypt=function(l,d,o){var h=this,s=this.subtle;return(this.key!==d||!this.fastAesKey)&&(this.key=d,this.fastAesKey=new H.default(s,d)),this.fastAesKey.expandKey().then(function(a){if(!s)return Promise.reject(new Error("web crypto not initialized"));var A=new $.default(s,o);return A.decrypt(l.buffer,a)}).catch(function(a){return h.onWebCryptoError(a,l,d,o)})},m.onWebCryptoError=function(l,d,o,h){return K.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",l),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(d,o,h)},m.getValidChunk=function(l){var d=l,o=l.length-l.length%O;return o!==l.length&&(d=Object(n.sliceUint8)(l,0,o),this.remainderData=Object(n.sliceUint8)(l,o)),d},m.logOnce=function(l){if(!this.logEnabled)return;K.logger.log("[decrypter.ts]: "+l),this.logEnabled=!1},p}()},"./src/crypt/fast-aes-key.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return $});var $=function(){function H(K,G){this.subtle=void 0,this.key=void 0,this.subtle=K,this.key=G}var M=H.prototype;return M.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},H}()},"./src/demux/aacdemuxer.ts":function(le,Y,N){"use strict";N.r(Y);var $=N("./src/demux/base-audio-demuxer.ts"),H=N("./src/demux/adts.ts"),M=N("./src/utils/logger.ts"),K=N("./src/demux/id3.ts");function G(v,p){v.prototype=Object.create(p.prototype),v.prototype.constructor=v,n(v,p)}function n(v,p){return n=Object.setPrototypeOf||function(u,l){return u.__proto__=l,u},n(v,p)}var O=function(v){G(p,v);function p(u,l){var d;return d=v.call(this)||this,d.observer=void 0,d.config=void 0,d.observer=u,d.config=l,d}var m=p.prototype;return m.resetInitSegment=function(l,d,o){v.prototype.resetInitSegment.call(this,l,d,o),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:l,duration:o,inputTimeScale:9e4,dropped:0}},p.probe=function(l){if(!l)return!1;for(var d=K.getID3Data(l,0)||[],o=d.length,h=l.length;o<h;o++)if(H.probe(l,o))return M.logger.log("ADTS sync word found !"),!0;return!1},m.canParse=function(l,d){return H.canParse(l,d)},m.appendFrame=function(l,d,o){H.initTrackConfig(l,this.observer,d,o,l.manifestCodec);var h=H.appendFrame(l,d,o,this.initPTS,this.frameIndex);if(h&&h.missing===0)return h},p}($.default);O.minProbeByteLength=9,Y.default=O},"./src/demux/adts.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"getAudioConfig",function(){return K}),N.d(Y,"isHeaderPattern",function(){return G}),N.d(Y,"getHeaderLength",function(){return n}),N.d(Y,"getFullFrameLength",function(){return O}),N.d(Y,"canGetFrameLength",function(){return v}),N.d(Y,"isHeader",function(){return p}),N.d(Y,"canParse",function(){return m}),N.d(Y,"probe",function(){return u}),N.d(Y,"initTrackConfig",function(){return l}),N.d(Y,"getFrameDuration",function(){return d}),N.d(Y,"parseFrameHeader",function(){return o}),N.d(Y,"appendFrame",function(){return h});var $=N("./src/utils/logger.ts"),H=N("./src/errors.ts"),M=N("./src/events.ts");function K(s,a,A,E){var T,k,L,S,R=navigator.userAgent.toLowerCase(),C=E,f=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];T=((a[A+2]&192)>>>6)+1;var w=(a[A+2]&60)>>>2;if(w>f.length-1){s.trigger(M.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+w});return}return L=(a[A+2]&1)<<2,L|=(a[A+3]&192)>>>6,$.logger.log("manifest codec:"+E+", ADTS type:"+T+", samplingIndex:"+w),/firefox/i.test(R)?w>=6?(T=5,S=new Array(4),k=w-3):(T=2,S=new Array(2),k=w):R.indexOf("android")!==-1?(T=2,S=new Array(2),k=w):(T=5,S=new Array(4),E&&(E.indexOf("mp4a.40.29")!==-1||E.indexOf("mp4a.40.5")!==-1)||!E&&w>=6?k=w-3:((E&&E.indexOf("mp4a.40.2")!==-1&&(w>=6&&L===1||/vivaldi/i.test(R))||!E&&L===1)&&(T=2,S=new Array(2)),k=w)),S[0]=T<<3,S[0]|=(w&14)>>1,S[1]|=(w&1)<<7,S[1]|=L<<3,T===5&&(S[1]|=(k&14)>>1,S[2]=(k&1)<<7,S[2]|=2<<2,S[3]=0),{config:S,samplerate:f[w],channelCount:L,codec:"mp4a.40."+T,manifestCodec:C}}function G(s,a){return s[a]===255&&(s[a+1]&246)===240}function n(s,a){return s[a+1]&1?7:9}function O(s,a){return(s[a+3]&3)<<11|s[a+4]<<3|(s[a+5]&224)>>>5}function v(s,a){return a+5<s.length}function p(s,a){return a+1<s.length&&G(s,a)}function m(s,a){return v(s,a)&&G(s,a)&&O(s,a)<=s.length-a}function u(s,a){if(p(s,a)){var A=n(s,a);if(a+A>=s.length)return!1;var E=O(s,a);if(E<=A)return!1;var T=a+E;return T===s.length||p(s,T)}return!1}function l(s,a,A,E,T){if(!s.samplerate){var k=K(a,A,E,T);if(!k)return;s.config=k.config,s.samplerate=k.samplerate,s.channelCount=k.channelCount,s.codec=k.codec,s.manifestCodec=k.manifestCodec,$.logger.log("parsed codec:"+s.codec+", rate:"+k.samplerate+", channels:"+k.channelCount)}}function d(s){return 1024*9e4/s}function o(s,a,A,E,T){var k=n(s,a),L=O(s,a);if(L-=k,L>0){var S=A+E*T;return{headerLength:k,frameLength:L,stamp:S}}}function h(s,a,A,E,T){var k=d(s.samplerate),L=o(a,A,E,T,k);if(L){var S=L.frameLength,R=L.headerLength,C=L.stamp,f=R+S,w=Math.max(0,A+f-a.length),y;w?(y=new Uint8Array(f-R),y.set(a.subarray(A+R,a.length),0)):y=a.subarray(A+R,A+f);var _={unit:y,pts:C};return w||s.samples.push(_),{sample:_,length:f,missing:w}}}},"./src/demux/base-audio-demuxer.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"initPTSFn",function(){return O});var $=N("./src/polyfills/number.ts"),H=N("./src/demux/id3.ts"),M=N("./src/demux/dummy-demuxed-track.ts"),K=N("./src/utils/mp4-tools.ts"),G=N("./src/utils/typed-array.ts"),n=function(){function v(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var p=v.prototype;return p.resetInitSegment=function(u,l,d){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,l){return!1},p.appendFrame=function(u,l,d){},p.demux=function(u,l){this.cachedData&&(u=Object(K.appendUint8Array)(this.cachedData,u),this.cachedData=null);var d=H.getID3Data(u,0),o=d?d.length:0,h,s,a=this._audioTrack,A=this._id3Track,E=d?H.getTimeStamp(d):void 0,T=u.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=O(E,l)),d&&d.length>0&&A.samples.push({pts:this.initPTS,dts:this.initPTS,data:d}),s=this.initPTS;o<T;){if(this.canParse(u,o)){var k=this.appendFrame(a,u,o);k?(this.frameIndex++,s=k.sample.pts,o+=k.length,h=o):o=T}else H.canParse(u,o)?(d=H.getID3Data(u,o),A.samples.push({pts:s,dts:s,data:d}),o+=d.length,h=o):o++;if(o===T&&h!==T){var L=Object(G.sliceUint8)(u,h);this.cachedData?this.cachedData=Object(K.appendUint8Array)(this.cachedData,L):this.cachedData=L}}return{audioTrack:a,avcTrack:Object(M.dummyTrack)(),id3Track:A,textTrack:Object(M.dummyTrack)()}},p.demuxSampleAes=function(u,l,d){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},p.flush=function(u){var l=this.cachedData;return l&&(this.cachedData=null,this.demux(l,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(M.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(M.dummyTrack)()}},p.destroy=function(){},v}(),O=function(p,m){return Object($.isFiniteNumber)(p)?p*90:m*9e4};Y.default=n},"./src/demux/chunk-cache.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return $});var $=function(){function M(){this.chunks=[],this.dataLength=0}var K=M.prototype;return K.push=function(n){this.chunks.push(n),this.dataLength+=n.length},K.flush=function(){var n=this.chunks,O=this.dataLength,v;if(n.length)n.length===1?v=n[0]:v=H(n,O);else return new Uint8Array(0);return this.reset(),v},K.reset=function(){this.chunks.length=0,this.dataLength=0},M}();function H(M,K){for(var G=new Uint8Array(K),n=0,O=0;O<M.length;O++){var v=M[O];G.set(v,n),n+=v.length}return G}},"./src/demux/dummy-demuxed-track.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"dummyTrack",function(){return $});function $(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(le,Y,N){"use strict";N.r(Y);var $=N("./src/utils/logger.ts"),H=function(){function M(G){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=G,this.bytesAvailable=G.byteLength,this.word=0,this.bitsAvailable=0}var K=M.prototype;return K.loadWord=function(){var n=this.data,O=this.bytesAvailable,v=n.byteLength-O,p=new Uint8Array(4),m=Math.min(4,O);if(m===0)throw new Error("no bytes available");p.set(n.subarray(v,v+m)),this.word=new DataView(p.buffer).getUint32(0),this.bitsAvailable=m*8,this.bytesAvailable-=m},K.skipBits=function(n){var O;this.bitsAvailable>n?(this.word<<=n,this.bitsAvailable-=n):(n-=this.bitsAvailable,O=n>>3,n-=O>>3,this.bytesAvailable-=O,this.loadWord(),this.word<<=n,this.bitsAvailable-=n)},K.readBits=function(n){var O=Math.min(this.bitsAvailable,n),v=this.word>>>32-O;return n>32&&$.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=O,this.bitsAvailable>0?this.word<<=O:this.bytesAvailable>0&&this.loadWord(),O=n-O,O>0&&this.bitsAvailable?v<<O|this.readBits(O):v},K.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()},K.skipUEG=function(){this.skipBits(1+this.skipLZ())},K.skipEG=function(){this.skipBits(1+this.skipLZ())},K.readUEG=function(){var n=this.skipLZ();return this.readBits(n+1)-1},K.readEG=function(){var n=this.readUEG();return 1&n?1+n>>>1:-1*(n>>>1)},K.readBoolean=function(){return this.readBits(1)===1},K.readUByte=function(){return this.readBits(8)},K.readUShort=function(){return this.readBits(16)},K.readUInt=function(){return this.readBits(32)},K.skipScalingList=function(n){for(var O=8,v=8,p,m=0;m<n;m++)v!==0&&(p=this.readEG(),v=(O+p+256)%256),O=v===0?O:v},K.readSPS=function(){var n=0,O=0,v=0,p=0,m,u,l,d=this.readUByte.bind(this),o=this.readBits.bind(this),h=this.readUEG.bind(this),s=this.readBoolean.bind(this),a=this.skipBits.bind(this),A=this.skipEG.bind(this),E=this.skipUEG.bind(this),T=this.skipScalingList.bind(this);d();var k=d();if(o(5),a(3),d(),E(),k===100||k===110||k===122||k===244||k===44||k===83||k===86||k===118||k===128){var L=h();if(L===3&&a(1),E(),E(),a(1),s())for(u=L!==3?8:12,l=0;l<u;l++)s()&&(l<6?T(16):T(64))}E();var S=h();if(S===0)h();else if(S===1)for(a(1),A(),A(),m=h(),l=0;l<m;l++)A();E(),a(1);var R=h(),C=h(),f=o(1);f===0&&a(1),a(1),s()&&(n=h(),O=h(),v=h(),p=h());var w=[1,1];if(s()&&s()){var y=d();switch(y){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=[d()<<8|d(),d()<<8|d()];break}}}return{width:Math.ceil((R+1)*16-n*2-O*2),height:(2-f)*(C+1)*16-(f?2:4)*(v+p),pixelRatio:w}},K.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},M}();Y.default=H},"./src/demux/id3.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"isHeader",function(){return $}),N.d(Y,"isFooter",function(){return H}),N.d(Y,"getID3Data",function(){return M}),N.d(Y,"canParse",function(){return G}),N.d(Y,"getTimeStamp",function(){return n}),N.d(Y,"isTimeStampFrame",function(){return O}),N.d(Y,"getID3Frames",function(){return p}),N.d(Y,"decodeFrame",function(){return m}),N.d(Y,"utf8ArrayToStr",function(){return h}),N.d(Y,"testables",function(){return s});var $=function(T,k){return k+10<=T.length&&(T[k]===73&&T[k+1]===68&&T[k+2]===51&&(T[k+3]<255&&T[k+4]<255&&(T[k+6]<128&&T[k+7]<128&&T[k+8]<128&&T[k+9]<128)))},H=function(T,k){return k+10<=T.length&&(T[k]===51&&T[k+1]===68&&T[k+2]===73&&(T[k+3]<255&&T[k+4]<255&&(T[k+6]<128&&T[k+7]<128&&T[k+8]<128&&T[k+9]<128)))},M=function(T,k){for(var L=k,S=0;$(T,k);){S+=10;var R=K(T,k+6);S+=R,H(T,k+10)&&(S+=10),k+=S}return S>0?T.subarray(L,L+S):void 0},K=function(T,k){var L=0;return L=(T[k]&127)<<21,L|=(T[k+1]&127)<<14,L|=(T[k+2]&127)<<7,L|=T[k+3]&127,L},G=function(T,k){return $(T,k)&&K(T,k+6)+10<=T.length-k},n=function(T){for(var k=p(T),L=0;L<k.length;L++){var S=k[L];if(O(S))return o(S)}return},O=function(T){return T&&T.key==="PRIV"&&T.info==="com.apple.streaming.transportStreamTimestamp"},v=function(T){var k=String.fromCharCode(T[0],T[1],T[2],T[3]),L=K(T,4),S=10;return{type:k,size:L,data:T.subarray(S,S+L)}},p=function(T){for(var k=0,L=[];$(T,k);){var S=K(T,k+6);k+=10;for(var R=k+S;k+8<R;){var C=v(T.subarray(k)),f=m(C);f&&L.push(f),k+=C.size+10}H(T,k)&&(k+=10)}return L},m=function(T){return T.type==="PRIV"?u(T):T.type[0]==="W"?d(T):l(T)},u=function(T){if(T.size<2)return;var k=h(T.data,!0),L=new Uint8Array(T.data.subarray(k.length+1));return{key:T.type,info:k,data:L.buffer}},l=function(T){if(T.size<2)return;if(T.type==="TXXX"){var k=1,L=h(T.data.subarray(k),!0);k+=L.length+1;var S=h(T.data.subarray(k));return{key:T.type,info:L,data:S}}var R=h(T.data.subarray(1));return{key:T.type,data:R}},d=function(T){if(T.type==="WXXX"){if(T.size<2)return;var k=1,L=h(T.data.subarray(k),!0);k+=L.length+1;var S=h(T.data.subarray(k));return{key:T.type,info:L,data:S}}var R=h(T.data);return{key:T.type,data:R}},o=function(T){if(T.data.byteLength===8){var k=new Uint8Array(T.data),L=k[3]&1,S=(k[4]<<23)+(k[5]<<15)+(k[6]<<7)+k[7];return S/=45,L&&(S+=4772185884e-2),Math.round(S)}return},h=function(T,k){k===void 0&&(k=!1);var L=A();if(L){var S=L.decode(T);if(k){var R=S.indexOf("\0");return R!==-1?S.substring(0,R):S}return S.replace(/\0/g,"")}for(var C=T.length,f,w,y,_="",j=0;j<C;){if(f=T[j++],f===0&&k)return _;if(f===0||f===3)continue;switch(f>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:_+=String.fromCharCode(f);break;case 12:case 13:w=T[j++],_+=String.fromCharCode((f&31)<<6|w&63);break;case 14:w=T[j++],y=T[j++],_+=String.fromCharCode((f&15)<<12|(w&63)<<6|(y&63)<<0);break;default:}}return _},s={decodeTextFrame:l},a;function A(){return!a&&typeof self.TextDecoder!="undefined"&&(a=new self.TextDecoder("utf-8")),a}},"./src/demux/mp3demuxer.ts":function(le,Y,N){"use strict";N.r(Y);var $=N("./src/demux/base-audio-demuxer.ts"),H=N("./src/demux/id3.ts"),M=N("./src/utils/logger.ts"),K=N("./src/demux/mpegaudio.ts");function G(v,p){v.prototype=Object.create(p.prototype),v.prototype.constructor=v,n(v,p)}function n(v,p){return n=Object.setPrototypeOf||function(u,l){return u.__proto__=l,u},n(v,p)}var O=function(v){G(p,v);function p(){return v.apply(this,arguments)||this}var m=p.prototype;return m.resetInitSegment=function(l,d,o){v.prototype.resetInitSegment.call(this,l,d,o),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:l,duration:o,inputTimeScale:9e4,dropped:0}},p.probe=function(l){if(!l)return!1;for(var d=H.getID3Data(l,0)||[],o=d.length,h=l.length;o<h;o++)if(K.probe(l,o))return M.logger.log("MPEG Audio sync word found !"),!0;return!1},m.canParse=function(l,d){return K.canParse(l,d)},m.appendFrame=function(l,d,o){return this.initPTS===null?void 0:K.appendFrame(l,d,o,this.initPTS,this.frameIndex)},p}($.default);O.minProbeByteLength=4,Y.default=O},"./src/demux/mp4demuxer.ts":function(le,Y,N){"use strict";N.r(Y);var $=N("./src/utils/mp4-tools.ts"),H=N("./src/demux/dummy-demuxed-track.ts"),M=function(){function K(n,O){this.remainderData=null,this.config=void 0,this.config=O}var G=K.prototype;return G.resetTimeStamp=function(){},G.resetInitSegment=function(){},G.resetContiguity=function(){},K.probe=function(O){return Object($.findBox)({data:O,start:0,end:Math.min(O.length,16384)},["moof"]).length>0},G.demux=function(O){var v=O,p=Object(H.dummyTrack)();if(this.config.progressive){this.remainderData&&(v=Object($.appendUint8Array)(this.remainderData,O));var m=Object($.segmentValidRange)(v);this.remainderData=m.remainder,p.samples=m.valid||new Uint8Array}else p.samples=v;return{audioTrack:Object(H.dummyTrack)(),avcTrack:p,id3Track:Object(H.dummyTrack)(),textTrack:Object(H.dummyTrack)()}},G.flush=function(){var O=Object(H.dummyTrack)();return O.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(H.dummyTrack)(),avcTrack:O,id3Track:Object(H.dummyTrack)(),textTrack:Object(H.dummyTrack)()}},G.demuxSampleAes=function(O,v,p){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},G.destroy=function(){},K}();M.minProbeByteLength=1024,Y.default=M},"./src/demux/mpegaudio.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"appendFrame",function(){return n}),N.d(Y,"parseHeader",function(){return O}),N.d(Y,"isHeaderPattern",function(){return v}),N.d(Y,"isHeader",function(){return p}),N.d(Y,"canParse",function(){return m}),N.d(Y,"probe",function(){return u});var $=null,H=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],M=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],K=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],G=[0,1,1,4];function n(l,d,o,h,s){if(o+24>d.length)return;var a=O(d,o);if(a&&o+a.frameLength<=d.length){var A=a.samplesPerFrame*9e4/a.sampleRate,E=h+s*A,T={unit:d.subarray(o,o+a.frameLength),pts:E,dts:E};return l.config=[],l.channelCount=a.channelCount,l.samplerate=a.sampleRate,l.samples.push(T),{sample:T,length:a.frameLength,missing:0}}}function O(l,d){var o=l[d+1]>>3&3,h=l[d+1]>>1&3,s=l[d+2]>>4&15,a=l[d+2]>>2&3;if(o!==1&&s!==0&&s!==15&&a!==3){var A=l[d+2]>>1&1,E=l[d+3]>>6,T=o===3?3-h:h===3?3:4,k=H[T*14+s-1]*1e3,L=o===3?0:o===2?1:2,S=M[L*3+a],R=E===3?1:2,C=K[o][h],f=G[h],w=C*8*f,y=Math.floor(C*k/S+A)*f;if($===null){var _=navigator.userAgent||"",j=_.match(/Chrome\/(\d+)/i);$=j?parseInt(j[1]):0}var U=!!$&&$<=87;return U&&h===2&&k>=224e3&&E===0&&(l[d+3]=l[d+3]|128),{sampleRate:S,channelCount:R,frameLength:y,samplesPerFrame:w}}}function v(l,d){return l[d]===255&&(l[d+1]&224)===224&&(l[d+1]&6)!==0}function p(l,d){return d+1<l.length&&v(l,d)}function m(l,d){var o=4;return v(l,d)&&o<=l.length-d}function u(l,d){if(d+1<l.length&&v(l,d)){var o=4,h=O(l,d),s=o;h!=null&&h.frameLength&&(s=h.frameLength);var a=d+s;return a===l.length||p(l,a)}return!1}},"./src/demux/sample-aes.ts":function(le,Y,N){"use strict";N.r(Y);var $=N("./src/crypt/decrypter.ts"),H=N("./src/demux/tsdemuxer.ts"),M=function(){function K(n,O,v){this.keyData=void 0,this.decrypter=void 0,this.keyData=v,this.decrypter=new $.default(n,O,{removePKCS7Padding:!1})}var G=K.prototype;return G.decryptBuffer=function(O,v){this.decrypter.decrypt(O,this.keyData.key.buffer,this.keyData.iv.buffer,v)},G.decryptAacSample=function(O,v,p,m){var u=O[v].unit,l=u.subarray(16,u.length-u.length%16),d=l.buffer.slice(l.byteOffset,l.byteOffset+l.length),o=this;this.decryptBuffer(d,function(h){var s=new Uint8Array(h);u.set(s,16),m||o.decryptAacSamples(O,v+1,p)})},G.decryptAacSamples=function(O,v,p){for(;;v++){if(v>=O.length){p();return}if(O[v].unit.length<32)continue;var m=this.decrypter.isSync();if(this.decryptAacSample(O,v,p,m),!m)return}},G.getAvcEncryptedData=function(O){for(var v=Math.floor((O.length-48)/160)*16+16,p=new Int8Array(v),m=0,u=32;u<=O.length-16;u+=160,m+=16)p.set(O.subarray(u,u+16),m);return p},G.getAvcDecryptedUnit=function(O,v){for(var p=new Uint8Array(v),m=0,u=32;u<=O.length-16;u+=160,m+=16)O.set(p.subarray(m,m+16),u);return O},G.decryptAvcSample=function(O,v,p,m,u,l){var d=Object(H.discardEPB)(u.data),o=this.getAvcEncryptedData(d),h=this;this.decryptBuffer(o.buffer,function(s){u.data=h.getAvcDecryptedUnit(d,s),l||h.decryptAvcSamples(O,v,p+1,m)})},G.decryptAvcSamples=function(O,v,p,m){if(O instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;v++,p=0){if(v>=O.length){m();return}for(var u=O[v].units;!(p>=u.length);p++){var l=u[p];if(l.data.length<=48||l.type!==1&&l.type!==5)continue;var d=this.decrypter.isSync();if(this.decryptAvcSample(O,v,p,m,l,d),!d)return}}},K}();Y.default=M},"./src/demux/transmuxer-interface.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return u});var $=N("./node_modules/webworkify-webpack/index.js"),H=N.n($),M=N("./src/events.ts"),K=N("./src/demux/transmuxer.ts"),G=N("./src/utils/logger.ts"),n=N("./src/errors.ts"),O=N("./src/utils/mediasource-helper.ts"),v=N("./node_modules/eventemitter3/index.js"),p=N.n(v),m=Object(O.getMediaSource)()||{isTypeSupported:function(){return!1}},u=function(){function l(o,h,s,a){var A=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.hls=o,this.id=h,this.onTransmuxComplete=s,this.onFlush=a;var E=o.config,T=function(C,f){f=f||{},f.frag=A.frag,f.id=A.id,o.trigger(C,f)};this.observer=new v.EventEmitter,this.observer.on(M.Events.FRAG_DECRYPTED,T),this.observer.on(M.Events.ERROR,T);var k={mp4:m.isTypeSupported("video/mp4"),mpeg:m.isTypeSupported("audio/mpeg"),mp3:m.isTypeSupported('audio/mp4; codecs="mp3"')},L=navigator.vendor;if(E.enableWorker&&typeof Worker!="undefined"){G.logger.log("demuxing in webworker");var S;try{S=this.worker=$("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),S.addEventListener("message",this.onwmsg),S.onerror=function(R){o.trigger(M.Events.ERROR,{type:n.ErrorTypes.OTHER_ERROR,details:n.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(R.message+" ("+R.filename+":"+R.lineno+")")})},S.postMessage({cmd:"init",typeSupported:k,vendor:L,id:h,config:JSON.stringify(E)})}catch(R){G.logger.warn("Error in worker:",R),G.logger.error("Error while initializing DemuxerWorker, fallback to inline"),S&&self.URL.revokeObjectURL(S.objectURL),this.transmuxer=new K.default(this.observer,k,E,L,h),this.worker=null}}else this.transmuxer=new K.default(this.observer,k,E,L,h)}var d=l.prototype;return d.destroy=function(){var h=this.worker;if(h)h.removeEventListener("message",this.onwmsg),h.terminate(),this.worker=null;else{var s=this.transmuxer;s&&(s.destroy(),this.transmuxer=null)}var a=this.observer;a&&a.removeAllListeners(),this.observer=null},d.push=function(h,s,a,A,E,T,k,L,S,R){var C=this;S.transmuxing.start=self.performance.now();var f=this.transmuxer,w=this.worker,y=T?T.start:E.start,_=E.decryptdata,j=this.frag,U=!(j&&E.cc===j.cc),x=!(j&&S.level===j.level),F=j?S.sn-j.sn:-1,D=this.part?S.part-this.part.index:1,g=!x&&(F===1||F===0&&D===1),W=self.performance.now();(x||F||E.stats.parsing.start===0)&&(E.stats.parsing.start=W),T&&(D||!g)&&(T.stats.parsing.start=W);var J=new K.TransmuxState(U,g,L,x,y);if(!g||U){G.logger.log("[transmuxer-interface, "+E.type+"]: Starting new transmux session for sn: "+S.sn+" p: "+S.part+" level: "+S.level+" id: "+S.id+`
|
|
discontinuity: `+U+`
|
|
trackSwitch: `+x+`
|
|
contiguous: `+g+`
|
|
accurateTimeOffset: `+L+`
|
|
timeOffset: `+y);var oe=new K.TransmuxConfig(a,A,s,k,R);this.configureTransmuxer(oe)}if(this.frag=E,this.part=T,w)w.postMessage({cmd:"demux",data:h,decryptdata:_,chunkMeta:S,state:J},h instanceof ArrayBuffer?[h]:[]);else if(f){var fe=f.push(h,_,S,J);Object(K.isPromise)(fe)?fe.then(function(Re){C.handleTransmuxComplete(Re)}):this.handleTransmuxComplete(fe)}},d.flush=function(h){var s=this;h.transmuxing.start=self.performance.now();var a=this.transmuxer,A=this.worker;if(A)A.postMessage({cmd:"flush",chunkMeta:h});else if(a){var E=a.flush(h);Object(K.isPromise)(E)?E.then(function(T){s.handleFlushResult(T,h)}):this.handleFlushResult(E,h)}},d.handleFlushResult=function(h,s){var a=this;h.forEach(function(A){a.handleTransmuxComplete(A)}),this.onFlush(s)},d.onWorkerMessage=function(h){var s=h.data,a=this.hls;switch(s.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(s.data);break}case"flush":{this.onFlush(s.data);break}default:{s.data=s.data||{},s.data.frag=this.frag,s.data.id=this.id,a.trigger(s.event,s.data);break}}},d.configureTransmuxer=function(h){var s=this.worker,a=this.transmuxer;s?s.postMessage({cmd:"configure",config:h}):a&&a.configure(h)},d.handleTransmuxComplete=function(h){h.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(h)},l}()},"./src/demux/transmuxer-worker.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return n});var $=N("./src/demux/transmuxer.ts"),H=N("./src/events.ts"),M=N("./src/utils/logger.ts"),K=N("./node_modules/eventemitter3/index.js"),G=N.n(K);function n(u){var l=new K.EventEmitter,d=function(h,s){u.postMessage({event:h,data:s})};l.on(H.Events.FRAG_DECRYPTED,d),l.on(H.Events.ERROR,d),u.addEventListener("message",function(o){var h=o.data;switch(h.cmd){case"init":{var s=JSON.parse(h.config);u.transmuxer=new $.default(l,h.typeSupported,s,h.vendor,h.id),Object(M.enableLogs)(s.debug),d("init",null);break}case"configure":{u.transmuxer.configure(h.config);break}case"demux":{var a=u.transmuxer.push(h.data,h.decryptdata,h.chunkMeta,h.state);Object($.isPromise)(a)?a.then(function(T){O(u,T)}):O(u,a);break}case"flush":{var A=h.chunkMeta,E=u.transmuxer.flush(A);Object($.isPromise)(E)?E.then(function(T){p(u,T,A)}):p(u,E,A);break}default:break}})}function O(u,l){if(m(l.remuxResult))return;var d=[],o=l.remuxResult,h=o.audio,s=o.video;h&&v(d,h),s&&v(d,s),u.postMessage({event:"transmuxComplete",data:l},d)}function v(u,l){l.data1&&u.push(l.data1.buffer),l.data2&&u.push(l.data2.buffer)}function p(u,l,d){l.forEach(function(o){O(u,o)}),u.postMessage({event:"flush",data:d})}function m(u){return!u.audio&&!u.video&&!u.text&&!u.id3&&!u.initSegment}},"./src/demux/transmuxer.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return s}),N.d(Y,"isPromise",function(){return E}),N.d(Y,"TransmuxConfig",function(){return T}),N.d(Y,"TransmuxState",function(){return k});var $=N("./src/events.ts"),H=N("./src/errors.ts"),M=N("./src/crypt/decrypter.ts"),K=N("./src/demux/aacdemuxer.ts"),G=N("./src/demux/mp4demuxer.ts"),n=N("./src/demux/tsdemuxer.ts"),O=N("./src/demux/mp3demuxer.ts"),v=N("./src/remux/mp4-remuxer.ts"),p=N("./src/remux/passthrough-remuxer.ts"),m=N("./src/demux/chunk-cache.ts"),u=N("./src/utils/mp4-tools.ts"),l=N("./src/utils/logger.ts"),d;try{d=self.performance.now.bind(self.performance)}catch(L){l.logger.debug("Unable to use Performance API on this environment"),d=self.Date.now}var o=[{demux:n.default,remux:v.default},{demux:G.default,remux:p.default},{demux:K.default,remux:v.default},{demux:O.default,remux:v.default}],h=1024;o.forEach(function(L){var S=L.demux;h=Math.max(h,S.minProbeByteLength)});var s=function(){function L(R,C,f,w,y){this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.cache=new m.default,this.observer=R,this.typeSupported=C,this.config=f,this.vendor=w,this.id=y}var S=L.prototype;return S.configure=function(C){this.transmuxConfig=C,this.decrypter&&this.decrypter.reset()},S.push=function(C,f,w,y){var _=this,j=w.transmuxing;j.executeStart=d();var U=new Uint8Array(C),x=this.cache,F=this.config,D=this.currentTransmuxState,g=this.transmuxConfig;y&&(this.currentTransmuxState=y);var W=a(U,f);if(W&&W.method==="AES-128"){var J=this.getDecrypter();if(F.enableSoftwareAES){var oe=J.softwareDecrypt(U,W.key.buffer,W.iv.buffer);if(!oe)return j.executeEnd=d(),A(w);U=new Uint8Array(oe)}else return this.decryptionPromise=J.webCryptoDecrypt(U,W.key.buffer,W.iv.buffer).then(function(xe){var Ie=_.push(xe,null,w);return _.decryptionPromise=null,Ie}),this.decryptionPromise}var fe=y||D,Re=fe.contiguous,be=fe.discontinuity,Le=fe.trackSwitch,Ce=fe.accurateTimeOffset,Te=fe.timeOffset,ve=g.audioCodec,X=g.videoCodec,b=g.defaultInitPts,I=g.duration,B=g.initSegmentData;if((be||Le)&&this.resetInitSegment(B,ve,X,I),be&&this.resetInitialTimestamp(b),Re||this.resetContiguity(),this.needsProbing(U,be,Le)){if(x.dataLength){var Q=x.flush();U=Object(u.appendUint8Array)(Q,U)}this.configureTransmuxer(U,g)}var z=this.transmux(U,W,Te,Ce,w),he=this.currentTransmuxState;return he.contiguous=!0,he.discontinuity=!1,he.trackSwitch=!1,j.executeEnd=d(),z},S.flush=function(C){var f=this,w=C.transmuxing;w.executeStart=d();var y=this.decrypter,_=this.cache,j=this.currentTransmuxState,U=this.decryptionPromise;if(U)return U.then(function(){return f.flush(C)});var x=[],F=j.timeOffset;if(y){var D=y.flush();D&&x.push(this.push(D,null,C))}var g=_.dataLength;_.reset();var W=this.demuxer,J=this.remuxer;if(!W||!J)return g>=h&&this.observer.emit($.Events.ERROR,$.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),w.executeEnd=d(),[A(C)];var oe=W.flush(F);return E(oe)?oe.then(function(fe){return f.flushRemux(x,fe,C),x}):(this.flushRemux(x,oe,C),x)},S.flushRemux=function(C,f,w){var y=f.audioTrack,_=f.avcTrack,j=f.id3Track,U=f.textTrack,x=this.currentTransmuxState,F=x.accurateTimeOffset,D=x.timeOffset;l.logger.log("[transmuxer.ts]: Flushed fragment "+w.sn+(w.part>-1?" p: "+w.part:"")+" of level "+w.level);var g=this.remuxer.remux(y,_,j,U,D,F,!0,this.id);C.push({remuxResult:g,chunkMeta:w}),w.transmuxing.executeEnd=d()},S.resetInitialTimestamp=function(C){var f=this.demuxer,w=this.remuxer;if(!f||!w)return;f.resetTimeStamp(C),w.resetTimeStamp(C)},S.resetContiguity=function(){var C=this.demuxer,f=this.remuxer;if(!C||!f)return;C.resetContiguity(),f.resetNextTimestamp()},S.resetInitSegment=function(C,f,w,y){var _=this.demuxer,j=this.remuxer;if(!_||!j)return;_.resetInitSegment(f,w,y),j.resetInitSegment(C,f,w)},S.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},S.transmux=function(C,f,w,y,_){var j;return f&&f.method==="SAMPLE-AES"?j=this.transmuxSampleAes(C,f,w,y,_):j=this.transmuxUnencrypted(C,w,y,_),j},S.transmuxUnencrypted=function(C,f,w,y){var _=this.demuxer.demux(C,f,!1,!this.config.progressive),j=_.audioTrack,U=_.avcTrack,x=_.id3Track,F=_.textTrack,D=this.remuxer.remux(j,U,x,F,f,w,!1,this.id);return{remuxResult:D,chunkMeta:y}},S.transmuxSampleAes=function(C,f,w,y,_){var j=this;return this.demuxer.demuxSampleAes(C,f,w).then(function(U){var x=j.remuxer.remux(U.audioTrack,U.avcTrack,U.id3Track,U.textTrack,w,y,!1,j.id);return{remuxResult:x,chunkMeta:_}})},S.configureTransmuxer=function(C,f){for(var w=this.config,y=this.observer,_=this.typeSupported,j=this.vendor,U=f.audioCodec,x=f.defaultInitPts,F=f.duration,D=f.initSegmentData,g=f.videoCodec,W,J=0,oe=o.length;J<oe;J++)if(o[J].demux.probe(C)){W=o[J];break}W||(l.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),W={demux:G.default,remux:p.default});var fe=this.demuxer,Re=this.remuxer,be=W.remux,Le=W.demux;(!Re||!(Re instanceof be))&&(this.remuxer=new be(y,w,_,j)),(!fe||!(fe instanceof Le))&&(this.demuxer=new Le(y,w,_),this.probe=Le.probe),this.resetInitSegment(D,U,g,F),this.resetInitialTimestamp(x)},S.needsProbing=function(C,f,w){return!this.demuxer||!this.remuxer||f||w},S.getDecrypter=function(){var C=this.decrypter;return C||(C=this.decrypter=new M.default(this.observer,this.config)),C},L}();function a(L,S){var R=null;return L.byteLength>0&&S!=null&&S.key!=null&&S.iv!==null&&S.method!=null&&(R=S),R}var A=function(S){return{remuxResult:{},chunkMeta:S}};function E(L){return"then"in L&&L.then instanceof Function}var T=function(S,R,C,f,w){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=S,this.videoCodec=R,this.initSegmentData=C,this.duration=f,this.defaultInitPts=w},k=function(S,R,C,f,w){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=S,this.contiguous=R,this.accurateTimeOffset=C,this.trackSwitch=f,this.timeOffset=w}},"./src/demux/tsdemuxer.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"discardEPB",function(){return A});var $=N("./src/demux/adts.ts"),H=N("./src/demux/mpegaudio.ts"),M=N("./src/demux/exp-golomb.ts"),K=N("./src/demux/id3.ts"),G=N("./src/demux/sample-aes.ts"),n=N("./src/events.ts"),O=N("./src/utils/mp4-tools.ts"),v=N("./src/utils/logger.ts"),p=N("./src/errors.ts"),m={video:1,audio:2,id3:3,text:4},u=function(){function E(k,L,S){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=k,this.config=L,this.typeSupported=S}E.probe=function(L){var S=E.syncOffset(L);return S<0?!1:(S&&v.logger.warn("MPEG2-TS detected but first sync word found @ offset "+S+", junk ahead ?"),!0)},E.syncOffset=function(L){for(var S=Math.min(1e3,L.length-3*188),R=0;R<S;){if(L[R]===71&&L[R+188]===71&&L[R+2*188]===71)return R;R++}return-1},E.createTrack=function(L,S){return{container:L==="video"||L==="audio"?"video/mp2t":void 0,type:L,id:m[L],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:L==="audio"?S:void 0}};var T=E.prototype;return T.resetInitSegment=function(L,S,R){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=E.createTrack("video",R),this._audioTrack=E.createTrack("audio",R),this._id3Track=E.createTrack("id3",R),this._txtTrack=E.createTrack("text",R),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=L,this.videoCodec=S,this._duration=R},T.resetTimeStamp=function(){},T.resetContiguity=function(){var L=this._audioTrack,S=this._avcTrack,R=this._id3Track;L&&(L.pesData=null),S&&(S.pesData=null),R&&(R.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},T.demux=function(L,S,R,C){R===void 0&&(R=!1),C===void 0&&(C=!1),R||(this.sampleAes=null);var f,w=this._avcTrack,y=this._audioTrack,_=this._id3Track,j=w.pid,U=w.pesData,x=y.pid,F=_.pid,D=y.pesData,g=_.pesData,W=!1,J=this.pmtParsed,oe=this._pmtId,fe=L.length;if(this.remainderData&&(L=Object(O.appendUint8Array)(this.remainderData,L),fe=L.length,this.remainderData=null),fe<188&&!C)return this.remainderData=L,{audioTrack:y,avcTrack:w,id3Track:_,textTrack:this._txtTrack};var Re=Math.max(0,E.syncOffset(L));fe-=(fe+Re)%188,fe<L.byteLength&&!C&&(this.remainderData=new Uint8Array(L.buffer,fe,L.buffer.byteLength-fe));for(var be=Re;be<fe;be+=188)if(L[be]===71){var Le=!!(L[be+1]&64),Ce=((L[be+1]&31)<<8)+L[be+2],Te=(L[be+3]&48)>>4,ve=void 0;if(Te>1){if(ve=be+5+L[be+4],ve===be+188)continue}else ve=be+4;switch(Ce){case j:Le&&(U&&(f=h(U))&&this.parseAVCPES(f,!1),U={data:[],size:0}),U&&(U.data.push(L.subarray(ve,be+188)),U.size+=be+188-ve);break;case x:Le&&(D&&(f=h(D))&&(y.isAAC?this.parseAACPES(f):this.parseMPEGPES(f)),D={data:[],size:0}),D&&(D.data.push(L.subarray(ve,be+188)),D.size+=be+188-ve);break;case F:Le&&(g&&(f=h(g))&&this.parseID3PES(f),g={data:[],size:0}),g&&(g.data.push(L.subarray(ve,be+188)),g.size+=be+188-ve);break;case 0:Le&&(ve+=L[ve]+1),oe=this._pmtId=d(L,ve);break;case oe:{Le&&(ve+=L[ve]+1);var X=o(L,ve,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,R);j=X.avc,j>0&&(w.pid=j),x=X.audio,x>0&&(y.pid=x,y.isAAC=X.isAAC),F=X.id3,F>0&&(_.pid=F),W&&!J&&(v.logger.log("reparse from beginning"),W=!1,be=Re-188),J=this.pmtParsed=!0;break}case 17:case 8191:break;default:W=!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=U,y.pesData=D,_.pesData=g;var b={audioTrack:y,avcTrack:w,id3Track:_,textTrack:this._txtTrack};return C&&this.extractRemainingSamples(b),b},T.flush=function(){var L=this.remainderData;this.remainderData=null;var S;return L?S=this.demux(L,-1,!1,!0):S={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(S),this.sampleAes?this.decrypt(S,this.sampleAes):S},T.extractRemainingSamples=function(L){var S=L.audioTrack,R=L.avcTrack,C=L.id3Track,f=R.pesData,w=S.pesData,y=C.pesData,_;f&&(_=h(f))?(this.parseAVCPES(_,!0),R.pesData=null):R.pesData=f,w&&(_=h(w))?(S.isAAC?this.parseAACPES(_):this.parseMPEGPES(_),S.pesData=null):(w!=null&&w.size&&v.logger.log("last AAC PES packet truncated,might overlap between fragments"),S.pesData=w),y&&(_=h(y))?(this.parseID3PES(_),C.pesData=null):C.pesData=y},T.demuxSampleAes=function(L,S,R){var C=this.demux(L,R,!0,!this.config.progressive),f=this.sampleAes=new G.default(this.observer,this.config,S);return this.decrypt(C,f)},T.decrypt=function(L,S){return new Promise(function(R){var C=L.audioTrack,f=L.avcTrack;C.samples&&C.isAAC?S.decryptAacSamples(C.samples,0,function(){f.samples?S.decryptAvcSamples(f.samples,0,0,function(){R(L)}):R(L)}):f.samples&&S.decryptAvcSamples(f.samples,0,0,function(){R(L)})})},T.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},T.parseAVCPES=function(L,S){var R=this,C=this._avcTrack,f=this.parseAVCNALu(L.data),w=!1,y=this.avcSample,_,j=!1;L.data=null,y&&f.length&&!C.audFound&&(s(y,C),y=this.avcSample=l(!1,L.pts,L.dts,"")),f.forEach(function(U){switch(U.type){case 1:{_=!0,y||(y=R.avcSample=l(!0,L.pts,L.dts,"")),w&&(y.debug+="NDR "),y.frame=!0;var x=U.data;if(j&&x.length>4){var F=new M.default(x).readSliceType();(F===2||F===4||F===7||F===9)&&(y.key=!0)}break}case 5:_=!0,y||(y=R.avcSample=l(!0,L.pts,L.dts,"")),w&&(y.debug+="IDR "),y.key=!0,y.frame=!0;break;case 6:{_=!0,w&&y&&(y.debug+="SEI ");var D=new M.default(A(U.data));D.readUByte();for(var g=0,W=0,J=!1,oe=0;!J&&D.bytesAvailable>1;){g=0;do oe=D.readUByte(),g+=oe;while(oe===255);W=0;do oe=D.readUByte(),W+=oe;while(oe===255);if(g===4&&D.bytesAvailable!==0){J=!0;var fe=D.readUByte();if(fe===181){var Re=D.readUShort();if(Re===49){var be=D.readUInt();if(be===1195456820){var Le=D.readUByte();if(Le===3){for(var Ce=D.readUByte(),Te=D.readUByte(),ve=31&Ce,X=[Ce,Te],b=0;b<ve;b++)X.push(D.readUByte()),X.push(D.readUByte()),X.push(D.readUByte());a(R._txtTrack.samples,{type:3,pts:L.pts,bytes:X})}}}}}else if(g===5&&D.bytesAvailable!==0){if(J=!0,W>16){for(var I=[],B=0;B<16;B++)I.push(D.readUByte().toString(16)),(B===3||B===5||B===7||B===9)&&I.push("-");for(var Q=W-16,z=new Uint8Array(Q),he=0;he<Q;he++)z[he]=D.readUByte();a(R._txtTrack.samples,{pts:L.pts,payloadType:g,uuid:I.join(""),userData:Object(K.utf8ArrayToStr)(z),userDataBytes:z})}}else if(W<D.bytesAvailable)for(var xe=0;xe<W;xe++)D.readUByte()}break}case 7:if(_=!0,j=!0,w&&y&&(y.debug+="SPS "),!C.sps){var Ie=new M.default(U.data),ue=Ie.readSPS();C.width=ue.width,C.height=ue.height,C.pixelRatio=ue.pixelRatio,C.sps=[U.data],C.duration=R._duration;for(var me=U.data.subarray(1,4),we="avc1.",Ae=0;Ae<3;Ae++){var Ne=me[Ae].toString(16);Ne.length<2&&(Ne="0"+Ne),we+=Ne}C.codec=we}break;case 8:_=!0,w&&y&&(y.debug+="PPS "),C.pps||(C.pps=[U.data]);break;case 9:_=!1,C.audFound=!0,y&&s(y,C),y=R.avcSample=l(!1,L.pts,L.dts,w?"AUD ":"");break;case 12:_=!1;break;default:_=!1,y&&(y.debug+="unknown NAL "+U.type+" ");break}if(y&&_){var Be=y.units;Be.push(U)}}),S&&y&&(s(y,C),this.avcSample=null)},T.getLastNalUnit=function(){var L,S=this.avcSample,R;if(!S||S.units.length===0){var C=this._avcTrack.samples;S=C[C.length-1]}if((L=S)!==null&&L!==void 0&&L.units){var f=S.units;R=f[f.length-1]}return R},T.parseAVCNALu=function(L){var S=L.byteLength,R=this._avcTrack,C=R.naluState||0,f=C,w=[],y=0,_,j,U,x=-1,F=0;for(C===-1&&(x=0,F=L[0]&31,C=0,y=1);y<S;){if(_=L[y++],!C){C=_?0:1;continue}if(C===1){C=_?0:2;continue}if(!_)C=3;else if(_===1){if(x>=0){var D={data:L.subarray(x,y-C-1),type:F};w.push(D)}else{var g=this.getLastNalUnit();if(g&&(f&&y<=4-f&&(g.state&&(g.data=g.data.subarray(0,g.data.byteLength-f))),j=y-C-1,j>0)){var W=new Uint8Array(g.data.byteLength+j);W.set(g.data,0),W.set(L.subarray(0,j),g.data.byteLength),g.data=W,g.state=0}}y<S?(U=L[y]&31,x=y,F=U,C=0):C=-1}else C=0}if(x>=0&&C>=0){var J={data:L.subarray(x,S),type:F,state:C};w.push(J)}if(w.length===0){var oe=this.getLastNalUnit();if(oe){var fe=new Uint8Array(oe.data.byteLength+L.byteLength);fe.set(oe.data,0),fe.set(L,oe.data.byteLength),oe.data=fe}}return R.naluState=C,w},T.parseAACPES=function(L){var S=0,R=this._audioTrack,C=this.aacOverFlow,f=L.data;if(C){this.aacOverFlow=null;var w=C.sample.unit.byteLength,y=Math.min(C.missing,w),_=w-y;C.sample.unit.set(f.subarray(0,y),_),R.samples.push(C.sample),S=C.missing}var j,U;for(j=S,U=f.length;j<U-1&&!$.isHeader(f,j);j++);if(j!==S){var x,F;if(j<U-1?(x="AAC PES did not start with ADTS header,offset:"+j,F=!1):(x="no ADTS header found in AAC PES",F=!0),v.logger.warn("parsing error:"+x),this.observer.emit(n.Events.ERROR,n.Events.ERROR,{type:p.ErrorTypes.MEDIA_ERROR,details:p.ErrorDetails.FRAG_PARSING_ERROR,fatal:F,reason:x}),F)return}$.initTrackConfig(R,this.observer,f,j,this.audioCodec);var D;if(L.pts!==void 0)D=L.pts;else if(C){var g=$.getFrameDuration(R.samplerate);D=C.sample.pts+g}else{v.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var W=0;j<U;)if($.isHeader(f,j)){if(j+5<U){var J=$.appendFrame(R,f,j,D,W);if(J)if(J.missing)this.aacOverFlow=J;else{j+=J.length,W++;continue}}break}else j++},T.parseMPEGPES=function(L){var S=L.data,R=S.length,C=0,f=0,w=L.pts;if(w===void 0){v.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;f<R;)if(H.isHeader(S,f)){var y=H.appendFrame(this._audioTrack,S,f,w,C);if(y)f+=y.length,C++;else break}else f++},T.parseID3PES=function(L){if(L.pts===void 0){v.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(L)},E}();u.minProbeByteLength=188;function l(E,T,k,L){return{key:E,frame:!1,pts:T,dts:k,units:[],debug:L,length:0}}function d(E,T){return(E[T+10]&31)<<8|E[T+11]}function o(E,T,k,L){var S={audio:-1,avc:-1,id3:-1,isAAC:!0},R=(E[T+1]&15)<<8|E[T+2],C=T+3+R-4,f=(E[T+10]&15)<<8|E[T+11];for(T+=12+f;T<C;){var w=(E[T+1]&31)<<8|E[T+2];switch(E[T]){case 207:if(!L){v.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:S.audio===-1&&(S.audio=w);break;case 21:S.id3===-1&&(S.id3=w);break;case 219:if(!L){v.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:S.avc===-1&&(S.avc=w);break;case 3:case 4:k?S.audio===-1&&(S.audio=w,S.isAAC=!1):v.logger.log("MPEG audio found, not supported in this browser");break;case 36:v.logger.warn("Unsupported HEVC stream type found");break;default:break}T+=((E[T+3]&15)<<8|E[T+4])+5}return S}function h(E){var T=0,k,L,S,R,C,f=E.data;if(!E||E.size===0)return null;for(;f[0].length<19&&f.length>1;){var w=new Uint8Array(f[0].length+f[1].length);w.set(f[0]),w.set(f[1],f[0].length),f[0]=w,f.splice(1,1)}k=f[0];var y=(k[0]<<16)+(k[1]<<8)+k[2];if(y===1){if(L=(k[4]<<8)+k[5],L&&L>E.size-6)return null;var _=k[7];_&192&&(R=(k[9]&14)*536870912+(k[10]&255)*4194304+(k[11]&254)*16384+(k[12]&255)*128+(k[13]&254)/2,_&64?(C=(k[14]&14)*536870912+(k[15]&255)*4194304+(k[16]&254)*16384+(k[17]&255)*128+(k[18]&254)/2,R-C>60*9e4&&(v.logger.warn(Math.round((R-C)/9e4)+"s delta between PTS and DTS, align them"),R=C)):C=R),S=k[8];var j=S+9;if(E.size<=j)return null;E.size-=j;for(var U=new Uint8Array(E.size),x=0,F=f.length;x<F;x++){k=f[x];var D=k.byteLength;if(j)if(j>D){j-=D;continue}else k=k.subarray(j),D-=j,j=0;U.set(k,T),T+=D}return L&&(L-=S+3),{data:U,pts:R,dts:C,len:L}}return null}function s(E,T){if(E.units.length&&E.frame){if(E.pts===void 0){var k=T.samples,L=k.length;if(L){var S=k[L-1];E.pts=S.pts,E.dts=S.dts}else{T.dropped++;return}}T.samples.push(E)}E.debug.length&&v.logger.log(E.pts+"/"+E.dts+":"+E.debug)}function a(E,T){var k=E.length;if(k>0){if(T.pts>=E[k-1].pts)E.push(T);else for(var L=k-1;L>=0;L--)if(T.pts<E[L].pts){E.splice(L,0,T);break}}else E.push(T)}function A(E){for(var T=E.byteLength,k=[],L=1;L<T-2;)E[L]===0&&E[L+1]===0&&E[L+2]===3?(k.push(L+2),L+=2):L++;if(k.length===0)return E;var S=T-k.length,R=new Uint8Array(S),C=0;for(L=0;L<S;C++,L++)C===k[0]&&(C++,k.shift()),R[L]=E[C];return R}Y.default=u},"./src/errors.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"ErrorTypes",function(){return $}),N.d(Y,"ErrorDetails",function(){return H});var $;(function(M){M.NETWORK_ERROR="networkError",M.MEDIA_ERROR="mediaError",M.KEY_SYSTEM_ERROR="keySystemError",M.MUX_ERROR="muxError",M.OTHER_ERROR="otherError"})($||($={}));var H;(function(M){M.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",M.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",M.KEY_SYSTEM_NO_SESSION="keySystemNoSession",M.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",M.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",M.MANIFEST_LOAD_ERROR="manifestLoadError",M.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",M.MANIFEST_PARSING_ERROR="manifestParsingError",M.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",M.LEVEL_EMPTY_ERROR="levelEmptyError",M.LEVEL_LOAD_ERROR="levelLoadError",M.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",M.LEVEL_SWITCH_ERROR="levelSwitchError",M.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",M.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",M.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",M.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",M.FRAG_LOAD_ERROR="fragLoadError",M.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",M.FRAG_DECRYPT_ERROR="fragDecryptError",M.FRAG_PARSING_ERROR="fragParsingError",M.REMUX_ALLOC_ERROR="remuxAllocError",M.KEY_LOAD_ERROR="keyLoadError",M.KEY_LOAD_TIMEOUT="keyLoadTimeOut",M.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",M.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",M.BUFFER_APPEND_ERROR="bufferAppendError",M.BUFFER_APPENDING_ERROR="bufferAppendingError",M.BUFFER_STALLED_ERROR="bufferStalledError",M.BUFFER_FULL_ERROR="bufferFullError",M.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",M.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",M.INTERNAL_EXCEPTION="internalException",M.INTERNAL_ABORTED="aborted",M.UNKNOWN="unknown"})(H||(H={}))},"./src/events.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"Events",function(){return $});var $;(function(H){H.MEDIA_ATTACHING="hlsMediaAttaching",H.MEDIA_ATTACHED="hlsMediaAttached",H.MEDIA_DETACHING="hlsMediaDetaching",H.MEDIA_DETACHED="hlsMediaDetached",H.BUFFER_RESET="hlsBufferReset",H.BUFFER_CODECS="hlsBufferCodecs",H.BUFFER_CREATED="hlsBufferCreated",H.BUFFER_APPENDING="hlsBufferAppending",H.BUFFER_APPENDED="hlsBufferAppended",H.BUFFER_EOS="hlsBufferEos",H.BUFFER_FLUSHING="hlsBufferFlushing",H.BUFFER_FLUSHED="hlsBufferFlushed",H.MANIFEST_LOADING="hlsManifestLoading",H.MANIFEST_LOADED="hlsManifestLoaded",H.MANIFEST_PARSED="hlsManifestParsed",H.LEVEL_SWITCHING="hlsLevelSwitching",H.LEVEL_SWITCHED="hlsLevelSwitched",H.LEVEL_LOADING="hlsLevelLoading",H.LEVEL_LOADED="hlsLevelLoaded",H.LEVEL_UPDATED="hlsLevelUpdated",H.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",H.LEVELS_UPDATED="hlsLevelsUpdated",H.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",H.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",H.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",H.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",H.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",H.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",H.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",H.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",H.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",H.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",H.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",H.CUES_PARSED="hlsCuesParsed",H.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",H.INIT_PTS_FOUND="hlsInitPtsFound",H.FRAG_LOADING="hlsFragLoading",H.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",H.FRAG_LOADED="hlsFragLoaded",H.FRAG_DECRYPTED="hlsFragDecrypted",H.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",H.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",H.FRAG_PARSING_METADATA="hlsFragParsingMetadata",H.FRAG_PARSED="hlsFragParsed",H.FRAG_BUFFERED="hlsFragBuffered",H.FRAG_CHANGED="hlsFragChanged",H.FPS_DROP="hlsFpsDrop",H.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",H.ERROR="hlsError",H.DESTROYING="hlsDestroying",H.KEY_LOADING="hlsKeyLoading",H.KEY_LOADED="hlsKeyLoaded",H.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",H.BACK_BUFFER_REACHED="hlsBackBufferReached"})($||($={}))},"./src/hls.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return E});var $=N("./node_modules/url-toolkit/src/url-toolkit.js"),H=N.n($),M=N("./src/loader/playlist-loader.ts"),K=N("./src/loader/key-loader.ts"),G=N("./src/controller/id3-track-controller.ts"),n=N("./src/controller/latency-controller.ts"),O=N("./src/controller/level-controller.ts"),v=N("./src/controller/fragment-tracker.ts"),p=N("./src/controller/stream-controller.ts"),m=N("./src/is-supported.ts"),u=N("./src/utils/logger.ts"),l=N("./src/config.ts"),d=N("./node_modules/eventemitter3/index.js"),o=N.n(d),h=N("./src/events.ts"),s=N("./src/errors.ts");function a(T,k){for(var L=0;L<k.length;L++){var S=k[L];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(T,S.key,S)}}function A(T,k,L){return k&&a(T.prototype,k),L&&a(T,L),T}var E=function(){T.isSupported=function(){return Object(m.isSupported)()};function T(L){L===void 0&&(L={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new d.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 S=this.config=Object(l.mergeConfig)(T.DefaultConfig,L);this.userConfig=L,Object(u.enableLogs)(S.debug),this._autoLevelCapping=-1,S.progressive&&Object(l.enableStreamingMode)(S);var R=S.abrController,C=S.bufferController,f=S.capLevelController,w=S.fpsController,y=this.abrController=new R(this),_=this.bufferController=new C(this),j=this.capLevelController=new f(this),U=new w(this),x=new M.default(this),F=new K.default(this),D=new G.default(this),g=this.levelController=new O.default(this),W=new v.FragmentTracker(this),J=this.streamController=new p.default(this,W);j.setStreamController(J),U.setStreamController(J);var oe=[g,J];this.networkControllers=oe;var fe=[x,F,y,_,j,U,D,W];this.audioTrackController=this.createController(S.audioTrackController,null,oe),this.createController(S.audioStreamController,W,oe),this.subtitleTrackController=this.createController(S.subtitleTrackController,null,oe),this.createController(S.subtitleStreamController,W,oe),this.createController(S.timelineController,null,fe),this.emeController=this.createController(S.emeController,null,fe),this.cmcdController=this.createController(S.cmcdController,null,fe),this.latencyController=this.createController(n.default,null,fe),this.coreComponents=fe}var k=T.prototype;return k.createController=function(S,R,C){if(S){var f=R?new S(this,R):new S(this);return C&&C.push(f),f}return null},k.on=function(S,R,C){C===void 0&&(C=this),this._emitter.on(S,R,C)},k.once=function(S,R,C){C===void 0&&(C=this),this._emitter.once(S,R,C)},k.removeAllListeners=function(S){this._emitter.removeAllListeners(S)},k.off=function(S,R,C,f){C===void 0&&(C=this),this._emitter.off(S,R,C,f)},k.listeners=function(S){return this._emitter.listeners(S)},k.emit=function(S,R,C){return this._emitter.emit(S,R,C)},k.trigger=function(S,R){if(this.config.debug)return this.emit(S,S,R);try{return this.emit(S,S,R)}catch(C){u.logger.error("An internal error happened while handling event "+S+'. Error message: "'+C.message+'". Here is a stacktrace:',C),this.trigger(h.Events.ERROR,{type:s.ErrorTypes.OTHER_ERROR,details:s.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:S,error:C})}return!1},k.listenerCount=function(S){return this._emitter.listenerCount(S)},k.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(S){return S.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(S){return S.destroy()}),this.coreComponents.length=0},k.attachMedia=function(S){u.logger.log("attachMedia"),this._media=S,this.trigger(h.Events.MEDIA_ATTACHING,{media:S})},k.detachMedia=function(){u.logger.log("detachMedia"),this.trigger(h.Events.MEDIA_DETACHING,void 0),this._media=null},k.loadSource=function(S){this.stopLoad();var R=this.media,C=this.url,f=this.url=$.buildAbsoluteURL(self.location.href,S,{alwaysNormalize:!0});u.logger.log("loadSource:"+f),R&&C&&C!==f&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(R)),this.trigger(h.Events.MANIFEST_LOADING,{url:S})},k.startLoad=function(S){S===void 0&&(S=-1),u.logger.log("startLoad("+S+")"),this.networkControllers.forEach(function(R){R.startLoad(S)})},k.stopLoad=function(){u.logger.log("stopLoad"),this.networkControllers.forEach(function(S){S.stopLoad()})},k.swapAudioCodec=function(){u.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},k.recoverMediaError=function(){u.logger.log("recoverMediaError");var S=this._media;this.detachMedia(),S&&this.attachMedia(S)},k.removeLevel=function(S,R){R===void 0&&(R=0),this.levelController.removeLevel(S,R)},A(T,[{key:"levels",get:function(){var S=this.levelController.levels;return S||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(S){u.logger.log("set currentLevel:"+S),this.loadLevel=S,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(S){u.logger.log("set nextLevel:"+S),this.levelController.manualLevel=S,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(S){u.logger.log("set loadLevel:"+S),this.levelController.manualLevel=S}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(S){this.levelController.nextLoadLevel=S}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(S){u.logger.log("set firstLevel:"+S),this.levelController.firstLevel=S}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(S){u.logger.log("set startLevel:"+S),S!==-1&&(S=Math.max(S,this.minAutoLevel)),this.levelController.startLevel=S}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(S){var R=!!S;R!==this.config.capLevelToPlayerSize&&(R?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=R)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(S){this._autoLevelCapping!==S&&(u.logger.log("set autoLevelCapping:"+S),this._autoLevelCapping=S)}},{key:"bandwidthEstimate",get:function(){var S=this.abrController.bwEstimator;return S?S.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var S=this.levels,R=this.config.minAutoBitrate;if(!S)return 0;for(var C=S.length,f=0;f<C;f++)if(S[f].maxBitrate>R)return f;return 0}},{key:"maxAutoLevel",get:function(){var S=this.levels,R=this.autoLevelCapping,C;return R===-1&&S&&S.length?C=S.length-1:C=R,C}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(S){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,S)}},{key:"audioTracks",get:function(){var S=this.audioTrackController;return S?S.audioTracks:[]}},{key:"audioTrack",get:function(){var S=this.audioTrackController;return S?S.audioTrack:-1},set:function(S){var R=this.audioTrackController;R&&(R.audioTrack=S)}},{key:"subtitleTracks",get:function(){var S=this.subtitleTrackController;return S?S.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var S=this.subtitleTrackController;return S?S.subtitleTrack:-1},set:function(S){var R=this.subtitleTrackController;R&&(R.subtitleTrack=S)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var S=this.subtitleTrackController;return S?S.subtitleDisplay:!1},set:function(S){var R=this.subtitleTrackController;R&&(R.subtitleDisplay=S)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(S){this.config.lowLatencyMode=S}},{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 s.ErrorTypes}},{key:"ErrorDetails",get:function(){return s.ErrorDetails}},{key:"DefaultConfig",get:function(){return T.defaultConfig?T.defaultConfig:l.hlsDefaultConfig},set:function(S){T.defaultConfig=S}}]),T}();E.defaultConfig=void 0},"./src/is-supported.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"isSupported",function(){return M}),N.d(Y,"changeTypeSupported",function(){return K});var $=N("./src/utils/mediasource-helper.ts");function H(){return self.SourceBuffer||self.WebKitSourceBuffer}function M(){var G=Object($.getMediaSource)();if(!G)return!1;var n=H(),O=G&&typeof G.isTypeSupported=="function"&&G.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),v=!n||n.prototype&&typeof n.prototype.appendBuffer=="function"&&typeof n.prototype.remove=="function";return!!O&&!!v}function K(){var G,n=H();return typeof(n==null||((G=n.prototype)===null||G===void 0)?void 0:G.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return u}),N.d(Y,"LoadError",function(){return d});var $=N("./src/polyfills/number.ts"),H=N("./src/errors.ts");function M(o,h){o.prototype=Object.create(h.prototype),o.prototype.constructor=o,v(o,h)}function K(o){var h=typeof Map=="function"?new Map:void 0;return K=function(a){if(a===null||!O(a))return a;if(typeof a!="function")throw new TypeError("Super expression must either be null or a function");if(typeof h!="undefined"){if(h.has(a))return h.get(a);h.set(a,A)}function A(){return G(a,arguments,p(this).constructor)}return A.prototype=Object.create(a.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),v(A,a)},K(o)}function G(o,h,s){return n()?G=Reflect.construct:G=function(A,E,T){var k=[null];k.push.apply(k,E);var L=Function.bind.apply(A,k),S=new L;return T&&v(S,T.prototype),S},G.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(o){return!1}}function O(o){return Function.toString.call(o).indexOf("[native code]")!==-1}function v(o,h){return v=Object.setPrototypeOf||function(a,A){return a.__proto__=A,a},v(o,h)}function p(o){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(s){return s.__proto__||Object.getPrototypeOf(s)},p(o)}var m=Math.pow(2,17),u=function(){function o(s){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=s}var h=o.prototype;return h.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},h.abort=function(){this.loader&&this.loader.abort()},h.load=function(a,A){var E=this,T=a.url;if(!T)return Promise.reject(new d({type:H.ErrorTypes.NETWORK_ERROR,details:H.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:a,networkDetails:null},"Fragment does not have a "+(T?"part list":"url")));this.abort();var k=this.config,L=k.fLoader,S=k.loader;return new Promise(function(R,C){E.loader&&E.loader.destroy();var f=E.loader=a.loader=L?new L(k):new S(k),w=l(a),y={timeout:k.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:k.fragLoadingMaxRetryTimeout,highWaterMark:m};a.stats=f.stats,f.load(w,y,{onSuccess:function(j,U,x,F){E.resetLoader(a,f),R({frag:a,part:null,payload:j.data,networkDetails:F})},onError:function(j,U,x){E.resetLoader(a,f),C(new d({type:H.ErrorTypes.NETWORK_ERROR,details:H.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:a,response:j,networkDetails:x}))},onAbort:function(j,U,x){E.resetLoader(a,f),C(new d({type:H.ErrorTypes.NETWORK_ERROR,details:H.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:a,networkDetails:x}))},onTimeout:function(j,U,x){E.resetLoader(a,f),C(new d({type:H.ErrorTypes.NETWORK_ERROR,details:H.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:a,networkDetails:x}))},onProgress:function(j,U,x,F){A&&A({frag:a,part:null,payload:x,networkDetails:F})}})})},h.loadPart=function(a,A,E){var T=this;this.abort();var k=this.config,L=k.fLoader,S=k.loader;return new Promise(function(R,C){T.loader&&T.loader.destroy();var f=T.loader=a.loader=L?new L(k):new S(k),w=l(a,A),y={timeout:k.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:k.fragLoadingMaxRetryTimeout,highWaterMark:m};A.stats=f.stats,f.load(w,y,{onSuccess:function(j,U,x,F){T.resetLoader(a,f),T.updateStatsFromPart(a,A);var D={frag:a,part:A,payload:j.data,networkDetails:F};E(D),R(D)},onError:function(j,U,x){T.resetLoader(a,f),C(new d({type:H.ErrorTypes.NETWORK_ERROR,details:H.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:a,part:A,response:j,networkDetails:x}))},onAbort:function(j,U,x){a.stats.aborted=A.stats.aborted,T.resetLoader(a,f),C(new d({type:H.ErrorTypes.NETWORK_ERROR,details:H.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:a,part:A,networkDetails:x}))},onTimeout:function(j,U,x){T.resetLoader(a,f),C(new d({type:H.ErrorTypes.NETWORK_ERROR,details:H.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:a,part:A,networkDetails:x}))}})})},h.updateStatsFromPart=function(a,A){var E=a.stats,T=A.stats,k=T.total;if(E.loaded+=T.loaded,k){var L=Math.round(a.duration/A.duration),S=Math.min(Math.round(E.loaded/k),L),R=L-S,C=R*Math.round(E.loaded/S);E.total=E.loaded+C}else E.total=Math.max(E.loaded,E.total);var f=E.loading,w=T.loading;f.start?f.first+=w.first-w.start:(f.start=w.start,f.first=w.first),f.end=w.end},h.resetLoader=function(a,A){a.loader=null,this.loader===A&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),A.destroy()},o}();function l(o,h){h===void 0&&(h=null);var s=h||o,a={frag:o,part:h,responseType:"arraybuffer",url:s.url,headers:{},rangeStart:0,rangeEnd:0},A=s.byteRangeStartOffset,E=s.byteRangeEndOffset;return Object($.isFiniteNumber)(A)&&Object($.isFiniteNumber)(E)&&(a.rangeStart=A,a.rangeEnd=E),a}var d=function(o){M(h,o);function h(s){for(var a,A=arguments.length,E=new Array(A>1?A-1:0),T=1;T<A;T++)E[T-1]=arguments[T];return a=o.call.apply(o,[this].concat(E))||this,a.data=void 0,a.data=s,a}return h}(K(Error))},"./src/loader/fragment.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"ElementaryStreamTypes",function(){return u}),N.d(Y,"BaseSegment",function(){return l}),N.d(Y,"Fragment",function(){return d}),N.d(Y,"Part",function(){return o});var $=N("./src/polyfills/number.ts"),H=N("./node_modules/url-toolkit/src/url-toolkit.js"),M=N.n(H),K=N("./src/utils/logger.ts"),G=N("./src/loader/level-key.ts"),n=N("./src/loader/load-stats.ts");function O(h,s){h.prototype=Object.create(s.prototype),h.prototype.constructor=h,v(h,s)}function v(h,s){return v=Object.setPrototypeOf||function(A,E){return A.__proto__=E,A},v(h,s)}function p(h,s){for(var a=0;a<s.length;a++){var A=s[a];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(h,A.key,A)}}function m(h,s,a){return s&&p(h.prototype,s),a&&p(h,a),h}var u;(function(h){h.AUDIO="audio",h.VIDEO="video",h.AUDIOVIDEO="audiovideo"})(u||(u={}));var l=function(){function h(a){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=a}var s=h.prototype;return s.setByteRange=function(A,E){var T=A.split("@",2),k=[];T.length===1?k[0]=E?E.byteRangeEndOffset:0:k[0]=parseInt(T[1]),k[1]=parseInt(T[0])+k[0],this._byteRange=k},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(H.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(A){this._url=A}}]),h}(),d=function(h){O(s,h);function s(A,E){var T;return T=h.call(this,E)||this,T._decryptdata=null,T.rawProgramDateTime=null,T.programDateTime=null,T.tagList=[],T.duration=0,T.sn=0,T.levelkey=void 0,T.type=void 0,T.loader=null,T.level=-1,T.cc=0,T.startPTS=void 0,T.endPTS=void 0,T.appendedPTS=void 0,T.startDTS=void 0,T.endDTS=void 0,T.start=0,T.deltaPTS=void 0,T.maxStartPTS=void 0,T.minEndPTS=void 0,T.stats=new n.LoadStats,T.urlId=0,T.data=void 0,T.bitrateTest=!1,T.title=null,T.initSegment=null,T.type=A,T}var a=s.prototype;return a.createInitializationVector=function(E){for(var T=new Uint8Array(16),k=12;k<16;k++)T[k]=E>>8*(15-k)&255;return T},a.setDecryptDataFromLevelKey=function(E,T){var k=E;return(E==null?void 0:E.method)==="AES-128"&&E.uri&&!E.iv&&(k=G.LevelKey.fromURI(E.uri),k.method=E.method,k.iv=this.createInitializationVector(T),k.keyFormat="identity"),k},a.setElementaryStreamInfo=function(E,T,k,L,S,R){R===void 0&&(R=!1);var C=this.elementaryStreams,f=C[E];if(!f){C[E]={startPTS:T,endPTS:k,startDTS:L,endDTS:S,partial:R};return}f.startPTS=Math.min(f.startPTS,T),f.endPTS=Math.max(f.endPTS,k),f.startDTS=Math.min(f.startDTS,L),f.endDTS=Math.max(f.endDTS,S)},a.clearElementaryStreamInfo=function(){var E=this.elementaryStreams;E[u.AUDIO]=null,E[u.VIDEO]=null,E[u.AUDIOVIDEO]=null},m(s,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var E=this.sn;typeof E!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&K.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($.isFiniteNumber)(this.programDateTime))return null;var E=Object($.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+E*1e3}},{key:"encrypted",get:function(){var E;return!!((E=this.decryptdata)!==null&&E!==void 0&&E.keyFormat&&this.decryptdata.uri)}}]),s}(l),o=function(h){O(s,h);function s(a,A,E,T,k){var L;L=h.call(this,E)||this,L.fragOffset=0,L.duration=0,L.gap=!1,L.independent=!1,L.relurl=void 0,L.fragment=void 0,L.index=void 0,L.stats=new n.LoadStats,L.duration=a.decimalFloatingPoint("DURATION"),L.gap=a.bool("GAP"),L.independent=a.bool("INDEPENDENT"),L.relurl=a.enumeratedString("URI"),L.fragment=A,L.index=T;var S=a.enumeratedString("BYTERANGE");return S&&L.setByteRange(S,k),k&&(L.fragOffset=k.fragOffset+k.duration),L}return m(s,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var A=this.elementaryStreams;return!!(A.audio||A.video||A.audiovideo)}}]),s}(l)},"./src/loader/key-loader.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return K});var $=N("./src/events.ts"),H=N("./src/errors.ts"),M=N("./src/utils/logger.ts"),K=function(){function G(O){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=O,this._registerListeners()}var n=G.prototype;return n._registerListeners=function(){this.hls.on($.Events.KEY_LOADING,this.onKeyLoading,this)},n._unregisterListeners=function(){this.hls.off($.Events.KEY_LOADING,this.onKeyLoading)},n.destroy=function(){this._unregisterListeners();for(var v in this.loaders){var p=this.loaders[v];p&&p.destroy()}this.loaders={}},n.onKeyLoading=function(v,p){var m=p.frag,u=m.type,l=this.loaders[u];if(!m.decryptdata){M.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var d=m.decryptdata.uri;if(d!==this.decrypturl||this.decryptkey===null){var o=this.hls.config;if(l&&(M.logger.warn("abort previous key loader for type:"+u),l.abort()),!d){M.logger.warn("key uri is falsy");return}var h=o.loader,s=m.loader=this.loaders[u]=new h(o);this.decrypturl=d,this.decryptkey=null;var a={url:d,frag:m,responseType:"arraybuffer"},A={timeout:o.fragLoadingTimeOut,maxRetry:0,retryDelay:o.fragLoadingRetryDelay,maxRetryDelay:o.fragLoadingMaxRetryTimeout,highWaterMark:0},E={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};s.load(a,A,E)}else this.decryptkey&&(m.decryptdata.key=this.decryptkey,this.hls.trigger($.Events.KEY_LOADED,{frag:m}))},n.loadsuccess=function(v,p,m){var u=m.frag;if(!u.decryptdata){M.logger.error("after key load, decryptdata unset");return}this.decryptkey=u.decryptdata.key=new Uint8Array(v.data),u.loader=null,delete this.loaders[u.type],this.hls.trigger($.Events.KEY_LOADED,{frag:u})},n.loaderror=function(v,p){var m=p.frag,u=m.loader;u&&u.abort(),delete this.loaders[m.type],this.hls.trigger($.Events.ERROR,{type:H.ErrorTypes.NETWORK_ERROR,details:H.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:m,response:v})},n.loadtimeout=function(v,p){var m=p.frag,u=m.loader;u&&u.abort(),delete this.loaders[m.type],this.hls.trigger($.Events.ERROR,{type:H.ErrorTypes.NETWORK_ERROR,details:H.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:m})},G}()},"./src/loader/level-details.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"LevelDetails",function(){return G});var $=N("./src/polyfills/number.ts");function H(n,O){for(var v=0;v<O.length;v++){var p=O[v];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(n,p.key,p)}}function M(n,O,v){return O&&H(n.prototype,O),v&&H(n,v),n}var K=10,G=function(){function n(v){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=v}var O=n.prototype;return O.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},M(n,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object($.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||K}},{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(le,Y,N){"use strict";N.r(Y),N.d(Y,"LevelKey",function(){return G});var $=N("./node_modules/url-toolkit/src/url-toolkit.js"),H=N.n($);function M(n,O){for(var v=0;v<O.length;v++){var p=O[v];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(n,p.key,p)}}function K(n,O,v){return O&&M(n.prototype,O),v&&M(n,v),n}var G=function(){n.fromURL=function(v,p){return new n(v,p)},n.fromURI=function(v){return new n(v)};function n(O,v){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,v?this._uri=Object($.buildAbsoluteURL)(O,v,{alwaysNormalize:!0}):this._uri=O}return K(n,[{key:"uri",get:function(){return this._uri}}]),n}()},"./src/loader/load-stats.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"LoadStats",function(){return $});var $=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(le,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return s});var $=N("./src/polyfills/number.ts"),H=N("./node_modules/url-toolkit/src/url-toolkit.js"),M=N.n(H),K=N("./src/loader/fragment.ts"),G=N("./src/loader/level-details.ts"),n=N("./src/loader/level-key.ts"),O=N("./src/utils/attr-list.ts"),v=N("./src/utils/logger.ts"),p=N("./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,l=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),d=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("|")),o=/\.(mp4|m4s|m4v|m4a)$/i;function h(k){var L,S;return o.test((L=(S=H.parseURL(k))===null||S===void 0?void 0:S.path)!=null?L:"")}var s=function(){function k(){}return k.findGroup=function(S,R){for(var C=0;C<S.length;C++){var f=S[C];if(f.id===R)return f}},k.convertAVC1ToAVCOTI=function(S){var R=S.split(".");if(R.length>2){var C=R.shift()+".";return C+=parseInt(R.shift()).toString(16),C+=("000"+parseInt(R.shift()).toString(16)).substr(-4),C}return S},k.resolve=function(S,R){return H.buildAbsoluteURL(R,S,{alwaysNormalize:!0})},k.parseMasterPlaylist=function(S,R){var C=[],f={},w=!1;m.lastIndex=0;for(var y;(y=m.exec(S))!=null;)if(y[1]){var _=new O.AttrList(y[1]),j={attrs:_,bitrate:_.decimalInteger("AVERAGE-BANDWIDTH")||_.decimalInteger("BANDWIDTH"),name:_.NAME,url:k.resolve(y[2],R)},U=_.decimalResolution("RESOLUTION");U&&(j.width=U.width,j.height=U.height),a((_.CODECS||"").split(/[ ,]+/).filter(function(F){return F}),j),j.videoCodec&&j.videoCodec.indexOf("avc1")!==-1&&(j.videoCodec=k.convertAVC1ToAVCOTI(j.videoCodec)),C.push(j)}else if(y[3]){var x=new O.AttrList(y[3]);x["DATA-ID"]&&(w=!0,f[x["DATA-ID"]]=x)}return{levels:C,sessionData:w?f:null}},k.parseMasterPlaylistMedia=function(S,R,C,f){f===void 0&&(f=[]);var w,y=[],_=0;for(u.lastIndex=0;(w=u.exec(S))!==null;){var j=new O.AttrList(w[1]);if(j.TYPE===C){var U={attrs:j,bitrate:0,id:_++,groupId:j["GROUP-ID"],instreamId:j["INSTREAM-ID"],name:j.NAME||j.LANGUAGE||"",type:C,default:j.bool("DEFAULT"),autoselect:j.bool("AUTOSELECT"),forced:j.bool("FORCED"),lang:j.LANGUAGE,url:j.URI?k.resolve(j.URI,R):""};if(f.length){var x=k.findGroup(f,U.groupId)||f[0];A(U,x,"audioCodec"),A(U,x,"textCodec")}y.push(U)}}return y},k.parseLevelPlaylist=function(S,R,C,f,w){var y=new G.LevelDetails(R),_=y.fragments,j=null,U=0,x=0,F=0,D=0,g=null,W=new K.Fragment(f,R),J,oe,fe,Re=-1,be=!1;for(l.lastIndex=0,y.m3u8=S;(J=l.exec(S))!==null;){be&&(be=!1,W=new K.Fragment(f,R),W.start=F,W.sn=U,W.cc=D,W.level=C,j&&(W.initSegment=j,W.rawProgramDateTime=j.rawProgramDateTime));var Le=J[1];if(Le){W.duration=parseFloat(Le);var Ce=(" "+J[2]).slice(1);W.title=Ce||null,W.tagList.push(Ce?["INF",Le,Ce]:["INF",Le])}else if(J[3])Object($.isFiniteNumber)(W.duration)&&(W.start=F,fe&&(W.levelkey=fe),W.sn=U,W.level=C,W.cc=D,W.urlId=w,_.push(W),W.relurl=(" "+J[3]).slice(1),T(W,g),g=W,F+=W.duration,U++,x=0,be=!0);else if(J[4]){var Te=(" "+J[4]).slice(1);g?W.setByteRange(Te,g):W.setByteRange(Te)}else if(J[5])W.rawProgramDateTime=(" "+J[5]).slice(1),W.tagList.push(["PROGRAM-DATE-TIME",W.rawProgramDateTime]),Re===-1&&(Re=_.length);else{if(J=J[0].match(d),!J){v.logger.warn("No matches on slow regex match for level playlist!");continue}for(oe=1;oe<J.length&&!(typeof J[oe]!="undefined");oe++);var ve=(" "+J[oe]).slice(1),X=(" "+J[oe+1]).slice(1),b=J[oe+2]?(" "+J[oe+2]).slice(1):"";switch(ve){case"PLAYLIST-TYPE":y.type=X.toUpperCase();break;case"MEDIA-SEQUENCE":U=y.startSN=parseInt(X);break;case"SKIP":{var I=new O.AttrList(X),B=I.decimalInteger("SKIPPED-SEGMENTS");if(Object($.isFiniteNumber)(B)){y.skippedSegments=B;for(var Q=B;Q--;)_.unshift(null);U+=B}var z=I.enumeratedString("RECENTLY-REMOVED-DATERANGES");z&&(y.recentlyRemovedDateranges=z.split(" "));break}case"TARGETDURATION":y.targetduration=parseFloat(X);break;case"VERSION":y.version=parseInt(X);break;case"EXTM3U":break;case"ENDLIST":y.live=!1;break;case"#":(X||b)&&W.tagList.push(b?[X,b]:[X]);break;case"DIS":D++;case"GAP":W.tagList.push([ve]);break;case"BITRATE":W.tagList.push([ve,X]);break;case"DISCONTINUITY-SEQ":D=parseInt(X);break;case"KEY":{var he,xe=new O.AttrList(X),Ie=xe.enumeratedString("METHOD"),ue=xe.URI,me=xe.hexadecimalInteger("IV"),we=xe.enumeratedString("KEYFORMATVERSIONS"),Ae=xe.enumeratedString("KEYID"),Ne=(he=xe.enumeratedString("KEYFORMAT"))!=null?he:"identity",Be=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(Be.indexOf(Ne)>-1){v.logger.warn("Keyformat "+Ne+" is not supported from the manifest");continue}else if(Ne!=="identity")continue;Ie&&(fe=n.LevelKey.fromURL(R,ue),ue&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Ie)>=0&&(fe.method=Ie,fe.keyFormat=Ne,Ae&&(fe.keyID=Ae),we&&(fe.keyFormatVersions=we),fe.iv=me));break}case"START":{var Ke=new O.AttrList(X),Ge=Ke.decimalFloatingPoint("TIME-OFFSET");Object($.isFiniteNumber)(Ge)&&(y.startTimeOffset=Ge);break}case"MAP":{var $e=new O.AttrList(X);W.relurl=$e.URI,$e.BYTERANGE&&W.setByteRange($e.BYTERANGE),W.level=C,W.sn="initSegment",fe&&(W.levelkey=fe),W.initSegment=null,j=W,be=!0;break}case"SERVER-CONTROL":{var je=new O.AttrList(X);y.canBlockReload=je.bool("CAN-BLOCK-RELOAD"),y.canSkipUntil=je.optionalFloat("CAN-SKIP-UNTIL",0),y.canSkipDateRanges=y.canSkipUntil>0&&je.bool("CAN-SKIP-DATERANGES"),y.partHoldBack=je.optionalFloat("PART-HOLD-BACK",0),y.holdBack=je.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var We=new O.AttrList(X);y.partTarget=We.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Me=y.partList;Me||(Me=y.partList=[]);var tt=x>0?Me[Me.length-1]:void 0,rt=x++,ce=new K.Part(new O.AttrList(X),W,R,rt,tt);Me.push(ce),W.duration+=ce.duration;break}case"PRELOAD-HINT":{var ee=new O.AttrList(X);y.preloadHint=ee;break}case"RENDITION-REPORT":{var ne=new O.AttrList(X);y.renditionReports=y.renditionReports||[],y.renditionReports.push(ne);break}default:v.logger.warn("line parsed but not handled: "+J);break}}}g&&!g.relurl?(_.pop(),F-=g.duration,y.partList&&(y.fragmentHint=g)):y.partList&&(T(W,g),W.cc=D,y.fragmentHint=W);var se=_.length,de=_[0],re=_[se-1];if(F+=y.skippedSegments*y.targetduration,F>0&&se&&re){y.averagetargetduration=F/se;var ae=re.sn;y.endSN=ae!=="initSegment"?ae:0,de&&(y.startCC=de.cc,de.initSegment||y.fragments.every(function(pe){return pe.relurl&&h(pe.relurl)})&&(v.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),W=new K.Fragment(f,R),W.relurl=re.relurl,W.level=C,W.sn="initSegment",de.initSegment=W,y.needSidxRanges=!0))}else y.endSN=0,y.startCC=0;return y.fragmentHint&&(F+=y.fragmentHint.duration),y.totalduration=F,y.endCC=D,Re>0&&E(_,Re),y},k}();function a(k,L){["video","audio","text"].forEach(function(S){var R=k.filter(function(f){return Object(p.isCodecType)(f,S)});if(R.length){var C=R.filter(function(f){return f.lastIndexOf("avc1",0)===0||f.lastIndexOf("mp4a",0)===0});L[S+"Codec"]=C.length>0?C[0]:R[0],k=k.filter(function(f){return R.indexOf(f)===-1})}}),L.unknownCodecs=k}function A(k,L,S){var R=L[S];R&&(k[S]=R)}function E(k,L){for(var S=k[L],R=L;R--;){var C=k[R];if(!C)return;C.programDateTime=S.programDateTime-C.duration*1e3,S=C}}function T(k,L){k.rawProgramDateTime?k.programDateTime=Date.parse(k.rawProgramDateTime):L!=null&&L.programDateTime&&(k.programDateTime=L.endProgramDateTime),Object($.isFiniteNumber)(k.programDateTime)||(k.programDateTime=null,k.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(le,Y,N){"use strict";N.r(Y);var $=N("./src/polyfills/number.ts"),H=N("./src/events.ts"),M=N("./src/errors.ts"),K=N("./src/utils/logger.ts"),G=N("./src/utils/mp4-tools.ts"),n=N("./src/loader/m3u8-parser.ts"),O=N("./src/types/loader.ts"),v=N("./src/utils/attr-list.ts");function p(l){var d=l.type;switch(d){case O.PlaylistContextType.AUDIO_TRACK:return O.PlaylistLevelType.AUDIO;case O.PlaylistContextType.SUBTITLE_TRACK:return O.PlaylistLevelType.SUBTITLE;default:return O.PlaylistLevelType.MAIN}}function m(l,d){var o=l.url;return(o===void 0||o.indexOf("data:")===0)&&(o=d.url),o}var u=function(){function l(o){this.hls=void 0,this.loaders=Object.create(null),this.hls=o,this.registerListeners()}var d=l.prototype;return d.registerListeners=function(){var h=this.hls;h.on(H.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.on(H.Events.LEVEL_LOADING,this.onLevelLoading,this),h.on(H.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),h.on(H.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},d.unregisterListeners=function(){var h=this.hls;h.off(H.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.off(H.Events.LEVEL_LOADING,this.onLevelLoading,this),h.off(H.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),h.off(H.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},d.createInternalLoader=function(h){var s=this.hls.config,a=s.pLoader,A=s.loader,E=a||A,T=new E(s);return h.loader=T,this.loaders[h.type]=T,T},d.getInternalLoader=function(h){return this.loaders[h.type]},d.resetInternalLoader=function(h){this.loaders[h]&&delete this.loaders[h]},d.destroyInternalLoaders=function(){for(var h in this.loaders){var s=this.loaders[h];s&&s.destroy(),this.resetInternalLoader(h)}},d.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},d.onManifestLoading=function(h,s){var a=s.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:O.PlaylistContextType.MANIFEST,url:a,deliveryDirectives:null})},d.onLevelLoading=function(h,s){var a=s.id,A=s.level,E=s.url,T=s.deliveryDirectives;this.load({id:a,groupId:null,level:A,responseType:"text",type:O.PlaylistContextType.LEVEL,url:E,deliveryDirectives:T})},d.onAudioTrackLoading=function(h,s){var a=s.id,A=s.groupId,E=s.url,T=s.deliveryDirectives;this.load({id:a,groupId:A,level:null,responseType:"text",type:O.PlaylistContextType.AUDIO_TRACK,url:E,deliveryDirectives:T})},d.onSubtitleTrackLoading=function(h,s){var a=s.id,A=s.groupId,E=s.url,T=s.deliveryDirectives;this.load({id:a,groupId:A,level:null,responseType:"text",type:O.PlaylistContextType.SUBTITLE_TRACK,url:E,deliveryDirectives:T})},d.load=function(h){var s,a=this.hls.config,A=this.getInternalLoader(h);if(A){var E=A.context;if(E&&E.url===h.url){K.logger.trace("[playlist-loader]: playlist request ongoing");return}K.logger.log("[playlist-loader]: aborting previous loader for type: "+h.type),A.abort()}var T,k,L,S;switch(h.type){case O.PlaylistContextType.MANIFEST:T=a.manifestLoadingMaxRetry,k=a.manifestLoadingTimeOut,L=a.manifestLoadingRetryDelay,S=a.manifestLoadingMaxRetryTimeout;break;case O.PlaylistContextType.LEVEL:case O.PlaylistContextType.AUDIO_TRACK:case O.PlaylistContextType.SUBTITLE_TRACK:T=0,k=a.levelLoadingTimeOut;break;default:T=a.levelLoadingMaxRetry,k=a.levelLoadingTimeOut,L=a.levelLoadingRetryDelay,S=a.levelLoadingMaxRetryTimeout;break}if(A=this.createInternalLoader(h),(s=h.deliveryDirectives)!==null&&s!==void 0&&s.part){var R;if(h.type===O.PlaylistContextType.LEVEL&&h.level!==null?R=this.hls.levels[h.level].details:h.type===O.PlaylistContextType.AUDIO_TRACK&&h.id!==null?R=this.hls.audioTracks[h.id].details:h.type===O.PlaylistContextType.SUBTITLE_TRACK&&h.id!==null&&(R=this.hls.subtitleTracks[h.id].details),R){var C=R.partTarget,f=R.targetduration;C&&f&&(k=Math.min(Math.max(C*3,f*.8)*1e3,k))}}var w={timeout:k,maxRetry:T,retryDelay:L,maxRetryDelay:S,highWaterMark:0},y={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};A.load(h,w,y)},d.loadsuccess=function(h,s,a,A){if(A===void 0&&(A=null),a.isSidxRequest){this.handleSidxRequest(h,a),this.handlePlaylistLoaded(h,s,a,A);return}this.resetInternalLoader(a.type);var E=h.data;if(E.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(h,a,"no EXTM3U delimiter",A);return}s.parsing.start=performance.now(),E.indexOf("#EXTINF:")>0||E.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(h,s,a,A):this.handleMasterPlaylist(h,s,a,A)},d.loaderror=function(h,s,a){a===void 0&&(a=null),this.handleNetworkError(s,a,!1,h)},d.loadtimeout=function(h,s,a){a===void 0&&(a=null),this.handleNetworkError(s,a,!0)},d.handleMasterPlaylist=function(h,s,a,A){var E=this.hls,T=h.data,k=m(h,a),L=n.default.parseMasterPlaylist(T,k),S=L.levels,R=L.sessionData;if(!S.length){this.handleManifestParsingError(h,a,"no level found in manifest",A);return}var C=S.map(function(U){return{id:U.attrs.AUDIO,audioCodec:U.audioCodec}}),f=S.map(function(U){return{id:U.attrs.SUBTITLES,textCodec:U.textCodec}}),w=n.default.parseMasterPlaylistMedia(T,k,"AUDIO",C),y=n.default.parseMasterPlaylistMedia(T,k,"SUBTITLES",f),_=n.default.parseMasterPlaylistMedia(T,k,"CLOSED-CAPTIONS");if(w.length){var j=w.some(function(U){return!U.url});!j&&S[0].audioCodec&&!S[0].attrs.AUDIO&&(K.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 v.AttrList({}),bitrate:0,url:""}))}E.trigger(H.Events.MANIFEST_LOADED,{levels:S,audioTracks:w,subtitles:y,captions:_,url:k,stats:s,networkDetails:A,sessionData:R})},d.handleTrackOrLevelPlaylist=function(h,s,a,A){var E=this.hls,T=a.id,k=a.level,L=a.type,S=m(h,a),R=Object($.isFiniteNumber)(T)?T:0,C=Object($.isFiniteNumber)(k)?k:R,f=p(a),w=n.default.parseLevelPlaylist(h.data,S,C,f,R);if(!w.fragments.length){E.trigger(H.Events.ERROR,{type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:S,reason:"no fragments found in level",level:typeof a.level=="number"?a.level:void 0});return}if(L===O.PlaylistContextType.MANIFEST){var y={attrs:new v.AttrList({}),bitrate:0,details:w,name:"",url:S};E.trigger(H.Events.MANIFEST_LOADED,{levels:[y],audioTracks:[],url:S,stats:s,networkDetails:A,sessionData:null})}if(s.parsing.end=performance.now(),w.needSidxRanges){var _,j=(_=w.fragments[0].initSegment)===null||_===void 0?void 0:_.url;this.load({url:j,isSidxRequest:!0,type:L,level:k,levelDetails:w,id:T,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}a.levelDetails=w,this.handlePlaylistLoaded(h,s,a,A)},d.handleSidxRequest=function(h,s){var a=Object(G.parseSegmentIndex)(new Uint8Array(h.data));if(!a)return;var A=a.references,E=s.levelDetails;A.forEach(function(T,k){var L=T.info,S=E.fragments[k];S.byteRange.length===0&&S.setByteRange(String(1+L.end-L.start)+"@"+String(L.start)),S.initSegment&&S.initSegment.setByteRange(String(a.moovEndOffset)+"@0")})},d.handleManifestParsingError=function(h,s,a,A){this.hls.trigger(H.Events.ERROR,{type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:s.type===O.PlaylistContextType.MANIFEST,url:h.url,reason:a,response:h,context:s,networkDetails:A})},d.handleNetworkError=function(h,s,a,A){a===void 0&&(a=!1),K.logger.warn("[playlist-loader]: A network "+(a?"timeout":"error")+" occurred while loading "+h.type+" level: "+h.level+" id: "+h.id+' group-id: "'+h.groupId+'"');var E=M.ErrorDetails.UNKNOWN,T=!1,k=this.getInternalLoader(h);switch(h.type){case O.PlaylistContextType.MANIFEST:E=a?M.ErrorDetails.MANIFEST_LOAD_TIMEOUT:M.ErrorDetails.MANIFEST_LOAD_ERROR,T=!0;break;case O.PlaylistContextType.LEVEL:E=a?M.ErrorDetails.LEVEL_LOAD_TIMEOUT:M.ErrorDetails.LEVEL_LOAD_ERROR,T=!1;break;case O.PlaylistContextType.AUDIO_TRACK:E=a?M.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:M.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,T=!1;break;case O.PlaylistContextType.SUBTITLE_TRACK:E=a?M.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:M.ErrorDetails.SUBTITLE_LOAD_ERROR,T=!1;break}k&&this.resetInternalLoader(h.type);var L={type:M.ErrorTypes.NETWORK_ERROR,details:E,fatal:T,url:h.url,loader:k,context:h,networkDetails:s};A&&(L.response=A),this.hls.trigger(H.Events.ERROR,L)},d.handlePlaylistLoaded=function(h,s,a,A){var E=a.type,T=a.level,k=a.id,L=a.groupId,S=a.loader,R=a.levelDetails,C=a.deliveryDirectives;if(!(R!=null&&R.targetduration)){this.handleManifestParsingError(h,a,"invalid target duration",A);return}if(!S)return;R.live&&(S.getCacheAge&&(R.ageHeader=S.getCacheAge()||0),(!S.getCacheAge||isNaN(R.ageHeader))&&(R.ageHeader=0));switch(E){case O.PlaylistContextType.MANIFEST:case O.PlaylistContextType.LEVEL:this.hls.trigger(H.Events.LEVEL_LOADED,{details:R,level:T||0,id:k||0,stats:s,networkDetails:A,deliveryDirectives:C});break;case O.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(H.Events.AUDIO_TRACK_LOADED,{details:R,id:k||0,groupId:L||"",stats:s,networkDetails:A,deliveryDirectives:C});break;case O.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(H.Events.SUBTITLE_TRACK_LOADED,{details:R,id:k||0,groupId:L||"",stats:s,networkDetails:A,deliveryDirectives:C});break}},l}();Y.default=u},"./src/polyfills/number.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"isFiniteNumber",function(){return $}),N.d(Y,"MAX_SAFE_INTEGER",function(){return H});var $=Number.isFinite||function(M){return typeof M=="number"&&isFinite(M)},H=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(le,Y,N){"use strict";N.r(Y);var $=function(){function H(){}return H.getSilentFrame=function(K,G){switch(K){case"mp4a.40.2":if(G===1)return new Uint8Array([0,200,0,128,35,128]);if(G===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(G===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(G===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(G===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(G===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(G===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(G===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(G===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},H}();Y.default=$},"./src/remux/mp4-generator.ts":function(le,Y,N){"use strict";N.r(Y);var $=Math.pow(2,32)-1,H=function(){function M(){}return M.init=function(){M.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};var G;for(G in M.types)M.types.hasOwnProperty(G)&&(M.types[G]=[G.charCodeAt(0),G.charCodeAt(1),G.charCodeAt(2),G.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]),O=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);M.HDLR_TYPES={video:n,audio:O};var v=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]);M.STTS=M.STSC=M.STCO=p,M.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),M.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),M.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),M.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var m=new Uint8Array([105,115,111,109]),u=new Uint8Array([97,118,99,49]),l=new Uint8Array([0,0,0,1]);M.FTYP=M.box(M.types.ftyp,m,l,m,u),M.DINF=M.box(M.types.dinf,M.box(M.types.dref,v))},M.box=function(G){for(var n=8,O=arguments.length,v=new Array(O>1?O-1:0),p=1;p<O;p++)v[p-1]=arguments[p];for(var m=v.length,u=m;m--;)n+=v[m].byteLength;var l=new Uint8Array(n);for(l[0]=n>>24&255,l[1]=n>>16&255,l[2]=n>>8&255,l[3]=n&255,l.set(G,4),m=0,n=8;m<u;m++)l.set(v[m],n),n+=v[m].byteLength;return l},M.hdlr=function(G){return M.box(M.types.hdlr,M.HDLR_TYPES[G])},M.mdat=function(G){return M.box(M.types.mdat,G)},M.mdhd=function(G,n){n*=G;var O=Math.floor(n/($+1)),v=Math.floor(n%($+1));return M.box(M.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,G>>24&255,G>>16&255,G>>8&255,G&255,O>>24,O>>16&255,O>>8&255,O&255,v>>24,v>>16&255,v>>8&255,v&255,85,196,0,0]))},M.mdia=function(G){return M.box(M.types.mdia,M.mdhd(G.timescale,G.duration),M.hdlr(G.type),M.minf(G))},M.mfhd=function(G){return M.box(M.types.mfhd,new Uint8Array([0,0,0,0,G>>24,G>>16&255,G>>8&255,G&255]))},M.minf=function(G){return G.type==="audio"?M.box(M.types.minf,M.box(M.types.smhd,M.SMHD),M.DINF,M.stbl(G)):M.box(M.types.minf,M.box(M.types.vmhd,M.VMHD),M.DINF,M.stbl(G))},M.moof=function(G,n,O){return M.box(M.types.moof,M.mfhd(G),M.traf(O,n))},M.moov=function(G){for(var n=G.length,O=[];n--;)O[n]=M.trak(G[n]);return M.box.apply(null,[M.types.moov,M.mvhd(G[0].timescale,G[0].duration)].concat(O).concat(M.mvex(G)))},M.mvex=function(G){for(var n=G.length,O=[];n--;)O[n]=M.trex(G[n]);return M.box.apply(null,[M.types.mvex].concat(O))},M.mvhd=function(G,n){n*=G;var O=Math.floor(n/($+1)),v=Math.floor(n%($+1)),p=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,G>>24&255,G>>16&255,G>>8&255,G&255,O>>24,O>>16&255,O>>8&255,O&255,v>>24,v>>16&255,v>>8&255,v&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return M.box(M.types.mvhd,p)},M.sdtp=function(G){var n=G.samples||[],O=new Uint8Array(4+n.length),v,p;for(v=0;v<n.length;v++)p=n[v].flags,O[v+4]=p.dependsOn<<4|p.isDependedOn<<2|p.hasRedundancy;return M.box(M.types.sdtp,O)},M.stbl=function(G){return M.box(M.types.stbl,M.stsd(G),M.box(M.types.stts,M.STTS),M.box(M.types.stsc,M.STSC),M.box(M.types.stsz,M.STSZ),M.box(M.types.stco,M.STCO))},M.avc1=function(G){var n=[],O=[],v,p,m;for(v=0;v<G.sps.length;v++)p=G.sps[v],m=p.byteLength,n.push(m>>>8&255),n.push(m&255),n=n.concat(Array.prototype.slice.call(p));for(v=0;v<G.pps.length;v++)p=G.pps[v],m=p.byteLength,O.push(m>>>8&255),O.push(m&255),O=O.concat(Array.prototype.slice.call(p));var u=M.box(M.types.avcC,new Uint8Array([1,n[3],n[4],n[5],252|3,224|G.sps.length].concat(n).concat([G.pps.length]).concat(O))),l=G.width,d=G.height,o=G.pixelRatio[0],h=G.pixelRatio[1];return M.box(M.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,l>>8&255,l&255,d>>8&255,d&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,M.box(M.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),M.box(M.types.pasp,new Uint8Array([o>>24,o>>16&255,o>>8&255,o&255,h>>24,h>>16&255,h>>8&255,h&255])))},M.esds=function(G){var n=G.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(G.config).concat([6,1,2]))},M.mp4a=function(G){var n=G.samplerate;return M.box(M.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,G.channelCount,0,16,0,0,0,0,n>>8&255,n&255,0,0]),M.box(M.types.esds,M.esds(G)))},M.mp3=function(G){var n=G.samplerate;return M.box(M.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,G.channelCount,0,16,0,0,0,0,n>>8&255,n&255,0,0]))},M.stsd=function(G){return G.type==="audio"?!G.isAAC&&G.codec==="mp3"?M.box(M.types.stsd,M.STSD,M.mp3(G)):M.box(M.types.stsd,M.STSD,M.mp4a(G)):M.box(M.types.stsd,M.STSD,M.avc1(G))},M.tkhd=function(G){var n=G.id,O=G.duration*G.timescale,v=G.width,p=G.height,m=Math.floor(O/($+1)),u=Math.floor(O%($+1));return M.box(M.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,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,v>>8&255,v&255,0,0,p>>8&255,p&255,0,0]))},M.traf=function(G,n){var O=M.sdtp(G),v=G.id,p=Math.floor(n/($+1)),m=Math.floor(n%($+1));return M.box(M.types.traf,M.box(M.types.tfhd,new Uint8Array([0,0,0,0,v>>24,v>>16&255,v>>8&255,v&255])),M.box(M.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])),M.trun(G,O.length+16+20+8+16+8+8),O)},M.trak=function(G){return G.duration=G.duration||4294967295,M.box(M.types.trak,M.tkhd(G),M.mdia(G))},M.trex=function(G){var n=G.id;return M.box(M.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]))},M.trun=function(G,n){var O=G.samples||[],v=O.length,p=12+16*v,m=new Uint8Array(p),u,l,d,o,h,s;for(n+=8+p,m.set([0,0,15,1,v>>>24&255,v>>>16&255,v>>>8&255,v&255,n>>>24&255,n>>>16&255,n>>>8&255,n&255],0),u=0;u<v;u++)l=O[u],d=l.duration,o=l.size,h=l.flags,s=l.cts,m.set([d>>>24&255,d>>>16&255,d>>>8&255,d&255,o>>>24&255,o>>>16&255,o>>>8&255,o&255,h.isLeading<<2|h.dependsOn,h.isDependedOn<<6|h.hasRedundancy<<4|h.paddingValue<<1|h.isNonSync,h.degradPrio&240<<8,h.degradPrio&15,s>>>24&255,s>>>16&255,s>>>8&255,s&255],12+16*u);return M.box(M.types.trun,m)},M.initSegment=function(G){M.types||M.init();var n=M.moov(G),O=new Uint8Array(M.FTYP.byteLength+n.byteLength);return O.set(M.FTYP),O.set(n,M.FTYP.byteLength),O},M}();H.types=void 0,H.HDLR_TYPES=void 0,H.STTS=void 0,H.STSC=void 0,H.STCO=void 0,H.STSZ=void 0,H.VMHD=void 0,H.SMHD=void 0,H.STSD=void 0,H.FTYP=void 0,H.DINF=void 0,Y.default=H},"./src/remux/mp4-remuxer.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return s}),N.d(Y,"normalizePts",function(){return a});var $=N("./src/polyfills/number.ts"),H=N("./src/remux/aac-helper.ts"),M=N("./src/remux/mp4-generator.ts"),K=N("./src/events.ts"),G=N("./src/errors.ts"),n=N("./src/utils/logger.ts"),O=N("./src/types/loader.ts"),v=N("./src/utils/timescale-conversion.ts");function p(){return p=Object.assign||function(k){for(var L=1;L<arguments.length;L++){var S=arguments[L];for(var R in S)Object.prototype.hasOwnProperty.call(S,R)&&(k[R]=S[R])}return k},p.apply(this,arguments)}var m=10*1e3,u=1024,l=1152,d=null,o=null,h=!1,s=function(){function k(S,R,C,f){if(f===void 0&&(f=""),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=void 0,this._initDTS=void 0,this.nextAvcDts=null,this.nextAudioPts=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=S,this.config=R,this.typeSupported=C,this.ISGenerated=!1,d===null){var w=navigator.userAgent||"",y=w.match(/Chrome\/(\d+)/i);d=y?parseInt(y[1]):0}if(o===null){var _=navigator.userAgent.match(/Safari\/(\d+)/i);o=_?parseInt(_[1]):0}h=!!d&&d<75||!!o&&o<600}var L=k.prototype;return L.destroy=function(){},L.resetTimeStamp=function(R){n.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=R},L.resetNextTimestamp=function(){n.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},L.resetInitSegment=function(){n.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},L.getVideoStartPts=function(R){var C=!1,f=R.reduce(function(w,y){var _=y.pts-w;return _<-4294967296?(C=!0,a(w,y.pts)):_>0?w:y.pts},R[0].pts);return C&&n.logger.debug("PTS rollover detected"),f},L.remux=function(R,C,f,w,y,_,j,U){var x,F,D,g,W,J,oe=y,fe=y,Re=R.pid>-1,be=C.pid>-1,Le=C.samples.length,Ce=R.samples.length>0,Te=Le>1,ve=(!Re||Ce)&&(!be||Te)||this.ISGenerated||j;if(ve){this.ISGenerated||(D=this.generateIS(R,C,y));var X=this.isVideoContiguous,b=-1;if(Te&&(b=A(C.samples),!X&&this.config.forceKeyFrameOnDiscontinuity))if(J=!0,b>0){n.logger.warn("[mp4-remuxer]: Dropped "+b+" out of "+Le+" video samples due to a missing keyframe");var I=this.getVideoStartPts(C.samples);C.samples=C.samples.slice(b),C.dropped+=b,fe+=(C.samples[0].pts-I)/(C.timescale||9e4)}else b===-1&&(n.logger.warn("[mp4-remuxer]: No keyframe found out of "+Le+" video samples"),J=!1);if(this.ISGenerated){if(Ce&&Te){var B=this.getVideoStartPts(C.samples),Q=a(R.samples[0].pts,B)-B,z=Q/C.inputTimeScale;oe+=Math.max(0,z),fe+=Math.max(0,-z)}if(Ce){if(R.samplerate||(n.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),D=this.generateIS(R,C,y)),F=this.remuxAudio(R,oe,this.isAudioContiguous,_,be||Te||U===O.PlaylistLevelType.AUDIO?fe:void 0),Te){var he=F?F.endPTS-F.startPTS:0;C.inputTimeScale||(n.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),D=this.generateIS(R,C,y)),x=this.remuxVideo(C,fe,X,he)}}else Te&&(x=this.remuxVideo(C,fe,X,0));x&&(x.firstKeyFrame=b,x.independent=b!==-1)}}return this.ISGenerated&&(f.samples.length&&(W=this.remuxID3(f,y)),w.samples.length&&(g=this.remuxText(w,y))),{audio:F,video:x,initSegment:D,independent:J,text:g,id3:W}},L.generateIS=function(R,C,f){var w=R.samples,y=C.samples,_=this.typeSupported,j={},U=!Object($.isFiniteNumber)(this._initPTS),x="audio/mp4",F,D,g;if(U&&(F=D=Infinity),R.config&&w.length&&(R.timescale=R.samplerate,R.isAAC||(_.mpeg?(x="audio/mpeg",R.codec=""):_.mp3&&(R.codec="mp3")),j.audio={id:"audio",container:x,codec:R.codec,initSegment:!R.isAAC&&_.mpeg?new Uint8Array(0):M.default.initSegment([R]),metadata:{channelCount:R.channelCount}},U&&(g=R.inputTimeScale,F=D=w[0].pts-Math.round(g*f))),C.sps&&C.pps&&y.length&&(C.timescale=C.inputTimeScale,j.video={id:"main",container:"video/mp4",codec:C.codec,initSegment:M.default.initSegment([C]),metadata:{width:C.width,height:C.height}},U)){g=C.inputTimeScale;var W=this.getVideoStartPts(y),J=Math.round(g*f);D=Math.min(D,a(y[0].dts,W)-J),F=Math.min(F,W-J)}if(Object.keys(j).length)return this.ISGenerated=!0,U&&(this._initPTS=F,this._initDTS=D),{tracks:j,initPTS:F,timescale:g}},L.remuxVideo=function(R,C,f,w){var y=R.inputTimeScale,_=R.samples,j=[],U=_.length,x=this._initPTS,F=this.nextAvcDts,D=8,g,W,J,oe=Number.POSITIVE_INFINITY,fe=Number.NEGATIVE_INFINITY,Re=0,be=!1;if(!f||F===null){var Le=C*y,Ce=_[0].pts-a(_[0].dts,_[0].pts);F=Le-Ce}for(var Te=0;Te<U;Te++){var ve=_[Te];if(ve.pts=a(ve.pts-x,F),ve.dts=a(ve.dts-x,F),ve.dts>ve.pts){var X=9e4*.2;Re=Math.max(Math.min(Re,ve.pts-ve.dts),-1*X)}ve.dts<_[Te>0?Te-1:Te].dts&&(be=!0)}be&&_.sort(function(_t,lt){var at=_t.dts-lt.dts,Rt=_t.pts-lt.pts;return at||Rt}),W=_[0].dts,J=_[_.length-1].dts;var b=Math.round((J-W)/(U-1));if(Re<0){if(Re<b*-2){n.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(v.toMsFromMpegTsClock)(-b,!0)+" ms");for(var I=Re,B=0;B<U;B++)_[B].dts=I=Math.max(I,_[B].pts-b),_[B].pts=Math.max(I,_[B].pts)}else{n.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(v.toMsFromMpegTsClock)(Re,!0)+" ms to overcome this issue");for(var Q=0;Q<U;Q++)_[Q].dts=_[Q].dts+Re}W=_[0].dts}if(f){var z=W-F,he=z>b,xe=z<-1;if(he||xe){he?n.logger.warn("AVC: "+Object(v.toMsFromMpegTsClock)(z,!0)+" ms ("+z+"dts) hole between fragments detected, filling it"):n.logger.warn("AVC: "+Object(v.toMsFromMpegTsClock)(-z,!0)+" ms ("+z+"dts) overlapping between fragments detected"),W=F;var Ie=_[0].pts-z;_[0].dts=W,_[0].pts=Ie,n.logger.log("Video: First PTS/DTS adjusted: "+Object(v.toMsFromMpegTsClock)(Ie,!0)+"/"+Object(v.toMsFromMpegTsClock)(W,!0)+", delta: "+Object(v.toMsFromMpegTsClock)(z,!0)+" ms")}}h&&(W=Math.max(0,W));for(var ue=0,me=0,we=0;we<U;we++){for(var Ae=_[we],Ne=Ae.units,Be=Ne.length,Ke=0,Ge=0;Ge<Be;Ge++)Ke+=Ne[Ge].data.length;me+=Ke,ue+=Be,Ae.length=Ke,Ae.dts=Math.max(Ae.dts,W),Ae.pts=Math.max(Ae.pts,Ae.dts,0),oe=Math.min(Ae.pts,oe),fe=Math.max(Ae.pts,fe)}J=_[U-1].dts;var $e=me+4*ue+8,je;try{je=new Uint8Array($e)}catch(_t){this.observer.emit(K.Events.ERROR,K.Events.ERROR,{type:G.ErrorTypes.MUX_ERROR,details:G.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:$e,reason:"fail allocating video mdat "+$e});return}var We=new DataView(je.buffer);We.setUint32(0,$e),je.set(M.default.types.mdat,4);for(var Me=0;Me<U;Me++){for(var tt=_[Me],rt=tt.units,ce=0,ee=0,ne=rt.length;ee<ne;ee++){var se=rt[ee],de=se.data,re=se.data.byteLength;We.setUint32(D,re),D+=4,je.set(de,D),D+=re,ce+=4+re}if(Me<U-1)g=_[Me+1].dts-tt.dts;else{var ae=this.config,pe=tt.dts-_[Me>0?Me-1:Me].dts;if(ae.stretchShortVideoTrack&&this.nextAudioPts!==null){var ge=Math.floor(ae.maxBufferHole*y),_e=(w?oe+w*y:this.nextAudioPts)-tt.pts;_e>ge?(g=_e-pe,g<0&&(g=pe),n.logger.log("[mp4-remuxer]: It is approximately "+_e/90+" ms to the next segment; using duration "+g/90+" ms for the last video frame.")):g=pe}else g=pe}var Oe=Math.round(tt.pts-tt.dts);j.push(new E(tt.key,g,ce,Oe))}if(j.length&&d&&d<70){var Pe=j[0].flags;Pe.dependsOn=2,Pe.isNonSync=0}console.assert(g!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=F=J+g,this.isVideoContiguous=!0;var ze=M.default.moof(R.sequenceNumber++,W,p({},R,{samples:j})),et="video",nt={data1:ze,data2:je,startPTS:oe/y,endPTS:(fe+g)/y,startDTS:W/y,endDTS:F/y,type:et,hasAudio:!1,hasVideo:!0,nb:j.length,dropped:R.dropped};return R.samples=[],R.dropped=0,console.assert(je.length,"MDAT length must not be zero"),nt},L.remuxAudio=function(R,C,f,w,y){var _=R.inputTimeScale,j=R.samplerate?R.samplerate:_,U=_/j,x=R.isAAC?u:l,F=x*U,D=this._initPTS,g=!R.isAAC&&this.typeSupported.mpeg,W=[],J=R.samples,oe=g?0:8,fe=this.nextAudioPts||-1,Re=C*_;if(this.isAudioContiguous=f=f||J.length&&fe>0&&(w&&Math.abs(Re-fe)<9e3||Math.abs(a(J[0].pts-D,Re)-fe)<20*F),J.forEach(function(de){de.pts=a(de.pts-D,Re)}),!f||fe<0){if(J=J.filter(function(de){return de.pts>=0}),!J.length)return;y===0?fe=0:w?fe=Math.max(0,Re):fe=J[0].pts}if(R.isAAC)for(var be=y!==void 0,Le=this.config.maxAudioFramesDrift,Ce=0,Te=fe;Ce<J.length;Ce++){var ve=J[Ce],X=ve.pts,b=X-Te,I=Math.abs(1e3*b/_);if(b<=-Le*F&&be)Ce===0&&(n.logger.warn("Audio frame @ "+(X/_).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*b/_)+" ms."),this.nextAudioPts=fe=Te=X);else if(b>=Le*F&&I<m&&be){var B=Math.round(b/F);Te=X-B*F,Te<0&&(B--,Te+=F),Ce===0&&(this.nextAudioPts=fe=Te),n.logger.warn("[mp4-remuxer]: Injecting "+B+" audio frame @ "+(Te/_).toFixed(3)+"s due to "+Math.round(1e3*b/_)+" ms gap.");for(var Q=0;Q<B;Q++){var z=Math.max(Te,0),he=H.default.getSilentFrame(R.manifestCodec||R.codec,R.channelCount);he||(n.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),he=ve.unit.subarray()),J.splice(Ce,0,{unit:he,pts:z}),Te+=F,Ce++}}ve.pts=Te,Te+=F}for(var xe=null,Ie=null,ue,me=0,we=J.length;we--;)me+=J[we].unit.byteLength;for(var Ae=0,Ne=J.length;Ae<Ne;Ae++){var Be=J[Ae],Ke=Be.unit,Ge=Be.pts;if(Ie!==null){var $e=W[Ae-1];$e.duration=Math.round((Ge-Ie)/U)}else if(f&&R.isAAC&&(Ge=fe),xe=Ge,me>0){me+=oe;try{ue=new Uint8Array(me)}catch(de){this.observer.emit(K.Events.ERROR,K.Events.ERROR,{type:G.ErrorTypes.MUX_ERROR,details:G.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:me,reason:"fail allocating audio mdat "+me});return}if(!g){var je=new DataView(ue.buffer);je.setUint32(0,me),ue.set(M.default.types.mdat,4)}}else return;ue.set(Ke,oe);var We=Ke.byteLength;oe+=We,W.push(new E(!0,x,We,0)),Ie=Ge}var Me=W.length;if(!Me)return;var tt=W[W.length-1];this.nextAudioPts=fe=Ie+U*tt.duration;var rt=g?new Uint8Array(0):M.default.moof(R.sequenceNumber++,xe/U,p({},R,{samples:W}));R.samples=[];var ce=xe/_,ee=fe/_,ne="audio",se={data1:rt,data2:ue,startPTS:ce,endPTS:ee,startDTS:ce,endDTS:ee,type:ne,hasAudio:!0,hasVideo:!1,nb:Me};return this.isAudioContiguous=!0,console.assert(ue.length,"MDAT length must not be zero"),se},L.remuxEmptyAudio=function(R,C,f,w){var y=R.inputTimeScale,_=R.samplerate?R.samplerate:y,j=y/_,U=this.nextAudioPts,x=(U!==null?U:w.startDTS*y)+this._initDTS,F=w.endDTS*y+this._initDTS,D=j*u,g=Math.ceil((F-x)/D),W=H.default.getSilentFrame(R.manifestCodec||R.codec,R.channelCount);if(n.logger.warn("[mp4-remuxer]: remux empty Audio"),!W){n.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var J=[],oe=0;oe<g;oe++){var fe=x+oe*D;J.push({unit:W,pts:fe,dts:fe})}return R.samples=J,this.remuxAudio(R,C,f,!1)},L.remuxID3=function(R,C){var f=R.samples.length;if(!f)return;for(var w=R.inputTimeScale,y=this._initPTS,_=this._initDTS,j=0;j<f;j++){var U=R.samples[j];U.pts=a(U.pts-y,C*w)/w,U.dts=a(U.dts-_,C*w)/w}var x=R.samples;return R.samples=[],{samples:x}},L.remuxText=function(R,C){var f=R.samples.length;if(!f)return;for(var w=R.inputTimeScale,y=this._initPTS,_=0;_<f;_++){var j=R.samples[_];j.pts=a(j.pts-y,C*w)/w}R.samples.sort(function(x,F){return x.pts-F.pts});var U=R.samples;return R.samples=[],{samples:U}},k}();function a(k,L){var S;if(L===null)return k;for(L<k?S=-8589934592:S=8589934592;Math.abs(k-L)>4294967296;)k+=S;return k}function A(k){for(var L=0;L<k.length;L++)if(k[L].key)return L;return-1}var E=function(L,S,R,C){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=S,this.size=R,this.cts=C,this.flags=new T(L)},T=function(L){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=L?2:1,this.isNonSync=L?0:1}},"./src/remux/passthrough-remuxer.ts":function(le,Y,N){"use strict";N.r(Y);var $=N("./src/polyfills/number.ts"),H=N("./src/utils/mp4-tools.ts"),M=N("./src/loader/fragment.ts"),K=N("./src/utils/logger.ts"),G=function(){function v(){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=v.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,l,d){this.audioCodec=l,this.videoCodec=d,this.generateInitSegment(u),this.emitInitSegment=!0},p.generateInitSegment=function(u){var l=this.audioCodec,d=this.videoCodec;if(!u||!u.byteLength){this.initTracks=void 0,this.initData=void 0;return}var o=this.initData=Object(H.parseInitSegment)(u);l||(l=O(o.audio,M.ElementaryStreamTypes.AUDIO)),d||(d=O(o.video,M.ElementaryStreamTypes.VIDEO));var h={};o.audio&&o.video?h.audiovideo={container:"video/mp4",codec:l+","+d,initSegment:u,id:"main"}:o.audio?h.audio={container:"audio/mp4",codec:l,initSegment:u,id:"audio"}:o.video?h.video={container:"video/mp4",codec:d,initSegment:u,id:"main"}:K.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=h},p.remux=function(u,l,d,o,h){var s=this.initPTS,a=this.lastEndDTS,A={audio:void 0,video:void 0,text:o,id3:d,initSegment:void 0};Object($.isFiniteNumber)(a)||(a=this.lastEndDTS=h||0);var E=l.samples;if(!E||!E.length)return A;var T={initPTS:void 0,timescale:1},k=this.initData;if((!k||!k.length)&&(this.generateInitSegment(E),k=this.initData),!k||!k.length)return K.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),A;this.emitInitSegment&&(T.tracks=this.initTracks,this.emitInitSegment=!1),Object($.isFiniteNumber)(s)||(this.initPTS=T.initPTS=s=n(k,E,a));var L=Object(H.getDuration)(E,k),S=a,R=L+S;Object(H.offsetStartDTS)(k,E,s),L>0?this.lastEndDTS=R:(K.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var C=!!k.audio,f=!!k.video,w="";C&&(w+="audio"),f&&(w+="video");var y={data1:E,startPTS:S,startDTS:S,endPTS:R,endDTS:R,type:w,hasAudio:C,hasVideo:f,nb:1,dropped:0};return A.audio=y.type==="audio"?y:void 0,A.video=y.type!=="audio"?y:void 0,A.text=o,A.id3=d,A.initSegment=T,A},v}(),n=function(p,m,u){return Object(H.getStartDTS)(p,m)-u};function O(v,p){var m=v==null?void 0:v.codec;return m&&m.length>4?m:m==="hvc1"?"hvc1.1.c.L120.90":m==="av01"?"av01.0.04M.08":m==="avc1"||p===M.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}Y.default=G},"./src/task-loop.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return $});var $=function(){function H(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var M=H.prototype;return M.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},M.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},M.onHandlerDestroyed=function(){},M.hasInterval=function(){return!!this._tickInterval},M.hasNextTick=function(){return!!this._tickTimer},M.setInterval=function(G){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,G),!0)},M.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},M.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},M.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},M.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},M.doTick=function(){},H}()},"./src/types/cmcd.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"CMCDVersion",function(){return $}),N.d(Y,"CMCDObjectType",function(){return H}),N.d(Y,"CMCDStreamingFormat",function(){return M}),N.d(Y,"CMCDStreamType",function(){return K});var $=1,H;(function(G){G.MANIFEST="m",G.AUDIO="a",G.VIDEO="v",G.MUXED="av",G.INIT="i",G.CAPTION="c",G.TIMED_TEXT="tt",G.KEY="k",G.OTHER="o"})(H||(H={}));var M;(function(G){G.DASH="d",G.HLS="h",G.SMOOTH="s",G.OTHER="o"})(M||(M={}));var K;(function(G){G.VOD="v",G.LIVE="l"})(K||(K={}))},"./src/types/level.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"HlsSkip",function(){return M}),N.d(Y,"getSkipValue",function(){return K}),N.d(Y,"HlsUrlParameters",function(){return G}),N.d(Y,"Level",function(){return n});function $(O,v){for(var p=0;p<v.length;p++){var m=v[p];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(O,m.key,m)}}function H(O,v,p){return v&&$(O.prototype,v),p&&$(O,p),O}var M;(function(O){O.No="",O.Yes="YES",O.v2="v2"})(M||(M={}));function K(O,v){var p=O.canSkipUntil,m=O.canSkipDateRanges,u=O.endSN,l=v!==void 0?v-u:0;return p&&l<p?m?M.v2:M.Yes:M.No}var G=function(){function O(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 v=O.prototype;return v.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()},O}(),n=function(){function O(v){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=[v.url],this.attrs=v.attrs,this.bitrate=v.bitrate,v.details&&(this.details=v.details),this.id=v.id||0,this.name=v.name,this.width=v.width||0,this.height=v.height||0,this.audioCodec=v.audioCodec,this.videoCodec=v.videoCodec,this.unknownCodecs=v.unknownCodecs,this.codecSet=[v.videoCodec,v.audioCodec].filter(function(p){return p}).join(",").replace(/\.[^.,]+/g,"")}return H(O,[{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)}}]),O}()},"./src/types/loader.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"PlaylistContextType",function(){return $}),N.d(Y,"PlaylistLevelType",function(){return H});var $;(function(M){M.MANIFEST="manifest",M.LEVEL="level",M.AUDIO_TRACK="audioTrack",M.SUBTITLE_TRACK="subtitleTrack"})($||($={}));var H;(function(M){M.MAIN="main",M.AUDIO="audio",M.SUBTITLE="subtitle"})(H||(H={}))},"./src/types/transmuxer.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"ChunkMetadata",function(){return $});var $=function(K,G,n,O,v,p){O===void 0&&(O=0),v===void 0&&(v=-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=H(),this.buffering={audio:H(),video:H(),audiovideo:H()},this.level=K,this.sn=G,this.id=n,this.size=O,this.part=v,this.partial=p};function H(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"AttrList",function(){return M});var $=/^(\d+)x(\d+)$/,H=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,M=function(){function K(n){typeof n=="string"&&(n=K.parseAttrList(n));for(var O in n)n.hasOwnProperty(O)&&(this[O]=n[O])}var G=K.prototype;return G.decimalInteger=function(O){var v=parseInt(this[O],10);return v>Number.MAX_SAFE_INTEGER?Infinity:v},G.hexadecimalInteger=function(O){if(this[O]){var v=(this[O]||"0x").slice(2);v=(v.length&1?"0":"")+v;for(var p=new Uint8Array(v.length/2),m=0;m<v.length/2;m++)p[m]=parseInt(v.slice(m*2,m*2+2),16);return p}else return null},G.hexadecimalIntegerAsNumber=function(O){var v=parseInt(this[O],16);return v>Number.MAX_SAFE_INTEGER?Infinity:v},G.decimalFloatingPoint=function(O){return parseFloat(this[O])},G.optionalFloat=function(O,v){var p=this[O];return p?parseFloat(p):v},G.enumeratedString=function(O){return this[O]},G.bool=function(O){return this[O]==="YES"},G.decimalResolution=function(O){var v=$.exec(this[O]);return v===null?void 0:{width:parseInt(v[1],10),height:parseInt(v[2],10)}},K.parseAttrList=function(O){var v,p={},m='"';for(H.lastIndex=0;(v=H.exec(O))!==null;){var u=v[2];u.indexOf(m)===0&&u.lastIndexOf(m)===u.length-1&&(u=u.slice(1,-1)),p[v[1]]=u}return p},K}()},"./src/utils/binary-search.ts":function(le,Y,N){"use strict";N.r(Y);var $={search:function(M,K){for(var G=0,n=M.length-1,O=null,v=null;G<=n;){O=(G+n)/2|0,v=M[O];var p=K(v);if(p>0)G=O+1;else if(p<0)n=O-1;else return v}return null}};Y.default=$},"./src/utils/buffer-helper.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"BufferHelper",function(){return M});var $=N("./src/utils/logger.ts"),H={length:0,start:function(){return 0},end:function(){return 0}},M=function(){function K(){}return K.isBuffered=function(n,O){try{if(n){for(var v=K.getBuffered(n),p=0;p<v.length;p++)if(O>=v.start(p)&&O<=v.end(p))return!0}}catch(m){}return!1},K.bufferInfo=function(n,O,v){try{if(n){var p=K.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,O,v)}}catch(l){}return{len:0,start:O,end:O,nextStart:void 0}},K.bufferedInfo=function(n,O,v){O=Math.max(0,O),n.sort(function(T,k){var L=T.start-k.start;return L||k.end-T.end});var p=[];if(v)for(var m=0;m<n.length;m++){var u=p.length;if(u){var l=p[u-1].end;n[m].start-l<v?n[m].end>l&&(p[u-1].end=n[m].end):p.push(n[m])}else p.push(n[m])}else p=n;for(var d=0,o,h=O,s=O,a=0;a<p.length;a++){var A=p[a].start,E=p[a].end;if(O+v>=A&&O<E)h=A,s=E,d=s-O;else if(O+v<A){o=A;break}}return{len:d,start:h||0,end:s||0,nextStart:o}},K.getBuffered=function(n){try{return n.buffered}catch(O){return $.logger.log("failed to get media.buffered",O),H}},K}()},"./src/utils/cea-608-parser.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"Row",function(){return s}),N.d(Y,"CaptionScreen",function(){return a});var $=N("./src/utils/logger.ts"),H={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},M=function(R){var C=R;return H.hasOwnProperty(R)&&(C=H[R]),String.fromCharCode(C)},K=15,G=100,n={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},O={17:2,18:4,21:6,22:8,23:10,19:13,20:15},v={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(S){S[S.ERROR=0]="ERROR",S[S.TEXT=1]="TEXT",S[S.WARNING=2]="WARNING",S[S.INFO=2]="INFO",S[S.DEBUG=3]="DEBUG",S[S.DATA=3]="DATA"})(u||(u={}));var l=function(){function S(){this.time=null,this.verboseLevel=u.ERROR}var R=S.prototype;return R.log=function(f,w){this.verboseLevel>=f&&$.logger.log(this.time+" ["+f+"] "+w)},S}(),d=function(R){for(var C=[],f=0;f<R.length;f++)C.push(R[f].toString(16));return C},o=function(){function S(C,f,w,y,_){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=C||"white",this.underline=f||!1,this.italics=w||!1,this.background=y||"black",this.flash=_||!1}var R=S.prototype;return R.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},R.setStyles=function(f){for(var w=["foreground","underline","italics","background","flash"],y=0;y<w.length;y++){var _=w[y];f.hasOwnProperty(_)&&(this[_]=f[_])}},R.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},R.equals=function(f){return this.foreground===f.foreground&&this.underline===f.underline&&this.italics===f.italics&&this.background===f.background&&this.flash===f.flash},R.copy=function(f){this.foreground=f.foreground,this.underline=f.underline,this.italics=f.italics,this.background=f.background,this.flash=f.flash},R.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},S}(),h=function(){function S(C,f,w,y,_,j){this.uchar=void 0,this.penState=void 0,this.uchar=C||" ",this.penState=new o(f,w,y,_,j)}var R=S.prototype;return R.reset=function(){this.uchar=" ",this.penState.reset()},R.setChar=function(f,w){this.uchar=f,this.penState.copy(w)},R.setPenState=function(f){this.penState.copy(f)},R.equals=function(f){return this.uchar===f.uchar&&this.penState.equals(f.penState)},R.copy=function(f){this.uchar=f.uchar,this.penState.copy(f.penState)},R.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},S}(),s=function(){function S(C){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var f=0;f<G;f++)this.chars.push(new h);this.logger=C,this.pos=0,this.currPenState=new o}var R=S.prototype;return R.equals=function(f){for(var w=!0,y=0;y<G;y++)if(!this.chars[y].equals(f.chars[y])){w=!1;break}return w},R.copy=function(f){for(var w=0;w<G;w++)this.chars[w].copy(f.chars[w])},R.isEmpty=function(){for(var f=!0,w=0;w<G;w++)if(!this.chars[w].isEmpty()){f=!1;break}return f},R.setCursor=function(f){this.pos!==f&&(this.pos=f),this.pos<0?(this.logger.log(u.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>G&&(this.logger.log(u.DEBUG,"Too large cursor position "+this.pos),this.pos=G)},R.moveCursor=function(f){var w=this.pos+f;if(f>1)for(var y=this.pos+1;y<w+1;y++)this.chars[y].setPenState(this.currPenState);this.setCursor(w)},R.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},R.insertChar=function(f){f>=144&&this.backSpace();var w=M(f);if(this.pos>=G){this.logger.log(u.ERROR,"Cannot insert "+f.toString(16)+" ("+w+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(w,this.currPenState),this.moveCursor(1)},R.clearFromPos=function(f){var w;for(w=f;w<G;w++)this.chars[w].reset()},R.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},R.clearToEndOfRow=function(){this.clearFromPos(this.pos)},R.getTextString=function(){for(var f=[],w=!0,y=0;y<G;y++){var _=this.chars[y].uchar;_!==" "&&(w=!1),f.push(_)}return w?"":f.join("")},R.setPenStyles=function(f){this.currPenState.setStyles(f);var w=this.chars[this.pos];w.setPenState(this.currPenState)},S}(),a=function(){function S(C){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var f=0;f<K;f++)this.rows.push(new s(C));this.logger=C,this.currRow=K-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var R=S.prototype;return R.reset=function(){for(var f=0;f<K;f++)this.rows[f].clear();this.currRow=K-1},R.equals=function(f){for(var w=!0,y=0;y<K;y++)if(!this.rows[y].equals(f.rows[y])){w=!1;break}return w},R.copy=function(f){for(var w=0;w<K;w++)this.rows[w].copy(f.rows[w])},R.isEmpty=function(){for(var f=!0,w=0;w<K;w++)if(!this.rows[w].isEmpty()){f=!1;break}return f},R.backSpace=function(){var f=this.rows[this.currRow];f.backSpace()},R.clearToEndOfRow=function(){var f=this.rows[this.currRow];f.clearToEndOfRow()},R.insertChar=function(f){var w=this.rows[this.currRow];w.insertChar(f)},R.setPen=function(f){var w=this.rows[this.currRow];w.setPenStyles(f)},R.moveCursor=function(f){var w=this.rows[this.currRow];w.moveCursor(f)},R.setCursor=function(f){this.logger.log(u.INFO,"setCursor: "+f);var w=this.rows[this.currRow];w.setCursor(f)},R.setPAC=function(f){this.logger.log(u.INFO,"pacData = "+JSON.stringify(f));var w=f.row-1;if(this.nrRollUpRows&&w<this.nrRollUpRows-1&&(w=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==w){for(var y=0;y<K;y++)this.rows[y].clear();var _=this.currRow+1-this.nrRollUpRows,j=this.lastOutputScreen;if(j){var U=j.rows[_].cueStartTime,x=this.logger.time;if(U&&x!==null&&U<x)for(var F=0;F<this.nrRollUpRows;F++)this.rows[w-this.nrRollUpRows+F+1].copy(j.rows[_+F])}}this.currRow=w;var D=this.rows[this.currRow];if(f.indent!==null){var g=f.indent,W=Math.max(g-1,0);D.setCursor(f.indent),f.color=D.chars[W].penState.foreground}var J={foreground:f.color,underline:f.underline,italics:f.italics,background:"black",flash:!1};this.setPen(J)},R.setBkgData=function(f){this.logger.log(u.INFO,"bkgData = "+JSON.stringify(f)),this.backSpace(),this.setPen(f),this.insertChar(32)},R.setRollUpRows=function(f){this.nrRollUpRows=f},R.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 f=this.currRow+1-this.nrRollUpRows,w=this.rows.splice(f,1)[0];w.clear(),this.rows.splice(this.currRow,0,w),this.logger.log(u.INFO,"Rolling up")},R.getDisplayText=function(f){f=f||!1;for(var w=[],y="",_=-1,j=0;j<K;j++){var U=this.rows[j].getTextString();U&&(_=j+1,f?w.push("Row "+_+": '"+U+"'"):w.push(U.trim()))}return w.length>0&&(f?y="["+w.join(" | ")+"]":y=w.join(`
|
|
`)),y},R.getTextAndFormat=function(){return this.rows},S}(),A=function(){function S(C,f,w){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=C,this.outputFilter=f,this.mode=null,this.verbose=0,this.displayedMemory=new a(w),this.nonDisplayedMemory=new a(w),this.lastOutputScreen=new a(w),this.currRollUpRow=this.displayedMemory.rows[K-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=w}var R=S.prototype;return R.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[K-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},R.getHandler=function(){return this.outputFilter},R.setHandler=function(f){this.outputFilter=f},R.setPAC=function(f){this.writeScreen.setPAC(f)},R.setBkgData=function(f){this.writeScreen.setBkgData(f)},R.setMode=function(f){if(f===this.mode)return;this.mode=f,this.logger.log(u.INFO,"MODE="+f),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=f},R.insertChars=function(f){for(var w=0;w<f.length;w++)this.writeScreen.insertChar(f[w]);var y=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(u.INFO,y+": "+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())},R.ccRCL=function(){this.logger.log(u.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},R.ccBS=function(){if(this.logger.log(u.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},R.ccAOF=function(){},R.ccAON=function(){},R.ccDER=function(){this.logger.log(u.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},R.ccRU=function(f){this.logger.log(u.INFO,"RU("+f+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(f)},R.ccFON=function(){this.logger.log(u.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},R.ccRDC=function(){this.logger.log(u.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},R.ccTR=function(){this.logger.log(u.INFO,"TR"),this.setMode("MODE_TEXT")},R.ccRTD=function(){this.logger.log(u.INFO,"RTD"),this.setMode("MODE_TEXT")},R.ccEDM=function(){this.logger.log(u.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},R.ccCR=function(){this.logger.log(u.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},R.ccENM=function(){this.logger.log(u.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},R.ccEOC=function(){if(this.logger.log(u.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var f=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=f,this.writeScreen=this.nonDisplayedMemory,this.logger.log(u.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},R.ccTO=function(f){this.logger.log(u.INFO,"TO("+f+") - Tab Offset"),this.writeScreen.moveCursor(f)},R.ccMIDROW=function(f){var w={flash:!1};if(w.underline=f%2===1,w.italics=f>=46,w.italics)w.foreground="white";else{var y=Math.floor(f/2)-16,_=["white","green","blue","cyan","red","yellow","magenta"];w.foreground=_[y]}this.logger.log(u.INFO,"MIDROW: "+JSON.stringify(w)),this.writeScreen.setPen(w)},R.outputDataUpdate=function(f){f===void 0&&(f=!1);var w=this.logger.time;if(w===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=w:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,w,this.lastOutputScreen),f&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:w),this.lastOutputScreen.copy(this.displayedMemory))},R.cueSplitAtTime=function(f){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,f,this.displayedMemory),this.cueStartTime=f))},S}(),E=function(){function S(C,f,w){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var y=new l;this.channels=[null,new A(C,f,y),new A(C+1,w,y)],this.cmdHistory=L(),this.logger=y}var R=S.prototype;return R.getHandler=function(f){return this.channels[f].getHandler()},R.setHandler=function(f,w){this.channels[f].setHandler(w)},R.addData=function(f,w){var y,_,j,U=!1;this.logger.time=f;for(var x=0;x<w.length;x+=2){if(_=w[x]&127,j=w[x+1]&127,_===0&&j===0)continue;if(this.logger.log(u.DATA,"["+d([w[x],w[x+1]])+"] -> ("+d([_,j])+")"),y=this.parseCmd(_,j),y||(y=this.parseMidrow(_,j)),y||(y=this.parsePAC(_,j)),y||(y=this.parseBackgroundAttributes(_,j)),!y&&(U=this.parseChars(_,j),U)){var F=this.currentChannel;if(F&&F>0){var D=this.channels[F];D.insertChars(U)}else this.logger.log(u.WARNING,"No channel found yet. TEXT-MODE?")}!y&&!U&&this.logger.log(u.WARNING,"Couldn't parse cleaned data "+d([_,j])+" orig: "+d([w[x],w[x+1]]))}},R.parseCmd=function(f,w){var y=this.cmdHistory,_=(f===20||f===28||f===21||f===29)&&w>=32&&w<=47,j=(f===23||f===31)&&w>=33&&w<=35;if(!(_||j))return!1;if(k(f,w,y))return T(null,null,y),this.logger.log(u.DEBUG,"Repeated command ("+d([f,w])+") is dropped"),!0;var U=f===20||f===21||f===23?1:2,x=this.channels[U];return f===20||f===21||f===28||f===29?w===32?x.ccRCL():w===33?x.ccBS():w===34?x.ccAOF():w===35?x.ccAON():w===36?x.ccDER():w===37?x.ccRU(2):w===38?x.ccRU(3):w===39?x.ccRU(4):w===40?x.ccFON():w===41?x.ccRDC():w===42?x.ccTR():w===43?x.ccRTD():w===44?x.ccEDM():w===45?x.ccCR():w===46?x.ccENM():w===47&&x.ccEOC():x.ccTO(w-32),T(f,w,y),this.currentChannel=U,!0},R.parseMidrow=function(f,w){var y=0;if((f===17||f===25)&&w>=32&&w<=47){if(f===17?y=1:y=2,y!==this.currentChannel)return this.logger.log(u.ERROR,"Mismatch channel in midrow parsing"),!1;var _=this.channels[y];return _?(_.ccMIDROW(w),this.logger.log(u.DEBUG,"MIDROW ("+d([f,w])+")"),!0):!1}return!1},R.parsePAC=function(f,w){var y,_=this.cmdHistory,j=(f>=17&&f<=23||f>=25&&f<=31)&&w>=64&&w<=127,U=(f===16||f===24)&&w>=64&&w<=95;if(!(j||U))return!1;if(k(f,w,_))return T(null,null,_),!0;var x=f<=23?1:2;w>=64&&w<=95?y=x===1?n[f]:v[f]:y=x===1?O[f]:p[f];var F=this.channels[x];return F?(F.setPAC(this.interpretPAC(y,w)),T(f,w,_),this.currentChannel=x,!0):!1},R.interpretPAC=function(f,w){var y,_={color:null,italics:!1,indent:null,underline:!1,row:f};return w>95?y=w-96:y=w-64,_.underline=(y&1)===1,y<=13?_.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(y/2)]:y<=15?(_.italics=!0,_.color="white"):_.indent=Math.floor((y-16)/2)*4,_},R.parseChars=function(f,w){var y,_=null,j=null;if(f>=25?(y=2,j=f-8):(y=1,j=f),j>=17&&j<=19){var U;j===17?U=w+80:j===18?U=w+112:U=w+144,this.logger.log(u.INFO,"Special char '"+M(U)+"' in channel "+y),_=[U]}else f>=32&&f<=127&&(_=w===0?[f]:[f,w]);if(_){var x=d(_);this.logger.log(u.DEBUG,"Char codes = "+x.join(",")),T(f,w,this.cmdHistory)}return _},R.parseBackgroundAttributes=function(f,w){var y=(f===16||f===24)&&w>=32&&w<=47,_=(f===23||f===31)&&w>=45&&w<=47;if(!(y||_))return!1;var j,U={};f===16||f===24?(j=Math.floor((w-32)/2),U.background=m[j],w%2===1&&(U.background=U.background+"_semi")):w===45?U.background="transparent":(U.foreground="black",w===47&&(U.underline=!0));var x=f<=23?1:2,F=this.channels[x];return F.setBkgData(U),T(f,w,this.cmdHistory),!0},R.reset=function(){for(var f=0;f<Object.keys(this.channels).length;f++){var w=this.channels[f];w&&w.reset()}this.cmdHistory=L()},R.cueSplitAtTime=function(f){for(var w=0;w<this.channels.length;w++){var y=this.channels[w];y&&y.cueSplitAtTime(f)}},S}();function T(S,R,C){C.a=S,C.b=R}function k(S,R,C){return C.a===S&&C.b===R}function L(){return{a:null,b:null}}Y.default=E},"./src/utils/codecs.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"isCodecType",function(){return H}),N.d(Y,"isCodecSupportedInMp4",function(){return M});var $={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 H(K,G){var n=$[G];return!!n&&n[K.slice(0,4)]===!0}function M(K,G){return MediaSource.isTypeSupported((G||"video")+'/mp4;codecs="'+K+'"')}},"./src/utils/cues.ts":function(le,Y,N){"use strict";N.r(Y);var $=N("./src/utils/vttparser.ts"),H=N("./src/utils/webvtt-parser.ts"),M=N("./src/utils/texttrack-utils.ts"),K=/\s/,G={newCue:function(O,v,p,m){for(var u=[],l,d,o,h,s,a=self.VTTCue||self.TextTrackCue,A=0;A<m.rows.length;A++)if(l=m.rows[A],o=!0,h=0,s="",!l.isEmpty()){for(var E=0;E<l.chars.length;E++)K.test(l.chars[E].uchar)&&o?h++:(s+=l.chars[E].uchar,o=!1);l.cueStartTime=v,v===p&&(p+=1e-4),h>=16?h--:h++;var T=Object($.fixLineBreaks)(s.trim()),k=Object(H.generateCueId)(v,p,T);(!O||!O.cues||!O.cues.getCueById(k))&&(d=new a(v,p,T),d.id=k,d.line=A+1,d.align="left",d.position=10+Math.min(80,Math.floor(h*8/32)*10),u.push(d))}return O&&u.length&&(u.sort(function(L,S){return L.line==="auto"||S.line==="auto"?0:L.line>8&&S.line>8?S.line-L.line:L.line-S.line}),u.forEach(function(L){return Object(M.addCueToTrack)(O,L)})),u}};Y.default=G},"./src/utils/discontinuities.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"findFirstFragWithCC",function(){return K}),N.d(Y,"shouldAlignOnDiscontinuities",function(){return G}),N.d(Y,"findDiscontinuousReferenceFrag",function(){return n}),N.d(Y,"adjustSlidingStart",function(){return v}),N.d(Y,"alignStream",function(){return p}),N.d(Y,"alignPDT",function(){return u}),N.d(Y,"alignFragmentByPDTDelta",function(){return l}),N.d(Y,"alignMediaPlaylistByPDT",function(){return d});var $=N("./src/polyfills/number.ts"),H=N("./src/utils/logger.ts"),M=N("./src/controller/level-helper.ts");function K(o,h){for(var s=null,a=0,A=o.length;a<A;a++){var E=o[a];if(E&&E.cc===h){s=E;break}}return s}function G(o,h,s){return!!(h.details&&(s.endCC>s.startCC||o&&o.cc<s.startCC))}function n(o,h){var s=o.fragments,a=h.fragments;if(!a.length||!s.length){H.logger.log("No fragments to align");return}var A=K(s,a[0].cc);if(!A||A&&!A.startPTS){H.logger.log("No frag in previous level to align on");return}return A}function O(o,h){if(o){var s=o.start+h;o.start=o.startPTS=s,o.endPTS=s+o.duration}}function v(o,h){for(var s=h.fragments,a=0,A=s.length;a<A;a++)O(s[a],o);h.fragmentHint&&O(h.fragmentHint,o),h.alignedSliding=!0}function p(o,h,s){if(!h)return;m(o,s,h),!s.alignedSliding&&h.details&&u(s,h.details),!s.alignedSliding&&h.details&&!s.skippedSegments&&Object(M.adjustSliding)(h.details,s)}function m(o,h,s){if(G(o,s,h)){var a=n(s.details,h);a&&Object($.isFiniteNumber)(a.start)&&(H.logger.log("Adjusting PTS using last level due to CC increase within current level "+h.url),v(a.start,h))}}function u(o,h){if(!h.fragments.length||!o.hasProgramDateTime||!h.hasProgramDateTime)return;var s=h.fragments[0].programDateTime,a=o.fragments[0].programDateTime,A=(a-s)/1e3+h.fragments[0].start;A&&Object($.isFiniteNumber)(A)&&(H.logger.log("Adjusting PTS using programDateTime delta "+(a-s)+"ms, sliding:"+A.toFixed(3)+" "+o.url+" "),v(A,o))}function l(o,h){var s=o.programDateTime;if(!s)return;var a=(s-h)/1e3;o.start=o.startPTS=a,o.endPTS=a+o.duration}function d(o,h){if(!h.fragments.length||!o.hasProgramDateTime||!h.hasProgramDateTime)return;var s=h.fragments[0].programDateTime,a=h.fragments[0].start,A=s-a*1e3;o.fragments.forEach(function(E){l(E,A)}),o.fragmentHint&&l(o.fragmentHint,A),o.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(le,Y,N){"use strict";N.r(Y);var $=N("./src/utils/ewma.ts"),H=function(){function M(G,n,O){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=O,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new $.default(G),this.fast_=new $.default(n)}var K=M.prototype;return K.update=function(n,O){var v=this.slow_,p=this.fast_;this.slow_.halfLife!==n&&(this.slow_=new $.default(n,v.getEstimate(),v.getTotalWeight())),this.fast_.halfLife!==O&&(this.fast_=new $.default(O,p.getEstimate(),p.getTotalWeight()))},K.sample=function(n,O){n=Math.max(n,this.minDelayMs_);var v=8*O,p=n/1e3,m=v/p;this.fast_.sample(p,m),this.slow_.sample(p,m)},K.canEstimate=function(){var n=this.fast_;return n&&n.getTotalWeight()>=this.minWeight_},K.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},K.destroy=function(){},M}();Y.default=H},"./src/utils/ewma.ts":function(le,Y,N){"use strict";N.r(Y);var $=function(){function H(K,G,n){G===void 0&&(G=0),n===void 0&&(n=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=K,this.alpha_=K?Math.exp(Math.log(.5)/K):0,this.estimate_=G,this.totalWeight_=n}var M=H.prototype;return M.sample=function(G,n){var O=Math.pow(this.alpha_,G);this.estimate_=n*(1-O)+O*this.estimate_,this.totalWeight_+=G},M.getTotalWeight=function(){return this.totalWeight_},M.getEstimate=function(){if(this.alpha_){var G=1-Math.pow(this.alpha_,this.totalWeight_);if(G)return this.estimate_/G}return this.estimate_},H}();Y.default=$},"./src/utils/fetch-loader.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"fetchSupported",function(){return l});var $=N("./src/polyfills/number.ts"),H=N("./src/loader/load-stats.ts"),M=N("./src/demux/chunk-cache.ts");function K(a,A){a.prototype=Object.create(A.prototype),a.prototype.constructor=a,p(a,A)}function G(a){var A=typeof Map=="function"?new Map:void 0;return G=function(T){if(T===null||!v(T))return T;if(typeof T!="function")throw new TypeError("Super expression must either be null or a function");if(typeof A!="undefined"){if(A.has(T))return A.get(T);A.set(T,k)}function k(){return n(T,arguments,m(this).constructor)}return k.prototype=Object.create(T.prototype,{constructor:{value:k,enumerable:!1,writable:!0,configurable:!0}}),p(k,T)},G(a)}function n(a,A,E){return O()?n=Reflect.construct:n=function(k,L,S){var R=[null];R.push.apply(R,L);var C=Function.bind.apply(k,R),f=new C;return S&&p(f,S.prototype),f},n.apply(null,arguments)}function O(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(a){return!1}}function v(a){return Function.toString.call(a).indexOf("[native code]")!==-1}function p(a,A){return p=Object.setPrototypeOf||function(T,k){return T.__proto__=k,T},p(a,A)}function m(a){return m=Object.setPrototypeOf?Object.getPrototypeOf:function(E){return E.__proto__||Object.getPrototypeOf(E)},m(a)}function u(){return u=Object.assign||function(a){for(var A=1;A<arguments.length;A++){var E=arguments[A];for(var T in E)Object.prototype.hasOwnProperty.call(E,T)&&(a[T]=E[T])}return a},u.apply(this,arguments)}function l(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(a){}return!1}var d=function(){function a(E){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=void 0,this.response=void 0,this.controller=void 0,this.context=void 0,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=E.fetchSetup||h,this.controller=new self.AbortController,this.stats=new H.LoadStats}var A=a.prototype;return A.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},A.abortInternal=function(){var T=this.response;(!T||!T.ok)&&(this.stats.aborted=!0,this.controller.abort())},A.abort=function(){var T;this.abortInternal(),(T=this.callbacks)!==null&&T!==void 0&&T.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},A.load=function(T,k,L){var S=this,R=this.stats;if(R.loading.start)throw new Error("Loader can only be used once.");R.loading.start=self.performance.now();var C=o(T,this.controller.signal),f=L.onProgress,w=T.responseType==="arraybuffer",y=w?"byteLength":"length";this.context=T,this.config=k,this.callbacks=L,this.request=this.fetchSetup(T,C),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){S.abortInternal(),L.onTimeout(R,T,S.response)},k.timeout),self.fetch(this.request).then(function(_){if(S.response=S.loader=_,!_.ok){var j=_.status,U=_.statusText;throw new s(U||"fetch, bad network response",j,_)}return R.loading.first=Math.max(self.performance.now(),R.loading.start),R.total=parseInt(_.headers.get("Content-Length")||"0"),f&&Object($.isFiniteNumber)(k.highWaterMark)?S.loadProgressively(_,R,T,k.highWaterMark,f):w?_.arrayBuffer():_.text()}).then(function(_){var j=S.response;self.clearTimeout(S.requestTimeout),R.loading.end=Math.max(self.performance.now(),R.loading.first),R.loaded=R.total=_[y];var U={url:j.url,data:_};f&&!Object($.isFiniteNumber)(k.highWaterMark)&&f(R,T,_,j),L.onSuccess(U,R,T,j)}).catch(function(_){if(self.clearTimeout(S.requestTimeout),R.aborted)return;var j=_.code||0;L.onError({code:j,text:_.message},T,_.details)})},A.getCacheAge=function(){var T=null;if(this.response){var k=this.response.headers.get("age");T=k?parseFloat(k):null}return T},A.loadProgressively=function(T,k,L,S,R){S===void 0&&(S=0);var C=new M.default,f=T.body.getReader(),w=function y(){return f.read().then(function(_){if(_.done)return C.dataLength&&R(k,L,C.flush(),T),Promise.resolve(new ArrayBuffer(0));var j=_.value,U=j.length;return k.loaded+=U,U<S||C.dataLength?(C.push(j),C.dataLength>=S&&R(k,L,C.flush(),T)):R(k,L,j,T),y()}).catch(function(){return Promise.reject()})};return w()},a}();function o(a,A){var E={method:"GET",mode:"cors",credentials:"same-origin",signal:A,headers:new self.Headers(u({},a.headers))};return a.rangeEnd&&E.headers.set("Range","bytes="+a.rangeStart+"-"+String(a.rangeEnd-1)),E}function h(a,A){return new self.Request(a.url,A)}var s=function(a){K(A,a);function A(E,T,k){var L;return L=a.call(this,E)||this,L.code=void 0,L.details=void 0,L.code=T,L.details=k,L}return A}(G(Error));Y.default=d},"./src/utils/imsc1-ttml-parser.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"IMSC1_CODEC",function(){return v}),N.d(Y,"parseIMSC1",function(){return l});var $=N("./src/utils/mp4-tools.ts"),H=N("./src/utils/vttparser.ts"),M=N("./src/utils/vttcue.ts"),K=N("./src/demux/id3.ts"),G=N("./src/utils/timescale-conversion.ts"),n=N("./src/utils/webvtt-parser.ts");function O(){return O=Object.assign||function(S){for(var R=1;R<arguments.length;R++){var C=arguments[R];for(var f in C)Object.prototype.hasOwnProperty.call(C,f)&&(S[f]=C[f])}return S},O.apply(this,arguments)}var v="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 l(S,R,C,f,w){var y=Object($.findBox)(new Uint8Array(S),["mdat"]);if(y.length===0){w(new Error("Could not parse IMSC1 mdat"));return}var _=y[0],j=Object(K.utf8ArrayToStr)(new Uint8Array(S,_.start,_.end-_.start)),U=Object(G.toTimescaleFromScale)(R,1,C);try{f(d(j,U))}catch(x){w(x)}}function d(S,R){var C=new DOMParser,f=C.parseFromString(S,"text/xml"),w=f.getElementsByTagName("tt")[0];if(!w)throw new Error("Invalid ttml");var y={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},_=Object.keys(y).reduce(function(D,g){return D[g]=w.getAttribute("ttp:"+g)||y[g],D},{}),j=w.getAttribute("xml:space")!=="preserve",U=h(o(w,"styling","style")),x=h(o(w,"layout","region")),F=o(w,"body","[begin]");return[].map.call(F,function(D){var g=s(D,j);if(!g||!D.hasAttribute("begin"))return null;var W=T(D.getAttribute("begin"),_),J=T(D.getAttribute("dur"),_),oe=T(D.getAttribute("end"),_);if(W===null)throw E(D);if(oe===null){if(J===null)throw E(D);oe=W+J}var fe=new M.default(W-R,oe-R,g);fe.id=Object(n.generateCueId)(fe.startTime,fe.endTime,fe.text);var Re=x[D.getAttribute("region")],be=U[D.getAttribute("style")];fe.position=10,fe.size=80;var Le=a(Re,be),Ce=Le.textAlign;if(Ce){var Te=u[Ce];Te&&(fe.lineAlign=Te),fe.align=Ce}return O(fe,Le),fe}).filter(function(D){return D!==null})}function o(S,R,C){var f=S.getElementsByTagName(R)[0];return f?[].slice.call(f.querySelectorAll(C)):[]}function h(S){return S.reduce(function(R,C){var f=C.getAttribute("xml:id");return f&&(R[f]=C),R},{})}function s(S,R){return[].slice.call(S.childNodes).reduce(function(C,f,w){var y;return f.nodeName==="br"&&w?C+`
|
|
`:(y=f.childNodes)!==null&&y!==void 0&&y.length?s(f,R):R?C+f.textContent.trim().replace(/\s+/g," "):C+f.textContent},"")}function a(S,R){var C="http://www.w3.org/ns/ttml#styling",f=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return f.reduce(function(w,y){var _=A(R,C,y)||A(S,C,y);return _&&(w[y]=_),w},{})}function A(S,R,C){return S.hasAttributeNS(R,C)?S.getAttributeNS(R,C):null}function E(S){return new Error("Could not parse ttml timestamp "+S)}function T(S,R){if(!S)return null;var C=Object(H.parseTimeStamp)(S);return C===null&&(p.test(S)?C=k(S,R):m.test(S)&&(C=L(S,R))),C}function k(S,R){var C=p.exec(S),f=(C[4]|0)+(C[5]|0)/R.subFrameRate;return(C[1]|0)*3600+(C[2]|0)*60+(C[3]|0)+f/R.frameRate}function L(S,R){var C=m.exec(S),f=Number(C[1]),w=C[2];switch(w){case"h":return f*3600;case"m":return f*60;case"ms":return f*1e3;case"f":return f/R.frameRate;case"t":return f/R.tickRate}return f}},"./src/utils/logger.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"enableLogs",function(){return n}),N.d(Y,"logger",function(){return O});var $=function(){},H={trace:$,debug:$,log:$,warn:$,info:$,error:$},M=H;function K(v){var p=self.console[v];return p?p.bind(self.console,"["+v+"] >"):$}function G(v){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(l){M[l]=v[l]?v[l].bind(v):K(l)})}function n(v){if(self.console&&v===!0||typeof v=="object"){G(v,"debug","log","info","warn","error");try{M.log()}catch(p){M=H}}else M=H}var O=M},"./src/utils/mediakeys-helper.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"KeySystems",function(){return $}),N.d(Y,"requestMediaKeySystemAccess",function(){return H});var $;(function(M){M.WIDEVINE="com.widevine.alpha",M.PLAYREADY="com.microsoft.playready"})($||($={}));var H=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"getMediaSource",function(){return $});function $(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"bin2str",function(){return G}),N.d(Y,"readUint16",function(){return n}),N.d(Y,"readUint32",function(){return O}),N.d(Y,"writeUint32",function(){return v}),N.d(Y,"findBox",function(){return p}),N.d(Y,"parseSegmentIndex",function(){return m}),N.d(Y,"parseInitSegment",function(){return u}),N.d(Y,"getStartDTS",function(){return l}),N.d(Y,"getDuration",function(){return d}),N.d(Y,"computeRawDurationFromSamples",function(){return o}),N.d(Y,"offsetStartDTS",function(){return h}),N.d(Y,"segmentValidRange",function(){return s}),N.d(Y,"appendUint8Array",function(){return a});var $=N("./src/utils/typed-array.ts"),H=N("./src/loader/fragment.ts"),M=Math.pow(2,32)-1,K=[].push;function G(A){return String.fromCharCode.apply(null,A)}function n(A,E){"data"in A&&(E+=A.start,A=A.data);var T=A[E]<<8|A[E+1];return T<0?65536+T:T}function O(A,E){"data"in A&&(E+=A.start,A=A.data);var T=A[E]<<24|A[E+1]<<16|A[E+2]<<8|A[E+3];return T<0?4294967296+T:T}function v(A,E,T){"data"in A&&(E+=A.start,A=A.data),A[E]=T>>24,A[E+1]=T>>16&255,A[E+2]=T>>8&255,A[E+3]=T&255}function p(A,E){var T=[];if(!E.length)return T;var k,L,S;"data"in A?(k=A.data,L=A.start,S=A.end):(k=A,L=0,S=k.byteLength);for(var R=L;R<S;){var C=O(k,R),f=G(k.subarray(R+4,R+8)),w=C>1?R+C:S;if(f===E[0])if(E.length===1)T.push({data:k,start:R+8,end:w});else{var y=p({data:k,start:R+8,end:w},E.slice(1));y.length&&K.apply(T,y)}R=w}return T}function m(A){var E=p(A,["moov"]),T=E[0],k=T?T.end:null,L=p(A,["sidx"]);if(!L||!L[0])return null;var S=[],R=L[0],C=R.data[0],f=C===0?8:16,w=O(R,f);f+=4;var y=0,_=0;C===0?f+=8:f+=16,f+=2;var j=R.end+_,U=n(R,f);f+=2;for(var x=0;x<U;x++){var F=f,D=O(R,F);F+=4;var g=D&2147483647,W=(D&2147483648)>>>31;if(W===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var J=O(R,F);F+=4,S.push({referenceSize:g,subsegmentDuration:J,info:{duration:J/w,start:j,end:j+g-1}}),j+=g,F+=4,f=F}return{earliestPresentationTime:y,timescale:w,version:C,referencesCount:U,references:S,moovEndOffset:k}}function u(A){for(var E=[],T=p(A,["moov","trak"]),k=0;k<T.length;k++){var L=T[k],S=p(L,["tkhd"])[0];if(S){var R=S.data[S.start],C=R===0?12:20,f=O(S,C),w=p(L,["mdia","mdhd"])[0];if(w){R=w.data[w.start],C=R===0?12:20;var y=O(w,C),_=p(L,["mdia","hdlr"])[0];if(_){var j=G(_.data.subarray(_.start+8,_.start+12)),U={soun:H.ElementaryStreamTypes.AUDIO,vide:H.ElementaryStreamTypes.VIDEO}[j];if(U){var x=p(L,["mdia","minf","stbl","stsd"])[0],F=void 0;x&&(F=G(x.data.subarray(x.start+12,x.start+16))),E[f]={timescale:y,type:U},E[U]={timescale:y,id:f,codec:F}}}}}}var D=p(A,["moov","mvex","trex"]);return D.forEach(function(g){var W=O(g,4),J=E[W];J&&(J.default={duration:O(g,12),flags:O(g,20)})}),E}function l(A,E){return p(E,["moof","traf"]).reduce(function(T,k){var L=p(k,["tfdt"])[0],S=L.data[L.start],R=p(k,["tfhd"]).reduce(function(C,f){var w=O(f,4),y=A[w];if(y){var _=O(L,4);S===1&&(_*=Math.pow(2,32),_+=O(L,8));var j=y.timescale||9e4,U=_/j;if(isFinite(U)&&(C===null||U<C))return U}return C},null);return R!==null&&isFinite(R)&&(T===null||R<T)?R:T},null)||0}function d(A,E){for(var T=0,k=0,L=0,S=p(A,["moof","traf"]),R=0;R<S.length;R++){var C=S[R],f=p(C,["tfhd"])[0],w=O(f,4),y=E[w];if(!y)continue;var _=y.default,j=O(f,0)|(_==null?void 0:_.flags),U=_==null?void 0:_.duration;j&8&&(j&2?U=O(f,12):U=O(f,8));for(var x=y.timescale||9e4,F=p(C,["trun"]),D=0;D<F.length;D++){if(U){var g=O(F[D],4);T=U*g}else T=o(F[D]);y.type===H.ElementaryStreamTypes.VIDEO?k+=T/x:y.type===H.ElementaryStreamTypes.AUDIO&&(L+=T/x)}}if(k===0&&L===0){var W=m(A);if(W!=null&&W.references)return W.references.reduce(function(J,oe){return J+oe.info.duration||0},0)}return k||L}function o(A){var E=O(A,0),T=8;E&1&&(T+=4),E&4&&(T+=4);for(var k=0,L=O(A,4),S=0;S<L;S++){if(E&256){var R=O(A,T);k+=R,T+=4}E&512&&(T+=4),E&1024&&(T+=4),E&2048&&(T+=4)}return k}function h(A,E,T){p(E,["moof","traf"]).forEach(function(k){p(k,["tfhd"]).forEach(function(L){var S=O(L,4),R=A[S];if(!R)return;var C=R.timescale||9e4;p(k,["tfdt"]).forEach(function(f){var w=f.data[f.start],y=O(f,4);if(w===0)v(f,4,y-T*C);else{y*=Math.pow(2,32),y+=O(f,8),y-=T*C,y=Math.max(y,0);var _=Math.floor(y/(M+1)),j=Math.floor(y%(M+1));v(f,4,_),v(f,8,j)}})})})}function s(A){var E={valid:null,remainder:null},T=p(A,["moof"]);if(T){if(T.length<2)return E.remainder=A,E}else return E;var k=T[T.length-1];return E.valid=Object($.sliceUint8)(A,0,k.start-8),E.remainder=Object($.sliceUint8)(A,k.start-8),E}function a(A,E){var T=new Uint8Array(A.length+E.length);return T.set(A),T.set(E,A.length),T}},"./src/utils/output-filter.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return $});var $=function(){function H(K,G){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=K,this.trackName=G}var M=H.prototype;return M.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},M.newCue=function(G,n,O){(this.startTime===null||this.startTime>G)&&(this.startTime=G),this.endTime=n,this.screen=O,this.timelineController.createCaptionsTrack(this.trackName)},M.reset=function(){this.cueRanges=[]},H}()},"./src/utils/texttrack-utils.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"sendAddTrackEvent",function(){return H}),N.d(Y,"addCueToTrack",function(){return M}),N.d(Y,"clearCurrentCues",function(){return K}),N.d(Y,"removeCuesInRange",function(){return G}),N.d(Y,"getCuesInRange",function(){return O});var $=N("./src/utils/logger.ts");function H(v,p){var m;try{m=new Event("addtrack")}catch(u){m=document.createEvent("Event"),m.initEvent("addtrack",!1,!1)}m.track=v,p.dispatchEvent(m)}function M(v,p){var m=v.mode;if(m==="disabled"&&(v.mode="hidden"),v.cues&&!v.cues.getCueById(p.id))try{if(v.addCue(p),!v.cues.getCueById(p.id))throw new Error("addCue is failed for: "+p)}catch(l){$.logger.debug("[texttrack-utils]: "+l);var u=new self.TextTrackCue(p.startTime,p.endTime,p.text);u.id=p.id,v.addCue(u)}m==="disabled"&&(v.mode=m)}function K(v){var p=v.mode;if(p==="disabled"&&(v.mode="hidden"),v.cues)for(var m=v.cues.length;m--;)v.removeCue(v.cues[m]);p==="disabled"&&(v.mode=p)}function G(v,p,m){var u=v.mode;if(u==="disabled"&&(v.mode="hidden"),v.cues&&v.cues.length>0)for(var l=O(v.cues,p,m),d=0;d<l.length;d++)v.removeCue(l[d]);u==="disabled"&&(v.mode=u)}function n(v,p){if(p<v[0].startTime)return 0;var m=v.length-1;if(p>v[m].endTime)return-1;for(var u=0,l=m;u<=l;){var d=Math.floor((l+u)/2);if(p<v[d].startTime)l=d-1;else if(p>v[d].startTime&&u<m)u=d+1;else return d}return v[u].startTime-p<p-v[l].startTime?u:l}function O(v,p,m){var u=[],l=n(v,p);if(l>-1)for(var d=l,o=v.length;d<o;d++){var h=v[d];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(le,Y,N){"use strict";N.r(Y);var $={toString:function(M){for(var K="",G=M.length,n=0;n<G;n++)K+="["+M.start(n).toFixed(3)+","+M.end(n).toFixed(3)+"]";return K}};Y.default=$},"./src/utils/timescale-conversion.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"toTimescaleFromBase",function(){return H}),N.d(Y,"toTimescaleFromScale",function(){return M}),N.d(Y,"toMsFromMpegTsClock",function(){return K}),N.d(Y,"toMpegTsClockFromTimescale",function(){return G});var $=9e4;function H(n,O,v,p){v===void 0&&(v=1),p===void 0&&(p=!1);var m=n*O*v;return p?Math.round(m):m}function M(n,O,v,p){return v===void 0&&(v=1),p===void 0&&(p=!1),H(n,O,1/v,p)}function K(n,O){return O===void 0&&(O=!1),H(n,1e3,1/$,O)}function G(n,O){return O===void 0&&(O=1),H(n,$,1/O)}},"./src/utils/typed-array.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"sliceUint8",function(){return $});function $(H,M,K){return Uint8Array.prototype.slice?H.slice(M,K):new Uint8Array(Array.prototype.slice.call(H,M,K))}},"./src/utils/vttcue.ts":function(le,Y,N){"use strict";N.r(Y),Y.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var $=["","lr","rl"],H=["start","middle","end","left","right"];function M(v,p){if(typeof p!="string")return!1;if(!Array.isArray(v))return!1;var m=p.toLowerCase();return~v.indexOf(m)?m:!1}function K(v){return M($,v)}function G(v){return M(H,v)}function n(v){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 l=1;l<arguments.length;l++){var d=arguments[l];for(var o in d)v[o]=d[o]}return v}function O(v,p,m){var u=this,l={enumerable:!0};u.hasBeenReset=!1;var d="",o=!1,h=v,s=p,a=m,A=null,E="",T=!0,k="auto",L="start",S=50,R="middle",C=50,f="middle";Object.defineProperty(u,"id",n({},l,{get:function(){return d},set:function(y){d=""+y}})),Object.defineProperty(u,"pauseOnExit",n({},l,{get:function(){return o},set:function(y){o=!!y}})),Object.defineProperty(u,"startTime",n({},l,{get:function(){return h},set:function(y){if(typeof y!="number")throw new TypeError("Start time must be set to a number.");h=y,this.hasBeenReset=!0}})),Object.defineProperty(u,"endTime",n({},l,{get:function(){return s},set:function(y){if(typeof y!="number")throw new TypeError("End time must be set to a number.");s=y,this.hasBeenReset=!0}})),Object.defineProperty(u,"text",n({},l,{get:function(){return a},set:function(y){a=""+y,this.hasBeenReset=!0}})),Object.defineProperty(u,"region",n({},l,{get:function(){return A},set:function(y){A=y,this.hasBeenReset=!0}})),Object.defineProperty(u,"vertical",n({},l,{get:function(){return E},set:function(y){var _=K(y);if(_===!1)throw new SyntaxError("An invalid or illegal string was specified.");E=_,this.hasBeenReset=!0}})),Object.defineProperty(u,"snapToLines",n({},l,{get:function(){return T},set:function(y){T=!!y,this.hasBeenReset=!0}})),Object.defineProperty(u,"line",n({},l,{get:function(){return k},set:function(y){if(typeof y!="number"&&y!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");k=y,this.hasBeenReset=!0}})),Object.defineProperty(u,"lineAlign",n({},l,{get:function(){return L},set:function(y){var _=G(y);if(!_)throw new SyntaxError("An invalid or illegal string was specified.");L=_,this.hasBeenReset=!0}})),Object.defineProperty(u,"position",n({},l,{get:function(){return S},set:function(y){if(y<0||y>100)throw new Error("Position must be between 0 and 100.");S=y,this.hasBeenReset=!0}})),Object.defineProperty(u,"positionAlign",n({},l,{get:function(){return R},set:function(y){var _=G(y);if(!_)throw new SyntaxError("An invalid or illegal string was specified.");R=_,this.hasBeenReset=!0}})),Object.defineProperty(u,"size",n({},l,{get:function(){return C},set:function(y){if(y<0||y>100)throw new Error("Size must be between 0 and 100.");C=y,this.hasBeenReset=!0}})),Object.defineProperty(u,"align",n({},l,{get:function(){return f},set:function(y){var _=G(y);if(!_)throw new SyntaxError("An invalid or illegal string was specified.");f=_,this.hasBeenReset=!0}})),u.displayState=void 0}return O.prototype.getCueAsHTML=function(){var v=self.WebVTT;return v.convertCueToDOMTree(self,this.text)},O}()},"./src/utils/vttparser.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"parseTimeStamp",function(){return M}),N.d(Y,"fixLineBreaks",function(){return p}),N.d(Y,"VTTParser",function(){return m});var $=N("./src/utils/vttcue.ts"),H=function(){function u(){}var l=u.prototype;return l.decode=function(o,h){if(!o)return"";if(typeof o!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(o))},u}();function M(u){function l(o,h,s,a){return(o|0)*3600+(h|0)*60+(s|0)+parseFloat(a||0)}var d=u.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return d?parseFloat(d[2])>59?l(d[2],d[3],0,d[4]):l(d[1],d[2],d[3],d[4]):null}var K=function(){function u(){this.values=Object.create(null)}var l=u.prototype;return l.set=function(o,h){!this.get(o)&&h!==""&&(this.values[o]=h)},l.get=function(o,h,s){return s?this.has(o)?this.values[o]:h[s]:this.has(o)?this.values[o]:h},l.has=function(o){return o in this.values},l.alt=function(o,h,s){for(var a=0;a<s.length;++a)if(h===s[a]){this.set(o,h);break}},l.integer=function(o,h){/^-?\d+$/.test(h)&&this.set(o,parseInt(h,10))},l.percent=function(o,h){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(h)){var s=parseFloat(h);if(s>=0&&s<=100)return this.set(o,s),!0}return!1},u}();function G(u,l,d,o){var h=o?u.split(o):[u];for(var s in h){if(typeof h[s]!="string")continue;var a=h[s].split(d);if(a.length!==2)continue;var A=a[0],E=a[1];l(A,E)}}var n=new $.default(0,0,""),O=n.align==="middle"?"middle":"center";function v(u,l,d){var o=u;function h(){var A=M(u);if(A===null)throw new Error("Malformed timestamp: "+o);return u=u.replace(/^[^\sa-zA-Z-]+/,""),A}function s(A,E){var T=new K;G(A,function(S,R){var C;switch(S){case"region":for(var f=d.length-1;f>=0;f--)if(d[f].id===R){T.set(S,d[f].region);break}break;case"vertical":T.alt(S,R,["rl","lr"]);break;case"line":C=R.split(","),T.integer(S,C[0]),T.percent(S,C[0])&&T.set("snapToLines",!1),T.alt(S,C[0],["auto"]),C.length===2&&T.alt("lineAlign",C[1],["start",O,"end"]);break;case"position":C=R.split(","),T.percent(S,C[0]),C.length===2&&T.alt("positionAlign",C[1],["start",O,"end","line-left","line-right","auto"]);break;case"size":T.percent(S,R);break;case"align":T.alt(S,R,["start",O,"end","left","right"]);break}},/:/,/\s/),E.region=T.get("region",null),E.vertical=T.get("vertical","");var k=T.get("line","auto");k==="auto"&&n.line===-1&&(k=-1),E.line=k,E.lineAlign=T.get("lineAlign","start"),E.snapToLines=T.get("snapToLines",!0),E.size=T.get("size",100),E.align=T.get("align",O);var L=T.get("position","auto");L==="auto"&&n.position===50&&(L=E.align==="start"||E.align==="left"?0:E.align==="end"||E.align==="right"?100:50),E.position=L}function a(){u=u.replace(/^\s+/,"")}if(a(),l.startTime=h(),a(),u.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+o);u=u.substr(3),a(),l.endTime=h(),a(),s(u,l)}function p(u){return u.replace(/<br(?: \/)?>/gi,`
|
|
`)}var m=function(){function u(){this.state="INITIAL",this.buffer="",this.decoder=new H,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var l=u.prototype;return l.parse=function(o){var h=this;o&&(h.buffer+=h.decoder.decode(o,{stream:!0}));function s(){var L=h.buffer,S=0;for(L=p(L);S<L.length&&L[S]!=="\r"&&L[S]!==`
|
|
`;)++S;var R=L.substr(0,S);return L[S]==="\r"&&++S,L[S]===`
|
|
`&&++S,h.buffer=L.substr(S),R}function a(L){G(L,function(S,R){},/:/)}try{var A="";if(h.state==="INITIAL"){if(!/\r\n|\n/.test(h.buffer))return this;A=s();var E=A.match(/^()?WEBVTT([ \t].*)?$/);if(!E||!E[0])throw new Error("Malformed WebVTT signature.");h.state="HEADER"}for(var T=!1;h.buffer;){if(!/\r\n|\n/.test(h.buffer))return this;T?T=!1:A=s();switch(h.state){case"HEADER":/:/.test(A)?a(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 $.default(0,0,""),h.state="CUE",A.indexOf("-->")===-1){h.cue.id=A;continue}case"CUE":if(!h.cue){h.state="BADCUE";continue}try{v(A,h.cue,h.regionList)}catch(L){h.cue=null,h.state="BADCUE";continue}h.state="CUETEXT";continue;case"CUETEXT":{var k=A.indexOf("-->")!==-1;if(!A||k&&(T=!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(L){h.state==="CUETEXT"&&h.cue&&h.oncue&&h.oncue(h.cue),h.cue=null,h.state=h.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},l.flush=function(){var o=this;try{if((o.cue||o.state==="HEADER")&&(o.buffer+=`
|
|
|
|
`,o.parse()),o.state==="INITIAL"||o.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(h){o.onparsingerror&&o.onparsingerror(h)}return o.onflush&&o.onflush(),this},u}()},"./src/utils/webvtt-parser.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"generateCueId",function(){return m}),N.d(Y,"parseWebVTT",function(){return l});var $=N("./src/polyfills/number.ts"),H=N("./src/utils/vttparser.ts"),M=N("./src/demux/id3.ts"),K=N("./src/utils/timescale-conversion.ts"),G=N("./src/remux/mp4-remuxer.ts"),n=/\r\n|\n\r|\n|\r/g,O=function(o,h,s){return s===void 0&&(s=0),o.substr(s,h.length)===h},v=function(o){var h=parseInt(o.substr(-3)),s=parseInt(o.substr(-6,2)),a=parseInt(o.substr(-9,2)),A=o.length>9?parseInt(o.substr(0,o.indexOf(":"))):0;if(!Object($.isFiniteNumber)(h)||!Object($.isFiniteNumber)(s)||!Object($.isFiniteNumber)(a)||!Object($.isFiniteNumber)(A))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+o);return h+=1e3*s,h+=60*1e3*a,h+=60*60*1e3*A,h},p=function(o){for(var h=5381,s=o.length;s;)h=h*33^o.charCodeAt(--s);return(h>>>0).toString()};function m(d,o,h){return p(d.toString())+p(o.toString())+p(h)}var u=function(o,h,s){var a=o[h],A=o[a.prevCC];if(!A||!A.new&&a.new){o.ccOffset=o.presentationOffset=a.start,a.new=!1;return}for(;(E=A)!==null&&E!==void 0&&E.new;){var E;o.ccOffset+=a.start-A.start,a.new=!1,a=A,A=o[a.prevCC]}o.presentationOffset=s};function l(d,o,h,s,a,A,E,T){var k=new H.VTTParser,L=Object(M.utf8ArrayToStr)(new Uint8Array(d)).trim().replace(n,`
|
|
`).split(`
|
|
`),S=[],R=Object(K.toMpegTsClockFromTimescale)(o,h),C="00:00.000",f=0,w=0,y,_=!0,j=!1;k.oncue=function(U){var x=s[a],F=s.ccOffset,D=(f-R)/9e4;if(x!=null&&x.new&&(w!==void 0?F=s.ccOffset=x.start:u(s,a,D)),D&&(F=D-s.presentationOffset),j){var g=U.endTime-U.startTime,W=Object(G.normalizePts)((U.startTime+F-w)*9e4,A*9e4)/9e4;U.startTime=W,U.endTime=W+g}var J=U.text.trim();U.text=decodeURIComponent(encodeURIComponent(J)),U.id||(U.id=m(U.startTime,U.endTime,J)),U.endTime>0&&S.push(U)},k.onparsingerror=function(U){y=U},k.onflush=function(){if(y){T(y);return}E(S)},L.forEach(function(U){if(_)if(O(U,"X-TIMESTAMP-MAP=")){_=!1,j=!0,U.substr(16).split(",").forEach(function(x){O(x,"LOCAL:")?C=x.substr(6):O(x,"MPEGTS:")&&(f=parseInt(x.substr(7)))});try{w=v(C)/1e3}catch(x){j=!1,y=x}return}else U===""&&(_=!1);k.parse(U+`
|
|
`)}),k.flush()}},"./src/utils/xhr-loader.ts":function(le,Y,N){"use strict";N.r(Y);var $=N("./src/utils/logger.ts"),H=N("./src/loader/load-stats.ts"),M=/^age:\s*[\d.]+\s*$/m,K=function(){function G(O){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=O?O.xhrSetup:null,this.stats=new H.LoadStats,this.retryDelay=0}var n=G.prototype;return n.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},n.abortInternal=function(){var v=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),v&&(v.onreadystatechange=null,v.onprogress=null,v.readyState!==4&&(this.stats.aborted=!0,v.abort()))},n.abort=function(){var v;this.abortInternal(),(v=this.callbacks)!==null&&v!==void 0&&v.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},n.load=function(v,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=v,this.config=p,this.callbacks=m,this.retryDelay=p.retryDelay,this.loadInternal()},n.loadInternal=function(){var v=this.config,p=this.context;if(!v)return;var m=this.loader=new self.XMLHttpRequest,u=this.stats;u.loading.first=0,u.loaded=0;var l=this.xhrSetup;try{if(l)try{l(m,p.url)}catch(h){m.open("GET",p.url,!0),l(m,p.url)}m.readyState||m.open("GET",p.url,!0);var d=this.context.headers;if(d)for(var o in d)m.setRequestHeader(o,d[o])}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),v.timeout),m.send()},n.readystatechange=function(){var v=this.context,p=this.loader,m=this.stats;if(!v||!p)return;var u=p.readyState,l=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 d=p.status;if(d>=200&&d<300){m.loading.end=Math.max(self.performance.now(),m.loading.first);var o,h;if(v.responseType==="arraybuffer"?(o=p.response,h=o.byteLength):(o=p.responseText,h=o.length),m.loaded=m.total=h,!this.callbacks)return;var s=this.callbacks.onProgress;if(s&&s(m,v,o,p),!this.callbacks)return;var a={url:p.responseURL,data:o};this.callbacks.onSuccess(a,m,v,p)}else m.retry>=l.maxRetry||d>=400&&d<499?($.logger.error(d+" while loading "+v.url),this.callbacks.onError({code:d,text:p.statusText},v,p)):($.logger.warn(d+" while loading "+v.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,l.maxRetryDelay),m.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),l.timeout)},n.loadtimeout=function(){$.logger.warn("timeout while loading "+this.context.url);var v=this.callbacks;v&&(this.abortInternal(),v.onTimeout(this.stats,this.context,this.loader))},n.loadprogress=function(v){var p=this.stats;p.loaded=v.loaded,v.lengthComputable&&(p.total=v.total)},n.getCacheAge=function(){var v=null;if(this.loader&&M.test(this.loader.getAllResponseHeaders())){var p=this.loader.getResponseHeader("age");v=p?parseFloat(p):null}return v},G}();Y.default=K}}).default})},vHTk:function(Ze,Se,q){Ze.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}}}]);
|