You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
166 lines
639 KiB
166 lines
639 KiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[217,5,7],{"+ua5":function(Be,Le,Y){},"55Ip":function(Be,Le,Y){"use strict";Y.d(Le,"a",function(){return t});var ae=Y("Ty5D"),M=Y("dI71"),S=Y("cDcd"),N=Y.n(S),w=Y("YS25"),R=Y("17x9"),D=Y.n(R),L=Y("wx14"),x=Y("zLVn"),T=Y("9R94"),m=function(u){Object(M.a)(d,u);function d(){for(var _,f=arguments.length,b=new Array(f),A=0;A<f;A++)b[A]=arguments[A];return _=u.call.apply(u,[this].concat(b))||this,_.history=Object(w.a)(_.props),_}var c=d.prototype;return c.render=function(){return N.a.createElement(ae.c,{history:this.history,children:this.props.children})},d}(N.a.Component),p=function(u){Object(M.a)(d,u);function d(){for(var _,f=arguments.length,b=new Array(f),A=0;A<f;A++)b[A]=arguments[A];return _=u.call.apply(u,[this].concat(b))||this,_.history=Object(w.b)(_.props),_}var c=d.prototype;return c.render=function(){return N.a.createElement(ae.c,{history:this.history,children:this.props.children})},d}(N.a.Component),o=function(d,c){return typeof d=="function"?d(c):d},a=function(d,c){return typeof d=="string"?Object(w.c)(d,null,null,c):d},n=function(d){return d},s=N.a.forwardRef;typeof s=="undefined"&&(s=n);function i(u){return!!(u.metaKey||u.altKey||u.ctrlKey||u.shiftKey)}var e=s(function(u,d){var c=u.innerRef,_=u.navigate,f=u.onClick,b=Object(x.a)(u,["innerRef","navigate","onClick"]),A=b.target,O=Object(L.a)({},b,{onClick:function(P){try{f&&f(P)}catch(k){throw P.preventDefault(),k}!P.defaultPrevented&&P.button===0&&(!A||A==="_self")&&!i(P)&&(P.preventDefault(),_())}});return n!==s?O.ref=d||c:O.ref=c,N.a.createElement("a",O)}),t=s(function(u,d){var c=u.component,_=c===void 0?e:c,f=u.replace,b=u.to,A=u.innerRef,O=Object(x.a)(u,["component","replace","to","innerRef"]);return N.a.createElement(ae.e.Consumer,null,function(C){C||Object(T.a)(!1);var P=C.history,k=a(o(b,C.location),C.location),I=k?P.createHref(k):"",U=Object(L.a)({},O,{href:I,navigate:function(){var Z=o(b,C.location),$=f?P.replace:P.push;$(Z)}});return n!==s?U.ref=d||A:U.innerRef=A,N.a.createElement(_,U)})});if(!1)var r,E;var g=function(d){return d},h=N.a.forwardRef;typeof h=="undefined"&&(h=g);function y(){for(var u=arguments.length,d=new Array(u),c=0;c<u;c++)d[c]=arguments[c];return d.filter(function(_){return _}).join(" ")}var v=h(function(u,d){var c=u["aria-current"],_=c===void 0?"page":c,f=u.activeClassName,b=f===void 0?"active":f,A=u.activeStyle,O=u.className,C=u.exact,P=u.isActive,k=u.location,I=u.sensitive,U=u.strict,H=u.style,Z=u.to,$=u.innerRef,ee=Object(x.a)(u,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return N.a.createElement(ae.e.Consumer,null,function(te){te||Object(T.a)(!1);var K=k||te.location,W=a(o(Z,K),K),X=W.pathname,j=X&&X.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),z=j?Object(ae.f)(K.pathname,{path:j,exact:C,sensitive:I,strict:U}):null,ie=!!(P?P(z,K):z),pe=ie?y(O,b):O,_e=ie?Object(L.a)({},H,{},A):H,Ee=Object(L.a)({"aria-current":ie&&_||null,className:pe,style:_e,to:W},ee);return g!==h?Ee.ref=d||$:Ee.innerRef=$,N.a.createElement(t,Ee)})});if(!1)var l},"5VLF":function(Be,Le,Y){"use strict";var ae,M;function S(N,w,R){var D=function(L,x){return N.js_beautify(L,x)};return D.js=N.js_beautify,D.css=w.css_beautify,D.html=R.html_beautify,D.js_beautify=N.js_beautify,D.css_beautify=w.css_beautify,D.html_beautify=R.html_beautify,D}!(ae=[Y("6UM0"),Y("TXwP"),Y("psGv")],M=function(N,w,R){return S(N,w,R)}.apply(Le,ae),M!==void 0&&(Be.exports=M))},"6UM0":function(Be,Le,Y){var ae,M;(function(){var S;(function(){"use strict";var w=[function(x,T,m){var p=m(1).Beautifier,o=m(5).Options;function a(n,s){var i=new p(n,s);return i.beautify()}x.exports=a,x.exports.defaultOptions=function(){return new o}},function(x,T,m){var p=m(2).Output,o=m(3).Token,a=m(4),n=m(5).Options,s=m(7).Tokenizer,i=m(7).line_starters,e=m(7).positionable_operators,t=m(7).TOKEN;function r(I,U){return U.indexOf(I)!==-1}function E(I){return I.replace(/^\s+/g,"")}function g(I){for(var U={},H=0;H<I.length;H++)U[I[H].replace(/-/g,"_")]=I[H];return U}function h(I,U){return I&&I.type===t.RESERVED&&I.text===U}function y(I,U){return I&&I.type===t.RESERVED&&r(I.text,U)}var v=["case","return","do","if","throw","else","await","break","continue","async"],l=["before-newline","after-newline","preserve-newline"],u=g(l),d=[u.before_newline,u.preserve_newline],c={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function _(I,U){if(U.multiline_frame||U.mode===c.ForInitializer||U.mode===c.Conditional)return;I.remove_indent(U.start_line_index)}function f(I){I=I.replace(a.allLineBreaks,`
|
|
`);for(var U=[],H=I.indexOf(`
|
|
`);H!==-1;)U.push(I.substring(0,H)),I=I.substring(H+1),H=I.indexOf(`
|
|
`);return I.length&&U.push(I),U}function b(I){return I===c.ArrayLiteral}function A(I){return r(I,[c.Expression,c.ForInitializer,c.Conditional])}function O(I,U){for(var H=0;H<I.length;H++){var Z=I[H].trim();if(Z.charAt(0)!==U)return!1}return!0}function C(I,U){for(var H=0,Z=I.length,$;H<Z;H++)if($=I[H],$&&$.indexOf(U)!==0)return!1;return!0}function P(I,U){U=U||{},this._source_text=I||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new n(U)}P.prototype.create_flags=function(I,U){var H=0;I&&(H=I.indentation_level,!this._output.just_added_newline()&&I.line_indent_level>H&&(H=I.line_indent_level));var Z={mode:U,parent:I,last_token:I?I.last_token:new o(t.START_BLOCK,""),last_word:I?I.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:H,alignment:0,line_indent_level:I?I.line_indent_level:H,start_line_index:this._output.get_line_number(),ternary_depth:0};return Z},P.prototype._reset=function(I){var U=I.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new p(this._options,U),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(c.BlockStatement);var H=new s(I,this._options);return this._tokens=H.tokenize(),I},P.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var I,U=this._reset(this._source_text),H=this._options.eol;this._options.eol==="auto"&&(H=`
|
|
`,U&&a.lineBreak.test(U||"")&&(H=U.match(a.lineBreak)[0]));for(var Z=this._tokens.next();Z;)this.handle_token(Z),this._last_last_text=this._flags.last_token.text,this._flags.last_token=Z,Z=this._tokens.next();return I=this._output.get_code(H),I},P.prototype.handle_token=function(I,U){I.type===t.START_EXPR?this.handle_start_expr(I):I.type===t.END_EXPR?this.handle_end_expr(I):I.type===t.START_BLOCK?this.handle_start_block(I):I.type===t.END_BLOCK?this.handle_end_block(I):I.type===t.WORD?this.handle_word(I):I.type===t.RESERVED?this.handle_word(I):I.type===t.SEMICOLON?this.handle_semicolon(I):I.type===t.STRING?this.handle_string(I):I.type===t.EQUALS?this.handle_equals(I):I.type===t.OPERATOR?this.handle_operator(I):I.type===t.COMMA?this.handle_comma(I):I.type===t.BLOCK_COMMENT?this.handle_block_comment(I,U):I.type===t.COMMENT?this.handle_comment(I,U):I.type===t.DOT?this.handle_dot(I):I.type===t.EOF?this.handle_eof(I):I.type===t.UNKNOWN?this.handle_unknown(I,U):this.handle_unknown(I,U)},P.prototype.handle_whitespace_and_comments=function(I,U){var H=I.newlines,Z=this._options.keep_array_indentation&&b(this._flags.mode);if(I.comments_before)for(var $=I.comments_before.next();$;)this.handle_whitespace_and_comments($,U),this.handle_token($,U),$=I.comments_before.next();if(Z)for(var ee=0;ee<H;ee+=1)this.print_newline(ee>0,U);else if(this._options.max_preserve_newlines&&H>this._options.max_preserve_newlines&&(H=this._options.max_preserve_newlines),this._options.preserve_newlines&&H>1){this.print_newline(!1,U);for(var te=1;te<H;te+=1)this.print_newline(!0,U)}};var k=["async","break","continue","return","throw","yield"];P.prototype.allow_wrap_or_preserved_newline=function(I,U){if(U=U===void 0?!1:U,this._output.just_added_newline())return;var H=this._options.preserve_newlines&&I.newlines||U,Z=r(this._flags.last_token.text,e)||r(I.text,e);if(Z){var $=r(this._flags.last_token.text,e)&&r(this._options.operator_position,d)||r(I.text,e);H=H&&$}if(H)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(y(this._flags.last_token,k))return;this._output.set_wrap_point()}},P.prototype.print_newline=function(I,U){if(!U&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==t.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var H=this._tokens.peek();this._flags.mode===c.Statement&&!(this._flags.if_block&&h(H,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(I)&&(this._flags.multiline_frame=!0)},P.prototype.print_token_line_indentation=function(I){this._output.just_added_newline()&&(this._options.keep_array_indentation&&I.newlines&&(I.text==="["||b(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(I.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},P.prototype.print_token=function(I){if(this._output.raw){this._output.add_raw_token(I);return}if(this._options.comma_first&&I.previous&&I.previous.type===t.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var U=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(U),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(I),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(I),this._output.non_breaking_space=!0,this._output.add_token(I.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},P.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},P.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},P.prototype.set_mode=function(I){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,I),this._flags=this.create_flags(this._previous_flags,I),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},P.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===c.Statement&&_(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},P.prototype.start_of_object_property=function(){return this._flags.parent.mode===c.ObjectLiteral&&this._flags.mode===c.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||y(this._flags.last_token,["get","set"]))},P.prototype.start_of_statement=function(I){var U=!1;return U=U||y(this._flags.last_token,["var","let","const"])&&I.type===t.WORD,U=U||h(this._flags.last_token,"do"),U=U||!(this._flags.parent.mode===c.ObjectLiteral&&this._flags.mode===c.Statement)&&y(this._flags.last_token,k)&&!I.newlines,U=U||h(this._flags.last_token,"else")&&!(h(I,"if")&&!I.comments_before),U=U||this._flags.last_token.type===t.END_EXPR&&(this._previous_flags.mode===c.ForInitializer||this._previous_flags.mode===c.Conditional),U=U||this._flags.last_token.type===t.WORD&&this._flags.mode===c.BlockStatement&&!this._flags.in_case&&!(I.text==="--"||I.text==="++")&&this._last_last_text!=="function"&&I.type!==t.WORD&&I.type!==t.RESERVED,U=U||this._flags.mode===c.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||y(this._flags.last_token,["get","set"])),U?(this.set_mode(c.Statement),this.indent(),this.handle_whitespace_and_comments(I,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(I,y(I,["do","for","if","while"])),!0):!1},P.prototype.handle_start_expr=function(I){this.start_of_statement(I)||this.handle_whitespace_and_comments(I);var U=c.Expression;if(I.text==="["){if(this._flags.last_token.type===t.WORD||this._flags.last_token.text===")"){y(this._flags.last_token,i)&&(this._output.space_before_token=!0),this.print_token(I),this.set_mode(U),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}U=c.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())),r(this._flags.last_token.type,[t.START_EXPR,t.END_EXPR,t.WORD,t.OPERATOR,t.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===t.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,U=c.ForInitializer):r(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,U=c.Conditional):r(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&I.whitespace_before===""?this._output.space_before_token=!1:(r(this._flags.last_token.text,i)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===t.EQUALS||this._flags.last_token.type===t.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(I);else if(this._flags.last_token.type===t.WORD){this._output.space_before_token=!1;var H=this._tokens.peek(-3);if(this._options.space_after_named_function&&H){var Z=this._tokens.peek(-4);y(H,["async","function"])||H.text==="*"&&y(Z,["async","function"])?this._output.space_before_token=!0:this._flags.mode===c.ObjectLiteral?(H.text==="{"||H.text===","||H.text==="*"&&(Z.text==="{"||Z.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(I);(this._flags.last_token.type===t.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(r(this._last_last_text,["function","yield"])||this._flags.mode===c.ObjectLiteral&&r(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===t.START_BLOCK?this.print_newline():(this._flags.last_token.type===t.END_EXPR||this._flags.last_token.type===t.START_EXPR||this._flags.last_token.type===t.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===t.COMMA)&&this.allow_wrap_or_preserved_newline(I,I.newlines),this.print_token(I),this.set_mode(U),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},P.prototype.handle_end_expr=function(I){for(;this._flags.mode===c.Statement;)this.restore_mode();this.handle_whitespace_and_comments(I),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(I,I.text==="]"&&b(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===t.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(I),this.restore_mode(),_(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===c.Conditional&&(this._previous_flags.mode=c.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},P.prototype.handle_start_block=function(I){this.handle_whitespace_and_comments(I);var U=this._tokens.peek(),H=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===t.END_EXPR?(this.set_mode(c.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(c.BlockStatement):H&&(r(H.text,[":",","])&&r(U.type,[t.STRING,t.WORD,t.RESERVED])||r(U.text,["get","set","..."])&&r(H.type,[t.WORD,t.RESERVED]))?r(this._last_last_text,["class","interface"])&&!r(H.text,[":",","])?this.set_mode(c.BlockStatement):this.set_mode(c.ObjectLiteral):this._flags.last_token.type===t.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(c.BlockStatement):r(this._flags.last_token.type,[t.EQUALS,t.START_EXPR,t.COMMA,t.OPERATOR])||y(this._flags.last_token,["return","throw","import","default"])?this.set_mode(c.ObjectLiteral):this.set_mode(c.BlockStatement),this._flags.last_token&&(y(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var Z=!U.comments_before&&U.text==="}",$=Z&&this._flags.last_word==="function"&&this._flags.last_token.type===t.END_EXPR;if(this._options.brace_preserve_inline){var ee=0,te=null;this._flags.inline_frame=!0;do if(ee+=1,te=this._tokens.peek(ee-1),te.newlines){this._flags.inline_frame=!1;break}while(te.type!==t.EOF&&!(te.type===t.END_BLOCK&&te.opened===I))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&I.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==t.OPERATOR&&($||this._flags.last_token.type===t.EQUALS||y(this._flags.last_token,v)&&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===t.START_EXPR||this._flags.last_token.type===t.COMMA)&&((this._flags.last_token.type===t.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===t.COMMA||this._flags.last_token.type===t.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(I),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==t.OPERATOR&&this._flags.last_token.type!==t.START_EXPR&&(this._flags.last_token.type===t.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(I),this.indent(),!Z&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},P.prototype.handle_end_block=function(I){for(this.handle_whitespace_and_comments(I);this._flags.mode===c.Statement;)this.restore_mode();var U=this._flags.last_token.type===t.START_BLOCK;this._flags.inline_frame&&!U?this._output.space_before_token=!0:this._options.brace_style==="expand"?U||this.print_newline():U||(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(I)},P.prototype.handle_word=function(I){if(I.type===t.RESERVED){if(r(I.text,["set","get"])&&this._flags.mode!==c.ObjectLiteral)I.type=t.WORD;else if(I.text==="import"&&r(this._tokens.peek().text,["(","."]))I.type=t.WORD;else if(r(I.text,["as","from"])&&!this._flags.import_block)I.type=t.WORD;else if(this._flags.mode===c.ObjectLiteral){var U=this._tokens.peek();U.text===":"&&(I.type=t.WORD)}}if(this.start_of_statement(I)?y(this._flags.last_token,["var","let","const"])&&I.type===t.WORD&&(this._flags.declaration_statement=!0):I.newlines&&!A(this._flags.mode)&&(this._flags.last_token.type!==t.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==t.EQUALS&&(this._options.preserve_newlines||!y(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(I),this.print_newline()):this.handle_whitespace_and_comments(I),this._flags.do_block&&!this._flags.do_while)if(h(I,"while")){this._output.space_before_token=!0,this.print_token(I),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&&h(I,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===c.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&y(I,["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(I),this._flags.in_case=!0;return}if((this._flags.last_token.type===t.COMMA||this._flags.last_token.type===t.START_EXPR||this._flags.last_token.type===t.EQUALS||this._flags.last_token.type===t.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(I)),h(I,"function")){(r(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(r(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===t.OPERATOR))&&(!this._output.just_added_blankline()&&!I.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===t.RESERVED||this._flags.last_token.type===t.WORD?y(this._flags.last_token,["get","set","new","export"])||y(this._flags.last_token,k)?this._output.space_before_token=!0:h(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===t.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(A(this._flags.mode)||b(this._flags.mode))||this.print_newline(),this.print_token(I),this._flags.last_word=I.text;return}var H="NONE";if(this._flags.last_token.type===t.END_BLOCK?this._previous_flags.inline_frame?H="SPACE":y(I,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&I.newlines?H="NEWLINE":(H="SPACE",this._output.space_before_token=!0):H="NEWLINE":this._flags.last_token.type===t.SEMICOLON&&this._flags.mode===c.BlockStatement?H="NEWLINE":this._flags.last_token.type===t.SEMICOLON&&A(this._flags.mode)?H="SPACE":this._flags.last_token.type===t.STRING?H="NEWLINE":this._flags.last_token.type===t.RESERVED||this._flags.last_token.type===t.WORD||this._flags.last_token.text==="*"&&(r(this._last_last_text,["function","yield"])||this._flags.mode===c.ObjectLiteral&&r(this._last_last_text,["{",","]))?H="SPACE":this._flags.last_token.type===t.START_BLOCK?this._flags.inline_frame?H="SPACE":H="NEWLINE":this._flags.last_token.type===t.END_EXPR&&(this._output.space_before_token=!0,H="NEWLINE"),y(I,i)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?H="SPACE":H="NEWLINE"),y(I,["else","catch","finally"]))if((!(this._flags.last_token.type===t.END_BLOCK&&this._previous_flags.mode===c.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&I.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var Z=this._output.current_line;Z.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else H==="NEWLINE"?y(this._flags.last_token,v)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&y(I,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==t.END_EXPR?(this._flags.last_token.type!==t.START_EXPR||!y(I,["var","let","const"]))&&this._flags.last_token.text!==":"&&(h(I,"if")&&h(I.previous,"else")?this._output.space_before_token=!0:this.print_newline()):y(I,i)&&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():H==="SPACE"&&(this._output.space_before_token=!0);I.previous&&(I.previous.type===t.WORD||I.previous.type===t.RESERVED)&&(this._output.space_before_token=!0),this.print_token(I),this._flags.last_word=I.text,I.type===t.RESERVED&&(I.text==="do"?this._flags.do_block=!0:I.text==="if"?this._flags.if_block=!0:I.text==="import"?this._flags.import_block=!0:this._flags.import_block&&h(I,"from")&&(this._flags.import_block=!1))},P.prototype.handle_semicolon=function(I){this.start_of_statement(I)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(I);for(var U=this._tokens.peek();this._flags.mode===c.Statement&&!(this._flags.if_block&&h(U,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(I)},P.prototype.handle_string=function(I){I.text.startsWith("`")&&I.newlines===0&&I.whitespace_before===""&&(I.previous.text===")"||this._flags.last_token.type===t.WORD)||(this.start_of_statement(I)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(I),this._flags.last_token.type===t.RESERVED||this._flags.last_token.type===t.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===t.COMMA||this._flags.last_token.type===t.START_EXPR||this._flags.last_token.type===t.EQUALS||this._flags.last_token.type===t.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(I):I.text.startsWith("`")&&this._flags.last_token.type===t.END_EXPR&&(I.previous.text==="]"||I.previous.text===")")&&I.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(I)},P.prototype.handle_equals=function(I){this.start_of_statement(I)||this.handle_whitespace_and_comments(I),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(I),this._output.space_before_token=!0},P.prototype.handle_comma=function(I){this.handle_whitespace_and_comments(I,!0),this.print_token(I),this._output.space_before_token=!0,this._flags.declaration_statement?(A(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(I)):this._flags.mode===c.ObjectLiteral||this._flags.mode===c.Statement&&this._flags.parent.mode===c.ObjectLiteral?(this._flags.mode===c.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(I)},P.prototype.handle_operator=function(I){var U=I.text==="*"&&(y(this._flags.last_token,["function","yield"])||r(this._flags.last_token.type,[t.START_BLOCK,t.COMMA,t.END_BLOCK,t.SEMICOLON])),H=r(I.text,["-","+"])&&(r(this._flags.last_token.type,[t.START_BLOCK,t.START_EXPR,t.EQUALS,t.OPERATOR])||r(this._flags.last_token.text,i)||this._flags.last_token.text===",");if(!this.start_of_statement(I)){var Z=!U;this.handle_whitespace_and_comments(I,Z)}if(I.text==="*"&&this._flags.last_token.type===t.DOT){this.print_token(I);return}if(I.text==="::"){this.print_token(I);return}if(this._flags.last_token.type===t.OPERATOR&&r(this._options.operator_position,d)&&this.allow_wrap_or_preserved_newline(I),I.text===":"&&this._flags.in_case){this.print_token(I),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==t.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 $=!0,ee=!0,te=!1;if(I.text===":"?this._flags.ternary_depth===0?$=!1:(this._flags.ternary_depth-=1,te=!0):I.text==="?"&&(this._flags.ternary_depth+=1),!H&&!U&&this._options.preserve_newlines&&r(I.text,e)){var K=I.text===":",W=K&&te,X=K&&!te;switch(this._options.operator_position){case u.before_newline:this._output.space_before_token=!X,this.print_token(I),(!K||W)&&this.allow_wrap_or_preserved_newline(I),this._output.space_before_token=!0;return;case u.after_newline:this._output.space_before_token=!0,!K||W?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(I):this._output.space_before_token=!1,this.print_token(I),this._output.space_before_token=!0;return;case u.preserve_newline:X||this.allow_wrap_or_preserved_newline(I),$=!(this._output.just_added_newline()||X),this._output.space_before_token=$,this.print_token(I),this._output.space_before_token=!0;return}}if(U){this.allow_wrap_or_preserved_newline(I),$=!1;var j=this._tokens.peek();ee=j&&r(j.type,[t.WORD,t.RESERVED])}else if(I.text==="...")this.allow_wrap_or_preserved_newline(I),$=this._flags.last_token.type===t.START_BLOCK,ee=!1;else if(r(I.text,["--","++","!","~"])||H){if((this._flags.last_token.type===t.COMMA||this._flags.last_token.type===t.START_EXPR)&&this.allow_wrap_or_preserved_newline(I),$=!1,ee=!1,I.newlines&&(I.text==="--"||I.text==="++"||I.text==="~")){var z=y(this._flags.last_token,v)&&I.newlines;z&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(z,!0)}this._flags.last_token.text===";"&&A(this._flags.mode)&&($=!0),this._flags.last_token.type===t.RESERVED?$=!0:this._flags.last_token.type===t.END_EXPR?$=!(this._flags.last_token.text==="]"&&(I.text==="--"||I.text==="++")):this._flags.last_token.type===t.OPERATOR&&($=r(I.text,["--","-","++","+"])&&r(this._flags.last_token.text,["--","-","++","+"]),r(I.text,["+","-"])&&r(this._flags.last_token.text,["--","++"])&&(ee=!0)),(this._flags.mode===c.BlockStatement&&!this._flags.inline_frame||this._flags.mode===c.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||$,this.print_token(I),this._output.space_before_token=ee},P.prototype.handle_block_comment=function(I,U){if(this._output.raw){this._output.add_raw_token(I),I.directives&&I.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(I.directives){this.print_newline(!1,U),this.print_token(I),I.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!a.newline.test(I.text)&&!I.newlines){this._output.space_before_token=!0,this.print_token(I),this._output.space_before_token=!0;return}else this.print_block_commment(I,U)},P.prototype.print_block_commment=function(I,U){var H=f(I.text),Z,$=!1,ee=!1,te=I.whitespace_before,K=te.length;if(this.print_newline(!1,U),this.print_token_line_indentation(I),this._output.add_token(H[0]),this.print_newline(!1,U),H.length>1){for(H=H.slice(1),$=O(H,"*"),ee=C(H,te),$&&(this._flags.alignment=1),Z=0;Z<H.length;Z++)$?(this.print_token_line_indentation(I),this._output.add_token(E(H[Z]))):ee&&H[Z]?(this.print_token_line_indentation(I),this._output.add_token(H[Z].substring(K))):(this._output.current_line.set_indent(-1),this._output.add_token(H[Z])),this.print_newline(!1,U);this._flags.alignment=0}},P.prototype.handle_comment=function(I,U){I.newlines?this.print_newline(!1,U):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(I),this.print_newline(!1,U)},P.prototype.handle_dot=function(I){this.start_of_statement(I)||this.handle_whitespace_and_comments(I,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),y(this._flags.last_token,v)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(I,this._flags.last_token.text===")"&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(I)},P.prototype.handle_unknown=function(I,U){this.print_token(I),I.text[I.text.length-1]===`
|
|
`&&this.print_newline(!1,U)},P.prototype.handle_eof=function(I){for(;this._flags.mode===c.Statement;)this.restore_mode();this.handle_whitespace_and_comments(I)},x.exports.Beautifier=P},function(x){function T(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=[]}T.prototype.clone_empty=function(){var o=new T(this.__parent);return o.set_indent(this.__indent_count,this.__alignment_count),o},T.prototype.item=function(o){return o<0?this.__items[this.__items.length+o]:this.__items[o]},T.prototype.has_match=function(o){for(var a=this.__items.length-1;a>=0;a--)if(this.__items[a].match(o))return!0;return!1},T.prototype.set_indent=function(o,a){this.is_empty()&&(this.__indent_count=o||0,this.__alignment_count=a||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},T.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)},T.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},T.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},T.prototype.is_empty=function(){return this.__items.length===0},T.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},T.prototype.push=function(o){this.__items.push(o);var a=o.lastIndexOf(`
|
|
`);a!==-1?this.__character_count=o.length-a:this.__character_count+=o.length},T.prototype.pop=function(){var o=null;return this.is_empty()||(o=this.__items.pop(),this.__character_count-=o.length),o},T.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},T.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},T.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},T.prototype.toString=function(){var o="";return this.is_empty()?this.__parent.indent_empty_lines&&(o=this.__parent.get_indent_string(this.__indent_count)):(o=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),o+=this.__items.join("")),o};function m(o,a){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)),a=a||"",o.indent_level>0&&(a=new Array(o.indent_level+1).join(this.__indent_string)),this.__base_string=a,this.__base_string_length=a.length}m.prototype.get_indent_size=function(o,a){var n=this.__base_string_length;return a=a||0,o<0&&(n=0),n+=o*this.__indent_size,n+=a,n},m.prototype.get_indent_string=function(o,a){var n=this.__base_string;return a=a||0,o<0&&(o=0,n=""),a+=o*this.__indent_size,this.__ensure_cache(a),n+=this.__cache[a],n},m.prototype.__ensure_cache=function(o){for(;o>=this.__cache.length;)this.__add_column()},m.prototype.__add_column=function(){var o=this.__cache.length,a=0,n="";this.__indent_size&&o>=this.__indent_size&&(a=Math.floor(o/this.__indent_size),o-=a*this.__indent_size,n=new Array(a+1).join(this.__indent_string)),o&&(n+=new Array(o+1).join(" ")),this.__cache.push(n)};function p(o,a){this.__indent_cache=new m(o,a),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 T(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(o,a){return this.__indent_cache.get_indent_string(o,a)},p.prototype.get_indent_size=function(o,a){return this.__indent_cache.get_indent_size(o,a)},p.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},p.prototype.add_new_line=function(o){return this.is_empty()||!o&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},p.prototype.get_code=function(o){this.trim(!0);var a=this.current_line.pop();a&&(a[a.length-1]===`
|
|
`&&(a=a.replace(/\n+$/g,"")),this.current_line.push(a)),this._end_with_newline&&this.__add_outputline();var n=this.__lines.join(`
|
|
`);return o!==`
|
|
`&&(n=n.replace(/[\n]/g,o)),n},p.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},p.prototype.set_indent=function(o,a){return o=o||0,a=a||0,this.next_line.set_indent(o,a),this.__lines.length>1?(this.current_line.set_indent(o,a),!0):(this.current_line.set_indent(),!1)},p.prototype.add_raw_token=function(o){for(var a=0;a<o.newlines;a++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(o.whitespace_before),this.current_line.push(o.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},p.prototype.add_token=function(o){this.__add_space_before_token(),this.current_line.push(o),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},p.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},p.prototype.remove_indent=function(o){for(var a=this.__lines.length;o<a;)this.__lines[o]._remove_indent(),o++;this.current_line._remove_wrap_indent()},p.prototype.trim=function(o){for(o=o===void 0?!1:o,this.current_line.trim();o&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},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(o,a){for(var n=this.__lines.length-2;n>=0;){var s=this.__lines[n];if(s.is_empty())break;if(s.item(0).indexOf(o)!==0&&s.item(-1)!==a){this.__lines.splice(n+1,0,new T(this)),this.previous_line=this.__lines[this.__lines.length-2];break}n--}},x.exports.Output=p},function(x){function T(m,p,o,a){this.type=m,this.text=p,this.comments_before=null,this.newlines=o||0,this.whitespace_before=a||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}x.exports.Token=T},function(x,T){var m="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",p="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",o="\\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",a="\\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",n="(?:\\\\u[0-9a-fA-F]{4}|["+m+o+"])",s="(?:\\\\u[0-9a-fA-F]{4}|["+p+o+a+"])*";T.identifier=new RegExp(n+s,"g"),T.identifierStart=new RegExp(n),T.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+p+o+a+"])+");var i=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;T.newline=/[\n\r\u2028\u2029]/,T.lineBreak=new RegExp(`\r
|
|
|`+T.newline.source),T.allLineBreaks=new RegExp(T.lineBreak.source,"g")},function(x,T,m){var p=m(6).Options,o=["before-newline","after-newline","preserve-newline"];function a(n){p.call(this,n,"js");var s=this.raw_options.brace_style||null;s==="expand-strict"?this.raw_options.brace_style="expand":s==="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 i=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var e=0;e<i.length;e++)i[e]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=i[e];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",o),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}a.prototype=new p,x.exports.Options=a},function(x){function T(o,a){this.raw_options=m(o,a),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"])}T.prototype._get_array=function(o,a){var n=this.raw_options[o],s=a||[];return typeof n=="object"?n!==null&&typeof n.concat=="function"&&(s=n.concat()):typeof n=="string"&&(s=n.split(/[^a-zA-Z0-9_\/\-]+/)),s},T.prototype._get_boolean=function(o,a){var n=this.raw_options[o],s=n===void 0?!!a:!!n;return s},T.prototype._get_characters=function(o,a){var n=this.raw_options[o],s=a||"";return typeof n=="string"&&(s=n.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),s},T.prototype._get_number=function(o,a){var n=this.raw_options[o];a=parseInt(a,10),isNaN(a)&&(a=0);var s=parseInt(n,10);return isNaN(s)&&(s=a),s},T.prototype._get_selection=function(o,a,n){var s=this._get_selection_list(o,a,n);if(s.length!==1)throw new Error("Invalid Option Value: The option '"+o+`' can only be one of the following values:
|
|
`+a+`
|
|
You passed in: '`+this.raw_options[o]+"'");return s[0]},T.prototype._get_selection_list=function(o,a,n){if(!a||a.length===0)throw new Error("Selection list cannot be empty.");if(n=n||[a[0]],!this._is_valid_selection(n,a))throw new Error("Invalid Default Value!");var s=this._get_array(o,n);if(!this._is_valid_selection(s,a))throw new Error("Invalid Option Value: The option '"+o+`' can contain only the following values:
|
|
`+a+`
|
|
You passed in: '`+this.raw_options[o]+"'");return s},T.prototype._is_valid_selection=function(o,a){return o.length&&a.length&&!o.some(function(n){return a.indexOf(n)===-1})};function m(o,a){var n={};o=p(o);var s;for(s in o)s!==a&&(n[s]=o[s]);if(a&&o[a])for(s in o[a])n[s]=o[a][s];return n}function p(o){var a={},n;for(n in o){var s=n.replace(/-/g,"_");a[s]=o[n]}return a}x.exports.Options=T,x.exports.normalizeOpts=p,x.exports.mergeOpts=m},function(x,T,m){var p=m(8).InputScanner,o=m(9).Tokenizer,a=m(9).TOKEN,n=m(13).Directives,s=m(4),i=m(12).Pattern,e=m(14).TemplatablePattern;function t(O,C){return C.indexOf(O)!==-1}var r={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:a.START,RAW:a.RAW,EOF:a.EOF},E=new n(/\/\*/,/\*\//),g=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,h=/[0-9]/,y=/[^\d\.]/,v=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),l=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";l=l.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),l="\\?\\.(?!\\d) "+l,l=l.replace(/ /g,"|");var u=new RegExp(l),d="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),c=d.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),_=new RegExp("^(?:"+c.join("|")+")$"),f,b=function(O,C){o.call(this,O,C),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var P=new i(this._input),k=new e(this._input).read_options(this._options);this.__patterns={template:k,identifier:k.starting_with(s.identifier).matching(s.identifierMatch),number:P.matching(g),punct:P.matching(u),comment:P.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:P.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:P.matching(/<!--/),html_comment_end:P.matching(/-->/),include:P.starting_with(/#include/).until_after(s.lineBreak),shebang:P.starting_with(/#!/).until_after(s.lineBreak),xml:P.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:k.until(/['\\\n\r\u2028\u2029]/),double_quote:k.until(/["\\\n\r\u2028\u2029]/),template_text:k.until(/[`\\$]/),template_expression:k.until(/[`}\\]/)}};b.prototype=new o,b.prototype._is_comment=function(O){return O.type===r.COMMENT||O.type===r.BLOCK_COMMENT||O.type===r.UNKNOWN},b.prototype._is_opening=function(O){return O.type===r.START_BLOCK||O.type===r.START_EXPR},b.prototype._is_closing=function(O,C){return(O.type===r.END_BLOCK||O.type===r.END_EXPR)&&C&&(O.text==="]"&&C.text==="["||O.text===")"&&C.text==="("||O.text==="}"&&C.text==="{")},b.prototype._reset=function(){f=!1},b.prototype._get_next_token=function(O,C){var P=null;this._readWhitespace();var k=this._input.peek();return k===null?this._create_token(r.EOF,""):(P=P||this._read_non_javascript(k),P=P||this._read_string(k),P=P||this._read_word(O),P=P||this._read_singles(k),P=P||this._read_comment(k),P=P||this._read_regexp(k,O),P=P||this._read_xml(k,O),P=P||this._read_punctuation(),P=P||this._create_token(r.UNKNOWN,this._input.next()),P)},b.prototype._read_word=function(O){var C;if(C=this.__patterns.identifier.read(),C!=="")return C=C.replace(s.allLineBreaks,`
|
|
`),!(O.type===r.DOT||O.type===r.RESERVED&&(O.text==="set"||O.text==="get"))&&_.test(C)?(C==="in"||C==="of")&&(O.type===r.WORD||O.type===r.STRING)?this._create_token(r.OPERATOR,C):this._create_token(r.RESERVED,C):this._create_token(r.WORD,C);if(C=this.__patterns.number.read(),C!=="")return this._create_token(r.WORD,C)},b.prototype._read_singles=function(O){var C=null;return O==="("||O==="["?C=this._create_token(r.START_EXPR,O):O===")"||O==="]"?C=this._create_token(r.END_EXPR,O):O==="{"?C=this._create_token(r.START_BLOCK,O):O==="}"?C=this._create_token(r.END_BLOCK,O):O===";"?C=this._create_token(r.SEMICOLON,O):O==="."&&y.test(this._input.peek(1))?C=this._create_token(r.DOT,O):O===","&&(C=this._create_token(r.COMMA,O)),C&&this._input.next(),C},b.prototype._read_punctuation=function(){var O=this.__patterns.punct.read();if(O!=="")return O==="="?this._create_token(r.EQUALS,O):O==="?."?this._create_token(r.DOT,O):this._create_token(r.OPERATOR,O)},b.prototype._read_non_javascript=function(O){var C="";if(O==="#"){if(this._is_first_token()&&(C=this.__patterns.shebang.read(),C))return this._create_token(r.UNKNOWN,C.trim()+`
|
|
`);if(C=this.__patterns.include.read(),C)return this._create_token(r.UNKNOWN,C.trim()+`
|
|
`);O=this._input.next();var P="#";if(this._input.hasNext()&&this._input.testChar(h)){do O=this._input.next(),P+=O;while(this._input.hasNext()&&O!=="#"&&O!=="=");return O==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(P+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(P+="{}",this._input.next(),this._input.next())),this._create_token(r.WORD,P)}this._input.back()}else if(O==="<"&&this._is_first_token()){if(C=this.__patterns.html_comment_start.read(),C){for(;this._input.hasNext()&&!this._input.testChar(s.newline);)C+=this._input.next();return f=!0,this._create_token(r.COMMENT,C)}}else if(f&&O==="-"&&(C=this.__patterns.html_comment_end.read(),C))return f=!1,this._create_token(r.COMMENT,C);return null},b.prototype._read_comment=function(O){var C=null;if(O==="/"){var P="";if(this._input.peek(1)==="*"){P=this.__patterns.block_comment.read();var k=E.get_directives(P);k&&k.ignore==="start"&&(P+=E.readIgnored(this._input)),P=P.replace(s.allLineBreaks,`
|
|
`),C=this._create_token(r.BLOCK_COMMENT,P),C.directives=k}else this._input.peek(1)==="/"&&(P=this.__patterns.comment.read(),C=this._create_token(r.COMMENT,P))}return C},b.prototype._read_string=function(O){if(O==="`"||O==="'"||O==='"'){var C=this._input.next();return this.has_char_escapes=!1,O==="`"?C+=this._read_string_recursive("`",!0,"${"):C+=this._read_string_recursive(O),this.has_char_escapes&&this._options.unescape_strings&&(C=A(C)),this._input.peek()===O&&(C+=this._input.next()),C=C.replace(s.allLineBreaks,`
|
|
`),this._create_token(r.STRING,C)}return null},b.prototype._allow_regexp_or_xml=function(O){return O.type===r.RESERVED&&t(O.text,["return","case","throw","else","do","typeof","yield"])||O.type===r.END_EXPR&&O.text===")"&&O.opened.previous.type===r.RESERVED&&t(O.opened.previous.text,["if","while","for"])||t(O.type,[r.COMMENT,r.START_EXPR,r.START_BLOCK,r.START,r.END_BLOCK,r.OPERATOR,r.EQUALS,r.EOF,r.SEMICOLON,r.COMMA])},b.prototype._read_regexp=function(O,C){if(O==="/"&&this._allow_regexp_or_xml(C)){for(var P=this._input.next(),k=!1,I=!1;this._input.hasNext()&&(k||I||this._input.peek()!==O)&&!this._input.testChar(s.newline);)P+=this._input.peek(),k?k=!1:(k=this._input.peek()==="\\",this._input.peek()==="["?I=!0:this._input.peek()==="]"&&(I=!1)),this._input.next();return this._input.peek()===O&&(P+=this._input.next(),P+=this._input.read(s.identifier)),this._create_token(r.STRING,P)}return null},b.prototype._read_xml=function(O,C){if(this._options.e4x&&O==="<"&&this._allow_regexp_or_xml(C)){var P="",k=this.__patterns.xml.read_match();if(k){for(var I=k[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),U=I.indexOf("{")===0,H=0;k;){var Z=!!k[1],$=k[2],ee=!!k[k.length-1]||$.slice(0,8)==="![CDATA[";if(!ee&&($===I||U&&$.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(Z?--H:++H),P+=k[0],H<=0)break;k=this.__patterns.xml.read_match()}return k||(P+=this._input.match(/[\s\S]*/g)[0]),P=P.replace(s.allLineBreaks,`
|
|
`),this._create_token(r.STRING,P)}}return null};function A(O){for(var C="",P=0,k=new p(O),I=null;k.hasNext();)if(I=k.match(/([\s]|[^\\]|\\\\)+/g),I&&(C+=I[0]),k.peek()==="\\"){if(k.next(),k.peek()==="x")I=k.match(/x([0-9A-Fa-f]{2})/g);else if(k.peek()==="u")I=k.match(/u([0-9A-Fa-f]{4})/g);else{C+="\\",k.hasNext()&&(C+=k.next());continue}if(!I)return O;if(P=parseInt(I[1],16),P>126&&P<=255&&I[0].indexOf("x")===0)return O;if(P>=0&&P<32){C+="\\"+I[0];continue}else P===34||P===39||P===92?C+="\\"+String.fromCharCode(P):C+=String.fromCharCode(P)}return C}b.prototype._read_string_recursive=function(O,C,P){var k,I;O==="'"?I=this.__patterns.single_quote:O==='"'?I=this.__patterns.double_quote:O==="`"?I=this.__patterns.template_text:O==="}"&&(I=this.__patterns.template_expression);for(var U=I.read(),H="";this._input.hasNext();){if(H=this._input.next(),H===O||!C&&s.newline.test(H)){this._input.back();break}else H==="\\"&&this._input.hasNext()?(k=this._input.peek(),k==="x"||k==="u"?this.has_char_escapes=!0:k==="\r"&&this._input.peek(1)===`
|
|
`&&this._input.next(),H+=this._input.next()):P&&(P==="${"&&H==="$"&&this._input.peek()==="{"&&(H+=this._input.next()),P===H&&(O==="`"?H+=this._read_string_recursive("}",C,"`"):H+=this._read_string_recursive("`",C,"${"),this._input.hasNext()&&(H+=this._input.next())));H+=I.read(),U+=H}return U},x.exports.Tokenizer=b,x.exports.TOKEN=r,x.exports.positionable_operators=v.slice(),x.exports.line_starters=d.slice()},function(x){var T=RegExp.prototype.hasOwnProperty("sticky");function m(p){this.__input=p||"",this.__input_length=this.__input.length,this.__position=0}m.prototype.restart=function(){this.__position=0},m.prototype.back=function(){this.__position>0&&(this.__position-=1)},m.prototype.hasNext=function(){return this.__position<this.__input_length},m.prototype.next=function(){var p=null;return this.hasNext()&&(p=this.__input.charAt(this.__position),this.__position+=1),p},m.prototype.peek=function(p){var o=null;return p=p||0,p+=this.__position,p>=0&&p<this.__input_length&&(o=this.__input.charAt(p)),o},m.prototype.__match=function(p,o){p.lastIndex=o;var a=p.exec(this.__input);return a&&!(T&&p.sticky)&&(a.index!==o&&(a=null)),a},m.prototype.test=function(p,o){return o=o||0,o+=this.__position,o>=0&&o<this.__input_length?!!this.__match(p,o):!1},m.prototype.testChar=function(p,o){var a=this.peek(o);return p.lastIndex=0,a!==null&&p.test(a)},m.prototype.match=function(p){var o=this.__match(p,this.__position);return o?this.__position+=o[0].length:o=null,o},m.prototype.read=function(p,o,a){var n="",s;return p&&(s=this.match(p),s&&(n+=s[0])),o&&(s||!p)&&(n+=this.readUntil(o,a)),n},m.prototype.readUntil=function(p,o){var a="",n=this.__position;p.lastIndex=this.__position;var s=p.exec(this.__input);return s?(n=s.index,o&&(n+=s[0].length)):n=this.__input_length,a=this.__input.substring(this.__position,n),this.__position=n,a},m.prototype.readUntilAfter=function(p){return this.readUntil(p,!0)},m.prototype.get_regexp=function(p,o){var a=null,n="g";return o&&T&&(n="y"),typeof p=="string"&&p!==""?a=new RegExp(p,n):p&&(a=new RegExp(p.source,n)),a},m.prototype.get_literal_regexp=function(p){return RegExp(p.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},m.prototype.peekUntilAfter=function(p){var o=this.__position,a=this.readUntilAfter(p);return this.__position=o,a},m.prototype.lookBack=function(p){var o=this.__position-1;return o>=p.length&&this.__input.substring(o-p.length,o).toLowerCase()===p},x.exports.InputScanner=m},function(x,T,m){var p=m(8).InputScanner,o=m(3).Token,a=m(10).TokenStream,n=m(11).WhitespacePattern,s={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},i=function(e,t){this._input=new p(e),this._options=t||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new n(this._input)};i.prototype.tokenize=function(){this._input.restart(),this.__tokens=new a,this._reset();for(var e,t=new o(s.START,""),r=null,E=[],g=new a;t.type!==s.EOF;){for(e=this._get_next_token(t,r);this._is_comment(e);)g.add(e),e=this._get_next_token(t,r);g.isEmpty()||(e.comments_before=g,g=new a),e.parent=r,this._is_opening(e)?(E.push(r),r=e):r&&this._is_closing(e,r)&&(e.opened=r,r.closed=e,r=E.pop(),e.parent=r),e.previous=t,t.next=e,this.__tokens.add(e),t=e}return this.__tokens},i.prototype._is_first_token=function(){return this.__tokens.isEmpty()},i.prototype._reset=function(){},i.prototype._get_next_token=function(e,t){this._readWhitespace();var r=this._input.read(/.+/g);return r?this._create_token(s.RAW,r):this._create_token(s.EOF,"")},i.prototype._is_comment=function(e){return!1},i.prototype._is_opening=function(e){return!1},i.prototype._is_closing=function(e,t){return!1},i.prototype._create_token=function(e,t){var r=new o(e,t,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return r},i.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},x.exports.Tokenizer=i,x.exports.TOKEN=s},function(x){function T(m){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=m}T.prototype.restart=function(){this.__position=0},T.prototype.isEmpty=function(){return this.__tokens_length===0},T.prototype.hasNext=function(){return this.__position<this.__tokens_length},T.prototype.next=function(){var m=null;return this.hasNext()&&(m=this.__tokens[this.__position],this.__position+=1),m},T.prototype.peek=function(m){var p=null;return m=m||0,m+=this.__position,m>=0&&m<this.__tokens_length&&(p=this.__tokens[m]),p},T.prototype.add=function(m){this.__parent_token&&(m.parent=this.__parent_token),this.__tokens.push(m),this.__tokens_length+=1},x.exports.TokenStream=T},function(x,T,m){var p=m(12).Pattern;function o(a,n){p.call(this,a,n),n?this._line_regexp=this._input.get_regexp(n._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}o.prototype=new p,o.prototype.__set_whitespace_patterns=function(a,n){a+="\\t ",n+="\\n\\r",this._match_pattern=this._input.get_regexp("["+a+n+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+n+"]")},o.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var a=this._input.read(this._match_pattern);if(a===" ")this.whitespace_before_token=" ";else if(a){var n=this.__split(this._newline_regexp,a);this.newline_count=n.length-1,this.whitespace_before_token=n[this.newline_count]}return a},o.prototype.matching=function(a,n){var s=this._create();return s.__set_whitespace_patterns(a,n),s._update(),s},o.prototype._create=function(){return new o(this._input,this)},o.prototype.__split=function(a,n){a.lastIndex=0;for(var s=0,i=[],e=a.exec(n);e;)i.push(n.substring(s,e.index)),s=e.index+e[0].length,e=a.exec(n);return s<n.length?i.push(n.substring(s,n.length)):i.push(""),i},x.exports.WhitespacePattern=o},function(x){function T(m,p){this._input=m,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,p&&(this._starting_pattern=this._input.get_regexp(p._starting_pattern,!0),this._match_pattern=this._input.get_regexp(p._match_pattern,!0),this._until_pattern=this._input.get_regexp(p._until_pattern),this._until_after=p._until_after)}T.prototype.read=function(){var m=this._input.read(this._starting_pattern);return(!this._starting_pattern||m)&&(m+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),m},T.prototype.read_match=function(){return this._input.match(this._match_pattern)},T.prototype.until_after=function(m){var p=this._create();return p._until_after=!0,p._until_pattern=this._input.get_regexp(m),p._update(),p},T.prototype.until=function(m){var p=this._create();return p._until_after=!1,p._until_pattern=this._input.get_regexp(m),p._update(),p},T.prototype.starting_with=function(m){var p=this._create();return p._starting_pattern=this._input.get_regexp(m,!0),p._update(),p},T.prototype.matching=function(m){var p=this._create();return p._match_pattern=this._input.get_regexp(m,!0),p._update(),p},T.prototype._create=function(){return new T(this._input,this)},T.prototype._update=function(){},x.exports.Pattern=T},function(x){function T(m,p){m=typeof m=="string"?m:m.source,p=typeof p=="string"?p:p.source,this.__directives_block_pattern=new RegExp(m+/ beautify( \w+[:]\w+)+ /.source+p,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(m+/\sbeautify\signore:end\s/.source+p,"g")}T.prototype.get_directives=function(m){if(!m.match(this.__directives_block_pattern))return null;var p={};this.__directive_pattern.lastIndex=0;for(var o=this.__directive_pattern.exec(m);o;)p[o[1]]=o[2],o=this.__directive_pattern.exec(m);return p},T.prototype.readIgnored=function(m){return m.readUntilAfter(this.__directives_end_ignore_pattern)},x.exports.Directives=T},function(x,T,m){var p=m(12).Pattern,o={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function a(n,s){p.call(this,n,s),this.__template_pattern=null,this._disabled=Object.assign({},o),this._excluded=Object.assign({},o),s&&(this.__template_pattern=this._input.get_regexp(s.__template_pattern),this._excluded=Object.assign(this._excluded,s._excluded),this._disabled=Object.assign(this._disabled,s._disabled));var i=new p(n);this.__patterns={handlebars_comment:i.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:i.starting_with(/{{{/).until_after(/}}}/),handlebars:i.starting_with(/{{/).until_after(/}}/),php:i.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:i.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:i.starting_with(/{%/).until_after(/%}/),django_value:i.starting_with(/{{/).until_after(/}}/),django_comment:i.starting_with(/{#/).until_after(/#}/),smarty:i.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:i.starting_with(/{\*/).until_after(/\*}/),smarty_literal:i.starting_with(/{literal}/).until_after(/{\/literal}/)}}a.prototype=new p,a.prototype._create=function(){return new a(this._input,this)},a.prototype._update=function(){this.__set_templated_pattern()},a.prototype.disable=function(n){var s=this._create();return s._disabled[n]=!0,s._update(),s},a.prototype.read_options=function(n){var s=this._create();for(var i in o)s._disabled[i]=n.templating.indexOf(i)===-1;return s._update(),s},a.prototype.exclude=function(n){var s=this._create();return s._excluded[n]=!0,s._update(),s},a.prototype.read=function(){var n="";this._match_pattern?n=this._input.read(this._starting_pattern):n=this._input.read(this._starting_pattern,this.__template_pattern);for(var s=this._read_template();s;)this._match_pattern?s+=this._input.read(this._match_pattern):s+=this._input.readUntil(this.__template_pattern),n+=s,s=this._read_template();return this._until_after&&(n+=this._input.readUntilAfter(this._until_pattern)),n},a.prototype.__set_templated_pattern=function(){var n=[];this._disabled.php||n.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||n.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||n.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(n.push(this.__patterns.django._starting_pattern.source),n.push(this.__patterns.django_value._starting_pattern.source),n.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||n.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&n.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+n.join("|")+")")},a.prototype._read_template=function(){var n="",s=this._input.peek();if(s==="<"){var i=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&i==="?"&&(n=n||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&i==="%"&&(n=n||this.__patterns.erb.read())}else s==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(n=n||this.__patterns.handlebars_comment.read(),n=n||this.__patterns.handlebars_unescaped.read(),n=n||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(n=n||this.__patterns.django_value.read()),this._excluded.django||(n=n||this.__patterns.django_comment.read(),n=n||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(n=n||this.__patterns.smarty_comment.read(),n=n||this.__patterns.smarty_literal.read(),n=n||this.__patterns.smarty.read()));return n},x.exports.TemplatablePattern=a}],R={};function D(x){var T=R[x];if(T!==void 0)return T.exports;var m=R[x]={exports:{}};return w[x](m,m.exports,D),m.exports}var L=D(0);S=L})();var N=S;!(ae=[],M=function(){return{js_beautify:N}}.apply(Le,ae),M!==void 0&&(Be.exports=M))})()},"815F":function(Be,Le,Y){"use strict";Y.d(Le,"e",function(){return D}),Y.d(Le,"c",function(){return x}),Y.d(Le,"d",function(){return T}),Y.d(Le,"a",function(){return p}),Y.d(Le,"f",function(){return o}),Y.d(Le,"b",function(){return a});var ae=Y("KQm4"),M=Y("VTBJ"),S=Y("Ff2n"),N=Y("Zm9Q"),w=Y("Kwbf"),R=Y("OZM5");function D(n,s){return n!=null?n:s}function L(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],s=new Map;function i(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(e||[]).forEach(function(r){var E=r.key,g=r.children;Object(w.a)(E!=null,"Tree node must have a certain key: [".concat(t).concat(E,"]"));var h=String(E);Object(w.a)(!s.has(h)||E===null||E===void 0,"Same 'key' exist in the Tree: ".concat(h)),s.set(h,!0),i(g,"".concat(t).concat(h," > "))})}i(n)}function x(n){function s(i){var e=Object(N.a)(i);return e.map(function(t){if(!Object(R.i)(t))return Object(w.a)(!t,"Tree/TreeNode can only accept TreeNode as children."),null;var r=t.key,E=t.props,g=E.children,h=Object(S.a)(E,["children"]),y=Object(M.a)({key:r},h),v=s(g);return v.length&&(y.children=v),y}).filter(function(t){return t})}return s(n)}function T(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=new Set(s===!0?[]:s),e=[];function t(r){var E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return r.map(function(g,h){var y=Object(R.h)(E?E.pos:"0",h),v=D(g.key,y),l=Object(M.a)(Object(M.a)({},g),{},{parent:E,pos:y,children:null,data:g,isStart:[].concat(Object(ae.a)(E?E.isStart:[]),[h===0]),isEnd:[].concat(Object(ae.a)(E?E.isEnd:[]),[h===r.length-1])});return e.push(l),s===!0||i.has(v)?l.children=t(g.children||[],l):l.children=[],l})}return t(n),e}function m(n,s,i){var e;i?typeof i=="string"?e=function(E){return E[i]}:typeof i=="function"&&(e=function(E){return i(E)}):e=function(E,g){return D(E.key,g)};function t(r,E,g){var h=r?r.children:n,y=r?Object(R.h)(g.pos,E):"0";if(r){var v=e(r,y),l={node:r,index:E,pos:y,key:v,parentPos:g.node?g.pos:null,level:g.level+1};s(l)}h&&h.forEach(function(u,d){t(u,d,{node:r,pos:y,level:g?g.level+1:-1})})}t(null)}function p(n){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=s.initWrapper,e=s.processEntity,t=s.onProcessFinished,r=arguments.length>2?arguments[2]:void 0,E={},g={},h={posEntities:E,keyEntities:g};return i&&(h=i(h)||h),m(n,function(y){var v=y.node,l=y.index,u=y.pos,d=y.key,c=y.parentPos,_=y.level,f={node:v,index:l,key:d,pos:u,level:_},b=D(d,u);E[u]=f,g[b]=f,f.parent=E[c],f.parent&&(f.parent.children=f.parent.children||[],f.parent.children.push(f)),e&&e(f,h)},r),t&&t(h),h}function o(n,s){var i=s.expandedKeys,e=s.selectedKeys,t=s.loadedKeys,r=s.loadingKeys,E=s.checkedKeys,g=s.halfCheckedKeys,h=s.dragOverNodeKey,y=s.dropPosition,v=s.keyEntities,l=v[n],u={eventKey:n,expanded:i.indexOf(n)!==-1,selected:e.indexOf(n)!==-1,loaded:t.indexOf(n)!==-1,loading:r.indexOf(n)!==-1,checked:E.indexOf(n)!==-1,halfChecked:g.indexOf(n)!==-1,pos:String(l?l.pos:""),dragOver:h===n&&y===0,dragOverGapTop:h===n&&y===-1,dragOverGapBottom:h===n&&y===1};return u}function a(n){var s=n.data,i=n.expanded,e=n.selected,t=n.checked,r=n.loaded,E=n.loading,g=n.halfChecked,h=n.dragOver,y=n.dragOverGapTop,v=n.dragOverGapBottom,l=n.pos,u=n.active,d=Object(M.a)(Object(M.a)({},s),{},{expanded:i,selected:e,checked:t,loaded:r,loading:E,halfChecked:g,dragOver:h,dragOverGapTop:y,dragOverGapBottom:v,pos:l,active:u});return"props"in d||Object.defineProperty(d,"props",{get:function(){return Object(w.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),n}}),d}},"8Jsi":function(Be,Le,Y){"use strict";Y.d(Le,"d",function(){return c}),Y.d(Le,"a",function(){return _e}),Y.d(Le,"b",function(){return we}),Y.d(Le,"c",function(){return Ee});var ae=Y("1OyB"),M=Y("vuIU"),S=Y("Ji7U"),N=Y("LK+K"),w=Y("KQm4"),R=Y("U8pU"),D=Y("ODXe"),L=Y("VTBJ"),x=Y("cDcd"),T=Y("qNPg"),m=Y("2Qr1"),p=Y("815F"),o=Y("NvD2"),a=Y("wPlo"),n=Y("6cGi"),s=Y("Kwbf"),i=Y("4IlW"),e=Y("YrtM"),t=Y("fAei"),r=x.createContext(null);function E(ne,oe){if(!ne)return!0;var ue=ne.data,me=ue.disabled,ye=ue.disableCheckbox;switch(oe){case"select":return me;case"checkbox":return me||ye}return!1}function g(ne,oe){var ue=x.useCallback(function(ye){var ve=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"select",de=arguments.length>2?arguments[2]:void 0,Oe=ne.get(ye);return!de&&E(Oe,ve)?null:Oe},[ne]),me=x.useCallback(function(ye){var ve=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"select",de=arguments.length>2?arguments[2]:void 0,Oe=oe.get(ye);return!de&&E(Oe,ve)?null:Oe},[oe]);return[ue,me]}function h(ne){return x.useMemo(function(){var oe=new Map,ue=new Map;return ne.forEach(function(me){oe.set(me.key,me),ue.set(me.data.value,me)}),[oe,ue]},[ne])}var y={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},v=function(oe,ue){var me=oe.prefixCls,ye=oe.height,ve=oe.itemHeight,de=oe.virtual,Oe=oe.options,Ae=oe.flattenOptions,re=oe.multiple,Se=oe.searchValue,q=oe.onSelect,Q=oe.onToggleOpen,J=oe.open,F=oe.notFoundContent,B=oe.onMouseEnter,G=x.useContext(r),V=G.checkable,se=G.checkedKeys,he=G.halfCheckedKeys,Te=G.treeExpandedKeys,De=G.treeDefaultExpandAll,Pe=G.treeDefaultExpandedKeys,Ce=G.onTreeExpand,We=G.treeIcon,He=G.showTreeIcon,Me=G.switcherIcon,qe=G.treeLine,Ve=G.treeNodeFilterProp,tt=G.loadData,Je=G.treeLoadedKeys,Ke=G.treeMotion,nt=G.onTreeLoad,rt=x.useRef(),Ne=Object(e.a)(function(){return Oe},[J,Oe],function(lt,at){return at[0]&<[1]!==at[1]}),ke=h(Ae),Fe=Object(D.a)(ke,2),Ge=Fe[0],Ze=Fe[1],ot=g(Ge,Ze),mt=Object(D.a)(ot,2),it=mt[0],ze=mt[1],Ue=x.useMemo(function(){return se.map(function(lt){var at=ze(lt);return at?at.key:null})},[se]),Qe=x.useMemo(function(){return V?{checked:Ue,halfChecked:he}:null},[Ue,he,V]);x.useEffect(function(){if(J&&!re&&Ue.length){var lt;(lt=rt.current)===null||lt===void 0||lt.scrollTo({key:Ue[0]})}},[J]);var $e=String(Se).toLowerCase(),Ye=function(at){return $e?String(at[Ve]).toLowerCase().includes($e):!1},Xe=x.useState(Pe),et=Object(D.a)(Xe,2),ht=et[0],Tt=et[1],bt=x.useState(null),Lt=Object(D.a)(bt,2),xt=Lt[0],kt=Lt[1],wt=x.useMemo(function(){return Te?Object(w.a)(Te):Se?xt:ht},[ht,xt,$e,Te]);x.useEffect(function(){Se&&kt(Ae.map(function(lt){return lt.key}))},[Se]);var Ut=function(at){Tt(at),kt(at),Ce&&Ce(at)},Dt=function(at){at.preventDefault()},St=function(at,ut){var je=ut.node.key,dt=it(je,V?"checkbox":"select");dt!==null&&q(dt.data.value,{selected:!se.includes(dt.data.value)}),re||Q(!1)},Ct=x.useState(null),Pt=Object(D.a)(Ct,2),At=Pt[0],Ft=Pt[1],It=it(At);if(x.useImperativeHandle(ue,function(){return{onKeyDown:function(at){var ut,je=at.which;switch(je){case i.a.UP:case i.a.DOWN:case i.a.LEFT:case i.a.RIGHT:(ut=rt.current)===null||ut===void 0||ut.onKeyDown(at);break;case i.a.ENTER:{It!==null&&St(null,{node:{key:At},selected:!se.includes(It.data.value)});break}case i.a.ESC:Q(!1)}},onKeyUp:function(){}}}),Ne.length===0)return x.createElement("div",{role:"listbox",className:"".concat(me,"-empty"),onMouseDown:Dt},F);var Nt={};return Je&&(Nt.loadedKeys=Je),wt&&(Nt.expandedKeys=wt),x.createElement("div",{onMouseDown:Dt,onMouseEnter:B},It&&J&&x.createElement("span",{style:y,"aria-live":"assertive"},It.data.value),x.createElement(t.b,Object.assign({ref:rt,focusable:!1,prefixCls:"".concat(me,"-tree"),treeData:Ne,height:ye,itemHeight:ve,virtual:de,multiple:re,icon:We,showIcon:He,switcherIcon:Me,showLine:qe,loadData:Se?null:tt,motion:Ke,checkable:V,checkStrictly:!0,checkedKeys:Qe,selectedKeys:V?[]:Ue,defaultExpandAll:De},Nt,{onActiveChange:Ft,onSelect:St,onCheck:St,onExpand:Ut,onLoad:nt,filterTreeNode:Ye})))},l=x.forwardRef(v);l.displayName="OptionList";var u=l,d=function(){return null},c=d,_=Y("Ff2n"),f=Y("Zm9Q");function b(ne){return Object(f.a)(ne).map(function(oe){if(!x.isValidElement(oe)||!oe.type)return null;var ue=oe.key,me=oe.props,ye=me.children,ve=me.value,de=Object(_.a)(me,["children","value"]),Oe=Object(L.a)({key:ue,value:ve},de),Ae=b(ye);return Ae.length&&(Oe.children=Ae),Oe}).filter(function(oe){return oe})}function A(ne){if(!ne)return ne;var oe=Object(L.a)({},ne);return"props"in oe||Object.defineProperty(oe,"props",{get:function(){return Object(s.a)(!1,"New `rc-tree-select` not support return node instance as argument anymore. Please consider to remove `props` access."),oe}}),oe}function O(ne,oe,ue,me,ye){var ve=null,de=null;function Oe(){function Ae(re){var Se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"0",q=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return re.map(function(Q,J){var F="".concat(Se,"-").concat(J),B=ue.includes(Q.value),G=Ae(Q.children||[],F,B),V=x.createElement(c,Object.assign({},Q),G.map(function(he){return he.node}));if(oe===Q.value&&(ve=V),B){var se={pos:F,node:V,children:G};return q||de.push(se),se}return null}).filter(function(Q){return Q})}de||(de=[],Ae(me),de.sort(function(re,Se){var q=re.node.props.value,Q=Se.node.props.value,J=ue.indexOf(q),F=ue.indexOf(Q);return J-F}))}Object.defineProperty(ne,"triggerNode",{get:function(){return Object(s.a)(!1,"`triggerNode` is deprecated. Please consider decoupling data with node."),Oe(),ve}}),Object.defineProperty(ne,"allCheckedNodes",{get:function(){return Object(s.a)(!1,"`allCheckedNodes` is deprecated. Please consider decoupling data with node."),Oe(),ye?de:de.map(function(re){var Se=re.node;return Se})}})}function C(ne){return Array.isArray(ne)?ne:ne!==void 0?[ne]:[]}function P(ne,oe){var ue=new Map;return oe.forEach(function(me){var ye=me.data;ue.set(ye.value,ye)}),ne.map(function(me){return A(ue.get(me))})}function k(ne,oe){var ue=P([ne],oe)[0];return ue?ue.disabled:!1}function I(ne){return ne.disabled||ne.disableCheckbox||ne.checkable===!1}function U(ne){for(var oe=ne.parent,ue=0,me=oe;me;)me=me.parent,ue+=1;return ue}function H(ne){function oe(me){return(me||[]).map(function(ye){var ve=ye.value,de=ye.key,Oe=ye.children,Ae=Object(L.a)(Object(L.a)({},ye),{},{key:"key"in ye?de:ve});return Oe&&(Ae.children=oe(Oe)),Ae})}var ue=Object(p.d)(oe(ne),!0);return ue.map(function(me){return{key:me.data.key,data:me.data,level:U(me)}})}function Z(ne){return function(oe,ue){var me=ue[ne];return String(me).toLowerCase().includes(String(oe).toLowerCase())}}function $(ne,oe,ue){var me=ue.optionFilterProp,ye=ue.filterOption;if(ye===!1)return oe;var ve;typeof ye=="function"?ve=ye:ve=Z(me);function de(Oe){var Ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Oe.map(function(re){var Se=re.children,q=Ae||ve(ne,A(re)),Q=de(Se||[],q);return q||Q.length?Object(L.a)(Object(L.a)({},re),{},{children:Q}):null}).filter(function(re){return re})}return de(oe)}function ee(ne,oe,ue,me){var ye=new Map;return C(oe).forEach(function(ve){ve&&Object(R.a)(ve)==="object"&&"value"in ve&&ye.set(ve.value,ve)}),ne.map(function(ve){var de={value:ve},Oe=ue(ve,"select",!0),Ae=Oe?me(Oe.data):ve;if(ye.has(ve)){var re=ye.get(ve);de.label="label"in re?re.label:Ae,"halfChecked"in re&&(de.halfChecked=re.halfChecked)}else de.label=Ae;return de})}function te(ne,oe){var ue=new Set(ne);return ue.add(oe),Array.from(ue)}function K(ne,oe){var ue=new Set(ne);return ue.delete(oe),Array.from(ue)}function W(ne){var oe=ne.searchPlaceholder,ue=ne.treeCheckStrictly,me=ne.treeCheckable,ye=ne.labelInValue,ve=ne.value,de=ne.multiple;Object(s.a)(!oe,"`searchPlaceholder` has been removed."),ue&&ye===!1&&Object(s.a)(!1,"`treeCheckStrictly` will force set `labelInValue` to `true`."),(ye||ue)&&Object(s.a)(C(ve).every(function(Oe){return Oe&&Object(R.a)(Oe)==="object"&&"value"in Oe}),"Invalid prop `value` supplied to `TreeSelect`. You should use { label: string, value: string | number } or [{ label: string, value: string | number }] instead."),ue||de||me?Object(s.a)(!ve||Array.isArray(ve),"`value` should be an array when `TreeSelect` is checkable or multiple."):Object(s.a)(!Array.isArray(ve),"`value` should not be array when `TreeSelect` is single mode.")}var X=W,j=10;function z(ne,oe){var ue=oe.id,me=oe.pId,ye=oe.rootPId,ve={},de=[],Oe=ne.map(function(Ae){var re=Object(L.a)({},Ae),Se=re[ue];return ve[Se]=re,re.key=re.key||Se,re});return Oe.forEach(function(Ae){var re=Ae[me],Se=ve[re];Se&&(Se.children=Se.children||[],Se.children.push(Ae)),(re===ye||!Se&&ye===null)&&de.push(Ae)}),de}function ie(ne,oe){var ue=0,me=new Set;function ye(ve){return(ve||[]).map(function(de){var Oe=de.key,Ae=de.value,re=de.children,Se=Object(_.a)(de,["key","value","children"]),q="value"in de?Ae:Oe,Q=Object(L.a)(Object(L.a)({},Se),{},{key:Oe!=null?Oe:q,value:q,title:oe(de)});return"children"in de&&(Q.children=ye(re)),Q})}return ye(ne)}function pe(ne,oe,ue){var me=ue.getLabelProp,ye=ue.simpleMode,ve=x.useRef({});return ne?(ve.current.formatTreeData=ve.current.treeData===ne?ve.current.formatTreeData:ie(ye?z(ne,Object(L.a)({id:"id",pId:"pId",rootPId:null},ye!==!0?ye:{})):ne,me),ve.current.treeData=ne):ve.current.formatTreeData=ve.current.children===oe?ve.current.formatTreeData:ie(b(oe),me),ve.current.formatTreeData}var _e="SHOW_ALL",Ee="SHOW_PARENT",we="SHOW_CHILD";function fe(ne,oe,ue){var me=new Set(ne);return oe===we?ne.filter(function(ye){var ve=ue[ye];return!(ve&&ve.children&&ve.children.every(function(de){var Oe=de.node;return I(Oe)||me.has(Oe.key)}))}):oe===Ee?ne.filter(function(ye){var ve=ue[ye],de=ve?ve.parent:null;return!(de&&!I(de.node)&&me.has(de.node.key))}):ne}function le(ne,oe){var ue=oe.value,me=oe.getEntityByValue,ye=oe.getEntityByKey,ve=oe.treeConduction,de=oe.showCheckedStrategy,Oe=oe.conductKeyEntities,Ae=oe.getLabelProp;return x.useMemo(function(){var re=ne;if(ve){var Se=fe(ne.map(function(q){var Q=me(q);return Q?Q.key:q}),de,Oe);re=Se.map(function(q){var Q=ye(q);return Q?Q.data.value:q})}return ee(re,ue,me,Ae)},[ne,ue,ve,de,me])}var ce=["expandedKeys","treeData","treeCheckable","showCheckedStrategy","searchPlaceholder","treeLine","treeIcon","showTreeIcon","switcherIcon","treeNodeFilterProp","filterTreeNode","dropdownPopupAlign","treeDefaultExpandAll","treeCheckStrictly","treeExpandedKeys","treeLoadedKeys","treeMotion","onTreeExpand","onTreeLoad","loadData","treeDataSimpleMode","treeNodeLabelProp","treeDefaultExpandedKeys"],ge=Object(T.a)({prefixCls:"rc-tree-select",components:{optionList:u},convertChildrenToData:function(){return null},flattenOptions:H,getLabeledValue:m.e,filterOptions:$,isValueDisabled:k,findValueOption:P,omitDOMProps:function(oe){var ue=Object(L.a)({},oe);return ce.forEach(function(me){delete ue[me]}),ue}});ge.displayName="Select";var Re=x.forwardRef(function(ne,oe){var ue=ne.multiple,me=ne.treeCheckable,ye=ne.treeCheckStrictly,ve=ne.showCheckedStrategy,de=ve===void 0?"SHOW_CHILD":ve,Oe=ne.labelInValue,Ae=ne.loadData,re=ne.treeLoadedKeys,Se=ne.treeNodeFilterProp,q=Se===void 0?"value":Se,Q=ne.treeNodeLabelProp,J=ne.treeDataSimpleMode,F=ne.treeData,B=ne.treeExpandedKeys,G=ne.treeDefaultExpandedKeys,V=ne.treeDefaultExpandAll,se=ne.children,he=ne.treeIcon,Te=ne.showTreeIcon,De=ne.switcherIcon,Pe=ne.treeLine,Ce=ne.treeMotion,We=ne.filterTreeNode,He=ne.dropdownPopupAlign,Me=ne.onChange,qe=ne.onTreeExpand,Ve=ne.onTreeLoad,tt=ne.onDropdownVisibleChange,Je=ne.onSelect,Ke=ne.onDeselect,nt=me||ye,rt=ue||nt,Ne=me&&!ye,ke=ye||Oe,Fe=x.useRef(null);x.useImperativeHandle(oe,function(){return{focus:Fe.current.focus,blur:Fe.current.blur}});var Ge=function(je){return F&&je.label||je.title},Ze=function(je){return Q?je[Q]:Ge(je)},ot=pe(F,se,{getLabelProp:Ge,simpleMode:J}),mt=Object(x.useMemo)(function(){return H(ot)},[ot]),it=h(mt),ze=Object(D.a)(it,2),Ue=ze[0],Qe=ze[1],$e=g(Ue,Qe),Ye=Object(D.a)($e,2),Xe=Ye[0],et=Ye[1],ht=Object(x.useMemo)(function(){return Ne?Object(p.a)(ot):{keyEntities:null}},[ot,me,ye]),Tt=ht.keyEntities,bt=Object(n.a)(ne.defaultValue,{value:ne.value}),Lt=Object(D.a)(bt,2),xt=Lt[0],kt=Lt[1],wt=function(je){var dt=[],gt=[];return je.forEach(function(ct){et(ct)?gt.push(ct):dt.push(ct)}),{missingRawValues:dt,existRawValues:gt}},Ut=Object(x.useMemo)(function(){var ut=[],je=[];if(C(xt).forEach(function(st){if(st&&Object(R.a)(st)==="object"&&"value"in st)if(st.halfChecked&&ye){var _t=et(st.value);ut.push(_t?_t.key:st.value)}else je.push(st.value);else je.push(st)}),Ne){var dt=wt(je),gt=dt.missingRawValues,ct=dt.existRawValues,vt=ct.map(function(st){return et(st).key}),Et=Object(o.a)(vt,!0,Tt),Ot=Et.checkedKeys,Rt=Et.halfCheckedKeys;return[[].concat(Object(w.a)(gt),Object(w.a)(Ot.map(function(st){return Xe(st).data.value}))),Rt]}return[je,ut]},[xt,rt,ke,me,ye]),Dt=Object(D.a)(Ut,2),St=Dt[0],Ct=Dt[1],Pt=le(St,{treeConduction:Ne,value:xt,showCheckedStrategy:de,conductKeyEntities:Tt,getEntityByValue:et,getEntityByKey:Xe,getLabelProp:Ze}),At=function(je,dt,gt){if(kt(rt?je:je[0]),Me){var ct=je;if(Ne&&de!=="SHOW_ALL"){var vt=je.map(function(pt){var yt=et(pt);return yt?yt.key:pt}),Et=fe(vt,de,Tt);ct=Et.map(function(pt){var yt=Xe(pt);return yt?yt.data.value:pt})}var Ot=dt||{triggerValue:void 0,selected:void 0},Rt=Ot.triggerValue,st=Ot.selected,_t=ke?ee(ct,xt,et,Ze):ct;if(ye){var Mt=Ct.map(function(pt){var yt=Xe(pt);return yt?yt.data.value:pt}).filter(function(pt){return!ct.includes(pt)});_t=[].concat(Object(w.a)(_t),Object(w.a)(ee(Mt,xt,et,Ze)))}var ft={preValue:Pt,triggerValue:Rt},Bt=!0;(ye||gt==="selection"&&!st)&&(Bt=!1),O(ft,Rt,je,ot,Bt),nt?ft.checked=st:ft.selected=st,Me(rt?_t:_t[0],ke?null:ct.map(function(pt){var yt=et(pt);return yt?Ze(yt.data):null}),ft)}},Ft=function(je,dt,gt){var ct=je;if(!rt)At([je],{selected:!0,triggerValue:je},gt);else{var vt=te(St,je);if(Ne){var Et=wt(vt),Ot=Et.missingRawValues,Rt=Et.existRawValues,st=Rt.map(function(ft){return et(ft).key}),_t=Object(o.a)(st,!0,Tt),Mt=_t.checkedKeys;vt=[].concat(Object(w.a)(Ot),Object(w.a)(Mt.map(function(ft){return Xe(ft).data.value})))}At(vt,{selected:!0,triggerValue:je},gt)}Je&&Je(ct,dt)},It=function(je,dt,gt){var ct=je,vt=K(St,je);if(Ne){var Et=wt(vt),Ot=Et.missingRawValues,Rt=Et.existRawValues,st=Rt.map(function(ft){return et(ft).key}),_t=Object(o.a)(st,{checked:!1,halfCheckedKeys:Ct},Tt),Mt=_t.checkedKeys;vt=[].concat(Object(w.a)(Ot),Object(w.a)(Mt.map(function(ft){return Xe(ft).data.value})))}At(vt,{selected:!1,triggerValue:je},gt),Ke&&Ke(ct,dt)},Nt=function(){At([],null,"clear")},lt=x.useCallback(function(ut){if(tt){var je={};Object.defineProperty(je,"documentClickClose",{get:function(){return Object(s.a)(!1,"Second param of `onDropdownVisibleChange` has been removed."),!1}}),tt(ut,je)}},[tt]),at={optionLabelProp:null,optionFilterProp:q,dropdownAlign:He,internalProps:{mark:a.a,onClear:Nt,skipTriggerChange:!0,skipTriggerSelect:!0,onRawSelect:Ft,onRawDeselect:It}};return"filterTreeNode"in ne&&(at.filterOption=We),x.createElement(r.Provider,{value:{checkable:nt,loadData:Ae,treeLoadedKeys:re,onTreeLoad:Ve,checkedKeys:St,halfCheckedKeys:Ct,treeDefaultExpandAll:V,treeExpandedKeys:B,treeDefaultExpandedKeys:G,onTreeExpand:qe,treeIcon:he,treeMotion:Ce,showTreeIcon:Te,switcherIcon:De,treeLine:Pe,treeNodeFilterProp:q}},x.createElement(ge,Object.assign({ref:Fe,mode:rt?"multiple":null},ne,at,{value:Pt,labelInValue:!0,options:ot,onChange:null,onSelect:null,onDeselect:null,onDropdownVisibleChange:lt})))}),xe=function(ne){Object(S.a)(ue,ne);var oe=Object(N.a)(ue);function ue(){var me;return Object(ae.a)(this,ue),me=oe.apply(this,arguments),me.selectRef=x.createRef(),me.focus=function(){me.selectRef.current.focus()},me.blur=function(){me.selectRef.current.blur()},me}return Object(M.a)(ue,[{key:"render",value:function(){return x.createElement(Re,Object.assign({ref:this.selectRef},this.props))}}]),ue}(x.Component);xe.TreeNode=c,xe.SHOW_ALL=_e,xe.SHOW_PARENT=Ee,xe.SHOW_CHILD=we;var be=xe,Ie=Le.e=be},"8hTe":function(Be,Le,Y){Be.exports={button:"button___1wy9m"}},"9Bee":function(Be,Le,Y){"use strict";var ae=Y("DYRE"),M=Y("zeV3"),S=Y("+L6B"),N=Y("2/Rp"),w=Y("k1fw"),R=Y("tJVT"),D=Y("cDcd"),L=Y.n(D),x=Y("vg9a"),T=Y("DlQD"),m=Y.n(T),p=Y("rUJ1");function o(K,W){var X=K.match(/^(\s+)(?:```)/);if(X===null)return W;var j=X[1];return W.split(`
|
|
`).map(function(z){var ie=z.match(/^\s+/);if(ie===null)return z;var pe=Object(R.a)(ie,1),_e=pe[0];return _e.length>=j.length?z.slice(j.length):z}).join(`
|
|
`)}var a=[],n=["<ul>"],s=new m.a.Renderer,i=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function e(){a.length=0,n=["<ul>"]}var t={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function r(K,W,X,j){if(W>=K.length||K[W].level<=X)return W;var z=K[W];j.push("<li><a href='#"+z.anchor+"'>"+z.text+"</a>"),W++;var ie=[];return W=r(K,W,z.level,ie),ie.length>0&&(j.push("<ul>"),ie.forEach(function(pe){j.push(pe)}),j.push("</ul>")),j.push("</li>"),W=r(K,W,X,j),W}function E(){return r(a,0,0,n),n.push("</ul>"),n.join("")}var g={heading:function(W){var X=i.exec(W);if(X)return{type:"heading",raw:X[0],depth:X[1].length,text:X[2]}},fences:function(W){var X=this.rules.block.fences.exec(W);if(X){var j=X[0],z=o(j,X[3]||""),ie=X[2]?X[2].trim():X[2];if(["latex","katex","math"].indexOf(ie)>=0){var pe=v(),_e=z;z=pe,l[pe]={type:"block",expression:_e}}return{type:"code",raw:j,lang:ie,text:z}}}},h=/(?:\${2})([^\n`]+?)(?:\${2})/gi,y=0,v=function(){return"__special_katext_id_".concat(y++,"__")},l={};function u(){return l}function d(){y=0,l={}}function c(K){return K=K.replace(h,function(W,X){var j=v();return l[j]={type:"inline",expression:X},j}),K}var _=s.listitem;s.listitem=function(K){return _(c(K))};var f=s.paragraph;s.paragraph=function(K){return f(c(K))};var b=s.tablecell;s.tablecell=function(K,W){return b(c(K),W)},s.code=function(K,W,X){var j=(W||"").match(/\S*/)[0];return j?["latex","katex","math"].indexOf(j)>=0?"<p class='editormd-tex'>".concat(K,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(W,'">').concat(X?K:Object(p.escape)(K,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(X?K:Object(p.escape)(K,!0))+"</code></pre>"},s.heading=function(K,W,X){var j=this.options.headerPrefix+X.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return a.push({anchor:j,level:W,text:K}),"<h"+W+' id="'+j+'">'+K+"</h"+W+">"},m.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),m.a.use({tokenizer:g,renderer:s});var A=m.a,O=Y("SJMd"),C=Y("ulZh"),P=Y.n(C),k=Y("m3rI"),I=Y("Oy/b"),U=Y("p5ED"),H=Y("8hTe"),Z=Y.n(H),$=/<pre[^>]*>/g;function ee(K){var W=document.createElement("div");return W.innerHTML=K,W.childNodes.length===0?"":W.childNodes[0].nodeValue}var te=Le.a=function(K){var W=K.value,X=W===void 0?"":W,j=K.edit,z=j===void 0?!1:j,ie=K.className,pe=K.showTextOnly,_e=K.showLines,Ee=K.replaces,we=K.zoomImg,fe=K.hasMask,le=K.style,ce=le===void 0?{}:le,ge=K.stylesPrev,Re=ge===void 0?{}:ge,xe=String(X),be=Object(D.useRef)(),Ie=Object(D.useRef)(),ne=Object(D.useState)(""),oe=Object(R.a)(ne,2),ue=oe[0],me=oe[1],ye=Object(D.useState)("office"),ve=Object(R.a)(ye,2),de=ve[0],Oe=ve[1],Ae=Object(D.useMemo)(function(){try{var J=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,F=/\"\/api\/attachments\/|\"\/attachments\/download\//g,B=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;xe=xe.replace(J,"("+k.a.API_SERVER+"/api/attachments/").replace(F,'"'+k.a.API_SERVER+"/api/attachments/").replace(B,'"'+k.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(he){}var G=A(xe),V=u();if(xe.match(/\[TOC\]/)&&(G=G.replace("<p>[TOC]</p>",E()),e()),G=G.replace(/(__special_katext_id_\d+__)/g,function(he,Te){var De=V[Te],Pe=De.type,Ce=De.expression;return Object(I.renderToString)(ee(Ce)||"",{displayMode:Pe==="block",throwOnError:!1,output:"html"})}),G=G.replace(/▁/g,"\u2581\u2581\u2581"),d(),pe){var se=document.createElement("div");return se.innerHTML=G,se.innerText}return setTimeout(function(){return q()},500),G},[xe]),re=Object(D.useRef)();t.WebkitLineClamp=_e,_e&&(ce=Object(w.a)(Object(w.a)({},ce),t));function Se(J){var F=J.target;if(F.tagName.toUpperCase()==="IMG"){if(we){var B=F.getAttribute("src");me(B),Oe("image")}}else if(F.tagName.toUpperCase()==="A"){var G=F.getAttribute("href");if(G.indexOf("office")>-1)J.preventDefault(),me(G),Oe("office");else if(G.indexOf("application/pdf")>-1)J.preventDefault(),me(G),Oe("pdf");else if(G.indexOf("text/html")>-1)J.preventDefault(),me(G),Oe("html");else if(G.startsWith("#")){J.preventDefault();var V=document.getElementById(G.replace("#",""));V&&V.scrollIntoView(!0)}}}var q=function(){var F,B=(F=re.current)===null||F===void 0?void 0:F.querySelectorAll("video");B==null||B.forEach(function(G){if(G.oncontextmenu=function(){return!1},G.src.indexOf(".m3u8")>-1&&!G.canPlayType("application/vnd.apple.mpegurl")){if(P.a.isSupported()){var V=new P.a;V.loadSource(G.src),V.attachMedia(G)}}})};Object(D.useEffect)(function(){if(re.current&&Ae&&(Ae.match($)&&window.PR.prettyPrint()),re.current)return re.current.addEventListener("click",Se),function(){re.current.removeEventListener("click",Se),d(),e()}},[Ae,re.current,Se]);var Q=function(F){if(!z)return;F.target.nodeName==="IMG"?(be.current.style.display="flex",be.current.style.width=F.target.clientWidth+"px",be.current.style.height=F.target.clientHeight+"px",be.current.style.top=F.target.offsetTop+"px",be.current.style.left=F.target.offsetLeft+"px",Ie.current.src=F.target.getAttribute("src")):be.current.style.display="none"};return L.a.createElement("div",{style:{position:"relative"}},L.a.createElement("div",{ref:re,style:Object(w.a)({},ce),className:"".concat(ie||""," markdown-body ").concat(Z.a.mdBody),onMouseOver:Q,dangerouslySetInnerHTML:{__html:Ae}}),L.a.createElement("div",{ref:be,className:Z.a.button},L.a.createElement(M.a,null,L.a.createElement(N.a,{onClick:function(){return openCrop()}},"\u88C1\u526A"),L.a.createElement(N.a,{onClick:function(){return openEditor()}},"\u7F16\u8F91"))),L.a.createElement("img",{ref:Ie,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1,top:"-10000px"}}),L.a.createElement(U.a,{close:!0,data:ue,type:ue!=null&&ue.length?de:"",style:Object(w.a)({},Re),onClose:function(){return me("")}}))}},BU3w:function(Be,Le,Y){"use strict";Y.d(Le,"a",function(){return R});var ae=Y("MNnm"),M="rc-util-key";function S(D){if(D.attachTo)return D.attachTo;var L=document.querySelector("head");return L||document.body}function N(D){var L,x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(ae.a)())return null;var T=document.createElement("style");if((L=x.csp)===null||L===void 0?void 0:L.nonce){var m;T.nonce=(m=x.csp)===null||m===void 0?void 0:m.nonce}T.innerHTML=D;var p=S(x),o=p.firstChild;return x.prepend&&p.prepend?p.prepend(T):x.prepend&&o?p.insertBefore(T,o):p.appendChild(T),T}var w=new Map;function R(D,L){var x=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},T=S(x);if(!w.has(T)){var m=N("",x),p=m.parentNode;w.set(T,p),p.removeChild(m)}var o=Array.from(w.get(T).children).find(function(e){return e.tagName==="STYLE"&&e[M]===L});if(o){var a,n;if(((a=x.csp)===null||a===void 0?void 0:a.nonce)&&o.nonce!==((n=x.csp)===null||n===void 0?void 0:n.nonce)){var s;o.nonce=(s=x.csp)===null||s===void 0?void 0:s.nonce}return o.innerHTML!==D&&(o.innerHTML=D),o}var i=N(D,x);return i[M]=L,i}},DlQD:function(Be,Le,Y){(function(ae,M){Be.exports=M()})(this,function(){"use strict";function ae(q,Q){for(var J=0;J<Q.length;J++){var F=Q[J];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(q,F.key,F)}}function M(q,Q,J){return Q&&ae(q.prototype,Q),J&&ae(q,J),q}function S(q,Q){if(!q)return;if(typeof q=="string")return N(q,Q);var J=Object.prototype.toString.call(q).slice(8,-1);if(J==="Object"&&q.constructor&&(J=q.constructor.name),J==="Map"||J==="Set")return Array.from(q);if(J==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(J))return N(q,Q)}function N(q,Q){(Q==null||Q>q.length)&&(Q=q.length);for(var J=0,F=new Array(Q);J<Q;J++)F[J]=q[J];return F}function w(q,Q){var J;if(typeof Symbol=="undefined"||q[Symbol.iterator]==null){if(Array.isArray(q)||(J=S(q))||Q&&q&&typeof q.length=="number"){J&&(q=J);var F=0;return function(){return F>=q.length?{done:!0}:{done:!1,value:q[F++]}}}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 J=q[Symbol.iterator](),J.next.bind(J)}function R(q,Q){return Q={exports:{}},q(Q,Q.exports),Q.exports}var D=R(function(q){function Q(){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 J(F){q.exports.defaults=F}q.exports={defaults:Q(),getDefaults:Q,changeDefaults:J}}),L=D.defaults,x=D.getDefaults,T=D.changeDefaults,m=/[&<>"']/,p=/[&<>"']/g,o=/[<>"']|&(?!#?\w+;)/,a=/[<>"']|&(?!#?\w+;)/g,n={"&":"&","<":"<",">":">",'"':""","'":"'"},s=function(Q){return n[Q]};function i(q,Q){if(Q){if(m.test(q))return q.replace(p,s)}else if(o.test(q))return q.replace(a,s);return q}var e=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function t(q){return q.replace(e,function(Q,J){return J=J.toLowerCase(),J==="colon"?":":J.charAt(0)==="#"?J.charAt(1)==="x"?String.fromCharCode(parseInt(J.substring(2),16)):String.fromCharCode(+J.substring(1)):""})}var r=/(^|[^\[])\^/g;function E(q,Q){q=q.source||q,Q=Q||"";var J={replace:function(B,G){return G=G.source||G,G=G.replace(r,"$1"),q=q.replace(B,G),J},getRegex:function(){return new RegExp(q,Q)}};return J}var g=/[^\w:]/g,h=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function y(q,Q,J){if(q){var F;try{F=decodeURIComponent(t(J)).replace(g,"").toLowerCase()}catch(B){return null}if(F.indexOf("javascript:")===0||F.indexOf("vbscript:")===0||F.indexOf("data:")===0)return null}Q&&!h.test(J)&&(J=c(Q,J));try{J=encodeURI(J).replace(/%25/g,"%")}catch(B){return null}return J}var v={},l=/^[^:]+:\/*[^/]*$/,u=/^([^:]+:)[\s\S]*$/,d=/^([^:]+:\/*[^/]*)[\s\S]*$/;function c(q,Q){v[" "+q]||(l.test(q)?v[" "+q]=q+"/":v[" "+q]=A(q,"/",!0)),q=v[" "+q];var J=q.indexOf(":")===-1;return Q.substring(0,2)==="//"?J?Q:q.replace(u,"$1")+Q:Q.charAt(0)==="/"?J?Q:q.replace(d,"$1")+Q:q+Q}var _={exec:function(){}};function f(q){for(var Q=1,J,F;Q<arguments.length;Q++){J=arguments[Q];for(F in J)Object.prototype.hasOwnProperty.call(J,F)&&(q[F]=J[F])}return q}function b(q,Q){var J=q.replace(/\|/g,function(G,V,se){for(var he=!1,Te=V;--Te>=0&&se[Te]==="\\";)he=!he;return he?"|":" |"}),F=J.split(/ \|/),B=0;if(F.length>Q)F.splice(Q);else for(;F.length<Q;)F.push("");for(;B<F.length;B++)F[B]=F[B].trim().replace(/\\\|/g,"|");return F}function A(q,Q,J){var F=q.length;if(F===0)return"";for(var B=0;B<F;){var G=q.charAt(F-B-1);if(G===Q&&!J)B++;else if(G!==Q&&J)B++;else break}return q.substr(0,F-B)}function O(q,Q){if(q.indexOf(Q[1])===-1)return-1;for(var J=q.length,F=0,B=0;B<J;B++)if(q[B]==="\\")B++;else if(q[B]===Q[0])F++;else if(q[B]===Q[1]&&(F--,F<0))return B;return-1}function C(q){q&&q.sanitize&&!q.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}var P={escape:i,unescape:t,edit:E,cleanUrl:y,resolveUrl:c,noopTest:_,merge:f,splitCells:b,rtrim:A,findClosingBracket:O,checkSanitizeDeprecation:C},k=D.defaults,I=P.rtrim,U=P.splitCells,H=P.escape,Z=P.findClosingBracket;function $(q,Q,J){var F=Q.href,B=Q.title?H(Q.title):null,G=q[1].replace(/\\([\[\]])/g,"$1");return q[0].charAt(0)!=="!"?{type:"link",raw:J,href:F,title:B,text:G}:{type:"image",raw:J,href:F,title:B,text:H(G)}}function ee(q,Q){var J=q.match(/^(\s+)(?:```)/);if(J===null)return Q;var F=J[1];return Q.split(`
|
|
`).map(function(B){var G=B.match(/^\s+/);if(G===null)return B;var V=G[0];return V.length>=F.length?B.slice(F.length):B}).join(`
|
|
`)}var te=function(){function q(J){this.options=J||k}var Q=q.prototype;return Q.space=function(F){var B=this.rules.block.newline.exec(F);if(B)return B[0].length>1?{type:"space",raw:B[0]}:{raw:`
|
|
`}},Q.code=function(F,B){var G=this.rules.block.code.exec(F);if(G){var V=B[B.length-1];if(V&&V.type==="paragraph")return{raw:G[0],text:G[0].trimRight()};var se=G[0].replace(/^ {4}/gm,"");return{type:"code",raw:G[0],codeBlockStyle:"indented",text:this.options.pedantic?se:I(se,`
|
|
`)}}},Q.fences=function(F){var B=this.rules.block.fences.exec(F);if(B){var G=B[0],V=ee(G,B[3]||"");return{type:"code",raw:G,lang:B[2]?B[2].trim():B[2],text:V}}},Q.heading=function(F){var B=this.rules.block.heading.exec(F);if(B)return{type:"heading",raw:B[0],depth:B[1].length,text:B[2]}},Q.nptable=function(F){var B=this.rules.block.nptable.exec(F);if(B){var G={type:"table",header:U(B[1].replace(/^ *| *\| *$/g,"")),align:B[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:B[3]?B[3].replace(/\n$/,"").split(`
|
|
`):[],raw:B[0]};if(G.header.length===G.align.length){var V=G.align.length,se;for(se=0;se<V;se++)/^ *-+: *$/.test(G.align[se])?G.align[se]="right":/^ *:-+: *$/.test(G.align[se])?G.align[se]="center":/^ *:-+ *$/.test(G.align[se])?G.align[se]="left":G.align[se]=null;for(V=G.cells.length,se=0;se<V;se++)G.cells[se]=U(G.cells[se],G.header.length);return G}}},Q.hr=function(F){var B=this.rules.block.hr.exec(F);if(B)return{type:"hr",raw:B[0]}},Q.blockquote=function(F){var B=this.rules.block.blockquote.exec(F);if(B){var G=B[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:B[0],text:G}}},Q.list=function(F){var B=this.rules.block.list.exec(F);if(B){for(var G=B[0],V=B[2],se=V.length>1,he=V[V.length-1]===")",Te={type:"list",raw:G,ordered:se,start:se?+V.slice(0,-1):"",loose:!1,items:[]},De=B[0].match(this.rules.block.item),Pe=!1,Ce,We,He,Me,qe,Ve,tt,Je=De.length,Ke=0;Ke<Je;Ke++)Ce=De[Ke],G=Ce,We=Ce.length,Ce=Ce.replace(/^ *([*+-]|\d+[.)]) */,""),~Ce.indexOf(`
|
|
`)&&(We-=Ce.length,Ce=this.options.pedantic?Ce.replace(/^ {1,4}/gm,""):Ce.replace(new RegExp("^ {1,"+We+"}","gm"),"")),Ke!==Je-1&&(He=this.rules.block.bullet.exec(De[Ke+1])[0],(se?He.length===1||!he&&He[He.length-1]===")":He.length>1||this.options.smartLists&&He!==V)&&(Me=De.slice(Ke+1).join(`
|
|
`),Te.raw=Te.raw.substring(0,Te.raw.length-Me.length),Ke=Je-1)),qe=Pe||/\n\n(?!\s*$)/.test(Ce),Ke!==Je-1&&(Pe=Ce.charAt(Ce.length-1)===`
|
|
`,qe||(qe=Pe)),qe&&(Te.loose=!0),Ve=/^\[[ xX]\] /.test(Ce),tt=void 0,Ve&&(tt=Ce[1]!==" ",Ce=Ce.replace(/^\[[ xX]\] +/,"")),Te.items.push({type:"list_item",raw:G,task:Ve,checked:tt,loose:qe,text:Ce});return Te}},Q.html=function(F){var B=this.rules.block.html.exec(F);if(B)return{type:this.options.sanitize?"paragraph":"html",raw:B[0],pre:!this.options.sanitizer&&(B[1]==="pre"||B[1]==="script"||B[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(B[0]):H(B[0]):B[0]}},Q.def=function(F){var B=this.rules.block.def.exec(F);if(B){B[3]&&(B[3]=B[3].substring(1,B[3].length-1));var G=B[1].toLowerCase().replace(/\s+/g," ");return{tag:G,raw:B[0],href:B[2],title:B[3]}}},Q.table=function(F){var B=this.rules.block.table.exec(F);if(B){var G={type:"table",header:U(B[1].replace(/^ *| *\| *$/g,"")),align:B[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:B[3]?B[3].replace(/\n$/,"").split(`
|
|
`):[]};if(G.header.length===G.align.length){G.raw=B[0];var V=G.align.length,se;for(se=0;se<V;se++)/^ *-+: *$/.test(G.align[se])?G.align[se]="right":/^ *:-+: *$/.test(G.align[se])?G.align[se]="center":/^ *:-+ *$/.test(G.align[se])?G.align[se]="left":G.align[se]=null;for(V=G.cells.length,se=0;se<V;se++)G.cells[se]=U(G.cells[se].replace(/^ *\| *| *\| *$/g,""),G.header.length);return G}}},Q.lheading=function(F){var B=this.rules.block.lheading.exec(F);if(B)return{type:"heading",raw:B[0],depth:B[2].charAt(0)==="="?1:2,text:B[1]}},Q.paragraph=function(F){var B=this.rules.block.paragraph.exec(F);if(B)return{type:"paragraph",raw:B[0],text:B[1].charAt(B[1].length-1)===`
|
|
`?B[1].slice(0,-1):B[1]}},Q.text=function(F,B){var G=this.rules.block.text.exec(F);if(G){var V=B[B.length-1];return V&&V.type==="text"?{raw:G[0],text:G[0]}:{type:"text",raw:G[0],text:G[0]}}},Q.escape=function(F){var B=this.rules.inline.escape.exec(F);if(B)return{type:"escape",raw:B[0],text:H(B[1])}},Q.tag=function(F,B,G){var V=this.rules.inline.tag.exec(F);if(V)return!B&&/^<a /i.test(V[0])?B=!0:B&&/^<\/a>/i.test(V[0])&&(B=!1),!G&&/^<(pre|code|kbd|script)(\s|>)/i.test(V[0])?G=!0:G&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(V[0])&&(G=!1),{type:this.options.sanitize?"text":"html",raw:V[0],inLink:B,inRawBlock:G,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(V[0]):H(V[0]):V[0]}},Q.link=function(F){var B=this.rules.inline.link.exec(F);if(B){var G=Z(B[2],"()");if(G>-1){var V=B[0].indexOf("!")===0?5:4,se=V+B[1].length+G;B[2]=B[2].substring(0,G),B[0]=B[0].substring(0,se).trim(),B[3]=""}var he=B[2],Te="";if(this.options.pedantic){var De=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(he);De?(he=De[1],Te=De[3]):Te=""}else Te=B[3]?B[3].slice(1,-1):"";he=he.trim().replace(/^<([\s\S]*)>$/,"$1");var Pe=$(B,{href:he&&he.replace(this.rules.inline._escapes,"$1"),title:Te&&Te.replace(this.rules.inline._escapes,"$1")},B[0]);return Pe}},Q.reflink=function(F,B){var G;if((G=this.rules.inline.reflink.exec(F))||(G=this.rules.inline.nolink.exec(F))){var V=(G[2]||G[1]).replace(/\s+/g," ");if(V=B[V.toLowerCase()],!V||!V.href){var se=G[0].charAt(0);return{type:"text",raw:se,text:se}}var he=$(G,V,G[0]);return he}},Q.strong=function(F,B,G){G===void 0&&(G="");var V=this.rules.inline.strong.start.exec(F);if(V&&(!V[1]||V[1]&&(G===""||this.rules.inline.punctuation.exec(G)))){B=B.slice(-1*F.length);var se=V[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;se.lastIndex=0;for(var he;(V=se.exec(B))!=null;)if(he=this.rules.inline.strong.middle.exec(B.slice(0,V.index+3)),he)return{type:"strong",raw:F.slice(0,he[0].length),text:F.slice(2,he[0].length-2)}}},Q.em=function(F,B,G){G===void 0&&(G="");var V=this.rules.inline.em.start.exec(F);if(V&&(!V[1]||V[1]&&(G===""||this.rules.inline.punctuation.exec(G)))){B=B.slice(-1*F.length);var se=V[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;se.lastIndex=0;for(var he;(V=se.exec(B))!=null;)if(he=this.rules.inline.em.middle.exec(B.slice(0,V.index+2)),he)return{type:"em",raw:F.slice(0,he[0].length),text:F.slice(1,he[0].length-1)}}},Q.codespan=function(F){var B=this.rules.inline.code.exec(F);if(B){var G=B[2].replace(/\n/g," "),V=/[^ ]/.test(G),se=G.startsWith(" ")&&G.endsWith(" ");return V&&se&&(G=G.substring(1,G.length-1)),G=H(G,!0),{type:"codespan",raw:B[0],text:G}}},Q.br=function(F){var B=this.rules.inline.br.exec(F);if(B)return{type:"br",raw:B[0]}},Q.del=function(F){var B=this.rules.inline.del.exec(F);if(B)return{type:"del",raw:B[0],text:B[1]}},Q.autolink=function(F,B){var G=this.rules.inline.autolink.exec(F);if(G){var V,se;return G[2]==="@"?(V=H(this.options.mangle?B(G[1]):G[1]),se="mailto:"+V):(V=H(G[1]),se=V),{type:"link",raw:G[0],text:V,href:se,tokens:[{type:"text",raw:V,text:V}]}}},Q.url=function(F,B){var G;if(G=this.rules.inline.url.exec(F)){var V,se;if(G[2]==="@")V=H(this.options.mangle?B(G[0]):G[0]),se="mailto:"+V;else{var he;do he=G[0],G[0]=this.rules.inline._backpedal.exec(G[0])[0];while(he!==G[0]);V=H(G[0]),G[1]==="www."?se="http://"+V:se=V}return{type:"link",raw:G[0],text:V,href:se,tokens:[{type:"text",raw:V,text:V}]}}},Q.inlineText=function(F,B,G){var V=this.rules.inline.text.exec(F);if(V){var se;return B?se=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(V[0]):H(V[0]):V[0]:se=H(this.options.smartypants?G(V[0]):V[0]),{type:"text",raw:V[0],text:se}}},q}(),K=P.noopTest,W=P.edit,X=P.merge,j={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:K,table:K,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};j._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,j._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,j.def=W(j.def).replace("label",j._label).replace("title",j._title).getRegex(),j.bullet=/(?:[*+-]|\d{1,9}[.)])/,j.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,j.item=W(j.item,"gm").replace(/bull/g,j.bullet).getRegex(),j.list=W(j.list).replace(/bull/g,j.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+j.def.source+")").getRegex(),j._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",j._comment=/<!--(?!-?>)[\s\S]*?-->/,j.html=W(j.html,"i").replace("comment",j._comment).replace("tag",j._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),j.paragraph=W(j._paragraph).replace("hr",j.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",j._tag).getRegex(),j.blockquote=W(j.blockquote).replace("paragraph",j.paragraph).getRegex(),j.normal=X({},j),j.gfm=X({},j.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*|$)"}),j.gfm.nptable=W(j.gfm.nptable).replace("hr",j.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",j._tag).getRegex(),j.gfm.table=W(j.gfm.table).replace("hr",j.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",j._tag).getRegex(),j.pedantic=X({},j.normal,{html:W(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",j._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:K,paragraph:W(j.normal._paragraph).replace("hr",j.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",j.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var z={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:K,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:K,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};z._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",z.punctuation=W(z.punctuation).replace(/punctuation/g,z._punctuation).getRegex(),z._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",z._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",z.em.start=W(z.em.start).replace(/punctuation/g,z._punctuation).getRegex(),z.em.middle=W(z.em.middle).replace(/punctuation/g,z._punctuation).replace(/overlapSkip/g,z._overlapSkip).getRegex(),z.em.endAst=W(z.em.endAst,"g").replace(/punctuation/g,z._punctuation).getRegex(),z.em.endUnd=W(z.em.endUnd,"g").replace(/punctuation/g,z._punctuation).getRegex(),z.strong.start=W(z.strong.start).replace(/punctuation/g,z._punctuation).getRegex(),z.strong.middle=W(z.strong.middle).replace(/punctuation/g,z._punctuation).replace(/blockSkip/g,z._blockSkip).getRegex(),z.strong.endAst=W(z.strong.endAst,"g").replace(/punctuation/g,z._punctuation).getRegex(),z.strong.endUnd=W(z.strong.endUnd,"g").replace(/punctuation/g,z._punctuation).getRegex(),z.blockSkip=W(z._blockSkip,"g").getRegex(),z.overlapSkip=W(z._overlapSkip,"g").getRegex(),z._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,z._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,z._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])?)+(?![-_])/,z.autolink=W(z.autolink).replace("scheme",z._scheme).replace("email",z._email).getRegex(),z._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,z.tag=W(z.tag).replace("comment",j._comment).replace("attribute",z._attribute).getRegex(),z._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,z._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,z._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,z.link=W(z.link).replace("label",z._label).replace("href",z._href).replace("title",z._title).getRegex(),z.reflink=W(z.reflink).replace("label",z._label).getRegex(),z.reflinkSearch=W(z.reflinkSearch,"g").replace("reflink",z.reflink).replace("nolink",z.nolink).getRegex(),z.normal=X({},z),z.pedantic=X({},z.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:W(/^!?\[(label)\]\((.*?)\)/).replace("label",z._label).getRegex(),reflink:W(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",z._label).getRegex()}),z.gfm=X({},z.normal,{escape:W(z.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?= {2,}\n|[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/}),z.gfm.url=W(z.gfm.url,"i").replace("email",z.gfm._extended_email).getRegex(),z.breaks=X({},z.gfm,{br:W(z.br).replace("{2,}","*").getRegex(),text:W(z.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var ie={block:j,inline:z},pe=D.defaults,_e=ie.block,Ee=ie.inline;function we(q){return q.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function fe(q){var Q="",J,F,B=q.length;for(J=0;J<B;J++)F=q.charCodeAt(J),Math.random()>.5&&(F="x"+F.toString(16)),Q+="&#"+F+";";return Q}var le=function(){function q(J){this.tokens=[],this.tokens.links=Object.create(null),this.options=J||pe,this.options.tokenizer=this.options.tokenizer||new te,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var F={block:_e.normal,inline:Ee.normal};this.options.pedantic?(F.block=_e.pedantic,F.inline=Ee.pedantic):this.options.gfm&&(F.block=_e.gfm,this.options.breaks?F.inline=Ee.breaks:F.inline=Ee.gfm),this.tokenizer.rules=F}q.lex=function(F,B){var G=new q(B);return G.lex(F)};var Q=q.prototype;return Q.lex=function(F){return F=F.replace(/\r\n|\r/g,`
|
|
`).replace(/\t/g," "),this.blockTokens(F,this.tokens,!0),this.inline(this.tokens),this.tokens},Q.blockTokens=function(F,B,G){B===void 0&&(B=[]),G===void 0&&(G=!0),F=F.replace(/^ +$/gm,"");for(var V,se,he,Te;F;){if(V=this.tokenizer.space(F)){F=F.substring(V.raw.length),V.type&&B.push(V);continue}if(V=this.tokenizer.code(F,B)){F=F.substring(V.raw.length),V.type?B.push(V):(Te=B[B.length-1],Te.raw+=`
|
|
`+V.raw,Te.text+=`
|
|
`+V.text);continue}if(V=this.tokenizer.fences(F)){F=F.substring(V.raw.length),B.push(V);continue}if(V=this.tokenizer.heading(F)){F=F.substring(V.raw.length),B.push(V);continue}if(V=this.tokenizer.nptable(F)){F=F.substring(V.raw.length),B.push(V);continue}if(V=this.tokenizer.hr(F)){F=F.substring(V.raw.length),B.push(V);continue}if(V=this.tokenizer.blockquote(F)){F=F.substring(V.raw.length),V.tokens=this.blockTokens(V.text,[],G),B.push(V);continue}if(V=this.tokenizer.list(F)){for(F=F.substring(V.raw.length),he=V.items.length,se=0;se<he;se++)V.items[se].tokens=this.blockTokens(V.items[se].text,[],!1);B.push(V);continue}if(V=this.tokenizer.html(F)){F=F.substring(V.raw.length),B.push(V);continue}if(G&&(V=this.tokenizer.def(F))){F=F.substring(V.raw.length),this.tokens.links[V.tag]||(this.tokens.links[V.tag]={href:V.href,title:V.title});continue}if(V=this.tokenizer.table(F)){F=F.substring(V.raw.length),B.push(V);continue}if(V=this.tokenizer.lheading(F)){F=F.substring(V.raw.length),B.push(V);continue}if(G&&(V=this.tokenizer.paragraph(F))){F=F.substring(V.raw.length),B.push(V);continue}if(V=this.tokenizer.text(F,B)){F=F.substring(V.raw.length),V.type?B.push(V):(Te=B[B.length-1],Te.raw+=`
|
|
`+V.raw,Te.text+=`
|
|
`+V.text);continue}if(F){var De="Infinite loop on byte: "+F.charCodeAt(0);if(this.options.silent){console.error(De);break}else throw new Error(De)}}return B},Q.inline=function(F){var B,G,V,se,he,Te,De=F.length;for(B=0;B<De;B++){Te=F[B];switch(Te.type){case"paragraph":case"text":case"heading":{Te.tokens=[],this.inlineTokens(Te.text,Te.tokens);break}case"table":{for(Te.tokens={header:[],cells:[]},se=Te.header.length,G=0;G<se;G++)Te.tokens.header[G]=[],this.inlineTokens(Te.header[G],Te.tokens.header[G]);for(se=Te.cells.length,G=0;G<se;G++)for(he=Te.cells[G],Te.tokens.cells[G]=[],V=0;V<he.length;V++)Te.tokens.cells[G][V]=[],this.inlineTokens(he[V],Te.tokens.cells[G][V]);break}case"blockquote":{this.inline(Te.tokens);break}case"list":{for(se=Te.items.length,G=0;G<se;G++)this.inline(Te.items[G].tokens);break}}}return F},Q.inlineTokens=function(F,B,G,V,se){B===void 0&&(B=[]),G===void 0&&(G=!1),V===void 0&&(V=!1),se===void 0&&(se="");var he,Te=F,De;if(this.tokens.links){var Pe=Object.keys(this.tokens.links);if(Pe.length>0)for(;(De=this.tokenizer.rules.inline.reflinkSearch.exec(Te))!=null;)Pe.includes(De[0].slice(De[0].lastIndexOf("[")+1,-1))&&(Te=Te.slice(0,De.index)+"["+"a".repeat(De[0].length-2)+"]"+Te.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(De=this.tokenizer.rules.inline.blockSkip.exec(Te))!=null;)Te=Te.slice(0,De.index)+"["+"a".repeat(De[0].length-2)+"]"+Te.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;F;){if(he=this.tokenizer.escape(F)){F=F.substring(he.raw.length),B.push(he);continue}if(he=this.tokenizer.tag(F,G,V)){F=F.substring(he.raw.length),G=he.inLink,V=he.inRawBlock,B.push(he);continue}if(he=this.tokenizer.link(F)){F=F.substring(he.raw.length),he.type==="link"&&(he.tokens=this.inlineTokens(he.text,[],!0,V)),B.push(he);continue}if(he=this.tokenizer.reflink(F,this.tokens.links)){F=F.substring(he.raw.length),he.type==="link"&&(he.tokens=this.inlineTokens(he.text,[],!0,V)),B.push(he);continue}if(he=this.tokenizer.strong(F,Te,se)){F=F.substring(he.raw.length),he.tokens=this.inlineTokens(he.text,[],G,V),B.push(he);continue}if(he=this.tokenizer.em(F,Te,se)){F=F.substring(he.raw.length),he.tokens=this.inlineTokens(he.text,[],G,V),B.push(he);continue}if(he=this.tokenizer.codespan(F)){F=F.substring(he.raw.length),B.push(he);continue}if(he=this.tokenizer.br(F)){F=F.substring(he.raw.length),B.push(he);continue}if(he=this.tokenizer.del(F)){F=F.substring(he.raw.length),he.tokens=this.inlineTokens(he.text,[],G,V),B.push(he);continue}if(he=this.tokenizer.autolink(F,fe)){F=F.substring(he.raw.length),B.push(he);continue}if(!G&&(he=this.tokenizer.url(F,fe))){F=F.substring(he.raw.length),B.push(he);continue}if(he=this.tokenizer.inlineText(F,V,we)){F=F.substring(he.raw.length),se=he.raw.slice(-1),B.push(he);continue}if(F){var Ce="Infinite loop on byte: "+F.charCodeAt(0);if(this.options.silent){console.error(Ce);break}else throw new Error(Ce)}}return B},M(q,null,[{key:"rules",get:function(){return{block:_e,inline:Ee}}}]),q}(),ce=D.defaults,ge=P.cleanUrl,Re=P.escape,xe=function(){function q(J){this.options=J||ce}var Q=q.prototype;return Q.code=function(F,B,G){var V=(B||"").match(/\S*/)[0];if(this.options.highlight){var se=this.options.highlight(F,V);se!=null&&se!==F&&(G=!0,F=se)}return V?'<pre><code class="'+this.options.langPrefix+Re(V,!0)+'">'+(G?F:Re(F,!0))+`</code></pre>
|
|
`:"<pre><code>"+(G?F:Re(F,!0))+`</code></pre>
|
|
`},Q.blockquote=function(F){return`<blockquote>
|
|
`+F+`</blockquote>
|
|
`},Q.html=function(F){return F},Q.heading=function(F,B,G,V){return this.options.headerIds?"<h"+B+' id="'+this.options.headerPrefix+V.slug(G)+'">'+F+"</h"+B+`>
|
|
`:"<h"+B+">"+F+"</h"+B+`>
|
|
`},Q.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},Q.list=function(F,B,G){var V=B?"ol":"ul",se=B&&G!==1?' start="'+G+'"':"";return"<"+V+se+`>
|
|
`+F+"</"+V+`>
|
|
`},Q.listitem=function(F){return"<li>"+F+`</li>
|
|
`},Q.checkbox=function(F){return"<input "+(F?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},Q.paragraph=function(F){return"<p>"+F+`</p>
|
|
`},Q.table=function(F,B){return B&&(B="<tbody>"+B+"</tbody>"),`<table>
|
|
<thead>
|
|
`+F+`</thead>
|
|
`+B+`</table>
|
|
`},Q.tablerow=function(F){return`<tr>
|
|
`+F+`</tr>
|
|
`},Q.tablecell=function(F,B){var G=B.header?"th":"td",V=B.align?"<"+G+' align="'+B.align+'">':"<"+G+">";return V+F+"</"+G+`>
|
|
`},Q.strong=function(F){return"<strong>"+F+"</strong>"},Q.em=function(F){return"<em>"+F+"</em>"},Q.codespan=function(F){return"<code>"+F+"</code>"},Q.br=function(){return this.options.xhtml?"<br/>":"<br>"},Q.del=function(F){return"<del>"+F+"</del>"},Q.link=function(F,B,G){if(F=ge(this.options.sanitize,this.options.baseUrl,F),F===null)return G;var V='<a href="'+Re(F)+'"';return B&&(V+=' title="'+B+'"'),V+=">"+G+"</a>",V},Q.image=function(F,B,G){if(F=ge(this.options.sanitize,this.options.baseUrl,F),F===null)return G;var V='<img src="'+F+'" alt="'+G+'"';return B&&(V+=' title="'+B+'"'),V+=this.options.xhtml?"/>":">",V},Q.text=function(F){return F},q}(),be=function(){function q(){}var Q=q.prototype;return Q.strong=function(F){return F},Q.em=function(F){return F},Q.codespan=function(F){return F},Q.del=function(F){return F},Q.html=function(F){return F},Q.text=function(F){return F},Q.link=function(F,B,G){return""+G},Q.image=function(F,B,G){return""+G},Q.br=function(){return""},q}(),Ie=function(){function q(){this.seen={}}var Q=q.prototype;return Q.slug=function(F){var B=F.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(B)){var G=B;do this.seen[G]++,B=G+"-"+this.seen[G];while(this.seen.hasOwnProperty(B))}return this.seen[B]=0,B},q}(),ne=D.defaults,oe=P.unescape,ue=function(){function q(J){this.options=J||ne,this.options.renderer=this.options.renderer||new xe,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new be,this.slugger=new Ie}q.parse=function(F,B){var G=new q(B);return G.parse(F)};var Q=q.prototype;return Q.parse=function(F,B){B===void 0&&(B=!0);var G="",V,se,he,Te,De,Pe,Ce,We,He,Me,qe,Ve,tt,Je,Ke,nt,rt,Ne,ke=F.length;for(V=0;V<ke;V++){Me=F[V];switch(Me.type){case"space":continue;case"hr":{G+=this.renderer.hr();continue}case"heading":{G+=this.renderer.heading(this.parseInline(Me.tokens),Me.depth,oe(this.parseInline(Me.tokens,this.textRenderer)),this.slugger);continue}case"code":{G+=this.renderer.code(Me.text,Me.lang,Me.escaped);continue}case"table":{for(We="",Ce="",Te=Me.header.length,se=0;se<Te;se++)Ce+=this.renderer.tablecell(this.parseInline(Me.tokens.header[se]),{header:!0,align:Me.align[se]});for(We+=this.renderer.tablerow(Ce),He="",Te=Me.cells.length,se=0;se<Te;se++){for(Pe=Me.tokens.cells[se],Ce="",De=Pe.length,he=0;he<De;he++)Ce+=this.renderer.tablecell(this.parseInline(Pe[he]),{header:!1,align:Me.align[he]});He+=this.renderer.tablerow(Ce)}G+=this.renderer.table(We,He);continue}case"blockquote":{He=this.parse(Me.tokens),G+=this.renderer.blockquote(He);continue}case"list":{for(qe=Me.ordered,Ve=Me.start,tt=Me.loose,Te=Me.items.length,He="",se=0;se<Te;se++)Ke=Me.items[se],nt=Ke.checked,rt=Ke.task,Je="",Ke.task&&(Ne=this.renderer.checkbox(nt),tt?Ke.tokens.length>0&&Ke.tokens[0].type==="text"?(Ke.tokens[0].text=Ne+" "+Ke.tokens[0].text,Ke.tokens[0].tokens&&Ke.tokens[0].tokens.length>0&&Ke.tokens[0].tokens[0].type==="text"&&(Ke.tokens[0].tokens[0].text=Ne+" "+Ke.tokens[0].tokens[0].text)):Ke.tokens.unshift({type:"text",text:Ne}):Je+=Ne),Je+=this.parse(Ke.tokens,tt),He+=this.renderer.listitem(Je,rt,nt);G+=this.renderer.list(He,qe,Ve);continue}case"html":{G+=this.renderer.html(Me.text);continue}case"paragraph":{G+=this.renderer.paragraph(this.parseInline(Me.tokens));continue}case"text":{for(He=Me.tokens?this.parseInline(Me.tokens):Me.text;V+1<ke&&F[V+1].type==="text";)Me=F[++V],He+=`
|
|
`+(Me.tokens?this.parseInline(Me.tokens):Me.text);G+=B?this.renderer.paragraph(He):He;continue}default:{var Fe='Token with "'+Me.type+'" type was not found.';if(this.options.silent){console.error(Fe);return}else throw new Error(Fe)}}}return G},Q.parseInline=function(F,B){B=B||this.renderer;var G="",V,se,he=F.length;for(V=0;V<he;V++){se=F[V];switch(se.type){case"escape":{G+=B.text(se.text);break}case"html":{G+=B.html(se.text);break}case"link":{G+=B.link(se.href,se.title,this.parseInline(se.tokens,B));break}case"image":{G+=B.image(se.href,se.title,se.text);break}case"strong":{G+=B.strong(this.parseInline(se.tokens,B));break}case"em":{G+=B.em(this.parseInline(se.tokens,B));break}case"codespan":{G+=B.codespan(se.text);break}case"br":{G+=B.br();break}case"del":{G+=B.del(this.parseInline(se.tokens,B));break}case"text":{G+=B.text(se.text);break}default:{var Te='Token with "'+se.type+'" type was not found.';if(this.options.silent){console.error(Te);return}else throw new Error(Te)}}}return G},q}(),me=P.merge,ye=P.checkSanitizeDeprecation,ve=P.escape,de=D.getDefaults,Oe=D.changeDefaults,Ae=D.defaults;function re(q,Q,J){if(typeof q=="undefined"||q===null)throw new Error("marked(): input parameter is undefined or null");if(typeof q!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(q)+", string expected");if(typeof Q=="function"&&(J=Q,Q=null),Q=me({},re.defaults,Q||{}),ye(Q),J){var F=Q.highlight,B;try{B=le.lex(q,Q)}catch(he){return J(he)}var G=function(Te){var De;if(!Te)try{De=ue.parse(B,Q)}catch(Pe){Te=Pe}return Q.highlight=F,Te?J(Te):J(null,De)};if(!F||F.length<3)return G();if(delete Q.highlight,!B.length)return G();var V=0;re.walkTokens(B,function(he){he.type==="code"&&(V++,setTimeout(function(){F(he.text,he.lang,function(Te,De){if(Te)return G(Te);De!=null&&De!==he.text&&(he.text=De,he.escaped=!0),V--,V===0&&G()})},0))}),V===0&&G();return}try{var se=le.lex(q,Q);return Q.walkTokens&&re.walkTokens(se,Q.walkTokens),ue.parse(se,Q)}catch(he){if(he.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,Q.silent)return"<p>An error occurred:</p><pre>"+ve(he.message+"",!0)+"</pre>";throw he}}re.options=re.setOptions=function(q){return me(re.defaults,q),Oe(re.defaults),re},re.getDefaults=de,re.defaults=Ae,re.use=function(q){var Q=me({},q);if(q.renderer&&function(){var F=re.defaults.renderer||new xe,B=function(se){var he=F[se];F[se]=function(){for(var Te=arguments.length,De=new Array(Te),Pe=0;Pe<Te;Pe++)De[Pe]=arguments[Pe];var Ce=q.renderer[se].apply(F,De);return Ce===!1&&(Ce=he.apply(F,De)),Ce}};for(var G in q.renderer)B(G);Q.renderer=F}(),q.tokenizer&&function(){var F=re.defaults.tokenizer||new te,B=function(se){var he=F[se];F[se]=function(){for(var Te=arguments.length,De=new Array(Te),Pe=0;Pe<Te;Pe++)De[Pe]=arguments[Pe];var Ce=q.tokenizer[se].apply(F,De);return Ce===!1&&(Ce=he.apply(F,De)),Ce}};for(var G in q.tokenizer)B(G);Q.tokenizer=F}(),q.walkTokens){var J=re.defaults.walkTokens;Q.walkTokens=function(F){q.walkTokens(F),J&&J(F)}}re.setOptions(Q)},re.walkTokens=function(q,Q){for(var J=w(q),F;!(F=J()).done;){var B=F.value;Q(B);switch(B.type){case"table":{for(var G=w(B.tokens.header),V;!(V=G()).done;){var se=V.value;re.walkTokens(se,Q)}for(var he=w(B.tokens.cells),Te;!(Te=he()).done;)for(var De=Te.value,Pe=w(De),Ce;!(Ce=Pe()).done;){var We=Ce.value;re.walkTokens(We,Q)}break}case"list":{re.walkTokens(B.items,Q);break}default:B.tokens&&re.walkTokens(B.tokens,Q)}}},re.Parser=ue,re.parser=ue.parse,re.Renderer=xe,re.TextRenderer=be,re.Lexer=le,re.lexer=le.lex,re.Tokenizer=te,re.Slugger=Ie,re.parse=re;var Se=re;return Se})},Etsf:function(Be,Le,Y){"use strict";Y.r(Le);var ae=Y("5Dmo"),M=Y("3S7+"),S=Y("14J3"),N=Y("BMrR"),w=Y("jCWc"),R=Y("kPKH"),D=Y("sPJy"),L=Y("bE4q"),x=Y("k1fw"),T=Y("9og8"),m=Y("y8nQ"),p=Y("Vl3Y"),o=Y("tJVT"),a=Y("PpiC"),n=Y("WmNS"),s=Y.n(n),i=Y("cDcd"),e=Y.n(i),t=Y("55Ip"),r=Y("9kvl"),E=Y("9Bee"),g=Y("xKgJ"),h=Y("U/Y8"),y=Y.n(h),v=Y("Q9mQ"),l=Y("diRs"),u=Y("miYZ"),d=Y("tsqr"),c=Y("2qtc"),_=Y("kLXV"),f=Y("oBTY"),b=Y("ozfa"),A=Y("MJZm"),O=Y("5NDa"),C=Y("5rEg"),P=Y("jrin"),k=Y("nRaC"),I=Y("5RzL"),U=Y("ErOA"),H=Y("Ty5D"),Z=I.a.TreeNode,$=function(ce){var ge=ce.restful,Re=ce.loading,xe=ce.dispatch,be=Object(H.i)(),Ie=Object(H.h)(),ne=Object(i.useState)(!1),oe=Object(o.a)(ne,2),ue=oe[0],me=oe[1],ye=Object(i.useState)(),ve=Object(o.a)(ye,2),de=ve[0],Oe=ve[1],Ae=ge.actionTabs,re=p.a.useForm(),Se=Object(o.a)(re,1),q=Se[0];return Object(i.useEffect)(function(){ge.actionTabs.key=="\u65B0\u5EFA\u540C\u7EA7\u76EE\u5F55"&&q.resetFields()},[ge.actionTabs.key]),ge.actionTabs.key!=="\u65B0\u5EFA\u540C\u7EA7\u76EE\u5F55"?null:e.a.createElement(_.a,{centered:!0,title:"\u65B0\u5EFA\u76EE\u5F55",visible:ge.actionTabs.key==="\u65B0\u5EFA\u540C\u7EA7\u76EE\u5F55",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",bodyStyle:{minHeight:150},confirmLoading:ue,onOk:Object(T.a)(s.a.mark(function Q(){var J,F,B;return s.a.wrap(function(V){for(;;)switch(V.prev=V.next){case 0:return V.next=2,q.validateFields();case 2:return J=q.getFieldValue(),me(!0),F="/api/restfuls.json",V.next=7,Object(U.a)(F,{method:"post",body:Object(x.a)({file_type:1},J)});case 7:B=V.sent,B.status===0&&(d.b.success("\u6DFB\u52A0\u6210\u529F"),xe({type:"restful/setActionTabs",payload:{}}),xe({type:"restful/getRestful"})),me(!1);case 10:case"end":return V.stop()}},Q)})),onCancel:function(){xe({type:"restful/setActionTabs",payload:{}})}},e.a.createElement("div",{className:"pl30 pr30"},e.a.createElement(p.a,{form:q,initialValues:Object(P.a)({},"name","")},e.a.createElement(p.a.Item,{name:"name",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u76EE\u5F55\u540D\u79F0"}]},e.a.createElement(N.a,{className:"mt30"},e.a.createElement(R.a,{flex:"80px",className:"font14"},"\u76EE\u5F55\u540D\u79F0\uFF1A"),e.a.createElement(R.a,{flex:"1"},e.a.createElement(C.a,{placeholder:"\u8BF7\u8F93\u5165\u540D\u79F0\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26 ",maxLength:60})))))))},ee=Object(r.a)(function(le){var ce=le.restful,ge=le.loading;return{restful:ce,loading:ge}})($),te=I.a.TreeNode,K=function(ce){var ge=ce.restful,Re=ce.loading,xe=ce.dispatch,be=Object(H.i)(),Ie=Object(H.h)(),ne=Object(i.useState)(!1),oe=Object(o.a)(ne,2),ue=oe[0],me=oe[1],ye=Object(i.useState)(),ve=Object(o.a)(ye,2),de=ve[0],Oe=ve[1],Ae=ge.actionTabs,re=p.a.useForm(),Se=Object(o.a)(re,1),q=Se[0];return Object(i.useEffect)(function(){ge.actionTabs.key=="\u91CD\u547D\u540D"&&(q.resetFields(),q.setFieldsValue({name:ge.actionTabs.data.title}))},[ge.actionTabs.key]),ge.actionTabs.key!=="\u91CD\u547D\u540D"?null:e.a.createElement(_.a,{centered:!0,title:"\u91CD\u547D\u540D",visible:ge.actionTabs.key==="\u91CD\u547D\u540D",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",bodyStyle:{minHeight:150},confirmLoading:ue,onOk:Object(T.a)(s.a.mark(function Q(){var J,F,B;return s.a.wrap(function(V){for(;;)switch(V.prev=V.next){case 0:return V.next=2,q.validateFields();case 2:return J=q.getFieldValue(),me(!0),F="/api/restfuls/".concat(ge.actionTabs.data.id,".json"),V.next=7,Object(U.a)(F,{method:"put",body:Object(x.a)({file_type:1},J)});case 7:B=V.sent,B.status===0&&(d.b.success("\u4FEE\u6539\u6210\u529F"),xe({type:"restful/setActionTabs",payload:{}}),xe({type:"restful/getRestful"})),me(!1);case 10:case"end":return V.stop()}},Q)})),onCancel:function(){xe({type:"restful/setActionTabs",payload:{}})}},e.a.createElement("div",{className:"pl30 pr30"},e.a.createElement(p.a,{form:q,initialValues:Object(P.a)({},"name","")},e.a.createElement(N.a,{className:"mt30"},e.a.createElement(R.a,{flex:"80px",className:"font14"},"\u76EE\u5F55\u540D\u79F0\uFF1A"),e.a.createElement(R.a,{flex:"1"},e.a.createElement(p.a.Item,{name:"name",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u65B0\u540D\u79F0"}]},e.a.createElement(C.a,{placeholder:"\u8BF7\u8F93\u5165\u540D\u79F0\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26 ",maxLength:60})))))))},W=Object(r.a)(function(le){var ce=le.restful,ge=le.loading;return{restful:ce,loading:ge}})(K),X=Y("s7vb"),j=Y("P48q"),z=Y.n(j),ie=C.a.Search,pe=A.a.DirectoryTree,_e=function(ce){var ge=ce.user,Re=ce.globalSetting,xe=ce.loading,be=ce.dispatch,Ie=ce.restful,ne=Object(a.a)(ce,["user","globalSetting","loading","dispatch","restful"]),oe=Object(i.useState)({content:"",message:"",status:0,contacts:[],address:"",data:[]}),ue=Object(o.a)(oe,2),me=ue[0],ye=ue[1],ve=Object(i.useState)(!0),de=Object(o.a)(ve,2),Oe=de[0],Ae=de[1],re=p.a.useForm(),Se=Object(o.a)(re,1),q=Se[0],Q=Object(i.useState)(""),J=Object(o.a)(Q,2),F=J[0],B=J[1],G=Object(i.useState)([{id:1,name:"\u65B0\u5EFA\u6587\u4EF6"},{id:2,name:"\u65B0\u5EFA\u540C\u7EA7\u76EE\u5F55"},{id:3,name:"\u91CD\u547D\u540D"},{id:4,name:"\u7F16\u8F91"},{id:5,name:"\u5220\u9664"}]),V=Object(o.a)(G,1),se=V[0],he=Object(i.useState)([]),Te=Object(o.a)(he,2),De=Te[0],Pe=Te[1],Ce=Object(i.useState)([]),We=Object(o.a)(Ce,2),He=We[0],Me=We[1],qe=Object(i.useState)(!1),Ve=Object(o.a)(qe,2),tt=Ve[0],Je=Ve[1],Ke=Object(i.useState)([]),nt=Object(o.a)(Ke,2),rt=nt[0],Ne=nt[1];Object(i.useEffect)(function(){var it;if((it=Ie.restful)!==null&&it!==void 0&&it.data){var ze,Ue,Qe;Ne(Object(f.a)((ze=Ie.restful)===null||ze===void 0?void 0:ze.data));var $e=0,Ye;if((Ue=Ie.restful)===null||Ue===void 0||((Qe=Ue.data)===null||Qe===void 0)||Qe.map(function(Xe){var et;Xe.id==ne.match.params.id&&($e=Xe.id),Xe.file_type==0&&!Ye&&(Ye=Xe.id),Xe==null||((et=Xe.children)===null||et===void 0)||et.map(function(ht){Ye||(Ye=ht.id),ht.id==ne.match.params.id&&($e=Xe.id)}),!Xe.children&&!Ye&&(Ye=Xe.id)}),!ne.match.params.id&&Ye){ne.history.push("/ch/rest/".concat(Ye));return}$e&&setTimeout(function(){Pe([$e]),Me([Number(ne.match.params.id||Ye)])},200)}},[Ie.restful]);var ke=function(ze,Ue){Ue.node.file_type===0?ne.history.push("/ch/rest/".concat(ze[0])):Me(Object(f.a)(ze)),console.log("Trigger Select",ze,Ue)},Fe=function(ze){Pe(ze),console.log("Trigger Expand",ze)},Ge=function(ze){return e.a.createElement("div",null,se.map(function(Ue,Qe){return e.a.createElement("p",{key:Ue.id,className:"current",onClick:function(){switch(Ue.id){case 1:ne.history.push("/ch/rest/edit/".concat(ze.id,"/0"));break;case 2:case 3:be({type:"restful/setActionTabs",payload:{key:Ue.name,data:ze}});break;case 4:document.location.href="/ch/rest/edit/".concat(ze.pid||0,"/").concat(ze.id);break;case 5:_.a.confirm({title:"\u63D0\u793A",content:"\u662F\u5426\u786E\u5B9A\u5220\u9664\uFF1F",onOk:function(){var Ye=Object(T.a)(s.a.mark(function et(){var ht;return s.a.wrap(function(bt){for(;;)switch(bt.prev=bt.next){case 0:return bt.next=2,Object(X.a)({id:ze.id});case 2:ht=bt.sent,(ht==null?void 0:ht.status)==0&&(d.b.success("\u5220\u9664\u6210\u529F"),be({type:"restful/getRestful"}));case 4:case"end":return bt.stop()}},et)}));function Xe(){return Ye.apply(this,arguments)}return Xe}()});break}}},Ue.name)}).filter(function(Ue){return!!Ue}).filter(function(Ue){return ze.pid||ze.file_type==0?Ue.key>3:Ue.key!=4}))},Ze=function it(ze){return ze.map(function(Ue){var Qe=Ue.title.indexOf(F),$e=Ue.title.substr(0,Qe),Ye=Ue.title.substr(Qe+F.length),Xe=e.a.createElement("span",null,$e,e.a.createElement("span",{className:"c-blue"},F),Ye,Object(g.o)()&&e.a.createElement(l.a,{placement:"right",title:F,content:function(){return Ge(Ue)},trigger:"hover"},e.a.createElement("span",{className:"iconfont icon-sandian ".concat(z.a.actions)})));if(F!==""){var et;if(Qe===-1&&!((et=Ue.children)!==null&&et!==void 0&&et.length))return null}return Ue.children&&Ue.file_type===1?Object(x.a)(Object(x.a)({},Ue),{},{title:Xe,key:Ue.key,children:it(Ue.children)}):Object(x.a)(Object(x.a)({},Ue),{},{title:Xe,key:Ue.key,isLeaf:!0})}).filter(function(Ue){return!!Ue})},ot=function it(ze,Ue){for(var Qe,$e=0;$e<Ue.length;$e++){var Ye=Ue[$e];Ye.children&&(Ye.children.some(function(Xe){return Xe.key===ze})?Qe=Ye.key:it(ze,Ye.children)&&(Qe=it(ze,Ye.children)))}return Qe},mt=function(ze){var Ue=ze.target.value,Qe=rt.map(function($e){if($e!=null&&$e.children){var Ye;return $e!=null&&(Ye=$e.children.filter(function(Xe){return Xe.title.indexOf(Ue)>-1}))!==null&&Ye!==void 0&&Ye.length?$e.id:null}return null});B(Ue),Je(!0),console.log("expandedKeys:",Qe),Pe(Qe)};return console.log("loop(treeData):",Ze(rt)),e.a.createElement("div",{className:z.a.tree},e.a.createElement(ie,{style:{marginBottom:8},placeholder:"\u8F93\u5165\u5173\u952E\u5B57\u68C0\u7D22",onChange:mt}),e.a.createElement(pe,{multiple:!0,defaultExpandAll:!0,onSelect:ke,onExpand:Fe,expandedKeys:De,selectedKeys:He,autoExpandParent:tt,treeData:Ze(rt)}),e.a.createElement(ee,null),e.a.createElement(W,null))},Ee=Object(r.a)(function(le){var ce=le.user,ge=le.loading,Re=le.globalSetting,xe=le.restful;return{user:ce,globalSetting:Re,restful:xe,loading:ge.models.index}})(_e),we=function(ce){var ge,Re,xe=ce.user,be=ce.globalSetting,Ie=ce.loading,ne=ce.dispatch,oe=ce.restful,ue=Object(a.a)(ce,["user","globalSetting","loading","dispatch","restful"]),me=Object(i.useState)({content:"",message:"",status:0,contacts:[],address:"",data:[]}),ye=Object(o.a)(me,2),ve=ye[0],de=ye[1],Oe=Object(i.useState)(!0),Ae=Object(o.a)(Oe,2),re=Ae[0],Se=Ae[1],q=p.a.useForm(),Q=Object(o.a)(q,1),J=Q[0],F=ue.match.params,B=function(){var se=Object(T.a)(s.a.mark(function he(){return s.a.wrap(function(De){for(;;)switch(De.prev=De.next){case 0:ne({type:"restful/getRestful"}),F.id&&ne({type:"restful/getRestfulDetail",payload:Object(x.a)({},F)});case 2:case"end":return De.stop()}},he)}));return function(){return se.apply(this,arguments)}}();Object(i.useEffect)(function(){Se(!0),B()},[F.id]);var G=function(){ne({type:"restful/setActionTabs",payload:{key:"\u65B0\u5EFA\u540C\u7EA7\u76EE\u5F55"}})},V=function(){var he;if((he=oe.restful)!==null&&he!==void 0&&he.data){var Te,De,Pe=0;return(Te=oe.restful)===null||Te===void 0||((De=Te.data)===null||De===void 0)||De.map(function(Ce){var We;Ce==null||((We=Ce.children)===null||We===void 0)||We.map(function(He){He.id==ue.match.params.id&&(Pe=Ce.id)}),!Ce.children&&!Pe&&(Pe=Ce.id)}),Pe}return 0};return e.a.createElement("section",null,e.a.createElement("aside",{className:"edu-container mt20"},e.a.createElement(L.a,null,e.a.createElement(L.a.Item,null,e.a.createElement(t.a,{to:"/"},"\u9996\u9875")),e.a.createElement(L.a.Item,null,e.a.createElement(t.a,{to:"/ch/rest"},"API\u6587\u6863"))),e.a.createElement("div",{className:"mt20"},e.a.createElement(N.a,{gutter:[20,20]},e.a.createElement(R.a,{flex:"300px"},e.a.createElement(Ee,ue)),e.a.createElement(R.a,{flex:"1"},e.a.createElement("div",{className:y.a.info},e.a.createElement("h1",{style:{fontSize:28,paddingBottom:15,borderBottom:"1px solid #eaeaea",textAlign:"center"}},(ge=oe.restfulDetail)===null||ge===void 0?void 0:ge.name),e.a.createElement(E.a,{value:(Re=oe.restfulDetail)===null||Re===void 0?void 0:Re.description}))))),Object(g.o)()&&e.a.createElement("div",{className:y.a.bar},e.a.createElement(N.a,null,!!V()&&e.a.createElement(R.a,null,e.a.createElement(M.a,{title:"\u7F16\u8F91\u6587\u4EF6"},e.a.createElement(t.a,{to:"/ch/rest/edit/".concat(V(),"/").concat(ue.match.params.id),className:"icon-zhongmingming current"}))),e.a.createElement(R.a,null,e.a.createElement(M.a,{title:"\u6DFB\u52A0\u6587\u4EF6"},e.a.createElement(t.a,{to:"/ch/rest/edit/".concat(V(),"/0"),className:"icon-tianjiatimu current"}))),e.a.createElement(R.a,null,e.a.createElement(M.a,{title:"\u65B0\u5EFA\u6587\u4EF6\u5939"},e.a.createElement("span",{className:"icon-wenjianjia1 current",onClick:G})))))))},fe=Le.default=Object(r.a)(function(le){var ce=le.user,ge=le.loading,Re=le.globalSetting,xe=le.restful;return{user:ce,globalSetting:Re,restful:xe,loading:ge.models.index}})(we)},NvD2:function(Be,Le,Y){"use strict";Y.d(Le,"a",function(){return R});var ae=Y("Kwbf");function M(D,L){var x=new Set;return D.forEach(function(T){L.has(T)||x.add(T)}),x}function S(D){var L=D||{},x=L.disabled,T=L.disableCheckbox,m=L.checkable;return!!(x||T)||m===!1}function N(D,L,x,T){for(var m=new Set(D),p=new Set,o=0;o<=x;o+=1){var a=L.get(o)||new Set;a.forEach(function(e){var t=e.key,r=e.node,E=e.children,g=E===void 0?[]:E;m.has(t)&&!T(r)&&g.filter(function(h){return!T(h.node)}).forEach(function(h){m.add(h.key)})})}for(var n=new Set,s=x;s>=0;s-=1){var i=L.get(s)||new Set;i.forEach(function(e){var t=e.parent,r=e.node;if(T(r)||!e.parent||n.has(e.parent.key))return;if(T(e.parent.node)){n.add(t.key);return}var E=!0,g=!1;(t.children||[]).filter(function(h){return!T(h.node)}).forEach(function(h){var y=h.key,v=m.has(y);E&&!v&&(E=!1),!g&&(v||p.has(y))&&(g=!0)}),E&&m.add(t.key),g&&p.add(t.key),n.add(t.key)})}return{checkedKeys:Array.from(m),halfCheckedKeys:Array.from(M(p,m))}}function w(D,L,x,T,m){for(var p=new Set(D),o=new Set(L),a=0;a<=T;a+=1){var n=x.get(a)||new Set;n.forEach(function(t){var r=t.key,E=t.node,g=t.children,h=g===void 0?[]:g;!p.has(r)&&!o.has(r)&&!m(E)&&h.filter(function(y){return!m(y.node)}).forEach(function(y){p.delete(y.key)})})}o=new Set;for(var s=new Set,i=T;i>=0;i-=1){var e=x.get(i)||new Set;e.forEach(function(t){var r=t.parent,E=t.node;if(m(E)||!t.parent||s.has(t.parent.key))return;if(m(t.parent.node)){s.add(r.key);return}var g=!0,h=!1;(r.children||[]).filter(function(y){return!m(y.node)}).forEach(function(y){var v=y.key,l=p.has(v);g&&!l&&(g=!1),!h&&(l||o.has(v))&&(h=!0)}),g||p.delete(r.key),h&&o.add(r.key),s.add(r.key)})}return{checkedKeys:Array.from(p),halfCheckedKeys:Array.from(M(o,p))}}function R(D,L,x,T){var m=[],p;T?p=T:p=S;var o=new Set(D.filter(function(i){var e=!!x[i];return e||m.push(i),e})),a=new Map,n=0;Object.keys(x).forEach(function(i){var e=x[i],t=e.level,r=a.get(t);r||(r=new Set,a.set(t,r)),r.add(e),n=Math.max(n,t)}),Object(ae.a)(!m.length,"Tree missing follow keys: ".concat(m.slice(0,100).map(function(i){return"'".concat(i,"'")}).join(", ")));var s;return L===!0?s=N(o,a,n,p):s=w(o,L.halfCheckedKeys,a,n,p),s}},OZM5:function(Be,Le,Y){"use strict";Y.d(Le,"b",function(){return T}),Y.d(Le,"a",function(){return m}),Y.d(Le,"k",function(){return p}),Y.d(Le,"h",function(){return o}),Y.d(Le,"i",function(){return a}),Y.d(Le,"g",function(){return n}),Y.d(Le,"c",function(){return s}),Y.d(Le,"d",function(){return i}),Y.d(Le,"j",function(){return r}),Y.d(Le,"e",function(){return E}),Y.d(Le,"f",function(){return g});var ae=Y("KQm4"),M=Y("U8pU"),S=Y("Ff2n"),N=Y("cDcd"),w=Y.n(N),R=Y("Kwbf"),D=Y("WaYH"),L=.25,x=2;function T(h,y){var v=h.slice(),l=v.indexOf(y);return l>=0&&v.splice(l,1),v}function m(h,y){var v=h.slice();return v.indexOf(y)===-1&&v.push(y),v}function p(h){return h.split("-")}function o(h,y){return"".concat(h,"-").concat(y)}function a(h){return h&&h.type&&h.type.isTreeNode}function n(h,y){var v=[h],l=y[h];function u(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];d.forEach(function(c){var _=c.key,f=c.children;v.push(_),u(f)})}return u(l.children),v}function s(h,y){var v=h.clientY,l=y.selectHandle.getBoundingClientRect(),u=l.top,d=l.bottom,c=l.height,_=Math.max(c*L,x);return v<=u+_?-1:v>=d-_?1:0}function i(h,y){if(!h)return;var v=y.multiple;return v?h.slice():h.length?[h[0]]:h}var e=function(y){return y};function t(h,y){if(!h)return[];var v=y||{},l=v.processProps,u=l===void 0?e:l,d=Array.isArray(h)?h:[h];return d.map(function(c){var _=c.children,f=Object(S.a)(c,["children"]),b=t(_,y);return w.a.createElement(D.a,Object.assign({},u(f)),b)})}function r(h){if(!h)return null;var y;if(Array.isArray(h))y={checkedKeys:h,halfCheckedKeys:void 0};else if(Object(M.a)(h)==="object")y={checkedKeys:h.checked||void 0,halfCheckedKeys:h.halfChecked||void 0};else return Object(R.a)(!1,"`checkedKeys` is not an array or an object"),null;return y}function E(h,y){var v=new Set;function l(u){if(v.has(u))return;var d=y[u];if(!d)return;v.add(u);var c=d.parent,_=d.node;if(_.disabled)return;c&&l(c.key)}return(h||[]).forEach(function(u){l(u)}),Object(ae.a)(v)}function g(h){var y={};return Object.keys(h).forEach(function(v){(v.startsWith("data-")||v.startsWith("aria-"))&&(y[v]=h[v])}),y}},P48q:function(Be,Le,Y){Be.exports={flex_box_center:"flex_box_center___BHtvi",flex_space_between:"flex_space_between___1noDr",flex_box_vertical_center:"flex_box_vertical_center___2UDAc",flex_box_center_end:"flex_box_center_end___2j8--",flex_box_column:"flex_box_column___3X60k",tree:"tree___2kCYs",actions:"actions___10Q_6"}},SJMd:function(Be,Le){/**
|
|
* @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 Y,ae,M,S=!1,N,w;window.PR_SHOULD_USE_CONTINUATION=!0;var R,D;(function(){var L=window,x=["break,continue,do,else,for,if,return,while"],T=[x,"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"],m=[T,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],p=[m,"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"],o=[m,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],a=[m,"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"],n="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",s=[m,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],i="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",e=[x,"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"],t=[x,"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"],r=[x,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],E=[p,a,o,s,i,e,t,r],g=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,h="str",y="kwd",v="com",l="typ",u="lit",d="pun",c="pln",_="tag",f="dec",b="src",A="atn",O="atv",C="nocode",P="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(fe){for(var le=0,ce=!1,ge=!1,Re=0,xe=fe.length;Re<xe;++Re){var be=fe[Re];if(be.ignoreCase)ge=!0;else if(/[a-z]/i.test(be.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){ce=!0,ge=!1;break}}var Ie={b:8,t:9,n:10,v:11,f:12,r:13};function ne(ve){var de=ve.charCodeAt(0);if(de!==92)return de;var Oe=ve.charAt(1);return de=Ie[Oe],de||("0"<=Oe&&Oe<="7"?parseInt(ve.substring(1),8):Oe==="u"||Oe==="x"?parseInt(ve.substring(2),16):ve.charCodeAt(1))}function oe(ve){if(ve<32)return(ve<16?"\\x0":"\\x")+ve.toString(16);var de=String.fromCharCode(ve);return de==="\\"||de==="-"||de==="]"||de==="^"?"\\"+de:de}function ue(ve){var de=ve.substring(1,ve.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),Oe=[],Ae=de[0]==="^",re=["["];Ae&&re.push("^");for(var Se=Ae?1:0,q=de.length;Se<q;++Se){var Q=de[Se];if(/\\[bdsw]/i.test(Q))re.push(Q);else{var J=ne(Q),F;Se+2<q&&de[Se+1]==="-"?(F=ne(de[Se+2]),Se+=2):F=J,Oe.push([J,F]),F<65||J>122||(F<65||J>90||Oe.push([Math.max(65,J)|32,Math.min(F,90)|32]),F<97||J>122||Oe.push([Math.max(97,J)&~32,Math.min(F,122)&~32]))}}Oe.sort(function(se,he){return se[0]-he[0]||he[1]-se[1]});for(var B=[],G=[],Se=0;Se<Oe.length;++Se){var V=Oe[Se];V[0]<=G[1]+1?G[1]=Math.max(G[1],V[1]):B.push(G=V)}for(var Se=0;Se<B.length;++Se){var V=B[Se];re.push(oe(V[0])),V[1]>V[0]&&(V[1]+1>V[0]&&re.push("-"),re.push(oe(V[1])))}return re.push("]"),re.join("")}function me(ve){for(var de=ve.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")),Oe=de.length,Ae=[],re=0,Se=0;re<Oe;++re){var q=de[re];if(q==="(")++Se;else if(q.charAt(0)==="\\"){var Q=+q.substring(1);Q&&(Q<=Se?Ae[Q]=-1:de[re]=oe(Q))}}for(var re=1;re<Ae.length;++re)Ae[re]===-1&&(Ae[re]=++le);for(var re=0,Se=0;re<Oe;++re){var q=de[re];if(q==="(")++Se,Ae[Se]||(de[re]="(?:");else if(q.charAt(0)==="\\"){var Q=+q.substring(1);Q&&Q<=Se&&(de[re]="\\"+Ae[Q])}}for(var re=0;re<Oe;++re)de[re]==="^"&&de[re+1]!=="^"&&(de[re]="");if(ve.ignoreCase&&ce)for(var re=0;re<Oe;++re){var q=de[re],J=q.charAt(0);q.length>=2&&J==="["?de[re]=ue(q):J!=="\\"&&(de[re]=q.replace(/[a-zA-Z]/g,function(G){var V=G.charCodeAt(0);return"["+String.fromCharCode(V&~32,V|32)+"]"}))}return de.join("")}for(var ye=[],Re=0,xe=fe.length;Re<xe;++Re){var be=fe[Re];if(be.global||be.multiline)throw new Error(""+be);ye.push("(?:"+me(be)+")")}return new RegExp(ye.join("|"),ge?"gi":"g")}function I(fe,le){var ce=/(?:^|\s)nocode(?:\s|$)/,ge=[],Re=0,xe=[],be=0;function Ie(ne){var oe=ne.nodeType;if(oe==1){if(ce.test(ne.className))return;for(var ue=ne.firstChild;ue;ue=ue.nextSibling)Ie(ue);var me=ne.nodeName.toLowerCase();(me==="br"||me==="li")&&(ge[be]=`
|
|
`,xe[be<<1]=Re++,xe[be++<<1|1]=ne)}else if(oe==3||oe==4){var ye=ne.nodeValue;ye.length&&(le?ye=ye.replace(/\r\n?/g,`
|
|
`):ye=ye.replace(/[ \t\r\n]+/g," "),ge[be]=ye,xe[be<<1]=Re,Re+=ye.length,xe[be++<<1|1]=ne)}}return Ie(fe),{sourceCode:ge.join("").replace(/\n$/,""),spans:xe}}function U(fe,le,ce,ge,Re){if(!ce)return;var xe={sourceNode:fe,pre:1,langExtension:null,numberLines:null,sourceCode:ce,spans:null,basePos:le,decorations:null};ge(xe),Re.push.apply(Re,xe.decorations)}var H=/\S/;function Z(fe){for(var le=void 0,ce=fe.firstChild;ce;ce=ce.nextSibling){var ge=ce.nodeType;le=ge===1?le?fe:ce:ge===3&&H.test(ce.nodeValue)?fe:le}return le===fe?void 0:le}function $(fe,le){var ce={},ge;(function(){for(var be=fe.concat(le),Ie=[],ne={},oe=0,ue=be.length;oe<ue;++oe){var me=be[oe],ye=me[3];if(ye)for(var ve=ye.length;--ve>=0;)ce[ye.charAt(ve)]=me;var de=me[1],Oe=""+de;ne.hasOwnProperty(Oe)||(Ie.push(de),ne[Oe]=null)}Ie.push(/[\0-\uffff]/),ge=k(Ie)})();var Re=le.length,xe=function(be){for(var Ie=be.sourceCode,ne=be.basePos,oe=be.sourceNode,ue=[ne,c],me=0,ye=Ie.match(ge)||[],ve={},de=0,Oe=ye.length;de<Oe;++de){var Ae=ye[de],re=ve[Ae],Se=void 0,q;if(typeof re=="string")q=!1;else{var Q=ce[Ae.charAt(0)];if(Q)Se=Ae.match(Q[1]),re=Q[0];else{for(var J=0;J<Re;++J)if(Q=le[J],Se=Ae.match(Q[1]),Se){re=Q[0];break}Se||(re=c)}q=re.length>=5&&re.substring(0,5)==="lang-",q&&!(Se&&typeof Se[1]=="string")&&(q=!1,re=b),q||(ve[Ae]=re)}var F=me;if(me+=Ae.length,!q)ue.push(ne+F,re);else{var B=Se[1],G=Ae.indexOf(B),V=G+B.length;Se[2]&&(V=Ae.length-Se[2].length,G=V-B.length);var se=re.substring(5);U(oe,ne+F,Ae.substring(0,G),xe,ue),U(oe,ne+F+G,B,z(se,B),ue),U(oe,ne+F+V,Ae.substring(V),xe,ue)}}be.decorations=ue};return xe}function ee(fe){var le=[],ce=[];fe.tripleQuotedStrings?le.push([h,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):fe.multiLineStrings?le.push([h,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):le.push([h,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),fe.verbatimStrings&&ce.push([h,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var ge=fe.hashComments;ge&&(fe.cStyleComments?(ge>1?le.push([v,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):le.push([v,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),ce.push([h,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):le.push([v,/^#[^\r\n]*/,null,"#"])),fe.cStyleComments&&(ce.push([v,/^\/\/[^\r\n]*/,null]),ce.push([v,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Re=fe.regexLiterals;if(Re){var xe=Re>1?"":`
|
|
\r`,be=xe?".":"[\\S\\s]",Ie="/(?=[^/*"+xe+"])(?:[^/\\x5B\\x5C"+xe+"]|\\x5C"+be+"|\\x5B(?:[^\\x5C\\x5D"+xe+"]|\\x5C"+be+")*(?:\\x5D|$))+/";ce.push(["lang-regex",RegExp("^"+P+"("+Ie+")")])}var ne=fe.types;ne&&ce.push([l,ne]);var oe=(""+fe.keywords).replace(/^ | $/g,"");oe.length&&ce.push([y,new RegExp("^(?:"+oe.replace(/[\s,]+/g,"|")+")\\b"),null]),le.push([c,/^\s+/,null,` \r
|
|
\xA0`]);var ue="^.[^\\s\\w.$@'\"`/\\\\]*";return fe.regexLiterals&&(ue+="(?!s*/)"),ce.push([u,/^@[a-z_$][a-z_$@0-9]*/i,null],[l,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[c,/^[a-z_$][a-z_$@0-9]*/i,null],[u,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[c,/^\\[\s\S]?/,null],[d,new RegExp(ue),null]),$(le,ce)}var te=ee({keywords:E,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function K(fe,le,ce){for(var ge=/(?:^|\s)nocode(?:\s|$)/,Re=/\r\n?|\n/,xe=fe.ownerDocument,be=xe.createElement("li");fe.firstChild;)be.appendChild(fe.firstChild);var Ie=[be];function ne(de){var Oe=de.nodeType;if(Oe==1&&!ge.test(de.className))if(de.nodeName==="br")oe(de),de.parentNode&&de.parentNode.removeChild(de);else for(var Ae=de.firstChild;Ae;Ae=Ae.nextSibling)ne(Ae);else if((Oe==3||Oe==4)&&ce){var re=de.nodeValue,Se=re.match(Re);if(Se){var q=re.substring(0,Se.index);de.nodeValue=q;var Q=re.substring(Se.index+Se[0].length);if(Q){var J=de.parentNode;J.insertBefore(xe.createTextNode(Q),de.nextSibling)}oe(de),q||de.parentNode.removeChild(de)}}}function oe(de){for(;!de.nextSibling;)if(de=de.parentNode,!de)return;function Oe(Se,q){var Q=q?Se.cloneNode(!1):Se,J=Se.parentNode;if(J){var F=Oe(J,1),B=Se.nextSibling;F.appendChild(Q);for(var G=B;G;G=B)B=G.nextSibling,F.appendChild(G)}return Q}for(var Ae=Oe(de.nextSibling,0),re;(re=Ae.parentNode)&&re.nodeType===1;)Ae=re;Ie.push(Ae)}for(var ue=0;ue<Ie.length;++ue)ne(Ie[ue]);le===(le|0)&&Ie[0].setAttribute("value",le);var me=xe.createElement("ol");me.className="linenums";for(var ye=Math.max(0,le-1|0)||0,ue=0,ve=Ie.length;ue<ve;++ue)be=Ie[ue],be.className="L"+(ue+ye)%10,be.firstChild||be.appendChild(xe.createTextNode("\xA0")),me.appendChild(be);fe.appendChild(me)}function W(fe){var le=/\bMSIE\s(\d+)/.exec(navigator.userAgent);le=le&&+le[1]<=8;var ce=/\n/g,ge=fe.sourceCode,Re=ge.length,xe=0,be=fe.spans,Ie=be.length,ne=0,oe=fe.decorations,ue=oe.length,me=0;oe[ue]=Re;var ye,ve;for(ve=ye=0;ve<ue;)oe[ve]!==oe[ve+2]?(oe[ye++]=oe[ve++],oe[ye++]=oe[ve++]):ve+=2;for(ue=ye,ve=ye=0;ve<ue;){for(var de=oe[ve],Oe=oe[ve+1],Ae=ve+2;Ae+2<=ue&&oe[Ae+1]===Oe;)Ae+=2;oe[ye++]=de,oe[ye++]=Oe,ve=Ae}ue=oe.length=ye;var re=fe.sourceNode,Se="";re&&(Se=re.style.display,re.style.display="none");try{for(var q=null;ne<Ie;){var Q=be[ne],J=be[ne+2]||Re,F=oe[me+2]||Re,Ae=Math.min(J,F),B=be[ne+1],G;if(B.nodeType!==1&&(G=ge.substring(xe,Ae))){le&&(G=G.replace(ce,"\r")),B.nodeValue=G;var V=B.ownerDocument,se=V.createElement("span");se.className=oe[me+1];var he=B.parentNode;he.replaceChild(se,B),se.appendChild(B),xe<J&&(be[ne+1]=B=V.createTextNode(ge.substring(Ae,J)),he.insertBefore(B,se.nextSibling))}xe=Ae,xe>=J&&(ne+=2),xe>=F&&(me+=2)}}finally{re&&(re.style.display=Se)}}var X={};function j(fe,le){for(var ce=le.length;--ce>=0;){var ge=le[ce];X.hasOwnProperty(ge)?L.console&&console.warn("cannot override language handler %s",ge):X[ge]=fe}}function z(fe,le){return fe&&X.hasOwnProperty(fe)||(fe=/^\s*</.test(le)?"default-markup":"default-code"),X[fe]}j(te,["default-code"]),j($([],[[c,/^[^<?]+/],[f,/^<!\w[^>]*(?:>|$)/],[v,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[d,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),j($([[c,/^[\s]+/,null,` \r
|
|
`],[O,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[_,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[A,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[d,/^[=<>\/]+/],["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"]),j($([],[[O,/^[\s\S]+/]]),["uq.val"]),j(ee({keywords:p,hashComments:!0,cStyleComments:!0,types:g}),["c","cc","cpp","cxx","cyc","m"]),j(ee({keywords:"null,true,false"}),["json"]),j(ee({keywords:a,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:g}),["cs"]),j(ee({keywords:o,cStyleComments:!0}),["java"]),j(ee({keywords:r,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),j(ee({keywords:e,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),j(ee({keywords:i,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),j(ee({keywords:t,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),j(ee({keywords:s,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),j(ee({keywords:n,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),j($([],[[h,/^[\s\S]+/]]),["regex"]);function ie(fe){var le=fe.langExtension;try{var ce=I(fe.sourceNode,fe.pre),ge=ce.sourceCode;fe.sourceCode=ge,fe.spans=ce.spans,fe.basePos=0,z(le,ge)(fe),W(fe)}catch(Re){L.console&&console.log(Re&&Re.stack||Re)}}function pe(fe,le,ce){var ge=ce||!1,Re=le||null,xe=document.createElement("div");xe.innerHTML="<pre>"+fe+"</pre>",xe=xe.firstChild,ge&&K(xe,ge,!0);var be={langExtension:Re,numberLines:ge,sourceNode:xe,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return ie(be),xe.innerHTML}function _e(fe,le){var ce=le||document.body,ge=ce.ownerDocument||document;function Re(Q){return ce.getElementsByTagName(Q)}for(var xe=[Re("pre"),Re("code"),Re("xmp")],be=[],Ie=0;Ie<xe.length;++Ie)for(var ne=0,oe=xe[Ie].length;ne<oe;++ne)be.push(xe[Ie][ne]);xe=null;var ue=Date;ue.now||(ue={now:function(){return+new Date}});var me=0,ye=/\blang(?:uage)?-([\w.]+)(?!\S)/,ve=/\bprettyprint\b/,de=/\bprettyprinted\b/,Oe=/pre|xmp/i,Ae=/^code$/i,re=/^(?:pre|code|xmp)$/i,Se={};function q(){for(var Q=L.PR_SHOULD_USE_CONTINUATION?ue.now()+250:Infinity;me<be.length&&ue.now()<Q;me++){for(var J=be[me],F=Se,B=J;B=B.previousSibling;){var G=B.nodeType,V=(G===7||G===8)&&B.nodeValue;if(V?!/^\??prettify\b/.test(V):G!==3||/\S/.test(B.nodeValue))break;if(V){F={},V.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Je,Ke,nt){F[Ke]=nt});break}}var se=J.className;if((F!==Se||ve.test(se))&&!de.test(se)){for(var he=!1,Te=J.parentNode;Te;Te=Te.parentNode){var De=Te.tagName;if(re.test(De)&&Te.className&&ve.test(Te.className)){he=!0;break}}if(!he){J.className+=" prettyprinted";var Pe=F.lang;if(!Pe){Pe=se.match(ye);var Ce;!Pe&&(Ce=Z(J))&&Ae.test(Ce.tagName)&&(Pe=Ce.className.match(ye)),Pe&&(Pe=Pe[1])}var We;if(Oe.test(J.tagName))We=1;else{var He=J.currentStyle,Me=ge.defaultView,qe=He?He.whiteSpace:Me&&Me.getComputedStyle?Me.getComputedStyle(J,null).getPropertyValue("white-space"):0;We=qe&&qe.substring(0,3)==="pre"}var Ve=F.linenums;(Ve=Ve==="true"||+Ve)||(Ve=se.match(/\blinenums\b(?::(\d+))?/),Ve=Ve?Ve[1]&&Ve[1].length?+Ve[1]:!0:!1),Ve&&K(J,Ve,We);var tt={langExtension:Pe,sourceNode:J,numberLines:Ve,pre:We,sourceCode:null,basePos:null,spans:null,decorations:null};ie(tt)}}}me<be.length?L.setTimeout(q,250):typeof fe=="function"&&fe()}q()}var Ee=L.PR={createSimpleLexer:$,registerLangHandler:j,sourceDecorator:ee,PR_ATTRIB_NAME:A,PR_ATTRIB_VALUE:O,PR_COMMENT:v,PR_DECLARATION:f,PR_KEYWORD:y,PR_LITERAL:u,PR_NOCODE:C,PR_PLAIN:c,PR_PUNCTUATION:d,PR_SOURCE:b,PR_STRING:h,PR_TAG:_,PR_TYPE:l,prettyPrintOne:S?L.prettyPrintOne=pe:R=pe,prettyPrint:D=S?L.prettyPrint=_e:D=_e},we=L.define;typeof we=="function"&&we.amd&&we("google-code-prettify",[],function(){return Ee})})()},TXwP:function(Be,Le,Y){var ae,M;(function(){var S;(function(){"use strict";var w=[,,function(x){function T(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=[]}T.prototype.clone_empty=function(){var o=new T(this.__parent);return o.set_indent(this.__indent_count,this.__alignment_count),o},T.prototype.item=function(o){return o<0?this.__items[this.__items.length+o]:this.__items[o]},T.prototype.has_match=function(o){for(var a=this.__items.length-1;a>=0;a--)if(this.__items[a].match(o))return!0;return!1},T.prototype.set_indent=function(o,a){this.is_empty()&&(this.__indent_count=o||0,this.__alignment_count=a||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},T.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)},T.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},T.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},T.prototype.is_empty=function(){return this.__items.length===0},T.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},T.prototype.push=function(o){this.__items.push(o);var a=o.lastIndexOf(`
|
|
`);a!==-1?this.__character_count=o.length-a:this.__character_count+=o.length},T.prototype.pop=function(){var o=null;return this.is_empty()||(o=this.__items.pop(),this.__character_count-=o.length),o},T.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},T.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},T.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},T.prototype.toString=function(){var o="";return this.is_empty()?this.__parent.indent_empty_lines&&(o=this.__parent.get_indent_string(this.__indent_count)):(o=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),o+=this.__items.join("")),o};function m(o,a){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)),a=a||"",o.indent_level>0&&(a=new Array(o.indent_level+1).join(this.__indent_string)),this.__base_string=a,this.__base_string_length=a.length}m.prototype.get_indent_size=function(o,a){var n=this.__base_string_length;return a=a||0,o<0&&(n=0),n+=o*this.__indent_size,n+=a,n},m.prototype.get_indent_string=function(o,a){var n=this.__base_string;return a=a||0,o<0&&(o=0,n=""),a+=o*this.__indent_size,this.__ensure_cache(a),n+=this.__cache[a],n},m.prototype.__ensure_cache=function(o){for(;o>=this.__cache.length;)this.__add_column()},m.prototype.__add_column=function(){var o=this.__cache.length,a=0,n="";this.__indent_size&&o>=this.__indent_size&&(a=Math.floor(o/this.__indent_size),o-=a*this.__indent_size,n=new Array(a+1).join(this.__indent_string)),o&&(n+=new Array(o+1).join(" ")),this.__cache.push(n)};function p(o,a){this.__indent_cache=new m(o,a),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 T(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(o,a){return this.__indent_cache.get_indent_string(o,a)},p.prototype.get_indent_size=function(o,a){return this.__indent_cache.get_indent_size(o,a)},p.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},p.prototype.add_new_line=function(o){return this.is_empty()||!o&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},p.prototype.get_code=function(o){this.trim(!0);var a=this.current_line.pop();a&&(a[a.length-1]===`
|
|
`&&(a=a.replace(/\n+$/g,"")),this.current_line.push(a)),this._end_with_newline&&this.__add_outputline();var n=this.__lines.join(`
|
|
`);return o!==`
|
|
`&&(n=n.replace(/[\n]/g,o)),n},p.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},p.prototype.set_indent=function(o,a){return o=o||0,a=a||0,this.next_line.set_indent(o,a),this.__lines.length>1?(this.current_line.set_indent(o,a),!0):(this.current_line.set_indent(),!1)},p.prototype.add_raw_token=function(o){for(var a=0;a<o.newlines;a++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(o.whitespace_before),this.current_line.push(o.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},p.prototype.add_token=function(o){this.__add_space_before_token(),this.current_line.push(o),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},p.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},p.prototype.remove_indent=function(o){for(var a=this.__lines.length;o<a;)this.__lines[o]._remove_indent(),o++;this.current_line._remove_wrap_indent()},p.prototype.trim=function(o){for(o=o===void 0?!1:o,this.current_line.trim();o&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},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(o,a){for(var n=this.__lines.length-2;n>=0;){var s=this.__lines[n];if(s.is_empty())break;if(s.item(0).indexOf(o)!==0&&s.item(-1)!==a){this.__lines.splice(n+1,0,new T(this)),this.previous_line=this.__lines[this.__lines.length-2];break}n--}},x.exports.Output=p},,,,function(x){function T(o,a){this.raw_options=m(o,a),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"])}T.prototype._get_array=function(o,a){var n=this.raw_options[o],s=a||[];return typeof n=="object"?n!==null&&typeof n.concat=="function"&&(s=n.concat()):typeof n=="string"&&(s=n.split(/[^a-zA-Z0-9_\/\-]+/)),s},T.prototype._get_boolean=function(o,a){var n=this.raw_options[o],s=n===void 0?!!a:!!n;return s},T.prototype._get_characters=function(o,a){var n=this.raw_options[o],s=a||"";return typeof n=="string"&&(s=n.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),s},T.prototype._get_number=function(o,a){var n=this.raw_options[o];a=parseInt(a,10),isNaN(a)&&(a=0);var s=parseInt(n,10);return isNaN(s)&&(s=a),s},T.prototype._get_selection=function(o,a,n){var s=this._get_selection_list(o,a,n);if(s.length!==1)throw new Error("Invalid Option Value: The option '"+o+`' can only be one of the following values:
|
|
`+a+`
|
|
You passed in: '`+this.raw_options[o]+"'");return s[0]},T.prototype._get_selection_list=function(o,a,n){if(!a||a.length===0)throw new Error("Selection list cannot be empty.");if(n=n||[a[0]],!this._is_valid_selection(n,a))throw new Error("Invalid Default Value!");var s=this._get_array(o,n);if(!this._is_valid_selection(s,a))throw new Error("Invalid Option Value: The option '"+o+`' can contain only the following values:
|
|
`+a+`
|
|
You passed in: '`+this.raw_options[o]+"'");return s},T.prototype._is_valid_selection=function(o,a){return o.length&&a.length&&!o.some(function(n){return a.indexOf(n)===-1})};function m(o,a){var n={};o=p(o);var s;for(s in o)s!==a&&(n[s]=o[s]);if(a&&o[a])for(s in o[a])n[s]=o[a][s];return n}function p(o){var a={},n;for(n in o){var s=n.replace(/-/g,"_");a[s]=o[n]}return a}x.exports.Options=T,x.exports.normalizeOpts=p,x.exports.mergeOpts=m},,function(x){var T=RegExp.prototype.hasOwnProperty("sticky");function m(p){this.__input=p||"",this.__input_length=this.__input.length,this.__position=0}m.prototype.restart=function(){this.__position=0},m.prototype.back=function(){this.__position>0&&(this.__position-=1)},m.prototype.hasNext=function(){return this.__position<this.__input_length},m.prototype.next=function(){var p=null;return this.hasNext()&&(p=this.__input.charAt(this.__position),this.__position+=1),p},m.prototype.peek=function(p){var o=null;return p=p||0,p+=this.__position,p>=0&&p<this.__input_length&&(o=this.__input.charAt(p)),o},m.prototype.__match=function(p,o){p.lastIndex=o;var a=p.exec(this.__input);return a&&!(T&&p.sticky)&&(a.index!==o&&(a=null)),a},m.prototype.test=function(p,o){return o=o||0,o+=this.__position,o>=0&&o<this.__input_length?!!this.__match(p,o):!1},m.prototype.testChar=function(p,o){var a=this.peek(o);return p.lastIndex=0,a!==null&&p.test(a)},m.prototype.match=function(p){var o=this.__match(p,this.__position);return o?this.__position+=o[0].length:o=null,o},m.prototype.read=function(p,o,a){var n="",s;return p&&(s=this.match(p),s&&(n+=s[0])),o&&(s||!p)&&(n+=this.readUntil(o,a)),n},m.prototype.readUntil=function(p,o){var a="",n=this.__position;p.lastIndex=this.__position;var s=p.exec(this.__input);return s?(n=s.index,o&&(n+=s[0].length)):n=this.__input_length,a=this.__input.substring(this.__position,n),this.__position=n,a},m.prototype.readUntilAfter=function(p){return this.readUntil(p,!0)},m.prototype.get_regexp=function(p,o){var a=null,n="g";return o&&T&&(n="y"),typeof p=="string"&&p!==""?a=new RegExp(p,n):p&&(a=new RegExp(p.source,n)),a},m.prototype.get_literal_regexp=function(p){return RegExp(p.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},m.prototype.peekUntilAfter=function(p){var o=this.__position,a=this.readUntilAfter(p);return this.__position=o,a},m.prototype.lookBack=function(p){var o=this.__position-1;return o>=p.length&&this.__input.substring(o-p.length,o).toLowerCase()===p},x.exports.InputScanner=m},,,,,function(x){function T(m,p){m=typeof m=="string"?m:m.source,p=typeof p=="string"?p:p.source,this.__directives_block_pattern=new RegExp(m+/ beautify( \w+[:]\w+)+ /.source+p,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(m+/\sbeautify\signore:end\s/.source+p,"g")}T.prototype.get_directives=function(m){if(!m.match(this.__directives_block_pattern))return null;var p={};this.__directive_pattern.lastIndex=0;for(var o=this.__directive_pattern.exec(m);o;)p[o[1]]=o[2],o=this.__directive_pattern.exec(m);return p},T.prototype.readIgnored=function(m){return m.readUntilAfter(this.__directives_end_ignore_pattern)},x.exports.Directives=T},,function(x,T,m){var p=m(16).Beautifier,o=m(17).Options;function a(n,s){var i=new p(n,s);return i.beautify()}x.exports=a,x.exports.defaultOptions=function(){return new o}},function(x,T,m){var p=m(17).Options,o=m(2).Output,a=m(8).InputScanner,n=m(13).Directives,s=new n(/\/\*/,/\*\//),i=/\r\n|[\r\n]/,e=/\r\n|[\r\n]/g,t=/\s/,r=/(?:\s|\n)+/g,E=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,g=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function h(y,v){this._source_text=y||"",this._options=new p(v),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"]}h.prototype.eatString=function(y){var v="";for(this._ch=this._input.next();this._ch;){if(v+=this._ch,this._ch==="\\")v+=this._input.next();else if(y.indexOf(this._ch)!==-1||this._ch===`
|
|
`)break;this._ch=this._input.next()}return v},h.prototype.eatWhitespace=function(y){for(var v=t.test(this._input.peek()),l=0;t.test(this._input.peek());)this._ch=this._input.next(),y&&this._ch===`
|
|
`&&((l===0||l<this._options.max_preserve_newlines)&&(l++,this._output.add_new_line(!0)));return v},h.prototype.foundNestedPseudoClass=function(){for(var y=0,v=1,l=this._input.peek(v);l;){if(l==="{")return!0;if(l==="(")y+=1;else if(l===")"){if(y===0)return!1;y-=1}else if(l===";"||l==="}")return!1;v++,l=this._input.peek(v)}return!1},h.prototype.print_string=function(y){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(y)},h.prototype.preserveSingleSpace=function(y){y&&(this._output.space_before_token=!0)},h.prototype.indent=function(){this._indentLevel++},h.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},h.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var y=this._source_text,v=this._options.eol;v==="auto"&&(v=`
|
|
`,y&&i.test(y||"")&&(v=y.match(i)[0])),y=y.replace(e,`
|
|
`);var l=y.match(/^[\t ]*/)[0];this._output=new o(this._options,l),this._input=new a(y),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var u=0,d=!1,c=!1,_=!1,f=!1,b=!1,A=!1,O=this._ch,C=!1,P,k,I;P=this._input.read(r),k=P!=="",I=O,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),O=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var U=this._input.read(E),H=s.get_directives(U);H&&H.ignore==="start"&&(U+=s.readIgnored(this._input)),this.print_string(U),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(g)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(k),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var Z=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);Z.match(/[ :]$/)&&(Z=this.eatString(": ").replace(/\s$/,""),this.print_string(Z),this._output.space_before_token=!0),Z=Z.replace(/\s$/,""),Z==="extend"?f=!0:Z==="import"&&(b=!0),Z in this.NESTED_AT_RULE?(this._nestedLevel+=1,Z in this.CONDITIONAL_GROUP_RULE&&(_=!0)):!d&&u===0&&Z.indexOf(":")!==-1&&(c=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(k),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")c&&(c=!1,this.outdent()),_?(_=!1,d=this._indentLevel>=this._nestedLevel):d=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&d&&(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)):(I==="("?this._output.space_before_token=!1:I!==","&&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(),I==="{"&&this._output.trim(!0),b=!1,f=!1,c&&(this.outdent(),c=!1),this.print_string(this._ch),d=!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 $=0;$<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;$++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[$])){C=!0;break}(d||_)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!f&&u===0?(this.print_string(":"),c||(c=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):(this._input.lookBack(" ")&&(this._output.space_before_token=!0),this._input.peek()===":"?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":"))}else if(this._ch==='"'||this._ch==="'"){var ee=I==='"'||I==="'";this.preserveSingleSpace(ee||k),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")C=!1,u===0?(c&&(this.outdent(),c=!1),f=!1,b=!1,this.print_string(this._ch),this.eatWhitespace(!0),this._input.peek()!=="/"&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0);else if(this._ch==="(")if(this._input.lookBack("url"))this.print_string(this._ch),this.eatWhitespace(),u++,this.indent(),this._ch=this._input.next(),this._ch===")"||this._ch==='"'||this._ch==="'"?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),u&&(u--,this.outdent()));else{var te=!1;this._input.lookBack("with")&&(te=!0),this.preserveSingleSpace(k||te),this.print_string(this._ch),c&&I==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),A=!0):(this.eatWhitespace(),u++,this.indent())}else if(this._ch===")")u&&(u--,this.outdent()),A&&this._input.peek()===";"&&this._options.selector_separator_newline&&(A=!1,this.outdent(),this._output.add_new_line()),this.print_string(this._ch);else if(this._ch===",")this.print_string(this._ch),this.eatWhitespace(!0),this._options.selector_separator_newline&&(!c||A)&&u===0&&!b&&!f?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!c&&u===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&&t.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(k),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),t.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 K=I==='"'||I==="'";this.preserveSingleSpace(K||k),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
|
|
`&&C&&this._output.add_new_line()}var W=this._output.get_code(v);return W},x.exports.Beautifier=h},function(x,T,m){var p=m(6).Options;function o(a){p.call(this,a,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var n=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||n;var s=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var i=0;i<s.length;i++)s[i]!=="expand"?this.brace_style="collapse":this.brace_style=s[i]}o.prototype=new p,x.exports.Options=o}],R={};function D(x){var T=R[x];if(T!==void 0)return T.exports;var m=R[x]={exports:{}};return w[x](m,m.exports,D),m.exports}var L=D(15);S=L})();var N=S;!(ae=[],M=function(){return{css_beautify:N}}.apply(Le,ae),M!==void 0&&(Be.exports=M))})()},"U/Y8":function(Be,Le,Y){Be.exports={flex_box_center:"flex_box_center___2aRVA",flex_space_between:"flex_space_between___12c3F",flex_box_vertical_center:"flex_box_vertical_center___30OYS",flex_box_center_end:"flex_box_center_end___12QBt",flex_box_column:"flex_box_column___t6urT",info:"info___2BaCz",bar:"bar___3Aega"}},WaYH:function(Be,Le,Y){"use strict";var ae=Y("rePB"),M=Y("Ff2n"),S=Y("VTBJ"),N=Y("1OyB"),w=Y("vuIU"),R=Y("JX7q"),D=Y("Ji7U"),L=Y("LK+K"),x=Y("cDcd"),T=Y("TSYQ"),m=Y.n(T),p=Y("sboe"),o=Y("OZM5"),a=function(y){var v=y.prefixCls,l=y.level,u=y.isStart,d=y.isEnd;if(!l)return null;for(var c="".concat(v,"-indent-unit"),_=[],f=0;f<l;f+=1){var b;_.push(x.createElement("span",{key:f,className:m()(c,(b={},Object(ae.a)(b,"".concat(c,"-start"),u[f+1]),Object(ae.a)(b,"".concat(c,"-end"),d[f+1]),Object(ae.a)(b,"".concat(c,"-end-first-level"),!f&&d[0]),b))}))}return x.createElement("span",{"aria-hidden":"true",className:"".concat(v,"-indent")},_)},n=a,s=Y("815F"),i="open",e="close",t="---",r=function(h){Object(D.a)(v,h);var y=Object(L.a)(v);function v(){var l;return Object(N.a)(this,v),l=y.apply(this,arguments),l.state={dragNodeHighlight:!1},l.onSelectorClick=function(u){var d=l.props.context.onNodeClick;d(u,Object(s.b)(l.props)),l.isSelectable()?l.onSelect(u):l.onCheck(u)},l.onSelectorDoubleClick=function(u){var d=l.props.context.onNodeDoubleClick;d(u,Object(s.b)(l.props))},l.onSelect=function(u){if(l.isDisabled())return;var d=l.props.context.onNodeSelect;u.preventDefault(),d(u,Object(s.b)(l.props))},l.onCheck=function(u){if(l.isDisabled())return;var d=l.props,c=d.disableCheckbox,_=d.checked,f=l.props.context.onNodeCheck;if(!l.isCheckable()||c)return;u.preventDefault();var b=!_;f(u,Object(s.b)(l.props),b)},l.onMouseEnter=function(u){var d=l.props.context.onNodeMouseEnter;d(u,Object(s.b)(l.props))},l.onMouseLeave=function(u){var d=l.props.context.onNodeMouseLeave;d(u,Object(s.b)(l.props))},l.onContextMenu=function(u){var d=l.props.context.onNodeContextMenu;d(u,Object(s.b)(l.props))},l.onDragStart=function(u){var d=l.props.context.onNodeDragStart;u.stopPropagation(),l.setState({dragNodeHighlight:!0}),d(u,Object(R.a)(l));try{u.dataTransfer.setData("text/plain","")}catch(c){}},l.onDragEnter=function(u){var d=l.props.context.onNodeDragEnter;u.preventDefault(),u.stopPropagation(),d(u,Object(R.a)(l))},l.onDragOver=function(u){var d=l.props.context.onNodeDragOver;u.preventDefault(),u.stopPropagation(),d(u,Object(R.a)(l))},l.onDragLeave=function(u){var d=l.props.context.onNodeDragLeave;u.stopPropagation(),d(u,Object(R.a)(l))},l.onDragEnd=function(u){var d=l.props.context.onNodeDragEnd;u.stopPropagation(),l.setState({dragNodeHighlight:!1}),d(u,Object(R.a)(l))},l.onDrop=function(u){var d=l.props.context.onNodeDrop;u.preventDefault(),u.stopPropagation(),l.setState({dragNodeHighlight:!1}),d(u,Object(R.a)(l))},l.onExpand=function(u){var d=l.props.context.onNodeExpand;d(u,Object(s.b)(l.props))},l.setSelectHandle=function(u){l.selectHandle=u},l.getNodeState=function(){var u=l.props.expanded;return l.isLeaf()?null:u?i:e},l.hasChildren=function(){var u=l.props.eventKey,d=l.props.context.keyEntities,c=d[u]||{},_=c.children;return!!(_||[]).length},l.isLeaf=function(){var u=l.props,d=u.isLeaf,c=u.loaded,_=l.props.context.loadData,f=l.hasChildren();return d===!1?!1:d||!_&&!f||_&&c&&!f},l.isDisabled=function(){var u=l.props.disabled,d=l.props.context.disabled;return!!(d||u)},l.isCheckable=function(){var u=l.props.checkable,d=l.props.context.checkable;return!d||u===!1?!1:d},l.syncLoadData=function(u){var d=u.expanded,c=u.loading,_=u.loaded,f=l.props.context,b=f.loadData,A=f.onNodeLoad;if(c)return;b&&d&&!l.isLeaf()&&(!l.hasChildren()&&!_&&A(Object(s.b)(l.props)))},l.renderSwitcher=function(){var u=l.props,d=u.expanded,c=u.switcherIcon,_=l.props.context,f=_.prefixCls,b=_.switcherIcon,A=c||b;if(l.isLeaf())return x.createElement("span",{className:m()("".concat(f,"-switcher"),"".concat(f,"-switcher-noop"))},typeof A=="function"?A(Object(S.a)(Object(S.a)({},l.props),{},{isLeaf:!0})):A);var O=m()("".concat(f,"-switcher"),"".concat(f,"-switcher_").concat(d?i:e));return x.createElement("span",{onClick:l.onExpand,className:O},typeof A=="function"?A(Object(S.a)(Object(S.a)({},l.props),{},{isLeaf:!1})):A)},l.renderCheckbox=function(){var u=l.props,d=u.checked,c=u.halfChecked,_=u.disableCheckbox,f=l.props.context.prefixCls,b=l.isDisabled(),A=l.isCheckable();if(!A)return null;var O=typeof A!="boolean"?A:null;return x.createElement("span",{className:m()("".concat(f,"-checkbox"),d&&"".concat(f,"-checkbox-checked"),!d&&c&&"".concat(f,"-checkbox-indeterminate"),(b||_)&&"".concat(f,"-checkbox-disabled")),onClick:l.onCheck},O)},l.renderIcon=function(){var u=l.props.loading,d=l.props.context.prefixCls;return x.createElement("span",{className:m()("".concat(d,"-iconEle"),"".concat(d,"-icon__").concat(l.getNodeState()||"docu"),u&&"".concat(d,"-icon_loading"))})},l.renderSelector=function(){var u=l.state.dragNodeHighlight,d=l.props,c=d.title,_=d.selected,f=d.icon,b=d.loading,A=d.data,O=l.props.context,C=O.prefixCls,P=O.showIcon,k=O.icon,I=O.draggable,U=O.loadData,H=O.titleRender,Z=l.isDisabled(),$="".concat(C,"-node-content-wrapper"),ee;if(P){var te=f||k;ee=te?x.createElement("span",{className:m()("".concat(C,"-iconEle"),"".concat(C,"-icon__customize"))},typeof te=="function"?te(l.props):te):l.renderIcon()}else U&&b&&(ee=l.renderIcon());var K;typeof c=="function"?K=c(A):H?K=H(A):K=c;var W=x.createElement("span",{className:"".concat(C,"-title")},K);return x.createElement("span",{ref:l.setSelectHandle,title:typeof c=="string"?c:"",className:m()("".concat($),"".concat($,"-").concat(l.getNodeState()||"normal"),!Z&&(_||u)&&"".concat(C,"-node-selected"),!Z&&I&&"draggable"),draggable:!Z&&I||void 0,"aria-grabbed":!Z&&I||void 0,onMouseEnter:l.onMouseEnter,onMouseLeave:l.onMouseLeave,onContextMenu:l.onContextMenu,onClick:l.onSelectorClick,onDoubleClick:l.onSelectorDoubleClick,onDragStart:I?l.onDragStart:void 0},ee,W)},l}return Object(w.a)(v,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var u=this.props.selectable,d=this.props.context.selectable;return typeof u=="boolean"?u:d}},{key:"render",value:function(){var u,d=this.props,c=d.eventKey,_=d.className,f=d.style,b=d.dragOver,A=d.dragOverGapTop,O=d.dragOverGapBottom,C=d.isLeaf,P=d.isStart,k=d.isEnd,I=d.expanded,U=d.selected,H=d.checked,Z=d.halfChecked,$=d.loading,ee=d.domRef,te=d.active,K=d.onMouseMove,W=Object(M.a)(d,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),X=this.props.context,j=X.prefixCls,z=X.filterTreeNode,ie=X.draggable,pe=X.keyEntities,_e=this.isDisabled(),Ee=Object(o.f)(W),we=pe[c]||{},fe=we.level,le=k[k.length-1];return x.createElement("div",Object.assign({ref:ee,className:m()(_,"".concat(j,"-treenode"),(u={},Object(ae.a)(u,"".concat(j,"-treenode-disabled"),_e),Object(ae.a)(u,"".concat(j,"-treenode-switcher-").concat(I?"open":"close"),!C),Object(ae.a)(u,"".concat(j,"-treenode-checkbox-checked"),H),Object(ae.a)(u,"".concat(j,"-treenode-checkbox-indeterminate"),Z),Object(ae.a)(u,"".concat(j,"-treenode-selected"),U),Object(ae.a)(u,"".concat(j,"-treenode-loading"),$),Object(ae.a)(u,"".concat(j,"-treenode-active"),te),Object(ae.a)(u,"".concat(j,"-treenode-leaf-last"),le),Object(ae.a)(u,"drag-over",!_e&&b),Object(ae.a)(u,"drag-over-gap-top",!_e&&A),Object(ae.a)(u,"drag-over-gap-bottom",!_e&&O),Object(ae.a)(u,"filter-node",z&&z(Object(s.b)(this.props))),u)),style:f,onDragEnter:ie?this.onDragEnter:void 0,onDragOver:ie?this.onDragOver:void 0,onDragLeave:ie?this.onDragLeave:void 0,onDrop:ie?this.onDrop:void 0,onDragEnd:ie?this.onDragEnd:void 0,onMouseMove:K},Ee),x.createElement(n,{prefixCls:j,level:fe,isStart:P,isEnd:k}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),v}(x.Component),E=function(y){return x.createElement(p.a.Consumer,null,function(v){return x.createElement(r,Object.assign({},y,{context:v}))})};E.displayName="TreeNode",E.defaultProps={title:t},E.isTreeNode=1;var g=Le.a=E},Y1PL:function(Be,Le,Y){"use strict";Y.r(Le),Y.d(Le,"ResizableTextArea",function(){return Z});var ae=Y("wx14"),M=Y("1OyB"),S=Y("vuIU"),N=Y("Ji7U"),w=Y("LK+K"),R=Y("cDcd"),D=Y("VTBJ"),L=Y("rePB"),x=Y("Zm9Q"),T=Y("Kwbf"),m=Y("c+Xe"),p=Y("m+aA"),o=Y("bdgK"),a=new Map;function n(te){te.forEach(function(K){var W,X=K.target;(W=a.get(X))===null||W===void 0||W.forEach(function(j){return j(X)})})}var s=new o.default(n),i=null,e=null;function t(te,K){a.has(te)||(a.set(te,new Set),s.observe(te)),a.get(te).add(K)}function r(te,K){a.has(te)&&(a.get(te).delete(K),a.get(te).size||(s.unobserve(te),a.delete(te)))}var E=function(te){Object(N.a)(W,te);var K=Object(w.a)(W);function W(){return Object(M.a)(this,W),K.apply(this,arguments)}return Object(S.a)(W,[{key:"render",value:function(){return this.props.children}}]),W}(R.Component),g=R.createContext(null);function h(te){var K=te.children,W=te.onBatchResize,X=R.useRef(0),j=R.useRef([]),z=R.useContext(g),ie=R.useCallback(function(pe,_e,Ee){X.current+=1;var we=X.current;j.current.push({size:pe,element:_e,data:Ee}),Promise.resolve().then(function(){we===X.current&&(W==null||W(j.current),j.current=[])}),z==null||z(pe,_e,Ee)},[W,z]);return R.createElement(g.Provider,{value:ie},K)}function y(te){var K=te.children,W=te.disabled,X=R.useRef(null),j=R.useRef(null),z=R.useContext(g),ie=R.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),pe=R.isValidElement(K)&&Object(m.c)(K),_e=pe?K.ref:null,Ee=R.useMemo(function(){return Object(m.a)(_e,X)},[_e,X]),we=R.useRef(te);we.current=te;var fe=R.useCallback(function(le){var ce=we.current,ge=ce.onResize,Re=ce.data,xe=le.getBoundingClientRect(),be=xe.width,Ie=xe.height,ne=le.offsetWidth,oe=le.offsetHeight,ue=Math.floor(be),me=Math.floor(Ie);if(ie.current.width!==ue||ie.current.height!==me||ie.current.offsetWidth!==ne||ie.current.offsetHeight!==oe){var ye={width:ue,height:me,offsetWidth:ne,offsetHeight:oe};ie.current=ye;var ve=ne===Math.round(be)?be:ne,de=oe===Math.round(Ie)?Ie:oe,Oe=Object(D.a)(Object(D.a)({},ye),{},{offsetWidth:ve,offsetHeight:de});z==null||z(Oe,le,Re),ge&&Promise.resolve().then(function(){ge(Oe,le)})}},[]);return R.useEffect(function(){var le=Object(p.a)(X.current)||Object(p.a)(j.current);return le&&!W&&t(le,fe),function(){return r(le,fe)}},[X.current,W]),R.createElement(E,{ref:j},pe?R.cloneElement(K,{ref:Ee}):K)}var v="rc-observer-key";function l(te){var K=te.children,W=Object(x.a)(K);return W.map(function(X,j){var z=(X==null?void 0:X.key)||"".concat(v,"-").concat(j);return R.createElement(y,Object(ae.a)({},te,{key:z}),X)})}l.Collection=h;var u=l,d=Y("bT9E"),c=Y("TSYQ"),_=Y.n(c),f=`
|
|
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"],A={},O;function C(te){var K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,W=te.getAttribute("id")||te.getAttribute("data-reactid")||te.getAttribute("name");if(K&&A[W])return A[W];var X=window.getComputedStyle(te),j=X.getPropertyValue("box-sizing")||X.getPropertyValue("-moz-box-sizing")||X.getPropertyValue("-webkit-box-sizing"),z=parseFloat(X.getPropertyValue("padding-bottom"))+parseFloat(X.getPropertyValue("padding-top")),ie=parseFloat(X.getPropertyValue("border-bottom-width"))+parseFloat(X.getPropertyValue("border-top-width")),pe=b.map(function(Ee){return"".concat(Ee,":").concat(X.getPropertyValue(Ee))}).join(";"),_e={sizingStyle:pe,paddingSize:z,borderSize:ie,boxSizing:j};return K&&W&&(A[W]=_e),_e}function P(te){var K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,W=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,X=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;O||(O=document.createElement("textarea"),O.setAttribute("tab-index","-1"),O.setAttribute("aria-hidden","true"),document.body.appendChild(O)),te.getAttribute("wrap")?O.setAttribute("wrap",te.getAttribute("wrap")):O.removeAttribute("wrap");var j=C(te,K),z=j.paddingSize,ie=j.borderSize,pe=j.boxSizing,_e=j.sizingStyle;O.setAttribute("style","".concat(_e,";").concat(f)),O.value=te.value||te.placeholder||"";var Ee=Number.MIN_SAFE_INTEGER,we=Number.MAX_SAFE_INTEGER,fe=O.scrollHeight,le;if(pe==="border-box"?fe+=ie:pe==="content-box"&&(fe-=z),W!==null||X!==null){O.value=" ";var ce=O.scrollHeight-z;W!==null&&(Ee=ce*W,pe==="border-box"&&(Ee=Ee+z+ie),fe=Math.max(Ee,fe)),X!==null&&(we=ce*X,pe==="border-box"&&(we=we+z+ie),le=fe>we?"":"hidden",fe=Math.min(we,fe))}return{height:fe,minHeight:Ee,maxHeight:we,overflowY:le,resize:"none"}}var k=Y("Gytx"),I=Y.n(k),U;(function(te){te[te.NONE=0]="NONE",te[te.RESIZING=1]="RESIZING",te[te.RESIZED=2]="RESIZED"})(U||(U={}));var H=function(te){Object(N.a)(W,te);var K=Object(w.a)(W);function W(X){var j;return Object(M.a)(this,W),j=K.call(this,X),j.nextFrameActionId=void 0,j.resizeFrameId=void 0,j.textArea=void 0,j.saveTextArea=function(z){j.textArea=z},j.handleResize=function(z){var ie=j.state.resizeStatus,pe=j.props,_e=pe.autoSize,Ee=pe.onResize;if(ie!==U.NONE)return;typeof Ee=="function"&&Ee(z),_e&&j.resizeOnNextFrame()},j.resizeOnNextFrame=function(){cancelAnimationFrame(j.nextFrameActionId),j.nextFrameActionId=requestAnimationFrame(j.resizeTextarea)},j.resizeTextarea=function(){var z=j.props.autoSize;if(!z||!j.textArea)return;var ie=z.minRows,pe=z.maxRows,_e=P(j.textArea,!1,ie,pe);j.setState({textareaStyles:_e,resizeStatus:U.RESIZING},function(){cancelAnimationFrame(j.resizeFrameId),j.resizeFrameId=requestAnimationFrame(function(){j.setState({resizeStatus:U.RESIZED},function(){j.resizeFrameId=requestAnimationFrame(function(){j.setState({resizeStatus:U.NONE}),j.fixFirefoxAutoScroll()})})})})},j.renderTextArea=function(){var z=j.props,ie=z.prefixCls,pe=ie===void 0?"rc-textarea":ie,_e=z.autoSize,Ee=z.onResize,we=z.className,fe=z.disabled,le=j.state,ce=le.textareaStyles,ge=le.resizeStatus,Re=Object(d.a)(j.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),xe=_()(pe,we,Object(L.a)({},"".concat(pe,"-disabled"),fe));"value"in Re&&(Re.value=Re.value||"");var be=Object(D.a)(Object(D.a)(Object(D.a)({},j.props.style),ce),ge===U.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return R.createElement(u,{onResize:j.handleResize,disabled:!(_e||Ee)},R.createElement("textarea",Object(ae.a)({},Re,{className:xe,style:be,ref:j.saveTextArea})))},j.state={textareaStyles:{},resizeStatus:U.NONE},j}return Object(S.a)(W,[{key:"componentDidUpdate",value:function(j){(j.value!==this.props.value||!I()(j.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 j=this.textArea.selectionStart,z=this.textArea.selectionEnd;this.textArea.setSelectionRange(j,z)}}catch(ie){}}},{key:"render",value:function(){return this.renderTextArea()}}]),W}(R.Component),Z=H,$=function(te){Object(N.a)(W,te);var K=Object(w.a)(W);function W(X){var j;Object(M.a)(this,W),j=K.call(this,X),j.resizableTextArea=void 0,j.focus=function(){j.resizableTextArea.textArea.focus()},j.saveTextArea=function(ie){j.resizableTextArea=ie},j.handleChange=function(ie){var pe=j.props.onChange;j.setValue(ie.target.value,function(){j.resizableTextArea.resizeTextarea()}),pe&&pe(ie)},j.handleKeyDown=function(ie){var pe=j.props,_e=pe.onPressEnter,Ee=pe.onKeyDown;ie.keyCode===13&&_e&&_e(ie),Ee&&Ee(ie)};var z=typeof X.value=="undefined"||X.value===null?X.defaultValue:X.value;return j.state={value:z},j}return Object(S.a)(W,[{key:"setValue",value:function(j,z){"value"in this.props||this.setState({value:j},z)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return R.createElement(Z,Object(ae.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(j){return"value"in j?{value:j.value}:null}}]),W}(R.Component),ee=Le.default=$},ZW9T:function(Be,Le,Y){"use strict";Y.d(Le,"a",function(){return P});var ae=Y("k1fw"),M=Y("miYZ"),S=Y("tsqr"),N=Y("rAM+"),w=Y("tJVT"),R=Y("PpiC"),D=Y("cDcd"),L=Y.n(D),x=Y("bdgK"),T=Y("oBTY"),m=Y("9og8"),p=Y("WmNS"),o=Y.n(p),a={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"]},n={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"]},s={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 <iostream>",content:["#include <iostream>"].join(`
|
|
`)},{label:"#include <vector>",content:["#include <vector>"].join(`
|
|
`)},{label:"#include <sstream>",content:["#include <sstream>"].join(`
|
|
`)},{label:"#include <string>",content:["#include <string>"].join(`
|
|
`)},{label:"#include <cmath>",content:["#include <cmath>"].join(`
|
|
`)}]},i={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(`
|
|
`)}]},e=Y("5VLF"),t=Y.n(e),r={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"]}},E=function(I,U){return U.map(function(H){return{label:H,kind:I.languages.CompletionItemKind.Keyword,insertText:H}})},g=function(I){return Object.keys(r.tables).map(function(U){return{label:U,kind:I.languages.CompletionItemKind.Variable,insertText:U}})},h=function(I,U){var H=r.tables[I];return H?H.map(function(Z){return{label:Z,kind:U.languages.CompletionItemKind.Field,insertText:Z}}):[]};function y(k,I,U,H,Z){var $=I.getWordUntilPosition(U),ee={startLineNumber:U.lineNumber,endLineNumber:U.lineNumber,startColumn:$.startColumn,endColumn:$.endColumn},te=H.map(function(K){return{label:K,kind:k.languages.CompletionItemKind.Keyword,insertText:K,insertTextRules:k.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ee}});return Z.map(function(K){te.push(Object(ae.a)(Object(ae.a)({},K),{},{range:ee}))}),te}var v=function(k){r.languages.map(function(Z){return k.languages.registerDocumentFormattingEditProvider(Z,{provideDocumentFormattingEdits:function(ee,te,K){return Object(m.a)(o.a.mark(function W(){var X;return o.a.wrap(function(z){for(;;)switch(z.prev=z.next){case 0:return X=t()(ee.getValue(),{indent_size:"2",indent_char:" ",max_preserve_newlines:"2",preserve_newlines:!0,keep_array_indentation:!0,break_chained_methods:!1,indent_scripts:"normal",brace_style:"collapse",space_before_conditional:!0,unescape_strings:!1,jslint_happy:!1,end_with_newline:!0,wrap_line_length:"0",indent_inner_html:!1,comma_first:!1,e4x:!1,indent_empty_lines:!1}),z.abrupt("return",[{range:ee.getFullModelRange(),text:X}]);case 2:case"end":return z.stop()}},W)}))()}}),Z});var I=s.quickKey.map(function(Z){return{label:Z.label,kind:k.languages.CompletionItemKind.Method,insertText:Z.content,insertTextRules:k.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),U=i.quickKey.map(function(Z){return{label:Z.label,kind:k.languages.CompletionItemKind.Method,insertText:Z.content,insertTextRules:k.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),H=n.quickKey.map(function(Z){return{label:Z.label,kind:k.languages.CompletionItemKind.Method,insertText:Z.content,insertTextRules:k.languages.CompletionItemInsertTextRule.InsertAsSnippet}});k.languages.registerCompletionItemProvider("cpp",{triggerCharacters:["."," ","#"].concat(Object(T.a)(s.keywords),Object(T.a)(s.quickKey.map(function(Z){return Z.label}))),provideCompletionItems:function($,ee){var te=$.getValueInRange({startLineNumber:ee.lineNumber,startColumn:1,endLineNumber:ee.lineNumber,endColumn:ee.column}),K=te.match(/cu/gim);console.log("match:",K,ee,te,$);var W=[],X=ee.lineNumber,j=ee.column,z=$.getValueInRange({startLineNumber:X,startColumn:0,endLineNumber:X,endColumn:j}),ie=z.trim().split(/\s+/),pe=ie[ie.length-1];if(pe.endsWith(".")){var _e=pe.slice(0,pe.length-1);Object.keys(r.tables).includes(_e)&&(W=Object(T.a)(h(_e,k)))}else pe==="."?W=[]:W=[].concat(Object(T.a)(g(k)),Object(T.a)(E(k,s.keywords)),Object(T.a)(I));return{suggestions:W}}}),k.languages.registerCompletionItemProvider("c",{triggerCharacters:["."," ","#"].concat(Object(T.a)(a.keywords)),provideCompletionItems:function($,ee){var te=$.getValueInRange({startLineNumber:ee.lineNumber,startColumn:1,endLineNumber:ee.lineNumber,endColumn:ee.column}),K=te.match(/cu/gim);console.log("match:",K,ee,te,$);var W=[],X=ee.lineNumber,j=ee.column,z=$.getValueInRange({startLineNumber:X,startColumn:0,endLineNumber:X,endColumn:j}),ie=z.trim().split(/\s+/),pe=ie[ie.length-1];if(pe.endsWith(".")){var _e=pe.slice(0,pe.length-1);Object.keys(r.tables).includes(_e)&&(W=Object(T.a)(h(_e,k)))}else pe==="."?W=[]:W=[].concat(Object(T.a)(g(k)),Object(T.a)(E(k,a.keywords)));return{suggestions:W}}}),k.languages.registerCompletionItemProvider("java",{triggerCharacters:["."," "].concat(Object(T.a)(n.keywords)),provideCompletionItems:function($,ee){var te=[],K=ee.lineNumber,W=ee.column,X=$.getValueInRange({startLineNumber:K,startColumn:0,endLineNumber:K,endColumn:W}),j=X.trim().split(/\s+/),z=j[j.length-1];if(z.endsWith(".")){var ie=z.slice(0,z.length-1);Object.keys(r.tables).includes(ie)&&(te=Object(T.a)(h(ie,k)))}else z==="."?te=[]:te=[].concat(Object(T.a)(g(k)),Object(T.a)(E(k,n.keywords)),Object(T.a)(H));return{suggestions:te}}}),k.languages.registerCompletionItemProvider("python",{triggerCharacters:["."," "].concat(Object(T.a)(i.keywords)),provideCompletionItems:function($,ee){var te=[],K=ee.lineNumber,W=ee.column,X=$.getValueInRange({startLineNumber:K,startColumn:0,endLineNumber:K,endColumn:W}),j=X.trim().split(/\s+/),z=j[j.length-1];if(z.endsWith(".")){var ie=z.slice(0,z.length-1);Object.keys(r.tables).includes(ie)&&(te=Object(T.a)(h(ie,k)))}else z==="."?te=[]:te=[].concat(Object(T.a)(g(k)),Object(T.a)(E(k,i.keywords)),Object(T.a)(U));return{suggestions:te}}})},l="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",u=Y("LvDl"),d=Y("+ua5");function c(k){return/^\d+$/.test(k)?"".concat(k,"px"):k}function _(){}var f=!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 A(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],I=k;if(Array.isArray(k)){for(var U=0;U<k.length;U++){var H=b[k[U]];if(H)return H}return I[0]}return b[I]||I}var O=null,C=Le.b=function(k){var I=k.width,U=I===void 0?"100%":I,H=k.height,Z=H===void 0?"100%":H,$=k.value,ee=k.language,te=ee===void 0?"javascript":ee,K=k.style,W=K===void 0?{}:K,X=k.options,j=X===void 0?{}:X,z=k.overrideServices,ie=z===void 0?{}:z,pe=k.theme,_e=pe===void 0?"vs-dark":pe,Ee=k.onEditBlur,we=k.onSave,fe=k.autoHeight,le=fe===void 0?!1:fe,ce=k.forbidCopy,ge=ce===void 0?!1:ce,Re=k.onChange,xe=Re===void 0?_:Re,be=k.editorDidMount,Ie=be===void 0?_:be,ne=k.onFocus,oe=ne===void 0?_:ne,ue=k.filename,me=ue===void 0?"educoder.txt":ue,ye=k.errorLine,ve=k.errorContent,de=ve===void 0?"":ve,Oe=Object(R.a)(k,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),Ae=Object(D.useRef)(),re=Object(D.useRef)({}),Se=Object(D.useRef)(),q=Object(D.useRef)(!1),Q=Object(D.useRef)(),J=Object(D.useState)(!1),F=Object(w.a)(J,2),B=F[0],G=F[1];function V(){var Ne;return Ae.current&&(Ne=new x.default(function(ke){var Fe=Object(N.a)(ke),Ge;try{for(Fe.s();!(Ge=Fe.n()).done;){var Ze=Ge.value;(Ze.target.offsetHeight>0||Ze.target.offsetWidth>0)&&re.current.instance.layout()}}catch(ot){Fe.e(ot)}finally{Fe.f()}}),Ne.observe(Ae.current)),Ne}function se(){S.b.warn(decodeURIComponent(l))}var he=function(){var ke=re.current.instance;if($!=null&&ke&&B){var Fe=ke.getModel();Fe&&$!==Fe.getValue()&&(f=!0,Fe.setValue($),ke.layout(),f=!1)}};Object(D.useEffect)(function(){Se.current&&clearTimeout(Se.current),Se.current=setTimeout(function(){he()},500)},[$,B,re.current]),Object(D.useEffect)(function(){if(ye&&re.current&&re.current.instance){var Ne=re.current.instance;Ne.changeViewZones(function(Fe){var Ge=document.createElement("div");Ge.style.padding="10px 20px",Ge.style.width="calc(100% - 20px)",Ge.className="my-error-line-wrp",Ge.innerHTML=de,Fe.addZone({afterLineNumber:ye||11,heightInLines:3,domNode:Ge})});var ke={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}};Ne.addOverlayWidget(ke),Ne.revealPositionInCenter({lineNumber:20,column:1})}},[ye,re.current,B]);function Te(){var Ne=re.current.instance;if(Ne){var ke=Ne.getSelection(),Fe=re.current.pastePos||{},Ge=new O.Range(Fe.startLineNumber||ke.endLineNumber,Fe.startColumn||ke.endColumn,Fe.endLineNumber||ke.endLineNumber,Fe.endColumn||ke.endColumn);setTimeout(function(){Ne.executeEdits("",[{range:Ge,text:""}])},300)}}function De(Ne){(window.navigator.platform.match("Mac")?Ne.metaKey:Ne.ctrlKey)&&Ne.keyCode==83&&(Ne.preventDefault(),we())}var Pe=function(){if(le&&re.current.instance){var ke=re.current.instance.getContentHeight();nt(ke<Z?Z:ke)}else nt(Z)};function Ce(Ne){var ke=document.createEvent("MouseEvents");ke.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),Ne.dispatchEvent(ke)}function We(Ne,ke){var Fe=window.URL||window.webkitURL||window,Ge=new Blob([ke]),Ze=document.createElementNS("http://www.w3.org/1999/xhtml","a");Ze.href=Fe.createObjectURL(Ge),Ze.download=Ne,Ce(Ze)}Object(D.useEffect)(function(){Pe()},[Pe]),Object(D.useEffect)(function(){Ae.current&&!B&&Y.e(27).then(Y.t.bind(null,"M/lh",7)).then(function(Ne){try{O=Ne,re.current.instance=O.editor.create(Ae.current,{value:$,language:A(te),theme:_e,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},ie);var ke=re.current.instance;if(Ie(ke,O),setTimeout(function(){Pe(),re.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){We(me||"educoder.txt",ke.getValue())}})},500),re.current.subscription=ke.onDidChangeModelContent(function(Ge){q.current?clearTimeout(Q.current):(Pe(),xe(ke.getValue(),Ge)),Q.current=setTimeout(function(){q.current=!1},500)}),window.Monaco||v(O),ge&&(ke.addCommand(O.KeyMod.CtrlCmd|O.KeyMod.Shift|O.KeyCode.KEY_V,function(){return se(),null}),ke.addCommand(O.KeyMod.CtrlCmd|O.KeyCode.KEY_C,function(){return se(),null})),window.Monaco=O,Ee&&ke.onDidBlurEditorWidget(function(){Ee(ke.getValue())}),oe&&ke.onDidFocusEditorText(function(){oe(ke.getValue())}),ge){ke.addCommand(O.KeyMod.CtrlCmd|O.KeyCode.KEY_V,function(){return se(),null}),ke.onDidPaste(function(Ge){re.current.pastePos=Ge});try{window.addEventListener("paste",Te)}catch(Ge){}}var Fe=V();return G(!0),function(){var Ge=re.current.instance;Ge.dispose();var Ze=Ge.getModel();Ze&&Ze.dispose(),re.current.subscription&&re.current.subscription.dispose(),ge&&window.removeEventListener("paste",Te),Fe.unobserve(Ae.current)}}catch(Ge){}})},[]),Object(D.useEffect)(function(){var Ne=re.current.instance;if(Ne&&B)return document.addEventListener("keydown",De,!1),function(){document.removeEventListener("keydown",De)}},[we,B]),Object(D.useEffect)(function(){var Ne=re.current.instance;if(Ne&&B){var ke=A(te);O.editor.setModelLanguage(Ne.getModel(),ke),console.log("language:",te,Ne.getModel(),ke)}},[te,B]),Object(D.useEffect)(function(){var Ne=re.current.instance;Ne&&B&&O.editor.setTheme(_e)},[_e,B]),Object(D.useEffect)(function(){var Ne=re.current.instance;Ne&&B&&(Ne.updateOptions(Object(ae.a)({},j)),setTimeout(function(){Ne.getModel().updateOptions(Object(ae.a)({},j))},200))},[JSON.stringify(j),B]),Object(D.useEffect)(function(){var Ne=re.current.instance;Ne&&B&&Ne.layout()},[U,Z,B]);var He=Object(D.useState)(c(U)),Me=Object(w.a)(He,2),qe=Me[0],Ve=Me[1],tt=Object(D.useState)(c(Z)),Je=Object(w.a)(tt,2),Ke=Je[0],nt=Je[1],rt=Object(ae.a)(Object(ae.a)({},W),{},{width:qe,height:Ke});return L.a.createElement("div",{className:"my-monaco-editor",ref:Ae,style:rt})};function P(k){var I=k.width,U=I===void 0?"100%":I,H=k.height,Z=H===void 0?"100%":H,$=k.original,ee=k.modified,te=k.language,K=k.options,W=K===void 0?{}:K,X=Object(D.useRef)(),j=Object(D.useState)(null),z=Object(w.a)(j,2),ie=z[0],pe=z[1];function _e(le){var ce;return X.current&&(ce=new x.default(function(ge){var Re=Object(N.a)(ge),xe;try{for(Re.s();!(xe=Re.n()).done;){var be=xe.value;(be.target.offsetHeight>0||be.target.offsetWidth>0)&&le.layout()}}catch(Ie){Re.e(Ie)}finally{Re.f()}}),ce.observe(X.current)),ce}Object(D.useEffect)(function(){X.current&&Y.e(27).then(Y.t.bind(null,"M/lh",7)).then(function(le){O=le;var ce=O.editor.createDiffEditor(X.current,Object(ae.a)(Object(ae.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},W),{},{wordWrap:!0}));pe(ce);var ge=_e(ce);return function(){ce.dispose();var Re=ce.getModel();Re&&Re.dispose(),ge.unobserve(X.current)}})},[]),Object(D.useEffect)(function(){ie&&ie.setModel({original:O.editor.createModel($,te),modified:O.editor.createModel(ee,te)})},[$,ee,te,ie]);var Ee=c(U),we=c(Z),fe={width:Ee,height:we};return L.a.createElement("div",{className:"my-diff-editor",ref:X,style:fe})}},ZpRC:function(Be,Le,Y){"use strict";function ae(m){return typeof m=="object"&&m!=null&&m.nodeType===1}function M(m,p){return(!p||m!=="hidden")&&m!=="visible"&&m!=="clip"}function S(m,p){if(m.clientHeight<m.scrollHeight||m.clientWidth<m.scrollWidth){var o=getComputedStyle(m,null);return M(o.overflowY,p)||M(o.overflowX,p)||function(a){var n=function(s){if(!s.ownerDocument||!s.ownerDocument.defaultView)return null;try{return s.ownerDocument.defaultView.frameElement}catch(i){return null}}(a);return!!n&&(n.clientHeight<a.scrollHeight||n.clientWidth<a.scrollWidth)}(m)}return!1}function N(m,p,o,a,n,s,i,e){return s<m&&i>p||s>m&&i<p?0:s<=m&&e<=o||i>=p&&e>=o?s-m-a:i>p&&e<o||s<m&&e>o?i-p+n:0}var w=function(m,p){var o=window,a=p.scrollMode,n=p.block,s=p.inline,i=p.boundary,e=p.skipOverflowHiddenElements,t=typeof i=="function"?i:function(ce){return ce!==i};if(!ae(m))throw new TypeError("Invalid target");for(var r=document.scrollingElement||document.documentElement,E=[],g=m;ae(g)&&t(g);){if((g=g.parentElement)===r){E.push(g);break}g!=null&&g===document.body&&S(g)&&!S(document.documentElement)||g!=null&&S(g,e)&&E.push(g)}for(var h=o.visualViewport?o.visualViewport.width:innerWidth,y=o.visualViewport?o.visualViewport.height:innerHeight,v=window.scrollX||pageXOffset,l=window.scrollY||pageYOffset,u=m.getBoundingClientRect(),d=u.height,c=u.width,_=u.top,f=u.right,b=u.bottom,A=u.left,O=n==="start"||n==="nearest"?_:n==="end"?b:_+d/2,C=s==="center"?A+c/2:s==="end"?f:A,P=[],k=0;k<E.length;k++){var I=E[k],U=I.getBoundingClientRect(),H=U.height,Z=U.width,$=U.top,ee=U.right,te=U.bottom,K=U.left;if(a==="if-needed"&&_>=0&&A>=0&&b<=y&&f<=h&&_>=$&&b<=te&&A>=K&&f<=ee)return P;var W=getComputedStyle(I),X=parseInt(W.borderLeftWidth,10),j=parseInt(W.borderTopWidth,10),z=parseInt(W.borderRightWidth,10),ie=parseInt(W.borderBottomWidth,10),pe=0,_e=0,Ee="offsetWidth"in I?I.offsetWidth-I.clientWidth-X-z:0,we="offsetHeight"in I?I.offsetHeight-I.clientHeight-j-ie:0;if(r===I)pe=n==="start"?O:n==="end"?O-y:n==="nearest"?N(l,l+y,y,j,ie,l+O,l+O+d,d):O-y/2,_e=s==="start"?C:s==="center"?C-h/2:s==="end"?C-h:N(v,v+h,h,X,z,v+C,v+C+c,c),pe=Math.max(0,pe+l),_e=Math.max(0,_e+v);else{pe=n==="start"?O-$-j:n==="end"?O-te+ie+we:n==="nearest"?N($,te,H,j,ie+we,O,O+d,d):O-($+H/2)+we/2,_e=s==="start"?C-K-X:s==="center"?C-(K+Z/2)+Ee/2:s==="end"?C-ee+z+Ee:N(K,ee,Z,X,z+Ee,C,C+c,c);var fe=I.scrollLeft,le=I.scrollTop;O+=le-(pe=Math.max(0,Math.min(le+pe,I.scrollHeight-H+we))),C+=fe-(_e=Math.max(0,Math.min(fe+_e,I.scrollWidth-Z+Ee)))}P.push({el:I,top:pe,left:_e})}return P};function R(m){return m===Object(m)&&Object.keys(m).length!==0}function D(m,p){p===void 0&&(p="auto");var o="scrollBehavior"in document.body.style;m.forEach(function(a){var n=a.el,s=a.top,i=a.left;n.scroll&&o?n.scroll({top:s,left:i,behavior:p}):(n.scrollTop=s,n.scrollLeft=i)})}function L(m){return m===!1?{block:"end",inline:"nearest"}:R(m)?m:{block:"start",inline:"nearest"}}function x(m,p){var o=!m.ownerDocument.documentElement.contains(m);if(R(p)&&typeof p.behavior=="function")return p.behavior(o?[]:w(m,p));if(o)return;var a=L(p);return D(w(m,a),a.behavior)}var T=Le.a=x},bT9E:function(Be,Le,Y){"use strict";Y.d(Le,"a",function(){return M});var ae=Y("VTBJ");function M(S,N){var w=Object(ae.a)({},S);return Array.isArray(N)&&N.forEach(function(R){delete w[R]}),w}},fAei:function(Be,Le,Y){"use strict";Y.d(Le,"a",function(){return r.a});var ae=Y("rePB"),M=Y("VTBJ"),S=Y("KQm4"),N=Y("1OyB"),w=Y("vuIU"),R=Y("Ji7U"),D=Y("LK+K"),L=Y("cDcd"),x=Y("4IlW"),T=Y("Kwbf"),m=Y("TSYQ"),p=Y.n(m),o=Y("sboe"),a=Y("OZM5"),n=Y("815F"),s=Y("ODXe"),i=Y("Ff2n"),e=Y("+nKL"),t=Y("8XRh"),r=Y("WaYH"),E=function(ee,te){var K=ee.className,W=ee.style,X=ee.motion,j=ee.motionNodes,z=ee.motionType,ie=ee.onMotionStart,pe=ee.onMotionEnd,_e=ee.active,Ee=ee.treeNodeRequiredProps,we=Object(i.a)(ee,["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"]),fe=L.useState(!0),le=Object(s.a)(fe,2),ce=le[0],ge=le[1],Re=L.useContext(o.a),xe=Re.prefixCls,be=L.useRef(!1),Ie=function(){be.current||pe(),be.current=!0};return Object(L.useEffect)(function(){j&&z==="hide"&&ce&&ge(!1)},[j]),Object(L.useEffect)(function(){return j&&ie(),function(){j&&Ie()}},[]),j?L.createElement(t.default,Object.assign({ref:te,visible:ce},X,{motionAppear:z==="show",onAppearEnd:Ie,onLeaveEnd:Ie}),function(ne,oe){var ue=ne.className,me=ne.style;return L.createElement("div",{ref:oe,className:p()("".concat(xe,"-treenode-motion"),ue),style:me},j.map(function(ye){var ve=ye.data,de=ve.key,Oe=Object(i.a)(ve,["key"]),Ae=ye.isStart,re=ye.isEnd;delete Oe.children;var Se=Object(n.f)(de,Ee);return L.createElement(r.a,Object.assign({},Oe,Se,{active:_e,data:ye.data,key:de,isStart:Ae,isEnd:re}))}))}):L.createElement(r.a,Object.assign({domRef:te,className:K,style:W},we,{active:_e}))};E.displayName="MotionTreeNode";var g=L.forwardRef(E),h=g;function y(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],te=$.length,K=ee.length;if(Math.abs(te-K)!==1)return{add:!1,key:null};function W(X,j){var z=new Map;X.forEach(function(pe){z.set(pe,!0)});var ie=j.filter(function(pe){return!z.has(pe)});return ie.length===1?ie[0]:null}return te<K?{add:!0,key:W($,ee)}:{add:!1,key:W(ee,$)}}function v($,ee,te){var K=$.findIndex(function(z){var ie=z.data;return ie.key===te}),W=$[K+1],X=ee.findIndex(function(z){var ie=z.data;return ie.key===te});if(W){var j=ee.findIndex(function(z){var ie=z.data;return ie.key===W.data.key});return ee.slice(X+1,j)}return ee.slice(X+1)}var l={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},u=function(){},d="RC_TREE_MOTION_".concat(Math.random()),c={key:d},_={key:d,level:0,index:0,pos:"0",node:c},f={parent:null,children:[],pos:_.pos,data:c,isStart:[],isEnd:[]};function b($,ee,te,K){return ee===!1||!te?$:$.slice(0,Math.ceil(te/K)+1)}function A($){var ee=$.data.key,te=$.pos;return Object(n.e)(ee,te)}function O($){for(var ee=String($.data.key),te=$;te.parent;)te=te.parent,ee="".concat(te.data.key," > ").concat(ee);return ee}var C=function(ee,te){var K=ee.prefixCls,W=ee.data,X=ee.selectable,j=ee.checkable,z=ee.expandedKeys,ie=ee.selectedKeys,pe=ee.checkedKeys,_e=ee.loadedKeys,Ee=ee.loadingKeys,we=ee.halfCheckedKeys,fe=ee.keyEntities,le=ee.disabled,ce=ee.dragging,ge=ee.dragOverNodeKey,Re=ee.dropPosition,xe=ee.motion,be=ee.height,Ie=ee.itemHeight,ne=ee.virtual,oe=ee.focusable,ue=ee.activeItem,me=ee.focused,ye=ee.tabIndex,ve=ee.onKeyDown,de=ee.onFocus,Oe=ee.onBlur,Ae=ee.onActiveChange,re=ee.onListChangeStart,Se=ee.onListChangeEnd,q=Object(i.a)(ee,["prefixCls","data","selectable","checkable","expandedKeys","selectedKeys","checkedKeys","loadedKeys","loadingKeys","halfCheckedKeys","keyEntities","disabled","dragging","dragOverNodeKey","dropPosition","motion","height","itemHeight","virtual","focusable","activeItem","focused","tabIndex","onKeyDown","onFocus","onBlur","onActiveChange","onListChangeStart","onListChangeEnd"]),Q=L.useRef(null);L.useImperativeHandle(te,function(){return{scrollTo:function(Ge){Q.current.scrollTo(Ge)}}});var J=L.useState(z),F=Object(s.a)(J,2),B=F[0],G=F[1],V=L.useState(W),se=Object(s.a)(V,2),he=se[0],Te=se[1],De=L.useState(W),Pe=Object(s.a)(De,2),Ce=Pe[0],We=Pe[1],He=L.useState([]),Me=Object(s.a)(He,2),qe=Me[0],Ve=Me[1],tt=L.useState(null),Je=Object(s.a)(tt,2),Ke=Je[0],nt=Je[1];function rt(){Te(W),We(W),Ve([]),nt(null),Se()}L.useEffect(function(){G(z);var Fe=y(B,z);if(Fe.key!==null)if(Fe.add){var Ge=he.findIndex(function(Ue){var Qe=Ue.data.key;return Qe===Fe.key}),Ze=b(v(he,W,Fe.key),ne,be,Ie),ot=he.slice();ot.splice(Ge+1,0,f),We(ot),Ve(Ze),nt("show")}else{var mt=W.findIndex(function(Ue){var Qe=Ue.data.key;return Qe===Fe.key}),it=b(v(W,he,Fe.key),ne,be,Ie),ze=W.slice();ze.splice(mt+1,0,f),We(ze),Ve(it),nt("hide")}else he!==W&&(Te(W),We(W))},[z,W]),L.useEffect(function(){ce||rt()},[ce]);var Ne=xe?Ce:W,ke={expandedKeys:z,selectedKeys:ie,loadedKeys:_e,loadingKeys:Ee,checkedKeys:pe,halfCheckedKeys:we,dragOverNodeKey:ge,dropPosition:Re,keyEntities:fe};return L.createElement(L.Fragment,null,me&&ue&&L.createElement("span",{style:l,"aria-live":"assertive"},O(ue)),L.createElement("div",{role:"tree"},L.createElement("input",{style:l,disabled:oe===!1||le,tabIndex:oe!==!1?ye:null,onKeyDown:ve,onFocus:de,onBlur:Oe,value:"",onChange:u})),L.createElement(e.a,Object.assign({},q,{data:Ne,itemKey:A,height:be,fullHeight:!1,virtual:ne,itemHeight:Ie,prefixCls:"".concat(K,"-list"),ref:Q}),function(Fe){var Ge=Fe.pos,Ze=Fe.data,ot=Ze.key,mt=Object(i.a)(Ze,["key"]),it=Fe.isStart,ze=Fe.isEnd,Ue=Object(n.e)(ot,Ge);delete mt.children;var Qe=Object(n.f)(Ue,ke);return L.createElement(h,Object.assign({},mt,Qe,{active:ue&&ot===ue.data.key,pos:Ge,data:Fe.data,isStart:it,isEnd:ze,motion:xe,motionNodes:ot===d?qe:null,motionType:Ke,onMotionStart:re,onMotionEnd:rt,treeNodeRequiredProps:ke,onMouseMove:function(){Ae(null)}}))}))},P=L.forwardRef(C);P.displayName="NodeList";var k=P,I=Y("NvD2"),U=function($){Object(R.a)(te,$);var ee=Object(D.a)(te);function te(){var K;return Object(N.a)(this,te),K=ee.apply(this,arguments),K.destroyed=!1,K.state={keyEntities:{},selectedKeys:[],checkedKeys:[],halfCheckedKeys:[],loadedKeys:[],loadingKeys:[],expandedKeys:[],dragging:!1,dragNodesKeys:[],dragOverNodeKey:null,dropPosition:null,treeData:[],flattenNodes:[],focused:!1,activeKey:null,listChanging:!1,prevProps:null},K.listRef=L.createRef(),K.onNodeDragStart=function(W,X){var j=K.state,z=j.expandedKeys,ie=j.keyEntities,pe=K.props.onDragStart,_e=X.props.eventKey;K.dragNode=X;var Ee=Object(a.b)(z,_e);K.setState({dragging:!0,dragNodesKeys:Object(a.g)(_e,ie)}),K.setExpandedKeys(Ee),pe&&pe({event:W,node:Object(n.b)(X.props)})},K.onNodeDragEnter=function(W,X){var j=K.state,z=j.expandedKeys,ie=j.keyEntities,pe=j.dragNodesKeys,_e=K.props.onDragEnter,Ee=X.props,we=Ee.pos,fe=Ee.eventKey;if(!K.dragNode||pe.indexOf(fe)!==-1)return;var le=Object(a.c)(W,X);if(K.dragNode.props.eventKey===fe&&le===0){K.setState({dragOverNodeKey:"",dropPosition:null});return}setTimeout(function(){K.setState({dragOverNodeKey:fe,dropPosition:le}),K.delayedDragEnterLogic||(K.delayedDragEnterLogic={}),Object.keys(K.delayedDragEnterLogic).forEach(function(ce){clearTimeout(K.delayedDragEnterLogic[ce])}),K.delayedDragEnterLogic[we]=window.setTimeout(function(){if(!K.state.dragging)return;var ce=Object(S.a)(z),ge=ie[fe];ge&&(ge.children||[]).length&&(ce=Object(a.a)(z,fe)),"expandedKeys"in K.props||K.setExpandedKeys(ce),_e&&_e({event:W,node:Object(n.b)(X.props),expandedKeys:ce})},400)},0)},K.onNodeDragOver=function(W,X){var j=K.state.dragNodesKeys,z=K.props.onDragOver,ie=X.props.eventKey;if(j.indexOf(ie)!==-1)return;if(K.dragNode&&ie===K.state.dragOverNodeKey){var pe=Object(a.c)(W,X);if(pe===K.state.dropPosition)return;K.setState({dropPosition:pe})}z&&z({event:W,node:Object(n.b)(X.props)})},K.onNodeDragLeave=function(W,X){var j=K.props.onDragLeave;K.setState({dragOverNodeKey:""}),j&&j({event:W,node:Object(n.b)(X.props)})},K.onNodeDragEnd=function(W,X){var j=K.props.onDragEnd;K.setState({dragOverNodeKey:""}),K.cleanDragState(),j&&j({event:W,node:Object(n.b)(X.props)}),K.dragNode=null},K.onNodeDrop=function(W,X){var j=K.state,z=j.dragNodesKeys,ie=z===void 0?[]:z,pe=j.dropPosition,_e=K.props.onDrop,Ee=X.props,we=Ee.eventKey,fe=Ee.pos;if(K.setState({dragOverNodeKey:""}),K.cleanDragState(),ie.indexOf(we)!==-1){Object(T.a)(!1,"Can not drop to dragNode(include it's children node)");return}var le=Object(a.k)(fe),ce={event:W,node:Object(n.b)(X.props),dragNode:K.dragNode?Object(n.b)(K.dragNode.props):null,dragNodesKeys:ie.slice(),dropPosition:pe+Number(le[le.length-1]),dropToGap:!1};pe!==0&&(ce.dropToGap=!0),_e&&_e(ce),K.dragNode=null},K.cleanDragState=function(){var W=K.state.dragging;W&&K.setState({dragging:!1})},K.onNodeClick=function(W,X){var j=K.props.onClick;j&&j(W,X)},K.onNodeDoubleClick=function(W,X){var j=K.props.onDoubleClick;j&&j(W,X)},K.onNodeSelect=function(W,X){var j=K.state.selectedKeys,z=K.state.keyEntities,ie=K.props,pe=ie.onSelect,_e=ie.multiple,Ee=X.selected,we=X.key,fe=!Ee;fe?_e?j=Object(a.a)(j,we):j=[we]:j=Object(a.b)(j,we);var le=j.map(function(ce){var ge=z[ce];return ge?ge.node:null}).filter(function(ce){return ce});K.setUncontrolledState({selectedKeys:j}),pe&&pe(j,{event:"select",selected:fe,node:X,selectedNodes:le,nativeEvent:W.nativeEvent})},K.onNodeCheck=function(W,X,j){var z=K.state,ie=z.keyEntities,pe=z.checkedKeys,_e=z.halfCheckedKeys,Ee=K.props,we=Ee.checkStrictly,fe=Ee.onCheck,le=X.key,ce,ge={event:"check",node:X,checked:j,nativeEvent:W.nativeEvent};if(we){var Re=j?Object(a.a)(pe,le):Object(a.b)(pe,le),xe=Object(a.b)(_e,le);ce={checked:Re,halfChecked:xe},ge.checkedNodes=Re.map(function(me){return ie[me]}).filter(function(me){return me}).map(function(me){return me.node}),K.setUncontrolledState({checkedKeys:Re})}else{var be=Object(I.a)([].concat(Object(S.a)(pe),[le]),!0,ie),Ie=be.checkedKeys,ne=be.halfCheckedKeys;if(!j){var oe=new Set(Ie);oe.delete(le);var ue=Object(I.a)(Array.from(oe),{checked:!1,halfCheckedKeys:ne},ie);Ie=ue.checkedKeys,ne=ue.halfCheckedKeys}ce=Ie,ge.checkedNodes=[],ge.checkedNodesPositions=[],ge.halfCheckedKeys=ne,Ie.forEach(function(me){var ye=ie[me];if(!ye)return;var ve=ye.node,de=ye.pos;ge.checkedNodes.push(ve),ge.checkedNodesPositions.push({node:ve,pos:de})}),K.setUncontrolledState({checkedKeys:Ie},!1,{halfCheckedKeys:ne})}fe&&fe(ce,ge)},K.onNodeLoad=function(W){return new Promise(function(X){K.setState(function(j){var z=j.loadedKeys,ie=z===void 0?[]:z,pe=j.loadingKeys,_e=pe===void 0?[]:pe,Ee=K.props,we=Ee.loadData,fe=Ee.onLoad,le=W.key;if(!we||ie.indexOf(le)!==-1||_e.indexOf(le)!==-1)return{};var ce=we(W);return ce.then(function(){var ge=K.state,Re=ge.loadedKeys,xe=ge.loadingKeys,be=Object(a.a)(Re,le),Ie=Object(a.b)(xe,le);fe&&fe(be,{event:"load",node:W}),K.setUncontrolledState({loadedKeys:be}),K.setState({loadingKeys:Ie}),X()}),{loadingKeys:Object(a.a)(_e,le)}})})},K.onNodeMouseEnter=function(W,X){var j=K.props.onMouseEnter;j&&j({event:W,node:X})},K.onNodeMouseLeave=function(W,X){var j=K.props.onMouseLeave;j&&j({event:W,node:X})},K.onNodeContextMenu=function(W,X){var j=K.props.onRightClick;j&&(W.preventDefault(),j({event:W,node:X}))},K.onFocus=function(){var W=K.props.onFocus;K.setState({focused:!0}),W&&W.apply(void 0,arguments)},K.onBlur=function(){var W=K.props.onBlur;K.setState({focused:!1}),K.onActiveChange(null),W&&W.apply(void 0,arguments)},K.getTreeNodeRequiredProps=function(){var W=K.state,X=W.expandedKeys,j=W.selectedKeys,z=W.loadedKeys,ie=W.loadingKeys,pe=W.checkedKeys,_e=W.halfCheckedKeys,Ee=W.dragOverNodeKey,we=W.dropPosition,fe=W.keyEntities;return{expandedKeys:X||[],selectedKeys:j||[],loadedKeys:z||[],loadingKeys:ie||[],checkedKeys:pe||[],halfCheckedKeys:_e||[],dragOverNodeKey:Ee,dropPosition:we,keyEntities:fe}},K.setExpandedKeys=function(W){var X=K.state.treeData,j=Object(n.d)(X,W);K.setUncontrolledState({expandedKeys:W,flattenNodes:j},!0)},K.onNodeExpand=function(W,X){var j=K.state.expandedKeys,z=K.state.listChanging,ie=K.props,pe=ie.onExpand,_e=ie.loadData,Ee=X.key,we=X.expanded;if(z)return;var fe=j.indexOf(Ee),le=!we;if(Object(T.a)(we&&fe!==-1||!we&&fe===-1,"Expand state not sync with index check"),le?j=Object(a.a)(j,Ee):j=Object(a.b)(j,Ee),K.setExpandedKeys(j),pe&&pe(j,{node:X,expanded:le,nativeEvent:W.nativeEvent}),le&&_e){var ce=K.onNodeLoad(X);ce&&ce.then(function(){var ge=Object(n.d)(K.state.treeData,j);K.setUncontrolledState({flattenNodes:ge})})}},K.onListChangeStart=function(){K.setUncontrolledState({listChanging:!0})},K.onListChangeEnd=function(){setTimeout(function(){K.setUncontrolledState({listChanging:!1})})},K.onActiveChange=function(W){var X=K.state.activeKey,j=K.props.onActiveChange;if(X===W)return;K.setState({activeKey:W}),W!==null&&K.scrollTo({key:W}),j&&j(W)},K.getActiveItem=function(){var W=K.state,X=W.activeKey,j=W.flattenNodes;return X===null?null:j.find(function(z){var ie=z.data.key;return ie===X})||null},K.offsetActiveKey=function(W){var X=K.state,j=X.flattenNodes,z=X.activeKey,ie=j.findIndex(function(Ee){var we=Ee.data.key;return we===z});ie===-1&&W<0&&(ie=j.length),ie=(ie+W+j.length)%j.length;var pe=j[ie];if(pe){var _e=pe.data.key;K.onActiveChange(_e)}else K.onActiveChange(null)},K.onKeyDown=function(W){var X=K.state,j=X.activeKey,z=X.expandedKeys,ie=X.checkedKeys,pe=K.props,_e=pe.onKeyDown,Ee=pe.checkable,we=pe.selectable;switch(W.which){case x.a.UP:{K.offsetActiveKey(-1),W.preventDefault();break}case x.a.DOWN:{K.offsetActiveKey(1),W.preventDefault();break}}var fe=K.getActiveItem();if(fe&&fe.data){var le=K.getTreeNodeRequiredProps(),ce=fe.data.isLeaf===!1||!!(fe.data.children||[]).length,ge=Object(n.b)(Object(M.a)(Object(M.a)({},Object(n.f)(j,le)),{},{data:fe.data,active:!0}));switch(W.which){case x.a.LEFT:{ce&&z.includes(j)?K.onNodeExpand({},ge):fe.parent&&K.onActiveChange(fe.parent.data.key),W.preventDefault();break}case x.a.RIGHT:{ce&&!z.includes(j)?K.onNodeExpand({},ge):fe.children&&fe.children.length&&K.onActiveChange(fe.children[0].data.key),W.preventDefault();break}case x.a.ENTER:case x.a.SPACE:{Ee&&!ge.disabled&&ge.checkable!==!1&&!ge.disableCheckbox?K.onNodeCheck({},ge,!ie.includes(j)):!Ee&&we&&!ge.disabled&&ge.selectable!==!1&&K.onNodeSelect({},ge);break}}}_e&&_e(W)},K.setUncontrolledState=function(W){var X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,j=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(K.destroyed)return;var z=!1,ie=!0,pe={};Object.keys(W).forEach(function(_e){if(_e in K.props){ie=!1;return}z=!0,pe[_e]=W[_e]}),z&&(!X||ie)&&K.setState(Object(M.a)(Object(M.a)({},pe),j))},K.scrollTo=function(W){K.listRef.current.scrollTo(W)},K}return Object(w.a)(te,[{key:"componentWillUnmount",value:function(){this.destroyed=!0}},{key:"render",value:function(){var W,X=this.state,j=X.focused,z=X.flattenNodes,ie=X.keyEntities,pe=X.dragging,_e=X.activeKey,Ee=this.props,we=Ee.prefixCls,fe=Ee.className,le=Ee.style,ce=Ee.showLine,ge=Ee.focusable,Re=Ee.tabIndex,xe=Re===void 0?0:Re,be=Ee.selectable,Ie=Ee.showIcon,ne=Ee.icon,oe=Ee.switcherIcon,ue=Ee.draggable,me=Ee.checkable,ye=Ee.checkStrictly,ve=Ee.disabled,de=Ee.motion,Oe=Ee.loadData,Ae=Ee.filterTreeNode,re=Ee.height,Se=Ee.itemHeight,q=Ee.virtual,Q=Ee.titleRender,J=Ee.onContextMenu,F=Object(a.f)(this.props);return L.createElement(o.a.Provider,{value:{prefixCls:we,selectable:be,showIcon:Ie,icon:ne,switcherIcon:oe,draggable:ue,checkable:me,checkStrictly:ye,disabled:ve,keyEntities:ie,loadData:Oe,filterTreeNode:Ae,titleRender:Q,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop}},L.createElement("div",{className:p()(we,fe,(W={},Object(ae.a)(W,"".concat(we,"-show-line"),ce),Object(ae.a)(W,"".concat(we,"-focused"),j),Object(ae.a)(W,"".concat(we,"-active-focused"),_e!==null),W))},L.createElement(k,Object.assign({ref:this.listRef,prefixCls:we,style:le,data:z,disabled:ve,selectable:be,checkable:!!me,motion:de,dragging:pe,height:re,itemHeight:Se,virtual:q,focusable:ge,focused:j,tabIndex:xe,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:J},this.getTreeNodeRequiredProps(),F))))}}],[{key:"getDerivedStateFromProps",value:function(W,X){var j=X.prevProps,z={prevProps:W};function ie(ne){return!j&&ne in W||j&&j[ne]!==W[ne]}var pe;if(ie("treeData")?pe=W.treeData:ie("children")&&(Object(T.a)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),pe=Object(n.c)(W.children)),pe){z.treeData=pe;var _e=Object(n.a)(pe);z.keyEntities=Object(M.a)(Object(ae.a)({},d,_),_e.keyEntities)}var Ee=z.keyEntities||X.keyEntities;if(ie("expandedKeys")||j&&ie("autoExpandParent"))z.expandedKeys=W.autoExpandParent||!j&&W.defaultExpandParent?Object(a.e)(W.expandedKeys,Ee):W.expandedKeys;else if(!j&&W.defaultExpandAll){var we=Object(M.a)({},Ee);delete we[d],z.expandedKeys=Object.keys(we).map(function(ne){return we[ne].key})}else!j&&W.defaultExpandedKeys&&(z.expandedKeys=W.autoExpandParent||W.defaultExpandParent?Object(a.e)(W.defaultExpandedKeys,Ee):W.defaultExpandedKeys);if(z.expandedKeys||delete z.expandedKeys,pe||z.expandedKeys){var fe=Object(n.d)(pe||X.treeData,z.expandedKeys||X.expandedKeys);z.flattenNodes=fe}if(W.selectable&&(ie("selectedKeys")?z.selectedKeys=Object(a.d)(W.selectedKeys,W):!j&&W.defaultSelectedKeys&&(z.selectedKeys=Object(a.d)(W.defaultSelectedKeys,W))),W.checkable){var le;if(ie("checkedKeys")?le=Object(a.j)(W.checkedKeys)||{}:!j&&W.defaultCheckedKeys?le=Object(a.j)(W.defaultCheckedKeys)||{}:pe&&(le=Object(a.j)(W.checkedKeys)||{checkedKeys:X.checkedKeys,halfCheckedKeys:X.halfCheckedKeys}),le){var ce=le,ge=ce.checkedKeys,Re=ge===void 0?[]:ge,xe=ce.halfCheckedKeys,be=xe===void 0?[]:xe;if(!W.checkStrictly){var Ie=Object(I.a)(Re,!0,Ee);Re=Ie.checkedKeys,be=Ie.halfCheckedKeys}z.checkedKeys=Re,z.halfCheckedKeys=be}}return ie("loadedKeys")&&(z.loadedKeys=W.loadedKeys),z}}]),te}(L.Component);U.defaultProps={prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[]},U.TreeNode=r.a;var H=U,Z=Le.b=H},p5ED:function(Be,Le,Y){"use strict";var ae=Y("+L6B"),M=Y("2/Rp"),S=Y("5Dmo"),N=Y("3S7+"),w=Y("k1fw"),R=Y("tJVT"),D=Y("cDcd"),L=Y.n(D),x=Y("vHTk"),T=Y.n(x),m=Y("yEEn"),p=Y("ZW9T"),o=Y("1vsH");Le.a=function(a){var n=a.name,s=a.data,i=a.theme,e=a.type,t=a.filename,r=a.monacoEditor,E=a.className,g=a.style,h=a.close,y=a.onClose,v=a.hasMask,l=Object(D.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),u=Object(R.a)(l,2),d=u[0],c=u[1],_=Object(D.useState)(""),f=Object(R.a)(_,2),b=f[0],A=f[1],O,C=1024*1024,P=10*C,k=Object(D.useRef)();e==="office"&&(O=Object(o.V)(s).filesize,O>P&&(e="other")),t&&(r.filename=t),Object(D.useEffect)(function(){var H,Z,$=(H=document.cookie)===null||H===void 0||((Z=H.replace(/\s/g,""))===null||Z===void 0)?void 0:Z.split(";");$==null||$.map(function(ee){var te=ee.split("=");te[0]==="_educoder_session"&&A(te[1])})},[]);var I=function(){if(s.startsWith("http")||s.startsWith("/")){U();return}Object(o.z)(t||"educoder",s,t)},U=function(){Object(o.x)(t||n,s)};return console.log("data:",s,"fileanme:",t," name:",n),L.a.createElement("div",{style:Object(w.a)({},g||{}),className:"".concat(v&&T.a.bgBlack," ").concat(e?T.a.wrp:"hide")},h&&L.a.createElement("div",{className:T.a.close,ref:k},L.a.createElement(N.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return k.current}},L.a.createElement("span",{onClick:U},L.a.createElement("i",{className:"icon-quxiaozhiding"}))),L.a.createElement(N.a,{title:"\u5173\u95ED",getPopupContainer:function(){return k.current}},L.a.createElement("span",{className:"",onClick:y},L.a.createElement("i",{className:"icon-guanbi1"})))),L.a.createElement("div",{className:"".concat(T.a[E]," ").concat(E," ").concat(T.a.monaco," ").concat(e==="txt"?"show":"hide")},e==="txt"&&L.a.createElement(p.b,r)),e==="audio"&&L.a.createElement("audio",{src:"".concat(s!=null&&s.startsWith("/")||(s==null?void 0:s.indexOf("https://"))>-1?s:"data:audio/mp3;base64,").concat(s),autoPlay:!0}),e==="video"&&L.a.createElement(L.a.Fragment,null,s!=null&&s.startsWith("/")?L.a.createElement("video",{controls:!0,src:"".concat(s),autoPlay:!0}):L.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(s),autoPlay:!0})),e==="html"&&L.a.createElement("iframe",{src:s+"&disposition=inline"}),e==="pdf"&&L.a.createElement("embed",{className:T.a.embed,src:s}),e==="image"&&L.a.createElement(L.a.Fragment,null,L.a.createElement("img",{src:"".concat(s!=null&&s.startsWith("/")||(s==null?void 0:s.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(s)})),e==="other"&&L.a.createElement("div",null,L.a.createElement(M.a,{type:"primary",size:"large",onClick:I},L.a.createElement(m.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),(e==="download"||e==="office")&&L.a.createElement(M.a,{type:"primary",size:"large",onClick:I},L.a.createElement(m.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},psGv:function(Be,Le,Y){var ae,M;(function(){var S;(function(){"use strict";var D=[,,function(m){function p(n){this.__parent=n,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 n=new p(this.__parent);return n.set_indent(this.__indent_count,this.__alignment_count),n},p.prototype.item=function(n){return n<0?this.__items[this.__items.length+n]:this.__items[n]},p.prototype.has_match=function(n){for(var s=this.__items.length-1;s>=0;s--)if(this.__items[s].match(n))return!0;return!1},p.prototype.set_indent=function(n,s){this.is_empty()&&(this.__indent_count=n||0,this.__alignment_count=s||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 n=this.__parent.current_line;return n.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),n.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),n.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,n.__items[0]===" "&&(n.__items.splice(0,1),n.__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(n){this.__items.push(n);var s=n.lastIndexOf(`
|
|
`);s!==-1?this.__character_count=n.length-s:this.__character_count+=n.length},p.prototype.pop=function(){var n=null;return this.is_empty()||(n=this.__items.pop(),this.__character_count-=n.length),n},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 n="";return this.is_empty()?this.__parent.indent_empty_lines&&(n=this.__parent.get_indent_string(this.__indent_count)):(n=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),n+=this.__items.join("")),n};function o(n,s){this.__cache=[""],this.__indent_size=n.indent_size,this.__indent_string=n.indent_char,n.indent_with_tabs||(this.__indent_string=new Array(n.indent_size+1).join(n.indent_char)),s=s||"",n.indent_level>0&&(s=new Array(n.indent_level+1).join(this.__indent_string)),this.__base_string=s,this.__base_string_length=s.length}o.prototype.get_indent_size=function(n,s){var i=this.__base_string_length;return s=s||0,n<0&&(i=0),i+=n*this.__indent_size,i+=s,i},o.prototype.get_indent_string=function(n,s){var i=this.__base_string;return s=s||0,n<0&&(n=0,i=""),s+=n*this.__indent_size,this.__ensure_cache(s),i+=this.__cache[s],i},o.prototype.__ensure_cache=function(n){for(;n>=this.__cache.length;)this.__add_column()},o.prototype.__add_column=function(){var n=this.__cache.length,s=0,i="";this.__indent_size&&n>=this.__indent_size&&(s=Math.floor(n/this.__indent_size),n-=s*this.__indent_size,i=new Array(s+1).join(this.__indent_string)),n&&(i+=new Array(n+1).join(" ")),this.__cache.push(i)};function a(n,s){this.__indent_cache=new o(n,s),this.raw=!1,this._end_with_newline=n.end_with_newline,this.indent_size=n.indent_size,this.wrap_line_length=n.wrap_line_length,this.indent_empty_lines=n.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()}a.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},a.prototype.get_line_number=function(){return this.__lines.length},a.prototype.get_indent_string=function(n,s){return this.__indent_cache.get_indent_string(n,s)},a.prototype.get_indent_size=function(n,s){return this.__indent_cache.get_indent_size(n,s)},a.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},a.prototype.add_new_line=function(n){return this.is_empty()||!n&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},a.prototype.get_code=function(n){this.trim(!0);var s=this.current_line.pop();s&&(s[s.length-1]===`
|
|
`&&(s=s.replace(/\n+$/g,"")),this.current_line.push(s)),this._end_with_newline&&this.__add_outputline();var i=this.__lines.join(`
|
|
`);return n!==`
|
|
`&&(i=i.replace(/[\n]/g,n)),i},a.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},a.prototype.set_indent=function(n,s){return n=n||0,s=s||0,this.next_line.set_indent(n,s),this.__lines.length>1?(this.current_line.set_indent(n,s),!0):(this.current_line.set_indent(),!1)},a.prototype.add_raw_token=function(n){for(var s=0;s<n.newlines;s++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(n.whitespace_before),this.current_line.push(n.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},a.prototype.add_token=function(n){this.__add_space_before_token(),this.current_line.push(n),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},a.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},a.prototype.remove_indent=function(n){for(var s=this.__lines.length;n<s;)this.__lines[n]._remove_indent(),n++;this.current_line._remove_wrap_indent()},a.prototype.trim=function(n){for(n=n===void 0?!1:n,this.current_line.trim();n&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},a.prototype.just_added_newline=function(){return this.current_line.is_empty()},a.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},a.prototype.ensure_empty_line_above=function(n,s){for(var i=this.__lines.length-2;i>=0;){var e=this.__lines[i];if(e.is_empty())break;if(e.item(0).indexOf(n)!==0&&e.item(-1)!==s){this.__lines.splice(i+1,0,new p(this)),this.previous_line=this.__lines[this.__lines.length-2];break}i--}},m.exports.Output=a},function(m){function p(o,a,n,s){this.type=o,this.text=a,this.comments_before=null,this.newlines=n||0,this.whitespace_before=s||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}m.exports.Token=p},,,function(m){function p(n,s){this.raw_options=o(n,s),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(n,s){var i=this.raw_options[n],e=s||[];return typeof i=="object"?i!==null&&typeof i.concat=="function"&&(e=i.concat()):typeof i=="string"&&(e=i.split(/[^a-zA-Z0-9_\/\-]+/)),e},p.prototype._get_boolean=function(n,s){var i=this.raw_options[n],e=i===void 0?!!s:!!i;return e},p.prototype._get_characters=function(n,s){var i=this.raw_options[n],e=s||"";return typeof i=="string"&&(e=i.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),e},p.prototype._get_number=function(n,s){var i=this.raw_options[n];s=parseInt(s,10),isNaN(s)&&(s=0);var e=parseInt(i,10);return isNaN(e)&&(e=s),e},p.prototype._get_selection=function(n,s,i){var e=this._get_selection_list(n,s,i);if(e.length!==1)throw new Error("Invalid Option Value: The option '"+n+`' can only be one of the following values:
|
|
`+s+`
|
|
You passed in: '`+this.raw_options[n]+"'");return e[0]},p.prototype._get_selection_list=function(n,s,i){if(!s||s.length===0)throw new Error("Selection list cannot be empty.");if(i=i||[s[0]],!this._is_valid_selection(i,s))throw new Error("Invalid Default Value!");var e=this._get_array(n,i);if(!this._is_valid_selection(e,s))throw new Error("Invalid Option Value: The option '"+n+`' can contain only the following values:
|
|
`+s+`
|
|
You passed in: '`+this.raw_options[n]+"'");return e},p.prototype._is_valid_selection=function(n,s){return n.length&&s.length&&!n.some(function(i){return s.indexOf(i)===-1})};function o(n,s){var i={};n=a(n);var e;for(e in n)e!==s&&(i[e]=n[e]);if(s&&n[s])for(e in n[s])i[e]=n[s][e];return i}function a(n){var s={},i;for(i in n){var e=i.replace(/-/g,"_");s[e]=n[i]}return s}m.exports.Options=p,m.exports.normalizeOpts=a,m.exports.mergeOpts=o},,function(m){var p=RegExp.prototype.hasOwnProperty("sticky");function o(a){this.__input=a||"",this.__input_length=this.__input.length,this.__position=0}o.prototype.restart=function(){this.__position=0},o.prototype.back=function(){this.__position>0&&(this.__position-=1)},o.prototype.hasNext=function(){return this.__position<this.__input_length},o.prototype.next=function(){var a=null;return this.hasNext()&&(a=this.__input.charAt(this.__position),this.__position+=1),a},o.prototype.peek=function(a){var n=null;return a=a||0,a+=this.__position,a>=0&&a<this.__input_length&&(n=this.__input.charAt(a)),n},o.prototype.__match=function(a,n){a.lastIndex=n;var s=a.exec(this.__input);return s&&!(p&&a.sticky)&&(s.index!==n&&(s=null)),s},o.prototype.test=function(a,n){return n=n||0,n+=this.__position,n>=0&&n<this.__input_length?!!this.__match(a,n):!1},o.prototype.testChar=function(a,n){var s=this.peek(n);return a.lastIndex=0,s!==null&&a.test(s)},o.prototype.match=function(a){var n=this.__match(a,this.__position);return n?this.__position+=n[0].length:n=null,n},o.prototype.read=function(a,n,s){var i="",e;return a&&(e=this.match(a),e&&(i+=e[0])),n&&(e||!a)&&(i+=this.readUntil(n,s)),i},o.prototype.readUntil=function(a,n){var s="",i=this.__position;a.lastIndex=this.__position;var e=a.exec(this.__input);return e?(i=e.index,n&&(i+=e[0].length)):i=this.__input_length,s=this.__input.substring(this.__position,i),this.__position=i,s},o.prototype.readUntilAfter=function(a){return this.readUntil(a,!0)},o.prototype.get_regexp=function(a,n){var s=null,i="g";return n&&p&&(i="y"),typeof a=="string"&&a!==""?s=new RegExp(a,i):a&&(s=new RegExp(a.source,i)),s},o.prototype.get_literal_regexp=function(a){return RegExp(a.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},o.prototype.peekUntilAfter=function(a){var n=this.__position,s=this.readUntilAfter(a);return this.__position=n,s},o.prototype.lookBack=function(a){var n=this.__position-1;return n>=a.length&&this.__input.substring(n-a.length,n).toLowerCase()===a},m.exports.InputScanner=o},function(m,p,o){var a=o(8).InputScanner,n=o(3).Token,s=o(10).TokenStream,i=o(11).WhitespacePattern,e={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},t=function(r,E){this._input=new a(r),this._options=E||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new i(this._input)};t.prototype.tokenize=function(){this._input.restart(),this.__tokens=new s,this._reset();for(var r,E=new n(e.START,""),g=null,h=[],y=new s;E.type!==e.EOF;){for(r=this._get_next_token(E,g);this._is_comment(r);)y.add(r),r=this._get_next_token(E,g);y.isEmpty()||(r.comments_before=y,y=new s),r.parent=g,this._is_opening(r)?(h.push(g),g=r):g&&this._is_closing(r,g)&&(r.opened=g,g.closed=r,g=h.pop(),r.parent=g),r.previous=E,E.next=r,this.__tokens.add(r),E=r}return this.__tokens},t.prototype._is_first_token=function(){return this.__tokens.isEmpty()},t.prototype._reset=function(){},t.prototype._get_next_token=function(r,E){this._readWhitespace();var g=this._input.read(/.+/g);return g?this._create_token(e.RAW,g):this._create_token(e.EOF,"")},t.prototype._is_comment=function(r){return!1},t.prototype._is_opening=function(r){return!1},t.prototype._is_closing=function(r,E){return!1},t.prototype._create_token=function(r,E){var g=new n(r,E,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return g},t.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},m.exports.Tokenizer=t,m.exports.TOKEN=e},function(m){function p(o){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=o}p.prototype.restart=function(){this.__position=0},p.prototype.isEmpty=function(){return this.__tokens_length===0},p.prototype.hasNext=function(){return this.__position<this.__tokens_length},p.prototype.next=function(){var o=null;return this.hasNext()&&(o=this.__tokens[this.__position],this.__position+=1),o},p.prototype.peek=function(o){var a=null;return o=o||0,o+=this.__position,o>=0&&o<this.__tokens_length&&(a=this.__tokens[o]),a},p.prototype.add=function(o){this.__parent_token&&(o.parent=this.__parent_token),this.__tokens.push(o),this.__tokens_length+=1},m.exports.TokenStream=p},function(m,p,o){var a=o(12).Pattern;function n(s,i){a.call(this,s,i),i?this._line_regexp=this._input.get_regexp(i._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}n.prototype=new a,n.prototype.__set_whitespace_patterns=function(s,i){s+="\\t ",i+="\\n\\r",this._match_pattern=this._input.get_regexp("["+s+i+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+i+"]")},n.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var s=this._input.read(this._match_pattern);if(s===" ")this.whitespace_before_token=" ";else if(s){var i=this.__split(this._newline_regexp,s);this.newline_count=i.length-1,this.whitespace_before_token=i[this.newline_count]}return s},n.prototype.matching=function(s,i){var e=this._create();return e.__set_whitespace_patterns(s,i),e._update(),e},n.prototype._create=function(){return new n(this._input,this)},n.prototype.__split=function(s,i){s.lastIndex=0;for(var e=0,t=[],r=s.exec(i);r;)t.push(i.substring(e,r.index)),e=r.index+r[0].length,r=s.exec(i);return e<i.length?t.push(i.substring(e,i.length)):t.push(""),t},m.exports.WhitespacePattern=n},function(m){function p(o,a){this._input=o,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,a&&(this._starting_pattern=this._input.get_regexp(a._starting_pattern,!0),this._match_pattern=this._input.get_regexp(a._match_pattern,!0),this._until_pattern=this._input.get_regexp(a._until_pattern),this._until_after=a._until_after)}p.prototype.read=function(){var o=this._input.read(this._starting_pattern);return(!this._starting_pattern||o)&&(o+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),o},p.prototype.read_match=function(){return this._input.match(this._match_pattern)},p.prototype.until_after=function(o){var a=this._create();return a._until_after=!0,a._until_pattern=this._input.get_regexp(o),a._update(),a},p.prototype.until=function(o){var a=this._create();return a._until_after=!1,a._until_pattern=this._input.get_regexp(o),a._update(),a},p.prototype.starting_with=function(o){var a=this._create();return a._starting_pattern=this._input.get_regexp(o,!0),a._update(),a},p.prototype.matching=function(o){var a=this._create();return a._match_pattern=this._input.get_regexp(o,!0),a._update(),a},p.prototype._create=function(){return new p(this._input,this)},p.prototype._update=function(){},m.exports.Pattern=p},function(m){function p(o,a){o=typeof o=="string"?o:o.source,a=typeof a=="string"?a:a.source,this.__directives_block_pattern=new RegExp(o+/ beautify( \w+[:]\w+)+ /.source+a,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(o+/\sbeautify\signore:end\s/.source+a,"g")}p.prototype.get_directives=function(o){if(!o.match(this.__directives_block_pattern))return null;var a={};this.__directive_pattern.lastIndex=0;for(var n=this.__directive_pattern.exec(o);n;)a[n[1]]=n[2],n=this.__directive_pattern.exec(o);return a},p.prototype.readIgnored=function(o){return o.readUntilAfter(this.__directives_end_ignore_pattern)},m.exports.Directives=p},function(m,p,o){var a=o(12).Pattern,n={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function s(i,e){a.call(this,i,e),this.__template_pattern=null,this._disabled=Object.assign({},n),this._excluded=Object.assign({},n),e&&(this.__template_pattern=this._input.get_regexp(e.__template_pattern),this._excluded=Object.assign(this._excluded,e._excluded),this._disabled=Object.assign(this._disabled,e._disabled));var t=new a(i);this.__patterns={handlebars_comment:t.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:t.starting_with(/{{{/).until_after(/}}}/),handlebars:t.starting_with(/{{/).until_after(/}}/),php:t.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:t.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:t.starting_with(/{%/).until_after(/%}/),django_value:t.starting_with(/{{/).until_after(/}}/),django_comment:t.starting_with(/{#/).until_after(/#}/),smarty:t.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:t.starting_with(/{\*/).until_after(/\*}/),smarty_literal:t.starting_with(/{literal}/).until_after(/{\/literal}/)}}s.prototype=new a,s.prototype._create=function(){return new s(this._input,this)},s.prototype._update=function(){this.__set_templated_pattern()},s.prototype.disable=function(i){var e=this._create();return e._disabled[i]=!0,e._update(),e},s.prototype.read_options=function(i){var e=this._create();for(var t in n)e._disabled[t]=i.templating.indexOf(t)===-1;return e._update(),e},s.prototype.exclude=function(i){var e=this._create();return e._excluded[i]=!0,e._update(),e},s.prototype.read=function(){var i="";this._match_pattern?i=this._input.read(this._starting_pattern):i=this._input.read(this._starting_pattern,this.__template_pattern);for(var e=this._read_template();e;)this._match_pattern?e+=this._input.read(this._match_pattern):e+=this._input.readUntil(this.__template_pattern),i+=e,e=this._read_template();return this._until_after&&(i+=this._input.readUntilAfter(this._until_pattern)),i},s.prototype.__set_templated_pattern=function(){var i=[];this._disabled.php||i.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||i.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||i.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(i.push(this.__patterns.django._starting_pattern.source),i.push(this.__patterns.django_value._starting_pattern.source),i.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||i.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&i.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+i.join("|")+")")},s.prototype._read_template=function(){var i="",e=this._input.peek();if(e==="<"){var t=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&t==="?"&&(i=i||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&t==="%"&&(i=i||this.__patterns.erb.read())}else e==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(i=i||this.__patterns.handlebars_comment.read(),i=i||this.__patterns.handlebars_unescaped.read(),i=i||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(i=i||this.__patterns.django_value.read()),this._excluded.django||(i=i||this.__patterns.django_comment.read(),i=i||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(i=i||this.__patterns.smarty_comment.read(),i=i||this.__patterns.smarty_literal.read(),i=i||this.__patterns.smarty.read()));return i},m.exports.TemplatablePattern=s},,,,function(m,p,o){var a=o(19).Beautifier,n=o(20).Options;function s(i,e,t,r){var E=new a(i,e,t,r);return E.beautify()}m.exports=s,m.exports.defaultOptions=function(){return new n}},function(m,p,o){var a=o(20).Options,n=o(2).Output,s=o(21).Tokenizer,i=o(21).TOKEN,e=/\r\n|[\r\n]/,t=/\r\n|[\r\n]/g,r=function(_,f){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=_.max_preserve_newlines,this.preserve_newlines=_.preserve_newlines,this._output=new n(_,f)};r.prototype.current_line_has_match=function(_){return this._output.current_line.has_match(_)},r.prototype.set_space_before_token=function(_,f){this._output.space_before_token=_,this._output.non_breaking_space=f},r.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},r.prototype.add_raw_token=function(_){this._output.add_raw_token(_)},r.prototype.print_preserved_newlines=function(_){var f=0;_.type!==i.TEXT&&_.previous.type!==i.TEXT&&(f=_.newlines?1:0),this.preserve_newlines&&(f=_.newlines<this.max_preserve_newlines+1?_.newlines:this.max_preserve_newlines+1);for(var b=0;b<f;b++)this.print_newline(b>0);return f!==0},r.prototype.traverse_whitespace=function(_){return _.whitespace_before||_.newlines?(this.print_preserved_newlines(_)||(this._output.space_before_token=!0),!0):!1},r.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},r.prototype.print_newline=function(_){this._output.add_new_line(_)},r.prototype.print_token=function(_){_.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(_.text))},r.prototype.indent=function(){this.indent_level++},r.prototype.get_full_indent=function(_){return _=this.indent_level+(_||0),_<1?"":this._output.get_indent_string(_)};var E=function(_){for(var f=null,b=_.next;b.type!==i.EOF&&_.closed!==b;){if(b.type===i.ATTRIBUTE&&b.text==="type"){b.next&&b.next.type===i.EQUALS&&b.next.next&&b.next.next.type===i.VALUE&&(f=b.next.next.text);break}b=b.next}return f},g=function(_,f){var b=null,A=null;return f.closed?(_==="script"?b="text/javascript":_==="style"&&(b="text/css"),b=E(f)||b,b.search("text/css")>-1?A="css":b.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?A="javascript":b.search(/(text|application|dojo)\/(x-)?(html)/)>-1?A="html":b.search(/test\/null/)>-1&&(A="null"),A):null};function h(_,f){return f.indexOf(_)!==-1}function y(_,f,b){this.parent=_||null,this.tag=f?f.tag_name:"",this.indent_level=b||0,this.parser_token=f||null}function v(_){this._printer=_,this._current_frame=null}v.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},v.prototype.record_tag=function(_){var f=new y(this._current_frame,_,this._printer.indent_level);this._current_frame=f},v.prototype._try_pop_frame=function(_){var f=null;return _&&(f=_.parser_token,this._printer.indent_level=_.indent_level,this._current_frame=_.parent),f},v.prototype._get_frame=function(_,f){for(var b=this._current_frame;b&&!(_.indexOf(b.tag)!==-1);){if(f&&f.indexOf(b.tag)!==-1){b=null;break}b=b.parent}return b},v.prototype.try_pop=function(_,f){var b=this._get_frame([_],f);return this._try_pop_frame(b)},v.prototype.indent_to_tag=function(_){var f=this._get_frame(_);f&&(this._printer.indent_level=f.indent_level)};function l(_,f,b,A){this._source_text=_||"",f=f||{},this._js_beautify=b,this._css_beautify=A,this._tag_stack=null;var O=new a(f,"html");this._options=O,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"}l.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var _=this._source_text,f=this._options.eol;this._options.eol==="auto"&&(f=`
|
|
`,_&&e.test(_)&&(f=_.match(e)[0])),_=_.replace(t,`
|
|
`);var b=_.match(/^[\t ]*/)[0],A={text:"",type:""},O=new u,C=new r(this._options,b),P=new s(_,this._options).tokenize();this._tag_stack=new v(C);for(var k=null,I=P.next();I.type!==i.EOF;)I.type===i.TAG_OPEN||I.type===i.COMMENT?(k=this._handle_tag_open(C,I,O,A),O=k):I.type===i.ATTRIBUTE||I.type===i.EQUALS||I.type===i.VALUE||I.type===i.TEXT&&!O.tag_complete?k=this._handle_inside_tag(C,I,O,P):I.type===i.TAG_CLOSE?k=this._handle_tag_close(C,I,O):I.type===i.TEXT?k=this._handle_text(C,I,O):C.add_raw_token(I),A=k,I=P.next();var U=C._output.get_code(f);return U},l.prototype._handle_tag_close=function(_,f,b){var A={text:f.text,type:f.type};return _.alignment_size=0,b.tag_complete=!0,_.set_space_before_token(f.newlines||f.whitespace_before!=="",!0),b.is_unformatted?_.add_raw_token(f):(b.tag_start_char==="<"&&(_.set_space_before_token(f.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&b.has_wrapped_attrs&&_.print_newline(!1)),_.print_token(f)),b.indent_content&&!(b.is_unformatted||b.is_content_unformatted)&&(_.indent(),b.indent_content=!1),!b.is_inline_element&&!(b.is_unformatted||b.is_content_unformatted)&&_.set_wrap_point(),A},l.prototype._handle_inside_tag=function(_,f,b,A){var O=b.has_wrapped_attrs,C={text:f.text,type:f.type};if(_.set_space_before_token(f.newlines||f.whitespace_before!=="",!0),b.is_unformatted)_.add_raw_token(f);else if(b.tag_start_char==="{"&&f.type===i.TEXT)_.print_preserved_newlines(f)?(f.newlines=0,_.add_raw_token(f)):_.print_token(f);else{if(f.type===i.ATTRIBUTE?(_.set_space_before_token(!0),b.attr_count+=1):(f.type===i.EQUALS||f.type===i.VALUE&&f.previous.type===i.EQUALS)&&_.set_space_before_token(!1),f.type===i.ATTRIBUTE&&b.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(_.traverse_whitespace(f),O=O||f.newlines!==0),this._is_wrap_attributes_force)){var P=b.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&b.attr_count===1){var k=!0,I=0,U;do{if(U=A.peek(I),U.type===i.ATTRIBUTE){k=!1;break}I+=1}while(I<4&&U.type!==i.EOF&&U.type!==i.TAG_CLOSE);P=!k}P&&(_.print_newline(!1),O=!0)}_.print_token(f),O=O||_.previous_token_wrapped(),b.has_wrapped_attrs=O}return C},l.prototype._handle_text=function(_,f,b){var A={text:f.text,type:"TK_CONTENT"};return b.custom_beautifier_name?this._print_custom_beatifier_text(_,f,b):b.is_unformatted||b.is_content_unformatted?_.add_raw_token(f):(_.traverse_whitespace(f),_.print_token(f)),A},l.prototype._print_custom_beatifier_text=function(_,f,b){var A=this;if(f.text!==""){var O=f.text,C,P=1,k="",I="";b.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?C=this._js_beautify:b.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?C=this._css_beautify:b.custom_beautifier_name==="html"&&(C=function(te,K){var W=new l(te,K,A._js_beautify,A._css_beautify);return W.beautify()}),this._options.indent_scripts==="keep"?P=0:this._options.indent_scripts==="separate"&&(P=-_.indent_level);var U=_.get_full_indent(P);if(O=O.replace(/\n[ \t]*$/,""),b.custom_beautifier_name!=="html"&&O[0]==="<"&&O.match(/^(<!--|<!\[CDATA\[)/)){var H=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(O);if(!H){_.add_raw_token(f);return}k=U+H[1]+`
|
|
`,O=H[4],H[5]&&(I=U+H[5]),O=O.replace(/\n[ \t]*$/,""),(H[2]||H[3].indexOf(`
|
|
`)!==-1)&&(H=H[3].match(/[ \t]+$/),H&&(f.whitespace_before=H[0]))}if(O)if(C){var Z=function(){this.eol=`
|
|
`};Z.prototype=this._options.raw_options;var $=new Z;O=C(U+O,$)}else{var ee=f.whitespace_before;ee&&(O=O.replace(new RegExp(`
|
|
(`+ee+")?","g"),`
|
|
`)),O=U+O.replace(/\n/g,`
|
|
`+U)}k&&(O?O=k+O+`
|
|
`+I:O=k+I),_.print_newline(!1),O&&(f.text=O,f.whitespace_before="",f.newlines=0,_.add_raw_token(f),_.print_newline(!0))}},l.prototype._handle_tag_open=function(_,f,b,A){var O=this._get_tag_open_token(f);return(b.is_unformatted||b.is_content_unformatted)&&!b.is_empty_element&&f.type===i.TAG_OPEN&&f.text.indexOf("</")===0?(_.add_raw_token(f),O.start_tag_token=this._tag_stack.try_pop(O.tag_name)):(_.traverse_whitespace(f),this._set_tag_position(_,f,O,b,A),O.is_inline_element||_.set_wrap_point(),_.print_token(f)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(O.alignment_size=f.text.length+1),!O.tag_complete&&!O.is_unformatted&&(_.alignment_size=O.alignment_size),O};var u=function(_,f){if(this.parent=_||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",!f)this.tag_complete=!0;else{var b;this.tag_start_char=f.text[0],this.text=f.text,this.tag_start_char==="<"?(b=f.text.match(/^<([^\s>]*)/),this.tag_check=b?b[1]:""):(b=f.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=b?b[1]:"",(f.text.startsWith("{{#>")||f.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&f.next!==null?this.tag_check=f.next.text.split(" ")[0]:this.tag_check=f.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),f.type===i.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||f.closed&&f.closed.text==="/>";var A=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(A=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(A)))}};l.prototype._get_tag_open_token=function(_){var f=new u(this._tag_stack.get_parser_token(),_);return f.alignment_size=this._options.wrap_attributes_indent_size,f.is_end_tag=f.is_end_tag||h(f.tag_check,this._options.void_elements),f.is_empty_element=f.tag_complete||f.is_start_tag&&f.is_end_tag,f.is_unformatted=!f.tag_complete&&h(f.tag_check,this._options.unformatted),f.is_content_unformatted=!f.is_empty_element&&h(f.tag_check,this._options.content_unformatted),f.is_inline_element=h(f.tag_name,this._options.inline)||f.tag_name.includes("-")||f.tag_start_char==="{",f},l.prototype._set_tag_position=function(_,f,b,A,O){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||_.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=g(b.tag_check,f)))),h(b.tag_check,this._options.extra_liners)&&(_.print_newline(!1),_._output.just_added_blankline()||_.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 C=_.current_line_has_match(/{{#if/);C||_.print_newline(!1)}b.tag_name==="!--"&&O.type===i.TAG_CLOSE&&A.is_end_tag&&b.text.indexOf(`
|
|
`)===-1||(b.is_inline_element||b.is_unformatted||_.print_newline(!1),this._calcluate_parent_multiline(_,b))}else if(b.is_end_tag){var P=!1;P=b.start_tag_token&&b.start_tag_token.multiline_content,P=P||!b.is_inline_element&&!(A.is_inline_element||A.is_unformatted)&&!(O.type===i.TAG_CLOSE&&b.start_tag_token===A)&&O.type!=="TK_CONTENT",(b.is_content_unformatted||b.is_unformatted)&&(P=!1),P&&_.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)&&(O.type!=="TK_CONTENT"||b.is_content_unformatted)&&_.print_newline(!1),this._calcluate_parent_multiline(_,b)},l.prototype._calcluate_parent_multiline=function(_,f){f.parent&&_._output.just_added_newline()&&!((f.is_inline_element||f.is_unformatted)&&f.parent.is_inline_element)&&(f.parent.multiline_content=!0)};var d=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","nav","ol","p","pre","section","table","ul"],c=["a","audio","del","ins","map","noscript","video"];l.prototype._do_optional_end_element=function(_){var f=null;if(_.is_empty_element||!_.is_start_tag||!_.parent)return;if(_.tag_name==="body")f=f||this._tag_stack.try_pop("head");else if(_.tag_name==="li")f=f||this._tag_stack.try_pop("li",["ol","ul"]);else if(_.tag_name==="dd"||_.tag_name==="dt")f=f||this._tag_stack.try_pop("dt",["dl"]),f=f||this._tag_stack.try_pop("dd",["dl"]);else if(_.parent.tag_name==="p"&&d.indexOf(_.tag_name)!==-1){var b=_.parent.parent;(!b||c.indexOf(b.tag_name)===-1)&&(f=f||this._tag_stack.try_pop("p"))}else _.tag_name==="rp"||_.tag_name==="rt"?(f=f||this._tag_stack.try_pop("rt",["ruby","rtc"]),f=f||this._tag_stack.try_pop("rp",["ruby","rtc"])):_.tag_name==="optgroup"?f=f||this._tag_stack.try_pop("optgroup",["select"]):_.tag_name==="option"?f=f||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):_.tag_name==="colgroup"?f=f||this._tag_stack.try_pop("caption",["table"]):_.tag_name==="thead"?(f=f||this._tag_stack.try_pop("caption",["table"]),f=f||this._tag_stack.try_pop("colgroup",["table"])):_.tag_name==="tbody"||_.tag_name==="tfoot"?(f=f||this._tag_stack.try_pop("caption",["table"]),f=f||this._tag_stack.try_pop("colgroup",["table"]),f=f||this._tag_stack.try_pop("thead",["table"]),f=f||this._tag_stack.try_pop("tbody",["table"])):_.tag_name==="tr"?(f=f||this._tag_stack.try_pop("caption",["table"]),f=f||this._tag_stack.try_pop("colgroup",["table"]),f=f||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(_.tag_name==="th"||_.tag_name==="td")&&(f=f||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),f=f||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return _.parent=this._tag_stack.get_parser_token(),f},m.exports.Beautifier=l},function(m,p,o){var a=o(6).Options;function n(s){a.call(this,s,"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"])}n.prototype=new a,m.exports.Options=n},function(m,p,o){var a=o(9).Tokenizer,n=o(9).TOKEN,s=o(13).Directives,i=o(14).TemplatablePattern,e=o(12).Pattern,t={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:n.START,RAW:n.RAW,EOF:n.EOF},r=new s(/<\!--/,/-->/),E=function(g,h){a.call(this,g,h),this._current_tag_name="";var y=new i(this._input).read_options(this._options),v=new e(this._input);if(this.__patterns={word:y.until(/[\n\r\t <]/),single_quote:y.until_after(/'/),double_quote:y.until_after(/"/),attribute:y.until(/[\n\r\t =>]|\/>/),element_name:y.until(/[\n\r\t >\/]/),handlebars_comment:v.starting_with(/{{!--/).until_after(/--}}/),handlebars:v.starting_with(/{{/).until_after(/}}/),handlebars_open:v.until(/[\n\r\t }]/),handlebars_raw_close:v.until(/}}/),comment:v.starting_with(/<!--/).until_after(/-->/),cdata:v.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:v.starting_with(/<!\[/).until_after(/]>/),processing:v.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 l=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=v.matching(l).until_after(l)}};E.prototype=new a,E.prototype._is_comment=function(g){return!1},E.prototype._is_opening=function(g){return g.type===t.TAG_OPEN},E.prototype._is_closing=function(g,h){return g.type===t.TAG_CLOSE&&h&&((g.text===">"||g.text==="/>")&&h.text[0]==="<"||g.text==="}}"&&h.text[0]==="{"&&h.text[1]==="{")},E.prototype._reset=function(){this._current_tag_name=""},E.prototype._get_next_token=function(g,h){var y=null;this._readWhitespace();var v=this._input.peek();return v===null?this._create_token(t.EOF,""):(y=y||this._read_open_handlebars(v,h),y=y||this._read_attribute(v,g,h),y=y||this._read_close(v,h),y=y||this._read_raw_content(v,g,h),y=y||this._read_content_word(v),y=y||this._read_comment_or_cdata(v),y=y||this._read_processing(v),y=y||this._read_open(v,h),y=y||this._create_token(t.UNKNOWN,this._input.next()),y)},E.prototype._read_comment_or_cdata=function(g){var h=null,y=null,v=null;if(g==="<"){var l=this._input.peek(1);l==="!"&&(y=this.__patterns.comment.read(),y?(v=r.get_directives(y),v&&v.ignore==="start"&&(y+=r.readIgnored(this._input))):y=this.__patterns.cdata.read()),y&&(h=this._create_token(t.COMMENT,y),h.directives=v)}return h},E.prototype._read_processing=function(g){var h=null,y=null,v=null;if(g==="<"){var l=this._input.peek(1);(l==="!"||l==="?")&&(y=this.__patterns.conditional_comment.read(),y=y||this.__patterns.processing.read()),y&&(h=this._create_token(t.COMMENT,y),h.directives=v)}return h},E.prototype._read_open=function(g,h){var y=null,v=null;return h||g==="<"&&(y=this._input.next(),this._input.peek()==="/"&&(y+=this._input.next()),y+=this.__patterns.element_name.read(),v=this._create_token(t.TAG_OPEN,y)),v},E.prototype._read_open_handlebars=function(g,h){var y=null,v=null;return h||this._options.indent_handlebars&&g==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(y=this.__patterns.handlebars_comment.read(),y=y||this.__patterns.handlebars.read(),v=this._create_token(t.COMMENT,y)):(y=this.__patterns.handlebars_open.read(),v=this._create_token(t.TAG_OPEN,y))),v},E.prototype._read_close=function(g,h){var y=null,v=null;return h&&(h.text[0]==="<"&&(g===">"||g==="/"&&this._input.peek(1)===">")?(y=this._input.next(),g==="/"&&(y+=this._input.next()),v=this._create_token(t.TAG_CLOSE,y)):h.text[0]==="{"&&g==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),v=this._create_token(t.TAG_CLOSE,"}}"))),v},E.prototype._read_attribute=function(g,h,y){var v=null,l="";if(y&&y.text[0]==="<")if(g==="=")v=this._create_token(t.EQUALS,this._input.next());else if(g==='"'||g==="'"){var u=this._input.next();g==='"'?u+=this.__patterns.double_quote.read():u+=this.__patterns.single_quote.read(),v=this._create_token(t.VALUE,u)}else l=this.__patterns.attribute.read(),l&&(h.type===t.EQUALS?v=this._create_token(t.VALUE,l):v=this._create_token(t.ATTRIBUTE,l));return v},E.prototype._is_content_unformatted=function(g){return this._options.void_elements.indexOf(g)===-1&&(this._options.content_unformatted.indexOf(g)!==-1||this._options.unformatted.indexOf(g)!==-1)},E.prototype._read_raw_content=function(g,h,y){var v="";if(y&&y.text[0]==="{")v=this.__patterns.handlebars_raw_close.read();else if(h.type===t.TAG_CLOSE&&h.opened.text[0]==="<"&&h.text[0]!=="/"){var l=h.opened.text.substr(1).toLowerCase();if(l==="script"||l==="style"){var u=this._read_comment_or_cdata(g);if(u)return u.type=t.TEXT,u;v=this._input.readUntil(new RegExp("</"+l+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(l)&&(v=this._input.readUntil(new RegExp("</"+l+"[\\n\\r\\t ]*?>","ig")))}return v?this._create_token(t.TEXT,v):null},E.prototype._read_content_word=function(g){var h="";if(this._options.unformatted_content_delimiter&&(g===this._options.unformatted_content_delimiter[0]&&(h=this.__patterns.unformatted_content_delimiter.read())),h||(h=this.__patterns.word.read()),h)return this._create_token(t.TEXT,h)},m.exports.Tokenizer=E,m.exports.TOKEN=t}],L={};function x(m){var p=L[m];if(p!==void 0)return p.exports;var o=L[m]={exports:{}};return D[m](o,o.exports,x),o.exports}var T=x(18);S=T})();var N=S;if(!0)!(ae=[Y,Y("6UM0"),Y("TXwP")],M=function(D){var L=Y("6UM0"),x=Y("TXwP");return{html_beautify:function(T,m){return N(T,m,L.js_beautify,x.css_beautify)}}}.apply(Le,ae),M!==void 0&&(Be.exports=M));else var w,R})()},"rAM+":function(Be,Le,Y){"use strict";Y.d(Le,"a",function(){return M});var ae=Y("Qw5x");function M(S,N){var w;if(typeof Symbol=="undefined"||S[Symbol.iterator]==null){if(Array.isArray(S)||(w=Object(ae.a)(S))||N&&S&&typeof S.length=="number"){w&&(S=w);var R=0,D=function(){};return{s:D,n:function(){return R>=S.length?{done:!0}:{done:!1,value:S[R++]}},e:function(p){throw p},f:D}}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 L=!0,x=!1,T;return{s:function(){w=S[Symbol.iterator]()},n:function(){var p=w.next();return L=p.done,p},e:function(p){x=!0,T=p},f:function(){try{!L&&w.return!=null&&w.return()}finally{if(x)throw T}}}}},rUJ1:function(Be,Le){const Y=/[&<>"']/,ae=/[&<>"']/g,M=/[<>"']|&(?!#?\w+;)/,S=/[<>"']|&(?!#?\w+;)/g,N={"&":"&","<":"<",">":">",'"':""","'":"'"},w=v=>N[v];function R(v,l){if(l){if(Y.test(v))return v.replace(ae,w)}else if(M.test(v))return v.replace(S,w);return v}const D=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function L(v){return v.replace(D,(l,u)=>(u=u.toLowerCase(),u==="colon"?":":u.charAt(0)==="#"?u.charAt(1)==="x"?String.fromCharCode(parseInt(u.substring(2),16)):String.fromCharCode(+u.substring(1)):""))}const x=/(^|[^\[])\^/g;function T(v,l){v=v.source||v,l=l||"";const u={replace:(d,c)=>(c=c.source||c,c=c.replace(x,"$1"),v=v.replace(d,c),u),getRegex:()=>new RegExp(v,l)};return u}const m=/[^\w:]/g,p=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function o(v,l,u){if(v){let d;try{d=decodeURIComponent(L(u)).replace(m,"").toLowerCase()}catch(c){return null}if(d.indexOf("javascript:")===0||d.indexOf("vbscript:")===0||d.indexOf("data:")===0)return null}l&&!p.test(u)&&(u=e(l,u));try{u=encodeURI(u).replace(/%25/g,"%")}catch(d){return null}return u}const a={},n=/^[^:]+:\/*[^/]*$/,s=/^([^:]+:)[\s\S]*$/,i=/^([^:]+:\/*[^/]*)[\s\S]*$/;function e(v,l){a[" "+v]||(n.test(v)?a[" "+v]=v+"/":a[" "+v]=g(v,"/",!0)),v=a[" "+v];const u=v.indexOf(":")===-1;return l.substring(0,2)==="//"?u?l:v.replace(s,"$1")+l:l.charAt(0)==="/"?u?l:v.replace(i,"$1")+l:v+l}const t={exec:function(){}};function r(v){let l=1,u,d;for(;l<arguments.length;l++){u=arguments[l];for(d in u)Object.prototype.hasOwnProperty.call(u,d)&&(v[d]=u[d])}return v}function E(v,l){const u=v.replace(/\|/g,(_,f,b)=>{let A=!1,O=f;for(;--O>=0&&b[O]==="\\";)A=!A;return A?"|":" |"}),d=u.split(/ \|/);let c=0;if(d.length>l)d.splice(l);else for(;d.length<l;)d.push("");for(;c<d.length;c++)d[c]=d[c].trim().replace(/\\\|/g,"|");return d}function g(v,l,u){const d=v.length;if(d===0)return"";let c=0;for(;c<d;){const _=v.charAt(d-c-1);if(_===l&&!u)c++;else if(_!==l&&u)c++;else break}return v.substr(0,d-c)}function h(v,l){if(v.indexOf(l[1])===-1)return-1;const u=v.length;let d=0,c=0;for(;c<u;c++)if(v[c]==="\\")c++;else if(v[c]===l[0])d++;else if(v[c]===l[1]&&(d--,d<0))return c;return-1}function y(v){v&&v.sanitize&&!v.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}Be.exports={escape:R,unescape:L,edit:T,cleanUrl:o,resolveUrl:e,noopTest:t,merge:r,splitCells:E,rtrim:g,findClosingBracket:h,checkSanitizeDeprecation:y}},sboe:function(Be,Le,Y){"use strict";Y.d(Le,"a",function(){return S});var ae=Y("cDcd"),M=Y.n(ae),S=ae.createContext(null)},ulZh:function(Be,Le,Y){typeof window!="undefined"&&function(M,S){Be.exports=S()}(this,function(){return function(ae){var M={};function S(N){if(M[N])return M[N].exports;var w=M[N]={i:N,l:!1,exports:{}};return ae[N].call(w.exports,w,w.exports,S),w.l=!0,w.exports}return S.m=ae,S.c=M,S.d=function(N,w,R){S.o(N,w)||Object.defineProperty(N,w,{enumerable:!0,get:R})},S.r=function(N){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(N,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(N,"__esModule",{value:!0})},S.t=function(N,w){if(w&1&&(N=S(N)),w&8)return N;if(w&4&&typeof N=="object"&&N&&N.__esModule)return N;var R=Object.create(null);if(S.r(R),Object.defineProperty(R,"default",{enumerable:!0,value:N}),w&2&&typeof N!="string")for(var D in N)S.d(R,D,function(L){return N[L]}.bind(null,D));return R},S.n=function(N){var w=N&&N.__esModule?function(){return N.default}:function(){return N};return S.d(w,"a",w),w},S.o=function(N,w){return Object.prototype.hasOwnProperty.call(N,w)},S.p="/dist/",S(S.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(ae,M,S){"use strict";var N=Object.prototype.hasOwnProperty,w="~";function R(){}Object.create&&(R.prototype=Object.create(null),new R().__proto__||(w=!1));function D(m,p,o){this.fn=m,this.context=p,this.once=o||!1}function L(m,p,o,a,n){if(typeof o!="function")throw new TypeError("The listener must be a function");var s=new D(o,a||m,n),i=w?w+p:p;return m._events[i]?m._events[i].fn?m._events[i]=[m._events[i],s]:m._events[i].push(s):(m._events[i]=s,m._eventsCount++),m}function x(m,p){--m._eventsCount===0?m._events=new R:delete m._events[p]}function T(){this._events=new R,this._eventsCount=0}T.prototype.eventNames=function(){var p=[],o,a;if(this._eventsCount===0)return p;for(a in o=this._events)N.call(o,a)&&p.push(w?a.slice(1):a);return Object.getOwnPropertySymbols?p.concat(Object.getOwnPropertySymbols(o)):p},T.prototype.listeners=function(p){var o=w?w+p:p,a=this._events[o];if(!a)return[];if(a.fn)return[a.fn];for(var n=0,s=a.length,i=new Array(s);n<s;n++)i[n]=a[n].fn;return i},T.prototype.listenerCount=function(p){var o=w?w+p:p,a=this._events[o];return a?a.fn?1:a.length:0},T.prototype.emit=function(p,o,a,n,s,i){var e=w?w+p:p;if(!this._events[e])return!1;var t=this._events[e],r=arguments.length,E,g;if(t.fn){t.once&&this.removeListener(p,t.fn,void 0,!0);switch(r){case 1:return t.fn.call(t.context),!0;case 2:return t.fn.call(t.context,o),!0;case 3:return t.fn.call(t.context,o,a),!0;case 4:return t.fn.call(t.context,o,a,n),!0;case 5:return t.fn.call(t.context,o,a,n,s),!0;case 6:return t.fn.call(t.context,o,a,n,s,i),!0}for(g=1,E=new Array(r-1);g<r;g++)E[g-1]=arguments[g];t.fn.apply(t.context,E)}else{var h=t.length,y;for(g=0;g<h;g++){t[g].once&&this.removeListener(p,t[g].fn,void 0,!0);switch(r){case 1:t[g].fn.call(t[g].context);break;case 2:t[g].fn.call(t[g].context,o);break;case 3:t[g].fn.call(t[g].context,o,a);break;case 4:t[g].fn.call(t[g].context,o,a,n);break;default:if(!E)for(y=1,E=new Array(r-1);y<r;y++)E[y-1]=arguments[y];t[g].fn.apply(t[g].context,E)}}}return!0},T.prototype.on=function(p,o,a){return L(this,p,o,a,!1)},T.prototype.once=function(p,o,a){return L(this,p,o,a,!0)},T.prototype.removeListener=function(p,o,a,n){var s=w?w+p:p;if(!this._events[s])return this;if(!o)return x(this,s),this;var i=this._events[s];if(i.fn)i.fn===o&&(!n||i.once)&&(!a||i.context===a)&&x(this,s);else{for(var e=0,t=[],r=i.length;e<r;e++)(i[e].fn!==o||n&&!i[e].once||a&&i[e].context!==a)&&t.push(i[e]);t.length?this._events[s]=t.length===1?t[0]:t:x(this,s)}return this},T.prototype.removeAllListeners=function(p){var o;return p?(o=w?w+p:p,this._events[o]&&x(this,o)):(this._events=new R,this._eventsCount=0),this},T.prototype.off=T.prototype.removeListener,T.prototype.addListener=T.prototype.on,T.prefixed=w,T.EventEmitter=T,ae.exports=T},"./node_modules/url-toolkit/src/url-toolkit.js":function(ae,M,S){(function(N){var w=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,R=/^([^\/?#]*)([^]*)$/,D=/(?:\/|^)\.(?=\/)/g,L=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,x={buildAbsoluteURL:function(T,m,p){if(p=p||{},T=T.trim(),m=m.trim(),!m){if(!p.alwaysNormalize)return T;var o=x.parseURL(T);if(!o)throw new Error("Error trying to parse base URL.");return o.path=x.normalizePath(o.path),x.buildURLFromParts(o)}var a=x.parseURL(m);if(!a)throw new Error("Error trying to parse relative URL.");if(a.scheme)return p.alwaysNormalize?(a.path=x.normalizePath(a.path),x.buildURLFromParts(a)):m;var n=x.parseURL(T);if(!n)throw new Error("Error trying to parse base URL.");if(!n.netLoc&&n.path&&n.path[0]!=="/"){var s=R.exec(n.path);n.netLoc=s[1],n.path=s[2]}n.netLoc&&!n.path&&(n.path="/");var i={scheme:n.scheme,netLoc:a.netLoc,path:null,params:a.params,query:a.query,fragment:a.fragment};if(!a.netLoc&&(i.netLoc=n.netLoc,a.path[0]!=="/"))if(!a.path)i.path=n.path,a.params||(i.params=n.params,a.query||(i.query=n.query));else{var e=n.path,t=e.substring(0,e.lastIndexOf("/")+1)+a.path;i.path=x.normalizePath(t)}return i.path===null&&(i.path=p.alwaysNormalize?x.normalizePath(a.path):a.path),x.buildURLFromParts(i)},parseURL:function(T){var m=w.exec(T);return m?{scheme:m[1]||"",netLoc:m[2]||"",path:m[3]||"",params:m[4]||"",query:m[5]||"",fragment:m[6]||""}:null},normalizePath:function(T){for(T=T.split("").reverse().join("").replace(D,"");T.length!==(T=T.replace(L,"")).length;);return T.split("").reverse().join("")},buildURLFromParts:function(T){return T.scheme+T.netLoc+T.path+T.params+T.query+T.fragment}};ae.exports=x})(this)},"./node_modules/webworkify-webpack/index.js":function(ae,M,S){function N(p){var o={};function a(s){if(o[s])return o[s].exports;var i=o[s]={i:s,l:!1,exports:{}};return p[s].call(i.exports,i,i.exports,a),i.l=!0,i.exports}a.m=p,a.c=o,a.i=function(s){return s},a.d=function(s,i,e){a.o(s,i)||Object.defineProperty(s,i,{configurable:!1,enumerable:!0,get:e})},a.r=function(s){Object.defineProperty(s,"__esModule",{value:!0})},a.n=function(s){var i=s&&s.__esModule?function(){return s.default}:function(){return s};return a.d(i,"a",i),i},a.o=function(s,i){return Object.prototype.hasOwnProperty.call(s,i)},a.p="/",a.oe=function(s){throw console.error(s),s};var n=a(a.s=ENTRY_MODULE);return n.default||n}var w="[\\.|\\-|\\+|\\w|/|@]+",R="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+w+").*?\\)";function D(p){return(p+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function L(p){return!isNaN(1*p)}function x(p,o,a){var n={};n[a]=[];var s=o.toString(),i=s.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!i)return n;for(var e=i[1],t=new RegExp("(\\\\n|\\W)"+D(e)+R,"g"),r;r=t.exec(s);){if(r[3]==="dll-reference")continue;n[a].push(r[3])}for(t=new RegExp("\\("+D(e)+'\\("(dll-reference\\s('+w+'))"\\)\\)'+R,"g");r=t.exec(s);)p[r[2]]||(n[a].push(r[1]),p[r[2]]=S(r[1]).m),n[r[2]]=n[r[2]]||[],n[r[2]].push(r[4]);for(var E=Object.keys(n),g=0;g<E.length;g++)for(var h=0;h<n[E[g]].length;h++)L(n[E[g]][h])&&(n[E[g]][h]=1*n[E[g]][h]);return n}function T(p){var o=Object.keys(p);return o.reduce(function(a,n){return a||p[n].length>0},!1)}function m(p,o){for(var a={main:[o]},n={main:[]},s={main:{}};T(a);)for(var i=Object.keys(a),e=0;e<i.length;e++){var t=i[e],r=a[t],E=r.pop();if(s[t]=s[t]||{},s[t][E]||!p[t][E])continue;s[t][E]=!0,n[t]=n[t]||[],n[t].push(E);for(var g=x(p,p[t][E],t),h=Object.keys(g),y=0;y<h.length;y++)a[h[y]]=a[h[y]]||[],a[h[y]]=a[h[y]].concat(g[h[y]])}return n}ae.exports=function(p,o){o=o||{};var a={main:S.m},n=o.all?{main:Object.keys(a.main)}:m(a,p),s="";Object.keys(n).filter(function(E){return E!=="main"}).forEach(function(E){for(var g=0;n[E][g];)g++;n[E].push(g),a[E][g]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",s=s+"var "+E+" = ("+N.toString().replace("ENTRY_MODULE",JSON.stringify(g))+")({"+n[E].map(function(h){return""+JSON.stringify(h)+": "+a[E][h].toString()}).join(",")+`});
|
|
`}),s=s+"new (("+N.toString().replace("ENTRY_MODULE",JSON.stringify(p))+")({"+n.main.map(function(E){return""+JSON.stringify(E)+": "+a.main[E].toString()}).join(",")+"}))(self);";var i=new window.Blob([s],{type:"text/javascript"});if(o.bare)return i;var e=window.URL||window.webkitURL||window.mozURL||window.msURL,t=e.createObjectURL(i),r=new window.Worker(t);return r.objectURL=t,r}},"./src/config.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"hlsDefaultConfig",function(){return y}),S.d(M,"mergeConfig",function(){return l}),S.d(M,"enableStreamingMode",function(){return u});var N=S("./src/controller/abr-controller.ts"),w=S("./src/controller/audio-stream-controller.ts"),R=S("./src/controller/audio-track-controller.ts"),D=S("./src/controller/subtitle-stream-controller.ts"),L=S("./src/controller/subtitle-track-controller.ts"),x=S("./src/controller/buffer-controller.ts"),T=S("./src/controller/timeline-controller.ts"),m=S("./src/controller/cap-level-controller.ts"),p=S("./src/controller/fps-controller.ts"),o=S("./src/controller/eme-controller.ts"),a=S("./src/controller/cmcd-controller.ts"),n=S("./src/utils/xhr-loader.ts"),s=S("./src/utils/fetch-loader.ts"),i=S("./src/utils/cues.ts"),e=S("./src/utils/mediakeys-helper.ts"),t=S("./src/utils/logger.ts");function r(){return r=Object.assign||function(d){for(var c=1;c<arguments.length;c++){var _=arguments[c];for(var f in _)Object.prototype.hasOwnProperty.call(_,f)&&(d[f]=_[f])}return d},r.apply(this,arguments)}function E(d,c){var _=Object.keys(d);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(d);c&&(f=f.filter(function(b){return Object.getOwnPropertyDescriptor(d,b).enumerable})),_.push.apply(_,f)}return _}function g(d){for(var c=1;c<arguments.length;c++){var _=arguments[c]!=null?arguments[c]:{};c%2?E(Object(_),!0).forEach(function(f){h(d,f,_[f])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(_)):E(Object(_)).forEach(function(f){Object.defineProperty(d,f,Object.getOwnPropertyDescriptor(_,f))})}return d}function h(d,c,_){return c in d?Object.defineProperty(d,c,{value:_,enumerable:!0,configurable:!0,writable:!0}):d[c]=_,d}var y=g(g({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:Infinity,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:Infinity,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:n.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:N.default,bufferController:x.default,capLevelController:m.default,fpsController:p.default,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystemOptions:{},requestMediaKeySystemAccessFunc:e.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},v()),{},{subtitleStreamController:D.SubtitleStreamController,subtitleTrackController:L.default,timelineController:T.TimelineController,audioStreamController:w.default,audioTrackController:R.default,emeController:o.default,cmcdController:a.default});function v(){return{cueHandler:i.default,enableCEA708Captions:!0,enableWebVTT:!0,enableIMSC1:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function l(d,c){if((c.liveSyncDurationCount||c.liveMaxLatencyDurationCount)&&(c.liveSyncDuration||c.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(c.liveMaxLatencyDurationCount!==void 0&&(c.liveSyncDurationCount===void 0||c.liveMaxLatencyDurationCount<=c.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(c.liveMaxLatencyDuration!==void 0&&(c.liveSyncDuration===void 0||c.liveMaxLatencyDuration<=c.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return r({},d,c)}function u(d){var c=d.loader;if(c!==s.default&&c!==n.default)t.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),d.progressive=!1;else{var _=Object(s.fetchSupported)();_&&(d.loader=s.default,d.progressive=!0,d.enableSoftwareAES=!0,t.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(ae,M,S){"use strict";S.r(M);var N=S("./src/polyfills/number.ts"),w=S("./src/utils/ewma-bandwidth-estimator.ts"),R=S("./src/events.ts"),D=S("./src/utils/buffer-helper.ts"),L=S("./src/errors.ts"),x=S("./src/types/loader.ts"),T=S("./src/utils/logger.ts");function m(a,n){for(var s=0;s<n.length;s++){var i=n[s];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(a,i.key,i)}}function p(a,n,s){return n&&m(a.prototype,n),s&&m(a,s),a}var o=function(){function a(s){this.hls=void 0,this.lastLoadedFragLevel=0,this._nextAutoLevel=-1,this.timer=void 0,this.onCheck=this._abandonRulesCheck.bind(this),this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this.hls=s;var i=s.config;this.bwEstimator=new w.default(i.abrEwmaSlowVoD,i.abrEwmaFastVoD,i.abrEwmaDefaultEstimate),this.registerListeners()}var n=a.prototype;return n.registerListeners=function(){var i=this.hls;i.on(R.Events.FRAG_LOADING,this.onFragLoading,this),i.on(R.Events.FRAG_LOADED,this.onFragLoaded,this),i.on(R.Events.FRAG_BUFFERED,this.onFragBuffered,this),i.on(R.Events.LEVEL_LOADED,this.onLevelLoaded,this),i.on(R.Events.ERROR,this.onError,this)},n.unregisterListeners=function(){var i=this.hls;i.off(R.Events.FRAG_LOADING,this.onFragLoading,this),i.off(R.Events.FRAG_LOADED,this.onFragLoaded,this),i.off(R.Events.FRAG_BUFFERED,this.onFragBuffered,this),i.off(R.Events.LEVEL_LOADED,this.onLevelLoaded,this),i.off(R.Events.ERROR,this.onError,this)},n.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},n.onFragLoading=function(i,e){var t=e.frag;if(t.type===x.PlaylistLevelType.MAIN&&!this.timer){var r;this.fragCurrent=t,this.partCurrent=(r=e.part)!=null?r:null,this.timer=self.setInterval(this.onCheck,100)}},n.onLevelLoaded=function(i,e){var t=this.hls.config;e.details.live?this.bwEstimator.update(t.abrEwmaSlowLive,t.abrEwmaFastLive):this.bwEstimator.update(t.abrEwmaSlowVoD,t.abrEwmaFastVoD)},n._abandonRulesCheck=function(){var i=this.fragCurrent,e=this.partCurrent,t=this.hls,r=t.autoLevelEnabled,E=t.config,g=t.media;if(!i||!g)return;var h=e?e.stats:i.stats,y=e?e.duration:i.duration;if(h.aborted){T.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!r||g.paused||!g.playbackRate||!g.readyState)return;var v=performance.now()-h.loading.start,l=Math.abs(g.playbackRate);if(v<=500*y/l)return;var u=t.levels,d=t.minAutoLevel,c=u[i.level],_=h.total||Math.max(h.loaded,Math.round(y*c.maxBitrate/8)),f=Math.max(1,h.bwEstimate?h.bwEstimate/8:h.loaded*1e3/v),b=(_-h.loaded)/f,A=g.currentTime,O=(D.BufferHelper.bufferInfo(g,A,E.maxBufferHole).end-A)/l;if(O>=2*y/l||b<=O)return;var C=Number.POSITIVE_INFINITY,P;for(P=i.level-1;P>d;P--){var k=u[P].maxBitrate;if(C=y*k/(8*.8*f),C<O)break}if(C>=b)return;var I=this.bwEstimator.getEstimate();T.logger.warn("Fragment "+i.sn+(e?" part "+e.index:"")+" of level "+i.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+P+`
|
|
Current BW estimate: `+(Object(N.isFiniteNumber)(I)?(I/1024).toFixed(3):"Unknown")+` Kb/s
|
|
Estimated load time for current fragment: `+b.toFixed(3)+` s
|
|
Estimated load time for the next fragment: `+C.toFixed(3)+` s
|
|
Time to underbuffer: `+O.toFixed(3)+" s"),t.nextLoadLevel=P,this.bwEstimator.sample(v,h.loaded),this.clearTimer(),i.loader&&(this.fragCurrent=this.partCurrent=null,i.loader.abort()),t.trigger(R.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:i,part:e,stats:h})},n.onFragLoaded=function(i,e){var t=e.frag,r=e.part;if(t.type===x.PlaylistLevelType.MAIN&&Object(N.isFiniteNumber)(t.sn)){var E=r?r.stats:t.stats,g=r?r.duration:t.duration;if(this.clearTimer(),this.lastLoadedFragLevel=t.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var h=this.hls.levels[t.level],y=(h.loaded?h.loaded.bytes:0)+E.loaded,v=(h.loaded?h.loaded.duration:0)+g;h.loaded={bytes:y,duration:v},h.realBitrate=Math.round(8*y/v)}if(t.bitrateTest){var l={stats:E,frag:t,part:r,id:t.type};this.onFragBuffered(R.Events.FRAG_BUFFERED,l),t.bitrateTest=!1}}},n.onFragBuffered=function(i,e){var t=e.frag,r=e.part,E=r?r.stats:t.stats;if(E.aborted)return;if(t.type!==x.PlaylistLevelType.MAIN||t.sn==="initSegment")return;var g=E.parsing.end-E.loading.start;this.bwEstimator.sample(g,E.loaded),E.bwEstimate=this.bwEstimator.getEstimate(),t.bitrateTest?this.bitrateTestDelay=g/1e3:this.bitrateTestDelay=0},n.onError=function(i,e){switch(e.details){case L.ErrorDetails.FRAG_LOAD_ERROR:case L.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},n.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},n.getNextABRAutoLevel=function(){var i=this.fragCurrent,e=this.partCurrent,t=this.hls,r=t.maxAutoLevel,E=t.config,g=t.minAutoLevel,h=t.media,y=e?e.duration:i?i.duration:0,v=h?h.currentTime:0,l=h&&h.playbackRate!==0?Math.abs(h.playbackRate):1,u=this.bwEstimator?this.bwEstimator.getEstimate():E.abrEwmaDefaultEstimate,d=(D.BufferHelper.bufferInfo(h,v,E.maxBufferHole).end-v)/l,c=this.findBestLevel(u,g,r,d,E.abrBandWidthFactor,E.abrBandWidthUpFactor);if(c>=0)return c;T.logger.trace((d?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var _=y?Math.min(y,E.maxStarvationDelay):E.maxStarvationDelay,f=E.abrBandWidthFactor,b=E.abrBandWidthUpFactor;if(!d){var A=this.bitrateTestDelay;if(A){var O=y?Math.min(y,E.maxLoadingDelay):E.maxLoadingDelay;_=O-A,T.logger.trace("bitrate test took "+Math.round(1e3*A)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*_)+" ms"),f=b=1}}return c=this.findBestLevel(u,g,r,d+_,f,b),Math.max(c,0)},n.findBestLevel=function(i,e,t,r,E,g){for(var h,y=this.fragCurrent,v=this.partCurrent,l=this.lastLoadedFragLevel,u=this.hls.levels,d=u[l],c=!!(d!=null&&(h=d.details)!==null&&h!==void 0&&h.live),_=d==null?void 0:d.codecSet,f=v?v.duration:y?y.duration:0,b=t;b>=e;b--){var A=u[b];if(!A||_&&A.codecSet!==_)continue;var O=A.details,C=(v?O==null?void 0:O.partTarget:O==null?void 0:O.averagetargetduration)||f,P=void 0;b<=l?P=E*i:P=g*i;var k=u[b].maxBitrate,I=k*C/P;if(T.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+b+"/"+Math.round(P)+"/"+k+"/"+C+"/"+r+"/"+I),P>k&&(!I||c&&!this.bitrateTestDelay||I<r))return b}return-1},p(a,[{key:"nextAutoLevel",get:function(){var i=this._nextAutoLevel,e=this.bwEstimator;if(i!==-1&&(!e||!e.canEstimate()))return i;var t=this.getNextABRAutoLevel();return i!==-1&&(t=Math.min(i,t)),t},set:function(i){this._nextAutoLevel=i}}]),a}();M.default=o},"./src/controller/audio-stream-controller.ts":function(ae,M,S){"use strict";S.r(M);var N=S("./src/polyfills/number.ts"),w=S("./src/controller/base-stream-controller.ts"),R=S("./src/events.ts"),D=S("./src/utils/buffer-helper.ts"),L=S("./src/controller/fragment-tracker.ts"),x=S("./src/types/level.ts"),T=S("./src/types/loader.ts"),m=S("./src/loader/fragment.ts"),p=S("./src/demux/chunk-cache.ts"),o=S("./src/demux/transmuxer-interface.ts"),a=S("./src/types/transmuxer.ts"),n=S("./src/controller/fragment-finders.ts"),s=S("./src/utils/discontinuities.ts"),i=S("./src/errors.ts"),e=S("./src/utils/logger.ts");function t(){return t=Object.assign||function(y){for(var v=1;v<arguments.length;v++){var l=arguments[v];for(var u in l)Object.prototype.hasOwnProperty.call(l,u)&&(y[u]=l[u])}return y},t.apply(this,arguments)}function r(y,v){y.prototype=Object.create(v.prototype),y.prototype.constructor=y,E(y,v)}function E(y,v){return E=Object.setPrototypeOf||function(u,d){return u.__proto__=d,u},E(y,v)}var g=100,h=function(y){r(v,y);function v(u,d){var c;return c=y.call(this,u,d,"[audio-stream-controller]")||this,c.videoBuffer=null,c.videoTrackCC=-1,c.waitingVideoCC=-1,c.audioSwitch=!1,c.trackId=-1,c.waitingData=null,c.mainDetails=null,c.bufferFlushed=!1,c._registerListeners(),c}var l=v.prototype;return l.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},l._registerListeners=function(){var d=this.hls;d.on(R.Events.MEDIA_ATTACHED,this.onMediaAttached,this),d.on(R.Events.MEDIA_DETACHING,this.onMediaDetaching,this),d.on(R.Events.MANIFEST_LOADING,this.onManifestLoading,this),d.on(R.Events.LEVEL_LOADED,this.onLevelLoaded,this),d.on(R.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),d.on(R.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),d.on(R.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),d.on(R.Events.ERROR,this.onError,this),d.on(R.Events.BUFFER_RESET,this.onBufferReset,this),d.on(R.Events.BUFFER_CREATED,this.onBufferCreated,this),d.on(R.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),d.on(R.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),d.on(R.Events.FRAG_BUFFERED,this.onFragBuffered,this)},l._unregisterListeners=function(){var d=this.hls;d.off(R.Events.MEDIA_ATTACHED,this.onMediaAttached,this),d.off(R.Events.MEDIA_DETACHING,this.onMediaDetaching,this),d.off(R.Events.MANIFEST_LOADING,this.onManifestLoading,this),d.off(R.Events.LEVEL_LOADED,this.onLevelLoaded,this),d.off(R.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),d.off(R.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),d.off(R.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),d.off(R.Events.ERROR,this.onError,this),d.off(R.Events.BUFFER_RESET,this.onBufferReset,this),d.off(R.Events.BUFFER_CREATED,this.onBufferCreated,this),d.off(R.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),d.off(R.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),d.off(R.Events.FRAG_BUFFERED,this.onFragBuffered,this)},l.onInitPtsFound=function(d,c){var _=c.frag,f=c.id,b=c.initPTS;if(f==="main"){var A=_.cc;this.initPTS[_.cc]=b,this.log("InitPTS for cc: "+A+" found from main: "+b),this.videoTrackCC=A,this.state===w.State.WAITING_INIT_PTS&&this.tick()}},l.startLoad=function(d){if(!this.levels){this.startPosition=d,this.state=w.State.STOPPED;return}var c=this.lastCurrentTime;this.stopLoad(),this.setInterval(g),this.fragLoadError=0,c>0&&d===-1?(this.log("Override startPosition with lastCurrentTime @"+c.toFixed(3)),this.state=w.State.IDLE):(this.loadedmetadata=!1,this.state=w.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=d,this.tick()},l.doTick=function(){switch(this.state){case w.State.IDLE:this.doTickIdle();break;case w.State.WAITING_TRACK:{var d,c=this.levels,_=this.trackId,f=c==null||((d=c[_])===null||d===void 0)?void 0:d.details;if(f){if(this.waitForCdnTuneIn(f))break;this.state=w.State.WAITING_INIT_PTS}break}case w.State.FRAG_LOADING_WAITING_RETRY:{var b,A=performance.now(),O=this.retryDate;(!O||A>=O||(b=this.media)!==null&&b!==void 0&&b.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=w.State.IDLE);break}case w.State.WAITING_INIT_PTS:{var C=this.waitingData;if(C){var P=C.frag,k=C.part,I=C.cache,U=C.complete;if(this.initPTS[P.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=w.State.FRAG_LOADING;var H=I.flush(),Z={frag:P,part:k,payload:H,networkDetails:null};this._handleFragmentLoadProgress(Z),U&&y.prototype._handleFragmentLoadComplete.call(this,Z)}else if(this.videoTrackCC!==this.waitingVideoCC)e.logger.log("Waiting fragment cc ("+P.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var $=this.getLoadPosition(),ee=D.BufferHelper.bufferInfo(this.mediaBuffer,$,this.config.maxBufferHole),te=Object(n.fragmentWithinToleranceTest)(ee.end,this.config.maxFragLookUpTolerance,P);te<0&&(e.logger.log("Waiting fragment cc ("+P.cc+") @ "+P.start+" cancelled because another fragment at "+ee.end+" is needed"),this.clearWaitingFragment())}}else this.state=w.State.IDLE}}this.onTickEnd()},l.clearWaitingFragment=function(){var d=this.waitingData;d&&(this.fragmentTracker.removeFragment(d.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=w.State.IDLE)},l.onTickEnd=function(){var d=this.media;if(!d||!d.readyState)return;var c=this.mediaBuffer?this.mediaBuffer:d,_=c.buffered;!this.loadedmetadata&&_.length&&(this.loadedmetadata=!0),this.lastCurrentTime=d.currentTime},l.doTickIdle=function(){var d,c,_=this.hls,f=this.levels,b=this.media,A=this.trackId,O=_.config;if(!f||!f[A])return;if(!b&&(this.startFragRequested||!O.startFragPrefetch))return;var C=f[A],P=C.details;if(!P||P.live&&this.levelLastLoaded!==A||this.waitForCdnTuneIn(P)){this.state=w.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,m.ElementaryStreamTypes.AUDIO,T.PlaylistLevelType.AUDIO));var k=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,T.PlaylistLevelType.AUDIO);if(k===null)return;var I=k.len,U=this.getMaxBufferLength(),H=this.audioSwitch;if(I>=U&&!H)return;if(!H&&this._streamEnded(k,P)){_.trigger(R.Events.BUFFER_EOS,{type:"audio"}),this.state=w.State.ENDED;return}var Z=P.fragments,$=Z[0].start,ee=k.end;if(H){var te=this.getLoadPosition();ee=te,P.PTSKnown&&te<$&&((k.end>$||k.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),b.currentTime=$+.05))}var K=this.getNextFragment(ee,P);if(!K){this.bufferFlushed=!0;return}((d=K.decryptdata)===null||d===void 0?void 0:d.keyFormat)==="identity"&&!((c=K.decryptdata)!==null&&c!==void 0&&c.key)?this.loadKey(K,P):this.loadFragment(K,P,ee)},l.getMaxBufferLength=function(){var d=y.prototype.getMaxBufferLength.call(this),c=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,T.PlaylistLevelType.MAIN);return c===null?d:Math.max(d,c.len)},l.onMediaDetaching=function(){this.videoBuffer=null,y.prototype.onMediaDetaching.call(this)},l.onAudioTracksUpdated=function(d,c){var _=c.audioTracks;this.resetTransmuxer(),this.levels=_.map(function(f){return new x.Level(f)})},l.onAudioTrackSwitching=function(d,c){var _=!!c.url;this.trackId=c.id;var f=this.fragCurrent;f!=null&&f.loader&&f.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),_?this.setInterval(g):this.resetTransmuxer(),_?(this.audioSwitch=!0,this.state=w.State.IDLE):this.state=w.State.STOPPED,this.tick()},l.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},l.onLevelLoaded=function(d,c){this.mainDetails=c.details},l.onAudioTrackLoaded=function(d,c){var _,f=this.levels,b=c.details,A=c.id;if(!f){this.warn("Audio tracks were reset while loading level "+A);return}this.log("Track "+A+" loaded ["+b.startSN+","+b.endSN+"],duration:"+b.totalduration);var O=f[A],C=0;if(b.live||(_=O.details)!==null&&_!==void 0&&_.live){var P=this.mainDetails;if(b.fragments[0]||(b.deltaUpdateFailed=!0),b.deltaUpdateFailed||!P)return;!O.details&&b.hasProgramDateTime&&P.hasProgramDateTime?(Object(s.alignMediaPlaylistByPDT)(b,P),C=b.fragments[0].start):C=this.alignPlaylists(b,O.details)}O.details=b,this.levelLastLoaded=A,!this.startFragRequested&&(this.mainDetails||!b.live)&&this.setStartPosition(O.details,C),this.state===w.State.WAITING_TRACK&&!this.waitForCdnTuneIn(b)&&(this.state=w.State.IDLE),this.tick()},l._handleFragmentLoadProgress=function(d){var c,_=d.frag,f=d.part,b=d.payload,A=this.config,O=this.trackId,C=this.levels;if(!C){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+_.sn+" of level "+_.level+" will not be buffered");return}var P=C[O];console.assert(P,"Audio track is defined on fragment load progress");var k=P.details;console.assert(k,"Audio track details are defined on fragment load progress");var I=A.defaultAudioCodec||P.audioCodec||"mp4a.40.2",U=this.transmuxer;U||(U=this.transmuxer=new o.default(this.hls,T.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var H=this.initPTS[_.cc],Z=(c=_.initSegment)===null||c===void 0?void 0:c.data;if(H!==void 0){var $=!1,ee=f?f.index:-1,te=ee!==-1,K=new a.ChunkMetadata(_.level,_.sn,_.stats.chunkCount,b.byteLength,ee,te);U.push(b,Z,I,"",_,f,k.totalduration,$,K,H)}else{e.logger.log("Unknown video PTS for cc "+_.cc+", waiting for video PTS before demuxing audio frag "+_.sn+" of ["+k.startSN+" ,"+k.endSN+"],track "+O);var W=this.waitingData=this.waitingData||{frag:_,part:f,cache:new p.default,complete:!1},X=W.cache;X.push(new Uint8Array(b)),this.waitingVideoCC=this.videoTrackCC,this.state=w.State.WAITING_INIT_PTS}},l._handleFragmentLoadComplete=function(d){if(this.waitingData){this.waitingData.complete=!0;return}y.prototype._handleFragmentLoadComplete.call(this,d)},l.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},l.onBufferCreated=function(d,c){var _=c.tracks.audio;_&&(this.mediaBuffer=_.buffer),c.tracks.video&&(this.videoBuffer=c.tracks.video.buffer)},l.onFragBuffered=function(d,c){var _=c.frag,f=c.part;if(_.type!==T.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(_)){this.warn("Fragment "+_.sn+(f?" p: "+f.index:"")+" of level "+_.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}_.sn!=="initSegment"&&(this.fragPrevious=_,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(R.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(_,f)},l.onError=function(d,c){switch(c.details){case i.ErrorDetails.FRAG_LOAD_ERROR:case i.ErrorDetails.FRAG_LOAD_TIMEOUT:case i.ErrorDetails.KEY_LOAD_ERROR:case i.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(T.PlaylistLevelType.AUDIO,c);break;case i.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case i.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==w.State.ERROR&&this.state!==w.State.STOPPED&&(this.state=c.fatal?w.State.ERROR:w.State.IDLE,this.warn(c.details+" while loading frag, switching to "+this.state+" state"));break;case i.ErrorDetails.BUFFER_FULL_ERROR:if(c.parent==="audio"&&(this.state===w.State.PARSING||this.state===w.State.PARSED)){var _=!0,f=this.getFwdBufferInfo(this.mediaBuffer,T.PlaylistLevelType.AUDIO);f&&f.len>.5&&(_=!this.reduceMaxBufferLength(f.len)),_&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,y.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},l.onBufferFlushed=function(d,c){var _=c.type;_===m.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},l._handleTransmuxComplete=function(d){var c,_="audio",f=this.hls,b=d.remuxResult,A=d.chunkMeta,O=this.getCurrentContext(A);if(!O){this.warn("The loading context changed while buffering fragment "+A.sn+" of level "+A.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(A.level);return}var C=O.frag,P=O.part,k=b.audio,I=b.text,U=b.id3,H=b.initSegment;if(this.fragContextChanged(C))return;if(this.state=w.State.PARSING,this.audioSwitch&&k&&this.completeAudioSwitch(),H!=null&&H.tracks&&(this._bufferInitSegment(H.tracks,C,A),f.trigger(R.Events.FRAG_PARSING_INIT_SEGMENT,{frag:C,id:_,tracks:H.tracks})),k){var Z=k.startPTS,$=k.endPTS,ee=k.startDTS,te=k.endDTS;P&&(P.elementaryStreams[m.ElementaryStreamTypes.AUDIO]={startPTS:Z,endPTS:$,startDTS:ee,endDTS:te}),C.setElementaryStreamInfo(m.ElementaryStreamTypes.AUDIO,Z,$,ee,te),this.bufferFragmentData(k,C,P,A)}if(U!=null&&(c=U.samples)!==null&&c!==void 0&&c.length){var K=t({frag:C,id:_},U);f.trigger(R.Events.FRAG_PARSING_METADATA,K)}if(I){var W=t({frag:C,id:_},I);f.trigger(R.Events.FRAG_PARSING_USERDATA,W)}},l._bufferInitSegment=function(d,c,_){if(this.state!==w.State.PARSING)return;d.video&&delete d.video;var f=d.audio;if(!f)return;f.levelCodec=f.codec,f.id="audio",this.log("Init audio buffer, container:"+f.container+", codecs[parsed]=["+f.codec+"]"),this.hls.trigger(R.Events.BUFFER_CODECS,d);var b=f.initSegment;if(b!=null&&b.byteLength){var A={type:"audio",frag:c,part:null,chunkMeta:_,parent:c.type,data:b};this.hls.trigger(R.Events.BUFFER_APPENDING,A)}this.tick()},l.loadFragment=function(d,c,_){var f=this.fragmentTracker.getState(d);this.fragCurrent=d,(this.audioSwitch||f===L.FragmentState.NOT_LOADED||f===L.FragmentState.PARTIAL)&&(d.sn==="initSegment"?this._loadInitSegment(d):c.live&&!Object(N.isFiniteNumber)(this.initPTS[d.cc])?(this.log("Waiting for video PTS in continuity counter "+d.cc+" of live stream before loading audio fragment "+d.sn+" of level "+this.trackId),this.state=w.State.WAITING_INIT_PTS):(this.startFragRequested=!0,y.prototype.loadFragment.call(this,d,c,_)))},l.completeAudioSwitch=function(){var d=this.hls,c=this.media,_=this.trackId;c&&(this.log("Switching audio track : flushing all audio"),y.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,d.trigger(R.Events.AUDIO_TRACK_SWITCHED,{id:_})},v}(w.default);M.default=h},"./src/controller/audio-track-controller.ts":function(ae,M,S){"use strict";S.r(M);var N=S("./src/events.ts"),w=S("./src/errors.ts"),R=S("./src/controller/base-playlist-controller.ts"),D=S("./src/types/loader.ts");function L(o,a){for(var n=0;n<a.length;n++){var s=a[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(o,s.key,s)}}function x(o,a,n){return a&&L(o.prototype,a),n&&L(o,n),o}function T(o,a){o.prototype=Object.create(a.prototype),o.prototype.constructor=o,m(o,a)}function m(o,a){return m=Object.setPrototypeOf||function(s,i){return s.__proto__=i,s},m(o,a)}var p=function(o){T(a,o);function a(s){var i;return i=o.call(this,s,"[audio-track-controller]")||this,i.tracks=[],i.groupId=null,i.tracksInGroup=[],i.trackId=-1,i.trackName="",i.selectDefaultTrack=!0,i.registerListeners(),i}var n=a.prototype;return n.registerListeners=function(){var i=this.hls;i.on(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.on(N.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.on(N.Events.LEVEL_LOADING,this.onLevelLoading,this),i.on(N.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),i.on(N.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),i.on(N.Events.ERROR,this.onError,this)},n.unregisterListeners=function(){var i=this.hls;i.off(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.off(N.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.off(N.Events.LEVEL_LOADING,this.onLevelLoading,this),i.off(N.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),i.off(N.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),i.off(N.Events.ERROR,this.onError,this)},n.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,o.prototype.destroy.call(this)},n.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},n.onManifestParsed=function(i,e){this.tracks=e.audioTracks||[]},n.onAudioTrackLoaded=function(i,e){var t=e.id,r=e.details,E=this.tracksInGroup[t];if(!E){this.warn("Invalid audio track id "+t);return}var g=E.details;E.details=e.details,this.log("audioTrack "+t+" loaded ["+r.startSN+"-"+r.endSN+"]"),t===this.trackId&&(this.retryCount=0,this.playlistLoaded(t,e,g))},n.onLevelLoading=function(i,e){this.switchLevel(e.level)},n.onLevelSwitching=function(i,e){this.switchLevel(e.level)},n.switchLevel=function(i){var e=this.hls.levels[i];if(!(e!=null&&e.audioGroupIds))return;var t=e.audioGroupIds[e.urlId];if(this.groupId!==t){this.groupId=t;var r=this.tracks.filter(function(g){return!t||g.groupId===t});this.selectDefaultTrack&&!r.some(function(g){return g.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=r;var E={audioTracks:r};this.log("Updating audio tracks, "+r.length+' track(s) found in "'+t+'" group-id'),this.hls.trigger(N.Events.AUDIO_TRACKS_UPDATED,E),this.selectInitialTrack()}},n.onError=function(i,e){if(o.prototype.onError.call(this,i,e),e.fatal||!e.context)return;e.context.type===D.PlaylistContextType.AUDIO_TRACK&&e.context.id===this.trackId&&e.context.groupId===this.groupId&&this.retryLoadingOrFail(e)},n.setAudioTrack=function(i){var e=this.tracksInGroup;if(i<0||i>=e.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var t=e[this.trackId];this.log("Now switching to audio-track index "+i);var r=e[i],E=r.id,g=r.groupId,h=g===void 0?"":g,y=r.name,v=r.type,l=r.url;if(this.trackId=i,this.trackName=y,this.selectDefaultTrack=!1,this.hls.trigger(N.Events.AUDIO_TRACK_SWITCHING,{id:E,groupId:h,name:y,type:v,url:l}),r.details&&!r.details.live)return;var u=this.switchParams(r.url,t==null?void 0:t.details);this.loadPlaylist(u)},n.selectInitialTrack=function(){var i=this.tracksInGroup;console.assert(i.length,"Initial audio track should be selected when tracks are known");var e=this.trackName,t=this.findTrackId(e)||this.findTrackId();t!==-1?this.setAudioTrack(t):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(N.Events.ERROR,{type:w.ErrorTypes.MEDIA_ERROR,details:w.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},n.findTrackId=function(i){for(var e=this.tracksInGroup,t=0;t<e.length;t++){var r=e[t];if((!this.selectDefaultTrack||r.default)&&(!i||i===r.name))return r.id}return-1},n.loadPlaylist=function(i){var e=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(e)){var t=e.id,r=e.groupId,E=e.url;if(i)try{E=i.addDirectives(E)}catch(g){this.warn("Could not construct new URL with HLS Delivery Directives: "+g)}this.log("loading audio-track playlist for id: "+t),this.clearTimer(),this.hls.trigger(N.Events.AUDIO_TRACK_LOADING,{url:E,id:t,groupId:r,deliveryDirectives:i||null})}},x(a,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(i){this.selectDefaultTrack=!1,this.setAudioTrack(i)}}]),a}(R.default);M.default=p},"./src/controller/base-playlist-controller.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"default",function(){return x});var N=S("./src/polyfills/number.ts"),w=S("./src/types/level.ts"),R=S("./src/controller/level-helper.ts"),D=S("./src/utils/logger.ts"),L=S("./src/errors.ts"),x=function(){function T(p,o){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=D.logger.log.bind(D.logger,o+":"),this.warn=D.logger.warn.bind(D.logger,o+":"),this.hls=p}var m=T.prototype;return m.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},m.onError=function(o,a){a.fatal&&a.type===L.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},m.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},m.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},m.stopLoad=function(){this.canLoad=!1,this.clearTimer()},m.switchParams=function(o,a){var n=a==null?void 0:a.renditionReports;if(n)for(var s=0;s<n.length;s++){var i=n[s],e=""+i.URI;if(e===o.substr(-e.length)){var t=parseInt(i["LAST-MSN"]),r=parseInt(i["LAST-PART"]);if(a&&this.hls.config.lowLatencyMode){var E=Math.min(a.age-a.partTarget,a.targetduration);r!==void 0&&E>a.partTarget&&(r+=1)}if(Object(N.isFiniteNumber)(t))return new w.HlsUrlParameters(t,Object(N.isFiniteNumber)(r)?r:void 0,w.HlsSkip.No)}}},m.loadPlaylist=function(o){},m.shouldLoadTrack=function(o){return this.canLoad&&o&&!!o.url&&(!o.details||o.details.live)},m.playlistLoaded=function(o,a,n){var s=this,i=a.details,e=a.stats,t=e.loading.end?Math.max(0,self.performance.now()-e.loading.end):0;if(i.advancedDateTime=Date.now()-t,i.live||n!=null&&n.live){if(i.reloaded(n),n&&this.log("live playlist "+o+" "+(i.advanced?"REFRESHED "+i.lastPartSn+"-"+i.lastPartIndex:"MISSED")),n&&i.fragments.length>0&&Object(R.mergeDetails)(n,i),!this.canLoad||!i.live)return;var r,E=void 0,g=void 0;if(i.canBlockReload&&i.endSN&&i.advanced){var h=this.hls.config.lowLatencyMode,y=i.lastPartSn,v=i.endSN,l=i.lastPartIndex,u=l!==-1,d=y===v,c=h?0:l;u?(E=d?v+1:y,g=d?c:l+1):E=v+1;var _=i.age,f=_+i.ageHeader,b=Math.min(f-i.partTarget,i.targetduration*1.5);if(b>0){if(n&&b>n.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+n.tuneInGoal+" to: "+b+" with playlist age: "+i.age),b=0;else{var A=Math.floor(b/i.targetduration);if(E+=A,g!==void 0){var O=Math.round(b%i.targetduration/i.partTarget);g+=O}this.log("CDN Tune-in age: "+i.ageHeader+"s last advanced "+_.toFixed(2)+"s goal: "+b+" skip sn "+A+" to part "+g)}i.tuneInGoal=b}if(r=this.getDeliveryDirectives(i,a.deliveryDirectives,E,g),h||!d){this.loadPlaylist(r);return}}else r=this.getDeliveryDirectives(i,a.deliveryDirectives,E,g);var C=Object(R.computeReloadInterval)(i,e);E!==void 0&&i.canBlockReload&&(C-=i.partTarget||1),this.log("reload live playlist "+o+" in "+Math.round(C)+" ms"),this.timer=self.setTimeout(function(){return s.loadPlaylist(r)},C)}else this.clearTimer()},m.getDeliveryDirectives=function(o,a,n,s){var i=Object(w.getSkipValue)(o,n);return a!=null&&a.skip&&o.deltaUpdateFailed&&(n=a.msn,s=a.part,i=w.HlsSkip.No),new w.HlsUrlParameters(n,s,i)},m.retryLoadingOrFail=function(o){var a=this,n=this.hls.config,s=this.retryCount<n.levelLoadingMaxRetry;if(s){var i;if(this.retryCount++,o.details.indexOf("LoadTimeOut")>-1&&(i=o.context)!==null&&i!==void 0&&i.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+o.details+'"'),this.loadPlaylist();else{var e=Math.min(Math.pow(2,this.retryCount)*n.levelLoadingRetryDelay,n.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return a.loadPlaylist()},e),this.warn("retry playlist loading #"+this.retryCount+" in "+e+' ms after "'+o.details+'"')}}else this.warn('cannot recover from error "'+o.details+'"'),this.clearTimer(),o.fatal=!0;return s},T}()},"./src/controller/base-stream-controller.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"State",function(){return v}),S.d(M,"default",function(){return l});var N=S("./src/polyfills/number.ts"),w=S("./src/task-loop.ts"),R=S("./src/controller/fragment-tracker.ts"),D=S("./src/utils/buffer-helper.ts"),L=S("./src/utils/logger.ts"),x=S("./src/events.ts"),T=S("./src/errors.ts"),m=S("./src/types/transmuxer.ts"),p=S("./src/utils/mp4-tools.ts"),o=S("./src/utils/discontinuities.ts"),a=S("./src/controller/fragment-finders.ts"),n=S("./src/controller/level-helper.ts"),s=S("./src/loader/fragment-loader.ts"),i=S("./src/crypt/decrypter.ts"),e=S("./src/utils/time-ranges.ts"),t=S("./src/types/loader.ts");function r(u,d){for(var c=0;c<d.length;c++){var _=d[c];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(u,_.key,_)}}function E(u,d,c){return d&&r(u.prototype,d),c&&r(u,c),u}function g(u){if(u===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return u}function h(u,d){u.prototype=Object.create(d.prototype),u.prototype.constructor=u,y(u,d)}function y(u,d){return y=Object.setPrototypeOf||function(_,f){return _.__proto__=f,_},y(u,d)}var v={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",BACKTRACKING:"BACKTRACKING",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"},l=function(u){h(d,u);function d(_,f,b){var A;return A=u.call(this)||this,A.hls=void 0,A.fragPrevious=null,A.fragCurrent=null,A.fragmentTracker=void 0,A.transmuxer=null,A._state=v.STOPPED,A.media=void 0,A.mediaBuffer=void 0,A.config=void 0,A.bitrateTest=!1,A.lastCurrentTime=0,A.nextLoadPosition=0,A.startPosition=0,A.loadedmetadata=!1,A.fragLoadError=0,A.retryDate=0,A.levels=null,A.fragmentLoader=void 0,A.levelLastLoaded=null,A.startFragRequested=!1,A.decrypter=void 0,A.initPTS=[],A.onvseeking=null,A.onvended=null,A.logPrefix="",A.log=void 0,A.warn=void 0,A.logPrefix=b,A.log=L.logger.log.bind(L.logger,b+":"),A.warn=L.logger.warn.bind(L.logger,b+":"),A.hls=_,A.fragmentLoader=new s.default(_.config),A.fragmentTracker=f,A.config=_.config,A.decrypter=new i.default(_,_.config),_.on(x.Events.KEY_LOADED,A.onKeyLoaded,g(A)),A}var c=d.prototype;return c.doTick=function(){this.onTickEnd()},c.onTickEnd=function(){},c.startLoad=function(f){},c.stopLoad=function(){this.fragmentLoader.abort();var f=this.fragCurrent;f&&this.fragmentTracker.removeFragment(f),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=v.STOPPED},c._streamEnded=function(f,b){var A=this.fragCurrent,O=this.fragmentTracker;if(!b.live&&A&&A.sn===b.endSN&&!f.nextStart){var C=O.getState(A);return C===R.FragmentState.PARTIAL||C===R.FragmentState.OK}return!1},c.onMediaAttached=function(f,b){var A=this.media=this.mediaBuffer=b.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),A.addEventListener("seeking",this.onvseeking),A.addEventListener("ended",this.onvended);var O=this.config;this.levels&&O.autoStartLoad&&this.state===v.STOPPED&&this.startLoad(O.startPosition)},c.onMediaDetaching=function(){var f=this.media;f!=null&&f.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),f&&(f.removeEventListener("seeking",this.onvseeking),f.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},c.onMediaSeeking=function(){var f=this.config,b=this.fragCurrent,A=this.media,O=this.mediaBuffer,C=this.state,P=A?A.currentTime:0,k=D.BufferHelper.bufferInfo(O||A,P,f.maxBufferHole);if(this.log("media seeking to "+(Object(N.isFiniteNumber)(P)?P.toFixed(3):P)+", state: "+C),C===v.ENDED)this.resetLoadingState();else if(b&&!k.len){var I=f.maxFragLookUpTolerance,U=b.start-I,H=b.start+b.duration+I,Z=P>H;(P<U||Z)&&(Z&&b.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),b.loader.abort()),this.resetLoadingState())}A&&(this.lastCurrentTime=P),!this.loadedmetadata&&!k.len&&(this.nextLoadPosition=this.startPosition=P),this.tickImmediate()},c.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},c.onKeyLoaded=function(f,b){if(this.state!==v.KEY_LOADING||b.frag!==this.fragCurrent||!this.levels)return;this.state=v.IDLE;var A=this.levels[b.frag.level].details;A&&this.loadFragment(b.frag,A,b.frag.start)},c.onHandlerDestroying=function(){this.stopLoad(),u.prototype.onHandlerDestroying.call(this)},c.onHandlerDestroyed=function(){this.state=v.STOPPED,this.hls.off(x.Events.KEY_LOADED,this.onKeyLoaded,this),this.fragmentLoader&&this.fragmentLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.fragmentLoader=this.fragmentTracker=null,u.prototype.onHandlerDestroyed.call(this)},c.loadKey=function(f,b){this.log("Loading key for "+f.sn+" of ["+b.startSN+"-"+b.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+f.level),this.state=v.KEY_LOADING,this.fragCurrent=f,this.hls.trigger(x.Events.KEY_LOADING,{frag:f})},c.loadFragment=function(f,b,A){this._loadFragForPlayback(f,b,A)},c._loadFragForPlayback=function(f,b,A){var O=this,C=function(k){if(O.fragContextChanged(f)){O.warn("Fragment "+f.sn+(k.part?" p: "+k.part.index:"")+" of level "+f.level+" was dropped during download."),O.fragmentTracker.removeFragment(f);return}f.stats.chunkCount++,O._handleFragmentLoadProgress(k)};this._doFragLoad(f,b,A,C).then(function(P){if(!P)return;O.fragLoadError=0;var k=O.state;if(O.fragContextChanged(f)){(k===v.FRAG_LOADING||k===v.BACKTRACKING||!O.fragCurrent&&k===v.PARSING)&&(O.fragmentTracker.removeFragment(f),O.state=v.IDLE);return}if("payload"in P&&(O.log("Loaded fragment "+f.sn+" of level "+f.level),O.hls.trigger(x.Events.FRAG_LOADED,P),O.state===v.BACKTRACKING)){O.fragmentTracker.backtrack(f,P),O.resetFragmentLoading(f);return}O._handleFragmentLoadComplete(P)}).catch(function(P){O.warn(P),O.resetFragmentLoading(f)})},c.flushMainBuffer=function(f,b,A){if(A===void 0&&(A=null),!(f-b))return;var O={startOffset:f,endOffset:b,type:A};this.fragLoadError=0,this.hls.trigger(x.Events.BUFFER_FLUSHING,O)},c._loadInitSegment=function(f){var b=this;this._doFragLoad(f).then(function(A){if(!A||b.fragContextChanged(f)||!b.levels)throw new Error("init load aborted");return A}).then(function(A){var O=b.hls,C=A.payload,P=f.decryptdata;if(C&&C.byteLength>0&&P&&P.key&&P.iv&&P.method==="AES-128"){var k=self.performance.now();return b.decrypter.webCryptoDecrypt(new Uint8Array(C),P.key.buffer,P.iv.buffer).then(function(I){var U=self.performance.now();return O.trigger(x.Events.FRAG_DECRYPTED,{frag:f,payload:I,stats:{tstart:k,tdecrypt:U}}),A.payload=I,A})}return A}).then(function(A){var O=b.fragCurrent,C=b.hls,P=b.levels;if(!P)throw new Error("init load aborted, missing levels");var k=P[f.level].details;console.assert(k,"Level details are defined when init segment is loaded");var I=f.stats;b.state=v.IDLE,b.fragLoadError=0,f.data=new Uint8Array(A.payload),I.parsing.start=I.buffering.start=self.performance.now(),I.parsing.end=I.buffering.end=self.performance.now(),A.frag===O&&C.trigger(x.Events.FRAG_BUFFERED,{stats:I,frag:O,part:null,id:f.type}),b.tick()}).catch(function(A){b.warn(A),b.resetFragmentLoading(f)})},c.fragContextChanged=function(f){var b=this.fragCurrent;return!f||!b||f.level!==b.level||f.sn!==b.sn||f.urlId!==b.urlId},c.fragBufferedComplete=function(f,b){var A=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+f.type+" sn: "+f.sn+(b?" part: "+b.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+f.level+" "+e.default.toString(D.BufferHelper.getBuffered(A))),this.state=v.IDLE,this.tick()},c._handleFragmentLoadComplete=function(f){var b=this.transmuxer;if(!b)return;var A=f.frag,O=f.part,C=f.partsLoaded,P=!C||C.length===0||C.some(function(I){return!I}),k=new m.ChunkMetadata(A.level,A.sn,A.stats.chunkCount+1,0,O?O.index:-1,!P);b.flush(k)},c._handleFragmentLoadProgress=function(f){},c._doFragLoad=function(f,b,A,O){var C=this;if(A===void 0&&(A=null),!this.levels)throw new Error("frag load aborted, missing levels");if(A=Math.max(f.start,A||0),this.config.lowLatencyMode&&b){var P=b.partList;if(P&&O){A>f.end&&b.fragmentHint&&(f=b.fragmentHint);var k=this.getNextPart(P,f,A);if(k>-1){var I=P[k];return this.log("Loading part sn: "+f.sn+" p: "+I.index+" cc: "+f.cc+" of playlist ["+b.startSN+"-"+b.endSN+"] parts [0-"+k+"-"+(P.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+f.level+", target: "+parseFloat(A.toFixed(3))),this.nextLoadPosition=I.start+I.duration,this.state=v.FRAG_LOADING,this.hls.trigger(x.Events.FRAG_LOADING,{frag:f,part:P[k],targetBufferTime:A}),this.doFragPartsLoad(f,P,k,O).catch(function(U){return C.handleFragLoadError(U)})}else if(!f.url||this.loadedEndOfParts(P,A))return Promise.resolve(null)}}return this.log("Loading fragment "+f.sn+" cc: "+f.cc+" "+(b?"of ["+b.startSN+"-"+b.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+f.level+", target: "+parseFloat(A.toFixed(3))),Object(N.isFiniteNumber)(f.sn)&&!this.bitrateTest&&(this.nextLoadPosition=f.start+f.duration),this.state=v.FRAG_LOADING,this.hls.trigger(x.Events.FRAG_LOADING,{frag:f,targetBufferTime:A}),this.fragmentLoader.load(f,O).catch(function(U){return C.handleFragLoadError(U)})},c.doFragPartsLoad=function(f,b,A,O){var C=this;return new Promise(function(P,k){var I=[],U=function H(Z){var $=b[Z];C.fragmentLoader.loadPart(f,$,O).then(function(ee){I[$.index]=ee;var te=ee.part;C.hls.trigger(x.Events.FRAG_LOADED,ee);var K=b[Z+1];if(K&&K.fragment===f)H(Z+1);else return P({frag:f,part:te,partsLoaded:I})}).catch(k)};U(A)})},c.handleFragLoadError=function(f){var b=f.data;return b&&b.details===T.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(b.frag,b.part):this.hls.trigger(x.Events.ERROR,b),null},c._handleTransmuxerFlush=function(f){var b=this.getCurrentContext(f);if(!b||this.state!==v.PARSING){this.fragCurrent||(this.state=v.IDLE);return}var A=b.frag,O=b.part,C=b.level,P=self.performance.now();A.stats.parsing.end=P,O&&(O.stats.parsing.end=P),this.updateLevelTiming(A,O,C,f.partial)},c.getCurrentContext=function(f){var b=this.levels,A=f.level,O=f.sn,C=f.part;if(!b||!b[A])return this.warn("Levels object was unset while buffering fragment "+O+" of level "+A+". The current chunk will not be buffered."),null;var P=b[A],k=C>-1?Object(n.getPartWith)(P,O,C):null,I=k?k.fragment:Object(n.getFragmentWithSN)(P,O,this.fragCurrent);return I?{frag:I,part:k,level:P}:null},c.bufferFragmentData=function(f,b,A,O){if(!f||this.state!==v.PARSING)return;var C=f.data1,P=f.data2,k=C;if(C&&P&&(k=Object(p.appendUint8Array)(C,P)),!k||!k.length)return;var I={type:f.type,frag:b,part:A,chunkMeta:O,parent:b.type,data:k};this.hls.trigger(x.Events.BUFFER_APPENDING,I),f.dropped&&f.independent&&!A&&this.flushBufferGap(b)},c.flushBufferGap=function(f){var b=this.media;if(!b)return;if(!D.BufferHelper.isBuffered(b,b.currentTime)){this.flushMainBuffer(0,f.start);return}var A=b.currentTime,O=D.BufferHelper.bufferInfo(b,A,0),C=f.duration,P=Math.min(this.config.maxFragLookUpTolerance*2,C*.25),k=Math.max(Math.min(f.start-P,O.end-P),A+P);f.start-k>P&&this.flushMainBuffer(k,f.start)},c.getFwdBufferInfo=function(f,b){var A=this.config,O=this.getLoadPosition();if(!Object(N.isFiniteNumber)(O))return null;var C=D.BufferHelper.bufferInfo(f,O,A.maxBufferHole);if(C.len===0&&C.nextStart!==void 0){var P=this.fragmentTracker.getBufferedFrag(O,b);if(P&&C.nextStart<P.end)return D.BufferHelper.bufferInfo(f,O,Math.max(C.nextStart,A.maxBufferHole))}return C},c.getMaxBufferLength=function(f){var b=this.config,A;return f?A=Math.max(8*b.maxBufferSize/f,b.maxBufferLength):A=b.maxBufferLength,Math.min(A,b.maxMaxBufferLength)},c.reduceMaxBufferLength=function(f){var b=this.config,A=f||b.maxBufferLength;return b.maxMaxBufferLength>=A?(b.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+b.maxMaxBufferLength+"s"),!0):!1},c.getNextFragment=function(f,b){var A,O,C=b.fragments,P=C.length;if(!P)return null;var k=this.config,I=C[0].start,U;if(b.live){var H=k.initialLiveManifestSize;if(P<H)return this.warn("Not enough fragments to start playback (have: "+P+", need: "+H+")"),null;!b.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(U=this.getInitialLiveFragment(b,C),this.startPosition=U?this.hls.liveSyncPosition||U.start:f)}else f<=I&&(U=C[0]);if(!U){var Z=k.lowLatencyMode?b.partEnd:b.fragmentEnd;U=this.getFragmentAtPosition(f,Z,b)}return(A=U)!==null&&A!==void 0&&A.initSegment&&!((O=U)!==null&&O!==void 0&&O.initSegment.data)&&!this.bitrateTest&&(U=U.initSegment),U},c.getNextPart=function(f,b,A){for(var O=-1,C=!1,P=!0,k=0,I=f.length;k<I;k++){var U=f[k];if(P=P&&!U.independent,O>-1&&A<U.start)break;var H=U.loaded;!H&&(C||U.independent||P)&&U.fragment===b&&(O=k),C=H}return O},c.loadedEndOfParts=function(f,b){var A=f[f.length-1];return A&&b>A.start&&A.loaded},c.getInitialLiveFragment=function(f,b){var A=this.fragPrevious,O=null;if(A){if(f.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+A.programDateTime),O=Object(a.findFragmentByPDT)(b,A.endProgramDateTime,this.config.maxFragLookUpTolerance)),!O){var C=A.sn+1;if(C>=f.startSN&&C<=f.endSN){var P=b[C-f.startSN];A.cc===P.cc&&(O=P,this.log("Live playlist, switching playlist, load frag with next SN: "+O.sn))}O||(O=Object(a.findFragWithCC)(b,A.cc),O&&this.log("Live playlist, switching playlist, load frag with same CC: "+O.sn))}}else{var k=this.hls.liveSyncPosition;k!==null&&(O=this.getFragmentAtPosition(k,this.bitrateTest?f.fragmentEnd:f.edge,f))}return O},c.getFragmentAtPosition=function(f,b,A){var O=this.config,C=this.fragPrevious,P=A.fragments,k=A.endSN,I=A.fragmentHint,U=O.maxFragLookUpTolerance,H=!!(O.lowLatencyMode&&A.partList&&I);H&&I&&!this.bitrateTest&&(P=P.concat(I),k=I.sn);var Z;if(f<b){var $=f>b-U?0:U;Z=Object(a.findFragmentByPTS)(C,P,f,$)}else Z=P[P.length-1];if(Z){var ee=Z.sn-A.startSN,te=C&&Z.level===C.level,K=P[ee+1],W=this.fragmentTracker.getState(Z);if(W===R.FragmentState.BACKTRACKED){Z=null;for(var X=ee;P[X]&&this.fragmentTracker.getState(P[X])===R.FragmentState.BACKTRACKED;)C?Z=P[X--]:Z=P[--X];Z||(Z=K)}else C&&Z.sn===C.sn&&!H&&(te&&(Z.sn<k&&this.fragmentTracker.getState(K)!==R.FragmentState.OK?(this.log("SN "+Z.sn+" just loaded, load next one: "+K.sn),Z=K):Z=null))}return Z},c.synchronizeToLiveEdge=function(f){var b=this.config,A=this.media;if(!A)return;var O=this.hls.liveSyncPosition,C=A.currentTime,P=f.fragments[0].start,k=f.edge,I=C>=P-b.maxFragLookUpTolerance&&C<=k;if(O!==null&&A.duration>O&&(C<O||!I)){var U=b.liveMaxLatencyDuration!==void 0?b.liveMaxLatencyDuration:b.liveMaxLatencyDurationCount*f.targetduration;(!I&&A.readyState<4||C<k-U)&&(this.loadedmetadata||(this.nextLoadPosition=O),A.readyState&&(this.warn("Playback: "+C.toFixed(3)+" is located too far from the end of live sliding playlist: "+k+", reset currentTime to : "+O.toFixed(3)),A.currentTime=O))}},c.alignPlaylists=function(f,b){var A=this.levels,O=this.levelLastLoaded,C=this.fragPrevious,P=O!==null?A[O]:null,k=f.fragments.length;if(!k)return this.warn("No fragments in live playlist"),0;var I=f.fragments[0].start,U=!b,H=f.alignedSliding&&Object(N.isFiniteNumber)(I);if(U||!H&&!I){Object(o.alignStream)(C,P,f);var Z=f.fragments[0].start;return this.log("Live playlist sliding: "+Z.toFixed(2)+" start-sn: "+(b?b.startSN:"na")+"->"+f.startSN+" prev-sn: "+(C?C.sn:"na")+" fragments: "+k),Z}return I},c.waitForCdnTuneIn=function(f){var b=3;return f.live&&f.canBlockReload&&f.tuneInGoal>Math.max(f.partHoldBack,f.partTarget*b)},c.setStartPosition=function(f,b){var A=this.startPosition;if(A<b&&(A=-1),A===-1||this.lastCurrentTime===-1){var O=f.startTimeOffset;Object(N.isFiniteNumber)(O)?(A=b+O,O<0&&(A+=f.totalduration),A=Math.min(Math.max(b,A),b+f.totalduration),this.log("Start time offset "+O+" found in playlist, adjust startPosition to "+A),this.startPosition=A):f.live?A=this.hls.liveSyncPosition||b:this.startPosition=A=0,this.lastCurrentTime=A}this.nextLoadPosition=A},c.getLoadPosition=function(){var f=this.media,b=0;return this.loadedmetadata&&f?b=f.currentTime:this.nextLoadPosition&&(b=this.nextLoadPosition),b},c.handleFragLoadAborted=function(f,b){this.transmuxer&&f.sn!=="initSegment"&&f.stats.aborted&&(this.warn("Fragment "+f.sn+(b?" part"+b.index:"")+" of level "+f.level+" was aborted"),this.resetFragmentLoading(f))},c.resetFragmentLoading=function(f){(!this.fragCurrent||!this.fragContextChanged(f))&&(this.state=v.IDLE)},c.onFragmentOrKeyLoadError=function(f,b){if(b.fatal)return;var A=b.frag;if(!A||A.type!==f)return;var O=this.fragCurrent;console.assert(O&&A.sn===O.sn&&A.level===O.level&&A.urlId===O.urlId,"Frag load error must match current frag to retry");var C=this.config;if(this.fragLoadError+1<=C.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(A.level))return;var P=Math.min(Math.pow(2,this.fragLoadError)*C.fragLoadingRetryDelay,C.fragLoadingMaxRetryTimeout);this.warn("Fragment "+A.sn+" of "+f+" "+A.level+" failed to load, retrying in "+P+"ms"),this.retryDate=self.performance.now()+P,this.fragLoadError++,this.state=v.FRAG_LOADING_WAITING_RETRY}else b.levelRetry?(f===t.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=v.IDLE):(L.logger.error(b.details+" reaches max retry, redispatch as fatal ..."),b.fatal=!0,this.hls.stopLoad(),this.state=v.ERROR)},c.afterBufferFlushed=function(f,b,A){if(!f)return;var O=D.BufferHelper.getBuffered(f);this.fragmentTracker.detectEvictedFragments(b,O,A),this.state===v.ENDED&&this.resetLoadingState()},c.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=v.IDLE},c.resetLiveStartWhenNotLoaded=function(f){if(!this.loadedmetadata){this.startFragRequested=!1;var b=this.levels?this.levels[f].details:null;if(b!=null&&b.live)return this.startPosition=-1,this.setStartPosition(b,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},c.updateLevelTiming=function(f,b,A,O){var C=this,P=A.details;console.assert(!!P,"level.details must be defined");var k=Object.keys(f.elementaryStreams).reduce(function(I,U){var H=f.elementaryStreams[U];if(H){var Z=H.endPTS-H.startPTS;if(Z<=0)return C.warn("Could not parse fragment "+f.sn+" "+U+" duration reliably ("+Z+") resetting transmuxer to fallback to playlist timing"),C.resetTransmuxer(),I||!1;var $=O?0:Object(n.updateFragPTSDTS)(P,f,H.startPTS,H.endPTS,H.startDTS,H.endDTS);return C.hls.trigger(x.Events.LEVEL_PTS_UPDATED,{details:P,level:A,drift:$,type:U,frag:f,start:H.startPTS,end:H.endPTS}),!0}return I},!1);k?(this.state=v.PARSED,this.hls.trigger(x.Events.FRAG_PARSED,{frag:f,part:b})):this.resetLoadingState()},c.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},E(d,[{key:"state",get:function(){return this._state},set:function(f){var b=this._state;b!==f&&(this._state=f,this.log(b+"->"+f))}}]),d}(w.default)},"./src/controller/buffer-controller.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"default",function(){return a});var N=S("./src/polyfills/number.ts"),w=S("./src/events.ts"),R=S("./src/utils/logger.ts"),D=S("./src/errors.ts"),L=S("./src/utils/buffer-helper.ts"),x=S("./src/utils/mediasource-helper.ts"),T=S("./src/loader/fragment.ts"),m=S("./src/controller/buffer-operation-queue.ts"),p=Object(x.getMediaSource)(),o=/([ha]vc.)(?:\.[^.,]+)+/,a=function(){function n(i){var e=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 t=e.hls,r=e.media,E=e.mediaSource;R.logger.log("[buffer-controller]: Media source opened"),r&&(e.updateMediaElementDuration(),t.trigger(w.Events.MEDIA_ATTACHED,{media:r})),E&&E.removeEventListener("sourceopen",e._onMediaSourceOpen),e.checkPendingTracks()},this._onMediaSourceClose=function(){R.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){R.logger.log("[buffer-controller]: Media source ended")},this.hls=i,this._initSourceBuffer(),this.registerListeners()}var s=n.prototype;return s.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},s.destroy=function(){this.unregisterListeners(),this.details=null},s.registerListeners=function(){var e=this.hls;e.on(w.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(w.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(w.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.on(w.Events.BUFFER_RESET,this.onBufferReset,this),e.on(w.Events.BUFFER_APPENDING,this.onBufferAppending,this),e.on(w.Events.BUFFER_CODECS,this.onBufferCodecs,this),e.on(w.Events.BUFFER_EOS,this.onBufferEos,this),e.on(w.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(w.Events.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(w.Events.FRAG_PARSED,this.onFragParsed,this),e.on(w.Events.FRAG_CHANGED,this.onFragChanged,this)},s.unregisterListeners=function(){var e=this.hls;e.off(w.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(w.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(w.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.off(w.Events.BUFFER_RESET,this.onBufferReset,this),e.off(w.Events.BUFFER_APPENDING,this.onBufferAppending,this),e.off(w.Events.BUFFER_CODECS,this.onBufferCodecs,this),e.off(w.Events.BUFFER_EOS,this.onBufferEos,this),e.off(w.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(w.Events.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(w.Events.FRAG_PARSED,this.onFragParsed,this),e.off(w.Events.FRAG_CHANGED,this.onFragChanged,this)},s._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new m.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},s.onManifestParsed=function(e,t){var r=2;(t.audio&&!t.video||!t.altAudio)&&(r=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=r,this.details=null,R.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},s.onMediaAttaching=function(e,t){var r=this.media=t.media;if(r&&p){var E=this.mediaSource=new p;E.addEventListener("sourceopen",this._onMediaSourceOpen),E.addEventListener("sourceended",this._onMediaSourceEnded),E.addEventListener("sourceclose",this._onMediaSourceClose),r.src=self.URL.createObjectURL(E),this._objectUrl=r.src}},s.onMediaDetaching=function(){var e=this.media,t=this.mediaSource,r=this._objectUrl;if(t){if(R.logger.log("[buffer-controller]: media source detaching"),t.readyState==="open")try{t.endOfStream()}catch(E){R.logger.warn("[buffer-controller]: onMediaDetaching: "+E.message+" while calling endOfStream")}this.onBufferReset(),t.removeEventListener("sourceopen",this._onMediaSourceOpen),t.removeEventListener("sourceended",this._onMediaSourceEnded),t.removeEventListener("sourceclose",this._onMediaSourceClose),e&&(r&&self.URL.revokeObjectURL(r),e.src===r?(e.removeAttribute("src"),e.load()):R.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(w.Events.MEDIA_DETACHED,void 0)},s.onBufferReset=function(){var e=this;this.getSourceBufferTypes().forEach(function(t){var r=e.sourceBuffer[t];try{r&&(e.removeBufferListeners(t),e.mediaSource&&e.mediaSource.removeSourceBuffer(r),e.sourceBuffer[t]=void 0)}catch(E){R.logger.warn("[buffer-controller]: Failed to reset the "+t+" buffer",E)}}),this._initSourceBuffer()},s.onBufferCodecs=function(e,t){var r=this,E=this.getSourceBufferTypes().length;if(Object.keys(t).forEach(function(g){if(E){var h=r.tracks[g];if(h&&typeof h.buffer.changeType=="function"){var y=t[g],v=y.codec,l=y.levelCodec,u=y.container,d=(h.levelCodec||h.codec).replace(o,"$1"),c=(l||v).replace(o,"$1");if(d!==c){var _=u+";codecs="+(l||v);r.appendChangeType(g,_)}}}else r.pendingTracks[g]=t[g]}),E)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},s.appendChangeType=function(e,t){var r=this,E=this.operationQueue,g={execute:function(){var y=r.sourceBuffer[e];y&&(R.logger.log("[buffer-controller]: changing "+e+" sourceBuffer type to "+t),y.changeType(t)),E.shiftAndExecuteNext(e)},onStart:function(){},onComplete:function(){},onError:function(y){R.logger.warn("[buffer-controller]: Failed to change "+e+" SourceBuffer type",y)}};E.append(g,e)},s.onBufferAppending=function(e,t){var r=this,E=this.hls,g=this.operationQueue,h=this.tracks,y=t.data,v=t.type,l=t.frag,u=t.part,d=t.chunkMeta,c=d.buffering[v],_=self.performance.now();c.start=_;var f=l.stats.buffering,b=u?u.stats.buffering:null;f.start===0&&(f.start=_),b&&b.start===0&&(b.start=_);var A=h.audio,O=v==="audio"&&d.id===1&&(A==null?void 0:A.container)==="audio/mpeg",C={execute:function(){if(c.executeStart=self.performance.now(),O){var k=r.sourceBuffer[v];if(k){var I=l.start-k.timestampOffset;Math.abs(I)>=.1&&(R.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+l.start+" (delta: "+I+") sn: "+l.sn+")"),k.timestampOffset=l.start)}}r.appendExecutor(y,v)},onStart:function(){},onComplete:function(){var k=self.performance.now();c.executeEnd=c.end=k,f.first===0&&(f.first=k),b&&b.first===0&&(b.first=k);var I=r.sourceBuffer,U={};for(var H in I)U[H]=L.BufferHelper.getBuffered(I[H]);r.appendError=0,r.hls.trigger(w.Events.BUFFER_APPENDED,{type:v,frag:l,part:u,chunkMeta:d,parent:l.type,timeRanges:U})},onError:function(k){R.logger.error("[buffer-controller]: Error encountered while trying to append to the "+v+" SourceBuffer",k);var I={type:D.ErrorTypes.MEDIA_ERROR,parent:l.type,details:D.ErrorDetails.BUFFER_APPEND_ERROR,err:k,fatal:!1};k.code===DOMException.QUOTA_EXCEEDED_ERR?I.details=D.ErrorDetails.BUFFER_FULL_ERROR:(r.appendError++,I.details=D.ErrorDetails.BUFFER_APPEND_ERROR,r.appendError>E.config.appendErrorMaxRetry&&(R.logger.error("[buffer-controller]: Failed "+E.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),I.fatal=!0)),E.trigger(w.Events.ERROR,I)}};g.append(C,v)},s.onBufferFlushing=function(e,t){var r=this,E=this.operationQueue,g=function(y){return{execute:r.removeExecutor.bind(r,y,t.startOffset,t.endOffset),onStart:function(){},onComplete:function(){r.hls.trigger(w.Events.BUFFER_FLUSHED,{type:y})},onError:function(l){R.logger.warn("[buffer-controller]: Failed to remove from "+y+" SourceBuffer",l)}}};t.type?E.append(g(t.type),t.type):this.getSourceBufferTypes().forEach(function(h){E.append(g(h),h)})},s.onFragParsed=function(e,t){var r=this,E=t.frag,g=t.part,h=[],y=g?g.elementaryStreams:E.elementaryStreams;y[T.ElementaryStreamTypes.AUDIOVIDEO]?h.push("audiovideo"):(y[T.ElementaryStreamTypes.AUDIO]&&h.push("audio"),y[T.ElementaryStreamTypes.VIDEO]&&h.push("video"));var v=function(){var u=self.performance.now();E.stats.buffering.end=u,g&&(g.stats.buffering.end=u);var d=g?g.stats:E.stats;r.hls.trigger(w.Events.FRAG_BUFFERED,{frag:E,part:g,stats:d,id:E.type})};h.length===0&&R.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+E.type+" level: "+E.level+" sn: "+E.sn),this.blockBuffers(v,h)},s.onFragChanged=function(e,t){this.flushBackBuffer()},s.onBufferEos=function(e,t){var r=this,E=this.getSourceBufferTypes().reduce(function(g,h){var y=r.sourceBuffer[h];return(!t.type||t.type===h)&&(y&&!y.ended&&(y.ended=!0,R.logger.log("[buffer-controller]: "+h+" sourceBuffer now EOS"))),g&&!!(!y||y.ended)},!0);E&&this.blockBuffers(function(){var g=r.mediaSource;if(!g||g.readyState!=="open")return;g.endOfStream()})},s.onLevelUpdated=function(e,t){var r=t.details;if(!r.fragments.length)return;this.details=r,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},s.flushBackBuffer=function(){var e=this.hls,t=this.details,r=this.media,E=this.sourceBuffer;if(!r||t===null)return;var g=this.getSourceBufferTypes();if(!g.length)return;var h=t.live&&e.config.liveBackBufferLength!==null?e.config.liveBackBufferLength:e.config.backBufferLength;if(!Object(N.isFiniteNumber)(h)||h<0)return;var y=r.currentTime,v=t.levelTargetDuration,l=Math.max(h,v),u=Math.floor(y/v)*v-l;g.forEach(function(d){var c=E[d];if(c){var _=L.BufferHelper.getBuffered(c);_.length>0&&u>_.start(0)&&(e.trigger(w.Events.BACK_BUFFER_REACHED,{bufferEnd:u}),t.live&&e.trigger(w.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:u}),e.trigger(w.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:u,type:d}))}})},s.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var e=this.details,t=this.hls,r=this.media,E=this.mediaSource,g=e.fragments[0].start+e.totalduration,h=r.duration,y=Object(N.isFiniteNumber)(E.duration)?E.duration:0;e.live&&t.config.liveDurationInfinity?(R.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),E.duration=Infinity,this.updateSeekableRange(e)):(g>y&&g>h||!Object(N.isFiniteNumber)(h))&&(R.logger.log("[buffer-controller]: Updating Media Source duration to "+g.toFixed(3)),E.duration=g)},s.updateSeekableRange=function(e){var t=this.mediaSource,r=e.fragments,E=r.length;if(E&&e.live&&t!==null&&t!==void 0&&t.setLiveSeekableRange){var g=Math.max(0,r[0].start),h=Math.max(g,g+e.totalduration);t.setLiveSeekableRange(g,h)}},s.checkPendingTracks=function(){var e=this.bufferCodecEventsExpected,t=this.operationQueue,r=this.pendingTracks,E=Object.keys(r).length;if(E&&!e||E===2){this.createSourceBuffers(r),this.pendingTracks={};var g=this.getSourceBufferTypes();if(g.length===0){this.hls.trigger(w.Events.ERROR,{type:D.ErrorTypes.MEDIA_ERROR,details:D.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}g.forEach(function(h){t.executeNext(h)})}},s.createSourceBuffers=function(e){var t=this.sourceBuffer,r=this.mediaSource;if(!r)throw Error("createSourceBuffers called when mediaSource was null");var E=0;for(var g in e)if(!t[g]){var h=e[g];if(!h)throw Error("source buffer exists for track "+g+", however track does not");var y=h.levelCodec||h.codec,v=h.container+";codecs="+y;R.logger.log("[buffer-controller]: creating sourceBuffer("+v+")");try{var l=t[g]=r.addSourceBuffer(v),u=g;this.addBufferListener(u,"updatestart",this._onSBUpdateStart),this.addBufferListener(u,"updateend",this._onSBUpdateEnd),this.addBufferListener(u,"error",this._onSBUpdateError),this.tracks[g]={buffer:l,codec:y,container:h.container,levelCodec:h.levelCodec,id:h.id},E++}catch(d){R.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+d.message),this.hls.trigger(w.Events.ERROR,{type:D.ErrorTypes.MEDIA_ERROR,details:D.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:d,mimeType:v})}}E&&this.hls.trigger(w.Events.BUFFER_CREATED,{tracks:this.tracks})},s._onSBUpdateStart=function(e){var t=this.operationQueue,r=t.current(e);r.onStart()},s._onSBUpdateEnd=function(e){var t=this.operationQueue,r=t.current(e);r.onComplete(),t.shiftAndExecuteNext(e)},s._onSBUpdateError=function(e,t){R.logger.error("[buffer-controller]: "+e+" SourceBuffer error",t),this.hls.trigger(w.Events.ERROR,{type:D.ErrorTypes.MEDIA_ERROR,details:D.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var r=this.operationQueue.current(e);r&&r.onError(t)},s.removeExecutor=function(e,t,r){var E=this.media,g=this.mediaSource,h=this.operationQueue,y=this.sourceBuffer,v=y[e];if(!E||!g||!v){R.logger.warn("[buffer-controller]: Attempting to remove from the "+e+" SourceBuffer, but it does not exist"),h.shiftAndExecuteNext(e);return}var l=Object(N.isFiniteNumber)(E.duration)?E.duration:Infinity,u=Object(N.isFiniteNumber)(g.duration)?g.duration:Infinity,d=Math.max(0,t),c=Math.min(r,l,u);c>d?(R.logger.log("[buffer-controller]: Removing ["+d+","+c+"] from the "+e+" SourceBuffer"),console.assert(!v.updating,e+" sourceBuffer must not be updating"),v.remove(d,c)):h.shiftAndExecuteNext(e)},s.appendExecutor=function(e,t){var r=this.operationQueue,E=this.sourceBuffer,g=E[t];if(!g){R.logger.warn("[buffer-controller]: Attempting to append to the "+t+" SourceBuffer, but it does not exist"),r.shiftAndExecuteNext(t);return}g.ended=!1,console.assert(!g.updating,t+" sourceBuffer must not be updating"),g.appendBuffer(e)},s.blockBuffers=function(e,t){var r=this;if(t===void 0&&(t=this.getSourceBufferTypes()),!t.length){R.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(e);return}var E=this.operationQueue,g=t.map(function(h){return E.appendBlocker(h)});Promise.all(g).then(function(){e(),t.forEach(function(h){var y=r.sourceBuffer[h];(!y||!y.updating)&&E.shiftAndExecuteNext(h)})})},s.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},s.addBufferListener=function(e,t,r){var E=this.sourceBuffer[e];if(!E)return;var g=r.bind(this,e);this.listeners[e].push({event:t,listener:g}),E.addEventListener(t,g)},s.removeBufferListeners=function(e){var t=this.sourceBuffer[e];if(!t)return;this.listeners[e].forEach(function(r){t.removeEventListener(r.event,r.listener)})},n}()},"./src/controller/buffer-operation-queue.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"default",function(){return w});var N=S("./src/utils/logger.ts"),w=function(){function R(L){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=L}var D=R.prototype;return D.append=function(x,T){var m=this.queues[T];m.push(x),m.length===1&&this.buffers[T]&&this.executeNext(T)},D.insertAbort=function(x,T){var m=this.queues[T];m.unshift(x),this.executeNext(T)},D.appendBlocker=function(x){var T,m=new Promise(function(o){T=o}),p={execute:T,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(p,x),m},D.executeNext=function(x){var T=this.buffers,m=this.queues,p=T[x],o=m[x];if(o.length){var a=o[0];try{a.execute()}catch(n){N.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),a.onError(n),(!p||!p.updating)&&(o.shift(),this.executeNext(x))}}},D.shiftAndExecuteNext=function(x){this.queues[x].shift(),this.executeNext(x)},D.current=function(x){return this.queues[x][0]},R}()},"./src/controller/cap-level-controller.ts":function(ae,M,S){"use strict";S.r(M);var N=S("./src/events.ts");function w(L,x){for(var T=0;T<x.length;T++){var m=x[T];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(L,m.key,m)}}function R(L,x,T){return x&&w(L.prototype,x),T&&w(L,T),L}var D=function(){function L(T){this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.hls=void 0,this.streamController=void 0,this.clientRect=void 0,this.hls=T,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var x=L.prototype;return x.setStreamController=function(m){this.streamController=m},x.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},x.registerListeners=function(){var m=this.hls;m.on(N.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),m.on(N.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),m.on(N.Events.MANIFEST_PARSED,this.onManifestParsed,this),m.on(N.Events.BUFFER_CODECS,this.onBufferCodecs,this),m.on(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},x.unregisterListener=function(){var m=this.hls;m.off(N.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),m.off(N.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),m.off(N.Events.MANIFEST_PARSED,this.onManifestParsed,this),m.off(N.Events.BUFFER_CODECS,this.onBufferCodecs,this),m.off(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},x.onFpsDropLevelCapping=function(m,p){L.isLevelAllowed(p.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(p.droppedLevel)},x.onMediaAttaching=function(m,p){this.media=p.media instanceof HTMLVideoElement?p.media:null},x.onManifestParsed=function(m,p){var o=this.hls;this.restrictedLevels=[],this.firstLevel=p.firstLevel,o.config.capLevelToPlayerSize&&p.video&&this.startCapping()},x.onBufferCodecs=function(m,p){var o=this.hls;o.config.capLevelToPlayerSize&&p.video&&this.startCapping()},x.onMediaDetaching=function(){this.stopCapping()},x.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var m=this.hls.levels;if(m.length){var p=this.hls;p.autoLevelCapping=this.getMaxLevel(m.length-1),p.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=p.autoLevelCapping}}},x.getMaxLevel=function(m){var p=this,o=this.hls.levels;if(!o.length)return-1;var a=o.filter(function(n,s){return L.isLevelAllowed(s,p.restrictedLevels)&&s<=m});return this.clientRect=null,L.getMaxLevelByMediaSize(a,this.mediaWidth,this.mediaHeight)},x.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()},x.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},x.getDimensions=function(){if(this.clientRect)return this.clientRect;var m=this.media,p={width:0,height:0};if(m){var o=m.getBoundingClientRect();p.width=o.width,p.height=o.height,!p.width&&!p.height&&(p.width=o.right-o.left||m.width||0,p.height=o.bottom-o.top||m.height||0)}return this.clientRect=p,p},L.isLevelAllowed=function(m,p){return p===void 0&&(p=[]),p.indexOf(m)===-1},L.getMaxLevelByMediaSize=function(m,p,o){if(!m||!m.length)return-1;for(var a=function(t,r){return r?t.width!==r.width||t.height!==r.height:!0},n=m.length-1,s=0;s<m.length;s+=1){var i=m[s];if((i.width>=p||i.height>=o)&&a(i,m[s+1])){n=s;break}}return n},R(L,[{key:"mediaWidth",get:function(){return this.getDimensions().width*L.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*L.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var m=1;try{m=self.devicePixelRatio}catch(p){}return m}}]),L}();M.default=D},"./src/controller/cmcd-controller.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"default",function(){return a});var N=S("./src/events.ts"),w=S("./src/types/cmcd.ts"),R=S("./src/utils/buffer-helper.ts"),D=S("./src/utils/logger.ts");function L(n,s){for(var i=0;i<s.length;i++){var e=s[i];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(n,e.key,e)}}function x(n,s,i){return s&&L(n.prototype,s),i&&L(n,i),n}function T(n,s){var i=typeof Symbol!="undefined"&&n[Symbol.iterator]||n["@@iterator"];if(i)return(i=i.call(n)).next.bind(i);if(Array.isArray(n)||(i=m(n))||s&&n&&typeof n.length=="number"){i&&(n=i);var e=0;return function(){return e>=n.length?{done:!0}:{done:!1,value:n[e++]}}}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 m(n,s){if(!n)return;if(typeof n=="string")return p(n,s);var i=Object.prototype.toString.call(n).slice(8,-1);if(i==="Object"&&n.constructor&&(i=n.constructor.name),i==="Map"||i==="Set")return Array.from(n);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return p(n,s)}function p(n,s){(s==null||s>n.length)&&(s=n.length);for(var i=0,e=new Array(s);i<s;i++)e[i]=n[i];return e}function o(){return o=Object.assign||function(n){for(var s=1;s<arguments.length;s++){var i=arguments[s];for(var e in i)Object.prototype.hasOwnProperty.call(i,e)&&(n[e]=i[e])}return n},o.apply(this,arguments)}var a=function(){function n(i){var e=this;this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=function(){e.initialized&&(e.starved=!0),e.buffering=!0},this.onPlaying=function(){e.initialized||(e.initialized=!0),e.buffering=!1},this.applyPlaylistData=function(E){try{e.apply(E,{ot:w.CMCDObjectType.MANIFEST,su:!e.initialized})}catch(g){D.logger.warn("Could not generate manifest CMCD data.",g)}},this.applyFragmentData=function(E){try{var g=E.frag,h=e.hls.levels[g.level],y=e.getObjectType(g),v={d:g.duration*1e3,ot:y};(y===w.CMCDObjectType.VIDEO||y===w.CMCDObjectType.AUDIO||y==w.CMCDObjectType.MUXED)&&(v.br=h.bitrate/1e3,v.tb=e.getTopBandwidth(y),v.bl=e.getBufferLength(y)),e.apply(E,v)}catch(l){D.logger.warn("Could not generate segment CMCD data.",l)}},this.hls=i;var t=this.config=i.config,r=t.cmcd;r!=null&&(t.pLoader=this.createPlaylistLoader(),t.fLoader=this.createFragmentLoader(),this.sid=r.sessionId||n.uuid(),this.cid=r.contentId,this.useHeaders=r.useHeaders===!0,this.registerListeners())}var s=n.prototype;return s.registerListeners=function(){var e=this.hls;e.on(N.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(N.Events.MEDIA_DETACHED,this.onMediaDetached,this),e.on(N.Events.BUFFER_CREATED,this.onBufferCreated,this)},s.unregisterListeners=function(){var e=this.hls;e.off(N.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(N.Events.MEDIA_DETACHED,this.onMediaDetached,this),e.off(N.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},s.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},s.onMediaAttached=function(e,t){this.media=t.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},s.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},s.onBufferCreated=function(e,t){var r,E;this.audioBuffer=(r=t.tracks.audio)===null||r===void 0?void 0:r.buffer,this.videoBuffer=(E=t.tracks.video)===null||E===void 0?void 0:E.buffer},s.createData=function(){var e;return{v:w.CMCDVersion,sf:w.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(e=this.media)===null||e===void 0?void 0:e.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},s.apply=function(e,t){t===void 0&&(t={}),o(t,this.createData());var r=t.ot===w.CMCDObjectType.INIT||t.ot===w.CMCDObjectType.VIDEO||t.ot===w.CMCDObjectType.MUXED;if(this.starved&&r&&(t.bs=!0,t.su=!0,this.starved=!1),t.su==null&&(t.su=this.buffering),this.useHeaders){var E=n.toHeaders(t);if(!Object.keys(E).length)return;e.headers||(e.headers={}),o(e.headers,E)}else{var g=n.toQuery(t);if(!g)return;e.url=n.appendQueryToUri(e.url,g)}},s.getObjectType=function(e){var t=e.type;return t==="subtitle"?w.CMCDObjectType.TIMED_TEXT:e.sn==="initSegment"?w.CMCDObjectType.INIT:t==="audio"?w.CMCDObjectType.AUDIO:t==="main"?this.hls.audioTracks.length?w.CMCDObjectType.VIDEO:w.CMCDObjectType.MUXED:void 0},s.getTopBandwidth=function(e){for(var t=0,r=e===w.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,E=T(r),g;!(g=E()).done;){var h=g.value;h.bitrate>t&&(t=h.bitrate)}return t>0?t:NaN},s.getBufferLength=function(e){var t=this.hls.media,r=e===w.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!r||!t)return NaN;var E=R.BufferHelper.bufferInfo(r,t.currentTime,this.config.maxBufferHole);return E.len*1e3},s.createPlaylistLoader=function(){var e=this.config.pLoader,t=this.applyPlaylistData,r=e||this.config.loader;return function(){function E(h){this.loader=void 0,this.loader=new r(h)}var g=E.prototype;return g.destroy=function(){this.loader.destroy()},g.abort=function(){this.loader.abort()},g.load=function(y,v,l){t(y),this.loader.load(y,v,l)},x(E,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),E}()},s.createFragmentLoader=function(){var e=this.config.fLoader,t=this.applyFragmentData,r=e||this.config.loader;return function(){function E(h){this.loader=void 0,this.loader=new r(h)}var g=E.prototype;return g.destroy=function(){this.loader.destroy()},g.abort=function(){this.loader.abort()},g.load=function(y,v,l){t(y),this.loader.load(y,v,l)},x(E,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),E}()},n.uuid=function(){var e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.substr(t.lastIndexOf("/")+1)},n.serialize=function(e){for(var t=[],r=function(O){return!Number.isNaN(O)&&O!=null&&O!==""&&O!==!1},E=function(O){return Math.round(O)},g=function(O){return E(O/100)*100},h=function(O){return encodeURIComponent(O)},y={br:E,d:E,bl:g,dl:g,mtp:g,nor:h,rtp:g,tb:E},v=Object.keys(e||{}).sort(),l=T(v),u;!(u=l()).done;){var d=u.value,c=e[d];if(!r(c))continue;if(d==="v"&&c===1)continue;if(d=="pr"&&c===1)continue;var _=y[d];_&&(c=_(c));var f=typeof c,b=void 0;d==="ot"||d==="sf"||d==="st"?b=d+"="+c:f==="boolean"?b=d:f==="number"?b=d+"="+c:b=d+"="+JSON.stringify(c),t.push(b)}return t.join(",")},n.toHeaders=function(e){for(var t=Object.keys(e),r={},E=["Object","Request","Session","Status"],g=[{},{},{},{}],h={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},y=0,v=t;y<v.length;y++){var l=v[y],u=h[l]!=null?h[l]:1;g[u][l]=e[l]}for(var d=0;d<g.length;d++){var c=n.serialize(g[d]);c&&(r["CMCD-"+E[d]]=c)}return r},n.toQuery=function(e){return"CMCD="+encodeURIComponent(n.serialize(e))},n.appendQueryToUri=function(e,t){if(!t)return e;var r=e.includes("?")?"&":"?";return""+e+r+t},n}()},"./src/controller/eme-controller.ts":function(ae,M,S){"use strict";S.r(M);var N=S("./src/events.ts"),w=S("./src/errors.ts"),R=S("./src/utils/logger.ts"),D=S("./src/utils/mediakeys-helper.ts");function L(a,n){for(var s=0;s<n.length;s++){var i=n[s];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(a,i.key,i)}}function x(a,n,s){return n&&L(a.prototype,n),s&&L(a,s),a}var T=3,m=function(n,s,i){var e={audioCapabilities:[],videoCapabilities:[]};return n.forEach(function(t){e.audioCapabilities.push({contentType:'audio/mp4; codecs="'+t+'"',robustness:i.audioRobustness||""})}),s.forEach(function(t){e.videoCapabilities.push({contentType:'video/mp4; codecs="'+t+'"',robustness:i.videoRobustness||""})}),[e]},p=function(n,s,i,e){switch(n){case D.KeySystems.WIDEVINE:return m(s,i,e);default:throw new Error("Unknown key-system: "+n)}},o=function(){function a(s){this.hls=void 0,this._widevineLicenseUrl=void 0,this._licenseXhrSetup=void 0,this._licenseResponseCallback=void 0,this._emeEnabled=void 0,this._requestMediaKeySystemAccess=void 0,this._drmSystemOptions=void 0,this._config=void 0,this._mediaKeysList=[],this._media=null,this._hasSetMediaKeys=!1,this._requestLicenseFailureCount=0,this.mediaKeysPromise=null,this._onMediaEncrypted=this.onMediaEncrypted.bind(this),this.hls=s,this._config=s.config,this._widevineLicenseUrl=this._config.widevineLicenseUrl,this._licenseXhrSetup=this._config.licenseXhrSetup,this._licenseResponseCallback=this._config.licenseResponseCallback,this._emeEnabled=this._config.emeEnabled,this._requestMediaKeySystemAccess=this._config.requestMediaKeySystemAccessFunc,this._drmSystemOptions=this._config.drmSystemOptions,this._registerListeners()}var n=a.prototype;return n.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},n._registerListeners=function(){this.hls.on(N.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(N.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(N.Events.MANIFEST_PARSED,this.onManifestParsed,this)},n._unregisterListeners=function(){this.hls.off(N.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(N.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(N.Events.MANIFEST_PARSED,this.onManifestParsed,this)},n.getLicenseServerUrl=function(i){switch(i){case D.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+i+'"')},n._attemptKeySystemAccess=function(i,e,t){var r=this,E=p(i,e,t,this._drmSystemOptions);R.logger.log("Requesting encrypted media key-system access");var g=this.requestMediaKeySystemAccess(i,E);this.mediaKeysPromise=g.then(function(h){return r._onMediaKeySystemAccessObtained(i,h)}),g.catch(function(h){R.logger.error('Failed to obtain key-system "'+i+'" access:',h)})},n._onMediaKeySystemAccessObtained=function(i,e){var t=this;R.logger.log('Access for key-system "'+i+'" obtained');var r={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:e,mediaKeySystemDomain:i};this._mediaKeysList.push(r);var E=Promise.resolve().then(function(){return e.createMediaKeys()}).then(function(g){return r.mediaKeys=g,R.logger.log('Media-keys created for key-system "'+i+'"'),t._onMediaKeysCreated(),g});return E.catch(function(g){R.logger.error("Failed to create media-keys:",g)}),E},n._onMediaKeysCreated=function(){var i=this;this._mediaKeysList.forEach(function(e){e.mediaKeysSession||(e.mediaKeysSession=e.mediaKeys.createSession(),i._onNewMediaKeySession(e.mediaKeysSession))})},n._onNewMediaKeySession=function(i){var e=this;R.logger.log("New key-system session "+i.sessionId),i.addEventListener("message",function(t){e._onKeySessionMessage(i,t.message)},!1)},n._onKeySessionMessage=function(i,e){R.logger.log("Got EME message event, creating license request"),this._requestLicense(e,function(t){R.logger.log("Received license data (length: "+(t&&t.byteLength)+"), updating key-session"),i.update(t)})},n.onMediaEncrypted=function(i){var e=this;if(R.logger.log('Media is encrypted using "'+i.initDataType+'" init data type'),!this.mediaKeysPromise){R.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(N.Events.ERROR,{type:w.ErrorTypes.KEY_SYSTEM_ERROR,details:w.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var t=function(E){if(!e._media)return;e._attemptSetMediaKeys(E),e._generateRequestWithPreferredKeySession(i.initDataType,i.initData)};this.mediaKeysPromise.then(t).catch(t)},n._attemptSetMediaKeys=function(i){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var e=this._mediaKeysList[0];if(!e||!e.mediaKeys){R.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(N.Events.ERROR,{type:w.ErrorTypes.KEY_SYSTEM_ERROR,details:w.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}R.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(e.mediaKeys),this._hasSetMediaKeys=!0}},n._generateRequestWithPreferredKeySession=function(i,e){var t=this,r=this._mediaKeysList[0];if(!r){R.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(N.Events.ERROR,{type:w.ErrorTypes.KEY_SYSTEM_ERROR,details:w.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(r.mediaKeysSessionInitialized){R.logger.warn("Key-Session already initialized but requested again");return}var E=r.mediaKeysSession;if(!E){R.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(N.Events.ERROR,{type:w.ErrorTypes.KEY_SYSTEM_ERROR,details:w.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!e){R.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(N.Events.ERROR,{type:w.ErrorTypes.KEY_SYSTEM_ERROR,details:w.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}R.logger.log('Generating key-session request for "'+i+'" init data type'),r.mediaKeysSessionInitialized=!0,E.generateRequest(i,e).then(function(){R.logger.debug("Key-session generation succeeded")}).catch(function(g){R.logger.error("Error generating key-session request:",g),t.hls.trigger(N.Events.ERROR,{type:w.ErrorTypes.KEY_SYSTEM_ERROR,details:w.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},n._createLicenseXhr=function(i,e,t){var r=new XMLHttpRequest;r.responseType="arraybuffer",r.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,r,i,e,t);var E=this._licenseXhrSetup;if(E)try{E.call(this.hls,r,i),E=void 0}catch(g){R.logger.error(g)}try{r.readyState||r.open("POST",i,!0),E&&E.call(this.hls,r,i)}catch(g){throw new Error("issue setting up KeySystem license XHR "+g)}return r},n._onLicenseRequestReadyStageChange=function(i,e,t,r){switch(i.readyState){case 4:if(i.status===200){this._requestLicenseFailureCount=0,R.logger.log("License request succeeded");var E=i.response,g=this._licenseResponseCallback;if(g)try{E=g.call(this.hls,i,e)}catch(y){R.logger.error(y)}r(E)}else{if(R.logger.error("License Request XHR failed ("+e+"). Status: "+i.status+" ("+i.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>T){this.hls.trigger(N.Events.ERROR,{type:w.ErrorTypes.KEY_SYSTEM_ERROR,details:w.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var h=T-this._requestLicenseFailureCount+1;R.logger.warn("Retrying license request, "+h+" attempts left"),this._requestLicense(t,r)}break}},n._generateLicenseRequestChallenge=function(i,e){switch(i.mediaKeySystemDomain){case D.KeySystems.WIDEVINE:return e}throw new Error("unsupported key-system: "+i.mediaKeySystemDomain)},n._requestLicense=function(i,e){R.logger.log("Requesting content license for key-system");var t=this._mediaKeysList[0];if(!t){R.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(N.Events.ERROR,{type:w.ErrorTypes.KEY_SYSTEM_ERROR,details:w.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var r=this.getLicenseServerUrl(t.mediaKeySystemDomain),E=this._createLicenseXhr(r,i,e);R.logger.log("Sending license request to URL: "+r);var g=this._generateLicenseRequestChallenge(t,i);E.send(g)}catch(h){R.logger.error("Failure requesting DRM license: "+h),this.hls.trigger(N.Events.ERROR,{type:w.ErrorTypes.KEY_SYSTEM_ERROR,details:w.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},n.onMediaAttached=function(i,e){if(!this._emeEnabled)return;var t=e.media;this._media=t,t.addEventListener("encrypted",this._onMediaEncrypted)},n.onMediaDetached=function(){var i=this._media,e=this._mediaKeysList;if(!i)return;i.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(e.map(function(t){if(t.mediaKeysSession)return t.mediaKeysSession.close().catch(function(){})})).then(function(){return i.setMediaKeys(null)}).catch(function(){})},n.onManifestParsed=function(i,e){if(!this._emeEnabled)return;var t=e.levels.map(function(E){return E.audioCodec}).filter(function(E){return!!E}),r=e.levels.map(function(E){return E.videoCodec}).filter(function(E){return!!E});this._attemptKeySystemAccess(D.KeySystems.WIDEVINE,t,r)},x(a,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),a}();M.default=o},"./src/controller/fps-controller.ts":function(ae,M,S){"use strict";S.r(M);var N=S("./src/events.ts"),w=S("./src/utils/logger.ts"),R=function(){function D(x){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=x,this.registerListeners()}var L=D.prototype;return L.setStreamController=function(T){this.streamController=T},L.registerListeners=function(){this.hls.on(N.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},L.unregisterListeners=function(){this.hls.off(N.Events.MEDIA_ATTACHING,this.onMediaAttaching)},L.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},L.onMediaAttaching=function(T,m){var p=this.hls.config;if(p.capLevelOnFPSDrop){var o=m.media instanceof self.HTMLVideoElement?m.media:null;this.media=o,o&&typeof o.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),p.fpsDroppedMonitoringPeriod)}},L.checkFPS=function(T,m,p){var o=performance.now();if(m){if(this.lastTime){var a=o-this.lastTime,n=p-this.lastDroppedFrames,s=m-this.lastDecodedFrames,i=1e3*n/a,e=this.hls;if(e.trigger(N.Events.FPS_DROP,{currentDropped:n,currentDecoded:s,totalDroppedFrames:p}),i>0&&n>e.config.fpsDroppedMonitoringThreshold*s){var t=e.currentLevel;w.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+t),t>0&&(e.autoLevelCapping===-1||e.autoLevelCapping>=t)&&(t=t-1,e.trigger(N.Events.FPS_DROP_LEVEL_CAPPING,{level:t,droppedLevel:e.currentLevel}),e.autoLevelCapping=t,this.streamController.nextLevelSwitch())}}this.lastTime=o,this.lastDroppedFrames=p,this.lastDecodedFrames=m}},L.checkFPSInterval=function(){var T=this.media;if(T)if(this.isVideoPlaybackQualityAvailable){var m=T.getVideoPlaybackQuality();this.checkFPS(T,m.totalVideoFrames,m.droppedVideoFrames)}else this.checkFPS(T,T.webkitDecodedFrameCount,T.webkitDroppedFrameCount)},D}();M.default=R},"./src/controller/fragment-finders.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"findFragmentByPDT",function(){return R}),S.d(M,"findFragmentByPTS",function(){return D}),S.d(M,"fragmentWithinToleranceTest",function(){return L}),S.d(M,"pdtWithinToleranceTest",function(){return x}),S.d(M,"findFragWithCC",function(){return T});var N=S("./src/polyfills/number.ts"),w=S("./src/utils/binary-search.ts");function R(m,p,o){if(p===null||!Array.isArray(m)||!m.length||!Object(N.isFiniteNumber)(p))return null;var a=m[0].programDateTime;if(p<(a||0))return null;var n=m[m.length-1].endProgramDateTime;if(p>=(n||0))return null;o=o||0;for(var s=0;s<m.length;++s){var i=m[s];if(x(p,o,i))return i}return null}function D(m,p,o,a){o===void 0&&(o=0),a===void 0&&(a=0);var n=null;if(m?n=p[m.sn-p[0].sn+1]||null:o===0&&p[0].start===0&&(n=p[0]),n&&L(o,a,n)===0)return n;var s=w.default.search(p,L.bind(null,o,a));return s||n}function L(m,p,o){m===void 0&&(m=0),p===void 0&&(p=0);var a=Math.min(p,o.duration+(o.deltaPTS?o.deltaPTS:0));return o.start+o.duration-a<=m?1:o.start-a>m&&o.start?-1:0}function x(m,p,o){var a=Math.min(p,o.duration+(o.deltaPTS?o.deltaPTS:0))*1e3,n=o.endProgramDateTime||0;return n-a>m}function T(m,p){return w.default.search(m,function(o){return o.cc<p?1:o.cc>p?-1:0})}},"./src/controller/fragment-tracker.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"FragmentState",function(){return R}),S.d(M,"FragmentTracker",function(){return D});var N=S("./src/events.ts"),w=S("./src/types/loader.ts"),R;(function(T){T.NOT_LOADED="NOT_LOADED",T.BACKTRACKED="BACKTRACKED",T.APPENDING="APPENDING",T.PARTIAL="PARTIAL",T.OK="OK"})(R||(R={}));var D=function(){function T(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 m=T.prototype;return m._registerListeners=function(){var o=this.hls;o.on(N.Events.BUFFER_APPENDED,this.onBufferAppended,this),o.on(N.Events.FRAG_BUFFERED,this.onFragBuffered,this),o.on(N.Events.FRAG_LOADED,this.onFragLoaded,this)},m._unregisterListeners=function(){var o=this.hls;o.off(N.Events.BUFFER_APPENDED,this.onBufferAppended,this),o.off(N.Events.FRAG_BUFFERED,this.onFragBuffered,this),o.off(N.Events.FRAG_LOADED,this.onFragLoaded,this)},m.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},m.getAppendedFrag=function(o,a){if(a===w.PlaylistLevelType.MAIN){var n=this.activeFragment,s=this.activeParts;if(!n)return null;if(s)for(var i=s.length;i--;){var e=s[i],t=e?e.end:n.appendedPTS;if(e.start<=o&&t!==void 0&&o<=t)return i>9&&(this.activeParts=s.slice(i-9)),e}else if(n.start<=o&&n.appendedPTS!==void 0&&o<=n.appendedPTS)return n}return this.getBufferedFrag(o,a)},m.getBufferedFrag=function(o,a){for(var n=this.fragments,s=Object.keys(n),i=s.length;i--;){var e=n[s[i]];if((e==null?void 0:e.body.type)===a&&e.buffered){var t=e.body;if(t.start<=o&&o<=t.end)return t}}return null},m.detectEvictedFragments=function(o,a,n){var s=this;Object.keys(this.fragments).forEach(function(i){var e=s.fragments[i];if(!e)return;if(!e.buffered){e.body.type===n&&s.removeFragment(e.body);return}var t=e.range[o];if(!t)return;t.time.some(function(r){var E=!s.isTimeBuffered(r.startPTS,r.endPTS,a);return E&&s.removeFragment(e.body),E})})},m.detectPartialFragments=function(o){var a=this,n=this.timeRanges,s=o.frag,i=o.part;if(!n||s.sn==="initSegment")return;var e=x(s),t=this.fragments[e];if(!t)return;Object.keys(n).forEach(function(r){var E=s.elementaryStreams[r];if(!E)return;var g=n[r],h=i!==null||E.partial===!0;t.range[r]=a.getBufferedTimes(s,i,h,g)}),t.backtrack=t.loaded=null,Object.keys(t.range).length?t.buffered=!0:this.removeFragment(t.body)},m.fragBuffered=function(o){var a=x(o),n=this.fragments[a];n&&(n.backtrack=n.loaded=null,n.buffered=!0)},m.getBufferedTimes=function(o,a,n,s){for(var i={time:[],partial:n},e=a?a.start:o.start,t=a?a.end:o.end,r=o.minEndPTS||t,E=o.maxStartPTS||e,g=0;g<s.length;g++){var h=s.start(g)-this.bufferPadding,y=s.end(g)+this.bufferPadding;if(E>=h&&r<=y){i.time.push({startPTS:Math.max(e,s.start(g)),endPTS:Math.min(t,s.end(g))});break}else if(e<y&&t>h)i.partial=!0,i.time.push({startPTS:Math.max(e,s.start(g)),endPTS:Math.min(t,s.end(g))});else if(t<=h)break}return i},m.getPartialFragment=function(o){var a=null,n,s,i,e=0,t=this.bufferPadding,r=this.fragments;return Object.keys(r).forEach(function(E){var g=r[E];if(!g)return;L(g)&&(s=g.body.start-t,i=g.body.end+t,o>=s&&o<=i&&(n=Math.min(o-s,i-o),e<=n&&(a=g.body,e=n)))}),a},m.getState=function(o){var a=x(o),n=this.fragments[a];return n?n.buffered?L(n)?R.PARTIAL:R.OK:n.backtrack?R.BACKTRACKED:R.APPENDING:R.NOT_LOADED},m.backtrack=function(o,a){var n=x(o),s=this.fragments[n];if(!s||s.backtrack)return null;var i=s.backtrack=a||s.loaded;return s.loaded=null,i},m.getBacktrackData=function(o){var a=x(o),n=this.fragments[a];if(n){var s,i=n.backtrack;if(i!=null&&(s=i.payload)!==null&&s!==void 0&&s.byteLength)return i;this.removeFragment(o)}return null},m.isTimeBuffered=function(o,a,n){for(var s,i,e=0;e<n.length;e++){if(s=n.start(e)-this.bufferPadding,i=n.end(e)+this.bufferPadding,o>=s&&a<=i)return!0;if(a<=s)return!1}return!1},m.onFragLoaded=function(o,a){var n=a.frag,s=a.part;if(n.sn==="initSegment"||n.bitrateTest||s)return;var i=x(n);this.fragments[i]={body:n,loaded:a,backtrack:null,buffered:!1,range:Object.create(null)}},m.onBufferAppended=function(o,a){var n=this,s=a.frag,i=a.part,e=a.timeRanges;if(s.type===w.PlaylistLevelType.MAIN)if(this.activeFragment=s,i){var t=this.activeParts;t||(this.activeParts=t=[]),t.push(i)}else this.activeParts=null;this.timeRanges=e,Object.keys(e).forEach(function(r){var E=e[r];if(n.detectEvictedFragments(r,E),!i)for(var g=0;g<E.length;g++)s.appendedPTS=Math.max(E.end(g),s.appendedPTS||0)})},m.onFragBuffered=function(o,a){this.detectPartialFragments(a)},m.hasFragment=function(o){var a=x(o);return!!this.fragments[a]},m.removeFragmentsInRange=function(o,a,n){var s=this;Object.keys(this.fragments).forEach(function(i){var e=s.fragments[i];if(!e)return;if(e.buffered){var t=e.body;t.type===n&&t.start<a&&t.end>o&&s.removeFragment(t)}})},m.removeFragment=function(o){var a=x(o);o.stats.loaded=0,o.clearElementaryStreamInfo(),delete this.fragments[a]},m.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},T}();function L(T){var m,p;return T.buffered&&(((m=T.range.video)===null||m===void 0?void 0:m.partial)||((p=T.range.audio)===null||p===void 0?void 0:p.partial))}function x(T){return T.type+"_"+T.level+"_"+T.urlId+"_"+T.sn}},"./src/controller/gap-controller.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"STALL_MINIMUM_DURATION_MS",function(){return L}),S.d(M,"MAX_START_GAP_JUMP",function(){return x}),S.d(M,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return T}),S.d(M,"SKIP_BUFFER_RANGE_START",function(){return m}),S.d(M,"default",function(){return p});var N=S("./src/utils/buffer-helper.ts"),w=S("./src/errors.ts"),R=S("./src/events.ts"),D=S("./src/utils/logger.ts"),L=250,x=2,T=.1,m=.05,p=function(){function o(n,s,i,e){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=n,this.media=s,this.fragmentTracker=i,this.hls=e}var a=o.prototype;return a.destroy=function(){this.hls=this.fragmentTracker=this.media=null},a.poll=function(s){var i=this.config,e=this.media,t=this.stalled,r=e.currentTime,E=e.seeking,g=this.seeking&&!E,h=!this.seeking&&E;if(this.seeking=E,r!==s){if(this.moved=!0,t!==null){if(this.stallReported){var y=self.performance.now()-t;D.logger.warn("playback not stuck anymore @"+r+", after "+Math.round(y)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((h||g)&&(this.stalled=null),e.paused||e.ended||e.playbackRate===0||!N.BufferHelper.getBuffered(e).length)return;var v=N.BufferHelper.bufferInfo(e,r,0),l=v.len>0,u=v.nextStart||0;if(!l&&!u)return;if(E){var d=v.len>x,c=!u||u-r>x&&!this.fragmentTracker.getPartialFragment(r);if(d||c)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var _,f=Math.max(u,v.start||0)-r,b=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,A=b==null||((_=b.details)===null||_===void 0)?void 0:_.live,O=A?b.details.targetduration*2:x;if(f>0&&f<=O){this._trySkipBufferHole(null);return}}var C=self.performance.now();if(t===null){this.stalled=C;return}var P=C-t;!E&&P>=L&&this._reportStall(v.len);var k=N.BufferHelper.bufferInfo(e,r,i.maxBufferHole);this._tryFixBufferStall(k,P)},a._tryFixBufferStall=function(s,i){var e=this.config,t=this.fragmentTracker,r=this.media,E=r.currentTime,g=t.getPartialFragment(E);if(g){var h=this._trySkipBufferHole(g);if(h)return}s.len>e.maxBufferHole&&i>e.highBufferWatchdogPeriod*1e3&&(D.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},a._reportStall=function(s){var i=this.hls,e=this.media,t=this.stallReported;t||(this.stallReported=!0,D.logger.warn("Playback stalling at @"+e.currentTime+" due to low buffer (buffer="+s+")"),i.trigger(R.Events.ERROR,{type:w.ErrorTypes.MEDIA_ERROR,details:w.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:s}))},a._trySkipBufferHole=function(s){for(var i=this.config,e=this.hls,t=this.media,r=t.currentTime,E=0,g=N.BufferHelper.getBuffered(t),h=0;h<g.length;h++){var y=g.start(h);if(r+i.maxBufferHole>=E&&r<y){var v=Math.max(y+m,t.currentTime+T);return D.logger.warn("skipping hole, adjusting currentTime from "+r+" to "+v),this.moved=!0,this.stalled=null,t.currentTime=v,s&&e.trigger(R.Events.ERROR,{type:w.ErrorTypes.MEDIA_ERROR,details:w.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+r+" to "+v,frag:s}),v}E=g.end(h)}return 0},a._tryNudgeBuffer=function(){var s=this.config,i=this.hls,e=this.media,t=e.currentTime,r=(this.nudgeRetry||0)+1;if(this.nudgeRetry=r,r<s.nudgeMaxRetry){var E=t+r*s.nudgeOffset;D.logger.warn("Nudging 'currentTime' from "+t+" to "+E),e.currentTime=E,i.trigger(R.Events.ERROR,{type:w.ErrorTypes.MEDIA_ERROR,details:w.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else D.logger.error("Playhead still not moving while enough data buffered @"+t+" after "+s.nudgeMaxRetry+" nudges"),i.trigger(R.Events.ERROR,{type:w.ErrorTypes.MEDIA_ERROR,details:w.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},o}()},"./src/controller/id3-track-controller.ts":function(ae,M,S){"use strict";S.r(M);var N=S("./src/events.ts"),w=S("./src/utils/texttrack-utils.ts"),R=S("./src/demux/id3.ts"),D=.25,L=function(){function x(m){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=m,this._registerListeners()}var T=x.prototype;return T.destroy=function(){this._unregisterListeners()},T._registerListeners=function(){var p=this.hls;p.on(N.Events.MEDIA_ATTACHED,this.onMediaAttached,this),p.on(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),p.on(N.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),p.on(N.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},T._unregisterListeners=function(){var p=this.hls;p.off(N.Events.MEDIA_ATTACHED,this.onMediaAttached,this),p.off(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),p.off(N.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),p.off(N.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},T.onMediaAttached=function(p,o){this.media=o.media},T.onMediaDetaching=function(){if(!this.id3Track)return;Object(w.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},T.getID3Track=function(p){if(!this.media)return;for(var o=0;o<p.length;o++){var a=p[o];if(a.kind==="metadata"&&a.label==="id3")return Object(w.sendAddTrackEvent)(a,this.media),a}return this.media.addTextTrack("metadata","id3")},T.onFragParsingMetadata=function(p,o){if(!this.media)return;var a=o.frag,n=o.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var s=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,i=0;i<n.length;i++){var e=R.getID3Frames(n[i].data);if(e){var t=n[i].pts,r=i<n.length-1?n[i+1].pts:a.end,E=r-t;E<=0&&(r=t+D);for(var g=0;g<e.length;g++){var h=e[g];if(!R.isTimeStampFrame(h)){var y=new s(t,r,"");y.value=h,this.id3Track.addCue(y)}}}}},T.onBufferFlushing=function(p,o){var a=o.startOffset,n=o.endOffset,s=o.type;if(!s||s==="audio"){var i=this.id3Track;i&&Object(w.removeCuesInRange)(i,a,n)}},x}();M.default=L},"./src/controller/latency-controller.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"default",function(){return x});var N=S("./src/errors.ts"),w=S("./src/events.ts"),R=S("./src/utils/logger.ts");function D(T,m){for(var p=0;p<m.length;p++){var o=m[p];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(T,o.key,o)}}function L(T,m,p){return m&&D(T.prototype,m),p&&D(T,p),T}var x=function(){function T(p){var o=this;this.hls=void 0,this.config=void 0,this.media=null,this.levelDetails=null,this.currentTime=0,this.stallCount=0,this._latency=null,this.timeupdateHandler=function(){return o.timeupdate()},this.hls=p,this.config=p.config,this.registerListeners()}var m=T.prototype;return m.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},m.registerListeners=function(){this.hls.on(w.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(w.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(w.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(w.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(w.Events.ERROR,this.onError,this)},m.unregisterListeners=function(){this.hls.off(w.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(w.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(w.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(w.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(w.Events.ERROR,this.onError)},m.onMediaAttached=function(o,a){this.media=a.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},m.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},m.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},m.onLevelUpdated=function(o,a){var n=a.details;this.levelDetails=n,n.advanced&&this.timeupdate(),!n.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},m.onError=function(o,a){if(a.details!==N.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,R.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},m.timeupdate=function(){var o=this.media,a=this.levelDetails;if(!o||!a)return;this.currentTime=o.currentTime;var n=this.computeLatency();if(n===null)return;this._latency=n;var s=this.config,i=s.lowLatencyMode,e=s.maxLiveSyncPlaybackRate;if(!i||e===1)return;var t=this.targetLatency;if(t===null)return;var r=n-t,E=Math.min(this.maxLatency,t+a.targetduration),g=r<E;if(a.live&&g&&r>.05&&this.forwardBufferLength>1){var h=Math.min(2,Math.max(1,e)),y=Math.round(2/(1+Math.exp(-.75*r-this.edgeStalled))*20)/20;o.playbackRate=Math.min(h,Math.max(1,y))}else o.playbackRate!==1&&o.playbackRate!==0&&(o.playbackRate=1)},m.estimateLiveEdge=function(){var o=this.levelDetails;return o===null?null:o.edge+o.age},m.computeLatency=function(){var o=this.estimateLiveEdge();return o===null?null:o-this.currentTime},L(T,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var o=this.config,a=this.levelDetails;return o.liveMaxLatencyDuration!==void 0?o.liveMaxLatencyDuration:a?o.liveMaxLatencyDurationCount*a.targetduration:0}},{key:"targetLatency",get:function(){var o=this.levelDetails;if(o===null)return null;var a=o.holdBack,n=o.partHoldBack,s=o.targetduration,i=this.config,e=i.liveSyncDuration,t=i.liveSyncDurationCount,r=i.lowLatencyMode,E=this.hls.userConfig,g=r&&n||a;(E.liveSyncDuration||E.liveSyncDurationCount||g===0)&&(g=e!==void 0?e:t*s);var h=s,y=1;return g+Math.min(this.stallCount*y,h)}},{key:"liveSyncPosition",get:function(){var o=this.estimateLiveEdge(),a=this.targetLatency,n=this.levelDetails;if(o===null||a===null||n===null)return null;var s=n.edge,i=o-a-this.edgeStalled,e=s-n.totalduration,t=s-(this.config.lowLatencyMode&&n.partTarget||n.targetduration);return Math.min(Math.max(e,i),t)}},{key:"drift",get:function(){var o=this.levelDetails;return o===null?1:o.drift}},{key:"edgeStalled",get:function(){var o=this.levelDetails;if(o===null)return 0;var a=(this.config.lowLatencyMode&&o.partTarget||o.targetduration)*3;return Math.max(o.age-a,0)}},{key:"forwardBufferLength",get:function(){var o=this.media,a=this.levelDetails;if(!o||!a)return 0;var n=o.buffered.length;return n?o.buffered.end(n-1):a.edge-this.currentTime}}]),T}()},"./src/controller/level-controller.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"default",function(){return i});var N=S("./src/types/level.ts"),w=S("./src/events.ts"),R=S("./src/errors.ts"),D=S("./src/utils/codecs.ts"),L=S("./src/controller/level-helper.ts"),x=S("./src/controller/base-playlist-controller.ts"),T=S("./src/types/loader.ts");function m(){return m=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var E in r)Object.prototype.hasOwnProperty.call(r,E)&&(e[E]=r[E])}return e},m.apply(this,arguments)}function p(e,t){for(var r=0;r<t.length;r++){var E=t[r];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(e,E.key,E)}}function o(e,t,r){return t&&p(e.prototype,t),r&&p(e,r),e}function a(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,n(e,t)}function n(e,t){return n=Object.setPrototypeOf||function(E,g){return E.__proto__=g,E},n(e,t)}var s=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),i=function(e){a(t,e);function t(E){var g;return g=e.call(this,E,"[level-controller]")||this,g._levels=[],g._firstLevel=-1,g._startLevel=void 0,g.currentLevelIndex=-1,g.manualLevelIndex=-1,g.onParsedComplete=void 0,g._registerListeners(),g}var r=t.prototype;return r._registerListeners=function(){var g=this.hls;g.on(w.Events.MANIFEST_LOADED,this.onManifestLoaded,this),g.on(w.Events.LEVEL_LOADED,this.onLevelLoaded,this),g.on(w.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),g.on(w.Events.FRAG_LOADED,this.onFragLoaded,this),g.on(w.Events.ERROR,this.onError,this)},r._unregisterListeners=function(){var g=this.hls;g.off(w.Events.MANIFEST_LOADED,this.onManifestLoaded,this),g.off(w.Events.LEVEL_LOADED,this.onLevelLoaded,this),g.off(w.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),g.off(w.Events.FRAG_LOADED,this.onFragLoaded,this),g.off(w.Events.ERROR,this.onError,this)},r.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,e.prototype.destroy.call(this)},r.startLoad=function(){var g=this._levels;g.forEach(function(h){h.loadError=0}),e.prototype.startLoad.call(this)},r.onManifestLoaded=function(g,h){var y=[],v=[],l=[],u,d={},c,_=!1,f=!1,b=!1;if(h.levels.forEach(function(P){var k=P.attrs;_=_||!!(P.width&&P.height),f=f||!!P.videoCodec,b=b||!!P.audioCodec,s&&P.audioCodec&&P.audioCodec.indexOf("mp4a.40.34")!==-1&&(P.audioCodec=void 0);var I=P.bitrate+"-"+P.attrs.RESOLUTION+"-"+P.attrs.CODECS;c=d[I],c?c.url.push(P.url):(c=new N.Level(P),d[I]=c,y.push(c)),k&&(k.AUDIO&&Object(L.addGroupId)(c,"audio",k.AUDIO),k.SUBTITLES&&Object(L.addGroupId)(c,"text",k.SUBTITLES))}),(_||f)&&b&&(y=y.filter(function(P){var k=P.videoCodec,I=P.width,U=P.height;return!!k||!!(I&&U)})),y=y.filter(function(P){var k=P.audioCodec,I=P.videoCodec;return(!k||Object(D.isCodecSupportedInMp4)(k,"audio"))&&(!I||Object(D.isCodecSupportedInMp4)(I,"video"))}),h.audioTracks&&(v=h.audioTracks.filter(function(P){return!P.audioCodec||Object(D.isCodecSupportedInMp4)(P.audioCodec,"audio")}),Object(L.assignTrackIdsByGroup)(v)),h.subtitles&&(l=h.subtitles,Object(L.assignTrackIdsByGroup)(l)),y.length>0){u=y[0].bitrate,y.sort(function(P,k){return P.bitrate-k.bitrate}),this._levels=y;for(var A=0;A<y.length;A++)if(y[A].bitrate===u){this._firstLevel=A,this.log("manifest loaded, "+y.length+" level(s) found, first bitrate: "+u);break}var O=b&&!f,C={levels:y,audioTracks:v,subtitleTracks:l,firstLevel:this._firstLevel,stats:h.stats,audio:b,video:f,altAudio:!O&&v.some(function(P){return!!P.url})};this.hls.trigger(w.Events.MANIFEST_PARSED,C),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(w.Events.ERROR,{type:R.ErrorTypes.MEDIA_ERROR,details:R.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:h.url,reason:"no level with compatible codecs found in manifest"})},r.onError=function(g,h){if(e.prototype.onError.call(this,g,h),h.fatal)return;var y=h.context,v=this._levels[this.currentLevelIndex];if(y&&(y.type===T.PlaylistContextType.AUDIO_TRACK&&v.audioGroupIds&&y.groupId===v.audioGroupIds[v.urlId]||y.type===T.PlaylistContextType.SUBTITLE_TRACK&&v.textGroupIds&&y.groupId===v.textGroupIds[v.urlId])){this.redundantFailover(this.currentLevelIndex);return}var l=!1,u=!0,d;switch(h.details){case R.ErrorDetails.FRAG_LOAD_ERROR:case R.ErrorDetails.FRAG_LOAD_TIMEOUT:case R.ErrorDetails.KEY_LOAD_ERROR:case R.ErrorDetails.KEY_LOAD_TIMEOUT:if(h.frag){var c=this._levels[h.frag.level];c?(c.fragmentError++,c.fragmentError>this.hls.config.fragLoadingMaxRetry&&(d=h.frag.level)):d=h.frag.level}break;case R.ErrorDetails.LEVEL_LOAD_ERROR:case R.ErrorDetails.LEVEL_LOAD_TIMEOUT:y&&(y.deliveryDirectives&&(u=!1),d=y.level),l=!0;break;case R.ErrorDetails.REMUX_ALLOC_ERROR:d=h.level,l=!0;break}d!==void 0&&this.recoverLevel(h,d,l,u)},r.recoverLevel=function(g,h,y,v){var l=g.details,u=this._levels[h];if(u.loadError++,y){var d=this.retryLoadingOrFail(g);if(d)g.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(v){var c=u.url.length;if(c>1&&u.loadError<c)g.levelRetry=!0,this.redundantFailover(h);else if(this.manualLevelIndex===-1){var _=h===0?this._levels.length-1:h-1;this.currentLevelIndex!==_&&this._levels[_].loadError===0&&(this.warn(l+": switch to "+_),g.levelRetry=!0,this.hls.nextAutoLevel=_)}}},r.redundantFailover=function(g){var h=this._levels[g],y=h.url.length;if(y>1){var v=(h.urlId+1)%y;this.warn("Switching to redundant URL-id "+v),this._levels.forEach(function(l){l.urlId=v}),this.level=g}},r.onFragLoaded=function(g,h){var y=h.frag;if(y!==void 0&&y.type===T.PlaylistLevelType.MAIN){var v=this._levels[y.level];v!==void 0&&(v.fragmentError=0,v.loadError=0)}},r.onLevelLoaded=function(g,h){var y,v=h.level,l=h.details,u=this._levels[v];if(!u){var d;this.warn("Invalid level index "+v),(d=h.deliveryDirectives)!==null&&d!==void 0&&d.skip&&(l.deltaUpdateFailed=!0);return}v===this.currentLevelIndex?(u.fragmentError===0&&(u.loadError=0,this.retryCount=0),this.playlistLoaded(v,h,u.details)):(y=h.deliveryDirectives)!==null&&y!==void 0&&y.skip&&(l.deltaUpdateFailed=!0)},r.onAudioTrackSwitched=function(g,h){var y=this.hls.levels[this.currentLevelIndex];if(!y)return;if(y.audioGroupIds){for(var v=-1,l=this.hls.audioTracks[h.id].groupId,u=0;u<y.audioGroupIds.length;u++)if(y.audioGroupIds[u]===l){v=u;break}v!==y.urlId&&(y.urlId=v,this.startLoad())}},r.loadPlaylist=function(g){var h=this.currentLevelIndex,y=this._levels[h];if(this.canLoad&&y&&y.url.length>0){var v=y.urlId,l=y.url[v];if(g)try{l=g.addDirectives(l)}catch(u){this.warn("Could not construct new URL with HLS Delivery Directives: "+u)}this.log("Attempt loading level index "+h+(g?" at sn "+g.msn+" part "+g.part:"")+" with URL-id "+v+" "+l),this.clearTimer(),this.hls.trigger(w.Events.LEVEL_LOADING,{url:l,level:h,id:v,deliveryDirectives:g||null})}},r.removeLevel=function(g,h){var y=function(u,d){return d!==h},v=this._levels.filter(function(l,u){return u!==g?!0:l.url.length>1&&h!==void 0?(l.url=l.url.filter(y),l.audioGroupIds&&(l.audioGroupIds=l.audioGroupIds.filter(y)),l.textGroupIds&&(l.textGroupIds=l.textGroupIds.filter(y)),l.urlId=0,!0):!1}).map(function(l,u){var d=l.details;return d!=null&&d.fragments&&d.fragments.forEach(function(c){c.level=u}),l});this._levels=v,this.hls.trigger(w.Events.LEVELS_UPDATED,{levels:v})},o(t,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(g){var h,y=this._levels;if(y.length===0)return;if(this.currentLevelIndex===g&&(h=y[g])!==null&&h!==void 0&&h.details)return;if(g<0||g>=y.length){var v=g<0;if(this.hls.trigger(w.Events.ERROR,{type:R.ErrorTypes.OTHER_ERROR,details:R.ErrorDetails.LEVEL_SWITCH_ERROR,level:g,fatal:v,reason:"invalid level idx"}),v)return;g=Math.min(g,y.length-1)}this.clearTimer();var l=this.currentLevelIndex,u=y[l],d=y[g];this.log("switching to level "+g+" from "+l),this.currentLevelIndex=g;var c=m({},d,{level:g,maxBitrate:d.maxBitrate,uri:d.uri,urlId:d.urlId});delete c._urlId,this.hls.trigger(w.Events.LEVEL_SWITCHING,c);var _=d.details;if(!_||_.live){var f=this.switchParams(d.uri,u==null?void 0:u.details);this.loadPlaylist(f)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(g){this.manualLevelIndex=g,this._startLevel===void 0&&(this._startLevel=g),g!==-1&&(this.level=g)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(g){this._firstLevel=g}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var g=this.hls.config.startLevel;return g!==void 0?g:this._firstLevel}else return this._startLevel},set:function(g){this._startLevel=g}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(g){this.level=g,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=g)}}]),t}(x.default)},"./src/controller/level-helper.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"addGroupId",function(){return R}),S.d(M,"assignTrackIdsByGroup",function(){return D}),S.d(M,"updatePTS",function(){return L}),S.d(M,"updateFragPTSDTS",function(){return T}),S.d(M,"mergeDetails",function(){return m}),S.d(M,"mapPartIntersection",function(){return p}),S.d(M,"mapFragmentIntersection",function(){return o}),S.d(M,"adjustSliding",function(){return a}),S.d(M,"addSliding",function(){return n}),S.d(M,"computeReloadInterval",function(){return s}),S.d(M,"getFragmentWithSN",function(){return i}),S.d(M,"getPartWith",function(){return e});var N=S("./src/polyfills/number.ts"),w=S("./src/utils/logger.ts");function R(t,r,E){switch(r){case"audio":t.audioGroupIds||(t.audioGroupIds=[]),t.audioGroupIds.push(E);break;case"text":t.textGroupIds||(t.textGroupIds=[]),t.textGroupIds.push(E);break}}function D(t){var r={};t.forEach(function(E){var g=E.groupId||"";E.id=r[g]=r[g]||0,r[g]++})}function L(t,r,E){var g=t[r],h=t[E];x(g,h)}function x(t,r){var E=r.startPTS;if(Object(N.isFiniteNumber)(E)){var g=0,h;r.sn>t.sn?(g=E-t.start,h=t):(g=t.start-E,h=r),h.duration!==g&&(h.duration=g)}else if(r.sn>t.sn){var y=t.cc===r.cc;y&&t.minEndPTS?r.start=t.start+(t.minEndPTS-t.start):r.start=t.start+t.duration}else r.start=Math.max(t.start-r.duration,0)}function T(t,r,E,g,h,y){var v=g-E;v<=0&&(w.logger.warn("Fragment should have a positive duration",r),g=E+r.duration,y=h+r.duration);var l=E,u=g,d=r.startPTS,c=r.endPTS;if(Object(N.isFiniteNumber)(d)){var _=Math.abs(d-E);Object(N.isFiniteNumber)(r.deltaPTS)?r.deltaPTS=Math.max(_,r.deltaPTS):r.deltaPTS=_,l=Math.max(E,d),E=Math.min(E,d),h=Math.min(h,r.startDTS),u=Math.min(g,c),g=Math.max(g,c),y=Math.max(y,r.endDTS)}r.duration=g-E;var f=E-r.start;r.appendedPTS=g,r.start=r.startPTS=E,r.maxStartPTS=l,r.startDTS=h,r.endPTS=g,r.minEndPTS=u,r.endDTS=y;var b=r.sn;if(!t||b<t.startSN||b>t.endSN)return 0;var A,O=b-t.startSN,C=t.fragments;for(C[O]=r,A=O;A>0;A--)x(C[A],C[A-1]);for(A=O;A<C.length-1;A++)x(C[A],C[A+1]);return t.fragmentHint&&x(C[C.length-1],t.fragmentHint),t.PTSKnown=t.alignedSliding=!0,f}function m(t,r){for(var E=null,g=t.fragments,h=g.length-1;h>=0;h--){var y=g[h].initSegment;if(y){E=y;break}}t.fragmentHint&&delete t.fragmentHint.endPTS;var v=0,l;if(o(t,r,function(A,O){A.relurl&&(v=A.cc-O.cc),Object(N.isFiniteNumber)(A.startPTS)&&Object(N.isFiniteNumber)(A.endPTS)&&(O.start=O.startPTS=A.startPTS,O.startDTS=A.startDTS,O.appendedPTS=A.appendedPTS,O.maxStartPTS=A.maxStartPTS,O.endPTS=A.endPTS,O.endDTS=A.endDTS,O.minEndPTS=A.minEndPTS,O.duration=A.endPTS-A.startPTS,O.duration&&(l=O),r.PTSKnown=r.alignedSliding=!0),O.elementaryStreams=A.elementaryStreams,O.loader=A.loader,O.stats=A.stats,O.urlId=A.urlId,A.initSegment&&(O.initSegment=A.initSegment,E=A.initSegment)}),E){var u=r.fragmentHint?r.fragments.concat(r.fragmentHint):r.fragments;u.forEach(function(A){var O;(!A.initSegment||A.initSegment.relurl===((O=E)===null||O===void 0?void 0:O.relurl))&&(A.initSegment=E)})}if(r.skippedSegments&&(r.deltaUpdateFailed=r.fragments.some(function(A){return!A}),r.deltaUpdateFailed)){w.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var d=r.skippedSegments;d--;)r.fragments.shift();r.startSN=r.fragments[0].sn,r.startCC=r.fragments[0].cc}var c=r.fragments;if(v){w.logger.warn("discontinuity sliding from playlist, take drift into account");for(var _=0;_<c.length;_++)c[_].cc+=v}r.skippedSegments&&(r.startCC=r.fragments[0].cc),p(t.partList,r.partList,function(A,O){O.elementaryStreams=A.elementaryStreams,O.stats=A.stats}),l?T(r,l,l.startPTS,l.endPTS,l.startDTS,l.endDTS):a(t,r),c.length&&(r.totalduration=r.edge-c[0].start),r.driftStartTime=t.driftStartTime,r.driftStart=t.driftStart;var f=r.advancedDateTime;if(r.advanced&&f){var b=r.edge;r.driftStart||(r.driftStartTime=f,r.driftStart=b),r.driftEndTime=f,r.driftEnd=b}else r.driftEndTime=t.driftEndTime,r.driftEnd=t.driftEnd,r.advancedDateTime=t.advancedDateTime}function p(t,r,E){if(t&&r)for(var g=0,h=0,y=t.length;h<=y;h++){var v=t[h],l=r[h+g];v&&l&&v.index===l.index&&v.fragment.sn===l.fragment.sn?E(v,l):g--}}function o(t,r,E){for(var g=r.skippedSegments,h=Math.max(t.startSN,r.startSN)-r.startSN,y=(t.fragmentHint?1:0)+(g?r.endSN:Math.min(t.endSN,r.endSN))-r.startSN,v=r.startSN-t.startSN,l=r.fragmentHint?r.fragments.concat(r.fragmentHint):r.fragments,u=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments,d=h;d<=y;d++){var c=u[v+d],_=l[d];g&&!_&&d<g&&(_=r.fragments[d]=c),c&&_&&E(c,_)}}function a(t,r){var E=r.startSN+r.skippedSegments-t.startSN,g=t.fragments;if(E<0||E>=g.length)return;n(r,g[E].start)}function n(t,r){if(r){for(var E=t.fragments,g=t.skippedSegments;g<E.length;g++)E[g].start+=r;t.fragmentHint&&(t.fragmentHint.start+=r)}}function s(t,r){var E=1e3*t.levelTargetDuration,g=E/2,h=t.age,y=h>0&&h<E*3,v=r.loading.end-r.loading.start,l,u=t.availabilityDelay;if(t.updated===!1)if(y){var d=333*t.misses;l=Math.max(Math.min(g,v*2),d),t.availabilityDelay=(t.availabilityDelay||0)+l}else l=g;else y?(u=Math.min(u||E/2,h),t.availabilityDelay=u,l=u+E-h):l=E-v;return Math.round(l)}function i(t,r,E){if(!t||!t.details)return null;var g=t.details,h=g.fragments[r-g.startSN];return h||(h=g.fragmentHint,h&&h.sn===r?h:r<g.startSN&&E&&E.sn===r?E:null)}function e(t,r,E){if(!t||!t.details)return null;var g=t.details.partList;if(g)for(var h=g.length;h--;){var y=g[h];if(y.index===E&&y.fragment.sn===r)return y}return null}},"./src/controller/stream-controller.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"default",function(){return g});var N=S("./src/polyfills/number.ts"),w=S("./src/controller/base-stream-controller.ts"),R=S("./src/is-supported.ts"),D=S("./src/events.ts"),L=S("./src/utils/buffer-helper.ts"),x=S("./src/controller/fragment-tracker.ts"),T=S("./src/types/loader.ts"),m=S("./src/loader/fragment.ts"),p=S("./src/demux/transmuxer-interface.ts"),o=S("./src/types/transmuxer.ts"),a=S("./src/controller/gap-controller.ts"),n=S("./src/errors.ts"),s=S("./src/utils/logger.ts");function i(h,y){for(var v=0;v<y.length;v++){var l=y[v];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(h,l.key,l)}}function e(h,y,v){return y&&i(h.prototype,y),v&&i(h,v),h}function t(h,y){h.prototype=Object.create(y.prototype),h.prototype.constructor=h,r(h,y)}function r(h,y){return r=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},r(h,y)}var E=100,g=function(h){t(y,h);function y(l,u){var d;return d=h.call(this,l,u,"[stream-controller]")||this,d.audioCodecSwap=!1,d.gapController=null,d.level=-1,d._forceStartLoad=!1,d.altAudio=!1,d.audioOnly=!1,d.fragPlaying=null,d.onvplaying=null,d.onvseeked=null,d.fragLastKbps=0,d.stalled=!1,d.couldBacktrack=!1,d.audioCodecSwitch=!1,d.videoBuffer=null,d._registerListeners(),d}var v=y.prototype;return v._registerListeners=function(){var u=this.hls;u.on(D.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.on(D.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.on(D.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.on(D.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.on(D.Events.LEVEL_LOADING,this.onLevelLoading,this),u.on(D.Events.LEVEL_LOADED,this.onLevelLoaded,this),u.on(D.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),u.on(D.Events.ERROR,this.onError,this),u.on(D.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),u.on(D.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),u.on(D.Events.BUFFER_CREATED,this.onBufferCreated,this),u.on(D.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),u.on(D.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),u.on(D.Events.FRAG_BUFFERED,this.onFragBuffered,this)},v._unregisterListeners=function(){var u=this.hls;u.off(D.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.off(D.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.off(D.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.off(D.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.off(D.Events.LEVEL_LOADED,this.onLevelLoaded,this),u.off(D.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),u.off(D.Events.ERROR,this.onError,this),u.off(D.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),u.off(D.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),u.off(D.Events.BUFFER_CREATED,this.onBufferCreated,this),u.off(D.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),u.off(D.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),u.off(D.Events.FRAG_BUFFERED,this.onFragBuffered,this)},v.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},v.startLoad=function(u){if(this.levels){var d=this.lastCurrentTime,c=this.hls;if(this.stopLoad(),this.setInterval(E),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var _=c.startLevel;_===-1&&(c.config.testBandwidth?(_=0,this.bitrateTest=!0):_=c.nextAutoLevel),this.level=c.nextLoadLevel=_,this.loadedmetadata=!1}d>0&&u===-1&&(this.log("Override startPosition with lastCurrentTime @"+d.toFixed(3)),u=d),this.state=w.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=u,this.tick()}else this._forceStartLoad=!0,this.state=w.State.STOPPED},v.stopLoad=function(){this._forceStartLoad=!1,h.prototype.stopLoad.call(this)},v.doTick=function(){switch(this.state){case w.State.IDLE:this.doTickIdle();break;case w.State.WAITING_LEVEL:{var u,d=this.levels,c=this.level,_=d==null||((u=d[c])===null||u===void 0)?void 0:u.details;if(_&&(!_.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(_))break;this.state=w.State.IDLE;break}break}case w.State.FRAG_LOADING_WAITING_RETRY:{var f,b=self.performance.now(),A=this.retryDate;(!A||b>=A||(f=this.media)!==null&&f!==void 0&&f.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=w.State.IDLE)}break;default:break}this.onTickEnd()},v.onTickEnd=function(){h.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},v.doTickIdle=function(){var u,d,c=this.hls,_=this.levelLastLoaded,f=this.levels,b=this.media,A=c.config,O=c.nextLoadLevel;if(_===null||!b&&(this.startFragRequested||!A.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!f||!f[O])return;var C=f[O];this.level=c.nextLoadLevel=O;var P=C.details;if(!P||this.state===w.State.WAITING_LEVEL||P.live&&this.levelLastLoaded!==O){this.state=w.State.WAITING_LEVEL;return}var k=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:b,T.PlaylistLevelType.MAIN);if(k===null)return;var I=k.len,U=this.getMaxBufferLength(C.maxBitrate);if(I>=U)return;if(this._streamEnded(k,P)){var H={};this.altAudio&&(H.type="video"),this.hls.trigger(D.Events.BUFFER_EOS,H),this.state=w.State.ENDED;return}var Z=k.end,$=this.getNextFragment(Z,P);if(this.couldBacktrack&&!this.fragPrevious&&$&&$.sn!=="initSegment"){var ee=$.sn-P.startSN;ee>1&&($=P.fragments[ee-1],this.fragmentTracker.removeFragment($))}if($&&this.fragmentTracker.getState($)===x.FragmentState.OK&&this.nextLoadPosition>Z){var te=this.audioOnly&&!this.altAudio?m.ElementaryStreamTypes.AUDIO:m.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(b,te,T.PlaylistLevelType.MAIN),$=this.getNextFragment(this.nextLoadPosition,P)}if(!$)return;$.initSegment&&!$.initSegment.data&&!this.bitrateTest&&($=$.initSegment),((u=$.decryptdata)===null||u===void 0?void 0:u.keyFormat)==="identity"&&!((d=$.decryptdata)!==null&&d!==void 0&&d.key)?this.loadKey($,P):this.loadFragment($,P,Z)},v.loadFragment=function(u,d,c){var _,f=this.fragmentTracker.getState(u);if(this.fragCurrent=u,f===x.FragmentState.BACKTRACKED){var b=this.fragmentTracker.getBacktrackData(u);if(b){this._handleFragmentLoadProgress(b),this._handleFragmentLoadComplete(b);return}else f=x.FragmentState.NOT_LOADED}f===x.FragmentState.NOT_LOADED||f===x.FragmentState.PARTIAL?u.sn==="initSegment"?this._loadInitSegment(u):this.bitrateTest?(u.bitrateTest=!0,this.log("Fragment "+u.sn+" of level "+u.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(u)):(this.startFragRequested=!0,h.prototype.loadFragment.call(this,u,d,c)):f===x.FragmentState.APPENDING?this.reduceMaxBufferLength(u.duration)&&this.fragmentTracker.removeFragment(u):((_=this.media)===null||_===void 0?void 0:_.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},v.getAppendedFrag=function(u){var d=this.fragmentTracker.getAppendedFrag(u,T.PlaylistLevelType.MAIN);return d&&"fragment"in d?d.fragment:d},v.getBufferedFrag=function(u){return this.fragmentTracker.getBufferedFrag(u,T.PlaylistLevelType.MAIN)},v.followingBufferedFrag=function(u){return u?this.getBufferedFrag(u.end+.5):null},v.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},v.nextLevelSwitch=function(){var u=this.levels,d=this.media;if(d!=null&&d.readyState){var c,_=this.getAppendedFrag(d.currentTime);if(_&&_.start>1&&this.flushMainBuffer(0,_.start-1),!d.paused&&u){var f=this.hls.nextLoadLevel,b=u[f],A=this.fragLastKbps;A&&this.fragCurrent?c=this.fragCurrent.duration*b.maxBitrate/(1e3*A)+1:c=0}else c=0;var O=this.getBufferedFrag(d.currentTime+c);if(O){var C=this.followingBufferedFrag(O);if(C){this.abortCurrentFrag();var P=C.maxStartPTS?C.maxStartPTS:C.start,k=C.duration,I=Math.max(O.end,P+Math.min(Math.max(k-this.config.maxFragLookUpTolerance,k*.5),k*.75));this.flushMainBuffer(I,Number.POSITIVE_INFINITY)}}}},v.abortCurrentFrag=function(){var u=this.fragCurrent;this.fragCurrent=null,u!=null&&u.loader&&u.loader.abort(),this.state===w.State.KEY_LOADING&&(this.state=w.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},v.flushMainBuffer=function(u,d){h.prototype.flushMainBuffer.call(this,u,d,this.altAudio?"video":null)},v.onMediaAttached=function(u,d){h.prototype.onMediaAttached.call(this,u,d);var c=d.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),c.addEventListener("playing",this.onvplaying),c.addEventListener("seeked",this.onvseeked),this.gapController=new a.default(this.config,c,this.fragmentTracker,this.hls)},v.onMediaDetaching=function(){var u=this.media;u&&(u.removeEventListener("playing",this.onvplaying),u.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),h.prototype.onMediaDetaching.call(this)},v.onMediaPlaying=function(){this.tick()},v.onMediaSeeked=function(){var u=this.media,d=u?u.currentTime:null;Object(N.isFiniteNumber)(d)&&this.log("Media seeked to "+d.toFixed(3)),this.tick()},v.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(D.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},v.onManifestParsed=function(u,d){var c=!1,_=!1,f;d.levels.forEach(function(b){f=b.audioCodec,f&&(f.indexOf("mp4a.40.2")!==-1&&(c=!0),f.indexOf("mp4a.40.5")!==-1&&(_=!0))}),this.audioCodecSwitch=c&&_&&!Object(R.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=d.levels,this.startFragRequested=!1},v.onLevelLoading=function(u,d){var c=this.levels;if(!c||this.state!==w.State.IDLE)return;var _=c[d.level];(!_.details||_.details.live&&this.levelLastLoaded!==d.level||this.waitForCdnTuneIn(_.details))&&(this.state=w.State.WAITING_LEVEL)},v.onLevelLoaded=function(u,d){var c,_=this.levels,f=d.level,b=d.details,A=b.totalduration;if(!_){this.warn("Levels were reset while loading level "+f);return}this.log("Level "+f+" loaded ["+b.startSN+","+b.endSN+"], cc ["+b.startCC+", "+b.endCC+"] duration:"+A);var O=this.fragCurrent;O&&(this.state===w.State.FRAG_LOADING||this.state===w.State.FRAG_LOADING_WAITING_RETRY)&&(O.level!==d.level&&O.loader&&(this.state=w.State.IDLE,O.loader.abort()));var C=_[f],P=0;if(b.live||(c=C.details)!==null&&c!==void 0&&c.live){if(b.fragments[0]||(b.deltaUpdateFailed=!0),b.deltaUpdateFailed)return;P=this.alignPlaylists(b,C.details)}if(C.details=b,this.levelLastLoaded=f,this.hls.trigger(D.Events.LEVEL_UPDATED,{details:b,level:f}),this.state===w.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(b))return;this.state=w.State.IDLE}this.startFragRequested?b.live&&this.synchronizeToLiveEdge(b):this.setStartPosition(b,P),this.tick()},v._handleFragmentLoadProgress=function(u){var d,c=u.frag,_=u.part,f=u.payload,b=this.levels;if(!b){this.warn("Levels were reset while fragment load was in progress. Fragment "+c.sn+" of level "+c.level+" will not be buffered");return}var A=b[c.level],O=A.details;if(!O){this.warn("Dropping fragment "+c.sn+" of level "+c.level+" after level details were reset");return}var C=A.videoCodec,P=O.PTSKnown||!O.live,k=(d=c.initSegment)===null||d===void 0?void 0:d.data,I=this._getAudioCodec(A),U=this.transmuxer=this.transmuxer||new p.default(this.hls,T.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),H=_?_.index:-1,Z=H!==-1,$=new o.ChunkMetadata(c.level,c.sn,c.stats.chunkCount,f.byteLength,H,Z),ee=this.initPTS[c.cc];U.push(f,k,I,C,c,_,O.totalduration,P,$,ee)},v.onAudioTrackSwitching=function(u,d){var c=this.altAudio,_=!!d.url,f=d.id;if(!_){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 A=this.hls;c&&A.trigger(D.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),A.trigger(D.Events.AUDIO_TRACK_SWITCHED,{id:f})}},v.onAudioTrackSwitched=function(u,d){var c=d.id,_=!!this.hls.audioTracks[c].url;if(_){var f=this.videoBuffer;f&&this.mediaBuffer!==f&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=f)}this.altAudio=_,this.tick()},v.onBufferCreated=function(u,d){var c=d.tracks,_,f,b=!1;for(var A in c){var O=c[A];if(O.id==="main"){if(f=A,_=O,A==="video"){var C=c[A];C&&(this.videoBuffer=C.buffer)}}else b=!0}b&&_?(this.log("Alternate track found, use "+f+".buffered to schedule main fragment loading"),this.mediaBuffer=_.buffer):this.mediaBuffer=this.media},v.onFragBuffered=function(u,d){var c=d.frag,_=d.part;if(c&&c.type!==T.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(c)){this.warn("Fragment "+c.sn+(_?" p: "+_.index:"")+" of level "+c.level+" finished buffering, but was aborted. state: "+this.state),this.state===w.State.PARSED&&(this.state=w.State.IDLE);return}var f=_?_.stats:c.stats;this.fragLastKbps=Math.round(8*f.total/(f.buffering.end-f.loading.first)),c.sn!=="initSegment"&&(this.fragPrevious=c),this.fragBufferedComplete(c,_)},v.onError=function(u,d){switch(d.details){case n.ErrorDetails.FRAG_LOAD_ERROR:case n.ErrorDetails.FRAG_LOAD_TIMEOUT:case n.ErrorDetails.KEY_LOAD_ERROR:case n.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(T.PlaylistLevelType.MAIN,d);break;case n.ErrorDetails.LEVEL_LOAD_ERROR:case n.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==w.State.ERROR&&(d.fatal?(this.warn(""+d.details),this.state=w.State.ERROR):!d.levelRetry&&this.state===w.State.WAITING_LEVEL&&(this.state=w.State.IDLE));break;case n.ErrorDetails.BUFFER_FULL_ERROR:if(d.parent==="main"&&(this.state===w.State.PARSING||this.state===w.State.PARSED)){var c=!0,_=this.getFwdBufferInfo(this.media,T.PlaylistLevelType.MAIN);_&&_.len>.5&&(c=!this.reduceMaxBufferLength(_.len)),c&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},v.checkBuffer=function(){var u=this.media,d=this.gapController;if(!u||!d||!u.readyState)return;var c=L.BufferHelper.getBuffered(u);!this.loadedmetadata&&c.length?(this.loadedmetadata=!0,this.seekToStartPos()):d.poll(this.lastCurrentTime),this.lastCurrentTime=u.currentTime},v.onFragLoadEmergencyAborted=function(){this.state=w.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},v.onBufferFlushed=function(u,d){var c=d.type;if(c!==m.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var _=(c===m.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(_,c,T.PlaylistLevelType.MAIN)}},v.onLevelsUpdated=function(u,d){this.levels=d.levels},v.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},v.seekToStartPos=function(){var u=this.media,d=u.currentTime,c=this.startPosition;if(c>=0&&d<c){if(u.seeking){s.logger.log("could not seek to "+c+", already seeking at "+d);return}var _=L.BufferHelper.getBuffered(u),f=_.length?_.start(0):0,b=f-c;b>0&&(b<this.config.maxBufferHole||b<this.config.maxFragLookUpTolerance)&&(s.logger.log("adjusting start position by "+b+" to match buffer start"),c+=b,this.startPosition=c),this.log("seek to target start position "+c+" from current time "+d),u.currentTime=c}},v._getAudioCodec=function(u){var d=this.config.defaultAudioCodec||u.audioCodec;return this.audioCodecSwap&&d&&(this.log("Swapping audio codec"),d.indexOf("mp4a.40.5")!==-1?d="mp4a.40.2":d="mp4a.40.5"),d},v._loadBitrateTestFrag=function(u){var d=this;this._doFragLoad(u).then(function(c){var _=d.hls;if(!c||_.nextLoadLevel||d.fragContextChanged(u))return;d.fragLoadError=0,d.state=w.State.IDLE,d.startFragRequested=!1,d.bitrateTest=!1;var f=u.stats;f.parsing.start=f.parsing.end=f.buffering.start=f.buffering.end=self.performance.now(),_.trigger(D.Events.FRAG_LOADED,c)})},v._handleTransmuxComplete=function(u){var d,c="main",_=this.hls,f=u.remuxResult,b=u.chunkMeta,A=this.getCurrentContext(b);if(!A){this.warn("The loading context changed while buffering fragment "+b.sn+" of level "+b.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(b.level);return}var O=A.frag,C=A.part,P=A.level,k=f.video,I=f.text,U=f.id3,H=f.initSegment,Z=this.altAudio?void 0:f.audio;if(this.fragContextChanged(O))return;if(this.state=w.State.PARSING,H){H.tracks&&(this._bufferInitSegment(P,H.tracks,O,b),_.trigger(D.Events.FRAG_PARSING_INIT_SEGMENT,{frag:O,id:c,tracks:H.tracks}));var $=H.initPTS,ee=H.timescale;Object(N.isFiniteNumber)($)&&(this.initPTS[O.cc]=$,_.trigger(D.Events.INIT_PTS_FOUND,{frag:O,id:c,initPTS:$,timescale:ee}))}if(k&&f.independent!==!1){if(P.details){var te=k.startPTS,K=k.endPTS,W=k.startDTS,X=k.endDTS;if(C)C.elementaryStreams[k.type]={startPTS:te,endPTS:K,startDTS:W,endDTS:X};else if(k.firstKeyFrame&&k.independent&&(this.couldBacktrack=!0),k.dropped&&k.independent){var j=this.getLoadPosition()+this.config.maxBufferHole;if(j<te){this.backtrack(O);return}O.setElementaryStreamInfo(k.type,O.start,K,O.start,X,!0)}O.setElementaryStreamInfo(k.type,te,K,W,X),this.bufferFragmentData(k,O,C,b)}}else if(f.independent===!1){this.backtrack(O);return}if(Z){var z=Z.startPTS,ie=Z.endPTS,pe=Z.startDTS,_e=Z.endDTS;C&&(C.elementaryStreams[m.ElementaryStreamTypes.AUDIO]={startPTS:z,endPTS:ie,startDTS:pe,endDTS:_e}),O.setElementaryStreamInfo(m.ElementaryStreamTypes.AUDIO,z,ie,pe,_e),this.bufferFragmentData(Z,O,C,b)}if(U!=null&&(d=U.samples)!==null&&d!==void 0&&d.length){var Ee={frag:O,id:c,samples:U.samples};_.trigger(D.Events.FRAG_PARSING_METADATA,Ee)}if(I){var we={frag:O,id:c,samples:I.samples};_.trigger(D.Events.FRAG_PARSING_USERDATA,we)}},v._bufferInitSegment=function(u,d,c,_){var f=this;if(this.state!==w.State.PARSING)return;this.audioOnly=!!d.audio&&!d.video,this.altAudio&&!this.audioOnly&&delete d.audio;var b=d.audio,A=d.video,O=d.audiovideo;if(b){var C=u.audioCodec,P=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(C&&(C.indexOf("mp4a.40.5")!==-1?C="mp4a.40.2":C="mp4a.40.5"),b.metadata.channelCount!==1&&P.indexOf("firefox")===-1&&(C="mp4a.40.5")),P.indexOf("android")!==-1&&b.container!=="audio/mpeg"&&(C="mp4a.40.2",this.log("Android: force audio codec to "+C)),u.audioCodec&&u.audioCodec!==C&&this.log('Swapping manifest audio codec "'+u.audioCodec+'" for "'+C+'"'),b.levelCodec=C,b.id="main",this.log("Init audio buffer, container:"+b.container+", codecs[selected/level/parsed]=["+(C||"")+"/"+(u.audioCodec||"")+"/"+b.codec+"]")}A&&(A.levelCodec=u.videoCodec,A.id="main",this.log("Init video buffer, container:"+A.container+", codecs[level/parsed]=["+(u.videoCodec||"")+"/"+A.codec+"]")),O&&this.log("Init audiovideo buffer, container:"+O.container+", codecs[level/parsed]=["+(u.attrs.CODECS||"")+"/"+O.codec+"]"),this.hls.trigger(D.Events.BUFFER_CODECS,d),Object.keys(d).forEach(function(k){var I=d[k],U=I.initSegment;U!=null&&U.byteLength&&f.hls.trigger(D.Events.BUFFER_APPENDING,{type:k,data:U,frag:c,part:null,chunkMeta:_,parent:c.type})}),this.tick()},v.backtrack=function(u){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(u);var d=this.fragmentTracker.backtrack(u);this.fragPrevious=null,this.nextLoadPosition=u.start,d?this.resetFragmentLoading(u):this.state=w.State.BACKTRACKING},v.checkFragmentChanged=function(){var u=this.media,d=null;if(u&&u.readyState>1&&u.seeking===!1){var c=u.currentTime;if(L.BufferHelper.isBuffered(u,c)?d=this.getAppendedFrag(c):L.BufferHelper.isBuffered(u,c+.1)&&(d=this.getAppendedFrag(c+.1)),d){var _=this.fragPlaying,f=d.level;(!_||d.sn!==_.sn||_.level!==f||d.urlId!==_.urlId)&&(this.hls.trigger(D.Events.FRAG_CHANGED,{frag:d}),(!_||_.level!==f)&&this.hls.trigger(D.Events.LEVEL_SWITCHED,{level:f}),this.fragPlaying=d)}}},e(y,[{key:"nextLevel",get:function(){var u=this.nextBufferedFrag;return u?u.level:-1}},{key:"currentLevel",get:function(){var u=this.media;if(u){var d=this.getAppendedFrag(u.currentTime);if(d)return d.level}return-1}},{key:"nextBufferedFrag",get:function(){var u=this.media;if(u){var d=this.getAppendedFrag(u.currentTime);return this.followingBufferedFrag(d)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),y}(w.default)},"./src/controller/subtitle-stream-controller.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"SubtitleStreamController",function(){return t});var N=S("./src/events.ts"),w=S("./src/utils/logger.ts"),R=S("./src/utils/buffer-helper.ts"),D=S("./src/controller/fragment-finders.ts"),L=S("./src/utils/discontinuities.ts"),x=S("./src/controller/level-helper.ts"),T=S("./src/controller/fragment-tracker.ts"),m=S("./src/controller/base-stream-controller.ts"),p=S("./src/types/loader.ts"),o=S("./src/types/level.ts");function a(r,E){for(var g=0;g<E.length;g++){var h=E[g];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(r,h.key,h)}}function n(r,E,g){return E&&a(r.prototype,E),g&&a(r,g),r}function s(r,E){r.prototype=Object.create(E.prototype),r.prototype.constructor=r,i(r,E)}function i(r,E){return i=Object.setPrototypeOf||function(h,y){return h.__proto__=y,h},i(r,E)}var e=500,t=function(r){s(E,r);function E(h,y){var v;return v=r.call(this,h,y,"[subtitle-stream-controller]")||this,v.levels=[],v.currentTrackId=-1,v.tracksBuffered=[],v.mainDetails=null,v._registerListeners(),v}var g=E.prototype;return g.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},g._registerListeners=function(){var y=this.hls;y.on(N.Events.MEDIA_ATTACHED,this.onMediaAttached,this),y.on(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),y.on(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),y.on(N.Events.LEVEL_LOADED,this.onLevelLoaded,this),y.on(N.Events.ERROR,this.onError,this),y.on(N.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),y.on(N.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),y.on(N.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),y.on(N.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),y.on(N.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},g._unregisterListeners=function(){var y=this.hls;y.off(N.Events.MEDIA_ATTACHED,this.onMediaAttached,this),y.off(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),y.off(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),y.off(N.Events.LEVEL_LOADED,this.onLevelLoaded,this),y.off(N.Events.ERROR,this.onError,this),y.off(N.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),y.off(N.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),y.off(N.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),y.off(N.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),y.off(N.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},g.startLoad=function(){this.stopLoad(),this.state=m.State.IDLE,this.setInterval(e),this.tick()},g.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},g.onLevelLoaded=function(y,v){this.mainDetails=v.details},g.onSubtitleFragProcessed=function(y,v){var l=v.frag,u=v.success;if(this.fragPrevious=l,this.state=m.State.IDLE,!u)return;var d=this.tracksBuffered[this.currentTrackId];if(!d)return;for(var c,_=l.start,f=0;f<d.length;f++)if(_>=d[f].start&&_<=d[f].end){c=d[f];break}var b=l.start+l.duration;c?c.end=b:(c={start:_,end:b},d.push(c)),this.fragmentTracker.fragBuffered(l)},g.onBufferFlushing=function(y,v){var l=v.startOffset,u=v.endOffset;if(l===0&&u!==Number.POSITIVE_INFINITY){var d=this.currentTrackId,c=this.levels;if(!c.length||!c[d]||!c[d].details)return;var _=c[d].details,f=_.targetduration,b=u-f;if(b<=0)return;v.endOffsetSubtitles=Math.max(0,b),this.tracksBuffered.forEach(function(A){for(var O=0;O<A.length;){if(A[O].end<=b){A.shift();continue}else if(A[O].start<b)A[O].start=b;else break;O++}}),this.fragmentTracker.removeFragmentsInRange(l,b,p.PlaylistLevelType.SUBTITLE)}},g.onError=function(y,v){var l,u=v.frag;if(!u||u.type!==p.PlaylistLevelType.SUBTITLE)return;(l=this.fragCurrent)!==null&&l!==void 0&&l.loader&&this.fragCurrent.loader.abort(),this.state=m.State.IDLE},g.onSubtitleTracksUpdated=function(y,v){var l=this,u=v.subtitleTracks;this.tracksBuffered=[],this.levels=u.map(function(d){return new o.Level(d)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(d){l.tracksBuffered[d.id]=[]}),this.mediaBuffer=null},g.onSubtitleTrackSwitch=function(y,v){if(this.currentTrackId=v.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var l=this.levels[this.currentTrackId];l!=null&&l.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,l&&this.setInterval(e)},g.onSubtitleTrackLoaded=function(y,v){var l,u=v.details,d=v.id,c=this.currentTrackId,_=this.levels;if(!_.length)return;var f=_[c];if(d>=_.length||d!==c||!f)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,u.live||(l=f.details)!==null&&l!==void 0&&l.live){var b=this.mainDetails;if(u.deltaUpdateFailed||!b)return;var A=b.fragments[0];if(!f.details)u.hasProgramDateTime&&b.hasProgramDateTime?Object(L.alignMediaPlaylistByPDT)(u,b):A&&Object(x.addSliding)(u,A.start);else{var O=this.alignPlaylists(u,f.details);O===0&&A&&Object(x.addSliding)(u,A.start)}}if(f.details=u,this.levelLastLoaded=d,this.tick(),u.live&&!this.fragCurrent&&this.media&&this.state===m.State.IDLE){var C=Object(D.findFragmentByPTS)(null,u.fragments,this.media.currentTime,0);C||(this.warn("Subtitle playlist not aligned with playback"),f.details=void 0)}},g._handleFragmentLoadComplete=function(y){var v=y.frag,l=y.payload,u=v.decryptdata,d=this.hls;if(this.fragContextChanged(v))return;if(l&&l.byteLength>0&&u&&u.key&&u.iv&&u.method==="AES-128"){var c=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(l),u.key.buffer,u.iv.buffer).then(function(_){var f=performance.now();d.trigger(N.Events.FRAG_DECRYPTED,{frag:v,payload:_,stats:{tstart:c,tdecrypt:f}})})}},g.doTick=function(){if(!this.media){this.state=m.State.IDLE;return}if(this.state===m.State.IDLE){var y,v=this.currentTrackId,l=this.levels;if(!l.length||!l[v]||!l[v].details)return;var u=l[v].details,d=u.targetduration,c=this.config,_=this.media,f=R.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,_.currentTime-d,c.maxBufferHole),b=f.end,A=f.len,O=this.getMaxBufferLength()+d;if(A>O)return;console.assert(u,"Subtitle track details are defined on idle subtitle stream controller tick");var C=u.fragments,P=C.length,k=u.edge,I,U=this.fragPrevious;if(b<k){var H=c.maxFragLookUpTolerance;U&&u.hasProgramDateTime&&(I=Object(D.findFragmentByPDT)(C,U.endProgramDateTime,H)),I||(I=Object(D.findFragmentByPTS)(U,C,b,H),!I&&U&&U.start<C[0].start&&(I=C[0]))}else I=C[P-1];(y=I)!==null&&y!==void 0&&y.encrypted?(w.logger.log("Loading key for "+I.sn),this.state=m.State.KEY_LOADING,this.hls.trigger(N.Events.KEY_LOADING,{frag:I})):I&&this.fragmentTracker.getState(I)===T.FragmentState.NOT_LOADED&&this.loadFragment(I,u,b)}},g.loadFragment=function(y,v,l){this.fragCurrent=y,r.prototype.loadFragment.call(this,y,v,l)},n(E,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),E}(m.default)},"./src/controller/subtitle-track-controller.ts":function(ae,M,S){"use strict";S.r(M);var N=S("./src/events.ts"),w=S("./src/utils/texttrack-utils.ts"),R=S("./src/controller/base-playlist-controller.ts"),D=S("./src/types/loader.ts");function L(a,n){for(var s=0;s<n.length;s++){var i=n[s];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(a,i.key,i)}}function x(a,n,s){return n&&L(a.prototype,n),s&&L(a,s),a}function T(a,n){a.prototype=Object.create(n.prototype),a.prototype.constructor=a,m(a,n)}function m(a,n){return m=Object.setPrototypeOf||function(i,e){return i.__proto__=e,i},m(a,n)}var p=function(a){T(n,a);function n(i){var e;return e=a.call(this,i,"[subtitle-track-controller]")||this,e.media=null,e.tracks=[],e.groupId=null,e.tracksInGroup=[],e.trackId=-1,e.selectDefaultTrack=!0,e.queuedDefaultTrack=-1,e.trackChangeListener=function(){return e.onTextTracksChanged()},e.asyncPollTrackChange=function(){return e.pollTrackChange(0)},e.useTextTrackPolling=!1,e.subtitlePollingInterval=-1,e.subtitleDisplay=!0,e.registerListeners(),e}var s=n.prototype;return s.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,a.prototype.destroy.call(this)},s.registerListeners=function(){var e=this.hls;e.on(N.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.on(N.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.on(N.Events.LEVEL_LOADING,this.onLevelLoading,this),e.on(N.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(N.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(N.Events.ERROR,this.onError,this)},s.unregisterListeners=function(){var e=this.hls;e.off(N.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.off(N.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.off(N.Events.LEVEL_LOADING,this.onLevelLoading,this),e.off(N.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(N.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(N.Events.ERROR,this.onError,this)},s.onMediaAttached=function(e,t){if(this.media=t.media,!this.media)return;this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange)},s.pollTrackChange=function(e){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,e)},s.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 e=o(this.media.textTracks);e.forEach(function(t){Object(w.clearCurrentCues)(t)}),this.subtitleTrack=-1,this.media=null},s.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},s.onManifestParsed=function(e,t){this.tracks=t.subtitleTracks},s.onSubtitleTrackLoaded=function(e,t){var r=t.id,E=t.details,g=this.trackId,h=this.tracksInGroup[g];if(!h){this.warn("Invalid subtitle track id "+r);return}var y=h.details;h.details=t.details,this.log("subtitle track "+r+" loaded ["+E.startSN+"-"+E.endSN+"]"),r===this.trackId&&(this.retryCount=0,this.playlistLoaded(r,t,y))},s.onLevelLoading=function(e,t){this.switchLevel(t.level)},s.onLevelSwitching=function(e,t){this.switchLevel(t.level)},s.switchLevel=function(e){var t=this.hls.levels[e];if(!(t!=null&&t.textGroupIds))return;var r=t.textGroupIds[t.urlId];if(this.groupId!==r){var E=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,g=this.tracks.filter(function(v){return!r||v.groupId===r});this.tracksInGroup=g;var h=this.findTrackId(E==null?void 0:E.name)||this.findTrackId();this.groupId=r;var y={subtitleTracks:g};this.log("Updating subtitle tracks, "+g.length+' track(s) found in "'+r+'" group-id'),this.hls.trigger(N.Events.SUBTITLE_TRACKS_UPDATED,y),h!==-1&&this.setSubtitleTrack(h,E)}},s.findTrackId=function(e){for(var t=this.tracksInGroup,r=0;r<t.length;r++){var E=t[r];if((!this.selectDefaultTrack||E.default)&&(!e||e===E.name))return E.id}return-1},s.onError=function(e,t){if(a.prototype.onError.call(this,e,t),t.fatal||!t.context)return;t.context.type===D.PlaylistContextType.SUBTITLE_TRACK&&t.context.id===this.trackId&&t.context.groupId===this.groupId&&this.retryLoadingOrFail(t)},s.loadPlaylist=function(e){var t=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(t)){var r=t.id,E=t.groupId,g=t.url;if(e)try{g=e.addDirectives(g)}catch(h){this.warn("Could not construct new URL with HLS Delivery Directives: "+h)}this.log("Loading subtitle playlist for id "+r),this.hls.trigger(N.Events.SUBTITLE_TRACK_LOADING,{url:g,id:r,groupId:E,deliveryDirectives:e||null})}},s.toggleTrackModes=function(e){var t=this,r=this.media,E=this.subtitleDisplay,g=this.trackId;if(!r)return;var h=o(r.textTracks),y=h.filter(function(u){return u.groupId===t.groupId});if(e===-1)[].slice.call(h).forEach(function(u){u.mode="disabled"});else{var v=y[g];v&&(v.mode="disabled")}var l=y[e];l&&(l.mode=E?"showing":"hidden")},s.setSubtitleTrack=function(e,t){var r,E=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=e;return}if(this.trackId!==e&&this.toggleTrackModes(e),this.trackId===e&&(e===-1||(r=E[e])!==null&&r!==void 0&&r.details)||e<-1||e>=E.length)return;this.clearTimer();var g=E[e];if(this.log("Switching to subtitle track "+e),this.trackId=e,g){var h=g.id,y=g.groupId,v=y===void 0?"":y,l=g.name,u=g.type,d=g.url;this.hls.trigger(N.Events.SUBTITLE_TRACK_SWITCH,{id:h,groupId:v,name:l,type:u,url:d});var c=this.switchParams(g.url,t==null?void 0:t.details);this.loadPlaylist(c)}else this.hls.trigger(N.Events.SUBTITLE_TRACK_SWITCH,{id:e})},s.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var e=-1,t=o(this.media.textTracks),r=0;r<t.length;r++)if(t[r].mode==="hidden")e=r;else if(t[r].mode==="showing"){e=r;break}this.subtitleTrack!==e&&(this.subtitleTrack=e)},x(n,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(e){this.selectDefaultTrack=!1;var t=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(e,t)}}]),n}(R.default);function o(a){for(var n=[],s=0;s<a.length;s++){var i=a[s];i.kind==="subtitles"&&i.label&&n.push(a[s])}return n}M.default=p},"./src/controller/timeline-controller.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"TimelineController",function(){return o});var N=S("./src/polyfills/number.ts"),w=S("./src/events.ts"),R=S("./src/utils/cea-608-parser.ts"),D=S("./src/utils/output-filter.ts"),L=S("./src/utils/webvtt-parser.ts"),x=S("./src/utils/texttrack-utils.ts"),T=S("./src/utils/imsc1-ttml-parser.ts"),m=S("./src/types/loader.ts"),p=S("./src/utils/logger.ts"),o=function(){function i(t){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.timescale=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=s(),this.captionsProperties=void 0,this.hls=t,this.config=t.config,this.Cues=t.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){var r=new D.default(this,"textTrack1"),E=new D.default(this,"textTrack2"),g=new D.default(this,"textTrack3"),h=new D.default(this,"textTrack4");this.cea608Parser1=new R.default(1,r,E),this.cea608Parser2=new R.default(3,g,h)}t.on(w.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(w.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(w.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.on(w.Events.MANIFEST_LOADED,this.onManifestLoaded,this),t.on(w.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.on(w.Events.FRAG_LOADING,this.onFragLoading,this),t.on(w.Events.FRAG_LOADED,this.onFragLoaded,this),t.on(w.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),t.on(w.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),t.on(w.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),t.on(w.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),t.on(w.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var e=i.prototype;return e.destroy=function(){var r=this.hls;r.off(w.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),r.off(w.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.off(w.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.off(w.Events.MANIFEST_LOADED,this.onManifestLoaded,this),r.off(w.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),r.off(w.Events.FRAG_LOADING,this.onFragLoading,this),r.off(w.Events.FRAG_LOADED,this.onFragLoaded,this),r.off(w.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),r.off(w.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),r.off(w.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),r.off(w.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),r.off(w.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},e.addCues=function(r,E,g,h,y){for(var v=!1,l=y.length;l--;){var u=y[l],d=n(u[0],u[1],E,g);if(d>=0&&(u[0]=Math.min(u[0],E),u[1]=Math.max(u[1],g),v=!0,d/(g-E)>.5))return}if(v||y.push([E,g]),this.config.renderTextTracksNatively){var c=this.captionsTracks[r];this.Cues.newCue(c,E,g,h)}else{var _=this.Cues.newCue(null,E,g,h);this.hls.trigger(w.Events.CUES_PARSED,{type:"captions",cues:_,track:r})}},e.onInitPtsFound=function(r,E){var g=this,h=E.frag,y=E.id,v=E.initPTS,l=E.timescale,u=this.unparsedVttFrags;y==="main"&&(this.initPTS[h.cc]=v,this.timescale[h.cc]=l),u.length&&(this.unparsedVttFrags=[],u.forEach(function(d){g.onFragLoaded(w.Events.FRAG_LOADED,d)}))},e.getExistingTrack=function(r){var E=this.media;if(E)for(var g=0;g<E.textTracks.length;g++){var h=E.textTracks[g];if(h[r])return h}return null},e.createCaptionsTrack=function(r){this.config.renderTextTracksNatively?this.createNativeTrack(r):this.createNonNativeTrack(r)},e.createNativeTrack=function(r){if(this.captionsTracks[r])return;var E=this.captionsProperties,g=this.captionsTracks,h=this.media,y=E[r],v=y.label,l=y.languageCode,u=this.getExistingTrack(r);if(u)g[r]=u,Object(x.clearCurrentCues)(g[r]),Object(x.sendAddTrackEvent)(g[r],h);else{var d=this.createTextTrack("captions",v,l);d&&(d[r]=!0,g[r]=d)}},e.createNonNativeTrack=function(r){if(this.nonNativeCaptionsTracks[r])return;var E=this.captionsProperties[r];if(!E)return;var g=E.label,h={_id:r,label:g,kind:"captions",default:E.media?!!E.media.default:!1,closedCaptions:E.media};this.nonNativeCaptionsTracks[r]=h,this.hls.trigger(w.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[h]})},e.createTextTrack=function(r,E,g){var h=this.media;return h?h.addTextTrack(r,E,g):void 0},e.onMediaAttaching=function(r,E){this.media=E.media,this._cleanTracks()},e.onMediaDetaching=function(){var r=this.captionsTracks;Object.keys(r).forEach(function(E){Object(x.clearCurrentCues)(r[E]),delete r[E]}),this.nonNativeCaptionsTracks={}},e.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=s(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.timescale=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())},e._cleanTracks=function(){var r=this.media;if(!r)return;var E=r.textTracks;if(E)for(var g=0;g<E.length;g++)Object(x.clearCurrentCues)(E[g])},e.onSubtitleTracksUpdated=function(r,E){var g=this;this.textTracks=[];var h=E.subtitleTracks||[],y=h.some(function(d){return d.textCodec===T.IMSC1_CODEC});if(this.config.enableWebVTT||y&&this.config.enableIMSC1){var v=this.tracks&&h&&this.tracks.length===h.length;if(this.tracks=h||[],this.config.renderTextTracksNatively){var l=this.media?this.media.textTracks:[];this.tracks.forEach(function(d,c){var _;if(c<l.length){for(var f=null,b=0;b<l.length;b++)if(a(l[b],d)){f=l[b];break}f&&(_=f)}_?Object(x.clearCurrentCues)(_):(_=g.createTextTrack("subtitles",d.name,d.lang),_&&(_.mode="disabled")),_&&(_.groupId=d.groupId,g.textTracks.push(_))})}else if(!v&&this.tracks&&this.tracks.length){var u=this.tracks.map(function(d){return{label:d.name,kind:d.type.toLowerCase(),default:d.default,subtitleTrack:d}});this.hls.trigger(w.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:u})}}},e.onManifestLoaded=function(r,E){var g=this;this.config.enableCEA708Captions&&E.captions&&E.captions.forEach(function(h){var y=/(?:CC|SERVICE)([1-4])/.exec(h.instreamId);if(!y)return;var v="textTrack"+y[1],l=g.captionsProperties[v];if(!l)return;l.label=h.name,h.lang&&(l.languageCode=h.lang),l.media=h})},e.onFragLoading=function(r,E){var g=this.cea608Parser1,h=this.cea608Parser2,y=this.lastSn,v=this.lastPartIndex;if(!this.enabled||!(g&&h))return;if(E.frag.type===m.PlaylistLevelType.MAIN){var l,u,d=E.frag.sn,c=(l=E==null||((u=E.part)===null||u===void 0)?void 0:u.index)!=null?l:-1;d===y+1||d===y&&c===v+1||(g.reset(),h.reset()),this.lastSn=d,this.lastPartIndex=c}},e.onFragLoaded=function(r,E){var g=E.frag,h=E.payload,y=this.initPTS,v=this.unparsedVttFrags;if(g.type===m.PlaylistLevelType.SUBTITLE)if(h.byteLength){if(!Object(N.isFiniteNumber)(y[g.cc])){v.push(E),y.length&&this.hls.trigger(w.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:g,error:new Error("Missing initial subtitle PTS")});return}var l=g.decryptdata;if(l==null||l.key==null||l.method!=="AES-128"){var u=this.tracks[g.level],d=this.vttCCs;d[g.cc]||(d[g.cc]={start:g.start,prevCC:this.prevCC,new:!0},this.prevCC=g.cc),u&&u.textCodec===T.IMSC1_CODEC?this._parseIMSC1(g,h):this._parseVTTs(g,h,d)}}else this.hls.trigger(w.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:g,error:new Error("Empty subtitle payload")})},e._parseIMSC1=function(r,E){var g=this,h=this.hls;Object(T.parseIMSC1)(E,this.initPTS[r.cc],this.timescale[r.cc],function(y){g._appendCues(y,r.level),h.trigger(w.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:r})},function(y){p.logger.log("Failed to parse IMSC1: "+y),h.trigger(w.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:r,error:y})})},e._parseVTTs=function(r,E,g){var h=this,y=this.hls;Object(L.parseWebVTT)(E,this.initPTS[r.cc],this.timescale[r.cc],g,r.cc,r.start,function(v){h._appendCues(v,r.level),y.trigger(w.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:r})},function(v){h._fallbackToIMSC1(r,E),p.logger.log("Failed to parse VTT cue: "+v),y.trigger(w.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:r,error:v})})},e._fallbackToIMSC1=function(r,E){var g=this,h=this.tracks[r.level];h.textCodec||Object(T.parseIMSC1)(E,this.initPTS[r.cc],this.timescale[r.cc],function(){h.textCodec=T.IMSC1_CODEC,g._parseIMSC1(r,E)},function(){h.textCodec="wvtt"})},e._appendCues=function(r,E){var g=this.hls;if(this.config.renderTextTracksNatively){var h=this.textTracks[E];if(h.mode==="disabled")return;r.forEach(function(l){return Object(x.addCueToTrack)(h,l)})}else{var y=this.tracks[E],v=y.default?"default":"subtitles"+E;g.trigger(w.Events.CUES_PARSED,{type:"subtitles",cues:r,track:v})}},e.onFragDecrypted=function(r,E){var g=E.frag;if(g.type===m.PlaylistLevelType.SUBTITLE){if(!Object(N.isFiniteNumber)(this.initPTS[g.cc])){this.unparsedVttFrags.push(E);return}this.onFragLoaded(w.Events.FRAG_LOADED,E)}},e.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},e.onFragParsingUserdata=function(r,E){var g=this.cea608Parser1,h=this.cea608Parser2;if(!this.enabled||!(g&&h))return;for(var y=0;y<E.samples.length;y++){var v=E.samples[y].bytes;if(v){var l=this.extractCea608Data(v);g.addData(E.samples[y].pts,l[0]),h.addData(E.samples[y].pts,l[1])}}},e.onBufferFlushing=function(r,E){var g=E.startOffset,h=E.endOffset,y=E.endOffsetSubtitles,v=E.type,l=this.media;if(!l||l.currentTime<h)return;if(!v||v==="video"){var u=this.captionsTracks;Object.keys(u).forEach(function(c){return Object(x.removeCuesInRange)(u[c],g,h)})}if(this.config.renderTextTracksNatively&&(g===0&&y!==void 0)){var d=this.textTracks;Object.keys(d).forEach(function(c){return Object(x.removeCuesInRange)(d[c],g,y)})}},e.extractCea608Data=function(r){for(var E=r[0]&31,g=2,h=[[],[]],y=0;y<E;y++){var v=r[g++],l=127&r[g++],u=127&r[g++],d=(4&v)!==0,c=3&v;if(l===0&&u===0)continue;d&&((c===0||c===1)&&(h[c].push(l),h[c].push(u)))}return h},i}();function a(i,e){return i&&i.label===e.name&&!(i.textTrack1||i.textTrack2)}function n(i,e,t,r){return Math.min(e,r)-Math.max(i,t)}function s(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"default",function(){return N});var N=function(){function w(D,L){this.subtle=void 0,this.aesIV=void 0,this.subtle=D,this.aesIV=L}var R=w.prototype;return R.decrypt=function(L,x){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},x,L)},w}()},"./src/crypt/aes-decryptor.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"removePadding",function(){return w}),S.d(M,"default",function(){return R});var N=S("./src/utils/typed-array.ts");function w(D){var L=D.byteLength,x=L&&new DataView(D.buffer).getUint8(L-1);return x?Object(N.sliceUint8)(D,0,L-x):D}var R=function(){function D(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}var L=D.prototype;return L.uint8ArrayToUint32Array_=function(T){for(var m=new DataView(T),p=new Uint32Array(4),o=0;o<4;o++)p[o]=m.getUint32(o*4);return p},L.initTable=function(){var T=this.sBox,m=this.invSBox,p=this.subMix,o=p[0],a=p[1],n=p[2],s=p[3],i=this.invSubMix,e=i[0],t=i[1],r=i[2],E=i[3],g=new Uint32Array(256),h=0,y=0,v=0;for(v=0;v<256;v++)v<128?g[v]=v<<1:g[v]=v<<1^283;for(v=0;v<256;v++){var l=y^y<<1^y<<2^y<<3^y<<4;l=l>>>8^l&255^99,T[h]=l,m[l]=h;var u=g[h],d=g[u],c=g[d],_=g[l]*257^l*16843008;o[h]=_<<24|_>>>8,a[h]=_<<16|_>>>16,n[h]=_<<8|_>>>24,s[h]=_,_=c*16843009^d*65537^u*257^h*16843008,e[l]=_<<24|_>>>8,t[l]=_<<16|_>>>16,r[l]=_<<8|_>>>24,E[l]=_,h?(h=u^g[g[g[c^u]]],y^=g[g[y]]):h=y=1}},L.expandKey=function(T){for(var m=this.uint8ArrayToUint32Array_(T),p=!0,o=0;o<m.length&&p;)p=m[o]===this.key[o],o++;if(p)return;this.key=m;var a=this.keySize=m.length;if(a!==4&&a!==6&&a!==8)throw new Error("Invalid aes key size="+a);var n=this.ksRows=(a+6+1)*4,s,i,e=this.keySchedule=new Uint32Array(n),t=this.invKeySchedule=new Uint32Array(n),r=this.sBox,E=this.rcon,g=this.invSubMix,h=g[0],y=g[1],v=g[2],l=g[3],u,d;for(s=0;s<n;s++){if(s<a){u=e[s]=m[s];continue}d=u,s%a===0?(d=d<<8|d>>>24,d=r[d>>>24]<<24|r[d>>>16&255]<<16|r[d>>>8&255]<<8|r[d&255],d^=E[s/a|0]<<24):a>6&&s%a===4&&(d=r[d>>>24]<<24|r[d>>>16&255]<<16|r[d>>>8&255]<<8|r[d&255]),e[s]=u=(e[s-a]^d)>>>0}for(i=0;i<n;i++)s=n-i,i&3?d=e[s]:d=e[s-4],i<4||s<=4?t[i]=d:t[i]=h[r[d>>>24]]^y[r[d>>>16&255]]^v[r[d>>>8&255]]^l[r[d&255]],t[i]=t[i]>>>0},L.networkToHostOrderSwap=function(T){return T<<24|(T&65280)<<8|(T&16711680)>>8|T>>>24},L.decrypt=function(T,m,p){for(var o=this.keySize+6,a=this.invKeySchedule,n=this.invSBox,s=this.invSubMix,i=s[0],e=s[1],t=s[2],r=s[3],E=this.uint8ArrayToUint32Array_(p),g=E[0],h=E[1],y=E[2],v=E[3],l=new Int32Array(T),u=new Int32Array(l.length),d,c,_,f,b,A,O,C,P,k,I,U,H,Z,$=this.networkToHostOrderSwap;m<l.length;){for(P=$(l[m]),k=$(l[m+1]),I=$(l[m+2]),U=$(l[m+3]),b=P^a[0],A=U^a[1],O=I^a[2],C=k^a[3],H=4,Z=1;Z<o;Z++)d=i[b>>>24]^e[A>>16&255]^t[O>>8&255]^r[C&255]^a[H],c=i[A>>>24]^e[O>>16&255]^t[C>>8&255]^r[b&255]^a[H+1],_=i[O>>>24]^e[C>>16&255]^t[b>>8&255]^r[A&255]^a[H+2],f=i[C>>>24]^e[b>>16&255]^t[A>>8&255]^r[O&255]^a[H+3],b=d,A=c,O=_,C=f,H=H+4;d=n[b>>>24]<<24^n[A>>16&255]<<16^n[O>>8&255]<<8^n[C&255]^a[H],c=n[A>>>24]<<24^n[O>>16&255]<<16^n[C>>8&255]<<8^n[b&255]^a[H+1],_=n[O>>>24]<<24^n[C>>16&255]<<16^n[b>>8&255]<<8^n[A&255]^a[H+2],f=n[C>>>24]<<24^n[b>>16&255]<<16^n[A>>8&255]<<8^n[O&255]^a[H+3],u[m]=$(d^g),u[m+1]=$(f^h),u[m+2]=$(_^y),u[m+3]=$(c^v),g=P,h=k,y=I,v=U,m=m+4}return u.buffer},D}()},"./src/crypt/decrypter.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"default",function(){return m});var N=S("./src/crypt/aes-crypto.ts"),w=S("./src/crypt/fast-aes-key.ts"),R=S("./src/crypt/aes-decryptor.ts"),D=S("./src/utils/logger.ts"),L=S("./src/utils/mp4-tools.ts"),x=S("./src/utils/typed-array.ts"),T=16,m=function(){function p(a,n,s){var i=s===void 0?{}:s,e=i.removePKCS7Padding,t=e===void 0?!0:e;if(this.logEnabled=!0,this.observer=void 0,this.config=void 0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.observer=a,this.config=n,this.removePKCS7Padding=t,t)try{var r=self.crypto;r&&(this.subtle=r.subtle||r.webkitSubtle)}catch(E){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var o=p.prototype;return o.destroy=function(){this.observer=null},o.isSync=function(){return this.config.enableSoftwareAES},o.flush=function(){var n=this.currentResult;if(!n){this.reset();return}var s=new Uint8Array(n);return this.reset(),this.removePKCS7Padding?Object(R.removePadding)(s):s},o.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},o.decrypt=function(n,s,i,e){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(n),s,i);var t=this.flush();t&&e(t.buffer)}else this.webCryptoDecrypt(new Uint8Array(n),s,i).then(e)},o.softwareDecrypt=function(n,s,i){var e=this.currentIV,t=this.currentResult,r=this.remainderData;this.logOnce("JS AES decrypt"),r&&(n=Object(L.appendUint8Array)(r,n),this.remainderData=null);var E=this.getValidChunk(n);if(!E.length)return null;e&&(i=e);var g=this.softwareDecrypter;g||(g=this.softwareDecrypter=new R.default),g.expandKey(s);var h=t;return this.currentResult=g.decrypt(E.buffer,0,i),this.currentIV=Object(x.sliceUint8)(E,-16).buffer,h||null},o.webCryptoDecrypt=function(n,s,i){var e=this,t=this.subtle;return(this.key!==s||!this.fastAesKey)&&(this.key=s,this.fastAesKey=new w.default(t,s)),this.fastAesKey.expandKey().then(function(r){if(!t)return Promise.reject(new Error("web crypto not initialized"));var E=new N.default(t,i);return E.decrypt(n.buffer,r)}).catch(function(r){return e.onWebCryptoError(r,n,s,i)})},o.onWebCryptoError=function(n,s,i,e){return D.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",n),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(s,i,e)},o.getValidChunk=function(n){var s=n,i=n.length-n.length%T;return i!==n.length&&(s=Object(x.sliceUint8)(n,0,i),this.remainderData=Object(x.sliceUint8)(n,i)),s},o.logOnce=function(n){if(!this.logEnabled)return;D.logger.log("[decrypter.ts]: "+n),this.logEnabled=!1},p}()},"./src/crypt/fast-aes-key.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"default",function(){return N});var N=function(){function w(D,L){this.subtle=void 0,this.key=void 0,this.subtle=D,this.key=L}var R=w.prototype;return R.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},w}()},"./src/demux/aacdemuxer.ts":function(ae,M,S){"use strict";S.r(M);var N=S("./src/demux/base-audio-demuxer.ts"),w=S("./src/demux/adts.ts"),R=S("./src/utils/logger.ts"),D=S("./src/demux/id3.ts");function L(m,p){m.prototype=Object.create(p.prototype),m.prototype.constructor=m,x(m,p)}function x(m,p){return x=Object.setPrototypeOf||function(a,n){return a.__proto__=n,a},x(m,p)}var T=function(m){L(p,m);function p(a,n){var s;return s=m.call(this)||this,s.observer=void 0,s.config=void 0,s.observer=a,s.config=n,s}var o=p.prototype;return o.resetInitSegment=function(n,s,i){m.prototype.resetInitSegment.call(this,n,s,i),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:n,duration:i,inputTimeScale:9e4,dropped:0}},p.probe=function(n){if(!n)return!1;for(var s=D.getID3Data(n,0)||[],i=s.length,e=n.length;i<e;i++)if(w.probe(n,i))return R.logger.log("ADTS sync word found !"),!0;return!1},o.canParse=function(n,s){return w.canParse(n,s)},o.appendFrame=function(n,s,i){w.initTrackConfig(n,this.observer,s,i,n.manifestCodec);var e=w.appendFrame(n,s,i,this.initPTS,this.frameIndex);if(e&&e.missing===0)return e},p}(N.default);T.minProbeByteLength=9,M.default=T},"./src/demux/adts.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"getAudioConfig",function(){return D}),S.d(M,"isHeaderPattern",function(){return L}),S.d(M,"getHeaderLength",function(){return x}),S.d(M,"getFullFrameLength",function(){return T}),S.d(M,"canGetFrameLength",function(){return m}),S.d(M,"isHeader",function(){return p}),S.d(M,"canParse",function(){return o}),S.d(M,"probe",function(){return a}),S.d(M,"initTrackConfig",function(){return n}),S.d(M,"getFrameDuration",function(){return s}),S.d(M,"parseFrameHeader",function(){return i}),S.d(M,"appendFrame",function(){return e});var N=S("./src/utils/logger.ts"),w=S("./src/errors.ts"),R=S("./src/events.ts");function D(t,r,E,g){var h,y,v,l,u=navigator.userAgent.toLowerCase(),d=g,c=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];h=((r[E+2]&192)>>>6)+1;var _=(r[E+2]&60)>>>2;if(_>c.length-1){t.trigger(R.Events.ERROR,{type:w.ErrorTypes.MEDIA_ERROR,details:w.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+_});return}return v=(r[E+2]&1)<<2,v|=(r[E+3]&192)>>>6,N.logger.log("manifest codec:"+g+", ADTS type:"+h+", samplingIndex:"+_),/firefox/i.test(u)?_>=6?(h=5,l=new Array(4),y=_-3):(h=2,l=new Array(2),y=_):u.indexOf("android")!==-1?(h=2,l=new Array(2),y=_):(h=5,l=new Array(4),g&&(g.indexOf("mp4a.40.29")!==-1||g.indexOf("mp4a.40.5")!==-1)||!g&&_>=6?y=_-3:((g&&g.indexOf("mp4a.40.2")!==-1&&(_>=6&&v===1||/vivaldi/i.test(u))||!g&&v===1)&&(h=2,l=new Array(2)),y=_)),l[0]=h<<3,l[0]|=(_&14)>>1,l[1]|=(_&1)<<7,l[1]|=v<<3,h===5&&(l[1]|=(y&14)>>1,l[2]=(y&1)<<7,l[2]|=2<<2,l[3]=0),{config:l,samplerate:c[_],channelCount:v,codec:"mp4a.40."+h,manifestCodec:d}}function L(t,r){return t[r]===255&&(t[r+1]&246)===240}function x(t,r){return t[r+1]&1?7:9}function T(t,r){return(t[r+3]&3)<<11|t[r+4]<<3|(t[r+5]&224)>>>5}function m(t,r){return r+5<t.length}function p(t,r){return r+1<t.length&&L(t,r)}function o(t,r){return m(t,r)&&L(t,r)&&T(t,r)<=t.length-r}function a(t,r){if(p(t,r)){var E=x(t,r);if(r+E>=t.length)return!1;var g=T(t,r);if(g<=E)return!1;var h=r+g;return h===t.length||p(t,h)}return!1}function n(t,r,E,g,h){if(!t.samplerate){var y=D(r,E,g,h);if(!y)return;t.config=y.config,t.samplerate=y.samplerate,t.channelCount=y.channelCount,t.codec=y.codec,t.manifestCodec=y.manifestCodec,N.logger.log("parsed codec:"+t.codec+", rate:"+y.samplerate+", channels:"+y.channelCount)}}function s(t){return 1024*9e4/t}function i(t,r,E,g,h){var y=x(t,r),v=T(t,r);if(v-=y,v>0){var l=E+g*h;return{headerLength:y,frameLength:v,stamp:l}}}function e(t,r,E,g,h){var y=s(t.samplerate),v=i(r,E,g,h,y);if(v){var l=v.frameLength,u=v.headerLength,d=v.stamp,c=u+l,_=Math.max(0,E+c-r.length),f;_?(f=new Uint8Array(c-u),f.set(r.subarray(E+u,r.length),0)):f=r.subarray(E+u,E+c);var b={unit:f,pts:d};return _||t.samples.push(b),{sample:b,length:c,missing:_}}}},"./src/demux/base-audio-demuxer.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"initPTSFn",function(){return T});var N=S("./src/polyfills/number.ts"),w=S("./src/demux/id3.ts"),R=S("./src/demux/dummy-demuxed-track.ts"),D=S("./src/utils/mp4-tools.ts"),L=S("./src/utils/typed-array.ts"),x=function(){function m(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var p=m.prototype;return p.resetInitSegment=function(a,n,s){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},p.resetTimeStamp=function(){},p.resetContiguity=function(){},p.canParse=function(a,n){return!1},p.appendFrame=function(a,n,s){},p.demux=function(a,n){this.cachedData&&(a=Object(D.appendUint8Array)(this.cachedData,a),this.cachedData=null);var s=w.getID3Data(a,0),i=s?s.length:0,e,t,r=this._audioTrack,E=this._id3Track,g=s?w.getTimeStamp(s):void 0,h=a.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=T(g,n)),s&&s.length>0&&E.samples.push({pts:this.initPTS,dts:this.initPTS,data:s}),t=this.initPTS;i<h;){if(this.canParse(a,i)){var y=this.appendFrame(r,a,i);y?(this.frameIndex++,t=y.sample.pts,i+=y.length,e=i):i=h}else w.canParse(a,i)?(s=w.getID3Data(a,i),E.samples.push({pts:t,dts:t,data:s}),i+=s.length,e=i):i++;if(i===h&&e!==h){var v=Object(L.sliceUint8)(a,e);this.cachedData?this.cachedData=Object(D.appendUint8Array)(this.cachedData,v):this.cachedData=v}}return{audioTrack:r,avcTrack:Object(R.dummyTrack)(),id3Track:E,textTrack:Object(R.dummyTrack)()}},p.demuxSampleAes=function(a,n,s){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},p.flush=function(a){var n=this.cachedData;return n&&(this.cachedData=null,this.demux(n,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(R.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(R.dummyTrack)()}},p.destroy=function(){},m}(),T=function(p,o){return Object(N.isFiniteNumber)(p)?p*90:o*9e4};M.default=x},"./src/demux/chunk-cache.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"default",function(){return N});var N=function(){function R(){this.chunks=[],this.dataLength=0}var D=R.prototype;return D.push=function(x){this.chunks.push(x),this.dataLength+=x.length},D.flush=function(){var x=this.chunks,T=this.dataLength,m;if(x.length)x.length===1?m=x[0]:m=w(x,T);else return new Uint8Array(0);return this.reset(),m},D.reset=function(){this.chunks.length=0,this.dataLength=0},R}();function w(R,D){for(var L=new Uint8Array(D),x=0,T=0;T<R.length;T++){var m=R[T];L.set(m,x),x+=m.length}return L}},"./src/demux/dummy-demuxed-track.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"dummyTrack",function(){return N});function N(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(ae,M,S){"use strict";S.r(M);var N=S("./src/utils/logger.ts"),w=function(){function R(L){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=L,this.bytesAvailable=L.byteLength,this.word=0,this.bitsAvailable=0}var D=R.prototype;return D.loadWord=function(){var x=this.data,T=this.bytesAvailable,m=x.byteLength-T,p=new Uint8Array(4),o=Math.min(4,T);if(o===0)throw new Error("no bytes available");p.set(x.subarray(m,m+o)),this.word=new DataView(p.buffer).getUint32(0),this.bitsAvailable=o*8,this.bytesAvailable-=o},D.skipBits=function(x){var T;this.bitsAvailable>x?(this.word<<=x,this.bitsAvailable-=x):(x-=this.bitsAvailable,T=x>>3,x-=T>>3,this.bytesAvailable-=T,this.loadWord(),this.word<<=x,this.bitsAvailable-=x)},D.readBits=function(x){var T=Math.min(this.bitsAvailable,x),m=this.word>>>32-T;return x>32&&N.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=T,this.bitsAvailable>0?this.word<<=T:this.bytesAvailable>0&&this.loadWord(),T=x-T,T>0&&this.bitsAvailable?m<<T|this.readBits(T):m},D.skipLZ=function(){var x;for(x=0;x<this.bitsAvailable;++x)if((this.word&2147483648>>>x)!==0)return this.word<<=x,this.bitsAvailable-=x,x;return this.loadWord(),x+this.skipLZ()},D.skipUEG=function(){this.skipBits(1+this.skipLZ())},D.skipEG=function(){this.skipBits(1+this.skipLZ())},D.readUEG=function(){var x=this.skipLZ();return this.readBits(x+1)-1},D.readEG=function(){var x=this.readUEG();return 1&x?1+x>>>1:-1*(x>>>1)},D.readBoolean=function(){return this.readBits(1)===1},D.readUByte=function(){return this.readBits(8)},D.readUShort=function(){return this.readBits(16)},D.readUInt=function(){return this.readBits(32)},D.skipScalingList=function(x){for(var T=8,m=8,p,o=0;o<x;o++)m!==0&&(p=this.readEG(),m=(T+p+256)%256),T=m===0?T:m},D.readSPS=function(){var x=0,T=0,m=0,p=0,o,a,n,s=this.readUByte.bind(this),i=this.readBits.bind(this),e=this.readUEG.bind(this),t=this.readBoolean.bind(this),r=this.skipBits.bind(this),E=this.skipEG.bind(this),g=this.skipUEG.bind(this),h=this.skipScalingList.bind(this);s();var y=s();if(i(5),r(3),s(),g(),y===100||y===110||y===122||y===244||y===44||y===83||y===86||y===118||y===128){var v=e();if(v===3&&r(1),g(),g(),r(1),t())for(a=v!==3?8:12,n=0;n<a;n++)t()&&(n<6?h(16):h(64))}g();var l=e();if(l===0)e();else if(l===1)for(r(1),E(),E(),o=e(),n=0;n<o;n++)E();g(),r(1);var u=e(),d=e(),c=i(1);c===0&&r(1),r(1),t()&&(x=e(),T=e(),m=e(),p=e());var _=[1,1];if(t()&&t()){var f=s();switch(f){case 1:_=[1,1];break;case 2:_=[12,11];break;case 3:_=[10,11];break;case 4:_=[16,11];break;case 5:_=[40,33];break;case 6:_=[24,11];break;case 7:_=[20,11];break;case 8:_=[32,11];break;case 9:_=[80,33];break;case 10:_=[18,11];break;case 11:_=[15,11];break;case 12:_=[64,33];break;case 13:_=[160,99];break;case 14:_=[4,3];break;case 15:_=[3,2];break;case 16:_=[2,1];break;case 255:{_=[s()<<8|s(),s()<<8|s()];break}}}return{width:Math.ceil((u+1)*16-x*2-T*2),height:(2-c)*(d+1)*16-(c?2:4)*(m+p),pixelRatio:_}},D.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},R}();M.default=w},"./src/demux/id3.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"isHeader",function(){return N}),S.d(M,"isFooter",function(){return w}),S.d(M,"getID3Data",function(){return R}),S.d(M,"canParse",function(){return L}),S.d(M,"getTimeStamp",function(){return x}),S.d(M,"isTimeStampFrame",function(){return T}),S.d(M,"getID3Frames",function(){return p}),S.d(M,"decodeFrame",function(){return o}),S.d(M,"utf8ArrayToStr",function(){return e}),S.d(M,"testables",function(){return t});var N=function(h,y){return y+10<=h.length&&(h[y]===73&&h[y+1]===68&&h[y+2]===51&&(h[y+3]<255&&h[y+4]<255&&(h[y+6]<128&&h[y+7]<128&&h[y+8]<128&&h[y+9]<128)))},w=function(h,y){return y+10<=h.length&&(h[y]===51&&h[y+1]===68&&h[y+2]===73&&(h[y+3]<255&&h[y+4]<255&&(h[y+6]<128&&h[y+7]<128&&h[y+8]<128&&h[y+9]<128)))},R=function(h,y){for(var v=y,l=0;N(h,y);){l+=10;var u=D(h,y+6);l+=u,w(h,y+10)&&(l+=10),y+=l}return l>0?h.subarray(v,v+l):void 0},D=function(h,y){var v=0;return v=(h[y]&127)<<21,v|=(h[y+1]&127)<<14,v|=(h[y+2]&127)<<7,v|=h[y+3]&127,v},L=function(h,y){return N(h,y)&&D(h,y+6)+10<=h.length-y},x=function(h){for(var y=p(h),v=0;v<y.length;v++){var l=y[v];if(T(l))return i(l)}return},T=function(h){return h&&h.key==="PRIV"&&h.info==="com.apple.streaming.transportStreamTimestamp"},m=function(h){var y=String.fromCharCode(h[0],h[1],h[2],h[3]),v=D(h,4),l=10;return{type:y,size:v,data:h.subarray(l,l+v)}},p=function(h){for(var y=0,v=[];N(h,y);){var l=D(h,y+6);y+=10;for(var u=y+l;y+8<u;){var d=m(h.subarray(y)),c=o(d);c&&v.push(c),y+=d.size+10}w(h,y)&&(y+=10)}return v},o=function(h){return h.type==="PRIV"?a(h):h.type[0]==="W"?s(h):n(h)},a=function(h){if(h.size<2)return;var y=e(h.data,!0),v=new Uint8Array(h.data.subarray(y.length+1));return{key:h.type,info:y,data:v.buffer}},n=function(h){if(h.size<2)return;if(h.type==="TXXX"){var y=1,v=e(h.data.subarray(y),!0);y+=v.length+1;var l=e(h.data.subarray(y));return{key:h.type,info:v,data:l}}var u=e(h.data.subarray(1));return{key:h.type,data:u}},s=function(h){if(h.type==="WXXX"){if(h.size<2)return;var y=1,v=e(h.data.subarray(y),!0);y+=v.length+1;var l=e(h.data.subarray(y));return{key:h.type,info:v,data:l}}var u=e(h.data);return{key:h.type,data:u}},i=function(h){if(h.data.byteLength===8){var y=new Uint8Array(h.data),v=y[3]&1,l=(y[4]<<23)+(y[5]<<15)+(y[6]<<7)+y[7];return l/=45,v&&(l+=4772185884e-2),Math.round(l)}return},e=function(h,y){y===void 0&&(y=!1);var v=E();if(v){var l=v.decode(h);if(y){var u=l.indexOf("\0");return u!==-1?l.substring(0,u):l}return l.replace(/\0/g,"")}for(var d=h.length,c,_,f,b="",A=0;A<d;){if(c=h[A++],c===0&&y)return b;if(c===0||c===3)continue;switch(c>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:b+=String.fromCharCode(c);break;case 12:case 13:_=h[A++],b+=String.fromCharCode((c&31)<<6|_&63);break;case 14:_=h[A++],f=h[A++],b+=String.fromCharCode((c&15)<<12|(_&63)<<6|(f&63)<<0);break;default:}}return b},t={decodeTextFrame:n},r;function E(){return!r&&typeof self.TextDecoder!="undefined"&&(r=new self.TextDecoder("utf-8")),r}},"./src/demux/mp3demuxer.ts":function(ae,M,S){"use strict";S.r(M);var N=S("./src/demux/base-audio-demuxer.ts"),w=S("./src/demux/id3.ts"),R=S("./src/utils/logger.ts"),D=S("./src/demux/mpegaudio.ts");function L(m,p){m.prototype=Object.create(p.prototype),m.prototype.constructor=m,x(m,p)}function x(m,p){return x=Object.setPrototypeOf||function(a,n){return a.__proto__=n,a},x(m,p)}var T=function(m){L(p,m);function p(){return m.apply(this,arguments)||this}var o=p.prototype;return o.resetInitSegment=function(n,s,i){m.prototype.resetInitSegment.call(this,n,s,i),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:n,duration:i,inputTimeScale:9e4,dropped:0}},p.probe=function(n){if(!n)return!1;for(var s=w.getID3Data(n,0)||[],i=s.length,e=n.length;i<e;i++)if(D.probe(n,i))return R.logger.log("MPEG Audio sync word found !"),!0;return!1},o.canParse=function(n,s){return D.canParse(n,s)},o.appendFrame=function(n,s,i){return this.initPTS===null?void 0:D.appendFrame(n,s,i,this.initPTS,this.frameIndex)},p}(N.default);T.minProbeByteLength=4,M.default=T},"./src/demux/mp4demuxer.ts":function(ae,M,S){"use strict";S.r(M);var N=S("./src/utils/mp4-tools.ts"),w=S("./src/demux/dummy-demuxed-track.ts"),R=function(){function D(x,T){this.remainderData=null,this.config=void 0,this.config=T}var L=D.prototype;return L.resetTimeStamp=function(){},L.resetInitSegment=function(){},L.resetContiguity=function(){},D.probe=function(T){return Object(N.findBox)({data:T,start:0,end:Math.min(T.length,16384)},["moof"]).length>0},L.demux=function(T){var m=T,p=Object(w.dummyTrack)();if(this.config.progressive){this.remainderData&&(m=Object(N.appendUint8Array)(this.remainderData,T));var o=Object(N.segmentValidRange)(m);this.remainderData=o.remainder,p.samples=o.valid||new Uint8Array}else p.samples=m;return{audioTrack:Object(w.dummyTrack)(),avcTrack:p,id3Track:Object(w.dummyTrack)(),textTrack:Object(w.dummyTrack)()}},L.flush=function(){var T=Object(w.dummyTrack)();return T.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(w.dummyTrack)(),avcTrack:T,id3Track:Object(w.dummyTrack)(),textTrack:Object(w.dummyTrack)()}},L.demuxSampleAes=function(T,m,p){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},L.destroy=function(){},D}();R.minProbeByteLength=1024,M.default=R},"./src/demux/mpegaudio.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"appendFrame",function(){return x}),S.d(M,"parseHeader",function(){return T}),S.d(M,"isHeaderPattern",function(){return m}),S.d(M,"isHeader",function(){return p}),S.d(M,"canParse",function(){return o}),S.d(M,"probe",function(){return a});var N=null,w=[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],R=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],D=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],L=[0,1,1,4];function x(n,s,i,e,t){if(i+24>s.length)return;var r=T(s,i);if(r&&i+r.frameLength<=s.length){var E=r.samplesPerFrame*9e4/r.sampleRate,g=e+t*E,h={unit:s.subarray(i,i+r.frameLength),pts:g,dts:g};return n.config=[],n.channelCount=r.channelCount,n.samplerate=r.sampleRate,n.samples.push(h),{sample:h,length:r.frameLength,missing:0}}}function T(n,s){var i=n[s+1]>>3&3,e=n[s+1]>>1&3,t=n[s+2]>>4&15,r=n[s+2]>>2&3;if(i!==1&&t!==0&&t!==15&&r!==3){var E=n[s+2]>>1&1,g=n[s+3]>>6,h=i===3?3-e:e===3?3:4,y=w[h*14+t-1]*1e3,v=i===3?0:i===2?1:2,l=R[v*3+r],u=g===3?1:2,d=D[i][e],c=L[e],_=d*8*c,f=Math.floor(d*y/l+E)*c;if(N===null){var b=navigator.userAgent||"",A=b.match(/Chrome\/(\d+)/i);N=A?parseInt(A[1]):0}var O=!!N&&N<=87;return O&&e===2&&y>=224e3&&g===0&&(n[s+3]=n[s+3]|128),{sampleRate:l,channelCount:u,frameLength:f,samplesPerFrame:_}}}function m(n,s){return n[s]===255&&(n[s+1]&224)===224&&(n[s+1]&6)!==0}function p(n,s){return s+1<n.length&&m(n,s)}function o(n,s){var i=4;return m(n,s)&&i<=n.length-s}function a(n,s){if(s+1<n.length&&m(n,s)){var i=4,e=T(n,s),t=i;e!=null&&e.frameLength&&(t=e.frameLength);var r=s+t;return r===n.length||p(n,r)}return!1}},"./src/demux/sample-aes.ts":function(ae,M,S){"use strict";S.r(M);var N=S("./src/crypt/decrypter.ts"),w=S("./src/demux/tsdemuxer.ts"),R=function(){function D(x,T,m){this.keyData=void 0,this.decrypter=void 0,this.keyData=m,this.decrypter=new N.default(x,T,{removePKCS7Padding:!1})}var L=D.prototype;return L.decryptBuffer=function(T,m){this.decrypter.decrypt(T,this.keyData.key.buffer,this.keyData.iv.buffer,m)},L.decryptAacSample=function(T,m,p,o){var a=T[m].unit,n=a.subarray(16,a.length-a.length%16),s=n.buffer.slice(n.byteOffset,n.byteOffset+n.length),i=this;this.decryptBuffer(s,function(e){var t=new Uint8Array(e);a.set(t,16),o||i.decryptAacSamples(T,m+1,p)})},L.decryptAacSamples=function(T,m,p){for(;;m++){if(m>=T.length){p();return}if(T[m].unit.length<32)continue;var o=this.decrypter.isSync();if(this.decryptAacSample(T,m,p,o),!o)return}},L.getAvcEncryptedData=function(T){for(var m=Math.floor((T.length-48)/160)*16+16,p=new Int8Array(m),o=0,a=32;a<=T.length-16;a+=160,o+=16)p.set(T.subarray(a,a+16),o);return p},L.getAvcDecryptedUnit=function(T,m){for(var p=new Uint8Array(m),o=0,a=32;a<=T.length-16;a+=160,o+=16)T.set(p.subarray(o,o+16),a);return T},L.decryptAvcSample=function(T,m,p,o,a,n){var s=Object(w.discardEPB)(a.data),i=this.getAvcEncryptedData(s),e=this;this.decryptBuffer(i.buffer,function(t){a.data=e.getAvcDecryptedUnit(s,t),n||e.decryptAvcSamples(T,m,p+1,o)})},L.decryptAvcSamples=function(T,m,p,o){if(T instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;m++,p=0){if(m>=T.length){o();return}for(var a=T[m].units;!(p>=a.length);p++){var n=a[p];if(n.data.length<=48||n.type!==1&&n.type!==5)continue;var s=this.decrypter.isSync();if(this.decryptAvcSample(T,m,p,o,n,s),!s)return}}},D}();M.default=R},"./src/demux/transmuxer-interface.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"default",function(){return a});var N=S("./node_modules/webworkify-webpack/index.js"),w=S.n(N),R=S("./src/events.ts"),D=S("./src/demux/transmuxer.ts"),L=S("./src/utils/logger.ts"),x=S("./src/errors.ts"),T=S("./src/utils/mediasource-helper.ts"),m=S("./node_modules/eventemitter3/index.js"),p=S.n(m),o=Object(T.getMediaSource)()||{isTypeSupported:function(){return!1}},a=function(){function n(i,e,t,r){var E=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=i,this.id=e,this.onTransmuxComplete=t,this.onFlush=r;var g=i.config,h=function(d,c){c=c||{},c.frag=E.frag,c.id=E.id,i.trigger(d,c)};this.observer=new m.EventEmitter,this.observer.on(R.Events.FRAG_DECRYPTED,h),this.observer.on(R.Events.ERROR,h);var y={mp4:o.isTypeSupported("video/mp4"),mpeg:o.isTypeSupported("audio/mpeg"),mp3:o.isTypeSupported('audio/mp4; codecs="mp3"')},v=navigator.vendor;if(g.enableWorker&&typeof Worker!="undefined"){L.logger.log("demuxing in webworker");var l;try{l=this.worker=N("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),l.addEventListener("message",this.onwmsg),l.onerror=function(u){i.trigger(R.Events.ERROR,{type:x.ErrorTypes.OTHER_ERROR,details:x.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(u.message+" ("+u.filename+":"+u.lineno+")")})},l.postMessage({cmd:"init",typeSupported:y,vendor:v,id:e,config:JSON.stringify(g)})}catch(u){L.logger.warn("Error in worker:",u),L.logger.error("Error while initializing DemuxerWorker, fallback to inline"),l&&self.URL.revokeObjectURL(l.objectURL),this.transmuxer=new D.default(this.observer,y,g,v,e),this.worker=null}}else this.transmuxer=new D.default(this.observer,y,g,v,e)}var s=n.prototype;return s.destroy=function(){var e=this.worker;if(e)e.removeEventListener("message",this.onwmsg),e.terminate(),this.worker=null;else{var t=this.transmuxer;t&&(t.destroy(),this.transmuxer=null)}var r=this.observer;r&&r.removeAllListeners(),this.observer=null},s.push=function(e,t,r,E,g,h,y,v,l,u){var d=this;l.transmuxing.start=self.performance.now();var c=this.transmuxer,_=this.worker,f=h?h.start:g.start,b=g.decryptdata,A=this.frag,O=!(A&&g.cc===A.cc),C=!(A&&l.level===A.level),P=A?l.sn-A.sn:-1,k=this.part?l.part-this.part.index:1,I=!C&&(P===1||P===0&&k===1),U=self.performance.now();(C||P||g.stats.parsing.start===0)&&(g.stats.parsing.start=U),h&&(k||!I)&&(h.stats.parsing.start=U);var H=new D.TransmuxState(O,I,v,C,f);if(!I||O){L.logger.log("[transmuxer-interface, "+g.type+"]: Starting new transmux session for sn: "+l.sn+" p: "+l.part+" level: "+l.level+" id: "+l.id+`
|
|
discontinuity: `+O+`
|
|
trackSwitch: `+C+`
|
|
contiguous: `+I+`
|
|
accurateTimeOffset: `+v+`
|
|
timeOffset: `+f);var Z=new D.TransmuxConfig(r,E,t,y,u);this.configureTransmuxer(Z)}if(this.frag=g,this.part=h,_)_.postMessage({cmd:"demux",data:e,decryptdata:b,chunkMeta:l,state:H},e instanceof ArrayBuffer?[e]:[]);else if(c){var $=c.push(e,b,l,H);Object(D.isPromise)($)?$.then(function(ee){d.handleTransmuxComplete(ee)}):this.handleTransmuxComplete($)}},s.flush=function(e){var t=this;e.transmuxing.start=self.performance.now();var r=this.transmuxer,E=this.worker;if(E)E.postMessage({cmd:"flush",chunkMeta:e});else if(r){var g=r.flush(e);Object(D.isPromise)(g)?g.then(function(h){t.handleFlushResult(h,e)}):this.handleFlushResult(g,e)}},s.handleFlushResult=function(e,t){var r=this;e.forEach(function(E){r.handleTransmuxComplete(E)}),this.onFlush(t)},s.onWorkerMessage=function(e){var t=e.data,r=this.hls;switch(t.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(t.data);break}case"flush":{this.onFlush(t.data);break}default:{t.data=t.data||{},t.data.frag=this.frag,t.data.id=this.id,r.trigger(t.event,t.data);break}}},s.configureTransmuxer=function(e){var t=this.worker,r=this.transmuxer;t?t.postMessage({cmd:"configure",config:e}):r&&r.configure(e)},s.handleTransmuxComplete=function(e){e.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(e)},n}()},"./src/demux/transmuxer-worker.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"default",function(){return x});var N=S("./src/demux/transmuxer.ts"),w=S("./src/events.ts"),R=S("./src/utils/logger.ts"),D=S("./node_modules/eventemitter3/index.js"),L=S.n(D);function x(a){var n=new D.EventEmitter,s=function(e,t){a.postMessage({event:e,data:t})};n.on(w.Events.FRAG_DECRYPTED,s),n.on(w.Events.ERROR,s),a.addEventListener("message",function(i){var e=i.data;switch(e.cmd){case"init":{var t=JSON.parse(e.config);a.transmuxer=new N.default(n,e.typeSupported,t,e.vendor,e.id),Object(R.enableLogs)(t.debug),s("init",null);break}case"configure":{a.transmuxer.configure(e.config);break}case"demux":{var r=a.transmuxer.push(e.data,e.decryptdata,e.chunkMeta,e.state);Object(N.isPromise)(r)?r.then(function(h){T(a,h)}):T(a,r);break}case"flush":{var E=e.chunkMeta,g=a.transmuxer.flush(E);Object(N.isPromise)(g)?g.then(function(h){p(a,h,E)}):p(a,g,E);break}default:break}})}function T(a,n){if(o(n.remuxResult))return;var s=[],i=n.remuxResult,e=i.audio,t=i.video;e&&m(s,e),t&&m(s,t),a.postMessage({event:"transmuxComplete",data:n},s)}function m(a,n){n.data1&&a.push(n.data1.buffer),n.data2&&a.push(n.data2.buffer)}function p(a,n,s){n.forEach(function(i){T(a,i)}),a.postMessage({event:"flush",data:s})}function o(a){return!a.audio&&!a.video&&!a.text&&!a.id3&&!a.initSegment}},"./src/demux/transmuxer.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"default",function(){return t}),S.d(M,"isPromise",function(){return g}),S.d(M,"TransmuxConfig",function(){return h}),S.d(M,"TransmuxState",function(){return y});var N=S("./src/events.ts"),w=S("./src/errors.ts"),R=S("./src/crypt/decrypter.ts"),D=S("./src/demux/aacdemuxer.ts"),L=S("./src/demux/mp4demuxer.ts"),x=S("./src/demux/tsdemuxer.ts"),T=S("./src/demux/mp3demuxer.ts"),m=S("./src/remux/mp4-remuxer.ts"),p=S("./src/remux/passthrough-remuxer.ts"),o=S("./src/demux/chunk-cache.ts"),a=S("./src/utils/mp4-tools.ts"),n=S("./src/utils/logger.ts"),s;try{s=self.performance.now.bind(self.performance)}catch(v){n.logger.debug("Unable to use Performance API on this environment"),s=self.Date.now}var i=[{demux:x.default,remux:m.default},{demux:L.default,remux:p.default},{demux:D.default,remux:m.default},{demux:T.default,remux:m.default}],e=1024;i.forEach(function(v){var l=v.demux;e=Math.max(e,l.minProbeByteLength)});var t=function(){function v(u,d,c,_,f){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 o.default,this.observer=u,this.typeSupported=d,this.config=c,this.vendor=_,this.id=f}var l=v.prototype;return l.configure=function(d){this.transmuxConfig=d,this.decrypter&&this.decrypter.reset()},l.push=function(d,c,_,f){var b=this,A=_.transmuxing;A.executeStart=s();var O=new Uint8Array(d),C=this.cache,P=this.config,k=this.currentTransmuxState,I=this.transmuxConfig;f&&(this.currentTransmuxState=f);var U=r(O,c);if(U&&U.method==="AES-128"){var H=this.getDecrypter();if(P.enableSoftwareAES){var Z=H.softwareDecrypt(O,U.key.buffer,U.iv.buffer);if(!Z)return A.executeEnd=s(),E(_);O=new Uint8Array(Z)}else return this.decryptionPromise=H.webCryptoDecrypt(O,U.key.buffer,U.iv.buffer).then(function(le){var ce=b.push(le,null,_);return b.decryptionPromise=null,ce}),this.decryptionPromise}var $=f||k,ee=$.contiguous,te=$.discontinuity,K=$.trackSwitch,W=$.accurateTimeOffset,X=$.timeOffset,j=I.audioCodec,z=I.videoCodec,ie=I.defaultInitPts,pe=I.duration,_e=I.initSegmentData;if((te||K)&&this.resetInitSegment(_e,j,z,pe),te&&this.resetInitialTimestamp(ie),ee||this.resetContiguity(),this.needsProbing(O,te,K)){if(C.dataLength){var Ee=C.flush();O=Object(a.appendUint8Array)(Ee,O)}this.configureTransmuxer(O,I)}var we=this.transmux(O,U,X,W,_),fe=this.currentTransmuxState;return fe.contiguous=!0,fe.discontinuity=!1,fe.trackSwitch=!1,A.executeEnd=s(),we},l.flush=function(d){var c=this,_=d.transmuxing;_.executeStart=s();var f=this.decrypter,b=this.cache,A=this.currentTransmuxState,O=this.decryptionPromise;if(O)return O.then(function(){return c.flush(d)});var C=[],P=A.timeOffset;if(f){var k=f.flush();k&&C.push(this.push(k,null,d))}var I=b.dataLength;b.reset();var U=this.demuxer,H=this.remuxer;if(!U||!H)return I>=e&&this.observer.emit(N.Events.ERROR,N.Events.ERROR,{type:w.ErrorTypes.MEDIA_ERROR,details:w.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),_.executeEnd=s(),[E(d)];var Z=U.flush(P);return g(Z)?Z.then(function($){return c.flushRemux(C,$,d),C}):(this.flushRemux(C,Z,d),C)},l.flushRemux=function(d,c,_){var f=c.audioTrack,b=c.avcTrack,A=c.id3Track,O=c.textTrack,C=this.currentTransmuxState,P=C.accurateTimeOffset,k=C.timeOffset;n.logger.log("[transmuxer.ts]: Flushed fragment "+_.sn+(_.part>-1?" p: "+_.part:"")+" of level "+_.level);var I=this.remuxer.remux(f,b,A,O,k,P,!0,this.id);d.push({remuxResult:I,chunkMeta:_}),_.transmuxing.executeEnd=s()},l.resetInitialTimestamp=function(d){var c=this.demuxer,_=this.remuxer;if(!c||!_)return;c.resetTimeStamp(d),_.resetTimeStamp(d)},l.resetContiguity=function(){var d=this.demuxer,c=this.remuxer;if(!d||!c)return;d.resetContiguity(),c.resetNextTimestamp()},l.resetInitSegment=function(d,c,_,f){var b=this.demuxer,A=this.remuxer;if(!b||!A)return;b.resetInitSegment(c,_,f),A.resetInitSegment(d,c,_)},l.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},l.transmux=function(d,c,_,f,b){var A;return c&&c.method==="SAMPLE-AES"?A=this.transmuxSampleAes(d,c,_,f,b):A=this.transmuxUnencrypted(d,_,f,b),A},l.transmuxUnencrypted=function(d,c,_,f){var b=this.demuxer.demux(d,c,!1,!this.config.progressive),A=b.audioTrack,O=b.avcTrack,C=b.id3Track,P=b.textTrack,k=this.remuxer.remux(A,O,C,P,c,_,!1,this.id);return{remuxResult:k,chunkMeta:f}},l.transmuxSampleAes=function(d,c,_,f,b){var A=this;return this.demuxer.demuxSampleAes(d,c,_).then(function(O){var C=A.remuxer.remux(O.audioTrack,O.avcTrack,O.id3Track,O.textTrack,_,f,!1,A.id);return{remuxResult:C,chunkMeta:b}})},l.configureTransmuxer=function(d,c){for(var _=this.config,f=this.observer,b=this.typeSupported,A=this.vendor,O=c.audioCodec,C=c.defaultInitPts,P=c.duration,k=c.initSegmentData,I=c.videoCodec,U,H=0,Z=i.length;H<Z;H++)if(i[H].demux.probe(d)){U=i[H];break}U||(n.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),U={demux:L.default,remux:p.default});var $=this.demuxer,ee=this.remuxer,te=U.remux,K=U.demux;(!ee||!(ee instanceof te))&&(this.remuxer=new te(f,_,b,A)),(!$||!($ instanceof K))&&(this.demuxer=new K(f,_,b),this.probe=K.probe),this.resetInitSegment(k,O,I,P),this.resetInitialTimestamp(C)},l.needsProbing=function(d,c,_){return!this.demuxer||!this.remuxer||c||_},l.getDecrypter=function(){var d=this.decrypter;return d||(d=this.decrypter=new R.default(this.observer,this.config)),d},v}();function r(v,l){var u=null;return v.byteLength>0&&l!=null&&l.key!=null&&l.iv!==null&&l.method!=null&&(u=l),u}var E=function(l){return{remuxResult:{},chunkMeta:l}};function g(v){return"then"in v&&v.then instanceof Function}var h=function(l,u,d,c,_){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=l,this.videoCodec=u,this.initSegmentData=d,this.duration=c,this.defaultInitPts=_},y=function(l,u,d,c,_){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=l,this.contiguous=u,this.accurateTimeOffset=d,this.trackSwitch=c,this.timeOffset=_}},"./src/demux/tsdemuxer.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"discardEPB",function(){return E});var N=S("./src/demux/adts.ts"),w=S("./src/demux/mpegaudio.ts"),R=S("./src/demux/exp-golomb.ts"),D=S("./src/demux/id3.ts"),L=S("./src/demux/sample-aes.ts"),x=S("./src/events.ts"),T=S("./src/utils/mp4-tools.ts"),m=S("./src/utils/logger.ts"),p=S("./src/errors.ts"),o={video:1,audio:2,id3:3,text:4},a=function(){function g(y,v,l){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=y,this.config=v,this.typeSupported=l}g.probe=function(v){var l=g.syncOffset(v);return l<0?!1:(l&&m.logger.warn("MPEG2-TS detected but first sync word found @ offset "+l+", junk ahead ?"),!0)},g.syncOffset=function(v){for(var l=Math.min(1e3,v.length-3*188),u=0;u<l;){if(v[u]===71&&v[u+188]===71&&v[u+2*188]===71)return u;u++}return-1},g.createTrack=function(v,l){return{container:v==="video"||v==="audio"?"video/mp2t":void 0,type:v,id:o[v],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:v==="audio"?l:void 0}};var h=g.prototype;return h.resetInitSegment=function(v,l,u){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=g.createTrack("video",u),this._audioTrack=g.createTrack("audio",u),this._id3Track=g.createTrack("id3",u),this._txtTrack=g.createTrack("text",u),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=v,this.videoCodec=l,this._duration=u},h.resetTimeStamp=function(){},h.resetContiguity=function(){var v=this._audioTrack,l=this._avcTrack,u=this._id3Track;v&&(v.pesData=null),l&&(l.pesData=null),u&&(u.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},h.demux=function(v,l,u,d){u===void 0&&(u=!1),d===void 0&&(d=!1),u||(this.sampleAes=null);var c,_=this._avcTrack,f=this._audioTrack,b=this._id3Track,A=_.pid,O=_.pesData,C=f.pid,P=b.pid,k=f.pesData,I=b.pesData,U=!1,H=this.pmtParsed,Z=this._pmtId,$=v.length;if(this.remainderData&&(v=Object(T.appendUint8Array)(this.remainderData,v),$=v.length,this.remainderData=null),$<188&&!d)return this.remainderData=v,{audioTrack:f,avcTrack:_,id3Track:b,textTrack:this._txtTrack};var ee=Math.max(0,g.syncOffset(v));$-=($+ee)%188,$<v.byteLength&&!d&&(this.remainderData=new Uint8Array(v.buffer,$,v.buffer.byteLength-$));for(var te=ee;te<$;te+=188)if(v[te]===71){var K=!!(v[te+1]&64),W=((v[te+1]&31)<<8)+v[te+2],X=(v[te+3]&48)>>4,j=void 0;if(X>1){if(j=te+5+v[te+4],j===te+188)continue}else j=te+4;switch(W){case A:K&&(O&&(c=e(O))&&this.parseAVCPES(c,!1),O={data:[],size:0}),O&&(O.data.push(v.subarray(j,te+188)),O.size+=te+188-j);break;case C:K&&(k&&(c=e(k))&&(f.isAAC?this.parseAACPES(c):this.parseMPEGPES(c)),k={data:[],size:0}),k&&(k.data.push(v.subarray(j,te+188)),k.size+=te+188-j);break;case P:K&&(I&&(c=e(I))&&this.parseID3PES(c),I={data:[],size:0}),I&&(I.data.push(v.subarray(j,te+188)),I.size+=te+188-j);break;case 0:K&&(j+=v[j]+1),Z=this._pmtId=s(v,j);break;case Z:{K&&(j+=v[j]+1);var z=i(v,j,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,u);A=z.avc,A>0&&(_.pid=A),C=z.audio,C>0&&(f.pid=C,f.isAAC=z.isAAC),P=z.id3,P>0&&(b.pid=P),U&&!H&&(m.logger.log("reparse from beginning"),U=!1,te=ee-188),H=this.pmtParsed=!0;break}case 17:case 8191:break;default:U=!0;break}}else this.observer.emit(x.Events.ERROR,x.Events.ERROR,{type:p.ErrorTypes.MEDIA_ERROR,details:p.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});_.pesData=O,f.pesData=k,b.pesData=I;var ie={audioTrack:f,avcTrack:_,id3Track:b,textTrack:this._txtTrack};return d&&this.extractRemainingSamples(ie),ie},h.flush=function(){var v=this.remainderData;this.remainderData=null;var l;return v?l=this.demux(v,-1,!1,!0):l={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(l),this.sampleAes?this.decrypt(l,this.sampleAes):l},h.extractRemainingSamples=function(v){var l=v.audioTrack,u=v.avcTrack,d=v.id3Track,c=u.pesData,_=l.pesData,f=d.pesData,b;c&&(b=e(c))?(this.parseAVCPES(b,!0),u.pesData=null):u.pesData=c,_&&(b=e(_))?(l.isAAC?this.parseAACPES(b):this.parseMPEGPES(b),l.pesData=null):(_!=null&&_.size&&m.logger.log("last AAC PES packet truncated,might overlap between fragments"),l.pesData=_),f&&(b=e(f))?(this.parseID3PES(b),d.pesData=null):d.pesData=f},h.demuxSampleAes=function(v,l,u){var d=this.demux(v,u,!0,!this.config.progressive),c=this.sampleAes=new L.default(this.observer,this.config,l);return this.decrypt(d,c)},h.decrypt=function(v,l){return new Promise(function(u){var d=v.audioTrack,c=v.avcTrack;d.samples&&d.isAAC?l.decryptAacSamples(d.samples,0,function(){c.samples?l.decryptAvcSamples(c.samples,0,0,function(){u(v)}):u(v)}):c.samples&&l.decryptAvcSamples(c.samples,0,0,function(){u(v)})})},h.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},h.parseAVCPES=function(v,l){var u=this,d=this._avcTrack,c=this.parseAVCNALu(v.data),_=!1,f=this.avcSample,b,A=!1;v.data=null,f&&c.length&&!d.audFound&&(t(f,d),f=this.avcSample=n(!1,v.pts,v.dts,"")),c.forEach(function(O){switch(O.type){case 1:{b=!0,f||(f=u.avcSample=n(!0,v.pts,v.dts,"")),_&&(f.debug+="NDR "),f.frame=!0;var C=O.data;if(A&&C.length>4){var P=new R.default(C).readSliceType();(P===2||P===4||P===7||P===9)&&(f.key=!0)}break}case 5:b=!0,f||(f=u.avcSample=n(!0,v.pts,v.dts,"")),_&&(f.debug+="IDR "),f.key=!0,f.frame=!0;break;case 6:{b=!0,_&&f&&(f.debug+="SEI ");var k=new R.default(E(O.data));k.readUByte();for(var I=0,U=0,H=!1,Z=0;!H&&k.bytesAvailable>1;){I=0;do Z=k.readUByte(),I+=Z;while(Z===255);U=0;do Z=k.readUByte(),U+=Z;while(Z===255);if(I===4&&k.bytesAvailable!==0){H=!0;var $=k.readUByte();if($===181){var ee=k.readUShort();if(ee===49){var te=k.readUInt();if(te===1195456820){var K=k.readUByte();if(K===3){for(var W=k.readUByte(),X=k.readUByte(),j=31&W,z=[W,X],ie=0;ie<j;ie++)z.push(k.readUByte()),z.push(k.readUByte()),z.push(k.readUByte());r(u._txtTrack.samples,{type:3,pts:v.pts,bytes:z})}}}}}else if(I===5&&k.bytesAvailable!==0){if(H=!0,U>16){for(var pe=[],_e=0;_e<16;_e++)pe.push(k.readUByte().toString(16)),(_e===3||_e===5||_e===7||_e===9)&&pe.push("-");for(var Ee=U-16,we=new Uint8Array(Ee),fe=0;fe<Ee;fe++)we[fe]=k.readUByte();r(u._txtTrack.samples,{pts:v.pts,payloadType:I,uuid:pe.join(""),userData:Object(D.utf8ArrayToStr)(we),userDataBytes:we})}}else if(U<k.bytesAvailable)for(var le=0;le<U;le++)k.readUByte()}break}case 7:if(b=!0,A=!0,_&&f&&(f.debug+="SPS "),!d.sps){var ce=new R.default(O.data),ge=ce.readSPS();d.width=ge.width,d.height=ge.height,d.pixelRatio=ge.pixelRatio,d.sps=[O.data],d.duration=u._duration;for(var Re=O.data.subarray(1,4),xe="avc1.",be=0;be<3;be++){var Ie=Re[be].toString(16);Ie.length<2&&(Ie="0"+Ie),xe+=Ie}d.codec=xe}break;case 8:b=!0,_&&f&&(f.debug+="PPS "),d.pps||(d.pps=[O.data]);break;case 9:b=!1,d.audFound=!0,f&&t(f,d),f=u.avcSample=n(!1,v.pts,v.dts,_?"AUD ":"");break;case 12:b=!1;break;default:b=!1,f&&(f.debug+="unknown NAL "+O.type+" ");break}if(f&&b){var ne=f.units;ne.push(O)}}),l&&f&&(t(f,d),this.avcSample=null)},h.getLastNalUnit=function(){var v,l=this.avcSample,u;if(!l||l.units.length===0){var d=this._avcTrack.samples;l=d[d.length-1]}if((v=l)!==null&&v!==void 0&&v.units){var c=l.units;u=c[c.length-1]}return u},h.parseAVCNALu=function(v){var l=v.byteLength,u=this._avcTrack,d=u.naluState||0,c=d,_=[],f=0,b,A,O,C=-1,P=0;for(d===-1&&(C=0,P=v[0]&31,d=0,f=1);f<l;){if(b=v[f++],!d){d=b?0:1;continue}if(d===1){d=b?0:2;continue}if(!b)d=3;else if(b===1){if(C>=0){var k={data:v.subarray(C,f-d-1),type:P};_.push(k)}else{var I=this.getLastNalUnit();if(I&&(c&&f<=4-c&&(I.state&&(I.data=I.data.subarray(0,I.data.byteLength-c))),A=f-d-1,A>0)){var U=new Uint8Array(I.data.byteLength+A);U.set(I.data,0),U.set(v.subarray(0,A),I.data.byteLength),I.data=U,I.state=0}}f<l?(O=v[f]&31,C=f,P=O,d=0):d=-1}else d=0}if(C>=0&&d>=0){var H={data:v.subarray(C,l),type:P,state:d};_.push(H)}if(_.length===0){var Z=this.getLastNalUnit();if(Z){var $=new Uint8Array(Z.data.byteLength+v.byteLength);$.set(Z.data,0),$.set(v,Z.data.byteLength),Z.data=$}}return u.naluState=d,_},h.parseAACPES=function(v){var l=0,u=this._audioTrack,d=this.aacOverFlow,c=v.data;if(d){this.aacOverFlow=null;var _=d.sample.unit.byteLength,f=Math.min(d.missing,_),b=_-f;d.sample.unit.set(c.subarray(0,f),b),u.samples.push(d.sample),l=d.missing}var A,O;for(A=l,O=c.length;A<O-1&&!N.isHeader(c,A);A++);if(A!==l){var C,P;if(A<O-1?(C="AAC PES did not start with ADTS header,offset:"+A,P=!1):(C="no ADTS header found in AAC PES",P=!0),m.logger.warn("parsing error:"+C),this.observer.emit(x.Events.ERROR,x.Events.ERROR,{type:p.ErrorTypes.MEDIA_ERROR,details:p.ErrorDetails.FRAG_PARSING_ERROR,fatal:P,reason:C}),P)return}N.initTrackConfig(u,this.observer,c,A,this.audioCodec);var k;if(v.pts!==void 0)k=v.pts;else if(d){var I=N.getFrameDuration(u.samplerate);k=d.sample.pts+I}else{m.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var U=0;A<O;)if(N.isHeader(c,A)){if(A+5<O){var H=N.appendFrame(u,c,A,k,U);if(H)if(H.missing)this.aacOverFlow=H;else{A+=H.length,U++;continue}}break}else A++},h.parseMPEGPES=function(v){var l=v.data,u=l.length,d=0,c=0,_=v.pts;if(_===void 0){m.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;c<u;)if(w.isHeader(l,c)){var f=w.appendFrame(this._audioTrack,l,c,_,d);if(f)c+=f.length,d++;else break}else c++},h.parseID3PES=function(v){if(v.pts===void 0){m.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(v)},g}();a.minProbeByteLength=188;function n(g,h,y,v){return{key:g,frame:!1,pts:h,dts:y,units:[],debug:v,length:0}}function s(g,h){return(g[h+10]&31)<<8|g[h+11]}function i(g,h,y,v){var l={audio:-1,avc:-1,id3:-1,isAAC:!0},u=(g[h+1]&15)<<8|g[h+2],d=h+3+u-4,c=(g[h+10]&15)<<8|g[h+11];for(h+=12+c;h<d;){var _=(g[h+1]&31)<<8|g[h+2];switch(g[h]){case 207:if(!v){m.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:l.audio===-1&&(l.audio=_);break;case 21:l.id3===-1&&(l.id3=_);break;case 219:if(!v){m.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:l.avc===-1&&(l.avc=_);break;case 3:case 4:y?l.audio===-1&&(l.audio=_,l.isAAC=!1):m.logger.log("MPEG audio found, not supported in this browser");break;case 36:m.logger.warn("Unsupported HEVC stream type found");break;default:break}h+=((g[h+3]&15)<<8|g[h+4])+5}return l}function e(g){var h=0,y,v,l,u,d,c=g.data;if(!g||g.size===0)return null;for(;c[0].length<19&&c.length>1;){var _=new Uint8Array(c[0].length+c[1].length);_.set(c[0]),_.set(c[1],c[0].length),c[0]=_,c.splice(1,1)}y=c[0];var f=(y[0]<<16)+(y[1]<<8)+y[2];if(f===1){if(v=(y[4]<<8)+y[5],v&&v>g.size-6)return null;var b=y[7];b&192&&(u=(y[9]&14)*536870912+(y[10]&255)*4194304+(y[11]&254)*16384+(y[12]&255)*128+(y[13]&254)/2,b&64?(d=(y[14]&14)*536870912+(y[15]&255)*4194304+(y[16]&254)*16384+(y[17]&255)*128+(y[18]&254)/2,u-d>60*9e4&&(m.logger.warn(Math.round((u-d)/9e4)+"s delta between PTS and DTS, align them"),u=d)):d=u),l=y[8];var A=l+9;if(g.size<=A)return null;g.size-=A;for(var O=new Uint8Array(g.size),C=0,P=c.length;C<P;C++){y=c[C];var k=y.byteLength;if(A)if(A>k){A-=k;continue}else y=y.subarray(A),k-=A,A=0;O.set(y,h),h+=k}return v&&(v-=l+3),{data:O,pts:u,dts:d,len:v}}return null}function t(g,h){if(g.units.length&&g.frame){if(g.pts===void 0){var y=h.samples,v=y.length;if(v){var l=y[v-1];g.pts=l.pts,g.dts=l.dts}else{h.dropped++;return}}h.samples.push(g)}g.debug.length&&m.logger.log(g.pts+"/"+g.dts+":"+g.debug)}function r(g,h){var y=g.length;if(y>0){if(h.pts>=g[y-1].pts)g.push(h);else for(var v=y-1;v>=0;v--)if(h.pts<g[v].pts){g.splice(v,0,h);break}}else g.push(h)}function E(g){for(var h=g.byteLength,y=[],v=1;v<h-2;)g[v]===0&&g[v+1]===0&&g[v+2]===3?(y.push(v+2),v+=2):v++;if(y.length===0)return g;var l=h-y.length,u=new Uint8Array(l),d=0;for(v=0;v<l;d++,v++)d===y[0]&&(d++,y.shift()),u[v]=g[d];return u}M.default=a},"./src/errors.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"ErrorTypes",function(){return N}),S.d(M,"ErrorDetails",function(){return w});var N;(function(R){R.NETWORK_ERROR="networkError",R.MEDIA_ERROR="mediaError",R.KEY_SYSTEM_ERROR="keySystemError",R.MUX_ERROR="muxError",R.OTHER_ERROR="otherError"})(N||(N={}));var w;(function(R){R.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",R.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",R.KEY_SYSTEM_NO_SESSION="keySystemNoSession",R.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",R.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",R.MANIFEST_LOAD_ERROR="manifestLoadError",R.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",R.MANIFEST_PARSING_ERROR="manifestParsingError",R.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",R.LEVEL_EMPTY_ERROR="levelEmptyError",R.LEVEL_LOAD_ERROR="levelLoadError",R.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",R.LEVEL_SWITCH_ERROR="levelSwitchError",R.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",R.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",R.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",R.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",R.FRAG_LOAD_ERROR="fragLoadError",R.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",R.FRAG_DECRYPT_ERROR="fragDecryptError",R.FRAG_PARSING_ERROR="fragParsingError",R.REMUX_ALLOC_ERROR="remuxAllocError",R.KEY_LOAD_ERROR="keyLoadError",R.KEY_LOAD_TIMEOUT="keyLoadTimeOut",R.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",R.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",R.BUFFER_APPEND_ERROR="bufferAppendError",R.BUFFER_APPENDING_ERROR="bufferAppendingError",R.BUFFER_STALLED_ERROR="bufferStalledError",R.BUFFER_FULL_ERROR="bufferFullError",R.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",R.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",R.INTERNAL_EXCEPTION="internalException",R.INTERNAL_ABORTED="aborted",R.UNKNOWN="unknown"})(w||(w={}))},"./src/events.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"Events",function(){return N});var N;(function(w){w.MEDIA_ATTACHING="hlsMediaAttaching",w.MEDIA_ATTACHED="hlsMediaAttached",w.MEDIA_DETACHING="hlsMediaDetaching",w.MEDIA_DETACHED="hlsMediaDetached",w.BUFFER_RESET="hlsBufferReset",w.BUFFER_CODECS="hlsBufferCodecs",w.BUFFER_CREATED="hlsBufferCreated",w.BUFFER_APPENDING="hlsBufferAppending",w.BUFFER_APPENDED="hlsBufferAppended",w.BUFFER_EOS="hlsBufferEos",w.BUFFER_FLUSHING="hlsBufferFlushing",w.BUFFER_FLUSHED="hlsBufferFlushed",w.MANIFEST_LOADING="hlsManifestLoading",w.MANIFEST_LOADED="hlsManifestLoaded",w.MANIFEST_PARSED="hlsManifestParsed",w.LEVEL_SWITCHING="hlsLevelSwitching",w.LEVEL_SWITCHED="hlsLevelSwitched",w.LEVEL_LOADING="hlsLevelLoading",w.LEVEL_LOADED="hlsLevelLoaded",w.LEVEL_UPDATED="hlsLevelUpdated",w.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",w.LEVELS_UPDATED="hlsLevelsUpdated",w.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",w.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",w.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",w.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",w.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",w.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",w.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",w.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",w.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",w.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",w.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",w.CUES_PARSED="hlsCuesParsed",w.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",w.INIT_PTS_FOUND="hlsInitPtsFound",w.FRAG_LOADING="hlsFragLoading",w.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",w.FRAG_LOADED="hlsFragLoaded",w.FRAG_DECRYPTED="hlsFragDecrypted",w.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",w.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",w.FRAG_PARSING_METADATA="hlsFragParsingMetadata",w.FRAG_PARSED="hlsFragParsed",w.FRAG_BUFFERED="hlsFragBuffered",w.FRAG_CHANGED="hlsFragChanged",w.FPS_DROP="hlsFpsDrop",w.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",w.ERROR="hlsError",w.DESTROYING="hlsDestroying",w.KEY_LOADING="hlsKeyLoading",w.KEY_LOADED="hlsKeyLoaded",w.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",w.BACK_BUFFER_REACHED="hlsBackBufferReached"})(N||(N={}))},"./src/hls.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"default",function(){return g});var N=S("./node_modules/url-toolkit/src/url-toolkit.js"),w=S.n(N),R=S("./src/loader/playlist-loader.ts"),D=S("./src/loader/key-loader.ts"),L=S("./src/controller/id3-track-controller.ts"),x=S("./src/controller/latency-controller.ts"),T=S("./src/controller/level-controller.ts"),m=S("./src/controller/fragment-tracker.ts"),p=S("./src/controller/stream-controller.ts"),o=S("./src/is-supported.ts"),a=S("./src/utils/logger.ts"),n=S("./src/config.ts"),s=S("./node_modules/eventemitter3/index.js"),i=S.n(s),e=S("./src/events.ts"),t=S("./src/errors.ts");function r(h,y){for(var v=0;v<y.length;v++){var l=y[v];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(h,l.key,l)}}function E(h,y,v){return y&&r(h.prototype,y),v&&r(h,v),h}var g=function(){h.isSupported=function(){return Object(o.isSupported)()};function h(v){v===void 0&&(v={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new s.EventEmitter,this._autoLevelCapping=void 0,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null;var l=this.config=Object(n.mergeConfig)(h.DefaultConfig,v);this.userConfig=v,Object(a.enableLogs)(l.debug),this._autoLevelCapping=-1,l.progressive&&Object(n.enableStreamingMode)(l);var u=l.abrController,d=l.bufferController,c=l.capLevelController,_=l.fpsController,f=this.abrController=new u(this),b=this.bufferController=new d(this),A=this.capLevelController=new c(this),O=new _(this),C=new R.default(this),P=new D.default(this),k=new L.default(this),I=this.levelController=new T.default(this),U=new m.FragmentTracker(this),H=this.streamController=new p.default(this,U);A.setStreamController(H),O.setStreamController(H);var Z=[I,H];this.networkControllers=Z;var $=[C,P,f,b,A,O,k,U];this.audioTrackController=this.createController(l.audioTrackController,null,Z),this.createController(l.audioStreamController,U,Z),this.subtitleTrackController=this.createController(l.subtitleTrackController,null,Z),this.createController(l.subtitleStreamController,U,Z),this.createController(l.timelineController,null,$),this.emeController=this.createController(l.emeController,null,$),this.cmcdController=this.createController(l.cmcdController,null,$),this.latencyController=this.createController(x.default,null,$),this.coreComponents=$}var y=h.prototype;return y.createController=function(l,u,d){if(l){var c=u?new l(this,u):new l(this);return d&&d.push(c),c}return null},y.on=function(l,u,d){d===void 0&&(d=this),this._emitter.on(l,u,d)},y.once=function(l,u,d){d===void 0&&(d=this),this._emitter.once(l,u,d)},y.removeAllListeners=function(l){this._emitter.removeAllListeners(l)},y.off=function(l,u,d,c){d===void 0&&(d=this),this._emitter.off(l,u,d,c)},y.listeners=function(l){return this._emitter.listeners(l)},y.emit=function(l,u,d){return this._emitter.emit(l,u,d)},y.trigger=function(l,u){if(this.config.debug)return this.emit(l,l,u);try{return this.emit(l,l,u)}catch(d){a.logger.error("An internal error happened while handling event "+l+'. Error message: "'+d.message+'". Here is a stacktrace:',d),this.trigger(e.Events.ERROR,{type:t.ErrorTypes.OTHER_ERROR,details:t.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:l,error:d})}return!1},y.listenerCount=function(l){return this._emitter.listenerCount(l)},y.destroy=function(){a.logger.log("destroy"),this.trigger(e.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(l){return l.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(l){return l.destroy()}),this.coreComponents.length=0},y.attachMedia=function(l){a.logger.log("attachMedia"),this._media=l,this.trigger(e.Events.MEDIA_ATTACHING,{media:l})},y.detachMedia=function(){a.logger.log("detachMedia"),this.trigger(e.Events.MEDIA_DETACHING,void 0),this._media=null},y.loadSource=function(l){this.stopLoad();var u=this.media,d=this.url,c=this.url=N.buildAbsoluteURL(self.location.href,l,{alwaysNormalize:!0});a.logger.log("loadSource:"+c),u&&d&&d!==c&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(u)),this.trigger(e.Events.MANIFEST_LOADING,{url:l})},y.startLoad=function(l){l===void 0&&(l=-1),a.logger.log("startLoad("+l+")"),this.networkControllers.forEach(function(u){u.startLoad(l)})},y.stopLoad=function(){a.logger.log("stopLoad"),this.networkControllers.forEach(function(l){l.stopLoad()})},y.swapAudioCodec=function(){a.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},y.recoverMediaError=function(){a.logger.log("recoverMediaError");var l=this._media;this.detachMedia(),l&&this.attachMedia(l)},y.removeLevel=function(l,u){u===void 0&&(u=0),this.levelController.removeLevel(l,u)},E(h,[{key:"levels",get:function(){var l=this.levelController.levels;return l||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(l){a.logger.log("set currentLevel:"+l),this.loadLevel=l,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(l){a.logger.log("set nextLevel:"+l),this.levelController.manualLevel=l,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(l){a.logger.log("set loadLevel:"+l),this.levelController.manualLevel=l}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(l){this.levelController.nextLoadLevel=l}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(l){a.logger.log("set firstLevel:"+l),this.levelController.firstLevel=l}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(l){a.logger.log("set startLevel:"+l),l!==-1&&(l=Math.max(l,this.minAutoLevel)),this.levelController.startLevel=l}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(l){var u=!!l;u!==this.config.capLevelToPlayerSize&&(u?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=u)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(l){this._autoLevelCapping!==l&&(a.logger.log("set autoLevelCapping:"+l),this._autoLevelCapping=l)}},{key:"bandwidthEstimate",get:function(){var l=this.abrController.bwEstimator;return l?l.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var l=this.levels,u=this.config.minAutoBitrate;if(!l)return 0;for(var d=l.length,c=0;c<d;c++)if(l[c].maxBitrate>u)return c;return 0}},{key:"maxAutoLevel",get:function(){var l=this.levels,u=this.autoLevelCapping,d;return u===-1&&l&&l.length?d=l.length-1:d=u,d}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(l){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,l)}},{key:"audioTracks",get:function(){var l=this.audioTrackController;return l?l.audioTracks:[]}},{key:"audioTrack",get:function(){var l=this.audioTrackController;return l?l.audioTrack:-1},set:function(l){var u=this.audioTrackController;u&&(u.audioTrack=l)}},{key:"subtitleTracks",get:function(){var l=this.subtitleTrackController;return l?l.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var l=this.subtitleTrackController;return l?l.subtitleTrack:-1},set:function(l){var u=this.subtitleTrackController;u&&(u.subtitleTrack=l)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var l=this.subtitleTrackController;return l?l.subtitleDisplay:!1},set:function(l){var u=this.subtitleTrackController;u&&(u.subtitleDisplay=l)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(l){this.config.lowLatencyMode=l}},{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 e.Events}},{key:"ErrorTypes",get:function(){return t.ErrorTypes}},{key:"ErrorDetails",get:function(){return t.ErrorDetails}},{key:"DefaultConfig",get:function(){return h.defaultConfig?h.defaultConfig:n.hlsDefaultConfig},set:function(l){h.defaultConfig=l}}]),h}();g.defaultConfig=void 0},"./src/is-supported.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"isSupported",function(){return R}),S.d(M,"changeTypeSupported",function(){return D});var N=S("./src/utils/mediasource-helper.ts");function w(){return self.SourceBuffer||self.WebKitSourceBuffer}function R(){var L=Object(N.getMediaSource)();if(!L)return!1;var x=w(),T=L&&typeof L.isTypeSupported=="function"&&L.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),m=!x||x.prototype&&typeof x.prototype.appendBuffer=="function"&&typeof x.prototype.remove=="function";return!!T&&!!m}function D(){var L,x=w();return typeof(x==null||((L=x.prototype)===null||L===void 0)?void 0:L.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"default",function(){return a}),S.d(M,"LoadError",function(){return s});var N=S("./src/polyfills/number.ts"),w=S("./src/errors.ts");function R(i,e){i.prototype=Object.create(e.prototype),i.prototype.constructor=i,m(i,e)}function D(i){var e=typeof Map=="function"?new Map:void 0;return D=function(r){if(r===null||!T(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e!="undefined"){if(e.has(r))return e.get(r);e.set(r,E)}function E(){return L(r,arguments,p(this).constructor)}return E.prototype=Object.create(r.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),m(E,r)},D(i)}function L(i,e,t){return x()?L=Reflect.construct:L=function(E,g,h){var y=[null];y.push.apply(y,g);var v=Function.bind.apply(E,y),l=new v;return h&&m(l,h.prototype),l},L.apply(null,arguments)}function x(){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(i){return!1}}function T(i){return Function.toString.call(i).indexOf("[native code]")!==-1}function m(i,e){return m=Object.setPrototypeOf||function(r,E){return r.__proto__=E,r},m(i,e)}function p(i){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},p(i)}var o=Math.pow(2,17),a=function(){function i(t){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=t}var e=i.prototype;return e.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},e.abort=function(){this.loader&&this.loader.abort()},e.load=function(r,E){var g=this,h=r.url;if(!h)return Promise.reject(new s({type:w.ErrorTypes.NETWORK_ERROR,details:w.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:r,networkDetails:null},"Fragment does not have a "+(h?"part list":"url")));this.abort();var y=this.config,v=y.fLoader,l=y.loader;return new Promise(function(u,d){g.loader&&g.loader.destroy();var c=g.loader=r.loader=v?new v(y):new l(y),_=n(r),f={timeout:y.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:y.fragLoadingMaxRetryTimeout,highWaterMark:o};r.stats=c.stats,c.load(_,f,{onSuccess:function(A,O,C,P){g.resetLoader(r,c),u({frag:r,part:null,payload:A.data,networkDetails:P})},onError:function(A,O,C){g.resetLoader(r,c),d(new s({type:w.ErrorTypes.NETWORK_ERROR,details:w.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:r,response:A,networkDetails:C}))},onAbort:function(A,O,C){g.resetLoader(r,c),d(new s({type:w.ErrorTypes.NETWORK_ERROR,details:w.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:r,networkDetails:C}))},onTimeout:function(A,O,C){g.resetLoader(r,c),d(new s({type:w.ErrorTypes.NETWORK_ERROR,details:w.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:r,networkDetails:C}))},onProgress:function(A,O,C,P){E&&E({frag:r,part:null,payload:C,networkDetails:P})}})})},e.loadPart=function(r,E,g){var h=this;this.abort();var y=this.config,v=y.fLoader,l=y.loader;return new Promise(function(u,d){h.loader&&h.loader.destroy();var c=h.loader=r.loader=v?new v(y):new l(y),_=n(r,E),f={timeout:y.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:y.fragLoadingMaxRetryTimeout,highWaterMark:o};E.stats=c.stats,c.load(_,f,{onSuccess:function(A,O,C,P){h.resetLoader(r,c),h.updateStatsFromPart(r,E);var k={frag:r,part:E,payload:A.data,networkDetails:P};g(k),u(k)},onError:function(A,O,C){h.resetLoader(r,c),d(new s({type:w.ErrorTypes.NETWORK_ERROR,details:w.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:r,part:E,response:A,networkDetails:C}))},onAbort:function(A,O,C){r.stats.aborted=E.stats.aborted,h.resetLoader(r,c),d(new s({type:w.ErrorTypes.NETWORK_ERROR,details:w.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:r,part:E,networkDetails:C}))},onTimeout:function(A,O,C){h.resetLoader(r,c),d(new s({type:w.ErrorTypes.NETWORK_ERROR,details:w.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:r,part:E,networkDetails:C}))}})})},e.updateStatsFromPart=function(r,E){var g=r.stats,h=E.stats,y=h.total;if(g.loaded+=h.loaded,y){var v=Math.round(r.duration/E.duration),l=Math.min(Math.round(g.loaded/y),v),u=v-l,d=u*Math.round(g.loaded/l);g.total=g.loaded+d}else g.total=Math.max(g.loaded,g.total);var c=g.loading,_=h.loading;c.start?c.first+=_.first-_.start:(c.start=_.start,c.first=_.first),c.end=_.end},e.resetLoader=function(r,E){r.loader=null,this.loader===E&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),E.destroy()},i}();function n(i,e){e===void 0&&(e=null);var t=e||i,r={frag:i,part:e,responseType:"arraybuffer",url:t.url,headers:{},rangeStart:0,rangeEnd:0},E=t.byteRangeStartOffset,g=t.byteRangeEndOffset;return Object(N.isFiniteNumber)(E)&&Object(N.isFiniteNumber)(g)&&(r.rangeStart=E,r.rangeEnd=g),r}var s=function(i){R(e,i);function e(t){for(var r,E=arguments.length,g=new Array(E>1?E-1:0),h=1;h<E;h++)g[h-1]=arguments[h];return r=i.call.apply(i,[this].concat(g))||this,r.data=void 0,r.data=t,r}return e}(D(Error))},"./src/loader/fragment.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"ElementaryStreamTypes",function(){return a}),S.d(M,"BaseSegment",function(){return n}),S.d(M,"Fragment",function(){return s}),S.d(M,"Part",function(){return i});var N=S("./src/polyfills/number.ts"),w=S("./node_modules/url-toolkit/src/url-toolkit.js"),R=S.n(w),D=S("./src/utils/logger.ts"),L=S("./src/loader/level-key.ts"),x=S("./src/loader/load-stats.ts");function T(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,m(e,t)}function m(e,t){return m=Object.setPrototypeOf||function(E,g){return E.__proto__=g,E},m(e,t)}function p(e,t){for(var r=0;r<t.length;r++){var E=t[r];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(e,E.key,E)}}function o(e,t,r){return t&&p(e.prototype,t),r&&p(e,r),e}var a;(function(e){e.AUDIO="audio",e.VIDEO="video",e.AUDIOVIDEO="audiovideo"})(a||(a={}));var n=function(){function e(r){var E;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(E={},E[a.AUDIO]=null,E[a.VIDEO]=null,E[a.AUDIOVIDEO]=null,E),this.baseurl=r}var t=e.prototype;return t.setByteRange=function(E,g){var h=E.split("@",2),y=[];h.length===1?y[0]=g?g.byteRangeEndOffset:0:y[0]=parseInt(h[1]),y[1]=parseInt(h[0])+y[0],this._byteRange=y},o(e,[{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Object(w.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(E){this._url=E}}]),e}(),s=function(e){T(t,e);function t(E,g){var h;return h=e.call(this,g)||this,h._decryptdata=null,h.rawProgramDateTime=null,h.programDateTime=null,h.tagList=[],h.duration=0,h.sn=0,h.levelkey=void 0,h.type=void 0,h.loader=null,h.level=-1,h.cc=0,h.startPTS=void 0,h.endPTS=void 0,h.appendedPTS=void 0,h.startDTS=void 0,h.endDTS=void 0,h.start=0,h.deltaPTS=void 0,h.maxStartPTS=void 0,h.minEndPTS=void 0,h.stats=new x.LoadStats,h.urlId=0,h.data=void 0,h.bitrateTest=!1,h.title=null,h.initSegment=null,h.type=E,h}var r=t.prototype;return r.createInitializationVector=function(g){for(var h=new Uint8Array(16),y=12;y<16;y++)h[y]=g>>8*(15-y)&255;return h},r.setDecryptDataFromLevelKey=function(g,h){var y=g;return(g==null?void 0:g.method)==="AES-128"&&g.uri&&!g.iv&&(y=L.LevelKey.fromURI(g.uri),y.method=g.method,y.iv=this.createInitializationVector(h),y.keyFormat="identity"),y},r.setElementaryStreamInfo=function(g,h,y,v,l,u){u===void 0&&(u=!1);var d=this.elementaryStreams,c=d[g];if(!c){d[g]={startPTS:h,endPTS:y,startDTS:v,endDTS:l,partial:u};return}c.startPTS=Math.min(c.startPTS,h),c.endPTS=Math.max(c.endPTS,y),c.startDTS=Math.min(c.startDTS,v),c.endDTS=Math.max(c.endDTS,l)},r.clearElementaryStreamInfo=function(){var g=this.elementaryStreams;g[a.AUDIO]=null,g[a.VIDEO]=null,g[a.AUDIOVIDEO]=null},o(t,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var g=this.sn;typeof g!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&D.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),g=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,g)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(N.isFiniteNumber)(this.programDateTime))return null;var g=Object(N.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+g*1e3}},{key:"encrypted",get:function(){var g;return!!((g=this.decryptdata)!==null&&g!==void 0&&g.keyFormat&&this.decryptdata.uri)}}]),t}(n),i=function(e){T(t,e);function t(r,E,g,h,y){var v;v=e.call(this,g)||this,v.fragOffset=0,v.duration=0,v.gap=!1,v.independent=!1,v.relurl=void 0,v.fragment=void 0,v.index=void 0,v.stats=new x.LoadStats,v.duration=r.decimalFloatingPoint("DURATION"),v.gap=r.bool("GAP"),v.independent=r.bool("INDEPENDENT"),v.relurl=r.enumeratedString("URI"),v.fragment=E,v.index=h;var l=r.enumeratedString("BYTERANGE");return l&&v.setByteRange(l,y),y&&(v.fragOffset=y.fragOffset+y.duration),v}return o(t,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var E=this.elementaryStreams;return!!(E.audio||E.video||E.audiovideo)}}]),t}(n)},"./src/loader/key-loader.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"default",function(){return D});var N=S("./src/events.ts"),w=S("./src/errors.ts"),R=S("./src/utils/logger.ts"),D=function(){function L(T){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=T,this._registerListeners()}var x=L.prototype;return x._registerListeners=function(){this.hls.on(N.Events.KEY_LOADING,this.onKeyLoading,this)},x._unregisterListeners=function(){this.hls.off(N.Events.KEY_LOADING,this.onKeyLoading)},x.destroy=function(){this._unregisterListeners();for(var m in this.loaders){var p=this.loaders[m];p&&p.destroy()}this.loaders={}},x.onKeyLoading=function(m,p){var o=p.frag,a=o.type,n=this.loaders[a];if(!o.decryptdata){R.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var s=o.decryptdata.uri;if(s!==this.decrypturl||this.decryptkey===null){var i=this.hls.config;if(n&&(R.logger.warn("abort previous key loader for type:"+a),n.abort()),!s){R.logger.warn("key uri is falsy");return}var e=i.loader,t=o.loader=this.loaders[a]=new e(i);this.decrypturl=s,this.decryptkey=null;var r={url:s,frag:o,responseType:"arraybuffer"},E={timeout:i.fragLoadingTimeOut,maxRetry:0,retryDelay:i.fragLoadingRetryDelay,maxRetryDelay:i.fragLoadingMaxRetryTimeout,highWaterMark:0},g={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};t.load(r,E,g)}else this.decryptkey&&(o.decryptdata.key=this.decryptkey,this.hls.trigger(N.Events.KEY_LOADED,{frag:o}))},x.loadsuccess=function(m,p,o){var a=o.frag;if(!a.decryptdata){R.logger.error("after key load, decryptdata unset");return}this.decryptkey=a.decryptdata.key=new Uint8Array(m.data),a.loader=null,delete this.loaders[a.type],this.hls.trigger(N.Events.KEY_LOADED,{frag:a})},x.loaderror=function(m,p){var o=p.frag,a=o.loader;a&&a.abort(),delete this.loaders[o.type],this.hls.trigger(N.Events.ERROR,{type:w.ErrorTypes.NETWORK_ERROR,details:w.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:o,response:m})},x.loadtimeout=function(m,p){var o=p.frag,a=o.loader;a&&a.abort(),delete this.loaders[o.type],this.hls.trigger(N.Events.ERROR,{type:w.ErrorTypes.NETWORK_ERROR,details:w.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:o})},L}()},"./src/loader/level-details.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"LevelDetails",function(){return L});var N=S("./src/polyfills/number.ts");function w(x,T){for(var m=0;m<T.length;m++){var p=T[m];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(x,p.key,p)}}function R(x,T,m){return T&&w(x.prototype,T),m&&w(x,m),x}var D=10,L=function(){function x(m){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.needSidxRanges=!1,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.fragments=[],this.url=m}var T=x.prototype;return T.reloaded=function(p){if(!p){this.advanced=!0,this.updated=!0;return}var o=this.lastPartSn-p.lastPartSn,a=this.lastPartIndex-p.lastPartIndex;this.updated=this.endSN!==p.endSN||!!a||!!o,this.advanced=this.endSN>p.endSN||o>0||o===0&&a>0,this.updated||this.advanced?this.misses=Math.floor(p.misses*.6):this.misses=p.misses+1,this.availabilityDelay=p.availabilityDelay},R(x,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(N.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||D}},{key:"drift",get:function(){var p=this.driftEndTime-this.driftStartTime;if(p>0){var o=this.driftEnd-this.driftStart;return o*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}}]),x}()},"./src/loader/level-key.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"LevelKey",function(){return L});var N=S("./node_modules/url-toolkit/src/url-toolkit.js"),w=S.n(N);function R(x,T){for(var m=0;m<T.length;m++){var p=T[m];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(x,p.key,p)}}function D(x,T,m){return T&&R(x.prototype,T),m&&R(x,m),x}var L=function(){x.fromURL=function(m,p){return new x(m,p)},x.fromURI=function(m){return new x(m)};function x(T,m){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,m?this._uri=Object(N.buildAbsoluteURL)(T,m,{alwaysNormalize:!0}):this._uri=T}return D(x,[{key:"uri",get:function(){return this._uri}}]),x}()},"./src/loader/load-stats.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"LoadStats",function(){return N});var N=function(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}},"./src/loader/m3u8-parser.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"default",function(){return t});var N=S("./src/polyfills/number.ts"),w=S("./node_modules/url-toolkit/src/url-toolkit.js"),R=S.n(w),D=S("./src/loader/fragment.ts"),L=S("./src/loader/level-details.ts"),x=S("./src/loader/level-key.ts"),T=S("./src/utils/attr-list.ts"),m=S("./src/utils/logger.ts"),p=S("./src/utils/codecs.ts"),o=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,a=/#EXT-X-MEDIA:(.*)/g,n=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),s=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(PLAYLIST-TYPE):(.+)/.source,/#EXT-X-(MEDIA-SEQUENCE): *(\d+)/.source,/#EXT-X-(SKIP):(.+)/.source,/#EXT-X-(TARGETDURATION): *(\d+)/.source,/#EXT-X-(KEY):(.+)/.source,/#EXT-X-(START):(.+)/.source,/#EXT-X-(ENDLIST)/.source,/#EXT-X-(DISCONTINUITY-SEQ)UENCE: *(\d+)/.source,/#EXT-X-(DIS)CONTINUITY/.source,/#EXT-X-(VERSION):(\d+)/.source,/#EXT-X-(MAP):(.+)/.source,/#EXT-X-(SERVER-CONTROL):(.+)/.source,/#EXT-X-(PART-INF):(.+)/.source,/#EXT-X-(GAP)/.source,/#EXT-X-(BITRATE):\s*(\d+)/.source,/#EXT-X-(PART):(.+)/.source,/#EXT-X-(PRELOAD-HINT):(.+)/.source,/#EXT-X-(RENDITION-REPORT):(.+)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),i=/\.(mp4|m4s|m4v|m4a)$/i;function e(y){var v,l;return i.test((v=(l=w.parseURL(y))===null||l===void 0?void 0:l.path)!=null?v:"")}var t=function(){function y(){}return y.findGroup=function(l,u){for(var d=0;d<l.length;d++){var c=l[d];if(c.id===u)return c}},y.convertAVC1ToAVCOTI=function(l){var u=l.split(".");if(u.length>2){var d=u.shift()+".";return d+=parseInt(u.shift()).toString(16),d+=("000"+parseInt(u.shift()).toString(16)).substr(-4),d}return l},y.resolve=function(l,u){return w.buildAbsoluteURL(u,l,{alwaysNormalize:!0})},y.parseMasterPlaylist=function(l,u){var d=[],c={},_=!1;o.lastIndex=0;for(var f;(f=o.exec(l))!=null;)if(f[1]){var b=new T.AttrList(f[1]),A={attrs:b,bitrate:b.decimalInteger("AVERAGE-BANDWIDTH")||b.decimalInteger("BANDWIDTH"),name:b.NAME,url:y.resolve(f[2],u)},O=b.decimalResolution("RESOLUTION");O&&(A.width=O.width,A.height=O.height),r((b.CODECS||"").split(/[ ,]+/).filter(function(P){return P}),A),A.videoCodec&&A.videoCodec.indexOf("avc1")!==-1&&(A.videoCodec=y.convertAVC1ToAVCOTI(A.videoCodec)),d.push(A)}else if(f[3]){var C=new T.AttrList(f[3]);C["DATA-ID"]&&(_=!0,c[C["DATA-ID"]]=C)}return{levels:d,sessionData:_?c:null}},y.parseMasterPlaylistMedia=function(l,u,d,c){c===void 0&&(c=[]);var _,f=[],b=0;for(a.lastIndex=0;(_=a.exec(l))!==null;){var A=new T.AttrList(_[1]);if(A.TYPE===d){var O={attrs:A,bitrate:0,id:b++,groupId:A["GROUP-ID"],instreamId:A["INSTREAM-ID"],name:A.NAME||A.LANGUAGE||"",type:d,default:A.bool("DEFAULT"),autoselect:A.bool("AUTOSELECT"),forced:A.bool("FORCED"),lang:A.LANGUAGE,url:A.URI?y.resolve(A.URI,u):""};if(c.length){var C=y.findGroup(c,O.groupId)||c[0];E(O,C,"audioCodec"),E(O,C,"textCodec")}f.push(O)}}return f},y.parseLevelPlaylist=function(l,u,d,c,_){var f=new L.LevelDetails(u),b=f.fragments,A=null,O=0,C=0,P=0,k=0,I=null,U=new D.Fragment(c,u),H,Z,$,ee=-1,te=!1;for(n.lastIndex=0,f.m3u8=l;(H=n.exec(l))!==null;){te&&(te=!1,U=new D.Fragment(c,u),U.start=P,U.sn=O,U.cc=k,U.level=d,A&&(U.initSegment=A,U.rawProgramDateTime=A.rawProgramDateTime));var K=H[1];if(K){U.duration=parseFloat(K);var W=(" "+H[2]).slice(1);U.title=W||null,U.tagList.push(W?["INF",K,W]:["INF",K])}else if(H[3])Object(N.isFiniteNumber)(U.duration)&&(U.start=P,$&&(U.levelkey=$),U.sn=O,U.level=d,U.cc=k,U.urlId=_,b.push(U),U.relurl=(" "+H[3]).slice(1),h(U,I),I=U,P+=U.duration,O++,C=0,te=!0);else if(H[4]){var X=(" "+H[4]).slice(1);I?U.setByteRange(X,I):U.setByteRange(X)}else if(H[5])U.rawProgramDateTime=(" "+H[5]).slice(1),U.tagList.push(["PROGRAM-DATE-TIME",U.rawProgramDateTime]),ee===-1&&(ee=b.length);else{if(H=H[0].match(s),!H){m.logger.warn("No matches on slow regex match for level playlist!");continue}for(Z=1;Z<H.length&&!(typeof H[Z]!="undefined");Z++);var j=(" "+H[Z]).slice(1),z=(" "+H[Z+1]).slice(1),ie=H[Z+2]?(" "+H[Z+2]).slice(1):"";switch(j){case"PLAYLIST-TYPE":f.type=z.toUpperCase();break;case"MEDIA-SEQUENCE":O=f.startSN=parseInt(z);break;case"SKIP":{var pe=new T.AttrList(z),_e=pe.decimalInteger("SKIPPED-SEGMENTS");if(Object(N.isFiniteNumber)(_e)){f.skippedSegments=_e;for(var Ee=_e;Ee--;)b.unshift(null);O+=_e}var we=pe.enumeratedString("RECENTLY-REMOVED-DATERANGES");we&&(f.recentlyRemovedDateranges=we.split(" "));break}case"TARGETDURATION":f.targetduration=parseFloat(z);break;case"VERSION":f.version=parseInt(z);break;case"EXTM3U":break;case"ENDLIST":f.live=!1;break;case"#":(z||ie)&&U.tagList.push(ie?[z,ie]:[z]);break;case"DIS":k++;case"GAP":U.tagList.push([j]);break;case"BITRATE":U.tagList.push([j,z]);break;case"DISCONTINUITY-SEQ":k=parseInt(z);break;case"KEY":{var fe,le=new T.AttrList(z),ce=le.enumeratedString("METHOD"),ge=le.URI,Re=le.hexadecimalInteger("IV"),xe=le.enumeratedString("KEYFORMATVERSIONS"),be=le.enumeratedString("KEYID"),Ie=(fe=le.enumeratedString("KEYFORMAT"))!=null?fe:"identity",ne=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(ne.indexOf(Ie)>-1){m.logger.warn("Keyformat "+Ie+" is not supported from the manifest");continue}else if(Ie!=="identity")continue;ce&&($=x.LevelKey.fromURL(u,ge),ge&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(ce)>=0&&($.method=ce,$.keyFormat=Ie,be&&($.keyID=be),xe&&($.keyFormatVersions=xe),$.iv=Re));break}case"START":{var oe=new T.AttrList(z),ue=oe.decimalFloatingPoint("TIME-OFFSET");Object(N.isFiniteNumber)(ue)&&(f.startTimeOffset=ue);break}case"MAP":{var me=new T.AttrList(z);U.relurl=me.URI,me.BYTERANGE&&U.setByteRange(me.BYTERANGE),U.level=d,U.sn="initSegment",$&&(U.levelkey=$),U.initSegment=null,A=U,te=!0;break}case"SERVER-CONTROL":{var ye=new T.AttrList(z);f.canBlockReload=ye.bool("CAN-BLOCK-RELOAD"),f.canSkipUntil=ye.optionalFloat("CAN-SKIP-UNTIL",0),f.canSkipDateRanges=f.canSkipUntil>0&&ye.bool("CAN-SKIP-DATERANGES"),f.partHoldBack=ye.optionalFloat("PART-HOLD-BACK",0),f.holdBack=ye.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var ve=new T.AttrList(z);f.partTarget=ve.decimalFloatingPoint("PART-TARGET");break}case"PART":{var de=f.partList;de||(de=f.partList=[]);var Oe=C>0?de[de.length-1]:void 0,Ae=C++,re=new D.Part(new T.AttrList(z),U,u,Ae,Oe);de.push(re),U.duration+=re.duration;break}case"PRELOAD-HINT":{var Se=new T.AttrList(z);f.preloadHint=Se;break}case"RENDITION-REPORT":{var q=new T.AttrList(z);f.renditionReports=f.renditionReports||[],f.renditionReports.push(q);break}default:m.logger.warn("line parsed but not handled: "+H);break}}}I&&!I.relurl?(b.pop(),P-=I.duration,f.partList&&(f.fragmentHint=I)):f.partList&&(h(U,I),U.cc=k,f.fragmentHint=U);var Q=b.length,J=b[0],F=b[Q-1];if(P+=f.skippedSegments*f.targetduration,P>0&&Q&&F){f.averagetargetduration=P/Q;var B=F.sn;f.endSN=B!=="initSegment"?B:0,J&&(f.startCC=J.cc,J.initSegment||f.fragments.every(function(G){return G.relurl&&e(G.relurl)})&&(m.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),U=new D.Fragment(c,u),U.relurl=F.relurl,U.level=d,U.sn="initSegment",J.initSegment=U,f.needSidxRanges=!0))}else f.endSN=0,f.startCC=0;return f.fragmentHint&&(P+=f.fragmentHint.duration),f.totalduration=P,f.endCC=k,ee>0&&g(b,ee),f},y}();function r(y,v){["video","audio","text"].forEach(function(l){var u=y.filter(function(c){return Object(p.isCodecType)(c,l)});if(u.length){var d=u.filter(function(c){return c.lastIndexOf("avc1",0)===0||c.lastIndexOf("mp4a",0)===0});v[l+"Codec"]=d.length>0?d[0]:u[0],y=y.filter(function(c){return u.indexOf(c)===-1})}}),v.unknownCodecs=y}function E(y,v,l){var u=v[l];u&&(y[l]=u)}function g(y,v){for(var l=y[v],u=v;u--;){var d=y[u];if(!d)return;d.programDateTime=l.programDateTime-d.duration*1e3,l=d}}function h(y,v){y.rawProgramDateTime?y.programDateTime=Date.parse(y.rawProgramDateTime):v!=null&&v.programDateTime&&(y.programDateTime=v.endProgramDateTime),Object(N.isFiniteNumber)(y.programDateTime)||(y.programDateTime=null,y.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(ae,M,S){"use strict";S.r(M);var N=S("./src/polyfills/number.ts"),w=S("./src/events.ts"),R=S("./src/errors.ts"),D=S("./src/utils/logger.ts"),L=S("./src/utils/mp4-tools.ts"),x=S("./src/loader/m3u8-parser.ts"),T=S("./src/types/loader.ts"),m=S("./src/utils/attr-list.ts");function p(n){var s=n.type;switch(s){case T.PlaylistContextType.AUDIO_TRACK:return T.PlaylistLevelType.AUDIO;case T.PlaylistContextType.SUBTITLE_TRACK:return T.PlaylistLevelType.SUBTITLE;default:return T.PlaylistLevelType.MAIN}}function o(n,s){var i=n.url;return(i===void 0||i.indexOf("data:")===0)&&(i=s.url),i}var a=function(){function n(i){this.hls=void 0,this.loaders=Object.create(null),this.hls=i,this.registerListeners()}var s=n.prototype;return s.registerListeners=function(){var e=this.hls;e.on(w.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.on(w.Events.LEVEL_LOADING,this.onLevelLoading,this),e.on(w.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(w.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},s.unregisterListeners=function(){var e=this.hls;e.off(w.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.off(w.Events.LEVEL_LOADING,this.onLevelLoading,this),e.off(w.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(w.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},s.createInternalLoader=function(e){var t=this.hls.config,r=t.pLoader,E=t.loader,g=r||E,h=new g(t);return e.loader=h,this.loaders[e.type]=h,h},s.getInternalLoader=function(e){return this.loaders[e.type]},s.resetInternalLoader=function(e){this.loaders[e]&&delete this.loaders[e]},s.destroyInternalLoaders=function(){for(var e in this.loaders){var t=this.loaders[e];t&&t.destroy(),this.resetInternalLoader(e)}},s.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},s.onManifestLoading=function(e,t){var r=t.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:T.PlaylistContextType.MANIFEST,url:r,deliveryDirectives:null})},s.onLevelLoading=function(e,t){var r=t.id,E=t.level,g=t.url,h=t.deliveryDirectives;this.load({id:r,groupId:null,level:E,responseType:"text",type:T.PlaylistContextType.LEVEL,url:g,deliveryDirectives:h})},s.onAudioTrackLoading=function(e,t){var r=t.id,E=t.groupId,g=t.url,h=t.deliveryDirectives;this.load({id:r,groupId:E,level:null,responseType:"text",type:T.PlaylistContextType.AUDIO_TRACK,url:g,deliveryDirectives:h})},s.onSubtitleTrackLoading=function(e,t){var r=t.id,E=t.groupId,g=t.url,h=t.deliveryDirectives;this.load({id:r,groupId:E,level:null,responseType:"text",type:T.PlaylistContextType.SUBTITLE_TRACK,url:g,deliveryDirectives:h})},s.load=function(e){var t,r=this.hls.config,E=this.getInternalLoader(e);if(E){var g=E.context;if(g&&g.url===e.url){D.logger.trace("[playlist-loader]: playlist request ongoing");return}D.logger.log("[playlist-loader]: aborting previous loader for type: "+e.type),E.abort()}var h,y,v,l;switch(e.type){case T.PlaylistContextType.MANIFEST:h=r.manifestLoadingMaxRetry,y=r.manifestLoadingTimeOut,v=r.manifestLoadingRetryDelay,l=r.manifestLoadingMaxRetryTimeout;break;case T.PlaylistContextType.LEVEL:case T.PlaylistContextType.AUDIO_TRACK:case T.PlaylistContextType.SUBTITLE_TRACK:h=0,y=r.levelLoadingTimeOut;break;default:h=r.levelLoadingMaxRetry,y=r.levelLoadingTimeOut,v=r.levelLoadingRetryDelay,l=r.levelLoadingMaxRetryTimeout;break}if(E=this.createInternalLoader(e),(t=e.deliveryDirectives)!==null&&t!==void 0&&t.part){var u;if(e.type===T.PlaylistContextType.LEVEL&&e.level!==null?u=this.hls.levels[e.level].details:e.type===T.PlaylistContextType.AUDIO_TRACK&&e.id!==null?u=this.hls.audioTracks[e.id].details:e.type===T.PlaylistContextType.SUBTITLE_TRACK&&e.id!==null&&(u=this.hls.subtitleTracks[e.id].details),u){var d=u.partTarget,c=u.targetduration;d&&c&&(y=Math.min(Math.max(d*3,c*.8)*1e3,y))}}var _={timeout:y,maxRetry:h,retryDelay:v,maxRetryDelay:l,highWaterMark:0},f={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};E.load(e,_,f)},s.loadsuccess=function(e,t,r,E){if(E===void 0&&(E=null),r.isSidxRequest){this.handleSidxRequest(e,r),this.handlePlaylistLoaded(e,t,r,E);return}this.resetInternalLoader(r.type);var g=e.data;if(g.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(e,r,"no EXTM3U delimiter",E);return}t.parsing.start=performance.now(),g.indexOf("#EXTINF:")>0||g.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(e,t,r,E):this.handleMasterPlaylist(e,t,r,E)},s.loaderror=function(e,t,r){r===void 0&&(r=null),this.handleNetworkError(t,r,!1,e)},s.loadtimeout=function(e,t,r){r===void 0&&(r=null),this.handleNetworkError(t,r,!0)},s.handleMasterPlaylist=function(e,t,r,E){var g=this.hls,h=e.data,y=o(e,r),v=x.default.parseMasterPlaylist(h,y),l=v.levels,u=v.sessionData;if(!l.length){this.handleManifestParsingError(e,r,"no level found in manifest",E);return}var d=l.map(function(O){return{id:O.attrs.AUDIO,audioCodec:O.audioCodec}}),c=l.map(function(O){return{id:O.attrs.SUBTITLES,textCodec:O.textCodec}}),_=x.default.parseMasterPlaylistMedia(h,y,"AUDIO",d),f=x.default.parseMasterPlaylistMedia(h,y,"SUBTITLES",c),b=x.default.parseMasterPlaylistMedia(h,y,"CLOSED-CAPTIONS");if(_.length){var A=_.some(function(O){return!O.url});!A&&l[0].audioCodec&&!l[0].attrs.AUDIO&&(D.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),_.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new m.AttrList({}),bitrate:0,url:""}))}g.trigger(w.Events.MANIFEST_LOADED,{levels:l,audioTracks:_,subtitles:f,captions:b,url:y,stats:t,networkDetails:E,sessionData:u})},s.handleTrackOrLevelPlaylist=function(e,t,r,E){var g=this.hls,h=r.id,y=r.level,v=r.type,l=o(e,r),u=Object(N.isFiniteNumber)(h)?h:0,d=Object(N.isFiniteNumber)(y)?y:u,c=p(r),_=x.default.parseLevelPlaylist(e.data,l,d,c,u);if(!_.fragments.length){g.trigger(w.Events.ERROR,{type:R.ErrorTypes.NETWORK_ERROR,details:R.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:l,reason:"no fragments found in level",level:typeof r.level=="number"?r.level:void 0});return}if(v===T.PlaylistContextType.MANIFEST){var f={attrs:new m.AttrList({}),bitrate:0,details:_,name:"",url:l};g.trigger(w.Events.MANIFEST_LOADED,{levels:[f],audioTracks:[],url:l,stats:t,networkDetails:E,sessionData:null})}if(t.parsing.end=performance.now(),_.needSidxRanges){var b,A=(b=_.fragments[0].initSegment)===null||b===void 0?void 0:b.url;this.load({url:A,isSidxRequest:!0,type:v,level:y,levelDetails:_,id:h,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}r.levelDetails=_,this.handlePlaylistLoaded(e,t,r,E)},s.handleSidxRequest=function(e,t){var r=Object(L.parseSegmentIndex)(new Uint8Array(e.data));if(!r)return;var E=r.references,g=t.levelDetails;E.forEach(function(h,y){var v=h.info,l=g.fragments[y];l.byteRange.length===0&&l.setByteRange(String(1+v.end-v.start)+"@"+String(v.start)),l.initSegment&&l.initSegment.setByteRange(String(r.moovEndOffset)+"@0")})},s.handleManifestParsingError=function(e,t,r,E){this.hls.trigger(w.Events.ERROR,{type:R.ErrorTypes.NETWORK_ERROR,details:R.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:t.type===T.PlaylistContextType.MANIFEST,url:e.url,reason:r,response:e,context:t,networkDetails:E})},s.handleNetworkError=function(e,t,r,E){r===void 0&&(r=!1),D.logger.warn("[playlist-loader]: A network "+(r?"timeout":"error")+" occurred while loading "+e.type+" level: "+e.level+" id: "+e.id+' group-id: "'+e.groupId+'"');var g=R.ErrorDetails.UNKNOWN,h=!1,y=this.getInternalLoader(e);switch(e.type){case T.PlaylistContextType.MANIFEST:g=r?R.ErrorDetails.MANIFEST_LOAD_TIMEOUT:R.ErrorDetails.MANIFEST_LOAD_ERROR,h=!0;break;case T.PlaylistContextType.LEVEL:g=r?R.ErrorDetails.LEVEL_LOAD_TIMEOUT:R.ErrorDetails.LEVEL_LOAD_ERROR,h=!1;break;case T.PlaylistContextType.AUDIO_TRACK:g=r?R.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:R.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,h=!1;break;case T.PlaylistContextType.SUBTITLE_TRACK:g=r?R.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:R.ErrorDetails.SUBTITLE_LOAD_ERROR,h=!1;break}y&&this.resetInternalLoader(e.type);var v={type:R.ErrorTypes.NETWORK_ERROR,details:g,fatal:h,url:e.url,loader:y,context:e,networkDetails:t};E&&(v.response=E),this.hls.trigger(w.Events.ERROR,v)},s.handlePlaylistLoaded=function(e,t,r,E){var g=r.type,h=r.level,y=r.id,v=r.groupId,l=r.loader,u=r.levelDetails,d=r.deliveryDirectives;if(!(u!=null&&u.targetduration)){this.handleManifestParsingError(e,r,"invalid target duration",E);return}if(!l)return;u.live&&(l.getCacheAge&&(u.ageHeader=l.getCacheAge()||0),(!l.getCacheAge||isNaN(u.ageHeader))&&(u.ageHeader=0));switch(g){case T.PlaylistContextType.MANIFEST:case T.PlaylistContextType.LEVEL:this.hls.trigger(w.Events.LEVEL_LOADED,{details:u,level:h||0,id:y||0,stats:t,networkDetails:E,deliveryDirectives:d});break;case T.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(w.Events.AUDIO_TRACK_LOADED,{details:u,id:y||0,groupId:v||"",stats:t,networkDetails:E,deliveryDirectives:d});break;case T.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(w.Events.SUBTITLE_TRACK_LOADED,{details:u,id:y||0,groupId:v||"",stats:t,networkDetails:E,deliveryDirectives:d});break}},n}();M.default=a},"./src/polyfills/number.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"isFiniteNumber",function(){return N}),S.d(M,"MAX_SAFE_INTEGER",function(){return w});var N=Number.isFinite||function(R){return typeof R=="number"&&isFinite(R)},w=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(ae,M,S){"use strict";S.r(M);var N=function(){function w(){}return w.getSilentFrame=function(D,L){switch(D){case"mp4a.40.2":if(L===1)return new Uint8Array([0,200,0,128,35,128]);if(L===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(L===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(L===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(L===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(L===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(L===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(L===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(L===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},w}();M.default=N},"./src/remux/mp4-generator.ts":function(ae,M,S){"use strict";S.r(M);var N=Math.pow(2,32)-1,w=function(){function R(){}return R.init=function(){R.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 L;for(L in R.types)R.types.hasOwnProperty(L)&&(R.types[L]=[L.charCodeAt(0),L.charCodeAt(1),L.charCodeAt(2),L.charCodeAt(3)]);var x=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]),T=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]);R.HDLR_TYPES={video:x,audio:T};var m=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]);R.STTS=R.STSC=R.STCO=p,R.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),R.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),R.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),R.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var o=new Uint8Array([105,115,111,109]),a=new Uint8Array([97,118,99,49]),n=new Uint8Array([0,0,0,1]);R.FTYP=R.box(R.types.ftyp,o,n,o,a),R.DINF=R.box(R.types.dinf,R.box(R.types.dref,m))},R.box=function(L){for(var x=8,T=arguments.length,m=new Array(T>1?T-1:0),p=1;p<T;p++)m[p-1]=arguments[p];for(var o=m.length,a=o;o--;)x+=m[o].byteLength;var n=new Uint8Array(x);for(n[0]=x>>24&255,n[1]=x>>16&255,n[2]=x>>8&255,n[3]=x&255,n.set(L,4),o=0,x=8;o<a;o++)n.set(m[o],x),x+=m[o].byteLength;return n},R.hdlr=function(L){return R.box(R.types.hdlr,R.HDLR_TYPES[L])},R.mdat=function(L){return R.box(R.types.mdat,L)},R.mdhd=function(L,x){x*=L;var T=Math.floor(x/(N+1)),m=Math.floor(x%(N+1));return R.box(R.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,L>>24&255,L>>16&255,L>>8&255,L&255,T>>24,T>>16&255,T>>8&255,T&255,m>>24,m>>16&255,m>>8&255,m&255,85,196,0,0]))},R.mdia=function(L){return R.box(R.types.mdia,R.mdhd(L.timescale,L.duration),R.hdlr(L.type),R.minf(L))},R.mfhd=function(L){return R.box(R.types.mfhd,new Uint8Array([0,0,0,0,L>>24,L>>16&255,L>>8&255,L&255]))},R.minf=function(L){return L.type==="audio"?R.box(R.types.minf,R.box(R.types.smhd,R.SMHD),R.DINF,R.stbl(L)):R.box(R.types.minf,R.box(R.types.vmhd,R.VMHD),R.DINF,R.stbl(L))},R.moof=function(L,x,T){return R.box(R.types.moof,R.mfhd(L),R.traf(T,x))},R.moov=function(L){for(var x=L.length,T=[];x--;)T[x]=R.trak(L[x]);return R.box.apply(null,[R.types.moov,R.mvhd(L[0].timescale,L[0].duration)].concat(T).concat(R.mvex(L)))},R.mvex=function(L){for(var x=L.length,T=[];x--;)T[x]=R.trex(L[x]);return R.box.apply(null,[R.types.mvex].concat(T))},R.mvhd=function(L,x){x*=L;var T=Math.floor(x/(N+1)),m=Math.floor(x%(N+1)),p=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,L>>24&255,L>>16&255,L>>8&255,L&255,T>>24,T>>16&255,T>>8&255,T&255,m>>24,m>>16&255,m>>8&255,m&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 R.box(R.types.mvhd,p)},R.sdtp=function(L){var x=L.samples||[],T=new Uint8Array(4+x.length),m,p;for(m=0;m<x.length;m++)p=x[m].flags,T[m+4]=p.dependsOn<<4|p.isDependedOn<<2|p.hasRedundancy;return R.box(R.types.sdtp,T)},R.stbl=function(L){return R.box(R.types.stbl,R.stsd(L),R.box(R.types.stts,R.STTS),R.box(R.types.stsc,R.STSC),R.box(R.types.stsz,R.STSZ),R.box(R.types.stco,R.STCO))},R.avc1=function(L){var x=[],T=[],m,p,o;for(m=0;m<L.sps.length;m++)p=L.sps[m],o=p.byteLength,x.push(o>>>8&255),x.push(o&255),x=x.concat(Array.prototype.slice.call(p));for(m=0;m<L.pps.length;m++)p=L.pps[m],o=p.byteLength,T.push(o>>>8&255),T.push(o&255),T=T.concat(Array.prototype.slice.call(p));var a=R.box(R.types.avcC,new Uint8Array([1,x[3],x[4],x[5],252|3,224|L.sps.length].concat(x).concat([L.pps.length]).concat(T))),n=L.width,s=L.height,i=L.pixelRatio[0],e=L.pixelRatio[1];return R.box(R.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,n>>8&255,n&255,s>>8&255,s&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]),a,R.box(R.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),R.box(R.types.pasp,new Uint8Array([i>>24,i>>16&255,i>>8&255,i&255,e>>24,e>>16&255,e>>8&255,e&255])))},R.esds=function(L){var x=L.config.length;return new Uint8Array([0,0,0,0,3,23+x,0,1,0,4,15+x,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([x]).concat(L.config).concat([6,1,2]))},R.mp4a=function(L){var x=L.samplerate;return R.box(R.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,L.channelCount,0,16,0,0,0,0,x>>8&255,x&255,0,0]),R.box(R.types.esds,R.esds(L)))},R.mp3=function(L){var x=L.samplerate;return R.box(R.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,L.channelCount,0,16,0,0,0,0,x>>8&255,x&255,0,0]))},R.stsd=function(L){return L.type==="audio"?!L.isAAC&&L.codec==="mp3"?R.box(R.types.stsd,R.STSD,R.mp3(L)):R.box(R.types.stsd,R.STSD,R.mp4a(L)):R.box(R.types.stsd,R.STSD,R.avc1(L))},R.tkhd=function(L){var x=L.id,T=L.duration*L.timescale,m=L.width,p=L.height,o=Math.floor(T/(N+1)),a=Math.floor(T%(N+1));return R.box(R.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,x>>24&255,x>>16&255,x>>8&255,x&255,0,0,0,0,o>>24,o>>16&255,o>>8&255,o&255,a>>24,a>>16&255,a>>8&255,a&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,m>>8&255,m&255,0,0,p>>8&255,p&255,0,0]))},R.traf=function(L,x){var T=R.sdtp(L),m=L.id,p=Math.floor(x/(N+1)),o=Math.floor(x%(N+1));return R.box(R.types.traf,R.box(R.types.tfhd,new Uint8Array([0,0,0,0,m>>24,m>>16&255,m>>8&255,m&255])),R.box(R.types.tfdt,new Uint8Array([1,0,0,0,p>>24,p>>16&255,p>>8&255,p&255,o>>24,o>>16&255,o>>8&255,o&255])),R.trun(L,T.length+16+20+8+16+8+8),T)},R.trak=function(L){return L.duration=L.duration||4294967295,R.box(R.types.trak,R.tkhd(L),R.mdia(L))},R.trex=function(L){var x=L.id;return R.box(R.types.trex,new Uint8Array([0,0,0,0,x>>24,x>>16&255,x>>8&255,x&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},R.trun=function(L,x){var T=L.samples||[],m=T.length,p=12+16*m,o=new Uint8Array(p),a,n,s,i,e,t;for(x+=8+p,o.set([0,0,15,1,m>>>24&255,m>>>16&255,m>>>8&255,m&255,x>>>24&255,x>>>16&255,x>>>8&255,x&255],0),a=0;a<m;a++)n=T[a],s=n.duration,i=n.size,e=n.flags,t=n.cts,o.set([s>>>24&255,s>>>16&255,s>>>8&255,s&255,i>>>24&255,i>>>16&255,i>>>8&255,i&255,e.isLeading<<2|e.dependsOn,e.isDependedOn<<6|e.hasRedundancy<<4|e.paddingValue<<1|e.isNonSync,e.degradPrio&240<<8,e.degradPrio&15,t>>>24&255,t>>>16&255,t>>>8&255,t&255],12+16*a);return R.box(R.types.trun,o)},R.initSegment=function(L){R.types||R.init();var x=R.moov(L),T=new Uint8Array(R.FTYP.byteLength+x.byteLength);return T.set(R.FTYP),T.set(x,R.FTYP.byteLength),T},R}();w.types=void 0,w.HDLR_TYPES=void 0,w.STTS=void 0,w.STSC=void 0,w.STCO=void 0,w.STSZ=void 0,w.VMHD=void 0,w.SMHD=void 0,w.STSD=void 0,w.FTYP=void 0,w.DINF=void 0,M.default=w},"./src/remux/mp4-remuxer.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"default",function(){return t}),S.d(M,"normalizePts",function(){return r});var N=S("./src/polyfills/number.ts"),w=S("./src/remux/aac-helper.ts"),R=S("./src/remux/mp4-generator.ts"),D=S("./src/events.ts"),L=S("./src/errors.ts"),x=S("./src/utils/logger.ts"),T=S("./src/types/loader.ts"),m=S("./src/utils/timescale-conversion.ts");function p(){return p=Object.assign||function(y){for(var v=1;v<arguments.length;v++){var l=arguments[v];for(var u in l)Object.prototype.hasOwnProperty.call(l,u)&&(y[u]=l[u])}return y},p.apply(this,arguments)}var o=10*1e3,a=1024,n=1152,s=null,i=null,e=!1,t=function(){function y(l,u,d,c){if(c===void 0&&(c=""),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=void 0,this._initDTS=void 0,this.nextAvcDts=null,this.nextAudioPts=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=l,this.config=u,this.typeSupported=d,this.ISGenerated=!1,s===null){var _=navigator.userAgent||"",f=_.match(/Chrome\/(\d+)/i);s=f?parseInt(f[1]):0}if(i===null){var b=navigator.userAgent.match(/Safari\/(\d+)/i);i=b?parseInt(b[1]):0}e=!!s&&s<75||!!i&&i<600}var v=y.prototype;return v.destroy=function(){},v.resetTimeStamp=function(u){x.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=u},v.resetNextTimestamp=function(){x.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},v.resetInitSegment=function(){x.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},v.getVideoStartPts=function(u){var d=!1,c=u.reduce(function(_,f){var b=f.pts-_;return b<-4294967296?(d=!0,r(_,f.pts)):b>0?_:f.pts},u[0].pts);return d&&x.logger.debug("PTS rollover detected"),c},v.remux=function(u,d,c,_,f,b,A,O){var C,P,k,I,U,H,Z=f,$=f,ee=u.pid>-1,te=d.pid>-1,K=d.samples.length,W=u.samples.length>0,X=K>1,j=(!ee||W)&&(!te||X)||this.ISGenerated||A;if(j){this.ISGenerated||(k=this.generateIS(u,d,f));var z=this.isVideoContiguous,ie=-1;if(X&&(ie=E(d.samples),!z&&this.config.forceKeyFrameOnDiscontinuity))if(H=!0,ie>0){x.logger.warn("[mp4-remuxer]: Dropped "+ie+" out of "+K+" video samples due to a missing keyframe");var pe=this.getVideoStartPts(d.samples);d.samples=d.samples.slice(ie),d.dropped+=ie,$+=(d.samples[0].pts-pe)/(d.timescale||9e4)}else ie===-1&&(x.logger.warn("[mp4-remuxer]: No keyframe found out of "+K+" video samples"),H=!1);if(this.ISGenerated){if(W&&X){var _e=this.getVideoStartPts(d.samples),Ee=r(u.samples[0].pts,_e)-_e,we=Ee/d.inputTimeScale;Z+=Math.max(0,we),$+=Math.max(0,-we)}if(W){if(u.samplerate||(x.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),k=this.generateIS(u,d,f)),P=this.remuxAudio(u,Z,this.isAudioContiguous,b,te||X||O===T.PlaylistLevelType.AUDIO?$:void 0),X){var fe=P?P.endPTS-P.startPTS:0;d.inputTimeScale||(x.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),k=this.generateIS(u,d,f)),C=this.remuxVideo(d,$,z,fe)}}else X&&(C=this.remuxVideo(d,$,z,0));C&&(C.firstKeyFrame=ie,C.independent=ie!==-1)}}return this.ISGenerated&&(c.samples.length&&(U=this.remuxID3(c,f)),_.samples.length&&(I=this.remuxText(_,f))),{audio:P,video:C,initSegment:k,independent:H,text:I,id3:U}},v.generateIS=function(u,d,c){var _=u.samples,f=d.samples,b=this.typeSupported,A={},O=!Object(N.isFiniteNumber)(this._initPTS),C="audio/mp4",P,k,I;if(O&&(P=k=Infinity),u.config&&_.length&&(u.timescale=u.samplerate,u.isAAC||(b.mpeg?(C="audio/mpeg",u.codec=""):b.mp3&&(u.codec="mp3")),A.audio={id:"audio",container:C,codec:u.codec,initSegment:!u.isAAC&&b.mpeg?new Uint8Array(0):R.default.initSegment([u]),metadata:{channelCount:u.channelCount}},O&&(I=u.inputTimeScale,P=k=_[0].pts-Math.round(I*c))),d.sps&&d.pps&&f.length&&(d.timescale=d.inputTimeScale,A.video={id:"main",container:"video/mp4",codec:d.codec,initSegment:R.default.initSegment([d]),metadata:{width:d.width,height:d.height}},O)){I=d.inputTimeScale;var U=this.getVideoStartPts(f),H=Math.round(I*c);k=Math.min(k,r(f[0].dts,U)-H),P=Math.min(P,U-H)}if(Object.keys(A).length)return this.ISGenerated=!0,O&&(this._initPTS=P,this._initDTS=k),{tracks:A,initPTS:P,timescale:I}},v.remuxVideo=function(u,d,c,_){var f=u.inputTimeScale,b=u.samples,A=[],O=b.length,C=this._initPTS,P=this.nextAvcDts,k=8,I,U,H,Z=Number.POSITIVE_INFINITY,$=Number.NEGATIVE_INFINITY,ee=0,te=!1;if(!c||P===null){var K=d*f,W=b[0].pts-r(b[0].dts,b[0].pts);P=K-W}for(var X=0;X<O;X++){var j=b[X];if(j.pts=r(j.pts-C,P),j.dts=r(j.dts-C,P),j.dts>j.pts){var z=9e4*.2;ee=Math.max(Math.min(ee,j.pts-j.dts),-1*z)}j.dts<b[X>0?X-1:X].dts&&(te=!0)}te&&b.sort(function(We,He){var Me=We.dts-He.dts,qe=We.pts-He.pts;return Me||qe}),U=b[0].dts,H=b[b.length-1].dts;var ie=Math.round((H-U)/(O-1));if(ee<0){if(ee<ie*-2){x.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(m.toMsFromMpegTsClock)(-ie,!0)+" ms");for(var pe=ee,_e=0;_e<O;_e++)b[_e].dts=pe=Math.max(pe,b[_e].pts-ie),b[_e].pts=Math.max(pe,b[_e].pts)}else{x.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(m.toMsFromMpegTsClock)(ee,!0)+" ms to overcome this issue");for(var Ee=0;Ee<O;Ee++)b[Ee].dts=b[Ee].dts+ee}U=b[0].dts}if(c){var we=U-P,fe=we>ie,le=we<-1;if(fe||le){fe?x.logger.warn("AVC: "+Object(m.toMsFromMpegTsClock)(we,!0)+" ms ("+we+"dts) hole between fragments detected, filling it"):x.logger.warn("AVC: "+Object(m.toMsFromMpegTsClock)(-we,!0)+" ms ("+we+"dts) overlapping between fragments detected"),U=P;var ce=b[0].pts-we;b[0].dts=U,b[0].pts=ce,x.logger.log("Video: First PTS/DTS adjusted: "+Object(m.toMsFromMpegTsClock)(ce,!0)+"/"+Object(m.toMsFromMpegTsClock)(U,!0)+", delta: "+Object(m.toMsFromMpegTsClock)(we,!0)+" ms")}}e&&(U=Math.max(0,U));for(var ge=0,Re=0,xe=0;xe<O;xe++){for(var be=b[xe],Ie=be.units,ne=Ie.length,oe=0,ue=0;ue<ne;ue++)oe+=Ie[ue].data.length;Re+=oe,ge+=ne,be.length=oe,be.dts=Math.max(be.dts,U),be.pts=Math.max(be.pts,be.dts,0),Z=Math.min(be.pts,Z),$=Math.max(be.pts,$)}H=b[O-1].dts;var me=Re+4*ge+8,ye;try{ye=new Uint8Array(me)}catch(We){this.observer.emit(D.Events.ERROR,D.Events.ERROR,{type:L.ErrorTypes.MUX_ERROR,details:L.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:me,reason:"fail allocating video mdat "+me});return}var ve=new DataView(ye.buffer);ve.setUint32(0,me),ye.set(R.default.types.mdat,4);for(var de=0;de<O;de++){for(var Oe=b[de],Ae=Oe.units,re=0,Se=0,q=Ae.length;Se<q;Se++){var Q=Ae[Se],J=Q.data,F=Q.data.byteLength;ve.setUint32(k,F),k+=4,ye.set(J,k),k+=F,re+=4+F}if(de<O-1)I=b[de+1].dts-Oe.dts;else{var B=this.config,G=Oe.dts-b[de>0?de-1:de].dts;if(B.stretchShortVideoTrack&&this.nextAudioPts!==null){var V=Math.floor(B.maxBufferHole*f),se=(_?Z+_*f:this.nextAudioPts)-Oe.pts;se>V?(I=se-G,I<0&&(I=G),x.logger.log("[mp4-remuxer]: It is approximately "+se/90+" ms to the next segment; using duration "+I/90+" ms for the last video frame.")):I=G}else I=G}var he=Math.round(Oe.pts-Oe.dts);A.push(new g(Oe.key,I,re,he))}if(A.length&&s&&s<70){var Te=A[0].flags;Te.dependsOn=2,Te.isNonSync=0}console.assert(I!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=P=H+I,this.isVideoContiguous=!0;var De=R.default.moof(u.sequenceNumber++,U,p({},u,{samples:A})),Pe="video",Ce={data1:De,data2:ye,startPTS:Z/f,endPTS:($+I)/f,startDTS:U/f,endDTS:P/f,type:Pe,hasAudio:!1,hasVideo:!0,nb:A.length,dropped:u.dropped};return u.samples=[],u.dropped=0,console.assert(ye.length,"MDAT length must not be zero"),Ce},v.remuxAudio=function(u,d,c,_,f){var b=u.inputTimeScale,A=u.samplerate?u.samplerate:b,O=b/A,C=u.isAAC?a:n,P=C*O,k=this._initPTS,I=!u.isAAC&&this.typeSupported.mpeg,U=[],H=u.samples,Z=I?0:8,$=this.nextAudioPts||-1,ee=d*b;if(this.isAudioContiguous=c=c||H.length&&$>0&&(_&&Math.abs(ee-$)<9e3||Math.abs(r(H[0].pts-k,ee)-$)<20*P),H.forEach(function(J){J.pts=r(J.pts-k,ee)}),!c||$<0){if(H=H.filter(function(J){return J.pts>=0}),!H.length)return;f===0?$=0:_?$=Math.max(0,ee):$=H[0].pts}if(u.isAAC)for(var te=f!==void 0,K=this.config.maxAudioFramesDrift,W=0,X=$;W<H.length;W++){var j=H[W],z=j.pts,ie=z-X,pe=Math.abs(1e3*ie/b);if(ie<=-K*P&&te)W===0&&(x.logger.warn("Audio frame @ "+(z/b).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*ie/b)+" ms."),this.nextAudioPts=$=X=z);else if(ie>=K*P&&pe<o&&te){var _e=Math.round(ie/P);X=z-_e*P,X<0&&(_e--,X+=P),W===0&&(this.nextAudioPts=$=X),x.logger.warn("[mp4-remuxer]: Injecting "+_e+" audio frame @ "+(X/b).toFixed(3)+"s due to "+Math.round(1e3*ie/b)+" ms gap.");for(var Ee=0;Ee<_e;Ee++){var we=Math.max(X,0),fe=w.default.getSilentFrame(u.manifestCodec||u.codec,u.channelCount);fe||(x.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),fe=j.unit.subarray()),H.splice(W,0,{unit:fe,pts:we}),X+=P,W++}}j.pts=X,X+=P}for(var le=null,ce=null,ge,Re=0,xe=H.length;xe--;)Re+=H[xe].unit.byteLength;for(var be=0,Ie=H.length;be<Ie;be++){var ne=H[be],oe=ne.unit,ue=ne.pts;if(ce!==null){var me=U[be-1];me.duration=Math.round((ue-ce)/O)}else if(c&&u.isAAC&&(ue=$),le=ue,Re>0){Re+=Z;try{ge=new Uint8Array(Re)}catch(J){this.observer.emit(D.Events.ERROR,D.Events.ERROR,{type:L.ErrorTypes.MUX_ERROR,details:L.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Re,reason:"fail allocating audio mdat "+Re});return}if(!I){var ye=new DataView(ge.buffer);ye.setUint32(0,Re),ge.set(R.default.types.mdat,4)}}else return;ge.set(oe,Z);var ve=oe.byteLength;Z+=ve,U.push(new g(!0,C,ve,0)),ce=ue}var de=U.length;if(!de)return;var Oe=U[U.length-1];this.nextAudioPts=$=ce+O*Oe.duration;var Ae=I?new Uint8Array(0):R.default.moof(u.sequenceNumber++,le/O,p({},u,{samples:U}));u.samples=[];var re=le/b,Se=$/b,q="audio",Q={data1:Ae,data2:ge,startPTS:re,endPTS:Se,startDTS:re,endDTS:Se,type:q,hasAudio:!0,hasVideo:!1,nb:de};return this.isAudioContiguous=!0,console.assert(ge.length,"MDAT length must not be zero"),Q},v.remuxEmptyAudio=function(u,d,c,_){var f=u.inputTimeScale,b=u.samplerate?u.samplerate:f,A=f/b,O=this.nextAudioPts,C=(O!==null?O:_.startDTS*f)+this._initDTS,P=_.endDTS*f+this._initDTS,k=A*a,I=Math.ceil((P-C)/k),U=w.default.getSilentFrame(u.manifestCodec||u.codec,u.channelCount);if(x.logger.warn("[mp4-remuxer]: remux empty Audio"),!U){x.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var H=[],Z=0;Z<I;Z++){var $=C+Z*k;H.push({unit:U,pts:$,dts:$})}return u.samples=H,this.remuxAudio(u,d,c,!1)},v.remuxID3=function(u,d){var c=u.samples.length;if(!c)return;for(var _=u.inputTimeScale,f=this._initPTS,b=this._initDTS,A=0;A<c;A++){var O=u.samples[A];O.pts=r(O.pts-f,d*_)/_,O.dts=r(O.dts-b,d*_)/_}var C=u.samples;return u.samples=[],{samples:C}},v.remuxText=function(u,d){var c=u.samples.length;if(!c)return;for(var _=u.inputTimeScale,f=this._initPTS,b=0;b<c;b++){var A=u.samples[b];A.pts=r(A.pts-f,d*_)/_}u.samples.sort(function(C,P){return C.pts-P.pts});var O=u.samples;return u.samples=[],{samples:O}},y}();function r(y,v){var l;if(v===null)return y;for(v<y?l=-8589934592:l=8589934592;Math.abs(y-v)>4294967296;)y+=l;return y}function E(y){for(var v=0;v<y.length;v++)if(y[v].key)return v;return-1}var g=function(v,l,u,d){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=l,this.size=u,this.cts=d,this.flags=new h(v)},h=function(v){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=v?2:1,this.isNonSync=v?0:1}},"./src/remux/passthrough-remuxer.ts":function(ae,M,S){"use strict";S.r(M);var N=S("./src/polyfills/number.ts"),w=S("./src/utils/mp4-tools.ts"),R=S("./src/loader/fragment.ts"),D=S("./src/utils/logger.ts"),L=function(){function m(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndDTS=null}var p=m.prototype;return p.destroy=function(){},p.resetTimeStamp=function(a){this.initPTS=a,this.lastEndDTS=null},p.resetNextTimestamp=function(){this.lastEndDTS=null},p.resetInitSegment=function(a,n,s){this.audioCodec=n,this.videoCodec=s,this.generateInitSegment(a),this.emitInitSegment=!0},p.generateInitSegment=function(a){var n=this.audioCodec,s=this.videoCodec;if(!a||!a.byteLength){this.initTracks=void 0,this.initData=void 0;return}var i=this.initData=Object(w.parseInitSegment)(a);n||(n=T(i.audio,R.ElementaryStreamTypes.AUDIO)),s||(s=T(i.video,R.ElementaryStreamTypes.VIDEO));var e={};i.audio&&i.video?e.audiovideo={container:"video/mp4",codec:n+","+s,initSegment:a,id:"main"}:i.audio?e.audio={container:"audio/mp4",codec:n,initSegment:a,id:"audio"}:i.video?e.video={container:"video/mp4",codec:s,initSegment:a,id:"main"}:D.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=e},p.remux=function(a,n,s,i,e){var t=this.initPTS,r=this.lastEndDTS,E={audio:void 0,video:void 0,text:i,id3:s,initSegment:void 0};Object(N.isFiniteNumber)(r)||(r=this.lastEndDTS=e||0);var g=n.samples;if(!g||!g.length)return E;var h={initPTS:void 0,timescale:1},y=this.initData;if((!y||!y.length)&&(this.generateInitSegment(g),y=this.initData),!y||!y.length)return D.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),E;this.emitInitSegment&&(h.tracks=this.initTracks,this.emitInitSegment=!1),Object(N.isFiniteNumber)(t)||(this.initPTS=h.initPTS=t=x(y,g,r));var v=Object(w.getDuration)(g,y),l=r,u=v+l;Object(w.offsetStartDTS)(y,g,t),v>0?this.lastEndDTS=u:(D.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var d=!!y.audio,c=!!y.video,_="";d&&(_+="audio"),c&&(_+="video");var f={data1:g,startPTS:l,startDTS:l,endPTS:u,endDTS:u,type:_,hasAudio:d,hasVideo:c,nb:1,dropped:0};return E.audio=f.type==="audio"?f:void 0,E.video=f.type!=="audio"?f:void 0,E.text=i,E.id3=s,E.initSegment=h,E},m}(),x=function(p,o,a){return Object(w.getStartDTS)(p,o)-a};function T(m,p){var o=m==null?void 0:m.codec;return o&&o.length>4?o:o==="hvc1"?"hvc1.1.c.L120.90":o==="av01"?"av01.0.04M.08":o==="avc1"||p===R.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}M.default=L},"./src/task-loop.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"default",function(){return N});var N=function(){function w(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var R=w.prototype;return R.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},R.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},R.onHandlerDestroyed=function(){},R.hasInterval=function(){return!!this._tickInterval},R.hasNextTick=function(){return!!this._tickTimer},R.setInterval=function(L){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,L),!0)},R.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},R.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},R.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},R.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},R.doTick=function(){},w}()},"./src/types/cmcd.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"CMCDVersion",function(){return N}),S.d(M,"CMCDObjectType",function(){return w}),S.d(M,"CMCDStreamingFormat",function(){return R}),S.d(M,"CMCDStreamType",function(){return D});var N=1,w;(function(L){L.MANIFEST="m",L.AUDIO="a",L.VIDEO="v",L.MUXED="av",L.INIT="i",L.CAPTION="c",L.TIMED_TEXT="tt",L.KEY="k",L.OTHER="o"})(w||(w={}));var R;(function(L){L.DASH="d",L.HLS="h",L.SMOOTH="s",L.OTHER="o"})(R||(R={}));var D;(function(L){L.VOD="v",L.LIVE="l"})(D||(D={}))},"./src/types/level.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"HlsSkip",function(){return R}),S.d(M,"getSkipValue",function(){return D}),S.d(M,"HlsUrlParameters",function(){return L}),S.d(M,"Level",function(){return x});function N(T,m){for(var p=0;p<m.length;p++){var o=m[p];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(T,o.key,o)}}function w(T,m,p){return m&&N(T.prototype,m),p&&N(T,p),T}var R;(function(T){T.No="",T.Yes="YES",T.v2="v2"})(R||(R={}));function D(T,m){var p=T.canSkipUntil,o=T.canSkipDateRanges,a=T.endSN,n=m!==void 0?m-a:0;return p&&n<p?o?R.v2:R.Yes:R.No}var L=function(){function T(p,o,a){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=p,this.part=o,this.skip=a}var m=T.prototype;return m.addDirectives=function(o){var a=new self.URL(o);return this.msn!==void 0&&a.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&a.searchParams.set("_HLS_part",this.part.toString()),this.skip&&a.searchParams.set("_HLS_skip",this.skip),a.toString()},T}(),x=function(){function T(m){this.attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.unknownCodecs=void 0,this.audioGroupIds=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.textGroupIds=void 0,this.url=void 0,this._urlId=0,this.url=[m.url],this.attrs=m.attrs,this.bitrate=m.bitrate,m.details&&(this.details=m.details),this.id=m.id||0,this.name=m.name,this.width=m.width||0,this.height=m.height||0,this.audioCodec=m.audioCodec,this.videoCodec=m.videoCodec,this.unknownCodecs=m.unknownCodecs,this.codecSet=[m.videoCodec,m.audioCodec].filter(function(p){return p}).join(",").replace(/\.[^.,]+/g,"")}return w(T,[{key:"maxBitrate",get:function(){return Math.max(this.realBitrate,this.bitrate)}},{key:"uri",get:function(){return this.url[this._urlId]||""}},{key:"urlId",get:function(){return this._urlId},set:function(p){var o=p%this.url.length;this._urlId!==o&&(this.details=void 0,this._urlId=o)}}]),T}()},"./src/types/loader.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"PlaylistContextType",function(){return N}),S.d(M,"PlaylistLevelType",function(){return w});var N;(function(R){R.MANIFEST="manifest",R.LEVEL="level",R.AUDIO_TRACK="audioTrack",R.SUBTITLE_TRACK="subtitleTrack"})(N||(N={}));var w;(function(R){R.MAIN="main",R.AUDIO="audio",R.SUBTITLE="subtitle"})(w||(w={}))},"./src/types/transmuxer.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"ChunkMetadata",function(){return N});var N=function(D,L,x,T,m,p){T===void 0&&(T=0),m===void 0&&(m=-1),p===void 0&&(p=!1),this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=w(),this.buffering={audio:w(),video:w(),audiovideo:w()},this.level=D,this.sn=L,this.id=x,this.size=T,this.part=m,this.partial=p};function w(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"AttrList",function(){return R});var N=/^(\d+)x(\d+)$/,w=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,R=function(){function D(x){typeof x=="string"&&(x=D.parseAttrList(x));for(var T in x)x.hasOwnProperty(T)&&(this[T]=x[T])}var L=D.prototype;return L.decimalInteger=function(T){var m=parseInt(this[T],10);return m>Number.MAX_SAFE_INTEGER?Infinity:m},L.hexadecimalInteger=function(T){if(this[T]){var m=(this[T]||"0x").slice(2);m=(m.length&1?"0":"")+m;for(var p=new Uint8Array(m.length/2),o=0;o<m.length/2;o++)p[o]=parseInt(m.slice(o*2,o*2+2),16);return p}else return null},L.hexadecimalIntegerAsNumber=function(T){var m=parseInt(this[T],16);return m>Number.MAX_SAFE_INTEGER?Infinity:m},L.decimalFloatingPoint=function(T){return parseFloat(this[T])},L.optionalFloat=function(T,m){var p=this[T];return p?parseFloat(p):m},L.enumeratedString=function(T){return this[T]},L.bool=function(T){return this[T]==="YES"},L.decimalResolution=function(T){var m=N.exec(this[T]);return m===null?void 0:{width:parseInt(m[1],10),height:parseInt(m[2],10)}},D.parseAttrList=function(T){var m,p={},o='"';for(w.lastIndex=0;(m=w.exec(T))!==null;){var a=m[2];a.indexOf(o)===0&&a.lastIndexOf(o)===a.length-1&&(a=a.slice(1,-1)),p[m[1]]=a}return p},D}()},"./src/utils/binary-search.ts":function(ae,M,S){"use strict";S.r(M);var N={search:function(R,D){for(var L=0,x=R.length-1,T=null,m=null;L<=x;){T=(L+x)/2|0,m=R[T];var p=D(m);if(p>0)L=T+1;else if(p<0)x=T-1;else return m}return null}};M.default=N},"./src/utils/buffer-helper.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"BufferHelper",function(){return R});var N=S("./src/utils/logger.ts"),w={length:0,start:function(){return 0},end:function(){return 0}},R=function(){function D(){}return D.isBuffered=function(x,T){try{if(x){for(var m=D.getBuffered(x),p=0;p<m.length;p++)if(T>=m.start(p)&&T<=m.end(p))return!0}}catch(o){}return!1},D.bufferInfo=function(x,T,m){try{if(x){var p=D.getBuffered(x),o=[],a;for(a=0;a<p.length;a++)o.push({start:p.start(a),end:p.end(a)});return this.bufferedInfo(o,T,m)}}catch(n){}return{len:0,start:T,end:T,nextStart:void 0}},D.bufferedInfo=function(x,T,m){T=Math.max(0,T),x.sort(function(h,y){var v=h.start-y.start;return v||y.end-h.end});var p=[];if(m)for(var o=0;o<x.length;o++){var a=p.length;if(a){var n=p[a-1].end;x[o].start-n<m?x[o].end>n&&(p[a-1].end=x[o].end):p.push(x[o])}else p.push(x[o])}else p=x;for(var s=0,i,e=T,t=T,r=0;r<p.length;r++){var E=p[r].start,g=p[r].end;if(T+m>=E&&T<g)e=E,t=g,s=t-T;else if(T+m<E){i=E;break}}return{len:s,start:e||0,end:t||0,nextStart:i}},D.getBuffered=function(x){try{return x.buffered}catch(T){return N.logger.log("failed to get media.buffered",T),w}},D}()},"./src/utils/cea-608-parser.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"Row",function(){return t}),S.d(M,"CaptionScreen",function(){return r});var N=S("./src/utils/logger.ts"),w={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},R=function(u){var d=u;return w.hasOwnProperty(u)&&(d=w[u]),String.fromCharCode(d)},D=15,L=100,x={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},T={17:2,18:4,21:6,22:8,23:10,19:13,20:15},m={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},p={25:2,26:4,29:6,30:8,31:10,27:13,28:15},o=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],a;(function(l){l[l.ERROR=0]="ERROR",l[l.TEXT=1]="TEXT",l[l.WARNING=2]="WARNING",l[l.INFO=2]="INFO",l[l.DEBUG=3]="DEBUG",l[l.DATA=3]="DATA"})(a||(a={}));var n=function(){function l(){this.time=null,this.verboseLevel=a.ERROR}var u=l.prototype;return u.log=function(c,_){this.verboseLevel>=c&&N.logger.log(this.time+" ["+c+"] "+_)},l}(),s=function(u){for(var d=[],c=0;c<u.length;c++)d.push(u[c].toString(16));return d},i=function(){function l(d,c,_,f,b){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=d||"white",this.underline=c||!1,this.italics=_||!1,this.background=f||"black",this.flash=b||!1}var u=l.prototype;return u.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},u.setStyles=function(c){for(var _=["foreground","underline","italics","background","flash"],f=0;f<_.length;f++){var b=_[f];c.hasOwnProperty(b)&&(this[b]=c[b])}},u.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},u.equals=function(c){return this.foreground===c.foreground&&this.underline===c.underline&&this.italics===c.italics&&this.background===c.background&&this.flash===c.flash},u.copy=function(c){this.foreground=c.foreground,this.underline=c.underline,this.italics=c.italics,this.background=c.background,this.flash=c.flash},u.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},l}(),e=function(){function l(d,c,_,f,b,A){this.uchar=void 0,this.penState=void 0,this.uchar=d||" ",this.penState=new i(c,_,f,b,A)}var u=l.prototype;return u.reset=function(){this.uchar=" ",this.penState.reset()},u.setChar=function(c,_){this.uchar=c,this.penState.copy(_)},u.setPenState=function(c){this.penState.copy(c)},u.equals=function(c){return this.uchar===c.uchar&&this.penState.equals(c.penState)},u.copy=function(c){this.uchar=c.uchar,this.penState.copy(c.penState)},u.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},l}(),t=function(){function l(d){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var c=0;c<L;c++)this.chars.push(new e);this.logger=d,this.pos=0,this.currPenState=new i}var u=l.prototype;return u.equals=function(c){for(var _=!0,f=0;f<L;f++)if(!this.chars[f].equals(c.chars[f])){_=!1;break}return _},u.copy=function(c){for(var _=0;_<L;_++)this.chars[_].copy(c.chars[_])},u.isEmpty=function(){for(var c=!0,_=0;_<L;_++)if(!this.chars[_].isEmpty()){c=!1;break}return c},u.setCursor=function(c){this.pos!==c&&(this.pos=c),this.pos<0?(this.logger.log(a.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>L&&(this.logger.log(a.DEBUG,"Too large cursor position "+this.pos),this.pos=L)},u.moveCursor=function(c){var _=this.pos+c;if(c>1)for(var f=this.pos+1;f<_+1;f++)this.chars[f].setPenState(this.currPenState);this.setCursor(_)},u.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},u.insertChar=function(c){c>=144&&this.backSpace();var _=R(c);if(this.pos>=L){this.logger.log(a.ERROR,"Cannot insert "+c.toString(16)+" ("+_+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(_,this.currPenState),this.moveCursor(1)},u.clearFromPos=function(c){var _;for(_=c;_<L;_++)this.chars[_].reset()},u.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},u.clearToEndOfRow=function(){this.clearFromPos(this.pos)},u.getTextString=function(){for(var c=[],_=!0,f=0;f<L;f++){var b=this.chars[f].uchar;b!==" "&&(_=!1),c.push(b)}return _?"":c.join("")},u.setPenStyles=function(c){this.currPenState.setStyles(c);var _=this.chars[this.pos];_.setPenState(this.currPenState)},l}(),r=function(){function l(d){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var c=0;c<D;c++)this.rows.push(new t(d));this.logger=d,this.currRow=D-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var u=l.prototype;return u.reset=function(){for(var c=0;c<D;c++)this.rows[c].clear();this.currRow=D-1},u.equals=function(c){for(var _=!0,f=0;f<D;f++)if(!this.rows[f].equals(c.rows[f])){_=!1;break}return _},u.copy=function(c){for(var _=0;_<D;_++)this.rows[_].copy(c.rows[_])},u.isEmpty=function(){for(var c=!0,_=0;_<D;_++)if(!this.rows[_].isEmpty()){c=!1;break}return c},u.backSpace=function(){var c=this.rows[this.currRow];c.backSpace()},u.clearToEndOfRow=function(){var c=this.rows[this.currRow];c.clearToEndOfRow()},u.insertChar=function(c){var _=this.rows[this.currRow];_.insertChar(c)},u.setPen=function(c){var _=this.rows[this.currRow];_.setPenStyles(c)},u.moveCursor=function(c){var _=this.rows[this.currRow];_.moveCursor(c)},u.setCursor=function(c){this.logger.log(a.INFO,"setCursor: "+c);var _=this.rows[this.currRow];_.setCursor(c)},u.setPAC=function(c){this.logger.log(a.INFO,"pacData = "+JSON.stringify(c));var _=c.row-1;if(this.nrRollUpRows&&_<this.nrRollUpRows-1&&(_=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==_){for(var f=0;f<D;f++)this.rows[f].clear();var b=this.currRow+1-this.nrRollUpRows,A=this.lastOutputScreen;if(A){var O=A.rows[b].cueStartTime,C=this.logger.time;if(O&&C!==null&&O<C)for(var P=0;P<this.nrRollUpRows;P++)this.rows[_-this.nrRollUpRows+P+1].copy(A.rows[b+P])}}this.currRow=_;var k=this.rows[this.currRow];if(c.indent!==null){var I=c.indent,U=Math.max(I-1,0);k.setCursor(c.indent),c.color=k.chars[U].penState.foreground}var H={foreground:c.color,underline:c.underline,italics:c.italics,background:"black",flash:!1};this.setPen(H)},u.setBkgData=function(c){this.logger.log(a.INFO,"bkgData = "+JSON.stringify(c)),this.backSpace(),this.setPen(c),this.insertChar(32)},u.setRollUpRows=function(c){this.nrRollUpRows=c},u.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(a.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(a.TEXT,this.getDisplayText());var c=this.currRow+1-this.nrRollUpRows,_=this.rows.splice(c,1)[0];_.clear(),this.rows.splice(this.currRow,0,_),this.logger.log(a.INFO,"Rolling up")},u.getDisplayText=function(c){c=c||!1;for(var _=[],f="",b=-1,A=0;A<D;A++){var O=this.rows[A].getTextString();O&&(b=A+1,c?_.push("Row "+b+": '"+O+"'"):_.push(O.trim()))}return _.length>0&&(c?f="["+_.join(" | ")+"]":f=_.join(`
|
|
`)),f},u.getTextAndFormat=function(){return this.rows},l}(),E=function(){function l(d,c,_){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=d,this.outputFilter=c,this.mode=null,this.verbose=0,this.displayedMemory=new r(_),this.nonDisplayedMemory=new r(_),this.lastOutputScreen=new r(_),this.currRollUpRow=this.displayedMemory.rows[D-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=_}var u=l.prototype;return u.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[D-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},u.getHandler=function(){return this.outputFilter},u.setHandler=function(c){this.outputFilter=c},u.setPAC=function(c){this.writeScreen.setPAC(c)},u.setBkgData=function(c){this.writeScreen.setBkgData(c)},u.setMode=function(c){if(c===this.mode)return;this.mode=c,this.logger.log(a.INFO,"MODE="+c),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=c},u.insertChars=function(c){for(var _=0;_<c.length;_++)this.writeScreen.insertChar(c[_]);var f=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(a.INFO,f+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(a.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},u.ccRCL=function(){this.logger.log(a.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},u.ccBS=function(){if(this.logger.log(a.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},u.ccAOF=function(){},u.ccAON=function(){},u.ccDER=function(){this.logger.log(a.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},u.ccRU=function(c){this.logger.log(a.INFO,"RU("+c+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(c)},u.ccFON=function(){this.logger.log(a.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},u.ccRDC=function(){this.logger.log(a.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},u.ccTR=function(){this.logger.log(a.INFO,"TR"),this.setMode("MODE_TEXT")},u.ccRTD=function(){this.logger.log(a.INFO,"RTD"),this.setMode("MODE_TEXT")},u.ccEDM=function(){this.logger.log(a.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},u.ccCR=function(){this.logger.log(a.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},u.ccENM=function(){this.logger.log(a.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},u.ccEOC=function(){if(this.logger.log(a.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var c=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=c,this.writeScreen=this.nonDisplayedMemory,this.logger.log(a.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},u.ccTO=function(c){this.logger.log(a.INFO,"TO("+c+") - Tab Offset"),this.writeScreen.moveCursor(c)},u.ccMIDROW=function(c){var _={flash:!1};if(_.underline=c%2===1,_.italics=c>=46,_.italics)_.foreground="white";else{var f=Math.floor(c/2)-16,b=["white","green","blue","cyan","red","yellow","magenta"];_.foreground=b[f]}this.logger.log(a.INFO,"MIDROW: "+JSON.stringify(_)),this.writeScreen.setPen(_)},u.outputDataUpdate=function(c){c===void 0&&(c=!1);var _=this.logger.time;if(_===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=_:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,_,this.lastOutputScreen),c&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:_),this.lastOutputScreen.copy(this.displayedMemory))},u.cueSplitAtTime=function(c){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,c,this.displayedMemory),this.cueStartTime=c))},l}(),g=function(){function l(d,c,_){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var f=new n;this.channels=[null,new E(d,c,f),new E(d+1,_,f)],this.cmdHistory=v(),this.logger=f}var u=l.prototype;return u.getHandler=function(c){return this.channels[c].getHandler()},u.setHandler=function(c,_){this.channels[c].setHandler(_)},u.addData=function(c,_){var f,b,A,O=!1;this.logger.time=c;for(var C=0;C<_.length;C+=2){if(b=_[C]&127,A=_[C+1]&127,b===0&&A===0)continue;if(this.logger.log(a.DATA,"["+s([_[C],_[C+1]])+"] -> ("+s([b,A])+")"),f=this.parseCmd(b,A),f||(f=this.parseMidrow(b,A)),f||(f=this.parsePAC(b,A)),f||(f=this.parseBackgroundAttributes(b,A)),!f&&(O=this.parseChars(b,A),O)){var P=this.currentChannel;if(P&&P>0){var k=this.channels[P];k.insertChars(O)}else this.logger.log(a.WARNING,"No channel found yet. TEXT-MODE?")}!f&&!O&&this.logger.log(a.WARNING,"Couldn't parse cleaned data "+s([b,A])+" orig: "+s([_[C],_[C+1]]))}},u.parseCmd=function(c,_){var f=this.cmdHistory,b=(c===20||c===28||c===21||c===29)&&_>=32&&_<=47,A=(c===23||c===31)&&_>=33&&_<=35;if(!(b||A))return!1;if(y(c,_,f))return h(null,null,f),this.logger.log(a.DEBUG,"Repeated command ("+s([c,_])+") is dropped"),!0;var O=c===20||c===21||c===23?1:2,C=this.channels[O];return c===20||c===21||c===28||c===29?_===32?C.ccRCL():_===33?C.ccBS():_===34?C.ccAOF():_===35?C.ccAON():_===36?C.ccDER():_===37?C.ccRU(2):_===38?C.ccRU(3):_===39?C.ccRU(4):_===40?C.ccFON():_===41?C.ccRDC():_===42?C.ccTR():_===43?C.ccRTD():_===44?C.ccEDM():_===45?C.ccCR():_===46?C.ccENM():_===47&&C.ccEOC():C.ccTO(_-32),h(c,_,f),this.currentChannel=O,!0},u.parseMidrow=function(c,_){var f=0;if((c===17||c===25)&&_>=32&&_<=47){if(c===17?f=1:f=2,f!==this.currentChannel)return this.logger.log(a.ERROR,"Mismatch channel in midrow parsing"),!1;var b=this.channels[f];return b?(b.ccMIDROW(_),this.logger.log(a.DEBUG,"MIDROW ("+s([c,_])+")"),!0):!1}return!1},u.parsePAC=function(c,_){var f,b=this.cmdHistory,A=(c>=17&&c<=23||c>=25&&c<=31)&&_>=64&&_<=127,O=(c===16||c===24)&&_>=64&&_<=95;if(!(A||O))return!1;if(y(c,_,b))return h(null,null,b),!0;var C=c<=23?1:2;_>=64&&_<=95?f=C===1?x[c]:m[c]:f=C===1?T[c]:p[c];var P=this.channels[C];return P?(P.setPAC(this.interpretPAC(f,_)),h(c,_,b),this.currentChannel=C,!0):!1},u.interpretPAC=function(c,_){var f,b={color:null,italics:!1,indent:null,underline:!1,row:c};return _>95?f=_-96:f=_-64,b.underline=(f&1)===1,f<=13?b.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(f/2)]:f<=15?(b.italics=!0,b.color="white"):b.indent=Math.floor((f-16)/2)*4,b},u.parseChars=function(c,_){var f,b=null,A=null;if(c>=25?(f=2,A=c-8):(f=1,A=c),A>=17&&A<=19){var O;A===17?O=_+80:A===18?O=_+112:O=_+144,this.logger.log(a.INFO,"Special char '"+R(O)+"' in channel "+f),b=[O]}else c>=32&&c<=127&&(b=_===0?[c]:[c,_]);if(b){var C=s(b);this.logger.log(a.DEBUG,"Char codes = "+C.join(",")),h(c,_,this.cmdHistory)}return b},u.parseBackgroundAttributes=function(c,_){var f=(c===16||c===24)&&_>=32&&_<=47,b=(c===23||c===31)&&_>=45&&_<=47;if(!(f||b))return!1;var A,O={};c===16||c===24?(A=Math.floor((_-32)/2),O.background=o[A],_%2===1&&(O.background=O.background+"_semi")):_===45?O.background="transparent":(O.foreground="black",_===47&&(O.underline=!0));var C=c<=23?1:2,P=this.channels[C];return P.setBkgData(O),h(c,_,this.cmdHistory),!0},u.reset=function(){for(var c=0;c<Object.keys(this.channels).length;c++){var _=this.channels[c];_&&_.reset()}this.cmdHistory=v()},u.cueSplitAtTime=function(c){for(var _=0;_<this.channels.length;_++){var f=this.channels[_];f&&f.cueSplitAtTime(c)}},l}();function h(l,u,d){d.a=l,d.b=u}function y(l,u,d){return d.a===l&&d.b===u}function v(){return{a:null,b:null}}M.default=g},"./src/utils/codecs.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"isCodecType",function(){return w}),S.d(M,"isCodecSupportedInMp4",function(){return R});var N={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}};function w(D,L){var x=N[L];return!!x&&x[D.slice(0,4)]===!0}function R(D,L){return MediaSource.isTypeSupported((L||"video")+'/mp4;codecs="'+D+'"')}},"./src/utils/cues.ts":function(ae,M,S){"use strict";S.r(M);var N=S("./src/utils/vttparser.ts"),w=S("./src/utils/webvtt-parser.ts"),R=S("./src/utils/texttrack-utils.ts"),D=/\s/,L={newCue:function(T,m,p,o){for(var a=[],n,s,i,e,t,r=self.VTTCue||self.TextTrackCue,E=0;E<o.rows.length;E++)if(n=o.rows[E],i=!0,e=0,t="",!n.isEmpty()){for(var g=0;g<n.chars.length;g++)D.test(n.chars[g].uchar)&&i?e++:(t+=n.chars[g].uchar,i=!1);n.cueStartTime=m,m===p&&(p+=1e-4),e>=16?e--:e++;var h=Object(N.fixLineBreaks)(t.trim()),y=Object(w.generateCueId)(m,p,h);(!T||!T.cues||!T.cues.getCueById(y))&&(s=new r(m,p,h),s.id=y,s.line=E+1,s.align="left",s.position=10+Math.min(80,Math.floor(e*8/32)*10),a.push(s))}return T&&a.length&&(a.sort(function(v,l){return v.line==="auto"||l.line==="auto"?0:v.line>8&&l.line>8?l.line-v.line:v.line-l.line}),a.forEach(function(v){return Object(R.addCueToTrack)(T,v)})),a}};M.default=L},"./src/utils/discontinuities.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"findFirstFragWithCC",function(){return D}),S.d(M,"shouldAlignOnDiscontinuities",function(){return L}),S.d(M,"findDiscontinuousReferenceFrag",function(){return x}),S.d(M,"adjustSlidingStart",function(){return m}),S.d(M,"alignStream",function(){return p}),S.d(M,"alignPDT",function(){return a}),S.d(M,"alignFragmentByPDTDelta",function(){return n}),S.d(M,"alignMediaPlaylistByPDT",function(){return s});var N=S("./src/polyfills/number.ts"),w=S("./src/utils/logger.ts"),R=S("./src/controller/level-helper.ts");function D(i,e){for(var t=null,r=0,E=i.length;r<E;r++){var g=i[r];if(g&&g.cc===e){t=g;break}}return t}function L(i,e,t){return!!(e.details&&(t.endCC>t.startCC||i&&i.cc<t.startCC))}function x(i,e){var t=i.fragments,r=e.fragments;if(!r.length||!t.length){w.logger.log("No fragments to align");return}var E=D(t,r[0].cc);if(!E||E&&!E.startPTS){w.logger.log("No frag in previous level to align on");return}return E}function T(i,e){if(i){var t=i.start+e;i.start=i.startPTS=t,i.endPTS=t+i.duration}}function m(i,e){for(var t=e.fragments,r=0,E=t.length;r<E;r++)T(t[r],i);e.fragmentHint&&T(e.fragmentHint,i),e.alignedSliding=!0}function p(i,e,t){if(!e)return;o(i,t,e),!t.alignedSliding&&e.details&&a(t,e.details),!t.alignedSliding&&e.details&&!t.skippedSegments&&Object(R.adjustSliding)(e.details,t)}function o(i,e,t){if(L(i,t,e)){var r=x(t.details,e);r&&Object(N.isFiniteNumber)(r.start)&&(w.logger.log("Adjusting PTS using last level due to CC increase within current level "+e.url),m(r.start,e))}}function a(i,e){if(!e.fragments.length||!i.hasProgramDateTime||!e.hasProgramDateTime)return;var t=e.fragments[0].programDateTime,r=i.fragments[0].programDateTime,E=(r-t)/1e3+e.fragments[0].start;E&&Object(N.isFiniteNumber)(E)&&(w.logger.log("Adjusting PTS using programDateTime delta "+(r-t)+"ms, sliding:"+E.toFixed(3)+" "+i.url+" "),m(E,i))}function n(i,e){var t=i.programDateTime;if(!t)return;var r=(t-e)/1e3;i.start=i.startPTS=r,i.endPTS=r+i.duration}function s(i,e){if(!e.fragments.length||!i.hasProgramDateTime||!e.hasProgramDateTime)return;var t=e.fragments[0].programDateTime,r=e.fragments[0].start,E=t-r*1e3;i.fragments.forEach(function(g){n(g,E)}),i.fragmentHint&&n(i.fragmentHint,E),i.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(ae,M,S){"use strict";S.r(M);var N=S("./src/utils/ewma.ts"),w=function(){function R(L,x,T){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=T,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new N.default(L),this.fast_=new N.default(x)}var D=R.prototype;return D.update=function(x,T){var m=this.slow_,p=this.fast_;this.slow_.halfLife!==x&&(this.slow_=new N.default(x,m.getEstimate(),m.getTotalWeight())),this.fast_.halfLife!==T&&(this.fast_=new N.default(T,p.getEstimate(),p.getTotalWeight()))},D.sample=function(x,T){x=Math.max(x,this.minDelayMs_);var m=8*T,p=x/1e3,o=m/p;this.fast_.sample(p,o),this.slow_.sample(p,o)},D.canEstimate=function(){var x=this.fast_;return x&&x.getTotalWeight()>=this.minWeight_},D.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},D.destroy=function(){},R}();M.default=w},"./src/utils/ewma.ts":function(ae,M,S){"use strict";S.r(M);var N=function(){function w(D,L,x){L===void 0&&(L=0),x===void 0&&(x=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=D,this.alpha_=D?Math.exp(Math.log(.5)/D):0,this.estimate_=L,this.totalWeight_=x}var R=w.prototype;return R.sample=function(L,x){var T=Math.pow(this.alpha_,L);this.estimate_=x*(1-T)+T*this.estimate_,this.totalWeight_+=L},R.getTotalWeight=function(){return this.totalWeight_},R.getEstimate=function(){if(this.alpha_){var L=1-Math.pow(this.alpha_,this.totalWeight_);if(L)return this.estimate_/L}return this.estimate_},w}();M.default=N},"./src/utils/fetch-loader.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"fetchSupported",function(){return n});var N=S("./src/polyfills/number.ts"),w=S("./src/loader/load-stats.ts"),R=S("./src/demux/chunk-cache.ts");function D(r,E){r.prototype=Object.create(E.prototype),r.prototype.constructor=r,p(r,E)}function L(r){var E=typeof Map=="function"?new Map:void 0;return L=function(h){if(h===null||!m(h))return h;if(typeof h!="function")throw new TypeError("Super expression must either be null or a function");if(typeof E!="undefined"){if(E.has(h))return E.get(h);E.set(h,y)}function y(){return x(h,arguments,o(this).constructor)}return y.prototype=Object.create(h.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),p(y,h)},L(r)}function x(r,E,g){return T()?x=Reflect.construct:x=function(y,v,l){var u=[null];u.push.apply(u,v);var d=Function.bind.apply(y,u),c=new d;return l&&p(c,l.prototype),c},x.apply(null,arguments)}function T(){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(r){return!1}}function m(r){return Function.toString.call(r).indexOf("[native code]")!==-1}function p(r,E){return p=Object.setPrototypeOf||function(h,y){return h.__proto__=y,h},p(r,E)}function o(r){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(g){return g.__proto__||Object.getPrototypeOf(g)},o(r)}function a(){return a=Object.assign||function(r){for(var E=1;E<arguments.length;E++){var g=arguments[E];for(var h in g)Object.prototype.hasOwnProperty.call(g,h)&&(r[h]=g[h])}return r},a.apply(this,arguments)}function n(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(r){}return!1}var s=function(){function r(g){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=void 0,this.response=void 0,this.controller=void 0,this.context=void 0,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=g.fetchSetup||e,this.controller=new self.AbortController,this.stats=new w.LoadStats}var E=r.prototype;return E.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},E.abortInternal=function(){var h=this.response;(!h||!h.ok)&&(this.stats.aborted=!0,this.controller.abort())},E.abort=function(){var h;this.abortInternal(),(h=this.callbacks)!==null&&h!==void 0&&h.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},E.load=function(h,y,v){var l=this,u=this.stats;if(u.loading.start)throw new Error("Loader can only be used once.");u.loading.start=self.performance.now();var d=i(h,this.controller.signal),c=v.onProgress,_=h.responseType==="arraybuffer",f=_?"byteLength":"length";this.context=h,this.config=y,this.callbacks=v,this.request=this.fetchSetup(h,d),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){l.abortInternal(),v.onTimeout(u,h,l.response)},y.timeout),self.fetch(this.request).then(function(b){if(l.response=l.loader=b,!b.ok){var A=b.status,O=b.statusText;throw new t(O||"fetch, bad network response",A,b)}return u.loading.first=Math.max(self.performance.now(),u.loading.start),u.total=parseInt(b.headers.get("Content-Length")||"0"),c&&Object(N.isFiniteNumber)(y.highWaterMark)?l.loadProgressively(b,u,h,y.highWaterMark,c):_?b.arrayBuffer():b.text()}).then(function(b){var A=l.response;self.clearTimeout(l.requestTimeout),u.loading.end=Math.max(self.performance.now(),u.loading.first),u.loaded=u.total=b[f];var O={url:A.url,data:b};c&&!Object(N.isFiniteNumber)(y.highWaterMark)&&c(u,h,b,A),v.onSuccess(O,u,h,A)}).catch(function(b){if(self.clearTimeout(l.requestTimeout),u.aborted)return;var A=b.code||0;v.onError({code:A,text:b.message},h,b.details)})},E.getCacheAge=function(){var h=null;if(this.response){var y=this.response.headers.get("age");h=y?parseFloat(y):null}return h},E.loadProgressively=function(h,y,v,l,u){l===void 0&&(l=0);var d=new R.default,c=h.body.getReader(),_=function f(){return c.read().then(function(b){if(b.done)return d.dataLength&&u(y,v,d.flush(),h),Promise.resolve(new ArrayBuffer(0));var A=b.value,O=A.length;return y.loaded+=O,O<l||d.dataLength?(d.push(A),d.dataLength>=l&&u(y,v,d.flush(),h)):u(y,v,A,h),f()}).catch(function(){return Promise.reject()})};return _()},r}();function i(r,E){var g={method:"GET",mode:"cors",credentials:"same-origin",signal:E,headers:new self.Headers(a({},r.headers))};return r.rangeEnd&&g.headers.set("Range","bytes="+r.rangeStart+"-"+String(r.rangeEnd-1)),g}function e(r,E){return new self.Request(r.url,E)}var t=function(r){D(E,r);function E(g,h,y){var v;return v=r.call(this,g)||this,v.code=void 0,v.details=void 0,v.code=h,v.details=y,v}return E}(L(Error));M.default=s},"./src/utils/imsc1-ttml-parser.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"IMSC1_CODEC",function(){return m}),S.d(M,"parseIMSC1",function(){return n});var N=S("./src/utils/mp4-tools.ts"),w=S("./src/utils/vttparser.ts"),R=S("./src/utils/vttcue.ts"),D=S("./src/demux/id3.ts"),L=S("./src/utils/timescale-conversion.ts"),x=S("./src/utils/webvtt-parser.ts");function T(){return T=Object.assign||function(l){for(var u=1;u<arguments.length;u++){var d=arguments[u];for(var c in d)Object.prototype.hasOwnProperty.call(d,c)&&(l[c]=d[c])}return l},T.apply(this,arguments)}var m="stpp.ttml.im1t",p=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,o=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,a={left:"start",center:"center",right:"end",start:"start",end:"end"};function n(l,u,d,c,_){var f=Object(N.findBox)(new Uint8Array(l),["mdat"]);if(f.length===0){_(new Error("Could not parse IMSC1 mdat"));return}var b=f[0],A=Object(D.utf8ArrayToStr)(new Uint8Array(l,b.start,b.end-b.start)),O=Object(L.toTimescaleFromScale)(u,1,d);try{c(s(A,O))}catch(C){_(C)}}function s(l,u){var d=new DOMParser,c=d.parseFromString(l,"text/xml"),_=c.getElementsByTagName("tt")[0];if(!_)throw new Error("Invalid ttml");var f={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},b=Object.keys(f).reduce(function(k,I){return k[I]=_.getAttribute("ttp:"+I)||f[I],k},{}),A=_.getAttribute("xml:space")!=="preserve",O=e(i(_,"styling","style")),C=e(i(_,"layout","region")),P=i(_,"body","[begin]");return[].map.call(P,function(k){var I=t(k,A);if(!I||!k.hasAttribute("begin"))return null;var U=h(k.getAttribute("begin"),b),H=h(k.getAttribute("dur"),b),Z=h(k.getAttribute("end"),b);if(U===null)throw g(k);if(Z===null){if(H===null)throw g(k);Z=U+H}var $=new R.default(U-u,Z-u,I);$.id=Object(x.generateCueId)($.startTime,$.endTime,$.text);var ee=C[k.getAttribute("region")],te=O[k.getAttribute("style")];$.position=10,$.size=80;var K=r(ee,te),W=K.textAlign;if(W){var X=a[W];X&&($.lineAlign=X),$.align=W}return T($,K),$}).filter(function(k){return k!==null})}function i(l,u,d){var c=l.getElementsByTagName(u)[0];return c?[].slice.call(c.querySelectorAll(d)):[]}function e(l){return l.reduce(function(u,d){var c=d.getAttribute("xml:id");return c&&(u[c]=d),u},{})}function t(l,u){return[].slice.call(l.childNodes).reduce(function(d,c,_){var f;return c.nodeName==="br"&&_?d+`
|
|
`:(f=c.childNodes)!==null&&f!==void 0&&f.length?t(c,u):u?d+c.textContent.trim().replace(/\s+/g," "):d+c.textContent},"")}function r(l,u){var d="http://www.w3.org/ns/ttml#styling",c=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return c.reduce(function(_,f){var b=E(u,d,f)||E(l,d,f);return b&&(_[f]=b),_},{})}function E(l,u,d){return l.hasAttributeNS(u,d)?l.getAttributeNS(u,d):null}function g(l){return new Error("Could not parse ttml timestamp "+l)}function h(l,u){if(!l)return null;var d=Object(w.parseTimeStamp)(l);return d===null&&(p.test(l)?d=y(l,u):o.test(l)&&(d=v(l,u))),d}function y(l,u){var d=p.exec(l),c=(d[4]|0)+(d[5]|0)/u.subFrameRate;return(d[1]|0)*3600+(d[2]|0)*60+(d[3]|0)+c/u.frameRate}function v(l,u){var d=o.exec(l),c=Number(d[1]),_=d[2];switch(_){case"h":return c*3600;case"m":return c*60;case"ms":return c*1e3;case"f":return c/u.frameRate;case"t":return c/u.tickRate}return c}},"./src/utils/logger.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"enableLogs",function(){return x}),S.d(M,"logger",function(){return T});var N=function(){},w={trace:N,debug:N,log:N,warn:N,info:N,error:N},R=w;function D(m){var p=self.console[m];return p?p.bind(self.console,"["+m+"] >"):N}function L(m){for(var p=arguments.length,o=new Array(p>1?p-1:0),a=1;a<p;a++)o[a-1]=arguments[a];o.forEach(function(n){R[n]=m[n]?m[n].bind(m):D(n)})}function x(m){if(self.console&&m===!0||typeof m=="object"){L(m,"debug","log","info","warn","error");try{R.log()}catch(p){R=w}}else R=w}var T=R},"./src/utils/mediakeys-helper.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"KeySystems",function(){return N}),S.d(M,"requestMediaKeySystemAccess",function(){return w});var N;(function(R){R.WIDEVINE="com.widevine.alpha",R.PLAYREADY="com.microsoft.playready"})(N||(N={}));var w=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"getMediaSource",function(){return N});function N(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"bin2str",function(){return L}),S.d(M,"readUint16",function(){return x}),S.d(M,"readUint32",function(){return T}),S.d(M,"writeUint32",function(){return m}),S.d(M,"findBox",function(){return p}),S.d(M,"parseSegmentIndex",function(){return o}),S.d(M,"parseInitSegment",function(){return a}),S.d(M,"getStartDTS",function(){return n}),S.d(M,"getDuration",function(){return s}),S.d(M,"computeRawDurationFromSamples",function(){return i}),S.d(M,"offsetStartDTS",function(){return e}),S.d(M,"segmentValidRange",function(){return t}),S.d(M,"appendUint8Array",function(){return r});var N=S("./src/utils/typed-array.ts"),w=S("./src/loader/fragment.ts"),R=Math.pow(2,32)-1,D=[].push;function L(E){return String.fromCharCode.apply(null,E)}function x(E,g){"data"in E&&(g+=E.start,E=E.data);var h=E[g]<<8|E[g+1];return h<0?65536+h:h}function T(E,g){"data"in E&&(g+=E.start,E=E.data);var h=E[g]<<24|E[g+1]<<16|E[g+2]<<8|E[g+3];return h<0?4294967296+h:h}function m(E,g,h){"data"in E&&(g+=E.start,E=E.data),E[g]=h>>24,E[g+1]=h>>16&255,E[g+2]=h>>8&255,E[g+3]=h&255}function p(E,g){var h=[];if(!g.length)return h;var y,v,l;"data"in E?(y=E.data,v=E.start,l=E.end):(y=E,v=0,l=y.byteLength);for(var u=v;u<l;){var d=T(y,u),c=L(y.subarray(u+4,u+8)),_=d>1?u+d:l;if(c===g[0])if(g.length===1)h.push({data:y,start:u+8,end:_});else{var f=p({data:y,start:u+8,end:_},g.slice(1));f.length&&D.apply(h,f)}u=_}return h}function o(E){var g=p(E,["moov"]),h=g[0],y=h?h.end:null,v=p(E,["sidx"]);if(!v||!v[0])return null;var l=[],u=v[0],d=u.data[0],c=d===0?8:16,_=T(u,c);c+=4;var f=0,b=0;d===0?c+=8:c+=16,c+=2;var A=u.end+b,O=x(u,c);c+=2;for(var C=0;C<O;C++){var P=c,k=T(u,P);P+=4;var I=k&2147483647,U=(k&2147483648)>>>31;if(U===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var H=T(u,P);P+=4,l.push({referenceSize:I,subsegmentDuration:H,info:{duration:H/_,start:A,end:A+I-1}}),A+=I,P+=4,c=P}return{earliestPresentationTime:f,timescale:_,version:d,referencesCount:O,references:l,moovEndOffset:y}}function a(E){for(var g=[],h=p(E,["moov","trak"]),y=0;y<h.length;y++){var v=h[y],l=p(v,["tkhd"])[0];if(l){var u=l.data[l.start],d=u===0?12:20,c=T(l,d),_=p(v,["mdia","mdhd"])[0];if(_){u=_.data[_.start],d=u===0?12:20;var f=T(_,d),b=p(v,["mdia","hdlr"])[0];if(b){var A=L(b.data.subarray(b.start+8,b.start+12)),O={soun:w.ElementaryStreamTypes.AUDIO,vide:w.ElementaryStreamTypes.VIDEO}[A];if(O){var C=p(v,["mdia","minf","stbl","stsd"])[0],P=void 0;C&&(P=L(C.data.subarray(C.start+12,C.start+16))),g[c]={timescale:f,type:O},g[O]={timescale:f,id:c,codec:P}}}}}}var k=p(E,["moov","mvex","trex"]);return k.forEach(function(I){var U=T(I,4),H=g[U];H&&(H.default={duration:T(I,12),flags:T(I,20)})}),g}function n(E,g){return p(g,["moof","traf"]).reduce(function(h,y){var v=p(y,["tfdt"])[0],l=v.data[v.start],u=p(y,["tfhd"]).reduce(function(d,c){var _=T(c,4),f=E[_];if(f){var b=T(v,4);l===1&&(b*=Math.pow(2,32),b+=T(v,8));var A=f.timescale||9e4,O=b/A;if(isFinite(O)&&(d===null||O<d))return O}return d},null);return u!==null&&isFinite(u)&&(h===null||u<h)?u:h},null)||0}function s(E,g){for(var h=0,y=0,v=0,l=p(E,["moof","traf"]),u=0;u<l.length;u++){var d=l[u],c=p(d,["tfhd"])[0],_=T(c,4),f=g[_];if(!f)continue;var b=f.default,A=T(c,0)|(b==null?void 0:b.flags),O=b==null?void 0:b.duration;A&8&&(A&2?O=T(c,12):O=T(c,8));for(var C=f.timescale||9e4,P=p(d,["trun"]),k=0;k<P.length;k++){if(O){var I=T(P[k],4);h=O*I}else h=i(P[k]);f.type===w.ElementaryStreamTypes.VIDEO?y+=h/C:f.type===w.ElementaryStreamTypes.AUDIO&&(v+=h/C)}}if(y===0&&v===0){var U=o(E);if(U!=null&&U.references)return U.references.reduce(function(H,Z){return H+Z.info.duration||0},0)}return y||v}function i(E){var g=T(E,0),h=8;g&1&&(h+=4),g&4&&(h+=4);for(var y=0,v=T(E,4),l=0;l<v;l++){if(g&256){var u=T(E,h);y+=u,h+=4}g&512&&(h+=4),g&1024&&(h+=4),g&2048&&(h+=4)}return y}function e(E,g,h){p(g,["moof","traf"]).forEach(function(y){p(y,["tfhd"]).forEach(function(v){var l=T(v,4),u=E[l];if(!u)return;var d=u.timescale||9e4;p(y,["tfdt"]).forEach(function(c){var _=c.data[c.start],f=T(c,4);if(_===0)m(c,4,f-h*d);else{f*=Math.pow(2,32),f+=T(c,8),f-=h*d,f=Math.max(f,0);var b=Math.floor(f/(R+1)),A=Math.floor(f%(R+1));m(c,4,b),m(c,8,A)}})})})}function t(E){var g={valid:null,remainder:null},h=p(E,["moof"]);if(h){if(h.length<2)return g.remainder=E,g}else return g;var y=h[h.length-1];return g.valid=Object(N.sliceUint8)(E,0,y.start-8),g.remainder=Object(N.sliceUint8)(E,y.start-8),g}function r(E,g){var h=new Uint8Array(E.length+g.length);return h.set(E),h.set(g,E.length),h}},"./src/utils/output-filter.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"default",function(){return N});var N=function(){function w(D,L){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=D,this.trackName=L}var R=w.prototype;return R.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},R.newCue=function(L,x,T){(this.startTime===null||this.startTime>L)&&(this.startTime=L),this.endTime=x,this.screen=T,this.timelineController.createCaptionsTrack(this.trackName)},R.reset=function(){this.cueRanges=[]},w}()},"./src/utils/texttrack-utils.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"sendAddTrackEvent",function(){return w}),S.d(M,"addCueToTrack",function(){return R}),S.d(M,"clearCurrentCues",function(){return D}),S.d(M,"removeCuesInRange",function(){return L}),S.d(M,"getCuesInRange",function(){return T});var N=S("./src/utils/logger.ts");function w(m,p){var o;try{o=new Event("addtrack")}catch(a){o=document.createEvent("Event"),o.initEvent("addtrack",!1,!1)}o.track=m,p.dispatchEvent(o)}function R(m,p){var o=m.mode;if(o==="disabled"&&(m.mode="hidden"),m.cues&&!m.cues.getCueById(p.id))try{if(m.addCue(p),!m.cues.getCueById(p.id))throw new Error("addCue is failed for: "+p)}catch(n){N.logger.debug("[texttrack-utils]: "+n);var a=new self.TextTrackCue(p.startTime,p.endTime,p.text);a.id=p.id,m.addCue(a)}o==="disabled"&&(m.mode=o)}function D(m){var p=m.mode;if(p==="disabled"&&(m.mode="hidden"),m.cues)for(var o=m.cues.length;o--;)m.removeCue(m.cues[o]);p==="disabled"&&(m.mode=p)}function L(m,p,o){var a=m.mode;if(a==="disabled"&&(m.mode="hidden"),m.cues&&m.cues.length>0)for(var n=T(m.cues,p,o),s=0;s<n.length;s++)m.removeCue(n[s]);a==="disabled"&&(m.mode=a)}function x(m,p){if(p<m[0].startTime)return 0;var o=m.length-1;if(p>m[o].endTime)return-1;for(var a=0,n=o;a<=n;){var s=Math.floor((n+a)/2);if(p<m[s].startTime)n=s-1;else if(p>m[s].startTime&&a<o)a=s+1;else return s}return m[a].startTime-p<p-m[n].startTime?a:n}function T(m,p,o){var a=[],n=x(m,p);if(n>-1)for(var s=n,i=m.length;s<i;s++){var e=m[s];if(e.startTime>=p&&e.endTime<=o)a.push(e);else if(e.startTime>o)return a}return a}},"./src/utils/time-ranges.ts":function(ae,M,S){"use strict";S.r(M);var N={toString:function(R){for(var D="",L=R.length,x=0;x<L;x++)D+="["+R.start(x).toFixed(3)+","+R.end(x).toFixed(3)+"]";return D}};M.default=N},"./src/utils/timescale-conversion.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"toTimescaleFromBase",function(){return w}),S.d(M,"toTimescaleFromScale",function(){return R}),S.d(M,"toMsFromMpegTsClock",function(){return D}),S.d(M,"toMpegTsClockFromTimescale",function(){return L});var N=9e4;function w(x,T,m,p){m===void 0&&(m=1),p===void 0&&(p=!1);var o=x*T*m;return p?Math.round(o):o}function R(x,T,m,p){return m===void 0&&(m=1),p===void 0&&(p=!1),w(x,T,1/m,p)}function D(x,T){return T===void 0&&(T=!1),w(x,1e3,1/N,T)}function L(x,T){return T===void 0&&(T=1),w(x,N,1/T)}},"./src/utils/typed-array.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"sliceUint8",function(){return N});function N(w,R,D){return Uint8Array.prototype.slice?w.slice(R,D):new Uint8Array(Array.prototype.slice.call(w,R,D))}},"./src/utils/vttcue.ts":function(ae,M,S){"use strict";S.r(M),M.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var N=["","lr","rl"],w=["start","middle","end","left","right"];function R(m,p){if(typeof p!="string")return!1;if(!Array.isArray(m))return!1;var o=p.toLowerCase();return~m.indexOf(o)?o:!1}function D(m){return R(N,m)}function L(m){return R(w,m)}function x(m){for(var p=arguments.length,o=new Array(p>1?p-1:0),a=1;a<p;a++)o[a-1]=arguments[a];for(var n=1;n<arguments.length;n++){var s=arguments[n];for(var i in s)m[i]=s[i]}return m}function T(m,p,o){var a=this,n={enumerable:!0};a.hasBeenReset=!1;var s="",i=!1,e=m,t=p,r=o,E=null,g="",h=!0,y="auto",v="start",l=50,u="middle",d=50,c="middle";Object.defineProperty(a,"id",x({},n,{get:function(){return s},set:function(f){s=""+f}})),Object.defineProperty(a,"pauseOnExit",x({},n,{get:function(){return i},set:function(f){i=!!f}})),Object.defineProperty(a,"startTime",x({},n,{get:function(){return e},set:function(f){if(typeof f!="number")throw new TypeError("Start time must be set to a number.");e=f,this.hasBeenReset=!0}})),Object.defineProperty(a,"endTime",x({},n,{get:function(){return t},set:function(f){if(typeof f!="number")throw new TypeError("End time must be set to a number.");t=f,this.hasBeenReset=!0}})),Object.defineProperty(a,"text",x({},n,{get:function(){return r},set:function(f){r=""+f,this.hasBeenReset=!0}})),Object.defineProperty(a,"region",x({},n,{get:function(){return E},set:function(f){E=f,this.hasBeenReset=!0}})),Object.defineProperty(a,"vertical",x({},n,{get:function(){return g},set:function(f){var b=D(f);if(b===!1)throw new SyntaxError("An invalid or illegal string was specified.");g=b,this.hasBeenReset=!0}})),Object.defineProperty(a,"snapToLines",x({},n,{get:function(){return h},set:function(f){h=!!f,this.hasBeenReset=!0}})),Object.defineProperty(a,"line",x({},n,{get:function(){return y},set:function(f){if(typeof f!="number"&&f!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");y=f,this.hasBeenReset=!0}})),Object.defineProperty(a,"lineAlign",x({},n,{get:function(){return v},set:function(f){var b=L(f);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");v=b,this.hasBeenReset=!0}})),Object.defineProperty(a,"position",x({},n,{get:function(){return l},set:function(f){if(f<0||f>100)throw new Error("Position must be between 0 and 100.");l=f,this.hasBeenReset=!0}})),Object.defineProperty(a,"positionAlign",x({},n,{get:function(){return u},set:function(f){var b=L(f);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");u=b,this.hasBeenReset=!0}})),Object.defineProperty(a,"size",x({},n,{get:function(){return d},set:function(f){if(f<0||f>100)throw new Error("Size must be between 0 and 100.");d=f,this.hasBeenReset=!0}})),Object.defineProperty(a,"align",x({},n,{get:function(){return c},set:function(f){var b=L(f);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");c=b,this.hasBeenReset=!0}})),a.displayState=void 0}return T.prototype.getCueAsHTML=function(){var m=self.WebVTT;return m.convertCueToDOMTree(self,this.text)},T}()},"./src/utils/vttparser.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"parseTimeStamp",function(){return R}),S.d(M,"fixLineBreaks",function(){return p}),S.d(M,"VTTParser",function(){return o});var N=S("./src/utils/vttcue.ts"),w=function(){function a(){}var n=a.prototype;return n.decode=function(i,e){if(!i)return"";if(typeof i!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(i))},a}();function R(a){function n(i,e,t,r){return(i|0)*3600+(e|0)*60+(t|0)+parseFloat(r||0)}var s=a.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return s?parseFloat(s[2])>59?n(s[2],s[3],0,s[4]):n(s[1],s[2],s[3],s[4]):null}var D=function(){function a(){this.values=Object.create(null)}var n=a.prototype;return n.set=function(i,e){!this.get(i)&&e!==""&&(this.values[i]=e)},n.get=function(i,e,t){return t?this.has(i)?this.values[i]:e[t]:this.has(i)?this.values[i]:e},n.has=function(i){return i in this.values},n.alt=function(i,e,t){for(var r=0;r<t.length;++r)if(e===t[r]){this.set(i,e);break}},n.integer=function(i,e){/^-?\d+$/.test(e)&&this.set(i,parseInt(e,10))},n.percent=function(i,e){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(e)){var t=parseFloat(e);if(t>=0&&t<=100)return this.set(i,t),!0}return!1},a}();function L(a,n,s,i){var e=i?a.split(i):[a];for(var t in e){if(typeof e[t]!="string")continue;var r=e[t].split(s);if(r.length!==2)continue;var E=r[0],g=r[1];n(E,g)}}var x=new N.default(0,0,""),T=x.align==="middle"?"middle":"center";function m(a,n,s){var i=a;function e(){var E=R(a);if(E===null)throw new Error("Malformed timestamp: "+i);return a=a.replace(/^[^\sa-zA-Z-]+/,""),E}function t(E,g){var h=new D;L(E,function(l,u){var d;switch(l){case"region":for(var c=s.length-1;c>=0;c--)if(s[c].id===u){h.set(l,s[c].region);break}break;case"vertical":h.alt(l,u,["rl","lr"]);break;case"line":d=u.split(","),h.integer(l,d[0]),h.percent(l,d[0])&&h.set("snapToLines",!1),h.alt(l,d[0],["auto"]),d.length===2&&h.alt("lineAlign",d[1],["start",T,"end"]);break;case"position":d=u.split(","),h.percent(l,d[0]),d.length===2&&h.alt("positionAlign",d[1],["start",T,"end","line-left","line-right","auto"]);break;case"size":h.percent(l,u);break;case"align":h.alt(l,u,["start",T,"end","left","right"]);break}},/:/,/\s/),g.region=h.get("region",null),g.vertical=h.get("vertical","");var y=h.get("line","auto");y==="auto"&&x.line===-1&&(y=-1),g.line=y,g.lineAlign=h.get("lineAlign","start"),g.snapToLines=h.get("snapToLines",!0),g.size=h.get("size",100),g.align=h.get("align",T);var v=h.get("position","auto");v==="auto"&&x.position===50&&(v=g.align==="start"||g.align==="left"?0:g.align==="end"||g.align==="right"?100:50),g.position=v}function r(){a=a.replace(/^\s+/,"")}if(r(),n.startTime=e(),r(),a.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+i);a=a.substr(3),r(),n.endTime=e(),r(),t(a,n)}function p(a){return a.replace(/<br(?: \/)?>/gi,`
|
|
`)}var o=function(){function a(){this.state="INITIAL",this.buffer="",this.decoder=new w,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var n=a.prototype;return n.parse=function(i){var e=this;i&&(e.buffer+=e.decoder.decode(i,{stream:!0}));function t(){var v=e.buffer,l=0;for(v=p(v);l<v.length&&v[l]!=="\r"&&v[l]!==`
|
|
`;)++l;var u=v.substr(0,l);return v[l]==="\r"&&++l,v[l]===`
|
|
`&&++l,e.buffer=v.substr(l),u}function r(v){L(v,function(l,u){},/:/)}try{var E="";if(e.state==="INITIAL"){if(!/\r\n|\n/.test(e.buffer))return this;E=t();var g=E.match(/^()?WEBVTT([ \t].*)?$/);if(!g||!g[0])throw new Error("Malformed WebVTT signature.");e.state="HEADER"}for(var h=!1;e.buffer;){if(!/\r\n|\n/.test(e.buffer))return this;h?h=!1:E=t();switch(e.state){case"HEADER":/:/.test(E)?r(E):E||(e.state="ID");continue;case"NOTE":E||(e.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(E)){e.state="NOTE";break}if(!E)continue;if(e.cue=new N.default(0,0,""),e.state="CUE",E.indexOf("-->")===-1){e.cue.id=E;continue}case"CUE":if(!e.cue){e.state="BADCUE";continue}try{m(E,e.cue,e.regionList)}catch(v){e.cue=null,e.state="BADCUE";continue}e.state="CUETEXT";continue;case"CUETEXT":{var y=E.indexOf("-->")!==-1;if(!E||y&&(h=!0)){e.oncue&&e.cue&&e.oncue(e.cue),e.cue=null,e.state="ID";continue}if(e.cue===null)continue;e.cue.text&&(e.cue.text+=`
|
|
`),e.cue.text+=E}continue;case"BADCUE":E||(e.state="ID")}}}catch(v){e.state==="CUETEXT"&&e.cue&&e.oncue&&e.oncue(e.cue),e.cue=null,e.state=e.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},n.flush=function(){var i=this;try{if((i.cue||i.state==="HEADER")&&(i.buffer+=`
|
|
|
|
`,i.parse()),i.state==="INITIAL"||i.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(e){i.onparsingerror&&i.onparsingerror(e)}return i.onflush&&i.onflush(),this},a}()},"./src/utils/webvtt-parser.ts":function(ae,M,S){"use strict";S.r(M),S.d(M,"generateCueId",function(){return o}),S.d(M,"parseWebVTT",function(){return n});var N=S("./src/polyfills/number.ts"),w=S("./src/utils/vttparser.ts"),R=S("./src/demux/id3.ts"),D=S("./src/utils/timescale-conversion.ts"),L=S("./src/remux/mp4-remuxer.ts"),x=/\r\n|\n\r|\n|\r/g,T=function(i,e,t){return t===void 0&&(t=0),i.substr(t,e.length)===e},m=function(i){var e=parseInt(i.substr(-3)),t=parseInt(i.substr(-6,2)),r=parseInt(i.substr(-9,2)),E=i.length>9?parseInt(i.substr(0,i.indexOf(":"))):0;if(!Object(N.isFiniteNumber)(e)||!Object(N.isFiniteNumber)(t)||!Object(N.isFiniteNumber)(r)||!Object(N.isFiniteNumber)(E))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+i);return e+=1e3*t,e+=60*1e3*r,e+=60*60*1e3*E,e},p=function(i){for(var e=5381,t=i.length;t;)e=e*33^i.charCodeAt(--t);return(e>>>0).toString()};function o(s,i,e){return p(s.toString())+p(i.toString())+p(e)}var a=function(i,e,t){var r=i[e],E=i[r.prevCC];if(!E||!E.new&&r.new){i.ccOffset=i.presentationOffset=r.start,r.new=!1;return}for(;(g=E)!==null&&g!==void 0&&g.new;){var g;i.ccOffset+=r.start-E.start,r.new=!1,r=E,E=i[r.prevCC]}i.presentationOffset=t};function n(s,i,e,t,r,E,g,h){var y=new w.VTTParser,v=Object(R.utf8ArrayToStr)(new Uint8Array(s)).trim().replace(x,`
|
|
`).split(`
|
|
`),l=[],u=Object(D.toMpegTsClockFromTimescale)(i,e),d="00:00.000",c=0,_=0,f,b=!0,A=!1;y.oncue=function(O){var C=t[r],P=t.ccOffset,k=(c-u)/9e4;if(C!=null&&C.new&&(_!==void 0?P=t.ccOffset=C.start:a(t,r,k)),k&&(P=k-t.presentationOffset),A){var I=O.endTime-O.startTime,U=Object(L.normalizePts)((O.startTime+P-_)*9e4,E*9e4)/9e4;O.startTime=U,O.endTime=U+I}var H=O.text.trim();O.text=decodeURIComponent(encodeURIComponent(H)),O.id||(O.id=o(O.startTime,O.endTime,H)),O.endTime>0&&l.push(O)},y.onparsingerror=function(O){f=O},y.onflush=function(){if(f){h(f);return}g(l)},v.forEach(function(O){if(b)if(T(O,"X-TIMESTAMP-MAP=")){b=!1,A=!0,O.substr(16).split(",").forEach(function(C){T(C,"LOCAL:")?d=C.substr(6):T(C,"MPEGTS:")&&(c=parseInt(C.substr(7)))});try{_=m(d)/1e3}catch(C){A=!1,f=C}return}else O===""&&(b=!1);y.parse(O+`
|
|
`)}),y.flush()}},"./src/utils/xhr-loader.ts":function(ae,M,S){"use strict";S.r(M);var N=S("./src/utils/logger.ts"),w=S("./src/loader/load-stats.ts"),R=/^age:\s*[\d.]+\s*$/m,D=function(){function L(T){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=T?T.xhrSetup:null,this.stats=new w.LoadStats,this.retryDelay=0}var x=L.prototype;return x.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},x.abortInternal=function(){var m=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),m&&(m.onreadystatechange=null,m.onprogress=null,m.readyState!==4&&(this.stats.aborted=!0,m.abort()))},x.abort=function(){var m;this.abortInternal(),(m=this.callbacks)!==null&&m!==void 0&&m.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},x.load=function(m,p,o){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=m,this.config=p,this.callbacks=o,this.retryDelay=p.retryDelay,this.loadInternal()},x.loadInternal=function(){var m=this.config,p=this.context;if(!m)return;var o=this.loader=new self.XMLHttpRequest,a=this.stats;a.loading.first=0,a.loaded=0;var n=this.xhrSetup;try{if(n)try{n(o,p.url)}catch(e){o.open("GET",p.url,!0),n(o,p.url)}o.readyState||o.open("GET",p.url,!0);var s=this.context.headers;if(s)for(var i in s)o.setRequestHeader(i,s[i])}catch(e){this.callbacks.onError({code:o.status,text:e.message},p,o);return}p.rangeEnd&&o.setRequestHeader("Range","bytes="+p.rangeStart+"-"+(p.rangeEnd-1)),o.onreadystatechange=this.readystatechange.bind(this),o.onprogress=this.loadprogress.bind(this),o.responseType=p.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),m.timeout),o.send()},x.readystatechange=function(){var m=this.context,p=this.loader,o=this.stats;if(!m||!p)return;var a=p.readyState,n=this.config;if(o.aborted)return;if(a>=2)if(self.clearTimeout(this.requestTimeout),o.loading.first===0&&(o.loading.first=Math.max(self.performance.now(),o.loading.start)),a===4){p.onreadystatechange=null,p.onprogress=null;var s=p.status;if(s>=200&&s<300){o.loading.end=Math.max(self.performance.now(),o.loading.first);var i,e;if(m.responseType==="arraybuffer"?(i=p.response,e=i.byteLength):(i=p.responseText,e=i.length),o.loaded=o.total=e,!this.callbacks)return;var t=this.callbacks.onProgress;if(t&&t(o,m,i,p),!this.callbacks)return;var r={url:p.responseURL,data:i};this.callbacks.onSuccess(r,o,m,p)}else o.retry>=n.maxRetry||s>=400&&s<499?(N.logger.error(s+" while loading "+m.url),this.callbacks.onError({code:s,text:p.statusText},m,p)):(N.logger.warn(s+" while loading "+m.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,n.maxRetryDelay),o.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),n.timeout)},x.loadtimeout=function(){N.logger.warn("timeout while loading "+this.context.url);var m=this.callbacks;m&&(this.abortInternal(),m.onTimeout(this.stats,this.context,this.loader))},x.loadprogress=function(m){var p=this.stats;p.loaded=m.loaded,m.lengthComputable&&(p.total=m.total)},x.getCacheAge=function(){var m=null;if(this.loader&&R.test(this.loader.getAllResponseHeaders())){var p=this.loader.getResponseHeader("age");m=p?parseFloat(p):null}return m},L}();M.default=D}}).default})},vHTk:function(Be,Le,Y){Be.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}}}]);
|