(window.webpackJsonp=window.webpackJsonp||[]).push([[274,5,6,7],{"+NIl":function(at,Ve,te){(function(ne){ne(te("VrN/"))})(function(ne){"use strict";ne.defineMode("stex",function(V,D){"use strict";function z(d,o){d.cmdState.push(o)}function N(d){return d.cmdState.length>0?d.cmdState[d.cmdState.length-1]:null}function M(d){var o=d.cmdState.pop();o&&o.closeBracket()}function W(d){for(var o=d.cmdState,c=o.length-1;c>=0;c--){var s=o[c];if(s.name=="DEFAULT")continue;return s}return{styleIdentifier:function(){return null}}}function B(d,o,c){return function(){this.name=d,this.bracketNo=0,this.style=o,this.styles=c,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var k={};k.importmodule=B("importmodule","tag",["string","builtin"]),k.documentclass=B("documentclass","tag",["","atom"]),k.usepackage=B("usepackage","tag",["atom"]),k.begin=B("begin","tag",["atom"]),k.end=B("end","tag",["atom"]),k.label=B("label","tag",["atom"]),k.ref=B("ref","tag",["atom"]),k.eqref=B("eqref","tag",["atom"]),k.cite=B("cite","tag",["atom"]),k.bibitem=B("bibitem","tag",["atom"]),k.Bibitem=B("Bibitem","tag",["atom"]),k.RBibitem=B("RBibitem","tag",["atom"]),k.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function R(d,o){d.f=o}function g(d,o){var c;if(d.match(/^\\[a-zA-Z@]+/)){var s=d.current().slice(1);return c=k.hasOwnProperty(s)?k[s]:k.DEFAULT,c=new c,z(o,c),R(o,f),c.style}if(d.match(/^\\[$&%#{}_]/))return"tag";if(d.match(/^\\[,;!\/\\]/))return"tag";if(d.match("\\["))return R(o,function(l,h){return p(l,h,"\\]")}),"keyword";if(d.match("\\("))return R(o,function(l,h){return p(l,h,"\\)")}),"keyword";if(d.match("$$"))return R(o,function(l,h){return p(l,h,"$$")}),"keyword";if(d.match("$"))return R(o,function(l,h){return p(l,h,"$")}),"keyword";var a=d.next();if(a=="%")return d.skipToEnd(),"comment";if(a=="}"||a=="]"){if(c=N(o),c)c.closeBracket(a),R(o,f);else return"error";return"bracket"}else return a=="{"||a=="["?(c=k.DEFAULT,c=new c,z(o,c),"bracket"):/\d/.test(a)?(d.eatWhile(/[\w.%]/),"atom"):(d.eatWhile(/[\w\-_]/),c=W(o),c.name=="begin"&&(c.argument=d.current()),c.styleIdentifier())}function p(d,o,c){if(d.eatSpace())return null;if(c&&d.match(c))return R(o,g),"keyword";if(d.match(/^\\[a-zA-Z@]+/))return"tag";if(d.match(/^[a-zA-Z]+/))return"variable-2";if(d.match(/^\\[$&%#{}_]/))return"tag";if(d.match(/^\\[,;!\/]/))return"tag";if(d.match(/^[\^_&]/))return"tag";if(d.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(d.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var s=d.next();return s=="{"||s=="}"||s=="["||s=="]"||s=="("||s==")"?"bracket":s=="%"?(d.skipToEnd(),"comment"):"error"}function f(d,o){var c=d.peek(),s;return c=="{"||c=="["?(s=N(o),s.openBracket(c),d.eat(c),R(o,g),"bracket"):/[ \t\r]/.test(c)?(d.eat(c),null):(R(o,g),M(o),g(d,o))}return{startState:function(){var d=D.inMathMode?function(o,c){return p(o,c)}:g;return{cmdState:[],f:d}},copyState:function(d){return{cmdState:d.cmdState.slice(),f:d.f}},token:function(d,o){return o.f(d,o)},blankLine:function(d){d.f=g,d.cmdState.length=0},lineComment:"%"}}),ne.defineMIME("text/x-stex","stex"),ne.defineMIME("text/x-latex","stex")})},"+ua5":function(at,Ve,te){},"19Vz":function(at,Ve,te){(function(ne){ne(te("VrN/"))})(function(ne){ne.defineOption("placeholder","",function(B,k,R){var g=R&&R!=ne.Init;if(k&&!g)B.on("blur",N),B.on("change",M),B.on("swapDoc",M),ne.on(B.getInputField(),"compositionupdate",B.state.placeholderCompose=function(){z(B)}),M(B);else if(!k&&g){B.off("blur",N),B.off("change",M),B.off("swapDoc",M),ne.off(B.getInputField(),"compositionupdate",B.state.placeholderCompose),V(B);var p=B.getWrapperElement();p.className=p.className.replace(" CodeMirror-empty","")}k&&!B.hasFocus()&&N(B)});function V(B){B.state.placeholder&&(B.state.placeholder.parentNode.removeChild(B.state.placeholder),B.state.placeholder=null)}function D(B){V(B);var k=B.state.placeholder=document.createElement("pre");k.style.cssText="height: 0; overflow: visible",k.style.direction=B.getOption("direction"),k.className="CodeMirror-placeholder CodeMirror-line-like";var R=B.getOption("placeholder");typeof R=="string"&&(R=document.createTextNode(R)),k.appendChild(R),B.display.lineSpace.insertBefore(k,B.display.lineSpace.firstChild)}function z(B){setTimeout(function(){var k=!1,R=B.getInputField();R.nodeName=="TEXTAREA"?k=!R.value:B.lineCount()==1&&(k=!/[^\u200b]/.test(R.querySelector(".CodeMirror-line").textContent)),k?D(B):V(B)},20)}function N(B){W(B)&&D(B)}function M(B){var k=B.getWrapperElement(),R=W(B);k.className=k.className.replace(" CodeMirror-empty","")+(R?" CodeMirror-empty":""),R?D(B):V(B)}function W(B){return B.lineCount()===1&&B.getLine(0)===""}})},"1eCo":function(at,Ve,te){(function(ne){ne(te("VrN/"))})(function(ne){"use strict";var V={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},D={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};ne.defineMode("xml",function(z,N){var M=z.indentUnit,W={},B=N.htmlMode?V:D;for(var k in B)W[k]=B[k];for(var k in N)W[k]=N[k];var R,g;function p(u,y){function m(I){return y.tokenize=I,I(u,y)}var b=u.next();if(b=="<")return u.eat("!")?u.eat("[")?u.match("CDATA[")?m(o("atom","]]>")):null:u.match("--")?m(o("comment","-->")):u.match("DOCTYPE",!0,!0)?(u.eatWhile(/[\w\._\-]/),m(c(1))):null:u.eat("?")?(u.eatWhile(/[\w\._\-]/),y.tokenize=o("meta","?>"),"meta"):(R=u.eat("/")?"closeTag":"openTag",y.tokenize=f,"tag bracket");if(b=="&"){var P;return u.eat("#")?u.eat("x")?P=u.eatWhile(/[a-fA-F\d]/)&&u.eat(";"):P=u.eatWhile(/[\d]/)&&u.eat(";"):P=u.eatWhile(/[\w\.\-:]/)&&u.eat(";"),P?"atom":"error"}else return u.eatWhile(/[^&<]/),null}p.isInText=!0;function f(u,y){var m=u.next();if(m==">"||m=="/"&&u.eat(">"))return y.tokenize=p,R=m==">"?"endTag":"selfcloseTag","tag bracket";if(m=="=")return R="equals",null;if(m=="<"){y.tokenize=p,y.state=h,y.tagName=y.tagStart=null;var b=y.tokenize(u,y);return b?b+" tag error":"tag error"}else return/[\'\"]/.test(m)?(y.tokenize=d(m),y.stringStartCol=u.column(),y.tokenize(u,y)):(u.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function d(u){var y=function(m,b){for(;!m.eol();)if(m.next()==u){b.tokenize=f;break}return"string"};return y.isInAttribute=!0,y}function o(u,y){return function(m,b){for(;!m.eol();){if(m.match(y)){b.tokenize=p;break}m.next()}return u}}function c(u){return function(y,m){for(var b;(b=y.next())!=null;){if(b=="<")return m.tokenize=c(u+1),m.tokenize(y,m);if(b==">")if(u==1){m.tokenize=p;break}else return m.tokenize=c(u-1),m.tokenize(y,m)}return"meta"}}function s(u,y,m){this.prev=u.context,this.tagName=y,this.indent=u.indented,this.startOfLine=m,(W.doNotIndent.hasOwnProperty(y)||u.context&&u.context.noIndent)&&(this.noIndent=!0)}function a(u){u.context&&(u.context=u.context.prev)}function l(u,y){for(var m;;){if(!u.context)return;if(m=u.context.tagName,!W.contextGrabbers.hasOwnProperty(m)||!W.contextGrabbers[m].hasOwnProperty(y))return;a(u)}}function h(u,y,m){return u=="openTag"?(m.tagStart=y.column(),O):u=="closeTag"?w:h}function O(u,y,m){return u=="word"?(m.tagName=y.current(),g="tag",S):W.allowMissingTagName&&u=="endTag"?(g="tag bracket",S(u,y,m)):(g="error",O)}function w(u,y,m){if(u=="word"){var b=y.current();return m.context&&m.context.tagName!=b&&W.implicitlyClosed.hasOwnProperty(m.context.tagName)&&a(m),m.context&&m.context.tagName==b||W.matchClosing===!1?(g="tag",x):(g="tag error",A)}else return W.allowMissingTagName&&u=="endTag"?(g="tag bracket",x(u,y,m)):(g="error",A)}function x(u,y,m){return u!="endTag"?(g="error",x):(a(m),h)}function A(u,y,m){return g="error",x(u,y,m)}function S(u,y,m){if(u=="word")return g="attribute",T;if(u=="endTag"||u=="selfcloseTag"){var b=m.tagName,P=m.tagStart;return m.tagName=m.tagStart=null,u=="selfcloseTag"||W.autoSelfClosers.hasOwnProperty(b)?l(m,b):(l(m,b),m.context=new s(m,b,P==m.indented)),h}return g="error",S}function T(u,y,m){return u=="equals"?E:(W.allowMissing||(g="error"),S(u,y,m))}function E(u,y,m){return u=="string"?_:u=="word"&&W.allowUnquoted?(g="string",S):(g="error",S(u,y,m))}function _(u,y,m){return u=="string"?_:S(u,y,m)}return{startState:function(u){var y={tokenize:p,state:h,indented:u||0,tagName:null,tagStart:null,context:null};return u!=null&&(y.baseIndent=u),y},token:function(u,y){if(!y.tagName&&u.sol()&&(y.indented=u.indentation()),u.eatSpace())return null;R=null;var m=y.tokenize(u,y);return(m||R)&&m!="comment"&&(g=null,y.state=y.state(R||m,u,y),g&&(m=g=="error"?m+" error":g)),m},indent:function(u,y,m){var b=u.context;if(u.tokenize.isInAttribute)return u.tagStart==u.indented?u.stringStartCol+1:u.indented+M;if(b&&b.noIndent)return ne.Pass;if(u.tokenize!=f&&u.tokenize!=p)return m?m.match(/^(\s*)/)[0].length:0;if(u.tagName)return W.multilineTagIndentPastTag!==!1?u.tagStart+u.tagName.length+2:u.tagStart+M*(W.multilineTagIndentFactor||1);if(W.alignCDATA&&/$/,blockCommentStart:"",configuration:W.htmlMode?"html":"xml",helperType:W.htmlMode?"html":"xml",skipAttribute:function(u){u.state==E&&(u.state=S)},xmlCurrentTag:function(u){return u.tagName?{name:u.tagName,close:u.type=="closeTag"}:null},xmlCurrentContext:function(u){for(var y=[],m=u.context;m;m=m.prev)m.tagName&&y.push(m.tagName);return y.reverse()}}}),ne.defineMIME("text/xml","xml"),ne.defineMIME("application/xml","xml"),ne.mimeModes.hasOwnProperty("text/html")||ne.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"55Ip":function(at,Ve,te){"use strict";te.d(Ve,"a",function(){return l});var ne=te("Ty5D"),V=te("dI71"),D=te("cDcd"),z=te.n(D),N=te("YS25"),M=te("17x9"),W=te.n(M),B=te("wx14"),k=te("zLVn"),R=te("9R94"),g=function(E){Object(V.a)(_,E);function _(){for(var y,m=arguments.length,b=new Array(m),P=0;PK&&(K=v.line_indent_level));var J={mode:j,parent:v,last_token:v?v.last_token:new f(l.START_BLOCK,""),last_word:v?v.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:K,alignment:0,line_indent_level:v?v.line_indent_level:K,start_line_index:this._output.get_line_number(),ternary_depth:0};return J},F.prototype._reset=function(v){var j=v.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new p(this._options,j),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(u.BlockStatement);var K=new c(v,this._options);return this._tokens=K.tokenize(),v},F.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var v,j=this._reset(this._source_text),K=this._options.eol;this._options.eol==="auto"&&(K=` `,j&&d.lineBreak.test(j||"")&&(K=j.match(d.lineBreak)[0]));for(var J=this._tokens.next();J;)this.handle_token(J),this._last_last_text=this._flags.last_token.text,this._flags.last_token=J,J=this._tokens.next();return v=this._output.get_code(K),v},F.prototype.handle_token=function(v,j){v.type===l.START_EXPR?this.handle_start_expr(v):v.type===l.END_EXPR?this.handle_end_expr(v):v.type===l.START_BLOCK?this.handle_start_block(v):v.type===l.END_BLOCK?this.handle_end_block(v):v.type===l.WORD?this.handle_word(v):v.type===l.RESERVED?this.handle_word(v):v.type===l.SEMICOLON?this.handle_semicolon(v):v.type===l.STRING?this.handle_string(v):v.type===l.EQUALS?this.handle_equals(v):v.type===l.OPERATOR?this.handle_operator(v):v.type===l.COMMA?this.handle_comma(v):v.type===l.BLOCK_COMMENT?this.handle_block_comment(v,j):v.type===l.COMMENT?this.handle_comment(v,j):v.type===l.DOT?this.handle_dot(v):v.type===l.EOF?this.handle_eof(v):v.type===l.UNKNOWN?this.handle_unknown(v,j):this.handle_unknown(v,j)},F.prototype.handle_whitespace_and_comments=function(v,j){var K=v.newlines,J=this._options.keep_array_indentation&&b(this._flags.mode);if(v.comments_before)for(var ee=v.comments_before.next();ee;)this.handle_whitespace_and_comments(ee,j),this.handle_token(ee,j),ee=v.comments_before.next();if(J)for(var ve=0;ve0,j);else if(this._options.max_preserve_newlines&&K>this._options.max_preserve_newlines&&(K=this._options.max_preserve_newlines),this._options.preserve_newlines&&K>1){this.print_newline(!1,j);for(var de=1;de0&&(!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(v){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,v),this._flags=this.create_flags(this._previous_flags,v),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===u.Statement&&y(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===u.ObjectLiteral&&this._flags.mode===u.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||A(this._flags.last_token,["get","set"]))},F.prototype.start_of_statement=function(v){var j=!1;return j=j||A(this._flags.last_token,["var","let","const"])&&v.type===l.WORD,j=j||x(this._flags.last_token,"do"),j=j||!(this._flags.parent.mode===u.ObjectLiteral&&this._flags.mode===u.Statement)&&A(this._flags.last_token,L)&&!v.newlines,j=j||x(this._flags.last_token,"else")&&!(x(v,"if")&&!v.comments_before),j=j||this._flags.last_token.type===l.END_EXPR&&(this._previous_flags.mode===u.ForInitializer||this._previous_flags.mode===u.Conditional),j=j||this._flags.last_token.type===l.WORD&&this._flags.mode===u.BlockStatement&&!this._flags.in_case&&!(v.text==="--"||v.text==="++")&&this._last_last_text!=="function"&&v.type!==l.WORD&&v.type!==l.RESERVED,j=j||this._flags.mode===u.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||A(this._flags.last_token,["get","set"])),j?(this.set_mode(u.Statement),this.indent(),this.handle_whitespace_and_comments(v,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(v,A(v,["do","for","if","while"])),!0):!1},F.prototype.handle_start_expr=function(v){this.start_of_statement(v)||this.handle_whitespace_and_comments(v);var j=u.Expression;if(v.text==="["){if(this._flags.last_token.type===l.WORD||this._flags.last_token.text===")"){A(this._flags.last_token,s)&&(this._output.space_before_token=!0),this.print_token(v),this.set_mode(j),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}j=u.ArrayLiteral,b(this._flags.mode)&&((this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline())),h(this._flags.last_token.type,[l.START_EXPR,l.END_EXPR,l.WORD,l.OPERATOR,l.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===l.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,j=u.ForInitializer):h(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,j=u.Conditional):h(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&v.whitespace_before===""?this._output.space_before_token=!1:(h(this._flags.last_token.text,s)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===l.EQUALS||this._flags.last_token.type===l.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(v);else if(this._flags.last_token.type===l.WORD){this._output.space_before_token=!1;var K=this._tokens.peek(-3);if(this._options.space_after_named_function&&K){var J=this._tokens.peek(-4);A(K,["async","function"])||K.text==="*"&&A(J,["async","function"])?this._output.space_before_token=!0:this._flags.mode===u.ObjectLiteral?(K.text==="{"||K.text===","||K.text==="*"&&(J.text==="{"||J.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(v);(this._flags.last_token.type===l.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(h(this._last_last_text,["function","yield"])||this._flags.mode===u.ObjectLiteral&&h(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===l.START_BLOCK?this.print_newline():(this._flags.last_token.type===l.END_EXPR||this._flags.last_token.type===l.START_EXPR||this._flags.last_token.type===l.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===l.COMMA)&&this.allow_wrap_or_preserved_newline(v,v.newlines),this.print_token(v),this.set_mode(j),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},F.prototype.handle_end_expr=function(v){for(;this._flags.mode===u.Statement;)this.restore_mode();this.handle_whitespace_and_comments(v),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(v,v.text==="]"&&b(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===l.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(v),this.restore_mode(),y(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===u.Conditional&&(this._previous_flags.mode=u.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},F.prototype.handle_start_block=function(v){this.handle_whitespace_and_comments(v);var j=this._tokens.peek(),K=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===l.END_EXPR?(this.set_mode(u.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(u.BlockStatement):K&&(h(K.text,[":",","])&&h(j.type,[l.STRING,l.WORD,l.RESERVED])||h(j.text,["get","set","..."])&&h(K.type,[l.WORD,l.RESERVED]))?h(this._last_last_text,["class","interface"])&&!h(K.text,[":",","])?this.set_mode(u.BlockStatement):this.set_mode(u.ObjectLiteral):this._flags.last_token.type===l.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(u.BlockStatement):h(this._flags.last_token.type,[l.EQUALS,l.START_EXPR,l.COMMA,l.OPERATOR])||A(this._flags.last_token,["return","throw","import","default"])?this.set_mode(u.ObjectLiteral):this.set_mode(u.BlockStatement),this._flags.last_token&&(A(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var J=!j.comments_before&&j.text==="}",ee=J&&this._flags.last_word==="function"&&this._flags.last_token.type===l.END_EXPR;if(this._options.brace_preserve_inline){var ve=0,de=null;this._flags.inline_frame=!0;do if(ve+=1,de=this._tokens.peek(ve-1),de.newlines){this._flags.inline_frame=!1;break}while(de.type!==l.EOF&&!(de.type===l.END_BLOCK&&de.opened===v))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&v.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==l.OPERATOR&&(ee||this._flags.last_token.type===l.EQUALS||A(this._flags.last_token,S)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(b(this._previous_flags.mode)&&(this._flags.last_token.type===l.START_EXPR||this._flags.last_token.type===l.COMMA)&&((this._flags.last_token.type===l.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===l.COMMA||this._flags.last_token.type===l.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(v),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==l.OPERATOR&&this._flags.last_token.type!==l.START_EXPR&&(this._flags.last_token.type===l.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(v),this.indent(),!J&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},F.prototype.handle_end_block=function(v){for(this.handle_whitespace_and_comments(v);this._flags.mode===u.Statement;)this.restore_mode();var j=this._flags.last_token.type===l.START_BLOCK;this._flags.inline_frame&&!j?this._output.space_before_token=!0:this._options.brace_style==="expand"?j||this.print_newline():j||(b(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(v)},F.prototype.handle_word=function(v){if(v.type===l.RESERVED){if(h(v.text,["set","get"])&&this._flags.mode!==u.ObjectLiteral)v.type=l.WORD;else if(v.text==="import"&&h(this._tokens.peek().text,["(","."]))v.type=l.WORD;else if(h(v.text,["as","from"])&&!this._flags.import_block)v.type=l.WORD;else if(this._flags.mode===u.ObjectLiteral){var j=this._tokens.peek();j.text===":"&&(v.type=l.WORD)}}if(this.start_of_statement(v)?A(this._flags.last_token,["var","let","const"])&&v.type===l.WORD&&(this._flags.declaration_statement=!0):v.newlines&&!P(this._flags.mode)&&(this._flags.last_token.type!==l.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==l.EQUALS&&(this._options.preserve_newlines||!A(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(v),this.print_newline()):this.handle_whitespace_and_comments(v),this._flags.do_block&&!this._flags.do_while)if(x(v,"while")){this._output.space_before_token=!0,this.print_token(v),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&&x(v,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===u.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&A(v,["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(v),this._flags.in_case=!0;return}if((this._flags.last_token.type===l.COMMA||this._flags.last_token.type===l.START_EXPR||this._flags.last_token.type===l.EQUALS||this._flags.last_token.type===l.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(v)),x(v,"function")){(h(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(h(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===l.OPERATOR))&&(!this._output.just_added_blankline()&&!v.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===l.RESERVED||this._flags.last_token.type===l.WORD?A(this._flags.last_token,["get","set","new","export"])||A(this._flags.last_token,L)?this._output.space_before_token=!0:x(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===l.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(P(this._flags.mode)||b(this._flags.mode))||this.print_newline(),this.print_token(v),this._flags.last_word=v.text;return}var K="NONE";if(this._flags.last_token.type===l.END_BLOCK?this._previous_flags.inline_frame?K="SPACE":A(v,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&v.newlines?K="NEWLINE":(K="SPACE",this._output.space_before_token=!0):K="NEWLINE":this._flags.last_token.type===l.SEMICOLON&&this._flags.mode===u.BlockStatement?K="NEWLINE":this._flags.last_token.type===l.SEMICOLON&&P(this._flags.mode)?K="SPACE":this._flags.last_token.type===l.STRING?K="NEWLINE":this._flags.last_token.type===l.RESERVED||this._flags.last_token.type===l.WORD||this._flags.last_token.text==="*"&&(h(this._last_last_text,["function","yield"])||this._flags.mode===u.ObjectLiteral&&h(this._last_last_text,["{",","]))?K="SPACE":this._flags.last_token.type===l.START_BLOCK?this._flags.inline_frame?K="SPACE":K="NEWLINE":this._flags.last_token.type===l.END_EXPR&&(this._output.space_before_token=!0,K="NEWLINE"),A(v,s)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?K="SPACE":K="NEWLINE"),A(v,["else","catch","finally"]))if((!(this._flags.last_token.type===l.END_BLOCK&&this._previous_flags.mode===u.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&v.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var J=this._output.current_line;J.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else K==="NEWLINE"?A(this._flags.last_token,S)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&A(v,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==l.END_EXPR?(this._flags.last_token.type!==l.START_EXPR||!A(v,["var","let","const"]))&&this._flags.last_token.text!==":"&&(x(v,"if")&&x(v.previous,"else")?this._output.space_before_token=!0:this.print_newline()):A(v,s)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&b(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():K==="SPACE"&&(this._output.space_before_token=!0);v.previous&&(v.previous.type===l.WORD||v.previous.type===l.RESERVED)&&(this._output.space_before_token=!0),this.print_token(v),this._flags.last_word=v.text,v.type===l.RESERVED&&(v.text==="do"?this._flags.do_block=!0:v.text==="if"?this._flags.if_block=!0:v.text==="import"?this._flags.import_block=!0:this._flags.import_block&&x(v,"from")&&(this._flags.import_block=!1))},F.prototype.handle_semicolon=function(v){this.start_of_statement(v)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(v);for(var j=this._tokens.peek();this._flags.mode===u.Statement&&!(this._flags.if_block&&x(j,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(v)},F.prototype.handle_string=function(v){v.text.startsWith("`")&&v.newlines===0&&v.whitespace_before===""&&(v.previous.text===")"||this._flags.last_token.type===l.WORD)||(this.start_of_statement(v)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(v),this._flags.last_token.type===l.RESERVED||this._flags.last_token.type===l.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===l.COMMA||this._flags.last_token.type===l.START_EXPR||this._flags.last_token.type===l.EQUALS||this._flags.last_token.type===l.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(v):v.text.startsWith("`")&&this._flags.last_token.type===l.END_EXPR&&(v.previous.text==="]"||v.previous.text===")")&&v.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(v)},F.prototype.handle_equals=function(v){this.start_of_statement(v)||this.handle_whitespace_and_comments(v),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(v),this._output.space_before_token=!0},F.prototype.handle_comma=function(v){this.handle_whitespace_and_comments(v,!0),this.print_token(v),this._output.space_before_token=!0,this._flags.declaration_statement?(P(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(v)):this._flags.mode===u.ObjectLiteral||this._flags.mode===u.Statement&&this._flags.parent.mode===u.ObjectLiteral?(this._flags.mode===u.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(v)},F.prototype.handle_operator=function(v){var j=v.text==="*"&&(A(this._flags.last_token,["function","yield"])||h(this._flags.last_token.type,[l.START_BLOCK,l.COMMA,l.END_BLOCK,l.SEMICOLON])),K=h(v.text,["-","+"])&&(h(this._flags.last_token.type,[l.START_BLOCK,l.START_EXPR,l.EQUALS,l.OPERATOR])||h(this._flags.last_token.text,s)||this._flags.last_token.text===",");if(!this.start_of_statement(v)){var J=!j;this.handle_whitespace_and_comments(v,J)}if(v.text==="*"&&this._flags.last_token.type===l.DOT){this.print_token(v);return}if(v.text==="::"){this.print_token(v);return}if(this._flags.last_token.type===l.OPERATOR&&h(this._options.operator_position,_)&&this.allow_wrap_or_preserved_newline(v),v.text===":"&&this._flags.in_case){this.print_token(v),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==l.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 ee=!0,ve=!0,de=!1;if(v.text===":"?this._flags.ternary_depth===0?ee=!1:(this._flags.ternary_depth-=1,de=!0):v.text==="?"&&(this._flags.ternary_depth+=1),!K&&!j&&this._options.preserve_newlines&&h(v.text,a)){var me=v.text===":",ce=me&&de,pe=me&&!de;switch(this._options.operator_position){case E.before_newline:this._output.space_before_token=!pe,this.print_token(v),(!me||ce)&&this.allow_wrap_or_preserved_newline(v),this._output.space_before_token=!0;return;case E.after_newline:this._output.space_before_token=!0,!me||ce?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(v):this._output.space_before_token=!1,this.print_token(v),this._output.space_before_token=!0;return;case E.preserve_newline:pe||this.allow_wrap_or_preserved_newline(v),ee=!(this._output.just_added_newline()||pe),this._output.space_before_token=ee,this.print_token(v),this._output.space_before_token=!0;return}}if(j){this.allow_wrap_or_preserved_newline(v),ee=!1;var ae=this._tokens.peek();ve=ae&&h(ae.type,[l.WORD,l.RESERVED])}else if(v.text==="...")this.allow_wrap_or_preserved_newline(v),ee=this._flags.last_token.type===l.START_BLOCK,ve=!1;else if(h(v.text,["--","++","!","~"])||K){if((this._flags.last_token.type===l.COMMA||this._flags.last_token.type===l.START_EXPR)&&this.allow_wrap_or_preserved_newline(v),ee=!1,ve=!1,v.newlines&&(v.text==="--"||v.text==="++"||v.text==="~")){var he=A(this._flags.last_token,S)&&v.newlines;he&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(he,!0)}this._flags.last_token.text===";"&&P(this._flags.mode)&&(ee=!0),this._flags.last_token.type===l.RESERVED?ee=!0:this._flags.last_token.type===l.END_EXPR?ee=!(this._flags.last_token.text==="]"&&(v.text==="--"||v.text==="++")):this._flags.last_token.type===l.OPERATOR&&(ee=h(v.text,["--","-","++","+"])&&h(this._flags.last_token.text,["--","-","++","+"]),h(v.text,["+","-"])&&h(this._flags.last_token.text,["--","++"])&&(ve=!0)),(this._flags.mode===u.BlockStatement&&!this._flags.inline_frame||this._flags.mode===u.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||ee,this.print_token(v),this._output.space_before_token=ve},F.prototype.handle_block_comment=function(v,j){if(this._output.raw){this._output.add_raw_token(v),v.directives&&v.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(v.directives){this.print_newline(!1,j),this.print_token(v),v.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!d.newline.test(v.text)&&!v.newlines){this._output.space_before_token=!0,this.print_token(v),this._output.space_before_token=!0;return}else this.print_block_commment(v,j)},F.prototype.print_block_commment=function(v,j){var K=m(v.text),J,ee=!1,ve=!1,de=v.whitespace_before,me=de.length;if(this.print_newline(!1,j),this.print_token_line_indentation(v),this._output.add_token(K[0]),this.print_newline(!1,j),K.length>1){for(K=K.slice(1),ee=I(K,"*"),ve=U(K,de),ee&&(this._flags.alignment=1),J=0;J=0;d--)if(this.__items[d].match(f))return!0;return!1},R.prototype.set_indent=function(f,d){this.is_empty()&&(this.__indent_count=f||0,this.__alignment_count=d||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},R.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)},R.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},R.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var f=this.__parent.current_line;return f.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),f.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),f.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,f.__items[0]===" "&&(f.__items.splice(0,1),f.__character_count-=1),!0}return!1},R.prototype.is_empty=function(){return this.__items.length===0},R.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},R.prototype.push=function(f){this.__items.push(f);var d=f.lastIndexOf(` `);d!==-1?this.__character_count=f.length-d:this.__character_count+=f.length},R.prototype.pop=function(){var f=null;return this.is_empty()||(f=this.__items.pop(),this.__character_count-=f.length),f},R.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},R.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},R.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},R.prototype.toString=function(){var f="";return this.is_empty()?this.__parent.indent_empty_lines&&(f=this.__parent.get_indent_string(this.__indent_count)):(f=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),f+=this.__items.join("")),f};function g(f,d){this.__cache=[""],this.__indent_size=f.indent_size,this.__indent_string=f.indent_char,f.indent_with_tabs||(this.__indent_string=new Array(f.indent_size+1).join(f.indent_char)),d=d||"",f.indent_level>0&&(d=new Array(f.indent_level+1).join(this.__indent_string)),this.__base_string=d,this.__base_string_length=d.length}g.prototype.get_indent_size=function(f,d){var o=this.__base_string_length;return d=d||0,f<0&&(o=0),o+=f*this.__indent_size,o+=d,o},g.prototype.get_indent_string=function(f,d){var o=this.__base_string;return d=d||0,f<0&&(f=0,o=""),d+=f*this.__indent_size,this.__ensure_cache(d),o+=this.__cache[d],o},g.prototype.__ensure_cache=function(f){for(;f>=this.__cache.length;)this.__add_column()},g.prototype.__add_column=function(){var f=this.__cache.length,d=0,o="";this.__indent_size&&f>=this.__indent_size&&(d=Math.floor(f/this.__indent_size),f-=d*this.__indent_size,o=new Array(d+1).join(this.__indent_string)),f&&(o+=new Array(f+1).join(" ")),this.__cache.push(o)};function p(f,d){this.__indent_cache=new g(f,d),this.raw=!1,this._end_with_newline=f.end_with_newline,this.indent_size=f.indent_size,this.wrap_line_length=f.wrap_line_length,this.indent_empty_lines=f.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new R(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(f,d){return this.__indent_cache.get_indent_string(f,d)},p.prototype.get_indent_size=function(f,d){return this.__indent_cache.get_indent_size(f,d)},p.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},p.prototype.add_new_line=function(f){return this.is_empty()||!f&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},p.prototype.get_code=function(f){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 f!==` `&&(o=o.replace(/[\n]/g,f)),o},p.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},p.prototype.set_indent=function(f,d){return f=f||0,d=d||0,this.next_line.set_indent(f,d),this.__lines.length>1?(this.current_line.set_indent(f,d),!0):(this.current_line.set_indent(),!1)},p.prototype.add_raw_token=function(f){for(var d=0;d1&&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(f,d){for(var o=this.__lines.length-2;o>=0;){var c=this.__lines[o];if(c.is_empty())break;if(c.item(0).indexOf(f)!==0&&c.item(-1)!==d){this.__lines.splice(o+1,0,new R(this)),this.previous_line=this.__lines[this.__lines.length-2];break}o--}},k.exports.Output=p},function(k){function R(g,p,f,d){this.type=g,this.text=p,this.comments_before=null,this.newlines=f||0,this.whitespace_before=d||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}k.exports.Token=R},function(k,R){var g="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",p="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",f="\\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",d="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",o="(?:\\\\u[0-9a-fA-F]{4}|["+g+f+"])",c="(?:\\\\u[0-9a-fA-F]{4}|["+p+f+d+"])*";R.identifier=new RegExp(o+c,"g"),R.identifierStart=new RegExp(o),R.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+p+f+d+"])+");var s=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;R.newline=/[\n\r\u2028\u2029]/,R.lineBreak=new RegExp(`\r |`+R.newline.source),R.allLineBreaks=new RegExp(R.lineBreak.source,"g")},function(k,R,g){var p=g(6).Options,f=["before-newline","after-newline","preserve-newline"];function d(o){p.call(this,o,"js");var c=this.raw_options.brace_style||null;c==="expand-strict"?this.raw_options.brace_style="expand":c==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var s=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var a=0;a>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),T=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";T=T.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),T="\\?\\.(?!\\d) "+T,T=T.replace(/ /g,"|");var E=new RegExp(T),_="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),u=_.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),y=new RegExp("^(?:"+u.join("|")+")$"),m,b=function(I,U){f.call(this,I,U),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var F=new s(this._input),L=new a(this._input).read_options(this._options);this.__patterns={template:L,identifier:L.starting_with(c.identifier).matching(c.identifierMatch),number:F.matching(w),punct:F.matching(E),comment:F.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:F.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:F.matching(//),include:F.starting_with(/#include/).until_after(c.lineBreak),shebang:F.starting_with(/#!/).until_after(c.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:L.until(/['\\\n\r\u2028\u2029]/),double_quote:L.until(/["\\\n\r\u2028\u2029]/),template_text:L.until(/[`\\$]/),template_expression:L.until(/[`}\\]/)}};b.prototype=new f,b.prototype._is_comment=function(I){return I.type===h.COMMENT||I.type===h.BLOCK_COMMENT||I.type===h.UNKNOWN},b.prototype._is_opening=function(I){return I.type===h.START_BLOCK||I.type===h.START_EXPR},b.prototype._is_closing=function(I,U){return(I.type===h.END_BLOCK||I.type===h.END_EXPR)&&U&&(I.text==="]"&&U.text==="["||I.text===")"&&U.text==="("||I.text==="}"&&U.text==="{")},b.prototype._reset=function(){m=!1},b.prototype._get_next_token=function(I,U){var F=null;this._readWhitespace();var L=this._input.peek();return L===null?this._create_token(h.EOF,""):(F=F||this._read_non_javascript(L),F=F||this._read_string(L),F=F||this._read_word(I),F=F||this._read_singles(L),F=F||this._read_comment(L),F=F||this._read_regexp(L,I),F=F||this._read_xml(L,I),F=F||this._read_punctuation(),F=F||this._create_token(h.UNKNOWN,this._input.next()),F)},b.prototype._read_word=function(I){var U;if(U=this.__patterns.identifier.read(),U!=="")return U=U.replace(c.allLineBreaks,` `),!(I.type===h.DOT||I.type===h.RESERVED&&(I.text==="set"||I.text==="get"))&&y.test(U)?(U==="in"||U==="of")&&(I.type===h.WORD||I.type===h.STRING)?this._create_token(h.OPERATOR,U):this._create_token(h.RESERVED,U):this._create_token(h.WORD,U);if(U=this.__patterns.number.read(),U!=="")return this._create_token(h.WORD,U)},b.prototype._read_singles=function(I){var U=null;return I==="("||I==="["?U=this._create_token(h.START_EXPR,I):I===")"||I==="]"?U=this._create_token(h.END_EXPR,I):I==="{"?U=this._create_token(h.START_BLOCK,I):I==="}"?U=this._create_token(h.END_BLOCK,I):I===";"?U=this._create_token(h.SEMICOLON,I):I==="."&&A.test(this._input.peek(1))?U=this._create_token(h.DOT,I):I===","&&(U=this._create_token(h.COMMA,I)),U&&this._input.next(),U},b.prototype._read_punctuation=function(){var I=this.__patterns.punct.read();if(I!=="")return I==="="?this._create_token(h.EQUALS,I):I==="?."?this._create_token(h.DOT,I):this._create_token(h.OPERATOR,I)},b.prototype._read_non_javascript=function(I){var U="";if(I==="#"){if(this._is_first_token()&&(U=this.__patterns.shebang.read(),U))return this._create_token(h.UNKNOWN,U.trim()+` `);if(U=this.__patterns.include.read(),U)return this._create_token(h.UNKNOWN,U.trim()+` `);I=this._input.next();var F="#";if(this._input.hasNext()&&this._input.testChar(x)){do I=this._input.next(),F+=I;while(this._input.hasNext()&&I!=="#"&&I!=="=");return I==="#"||(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(h.WORD,F)}this._input.back()}else if(I==="<"&&this._is_first_token()){if(U=this.__patterns.html_comment_start.read(),U){for(;this._input.hasNext()&&!this._input.testChar(c.newline);)U+=this._input.next();return m=!0,this._create_token(h.COMMENT,U)}}else if(m&&I==="-"&&(U=this.__patterns.html_comment_end.read(),U))return m=!1,this._create_token(h.COMMENT,U);return null},b.prototype._read_comment=function(I){var U=null;if(I==="/"){var F="";if(this._input.peek(1)==="*"){F=this.__patterns.block_comment.read();var L=O.get_directives(F);L&&L.ignore==="start"&&(F+=O.readIgnored(this._input)),F=F.replace(c.allLineBreaks,` `),U=this._create_token(h.BLOCK_COMMENT,F),U.directives=L}else this._input.peek(1)==="/"&&(F=this.__patterns.comment.read(),U=this._create_token(h.COMMENT,F))}return U},b.prototype._read_string=function(I){if(I==="`"||I==="'"||I==='"'){var U=this._input.next();return this.has_char_escapes=!1,I==="`"?U+=this._read_string_recursive("`",!0,"${"):U+=this._read_string_recursive(I),this.has_char_escapes&&this._options.unescape_strings&&(U=P(U)),this._input.peek()===I&&(U+=this._input.next()),U=U.replace(c.allLineBreaks,` `),this._create_token(h.STRING,U)}return null},b.prototype._allow_regexp_or_xml=function(I){return I.type===h.RESERVED&&l(I.text,["return","case","throw","else","do","typeof","yield"])||I.type===h.END_EXPR&&I.text===")"&&I.opened.previous.type===h.RESERVED&&l(I.opened.previous.text,["if","while","for"])||l(I.type,[h.COMMENT,h.START_EXPR,h.START_BLOCK,h.START,h.END_BLOCK,h.OPERATOR,h.EQUALS,h.EOF,h.SEMICOLON,h.COMMA])},b.prototype._read_regexp=function(I,U){if(I==="/"&&this._allow_regexp_or_xml(U)){for(var F=this._input.next(),L=!1,v=!1;this._input.hasNext()&&(L||v||this._input.peek()!==I)&&!this._input.testChar(c.newline);)F+=this._input.peek(),L?L=!1:(L=this._input.peek()==="\\",this._input.peek()==="["?v=!0:this._input.peek()==="]"&&(v=!1)),this._input.next();return this._input.peek()===I&&(F+=this._input.next(),F+=this._input.read(c.identifier)),this._create_token(h.STRING,F)}return null},b.prototype._read_xml=function(I,U){if(this._options.e4x&&I==="<"&&this._allow_regexp_or_xml(U)){var F="",L=this.__patterns.xml.read_match();if(L){for(var v=L[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),j=v.indexOf("{")===0,K=0;L;){var J=!!L[1],ee=L[2],ve=!!L[L.length-1]||ee.slice(0,8)==="![CDATA[";if(!ve&&(ee===v||j&&ee.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(J?--K:++K),F+=L[0],K<=0)break;L=this.__patterns.xml.read_match()}return L||(F+=this._input.match(/[\s\S]*/g)[0]),F=F.replace(c.allLineBreaks,` `),this._create_token(h.STRING,F)}}return null};function P(I){for(var U="",F=0,L=new p(I),v=null;L.hasNext();)if(v=L.match(/([\s]|[^\\]|\\\\)+/g),v&&(U+=v[0]),L.peek()==="\\"){if(L.next(),L.peek()==="x")v=L.match(/x([0-9A-Fa-f]{2})/g);else if(L.peek()==="u")v=L.match(/u([0-9A-Fa-f]{4})/g);else{U+="\\",L.hasNext()&&(U+=L.next());continue}if(!v)return I;if(F=parseInt(v[1],16),F>126&&F<=255&&v[0].indexOf("x")===0)return I;if(F>=0&&F<32){U+="\\"+v[0];continue}else F===34||F===39||F===92?U+="\\"+String.fromCharCode(F):U+=String.fromCharCode(F)}return U}b.prototype._read_string_recursive=function(I,U,F){var L,v;I==="'"?v=this.__patterns.single_quote:I==='"'?v=this.__patterns.double_quote:I==="`"?v=this.__patterns.template_text:I==="}"&&(v=this.__patterns.template_expression);for(var j=v.read(),K="";this._input.hasNext();){if(K=this._input.next(),K===I||!U&&c.newline.test(K)){this._input.back();break}else K==="\\"&&this._input.hasNext()?(L=this._input.peek(),L==="x"||L==="u"?this.has_char_escapes=!0:L==="\r"&&this._input.peek(1)===` `&&this._input.next(),K+=this._input.next()):F&&(F==="${"&&K==="$"&&this._input.peek()==="{"&&(K+=this._input.next()),F===K&&(I==="`"?K+=this._read_string_recursive("}",U,"`"):K+=this._read_string_recursive("`",U,"${"),this._input.hasNext()&&(K+=this._input.next())));K+=v.read(),j+=K}return j},k.exports.Tokenizer=b,k.exports.TOKEN=h,k.exports.positionable_operators=S.slice(),k.exports.line_starters=_.slice()},function(k){var R=RegExp.prototype.hasOwnProperty("sticky");function g(p){this.__input=p||"",this.__input_length=this.__input.length,this.__position=0}g.prototype.restart=function(){this.__position=0},g.prototype.back=function(){this.__position>0&&(this.__position-=1)},g.prototype.hasNext=function(){return this.__position=0&&p=0&&f=p.length&&this.__input.substring(f-p.length,f).toLowerCase()===p},k.exports.InputScanner=g},function(k,R,g){var p=g(8).InputScanner,f=g(3).Token,d=g(10).TokenStream,o=g(11).WhitespacePattern,c={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},s=function(a,l){this._input=new p(a),this._options=l||{},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,l=new f(c.START,""),h=null,O=[],w=new d;l.type!==c.EOF;){for(a=this._get_next_token(l,h);this._is_comment(a);)w.add(a),a=this._get_next_token(l,h);w.isEmpty()||(a.comments_before=w,w=new d),a.parent=h,this._is_opening(a)?(O.push(h),h=a):h&&this._is_closing(a,h)&&(a.opened=h,h.closed=a,h=O.pop(),a.parent=h),a.previous=l,l.next=a,this.__tokens.add(a),l=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,l){this._readWhitespace();var h=this._input.read(/.+/g);return h?this._create_token(c.RAW,h):this._create_token(c.EOF,"")},s.prototype._is_comment=function(a){return!1},s.prototype._is_opening=function(a){return!1},s.prototype._is_closing=function(a,l){return!1},s.prototype._create_token=function(a,l){var h=new f(a,l,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return h},s.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},k.exports.Tokenizer=s,k.exports.TOKEN=c},function(k){function R(g){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=g}R.prototype.restart=function(){this.__position=0},R.prototype.isEmpty=function(){return this.__tokens_length===0},R.prototype.hasNext=function(){return this.__position=0&&g/),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 p,d.prototype._create=function(){return new d(this._input,this)},d.prototype._update=function(){this.__set_templated_pattern()},d.prototype.disable=function(o){var c=this._create();return c._disabled[o]=!0,c._update(),c},d.prototype.read_options=function(o){var c=this._create();for(var s in f)c._disabled[s]=o.templating.indexOf(s)===-1;return c._update(),c},d.prototype.exclude=function(o){var c=this._create();return c._excluded[o]=!0,c._update(),c},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 c=this._read_template();c;)this._match_pattern?c+=this._input.read(this._match_pattern):c+=this._input.readUntil(this.__template_pattern),o+=c,c=this._read_template();return this._until_after&&(o+=this._input.readUntilAfter(this._until_pattern)),o},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="",c=this._input.peek();if(c==="<"){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 c==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(o=o||this.__patterns.handlebars_comment.read(),o=o||this.__patterns.handlebars_unescaped.read(),o=o||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(o=o||this.__patterns.django_value.read()),this._excluded.django||(o=o||this.__patterns.django_comment.read(),o=o||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(o=o||this.__patterns.smarty_comment.read(),o=o||this.__patterns.smarty_literal.read(),o=o||this.__patterns.smarty.read()));return o},k.exports.TemplatablePattern=d}],M={};function W(k){var R=M[k];if(R!==void 0)return R.exports;var g=M[k]={exports:{}};return N[k](g,g.exports,W),g.exports}var B=W(0);D=B})();var z=D;!(ne=[],V=function(){return{js_beautify:z}}.apply(Ve,ne),V!==void 0&&(at.exports=V))})()},"7Cbv":function(at,Ve,te){"use strict";var ne=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),V=new Uint8Array(16);function D(){if(!ne)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ne(V)}var z=/^(?:[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 N(f){return typeof f=="string"&&z.test(f)}for(var M=N,W=[],B=0;B<256;++B)W.push((B+256).toString(16).substr(1));function k(f){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=(W[f[d+0]]+W[f[d+1]]+W[f[d+2]]+W[f[d+3]]+"-"+W[f[d+4]]+W[f[d+5]]+"-"+W[f[d+6]]+W[f[d+7]]+"-"+W[f[d+8]]+W[f[d+9]]+"-"+W[f[d+10]]+W[f[d+11]]+W[f[d+12]]+W[f[d+13]]+W[f[d+14]]+W[f[d+15]]).toLowerCase();if(!M(o))throw TypeError("Stringified UUID is invalid");return o}var R=k;function g(f,d,o){f=f||{};var c=f.random||(f.rng||D)();if(c[6]=c[6]&15|64,c[8]=c[8]&63|128,d){o=o||0;for(var s=0;s<16;++s)d[o+s]=c[s];return d}return R(c)}var p=Ve.a=g},"7ahc":function(at,Ve,te){"use strict";te.d(Ve,"a",function(){return O});var ne=te("k1fw"),V=te("0Owb"),D=te("+L6B"),z=te("2/Rp"),N=te("y8nQ"),M=te("Vl3Y"),W=te("tJVT"),B=te("OaEy"),k=te("2fM7"),R=te("cDcd"),g=te.n(R),p=te("VrN/"),f=te.n(p),d=te("p77/"),o=te.n(d),c=te("c5Ni"),s=te.n(c),a=k.a.Option,l={labelCol:{span:4},wrapperCol:{span:20}},h={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"]};Ve.b=function(w){var x=w.callback,A=w.onCancel,S=Object(R.useState)("python"),T=Object(W.a)(S,2),E=T[0],_=T[1];function u(m){_(h[m][1])}function y(m){x(m)}return g.a.createElement(M.a,Object(V.a)({},l,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:y}),g.a.createElement(M.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},g.a.createElement(k.a,{onChange:u},Object.keys(h).map(function(m){return g.a.createElement(a,{key:m,value:m},h[m][0])}))),g.a.createElement(M.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},g.a.createElement(O,{mode:E})),g.a.createElement("div",{className:"flex-container flex-end"},g.a.createElement(z.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),g.a.createElement(z.a,{type:"ghost",onClick:A},"\u53D6\u6D88")))};function O(w){var x=w.value,A=w.onChange,S=w.mode,T=w.options,E=T===void 0?{}:T,_=Object(R.useRef)(),u=Object(R.useState)(),y=Object(W.a)(u,2),m=y[0],b=y[1];return Object(R.useEffect)(function(){if(m){function P(I){var U=I.getValue();A&&A(U)}return m.on("change",P),function(){m.off("change",P)}}},[m,A]),Object(R.useEffect)(function(){m&&m.setOption("mode",S)},[m,S]),Object(R.useEffect)(function(){m&&((x!==m.getValue()||x==="")&&setTimeout(function(){m.setValue(x||" ")},300))},[m,x]),Object(R.useEffect)(function(){if(_.current&&!m){var P=f.a.fromTextArea(_.current,Object(ne.a)({mode:S,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},E));b(P)}},[_.current,m]),g.a.createElement("div",{className:"my-codemirror-container"},g.a.createElement("textarea",{ref:_}))}},"8EBN":function(at,Ve,te){(function(ne){ne(te("VrN/"))})(function(ne){"use strict";ne.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var V=0;V-1&&z.substring(W+1,z.length);if(B)return ne.findModeByExtension(B)},ne.findModeByName=function(z){z=z.toLowerCase();for(var N=0;N=ae.length?he.slice(ae.length):he}).join(` `)}var d=[],o=["
    "],c=new g.a.Renderer,s=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function a(){d.length=0,o=["
      "]}var l={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function h(me,ce,pe,ae){if(ce>=me.length||me[ce].level<=pe)return ce;var he=me[ce];ae.push("
    • "+he.text+""),ce++;var $=[];return ce=h(me,ce,he.level,$),$.length>0&&(ae.push("
        "),$.forEach(function(ie){ae.push(ie)}),ae.push("
      ")),ae.push("
    • "),ce=h(me,ce,pe,ae),ce}function O(){return h(d,0,0,o),o.push("
    "),o.join("")}var w={heading:function(ce){var pe=s.exec(ce);if(pe)return{type:"heading",raw:pe[0],depth:pe[1].length,text:pe[2]}},fences:function(ce){var pe=this.rules.block.fences.exec(ce);if(pe){var ae=pe[0],he=f(ae,pe[3]||""),$=pe[2]?pe[2].trim():pe[2];if(["latex","katex","math"].indexOf($)>=0){var ie=S(),q=he;he=ie,T[ie]={type:"block",expression:q}}return{type:"code",raw:ae,lang:$,text:he}}}},x=/(?:\${2})([^\n`]+?)(?:\${2})/gi,A=0,S=function(){return"__special_katext_id_".concat(A++,"__")},T={};function E(){return T}function _(){A=0,T={}}function u(me){return me=me.replace(x,function(ce,pe){var ae=S();return T[ae]={type:"inline",expression:pe},ae}),me}var y=c.listitem;c.listitem=function(me){return y(u(me))};var m=c.paragraph;c.paragraph=function(me){return m(u(me))};var b=c.tablecell;c.tablecell=function(me,ce){return b(u(me),ce)},c.code=function(me,ce,pe){var ae=(ce||"").match(/\S*/)[0];return ae?["latex","katex","math"].indexOf(ae)>=0?"

    ".concat(me,"

    "):'
    ').concat(pe?me:Object(p.escape)(me,!0),`
    `):'
    '+(pe?me:Object(p.escape)(me,!0))+"
    "},c.heading=function(me,ce,pe){var ae=this.options.headerPrefix+pe.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return d.push({anchor:ae,level:ce,text:me}),"'+me+""},g.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),g.a.use({tokenizer:w,renderer:c});var P=g.a,I=te("SJMd"),U=te("ulZh"),F=te.n(U),L=te("m3rI"),v=te("Oy/b"),j=te("p5ED"),K=te("8hTe"),J=te.n(K),ee=/]*>/g;function ve(me){var ce=document.createElement("div");return ce.innerHTML=me,ce.childNodes.length===0?"":ce.childNodes[0].nodeValue}var de=Ve.a=function(me){var ce=me.value,pe=ce===void 0?"":ce,ae=me.edit,he=ae===void 0?!1:ae,$=me.className,ie=me.showTextOnly,q=me.showLines,Ee=me.replaces,Ae=me.zoomImg,ye=me.hasMask,we=me.style,Re=we===void 0?{}:we,ke=me.stylesPrev,Ne=ke===void 0?{}:ke,Ie=String(pe),Le=Object(W.useRef)(),Ye=Object(W.useRef)(),Qe=Object(W.useState)(""),Xe=Object(M.a)(Qe,2),We=Xe[0],Je=Xe[1],je=Object(W.useState)("office"),He=Object(M.a)(je,2),Se=He[0],qe=He[1],Ke=Object(W.useMemo)(function(){try{var fe=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Q=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Z=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Ie=Ie.replace(fe,"("+L.a.API_SERVER+"/api/attachments/").replace(Q,'"'+L.a.API_SERVER+"/api/attachments/").replace(Z,'"'+L.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(Oe){}var re=P(Ie),oe=E();if(Ie.match(/\[TOC\]/)&&(re=re.replace("

    [TOC]

    ",O()),a()),re=re.replace(/(__special_katext_id_\d+__)/g,function(Oe,De){var $e=oe[De],tt=$e.type,nt=$e.expression;return Object(v.renderToString)(ve(nt)||"",{displayMode:tt==="block",throwOnError:!1,output:"html"})}),re=re.replace(/▁/g,"\u2581\u2581\u2581"),_(),ie){var ge=document.createElement("div");return ge.innerHTML=re,ge.innerText}return setTimeout(function(){return _e()},500),re},[Ie]),xe=Object(W.useRef)();l.WebkitLineClamp=q,q&&(Re=Object(N.a)(Object(N.a)({},Re),l));function Pe(fe){var Q=fe.target;if(Q.tagName.toUpperCase()==="IMG"){if(Ae){var Z=Q.getAttribute("src");Je(Z),qe("image")}}else if(Q.tagName.toUpperCase()==="A"){var re=Q.getAttribute("href");if(re.indexOf("office")>-1)fe.preventDefault(),Je(re),qe("office");else if(re.indexOf("application/pdf")>-1)fe.preventDefault(),Je(re),qe("pdf");else if(re.indexOf("text/html")>-1)fe.preventDefault(),Je(re),qe("html");else if(re.startsWith("#")){fe.preventDefault();var oe=document.getElementById(re.replace("#",""));oe&&oe.scrollIntoView(!0)}}}var _e=function(){var Q,Z=(Q=xe.current)===null||Q===void 0?void 0:Q.querySelectorAll("video");Z==null||Z.forEach(function(re){if(re.oncontextmenu=function(){return!1},re.src.indexOf(".m3u8")>-1&&!re.canPlayType("application/vnd.apple.mpegurl")){if(F.a.isSupported()){var oe=new F.a;oe.loadSource(re.src),oe.attachMedia(re)}}})};Object(W.useEffect)(function(){if(xe.current&&Ke&&(Ke.match(ee)&&window.PR.prettyPrint()),xe.current)return xe.current.addEventListener("click",Pe),function(){xe.current.removeEventListener("click",Pe),_(),a()}},[Ke,xe.current,Pe]);var le=function(Q){if(!he)return;Q.target.nodeName==="IMG"?(Le.current.style.display="flex",Le.current.style.width=Q.target.clientWidth+"px",Le.current.style.height=Q.target.clientHeight+"px",Le.current.style.top=Q.target.offsetTop+"px",Le.current.style.left=Q.target.offsetLeft+"px",Ye.current.src=Q.target.getAttribute("src")):Le.current.style.display="none"};return B.a.createElement("div",{style:{position:"relative"}},B.a.createElement("div",{ref:xe,style:Object(N.a)({},Re),className:"".concat($||""," markdown-body ").concat(J.a.mdBody),onMouseOver:le,dangerouslySetInnerHTML:{__html:Ke}}),B.a.createElement("div",{ref:Le,className:J.a.button},B.a.createElement(V.a,null,B.a.createElement(z.a,{onClick:function(){return openCrop()}},"\u88C1\u526A"),B.a.createElement(z.a,{onClick:function(){return openEditor()}},"\u7F16\u8F91"))),B.a.createElement("img",{ref:Ye,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1,top:"-10000px"}}),B.a.createElement(j.a,{close:!0,data:We,type:We!=null&&We.length?Se:"",style:Object(N.a)({},Ne),onClose:function(){return Je("")}}))}},"9VGf":function(at,Ve,te){"use strict";te.d(Ve,"a",function(){return D});var ne=te("cDcd"),V=te.n(ne);function D(z,N){var M=Object(ne.useRef)();Object(ne.useEffect)(function(){M.current=z}),Object(ne.useEffect)(function(){function W(){M.current()}if(N!==null){var B=setInterval(W,N);return function(){return clearInterval(B)}}},[N])}},BU3w:function(at,Ve,te){"use strict";te.d(Ve,"a",function(){return M});var ne=te("MNnm"),V="rc-util-key";function D(W){if(W.attachTo)return W.attachTo;var B=document.querySelector("head");return B||document.body}function z(W){var B,k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(ne.a)())return null;var R=document.createElement("style");if((B=k.csp)===null||B===void 0?void 0:B.nonce){var g;R.nonce=(g=k.csp)===null||g===void 0?void 0:g.nonce}R.innerHTML=W;var p=D(k),f=p.firstChild;return k.prepend&&p.prepend?p.prepend(R):k.prepend&&f?p.insertBefore(R,f):p.appendChild(R),R}var N=new Map;function M(W,B){var k=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},R=D(k);if(!N.has(R)){var g=z("",k),p=g.parentNode;N.set(R,p),p.removeChild(g)}var f=Array.from(N.get(R).children).find(function(a){return a.tagName==="STYLE"&&a[V]===B});if(f){var d,o;if(((d=k.csp)===null||d===void 0?void 0:d.nonce)&&f.nonce!==((o=k.csp)===null||o===void 0?void 0:o.nonce)){var c;f.nonce=(c=k.csp)===null||c===void 0?void 0:c.nonce}return f.innerHTML!==W&&(f.innerHTML=W),f}var s=z(W,k);return s[V]=B,s}},Bd2K:function(at,Ve,te){(function(ne){ne(te("VrN/"),te("osHv"))})(function(ne){ne.defineOption("autoCloseTags",!1,function(k,R,g){if(g!=ne.Init&&g&&k.removeKeyMap("autoCloseTags"),!R)return;var p={name:"autoCloseTags"};(typeof R!="object"||R.whenClosing!==!1)&&(p["'/'"]=function(f){return M(f)}),(typeof R!="object"||R.whenOpening!==!1)&&(p["'>'"]=function(f){return z(f)}),k.addKeyMap(p)});var V=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],D=["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 z(k){if(k.getOption("disableInput"))return ne.Pass;for(var R=k.listSelections(),g=[],p=k.getOption("autoCloseTags"),f=0;fd.ch&&(l=l.slice(0,l.length-o.end+d.ch));var x=l.toLowerCase();if(!l||o.type=="string"&&(o.end!=d.ch||!/[\"\']/.test(o.string.charAt(o.string.length-1))||o.string.length==1)||o.type=="tag"&&a.close||o.string.indexOf("/")==d.ch-o.start-1||O&&W(O,x)>-1||B(k,c.mode.xmlCurrentContext&&c.mode.xmlCurrentContext(s)||[],l,d,!0))return ne.Pass;var A=typeof p=="object"&&p.emptyTags;if(A&&W(A,l)>-1){g[f]={text:"/>",newPos:ne.Pos(d.line,d.ch+2)};continue}var S=w&&W(w,x)>-1;g[f]={indent:S,text:">"+(S?` `:"")+"",newPos:S?ne.Pos(d.line+1,0):ne.Pos(d.line,d.ch+1)}}for(var T=typeof p=="object"&&p.dontIndentOnAutoClose,f=R.length-1;f>=0;f--){var E=g[f];k.replaceRange(E.text,R[f].head,R[f].anchor,"+insert");var _=k.listSelections().slice(0);_[f]={head:E.newPos,anchor:E.newPos},k.setSelections(_),!T&&E.indent&&(k.indentLine(E.newPos.line,null,!0),k.indentLine(E.newPos.line+1,null,!0))}}function N(k,R){for(var g=k.listSelections(),p=[],f=R?"/":""&&(O+=">"),p[c]=O}if(k.replaceSelections(p),g=k.listSelections(),!o)for(var c=0;c=0&&R[s]==g;s--)++c;p=o.to;for(var s=1;s0){for(var R=0;R1&&arguments[1]!==void 0?arguments[1]:"",R=[],g=0;g_e.length)&&(le=_e.length);for(var fe=0,Q=new Array(le);fe=_e.length?{done:!0}:{done:!1,value:_e[Q++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return fe=_e[Symbol.iterator](),fe.next.bind(fe)}function M(_e,le){return le={exports:{}},_e(le,le.exports),le.exports}var W=M(function(_e){function le(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function fe(Q){_e.exports.defaults=Q}_e.exports={defaults:le(),getDefaults:le,changeDefaults:fe}}),B=W.defaults,k=W.getDefaults,R=W.changeDefaults,g=/[&<>"']/,p=/[&<>"']/g,f=/[<>"']|&(?!#?\w+;)/,d=/[<>"']|&(?!#?\w+;)/g,o={"&":"&","<":"<",">":">",'"':""","'":"'"},c=function(le){return o[le]};function s(_e,le){if(le){if(g.test(_e))return _e.replace(p,c)}else if(f.test(_e))return _e.replace(d,c);return _e}var a=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function l(_e){return _e.replace(a,function(le,fe){return fe=fe.toLowerCase(),fe==="colon"?":":fe.charAt(0)==="#"?fe.charAt(1)==="x"?String.fromCharCode(parseInt(fe.substring(2),16)):String.fromCharCode(+fe.substring(1)):""})}var h=/(^|[^\[])\^/g;function O(_e,le){_e=_e.source||_e,le=le||"";var fe={replace:function(Z,re){return re=re.source||re,re=re.replace(h,"$1"),_e=_e.replace(Z,re),fe},getRegex:function(){return new RegExp(_e,le)}};return fe}var w=/[^\w:]/g,x=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function A(_e,le,fe){if(_e){var Q;try{Q=decodeURIComponent(l(fe)).replace(w,"").toLowerCase()}catch(Z){return null}if(Q.indexOf("javascript:")===0||Q.indexOf("vbscript:")===0||Q.indexOf("data:")===0)return null}le&&!x.test(fe)&&(fe=u(le,fe));try{fe=encodeURI(fe).replace(/%25/g,"%")}catch(Z){return null}return fe}var S={},T=/^[^:]+:\/*[^/]*$/,E=/^([^:]+:)[\s\S]*$/,_=/^([^:]+:\/*[^/]*)[\s\S]*$/;function u(_e,le){S[" "+_e]||(T.test(_e)?S[" "+_e]=_e+"/":S[" "+_e]=P(_e,"/",!0)),_e=S[" "+_e];var fe=_e.indexOf(":")===-1;return le.substring(0,2)==="//"?fe?le:_e.replace(E,"$1")+le:le.charAt(0)==="/"?fe?le:_e.replace(_,"$1")+le:_e+le}var y={exec:function(){}};function m(_e){for(var le=1,fe,Q;le=0&&ge[De]==="\\";)Oe=!Oe;return Oe?"|":" |"}),Q=fe.split(/ \|/),Z=0;if(Q.length>le)Q.splice(le);else for(;Q.length=Q.length?Z.slice(Q.length):Z}).join(` `)}var de=function(){function _e(fe){this.options=fe||L}var le=_e.prototype;return le.space=function(Q){var Z=this.rules.block.newline.exec(Q);if(Z)return Z[0].length>1?{type:"space",raw:Z[0]}:{raw:` `}},le.code=function(Q,Z){var re=this.rules.block.code.exec(Q);if(re){var oe=Z[Z.length-1];if(oe&&oe.type==="paragraph")return{raw:re[0],text:re[0].trimRight()};var ge=re[0].replace(/^ {4}/gm,"");return{type:"code",raw:re[0],codeBlockStyle:"indented",text:this.options.pedantic?ge:v(ge,` `)}}},le.fences=function(Q){var Z=this.rules.block.fences.exec(Q);if(Z){var re=Z[0],oe=ve(re,Z[3]||"");return{type:"code",raw:re,lang:Z[2]?Z[2].trim():Z[2],text:oe}}},le.heading=function(Q){var Z=this.rules.block.heading.exec(Q);if(Z)return{type:"heading",raw:Z[0],depth:Z[1].length,text:Z[2]}},le.nptable=function(Q){var Z=this.rules.block.nptable.exec(Q);if(Z){var re={type:"table",header:j(Z[1].replace(/^ *| *\| *$/g,"")),align:Z[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Z[3]?Z[3].replace(/\n$/,"").split(` `):[],raw:Z[0]};if(re.header.length===re.align.length){var oe=re.align.length,ge;for(ge=0;ge ?/gm,"");return{type:"blockquote",raw:Z[0],text:re}}},le.list=function(Q){var Z=this.rules.block.list.exec(Q);if(Z){for(var re=Z[0],oe=Z[2],ge=oe.length>1,Oe=oe[oe.length-1]===")",De={type:"list",raw:re,ordered:ge,start:ge?+oe.slice(0,-1):"",loose:!1,items:[]},$e=Z[0].match(this.rules.block.item),tt=!1,nt,Et,ct,st,Ot,Tt,Bt,Mt=$e.length,yt=0;yt1||this.options.smartLists&&ct!==oe)&&(st=$e.slice(yt+1).join(` `),De.raw=De.raw.substring(0,De.raw.length-st.length),yt=Mt-1)),Ot=tt||/\n\n(?!\s*$)/.test(nt),yt!==Mt-1&&(tt=nt.charAt(nt.length-1)===` `,Ot||(Ot=tt)),Ot&&(De.loose=!0),Tt=/^\[[ xX]\] /.test(nt),Bt=void 0,Tt&&(Bt=nt[1]!==" ",nt=nt.replace(/^\[[ xX]\] +/,"")),De.items.push({type:"list_item",raw:re,task:Tt,checked:Bt,loose:Ot,text:nt});return De}},le.html=function(Q){var Z=this.rules.block.html.exec(Q);if(Z)return{type:this.options.sanitize?"paragraph":"html",raw:Z[0],pre:!this.options.sanitizer&&(Z[1]==="pre"||Z[1]==="script"||Z[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Z[0]):K(Z[0]):Z[0]}},le.def=function(Q){var Z=this.rules.block.def.exec(Q);if(Z){Z[3]&&(Z[3]=Z[3].substring(1,Z[3].length-1));var re=Z[1].toLowerCase().replace(/\s+/g," ");return{tag:re,raw:Z[0],href:Z[2],title:Z[3]}}},le.table=function(Q){var Z=this.rules.block.table.exec(Q);if(Z){var re={type:"table",header:j(Z[1].replace(/^ *| *\| *$/g,"")),align:Z[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Z[3]?Z[3].replace(/\n$/,"").split(` `):[]};if(re.header.length===re.align.length){re.raw=Z[0];var oe=re.align.length,ge;for(ge=0;ge/i.test(oe[0])&&(Z=!1),!re&&/^<(pre|code|kbd|script)(\s|>)/i.test(oe[0])?re=!0:re&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(oe[0])&&(re=!1),{type:this.options.sanitize?"text":"html",raw:oe[0],inLink:Z,inRawBlock:re,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(oe[0]):K(oe[0]):oe[0]}},le.link=function(Q){var Z=this.rules.inline.link.exec(Q);if(Z){var re=J(Z[2],"()");if(re>-1){var oe=Z[0].indexOf("!")===0?5:4,ge=oe+Z[1].length+re;Z[2]=Z[2].substring(0,re),Z[0]=Z[0].substring(0,ge).trim(),Z[3]=""}var Oe=Z[2],De="";if(this.options.pedantic){var $e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Oe);$e?(Oe=$e[1],De=$e[3]):De=""}else De=Z[3]?Z[3].slice(1,-1):"";Oe=Oe.trim().replace(/^<([\s\S]*)>$/,"$1");var tt=ee(Z,{href:Oe&&Oe.replace(this.rules.inline._escapes,"$1"),title:De&&De.replace(this.rules.inline._escapes,"$1")},Z[0]);return tt}},le.reflink=function(Q,Z){var re;if((re=this.rules.inline.reflink.exec(Q))||(re=this.rules.inline.nolink.exec(Q))){var oe=(re[2]||re[1]).replace(/\s+/g," ");if(oe=Z[oe.toLowerCase()],!oe||!oe.href){var ge=re[0].charAt(0);return{type:"text",raw:ge,text:ge}}var Oe=ee(re,oe,re[0]);return Oe}},le.strong=function(Q,Z,re){re===void 0&&(re="");var oe=this.rules.inline.strong.start.exec(Q);if(oe&&(!oe[1]||oe[1]&&(re===""||this.rules.inline.punctuation.exec(re)))){Z=Z.slice(-1*Q.length);var ge=oe[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;ge.lastIndex=0;for(var Oe;(oe=ge.exec(Z))!=null;)if(Oe=this.rules.inline.strong.middle.exec(Z.slice(0,oe.index+3)),Oe)return{type:"strong",raw:Q.slice(0,Oe[0].length),text:Q.slice(2,Oe[0].length-2)}}},le.em=function(Q,Z,re){re===void 0&&(re="");var oe=this.rules.inline.em.start.exec(Q);if(oe&&(!oe[1]||oe[1]&&(re===""||this.rules.inline.punctuation.exec(re)))){Z=Z.slice(-1*Q.length);var ge=oe[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;ge.lastIndex=0;for(var Oe;(oe=ge.exec(Z))!=null;)if(Oe=this.rules.inline.em.middle.exec(Z.slice(0,oe.index+2)),Oe)return{type:"em",raw:Q.slice(0,Oe[0].length),text:Q.slice(1,Oe[0].length-1)}}},le.codespan=function(Q){var Z=this.rules.inline.code.exec(Q);if(Z){var re=Z[2].replace(/\n/g," "),oe=/[^ ]/.test(re),ge=re.startsWith(" ")&&re.endsWith(" ");return oe&&ge&&(re=re.substring(1,re.length-1)),re=K(re,!0),{type:"codespan",raw:Z[0],text:re}}},le.br=function(Q){var Z=this.rules.inline.br.exec(Q);if(Z)return{type:"br",raw:Z[0]}},le.del=function(Q){var Z=this.rules.inline.del.exec(Q);if(Z)return{type:"del",raw:Z[0],text:Z[1]}},le.autolink=function(Q,Z){var re=this.rules.inline.autolink.exec(Q);if(re){var oe,ge;return re[2]==="@"?(oe=K(this.options.mangle?Z(re[1]):re[1]),ge="mailto:"+oe):(oe=K(re[1]),ge=oe),{type:"link",raw:re[0],text:oe,href:ge,tokens:[{type:"text",raw:oe,text:oe}]}}},le.url=function(Q,Z){var re;if(re=this.rules.inline.url.exec(Q)){var oe,ge;if(re[2]==="@")oe=K(this.options.mangle?Z(re[0]):re[0]),ge="mailto:"+oe;else{var Oe;do Oe=re[0],re[0]=this.rules.inline._backpedal.exec(re[0])[0];while(Oe!==re[0]);oe=K(re[0]),re[1]==="www."?ge="http://"+oe:ge=oe}return{type:"link",raw:re[0],text:oe,href:ge,tokens:[{type:"text",raw:oe,text:oe}]}}},le.inlineText=function(Q,Z,re){var oe=this.rules.inline.text.exec(Q);if(oe){var ge;return Z?ge=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(oe[0]):K(oe[0]):oe[0]:ge=K(this.options.smartypants?re(oe[0]):oe[0]),{type:"text",raw:oe[0],text:ge}}},_e}(),me=F.noopTest,ce=F.edit,pe=F.merge,ae={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]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:me,table:me,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};ae._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,ae._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ae.def=ce(ae.def).replace("label",ae._label).replace("title",ae._title).getRegex(),ae.bullet=/(?:[*+-]|\d{1,9}[.)])/,ae.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,ae.item=ce(ae.item,"gm").replace(/bull/g,ae.bullet).getRegex(),ae.list=ce(ae.list).replace(/bull/g,ae.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ae.def.source+")").getRegex(),ae._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",ae._comment=//,ae.html=ce(ae.html,"i").replace("comment",ae._comment).replace("tag",ae._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ae.paragraph=ce(ae._paragraph).replace("hr",ae.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",")|<(?:script|pre|style|!--)").replace("tag",ae._tag).getRegex(),ae.blockquote=ce(ae.blockquote).replace("paragraph",ae.paragraph).getRegex(),ae.normal=pe({},ae),ae.gfm=pe({},ae.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*|$)"}),ae.gfm.nptable=ce(ae.gfm.nptable).replace("hr",ae.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",")|<(?:script|pre|style|!--)").replace("tag",ae._tag).getRegex(),ae.gfm.table=ce(ae.gfm.table).replace("hr",ae.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",")|<(?:script|pre|style|!--)").replace("tag",ae._tag).getRegex(),ae.pedantic=pe({},ae.normal,{html:ce(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ae._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:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:me,paragraph:ce(ae.normal._paragraph).replace("hr",ae.hr).replace("heading",` *#{1,6} *[^ ]`).replace("lheading",ae.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var he={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:me,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\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:me,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",he.punctuation=ce(he.punctuation).replace(/punctuation/g,he._punctuation).getRegex(),he._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",he._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",he.em.start=ce(he.em.start).replace(/punctuation/g,he._punctuation).getRegex(),he.em.middle=ce(he.em.middle).replace(/punctuation/g,he._punctuation).replace(/overlapSkip/g,he._overlapSkip).getRegex(),he.em.endAst=ce(he.em.endAst,"g").replace(/punctuation/g,he._punctuation).getRegex(),he.em.endUnd=ce(he.em.endUnd,"g").replace(/punctuation/g,he._punctuation).getRegex(),he.strong.start=ce(he.strong.start).replace(/punctuation/g,he._punctuation).getRegex(),he.strong.middle=ce(he.strong.middle).replace(/punctuation/g,he._punctuation).replace(/blockSkip/g,he._blockSkip).getRegex(),he.strong.endAst=ce(he.strong.endAst,"g").replace(/punctuation/g,he._punctuation).getRegex(),he.strong.endUnd=ce(he.strong.endUnd,"g").replace(/punctuation/g,he._punctuation).getRegex(),he.blockSkip=ce(he._blockSkip,"g").getRegex(),he.overlapSkip=ce(he._overlapSkip,"g").getRegex(),he._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,he._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,he._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,he.autolink=ce(he.autolink).replace("scheme",he._scheme).replace("email",he._email).getRegex(),he._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,he.tag=ce(he.tag).replace("comment",ae._comment).replace("attribute",he._attribute).getRegex(),he._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,he._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,he._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,he.link=ce(he.link).replace("label",he._label).replace("href",he._href).replace("title",he._title).getRegex(),he.reflink=ce(he.reflink).replace("label",he._label).getRegex(),he.reflinkSearch=ce(he.reflinkSearch,"g").replace("reflink",he.reflink).replace("nolink",he.nolink).getRegex(),he.normal=pe({},he),he.pedantic=pe({},he.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:ce(/^!?\[(label)\]\((.*?)\)/).replace("label",he._label).getRegex(),reflink:ce(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",he._label).getRegex()}),he.gfm=pe({},he.normal,{escape:ce(he.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\.5&&(Q="x"+Q.toString(16)),le+="&#"+Q+";";return le}var we=function(){function _e(fe){this.tokens=[],this.tokens.links=Object.create(null),this.options=fe||ie,this.options.tokenizer=this.options.tokenizer||new de,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var Q={block:q.normal,inline:Ee.normal};this.options.pedantic?(Q.block=q.pedantic,Q.inline=Ee.pedantic):this.options.gfm&&(Q.block=q.gfm,this.options.breaks?Q.inline=Ee.breaks:Q.inline=Ee.gfm),this.tokenizer.rules=Q}_e.lex=function(Q,Z){var re=new _e(Z);return re.lex(Q)};var le=_e.prototype;return le.lex=function(Q){return Q=Q.replace(/\r\n|\r/g,` `).replace(/\t/g," "),this.blockTokens(Q,this.tokens,!0),this.inline(this.tokens),this.tokens},le.blockTokens=function(Q,Z,re){Z===void 0&&(Z=[]),re===void 0&&(re=!0),Q=Q.replace(/^ +$/gm,"");for(var oe,ge,Oe,De;Q;){if(oe=this.tokenizer.space(Q)){Q=Q.substring(oe.raw.length),oe.type&&Z.push(oe);continue}if(oe=this.tokenizer.code(Q,Z)){Q=Q.substring(oe.raw.length),oe.type?Z.push(oe):(De=Z[Z.length-1],De.raw+=` `+oe.raw,De.text+=` `+oe.text);continue}if(oe=this.tokenizer.fences(Q)){Q=Q.substring(oe.raw.length),Z.push(oe);continue}if(oe=this.tokenizer.heading(Q)){Q=Q.substring(oe.raw.length),Z.push(oe);continue}if(oe=this.tokenizer.nptable(Q)){Q=Q.substring(oe.raw.length),Z.push(oe);continue}if(oe=this.tokenizer.hr(Q)){Q=Q.substring(oe.raw.length),Z.push(oe);continue}if(oe=this.tokenizer.blockquote(Q)){Q=Q.substring(oe.raw.length),oe.tokens=this.blockTokens(oe.text,[],re),Z.push(oe);continue}if(oe=this.tokenizer.list(Q)){for(Q=Q.substring(oe.raw.length),Oe=oe.items.length,ge=0;ge0)for(;($e=this.tokenizer.rules.inline.reflinkSearch.exec(De))!=null;)tt.includes($e[0].slice($e[0].lastIndexOf("[")+1,-1))&&(De=De.slice(0,$e.index)+"["+"a".repeat($e[0].length-2)+"]"+De.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;($e=this.tokenizer.rules.inline.blockSkip.exec(De))!=null;)De=De.slice(0,$e.index)+"["+"a".repeat($e[0].length-2)+"]"+De.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;Q;){if(Oe=this.tokenizer.escape(Q)){Q=Q.substring(Oe.raw.length),Z.push(Oe);continue}if(Oe=this.tokenizer.tag(Q,re,oe)){Q=Q.substring(Oe.raw.length),re=Oe.inLink,oe=Oe.inRawBlock,Z.push(Oe);continue}if(Oe=this.tokenizer.link(Q)){Q=Q.substring(Oe.raw.length),Oe.type==="link"&&(Oe.tokens=this.inlineTokens(Oe.text,[],!0,oe)),Z.push(Oe);continue}if(Oe=this.tokenizer.reflink(Q,this.tokens.links)){Q=Q.substring(Oe.raw.length),Oe.type==="link"&&(Oe.tokens=this.inlineTokens(Oe.text,[],!0,oe)),Z.push(Oe);continue}if(Oe=this.tokenizer.strong(Q,De,ge)){Q=Q.substring(Oe.raw.length),Oe.tokens=this.inlineTokens(Oe.text,[],re,oe),Z.push(Oe);continue}if(Oe=this.tokenizer.em(Q,De,ge)){Q=Q.substring(Oe.raw.length),Oe.tokens=this.inlineTokens(Oe.text,[],re,oe),Z.push(Oe);continue}if(Oe=this.tokenizer.codespan(Q)){Q=Q.substring(Oe.raw.length),Z.push(Oe);continue}if(Oe=this.tokenizer.br(Q)){Q=Q.substring(Oe.raw.length),Z.push(Oe);continue}if(Oe=this.tokenizer.del(Q)){Q=Q.substring(Oe.raw.length),Oe.tokens=this.inlineTokens(Oe.text,[],re,oe),Z.push(Oe);continue}if(Oe=this.tokenizer.autolink(Q,ye)){Q=Q.substring(Oe.raw.length),Z.push(Oe);continue}if(!re&&(Oe=this.tokenizer.url(Q,ye))){Q=Q.substring(Oe.raw.length),Z.push(Oe);continue}if(Oe=this.tokenizer.inlineText(Q,oe,Ae)){Q=Q.substring(Oe.raw.length),ge=Oe.raw.slice(-1),Z.push(Oe);continue}if(Q){var nt="Infinite loop on byte: "+Q.charCodeAt(0);if(this.options.silent){console.error(nt);break}else throw new Error(nt)}}return Z},V(_e,null,[{key:"rules",get:function(){return{block:q,inline:Ee}}}]),_e}(),Re=W.defaults,ke=F.cleanUrl,Ne=F.escape,Ie=function(){function _e(fe){this.options=fe||Re}var le=_e.prototype;return le.code=function(Q,Z,re){var oe=(Z||"").match(/\S*/)[0];if(this.options.highlight){var ge=this.options.highlight(Q,oe);ge!=null&&ge!==Q&&(re=!0,Q=ge)}return oe?'
    '+(re?Q:Ne(Q,!0))+`
    `:"
    "+(re?Q:Ne(Q,!0))+`
    `},le.blockquote=function(Q){return`
    `+Q+`
    `},le.html=function(Q){return Q},le.heading=function(Q,Z,re,oe){return this.options.headerIds?"'+Q+" `:""+Q+" `},le.hr=function(){return this.options.xhtml?`
    `:`
    `},le.list=function(Q,Z,re){var oe=Z?"ol":"ul",ge=Z&&re!==1?' start="'+re+'"':"";return"<"+oe+ge+`> `+Q+" `},le.listitem=function(Q){return"
  • "+Q+`
  • `},le.checkbox=function(Q){return" "},le.paragraph=function(Q){return"

    "+Q+`

    `},le.table=function(Q,Z){return Z&&(Z=""+Z+""),` `+Q+` `+Z+`
    `},le.tablerow=function(Q){return` `+Q+` `},le.tablecell=function(Q,Z){var re=Z.header?"th":"td",oe=Z.align?"<"+re+' align="'+Z.align+'">':"<"+re+">";return oe+Q+" `},le.strong=function(Q){return""+Q+""},le.em=function(Q){return""+Q+""},le.codespan=function(Q){return""+Q+""},le.br=function(){return this.options.xhtml?"
    ":"
    "},le.del=function(Q){return""+Q+""},le.link=function(Q,Z,re){if(Q=ke(this.options.sanitize,this.options.baseUrl,Q),Q===null)return re;var oe='",oe},le.image=function(Q,Z,re){if(Q=ke(this.options.sanitize,this.options.baseUrl,Q),Q===null)return re;var oe=''+re+'":">",oe},le.text=function(Q){return Q},_e}(),Le=function(){function _e(){}var le=_e.prototype;return le.strong=function(Q){return Q},le.em=function(Q){return Q},le.codespan=function(Q){return Q},le.del=function(Q){return Q},le.html=function(Q){return Q},le.text=function(Q){return Q},le.link=function(Q,Z,re){return""+re},le.image=function(Q,Z,re){return""+re},le.br=function(){return""},_e}(),Ye=function(){function _e(){this.seen={}}var le=_e.prototype;return le.slug=function(Q){var Z=Q.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(Z)){var re=Z;do this.seen[re]++,Z=re+"-"+this.seen[re];while(this.seen.hasOwnProperty(Z))}return this.seen[Z]=0,Z},_e}(),Qe=W.defaults,Xe=F.unescape,We=function(){function _e(fe){this.options=fe||Qe,this.options.renderer=this.options.renderer||new Ie,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Le,this.slugger=new Ye}_e.parse=function(Q,Z){var re=new _e(Z);return re.parse(Q)};var le=_e.prototype;return le.parse=function(Q,Z){Z===void 0&&(Z=!0);var re="",oe,ge,Oe,De,$e,tt,nt,Et,ct,st,Ot,Tt,Bt,Mt,yt,pn,bn,dt,mt=Q.length;for(oe=0;oe0&&yt.tokens[0].type==="text"?(yt.tokens[0].text=dt+" "+yt.tokens[0].text,yt.tokens[0].tokens&&yt.tokens[0].tokens.length>0&&yt.tokens[0].tokens[0].type==="text"&&(yt.tokens[0].tokens[0].text=dt+" "+yt.tokens[0].tokens[0].text)):yt.tokens.unshift({type:"text",text:dt}):Mt+=dt),Mt+=this.parse(yt.tokens,Bt),ct+=this.renderer.listitem(Mt,bn,pn);re+=this.renderer.list(ct,Ot,Tt);continue}case"html":{re+=this.renderer.html(st.text);continue}case"paragraph":{re+=this.renderer.paragraph(this.parseInline(st.tokens));continue}case"text":{for(ct=st.tokens?this.parseInline(st.tokens):st.text;oe+1An error occurred:

    "+He(Oe.message+"",!0)+"
    ";throw Oe}}xe.options=xe.setOptions=function(_e){return Je(xe.defaults,_e),qe(xe.defaults),xe},xe.getDefaults=Se,xe.defaults=Ke,xe.use=function(_e){var le=Je({},_e);if(_e.renderer&&function(){var Q=xe.defaults.renderer||new Ie,Z=function(ge){var Oe=Q[ge];Q[ge]=function(){for(var De=arguments.length,$e=new Array(De),tt=0;tt`,triples:"",explode:"[]{}"},D=ne.Pos;ne.defineOption("autoCloseBrackets",!1,function(o,c,s){s&&s!=ne.Init&&(o.removeKeyMap(N),o.state.closeBrackets=null),c&&(M(z(c,"pairs")),o.state.closeBrackets=c,o.addKeyMap(N))});function z(o,c){return c=="pairs"&&typeof o=="string"?o:typeof o=="object"&&o[c]!=null?o[c]:V[c]}var N={Backspace:k,Enter:R};function M(o){for(var c=0;c=0;l--){var O=a[l].head;o.replaceRange("",D(O.line,O.ch-1),D(O.line,O.ch+1),"+delete")}}function R(o){var c=B(o),s=c&&z(c,"explode");if(!s||o.getOption("disableInput"))return ne.Pass;for(var a=o.listSelections(),l=0;l0;return{anchor:new D(o.anchor.line,o.anchor.ch+(c?-1:1)),head:new D(o.head.line,o.head.ch+(c?1:-1))}}function p(o,c){var s=B(o);if(!s||o.getOption("disableInput"))return ne.Pass;var a=z(s,"pairs"),l=a.indexOf(c);if(l==-1)return ne.Pass;for(var h=z(s,"closeBefore"),O=z(s,"triples"),w=a.charAt(l+1)==c,x=o.listSelections(),A=l%2==0,S,T=0;T=0&&o.getRange(_,D(_.line,_.ch+3))==c+c+c?u="skipThree":u="skip";else if(w&&_.ch>1&&O.indexOf(c)>=0&&o.getRange(D(_.line,_.ch-2),_)==c+c){if(_.ch>2&&/\bstring/.test(o.getTokenTypeAt(D(_.line,_.ch-2))))return ne.Pass;u="addFour"}else if(w){var m=_.ch==0?" ":o.getRange(D(_.line,_.ch-1),_);if(!ne.isWordChar(y)&&m!=c&&!ne.isWordChar(m))u="both";else return ne.Pass}else if(A&&(y.length===0||/\s/.test(y)||h.indexOf(y)>-1))u="both";else return ne.Pass;if(!S)S=u;else if(S!=u)return ne.Pass}var b=l%2?a.charAt(l-1):c,P=l%2?c:a.charAt(l+1);o.operation(function(){if(S=="skip")o.execCommand("goCharRight");else if(S=="skipThree")for(var I=0;I<3;I++)o.execCommand("goCharRight");else if(S=="surround"){for(var U=o.getSelections(),I=0;I0&&(J.percent=J.loaded/J.total*100),F.onProgress(J)});var v=new FormData;F.data&&Object.keys(F.data).forEach(function(K){var J=F.data[K];if(Array.isArray(J)){J.forEach(function(ee){v.append(K+"[]",ee)});return}v.append(K,F.data[K])}),F.file instanceof Blob?v.append(F.filename,F.file,F.file.name):v.append(F.filename,F.file),L.onerror=function(J){F.onError(J)},L.onload=function(){return L.status<200||L.status>=300?F.onError(N(F,L),M(L)):F.onSuccess(M(L),L)},L.open(F.method,F.action,!0),F.withCredentials&&"withCredentials"in L&&(L.withCredentials=!0);var j=F.headers||{};return j["X-Requested-With"]!==null&&L.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(j).forEach(function(K){j[K]!==null&&L.setRequestHeader(K,j[K])}),L.send(v),{abort:function(){L.abort()}}}var B=+new Date,k=0;function R(){return"rc-upload-"+B+"-"+ ++k}function g(F,L){return F.indexOf(L,F.length-L.length)!==-1}var p=function(F,L){if(F&&L){var v=Array.isArray(L)?L:L.split(","),j=F.name||"",K=F.type||"",J=K.replace(/\/.*$/,"");return v.some(function(ee){var ve=ee.trim();return ve.charAt(0)==="."?g(j.toLowerCase(),ve.toLowerCase()):/\/\*$/.test(ve)?J===ve.replace(/\/.*$/,""):K===ve})}return!0};function f(F,L){var v=F.createReader(),j=[];function K(){v.readEntries(function(J){var ee=Array.prototype.slice.apply(J);j=j.concat(ee);var ve=!ee.length;ve?L(j):K()})}K()}var d=function(L,v,j){var K=function J(ee,ve){ve=ve||"",ee.isFile?ee.file(function(de){j(de)&&(ee.fullPath&&!de.webkitRelativePath&&(Object.defineProperties(de,{webkitRelativePath:{writable:!0}}),de.webkitRelativePath=ee.fullPath.replace(/^\//,""),Object.defineProperties(de,{webkitRelativePath:{writable:!1}})),v([de]))}):ee.isDirectory&&f(ee,function(de){de.forEach(function(me){J(me,""+ve+ee.name+"/")})})};L.forEach(function(J){K(J.webkitGetAsEntry())})},o=d,c=Object.assign||function(F){for(var L=1;L=0)continue;if(!Object.prototype.hasOwnProperty.call(F,j))continue;v[j]=F[j]}return v}function O(F,L){if(!(F instanceof L))throw new TypeError("Cannot call a class as a function")}function w(F,L){if(!F)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return L&&(typeof L=="object"||typeof L=="function")?L:F}function x(F,L){if(typeof L!="function"&&L!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof L);F.prototype=Object.create(L&&L.prototype,{constructor:{value:F,enumerable:!1,writable:!0,configurable:!0}}),L&&(Object.setPrototypeOf?Object.setPrototypeOf(F,L):F.__proto__=L)}var A=function(L){return Object.keys(L).reduce(function(v,j){return(j.substr(0,5)==="data-"||j.substr(0,5)==="aria-"||j==="role")&&(v[j]=L[j]),v},{})},S=function(F){x(L,F);function L(){var v,j,K,J;O(this,L);for(var ee=arguments.length,ve=Array(ee),de=0;de1&&arguments[1]!==void 0?arguments[1]:1,fe=Le.length,Q=0;Q1&&arguments[1]!==void 0?arguments[1]:!1;return Object(A.a)(v).map(function(K,J){if(!N.isValidElement(K)||!K.type)return null;var ee=K.type.isSelectOptGroup,ve=K.key,de=K.props,me=de.children,ce=Object(W.a)(de,["children"]);return j||!ee?S(K):Object(x.a)(Object(x.a)({key:"__RC_SELECT_GRP__".concat(ve===null?J:ve,"__"),label:ve},ce),{},{options:T(me)})}).filter(function(K){return K})}var E=te("2Qr1"),_=te("qNPg"),u=te("U8pU"),y=te("Kwbf"),m=te("WKfj");function b(v){var j=v.mode,K=v.options,J=v.children,ee=v.backfill,ve=v.allowClear,de=v.placeholder,me=v.getInputElement,ce=v.showSearch,pe=v.onSearch,ae=v.defaultOpen,he=v.autoFocus,$=v.labelInValue,ie=v.value,q=v.inputValue,Ee=v.optionLabelProp,Ae=j==="multiple"||j==="tags",ye=ce!==void 0?ce:Ae||j==="combobox",we=K||T(J);if(Object(y.a)(j!=="tags"||we.every(function(Ie){return!Ie.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),j==="tags"||j==="combobox"){var Re=we.some(function(Ie){return Ie.options?Ie.options.some(function(Le){return typeof("value"in Le?Le.value:Le.key)=="number"}):typeof("value"in Ie?Ie.value:Ie.key)=="number"});Object(y.a)(!Re,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(y.a)(j!=="combobox"||!Ee,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(y.a)(j==="combobox"||!ee,"`backfill` only works with `combobox` mode."),Object(y.a)(j==="combobox"||!me,"`getInputElement` only work with `combobox` mode."),Object(y.b)(j!=="combobox"||!me||!ve||!de,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),pe&&!ye&&j!=="combobox"&&j!=="tags"&&Object(y.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(y.b)(!ae||he,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),ie!=null){var ke=Object(m.d)(ie);Object(y.a)(!$||ke.every(function(Ie){return Object(u.a)(Ie)==="object"&&("key"in Ie||"value"in Ie)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(y.a)(!Ae||Array.isArray(ie),"`value` should be array when `mode` is `multiple` or `tags`")}if(J){var Ne=null;Object(A.a)(J).some(function(Ie){if(!N.isValidElement(Ie)||!Ie.type)return!1;var Le=Ie.type;if(Le.isSelectOption)return!1;if(Le.isSelectOptGroup){var Ye=Object(A.a)(Ie.props.children).every(function(Qe){return!N.isValidElement(Qe)||!Ie.type||Qe.type.isSelectOption?!0:(Ne=Qe.type,!1)});return!Ye}return Ne=Le,!0}),Ne&&Object(y.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Ne.displayName||Ne.name||Ne,"`.")),Object(y.a)(q===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var P=b,I=Object(_.a)({prefixCls:"rc-select",components:{optionList:a},convertChildrenToData:T,flattenOptions:E.d,getLabeledValue:E.e,filterOptions:E.b,isValueDisabled:E.g,findValueOption:E.c,warningProps:P,fillOptionsWithMissingValue:E.a}),U=function(v){Object(D.a)(K,v);var j=Object(z.a)(K);function K(){var J;return Object(ne.a)(this,K),J=j.apply(this,arguments),J.selectRef=N.createRef(),J.focus=function(){J.selectRef.current.focus()},J.blur=function(){J.selectRef.current.blur()},J}return Object(V.a)(K,[{key:"render",value:function(){return N.createElement(I,Object.assign({ref:this.selectRef},this.props))}}]),K}(N.Component);U.Option=h,U.OptGroup=w;var F=U,L=Ve.c=F},M8RZ:function(at,Ve,te){"use strict";te.d(Ve,"a",function(){return k});var ne=te("fWQN"),V=te("mtLc"),D=te("yKVA"),z=te("879j"),N=te("cDcd"),M=te.n(N),W=te("faye"),B=te.n(W),k=function(R){Object(D.a)(p,R);var g=Object(z.a)(p);function p(f){var d;Object(ne.a)(this,p),d=g.call(this,f);var o=window.document;return d.node=o.createElement("div"),o.body.appendChild(d.node),d}return Object(V.a)(p,[{key:"render",value:function(){var d=this.props.children;return Object(W.createPortal)(d,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),p}(M.a.Component)},Ot1p:function(at,Ve,te){"use strict";var ne=te("2qtc"),V=te("kLXV"),D=te("rAM+"),z=te("miYZ"),N=te("tsqr"),M=te("9og8"),W=te("tJVT"),B=te("jrin"),k=te("WmNS"),R=te.n(k),g=te("cDcd"),p=te.n(g),f=te("VrN/"),d=te.n(f),o=te("bdgK"),c=te("p77/"),s=te("Bd2K"),a=te("ELLl"),l=te("19Vz"),h=te("lZu9"),O=te("+NIl"),w=te("kSUc"),x=te("9Bee"),A=function(ge){var Oe=ge.value,De=Oe===void 0?"":Oe,$e=ge.className,tt=ge.showTextOnly,nt=ge.showLines,Et=ge.style,ct=Et===void 0?{}:Et,st=Object(g.useMemo)(function(){return""},[De]);return p.a.createElement(p.a.Fragment,null,p.a.createElement("div",{dangerouslySetInnerHTML:{__html:st}}))},S=te("0Owb"),T=te("dejd"),E=te("C+DQ"),_=te("1vsH"),u=te("m3rI"),y=[{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 m(ge){var Oe=ge.onActionCallback,De=ge.title,$e=ge.icon,tt=ge.actionName,nt=ge.className,Et=nt===void 0?"":nt,ct=ge.children;function st(){Oe(tt)}return p.a.createElement("a",{title:De,className:Et,onClick:st},p.a.createElement("i",{className:"md-iconfont ".concat($e)}),ct)}var b=function(ge){var Oe=ge.watch,De=ge.showNullButton,$e=ge.onActionCallback,tt=ge.fullScreen,nt=ge.insertTemp,Et=ge.hidetoolBar,ct=ge.uuid,st=ge.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(_.G)("_educoder_session_login"),"&_educoder_session=").concat(Object(_.G)("_educoder_session"),"&key=").concat(ct,"&api=").concat(encodeURIComponent(u.a.PROXY_SERVER)));var Ot=[].concat(y,[{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"},!Et&&Ot.map(function(Tt,Bt){return p.a.createElement("li",{key:Bt},Tt.actionName?p.a.createElement(m,Object(S.a)({},Tt,{onActionCallback:$e})):p.a.createElement("span",{className:"v-line"}))}),De?p.a.createElement("li",null,p.a.createElement(m,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:$e},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(m,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(nt),onActionCallback:$e},p.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),p.a.createElement("li",{className:"btn-full-screen"},p.a.createElement(m,{icon:"".concat(tt?"icon-shrink":"icon-enlarge"),title:tt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:$e})))},P=te("M8RZ"),I=te("+L6B"),U=te("2/Rp"),F=te("y8nQ"),L=te("Vl3Y"),v=te("5NDa"),j=te("5rEg"),K={labelCol:{span:4},wrapperCol:{span:20}},J=function(ge){var Oe=ge.callback,De=ge.onCancel;function $e(tt){Oe(tt)}return p.a.createElement(L.a,Object(S.a)({},K,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:$e}),p.a.createElement(L.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},p.a.createElement(j.a,null)),p.a.createElement(L.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},p.a.createElement(j.a,null)),p.a.createElement("div",{className:"flex-container flex-end"},p.a.createElement(U.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(U.a,{type:"ghost",onClick:De},"\u53D6\u6D88")))},ee=te("7ahc"),ve=te("HmJG"),de=te("BjJ7"),me=L.a.useForm,ce={width:280,marginRight:10},pe={labelCol:{span:5},wrapperCol:{span:19}},ae=function(ge){var Oe=ge.callback,De=ge.onCancel,$e=me(),tt=Object(W.a)($e,1),nt=tt[0];function Et(Ot){Oe(Ot)}function ct(Ot,Tt){if(Ot.status===-1){N.b.error(Ot.message);return}nt.setFieldsValue({src:"/api/attachments/".concat(Ot.id),type:Tt.type})}function st(Ot){var Tt=Ot.target.files[0];$(Tt,ct)}return p.a.createElement(L.a,Object(S.a)({form:nt},pe,{className:"upload-image-panel",onFinish:Et}),p.a.createElement(L.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},p.a.createElement("div",{className:"flex-container"},p.a.createElement(L.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},p.a.createElement(j.a,{style:ce})),p.a.createElement(he,{onFileChange:st}))),p.a.createElement(L.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},p.a.createElement(j.a,{style:{width:264}})),p.a.createElement(L.a.Item,{style:{textAlign:"right"}},p.a.createElement(U.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(U.a,{type:"ghost",onClick:De},"\u53D6\u6D88")))};function he(ge){var Oe=ge.onFileChange;return p.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",p.a.createElement("input",{type:"file",onChange:Oe}))}function $(ge,Oe){if(!ge)throw new String("\u6CA1\u6709\u6587\u4EF6");var De=new FormData;De.append("editormd-image-file",ge),De.append("file_param_name","editormd-image-file"),De.append("byxhr","true");var $e=new window.XMLHttpRequest;$e.withCredentials=!0,$e.addEventListener("load",function(tt){Oe(JSON.parse(tt.target.responseText),ge)},!1),$e.addEventListener("error",function(tt){console.error(tt)},!1),$e.open("POST","".concat(de.a,"/api/attachments.json")),$e.send(De)}var ie=te("giR+"),q=te("fyUT"),Ee=te("7Kak"),Ae=te("9yH6"),ye=Ae.a.Group,we={margin:"0 8px"},Re=function(ge){var Oe=ge.callback,De=ge.onCancel;function $e(tt){Oe(tt)}return p.a.createElement(L.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:$e},p.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},p.a.createElement("span",{style:we},"\u5355\u5143\u683C\u6570\uFF1A"),p.a.createElement("span",{style:we},"\u884C\u6570"),p.a.createElement(L.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},p.a.createElement(q.a,null)),p.a.createElement("span",{style:we},"\u5217\u6570"),p.a.createElement(L.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},p.a.createElement(q.a,null))),p.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},p.a.createElement("span",{style:we},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),p.a.createElement(L.a.Item,{name:"align"},p.a.createElement(ye,null,p.a.createElement(Ae.a,{value:"default"},p.a.createElement("i",{className:"fa fa-align-justify"})),p.a.createElement(Ae.a,{value:"left"},p.a.createElement("i",{className:"fa fa-align-left"})),p.a.createElement(Ae.a,{value:"center"},p.a.createElement("i",{className:"fa fa-align-center"})),p.a.createElement(Ae.a,{value:"right"},p.a.createElement("i",{className:"fa fa-align-right"}))))),p.a.createElement("div",{className:"flex-container flex-end"},p.a.createElement(U.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(U.a,{type:"ghost",onClick:De},"\u53D6\u6D88")))},ke=te("ErOA"),Ne=te("7Cbv"),Ie="link",Le="upload-image",Ye="code-block",Qe="add-table",Xe="------------",We={default:Xe,left:":".concat(Xe),center:":".concat(Xe,":"),right:"".concat(Xe,":")},Je=te("9VGf"),je,He;function Se(){}var qe=0,Ke=1e4,xe="\u2581",Pe=` **\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 _e(ge){return/^\d+$/.test(ge)?"".concat(ge,"px"):ge}var le=navigator.platform.toUpperCase().indexOf("MAC")>=0,fe=le?"Cmd":"Ctrl",Q=["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"],Z=(je={},Object(B.a)(je,fe+"-B","bold"),Object(B.a)(je,fe+"-I","italic"),je),re=(He={},Object(B.a)(He,Ie,"\u6DFB\u52A0\u94FE\u63A5"),Object(B.a)(He,Ye,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(B.a)(He,Le,"\u6DFB\u52A0\u6587\u4EF6"),Object(B.a)(He,Qe,"\u6DFB\u52A0\u8868\u683C"),He),oe=Ve.a=function(ge){var Oe=ge.defaultValue,De=Oe===void 0?"":Oe,$e=ge.onChange,tt=ge.width,nt=tt===void 0?"100%":tt,Et=ge.height,ct=Et===void 0?400:Et,st=ge.miniToolbar,Ot=st===void 0?!1:st,Tt=ge.isFocus,Bt=Tt===void 0?!1:Tt,Mt=ge.watch,yt=ge.insertTemp,pn=ge.mode,bn=pn===void 0?"markdown":pn,dt=ge.id,mt=dt===void 0?"markdown-editor-id":dt,xt=ge.showResizeBar,Dt=xt===void 0?!1:xt,Wt=ge.noStorage,qn=Wt===void 0?!1:Wt,Gr=ge.showNullButton,Nt=Gr===void 0?!1:Gr,rt=ge.hidetoolBar,Pn=rt===void 0?!1:rt,gr=ge.fullScreen,rn=gr===void 0?!1:gr,St=ge.onBlur,En=ge.onCMBeforeChange,Mn=ge.onFullScreen,vr=ge.className,Fe=vr===void 0?"":vr,ht=ge.disablePaste,zr=ht===void 0?!1:ht,_r=ge.placeholder,yr=_r===void 0?"":_r,er=ge.values,br=er===void 0?"":er,pt=Object(g.useState)(null),Ai=Object(W.a)(pt,2),Ue=Ai[0],Er=Ai[1],_n=Object(g.useState)(De),Vr=Object(W.a)(_n,2),tr=Vr[0],Tn=Vr[1],Xr=Object(g.useState)(Mt),Yr=Object(W.a)(Xr,2),xn=Yr[0],$r=Yr[1],Ri=Object(g.useState)(rn),Qr=Object(W.a)(Ri,2),wn=Qr[0],Li=Qr[1],aa=Object(g.useState)(""),Jr=Object(W.a)(aa,2),en=Jr[0],Kn=Jr[1],sa=Object(g.useState)(0),nr=Object(W.a)(sa,2),Sn=nr[0],Zr=nr[1],oa=Object(g.useState)(ct),Ci=Object(W.a)(oa,2),Ii=Ci[0],Tr=Ci[1],Di=Object(g.useState)(!1),ki=Object(W.a)(Di,2),la=ki[0],xr=ki[1],rr=Object(g.useRef)(Object(Ne.a)()),ir=Object(g.useRef)(!1),wr=Object(g.useRef)(),Nn=Object(g.useRef)(),Fn=Object(g.useRef)(),Un=Object(g.useRef)(),Sr=Object(g.useRef)(),Pi=function(){var it=Object(M.a)(R.a.mark(function ft(){var lt,vt;return R.a.wrap(function(Ct){for(;;)switch(Ct.prev=Ct.next){case 0:return Ct.next=2,Object(ke.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:rr.current}});case 2:vt=Ct.sent,vt!=null&&(lt=vt.attachments)!==null&<!==void 0&<.length&&(console.log("cm:",Ue,Nn),vt.attachments.map(function(bt){bt.content_type.indexOf("image")>-1?Ue.replaceSelection("![,](/api/attachments/".concat(bt.id,"?type=").concat(bt.content_type,")")):bt.content_type.indexOf("video")>-1?Ue.replaceSelection('')):bt.content_type.indexOf("pdf")>-1?Ue.replaceSelection('
    ').concat(bt.name,"")):Ue.replaceSelection("[".concat(bt.name,"](").concat(u.a.API_SERVER,"/api/attachments/").concat(bt.id,"?type=").concat(bt.content_type,")"))}));case 4:case"end":return Ct.stop()}},ft)}));return function(){return it.apply(this,arguments)}}();Object(g.useEffect)(function(){Tn(br),Ue==null||Ue.setValue(br)},[br]),Object(g.useEffect)(function(){Mn==null||Mn(wn)},[wn]),Object(g.useEffect)(function(){if(Nn.current){var it=d.a.fromTextArea(Nn.current,{mode:bn,lineNumbers:!Ot,lineWrapping:!0,value:De,autoCloseTags:!0,autoCloseBrackets:!0});Bt&&it.focus();function ft(lt,vt){if(zr){vt.preventDefault();return}var wt=vt.clipboardData;if(wt){var Ct=wt.types.toString(),bt=wt.items;if(Ct==="Files"||wt.types.indexOf("Files")>-1){if(vt.preventDefault(),bn=="stex")return;try{var Kt,an=bt[1];((Kt=bt[0])===null||Kt===void 0?void 0:Kt.kind)==="file"&&(an=bt[0]);var _t=an.getAsFile(),Bn=_t.name.split(".").pop();$(_t,function(At){if(At.id){var sn,Jt,yn;(_t==null||((sn=_t.type)===null||sn===void 0)?void 0:sn.indexOf("image"))>-1?it.replaceSelection("![,](/api/attachments/".concat(At.id,"?type=").concat(At.content_type,")")):(_t==null||((Jt=_t.type)===null||Jt===void 0)?void 0:Jt.indexOf("video"))>-1?it.replaceSelection('')):(_t==null||((yn=_t.type)===null||yn===void 0)?void 0:yn.indexOf("pdf"))>-1?it.replaceSelection('').concat(_t.name,"")):Q.includes(Bn)?it.replaceSelection('').concat(_t.name,"")):it.replaceSelection("[".concat(_t.name,"](").concat(u.a.API_SERVER,"/api/attachments/").concat(At.id,"?type=").concat(At.content_type,")"))}else(At==null?void 0:At.status)===401&&(document.location.href="/user/login")})}catch(At){N.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return it.on("paste",ft),it.on("dragleave",function(lt,vt){Fn.current.classList.remove("mouse-hover-md")}),it.on("dragover",function(lt,vt){Fn.current.classList.add("mouse-hover-md")}),it.on("drop",function(lt,vt){Fn.current.classList.add("mouse-hover-md");var wt;if(wt=vt.dataTransfer.files,wt.length>0){vt.preventDefault(),vt.stopPropagation();for(var Ct=function(an){var _t=wt[an],Bn=_t.name.split(".").pop();$(_t,function(At){if(At.id){var sn,Jt,yn;(_t==null||((sn=_t.type)===null||sn===void 0)?void 0:sn.indexOf("image"))>-1?it.replaceSelection("![,](/api/attachments/".concat(At.id,"?type=").concat(At.content_type,")")):(_t==null||((Jt=_t.type)===null||Jt===void 0)?void 0:Jt.indexOf("video"))>-1?it.replaceSelection('')):(_t==null||((yn=_t.type)===null||yn===void 0)?void 0:yn.indexOf("pdf"))>-1?it.replaceSelection('').concat(_t.name,"")):Q.includes(Bn)?it.replaceSelection('').concat(_t.name,"")):it.replaceSelection("[".concat(_t.name,"](").concat(u.a.API_SERVER,"/api/attachments/").concat(At.id,"?type=").concat(At.content_type,")"))}else(At==null?void 0:At.status)===401&&(document.location.href="/user/login")})},bt=0;bt0||bt.target.offsetWidth>0)&&(mn(),Ue.setSize("100%","100%"),Ue.refresh())}}catch(Kt){wt.e(Kt)}finally{wt.f()}});return lt.observe(Nn.current.parentElement),lt}if(Ue){var ft=it();return function(){ft.unobserve(Nn.current.parentElement)}}},[Ue,mn]),Object(g.useEffect)(function(){if(Ue){for(var it=[],ft=function(){var bt=vt[lt];wt=Object(W.a)(bt,2);var Kt=wt[0],an=wt[1],_t=Object(B.a)({},Kt,function(){Mi(an)});it.push(_t),Ue.addKeyMap(_t)},lt=0,vt=Object.entries(Z);lt0){var it=new Date().getTime(),ft=window.sessionStorage.getItem(mt);it>=Sn+Ke&&(!ft||ft!==tr)&&(window.sessionStorage.setItem(mt,tr),xr(!0))}},Ke),Object(g.useEffect)(function(){$r(Mt)},[Ue,Mt]),Object(g.useEffect)(function(){Ue&&(Bt&&Ue.focus())},[Ue,Bt]),Object(g.useEffect)(function(){if(xn&&Ue){var it=Ue.getScrollerElement();function ft(lt){var vt=lt.target;if(Sr.current){var wt=vt.scrollTop/vt.scrollHeight;Sr.current.scrollTop=Sr.current.scrollHeight*wt}}return it.addEventListener("scroll",ft),function(){it.removeEventListener("scroll",ft)}}},[Ue,xn]),Object(g.useEffect)(function(){if(Ue&&En){function it(ft,lt){En(ft,lt)}return Ue.on("beforeChange",it),function(){Ue.off("beforeChange",it)}}},[Ue,En]),Object(g.useEffect)(function(){if(Ue&&St){function it(){St(Ue.getValue())}return Ue.on("blur",it),function(){Ue.off("blur",it)}}},[Ue,St]),Object(g.useEffect)(function(){if(Ue){function it(ft){var lt=ft.getValue();Tn(lt),Zr(new Date().getTime()),ft.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),$e&&$e(lt)}return Ue.on("change",it),function(){Ue.off("change",it)}}},[Ue,$e]),Object(g.useEffect)(function(){Ue&&(De==null?(Ue.setValue(""),Tn("")):De!==Ue.getValue()&&(Ue.setValue(De),Tn(De),Ue.setCursor(Ue.lineCount(),0)))},[Ue,De]);var Mi=Object(g.useCallback)(function(it){var ft=Ue.getCursor(),lt=Ue.getSelection(),vt=lt.split(` `);switch(it){case"bold":return Ue.replaceSelection("**"+lt+"**"),lt===""&&Ue.setCursor(ft.line,ft.ch+2),Ue.focus();case"italic":return Ue.replaceSelection("*"+lt+"*"),lt===""&&Ue.setCursor(ft.line,ft.ch+1),Ue.focus();case"code":return Ue.replaceSelection("`"+lt+"`"),lt===""&&Ue.setCursor(ft.line,ft.ch+1),Ue.focus();case"inline-latex":return Ue.replaceSelection("`$$"+lt+"$$`"),lt===""&&Ue.setCursor(ft.line,ft.ch+3),Ue.focus();case"latex":return Ue.replaceSelection("```latex\n"+lt+"\n```"),Ue.setCursor(ft.line+1,lt.length+1),Ue.focus();case"line-break":return Ue.replaceSelection(`
    `),Ue.focus();case"list-ul":return lt===""?Ue.replaceSelection("- "+lt):Ue.replaceSelection(vt.map(function(wt){return wt===""?"":"- ".concat(wt)}).join(` `)),Ue.focus();case"list-ol":return lt===""?Ue.replaceSelection("1. "+lt):Ue.replaceSelection(vt.map(function(wt,Ct){return wt===""?"":"".concat(Ct+1,". ").concat(wt)}).join(` `)),Ue.focus();case"add-null-ch":return lt===""&&Ue.setCursor(ft.line,ft.ch+1),Ue.replaceSelection(xe),Ue.focus();case"inster-template-1":return lt===""&&Ue.setCursor(ft.line,ft.ch),Ue.replaceSelection(Pe),Ue.focus();case"eraser":return Ue.setValue(""),Ue.focus();case"trigger-watch":return $r(!xn),Ue.focus();case"trigger-full-screen":return Li(!wn),Ue.focus();case Ie:Kn(Ie);return;case Ye:Kn(Ye);return;case Le:Kn(Le);return;case Qe:Kn(Qe);return;default:throw new Error}},[Ue,xn,wn]),Or=Object(g.useCallback)(function(it){Kn("");switch(en){case Ie:var ft=it.title,lt=it.link;return Ue.replaceSelection("[".concat(ft,"](").concat(lt,")")),Ue.focus();case Ye:var vt=it.language,wt=it.content;return Ue.replaceSelection(["```"+vt,wt,"```"].join(` `)),Ue.focus();case Le:var Ct=it.src,bt=it.alt;return bt?Ue.replaceSelection("![ ".concat(bt," ]( ").concat(Ct,' "').concat(bt,'" )')):Ue.replaceSelection("![,](".concat(Ct,")")),Ue.focus();case Qe:for(var Kt=it.row,an=it.col,_t=it.align,Bn=` `,At=0;At300&&(Kt=300);var an=ct+Kt+"px";Tr(an)}}return it.addEventListener("mousedown",vt),document.addEventListener("mousemove",Ct),document.addEventListener("mouseup",wt),function(){it.removeEventListener("mousedown",vt),document.removeEventListener("mousemove",Ct),document.removeEventListener("mouseup",wt)}}},[Ue,Un]),Object(g.useEffect)(function(){Tr(ct)},[ct]);var Cn=_e(nt),ei=_e(Ii),On={width:Cn,height:ei},ti=Object(g.useMemo)(function(){if(Sn){var it=new Date(Sn),ft=it.getHours(),lt=it.getMinutes(),vt=it.getSeconds();return ft=ft<10?"0"+ft:ft,lt=lt<10?"0"+lt:lt,vt=vt<10?"0"+vt:vt,"".concat(ft,":").concat(lt,":").concat(vt)}return 0},[Sn]);function Ni(){window.sessionStorage.removeItem(mt),xr(!1),Zr(0)}function ar(){xr(!1),Zr(0),Ue.setValue(window.sessionStorage.getItem(mt))}function ua(it,ft){var lt=Ue.getValue();lt=lt.replace(it,ft),Tn(lt),Ue==null||Ue.setValue(lt)}return p.a.createElement(g.Fragment,null,p.a.createElement("div",{className:"markdown-editor-wrapper",ref:Fn},p.a.createElement("div",{className:"markdown-editor-container ".concat(Fe," ").concat(xn?"on-preview":""," ").concat(Ot?"mini":""," ").concat(wn?"full-screen":""),style:On},p.a.createElement(b,{insertTemp:yt,watch:xn,fullScreen:wn,showNullButton:Nt,onActionCallback:Mi,hidetoolBar:Pn,uuid:rr.current,setOpenPhones:function(){ir.current=!0}}),p.a.createElement("div",{className:"markdown-editor-body"},p.a.createElement("div",{className:"codemirror-container"},p.a.createElement("textarea",{ref:Nn,placeholder:yr})),xn?p.a.createElement("div",{ref:Sr,className:"preview-container"},bn==="stex"&&p.a.createElement(A,{value:tr}),bn!=="stex"&&p.a.createElement(x.a,{edit:!0,value:tr,replaces:ua})):null))),Dt?p.a.createElement("a",{ref:Un,className:"editor-resize"}):null,p.a.createElement(P.a,null,re[en]?p.a.createElement(V.a,{centered:!0,title:re[en],visible:!0,onCancel:Gn,footer:null,className:"markdown-popup-form"},qr):null))}},R7cW:function(at,Ve,te){"use strict";te.r(Ve);var ne=te("+L6B"),V=te("2/Rp"),D=te("DZo9"),z=te("8z0m"),N=te("0Owb"),M=te("5NDa"),W=te("5rEg"),B=te("sPJy"),k=te("bE4q"),R=te("k1fw"),g=te("oBTY"),p=te("9og8"),f=te("miYZ"),d=te("tsqr"),o=te("y8nQ"),c=te("Vl3Y"),s=te("tJVT"),a=te("WmNS"),l=te.n(a),h=te("cDcd"),O=te.n(h),w=te("Ty5D"),x=te("9kvl"),A=te("55Ip"),S=te("Ot1p"),T=te("XYT7"),E=te("m3rI"),_=te("YiJy"),u=te.n(_),y=function(b){var P,I=b.shixunHomeworks,U=b.newCourse,F=b.globalSetting,L=b.loading,v=b.dispatch,j=b.match,K=Object(w.i)(),J=c.a.useForm(),ee=Object(s.a)(J,1),ve=ee[0],de=Object(h.useState)({}),me=Object(s.a)(de,2),ce=me[0],pe=me[1],ae=Object(h.useState)(!1),he=Object(s.a)(ae,2),$=he[0],ie=he[1],q=Object(h.useState)([]),Ee=Object(s.a)(q,2),Ae=Ee[0],ye=Ee[1],we=Object(h.useState)([]),Re=Object(s.a)(we,2),ke=Re[0],Ne=Re[1],Ie=I.commonHomeWorkEditDefaultData,Le={name:"file",multiple:!0,action:E.a.API_SERVER+"/api/attachments.json",defaultFileList:Ae,onChange:function(Je){var je=Je.file.status;je!=="uploading",je==="done"?d.b.success("".concat(Je.file.name," \u6587\u4EF6\u4E0A\u4F20\u6210\u529F")):je==="error"&&d.b.error("".concat(Je.file.name," \u6587\u4EF6\u4E0A\u4F20\u5931\u8D25"))}};Object(h.useEffect)(function(){Qe()},[K.topicId]);var Ye=function(Je){return Je==null?void 0:Je.map(function(je){return{uid:je.id,response:{id:je.id},name:je.title,status:"done",url:je.url}})},Qe=function(){var We=Object(p.a)(l.a.mark(function Je(){var je;return l.a.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:return Se.next=2,v({type:"shixunHomeworks/editCommonHomeWorkDefaultBankData",payload:{id:K.topicId}});case 2:je=Se.sent,je&&(ve.setFieldsValue({name:je.name}),ve.setFieldsValue({description:je.description}),ve.setFieldsValue({reference_answer:je.reference_answer}),ye(Object(g.a)(Ye(je.attachments))),Ne(Object(g.a)(Ye(je.reference_attachments))),ie(!0));case 4:case"end":return Se.stop()}},Je)}));return function(){return We.apply(this,arguments)}}(),Xe=function(){var We=Object(p.a)(l.a.mark(function Je(je){var He,Se,qe,Ke;return l.a.wrap(function(Pe){for(;;)switch(Pe.prev=Pe.next){case 0:return He=Object(R.a)({},ce),He.attachment_ids&&(He.attachment_ids=He==null||((Se=He.attachment_ids.fileList)===null||Se===void 0)?void 0:Se.map(function(_e){var le;return(le=_e.response)===null||le===void 0?void 0:le.id})),He.reference_attachment_ids&&(He.reference_attachment_ids=He==null||((qe=He.reference_attachment_ids.fileList)===null||qe===void 0)?void 0:qe.map(function(_e){var le;return(le=_e.response)===null||le===void 0?void 0:le.id})),Pe.next=5,Object(T.n)(Object(R.a)(Object(R.a)({id:K.topicId},He),{},{base_on_project:null,type:1}));case 5:Ke=Pe.sent,Ke&&x.d.push("/users/".concat(K.username,"/topics/").concat(K.topicId,"/").concat(K.topictype,"/normal/detail"));case 7:case"end":return Pe.stop()}},Je)}));return function(je){return We.apply(this,arguments)}}();return O.a.createElement("section",{className:u.a.bg},O.a.createElement("section",{className:"animated fadeIn"},O.a.createElement("aside",{className:"mt10"},O.a.createElement(k.a,{separator:">"},O.a.createElement(k.a.Item,null,O.a.createElement(A.a,{to:"/users/".concat(K.username,"/").concat(K.topictype==="personal"?"topics":"topicbank","/").concat(K.topictype)},K.topictype==="personal"?"\u6211\u7684\u8BFE\u5802\u8D44\u6E90":"\u516C\u5171\u9898\u5E93")),O.a.createElement(k.a.Item,null,O.a.createElement(A.a,{to:"/users/".concat(K.username,"/topics/").concat(K.topicId,"/").concat(K.topictype,"/normal/detail")},"\u8BE6\u60C5")),O.a.createElement(k.a.Item,null,"\u7F16\u8F91")))),O.a.createElement("aside",{className:"font24 bold mt20 mb20"},"\u7F16\u8F91"),O.a.createElement(c.a,{form:ve,className:u.a.formWrap,scrollToFirstError:!0,layout:"vertical",onValuesChange:function(){pe(Object(R.a)({},ve.getFieldsValue()))},onFinish:Xe},O.a.createElement("div",{className:u.a.fieldWrap},O.a.createElement(c.a.Item,{name:"name",label:"\u6807\u9898:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6807\u9898"}]},O.a.createElement(W.a,{maxLength:60,suffix:"".concat(((P=ce.name)===null||P===void 0?void 0:P.length)||0,"/60"),placeholder:"\u4F8B\u5982\uFF1A\u4ECEPython\u7A0B\u5E8F\u8BBE\u8BA1-\u5165\u95E8\u7CBE\u901A"}))),O.a.createElement("div",{className:u.a.mdWrap},O.a.createElement(c.a.Item,{name:"description",label:"\u7B80\u4ECB:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4F5C\u4E1A\u7684\u7B80\u4ECB"},{max:5e3,message:"\u4F5C\u4E1A\u7B80\u4ECB\u6700\u5927\u9650\u52365000\u4E2A\u5B57\u7B26"}]},O.a.createElement(S.a,{id:"topic-normal-description",watch:!0,defaultValue:Ie.description})),O.a.createElement("div",null,O.a.createElement(c.a.Item,{name:"attachment_ids"},$&&O.a.createElement(z.a,Object(N.a)({defaultFileList:Ae},Le),O.a.createElement("span",{className:"c-blue"},"\u4E0A\u4F20\u9644\u4EF6")," \uFF08\u5355\u4E2A\u6587\u4EF6150MB\u4EE5\u5185\uFF09")))),O.a.createElement("div",{className:u.a.mdWrap},O.a.createElement(c.a.Item,{name:"reference_answer",label:"\u53C2\u8003\u7B54\u6848:"},O.a.createElement(S.a,{id:"topic-normal-reference_answer",defaultValue:Ie.reference_answer,watch:!0})),O.a.createElement("div",null,O.a.createElement(c.a.Item,{name:"reference_attachment_ids"},$&&O.a.createElement(z.a,Object(N.a)({},Le,{defaultFileList:ke}),O.a.createElement("span",{className:"c-blue"},"\u4E0A\u4F20\u9644\u4EF6")," \uFF08\u5355\u4E2A\u6587\u4EF6150MB\u4EE5\u5185\uFF09")))),O.a.createElement("div",{className:u.a.backgroundFa},O.a.createElement("div",{className:"pt40 mb30"},O.a.createElement(c.a.Item,null,O.a.createElement(V.a,{size:"large",type:"primary",className:"".concat(u.a.button," mr20"),htmlType:"submit"},"\u63D0\u4EA4"),O.a.createElement(V.a,{size:"large",type:"primary",ghost:!0,className:u.a.button,onClick:function(){return x.d.push("/users/".concat(K.username,"/topics/").concat(K.topicId,"/").concat(K.topictype,"/normal/detail"))}},"\u53D6\u6D88"))))))};Ve.default=Object(x.a)(function(m){var b=m.shixunHomeworks,P=m.newCourse,I=m.loading,U=m.globalSetting;return{shixunHomeworks:b,newCourse:P,globalSetting:U,loading:I.effects}})(y)},SJMd:function(at,Ve){/** * @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 te,ne,V,D=!1,z,N;window.PR_SHOULD_USE_CONTINUATION=!0;var M,W;(function(){var B=window,k=["break,continue,do,else,for,if,return,while"],R=[k,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],g=[R,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],p=[g,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],f=[g,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],d=[g,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],o="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",c=[g,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",a=[k,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],l=[k,"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"],h=[k,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],O=[p,d,f,c,s,a,l,h],w=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,x="str",A="kwd",S="com",T="typ",E="lit",_="pun",u="pln",y="tag",m="dec",b="src",P="atn",I="atv",U="nocode",F="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function L(ye){for(var we=0,Re=!1,ke=!1,Ne=0,Ie=ye.length;Ne122||(Q<65||fe>90||qe.push([Math.max(65,fe)|32,Math.min(Q,90)|32]),Q<97||fe>122||qe.push([Math.max(97,fe)&~32,Math.min(Q,122)&~32]))}}qe.sort(function(ge,Oe){return ge[0]-Oe[0]||Oe[1]-ge[1]});for(var Z=[],re=[],Pe=0;Peoe[0]&&(oe[1]+1>oe[0]&&xe.push("-"),xe.push(Xe(oe[1])))}return xe.push("]"),xe.join("")}function Je(He){for(var Se=He.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")),qe=Se.length,Ke=[],xe=0,Pe=0;xe=2&&fe==="["?Se[xe]=We(_e):fe!=="\\"&&(Se[xe]=_e.replace(/[a-zA-Z]/g,function(re){var oe=re.charCodeAt(0);return"["+String.fromCharCode(oe&~32,oe|32)+"]"}))}return Se.join("")}for(var je=[],Ne=0,Ie=ye.length;Ne=0;)Re[je.charAt(He)]=Je;var Se=Je[1],qe=""+Se;Qe.hasOwnProperty(qe)||(Ye.push(Se),Qe[qe]=null)}Ye.push(/[\0-\uffff]/),ke=L(Ye)})();var Ne=we.length,Ie=function(Le){for(var Ye=Le.sourceCode,Qe=Le.basePos,Xe=Le.sourceNode,We=[Qe,u],Je=0,je=Ye.match(ke)||[],He={},Se=0,qe=je.length;Se=5&&xe.substring(0,5)==="lang-",_e&&!(Pe&&typeof Pe[1]=="string")&&(_e=!1,xe=b),_e||(He[Ke]=xe)}var Q=Je;if(Je+=Ke.length,!_e)We.push(Qe+Q,xe);else{var Z=Pe[1],re=Ke.indexOf(Z),oe=re+Z.length;Pe[2]&&(oe=Ke.length-Pe[2].length,re=oe-Z.length);var ge=xe.substring(5);j(Xe,Qe+Q,Ke.substring(0,re),Ie,We),j(Xe,Qe+Q+re,Z,he(ge,Z),We),j(Xe,Qe+Q+oe,Ke.substring(oe),Ie,We)}}Le.decorations=We};return Ie}function ve(ye){var we=[],Re=[];ye.tripleQuotedStrings?we.push([x,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):ye.multiLineStrings?we.push([x,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):we.push([x,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),ye.verbatimStrings&&Re.push([x,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var ke=ye.hashComments;ke&&(ye.cStyleComments?(ke>1?we.push([S,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):we.push([S,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Re.push([x,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):we.push([S,/^#[^\r\n]*/,null,"#"])),ye.cStyleComments&&(Re.push([S,/^\/\/[^\r\n]*/,null]),Re.push([S,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Ne=ye.regexLiterals;if(Ne){var Ie=Ne>1?"":` \r`,Le=Ie?".":"[\\S\\s]",Ye="/(?=[^/*"+Ie+"])(?:[^/\\x5B\\x5C"+Ie+"]|\\x5C"+Le+"|\\x5B(?:[^\\x5C\\x5D"+Ie+"]|\\x5C"+Le+")*(?:\\x5D|$))+/";Re.push(["lang-regex",RegExp("^"+F+"("+Ye+")")])}var Qe=ye.types;Qe&&Re.push([T,Qe]);var Xe=(""+ye.keywords).replace(/^ | $/g,"");Xe.length&&Re.push([A,new RegExp("^(?:"+Xe.replace(/[\s,]+/g,"|")+")\\b"),null]),we.push([u,/^\s+/,null,` \r \xA0`]);var We="^.[^\\s\\w.$@'\"`/\\\\]*";return ye.regexLiterals&&(We+="(?!s*/)"),Re.push([E,/^@[a-z_$][a-z_$@0-9]*/i,null],[T,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[u,/^[a-z_$][a-z_$@0-9]*/i,null],[E,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[u,/^\\[\s\S]?/,null],[_,new RegExp(We),null]),ee(we,Re)}var de=ve({keywords:O,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function me(ye,we,Re){for(var ke=/(?:^|\s)nocode(?:\s|$)/,Ne=/\r\n?|\n/,Ie=ye.ownerDocument,Le=Ie.createElement("li");ye.firstChild;)Le.appendChild(ye.firstChild);var Ye=[Le];function Qe(Se){var qe=Se.nodeType;if(qe==1&&!ke.test(Se.className))if(Se.nodeName==="br")Xe(Se),Se.parentNode&&Se.parentNode.removeChild(Se);else for(var Ke=Se.firstChild;Ke;Ke=Ke.nextSibling)Qe(Ke);else if((qe==3||qe==4)&&Re){var xe=Se.nodeValue,Pe=xe.match(Ne);if(Pe){var _e=xe.substring(0,Pe.index);Se.nodeValue=_e;var le=xe.substring(Pe.index+Pe[0].length);if(le){var fe=Se.parentNode;fe.insertBefore(Ie.createTextNode(le),Se.nextSibling)}Xe(Se),_e||Se.parentNode.removeChild(Se)}}}function Xe(Se){for(;!Se.nextSibling;)if(Se=Se.parentNode,!Se)return;function qe(Pe,_e){var le=_e?Pe.cloneNode(!1):Pe,fe=Pe.parentNode;if(fe){var Q=qe(fe,1),Z=Pe.nextSibling;Q.appendChild(le);for(var re=Z;re;re=Z)Z=re.nextSibling,Q.appendChild(re)}return le}for(var Ke=qe(Se.nextSibling,0),xe;(xe=Ke.parentNode)&&xe.nodeType===1;)Ke=xe;Ye.push(Ke)}for(var We=0;We=fe&&(Qe+=2),Ie>=Q&&(Je+=2)}}finally{xe&&(xe.style.display=Pe)}}var pe={};function ae(ye,we){for(var Re=we.length;--Re>=0;){var ke=we[Re];pe.hasOwnProperty(ke)?B.console&&console.warn("cannot override language handler %s",ke):pe[ke]=ye}}function he(ye,we){return ye&&pe.hasOwnProperty(ye)||(ye=/^\s*]*(?:>|$)/],[S,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[_,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),ae(ee([[u,/^[\s]+/,null,` \r `],[I,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[y,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[_,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),ae(ee([],[[I,/^[\s\S]+/]]),["uq.val"]),ae(ve({keywords:p,hashComments:!0,cStyleComments:!0,types:w}),["c","cc","cpp","cxx","cyc","m"]),ae(ve({keywords:"null,true,false"}),["json"]),ae(ve({keywords:d,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:w}),["cs"]),ae(ve({keywords:f,cStyleComments:!0}),["java"]),ae(ve({keywords:h,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),ae(ve({keywords:a,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),ae(ve({keywords:s,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),ae(ve({keywords:l,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),ae(ve({keywords:c,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),ae(ve({keywords:o,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),ae(ee([],[[x,/^[\s\S]+/]]),["regex"]);function $(ye){var we=ye.langExtension;try{var Re=v(ye.sourceNode,ye.pre),ke=Re.sourceCode;ye.sourceCode=ke,ye.spans=Re.spans,ye.basePos=0,he(we,ke)(ye),ce(ye)}catch(Ne){B.console&&console.log(Ne&&Ne.stack||Ne)}}function ie(ye,we,Re){var ke=Re||!1,Ne=we||null,Ie=document.createElement("div");Ie.innerHTML="
    "+ye+"
    ",Ie=Ie.firstChild,ke&&me(Ie,ke,!0);var Le={langExtension:Ne,numberLines:ke,sourceNode:Ie,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return $(Le),Ie.innerHTML}function q(ye,we){var Re=we||document.body,ke=Re.ownerDocument||document;function Ne(le){return Re.getElementsByTagName(le)}for(var Ie=[Ne("pre"),Ne("code"),Ne("xmp")],Le=[],Ye=0;Ye=0;d--)if(this.__items[d].match(f))return!0;return!1},R.prototype.set_indent=function(f,d){this.is_empty()&&(this.__indent_count=f||0,this.__alignment_count=d||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},R.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)},R.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},R.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var f=this.__parent.current_line;return f.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),f.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),f.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,f.__items[0]===" "&&(f.__items.splice(0,1),f.__character_count-=1),!0}return!1},R.prototype.is_empty=function(){return this.__items.length===0},R.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},R.prototype.push=function(f){this.__items.push(f);var d=f.lastIndexOf(` `);d!==-1?this.__character_count=f.length-d:this.__character_count+=f.length},R.prototype.pop=function(){var f=null;return this.is_empty()||(f=this.__items.pop(),this.__character_count-=f.length),f},R.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},R.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},R.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},R.prototype.toString=function(){var f="";return this.is_empty()?this.__parent.indent_empty_lines&&(f=this.__parent.get_indent_string(this.__indent_count)):(f=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),f+=this.__items.join("")),f};function g(f,d){this.__cache=[""],this.__indent_size=f.indent_size,this.__indent_string=f.indent_char,f.indent_with_tabs||(this.__indent_string=new Array(f.indent_size+1).join(f.indent_char)),d=d||"",f.indent_level>0&&(d=new Array(f.indent_level+1).join(this.__indent_string)),this.__base_string=d,this.__base_string_length=d.length}g.prototype.get_indent_size=function(f,d){var o=this.__base_string_length;return d=d||0,f<0&&(o=0),o+=f*this.__indent_size,o+=d,o},g.prototype.get_indent_string=function(f,d){var o=this.__base_string;return d=d||0,f<0&&(f=0,o=""),d+=f*this.__indent_size,this.__ensure_cache(d),o+=this.__cache[d],o},g.prototype.__ensure_cache=function(f){for(;f>=this.__cache.length;)this.__add_column()},g.prototype.__add_column=function(){var f=this.__cache.length,d=0,o="";this.__indent_size&&f>=this.__indent_size&&(d=Math.floor(f/this.__indent_size),f-=d*this.__indent_size,o=new Array(d+1).join(this.__indent_string)),f&&(o+=new Array(f+1).join(" ")),this.__cache.push(o)};function p(f,d){this.__indent_cache=new g(f,d),this.raw=!1,this._end_with_newline=f.end_with_newline,this.indent_size=f.indent_size,this.wrap_line_length=f.wrap_line_length,this.indent_empty_lines=f.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new R(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(f,d){return this.__indent_cache.get_indent_string(f,d)},p.prototype.get_indent_size=function(f,d){return this.__indent_cache.get_indent_size(f,d)},p.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},p.prototype.add_new_line=function(f){return this.is_empty()||!f&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},p.prototype.get_code=function(f){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 f!==` `&&(o=o.replace(/[\n]/g,f)),o},p.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},p.prototype.set_indent=function(f,d){return f=f||0,d=d||0,this.next_line.set_indent(f,d),this.__lines.length>1?(this.current_line.set_indent(f,d),!0):(this.current_line.set_indent(),!1)},p.prototype.add_raw_token=function(f){for(var d=0;d1&&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(f,d){for(var o=this.__lines.length-2;o>=0;){var c=this.__lines[o];if(c.is_empty())break;if(c.item(0).indexOf(f)!==0&&c.item(-1)!==d){this.__lines.splice(o+1,0,new R(this)),this.previous_line=this.__lines[this.__lines.length-2];break}o--}},k.exports.Output=p},,,,function(k){function R(f,d){this.raw_options=g(f,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"])}R.prototype._get_array=function(f,d){var o=this.raw_options[f],c=d||[];return typeof o=="object"?o!==null&&typeof o.concat=="function"&&(c=o.concat()):typeof o=="string"&&(c=o.split(/[^a-zA-Z0-9_\/\-]+/)),c},R.prototype._get_boolean=function(f,d){var o=this.raw_options[f],c=o===void 0?!!d:!!o;return c},R.prototype._get_characters=function(f,d){var o=this.raw_options[f],c=d||"";return typeof o=="string"&&(c=o.replace(/\\r/,"\r").replace(/\\n/,` `).replace(/\\t/," ")),c},R.prototype._get_number=function(f,d){var o=this.raw_options[f];d=parseInt(d,10),isNaN(d)&&(d=0);var c=parseInt(o,10);return isNaN(c)&&(c=d),c},R.prototype._get_selection=function(f,d,o){var c=this._get_selection_list(f,d,o);if(c.length!==1)throw new Error("Invalid Option Value: The option '"+f+`' can only be one of the following values: `+d+` You passed in: '`+this.raw_options[f]+"'");return c[0]},R.prototype._get_selection_list=function(f,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 c=this._get_array(f,o);if(!this._is_valid_selection(c,d))throw new Error("Invalid Option Value: The option '"+f+`' can contain only the following values: `+d+` You passed in: '`+this.raw_options[f]+"'");return c},R.prototype._is_valid_selection=function(f,d){return f.length&&d.length&&!f.some(function(o){return d.indexOf(o)===-1})};function g(f,d){var o={};f=p(f);var c;for(c in f)c!==d&&(o[c]=f[c]);if(d&&f[d])for(c in f[d])o[c]=f[d][c];return o}function p(f){var d={},o;for(o in f){var c=o.replace(/-/g,"_");d[c]=f[o]}return d}k.exports.Options=R,k.exports.normalizeOpts=p,k.exports.mergeOpts=g},,function(k){var R=RegExp.prototype.hasOwnProperty("sticky");function g(p){this.__input=p||"",this.__input_length=this.__input.length,this.__position=0}g.prototype.restart=function(){this.__position=0},g.prototype.back=function(){this.__position>0&&(this.__position-=1)},g.prototype.hasNext=function(){return this.__position=0&&p=0&&f=p.length&&this.__input.substring(f-p.length,f).toLowerCase()===p},k.exports.InputScanner=g},,,,,function(k){function R(g,p){g=typeof g=="string"?g:g.source,p=typeof p=="string"?p:p.source,this.__directives_block_pattern=new RegExp(g+/ beautify( \w+[:]\w+)+ /.source+p,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(g+/\sbeautify\signore:end\s/.source+p,"g")}R.prototype.get_directives=function(g){if(!g.match(this.__directives_block_pattern))return null;var p={};this.__directive_pattern.lastIndex=0;for(var f=this.__directive_pattern.exec(g);f;)p[f[1]]=f[2],f=this.__directive_pattern.exec(g);return p},R.prototype.readIgnored=function(g){return g.readUntilAfter(this.__directives_end_ignore_pattern)},k.exports.Directives=R},,function(k,R,g){var p=g(16).Beautifier,f=g(17).Options;function d(o,c){var s=new p(o,c);return s.beautify()}k.exports=d,k.exports.defaultOptions=function(){return new f}},function(k,R,g){var p=g(17).Options,f=g(2).Output,d=g(8).InputScanner,o=g(13).Directives,c=new o(/\/\*/,/\*\//),s=/\r\n|[\r\n]/,a=/\r\n|[\r\n]/g,l=/\s/,h=/(?:\s|\n)+/g,O=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,w=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function x(A,S){this._source_text=A||"",this._options=new p(S),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"]}x.prototype.eatString=function(A){var S="";for(this._ch=this._input.next();this._ch;){if(S+=this._ch,this._ch==="\\")S+=this._input.next();else if(A.indexOf(this._ch)!==-1||this._ch===` `)break;this._ch=this._input.next()}return S},x.prototype.eatWhitespace=function(A){for(var S=l.test(this._input.peek()),T=0;l.test(this._input.peek());)this._ch=this._input.next(),A&&this._ch===` `&&((T===0||T0&&this._indentLevel--},x.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var A=this._source_text,S=this._options.eol;S==="auto"&&(S=` `,A&&s.test(A||"")&&(S=A.match(s)[0])),A=A.replace(a,` `);var T=A.match(/^[\t ]*/)[0];this._output=new f(this._options,T),this._input=new d(A),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var E=0,_=!1,u=!1,y=!1,m=!1,b=!1,P=!1,I=this._ch,U=!1,F,L,v;F=this._input.read(h),L=F!=="",v=I,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),I=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var j=this._input.read(O),K=c.get_directives(j);K&&K.ignore==="start"&&(j+=c.readIgnored(this._input)),this.print_string(j),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(w)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(L),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var J=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);J.match(/[ :]$/)&&(J=this.eatString(": ").replace(/\s$/,""),this.print_string(J),this._output.space_before_token=!0),J=J.replace(/\s$/,""),J==="extend"?m=!0:J==="import"&&(b=!0),J in this.NESTED_AT_RULE?(this._nestedLevel+=1,J in this.CONDITIONAL_GROUP_RULE&&(y=!0)):!_&&E===0&&J.indexOf(":")!==-1&&(u=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(L),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")u&&(u=!1,this.outdent()),y?(y=!1,_=this._indentLevel>=this._nestedLevel):_=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&_&&(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)):(v==="("?this._output.space_before_token=!1:v!==","&&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(),v==="{"&&this._output.trim(!0),b=!1,m=!1,u&&(this.outdent(),u=!1),this.print_string(this._ch),_=!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 ee=0;ee"||this._ch==="+"||this._ch==="~")&&!u&&E===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&&l.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(L),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),l.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 me=v==='"'||v==="'";this.preserveSingleSpace(me||L),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===` `&&U&&this._output.add_new_line()}var ce=this._output.get_code(S);return ce},k.exports.Beautifier=x},function(k,R,g){var p=g(6).Options;function f(d){p.call(this,d,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var o=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||o;var c=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var s=0;s=15&&(p=!1,k=!0);var x=l&&(R||p&&(w==null||w<12.11)),A=D||W&&B>=9;function S(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var T=function(e,t){var r=e.className,n=S(t).exec(r);if(n){var i=r.slice(n.index+n[0].length);e.className=r.slice(0,n.index)+(i?n[1]+i:"")}};function E(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function _(e,t){return E(e).appendChild(t)}function u(e,t,r,n){var i=document.createElement(e);if(r&&(i.className=r),n&&(i.style.cssText=n),typeof t=="string")i.appendChild(document.createTextNode(t));else if(t)for(var C=0;C=t)return H+(t-C);H+=G-C,H+=r-H%r,C=G+1}}var K=function(){this.id=null,this.f=null,this.time=0,this.handler=L(this.onTimeout,this)};K.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},K.prototype.set=function(e,t){this.f=t;var r=+new Date+e;(!this.id||r=t)return n+Math.min(H,t-i);if(i+=C-n,i+=r-i%r,n=C+1,i>=t)return n}}var ae=[""];function he(e){for(;ae.length<=e;)ae.push($(ae)+" ");return ae[e]}function $(e){return e[e.length-1]}function ie(e,t){for(var r=[],n=0;n"\x80"&&(e.toUpperCase()!=e.toLowerCase()||ye.test(e))}function Re(e,t){return t?t.source.indexOf("\\w")>-1&&we(e)?!0:t.test(e):we(e)}function ke(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Ne=/[\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 Ie(e){return e.charCodeAt(0)>=768&&Ne.test(e)}function Le(e,t,r){for(;(r<0?t>0:tr?-1:1;;){if(t==r)return t;var i=(t+r)/2,C=n<0?Math.ceil(i):Math.floor(i);if(C==t)return e(C)?t:r;e(C)?r=C:t=C+n}}function Qe(e,t,r,n){if(!e)return n(t,r,"ltr",0);for(var i=!1,C=0;Ct||t==r&&H.to==t)&&(n(Math.max(H.from,t),Math.min(H.to,r),H.level==1?"rtl":"ltr",C),i=!0)}i||n(t,r,"ltr")}var Xe=null;function We(e,t,r){var n;Xe=null;for(var i=0;it)return i;C.to==t&&(C.from!=C.to&&r=="before"?n=i:Xe=i),C.from==t&&(C.from!=C.to&&r!="before"?n=i:Xe=i)}return n!=null?n:Xe}var Je=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function r(Y){return Y<=247?e.charAt(Y):1424<=Y&&Y<=1524?"R":1536<=Y&&Y<=1785?t.charAt(Y-1536):1774<=Y&&Y<=2220?"r":8192<=Y&&Y<=8203?"w":Y==8204?"b":"L"}var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,C=/[LRr]/,H=/[Lb1n]/,G=/[1n]/;function X(Y,se,ue){this.level=Y,this.from=se,this.to=ue}return function(Y,se){var ue=se=="ltr"?"L":"R";if(Y.length==0||se=="ltr"&&!n.test(Y))return!1;for(var Te=Y.length,be=[],Ce=0;Ce-1&&(n[t]=i.slice(0,C).concat(i.slice(C+1)))}}}function xe(e,t){var r=qe(e,t);if(!r.length)return;for(var n=Array.prototype.slice.call(arguments,2),i=0;i0}function fe(e){e.prototype.on=function(t,r){Se(this,t,r)},e.prototype.off=function(t,r){Ke(this,t,r)}}function Q(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Z(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function re(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function oe(e){Q(e),Z(e)}function ge(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)),l&&e.ctrlKey&&t==1&&(t=3),t}var De=function(){if(W&&B<9)return!1;var e=u("div");return"draggable"in e||"dragDrop"in e}(),$e;function tt(e){if($e==null){var t=u("span","\u200B");_(e,u("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&($e=t.offsetWidth<=1&&t.offsetHeight>2&&!(W&&B<8))}var r=$e?u("span","\u200B"):u("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}var nt;function Et(e){if(nt!=null)return nt;var t=_(e,document.createTextNode("A\u062EA")),r=m(t,0,1).getBoundingClientRect(),n=m(t,1,2).getBoundingClientRect();return E(e),!r||r.left==r.right?!1:nt=n.right-r.right<3}var ct=` b`.split(/\n/).length!=3?function(e){for(var t=0,r=[],n=e.length;t<=n;){var i=e.indexOf(` `,t);i==-1&&(i=e.length);var C=e.slice(t,e.charAt(i-1)=="\r"?i-1:i),H=C.indexOf("\r");H!=-1?(r.push(C.slice(0,H)),t+=H+1):(r.push(C),t=i+1)}return r}:function(e){return e.split(/\r\n?|\n/)},st=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(r){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Ot=function(){var e=u("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Tt=null;function Bt(e){if(Tt!=null)return Tt;var t=_(e,u("span","x")),r=t.getBoundingClientRect(),n=m(t,0,1).getBoundingClientRect();return Tt=Math.abs(r.left-n.left)>1}var Mt={},yt={};function pn(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Mt[e]=t}function bn(e,t){yt[e]=t}function dt(e){if(typeof e=="string"&&yt.hasOwnProperty(e))e=yt[e];else if(e&&typeof e.name=="string"&&yt.hasOwnProperty(e.name)){var t=yt[e.name];typeof t=="string"&&(t={name:t}),e=Ae(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return dt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return dt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function mt(e,t){t=dt(t);var r=Mt[t.name];if(!r)return mt(e,"text/plain");var n=r(e,t);if(xt.hasOwnProperty(t.name)){var i=xt[t.name];for(var C in i){if(!i.hasOwnProperty(C))continue;n.hasOwnProperty(C)&&(n["_"+C]=n[C]),n[C]=i[C]}}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var H in t.modeProps)n[H]=t.modeProps[H];return n}var xt={};function Dt(e,t){var r=xt.hasOwnProperty(e)?xt[e]:xt[e]={};v(t,r)}function Wt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var r={};for(var n in t){var i=t[n];i instanceof Array&&(i=i.concat([])),r[n]=i}return r}function qn(e,t){for(var r;e.innerMode&&!(r=e.innerMode(t),!r||r.mode==e);)t=r.state,e=r.mode;return r||{mode:e,state:t}}function Gr(e,t,r){return e.startState?e.startState(t,r):!0}var Nt=function(e,t,r){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=r};Nt.prototype.eol=function(){return this.pos>=this.string.length},Nt.prototype.sol=function(){return this.pos==this.lineStart},Nt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Nt.prototype.next=function(){if(this.post},Nt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Nt.prototype.skipToEnd=function(){this.pos=this.string.length},Nt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Nt.prototype.backUp=function(e){this.pos-=e},Nt.prototype.column=function(){return this.lastColumnPos0?null:(C&&t!==!1&&(this.pos+=C[0].length),C)}},Nt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Nt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Nt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Nt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function rt(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var r=e;!r.lines;)for(var n=0;;++n){var i=r.children[n],C=i.chunkSize();if(t=e.first&&tr?Fe(r,rt(e,r).text.length):Ai(t,rt(e,t.line).text.length)}function Ai(e,t){var r=e.ch;return r==null||r>t?Fe(e.line,t):r<0?Fe(e.line,0):e}function Ue(e,t){for(var r=[],n=0;nthis.maxLookAhead&&(this.maxLookAhead=e),t},_n.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}},_n.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},_n.fromSaved=function(e,t,r){return t instanceof Er?new _n(e,Wt(e.mode,t.state),r,t.lookAhead):new _n(e,Wt(e.mode,t),r)},_n.prototype.save=function(e){var t=e!==!1?Wt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Er(t,this.maxLookAhead):t};function Vr(e,t,r,n){var i=[e.state.modeGen],C={};wn(e,t.text,e.doc.mode,r,function(Y,se){return i.push(Y,se)},C,n);for(var H=r.state,G=function(Y){r.baseTokens=i;var se=e.state.overlays[Y],ue=1,Te=0;r.state=!0,wn(e,t.text,se.mode,r,function(be,Ce){for(var Me=ue;Tebe&&i.splice(ue,1,be,i[ue+1],Be),ue+=2,Te=Math.min(be,Be)}if(!Ce)return;if(se.opaque)i.splice(Me,ue-Me,be,"overlay "+Ce),ue=Me+2;else for(;Mee.options.maxHighlightLength&&Wt(e.doc.mode,n.state),C=Vr(e,t,n);i&&(n.state=i),t.stateAfter=n.save(!i),t.styles=C.styles,C.classes?t.styleClasses=C.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Tn(e,t,r){var n=e.doc,i=e.display;if(!n.mode.startState)return new _n(n,!0,t);var C=Li(e,t,r),H=C>n.first&&rt(n,C-1).stateAfter,G=H?_n.fromSaved(n,H,C):new _n(n,Gr(n.mode),C);return n.iter(C,t,function(X){Xr(e,X.text,G);var Y=G.line;X.stateAfter=Y==t-1||Y%5==0||Y>=i.viewFrom&&Yt.start)return C}throw new Error("Mode "+e.name+" failed to advance stream.")}var $r=function(e,t,r){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=r};function Ri(e,t,r,n){var i=e.doc,C=i.mode,H;t=pt(i,t);var G=rt(i,t.line),X=Tn(e,t.line,r),Y=new Nt(G.text,e.options.tabSize,X),se;for(n&&(se=[]);(n||Y.pose.options.maxHighlightLength?(G=!1,H&&Xr(e,t,n,se.pos),se.pos=t.length,ue=null):ue=Qr(xn(r,se,n.state,Te),C),Te){var be=Te[0].name;be&&(ue="m-"+(ue?be+" "+ue:be))}if(!G||Y!=ue){for(;XH;--G){if(G<=C.first)return C.first;var X=rt(C,G-1),Y=X.stateAfter;if(Y&&(!r||G+(Y instanceof Er?Y.lookAhead:0)<=C.modeFrontier))return G;var se=j(X.text,null,e.options.tabSize);(i==null||n>se)&&(i=G-1,n=se)}return i}function aa(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontierr;n--){var i=rt(e,n).stateAfter;if(i&&(!(i instanceof Er)||n+i.lookAhead=t:C.to>t);(n||(n=[])).push(new nr(H,C.from,X?null:C.to))}}return n}function Ii(e,t,r){var n;if(e)for(var i=0;i=t:C.to>t);if(G||C.from==t&&H.type=="bookmark"&&(!r||C.marker.insertLeft)){var X=C.from==null||(H.inclusiveLeft?C.from<=t:C.from0&&G)for(var et=0;et0)continue;var se=[X,1],ue=ht(Y.from,G.from),Te=ht(Y.to,G.to);(ue<0||!H.inclusiveLeft&&!ue)&&se.push({from:Y.from,to:G.from}),(Te>0||!H.inclusiveRight&&!Te)&&se.push({from:G.to,to:Y.to}),i.splice.apply(i,se),X+=se.length-3}return i}function la(e){var t=e.markedSpans;if(!t)return;for(var r=0;rt)&&(!n||wr(n,C.marker)<0)&&(n=C.marker)}return n}function Pi(e,t,r,n,i){var C=rt(e,t),H=en&&C.markedSpans;if(H)for(var G=0;G=0&&ue<=0||se<=0&&ue>=0)continue;if(se<=0&&(X.marker.inclusiveRight&&i.inclusiveLeft?ht(Y.to,r)>=0:ht(Y.to,r)>0)||se>=0&&(X.marker.inclusiveRight&&i.inclusiveLeft?ht(Y.from,n)<=0:ht(Y.from,n)<0))return!0}}function mn(e){for(var t;t=Fn(e);)e=t.find(-1,!0).line;return e}function Mi(e){for(var t;t=Un(e);)e=t.find(1,!0).line;return e}function Or(e){for(var t,r;t=Un(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}function qr(e,t){var r=rt(e,t),n=mn(r);return r==n?t:St(n)}function Gn(e,t){if(t>e.lastLine())return t;var r=rt(e,t),n;if(!Cn(e,r))return t;for(;n=Un(r);)r=n.find(1,!0).line;return St(r)+1}function Cn(e,t){var r=en&&t.markedSpans;if(r)for(var n=void 0,i=0;it.maxLineLength&&(t.maxLineLength=i,t.maxLine=n)})}var ar=function(e,t,r){this.text=e,xr(this,t),this.height=r?r(this):1};ar.prototype.lineNo=function(){return St(this)},fe(ar);function ua(e,t,r,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),la(e),xr(e,r);var i=n?n(e):1;i!=e.height&&rn(e,i)}function it(e){e.parent=null,la(e)}var ft={},lt={};function vt(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?lt:ft;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function wt(e,t){var r=y("span",null,null,k?"padding-right: .1px":null),n={pre:y("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var C=i?t.rest[i-1]:t.line,H=void 0;n.pos=0,n.addToken=bt,Et(e.display.measure)&&(H=je(C,e.doc.direction))&&(n.addToken=an(n.addToken,H)),n.map=[];var G=t!=e.display.externalMeasured&&St(C);Bn(C,n,tr(e,C,G)),C.styleClasses&&(C.styleClasses.bgClass&&(n.bgClass=U(C.styleClasses.bgClass,n.bgClass||"")),C.styleClasses.textClass&&(n.textClass=U(C.styleClasses.textClass,n.textClass||""))),n.map.length==0&&n.map.push(0,0,n.content.appendChild(tt(e.display.measure))),i==0?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(k){var X=n.content.lastChild;(/\bcm-tab\b/.test(X.className)||X.querySelector&&X.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return xe(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=U(n.pre.className,n.textClass||"")),n}function Ct(e){var t=u("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function bt(e,t,r,n,i,C,H){if(!t)return;var G=e.splitSpaces?Kt(t,e.trailingSpace):t,X=e.cm.state.specialChars,Y=!1,se;if(!X.test(t))e.col+=t.length,se=document.createTextNode(G),e.map.push(e.pos,e.pos+t.length,se),W&&B<9&&(Y=!0),e.pos+=t.length;else{se=document.createDocumentFragment();for(var ue=0;;){X.lastIndex=ue;var Te=X.exec(t),be=Te?Te.index-ue:t.length-ue;if(be){var Ce=document.createTextNode(G.slice(ue,ue+be));W&&B<9?se.appendChild(u("span",[Ce])):se.appendChild(Ce),e.map.push(e.pos,e.pos+be,Ce),e.col+=be,e.pos+=be}if(!Te)break;ue+=be+1;var Me=void 0;if(Te[0]==" "){var Be=e.cm.options.tabSize,Ge=Be-e.col%Be;Me=se.appendChild(u("span",he(Ge),"cm-tab")),Me.setAttribute("role","presentation"),Me.setAttribute("cm-text"," "),e.col+=Ge}else Te[0]=="\r"||Te[0]==` `?(Me=se.appendChild(u("span",Te[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Me.setAttribute("cm-text",Te[0]),e.col+=1):(Me=e.cm.options.specialCharPlaceholder(Te[0]),Me.setAttribute("cm-text",Te[0]),W&&B<9?se.appendChild(u("span",[Me])):se.appendChild(Me),e.col+=1);e.map.push(e.pos,e.pos+1,Me),e.pos++}}if(e.trailingSpace=G.charCodeAt(t.length-1)==32,r||n||i||Y||C||H){var Ze=r||"";n&&(Ze+=n),i&&(Ze+=i);var ze=u("span",[se],Ze,C);if(H)for(var et in H)H.hasOwnProperty(et)&&et!="style"&&et!="class"&&ze.setAttribute(et,H[et]);return e.content.appendChild(ze)}e.content.appendChild(se)}function Kt(e,t){if(e.length>1&&!/ /.test(e))return e;for(var r=t,n="",i=0;iY&&ue.from<=Y);Te++);if(ue.to>=se)return e(r,n,i,C,H,G,X);e(r,n.slice(0,ue.to-Y),i,C,null,G,X),C=null,n=n.slice(ue.to-Y),Y=ue.to}}}function _t(e,t,r,n){var i=!n&&r.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!n&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",r.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function Bn(e,t,r){var n=e.markedSpans,i=e.text,C=0;if(!n){for(var H=1;HX||gt.collapsed&&ot.to==X&&ot.from==X)){if(ot.to!=null&&ot.to!=X&&be>ot.to&&(be=ot.to,Me=""),gt.className&&(Ce+=" "+gt.className),gt.css&&(Te=(Te?Te+";":"")+gt.css),gt.startStyle&&ot.from==X&&(Be+=" "+gt.startStyle),gt.endStyle&&ot.to==be&&(et||(et=[])).push(gt.endStyle,ot.to),gt.title&&((Ze||(Ze={})).title=gt.title),gt.attributes)for(var It in gt.attributes)(Ze||(Ze={}))[It]=gt.attributes[It];gt.collapsed&&(!Ge||wr(Ge.marker,gt)<0)&&(Ge=ot)}else ot.from>X&&be>ot.from&&(be=ot.from)}if(et)for(var Xt=0;Xt=G)break;for(var fn=Math.min(G,be);;){if(se){var un=X+se.length;if(!Ge){var jt=un>fn?se.slice(0,fn-X):se;t.addToken(t,jt,ue?ue+Ce:Ce,Be,X+jt.length==be?Me:"",Te,Ze)}if(un>=fn){se=se.slice(fn-X),X=fn;break}X=un,Be=""}se=i.slice(C,C=r[Y++]),ue=vt(r[Y++],t.cm.options)}}}function At(e,t,r){this.line=t,this.rest=Or(t),this.size=this.rest?St($(this.rest))-r+1:1,this.node=this.text=null,this.hidden=Cn(e,t)}function sn(e,t,r){for(var n=[],i,C=t;C2&&C.push((X.bottom+Y.top)/2-r.top)}}C.push(r.bottom-r.top)}}function es(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;nr)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Bo(e,t){t=mn(t);var r=St(t),n=e.display.externalMeasured=new At(e.doc,t,r);n.lineN=r;var i=n.built=wt(e,n);return n.text=i.pre,_(e.display.lineMeasure,i.pre),n}function ts(e,t,r,n){return Dn(e,Ar(e,t),r,n)}function fa(e,t){if(t>=e.display.viewFrom&&t=r.lineN&&tt)&&(C=X-G,i=C-1,t>=X&&(H="right")),i!=null){if(n=e[Y+2],G==X&&r==(n.insertLeft?"left":"right")&&(H=r),r=="left"&&i==0)for(;Y&&e[Y-2]==e[Y-3]&&e[Y-1].insertLeft;)n=e[(Y-=3)+2],H="left";if(r=="right"&&i==X-G)for(;Y=0&&!((r=e[i]).left!=r.right);i--);return r}function Ho(e,t,r,n){var i=rs(t.map,r,n),C=i.node,H=i.start,G=i.end,X=i.collapse,Y;if(C.nodeType==3){for(var se=0;se<4;se++){for(;H&&Ie(t.line.text.charAt(i.coverStart+H));)--H;for(;i.coverStart+G0&&(X=n="right");var ue;e.options.lineWrapping&&(ue=C.getClientRects()).length>1?Y=ue[n=="right"?ue.length-1:0]:Y=C.getBoundingClientRect()}if(W&&B<9&&!H&&(!Y||!Y.left&&!Y.right)){var Te=C.parentNode.getClientRects()[0];Te?Y={left:Te.left,right:Te.left+Lr(e.display),top:Te.top,bottom:Te.bottom}:Y=ns}for(var be=Y.top-t.rect.top,Ce=Y.bottom-t.rect.top,Me=(be+Ce)/2,Be=t.view.measure.heights,Ge=0;Ge=n.text.length?(X=n.text.length,Y="before"):X<=0&&(X=0,Y="after"),!G)return H(Y=="before"?X-1:X,Y=="before");function se(Ce,Me,Be){var Ge=G[Me],Ze=Ge.level==1;return H(Be?Ce-1:Ce,Ze!=Be)}var ue=We(G,X,Y),Te=Xe,be=se(X,ue,Y=="before");return Te!=null&&(be.other=se(X,Te,Y!="before")),be}function us(e,t){var r=0;t=pt(e.doc,t),e.options.lineWrapping||(r=Lr(e.display)*t.ch);var n=rt(e.doc,t.line),i=On(n)+Fi(e.display);return{left:r,right:r,top:i,bottom:i+n.height}}function ga(e,t,r,n,i){var C=Fe(e,t,r);return C.xRel=i,n&&(C.outside=n),C}function va(e,t,r){var n=e.doc;if(r+=e.display.viewOffset,r<0)return ga(n.first,0,null,-1,-1);var i=En(n,r),C=n.first+n.size-1;if(i>C)return ga(n.first+n.size-1,rt(n,C).text.length,null,1,1);t<0&&(t=0);for(var H=rt(n,i);;){var G=Ko(e,H,i,t,r),X=Sr(H,G.ch+(G.xRel>0||G.outside>0?1:0));if(!X)return G;var Y=X.find(1);if(Y.line==i)return Y;H=rt(n,i=Y.line)}}function ds(e,t,r,n){n-=pa(t);var i=t.text.length,C=Ye(function(H){return Dn(e,r,H-1).bottom<=n},i,0);return i=Ye(function(H){return Dn(e,r,H).top>n},C,i),{begin:C,end:i}}function cs(e,t,r,n){r||(r=Ar(e,t));var i=Ui(e,t,Dn(e,r,n),"line").top;return ds(e,t,r,i)}function _a(e,t,r,n){return e.bottom<=r?!1:e.top>r?!0:(n?e.left:e.right)>t}function Ko(e,t,r,n,i){i-=On(t);var C=Ar(e,t),H=pa(t),G=0,X=t.text.length,Y=!0,se=je(t,e.doc.direction);if(se){var ue=(e.options.lineWrapping?zo:Go)(e,t,r,C,se,n,i);Y=ue.level!=1,G=Y?ue.from:ue.to-1,X=Y?ue.to:ue.from-1}var Te=null,be=null,Ce=Ye(function(ut){var ot=Dn(e,C,ut);return ot.top+=H,ot.bottom+=H,_a(ot,n,i,!1)?(ot.top<=i&&ot.left<=n&&(Te=ut,be=ot),!0):!1},G,X),Me,Be,Ge=!1;if(be){var Ze=n-be.left=et.bottom?1:0}return Ce=Le(t.text,Ce,1),ga(r,Ce,Be,Ge,n-Me)}function Go(e,t,r,n,i,C,H){var G=Ye(function(ue){var Te=i[ue],be=Te.level!=1;return _a(An(e,Fe(r,be?Te.to:Te.from,be?"before":"after"),"line",t,n),C,H,!0)},0,i.length-1),X=i[G];if(G>0){var Y=X.level!=1,se=An(e,Fe(r,Y?X.from:X.to,Y?"after":"before"),"line",t,n);_a(se,C,H,!0)&&se.top>H&&(X=i[G-1])}return X}function zo(e,t,r,n,i,C,H){var G=ds(e,t,n,H),X=G.begin,Y=G.end;/\s/.test(t.text.charAt(Y-1))&&Y--;for(var se=null,ue=null,Te=0;Te=Y||be.to<=X)continue;var Ce=be.level!=1,Me=Dn(e,n,Ce?Math.min(Y,be.to)-1:Math.max(X,be.from)).right,Be=MeBe)&&(se=be,ue=Be)}return se||(se=i[i.length-1]),se.fromY&&(se={from:se.from,to:Y,level:se.level}),se}var or;function Rr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(or==null){or=u("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)or.appendChild(document.createTextNode("x")),or.appendChild(u("br"));or.appendChild(document.createTextNode("x"))}_(e.measure,or);var r=or.offsetHeight/50;return r>3&&(e.cachedTextHeight=r),E(e.measure),r||1}function Lr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=u("span","xxxxxxxxxx"),r=u("pre",[t],"CodeMirror-line-like");_(e.measure,r);var n=t.getBoundingClientRect(),i=(n.right-n.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function ya(e){for(var t=e.display,r={},n={},i=t.gutters.clientLeft,C=t.gutters.firstChild,H=0;C;C=C.nextSibling,++H){var G=e.display.gutterSpecs[H].className;r[G]=C.offsetLeft+C.clientLeft+i,n[G]=C.clientWidth}return{fixedPos:ba(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function ba(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function hs(e){var t=Rr(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/Lr(e.display)-3);return function(i){if(Cn(e.doc,i))return 0;var C=0;if(i.widgets)for(var H=0;H0&&(Y=rt(e.doc,X.line).text).length==X.ch){var se=j(Y,Y.length,e.options.tabSize)-Y.length;X=Fe(X.line,Math.max(0,Math.round((C-qa(e.display).left)/Lr(e.display))-se))}return X}function ur(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var r=e.display.view,n=0;nt)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)en&&qr(e.doc,t)i.viewFrom?Vn(e):(i.viewFrom+=n,i.viewTo+=n);else if(t<=i.viewFrom&&r>=i.viewTo)Vn(e);else if(t<=i.viewFrom){var C=Bi(e,r,r+n,1);C?(i.view=i.view.slice(C.index),i.viewFrom=C.lineN,i.viewTo+=n):Vn(e)}else if(r>=i.viewTo){var H=Bi(e,t,t,-1);H?(i.view=i.view.slice(0,H.index),i.viewTo=H.lineN):Vn(e)}else{var G=Bi(e,t,t,-1),X=Bi(e,r,r+n,1);G&&X?(i.view=i.view.slice(0,G.index).concat(sn(e,G.lineN,X.lineN)).concat(i.view.slice(X.index)),i.viewTo+=n):Vn(e)}var Y=i.externalMeasured;Y&&(r=i.lineN&&t=n.viewTo)return;var C=n.view[ur(e,t)];if(C.node==null)return;var H=C.changes||(C.changes=[]);J(H,r)==-1&&H.push(r)}function Vn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Bi(e,t,r,n){var i=ur(e,t),C,H=e.display.view;if(!en||r==e.doc.first+e.doc.size)return{index:i,lineN:r};for(var G=e.display.viewFrom,X=0;X0){if(i==H.length-1)return null;C=G+H[i].size-t,i++}else C=G-t;t+=C,r+=C}for(;qr(e.doc,r)!=r;){if(i==(n<0?0:H.length-1))return null;r+=n*H[i-(n<0?1:0)].size,i+=n}return{index:i,lineN:r}}function Vo(e,t,r){var n=e.display,i=n.view;i.length==0||t>=n.viewTo||r<=n.viewFrom?(n.view=sn(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=sn(e,t,n.viewFrom).concat(n.view):n.viewFromr&&(n.view=n.view.slice(0,ur(e,r)))),n.viewTo=r}function fs(e){for(var t=e.display.view,r=0,n=0;n=e.display.viewTo||G.to().line0?t.blinker=setInterval(function(){e.hasFocus()||Cr(e),t.cursorDiv.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function gs(e){e.state.focused||(e.display.input.focus(),xa(e))}function vs(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Cr(e))},100)}function xa(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(xe(e,"focus",e,t),e.state.focused=!0,I(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),k&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Ta(e)}function Cr(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(xe(e,"blur",e,t),e.state.focused=!1,T(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,r=t.lineDiv.offsetTop,n=0;n.005||se<-.005)&&(rn(i.line,H),_s(i.line),i.rest))for(var ue=0;uee.display.sizerWidth){var Te=Math.ceil(G/Lr(e.display));Te>e.display.maxLineLength&&(e.display.maxLineLength=Te,e.display.maxLine=i.line,e.display.maxLineChanged=!0)}}}function _s(e){if(e.widgets)for(var t=0;t=H&&(C=En(t,On(rt(t,X))-e.wrapper.clientHeight),H=X)}return{from:C,to:Math.max(H,C+1)}}function Yo(e,t){if(Pe(e,"scrollCursorIntoView"))return;var r=e.display,n=r.sizer.getBoundingClientRect(),i=null;if(t.top+n.top<0?i=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),i!=null&&!o){var C=u("div","\u200B",null,`position: absolute; top: `+(t.top-r.viewOffset-Fi(e.display))+`px; height: `+(t.bottom-t.top+In(e)+r.barHeight)+`px; left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(C),C.scrollIntoView(i),e.display.lineSpace.removeChild(C)}}function $o(e,t,r,n){n==null&&(n=0);var i;!e.options.lineWrapping&&t==r&&(t=t.ch?Fe(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,r=t.sticky=="before"?Fe(t.line,t.ch+1,"before"):t);for(var C=0;C<5;C++){var H=!1,G=An(e,t),X=!r||r==t?G:An(e,r);i={left:Math.min(G.left,X.left),top:Math.min(G.top,X.top)-n,right:Math.max(G.left,X.left),bottom:Math.max(G.bottom,X.bottom)+n};var Y=wa(e,i),se=e.doc.scrollTop,ue=e.doc.scrollLeft;if(Y.scrollTop!=null&&(li(e,Y.scrollTop),Math.abs(e.doc.scrollTop-se)>1&&(H=!0)),Y.scrollLeft!=null&&(dr(e,Y.scrollLeft),Math.abs(e.doc.scrollLeft-ue)>1&&(H=!0)),!H)break}return i}function Qo(e,t){var r=wa(e,t);r.scrollTop!=null&&li(e,r.scrollTop),r.scrollLeft!=null&&dr(e,r.scrollLeft)}function wa(e,t){var r=e.display,n=Rr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:r.scroller.scrollTop,C=ha(e),H={};t.bottom-t.top>C&&(t.bottom=t.top+C);var G=e.doc.height+ca(r),X=t.topG-n;if(t.topi+C){var se=Math.min(t.top,(Y?G:t.bottom)-C);se!=i&&(H.scrollTop=se)}var ue=e.options.fixedGutter?0:r.gutters.offsetWidth,Te=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:r.scroller.scrollLeft-ue,be=sr(e)-r.gutters.offsetWidth,Ce=t.right-t.left>be;return Ce&&(t.right=t.left+be),t.left<10?H.scrollLeft=0:t.leftbe+Te-3&&(H.scrollLeft=t.right+(Ce?0:10)-be),H}function Sa(e,t){if(t==null)return;Ki(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function Ir(e){Ki(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function oi(e,t,r){(t!=null||r!=null)&&Ki(e),t!=null&&(e.curOp.scrollLeft=t),r!=null&&(e.curOp.scrollTop=r)}function Jo(e,t){Ki(e),e.curOp.scrollToPos=t}function Ki(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var r=us(e,t.from),n=us(e,t.to);ys(e,r,n,t.margin)}}function ys(e,t,r,n){var i=wa(e,{left:Math.min(t.left,r.left),top:Math.min(t.top,r.top)-n,right:Math.max(t.right,r.right),bottom:Math.max(t.bottom,r.bottom)+n});oi(e,i.scrollLeft,i.scrollTop)}function li(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;D||Aa(e,{top:t}),bs(e,t,!0),D&&Aa(e),ci(e,100)}function bs(e,t,r){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!r)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function dr(e,t,r,n){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n)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,r=t.gutters.offsetWidth,n=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?r:0,docHeight:n,scrollHeight:n+In(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}var cr=function(e,t,r){this.cm=r;var n=this.vert=u("div",[u("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=u("div",[u("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=i.tabIndex=-1,e(n),e(i),Se(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),Se(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,W&&B<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};cr.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var i=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=r?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var C=e.viewWidth-e.barLeft-(r?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+C)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(n==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?n:0,bottom:t?n:0}},cr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},cr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},cr.prototype.zeroWidthHack=function(){var e=l&&!d?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new K,this.disableVert=new K},cr.prototype.enableZeroWidthBar=function(e,t,r){e.style.pointerEvents="auto";function n(){var i=e.getBoundingClientRect(),C=r=="vert"?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1);C!=e?e.style.pointerEvents="none":t.set(1e3,n)}t.set(1e3,n)},cr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var di=function(){};di.prototype.update=function(){return{bottom:0,right:0}},di.prototype.setScrollLeft=function(){},di.prototype.setScrollTop=function(){},di.prototype.clear=function(){};function Dr(e,t){t||(t=ui(e));var r=e.display.barWidth,n=e.display.barHeight;Es(e,t);for(var i=0;i<4&&r!=e.display.barWidth||n!=e.display.barHeight;i++)r!=e.display.barWidth&&e.options.lineWrapping&&Hi(e),Es(e,ui(e)),r=e.display.barWidth,n=e.display.barHeight}function Es(e,t){var r=e.display,n=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=n.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=n.bottom)+"px",r.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=n.bottom+"px",r.scrollbarFiller.style.width=n.right+"px"):r.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=n.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}var Ts={native:cr,null:di};function xs(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&T(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Ts[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Se(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,r){r=="horizontal"?dr(e,t):li(e,t)},e),e.display.scrollbars.addClass&&I(e.display.wrapper,e.display.scrollbars.addClass)}var Zo=0;function hr(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},yn(e.curOp)}function fr(e){var t=e.curOp;t&&Io(t,function(r){for(var n=0;n=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Gi(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&Oa(e.cm,e.update)}function nl(e){var t=e.cm,r=t.display;e.updatedDisplay&&Hi(t),e.barMeasure=ui(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=ts(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+In(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-sr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function rl(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)return;var r=+new Date+e.options.workTime,n=Tn(e,t.highlightFrontier),i=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),function(C){if(n.line>=e.display.viewFrom){var H=C.styles,G=C.text.length>e.options.maxHighlightLength?Wt(t.mode,n.state):null,X=Vr(e,C,n,!0);G&&(n.state=G),C.styles=X.styles;var Y=C.styleClasses,se=X.classes;se?C.styleClasses=se:Y&&(C.styleClasses=null);for(var ue=!H||H.length!=C.styles.length||Y!=se&&(!Y||!se||Y.bgClass!=se.bgClass||Y.textClass!=se.textClass),Te=0;!ue&&Ter)return ci(e,e.options.workDelay),!0}),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),i.length&&hn(e,function(){for(var C=0;C=r.viewFrom&&t.visible.to<=r.viewTo&&(r.updateLineNumbers==null||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&fs(e)==0)return!1;Os(e)&&(Vn(e),t.dims=ya(e));var i=n.first+n.size,C=Math.max(t.visible.from-e.options.viewportMargin,n.first),H=Math.min(i,t.visible.to+e.options.viewportMargin);r.viewFromH&&r.viewTo-H<20&&(H=Math.min(i,r.viewTo)),en&&(C=qr(e.doc,C),H=Gn(e.doc,H));var G=C!=r.viewFrom||H!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;Vo(e,C,H),r.viewOffset=On(rt(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var X=fs(e);if(!G&&X==0&&!t.force&&r.renderedView==r.view&&(r.updateLineNumbers==null||r.updateLineNumbers>=r.viewTo))return!1;var Y=ol(e);return X>4&&(r.lineDiv.style.display="none"),ul(e,r.updateLineNumbers,t.dims),X>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,ll(Y),E(r.cursorDiv),E(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,G&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,ci(e,400)),r.updateLineNumbers=null,!0}function ws(e,t){for(var r=t.viewport,n=!0;;n=!1){if(!n||!e.options.lineWrapping||t.oldDisplayWidth==sr(e)){if(r&&r.top!=null&&(r={top:Math.min(e.doc.height+ca(e.display)-ha(e),r.top)}),t.visible=Wi(e.display,e.doc,r),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else n&&(t.visible=Wi(e.display,e.doc,r));if(!Oa(e,t))break;Hi(e);var i=ui(e);si(e),Dr(e,i),La(e,i),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Aa(e,t){var r=new Gi(e,t);if(Oa(e,r)){Hi(e),ws(e,r);var n=ui(e);si(e),Dr(e,n),La(e,n),r.finish()}}function ul(e,t,r){var n=e.display,i=e.options.lineNumbers,C=n.lineDiv,H=C.firstChild;function G(Ce){var Me=Ce.nextSibling;return k&&l&&e.display.currentWheelTarget==Ce?Ce.style.display="none":Ce.parentNode.removeChild(Ce),Me}for(var X=n.view,Y=n.viewFrom,se=0;se-1&&(be=!1),Ya(e,ue,Y,r)),be&&(E(ue.lineNumber),ue.lineNumber.appendChild(document.createTextNode(vr(e.options,Y)))),H=ue.node.nextSibling}Y+=ue.size}for(;H;)H=G(H)}function Ra(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function La(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+In(e)+"px"}function Ss(e){var t=e.display,r=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var n=ba(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,C=n+"px",H=0;HH.clientWidth,X=H.scrollHeight>H.clientHeight;if(!(n&&G||i&&X))return;if(i&&l&&k){e:for(var Y=t.target,se=C.view;Y!=H;Y=Y.parentNode)for(var ue=0;ue=0&&ht(e,n.to())<=0)return r}return-1};var Rt=function(e,t){this.anchor=e,this.head=t};Rt.prototype.from=function(){return er(this.anchor,this.head)},Rt.prototype.to=function(){return yr(this.anchor,this.head)},Rt.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Rn(e,t,r){var n=e&&e.options.selectionsMayTouch,i=t[r];t.sort(function(Te,be){return ht(Te.from(),be.from())}),r=J(t,i);for(var C=1;C0:X>=0){var Y=er(G.from(),H.from()),se=yr(G.to(),H.to()),ue=G.empty()?H.from()==H.head:G.from()==G.head;C<=r&&--r,t.splice(--C,2,new Rt(ue?se:Y,ue?Y:se))}}return new vn(t,r)}function Xn(e,t){return new vn([new Rt(e,t||e)],0)}function Yn(e){return e.text?Fe(e.from.line+e.text.length-1,$(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Cs(e,t){if(ht(e,t.from)<0)return e;if(ht(e,t.to)<=0)return Yn(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=Yn(t).ch-t.to.ch),Fe(r,n)}function Ia(e,t){for(var r=[],n=0;n1&&e.remove(G.line+1,Ce-1),e.insert(G.line+1,Ge)}$t(e,"change",e,t)}function $n(e,t,r){function n(i,C,H){if(i.linked)for(var G=0;G1&&!e.done[e.done.length-2].ranges)return e.done.pop(),$(e.done)}function Ns(e,t,r,n){var i=e.history;i.undone.length=0;var C=+new Date,H,G;if((i.lastOp==n||i.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&i.lastModTime>C-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(H=pl(i,i.lastOp==n)))G=$(H.changes),ht(t.from,t.to)==0&&ht(t.from,G.to)==0?G.to=Yn(t):H.changes.push(Pa(e,t));else{var X=$(i.done);for((!X||!X.ranges)&&Xi(e.sel,i.done),H={changes:[Pa(e,t)],generation:i.generation},i.done.push(H);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(r),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=C,i.lastOp=i.lastSelOp=n,i.lastOrigin=i.lastSelOrigin=t.origin,G||xe(e,"historyAdded")}function ml(e,t,r,n){var i=t.charAt(0);return i=="*"||i=="+"&&r.ranges.length==n.ranges.length&&r.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,r,n){var i=e.history,C=n&&n.origin;r==i.lastSelOp||C&&i.lastSelOrigin==C&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==C||ml(e,C,$(i.done),t))?i.done[i.done.length-1]=t:Xi(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=C,i.lastSelOp=r,n&&n.clearRedo!==!1&&Ms(i.undone)}function Xi(e,t){var r=$(t);r&&r.ranges&&r.equals(e)||t.push(e)}function Fs(e,t,r,n){var i=t["spans_"+e.id],C=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,n),function(H){H.markedSpans&&((i||(i=t["spans_"+e.id]={}))[C]=H.markedSpans),++C})}function vl(e){if(!e)return null;for(var t,r=0;r-1&&($(G)[ue]=Y[ue],delete Y[ue]))}}return n}function Ma(e,t,r,n){if(n){var i=e.anchor;if(r){var C=ht(t,i)<0;C!=ht(r,i)<0?(i=t,t=r):C!=ht(t,r)<0&&(t=r)}return new Rt(i,t)}else return new Rt(r||t,t)}function Yi(e,t,r,n,i){i==null&&(i=e.cm&&(e.cm.display.shift||e.extend)),Zt(e,new vn([Ma(e.sel.primary(),t,r,i)],0),n)}function Bs(e,t,r){for(var n=[],i=e.cm&&(e.cm.display.shift||e.extend),C=0;C=t.ch:G.to>t.ch))){if(i&&(xe(X,"beforeCursorEnter"),X.explicitlyCleared))if(C.markedSpans){--H;continue}else break;if(!X.atomic)continue;if(r){var ue=X.find(n<0?1:-1),Te=void 0;if((n<0?se:Y)&&(ue=zs(e,ue,-n,ue&&ue.line==t.line?C:null)),ue&&ue.line==t.line&&(Te=ht(ue,r))&&(n<0?Te<0:Te>0))return Pr(e,ue,t,n,i)}var be=X.find(n<0?-1:1);return(n<0?Y:se)&&(be=zs(e,be,n,be.line==t.line?C:null)),be?Pr(e,be,t,n,i):null}}return t}function Qi(e,t,r,n,i){var C=n||1,H=Pr(e,t,r,C,i)||!i&&Pr(e,t,r,C,!0)||Pr(e,t,r,-C,i)||!i&&Pr(e,t,r,-C,!0);return H||(e.cantEdit=!0,Fe(e.first,0))}function zs(e,t,r,n){return r<0&&t.ch==0?t.line>e.first?pt(e,Fe(t.line-1)):null:r>0&&t.ch==(n||rt(e,t.line)).text.length?t.line=0;--i)Ys(e,{from:n[i].from,to:n[i].to,text:i?[""]:t.text,origin:t.origin});else Ys(e,t)}function Ys(e,t){if(t.text.length==1&&t.text[0]==""&&ht(t.from,t.to)==0)return;var r=Ia(e,t);Ns(e,t,r,e.cm?e.cm.curOp.id:NaN),pi(e,t,r,Tr(e,t));var n=[];$n(e,function(i,C){!C&&J(n,i.history)==-1&&(Zs(i.history,t),n.push(i.history)),pi(i,t,null,Tr(i,t))})}function Ji(e,t,r){var n=e.cm&&e.cm.state.suppressEdits;if(n&&!r)return;for(var i=e.history,C,H=e.sel,G=t=="undo"?i.done:i.undone,X=t=="undo"?i.undone:i.done,Y=0;Y=0;--be){var Ce=Te(be);if(Ce)return Ce.v}}function $s(e,t){if(t==0)return;if(e.first+=t,e.sel=new vn(ie(e.sel.ranges,function(i){return new Rt(Fe(i.anchor.line+t,i.anchor.ch),Fe(i.head.line+t,i.head.ch))}),e.sel.primIndex),e.cm){on(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;ne.lastLine())return;if(t.from.lineC&&(t={from:t.from,to:Fe(C,rt(e,C).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Pn(e,t.from,t.to),r||(r=Ia(e,t)),e.cm?bl(e.cm,t,n):ka(e,t,n),$i(e,r,de),e.cantEdit&&Qi(e,Fe(e.firstLine(),0))&&(e.cantEdit=!1)}function bl(e,t,r){var n=e.doc,i=e.display,C=t.from,H=t.to,G=!1,X=C.line;e.options.lineWrapping||(X=St(mn(rt(n,C.line))),n.iter(X,H.line+1,function(be){if(be==i.maxLine)return G=!0,!0})),n.sel.contains(t.from,t.to)>-1&&_e(e),ka(n,t,r,hs(e)),e.options.lineWrapping||(n.iter(X,C.line+t.text.length,function(be){var Ce=ti(be);Ce>i.maxLineLength&&(i.maxLine=be,i.maxLineLength=Ce,i.maxLineChanged=!0,G=!1)}),G&&(e.curOp.updateMaxLine=!0)),aa(n,C.line),ci(e,400);var Y=t.text.length-(H.line-C.line)-1;t.full?on(e):C.line==H.line&&t.text.length==1&&!Ds(e.doc,t)?zn(e,C.line,"text"):on(e,C.line,H.line+1,Y);var se=le(e,"changes"),ue=le(e,"change");if(ue||se){var Te={from:C,to:H,text:t.text,removed:t.removed,origin:t.origin};ue&&$t(e,"change",e,Te),se&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Te)}e.display.selForContextMenu=null}function Nr(e,t,r,n,i){var C;n||(n=r),ht(n,r)<0&&(C=[n,r],r=C[0],n=C[1]),typeof t=="string"&&(t=e.splitLines(t)),Mr(e,{from:r,to:n,text:t,origin:i})}function Qs(e,t,r,n){r1||!(this.children[0]instanceof gi))){var G=[];this.collapse(G),this.children=[new gi(G)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var H=i.lines.length%25+25,G=H;G10);e.parent.maybeSpill()},iterN:function(e,t,r){for(var n=0;ne.display.maxLineLength&&(e.display.maxLine=Y,e.display.maxLineLength=se,e.display.maxLineChanged=!0)}n!=null&&e&&this.collapsed&&on(e,n,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Ks(e.doc)),e&&$t(e,"markerCleared",e,this,n,i),t&&fr(e),this.parent&&this.parent.clear()},Qn.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var r,n,i=0;i0||H==0&&C.clearWhenEmpty!==!1)return C;if(C.replacedWith&&(C.collapsed=!0,C.widgetNode=y("span",[C.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||C.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(C.widgetNode.insertLeft=!0)),C.collapsed){if(Pi(e,t.line,t,r,C)||t.line!=r.line&&Pi(e,r.line,t,r,C))throw new Error("Inserting collapsed marker partially overlapping an existing one");sa()}C.addToHistory&&Ns(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var G=t.line,X=e.cm,Y;if(e.iter(G,r.line+1,function(ue){X&&C.collapsed&&!X.options.lineWrapping&&mn(ue)==X.display.maxLine&&(Y=!0),C.collapsed&&G!=t.line&&rn(ue,0),oa(ue,new nr(C,G==t.line?t.ch:null,G==r.line?r.ch:null)),++G}),C.collapsed&&e.iter(t.line,r.line+1,function(ue){Cn(e,ue)&&rn(ue,0)}),C.clearOnEnter&&Se(C,"beforeCursorEnter",function(){return C.clear()}),C.readOnly&&(Kn(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),C.collapsed&&(C.id=++eo,C.atomic=!0),X){if(Y&&(X.curOp.updateMaxLine=!0),C.collapsed)on(X,t.line,r.line+1);else if(C.className||C.startStyle||C.endStyle||C.css||C.attributes||C.title)for(var se=t.line;se<=r.line;se++)zn(X,se,"text");C.atomic&&Ks(X.doc),$t(X,"markerAdded",X,C)}return C}var yi=function(e,t){this.markers=e,this.primary=t;for(var r=0;r=0;X--)Mr(this,n[X]);G?Hs(this,G):this.cm&&Ir(this.cm)}),undo:Vt(function(){Ji(this,"undo")}),redo:Vt(function(){Ji(this,"redo")}),undoSelection:Vt(function(){Ji(this,"undo",!0)}),redoSelection:Vt(function(){Ji(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,r=0,n=0;n=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,r){e=pt(this,e),t=pt(this,t);var n=[],i=e.line;return this.iter(e.line,t.line+1,function(C){var H=C.markedSpans;if(H)for(var G=0;G=X.to||X.from==null&&i!=e.line||X.from!=null&&i==t.line&&X.from>=t.ch)&&(!r||r(X.marker))&&n.push(X.marker.parent||X.marker)}++i}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var r=t.markedSpans;if(r)for(var n=0;ne)return t=e,!0;e-=C,++r}),pt(this,Fe(r,t))},indexFromPos:function(e){e=pt(this,e);var t=e.ch;if(e.linet&&(t=e.from),e.to!=null&&e.to-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var se=e.dataTransfer.getData("Text");if(se){var ue;if(t.state.draggingText&&!t.state.draggingText.copy&&(ue=t.listSelections()),$i(t.doc,Xn(r,r)),ue)for(var Te=0;Te=0;G--)Nr(e.doc,"",n[G].from,n[G].to,"+delete");Ir(e)})}function Fa(e,t,r){var n=Le(e.text,t+r,r);return n<0||n>e.text.length?null:n}function Ua(e,t,r){var n=Fa(e,t.ch,r);return n==null?null:new Fe(t.line,n,r<0?"after":"before")}function Ba(e,t,r,n,i){if(e){t.doc.direction=="rtl"&&(i=-i);var C=je(r,t.doc.direction);if(C){var H=i<0?$(C):C[0],G=i<0==(H.level==1),X=G?"after":"before",Y;if(H.level>0||t.doc.direction=="rtl"){var se=Ar(t,r);Y=i<0?r.text.length-1:0;var ue=Dn(t,se,Y).top;Y=Ye(function(Te){return Dn(t,se,Te).top==ue},i<0==(H.level==1)?H.from:H.to-1,Y),X=="before"&&(Y=Fa(r,Y,1))}else Y=i<0?H.to:H.from;return new Fe(n,Y,X)}}return new Fe(n,i<0?r.text.length:0,i<0?"before":"after")}function Pl(e,t,r,n){var i=je(t,e.doc.direction);if(!i)return Ua(t,r,n);r.ch>=t.text.length?(r.ch=t.text.length,r.sticky="before"):r.ch<=0&&(r.ch=0,r.sticky="after");var C=We(i,r.ch,r.sticky),H=i[C];if(e.doc.direction=="ltr"&&H.level%2==0&&(n>0?H.to>r.ch:H.from=H.from&&Te>=se.begin)){var be=ue?"before":"after";return new Fe(r.line,Te,be)}}var Ce=function(Ge,Ze,ze){for(var et=function(It,Xt){return Xt?new Fe(r.line,G(It,1),"before"):new Fe(r.line,It,"after")};Ge>=0&&Ge0==(ut.level!=1),gt=ot?ze.begin:G(ze.end,-1);if(ut.from<=gt&>0?se.end:G(se.begin,-1);return Be!=null&&!(n>0&&Be==t.text.length)&&(Me=Ce(n>0?0:i.length-1,n,Y(Be)),Me)?Me:null}var Ti={selectAll:Vs,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),de)},killLine:function(e){return Br(e,function(t){if(t.empty()){var r=rt(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line0)i=new Fe(i.line,i.ch+1),e.replaceRange(C.charAt(i.ch-1)+C.charAt(i.ch-2),Fe(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var H=rt(e.doc,i.line-1).text;H&&(i=new Fe(i.line,1),e.replaceRange(C.charAt(0)+e.doc.lineSeparator()+H.charAt(H.length-1),Fe(i.line-1,H.length-1),i,"+transpose"))}}r.push(new Rt(i,i))}e.setSelections(r)})},newlineAndIndent:function(e){return hn(e,function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange(e.doc.lineSeparator(),t[r].anchor,t[r].head,"+input");t=e.listSelections();for(var n=0;ne&&ht(t,this.pos)==0&&r==this.button};var wi,Si;function Hl(e,t){var r=+new Date;return Si&&Si.compare(r,e,t)?(wi=Si=null,"triple"):wi&&wi.compare(r,e,t)?(Si=new Ha(r,e,t),wi=null,"double"):(wi=new Ha(r,e,t),Si=null,"single")}function vo(e){var t=this,r=t.display;if(Pe(t,e)||r.activeTouch&&r.input.supportsTouch())return;if(r.input.ensurePolled(),r.shift=e.shiftKey,jn(r,e)){k||(r.scroller.draggable=!1,setTimeout(function(){return r.scroller.draggable=!0},100));return}if(Wa(t,e))return;var n=lr(t,e),i=Oe(e),C=n?Hl(n,i):"single";if(window.focus(),i==1&&t.state.selectingText&&t.state.selectingText(e),n&&Wl(t,i,n,C,e))return;i==1?n?Gl(t,n,C,e):ge(e)==r.scroller&&Q(e):i==2?(n&&Yi(t.doc,n),setTimeout(function(){return r.input.focus()},20)):i==3&&(A?t.display.input.onContextMenu(e):vs(t))}function Wl(e,t,r,n,i){var C="Click";return n=="double"?C="Double"+C:n=="triple"&&(C="Triple"+C),C=(t==1?"Left":t==2?"Middle":"Right")+C,xi(e,oo(C,i),i,function(H){if(typeof H=="string"&&(H=Ti[H]),!H)return!1;var G=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),G=H(e,r)!=ve}finally{e.state.suppressEdits=!1}return G})}function Kl(e,t,r){var n=e.getOption("configureMouse"),i=n?n(e,t,r):{};if(i.unit==null){var C=h?r.shiftKey&&r.metaKey:r.altKey;i.unit=C?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(i.extend==null||e.doc.extend)&&(i.extend=e.doc.extend||r.shiftKey),i.addNew==null&&(i.addNew=l?r.metaKey:r.ctrlKey),i.moveOnDrag==null&&(i.moveOnDrag=!(l?r.altKey:r.ctrlKey)),i}function Gl(e,t,r,n){W?setTimeout(L(gs,e),0):e.curOp.focus=P();var i=Kl(e,r,n),C=e.doc.sel,H;e.options.dragDrop&&De&&!e.isReadOnly()&&r=="single"&&(H=C.contains(t))>-1&&(ht((H=C.ranges[H]).from(),t)<0||t.xRel>0)&&(ht(H.to(),t)>0||t.xRel<0)?zl(e,n,t,i):Vl(e,n,t,i)}function zl(e,t,r,n){var i=e.display,C=!1,H=zt(e,function(Y){k&&(i.scroller.draggable=!1),e.state.draggingText=!1,Ke(i.wrapper.ownerDocument,"mouseup",H),Ke(i.wrapper.ownerDocument,"mousemove",G),Ke(i.scroller,"dragstart",X),Ke(i.scroller,"drop",H),C||(Q(Y),n.addNew||Yi(e.doc,r,null,null,n.extend),k&&!f||W&&B==9?setTimeout(function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()},20):i.input.focus())}),G=function(Y){C=C||Math.abs(t.clientX-Y.clientX)+Math.abs(t.clientY-Y.clientY)>=10},X=function(){return C=!0};k&&(i.scroller.draggable=!0),e.state.draggingText=H,H.copy=!n.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop(),Se(i.wrapper.ownerDocument,"mouseup",H),Se(i.wrapper.ownerDocument,"mousemove",G),Se(i.scroller,"dragstart",X),Se(i.scroller,"drop",H),vs(e),setTimeout(function(){return i.input.focus()},20)}function _o(e,t,r){if(r=="char")return new Rt(t,t);if(r=="word")return e.findWordAt(t);if(r=="line")return new Rt(Fe(t.line,0),pt(e.doc,Fe(t.line+1,0)));var n=r(e,t);return new Rt(n.from,n.to)}function Vl(e,t,r,n){var i=e.display,C=e.doc;Q(t);var H,G,X=C.sel,Y=X.ranges;if(n.addNew&&!n.extend?(G=C.sel.contains(r),G>-1?H=Y[G]:H=new Rt(r,r)):(H=C.sel.primary(),G=C.sel.primIndex),n.unit=="rectangle")n.addNew||(H=new Rt(r,r)),r=lr(e,t,!0,!0),G=-1;else{var se=_o(e,r,n.unit);n.extend?H=Ma(H,se.anchor,se.head,n.extend):H=se}n.addNew?G==-1?(G=Y.length,Zt(C,Rn(e,Y.concat([H]),G),{scroll:!1,origin:"*mouse"})):Y.length>1&&Y[G].empty()&&n.unit=="char"&&!n.extend?(Zt(C,Rn(e,Y.slice(0,G).concat(Y.slice(G+1)),0),{scroll:!1,origin:"*mouse"}),X=C.sel):Na(C,G,H,me):(G=0,Zt(C,new vn([H],0),me),X=C.sel);var ue=r;function Te(ze){if(ht(ue,ze)==0)return;if(ue=ze,n.unit=="rectangle"){for(var et=[],ut=e.options.tabSize,ot=j(rt(C,r.line).text,r.ch,ut),gt=j(rt(C,ze.line).text,ze.ch,ut),It=Math.min(ot,gt),Xt=Math.max(ot,gt),Pt=Math.min(r.line,ze.line),fn=Math.min(e.lastLine(),Math.max(r.line,ze.line));Pt<=fn;Pt++){var un=rt(C,Pt).text,jt=pe(un,It,ut);It==Xt?et.push(new Rt(Fe(Pt,jt),Fe(Pt,jt))):un.length>jt&&et.push(new Rt(Fe(Pt,jt),Fe(Pt,pe(un,Xt,ut))))}et.length||et.push(new Rt(r,r)),Zt(C,Rn(e,X.ranges.slice(0,G).concat(et),G),{origin:"*mouse",scroll:!1}),e.scrollIntoView(ze)}else{var dn=H,Qt=_o(e,ze,n.unit),Gt=dn.anchor,Ht;ht(Qt.anchor,Gt)>0?(Ht=Qt.head,Gt=er(dn.from(),Qt.anchor)):(Ht=Qt.anchor,Gt=yr(dn.to(),Qt.head));var Ft=X.ranges.slice(0);Ft[G]=Xl(e,new Rt(pt(C,Gt),Ht)),Zt(C,Rn(e,Ft,G),me)}}var be=i.wrapper.getBoundingClientRect(),Ce=0;function Me(ze){var et=++Ce,ut=lr(e,ze,!0,n.unit=="rectangle");if(!ut)return;if(ht(ut,ue)!=0){e.curOp.focus=P(),Te(ut);var ot=Wi(i,C);(ut.line>=ot.to||ut.linebe.bottom?20:0;gt&&setTimeout(zt(e,function(){if(Ce!=et)return;i.scroller.scrollTop+=gt,Me(ze)}),50)}}function Be(ze){e.state.selectingText=!1,Ce=Infinity,ze&&(Q(ze),i.input.focus()),Ke(i.wrapper.ownerDocument,"mousemove",Ge),Ke(i.wrapper.ownerDocument,"mouseup",Ze),C.history.lastSelOrigin=null}var Ge=zt(e,function(ze){ze.buttons===0||!Oe(ze)?Be(ze):Me(ze)}),Ze=zt(e,Be);e.state.selectingText=Ze,Se(i.wrapper.ownerDocument,"mousemove",Ge),Se(i.wrapper.ownerDocument,"mouseup",Ze)}function Xl(e,t){var r=t.anchor,n=t.head,i=rt(e.doc,r.line);if(ht(r,n)==0&&r.sticky==n.sticky)return t;var C=je(i);if(!C)return t;var H=We(C,r.ch,r.sticky),G=C[H];if(G.from!=r.ch&&G.to!=r.ch)return t;var X=H+(G.from==r.ch==(G.level!=1)?0:1);if(X==0||X==C.length)return t;var Y;if(n.line!=r.line)Y=(n.line-r.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var se=We(C,n.ch,n.sticky),ue=se-H||(n.ch-r.ch)*(G.level==1?-1:1);se==X-1||se==X?Y=ue<0:Y=ue>0}var Te=C[X+(Y?-1:0)],be=Y==(Te.level==1),Ce=be?Te.from:Te.to,Me=be?"after":"before";return r.ch==Ce&&r.sticky==Me?t:new Rt(new Fe(r.line,Ce,Me),n)}function yo(e,t,r,n){var i,C;if(t.touches)i=t.touches[0].clientX,C=t.touches[0].clientY;else try{i=t.clientX,C=t.clientY}catch(Te){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&Q(t);var H=e.display,G=H.lineDiv.getBoundingClientRect();if(C>G.bottom||!le(e,r))return re(t);C-=G.top-H.viewOffset;for(var X=0;X=i){var se=En(e.doc,C),ue=e.display.gutterSpecs[X];return xe(e,r,e,se,ue.className,t),re(t)}}}function Wa(e,t){return yo(e,t,"gutterClick",!0)}function bo(e,t){if(jn(e.display,t)||Yl(e,t))return;if(Pe(e,t,"contextmenu"))return;A||e.display.input.onContextMenu(t)}function Yl(e,t){return le(e,"gutterContextMenu")?yo(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 jr={toString:function(){return"CodeMirror.Init"}},To={},ta={};function $l(e){var t=e.optionHandlers;function r(n,i,C,H){e.defaults[n]=i,C&&(t[n]=H?function(G,X,Y){Y!=jr&&C(G,X,Y)}:C)}e.defineOption=r,e.Init=jr,r("value","",function(n,i){return n.setValue(i)},!0),r("mode",null,function(n,i){n.doc.modeOption=i,Da(n)},!0),r("indentUnit",2,Da,!0),r("indentWithTabs",!1),r("smartIndent",!0),r("tabSize",4,function(n){fi(n),ai(n),on(n)},!0),r("lineSeparator",null,function(n,i){if(n.doc.lineSep=i,!i)return;var C=[],H=n.doc.first;n.doc.iter(function(X){for(var Y=0;;){var se=X.text.indexOf(i,Y);if(se==-1)break;Y=se+i.length,C.push(Fe(H,se))}H++});for(var G=C.length-1;G>=0;G--)Nr(n.doc,i,C[G],Fe(C[G].line,C[G].ch+i.length))}),r("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(n,i,C){n.state.specialChars=new RegExp(i.source+(i.test(" ")?"":"| "),"g"),C!=jr&&n.refresh()}),r("specialCharPlaceholder",Ct,function(n){return n.refresh()},!0),r("electricChars",!0),r("inputStyle",a?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),r("spellcheck",!1,function(n,i){return n.getInputField().spellcheck=i},!0),r("autocorrect",!1,function(n,i){return n.getInputField().autocorrect=i},!0),r("autocapitalize",!1,function(n,i){return n.getInputField().autocapitalize=i},!0),r("rtlMoveVisually",!O),r("wholeLineUpdateBefore",!0),r("theme","default",function(n){Eo(n),hi(n)},!0),r("keyMap","default",function(n,i,C){var H=qi(i),G=C!=jr&&qi(C);G&&G.detach&&G.detach(n,H),H.attach&&H.attach(n,G||null)}),r("extraKeys",null),r("configureMouse",null),r("lineWrapping",!1,Jl,!0),r("gutters",[],function(n,i){n.display.gutterSpecs=Ca(i,n.options.lineNumbers),hi(n)},!0),r("fixedGutter",!0,function(n,i){n.display.gutters.style.left=i?ba(n.display)+"px":"0",n.refresh()},!0),r("coverGutterNextToScrollbar",!1,function(n){return Dr(n)},!0),r("scrollbarStyle","native",function(n){xs(n),Dr(n),n.display.scrollbars.setScrollTop(n.doc.scrollTop),n.display.scrollbars.setScrollLeft(n.doc.scrollLeft)},!0),r("lineNumbers",!1,function(n,i){n.display.gutterSpecs=Ca(n.options.gutters,i),hi(n)},!0),r("firstLineNumber",1,hi,!0),r("lineNumberFormatter",function(n){return n},hi,!0),r("showCursorWhenSelecting",!1,si,!0),r("resetSelectionOnContextMenu",!0),r("lineWiseCopyCut",!0),r("pasteLinesPerSelection",!0),r("selectionsMayTouch",!1),r("readOnly",!1,function(n,i){i=="nocursor"&&(Cr(n),n.display.input.blur()),n.display.input.readOnlyChanged(i)}),r("screenReaderLabel",null,function(n,i){i=i===""?null:i,n.display.input.screenReaderLabelChanged(i)}),r("disableInput",!1,function(n,i){i||n.display.input.reset()},!0),r("dragDrop",!0,Ql),r("allowDropFileTypes",null),r("cursorBlinkRate",530),r("cursorScrollMargin",0),r("cursorHeight",1,si,!0),r("singleCursorHeightPerLine",!0,si,!0),r("workTime",100),r("workDelay",100),r("flattenSpans",!0,fi,!0),r("addModeClass",!1,fi,!0),r("pollInterval",100),r("undoDepth",200,function(n,i){return n.doc.history.undoDepth=i}),r("historyEventDelay",1250),r("viewportMargin",10,function(n){return n.refresh()},!0),r("maxHighlightLength",1e4,fi,!0),r("moveInputWithCursor",!0,function(n,i){i||n.display.input.resetPosition()}),r("tabindex",null,function(n,i){return n.display.input.getField().tabIndex=i||""}),r("autofocus",null),r("direction","ltr",function(n,i){return n.doc.setDirection(i)},!0),r("phrases",null)}function Ql(e,t,r){var n=r&&r!=jr;if(!t!=!n){var i=e.display.dragFunctions,C=t?Se:Ke;C(e.display.scroller,"dragstart",i.start),C(e.display.scroller,"dragenter",i.enter),C(e.display.scroller,"dragover",i.over),C(e.display.scroller,"dragleave",i.leave),C(e.display.scroller,"drop",i.drop)}}function Jl(e){e.options.lineWrapping?(I(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(T(e.display.wrapper,"CodeMirror-wrap"),Ni(e)),Ea(e),on(e),ai(e),setTimeout(function(){return Dr(e)},100)}function kt(e,t){var r=this;if(!(this instanceof kt))return new kt(e,t);this.options=t=t?v(t):{},v(To,t,!1);var n=t.value;typeof n=="string"?n=new ln(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var i=new kt.inputStyles[t.inputStyle](this),C=this.display=new dl(e,n,i,t);C.wrapper.CodeMirror=this,Eo(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),xs(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 K,keySeq:null,specialChars:null},t.autofocus&&!a&&C.input.focus(),W&&B<11&&setTimeout(function(){return r.display.input.reset(!0)},20),Zl(this),Ll(),hr(this),this.curOp.forceUpdate=!0,ks(this,n),t.autofocus&&!a||this.hasFocus()?setTimeout(function(){r.hasFocus()&&!r.state.focused&&xa(r)},20):Cr(this);for(var H in ta)ta.hasOwnProperty(H)&&ta[H](this,t[H],jr);Os(this),t.finishInit&&t.finishInit(this);for(var G=0;G20*20}Se(t.scroller,"touchstart",function(X){if(!Pe(e,X)&&!C(X)&&!Wa(e,X)){t.input.ensurePolled(),clearTimeout(r);var Y=+new Date;t.activeTouch={start:Y,moved:!1,prev:Y-n.end<=300?n:null},X.touches.length==1&&(t.activeTouch.left=X.touches[0].pageX,t.activeTouch.top=X.touches[0].pageY)}}),Se(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Se(t.scroller,"touchend",function(X){var Y=t.activeTouch;if(Y&&!jn(t,X)&&Y.left!=null&&!Y.moved&&new Date-Y.start<300){var se=e.coordsChar(t.activeTouch,"page"),ue;!Y.prev||H(Y,Y.prev)?ue=new Rt(se,se):!Y.prev.prev||H(Y,Y.prev.prev)?ue=e.findWordAt(se):ue=new Rt(Fe(se.line,0),pt(e.doc,Fe(se.line+1,0))),e.setSelection(ue.anchor,ue.head),e.focus(),Q(X)}i()}),Se(t.scroller,"touchcancel",i),Se(t.scroller,"scroll",function(){t.scroller.clientHeight&&(li(e,t.scroller.scrollTop),dr(e,t.scroller.scrollLeft,!0),xe(e,"scroll",e))}),Se(t.scroller,"mousewheel",function(X){return Ls(e,X)}),Se(t.scroller,"DOMMouseScroll",function(X){return Ls(e,X)}),Se(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(X){Pe(e,X)||oe(X)},over:function(X){Pe(e,X)||(Rl(e,X),oe(X))},start:function(X){return Al(e,X)},drop:zt(e,Ol),leave:function(X){Pe(e,X)||ro(e)}};var G=t.input.getField();Se(G,"keyup",function(X){return mo.call(e,X)}),Se(G,"keydown",zt(e,po)),Se(G,"keypress",zt(e,go)),Se(G,"focus",function(X){return xa(e,X)}),Se(G,"blur",function(X){return Cr(e,X)})}var Ka=[];kt.defineInitHook=function(e){return Ka.push(e)};function Oi(e,t,r,n){var i=e.doc,C;r==null&&(r="add"),r=="smart"&&(i.mode.indent?C=Tn(e,t).state:r="prev");var H=e.options.tabSize,G=rt(i,t),X=j(G.text,null,H);G.stateAfter&&(G.stateAfter=null);var Y=G.text.match(/^\s*/)[0],se;if(!n&&!/\S/.test(G.text))se=0,r="not";else if(r=="smart"&&(se=i.mode.indent(C,G.text.slice(Y.length),G.text),se==ve||se>150)){if(!n)return;r="prev"}r=="prev"?t>i.first?se=j(rt(i,t-1).text,null,H):se=0:r=="add"?se=X+e.options.indentUnit:r=="subtract"?se=X-e.options.indentUnit:typeof r=="number"&&(se=X+r),se=Math.max(0,se);var ue="",Te=0;if(e.options.indentWithTabs)for(var be=Math.floor(se/H);be;--be)Te+=H,ue+=" ";if(TeH,X=ct(t),Y=null;if(G&&n.ranges.length>1)if(Ln&&Ln.text.join(` `)==t){if(n.ranges.length%Ln.text.length==0){Y=[];for(var se=0;se=0;Te--){var be=n.ranges[Te],Ce=be.from(),Me=be.to();be.empty()&&(r&&r>0?Ce=Fe(Ce.line,Ce.ch-r):e.state.overwrite&&!G?Me=Fe(Me.line,Math.min(rt(C,Me.line).text.length,Me.ch+$(X).length)):G&&Ln&&Ln.lineWise&&Ln.text.join(` `)==X.join(` `)&&(Ce=Me=Fe(Ce.line,0)));var Be={from:Ce,to:Me,text:Y?Y[Te%Y.length]:X,origin:i||(G?"paste":e.state.cutIncoming>H?"cut":"+input")};Mr(e.doc,Be),$t(e,"inputRead",e,Be)}t&&!G&&wo(e,t),Ir(e),e.curOp.updateInput<2&&(e.curOp.updateInput=ue),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function xo(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&hn(t,function(){return Ga(t,r,0,null,"paste")}),!0}function wo(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var r=e.doc.sel,n=r.ranges.length-1;n>=0;n--){var i=r.ranges[n];if(i.head.ch>100||n&&r.ranges[n-1].head.line==i.head.line)continue;var C=e.getModeAt(i.head),H=!1;if(C.electricChars){for(var G=0;G-1){H=Oi(e,i.head.line,"smart");break}}else C.electricInput&&(C.electricInput.test(rt(e.doc,i.head.line).text.slice(0,i.head.ch))&&(H=Oi(e,i.head.line,"smart")));H&&$t(e,"electricInput",e,i.head.line)}}function So(e){for(var t=[],r=[],n=0;nC&&(Oi(this,G.head.line,n,!0),C=G.head.line,H==this.doc.sel.primIndex&&Ir(this));else{var X=G.from(),Y=G.to(),se=Math.max(C,X.line);C=Math.min(this.lastLine(),Y.line-(Y.ch?0:1))+1;for(var ue=se;ue0&&Na(this.doc,H,new Rt(X,Te[H].to()),de)}}}),getTokenAt:function(n,i){return Ri(this,n,i)},getLineTokens:function(n,i){return Ri(this,Fe(n),i,!0)},getTokenTypeAt:function(n){n=pt(this.doc,n);var i=tr(this,rt(this.doc,n.line)),C=0,H=(i.length-1)/2,G=n.ch,X;if(G==0)X=i[2];else for(;;){var Y=C+H>>1;if((Y?i[Y*2-1]:0)>=G)H=Y;else if(i[Y*2+1]X&&(n=X,H=!0),G=rt(this.doc,n)}else G=n;return Ui(this,G,{top:0,left:0},i||"page",C||H).top+(H?this.doc.height-On(G):0)},defaultTextHeight:function(){return Rr(this.display)},defaultCharWidth:function(){return Lr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(n,i,C,H,G){var X=this.display;n=An(this,pt(this.doc,n));var Y=n.bottom,se=n.left;if(i.style.position="absolute",i.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(i),X.sizer.appendChild(i),H=="over")Y=n.top;else if(H=="above"||H=="near"){var ue=Math.max(X.wrapper.clientHeight,this.doc.height),Te=Math.max(X.sizer.clientWidth,X.lineSpace.clientWidth);(H=="above"||n.bottom+i.offsetHeight>ue)&&n.top>i.offsetHeight?Y=n.top-i.offsetHeight:n.bottom+i.offsetHeight<=ue&&(Y=n.bottom),se+i.offsetWidth>Te&&(se=Te-i.offsetWidth)}i.style.top=Y+"px",i.style.left=i.style.right="",G=="right"?(se=X.sizer.clientWidth-i.offsetWidth,i.style.right="0px"):(G=="left"?se=0:G=="middle"&&(se=(X.sizer.clientWidth-i.offsetWidth)/2),i.style.left=se+"px"),C&&Qo(this,{left:se,top:Y,right:se+i.offsetWidth,bottom:Y+i.offsetHeight})},triggerOnKeyDown:tn(po),triggerOnKeyPress:tn(go),triggerOnKeyUp:mo,triggerOnMouseDown:tn(vo),execCommand:function(n){if(Ti.hasOwnProperty(n))return Ti[n].call(null,this)},triggerElectric:tn(function(n){wo(this,n)}),findPosH:function(n,i,C,H){var G=1;i<0&&(G=-1,i=-i);for(var X=pt(this.doc,n),Y=0;Y0&&se(C.charAt(H-1));)--H;for(;G.5||this.options.lineWrapping)&&Ea(this),xe(this,"refresh",this)}),swapDoc:tn(function(n){var i=this.doc;return i.cm=null,this.state.selectingText&&this.state.selectingText(),ks(this,n),ai(this),this.display.input.reset(),oi(this,n.scrollLeft,n.scrollTop),this.curOp.forceScroll=!0,$t(this,"swapDoc",this,i),i}),phrase:function(n){var i=this.options.phrases;return i&&Object.prototype.hasOwnProperty.call(i,n)?i[n]:n},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},fe(e),e.registerHelper=function(n,i,C){r.hasOwnProperty(n)||(r[n]=e[n]={_global:[]}),r[n][i]=C},e.registerGlobalHelper=function(n,i,C,H){e.registerHelper(n,i,H),r[n]._global.push({pred:C,val:H})}}function za(e,t,r,n,i){var C=t,H=r,G=rt(e,t.line),X=i&&e.direction=="rtl"?-r:r;function Y(){var Ze=t.line+X;return Ze=e.first+e.size?!1:(t=new Fe(Ze,t.ch,t.sticky),G=rt(e,Ze))}function se(Ze){var ze;if(n=="codepoint"){var et=G.text.charCodeAt(t.ch+(n>0?0:-1));isNaN(et)?ze=null:ze=new Fe(t.line,Math.max(0,Math.min(G.text.length,t.ch+r*(et>=55296&&et<56320?2:1))),-r)}else i?ze=Pl(e.cm,G,t,r):ze=Ua(G,t,r);if(ze==null)if(!Ze&&Y())t=Ba(i,e.cm,G,t.line,X);else return!1;else t=ze;return!0}if(n=="char"||n=="codepoint")se();else if(n=="column")se(!0);else if(n=="word"||n=="group")for(var ue=null,Te=n=="group",be=e.cm&&e.cm.getHelper(t,"wordChars"),Ce=!0;!(r<0&&!se(!Ce));Ce=!1){var Me=G.text.charAt(t.ch)||` `,Be=Re(Me,be)?"w":Te&&Me==` `?"n":!Te||/\s/.test(Me)?null:"p";if(Te&&!Ce&&!Be&&(Be="s"),ue&&ue!=Be){r<0&&(r=1,se(),t.sticky="after");break}if(Be&&(ue=Be),r>0&&!se(!Ce))break}var Ge=Qi(e,t,C,H,!0);return zr(C,Ge)&&(Ge.hitSide=!0),Ge}function Ro(e,t,r,n){var i=e.doc,C=t.left,H;if(n=="page"){var G=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),X=Math.max(G-.5*Rr(e.display),3);H=(r>0?t.bottom:t.top)+r*X}else n=="line"&&(H=r>0?t.bottom+3:t.top-3);for(var Y;!(Y=va(e,C,H),!Y.outside);){if(r<0?H<=0:H>=i.height){Y.hitSide=!0;break}H+=r*5}return Y}var Lt=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new K,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Lt.prototype.init=function(e){var t=this,r=this,n=r.cm,i=r.div=e.lineDiv;Oo(i,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize);function C(G){for(var X=G.target;X;X=X.parentNode){if(X==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(X.className))break}return!1}Se(i,"paste",function(G){if(!C(G)||Pe(n,G)||xo(G,n))return;B<=11&&setTimeout(zt(n,function(){return t.updateFromDOM()}),20)}),Se(i,"compositionstart",function(G){t.composing={data:G.data,done:!1}}),Se(i,"compositionupdate",function(G){t.composing||(t.composing={data:G.data,done:!1})}),Se(i,"compositionend",function(G){t.composing&&(G.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Se(i,"touchstart",function(){return r.forceCompositionEnd()}),Se(i,"input",function(){t.composing||t.readFromDOMSoon()});function H(G){if(!C(G)||Pe(n,G))return;if(n.somethingSelected())na({lineWise:!1,text:n.getSelections()}),G.type=="cut"&&n.replaceSelection("",null,"cut");else if(n.options.lineWiseCopyCut){var X=So(n);na({lineWise:!0,text:X.text}),G.type=="cut"&&n.operation(function(){n.setSelections(X.ranges,0,de),n.replaceSelection("",null,"cut")})}else return;if(G.clipboardData){G.clipboardData.clearData();var Y=Ln.text.join(` `);if(G.clipboardData.setData("Text",Y),G.clipboardData.getData("Text")==Y){G.preventDefault();return}}var se=Ao(),ue=se.firstChild;n.display.lineSpace.insertBefore(se,n.display.lineSpace.firstChild),ue.value=Ln.text.join(` `);var Te=document.activeElement;F(ue),setTimeout(function(){n.display.lineSpace.removeChild(se),Te.focus(),Te==i&&r.showPrimarySelection()},50)}Se(i,"copy",H),Se(i,"cut",H)},Lt.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Lt.prototype.prepareSelection=function(){var e=ps(this.cm,!1);return e.focus=document.activeElement==this.div,e},Lt.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Lt.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Lt.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,r=t.doc.sel.primary(),n=r.from(),i=r.to();if(t.display.viewTo==t.display.viewFrom||n.line>=t.display.viewTo||i.line=t.display.viewFrom&&Lo(t,n)||{node:G[0].measure.map[2],offset:0},Y=i.linee.firstLine()&&(n=Fe(n.line-1,rt(e.doc,n.line-1).length)),i.ch==rt(e.doc,i.line).text.length&&i.linet.viewTo-1)return!1;var C,H,G;n.line==t.viewFrom||(C=ur(e,n.line))==0?(H=St(t.view[0].line),G=t.view[0].node):(H=St(t.view[C].line),G=t.view[C-1].node.nextSibling);var X=ur(e,i.line),Y,se;if(X==t.view.length-1?(Y=t.viewTo-1,se=t.lineDiv.lastChild):(Y=St(t.view[X+1].line)-1,se=t.view[X+1].node.previousSibling),!G)return!1;for(var ue=e.doc.splitLines(tu(e,G,se,H,Y)),Te=Pn(e.doc,Fe(H,0),Fe(Y,rt(e.doc,Y).text.length));ue.length>1&&Te.length>1;)if($(ue)==$(Te))ue.pop(),Te.pop(),Y--;else if(ue[0]==Te[0])ue.shift(),Te.shift(),H++;else break;for(var be=0,Ce=0,Me=ue[0],Be=Te[0],Ge=Math.min(Me.length,Be.length);ben.ch&&Ze.charCodeAt(Ze.length-Ce-1)==ze.charCodeAt(ze.length-Ce-1);)be--,Ce++;ue[ue.length-1]=Ze.slice(0,Ze.length-Ce).replace(/^\u200b+/,""),ue[0]=ue[0].slice(be).replace(/\u200b+$/,"");var ut=Fe(H,be),ot=Fe(Y,Te.length?$(Te).length-Ce:0);if(ue.length>1||ue[0]||ht(ut,ot))return Nr(e.doc,ue,ut,ot,"+input"),!0},Lt.prototype.ensurePolled=function(){this.forceCompositionEnd()},Lt.prototype.reset=function(){this.forceCompositionEnd()},Lt.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Lt.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)},Lt.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&hn(this.cm,function(){return on(e.cm)})},Lt.prototype.setUneditable=function(e){e.contentEditable="false"},Lt.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||zt(this.cm,Ga)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Lt.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Lt.prototype.onContextMenu=function(){},Lt.prototype.resetPosition=function(){},Lt.prototype.needsContentAttribute=!0;function Lo(e,t){var r=fa(e,t.line);if(!r||r.hidden)return null;var n=rt(e.doc,t.line),i=es(r,n,t.line),C=je(n,e.doc.direction),H="left";if(C){var G=We(C,t.ch);H=G%2?"right":"left"}var X=rs(i.map,t.ch,H);return X.offset=X.collapse=="right"?X.end:X.start,X}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Hr(e,t){return t&&(e.bad=!0),e}function tu(e,t,r,n,i){var C="",H=!1,G=e.doc.lineSeparator(),X=!1;function Y(be){return function(Ce){return Ce.id==be}}function se(){H&&(C+=G,X&&(C+=G),H=X=!1)}function ue(be){be&&(se(),C+=be)}function Te(be){if(be.nodeType==1){var Ce=be.getAttribute("cm-text");if(Ce){ue(Ce);return}var Me=be.getAttribute("cm-marker"),Be;if(Me){var Ge=e.findMarks(Fe(n,0),Fe(i+1,0),Y(+Me));Ge.length&&(Be=Ge[0].find(0))&&ue(Pn(e.doc,Be.from,Be.to).join(G));return}if(be.getAttribute("contenteditable")=="false")return;var Ze=/^(pre|div|p|li|table|br)$/i.test(be.nodeName);if(!/^br$/i.test(be.nodeName)&&be.textContent.length==0)return;Ze&&se();for(var ze=0;ze=9&&t.hasSelection&&(t.hasSelection=null),r.poll()}),Se(i,"paste",function(H){if(Pe(n,H)||xo(H,n))return;n.state.pasteIncoming=+new Date,r.fastPoll()});function C(H){if(Pe(n,H))return;if(n.somethingSelected())na({lineWise:!1,text:n.getSelections()});else if(n.options.lineWiseCopyCut){var G=So(n);na({lineWise:!0,text:G.text}),H.type=="cut"?n.setSelections(G.ranges,null,de):(r.prevInput="",i.value=G.text.join(` `),F(i))}else return;H.type=="cut"&&(n.state.cutIncoming=+new Date)}Se(i,"cut",C),Se(i,"copy",C),Se(e.scroller,"paste",function(H){if(jn(e,H)||Pe(n,H))return;if(!i.dispatchEvent){n.state.pasteIncoming=+new Date,r.focus();return}var G=new Event("paste");G.clipboardData=H.clipboardData,i.dispatchEvent(G)}),Se(e.lineSpace,"selectstart",function(H){jn(e,H)||Q(H)}),Se(i,"compositionstart",function(){var H=n.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:H,range:n.markText(H,n.getCursor("to"),{className:"CodeMirror-composing"})}}),Se(i,"compositionend",function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)})},Ut.prototype.createField=function(e){this.wrapper=Ao(),this.textarea=this.wrapper.firstChild},Ut.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Ut.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,n=ps(e);if(e.options.moveInputWithCursor){var i=An(e,r.sel.primary().head,"div"),C=t.wrapper.getBoundingClientRect(),H=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+H.top-C.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+H.left-C.left))}return n},Ut.prototype.showSelection=function(e){var t=this.cm,r=t.display;_(r.cursorDiv,e.cursors),_(r.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Ut.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var r=t.getSelection();this.textarea.value=r,t.state.focused&&F(this.textarea),W&&B>=9&&(this.hasSelection=r)}else e||(this.prevInput=this.textarea.value="",W&&B>=9&&(this.hasSelection=null))},Ut.prototype.getField=function(){return this.textarea},Ut.prototype.supportsTouch=function(){return!1},Ut.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!a||P()!=this.textarea))try{this.textarea.focus()}catch(e){}},Ut.prototype.blur=function(){this.textarea.blur()},Ut.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Ut.prototype.receivedFocus=function(){this.slowPoll()},Ut.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()})},Ut.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function r(){var n=t.poll();!n&&!e?(e=!0,t.polling.set(60,r)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,r)},Ut.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||st(r)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=r.value;if(i==n&&!t.somethingSelected())return!1;if(W&&B>=9&&this.hasSelection===i||l&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var C=i.charCodeAt(0);if(C==8203&&!n&&(n="\u200B"),C==8666)return this.reset(),this.cm.execCommand("undo")}for(var H=0,G=Math.min(n.length,i.length);H1e3||i.indexOf(` `)>-1?r.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Ut.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Ut.prototype.onKeyPress=function(){W&&B>=9&&(this.hasSelection=null),this.fastPoll()},Ut.prototype.onContextMenu=function(e){var t=this,r=t.cm,n=r.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var C=lr(r,e),H=n.scroller.scrollTop;if(!C||p)return;var G=r.options.resetSelectionOnContextMenu;G&&r.doc.sel.contains(C)==-1&&zt(r,Zt)(r.doc,Xn(C),de);var X=i.style.cssText,Y=t.wrapper.style.cssText,se=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",i.style.cssText=`position: absolute; width: 30px; height: 30px; top: `+(e.clientY-se.top-5)+"px; left: "+(e.clientX-se.left-5)+`px; z-index: 1000; background: `+(W?"rgba(255, 255, 255, .05)":"transparent")+`; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var ue;k&&(ue=window.scrollY),n.input.focus(),k&&window.scrollTo(null,ue),n.input.reset(),r.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=be,n.selForContextMenu=r.doc.sel,clearTimeout(n.detectingSelectAll);function Te(){if(i.selectionStart!=null){var Me=r.somethingSelected(),Be="\u200B"+(Me?i.value:"");i.value="\u21DA",i.value=Be,t.prevInput=Me?"":"\u200B",i.selectionStart=1,i.selectionEnd=Be.length,n.selForContextMenu=r.doc.sel}}function be(){if(t.contextMenuPending!=be)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=Y,i.style.cssText=X,W&&B<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=H),i.selectionStart!=null){(!W||W&&B<9)&&Te();var Me=0,Be=function(){n.selForContextMenu==r.doc.sel&&i.selectionStart==0&&i.selectionEnd>0&&t.prevInput=="\u200B"?zt(r,Vs)(r):Me++<10?n.detectingSelectAll=setTimeout(Be,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(Be,200)}}if(W&&B>=9&&Te(),A){oe(e);var Ce=function(){Ke(window,"mouseup",Ce),setTimeout(be,20)};Se(window,"mouseup",Ce)}else setTimeout(be,50)},Ut.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Ut.prototype.setUneditable=function(){},Ut.prototype.needsContentAttribute=!1;function ru(e,t){if(t=t?v(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var r=P();t.autofocus=r==e||e.getAttribute("autofocus")!=null&&r==document.body}function n(){e.value=G.getValue()}var i;if(e.form&&(Se(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var C=e.form;i=C.submit;try{var H=C.submit=function(){n(),C.submit=i,C.submit(),C.submit=H}}catch(X){}}t.finishInit=function(X){X.save=n,X.getTextArea=function(){return e},X.toTextArea=function(){X.toTextArea=isNaN,n(),e.parentNode.removeChild(X.getWrapperElement()),e.style.display="",e.form&&(Ke(e.form,"submit",n),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=i))}},e.style.display="none";var G=kt(function(X){return e.parentNode.insertBefore(X,e.nextSibling)},t);return G}function iu(e){e.off=Ke,e.on=Se,e.wheelEventPixels=cl,e.Doc=ln,e.splitLines=ct,e.countColumn=j,e.findColumn=pe,e.isWordChar=we,e.Pass=ve,e.signal=xe,e.Line=ar,e.changeEnd=Yn,e.scrollbarModel=Ts,e.Pos=Fe,e.cmpPos=ht,e.modes=Mt,e.mimeModes=yt,e.resolveMode=dt,e.getMode=mt,e.modeExtensions=xt,e.extendMode=Dt,e.copyState=Wt,e.startState=Gr,e.innerMode=qn,e.commands=Ti,e.keyMap=Hn,e.keyName=lo,e.isModifierKey=so,e.lookupKey=Ur,e.normalizeKeyMap=kl,e.StringStream=Nt,e.SharedTextMarker=yi,e.TextMarker=Qn,e.LineWidget=_i,e.e_preventDefault=Q,e.e_stopPropagation=Z,e.e_stop=oe,e.addClass=I,e.contains=b,e.rmClass=T,e.keyNames=Jn}$l(kt),ql(kt);var au="iter insert remove copy getEditor constructor".split(" ");for(var ia in ln.prototype)ln.prototype.hasOwnProperty(ia)&&J(au,ia)<0&&(kt.prototype[ia]=function(e){return function(){return e.apply(this.doc,arguments)}}(ln.prototype[ia]));return fe(ln),kt.inputStyles={textarea:Ut,contenteditable:Lt},kt.defineMode=function(e){!kt.defaults.mode&&e!="null"&&(kt.defaults.mode=e),pn.apply(this,arguments)},kt.defineMIME=bn,kt.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),kt.defineMIME("text/plain","null"),kt.defineExtension=function(e,t){kt.prototype[e]=t},kt.defineDocExtension=function(e,t){ln.prototype[e]=t},kt.fromTextArea=ru,iu(kt),kt.version="5.58.2",kt})},Y1PL:function(at,Ve,te){"use strict";te.r(Ve),te.d(Ve,"ResizableTextArea",function(){return J});var ne=te("wx14"),V=te("1OyB"),D=te("vuIU"),z=te("Ji7U"),N=te("LK+K"),M=te("cDcd"),W=te("VTBJ"),B=te("rePB"),k=te("Zm9Q"),R=te("Kwbf"),g=te("c+Xe"),p=te("m+aA"),f=te("bdgK"),d=new Map;function o(de){de.forEach(function(me){var ce,pe=me.target;(ce=d.get(pe))===null||ce===void 0||ce.forEach(function(ae){return ae(pe)})})}var c=new f.default(o),s=null,a=null;function l(de,me){d.has(de)||(d.set(de,new Set),c.observe(de)),d.get(de).add(me)}function h(de,me){d.has(de)&&(d.get(de).delete(me),d.get(de).size||(c.unobserve(de),d.delete(de)))}var O=function(de){Object(z.a)(ce,de);var me=Object(N.a)(ce);function ce(){return Object(V.a)(this,ce),me.apply(this,arguments)}return Object(D.a)(ce,[{key:"render",value:function(){return this.props.children}}]),ce}(M.Component),w=M.createContext(null);function x(de){var me=de.children,ce=de.onBatchResize,pe=M.useRef(0),ae=M.useRef([]),he=M.useContext(w),$=M.useCallback(function(ie,q,Ee){pe.current+=1;var Ae=pe.current;ae.current.push({size:ie,element:q,data:Ee}),Promise.resolve().then(function(){Ae===pe.current&&(ce==null||ce(ae.current),ae.current=[])}),he==null||he(ie,q,Ee)},[ce,he]);return M.createElement(w.Provider,{value:$},me)}function A(de){var me=de.children,ce=de.disabled,pe=M.useRef(null),ae=M.useRef(null),he=M.useContext(w),$=M.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),ie=M.isValidElement(me)&&Object(g.c)(me),q=ie?me.ref:null,Ee=M.useMemo(function(){return Object(g.a)(q,pe)},[q,pe]),Ae=M.useRef(de);Ae.current=de;var ye=M.useCallback(function(we){var Re=Ae.current,ke=Re.onResize,Ne=Re.data,Ie=we.getBoundingClientRect(),Le=Ie.width,Ye=Ie.height,Qe=we.offsetWidth,Xe=we.offsetHeight,We=Math.floor(Le),Je=Math.floor(Ye);if($.current.width!==We||$.current.height!==Je||$.current.offsetWidth!==Qe||$.current.offsetHeight!==Xe){var je={width:We,height:Je,offsetWidth:Qe,offsetHeight:Xe};$.current=je;var He=Qe===Math.round(Le)?Le:Qe,Se=Xe===Math.round(Ye)?Ye:Xe,qe=Object(W.a)(Object(W.a)({},je),{},{offsetWidth:He,offsetHeight:Se});he==null||he(qe,we,Ne),ke&&Promise.resolve().then(function(){ke(qe,we)})}},[]);return M.useEffect(function(){var we=Object(p.a)(pe.current)||Object(p.a)(ae.current);return we&&!ce&&l(we,ye),function(){return h(we,ye)}},[pe.current,ce]),M.createElement(O,{ref:ae},ie?M.cloneElement(me,{ref:Ee}):me)}var S="rc-observer-key";function T(de){var me=de.children,ce=Object(k.a)(me);return ce.map(function(pe,ae){var he=(pe==null?void 0:pe.key)||"".concat(S,"-").concat(ae);return M.createElement(A,Object(ne.a)({},de,{key:he}),pe)})}T.Collection=x;var E=T,_=te("bT9E"),u=te("TSYQ"),y=te.n(u),m=` min-height:0 !important; max-height:none !important; height:0 !important; visibility:hidden !important; overflow:hidden !important; position:absolute !important; z-index:-1000 !important; top:0 !important; right:0 !important `,b=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],P={},I;function U(de){var me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ce=de.getAttribute("id")||de.getAttribute("data-reactid")||de.getAttribute("name");if(me&&P[ce])return P[ce];var pe=window.getComputedStyle(de),ae=pe.getPropertyValue("box-sizing")||pe.getPropertyValue("-moz-box-sizing")||pe.getPropertyValue("-webkit-box-sizing"),he=parseFloat(pe.getPropertyValue("padding-bottom"))+parseFloat(pe.getPropertyValue("padding-top")),$=parseFloat(pe.getPropertyValue("border-bottom-width"))+parseFloat(pe.getPropertyValue("border-top-width")),ie=b.map(function(Ee){return"".concat(Ee,":").concat(pe.getPropertyValue(Ee))}).join(";"),q={sizingStyle:ie,paddingSize:he,borderSize:$,boxSizing:ae};return me&&ce&&(P[ce]=q),q}function F(de){var me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ce=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,pe=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;I||(I=document.createElement("textarea"),I.setAttribute("tab-index","-1"),I.setAttribute("aria-hidden","true"),document.body.appendChild(I)),de.getAttribute("wrap")?I.setAttribute("wrap",de.getAttribute("wrap")):I.removeAttribute("wrap");var ae=U(de,me),he=ae.paddingSize,$=ae.borderSize,ie=ae.boxSizing,q=ae.sizingStyle;I.setAttribute("style","".concat(q,";").concat(m)),I.value=de.value||de.placeholder||"";var Ee=Number.MIN_SAFE_INTEGER,Ae=Number.MAX_SAFE_INTEGER,ye=I.scrollHeight,we;if(ie==="border-box"?ye+=$:ie==="content-box"&&(ye-=he),ce!==null||pe!==null){I.value=" ";var Re=I.scrollHeight-he;ce!==null&&(Ee=Re*ce,ie==="border-box"&&(Ee=Ee+he+$),ye=Math.max(Ee,ye)),pe!==null&&(Ae=Re*pe,ie==="border-box"&&(Ae=Ae+he+$),we=ye>Ae?"":"hidden",ye=Math.min(Ae,ye))}return{height:ye,minHeight:Ee,maxHeight:Ae,overflowY:we,resize:"none"}}var L=te("Gytx"),v=te.n(L),j;(function(de){de[de.NONE=0]="NONE",de[de.RESIZING=1]="RESIZING",de[de.RESIZED=2]="RESIZED"})(j||(j={}));var K=function(de){Object(z.a)(ce,de);var me=Object(N.a)(ce);function ce(pe){var ae;return Object(V.a)(this,ce),ae=me.call(this,pe),ae.nextFrameActionId=void 0,ae.resizeFrameId=void 0,ae.textArea=void 0,ae.saveTextArea=function(he){ae.textArea=he},ae.handleResize=function(he){var $=ae.state.resizeStatus,ie=ae.props,q=ie.autoSize,Ee=ie.onResize;if($!==j.NONE)return;typeof Ee=="function"&&Ee(he),q&&ae.resizeOnNextFrame()},ae.resizeOnNextFrame=function(){cancelAnimationFrame(ae.nextFrameActionId),ae.nextFrameActionId=requestAnimationFrame(ae.resizeTextarea)},ae.resizeTextarea=function(){var he=ae.props.autoSize;if(!he||!ae.textArea)return;var $=he.minRows,ie=he.maxRows,q=F(ae.textArea,!1,$,ie);ae.setState({textareaStyles:q,resizeStatus:j.RESIZING},function(){cancelAnimationFrame(ae.resizeFrameId),ae.resizeFrameId=requestAnimationFrame(function(){ae.setState({resizeStatus:j.RESIZED},function(){ae.resizeFrameId=requestAnimationFrame(function(){ae.setState({resizeStatus:j.NONE}),ae.fixFirefoxAutoScroll()})})})})},ae.renderTextArea=function(){var he=ae.props,$=he.prefixCls,ie=$===void 0?"rc-textarea":$,q=he.autoSize,Ee=he.onResize,Ae=he.className,ye=he.disabled,we=ae.state,Re=we.textareaStyles,ke=we.resizeStatus,Ne=Object(_.a)(ae.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Ie=y()(ie,Ae,Object(B.a)({},"".concat(ie,"-disabled"),ye));"value"in Ne&&(Ne.value=Ne.value||"");var Le=Object(W.a)(Object(W.a)(Object(W.a)({},ae.props.style),Re),ke===j.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return M.createElement(E,{onResize:ae.handleResize,disabled:!(q||Ee)},M.createElement("textarea",Object(ne.a)({},Ne,{className:Ie,style:Le,ref:ae.saveTextArea})))},ae.state={textareaStyles:{},resizeStatus:j.NONE},ae}return Object(D.a)(ce,[{key:"componentDidUpdate",value:function(ae){(ae.value!==this.props.value||!v()(ae.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 ae=this.textArea.selectionStart,he=this.textArea.selectionEnd;this.textArea.setSelectionRange(ae,he)}}catch($){}}},{key:"render",value:function(){return this.renderTextArea()}}]),ce}(M.Component),J=K,ee=function(de){Object(z.a)(ce,de);var me=Object(N.a)(ce);function ce(pe){var ae;Object(V.a)(this,ce),ae=me.call(this,pe),ae.resizableTextArea=void 0,ae.focus=function(){ae.resizableTextArea.textArea.focus()},ae.saveTextArea=function($){ae.resizableTextArea=$},ae.handleChange=function($){var ie=ae.props.onChange;ae.setValue($.target.value,function(){ae.resizableTextArea.resizeTextarea()}),ie&&ie($)},ae.handleKeyDown=function($){var ie=ae.props,q=ie.onPressEnter,Ee=ie.onKeyDown;$.keyCode===13&&q&&q($),Ee&&Ee($)};var he=typeof pe.value=="undefined"||pe.value===null?pe.defaultValue:pe.value;return ae.state={value:he},ae}return Object(D.a)(ce,[{key:"setValue",value:function(ae,he){"value"in this.props||this.setState({value:ae},he)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return M.createElement(J,Object(ne.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(ae){return"value"in ae?{value:ae.value}:null}}]),ce}(M.Component),ve=Ve.default=ee},YiJy:function(at,Ve,te){at.exports={bg:"bg___2xkgh",flexRow:"flexRow___3_RB8",flexJustifyCenter:"flexJustifyCenter___3Rbeo",flexAlignEnd:"flexAlignEnd___Up4h1",flexAlignCenter:"flexAlignCenter___hv6Pr",flexColumn:"flexColumn___kNPED",formWrap:"formWrap___2LY7l",titleWrap:"titleWrap___1TXK0",fieldWrap:"fieldWrap___2Bk37",mdWrap:"mdWrap___3VsOd",backgroundFa:"backgroundFa___13msX",button:"button___2BNet"}},ZW9T:function(at,Ve,te){"use strict";te.d(Ve,"a",function(){return F});var ne=te("k1fw"),V=te("miYZ"),D=te("tsqr"),z=te("rAM+"),N=te("tJVT"),M=te("PpiC"),W=te("cDcd"),B=te.n(W),k=te("bdgK"),R=te("oBTY"),g=te("9og8"),p=te("WmNS"),f=te.n(p),d={keywords:["print","auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while"]},o={quickKey:[{label:"main",content:["public static void main(String[] args) {"," $0","}"].join(` `)},{label:"System.out.println",content:["System.out.println($0)"].join(` `)},{label:"System.out.print",content:["System.out.print($0)"].join(` `)}],keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"]},c={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","for","friend","gcnew","generic","goto","if","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:"main",content:["int main () {"," $0","}"].join(` `)},{label:"for",content:["for( ; ; ){"," $0","}"].join(` `)},{label:"trycatch",content:["try{"," $0","}catch(ExceptionName e){","}"].join(` `)},{label:"using namespace std;",content:["using namespace std;"].join(` `)},{label:"#include ",content:["#include "].join(` `)},{label:"#include ",content:["#include "].join(` `)},{label:"#include ",content:["#include "].join(` `)},{label:"#include ",content:["#include "].join(` `)},{label:"#include ",content:["#include "].join(` `)}]},s={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(` `)}]},a=te("5VLF"),l=te.n(a),h={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"]}},O=function(v,j){return j.map(function(K){return{label:K,kind:v.languages.CompletionItemKind.Keyword,insertText:K}})},w=function(v){return Object.keys(h.tables).map(function(j){return{label:j,kind:v.languages.CompletionItemKind.Variable,insertText:j}})},x=function(v,j){var K=h.tables[v];return K?K.map(function(J){return{label:J,kind:j.languages.CompletionItemKind.Field,insertText:J}}):[]};function A(L,v,j,K,J){var ee=v.getWordUntilPosition(j),ve={startLineNumber:j.lineNumber,endLineNumber:j.lineNumber,startColumn:ee.startColumn,endColumn:ee.endColumn},de=K.map(function(me){return{label:me,kind:L.languages.CompletionItemKind.Keyword,insertText:me,insertTextRules:L.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ve}});return J.map(function(me){de.push(Object(ne.a)(Object(ne.a)({},me),{},{range:ve}))}),de}var S=function(L){h.languages.map(function(J){return L.languages.registerDocumentFormattingEditProvider(J,{provideDocumentFormattingEdits:function(ve,de,me){return Object(g.a)(f.a.mark(function ce(){var pe;return f.a.wrap(function(he){for(;;)switch(he.prev=he.next){case 0:return pe=l()(ve.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}),he.abrupt("return",[{range:ve.getFullModelRange(),text:pe}]);case 2:case"end":return he.stop()}},ce)}))()}}),J});var v=c.quickKey.map(function(J){return{label:J.label,kind:L.languages.CompletionItemKind.Method,insertText:J.content,insertTextRules:L.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),j=s.quickKey.map(function(J){return{label:J.label,kind:L.languages.CompletionItemKind.Method,insertText:J.content,insertTextRules:L.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),K=o.quickKey.map(function(J){return{label:J.label,kind:L.languages.CompletionItemKind.Method,insertText:J.content,insertTextRules:L.languages.CompletionItemInsertTextRule.InsertAsSnippet}});L.languages.registerCompletionItemProvider("cpp",{triggerCharacters:["."," ","#"].concat(Object(R.a)(c.keywords),Object(R.a)(c.quickKey.map(function(J){return J.label}))),provideCompletionItems:function(ee,ve){var de=ee.getValueInRange({startLineNumber:ve.lineNumber,startColumn:1,endLineNumber:ve.lineNumber,endColumn:ve.column}),me=de.match(/cu/gim);console.log("match:",me,ve,de,ee);var ce=[],pe=ve.lineNumber,ae=ve.column,he=ee.getValueInRange({startLineNumber:pe,startColumn:0,endLineNumber:pe,endColumn:ae}),$=he.trim().split(/\s+/),ie=$[$.length-1];if(ie.endsWith(".")){var q=ie.slice(0,ie.length-1);Object.keys(h.tables).includes(q)&&(ce=Object(R.a)(x(q,L)))}else ie==="."?ce=[]:ce=[].concat(Object(R.a)(w(L)),Object(R.a)(O(L,c.keywords)),Object(R.a)(v));return{suggestions:ce}}}),L.languages.registerCompletionItemProvider("c",{triggerCharacters:["."," ","#"].concat(Object(R.a)(d.keywords)),provideCompletionItems:function(ee,ve){var de=ee.getValueInRange({startLineNumber:ve.lineNumber,startColumn:1,endLineNumber:ve.lineNumber,endColumn:ve.column}),me=de.match(/cu/gim);console.log("match:",me,ve,de,ee);var ce=[],pe=ve.lineNumber,ae=ve.column,he=ee.getValueInRange({startLineNumber:pe,startColumn:0,endLineNumber:pe,endColumn:ae}),$=he.trim().split(/\s+/),ie=$[$.length-1];if(ie.endsWith(".")){var q=ie.slice(0,ie.length-1);Object.keys(h.tables).includes(q)&&(ce=Object(R.a)(x(q,L)))}else ie==="."?ce=[]:ce=[].concat(Object(R.a)(w(L)),Object(R.a)(O(L,d.keywords)));return{suggestions:ce}}}),L.languages.registerCompletionItemProvider("java",{triggerCharacters:["."," "].concat(Object(R.a)(o.keywords)),provideCompletionItems:function(ee,ve){var de=[],me=ve.lineNumber,ce=ve.column,pe=ee.getValueInRange({startLineNumber:me,startColumn:0,endLineNumber:me,endColumn:ce}),ae=pe.trim().split(/\s+/),he=ae[ae.length-1];if(he.endsWith(".")){var $=he.slice(0,he.length-1);Object.keys(h.tables).includes($)&&(de=Object(R.a)(x($,L)))}else he==="."?de=[]:de=[].concat(Object(R.a)(w(L)),Object(R.a)(O(L,o.keywords)),Object(R.a)(K));return{suggestions:de}}}),L.languages.registerCompletionItemProvider("python",{triggerCharacters:["."," "].concat(Object(R.a)(s.keywords)),provideCompletionItems:function(ee,ve){var de=[],me=ve.lineNumber,ce=ve.column,pe=ee.getValueInRange({startLineNumber:me,startColumn:0,endLineNumber:me,endColumn:ce}),ae=pe.trim().split(/\s+/),he=ae[ae.length-1];if(he.endsWith(".")){var $=he.slice(0,he.length-1);Object.keys(h.tables).includes($)&&(de=Object(R.a)(x($,L)))}else he==="."?de=[]:de=[].concat(Object(R.a)(w(L)),Object(R.a)(O(L,s.keywords)),Object(R.a)(j));return{suggestions:de}}})},T="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",E=te("LvDl"),_=te("+ua5");function u(L){return/^\d+$/.test(L)?"".concat(L,"px"):L}function y(){}var m=!1,b={"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 P(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],v=L;if(Array.isArray(L)){for(var j=0;j0||Wt.target.offsetWidth>0)&&xe.current.instance.layout()}}catch(qn){xt.e(qn)}finally{xt.f()}}),dt.observe(Ke.current)),dt}function ge(){D.b.warn(decodeURIComponent(T))}var Oe=function(){var mt=xe.current.instance;if(ee!=null&&mt&&Z){var xt=mt.getModel();xt&&ee!==xt.getValue()&&(m=!0,xt.setValue(ee),mt.layout(),m=!1)}};Object(W.useEffect)(function(){Pe.current&&clearTimeout(Pe.current),Pe.current=setTimeout(function(){Oe()},500)},[ee,Z,xe.current]),Object(W.useEffect)(function(){if(je&&xe.current&&xe.current.instance){var dt=xe.current.instance;dt.changeViewZones(function(xt){var Dt=document.createElement("div");Dt.style.padding="10px 20px",Dt.style.width="calc(100% - 20px)",Dt.className="my-error-line-wrp",Dt.innerHTML=Se,xt.addZone({afterLineNumber:je||11,heightInLines:3,domNode:Dt})});var mt={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(mt),dt.revealPositionInCenter({lineNumber:20,column:1})}},[je,xe.current,Z]);function De(){var dt=xe.current.instance;if(dt){var mt=dt.getSelection(),xt=xe.current.pastePos||{},Dt=new I.Range(xt.startLineNumber||mt.endLineNumber,xt.startColumn||mt.endColumn,xt.endLineNumber||mt.endLineNumber,xt.endColumn||mt.endColumn);setTimeout(function(){dt.executeEdits("",[{range:Dt,text:""}])},300)}}function $e(dt){(window.navigator.platform.match("Mac")?dt.metaKey:dt.ctrlKey)&&dt.keyCode==83&&(dt.preventDefault(),Ae())}var tt=function(){if(we&&xe.current.instance){var mt=xe.current.instance.getContentHeight();pn(mt0||Le.target.offsetWidth>0)&&we.layout()}}catch(Ye){Ne.e(Ye)}finally{Ne.f()}}),Re.observe(pe.current)),Re}Object(W.useEffect)(function(){pe.current&&te.e(27).then(te.t.bind(null,"M/lh",7)).then(function(we){I=we;var Re=I.editor.createDiffEditor(pe.current,Object(ne.a)(Object(ne.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},ce),{},{wordWrap:!0}));ie(Re);var ke=q(Re);return function(){Re.dispose();var Ne=Re.getModel();Ne&&Ne.dispose(),ke.unobserve(pe.current)}})},[]),Object(W.useEffect)(function(){$&&$.setModel({original:I.editor.createModel(ee,de),modified:I.editor.createModel(ve,de)})},[ee,ve,de,$]);var Ee=u(j),Ae=u(J),ye={width:Ee,height:Ae};return B.a.createElement("div",{className:"my-diff-editor",ref:pe,style:ye})}},ZpRC:function(at,Ve,te){"use strict";function ne(g){return typeof g=="object"&&g!=null&&g.nodeType===1}function V(g,p){return(!p||g!=="hidden")&&g!=="visible"&&g!=="clip"}function D(g,p){if(g.clientHeightp||c>g&&s=p&&a>=f?c-g-d:s>p&&af?s-p+o:0}var N=function(g,p){var f=window,d=p.scrollMode,o=p.block,c=p.inline,s=p.boundary,a=p.skipOverflowHiddenElements,l=typeof s=="function"?s:function(Re){return Re!==s};if(!ne(g))throw new TypeError("Invalid target");for(var h=document.scrollingElement||document.documentElement,O=[],w=g;ne(w)&&l(w);){if((w=w.parentElement)===h){O.push(w);break}w!=null&&w===document.body&&D(w)&&!D(document.documentElement)||w!=null&&D(w,a)&&O.push(w)}for(var x=f.visualViewport?f.visualViewport.width:innerWidth,A=f.visualViewport?f.visualViewport.height:innerHeight,S=window.scrollX||pageXOffset,T=window.scrollY||pageYOffset,E=g.getBoundingClientRect(),_=E.height,u=E.width,y=E.top,m=E.right,b=E.bottom,P=E.left,I=o==="start"||o==="nearest"?y:o==="end"?b:y+_/2,U=c==="center"?P+u/2:c==="end"?m:P,F=[],L=0;L=0&&P>=0&&b<=A&&m<=x&&y>=ee&&b<=de&&P>=me&&m<=ve)return F;var ce=getComputedStyle(v),pe=parseInt(ce.borderLeftWidth,10),ae=parseInt(ce.borderTopWidth,10),he=parseInt(ce.borderRightWidth,10),$=parseInt(ce.borderBottomWidth,10),ie=0,q=0,Ee="offsetWidth"in v?v.offsetWidth-v.clientWidth-pe-he:0,Ae="offsetHeight"in v?v.offsetHeight-v.clientHeight-ae-$:0;if(h===v)ie=o==="start"?I:o==="end"?I-A:o==="nearest"?z(T,T+A,A,ae,$,T+I,T+I+_,_):I-A/2,q=c==="start"?U:c==="center"?U-x/2:c==="end"?U-x:z(S,S+x,x,pe,he,S+U,S+U+u,u),ie=Math.max(0,ie+T),q=Math.max(0,q+S);else{ie=o==="start"?I-ee-ae:o==="end"?I-de+$+Ae:o==="nearest"?z(ee,de,K,ae,$+Ae,I,I+_,_):I-(ee+K/2)+Ae/2,q=c==="start"?U-me-pe:c==="center"?U-(me+J/2)+Ee/2:c==="end"?U-ve+he+Ee:z(me,ve,J,pe,he+Ee,U,U+u,u);var ye=v.scrollLeft,we=v.scrollTop;I+=we-(ie=Math.max(0,Math.min(we+ie,v.scrollHeight-K+Ae))),U+=ye-(q=Math.max(0,Math.min(ye+q,v.scrollWidth-J+Ee)))}F.push({el:v,top:ie,left:q})}return F};function M(g){return g===Object(g)&&Object.keys(g).length!==0}function W(g,p){p===void 0&&(p="auto");var f="scrollBehavior"in document.body.style;g.forEach(function(d){var o=d.el,c=d.top,s=d.left;o.scroll&&f?o.scroll({top:c,left:s,behavior:p}):(o.scrollTop=c,o.scrollLeft=s)})}function B(g){return g===!1?{block:"end",inline:"nearest"}:M(g)?g:{block:"start",inline:"nearest"}}function k(g,p){var f=!g.ownerDocument.documentElement.contains(g);if(M(p)&&typeof p.behavior=="function")return p.behavior(f?[]:N(g,p));if(f)return;var d=B(p);return W(N(g,d),d.behavior)}var R=Ve.a=k},Zss7:function(at,Ve,te){var ne;(function(V){var D=/^\s+/,z=/\s+$/,N=0,M=V.round,W=V.min,B=V.max,k=V.random;function R($,ie){if($=$||"",ie=ie||{},$ instanceof R)return $;if(!(this instanceof R))return new R($,ie);var q=g($);this._originalInput=$,this._r=q.r,this._g=q.g,this._b=q.b,this._a=q.a,this._roundA=M(100*this._a)/100,this._format=ie.format||q.format,this._gradientType=ie.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=q.ok,this._tc_id=N++}R.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 $=this.toRgb();return($.r*299+$.g*587+$.b*114)/1e3},getLuminance:function(){var $=this.toRgb(),ie,q,Ee,Ae,ye,we;return ie=$.r/255,q=$.g/255,Ee=$.b/255,ie<=.03928?Ae=ie/12.92:Ae=V.pow((ie+.055)/1.055,2.4),q<=.03928?ye=q/12.92:ye=V.pow((q+.055)/1.055,2.4),Ee<=.03928?we=Ee/12.92:we=V.pow((Ee+.055)/1.055,2.4),.2126*Ae+.7152*ye+.0722*we},setAlpha:function($){return this._a=F($),this._roundA=M(100*this._a)/100,this},toHsv:function(){var $=o(this._r,this._g,this._b);return{h:$.h*360,s:$.s,v:$.v,a:this._a}},toHsvString:function(){var $=o(this._r,this._g,this._b),ie=M($.h*360),q=M($.s*100),Ee=M($.v*100);return this._a==1?"hsv("+ie+", "+q+"%, "+Ee+"%)":"hsva("+ie+", "+q+"%, "+Ee+"%, "+this._roundA+")"},toHsl:function(){var $=f(this._r,this._g,this._b);return{h:$.h*360,s:$.s,l:$.l,a:this._a}},toHslString:function(){var $=f(this._r,this._g,this._b),ie=M($.h*360),q=M($.s*100),Ee=M($.l*100);return this._a==1?"hsl("+ie+", "+q+"%, "+Ee+"%)":"hsla("+ie+", "+q+"%, "+Ee+"%, "+this._roundA+")"},toHex:function($){return s(this._r,this._g,this._b,$)},toHexString:function($){return"#"+this.toHex($)},toHex8:function($){return a(this._r,this._g,this._b,this._a,$)},toHex8String:function($){return"#"+this.toHex8($)},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(L(this._r,255)*100)+"%",g:M(L(this._g,255)*100)+"%",b:M(L(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+M(L(this._r,255)*100)+"%, "+M(L(this._g,255)*100)+"%, "+M(L(this._b,255)*100)+"%)":"rgba("+M(L(this._r,255)*100)+"%, "+M(L(this._g,255)*100)+"%, "+M(L(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:I[s(this._r,this._g,this._b,!0)]||!1},toFilter:function($){var ie="#"+l(this._r,this._g,this._b,this._a),q=ie,Ee=this._gradientType?"GradientType = 1, ":"";if($){var Ae=R($);q="#"+l(Ae._r,Ae._g,Ae._b,Ae._a)}return"progid:DXImageTransform.Microsoft.gradient("+Ee+"startColorstr="+ie+",endColorstr="+q+")"},toString:function($){var ie=!!$;$=$||this._format;var q=!1,Ee=this._a<1&&this._a>=0,Ae=!ie&&Ee&&($==="hex"||$==="hex6"||$==="hex3"||$==="hex4"||$==="hex8"||$==="name");return Ae?$==="name"&&this._a===0?this.toName():this.toRgbString():($==="rgb"&&(q=this.toRgbString()),$==="prgb"&&(q=this.toPercentageRgbString()),($==="hex"||$==="hex6")&&(q=this.toHexString()),$==="hex3"&&(q=this.toHexString(!0)),$==="hex4"&&(q=this.toHex8String(!0)),$==="hex8"&&(q=this.toHex8String()),$==="name"&&(q=this.toName()),$==="hsl"&&(q=this.toHslString()),$==="hsv"&&(q=this.toHsvString()),q||this.toHexString())},clone:function(){return R(this.toString())},_applyModification:function($,ie){var q=$.apply(null,[this].concat([].slice.call(ie)));return this._r=q._r,this._g=q._g,this._b=q._b,this.setAlpha(q._a),this},lighten:function(){return this._applyModification(x,arguments)},brighten:function(){return this._applyModification(A,arguments)},darken:function(){return this._applyModification(S,arguments)},desaturate:function(){return this._applyModification(h,arguments)},saturate:function(){return this._applyModification(O,arguments)},greyscale:function(){return this._applyModification(w,arguments)},spin:function(){return this._applyModification(T,arguments)},_applyCombination:function($,ie){return $.apply(null,[this].concat([].slice.call(ie)))},analogous:function(){return this._applyCombination(m,arguments)},complement:function(){return this._applyCombination(E,arguments)},monochromatic:function(){return this._applyCombination(b,arguments)},splitcomplement:function(){return this._applyCombination(y,arguments)},triad:function(){return this._applyCombination(_,arguments)},tetrad:function(){return this._applyCombination(u,arguments)}},R.fromRatio=function($,ie){if(typeof $=="object"){var q={};for(var Ee in $)$.hasOwnProperty(Ee)&&(Ee==="a"?q[Ee]=$[Ee]:q[Ee]=ve($[Ee]));$=q}return R($,ie)};function g($){var ie={r:0,g:0,b:0},q=1,Ee=null,Ae=null,ye=null,we=!1,Re=!1;return typeof $=="string"&&($=ae($)),typeof $=="object"&&(pe($.r)&&pe($.g)&&pe($.b)?(ie=p($.r,$.g,$.b),we=!0,Re=String($.r).substr(-1)==="%"?"prgb":"rgb"):pe($.h)&&pe($.s)&&pe($.v)?(Ee=ve($.s),Ae=ve($.v),ie=c($.h,Ee,Ae),we=!0,Re="hsv"):pe($.h)&&pe($.s)&&pe($.l)&&(Ee=ve($.s),ye=ve($.l),ie=d($.h,Ee,ye),we=!0,Re="hsl"),$.hasOwnProperty("a")&&(q=$.a)),q=F(q),{ok:we,format:$.format||Re,r:W(255,B(ie.r,0)),g:W(255,B(ie.g,0)),b:W(255,B(ie.b,0)),a:q}}function p($,ie,q){return{r:L($,255)*255,g:L(ie,255)*255,b:L(q,255)*255}}function f($,ie,q){$=L($,255),ie=L(ie,255),q=L(q,255);var Ee=B($,ie,q),Ae=W($,ie,q),ye,we,Re=(Ee+Ae)/2;if(Ee==Ae)ye=we=0;else{var ke=Ee-Ae;we=Re>.5?ke/(2-Ee-Ae):ke/(Ee+Ae);switch(Ee){case $:ye=(ie-q)/ke+(ie1&&(Le-=1),Le<1/6?Ne+(Ie-Ne)*6*Le:Le<1/2?Ie:Le<2/3?Ne+(Ie-Ne)*(2/3-Le)*6:Ne}if(ie===0)Ee=Ae=ye=q;else{var Re=q<.5?q*(1+ie):q+ie-q*ie,ke=2*q-Re;Ee=we(ke,Re,$+1/3),Ae=we(ke,Re,$),ye=we(ke,Re,$-1/3)}return{r:Ee*255,g:Ae*255,b:ye*255}}function o($,ie,q){$=L($,255),ie=L(ie,255),q=L(q,255);var Ee=B($,ie,q),Ae=W($,ie,q),ye,we,Re=Ee,ke=Ee-Ae;if(we=Ee===0?0:ke/Ee,Ee==Ae)ye=0;else{switch(Ee){case $:ye=(ie-q)/ke+(ie>1)+720)%360;--ie;)Ee.h=(Ee.h+Ae)%360,ye.push(R(Ee));return ye}function b($,ie){ie=ie||6;for(var q=R($).toHsv(),Ee=q.h,Ae=q.s,ye=q.v,we=[],Re=1/ie;ie--;)we.push(R({h:Ee,s:Ae,v:ye})),ye=(ye+Re)%1;return we}R.mix=function($,ie,q){q=q===0?0:q||50;var Ee=R($).toRgb(),Ae=R(ie).toRgb(),ye=q/100,we={r:(Ae.r-Ee.r)*ye+Ee.r,g:(Ae.g-Ee.g)*ye+Ee.g,b:(Ae.b-Ee.b)*ye+Ee.b,a:(Ae.a-Ee.a)*ye+Ee.a};return R(we)},R.readability=function($,ie){var q=R($),Ee=R(ie);return(V.max(q.getLuminance(),Ee.getLuminance())+.05)/(V.min(q.getLuminance(),Ee.getLuminance())+.05)},R.isReadable=function($,ie,q){var Ee=R.readability($,ie),Ae,ye;ye=!1,Ae=he(q);switch(Ae.level+Ae.size){case"AAsmall":case"AAAlarge":ye=Ee>=4.5;break;case"AAlarge":ye=Ee>=3;break;case"AAAsmall":ye=Ee>=7;break}return ye},R.mostReadable=function($,ie,q){var Ee=null,Ae=0,ye,we,Re,ke;q=q||{},we=q.includeFallbackColors,Re=q.level,ke=q.size;for(var Ne=0;NeAe&&(Ae=ye,Ee=R(ie[Ne]));return R.isReadable($,Ee,{level:Re,size:ke})||!we?Ee:(q.includeFallbackColors=!1,R.mostReadable($,["#fff","#000"],q))};var P=R.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"},I=R.hexNames=U(P);function U($){var ie={};for(var q in $)$.hasOwnProperty(q)&&(ie[$[q]]=q);return ie}function F($){return $=parseFloat($),(isNaN($)||$<0||$>1)&&($=1),$}function L($,ie){K($)&&($="100%");var q=J($);return $=W(ie,B(0,parseFloat($))),q&&($=parseInt($*ie,10)/100),V.abs($-ie)<1e-6?1:$%ie/parseFloat(ie)}function v($){return W(1,B(0,$))}function j($){return parseInt($,16)}function K($){return typeof $=="string"&&$.indexOf(".")!=-1&&parseFloat($)===1}function J($){return typeof $=="string"&&$.indexOf("%")!=-1}function ee($){return $.length==1?"0"+$:""+$}function ve($){return $<=1&&($=$*100+"%"),$}function de($){return V.round(parseFloat($)*255).toString(16)}function me($){return j($)/255}var ce=function(){var $="[-\\+]?\\d+%?",ie="[-\\+]?\\d*\\.\\d+%?",q="(?:"+ie+")|(?:"+$+")",Ee="[\\s|\\(]+("+q+")[,|\\s]+("+q+")[,|\\s]+("+q+")\\s*\\)?",Ae="[\\s|\\(]+("+q+")[,|\\s]+("+q+")[,|\\s]+("+q+")[,|\\s]+("+q+")\\s*\\)?";return{CSS_UNIT:new RegExp(q),rgb:new RegExp("rgb"+Ee),rgba:new RegExp("rgba"+Ae),hsl:new RegExp("hsl"+Ee),hsla:new RegExp("hsla"+Ae),hsv:new RegExp("hsv"+Ee),hsva:new RegExp("hsva"+Ae),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 pe($){return!!ce.CSS_UNIT.exec($)}function ae($){$=$.replace(D,"").replace(z,"").toLowerCase();var ie=!1;if(P[$])$=P[$],ie=!0;else if($=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var q;return(q=ce.rgb.exec($))?{r:q[1],g:q[2],b:q[3]}:(q=ce.rgba.exec($))?{r:q[1],g:q[2],b:q[3],a:q[4]}:(q=ce.hsl.exec($))?{h:q[1],s:q[2],l:q[3]}:(q=ce.hsla.exec($))?{h:q[1],s:q[2],l:q[3],a:q[4]}:(q=ce.hsv.exec($))?{h:q[1],s:q[2],v:q[3]}:(q=ce.hsva.exec($))?{h:q[1],s:q[2],v:q[3],a:q[4]}:(q=ce.hex8.exec($))?{r:j(q[1]),g:j(q[2]),b:j(q[3]),a:me(q[4]),format:ie?"name":"hex8"}:(q=ce.hex6.exec($))?{r:j(q[1]),g:j(q[2]),b:j(q[3]),format:ie?"name":"hex"}:(q=ce.hex4.exec($))?{r:j(q[1]+""+q[1]),g:j(q[2]+""+q[2]),b:j(q[3]+""+q[3]),a:me(q[4]+""+q[4]),format:ie?"name":"hex8"}:(q=ce.hex3.exec($))?{r:j(q[1]+""+q[1]),g:j(q[2]+""+q[2]),b:j(q[3]+""+q[3]),format:ie?"name":"hex"}:!1}function he($){var ie,q;return $=$||{level:"AA",size:"small"},ie=($.level||"AA").toUpperCase(),q=($.size||"small").toLowerCase(),ie!=="AA"&&ie!=="AAA"&&(ie="AA"),q!=="small"&&q!=="large"&&(q="small"),{level:ie,size:q}}at.exports?at.exports=R:!(ne=function(){return R}.call(Ve,te,Ve,at),ne!==void 0&&(at.exports=ne))})(Math)},bT9E:function(at,Ve,te){"use strict";te.d(Ve,"a",function(){return V});var ne=te("VTBJ");function V(D,z){var N=Object(ne.a)({},D);return Array.isArray(z)&&z.forEach(function(M){delete N[M]}),N}},c5Ni:function(at,Ve,te){},dejd:function(at,Ve,te){},dmUQ:function(at,Ve,te){"use strict";var ne=te("Ff2n"),V=te("rePB"),D=te("1OyB"),z=te("vuIU"),N=te("Ji7U"),M=te("md7G"),W=te("foSv"),B=te("cDcd"),k=te.n(B),R=te("TSYQ"),g=te.n(R),p=te("4IlW");function f(_,u){var y=Object.keys(_);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(_);u&&(m=m.filter(function(b){return Object.getOwnPropertyDescriptor(_,b).enumerable})),y.push.apply(y,m)}return y}function d(_){for(var u=1;u1?J-1:0),ve=1;ve1?L-1:0),j=1;j=0)return parseInt(F.slice(F.indexOf("e-")+2),10);var L=0;return F.indexOf(".")>=0&&(L=F.length-F.indexOf(".")-1),L},b.getInputDisplayValue=function(U){var F=U||b.state,L=F.focused,v=F.inputValue,j=F.value,K;L?K=v:K=b.toPrecisionAsStep(j),K==null&&(K="");var J=b.formatWrapper(K);return x(b.props.decimalSeparator)&&(J=J.toString().replace(".",b.props.decimalSeparator)),J},b.recordCursorPosition=function(){try{b.cursorStart=b.input.selectionStart,b.cursorEnd=b.input.selectionEnd,b.currentValue=b.input.value,b.cursorBefore=b.input.value.substring(0,b.cursorStart),b.cursorAfter=b.input.value.substring(b.cursorEnd)}catch(U){}},b.restoreByAfter=function(U){if(U===void 0)return!1;var F=b.input.value,L=F.lastIndexOf(U);if(L===-1)return!1;var v=b.cursorBefore.length;return b.lastKeyCode===p.a.DELETE&&b.cursorBefore.charAt(v-1)===U[0]?(b.fixCaret(v,v),!0):L+U.length===F.length?(b.fixCaret(L,L),!0):!1},b.partRestoreByAfter=function(U){return U===void 0?!1:Array.prototype.some.call(U,function(F,L){var v=U.substring(L);return b.restoreByAfter(v)})},b.isNotCompleteNumber=function(U){return isNaN(U)||U===""||U===null||U&&U.toString().indexOf(".")===U.toString().length-1},b.stop=function(){b.autoStepTimer&&clearTimeout(b.autoStepTimer)},b.down=function(U,F,L){b.pressingUpOrDown=!0,b.step("down",U,F,L)},b.up=function(U,F,L){b.pressingUpOrDown=!0,b.step("up",U,F,L)},b.saveInput=function(U){b.input=U};var P=m.value;P===void 0&&(P=m.defaultValue),b.state={focused:m.autoFocus};var I=b.getValidValue(b.toNumber(P));return b.state=d(d({},b.state),{},{inputValue:b.toPrecisionAsStep(I),value:I}),b}return Object(z.a)(y,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(b){var P=this.props,I=P.value,U=P.onChange,F=P.max,L=P.min,v=this.state.focused;if(b){if(!A(b.value,I)||!A(b.max,F)||!A(b.min,L)){var j=v?I:this.getValidValue(I),K;this.pressingUpOrDown?K=j:this.inputting?K=this.rawInput:K=this.toPrecisionAsStep(j),this.setState({value:j,inputValue:K})}var J="value"in this.props?I:this.state.value;"max"in this.props&&b.max!==F&&typeof J=="number"&&J>F&&U&&U(F),"min"in this.props&&b.min!==L&&typeof J=="number"&&J1&&arguments[1]!==void 0?arguments[1]:this.props.min,I=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,U=parseFloat(b);return isNaN(U)?b:(UI&&(U=I),U)}},{key:"setValue",value:function(b,P){var I=this.props.precision,U=this.isNotCompleteNumber(parseFloat(b))?null:parseFloat(b),F=this.state.value,L=F===void 0?null:F,v=this.state.inputValue,j=v===void 0?null:v,K=typeof U=="number"?U.toFixed(I):"".concat(U),J=U!==L||K!=="".concat(j);return"value"in this.props?(j=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:j},P)):this.setState({value:U,inputValue:this.toPrecisionAsStep(b)},P),J&&this.props.onChange(U),U}},{key:"getMaxPrecision",value:function(b){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,I=this.props,U=I.precision,F=I.step;if(x(U))return U;var L=this.getPrecision(P),v=this.getPrecision(F),j=this.getPrecision(b);return b?Math.max(j,L+v):L+v}},{key:"getPrecisionFactor",value:function(b){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,I=this.getMaxPrecision(b,P);return Math.pow(10,I)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(b){return this.props.formatter?this.props.formatter(b):b}},{key:"toPrecisionAsStep",value:function(b){if(this.isNotCompleteNumber(b)||b==="")return b;var P=Math.abs(this.getMaxPrecision(b));return isNaN(P)?b.toString():Number(b).toFixed(P)}},{key:"toNumber",value:function(b){var P=this.props.precision,I=this.state.focused,U=b&&b.length>16&&I;return this.isNotCompleteNumber(b)||U?b:x(P)?Math.round(b*Math.pow(10,P))/Math.pow(10,P):Number(b)}},{key:"upStep",value:function(b,P){var I=this.props.step,U=this.getPrecisionFactor(b,P),F=Math.abs(this.getMaxPrecision(b,P)),L=((U*b+U*I*P)/U).toFixed(F);return this.toNumber(L)}},{key:"downStep",value:function(b,P){var I=this.props.step,U=this.getPrecisionFactor(b,P),F=Math.abs(this.getMaxPrecision(b,P)),L=((U*b-U*I*P)/U).toFixed(F);return this.toNumber(L)}},{key:"step",value:function(b,P){var I=this,U=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,F=arguments.length>3?arguments[3]:void 0;this.stop(),P&&(P.persist(),P.preventDefault());var L=this.props;if(L.disabled)return;var v=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(v))return;var j=this["".concat(b,"Step")](v,U),K=j>L.max||jL.max?j=L.max:j=ee),Pe=(Je||Je===0)&&(isNaN(Je)||Number(Je)<=ve),_e=xe||U||F,le=Pe||U||F,fe=g()("".concat(I,"-handler"),"".concat(I,"-handler-up"),Object(V.a)({},"".concat(I,"-handler-up-disabled"),_e)),Q=g()("".concat(I,"-handler"),"".concat(I,"-handler-down"),Object(V.a)({},"".concat(I,"-handler-down-disabled"),le)),Z=L?{onTouchStart:_e?s:this.up,onTouchEnd:this.stop}:{onMouseDown:_e?s:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},re=L?{onTouchStart:le?s:this.down,onTouchEnd:this.stop}:{onMouseDown:le?s:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return k.a.createElement("div",{className:He,style:de,title:me,onMouseEnter:ce,onMouseLeave:pe,onMouseOver:ae,onMouseOut:he,onFocus:function(){return null},onBlur:function(){return null}},k.a.createElement("div",{className:"".concat(I,"-handler-wrap")},k.a.createElement("span",Object.assign({unselectable:"on"},Z,{role:"button","aria-label":"Increase Value","aria-disabled":_e,className:fe}),j||k.a.createElement("span",{unselectable:"on",className:"".concat(I,"-handler-up-inner"),onClick:a})),k.a.createElement("span",Object.assign({unselectable:"on"},re,{role:"button","aria-label":"Decrease Value","aria-disabled":le,className:Q}),K||k.a.createElement("span",{unselectable:"on",className:"".concat(I,"-handler-down-inner"),onClick:a}))),k.a.createElement("div",{className:"".concat(I,"-input-wrap")},k.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":ve,"aria-valuemax":ee,"aria-valuenow":Je,required:$,type:Ee,placeholder:Ae,onPaste:Ye,onClick:ie,onMouseUp:this.onMouseUp,className:"".concat(I,"-input"),tabIndex:q,autoComplete:v,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:qe?this.onKeyDown:s,onKeyUp:qe?this.onKeyUp:s,autoFocus:Ie,maxLength:Ne,readOnly:F,disabled:U,max:ee,min:ve,step:ke,name:Le,title:me,id:ye,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(Ke),pattern:Re,inputMode:we,onInput:Qe},Se))))}}]),y}(k.a.Component);S.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:w,min:-w,step:1,style:{},onChange:s,onKeyDown:s,onPressEnter:s,onFocus:s,onBlur:s,parser:l,required:!1,autoComplete:"off"};var T=S,E=Ve.a=T},h78n:function(at,Ve,te){"use strict";te.d(Ve,"a",function(){return b});var ne=te("cDcd"),V=te.n(ne),D=te("TSYQ"),z=te.n(D),N={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},M=function(U){var F=U.map(function(){return Object(ne.useRef)()}),L=Object(ne.useRef)();return Object(ne.useEffect)(function(){var v=Date.now(),j=!1;Object.keys(F).forEach(function(K){var J=F[K].current;if(!J)return;j=!0;var ee=J.style;ee.transitionDuration=".3s, .3s, .3s, .06s",L.current&&v-L.current<100&&(ee.transitionDuration="0s, 0s")}),j&&(L.current=Date.now())}),[F]};function W(){return W=Object.assign||function(I){for(var U=1;UI.length)&&(U=I.length);for(var F=0,L=new Array(U);F=0)continue;if(!Object.prototype.propertyIsEnumerable.call(I,L))continue;F[L]=I[L]}}return F}function o(I,U){if(I==null)return{};var F={},L=Object.keys(I),v,j;for(j=0;j=0)continue;F[v]=I[v]}return F}var c=function(U){var F=U.className,L=U.percent,v=U.prefixCls,j=U.strokeColor,K=U.strokeLinecap,J=U.strokeWidth,ee=U.style,ve=U.trailColor,de=U.trailWidth,me=U.transition,ce=d(U,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete ce.gapPosition;var pe=Array.isArray(L)?L:[L],ae=Array.isArray(j)?j:[j],he=M(pe),$=B(he,1),ie=$[0],q=J/2,Ee=100-J/2,Ae="M ".concat(K==="round"?q:0,",").concat(q,` L `).concat(K==="round"?Ee:100,",").concat(q),ye="0 0 100 ".concat(J),we=0;return V.a.createElement("svg",W({className:z()("".concat(v,"-line"),F),viewBox:ye,preserveAspectRatio:"none",style:ee},ce),V.a.createElement("path",{className:"".concat(v,"-line-trail"),d:Ae,strokeLinecap:K,stroke:ve,strokeWidth:de||J,fillOpacity:"0"}),pe.map(function(Re,ke){var Ne={strokeDasharray:"".concat(Re,"px, 100px"),strokeDashoffset:"-".concat(we,"px"),transition:me||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},Ie=ae[ke]||ae[ae.length-1];return we+=Re,V.a.createElement("path",{key:ke,className:"".concat(v,"-line-path"),d:Ae,strokeLinecap:K,stroke:Ie,strokeWidth:J,fillOpacity:"0",ref:ie[ke],style:Ne})}))};c.defaultProps=N;var s=c;function a(){return a=Object.assign||function(I){for(var U=1;UI.length)&&(U=I.length);for(var F=0,L=new Array(U);F=0)continue;if(!Object.prototype.propertyIsEnumerable.call(I,L))continue;F[L]=I[L]}}return F}function T(I,U){if(I==null)return{};var F={},L=Object.keys(I),v,j;for(j=0;j=0)continue;F[v]=I[v]}return F}var E=0;function _(I){return+I.replace("%","")}function u(I){return Array.isArray(I)?I:[I]}function y(I,U,F,L){var v=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,j=arguments.length>5?arguments[5]:void 0,K=50-L/2,J=0,ee=-K,ve=0,de=-2*K;switch(j){case"left":J=-K,ee=0,ve=2*K,de=0;break;case"right":J=K,ee=0,ve=-2*K,de=0;break;case"bottom":ee=K,de=2*K;break;default:}var me="M 50,50 m ".concat(J,",").concat(ee,` a `).concat(K,",").concat(K," 0 1 1 ").concat(ve,",").concat(-de,` a `).concat(K,",").concat(K," 0 1 1 ").concat(-ve,",").concat(de),ce=Math.PI*2*K,pe={stroke:F,strokeDasharray:"".concat(U/100*(ce-v),"px ").concat(ce,"px"),strokeDashoffset:"-".concat(v/2+I/100*(ce-v),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:me,pathStyle:pe}}var m=function(U){var F=U.prefixCls,L=U.strokeWidth,v=U.trailWidth,j=U.gapDegree,K=U.gapPosition,J=U.trailColor,ee=U.strokeLinecap,ve=U.style,de=U.className,me=U.strokeColor,ce=U.percent,pe=S(U,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),ae=Object(ne.useMemo)(function(){return E+=1,E},[]),he=y(0,100,J,L,j,K),$=he.pathString,ie=he.pathStyle,q=u(ce),Ee=u(me),Ae=Ee.find(function(Ne){return Object.prototype.toString.call(Ne)==="[object Object]"}),ye=M(q),we=l(ye,1),Re=we[0],ke=function(){var Ie=0;return q.map(function(Le,Ye){var Qe=Ee[Ye]||Ee[Ee.length-1],Xe=Object.prototype.toString.call(Qe)==="[object Object]"?"url(#".concat(F,"-gradient-").concat(ae,")"):"",We=y(Ie,Le,Qe,L,j,K);return Ie+=Le,V.a.createElement("path",{key:Ye,className:"".concat(F,"-circle-path"),d:We.pathString,stroke:Xe,strokeLinecap:ee,strokeWidth:L,opacity:Le===0?0:1,fillOpacity:"0",style:We.pathStyle,ref:Re[Ye]})})};return V.a.createElement("svg",a({className:z()("".concat(F,"-circle"),de),viewBox:"0 0 100 100",style:ve},pe),Ae&&V.a.createElement("defs",null,V.a.createElement("linearGradient",{id:"".concat(F,"-gradient-").concat(ae),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(Ae).sort(function(Ne,Ie){return _(Ne)-_(Ie)}).map(function(Ne,Ie){return V.a.createElement("stop",{key:Ie,offset:Ne,stopColor:Ae[Ne]})}))),V.a.createElement("path",{className:"".concat(F,"-circle-trail"),d:$,stroke:J,strokeLinecap:ee,strokeWidth:v||L,fillOpacity:"0",style:ie}),ke().reverse())};m.defaultProps=N;var b=m,P={Line:s,Circle:b}},kSUc:function(at,Ve,te){},lZu9:function(at,Ve,te){(function(ne){ne(te("VrN/"),te("1eCo"),te("8EBN"))})(function(ne){"use strict";ne.defineMode("markdown",function(V,D){var z=ne.getMode(V,"text/html"),N=z.name=="null";function M(L){if(ne.findModeByName){var v=ne.findModeByName(L);v&&(L=v.mime||v.mimes[0])}var j=ne.getMode(V,L);return j.name=="null"?null:j}D.highlightFormatting===void 0&&(D.highlightFormatting=!1),D.maxBlockquoteDepth===void 0&&(D.maxBlockquoteDepth=0),D.taskLists===void 0&&(D.taskLists=!1),D.strikethrough===void 0&&(D.strikethrough=!1),D.emoji===void 0&&(D.emoji=!1),D.fencedCodeBlockHighlighting===void 0&&(D.fencedCodeBlockHighlighting=!0),D.fencedCodeBlockDefaultMode===void 0&&(D.fencedCodeBlockDefaultMode="text/plain"),D.xml===void 0&&(D.xml=!0),D.tokenTypeOverrides===void 0&&(D.tokenTypeOverrides={});var W={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var B in W)W.hasOwnProperty(B)&&D.tokenTypeOverrides[B]&&(W[B]=D.tokenTypeOverrides[B]);var k=/^([*\-_])(?:\s*\1){2,}\s*$/,R=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,g=/^\[(x| )\](?=\s)/i,p=D.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,f=/^ {0,3}(?:\={1,}|-{2,})\s*$/,d=/^[^#!\[\]*_\\<>` "'(~:]+/,o=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,c=/^\s*\[[^\]]+?\]:.*$/,s=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,a=" ";function l(L,v,j){return v.f=v.inline=j,j(L,v)}function h(L,v,j){return v.f=v.block=j,j(L,v)}function O(L){return!L||!/\S/.test(L.string)}function w(L){if(L.linkTitle=!1,L.linkHref=!1,L.linkText=!1,L.em=!1,L.strong=!1,L.strikethrough=!1,L.quote=0,L.indentedCode=!1,L.f==A){var v=N;if(!v){var j=ne.innerMode(z,L.htmlState);v=j.mode.name=="xml"&&j.state.tagStart===null&&!j.state.context&&j.state.tokenize.isInText}v&&(L.f=_,L.block=x,L.htmlState=null)}return L.trailingSpace=0,L.trailingSpaceNewLine=!1,L.prevLine=L.thisLine,L.thisLine={stream:null},null}function x(L,v){var j=L.column()===v.indentation,K=O(v.prevLine.stream),J=v.indentedCode,ee=v.prevLine.hr,ve=v.list!==!1,de=(v.listStack[v.listStack.length-1]||0)+3;v.indentedCode=!1;var me=v.indentation;if(v.indentationDiff===null&&(v.indentationDiff=v.indentation,ve)){for(v.list=null;me=4&&(J||v.prevLine.fencedCodeEnd||v.prevLine.header||K))return L.skipToEnd(),v.indentedCode=!0,W.code;if(L.eatSpace())return null;if(j&&v.indentation<=de&&(ae=L.match(p))&&ae[1].length<=6)return v.quote=0,v.header=ae[1].length,v.thisLine.header=!0,D.highlightFormatting&&(v.formatting="header"),v.f=v.inline,T(v);if(v.indentation<=de&&L.eat(">"))return v.quote=j?1:v.quote+1,D.highlightFormatting&&(v.formatting="quote"),L.eatSpace(),T(v);if(!pe&&!v.setext&&j&&v.indentation<=de&&(ae=L.match(R))){var he=ae[1]?"ol":"ul";return v.indentation=me+L.current().length,v.list=!0,v.quote=0,v.listStack.push(v.indentation),v.em=!1,v.strong=!1,v.code=!1,v.strikethrough=!1,D.taskLists&&L.match(g,!1)&&(v.taskList=!0),v.f=v.inline,D.highlightFormatting&&(v.formatting=["list","list-"+he]),T(v)}else{if(j&&v.indentation<=de&&(ae=L.match(o,!0)))return v.quote=0,v.fencedEndRE=new RegExp(ae[1]+"+ *$"),v.localMode=D.fencedCodeBlockHighlighting&&M(ae[2]||D.fencedCodeBlockDefaultMode),v.localMode&&(v.localState=ne.startState(v.localMode)),v.f=v.block=S,D.highlightFormatting&&(v.formatting="code-block"),v.code=-1,T(v);if(v.setext||(!ce||!ve)&&!v.quote&&v.list===!1&&!v.code&&!pe&&!c.test(L.string)&&(ae=L.lookAhead(1))&&(ae=ae.match(f)))return v.setext?(v.header=v.setext,v.setext=0,L.skipToEnd(),D.highlightFormatting&&(v.formatting="header")):(v.header=ae[0].charAt(0)=="="?1:2,v.setext=v.header),v.thisLine.header=!0,v.f=v.inline,T(v);if(pe)return L.skipToEnd(),v.hr=!0,v.thisLine.hr=!0,W.hr;if(L.peek()==="[")return l(L,v,P)}return l(L,v,v.inline)}function A(L,v){var j=z.token(L,v.htmlState);if(!N){var K=ne.innerMode(z,v.htmlState);(K.mode.name=="xml"&&K.state.tagStart===null&&!K.state.context&&K.state.tokenize.isInText||v.md_inside&&L.current().indexOf(">")>-1)&&(v.f=_,v.block=x,v.htmlState=null)}return j}function S(L,v){var j=v.listStack[v.listStack.length-1]||0,K=v.indentation=L.quote?v.push(W.formatting+"-"+L.formatting[j]+"-"+L.quote):v.push("error"))}if(L.taskOpen)return v.push("meta"),v.length?v.join(" "):null;if(L.taskClosed)return v.push("property"),v.length?v.join(" "):null;if(L.linkHref?v.push(W.linkHref,"url"):(L.strong&&v.push(W.strong),L.em&&v.push(W.em),L.strikethrough&&v.push(W.strikethrough),L.emoji&&v.push(W.emoji),L.linkText&&v.push(W.linkText),L.code&&v.push(W.code),L.image&&v.push(W.image),L.imageAltText&&v.push(W.imageAltText,"link"),L.imageMarker&&v.push(W.imageMarker)),L.header&&v.push(W.header,W.header+"-"+L.header),L.quote&&(v.push(W.quote),!D.maxBlockquoteDepth||D.maxBlockquoteDepth>=L.quote?v.push(W.quote+"-"+L.quote):v.push(W.quote+"-"+D.maxBlockquoteDepth)),L.list!==!1){var K=(L.listStack.length-1)%3;K?K===1?v.push(W.list2):v.push(W.list3):v.push(W.list1)}return L.trailingSpaceNewLine?v.push("trailing-space-new-line"):L.trailingSpace&&v.push("trailing-space-"+(L.trailingSpace%2?"a":"b")),v.length?v.join(" "):null}function E(L,v){return L.match(d,!0)?T(v):void 0}function _(L,v){var j=v.text(L,v);if(typeof j!="undefined")return j;if(v.list)return v.list=null,T(v);if(v.taskList){var K=L.match(g,!0)[1]===" ";return K?v.taskOpen=!0:v.taskClosed=!0,D.highlightFormatting&&(v.formatting="task"),v.taskList=!1,T(v)}if(v.taskOpen=!1,v.taskClosed=!1,v.header&&L.match(/^#+$/,!0))return D.highlightFormatting&&(v.formatting="header"),T(v);var J=L.next();if(v.linkTitle){v.linkTitle=!1;var ee=J;J==="("&&(ee=")"),ee=(ee+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var ve="^\\s*(?:[^"+ee+"\\\\]+|\\\\\\\\|\\\\.)"+ee;if(L.match(new RegExp(ve),!0))return W.linkHref}if(J==="`"){var de=v.formatting;D.highlightFormatting&&(v.formatting="code"),L.eatWhile("`");var me=L.current().length;if(v.code==0&&(!v.quote||me==1))return v.code=me,T(v);if(me==v.code){var ce=T(v);return v.code=0,ce}else return v.formatting=de,T(v)}else if(v.code)return T(v);if(J==="\\"&&(L.next(),D.highlightFormatting)){var pe=T(v),ae=W.formatting+"-escape";return pe?pe+" "+ae:ae}if(J==="!"&&L.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return v.imageMarker=!0,v.image=!0,D.highlightFormatting&&(v.formatting="image"),T(v);if(J==="["&&v.imageMarker&&L.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return v.imageMarker=!1,v.imageAltText=!0,D.highlightFormatting&&(v.formatting="image"),T(v);if(J==="]"&&v.imageAltText){D.highlightFormatting&&(v.formatting="image");var pe=T(v);return v.imageAltText=!1,v.image=!1,v.inline=v.f=y,pe}if(J==="["&&!v.image)return v.linkText&&L.match(/^.*?\]/)||(v.linkText=!0,D.highlightFormatting&&(v.formatting="link")),T(v);if(J==="]"&&v.linkText){D.highlightFormatting&&(v.formatting="link");var pe=T(v);return v.linkText=!1,v.inline=v.f=L.match(/\(.*?\)| ?\[.*?\]/,!1)?y:_,pe}if(J==="<"&&L.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){v.f=v.inline=u,D.highlightFormatting&&(v.formatting="link");var pe=T(v);return pe?pe+=" ":pe="",pe+W.linkInline}if(J==="<"&&L.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){v.f=v.inline=u,D.highlightFormatting&&(v.formatting="link");var pe=T(v);return pe?pe+=" ":pe="",pe+W.linkEmail}if(D.xml&&J==="<"&&L.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var he=L.string.indexOf(">",L.pos);if(he!=-1){var $=L.string.substring(L.start,he);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test($)&&(v.md_inside=!0)}return L.backUp(1),v.htmlState=ne.startState(z),h(L,v,A)}if(D.xml&&J==="<"&&L.match(/^\/\w*?>/))return v.md_inside=!1,"tag";if(J==="*"||J==="_"){for(var ie=1,q=L.pos==1?" ":L.string.charAt(L.pos-2);ie<3&&L.eat(J);)ie++;var Ee=L.peek()||" ",Ae=!/\s/.test(Ee)&&(!s.test(Ee)||/\s/.test(q)||s.test(q)),ye=!/\s/.test(q)&&(!s.test(q)||/\s/.test(Ee)||s.test(Ee)),we=null,Re=null;if(ie%2&&(!v.em&&Ae&&(J==="*"||!ye||s.test(q))?we=!0:v.em==J&&ye&&(J==="*"||!Ae||s.test(Ee))&&(we=!1)),ie>1&&(!v.strong&&Ae&&(J==="*"||!ye||s.test(q))?Re=!0:v.strong==J&&ye&&(J==="*"||!Ae||s.test(Ee))&&(Re=!1)),Re!=null||we!=null){D.highlightFormatting&&(v.formatting=we==null?"strong":Re==null?"em":"strong em"),we===!0&&(v.em=J),Re===!0&&(v.strong=J);var ce=T(v);return we===!1&&(v.em=!1),Re===!1&&(v.strong=!1),ce}}else if(J===" "&&(L.eat("*")||L.eat("_"))){if(L.peek()===" ")return T(v);L.backUp(1)}if(D.strikethrough){if(J==="~"&&L.eatWhile(J)){if(v.strikethrough){D.highlightFormatting&&(v.formatting="strikethrough");var ce=T(v);return v.strikethrough=!1,ce}else if(L.match(/^[^\s]/,!1))return v.strikethrough=!0,D.highlightFormatting&&(v.formatting="strikethrough"),T(v)}else if(J===" "&&L.match(/^~~/,!0)){if(L.peek()===" ")return T(v);L.backUp(2)}}if(D.emoji&&J===":"&&L.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){v.emoji=!0,D.highlightFormatting&&(v.formatting="emoji");var ke=T(v);return v.emoji=!1,ke}return J===" "&&(L.match(/^ +$/,!1)?v.trailingSpace++:v.trailingSpace&&(v.trailingSpaceNewLine=!0)),T(v)}function u(L,v){var j=L.next();if(j===">"){v.f=v.inline=_,D.highlightFormatting&&(v.formatting="link");var K=T(v);return K?K+=" ":K="",K+W.linkInline}return L.match(/^[^>]+/,!0),W.linkInline}function y(L,v){if(L.eatSpace())return null;var j=L.next();return j==="("||j==="["?(v.f=v.inline=b(j==="("?")":"]"),D.highlightFormatting&&(v.formatting="link-string"),v.linkHref=!0,T(v)):"error"}var m={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function b(L){return function(v,j){var K=v.next();if(K===L){j.f=j.inline=_,D.highlightFormatting&&(j.formatting="link-string");var J=T(j);return j.linkHref=!1,J}return v.match(m[L]),j.linkHref=!0,T(j)}}function P(L,v){return L.match(/^([^\]\\]|\\.)*\]:/,!1)?(v.f=I,L.next(),D.highlightFormatting&&(v.formatting="link"),v.linkText=!0,T(v)):l(L,v,_)}function I(L,v){if(L.match(/^\]:/,!0)){v.f=v.inline=U,D.highlightFormatting&&(v.formatting="link");var j=T(v);return v.linkText=!1,j}return L.match(/^([^\]\\]|\\.)+/,!0),W.linkText}function U(L,v){return L.eatSpace()?null:(L.match(/^[^\s]+/,!0),L.peek()===void 0?v.linkTitle=!0:L.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),v.f=v.inline=_,W.linkHref+" url")}var F={startState:function(){return{f:x,prevLine:{stream:null},thisLine:{stream:null},block:x,htmlState:null,indentation:0,inline:_,text:E,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(L){return{f:L.f,prevLine:L.prevLine,thisLine:L.thisLine,block:L.block,htmlState:L.htmlState&&ne.copyState(z,L.htmlState),indentation:L.indentation,localMode:L.localMode,localState:L.localMode?ne.copyState(L.localMode,L.localState):null,inline:L.inline,text:L.text,formatting:!1,linkText:L.linkText,linkTitle:L.linkTitle,linkHref:L.linkHref,code:L.code,em:L.em,strong:L.strong,strikethrough:L.strikethrough,emoji:L.emoji,header:L.header,setext:L.setext,hr:L.hr,taskList:L.taskList,list:L.list,listStack:L.listStack.slice(0),quote:L.quote,indentedCode:L.indentedCode,trailingSpace:L.trailingSpace,trailingSpaceNewLine:L.trailingSpaceNewLine,md_inside:L.md_inside,fencedEndRE:L.fencedEndRE}},token:function(L,v){if(v.formatting=!1,L!=v.thisLine.stream){if(v.header=0,v.hr=!1,L.match(/^\s*$/,!0))return w(v),null;if(v.prevLine=v.thisLine,v.thisLine={stream:L},v.taskList=!1,v.trailingSpace=0,v.trailingSpaceNewLine=!1,!v.localState&&(v.f=v.block,v.f!=A)){var j=L.match(/^\s*/,!0)[0].replace(/\t/g,a).length;if(v.indentation=j,v.indentationDiff=null,j>0)return null}}return v.f(L,v)},innerMode:function(L){return L.block==A?{state:L.htmlState,mode:z}:L.localState?{state:L.localState,mode:L.localMode}:{state:L,mode:F}},indent:function(L,v,j){return L.block==A&&z.indent?z.indent(L.htmlState,v,j):L.localState&&L.localMode.indent?L.localMode.indent(L.localState,v,j):ne.Pass},blankLine:w,getType:T,blockCommentStart:"",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return F},"xml"),ne.defineMIME("text/markdown","markdown"),ne.defineMIME("text/x-markdown","markdown")})},osHv:function(at,Ve,te){(function(ne){ne(te("VrN/"))})(function(ne){"use strict";var V=ne.Pos;function D(s,a){return s.line-a.line||s.ch-a.ch}var z="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",N=z+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",M=new RegExp("<(/?)(["+z+"]["+N+"]*)","g");function W(s,a,l,h){this.line=a,this.ch=l,this.cm=s,this.text=s.getLine(a),this.min=h?Math.max(h.from,s.firstLine()):s.firstLine(),this.max=h?Math.min(h.to-1,s.lastLine()):s.lastLine()}function B(s,a){var l=s.cm.getTokenTypeAt(V(s.line,a));return l&&/\btag\b/.test(l)}function k(s){return s.line>=s.max?void 0:(s.ch=0,s.text=s.cm.getLine(++s.line),!0)}function R(s){return s.line<=s.min?void 0:(s.text=s.cm.getLine(--s.line),s.ch=s.text.length,!0)}function g(s){for(;;){var a=s.text.indexOf(">",s.ch);if(a==-1){if(k(s))continue;return}if(!B(s,a+1)){s.ch=a+1;continue}var l=s.text.lastIndexOf("/",a),h=l>-1&&!/\S/.test(s.text.slice(l+1,a));return s.ch=a+1,h?"selfClose":"regular"}}function p(s){for(;;){var a=s.ch?s.text.lastIndexOf("<",s.ch-1):-1;if(a==-1){if(R(s))continue;return}if(!B(s,a+1)){s.ch=a;continue}M.lastIndex=a,s.ch=a;var l=M.exec(s.text);if(l&&l.index==a)return l}}function f(s){for(;;){M.lastIndex=s.ch;var a=M.exec(s.text);if(!a){if(k(s))continue;return}if(!B(s,a.index+1)){s.ch=a.index+1;continue}return s.ch=a.index+a[0].length,a}}function d(s){for(;;){var a=s.ch?s.text.lastIndexOf(">",s.ch-1):-1;if(a==-1){if(R(s))continue;return}if(!B(s,a+1)){s.ch=a;continue}var l=s.text.lastIndexOf("/",a),h=l>-1&&!/\S/.test(s.text.slice(l+1,a));return s.ch=a+1,h?"selfClose":"regular"}}function o(s,a){for(var l=[];;){var h=f(s),O,w=s.line,x=s.ch-(h?h[0].length:0);if(!h||!(O=g(s)))return;if(O=="selfClose")continue;if(h[1]){for(var A=l.length-1;A>=0;--A)if(l[A]==h[2]){l.length=A;break}if(A<0&&(!a||a==h[2]))return{tag:h[2],from:V(w,x),to:V(s.line,s.ch)}}else l.push(h[2])}}function c(s,a){for(var l=[];;){var h=d(s);if(!h)return;if(h=="selfClose"){p(s);continue}var O=s.line,w=s.ch,x=p(s);if(!x)return;if(x[1])l.push(x[2]);else{for(var A=l.length-1;A>=0;--A)if(l[A]==x[2]){l.length=A;break}if(A<0&&(!a||a==x[2]))return{tag:x[2],from:V(s.line,s.ch),to:V(O,w)}}}}ne.registerHelper("fold","xml",function(s,a){for(var l=new W(s,a.line,0);;){var h=f(l);if(!h||l.line!=a.line)return;var O=g(l);if(!O)return;if(!h[1]&&O!="selfClose"){var w=V(l.line,l.ch),x=o(l,h[2]);return x&&D(x.from,w)>0?{from:w,to:x.from}:null}}}),ne.findMatchingTag=function(s,a,l){var h=new W(s,a.line,a.ch,l);if(h.text.indexOf(">")==-1&&h.text.indexOf("<")==-1)return;var O=g(h),w=O&&V(h.line,h.ch),x=O&&p(h);if(!O||!x||D(h,a)>0)return;var A={from:V(h.line,h.ch),to:w,tag:x[2]};return O=="selfClose"?{open:A,close:null,at:"open"}:x[1]?{open:c(h,x[2]),close:A,at:"close"}:(h=new W(s,w.line,w.ch,l),{open:A,close:o(h,x[2]),at:"open"})},ne.findEnclosingTag=function(s,a,l,h){for(var O=new W(s,a.line,a.ch,l);;){var w=c(O,h);if(!w)break;var x=new W(s,a.line,a.ch,l),A=o(x,w.tag);if(A)return{open:w,close:A}}},ne.scanForClosingTag=function(s,a,l,h){var O=new W(s,a.line,a.ch,h?{from:0,to:h}:null);return o(O,l)}})},p5ED:function(at,Ve,te){"use strict";var ne=te("+L6B"),V=te("2/Rp"),D=te("5Dmo"),z=te("3S7+"),N=te("k1fw"),M=te("tJVT"),W=te("cDcd"),B=te.n(W),k=te("vHTk"),R=te.n(k),g=te("yEEn"),p=te("ZW9T"),f=te("1vsH");Ve.a=function(d){var o=d.name,c=d.data,s=d.theme,a=d.type,l=d.filename,h=d.monacoEditor,O=d.className,w=d.style,x=d.close,A=d.onClose,S=d.hasMask,T=Object(W.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),E=Object(M.a)(T,2),_=E[0],u=E[1],y=Object(W.useState)(""),m=Object(M.a)(y,2),b=m[0],P=m[1],I,U=1024*1024,F=10*U,L=Object(W.useRef)();a==="office"&&(I=Object(f.V)(c).filesize,I>F&&(a="other")),l&&(h.filename=l),Object(W.useEffect)(function(){var K,J,ee=(K=document.cookie)===null||K===void 0||((J=K.replace(/\s/g,""))===null||J===void 0)?void 0:J.split(";");ee==null||ee.map(function(ve){var de=ve.split("=");de[0]==="_educoder_session"&&P(de[1])})},[]);var v=function(){if(c.startsWith("http")||c.startsWith("/")){j();return}Object(f.z)(l||"educoder",c,l)},j=function(){Object(f.x)(l||o,c)};return console.log("data:",c,"fileanme:",l," name:",o),B.a.createElement("div",{style:Object(N.a)({},w||{}),className:"".concat(S&&R.a.bgBlack," ").concat(a?R.a.wrp:"hide")},x&&B.a.createElement("div",{className:R.a.close,ref:L},B.a.createElement(z.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return L.current}},B.a.createElement("span",{onClick:j},B.a.createElement("i",{className:"icon-quxiaozhiding"}))),B.a.createElement(z.a,{title:"\u5173\u95ED",getPopupContainer:function(){return L.current}},B.a.createElement("span",{className:"",onClick:A},B.a.createElement("i",{className:"icon-guanbi1"})))),B.a.createElement("div",{className:"".concat(R.a[O]," ").concat(O," ").concat(R.a.monaco," ").concat(a==="txt"?"show":"hide")},a==="txt"&&B.a.createElement(p.b,h)),a==="audio"&&B.a.createElement("audio",{src:"".concat(c!=null&&c.startsWith("/")||(c==null?void 0:c.indexOf("https://"))>-1?c:"data:audio/mp3;base64,").concat(c),autoPlay:!0}),a==="video"&&B.a.createElement(B.a.Fragment,null,c!=null&&c.startsWith("/")?B.a.createElement("video",{controls:!0,src:"".concat(c),autoPlay:!0}):B.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(c),autoPlay:!0})),a==="html"&&B.a.createElement("iframe",{src:c+"&disposition=inline"}),a==="pdf"&&B.a.createElement("embed",{className:R.a.embed,src:c}),a==="image"&&B.a.createElement(B.a.Fragment,null,B.a.createElement("img",{src:"".concat(c!=null&&c.startsWith("/")||(c==null?void 0:c.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(c)})),a==="other"&&B.a.createElement("div",null,B.a.createElement(V.a,{type:"primary",size:"large",onClick:v},B.a.createElement(g.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),(a==="download"||a==="office")&&B.a.createElement(V.a,{type:"primary",size:"large",onClick:v},B.a.createElement(g.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(at,Ve,te){},psGv:function(at,Ve,te){var ne,V;(function(){var D;(function(){"use strict";var W=[,,function(g){function p(o){this.__parent=o,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}p.prototype.clone_empty=function(){var o=new p(this.__parent);return o.set_indent(this.__indent_count,this.__alignment_count),o},p.prototype.item=function(o){return o<0?this.__items[this.__items.length+o]:this.__items[o]},p.prototype.has_match=function(o){for(var c=this.__items.length-1;c>=0;c--)if(this.__items[c].match(o))return!0;return!1},p.prototype.set_indent=function(o,c){this.is_empty()&&(this.__indent_count=o||0,this.__alignment_count=c||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},p.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},p.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},p.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var o=this.__parent.current_line;return o.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),o.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),o.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,o.__items[0]===" "&&(o.__items.splice(0,1),o.__character_count-=1),!0}return!1},p.prototype.is_empty=function(){return this.__items.length===0},p.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},p.prototype.push=function(o){this.__items.push(o);var c=o.lastIndexOf(` `);c!==-1?this.__character_count=o.length-c:this.__character_count+=o.length},p.prototype.pop=function(){var o=null;return this.is_empty()||(o=this.__items.pop(),this.__character_count-=o.length),o},p.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},p.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},p.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},p.prototype.toString=function(){var o="";return this.is_empty()?this.__parent.indent_empty_lines&&(o=this.__parent.get_indent_string(this.__indent_count)):(o=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),o+=this.__items.join("")),o};function f(o,c){this.__cache=[""],this.__indent_size=o.indent_size,this.__indent_string=o.indent_char,o.indent_with_tabs||(this.__indent_string=new Array(o.indent_size+1).join(o.indent_char)),c=c||"",o.indent_level>0&&(c=new Array(o.indent_level+1).join(this.__indent_string)),this.__base_string=c,this.__base_string_length=c.length}f.prototype.get_indent_size=function(o,c){var s=this.__base_string_length;return c=c||0,o<0&&(s=0),s+=o*this.__indent_size,s+=c,s},f.prototype.get_indent_string=function(o,c){var s=this.__base_string;return c=c||0,o<0&&(o=0,s=""),c+=o*this.__indent_size,this.__ensure_cache(c),s+=this.__cache[c],s},f.prototype.__ensure_cache=function(o){for(;o>=this.__cache.length;)this.__add_column()},f.prototype.__add_column=function(){var o=this.__cache.length,c=0,s="";this.__indent_size&&o>=this.__indent_size&&(c=Math.floor(o/this.__indent_size),o-=c*this.__indent_size,s=new Array(c+1).join(this.__indent_string)),o&&(s+=new Array(o+1).join(" ")),this.__cache.push(s)};function d(o,c){this.__indent_cache=new f(o,c),this.raw=!1,this._end_with_newline=o.end_with_newline,this.indent_size=o.indent_size,this.wrap_line_length=o.wrap_line_length,this.indent_empty_lines=o.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new p(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}d.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},d.prototype.get_line_number=function(){return this.__lines.length},d.prototype.get_indent_string=function(o,c){return this.__indent_cache.get_indent_string(o,c)},d.prototype.get_indent_size=function(o,c){return this.__indent_cache.get_indent_size(o,c)},d.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},d.prototype.add_new_line=function(o){return this.is_empty()||!o&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},d.prototype.get_code=function(o){this.trim(!0);var c=this.current_line.pop();c&&(c[c.length-1]===` `&&(c=c.replace(/\n+$/g,"")),this.current_line.push(c)),this._end_with_newline&&this.__add_outputline();var s=this.__lines.join(` `);return o!==` `&&(s=s.replace(/[\n]/g,o)),s},d.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},d.prototype.set_indent=function(o,c){return o=o||0,c=c||0,this.next_line.set_indent(o,c),this.__lines.length>1?(this.current_line.set_indent(o,c),!0):(this.current_line.set_indent(),!1)},d.prototype.add_raw_token=function(o){for(var c=0;c1&&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},d.prototype.just_added_newline=function(){return this.current_line.is_empty()},d.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},d.prototype.ensure_empty_line_above=function(o,c){for(var s=this.__lines.length-2;s>=0;){var a=this.__lines[s];if(a.is_empty())break;if(a.item(0).indexOf(o)!==0&&a.item(-1)!==c){this.__lines.splice(s+1,0,new p(this)),this.previous_line=this.__lines[this.__lines.length-2];break}s--}},g.exports.Output=d},function(g){function p(f,d,o,c){this.type=f,this.text=d,this.comments_before=null,this.newlines=o||0,this.whitespace_before=c||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}g.exports.Token=p},,,function(g){function p(o,c){this.raw_options=f(o,c),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}p.prototype._get_array=function(o,c){var s=this.raw_options[o],a=c||[];return typeof s=="object"?s!==null&&typeof s.concat=="function"&&(a=s.concat()):typeof s=="string"&&(a=s.split(/[^a-zA-Z0-9_\/\-]+/)),a},p.prototype._get_boolean=function(o,c){var s=this.raw_options[o],a=s===void 0?!!c:!!s;return a},p.prototype._get_characters=function(o,c){var s=this.raw_options[o],a=c||"";return typeof s=="string"&&(a=s.replace(/\\r/,"\r").replace(/\\n/,` `).replace(/\\t/," ")),a},p.prototype._get_number=function(o,c){var s=this.raw_options[o];c=parseInt(c,10),isNaN(c)&&(c=0);var a=parseInt(s,10);return isNaN(a)&&(a=c),a},p.prototype._get_selection=function(o,c,s){var a=this._get_selection_list(o,c,s);if(a.length!==1)throw new Error("Invalid Option Value: The option '"+o+`' can only be one of the following values: `+c+` You passed in: '`+this.raw_options[o]+"'");return a[0]},p.prototype._get_selection_list=function(o,c,s){if(!c||c.length===0)throw new Error("Selection list cannot be empty.");if(s=s||[c[0]],!this._is_valid_selection(s,c))throw new Error("Invalid Default Value!");var a=this._get_array(o,s);if(!this._is_valid_selection(a,c))throw new Error("Invalid Option Value: The option '"+o+`' can contain only the following values: `+c+` You passed in: '`+this.raw_options[o]+"'");return a},p.prototype._is_valid_selection=function(o,c){return o.length&&c.length&&!o.some(function(s){return c.indexOf(s)===-1})};function f(o,c){var s={};o=d(o);var a;for(a in o)a!==c&&(s[a]=o[a]);if(c&&o[c])for(a in o[c])s[a]=o[c][a];return s}function d(o){var c={},s;for(s in o){var a=s.replace(/-/g,"_");c[a]=o[s]}return c}g.exports.Options=p,g.exports.normalizeOpts=d,g.exports.mergeOpts=f},,function(g){var p=RegExp.prototype.hasOwnProperty("sticky");function f(d){this.__input=d||"",this.__input_length=this.__input.length,this.__position=0}f.prototype.restart=function(){this.__position=0},f.prototype.back=function(){this.__position>0&&(this.__position-=1)},f.prototype.hasNext=function(){return this.__position=0&&d=0&&o=d.length&&this.__input.substring(o-d.length,o).toLowerCase()===d},g.exports.InputScanner=f},function(g,p,f){var d=f(8).InputScanner,o=f(3).Token,c=f(10).TokenStream,s=f(11).WhitespacePattern,a={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},l=function(h,O){this._input=new d(h),this._options=O||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new s(this._input)};l.prototype.tokenize=function(){this._input.restart(),this.__tokens=new c,this._reset();for(var h,O=new o(a.START,""),w=null,x=[],A=new c;O.type!==a.EOF;){for(h=this._get_next_token(O,w);this._is_comment(h);)A.add(h),h=this._get_next_token(O,w);A.isEmpty()||(h.comments_before=A,A=new c),h.parent=w,this._is_opening(h)?(x.push(w),w=h):w&&this._is_closing(h,w)&&(h.opened=w,w.closed=h,w=x.pop(),h.parent=w),h.previous=O,O.next=h,this.__tokens.add(h),O=h}return this.__tokens},l.prototype._is_first_token=function(){return this.__tokens.isEmpty()},l.prototype._reset=function(){},l.prototype._get_next_token=function(h,O){this._readWhitespace();var w=this._input.read(/.+/g);return w?this._create_token(a.RAW,w):this._create_token(a.EOF,"")},l.prototype._is_comment=function(h){return!1},l.prototype._is_opening=function(h){return!1},l.prototype._is_closing=function(h,O){return!1},l.prototype._create_token=function(h,O){var w=new o(h,O,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return w},l.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},g.exports.Tokenizer=l,g.exports.TOKEN=a},function(g){function p(f){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=f}p.prototype.restart=function(){this.__position=0},p.prototype.isEmpty=function(){return this.__tokens_length===0},p.prototype.hasNext=function(){return this.__position=0&&f/),erb:l.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:l.starting_with(/{%/).until_after(/%}/),django_value:l.starting_with(/{{/).until_after(/}}/),django_comment:l.starting_with(/{#/).until_after(/#}/),smarty:l.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:l.starting_with(/{\*/).until_after(/\*}/),smarty_literal:l.starting_with(/{literal}/).until_after(/{\/literal}/)}}c.prototype=new d,c.prototype._create=function(){return new c(this._input,this)},c.prototype._update=function(){this.__set_templated_pattern()},c.prototype.disable=function(s){var a=this._create();return a._disabled[s]=!0,a._update(),a},c.prototype.read_options=function(s){var a=this._create();for(var l in o)a._disabled[l]=s.templating.indexOf(l)===-1;return a._update(),a},c.prototype.exclude=function(s){var a=this._create();return a._excluded[s]=!0,a._update(),a},c.prototype.read=function(){var s="";this._match_pattern?s=this._input.read(this._starting_pattern):s=this._input.read(this._starting_pattern,this.__template_pattern);for(var a=this._read_template();a;)this._match_pattern?a+=this._input.read(this._match_pattern):a+=this._input.readUntil(this.__template_pattern),s+=a,a=this._read_template();return this._until_after&&(s+=this._input.readUntilAfter(this._until_pattern)),s},c.prototype.__set_templated_pattern=function(){var s=[];this._disabled.php||s.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||s.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||s.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(s.push(this.__patterns.django._starting_pattern.source),s.push(this.__patterns.django_value._starting_pattern.source),s.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||s.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&s.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+s.join("|")+")")},c.prototype._read_template=function(){var s="",a=this._input.peek();if(a==="<"){var l=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&l==="?"&&(s=s||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&l==="%"&&(s=s||this.__patterns.erb.read())}else a==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(s=s||this.__patterns.handlebars_comment.read(),s=s||this.__patterns.handlebars_unescaped.read(),s=s||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(s=s||this.__patterns.django_value.read()),this._excluded.django||(s=s||this.__patterns.django_comment.read(),s=s||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(s=s||this.__patterns.smarty_comment.read(),s=s||this.__patterns.smarty_literal.read(),s=s||this.__patterns.smarty.read()));return s},g.exports.TemplatablePattern=c},,,,function(g,p,f){var d=f(19).Beautifier,o=f(20).Options;function c(s,a,l,h){var O=new d(s,a,l,h);return O.beautify()}g.exports=c,g.exports.defaultOptions=function(){return new o}},function(g,p,f){var d=f(20).Options,o=f(2).Output,c=f(21).Tokenizer,s=f(21).TOKEN,a=/\r\n|[\r\n]/,l=/\r\n|[\r\n]/g,h=function(y,m){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=y.max_preserve_newlines,this.preserve_newlines=y.preserve_newlines,this._output=new o(y,m)};h.prototype.current_line_has_match=function(y){return this._output.current_line.has_match(y)},h.prototype.set_space_before_token=function(y,m){this._output.space_before_token=y,this._output.non_breaking_space=m},h.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},h.prototype.add_raw_token=function(y){this._output.add_raw_token(y)},h.prototype.print_preserved_newlines=function(y){var m=0;y.type!==s.TEXT&&y.previous.type!==s.TEXT&&(m=y.newlines?1:0),this.preserve_newlines&&(m=y.newlines0);return m!==0},h.prototype.traverse_whitespace=function(y){return y.whitespace_before||y.newlines?(this.print_preserved_newlines(y)||(this._output.space_before_token=!0),!0):!1},h.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},h.prototype.print_newline=function(y){this._output.add_new_line(y)},h.prototype.print_token=function(y){y.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(y.text))},h.prototype.indent=function(){this.indent_level++},h.prototype.get_full_indent=function(y){return y=this.indent_level+(y||0),y<1?"":this._output.get_indent_string(y)};var O=function(y){for(var m=null,b=y.next;b.type!==s.EOF&&y.closed!==b;){if(b.type===s.ATTRIBUTE&&b.text==="type"){b.next&&b.next.type===s.EQUALS&&b.next.next&&b.next.next.type===s.VALUE&&(m=b.next.next.text);break}b=b.next}return m},w=function(y,m){var b=null,P=null;return m.closed?(y==="script"?b="text/javascript":y==="style"&&(b="text/css"),b=O(m)||b,b.search("text/css")>-1?P="css":b.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?P="javascript":b.search(/(text|application|dojo)\/(x-)?(html)/)>-1?P="html":b.search(/test\/null/)>-1&&(P="null"),P):null};function x(y,m){return m.indexOf(y)!==-1}function A(y,m,b){this.parent=y||null,this.tag=m?m.tag_name:"",this.indent_level=b||0,this.parser_token=m||null}function S(y){this._printer=y,this._current_frame=null}S.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},S.prototype.record_tag=function(y){var m=new A(this._current_frame,y,this._printer.indent_level);this._current_frame=m},S.prototype._try_pop_frame=function(y){var m=null;return y&&(m=y.parser_token,this._printer.indent_level=y.indent_level,this._current_frame=y.parent),m},S.prototype._get_frame=function(y,m){for(var b=this._current_frame;b&&!(y.indexOf(b.tag)!==-1);){if(m&&m.indexOf(b.tag)!==-1){b=null;break}b=b.parent}return b},S.prototype.try_pop=function(y,m){var b=this._get_frame([y],m);return this._try_pop_frame(b)},S.prototype.indent_to_tag=function(y){var m=this._get_frame(y);m&&(this._printer.indent_level=m.indent_level)};function T(y,m,b,P){this._source_text=y||"",m=m||{},this._js_beautify=b,this._css_beautify=P,this._tag_stack=null;var I=new d(m,"html");this._options=I,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"}T.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var y=this._source_text,m=this._options.eol;this._options.eol==="auto"&&(m=` `,y&&a.test(y)&&(m=y.match(a)[0])),y=y.replace(l,` `);var b=y.match(/^[\t ]*/)[0],P={text:"",type:""},I=new E,U=new h(this._options,b),F=new c(y,this._options).tokenize();this._tag_stack=new S(U);for(var L=null,v=F.next();v.type!==s.EOF;)v.type===s.TAG_OPEN||v.type===s.COMMENT?(L=this._handle_tag_open(U,v,I,P),I=L):v.type===s.ATTRIBUTE||v.type===s.EQUALS||v.type===s.VALUE||v.type===s.TEXT&&!I.tag_complete?L=this._handle_inside_tag(U,v,I,F):v.type===s.TAG_CLOSE?L=this._handle_tag_close(U,v,I):v.type===s.TEXT?L=this._handle_text(U,v,I):U.add_raw_token(v),P=L,v=F.next();var j=U._output.get_code(m);return j},T.prototype._handle_tag_close=function(y,m,b){var P={text:m.text,type:m.type};return y.alignment_size=0,b.tag_complete=!0,y.set_space_before_token(m.newlines||m.whitespace_before!=="",!0),b.is_unformatted?y.add_raw_token(m):(b.tag_start_char==="<"&&(y.set_space_before_token(m.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&b.has_wrapped_attrs&&y.print_newline(!1)),y.print_token(m)),b.indent_content&&!(b.is_unformatted||b.is_content_unformatted)&&(y.indent(),b.indent_content=!1),!b.is_inline_element&&!(b.is_unformatted||b.is_content_unformatted)&&y.set_wrap_point(),P},T.prototype._handle_inside_tag=function(y,m,b,P){var I=b.has_wrapped_attrs,U={text:m.text,type:m.type};if(y.set_space_before_token(m.newlines||m.whitespace_before!=="",!0),b.is_unformatted)y.add_raw_token(m);else if(b.tag_start_char==="{"&&m.type===s.TEXT)y.print_preserved_newlines(m)?(m.newlines=0,y.add_raw_token(m)):y.print_token(m);else{if(m.type===s.ATTRIBUTE?(y.set_space_before_token(!0),b.attr_count+=1):(m.type===s.EQUALS||m.type===s.VALUE&&m.previous.type===s.EQUALS)&&y.set_space_before_token(!1),m.type===s.ATTRIBUTE&&b.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(y.traverse_whitespace(m),I=I||m.newlines!==0),this._is_wrap_attributes_force)){var F=b.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&b.attr_count===1){var L=!0,v=0,j;do{if(j=P.peek(v),j.type===s.ATTRIBUTE){L=!1;break}v+=1}while(v<4&&j.type!==s.EOF&&j.type!==s.TAG_CLOSE);F=!L}F&&(y.print_newline(!1),I=!0)}y.print_token(m),I=I||y.previous_token_wrapped(),b.has_wrapped_attrs=I}return U},T.prototype._handle_text=function(y,m,b){var P={text:m.text,type:"TK_CONTENT"};return b.custom_beautifier_name?this._print_custom_beatifier_text(y,m,b):b.is_unformatted||b.is_content_unformatted?y.add_raw_token(m):(y.traverse_whitespace(m),y.print_token(m)),P},T.prototype._print_custom_beatifier_text=function(y,m,b){var P=this;if(m.text!==""){var I=m.text,U,F=1,L="",v="";b.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?U=this._js_beautify:b.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?U=this._css_beautify:b.custom_beautifier_name==="html"&&(U=function(de,me){var ce=new T(de,me,P._js_beautify,P._css_beautify);return ce.beautify()}),this._options.indent_scripts==="keep"?F=0:this._options.indent_scripts==="separate"&&(F=-y.indent_level);var j=y.get_full_indent(F);if(I=I.replace(/\n[ \t]*$/,""),b.custom_beautifier_name!=="html"&&I[0]==="<"&&I.match(/^(|]]>)$/.exec(I);if(!K){y.add_raw_token(m);return}L=j+K[1]+` `,I=K[4],K[5]&&(v=j+K[5]),I=I.replace(/\n[ \t]*$/,""),(K[2]||K[3].indexOf(` `)!==-1)&&(K=K[3].match(/[ \t]+$/),K&&(m.whitespace_before=K[0]))}if(I)if(U){var J=function(){this.eol=` `};J.prototype=this._options.raw_options;var ee=new J;I=U(j+I,ee)}else{var ve=m.whitespace_before;ve&&(I=I.replace(new RegExp(` (`+ve+")?","g"),` `)),I=j+I.replace(/\n/g,` `+j)}L&&(I?I=L+I+` `+v:I=L+v),y.print_newline(!1),I&&(m.text=I,m.whitespace_before="",m.newlines=0,y.add_raw_token(m),y.print_newline(!0))}},T.prototype._handle_tag_open=function(y,m,b,P){var I=this._get_tag_open_token(m);return(b.is_unformatted||b.is_content_unformatted)&&!b.is_empty_element&&m.type===s.TAG_OPEN&&m.text.indexOf("]*)/),this.tag_check=b?b[1]:""):(b=m.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=b?b[1]:"",(m.text.startsWith("{{#>")||m.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&m.next!==null?this.tag_check=m.next.text.split(" ")[0]:this.tag_check=m.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),m.type===s.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||m.closed&&m.closed.text==="/>";var P=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(P=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(P)))}};T.prototype._get_tag_open_token=function(y){var m=new E(this._tag_stack.get_parser_token(),y);return m.alignment_size=this._options.wrap_attributes_indent_size,m.is_end_tag=m.is_end_tag||x(m.tag_check,this._options.void_elements),m.is_empty_element=m.tag_complete||m.is_start_tag&&m.is_end_tag,m.is_unformatted=!m.tag_complete&&x(m.tag_check,this._options.unformatted),m.is_content_unformatted=!m.is_empty_element&&x(m.tag_check,this._options.content_unformatted),m.is_inline_element=x(m.tag_name,this._options.inline)||m.tag_name.includes("-")||m.tag_start_char==="{",m},T.prototype._set_tag_position=function(y,m,b,P,I){if(b.is_empty_element||(b.is_end_tag?b.start_tag_token=this._tag_stack.try_pop(b.tag_name):(this._do_optional_end_element(b)&&(b.is_inline_element||y.print_newline(!1)),this._tag_stack.record_tag(b),(b.tag_name==="script"||b.tag_name==="style")&&!(b.is_unformatted||b.is_content_unformatted)&&(b.custom_beautifier_name=w(b.tag_check,m)))),x(b.tag_check,this._options.extra_liners)&&(y.print_newline(!1),y._output.just_added_blankline()||y.print_newline(!0)),b.is_empty_element){if(b.tag_start_char==="{"&&b.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),b.indent_content=!0;var U=y.current_line_has_match(/{{#if/);U||y.print_newline(!1)}b.tag_name==="!--"&&I.type===s.TAG_CLOSE&&P.is_end_tag&&b.text.indexOf(` `)===-1||(b.is_inline_element||b.is_unformatted||y.print_newline(!1),this._calcluate_parent_multiline(y,b))}else if(b.is_end_tag){var F=!1;F=b.start_tag_token&&b.start_tag_token.multiline_content,F=F||!b.is_inline_element&&!(P.is_inline_element||P.is_unformatted)&&!(I.type===s.TAG_CLOSE&&b.start_tag_token===P)&&I.type!=="TK_CONTENT",(b.is_content_unformatted||b.is_unformatted)&&(F=!1),F&&y.print_newline(!1)}else b.indent_content=!b.custom_beautifier_name,b.tag_start_char==="<"&&(b.tag_name==="html"?b.indent_content=this._options.indent_inner_html:b.tag_name==="head"?b.indent_content=this._options.indent_head_inner_html:b.tag_name==="body"&&(b.indent_content=this._options.indent_body_inner_html)),!(b.is_inline_element||b.is_unformatted)&&(I.type!=="TK_CONTENT"||b.is_content_unformatted)&&y.print_newline(!1),this._calcluate_parent_multiline(y,b)},T.prototype._calcluate_parent_multiline=function(y,m){m.parent&&y._output.just_added_newline()&&!((m.is_inline_element||m.is_unformatted)&&m.parent.is_inline_element)&&(m.parent.multiline_content=!0)};var _=["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"],u=["a","audio","del","ins","map","noscript","video"];T.prototype._do_optional_end_element=function(y){var m=null;if(y.is_empty_element||!y.is_start_tag||!y.parent)return;if(y.tag_name==="body")m=m||this._tag_stack.try_pop("head");else if(y.tag_name==="li")m=m||this._tag_stack.try_pop("li",["ol","ul"]);else if(y.tag_name==="dd"||y.tag_name==="dt")m=m||this._tag_stack.try_pop("dt",["dl"]),m=m||this._tag_stack.try_pop("dd",["dl"]);else if(y.parent.tag_name==="p"&&_.indexOf(y.tag_name)!==-1){var b=y.parent.parent;(!b||u.indexOf(b.tag_name)===-1)&&(m=m||this._tag_stack.try_pop("p"))}else y.tag_name==="rp"||y.tag_name==="rt"?(m=m||this._tag_stack.try_pop("rt",["ruby","rtc"]),m=m||this._tag_stack.try_pop("rp",["ruby","rtc"])):y.tag_name==="optgroup"?m=m||this._tag_stack.try_pop("optgroup",["select"]):y.tag_name==="option"?m=m||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):y.tag_name==="colgroup"?m=m||this._tag_stack.try_pop("caption",["table"]):y.tag_name==="thead"?(m=m||this._tag_stack.try_pop("caption",["table"]),m=m||this._tag_stack.try_pop("colgroup",["table"])):y.tag_name==="tbody"||y.tag_name==="tfoot"?(m=m||this._tag_stack.try_pop("caption",["table"]),m=m||this._tag_stack.try_pop("colgroup",["table"]),m=m||this._tag_stack.try_pop("thead",["table"]),m=m||this._tag_stack.try_pop("tbody",["table"])):y.tag_name==="tr"?(m=m||this._tag_stack.try_pop("caption",["table"]),m=m||this._tag_stack.try_pop("colgroup",["table"]),m=m||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(y.tag_name==="th"||y.tag_name==="td")&&(m=m||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),m=m||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return y.parent=this._tag_stack.get_parser_token(),m},g.exports.Beautifier=T},function(g,p,f){var d=f(6).Options;function o(c){d.call(this,c,"html"),this.templating.length===1&&this.templating[0]==="auto"&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}o.prototype=new d,g.exports.Options=o},function(g,p,f){var d=f(9).Tokenizer,o=f(9).TOKEN,c=f(13).Directives,s=f(14).TemplatablePattern,a=f(12).Pattern,l={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:o.START,RAW:o.RAW,EOF:o.EOF},h=new c(/<\!--/,/-->/),O=function(w,x){d.call(this,w,x),this._current_tag_name="";var A=new s(this._input).read_options(this._options),S=new a(this._input);if(this.__patterns={word:A.until(/[\n\r\t <]/),single_quote:A.until_after(/'/),double_quote:A.until_after(/"/),attribute:A.until(/[\n\r\t =>]|\/>/),element_name:A.until(/[\n\r\t >\/]/),handlebars_comment:S.starting_with(/{{!--/).until_after(/--}}/),handlebars:S.starting_with(/{{/).until_after(/}}/),handlebars_open:S.until(/[\n\r\t }]/),handlebars_raw_close:S.until(/}}/),comment:S.starting_with(//),cdata:S.starting_with(//),conditional_comment:S.starting_with(//),processing:S.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 T=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=S.matching(T).until_after(T)}};O.prototype=new d,O.prototype._is_comment=function(w){return!1},O.prototype._is_opening=function(w){return w.type===l.TAG_OPEN},O.prototype._is_closing=function(w,x){return w.type===l.TAG_CLOSE&&x&&((w.text===">"||w.text==="/>")&&x.text[0]==="<"||w.text==="}}"&&x.text[0]==="{"&&x.text[1]==="{")},O.prototype._reset=function(){this._current_tag_name=""},O.prototype._get_next_token=function(w,x){var A=null;this._readWhitespace();var S=this._input.peek();return S===null?this._create_token(l.EOF,""):(A=A||this._read_open_handlebars(S,x),A=A||this._read_attribute(S,w,x),A=A||this._read_close(S,x),A=A||this._read_raw_content(S,w,x),A=A||this._read_content_word(S),A=A||this._read_comment_or_cdata(S),A=A||this._read_processing(S),A=A||this._read_open(S,x),A=A||this._create_token(l.UNKNOWN,this._input.next()),A)},O.prototype._read_comment_or_cdata=function(w){var x=null,A=null,S=null;if(w==="<"){var T=this._input.peek(1);T==="!"&&(A=this.__patterns.comment.read(),A?(S=h.get_directives(A),S&&S.ignore==="start"&&(A+=h.readIgnored(this._input))):A=this.__patterns.cdata.read()),A&&(x=this._create_token(l.COMMENT,A),x.directives=S)}return x},O.prototype._read_processing=function(w){var x=null,A=null,S=null;if(w==="<"){var T=this._input.peek(1);(T==="!"||T==="?")&&(A=this.__patterns.conditional_comment.read(),A=A||this.__patterns.processing.read()),A&&(x=this._create_token(l.COMMENT,A),x.directives=S)}return x},O.prototype._read_open=function(w,x){var A=null,S=null;return x||w==="<"&&(A=this._input.next(),this._input.peek()==="/"&&(A+=this._input.next()),A+=this.__patterns.element_name.read(),S=this._create_token(l.TAG_OPEN,A)),S},O.prototype._read_open_handlebars=function(w,x){var A=null,S=null;return x||this._options.indent_handlebars&&w==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(A=this.__patterns.handlebars_comment.read(),A=A||this.__patterns.handlebars.read(),S=this._create_token(l.COMMENT,A)):(A=this.__patterns.handlebars_open.read(),S=this._create_token(l.TAG_OPEN,A))),S},O.prototype._read_close=function(w,x){var A=null,S=null;return x&&(x.text[0]==="<"&&(w===">"||w==="/"&&this._input.peek(1)===">")?(A=this._input.next(),w==="/"&&(A+=this._input.next()),S=this._create_token(l.TAG_CLOSE,A)):x.text[0]==="{"&&w==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),S=this._create_token(l.TAG_CLOSE,"}}"))),S},O.prototype._read_attribute=function(w,x,A){var S=null,T="";if(A&&A.text[0]==="<")if(w==="=")S=this._create_token(l.EQUALS,this._input.next());else if(w==='"'||w==="'"){var E=this._input.next();w==='"'?E+=this.__patterns.double_quote.read():E+=this.__patterns.single_quote.read(),S=this._create_token(l.VALUE,E)}else T=this.__patterns.attribute.read(),T&&(x.type===l.EQUALS?S=this._create_token(l.VALUE,T):S=this._create_token(l.ATTRIBUTE,T));return S},O.prototype._is_content_unformatted=function(w){return this._options.void_elements.indexOf(w)===-1&&(this._options.content_unformatted.indexOf(w)!==-1||this._options.unformatted.indexOf(w)!==-1)},O.prototype._read_raw_content=function(w,x,A){var S="";if(A&&A.text[0]==="{")S=this.__patterns.handlebars_raw_close.read();else if(x.type===l.TAG_CLOSE&&x.opened.text[0]==="<"&&x.text[0]!=="/"){var T=x.opened.text.substr(1).toLowerCase();if(T==="script"||T==="style"){var E=this._read_comment_or_cdata(w);if(E)return E.type=l.TEXT,E;S=this._input.readUntil(new RegExp("","ig"))}else this._is_content_unformatted(T)&&(S=this._input.readUntil(new RegExp("","ig")))}return S?this._create_token(l.TEXT,S):null},O.prototype._read_content_word=function(w){var x="";if(this._options.unformatted_content_delimiter&&(w===this._options.unformatted_content_delimiter[0]&&(x=this.__patterns.unformatted_content_delimiter.read())),x||(x=this.__patterns.word.read()),x)return this._create_token(l.TEXT,x)},g.exports.Tokenizer=O,g.exports.TOKEN=l}],B={};function k(g){var p=B[g];if(p!==void 0)return p.exports;var f=B[g]={exports:{}};return W[g](f,f.exports,k),f.exports}var R=k(18);D=R})();var z=D;if(!0)!(ne=[te,te("6UM0"),te("TXwP")],V=function(W){var B=te("6UM0"),k=te("TXwP");return{html_beautify:function(R,g){return z(R,g,B.js_beautify,k.css_beautify)}}}.apply(Ve,ne),V!==void 0&&(at.exports=V));else var N,M})()},"rAM+":function(at,Ve,te){"use strict";te.d(Ve,"a",function(){return V});var ne=te("Qw5x");function V(D,z){var N;if(typeof Symbol=="undefined"||D[Symbol.iterator]==null){if(Array.isArray(D)||(N=Object(ne.a)(D))||z&&D&&typeof D.length=="number"){N&&(D=N);var M=0,W=function(){};return{s:W,n:function(){return M>=D.length?{done:!0}:{done:!1,value:D[M++]}},e:function(p){throw p},f:W}}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 B=!0,k=!1,R;return{s:function(){N=D[Symbol.iterator]()},n:function(){var p=N.next();return B=p.done,p},e:function(p){k=!0,R=p},f:function(){try{!B&&N.return!=null&&N.return()}finally{if(k)throw R}}}}},rUJ1:function(at,Ve){const te=/[&<>"']/,ne=/[&<>"']/g,V=/[<>"']|&(?!#?\w+;)/,D=/[<>"']|&(?!#?\w+;)/g,z={"&":"&","<":"<",">":">",'"':""","'":"'"},N=S=>z[S];function M(S,T){if(T){if(te.test(S))return S.replace(ne,N)}else if(V.test(S))return S.replace(D,N);return S}const W=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function B(S){return S.replace(W,(T,E)=>(E=E.toLowerCase(),E==="colon"?":":E.charAt(0)==="#"?E.charAt(1)==="x"?String.fromCharCode(parseInt(E.substring(2),16)):String.fromCharCode(+E.substring(1)):""))}const k=/(^|[^\[])\^/g;function R(S,T){S=S.source||S,T=T||"";const E={replace:(_,u)=>(u=u.source||u,u=u.replace(k,"$1"),S=S.replace(_,u),E),getRegex:()=>new RegExp(S,T)};return E}const g=/[^\w:]/g,p=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function f(S,T,E){if(S){let _;try{_=decodeURIComponent(B(E)).replace(g,"").toLowerCase()}catch(u){return null}if(_.indexOf("javascript:")===0||_.indexOf("vbscript:")===0||_.indexOf("data:")===0)return null}T&&!p.test(E)&&(E=a(T,E));try{E=encodeURI(E).replace(/%25/g,"%")}catch(_){return null}return E}const d={},o=/^[^:]+:\/*[^/]*$/,c=/^([^:]+:)[\s\S]*$/,s=/^([^:]+:\/*[^/]*)[\s\S]*$/;function a(S,T){d[" "+S]||(o.test(S)?d[" "+S]=S+"/":d[" "+S]=w(S,"/",!0)),S=d[" "+S];const E=S.indexOf(":")===-1;return T.substring(0,2)==="//"?E?T:S.replace(c,"$1")+T:T.charAt(0)==="/"?E?T:S.replace(s,"$1")+T:S+T}const l={exec:function(){}};function h(S){let T=1,E,_;for(;T{let P=!1,I=m;for(;--I>=0&&b[I]==="\\";)P=!P;return P?"|":" |"}),_=E.split(/ \|/);let u=0;if(_.length>T)_.splice(T);else for(;_.length0},!1)}function g(p,f){for(var d={main:[f]},o={main:[]},c={main:{}};R(d);)for(var s=Object.keys(d),a=0;a=2*A/T||b<=I)return;var U=Number.POSITIVE_INFINITY,F;for(F=s.level-1;F>_;F--){var L=E[F].maxBitrate;if(U=A*L/(8*.8*m),U=b)return;var v=this.bwEstimator.getEstimate();R.logger.warn("Fragment "+s.sn+(a?" part "+a.index:"")+" of level "+s.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+F+` Current BW estimate: `+(Object(z.isFiniteNumber)(v)?(v/1024).toFixed(3):"Unknown")+` Kb/s Estimated load time for current fragment: `+b.toFixed(3)+` s Estimated load time for the next fragment: `+U.toFixed(3)+` s Time to underbuffer: `+I.toFixed(3)+" s"),l.nextLoadLevel=F,this.bwEstimator.sample(S,x.loaded),this.clearTimer(),s.loader&&(this.fragCurrent=this.partCurrent=null,s.loader.abort()),l.trigger(M.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:s,part:a,stats:x})},o.onFragLoaded=function(s,a){var l=a.frag,h=a.part;if(l.type===k.PlaylistLevelType.MAIN&&Object(z.isFiniteNumber)(l.sn)){var O=h?h.stats:l.stats,w=h?h.duration:l.duration;if(this.clearTimer(),this.lastLoadedFragLevel=l.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var x=this.hls.levels[l.level],A=(x.loaded?x.loaded.bytes:0)+O.loaded,S=(x.loaded?x.loaded.duration:0)+w;x.loaded={bytes:A,duration:S},x.realBitrate=Math.round(8*A/S)}if(l.bitrateTest){var T={stats:O,frag:l,part:h,id:l.type};this.onFragBuffered(M.Events.FRAG_BUFFERED,T),l.bitrateTest=!1}}},o.onFragBuffered=function(s,a){var l=a.frag,h=a.part,O=h?h.stats:l.stats;if(O.aborted)return;if(l.type!==k.PlaylistLevelType.MAIN||l.sn==="initSegment")return;var w=O.parsing.end-O.loading.start;this.bwEstimator.sample(w,O.loaded),O.bwEstimate=this.bwEstimator.getEstimate(),l.bitrateTest?this.bitrateTestDelay=w/1e3:this.bitrateTestDelay=0},o.onError=function(s,a){switch(a.details){case B.ErrorDetails.FRAG_LOAD_ERROR:case B.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},o.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},o.getNextABRAutoLevel=function(){var s=this.fragCurrent,a=this.partCurrent,l=this.hls,h=l.maxAutoLevel,O=l.config,w=l.minAutoLevel,x=l.media,A=a?a.duration:s?s.duration:0,S=x?x.currentTime:0,T=x&&x.playbackRate!==0?Math.abs(x.playbackRate):1,E=this.bwEstimator?this.bwEstimator.getEstimate():O.abrEwmaDefaultEstimate,_=(W.BufferHelper.bufferInfo(x,S,O.maxBufferHole).end-S)/T,u=this.findBestLevel(E,w,h,_,O.abrBandWidthFactor,O.abrBandWidthUpFactor);if(u>=0)return u;R.logger.trace((_?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var y=A?Math.min(A,O.maxStarvationDelay):O.maxStarvationDelay,m=O.abrBandWidthFactor,b=O.abrBandWidthUpFactor;if(!_){var P=this.bitrateTestDelay;if(P){var I=A?Math.min(A,O.maxLoadingDelay):O.maxLoadingDelay;y=I-P,R.logger.trace("bitrate test took "+Math.round(1e3*P)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*y)+" ms"),m=b=1}}return u=this.findBestLevel(E,w,h,_+y,m,b),Math.max(u,0)},o.findBestLevel=function(s,a,l,h,O,w){for(var x,A=this.fragCurrent,S=this.partCurrent,T=this.lastLoadedFragLevel,E=this.hls.levels,_=E[T],u=!!(_!=null&&(x=_.details)!==null&&x!==void 0&&x.live),y=_==null?void 0:_.codecSet,m=S?S.duration:A?A.duration:0,b=l;b>=a;b--){var P=E[b];if(!P||y&&P.codecSet!==y)continue;var I=P.details,U=(S?I==null?void 0:I.partTarget:I==null?void 0:I.averagetargetduration)||m,F=void 0;b<=T?F=O*s:F=w*s;var L=E[b].maxBitrate,v=L*U/F;if(R.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+b+"/"+Math.round(F)+"/"+L+"/"+U+"/"+h+"/"+v),F>L&&(!v||u&&!this.bitrateTestDelay||v0&&_===-1?(this.log("Override startPosition with lastCurrentTime @"+u.toFixed(3)),this.state=N.State.IDLE):(this.loadedmetadata=!1,this.state=N.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=_,this.tick()},T.doTick=function(){switch(this.state){case N.State.IDLE:this.doTickIdle();break;case N.State.WAITING_TRACK:{var _,u=this.levels,y=this.trackId,m=u==null||((_=u[y])===null||_===void 0)?void 0:_.details;if(m){if(this.waitForCdnTuneIn(m))break;this.state=N.State.WAITING_INIT_PTS}break}case N.State.FRAG_LOADING_WAITING_RETRY:{var b,P=performance.now(),I=this.retryDate;(!I||P>=I||(b=this.media)!==null&&b!==void 0&&b.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=N.State.IDLE);break}case N.State.WAITING_INIT_PTS:{var U=this.waitingData;if(U){var F=U.frag,L=U.part,v=U.cache,j=U.complete;if(this.initPTS[F.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=N.State.FRAG_LOADING;var K=v.flush(),J={frag:F,part:L,payload:K,networkDetails:null};this._handleFragmentLoadProgress(J),j&&A.prototype._handleFragmentLoadComplete.call(this,J)}else if(this.videoTrackCC!==this.waitingVideoCC)a.logger.log("Waiting fragment cc ("+F.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var ee=this.getLoadPosition(),ve=W.BufferHelper.bufferInfo(this.mediaBuffer,ee,this.config.maxBufferHole),de=Object(o.fragmentWithinToleranceTest)(ve.end,this.config.maxFragLookUpTolerance,F);de<0&&(a.logger.log("Waiting fragment cc ("+F.cc+") @ "+F.start+" cancelled because another fragment at "+ve.end+" is needed"),this.clearWaitingFragment())}}else this.state=N.State.IDLE}}this.onTickEnd()},T.clearWaitingFragment=function(){var _=this.waitingData;_&&(this.fragmentTracker.removeFragment(_.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=N.State.IDLE)},T.onTickEnd=function(){var _=this.media;if(!_||!_.readyState)return;var u=this.mediaBuffer?this.mediaBuffer:_,y=u.buffered;!this.loadedmetadata&&y.length&&(this.loadedmetadata=!0),this.lastCurrentTime=_.currentTime},T.doTickIdle=function(){var _,u,y=this.hls,m=this.levels,b=this.media,P=this.trackId,I=y.config;if(!m||!m[P])return;if(!b&&(this.startFragRequested||!I.startFragPrefetch))return;var U=m[P],F=U.details;if(!F||F.live&&this.levelLastLoaded!==P||this.waitForCdnTuneIn(F)){this.state=N.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,g.ElementaryStreamTypes.AUDIO,R.PlaylistLevelType.AUDIO));var L=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,R.PlaylistLevelType.AUDIO);if(L===null)return;var v=L.len,j=this.getMaxBufferLength(),K=this.audioSwitch;if(v>=j&&!K)return;if(!K&&this._streamEnded(L,F)){y.trigger(M.Events.BUFFER_EOS,{type:"audio"}),this.state=N.State.ENDED;return}var J=F.fragments,ee=J[0].start,ve=L.end;if(K){var de=this.getLoadPosition();ve=de,F.PTSKnown&&deee||L.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),b.currentTime=ee+.05))}var me=this.getNextFragment(ve,F);if(!me){this.bufferFlushed=!0;return}((_=me.decryptdata)===null||_===void 0?void 0:_.keyFormat)==="identity"&&!((u=me.decryptdata)!==null&&u!==void 0&&u.key)?this.loadKey(me,F):this.loadFragment(me,F,ve)},T.getMaxBufferLength=function(){var _=A.prototype.getMaxBufferLength.call(this),u=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,R.PlaylistLevelType.MAIN);return u===null?_:Math.max(_,u.len)},T.onMediaDetaching=function(){this.videoBuffer=null,A.prototype.onMediaDetaching.call(this)},T.onAudioTracksUpdated=function(_,u){var y=u.audioTracks;this.resetTransmuxer(),this.levels=y.map(function(m){return new k.Level(m)})},T.onAudioTrackSwitching=function(_,u){var y=!!u.url;this.trackId=u.id;var m=this.fragCurrent;m!=null&&m.loader&&m.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),y?this.setInterval(w):this.resetTransmuxer(),y?(this.audioSwitch=!0,this.state=N.State.IDLE):this.state=N.State.STOPPED,this.tick()},T.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},T.onLevelLoaded=function(_,u){this.mainDetails=u.details},T.onAudioTrackLoaded=function(_,u){var y,m=this.levels,b=u.details,P=u.id;if(!m){this.warn("Audio tracks were reset while loading level "+P);return}this.log("Track "+P+" loaded ["+b.startSN+","+b.endSN+"],duration:"+b.totalduration);var I=m[P],U=0;if(b.live||(y=I.details)!==null&&y!==void 0&&y.live){var F=this.mainDetails;if(b.fragments[0]||(b.deltaUpdateFailed=!0),b.deltaUpdateFailed||!F)return;!I.details&&b.hasProgramDateTime&&F.hasProgramDateTime?(Object(c.alignMediaPlaylistByPDT)(b,F),U=b.fragments[0].start):U=this.alignPlaylists(b,I.details)}I.details=b,this.levelLastLoaded=P,!this.startFragRequested&&(this.mainDetails||!b.live)&&this.setStartPosition(I.details,U),this.state===N.State.WAITING_TRACK&&!this.waitForCdnTuneIn(b)&&(this.state=N.State.IDLE),this.tick()},T._handleFragmentLoadProgress=function(_){var u,y=_.frag,m=_.part,b=_.payload,P=this.config,I=this.trackId,U=this.levels;if(!U){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+y.sn+" of level "+y.level+" will not be buffered");return}var F=U[I];console.assert(F,"Audio track is defined on fragment load progress");var L=F.details;console.assert(L,"Audio track details are defined on fragment load progress");var v=P.defaultAudioCodec||F.audioCodec||"mp4a.40.2",j=this.transmuxer;j||(j=this.transmuxer=new f.default(this.hls,R.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var K=this.initPTS[y.cc],J=(u=y.initSegment)===null||u===void 0?void 0:u.data;if(K!==void 0){var ee=!1,ve=m?m.index:-1,de=ve!==-1,me=new d.ChunkMetadata(y.level,y.sn,y.stats.chunkCount,b.byteLength,ve,de);j.push(b,J,v,"",y,m,L.totalduration,ee,me,K)}else{a.logger.log("Unknown video PTS for cc "+y.cc+", waiting for video PTS before demuxing audio frag "+y.sn+" of ["+L.startSN+" ,"+L.endSN+"],track "+I);var ce=this.waitingData=this.waitingData||{frag:y,part:m,cache:new p.default,complete:!1},pe=ce.cache;pe.push(new Uint8Array(b)),this.waitingVideoCC=this.videoTrackCC,this.state=N.State.WAITING_INIT_PTS}},T._handleFragmentLoadComplete=function(_){if(this.waitingData){this.waitingData.complete=!0;return}A.prototype._handleFragmentLoadComplete.call(this,_)},T.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},T.onBufferCreated=function(_,u){var y=u.tracks.audio;y&&(this.mediaBuffer=y.buffer),u.tracks.video&&(this.videoBuffer=u.tracks.video.buffer)},T.onFragBuffered=function(_,u){var y=u.frag,m=u.part;if(y.type!==R.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(y)){this.warn("Fragment "+y.sn+(m?" p: "+m.index:"")+" of level "+y.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}y.sn!=="initSegment"&&(this.fragPrevious=y,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(M.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(y,m)},T.onError=function(_,u){switch(u.details){case s.ErrorDetails.FRAG_LOAD_ERROR:case s.ErrorDetails.FRAG_LOAD_TIMEOUT:case s.ErrorDetails.KEY_LOAD_ERROR:case s.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(R.PlaylistLevelType.AUDIO,u);break;case s.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case s.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==N.State.ERROR&&this.state!==N.State.STOPPED&&(this.state=u.fatal?N.State.ERROR:N.State.IDLE,this.warn(u.details+" while loading frag, switching to "+this.state+" state"));break;case s.ErrorDetails.BUFFER_FULL_ERROR:if(u.parent==="audio"&&(this.state===N.State.PARSING||this.state===N.State.PARSED)){var y=!0,m=this.getFwdBufferInfo(this.mediaBuffer,R.PlaylistLevelType.AUDIO);m&&m.len>.5&&(y=!this.reduceMaxBufferLength(m.len)),y&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,A.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},T.onBufferFlushed=function(_,u){var y=u.type;y===g.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},T._handleTransmuxComplete=function(_){var u,y="audio",m=this.hls,b=_.remuxResult,P=_.chunkMeta,I=this.getCurrentContext(P);if(!I){this.warn("The loading context changed while buffering fragment "+P.sn+" of level "+P.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(P.level);return}var U=I.frag,F=I.part,L=b.audio,v=b.text,j=b.id3,K=b.initSegment;if(this.fragContextChanged(U))return;if(this.state=N.State.PARSING,this.audioSwitch&&L&&this.completeAudioSwitch(),K!=null&&K.tracks&&(this._bufferInitSegment(K.tracks,U,P),m.trigger(M.Events.FRAG_PARSING_INIT_SEGMENT,{frag:U,id:y,tracks:K.tracks})),L){var J=L.startPTS,ee=L.endPTS,ve=L.startDTS,de=L.endDTS;F&&(F.elementaryStreams[g.ElementaryStreamTypes.AUDIO]={startPTS:J,endPTS:ee,startDTS:ve,endDTS:de}),U.setElementaryStreamInfo(g.ElementaryStreamTypes.AUDIO,J,ee,ve,de),this.bufferFragmentData(L,U,F,P)}if(j!=null&&(u=j.samples)!==null&&u!==void 0&&u.length){var me=l({frag:U,id:y},j);m.trigger(M.Events.FRAG_PARSING_METADATA,me)}if(v){var ce=l({frag:U,id:y},v);m.trigger(M.Events.FRAG_PARSING_USERDATA,ce)}},T._bufferInitSegment=function(_,u,y){if(this.state!==N.State.PARSING)return;_.video&&delete _.video;var m=_.audio;if(!m)return;m.levelCodec=m.codec,m.id="audio",this.log("Init audio buffer, container:"+m.container+", codecs[parsed]=["+m.codec+"]"),this.hls.trigger(M.Events.BUFFER_CODECS,_);var b=m.initSegment;if(b!=null&&b.byteLength){var P={type:"audio",frag:u,part:null,chunkMeta:y,parent:u.type,data:b};this.hls.trigger(M.Events.BUFFER_APPENDING,P)}this.tick()},T.loadFragment=function(_,u,y){var m=this.fragmentTracker.getState(_);this.fragCurrent=_,(this.audioSwitch||m===B.FragmentState.NOT_LOADED||m===B.FragmentState.PARTIAL)&&(_.sn==="initSegment"?this._loadInitSegment(_):u.live&&!Object(z.isFiniteNumber)(this.initPTS[_.cc])?(this.log("Waiting for video PTS in continuity counter "+_.cc+" of live stream before loading audio fragment "+_.sn+" of level "+this.trackId),this.state=N.State.WAITING_INIT_PTS):(this.startFragRequested=!0,A.prototype.loadFragment.call(this,_,u,y)))},T.completeAudioSwitch=function(){var _=this.hls,u=this.media,y=this.trackId;u&&(this.log("Switching audio track : flushing all audio"),A.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,_.trigger(M.Events.AUDIO_TRACK_SWITCHED,{id:y})},S}(N.default);V.default=x},"./src/controller/audio-track-controller.ts":function(ne,V,D){"use strict";D.r(V);var z=D("./src/events.ts"),N=D("./src/errors.ts"),M=D("./src/controller/base-playlist-controller.ts"),W=D("./src/types/loader.ts");function B(f,d){for(var o=0;o=a.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var l=a[this.trackId];this.log("Now switching to audio-track index "+s);var h=a[s],O=h.id,w=h.groupId,x=w===void 0?"":w,A=h.name,S=h.type,T=h.url;if(this.trackId=s,this.trackName=A,this.selectDefaultTrack=!1,this.hls.trigger(z.Events.AUDIO_TRACK_SWITCHING,{id:O,groupId:x,name:A,type:S,url:T}),h.details&&!h.details.live)return;var E=this.switchParams(h.url,l==null?void 0:l.details);this.loadPlaylist(E)},o.selectInitialTrack=function(){var s=this.tracksInGroup;console.assert(s.length,"Initial audio track should be selected when tracks are known");var a=this.trackName,l=this.findTrackId(a)||this.findTrackId();l!==-1?this.setAudioTrack(l):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(z.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},o.findTrackId=function(s){for(var a=this.tracksInGroup,l=0;ld.partTarget&&(h+=1)}if(Object(z.isFiniteNumber)(l))return new N.HlsUrlParameters(l,Object(z.isFiniteNumber)(h)?h:void 0,N.HlsSkip.No)}}},g.loadPlaylist=function(f){},g.shouldLoadTrack=function(f){return this.canLoad&&f&&!!f.url&&(!f.details||f.details.live)},g.playlistLoaded=function(f,d,o){var c=this,s=d.details,a=d.stats,l=a.loading.end?Math.max(0,self.performance.now()-a.loading.end):0;if(s.advancedDateTime=Date.now()-l,s.live||o!=null&&o.live){if(s.reloaded(o),o&&this.log("live playlist "+f+" "+(s.advanced?"REFRESHED "+s.lastPartSn+"-"+s.lastPartIndex:"MISSED")),o&&s.fragments.length>0&&Object(M.mergeDetails)(o,s),!this.canLoad||!s.live)return;var h,O=void 0,w=void 0;if(s.canBlockReload&&s.endSN&&s.advanced){var x=this.hls.config.lowLatencyMode,A=s.lastPartSn,S=s.endSN,T=s.lastPartIndex,E=T!==-1,_=A===S,u=x?0:T;E?(O=_?S+1:A,w=_?u:T+1):O=S+1;var y=s.age,m=y+s.ageHeader,b=Math.min(m-s.partTarget,s.targetduration*1.5);if(b>0){if(o&&b>o.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+o.tuneInGoal+" to: "+b+" with playlist age: "+s.age),b=0;else{var P=Math.floor(b/s.targetduration);if(O+=P,w!==void 0){var I=Math.round(b%s.targetduration/s.partTarget);w+=I}this.log("CDN Tune-in age: "+s.ageHeader+"s last advanced "+y.toFixed(2)+"s goal: "+b+" skip sn "+P+" to part "+w)}s.tuneInGoal=b}if(h=this.getDeliveryDirectives(s,d.deliveryDirectives,O,w),x||!_){this.loadPlaylist(h);return}}else h=this.getDeliveryDirectives(s,d.deliveryDirectives,O,w);var U=Object(M.computeReloadInterval)(s,a);O!==void 0&&s.canBlockReload&&(U-=s.partTarget||1),this.log("reload live playlist "+f+" in "+Math.round(U)+" ms"),this.timer=self.setTimeout(function(){return c.loadPlaylist(h)},U)}else this.clearTimer()},g.getDeliveryDirectives=function(f,d,o,c){var s=Object(N.getSkipValue)(f,o);return d!=null&&d.skip&&f.deltaUpdateFailed&&(o=d.msn,c=d.part,s=N.HlsSkip.No),new N.HlsUrlParameters(o,c,s)},g.retryLoadingOrFail=function(f){var d=this,o=this.hls.config,c=this.retryCount-1&&(s=f.context)!==null&&s!==void 0&&s.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+f.details+'"'),this.loadPlaylist();else{var a=Math.min(Math.pow(2,this.retryCount)*o.levelLoadingRetryDelay,o.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return d.loadPlaylist()},a),this.warn("retry playlist loading #"+this.retryCount+" in "+a+' ms after "'+f.details+'"')}}else this.warn('cannot recover from error "'+f.details+'"'),this.clearTimer(),f.fatal=!0;return c},R}()},"./src/controller/base-stream-controller.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"State",function(){return S}),D.d(V,"default",function(){return T});var z=D("./src/polyfills/number.ts"),N=D("./src/task-loop.ts"),M=D("./src/controller/fragment-tracker.ts"),W=D("./src/utils/buffer-helper.ts"),B=D("./src/utils/logger.ts"),k=D("./src/events.ts"),R=D("./src/errors.ts"),g=D("./src/types/transmuxer.ts"),p=D("./src/utils/mp4-tools.ts"),f=D("./src/utils/discontinuities.ts"),d=D("./src/controller/fragment-finders.ts"),o=D("./src/controller/level-helper.ts"),c=D("./src/loader/fragment-loader.ts"),s=D("./src/crypt/decrypter.ts"),a=D("./src/utils/time-ranges.ts"),l=D("./src/types/loader.ts");function h(E,_){for(var u=0;u<_.length;u++){var y=_[u];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(E,y.key,y)}}function O(E,_,u){return _&&h(E.prototype,_),u&&h(E,u),E}function w(E){if(E===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E}function x(E,_){E.prototype=Object.create(_.prototype),E.prototype.constructor=E,A(E,_)}function A(E,_){return A=Object.setPrototypeOf||function(y,m){return y.__proto__=m,y},A(E,_)}var S={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"},T=function(E){x(_,E);function _(y,m,b){var P;return P=E.call(this)||this,P.hls=void 0,P.fragPrevious=null,P.fragCurrent=null,P.fragmentTracker=void 0,P.transmuxer=null,P._state=S.STOPPED,P.media=void 0,P.mediaBuffer=void 0,P.config=void 0,P.bitrateTest=!1,P.lastCurrentTime=0,P.nextLoadPosition=0,P.startPosition=0,P.loadedmetadata=!1,P.fragLoadError=0,P.retryDate=0,P.levels=null,P.fragmentLoader=void 0,P.levelLastLoaded=null,P.startFragRequested=!1,P.decrypter=void 0,P.initPTS=[],P.onvseeking=null,P.onvended=null,P.logPrefix="",P.log=void 0,P.warn=void 0,P.logPrefix=b,P.log=B.logger.log.bind(B.logger,b+":"),P.warn=B.logger.warn.bind(B.logger,b+":"),P.hls=y,P.fragmentLoader=new c.default(y.config),P.fragmentTracker=m,P.config=y.config,P.decrypter=new s.default(y,y.config),y.on(k.Events.KEY_LOADED,P.onKeyLoaded,w(P)),P}var u=_.prototype;return u.doTick=function(){this.onTickEnd()},u.onTickEnd=function(){},u.startLoad=function(m){},u.stopLoad=function(){this.fragmentLoader.abort();var m=this.fragCurrent;m&&this.fragmentTracker.removeFragment(m),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=S.STOPPED},u._streamEnded=function(m,b){var P=this.fragCurrent,I=this.fragmentTracker;if(!b.live&&P&&P.sn===b.endSN&&!m.nextStart){var U=I.getState(P);return U===M.FragmentState.PARTIAL||U===M.FragmentState.OK}return!1},u.onMediaAttached=function(m,b){var P=this.media=this.mediaBuffer=b.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),P.addEventListener("seeking",this.onvseeking),P.addEventListener("ended",this.onvended);var I=this.config;this.levels&&I.autoStartLoad&&this.state===S.STOPPED&&this.startLoad(I.startPosition)},u.onMediaDetaching=function(){var m=this.media;m!=null&&m.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),m&&(m.removeEventListener("seeking",this.onvseeking),m.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},u.onMediaSeeking=function(){var m=this.config,b=this.fragCurrent,P=this.media,I=this.mediaBuffer,U=this.state,F=P?P.currentTime:0,L=W.BufferHelper.bufferInfo(I||P,F,m.maxBufferHole);if(this.log("media seeking to "+(Object(z.isFiniteNumber)(F)?F.toFixed(3):F)+", state: "+U),U===S.ENDED)this.resetLoadingState();else if(b&&!L.len){var v=m.maxFragLookUpTolerance,j=b.start-v,K=b.start+b.duration+v,J=F>K;(F0&&F&&F.key&&F.iv&&F.method==="AES-128"){var L=self.performance.now();return b.decrypter.webCryptoDecrypt(new Uint8Array(U),F.key.buffer,F.iv.buffer).then(function(v){var j=self.performance.now();return I.trigger(k.Events.FRAG_DECRYPTED,{frag:m,payload:v,stats:{tstart:L,tdecrypt:j}}),P.payload=v,P})}return P}).then(function(P){var I=b.fragCurrent,U=b.hls,F=b.levels;if(!F)throw new Error("init load aborted, missing levels");var L=F[m.level].details;console.assert(L,"Level details are defined when init segment is loaded");var v=m.stats;b.state=S.IDLE,b.fragLoadError=0,m.data=new Uint8Array(P.payload),v.parsing.start=v.buffering.start=self.performance.now(),v.parsing.end=v.buffering.end=self.performance.now(),P.frag===I&&U.trigger(k.Events.FRAG_BUFFERED,{stats:v,frag:I,part:null,id:m.type}),b.tick()}).catch(function(P){b.warn(P),b.resetFragmentLoading(m)})},u.fragContextChanged=function(m){var b=this.fragCurrent;return!m||!b||m.level!==b.level||m.sn!==b.sn||m.urlId!==b.urlId},u.fragBufferedComplete=function(m,b){var P=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+m.type+" sn: "+m.sn+(b?" part: "+b.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+m.level+" "+a.default.toString(W.BufferHelper.getBuffered(P))),this.state=S.IDLE,this.tick()},u._handleFragmentLoadComplete=function(m){var b=this.transmuxer;if(!b)return;var P=m.frag,I=m.part,U=m.partsLoaded,F=!U||U.length===0||U.some(function(v){return!v}),L=new g.ChunkMetadata(P.level,P.sn,P.stats.chunkCount+1,0,I?I.index:-1,!F);b.flush(L)},u._handleFragmentLoadProgress=function(m){},u._doFragLoad=function(m,b,P,I){var U=this;if(P===void 0&&(P=null),!this.levels)throw new Error("frag load aborted, missing levels");if(P=Math.max(m.start,P||0),this.config.lowLatencyMode&&b){var F=b.partList;if(F&&I){P>m.end&&b.fragmentHint&&(m=b.fragmentHint);var L=this.getNextPart(F,m,P);if(L>-1){var v=F[L];return this.log("Loading part sn: "+m.sn+" p: "+v.index+" cc: "+m.cc+" of playlist ["+b.startSN+"-"+b.endSN+"] parts [0-"+L+"-"+(F.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+m.level+", target: "+parseFloat(P.toFixed(3))),this.nextLoadPosition=v.start+v.duration,this.state=S.FRAG_LOADING,this.hls.trigger(k.Events.FRAG_LOADING,{frag:m,part:F[L],targetBufferTime:P}),this.doFragPartsLoad(m,F,L,I).catch(function(j){return U.handleFragLoadError(j)})}else if(!m.url||this.loadedEndOfParts(F,P))return Promise.resolve(null)}}return this.log("Loading fragment "+m.sn+" cc: "+m.cc+" "+(b?"of ["+b.startSN+"-"+b.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+m.level+", target: "+parseFloat(P.toFixed(3))),Object(z.isFiniteNumber)(m.sn)&&!this.bitrateTest&&(this.nextLoadPosition=m.start+m.duration),this.state=S.FRAG_LOADING,this.hls.trigger(k.Events.FRAG_LOADING,{frag:m,targetBufferTime:P}),this.fragmentLoader.load(m,I).catch(function(j){return U.handleFragLoadError(j)})},u.doFragPartsLoad=function(m,b,P,I){var U=this;return new Promise(function(F,L){var v=[],j=function K(J){var ee=b[J];U.fragmentLoader.loadPart(m,ee,I).then(function(ve){v[ee.index]=ve;var de=ve.part;U.hls.trigger(k.Events.FRAG_LOADED,ve);var me=b[J+1];if(me&&me.fragment===m)K(J+1);else return F({frag:m,part:de,partsLoaded:v})}).catch(L)};j(P)})},u.handleFragLoadError=function(m){var b=m.data;return b&&b.details===R.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(b.frag,b.part):this.hls.trigger(k.Events.ERROR,b),null},u._handleTransmuxerFlush=function(m){var b=this.getCurrentContext(m);if(!b||this.state!==S.PARSING){this.fragCurrent||(this.state=S.IDLE);return}var P=b.frag,I=b.part,U=b.level,F=self.performance.now();P.stats.parsing.end=F,I&&(I.stats.parsing.end=F),this.updateLevelTiming(P,I,U,m.partial)},u.getCurrentContext=function(m){var b=this.levels,P=m.level,I=m.sn,U=m.part;if(!b||!b[P])return this.warn("Levels object was unset while buffering fragment "+I+" of level "+P+". The current chunk will not be buffered."),null;var F=b[P],L=U>-1?Object(o.getPartWith)(F,I,U):null,v=L?L.fragment:Object(o.getFragmentWithSN)(F,I,this.fragCurrent);return v?{frag:v,part:L,level:F}:null},u.bufferFragmentData=function(m,b,P,I){if(!m||this.state!==S.PARSING)return;var U=m.data1,F=m.data2,L=U;if(U&&F&&(L=Object(p.appendUint8Array)(U,F)),!L||!L.length)return;var v={type:m.type,frag:b,part:P,chunkMeta:I,parent:b.type,data:L};this.hls.trigger(k.Events.BUFFER_APPENDING,v),m.dropped&&m.independent&&!P&&this.flushBufferGap(b)},u.flushBufferGap=function(m){var b=this.media;if(!b)return;if(!W.BufferHelper.isBuffered(b,b.currentTime)){this.flushMainBuffer(0,m.start);return}var P=b.currentTime,I=W.BufferHelper.bufferInfo(b,P,0),U=m.duration,F=Math.min(this.config.maxFragLookUpTolerance*2,U*.25),L=Math.max(Math.min(m.start-F,I.end-F),P+F);m.start-L>F&&this.flushMainBuffer(L,m.start)},u.getFwdBufferInfo=function(m,b){var P=this.config,I=this.getLoadPosition();if(!Object(z.isFiniteNumber)(I))return null;var U=W.BufferHelper.bufferInfo(m,I,P.maxBufferHole);if(U.len===0&&U.nextStart!==void 0){var F=this.fragmentTracker.getBufferedFrag(I,b);if(F&&U.nextStart=P?(b.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+b.maxMaxBufferLength+"s"),!0):!1},u.getNextFragment=function(m,b){var P,I,U=b.fragments,F=U.length;if(!F)return null;var L=this.config,v=U[0].start,j;if(b.live){var K=L.initialLiveManifestSize;if(F-1&&PP.start&&P.loaded},u.getInitialLiveFragment=function(m,b){var P=this.fragPrevious,I=null;if(P){if(m.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+P.programDateTime),I=Object(d.findFragmentByPDT)(b,P.endProgramDateTime,this.config.maxFragLookUpTolerance)),!I){var U=P.sn+1;if(U>=m.startSN&&U<=m.endSN){var F=b[U-m.startSN];P.cc===F.cc&&(I=F,this.log("Live playlist, switching playlist, load frag with next SN: "+I.sn))}I||(I=Object(d.findFragWithCC)(b,P.cc),I&&this.log("Live playlist, switching playlist, load frag with same CC: "+I.sn))}}else{var L=this.hls.liveSyncPosition;L!==null&&(I=this.getFragmentAtPosition(L,this.bitrateTest?m.fragmentEnd:m.edge,m))}return I},u.getFragmentAtPosition=function(m,b,P){var I=this.config,U=this.fragPrevious,F=P.fragments,L=P.endSN,v=P.fragmentHint,j=I.maxFragLookUpTolerance,K=!!(I.lowLatencyMode&&P.partList&&v);K&&v&&!this.bitrateTest&&(F=F.concat(v),L=v.sn);var J;if(mb-j?0:j;J=Object(d.findFragmentByPTS)(U,F,m,ee)}else J=F[F.length-1];if(J){var ve=J.sn-P.startSN,de=U&&J.level===U.level,me=F[ve+1],ce=this.fragmentTracker.getState(J);if(ce===M.FragmentState.BACKTRACKED){J=null;for(var pe=ve;F[pe]&&this.fragmentTracker.getState(F[pe])===M.FragmentState.BACKTRACKED;)U?J=F[pe--]:J=F[--pe];J||(J=me)}else U&&J.sn===U.sn&&!K&&(de&&(J.sn=F-b.maxFragLookUpTolerance&&U<=L;if(I!==null&&P.duration>I&&(U"+m.startSN+" prev-sn: "+(U?U.sn:"na")+" fragments: "+L),J}return v},u.waitForCdnTuneIn=function(m){var b=3;return m.live&&m.canBlockReload&&m.tuneInGoal>Math.max(m.partHoldBack,m.partTarget*b)},u.setStartPosition=function(m,b){var P=this.startPosition;if(P"+m))}}]),_}(N.default)},"./src/controller/buffer-controller.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"default",function(){return d});var z=D("./src/polyfills/number.ts"),N=D("./src/events.ts"),M=D("./src/utils/logger.ts"),W=D("./src/errors.ts"),B=D("./src/utils/buffer-helper.ts"),k=D("./src/utils/mediasource-helper.ts"),R=D("./src/loader/fragment.ts"),g=D("./src/controller/buffer-operation-queue.ts"),p=Object(k.getMediaSource)(),f=/([ha]vc.)(?:\.[^.,]+)+/,d=function(){function o(s){var a=this;this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var l=a.hls,h=a.media,O=a.mediaSource;M.logger.log("[buffer-controller]: Media source opened"),h&&(a.updateMediaElementDuration(),l.trigger(N.Events.MEDIA_ATTACHED,{media:h})),O&&O.removeEventListener("sourceopen",a._onMediaSourceOpen),a.checkPendingTracks()},this._onMediaSourceClose=function(){M.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){M.logger.log("[buffer-controller]: Media source ended")},this.hls=s,this._initSourceBuffer(),this.registerListeners()}var c=o.prototype;return c.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},c.destroy=function(){this.unregisterListeners(),this.details=null},c.registerListeners=function(){var a=this.hls;a.on(N.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),a.on(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.on(N.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.on(N.Events.BUFFER_RESET,this.onBufferReset,this),a.on(N.Events.BUFFER_APPENDING,this.onBufferAppending,this),a.on(N.Events.BUFFER_CODECS,this.onBufferCodecs,this),a.on(N.Events.BUFFER_EOS,this.onBufferEos,this),a.on(N.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),a.on(N.Events.LEVEL_UPDATED,this.onLevelUpdated,this),a.on(N.Events.FRAG_PARSED,this.onFragParsed,this),a.on(N.Events.FRAG_CHANGED,this.onFragChanged,this)},c.unregisterListeners=function(){var a=this.hls;a.off(N.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),a.off(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.off(N.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.off(N.Events.BUFFER_RESET,this.onBufferReset,this),a.off(N.Events.BUFFER_APPENDING,this.onBufferAppending,this),a.off(N.Events.BUFFER_CODECS,this.onBufferCodecs,this),a.off(N.Events.BUFFER_EOS,this.onBufferEos,this),a.off(N.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),a.off(N.Events.LEVEL_UPDATED,this.onLevelUpdated,this),a.off(N.Events.FRAG_PARSED,this.onFragParsed,this),a.off(N.Events.FRAG_CHANGED,this.onFragChanged,this)},c._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new g.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},c.onManifestParsed=function(a,l){var h=2;(l.audio&&!l.video||!l.altAudio)&&(h=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=h,this.details=null,M.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},c.onMediaAttaching=function(a,l){var h=this.media=l.media;if(h&&p){var O=this.mediaSource=new p;O.addEventListener("sourceopen",this._onMediaSourceOpen),O.addEventListener("sourceended",this._onMediaSourceEnded),O.addEventListener("sourceclose",this._onMediaSourceClose),h.src=self.URL.createObjectURL(O),this._objectUrl=h.src}},c.onMediaDetaching=function(){var a=this.media,l=this.mediaSource,h=this._objectUrl;if(l){if(M.logger.log("[buffer-controller]: media source detaching"),l.readyState==="open")try{l.endOfStream()}catch(O){M.logger.warn("[buffer-controller]: onMediaDetaching: "+O.message+" while calling endOfStream")}this.onBufferReset(),l.removeEventListener("sourceopen",this._onMediaSourceOpen),l.removeEventListener("sourceended",this._onMediaSourceEnded),l.removeEventListener("sourceclose",this._onMediaSourceClose),a&&(h&&self.URL.revokeObjectURL(h),a.src===h?(a.removeAttribute("src"),a.load()):M.logger.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(N.Events.MEDIA_DETACHED,void 0)},c.onBufferReset=function(){var a=this;this.getSourceBufferTypes().forEach(function(l){var h=a.sourceBuffer[l];try{h&&(a.removeBufferListeners(l),a.mediaSource&&a.mediaSource.removeSourceBuffer(h),a.sourceBuffer[l]=void 0)}catch(O){M.logger.warn("[buffer-controller]: Failed to reset the "+l+" buffer",O)}}),this._initSourceBuffer()},c.onBufferCodecs=function(a,l){var h=this,O=this.getSourceBufferTypes().length;if(Object.keys(l).forEach(function(w){if(O){var x=h.tracks[w];if(x&&typeof x.buffer.changeType=="function"){var A=l[w],S=A.codec,T=A.levelCodec,E=A.container,_=(x.levelCodec||x.codec).replace(f,"$1"),u=(T||S).replace(f,"$1");if(_!==u){var y=E+";codecs="+(T||S);h.appendChangeType(w,y)}}}else h.pendingTracks[w]=l[w]}),O)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},c.appendChangeType=function(a,l){var h=this,O=this.operationQueue,w={execute:function(){var A=h.sourceBuffer[a];A&&(M.logger.log("[buffer-controller]: changing "+a+" sourceBuffer type to "+l),A.changeType(l)),O.shiftAndExecuteNext(a)},onStart:function(){},onComplete:function(){},onError:function(A){M.logger.warn("[buffer-controller]: Failed to change "+a+" SourceBuffer type",A)}};O.append(w,a)},c.onBufferAppending=function(a,l){var h=this,O=this.hls,w=this.operationQueue,x=this.tracks,A=l.data,S=l.type,T=l.frag,E=l.part,_=l.chunkMeta,u=_.buffering[S],y=self.performance.now();u.start=y;var m=T.stats.buffering,b=E?E.stats.buffering:null;m.start===0&&(m.start=y),b&&b.start===0&&(b.start=y);var P=x.audio,I=S==="audio"&&_.id===1&&(P==null?void 0:P.container)==="audio/mpeg",U={execute:function(){if(u.executeStart=self.performance.now(),I){var L=h.sourceBuffer[S];if(L){var v=T.start-L.timestampOffset;Math.abs(v)>=.1&&(M.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+T.start+" (delta: "+v+") sn: "+T.sn+")"),L.timestampOffset=T.start)}}h.appendExecutor(A,S)},onStart:function(){},onComplete:function(){var L=self.performance.now();u.executeEnd=u.end=L,m.first===0&&(m.first=L),b&&b.first===0&&(b.first=L);var v=h.sourceBuffer,j={};for(var K in v)j[K]=B.BufferHelper.getBuffered(v[K]);h.appendError=0,h.hls.trigger(N.Events.BUFFER_APPENDED,{type:S,frag:T,part:E,chunkMeta:_,parent:T.type,timeRanges:j})},onError:function(L){M.logger.error("[buffer-controller]: Error encountered while trying to append to the "+S+" SourceBuffer",L);var v={type:W.ErrorTypes.MEDIA_ERROR,parent:T.type,details:W.ErrorDetails.BUFFER_APPEND_ERROR,err:L,fatal:!1};L.code===DOMException.QUOTA_EXCEEDED_ERR?v.details=W.ErrorDetails.BUFFER_FULL_ERROR:(h.appendError++,v.details=W.ErrorDetails.BUFFER_APPEND_ERROR,h.appendError>O.config.appendErrorMaxRetry&&(M.logger.error("[buffer-controller]: Failed "+O.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),v.fatal=!0)),O.trigger(N.Events.ERROR,v)}};w.append(U,S)},c.onBufferFlushing=function(a,l){var h=this,O=this.operationQueue,w=function(A){return{execute:h.removeExecutor.bind(h,A,l.startOffset,l.endOffset),onStart:function(){},onComplete:function(){h.hls.trigger(N.Events.BUFFER_FLUSHED,{type:A})},onError:function(T){M.logger.warn("[buffer-controller]: Failed to remove from "+A+" SourceBuffer",T)}}};l.type?O.append(w(l.type),l.type):this.getSourceBufferTypes().forEach(function(x){O.append(w(x),x)})},c.onFragParsed=function(a,l){var h=this,O=l.frag,w=l.part,x=[],A=w?w.elementaryStreams:O.elementaryStreams;A[R.ElementaryStreamTypes.AUDIOVIDEO]?x.push("audiovideo"):(A[R.ElementaryStreamTypes.AUDIO]&&x.push("audio"),A[R.ElementaryStreamTypes.VIDEO]&&x.push("video"));var S=function(){var E=self.performance.now();O.stats.buffering.end=E,w&&(w.stats.buffering.end=E);var _=w?w.stats:O.stats;h.hls.trigger(N.Events.FRAG_BUFFERED,{frag:O,part:w,stats:_,id:O.type})};x.length===0&&M.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+O.type+" level: "+O.level+" sn: "+O.sn),this.blockBuffers(S,x)},c.onFragChanged=function(a,l){this.flushBackBuffer()},c.onBufferEos=function(a,l){var h=this,O=this.getSourceBufferTypes().reduce(function(w,x){var A=h.sourceBuffer[x];return(!l.type||l.type===x)&&(A&&!A.ended&&(A.ended=!0,M.logger.log("[buffer-controller]: "+x+" sourceBuffer now EOS"))),w&&!!(!A||A.ended)},!0);O&&this.blockBuffers(function(){var w=h.mediaSource;if(!w||w.readyState!=="open")return;w.endOfStream()})},c.onLevelUpdated=function(a,l){var h=l.details;if(!h.fragments.length)return;this.details=h,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},c.flushBackBuffer=function(){var a=this.hls,l=this.details,h=this.media,O=this.sourceBuffer;if(!h||l===null)return;var w=this.getSourceBufferTypes();if(!w.length)return;var x=l.live&&a.config.liveBackBufferLength!==null?a.config.liveBackBufferLength:a.config.backBufferLength;if(!Object(z.isFiniteNumber)(x)||x<0)return;var A=h.currentTime,S=l.levelTargetDuration,T=Math.max(x,S),E=Math.floor(A/S)*S-T;w.forEach(function(_){var u=O[_];if(u){var y=B.BufferHelper.getBuffered(u);y.length>0&&E>y.start(0)&&(a.trigger(N.Events.BACK_BUFFER_REACHED,{bufferEnd:E}),l.live&&a.trigger(N.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:E}),a.trigger(N.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:E,type:_}))}})},c.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var a=this.details,l=this.hls,h=this.media,O=this.mediaSource,w=a.fragments[0].start+a.totalduration,x=h.duration,A=Object(z.isFiniteNumber)(O.duration)?O.duration:0;a.live&&l.config.liveDurationInfinity?(M.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),O.duration=Infinity,this.updateSeekableRange(a)):(w>A&&w>x||!Object(z.isFiniteNumber)(x))&&(M.logger.log("[buffer-controller]: Updating Media Source duration to "+w.toFixed(3)),O.duration=w)},c.updateSeekableRange=function(a){var l=this.mediaSource,h=a.fragments,O=h.length;if(O&&a.live&&l!==null&&l!==void 0&&l.setLiveSeekableRange){var w=Math.max(0,h[0].start),x=Math.max(w,w+a.totalduration);l.setLiveSeekableRange(w,x)}},c.checkPendingTracks=function(){var a=this.bufferCodecEventsExpected,l=this.operationQueue,h=this.pendingTracks,O=Object.keys(h).length;if(O&&!a||O===2){this.createSourceBuffers(h),this.pendingTracks={};var w=this.getSourceBufferTypes();if(w.length===0){this.hls.trigger(N.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}w.forEach(function(x){l.executeNext(x)})}},c.createSourceBuffers=function(a){var l=this.sourceBuffer,h=this.mediaSource;if(!h)throw Error("createSourceBuffers called when mediaSource was null");var O=0;for(var w in a)if(!l[w]){var x=a[w];if(!x)throw Error("source buffer exists for track "+w+", however track does not");var A=x.levelCodec||x.codec,S=x.container+";codecs="+A;M.logger.log("[buffer-controller]: creating sourceBuffer("+S+")");try{var T=l[w]=h.addSourceBuffer(S),E=w;this.addBufferListener(E,"updatestart",this._onSBUpdateStart),this.addBufferListener(E,"updateend",this._onSBUpdateEnd),this.addBufferListener(E,"error",this._onSBUpdateError),this.tracks[w]={buffer:T,codec:A,container:x.container,levelCodec:x.levelCodec,id:x.id},O++}catch(_){M.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+_.message),this.hls.trigger(N.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:_,mimeType:S})}}O&&this.hls.trigger(N.Events.BUFFER_CREATED,{tracks:this.tracks})},c._onSBUpdateStart=function(a){var l=this.operationQueue,h=l.current(a);h.onStart()},c._onSBUpdateEnd=function(a){var l=this.operationQueue,h=l.current(a);h.onComplete(),l.shiftAndExecuteNext(a)},c._onSBUpdateError=function(a,l){M.logger.error("[buffer-controller]: "+a+" SourceBuffer error",l),this.hls.trigger(N.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var h=this.operationQueue.current(a);h&&h.onError(l)},c.removeExecutor=function(a,l,h){var O=this.media,w=this.mediaSource,x=this.operationQueue,A=this.sourceBuffer,S=A[a];if(!O||!w||!S){M.logger.warn("[buffer-controller]: Attempting to remove from the "+a+" SourceBuffer, but it does not exist"),x.shiftAndExecuteNext(a);return}var T=Object(z.isFiniteNumber)(O.duration)?O.duration:Infinity,E=Object(z.isFiniteNumber)(w.duration)?w.duration:Infinity,_=Math.max(0,l),u=Math.min(h,T,E);u>_?(M.logger.log("[buffer-controller]: Removing ["+_+","+u+"] from the "+a+" SourceBuffer"),console.assert(!S.updating,a+" sourceBuffer must not be updating"),S.remove(_,u)):x.shiftAndExecuteNext(a)},c.appendExecutor=function(a,l){var h=this.operationQueue,O=this.sourceBuffer,w=O[l];if(!w){M.logger.warn("[buffer-controller]: Attempting to append to the "+l+" SourceBuffer, but it does not exist"),h.shiftAndExecuteNext(l);return}w.ended=!1,console.assert(!w.updating,l+" sourceBuffer must not be updating"),w.appendBuffer(a)},c.blockBuffers=function(a,l){var h=this;if(l===void 0&&(l=this.getSourceBufferTypes()),!l.length){M.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(a);return}var O=this.operationQueue,w=l.map(function(x){return O.appendBlocker(x)});Promise.all(w).then(function(){a(),l.forEach(function(x){var A=h.sourceBuffer[x];(!A||!A.updating)&&O.shiftAndExecuteNext(x)})})},c.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},c.addBufferListener=function(a,l,h){var O=this.sourceBuffer[a];if(!O)return;var w=h.bind(this,a);this.listeners[a].push({event:l,listener:w}),O.addEventListener(l,w)},c.removeBufferListeners=function(a){var l=this.sourceBuffer[a];if(!l)return;this.listeners[a].forEach(function(h){l.removeEventListener(h.event,h.listener)})},o}()},"./src/controller/buffer-operation-queue.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"default",function(){return N});var z=D("./src/utils/logger.ts"),N=function(){function M(B){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=B}var W=M.prototype;return W.append=function(k,R){var g=this.queues[R];g.push(k),g.length===1&&this.buffers[R]&&this.executeNext(R)},W.insertAbort=function(k,R){var g=this.queues[R];g.unshift(k),this.executeNext(R)},W.appendBlocker=function(k){var R,g=new Promise(function(f){R=f}),p={execute:R,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(p,k),g},W.executeNext=function(k){var R=this.buffers,g=this.queues,p=R[k],f=g[k];if(f.length){var d=f[0];try{d.execute()}catch(o){z.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),d.onError(o),(!p||!p.updating)&&(f.shift(),this.executeNext(k))}}},W.shiftAndExecuteNext=function(k){this.queues[k].shift(),this.executeNext(k)},W.current=function(k){return this.queues[k][0]},M}()},"./src/controller/cap-level-controller.ts":function(ne,V,D){"use strict";D.r(V);var z=D("./src/events.ts");function N(B,k){for(var R=0;R0&&this.mediaWidth>0){var g=this.hls.levels;if(g.length){var p=this.hls;p.autoLevelCapping=this.getMaxLevel(g.length-1),p.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=p.autoLevelCapping}}},k.getMaxLevel=function(g){var p=this,f=this.hls.levels;if(!f.length)return-1;var d=f.filter(function(o,c){return B.isLevelAllowed(c,p.restrictedLevels)&&c<=g});return this.clientRect=null,B.getMaxLevelByMediaSize(d,this.mediaWidth,this.mediaHeight)},k.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()},k.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},k.getDimensions=function(){if(this.clientRect)return this.clientRect;var g=this.media,p={width:0,height:0};if(g){var f=g.getBoundingClientRect();p.width=f.width,p.height=f.height,!p.width&&!p.height&&(p.width=f.right-f.left||g.width||0,p.height=f.bottom-f.top||g.height||0)}return this.clientRect=p,p},B.isLevelAllowed=function(g,p){return p===void 0&&(p=[]),p.indexOf(g)===-1},B.getMaxLevelByMediaSize=function(g,p,f){if(!g||!g.length)return-1;for(var d=function(l,h){return h?l.width!==h.width||l.height!==h.height:!0},o=g.length-1,c=0;c=p||s.height>=f)&&d(s,g[c+1])){o=c;break}}return o},M(B,[{key:"mediaWidth",get:function(){return this.getDimensions().width*B.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*B.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var g=1;try{g=self.devicePixelRatio}catch(p){}return g}}]),B}();V.default=W},"./src/controller/cmcd-controller.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"default",function(){return d});var z=D("./src/events.ts"),N=D("./src/types/cmcd.ts"),M=D("./src/utils/buffer-helper.ts"),W=D("./src/utils/logger.ts");function B(o,c){for(var s=0;s=o.length?{done:!0}:{done:!1,value:o[a++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function g(o,c){if(!o)return;if(typeof o=="string")return p(o,c);var s=Object.prototype.toString.call(o).slice(8,-1);if(s==="Object"&&o.constructor&&(s=o.constructor.name),s==="Map"||s==="Set")return Array.from(o);if(s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return p(o,c)}function p(o,c){(c==null||c>o.length)&&(c=o.length);for(var s=0,a=new Array(c);sl&&(l=x.bitrate)}return l>0?l:NaN},c.getBufferLength=function(a){var l=this.hls.media,h=a===N.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!h||!l)return NaN;var O=M.BufferHelper.bufferInfo(h,l.currentTime,this.config.maxBufferHole);return O.len*1e3},c.createPlaylistLoader=function(){var a=this.config.pLoader,l=this.applyPlaylistData,h=a||this.config.loader;return function(){function O(x){this.loader=void 0,this.loader=new h(x)}var w=O.prototype;return w.destroy=function(){this.loader.destroy()},w.abort=function(){this.loader.abort()},w.load=function(A,S,T){l(A),this.loader.load(A,S,T)},k(O,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),O}()},c.createFragmentLoader=function(){var a=this.config.fLoader,l=this.applyFragmentData,h=a||this.config.loader;return function(){function O(x){this.loader=void 0,this.loader=new h(x)}var w=O.prototype;return w.destroy=function(){this.loader.destroy()},w.abort=function(){this.loader.abort()},w.load=function(A,S,T){l(A),this.loader.load(A,S,T)},k(O,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),O}()},o.uuid=function(){var a=URL.createObjectURL(new Blob),l=a.toString();return URL.revokeObjectURL(a),l.substr(l.lastIndexOf("/")+1)},o.serialize=function(a){for(var l=[],h=function(I){return!Number.isNaN(I)&&I!=null&&I!==""&&I!==!1},O=function(I){return Math.round(I)},w=function(I){return O(I/100)*100},x=function(I){return encodeURIComponent(I)},A={br:O,d:O,bl:w,dl:w,mtp:w,nor:x,rtp:w,tb:O},S=Object.keys(a||{}).sort(),T=R(S),E;!(E=T()).done;){var _=E.value,u=a[_];if(!h(u))continue;if(_==="v"&&u===1)continue;if(_=="pr"&&u===1)continue;var y=A[_];y&&(u=y(u));var m=typeof u,b=void 0;_==="ot"||_==="sf"||_==="st"?b=_+"="+u:m==="boolean"?b=_:m==="number"?b=_+"="+u:b=_+"="+JSON.stringify(u),l.push(b)}return l.join(",")},o.toHeaders=function(a){for(var l=Object.keys(a),h={},O=["Object","Request","Session","Status"],w=[{},{},{},{}],x={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},A=0,S=l;AR){this.hls.trigger(z.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var x=R-this._requestLicenseFailureCount+1;M.logger.warn("Retrying license request, "+x+" attempts left"),this._requestLicense(l,h)}break}},o._generateLicenseRequestChallenge=function(s,a){switch(s.mediaKeySystemDomain){case W.KeySystems.WIDEVINE:return a}throw new Error("unsupported key-system: "+s.mediaKeySystemDomain)},o._requestLicense=function(s,a){M.logger.log("Requesting content license for key-system");var l=this._mediaKeysList[0];if(!l){M.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(z.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var h=this.getLicenseServerUrl(l.mediaKeySystemDomain),O=this._createLicenseXhr(h,s,a);M.logger.log("Sending license request to URL: "+h);var w=this._generateLicenseRequestChallenge(l,s);O.send(w)}catch(x){M.logger.error("Failure requesting DRM license: "+x),this.hls.trigger(z.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},o.onMediaAttached=function(s,a){if(!this._emeEnabled)return;var l=a.media;this._media=l,l.addEventListener("encrypted",this._onMediaEncrypted)},o.onMediaDetached=function(){var s=this._media,a=this._mediaKeysList;if(!s)return;s.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(a.map(function(l){if(l.mediaKeysSession)return l.mediaKeysSession.close().catch(function(){})})).then(function(){return s.setMediaKeys(null)}).catch(function(){})},o.onManifestParsed=function(s,a){if(!this._emeEnabled)return;var l=a.levels.map(function(O){return O.audioCodec}).filter(function(O){return!!O}),h=a.levels.map(function(O){return O.videoCodec}).filter(function(O){return!!O});this._attemptKeySystemAccess(W.KeySystems.WIDEVINE,l,h)},k(d,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),d}();V.default=f},"./src/controller/fps-controller.ts":function(ne,V,D){"use strict";D.r(V);var z=D("./src/events.ts"),N=D("./src/utils/logger.ts"),M=function(){function W(k){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=k,this.registerListeners()}var B=W.prototype;return B.setStreamController=function(R){this.streamController=R},B.registerListeners=function(){this.hls.on(z.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},B.unregisterListeners=function(){this.hls.off(z.Events.MEDIA_ATTACHING,this.onMediaAttaching)},B.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},B.onMediaAttaching=function(R,g){var p=this.hls.config;if(p.capLevelOnFPSDrop){var f=g.media instanceof self.HTMLVideoElement?g.media:null;this.media=f,f&&typeof f.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),p.fpsDroppedMonitoringPeriod)}},B.checkFPS=function(R,g,p){var f=performance.now();if(g){if(this.lastTime){var d=f-this.lastTime,o=p-this.lastDroppedFrames,c=g-this.lastDecodedFrames,s=1e3*o/d,a=this.hls;if(a.trigger(z.Events.FPS_DROP,{currentDropped:o,currentDecoded:c,totalDroppedFrames:p}),s>0&&o>a.config.fpsDroppedMonitoringThreshold*c){var l=a.currentLevel;N.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+l),l>0&&(a.autoLevelCapping===-1||a.autoLevelCapping>=l)&&(l=l-1,a.trigger(z.Events.FPS_DROP_LEVEL_CAPPING,{level:l,droppedLevel:a.currentLevel}),a.autoLevelCapping=l,this.streamController.nextLevelSwitch())}}this.lastTime=f,this.lastDroppedFrames=p,this.lastDecodedFrames=g}},B.checkFPSInterval=function(){var R=this.media;if(R)if(this.isVideoPlaybackQualityAvailable){var g=R.getVideoPlaybackQuality();this.checkFPS(R,g.totalVideoFrames,g.droppedVideoFrames)}else this.checkFPS(R,R.webkitDecodedFrameCount,R.webkitDroppedFrameCount)},W}();V.default=M},"./src/controller/fragment-finders.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"findFragmentByPDT",function(){return M}),D.d(V,"findFragmentByPTS",function(){return W}),D.d(V,"fragmentWithinToleranceTest",function(){return B}),D.d(V,"pdtWithinToleranceTest",function(){return k}),D.d(V,"findFragWithCC",function(){return R});var z=D("./src/polyfills/number.ts"),N=D("./src/utils/binary-search.ts");function M(g,p,f){if(p===null||!Array.isArray(g)||!g.length||!Object(z.isFiniteNumber)(p))return null;var d=g[0].programDateTime;if(p<(d||0))return null;var o=g[g.length-1].endProgramDateTime;if(p>=(o||0))return null;f=f||0;for(var c=0;cg&&f.start?-1:0}function k(g,p,f){var d=Math.min(p,f.duration+(f.deltaPTS?f.deltaPTS:0))*1e3,o=f.endProgramDateTime||0;return o-d>g}function R(g,p){return N.default.search(g,function(f){return f.ccp?-1:0})}},"./src/controller/fragment-tracker.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"FragmentState",function(){return M}),D.d(V,"FragmentTracker",function(){return W});var z=D("./src/events.ts"),N=D("./src/types/loader.ts"),M;(function(R){R.NOT_LOADED="NOT_LOADED",R.BACKTRACKED="BACKTRACKED",R.APPENDING="APPENDING",R.PARTIAL="PARTIAL",R.OK="OK"})(M||(M={}));var W=function(){function R(p){this.activeFragment=null,this.activeParts=null,this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hls=p,this._registerListeners()}var g=R.prototype;return g._registerListeners=function(){var f=this.hls;f.on(z.Events.BUFFER_APPENDED,this.onBufferAppended,this),f.on(z.Events.FRAG_BUFFERED,this.onFragBuffered,this),f.on(z.Events.FRAG_LOADED,this.onFragLoaded,this)},g._unregisterListeners=function(){var f=this.hls;f.off(z.Events.BUFFER_APPENDED,this.onBufferAppended,this),f.off(z.Events.FRAG_BUFFERED,this.onFragBuffered,this),f.off(z.Events.FRAG_LOADED,this.onFragLoaded,this)},g.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},g.getAppendedFrag=function(f,d){if(d===N.PlaylistLevelType.MAIN){var o=this.activeFragment,c=this.activeParts;if(!o)return null;if(c)for(var s=c.length;s--;){var a=c[s],l=a?a.end:o.appendedPTS;if(a.start<=f&&l!==void 0&&f<=l)return s>9&&(this.activeParts=c.slice(s-9)),a}else if(o.start<=f&&o.appendedPTS!==void 0&&f<=o.appendedPTS)return o}return this.getBufferedFrag(f,d)},g.getBufferedFrag=function(f,d){for(var o=this.fragments,c=Object.keys(o),s=c.length;s--;){var a=o[c[s]];if((a==null?void 0:a.body.type)===d&&a.buffered){var l=a.body;if(l.start<=f&&f<=l.end)return l}}return null},g.detectEvictedFragments=function(f,d,o){var c=this;Object.keys(this.fragments).forEach(function(s){var a=c.fragments[s];if(!a)return;if(!a.buffered){a.body.type===o&&c.removeFragment(a.body);return}var l=a.range[f];if(!l)return;l.time.some(function(h){var O=!c.isTimeBuffered(h.startPTS,h.endPTS,d);return O&&c.removeFragment(a.body),O})})},g.detectPartialFragments=function(f){var d=this,o=this.timeRanges,c=f.frag,s=f.part;if(!o||c.sn==="initSegment")return;var a=k(c),l=this.fragments[a];if(!l)return;Object.keys(o).forEach(function(h){var O=c.elementaryStreams[h];if(!O)return;var w=o[h],x=s!==null||O.partial===!0;l.range[h]=d.getBufferedTimes(c,s,x,w)}),l.backtrack=l.loaded=null,Object.keys(l.range).length?l.buffered=!0:this.removeFragment(l.body)},g.fragBuffered=function(f){var d=k(f),o=this.fragments[d];o&&(o.backtrack=o.loaded=null,o.buffered=!0)},g.getBufferedTimes=function(f,d,o,c){for(var s={time:[],partial:o},a=d?d.start:f.start,l=d?d.end:f.end,h=f.minEndPTS||l,O=f.maxStartPTS||a,w=0;w=x&&h<=A){s.time.push({startPTS:Math.max(a,c.start(w)),endPTS:Math.min(l,c.end(w))});break}else if(ax)s.partial=!0,s.time.push({startPTS:Math.max(a,c.start(w)),endPTS:Math.min(l,c.end(w))});else if(l<=x)break}return s},g.getPartialFragment=function(f){var d=null,o,c,s,a=0,l=this.bufferPadding,h=this.fragments;return Object.keys(h).forEach(function(O){var w=h[O];if(!w)return;B(w)&&(c=w.body.start-l,s=w.body.end+l,f>=c&&f<=s&&(o=Math.min(f-c,s-f),a<=o&&(d=w.body,a=o)))}),d},g.getState=function(f){var d=k(f),o=this.fragments[d];return o?o.buffered?B(o)?M.PARTIAL:M.OK:o.backtrack?M.BACKTRACKED:M.APPENDING:M.NOT_LOADED},g.backtrack=function(f,d){var o=k(f),c=this.fragments[o];if(!c||c.backtrack)return null;var s=c.backtrack=d||c.loaded;return c.loaded=null,s},g.getBacktrackData=function(f){var d=k(f),o=this.fragments[d];if(o){var c,s=o.backtrack;if(s!=null&&(c=s.payload)!==null&&c!==void 0&&c.byteLength)return s;this.removeFragment(f)}return null},g.isTimeBuffered=function(f,d,o){for(var c,s,a=0;a=c&&d<=s)return!0;if(d<=c)return!1}return!1},g.onFragLoaded=function(f,d){var o=d.frag,c=d.part;if(o.sn==="initSegment"||o.bitrateTest||c)return;var s=k(o);this.fragments[s]={body:o,loaded:d,backtrack:null,buffered:!1,range:Object.create(null)}},g.onBufferAppended=function(f,d){var o=this,c=d.frag,s=d.part,a=d.timeRanges;if(c.type===N.PlaylistLevelType.MAIN)if(this.activeFragment=c,s){var l=this.activeParts;l||(this.activeParts=l=[]),l.push(s)}else this.activeParts=null;this.timeRanges=a,Object.keys(a).forEach(function(h){var O=a[h];if(o.detectEvictedFragments(h,O),!s)for(var w=0;wf&&c.removeFragment(l)}})},g.removeFragment=function(f){var d=k(f);f.stats.loaded=0,f.clearElementaryStreamInfo(),delete this.fragments[d]},g.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},R}();function B(R){var g,p;return R.buffered&&(((g=R.range.video)===null||g===void 0?void 0:g.partial)||((p=R.range.audio)===null||p===void 0?void 0:p.partial))}function k(R){return R.type+"_"+R.level+"_"+R.urlId+"_"+R.sn}},"./src/controller/gap-controller.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"STALL_MINIMUM_DURATION_MS",function(){return B}),D.d(V,"MAX_START_GAP_JUMP",function(){return k}),D.d(V,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return R}),D.d(V,"SKIP_BUFFER_RANGE_START",function(){return g}),D.d(V,"default",function(){return p});var z=D("./src/utils/buffer-helper.ts"),N=D("./src/errors.ts"),M=D("./src/events.ts"),W=D("./src/utils/logger.ts"),B=250,k=2,R=.1,g=.05,p=function(){function f(o,c,s,a){this.config=void 0,this.media=void 0,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=o,this.media=c,this.fragmentTracker=s,this.hls=a}var d=f.prototype;return d.destroy=function(){this.hls=this.fragmentTracker=this.media=null},d.poll=function(c){var s=this.config,a=this.media,l=this.stalled,h=a.currentTime,O=a.seeking,w=this.seeking&&!O,x=!this.seeking&&O;if(this.seeking=O,h!==c){if(this.moved=!0,l!==null){if(this.stallReported){var A=self.performance.now()-l;W.logger.warn("playback not stuck anymore @"+h+", after "+Math.round(A)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((x||w)&&(this.stalled=null),a.paused||a.ended||a.playbackRate===0||!z.BufferHelper.getBuffered(a).length)return;var S=z.BufferHelper.bufferInfo(a,h,0),T=S.len>0,E=S.nextStart||0;if(!T&&!E)return;if(O){var _=S.len>k,u=!E||E-h>k&&!this.fragmentTracker.getPartialFragment(h);if(_||u)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var y,m=Math.max(E,S.start||0)-h,b=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,P=b==null||((y=b.details)===null||y===void 0)?void 0:y.live,I=P?b.details.targetduration*2:k;if(m>0&&m<=I){this._trySkipBufferHole(null);return}}var U=self.performance.now();if(l===null){this.stalled=U;return}var F=U-l;!O&&F>=B&&this._reportStall(S.len);var L=z.BufferHelper.bufferInfo(a,h,s.maxBufferHole);this._tryFixBufferStall(L,F)},d._tryFixBufferStall=function(c,s){var a=this.config,l=this.fragmentTracker,h=this.media,O=h.currentTime,w=l.getPartialFragment(O);if(w){var x=this._trySkipBufferHole(w);if(x)return}c.len>a.maxBufferHole&&s>a.highBufferWatchdogPeriod*1e3&&(W.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},d._reportStall=function(c){var s=this.hls,a=this.media,l=this.stallReported;l||(this.stallReported=!0,W.logger.warn("Playback stalling at @"+a.currentTime+" due to low buffer (buffer="+c+")"),s.trigger(M.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:c}))},d._trySkipBufferHole=function(c){for(var s=this.config,a=this.hls,l=this.media,h=l.currentTime,O=0,w=z.BufferHelper.getBuffered(l),x=0;x=O&&h.05&&this.forwardBufferLength>1){var x=Math.min(2,Math.max(1,a)),A=Math.round(2/(1+Math.exp(-.75*h-this.edgeStalled))*20)/20;f.playbackRate=Math.min(x,Math.max(1,A))}else f.playbackRate!==1&&f.playbackRate!==0&&(f.playbackRate=1)},g.estimateLiveEdge=function(){var f=this.levelDetails;return f===null?null:f.edge+f.age},g.computeLatency=function(){var f=this.estimateLiveEdge();return f===null?null:f-this.currentTime},B(R,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var f=this.config,d=this.levelDetails;return f.liveMaxLatencyDuration!==void 0?f.liveMaxLatencyDuration:d?f.liveMaxLatencyDurationCount*d.targetduration:0}},{key:"targetLatency",get:function(){var f=this.levelDetails;if(f===null)return null;var d=f.holdBack,o=f.partHoldBack,c=f.targetduration,s=this.config,a=s.liveSyncDuration,l=s.liveSyncDurationCount,h=s.lowLatencyMode,O=this.hls.userConfig,w=h&&o||d;(O.liveSyncDuration||O.liveSyncDurationCount||w===0)&&(w=a!==void 0?a:l*c);var x=c,A=1;return w+Math.min(this.stallCount*A,x)}},{key:"liveSyncPosition",get:function(){var f=this.estimateLiveEdge(),d=this.targetLatency,o=this.levelDetails;if(f===null||d===null||o===null)return null;var c=o.edge,s=f-d-this.edgeStalled,a=c-o.totalduration,l=c-(this.config.lowLatencyMode&&o.partTarget||o.targetduration);return Math.min(Math.max(a,s),l)}},{key:"drift",get:function(){var f=this.levelDetails;return f===null?1:f.drift}},{key:"edgeStalled",get:function(){var f=this.levelDetails;if(f===null)return 0;var d=(this.config.lowLatencyMode&&f.partTarget||f.targetduration)*3;return Math.max(f.age-d,0)}},{key:"forwardBufferLength",get:function(){var f=this.media,d=this.levelDetails;if(!f||!d)return 0;var o=f.buffered.length;return o?f.buffered.end(o-1):d.edge-this.currentTime}}]),R}()},"./src/controller/level-controller.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"default",function(){return s});var z=D("./src/types/level.ts"),N=D("./src/events.ts"),M=D("./src/errors.ts"),W=D("./src/utils/codecs.ts"),B=D("./src/controller/level-helper.ts"),k=D("./src/controller/base-playlist-controller.ts"),R=D("./src/types/loader.ts");function g(){return g=Object.assign||function(a){for(var l=1;l0){E=A[0].bitrate,A.sort(function(F,L){return F.bitrate-L.bitrate}),this._levels=A;for(var P=0;Pthis.hls.config.fragLoadingMaxRetry&&(_=x.frag.level)):_=x.frag.level}break;case M.ErrorDetails.LEVEL_LOAD_ERROR:case M.ErrorDetails.LEVEL_LOAD_TIMEOUT:A&&(A.deliveryDirectives&&(E=!1),_=A.level),T=!0;break;case M.ErrorDetails.REMUX_ALLOC_ERROR:_=x.level,T=!0;break}_!==void 0&&this.recoverLevel(x,_,T,E)},h.recoverLevel=function(w,x,A,S){var T=w.details,E=this._levels[x];if(E.loadError++,A){var _=this.retryLoadingOrFail(w);if(_)w.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(S){var u=E.url.length;if(u>1&&E.loadError1){var S=(x.urlId+1)%A;this.warn("Switching to redundant URL-id "+S),this._levels.forEach(function(T){T.urlId=S}),this.level=w}},h.onFragLoaded=function(w,x){var A=x.frag;if(A!==void 0&&A.type===R.PlaylistLevelType.MAIN){var S=this._levels[A.level];S!==void 0&&(S.fragmentError=0,S.loadError=0)}},h.onLevelLoaded=function(w,x){var A,S=x.level,T=x.details,E=this._levels[S];if(!E){var _;this.warn("Invalid level index "+S),(_=x.deliveryDirectives)!==null&&_!==void 0&&_.skip&&(T.deltaUpdateFailed=!0);return}S===this.currentLevelIndex?(E.fragmentError===0&&(E.loadError=0,this.retryCount=0),this.playlistLoaded(S,x,E.details)):(A=x.deliveryDirectives)!==null&&A!==void 0&&A.skip&&(T.deltaUpdateFailed=!0)},h.onAudioTrackSwitched=function(w,x){var A=this.hls.levels[this.currentLevelIndex];if(!A)return;if(A.audioGroupIds){for(var S=-1,T=this.hls.audioTracks[x.id].groupId,E=0;E0){var S=A.urlId,T=A.url[S];if(w)try{T=w.addDirectives(T)}catch(E){this.warn("Could not construct new URL with HLS Delivery Directives: "+E)}this.log("Attempt loading level index "+x+(w?" at sn "+w.msn+" part "+w.part:"")+" with URL-id "+S+" "+T),this.clearTimer(),this.hls.trigger(N.Events.LEVEL_LOADING,{url:T,level:x,id:S,deliveryDirectives:w||null})}},h.removeLevel=function(w,x){var A=function(E,_){return _!==x},S=this._levels.filter(function(T,E){return E!==w?!0:T.url.length>1&&x!==void 0?(T.url=T.url.filter(A),T.audioGroupIds&&(T.audioGroupIds=T.audioGroupIds.filter(A)),T.textGroupIds&&(T.textGroupIds=T.textGroupIds.filter(A)),T.urlId=0,!0):!1}).map(function(T,E){var _=T.details;return _!=null&&_.fragments&&_.fragments.forEach(function(u){u.level=E}),T});this._levels=S,this.hls.trigger(N.Events.LEVELS_UPDATED,{levels:S})},f(l,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(w){var x,A=this._levels;if(A.length===0)return;if(this.currentLevelIndex===w&&(x=A[w])!==null&&x!==void 0&&x.details)return;if(w<0||w>=A.length){var S=w<0;if(this.hls.trigger(N.Events.ERROR,{type:M.ErrorTypes.OTHER_ERROR,details:M.ErrorDetails.LEVEL_SWITCH_ERROR,level:w,fatal:S,reason:"invalid level idx"}),S)return;w=Math.min(w,A.length-1)}this.clearTimer();var T=this.currentLevelIndex,E=A[T],_=A[w];this.log("switching to level "+w+" from "+T),this.currentLevelIndex=w;var u=g({},_,{level:w,maxBitrate:_.maxBitrate,uri:_.uri,urlId:_.urlId});delete u._urlId,this.hls.trigger(N.Events.LEVEL_SWITCHING,u);var y=_.details;if(!y||y.live){var m=this.switchParams(_.uri,E==null?void 0:E.details);this.loadPlaylist(m)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(w){this.manualLevelIndex=w,this._startLevel===void 0&&(this._startLevel=w),w!==-1&&(this.level=w)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(w){this._firstLevel=w}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var w=this.hls.config.startLevel;return w!==void 0?w:this._firstLevel}else return this._startLevel},set:function(w){this._startLevel=w}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(w){this.level=w,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=w)}}]),l}(k.default)},"./src/controller/level-helper.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"addGroupId",function(){return M}),D.d(V,"assignTrackIdsByGroup",function(){return W}),D.d(V,"updatePTS",function(){return B}),D.d(V,"updateFragPTSDTS",function(){return R}),D.d(V,"mergeDetails",function(){return g}),D.d(V,"mapPartIntersection",function(){return p}),D.d(V,"mapFragmentIntersection",function(){return f}),D.d(V,"adjustSliding",function(){return d}),D.d(V,"addSliding",function(){return o}),D.d(V,"computeReloadInterval",function(){return c}),D.d(V,"getFragmentWithSN",function(){return s}),D.d(V,"getPartWith",function(){return a});var z=D("./src/polyfills/number.ts"),N=D("./src/utils/logger.ts");function M(l,h,O){switch(h){case"audio":l.audioGroupIds||(l.audioGroupIds=[]),l.audioGroupIds.push(O);break;case"text":l.textGroupIds||(l.textGroupIds=[]),l.textGroupIds.push(O);break}}function W(l){var h={};l.forEach(function(O){var w=O.groupId||"";O.id=h[w]=h[w]||0,h[w]++})}function B(l,h,O){var w=l[h],x=l[O];k(w,x)}function k(l,h){var O=h.startPTS;if(Object(z.isFiniteNumber)(O)){var w=0,x;h.sn>l.sn?(w=O-l.start,x=l):(w=l.start-O,x=h),x.duration!==w&&(x.duration=w)}else if(h.sn>l.sn){var A=l.cc===h.cc;A&&l.minEndPTS?h.start=l.start+(l.minEndPTS-l.start):h.start=l.start+l.duration}else h.start=Math.max(l.start-h.duration,0)}function R(l,h,O,w,x,A){var S=w-O;S<=0&&(N.logger.warn("Fragment should have a positive duration",h),w=O+h.duration,A=x+h.duration);var T=O,E=w,_=h.startPTS,u=h.endPTS;if(Object(z.isFiniteNumber)(_)){var y=Math.abs(_-O);Object(z.isFiniteNumber)(h.deltaPTS)?h.deltaPTS=Math.max(y,h.deltaPTS):h.deltaPTS=y,T=Math.max(O,_),O=Math.min(O,_),x=Math.min(x,h.startDTS),E=Math.min(w,u),w=Math.max(w,u),A=Math.max(A,h.endDTS)}h.duration=w-O;var m=O-h.start;h.appendedPTS=w,h.start=h.startPTS=O,h.maxStartPTS=T,h.startDTS=x,h.endPTS=w,h.minEndPTS=E,h.endDTS=A;var b=h.sn;if(!l||bl.endSN)return 0;var P,I=b-l.startSN,U=l.fragments;for(U[I]=h,P=I;P>0;P--)k(U[P],U[P-1]);for(P=I;P=0;x--){var A=w[x].initSegment;if(A){O=A;break}}l.fragmentHint&&delete l.fragmentHint.endPTS;var S=0,T;if(f(l,h,function(P,I){P.relurl&&(S=P.cc-I.cc),Object(z.isFiniteNumber)(P.startPTS)&&Object(z.isFiniteNumber)(P.endPTS)&&(I.start=I.startPTS=P.startPTS,I.startDTS=P.startDTS,I.appendedPTS=P.appendedPTS,I.maxStartPTS=P.maxStartPTS,I.endPTS=P.endPTS,I.endDTS=P.endDTS,I.minEndPTS=P.minEndPTS,I.duration=P.endPTS-P.startPTS,I.duration&&(T=I),h.PTSKnown=h.alignedSliding=!0),I.elementaryStreams=P.elementaryStreams,I.loader=P.loader,I.stats=P.stats,I.urlId=P.urlId,P.initSegment&&(I.initSegment=P.initSegment,O=P.initSegment)}),O){var E=h.fragmentHint?h.fragments.concat(h.fragmentHint):h.fragments;E.forEach(function(P){var I;(!P.initSegment||P.initSegment.relurl===((I=O)===null||I===void 0?void 0:I.relurl))&&(P.initSegment=O)})}if(h.skippedSegments&&(h.deltaUpdateFailed=h.fragments.some(function(P){return!P}),h.deltaUpdateFailed)){N.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var _=h.skippedSegments;_--;)h.fragments.shift();h.startSN=h.fragments[0].sn,h.startCC=h.fragments[0].cc}var u=h.fragments;if(S){N.logger.warn("discontinuity sliding from playlist, take drift into account");for(var y=0;y=w.length)return;o(h,w[O].start)}function o(l,h){if(h){for(var O=l.fragments,w=l.skippedSegments;w0&&x0&&E===-1&&(this.log("Override startPosition with lastCurrentTime @"+_.toFixed(3)),E=_),this.state=N.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=E,this.tick()}else this._forceStartLoad=!0,this.state=N.State.STOPPED},S.stopLoad=function(){this._forceStartLoad=!1,x.prototype.stopLoad.call(this)},S.doTick=function(){switch(this.state){case N.State.IDLE:this.doTickIdle();break;case N.State.WAITING_LEVEL:{var E,_=this.levels,u=this.level,y=_==null||((E=_[u])===null||E===void 0)?void 0:E.details;if(y&&(!y.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(y))break;this.state=N.State.IDLE;break}break}case N.State.FRAG_LOADING_WAITING_RETRY:{var m,b=self.performance.now(),P=this.retryDate;(!P||b>=P||(m=this.media)!==null&&m!==void 0&&m.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=N.State.IDLE)}break;default:break}this.onTickEnd()},S.onTickEnd=function(){x.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},S.doTickIdle=function(){var E,_,u=this.hls,y=this.levelLastLoaded,m=this.levels,b=this.media,P=u.config,I=u.nextLoadLevel;if(y===null||!b&&(this.startFragRequested||!P.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!m||!m[I])return;var U=m[I];this.level=u.nextLoadLevel=I;var F=U.details;if(!F||this.state===N.State.WAITING_LEVEL||F.live&&this.levelLastLoaded!==I){this.state=N.State.WAITING_LEVEL;return}var L=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:b,R.PlaylistLevelType.MAIN);if(L===null)return;var v=L.len,j=this.getMaxBufferLength(U.maxBitrate);if(v>=j)return;if(this._streamEnded(L,F)){var K={};this.altAudio&&(K.type="video"),this.hls.trigger(W.Events.BUFFER_EOS,K),this.state=N.State.ENDED;return}var J=L.end,ee=this.getNextFragment(J,F);if(this.couldBacktrack&&!this.fragPrevious&&ee&&ee.sn!=="initSegment"){var ve=ee.sn-F.startSN;ve>1&&(ee=F.fragments[ve-1],this.fragmentTracker.removeFragment(ee))}if(ee&&this.fragmentTracker.getState(ee)===k.FragmentState.OK&&this.nextLoadPosition>J){var de=this.audioOnly&&!this.altAudio?g.ElementaryStreamTypes.AUDIO:g.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(b,de,R.PlaylistLevelType.MAIN),ee=this.getNextFragment(this.nextLoadPosition,F)}if(!ee)return;ee.initSegment&&!ee.initSegment.data&&!this.bitrateTest&&(ee=ee.initSegment),((E=ee.decryptdata)===null||E===void 0?void 0:E.keyFormat)==="identity"&&!((_=ee.decryptdata)!==null&&_!==void 0&&_.key)?this.loadKey(ee,F):this.loadFragment(ee,F,J)},S.loadFragment=function(E,_,u){var y,m=this.fragmentTracker.getState(E);if(this.fragCurrent=E,m===k.FragmentState.BACKTRACKED){var b=this.fragmentTracker.getBacktrackData(E);if(b){this._handleFragmentLoadProgress(b),this._handleFragmentLoadComplete(b);return}else m=k.FragmentState.NOT_LOADED}m===k.FragmentState.NOT_LOADED||m===k.FragmentState.PARTIAL?E.sn==="initSegment"?this._loadInitSegment(E):this.bitrateTest?(E.bitrateTest=!0,this.log("Fragment "+E.sn+" of level "+E.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(E)):(this.startFragRequested=!0,x.prototype.loadFragment.call(this,E,_,u)):m===k.FragmentState.APPENDING?this.reduceMaxBufferLength(E.duration)&&this.fragmentTracker.removeFragment(E):((y=this.media)===null||y===void 0?void 0:y.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},S.getAppendedFrag=function(E){var _=this.fragmentTracker.getAppendedFrag(E,R.PlaylistLevelType.MAIN);return _&&"fragment"in _?_.fragment:_},S.getBufferedFrag=function(E){return this.fragmentTracker.getBufferedFrag(E,R.PlaylistLevelType.MAIN)},S.followingBufferedFrag=function(E){return E?this.getBufferedFrag(E.end+.5):null},S.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},S.nextLevelSwitch=function(){var E=this.levels,_=this.media;if(_!=null&&_.readyState){var u,y=this.getAppendedFrag(_.currentTime);if(y&&y.start>1&&this.flushMainBuffer(0,y.start-1),!_.paused&&E){var m=this.hls.nextLoadLevel,b=E[m],P=this.fragLastKbps;P&&this.fragCurrent?u=this.fragCurrent.duration*b.maxBitrate/(1e3*P)+1:u=0}else u=0;var I=this.getBufferedFrag(_.currentTime+u);if(I){var U=this.followingBufferedFrag(I);if(U){this.abortCurrentFrag();var F=U.maxStartPTS?U.maxStartPTS:U.start,L=U.duration,v=Math.max(I.end,F+Math.min(Math.max(L-this.config.maxFragLookUpTolerance,L*.5),L*.75));this.flushMainBuffer(v,Number.POSITIVE_INFINITY)}}}},S.abortCurrentFrag=function(){var E=this.fragCurrent;this.fragCurrent=null,E!=null&&E.loader&&E.loader.abort(),this.state===N.State.KEY_LOADING&&(this.state=N.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},S.flushMainBuffer=function(E,_){x.prototype.flushMainBuffer.call(this,E,_,this.altAudio?"video":null)},S.onMediaAttached=function(E,_){x.prototype.onMediaAttached.call(this,E,_);var u=_.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),u.addEventListener("playing",this.onvplaying),u.addEventListener("seeked",this.onvseeked),this.gapController=new d.default(this.config,u,this.fragmentTracker,this.hls)},S.onMediaDetaching=function(){var E=this.media;E&&(E.removeEventListener("playing",this.onvplaying),E.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),x.prototype.onMediaDetaching.call(this)},S.onMediaPlaying=function(){this.tick()},S.onMediaSeeked=function(){var E=this.media,_=E?E.currentTime:null;Object(z.isFiniteNumber)(_)&&this.log("Media seeked to "+_.toFixed(3)),this.tick()},S.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(W.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},S.onManifestParsed=function(E,_){var u=!1,y=!1,m;_.levels.forEach(function(b){m=b.audioCodec,m&&(m.indexOf("mp4a.40.2")!==-1&&(u=!0),m.indexOf("mp4a.40.5")!==-1&&(y=!0))}),this.audioCodecSwitch=u&&y&&!Object(M.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=_.levels,this.startFragRequested=!1},S.onLevelLoading=function(E,_){var u=this.levels;if(!u||this.state!==N.State.IDLE)return;var y=u[_.level];(!y.details||y.details.live&&this.levelLastLoaded!==_.level||this.waitForCdnTuneIn(y.details))&&(this.state=N.State.WAITING_LEVEL)},S.onLevelLoaded=function(E,_){var u,y=this.levels,m=_.level,b=_.details,P=b.totalduration;if(!y){this.warn("Levels were reset while loading level "+m);return}this.log("Level "+m+" loaded ["+b.startSN+","+b.endSN+"], cc ["+b.startCC+", "+b.endCC+"] duration:"+P);var I=this.fragCurrent;I&&(this.state===N.State.FRAG_LOADING||this.state===N.State.FRAG_LOADING_WAITING_RETRY)&&(I.level!==_.level&&I.loader&&(this.state=N.State.IDLE,I.loader.abort()));var U=y[m],F=0;if(b.live||(u=U.details)!==null&&u!==void 0&&u.live){if(b.fragments[0]||(b.deltaUpdateFailed=!0),b.deltaUpdateFailed)return;F=this.alignPlaylists(b,U.details)}if(U.details=b,this.levelLastLoaded=m,this.hls.trigger(W.Events.LEVEL_UPDATED,{details:b,level:m}),this.state===N.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(b))return;this.state=N.State.IDLE}this.startFragRequested?b.live&&this.synchronizeToLiveEdge(b):this.setStartPosition(b,F),this.tick()},S._handleFragmentLoadProgress=function(E){var _,u=E.frag,y=E.part,m=E.payload,b=this.levels;if(!b){this.warn("Levels were reset while fragment load was in progress. Fragment "+u.sn+" of level "+u.level+" will not be buffered");return}var P=b[u.level],I=P.details;if(!I){this.warn("Dropping fragment "+u.sn+" of level "+u.level+" after level details were reset");return}var U=P.videoCodec,F=I.PTSKnown||!I.live,L=(_=u.initSegment)===null||_===void 0?void 0:_.data,v=this._getAudioCodec(P),j=this.transmuxer=this.transmuxer||new p.default(this.hls,R.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),K=y?y.index:-1,J=K!==-1,ee=new f.ChunkMetadata(u.level,u.sn,u.stats.chunkCount,m.byteLength,K,J),ve=this.initPTS[u.cc];j.push(m,L,v,U,u,y,I.totalduration,F,ee,ve)},S.onAudioTrackSwitching=function(E,_){var u=this.altAudio,y=!!_.url,m=_.id;if(!y){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var b=this.fragCurrent;b!=null&&b.loader&&(this.log("Switching to main audio track, cancel main fragment load"),b.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var P=this.hls;u&&P.trigger(W.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),P.trigger(W.Events.AUDIO_TRACK_SWITCHED,{id:m})}},S.onAudioTrackSwitched=function(E,_){var u=_.id,y=!!this.hls.audioTracks[u].url;if(y){var m=this.videoBuffer;m&&this.mediaBuffer!==m&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=m)}this.altAudio=y,this.tick()},S.onBufferCreated=function(E,_){var u=_.tracks,y,m,b=!1;for(var P in u){var I=u[P];if(I.id==="main"){if(m=P,y=I,P==="video"){var U=u[P];U&&(this.videoBuffer=U.buffer)}}else b=!0}b&&y?(this.log("Alternate track found, use "+m+".buffered to schedule main fragment loading"),this.mediaBuffer=y.buffer):this.mediaBuffer=this.media},S.onFragBuffered=function(E,_){var u=_.frag,y=_.part;if(u&&u.type!==R.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(u)){this.warn("Fragment "+u.sn+(y?" p: "+y.index:"")+" of level "+u.level+" finished buffering, but was aborted. state: "+this.state),this.state===N.State.PARSED&&(this.state=N.State.IDLE);return}var m=y?y.stats:u.stats;this.fragLastKbps=Math.round(8*m.total/(m.buffering.end-m.loading.first)),u.sn!=="initSegment"&&(this.fragPrevious=u),this.fragBufferedComplete(u,y)},S.onError=function(E,_){switch(_.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(R.PlaylistLevelType.MAIN,_);break;case o.ErrorDetails.LEVEL_LOAD_ERROR:case o.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==N.State.ERROR&&(_.fatal?(this.warn(""+_.details),this.state=N.State.ERROR):!_.levelRetry&&this.state===N.State.WAITING_LEVEL&&(this.state=N.State.IDLE));break;case o.ErrorDetails.BUFFER_FULL_ERROR:if(_.parent==="main"&&(this.state===N.State.PARSING||this.state===N.State.PARSED)){var u=!0,y=this.getFwdBufferInfo(this.media,R.PlaylistLevelType.MAIN);y&&y.len>.5&&(u=!this.reduceMaxBufferLength(y.len)),u&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},S.checkBuffer=function(){var E=this.media,_=this.gapController;if(!E||!_||!E.readyState)return;var u=B.BufferHelper.getBuffered(E);!this.loadedmetadata&&u.length?(this.loadedmetadata=!0,this.seekToStartPos()):_.poll(this.lastCurrentTime),this.lastCurrentTime=E.currentTime},S.onFragLoadEmergencyAborted=function(){this.state=N.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},S.onBufferFlushed=function(E,_){var u=_.type;if(u!==g.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var y=(u===g.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(y,u,R.PlaylistLevelType.MAIN)}},S.onLevelsUpdated=function(E,_){this.levels=_.levels},S.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},S.seekToStartPos=function(){var E=this.media,_=E.currentTime,u=this.startPosition;if(u>=0&&_0&&(b1&&E.seeking===!1){var u=E.currentTime;if(B.BufferHelper.isBuffered(E,u)?_=this.getAppendedFrag(u):B.BufferHelper.isBuffered(E,u+.1)&&(_=this.getAppendedFrag(u+.1)),_){var y=this.fragPlaying,m=_.level;(!y||_.sn!==y.sn||y.level!==m||_.urlId!==y.urlId)&&(this.hls.trigger(W.Events.FRAG_CHANGED,{frag:_}),(!y||y.level!==m)&&this.hls.trigger(W.Events.LEVEL_SWITCHED,{level:m}),this.fragPlaying=_)}}},a(A,[{key:"nextLevel",get:function(){var E=this.nextBufferedFrag;return E?E.level:-1}},{key:"currentLevel",get:function(){var E=this.media;if(E){var _=this.getAppendedFrag(E.currentTime);if(_)return _.level}return-1}},{key:"nextBufferedFrag",get:function(){var E=this.media;if(E){var _=this.getAppendedFrag(E.currentTime);return this.followingBufferedFrag(_)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),A}(N.default)},"./src/controller/subtitle-stream-controller.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"SubtitleStreamController",function(){return l});var z=D("./src/events.ts"),N=D("./src/utils/logger.ts"),M=D("./src/utils/buffer-helper.ts"),W=D("./src/controller/fragment-finders.ts"),B=D("./src/utils/discontinuities.ts"),k=D("./src/controller/level-helper.ts"),R=D("./src/controller/fragment-tracker.ts"),g=D("./src/controller/base-stream-controller.ts"),p=D("./src/types/loader.ts"),f=D("./src/types/level.ts");function d(h,O){for(var w=0;w=_[m].start&&y<=_[m].end){u=_[m];break}var b=T.start+T.duration;u?u.end=b:(u={start:y,end:b},_.push(u)),this.fragmentTracker.fragBuffered(T)},w.onBufferFlushing=function(A,S){var T=S.startOffset,E=S.endOffset;if(T===0&&E!==Number.POSITIVE_INFINITY){var _=this.currentTrackId,u=this.levels;if(!u.length||!u[_]||!u[_].details)return;var y=u[_].details,m=y.targetduration,b=E-m;if(b<=0)return;S.endOffsetSubtitles=Math.max(0,b),this.tracksBuffered.forEach(function(P){for(var I=0;I=y.length||_!==u||!m)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,E.live||(T=m.details)!==null&&T!==void 0&&T.live){var b=this.mainDetails;if(E.deltaUpdateFailed||!b)return;var P=b.fragments[0];if(!m.details)E.hasProgramDateTime&&b.hasProgramDateTime?Object(B.alignMediaPlaylistByPDT)(E,b):P&&Object(k.addSliding)(E,P.start);else{var I=this.alignPlaylists(E,m.details);I===0&&P&&Object(k.addSliding)(E,P.start)}}if(m.details=E,this.levelLastLoaded=_,this.tick(),E.live&&!this.fragCurrent&&this.media&&this.state===g.State.IDLE){var U=Object(W.findFragmentByPTS)(null,E.fragments,this.media.currentTime,0);U||(this.warn("Subtitle playlist not aligned with playback"),m.details=void 0)}},w._handleFragmentLoadComplete=function(A){var S=A.frag,T=A.payload,E=S.decryptdata,_=this.hls;if(this.fragContextChanged(S))return;if(T&&T.byteLength>0&&E&&E.key&&E.iv&&E.method==="AES-128"){var u=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(T),E.key.buffer,E.iv.buffer).then(function(y){var m=performance.now();_.trigger(z.Events.FRAG_DECRYPTED,{frag:S,payload:y,stats:{tstart:u,tdecrypt:m}})})}},w.doTick=function(){if(!this.media){this.state=g.State.IDLE;return}if(this.state===g.State.IDLE){var A,S=this.currentTrackId,T=this.levels;if(!T.length||!T[S]||!T[S].details)return;var E=T[S].details,_=E.targetduration,u=this.config,y=this.media,m=M.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,y.currentTime-_,u.maxBufferHole),b=m.end,P=m.len,I=this.getMaxBufferLength()+_;if(P>I)return;console.assert(E,"Subtitle track details are defined on idle subtitle stream controller tick");var U=E.fragments,F=U.length,L=E.edge,v,j=this.fragPrevious;if(b-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange)},c.pollTrackChange=function(a){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,a)},c.onMediaDetaching=function(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);var a=f(this.media.textTracks);a.forEach(function(l){Object(N.clearCurrentCues)(l)}),this.subtitleTrack=-1,this.media=null},c.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},c.onManifestParsed=function(a,l){this.tracks=l.subtitleTracks},c.onSubtitleTrackLoaded=function(a,l){var h=l.id,O=l.details,w=this.trackId,x=this.tracksInGroup[w];if(!x){this.warn("Invalid subtitle track id "+h);return}var A=x.details;x.details=l.details,this.log("subtitle track "+h+" loaded ["+O.startSN+"-"+O.endSN+"]"),h===this.trackId&&(this.retryCount=0,this.playlistLoaded(h,l,A))},c.onLevelLoading=function(a,l){this.switchLevel(l.level)},c.onLevelSwitching=function(a,l){this.switchLevel(l.level)},c.switchLevel=function(a){var l=this.hls.levels[a];if(!(l!=null&&l.textGroupIds))return;var h=l.textGroupIds[l.urlId];if(this.groupId!==h){var O=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,w=this.tracks.filter(function(S){return!h||S.groupId===h});this.tracksInGroup=w;var x=this.findTrackId(O==null?void 0:O.name)||this.findTrackId();this.groupId=h;var A={subtitleTracks:w};this.log("Updating subtitle tracks, "+w.length+' track(s) found in "'+h+'" group-id'),this.hls.trigger(z.Events.SUBTITLE_TRACKS_UPDATED,A),x!==-1&&this.setSubtitleTrack(x,O)}},c.findTrackId=function(a){for(var l=this.tracksInGroup,h=0;h=O.length)return;this.clearTimer();var w=O[a];if(this.log("Switching to subtitle track "+a),this.trackId=a,w){var x=w.id,A=w.groupId,S=A===void 0?"":A,T=w.name,E=w.type,_=w.url;this.hls.trigger(z.Events.SUBTITLE_TRACK_SWITCH,{id:x,groupId:S,name:T,type:E,url:_});var u=this.switchParams(w.url,l==null?void 0:l.details);this.loadPlaylist(u)}else this.hls.trigger(z.Events.SUBTITLE_TRACK_SWITCH,{id:a})},c.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var a=-1,l=f(this.media.textTracks),h=0;h=0&&(E[0]=Math.min(E[0],O),E[1]=Math.max(E[1],w),S=!0,_/(w-O)>.5))return}if(S||A.push([O,w]),this.config.renderTextTracksNatively){var u=this.captionsTracks[h];this.Cues.newCue(u,O,w,x)}else{var y=this.Cues.newCue(null,O,w,x);this.hls.trigger(N.Events.CUES_PARSED,{type:"captions",cues:y,track:h})}},a.onInitPtsFound=function(h,O){var w=this,x=O.frag,A=O.id,S=O.initPTS,T=O.timescale,E=this.unparsedVttFrags;A==="main"&&(this.initPTS[x.cc]=S,this.timescale[x.cc]=T),E.length&&(this.unparsedVttFrags=[],E.forEach(function(_){w.onFragLoaded(N.Events.FRAG_LOADED,_)}))},a.getExistingTrack=function(h){var O=this.media;if(O)for(var w=0;w>>8^T&255^99,R[x]=T,g[T]=x;var E=w[x],_=w[E],u=w[_],y=w[T]*257^T*16843008;f[x]=y<<24|y>>>8,d[x]=y<<16|y>>>16,o[x]=y<<8|y>>>24,c[x]=y,y=u*16843009^_*65537^E*257^x*16843008,a[T]=y<<24|y>>>8,l[T]=y<<16|y>>>16,h[T]=y<<8|y>>>24,O[T]=y,x?(x=E^w[w[w[u^E]]],A^=w[w[A]]):x=A=1}},B.expandKey=function(R){for(var g=this.uint8ArrayToUint32Array_(R),p=!0,f=0;f>>6)+1;var y=(h[O+2]&60)>>>2;if(y>u.length-1){l.trigger(M.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+y});return}return S=(h[O+2]&1)<<2,S|=(h[O+3]&192)>>>6,z.logger.log("manifest codec:"+w+", ADTS type:"+x+", samplingIndex:"+y),/firefox/i.test(E)?y>=6?(x=5,T=new Array(4),A=y-3):(x=2,T=new Array(2),A=y):E.indexOf("android")!==-1?(x=2,T=new Array(2),A=y):(x=5,T=new Array(4),w&&(w.indexOf("mp4a.40.29")!==-1||w.indexOf("mp4a.40.5")!==-1)||!w&&y>=6?A=y-3:((w&&w.indexOf("mp4a.40.2")!==-1&&(y>=6&&S===1||/vivaldi/i.test(E))||!w&&S===1)&&(x=2,T=new Array(2)),A=y)),T[0]=x<<3,T[0]|=(y&14)>>1,T[1]|=(y&1)<<7,T[1]|=S<<3,x===5&&(T[1]|=(A&14)>>1,T[2]=(A&1)<<7,T[2]|=2<<2,T[3]=0),{config:T,samplerate:u[y],channelCount:S,codec:"mp4a.40."+x,manifestCodec:_}}function B(l,h){return l[h]===255&&(l[h+1]&246)===240}function k(l,h){return l[h+1]&1?7:9}function R(l,h){return(l[h+3]&3)<<11|l[h+4]<<3|(l[h+5]&224)>>>5}function g(l,h){return h+5=l.length)return!1;var w=R(l,h);if(w<=O)return!1;var x=h+w;return x===l.length||p(l,x)}return!1}function o(l,h,O,w,x){if(!l.samplerate){var A=W(h,O,w,x);if(!A)return;l.config=A.config,l.samplerate=A.samplerate,l.channelCount=A.channelCount,l.codec=A.codec,l.manifestCodec=A.manifestCodec,z.logger.log("parsed codec:"+l.codec+", rate:"+A.samplerate+", channels:"+A.channelCount)}}function c(l){return 1024*9e4/l}function s(l,h,O,w,x){var A=k(l,h),S=R(l,h);if(S-=A,S>0){var T=O+w*x;return{headerLength:A,frameLength:S,stamp:T}}}function a(l,h,O,w,x){var A=c(l.samplerate),S=s(h,O,w,x,A);if(S){var T=S.frameLength,E=S.headerLength,_=S.stamp,u=E+T,y=Math.max(0,O+u-h.length),m;y?(m=new Uint8Array(u-E),m.set(h.subarray(O+E,h.length),0)):m=h.subarray(O+E,O+u);var b={unit:m,pts:_};return y||l.samples.push(b),{sample:b,length:u,missing:y}}}},"./src/demux/base-audio-demuxer.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"initPTSFn",function(){return R});var z=D("./src/polyfills/number.ts"),N=D("./src/demux/id3.ts"),M=D("./src/demux/dummy-demuxed-track.ts"),W=D("./src/utils/mp4-tools.ts"),B=D("./src/utils/typed-array.ts"),k=function(){function g(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var p=g.prototype;return p.resetInitSegment=function(d,o,c){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},p.resetTimeStamp=function(){},p.resetContiguity=function(){},p.canParse=function(d,o){return!1},p.appendFrame=function(d,o,c){},p.demux=function(d,o){this.cachedData&&(d=Object(W.appendUint8Array)(this.cachedData,d),this.cachedData=null);var c=N.getID3Data(d,0),s=c?c.length:0,a,l,h=this._audioTrack,O=this._id3Track,w=c?N.getTimeStamp(c):void 0,x=d.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=R(w,o)),c&&c.length>0&&O.samples.push({pts:this.initPTS,dts:this.initPTS,data:c}),l=this.initPTS;sk?(this.word<<=k,this.bitsAvailable-=k):(k-=this.bitsAvailable,R=k>>3,k-=R>>3,this.bytesAvailable-=R,this.loadWord(),this.word<<=k,this.bitsAvailable-=k)},W.readBits=function(k){var R=Math.min(this.bitsAvailable,k),g=this.word>>>32-R;return k>32&&z.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=R,this.bitsAvailable>0?this.word<<=R:this.bytesAvailable>0&&this.loadWord(),R=k-R,R>0&&this.bitsAvailable?g<>>k)!==0)return this.word<<=k,this.bitsAvailable-=k,k;return this.loadWord(),k+this.skipLZ()},W.skipUEG=function(){this.skipBits(1+this.skipLZ())},W.skipEG=function(){this.skipBits(1+this.skipLZ())},W.readUEG=function(){var k=this.skipLZ();return this.readBits(k+1)-1},W.readEG=function(){var k=this.readUEG();return 1&k?1+k>>>1:-1*(k>>>1)},W.readBoolean=function(){return this.readBits(1)===1},W.readUByte=function(){return this.readBits(8)},W.readUShort=function(){return this.readBits(16)},W.readUInt=function(){return this.readBits(32)},W.skipScalingList=function(k){for(var R=8,g=8,p,f=0;f0?x.subarray(S,S+T):void 0},W=function(x,A){var S=0;return S=(x[A]&127)<<21,S|=(x[A+1]&127)<<14,S|=(x[A+2]&127)<<7,S|=x[A+3]&127,S},B=function(x,A){return z(x,A)&&W(x,A+6)+10<=x.length-A},k=function(x){for(var A=p(x),S=0;S>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:b+=String.fromCharCode(u);break;case 12:case 13:y=x[P++],b+=String.fromCharCode((u&31)<<6|y&63);break;case 14:y=x[P++],m=x[P++],b+=String.fromCharCode((u&15)<<12|(y&63)<<6|(m&63)<<0);break;default:}}return b},l={decodeTextFrame:o},h;function O(){return!h&&typeof self.TextDecoder!="undefined"&&(h=new self.TextDecoder("utf-8")),h}},"./src/demux/mp3demuxer.ts":function(ne,V,D){"use strict";D.r(V);var z=D("./src/demux/base-audio-demuxer.ts"),N=D("./src/demux/id3.ts"),M=D("./src/utils/logger.ts"),W=D("./src/demux/mpegaudio.ts");function B(g,p){g.prototype=Object.create(p.prototype),g.prototype.constructor=g,k(g,p)}function k(g,p){return k=Object.setPrototypeOf||function(d,o){return d.__proto__=o,d},k(g,p)}var R=function(g){B(p,g);function p(){return g.apply(this,arguments)||this}var f=p.prototype;return f.resetInitSegment=function(o,c,s){g.prototype.resetInitSegment.call(this,o,c,s),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:o,duration:s,inputTimeScale:9e4,dropped:0}},p.probe=function(o){if(!o)return!1;for(var c=N.getID3Data(o,0)||[],s=c.length,a=o.length;s0},B.demux=function(R){var g=R,p=Object(N.dummyTrack)();if(this.config.progressive){this.remainderData&&(g=Object(z.appendUint8Array)(this.remainderData,R));var f=Object(z.segmentValidRange)(g);this.remainderData=f.remainder,p.samples=f.valid||new Uint8Array}else p.samples=g;return{audioTrack:Object(N.dummyTrack)(),avcTrack:p,id3Track:Object(N.dummyTrack)(),textTrack:Object(N.dummyTrack)()}},B.flush=function(){var R=Object(N.dummyTrack)();return R.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(N.dummyTrack)(),avcTrack:R,id3Track:Object(N.dummyTrack)(),textTrack:Object(N.dummyTrack)()}},B.demuxSampleAes=function(R,g,p){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},B.destroy=function(){},W}();M.minProbeByteLength=1024,V.default=M},"./src/demux/mpegaudio.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"appendFrame",function(){return k}),D.d(V,"parseHeader",function(){return R}),D.d(V,"isHeaderPattern",function(){return g}),D.d(V,"isHeader",function(){return p}),D.d(V,"canParse",function(){return f}),D.d(V,"probe",function(){return d});var z=null,N=[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],W=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],B=[0,1,1,4];function k(o,c,s,a,l){if(s+24>c.length)return;var h=R(c,s);if(h&&s+h.frameLength<=c.length){var O=h.samplesPerFrame*9e4/h.sampleRate,w=a+l*O,x={unit:c.subarray(s,s+h.frameLength),pts:w,dts:w};return o.config=[],o.channelCount=h.channelCount,o.samplerate=h.sampleRate,o.samples.push(x),{sample:x,length:h.frameLength,missing:0}}}function R(o,c){var s=o[c+1]>>3&3,a=o[c+1]>>1&3,l=o[c+2]>>4&15,h=o[c+2]>>2&3;if(s!==1&&l!==0&&l!==15&&h!==3){var O=o[c+2]>>1&1,w=o[c+3]>>6,x=s===3?3-a:a===3?3:4,A=N[x*14+l-1]*1e3,S=s===3?0:s===2?1:2,T=M[S*3+h],E=w===3?1:2,_=W[s][a],u=B[a],y=_*8*u,m=Math.floor(_*A/T+O)*u;if(z===null){var b=navigator.userAgent||"",P=b.match(/Chrome\/(\d+)/i);z=P?parseInt(P[1]):0}var I=!!z&&z<=87;return I&&a===2&&A>=224e3&&w===0&&(o[c+3]=o[c+3]|128),{sampleRate:T,channelCount:E,frameLength:m,samplesPerFrame:y}}}function g(o,c){return o[c]===255&&(o[c+1]&224)===224&&(o[c+1]&6)!==0}function p(o,c){return c+1=R.length){p();return}if(R[g].unit.length<32)continue;var f=this.decrypter.isSync();if(this.decryptAacSample(R,g,p,f),!f)return}},B.getAvcEncryptedData=function(R){for(var g=Math.floor((R.length-48)/160)*16+16,p=new Int8Array(g),f=0,d=32;d<=R.length-16;d+=160,f+=16)p.set(R.subarray(d,d+16),f);return p},B.getAvcDecryptedUnit=function(R,g){for(var p=new Uint8Array(g),f=0,d=32;d<=R.length-16;d+=160,f+=16)R.set(p.subarray(f,f+16),d);return R},B.decryptAvcSample=function(R,g,p,f,d,o){var c=Object(N.discardEPB)(d.data),s=this.getAvcEncryptedData(c),a=this;this.decryptBuffer(s.buffer,function(l){d.data=a.getAvcDecryptedUnit(c,l),o||a.decryptAvcSamples(R,g,p+1,f)})},B.decryptAvcSamples=function(R,g,p,f){if(R instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;g++,p=0){if(g>=R.length){f();return}for(var d=R[g].units;!(p>=d.length);p++){var o=d[p];if(o.data.length<=48||o.type!==1&&o.type!==5)continue;var c=this.decrypter.isSync();if(this.decryptAvcSample(R,g,p,f,o,c),!c)return}}},W}();V.default=M},"./src/demux/transmuxer-interface.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"default",function(){return d});var z=D("./node_modules/webworkify-webpack/index.js"),N=D.n(z),M=D("./src/events.ts"),W=D("./src/demux/transmuxer.ts"),B=D("./src/utils/logger.ts"),k=D("./src/errors.ts"),R=D("./src/utils/mediasource-helper.ts"),g=D("./node_modules/eventemitter3/index.js"),p=D.n(g),f=Object(R.getMediaSource)()||{isTypeSupported:function(){return!1}},d=function(){function o(s,a,l,h){var O=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=s,this.id=a,this.onTransmuxComplete=l,this.onFlush=h;var w=s.config,x=function(_,u){u=u||{},u.frag=O.frag,u.id=O.id,s.trigger(_,u)};this.observer=new g.EventEmitter,this.observer.on(M.Events.FRAG_DECRYPTED,x),this.observer.on(M.Events.ERROR,x);var A={mp4:f.isTypeSupported("video/mp4"),mpeg:f.isTypeSupported("audio/mpeg"),mp3:f.isTypeSupported('audio/mp4; codecs="mp3"')},S=navigator.vendor;if(w.enableWorker&&typeof Worker!="undefined"){B.logger.log("demuxing in webworker");var T;try{T=this.worker=z("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),T.addEventListener("message",this.onwmsg),T.onerror=function(E){s.trigger(M.Events.ERROR,{type:k.ErrorTypes.OTHER_ERROR,details:k.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(E.message+" ("+E.filename+":"+E.lineno+")")})},T.postMessage({cmd:"init",typeSupported:A,vendor:S,id:a,config:JSON.stringify(w)})}catch(E){B.logger.warn("Error in worker:",E),B.logger.error("Error while initializing DemuxerWorker, fallback to inline"),T&&self.URL.revokeObjectURL(T.objectURL),this.transmuxer=new W.default(this.observer,A,w,S,a),this.worker=null}}else this.transmuxer=new W.default(this.observer,A,w,S,a)}var c=o.prototype;return c.destroy=function(){var a=this.worker;if(a)a.removeEventListener("message",this.onwmsg),a.terminate(),this.worker=null;else{var l=this.transmuxer;l&&(l.destroy(),this.transmuxer=null)}var h=this.observer;h&&h.removeAllListeners(),this.observer=null},c.push=function(a,l,h,O,w,x,A,S,T,E){var _=this;T.transmuxing.start=self.performance.now();var u=this.transmuxer,y=this.worker,m=x?x.start:w.start,b=w.decryptdata,P=this.frag,I=!(P&&w.cc===P.cc),U=!(P&&T.level===P.level),F=P?T.sn-P.sn:-1,L=this.part?T.part-this.part.index:1,v=!U&&(F===1||F===0&&L===1),j=self.performance.now();(U||F||w.stats.parsing.start===0)&&(w.stats.parsing.start=j),x&&(L||!v)&&(x.stats.parsing.start=j);var K=new W.TransmuxState(I,v,S,U,m);if(!v||I){B.logger.log("[transmuxer-interface, "+w.type+"]: Starting new transmux session for sn: "+T.sn+" p: "+T.part+" level: "+T.level+" id: "+T.id+` discontinuity: `+I+` trackSwitch: `+U+` contiguous: `+v+` accurateTimeOffset: `+S+` timeOffset: `+m);var J=new W.TransmuxConfig(h,O,l,A,E);this.configureTransmuxer(J)}if(this.frag=w,this.part=x,y)y.postMessage({cmd:"demux",data:a,decryptdata:b,chunkMeta:T,state:K},a instanceof ArrayBuffer?[a]:[]);else if(u){var ee=u.push(a,b,T,K);Object(W.isPromise)(ee)?ee.then(function(ve){_.handleTransmuxComplete(ve)}):this.handleTransmuxComplete(ee)}},c.flush=function(a){var l=this;a.transmuxing.start=self.performance.now();var h=this.transmuxer,O=this.worker;if(O)O.postMessage({cmd:"flush",chunkMeta:a});else if(h){var w=h.flush(a);Object(W.isPromise)(w)?w.then(function(x){l.handleFlushResult(x,a)}):this.handleFlushResult(w,a)}},c.handleFlushResult=function(a,l){var h=this;a.forEach(function(O){h.handleTransmuxComplete(O)}),this.onFlush(l)},c.onWorkerMessage=function(a){var l=a.data,h=this.hls;switch(l.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(l.data);break}case"flush":{this.onFlush(l.data);break}default:{l.data=l.data||{},l.data.frag=this.frag,l.data.id=this.id,h.trigger(l.event,l.data);break}}},c.configureTransmuxer=function(a){var l=this.worker,h=this.transmuxer;l?l.postMessage({cmd:"configure",config:a}):h&&h.configure(a)},c.handleTransmuxComplete=function(a){a.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(a)},o}()},"./src/demux/transmuxer-worker.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"default",function(){return k});var z=D("./src/demux/transmuxer.ts"),N=D("./src/events.ts"),M=D("./src/utils/logger.ts"),W=D("./node_modules/eventemitter3/index.js"),B=D.n(W);function k(d){var o=new W.EventEmitter,c=function(a,l){d.postMessage({event:a,data:l})};o.on(N.Events.FRAG_DECRYPTED,c),o.on(N.Events.ERROR,c),d.addEventListener("message",function(s){var a=s.data;switch(a.cmd){case"init":{var l=JSON.parse(a.config);d.transmuxer=new z.default(o,a.typeSupported,l,a.vendor,a.id),Object(M.enableLogs)(l.debug),c("init",null);break}case"configure":{d.transmuxer.configure(a.config);break}case"demux":{var h=d.transmuxer.push(a.data,a.decryptdata,a.chunkMeta,a.state);Object(z.isPromise)(h)?h.then(function(x){R(d,x)}):R(d,h);break}case"flush":{var O=a.chunkMeta,w=d.transmuxer.flush(O);Object(z.isPromise)(w)?w.then(function(x){p(d,x,O)}):p(d,w,O);break}default:break}})}function R(d,o){if(f(o.remuxResult))return;var c=[],s=o.remuxResult,a=s.audio,l=s.video;a&&g(c,a),l&&g(c,l),d.postMessage({event:"transmuxComplete",data:o},c)}function g(d,o){o.data1&&d.push(o.data1.buffer),o.data2&&d.push(o.data2.buffer)}function p(d,o,c){o.forEach(function(s){R(d,s)}),d.postMessage({event:"flush",data:c})}function f(d){return!d.audio&&!d.video&&!d.text&&!d.id3&&!d.initSegment}},"./src/demux/transmuxer.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"default",function(){return l}),D.d(V,"isPromise",function(){return w}),D.d(V,"TransmuxConfig",function(){return x}),D.d(V,"TransmuxState",function(){return A});var z=D("./src/events.ts"),N=D("./src/errors.ts"),M=D("./src/crypt/decrypter.ts"),W=D("./src/demux/aacdemuxer.ts"),B=D("./src/demux/mp4demuxer.ts"),k=D("./src/demux/tsdemuxer.ts"),R=D("./src/demux/mp3demuxer.ts"),g=D("./src/remux/mp4-remuxer.ts"),p=D("./src/remux/passthrough-remuxer.ts"),f=D("./src/demux/chunk-cache.ts"),d=D("./src/utils/mp4-tools.ts"),o=D("./src/utils/logger.ts"),c;try{c=self.performance.now.bind(self.performance)}catch(S){o.logger.debug("Unable to use Performance API on this environment"),c=self.Date.now}var s=[{demux:k.default,remux:g.default},{demux:B.default,remux:p.default},{demux:W.default,remux:g.default},{demux:R.default,remux:g.default}],a=1024;s.forEach(function(S){var T=S.demux;a=Math.max(a,T.minProbeByteLength)});var l=function(){function S(E,_,u,y,m){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 f.default,this.observer=E,this.typeSupported=_,this.config=u,this.vendor=y,this.id=m}var T=S.prototype;return T.configure=function(_){this.transmuxConfig=_,this.decrypter&&this.decrypter.reset()},T.push=function(_,u,y,m){var b=this,P=y.transmuxing;P.executeStart=c();var I=new Uint8Array(_),U=this.cache,F=this.config,L=this.currentTransmuxState,v=this.transmuxConfig;m&&(this.currentTransmuxState=m);var j=h(I,u);if(j&&j.method==="AES-128"){var K=this.getDecrypter();if(F.enableSoftwareAES){var J=K.softwareDecrypt(I,j.key.buffer,j.iv.buffer);if(!J)return P.executeEnd=c(),O(y);I=new Uint8Array(J)}else return this.decryptionPromise=K.webCryptoDecrypt(I,j.key.buffer,j.iv.buffer).then(function(we){var Re=b.push(we,null,y);return b.decryptionPromise=null,Re}),this.decryptionPromise}var ee=m||L,ve=ee.contiguous,de=ee.discontinuity,me=ee.trackSwitch,ce=ee.accurateTimeOffset,pe=ee.timeOffset,ae=v.audioCodec,he=v.videoCodec,$=v.defaultInitPts,ie=v.duration,q=v.initSegmentData;if((de||me)&&this.resetInitSegment(q,ae,he,ie),de&&this.resetInitialTimestamp($),ve||this.resetContiguity(),this.needsProbing(I,de,me)){if(U.dataLength){var Ee=U.flush();I=Object(d.appendUint8Array)(Ee,I)}this.configureTransmuxer(I,v)}var Ae=this.transmux(I,j,pe,ce,y),ye=this.currentTransmuxState;return ye.contiguous=!0,ye.discontinuity=!1,ye.trackSwitch=!1,P.executeEnd=c(),Ae},T.flush=function(_){var u=this,y=_.transmuxing;y.executeStart=c();var m=this.decrypter,b=this.cache,P=this.currentTransmuxState,I=this.decryptionPromise;if(I)return I.then(function(){return u.flush(_)});var U=[],F=P.timeOffset;if(m){var L=m.flush();L&&U.push(this.push(L,null,_))}var v=b.dataLength;b.reset();var j=this.demuxer,K=this.remuxer;if(!j||!K)return v>=a&&this.observer.emit(z.Events.ERROR,z.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),y.executeEnd=c(),[O(_)];var J=j.flush(F);return w(J)?J.then(function(ee){return u.flushRemux(U,ee,_),U}):(this.flushRemux(U,J,_),U)},T.flushRemux=function(_,u,y){var m=u.audioTrack,b=u.avcTrack,P=u.id3Track,I=u.textTrack,U=this.currentTransmuxState,F=U.accurateTimeOffset,L=U.timeOffset;o.logger.log("[transmuxer.ts]: Flushed fragment "+y.sn+(y.part>-1?" p: "+y.part:"")+" of level "+y.level);var v=this.remuxer.remux(m,b,P,I,L,F,!0,this.id);_.push({remuxResult:v,chunkMeta:y}),y.transmuxing.executeEnd=c()},T.resetInitialTimestamp=function(_){var u=this.demuxer,y=this.remuxer;if(!u||!y)return;u.resetTimeStamp(_),y.resetTimeStamp(_)},T.resetContiguity=function(){var _=this.demuxer,u=this.remuxer;if(!_||!u)return;_.resetContiguity(),u.resetNextTimestamp()},T.resetInitSegment=function(_,u,y,m){var b=this.demuxer,P=this.remuxer;if(!b||!P)return;b.resetInitSegment(u,y,m),P.resetInitSegment(_,u,y)},T.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},T.transmux=function(_,u,y,m,b){var P;return u&&u.method==="SAMPLE-AES"?P=this.transmuxSampleAes(_,u,y,m,b):P=this.transmuxUnencrypted(_,y,m,b),P},T.transmuxUnencrypted=function(_,u,y,m){var b=this.demuxer.demux(_,u,!1,!this.config.progressive),P=b.audioTrack,I=b.avcTrack,U=b.id3Track,F=b.textTrack,L=this.remuxer.remux(P,I,U,F,u,y,!1,this.id);return{remuxResult:L,chunkMeta:m}},T.transmuxSampleAes=function(_,u,y,m,b){var P=this;return this.demuxer.demuxSampleAes(_,u,y).then(function(I){var U=P.remuxer.remux(I.audioTrack,I.avcTrack,I.id3Track,I.textTrack,y,m,!1,P.id);return{remuxResult:U,chunkMeta:b}})},T.configureTransmuxer=function(_,u){for(var y=this.config,m=this.observer,b=this.typeSupported,P=this.vendor,I=u.audioCodec,U=u.defaultInitPts,F=u.duration,L=u.initSegmentData,v=u.videoCodec,j,K=0,J=s.length;K0&&T!=null&&T.key!=null&&T.iv!==null&&T.method!=null&&(E=T),E}var O=function(T){return{remuxResult:{},chunkMeta:T}};function w(S){return"then"in S&&S.then instanceof Function}var x=function(T,E,_,u,y){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=T,this.videoCodec=E,this.initSegmentData=_,this.duration=u,this.defaultInitPts=y},A=function(T,E,_,u,y){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=T,this.contiguous=E,this.accurateTimeOffset=_,this.trackSwitch=u,this.timeOffset=y}},"./src/demux/tsdemuxer.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"discardEPB",function(){return O});var z=D("./src/demux/adts.ts"),N=D("./src/demux/mpegaudio.ts"),M=D("./src/demux/exp-golomb.ts"),W=D("./src/demux/id3.ts"),B=D("./src/demux/sample-aes.ts"),k=D("./src/events.ts"),R=D("./src/utils/mp4-tools.ts"),g=D("./src/utils/logger.ts"),p=D("./src/errors.ts"),f={video:1,audio:2,id3:3,text:4},d=function(){function w(A,S,T){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=A,this.config=S,this.typeSupported=T}w.probe=function(S){var T=w.syncOffset(S);return T<0?!1:(T&&g.logger.warn("MPEG2-TS detected but first sync word found @ offset "+T+", junk ahead ?"),!0)},w.syncOffset=function(S){for(var T=Math.min(1e3,S.length-3*188),E=0;E>4,ae=void 0;if(pe>1){if(ae=de+5+S[de+4],ae===de+188)continue}else ae=de+4;switch(ce){case P:me&&(I&&(u=a(I))&&this.parseAVCPES(u,!1),I={data:[],size:0}),I&&(I.data.push(S.subarray(ae,de+188)),I.size+=de+188-ae);break;case U:me&&(L&&(u=a(L))&&(m.isAAC?this.parseAACPES(u):this.parseMPEGPES(u)),L={data:[],size:0}),L&&(L.data.push(S.subarray(ae,de+188)),L.size+=de+188-ae);break;case F:me&&(v&&(u=a(v))&&this.parseID3PES(u),v={data:[],size:0}),v&&(v.data.push(S.subarray(ae,de+188)),v.size+=de+188-ae);break;case 0:me&&(ae+=S[ae]+1),J=this._pmtId=c(S,ae);break;case J:{me&&(ae+=S[ae]+1);var he=s(S,ae,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,E);P=he.avc,P>0&&(y.pid=P),U=he.audio,U>0&&(m.pid=U,m.isAAC=he.isAAC),F=he.id3,F>0&&(b.pid=F),j&&!K&&(g.logger.log("reparse from beginning"),j=!1,de=ve-188),K=this.pmtParsed=!0;break}case 17:case 8191:break;default:j=!0;break}}else this.observer.emit(k.Events.ERROR,k.Events.ERROR,{type:p.ErrorTypes.MEDIA_ERROR,details:p.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});y.pesData=I,m.pesData=L,b.pesData=v;var $={audioTrack:m,avcTrack:y,id3Track:b,textTrack:this._txtTrack};return _&&this.extractRemainingSamples($),$},x.flush=function(){var S=this.remainderData;this.remainderData=null;var T;return S?T=this.demux(S,-1,!1,!0):T={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(T),this.sampleAes?this.decrypt(T,this.sampleAes):T},x.extractRemainingSamples=function(S){var T=S.audioTrack,E=S.avcTrack,_=S.id3Track,u=E.pesData,y=T.pesData,m=_.pesData,b;u&&(b=a(u))?(this.parseAVCPES(b,!0),E.pesData=null):E.pesData=u,y&&(b=a(y))?(T.isAAC?this.parseAACPES(b):this.parseMPEGPES(b),T.pesData=null):(y!=null&&y.size&&g.logger.log("last AAC PES packet truncated,might overlap between fragments"),T.pesData=y),m&&(b=a(m))?(this.parseID3PES(b),_.pesData=null):_.pesData=m},x.demuxSampleAes=function(S,T,E){var _=this.demux(S,E,!0,!this.config.progressive),u=this.sampleAes=new B.default(this.observer,this.config,T);return this.decrypt(_,u)},x.decrypt=function(S,T){return new Promise(function(E){var _=S.audioTrack,u=S.avcTrack;_.samples&&_.isAAC?T.decryptAacSamples(_.samples,0,function(){u.samples?T.decryptAvcSamples(u.samples,0,0,function(){E(S)}):E(S)}):u.samples&&T.decryptAvcSamples(u.samples,0,0,function(){E(S)})})},x.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},x.parseAVCPES=function(S,T){var E=this,_=this._avcTrack,u=this.parseAVCNALu(S.data),y=!1,m=this.avcSample,b,P=!1;S.data=null,m&&u.length&&!_.audFound&&(l(m,_),m=this.avcSample=o(!1,S.pts,S.dts,"")),u.forEach(function(I){switch(I.type){case 1:{b=!0,m||(m=E.avcSample=o(!0,S.pts,S.dts,"")),y&&(m.debug+="NDR "),m.frame=!0;var U=I.data;if(P&&U.length>4){var F=new M.default(U).readSliceType();(F===2||F===4||F===7||F===9)&&(m.key=!0)}break}case 5:b=!0,m||(m=E.avcSample=o(!0,S.pts,S.dts,"")),y&&(m.debug+="IDR "),m.key=!0,m.frame=!0;break;case 6:{b=!0,y&&m&&(m.debug+="SEI ");var L=new M.default(O(I.data));L.readUByte();for(var v=0,j=0,K=!1,J=0;!K&&L.bytesAvailable>1;){v=0;do J=L.readUByte(),v+=J;while(J===255);j=0;do J=L.readUByte(),j+=J;while(J===255);if(v===4&&L.bytesAvailable!==0){K=!0;var ee=L.readUByte();if(ee===181){var ve=L.readUShort();if(ve===49){var de=L.readUInt();if(de===1195456820){var me=L.readUByte();if(me===3){for(var ce=L.readUByte(),pe=L.readUByte(),ae=31&ce,he=[ce,pe],$=0;$16){for(var ie=[],q=0;q<16;q++)ie.push(L.readUByte().toString(16)),(q===3||q===5||q===7||q===9)&&ie.push("-");for(var Ee=j-16,Ae=new Uint8Array(Ee),ye=0;ye=0){var L={data:S.subarray(U,m-_-1),type:F};y.push(L)}else{var v=this.getLastNalUnit();if(v&&(u&&m<=4-u&&(v.state&&(v.data=v.data.subarray(0,v.data.byteLength-u))),P=m-_-1,P>0)){var j=new Uint8Array(v.data.byteLength+P);j.set(v.data,0),j.set(S.subarray(0,P),v.data.byteLength),v.data=j,v.state=0}}m=0&&_>=0){var K={data:S.subarray(U,T),type:F,state:_};y.push(K)}if(y.length===0){var J=this.getLastNalUnit();if(J){var ee=new Uint8Array(J.data.byteLength+S.byteLength);ee.set(J.data,0),ee.set(S,J.data.byteLength),J.data=ee}}return E.naluState=_,y},x.parseAACPES=function(S){var T=0,E=this._audioTrack,_=this.aacOverFlow,u=S.data;if(_){this.aacOverFlow=null;var y=_.sample.unit.byteLength,m=Math.min(_.missing,y),b=y-m;_.sample.unit.set(u.subarray(0,m),b),E.samples.push(_.sample),T=_.missing}var P,I;for(P=T,I=u.length;P1;){var y=new Uint8Array(u[0].length+u[1].length);y.set(u[0]),y.set(u[1],u[0].length),u[0]=y,u.splice(1,1)}A=u[0];var m=(A[0]<<16)+(A[1]<<8)+A[2];if(m===1){if(S=(A[4]<<8)+A[5],S&&S>w.size-6)return null;var b=A[7];b&192&&(E=(A[9]&14)*536870912+(A[10]&255)*4194304+(A[11]&254)*16384+(A[12]&255)*128+(A[13]&254)/2,b&64?(_=(A[14]&14)*536870912+(A[15]&255)*4194304+(A[16]&254)*16384+(A[17]&255)*128+(A[18]&254)/2,E-_>60*9e4&&(g.logger.warn(Math.round((E-_)/9e4)+"s delta between PTS and DTS, align them"),E=_)):_=E),T=A[8];var P=T+9;if(w.size<=P)return null;w.size-=P;for(var I=new Uint8Array(w.size),U=0,F=u.length;UL){P-=L;continue}else A=A.subarray(P),L-=P,P=0;I.set(A,x),x+=L}return S&&(S-=T+3),{data:I,pts:E,dts:_,len:S}}return null}function l(w,x){if(w.units.length&&w.frame){if(w.pts===void 0){var A=x.samples,S=A.length;if(S){var T=A[S-1];w.pts=T.pts,w.dts=T.dts}else{x.dropped++;return}}x.samples.push(w)}w.debug.length&&g.logger.log(w.pts+"/"+w.dts+":"+w.debug)}function h(w,x){var A=w.length;if(A>0){if(x.pts>=w[A-1].pts)w.push(x);else for(var S=A-1;S>=0;S--)if(x.ptsE)return u;return 0}},{key:"maxAutoLevel",get:function(){var T=this.levels,E=this.autoLevelCapping,_;return E===-1&&T&&T.length?_=T.length-1:_=E,_}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(T){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,T)}},{key:"audioTracks",get:function(){var T=this.audioTrackController;return T?T.audioTracks:[]}},{key:"audioTrack",get:function(){var T=this.audioTrackController;return T?T.audioTrack:-1},set:function(T){var E=this.audioTrackController;E&&(E.audioTrack=T)}},{key:"subtitleTracks",get:function(){var T=this.subtitleTrackController;return T?T.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var T=this.subtitleTrackController;return T?T.subtitleTrack:-1},set:function(T){var E=this.subtitleTrackController;E&&(E.subtitleTrack=T)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var T=this.subtitleTrackController;return T?T.subtitleDisplay:!1},set:function(T){var E=this.subtitleTrackController;E&&(E.subtitleDisplay=T)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(T){this.config.lowLatencyMode=T}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}],[{key:"version",get:function(){return"1.1.2"}},{key:"Events",get:function(){return a.Events}},{key:"ErrorTypes",get:function(){return l.ErrorTypes}},{key:"ErrorDetails",get:function(){return l.ErrorDetails}},{key:"DefaultConfig",get:function(){return x.defaultConfig?x.defaultConfig:o.hlsDefaultConfig},set:function(T){x.defaultConfig=T}}]),x}();w.defaultConfig=void 0},"./src/is-supported.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"isSupported",function(){return M}),D.d(V,"changeTypeSupported",function(){return W});var z=D("./src/utils/mediasource-helper.ts");function N(){return self.SourceBuffer||self.WebKitSourceBuffer}function M(){var B=Object(z.getMediaSource)();if(!B)return!1;var k=N(),R=B&&typeof B.isTypeSupported=="function"&&B.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),g=!k||k.prototype&&typeof k.prototype.appendBuffer=="function"&&typeof k.prototype.remove=="function";return!!R&&!!g}function W(){var B,k=N();return typeof(k==null||((B=k.prototype)===null||B===void 0)?void 0:B.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"default",function(){return d}),D.d(V,"LoadError",function(){return c});var z=D("./src/polyfills/number.ts"),N=D("./src/errors.ts");function M(s,a){s.prototype=Object.create(a.prototype),s.prototype.constructor=s,g(s,a)}function W(s){var a=typeof Map=="function"?new Map:void 0;return W=function(h){if(h===null||!R(h))return h;if(typeof h!="function")throw new TypeError("Super expression must either be null or a function");if(typeof a!="undefined"){if(a.has(h))return a.get(h);a.set(h,O)}function O(){return B(h,arguments,p(this).constructor)}return O.prototype=Object.create(h.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),g(O,h)},W(s)}function B(s,a,l){return k()?B=Reflect.construct:B=function(O,w,x){var A=[null];A.push.apply(A,w);var S=Function.bind.apply(O,A),T=new S;return x&&g(T,x.prototype),T},B.apply(null,arguments)}function k(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(s){return!1}}function R(s){return Function.toString.call(s).indexOf("[native code]")!==-1}function g(s,a){return g=Object.setPrototypeOf||function(h,O){return h.__proto__=O,h},g(s,a)}function p(s){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(l){return l.__proto__||Object.getPrototypeOf(l)},p(s)}var f=Math.pow(2,17),d=function(){function s(l){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=l}var a=s.prototype;return a.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},a.abort=function(){this.loader&&this.loader.abort()},a.load=function(h,O){var w=this,x=h.url;if(!x)return Promise.reject(new c({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:h,networkDetails:null},"Fragment does not have a "+(x?"part list":"url")));this.abort();var A=this.config,S=A.fLoader,T=A.loader;return new Promise(function(E,_){w.loader&&w.loader.destroy();var u=w.loader=h.loader=S?new S(A):new T(A),y=o(h),m={timeout:A.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:A.fragLoadingMaxRetryTimeout,highWaterMark:f};h.stats=u.stats,u.load(y,m,{onSuccess:function(P,I,U,F){w.resetLoader(h,u),E({frag:h,part:null,payload:P.data,networkDetails:F})},onError:function(P,I,U){w.resetLoader(h,u),_(new c({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:h,response:P,networkDetails:U}))},onAbort:function(P,I,U){w.resetLoader(h,u),_(new c({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:h,networkDetails:U}))},onTimeout:function(P,I,U){w.resetLoader(h,u),_(new c({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:h,networkDetails:U}))},onProgress:function(P,I,U,F){O&&O({frag:h,part:null,payload:U,networkDetails:F})}})})},a.loadPart=function(h,O,w){var x=this;this.abort();var A=this.config,S=A.fLoader,T=A.loader;return new Promise(function(E,_){x.loader&&x.loader.destroy();var u=x.loader=h.loader=S?new S(A):new T(A),y=o(h,O),m={timeout:A.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:A.fragLoadingMaxRetryTimeout,highWaterMark:f};O.stats=u.stats,u.load(y,m,{onSuccess:function(P,I,U,F){x.resetLoader(h,u),x.updateStatsFromPart(h,O);var L={frag:h,part:O,payload:P.data,networkDetails:F};w(L),E(L)},onError:function(P,I,U){x.resetLoader(h,u),_(new c({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:h,part:O,response:P,networkDetails:U}))},onAbort:function(P,I,U){h.stats.aborted=O.stats.aborted,x.resetLoader(h,u),_(new c({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:h,part:O,networkDetails:U}))},onTimeout:function(P,I,U){x.resetLoader(h,u),_(new c({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:h,part:O,networkDetails:U}))}})})},a.updateStatsFromPart=function(h,O){var w=h.stats,x=O.stats,A=x.total;if(w.loaded+=x.loaded,A){var S=Math.round(h.duration/O.duration),T=Math.min(Math.round(w.loaded/A),S),E=S-T,_=E*Math.round(w.loaded/T);w.total=w.loaded+_}else w.total=Math.max(w.loaded,w.total);var u=w.loading,y=x.loading;u.start?u.first+=y.first-y.start:(u.start=y.start,u.first=y.first),u.end=y.end},a.resetLoader=function(h,O){h.loader=null,this.loader===O&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),O.destroy()},s}();function o(s,a){a===void 0&&(a=null);var l=a||s,h={frag:s,part:a,responseType:"arraybuffer",url:l.url,headers:{},rangeStart:0,rangeEnd:0},O=l.byteRangeStartOffset,w=l.byteRangeEndOffset;return Object(z.isFiniteNumber)(O)&&Object(z.isFiniteNumber)(w)&&(h.rangeStart=O,h.rangeEnd=w),h}var c=function(s){M(a,s);function a(l){for(var h,O=arguments.length,w=new Array(O>1?O-1:0),x=1;x>8*(15-A)&255;return x},h.setDecryptDataFromLevelKey=function(w,x){var A=w;return(w==null?void 0:w.method)==="AES-128"&&w.uri&&!w.iv&&(A=B.LevelKey.fromURI(w.uri),A.method=w.method,A.iv=this.createInitializationVector(x),A.keyFormat="identity"),A},h.setElementaryStreamInfo=function(w,x,A,S,T,E){E===void 0&&(E=!1);var _=this.elementaryStreams,u=_[w];if(!u){_[w]={startPTS:x,endPTS:A,startDTS:S,endDTS:T,partial:E};return}u.startPTS=Math.min(u.startPTS,x),u.endPTS=Math.max(u.endPTS,A),u.startDTS=Math.min(u.startDTS,S),u.endDTS=Math.max(u.endDTS,T)},h.clearElementaryStreamInfo=function(){var w=this.elementaryStreams;w[d.AUDIO]=null,w[d.VIDEO]=null,w[d.AUDIOVIDEO]=null},f(l,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var w=this.sn;typeof w!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&W.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),w=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,w)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(z.isFiniteNumber)(this.programDateTime))return null;var w=Object(z.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+w*1e3}},{key:"encrypted",get:function(){var w;return!!((w=this.decryptdata)!==null&&w!==void 0&&w.keyFormat&&this.decryptdata.uri)}}]),l}(o),s=function(a){R(l,a);function l(h,O,w,x,A){var S;S=a.call(this,w)||this,S.fragOffset=0,S.duration=0,S.gap=!1,S.independent=!1,S.relurl=void 0,S.fragment=void 0,S.index=void 0,S.stats=new k.LoadStats,S.duration=h.decimalFloatingPoint("DURATION"),S.gap=h.bool("GAP"),S.independent=h.bool("INDEPENDENT"),S.relurl=h.enumeratedString("URI"),S.fragment=O,S.index=x;var T=h.enumeratedString("BYTERANGE");return T&&S.setByteRange(T,A),A&&(S.fragOffset=A.fragOffset+A.duration),S}return f(l,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var O=this.elementaryStreams;return!!(O.audio||O.video||O.audiovideo)}}]),l}(o)},"./src/loader/key-loader.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"default",function(){return W});var z=D("./src/events.ts"),N=D("./src/errors.ts"),M=D("./src/utils/logger.ts"),W=function(){function B(R){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=R,this._registerListeners()}var k=B.prototype;return k._registerListeners=function(){this.hls.on(z.Events.KEY_LOADING,this.onKeyLoading,this)},k._unregisterListeners=function(){this.hls.off(z.Events.KEY_LOADING,this.onKeyLoading)},k.destroy=function(){this._unregisterListeners();for(var g in this.loaders){var p=this.loaders[g];p&&p.destroy()}this.loaders={}},k.onKeyLoading=function(g,p){var f=p.frag,d=f.type,o=this.loaders[d];if(!f.decryptdata){M.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var c=f.decryptdata.uri;if(c!==this.decrypturl||this.decryptkey===null){var s=this.hls.config;if(o&&(M.logger.warn("abort previous key loader for type:"+d),o.abort()),!c){M.logger.warn("key uri is falsy");return}var a=s.loader,l=f.loader=this.loaders[d]=new a(s);this.decrypturl=c,this.decryptkey=null;var h={url:c,frag:f,responseType:"arraybuffer"},O={timeout:s.fragLoadingTimeOut,maxRetry:0,retryDelay:s.fragLoadingRetryDelay,maxRetryDelay:s.fragLoadingMaxRetryTimeout,highWaterMark:0},w={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};l.load(h,O,w)}else this.decryptkey&&(f.decryptdata.key=this.decryptkey,this.hls.trigger(z.Events.KEY_LOADED,{frag:f}))},k.loadsuccess=function(g,p,f){var d=f.frag;if(!d.decryptdata){M.logger.error("after key load, decryptdata unset");return}this.decryptkey=d.decryptdata.key=new Uint8Array(g.data),d.loader=null,delete this.loaders[d.type],this.hls.trigger(z.Events.KEY_LOADED,{frag:d})},k.loaderror=function(g,p){var f=p.frag,d=f.loader;d&&d.abort(),delete this.loaders[f.type],this.hls.trigger(z.Events.ERROR,{type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:f,response:g})},k.loadtimeout=function(g,p){var f=p.frag,d=f.loader;d&&d.abort(),delete this.loaders[f.type],this.hls.trigger(z.Events.ERROR,{type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:f})},B}()},"./src/loader/level-details.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"LevelDetails",function(){return B});var z=D("./src/polyfills/number.ts");function N(k,R){for(var g=0;gp.endSN||f>0||f===0&&d>0,this.updated||this.advanced?this.misses=Math.floor(p.misses*.6):this.misses=p.misses+1,this.availabilityDelay=p.availabilityDelay},M(k,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(z.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||W}},{key:"drift",get:function(){var p=this.driftEndTime-this.driftStartTime;if(p>0){var f=this.driftEnd-this.driftStart;return f*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}}]),k}()},"./src/loader/level-key.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"LevelKey",function(){return B});var z=D("./node_modules/url-toolkit/src/url-toolkit.js"),N=D.n(z);function M(k,R){for(var g=0;g2){var _=E.shift()+".";return _+=parseInt(E.shift()).toString(16),_+=("000"+parseInt(E.shift()).toString(16)).substr(-4),_}return T},A.resolve=function(T,E){return N.buildAbsoluteURL(E,T,{alwaysNormalize:!0})},A.parseMasterPlaylist=function(T,E){var _=[],u={},y=!1;f.lastIndex=0;for(var m;(m=f.exec(T))!=null;)if(m[1]){var b=new R.AttrList(m[1]),P={attrs:b,bitrate:b.decimalInteger("AVERAGE-BANDWIDTH")||b.decimalInteger("BANDWIDTH"),name:b.NAME,url:A.resolve(m[2],E)},I=b.decimalResolution("RESOLUTION");I&&(P.width=I.width,P.height=I.height),h((b.CODECS||"").split(/[ ,]+/).filter(function(F){return F}),P),P.videoCodec&&P.videoCodec.indexOf("avc1")!==-1&&(P.videoCodec=A.convertAVC1ToAVCOTI(P.videoCodec)),_.push(P)}else if(m[3]){var U=new R.AttrList(m[3]);U["DATA-ID"]&&(y=!0,u[U["DATA-ID"]]=U)}return{levels:_,sessionData:y?u:null}},A.parseMasterPlaylistMedia=function(T,E,_,u){u===void 0&&(u=[]);var y,m=[],b=0;for(d.lastIndex=0;(y=d.exec(T))!==null;){var P=new R.AttrList(y[1]);if(P.TYPE===_){var I={attrs:P,bitrate:0,id:b++,groupId:P["GROUP-ID"],instreamId:P["INSTREAM-ID"],name:P.NAME||P.LANGUAGE||"",type:_,default:P.bool("DEFAULT"),autoselect:P.bool("AUTOSELECT"),forced:P.bool("FORCED"),lang:P.LANGUAGE,url:P.URI?A.resolve(P.URI,E):""};if(u.length){var U=A.findGroup(u,I.groupId)||u[0];O(I,U,"audioCodec"),O(I,U,"textCodec")}m.push(I)}}return m},A.parseLevelPlaylist=function(T,E,_,u,y){var m=new B.LevelDetails(E),b=m.fragments,P=null,I=0,U=0,F=0,L=0,v=null,j=new W.Fragment(u,E),K,J,ee,ve=-1,de=!1;for(o.lastIndex=0,m.m3u8=T;(K=o.exec(T))!==null;){de&&(de=!1,j=new W.Fragment(u,E),j.start=F,j.sn=I,j.cc=L,j.level=_,P&&(j.initSegment=P,j.rawProgramDateTime=P.rawProgramDateTime));var me=K[1];if(me){j.duration=parseFloat(me);var ce=(" "+K[2]).slice(1);j.title=ce||null,j.tagList.push(ce?["INF",me,ce]:["INF",me])}else if(K[3])Object(z.isFiniteNumber)(j.duration)&&(j.start=F,ee&&(j.levelkey=ee),j.sn=I,j.level=_,j.cc=L,j.urlId=y,b.push(j),j.relurl=(" "+K[3]).slice(1),x(j,v),v=j,F+=j.duration,I++,U=0,de=!0);else if(K[4]){var pe=(" "+K[4]).slice(1);v?j.setByteRange(pe,v):j.setByteRange(pe)}else if(K[5])j.rawProgramDateTime=(" "+K[5]).slice(1),j.tagList.push(["PROGRAM-DATE-TIME",j.rawProgramDateTime]),ve===-1&&(ve=b.length);else{if(K=K[0].match(c),!K){g.logger.warn("No matches on slow regex match for level playlist!");continue}for(J=1;J-1){g.logger.warn("Keyformat "+Ye+" is not supported from the manifest");continue}else if(Ye!=="identity")continue;Re&&(ee=k.LevelKey.fromURL(E,ke),ke&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Re)>=0&&(ee.method=Re,ee.keyFormat=Ye,Le&&(ee.keyID=Le),Ie&&(ee.keyFormatVersions=Ie),ee.iv=Ne));break}case"START":{var Xe=new R.AttrList(he),We=Xe.decimalFloatingPoint("TIME-OFFSET");Object(z.isFiniteNumber)(We)&&(m.startTimeOffset=We);break}case"MAP":{var Je=new R.AttrList(he);j.relurl=Je.URI,Je.BYTERANGE&&j.setByteRange(Je.BYTERANGE),j.level=_,j.sn="initSegment",ee&&(j.levelkey=ee),j.initSegment=null,P=j,de=!0;break}case"SERVER-CONTROL":{var je=new R.AttrList(he);m.canBlockReload=je.bool("CAN-BLOCK-RELOAD"),m.canSkipUntil=je.optionalFloat("CAN-SKIP-UNTIL",0),m.canSkipDateRanges=m.canSkipUntil>0&&je.bool("CAN-SKIP-DATERANGES"),m.partHoldBack=je.optionalFloat("PART-HOLD-BACK",0),m.holdBack=je.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var He=new R.AttrList(he);m.partTarget=He.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Se=m.partList;Se||(Se=m.partList=[]);var qe=U>0?Se[Se.length-1]:void 0,Ke=U++,xe=new W.Part(new R.AttrList(he),j,E,Ke,qe);Se.push(xe),j.duration+=xe.duration;break}case"PRELOAD-HINT":{var Pe=new R.AttrList(he);m.preloadHint=Pe;break}case"RENDITION-REPORT":{var _e=new R.AttrList(he);m.renditionReports=m.renditionReports||[],m.renditionReports.push(_e);break}default:g.logger.warn("line parsed but not handled: "+K);break}}}v&&!v.relurl?(b.pop(),F-=v.duration,m.partList&&(m.fragmentHint=v)):m.partList&&(x(j,v),j.cc=L,m.fragmentHint=j);var le=b.length,fe=b[0],Q=b[le-1];if(F+=m.skippedSegments*m.targetduration,F>0&&le&&Q){m.averagetargetduration=F/le;var Z=Q.sn;m.endSN=Z!=="initSegment"?Z:0,fe&&(m.startCC=fe.cc,fe.initSegment||m.fragments.every(function(re){return re.relurl&&a(re.relurl)})&&(g.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),j=new W.Fragment(u,E),j.relurl=Q.relurl,j.level=_,j.sn="initSegment",fe.initSegment=j,m.needSidxRanges=!0))}else m.endSN=0,m.startCC=0;return m.fragmentHint&&(F+=m.fragmentHint.duration),m.totalduration=F,m.endCC=L,ve>0&&w(b,ve),m},A}();function h(A,S){["video","audio","text"].forEach(function(T){var E=A.filter(function(u){return Object(p.isCodecType)(u,T)});if(E.length){var _=E.filter(function(u){return u.lastIndexOf("avc1",0)===0||u.lastIndexOf("mp4a",0)===0});S[T+"Codec"]=_.length>0?_[0]:E[0],A=A.filter(function(u){return E.indexOf(u)===-1})}}),S.unknownCodecs=A}function O(A,S,T){var E=S[T];E&&(A[T]=E)}function w(A,S){for(var T=A[S],E=S;E--;){var _=A[E];if(!_)return;_.programDateTime=T.programDateTime-_.duration*1e3,T=_}}function x(A,S){A.rawProgramDateTime?A.programDateTime=Date.parse(A.rawProgramDateTime):S!=null&&S.programDateTime&&(A.programDateTime=S.endProgramDateTime),Object(z.isFiniteNumber)(A.programDateTime)||(A.programDateTime=null,A.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(ne,V,D){"use strict";D.r(V);var z=D("./src/polyfills/number.ts"),N=D("./src/events.ts"),M=D("./src/errors.ts"),W=D("./src/utils/logger.ts"),B=D("./src/utils/mp4-tools.ts"),k=D("./src/loader/m3u8-parser.ts"),R=D("./src/types/loader.ts"),g=D("./src/utils/attr-list.ts");function p(o){var c=o.type;switch(c){case R.PlaylistContextType.AUDIO_TRACK:return R.PlaylistLevelType.AUDIO;case R.PlaylistContextType.SUBTITLE_TRACK:return R.PlaylistLevelType.SUBTITLE;default:return R.PlaylistLevelType.MAIN}}function f(o,c){var s=o.url;return(s===void 0||s.indexOf("data:")===0)&&(s=c.url),s}var d=function(){function o(s){this.hls=void 0,this.loaders=Object.create(null),this.hls=s,this.registerListeners()}var c=o.prototype;return c.registerListeners=function(){var a=this.hls;a.on(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.on(N.Events.LEVEL_LOADING,this.onLevelLoading,this),a.on(N.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),a.on(N.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},c.unregisterListeners=function(){var a=this.hls;a.off(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.off(N.Events.LEVEL_LOADING,this.onLevelLoading,this),a.off(N.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),a.off(N.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},c.createInternalLoader=function(a){var l=this.hls.config,h=l.pLoader,O=l.loader,w=h||O,x=new w(l);return a.loader=x,this.loaders[a.type]=x,x},c.getInternalLoader=function(a){return this.loaders[a.type]},c.resetInternalLoader=function(a){this.loaders[a]&&delete this.loaders[a]},c.destroyInternalLoaders=function(){for(var a in this.loaders){var l=this.loaders[a];l&&l.destroy(),this.resetInternalLoader(a)}},c.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},c.onManifestLoading=function(a,l){var h=l.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:R.PlaylistContextType.MANIFEST,url:h,deliveryDirectives:null})},c.onLevelLoading=function(a,l){var h=l.id,O=l.level,w=l.url,x=l.deliveryDirectives;this.load({id:h,groupId:null,level:O,responseType:"text",type:R.PlaylistContextType.LEVEL,url:w,deliveryDirectives:x})},c.onAudioTrackLoading=function(a,l){var h=l.id,O=l.groupId,w=l.url,x=l.deliveryDirectives;this.load({id:h,groupId:O,level:null,responseType:"text",type:R.PlaylistContextType.AUDIO_TRACK,url:w,deliveryDirectives:x})},c.onSubtitleTrackLoading=function(a,l){var h=l.id,O=l.groupId,w=l.url,x=l.deliveryDirectives;this.load({id:h,groupId:O,level:null,responseType:"text",type:R.PlaylistContextType.SUBTITLE_TRACK,url:w,deliveryDirectives:x})},c.load=function(a){var l,h=this.hls.config,O=this.getInternalLoader(a);if(O){var w=O.context;if(w&&w.url===a.url){W.logger.trace("[playlist-loader]: playlist request ongoing");return}W.logger.log("[playlist-loader]: aborting previous loader for type: "+a.type),O.abort()}var x,A,S,T;switch(a.type){case R.PlaylistContextType.MANIFEST:x=h.manifestLoadingMaxRetry,A=h.manifestLoadingTimeOut,S=h.manifestLoadingRetryDelay,T=h.manifestLoadingMaxRetryTimeout;break;case R.PlaylistContextType.LEVEL:case R.PlaylistContextType.AUDIO_TRACK:case R.PlaylistContextType.SUBTITLE_TRACK:x=0,A=h.levelLoadingTimeOut;break;default:x=h.levelLoadingMaxRetry,A=h.levelLoadingTimeOut,S=h.levelLoadingRetryDelay,T=h.levelLoadingMaxRetryTimeout;break}if(O=this.createInternalLoader(a),(l=a.deliveryDirectives)!==null&&l!==void 0&&l.part){var E;if(a.type===R.PlaylistContextType.LEVEL&&a.level!==null?E=this.hls.levels[a.level].details:a.type===R.PlaylistContextType.AUDIO_TRACK&&a.id!==null?E=this.hls.audioTracks[a.id].details:a.type===R.PlaylistContextType.SUBTITLE_TRACK&&a.id!==null&&(E=this.hls.subtitleTracks[a.id].details),E){var _=E.partTarget,u=E.targetduration;_&&u&&(A=Math.min(Math.max(_*3,u*.8)*1e3,A))}}var y={timeout:A,maxRetry:x,retryDelay:S,maxRetryDelay:T,highWaterMark:0},m={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};O.load(a,y,m)},c.loadsuccess=function(a,l,h,O){if(O===void 0&&(O=null),h.isSidxRequest){this.handleSidxRequest(a,h),this.handlePlaylistLoaded(a,l,h,O);return}this.resetInternalLoader(h.type);var w=a.data;if(w.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(a,h,"no EXTM3U delimiter",O);return}l.parsing.start=performance.now(),w.indexOf("#EXTINF:")>0||w.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(a,l,h,O):this.handleMasterPlaylist(a,l,h,O)},c.loaderror=function(a,l,h){h===void 0&&(h=null),this.handleNetworkError(l,h,!1,a)},c.loadtimeout=function(a,l,h){h===void 0&&(h=null),this.handleNetworkError(l,h,!0)},c.handleMasterPlaylist=function(a,l,h,O){var w=this.hls,x=a.data,A=f(a,h),S=k.default.parseMasterPlaylist(x,A),T=S.levels,E=S.sessionData;if(!T.length){this.handleManifestParsingError(a,h,"no level found in manifest",O);return}var _=T.map(function(I){return{id:I.attrs.AUDIO,audioCodec:I.audioCodec}}),u=T.map(function(I){return{id:I.attrs.SUBTITLES,textCodec:I.textCodec}}),y=k.default.parseMasterPlaylistMedia(x,A,"AUDIO",_),m=k.default.parseMasterPlaylistMedia(x,A,"SUBTITLES",u),b=k.default.parseMasterPlaylistMedia(x,A,"CLOSED-CAPTIONS");if(y.length){var P=y.some(function(I){return!I.url});!P&&T[0].audioCodec&&!T[0].attrs.AUDIO&&(W.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),y.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new g.AttrList({}),bitrate:0,url:""}))}w.trigger(N.Events.MANIFEST_LOADED,{levels:T,audioTracks:y,subtitles:m,captions:b,url:A,stats:l,networkDetails:O,sessionData:E})},c.handleTrackOrLevelPlaylist=function(a,l,h,O){var w=this.hls,x=h.id,A=h.level,S=h.type,T=f(a,h),E=Object(z.isFiniteNumber)(x)?x:0,_=Object(z.isFiniteNumber)(A)?A:E,u=p(h),y=k.default.parseLevelPlaylist(a.data,T,_,u,E);if(!y.fragments.length){w.trigger(N.Events.ERROR,{type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:T,reason:"no fragments found in level",level:typeof h.level=="number"?h.level:void 0});return}if(S===R.PlaylistContextType.MANIFEST){var m={attrs:new g.AttrList({}),bitrate:0,details:y,name:"",url:T};w.trigger(N.Events.MANIFEST_LOADED,{levels:[m],audioTracks:[],url:T,stats:l,networkDetails:O,sessionData:null})}if(l.parsing.end=performance.now(),y.needSidxRanges){var b,P=(b=y.fragments[0].initSegment)===null||b===void 0?void 0:b.url;this.load({url:P,isSidxRequest:!0,type:S,level:A,levelDetails:y,id:x,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}h.levelDetails=y,this.handlePlaylistLoaded(a,l,h,O)},c.handleSidxRequest=function(a,l){var h=Object(B.parseSegmentIndex)(new Uint8Array(a.data));if(!h)return;var O=h.references,w=l.levelDetails;O.forEach(function(x,A){var S=x.info,T=w.fragments[A];T.byteRange.length===0&&T.setByteRange(String(1+S.end-S.start)+"@"+String(S.start)),T.initSegment&&T.initSegment.setByteRange(String(h.moovEndOffset)+"@0")})},c.handleManifestParsingError=function(a,l,h,O){this.hls.trigger(N.Events.ERROR,{type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:l.type===R.PlaylistContextType.MANIFEST,url:a.url,reason:h,response:a,context:l,networkDetails:O})},c.handleNetworkError=function(a,l,h,O){h===void 0&&(h=!1),W.logger.warn("[playlist-loader]: A network "+(h?"timeout":"error")+" occurred while loading "+a.type+" level: "+a.level+" id: "+a.id+' group-id: "'+a.groupId+'"');var w=M.ErrorDetails.UNKNOWN,x=!1,A=this.getInternalLoader(a);switch(a.type){case R.PlaylistContextType.MANIFEST:w=h?M.ErrorDetails.MANIFEST_LOAD_TIMEOUT:M.ErrorDetails.MANIFEST_LOAD_ERROR,x=!0;break;case R.PlaylistContextType.LEVEL:w=h?M.ErrorDetails.LEVEL_LOAD_TIMEOUT:M.ErrorDetails.LEVEL_LOAD_ERROR,x=!1;break;case R.PlaylistContextType.AUDIO_TRACK:w=h?M.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:M.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,x=!1;break;case R.PlaylistContextType.SUBTITLE_TRACK:w=h?M.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:M.ErrorDetails.SUBTITLE_LOAD_ERROR,x=!1;break}A&&this.resetInternalLoader(a.type);var S={type:M.ErrorTypes.NETWORK_ERROR,details:w,fatal:x,url:a.url,loader:A,context:a,networkDetails:l};O&&(S.response=O),this.hls.trigger(N.Events.ERROR,S)},c.handlePlaylistLoaded=function(a,l,h,O){var w=h.type,x=h.level,A=h.id,S=h.groupId,T=h.loader,E=h.levelDetails,_=h.deliveryDirectives;if(!(E!=null&&E.targetduration)){this.handleManifestParsingError(a,h,"invalid target duration",O);return}if(!T)return;E.live&&(T.getCacheAge&&(E.ageHeader=T.getCacheAge()||0),(!T.getCacheAge||isNaN(E.ageHeader))&&(E.ageHeader=0));switch(w){case R.PlaylistContextType.MANIFEST:case R.PlaylistContextType.LEVEL:this.hls.trigger(N.Events.LEVEL_LOADED,{details:E,level:x||0,id:A||0,stats:l,networkDetails:O,deliveryDirectives:_});break;case R.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(N.Events.AUDIO_TRACK_LOADED,{details:E,id:A||0,groupId:S||"",stats:l,networkDetails:O,deliveryDirectives:_});break;case R.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(N.Events.SUBTITLE_TRACK_LOADED,{details:E,id:A||0,groupId:S||"",stats:l,networkDetails:O,deliveryDirectives:_});break}},o}();V.default=d},"./src/polyfills/number.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"isFiniteNumber",function(){return z}),D.d(V,"MAX_SAFE_INTEGER",function(){return N});var z=Number.isFinite||function(M){return typeof M=="number"&&isFinite(M)},N=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(ne,V,D){"use strict";D.r(V);var z=function(){function N(){}return N.getSilentFrame=function(W,B){switch(W){case"mp4a.40.2":if(B===1)return new Uint8Array([0,200,0,128,35,128]);if(B===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(B===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(B===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(B===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(B===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(B===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(B===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(B===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},N}();V.default=z},"./src/remux/mp4-generator.ts":function(ne,V,D){"use strict";D.r(V);var z=Math.pow(2,32)-1,N=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 B;for(B in M.types)M.types.hasOwnProperty(B)&&(M.types[B]=[B.charCodeAt(0),B.charCodeAt(1),B.charCodeAt(2),B.charCodeAt(3)]);var k=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),R=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);M.HDLR_TYPES={video:k,audio:R};var g=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),p=new Uint8Array([0,0,0,0,0,0,0,0]);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 f=new Uint8Array([105,115,111,109]),d=new Uint8Array([97,118,99,49]),o=new Uint8Array([0,0,0,1]);M.FTYP=M.box(M.types.ftyp,f,o,f,d),M.DINF=M.box(M.types.dinf,M.box(M.types.dref,g))},M.box=function(B){for(var k=8,R=arguments.length,g=new Array(R>1?R-1:0),p=1;p>24&255,o[1]=k>>16&255,o[2]=k>>8&255,o[3]=k&255,o.set(B,4),f=0,k=8;f>24&255,B>>16&255,B>>8&255,B&255,R>>24,R>>16&255,R>>8&255,R&255,g>>24,g>>16&255,g>>8&255,g&255,85,196,0,0]))},M.mdia=function(B){return M.box(M.types.mdia,M.mdhd(B.timescale,B.duration),M.hdlr(B.type),M.minf(B))},M.mfhd=function(B){return M.box(M.types.mfhd,new Uint8Array([0,0,0,0,B>>24,B>>16&255,B>>8&255,B&255]))},M.minf=function(B){return B.type==="audio"?M.box(M.types.minf,M.box(M.types.smhd,M.SMHD),M.DINF,M.stbl(B)):M.box(M.types.minf,M.box(M.types.vmhd,M.VMHD),M.DINF,M.stbl(B))},M.moof=function(B,k,R){return M.box(M.types.moof,M.mfhd(B),M.traf(R,k))},M.moov=function(B){for(var k=B.length,R=[];k--;)R[k]=M.trak(B[k]);return M.box.apply(null,[M.types.moov,M.mvhd(B[0].timescale,B[0].duration)].concat(R).concat(M.mvex(B)))},M.mvex=function(B){for(var k=B.length,R=[];k--;)R[k]=M.trex(B[k]);return M.box.apply(null,[M.types.mvex].concat(R))},M.mvhd=function(B,k){k*=B;var R=Math.floor(k/(z+1)),g=Math.floor(k%(z+1)),p=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,B>>24&255,B>>16&255,B>>8&255,B&255,R>>24,R>>16&255,R>>8&255,R&255,g>>24,g>>16&255,g>>8&255,g&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return M.box(M.types.mvhd,p)},M.sdtp=function(B){var k=B.samples||[],R=new Uint8Array(4+k.length),g,p;for(g=0;g>>8&255),k.push(f&255),k=k.concat(Array.prototype.slice.call(p));for(g=0;g>>8&255),R.push(f&255),R=R.concat(Array.prototype.slice.call(p));var d=M.box(M.types.avcC,new Uint8Array([1,k[3],k[4],k[5],252|3,224|B.sps.length].concat(k).concat([B.pps.length]).concat(R))),o=B.width,c=B.height,s=B.pixelRatio[0],a=B.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,o>>8&255,o&255,c>>8&255,c&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),d,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([s>>24,s>>16&255,s>>8&255,s&255,a>>24,a>>16&255,a>>8&255,a&255])))},M.esds=function(B){var k=B.config.length;return new Uint8Array([0,0,0,0,3,23+k,0,1,0,4,15+k,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([k]).concat(B.config).concat([6,1,2]))},M.mp4a=function(B){var k=B.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,B.channelCount,0,16,0,0,0,0,k>>8&255,k&255,0,0]),M.box(M.types.esds,M.esds(B)))},M.mp3=function(B){var k=B.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,B.channelCount,0,16,0,0,0,0,k>>8&255,k&255,0,0]))},M.stsd=function(B){return B.type==="audio"?!B.isAAC&&B.codec==="mp3"?M.box(M.types.stsd,M.STSD,M.mp3(B)):M.box(M.types.stsd,M.STSD,M.mp4a(B)):M.box(M.types.stsd,M.STSD,M.avc1(B))},M.tkhd=function(B){var k=B.id,R=B.duration*B.timescale,g=B.width,p=B.height,f=Math.floor(R/(z+1)),d=Math.floor(R%(z+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,k>>24&255,k>>16&255,k>>8&255,k&255,0,0,0,0,f>>24,f>>16&255,f>>8&255,f&255,d>>24,d>>16&255,d>>8&255,d&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,g>>8&255,g&255,0,0,p>>8&255,p&255,0,0]))},M.traf=function(B,k){var R=M.sdtp(B),g=B.id,p=Math.floor(k/(z+1)),f=Math.floor(k%(z+1));return M.box(M.types.traf,M.box(M.types.tfhd,new Uint8Array([0,0,0,0,g>>24,g>>16&255,g>>8&255,g&255])),M.box(M.types.tfdt,new Uint8Array([1,0,0,0,p>>24,p>>16&255,p>>8&255,p&255,f>>24,f>>16&255,f>>8&255,f&255])),M.trun(B,R.length+16+20+8+16+8+8),R)},M.trak=function(B){return B.duration=B.duration||4294967295,M.box(M.types.trak,M.tkhd(B),M.mdia(B))},M.trex=function(B){var k=B.id;return M.box(M.types.trex,new Uint8Array([0,0,0,0,k>>24,k>>16&255,k>>8&255,k&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},M.trun=function(B,k){var R=B.samples||[],g=R.length,p=12+16*g,f=new Uint8Array(p),d,o,c,s,a,l;for(k+=8+p,f.set([0,0,15,1,g>>>24&255,g>>>16&255,g>>>8&255,g&255,k>>>24&255,k>>>16&255,k>>>8&255,k&255],0),d=0;d>>24&255,c>>>16&255,c>>>8&255,c&255,s>>>24&255,s>>>16&255,s>>>8&255,s&255,a.isLeading<<2|a.dependsOn,a.isDependedOn<<6|a.hasRedundancy<<4|a.paddingValue<<1|a.isNonSync,a.degradPrio&240<<8,a.degradPrio&15,l>>>24&255,l>>>16&255,l>>>8&255,l&255],12+16*d);return M.box(M.types.trun,f)},M.initSegment=function(B){M.types||M.init();var k=M.moov(B),R=new Uint8Array(M.FTYP.byteLength+k.byteLength);return R.set(M.FTYP),R.set(k,M.FTYP.byteLength),R},M}();N.types=void 0,N.HDLR_TYPES=void 0,N.STTS=void 0,N.STSC=void 0,N.STCO=void 0,N.STSZ=void 0,N.VMHD=void 0,N.SMHD=void 0,N.STSD=void 0,N.FTYP=void 0,N.DINF=void 0,V.default=N},"./src/remux/mp4-remuxer.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"default",function(){return l}),D.d(V,"normalizePts",function(){return h});var z=D("./src/polyfills/number.ts"),N=D("./src/remux/aac-helper.ts"),M=D("./src/remux/mp4-generator.ts"),W=D("./src/events.ts"),B=D("./src/errors.ts"),k=D("./src/utils/logger.ts"),R=D("./src/types/loader.ts"),g=D("./src/utils/timescale-conversion.ts");function p(){return p=Object.assign||function(A){for(var S=1;S0?y:m.pts},E[0].pts);return _&&k.logger.debug("PTS rollover detected"),u},S.remux=function(E,_,u,y,m,b,P,I){var U,F,L,v,j,K,J=m,ee=m,ve=E.pid>-1,de=_.pid>-1,me=_.samples.length,ce=E.samples.length>0,pe=me>1,ae=(!ve||ce)&&(!de||pe)||this.ISGenerated||P;if(ae){this.ISGenerated||(L=this.generateIS(E,_,m));var he=this.isVideoContiguous,$=-1;if(pe&&($=O(_.samples),!he&&this.config.forceKeyFrameOnDiscontinuity))if(K=!0,$>0){k.logger.warn("[mp4-remuxer]: Dropped "+$+" out of "+me+" video samples due to a missing keyframe");var ie=this.getVideoStartPts(_.samples);_.samples=_.samples.slice($),_.dropped+=$,ee+=(_.samples[0].pts-ie)/(_.timescale||9e4)}else $===-1&&(k.logger.warn("[mp4-remuxer]: No keyframe found out of "+me+" video samples"),K=!1);if(this.ISGenerated){if(ce&&pe){var q=this.getVideoStartPts(_.samples),Ee=h(E.samples[0].pts,q)-q,Ae=Ee/_.inputTimeScale;J+=Math.max(0,Ae),ee+=Math.max(0,-Ae)}if(ce){if(E.samplerate||(k.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),L=this.generateIS(E,_,m)),F=this.remuxAudio(E,J,this.isAudioContiguous,b,de||pe||I===R.PlaylistLevelType.AUDIO?ee:void 0),pe){var ye=F?F.endPTS-F.startPTS:0;_.inputTimeScale||(k.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),L=this.generateIS(E,_,m)),U=this.remuxVideo(_,ee,he,ye)}}else pe&&(U=this.remuxVideo(_,ee,he,0));U&&(U.firstKeyFrame=$,U.independent=$!==-1)}}return this.ISGenerated&&(u.samples.length&&(j=this.remuxID3(u,m)),y.samples.length&&(v=this.remuxText(y,m))),{audio:F,video:U,initSegment:L,independent:K,text:v,id3:j}},S.generateIS=function(E,_,u){var y=E.samples,m=_.samples,b=this.typeSupported,P={},I=!Object(z.isFiniteNumber)(this._initPTS),U="audio/mp4",F,L,v;if(I&&(F=L=Infinity),E.config&&y.length&&(E.timescale=E.samplerate,E.isAAC||(b.mpeg?(U="audio/mpeg",E.codec=""):b.mp3&&(E.codec="mp3")),P.audio={id:"audio",container:U,codec:E.codec,initSegment:!E.isAAC&&b.mpeg?new Uint8Array(0):M.default.initSegment([E]),metadata:{channelCount:E.channelCount}},I&&(v=E.inputTimeScale,F=L=y[0].pts-Math.round(v*u))),_.sps&&_.pps&&m.length&&(_.timescale=_.inputTimeScale,P.video={id:"main",container:"video/mp4",codec:_.codec,initSegment:M.default.initSegment([_]),metadata:{width:_.width,height:_.height}},I)){v=_.inputTimeScale;var j=this.getVideoStartPts(m),K=Math.round(v*u);L=Math.min(L,h(m[0].dts,j)-K),F=Math.min(F,j-K)}if(Object.keys(P).length)return this.ISGenerated=!0,I&&(this._initPTS=F,this._initDTS=L),{tracks:P,initPTS:F,timescale:v}},S.remuxVideo=function(E,_,u,y){var m=E.inputTimeScale,b=E.samples,P=[],I=b.length,U=this._initPTS,F=this.nextAvcDts,L=8,v,j,K,J=Number.POSITIVE_INFINITY,ee=Number.NEGATIVE_INFINITY,ve=0,de=!1;if(!u||F===null){var me=_*m,ce=b[0].pts-h(b[0].dts,b[0].pts);F=me-ce}for(var pe=0;peae.pts){var he=9e4*.2;ve=Math.max(Math.min(ve,ae.pts-ae.dts),-1*he)}ae.dts0?pe-1:pe].dts&&(de=!0)}de&&b.sort(function(Et,ct){var st=Et.dts-ct.dts,Ot=Et.pts-ct.pts;return st||Ot}),j=b[0].dts,K=b[b.length-1].dts;var $=Math.round((K-j)/(I-1));if(ve<0){if(ve<$*-2){k.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(g.toMsFromMpegTsClock)(-$,!0)+" ms");for(var ie=ve,q=0;q$,we=Ae<-1;if(ye||we){ye?k.logger.warn("AVC: "+Object(g.toMsFromMpegTsClock)(Ae,!0)+" ms ("+Ae+"dts) hole between fragments detected, filling it"):k.logger.warn("AVC: "+Object(g.toMsFromMpegTsClock)(-Ae,!0)+" ms ("+Ae+"dts) overlapping between fragments detected"),j=F;var Re=b[0].pts-Ae;b[0].dts=j,b[0].pts=Re,k.logger.log("Video: First PTS/DTS adjusted: "+Object(g.toMsFromMpegTsClock)(Re,!0)+"/"+Object(g.toMsFromMpegTsClock)(j,!0)+", delta: "+Object(g.toMsFromMpegTsClock)(Ae,!0)+" ms")}}a&&(j=Math.max(0,j));for(var ke=0,Ne=0,Ie=0;Ie0?Se-1:Se].dts;if(Z.stretchShortVideoTrack&&this.nextAudioPts!==null){var oe=Math.floor(Z.maxBufferHole*m),ge=(y?J+y*m:this.nextAudioPts)-qe.pts;ge>oe?(v=ge-re,v<0&&(v=re),k.logger.log("[mp4-remuxer]: It is approximately "+ge/90+" ms to the next segment; using duration "+v/90+" ms for the last video frame.")):v=re}else v=re}var Oe=Math.round(qe.pts-qe.dts);P.push(new w(qe.key,v,xe,Oe))}if(P.length&&c&&c<70){var De=P[0].flags;De.dependsOn=2,De.isNonSync=0}console.assert(v!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=F=K+v,this.isVideoContiguous=!0;var $e=M.default.moof(E.sequenceNumber++,j,p({},E,{samples:P})),tt="video",nt={data1:$e,data2:je,startPTS:J/m,endPTS:(ee+v)/m,startDTS:j/m,endDTS:F/m,type:tt,hasAudio:!1,hasVideo:!0,nb:P.length,dropped:E.dropped};return E.samples=[],E.dropped=0,console.assert(je.length,"MDAT length must not be zero"),nt},S.remuxAudio=function(E,_,u,y,m){var b=E.inputTimeScale,P=E.samplerate?E.samplerate:b,I=b/P,U=E.isAAC?d:o,F=U*I,L=this._initPTS,v=!E.isAAC&&this.typeSupported.mpeg,j=[],K=E.samples,J=v?0:8,ee=this.nextAudioPts||-1,ve=_*b;if(this.isAudioContiguous=u=u||K.length&&ee>0&&(y&&Math.abs(ve-ee)<9e3||Math.abs(h(K[0].pts-L,ve)-ee)<20*F),K.forEach(function(fe){fe.pts=h(fe.pts-L,ve)}),!u||ee<0){if(K=K.filter(function(fe){return fe.pts>=0}),!K.length)return;m===0?ee=0:y?ee=Math.max(0,ve):ee=K[0].pts}if(E.isAAC)for(var de=m!==void 0,me=this.config.maxAudioFramesDrift,ce=0,pe=ee;ce=me*F&&ie0){Ne+=J;try{ke=new Uint8Array(Ne)}catch(fe){this.observer.emit(W.Events.ERROR,W.Events.ERROR,{type:B.ErrorTypes.MUX_ERROR,details:B.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Ne,reason:"fail allocating audio mdat "+Ne});return}if(!v){var je=new DataView(ke.buffer);je.setUint32(0,Ne),ke.set(M.default.types.mdat,4)}}else return;ke.set(Xe,J);var He=Xe.byteLength;J+=He,j.push(new w(!0,U,He,0)),Re=We}var Se=j.length;if(!Se)return;var qe=j[j.length-1];this.nextAudioPts=ee=Re+I*qe.duration;var Ke=v?new Uint8Array(0):M.default.moof(E.sequenceNumber++,we/I,p({},E,{samples:j}));E.samples=[];var xe=we/b,Pe=ee/b,_e="audio",le={data1:Ke,data2:ke,startPTS:xe,endPTS:Pe,startDTS:xe,endDTS:Pe,type:_e,hasAudio:!0,hasVideo:!1,nb:Se};return this.isAudioContiguous=!0,console.assert(ke.length,"MDAT length must not be zero"),le},S.remuxEmptyAudio=function(E,_,u,y){var m=E.inputTimeScale,b=E.samplerate?E.samplerate:m,P=m/b,I=this.nextAudioPts,U=(I!==null?I:y.startDTS*m)+this._initDTS,F=y.endDTS*m+this._initDTS,L=P*d,v=Math.ceil((F-U)/L),j=N.default.getSilentFrame(E.manifestCodec||E.codec,E.channelCount);if(k.logger.warn("[mp4-remuxer]: remux empty Audio"),!j){k.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var K=[],J=0;J4294967296;)A+=T;return A}function O(A){for(var S=0;S0?this.lastEndDTS=E:(W.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var _=!!A.audio,u=!!A.video,y="";_&&(y+="audio"),u&&(y+="video");var m={data1:w,startPTS:T,startDTS:T,endPTS:E,endDTS:E,type:y,hasAudio:_,hasVideo:u,nb:1,dropped:0};return O.audio=m.type==="audio"?m:void 0,O.video=m.type!=="audio"?m:void 0,O.text=s,O.id3=c,O.initSegment=x,O},g}(),k=function(p,f,d){return Object(N.getStartDTS)(p,f)-d};function R(g,p){var f=g==null?void 0:g.codec;return f&&f.length>4?f:f==="hvc1"?"hvc1.1.c.L120.90":f==="av01"?"av01.0.04M.08":f==="avc1"||p===M.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}V.default=B},"./src/task-loop.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"default",function(){return z});var z=function(){function N(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var M=N.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(B){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,B),!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(){},N}()},"./src/types/cmcd.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"CMCDVersion",function(){return z}),D.d(V,"CMCDObjectType",function(){return N}),D.d(V,"CMCDStreamingFormat",function(){return M}),D.d(V,"CMCDStreamType",function(){return W});var z=1,N;(function(B){B.MANIFEST="m",B.AUDIO="a",B.VIDEO="v",B.MUXED="av",B.INIT="i",B.CAPTION="c",B.TIMED_TEXT="tt",B.KEY="k",B.OTHER="o"})(N||(N={}));var M;(function(B){B.DASH="d",B.HLS="h",B.SMOOTH="s",B.OTHER="o"})(M||(M={}));var W;(function(B){B.VOD="v",B.LIVE="l"})(W||(W={}))},"./src/types/level.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"HlsSkip",function(){return M}),D.d(V,"getSkipValue",function(){return W}),D.d(V,"HlsUrlParameters",function(){return B}),D.d(V,"Level",function(){return k});function z(R,g){for(var p=0;pNumber.MAX_SAFE_INTEGER?Infinity:g},B.hexadecimalInteger=function(R){if(this[R]){var g=(this[R]||"0x").slice(2);g=(g.length&1?"0":"")+g;for(var p=new Uint8Array(g.length/2),f=0;fNumber.MAX_SAFE_INTEGER?Infinity:g},B.decimalFloatingPoint=function(R){return parseFloat(this[R])},B.optionalFloat=function(R,g){var p=this[R];return p?parseFloat(p):g},B.enumeratedString=function(R){return this[R]},B.bool=function(R){return this[R]==="YES"},B.decimalResolution=function(R){var g=z.exec(this[R]);return g===null?void 0:{width:parseInt(g[1],10),height:parseInt(g[2],10)}},W.parseAttrList=function(R){var g,p={},f='"';for(N.lastIndex=0;(g=N.exec(R))!==null;){var d=g[2];d.indexOf(f)===0&&d.lastIndexOf(f)===d.length-1&&(d=d.slice(1,-1)),p[g[1]]=d}return p},W}()},"./src/utils/binary-search.ts":function(ne,V,D){"use strict";D.r(V);var z={search:function(M,W){for(var B=0,k=M.length-1,R=null,g=null;B<=k;){R=(B+k)/2|0,g=M[R];var p=W(g);if(p>0)B=R+1;else if(p<0)k=R-1;else return g}return null}};V.default=z},"./src/utils/buffer-helper.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"BufferHelper",function(){return M});var z=D("./src/utils/logger.ts"),N={length:0,start:function(){return 0},end:function(){return 0}},M=function(){function W(){}return W.isBuffered=function(k,R){try{if(k){for(var g=W.getBuffered(k),p=0;p=g.start(p)&&R<=g.end(p))return!0}}catch(f){}return!1},W.bufferInfo=function(k,R,g){try{if(k){var p=W.getBuffered(k),f=[],d;for(d=0;do&&(p[d-1].end=k[f].end):p.push(k[f])}else p.push(k[f])}else p=k;for(var c=0,s,a=R,l=R,h=0;h=O&&R=u&&z.logger.log(this.time+" ["+u+"] "+y)},T}(),c=function(E){for(var _=[],u=0;uB&&(this.logger.log(d.DEBUG,"Too large cursor position "+this.pos),this.pos=B)},E.moveCursor=function(u){var y=this.pos+u;if(u>1)for(var m=this.pos+1;m=144&&this.backSpace();var y=M(u);if(this.pos>=B){this.logger.log(d.ERROR,"Cannot insert "+u.toString(16)+" ("+y+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(y,this.currPenState),this.moveCursor(1)},E.clearFromPos=function(u){var y;for(y=u;y0&&(u?m="["+y.join(" | ")+"]":m=y.join(` `)),m},E.getTextAndFormat=function(){return this.rows},T}(),O=function(){function T(_,u,y){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=_,this.outputFilter=u,this.mode=null,this.verbose=0,this.displayedMemory=new h(y),this.nonDisplayedMemory=new h(y),this.lastOutputScreen=new h(y),this.currRollUpRow=this.displayedMemory.rows[W-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=y}var E=T.prototype;return E.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[W-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},E.getHandler=function(){return this.outputFilter},E.setHandler=function(u){this.outputFilter=u},E.setPAC=function(u){this.writeScreen.setPAC(u)},E.setBkgData=function(u){this.writeScreen.setBkgData(u)},E.setMode=function(u){if(u===this.mode)return;this.mode=u,this.logger.log(d.INFO,"MODE="+u),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=u},E.insertChars=function(u){for(var y=0;y=46,y.italics)y.foreground="white";else{var m=Math.floor(u/2)-16,b=["white","green","blue","cyan","red","yellow","magenta"];y.foreground=b[m]}this.logger.log(d.INFO,"MIDROW: "+JSON.stringify(y)),this.writeScreen.setPen(y)},E.outputDataUpdate=function(u){u===void 0&&(u=!1);var y=this.logger.time;if(y===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=y:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,y,this.lastOutputScreen),u&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:y),this.lastOutputScreen.copy(this.displayedMemory))},E.cueSplitAtTime=function(u){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,u,this.displayedMemory),this.cueStartTime=u))},T}(),w=function(){function T(_,u,y){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var m=new o;this.channels=[null,new O(_,u,m),new O(_+1,y,m)],this.cmdHistory=S(),this.logger=m}var E=T.prototype;return E.getHandler=function(u){return this.channels[u].getHandler()},E.setHandler=function(u,y){this.channels[u].setHandler(y)},E.addData=function(u,y){var m,b,P,I=!1;this.logger.time=u;for(var U=0;U ("+c([b,P])+")"),m=this.parseCmd(b,P),m||(m=this.parseMidrow(b,P)),m||(m=this.parsePAC(b,P)),m||(m=this.parseBackgroundAttributes(b,P)),!m&&(I=this.parseChars(b,P),I)){var F=this.currentChannel;if(F&&F>0){var L=this.channels[F];L.insertChars(I)}else this.logger.log(d.WARNING,"No channel found yet. TEXT-MODE?")}!m&&!I&&this.logger.log(d.WARNING,"Couldn't parse cleaned data "+c([b,P])+" orig: "+c([y[U],y[U+1]]))}},E.parseCmd=function(u,y){var m=this.cmdHistory,b=(u===20||u===28||u===21||u===29)&&y>=32&&y<=47,P=(u===23||u===31)&&y>=33&&y<=35;if(!(b||P))return!1;if(A(u,y,m))return x(null,null,m),this.logger.log(d.DEBUG,"Repeated command ("+c([u,y])+") is dropped"),!0;var I=u===20||u===21||u===23?1:2,U=this.channels[I];return u===20||u===21||u===28||u===29?y===32?U.ccRCL():y===33?U.ccBS():y===34?U.ccAOF():y===35?U.ccAON():y===36?U.ccDER():y===37?U.ccRU(2):y===38?U.ccRU(3):y===39?U.ccRU(4):y===40?U.ccFON():y===41?U.ccRDC():y===42?U.ccTR():y===43?U.ccRTD():y===44?U.ccEDM():y===45?U.ccCR():y===46?U.ccENM():y===47&&U.ccEOC():U.ccTO(y-32),x(u,y,m),this.currentChannel=I,!0},E.parseMidrow=function(u,y){var m=0;if((u===17||u===25)&&y>=32&&y<=47){if(u===17?m=1:m=2,m!==this.currentChannel)return this.logger.log(d.ERROR,"Mismatch channel in midrow parsing"),!1;var b=this.channels[m];return b?(b.ccMIDROW(y),this.logger.log(d.DEBUG,"MIDROW ("+c([u,y])+")"),!0):!1}return!1},E.parsePAC=function(u,y){var m,b=this.cmdHistory,P=(u>=17&&u<=23||u>=25&&u<=31)&&y>=64&&y<=127,I=(u===16||u===24)&&y>=64&&y<=95;if(!(P||I))return!1;if(A(u,y,b))return x(null,null,b),!0;var U=u<=23?1:2;y>=64&&y<=95?m=U===1?k[u]:g[u]:m=U===1?R[u]:p[u];var F=this.channels[U];return F?(F.setPAC(this.interpretPAC(m,y)),x(u,y,b),this.currentChannel=U,!0):!1},E.interpretPAC=function(u,y){var m,b={color:null,italics:!1,indent:null,underline:!1,row:u};return y>95?m=y-96:m=y-64,b.underline=(m&1)===1,m<=13?b.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(m/2)]:m<=15?(b.italics=!0,b.color="white"):b.indent=Math.floor((m-16)/2)*4,b},E.parseChars=function(u,y){var m,b=null,P=null;if(u>=25?(m=2,P=u-8):(m=1,P=u),P>=17&&P<=19){var I;P===17?I=y+80:P===18?I=y+112:I=y+144,this.logger.log(d.INFO,"Special char '"+M(I)+"' in channel "+m),b=[I]}else u>=32&&u<=127&&(b=y===0?[u]:[u,y]);if(b){var U=c(b);this.logger.log(d.DEBUG,"Char codes = "+U.join(",")),x(u,y,this.cmdHistory)}return b},E.parseBackgroundAttributes=function(u,y){var m=(u===16||u===24)&&y>=32&&y<=47,b=(u===23||u===31)&&y>=45&&y<=47;if(!(m||b))return!1;var P,I={};u===16||u===24?(P=Math.floor((y-32)/2),I.background=f[P],y%2===1&&(I.background=I.background+"_semi")):y===45?I.background="transparent":(I.foreground="black",y===47&&(I.underline=!0));var U=u<=23?1:2,F=this.channels[U];return F.setBkgData(I),x(u,y,this.cmdHistory),!0},E.reset=function(){for(var u=0;u=16?a--:a++;var x=Object(z.fixLineBreaks)(l.trim()),A=Object(N.generateCueId)(g,p,x);(!R||!R.cues||!R.cues.getCueById(A))&&(c=new h(g,p,x),c.id=A,c.line=O+1,c.align="left",c.position=10+Math.min(80,Math.floor(a*8/32)*10),d.push(c))}return R&&d.length&&(d.sort(function(S,T){return S.line==="auto"||T.line==="auto"?0:S.line>8&&T.line>8?T.line-S.line:S.line-T.line}),d.forEach(function(S){return Object(M.addCueToTrack)(R,S)})),d}};V.default=B},"./src/utils/discontinuities.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"findFirstFragWithCC",function(){return W}),D.d(V,"shouldAlignOnDiscontinuities",function(){return B}),D.d(V,"findDiscontinuousReferenceFrag",function(){return k}),D.d(V,"adjustSlidingStart",function(){return g}),D.d(V,"alignStream",function(){return p}),D.d(V,"alignPDT",function(){return d}),D.d(V,"alignFragmentByPDTDelta",function(){return o}),D.d(V,"alignMediaPlaylistByPDT",function(){return c});var z=D("./src/polyfills/number.ts"),N=D("./src/utils/logger.ts"),M=D("./src/controller/level-helper.ts");function W(s,a){for(var l=null,h=0,O=s.length;hl.startCC||s&&s.cc=this.minWeight_},W.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},W.destroy=function(){},M}();V.default=N},"./src/utils/ewma.ts":function(ne,V,D){"use strict";D.r(V);var z=function(){function N(W,B,k){B===void 0&&(B=0),k===void 0&&(k=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=W,this.alpha_=W?Math.exp(Math.log(.5)/W):0,this.estimate_=B,this.totalWeight_=k}var M=N.prototype;return M.sample=function(B,k){var R=Math.pow(this.alpha_,B);this.estimate_=k*(1-R)+R*this.estimate_,this.totalWeight_+=B},M.getTotalWeight=function(){return this.totalWeight_},M.getEstimate=function(){if(this.alpha_){var B=1-Math.pow(this.alpha_,this.totalWeight_);if(B)return this.estimate_/B}return this.estimate_},N}();V.default=z},"./src/utils/fetch-loader.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"fetchSupported",function(){return o});var z=D("./src/polyfills/number.ts"),N=D("./src/loader/load-stats.ts"),M=D("./src/demux/chunk-cache.ts");function W(h,O){h.prototype=Object.create(O.prototype),h.prototype.constructor=h,p(h,O)}function B(h){var O=typeof Map=="function"?new Map:void 0;return B=function(x){if(x===null||!g(x))return x;if(typeof x!="function")throw new TypeError("Super expression must either be null or a function");if(typeof O!="undefined"){if(O.has(x))return O.get(x);O.set(x,A)}function A(){return k(x,arguments,f(this).constructor)}return A.prototype=Object.create(x.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),p(A,x)},B(h)}function k(h,O,w){return R()?k=Reflect.construct:k=function(A,S,T){var E=[null];E.push.apply(E,S);var _=Function.bind.apply(A,E),u=new _;return T&&p(u,T.prototype),u},k.apply(null,arguments)}function R(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(h){return!1}}function g(h){return Function.toString.call(h).indexOf("[native code]")!==-1}function p(h,O){return p=Object.setPrototypeOf||function(x,A){return x.__proto__=A,x},p(h,O)}function f(h){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(w){return w.__proto__||Object.getPrototypeOf(w)},f(h)}function d(){return d=Object.assign||function(h){for(var O=1;O=T&&E(A,S,_.flush(),x)):E(A,S,P,x),m()}).catch(function(){return Promise.reject()})};return y()},h}();function s(h,O){var w={method:"GET",mode:"cors",credentials:"same-origin",signal:O,headers:new self.Headers(d({},h.headers))};return h.rangeEnd&&w.headers.set("Range","bytes="+h.rangeStart+"-"+String(h.rangeEnd-1)),w}function a(h,O){return new self.Request(h.url,O)}var l=function(h){W(O,h);function O(w,x,A){var S;return S=h.call(this,w)||this,S.code=void 0,S.details=void 0,S.code=x,S.details=A,S}return O}(B(Error));V.default=c},"./src/utils/imsc1-ttml-parser.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"IMSC1_CODEC",function(){return g}),D.d(V,"parseIMSC1",function(){return o});var z=D("./src/utils/mp4-tools.ts"),N=D("./src/utils/vttparser.ts"),M=D("./src/utils/vttcue.ts"),W=D("./src/demux/id3.ts"),B=D("./src/utils/timescale-conversion.ts"),k=D("./src/utils/webvtt-parser.ts");function R(){return R=Object.assign||function(T){for(var E=1;E"):z}function B(g){for(var p=arguments.length,f=new Array(p>1?p-1:0),d=1;d>24,O[w+1]=x>>16&255,O[w+2]=x>>8&255,O[w+3]=x&255}function p(O,w){var x=[];if(!w.length)return x;var A,S,T;"data"in O?(A=O.data,S=O.start,T=O.end):(A=O,S=0,T=A.byteLength);for(var E=S;E1?E+_:T;if(u===w[0])if(w.length===1)x.push({data:A,start:E+8,end:y});else{var m=p({data:A,start:E+8,end:y},w.slice(1));m.length&&W.apply(x,m)}E=y}return x}function f(O){var w=p(O,["moov"]),x=w[0],A=x?x.end:null,S=p(O,["sidx"]);if(!S||!S[0])return null;var T=[],E=S[0],_=E.data[0],u=_===0?8:16,y=R(E,u);u+=4;var m=0,b=0;_===0?u+=8:u+=16,u+=2;var P=E.end+b,I=k(E,u);u+=2;for(var U=0;U>>31;if(j===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var K=R(E,F);F+=4,T.push({referenceSize:v,subsegmentDuration:K,info:{duration:K/y,start:P,end:P+v-1}}),P+=v,F+=4,u=F}return{earliestPresentationTime:m,timescale:y,version:_,referencesCount:I,references:T,moovEndOffset:A}}function d(O){for(var w=[],x=p(O,["moov","trak"]),A=0;AB)&&(this.startTime=B),this.endTime=k,this.screen=R,this.timelineController.createCaptionsTrack(this.trackName)},M.reset=function(){this.cueRanges=[]},N}()},"./src/utils/texttrack-utils.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"sendAddTrackEvent",function(){return N}),D.d(V,"addCueToTrack",function(){return M}),D.d(V,"clearCurrentCues",function(){return W}),D.d(V,"removeCuesInRange",function(){return B}),D.d(V,"getCuesInRange",function(){return R});var z=D("./src/utils/logger.ts");function N(g,p){var f;try{f=new Event("addtrack")}catch(d){f=document.createEvent("Event"),f.initEvent("addtrack",!1,!1)}f.track=g,p.dispatchEvent(f)}function M(g,p){var f=g.mode;if(f==="disabled"&&(g.mode="hidden"),g.cues&&!g.cues.getCueById(p.id))try{if(g.addCue(p),!g.cues.getCueById(p.id))throw new Error("addCue is failed for: "+p)}catch(o){z.logger.debug("[texttrack-utils]: "+o);var d=new self.TextTrackCue(p.startTime,p.endTime,p.text);d.id=p.id,g.addCue(d)}f==="disabled"&&(g.mode=f)}function W(g){var p=g.mode;if(p==="disabled"&&(g.mode="hidden"),g.cues)for(var f=g.cues.length;f--;)g.removeCue(g.cues[f]);p==="disabled"&&(g.mode=p)}function B(g,p,f){var d=g.mode;if(d==="disabled"&&(g.mode="hidden"),g.cues&&g.cues.length>0)for(var o=R(g.cues,p,f),c=0;cg[f].endTime)return-1;for(var d=0,o=f;d<=o;){var c=Math.floor((o+d)/2);if(pg[c].startTime&&d-1)for(var c=o,s=g.length;c=p&&a.endTime<=f)d.push(a);else if(a.startTime>f)return d}return d}},"./src/utils/time-ranges.ts":function(ne,V,D){"use strict";D.r(V);var z={toString:function(M){for(var W="",B=M.length,k=0;k1?p-1:0),d=1;d100)throw new Error("Position must be between 0 and 100.");T=m,this.hasBeenReset=!0}})),Object.defineProperty(d,"positionAlign",k({},o,{get:function(){return E},set:function(m){var b=B(m);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");E=b,this.hasBeenReset=!0}})),Object.defineProperty(d,"size",k({},o,{get:function(){return _},set:function(m){if(m<0||m>100)throw new Error("Size must be between 0 and 100.");_=m,this.hasBeenReset=!0}})),Object.defineProperty(d,"align",k({},o,{get:function(){return u},set:function(m){var b=B(m);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");u=b,this.hasBeenReset=!0}})),d.displayState=void 0}return R.prototype.getCueAsHTML=function(){var g=self.WebVTT;return g.convertCueToDOMTree(self,this.text)},R}()},"./src/utils/vttparser.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"parseTimeStamp",function(){return M}),D.d(V,"fixLineBreaks",function(){return p}),D.d(V,"VTTParser",function(){return f});var z=D("./src/utils/vttcue.ts"),N=function(){function d(){}var o=d.prototype;return o.decode=function(s,a){if(!s)return"";if(typeof s!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(s))},d}();function M(d){function o(s,a,l,h){return(s|0)*3600+(a|0)*60+(l|0)+parseFloat(h||0)}var c=d.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return c?parseFloat(c[2])>59?o(c[2],c[3],0,c[4]):o(c[1],c[2],c[3],c[4]):null}var W=function(){function d(){this.values=Object.create(null)}var o=d.prototype;return o.set=function(s,a){!this.get(s)&&a!==""&&(this.values[s]=a)},o.get=function(s,a,l){return l?this.has(s)?this.values[s]:a[l]:this.has(s)?this.values[s]:a},o.has=function(s){return s in this.values},o.alt=function(s,a,l){for(var h=0;h=0&&l<=100)return this.set(s,l),!0}return!1},d}();function B(d,o,c,s){var a=s?d.split(s):[d];for(var l in a){if(typeof a[l]!="string")continue;var h=a[l].split(c);if(h.length!==2)continue;var O=h[0],w=h[1];o(O,w)}}var k=new z.default(0,0,""),R=k.align==="middle"?"middle":"center";function g(d,o,c){var s=d;function a(){var O=M(d);if(O===null)throw new Error("Malformed timestamp: "+s);return d=d.replace(/^[^\sa-zA-Z-]+/,""),O}function l(O,w){var x=new W;B(O,function(T,E){var _;switch(T){case"region":for(var u=c.length-1;u>=0;u--)if(c[u].id===E){x.set(T,c[u].region);break}break;case"vertical":x.alt(T,E,["rl","lr"]);break;case"line":_=E.split(","),x.integer(T,_[0]),x.percent(T,_[0])&&x.set("snapToLines",!1),x.alt(T,_[0],["auto"]),_.length===2&&x.alt("lineAlign",_[1],["start",R,"end"]);break;case"position":_=E.split(","),x.percent(T,_[0]),_.length===2&&x.alt("positionAlign",_[1],["start",R,"end","line-left","line-right","auto"]);break;case"size":x.percent(T,E);break;case"align":x.alt(T,E,["start",R,"end","left","right"]);break}},/:/,/\s/),w.region=x.get("region",null),w.vertical=x.get("vertical","");var A=x.get("line","auto");A==="auto"&&k.line===-1&&(A=-1),w.line=A,w.lineAlign=x.get("lineAlign","start"),w.snapToLines=x.get("snapToLines",!0),w.size=x.get("size",100),w.align=x.get("align",R);var S=x.get("position","auto");S==="auto"&&k.position===50&&(S=w.align==="start"||w.align==="left"?0:w.align==="end"||w.align==="right"?100:50),w.position=S}function h(){d=d.replace(/^\s+/,"")}if(h(),o.startTime=a(),h(),d.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+s);d=d.substr(3),h(),o.endTime=a(),h(),l(d,o)}function p(d){return d.replace(//gi,` `)}var f=function(){function d(){this.state="INITIAL",this.buffer="",this.decoder=new N,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var o=d.prototype;return o.parse=function(s){var a=this;s&&(a.buffer+=a.decoder.decode(s,{stream:!0}));function l(){var S=a.buffer,T=0;for(S=p(S);T")===-1){a.cue.id=O;continue}case"CUE":if(!a.cue){a.state="BADCUE";continue}try{g(O,a.cue,a.regionList)}catch(S){a.cue=null,a.state="BADCUE";continue}a.state="CUETEXT";continue;case"CUETEXT":{var A=O.indexOf("-->")!==-1;if(!O||A&&(x=!0)){a.oncue&&a.cue&&a.oncue(a.cue),a.cue=null,a.state="ID";continue}if(a.cue===null)continue;a.cue.text&&(a.cue.text+=` `),a.cue.text+=O}continue;case"BADCUE":O||(a.state="ID")}}}catch(S){a.state==="CUETEXT"&&a.cue&&a.oncue&&a.oncue(a.cue),a.cue=null,a.state=a.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},o.flush=function(){var s=this;try{if((s.cue||s.state==="HEADER")&&(s.buffer+=` `,s.parse()),s.state==="INITIAL"||s.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(a){s.onparsingerror&&s.onparsingerror(a)}return s.onflush&&s.onflush(),this},d}()},"./src/utils/webvtt-parser.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"generateCueId",function(){return f}),D.d(V,"parseWebVTT",function(){return o});var z=D("./src/polyfills/number.ts"),N=D("./src/utils/vttparser.ts"),M=D("./src/demux/id3.ts"),W=D("./src/utils/timescale-conversion.ts"),B=D("./src/remux/mp4-remuxer.ts"),k=/\r\n|\n\r|\n|\r/g,R=function(s,a,l){return l===void 0&&(l=0),s.substr(l,a.length)===a},g=function(s){var a=parseInt(s.substr(-3)),l=parseInt(s.substr(-6,2)),h=parseInt(s.substr(-9,2)),O=s.length>9?parseInt(s.substr(0,s.indexOf(":"))):0;if(!Object(z.isFiniteNumber)(a)||!Object(z.isFiniteNumber)(l)||!Object(z.isFiniteNumber)(h)||!Object(z.isFiniteNumber)(O))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+s);return a+=1e3*l,a+=60*1e3*h,a+=60*60*1e3*O,a},p=function(s){for(var a=5381,l=s.length;l;)a=a*33^s.charCodeAt(--l);return(a>>>0).toString()};function f(c,s,a){return p(c.toString())+p(s.toString())+p(a)}var d=function(s,a,l){var h=s[a],O=s[h.prevCC];if(!O||!O.new&&h.new){s.ccOffset=s.presentationOffset=h.start,h.new=!1;return}for(;(w=O)!==null&&w!==void 0&&w.new;){var w;s.ccOffset+=h.start-O.start,h.new=!1,h=O,O=s[h.prevCC]}s.presentationOffset=l};function o(c,s,a,l,h,O,w,x){var A=new N.VTTParser,S=Object(M.utf8ArrayToStr)(new Uint8Array(c)).trim().replace(k,` `).split(` `),T=[],E=Object(W.toMpegTsClockFromTimescale)(s,a),_="00:00.000",u=0,y=0,m,b=!0,P=!1;A.oncue=function(I){var U=l[h],F=l.ccOffset,L=(u-E)/9e4;if(U!=null&&U.new&&(y!==void 0?F=l.ccOffset=U.start:d(l,h,L)),L&&(F=L-l.presentationOffset),P){var v=I.endTime-I.startTime,j=Object(B.normalizePts)((I.startTime+F-y)*9e4,O*9e4)/9e4;I.startTime=j,I.endTime=j+v}var K=I.text.trim();I.text=decodeURIComponent(encodeURIComponent(K)),I.id||(I.id=f(I.startTime,I.endTime,K)),I.endTime>0&&T.push(I)},A.onparsingerror=function(I){m=I},A.onflush=function(){if(m){x(m);return}w(T)},S.forEach(function(I){if(b)if(R(I,"X-TIMESTAMP-MAP=")){b=!1,P=!0,I.substr(16).split(",").forEach(function(U){R(U,"LOCAL:")?_=U.substr(6):R(U,"MPEGTS:")&&(u=parseInt(U.substr(7)))});try{y=g(_)/1e3}catch(U){P=!1,m=U}return}else I===""&&(b=!1);A.parse(I+` `)}),A.flush()}},"./src/utils/xhr-loader.ts":function(ne,V,D){"use strict";D.r(V);var z=D("./src/utils/logger.ts"),N=D("./src/loader/load-stats.ts"),M=/^age:\s*[\d.]+\s*$/m,W=function(){function B(R){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=void 0,this.loader=null,this.stats=void 0,this.xhrSetup=R?R.xhrSetup:null,this.stats=new N.LoadStats,this.retryDelay=0}var k=B.prototype;return k.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},k.abortInternal=function(){var g=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),g&&(g.onreadystatechange=null,g.onprogress=null,g.readyState!==4&&(this.stats.aborted=!0,g.abort()))},k.abort=function(){var g;this.abortInternal(),(g=this.callbacks)!==null&&g!==void 0&&g.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},k.load=function(g,p,f){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=g,this.config=p,this.callbacks=f,this.retryDelay=p.retryDelay,this.loadInternal()},k.loadInternal=function(){var g=this.config,p=this.context;if(!g)return;var f=this.loader=new self.XMLHttpRequest,d=this.stats;d.loading.first=0,d.loaded=0;var o=this.xhrSetup;try{if(o)try{o(f,p.url)}catch(a){f.open("GET",p.url,!0),o(f,p.url)}f.readyState||f.open("GET",p.url,!0);var c=this.context.headers;if(c)for(var s in c)f.setRequestHeader(s,c[s])}catch(a){this.callbacks.onError({code:f.status,text:a.message},p,f);return}p.rangeEnd&&f.setRequestHeader("Range","bytes="+p.rangeStart+"-"+(p.rangeEnd-1)),f.onreadystatechange=this.readystatechange.bind(this),f.onprogress=this.loadprogress.bind(this),f.responseType=p.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),g.timeout),f.send()},k.readystatechange=function(){var g=this.context,p=this.loader,f=this.stats;if(!g||!p)return;var d=p.readyState,o=this.config;if(f.aborted)return;if(d>=2)if(self.clearTimeout(this.requestTimeout),f.loading.first===0&&(f.loading.first=Math.max(self.performance.now(),f.loading.start)),d===4){p.onreadystatechange=null,p.onprogress=null;var c=p.status;if(c>=200&&c<300){f.loading.end=Math.max(self.performance.now(),f.loading.first);var s,a;if(g.responseType==="arraybuffer"?(s=p.response,a=s.byteLength):(s=p.responseText,a=s.length),f.loaded=f.total=a,!this.callbacks)return;var l=this.callbacks.onProgress;if(l&&l(f,g,s,p),!this.callbacks)return;var h={url:p.responseURL,data:s};this.callbacks.onSuccess(h,f,g,p)}else f.retry>=o.maxRetry||c>=400&&c<499?(z.logger.error(c+" while loading "+g.url),this.callbacks.onError({code:c,text:p.statusText},g,p)):(z.logger.warn(c+" while loading "+g.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,o.maxRetryDelay),f.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),o.timeout)},k.loadtimeout=function(){z.logger.warn("timeout while loading "+this.context.url);var g=this.callbacks;g&&(this.abortInternal(),g.onTimeout(this.stats,this.context,this.loader))},k.loadprogress=function(g){var p=this.stats;p.loaded=g.loaded,g.lengthComputable&&(p.total=g.total)},k.getCacheAge=function(){var g=null;if(this.loader&&M.test(this.loader.getAllResponseHeaders())){var p=this.loader.getResponseHeader("age");g=p?parseFloat(p):null}return g},B}();V.default=W}}).default})},vHTk:function(at,Ve,te){at.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}}}]);