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.
NewEduCoderBuild/p__RestFul.8bafae89.async.js

403 lines
943 KiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[217,5,7],{"+ua5":function(Qe,le,W){},"/cxE":function(Qe,le,W){"use strict";W.d(le,"f",function(){return C}),W.d(le,"g",function(){return j}),W.d(le,"h",function(){return L}),W.d(le,"e",function(){return B}),W.d(le,"b",function(){return k}),W.d(le,"c",function(){return e}),W.d(le,"d",function(){return A}),W.d(le,"a",function(){return g});class te{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(c){setTimeout(()=>{throw c.stack?new Error(c.message+`
`+c.stack):c},0)}}emit(c){this.listeners.forEach(l=>{l(c)})}onUnexpectedError(c){this.unexpectedErrorHandler(c),this.emit(c)}onUnexpectedExternalError(c){this.unexpectedErrorHandler(c)}}const H=new te;function C(c){B(c)||H.onUnexpectedError(c);return}function j(c){B(c)||H.onUnexpectedExternalError(c);return}function L(c){if(c instanceof Error){let{name:l,message:n}=c;const a=c.stacktrace||c.stack;return{$isError:!0,name:l,message:n,stack:a}}return c}const R="Canceled";function B(c){return c instanceof Error&&c.name===R&&c.message===R}function k(){const c=new Error(R);return c.name=c.message,c}function e(c){return c?new Error(`Illegal argument: ${c}`):new Error("Illegal argument")}function A(c){return c?new Error(`Illegal state: ${c}`):new Error("Illegal state")}class g extends Error{constructor(c){super("NotSupported");c&&(this.message=c)}}},"24hK":function(Qe,le,W){"use strict";W.d(le,"a",function(){return H});class te{constructor(C){this.element=C,this.next=te.Undefined,this.prev=te.Undefined}}te.Undefined=new te(void 0);class H{constructor(){this._first=te.Undefined,this._last=te.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===te.Undefined}clear(){let C=this._first;for(;C!==te.Undefined;){const j=C.next;C.prev=te.Undefined,C.next=te.Undefined,C=j}this._first=te.Undefined,this._last=te.Undefined,this._size=0}unshift(C){return this._insert(C,!1)}push(C){return this._insert(C,!0)}_insert(C,j){const L=new te(C);if(this._first===te.Undefined)this._first=L,this._last=L;else if(j){const B=this._last;this._last=L,L.prev=B,B.next=L}else{const B=this._first;this._first=L,L.next=B,B.prev=L}this._size+=1;let R=!1;return()=>{R||(R=!0,this._remove(L))}}shift(){if(this._first===te.Undefined)return;{const C=this._first.element;return this._remove(this._first),C}}pop(){if(this._last===te.Undefined)return;{const C=this._last.element;return this._remove(this._last),C}}_remove(C){if(C.prev!==te.Undefined&&C.next!==te.Undefined){const j=C.prev;j.next=C.next,C.next.prev=j}else C.prev===te.Undefined&&C.next===te.Undefined?(this._first=te.Undefined,this._last=te.Undefined):C.next===te.Undefined?(this._last=this._last.prev,this._last.next=te.Undefined):C.prev===te.Undefined&&(this._first=this._first.next,this._first.prev=te.Undefined);this._size-=1}*[Symbol.iterator](){let C=this._first;for(;C!==te.Undefined;)yield C.element,C=C.next}}},"3/fG":function(Qe,le,W){"use strict";W.d(le,"a",function(){return H});function te(C,j){let L;return j.length===0?L=C:L=C.replace(/\{(\d+)\}/g,function(R,B){const k=B[0];return typeof j[k]!="undefined"?j[k]:R}),L}function H(C,j,...L){return te(j,L)}},"55Ip":function(Qe,le,W){"use strict";W.d(le,"a",function(){return i});var te=W("Ty5D"),H=W("dI71"),C=W("q1tI"),j=W.n(C),L=W("YS25"),R=W("17x9"),B=W.n(R),k=W("wx14"),e=W("zLVn"),A=W("9R94"),g=function(u){Object(H.a)(d,u);function d(){for(var T,b=arguments.length,S=new Array(b),D=0;D<b;D++)S[D]=arguments[D];return T=u.call.apply(u,[this].concat(S))||this,T.history=Object(L.a)(T.props),T}var f=d.prototype;return f.render=function(){return j.a.createElement(te.c,{history:this.history,children:this.props.children})},d}(j.a.Component),c=function(u){Object(H.a)(d,u);function d(){for(var T,b=arguments.length,S=new Array(b),D=0;D<b;D++)S[D]=arguments[D];return T=u.call.apply(u,[this].concat(S))||this,T.history=Object(L.b)(T.props),T}var f=d.prototype;return f.render=function(){return j.a.createElement(te.c,{history:this.history,children:this.props.children})},d}(j.a.Component),l=function(d,f){return typeof d=="function"?d(f):d},n=function(d,f){return typeof d=="string"?Object(L.c)(d,null,null,f):d},a=function(d){return d},o=j.a.forwardRef;typeof o=="undefined"&&(o=a);function s(u){return!!(u.metaKey||u.altKey||u.ctrlKey||u.shiftKey)}var r=o(function(u,d){var f=u.innerRef,T=u.navigate,b=u.onClick,S=Object(e.a)(u,["innerRef","navigate","onClick"]),D=S.target,I=Object(k.a)({},S,{onClick:function(P){try{b&&b(P)}catch(U){throw P.preventDefault(),U}!P.defaultPrevented&&P.button===0&&(!D||D==="_self")&&!s(P)&&(P.preventDefault(),T())}});return a!==o?I.ref=d||f:I.ref=f,j.a.createElement("a",I)}),i=o(function(u,d){var f=u.component,T=f===void 0?r:f,b=u.replace,S=u.to,D=u.innerRef,I=Object(e.a)(u,["component","replace","to","innerRef"]);return j.a.createElement(te.e.Consumer,null,function(w){w||Object(A.a)(!1);var P=w.history,U=n(l(S,w.location),w.location),O=U?P.createHref(U):"",G=Object(k.a)({},I,{href:O,navigate:function(){var ae=l(S,w.location),ie=b?P.replace:P.push;ie(ae)}});return a!==o?G.ref=d||D:G.innerRef=D,j.a.createElement(T,G)})});if(!1)var t,y;var p=function(d){return d},m=j.a.forwardRef;typeof m=="undefined"&&(m=p);function E(){for(var u=arguments.length,d=new Array(u),f=0;f<u;f++)d[f]=arguments[f];return d.filter(function(T){return T}).join(" ")}var _=m(function(u,d){var f=u["aria-current"],T=f===void 0?"page":f,b=u.activeClassName,S=b===void 0?"active":b,D=u.activeStyle,I=u.className,w=u.exact,P=u.isActive,U=u.location,O=u.sensitive,G=u.strict,z=u.style,ae=u.to,ie=u.innerRef,fe=Object(e.a)(u,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return j.a.createElement(te.e.Consumer,null,function(ce){ce||Object(A.a)(!1);var J=U||ce.location,Z=n(l(ae,J),J),ue=Z.pathname,X=ue&&ue.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),$=X?Object(te.f)(J.pathname,{path:X,exact:w,sensitive:O,strict:G}):null,be=!!(P?P($,J):$),Re=be?E(I,S):I,Ie=be?Object(k.a)({},z,{},D):z,Le=Object(k.a)({"aria-current":be&&T||null,className:Re,style:Ie,to:Z},fe);return p!==m?Le.ref=d||ie:Le.innerRef=ie,j.a.createElement(i,Le)})});if(!1)var h},"5VLF":function(Qe,le,W){"use strict";var te,H;function C(j,L,R){var B=function(k,e){return j.js_beautify(k,e)};return B.js=j.js_beautify,B.css=L.css_beautify,B.html=R.html_beautify,B.js_beautify=j.js_beautify,B.css_beautify=L.css_beautify,B.html_beautify=R.html_beautify,B}!(te=[W("6UM0"),W("TXwP"),W("psGv")],H=function(j,L,R){return C(j,L,R)}.apply(le,te),H!==void 0&&(Qe.exports=H))},"5Y4S":function(Qe,le,W){"use strict";W.d(le,"a",function(){return C});var te=W("MNsG");const H=te.b.performance&&typeof te.b.performance.now=="function";class C{constructor(j){this._highResolution=H&&j,this._startTime=this._now(),this._stopTime=-1}static create(j=!0){return new C(j)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?te.b.performance.now():Date.now()}}},"6UM0":function(Qe,le,W){var te,H;(function(){var C;(function(){"use strict";var L=[function(e,A,g){var c=g(1).Beautifier,l=g(5).Options;function n(a,o){var s=new c(a,o);return s.beautify()}e.exports=n,e.exports.defaultOptions=function(){return new l}},function(e,A,g){var c=g(2).Output,l=g(3).Token,n=g(4),a=g(5).Options,o=g(7).Tokenizer,s=g(7).line_starters,r=g(7).positionable_operators,i=g(7).TOKEN;function t(O,G){return G.indexOf(O)!==-1}function y(O){return O.replace(/^\s+/g,"")}function p(O){for(var G={},z=0;z<O.length;z++)G[O[z].replace(/-/g,"_")]=O[z];return G}function m(O,G){return O&&O.type===i.RESERVED&&O.text===G}function E(O,G){return O&&O.type===i.RESERVED&&t(O.text,G)}var _=["case","return","do","if","throw","else","await","break","continue","async"],h=["before-newline","after-newline","preserve-newline"],u=p(h),d=[u.before_newline,u.preserve_newline],f={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function T(O,G){if(G.multiline_frame||G.mode===f.ForInitializer||G.mode===f.Conditional)return;O.remove_indent(G.start_line_index)}function b(O){O=O.replace(n.allLineBreaks,`
`);for(var G=[],z=O.indexOf(`
`);z!==-1;)G.push(O.substring(0,z)),O=O.substring(z+1),z=O.indexOf(`
`);return O.length&&G.push(O),G}function S(O){return O===f.ArrayLiteral}function D(O){return t(O,[f.Expression,f.ForInitializer,f.Conditional])}function I(O,G){for(var z=0;z<O.length;z++){var ae=O[z].trim();if(ae.charAt(0)!==G)return!1}return!0}function w(O,G){for(var z=0,ae=O.length,ie;z<ae;z++)if(ie=O[z],ie&&ie.indexOf(G)!==0)return!1;return!0}function P(O,G){G=G||{},this._source_text=O||"",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 a(G)}P.prototype.create_flags=function(O,G){var z=0;O&&(z=O.indentation_level,!this._output.just_added_newline()&&O.line_indent_level>z&&(z=O.line_indent_level));var ae={mode:G,parent:O,last_token:O?O.last_token:new l(i.START_BLOCK,""),last_word:O?O.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:z,alignment:0,line_indent_level:O?O.line_indent_level:z,start_line_index:this._output.get_line_number(),ternary_depth:0};return ae},P.prototype._reset=function(O){var G=O.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new c(this._options,G),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(f.BlockStatement);var z=new o(O,this._options);return this._tokens=z.tokenize(),O},P.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var O,G=this._reset(this._source_text),z=this._options.eol;this._options.eol==="auto"&&(z=`
`,G&&n.lineBreak.test(G||"")&&(z=G.match(n.lineBreak)[0]));for(var ae=this._tokens.next();ae;)this.handle_token(ae),this._last_last_text=this._flags.last_token.text,this._flags.last_token=ae,ae=this._tokens.next();return O=this._output.get_code(z),O},P.prototype.handle_token=function(O,G){O.type===i.START_EXPR?this.handle_start_expr(O):O.type===i.END_EXPR?this.handle_end_expr(O):O.type===i.START_BLOCK?this.handle_start_block(O):O.type===i.END_BLOCK?this.handle_end_block(O):O.type===i.WORD?this.handle_word(O):O.type===i.RESERVED?this.handle_word(O):O.type===i.SEMICOLON?this.handle_semicolon(O):O.type===i.STRING?this.handle_string(O):O.type===i.EQUALS?this.handle_equals(O):O.type===i.OPERATOR?this.handle_operator(O):O.type===i.COMMA?this.handle_comma(O):O.type===i.BLOCK_COMMENT?this.handle_block_comment(O,G):O.type===i.COMMENT?this.handle_comment(O,G):O.type===i.DOT?this.handle_dot(O):O.type===i.EOF?this.handle_eof(O):O.type===i.UNKNOWN?this.handle_unknown(O,G):this.handle_unknown(O,G)},P.prototype.handle_whitespace_and_comments=function(O,G){var z=O.newlines,ae=this._options.keep_array_indentation&&S(this._flags.mode);if(O.comments_before)for(var ie=O.comments_before.next();ie;)this.handle_whitespace_and_comments(ie,G),this.handle_token(ie,G),ie=O.comments_before.next();if(ae)for(var fe=0;fe<z;fe+=1)this.print_newline(fe>0,G);else if(this._options.max_preserve_newlines&&z>this._options.max_preserve_newlines&&(z=this._options.max_preserve_newlines),this._options.preserve_newlines&&z>1){this.print_newline(!1,G);for(var ce=1;ce<z;ce+=1)this.print_newline(!0,G)}};var U=["async","break","continue","return","throw","yield"];P.prototype.allow_wrap_or_preserved_newline=function(O,G){if(G=G===void 0?!1:G,this._output.just_added_newline())return;var z=this._options.preserve_newlines&&O.newlines||G,ae=t(this._flags.last_token.text,r)||t(O.text,r);if(ae){var ie=t(this._flags.last_token.text,r)&&t(this._options.operator_position,d)||t(O.text,r);z=z&&ie}if(z)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(E(this._flags.last_token,U))return;this._output.set_wrap_point()}},P.prototype.print_newline=function(O,G){if(!G&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==i.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var z=this._tokens.peek();this._flags.mode===f.Statement&&!(this._flags.if_block&&m(z,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(O)&&(this._flags.multiline_frame=!0)},P.prototype.print_token_line_indentation=function(O){this._output.just_added_newline()&&(this._options.keep_array_indentation&&O.newlines&&(O.text==="["||S(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(O.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(O){if(this._output.raw){this._output.add_raw_token(O);return}if(this._options.comma_first&&O.previous&&O.previous.type===i.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var G=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(G),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(O),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(O),this._output.non_breaking_space=!0,this._output.add_token(O.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(O){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,O),this._flags=this.create_flags(this._previous_flags,O),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===f.Statement&&T(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===f.ObjectLiteral&&this._flags.mode===f.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||E(this._flags.last_token,["get","set"]))},P.prototype.start_of_statement=function(O){var G=!1;return G=G||E(this._flags.last_token,["var","let","const"])&&O.type===i.WORD,G=G||m(this._flags.last_token,"do"),G=G||!(this._flags.parent.mode===f.ObjectLiteral&&this._flags.mode===f.Statement)&&E(this._flags.last_token,U)&&!O.newlines,G=G||m(this._flags.last_token,"else")&&!(m(O,"if")&&!O.comments_before),G=G||this._flags.last_token.type===i.END_EXPR&&(this._previous_flags.mode===f.ForInitializer||this._previous_flags.mode===f.Conditional),G=G||this._flags.last_token.type===i.WORD&&this._flags.mode===f.BlockStatement&&!this._flags.in_case&&!(O.text==="--"||O.text==="++")&&this._last_last_text!=="function"&&O.type!==i.WORD&&O.type!==i.RESERVED,G=G||this._flags.mode===f.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||E(this._flags.last_token,["get","set"])),G?(this.set_mode(f.Statement),this.indent(),this.handle_whitespace_and_comments(O,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(O,E(O,["do","for","if","while"])),!0):!1},P.prototype.handle_start_expr=function(O){this.start_of_statement(O)||this.handle_whitespace_and_comments(O);var G=f.Expression;if(O.text==="["){if(this._flags.last_token.type===i.WORD||this._flags.last_token.text===")"){E(this._flags.last_token,s)&&(this._output.space_before_token=!0),this.print_token(O),this.set_mode(G),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}G=f.ArrayLiteral,S(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())),t(this._flags.last_token.type,[i.START_EXPR,i.END_EXPR,i.WORD,i.OPERATOR,i.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===i.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,G=f.ForInitializer):t(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,G=f.Conditional):t(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&O.whitespace_before===""?this._output.space_before_token=!1:(t(this._flags.last_token.text,s)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===i.EQUALS||this._flags.last_token.type===i.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(O);else if(this._flags.last_token.type===i.WORD){this._output.space_before_token=!1;var z=this._tokens.peek(-3);if(this._options.space_after_named_function&&z){var ae=this._tokens.peek(-4);E(z,["async","function"])||z.text==="*"&&E(ae,["async","function"])?this._output.space_before_token=!0:this._flags.mode===f.ObjectLiteral?(z.text==="{"||z.text===","||z.text==="*"&&(ae.text==="{"||ae.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(O);(this._flags.last_token.type===i.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(t(this._last_last_text,["function","yield"])||this._flags.mode===f.ObjectLiteral&&t(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===i.START_BLOCK?this.print_newline():(this._flags.last_token.type===i.END_EXPR||this._flags.last_token.type===i.START_EXPR||this._flags.last_token.type===i.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===i.COMMA)&&this.allow_wrap_or_preserved_newline(O,O.newlines),this.print_token(O),this.set_mode(G),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},P.prototype.handle_end_expr=function(O){for(;this._flags.mode===f.Statement;)this.restore_mode();this.handle_whitespace_and_comments(O),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(O,O.text==="]"&&S(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===i.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(O),this.restore_mode(),T(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===f.Conditional&&(this._previous_flags.mode=f.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},P.prototype.handle_start_block=function(O){this.handle_whitespace_and_comments(O);var G=this._tokens.peek(),z=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===i.END_EXPR?(this.set_mode(f.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(f.BlockStatement):z&&(t(z.text,[":",","])&&t(G.type,[i.STRING,i.WORD,i.RESERVED])||t(G.text,["get","set","..."])&&t(z.type,[i.WORD,i.RESERVED]))?t(this._last_last_text,["class","interface"])&&!t(z.text,[":",","])?this.set_mode(f.BlockStatement):this.set_mode(f.ObjectLiteral):this._flags.last_token.type===i.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(f.BlockStatement):t(this._flags.last_token.type,[i.EQUALS,i.START_EXPR,i.COMMA,i.OPERATOR])||E(this._flags.last_token,["return","throw","import","default"])?this.set_mode(f.ObjectLiteral):this.set_mode(f.BlockStatement),this._flags.last_token&&(E(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var ae=!G.comments_before&&G.text==="}",ie=ae&&this._flags.last_word==="function"&&this._flags.last_token.type===i.END_EXPR;if(this._options.brace_preserve_inline){var fe=0,ce=null;this._flags.inline_frame=!0;do if(fe+=1,ce=this._tokens.peek(fe-1),ce.newlines){this._flags.inline_frame=!1;break}while(ce.type!==i.EOF&&!(ce.type===i.END_BLOCK&&ce.opened===O))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&O.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==i.OPERATOR&&(ie||this._flags.last_token.type===i.EQUALS||E(this._flags.last_token,_)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(S(this._previous_flags.mode)&&(this._flags.last_token.type===i.START_EXPR||this._flags.last_token.type===i.COMMA)&&((this._flags.last_token.type===i.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===i.COMMA||this._flags.last_token.type===i.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(O),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==i.OPERATOR&&this._flags.last_token.type!==i.START_EXPR&&(this._flags.last_token.type===i.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(O),this.indent(),!ae&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},P.prototype.handle_end_block=function(O){for(this.handle_whitespace_and_comments(O);this._flags.mode===f.Statement;)this.restore_mode();var G=this._flags.last_token.type===i.START_BLOCK;this._flags.inline_frame&&!G?this._output.space_before_token=!0:this._options.brace_style==="expand"?G||this.print_newline():G||(S(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(O)},P.prototype.handle_word=function(O){if(O.type===i.RESERVED){if(t(O.text,["set","get"])&&this._flags.mode!==f.ObjectLiteral)O.type=i.WORD;else if(O.text==="import"&&t(this._tokens.peek().text,["(","."]))O.type=i.WORD;else if(t(O.text,["as","from"])&&!this._flags.import_block)O.type=i.WORD;else if(this._flags.mode===f.ObjectLiteral){var G=this._tokens.peek();G.text===":"&&(O.type=i.WORD)}}if(this.start_of_statement(O)?E(this._flags.last_token,["var","let","const"])&&O.type===i.WORD&&(this._flags.declaration_statement=!0):O.newlines&&!D(this._flags.mode)&&(this._flags.last_token.type!==i.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==i.EQUALS&&(this._options.preserve_newlines||!E(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(O),this.print_newline()):this.handle_whitespace_and_comments(O),this._flags.do_block&&!this._flags.do_while)if(m(O,"while")){this._output.space_before_token=!0,this.print_token(O),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&&m(O,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===f.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&E(O,["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(O),this._flags.in_case=!0;return}if((this._flags.last_token.type===i.COMMA||this._flags.last_token.type===i.START_EXPR||this._flags.last_token.type===i.EQUALS||this._flags.last_token.type===i.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(O)),m(O,"function")){(t(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(t(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===i.OPERATOR))&&(!this._output.just_added_blankline()&&!O.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===i.RESERVED||this._flags.last_token.type===i.WORD?E(this._flags.last_token,["get","set","new","export"])||E(this._flags.last_token,U)?this._output.space_before_token=!0:m(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===i.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(D(this._flags.mode)||S(this._flags.mode))||this.print_newline(),this.print_token(O),this._flags.last_word=O.text;return}var z="NONE";if(this._flags.last_token.type===i.END_BLOCK?this._previous_flags.inline_frame?z="SPACE":E(O,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&O.newlines?z="NEWLINE":(z="SPACE",this._output.space_before_token=!0):z="NEWLINE":this._flags.last_token.type===i.SEMICOLON&&this._flags.mode===f.BlockStatement?z="NEWLINE":this._flags.last_token.type===i.SEMICOLON&&D(this._flags.mode)?z="SPACE":this._flags.last_token.type===i.STRING?z="NEWLINE":this._flags.last_token.type===i.RESERVED||this._flags.last_token.type===i.WORD||this._flags.last_token.text==="*"&&(t(this._last_last_text,["function","yield"])||this._flags.mode===f.ObjectLiteral&&t(this._last_last_text,["{",","]))?z="SPACE":this._flags.last_token.type===i.START_BLOCK?this._flags.inline_frame?z="SPACE":z="NEWLINE":this._flags.last_token.type===i.END_EXPR&&(this._output.space_before_token=!0,z="NEWLINE"),E(O,s)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?z="SPACE":z="NEWLINE"),E(O,["else","catch","finally"]))if((!(this._flags.last_token.type===i.END_BLOCK&&this._previous_flags.mode===f.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&O.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var ae=this._output.current_line;ae.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else z==="NEWLINE"?E(this._flags.last_token,_)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&E(O,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==i.END_EXPR?(this._flags.last_token.type!==i.START_EXPR||!E(O,["var","let","const"]))&&this._flags.last_token.text!==":"&&(m(O,"if")&&m(O.previous,"else")?this._output.space_before_token=!0:this.print_newline()):E(O,s)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&S(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():z==="SPACE"&&(this._output.space_before_token=!0);O.previous&&(O.previous.type===i.WORD||O.previous.type===i.RESERVED)&&(this._output.space_before_token=!0),this.print_token(O),this._flags.last_word=O.text,O.type===i.RESERVED&&(O.text==="do"?this._flags.do_block=!0:O.text==="if"?this._flags.if_block=!0:O.text==="import"?this._flags.import_block=!0:this._flags.import_block&&m(O,"from")&&(this._flags.import_block=!1))},P.prototype.handle_semicolon=function(O){this.start_of_statement(O)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(O);for(var G=this._tokens.peek();this._flags.mode===f.Statement&&!(this._flags.if_block&&m(G,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(O)},P.prototype.handle_string=function(O){O.text.startsWith("`")&&O.newlines===0&&O.whitespace_before===""&&(O.previous.text===")"||this._flags.last_token.type===i.WORD)||(this.start_of_statement(O)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(O),this._flags.last_token.type===i.RESERVED||this._flags.last_token.type===i.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===i.COMMA||this._flags.last_token.type===i.START_EXPR||this._flags.last_token.type===i.EQUALS||this._flags.last_token.type===i.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(O):O.text.startsWith("`")&&this._flags.last_token.type===i.END_EXPR&&(O.previous.text==="]"||O.previous.text===")")&&O.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(O)},P.prototype.handle_equals=function(O){this.start_of_statement(O)||this.handle_whitespace_and_comments(O),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(O),this._output.space_before_token=!0},P.prototype.handle_comma=function(O){this.handle_whitespace_and_comments(O,!0),this.print_token(O),this._output.space_before_token=!0,this._flags.declaration_statement?(D(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(O)):this._flags.mode===f.ObjectLiteral||this._flags.mode===f.Statement&&this._flags.parent.mode===f.ObjectLiteral?(this._flags.mode===f.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(O)},P.prototype.handle_operator=function(O){var G=O.text==="*"&&(E(this._flags.last_token,["function","yield"])||t(this._flags.last_token.type,[i.START_BLOCK,i.COMMA,i.END_BLOCK,i.SEMICOLON])),z=t(O.text,["-","+"])&&(t(this._flags.last_token.type,[i.START_BLOCK,i.START_EXPR,i.EQUALS,i.OPERATOR])||t(this._flags.last_token.text,s)||this._flags.last_token.text===",");if(!this.start_of_statement(O)){var ae=!G;this.handle_whitespace_and_comments(O,ae)}if(O.text==="*"&&this._flags.last_token.type===i.DOT){this.print_token(O);return}if(O.text==="::"){this.print_token(O);return}if(this._flags.last_token.type===i.OPERATOR&&t(this._options.operator_position,d)&&this.allow_wrap_or_preserved_newline(O),O.text===":"&&this._flags.in_case){this.print_token(O),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==i.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 ie=!0,fe=!0,ce=!1;if(O.text===":"?this._flags.ternary_depth===0?ie=!1:(this._flags.ternary_depth-=1,ce=!0):O.text==="?"&&(this._flags.ternary_depth+=1),!z&&!G&&this._options.preserve_newlines&&t(O.text,r)){var J=O.text===":",Z=J&&ce,ue=J&&!ce;switch(this._options.operator_position){case u.before_newline:this._output.space_before_token=!ue,this.print_token(O),(!J||Z)&&this.allow_wrap_or_preserved_newline(O),this._output.space_before_token=!0;return;case u.after_newline:this._output.space_before_token=!0,!J||Z?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(O):this._output.space_before_token=!1,this.print_token(O),this._output.space_before_token=!0;return;case u.preserve_newline:ue||this.allow_wrap_or_preserved_newline(O),ie=!(this._output.just_added_newline()||ue),this._output.space_before_token=ie,this.print_token(O),this._output.space_before_token=!0;return}}if(G){this.allow_wrap_or_preserved_newline(O),ie=!1;var X=this._tokens.peek();fe=X&&t(X.type,[i.WORD,i.RESERVED])}else if(O.text==="...")this.allow_wrap_or_preserved_newline(O),ie=this._flags.last_token.type===i.START_BLOCK,fe=!1;else if(t(O.text,["--","++","!","~"])||z){if((this._flags.last_token.type===i.COMMA||this._flags.last_token.type===i.START_EXPR)&&this.allow_wrap_or_preserved_newline(O),ie=!1,fe=!1,O.newlines&&(O.text==="--"||O.text==="++"||O.text==="~")){var $=E(this._flags.last_token,_)&&O.newlines;$&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline($,!0)}this._flags.last_token.text===";"&&D(this._flags.mode)&&(ie=!0),this._flags.last_token.type===i.RESERVED?ie=!0:this._flags.last_token.type===i.END_EXPR?ie=!(this._flags.last_token.text==="]"&&(O.text==="--"||O.text==="++")):this._flags.last_token.type===i.OPERATOR&&(ie=t(O.text,["--","-","++","+"])&&t(this._flags.last_token.text,["--","-","++","+"]),t(O.text,["+","-"])&&t(this._flags.last_token.text,["--","++"])&&(fe=!0)),(this._flags.mode===f.BlockStatement&&!this._flags.inline_frame||this._flags.mode===f.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||ie,this.print_token(O),this._output.space_before_token=fe},P.prototype.handle_block_comment=function(O,G){if(this._output.raw){this._output.add_raw_token(O),O.directives&&O.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(O.directives){this.print_newline(!1,G),this.print_token(O),O.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!n.newline.test(O.text)&&!O.newlines){this._output.space_before_token=!0,this.print_token(O),this._output.space_before_token=!0;return}else this.print_block_commment(O,G)},P.prototype.print_block_commment=function(O,G){var z=b(O.text),ae,ie=!1,fe=!1,ce=O.whitespace_before,J=ce.length;if(this.print_newline(!1,G),this.print_token_line_indentation(O),this._output.add_token(z[0]),this.print_newline(!1,G),z.length>1){for(z=z.slice(1),ie=I(z,"*"),fe=w(z,ce),ie&&(this._flags.alignment=1),ae=0;ae<z.length;ae++)ie?(this.print_token_line_indentation(O),this._output.add_token(y(z[ae]))):fe&&z[ae]?(this.print_token_line_indentation(O),this._output.add_token(z[ae].substring(J))):(this._output.current_line.set_indent(-1),this._output.add_token(z[ae])),this.print_newline(!1,G);this._flags.alignment=0}},P.prototype.handle_comment=function(O,G){O.newlines?this.print_newline(!1,G):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(O),this.print_newline(!1,G)},P.prototype.handle_dot=function(O){this.start_of_statement(O)||this.handle_whitespace_and_comments(O,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),E(this._flags.last_token,_)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(O,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(O)},P.prototype.handle_unknown=function(O,G){this.print_token(O),O.text[O.text.length-1]===`
`&&this.print_newline(!1,G)},P.prototype.handle_eof=function(O){for(;this._flags.mode===f.Statement;)this.restore_mode();this.handle_whitespace_and_comments(O)},e.exports.Beautifier=P},function(e){function A(l){this.__parent=l,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}A.prototype.clone_empty=function(){var l=new A(this.__parent);return l.set_indent(this.__indent_count,this.__alignment_count),l},A.prototype.item=function(l){return l<0?this.__items[this.__items.length+l]:this.__items[l]},A.prototype.has_match=function(l){for(var n=this.__items.length-1;n>=0;n--)if(this.__items[n].match(l))return!0;return!1},A.prototype.set_indent=function(l,n){this.is_empty()&&(this.__indent_count=l||0,this.__alignment_count=n||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},A.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)},A.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},A.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var l=this.__parent.current_line;return l.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),l.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),l.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,l.__items[0]===" "&&(l.__items.splice(0,1),l.__character_count-=1),!0}return!1},A.prototype.is_empty=function(){return this.__items.length===0},A.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},A.prototype.push=function(l){this.__items.push(l);var n=l.lastIndexOf(`
`);n!==-1?this.__character_count=l.length-n:this.__character_count+=l.length},A.prototype.pop=function(){var l=null;return this.is_empty()||(l=this.__items.pop(),this.__character_count-=l.length),l},A.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},A.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},A.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},A.prototype.toString=function(){var l="";return this.is_empty()?this.__parent.indent_empty_lines&&(l=this.__parent.get_indent_string(this.__indent_count)):(l=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),l+=this.__items.join("")),l};function g(l,n){this.__cache=[""],this.__indent_size=l.indent_size,this.__indent_string=l.indent_char,l.indent_with_tabs||(this.__indent_string=new Array(l.indent_size+1).join(l.indent_char)),n=n||"",l.indent_level>0&&(n=new Array(l.indent_level+1).join(this.__indent_string)),this.__base_string=n,this.__base_string_length=n.length}g.prototype.get_indent_size=function(l,n){var a=this.__base_string_length;return n=n||0,l<0&&(a=0),a+=l*this.__indent_size,a+=n,a},g.prototype.get_indent_string=function(l,n){var a=this.__base_string;return n=n||0,l<0&&(l=0,a=""),n+=l*this.__indent_size,this.__ensure_cache(n),a+=this.__cache[n],a},g.prototype.__ensure_cache=function(l){for(;l>=this.__cache.length;)this.__add_column()},g.prototype.__add_column=function(){var l=this.__cache.length,n=0,a="";this.__indent_size&&l>=this.__indent_size&&(n=Math.floor(l/this.__indent_size),l-=n*this.__indent_size,a=new Array(n+1).join(this.__indent_string)),l&&(a+=new Array(l+1).join(" ")),this.__cache.push(a)};function c(l,n){this.__indent_cache=new g(l,n),this.raw=!1,this._end_with_newline=l.end_with_newline,this.indent_size=l.indent_size,this.wrap_line_length=l.wrap_line_length,this.indent_empty_lines=l.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new A(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}c.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},c.prototype.get_line_number=function(){return this.__lines.length},c.prototype.get_indent_string=function(l,n){return this.__indent_cache.get_indent_string(l,n)},c.prototype.get_indent_size=function(l,n){return this.__indent_cache.get_indent_size(l,n)},c.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},c.prototype.add_new_line=function(l){return this.is_empty()||!l&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},c.prototype.get_code=function(l){this.trim(!0);var n=this.current_line.pop();n&&(n[n.length-1]===`
`&&(n=n.replace(/\n+$/g,"")),this.current_line.push(n)),this._end_with_newline&&this.__add_outputline();var a=this.__lines.join(`
`);return l!==`
`&&(a=a.replace(/[\n]/g,l)),a},c.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},c.prototype.set_indent=function(l,n){return l=l||0,n=n||0,this.next_line.set_indent(l,n),this.__lines.length>1?(this.current_line.set_indent(l,n),!0):(this.current_line.set_indent(),!1)},c.prototype.add_raw_token=function(l){for(var n=0;n<l.newlines;n++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(l.whitespace_before),this.current_line.push(l.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},c.prototype.add_token=function(l){this.__add_space_before_token(),this.current_line.push(l),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},c.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(" "))},c.prototype.remove_indent=function(l){for(var n=this.__lines.length;l<n;)this.__lines[l]._remove_indent(),l++;this.current_line._remove_wrap_indent()},c.prototype.trim=function(l){for(l=l===void 0?!1:l,this.current_line.trim();l&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},c.prototype.just_added_newline=function(){return this.current_line.is_empty()},c.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},c.prototype.ensure_empty_line_above=function(l,n){for(var a=this.__lines.length-2;a>=0;){var o=this.__lines[a];if(o.is_empty())break;if(o.item(0).indexOf(l)!==0&&o.item(-1)!==n){this.__lines.splice(a+1,0,new A(this)),this.previous_line=this.__lines[this.__lines.length-2];break}a--}},e.exports.Output=c},function(e){function A(g,c,l,n){this.type=g,this.text=c,this.comments_before=null,this.newlines=l||0,this.whitespace_before=n||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}e.exports.Token=A},function(e,A){var g="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",c="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",l="\\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",n="\\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",a="(?:\\\\u[0-9a-fA-F]{4}|["+g+l+"])",o="(?:\\\\u[0-9a-fA-F]{4}|["+c+l+n+"])*";A.identifier=new RegExp(a+o,"g"),A.identifierStart=new RegExp(a),A.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+c+l+n+"])+");var s=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;A.newline=/[\n\r\u2028\u2029]/,A.lineBreak=new RegExp(`\r
|`+A.newline.source),A.allLineBreaks=new RegExp(A.lineBreak.source,"g")},function(e,A,g){var c=g(6).Options,l=["before-newline","after-newline","preserve-newline"];function n(a){c.call(this,a,"js");var o=this.raw_options.brace_style||null;o==="expand-strict"?this.raw_options.brace_style="expand":o==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var s=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var r=0;r<s.length;r++)s[r]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=s[r];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",l),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}n.prototype=new c,e.exports.Options=n},function(e){function A(l,n){this.raw_options=g(l,n),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"])}A.prototype._get_array=function(l,n){var a=this.raw_options[l],o=n||[];return typeof a=="object"?a!==null&&typeof a.concat=="function"&&(o=a.concat()):typeof a=="string"&&(o=a.split(/[^a-zA-Z0-9_\/\-]+/)),o},A.prototype._get_boolean=function(l,n){var a=this.raw_options[l],o=a===void 0?!!n:!!a;return o},A.prototype._get_characters=function(l,n){var a=this.raw_options[l],o=n||"";return typeof a=="string"&&(o=a.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),o},A.prototype._get_number=function(l,n){var a=this.raw_options[l];n=parseInt(n,10),isNaN(n)&&(n=0);var o=parseInt(a,10);return isNaN(o)&&(o=n),o},A.prototype._get_selection=function(l,n,a){var o=this._get_selection_list(l,n,a);if(o.length!==1)throw new Error("Invalid Option Value: The option '"+l+`' can only be one of the following values:
`+n+`
You passed in: '`+this.raw_options[l]+"'");return o[0]},A.prototype._get_selection_list=function(l,n,a){if(!n||n.length===0)throw new Error("Selection list cannot be empty.");if(a=a||[n[0]],!this._is_valid_selection(a,n))throw new Error("Invalid Default Value!");var o=this._get_array(l,a);if(!this._is_valid_selection(o,n))throw new Error("Invalid Option Value: The option '"+l+`' can contain only the following values:
`+n+`
You passed in: '`+this.raw_options[l]+"'");return o},A.prototype._is_valid_selection=function(l,n){return l.length&&n.length&&!l.some(function(a){return n.indexOf(a)===-1})};function g(l,n){var a={};l=c(l);var o;for(o in l)o!==n&&(a[o]=l[o]);if(n&&l[n])for(o in l[n])a[o]=l[n][o];return a}function c(l){var n={},a;for(a in l){var o=a.replace(/-/g,"_");n[o]=l[a]}return n}e.exports.Options=A,e.exports.normalizeOpts=c,e.exports.mergeOpts=g},function(e,A,g){var c=g(8).InputScanner,l=g(9).Tokenizer,n=g(9).TOKEN,a=g(13).Directives,o=g(4),s=g(12).Pattern,r=g(14).TemplatablePattern;function i(I,w){return w.indexOf(I)!==-1}var t={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:n.START,RAW:n.RAW,EOF:n.EOF},y=new a(/\/\*/,/\*\//),p=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,m=/[0-9]/,E=/[^\d\.]/,_=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),h=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";h=h.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),h="\\?\\.(?!\\d) "+h,h=h.replace(/ /g,"|");var u=new RegExp(h),d="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),f=d.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),T=new RegExp("^(?:"+f.join("|")+")$"),b,S=function(I,w){l.call(this,I,w),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var P=new s(this._input),U=new r(this._input).read_options(this._options);this.__patterns={template:U,identifier:U.starting_with(o.identifier).matching(o.identifierMatch),number:P.matching(p),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(o.lineBreak),shebang:P.starting_with(/#!/).until_after(o.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:U.until(/['\\\n\r\u2028\u2029]/),double_quote:U.until(/["\\\n\r\u2028\u2029]/),template_text:U.until(/[`\\$]/),template_expression:U.until(/[`}\\]/)}};S.prototype=new l,S.prototype._is_comment=function(I){return I.type===t.COMMENT||I.type===t.BLOCK_COMMENT||I.type===t.UNKNOWN},S.prototype._is_opening=function(I){return I.type===t.START_BLOCK||I.type===t.START_EXPR},S.prototype._is_closing=function(I,w){return(I.type===t.END_BLOCK||I.type===t.END_EXPR)&&w&&(I.text==="]"&&w.text==="["||I.text===")"&&w.text==="("||I.text==="}"&&w.text==="{")},S.prototype._reset=function(){b=!1},S.prototype._get_next_token=function(I,w){var P=null;this._readWhitespace();var U=this._input.peek();return U===null?this._create_token(t.EOF,""):(P=P||this._read_non_javascript(U),P=P||this._read_string(U),P=P||this._read_word(I),P=P||this._read_singles(U),P=P||this._read_comment(U),P=P||this._read_regexp(U,I),P=P||this._read_xml(U,I),P=P||this._read_punctuation(),P=P||this._create_token(t.UNKNOWN,this._input.next()),P)},S.prototype._read_word=function(I){var w;if(w=this.__patterns.identifier.read(),w!=="")return w=w.replace(o.allLineBreaks,`
`),!(I.type===t.DOT||I.type===t.RESERVED&&(I.text==="set"||I.text==="get"))&&T.test(w)?(w==="in"||w==="of")&&(I.type===t.WORD||I.type===t.STRING)?this._create_token(t.OPERATOR,w):this._create_token(t.RESERVED,w):this._create_token(t.WORD,w);if(w=this.__patterns.number.read(),w!=="")return this._create_token(t.WORD,w)},S.prototype._read_singles=function(I){var w=null;return I==="("||I==="["?w=this._create_token(t.START_EXPR,I):I===")"||I==="]"?w=this._create_token(t.END_EXPR,I):I==="{"?w=this._create_token(t.START_BLOCK,I):I==="}"?w=this._create_token(t.END_BLOCK,I):I===";"?w=this._create_token(t.SEMICOLON,I):I==="."&&E.test(this._input.peek(1))?w=this._create_token(t.DOT,I):I===","&&(w=this._create_token(t.COMMA,I)),w&&this._input.next(),w},S.prototype._read_punctuation=function(){var I=this.__patterns.punct.read();if(I!=="")return I==="="?this._create_token(t.EQUALS,I):I==="?."?this._create_token(t.DOT,I):this._create_token(t.OPERATOR,I)},S.prototype._read_non_javascript=function(I){var w="";if(I==="#"){if(this._is_first_token()&&(w=this.__patterns.shebang.read(),w))return this._create_token(t.UNKNOWN,w.trim()+`
`);if(w=this.__patterns.include.read(),w)return this._create_token(t.UNKNOWN,w.trim()+`
`);I=this._input.next();var P="#";if(this._input.hasNext()&&this._input.testChar(m)){do I=this._input.next(),P+=I;while(this._input.hasNext()&&I!=="#"&&I!=="=");return I==="#"||(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(t.WORD,P)}this._input.back()}else if(I==="<"&&this._is_first_token()){if(w=this.__patterns.html_comment_start.read(),w){for(;this._input.hasNext()&&!this._input.testChar(o.newline);)w+=this._input.next();return b=!0,this._create_token(t.COMMENT,w)}}else if(b&&I==="-"&&(w=this.__patterns.html_comment_end.read(),w))return b=!1,this._create_token(t.COMMENT,w);return null},S.prototype._read_comment=function(I){var w=null;if(I==="/"){var P="";if(this._input.peek(1)==="*"){P=this.__patterns.block_comment.read();var U=y.get_directives(P);U&&U.ignore==="start"&&(P+=y.readIgnored(this._input)),P=P.replace(o.allLineBreaks,`
`),w=this._create_token(t.BLOCK_COMMENT,P),w.directives=U}else this._input.peek(1)==="/"&&(P=this.__patterns.comment.read(),w=this._create_token(t.COMMENT,P))}return w},S.prototype._read_string=function(I){if(I==="`"||I==="'"||I==='"'){var w=this._input.next();return this.has_char_escapes=!1,I==="`"?w+=this._read_string_recursive("`",!0,"${"):w+=this._read_string_recursive(I),this.has_char_escapes&&this._options.unescape_strings&&(w=D(w)),this._input.peek()===I&&(w+=this._input.next()),w=w.replace(o.allLineBreaks,`
`),this._create_token(t.STRING,w)}return null},S.prototype._allow_regexp_or_xml=function(I){return I.type===t.RESERVED&&i(I.text,["return","case","throw","else","do","typeof","yield"])||I.type===t.END_EXPR&&I.text===")"&&I.opened.previous.type===t.RESERVED&&i(I.opened.previous.text,["if","while","for"])||i(I.type,[t.COMMENT,t.START_EXPR,t.START_BLOCK,t.START,t.END_BLOCK,t.OPERATOR,t.EQUALS,t.EOF,t.SEMICOLON,t.COMMA])},S.prototype._read_regexp=function(I,w){if(I==="/"&&this._allow_regexp_or_xml(w)){for(var P=this._input.next(),U=!1,O=!1;this._input.hasNext()&&(U||O||this._input.peek()!==I)&&!this._input.testChar(o.newline);)P+=this._input.peek(),U?U=!1:(U=this._input.peek()==="\\",this._input.peek()==="["?O=!0:this._input.peek()==="]"&&(O=!1)),this._input.next();return this._input.peek()===I&&(P+=this._input.next(),P+=this._input.read(o.identifier)),this._create_token(t.STRING,P)}return null},S.prototype._read_xml=function(I,w){if(this._options.e4x&&I==="<"&&this._allow_regexp_or_xml(w)){var P="",U=this.__patterns.xml.read_match();if(U){for(var O=U[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),G=O.indexOf("{")===0,z=0;U;){var ae=!!U[1],ie=U[2],fe=!!U[U.length-1]||ie.slice(0,8)==="![CDATA[";if(!fe&&(ie===O||G&&ie.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(ae?--z:++z),P+=U[0],z<=0)break;U=this.__patterns.xml.read_match()}return U||(P+=this._input.match(/[\s\S]*/g)[0]),P=P.replace(o.allLineBreaks,`
`),this._create_token(t.STRING,P)}}return null};function D(I){for(var w="",P=0,U=new c(I),O=null;U.hasNext();)if(O=U.match(/([\s]|[^\\]|\\\\)+/g),O&&(w+=O[0]),U.peek()==="\\"){if(U.next(),U.peek()==="x")O=U.match(/x([0-9A-Fa-f]{2})/g);else if(U.peek()==="u")O=U.match(/u([0-9A-Fa-f]{4})/g);else{w+="\\",U.hasNext()&&(w+=U.next());continue}if(!O)return I;if(P=parseInt(O[1],16),P>126&&P<=255&&O[0].indexOf("x")===0)return I;if(P>=0&&P<32){w+="\\"+O[0];continue}else P===34||P===39||P===92?w+="\\"+String.fromCharCode(P):w+=String.fromCharCode(P)}return w}S.prototype._read_string_recursive=function(I,w,P){var U,O;I==="'"?O=this.__patterns.single_quote:I==='"'?O=this.__patterns.double_quote:I==="`"?O=this.__patterns.template_text:I==="}"&&(O=this.__patterns.template_expression);for(var G=O.read(),z="";this._input.hasNext();){if(z=this._input.next(),z===I||!w&&o.newline.test(z)){this._input.back();break}else z==="\\"&&this._input.hasNext()?(U=this._input.peek(),U==="x"||U==="u"?this.has_char_escapes=!0:U==="\r"&&this._input.peek(1)===`
`&&this._input.next(),z+=this._input.next()):P&&(P==="${"&&z==="$"&&this._input.peek()==="{"&&(z+=this._input.next()),P===z&&(I==="`"?z+=this._read_string_recursive("}",w,"`"):z+=this._read_string_recursive("`",w,"${"),this._input.hasNext()&&(z+=this._input.next())));z+=O.read(),G+=z}return G},e.exports.Tokenizer=S,e.exports.TOKEN=t,e.exports.positionable_operators=_.slice(),e.exports.line_starters=d.slice()},function(e){var A=RegExp.prototype.hasOwnProperty("sticky");function g(c){this.__input=c||"",this.__input_length=this.__input.length,this.__position=0}g.prototype.restart=function(){this.__position=0},g.prototype.back=function(){this.__position>0&&(this.__position-=1)},g.prototype.hasNext=function(){return this.__position<this.__input_length},g.prototype.next=function(){var c=null;return this.hasNext()&&(c=this.__input.charAt(this.__position),this.__position+=1),c},g.prototype.peek=function(c){var l=null;return c=c||0,c+=this.__position,c>=0&&c<this.__input_length&&(l=this.__input.charAt(c)),l},g.prototype.__match=function(c,l){c.lastIndex=l;var n=c.exec(this.__input);return n&&!(A&&c.sticky)&&(n.index!==l&&(n=null)),n},g.prototype.test=function(c,l){return l=l||0,l+=this.__position,l>=0&&l<this.__input_length?!!this.__match(c,l):!1},g.prototype.testChar=function(c,l){var n=this.peek(l);return c.lastIndex=0,n!==null&&c.test(n)},g.prototype.match=function(c){var l=this.__match(c,this.__position);return l?this.__position+=l[0].length:l=null,l},g.prototype.read=function(c,l,n){var a="",o;return c&&(o=this.match(c),o&&(a+=o[0])),l&&(o||!c)&&(a+=this.readUntil(l,n)),a},g.prototype.readUntil=function(c,l){var n="",a=this.__position;c.lastIndex=this.__position;var o=c.exec(this.__input);return o?(a=o.index,l&&(a+=o[0].length)):a=this.__input_length,n=this.__input.substring(this.__position,a),this.__position=a,n},g.prototype.readUntilAfter=function(c){return this.readUntil(c,!0)},g.prototype.get_regexp=function(c,l){var n=null,a="g";return l&&A&&(a="y"),typeof c=="string"&&c!==""?n=new RegExp(c,a):c&&(n=new RegExp(c.source,a)),n},g.prototype.get_literal_regexp=function(c){return RegExp(c.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},g.prototype.peekUntilAfter=function(c){var l=this.__position,n=this.readUntilAfter(c);return this.__position=l,n},g.prototype.lookBack=function(c){var l=this.__position-1;return l>=c.length&&this.__input.substring(l-c.length,l).toLowerCase()===c},e.exports.InputScanner=g},function(e,A,g){var c=g(8).InputScanner,l=g(3).Token,n=g(10).TokenStream,a=g(11).WhitespacePattern,o={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},s=function(r,i){this._input=new c(r),this._options=i||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new a(this._input)};s.prototype.tokenize=function(){this._input.restart(),this.__tokens=new n,this._reset();for(var r,i=new l(o.START,""),t=null,y=[],p=new n;i.type!==o.EOF;){for(r=this._get_next_token(i,t);this._is_comment(r);)p.add(r),r=this._get_next_token(i,t);p.isEmpty()||(r.comments_before=p,p=new n),r.parent=t,this._is_opening(r)?(y.push(t),t=r):t&&this._is_closing(r,t)&&(r.opened=t,t.closed=r,t=y.pop(),r.parent=t),r.previous=i,i.next=r,this.__tokens.add(r),i=r}return this.__tokens},s.prototype._is_first_token=function(){return this.__tokens.isEmpty()},s.prototype._reset=function(){},s.prototype._get_next_token=function(r,i){this._readWhitespace();var t=this._input.read(/.+/g);return t?this._create_token(o.RAW,t):this._create_token(o.EOF,"")},s.prototype._is_comment=function(r){return!1},s.prototype._is_opening=function(r){return!1},s.prototype._is_closing=function(r,i){return!1},s.prototype._create_token=function(r,i){var t=new l(r,i,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return t},s.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},e.exports.Tokenizer=s,e.exports.TOKEN=o},function(e){function A(g){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=g}A.prototype.restart=function(){this.__position=0},A.prototype.isEmpty=function(){return this.__tokens_length===0},A.prototype.hasNext=function(){return this.__position<this.__tokens_length},A.prototype.next=function(){var g=null;return this.hasNext()&&(g=this.__tokens[this.__position],this.__position+=1),g},A.prototype.peek=function(g){var c=null;return g=g||0,g+=this.__position,g>=0&&g<this.__tokens_length&&(c=this.__tokens[g]),c},A.prototype.add=function(g){this.__parent_token&&(g.parent=this.__parent_token),this.__tokens.push(g),this.__tokens_length+=1},e.exports.TokenStream=A},function(e,A,g){var c=g(12).Pattern;function l(n,a){c.call(this,n,a),a?this._line_regexp=this._input.get_regexp(a._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}l.prototype=new c,l.prototype.__set_whitespace_patterns=function(n,a){n+="\\t ",a+="\\n\\r",this._match_pattern=this._input.get_regexp("["+n+a+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+a+"]")},l.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var n=this._input.read(this._match_pattern);if(n===" ")this.whitespace_before_token=" ";else if(n){var a=this.__split(this._newline_regexp,n);this.newline_count=a.length-1,this.whitespace_before_token=a[this.newline_count]}return n},l.prototype.matching=function(n,a){var o=this._create();return o.__set_whitespace_patterns(n,a),o._update(),o},l.prototype._create=function(){return new l(this._input,this)},l.prototype.__split=function(n,a){n.lastIndex=0;for(var o=0,s=[],r=n.exec(a);r;)s.push(a.substring(o,r.index)),o=r.index+r[0].length,r=n.exec(a);return o<a.length?s.push(a.substring(o,a.length)):s.push(""),s},e.exports.WhitespacePattern=l},function(e){function A(g,c){this._input=g,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,c&&(this._starting_pattern=this._input.get_regexp(c._starting_pattern,!0),this._match_pattern=this._input.get_regexp(c._match_pattern,!0),this._until_pattern=this._input.get_regexp(c._until_pattern),this._until_after=c._until_after)}A.prototype.read=function(){var g=this._input.read(this._starting_pattern);return(!this._starting_pattern||g)&&(g+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),g},A.prototype.read_match=function(){return this._input.match(this._match_pattern)},A.prototype.until_after=function(g){var c=this._create();return c._until_after=!0,c._until_pattern=this._input.get_regexp(g),c._update(),c},A.prototype.until=function(g){var c=this._create();return c._until_after=!1,c._until_pattern=this._input.get_regexp(g),c._update(),c},A.prototype.starting_with=function(g){var c=this._create();return c._starting_pattern=this._input.get_regexp(g,!0),c._update(),c},A.prototype.matching=function(g){var c=this._create();return c._match_pattern=this._input.get_regexp(g,!0),c._update(),c},A.prototype._create=function(){return new A(this._input,this)},A.prototype._update=function(){},e.exports.Pattern=A},function(e){function A(g,c){g=typeof g=="string"?g:g.source,c=typeof c=="string"?c:c.source,this.__directives_block_pattern=new RegExp(g+/ beautify( \w+[:]\w+)+ /.source+c,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(g+/\sbeautify\signore:end\s/.source+c,"g")}A.prototype.get_directives=function(g){if(!g.match(this.__directives_block_pattern))return null;var c={};this.__directive_pattern.lastIndex=0;for(var l=this.__directive_pattern.exec(g);l;)c[l[1]]=l[2],l=this.__directive_pattern.exec(g);return c},A.prototype.readIgnored=function(g){return g.readUntilAfter(this.__directives_end_ignore_pattern)},e.exports.Directives=A},function(e,A,g){var c=g(12).Pattern,l={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function n(a,o){c.call(this,a,o),this.__template_pattern=null,this._disabled=Object.assign({},l),this._excluded=Object.assign({},l),o&&(this.__template_pattern=this._input.get_regexp(o.__template_pattern),this._excluded=Object.assign(this._excluded,o._excluded),this._disabled=Object.assign(this._disabled,o._disabled));var s=new c(a);this.__patterns={handlebars_comment:s.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:s.starting_with(/{{{/).until_after(/}}}/),handlebars:s.starting_with(/{{/).until_after(/}}/),php:s.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:s.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:s.starting_with(/{%/).until_after(/%}/),django_value:s.starting_with(/{{/).until_after(/}}/),django_comment:s.starting_with(/{#/).until_after(/#}/),smarty:s.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:s.starting_with(/{\*/).until_after(/\*}/),smarty_literal:s.starting_with(/{literal}/).until_after(/{\/literal}/)}}n.prototype=new c,n.prototype._create=function(){return new n(this._input,this)},n.prototype._update=function(){this.__set_templated_pattern()},n.prototype.disable=function(a){var o=this._create();return o._disabled[a]=!0,o._update(),o},n.prototype.read_options=function(a){var o=this._create();for(var s in l)o._disabled[s]=a.templating.indexOf(s)===-1;return o._update(),o},n.prototype.exclude=function(a){var o=this._create();return o._excluded[a]=!0,o._update(),o},n.prototype.read=function(){var a="";this._match_pattern?a=this._input.read(this._starting_pattern):a=this._input.read(this._starting_pattern,this.__template_pattern);for(var o=this._read_template();o;)this._match_pattern?o+=this._input.read(this._match_pattern):o+=this._input.readUntil(this.__template_pattern),a+=o,o=this._read_template();return this._until_after&&(a+=this._input.readUntilAfter(this._until_pattern)),a},n.prototype.__set_templated_pattern=function(){var a=[];this._disabled.php||a.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||a.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||a.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(a.push(this.__patterns.django._starting_pattern.source),a.push(this.__patterns.django_value._starting_pattern.source),a.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||a.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&a.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+a.join("|")+")")},n.prototype._read_template=function(){var a="",o=this._input.peek();if(o==="<"){var s=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&s==="?"&&(a=a||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&s==="%"&&(a=a||this.__patterns.erb.read())}else o==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(a=a||this.__patterns.handlebars_comment.read(),a=a||this.__patterns.handlebars_unescaped.read(),a=a||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(a=a||this.__patterns.django_value.read()),this._excluded.django||(a=a||this.__patterns.django_comment.read(),a=a||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(a=a||this.__patterns.smarty_comment.read(),a=a||this.__patterns.smarty_literal.read(),a=a||this.__patterns.smarty.read()));return a},e.exports.TemplatablePattern=n}],R={};function B(e){var A=R[e];if(A!==void 0)return A.exports;var g=R[e]={exports:{}};return L[e](g,g.exports,B),g.exports}var k=B(0);C=k})();var j=C;!(te=[],H=function(){return{js_beautify:j}}.apply(le,te),H!==void 0&&(Qe.exports=H))})()},"746U":function(Qe,le,W){"use strict";W.d(le,"f",function(){return te}),W.d(le,"l",function(){return H}),W.d(le,"k",function(){return C}),W.d(le,"j",function(){return j}),W.d(le,"g",function(){return L}),W.d(le,"m",function(){return R}),W.d(le,"h",function(){return B}),W.d(le,"n",function(){return k}),W.d(le,"c",function(){return e}),W.d(le,"a",function(){return A}),W.d(le,"i",function(){return g}),W.d(le,"o",function(){return c}),W.d(le,"e",function(){return a}),W.d(le,"d",function(){return o}),W.d(le,"p",function(){return s}),W.d(le,"b",function(){return r});function te(i){return Array.isArray(i)}function H(i){return typeof i=="string"}function C(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)&&!(i instanceof RegExp)&&!(i instanceof Date)}function j(i){return typeof i=="number"&&!isNaN(i)}function L(i){return i===!0||i===!1}function R(i){return typeof i=="undefined"}function B(i){return!k(i)}function k(i){return R(i)||i===null}function e(i,t){if(!i)throw new Error(t?`Unexpected type, expected '${t}'`:"Unexpected type")}function A(i){if(k(i))throw new Error("Assertion Failed: argument is undefined or null");return i}function g(i){return typeof i=="function"}function c(i,t){const y=Math.min(i.length,t.length);for(let p=0;p<y;p++)l(i[p],t[p])}function l(i,t){if(H(t)){if(typeof i!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(g(t)){try{if(i instanceof t)return}catch(y){}if(!k(i)&&i.constructor===t)return;if(t.length===1&&t.call(void 0,i)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function n(i){let t=[],y=Object.getPrototypeOf(i);for(;Object.prototype!==y;)t=t.concat(Object.getOwnPropertyNames(y)),y=Object.getPrototypeOf(y);return t}function a(i){const t=[];for(const y of n(i))typeof i[y]=="function"&&t.push(y);return t}function o(i,t){const y=m=>function(){const E=Array.prototype.slice.call(arguments,0);return t(m,E)};let p={};for(const m of i)p[m]=y(m);return p}function s(i){return i===null?void 0:i}function r(i,t="Unreachable"){throw new Error(t)}},"815F":function(Qe,le,W){"use strict";W.d(le,"e",function(){return B}),W.d(le,"c",function(){return e}),W.d(le,"d",function(){return A}),W.d(le,"a",function(){return c}),W.d(le,"f",function(){return l}),W.d(le,"b",function(){return n});var te=W("KQm4"),H=W("VTBJ"),C=W("Ff2n"),j=W("Zm9Q"),L=W("Kwbf"),R=W("OZM5");function B(a,o){return a!=null?a:o}function k(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],o=new Map;function s(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(r||[]).forEach(function(t){var y=t.key,p=t.children;Object(L.a)(y!=null,"Tree node must have a certain key: [".concat(i).concat(y,"]"));var m=String(y);Object(L.a)(!o.has(m)||y===null||y===void 0,"Same 'key' exist in the Tree: ".concat(m)),o.set(m,!0),s(p,"".concat(i).concat(m," > "))})}s(a)}function e(a){function o(s){var r=Object(j.a)(s);return r.map(function(i){if(!Object(R.i)(i))return Object(L.a)(!i,"Tree/TreeNode can only accept TreeNode as children."),null;var t=i.key,y=i.props,p=y.children,m=Object(C.a)(y,["children"]),E=Object(H.a)({key:t},m),_=o(p);return _.length&&(E.children=_),E}).filter(function(i){return i})}return o(a)}function A(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],s=new Set(o===!0?[]:o),r=[];function i(t){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return t.map(function(p,m){var E=Object(R.h)(y?y.pos:"0",m),_=B(p.key,E),h=Object(H.a)(Object(H.a)({},p),{},{parent:y,pos:E,children:null,data:p,isStart:[].concat(Object(te.a)(y?y.isStart:[]),[m===0]),isEnd:[].concat(Object(te.a)(y?y.isEnd:[]),[m===t.length-1])});return r.push(h),o===!0||s.has(_)?h.children=i(p.children||[],h):h.children=[],h})}return i(a),r}function g(a,o,s){var r;s?typeof s=="string"?r=function(y){return y[s]}:typeof s=="function"&&(r=function(y){return s(y)}):r=function(y,p){return B(y.key,p)};function i(t,y,p){var m=t?t.children:a,E=t?Object(R.h)(p.pos,y):"0";if(t){var _=r(t,E),h={node:t,index:y,pos:E,key:_,parentPos:p.node?p.pos:null,level:p.level+1};o(h)}m&&m.forEach(function(u,d){i(u,d,{node:t,pos:E,level:p?p.level+1:-1})})}i(null)}function c(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=o.initWrapper,r=o.processEntity,i=o.onProcessFinished,t=arguments.length>2?arguments[2]:void 0,y={},p={},m={posEntities:y,keyEntities:p};return s&&(m=s(m)||m),g(a,function(E){var _=E.node,h=E.index,u=E.pos,d=E.key,f=E.parentPos,T=E.level,b={node:_,index:h,key:d,pos:u,level:T},S=B(d,u);y[u]=b,p[S]=b,b.parent=y[f],b.parent&&(b.parent.children=b.parent.children||[],b.parent.children.push(b)),r&&r(b,m)},t),i&&i(m),m}function l(a,o){var s=o.expandedKeys,r=o.selectedKeys,i=o.loadedKeys,t=o.loadingKeys,y=o.checkedKeys,p=o.halfCheckedKeys,m=o.dragOverNodeKey,E=o.dropPosition,_=o.keyEntities,h=_[a],u={eventKey:a,expanded:s.indexOf(a)!==-1,selected:r.indexOf(a)!==-1,loaded:i.indexOf(a)!==-1,loading:t.indexOf(a)!==-1,checked:y.indexOf(a)!==-1,halfChecked:p.indexOf(a)!==-1,pos:String(h?h.pos:""),dragOver:m===a&&E===0,dragOverGapTop:m===a&&E===-1,dragOverGapBottom:m===a&&E===1};return u}function n(a){var o=a.data,s=a.expanded,r=a.selected,i=a.checked,t=a.loaded,y=a.loading,p=a.halfChecked,m=a.dragOver,E=a.dragOverGapTop,_=a.dragOverGapBottom,h=a.pos,u=a.active,d=Object(H.a)(Object(H.a)({},o),{},{expanded:s,selected:r,checked:i,loaded:t,loading:y,halfChecked:p,dragOver:m,dragOverGapTop:E,dragOverGapBottom:_,pos:h,active:u});return"props"in d||Object.defineProperty(d,"props",{get:function(){return Object(L.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),a}}),d}},"8HAY":function(Qe,le,W){"use strict";W.d(le,"a",function(){return L}),W.d(le,"b",function(){return R}),W.d(le,"d",function(){return B}),W.d(le,"e",function(){return k}),W.d(le,"c",function(){return e});var te=W("MI8n"),H=W("pmY6"),C=W("3/fG"),j=function(A,g,c,l){function n(a){return a instanceof c?a:new c(function(o){o(a)})}return new(c||(c=Promise))(function(a,o){function s(t){try{i(l.next(t))}catch(y){o(y)}}function r(t){try{i(l.throw(t))}catch(y){o(y)}}function i(t){t.done?a(t.value):n(t.value).then(s,r)}i((l=l.apply(A,g||[])).next())})};class L extends H.a{constructor(A,g="",c="",l=!0,n){super();this._onDidChange=this._register(new te.b),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=A,this._label=g,this._cssClass=c,this._enabled=l,this._actionCallback=n}get id(){return this._id}get label(){return this._label}set label(A){this._setLabel(A)}_setLabel(A){this._label!==A&&(this._label=A,this._onDidChange.fire({label:A}))}get tooltip(){return this._tooltip||""}set tooltip(A){this._setTooltip(A)}_setTooltip(A){this._tooltip!==A&&(this._tooltip=A,this._onDidChange.fire({tooltip:A}))}get class(){return this._cssClass}set class(A){this._setClass(A)}_setClass(A){this._cssClass!==A&&(this._cssClass=A,this._onDidChange.fire({class:A}))}get enabled(){return this._enabled}set enabled(A){this._setEnabled(A)}_setEnabled(A){this._enabled!==A&&(this._enabled=A,this._onDidChange.fire({enabled:A}))}get checked(){return this._checked}set checked(A){this._setChecked(A)}_setChecked(A){this._checked!==A&&(this._checked=A,this._onDidChange.fire({checked:A}))}run(A,g){return j(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(A))})}}class R extends H.a{constructor(){super(...arguments);this._onBeforeRun=this._register(new te.b),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new te.b),this.onDidRun=this._onDidRun.event}run(A,g){return j(this,void 0,void 0,function*(){if(!A.enabled)return;this._onBeforeRun.fire({action:A});let c;try{yield this.runAction(A,g)}catch(l){c=l}this._onDidRun.fire({action:A,error:c})})}runAction(A,g){return j(this,void 0,void 0,function*(){yield A.run(g)})}}class B extends L{constructor(A){super(B.ID,A,A?"separator text":"separator");this.checked=!1,this.enabled=!1}}B.ID="vs.actions.separator";class k{constructor(A,g,c,l){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=A,this.label=g,this.class=l,this._actions=c}get actions(){return this._actions}dispose(){}run(){return j(this,void 0,void 0,function*(){})}}class e extends L{constructor(){super(e.ID,C.a("submenu.empty","(empty)"),void 0,!1)}}e.ID="vs.actions.empty"},"8Jsi":function(Qe,le,W){"use strict";W.d(le,"d",function(){return f}),W.d(le,"a",function(){return Ie}),W.d(le,"b",function(){return Fe}),W.d(le,"c",function(){return Le});var te=W("1OyB"),H=W("vuIU"),C=W("Ji7U"),j=W("LK+K"),L=W("KQm4"),R=W("U8pU"),B=W("ODXe"),k=W("VTBJ"),e=W("q1tI"),A=W("qNPg"),g=W("2Qr1"),c=W("815F"),l=W("NvD2"),n=W("wPlo"),a=W("6cGi"),o=W("Kwbf"),s=W("4IlW"),r=W("YrtM"),i=W("fAei"),t=e.createContext(null);function y(he,me){if(!he)return!0;var _e=he.data,Se=_e.disabled,Ce=_e.disableCheckbox;switch(me){case"select":return Se;case"checkbox":return Se||Ce}return!1}function p(he,me){var _e=e.useCallback(function(Ce){var Oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"select",xe=arguments.length>2?arguments[2]:void 0,Ue=he.get(Ce);return!xe&&y(Ue,Oe)?null:Ue},[he]),Se=e.useCallback(function(Ce){var Oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"select",xe=arguments.length>2?arguments[2]:void 0,Ue=me.get(Ce);return!xe&&y(Ue,Oe)?null:Ue},[me]);return[_e,Se]}function m(he){return e.useMemo(function(){var me=new Map,_e=new Map;return he.forEach(function(Se){me.set(Se.key,Se),_e.set(Se.data.value,Se)}),[me,_e]},[he])}var E={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},_=function(me,_e){var Se=me.prefixCls,Ce=me.height,Oe=me.itemHeight,xe=me.virtual,Ue=me.options,Be=me.flattenOptions,Ee=me.multiple,De=me.searchValue,de=me.onSelect,re=me.onToggleOpen,oe=me.open,V=me.notFoundContent,Q=me.onMouseEnter,q=e.useContext(t),ee=q.checkable,ge=q.checkedKeys,we=q.halfCheckedKeys,Ne=q.treeExpandedKeys,Ge=q.treeDefaultExpandAll,Je=q.treeDefaultExpandedKeys,ze=q.onTreeExpand,qe=q.treeIcon,nt=q.showTreeIcon,$e=q.switcherIcon,gt=q.treeLine,ht=q.treeNodeFilterProp,bt=q.loadData,pt=q.treeLoadedKeys,it=q.treeMotion,_t=q.onTreeLoad,Tt=e.useRef(),Ve=Object(r.a)(function(){return Ue},[oe,Ue],function(He,Pe){return Pe[0]&&He[1]!==Pe[1]}),At=m(Be),We=Object(B.a)(At,2),Ye=We[0],rt=We[1],dt=p(Ye,rt),vt=Object(B.a)(dt,2),ut=vt[0],tt=vt[1],Ze=e.useMemo(function(){return ge.map(function(He){var Pe=tt(He);return Pe?Pe.key:null})},[ge]),et=e.useMemo(function(){return ee?{checked:Ze,halfChecked:we}:null},[Ze,we,ee]);e.useEffect(function(){if(oe&&!Ee&&Ze.length){var He;(He=Tt.current)===null||He===void 0||He.scrollTo({key:Ze[0]})}},[oe]);var st=String(De).toLowerCase(),ot=function(Pe){return st?String(Pe[ht]).toLowerCase().includes(st):!1},lt=e.useState(Je),ct=Object(B.a)(lt,2),Ct=ct[0],Mt=ct[1],Nt=e.useState(null),Wt=Object(B.a)(Nt,2),jt=Wt[0],Vt=Wt[1],Kt=e.useMemo(function(){return Ne?Object(L.a)(Ne):De?jt:Ct},[Ct,jt,st,Ne]);e.useEffect(function(){De&&Vt(Be.map(function(He){return He.key}))},[De]);var F=function(Pe){Mt(Pe),Vt(Pe),ze&&ze(Pe)},v=function(Pe){Pe.preventDefault()},x=function(Pe,Xe){var Ke=Xe.node.key,at=ut(Ke,ee?"checkbox":"select");at!==null&&de(at.data.value,{selected:!ge.includes(at.data.value)}),Ee||re(!1)},M=e.useState(null),K=Object(B.a)(M,2),N=K[0],ne=K[1],ke=ut(N);if(e.useImperativeHandle(_e,function(){return{onKeyDown:function(Pe){var Xe,Ke=Pe.which;switch(Ke){case s.a.UP:case s.a.DOWN:case s.a.LEFT:case s.a.RIGHT:(Xe=Tt.current)===null||Xe===void 0||Xe.onKeyDown(Pe);break;case s.a.ENTER:{ke!==null&&x(null,{node:{key:N},selected:!ge.includes(ke.data.value)});break}case s.a.ESC:re(!1)}},onKeyUp:function(){}}}),Ve.length===0)return e.createElement("div",{role:"listbox",className:"".concat(Se,"-empty"),onMouseDown:v},V);var je={};return pt&&(je.loadedKeys=pt),Kt&&(je.expandedKeys=Kt),e.createElement("div",{onMouseDown:v,onMouseEnter:Q},ke&&oe&&e.createElement("span",{style:E,"aria-live":"assertive"},ke.data.value),e.createElement(i.b,Object.assign({ref:Tt,focusable:!1,prefixCls:"".concat(Se,"-tree"),treeData:Ve,height:Ce,itemHeight:Oe,virtual:xe,multiple:Ee,icon:qe,showIcon:nt,switcherIcon:$e,showLine:gt,loadData:De?null:bt,motion:it,checkable:ee,checkStrictly:!0,checkedKeys:et,selectedKeys:ee?[]:Ze,defaultExpandAll:Ge},je,{onActiveChange:ne,onSelect:x,onCheck:x,onExpand:F,onLoad:_t,filterTreeNode:ot})))},h=e.forwardRef(_);h.displayName="OptionList";var u=h,d=function(){return null},f=d,T=W("Ff2n"),b=W("Zm9Q");function S(he){return Object(b.a)(he).map(function(me){if(!e.isValidElement(me)||!me.type)return null;var _e=me.key,Se=me.props,Ce=Se.children,Oe=Se.value,xe=Object(T.a)(Se,["children","value"]),Ue=Object(k.a)({key:_e,value:Oe},xe),Be=S(Ce);return Be.length&&(Ue.children=Be),Ue}).filter(function(me){return me})}function D(he){if(!he)return he;var me=Object(k.a)({},he);return"props"in me||Object.defineProperty(me,"props",{get:function(){return Object(o.a)(!1,"New `rc-tree-select` not support return node instance as argument anymore. Please consider to remove `props` access."),me}}),me}function I(he,me,_e,Se,Ce){var Oe=null,xe=null;function Ue(){function Be(Ee){var De=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"0",de=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return Ee.map(function(re,oe){var V="".concat(De,"-").concat(oe),Q=_e.includes(re.value),q=Be(re.children||[],V,Q),ee=e.createElement(f,Object.assign({},re),q.map(function(we){return we.node}));if(me===re.value&&(Oe=ee),Q){var ge={pos:V,node:ee,children:q};return de||xe.push(ge),ge}return null}).filter(function(re){return re})}xe||(xe=[],Be(Se),xe.sort(function(Ee,De){var de=Ee.node.props.value,re=De.node.props.value,oe=_e.indexOf(de),V=_e.indexOf(re);return oe-V}))}Object.defineProperty(he,"triggerNode",{get:function(){return Object(o.a)(!1,"`triggerNode` is deprecated. Please consider decoupling data with node."),Ue(),Oe}}),Object.defineProperty(he,"allCheckedNodes",{get:function(){return Object(o.a)(!1,"`allCheckedNodes` is deprecated. Please consider decoupling data with node."),Ue(),Ce?xe:xe.map(function(Ee){var De=Ee.node;return De})}})}function w(he){return Array.isArray(he)?he:he!==void 0?[he]:[]}function P(he,me){var _e=new Map;return me.forEach(function(Se){var Ce=Se.data;_e.set(Ce.value,Ce)}),he.map(function(Se){return D(_e.get(Se))})}function U(he,me){var _e=P([he],me)[0];return _e?_e.disabled:!1}function O(he){return he.disabled||he.disableCheckbox||he.checkable===!1}function G(he){for(var me=he.parent,_e=0,Se=me;Se;)Se=Se.parent,_e+=1;return _e}function z(he){function me(Se){return(Se||[]).map(function(Ce){var Oe=Ce.value,xe=Ce.key,Ue=Ce.children,Be=Object(k.a)(Object(k.a)({},Ce),{},{key:"key"in Ce?xe:Oe});return Ue&&(Be.children=me(Ue)),Be})}var _e=Object(c.d)(me(he),!0);return _e.map(function(Se){return{key:Se.data.key,data:Se.data,level:G(Se)}})}function ae(he){return function(me,_e){var Se=_e[he];return String(Se).toLowerCase().includes(String(me).toLowerCase())}}function ie(he,me,_e){var Se=_e.optionFilterProp,Ce=_e.filterOption;if(Ce===!1)return me;var Oe;typeof Ce=="function"?Oe=Ce:Oe=ae(Se);function xe(Ue){var Be=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Ue.map(function(Ee){var De=Ee.children,de=Be||Oe(he,D(Ee)),re=xe(De||[],de);return de||re.length?Object(k.a)(Object(k.a)({},Ee),{},{children:re}):null}).filter(function(Ee){return Ee})}return xe(me)}function fe(he,me,_e,Se){var Ce=new Map;return w(me).forEach(function(Oe){Oe&&Object(R.a)(Oe)==="object"&&"value"in Oe&&Ce.set(Oe.value,Oe)}),he.map(function(Oe){var xe={value:Oe},Ue=_e(Oe,"select",!0),Be=Ue?Se(Ue.data):Oe;if(Ce.has(Oe)){var Ee=Ce.get(Oe);xe.label="label"in Ee?Ee.label:Be,"halfChecked"in Ee&&(xe.halfChecked=Ee.halfChecked)}else xe.label=Be;return xe})}function ce(he,me){var _e=new Set(he);return _e.add(me),Array.from(_e)}function J(he,me){var _e=new Set(he);return _e.delete(me),Array.from(_e)}function Z(he){var me=he.searchPlaceholder,_e=he.treeCheckStrictly,Se=he.treeCheckable,Ce=he.labelInValue,Oe=he.value,xe=he.multiple;Object(o.a)(!me,"`searchPlaceholder` has been removed."),_e&&Ce===!1&&Object(o.a)(!1,"`treeCheckStrictly` will force set `labelInValue` to `true`."),(Ce||_e)&&Object(o.a)(w(Oe).every(function(Ue){return Ue&&Object(R.a)(Ue)==="object"&&"value"in Ue}),"Invalid prop `value` supplied to `TreeSelect`. You should use { label: string, value: string | number } or [{ label: string, value: string | number }] instead."),_e||xe||Se?Object(o.a)(!Oe||Array.isArray(Oe),"`value` should be an array when `TreeSelect` is checkable or multiple."):Object(o.a)(!Array.isArray(Oe),"`value` should not be array when `TreeSelect` is single mode.")}var ue=Z,X=10;function $(he,me){var _e=me.id,Se=me.pId,Ce=me.rootPId,Oe={},xe=[],Ue=he.map(function(Be){var Ee=Object(k.a)({},Be),De=Ee[_e];return Oe[De]=Ee,Ee.key=Ee.key||De,Ee});return Ue.forEach(function(Be){var Ee=Be[Se],De=Oe[Ee];De&&(De.children=De.children||[],De.children.push(Be)),(Ee===Ce||!De&&Ce===null)&&xe.push(Be)}),xe}function be(he,me){var _e=0,Se=new Set;function Ce(Oe){return(Oe||[]).map(function(xe){var Ue=xe.key,Be=xe.value,Ee=xe.children,De=Object(T.a)(xe,["key","value","children"]),de="value"in xe?Be:Ue,re=Object(k.a)(Object(k.a)({},De),{},{key:Ue!=null?Ue:de,value:de,title:me(xe)});return"children"in xe&&(re.children=Ce(Ee)),re})}return Ce(he)}function Re(he,me,_e){var Se=_e.getLabelProp,Ce=_e.simpleMode,Oe=e.useRef({});return he?(Oe.current.formatTreeData=Oe.current.treeData===he?Oe.current.formatTreeData:be(Ce?$(he,Object(k.a)({id:"id",pId:"pId",rootPId:null},Ce!==!0?Ce:{})):he,Se),Oe.current.treeData=he):Oe.current.formatTreeData=Oe.current.children===me?Oe.current.formatTreeData:be(S(me),Se),Oe.current.formatTreeData}var Ie="SHOW_ALL",Le="SHOW_PARENT",Fe="SHOW_CHILD";function ye(he,me,_e){var Se=new Set(he);return me===Fe?he.filter(function(Ce){var Oe=_e[Ce];return!(Oe&&Oe.children&&Oe.children.every(function(xe){var Ue=xe.node;return O(Ue)||Se.has(Ue.key)}))}):me===Le?he.filter(function(Ce){var Oe=_e[Ce],xe=Oe?Oe.parent:null;return!(xe&&!O(xe.node)&&Se.has(xe.node.key))}):he}function Te(he,me){var _e=me.value,Se=me.getEntityByValue,Ce=me.getEntityByKey,Oe=me.treeConduction,xe=me.showCheckedStrategy,Ue=me.conductKeyEntities,Be=me.getLabelProp;return e.useMemo(function(){var Ee=he;if(Oe){var De=ye(he.map(function(de){var re=Se(de);return re?re.key:de}),xe,Ue);Ee=De.map(function(de){var re=Ce(de);return re?re.data.value:de})}return fe(Ee,_e,Se,Be)},[he,_e,Oe,xe,Se])}var Ae=["expandedKeys","treeData","treeCheckable","showCheckedStrategy","searchPlaceholder","treeLine","treeIcon","showTreeIcon","switcherIcon","treeNodeFilterProp","filterTreeNode","dropdownPopupAlign","treeDefaultExpandAll","treeCheckStrictly","treeExpandedKeys","treeLoadedKeys","treeMotion","onTreeExpand","onTreeLoad","loadData","treeDataSimpleMode","treeNodeLabelProp","treeDefaultExpandedKeys"],Y=Object(A.a)({prefixCls:"rc-tree-select",components:{optionList:u},convertChildrenToData:function(){return null},flattenOptions:z,getLabeledValue:g.e,filterOptions:ie,isValueDisabled:U,findValueOption:P,omitDOMProps:function(me){var _e=Object(k.a)({},me);return Ae.forEach(function(Se){delete _e[Se]}),_e}});Y.displayName="Select";var se=e.forwardRef(function(he,me){var _e=he.multiple,Se=he.treeCheckable,Ce=he.treeCheckStrictly,Oe=he.showCheckedStrategy,xe=Oe===void 0?"SHOW_CHILD":Oe,Ue=he.labelInValue,Be=he.loadData,Ee=he.treeLoadedKeys,De=he.treeNodeFilterProp,de=De===void 0?"value":De,re=he.treeNodeLabelProp,oe=he.treeDataSimpleMode,V=he.treeData,Q=he.treeExpandedKeys,q=he.treeDefaultExpandedKeys,ee=he.treeDefaultExpandAll,ge=he.children,we=he.treeIcon,Ne=he.showTreeIcon,Ge=he.switcherIcon,Je=he.treeLine,ze=he.treeMotion,qe=he.filterTreeNode,nt=he.dropdownPopupAlign,$e=he.onChange,gt=he.onTreeExpand,ht=he.onTreeLoad,bt=he.onDropdownVisibleChange,pt=he.onSelect,it=he.onDeselect,_t=Se||Ce,Tt=_e||_t,Ve=Se&&!Ce,At=Ce||Ue,We=e.useRef(null);e.useImperativeHandle(me,function(){return{focus:We.current.focus,blur:We.current.blur}});var Ye=function(Ke){return V&&Ke.label||Ke.title},rt=function(Ke){return re?Ke[re]:Ye(Ke)},dt=Re(V,ge,{getLabelProp:Ye,simpleMode:oe}),vt=Object(e.useMemo)(function(){return z(dt)},[dt]),ut=m(vt),tt=Object(B.a)(ut,2),Ze=tt[0],et=tt[1],st=p(Ze,et),ot=Object(B.a)(st,2),lt=ot[0],ct=ot[1],Ct=Object(e.useMemo)(function(){return Ve?Object(c.a)(dt):{keyEntities:null}},[dt,Se,Ce]),Mt=Ct.keyEntities,Nt=Object(a.a)(he.defaultValue,{value:he.value}),Wt=Object(B.a)(Nt,2),jt=Wt[0],Vt=Wt[1],Kt=function(Ke){var at=[],St=[];return Ke.forEach(function(xt){ct(xt)?St.push(xt):at.push(xt)}),{missingRawValues:at,existRawValues:St}},F=Object(e.useMemo)(function(){var Xe=[],Ke=[];if(w(jt).forEach(function(yt){if(yt&&Object(R.a)(yt)==="object"&&"value"in yt)if(yt.halfChecked&&Ce){var Rt=ct(yt.value);Xe.push(Rt?Rt.key:yt.value)}else Ke.push(yt.value);else Ke.push(yt)}),Ve){var at=Kt(Ke),St=at.missingRawValues,xt=at.existRawValues,Et=xt.map(function(yt){return ct(yt).key}),Ot=Object(l.a)(Et,!0,Mt),Ht=Ot.checkedKeys,Ft=Ot.halfCheckedKeys;return[[].concat(Object(L.a)(St),Object(L.a)(Ht.map(function(yt){return lt(yt).data.value}))),Ft]}return[Ke,Xe]},[jt,Tt,At,Se,Ce]),v=Object(B.a)(F,2),x=v[0],M=v[1],K=Te(x,{treeConduction:Ve,value:jt,showCheckedStrategy:xe,conductKeyEntities:Mt,getEntityByValue:ct,getEntityByKey:lt,getLabelProp:rt}),N=function(Ke,at,St){if(Vt(Tt?Ke:Ke[0]),$e){var xt=Ke;if(Ve&&xe!=="SHOW_ALL"){var Et=Ke.map(function(It){var kt=ct(It);return kt?kt.key:It}),Ot=ye(Et,xe,Mt);xt=Ot.map(function(It){var kt=lt(It);return kt?kt.data.value:It})}var Ht=at||{triggerValue:void 0,selected:void 0},Ft=Ht.triggerValue,yt=Ht.selected,Rt=At?fe(xt,jt,ct,rt):xt;if(Ce){var Gt=M.map(function(It){var kt=lt(It);return kt?kt.data.value:It}).filter(function(It){return!xt.includes(It)});Rt=[].concat(Object(L.a)(Rt),Object(L.a)(fe(Gt,jt,ct,rt)))}var Lt={preValue:K,triggerValue:Ft},Yt=!0;(Ce||St==="selection"&&!yt)&&(Yt=!1),I(Lt,Ft,Ke,dt,Yt),_t?Lt.checked=yt:Lt.selected=yt,$e(Tt?Rt:Rt[0],At?null:xt.map(function(It){var kt=ct(It);return kt?rt(kt.data):null}),Lt)}},ne=function(Ke,at,St){var xt=Ke;if(!Tt)N([Ke],{selected:!0,triggerValue:Ke},St);else{var Et=ce(x,Ke);if(Ve){var Ot=Kt(Et),Ht=Ot.missingRawValues,Ft=Ot.existRawValues,yt=Ft.map(function(Lt){return ct(Lt).key}),Rt=Object(l.a)(yt,!0,Mt),Gt=Rt.checkedKeys;Et=[].concat(Object(L.a)(Ht),Object(L.a)(Gt.map(function(Lt){return lt(Lt).data.value})))}N(Et,{selected:!0,triggerValue:Ke},St)}pt&&pt(xt,at)},ke=function(Ke,at,St){var xt=Ke,Et=J(x,Ke);if(Ve){var Ot=Kt(Et),Ht=Ot.missingRawValues,Ft=Ot.existRawValues,yt=Ft.map(function(Lt){return ct(Lt).key}),Rt=Object(l.a)(yt,{checked:!1,halfCheckedKeys:M},Mt),Gt=Rt.checkedKeys;Et=[].concat(Object(L.a)(Ht),Object(L.a)(Gt.map(function(Lt){return lt(Lt).data.value})))}N(Et,{selected:!1,triggerValue:Ke},St),it&&it(xt,at)},je=function(){N([],null,"clear")},He=e.useCallback(function(Xe){if(bt){var Ke={};Object.defineProperty(Ke,"documentClickClose",{get:function(){return Object(o.a)(!1,"Second param of `onDropdownVisibleChange` has been removed."),!1}}),bt(Xe,Ke)}},[bt]),Pe={optionLabelProp:null,optionFilterProp:de,dropdownAlign:nt,internalProps:{mark:n.a,onClear:je,skipTriggerChange:!0,skipTriggerSelect:!0,onRawSelect:ne,onRawDeselect:ke}};return"filterTreeNode"in he&&(Pe.filterOption=qe),e.createElement(t.Provider,{value:{checkable:_t,loadData:Be,treeLoadedKeys:Ee,onTreeLoad:ht,checkedKeys:x,halfCheckedKeys:M,treeDefaultExpandAll:ee,treeExpandedKeys:Q,treeDefaultExpandedKeys:q,onTreeExpand:gt,treeIcon:we,treeMotion:ze,showTreeIcon:Ne,switcherIcon:Ge,treeLine:Je,treeNodeFilterProp:de}},e.createElement(Y,Object.assign({ref:We,mode:Tt?"multiple":null},he,Pe,{value:K,labelInValue:!0,options:dt,onChange:null,onSelect:null,onDeselect:null,onDropdownVisibleChange:He})))}),pe=function(he){Object(C.a)(_e,he);var me=Object(j.a)(_e);function _e(){var Se;return Object(te.a)(this,_e),Se=me.apply(this,arguments),Se.selectRef=e.createRef(),Se.focus=function(){Se.selectRef.current.focus()},Se.blur=function(){Se.selectRef.current.blur()},Se}return Object(H.a)(_e,[{key:"render",value:function(){return e.createElement(se,Object.assign({ref:this.selectRef},this.props))}}]),_e}(e.Component);pe.TreeNode=f,pe.SHOW_ALL=Ie,pe.SHOW_PARENT=Le,pe.SHOW_CHILD=Fe;var ve=pe,Me=le.e=ve},"8hTe":function(Qe,le,W){Qe.exports={button:"button___1wy9m"}},"9Bee":function(Qe,le,W){"use strict";var te=W("DYRE"),H=W("zeV3"),C=W("+L6B"),j=W("2/Rp"),L=W("k1fw"),R=W("9og8"),B=W("tJVT"),k=W("WmNS"),e=W.n(k),A=W("q1tI"),g=W.n(A),c=W("vg9a"),l=W("DlQD"),n=W.n(l),a=W("rUJ1");function o(F,v){var x=F.match(/^(\s+)(?:```)/);if(x===null)return v;var M=x[1];return v.split(`
`).map(function(K){var N=K.match(/^\s+/);if(N===null)return K;var ne=Object(B.a)(N,1),ke=ne[0];return ke.length>=M.length?K.slice(M.length):K}).join(`
`)}var s=[],r=["<ul>"],i=new n.a.Renderer,t=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function y(){s.length=0,r=["<ul>"]}var p={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function m(F,v,x,M){if(v>=F.length||F[v].level<=x)return v;var K=F[v];M.push("<li><a href='#"+K.anchor+"'>"+K.text+"</a>"),v++;var N=[];return v=m(F,v,K.level,N),N.length>0&&(M.push("<ul>"),N.forEach(function(ne){M.push(ne)}),M.push("</ul>")),M.push("</li>"),v=m(F,v,x,M),v}function E(){return m(s,0,0,r),r.push("</ul>"),r.join("")}var _={heading:function(v){var x=t.exec(v);if(x)return{type:"heading",raw:x[0],depth:x[1].length,text:x[2]}},fences:function(v){var x=this.rules.block.fences.exec(v);if(x){var M=x[0],K=o(M,x[3]||""),N=x[2]?x[2].trim():x[2];if(["latex","katex","math"].indexOf(N)>=0){var ne=d(),ke=K;K=ne,f[ne]={type:"block",expression:ke}}return{type:"code",raw:M,lang:N,text:K}}}},h=/(?:\${2})([^\n`]+?)(?:\${2})/gi,u=0,d=function(){return"__special_katext_id_".concat(u++,"__")},f={};function T(){return f}function b(){u=0,f={}}function S(F){return F=F.replace(h,function(v,x){var M=d();return f[M]={type:"inline",expression:x},M}),F}var D=i.listitem;i.listitem=function(F){return D(S(F))};var I=i.paragraph;i.paragraph=function(F){return I(S(F))};var w=i.tablecell;i.tablecell=function(F,v){return w(S(F),v)},i.code=function(F,v,x){var M=(v||"").match(/\S*/)[0];return M?["latex","katex","math"].indexOf(M)>=0?"<p class='editormd-tex'>".concat(F,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(v,'">').concat(x?F:Object(a.escape)(F,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(x?F:Object(a.escape)(F,!0))+"</code></pre>"},i.heading=function(F,v,x){var M=this.options.headerPrefix+x.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return s.push({anchor:M,level:v,text:F}),"<h"+v+' id="'+M+'">'+F+"</h"+v+">"},n.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),n.a.use({tokenizer:_,renderer:i});var P=n.a,U=W("SJMd"),O=W("ulZh"),G=W.n(O),z=W("m3rI"),ae=W("Oy/b"),ie=W("p5ED"),fe=W("ErOA");/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var ce=function(F,v){return(ce=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,M){x.__proto__=M}||function(x,M){for(var K in M)Object.prototype.hasOwnProperty.call(M,K)&&(x[K]=M[K])})(F,v)};function J(F,v){function x(){this.constructor=F}ce(F,v),F.prototype=v===null?Object.create(v):(x.prototype=v.prototype,new x)}function Z(F,v,x,M){return new(x||(x=Promise))(function(K,N){function ne(He){try{je(M.next(He))}catch(Pe){N(Pe)}}function ke(He){try{je(M.throw(He))}catch(Pe){N(Pe)}}function je(He){var Pe;He.done?K(He.value):(Pe=He.value,Pe instanceof x?Pe:new x(function(Xe){Xe(Pe)})).then(ne,ke)}je((M=M.apply(F,v||[])).next())})}function ue(F,v){var x,M,K,N,ne={label:0,sent:function(){if(1&K[0])throw K[1];return K[1]},trys:[],ops:[]};return N={next:ke(0),throw:ke(1),return:ke(2)},typeof Symbol=="function"&&(N[Symbol.iterator]=function(){return this}),N;function ke(je){return function(He){return function(Pe){if(x)throw new TypeError("Generator is already executing.");for(;ne;)try{if(x=1,M&&(K=2&Pe[0]?M.return:Pe[0]?M.throw||((K=M.return)&&K.call(M),0):M.next)&&!(K=K.call(M,Pe[1])).done)return K;switch(M=0,K&&(Pe=[2&Pe[0],K.value]),Pe[0]){case 0:case 1:K=Pe;break;case 4:return ne.label++,{value:Pe[1],done:!1};case 5:ne.label++,M=Pe[1],Pe=[0];continue;case 7:Pe=ne.ops.pop(),ne.trys.pop();continue;default:if(!(K=ne.trys,(K=K.length>0&&K[K.length-1])||Pe[0]!==6&&Pe[0]!==2)){ne=0;continue}if(Pe[0]===3&&(!K||Pe[1]>K[0]&&Pe[1]<K[3])){ne.label=Pe[1];break}if(Pe[0]===6&&ne.label<K[1]){ne.label=K[1],K=Pe;break}if(K&&ne.label<K[2]){ne.label=K[2],ne.ops.push(Pe);break}K[2]&&ne.ops.pop(),ne.trys.pop();continue}Pe=v.call(F,ne)}catch(Xe){Pe=[6,Xe],M=0}finally{x=K=0}if(5&Pe[0])throw Pe[1];return{value:Pe[0]?Pe[1]:void 0,done:!0}}([je,He])}}}function X(){for(var F=0,v=0,x=arguments.length;v<x;v++)F+=arguments[v].length;var M=Array(F),K=0;for(v=0;v<x;v++)for(var N=arguments[v],ne=0,ke=N.length;ne<ke;ne++,K++)M[K]=N[ne];return M}var $=function(){function F(){}return F.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},F.setAttributes=function(v,x){for(var M=0,K=x;M<K.length;M++){var N=K[M],ne=N[0],ke=N[1];v.setAttribute(ne,ke)}},F.createRect=function(v,x,M){var K=document.createElementNS("http://www.w3.org/2000/svg","rect");return K.setAttribute("width",v.toString()),K.setAttribute("height",x.toString()),M&&F.setAttributes(K,M),K},F.createLine=function(v,x,M,K,N){var ne=document.createElementNS("http://www.w3.org/2000/svg","line");return ne.setAttribute("x1",v.toString()),ne.setAttribute("y1",x.toString()),ne.setAttribute("x2",M.toString()),ne.setAttribute("y2",K.toString()),N&&F.setAttributes(ne,N),ne},F.createPolygon=function(v,x){var M=document.createElementNS("http://www.w3.org/2000/svg","polygon");return M.setAttribute("points",v),x&&F.setAttributes(M,x),M},F.createCircle=function(v,x){var M=document.createElementNS("http://www.w3.org/2000/svg","circle");return M.setAttribute("cx",(v/2).toString()),M.setAttribute("cy",(v/2).toString()),M.setAttribute("r",v.toString()),x&&F.setAttributes(M,x),M},F.createEllipse=function(v,x,M){var K=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return K.setAttribute("cx",(v/2).toString()),K.setAttribute("cy",(x/2).toString()),K.setAttribute("rx",(v/2).toString()),K.setAttribute("ry",(x/2).toString()),M&&F.setAttributes(K,M),K},F.createGroup=function(v){var x=document.createElementNS("http://www.w3.org/2000/svg","g");return v&&F.setAttributes(x,v),x},F.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},F.createMarker=function(v,x,M,K,N,ne,ke){var je=document.createElementNS("http://www.w3.org/2000/svg","marker");return F.setAttributes(je,[["id",v],["orient",x],["markerWidth",M.toString()],["markerHeight",K.toString()],["refX",N.toString()],["refY",ne.toString()]]),je.appendChild(ke),je},F.createText=function(v){var x=document.createElementNS("http://www.w3.org/2000/svg","text");return x.setAttribute("x","0"),x.setAttribute("y","0"),v&&F.setAttributes(x,v),x},F.createTSpan=function(v,x){var M=document.createElementNS("http://www.w3.org/2000/svg","tspan");return M.textContent=v,x&&F.setAttributes(M,x),M},F.createImage=function(v){var x=document.createElementNS("http://www.w3.org/2000/svg","image");return v&&F.setAttributes(x,v),x},F.createPoint=function(v,x){var M=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return M.x=v,M.y=x,M},F.createPath=function(v,x){var M=document.createElementNS("http://www.w3.org/2000/svg","path");return M.setAttribute("d",v),x&&F.setAttributes(M,x),M},F}(),be=function(){function F(){}return F.addKey=function(v){F.key=v},Object.defineProperty(F,"isLicensed",{get:function(){return!!F.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(F.key)},enumerable:!1,configurable:!0}),F}(),Re=function(){function F(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return F.prototype.rasterize=function(v,x,M){var K=this;return new Promise(function(N){var ne=M!==void 0?M:document.createElement("canvas");v===null&&(K.markersOnly=!0,K.naturalSize=!1);var ke=document.createElementNS("http://www.w3.org/2000/svg","svg");ke.setAttribute("xmlns","http://www.w3.org/2000/svg"),ke.setAttribute("width",x.width.baseVal.valueAsString),ke.setAttribute("height",x.height.baseVal.valueAsString),ke.setAttribute("viewBox","0 0 "+x.viewBox.baseVal.width.toString()+" "+x.viewBox.baseVal.height.toString()),ke.innerHTML=x.innerHTML,K.naturalSize===!0?(ke.width.baseVal.value=v.naturalWidth,ke.height.baseVal.value=v.naturalHeight):K.width!==void 0&&K.height!==void 0&&(ke.width.baseVal.value=K.width,ke.height.baseVal.value=K.height),ne.width=ke.width.baseVal.value,ne.height=ke.height.baseVal.value;var je=ke.outerHTML,He=ne.getContext("2d");K.markersOnly!==!0&&He.drawImage(v,0,0,ne.width,ne.height);var Pe=window.URL,Xe=new Image(ne.width,ne.height);Xe.setAttribute("crossOrigin","anonymous");var Ke=new Blob([je],{type:"image/svg+xml"}),at=Pe.createObjectURL(Ke);Xe.onload=function(){He.drawImage(Xe,0,0),Pe.revokeObjectURL(at);var St=ne.toDataURL(K.imageType,K.imageQuality);N(St)},Xe.src=at})},F}(),Ie=function(){},Le=function(){function F(v){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+v+"_"}return Object.defineProperty(F.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#ffffff",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarColor:"#eeeeee",toolbarHeight:40,toolboxColor:"#eeeeee",toolboxAccentColor:"#3080c3",undoButtonVisible:!0,redoButtonVisible:!1,zoomButtonVisible:!1,zoomOutButtonVisible:!1,clearButtonVisible:!1,resultButtonBlockVisible:!0,logoPosition:"left"}},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),F.prototype.addClass=function(v){return this.styleSheet===void 0&&this.addStyleSheet(),v.name=""+this.classNamePrefix+v.localName,this.classes.push(v),this.styleSheet.sheet.insertRule("."+v.name+" {"+v.style+"}",this.styleSheet.sheet.cssRules.length),v},F.prototype.addRule=function(v){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(v),this.styleSheet.sheet.insertRule(v.selector+" {"+v.style+"}",this.styleSheet.sheet.cssRules.length)},F.prototype.addStyleSheet=function(){var v;this.styleSheet=document.createElement("style"),((v=this.styleSheetRoot)!==null&&v!==void 0?v:document.head).appendChild(this.styleSheet),this.addRule(new Fe("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Fe("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new Fe("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new ye("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new ye("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},F.prototype.removeStyleSheet=function(){var v;this.styleSheet&&(((v=this.styleSheetRoot)!==null&&v!==void 0?v:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},F}(),Fe=function(F,v){this.selector=F,this.style=v},ye=function(F,v){this.localName=F,this.style=v},Te=function(){function F(v,x,M,K,N){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=v,this.displayMode=x,this.markerItems=M,this.uiStyleSettings=K,this.styles=N,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return F.prototype.show=function(v){var x=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=v,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var M=document.createElement("div");M.className=this.toolbarBlockStyleClass.name,M.style.whiteSpace="nowrap",this.uiContainer.appendChild(M),this.addActionButton(M,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(M,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(M,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(M,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(M,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(M,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(M,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(M,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(N){var ne=document.createElement("div");ne.className=""+x.toolbarButtonStyleClass.name,ne.setAttribute("data-type-name",N.typeName),ne.innerHTML=N.icon,ne.addEventListener("click",function(){x.markerToolbarButtonClicked(ne,N)}),x.buttons.push(ne),x.markerButtons.push(ne)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var K=document.createElement("div");K.className=this.toolbarBlockStyleClass.name,K.style.whiteSpace="nowrap",K.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(K),this.addActionButton(K,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render"),this.addActionButton(K,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},F.prototype.addButtonClickListener=function(v){this.buttonClickListeners.push(v)},F.prototype.removeButtonClickListener=function(v){this.buttonClickListeners.indexOf(v)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(v),1)},F.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},F.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var v=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var x=0;x<this.markerButtons.length;x++)x<v||x===v&&this.markerButtons.length-1===v?this.markerButtonBlock.appendChild(this.markerButtons[x]):(x===v&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[x]))}},F.prototype.overflowButtonClicked=function(){this.markerButtonOverflowBlock.style.display!=="none"?(this.markerButtonOverflowBlock.className=this.markerButtonOverflowBlock.className.replace(this.styles.fadeInAnimationClassName,""),this.markerButtonOverflowBlock.style.display="none"):(this.markerButtonOverflowBlock.className+=" "+this.styles.fadeInAnimationClassName,this.markerButtonOverflowBlock.style.top=this.uiContainer.offsetTop+this.overflowButton.offsetHeight+"px",this.markerButtonOverflowBlock.style.right=this.uiContainer.offsetWidth-this.overflowButton.offsetLeft-this.overflowButton.offsetWidth+2*this.uiContainer.offsetLeft+"px",this.markerButtonOverflowBlock.style.display="inline-block")},F.prototype.resetButtonStyles=function(){var v=this;this.buttons.forEach(function(x){x.className=x.className.replace(v.uiStyleSettings.toolbarButtonStyleColorsClassName?v.uiStyleSettings.toolbarButtonStyleColorsClassName:v.toolbarButtonStyleColorsClass.name,"").trim(),x.className=x.className.replace(v.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?v.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:v.toolbarActiveButtonStyleColorsClass.name,"").trim(),x.className+=" "+(v.uiStyleSettings.toolbarButtonStyleColorsClassName?v.uiStyleSettings.toolbarButtonStyleColorsClassName:v.toolbarButtonStyleColorsClass.name)})},F.prototype.addActionButton=function(v,x,M){var K=this,N=document.createElement("div");switch(N.className=""+this.toolbarButtonStyleClass.name,N.innerHTML=x,N.setAttribute("data-action",M),N.addEventListener("click",function(){K.actionToolbarButtonClicked(N,M)}),M){case"select":N.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":N.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":N.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":N.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":N.style.fill=this.uiStyleSettings.closeButtonColor}v.appendChild(N),this.buttons.push(N)},F.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new ye("toolbar",`
width: 100%;
flex-shrink: 0;
display: flex;
flex-direction: row;
justify-content: space-between;
height: `+this.uiStyleSettings.toolbarHeight+`px;
box-sizing: content-box;
`+(this.displayMode==="inline"?"border-top-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
`+(this.displayMode==="inline"?"border-top-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
overflow: hidden;
`)),this.toolbarStyleColorsClass=this.styles.addClass(new ye("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new ye("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new ye("toolbar-overflow-block",`
position: absolute;
top: `+this.uiStyleSettings.toolbarHeight+`px;
max-width: `+2*this.uiStyleSettings.toolbarHeight+`px;
z-index: 10;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleColorsClass=this.styles.addClass(new ye("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var v=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new ye("toolbar_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*v)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*v)+`px;
padding: `+v+`px;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new ye("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new ye("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Fe("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new Fe("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},F.prototype.markerToolbarButtonClicked=function(v,x){this.setActiveButton(v),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(M){return M("marker",x)}),this.markerButtonOverflowBlock.style.display="none"},F.prototype.actionToolbarButtonClicked=function(v,x){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(M){return M("action",x)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},F.prototype.setActiveButton=function(v){this.resetButtonStyles(),v.className=v.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),v.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},F.prototype.setActiveMarkerButton=function(v){var x=this.markerButtons.find(function(M){return M.getAttribute("data-type-name")===v});x&&this.setActiveButton(x)},F.prototype.setCurrentMarker=function(v){var x=this;this.currentMarker=v,this.buttons.filter(function(M){return/delete|notes/.test(M.getAttribute("data-action"))}).forEach(function(M){x.currentMarker===void 0?(M.style.fillOpacity="0.4",M.style.pointerEvents="none"):(M.style.fillOpacity="1",M.style.pointerEvents="all")})},F}(),Ae=function(){function F(v,x,M,K){this.panels=[],this.panelButtons=[],this.markerjsContainer=v,this.displayMode=x,this.uiStyleSettings=M,this.styles=K,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return F.prototype.addStyles=function(){var v;this.toolboxStyleClass=this.styles.addClass(new ye("toolbox",`
width: 100%;
flex-shrink: 0;
display: flex;
flex-direction: column;
font-family: sans-serif;
`+(this.displayMode==="popup"?"height:"+2.5*this.uiStyleSettings.toolbarHeight+"px;":"")+`
box-sizing: content-box;
`+(this.displayMode==="popup"?"background-color: "+this.uiStyleSettings.canvasBackgroundColor+";":"")+`
`+(this.displayMode==="inline"?"border-bottom-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
`+(this.displayMode==="inline"?"border-bottom-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
overflow: hidden;
`)),this.toolboxStyleColorsClass=this.styles.addClass(new ye("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var x=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new ye("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new ye("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new ye("toolbox-panel-row",`
display: flex;
`+(this.displayMode==="inline"?"position: absolute;":"")+`
`+(this.displayMode==="inline"?"bottom: "+this.uiStyleSettings.toolbarHeight+"px;":"")+`
cursor: default;
height: `+1.5*this.uiStyleSettings.toolbarHeight+`px;
`+(this.displayMode==="inline"?"width: 100%;":"")+`
box-sizing: content-box;
`)),this.toolboxPanelRowStyleColorsClass=this.styles.addClass(new ye("toolbox-panel-row_colors",`
background-color: `+((v=this.uiStyleSettings.toolboxBackgroundColor)!==null&&v!==void 0?v:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new ye("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*x)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*x)+`px;
padding: `+x+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new ye("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new ye("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new Fe("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Fe("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},F.prototype.show=function(v){var x;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=v,this.uiContainer.className=this.toolboxStyleClass.name+" "+((x=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&x!==void 0?x:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},F.prototype.setPanelButtons=function(v){var x,M,K=this;this.panels=v,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((x=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&x!==void 0?x:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((M=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&M!==void 0?M:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(N){var ne;N.uiStyleSettings=K.uiStyleSettings;var ke=document.createElement("div");ke.className=K.toolboxButtonStyleClass.name+" "+((ne=K.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&ne!==void 0?ne:K.toolboxButtonStyleColorsClass.name),ke.innerHTML=N.icon,ke.title=N.title,ke.addEventListener("click",function(){K.panelButtonClick(N)}),K.panelButtons.push(ke),K.buttonRow.appendChild(ke)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},F.prototype.panelButtonClick=function(v){var x=this,M=-1;if(v!==this.activePanel){M=this.panels.indexOf(v),this.panelRow.innerHTML="";var K=v.getUi();K.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(K),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=v}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){x.displayMode==="inline"?x.panelRow.style.display="none":x.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(N,ne){var ke,je;N.className=x.toolboxButtonStyleClass.name+" "+(ne===M?""+((ke=x.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&ke!==void 0?ke:x.toolboxActiveButtonStyleColorsClass.name):""+((je=x.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&je!==void 0?je:x.toolboxButtonStyleColorsClass.name))})},F}(),Y=function(F,v){this.title=F,this.icon=v},se=function(F){function v(x,M,K,N){var ne=F.call(this,x,N||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return ne.colors=[],ne.addTransparent=!1,ne.colorBoxes=[],ne.colors=M,ne.currentColor=K,ne.setCurrentColor=ne.setCurrentColor.bind(ne),ne.getColorBox=ne.getColorBox.bind(ne),ne}return J(v,F),v.prototype.getUi=function(){var x=this,M=document.createElement("div");return M.style.overflow="hidden",M.style.whiteSpace="nowrap",this.colors.forEach(function(K){var N=x.getColorBox(K);M.appendChild(N),x.colorBoxes.push(N)}),M},v.prototype.getColorBox=function(x){var M=this,K=this.uiStyleSettings.toolbarHeight/4,N=this.uiStyleSettings.toolbarHeight-K,ne=document.createElement("div");ne.style.display="inline-block",ne.style.boxSizing="content-box",ne.style.width=N-2+"px",ne.style.height=N-2+"px",ne.style.padding="1px",ne.style.marginRight="2px",ne.style.marginBottom="2px",ne.style.borderWidth="2px",ne.style.borderStyle="solid",ne.style.borderRadius=(N+2)/2+"px",ne.style.borderColor=x===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",ne.addEventListener("click",function(){M.setCurrentColor(x,ne)});var ke=document.createElement("div");return ke.style.display="inline-block",ke.style.width=N-2+"px",ke.style.height=N-2+"px",ke.style.backgroundColor=x,ke.style.borderRadius=N/2+"px",x==="transparent"&&(ke.style.fill=this.uiStyleSettings.toolboxAccentColor,ke.innerHTML=`<svg viewBox="0 0 24 24">
<path d="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z" />
</svg>`),ne.appendChild(ke),ne},v.prototype.setCurrentColor=function(x,M){var K=this;this.currentColor=x,this.colorBoxes.forEach(function(N){N.style.borderColor=N===M?K.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(x)},v}(Y),pe=function(){function F(v,x,M){this._state="new",this._isSelected=!1,this._container=v,this._overlayContainer=x,this.globalSettings=M,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(F.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),F.prototype.ownsTarget=function(v){return!1},Object.defineProperty(F.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),F.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},F.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},F.prototype.pointerDown=function(v,x){},F.prototype.dblClick=function(v,x){},F.prototype.manipulate=function(v){},F.prototype.pointerUp=function(v){this.stateChanged()},F.prototype.dispose=function(){},F.prototype.addMarkerVisualToContainer=function(v){this.container.childNodes.length>0?this.container.insertBefore(v,this.container.childNodes[0]):this.container.appendChild(v)},F.prototype.getState=function(){return{typeName:F.typeName,state:this.state,notes:this.notes}},F.prototype.restoreState=function(v){this._state=v.state,this.notes=v.notes},F.prototype.scale=function(v,x){},F.prototype.colorChanged=function(v){this.onColorChanged&&this.onColorChanged(v),this.stateChanged()},F.prototype.fillColorChanged=function(v){this.onFillColorChanged&&this.onFillColorChanged(v),this.stateChanged()},F.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var v=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),v.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(v)&&this.onStateChanged(this)}},F.typeName="MarkerBase",F}(),ve=function(){function F(){this.findGripByVisual=this.findGripByVisual.bind(this)}return F.prototype.findGripByVisual=function(v){return this.topLeft.ownsTarget(v)?this.topLeft:this.topCenter.ownsTarget(v)?this.topCenter:this.topRight.ownsTarget(v)?this.topRight:this.centerLeft.ownsTarget(v)?this.centerLeft:this.centerRight.ownsTarget(v)?this.centerRight:this.bottomLeft.ownsTarget(v)?this.bottomLeft:this.bottomCenter.ownsTarget(v)?this.bottomCenter:this.bottomRight.ownsTarget(v)?this.bottomRight:void 0},F}(),Me=function(){function F(){this.GRIP_SIZE=10,this.visual=$.createGroup(),this.visual.appendChild($.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild($.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return F.prototype.ownsTarget=function(v){return v===this.visual||v===this.visual.childNodes[0]||v===this.visual.childNodes[1]},F}(),he=function(){function F(){}return F.toITransformMatrix=function(v){return{a:v.a,b:v.b,c:v.c,d:v.d,e:v.e,f:v.f}},F.toSVGMatrix=function(v,x){return v.a=x.a,v.b=x.b,v.c=x.c,v.d=x.d,v.e=x.e,v.f=x.f,v},F}(),me=function(F){function v(x,M,K){var N=F.call(this,x,M,K)||this;return N.left=0,N.top=0,N.width=0,N.height=0,N.defaultSize={x:50,y:20},N.offsetX=0,N.offsetY=0,N.rotationAngle=0,N.CB_DISTANCE=10,N._suppressMarkerCreateEvent=!1,N.container.transform.baseVal.appendItem($.createTransform()),N.setupControlBox(),N}return J(v,F),Object.defineProperty(v.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"visual",{get:function(){return this._visual},set:function(x){this._visual=x;var M=$.createTransform();this._visual.transform.baseVal.appendItem(M)},enumerable:!1,configurable:!0}),v.prototype.ownsTarget=function(x){return!!F.prototype.ownsTarget.call(this,x)||!!(this.controlGrips.findGripByVisual(x)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(x))},v.prototype.pointerDown=function(x,M){F.prototype.pointerDown.call(this,x,M),this.state==="new"&&(this.left=x.x,this.top=x.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var K=this.unrotatePoint(x);if(this.manipulationStartX=K.x,this.manipulationStartY=K.y,this.offsetX=K.x-this.left,this.offsetY=K.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(M),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(M)){this.activeGrip=this.rotatorGrip;var N=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=N.x-this.width/2,this.top=N.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var ne=this.container.transform.baseVal.getItem(0);ne.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(ne,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},v.prototype.pointerUp=function(x){var M=this.state;F.prototype.pointerUp.call(this,x),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(x),this._state="select",M==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},v.prototype.moveVisual=function(x){this.visual.style.transform="translate("+x.x+"px, "+x.y+"px)"},v.prototype.manipulate=function(x){var M=this.unrotatePoint(x);this.state==="creating"?this.resize(x):this.state==="move"?(this.left=this.manipulationStartLeft+(M.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(M.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(M):this.state==="rotate"&&this.rotate(x)},v.prototype.resize=function(x){var M=this.manipulationStartLeft,K=this.manipulationStartWidth,N=this.manipulationStartTop,ne=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:M=this.manipulationStartLeft+x.x-this.manipulationStartX,K=this.manipulationStartWidth+this.manipulationStartLeft-M;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:K=this.manipulationStartWidth+x.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:N=this.manipulationStartTop+x.y-this.manipulationStartY,ne=this.manipulationStartHeight+this.manipulationStartTop-N;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:ne=this.manipulationStartHeight+x.y-this.manipulationStartY}K>=0?(this.left=M,this.width=K):(this.left=M+K,this.width=-K),ne>=0?(this.top=N,this.height=ne):(this.top=N+ne,this.height=-ne),this.setSize()},v.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},v.prototype.rotate=function(x){if(Math.abs(x.x-this.centerX)>.1){var M=Math.sign(x.x-this.centerX);this.rotationAngle=180*Math.atan((x.y-this.centerY)/(x.x-this.centerX))/Math.PI+90*M,this.applyRotation()}},v.prototype.applyRotation=function(){var x=this.container.transform.baseVal.getItem(0);x.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(x,0)},v.prototype.rotatePoint=function(x){if(this.rotationAngle===0)return x;var M=this.container.getCTM(),K=$.createPoint(x.x,x.y);return{x:(K=K.matrixTransform(M)).x,y:K.y}},v.prototype.unrotatePoint=function(x){if(this.rotationAngle===0)return x;var M=this.container.getCTM();M=M.inverse();var K=$.createPoint(x.x,x.y);return{x:(K=K.matrixTransform(M)).x,y:K.y}},v.prototype.select=function(){F.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},v.prototype.deselect=function(){F.prototype.deselect.call(this),this.controlBox.style.display="none"},v.prototype.setupControlBox=function(){this.controlBox=$.createGroup();var x=$.createTransform();x.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(x),this.container.appendChild(this.controlBox),this.controlRect=$.createRect(this.width+this.CB_DISTANCE,this.height+this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"],["fill","transparent"],["pointer-events","none"]]),this.controlBox.appendChild(this.controlRect),this.globalSettings.disableRotation!==!0&&(this.rotatorGripLine=$.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new ve,this.addControlGrips(),this.controlBox.style.display="none"},v.prototype.adjustControlBox=function(){var x=this.controlBox.transform.baseVal.getItem(0);x.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(x,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},v.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},v.prototype.createGrip=function(){var x=new Me;return x.visual.transform.baseVal.appendItem($.createTransform()),this.controlBox.appendChild(x.visual),x},v.prototype.positionGrips=function(){var x=this.controlGrips.topLeft.GRIP_SIZE,M=-x/2,K=M,N=(this.width+this.CB_DISTANCE)/2-x/2,ne=(this.height+this.CB_DISTANCE)/2-x/2,ke=this.height+this.CB_DISTANCE-x/2,je=this.width+this.CB_DISTANCE-x/2;this.positionGrip(this.controlGrips.topLeft.visual,M,K),this.positionGrip(this.controlGrips.topCenter.visual,N,K),this.positionGrip(this.controlGrips.topRight.visual,je,K),this.positionGrip(this.controlGrips.centerLeft.visual,M,ne),this.positionGrip(this.controlGrips.centerRight.visual,je,ne),this.positionGrip(this.controlGrips.bottomLeft.visual,M,ke),this.positionGrip(this.controlGrips.bottomCenter.visual,N,ke),this.positionGrip(this.controlGrips.bottomRight.visual,je,ke),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,N,K-3*this.CB_DISTANCE)},v.prototype.positionGrip=function(x,M,K){var N=x.transform.baseVal.getItem(0);N.setTranslate(M,K),x.transform.baseVal.replaceItem(N,0)},v.prototype.hideControlBox=function(){this.controlBox.style.display="none"},v.prototype.showControlBox=function(){this.controlBox.style.display=""},v.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:he.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:he.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},F.prototype.getState.call(this))},v.prototype.restoreState=function(x){F.prototype.restoreState.call(this,x);var M=x;this.left=M.left,this.top=M.top,this.width=M.width,this.height=M.height,this.rotationAngle=M.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(he.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,M.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(he.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,M.containerTransformMatrix))},v.prototype.scale=function(x,M){F.prototype.scale.call(this,x,M);var K=this.rotatePoint({x:this.left,y:this.top}),N=this.unrotatePoint({x:K.x*x,y:K.y*M});this.left=N.x,this.top=N.y,this.width=this.width*x,this.height=this.height*M,this.adjustControlBox()},v}(pe),_e=function(F){function v(x,M,K){var N=F.call(this,x,M,K)||this;return N.fillColor="transparent",N.strokeColor="transparent",N.strokeWidth=0,N.strokeDasharray="",N.opacity=1,N.setStrokeColor=N.setStrokeColor.bind(N),N.setFillColor=N.setFillColor.bind(N),N.setStrokeWidth=N.setStrokeWidth.bind(N),N.setStrokeDasharray=N.setStrokeDasharray.bind(N),N.createVisual=N.createVisual.bind(N),N}return J(v,F),v.prototype.ownsTarget=function(x){return!(!F.prototype.ownsTarget.call(this,x)&&x!==this.visual)},v.prototype.createVisual=function(){this.visual=$.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},v.prototype.pointerDown=function(x,M){F.prototype.pointerDown.call(this,x,M),this.state==="new"&&(this.createVisual(),this.moveVisual(x),this._state="creating")},v.prototype.manipulate=function(x){F.prototype.manipulate.call(this,x)},v.prototype.resize=function(x){F.prototype.resize.call(this,x),this.setSize()},v.prototype.setSize=function(){F.prototype.setSize.call(this),$.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},v.prototype.pointerUp=function(x){F.prototype.pointerUp.call(this,x),this.setSize()},v.prototype.setStrokeColor=function(x){this.strokeColor=x,this.visual&&$.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(x),this.stateChanged()},v.prototype.setFillColor=function(x){this.fillColor=x,this.visual&&$.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},v.prototype.setStrokeWidth=function(x){this.strokeWidth=x,this.visual&&$.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},v.prototype.setStrokeDasharray=function(x){this.strokeDasharray=x,this.visual&&$.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},v.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},F.prototype.getState.call(this))},v.prototype.restoreState=function(x){var M=x;this.fillColor=M.fillColor,this.strokeColor=M.strokeColor,this.strokeWidth=M.strokeWidth,this.strokeDasharray=M.strokeDasharray,this.opacity=M.opacity,this.createVisual(),F.prototype.restoreState.call(this,x),this.setSize()},v.prototype.scale=function(x,M){F.prototype.scale.call(this,x,M),this.setSize()},v.title="Rectangle marker",v}(me),Se=function(F){function v(x,M,K,N){var ne=F.call(this,x,N||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return ne.widths=[],ne.widthBoxes=[],ne.widths=M,ne.currentWidth=K,ne.setCurrentWidth=ne.setCurrentWidth.bind(ne),ne}return J(v,F),v.prototype.getUi=function(){var x=this,M=document.createElement("div");return M.style.display="flex",M.style.overflow="hidden",M.style.flexGrow="2",this.widths.forEach(function(K){var N=document.createElement("div");N.style.display="flex",N.style.flexGrow="2",N.style.alignItems="center",N.style.justifyContent="space-between",N.style.padding="5px",N.style.borderWidth="2px",N.style.borderStyle="solid",N.style.borderColor=K===x.currentWidth?x.uiStyleSettings.toolboxAccentColor:"transparent",N.addEventListener("click",function(){x.setCurrentWidth(K,N)}),M.appendChild(N);var ne=document.createElement("div");ne.innerText=K.toString(),ne.style.marginRight="5px",N.appendChild(ne);var ke=document.createElement("div");ke.style.minHeight="20px",ke.style.flexGrow="2",ke.style.display="flex",ke.style.alignItems="center";var je=document.createElement("hr");je.style.minWidth="20px",je.style.border="0px",je.style.borderTop=K+"px solid "+x.uiStyleSettings.toolboxColor,je.style.flexGrow="2",ke.appendChild(je),N.appendChild(ke),x.widthBoxes.push(N)}),M},v.prototype.setCurrentWidth=function(x,M){var K=this;this.currentWidth=x,this.widthBoxes.forEach(function(N){N.style.borderColor=N===M?K.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},v}(Y),Ce=function(F){function v(x,M,K,N){var ne=F.call(this,x,N||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return ne.styles=[],ne.styleBoxes=[],ne.styles=M,ne.currentStyle=K,ne.setCurrentStyle=ne.setCurrentStyle.bind(ne),ne}return J(v,F),v.prototype.getUi=function(){var x=this,M=document.createElement("div");return M.style.display="flex",M.style.overflow="hidden",M.style.flexGrow="2",this.styles.forEach(function(K){var N=document.createElement("div");N.style.display="flex",N.style.alignItems="center",N.style.justifyContent="space-between",N.style.padding="5px",N.style.borderWidth="2px",N.style.borderStyle="solid",N.style.overflow="hidden",N.style.maxWidth=100/x.styles.length-5+"%",N.style.borderColor=K===x.currentStyle?x.uiStyleSettings.toolboxAccentColor:"transparent",N.addEventListener("click",function(){x.setCurrentStyle(K,N)}),M.appendChild(N);var ne=document.createElement("div");ne.style.minHeight="20px",ne.style.flexGrow="2",ne.style.overflow="hidden";var ke=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+x.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(K!==""?'stroke-dasharray="'+K+'"':"")+` />
</svg>`;ne.innerHTML=ke,N.appendChild(ne),x.styleBoxes.push(N)}),M},v.prototype.setCurrentStyle=function(x,M){var K=this;this.currentStyle=x,this.styleBoxes.forEach(function(N){N.style.borderColor=N===M?K.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},v}(Y),Oe=function(F){function v(x,M,K){var N=F.call(this,x,M,K)||this;return N.strokeColor=K.defaultColor,N.strokeWidth=K.defaultStrokeWidth,N.strokeDasharray=K.defaultStrokeDasharray,N.strokePanel=new se("Line color",K.defaultColorSet,K.defaultColor),N.strokePanel.onColorChanged=N.setStrokeColor,N.strokeWidthPanel=new Se("Line width",K.defaultStrokeWidths,K.defaultStrokeWidth),N.strokeWidthPanel.onWidthChanged=N.setStrokeWidth,N.strokeStylePanel=new Ce("Line style",K.defaultStrokeDasharrays,K.defaultStrokeDasharray),N.strokeStylePanel.onStyleChanged=N.setStrokeDasharray,N}return J(v,F),Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var x=F.prototype.getState.call(this);return x.typeName=v.typeName,x},v.typeName="FrameMarker",v.title="Frame marker",v.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',v}(_e),xe=function(){this.defaultColorSet=["#EF4444","#10B981","#2563EB","#FFFF00","#7C3AED","#F472B6","#000000","#FFFFFF"],this.defaultColor=this.defaultColorSet[0],this.defaultFillColor=this.defaultColorSet[0],this.defaultStrokeColor=this.defaultColorSet[7],this.defaultHighlightColor=this.defaultColorSet[3],this.defaultStrokeWidth=3,this.defaultStrokeDasharray="",this.defaultHighlightOpacity=.5,this.defaultFontFamily="Helvetica, Arial, sans-serif",this.defaultStrokeWidths=[1,2,3,5,10],this.defaultStrokeDasharrays=["","3","12 3","9 6 3 6"],this.defaultOpacitySteps=[.1,.25,.5,.75,1],this.displayMode="inline",this.defaultFontFamilies=['Times, "Times New Roman", serif',"Helvetica, Arial, sans-serif",'Courier, "Courier New", monospace',"cursive","fantasy"],this.popupMargin=30,this.newFreehandMarkerOnPointerUp=!1,this.defaultColorsFollowCurrentColors=!1,this.freehandPixelRatio=1,this.disableRotation=!1},Ue=function(F){function v(x,M,K){var N=F.call(this,x,M,K)||this;return N.x1=0,N.y1=0,N.x2=0,N.y2=0,N.defaultLength=50,N.manipulationStartX=0,N.manipulationStartY=0,N.manipulationStartX1=0,N.manipulationStartY1=0,N.manipulationStartX2=0,N.manipulationStartY2=0,N.setupControlBox(),N}return J(v,F),v.prototype.ownsTarget=function(x){return!!F.prototype.ownsTarget.call(this,x)||!(!this.grip1.ownsTarget(x)&&!this.grip2.ownsTarget(x))},v.prototype.pointerDown=function(x,M){F.prototype.pointerDown.call(this,x,M),this.manipulationStartX=x.x,this.manipulationStartY=x.y,this.state==="new"&&(this.x1=x.x,this.y1=x.y,this.x2=x.x,this.y2=x.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(M)?this.activeGrip=this.grip1:this.grip2.ownsTarget(M)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},v.prototype.pointerUp=function(x){var M=this.state;F.prototype.pointerUp.call(this,x),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(x),this._state="select",M==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},v.prototype.adjustVisual=function(){},v.prototype.manipulate=function(x){this.state==="creating"?this.resize(x):this.state==="move"?(this.x1=this.manipulationStartX1+x.x-this.manipulationStartX,this.y1=this.manipulationStartY1+x.y-this.manipulationStartY,this.x2=this.manipulationStartX2+x.x-this.manipulationStartX,this.y2=this.manipulationStartY2+x.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(x)},v.prototype.resize=function(x){switch(this.activeGrip){case this.grip1:this.x1=x.x,this.y1=x.y;break;case this.grip2:case void 0:this.x2=x.x,this.y2=x.y}this.adjustVisual(),this.adjustControlBox()},v.prototype.select=function(){F.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},v.prototype.deselect=function(){F.prototype.deselect.call(this),this.controlBox.style.display="none"},v.prototype.setupControlBox=function(){this.controlBox=$.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},v.prototype.adjustControlBox=function(){this.positionGrips()},v.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},v.prototype.createGrip=function(){var x=new Me;return x.visual.transform.baseVal.appendItem($.createTransform()),this.controlBox.appendChild(x.visual),x},v.prototype.positionGrips=function(){var x=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-x/2,this.y1-x/2),this.positionGrip(this.grip2.visual,this.x2-x/2,this.y2-x/2)},v.prototype.positionGrip=function(x,M,K){var N=x.transform.baseVal.getItem(0);N.setTranslate(M,K),x.transform.baseVal.replaceItem(N,0)},v.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},F.prototype.getState.call(this))},v.prototype.restoreState=function(x){F.prototype.restoreState.call(this,x);var M=x;this.x1=M.x1,this.y1=M.y1,this.x2=M.x2,this.y2=M.y2},v.prototype.scale=function(x,M){F.prototype.scale.call(this,x,M),this.x1=this.x1*x,this.y1=this.y1*M,this.x2=this.x2*x,this.y2=this.y2*M,this.adjustVisual(),this.adjustControlBox()},v}(pe),Be=function(F){function v(x,M,K){var N=F.call(this,x,M,K)||this;return N.strokeColor="transparent",N.strokeWidth=0,N.strokeDasharray="",N.setStrokeColor=N.setStrokeColor.bind(N),N.setStrokeWidth=N.setStrokeWidth.bind(N),N.setStrokeDasharray=N.setStrokeDasharray.bind(N),N.strokeColor=K.defaultColor,N.strokeWidth=K.defaultStrokeWidth,N.strokeDasharray=K.defaultStrokeDasharray,N.strokePanel=new se("Line color",K.defaultColorSet,K.defaultColor),N.strokePanel.onColorChanged=N.setStrokeColor,N.strokeWidthPanel=new Se("Line width",K.defaultStrokeWidths,K.defaultStrokeWidth),N.strokeWidthPanel.onWidthChanged=N.setStrokeWidth,N.strokeStylePanel=new Ce("Line style",K.defaultStrokeDasharrays,K.defaultStrokeDasharray),N.strokeStylePanel.onStyleChanged=N.setStrokeDasharray,N}return J(v,F),v.prototype.ownsTarget=function(x){return!(!F.prototype.ownsTarget.call(this,x)&&x!==this.visual&&x!==this.selectorLine&&x!==this.visibleLine)},v.prototype.createVisual=function(){this.visual=$.createGroup(),this.selectorLine=$.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=$.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},v.prototype.pointerDown=function(x,M){F.prototype.pointerDown.call(this,x,M),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},v.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),$.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),$.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),$.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},v.prototype.setStrokeColor=function(x){this.strokeColor=x,this.adjustVisual(),this.colorChanged(x)},v.prototype.setStrokeWidth=function(x){this.strokeWidth=x,this.adjustVisual()},v.prototype.setStrokeDasharray=function(x){this.strokeDasharray=x,this.adjustVisual(),this.stateChanged()},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var x=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},F.prototype.getState.call(this));return x.typeName=v.typeName,x},v.prototype.restoreState=function(x){F.prototype.restoreState.call(this,x);var M=x;this.strokeColor=M.strokeColor,this.strokeWidth=M.strokeWidth,this.strokeDasharray=M.strokeDasharray,this.createVisual(),this.adjustVisual()},v.typeName="LineMarker",v.title="Line marker",v.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',v}(Ue),Ee=function(F){function v(x,M,K,N){var ne=F.call(this,x,N||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return ne.fonts=[],ne.fontBoxes=[],ne.fonts=M,ne.currentFont=K,ne.setCurrentFont=ne.setCurrentFont.bind(ne),ne}return J(v,F),v.prototype.getUi=function(){var x=this,M=document.createElement("div");return M.style.overflow="hidden",M.style.flexGrow="2",this.fonts.forEach(function(K){var N=document.createElement("div");N.style.display="inline-block",N.style.alignItems="center",N.style.justifyContent="space-between",N.style.padding="5px",N.style.borderWidth="2px",N.style.borderStyle="solid",N.style.overflow="hidden",N.style.maxWidth=100/x.fonts.length-5+"%",N.style.borderColor=K===x.currentFont?x.uiStyleSettings.toolboxAccentColor:"transparent",N.addEventListener("click",function(){x.setCurrentFont(K,N)}),M.appendChild(N);var ne=document.createElement("div");ne.style.display="flex",ne.style.minHeight="20px",ne.style.flexGrow="2",ne.style.fontFamily=K,ne.style.overflow="hidden";var ke=document.createElement("div");ke.style.whiteSpace="nowrap",ke.style.overflow="hidden",ke.style.textOverflow="ellipsis",ke.innerHTML="The quick brown fox jumps over the lazy dog",ne.appendChild(ke),N.appendChild(ne),x.fontBoxes.push(N)}),M},v.prototype.setCurrentFont=function(x,M){var K=this;this.currentFont=x,this.fontBoxes.forEach(function(N){N.style.borderColor=N===M?K.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},v}(Y),De=function(F){function v(x,M,K){var N=F.call(this,x,M,K)||this;return N.color="transparent",N.padding=5,N.DEFAULT_TEXT="your text here",N.text=N.DEFAULT_TEXT,N.isMoved=!1,N.color=K.defaultColor,N.fontFamily=K.defaultFontFamily,N.defaultSize={x:100,y:30},N.setColor=N.setColor.bind(N),N.setFont=N.setFont.bind(N),N.renderText=N.renderText.bind(N),N.sizeText=N.sizeText.bind(N),N.textEditDivClicked=N.textEditDivClicked.bind(N),N.showTextEditor=N.showTextEditor.bind(N),N.setSize=N.setSize.bind(N),N.positionTextEditor=N.positionTextEditor.bind(N),N.colorPanel=new se("Color",K.defaultColorSet,K.defaultColor),N.colorPanel.onColorChanged=N.setColor,N.fontFamilyPanel=new Ee("Font",K.defaultFontFamilies,K.defaultFontFamily),N.fontFamilyPanel.onFontChanged=N.setFont,N}return J(v,F),v.prototype.ownsTarget=function(x){if(F.prototype.ownsTarget.call(this,x)||x===this.visual||x===this.textElement||x===this.bgRectangle)return!0;var M=!1;return this.textElement.childNodes.forEach(function(K){K===x&&(M=!0)}),M},v.prototype.createVisual=function(){this.visual=$.createGroup(),this.bgRectangle=$.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=$.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem($.createTransform()),this.textElement.transform.baseVal.appendItem($.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},v.prototype.pointerDown=function(x,M){F.prototype.pointerDown.call(this,x,M),this.isMoved=!1,this.pointerDownPoint=x,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(x),this._state="creating")},v.prototype.renderText=function(){var x=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(M){x.textElement.appendChild($.createTSpan(M.trim()===""?" ":M.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},v.prototype.getTextScale=function(){var x=this.textElement.getBBox(),M=1;if(x.width>0&&x.height>0){var K=(1*this.width-this.width*this.padding*2/100)/x.width,N=(1*this.height-this.height*this.padding*2/100)/x.height;M=Math.min(K,N)}return M},v.prototype.getTextPosition=function(x){var M=this.textElement.getBBox(),K=0,N=0;return M.width>0&&M.height>0&&(K=(this.width-M.width*x)/2,N=this.height/2-M.height*x/2),{x:K,y:N}},v.prototype.sizeText=function(){var x=this.textElement.getBBox(),M=this.getTextScale(),K=this.getTextPosition(M);K.y-=x.y*M,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+K.x+"px, "+K.y+"px) scale("+M+", "+M+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(K.x,K.y),this.textElement.transform.baseVal.getItem(1).setScale(M,M))},v.prototype.manipulate=function(x){F.prototype.manipulate.call(this,x),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(x.x-this.pointerDownPoint.x)>5||Math.abs(x.y-this.pointerDownPoint.y)>5)},v.prototype.resize=function(x){F.prototype.resize.call(this,x),this.isMoved=!0,this.setSize(),this.sizeText()},v.prototype.setSize=function(){F.prototype.setSize.call(this),this.visual&&this.bgRectangle&&($.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),$.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},v.prototype.pointerUp=function(x){var M=this.state;M==="creating"&&(this._suppressMarkerCreateEvent=!0),F.prototype.pointerUp.call(this,x),this.setSize(),(M==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},v.prototype.showTextEditor=function(){var x=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(M){M.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var M=Number.parseFloat(x.textEditor.style.fontSize);x.textEditor.clientWidth>=Number.parseInt(x.textEditor.style.maxWidth)&&M>.9;)M-=.1,x.textEditor.style.fontSize=Math.max(M,.9)+"em"}),this.textEditor.addEventListener("keyup",function(M){M.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(M){if(M.clipboardData){var K=M.clipboardData.getData("text"),N=window.getSelection();if(!N.rangeCount)return!1;N.deleteFromDocument(),N.getRangeAt(0).insertNode(document.createTextNode(K)),M.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){x.textEditDivClicked(x.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},v.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var x=this.getTextScale(),M=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),K=this.textElement.getBBox(),N={x:K.width*x,y:K.height*x};M.x-=N.x/2,M.y-=N.y/2,this.textEditor.style.top=M.y+"px",this.textEditor.style.left=M.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-M.x+"px",this.textEditor.style.fontSize=Math.max(16*x,12)+"px",this.textElement.style.display="none"}},v.prototype.textEditDivClicked=function(x){this.text=x.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},v.prototype.select=function(){F.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},v.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),F.prototype.deselect.call(this)},v.prototype.dblClick=function(x,M){F.prototype.dblClick.call(this,x,M),this.showTextEditor()},v.prototype.setColor=function(x){this.textElement&&$.setAttributes(this.textElement,[["fill",x]]),this.color=x,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(x)},v.prototype.setFont=function(x){this.textElement&&$.setAttributes(this.textElement,[["font-family",x]]),this.fontFamily=x,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},v.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},v.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var x=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},F.prototype.getState.call(this));return x.typeName=v.typeName,x},v.prototype.restoreState=function(x){var M=x;this.color=M.color,this.fontFamily=M.fontFamily,this.padding=M.padding,this.text=M.text,this.createVisual(),F.prototype.restoreState.call(this,x),this.setSize()},v.prototype.scale=function(x,M){F.prototype.scale.call(this,x,M),this.setSize(),this.sizeText(),this.positionTextEditor()},v.typeName="TextMarker",v.title="Text marker",v.icon='<svg viewBox="0 0 24 24"><path d="M9.6 14L12 7.7l2.4 6.3M11 5L5.5 19h2.2l1.1-3H15l1.1 3h2.2L13 5h-2z"/></svg>',v}(me),de=function(F){function v(x,M,K){var N=F.call(this,x,M,K)||this;return N.color="transparent",N.lineWidth=3,N.drawing=!1,N.pixelRatio=1,N.color=K.defaultColor,N.lineWidth=K.defaultStrokeWidth,N.pixelRatio=K.freehandPixelRatio,N.setColor=N.setColor.bind(N),N.addCanvas=N.addCanvas.bind(N),N.finishCreation=N.finishCreation.bind(N),N.setLineWidth=N.setLineWidth.bind(N),N.colorPanel=new se("Color",K.defaultColorSet,K.defaultColor),N.colorPanel.onColorChanged=N.setColor,N.lineWidthPanel=new Se("Line width",K.defaultStrokeWidths,K.defaultStrokeWidth),N.lineWidthPanel.onWidthChanged=N.setLineWidth,N}return J(v,F),v.prototype.ownsTarget=function(x){return!(!F.prototype.ownsTarget.call(this,x)&&x!==this.visual&&x!==this.drawingImage)},v.prototype.createVisual=function(){this.visual=$.createGroup(),this.drawingImage=$.createImage(),this.visual.appendChild(this.drawingImage);var x=$.createTransform();this.visual.transform.baseVal.appendItem(x),this.addMarkerVisualToContainer(this.visual)},v.prototype.pointerDown=function(x,M){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(x.x,x.y),this.drawing=!0):F.prototype.pointerDown.call(this,x,M)},v.prototype.manipulate=function(x){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(x.x,x.y),this.canvasContext.stroke()):F.prototype.manipulate.call(this,x)},v.prototype.resize=function(x){F.prototype.resize.call(this,x),$.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),$.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},v.prototype.pointerUp=function(x){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):F.prototype.pointerUp.call(this,x)},v.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},v.prototype.select=function(){this.state==="creating"&&this.finishCreation(),F.prototype.select.call(this)},v.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),F.prototype.deselect.call(this)},v.prototype.finishCreation=function(){for(var x=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),M=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],K=M[0],N=M[1],ne=M[2],ke=M[3],je=!1,He=0;He<this.canvasElement.height;He++)for(var Pe=0;Pe<this.canvasElement.width;Pe++)x.data[He*this.canvasElement.width*4+4*Pe+3]>0&&(je=!0,He<N&&(N=He),Pe<K&&(K=Pe),He>ke&&(ke=He),Pe>ne&&(ne=Pe));if(je){this.left=K/this.pixelRatio,this.top=N/this.pixelRatio,this.width=(ne-K)/this.pixelRatio,this.height=(ke-N)/this.pixelRatio;var Xe=document.createElement("canvas");Xe.width=ne-K,Xe.height=ke-N,Xe.getContext("2d").putImageData(this.canvasContext.getImageData(K,N,ne-K,ke-N),0,0),this.drawingImgUrl=Xe.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},v.prototype.setDrawingImage=function(){$.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),$.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},v.prototype.setColor=function(x){this.color=x,this.colorChanged(x)},v.prototype.setLineWidth=function(x){this.lineWidth=x},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var x=Object.assign({drawingImgUrl:this.drawingImgUrl},F.prototype.getState.call(this));return x.typeName=v.typeName,x},v.prototype.restoreState=function(x){this.createVisual(),F.prototype.restoreState.call(this,x),this.drawingImgUrl=x.drawingImgUrl,this.setDrawingImage()},v.prototype.scale=function(x,M){F.prototype.scale.call(this,x,M),this.setDrawingImage()},v.typeName="FreehandMarker",v.title="Freehand marker",v.icon='<svg viewBox="0 0 24 24"><path d="M9.75 20.85c1.78-.7 1.39-2.63.49-3.85-.89-1.25-2.12-2.11-3.36-2.94A9.817 9.817 0 014.54 12c-.28-.33-.85-.94-.27-1.06.59-.12 1.61.46 2.13.68.91.38 1.81.82 2.65 1.34l1.01-1.7C8.5 10.23 6.5 9.32 4.64 9.05c-1.06-.16-2.18.06-2.54 1.21-.32.99.19 1.99.77 2.77 1.37 1.83 3.5 2.71 5.09 4.29.34.33.75.72.95 1.18.21.44.16.47-.31.47-1.24 0-2.79-.97-3.8-1.61l-1.01 1.7c1.53.94 4.09 2.41 5.96 1.79m11.09-15.6c.22-.22.22-.58 0-.79l-1.3-1.3a.562.562 0 00-.78 0l-1.02 1.02 2.08 2.08M11 10.92V13h2.08l6.15-6.15-2.08-2.08L11 10.92z"/></svg>',v}(me),re=function(F){function v(x,M,K){var N=F.call(this,x,K||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return N.typeBoxes=[],N.currentType=M,N.setCurrentType=N.setCurrentType.bind(N),N}return J(v,F),v.prototype.getUi=function(){var x=this,M=document.createElement("div");M.style.display="flex",M.style.overflow="hidden",M.style.flexGrow="2";for(var K=function(ke){var je="both";switch(ke){case 0:je="both";break;case 1:je="start";break;case 2:je="end";break;case 3:je="none"}var He=document.createElement("div");if(He.style.display="flex",He.style.flexGrow="2",He.style.alignItems="center",He.style.justifyContent="space-between",He.style.padding="5px",He.style.borderWidth="2px",He.style.borderStyle="solid",He.style.borderColor=je===N.currentType?N.uiStyleSettings.toolboxAccentColor:"transparent",He.addEventListener("click",function(){x.setCurrentType(je,He)}),M.appendChild(He),je==="both"||je==="start"){var Pe=document.createElement("div");Pe.style.display="flex",Pe.style.alignItems="center",Pe.style.minHeight="20px",Pe.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,5 10,0 10,10" fill="`+(N.uiStyleSettings!==void 0?N.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,Pe.style.marginLeft="5px",He.appendChild(Pe)}var Xe=document.createElement("div");Xe.style.display="flex",Xe.style.alignItems="center",Xe.style.minHeight="20px",Xe.style.flexGrow="2";var Ke=document.createElement("hr");if(Ke.style.minWidth="20px",Ke.style.border="0px",Ke.style.borderTop="3px solid "+(N.uiStyleSettings!==void 0?N.uiStyleSettings.toolboxColor:"#eeeeee"),Ke.style.flexGrow="2",Xe.appendChild(Ke),He.appendChild(Xe),je==="both"||je==="end"){var at=document.createElement("div");at.style.display="flex",at.style.alignItems="center",at.style.minHeight="20px",at.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,0 10,5 0,10" fill="`+(N.uiStyleSettings!==void 0?N.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,at.style.marginRight="5px",He.appendChild(at)}N.typeBoxes.push(He)},N=this,ne=0;ne<4;ne++)K(ne);return M},v.prototype.setCurrentType=function(x,M){var K=this;this.currentType=x,this.typeBoxes.forEach(function(N){N.style.borderColor=N===M?K.uiStyleSettings!==void 0?K.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},v}(Y),oe=function(F){function v(x,M,K){var N=F.call(this,x,M,K)||this;return N.arrowType="end",N.arrowBaseHeight=10,N.arrowBaseWidth=10,N.getArrowPoints=N.getArrowPoints.bind(N),N.setArrowType=N.setArrowType.bind(N),N.arrowTypePanel=new re("Arrow type","end"),N.arrowTypePanel.onArrowTypeChanged=N.setArrowType,N}return J(v,F),v.prototype.ownsTarget=function(x){return!(!F.prototype.ownsTarget.call(this,x)&&x!==this.arrow1&&x!==this.arrow2)},v.prototype.getArrowPoints=function(x,M){var K=this.arrowBaseWidth+2*this.strokeWidth,N=this.arrowBaseHeight+2*this.strokeWidth;return x-K/2+","+(M+N/2)+" "+x+","+(M-N/2)+" "+(x+K/2)+","+(M+N/2)},v.prototype.createTips=function(){this.arrow1=$.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem($.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=$.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem($.createTransform()),this.visual.appendChild(this.arrow2)},v.prototype.pointerDown=function(x,M){F.prototype.pointerDown.call(this,x,M),this.state==="creating"&&this.createTips()},v.prototype.adjustVisual=function(){if(F.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",$.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),$.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var x=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),M=this.arrow1.transform.baseVal.getItem(0);M.setRotate(x,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(M,0);var K=this.arrow2.transform.baseVal.getItem(0);K.setRotate(x+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(K,0)}},v.prototype.setArrowType=function(x){this.arrowType=x,this.adjustVisual(),this.stateChanged()},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var x=Object.assign({arrowType:this.arrowType},F.prototype.getState.call(this));return x.typeName=v.typeName,x},v.prototype.restoreState=function(x){F.prototype.restoreState.call(this,x);var M=x;this.arrowType=M.arrowType,this.createTips(),this.adjustVisual()},v.typeName="ArrowMarker",v.title="Arrow marker",v.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',v}(Be),V=function(F){function v(x,M,K){var N=F.call(this,x,M,K)||this;return N.fillColor=K.defaultFillColor,N.strokeWidth=0,N.fillPanel=new se("Color",K.defaultColorSet,K.defaultFillColor),N.fillPanel.onColorChanged=N.setFillColor,N}return J(v,F),Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var x=F.prototype.getState.call(this);return x.typeName=v.typeName,x},v.typeName="CoverMarker",v.title="Cover marker",v.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',v}(_e),Q=function(F){function v(x,M,K,N){var ne=F.call(this,x,N||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return ne.opacities=[],ne.opacityBoxes=[],ne.opacities=M,ne.currentOpacity=K,ne.setCurrentOpacity=ne.setCurrentOpacity.bind(ne),ne}return J(v,F),v.prototype.getUi=function(){var x=this,M=document.createElement("div");return M.style.display="flex",M.style.overflow="hidden",M.style.flexGrow="2",M.style.justifyContent="space-between",this.opacities.forEach(function(K){var N=document.createElement("div");N.style.display="flex",N.style.alignItems="center",N.style.justifyContent="center",N.style.padding="5px",N.style.borderWidth="2px",N.style.borderStyle="solid",N.style.borderColor=K===x.currentOpacity?x.uiStyleSettings.toolboxAccentColor:"transparent",N.addEventListener("click",function(){x.setCurrentOpacity(K,N)}),M.appendChild(N);var ne=document.createElement("div");ne.innerText=100*K+"%",N.appendChild(ne),x.opacityBoxes.push(N)}),M},v.prototype.setCurrentOpacity=function(x,M){var K=this;this.currentOpacity=x,this.opacityBoxes.forEach(function(N){N.style.borderColor=N===M?K.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},v}(Y),q=function(F){function v(x,M,K){var N=F.call(this,x,M,K)||this;return N.setOpacity=N.setOpacity.bind(N),N.fillColor=K.defaultHighlightColor,N.strokeWidth=0,N.opacity=K.defaultHighlightOpacity,N.fillPanel=new se("Color",K.defaultColorSet,N.fillColor),N.fillPanel.onColorChanged=N.setFillColor,N.opacityPanel=new Q("Opacity",K.defaultOpacitySteps,N.opacity),N.opacityPanel.onOpacityChanged=N.setOpacity,N}return J(v,F),v.prototype.setOpacity=function(x){this.opacity=x,this.visual&&$.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var x=F.prototype.getState.call(this);return x.typeName=v.typeName,x},v.typeName="HighlightMarker",v.title="Highlight marker",v.icon='<svg viewBox="0 0 24 24"><path d="M18.5 1.15c-.53 0-1.04.19-1.43.58l-5.81 5.82 5.65 5.65 5.82-5.81c.77-.78.77-2.04 0-2.83l-2.84-2.83c-.39-.39-.89-.58-1.39-.58M10.3 8.5l-5.96 5.96c-.78.78-.78 2.04.02 2.85C3.14 18.54 1.9 19.77.67 21h5.66l.86-.86c.78.76 2.03.75 2.81-.02l5.95-5.96"/></svg>',v}(V),ee='<svg viewBox="0 0 24 24"><path d="M19 11.5s-2 2.17-2 3.5a2 2 0 002 2 2 2 0 002-2c0-1.33-2-3.5-2-3.5M5.21 10L10 5.21 14.79 10m1.77-1.06L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.56-.59 1.53 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.59.59-1.56 0-2.12z"/></svg>',ge=function(F){function v(x,M,K){var N=F.call(this,x,M,K)||this;return N.bgColor="transparent",N.tipPosition={x:0,y:0},N.tipBase1Position={x:0,y:0},N.tipBase2Position={x:0,y:0},N.tipMoving=!1,N.color=K.defaultStrokeColor,N.bgColor=K.defaultFillColor,N.fontFamily=K.defaultFontFamily,N.defaultSize={x:100,y:30},N.setBgColor=N.setBgColor.bind(N),N.getTipPoints=N.getTipPoints.bind(N),N.positionTip=N.positionTip.bind(N),N.setTipPoints=N.setTipPoints.bind(N),N.colorPanel=new se("Text color",K.defaultColorSet,N.color,'<svg viewBox="0 0 24 24"><path d="M9.62 12L12 5.67 14.37 12M11 3L5.5 17h2.25l1.12-3h6.25l1.13 3h2.25L13 3h-2z"/></svg>'),N.colorPanel.onColorChanged=N.setColor,N.bgColorPanel=new se("Fill color",K.defaultColorSet,N.bgColor,ee),N.bgColorPanel.onColorChanged=N.setBgColor,N.fontFamilyPanel=new Ee("Font",K.defaultFontFamilies,K.defaultFontFamily),N.fontFamilyPanel.onFontChanged=N.setFont,N.tipGrip=new Me,N.tipGrip.visual.transform.baseVal.appendItem($.createTransform()),N.controlBox.appendChild(N.tipGrip.visual),N}return J(v,F),v.prototype.ownsTarget=function(x){return F.prototype.ownsTarget.call(this,x)||this.tipGrip.ownsTarget(x)||this.tip===x},v.prototype.createTip=function(){$.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=$.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},v.prototype.pointerDown=function(x,M){this.state==="new"&&F.prototype.pointerDown.call(this,x,M),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(M)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):F.prototype.pointerDown.call(this,x,M)},v.prototype.pointerUp=function(x){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,F.prototype.pointerUp.call(this,x);else{var M=this.state==="creating";F.prototype.pointerUp.call(this,x),this.setTipPoints(M),this.positionTip()}},v.prototype.manipulate=function(x){if(this.tipMoving){var M=this.unrotatePoint(x);this.tipPosition={x:M.x-this.manipulationStartLeft,y:M.y-this.manipulationStartTop},this.positionTip()}else F.prototype.manipulate.call(this,x)},v.prototype.setBgColor=function(x){this.bgRectangle&&this.tip&&($.setAttributes(this.bgRectangle,[["fill",x]]),$.setAttributes(this.tip,[["fill",x]])),this.bgColor=x,this.fillColorChanged(x)},v.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},v.prototype.setTipPoints=function(x){x===void 0&&(x=!1);var M=Math.min(this.height/2,15),K=this.height/5;x&&(this.tipPosition={x:M+K/2,y:this.height+20});var N=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?N<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(K=this.width/5,M=Math.min(this.width/2,15),this.tipBase1Position={x:M,y:0},this.tipBase2Position={x:M+K,y:0}):(this.tipBase1Position={x:0,y:M},this.tipBase2Position={x:0,y:M+K}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?N<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(K=this.width/5,M=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-M-K,y:0},this.tipBase2Position={x:this.width-M,y:0}):(this.tipBase1Position={x:this.width,y:M},this.tipBase2Position={x:this.width,y:M+K}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?N<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(K=this.width/5,M=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-M-K,y:this.height},this.tipBase2Position={x:this.width-M,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-M-K},this.tipBase2Position={x:this.width,y:this.height-M}):N<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(K=this.width/5,M=Math.min(this.width/2,15),this.tipBase1Position={x:M,y:this.height},this.tipBase2Position={x:M+K,y:this.height}):(this.tipBase1Position={x:0,y:this.height-M},this.tipBase2Position={x:0,y:this.height-M-K})},v.prototype.resize=function(x){F.prototype.resize.call(this,x),this.positionTip()},v.prototype.positionTip=function(){$.setAttributes(this.tip,[["points",this.getTipPoints()]]);var x=this.tipGrip.visual.transform.baseVal.getItem(0);x.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(x,0)},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),v.prototype.select=function(){this.positionTip(),F.prototype.select.call(this)},v.prototype.getState=function(){var x=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},F.prototype.getState.call(this));return x.typeName=v.typeName,x},v.prototype.restoreState=function(x){var M=x;this.bgColor=M.bgColor,this.tipPosition=M.tipPosition,F.prototype.restoreState.call(this,x),this.createTip(),this.setTipPoints()},v.prototype.scale=function(x,M){F.prototype.scale.call(this,x,M),this.tipPosition={x:this.tipPosition.x*x,y:this.tipPosition.y*M},this.positionTip()},v.typeName="CalloutMarker",v.title="Callout marker",v.icon='<svg viewBox="0 0 24 24"><path d="M4 2h16a2 2 0 012 2v12a2 2 0 01-2 2h-4l-4 4-4-4H4a2 2 0 01-2-2V4a2 2 0 012-2m0 2v12h4.83L12 19.17 15.17 16H20V4H4m2 3h12v2H6V7m0 4h10v2H6v-2z"/></svg>',v}(De),we=function(F){function v(x,M,K){var N=F.call(this,x,M,K)||this;return N.fillColor="transparent",N.strokeColor="transparent",N.strokeWidth=0,N.strokeDasharray="",N.opacity=1,N.strokeColor=K.defaultColor,N.strokeWidth=K.defaultStrokeWidth,N.strokeDasharray=K.defaultStrokeDasharray,N.fillColor=K.defaultFillColor,N.setStrokeColor=N.setStrokeColor.bind(N),N.setFillColor=N.setFillColor.bind(N),N.setStrokeWidth=N.setStrokeWidth.bind(N),N.setStrokeDasharray=N.setStrokeDasharray.bind(N),N.setOpacity=N.setOpacity.bind(N),N.createVisual=N.createVisual.bind(N),N.strokePanel=new se("Line color",X(K.defaultColorSet,["transparent"]),K.defaultColor),N.strokePanel.onColorChanged=N.setStrokeColor,N.fillPanel=new se("Fill color",X(K.defaultColorSet,["transparent"]),N.fillColor,ee),N.fillPanel.onColorChanged=N.setFillColor,N.strokeWidthPanel=new Se("Line width",K.defaultStrokeWidths,K.defaultStrokeWidth),N.strokeWidthPanel.onWidthChanged=N.setStrokeWidth,N.strokeStylePanel=new Ce("Line style",K.defaultStrokeDasharrays,K.defaultStrokeDasharray),N.strokeStylePanel.onStyleChanged=N.setStrokeDasharray,N.opacityPanel=new Q("Opacity",K.defaultOpacitySteps,N.opacity),N.opacityPanel.onOpacityChanged=N.setOpacity,N}return J(v,F),v.prototype.ownsTarget=function(x){return!(!F.prototype.ownsTarget.call(this,x)&&x!==this.visual)},v.prototype.createVisual=function(){this.visual=$.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},v.prototype.pointerDown=function(x,M){F.prototype.pointerDown.call(this,x,M),this.state==="new"&&(this.createVisual(),this.moveVisual(x),this._state="creating")},v.prototype.manipulate=function(x){F.prototype.manipulate.call(this,x)},v.prototype.resize=function(x){F.prototype.resize.call(this,x),this.setSize()},v.prototype.setSize=function(){F.prototype.setSize.call(this),$.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},v.prototype.pointerUp=function(x){F.prototype.pointerUp.call(this,x),this.setSize()},v.prototype.setStrokeColor=function(x){this.strokeColor=x,this.visual&&$.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(x),this.stateChanged()},v.prototype.setFillColor=function(x){this.fillColor=x,this.visual&&$.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(x),this.stateChanged()},v.prototype.setStrokeWidth=function(x){this.strokeWidth=x,this.visual&&$.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},v.prototype.setStrokeDasharray=function(x){this.strokeDasharray=x,this.visual&&$.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},v.prototype.setOpacity=function(x){this.opacity=x,this.visual&&$.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var x=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},F.prototype.getState.call(this));return x.typeName=v.typeName,x},v.prototype.restoreState=function(x){var M=x;this.fillColor=M.fillColor,this.strokeColor=M.strokeColor,this.strokeWidth=M.strokeWidth,this.strokeDasharray=M.strokeDasharray,this.opacity=M.opacity,this.createVisual(),F.prototype.restoreState.call(this,x),this.setSize()},v.prototype.scale=function(x,M){F.prototype.scale.call(this,x,M),this.setSize()},v.typeName="EllipseMarker",v.title="Ellipse marker",v.icon='<svg viewBox="0 0 24 24"><path d="M12 4C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',v}(me),Ne=function(F){function v(x,M,K){return F.call(this,x,M,K)||this}return J(v,F),Object.defineProperty(v.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),v.prototype.ownsTarget=function(x){return!(!F.prototype.ownsTarget.call(this,x)&&x!==this.tip1&&x!==this.tip2)},v.prototype.createTips=function(){this.tip1=$.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem($.createTransform()),this.visual.appendChild(this.tip1),this.tip2=$.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem($.createTransform()),this.visual.appendChild(this.tip2)},v.prototype.pointerDown=function(x,M){F.prototype.pointerDown.call(this,x,M),this.state==="creating"&&this.createTips()},v.prototype.adjustVisual=function(){if(F.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&($.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),$.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var x=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),M=this.tip1.transform.baseVal.getItem(0);M.setRotate(x,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(M,0);var K=this.tip2.transform.baseVal.getItem(0);K.setRotate(x+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(K,0)}},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var x=F.prototype.getState.call(this);return x.typeName=v.typeName,x},v.prototype.restoreState=function(x){F.prototype.restoreState.call(this,x),this.createTips(),this.adjustVisual()},v.typeName="MeasurementMarker",v.title="Measurement marker",v.icon='<svg viewBox="0 0 24 24"><path d="M1.39 18.36l1.77-1.76L4.58 18l1.06-1.05-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.42 1.41L10.59 12l-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.41 1.41 1.07-1.06-1.42-1.41 1.42-1.42L18 6.7l1.07-1.06-2.47-2.48 1.76-1.77 4.25 4.25L5.64 22.61l-4.25-4.25z"/></svg>',v}(Be),Ge=function(F){function v(x,M,K){var N=F.call(this,x,M,K)||this;return N.strokePanel.colors=K.defaultColorSet,N.fillColor="transparent",N}return J(v,F),Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var x=F.prototype.getState.call(this);return x.typeName=v.typeName,x},v.typeName="EllipseFrameMarker",v.title="Ellipse frame marker",v.icon='<svg viewBox="0 0 24 24"><path d="M12 6c4.41 0 8 2.69 8 6s-3.59 6-8 6-8-2.69-8-6 3.59-6 8-6m0-2C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',v}(we),Je=function(){function F(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(F.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),F.prototype.addUndoStep=function(v){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(v)||(this.undoStack.push(v),JSON.stringify(this.lastRedoStep)!==JSON.stringify(v)&&this.redoStack.splice(0,this.redoStack.length))},F.prototype.replaceLastUndoStep=function(v){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=v)},F.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},F.prototype.undo=function(){if(this.undoStack.length>1){var v=this.undoStack.pop();return v!==void 0&&this.redoStack.push(v),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},F.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},F}(),ze=function(F){function v(x,M,K){var N=F.call(this,x,M,K)||this;return N.strokeColor="transparent",N.strokeWidth=0,N.strokeDasharray="",N.curveX=0,N.curveY=0,N.manipulationStartCurveX=0,N.manipulationStartCurveY=0,N.setStrokeColor=N.setStrokeColor.bind(N),N.setStrokeWidth=N.setStrokeWidth.bind(N),N.setStrokeDasharray=N.setStrokeDasharray.bind(N),N.positionGrips=N.positionGrips.bind(N),N.addControlGrips=N.addControlGrips.bind(N),N.adjustVisual=N.adjustVisual.bind(N),N.setupControlBox=N.setupControlBox.bind(N),N.resize=N.resize.bind(N),N.strokeColor=K.defaultColor,N.strokeWidth=K.defaultStrokeWidth,N.strokeDasharray=K.defaultStrokeDasharray,N.strokePanel=new se("Line color",K.defaultColorSet,K.defaultColor),N.strokePanel.onColorChanged=N.setStrokeColor,N.strokeWidthPanel=new Se("Line width",K.defaultStrokeWidths,K.defaultStrokeWidth),N.strokeWidthPanel.onWidthChanged=N.setStrokeWidth,N.strokeStylePanel=new Ce("Line style",K.defaultStrokeDasharrays,K.defaultStrokeDasharray),N.strokeStylePanel.onStyleChanged=N.setStrokeDasharray,N}return J(v,F),v.prototype.ownsTarget=function(x){return!(!F.prototype.ownsTarget.call(this,x)&&x!==this.visual&&x!==this.selectorCurve&&x!==this.visibleCurve&&!this.curveGrip.ownsTarget(x))},v.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},v.prototype.createVisual=function(){this.visual=$.createGroup(),this.selectorCurve=$.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=$.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},v.prototype.pointerDown=function(x,M){F.prototype.pointerDown.call(this,x,M),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=x.x,this.curveY=x.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(M)&&(this.activeGrip=this.curveGrip,this._state="resize")},v.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),$.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),$.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),$.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},v.prototype.setupControlBox=function(){F.prototype.setupControlBox.call(this),this.curveControlLine1=$.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=$.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},v.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,F.prototype.addControlGrips.call(this)},v.prototype.positionGrips=function(){F.prototype.positionGrips.call(this);var x=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-x/2,this.curveY-x/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},v.prototype.manipulate=function(x){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+x.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+x.y-this.manipulationStartY),F.prototype.manipulate.call(this,x)},v.prototype.resize=function(x){this.activeGrip===this.curveGrip&&(this.curveX=x.x,this.curveY=x.y),F.prototype.resize.call(this,x),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},v.prototype.setStrokeColor=function(x){this.strokeColor=x,this.adjustVisual(),this.colorChanged(x)},v.prototype.setStrokeWidth=function(x){this.strokeWidth=x,this.adjustVisual()},v.prototype.setStrokeDasharray=function(x){this.strokeDasharray=x,this.adjustVisual()},v.prototype.scale=function(x,M){this.curveX=this.curveX*x,this.curveY=this.curveY*M,F.prototype.scale.call(this,x,M)},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var x=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},F.prototype.getState.call(this));return x.typeName=v.typeName,x},v.prototype.restoreState=function(x){F.prototype.restoreState.call(this,x);var M=x;this.strokeColor=M.strokeColor,this.strokeWidth=M.strokeWidth,this.strokeDasharray=M.strokeDasharray,this.curveX=M.curveX,this.curveY=M.curveY,this.createVisual(),this.adjustVisual()},v.typeName="CurveMarker",v.title="Curve marker",v.icon='<svg viewBox="0 0 24 24"><path d="M18.5 2A1.5 1.5 0 0120 3.5 1.5 1.5 0 0118.5 5c-.23 0-.45-.05-.65-.15l-3.69 3.7.34.45c2.19-1.26 4.76-2 7.5-2l1 .03v2.01L22 9c-2.58 0-5 .75-7 2.04A3.96 3.96 0 0111.04 15C9.75 17 9 19.42 9 22l.04 1H7.03L7 22c0-2.74.74-5.31 2-7.5l-.45-.34-3.7 3.69c.1.2.15.42.15.65A1.5 1.5 0 013.5 20 1.5 1.5 0 012 18.5 1.5 1.5 0 013.5 17c.23 0 .45.05.65.15l3.69-3.7C7.31 12.78 7 11.92 7 11a4 4 0 014-4c.92 0 1.78.31 2.45.84l3.7-3.69c-.1-.2-.15-.42-.15-.65A1.5 1.5 0 0118.5 2M11 9a2 2 0 00-2 2 2 2 0 002 2 2 2 0 002-2 2 2 0 00-2-2z"/></svg>',v}(Ue),qe=function(){function F(v,x){x===void 0&&(x=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=v,this.cancelable=x}return Object.defineProperty(F.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),F.prototype.preventDefault=function(){this._defaultPrevented=!0},F}(),nt=function(F){function v(x,M,K){var N=F.call(this,x,!1)||this;return N.dataUrl=M,N.state=K,N}return J(v,F),v}(qe),$e=function(F){function v(x,M,K){K===void 0&&(K=!1);var N=F.call(this,x,K)||this;return N.marker=M,N}return J(v,F),v}(qe),gt=function(){function F(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return F.prototype.addEventListener=function(v,x){this[v].push(x)},F.prototype.removeEventListener=function(v,x){var M=this[v].indexOf(x);M>-1&&this[v].splice(M,1)},F}(),ht=function(){function F(v){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new xe,this._isOpen=!1,this.undoRedoManager=new Je,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.renderMarkersOnly=!1,this.zoomSteps=[1,1.5,2,4],this._zoomLevel=1,this._isResizing=!1,this.prevPanPoint={x:0,y:0},this.eventListeners=new gt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=F.instanceCounter++,this.styles=new Le(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=v,this.targetRoot=document.body,this.width=v.clientWidth,this.height=v.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(F.prototype,"ALL_MARKER_TYPES",{get:function(){return[Oe,de,oe,De,Ge,we,q,ge,Ne,V,Be,ze]},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Oe,de,oe,De,we,q,ge]},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Oe,de,oe,De,q]},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(v){var x=this;this._availableMarkerTypes.splice(0),v.forEach(function(M){if(typeof M=="string"){var K=x.ALL_MARKER_TYPES.find(function(N){return N.typeName===M});K!==void 0&&x._availableMarkerTypes.push(K)}else x._availableMarkerTypes.push(M)})},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(v){this._zoomLevel=v,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),F.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),be.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},F.prototype.show=function(){var v=this;this.styles.styleSheetRoot===void 0&&Ie.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=Ie.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(x){return x(new qe(v))})},F.prototype.render=function(){return Z(this,void 0,void 0,function(){var v;return ue(this,function(x){switch(x.label){case 0:return this.setCurrentMarker(),(v=new Re).naturalSize=this.renderAtNaturalSize,v.imageType=this.renderImageType,v.imageQuality=this.renderImageQuality,v.markersOnly=this.renderMarkersOnly,v.width=this.renderWidth,v.height=this.renderHeight,[4,v.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return x.sent(),[4,v.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,x.sent()]}})})},F.prototype.close=function(v){var x=this;if(v===void 0&&(v=!1),this.isOpen){var M=!1;v||this.eventListeners.beforeclose.forEach(function(K){var N=new qe(x,!0);K(N),N.defaultPrevented&&(M=!0)}),M||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(K){return K(new qe(x))}),this.detachEvents(),this._isOpen=!1)}},F.prototype.addMarkersToToolbar=function(){for(var v,x=[],M=0;M<arguments.length;M++)x[M]=arguments[M];(v=this._availableMarkerTypes).push.apply(v,x)},F.prototype.addRenderEventListener=function(v){this.addEventListener("render",function(x){v(x.dataUrl,x.state)})},F.prototype.removeRenderEventListener=function(v){},F.prototype.addCloseEventListener=function(v){this.addEventListener("close",function(){v()})},F.prototype.removeCloseEventListener=function(v){},F.prototype.setupResizeObserver=function(){var v=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){v.resize(v.target.clientWidth,v.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return v.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},F.prototype.onPopupTargetResize=function(){var v=1*this.target.clientWidth/this.target.clientHeight,x=this.editorCanvas.clientWidth/v>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*v:this.editorCanvas.clientWidth,M=x<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/v;this.resize(x,M)},F.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},F.prototype.resize=function(v,x){this._isResizing=!0;var M=v/this.imageWidth,K=x/this.imageHeight;this.imageWidth=Math.round(v),this.imageHeight=Math.round(x),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.settings.displayMode!=="popup"?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),this.toolbar!==void 0&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(M,K),this._isResizing=!1},F.prototype.scaleMarkers=function(v,x){var M,K=this;this._currentMarker&&this._currentMarker instanceof De?this._currentMarker.scale(v,x):(M=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(N){N!==K._currentMarker&&N.scale(v,x)}),M!==void 0&&this.setCurrentMarker(M)},F.prototype.setEditingTarget=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px"},F.prototype.setTopLeft=function(){var v=this.editingTarget.getBoundingClientRect(),x=this.editorCanvas.getBoundingClientRect();this.left=v.left-x.left,this.top=v.top-x.top},F.prototype.initMarkerCanvas=function(){this.markerImageHolder=document.createElement("div"),this.markerImageHolder.style.setProperty("touch-action","pinch-zoom"),this.markerImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.markerImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImage.style.pointerEvents="auto",this.markerImageHolder.style.position="absolute",this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.markerImageHolder.style.transformOrigin="top left",this.positionMarkerImage(),this.markerImageHolder.appendChild(this.markerImage),this.editorCanvas.appendChild(this.markerImageHolder)},F.prototype.addDefs=function(){for(var v,x=[],M=0;M<arguments.length;M++)x[M]=arguments[M];this.defs=$.createDefs(),this.addDefsToImage(),(v=this.defs).append.apply(v,x)},F.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},F.prototype.initOverlay=function(){this.overlayContainer=document.createElement("div"),this.overlayContainer.style.position="absolute",this.overlayContainer.style.left="0px",this.overlayContainer.style.top="0px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.overlayContainer.style.display="flex",this.markerImageHolder.appendChild(this.overlayContainer)},F.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},F.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},F.prototype.attachWindowEvents=function(){window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("pointerout",this.onPointerOut),window.addEventListener("pointerleave",this.onPointerUp),window.addEventListener("resize",this.onWindowResize),window.addEventListener("keyup",this.onKeyUp)},F.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},F.prototype.detachWindowEvents=function(){window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("pointerout",this.onPointerOut),window.removeEventListener("pointerleave",this.onPointerUp),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("keyup",this.onKeyUp)},F.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var v=document.createElement("a");v.href="https://markerjs.com/",v.target="_blank",v.innerHTML='<svg viewBox="0 0 112 96" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path fill="#e5f20d" fill-opacity=".647" d="M0 40.386h111.96V95.62H0z"/><path d="M93.61 61.452c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.591 1.048-1.481 0-2.222-.74-2.222-2.22 0-16.617-.533-29.347-1.604-38.192-1.068-8.842-2.92-13.265-5.552-13.265-4.443 0-10.94 15.509-19.497 46.52v.124c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.592 1.048-1.48 0-2.22-.74-2.22-2.22 0-3.29.165-8.392.493-15.302.33-7.732.494-13.82.494-18.262 0-6.17-.186-10.55-.556-13.142-.37-2.591-1.172-3.887-2.406-3.887-2.796 0-6.333 5.12-10.612 15.363C38.494 34.367 34.01 46.44 29.32 60.34l-1.11 3.209a5.714 5.714 0 01-1.42 2.097c-.617.578-1.295.864-2.036.864-.987 0-1.644-.081-1.974-.247-.328-.162-.533-.656-.617-1.48-.41-4.03-.74-9.418-.987-16.165-.163-1.728-.329-4.566-.494-8.515-.822-13.901-1.562-23.3-2.221-28.196-.657-4.893-.987-7.628-.987-8.205 0-.657.33-1.44.987-2.345.659-.903 1.276-1.357 1.85-1.357 1.319 0 2.387.947 3.21 2.838.411.906.863 4.526 1.357 10.859.493 6.335.905 14.19 1.233 23.568l.617 18.88c4.527-13.983 9.216-26.673 14.068-38.068C45.65 6.686 50.093.988 54.123.988c2.715 0 4.566 1.974 5.553 5.923.987 3.949 1.481 9.667 1.481 17.152 0 3.949-.081 9.625-.247 17.029l-.123 5.676c3.373-11.762 6.725-21.634 10.057-29.615 3.331-7.979 6.685-11.97 10.056-11.97 8.475 0 12.71 18.757 12.71 56.269z" fill-rule="nonzero"/></svg>',v.title="Powered by marker.js",v.style.display="grid",v.style.alignItems="center",v.style.justifyItems="center",v.style.padding="3px",v.style.width="20px",v.style.height="20px",this.logoUI.appendChild(v),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},F.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},F.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},F.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},F.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var v=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=v+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new Te(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y<this.styles.settings.toolbarHeight&&(this.editingTarget.style.marginTop=this.target.offsetTop-this.styles.settings.toolbarHeight+"px"),this.editorCanvas.appendChild(this.editingTarget),this.toolbox=new Ae(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},F.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},F.prototype.removeMarker=function(v){this.markerImage.removeChild(v.container),this.markers.indexOf(v)>-1&&this.markers.splice(this.markers.indexOf(v),1),v.dispose()},F.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},F.prototype.toolbarButtonClicked=function(v,x){if(v==="marker"&&x!==void 0)this.createNewMarker(x);else if(v==="action")switch(x){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},F.prototype.deleteSelectedMarker=function(){var v=this;if(this._currentMarker!==void 0){var x=!1;if(this.eventListeners.markerbeforedelete.forEach(function(K){var N=new $e(v,v._currentMarker,!0);K(N),N.defaultPrevented&&(x=!0)}),!x){var M=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(K){return K(new $e(v,M))})}}},F.prototype.clear=function(){var v=this,x=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(ne){var ke=new $e(v,void 0,!0);ne(ke),ke.defaultPrevented&&(x=!0)}),!x)){this.setCurrentMarker();for(var M=function(ne){var ke=K.markers[ne];K.setCurrentMarker(K.markers[ne]),K._currentMarker.dispose(),K.markerImage.removeChild(K._currentMarker.container),K.markers.splice(K.markers.indexOf(K._currentMarker),1),K.eventListeners.markerdelete.forEach(function(je){return je(new $e(v,ke))})},K=this,N=this.markers.length-1;N>=0;N--)M(N);this.addUndoStep()}},Object.defineProperty(F.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),F.prototype.showNotesEditor=function(){var v;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(v=this._currentMarker.notes)!==null&&v!==void 0?v:"",this.overlayContainer.appendChild(this.notesArea))},F.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},F.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},F.prototype.addUndoStep=function(){var v=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var x=this.getState(),M=this.undoRedoManager.getLastUndoStep();if(!M||M.width===x.width&&M.height===x.height){var K=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(x),K<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(N){return N(new qe(v))})}else this.undoRedoManager.replaceLastUndoStep(x),this.eventListeners.statechange.forEach(function(N){return N(new qe(v))})}},F.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},F.prototype.undoStep=function(){var v=this,x=this.undoRedoManager.undo();x!==void 0&&(this.restoreState(x),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(M){return M(new qe(v))}))},F.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},F.prototype.redoStep=function(){var v=this,x=this.undoRedoManager.redo();x!==void 0&&(this.restoreState(x),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(M){return M(new qe(v))}))},F.prototype.stepZoom=function(){var v=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=v<this.zoomSteps.length-1?this.zoomSteps[v+1]:this.zoomSteps[0]},F.prototype.panTo=function(v){this.contentDiv.scrollBy({left:this.prevPanPoint.x-v.x,top:this.prevPanPoint.y-v.y}),this.prevPanPoint=v},F.prototype.startRenderAndClose=function(){return Z(this,void 0,void 0,function(){var v,x,M=this;return ue(this,function(K){switch(K.label){case 0:return[4,this.render()];case 1:return v=K.sent(),x=this.getState(),this.eventListeners.render.forEach(function(N){return N(new nt(M,v,x))}),this.close(!0),[2]}})})},F.prototype.getState=function(v){v===!0&&this.setCurrentMarker();var x={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(M){return x.markers.push(M.getState())}),x},F.prototype.restoreState=function(v){var x=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);v.markers.forEach(function(M){var K=x._availableMarkerTypes.find(function(ne){return ne.typeName===M.typeName});if(K!==void 0){var N=x.addNewMarker(K);N.restoreState(M),x.markers.push(N)}}),v.width&&v.height&&(v.width!==this.imageWidth||v.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/v.width,this.imageHeight/v.height),this.eventListeners.restorestate.forEach(function(M){return M(new qe(x))})},F.prototype.addNewMarker=function(v){var x=$.createGroup();return this.markerImage.appendChild(x),new v(x,this.overlayContainer,this.settings)},F.prototype.createNewMarker=function(v){var x,M=this;(x=typeof v=="string"?this._availableMarkerTypes.find(function(K){return K.typeName===v}):v)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(x),this._currentMarker.onMarkerCreated=this.markerCreated,this._currentMarker.onColorChanged=this.colorChanged,this._currentMarker.onFillColorChanged=this.fillColorChanged,this._currentMarker.onStateChanged=this.markerStateChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(x.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(K){return K(new $e(M,M._currentMarker))}))},F.prototype.markerCreated=function(v){var x=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(v),this.setCurrentMarker(v),v instanceof de&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(de):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(M){return M(new $e(x,x._currentMarker))})},F.prototype.colorChanged=function(v){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=v,this.settings.defaultStrokeColor=v)},F.prototype.fillColorChanged=function(v){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=v)},F.prototype.markerStateChanged=function(v){var x=this;this.eventListeners.markerchange.forEach(function(M){return M(new $e(x,v))})},F.prototype.setCurrentMarker=function(v){var x=this;this._currentMarker!==v&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(M){return M(new $e(x,x._currentMarker))})),this._currentMarker=v,this._currentMarker===void 0||this._currentMarker.isSelected||(this._currentMarker.state!=="new"&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach(function(M){return M(new $e(x,x._currentMarker))}))},F.prototype.onPointerDown=function(v){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||v.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var x=this.markers.find(function(M){return M.ownsTarget(v.target)});x!==void 0?(this.setCurrentMarker(x),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(v.clientX,v.clientY),v.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:v.clientX,y:v.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(v.clientX,v.clientY))},F.prototype.onDblClick=function(v){if(this._isFocused||this.focus(),this.mode==="select"){var x=this.markers.find(function(M){return M.ownsTarget(v.target)});x!==void 0&&x!==this._currentMarker&&this.setCurrentMarker(x),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(v.clientX,v.clientY),v.target):this.setCurrentMarker()}},F.prototype.onPointerMove=function(v){this.touchPoints!==1&&v.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||v.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(v.clientX,v.clientY)):this.zoomLevel>1&&this.panTo({x:v.clientX,y:v.clientY}))},F.prototype.onPointerUp=function(v){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(v.clientX,v.clientY)),this.isDragging=!1,this.addUndoStep()},F.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},F.prototype.onKeyUp=function(v){this._currentMarker===void 0||this.notesArea!==void 0||v.key!=="Delete"&&v.key!=="Backspace"||this.deleteSelectedMarker()},F.prototype.clientToLocalCoordinates=function(v,x){var M=this.markerImage.getBoundingClientRect();return{x:(v-M.left)/this.zoomLevel,y:(x-M.top)/this.zoomLevel}},F.prototype.onWindowResize=function(){this.positionUI()},F.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var v=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=v+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},F.prototype.addLicenseKey=function(v){be.addKey(v)},F.prototype.addEventListener=function(v,x){this.eventListeners.addEventListener(v,x)},F.prototype.removeEventListener=function(v,x){this.eventListeners.removeEventListener(v,x)},F.prototype.renderState=function(v){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(v),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(F.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),F.prototype.focus=function(){var v=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(x){return x(new qe(v))}))},F.prototype.blur=function(){var v=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(x){return x(new qe(v))}))},F.instanceCounter=0,F}();/* **********************************
cropro version 1.2.0
@license SEE LICENSE IN LICENSE
copyright Alan Mendelevich
see README and LICENSE for details
********************************** *//*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var bt=function(F,v){return(bt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,M){x.__proto__=M}||function(x,M){for(var K in M)Object.prototype.hasOwnProperty.call(M,K)&&(x[K]=M[K])})(F,v)};function pt(F,v){if(typeof v!="function"&&v!==null)throw new TypeError("Class extends value "+String(v)+" is not a constructor or null");function x(){this.constructor=F}bt(F,v),F.prototype=v===null?Object.create(v):(x.prototype=v.prototype,new x)}function it(F,v,x,M){return new(x||(x=Promise))(function(K,N){function ne(He){try{je(M.next(He))}catch(Pe){N(Pe)}}function ke(He){try{je(M.throw(He))}catch(Pe){N(Pe)}}function je(He){var Pe;He.done?K(He.value):(Pe=He.value,Pe instanceof x?Pe:new x(function(Xe){Xe(Pe)})).then(ne,ke)}je((M=M.apply(F,v||[])).next())})}function _t(F,v){var x,M,K,N,ne={label:0,sent:function(){if(1&K[0])throw K[1];return K[1]},trys:[],ops:[]};return N={next:ke(0),throw:ke(1),return:ke(2)},typeof Symbol=="function"&&(N[Symbol.iterator]=function(){return this}),N;function ke(je){return function(He){return function(Pe){if(x)throw new TypeError("Generator is already executing.");for(;ne;)try{if(x=1,M&&(K=2&Pe[0]?M.return:Pe[0]?M.throw||((K=M.return)&&K.call(M),0):M.next)&&!(K=K.call(M,Pe[1])).done)return K;switch(M=0,K&&(Pe=[2&Pe[0],K.value]),Pe[0]){case 0:case 1:K=Pe;break;case 4:return ne.label++,{value:Pe[1],done:!1};case 5:ne.label++,M=Pe[1],Pe=[0];continue;case 7:Pe=ne.ops.pop(),ne.trys.pop();continue;default:if(!(K=ne.trys,(K=K.length>0&&K[K.length-1])||Pe[0]!==6&&Pe[0]!==2)){ne=0;continue}if(Pe[0]===3&&(!K||Pe[1]>K[0]&&Pe[1]<K[3])){ne.label=Pe[1];break}if(Pe[0]===6&&ne.label<K[1]){ne.label=K[1],K=Pe;break}if(K&&ne.label<K[2]){ne.label=K[2],ne.ops.push(Pe);break}K[2]&&ne.ops.pop(),ne.trys.pop();continue}Pe=v.call(F,ne)}catch(Xe){Pe=[6,Xe],M=0}finally{x=K=0}if(5&Pe[0])throw Pe[1];return{value:Pe[0]?Pe[1]:void 0,done:!0}}([je,He])}}}var Tt=function(){function F(){}return F.addKey=function(v){F.key=v},Object.defineProperty(F,"isLicensed",{get:function(){return!!F.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(F.key)},enumerable:!1,configurable:!0}),F}(),Ve=function(){function F(){}return F.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},F.setAttributes=function(v,x){for(var M=0,K=x;M<K.length;M++){var N=K[M],ne=N[0],ke=N[1];v.setAttribute(ne,ke)}},F.createRect=function(v,x,M){var K=document.createElementNS("http://www.w3.org/2000/svg","rect");return K.setAttribute("width",v.toString()),K.setAttribute("height",x.toString()),M&&F.setAttributes(K,M),K},F.createLine=function(v,x,M,K,N){var ne=document.createElementNS("http://www.w3.org/2000/svg","line");return ne.setAttribute("x1",v.toString()),ne.setAttribute("y1",x.toString()),ne.setAttribute("x2",M.toString()),ne.setAttribute("y2",K.toString()),N&&F.setAttributes(ne,N),ne},F.createPolygon=function(v,x){var M=document.createElementNS("http://www.w3.org/2000/svg","polygon");return M.setAttribute("points",v),x&&F.setAttributes(M,x),M},F.createCircle=function(v,x){var M=document.createElementNS("http://www.w3.org/2000/svg","circle");return M.setAttribute("cx",(v/2).toString()),M.setAttribute("cy",(v/2).toString()),M.setAttribute("r",v.toString()),x&&F.setAttributes(M,x),M},F.createEllipse=function(v,x,M){var K=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return K.setAttribute("cx",(v/2).toString()),K.setAttribute("cy",(x/2).toString()),K.setAttribute("rx",(v/2).toString()),K.setAttribute("ry",(x/2).toString()),M&&F.setAttributes(K,M),K},F.createGroup=function(v){var x=document.createElementNS("http://www.w3.org/2000/svg","g");return v&&F.setAttributes(x,v),x},F.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},F.createMarker=function(v,x,M,K,N,ne,ke){var je=document.createElementNS("http://www.w3.org/2000/svg","marker");return F.setAttributes(je,[["id",v],["orient",x],["markerWidth",M.toString()],["markerHeight",K.toString()],["refX",N.toString()],["refY",ne.toString()]]),je.appendChild(ke),je},F.createText=function(v){var x=document.createElementNS("http://www.w3.org/2000/svg","text");return x.setAttribute("x","0"),x.setAttribute("y","0"),v&&F.setAttributes(x,v),x},F.createTSpan=function(v,x){var M=document.createElementNS("http://www.w3.org/2000/svg","tspan");return M.textContent=v,x&&F.setAttributes(M,x),M},F.createImage=function(v){var x=document.createElementNS("http://www.w3.org/2000/svg","image");return v&&F.setAttributes(x,v),x},F.createPoint=function(v,x){var M=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return M.x=v,M.y=x,M},F.createPath=function(v,x){var M=document.createElementNS("http://www.w3.org/2000/svg","path");return M.setAttribute("d",v),x&&F.setAttributes(M,x),M},F.createElement=function(v,x){var M=document.createElementNS("http://www.w3.org/2000/svg",v);return x&&F.setAttributes(M,x),M},F.getHollowRectanglePath=function(v,x,M,K,N,ne,ke,je){return"M"+v+","+x+"V"+(x+K)+"H"+(v+M)+"V"+x+"H"+N+"V"+ne+"H"+(N+ke)+"V"+(ne+je)+"H"+N+"V"+x+"Z"},F}(),At=function(){function F(v){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+v+"_"}return Object.defineProperty(F.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#333333",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarBackgroundActiveColor:"#282828",toolbarColor:"#eeeeee",cropShadeColor:"#ffffff",cropFrameColor:"#ffffff",gripColor:"#333333",gripFillColor:"#cccccc",toolbarHeight:40}},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),F.prototype.addClass=function(v){return this.styleSheet===void 0&&this.addStyleSheet(),v.name=""+this.classNamePrefix+v.localName,this.classes.push(v),this.styleSheet.sheet.insertRule("."+v.name+" {"+v.style+"}",this.styleSheet.sheet.cssRules.length),v},F.prototype.addRule=function(v){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(v),this.styleSheet.sheet.insertRule(v.selector+" {"+v.style+"}",this.styleSheet.sheet.cssRules.length)},F.prototype.addStyleSheet=function(){var v;this.styleSheet=document.createElement("style"),((v=this.styleSheetRoot)!==null&&v!==void 0?v:document.head).appendChild(this.styleSheet),this.addRule(new We("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new We("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new We("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new Ye("_fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new Ye("_fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},F.prototype.removeStyleSheet=function(){var v;this.styleSheet&&(((v=this.styleSheetRoot)!==null&&v!==void 0?v:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},F}(),We=function(F,v){this.selector=F,this.style=v},Ye=function(F,v){this.localName=F,this.style=v},rt=function(){function F(){this.blocks=[],this.display=""}return F.prototype.addButtonBlock=function(v){v.className=this.blockClassName,v.buttonClassName=this.buttonClassName,v.buttonColorsClassName=this.buttonColorsClassName,v.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(v)},F.prototype.addElementBlock=function(v){v.className===void 0&&(v.className=this.blockClassName),this.blocks.push(v)},F.prototype.getUI=function(){var v=document.createElement("div");return v.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,v.style.display=this.display,this.blocks.forEach(function(x){return v.appendChild(x.getUI())}),v},F}(),dt=function(){function F(){}return F.prototype.getUI=function(){var v=document.createElement("div");if(v.className=this.className,this.minWidth!==void 0&&(v.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":v.style.justifyContent="flex-start";break;case"center":v.style.justifyContent="center";break;case"end":v.style.justifyContent="flex-end"}return v.style.whiteSpace="nowrap",v},F}(),vt=function(F){function v(){var x=F!==null&&F.apply(this,arguments)||this;return x.buttons=[],x}return pt(v,F),v.prototype.addButton=function(x){x.className=this.buttonClassName,x.colorsClassName=this.buttonColorsClassName,x.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(x)},v.prototype.getUI=function(){var x=F.prototype.getUI.call(this);return this.buttons.forEach(function(M){return x.appendChild(M.getUI())}),x},v}(dt),ut=function(){function F(v,x){this._isActive=!1,this._isHidden=!1,this._icon=v,this.title=x,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(F.prototype,"icon",{get:function(){return this._icon},set:function(v){this._icon=v,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"isActive",{get:function(){return this._isActive},set:function(v){this._isActive=v,this.adjustClassName()},enumerable:!1,configurable:!0}),F.prototype.getUI=function(){var v=this;return this.buttonContainer=document.createElement("div"),this.buttonContainer.title=this.title,this.buttonContainer.className=this.className+" "+this.colorsClassName,this.adjustClassName(),this.buttonContainer.innerHTML=this._icon,this.onClick&&this.buttonContainer.addEventListener("click",function(){return v.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},F.prototype.adjustClassName=function(){this.activeColorsClassName&&(this._isActive&&this.buttonContainer.className.indexOf(this.activeColorsClassName)<0?this.buttonContainer.className+=" "+this.activeColorsClassName:this._isActive||(this.buttonContainer.className=this.buttonContainer.className.replace(this.activeColorsClassName,"")))},F.prototype.hide=function(){this._isHidden=!0},F}(),tt=function(F){function v(){var x=F!==null&&F.apply(this,arguments)||this;return x.elements=[],x}return pt(v,F),v.prototype.addElement=function(x){this.elements.push(x)},v.prototype.getUI=function(){var x=F.prototype.getUI.call(this);return this.elements.forEach(function(M){return x.appendChild(M)}),x},v}(dt),Ze=function(){function F(v,x){this.horizontal=v,this.vertical=x}return Object.defineProperty(F.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),F.prototype.getVerticalLength=function(v){return v/this.ratio},F.prototype.getHorizontalLength=function(v){return v*this.ratio},F}(),et=function(){function F(){}return F.getIcon=function(v,x){if(v>0&&x>0){var M=new Ze(v,x),K=M.ratio>=1?20:M.getHorizontalLength(20),N=M.ratio<1?20:M.getVerticalLength(20),ne=document.createElementNS("http://www.w3.org/2000/svg","svg");ne.setAttribute("xmlns","http://www.w3.org/2000/svg"),ne.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(ne);var ke=Ve.createDefs();ne.appendChild(ke);var je=Ve.createElement("clipPath",[["id","text-bg-clip"]]);ke.appendChild(je);var He=Ve.createPath(Ve.getHollowRectanglePath((24-K)/2,(24-N)/2,K,N,(24-K)/2+2,(24-N)/2+2,K-4,N-4));ne.appendChild(He);var Pe=Ve.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Pe.appendChild(Ve.createTSpan(v+":"+x)),ne.appendChild(Pe);var Xe=Pe.getBBox();Ve.setAttributes(Pe,[["x",((24-Xe.width)/2).toString()],["y",((24-Xe.height)/2-Xe.y).toString()]]);var Ke=Ve.createPath(Ve.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Xe.width))/2,(24-Math.ceil(Xe.height))/2,Math.ceil(Xe.width),Math.ceil(Xe.height)));return je.appendChild(Ke),Ve.setAttributes(He,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(ne),ne.outerHTML}return'<svg viewBox="0 0 24 24"><path d="M19 12h-2v3h-3v2h5v-5M7 9h3V7H5v5h2V9m14-6H3a2 2 0 00-2 2v14a2 2 0 002 2h18a2 2 0 002-2V5a2 2 0 00-2-2m0 16H3V5h18v14z"/></svg>'},F}(),st=function(F){function v(x,M,K){var N=F.call(this,x,M)||this;return N.isDropdownOpen=!1,N.onClick=N.dropdownButtonClicked,N.dropdownButtons=K,N}return pt(v,F),v.prototype.setupDropdown=function(){var x=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(M){M.className=x.className,M.colorsClassName=x.colorsClassName,x.dropdownBlock.appendChild(M.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},v.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},v.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},v.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},v.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},v.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},v}(ut),ot=function(){function F(v,x){this.GRIP_SIZE=10,this.color=v,this.fillColor=x,this.visual=Ve.createGroup(),this.visual.appendChild(Ve.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Ve.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return F.prototype.ownsTarget=function(v){return v===this.visual||v===this.visual.childNodes[0]||v===this.visual.childNodes[1]},F.prototype.setCenter=function(v,x){this.visual.childNodes.forEach(function(M){return Ve.setAttributes(M,[["cx",v.toString()],["cy",x.toString()]])})},F}(),lt=function(){function F(v,x,M,K){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=v,this.canvasHeight=x,this.margin=M,this.container=K,this.attachEvents=this.attachEvents.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.resize=this.resize.bind(this),this.adjustCropRect=this.adjustCropRect.bind(this),this.scaleCanvas=this.scaleCanvas.bind(this),this.getRescaledRect=this.getRescaledRect.bind(this)}return Object.defineProperty(F.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(v){this._aspectRatio=v,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(v){this._isGridVisible=v,this.gridContainer&&Ve.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(v){this._zoomFactor=v,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),F.prototype.open=function(){var v=this;this.cropShadeElement=Ve.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=Ve.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var x=0;x<this.numberOfGridLines;x++)this.horizontalGridLines.push(Ve.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(Ve.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(M){return v.gridContainer.appendChild(M)}),this.verticalGridLines.forEach(function(M){return v.gridContainer.appendChild(M)}),this.cropRectElement=Ve.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new ot(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new ot(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new ot(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new ot(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},F.prototype.setCropRectangle=function(v){this.cropRect=v;var x=Object.assign({},this.cropRect);this.zoomFactor!==1&&(x.width=this.cropRect.width*this.zoomFactor,x.height=this.cropRect.height*this.zoomFactor,x.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-x.width/2,x.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-x.height/2),Ve.setAttributes(this.cropRectElement,[["x",x.x.toString()],["y",x.y.toString()],["width",x.width.toString()],["height",x.height.toString()]]);var M=x.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(N,ne){var ke=x.y+M*(ne+1);Ve.setAttributes(N,[["x1",""+x.x],["y1",""+ke],["x2",""+(x.x+x.width)],["y2",""+ke]])});var K=x.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(N,ne){var ke=x.x+K*(ne+1);Ve.setAttributes(N,[["x1",""+ke],["y1",""+x.y],["x2",""+ke],["y2",""+(x.y+x.height)]])}),Ve.setAttributes(this.cropShadeElement,[["d",Ve.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,x.x,x.y,x.width,x.height)]]),this.topLeftGrip.setCenter(x.x,x.y),this.topRightGrip.setCenter(x.x+x.width,x.y),this.bottomLeftGrip.setCenter(x.x,x.y+x.height),this.bottomRightGrip.setCenter(x.x+x.width,x.y+x.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},F.prototype.attachEvents=function(){this.container.style.touchAction="none",this.container.addEventListener("pointerdown",this.onPointerDown),this.container.addEventListener("pointermove",this.onPointerMove),this.container.addEventListener("pointerup",this.onPointerUp)},F.prototype.clientToLocalCoordinates=function(v,x){var M=this.container.getBoundingClientRect();return{x:v-M.left+this.margin,y:x-M.top+this.margin}},F.prototype.onPointerDown=function(v){this.container.setPointerCapture(v.pointerId),this.previousPoint=this.clientToLocalCoordinates(v.clientX,v.clientY),this.cropRectElement===v.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(v.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(v.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(v.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(v.target)&&(this.activeGrip=this.bottomRightGrip)},F.prototype.onPointerMove=function(v){if(this.isMoving)this.move(this.clientToLocalCoordinates(v.clientX,v.clientY));else if(this.activeGrip){var x=this.clientToLocalCoordinates(v.clientX,v.clientY);this.resize(x)}v.preventDefault()},F.prototype.onPointerUp=function(v){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(v.pointerId)},F.prototype.move=function(v){var x=v.x-this.previousPoint.x,M=v.y-this.previousPoint.y;this.zoomFactor!==1&&(x=-x/this.zoomFactor,M=-M/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+x),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+M),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=v},F.prototype.resize=function(v){var x=Object.assign({},this.cropRect),M=v.x-this.previousPoint.x,K=v.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:x.x+M<this.margin&&(M=this.margin-x.x),x.x+=M,x.width=this.cropRect.x+this.cropRect.width-x.x;break;case this.bottomRightGrip:case this.topRightGrip:x.width+M>this.canvasWidth*this.zoomFactor&&(M=this.canvasWidth*this.zoomFactor-x.width),x.width+=M}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(x.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(M),x.height=this.aspectRatio.getVerticalLength(x.width)):(x.y+=K,x.height=this.cropRect.y+this.cropRect.height-x.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?x.height=this.aspectRatio.getVerticalLength(x.width):x.height+=K}x.width<10&&(x.x=this.cropRect.x,x.width=10),x.height<10&&(x.y=this.cropRect.y,x.height=10),this.previousPoint=v,x.x>=this.margin&&x.y>=this.margin&&x.x-this.margin+x.width<=this.canvasWidth&&x.y-this.margin+x.height<=this.canvasHeight&&(this.cropRect=x,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},F.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var v=this.cropRect.x+this.cropRect.width/2,x=this.cropRect.y+this.cropRect.height/2,M=this.aspectRatio.getHorizontalLength(this.cropRect.height),K=this.aspectRatio.getVerticalLength(this.cropRect.width);M/this.canvasWidth<K/this.canvasHeight?this.cropRect.width=M:this.cropRect.height=K,this.cropRect.width>this.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=v-this.cropRect.width/2,this.cropRect.y=x-this.cropRect.height/2,this.cropRect.x+this.cropRect.width>this.margin+this.canvasWidth&&(this.cropRect.x=this.margin+this.canvasWidth-this.cropRect.width),this.cropRect.y+this.cropRect.height>this.margin+this.canvasHeight&&(this.cropRect.y=this.margin+this.canvasHeight-this.cropRect.height),this.cropRect.x=Math.max(this.cropRect.x,this.margin),this.cropRect.y=Math.max(this.cropRect.y,this.margin)}},F.prototype.getRescaledRect=function(v,x,M,K,N,ne){var ke=M/v,je=K/x;return{x:(N.x-ne)*ke+ne,y:(N.y-ne)*je+ne,width:N.width*ke,height:N.height*je}},F.prototype.scaleCanvas=function(v,x){var M=this.getRescaledRect(this.canvasWidth,this.canvasHeight,v,x,this.cropRect,this.margin);this.canvasWidth=v,this.canvasHeight=x,this.onCropChange&&this.onCropChange(M),this.setCropRectangle(M)},F}(),ct=function(){function F(v){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=v,this.uiContainer=document.createElement("div"),this.getUI=this.getUI.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.setAngleLabel=this.setAngleLabel.bind(this),this.positionScaleShape=this.positionScaleShape.bind(this)}return Object.defineProperty(F.prototype,"angle",{get:function(){return this._angle},set:function(v){this._angle=v,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),F.prototype.getUI=function(){return this.controlContainer=document.createElement("div"),this.controlContainer.title=this.title,this.controlContainer.className=this.className+" "+this.colorsClassName,this.controlContainer.appendChild(this.getVisual()),this.controlContainer.addEventListener("pointerdown",this.onPointerDown),this.controlContainer.addEventListener("pointermove",this.onPointerMove),this.controlContainer.addEventListener("pointerup",this.onPointerUp),this.uiContainer.appendChild(this.controlContainer),this.uiContainer.style.display="inline-block",this.uiContainer.style.touchAction="none",this.setAngleLabel(),this.positionScaleShape(),this.uiContainer},F.prototype.onPointerDown=function(v){this.controlContainer.setPointerCapture(v.pointerId),this.isDragging=!0,this.previousPoint={x:v.clientX,y:v.clientY}},F.prototype.onPointerMove=function(v){this.isDragging&&(this.onAngleChange&&this.onAngleChange((v.clientX-this.previousPoint.x)/5),this.previousPoint.x=v.clientX)},F.prototype.onPointerUp=function(v){this.isDragging&&this.onAngleChange&&this.onAngleChange((v.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(v.pointerId)},F.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var v=this.angleLabelText.getBBox();Ve.setAttributes(this.angleLabelElement,[["x",((this.width-v.width)/2).toString()],["y",(this.height/2).toString()]])}},F.prototype.positionScaleShape=function(){if(this.scaleShape){var v=this.scaleShape.transform.baseVal.getItem(0);v.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(v,0)}},F.prototype.getVisual=function(){var v=document.createElementNS("http://www.w3.org/2000/svg","svg");v.setAttribute("xmlns","http://www.w3.org/2000/svg"),v.setAttribute("width",this.width+"px"),v.setAttribute("height",this.height+"px"),v.setAttribute("viewBox","0 0 "+this.width+" "+this.height),v.style.flexShrink="0",document.body.appendChild(v);for(var x="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,M=1;M<=this.width/5+10;M++){var K=M%5==0?this.height/3:this.height/6;x+="h4v"+-K+"h1v"+K}x+="v1H0Z",this.scaleShape=Ve.createPath(x);var N=Ve.createTransform();this.scaleShape.transform.baseVal.appendItem(N),v.appendChild(this.scaleShape),this.angleLabelElement=Ve.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=Ve.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var ne=Ve.createTSpan("");return ne.innerHTML="&deg;",this.angleLabelElement.appendChild(ne),v.appendChild(this.angleLabelElement),document.body.removeChild(v),v},F}(),Ct=function(){function F(){this.naturalSize=!1,this.imageType="image/png"}return F.prototype.rasterize=function(v,x,M,K,N,ne,ke){var je=this;return new Promise(function(He){var Pe=document.createElement("canvas");Pe.width=v.width.baseVal.value-2*K,Pe.height=v.height.baseVal.value-2*K;var Xe=1,Ke=1;je.naturalSize===!0?(Xe=x.naturalWidth/(v.width.baseVal.value-2*K)/ne,Ke=x.naturalHeight/(v.height.baseVal.value-2*K)/ke,Pe.width=x.naturalWidth/ne,Pe.height=x.naturalHeight/ke):je.width!==void 0&&je.height!==void 0&&(Xe=je.width/M.width,Ke=je.height/M.height,Pe.width*=Xe,Pe.height*=Ke);var at=Pe.getContext("2d");at.translate(Pe.width/2,Pe.height/2),at.rotate(N*Math.PI/180),at.scale(ne,ke),at.translate(-Pe.width/2,-Pe.height/2),at.drawImage(x,0,0,Pe.width,Pe.height);var St=document.createElement("canvas");St.width=M.width*Xe,St.height=M.height*Ke,St.getContext("2d").putImageData(at.getImageData((M.x-K)*Xe,(M.y-K)*Ke,M.width*Xe,M.height*Ke),0,0),He(St.toDataURL(je.imageType,je.imageQuality))})},F}(),Mt=function(){function F(v){this._zoomToCropEnabled=!0,this.zoomFactor=1,this.flippedHorizontally=!1,this.flippedVertically=!1,this._isGridVisible=!0,this._gridLines=2,this._rotationAngle=0,this.scaleFactor=1,this.renderEventListeners=[],this.closeEventListeners=[],this._isOpen=!1,this.CANVAS_MARGIN=20,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.displayMode="inline",this.popupMargin=30,this.toolbarHeight=40,this.aspectRatios=[{horizontal:0,vertical:0},{horizontal:4,vertical:3},{horizontal:3,vertical:2},{horizontal:16,vertical:9},{horizontal:1,vertical:1},{horizontal:3,vertical:4},{horizontal:2,vertical:3},{horizontal:9,vertical:16}],this._instanceNo=F.instanceCounter++,this.styles=new At(this.instanceNo),this.target=v,this.targetRoot=document.body,this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.rotateBy=this.rotateBy.bind(this),this.applyRotation=this.applyRotation.bind(this),this.cropRectChanged=this.cropRectChanged.bind(this),this.zoomToCrop=this.zoomToCrop.bind(this),this.unzoomFromCrop=this.unzoomFromCrop.bind(this),this.rotateLeftButtonClicked=this.rotateLeftButtonClicked.bind(this),this.rotateRightButtonClicked=this.rotateRightButtonClicked.bind(this),this.flipHorizontallyButtonClicked=this.flipHorizontallyButtonClicked.bind(this),this.flipVerticallyButtonClicked=this.flipVerticallyButtonClicked.bind(this),this.applyFlip=this.applyFlip.bind(this),this.startRenderAndClose=this.startRenderAndClose.bind(this),this.render=this.render.bind(this),this.onPopupResize=this.onPopupResize.bind(this),this.applyAspectRatio=this.applyAspectRatio.bind(this)}return Object.defineProperty(F.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(v){this._zoomToCropEnabled=v,v?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(v){this._isGridVisible=v,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"gridLines",{get:function(){return this._gridLines},set:function(v){this._gridLines=v,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(v){this._rotationAngle=v,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"aspectRatio",{get:function(){var v;return(v=this._aspectRatio)!==null&&v!==void 0?v:this.aspectRatios[0]},set:function(v){this._aspectRatio=v},enumerable:!1,configurable:!0}),F.prototype.open=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.setupResizeObserver(),this.initCropCanvas(),this.setEditingTarget(),this.setTopLeft(),this.initCropLayer(),this.attachEvents(),this.applyAspectRatio(),this.displayMode==="popup"&&this.onPopupResize(),this._isOpen=!0},F.prototype.show=function(){this.showUI(),this.open()},F.prototype.close=function(v){v===void 0&&(v=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),v||this.closeEventListeners.forEach(function(x){return x()}),this._isOpen=!1)},F.prototype.addRenderEventListener=function(v){this.renderEventListeners.push(v)},F.prototype.removeRenderEventListener=function(v){this.renderEventListeners.indexOf(v)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(v),1)},F.prototype.addCloseEventListener=function(v){this.closeEventListeners.push(v)},F.prototype.removeCloseEventListener=function(v){this.closeEventListeners.indexOf(v)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(v),1)},F.prototype.setupResizeObserver=function(){var v=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){v.resize(v.target.clientWidth,v.target.clientHeight)}),this.targetObserver.observe(this.target)):this.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},F.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var v=1*this.target.clientWidth/this.target.clientHeight,x=this.contentDiv.clientWidth/v>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*v:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,M=x+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/v;this.resize(x,M)}},F.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},F.prototype.setEditingTargetSize=function(){this.editorCanvas.style.width=this.imageWidth+2*this.CANVAS_MARGIN+"px",this.editorCanvas.style.height=this.imageHeight+2*this.CANVAS_MARGIN+"px",Ve.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},F.prototype.resize=function(v,x){this.imageWidth=Math.round(v),this.imageHeight=Math.round(x),this.setEditingTargetSize(),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.displayMode!=="popup"?this.coverDiv.style.width=this.paddedImageWidth+"px":(this.setTopLeft(),this.positionCropImage()),this.cropLayer.scaleCanvas(this.imageWidth,this.imageHeight),this.applyRotation()},F.prototype.setEditingTarget=function(){var v=document.createElement("canvas");v.width=this.target.naturalWidth,v.height=this.target.naturalHeight,v.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var x=v.toDataURL();Ve.setAttributes(this.editingTarget,[["href",x]]),this.setEditingTargetSize()},F.prototype.setTopLeft=function(){var v=this.target.getBoundingClientRect(),x=this.editorCanvas.getBoundingClientRect();this.left=v.left-x.left-this.CANVAS_MARGIN,this.top=v.top-x.top-this.CANVAS_MARGIN},F.prototype.initCropCanvas=function(){this.cropImageHolder=document.createElement("div"),this.cropImageHolder.style.setProperty("touch-action","none"),this.cropImageHolder.style.setProperty("-ms-touch-action","none"),this.cropImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.cropImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImage.style.pointerEvents="auto",this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.cropImageHolder.style.transformOrigin="top left",this.positionCropImage(),this.defs=Ve.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=Ve.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=Ve.createGroup(),this.editingTargetRotationScaleContainer=Ve.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var v=Ve.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(v);var x=Ve.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(x),this.editingTargetContainer=Ve.createGroup(),this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px)",this.editingTargetContainer.appendChild(this.editingTargetRotationContainer),this.cropImage.appendChild(this.editingTargetContainer),this.cropImageHolder.appendChild(this.cropImage),this.editorCanvas.appendChild(this.cropImageHolder)},F.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},F.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=Ve.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new lt(this.imageWidth,this.imageHeight,this.CANVAS_MARGIN,this.cropLayerContainer),this.cropLayer.onCropChange=this.cropRectChanged,this.cropLayer.numberOfGridLines=this.gridLines,this.cropLayer.isGridVisible=this.isGridVisible,this.cropLayer.cropShadeColor=this.styles.settings.cropShadeColor,this.cropLayer.cropFrameColor=this.styles.settings.cropFrameColor,this.cropLayer.gripColor=this.styles.settings.gripColor,this.cropLayer.gripFillColor=this.styles.settings.gripFillColor,this.cropLayer.open(),this.cropLayer.setCropRectangle(this.cropRect),this.zoomToCropEnabled&&this.zoomToCrop()},F.prototype.zoomToCrop=function(){if(this.cropRect){var v=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,x=this.cropRect.y-this.CANVAS_MARGIN+this.cropRect.height/2;this.zoomFactor=Math.min(this.imageWidth/this.cropRect.width,this.imageHeight/this.cropRect.height),this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin=v+"px "+x+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-v+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-x+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},F.prototype.unzoomFromCrop=function(){this.zoomFactor=1,this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin="center",this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px) scale(1)",this.cropLayer.zoomFactor=this.zoomFactor)},F.prototype.cropRectChanged=function(v){this.cropRect=v,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},F.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},F.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},F.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},F.prototype.showUI=function(){switch(this.addStyles(),this.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.displayMode){case"inline":this.coverDiv.style.position="absolute";var v=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,x=this.target.offsetTop>v+this.CANVAS_MARGIN?this.target.offsetTop-(v+this.CANVAS_MARGIN):0;this.coverDiv.style.top=x+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.displayMode==="popup"?this.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.addToolbars(),this.uiDiv.appendChild(this.topToolbar.getUI()),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.alignItems="center",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.contentDiv.style.overflow="hidden",this.contentDiv.style.backgroundColor=this.styles.settings.canvasBackgroundColor,this.displayMode==="popup"&&(this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.popupMargin+"px)"),this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.contentDiv.appendChild(this.editorCanvas),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},F.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},F.prototype.addTopToolbar=function(){var v=this;this.topToolbar=new rt,this.topToolbar.display=this.styles.settings.hideTopToolbar?"none":"",this.topToolbar.className=this.toolbarStyleClass.name,this.topToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.topToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.topToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.topToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.topToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.topToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var x=new vt;x.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(x);var M=[];this.aspectRatios.forEach(function(Ke){var at=new ut(et.getIcon(Ke.horizontal,Ke.vertical),Ke.horizontal===0&&Ke.vertical===0?"FREE":Ke.horizontal+":"+Ke.vertical);at.onClick=function(){return v.ratioButtonClicked(Ke)},M.push(at)}),this.aspectRatioButton=new st(et.getIcon(0,0),"Aspect ratio",M),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,x.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var K=new ut('<svg viewBox="0 0 24 24"><path d="M10 4v4h4V4h-4m6 0v4h4V4h-4m0 6v4h4v-4h-4m0 6v4h4v-4h-4m-2 4v-4h-4v4h4m-6 0v-4H4v4h4m0-6v-4H4v4h4m0-6V4H4v4h4m2 6h4v-4h-4v4M4 2h16a2 2 0 012 2v16a2 2 0 01-2 2H4c-1.08 0-2-.9-2-2V4a2 2 0 012-2z"/></svg>',"Toggle grid");K.isActive=this.isGridVisible,K.onClick=function(){v.isGridVisible=!v.isGridVisible,K.isActive=v.isGridVisible},x.addButton(K);var N=new ut('<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"Zoom to selection");if(N.isActive=this.zoomToCropEnabled,N.onClick=function(){v.zoomToCropEnabled=!v.zoomToCropEnabled,N.isActive=v.zoomToCropEnabled},x.addButton(N),!Tt.isLicensed){var ne=new tt;this.topToolbar.addElementBlock(ne);var ke=document.createElement("div");ke.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var je=document.createElement("a");je.style.color="currentColor",je.href="https://markerjs.com/products/cropro",je.target="_blank",je.innerHTML='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2"><path d="M16.326 14.895c0 1.126-.558 1.688-1.673 1.688H9.931c-1.116 0-1.674-.562-1.674-1.688V3.733c0-1.126.558-1.688 1.674-1.688h4.722c1.115 0 1.673.562 1.673 1.688v2.899h-1.957V3.793h-4.124v11.042h4.124v-3.242h1.957v3.302z" fill="currentColor"/><path d="M15.94 7.364a.783.783 0 00-1.065-.304l-11.01 6.126a.783.783 0 00-.303 1.065l4.498 8.085a.783.783 0 001.065.304l11.01-6.126a.783.783 0 00.303-1.065L15.94 7.364zM5.311 14.173l3.737 6.718 9.641-5.364-3.737-6.718-9.641 5.364z" fill="#eef762"/></svg>',ke.appendChild(je),ne.addElement(ke)}var He=new vt;He.minWidth=3*this.toolbarHeight+"px",He.contentAlign="end",this.topToolbar.addButtonBlock(He);var Pe=new ut('<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"OK");Pe.onClick=this.startRenderAndClose,He.addButton(Pe),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Pe.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Xe=new ut('<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"Close");Xe.onClick=this.close,He.addButton(Xe),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Xe.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},F.prototype.addBottomToolbar=function(){var v=this;this.bottomToolbar=new rt,this.bottomToolbar.display=this.styles.settings.hideBottomToolbar?"none":"",this.bottomToolbar.className=this.toolbarStyleClass.name,this.bottomToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.bottomToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.bottomToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.bottomToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.bottomToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.bottomToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var x=new vt;x.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(x);var M=new ut('<svg viewBox="0 0 24 24"><path d="M13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93M7.1 18.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03L7.1 18.32M6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47m1.02-4.47L5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47z"/></svg>',"Rotate left");M.onClick=this.rotateLeftButtonClicked,x.addButton(M);var K=new ut('<svg viewBox="0 0 24 24"><path d="M16.89 15.5l1.42 1.39c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.5M13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03m6.93-6.9a7.906 7.906 0 00-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47m-2.36-5.45L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45z"/></svg>',"Rotate right");K.onClick=this.rotateRightButtonClicked,x.addButton(K);var N=new tt;N.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(N),this.straightener=new ct("Straighten"),this.straightener.className=this.toolbarStraightenerStyleClass.name,this.straightener.colorsClassName=this.styles.settings.toolbarStraightenerColorsClassName?this.styles.settings.toolbarStraightenerColorsClassName:this.toolbarStraightenerStyleColorsClass.name,this.straightener.onAngleChange=function(He){v.rotateBy(He),v.straightener.angle=v.rotationAngle},N.addElement(this.straightener.getUI());var ne=new vt;ne.minWidth=2*this.toolbarHeight+"px",ne.contentAlign="end",this.bottomToolbar.addButtonBlock(ne);var ke=new ut('<svg viewBox="0 0 24 24"><path d="M15 21h2v-2h-2m4-10h2V7h-2M3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2m16-2v2h2c0-1.1-.9-2-2-2m-8 20h2V1h-2m8 16h2v-2h-2M15 5h2V3h-2m4 10h2v-2h-2m0 10c1.1 0 2-.9 2-2h-2z"/></svg>',"Flip horizontal");ke.onClick=this.flipHorizontallyButtonClicked,ne.addButton(ke);var je=new ut('<svg viewBox="0 0 24 24"><path d="M3 15v2h2v-2m10 4v2h2v-2m2-16H5c-1.1 0-2 .9-2 2v4h2V5h14v4h2V5c0-1.1-.9-2-2-2m2 16h-2v2c1.1 0 2-.9 2-2M1 11v2h22v-2M7 19v2h2v-2m10-4v2h2v-2m-10 4v2h2v-2M3 19c0 1.1.9 2 2 2v-2z"/></svg>',"Flip vertical");je.onClick=this.flipVerticallyButtonClicked,ne.addButton(je)},F.prototype.ratioButtonClicked=function(v){this.aspectRatio=v,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},F.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=et.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},F.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Ze(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},F.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},F.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},F.prototype.restoreState=function(v){if(v){var x=this.cropLayer.getRescaledRect(v.width,v.height,this.imageWidth,this.imageHeight,v.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(x),this.cropRectChanged(x),this.flippedHorizontally=v.flippedHorizontally,this.flippedVertically=v.flippedVertically,this.applyFlip(),this.rotationAngle=v.rotationAngle,this.applyRotation()}},F.prototype.clientToLocalCoordinates=function(v,x){var M=this.cropImage.getBoundingClientRect();return{x:v-M.left,y:x-M.top}},F.prototype.onWindowResize=function(){this.positionUI()},F.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var v=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=v+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)"}this.positionCropImage()},F.prototype.rotateLeftButtonClicked=function(){var v=this.rotationAngle-90;this.rotationAngle%90!=0&&(v+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(v)},F.prototype.rotateRightButtonClicked=function(){var v=this.rotationAngle+90;this.rotationAngle%90!=0&&(v-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(v)},F.prototype.rotateTo=function(v){v=(v=v>180?v-360:v)<=-180?v+360:v,this.rotationAngle=v,this.applyRotation()},F.prototype.rotateBy=function(v){this.rotateTo((this.rotationAngle+v)%360)},F.prototype.applyRotation=function(){var v=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var x=this.editingTargetRotationContainer.transform.baseVal.getItem(0);x.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(x,0);var M=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/M.width,this.imageHeight/M.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=v},F.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},F.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},F.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},F.prototype.startRenderAndClose=function(){return it(this,void 0,void 0,function(){var v,x;return _t(this,function(M){switch(M.label){case 0:return[4,this.render()];case 1:return v=M.sent(),x=this.getState(),this.renderEventListeners.forEach(function(K){return K(v,x)}),this.close(!0),[2]}})})},F.prototype.render=function(){return it(this,void 0,void 0,function(){var v;return _t(this,function(x){switch(x.label){case 0:return(v=new Ct).naturalSize=this.renderAtNaturalSize,v.imageType=this.renderImageType,v.imageQuality=this.renderImageQuality,v.width=this.renderWidth,v.height=this.renderHeight,this.unzoomFromCrop(),Ve.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,v.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 1:return x.sent(),[4,v.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return[2,x.sent()]}})})},F.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Ye("toolbar",`
width: `+(this.displayMode==="inline"?"100%":"calc(100vw - "+2*this.popupMargin+"px)")+`;
flex-shrink: 0;
display: flex;
flex-direction: row;
justify-content: space-between;
height: `+this.toolbarHeight+`px;
box-sizing: content-box;
overflow: hidden;
line-height: 0px;
`)),this.toolbarStyleColorsClass=this.styles.addClass(new Ye("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Ye("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var v=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Ye("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*v)+`px;
height: `+(this.toolbarHeight-2*v)+`px;
padding: `+v+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Ye("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Ye("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new We("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new We("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new Ye("toolbar_dropdown",`
position: absolute;
max-width: `+4*this.toolbarHeight+`px;
z-index: 20;
white-space: normal;
box-sizing: content-box;
box-shadow: 3px 3px rgba(33, 33, 33, 0.1);
margin: `+(this.displayMode==="inline"?"0":this.popupMargin)+`px;
line-height: 0px;
`)),this.toolbarDropdownStyleColorsClass=this.styles.addClass(new Ye("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new Ye("toolbar_straightener_block",`
display: flex;
overflow: hidden;
justify-content: center;
-webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 30%, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 100%);
`)),this.toolbarStraightenerStyleClass=this.styles.addClass(new Ye("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*v)+`px;
padding: `+v+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new Ye("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},F.instanceCounter=0,F}(),Nt=W("8hTe"),Wt=W.n(Nt),jt=/<pre[^>]*>/g;function Vt(F){var v=document.createElement("div");return v.innerHTML=F,v.childNodes.length===0?"":v.childNodes[0].nodeValue}var Kt=le.a=function(F){var v=F.value,x=v===void 0?"":v,M=F.edit,K=M===void 0?!1:M,N=F.className,ne=F.showTextOnly,ke=F.showLines,je=F.replaces,He=F.zoomImg,Pe=F.hasMask,Xe=F.style,Ke=Xe===void 0?{}:Xe,at=F.stylesPrev,St=at===void 0?{}:at,xt=String(x),Et=Object(A.useRef)(),Ot=Object(A.useRef)(),Ht=Object(A.useState)(""),Ft=Object(B.a)(Ht,2),yt=Ft[0],Rt=Ft[1],Gt=Object(A.useState)("office"),Lt=Object(B.a)(Gt,2),Yt=Lt[0],It=Lt[1],kt=function(){var mt=new Mt(Ot.current);mt.displayMode="popup",mt.addRenderEventListener(function(){var Ut=Object(R.a)(e.a.mark(function ft(Bt){var wt;return e.a.wrap(function(Pt){for(;;)switch(Pt.prev=Pt.next){case 0:return Et.current.style.display="none",Pt.next=3,Object(fe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Bt}});case 3:wt=Pt.sent,wt!=null&&wt.id&&je(Ot.current.getAttribute("src").replace(z.a.API_SERVER,""),"/api/attachments/".concat(wt==null?void 0:wt.id,"?type=").concat(wt.content_type));case 5:case"end":return Pt.stop()}},ft)}));return function(ft){return Ut.apply(this,arguments)}}()),mt.show()},Zt=function(){var mt=new ht(Ot.current);mt.settings.displayMode="popup",mt.addEventListener("render",function(){var Ut=Object(R.a)(e.a.mark(function ft(Bt){var wt;return e.a.wrap(function(Pt){for(;;)switch(Pt.prev=Pt.next){case 0:if(Et.current.style.display="none",!Ot.current){Pt.next=6;break}return Pt.next=4,Object(fe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Bt.dataUrl}});case 4:wt=Pt.sent,wt!=null&&wt.id&&je(Ot.current.getAttribute("src").replace(z.a.API_SERVER,""),"/api/attachments/".concat(wt==null?void 0:wt.id,"?type=").concat(wt.content_type));case 6:case"end":return Pt.stop()}},ft)}));return function(ft){return Ut.apply(this,arguments)}}()),mt.show(),window.markerArea=mt},Xt=Object(A.useMemo)(function(){Et.current&&(Et.current.style.zIndex=-1);try{var Dt=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,mt=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Ut=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;xt=xt.replace(Dt,"("+z.a.API_SERVER+"/api/attachments/").replace(mt,'"'+z.a.API_SERVER+"/api/attachments/").replace(Ut,'"'+z.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(Qt){}var ft=P(xt),Bt=T();if(xt.match(/\[TOC\]/)&&(ft=ft.replace("<p>[TOC]</p>",E()),y()),ft=ft.replace(/(__special_katext_id_\d+__)/g,function(Qt,Pt){var Jt=Bt[Pt],ti=Jt.type,ii=Jt.expression;return Object(ae.renderToString)(Vt(ii)||"",{displayMode:ti==="block",throwOnError:!1,output:"html"})}),ft=ft.replace(/▁/g,"\u2581\u2581\u2581"),b(),ne){var wt=document.createElement("div");return wt.innerHTML=ft,wt.innerText}return setTimeout(function(){return qt()},500),ft},[xt]),zt=Object(A.useRef)();p.WebkitLineClamp=ke,ke&&(Ke=Object(L.a)(Object(L.a)({},Ke),p));function $t(Dt){var mt=Dt.target;if(mt.tagName.toUpperCase()==="IMG"){if(He){var Ut=mt.getAttribute("src");Rt(Ut),It("image")}}else if(mt.tagName.toUpperCase()==="A"){var ft=mt.getAttribute("href");if(ft.indexOf("office")>-1)Dt.preventDefault(),Rt(ft),It("office");else if(ft.indexOf("application/pdf")>-1)Dt.preventDefault(),Rt(ft),It("pdf");else if(ft.indexOf("text/html")>-1)Dt.preventDefault(),Rt(ft),It("html");else if(ft.startsWith("#")){Dt.preventDefault();var Bt=document.getElementById(ft.replace("#",""));Bt&&Bt.scrollIntoView(!0)}}}var qt=function(){var mt,Ut=(mt=zt.current)===null||mt===void 0?void 0:mt.querySelectorAll("video");Ut==null||Ut.forEach(function(ft){if(ft.oncontextmenu=function(){return!1},ft.src.indexOf(".m3u8")>-1&&!ft.canPlayType("application/vnd.apple.mpegurl")){if(G.a.isSupported()){var Bt=new G.a;Bt.loadSource(ft.src),Bt.attachMedia(ft)}}})};Object(A.useEffect)(function(){if(zt.current&&Xt&&(Xt.match(jt)&&window.PR.prettyPrint()),zt.current)return zt.current.addEventListener("click",$t),function(){zt.current.removeEventListener("click",$t),b(),y()}},[Xt,zt.current,$t]);var ei=function(mt){if(!K)return;mt.target.nodeName==="IMG"?(Et.current.style.zIndex=1,Et.current.style.display="flex",Et.current.style.width=mt.target.clientWidth+"px",Et.current.style.height=mt.target.clientHeight+"px",Et.current.style.top=mt.target.offsetTop+"px",Et.current.style.left=mt.target.offsetLeft+"px",Ot.current.src=mt.target.getAttribute("src")):Et.current.style.display="none"};return g.a.createElement("div",{style:{position:"relative"}},g.a.createElement("div",{ref:zt,style:Object(L.a)({},Ke),className:"".concat(N||""," markdown-body ").concat(Wt.a.mdBody),onMouseOver:ei,dangerouslySetInnerHTML:{__html:Xt}}),g.a.createElement("div",{ref:Et,className:Wt.a.button},g.a.createElement(H.a,null,g.a.createElement(j.a,{onClick:function(){return kt()}},"\u88C1\u526A"),g.a.createElement(j.a,{onClick:function(){return Zt()}},"\u7F16\u8F91"))),g.a.createElement("img",{ref:Ot,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),g.a.createElement(ie.a,{close:!0,data:yt,type:yt!=null&&yt.length?Yt:"",style:Object(L.a)({},St),onClose:function(){return Rt("")}}))}},BU3w:function(Qe,le,W){"use strict";W.d(le,"a",function(){return R});var te=W("MNnm"),H="rc-util-key";function C(B){if(B.attachTo)return B.attachTo;var k=document.querySelector("head");return k||document.body}function j(B){var k,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(te.a)())return null;var A=document.createElement("style");if((k=e.csp)===null||k===void 0?void 0:k.nonce){var g;A.nonce=(g=e.csp)===null||g===void 0?void 0:g.nonce}A.innerHTML=B;var c=C(e),l=c.firstChild;return e.prepend&&c.prepend?c.prepend(A):e.prepend&&l?c.insertBefore(A,l):c.appendChild(A),A}var L=new Map;function R(B,k){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},A=C(e);if(!L.has(A)){var g=j("",e),c=g.parentNode;L.set(A,c),c.removeChild(g)}var l=Array.from(L.get(A).children).find(function(r){return r.tagName==="STYLE"&&r[H]===k});if(l){var n,a;if(((n=e.csp)===null||n===void 0?void 0:n.nonce)&&l.nonce!==((a=e.csp)===null||a===void 0?void 0:a.nonce)){var o;l.nonce=(o=e.csp)===null||o===void 0?void 0:o.nonce}return l.innerHTML!==B&&(l.innerHTML=B),l}var s=j(B,e);return s[H]=k,s}},"C/vA":function(Qe,le,W){"use strict";W.d(le,"a",function(){return te});function te(H){const C=this;let j=!1,L;return function(){return j||(j=!0,L=H.apply(C,arguments)),L}}},"Cg/j":function(Qe,le,W){"use strict";W.d(le,"b",function(){return te}),W.d(le,"a",function(){return H}),W.d(le,"c",function(){return j}),W.d(le,"d",function(){return L});var te;(function(R){R.serviceIds=new Map,R.DI_TARGET="$di$target",R.DI_DEPENDENCIES="$di$dependencies";function B(k){return k[R.DI_DEPENDENCIES]||[]}R.getServiceDependencies=B})(te||(te={}));const H=j("instantiationService");function C(R,B,k,e){B[te.DI_TARGET]===B?B[te.DI_DEPENDENCIES].push({id:R,index:k,optional:e}):(B[te.DI_DEPENDENCIES]=[{id:R,index:k,optional:e}],B[te.DI_TARGET]=B)}function j(R){if(te.serviceIds.has(R))return te.serviceIds.get(R);const B=function(k,e,A){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");C(B,k,A,!1)};return B.toString=()=>R,te.serviceIds.set(R,B),B}function L(R){return function(B,k,e){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");C(R,B,e,!0)}}},DlQD:function(Qe,le,W){(function(te,H){Qe.exports=H()})(this,function(){"use strict";function te(de,re){for(var oe=0;oe<re.length;oe++){var V=re[oe];V.enumerable=V.enumerable||!1,V.configurable=!0,"value"in V&&(V.writable=!0),Object.defineProperty(de,V.key,V)}}function H(de,re,oe){return re&&te(de.prototype,re),oe&&te(de,oe),de}function C(de,re){if(!de)return;if(typeof de=="string")return j(de,re);var oe=Object.prototype.toString.call(de).slice(8,-1);if(oe==="Object"&&de.constructor&&(oe=de.constructor.name),oe==="Map"||oe==="Set")return Array.from(de);if(oe==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(oe))return j(de,re)}function j(de,re){(re==null||re>de.length)&&(re=de.length);for(var oe=0,V=new Array(re);oe<re;oe++)V[oe]=de[oe];return V}function L(de,re){var oe;if(typeof Symbol=="undefined"||de[Symbol.iterator]==null){if(Array.isArray(de)||(oe=C(de))||re&&de&&typeof de.length=="number"){oe&&(de=oe);var V=0;return function(){return V>=de.length?{done:!0}:{done:!1,value:de[V++]}}}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 oe=de[Symbol.iterator](),oe.next.bind(oe)}function R(de,re){return re={exports:{}},de(re,re.exports),re.exports}var B=R(function(de){function re(){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 oe(V){de.exports.defaults=V}de.exports={defaults:re(),getDefaults:re,changeDefaults:oe}}),k=B.defaults,e=B.getDefaults,A=B.changeDefaults,g=/[&<>"']/,c=/[&<>"']/g,l=/[<>"']|&(?!#?\w+;)/,n=/[<>"']|&(?!#?\w+;)/g,a={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},o=function(re){return a[re]};function s(de,re){if(re){if(g.test(de))return de.replace(c,o)}else if(l.test(de))return de.replace(n,o);return de}var r=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function i(de){return de.replace(r,function(re,oe){return oe=oe.toLowerCase(),oe==="colon"?":":oe.charAt(0)==="#"?oe.charAt(1)==="x"?String.fromCharCode(parseInt(oe.substring(2),16)):String.fromCharCode(+oe.substring(1)):""})}var t=/(^|[^\[])\^/g;function y(de,re){de=de.source||de,re=re||"";var oe={replace:function(Q,q){return q=q.source||q,q=q.replace(t,"$1"),de=de.replace(Q,q),oe},getRegex:function(){return new RegExp(de,re)}};return oe}var p=/[^\w:]/g,m=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function E(de,re,oe){if(de){var V;try{V=decodeURIComponent(i(oe)).replace(p,"").toLowerCase()}catch(Q){return null}if(V.indexOf("javascript:")===0||V.indexOf("vbscript:")===0||V.indexOf("data:")===0)return null}re&&!m.test(oe)&&(oe=f(re,oe));try{oe=encodeURI(oe).replace(/%25/g,"%")}catch(Q){return null}return oe}var _={},h=/^[^:]+:\/*[^/]*$/,u=/^([^:]+:)[\s\S]*$/,d=/^([^:]+:\/*[^/]*)[\s\S]*$/;function f(de,re){_[" "+de]||(h.test(de)?_[" "+de]=de+"/":_[" "+de]=D(de,"/",!0)),de=_[" "+de];var oe=de.indexOf(":")===-1;return re.substring(0,2)==="//"?oe?re:de.replace(u,"$1")+re:re.charAt(0)==="/"?oe?re:de.replace(d,"$1")+re:de+re}var T={exec:function(){}};function b(de){for(var re=1,oe,V;re<arguments.length;re++){oe=arguments[re];for(V in oe)Object.prototype.hasOwnProperty.call(oe,V)&&(de[V]=oe[V])}return de}function S(de,re){var oe=de.replace(/\|/g,function(q,ee,ge){for(var we=!1,Ne=ee;--Ne>=0&&ge[Ne]==="\\";)we=!we;return we?"|":" |"}),V=oe.split(/ \|/),Q=0;if(V.length>re)V.splice(re);else for(;V.length<re;)V.push("");for(;Q<V.length;Q++)V[Q]=V[Q].trim().replace(/\\\|/g,"|");return V}function D(de,re,oe){var V=de.length;if(V===0)return"";for(var Q=0;Q<V;){var q=de.charAt(V-Q-1);if(q===re&&!oe)Q++;else if(q!==re&&oe)Q++;else break}return de.substr(0,V-Q)}function I(de,re){if(de.indexOf(re[1])===-1)return-1;for(var oe=de.length,V=0,Q=0;Q<oe;Q++)if(de[Q]==="\\")Q++;else if(de[Q]===re[0])V++;else if(de[Q]===re[1]&&(V--,V<0))return Q;return-1}function w(de){de&&de.sanitize&&!de.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:s,unescape:i,edit:y,cleanUrl:E,resolveUrl:f,noopTest:T,merge:b,splitCells:S,rtrim:D,findClosingBracket:I,checkSanitizeDeprecation:w},U=B.defaults,O=P.rtrim,G=P.splitCells,z=P.escape,ae=P.findClosingBracket;function ie(de,re,oe){var V=re.href,Q=re.title?z(re.title):null,q=de[1].replace(/\\([\[\]])/g,"$1");return de[0].charAt(0)!=="!"?{type:"link",raw:oe,href:V,title:Q,text:q}:{type:"image",raw:oe,href:V,title:Q,text:z(q)}}function fe(de,re){var oe=de.match(/^(\s+)(?:```)/);if(oe===null)return re;var V=oe[1];return re.split(`
`).map(function(Q){var q=Q.match(/^\s+/);if(q===null)return Q;var ee=q[0];return ee.length>=V.length?Q.slice(V.length):Q}).join(`
`)}var ce=function(){function de(oe){this.options=oe||U}var re=de.prototype;return re.space=function(V){var Q=this.rules.block.newline.exec(V);if(Q)return Q[0].length>1?{type:"space",raw:Q[0]}:{raw:`
`}},re.code=function(V,Q){var q=this.rules.block.code.exec(V);if(q){var ee=Q[Q.length-1];if(ee&&ee.type==="paragraph")return{raw:q[0],text:q[0].trimRight()};var ge=q[0].replace(/^ {4}/gm,"");return{type:"code",raw:q[0],codeBlockStyle:"indented",text:this.options.pedantic?ge:O(ge,`
`)}}},re.fences=function(V){var Q=this.rules.block.fences.exec(V);if(Q){var q=Q[0],ee=fe(q,Q[3]||"");return{type:"code",raw:q,lang:Q[2]?Q[2].trim():Q[2],text:ee}}},re.heading=function(V){var Q=this.rules.block.heading.exec(V);if(Q)return{type:"heading",raw:Q[0],depth:Q[1].length,text:Q[2]}},re.nptable=function(V){var Q=this.rules.block.nptable.exec(V);if(Q){var q={type:"table",header:G(Q[1].replace(/^ *| *\| *$/g,"")),align:Q[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Q[3]?Q[3].replace(/\n$/,"").split(`
`):[],raw:Q[0]};if(q.header.length===q.align.length){var ee=q.align.length,ge;for(ge=0;ge<ee;ge++)/^ *-+: *$/.test(q.align[ge])?q.align[ge]="right":/^ *:-+: *$/.test(q.align[ge])?q.align[ge]="center":/^ *:-+ *$/.test(q.align[ge])?q.align[ge]="left":q.align[ge]=null;for(ee=q.cells.length,ge=0;ge<ee;ge++)q.cells[ge]=G(q.cells[ge],q.header.length);return q}}},re.hr=function(V){var Q=this.rules.block.hr.exec(V);if(Q)return{type:"hr",raw:Q[0]}},re.blockquote=function(V){var Q=this.rules.block.blockquote.exec(V);if(Q){var q=Q[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:Q[0],text:q}}},re.list=function(V){var Q=this.rules.block.list.exec(V);if(Q){for(var q=Q[0],ee=Q[2],ge=ee.length>1,we=ee[ee.length-1]===")",Ne={type:"list",raw:q,ordered:ge,start:ge?+ee.slice(0,-1):"",loose:!1,items:[]},Ge=Q[0].match(this.rules.block.item),Je=!1,ze,qe,nt,$e,gt,ht,bt,pt=Ge.length,it=0;it<pt;it++)ze=Ge[it],q=ze,qe=ze.length,ze=ze.replace(/^ *([*+-]|\d+[.)]) */,""),~ze.indexOf(`
`)&&(qe-=ze.length,ze=this.options.pedantic?ze.replace(/^ {1,4}/gm,""):ze.replace(new RegExp("^ {1,"+qe+"}","gm"),"")),it!==pt-1&&(nt=this.rules.block.bullet.exec(Ge[it+1])[0],(ge?nt.length===1||!we&&nt[nt.length-1]===")":nt.length>1||this.options.smartLists&&nt!==ee)&&($e=Ge.slice(it+1).join(`
`),Ne.raw=Ne.raw.substring(0,Ne.raw.length-$e.length),it=pt-1)),gt=Je||/\n\n(?!\s*$)/.test(ze),it!==pt-1&&(Je=ze.charAt(ze.length-1)===`
`,gt||(gt=Je)),gt&&(Ne.loose=!0),ht=/^\[[ xX]\] /.test(ze),bt=void 0,ht&&(bt=ze[1]!==" ",ze=ze.replace(/^\[[ xX]\] +/,"")),Ne.items.push({type:"list_item",raw:q,task:ht,checked:bt,loose:gt,text:ze});return Ne}},re.html=function(V){var Q=this.rules.block.html.exec(V);if(Q)return{type:this.options.sanitize?"paragraph":"html",raw:Q[0],pre:!this.options.sanitizer&&(Q[1]==="pre"||Q[1]==="script"||Q[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Q[0]):z(Q[0]):Q[0]}},re.def=function(V){var Q=this.rules.block.def.exec(V);if(Q){Q[3]&&(Q[3]=Q[3].substring(1,Q[3].length-1));var q=Q[1].toLowerCase().replace(/\s+/g," ");return{tag:q,raw:Q[0],href:Q[2],title:Q[3]}}},re.table=function(V){var Q=this.rules.block.table.exec(V);if(Q){var q={type:"table",header:G(Q[1].replace(/^ *| *\| *$/g,"")),align:Q[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Q[3]?Q[3].replace(/\n$/,"").split(`
`):[]};if(q.header.length===q.align.length){q.raw=Q[0];var ee=q.align.length,ge;for(ge=0;ge<ee;ge++)/^ *-+: *$/.test(q.align[ge])?q.align[ge]="right":/^ *:-+: *$/.test(q.align[ge])?q.align[ge]="center":/^ *:-+ *$/.test(q.align[ge])?q.align[ge]="left":q.align[ge]=null;for(ee=q.cells.length,ge=0;ge<ee;ge++)q.cells[ge]=G(q.cells[ge].replace(/^ *\| *| *\| *$/g,""),q.header.length);return q}}},re.lheading=function(V){var Q=this.rules.block.lheading.exec(V);if(Q)return{type:"heading",raw:Q[0],depth:Q[2].charAt(0)==="="?1:2,text:Q[1]}},re.paragraph=function(V){var Q=this.rules.block.paragraph.exec(V);if(Q)return{type:"paragraph",raw:Q[0],text:Q[1].charAt(Q[1].length-1)===`
`?Q[1].slice(0,-1):Q[1]}},re.text=function(V,Q){var q=this.rules.block.text.exec(V);if(q){var ee=Q[Q.length-1];return ee&&ee.type==="text"?{raw:q[0],text:q[0]}:{type:"text",raw:q[0],text:q[0]}}},re.escape=function(V){var Q=this.rules.inline.escape.exec(V);if(Q)return{type:"escape",raw:Q[0],text:z(Q[1])}},re.tag=function(V,Q,q){var ee=this.rules.inline.tag.exec(V);if(ee)return!Q&&/^<a /i.test(ee[0])?Q=!0:Q&&/^<\/a>/i.test(ee[0])&&(Q=!1),!q&&/^<(pre|code|kbd|script)(\s|>)/i.test(ee[0])?q=!0:q&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(ee[0])&&(q=!1),{type:this.options.sanitize?"text":"html",raw:ee[0],inLink:Q,inRawBlock:q,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ee[0]):z(ee[0]):ee[0]}},re.link=function(V){var Q=this.rules.inline.link.exec(V);if(Q){var q=ae(Q[2],"()");if(q>-1){var ee=Q[0].indexOf("!")===0?5:4,ge=ee+Q[1].length+q;Q[2]=Q[2].substring(0,q),Q[0]=Q[0].substring(0,ge).trim(),Q[3]=""}var we=Q[2],Ne="";if(this.options.pedantic){var Ge=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(we);Ge?(we=Ge[1],Ne=Ge[3]):Ne=""}else Ne=Q[3]?Q[3].slice(1,-1):"";we=we.trim().replace(/^<([\s\S]*)>$/,"$1");var Je=ie(Q,{href:we&&we.replace(this.rules.inline._escapes,"$1"),title:Ne&&Ne.replace(this.rules.inline._escapes,"$1")},Q[0]);return Je}},re.reflink=function(V,Q){var q;if((q=this.rules.inline.reflink.exec(V))||(q=this.rules.inline.nolink.exec(V))){var ee=(q[2]||q[1]).replace(/\s+/g," ");if(ee=Q[ee.toLowerCase()],!ee||!ee.href){var ge=q[0].charAt(0);return{type:"text",raw:ge,text:ge}}var we=ie(q,ee,q[0]);return we}},re.strong=function(V,Q,q){q===void 0&&(q="");var ee=this.rules.inline.strong.start.exec(V);if(ee&&(!ee[1]||ee[1]&&(q===""||this.rules.inline.punctuation.exec(q)))){Q=Q.slice(-1*V.length);var ge=ee[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;ge.lastIndex=0;for(var we;(ee=ge.exec(Q))!=null;)if(we=this.rules.inline.strong.middle.exec(Q.slice(0,ee.index+3)),we)return{type:"strong",raw:V.slice(0,we[0].length),text:V.slice(2,we[0].length-2)}}},re.em=function(V,Q,q){q===void 0&&(q="");var ee=this.rules.inline.em.start.exec(V);if(ee&&(!ee[1]||ee[1]&&(q===""||this.rules.inline.punctuation.exec(q)))){Q=Q.slice(-1*V.length);var ge=ee[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;ge.lastIndex=0;for(var we;(ee=ge.exec(Q))!=null;)if(we=this.rules.inline.em.middle.exec(Q.slice(0,ee.index+2)),we)return{type:"em",raw:V.slice(0,we[0].length),text:V.slice(1,we[0].length-1)}}},re.codespan=function(V){var Q=this.rules.inline.code.exec(V);if(Q){var q=Q[2].replace(/\n/g," "),ee=/[^ ]/.test(q),ge=q.startsWith(" ")&&q.endsWith(" ");return ee&&ge&&(q=q.substring(1,q.length-1)),q=z(q,!0),{type:"codespan",raw:Q[0],text:q}}},re.br=function(V){var Q=this.rules.inline.br.exec(V);if(Q)return{type:"br",raw:Q[0]}},re.del=function(V){var Q=this.rules.inline.del.exec(V);if(Q)return{type:"del",raw:Q[0],text:Q[1]}},re.autolink=function(V,Q){var q=this.rules.inline.autolink.exec(V);if(q){var ee,ge;return q[2]==="@"?(ee=z(this.options.mangle?Q(q[1]):q[1]),ge="mailto:"+ee):(ee=z(q[1]),ge=ee),{type:"link",raw:q[0],text:ee,href:ge,tokens:[{type:"text",raw:ee,text:ee}]}}},re.url=function(V,Q){var q;if(q=this.rules.inline.url.exec(V)){var ee,ge;if(q[2]==="@")ee=z(this.options.mangle?Q(q[0]):q[0]),ge="mailto:"+ee;else{var we;do we=q[0],q[0]=this.rules.inline._backpedal.exec(q[0])[0];while(we!==q[0]);ee=z(q[0]),q[1]==="www."?ge="http://"+ee:ge=ee}return{type:"link",raw:q[0],text:ee,href:ge,tokens:[{type:"text",raw:ee,text:ee}]}}},re.inlineText=function(V,Q,q){var ee=this.rules.inline.text.exec(V);if(ee){var ge;return Q?ge=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ee[0]):z(ee[0]):ee[0]:ge=z(this.options.smartypants?q(ee[0]):ee[0]),{type:"text",raw:ee[0],text:ge}}},de}(),J=P.noopTest,Z=P.edit,ue=P.merge,X={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:J,table:J,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};X._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,X._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,X.def=Z(X.def).replace("label",X._label).replace("title",X._title).getRegex(),X.bullet=/(?:[*+-]|\d{1,9}[.)])/,X.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,X.item=Z(X.item,"gm").replace(/bull/g,X.bullet).getRegex(),X.list=Z(X.list).replace(/bull/g,X.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+X.def.source+")").getRegex(),X._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",X._comment=/<!--(?!-?>)[\s\S]*?-->/,X.html=Z(X.html,"i").replace("comment",X._comment).replace("tag",X._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),X.paragraph=Z(X._paragraph).replace("hr",X.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",X._tag).getRegex(),X.blockquote=Z(X.blockquote).replace("paragraph",X.paragraph).getRegex(),X.normal=ue({},X),X.gfm=ue({},X.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*|$)"}),X.gfm.nptable=Z(X.gfm.nptable).replace("hr",X.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",X._tag).getRegex(),X.gfm.table=Z(X.gfm.table).replace("hr",X.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",X._tag).getRegex(),X.pedantic=ue({},X.normal,{html:Z(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",X._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:J,paragraph:Z(X.normal._paragraph).replace("hr",X.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",X.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var $={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:J,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:J,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};$._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",$.punctuation=Z($.punctuation).replace(/punctuation/g,$._punctuation).getRegex(),$._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",$._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",$.em.start=Z($.em.start).replace(/punctuation/g,$._punctuation).getRegex(),$.em.middle=Z($.em.middle).replace(/punctuation/g,$._punctuation).replace(/overlapSkip/g,$._overlapSkip).getRegex(),$.em.endAst=Z($.em.endAst,"g").replace(/punctuation/g,$._punctuation).getRegex(),$.em.endUnd=Z($.em.endUnd,"g").replace(/punctuation/g,$._punctuation).getRegex(),$.strong.start=Z($.strong.start).replace(/punctuation/g,$._punctuation).getRegex(),$.strong.middle=Z($.strong.middle).replace(/punctuation/g,$._punctuation).replace(/blockSkip/g,$._blockSkip).getRegex(),$.strong.endAst=Z($.strong.endAst,"g").replace(/punctuation/g,$._punctuation).getRegex(),$.strong.endUnd=Z($.strong.endUnd,"g").replace(/punctuation/g,$._punctuation).getRegex(),$.blockSkip=Z($._blockSkip,"g").getRegex(),$.overlapSkip=Z($._overlapSkip,"g").getRegex(),$._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,$._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,$._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])?)+(?![-_])/,$.autolink=Z($.autolink).replace("scheme",$._scheme).replace("email",$._email).getRegex(),$._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,$.tag=Z($.tag).replace("comment",X._comment).replace("attribute",$._attribute).getRegex(),$._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,$._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,$._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,$.link=Z($.link).replace("label",$._label).replace("href",$._href).replace("title",$._title).getRegex(),$.reflink=Z($.reflink).replace("label",$._label).getRegex(),$.reflinkSearch=Z($.reflinkSearch,"g").replace("reflink",$.reflink).replace("nolink",$.nolink).getRegex(),$.normal=ue({},$),$.pedantic=ue({},$.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:Z(/^!?\[(label)\]\((.*?)\)/).replace("label",$._label).getRegex(),reflink:Z(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",$._label).getRegex()}),$.gfm=ue({},$.normal,{escape: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.!#$%&'*+\/=?_`{\|}~-]+@))/}),$.gfm.url=Z($.gfm.url,"i").replace("email",$.gfm._extended_email).getRegex(),$.breaks=ue({},$.gfm,{br:Z($.br).replace("{2,}","*").getRegex(),text:Z($.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var be={block:X,inline:$},Re=B.defaults,Ie=be.block,Le=be.inline;function Fe(de){return de.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 ye(de){var re="",oe,V,Q=de.length;for(oe=0;oe<Q;oe++)V=de.charCodeAt(oe),Math.random()>.5&&(V="x"+V.toString(16)),re+="&#"+V+";";return re}var Te=function(){function de(oe){this.tokens=[],this.tokens.links=Object.create(null),this.options=oe||Re,this.options.tokenizer=this.options.tokenizer||new ce,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var V={block:Ie.normal,inline:Le.normal};this.options.pedantic?(V.block=Ie.pedantic,V.inline=Le.pedantic):this.options.gfm&&(V.block=Ie.gfm,this.options.breaks?V.inline=Le.breaks:V.inline=Le.gfm),this.tokenizer.rules=V}de.lex=function(V,Q){var q=new de(Q);return q.lex(V)};var re=de.prototype;return re.lex=function(V){return V=V.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(V,this.tokens,!0),this.inline(this.tokens),this.tokens},re.blockTokens=function(V,Q,q){Q===void 0&&(Q=[]),q===void 0&&(q=!0),V=V.replace(/^ +$/gm,"");for(var ee,ge,we,Ne;V;){if(ee=this.tokenizer.space(V)){V=V.substring(ee.raw.length),ee.type&&Q.push(ee);continue}if(ee=this.tokenizer.code(V,Q)){V=V.substring(ee.raw.length),ee.type?Q.push(ee):(Ne=Q[Q.length-1],Ne.raw+=`
`+ee.raw,Ne.text+=`
`+ee.text);continue}if(ee=this.tokenizer.fences(V)){V=V.substring(ee.raw.length),Q.push(ee);continue}if(ee=this.tokenizer.heading(V)){V=V.substring(ee.raw.length),Q.push(ee);continue}if(ee=this.tokenizer.nptable(V)){V=V.substring(ee.raw.length),Q.push(ee);continue}if(ee=this.tokenizer.hr(V)){V=V.substring(ee.raw.length),Q.push(ee);continue}if(ee=this.tokenizer.blockquote(V)){V=V.substring(ee.raw.length),ee.tokens=this.blockTokens(ee.text,[],q),Q.push(ee);continue}if(ee=this.tokenizer.list(V)){for(V=V.substring(ee.raw.length),we=ee.items.length,ge=0;ge<we;ge++)ee.items[ge].tokens=this.blockTokens(ee.items[ge].text,[],!1);Q.push(ee);continue}if(ee=this.tokenizer.html(V)){V=V.substring(ee.raw.length),Q.push(ee);continue}if(q&&(ee=this.tokenizer.def(V))){V=V.substring(ee.raw.length),this.tokens.links[ee.tag]||(this.tokens.links[ee.tag]={href:ee.href,title:ee.title});continue}if(ee=this.tokenizer.table(V)){V=V.substring(ee.raw.length),Q.push(ee);continue}if(ee=this.tokenizer.lheading(V)){V=V.substring(ee.raw.length),Q.push(ee);continue}if(q&&(ee=this.tokenizer.paragraph(V))){V=V.substring(ee.raw.length),Q.push(ee);continue}if(ee=this.tokenizer.text(V,Q)){V=V.substring(ee.raw.length),ee.type?Q.push(ee):(Ne=Q[Q.length-1],Ne.raw+=`
`+ee.raw,Ne.text+=`
`+ee.text);continue}if(V){var Ge="Infinite loop on byte: "+V.charCodeAt(0);if(this.options.silent){console.error(Ge);break}else throw new Error(Ge)}}return Q},re.inline=function(V){var Q,q,ee,ge,we,Ne,Ge=V.length;for(Q=0;Q<Ge;Q++){Ne=V[Q];switch(Ne.type){case"paragraph":case"text":case"heading":{Ne.tokens=[],this.inlineTokens(Ne.text,Ne.tokens);break}case"table":{for(Ne.tokens={header:[],cells:[]},ge=Ne.header.length,q=0;q<ge;q++)Ne.tokens.header[q]=[],this.inlineTokens(Ne.header[q],Ne.tokens.header[q]);for(ge=Ne.cells.length,q=0;q<ge;q++)for(we=Ne.cells[q],Ne.tokens.cells[q]=[],ee=0;ee<we.length;ee++)Ne.tokens.cells[q][ee]=[],this.inlineTokens(we[ee],Ne.tokens.cells[q][ee]);break}case"blockquote":{this.inline(Ne.tokens);break}case"list":{for(ge=Ne.items.length,q=0;q<ge;q++)this.inline(Ne.items[q].tokens);break}}}return V},re.inlineTokens=function(V,Q,q,ee,ge){Q===void 0&&(Q=[]),q===void 0&&(q=!1),ee===void 0&&(ee=!1),ge===void 0&&(ge="");var we,Ne=V,Ge;if(this.tokens.links){var Je=Object.keys(this.tokens.links);if(Je.length>0)for(;(Ge=this.tokenizer.rules.inline.reflinkSearch.exec(Ne))!=null;)Je.includes(Ge[0].slice(Ge[0].lastIndexOf("[")+1,-1))&&(Ne=Ne.slice(0,Ge.index)+"["+"a".repeat(Ge[0].length-2)+"]"+Ne.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Ge=this.tokenizer.rules.inline.blockSkip.exec(Ne))!=null;)Ne=Ne.slice(0,Ge.index)+"["+"a".repeat(Ge[0].length-2)+"]"+Ne.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;V;){if(we=this.tokenizer.escape(V)){V=V.substring(we.raw.length),Q.push(we);continue}if(we=this.tokenizer.tag(V,q,ee)){V=V.substring(we.raw.length),q=we.inLink,ee=we.inRawBlock,Q.push(we);continue}if(we=this.tokenizer.link(V)){V=V.substring(we.raw.length),we.type==="link"&&(we.tokens=this.inlineTokens(we.text,[],!0,ee)),Q.push(we);continue}if(we=this.tokenizer.reflink(V,this.tokens.links)){V=V.substring(we.raw.length),we.type==="link"&&(we.tokens=this.inlineTokens(we.text,[],!0,ee)),Q.push(we);continue}if(we=this.tokenizer.strong(V,Ne,ge)){V=V.substring(we.raw.length),we.tokens=this.inlineTokens(we.text,[],q,ee),Q.push(we);continue}if(we=this.tokenizer.em(V,Ne,ge)){V=V.substring(we.raw.length),we.tokens=this.inlineTokens(we.text,[],q,ee),Q.push(we);continue}if(we=this.tokenizer.codespan(V)){V=V.substring(we.raw.length),Q.push(we);continue}if(we=this.tokenizer.br(V)){V=V.substring(we.raw.length),Q.push(we);continue}if(we=this.tokenizer.del(V)){V=V.substring(we.raw.length),we.tokens=this.inlineTokens(we.text,[],q,ee),Q.push(we);continue}if(we=this.tokenizer.autolink(V,ye)){V=V.substring(we.raw.length),Q.push(we);continue}if(!q&&(we=this.tokenizer.url(V,ye))){V=V.substring(we.raw.length),Q.push(we);continue}if(we=this.tokenizer.inlineText(V,ee,Fe)){V=V.substring(we.raw.length),ge=we.raw.slice(-1),Q.push(we);continue}if(V){var ze="Infinite loop on byte: "+V.charCodeAt(0);if(this.options.silent){console.error(ze);break}else throw new Error(ze)}}return Q},H(de,null,[{key:"rules",get:function(){return{block:Ie,inline:Le}}}]),de}(),Ae=B.defaults,Y=P.cleanUrl,se=P.escape,pe=function(){function de(oe){this.options=oe||Ae}var re=de.prototype;return re.code=function(V,Q,q){var ee=(Q||"").match(/\S*/)[0];if(this.options.highlight){var ge=this.options.highlight(V,ee);ge!=null&&ge!==V&&(q=!0,V=ge)}return ee?'<pre><code class="'+this.options.langPrefix+se(ee,!0)+'">'+(q?V:se(V,!0))+`</code></pre>
`:"<pre><code>"+(q?V:se(V,!0))+`</code></pre>
`},re.blockquote=function(V){return`<blockquote>
`+V+`</blockquote>
`},re.html=function(V){return V},re.heading=function(V,Q,q,ee){return this.options.headerIds?"<h"+Q+' id="'+this.options.headerPrefix+ee.slug(q)+'">'+V+"</h"+Q+`>
`:"<h"+Q+">"+V+"</h"+Q+`>
`},re.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},re.list=function(V,Q,q){var ee=Q?"ol":"ul",ge=Q&&q!==1?' start="'+q+'"':"";return"<"+ee+ge+`>
`+V+"</"+ee+`>
`},re.listitem=function(V){return"<li>"+V+`</li>
`},re.checkbox=function(V){return"<input "+(V?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},re.paragraph=function(V){return"<p>"+V+`</p>
`},re.table=function(V,Q){return Q&&(Q="<tbody>"+Q+"</tbody>"),`<table>
<thead>
`+V+`</thead>
`+Q+`</table>
`},re.tablerow=function(V){return`<tr>
`+V+`</tr>
`},re.tablecell=function(V,Q){var q=Q.header?"th":"td",ee=Q.align?"<"+q+' align="'+Q.align+'">':"<"+q+">";return ee+V+"</"+q+`>
`},re.strong=function(V){return"<strong>"+V+"</strong>"},re.em=function(V){return"<em>"+V+"</em>"},re.codespan=function(V){return"<code>"+V+"</code>"},re.br=function(){return this.options.xhtml?"<br/>":"<br>"},re.del=function(V){return"<del>"+V+"</del>"},re.link=function(V,Q,q){if(V=Y(this.options.sanitize,this.options.baseUrl,V),V===null)return q;var ee='<a href="'+se(V)+'"';return Q&&(ee+=' title="'+Q+'"'),ee+=">"+q+"</a>",ee},re.image=function(V,Q,q){if(V=Y(this.options.sanitize,this.options.baseUrl,V),V===null)return q;var ee='<img src="'+V+'" alt="'+q+'"';return Q&&(ee+=' title="'+Q+'"'),ee+=this.options.xhtml?"/>":">",ee},re.text=function(V){return V},de}(),ve=function(){function de(){}var re=de.prototype;return re.strong=function(V){return V},re.em=function(V){return V},re.codespan=function(V){return V},re.del=function(V){return V},re.html=function(V){return V},re.text=function(V){return V},re.link=function(V,Q,q){return""+q},re.image=function(V,Q,q){return""+q},re.br=function(){return""},de}(),Me=function(){function de(){this.seen={}}var re=de.prototype;return re.slug=function(V){var Q=V.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(Q)){var q=Q;do this.seen[q]++,Q=q+"-"+this.seen[q];while(this.seen.hasOwnProperty(Q))}return this.seen[Q]=0,Q},de}(),he=B.defaults,me=P.unescape,_e=function(){function de(oe){this.options=oe||he,this.options.renderer=this.options.renderer||new pe,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ve,this.slugger=new Me}de.parse=function(V,Q){var q=new de(Q);return q.parse(V)};var re=de.prototype;return re.parse=function(V,Q){Q===void 0&&(Q=!0);var q="",ee,ge,we,Ne,Ge,Je,ze,qe,nt,$e,gt,ht,bt,pt,it,_t,Tt,Ve,At=V.length;for(ee=0;ee<At;ee++){$e=V[ee];switch($e.type){case"space":continue;case"hr":{q+=this.renderer.hr();continue}case"heading":{q+=this.renderer.heading(this.parseInline($e.tokens),$e.depth,me(this.parseInline($e.tokens,this.textRenderer)),this.slugger);continue}case"code":{q+=this.renderer.code($e.text,$e.lang,$e.escaped);continue}case"table":{for(qe="",ze="",Ne=$e.header.length,ge=0;ge<Ne;ge++)ze+=this.renderer.tablecell(this.parseInline($e.tokens.header[ge]),{header:!0,align:$e.align[ge]});for(qe+=this.renderer.tablerow(ze),nt="",Ne=$e.cells.length,ge=0;ge<Ne;ge++){for(Je=$e.tokens.cells[ge],ze="",Ge=Je.length,we=0;we<Ge;we++)ze+=this.renderer.tablecell(this.parseInline(Je[we]),{header:!1,align:$e.align[we]});nt+=this.renderer.tablerow(ze)}q+=this.renderer.table(qe,nt);continue}case"blockquote":{nt=this.parse($e.tokens),q+=this.renderer.blockquote(nt);continue}case"list":{for(gt=$e.ordered,ht=$e.start,bt=$e.loose,Ne=$e.items.length,nt="",ge=0;ge<Ne;ge++)it=$e.items[ge],_t=it.checked,Tt=it.task,pt="",it.task&&(Ve=this.renderer.checkbox(_t),bt?it.tokens.length>0&&it.tokens[0].type==="text"?(it.tokens[0].text=Ve+" "+it.tokens[0].text,it.tokens[0].tokens&&it.tokens[0].tokens.length>0&&it.tokens[0].tokens[0].type==="text"&&(it.tokens[0].tokens[0].text=Ve+" "+it.tokens[0].tokens[0].text)):it.tokens.unshift({type:"text",text:Ve}):pt+=Ve),pt+=this.parse(it.tokens,bt),nt+=this.renderer.listitem(pt,Tt,_t);q+=this.renderer.list(nt,gt,ht);continue}case"html":{q+=this.renderer.html($e.text);continue}case"paragraph":{q+=this.renderer.paragraph(this.parseInline($e.tokens));continue}case"text":{for(nt=$e.tokens?this.parseInline($e.tokens):$e.text;ee+1<At&&V[ee+1].type==="text";)$e=V[++ee],nt+=`
`+($e.tokens?this.parseInline($e.tokens):$e.text);q+=Q?this.renderer.paragraph(nt):nt;continue}default:{var We='Token with "'+$e.type+'" type was not found.';if(this.options.silent){console.error(We);return}else throw new Error(We)}}}return q},re.parseInline=function(V,Q){Q=Q||this.renderer;var q="",ee,ge,we=V.length;for(ee=0;ee<we;ee++){ge=V[ee];switch(ge.type){case"escape":{q+=Q.text(ge.text);break}case"html":{q+=Q.html(ge.text);break}case"link":{q+=Q.link(ge.href,ge.title,this.parseInline(ge.tokens,Q));break}case"image":{q+=Q.image(ge.href,ge.title,ge.text);break}case"strong":{q+=Q.strong(this.parseInline(ge.tokens,Q));break}case"em":{q+=Q.em(this.parseInline(ge.tokens,Q));break}case"codespan":{q+=Q.codespan(ge.text);break}case"br":{q+=Q.br();break}case"del":{q+=Q.del(this.parseInline(ge.tokens,Q));break}case"text":{q+=Q.text(ge.text);break}default:{var Ne='Token with "'+ge.type+'" type was not found.';if(this.options.silent){console.error(Ne);return}else throw new Error(Ne)}}}return q},de}(),Se=P.merge,Ce=P.checkSanitizeDeprecation,Oe=P.escape,xe=B.getDefaults,Ue=B.changeDefaults,Be=B.defaults;function Ee(de,re,oe){if(typeof de=="undefined"||de===null)throw new Error("marked(): input parameter is undefined or null");if(typeof de!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(de)+", string expected");if(typeof re=="function"&&(oe=re,re=null),re=Se({},Ee.defaults,re||{}),Ce(re),oe){var V=re.highlight,Q;try{Q=Te.lex(de,re)}catch(we){return oe(we)}var q=function(Ne){var Ge;if(!Ne)try{Ge=_e.parse(Q,re)}catch(Je){Ne=Je}return re.highlight=V,Ne?oe(Ne):oe(null,Ge)};if(!V||V.length<3)return q();if(delete re.highlight,!Q.length)return q();var ee=0;Ee.walkTokens(Q,function(we){we.type==="code"&&(ee++,setTimeout(function(){V(we.text,we.lang,function(Ne,Ge){if(Ne)return q(Ne);Ge!=null&&Ge!==we.text&&(we.text=Ge,we.escaped=!0),ee--,ee===0&&q()})},0))}),ee===0&&q();return}try{var ge=Te.lex(de,re);return re.walkTokens&&Ee.walkTokens(ge,re.walkTokens),_e.parse(ge,re)}catch(we){if(we.message+=`
Please report this to https://github.com/markedjs/marked.`,re.silent)return"<p>An error occurred:</p><pre>"+Oe(we.message+"",!0)+"</pre>";throw we}}Ee.options=Ee.setOptions=function(de){return Se(Ee.defaults,de),Ue(Ee.defaults),Ee},Ee.getDefaults=xe,Ee.defaults=Be,Ee.use=function(de){var re=Se({},de);if(de.renderer&&function(){var V=Ee.defaults.renderer||new pe,Q=function(ge){var we=V[ge];V[ge]=function(){for(var Ne=arguments.length,Ge=new Array(Ne),Je=0;Je<Ne;Je++)Ge[Je]=arguments[Je];var ze=de.renderer[ge].apply(V,Ge);return ze===!1&&(ze=we.apply(V,Ge)),ze}};for(var q in de.renderer)Q(q);re.renderer=V}(),de.tokenizer&&function(){var V=Ee.defaults.tokenizer||new ce,Q=function(ge){var we=V[ge];V[ge]=function(){for(var Ne=arguments.length,Ge=new Array(Ne),Je=0;Je<Ne;Je++)Ge[Je]=arguments[Je];var ze=de.tokenizer[ge].apply(V,Ge);return ze===!1&&(ze=we.apply(V,Ge)),ze}};for(var q in de.tokenizer)Q(q);re.tokenizer=V}(),de.walkTokens){var oe=Ee.defaults.walkTokens;re.walkTokens=function(V){de.walkTokens(V),oe&&oe(V)}}Ee.setOptions(re)},Ee.walkTokens=function(de,re){for(var oe=L(de),V;!(V=oe()).done;){var Q=V.value;re(Q);switch(Q.type){case"table":{for(var q=L(Q.tokens.header),ee;!(ee=q()).done;){var ge=ee.value;Ee.walkTokens(ge,re)}for(var we=L(Q.tokens.cells),Ne;!(Ne=we()).done;)for(var Ge=Ne.value,Je=L(Ge),ze;!(ze=Je()).done;){var qe=ze.value;Ee.walkTokens(qe,re)}break}case"list":{Ee.walkTokens(Q.items,re);break}default:Q.tokens&&Ee.walkTokens(Q.tokens,re)}}},Ee.Parser=_e,Ee.parser=_e.parse,Ee.Renderer=pe,Ee.TextRenderer=ve,Ee.Lexer=Te,Ee.lexer=Te.lex,Ee.Tokenizer=ce,Ee.Slugger=Me,Ee.parse=Ee;var De=Ee;return De})},Etsf:function(Qe,le,W){"use strict";W.r(le);var te=W("5Dmo"),H=W("3S7+"),C=W("14J3"),j=W("BMrR"),L=W("jCWc"),R=W("kPKH"),B=W("sPJy"),k=W("bE4q"),e=W("k1fw"),A=W("9og8"),g=W("y8nQ"),c=W("Vl3Y"),l=W("tJVT"),n=W("PpiC"),a=W("WmNS"),o=W.n(a),s=W("q1tI"),r=W.n(s),i=W("55Ip"),t=W("9kvl"),y=W("9Bee"),p=W("xKgJ"),m=W("U/Y8"),E=W.n(m),_=W("Q9mQ"),h=W("diRs"),u=W("miYZ"),d=W("tsqr"),f=W("2qtc"),T=W("kLXV"),b=W("oBTY"),S=W("ozfa"),D=W("MJZm"),I=W("5NDa"),w=W("5rEg"),P=W("jrin"),U=W("nRaC"),O=W("5RzL"),G=W("ErOA"),z=W("Ty5D"),ae=O.a.TreeNode,ie=function(Ae){var Y=Ae.restful,se=Ae.loading,pe=Ae.dispatch,ve=Object(z.i)(),Me=Object(z.h)(),he=Object(s.useState)(!1),me=Object(l.a)(he,2),_e=me[0],Se=me[1],Ce=Object(s.useState)(),Oe=Object(l.a)(Ce,2),xe=Oe[0],Ue=Oe[1],Be=Y.actionTabs,Ee=c.a.useForm(),De=Object(l.a)(Ee,1),de=De[0];return Object(s.useEffect)(function(){Y.actionTabs.key=="\u65B0\u5EFA\u540C\u7EA7\u76EE\u5F55"&&de.resetFields()},[Y.actionTabs.key]),Y.actionTabs.key!=="\u65B0\u5EFA\u540C\u7EA7\u76EE\u5F55"?null:r.a.createElement(T.a,{centered:!0,title:"\u65B0\u5EFA\u76EE\u5F55",visible:Y.actionTabs.key==="\u65B0\u5EFA\u540C\u7EA7\u76EE\u5F55",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",bodyStyle:{minHeight:150},confirmLoading:_e,onOk:Object(A.a)(o.a.mark(function re(){var oe,V,Q;return o.a.wrap(function(ee){for(;;)switch(ee.prev=ee.next){case 0:return ee.next=2,de.validateFields();case 2:return oe=de.getFieldValue(),Se(!0),V="/api/restfuls.json",ee.next=7,Object(G.a)(V,{method:"post",body:Object(e.a)({file_type:1},oe)});case 7:Q=ee.sent,Q.status===0&&(d.b.success("\u6DFB\u52A0\u6210\u529F"),pe({type:"restful/setActionTabs",payload:{}}),pe({type:"restful/getRestful"})),Se(!1);case 10:case"end":return ee.stop()}},re)})),onCancel:function(){pe({type:"restful/setActionTabs",payload:{}})}},r.a.createElement("div",{className:"pl30 pr30"},r.a.createElement(c.a,{form:de,initialValues:Object(P.a)({},"name","")},r.a.createElement(c.a.Item,{name:"name",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u76EE\u5F55\u540D\u79F0"}]},r.a.createElement(j.a,{className:"mt30"},r.a.createElement(R.a,{flex:"80px",className:"font14"},"\u76EE\u5F55\u540D\u79F0\uFF1A"),r.a.createElement(R.a,{flex:"1"},r.a.createElement(w.a,{placeholder:"\u8BF7\u8F93\u5165\u540D\u79F0\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26 ",maxLength:60})))))))},fe=Object(t.a)(function(Te){var Ae=Te.restful,Y=Te.loading;return{restful:Ae,loading:Y}})(ie),ce=O.a.TreeNode,J=function(Ae){var Y=Ae.restful,se=Ae.loading,pe=Ae.dispatch,ve=Object(z.i)(),Me=Object(z.h)(),he=Object(s.useState)(!1),me=Object(l.a)(he,2),_e=me[0],Se=me[1],Ce=Object(s.useState)(),Oe=Object(l.a)(Ce,2),xe=Oe[0],Ue=Oe[1],Be=Y.actionTabs,Ee=c.a.useForm(),De=Object(l.a)(Ee,1),de=De[0];return Object(s.useEffect)(function(){Y.actionTabs.key=="\u91CD\u547D\u540D"&&(de.resetFields(),de.setFieldsValue({name:Y.actionTabs.data.title}))},[Y.actionTabs.key]),Y.actionTabs.key!=="\u91CD\u547D\u540D"?null:r.a.createElement(T.a,{centered:!0,title:"\u91CD\u547D\u540D",visible:Y.actionTabs.key==="\u91CD\u547D\u540D",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",bodyStyle:{minHeight:150},confirmLoading:_e,onOk:Object(A.a)(o.a.mark(function re(){var oe,V,Q;return o.a.wrap(function(ee){for(;;)switch(ee.prev=ee.next){case 0:return ee.next=2,de.validateFields();case 2:return oe=de.getFieldValue(),Se(!0),V="/api/restfuls/".concat(Y.actionTabs.data.id,".json"),ee.next=7,Object(G.a)(V,{method:"put",body:Object(e.a)({file_type:1},oe)});case 7:Q=ee.sent,Q.status===0&&(d.b.success("\u4FEE\u6539\u6210\u529F"),pe({type:"restful/setActionTabs",payload:{}}),pe({type:"restful/getRestful"})),Se(!1);case 10:case"end":return ee.stop()}},re)})),onCancel:function(){pe({type:"restful/setActionTabs",payload:{}})}},r.a.createElement("div",{className:"pl30 pr30"},r.a.createElement(c.a,{form:de,initialValues:Object(P.a)({},"name","")},r.a.createElement(j.a,{className:"mt30"},r.a.createElement(R.a,{flex:"80px",className:"font14"},"\u76EE\u5F55\u540D\u79F0\uFF1A"),r.a.createElement(R.a,{flex:"1"},r.a.createElement(c.a.Item,{name:"name",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u65B0\u540D\u79F0"}]},r.a.createElement(w.a,{placeholder:"\u8BF7\u8F93\u5165\u540D\u79F0\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26 ",maxLength:60})))))))},Z=Object(t.a)(function(Te){var Ae=Te.restful,Y=Te.loading;return{restful:Ae,loading:Y}})(J),ue=W("s7vb"),X=W("P48q"),$=W.n(X),be=w.a.Search,Re=D.a.DirectoryTree,Ie=function(Ae){var Y=Ae.user,se=Ae.globalSetting,pe=Ae.loading,ve=Ae.dispatch,Me=Ae.restful,he=Object(n.a)(Ae,["user","globalSetting","loading","dispatch","restful"]),me=Object(s.useState)({content:"",message:"",status:0,contacts:[],address:"",data:[]}),_e=Object(l.a)(me,2),Se=_e[0],Ce=_e[1],Oe=Object(s.useState)(!0),xe=Object(l.a)(Oe,2),Ue=xe[0],Be=xe[1],Ee=c.a.useForm(),De=Object(l.a)(Ee,1),de=De[0],re=Object(s.useState)(""),oe=Object(l.a)(re,2),V=oe[0],Q=oe[1],q=Object(s.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"}]),ee=Object(l.a)(q,1),ge=ee[0],we=Object(s.useState)([]),Ne=Object(l.a)(we,2),Ge=Ne[0],Je=Ne[1],ze=Object(s.useState)([]),qe=Object(l.a)(ze,2),nt=qe[0],$e=qe[1],gt=Object(s.useState)(!1),ht=Object(l.a)(gt,2),bt=ht[0],pt=ht[1],it=Object(s.useState)([]),_t=Object(l.a)(it,2),Tt=_t[0],Ve=_t[1];Object(s.useEffect)(function(){var ut;if((ut=Me.restful)!==null&&ut!==void 0&&ut.data){var tt,Ze,et;Ve(Object(b.a)((tt=Me.restful)===null||tt===void 0?void 0:tt.data));var st=0,ot;if((Ze=Me.restful)===null||Ze===void 0||((et=Ze.data)===null||et===void 0)||et.map(function(lt){var ct;lt.id==he.match.params.id&&(st=lt.id),lt.file_type==0&&!ot&&(ot=lt.id),lt==null||((ct=lt.children)===null||ct===void 0)||ct.map(function(Ct){ot||(ot=Ct.id),Ct.id==he.match.params.id&&(st=lt.id)}),!lt.children&&!ot&&(ot=lt.id)}),!he.match.params.id&&ot){he.history.push("/ch/rest/".concat(ot));return}st&&setTimeout(function(){Je([st]),$e([Number(he.match.params.id||ot)])},200)}},[Me.restful]);var At=function(tt,Ze){Ze.node.file_type===0?he.history.push("/ch/rest/".concat(tt[0])):$e(Object(b.a)(tt)),console.log("Trigger Select",tt,Ze)},We=function(tt){Je(tt),console.log("Trigger Expand",tt)},Ye=function(tt){return r.a.createElement("div",null,ge.map(function(Ze,et){return r.a.createElement("p",{key:Ze.id,className:"current",onClick:function(){switch(Ze.id){case 1:he.history.push("/ch/rest/edit/".concat(tt.id,"/0"));break;case 2:case 3:ve({type:"restful/setActionTabs",payload:{key:Ze.name,data:tt}});break;case 4:document.location.href="/ch/rest/edit/".concat(tt.pid||0,"/").concat(tt.id);break;case 5:T.a.confirm({title:"\u63D0\u793A",content:"\u662F\u5426\u786E\u5B9A\u5220\u9664\uFF1F",onOk:function(){var ot=Object(A.a)(o.a.mark(function ct(){var Ct;return o.a.wrap(function(Nt){for(;;)switch(Nt.prev=Nt.next){case 0:return Nt.next=2,Object(ue.a)({id:tt.id});case 2:Ct=Nt.sent,(Ct==null?void 0:Ct.status)==0&&(d.b.success("\u5220\u9664\u6210\u529F"),ve({type:"restful/getRestful"}));case 4:case"end":return Nt.stop()}},ct)}));function lt(){return ot.apply(this,arguments)}return lt}()});break}}},Ze.name)}).filter(function(Ze){return!!Ze}).filter(function(Ze){return tt.pid||tt.file_type==0?Ze.key>3:Ze.key!=4}))},rt=function ut(tt){return tt.map(function(Ze){var et=Ze.title.indexOf(V),st=Ze.title.substr(0,et),ot=Ze.title.substr(et+V.length),lt=r.a.createElement("span",null,st,r.a.createElement("span",{className:"c-blue"},V),ot,Object(p.o)()&&r.a.createElement(h.a,{placement:"right",title:V,content:function(){return Ye(Ze)},trigger:"hover"},r.a.createElement("span",{className:"iconfont icon-sandian ".concat($.a.actions)})));if(V!==""){var ct;if(et===-1&&!((ct=Ze.children)!==null&&ct!==void 0&&ct.length))return null}return Ze.children&&Ze.file_type===1?Object(e.a)(Object(e.a)({},Ze),{},{title:lt,key:Ze.key,children:ut(Ze.children)}):Object(e.a)(Object(e.a)({},Ze),{},{title:lt,key:Ze.key,isLeaf:!0})}).filter(function(Ze){return!!Ze})},dt=function ut(tt,Ze){for(var et,st=0;st<Ze.length;st++){var ot=Ze[st];ot.children&&(ot.children.some(function(lt){return lt.key===tt})?et=ot.key:ut(tt,ot.children)&&(et=ut(tt,ot.children)))}return et},vt=function(tt){var Ze=tt.target.value,et=Tt.map(function(st){if(st!=null&&st.children){var ot;return st!=null&&(ot=st.children.filter(function(lt){return lt.title.indexOf(Ze)>-1}))!==null&&ot!==void 0&&ot.length?st.id:null}return null});Q(Ze),pt(!0),console.log("expandedKeys:",et),Je(et)};return console.log("loop(treeData):",rt(Tt)),r.a.createElement("div",{className:$.a.tree},r.a.createElement(be,{style:{marginBottom:8},placeholder:"\u8F93\u5165\u5173\u952E\u5B57\u68C0\u7D22",onChange:vt}),r.a.createElement(Re,{multiple:!0,defaultExpandAll:!0,onSelect:At,onExpand:We,expandedKeys:Ge,selectedKeys:nt,autoExpandParent:bt,treeData:rt(Tt)}),r.a.createElement(fe,null),r.a.createElement(Z,null))},Le=Object(t.a)(function(Te){var Ae=Te.user,Y=Te.loading,se=Te.globalSetting,pe=Te.restful;return{user:Ae,globalSetting:se,restful:pe,loading:Y.models.index}})(Ie),Fe=function(Ae){var Y,se,pe=Ae.user,ve=Ae.globalSetting,Me=Ae.loading,he=Ae.dispatch,me=Ae.restful,_e=Object(n.a)(Ae,["user","globalSetting","loading","dispatch","restful"]),Se=Object(s.useState)({content:"",message:"",status:0,contacts:[],address:"",data:[]}),Ce=Object(l.a)(Se,2),Oe=Ce[0],xe=Ce[1],Ue=Object(s.useState)(!0),Be=Object(l.a)(Ue,2),Ee=Be[0],De=Be[1],de=c.a.useForm(),re=Object(l.a)(de,1),oe=re[0],V=_e.match.params,Q=function(){var ge=Object(A.a)(o.a.mark(function we(){return o.a.wrap(function(Ge){for(;;)switch(Ge.prev=Ge.next){case 0:he({type:"restful/getRestful"}),V.id&&he({type:"restful/getRestfulDetail",payload:Object(e.a)({},V)});case 2:case"end":return Ge.stop()}},we)}));return function(){return ge.apply(this,arguments)}}();Object(s.useEffect)(function(){De(!0),Q()},[V.id]);var q=function(){he({type:"restful/setActionTabs",payload:{key:"\u65B0\u5EFA\u540C\u7EA7\u76EE\u5F55"}})},ee=function(){var we;if((we=me.restful)!==null&&we!==void 0&&we.data){var Ne,Ge,Je=0;return(Ne=me.restful)===null||Ne===void 0||((Ge=Ne.data)===null||Ge===void 0)||Ge.map(function(ze){var qe;ze==null||((qe=ze.children)===null||qe===void 0)||qe.map(function(nt){nt.id==_e.match.params.id&&(Je=ze.id)}),!ze.children&&!Je&&(Je=ze.id)}),Je}return 0};return r.a.createElement("section",null,r.a.createElement("aside",{className:"edu-container mt20"},r.a.createElement(k.a,null,r.a.createElement(k.a.Item,null,r.a.createElement(i.a,{to:"/"},"\u9996\u9875")),r.a.createElement(k.a.Item,null,r.a.createElement(i.a,{to:"/ch/rest"},"API\u6587\u6863"))),r.a.createElement("div",{className:"mt20"},r.a.createElement(j.a,{gutter:[20,20]},r.a.createElement(R.a,{flex:"300px"},r.a.createElement(Le,_e)),r.a.createElement(R.a,{flex:"1"},r.a.createElement("div",{className:E.a.info},r.a.createElement("h1",{style:{fontSize:28,paddingBottom:15,borderBottom:"1px solid #eaeaea",textAlign:"center"}},(Y=me.restfulDetail)===null||Y===void 0?void 0:Y.name),r.a.createElement(y.a,{value:(se=me.restfulDetail)===null||se===void 0?void 0:se.description}))))),Object(p.o)()&&r.a.createElement("div",{className:E.a.bar},r.a.createElement(j.a,null,!!ee()&&r.a.createElement(R.a,null,r.a.createElement(H.a,{title:"\u7F16\u8F91\u6587\u4EF6"},r.a.createElement(i.a,{to:"/ch/rest/edit/".concat(ee(),"/").concat(_e.match.params.id),className:"icon-zhongmingming current"}))),r.a.createElement(R.a,null,r.a.createElement(H.a,{title:"\u6DFB\u52A0\u6587\u4EF6"},r.a.createElement(i.a,{to:"/ch/rest/edit/".concat(ee(),"/0"),className:"icon-tianjiatimu current"}))),r.a.createElement(R.a,null,r.a.createElement(H.a,{title:"\u65B0\u5EFA\u6587\u4EF6\u5939"},r.a.createElement("span",{className:"icon-wenjianjia1 current",onClick:q})))))))},ye=le.default=Object(t.a)(function(Te){var Ae=Te.user,Y=Te.loading,se=Te.globalSetting,pe=Te.restful;return{user:Ae,globalSetting:se,restful:pe,loading:Y.models.index}})(Fe)},FWmy:function(Qe,le,W){"use strict";W.d(le,"a",function(){return te});function te(H,C){if(!H)throw new Error(C?`Assertion failed (${C})`:"Assertion Failed")}},JYp7:function(Qe,le,W){"use strict";W.d(le,"a",function(){return te});var te;(function(H){function C(t){return t&&typeof t=="object"&&typeof t[Symbol.iterator]=="function"}H.is=C;const j=Object.freeze([]);function L(){return j}H.empty=L;function*R(t){yield t}H.single=R;function B(t){return t||j}H.from=B;function k(t){return!t||t[Symbol.iterator]().next().done===!0}H.isEmpty=k;function e(t){return t[Symbol.iterator]().next().value}H.first=e;function A(t,y){for(const p of t)if(y(p))return!0;return!1}H.some=A;function g(t,y){for(const p of t)if(y(p))return p;return}H.find=g;function*c(t,y){for(const p of t)y(p)&&(yield p)}H.filter=c;function*l(t,y){let p=0;for(const m of t)yield y(m,p++)}H.map=l;function*n(...t){for(const y of t)for(const p of y)yield p}H.concat=n;function*a(t){for(const y of t)for(const p of y)yield p}H.concatNested=a;function o(t,y,p){let m=p;for(const E of t)m=y(m,E);return m}H.reduce=o;function*s(t,y,p=t.length){for(y<0&&(y+=t.length),p<0?p+=t.length:p>t.length&&(p=t.length);y<p;y++)yield t[y]}H.slice=s;function r(t,y=Number.POSITIVE_INFINITY){const p=[];if(y===0)return[p,t];const m=t[Symbol.iterator]();for(let E=0;E<y;E++){const _=m.next();if(_.done)return[p,H.empty()];p.push(_.value)}return[p,{[Symbol.iterator](){return m}}]}H.consume=r;function i(t,y,p=(m,E)=>m===E){const m=t[Symbol.iterator](),E=y[Symbol.iterator]();for(;;){const _=m.next(),h=E.next();if(_.done!==h.done)return!1;if(_.done)return!0;if(!p(_.value,h.value))return!1}}H.equals=i})(te||(te={}))},MI8n:function(Qe,le,W){"use strict";W.d(le,"c",function(){return L}),W.d(le,"b",function(){return e}),W.d(le,"e",function(){return A}),W.d(le,"a",function(){return g}),W.d(le,"d",function(){return c}),W.d(le,"f",function(){return l});var te=W("/cxE"),H=W("pmY6"),C=W("24hK"),j=W("5Y4S"),L;(function(n){n.None=()=>H.a.None;function a(S){return(D,I=null,w)=>{let P=!1,U;return U=S(O=>P?void 0:(U?U.dispose():P=!0,D.call(I,O)),null,w),P&&U.dispose(),U}}n.once=a;function o(S,D){return p((I,w=null,P)=>S(U=>I.call(w,D(U)),null,P))}n.map=o;function s(S,D){return p((I,w=null,P)=>S(U=>{D(U),I.call(w,U)},null,P))}n.forEach=s;function r(S,D){return p((I,w=null,P)=>S(U=>D(U)&&I.call(w,U),null,P))}n.filter=r;function i(S){return S}n.signal=i;function t(...S){return(D,I=null,w)=>Object(H.e)(...S.map(P=>P(U=>D.call(I,U),null,w)))}n.any=t;function y(S,D,I){let w=I;return o(S,P=>(w=D(w,P),w))}n.reduce=y;function p(S){let D;const I=new e({onFirstListenerAdd(){D=S(I.fire,I)},onLastListenerRemove(){D.dispose()}});return I.event}function m(S,D,I=100,w=!1,P){let U,O,G,z=0;const ae=new e({leakWarningThreshold:P,onFirstListenerAdd(){U=S(ie=>{z++,O=D(O,ie),w&&!G&&(ae.fire(O),O=void 0),clearTimeout(G),G=setTimeout(()=>{const fe=O;O=void 0,G=void 0,(!w||z>1)&&ae.fire(fe),z=0},I)})},onLastListenerRemove(){U.dispose()}});return ae.event}n.debounce=m;function E(S,D=(I,w)=>I===w){let I=!0,w;return r(S,P=>{const U=I||!D(P,w);return I=!1,w=P,U})}n.latch=E;function _(S,D){return[n.filter(S,D),n.filter(S,I=>!D(I))]}n.split=_;function h(S,D=!1,I=[]){let w=I.slice(),P=S(G=>{w?w.push(G):O.fire(G)});const U=()=>{w&&w.forEach(G=>O.fire(G)),w=null},O=new e({onFirstListenerAdd(){P||(P=S(G=>O.fire(G)))},onFirstListenerDidAdd(){w&&(D?setTimeout(U):U())},onLastListenerRemove(){P&&P.dispose(),P=null}});return O.event}n.buffer=h;class u{constructor(S){this.event=S}map(S){return new u(o(this.event,S))}forEach(S){return new u(s(this.event,S))}filter(S){return new u(r(this.event,S))}reduce(S,D){return new u(y(this.event,S,D))}latch(){return new u(E(this.event))}debounce(S,D=100,I=!1,w){return new u(m(this.event,S,D,I,w))}on(S,D,I){return this.event(S,D,I)}once(S,D,I){return a(this.event)(S,D,I)}}function d(S){return new u(S)}n.chain=d;function f(S,D,I=w=>w){const w=(...G)=>O.fire(I(...G)),P=()=>S.on(D,w),U=()=>S.removeListener(D,w),O=new e({onFirstListenerAdd:P,onLastListenerRemove:U});return O.event}n.fromNodeEventEmitter=f;function T(S,D,I=w=>w){const w=(...G)=>O.fire(I(...G)),P=()=>S.addEventListener(D,w),U=()=>S.removeEventListener(D,w),O=new e({onFirstListenerAdd:P,onLastListenerRemove:U});return O.event}n.fromDOMEventEmitter=T;function b(S){return new Promise(D=>a(S)(D))}n.toPromise=b})(L||(L={}));class R{constructor(n){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${n}_${R._idPool++}`}start(n){this._stopWatch=new j.a(!0),this._listenerCount=n}stop(){if(this._stopWatch){const n=this._stopWatch.elapsed();this._elapsedOverall+=n,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${n.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}R._idPool=0;let B=-1;class k{constructor(n,a=Math.random().toString(18).slice(2,5)){this.customThreshold=n,this.name=a,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(n){let a=B;if(typeof this.customThreshold=="number"&&(a=this.customThreshold),a<=0||n<a)return;this._stacks||(this._stacks=new Map);const o=new Error().stack.split(`
`).slice(3).join(`
`),s=this._stacks.get(o)||0;if(this._stacks.set(o,s+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=a*.5;let r,i=0;for(const[t,y]of this._stacks)(!r||i<y)&&(r=t,i=y);console.warn(`[${this.name}] potential listener LEAK detected, having ${n} listeners already. MOST frequent listener (${i}):`),console.warn(r)}return()=>{const r=this._stacks.get(o)||0;this._stacks.set(o,r-1)}}}class e{constructor(n){var a;this._disposed=!1,this._options=n,this._leakageMon=B>0?new k(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((a=this._options)===null||a===void 0?void 0:a._profName)?new R(this._options._profName):void 0}get event(){return this._event||(this._event=(n,a,o)=>{var s;this._listeners||(this._listeners=new C.a);const r=this._listeners.isEmpty();r&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const i=this._listeners.push(a?[n,a]:n);r&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,n,a);const t=(s=this._leakageMon)===null||s===void 0?void 0:s.check(this._listeners.size),y=Object(H.i)(()=>{if(t&&t(),!this._disposed&&(i(),this._options&&this._options.onLastListenerRemove)){const p=this._listeners&&!this._listeners.isEmpty();p||this._options.onLastListenerRemove(this)}});return o instanceof H.b?o.add(y):Array.isArray(o)&&o.push(y),y}),this._event}fire(n){var a,o;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new C.a);for(let s of this._listeners)this._deliveryQueue.push([s,n]);for((a=this._perfMon)===null||a===void 0||a.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[s,r]=this._deliveryQueue.shift();try{typeof s=="function"?s.call(void 0,r):s[0].call(s[1],r)}catch(i){Object(te.f)(i)}}(o=this._perfMon)===null||o===void 0||o.stop()}}dispose(){var n,a,o,s,r;this._disposed||(this._disposed=!0,(n=this._listeners)===null||n===void 0||n.clear(),(a=this._deliveryQueue)===null||a===void 0||a.clear(),(s=(o=this._options)===null||o===void 0?void 0:o.onLastListenerRemove)===null||s===void 0||s.call(o),(r=this._leakageMon)===null||r===void 0||r.dispose())}}class A extends e{constructor(n){super(n);this._isPaused=0,this._eventQueue=new C.a,this._mergeFn=n==null?void 0:n.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const n=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(n))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(n){this._listeners&&(this._isPaused!==0?this._eventQueue.push(n):super.fire(n))}}class g extends A{constructor(n){var a;super(n);this._delay=(a=n.delay)!==null&&a!==void 0?a:100}fire(n){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(n)}}class c{constructor(){this.buffers=[]}wrapEvent(n){return(a,o,s)=>n(r=>{const i=this.buffers[this.buffers.length-1];i?i.push(()=>a.call(o,r)):a.call(o,r)},void 0,s)}bufferEvents(n){const a=[];this.buffers.push(a);const o=n();return this.buffers.pop(),a.forEach(s=>s()),o}}class l{constructor(){this.listening=!1,this.inputEvent=L.None,this.inputEventListener=H.a.None,this.emitter=new e({onFirstListenerDidAdd:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onLastListenerRemove:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(n){this.inputEvent=n,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=n(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},MNsG:function(Qe,le,W){"use strict";(function(te,H){W.d(le,"b",function(){return o}),W.d(le,"i",function(){return t}),W.d(le,"f",function(){return y}),W.d(le,"d",function(){return p}),W.d(le,"g",function(){return m}),W.d(le,"h",function(){return E}),W.d(le,"c",function(){return _}),W.d(le,"k",function(){return h}),W.d(le,"j",function(){return u}),W.d(le,"a",function(){return d}),W.d(le,"e",function(){return b});var C;const j="en";let L=!1,R=!1,B=!1,k=!1,e=!1,A=!1,g=!1,c,l=j,n,a;const o=typeof self=="object"?self:typeof te=="object"?te:{};let s;typeof o.vscode!="undefined"&&typeof o.vscode.process!="undefined"?s=o.vscode.process:typeof H!="undefined"&&(s=H);const r=typeof((C=s==null?void 0:s.versions)===null||C===void 0?void 0:C.electron)=="string"&&s.type==="renderer";if(typeof navigator=="object"&&!r)a=navigator.userAgent,L=a.indexOf("Windows")>=0,R=a.indexOf("Macintosh")>=0,g=(a.indexOf("Macintosh")>=0||a.indexOf("iPad")>=0||a.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,B=a.indexOf("Linux")>=0,A=!0,c=navigator.language,l=c;else if(typeof s=="object"){L=s.platform==="win32",R=s.platform==="darwin",B=s.platform==="linux",k=B&&!!s.env.SNAP&&!!s.env.SNAP_REVISION,c=j,l=j;const S=s.env.VSCODE_NLS_CONFIG;if(S)try{const D=JSON.parse(S),I=D.availableLanguages["*"];c=D.locale,l=I||j,n=D._translationsConfigFile}catch(D){}e=!0}else console.error("Unable to resolve platform.");let i=0;R?i=1:L?i=3:B&&(i=2);const t=L,y=R,p=B,m=e,E=A,_=g,h=a,u=function(){if(o.setImmediate)return o.setImmediate.bind(o);if(typeof o.postMessage=="function"&&!o.importScripts){let I=[];o.addEventListener("message",P=>{if(P.data&&P.data.vscodeSetImmediateId)for(let U=0,O=I.length;U<O;U++){const G=I[U];if(G.id===P.data.vscodeSetImmediateId){I.splice(U,1),G.callback();return}}});let w=0;return P=>{const U=++w;I.push({id:U,callback:P}),o.postMessage({vscodeSetImmediateId:U},"*")}}if(typeof(s==null?void 0:s.nextTick)=="function")return s.nextTick.bind(s);const D=Promise.resolve();return I=>D.then(I)}(),d=R||g?2:L?1:3;let f=!0,T=!1;function b(){if(!T){T=!0;const S=new Uint8Array(2);S[0]=1,S[1]=2;const D=new Uint16Array(S.buffer);f=D[0]===(2<<8)+1}return f}}).call(this,W("IyRk"),W("Q2Ig"))},N0LK:function(Qe,le,W){"use strict";W.d(le,"C",function(){return te}),W.d(le,"v",function(){return C}),W.d(le,"s",function(){return j}),W.d(le,"t",function(){return L}),W.d(le,"U",function(){return R}),W.d(le,"J",function(){return B}),W.d(le,"O",function(){return k}),W.d(le,"p",function(){return e}),W.d(le,"T",function(){return A}),W.d(le,"q",function(){return g}),W.d(le,"N",function(){return c}),W.d(le,"M",function(){return l}),W.d(le,"Q",function(){return n}),W.d(le,"u",function(){return a}),W.d(le,"x",function(){return o}),W.d(le,"I",function(){return s}),W.d(le,"f",function(){return r}),W.d(le,"h",function(){return i}),W.d(le,"g",function(){return t}),W.d(le,"i",function(){return y}),W.d(le,"G",function(){return p}),W.d(le,"H",function(){return m}),W.d(le,"r",function(){return E}),W.d(le,"R",function(){return _}),W.d(le,"d",function(){return h}),W.d(le,"e",function(){return u}),W.d(le,"E",function(){return d}),W.d(le,"F",function(){return f}),W.d(le,"j",function(){return T}),W.d(le,"z",function(){return b}),W.d(le,"K",function(){return D}),W.d(le,"L",function(){return I}),W.d(le,"m",function(){return P}),W.d(le,"k",function(){return O}),W.d(le,"A",function(){return z}),W.d(le,"a",function(){return ae}),W.d(le,"n",function(){return ie}),W.d(le,"l",function(){return fe}),W.d(le,"D",function(){return ce}),W.d(le,"B",function(){return J}),W.d(le,"b",function(){return Z}),W.d(le,"S",function(){return ue}),W.d(le,"o",function(){return X}),W.d(le,"P",function(){return $}),W.d(le,"w",function(){return be}),W.d(le,"c",function(){return Re}),W.d(le,"y",function(){return Fe});function te(Y){return!Y||typeof Y!="string"?!0:Y.trim().length===0}const H=/{(\d+)}/g;function C(Y,...se){return se.length===0?Y:Y.replace(H,function(pe,ve){const Me=parseInt(ve,10);return isNaN(Me)||Me<0||Me>=se.length?pe:se[Me]})}function j(Y){return Y.replace(/[<>&]/g,function(se){switch(se){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";default:return se}})}function L(Y){return Y.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function R(Y,se=" "){const pe=B(Y,se);return k(pe,se)}function B(Y,se){if(!Y||!se)return Y;const pe=se.length;if(pe===0||Y.length===0)return Y;let ve=0;for(;Y.indexOf(se,ve)===ve;)ve=ve+pe;return Y.substring(ve)}function k(Y,se){if(!Y||!se)return Y;const pe=se.length,ve=Y.length;if(pe===0||ve===0)return Y;let Me=ve,he=-1;for(;!(he=Y.lastIndexOf(se,Me-1),he===-1||he+pe!==Me);){if(he===0)return"";Me=he}return Y.substring(0,Me)}function e(Y){return Y.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function A(Y){return Y.replace(/\*/g,"")}function g(Y,se,pe={}){if(!Y)throw new Error("Cannot create regex from empty string");se||(Y=L(Y)),pe.wholeWord&&(/\B/.test(Y.charAt(0))||(Y="\\b"+Y),/\B/.test(Y.charAt(Y.length-1))||(Y=Y+"\\b"));let ve="";return pe.global&&(ve+="g"),pe.matchCase||(ve+="i"),pe.multiline&&(ve+="m"),pe.unicode&&(ve+="u"),new RegExp(Y,ve)}function c(Y){if(Y.source==="^"||Y.source==="^$"||Y.source==="$"||Y.source==="^\\s*$")return!1;const se=Y.exec("");return!!(se&&Y.lastIndex===0)}function l(Y){return(Y.global?"g":"")+(Y.ignoreCase?"i":"")+(Y.multiline?"m":"")+(Y.unicode?"u":"")}function n(Y){return Y.split(/\r\n|\r|\n/)}function a(Y){for(let se=0,pe=Y.length;se<pe;se++){const ve=Y.charCodeAt(se);if(ve!==32&&ve!==9)return se}return-1}function o(Y,se=0,pe=Y.length){for(let ve=se;ve<pe;ve++){const Me=Y.charCodeAt(ve);if(Me!==32&&Me!==9)return Y.substring(se,ve)}return Y.substring(se,pe)}function s(Y,se=Y.length-1){for(let pe=se;pe>=0;pe--){const ve=Y.charCodeAt(pe);if(ve!==32&&ve!==9)return pe}return-1}function r(Y,se){return Y<se?-1:Y>se?1:0}function i(Y,se,pe=0,ve=Y.length,Me=0,he=se.length){for(;pe<ve&&Me<he;pe++,Me++){let Se=Y.charCodeAt(pe),Ce=se.charCodeAt(Me);if(Se<Ce)return-1;if(Se>Ce)return 1}const me=ve-pe,_e=he-Me;return me<_e?-1:me>_e?1:0}function t(Y,se){return y(Y,se,0,Y.length,0,se.length)}function y(Y,se,pe=0,ve=Y.length,Me=0,he=se.length){for(;pe<ve&&Me<he;pe++,Me++){let Se=Y.charCodeAt(pe),Ce=se.charCodeAt(Me);if(Se===Ce)continue;if(Se>=128||Ce>=128)return i(Y.toLowerCase(),se.toLowerCase(),pe,ve,Me,he);p(Se)&&(Se-=32),p(Ce)&&(Ce-=32);const Oe=Se-Ce;if(Oe===0)continue;return Oe}const me=ve-pe,_e=he-Me;return me<_e?-1:me>_e?1:0}function p(Y){return Y>=97&&Y<=122}function m(Y){return Y>=65&&Y<=90}function E(Y,se){return Y.length===se.length&&y(Y,se)===0}function _(Y,se){const pe=se.length;return se.length>Y.length?!1:y(Y,se,0,pe)===0}function h(Y,se){let pe,ve=Math.min(Y.length,se.length);for(pe=0;pe<ve;pe++)if(Y.charCodeAt(pe)!==se.charCodeAt(pe))return pe;return ve}function u(Y,se){let pe,ve=Math.min(Y.length,se.length);const Me=Y.length-1,he=se.length-1;for(pe=0;pe<ve;pe++)if(Y.charCodeAt(Me-pe)!==se.charCodeAt(he-pe))return pe;return ve}function d(Y){return 55296<=Y&&Y<=56319}function f(Y){return 56320<=Y&&Y<=57343}function T(Y,se){return(Y-55296<<10)+(se-56320)+65536}function b(Y,se,pe){const ve=Y.charCodeAt(pe);if(d(ve)&&pe+1<se){const Me=Y.charCodeAt(pe+1);if(f(Me))return T(ve,Me)}return ve}function S(Y,se){const pe=Y.charCodeAt(se-1);if(f(pe)&&se>1){const ve=Y.charCodeAt(se-2);if(d(ve))return T(ve,pe)}return pe}function D(Y,se){const pe=Ie.getInstance(),ve=se,Me=Y.length,he=b(Y,Me,se);se+=he>=65536?2:1;let me=pe.getGraphemeBreakType(he);for(;se<Me;){const _e=b(Y,Me,se),Se=pe.getGraphemeBreakType(_e);if(Re(me,Se))break;se+=_e>=65536?2:1,me=Se}return se-ve}function I(Y,se){const pe=Ie.getInstance(),ve=se,Me=S(Y,se);se-=Me>=65536?2:1;let he=pe.getGraphemeBreakType(Me);for(;se>0;){const me=S(Y,se),_e=pe.getGraphemeBreakType(me);if(Re(_e,he))break;se-=me>=65536?2:1,he=_e}return ve-se}const w=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/;function P(Y){return w.test(Y)}const U=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDED6])/;function O(Y){return U.test(Y)}const G=/^[\t\n\r\x20-\x7E]*$/;function z(Y){return G.test(Y)}const ae=/[\u2028\u2029]/;function ie(Y){return ae.test(Y)}function fe(Y){for(let se=0,pe=Y.length;se<pe;se++)if(ce(Y.charCodeAt(se)))return!0;return!1}function ce(Y){return Y=+Y,Y>=11904&&Y<=55215||Y>=63744&&Y<=64255||Y>=65281&&Y<=65374}function J(Y){return Y>=127462&&Y<=127487||Y===8986||Y===8987||Y===9200||Y===9203||Y>=9728&&Y<=10175||Y===11088||Y===11093||Y>=127744&&Y<=128591||Y>=128640&&Y<=128764||Y>=128992&&Y<=129003||Y>=129280&&Y<=129535||Y>=129648&&Y<=129750}const Z=String.fromCharCode(65279);function ue(Y){return!!(Y&&Y.length>0&&Y.charCodeAt(0)===65279)}function X(Y,se=!1){return Y?(se&&(Y=Y.replace(/\\./g,"")),Y.toLowerCase()!==Y):!1}function $(Y){const se=90-65+1;return Y=Y%(2*se),Y<se?String.fromCharCode(97+Y):String.fromCharCode(65+Y-se)}function be(Y){const se=Ie.getInstance();return se.getGraphemeBreakType(Y)}function Re(Y,se){return Y===0?se!==5&&se!==7:Y===2&&se===3?!1:Y===4||Y===2||Y===3||(se===4||se===2||se===3)?!0:Y===8&&(se===8||se===9||se===11||se===12)||((Y===11||Y===9)&&(se===9||se===10)||((Y===12||Y===10)&&se===10||(se===5||se===13||(se===7||(Y===1||Y===13&&se===14)))))?!1:!(Y===6&&se===6)}class Ie{constructor(){this._data=Le()}static getInstance(){return Ie._INSTANCE||(Ie._INSTANCE=new Ie),Ie._INSTANCE}getGraphemeBreakType(Y){if(Y<32)return Y===10?3:Y===13?2:4;if(Y<127)return 0;const se=this._data,pe=se.length/3;let ve=1;for(;ve<=pe;)if(Y<se[3*ve])ve=2*ve;else if(Y>se[3*ve+1])ve=2*ve+1;else return se[3*ve+2];return 0}}Ie._INSTANCE=null;function Le(){return JSON.parse("[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]")}function Fe(Y,se){if(Y===0)return 0;const pe=ye(Y,se);if(pe!==void 0)return pe;const ve=S(se,Y);return Y-=Te(ve),Y}function ye(Y,se){let pe=S(se,Y);for(Y-=Te(pe);Ae(pe)||pe===65039||pe===8419;){if(Y===0)return;pe=S(se,Y),Y-=Te(pe)}if(!J(pe))return;if(Y>=0){const ve=S(se,Y);ve===8205&&(Y-=Te(ve))}return Y}function Te(Y){return Y>=65536?2:1}function Ae(Y){return 127995<=Y&&Y<=127999}},NvD2:function(Qe,le,W){"use strict";W.d(le,"a",function(){return R});var te=W("Kwbf");function H(B,k){var e=new Set;return B.forEach(function(A){k.has(A)||e.add(A)}),e}function C(B){var k=B||{},e=k.disabled,A=k.disableCheckbox,g=k.checkable;return!!(e||A)||g===!1}function j(B,k,e,A){for(var g=new Set(B),c=new Set,l=0;l<=e;l+=1){var n=k.get(l)||new Set;n.forEach(function(r){var i=r.key,t=r.node,y=r.children,p=y===void 0?[]:y;g.has(i)&&!A(t)&&p.filter(function(m){return!A(m.node)}).forEach(function(m){g.add(m.key)})})}for(var a=new Set,o=e;o>=0;o-=1){var s=k.get(o)||new Set;s.forEach(function(r){var i=r.parent,t=r.node;if(A(t)||!r.parent||a.has(r.parent.key))return;if(A(r.parent.node)){a.add(i.key);return}var y=!0,p=!1;(i.children||[]).filter(function(m){return!A(m.node)}).forEach(function(m){var E=m.key,_=g.has(E);y&&!_&&(y=!1),!p&&(_||c.has(E))&&(p=!0)}),y&&g.add(i.key),p&&c.add(i.key),a.add(i.key)})}return{checkedKeys:Array.from(g),halfCheckedKeys:Array.from(H(c,g))}}function L(B,k,e,A,g){for(var c=new Set(B),l=new Set(k),n=0;n<=A;n+=1){var a=e.get(n)||new Set;a.forEach(function(i){var t=i.key,y=i.node,p=i.children,m=p===void 0?[]:p;!c.has(t)&&!l.has(t)&&!g(y)&&m.filter(function(E){return!g(E.node)}).forEach(function(E){c.delete(E.key)})})}l=new Set;for(var o=new Set,s=A;s>=0;s-=1){var r=e.get(s)||new Set;r.forEach(function(i){var t=i.parent,y=i.node;if(g(y)||!i.parent||o.has(i.parent.key))return;if(g(i.parent.node)){o.add(t.key);return}var p=!0,m=!1;(t.children||[]).filter(function(E){return!g(E.node)}).forEach(function(E){var _=E.key,h=c.has(_);p&&!h&&(p=!1),!m&&(h||l.has(_))&&(m=!0)}),p||c.delete(t.key),m&&l.add(t.key),o.add(t.key)})}return{checkedKeys:Array.from(c),halfCheckedKeys:Array.from(H(l,c))}}function R(B,k,e,A){var g=[],c;A?c=A:c=C;var l=new Set(B.filter(function(s){var r=!!e[s];return r||g.push(s),r})),n=new Map,a=0;Object.keys(e).forEach(function(s){var r=e[s],i=r.level,t=n.get(i);t||(t=new Set,n.set(i,t)),t.add(r),a=Math.max(a,i)}),Object(te.a)(!g.length,"Tree missing follow keys: ".concat(g.slice(0,100).map(function(s){return"'".concat(s,"'")}).join(", ")));var o;return k===!0?o=j(l,n,a,c):o=L(l,k.halfCheckedKeys,n,a,c),o}},OZM5:function(Qe,le,W){"use strict";W.d(le,"b",function(){return A}),W.d(le,"a",function(){return g}),W.d(le,"k",function(){return c}),W.d(le,"h",function(){return l}),W.d(le,"i",function(){return n}),W.d(le,"g",function(){return a}),W.d(le,"c",function(){return o}),W.d(le,"d",function(){return s}),W.d(le,"j",function(){return t}),W.d(le,"e",function(){return y}),W.d(le,"f",function(){return p});var te=W("KQm4"),H=W("U8pU"),C=W("Ff2n"),j=W("q1tI"),L=W.n(j),R=W("Kwbf"),B=W("WaYH"),k=.25,e=2;function A(m,E){var _=m.slice(),h=_.indexOf(E);return h>=0&&_.splice(h,1),_}function g(m,E){var _=m.slice();return _.indexOf(E)===-1&&_.push(E),_}function c(m){return m.split("-")}function l(m,E){return"".concat(m,"-").concat(E)}function n(m){return m&&m.type&&m.type.isTreeNode}function a(m,E){var _=[m],h=E[m];function u(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];d.forEach(function(f){var T=f.key,b=f.children;_.push(T),u(b)})}return u(h.children),_}function o(m,E){var _=m.clientY,h=E.selectHandle.getBoundingClientRect(),u=h.top,d=h.bottom,f=h.height,T=Math.max(f*k,e);return _<=u+T?-1:_>=d-T?1:0}function s(m,E){if(!m)return;var _=E.multiple;return _?m.slice():m.length?[m[0]]:m}var r=function(E){return E};function i(m,E){if(!m)return[];var _=E||{},h=_.processProps,u=h===void 0?r:h,d=Array.isArray(m)?m:[m];return d.map(function(f){var T=f.children,b=Object(C.a)(f,["children"]),S=i(T,E);return L.a.createElement(B.a,Object.assign({},u(b)),S)})}function t(m){if(!m)return null;var E;if(Array.isArray(m))E={checkedKeys:m,halfCheckedKeys:void 0};else if(Object(H.a)(m)==="object")E={checkedKeys:m.checked||void 0,halfCheckedKeys:m.halfChecked||void 0};else return Object(R.a)(!1,"`checkedKeys` is not an array or an object"),null;return E}function y(m,E){var _=new Set;function h(u){if(_.has(u))return;var d=E[u];if(!d)return;_.add(u);var f=d.parent,T=d.node;if(T.disabled)return;f&&h(f.key)}return(m||[]).forEach(function(u){h(u)}),Object(te.a)(_)}function p(m){var E={};return Object.keys(m).forEach(function(_){(_.startsWith("data-")||_.startsWith("aria-"))&&(E[_]=m[_])}),E}},P48q:function(Qe,le,W){Qe.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(Qe,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 W,te,H,C=!1,j,L;window.PR_SHOULD_USE_CONTINUATION=!0;var R,B;(function(){var k=window,e=["break,continue,do,else,for,if,return,while"],A=[e,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],g=[A,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],c=[g,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],l=[g,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],n=[g,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],a="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",o=[g,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",r=[e,"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"],i=[e,"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"],t=[e,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],y=[c,n,l,o,s,r,i,t],p=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,m="str",E="kwd",_="com",h="typ",u="lit",d="pun",f="pln",T="tag",b="dec",S="src",D="atn",I="atv",w="nocode",P="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function U(ye){for(var Te=0,Ae=!1,Y=!1,se=0,pe=ye.length;se<pe;++se){var ve=ye[se];if(ve.ignoreCase)Y=!0;else if(/[a-z]/i.test(ve.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Ae=!0,Y=!1;break}}var Me={b:8,t:9,n:10,v:11,f:12,r:13};function he(Oe){var xe=Oe.charCodeAt(0);if(xe!==92)return xe;var Ue=Oe.charAt(1);return xe=Me[Ue],xe||("0"<=Ue&&Ue<="7"?parseInt(Oe.substring(1),8):Ue==="u"||Ue==="x"?parseInt(Oe.substring(2),16):Oe.charCodeAt(1))}function me(Oe){if(Oe<32)return(Oe<16?"\\x0":"\\x")+Oe.toString(16);var xe=String.fromCharCode(Oe);return xe==="\\"||xe==="-"||xe==="]"||xe==="^"?"\\"+xe:xe}function _e(Oe){var xe=Oe.substring(1,Oe.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")),Ue=[],Be=xe[0]==="^",Ee=["["];Be&&Ee.push("^");for(var De=Be?1:0,de=xe.length;De<de;++De){var re=xe[De];if(/\\[bdsw]/i.test(re))Ee.push(re);else{var oe=he(re),V;De+2<de&&xe[De+1]==="-"?(V=he(xe[De+2]),De+=2):V=oe,Ue.push([oe,V]),V<65||oe>122||(V<65||oe>90||Ue.push([Math.max(65,oe)|32,Math.min(V,90)|32]),V<97||oe>122||Ue.push([Math.max(97,oe)&~32,Math.min(V,122)&~32]))}}Ue.sort(function(ge,we){return ge[0]-we[0]||we[1]-ge[1]});for(var Q=[],q=[],De=0;De<Ue.length;++De){var ee=Ue[De];ee[0]<=q[1]+1?q[1]=Math.max(q[1],ee[1]):Q.push(q=ee)}for(var De=0;De<Q.length;++De){var ee=Q[De];Ee.push(me(ee[0])),ee[1]>ee[0]&&(ee[1]+1>ee[0]&&Ee.push("-"),Ee.push(me(ee[1])))}return Ee.push("]"),Ee.join("")}function Se(Oe){for(var xe=Oe.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")),Ue=xe.length,Be=[],Ee=0,De=0;Ee<Ue;++Ee){var de=xe[Ee];if(de==="(")++De;else if(de.charAt(0)==="\\"){var re=+de.substring(1);re&&(re<=De?Be[re]=-1:xe[Ee]=me(re))}}for(var Ee=1;Ee<Be.length;++Ee)Be[Ee]===-1&&(Be[Ee]=++Te);for(var Ee=0,De=0;Ee<Ue;++Ee){var de=xe[Ee];if(de==="(")++De,Be[De]||(xe[Ee]="(?:");else if(de.charAt(0)==="\\"){var re=+de.substring(1);re&&re<=De&&(xe[Ee]="\\"+Be[re])}}for(var Ee=0;Ee<Ue;++Ee)xe[Ee]==="^"&&xe[Ee+1]!=="^"&&(xe[Ee]="");if(Oe.ignoreCase&&Ae)for(var Ee=0;Ee<Ue;++Ee){var de=xe[Ee],oe=de.charAt(0);de.length>=2&&oe==="["?xe[Ee]=_e(de):oe!=="\\"&&(xe[Ee]=de.replace(/[a-zA-Z]/g,function(q){var ee=q.charCodeAt(0);return"["+String.fromCharCode(ee&~32,ee|32)+"]"}))}return xe.join("")}for(var Ce=[],se=0,pe=ye.length;se<pe;++se){var ve=ye[se];if(ve.global||ve.multiline)throw new Error(""+ve);Ce.push("(?:"+Se(ve)+")")}return new RegExp(Ce.join("|"),Y?"gi":"g")}function O(ye,Te){var Ae=/(?:^|\s)nocode(?:\s|$)/,Y=[],se=0,pe=[],ve=0;function Me(he){var me=he.nodeType;if(me==1){if(Ae.test(he.className))return;for(var _e=he.firstChild;_e;_e=_e.nextSibling)Me(_e);var Se=he.nodeName.toLowerCase();(Se==="br"||Se==="li")&&(Y[ve]=`
`,pe[ve<<1]=se++,pe[ve++<<1|1]=he)}else if(me==3||me==4){var Ce=he.nodeValue;Ce.length&&(Te?Ce=Ce.replace(/\r\n?/g,`
`):Ce=Ce.replace(/[ \t\r\n]+/g," "),Y[ve]=Ce,pe[ve<<1]=se,se+=Ce.length,pe[ve++<<1|1]=he)}}return Me(ye),{sourceCode:Y.join("").replace(/\n$/,""),spans:pe}}function G(ye,Te,Ae,Y,se){if(!Ae)return;var pe={sourceNode:ye,pre:1,langExtension:null,numberLines:null,sourceCode:Ae,spans:null,basePos:Te,decorations:null};Y(pe),se.push.apply(se,pe.decorations)}var z=/\S/;function ae(ye){for(var Te=void 0,Ae=ye.firstChild;Ae;Ae=Ae.nextSibling){var Y=Ae.nodeType;Te=Y===1?Te?ye:Ae:Y===3&&z.test(Ae.nodeValue)?ye:Te}return Te===ye?void 0:Te}function ie(ye,Te){var Ae={},Y;(function(){for(var ve=ye.concat(Te),Me=[],he={},me=0,_e=ve.length;me<_e;++me){var Se=ve[me],Ce=Se[3];if(Ce)for(var Oe=Ce.length;--Oe>=0;)Ae[Ce.charAt(Oe)]=Se;var xe=Se[1],Ue=""+xe;he.hasOwnProperty(Ue)||(Me.push(xe),he[Ue]=null)}Me.push(/[\0-\uffff]/),Y=U(Me)})();var se=Te.length,pe=function(ve){for(var Me=ve.sourceCode,he=ve.basePos,me=ve.sourceNode,_e=[he,f],Se=0,Ce=Me.match(Y)||[],Oe={},xe=0,Ue=Ce.length;xe<Ue;++xe){var Be=Ce[xe],Ee=Oe[Be],De=void 0,de;if(typeof Ee=="string")de=!1;else{var re=Ae[Be.charAt(0)];if(re)De=Be.match(re[1]),Ee=re[0];else{for(var oe=0;oe<se;++oe)if(re=Te[oe],De=Be.match(re[1]),De){Ee=re[0];break}De||(Ee=f)}de=Ee.length>=5&&Ee.substring(0,5)==="lang-",de&&!(De&&typeof De[1]=="string")&&(de=!1,Ee=S),de||(Oe[Be]=Ee)}var V=Se;if(Se+=Be.length,!de)_e.push(he+V,Ee);else{var Q=De[1],q=Be.indexOf(Q),ee=q+Q.length;De[2]&&(ee=Be.length-De[2].length,q=ee-Q.length);var ge=Ee.substring(5);G(me,he+V,Be.substring(0,q),pe,_e),G(me,he+V+q,Q,$(ge,Q),_e),G(me,he+V+ee,Be.substring(ee),pe,_e)}}ve.decorations=_e};return pe}function fe(ye){var Te=[],Ae=[];ye.tripleQuotedStrings?Te.push([m,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):ye.multiLineStrings?Te.push([m,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Te.push([m,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),ye.verbatimStrings&&Ae.push([m,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Y=ye.hashComments;Y&&(ye.cStyleComments?(Y>1?Te.push([_,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Te.push([_,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Ae.push([m,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Te.push([_,/^#[^\r\n]*/,null,"#"])),ye.cStyleComments&&(Ae.push([_,/^\/\/[^\r\n]*/,null]),Ae.push([_,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var se=ye.regexLiterals;if(se){var pe=se>1?"":`
\r`,ve=pe?".":"[\\S\\s]",Me="/(?=[^/*"+pe+"])(?:[^/\\x5B\\x5C"+pe+"]|\\x5C"+ve+"|\\x5B(?:[^\\x5C\\x5D"+pe+"]|\\x5C"+ve+")*(?:\\x5D|$))+/";Ae.push(["lang-regex",RegExp("^"+P+"("+Me+")")])}var he=ye.types;he&&Ae.push([h,he]);var me=(""+ye.keywords).replace(/^ | $/g,"");me.length&&Ae.push([E,new RegExp("^(?:"+me.replace(/[\s,]+/g,"|")+")\\b"),null]),Te.push([f,/^\s+/,null,` \r
\xA0`]);var _e="^.[^\\s\\w.$@'\"`/\\\\]*";return ye.regexLiterals&&(_e+="(?!s*/)"),Ae.push([u,/^@[a-z_$][a-z_$@0-9]*/i,null],[h,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[f,/^[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"],[f,/^\\[\s\S]?/,null],[d,new RegExp(_e),null]),ie(Te,Ae)}var ce=fe({keywords:y,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function J(ye,Te,Ae){for(var Y=/(?:^|\s)nocode(?:\s|$)/,se=/\r\n?|\n/,pe=ye.ownerDocument,ve=pe.createElement("li");ye.firstChild;)ve.appendChild(ye.firstChild);var Me=[ve];function he(xe){var Ue=xe.nodeType;if(Ue==1&&!Y.test(xe.className))if(xe.nodeName==="br")me(xe),xe.parentNode&&xe.parentNode.removeChild(xe);else for(var Be=xe.firstChild;Be;Be=Be.nextSibling)he(Be);else if((Ue==3||Ue==4)&&Ae){var Ee=xe.nodeValue,De=Ee.match(se);if(De){var de=Ee.substring(0,De.index);xe.nodeValue=de;var re=Ee.substring(De.index+De[0].length);if(re){var oe=xe.parentNode;oe.insertBefore(pe.createTextNode(re),xe.nextSibling)}me(xe),de||xe.parentNode.removeChild(xe)}}}function me(xe){for(;!xe.nextSibling;)if(xe=xe.parentNode,!xe)return;function Ue(De,de){var re=de?De.cloneNode(!1):De,oe=De.parentNode;if(oe){var V=Ue(oe,1),Q=De.nextSibling;V.appendChild(re);for(var q=Q;q;q=Q)Q=q.nextSibling,V.appendChild(q)}return re}for(var Be=Ue(xe.nextSibling,0),Ee;(Ee=Be.parentNode)&&Ee.nodeType===1;)Be=Ee;Me.push(Be)}for(var _e=0;_e<Me.length;++_e)he(Me[_e]);Te===(Te|0)&&Me[0].setAttribute("value",Te);var Se=pe.createElement("ol");Se.className="linenums";for(var Ce=Math.max(0,Te-1|0)||0,_e=0,Oe=Me.length;_e<Oe;++_e)ve=Me[_e],ve.className="L"+(_e+Ce)%10,ve.firstChild||ve.appendChild(pe.createTextNode("\xA0")),Se.appendChild(ve);ye.appendChild(Se)}function Z(ye){var Te=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Te=Te&&+Te[1]<=8;var Ae=/\n/g,Y=ye.sourceCode,se=Y.length,pe=0,ve=ye.spans,Me=ve.length,he=0,me=ye.decorations,_e=me.length,Se=0;me[_e]=se;var Ce,Oe;for(Oe=Ce=0;Oe<_e;)me[Oe]!==me[Oe+2]?(me[Ce++]=me[Oe++],me[Ce++]=me[Oe++]):Oe+=2;for(_e=Ce,Oe=Ce=0;Oe<_e;){for(var xe=me[Oe],Ue=me[Oe+1],Be=Oe+2;Be+2<=_e&&me[Be+1]===Ue;)Be+=2;me[Ce++]=xe,me[Ce++]=Ue,Oe=Be}_e=me.length=Ce;var Ee=ye.sourceNode,De="";Ee&&(De=Ee.style.display,Ee.style.display="none");try{for(var de=null;he<Me;){var re=ve[he],oe=ve[he+2]||se,V=me[Se+2]||se,Be=Math.min(oe,V),Q=ve[he+1],q;if(Q.nodeType!==1&&(q=Y.substring(pe,Be))){Te&&(q=q.replace(Ae,"\r")),Q.nodeValue=q;var ee=Q.ownerDocument,ge=ee.createElement("span");ge.className=me[Se+1];var we=Q.parentNode;we.replaceChild(ge,Q),ge.appendChild(Q),pe<oe&&(ve[he+1]=Q=ee.createTextNode(Y.substring(Be,oe)),we.insertBefore(Q,ge.nextSibling))}pe=Be,pe>=oe&&(he+=2),pe>=V&&(Se+=2)}}finally{Ee&&(Ee.style.display=De)}}var ue={};function X(ye,Te){for(var Ae=Te.length;--Ae>=0;){var Y=Te[Ae];ue.hasOwnProperty(Y)?k.console&&console.warn("cannot override language handler %s",Y):ue[Y]=ye}}function $(ye,Te){return ye&&ue.hasOwnProperty(ye)||(ye=/^\s*</.test(Te)?"default-markup":"default-code"),ue[ye]}X(ce,["default-code"]),X(ie([],[[f,/^[^<?]+/],[b,/^<!\w[^>]*(?:>|$)/],[_,/^<\!--[\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"]),X(ie([[f,/^[\s]+/,null,` \r
`],[I,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[T,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[D,/^(?!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"]),X(ie([],[[I,/^[\s\S]+/]]),["uq.val"]),X(fe({keywords:c,hashComments:!0,cStyleComments:!0,types:p}),["c","cc","cpp","cxx","cyc","m"]),X(fe({keywords:"null,true,false"}),["json"]),X(fe({keywords:n,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:p}),["cs"]),X(fe({keywords:l,cStyleComments:!0}),["java"]),X(fe({keywords:t,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),X(fe({keywords:r,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),X(fe({keywords:s,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),X(fe({keywords:i,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),X(fe({keywords:o,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),X(fe({keywords:a,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),X(ie([],[[m,/^[\s\S]+/]]),["regex"]);function be(ye){var Te=ye.langExtension;try{var Ae=O(ye.sourceNode,ye.pre),Y=Ae.sourceCode;ye.sourceCode=Y,ye.spans=Ae.spans,ye.basePos=0,$(Te,Y)(ye),Z(ye)}catch(se){k.console&&console.log(se&&se.stack||se)}}function Re(ye,Te,Ae){var Y=Ae||!1,se=Te||null,pe=document.createElement("div");pe.innerHTML="<pre>"+ye+"</pre>",pe=pe.firstChild,Y&&J(pe,Y,!0);var ve={langExtension:se,numberLines:Y,sourceNode:pe,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return be(ve),pe.innerHTML}function Ie(ye,Te){var Ae=Te||document.body,Y=Ae.ownerDocument||document;function se(re){return Ae.getElementsByTagName(re)}for(var pe=[se("pre"),se("code"),se("xmp")],ve=[],Me=0;Me<pe.length;++Me)for(var he=0,me=pe[Me].length;he<me;++he)ve.push(pe[Me][he]);pe=null;var _e=Date;_e.now||(_e={now:function(){return+new Date}});var Se=0,Ce=/\blang(?:uage)?-([\w.]+)(?!\S)/,Oe=/\bprettyprint\b/,xe=/\bprettyprinted\b/,Ue=/pre|xmp/i,Be=/^code$/i,Ee=/^(?:pre|code|xmp)$/i,De={};function de(){for(var re=k.PR_SHOULD_USE_CONTINUATION?_e.now()+250:Infinity;Se<ve.length&&_e.now()<re;Se++){for(var oe=ve[Se],V=De,Q=oe;Q=Q.previousSibling;){var q=Q.nodeType,ee=(q===7||q===8)&&Q.nodeValue;if(ee?!/^\??prettify\b/.test(ee):q!==3||/\S/.test(Q.nodeValue))break;if(ee){V={},ee.replace(/\b(\w+)=([\w:.%+-]+)/g,function(pt,it,_t){V[it]=_t});break}}var ge=oe.className;if((V!==De||Oe.test(ge))&&!xe.test(ge)){for(var we=!1,Ne=oe.parentNode;Ne;Ne=Ne.parentNode){var Ge=Ne.tagName;if(Ee.test(Ge)&&Ne.className&&Oe.test(Ne.className)){we=!0;break}}if(!we){oe.className+=" prettyprinted";var Je=V.lang;if(!Je){Je=ge.match(Ce);var ze;!Je&&(ze=ae(oe))&&Be.test(ze.tagName)&&(Je=ze.className.match(Ce)),Je&&(Je=Je[1])}var qe;if(Ue.test(oe.tagName))qe=1;else{var nt=oe.currentStyle,$e=Y.defaultView,gt=nt?nt.whiteSpace:$e&&$e.getComputedStyle?$e.getComputedStyle(oe,null).getPropertyValue("white-space"):0;qe=gt&&gt.substring(0,3)==="pre"}var ht=V.linenums;(ht=ht==="true"||+ht)||(ht=ge.match(/\blinenums\b(?::(\d+))?/),ht=ht?ht[1]&&ht[1].length?+ht[1]:!0:!1),ht&&J(oe,ht,qe);var bt={langExtension:Je,sourceNode:oe,numberLines:ht,pre:qe,sourceCode:null,basePos:null,spans:null,decorations:null};be(bt)}}}Se<ve.length?k.setTimeout(de,250):typeof ye=="function"&&ye()}de()}var Le=k.PR={createSimpleLexer:ie,registerLangHandler:X,sourceDecorator:fe,PR_ATTRIB_NAME:D,PR_ATTRIB_VALUE:I,PR_COMMENT:_,PR_DECLARATION:b,PR_KEYWORD:E,PR_LITERAL:u,PR_NOCODE:w,PR_PLAIN:f,PR_PUNCTUATION:d,PR_SOURCE:S,PR_STRING:m,PR_TAG:T,PR_TYPE:h,prettyPrintOne:C?k.prettyPrintOne=Re:R=Re,prettyPrint:B=C?k.prettyPrint=Ie:B=Ie},Fe=k.define;typeof Fe=="function"&&Fe.amd&&Fe("google-code-prettify",[],function(){return Le})})()},T8No:function(Qe,le,W){"use strict";W.d(le,"a",function(){return B}),W.d(le,"e",function(){return k}),W.d(le,"c",function(){return d}),W.d(le,"b",function(){return f}),W.d(le,"d",function(){return T}),W.d(le,"f",function(){return D});var te=W("MNsG"),H=W("N0LK"),C=W("Cg/j");let j=te.k||"";const L=new Map;L.set("false",!1),L.set("true",!0),L.set("isMac",te.f),L.set("isLinux",te.d),L.set("isWindows",te.i),L.set("isWeb",te.h),L.set("isMacNative",te.f&&!te.h),L.set("isEdge",j.indexOf("Edg/")>=0),L.set("isFirefox",j.indexOf("Firefox")>=0),L.set("isChrome",j.indexOf("Chrome")>=0),L.set("isSafari",j.indexOf("Safari")>=0);const R=Object.prototype.hasOwnProperty;class B{static has(w){return c.create(w)}static equals(w,P){return l.create(w,P)}static regex(w,P){return m.create(w,P)}static not(w){return s.create(w)}static and(...w){return h.create(w,null)}static or(...w){return u.create(w,null,!0)}static deserialize(w,P=!1){return w?this._deserializeOrExpression(w,P):void 0}static _deserializeOrExpression(w,P){let U=w.split("||");return u.create(U.map(O=>this._deserializeAndExpression(O,P)),null,!0)}static _deserializeAndExpression(w,P){let U=w.split("&&");return h.create(U.map(O=>this._deserializeOne(O,P)),null)}static _deserializeOne(w,P){if(w=w.trim(),w.indexOf("!=")>=0){let U=w.split("!=");return o.create(U[0].trim(),this._deserializeValue(U[1],P))}if(w.indexOf("==")>=0){let U=w.split("==");return l.create(U[0].trim(),this._deserializeValue(U[1],P))}if(w.indexOf("=~")>=0){let U=w.split("=~");return m.create(U[0].trim(),this._deserializeRegexValue(U[1],P))}if(w.indexOf(" in ")>=0){let U=w.split(" in ");return n.create(U[0].trim(),U[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(w)){const U=w.split(">=");return t.create(U[0].trim(),U[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(w)){const U=w.split(">");return i.create(U[0].trim(),U[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(w)){const U=w.split("<=");return p.create(U[0].trim(),U[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(w)){const U=w.split("<");return y.create(U[0].trim(),U[1].trim())}return/^\!\s*/.test(w)?s.create(w.substr(1).trim()):c.create(w)}static _deserializeValue(w,P){if(w=w.trim(),w==="true")return!0;if(w==="false")return!1;let U=/^'([^']*)'$/.exec(w);return U?U[1].trim():w}static _deserializeRegexValue(w,P){if(Object(H.C)(w)){if(P)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let U=w.indexOf("/"),O=w.lastIndexOf("/");if(U===O||U<0){if(P)throw new Error(`bad regexp-value '${w}', missing /-enclosure`);return console.warn(`bad regexp-value '${w}', missing /-enclosure`),null}let G=w.slice(U+1,O),z=w[O+1]==="i"?"i":"";try{return new RegExp(G,z)}catch(ae){if(P)throw new Error(`bad regexp-value '${w}', parse error: ${ae}`);return console.warn(`bad regexp-value '${w}', parse error: ${ae}`),null}}}function k(w,P){const U=w?w.substituteConstants():void 0,O=P?P.substituteConstants():void 0;return!U&&!O?!0:!U||!O?!1:U.equals(O)}function e(w,P){return w.cmp(P)}class A{constructor(){this.type=0}cmp(w){return this.type-w.type}equals(w){return w.type===this.type}substituteConstants(){return this}evaluate(w){return!1}serialize(){return"false"}keys(){return[]}negate(){return g.INSTANCE}}A.INSTANCE=new A;class g{constructor(){this.type=1}cmp(w){return this.type-w.type}equals(w){return w.type===this.type}substituteConstants(){return this}evaluate(w){return!0}serialize(){return"true"}keys(){return[]}negate(){return A.INSTANCE}}g.INSTANCE=new g;class c{constructor(w,P){this.key=w,this.negated=P,this.type=2}static create(w,P=null){const U=L.get(w);return typeof U=="boolean"?U?g.INSTANCE:A.INSTANCE:new c(w,P)}cmp(w){return w.type!==this.type?this.type-w.type:b(this.key,w.key)}equals(w){return w.type===this.type?this.key===w.key:!1}substituteConstants(){const w=L.get(this.key);return typeof w=="boolean"?w?g.INSTANCE:A.INSTANCE:this}evaluate(w){return!!w.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=s.create(this.key,this)),this.negated}}class l{constructor(w,P,U){this.key=w,this.value=P,this.negated=U,this.type=4}static create(w,P,U=null){if(typeof P=="boolean")return P?c.create(w,U):s.create(w,U);const O=L.get(w);if(typeof O=="boolean"){const G=O?"true":"false";return P===G?g.INSTANCE:A.INSTANCE}return new l(w,P,U)}cmp(w){return w.type!==this.type?this.type-w.type:S(this.key,this.value,w.key,w.value)}equals(w){return w.type===this.type?this.key===w.key&&this.value===w.value:!1}substituteConstants(){const w=L.get(this.key);if(typeof w=="boolean"){const P=w?"true":"false";return this.value===P?g.INSTANCE:A.INSTANCE}return this}evaluate(w){return w.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=o.create(this.key,this.value,this)),this.negated}}class n{constructor(w,P){this.key=w,this.valueKey=P,this.type=10,this.negated=null}static create(w,P){return new n(w,P)}cmp(w){return w.type!==this.type?this.type-w.type:S(this.key,this.valueKey,w.key,w.valueKey)}equals(w){return w.type===this.type?this.key===w.key&&this.valueKey===w.valueKey:!1}substituteConstants(){return this}evaluate(w){const P=w.getValue(this.valueKey),U=w.getValue(this.key);return Array.isArray(P)?P.indexOf(U)>=0:typeof U=="string"&&typeof P=="object"&&P!==null?R.call(P,U):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=a.create(this)),this.negated}}class a{constructor(w){this._actual=w,this.type=11}static create(w){return new a(w)}cmp(w){return w.type!==this.type?this.type-w.type:this._actual.cmp(w._actual)}equals(w){return w.type===this.type?this._actual.equals(w._actual):!1}substituteConstants(){return this}evaluate(w){return!this._actual.evaluate(w)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class o{constructor(w,P,U){this.key=w,this.value=P,this.negated=U,this.type=5}static create(w,P,U=null){if(typeof P=="boolean")return P?s.create(w,U):c.create(w,U);const O=L.get(w);if(typeof O=="boolean"){const G=O?"true":"false";return P===G?A.INSTANCE:g.INSTANCE}return new o(w,P,U)}cmp(w){return w.type!==this.type?this.type-w.type:S(this.key,this.value,w.key,w.value)}equals(w){return w.type===this.type?this.key===w.key&&this.value===w.value:!1}substituteConstants(){const w=L.get(this.key);if(typeof w=="boolean"){const P=w?"true":"false";return this.value===P?A.INSTANCE:g.INSTANCE}return this}evaluate(w){return w.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=l.create(this.key,this.value,this)),this.negated}}class s{constructor(w,P){this.key=w,this.negated=P,this.type=3}static create(w,P=null){const U=L.get(w);return typeof U=="boolean"?U?A.INSTANCE:g.INSTANCE:new s(w,P)}cmp(w){return w.type!==this.type?this.type-w.type:b(this.key,w.key)}equals(w){return w.type===this.type?this.key===w.key:!1}substituteConstants(){const w=L.get(this.key);return typeof w=="boolean"?w?A.INSTANCE:g.INSTANCE:this}evaluate(w){return!w.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=c.create(this.key,this)),this.negated}}function r(w,P){if(typeof w=="string"){const U=parseFloat(w);isNaN(U)||(w=U)}return typeof w=="string"||typeof w=="number"?P(w):A.INSTANCE}class i{constructor(w,P,U){this.key=w,this.value=P,this.negated=U,this.type=12}static create(w,P,U=null){return r(P,O=>new i(w,O,U))}cmp(w){return w.type!==this.type?this.type-w.type:S(this.key,this.value,w.key,w.value)}equals(w){return w.type===this.type?this.key===w.key&&this.value===w.value:!1}substituteConstants(){return this}evaluate(w){return typeof this.value=="string"?!1:parseFloat(w.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=p.create(this.key,this.value,this)),this.negated}}class t{constructor(w,P,U){this.key=w,this.value=P,this.negated=U,this.type=13}static create(w,P,U=null){return r(P,O=>new t(w,O,U))}cmp(w){return w.type!==this.type?this.type-w.type:S(this.key,this.value,w.key,w.value)}equals(w){return w.type===this.type?this.key===w.key&&this.value===w.value:!1}substituteConstants(){return this}evaluate(w){return typeof this.value=="string"?!1:parseFloat(w.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=y.create(this.key,this.value,this)),this.negated}}class y{constructor(w,P,U){this.key=w,this.value=P,this.negated=U,this.type=14}static create(w,P,U=null){return r(P,O=>new y(w,O,U))}cmp(w){return w.type!==this.type?this.type-w.type:S(this.key,this.value,w.key,w.value)}equals(w){return w.type===this.type?this.key===w.key&&this.value===w.value:!1}substituteConstants(){return this}evaluate(w){return typeof this.value=="string"?!1:parseFloat(w.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=t.create(this.key,this.value,this)),this.negated}}class p{constructor(w,P,U){this.key=w,this.value=P,this.negated=U,this.type=15}static create(w,P,U=null){return r(P,O=>new p(w,O,U))}cmp(w){return w.type!==this.type?this.type-w.type:S(this.key,this.value,w.key,w.value)}equals(w){return w.type===this.type?this.key===w.key&&this.value===w.value:!1}substituteConstants(){return this}evaluate(w){return typeof this.value=="string"?!1:parseFloat(w.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=i.create(this.key,this.value,this)),this.negated}}class m{constructor(w,P){this.key=w,this.regexp=P,this.type=7,this.negated=null}static create(w,P){return new m(w,P)}cmp(w){if(w.type!==this.type)return this.type-w.type;if(this.key<w.key)return-1;if(this.key>w.key)return 1;const P=this.regexp?this.regexp.source:"",U=w.regexp?w.regexp.source:"";return P<U?-1:P>U?1:0}equals(w){if(w.type===this.type){const P=this.regexp?this.regexp.source:"",U=w.regexp?w.regexp.source:"";return this.key===w.key&&P===U}return!1}substituteConstants(){return this}evaluate(w){let P=w.getValue(this.key);return this.regexp?this.regexp.test(P):!1}serialize(){const w=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${w}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=E.create(this)),this.negated}}class E{constructor(w){this._actual=w,this.type=8}static create(w){return new E(w)}cmp(w){return w.type!==this.type?this.type-w.type:this._actual.cmp(w._actual)}equals(w){return w.type===this.type?this._actual.equals(w._actual):!1}substituteConstants(){return this}evaluate(w){return!this._actual.evaluate(w)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function _(w){let P=null;for(let U=0,O=w.length;U<O;U++){const G=w[U].substituteConstants();if(w[U]!==G&&P===null){P=[];for(let z=0;z<U;z++)P[z]=w[z]}P!==null&&(P[U]=G)}return P===null?w:P}class h{constructor(w,P){this.expr=w,this.negated=P,this.type=6}static create(w,P){return h._normalizeArr(w,P)}cmp(w){if(w.type!==this.type)return this.type-w.type;if(this.expr.length<w.expr.length)return-1;if(this.expr.length>w.expr.length)return 1;for(let P=0,U=this.expr.length;P<U;P++){const O=e(this.expr[P],w.expr[P]);if(O!==0)return O}return 0}equals(w){if(w.type===this.type){if(this.expr.length!==w.expr.length)return!1;for(let P=0,U=this.expr.length;P<U;P++)if(!this.expr[P].equals(w.expr[P]))return!1;return!0}return!1}substituteConstants(){const w=_(this.expr);return w===this.expr?this:h.create(w,this.negated)}evaluate(w){for(let P=0,U=this.expr.length;P<U;P++)if(!this.expr[P].evaluate(w))return!1;return!0}static _normalizeArr(w,P){const U=[];let O=!1;for(const G of w){if(!G)continue;if(G.type===1){O=!0;continue}if(G.type===0)return A.INSTANCE;if(G.type===6){U.push(...G.expr);continue}U.push(G)}if(U.length===0&&O)return g.INSTANCE;if(U.length===0)return;if(U.length===1)return U[0];U.sort(e);for(let G=1;G<U.length;G++)U[G-1].equals(U[G])&&(U.splice(G,1),G--);if(U.length===1)return U[0];for(;U.length>1;){const G=U[U.length-1];if(G.type!==9)break;U.pop();const z=U.pop(),ae=U.length===0,ie=u.create(G.expr.map(fe=>h.create([fe,z],null)),null,ae);ie&&(U.push(ie),U.sort(e))}return U.length===1?U[0]:new h(U,P)}serialize(){return this.expr.map(w=>w.serialize()).join(" && ")}keys(){const w=[];for(let P of this.expr)w.push(...P.keys());return w}negate(){if(!this.negated){const w=[];for(let P of this.expr)w.push(P.negate());this.negated=u.create(w,this,!0)}return this.negated}}class u{constructor(w,P){this.expr=w,this.negated=P,this.type=9}static create(w,P,U){return u._normalizeArr(w,P,U)}cmp(w){if(w.type!==this.type)return this.type-w.type;if(this.expr.length<w.expr.length)return-1;if(this.expr.length>w.expr.length)return 1;for(let P=0,U=this.expr.length;P<U;P++){const O=e(this.expr[P],w.expr[P]);if(O!==0)return O}return 0}equals(w){if(w.type===this.type){if(this.expr.length!==w.expr.length)return!1;for(let P=0,U=this.expr.length;P<U;P++)if(!this.expr[P].equals(w.expr[P]))return!1;return!0}return!1}substituteConstants(){const w=_(this.expr);return w===this.expr?this:u.create(w,this.negated,!1)}evaluate(w){for(let P=0,U=this.expr.length;P<U;P++)if(this.expr[P].evaluate(w))return!0;return!1}static _normalizeArr(w,P,U){let O=[],G=!1;if(w){for(let z=0,ae=w.length;z<ae;z++){const ie=w[z];if(!ie)continue;if(ie.type===0){G=!0;continue}if(ie.type===1)return g.INSTANCE;if(ie.type===9){O=O.concat(ie.expr);continue}O.push(ie)}if(O.length===0&&G)return A.INSTANCE;O.sort(e)}if(O.length===0)return;if(O.length===1)return O[0];for(let z=1;z<O.length;z++)O[z-1].equals(O[z])&&(O.splice(z,1),z--);if(O.length===1)return O[0];if(U){for(let z=0;z<O.length;z++)for(let ae=z+1;ae<O.length;ae++)D(O[z],O[ae])&&(O.splice(ae,1),ae--);if(O.length===1)return O[0]}return new u(O,P)}serialize(){return this.expr.map(w=>w.serialize()).join(" || ")}keys(){const w=[];for(let P of this.expr)w.push(...P.keys());return w}negate(){if(!this.negated){let w=[];for(let P of this.expr)w.push(P.negate());for(;w.length>1;){const P=w.shift(),U=w.shift(),O=[];for(const z of I(P))for(const ae of I(U))O.push(h.create([z,ae],null));const G=w.length===0;w.unshift(u.create(O,null,G))}this.negated=w[0]}return this.negated}}class d extends c{constructor(w,P,U){super(w,null);this._defaultValue=P,typeof U=="object"?d._info.push(Object.assign(Object.assign({},U),{key:w})):U!==!0&&d._info.push({key:w,description:U,type:P!=null?typeof P:void 0})}static all(){return d._info.values()}bindTo(w){return w.createKey(this.key,this._defaultValue)}getValue(w){return w.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(w){return l.create(this.key,w)}}d._info=[];const f=Object(C.c)("contextKeyService"),T="setContext";function b(w,P){return w<P?-1:w>P?1:0}function S(w,P,U,O){return w<U?-1:w>U?1:P<O?-1:P>O?1:0}function D(w,P){if(P.type===6&&w.type!==9&&w.type!==6){for(const G of P.expr)if(w.equals(G))return!0}const U=w.negate(),O=I(U).concat(I(P));O.sort(e);for(let G=0;G<O.length;G++){const z=O[G],ae=z.negate();for(let ie=G+1;ie<O.length;ie++){const fe=O[ie];if(ae.equals(fe))return!0}}return!1}function I(w){return w.type===9?w.expr:[w]}},TXwP:function(Qe,le,W){var te,H;(function(){var C;(function(){"use strict";var L=[,,function(e){function A(l){this.__parent=l,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}A.prototype.clone_empty=function(){var l=new A(this.__parent);return l.set_indent(this.__indent_count,this.__alignment_count),l},A.prototype.item=function(l){return l<0?this.__items[this.__items.length+l]:this.__items[l]},A.prototype.has_match=function(l){for(var n=this.__items.length-1;n>=0;n--)if(this.__items[n].match(l))return!0;return!1},A.prototype.set_indent=function(l,n){this.is_empty()&&(this.__indent_count=l||0,this.__alignment_count=n||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},A.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)},A.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},A.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var l=this.__parent.current_line;return l.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),l.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),l.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,l.__items[0]===" "&&(l.__items.splice(0,1),l.__character_count-=1),!0}return!1},A.prototype.is_empty=function(){return this.__items.length===0},A.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},A.prototype.push=function(l){this.__items.push(l);var n=l.lastIndexOf(`
`);n!==-1?this.__character_count=l.length-n:this.__character_count+=l.length},A.prototype.pop=function(){var l=null;return this.is_empty()||(l=this.__items.pop(),this.__character_count-=l.length),l},A.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},A.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},A.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},A.prototype.toString=function(){var l="";return this.is_empty()?this.__parent.indent_empty_lines&&(l=this.__parent.get_indent_string(this.__indent_count)):(l=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),l+=this.__items.join("")),l};function g(l,n){this.__cache=[""],this.__indent_size=l.indent_size,this.__indent_string=l.indent_char,l.indent_with_tabs||(this.__indent_string=new Array(l.indent_size+1).join(l.indent_char)),n=n||"",l.indent_level>0&&(n=new Array(l.indent_level+1).join(this.__indent_string)),this.__base_string=n,this.__base_string_length=n.length}g.prototype.get_indent_size=function(l,n){var a=this.__base_string_length;return n=n||0,l<0&&(a=0),a+=l*this.__indent_size,a+=n,a},g.prototype.get_indent_string=function(l,n){var a=this.__base_string;return n=n||0,l<0&&(l=0,a=""),n+=l*this.__indent_size,this.__ensure_cache(n),a+=this.__cache[n],a},g.prototype.__ensure_cache=function(l){for(;l>=this.__cache.length;)this.__add_column()},g.prototype.__add_column=function(){var l=this.__cache.length,n=0,a="";this.__indent_size&&l>=this.__indent_size&&(n=Math.floor(l/this.__indent_size),l-=n*this.__indent_size,a=new Array(n+1).join(this.__indent_string)),l&&(a+=new Array(l+1).join(" ")),this.__cache.push(a)};function c(l,n){this.__indent_cache=new g(l,n),this.raw=!1,this._end_with_newline=l.end_with_newline,this.indent_size=l.indent_size,this.wrap_line_length=l.wrap_line_length,this.indent_empty_lines=l.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new A(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}c.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},c.prototype.get_line_number=function(){return this.__lines.length},c.prototype.get_indent_string=function(l,n){return this.__indent_cache.get_indent_string(l,n)},c.prototype.get_indent_size=function(l,n){return this.__indent_cache.get_indent_size(l,n)},c.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},c.prototype.add_new_line=function(l){return this.is_empty()||!l&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},c.prototype.get_code=function(l){this.trim(!0);var n=this.current_line.pop();n&&(n[n.length-1]===`
`&&(n=n.replace(/\n+$/g,"")),this.current_line.push(n)),this._end_with_newline&&this.__add_outputline();var a=this.__lines.join(`
`);return l!==`
`&&(a=a.replace(/[\n]/g,l)),a},c.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},c.prototype.set_indent=function(l,n){return l=l||0,n=n||0,this.next_line.set_indent(l,n),this.__lines.length>1?(this.current_line.set_indent(l,n),!0):(this.current_line.set_indent(),!1)},c.prototype.add_raw_token=function(l){for(var n=0;n<l.newlines;n++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(l.whitespace_before),this.current_line.push(l.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},c.prototype.add_token=function(l){this.__add_space_before_token(),this.current_line.push(l),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},c.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(" "))},c.prototype.remove_indent=function(l){for(var n=this.__lines.length;l<n;)this.__lines[l]._remove_indent(),l++;this.current_line._remove_wrap_indent()},c.prototype.trim=function(l){for(l=l===void 0?!1:l,this.current_line.trim();l&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},c.prototype.just_added_newline=function(){return this.current_line.is_empty()},c.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},c.prototype.ensure_empty_line_above=function(l,n){for(var a=this.__lines.length-2;a>=0;){var o=this.__lines[a];if(o.is_empty())break;if(o.item(0).indexOf(l)!==0&&o.item(-1)!==n){this.__lines.splice(a+1,0,new A(this)),this.previous_line=this.__lines[this.__lines.length-2];break}a--}},e.exports.Output=c},,,,function(e){function A(l,n){this.raw_options=g(l,n),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"])}A.prototype._get_array=function(l,n){var a=this.raw_options[l],o=n||[];return typeof a=="object"?a!==null&&typeof a.concat=="function"&&(o=a.concat()):typeof a=="string"&&(o=a.split(/[^a-zA-Z0-9_\/\-]+/)),o},A.prototype._get_boolean=function(l,n){var a=this.raw_options[l],o=a===void 0?!!n:!!a;return o},A.prototype._get_characters=function(l,n){var a=this.raw_options[l],o=n||"";return typeof a=="string"&&(o=a.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),o},A.prototype._get_number=function(l,n){var a=this.raw_options[l];n=parseInt(n,10),isNaN(n)&&(n=0);var o=parseInt(a,10);return isNaN(o)&&(o=n),o},A.prototype._get_selection=function(l,n,a){var o=this._get_selection_list(l,n,a);if(o.length!==1)throw new Error("Invalid Option Value: The option '"+l+`' can only be one of the following values:
`+n+`
You passed in: '`+this.raw_options[l]+"'");return o[0]},A.prototype._get_selection_list=function(l,n,a){if(!n||n.length===0)throw new Error("Selection list cannot be empty.");if(a=a||[n[0]],!this._is_valid_selection(a,n))throw new Error("Invalid Default Value!");var o=this._get_array(l,a);if(!this._is_valid_selection(o,n))throw new Error("Invalid Option Value: The option '"+l+`' can contain only the following values:
`+n+`
You passed in: '`+this.raw_options[l]+"'");return o},A.prototype._is_valid_selection=function(l,n){return l.length&&n.length&&!l.some(function(a){return n.indexOf(a)===-1})};function g(l,n){var a={};l=c(l);var o;for(o in l)o!==n&&(a[o]=l[o]);if(n&&l[n])for(o in l[n])a[o]=l[n][o];return a}function c(l){var n={},a;for(a in l){var o=a.replace(/-/g,"_");n[o]=l[a]}return n}e.exports.Options=A,e.exports.normalizeOpts=c,e.exports.mergeOpts=g},,function(e){var A=RegExp.prototype.hasOwnProperty("sticky");function g(c){this.__input=c||"",this.__input_length=this.__input.length,this.__position=0}g.prototype.restart=function(){this.__position=0},g.prototype.back=function(){this.__position>0&&(this.__position-=1)},g.prototype.hasNext=function(){return this.__position<this.__input_length},g.prototype.next=function(){var c=null;return this.hasNext()&&(c=this.__input.charAt(this.__position),this.__position+=1),c},g.prototype.peek=function(c){var l=null;return c=c||0,c+=this.__position,c>=0&&c<this.__input_length&&(l=this.__input.charAt(c)),l},g.prototype.__match=function(c,l){c.lastIndex=l;var n=c.exec(this.__input);return n&&!(A&&c.sticky)&&(n.index!==l&&(n=null)),n},g.prototype.test=function(c,l){return l=l||0,l+=this.__position,l>=0&&l<this.__input_length?!!this.__match(c,l):!1},g.prototype.testChar=function(c,l){var n=this.peek(l);return c.lastIndex=0,n!==null&&c.test(n)},g.prototype.match=function(c){var l=this.__match(c,this.__position);return l?this.__position+=l[0].length:l=null,l},g.prototype.read=function(c,l,n){var a="",o;return c&&(o=this.match(c),o&&(a+=o[0])),l&&(o||!c)&&(a+=this.readUntil(l,n)),a},g.prototype.readUntil=function(c,l){var n="",a=this.__position;c.lastIndex=this.__position;var o=c.exec(this.__input);return o?(a=o.index,l&&(a+=o[0].length)):a=this.__input_length,n=this.__input.substring(this.__position,a),this.__position=a,n},g.prototype.readUntilAfter=function(c){return this.readUntil(c,!0)},g.prototype.get_regexp=function(c,l){var n=null,a="g";return l&&A&&(a="y"),typeof c=="string"&&c!==""?n=new RegExp(c,a):c&&(n=new RegExp(c.source,a)),n},g.prototype.get_literal_regexp=function(c){return RegExp(c.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},g.prototype.peekUntilAfter=function(c){var l=this.__position,n=this.readUntilAfter(c);return this.__position=l,n},g.prototype.lookBack=function(c){var l=this.__position-1;return l>=c.length&&this.__input.substring(l-c.length,l).toLowerCase()===c},e.exports.InputScanner=g},,,,,function(e){function A(g,c){g=typeof g=="string"?g:g.source,c=typeof c=="string"?c:c.source,this.__directives_block_pattern=new RegExp(g+/ beautify( \w+[:]\w+)+ /.source+c,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(g+/\sbeautify\signore:end\s/.source+c,"g")}A.prototype.get_directives=function(g){if(!g.match(this.__directives_block_pattern))return null;var c={};this.__directive_pattern.lastIndex=0;for(var l=this.__directive_pattern.exec(g);l;)c[l[1]]=l[2],l=this.__directive_pattern.exec(g);return c},A.prototype.readIgnored=function(g){return g.readUntilAfter(this.__directives_end_ignore_pattern)},e.exports.Directives=A},,function(e,A,g){var c=g(16).Beautifier,l=g(17).Options;function n(a,o){var s=new c(a,o);return s.beautify()}e.exports=n,e.exports.defaultOptions=function(){return new l}},function(e,A,g){var c=g(17).Options,l=g(2).Output,n=g(8).InputScanner,a=g(13).Directives,o=new a(/\/\*/,/\*\//),s=/\r\n|[\r\n]/,r=/\r\n|[\r\n]/g,i=/\s/,t=/(?:\s|\n)+/g,y=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,p=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function m(E,_){this._source_text=E||"",this._options=new c(_),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"]}m.prototype.eatString=function(E){var _="";for(this._ch=this._input.next();this._ch;){if(_+=this._ch,this._ch==="\\")_+=this._input.next();else if(E.indexOf(this._ch)!==-1||this._ch===`
`)break;this._ch=this._input.next()}return _},m.prototype.eatWhitespace=function(E){for(var _=i.test(this._input.peek()),h=0;i.test(this._input.peek());)this._ch=this._input.next(),E&&this._ch===`
`&&((h===0||h<this._options.max_preserve_newlines)&&(h++,this._output.add_new_line(!0)));return _},m.prototype.foundNestedPseudoClass=function(){for(var E=0,_=1,h=this._input.peek(_);h;){if(h==="{")return!0;if(h==="(")E+=1;else if(h===")"){if(E===0)return!1;E-=1}else if(h===";"||h==="}")return!1;_++,h=this._input.peek(_)}return!1},m.prototype.print_string=function(E){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(E)},m.prototype.preserveSingleSpace=function(E){E&&(this._output.space_before_token=!0)},m.prototype.indent=function(){this._indentLevel++},m.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},m.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var E=this._source_text,_=this._options.eol;_==="auto"&&(_=`
`,E&&s.test(E||"")&&(_=E.match(s)[0])),E=E.replace(r,`
`);var h=E.match(/^[\t ]*/)[0];this._output=new l(this._options,h),this._input=new n(E),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var u=0,d=!1,f=!1,T=!1,b=!1,S=!1,D=!1,I=this._ch,w=!1,P,U,O;P=this._input.read(t),U=P!=="",O=I,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),I=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var G=this._input.read(y),z=o.get_directives(G);z&&z.ignore==="start"&&(G+=o.readIgnored(this._input)),this.print_string(G),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(p)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(U),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var ae=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);ae.match(/[ :]$/)&&(ae=this.eatString(": ").replace(/\s$/,""),this.print_string(ae),this._output.space_before_token=!0),ae=ae.replace(/\s$/,""),ae==="extend"?b=!0:ae==="import"&&(S=!0),ae in this.NESTED_AT_RULE?(this._nestedLevel+=1,ae in this.CONDITIONAL_GROUP_RULE&&(T=!0)):!d&&u===0&&ae.indexOf(":")!==-1&&(f=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(U),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")f&&(f=!1,this.outdent()),T?(T=!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)):(O==="("?this._output.space_before_token=!1:O!==","&&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(),O==="{"&&this._output.trim(!0),S=!1,b=!1,f&&(this.outdent(),f=!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 ie=0;ie<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;ie++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[ie])){w=!0;break}(d||T)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!b&&u===0?(this.print_string(":"),f||(f=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):(this._input.lookBack(" ")&&(this._output.space_before_token=!0),this._input.peek()===":"?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":"))}else if(this._ch==='"'||this._ch==="'"){var fe=O==='"'||O==="'";this.preserveSingleSpace(fe||U),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")w=!1,u===0?(f&&(this.outdent(),f=!1),b=!1,S=!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 ce=!1;this._input.lookBack("with")&&(ce=!0),this.preserveSingleSpace(U||ce),this.print_string(this._ch),f&&O==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),D=!0):(this.eatWhitespace(),u++,this.indent())}else if(this._ch===")")u&&(u--,this.outdent()),D&&this._input.peek()===";"&&this._options.selector_separator_newline&&(D=!1,this.outdent(),this._output.add_new_line()),this.print_string(this._ch);else if(this._ch===",")this.print_string(this._ch),this.eatWhitespace(!0),this._options.selector_separator_newline&&(!f||D)&&u===0&&!S&&!b?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!f&&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&&i.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(U),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),i.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 J=O==='"'||O==="'";this.preserveSingleSpace(J||U),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
`&&w&&this._output.add_new_line()}var Z=this._output.get_code(_);return Z},e.exports.Beautifier=m},function(e,A,g){var c=g(6).Options;function l(n){c.call(this,n,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var a=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||a;var o=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var s=0;s<o.length;s++)o[s]!=="expand"?this.brace_style="collapse":this.brace_style=o[s]}l.prototype=new c,e.exports.Options=l}],R={};function B(e){var A=R[e];if(A!==void 0)return A.exports;var g=R[e]={exports:{}};return L[e](g,g.exports,B),g.exports}var k=B(15);C=k})();var j=C;!(te=[],H=function(){return{css_beautify:j}}.apply(le,te),H!==void 0&&(Qe.exports=H))})()},"U/Y8":function(Qe,le,W){Qe.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"}},Vhoy:function(Qe,le,W){"use strict";W.d(le,"d",function(){return j}),W.d(le,"e",function(){return L}),W.d(le,"c",function(){return R}),W.d(le,"b",function(){return B}),W.d(le,"a",function(){return k});var te=W("MI8n");class H{constructor(){this._icons=new Map,this._onDidRegister=new te.b}add(e){const A=this._icons.get(e.id);A?e.description?A.description=e.description:console.error(`Duplicate registration of codicon ${e.id}`):(this._icons.set(e.id,e),this._onDidRegister.fire(e))}get(e){return this._icons.get(e)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}}const C=new H,j=C;function L(e,A){return new B(e,A)}function R(e){return e?e.replace(/\$\((.*?)\)/g,(A,g)=>` ${g} `).trim():""}class B{constructor(e,A,g){this.id=e,this.definition=A,this.description=g,C.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var k;(function(e){e.iconNameSegment="[A-Za-z0-9]+",e.iconNameExpression="[A-Za-z0-9\\-]+",e.iconModifierExpression="~[A-Za-z]+";const A=new RegExp(`^(${e.iconNameExpression})(${e.iconModifierExpression})?$`);function g(n){if(n instanceof B)return["codicon","codicon-"+n.id];const a=A.exec(n.id);if(!a)return g(B.error);let[,o,s]=a;const r=["codicon","codicon-"+o];return s&&r.push("codicon-modifier-"+s.substr(1)),r}e.asClassNameArray=g;function c(n){return g(n).join(" ")}e.asClassName=c;function l(n){return"."+g(n).join(".")}e.asCSSSelector=l})(k||(k={})),function(e){e.add=new e("add",{fontCharacter:"\\ea60"}),e.plus=new e("plus",e.add.definition),e.gistNew=new e("gist-new",e.add.definition),e.repoCreate=new e("repo-create",e.add.definition),e.lightbulb=new e("lightbulb",{fontCharacter:"\\ea61"}),e.lightBulb=new e("light-bulb",{fontCharacter:"\\ea61"}),e.repo=new e("repo",{fontCharacter:"\\ea62"}),e.repoDelete=new e("repo-delete",{fontCharacter:"\\ea62"}),e.gistFork=new e("gist-fork",{fontCharacter:"\\ea63"}),e.repoForked=new e("repo-forked",{fontCharacter:"\\ea63"}),e.gitPullRequest=new e("git-pull-request",{fontCharacter:"\\ea64"}),e.gitPullRequestAbandoned=new e("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),e.recordKeys=new e("record-keys",{fontCharacter:"\\ea65"}),e.keyboard=new e("keyboard",{fontCharacter:"\\ea65"}),e.tag=new e("tag",{fontCharacter:"\\ea66"}),e.tagAdd=new e("tag-add",{fontCharacter:"\\ea66"}),e.tagRemove=new e("tag-remove",{fontCharacter:"\\ea66"}),e.person=new e("person",{fontCharacter:"\\ea67"}),e.personFollow=new e("person-follow",{fontCharacter:"\\ea67"}),e.personOutline=new e("person-outline",{fontCharacter:"\\ea67"}),e.personFilled=new e("person-filled",{fontCharacter:"\\ea67"}),e.gitBranch=new e("git-branch",{fontCharacter:"\\ea68"}),e.gitBranchCreate=new e("git-branch-create",{fontCharacter:"\\ea68"}),e.gitBranchDelete=new e("git-branch-delete",{fontCharacter:"\\ea68"}),e.sourceControl=new e("source-control",{fontCharacter:"\\ea68"}),e.mirror=new e("mirror",{fontCharacter:"\\ea69"}),e.mirrorPublic=new e("mirror-public",{fontCharacter:"\\ea69"}),e.star=new e("star",{fontCharacter:"\\ea6a"}),e.starAdd=new e("star-add",{fontCharacter:"\\ea6a"}),e.starDelete=new e("star-delete",{fontCharacter:"\\ea6a"}),e.starEmpty=new e("star-empty",{fontCharacter:"\\ea6a"}),e.comment=new e("comment",{fontCharacter:"\\ea6b"}),e.commentAdd=new e("comment-add",{fontCharacter:"\\ea6b"}),e.alert=new e("alert",{fontCharacter:"\\ea6c"}),e.warning=new e("warning",{fontCharacter:"\\ea6c"}),e.search=new e("search",{fontCharacter:"\\ea6d"}),e.searchSave=new e("search-save",{fontCharacter:"\\ea6d"}),e.logOut=new e("log-out",{fontCharacter:"\\ea6e"}),e.signOut=new e("sign-out",{fontCharacter:"\\ea6e"}),e.logIn=new e("log-in",{fontCharacter:"\\ea6f"}),e.signIn=new e("sign-in",{fontCharacter:"\\ea6f"}),e.eye=new e("eye",{fontCharacter:"\\ea70"}),e.eyeUnwatch=new e("eye-unwatch",{fontCharacter:"\\ea70"}),e.eyeWatch=new e("eye-watch",{fontCharacter:"\\ea70"}),e.circleFilled=new e("circle-filled",{fontCharacter:"\\ea71"}),e.primitiveDot=new e("primitive-dot",{fontCharacter:"\\ea71"}),e.closeDirty=new e("close-dirty",{fontCharacter:"\\ea71"}),e.debugBreakpoint=new e("debug-breakpoint",{fontCharacter:"\\ea71"}),e.debugBreakpointDisabled=new e("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),e.debugHint=new e("debug-hint",{fontCharacter:"\\ea71"}),e.primitiveSquare=new e("primitive-square",{fontCharacter:"\\ea72"}),e.edit=new e("edit",{fontCharacter:"\\ea73"}),e.pencil=new e("pencil",{fontCharacter:"\\ea73"}),e.info=new e("info",{fontCharacter:"\\ea74"}),e.issueOpened=new e("issue-opened",{fontCharacter:"\\ea74"}),e.gistPrivate=new e("gist-private",{fontCharacter:"\\ea75"}),e.gitForkPrivate=new e("git-fork-private",{fontCharacter:"\\ea75"}),e.lock=new e("lock",{fontCharacter:"\\ea75"}),e.mirrorPrivate=new e("mirror-private",{fontCharacter:"\\ea75"}),e.close=new e("close",{fontCharacter:"\\ea76"}),e.removeClose=new e("remove-close",{fontCharacter:"\\ea76"}),e.x=new e("x",{fontCharacter:"\\ea76"}),e.repoSync=new e("repo-sync",{fontCharacter:"\\ea77"}),e.sync=new e("sync",{fontCharacter:"\\ea77"}),e.clone=new e("clone",{fontCharacter:"\\ea78"}),e.desktopDownload=new e("desktop-download",{fontCharacter:"\\ea78"}),e.beaker=new e("beaker",{fontCharacter:"\\ea79"}),e.microscope=new e("microscope",{fontCharacter:"\\ea79"}),e.vm=new e("vm",{fontCharacter:"\\ea7a"}),e.deviceDesktop=new e("device-desktop",{fontCharacter:"\\ea7a"}),e.file=new e("file",{fontCharacter:"\\ea7b"}),e.fileText=new e("file-text",{fontCharacter:"\\ea7b"}),e.more=new e("more",{fontCharacter:"\\ea7c"}),e.ellipsis=new e("ellipsis",{fontCharacter:"\\ea7c"}),e.kebabHorizontal=new e("kebab-horizontal",{fontCharacter:"\\ea7c"}),e.mailReply=new e("mail-reply",{fontCharacter:"\\ea7d"}),e.reply=new e("reply",{fontCharacter:"\\ea7d"}),e.organization=new e("organization",{fontCharacter:"\\ea7e"}),e.organizationFilled=new e("organization-filled",{fontCharacter:"\\ea7e"}),e.organizationOutline=new e("organization-outline",{fontCharacter:"\\ea7e"}),e.newFile=new e("new-file",{fontCharacter:"\\ea7f"}),e.fileAdd=new e("file-add",{fontCharacter:"\\ea7f"}),e.newFolder=new e("new-folder",{fontCharacter:"\\ea80"}),e.fileDirectoryCreate=new e("file-directory-create",{fontCharacter:"\\ea80"}),e.trash=new e("trash",{fontCharacter:"\\ea81"}),e.trashcan=new e("trashcan",{fontCharacter:"\\ea81"}),e.history=new e("history",{fontCharacter:"\\ea82"}),e.clock=new e("clock",{fontCharacter:"\\ea82"}),e.folder=new e("folder",{fontCharacter:"\\ea83"}),e.fileDirectory=new e("file-directory",{fontCharacter:"\\ea83"}),e.symbolFolder=new e("symbol-folder",{fontCharacter:"\\ea83"}),e.logoGithub=new e("logo-github",{fontCharacter:"\\ea84"}),e.markGithub=new e("mark-github",{fontCharacter:"\\ea84"}),e.github=new e("github",{fontCharacter:"\\ea84"}),e.terminal=new e("terminal",{fontCharacter:"\\ea85"}),e.console=new e("console",{fontCharacter:"\\ea85"}),e.repl=new e("repl",{fontCharacter:"\\ea85"}),e.zap=new e("zap",{fontCharacter:"\\ea86"}),e.symbolEvent=new e("symbol-event",{fontCharacter:"\\ea86"}),e.error=new e("error",{fontCharacter:"\\ea87"}),e.stop=new e("stop",{fontCharacter:"\\ea87"}),e.variable=new e("variable",{fontCharacter:"\\ea88"}),e.symbolVariable=new e("symbol-variable",{fontCharacter:"\\ea88"}),e.array=new e("array",{fontCharacter:"\\ea8a"}),e.symbolArray=new e("symbol-array",{fontCharacter:"\\ea8a"}),e.symbolModule=new e("symbol-module",{fontCharacter:"\\ea8b"}),e.symbolPackage=new e("symbol-package",{fontCharacter:"\\ea8b"}),e.symbolNamespace=new e("symbol-namespace",{fontCharacter:"\\ea8b"}),e.symbolObject=new e("symbol-object",{fontCharacter:"\\ea8b"}),e.symbolMethod=new e("symbol-method",{fontCharacter:"\\ea8c"}),e.symbolFunction=new e("symbol-function",{fontCharacter:"\\ea8c"}),e.symbolConstructor=new e("symbol-constructor",{fontCharacter:"\\ea8c"}),e.symbolBoolean=new e("symbol-boolean",{fontCharacter:"\\ea8f"}),e.symbolNull=new e("symbol-null",{fontCharacter:"\\ea8f"}),e.symbolNumeric=new e("symbol-numeric",{fontCharacter:"\\ea90"}),e.symbolNumber=new e("symbol-number",{fontCharacter:"\\ea90"}),e.symbolStructure=new e("symbol-structure",{fontCharacter:"\\ea91"}),e.symbolStruct=new e("symbol-struct",{fontCharacter:"\\ea91"}),e.symbolParameter=new e("symbol-parameter",{fontCharacter:"\\ea92"}),e.symbolTypeParameter=new e("symbol-type-parameter",{fontCharacter:"\\ea92"}),e.symbolKey=new e("symbol-key",{fontCharacter:"\\ea93"}),e.symbolText=new e("symbol-text",{fontCharacter:"\\ea93"}),e.symbolReference=new e("symbol-reference",{fontCharacter:"\\ea94"}),e.goToFile=new e("go-to-file",{fontCharacter:"\\ea94"}),e.symbolEnum=new e("symbol-enum",{fontCharacter:"\\ea95"}),e.symbolValue=new e("symbol-value",{fontCharacter:"\\ea95"}),e.symbolRuler=new e("symbol-ruler",{fontCharacter:"\\ea96"}),e.symbolUnit=new e("symbol-unit",{fontCharacter:"\\ea96"}),e.activateBreakpoints=new e("activate-breakpoints",{fontCharacter:"\\ea97"}),e.archive=new e("archive",{fontCharacter:"\\ea98"}),e.arrowBoth=new e("arrow-both",{fontCharacter:"\\ea99"}),e.arrowDown=new e("arrow-down",{fontCharacter:"\\ea9a"}),e.arrowLeft=new e("arrow-left",{fontCharacter:"\\ea9b"}),e.arrowRight=new e("arrow-right",{fontCharacter:"\\ea9c"}),e.arrowSmallDown=new e("arrow-small-down",{fontCharacter:"\\ea9d"}),e.arrowSmallLeft=new e("arrow-small-left",{fontCharacter:"\\ea9e"}),e.arrowSmallRight=new e("arrow-small-right",{fontCharacter:"\\ea9f"}),e.arrowSmallUp=new e("arrow-small-up",{fontCharacter:"\\eaa0"}),e.arrowUp=new e("arrow-up",{fontCharacter:"\\eaa1"}),e.bell=new e("bell",{fontCharacter:"\\eaa2"}),e.bold=new e("bold",{fontCharacter:"\\eaa3"}),e.book=new e("book",{fontCharacter:"\\eaa4"}),e.bookmark=new e("bookmark",{fontCharacter:"\\eaa5"}),e.debugBreakpointConditionalUnverified=new e("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),e.debugBreakpointConditional=new e("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),e.debugBreakpointConditionalDisabled=new e("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),e.debugBreakpointDataUnverified=new e("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),e.debugBreakpointData=new e("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),e.debugBreakpointDataDisabled=new e("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),e.debugBreakpointLogUnverified=new e("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),e.debugBreakpointLog=new e("debug-breakpoint-log",{fontCharacter:"\\eaab"}),e.debugBreakpointLogDisabled=new e("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),e.briefcase=new e("briefcase",{fontCharacter:"\\eaac"}),e.broadcast=new e("broadcast",{fontCharacter:"\\eaad"}),e.browser=new e("browser",{fontCharacter:"\\eaae"}),e.bug=new e("bug",{fontCharacter:"\\eaaf"}),e.calendar=new e("calendar",{fontCharacter:"\\eab0"}),e.caseSensitive=new e("case-sensitive",{fontCharacter:"\\eab1"}),e.check=new e("check",{fontCharacter:"\\eab2"}),e.checklist=new e("checklist",{fontCharacter:"\\eab3"}),e.chevronDown=new e("chevron-down",{fontCharacter:"\\eab4"}),e.dropDownButton=new e("drop-down-button",e.chevronDown.definition),e.chevronLeft=new e("chevron-left",{fontCharacter:"\\eab5"}),e.chevronRight=new e("chevron-right",{fontCharacter:"\\eab6"}),e.chevronUp=new e("chevron-up",{fontCharacter:"\\eab7"}),e.chromeClose=new e("chrome-close",{fontCharacter:"\\eab8"}),e.chromeMaximize=new e("chrome-maximize",{fontCharacter:"\\eab9"}),e.chromeMinimize=new e("chrome-minimize",{fontCharacter:"\\eaba"}),e.chromeRestore=new e("chrome-restore",{fontCharacter:"\\eabb"}),e.circleOutline=new e("circle-outline",{fontCharacter:"\\eabc"}),e.debugBreakpointUnverified=new e("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),e.circleSlash=new e("circle-slash",{fontCharacter:"\\eabd"}),e.circuitBoard=new e("circuit-board",{fontCharacter:"\\eabe"}),e.clearAll=new e("clear-all",{fontCharacter:"\\eabf"}),e.clippy=new e("clippy",{fontCharacter:"\\eac0"}),e.closeAll=new e("close-all",{fontCharacter:"\\eac1"}),e.cloudDownload=new e("cloud-download",{fontCharacter:"\\eac2"}),e.cloudUpload=new e("cloud-upload",{fontCharacter:"\\eac3"}),e.code=new e("code",{fontCharacter:"\\eac4"}),e.collapseAll=new e("collapse-all",{fontCharacter:"\\eac5"}),e.colorMode=new e("color-mode",{fontCharacter:"\\eac6"}),e.commentDiscussion=new e("comment-discussion",{fontCharacter:"\\eac7"}),e.compareChanges=new e("compare-changes",{fontCharacter:"\\eafd"}),e.creditCard=new e("credit-card",{fontCharacter:"\\eac9"}),e.dash=new e("dash",{fontCharacter:"\\eacc"}),e.dashboard=new e("dashboard",{fontCharacter:"\\eacd"}),e.database=new e("database",{fontCharacter:"\\eace"}),e.debugContinue=new e("debug-continue",{fontCharacter:"\\eacf"}),e.debugDisconnect=new e("debug-disconnect",{fontCharacter:"\\ead0"}),e.debugPause=new e("debug-pause",{fontCharacter:"\\ead1"}),e.debugRestart=new e("debug-restart",{fontCharacter:"\\ead2"}),e.debugStart=new e("debug-start",{fontCharacter:"\\ead3"}),e.debugStepInto=new e("debug-step-into",{fontCharacter:"\\ead4"}),e.debugStepOut=new e("debug-step-out",{fontCharacter:"\\ead5"}),e.debugStepOver=new e("debug-step-over",{fontCharacter:"\\ead6"}),e.debugStop=new e("debug-stop",{fontCharacter:"\\ead7"}),e.debug=new e("debug",{fontCharacter:"\\ead8"}),e.deviceCameraVideo=new e("device-camera-video",{fontCharacter:"\\ead9"}),e.deviceCamera=new e("device-camera",{fontCharacter:"\\eada"}),e.deviceMobile=new e("device-mobile",{fontCharacter:"\\eadb"}),e.diffAdded=new e("diff-added",{fontCharacter:"\\eadc"}),e.diffIgnored=new e("diff-ignored",{fontCharacter:"\\eadd"}),e.diffModified=new e("diff-modified",{fontCharacter:"\\eade"}),e.diffRemoved=new e("diff-removed",{fontCharacter:"\\eadf"}),e.diffRenamed=new e("diff-renamed",{fontCharacter:"\\eae0"}),e.diff=new e("diff",{fontCharacter:"\\eae1"}),e.discard=new e("discard",{fontCharacter:"\\eae2"}),e.editorLayout=new e("editor-layout",{fontCharacter:"\\eae3"}),e.emptyWindow=new e("empty-window",{fontCharacter:"\\eae4"}),e.exclude=new e("exclude",{fontCharacter:"\\eae5"}),e.extensions=new e("extensions",{fontCharacter:"\\eae6"}),e.eyeClosed=new e("eye-closed",{fontCharacter:"\\eae7"}),e.fileBinary=new e("file-binary",{fontCharacter:"\\eae8"}),e.fileCode=new e("file-code",{fontCharacter:"\\eae9"}),e.fileMedia=new e("file-media",{fontCharacter:"\\eaea"}),e.filePdf=new e("file-pdf",{fontCharacter:"\\eaeb"}),e.fileSubmodule=new e("file-submodule",{fontCharacter:"\\eaec"}),e.fileSymlinkDirectory=new e("file-symlink-directory",{fontCharacter:"\\eaed"}),e.fileSymlinkFile=new e("file-symlink-file",{fontCharacter:"\\eaee"}),e.fileZip=new e("file-zip",{fontCharacter:"\\eaef"}),e.files=new e("files",{fontCharacter:"\\eaf0"}),e.filter=new e("filter",{fontCharacter:"\\eaf1"}),e.flame=new e("flame",{fontCharacter:"\\eaf2"}),e.foldDown=new e("fold-down",{fontCharacter:"\\eaf3"}),e.foldUp=new e("fold-up",{fontCharacter:"\\eaf4"}),e.fold=new e("fold",{fontCharacter:"\\eaf5"}),e.folderActive=new e("folder-active",{fontCharacter:"\\eaf6"}),e.folderOpened=new e("folder-opened",{fontCharacter:"\\eaf7"}),e.gear=new e("gear",{fontCharacter:"\\eaf8"}),e.gift=new e("gift",{fontCharacter:"\\eaf9"}),e.gistSecret=new e("gist-secret",{fontCharacter:"\\eafa"}),e.gist=new e("gist",{fontCharacter:"\\eafb"}),e.gitCommit=new e("git-commit",{fontCharacter:"\\eafc"}),e.gitCompare=new e("git-compare",{fontCharacter:"\\eafd"}),e.gitMerge=new e("git-merge",{fontCharacter:"\\eafe"}),e.githubAction=new e("github-action",{fontCharacter:"\\eaff"}),e.githubAlt=new e("github-alt",{fontCharacter:"\\eb00"}),e.globe=new e("globe",{fontCharacter:"\\eb01"}),e.grabber=new e("grabber",{fontCharacter:"\\eb02"}),e.graph=new e("graph",{fontCharacter:"\\eb03"}),e.gripper=new e("gripper",{fontCharacter:"\\eb04"}),e.heart=new e("heart",{fontCharacter:"\\eb05"}),e.home=new e("home",{fontCharacter:"\\eb06"}),e.horizontalRule=new e("horizontal-rule",{fontCharacter:"\\eb07"}),e.hubot=new e("hubot",{fontCharacter:"\\eb08"}),e.inbox=new e("inbox",{fontCharacter:"\\eb09"}),e.issueClosed=new e("issue-closed",{fontCharacter:"\\eba4"}),e.issueReopened=new e("issue-reopened",{fontCharacter:"\\eb0b"}),e.issues=new e("issues",{fontCharacter:"\\eb0c"}),e.italic=new e("italic",{fontCharacter:"\\eb0d"}),e.jersey=new e("jersey",{fontCharacter:"\\eb0e"}),e.json=new e("json",{fontCharacter:"\\eb0f"}),e.kebabVertical=new e("kebab-vertical",{fontCharacter:"\\eb10"}),e.key=new e("key",{fontCharacter:"\\eb11"}),e.law=new e("law",{fontCharacter:"\\eb12"}),e.lightbulbAutofix=new e("lightbulb-autofix",{fontCharacter:"\\eb13"}),e.linkExternal=new e("link-external",{fontCharacter:"\\eb14"}),e.link=new e("link",{fontCharacter:"\\eb15"}),e.listOrdered=new e("list-ordered",{fontCharacter:"\\eb16"}),e.listUnordered=new e("list-unordered",{fontCharacter:"\\eb17"}),e.liveShare=new e("live-share",{fontCharacter:"\\eb18"}),e.loading=new e("loading",{fontCharacter:"\\eb19"}),e.location=new e("location",{fontCharacter:"\\eb1a"}),e.mailRead=new e("mail-read",{fontCharacter:"\\eb1b"}),e.mail=new e("mail",{fontCharacter:"\\eb1c"}),e.markdown=new e("markdown",{fontCharacter:"\\eb1d"}),e.megaphone=new e("megaphone",{fontCharacter:"\\eb1e"}),e.mention=new e("mention",{fontCharacter:"\\eb1f"}),e.milestone=new e("milestone",{fontCharacter:"\\eb20"}),e.mortarBoard=new e("mortar-board",{fontCharacter:"\\eb21"}),e.move=new e("move",{fontCharacter:"\\eb22"}),e.multipleWindows=new e("multiple-windows",{fontCharacter:"\\eb23"}),e.mute=new e("mute",{fontCharacter:"\\eb24"}),e.noNewline=new e("no-newline",{fontCharacter:"\\eb25"}),e.note=new e("note",{fontCharacter:"\\eb26"}),e.octoface=new e("octoface",{fontCharacter:"\\eb27"}),e.openPreview=new e("open-preview",{fontCharacter:"\\eb28"}),e.package_=new e("package",{fontCharacter:"\\eb29"}),e.paintcan=new e("paintcan",{fontCharacter:"\\eb2a"}),e.pin=new e("pin",{fontCharacter:"\\eb2b"}),e.play=new e("play",{fontCharacter:"\\eb2c"}),e.run=new e("run",{fontCharacter:"\\eb2c"}),e.plug=new e("plug",{fontCharacter:"\\eb2d"}),e.preserveCase=new e("preserve-case",{fontCharacter:"\\eb2e"}),e.preview=new e("preview",{fontCharacter:"\\eb2f"}),e.project=new e("project",{fontCharacter:"\\eb30"}),e.pulse=new e("pulse",{fontCharacter:"\\eb31"}),e.question=new e("question",{fontCharacter:"\\eb32"}),e.quote=new e("quote",{fontCharacter:"\\eb33"}),e.radioTower=new e("radio-tower",{fontCharacter:"\\eb34"}),e.reactions=new e("reactions",{fontCharacter:"\\eb35"}),e.references=new e("references",{fontCharacter:"\\eb36"}),e.refresh=new e("refresh",{fontCharacter:"\\eb37"}),e.regex=new e("regex",{fontCharacter:"\\eb38"}),e.remoteExplorer=new e("remote-explorer",{fontCharacter:"\\eb39"}),e.remote=new e("remote",{fontCharacter:"\\eb3a"}),e.remove=new e("remove",{fontCharacter:"\\eb3b"}),e.replaceAll=new e("replace-all",{fontCharacter:"\\eb3c"}),e.replace=new e("replace",{fontCharacter:"\\eb3d"}),e.repoClone=new e("repo-clone",{fontCharacter:"\\eb3e"}),e.repoForcePush=new e("repo-force-push",{fontCharacter:"\\eb3f"}),e.repoPull=new e("repo-pull",{fontCharacter:"\\eb40"}),e.repoPush=new e("repo-push",{fontCharacter:"\\eb41"}),e.report=new e("report",{fontCharacter:"\\eb42"}),e.requestChanges=new e("request-changes",{fontCharacter:"\\eb43"}),e.rocket=new e("rocket",{fontCharacter:"\\eb44"}),e.rootFolderOpened=new e("root-folder-opened",{fontCharacter:"\\eb45"}),e.rootFolder=new e("root-folder",{fontCharacter:"\\eb46"}),e.rss=new e("rss",{fontCharacter:"\\eb47"}),e.ruby=new e("ruby",{fontCharacter:"\\eb48"}),e.saveAll=new e("save-all",{fontCharacter:"\\eb49"}),e.saveAs=new e("save-as",{fontCharacter:"\\eb4a"}),e.save=new e("save",{fontCharacter:"\\eb4b"}),e.screenFull=new e("screen-full",{fontCharacter:"\\eb4c"}),e.screenNormal=new e("screen-normal",{fontCharacter:"\\eb4d"}),e.searchStop=new e("search-stop",{fontCharacter:"\\eb4e"}),e.server=new e("server",{fontCharacter:"\\eb50"}),e.settingsGear=new e("settings-gear",{fontCharacter:"\\eb51"}),e.settings=new e("settings",{fontCharacter:"\\eb52"}),e.shield=new e("shield",{fontCharacter:"\\eb53"}),e.smiley=new e("smiley",{fontCharacter:"\\eb54"}),e.sortPrecedence=new e("sort-precedence",{fontCharacter:"\\eb55"}),e.splitHorizontal=new e("split-horizontal",{fontCharacter:"\\eb56"}),e.splitVertical=new e("split-vertical",{fontCharacter:"\\eb57"}),e.squirrel=new e("squirrel",{fontCharacter:"\\eb58"}),e.starFull=new e("star-full",{fontCharacter:"\\eb59"}),e.starHalf=new e("star-half",{fontCharacter:"\\eb5a"}),e.symbolClass=new e("symbol-class",{fontCharacter:"\\eb5b"}),e.symbolColor=new e("symbol-color",{fontCharacter:"\\eb5c"}),e.symbolConstant=new e("symbol-constant",{fontCharacter:"\\eb5d"}),e.symbolEnumMember=new e("symbol-enum-member",{fontCharacter:"\\eb5e"}),e.symbolField=new e("symbol-field",{fontCharacter:"\\eb5f"}),e.symbolFile=new e("symbol-file",{fontCharacter:"\\eb60"}),e.symbolInterface=new e("symbol-interface",{fontCharacter:"\\eb61"}),e.symbolKeyword=new e("symbol-keyword",{fontCharacter:"\\eb62"}),e.symbolMisc=new e("symbol-misc",{fontCharacter:"\\eb63"}),e.symbolOperator=new e("symbol-operator",{fontCharacter:"\\eb64"}),e.symbolProperty=new e("symbol-property",{fontCharacter:"\\eb65"}),e.wrench=new e("wrench",{fontCharacter:"\\eb65"}),e.wrenchSubaction=new e("wrench-subaction",{fontCharacter:"\\eb65"}),e.symbolSnippet=new e("symbol-snippet",{fontCharacter:"\\eb66"}),e.tasklist=new e("tasklist",{fontCharacter:"\\eb67"}),e.telescope=new e("telescope",{fontCharacter:"\\eb68"}),e.textSize=new e("text-size",{fontCharacter:"\\eb69"}),e.threeBars=new e("three-bars",{fontCharacter:"\\eb6a"}),e.thumbsdown=new e("thumbsdown",{fontCharacter:"\\eb6b"}),e.thumbsup=new e("thumbsup",{fontCharacter:"\\eb6c"}),e.tools=new e("tools",{fontCharacter:"\\eb6d"}),e.triangleDown=new e("triangle-down",{fontCharacter:"\\eb6e"}),e.triangleLeft=new e("triangle-left",{fontCharacter:"\\eb6f"}),e.triangleRight=new e("triangle-right",{fontCharacter:"\\eb70"}),e.triangleUp=new e("triangle-up",{fontCharacter:"\\eb71"}),e.twitter=new e("twitter",{fontCharacter:"\\eb72"}),e.unfold=new e("unfold",{fontCharacter:"\\eb73"}),e.unlock=new e("unlock",{fontCharacter:"\\eb74"}),e.unmute=new e("unmute",{fontCharacter:"\\eb75"}),e.unverified=new e("unverified",{fontCharacter:"\\eb76"}),e.verified=new e("verified",{fontCharacter:"\\eb77"}),e.versions=new e("versions",{fontCharacter:"\\eb78"}),e.vmActive=new e("vm-active",{fontCharacter:"\\eb79"}),e.vmOutline=new e("vm-outline",{fontCharacter:"\\eb7a"}),e.vmRunning=new e("vm-running",{fontCharacter:"\\eb7b"}),e.watch=new e("watch",{fontCharacter:"\\eb7c"}),e.whitespace=new e("whitespace",{fontCharacter:"\\eb7d"}),e.wholeWord=new e("whole-word",{fontCharacter:"\\eb7e"}),e.window=new e("window",{fontCharacter:"\\eb7f"}),e.wordWrap=new e("word-wrap",{fontCharacter:"\\eb80"}),e.zoomIn=new e("zoom-in",{fontCharacter:"\\eb81"}),e.zoomOut=new e("zoom-out",{fontCharacter:"\\eb82"}),e.listFilter=new e("list-filter",{fontCharacter:"\\eb83"}),e.listFlat=new e("list-flat",{fontCharacter:"\\eb84"}),e.listSelection=new e("list-selection",{fontCharacter:"\\eb85"}),e.selection=new e("selection",{fontCharacter:"\\eb85"}),e.listTree=new e("list-tree",{fontCharacter:"\\eb86"}),e.debugBreakpointFunctionUnverified=new e("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),e.debugBreakpointFunction=new e("debug-breakpoint-function",{fontCharacter:"\\eb88"}),e.debugBreakpointFunctionDisabled=new e("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),e.debugStackframeActive=new e("debug-stackframe-active",{fontCharacter:"\\eb89"}),e.debugStackframeDot=new e("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),e.debugStackframe=new e("debug-stackframe",{fontCharacter:"\\eb8b"}),e.debugStackframeFocused=new e("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),e.debugBreakpointUnsupported=new e("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),e.symbolString=new e("symbol-string",{fontCharacter:"\\eb8d"}),e.debugReverseContinue=new e("debug-reverse-continue",{fontCharacter:"\\eb8e"}),e.debugStepBack=new e("debug-step-back",{fontCharacter:"\\eb8f"}),e.debugRestartFrame=new e("debug-restart-frame",{fontCharacter:"\\eb90"}),e.callIncoming=new e("call-incoming",{fontCharacter:"\\eb92"}),e.callOutgoing=new e("call-outgoing",{fontCharacter:"\\eb93"}),e.menu=new e("menu",{fontCharacter:"\\eb94"}),e.expandAll=new e("expand-all",{fontCharacter:"\\eb95"}),e.feedback=new e("feedback",{fontCharacter:"\\eb96"}),e.groupByRefType=new e("group-by-ref-type",{fontCharacter:"\\eb97"}),e.ungroupByRefType=new e("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),e.account=new e("account",{fontCharacter:"\\eb99"}),e.bellDot=new e("bell-dot",{fontCharacter:"\\eb9a"}),e.debugConsole=new e("debug-console",{fontCharacter:"\\eb9b"}),e.library=new e("library",{fontCharacter:"\\eb9c"}),e.output=new e("output",{fontCharacter:"\\eb9d"}),e.runAll=new e("run-all",{fontCharacter:"\\eb9e"}),e.syncIgnored=new e("sync-ignored",{fontCharacter:"\\eb9f"}),e.pinned=new e("pinned",{fontCharacter:"\\eba0"}),e.githubInverted=new e("github-inverted",{fontCharacter:"\\eba1"}),e.debugAlt=new e("debug-alt",{fontCharacter:"\\eb91"}),e.serverProcess=new e("server-process",{fontCharacter:"\\eba2"}),e.serverEnvironment=new e("server-environment",{fontCharacter:"\\eba3"}),e.pass=new e("pass",{fontCharacter:"\\eba4"}),e.stopCircle=new e("stop-circle",{fontCharacter:"\\eba5"}),e.playCircle=new e("play-circle",{fontCharacter:"\\eba6"}),e.record=new e("record",{fontCharacter:"\\eba7"}),e.debugAltSmall=new e("debug-alt-small",{fontCharacter:"\\eba8"}),e.vmConnect=new e("vm-connect",{fontCharacter:"\\eba9"}),e.cloud=new e("cloud",{fontCharacter:"\\ebaa"}),e.merge=new e("merge",{fontCharacter:"\\ebab"}),e.exportIcon=new e("export",{fontCharacter:"\\ebac"}),e.graphLeft=new e("graph-left",{fontCharacter:"\\ebad"}),e.magnet=new e("magnet",{fontCharacter:"\\ebae"}),e.notebook=new e("notebook",{fontCharacter:"\\ebaf"}),e.redo=new e("redo",{fontCharacter:"\\ebb0"}),e.checkAll=new e("check-all",{fontCharacter:"\\ebb1"}),e.pinnedDirty=new e("pinned-dirty",{fontCharacter:"\\ebb2"}),e.passFilled=new e("pass-filled",{fontCharacter:"\\ebb3"}),e.circleLargeFilled=new e("circle-large-filled",{fontCharacter:"\\ebb4"}),e.circleLargeOutline=new e("circle-large-outline",{fontCharacter:"\\ebb5"}),e.combine=new e("combine",{fontCharacter:"\\ebb6"}),e.gather=new e("gather",{fontCharacter:"\\ebb6"}),e.table=new e("table",{fontCharacter:"\\ebb7"}),e.variableGroup=new e("variable-group",{fontCharacter:"\\ebb8"}),e.typeHierarchy=new e("type-hierarchy",{fontCharacter:"\\ebb9"}),e.typeHierarchySub=new e("type-hierarchy-sub",{fontCharacter:"\\ebba"}),e.typeHierarchySuper=new e("type-hierarchy-super",{fontCharacter:"\\ebbb"}),e.gitPullRequestCreate=new e("git-pull-request-create",{fontCharacter:"\\ebbc"}),e.runAbove=new e("run-above",{fontCharacter:"\\ebbd"}),e.runBelow=new e("run-below",{fontCharacter:"\\ebbe"}),e.notebookTemplate=new e("notebook-template",{fontCharacter:"\\ebbf"}),e.debugRerun=new e("debug-rerun",{fontCharacter:"\\ebc0"}),e.workspaceTrusted=new e("workspace-trusted",{fontCharacter:"\\ebc1"}),e.workspaceUntrusted=new e("workspace-untrusted",{fontCharacter:"\\ebc2"}),e.workspaceUnspecified=new e("workspace-unspecified",{fontCharacter:"\\ebc3"}),e.terminalCmd=new e("terminal-cmd",{fontCharacter:"\\ebc4"}),e.terminalDebian=new e("terminal-debian",{fontCharacter:"\\ebc5"}),e.terminalLinux=new e("terminal-linux",{fontCharacter:"\\ebc6"}),e.terminalPowershell=new e("terminal-powershell",{fontCharacter:"\\ebc7"}),e.terminalTmux=new e("terminal-tmux",{fontCharacter:"\\ebc8"}),e.terminalUbuntu=new e("terminal-ubuntu",{fontCharacter:"\\ebc9"}),e.terminalBash=new e("terminal-bash",{fontCharacter:"\\ebca"}),e.arrowSwap=new e("arrow-swap",{fontCharacter:"\\ebcb"}),e.copy=new e("copy",{fontCharacter:"\\ebcc"}),e.personAdd=new e("person-add",{fontCharacter:"\\ebcd"}),e.filterFilled=new e("filter-filled",{fontCharacter:"\\ebce"}),e.wand=new e("wand",{fontCharacter:"\\ebcf"}),e.debugLineByLine=new e("debug-line-by-line",{fontCharacter:"\\ebd0"}),e.inspect=new e("inspect",{fontCharacter:"\\ebd1"}),e.layers=new e("layers",{fontCharacter:"\\ebd2"}),e.layersDot=new e("layers-dot",{fontCharacter:"\\ebd3"}),e.layersActive=new e("layers-active",{fontCharacter:"\\ebd4"}),e.compass=new e("compass",{fontCharacter:"\\ebd5"}),e.compassDot=new e("compass-dot",{fontCharacter:"\\ebd6"}),e.compassActive=new e("compass-active",{fontCharacter:"\\ebd7"}),e.azure=new e("azure",{fontCharacter:"\\ebd8"}),e.issueDraft=new e("issue-draft",{fontCharacter:"\\ebd9"}),e.gitPullRequestClosed=new e("git-pull-request-closed",{fontCharacter:"\\ebda"}),e.gitPullRequestDraft=new e("git-pull-request-draft",{fontCharacter:"\\ebdb"}),e.debugAll=new e("debug-all",{fontCharacter:"\\ebdc"}),e.debugCoverage=new e("debug-coverage",{fontCharacter:"\\ebdd"}),e.runErrors=new e("run-errors",{fontCharacter:"\\ebde"}),e.folderLibrary=new e("folder-library",{fontCharacter:"\\ebdf"}),e.debugContinueSmall=new e("debug-continue-small",{fontCharacter:"\\ebe0"}),e.beakerStop=new e("beaker-stop",{fontCharacter:"\\ebe1"}),e.graphLine=new e("graph-line",{fontCharacter:"\\ebe2"}),e.graphScatter=new e("graph-scatter",{fontCharacter:"\\ebe3"}),e.pieChart=new e("pie-chart",{fontCharacter:"\\ebe4"}),e.bracket=new e("bracket",e.json.definition),e.bracketDot=new e("bracket-dot",{fontCharacter:"\\ebe5"}),e.bracketError=new e("bracket-error",{fontCharacter:"\\ebe6"}),e.lockSmall=new e("lock-small",{fontCharacter:"\\ebe7"}),e.azureDevops=new e("azure-devops",{fontCharacter:"\\ebe8"}),e.verifiedFilled=new e("verified-filled",{fontCharacter:"\\ebe9"})}(B||(B={}))},WaYH:function(Qe,le,W){"use strict";var te=W("rePB"),H=W("Ff2n"),C=W("VTBJ"),j=W("1OyB"),L=W("vuIU"),R=W("JX7q"),B=W("Ji7U"),k=W("LK+K"),e=W("q1tI"),A=W("TSYQ"),g=W.n(A),c=W("sboe"),l=W("OZM5"),n=function(E){var _=E.prefixCls,h=E.level,u=E.isStart,d=E.isEnd;if(!h)return null;for(var f="".concat(_,"-indent-unit"),T=[],b=0;b<h;b+=1){var S;T.push(e.createElement("span",{key:b,className:g()(f,(S={},Object(te.a)(S,"".concat(f,"-start"),u[b+1]),Object(te.a)(S,"".concat(f,"-end"),d[b+1]),Object(te.a)(S,"".concat(f,"-end-first-level"),!b&&d[0]),S))}))}return e.createElement("span",{"aria-hidden":"true",className:"".concat(_,"-indent")},T)},a=n,o=W("815F"),s="open",r="close",i="---",t=function(m){Object(B.a)(_,m);var E=Object(k.a)(_);function _(){var h;return Object(j.a)(this,_),h=E.apply(this,arguments),h.state={dragNodeHighlight:!1},h.onSelectorClick=function(u){var d=h.props.context.onNodeClick;d(u,Object(o.b)(h.props)),h.isSelectable()?h.onSelect(u):h.onCheck(u)},h.onSelectorDoubleClick=function(u){var d=h.props.context.onNodeDoubleClick;d(u,Object(o.b)(h.props))},h.onSelect=function(u){if(h.isDisabled())return;var d=h.props.context.onNodeSelect;u.preventDefault(),d(u,Object(o.b)(h.props))},h.onCheck=function(u){if(h.isDisabled())return;var d=h.props,f=d.disableCheckbox,T=d.checked,b=h.props.context.onNodeCheck;if(!h.isCheckable()||f)return;u.preventDefault();var S=!T;b(u,Object(o.b)(h.props),S)},h.onMouseEnter=function(u){var d=h.props.context.onNodeMouseEnter;d(u,Object(o.b)(h.props))},h.onMouseLeave=function(u){var d=h.props.context.onNodeMouseLeave;d(u,Object(o.b)(h.props))},h.onContextMenu=function(u){var d=h.props.context.onNodeContextMenu;d(u,Object(o.b)(h.props))},h.onDragStart=function(u){var d=h.props.context.onNodeDragStart;u.stopPropagation(),h.setState({dragNodeHighlight:!0}),d(u,Object(R.a)(h));try{u.dataTransfer.setData("text/plain","")}catch(f){}},h.onDragEnter=function(u){var d=h.props.context.onNodeDragEnter;u.preventDefault(),u.stopPropagation(),d(u,Object(R.a)(h))},h.onDragOver=function(u){var d=h.props.context.onNodeDragOver;u.preventDefault(),u.stopPropagation(),d(u,Object(R.a)(h))},h.onDragLeave=function(u){var d=h.props.context.onNodeDragLeave;u.stopPropagation(),d(u,Object(R.a)(h))},h.onDragEnd=function(u){var d=h.props.context.onNodeDragEnd;u.stopPropagation(),h.setState({dragNodeHighlight:!1}),d(u,Object(R.a)(h))},h.onDrop=function(u){var d=h.props.context.onNodeDrop;u.preventDefault(),u.stopPropagation(),h.setState({dragNodeHighlight:!1}),d(u,Object(R.a)(h))},h.onExpand=function(u){var d=h.props.context.onNodeExpand;d(u,Object(o.b)(h.props))},h.setSelectHandle=function(u){h.selectHandle=u},h.getNodeState=function(){var u=h.props.expanded;return h.isLeaf()?null:u?s:r},h.hasChildren=function(){var u=h.props.eventKey,d=h.props.context.keyEntities,f=d[u]||{},T=f.children;return!!(T||[]).length},h.isLeaf=function(){var u=h.props,d=u.isLeaf,f=u.loaded,T=h.props.context.loadData,b=h.hasChildren();return d===!1?!1:d||!T&&!b||T&&f&&!b},h.isDisabled=function(){var u=h.props.disabled,d=h.props.context.disabled;return!!(d||u)},h.isCheckable=function(){var u=h.props.checkable,d=h.props.context.checkable;return!d||u===!1?!1:d},h.syncLoadData=function(u){var d=u.expanded,f=u.loading,T=u.loaded,b=h.props.context,S=b.loadData,D=b.onNodeLoad;if(f)return;S&&d&&!h.isLeaf()&&(!h.hasChildren()&&!T&&D(Object(o.b)(h.props)))},h.renderSwitcher=function(){var u=h.props,d=u.expanded,f=u.switcherIcon,T=h.props.context,b=T.prefixCls,S=T.switcherIcon,D=f||S;if(h.isLeaf())return e.createElement("span",{className:g()("".concat(b,"-switcher"),"".concat(b,"-switcher-noop"))},typeof D=="function"?D(Object(C.a)(Object(C.a)({},h.props),{},{isLeaf:!0})):D);var I=g()("".concat(b,"-switcher"),"".concat(b,"-switcher_").concat(d?s:r));return e.createElement("span",{onClick:h.onExpand,className:I},typeof D=="function"?D(Object(C.a)(Object(C.a)({},h.props),{},{isLeaf:!1})):D)},h.renderCheckbox=function(){var u=h.props,d=u.checked,f=u.halfChecked,T=u.disableCheckbox,b=h.props.context.prefixCls,S=h.isDisabled(),D=h.isCheckable();if(!D)return null;var I=typeof D!="boolean"?D:null;return e.createElement("span",{className:g()("".concat(b,"-checkbox"),d&&"".concat(b,"-checkbox-checked"),!d&&f&&"".concat(b,"-checkbox-indeterminate"),(S||T)&&"".concat(b,"-checkbox-disabled")),onClick:h.onCheck},I)},h.renderIcon=function(){var u=h.props.loading,d=h.props.context.prefixCls;return e.createElement("span",{className:g()("".concat(d,"-iconEle"),"".concat(d,"-icon__").concat(h.getNodeState()||"docu"),u&&"".concat(d,"-icon_loading"))})},h.renderSelector=function(){var u=h.state.dragNodeHighlight,d=h.props,f=d.title,T=d.selected,b=d.icon,S=d.loading,D=d.data,I=h.props.context,w=I.prefixCls,P=I.showIcon,U=I.icon,O=I.draggable,G=I.loadData,z=I.titleRender,ae=h.isDisabled(),ie="".concat(w,"-node-content-wrapper"),fe;if(P){var ce=b||U;fe=ce?e.createElement("span",{className:g()("".concat(w,"-iconEle"),"".concat(w,"-icon__customize"))},typeof ce=="function"?ce(h.props):ce):h.renderIcon()}else G&&S&&(fe=h.renderIcon());var J;typeof f=="function"?J=f(D):z?J=z(D):J=f;var Z=e.createElement("span",{className:"".concat(w,"-title")},J);return e.createElement("span",{ref:h.setSelectHandle,title:typeof f=="string"?f:"",className:g()("".concat(ie),"".concat(ie,"-").concat(h.getNodeState()||"normal"),!ae&&(T||u)&&"".concat(w,"-node-selected"),!ae&&O&&"draggable"),draggable:!ae&&O||void 0,"aria-grabbed":!ae&&O||void 0,onMouseEnter:h.onMouseEnter,onMouseLeave:h.onMouseLeave,onContextMenu:h.onContextMenu,onClick:h.onSelectorClick,onDoubleClick:h.onSelectorDoubleClick,onDragStart:O?h.onDragStart:void 0},fe,Z)},h}return Object(L.a)(_,[{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,f=d.eventKey,T=d.className,b=d.style,S=d.dragOver,D=d.dragOverGapTop,I=d.dragOverGapBottom,w=d.isLeaf,P=d.isStart,U=d.isEnd,O=d.expanded,G=d.selected,z=d.checked,ae=d.halfChecked,ie=d.loading,fe=d.domRef,ce=d.active,J=d.onMouseMove,Z=Object(H.a)(d,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),ue=this.props.context,X=ue.prefixCls,$=ue.filterTreeNode,be=ue.draggable,Re=ue.keyEntities,Ie=this.isDisabled(),Le=Object(l.f)(Z),Fe=Re[f]||{},ye=Fe.level,Te=U[U.length-1];return e.createElement("div",Object.assign({ref:fe,className:g()(T,"".concat(X,"-treenode"),(u={},Object(te.a)(u,"".concat(X,"-treenode-disabled"),Ie),Object(te.a)(u,"".concat(X,"-treenode-switcher-").concat(O?"open":"close"),!w),Object(te.a)(u,"".concat(X,"-treenode-checkbox-checked"),z),Object(te.a)(u,"".concat(X,"-treenode-checkbox-indeterminate"),ae),Object(te.a)(u,"".concat(X,"-treenode-selected"),G),Object(te.a)(u,"".concat(X,"-treenode-loading"),ie),Object(te.a)(u,"".concat(X,"-treenode-active"),ce),Object(te.a)(u,"".concat(X,"-treenode-leaf-last"),Te),Object(te.a)(u,"drag-over",!Ie&&S),Object(te.a)(u,"drag-over-gap-top",!Ie&&D),Object(te.a)(u,"drag-over-gap-bottom",!Ie&&I),Object(te.a)(u,"filter-node",$&&$(Object(o.b)(this.props))),u)),style:b,onDragEnter:be?this.onDragEnter:void 0,onDragOver:be?this.onDragOver:void 0,onDragLeave:be?this.onDragLeave:void 0,onDrop:be?this.onDrop:void 0,onDragEnd:be?this.onDragEnd:void 0,onMouseMove:J},Le),e.createElement(a,{prefixCls:X,level:ye,isStart:P,isEnd:U}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),_}(e.Component),y=function(E){return e.createElement(c.a.Consumer,null,function(_){return e.createElement(t,Object.assign({},E,{context:_}))})};y.displayName="TreeNode",y.defaultProps={title:i},y.isTreeNode=1;var p=le.a=y},Y1PL:function(Qe,le,W){"use strict";W.r(le),W.d(le,"ResizableTextArea",function(){return ae});var te=W("wx14"),H=W("1OyB"),C=W("vuIU"),j=W("Ji7U"),L=W("LK+K"),R=W("q1tI"),B=W("VTBJ"),k=W("rePB"),e=W("Zm9Q"),A=W("Kwbf"),g=W("c+Xe"),c=W("m+aA"),l=W("bdgK"),n=new Map;function a(ce){ce.forEach(function(J){var Z,ue=J.target;(Z=n.get(ue))===null||Z===void 0||Z.forEach(function(X){return X(ue)})})}var o=new l.default(a),s=null,r=null;function i(ce,J){n.has(ce)||(n.set(ce,new Set),o.observe(ce)),n.get(ce).add(J)}function t(ce,J){n.has(ce)&&(n.get(ce).delete(J),n.get(ce).size||(o.unobserve(ce),n.delete(ce)))}var y=function(ce){Object(j.a)(Z,ce);var J=Object(L.a)(Z);function Z(){return Object(H.a)(this,Z),J.apply(this,arguments)}return Object(C.a)(Z,[{key:"render",value:function(){return this.props.children}}]),Z}(R.Component),p=R.createContext(null);function m(ce){var J=ce.children,Z=ce.onBatchResize,ue=R.useRef(0),X=R.useRef([]),$=R.useContext(p),be=R.useCallback(function(Re,Ie,Le){ue.current+=1;var Fe=ue.current;X.current.push({size:Re,element:Ie,data:Le}),Promise.resolve().then(function(){Fe===ue.current&&(Z==null||Z(X.current),X.current=[])}),$==null||$(Re,Ie,Le)},[Z,$]);return R.createElement(p.Provider,{value:be},J)}function E(ce){var J=ce.children,Z=ce.disabled,ue=R.useRef(null),X=R.useRef(null),$=R.useContext(p),be=R.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),Re=R.isValidElement(J)&&Object(g.c)(J),Ie=Re?J.ref:null,Le=R.useMemo(function(){return Object(g.a)(Ie,ue)},[Ie,ue]),Fe=R.useRef(ce);Fe.current=ce;var ye=R.useCallback(function(Te){var Ae=Fe.current,Y=Ae.onResize,se=Ae.data,pe=Te.getBoundingClientRect(),ve=pe.width,Me=pe.height,he=Te.offsetWidth,me=Te.offsetHeight,_e=Math.floor(ve),Se=Math.floor(Me);if(be.current.width!==_e||be.current.height!==Se||be.current.offsetWidth!==he||be.current.offsetHeight!==me){var Ce={width:_e,height:Se,offsetWidth:he,offsetHeight:me};be.current=Ce;var Oe=he===Math.round(ve)?ve:he,xe=me===Math.round(Me)?Me:me,Ue=Object(B.a)(Object(B.a)({},Ce),{},{offsetWidth:Oe,offsetHeight:xe});$==null||$(Ue,Te,se),Y&&Promise.resolve().then(function(){Y(Ue,Te)})}},[]);return R.useEffect(function(){var Te=Object(c.a)(ue.current)||Object(c.a)(X.current);return Te&&!Z&&i(Te,ye),function(){return t(Te,ye)}},[ue.current,Z]),R.createElement(y,{ref:X},Re?R.cloneElement(J,{ref:Le}):J)}var _="rc-observer-key";function h(ce){var J=ce.children,Z=Object(e.a)(J);return Z.map(function(ue,X){var $=(ue==null?void 0:ue.key)||"".concat(_,"-").concat(X);return R.createElement(E,Object(te.a)({},ce,{key:$}),ue)})}h.Collection=m;var u=h,d=W("bT9E"),f=W("TSYQ"),T=W.n(f),b=`
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
`,S=["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"],D={},I;function w(ce){var J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Z=ce.getAttribute("id")||ce.getAttribute("data-reactid")||ce.getAttribute("name");if(J&&D[Z])return D[Z];var ue=window.getComputedStyle(ce),X=ue.getPropertyValue("box-sizing")||ue.getPropertyValue("-moz-box-sizing")||ue.getPropertyValue("-webkit-box-sizing"),$=parseFloat(ue.getPropertyValue("padding-bottom"))+parseFloat(ue.getPropertyValue("padding-top")),be=parseFloat(ue.getPropertyValue("border-bottom-width"))+parseFloat(ue.getPropertyValue("border-top-width")),Re=S.map(function(Le){return"".concat(Le,":").concat(ue.getPropertyValue(Le))}).join(";"),Ie={sizingStyle:Re,paddingSize:$,borderSize:be,boxSizing:X};return J&&Z&&(D[Z]=Ie),Ie}function P(ce){var J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,ue=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;I||(I=document.createElement("textarea"),I.setAttribute("tab-index","-1"),I.setAttribute("aria-hidden","true"),document.body.appendChild(I)),ce.getAttribute("wrap")?I.setAttribute("wrap",ce.getAttribute("wrap")):I.removeAttribute("wrap");var X=w(ce,J),$=X.paddingSize,be=X.borderSize,Re=X.boxSizing,Ie=X.sizingStyle;I.setAttribute("style","".concat(Ie,";").concat(b)),I.value=ce.value||ce.placeholder||"";var Le=Number.MIN_SAFE_INTEGER,Fe=Number.MAX_SAFE_INTEGER,ye=I.scrollHeight,Te;if(Re==="border-box"?ye+=be:Re==="content-box"&&(ye-=$),Z!==null||ue!==null){I.value=" ";var Ae=I.scrollHeight-$;Z!==null&&(Le=Ae*Z,Re==="border-box"&&(Le=Le+$+be),ye=Math.max(Le,ye)),ue!==null&&(Fe=Ae*ue,Re==="border-box"&&(Fe=Fe+$+be),Te=ye>Fe?"":"hidden",ye=Math.min(Fe,ye))}return{height:ye,minHeight:Le,maxHeight:Fe,overflowY:Te,resize:"none"}}var U=W("Gytx"),O=W.n(U),G;(function(ce){ce[ce.NONE=0]="NONE",ce[ce.RESIZING=1]="RESIZING",ce[ce.RESIZED=2]="RESIZED"})(G||(G={}));var z=function(ce){Object(j.a)(Z,ce);var J=Object(L.a)(Z);function Z(ue){var X;return Object(H.a)(this,Z),X=J.call(this,ue),X.nextFrameActionId=void 0,X.resizeFrameId=void 0,X.textArea=void 0,X.saveTextArea=function($){X.textArea=$},X.handleResize=function($){var be=X.state.resizeStatus,Re=X.props,Ie=Re.autoSize,Le=Re.onResize;if(be!==G.NONE)return;typeof Le=="function"&&Le($),Ie&&X.resizeOnNextFrame()},X.resizeOnNextFrame=function(){cancelAnimationFrame(X.nextFrameActionId),X.nextFrameActionId=requestAnimationFrame(X.resizeTextarea)},X.resizeTextarea=function(){var $=X.props.autoSize;if(!$||!X.textArea)return;var be=$.minRows,Re=$.maxRows,Ie=P(X.textArea,!1,be,Re);X.setState({textareaStyles:Ie,resizeStatus:G.RESIZING},function(){cancelAnimationFrame(X.resizeFrameId),X.resizeFrameId=requestAnimationFrame(function(){X.setState({resizeStatus:G.RESIZED},function(){X.resizeFrameId=requestAnimationFrame(function(){X.setState({resizeStatus:G.NONE}),X.fixFirefoxAutoScroll()})})})})},X.renderTextArea=function(){var $=X.props,be=$.prefixCls,Re=be===void 0?"rc-textarea":be,Ie=$.autoSize,Le=$.onResize,Fe=$.className,ye=$.disabled,Te=X.state,Ae=Te.textareaStyles,Y=Te.resizeStatus,se=Object(d.a)(X.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),pe=T()(Re,Fe,Object(k.a)({},"".concat(Re,"-disabled"),ye));"value"in se&&(se.value=se.value||"");var ve=Object(B.a)(Object(B.a)(Object(B.a)({},X.props.style),Ae),Y===G.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return R.createElement(u,{onResize:X.handleResize,disabled:!(Ie||Le)},R.createElement("textarea",Object(te.a)({},se,{className:pe,style:ve,ref:X.saveTextArea})))},X.state={textareaStyles:{},resizeStatus:G.NONE},X}return Object(C.a)(Z,[{key:"componentDidUpdate",value:function(X){(X.value!==this.props.value||!O()(X.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 X=this.textArea.selectionStart,$=this.textArea.selectionEnd;this.textArea.setSelectionRange(X,$)}}catch(be){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Z}(R.Component),ae=z,ie=function(ce){Object(j.a)(Z,ce);var J=Object(L.a)(Z);function Z(ue){var X;Object(H.a)(this,Z),X=J.call(this,ue),X.resizableTextArea=void 0,X.focus=function(){X.resizableTextArea.textArea.focus()},X.saveTextArea=function(be){X.resizableTextArea=be},X.handleChange=function(be){var Re=X.props.onChange;X.setValue(be.target.value,function(){X.resizableTextArea.resizeTextarea()}),Re&&Re(be)},X.handleKeyDown=function(be){var Re=X.props,Ie=Re.onPressEnter,Le=Re.onKeyDown;be.keyCode===13&&Ie&&Ie(be),Le&&Le(be)};var $=typeof ue.value=="undefined"||ue.value===null?ue.defaultValue:ue.value;return X.state={value:$},X}return Object(C.a)(Z,[{key:"setValue",value:function(X,$){"value"in this.props||this.setState({value:X},$)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return R.createElement(ae,Object(te.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(X){return"value"in X?{value:X.value}:null}}]),Z}(R.Component),fe=le.default=ie},ZW9T:function(Qe,le,W){"use strict";W.d(le,"a",function(){return U});var te=W("k1fw"),H=W("oBTY"),C=W("miYZ"),j=W("tsqr"),L=W("rAM+"),R=W("tJVT"),B=W("PpiC"),k=W("q1tI"),e=W.n(k),A=W("bdgK"),g=W("9og8"),c=W("WmNS"),l=W.n(c),n={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"]},a={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"]},o={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","friend","gcnew","generic","goto","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],quickKey:[{label:"ifelse",content:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
`)},{label:"include",content:"include<$0>"},{label:"printf",content:"printf($0)"},{label:"system",content:'system("$0")'},{label:"main",content:["int main () {"," $0","}"].join(`
`)},{label:"if",content:["if () {"," $0","}"].join(`
`)},{label:"for",content:["for(int j=0 ; j<10; j++){"," $0","}"].join(`
`)},{label:"trycatch",content:["try{"," $0","}catch(ExceptionName e){","}"].join(`
`)},{label:"using namespace std;",content:["using namespace std;"].join(`
`)},{label:"include <iostream>",content:["#include <iostream>"].join(`
`)},{label:"include <vector>",content:["#include <vector>"].join(`
`)},{label:"include <cstdio>",content:["#include <cstdio>"].join(`
`)},{label:"include <cstring>",content:["#include <cstring>"].join(`
`)},{label:"include <sstream>",content:["#include <sstream>"].join(`
`)},{label:"include <fstream>",content:["#include <fstream>"].join(`
`)},{label:"include <map>",content:["#include <map>"].join(`
`)},{label:"include <string>",content:["#include <string>"].join(`
`)},{label:"include <cmath>",content:["#include <cmath>"].join(`
`)}]},s={keywords:["and","as","assert","break","class","continue","def","del","elif","else","except","exec","finally","for","from","global","if","import","in","is","lambda","None","not","or","pass","raise","return","self","try","while","with","yield","int","float","long","complex","hex","abs","all","any","apply","basestring","bin","bool","buffer","bytearray","callable","chr","classmethod","cmp","coerce","compile","complex","delattr","dict","dir","divmod","enumerate","eval","execfile","file","filter","format","frozenset","getattr","globals","hasattr","hash","help","id","input","intern","isinstance","issubclass","iter","len","locals","list","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","reversed","range","raw_input","reduce","reload","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","unichr","unicode","vars","xrange","zip","True","False","__dict__","__methods__","__members__","__class__","__bases__","__name__","__mro__","__subclasses__","__init__","__import__"],quickKey:[{label:"print",content:["print($0)"].join(`
`)}]},r=W("5VLF"),i=W.n(r),t={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"]}},y=function(G,z){return z.map(function(ae){return{label:ae,kind:G.languages.CompletionItemKind.Keyword,insertText:ae}})},p=function(G){return Object.keys(t.tables).map(function(z){return{label:z,kind:G.languages.CompletionItemKind.Variable,insertText:z}})},m=function(G,z){var ae=t.tables[G];return ae?ae.map(function(ie){return{label:ie,kind:z.languages.CompletionItemKind.Field,insertText:ie}}):[]};function E(O,G,z,ae,ie){var fe=G.getWordUntilPosition(z),ce={startLineNumber:z.lineNumber,endLineNumber:z.lineNumber,startColumn:fe.startColumn,endColumn:fe.endColumn},J=ae.map(function(Z){return{label:Z,kind:O.languages.CompletionItemKind.Keyword,insertText:Z,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ce}});return ie.map(function(Z){J.push(Object(te.a)(Object(te.a)({},Z),{},{range:ce}))}),J}var _=function(O){t.languages.map(function(ie){return O.languages.registerDocumentFormattingEditProvider(ie,{provideDocumentFormattingEdits:function(ce,J,Z){return Object(g.a)(l.a.mark(function ue(){var X;return l.a.wrap(function(be){for(;;)switch(be.prev=be.next){case 0:return X=i()(ce.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}),be.abrupt("return",[{range:ce.getFullModelRange(),text:X}]);case 2:case"end":return be.stop()}},ue)}))()}}),ie});var G=o.quickKey.map(function(ie){return{label:ie.label,kind:O.languages.CompletionItemKind.Method,insertText:ie.content,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),z=s.quickKey.map(function(ie){return{label:ie.label,kind:O.languages.CompletionItemKind.Method,insertText:ie.content,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),ae=a.quickKey.map(function(ie){return{label:ie.label,kind:O.languages.CompletionItemKind.Method,insertText:ie.content,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet}});O.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(fe,ce){var J=fe.getWordUntilPosition(ce),Z={startLineNumber:ce.lineNumber,endLineNumber:ce.lineNumber,startColumn:J.startColumn,endColumn:J.endColumn},ue=fe.getLineContent(ce.lineNumber).substring(J.startColumn-2,J.endColumn);return{suggestions:[].concat(Object(H.a)(o.keywords.map(function(X){return{label:X,kind:O.languages.CompletionItemKind.Function,documentation:X,insertText:X,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Z}})),Object(H.a)(o.quickKey.map(function(X){return{label:X.label,kind:O.languages.CompletionItemKind.Function,documentation:X.content,insertText:ue.startsWith("#")?X.content.replace(/#/,""):X.content,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Z}})))}}}),O.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(fe,ce){var J=fe.getWordUntilPosition(ce),Z={startLineNumber:ce.lineNumber,endLineNumber:ce.lineNumber,startColumn:J.startColumn,endColumn:J.endColumn};return{suggestions:Object(H.a)(n.keywords.map(function(ue){return{label:ue,kind:O.languages.CompletionItemKind.Function,documentation:ue,insertText:ue,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Z}}))}}}),O.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(fe,ce){var J=fe.getWordUntilPosition(ce),Z={startLineNumber:ce.lineNumber,endLineNumber:ce.lineNumber,startColumn:J.startColumn,endColumn:J.endColumn},ue=fe.getLineContent(ce.lineNumber).substring(J.startColumn-2,J.endColumn);return{suggestions:[].concat(Object(H.a)(a.keywords.map(function(X){return{label:X,kind:O.languages.CompletionItemKind.Function,documentation:X,insertText:X,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Z}})),Object(H.a)(a.quickKey.map(function(X){return{label:X.label,kind:O.languages.CompletionItemKind.Function,documentation:X.content,insertText:ue.startsWith("#")?X.content.replace(/#/,""):X.content,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Z}})))}}}),O.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(fe,ce){var J=fe.getWordUntilPosition(ce),Z={startLineNumber:ce.lineNumber,endLineNumber:ce.lineNumber,startColumn:J.startColumn,endColumn:J.endColumn},ue=fe.getLineContent(ce.lineNumber).substring(J.startColumn-2,J.endColumn);return{suggestions:[].concat(Object(H.a)(s.keywords.map(function(X){return{label:X,kind:O.languages.CompletionItemKind.Function,documentation:X,insertText:X,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Z}})),Object(H.a)(s.quickKey.map(function(X){return{label:X.label,kind:O.languages.CompletionItemKind.Function,documentation:X.content,insertText:ue.startsWith("#")?X.content.replace(/#/,""):X.content,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Z}})))}}})},h="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",u=W("fjLI"),d=W("LvDl"),f=W("+ua5");function T(O){return/^\d+$/.test(O)?"".concat(O,"px"):O}function b(){}var S=!1,D={"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 I(){var O=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],G=O;if(Array.isArray(O)){for(var z=0;z<O.length;z++){var ae=D[O[z]];if(ae)return ae}return G[0]}return D[G]||G}var w=null,P=le.b=function(O){var G=O.width,z=G===void 0?"100%":G,ae=O.height,ie=ae===void 0?"100%":ae,fe=O.value,ce=O.language,J=ce===void 0?"javascript":ce,Z=O.style,ue=Z===void 0?{}:Z,X=O.options,$=X===void 0?{}:X,be=O.overrideServices,Re=be===void 0?{}:be,Ie=O.theme,Le=Ie===void 0?"vs-dark":Ie,Fe=O.onEditBlur,ye=O.onSave,Te=O.autoHeight,Ae=Te===void 0?!1:Te,Y=O.forbidCopy,se=Y===void 0?!1:Y,pe=O.onChange,ve=pe===void 0?b:pe,Me=O.editorDidMount,he=Me===void 0?b:Me,me=O.onFocus,_e=me===void 0?b:me,Se=O.filename,Ce=Se===void 0?"educoder.txt":Se,Oe=O.errorLine,xe=O.errorContent,Ue=xe===void 0?"":xe,Be=Object(B.a)(O,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),Ee=Object(k.useRef)(),De=Object(k.useRef)({}),de=Object(k.useRef)(),re=Object(k.useRef)(),oe=Object(k.useRef)(!1),V=Object(k.useRef)(),Q=Object(k.useState)(!1),q=Object(R.a)(Q,2),ee=q[0],ge=q[1];function we(){var We;return Ee.current&&(We=new A.default(function(Ye){var rt=Object(L.a)(Ye),dt;try{for(rt.s();!(dt=rt.n()).done;){var vt=dt.value;(vt.target.offsetHeight>0||vt.target.offsetWidth>0)&&De.current.instance.layout()}}catch(ut){rt.e(ut)}finally{rt.f()}}),We.observe(Ee.current)),We}function Ne(){j.b.warn(decodeURIComponent(h))}var Ge=function(){var Ye=De.current.instance;if(fe!=null&&Ye&&ee){var rt=Ye.getModel();rt&&fe!==rt.getValue()&&(S=!0,rt.setValue(fe),Ye.layout(),S=!1)}};Object(k.useEffect)(function(){re.current&&clearTimeout(re.current),re.current=setTimeout(function(){Ge()},500)},[fe,ee,De.current]),Object(k.useEffect)(function(){if(Oe&&De.current&&De.current.instance){var We=De.current.instance;We.changeViewZones(function(rt){var dt=document.createElement("div");dt.style.padding="10px 20px",dt.style.width="calc(100% - 20px)",dt.className="my-error-line-wrp",dt.innerHTML=Ue,rt.addZone({afterLineNumber:Oe||11,heightInLines:3,domNode:dt})});var Ye={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}};We.addOverlayWidget(Ye),We.revealPositionInCenter({lineNumber:20,column:1})}},[Oe,De.current,ee]);function Je(){var We=De.current.instance;if(We){var Ye=We.getSelection(),rt=De.current.pastePos||{},dt=new w.Range(rt.startLineNumber||Ye.endLineNumber,rt.startColumn||Ye.endColumn,rt.endLineNumber||Ye.endLineNumber,rt.endColumn||Ye.endColumn);setTimeout(function(){We.executeEdits("",[{range:dt,text:""}])},300)}}function ze(We){(window.navigator.platform.match("Mac")?We.metaKey:We.ctrlKey)&&We.keyCode==83&&(We.preventDefault(),ye())}var qe=function(){if(Ae&&De.current.instance){var Ye=De.current.instance.getContentHeight();Ve(Ye<ie?ie:Ye)}else Ve(ie)};function nt(We){var Ye=document.createEvent("MouseEvents");Ye.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),We.dispatchEvent(Ye)}function $e(We,Ye){var rt=window.URL||window.webkitURL||window,dt=new Blob([Ye]),vt=document.createElementNS("http://www.w3.org/1999/xhtml","a");vt.href=rt.createObjectURL(dt),vt.download=We,nt(vt)}Object(k.useEffect)(function(){qe()},[qe]),Object(k.useEffect)(function(){Ee.current&&!ee&&Promise.all([W.e(15),W.e(27)]).then(W.t.bind(null,"M/lh",7)).then(function(We){try{w=We,De.current.instance=w.editor.create(Ee.current,{value:fe,language:I(J),theme:Le,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},Re);var Ye=De.current.instance,rt=u.d._menuItems,dt=Object(H.a)(rt).find(function(et){return et[0]._debugName=="EditorContext"}),vt=dt[1],ut=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],tt=function(st,ot){var lt=st._first;do{var ct,Ct,Mt=ot.includes((ct=lt.element)===null||ct===void 0||((Ct=ct.command)===null||Ct===void 0)?void 0:Ct.id);Mt&&st._remove(lt)}while(lt=lt.next)};if(he(Ye,w),setTimeout(function(){qe(),De.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){$e(Ce||"educoder.txt",Ye.getValue())}}),Ye.getDomNode().addEventListener("input",function(){de.current.autoFormat&&Ye.getAction("editor.action.formatDocument").run()})},500),De.current.subscription=Ye.onDidChangeModelContent(function(et){oe.current?clearTimeout(V.current):(qe(),ve(Ye.getValue(),et)),V.current=setTimeout(function(){oe.current=!1},500)}),window.Monaco||_(w,I(J)),se&&(tt(vt,ut),Ee.current.classList.add("noCopyPaste"),Ye.onKeyDown(function(et){var st=et.keyCode,ot=et.ctrlKey,lt=et.metaKey;(st===33||st===52)&&(lt||ot)&&(Ne(),et.preventDefault())})),window.Monaco=w,Fe&&Ye.onDidBlurEditorWidget(function(){Fe(Ye.getValue())}),_e&&Ye.onDidFocusEditorText(function(){_e(Ye.getValue())}),se){Ye.addCommand(w.KeyMod.CtrlCmd|w.KeyCode.KEY_V,function(){return Ne(),null}),Ye.onDidPaste(function(et){De.current.pastePos=et});try{window.addEventListener("paste",Je)}catch(et){}}var Ze=we();return ge(!0),function(){var et=De.current.instance;et.dispose();var st=et.getModel();st&&st.dispose(),De.current.subscription&&De.current.subscription.dispose(),se&&window.removeEventListener("paste",Je),Ze.unobserve(Ee.current)}}catch(et){}})},[]),Object(k.useEffect)(function(){var We=De.current.instance;if(We&&ee)return document.addEventListener("keydown",ze,!1),function(){document.removeEventListener("keydown",ze)}},[ye,ee]),Object(k.useEffect)(function(){var We=De.current.instance;if(We&&ee){var Ye=I(J);w.editor.setModelLanguage(We.getModel(),Ye),console.log("language:",J,We.getModel(),Ye)}},[J,ee]),Object(k.useEffect)(function(){var We=De.current.instance;We&&ee&&w.editor.setTheme(Le)},[Le,ee]),Object(k.useEffect)(function(){var We=De.current.instance;de.current=$,We&&ee&&(We.updateOptions(Object(te.a)({},$)),setTimeout(function(){We.getModel().updateOptions(Object(te.a)({},$))},200))},[JSON.stringify($),ee]),Object(k.useEffect)(function(){var We=De.current.instance;We&&ee&&We.layout()},[z,ie,ee]);var gt=Object(k.useState)(T(z)),ht=Object(R.a)(gt,2),bt=ht[0],pt=ht[1],it=Object(k.useState)(T(ie)),_t=Object(R.a)(it,2),Tt=_t[0],Ve=_t[1],At=Object(te.a)(Object(te.a)({},ue),{},{width:bt,height:Tt});return e.a.createElement("div",{className:"my-monaco-editor",ref:Ee,style:At})};function U(O){var G=O.width,z=G===void 0?"100%":G,ae=O.height,ie=ae===void 0?"100%":ae,fe=O.original,ce=O.modified,J=O.language,Z=O.options,ue=Z===void 0?{}:Z,X=Object(k.useRef)(),$=Object(k.useState)(null),be=Object(R.a)($,2),Re=be[0],Ie=be[1];function Le(Ae){var Y;return X.current&&(Y=new A.default(function(se){var pe=Object(L.a)(se),ve;try{for(pe.s();!(ve=pe.n()).done;){var Me=ve.value;(Me.target.offsetHeight>0||Me.target.offsetWidth>0)&&Ae.layout()}}catch(he){pe.e(he)}finally{pe.f()}}),Y.observe(X.current)),Y}Object(k.useEffect)(function(){X.current&&Promise.all([W.e(15),W.e(27)]).then(W.t.bind(null,"M/lh",7)).then(function(Ae){w=Ae;var Y=w.editor.createDiffEditor(X.current,Object(te.a)(Object(te.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},ue),{},{wordWrap:!0}));Ie(Y);var se=Le(Y);return function(){Y.dispose();var pe=Y.getModel();pe&&pe.dispose(),se.unobserve(X.current)}})},[]),Object(k.useEffect)(function(){Re&&Re.setModel({original:w.editor.createModel(fe,J),modified:w.editor.createModel(ce,J)})},[fe,ce,J,Re]);var Fe=T(z),ye=T(ie),Te={width:Fe,height:ye};return e.a.createElement("div",{className:"my-diff-editor",ref:X,style:Te})}},ZpRC:function(Qe,le,W){"use strict";function te(g){return typeof g=="object"&&g!=null&&g.nodeType===1}function H(g,c){return(!c||g!=="hidden")&&g!=="visible"&&g!=="clip"}function C(g,c){if(g.clientHeight<g.scrollHeight||g.clientWidth<g.scrollWidth){var l=getComputedStyle(g,null);return H(l.overflowY,c)||H(l.overflowX,c)||function(n){var a=function(o){if(!o.ownerDocument||!o.ownerDocument.defaultView)return null;try{return o.ownerDocument.defaultView.frameElement}catch(s){return null}}(n);return!!a&&(a.clientHeight<n.scrollHeight||a.clientWidth<n.scrollWidth)}(g)}return!1}function j(g,c,l,n,a,o,s,r){return o<g&&s>c||o>g&&s<c?0:o<=g&&r<=l||s>=c&&r>=l?o-g-n:s>c&&r<l||o<g&&r>l?s-c+a:0}var L=function(g,c){var l=window,n=c.scrollMode,a=c.block,o=c.inline,s=c.boundary,r=c.skipOverflowHiddenElements,i=typeof s=="function"?s:function(Ae){return Ae!==s};if(!te(g))throw new TypeError("Invalid target");for(var t=document.scrollingElement||document.documentElement,y=[],p=g;te(p)&&i(p);){if((p=p.parentElement)===t){y.push(p);break}p!=null&&p===document.body&&C(p)&&!C(document.documentElement)||p!=null&&C(p,r)&&y.push(p)}for(var m=l.visualViewport?l.visualViewport.width:innerWidth,E=l.visualViewport?l.visualViewport.height:innerHeight,_=window.scrollX||pageXOffset,h=window.scrollY||pageYOffset,u=g.getBoundingClientRect(),d=u.height,f=u.width,T=u.top,b=u.right,S=u.bottom,D=u.left,I=a==="start"||a==="nearest"?T:a==="end"?S:T+d/2,w=o==="center"?D+f/2:o==="end"?b:D,P=[],U=0;U<y.length;U++){var O=y[U],G=O.getBoundingClientRect(),z=G.height,ae=G.width,ie=G.top,fe=G.right,ce=G.bottom,J=G.left;if(n==="if-needed"&&T>=0&&D>=0&&S<=E&&b<=m&&T>=ie&&S<=ce&&D>=J&&b<=fe)return P;var Z=getComputedStyle(O),ue=parseInt(Z.borderLeftWidth,10),X=parseInt(Z.borderTopWidth,10),$=parseInt(Z.borderRightWidth,10),be=parseInt(Z.borderBottomWidth,10),Re=0,Ie=0,Le="offsetWidth"in O?O.offsetWidth-O.clientWidth-ue-$:0,Fe="offsetHeight"in O?O.offsetHeight-O.clientHeight-X-be:0;if(t===O)Re=a==="start"?I:a==="end"?I-E:a==="nearest"?j(h,h+E,E,X,be,h+I,h+I+d,d):I-E/2,Ie=o==="start"?w:o==="center"?w-m/2:o==="end"?w-m:j(_,_+m,m,ue,$,_+w,_+w+f,f),Re=Math.max(0,Re+h),Ie=Math.max(0,Ie+_);else{Re=a==="start"?I-ie-X:a==="end"?I-ce+be+Fe:a==="nearest"?j(ie,ce,z,X,be+Fe,I,I+d,d):I-(ie+z/2)+Fe/2,Ie=o==="start"?w-J-ue:o==="center"?w-(J+ae/2)+Le/2:o==="end"?w-fe+$+Le:j(J,fe,ae,ue,$+Le,w,w+f,f);var ye=O.scrollLeft,Te=O.scrollTop;I+=Te-(Re=Math.max(0,Math.min(Te+Re,O.scrollHeight-z+Fe))),w+=ye-(Ie=Math.max(0,Math.min(ye+Ie,O.scrollWidth-ae+Le)))}P.push({el:O,top:Re,left:Ie})}return P};function R(g){return g===Object(g)&&Object.keys(g).length!==0}function B(g,c){c===void 0&&(c="auto");var l="scrollBehavior"in document.body.style;g.forEach(function(n){var a=n.el,o=n.top,s=n.left;a.scroll&&l?a.scroll({top:o,left:s,behavior:c}):(a.scrollTop=o,a.scrollLeft=s)})}function k(g){return g===!1?{block:"end",inline:"nearest"}:R(g)?g:{block:"start",inline:"nearest"}}function e(g,c){var l=!g.ownerDocument.documentElement.contains(g);if(R(c)&&typeof c.behavior=="function")return c.behavior(l?[]:L(g,c));if(l)return;var n=k(c);return B(L(g,n),n.behavior)}var A=le.a=e},bT9E:function(Qe,le,W){"use strict";W.d(le,"a",function(){return H});var te=W("VTBJ");function H(C,j){var L=Object(te.a)({},C);return Array.isArray(j)&&j.forEach(function(R){delete L[R]}),L}},fAei:function(Qe,le,W){"use strict";W.d(le,"a",function(){return t.a});var te=W("rePB"),H=W("VTBJ"),C=W("KQm4"),j=W("1OyB"),L=W("vuIU"),R=W("Ji7U"),B=W("LK+K"),k=W("q1tI"),e=W("4IlW"),A=W("Kwbf"),g=W("TSYQ"),c=W.n(g),l=W("sboe"),n=W("OZM5"),a=W("815F"),o=W("ODXe"),s=W("Ff2n"),r=W("+nKL"),i=W("8XRh"),t=W("WaYH"),y=function(fe,ce){var J=fe.className,Z=fe.style,ue=fe.motion,X=fe.motionNodes,$=fe.motionType,be=fe.onMotionStart,Re=fe.onMotionEnd,Ie=fe.active,Le=fe.treeNodeRequiredProps,Fe=Object(s.a)(fe,["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"]),ye=k.useState(!0),Te=Object(o.a)(ye,2),Ae=Te[0],Y=Te[1],se=k.useContext(l.a),pe=se.prefixCls,ve=k.useRef(!1),Me=function(){ve.current||Re(),ve.current=!0};return Object(k.useEffect)(function(){X&&$==="hide"&&Ae&&Y(!1)},[X]),Object(k.useEffect)(function(){return X&&be(),function(){X&&Me()}},[]),X?k.createElement(i.default,Object.assign({ref:ce,visible:Ae},ue,{motionAppear:$==="show",onAppearEnd:Me,onLeaveEnd:Me}),function(he,me){var _e=he.className,Se=he.style;return k.createElement("div",{ref:me,className:c()("".concat(pe,"-treenode-motion"),_e),style:Se},X.map(function(Ce){var Oe=Ce.data,xe=Oe.key,Ue=Object(s.a)(Oe,["key"]),Be=Ce.isStart,Ee=Ce.isEnd;delete Ue.children;var De=Object(a.f)(xe,Le);return k.createElement(t.a,Object.assign({},Ue,De,{active:Ie,data:Ce.data,key:xe,isStart:Be,isEnd:Ee}))}))}):k.createElement(t.a,Object.assign({domRef:ce,className:J,style:Z},Fe,{active:Ie}))};y.displayName="MotionTreeNode";var p=k.forwardRef(y),m=p;function E(){var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],ce=ie.length,J=fe.length;if(Math.abs(ce-J)!==1)return{add:!1,key:null};function Z(ue,X){var $=new Map;ue.forEach(function(Re){$.set(Re,!0)});var be=X.filter(function(Re){return!$.has(Re)});return be.length===1?be[0]:null}return ce<J?{add:!0,key:Z(ie,fe)}:{add:!1,key:Z(fe,ie)}}function _(ie,fe,ce){var J=ie.findIndex(function($){var be=$.data;return be.key===ce}),Z=ie[J+1],ue=fe.findIndex(function($){var be=$.data;return be.key===ce});if(Z){var X=fe.findIndex(function($){var be=$.data;return be.key===Z.data.key});return fe.slice(ue+1,X)}return fe.slice(ue+1)}var h={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()),f={key:d},T={key:d,level:0,index:0,pos:"0",node:f},b={parent:null,children:[],pos:T.pos,data:f,isStart:[],isEnd:[]};function S(ie,fe,ce,J){return fe===!1||!ce?ie:ie.slice(0,Math.ceil(ce/J)+1)}function D(ie){var fe=ie.data.key,ce=ie.pos;return Object(a.e)(fe,ce)}function I(ie){for(var fe=String(ie.data.key),ce=ie;ce.parent;)ce=ce.parent,fe="".concat(ce.data.key," > ").concat(fe);return fe}var w=function(fe,ce){var J=fe.prefixCls,Z=fe.data,ue=fe.selectable,X=fe.checkable,$=fe.expandedKeys,be=fe.selectedKeys,Re=fe.checkedKeys,Ie=fe.loadedKeys,Le=fe.loadingKeys,Fe=fe.halfCheckedKeys,ye=fe.keyEntities,Te=fe.disabled,Ae=fe.dragging,Y=fe.dragOverNodeKey,se=fe.dropPosition,pe=fe.motion,ve=fe.height,Me=fe.itemHeight,he=fe.virtual,me=fe.focusable,_e=fe.activeItem,Se=fe.focused,Ce=fe.tabIndex,Oe=fe.onKeyDown,xe=fe.onFocus,Ue=fe.onBlur,Be=fe.onActiveChange,Ee=fe.onListChangeStart,De=fe.onListChangeEnd,de=Object(s.a)(fe,["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"]),re=k.useRef(null);k.useImperativeHandle(ce,function(){return{scrollTo:function(Ye){re.current.scrollTo(Ye)}}});var oe=k.useState($),V=Object(o.a)(oe,2),Q=V[0],q=V[1],ee=k.useState(Z),ge=Object(o.a)(ee,2),we=ge[0],Ne=ge[1],Ge=k.useState(Z),Je=Object(o.a)(Ge,2),ze=Je[0],qe=Je[1],nt=k.useState([]),$e=Object(o.a)(nt,2),gt=$e[0],ht=$e[1],bt=k.useState(null),pt=Object(o.a)(bt,2),it=pt[0],_t=pt[1];function Tt(){Ne(Z),qe(Z),ht([]),_t(null),De()}k.useEffect(function(){q($);var We=E(Q,$);if(We.key!==null)if(We.add){var Ye=we.findIndex(function(Ze){var et=Ze.data.key;return et===We.key}),rt=S(_(we,Z,We.key),he,ve,Me),dt=we.slice();dt.splice(Ye+1,0,b),qe(dt),ht(rt),_t("show")}else{var vt=Z.findIndex(function(Ze){var et=Ze.data.key;return et===We.key}),ut=S(_(Z,we,We.key),he,ve,Me),tt=Z.slice();tt.splice(vt+1,0,b),qe(tt),ht(ut),_t("hide")}else we!==Z&&(Ne(Z),qe(Z))},[$,Z]),k.useEffect(function(){Ae||Tt()},[Ae]);var Ve=pe?ze:Z,At={expandedKeys:$,selectedKeys:be,loadedKeys:Ie,loadingKeys:Le,checkedKeys:Re,halfCheckedKeys:Fe,dragOverNodeKey:Y,dropPosition:se,keyEntities:ye};return k.createElement(k.Fragment,null,Se&&_e&&k.createElement("span",{style:h,"aria-live":"assertive"},I(_e)),k.createElement("div",{role:"tree"},k.createElement("input",{style:h,disabled:me===!1||Te,tabIndex:me!==!1?Ce:null,onKeyDown:Oe,onFocus:xe,onBlur:Ue,value:"",onChange:u})),k.createElement(r.a,Object.assign({},de,{data:Ve,itemKey:D,height:ve,fullHeight:!1,virtual:he,itemHeight:Me,prefixCls:"".concat(J,"-list"),ref:re}),function(We){var Ye=We.pos,rt=We.data,dt=rt.key,vt=Object(s.a)(rt,["key"]),ut=We.isStart,tt=We.isEnd,Ze=Object(a.e)(dt,Ye);delete vt.children;var et=Object(a.f)(Ze,At);return k.createElement(m,Object.assign({},vt,et,{active:_e&&dt===_e.data.key,pos:Ye,data:We.data,isStart:ut,isEnd:tt,motion:pe,motionNodes:dt===d?gt:null,motionType:it,onMotionStart:Ee,onMotionEnd:Tt,treeNodeRequiredProps:At,onMouseMove:function(){Be(null)}}))}))},P=k.forwardRef(w);P.displayName="NodeList";var U=P,O=W("NvD2"),G=function(ie){Object(R.a)(ce,ie);var fe=Object(B.a)(ce);function ce(){var J;return Object(j.a)(this,ce),J=fe.apply(this,arguments),J.destroyed=!1,J.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},J.listRef=k.createRef(),J.onNodeDragStart=function(Z,ue){var X=J.state,$=X.expandedKeys,be=X.keyEntities,Re=J.props.onDragStart,Ie=ue.props.eventKey;J.dragNode=ue;var Le=Object(n.b)($,Ie);J.setState({dragging:!0,dragNodesKeys:Object(n.g)(Ie,be)}),J.setExpandedKeys(Le),Re&&Re({event:Z,node:Object(a.b)(ue.props)})},J.onNodeDragEnter=function(Z,ue){var X=J.state,$=X.expandedKeys,be=X.keyEntities,Re=X.dragNodesKeys,Ie=J.props.onDragEnter,Le=ue.props,Fe=Le.pos,ye=Le.eventKey;if(!J.dragNode||Re.indexOf(ye)!==-1)return;var Te=Object(n.c)(Z,ue);if(J.dragNode.props.eventKey===ye&&Te===0){J.setState({dragOverNodeKey:"",dropPosition:null});return}setTimeout(function(){J.setState({dragOverNodeKey:ye,dropPosition:Te}),J.delayedDragEnterLogic||(J.delayedDragEnterLogic={}),Object.keys(J.delayedDragEnterLogic).forEach(function(Ae){clearTimeout(J.delayedDragEnterLogic[Ae])}),J.delayedDragEnterLogic[Fe]=window.setTimeout(function(){if(!J.state.dragging)return;var Ae=Object(C.a)($),Y=be[ye];Y&&(Y.children||[]).length&&(Ae=Object(n.a)($,ye)),"expandedKeys"in J.props||J.setExpandedKeys(Ae),Ie&&Ie({event:Z,node:Object(a.b)(ue.props),expandedKeys:Ae})},400)},0)},J.onNodeDragOver=function(Z,ue){var X=J.state.dragNodesKeys,$=J.props.onDragOver,be=ue.props.eventKey;if(X.indexOf(be)!==-1)return;if(J.dragNode&&be===J.state.dragOverNodeKey){var Re=Object(n.c)(Z,ue);if(Re===J.state.dropPosition)return;J.setState({dropPosition:Re})}$&&$({event:Z,node:Object(a.b)(ue.props)})},J.onNodeDragLeave=function(Z,ue){var X=J.props.onDragLeave;J.setState({dragOverNodeKey:""}),X&&X({event:Z,node:Object(a.b)(ue.props)})},J.onNodeDragEnd=function(Z,ue){var X=J.props.onDragEnd;J.setState({dragOverNodeKey:""}),J.cleanDragState(),X&&X({event:Z,node:Object(a.b)(ue.props)}),J.dragNode=null},J.onNodeDrop=function(Z,ue){var X=J.state,$=X.dragNodesKeys,be=$===void 0?[]:$,Re=X.dropPosition,Ie=J.props.onDrop,Le=ue.props,Fe=Le.eventKey,ye=Le.pos;if(J.setState({dragOverNodeKey:""}),J.cleanDragState(),be.indexOf(Fe)!==-1){Object(A.a)(!1,"Can not drop to dragNode(include it's children node)");return}var Te=Object(n.k)(ye),Ae={event:Z,node:Object(a.b)(ue.props),dragNode:J.dragNode?Object(a.b)(J.dragNode.props):null,dragNodesKeys:be.slice(),dropPosition:Re+Number(Te[Te.length-1]),dropToGap:!1};Re!==0&&(Ae.dropToGap=!0),Ie&&Ie(Ae),J.dragNode=null},J.cleanDragState=function(){var Z=J.state.dragging;Z&&J.setState({dragging:!1})},J.onNodeClick=function(Z,ue){var X=J.props.onClick;X&&X(Z,ue)},J.onNodeDoubleClick=function(Z,ue){var X=J.props.onDoubleClick;X&&X(Z,ue)},J.onNodeSelect=function(Z,ue){var X=J.state.selectedKeys,$=J.state.keyEntities,be=J.props,Re=be.onSelect,Ie=be.multiple,Le=ue.selected,Fe=ue.key,ye=!Le;ye?Ie?X=Object(n.a)(X,Fe):X=[Fe]:X=Object(n.b)(X,Fe);var Te=X.map(function(Ae){var Y=$[Ae];return Y?Y.node:null}).filter(function(Ae){return Ae});J.setUncontrolledState({selectedKeys:X}),Re&&Re(X,{event:"select",selected:ye,node:ue,selectedNodes:Te,nativeEvent:Z.nativeEvent})},J.onNodeCheck=function(Z,ue,X){var $=J.state,be=$.keyEntities,Re=$.checkedKeys,Ie=$.halfCheckedKeys,Le=J.props,Fe=Le.checkStrictly,ye=Le.onCheck,Te=ue.key,Ae,Y={event:"check",node:ue,checked:X,nativeEvent:Z.nativeEvent};if(Fe){var se=X?Object(n.a)(Re,Te):Object(n.b)(Re,Te),pe=Object(n.b)(Ie,Te);Ae={checked:se,halfChecked:pe},Y.checkedNodes=se.map(function(Se){return be[Se]}).filter(function(Se){return Se}).map(function(Se){return Se.node}),J.setUncontrolledState({checkedKeys:se})}else{var ve=Object(O.a)([].concat(Object(C.a)(Re),[Te]),!0,be),Me=ve.checkedKeys,he=ve.halfCheckedKeys;if(!X){var me=new Set(Me);me.delete(Te);var _e=Object(O.a)(Array.from(me),{checked:!1,halfCheckedKeys:he},be);Me=_e.checkedKeys,he=_e.halfCheckedKeys}Ae=Me,Y.checkedNodes=[],Y.checkedNodesPositions=[],Y.halfCheckedKeys=he,Me.forEach(function(Se){var Ce=be[Se];if(!Ce)return;var Oe=Ce.node,xe=Ce.pos;Y.checkedNodes.push(Oe),Y.checkedNodesPositions.push({node:Oe,pos:xe})}),J.setUncontrolledState({checkedKeys:Me},!1,{halfCheckedKeys:he})}ye&&ye(Ae,Y)},J.onNodeLoad=function(Z){return new Promise(function(ue){J.setState(function(X){var $=X.loadedKeys,be=$===void 0?[]:$,Re=X.loadingKeys,Ie=Re===void 0?[]:Re,Le=J.props,Fe=Le.loadData,ye=Le.onLoad,Te=Z.key;if(!Fe||be.indexOf(Te)!==-1||Ie.indexOf(Te)!==-1)return{};var Ae=Fe(Z);return Ae.then(function(){var Y=J.state,se=Y.loadedKeys,pe=Y.loadingKeys,ve=Object(n.a)(se,Te),Me=Object(n.b)(pe,Te);ye&&ye(ve,{event:"load",node:Z}),J.setUncontrolledState({loadedKeys:ve}),J.setState({loadingKeys:Me}),ue()}),{loadingKeys:Object(n.a)(Ie,Te)}})})},J.onNodeMouseEnter=function(Z,ue){var X=J.props.onMouseEnter;X&&X({event:Z,node:ue})},J.onNodeMouseLeave=function(Z,ue){var X=J.props.onMouseLeave;X&&X({event:Z,node:ue})},J.onNodeContextMenu=function(Z,ue){var X=J.props.onRightClick;X&&(Z.preventDefault(),X({event:Z,node:ue}))},J.onFocus=function(){var Z=J.props.onFocus;J.setState({focused:!0}),Z&&Z.apply(void 0,arguments)},J.onBlur=function(){var Z=J.props.onBlur;J.setState({focused:!1}),J.onActiveChange(null),Z&&Z.apply(void 0,arguments)},J.getTreeNodeRequiredProps=function(){var Z=J.state,ue=Z.expandedKeys,X=Z.selectedKeys,$=Z.loadedKeys,be=Z.loadingKeys,Re=Z.checkedKeys,Ie=Z.halfCheckedKeys,Le=Z.dragOverNodeKey,Fe=Z.dropPosition,ye=Z.keyEntities;return{expandedKeys:ue||[],selectedKeys:X||[],loadedKeys:$||[],loadingKeys:be||[],checkedKeys:Re||[],halfCheckedKeys:Ie||[],dragOverNodeKey:Le,dropPosition:Fe,keyEntities:ye}},J.setExpandedKeys=function(Z){var ue=J.state.treeData,X=Object(a.d)(ue,Z);J.setUncontrolledState({expandedKeys:Z,flattenNodes:X},!0)},J.onNodeExpand=function(Z,ue){var X=J.state.expandedKeys,$=J.state.listChanging,be=J.props,Re=be.onExpand,Ie=be.loadData,Le=ue.key,Fe=ue.expanded;if($)return;var ye=X.indexOf(Le),Te=!Fe;if(Object(A.a)(Fe&&ye!==-1||!Fe&&ye===-1,"Expand state not sync with index check"),Te?X=Object(n.a)(X,Le):X=Object(n.b)(X,Le),J.setExpandedKeys(X),Re&&Re(X,{node:ue,expanded:Te,nativeEvent:Z.nativeEvent}),Te&&Ie){var Ae=J.onNodeLoad(ue);Ae&&Ae.then(function(){var Y=Object(a.d)(J.state.treeData,X);J.setUncontrolledState({flattenNodes:Y})})}},J.onListChangeStart=function(){J.setUncontrolledState({listChanging:!0})},J.onListChangeEnd=function(){setTimeout(function(){J.setUncontrolledState({listChanging:!1})})},J.onActiveChange=function(Z){var ue=J.state.activeKey,X=J.props.onActiveChange;if(ue===Z)return;J.setState({activeKey:Z}),Z!==null&&J.scrollTo({key:Z}),X&&X(Z)},J.getActiveItem=function(){var Z=J.state,ue=Z.activeKey,X=Z.flattenNodes;return ue===null?null:X.find(function($){var be=$.data.key;return be===ue})||null},J.offsetActiveKey=function(Z){var ue=J.state,X=ue.flattenNodes,$=ue.activeKey,be=X.findIndex(function(Le){var Fe=Le.data.key;return Fe===$});be===-1&&Z<0&&(be=X.length),be=(be+Z+X.length)%X.length;var Re=X[be];if(Re){var Ie=Re.data.key;J.onActiveChange(Ie)}else J.onActiveChange(null)},J.onKeyDown=function(Z){var ue=J.state,X=ue.activeKey,$=ue.expandedKeys,be=ue.checkedKeys,Re=J.props,Ie=Re.onKeyDown,Le=Re.checkable,Fe=Re.selectable;switch(Z.which){case e.a.UP:{J.offsetActiveKey(-1),Z.preventDefault();break}case e.a.DOWN:{J.offsetActiveKey(1),Z.preventDefault();break}}var ye=J.getActiveItem();if(ye&&ye.data){var Te=J.getTreeNodeRequiredProps(),Ae=ye.data.isLeaf===!1||!!(ye.data.children||[]).length,Y=Object(a.b)(Object(H.a)(Object(H.a)({},Object(a.f)(X,Te)),{},{data:ye.data,active:!0}));switch(Z.which){case e.a.LEFT:{Ae&&$.includes(X)?J.onNodeExpand({},Y):ye.parent&&J.onActiveChange(ye.parent.data.key),Z.preventDefault();break}case e.a.RIGHT:{Ae&&!$.includes(X)?J.onNodeExpand({},Y):ye.children&&ye.children.length&&J.onActiveChange(ye.children[0].data.key),Z.preventDefault();break}case e.a.ENTER:case e.a.SPACE:{Le&&!Y.disabled&&Y.checkable!==!1&&!Y.disableCheckbox?J.onNodeCheck({},Y,!be.includes(X)):!Le&&Fe&&!Y.disabled&&Y.selectable!==!1&&J.onNodeSelect({},Y);break}}}Ie&&Ie(Z)},J.setUncontrolledState=function(Z){var ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,X=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(J.destroyed)return;var $=!1,be=!0,Re={};Object.keys(Z).forEach(function(Ie){if(Ie in J.props){be=!1;return}$=!0,Re[Ie]=Z[Ie]}),$&&(!ue||be)&&J.setState(Object(H.a)(Object(H.a)({},Re),X))},J.scrollTo=function(Z){J.listRef.current.scrollTo(Z)},J}return Object(L.a)(ce,[{key:"componentWillUnmount",value:function(){this.destroyed=!0}},{key:"render",value:function(){var Z,ue=this.state,X=ue.focused,$=ue.flattenNodes,be=ue.keyEntities,Re=ue.dragging,Ie=ue.activeKey,Le=this.props,Fe=Le.prefixCls,ye=Le.className,Te=Le.style,Ae=Le.showLine,Y=Le.focusable,se=Le.tabIndex,pe=se===void 0?0:se,ve=Le.selectable,Me=Le.showIcon,he=Le.icon,me=Le.switcherIcon,_e=Le.draggable,Se=Le.checkable,Ce=Le.checkStrictly,Oe=Le.disabled,xe=Le.motion,Ue=Le.loadData,Be=Le.filterTreeNode,Ee=Le.height,De=Le.itemHeight,de=Le.virtual,re=Le.titleRender,oe=Le.onContextMenu,V=Object(n.f)(this.props);return k.createElement(l.a.Provider,{value:{prefixCls:Fe,selectable:ve,showIcon:Me,icon:he,switcherIcon:me,draggable:_e,checkable:Se,checkStrictly:Ce,disabled:Oe,keyEntities:be,loadData:Ue,filterTreeNode:Be,titleRender:re,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}},k.createElement("div",{className:c()(Fe,ye,(Z={},Object(te.a)(Z,"".concat(Fe,"-show-line"),Ae),Object(te.a)(Z,"".concat(Fe,"-focused"),X),Object(te.a)(Z,"".concat(Fe,"-active-focused"),Ie!==null),Z))},k.createElement(U,Object.assign({ref:this.listRef,prefixCls:Fe,style:Te,data:$,disabled:Oe,selectable:ve,checkable:!!Se,motion:xe,dragging:Re,height:Ee,itemHeight:De,virtual:de,focusable:Y,focused:X,tabIndex:pe,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:oe},this.getTreeNodeRequiredProps(),V))))}}],[{key:"getDerivedStateFromProps",value:function(Z,ue){var X=ue.prevProps,$={prevProps:Z};function be(he){return!X&&he in Z||X&&X[he]!==Z[he]}var Re;if(be("treeData")?Re=Z.treeData:be("children")&&(Object(A.a)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),Re=Object(a.c)(Z.children)),Re){$.treeData=Re;var Ie=Object(a.a)(Re);$.keyEntities=Object(H.a)(Object(te.a)({},d,T),Ie.keyEntities)}var Le=$.keyEntities||ue.keyEntities;if(be("expandedKeys")||X&&be("autoExpandParent"))$.expandedKeys=Z.autoExpandParent||!X&&Z.defaultExpandParent?Object(n.e)(Z.expandedKeys,Le):Z.expandedKeys;else if(!X&&Z.defaultExpandAll){var Fe=Object(H.a)({},Le);delete Fe[d],$.expandedKeys=Object.keys(Fe).map(function(he){return Fe[he].key})}else!X&&Z.defaultExpandedKeys&&($.expandedKeys=Z.autoExpandParent||Z.defaultExpandParent?Object(n.e)(Z.defaultExpandedKeys,Le):Z.defaultExpandedKeys);if($.expandedKeys||delete $.expandedKeys,Re||$.expandedKeys){var ye=Object(a.d)(Re||ue.treeData,$.expandedKeys||ue.expandedKeys);$.flattenNodes=ye}if(Z.selectable&&(be("selectedKeys")?$.selectedKeys=Object(n.d)(Z.selectedKeys,Z):!X&&Z.defaultSelectedKeys&&($.selectedKeys=Object(n.d)(Z.defaultSelectedKeys,Z))),Z.checkable){var Te;if(be("checkedKeys")?Te=Object(n.j)(Z.checkedKeys)||{}:!X&&Z.defaultCheckedKeys?Te=Object(n.j)(Z.defaultCheckedKeys)||{}:Re&&(Te=Object(n.j)(Z.checkedKeys)||{checkedKeys:ue.checkedKeys,halfCheckedKeys:ue.halfCheckedKeys}),Te){var Ae=Te,Y=Ae.checkedKeys,se=Y===void 0?[]:Y,pe=Ae.halfCheckedKeys,ve=pe===void 0?[]:pe;if(!Z.checkStrictly){var Me=Object(O.a)(se,!0,Le);se=Me.checkedKeys,ve=Me.halfCheckedKeys}$.checkedKeys=se,$.halfCheckedKeys=ve}}return be("loadedKeys")&&($.loadedKeys=Z.loadedKeys),$}}]),ce}(k.Component);G.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:[]},G.TreeNode=t.a;var z=G,ae=le.b=z},fjLI:function(Qe,le,W){"use strict";W.d(le,"f",function(){return l}),W.d(le,"b",function(){return n}),W.d(le,"a",function(){return a}),W.d(le,"d",function(){return o}),W.d(le,"e",function(){return s}),W.d(le,"c",function(){return r});var te=W("8HAY"),H=W("Vhoy"),C=W("MI8n"),j=W("JYp7"),L=W("pmY6"),R=W("24hK"),B=W("nnTU"),k=W("T8No"),e=W("Cg/j"),A=W("t9D7"),g=function(i,t,y,p){var m=arguments.length,E=m<3?t:p===null?p=Object.getOwnPropertyDescriptor(t,y):p,_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(i,t,y,p);else for(var h=i.length-1;h>=0;h--)(_=i[h])&&(E=(m<3?_(E):m>3?_(t,y,E):_(t,y))||E);return m>3&&E&&Object.defineProperty(t,y,E),E},c=function(i,t){return function(y,p){t(y,p,i)}};function l(i){return i.command!==void 0}class n{constructor(i){this.id=n._idPool++,this._debugName=i}}n._idPool=0,n.CommandPalette=new n("CommandPalette"),n.EditorContext=new n("EditorContext"),n.SimpleEditorContext=new n("SimpleEditorContext"),n.EditorContextCopy=new n("EditorContextCopy"),n.EditorContextPeek=new n("EditorContextPeek"),n.MenubarEditMenu=new n("MenubarEditMenu"),n.MenubarCopy=new n("MenubarCopy"),n.MenubarGoMenu=new n("MenubarGoMenu"),n.MenubarSelectionMenu=new n("MenubarSelectionMenu"),n.InlineCompletionsActions=new n("InlineCompletionsActions");const a=Object(e.c)("menuService"),o=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new C.b,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:i=>i===n.CommandPalette}}addCommand(i){return this.addCommands(j.a.single(i))}addCommands(i){for(const t of i)this._commands.set(t.id,t);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),Object(L.i)(()=>{let t=!1;for(const y of i)t=this._commands.delete(y.id)||t;t&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(i){return this._commands.get(i)}getCommands(){const i=new Map;return this._commands.forEach((t,y)=>i.set(y,t)),i}appendMenuItem(i,t){return this.appendMenuItems(j.a.single({id:i,item:t}))}appendMenuItems(i){const t=new Set,y=new R.a;for(const{id:p,item:m}of i){let E=this._menuItems.get(p);E||(E=new R.a,this._menuItems.set(p,E)),y.push(E.push(m)),t.add(p)}return this._onDidChangeMenu.fire(t),Object(L.i)(()=>{if(y.size>0){for(let p of y)p();this._onDidChangeMenu.fire(t),y.clear()}})}getMenuItems(i){let t;return this._menuItems.has(i)?t=[...this._menuItems.get(i)]:t=[],i===n.CommandPalette&&this._appendImplicitItems(t),t}_appendImplicitItems(i){const t=new Set;for(const y of i)l(y)&&(t.add(y.command.id),y.alt&&t.add(y.alt.id));this._commands.forEach((y,p)=>{t.has(p)||i.push({command:y})})}};class s extends te.e{constructor(i,t,y,p){super(`submenuitem.${i.submenu.id}`,typeof i.title=="string"?i.title:i.title.value,[],"submenu");this.item=i,this._menuService=t,this._contextKeyService=y,this._options=p}get actions(){const i=[],t=this._menuService.createMenu(this.item.submenu,this._contextKeyService),y=t.getActions(this._options);t.dispose();for(const[,p]of y)p.length>0&&(i.push(...p),i.push(new te.d));return i.length&&i.pop(),i}}let r=class i{constructor(t,y,p,m,E){var _,h;if(this._commandService=E,this.id=t.id,this.label=(p==null?void 0:p.renderShortTitle)&&t.shortTitle?typeof t.shortTitle=="string"?t.shortTitle:t.shortTitle.value:typeof t.title=="string"?t.title:t.title.value,this.tooltip=(h=typeof t.tooltip=="string"?t.tooltip:(_=t.tooltip)===null||_===void 0?void 0:_.value)!==null&&h!==void 0?h:"",this.enabled=!t.precondition||m.contextMatchesRules(t.precondition),this.checked=void 0,t.toggled){const u=t.toggled.condition?t.toggled:{condition:t.toggled};this.checked=m.contextMatchesRules(u.condition),this.checked&&u.tooltip&&(this.tooltip=typeof u.tooltip=="string"?u.tooltip:u.tooltip.value),u.title&&(this.label=typeof u.title=="string"?u.title:u.title.value)}this.item=t,this.alt=y?new i(y,void 0,p,m,E):void 0,this._options=p,A.d.isThemeIcon(t.icon)&&(this.class=H.a.asClassName(t.icon))}dispose(){}run(...t){var y,p;let m=[];return((y=this._options)===null||y===void 0?void 0:y.arg)&&(m=[...m,this._options.arg]),((p=this._options)===null||p===void 0?void 0:p.shouldForwardArgs)&&(m=[...m,...t]),this._commandService.executeCommand(this.id,...m)}};r=g([c(3,k.b),c(4,B.b)],r)},ic2d:function(Qe,le,W){"use strict";W.d(le,"a",function(){return j});var te=W("FWmy"),H=W("746U");class C{constructor(){this.data=new Map}add(L,R){te.a(H.l(L)),te.a(H.k(R)),te.a(!this.data.has(L),"There is already an extension with this id"),this.data.set(L,R)}as(L){return this.data.get(L)||null}}const j=new C},nEHx:function(Qe,le,W){"use strict";W.d(le,"a",function(){return te});var te;(function(H){H.DARK="dark",H.LIGHT="light",H.HIGH_CONTRAST="hc"})(te||(te={}))},nnTU:function(Qe,le,W){"use strict";W.d(le,"b",function(){return B}),W.d(le,"a",function(){return k});var te=W("MI8n"),H=W("JYp7"),C=W("pmY6"),j=W("24hK"),L=W("746U"),R=W("Cg/j");const B=Object(R.c)("commandService"),k=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new te.b,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(e,A){if(!e)throw new Error("invalid command");if(typeof e=="string"){if(!A)throw new Error("invalid command");return this.registerCommand({id:e,handler:A})}if(e.description){const a=[];for(let s of e.description.args)a.push(s.constraint);const o=e.handler;e.handler=function(s,...r){return Object(L.o)(r,a),o(s,...r)}}const{id:g}=e;let c=this._commands.get(g);c||(c=new j.a,this._commands.set(g,c));let l=c.unshift(e),n=Object(C.i)(()=>{l();const a=this._commands.get(g);(a==null?void 0:a.isEmpty())&&this._commands.delete(g)});return this._onDidRegisterCommand.fire(g),n}registerCommandAlias(e,A){return k.registerCommand(e,(g,...c)=>g.get(B).executeCommand(A,...c))}getCommand(e){const A=this._commands.get(e);return!A||A.isEmpty()?void 0:H.a.first(A)}getCommands(){const e=new Map;for(const A of this._commands.keys()){const g=this.getCommand(A);g&&e.set(A,g)}return e}};k.registerCommand("noop",()=>{})},p5ED:function(Qe,le,W){"use strict";var te=W("+L6B"),H=W("2/Rp"),C=W("5Dmo"),j=W("3S7+"),L=W("k1fw"),R=W("tJVT"),B=W("q1tI"),k=W.n(B),e=W("vHTk"),A=W.n(e),g=W("yEEn"),c=W("ZW9T"),l=W("1vsH");le.a=function(n){var a=n.name,o=n.data,s=n.theme,r=n.type,i=n.filename,t=n.monacoEditor,y=n.className,p=n.style,m=n.close,E=n.onClose,_=n.hasMask,h=Object(B.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)(h,2),d=u[0],f=u[1],T=Object(B.useState)(""),b=Object(R.a)(T,2),S=b[0],D=b[1],I,w=1024*1024,P=10*w,U=Object(B.useRef)();r==="office"&&(I=Object(l.T)(o).filesize,I>P&&(r="other")),i&&(t.filename=i),Object(B.useEffect)(function(){var z,ae,ie=(z=document.cookie)===null||z===void 0||((ae=z.replace(/\s/g,""))===null||ae===void 0)?void 0:ae.split(";");ie==null||ie.map(function(fe){var ce=fe.split("=");ce[0]==="_educoder_session"&&D(ce[1])})},[]);var O=function(){if(o.startsWith("http")||o.startsWith("/")){G();return}Object(l.z)(i||"educoder",o,i)},G=function(){Object(l.x)(i||a,o)};return console.log("data:",o,"fileanme:",i," name:",a),k.a.createElement("div",{style:Object(L.a)({},p||{}),className:"".concat(_&&A.a.bgBlack," ").concat(r?A.a.wrp:"hide")},m&&k.a.createElement("div",{className:A.a.close,ref:U},k.a.createElement(j.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return U.current}},k.a.createElement("span",{onClick:G},k.a.createElement("i",{className:"icon-quxiaozhiding"}))),k.a.createElement(j.a,{title:"\u5173\u95ED",getPopupContainer:function(){return U.current}},k.a.createElement("span",{className:"",onClick:E},k.a.createElement("i",{className:"icon-guanbi1"})))),k.a.createElement("div",{className:"".concat(A.a[y]," ").concat(y," ").concat(A.a.monaco," ").concat(r==="txt"?"show":"hide")},r==="txt"&&k.a.createElement(c.b,t)),r==="audio"&&k.a.createElement("audio",{src:"".concat(o!=null&&o.startsWith("/")||(o==null?void 0:o.indexOf("https://"))>-1?o:"data:audio/mp3;base64,").concat(o),autoPlay:!0}),r==="video"&&k.a.createElement(k.a.Fragment,null,o!=null&&o.startsWith("/")?k.a.createElement("video",{controls:!0,src:"".concat(o),autoPlay:!0}):k.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(o),autoPlay:!0})),r==="html"&&k.a.createElement("iframe",{src:o+"&disposition=inline"}),r==="pdf"&&k.a.createElement("embed",{className:A.a.embed,src:o}),r==="image"&&k.a.createElement(k.a.Fragment,null,k.a.createElement("img",{src:"".concat(o!=null&&o.startsWith("/")||(o==null?void 0:o.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(o)})),r==="other"&&k.a.createElement("div",null,k.a.createElement(H.a,{type:"primary",size:"large",onClick:O},k.a.createElement(g.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),(r==="download"||r==="office")&&k.a.createElement(H.a,{type:"primary",size:"large",onClick:O},k.a.createElement(g.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},pmY6:function(Qe,le,W){"use strict";W.d(le,"h",function(){return A}),W.d(le,"g",function(){return c}),W.d(le,"f",function(){return l}),W.d(le,"e",function(){return n}),W.d(le,"i",function(){return a}),W.d(le,"b",function(){return o}),W.d(le,"a",function(){return s}),W.d(le,"d",function(){return r}),W.d(le,"c",function(){return i});var te=W("C/vA"),H=W("JYp7");const C=!1;let j=null;function L(t){j=t}if(C){const t="__is_disposable_tracked__";L(new class{trackDisposable(y){const p=new Error("Potentially leaked disposable").stack;setTimeout(()=>{y[t]||console.log(p)},3e3)}setParent(y,p){if(y&&y!==s.None)try{y[t]=!0}catch(m){}}markAsDisposed(y){if(y&&y!==s.None)try{y[t]=!0}catch(p){}}markAsSingleton(y){}})}function R(t){return j==null||j.trackDisposable(t),t}function B(t){j==null||j.markAsDisposed(t)}function k(t,y){j==null||j.setParent(t,y)}function e(t,y){if(!j)return;for(const p of t)j.setParent(p,y)}function A(t){return j==null||j.markAsSingleton(t),t}class g extends Error{constructor(t){super(`Encountered errors while disposing of store. Errors: [${t.join(", ")}]`);this.errors=t}}function c(t){return typeof t.dispose=="function"&&t.dispose.length===0}function l(t){if(H.a.is(t)){let y=[];for(const p of t)if(p)try{p.dispose()}catch(m){y.push(m)}if(y.length===1)throw y[0];if(y.length>1)throw new g(y);return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}function n(...t){const y=a(()=>l(t));return e(t,y),y}function a(t){const y=R({dispose:Object(te.a)(()=>{B(y),t()})});return y}class o{constructor(){this._toDispose=new Set,this._isDisposed=!1,R(this)}dispose(){if(this._isDisposed)return;B(this),this._isDisposed=!0,this.clear()}clear(){try{l(this._toDispose.values())}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return k(t,this),this._isDisposed?o.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(t),t}}o.DISABLE_DISPOSED_WARNING=!1;class s{constructor(){this._store=new o,R(this),k(this._store,this)}dispose(){B(this),this._store.dispose()}_register(t){if(t===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(t)}}s.None=Object.freeze({dispose(){}});class r{constructor(){this._isDisposed=!1,R(this)}get value(){return this._isDisposed?void 0:this._value}set value(t){var y;if(this._isDisposed||t===this._value)return;(y=this._value)===null||y===void 0||y.dispose(),t&&k(t,this),this._value=t}clear(){this.value=void 0}dispose(){var t;this._isDisposed=!0,B(this),(t=this._value)===null||t===void 0||t.dispose(),this._value=void 0}clearAndLeak(){const t=this._value;return this._value=void 0,t&&k(t,null),t}}class i{constructor(t){this.object=t}dispose(){}}},psGv:function(Qe,le,W){var te,H;(function(){var C;(function(){"use strict";var B=[,,function(g){function c(a){this.__parent=a,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=[]}c.prototype.clone_empty=function(){var a=new c(this.__parent);return a.set_indent(this.__indent_count,this.__alignment_count),a},c.prototype.item=function(a){return a<0?this.__items[this.__items.length+a]:this.__items[a]},c.prototype.has_match=function(a){for(var o=this.__items.length-1;o>=0;o--)if(this.__items[o].match(a))return!0;return!1},c.prototype.set_indent=function(a,o){this.is_empty()&&(this.__indent_count=a||0,this.__alignment_count=o||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},c.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)},c.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},c.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var a=this.__parent.current_line;return a.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),a.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),a.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,a.__items[0]===" "&&(a.__items.splice(0,1),a.__character_count-=1),!0}return!1},c.prototype.is_empty=function(){return this.__items.length===0},c.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},c.prototype.push=function(a){this.__items.push(a);var o=a.lastIndexOf(`
`);o!==-1?this.__character_count=a.length-o:this.__character_count+=a.length},c.prototype.pop=function(){var a=null;return this.is_empty()||(a=this.__items.pop(),this.__character_count-=a.length),a},c.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},c.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},c.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},c.prototype.toString=function(){var a="";return this.is_empty()?this.__parent.indent_empty_lines&&(a=this.__parent.get_indent_string(this.__indent_count)):(a=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),a+=this.__items.join("")),a};function l(a,o){this.__cache=[""],this.__indent_size=a.indent_size,this.__indent_string=a.indent_char,a.indent_with_tabs||(this.__indent_string=new Array(a.indent_size+1).join(a.indent_char)),o=o||"",a.indent_level>0&&(o=new Array(a.indent_level+1).join(this.__indent_string)),this.__base_string=o,this.__base_string_length=o.length}l.prototype.get_indent_size=function(a,o){var s=this.__base_string_length;return o=o||0,a<0&&(s=0),s+=a*this.__indent_size,s+=o,s},l.prototype.get_indent_string=function(a,o){var s=this.__base_string;return o=o||0,a<0&&(a=0,s=""),o+=a*this.__indent_size,this.__ensure_cache(o),s+=this.__cache[o],s},l.prototype.__ensure_cache=function(a){for(;a>=this.__cache.length;)this.__add_column()},l.prototype.__add_column=function(){var a=this.__cache.length,o=0,s="";this.__indent_size&&a>=this.__indent_size&&(o=Math.floor(a/this.__indent_size),a-=o*this.__indent_size,s=new Array(o+1).join(this.__indent_string)),a&&(s+=new Array(a+1).join(" ")),this.__cache.push(s)};function n(a,o){this.__indent_cache=new l(a,o),this.raw=!1,this._end_with_newline=a.end_with_newline,this.indent_size=a.indent_size,this.wrap_line_length=a.wrap_line_length,this.indent_empty_lines=a.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new c(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}n.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},n.prototype.get_line_number=function(){return this.__lines.length},n.prototype.get_indent_string=function(a,o){return this.__indent_cache.get_indent_string(a,o)},n.prototype.get_indent_size=function(a,o){return this.__indent_cache.get_indent_size(a,o)},n.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},n.prototype.add_new_line=function(a){return this.is_empty()||!a&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},n.prototype.get_code=function(a){this.trim(!0);var o=this.current_line.pop();o&&(o[o.length-1]===`
`&&(o=o.replace(/\n+$/g,"")),this.current_line.push(o)),this._end_with_newline&&this.__add_outputline();var s=this.__lines.join(`
`);return a!==`
`&&(s=s.replace(/[\n]/g,a)),s},n.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},n.prototype.set_indent=function(a,o){return a=a||0,o=o||0,this.next_line.set_indent(a,o),this.__lines.length>1?(this.current_line.set_indent(a,o),!0):(this.current_line.set_indent(),!1)},n.prototype.add_raw_token=function(a){for(var o=0;o<a.newlines;o++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(a.whitespace_before),this.current_line.push(a.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},n.prototype.add_token=function(a){this.__add_space_before_token(),this.current_line.push(a),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},n.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(" "))},n.prototype.remove_indent=function(a){for(var o=this.__lines.length;a<o;)this.__lines[a]._remove_indent(),a++;this.current_line._remove_wrap_indent()},n.prototype.trim=function(a){for(a=a===void 0?!1:a,this.current_line.trim();a&&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},n.prototype.just_added_newline=function(){return this.current_line.is_empty()},n.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},n.prototype.ensure_empty_line_above=function(a,o){for(var s=this.__lines.length-2;s>=0;){var r=this.__lines[s];if(r.is_empty())break;if(r.item(0).indexOf(a)!==0&&r.item(-1)!==o){this.__lines.splice(s+1,0,new c(this)),this.previous_line=this.__lines[this.__lines.length-2];break}s--}},g.exports.Output=n},function(g){function c(l,n,a,o){this.type=l,this.text=n,this.comments_before=null,this.newlines=a||0,this.whitespace_before=o||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}g.exports.Token=c},,,function(g){function c(a,o){this.raw_options=l(a,o),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"])}c.prototype._get_array=function(a,o){var s=this.raw_options[a],r=o||[];return typeof s=="object"?s!==null&&typeof s.concat=="function"&&(r=s.concat()):typeof s=="string"&&(r=s.split(/[^a-zA-Z0-9_\/\-]+/)),r},c.prototype._get_boolean=function(a,o){var s=this.raw_options[a],r=s===void 0?!!o:!!s;return r},c.prototype._get_characters=function(a,o){var s=this.raw_options[a],r=o||"";return typeof s=="string"&&(r=s.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),r},c.prototype._get_number=function(a,o){var s=this.raw_options[a];o=parseInt(o,10),isNaN(o)&&(o=0);var r=parseInt(s,10);return isNaN(r)&&(r=o),r},c.prototype._get_selection=function(a,o,s){var r=this._get_selection_list(a,o,s);if(r.length!==1)throw new Error("Invalid Option Value: The option '"+a+`' can only be one of the following values:
`+o+`
You passed in: '`+this.raw_options[a]+"'");return r[0]},c.prototype._get_selection_list=function(a,o,s){if(!o||o.length===0)throw new Error("Selection list cannot be empty.");if(s=s||[o[0]],!this._is_valid_selection(s,o))throw new Error("Invalid Default Value!");var r=this._get_array(a,s);if(!this._is_valid_selection(r,o))throw new Error("Invalid Option Value: The option '"+a+`' can contain only the following values:
`+o+`
You passed in: '`+this.raw_options[a]+"'");return r},c.prototype._is_valid_selection=function(a,o){return a.length&&o.length&&!a.some(function(s){return o.indexOf(s)===-1})};function l(a,o){var s={};a=n(a);var r;for(r in a)r!==o&&(s[r]=a[r]);if(o&&a[o])for(r in a[o])s[r]=a[o][r];return s}function n(a){var o={},s;for(s in a){var r=s.replace(/-/g,"_");o[r]=a[s]}return o}g.exports.Options=c,g.exports.normalizeOpts=n,g.exports.mergeOpts=l},,function(g){var c=RegExp.prototype.hasOwnProperty("sticky");function l(n){this.__input=n||"",this.__input_length=this.__input.length,this.__position=0}l.prototype.restart=function(){this.__position=0},l.prototype.back=function(){this.__position>0&&(this.__position-=1)},l.prototype.hasNext=function(){return this.__position<this.__input_length},l.prototype.next=function(){var n=null;return this.hasNext()&&(n=this.__input.charAt(this.__position),this.__position+=1),n},l.prototype.peek=function(n){var a=null;return n=n||0,n+=this.__position,n>=0&&n<this.__input_length&&(a=this.__input.charAt(n)),a},l.prototype.__match=function(n,a){n.lastIndex=a;var o=n.exec(this.__input);return o&&!(c&&n.sticky)&&(o.index!==a&&(o=null)),o},l.prototype.test=function(n,a){return a=a||0,a+=this.__position,a>=0&&a<this.__input_length?!!this.__match(n,a):!1},l.prototype.testChar=function(n,a){var o=this.peek(a);return n.lastIndex=0,o!==null&&n.test(o)},l.prototype.match=function(n){var a=this.__match(n,this.__position);return a?this.__position+=a[0].length:a=null,a},l.prototype.read=function(n,a,o){var s="",r;return n&&(r=this.match(n),r&&(s+=r[0])),a&&(r||!n)&&(s+=this.readUntil(a,o)),s},l.prototype.readUntil=function(n,a){var o="",s=this.__position;n.lastIndex=this.__position;var r=n.exec(this.__input);return r?(s=r.index,a&&(s+=r[0].length)):s=this.__input_length,o=this.__input.substring(this.__position,s),this.__position=s,o},l.prototype.readUntilAfter=function(n){return this.readUntil(n,!0)},l.prototype.get_regexp=function(n,a){var o=null,s="g";return a&&c&&(s="y"),typeof n=="string"&&n!==""?o=new RegExp(n,s):n&&(o=new RegExp(n.source,s)),o},l.prototype.get_literal_regexp=function(n){return RegExp(n.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},l.prototype.peekUntilAfter=function(n){var a=this.__position,o=this.readUntilAfter(n);return this.__position=a,o},l.prototype.lookBack=function(n){var a=this.__position-1;return a>=n.length&&this.__input.substring(a-n.length,a).toLowerCase()===n},g.exports.InputScanner=l},function(g,c,l){var n=l(8).InputScanner,a=l(3).Token,o=l(10).TokenStream,s=l(11).WhitespacePattern,r={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},i=function(t,y){this._input=new n(t),this._options=y||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new s(this._input)};i.prototype.tokenize=function(){this._input.restart(),this.__tokens=new o,this._reset();for(var t,y=new a(r.START,""),p=null,m=[],E=new o;y.type!==r.EOF;){for(t=this._get_next_token(y,p);this._is_comment(t);)E.add(t),t=this._get_next_token(y,p);E.isEmpty()||(t.comments_before=E,E=new o),t.parent=p,this._is_opening(t)?(m.push(p),p=t):p&&this._is_closing(t,p)&&(t.opened=p,p.closed=t,p=m.pop(),t.parent=p),t.previous=y,y.next=t,this.__tokens.add(t),y=t}return this.__tokens},i.prototype._is_first_token=function(){return this.__tokens.isEmpty()},i.prototype._reset=function(){},i.prototype._get_next_token=function(t,y){this._readWhitespace();var p=this._input.read(/.+/g);return p?this._create_token(r.RAW,p):this._create_token(r.EOF,"")},i.prototype._is_comment=function(t){return!1},i.prototype._is_opening=function(t){return!1},i.prototype._is_closing=function(t,y){return!1},i.prototype._create_token=function(t,y){var p=new a(t,y,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return p},i.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},g.exports.Tokenizer=i,g.exports.TOKEN=r},function(g){function c(l){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=l}c.prototype.restart=function(){this.__position=0},c.prototype.isEmpty=function(){return this.__tokens_length===0},c.prototype.hasNext=function(){return this.__position<this.__tokens_length},c.prototype.next=function(){var l=null;return this.hasNext()&&(l=this.__tokens[this.__position],this.__position+=1),l},c.prototype.peek=function(l){var n=null;return l=l||0,l+=this.__position,l>=0&&l<this.__tokens_length&&(n=this.__tokens[l]),n},c.prototype.add=function(l){this.__parent_token&&(l.parent=this.__parent_token),this.__tokens.push(l),this.__tokens_length+=1},g.exports.TokenStream=c},function(g,c,l){var n=l(12).Pattern;function a(o,s){n.call(this,o,s),s?this._line_regexp=this._input.get_regexp(s._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}a.prototype=new n,a.prototype.__set_whitespace_patterns=function(o,s){o+="\\t ",s+="\\n\\r",this._match_pattern=this._input.get_regexp("["+o+s+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+s+"]")},a.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var o=this._input.read(this._match_pattern);if(o===" ")this.whitespace_before_token=" ";else if(o){var s=this.__split(this._newline_regexp,o);this.newline_count=s.length-1,this.whitespace_before_token=s[this.newline_count]}return o},a.prototype.matching=function(o,s){var r=this._create();return r.__set_whitespace_patterns(o,s),r._update(),r},a.prototype._create=function(){return new a(this._input,this)},a.prototype.__split=function(o,s){o.lastIndex=0;for(var r=0,i=[],t=o.exec(s);t;)i.push(s.substring(r,t.index)),r=t.index+t[0].length,t=o.exec(s);return r<s.length?i.push(s.substring(r,s.length)):i.push(""),i},g.exports.WhitespacePattern=a},function(g){function c(l,n){this._input=l,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,n&&(this._starting_pattern=this._input.get_regexp(n._starting_pattern,!0),this._match_pattern=this._input.get_regexp(n._match_pattern,!0),this._until_pattern=this._input.get_regexp(n._until_pattern),this._until_after=n._until_after)}c.prototype.read=function(){var l=this._input.read(this._starting_pattern);return(!this._starting_pattern||l)&&(l+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),l},c.prototype.read_match=function(){return this._input.match(this._match_pattern)},c.prototype.until_after=function(l){var n=this._create();return n._until_after=!0,n._until_pattern=this._input.get_regexp(l),n._update(),n},c.prototype.until=function(l){var n=this._create();return n._until_after=!1,n._until_pattern=this._input.get_regexp(l),n._update(),n},c.prototype.starting_with=function(l){var n=this._create();return n._starting_pattern=this._input.get_regexp(l,!0),n._update(),n},c.prototype.matching=function(l){var n=this._create();return n._match_pattern=this._input.get_regexp(l,!0),n._update(),n},c.prototype._create=function(){return new c(this._input,this)},c.prototype._update=function(){},g.exports.Pattern=c},function(g){function c(l,n){l=typeof l=="string"?l:l.source,n=typeof n=="string"?n:n.source,this.__directives_block_pattern=new RegExp(l+/ beautify( \w+[:]\w+)+ /.source+n,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(l+/\sbeautify\signore:end\s/.source+n,"g")}c.prototype.get_directives=function(l){if(!l.match(this.__directives_block_pattern))return null;var n={};this.__directive_pattern.lastIndex=0;for(var a=this.__directive_pattern.exec(l);a;)n[a[1]]=a[2],a=this.__directive_pattern.exec(l);return n},c.prototype.readIgnored=function(l){return l.readUntilAfter(this.__directives_end_ignore_pattern)},g.exports.Directives=c},function(g,c,l){var n=l(12).Pattern,a={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function o(s,r){n.call(this,s,r),this.__template_pattern=null,this._disabled=Object.assign({},a),this._excluded=Object.assign({},a),r&&(this.__template_pattern=this._input.get_regexp(r.__template_pattern),this._excluded=Object.assign(this._excluded,r._excluded),this._disabled=Object.assign(this._disabled,r._disabled));var i=new n(s);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}/)}}o.prototype=new n,o.prototype._create=function(){return new o(this._input,this)},o.prototype._update=function(){this.__set_templated_pattern()},o.prototype.disable=function(s){var r=this._create();return r._disabled[s]=!0,r._update(),r},o.prototype.read_options=function(s){var r=this._create();for(var i in a)r._disabled[i]=s.templating.indexOf(i)===-1;return r._update(),r},o.prototype.exclude=function(s){var r=this._create();return r._excluded[s]=!0,r._update(),r},o.prototype.read=function(){var s="";this._match_pattern?s=this._input.read(this._starting_pattern):s=this._input.read(this._starting_pattern,this.__template_pattern);for(var r=this._read_template();r;)this._match_pattern?r+=this._input.read(this._match_pattern):r+=this._input.readUntil(this.__template_pattern),s+=r,r=this._read_template();return this._until_after&&(s+=this._input.readUntilAfter(this._until_pattern)),s},o.prototype.__set_templated_pattern=function(){var s=[];this._disabled.php||s.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||s.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||s.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(s.push(this.__patterns.django._starting_pattern.source),s.push(this.__patterns.django_value._starting_pattern.source),s.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||s.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&s.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+s.join("|")+")")},o.prototype._read_template=function(){var s="",r=this._input.peek();if(r==="<"){var i=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&i==="?"&&(s=s||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&i==="%"&&(s=s||this.__patterns.erb.read())}else r==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(s=s||this.__patterns.handlebars_comment.read(),s=s||this.__patterns.handlebars_unescaped.read(),s=s||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(s=s||this.__patterns.django_value.read()),this._excluded.django||(s=s||this.__patterns.django_comment.read(),s=s||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(s=s||this.__patterns.smarty_comment.read(),s=s||this.__patterns.smarty_literal.read(),s=s||this.__patterns.smarty.read()));return s},g.exports.TemplatablePattern=o},,,,function(g,c,l){var n=l(19).Beautifier,a=l(20).Options;function o(s,r,i,t){var y=new n(s,r,i,t);return y.beautify()}g.exports=o,g.exports.defaultOptions=function(){return new a}},function(g,c,l){var n=l(20).Options,a=l(2).Output,o=l(21).Tokenizer,s=l(21).TOKEN,r=/\r\n|[\r\n]/,i=/\r\n|[\r\n]/g,t=function(T,b){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=T.max_preserve_newlines,this.preserve_newlines=T.preserve_newlines,this._output=new a(T,b)};t.prototype.current_line_has_match=function(T){return this._output.current_line.has_match(T)},t.prototype.set_space_before_token=function(T,b){this._output.space_before_token=T,this._output.non_breaking_space=b},t.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},t.prototype.add_raw_token=function(T){this._output.add_raw_token(T)},t.prototype.print_preserved_newlines=function(T){var b=0;T.type!==s.TEXT&&T.previous.type!==s.TEXT&&(b=T.newlines?1:0),this.preserve_newlines&&(b=T.newlines<this.max_preserve_newlines+1?T.newlines:this.max_preserve_newlines+1);for(var S=0;S<b;S++)this.print_newline(S>0);return b!==0},t.prototype.traverse_whitespace=function(T){return T.whitespace_before||T.newlines?(this.print_preserved_newlines(T)||(this._output.space_before_token=!0),!0):!1},t.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},t.prototype.print_newline=function(T){this._output.add_new_line(T)},t.prototype.print_token=function(T){T.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(T.text))},t.prototype.indent=function(){this.indent_level++},t.prototype.get_full_indent=function(T){return T=this.indent_level+(T||0),T<1?"":this._output.get_indent_string(T)};var y=function(T){for(var b=null,S=T.next;S.type!==s.EOF&&T.closed!==S;){if(S.type===s.ATTRIBUTE&&S.text==="type"){S.next&&S.next.type===s.EQUALS&&S.next.next&&S.next.next.type===s.VALUE&&(b=S.next.next.text);break}S=S.next}return b},p=function(T,b){var S=null,D=null;return b.closed?(T==="script"?S="text/javascript":T==="style"&&(S="text/css"),S=y(b)||S,S.search("text/css")>-1?D="css":S.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?D="javascript":S.search(/(text|application|dojo)\/(x-)?(html)/)>-1?D="html":S.search(/test\/null/)>-1&&(D="null"),D):null};function m(T,b){return b.indexOf(T)!==-1}function E(T,b,S){this.parent=T||null,this.tag=b?b.tag_name:"",this.indent_level=S||0,this.parser_token=b||null}function _(T){this._printer=T,this._current_frame=null}_.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},_.prototype.record_tag=function(T){var b=new E(this._current_frame,T,this._printer.indent_level);this._current_frame=b},_.prototype._try_pop_frame=function(T){var b=null;return T&&(b=T.parser_token,this._printer.indent_level=T.indent_level,this._current_frame=T.parent),b},_.prototype._get_frame=function(T,b){for(var S=this._current_frame;S&&!(T.indexOf(S.tag)!==-1);){if(b&&b.indexOf(S.tag)!==-1){S=null;break}S=S.parent}return S},_.prototype.try_pop=function(T,b){var S=this._get_frame([T],b);return this._try_pop_frame(S)},_.prototype.indent_to_tag=function(T){var b=this._get_frame(T);b&&(this._printer.indent_level=b.indent_level)};function h(T,b,S,D){this._source_text=T||"",b=b||{},this._js_beautify=S,this._css_beautify=D,this._tag_stack=null;var I=new n(b,"html");this._options=I,this._is_wrap_attributes_force=this._options.wrap_attributes.substr(0,"force".length)==="force",this._is_wrap_attributes_force_expand_multiline=this._options.wrap_attributes==="force-expand-multiline",this._is_wrap_attributes_force_aligned=this._options.wrap_attributes==="force-aligned",this._is_wrap_attributes_aligned_multiple=this._options.wrap_attributes==="aligned-multiple",this._is_wrap_attributes_preserve=this._options.wrap_attributes.substr(0,"preserve".length)==="preserve",this._is_wrap_attributes_preserve_aligned=this._options.wrap_attributes==="preserve-aligned"}h.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var T=this._source_text,b=this._options.eol;this._options.eol==="auto"&&(b=`
`,T&&r.test(T)&&(b=T.match(r)[0])),T=T.replace(i,`
`);var S=T.match(/^[\t ]*/)[0],D={text:"",type:""},I=new u,w=new t(this._options,S),P=new o(T,this._options).tokenize();this._tag_stack=new _(w);for(var U=null,O=P.next();O.type!==s.EOF;)O.type===s.TAG_OPEN||O.type===s.COMMENT?(U=this._handle_tag_open(w,O,I,D),I=U):O.type===s.ATTRIBUTE||O.type===s.EQUALS||O.type===s.VALUE||O.type===s.TEXT&&!I.tag_complete?U=this._handle_inside_tag(w,O,I,P):O.type===s.TAG_CLOSE?U=this._handle_tag_close(w,O,I):O.type===s.TEXT?U=this._handle_text(w,O,I):w.add_raw_token(O),D=U,O=P.next();var G=w._output.get_code(b);return G},h.prototype._handle_tag_close=function(T,b,S){var D={text:b.text,type:b.type};return T.alignment_size=0,S.tag_complete=!0,T.set_space_before_token(b.newlines||b.whitespace_before!=="",!0),S.is_unformatted?T.add_raw_token(b):(S.tag_start_char==="<"&&(T.set_space_before_token(b.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&S.has_wrapped_attrs&&T.print_newline(!1)),T.print_token(b)),S.indent_content&&!(S.is_unformatted||S.is_content_unformatted)&&(T.indent(),S.indent_content=!1),!S.is_inline_element&&!(S.is_unformatted||S.is_content_unformatted)&&T.set_wrap_point(),D},h.prototype._handle_inside_tag=function(T,b,S,D){var I=S.has_wrapped_attrs,w={text:b.text,type:b.type};if(T.set_space_before_token(b.newlines||b.whitespace_before!=="",!0),S.is_unformatted)T.add_raw_token(b);else if(S.tag_start_char==="{"&&b.type===s.TEXT)T.print_preserved_newlines(b)?(b.newlines=0,T.add_raw_token(b)):T.print_token(b);else{if(b.type===s.ATTRIBUTE?(T.set_space_before_token(!0),S.attr_count+=1):(b.type===s.EQUALS||b.type===s.VALUE&&b.previous.type===s.EQUALS)&&T.set_space_before_token(!1),b.type===s.ATTRIBUTE&&S.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(T.traverse_whitespace(b),I=I||b.newlines!==0),this._is_wrap_attributes_force)){var P=S.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&S.attr_count===1){var U=!0,O=0,G;do{if(G=D.peek(O),G.type===s.ATTRIBUTE){U=!1;break}O+=1}while(O<4&&G.type!==s.EOF&&G.type!==s.TAG_CLOSE);P=!U}P&&(T.print_newline(!1),I=!0)}T.print_token(b),I=I||T.previous_token_wrapped(),S.has_wrapped_attrs=I}return w},h.prototype._handle_text=function(T,b,S){var D={text:b.text,type:"TK_CONTENT"};return S.custom_beautifier_name?this._print_custom_beatifier_text(T,b,S):S.is_unformatted||S.is_content_unformatted?T.add_raw_token(b):(T.traverse_whitespace(b),T.print_token(b)),D},h.prototype._print_custom_beatifier_text=function(T,b,S){var D=this;if(b.text!==""){var I=b.text,w,P=1,U="",O="";S.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?w=this._js_beautify:S.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?w=this._css_beautify:S.custom_beautifier_name==="html"&&(w=function(ce,J){var Z=new h(ce,J,D._js_beautify,D._css_beautify);return Z.beautify()}),this._options.indent_scripts==="keep"?P=0:this._options.indent_scripts==="separate"&&(P=-T.indent_level);var G=T.get_full_indent(P);if(I=I.replace(/\n[ \t]*$/,""),S.custom_beautifier_name!=="html"&&I[0]==="<"&&I.match(/^(<!--|<!\[CDATA\[)/)){var z=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(I);if(!z){T.add_raw_token(b);return}U=G+z[1]+`
`,I=z[4],z[5]&&(O=G+z[5]),I=I.replace(/\n[ \t]*$/,""),(z[2]||z[3].indexOf(`
`)!==-1)&&(z=z[3].match(/[ \t]+$/),z&&(b.whitespace_before=z[0]))}if(I)if(w){var ae=function(){this.eol=`
`};ae.prototype=this._options.raw_options;var ie=new ae;I=w(G+I,ie)}else{var fe=b.whitespace_before;fe&&(I=I.replace(new RegExp(`
(`+fe+")?","g"),`
`)),I=G+I.replace(/\n/g,`
`+G)}U&&(I?I=U+I+`
`+O:I=U+O),T.print_newline(!1),I&&(b.text=I,b.whitespace_before="",b.newlines=0,T.add_raw_token(b),T.print_newline(!0))}},h.prototype._handle_tag_open=function(T,b,S,D){var I=this._get_tag_open_token(b);return(S.is_unformatted||S.is_content_unformatted)&&!S.is_empty_element&&b.type===s.TAG_OPEN&&b.text.indexOf("</")===0?(T.add_raw_token(b),I.start_tag_token=this._tag_stack.try_pop(I.tag_name)):(T.traverse_whitespace(b),this._set_tag_position(T,b,I,S,D),I.is_inline_element||T.set_wrap_point(),T.print_token(b)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(I.alignment_size=b.text.length+1),!I.tag_complete&&!I.is_unformatted&&(T.alignment_size=I.alignment_size),I};var u=function(T,b){if(this.parent=T||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="",!b)this.tag_complete=!0;else{var S;this.tag_start_char=b.text[0],this.text=b.text,this.tag_start_char==="<"?(S=b.text.match(/^<([^\s>]*)/),this.tag_check=S?S[1]:""):(S=b.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=S?S[1]:"",(b.text.startsWith("{{#>")||b.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&b.next!==null?this.tag_check=b.next.text.split(" ")[0]:this.tag_check=b.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),b.type===s.COMMENT&&(this.tag_complete=!0),this.is_start_tag=this.tag_check.charAt(0)!=="/",this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||b.closed&&b.closed.text==="/>";var D=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(D=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(D)))}};h.prototype._get_tag_open_token=function(T){var b=new u(this._tag_stack.get_parser_token(),T);return b.alignment_size=this._options.wrap_attributes_indent_size,b.is_end_tag=b.is_end_tag||m(b.tag_check,this._options.void_elements),b.is_empty_element=b.tag_complete||b.is_start_tag&&b.is_end_tag,b.is_unformatted=!b.tag_complete&&m(b.tag_check,this._options.unformatted),b.is_content_unformatted=!b.is_empty_element&&m(b.tag_check,this._options.content_unformatted),b.is_inline_element=m(b.tag_name,this._options.inline)||b.tag_name.includes("-")||b.tag_start_char==="{",b},h.prototype._set_tag_position=function(T,b,S,D,I){if(S.is_empty_element||(S.is_end_tag?S.start_tag_token=this._tag_stack.try_pop(S.tag_name):(this._do_optional_end_element(S)&&(S.is_inline_element||T.print_newline(!1)),this._tag_stack.record_tag(S),(S.tag_name==="script"||S.tag_name==="style")&&!(S.is_unformatted||S.is_content_unformatted)&&(S.custom_beautifier_name=p(S.tag_check,b)))),m(S.tag_check,this._options.extra_liners)&&(T.print_newline(!1),T._output.just_added_blankline()||T.print_newline(!0)),S.is_empty_element){if(S.tag_start_char==="{"&&S.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),S.indent_content=!0;var w=T.current_line_has_match(/{{#if/);w||T.print_newline(!1)}S.tag_name==="!--"&&I.type===s.TAG_CLOSE&&D.is_end_tag&&S.text.indexOf(`
`)===-1||(S.is_inline_element||S.is_unformatted||T.print_newline(!1),this._calcluate_parent_multiline(T,S))}else if(S.is_end_tag){var P=!1;P=S.start_tag_token&&S.start_tag_token.multiline_content,P=P||!S.is_inline_element&&!(D.is_inline_element||D.is_unformatted)&&!(I.type===s.TAG_CLOSE&&S.start_tag_token===D)&&I.type!=="TK_CONTENT",(S.is_content_unformatted||S.is_unformatted)&&(P=!1),P&&T.print_newline(!1)}else S.indent_content=!S.custom_beautifier_name,S.tag_start_char==="<"&&(S.tag_name==="html"?S.indent_content=this._options.indent_inner_html:S.tag_name==="head"?S.indent_content=this._options.indent_head_inner_html:S.tag_name==="body"&&(S.indent_content=this._options.indent_body_inner_html)),!(S.is_inline_element||S.is_unformatted)&&(I.type!=="TK_CONTENT"||S.is_content_unformatted)&&T.print_newline(!1),this._calcluate_parent_multiline(T,S)},h.prototype._calcluate_parent_multiline=function(T,b){b.parent&&T._output.just_added_newline()&&!((b.is_inline_element||b.is_unformatted)&&b.parent.is_inline_element)&&(b.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"],f=["a","audio","del","ins","map","noscript","video"];h.prototype._do_optional_end_element=function(T){var b=null;if(T.is_empty_element||!T.is_start_tag||!T.parent)return;if(T.tag_name==="body")b=b||this._tag_stack.try_pop("head");else if(T.tag_name==="li")b=b||this._tag_stack.try_pop("li",["ol","ul"]);else if(T.tag_name==="dd"||T.tag_name==="dt")b=b||this._tag_stack.try_pop("dt",["dl"]),b=b||this._tag_stack.try_pop("dd",["dl"]);else if(T.parent.tag_name==="p"&&d.indexOf(T.tag_name)!==-1){var S=T.parent.parent;(!S||f.indexOf(S.tag_name)===-1)&&(b=b||this._tag_stack.try_pop("p"))}else T.tag_name==="rp"||T.tag_name==="rt"?(b=b||this._tag_stack.try_pop("rt",["ruby","rtc"]),b=b||this._tag_stack.try_pop("rp",["ruby","rtc"])):T.tag_name==="optgroup"?b=b||this._tag_stack.try_pop("optgroup",["select"]):T.tag_name==="option"?b=b||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):T.tag_name==="colgroup"?b=b||this._tag_stack.try_pop("caption",["table"]):T.tag_name==="thead"?(b=b||this._tag_stack.try_pop("caption",["table"]),b=b||this._tag_stack.try_pop("colgroup",["table"])):T.tag_name==="tbody"||T.tag_name==="tfoot"?(b=b||this._tag_stack.try_pop("caption",["table"]),b=b||this._tag_stack.try_pop("colgroup",["table"]),b=b||this._tag_stack.try_pop("thead",["table"]),b=b||this._tag_stack.try_pop("tbody",["table"])):T.tag_name==="tr"?(b=b||this._tag_stack.try_pop("caption",["table"]),b=b||this._tag_stack.try_pop("colgroup",["table"]),b=b||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(T.tag_name==="th"||T.tag_name==="td")&&(b=b||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),b=b||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return T.parent=this._tag_stack.get_parser_token(),b},g.exports.Beautifier=h},function(g,c,l){var n=l(6).Options;function a(o){n.call(this,o,"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"])}a.prototype=new n,g.exports.Options=a},function(g,c,l){var n=l(9).Tokenizer,a=l(9).TOKEN,o=l(13).Directives,s=l(14).TemplatablePattern,r=l(12).Pattern,i={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:a.START,RAW:a.RAW,EOF:a.EOF},t=new o(/<\!--/,/-->/),y=function(p,m){n.call(this,p,m),this._current_tag_name="";var E=new s(this._input).read_options(this._options),_=new r(this._input);if(this.__patterns={word:E.until(/[\n\r\t <]/),single_quote:E.until_after(/'/),double_quote:E.until_after(/"/),attribute:E.until(/[\n\r\t =>]|\/>/),element_name:E.until(/[\n\r\t >\/]/),handlebars_comment:_.starting_with(/{{!--/).until_after(/--}}/),handlebars:_.starting_with(/{{/).until_after(/}}/),handlebars_open:_.until(/[\n\r\t }]/),handlebars_raw_close:_.until(/}}/),comment:_.starting_with(/<!--/).until_after(/-->/),cdata:_.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:_.starting_with(/<!\[/).until_after(/]>/),processing:_.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 h=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=_.matching(h).until_after(h)}};y.prototype=new n,y.prototype._is_comment=function(p){return!1},y.prototype._is_opening=function(p){return p.type===i.TAG_OPEN},y.prototype._is_closing=function(p,m){return p.type===i.TAG_CLOSE&&m&&((p.text===">"||p.text==="/>")&&m.text[0]==="<"||p.text==="}}"&&m.text[0]==="{"&&m.text[1]==="{")},y.prototype._reset=function(){this._current_tag_name=""},y.prototype._get_next_token=function(p,m){var E=null;this._readWhitespace();var _=this._input.peek();return _===null?this._create_token(i.EOF,""):(E=E||this._read_open_handlebars(_,m),E=E||this._read_attribute(_,p,m),E=E||this._read_close(_,m),E=E||this._read_raw_content(_,p,m),E=E||this._read_content_word(_),E=E||this._read_comment_or_cdata(_),E=E||this._read_processing(_),E=E||this._read_open(_,m),E=E||this._create_token(i.UNKNOWN,this._input.next()),E)},y.prototype._read_comment_or_cdata=function(p){var m=null,E=null,_=null;if(p==="<"){var h=this._input.peek(1);h==="!"&&(E=this.__patterns.comment.read(),E?(_=t.get_directives(E),_&&_.ignore==="start"&&(E+=t.readIgnored(this._input))):E=this.__patterns.cdata.read()),E&&(m=this._create_token(i.COMMENT,E),m.directives=_)}return m},y.prototype._read_processing=function(p){var m=null,E=null,_=null;if(p==="<"){var h=this._input.peek(1);(h==="!"||h==="?")&&(E=this.__patterns.conditional_comment.read(),E=E||this.__patterns.processing.read()),E&&(m=this._create_token(i.COMMENT,E),m.directives=_)}return m},y.prototype._read_open=function(p,m){var E=null,_=null;return m||p==="<"&&(E=this._input.next(),this._input.peek()==="/"&&(E+=this._input.next()),E+=this.__patterns.element_name.read(),_=this._create_token(i.TAG_OPEN,E)),_},y.prototype._read_open_handlebars=function(p,m){var E=null,_=null;return m||this._options.indent_handlebars&&p==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(E=this.__patterns.handlebars_comment.read(),E=E||this.__patterns.handlebars.read(),_=this._create_token(i.COMMENT,E)):(E=this.__patterns.handlebars_open.read(),_=this._create_token(i.TAG_OPEN,E))),_},y.prototype._read_close=function(p,m){var E=null,_=null;return m&&(m.text[0]==="<"&&(p===">"||p==="/"&&this._input.peek(1)===">")?(E=this._input.next(),p==="/"&&(E+=this._input.next()),_=this._create_token(i.TAG_CLOSE,E)):m.text[0]==="{"&&p==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),_=this._create_token(i.TAG_CLOSE,"}}"))),_},y.prototype._read_attribute=function(p,m,E){var _=null,h="";if(E&&E.text[0]==="<")if(p==="=")_=this._create_token(i.EQUALS,this._input.next());else if(p==='"'||p==="'"){var u=this._input.next();p==='"'?u+=this.__patterns.double_quote.read():u+=this.__patterns.single_quote.read(),_=this._create_token(i.VALUE,u)}else h=this.__patterns.attribute.read(),h&&(m.type===i.EQUALS?_=this._create_token(i.VALUE,h):_=this._create_token(i.ATTRIBUTE,h));return _},y.prototype._is_content_unformatted=function(p){return this._options.void_elements.indexOf(p)===-1&&(this._options.content_unformatted.indexOf(p)!==-1||this._options.unformatted.indexOf(p)!==-1)},y.prototype._read_raw_content=function(p,m,E){var _="";if(E&&E.text[0]==="{")_=this.__patterns.handlebars_raw_close.read();else if(m.type===i.TAG_CLOSE&&m.opened.text[0]==="<"&&m.text[0]!=="/"){var h=m.opened.text.substr(1).toLowerCase();if(h==="script"||h==="style"){var u=this._read_comment_or_cdata(p);if(u)return u.type=i.TEXT,u;_=this._input.readUntil(new RegExp("</"+h+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(h)&&(_=this._input.readUntil(new RegExp("</"+h+"[\\n\\r\\t ]*?>","ig")))}return _?this._create_token(i.TEXT,_):null},y.prototype._read_content_word=function(p){var m="";if(this._options.unformatted_content_delimiter&&(p===this._options.unformatted_content_delimiter[0]&&(m=this.__patterns.unformatted_content_delimiter.read())),m||(m=this.__patterns.word.read()),m)return this._create_token(i.TEXT,m)},g.exports.Tokenizer=y,g.exports.TOKEN=i}],k={};function e(g){var c=k[g];if(c!==void 0)return c.exports;var l=k[g]={exports:{}};return B[g](l,l.exports,e),l.exports}var A=e(18);C=A})();var j=C;if(!0)!(te=[W,W("6UM0"),W("TXwP")],H=function(B){var k=W("6UM0"),e=W("TXwP");return{html_beautify:function(A,g){return j(A,g,k.js_beautify,e.css_beautify)}}}.apply(le,te),H!==void 0&&(Qe.exports=H));else var L,R})()},"rAM+":function(Qe,le,W){"use strict";W.d(le,"a",function(){return H});var te=W("Qw5x");function H(C,j){var L;if(typeof Symbol=="undefined"||C[Symbol.iterator]==null){if(Array.isArray(C)||(L=Object(te.a)(C))||j&&C&&typeof C.length=="number"){L&&(C=L);var R=0,B=function(){};return{s:B,n:function(){return R>=C.length?{done:!0}:{done:!1,value:C[R++]}},e:function(c){throw c},f:B}}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 k=!0,e=!1,A;return{s:function(){L=C[Symbol.iterator]()},n:function(){var c=L.next();return k=c.done,c},e:function(c){e=!0,A=c},f:function(){try{!k&&L.return!=null&&L.return()}finally{if(e)throw A}}}}},rUJ1:function(Qe,le){const W=/[&<>"']/,te=/[&<>"']/g,H=/[<>"']|&(?!#?\w+;)/,C=/[<>"']|&(?!#?\w+;)/g,j={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},L=_=>j[_];function R(_,h){if(h){if(W.test(_))return _.replace(te,L)}else if(H.test(_))return _.replace(C,L);return _}const B=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function k(_){return _.replace(B,(h,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 e=/(^|[^\[])\^/g;function A(_,h){_=_.source||_,h=h||"";const u={replace:(d,f)=>(f=f.source||f,f=f.replace(e,"$1"),_=_.replace(d,f),u),getRegex:()=>new RegExp(_,h)};return u}const g=/[^\w:]/g,c=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function l(_,h,u){if(_){let d;try{d=decodeURIComponent(k(u)).replace(g,"").toLowerCase()}catch(f){return null}if(d.indexOf("javascript:")===0||d.indexOf("vbscript:")===0||d.indexOf("data:")===0)return null}h&&!c.test(u)&&(u=r(h,u));try{u=encodeURI(u).replace(/%25/g,"%")}catch(d){return null}return u}const n={},a=/^[^:]+:\/*[^/]*$/,o=/^([^:]+:)[\s\S]*$/,s=/^([^:]+:\/*[^/]*)[\s\S]*$/;function r(_,h){n[" "+_]||(a.test(_)?n[" "+_]=_+"/":n[" "+_]=p(_,"/",!0)),_=n[" "+_];const u=_.indexOf(":")===-1;return h.substring(0,2)==="//"?u?h:_.replace(o,"$1")+h:h.charAt(0)==="/"?u?h:_.replace(s,"$1")+h:_+h}const i={exec:function(){}};function t(_){let h=1,u,d;for(;h<arguments.length;h++){u=arguments[h];for(d in u)Object.prototype.hasOwnProperty.call(u,d)&&(_[d]=u[d])}return _}function y(_,h){const u=_.replace(/\|/g,(T,b,S)=>{let D=!1,I=b;for(;--I>=0&&S[I]==="\\";)D=!D;return D?"|":" |"}),d=u.split(/ \|/);let f=0;if(d.length>h)d.splice(h);else for(;d.length<h;)d.push("");for(;f<d.length;f++)d[f]=d[f].trim().replace(/\\\|/g,"|");return d}function p(_,h,u){const d=_.length;if(d===0)return"";let f=0;for(;f<d;){const T=_.charAt(d-f-1);if(T===h&&!u)f++;else if(T!==h&&u)f++;else break}return _.substr(0,d-f)}function m(_,h){if(_.indexOf(h[1])===-1)return-1;const u=_.length;let d=0,f=0;for(;f<u;f++)if(_[f]==="\\")f++;else if(_[f]===h[0])d++;else if(_[f]===h[1]&&(d--,d<0))return f;return-1}function E(_){_&&_.sanitize&&!_.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")}Qe.exports={escape:R,unescape:k,edit:A,cleanUrl:l,resolveUrl:r,noopTest:i,merge:t,splitCells:y,rtrim:p,findClosingBracket:m,checkSanitizeDeprecation:E}},sboe:function(Qe,le,W){"use strict";W.d(le,"a",function(){return C});var te=W("q1tI"),H=W.n(te),C=te.createContext(null)},t9D7:function(Qe,le,W){"use strict";W.d(le,"b",function(){return B}),W.d(le,"g",function(){return e}),W.d(le,"d",function(){return A}),W.d(le,"e",function(){return g}),W.d(le,"a",function(){return c}),W.d(le,"f",function(){return a}),W.d(le,"c",function(){return o});var te=W("Vhoy"),H=W("MI8n"),C=W("pmY6"),j=W("Cg/j"),L=W("ic2d"),R=W("nEHx");const B=Object(j.c)("themeService");var k;(function(s){function r(i){return i&&typeof i=="object"&&typeof i.id=="string"}s.isThemeColor=r})(k||(k={}));function e(s){return{id:s}}var A;(function(s){function r(E){return E&&typeof E=="object"&&typeof E.id=="string"&&(typeof E.color=="undefined"||k.isThemeColor(E.color))}s.isThemeIcon=r;const i=new RegExp(`^\\$\\((${te.a.iconNameExpression}(?:${te.a.iconModifierExpression})?)\\)$`);function t(E){const _=i.exec(E);if(!_)return;let[,h]=_;return{id:h}}s.fromString=t;function y(E,_){let h=E.id;const u=h.lastIndexOf("~");return u!==-1&&(h=h.substring(0,u)),_&&(h=`${h}~${_}`),{id:h}}s.modify=y;function p(E,_){var h,u;return E.id===_.id&&((h=E.color)===null||h===void 0?void 0:h.id)===((u=_.color)===null||u===void 0?void 0:u.id)}s.isEqual=p;function m(E,_){return{id:E.id,color:_?e(_):void 0}}s.asThemeIcon=m,s.asClassNameArray=te.a.asClassNameArray,s.asClassName=te.a.asClassName,s.asCSSSelector=te.a.asCSSSelector})(A||(A={}));function g(s){switch(s){case R.a.DARK:return"vs-dark";case R.a.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const c={ThemingContribution:"base.contributions.theming"};class l{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new H.b}onColorThemeChange(s){return this.themingParticipants.push(s),this.onThemingParticipantAddedEmitter.fire(s),Object(C.i)(()=>{const r=this.themingParticipants.indexOf(s);this.themingParticipants.splice(r,1)})}getThemingParticipants(){return this.themingParticipants}}let n=new l;L.a.add(c.ThemingContribution,n);function a(s){return n.onColorThemeChange(s)}class o extends C.a{constructor(s){super();this.themeService=s,this.theme=s.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(r=>this.onThemeChange(r)))}onThemeChange(s){this.theme=s,this.updateStyles()}updateStyles(){}}},ulZh:function(Qe,le,W){typeof window!="undefined"&&function(H,C){Qe.exports=C()}(this,function(){return function(te){var H={};function C(j){if(H[j])return H[j].exports;var L=H[j]={i:j,l:!1,exports:{}};return te[j].call(L.exports,L,L.exports,C),L.l=!0,L.exports}return C.m=te,C.c=H,C.d=function(j,L,R){C.o(j,L)||Object.defineProperty(j,L,{enumerable:!0,get:R})},C.r=function(j){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(j,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(j,"__esModule",{value:!0})},C.t=function(j,L){if(L&1&&(j=C(j)),L&8)return j;if(L&4&&typeof j=="object"&&j&&j.__esModule)return j;var R=Object.create(null);if(C.r(R),Object.defineProperty(R,"default",{enumerable:!0,value:j}),L&2&&typeof j!="string")for(var B in j)C.d(R,B,function(k){return j[k]}.bind(null,B));return R},C.n=function(j){var L=j&&j.__esModule?function(){return j.default}:function(){return j};return C.d(L,"a",L),L},C.o=function(j,L){return Object.prototype.hasOwnProperty.call(j,L)},C.p="/dist/",C(C.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(te,H,C){"use strict";var j=Object.prototype.hasOwnProperty,L="~";function R(){}Object.create&&(R.prototype=Object.create(null),new R().__proto__||(L=!1));function B(g,c,l){this.fn=g,this.context=c,this.once=l||!1}function k(g,c,l,n,a){if(typeof l!="function")throw new TypeError("The listener must be a function");var o=new B(l,n||g,a),s=L?L+c:c;return g._events[s]?g._events[s].fn?g._events[s]=[g._events[s],o]:g._events[s].push(o):(g._events[s]=o,g._eventsCount++),g}function e(g,c){--g._eventsCount===0?g._events=new R:delete g._events[c]}function A(){this._events=new R,this._eventsCount=0}A.prototype.eventNames=function(){var c=[],l,n;if(this._eventsCount===0)return c;for(n in l=this._events)j.call(l,n)&&c.push(L?n.slice(1):n);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(l)):c},A.prototype.listeners=function(c){var l=L?L+c:c,n=this._events[l];if(!n)return[];if(n.fn)return[n.fn];for(var a=0,o=n.length,s=new Array(o);a<o;a++)s[a]=n[a].fn;return s},A.prototype.listenerCount=function(c){var l=L?L+c:c,n=this._events[l];return n?n.fn?1:n.length:0},A.prototype.emit=function(c,l,n,a,o,s){var r=L?L+c:c;if(!this._events[r])return!1;var i=this._events[r],t=arguments.length,y,p;if(i.fn){i.once&&this.removeListener(c,i.fn,void 0,!0);switch(t){case 1:return i.fn.call(i.context),!0;case 2:return i.fn.call(i.context,l),!0;case 3:return i.fn.call(i.context,l,n),!0;case 4:return i.fn.call(i.context,l,n,a),!0;case 5:return i.fn.call(i.context,l,n,a,o),!0;case 6:return i.fn.call(i.context,l,n,a,o,s),!0}for(p=1,y=new Array(t-1);p<t;p++)y[p-1]=arguments[p];i.fn.apply(i.context,y)}else{var m=i.length,E;for(p=0;p<m;p++){i[p].once&&this.removeListener(c,i[p].fn,void 0,!0);switch(t){case 1:i[p].fn.call(i[p].context);break;case 2:i[p].fn.call(i[p].context,l);break;case 3:i[p].fn.call(i[p].context,l,n);break;case 4:i[p].fn.call(i[p].context,l,n,a);break;default:if(!y)for(E=1,y=new Array(t-1);E<t;E++)y[E-1]=arguments[E];i[p].fn.apply(i[p].context,y)}}}return!0},A.prototype.on=function(c,l,n){return k(this,c,l,n,!1)},A.prototype.once=function(c,l,n){return k(this,c,l,n,!0)},A.prototype.removeListener=function(c,l,n,a){var o=L?L+c:c;if(!this._events[o])return this;if(!l)return e(this,o),this;var s=this._events[o];if(s.fn)s.fn===l&&(!a||s.once)&&(!n||s.context===n)&&e(this,o);else{for(var r=0,i=[],t=s.length;r<t;r++)(s[r].fn!==l||a&&!s[r].once||n&&s[r].context!==n)&&i.push(s[r]);i.length?this._events[o]=i.length===1?i[0]:i:e(this,o)}return this},A.prototype.removeAllListeners=function(c){var l;return c?(l=L?L+c:c,this._events[l]&&e(this,l)):(this._events=new R,this._eventsCount=0),this},A.prototype.off=A.prototype.removeListener,A.prototype.addListener=A.prototype.on,A.prefixed=L,A.EventEmitter=A,te.exports=A},"./node_modules/url-toolkit/src/url-toolkit.js":function(te,H,C){(function(j){var L=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,R=/^([^\/?#]*)([^]*)$/,B=/(?:\/|^)\.(?=\/)/g,k=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,e={buildAbsoluteURL:function(A,g,c){if(c=c||{},A=A.trim(),g=g.trim(),!g){if(!c.alwaysNormalize)return A;var l=e.parseURL(A);if(!l)throw new Error("Error trying to parse base URL.");return l.path=e.normalizePath(l.path),e.buildURLFromParts(l)}var n=e.parseURL(g);if(!n)throw new Error("Error trying to parse relative URL.");if(n.scheme)return c.alwaysNormalize?(n.path=e.normalizePath(n.path),e.buildURLFromParts(n)):g;var a=e.parseURL(A);if(!a)throw new Error("Error trying to parse base URL.");if(!a.netLoc&&a.path&&a.path[0]!=="/"){var o=R.exec(a.path);a.netLoc=o[1],a.path=o[2]}a.netLoc&&!a.path&&(a.path="/");var s={scheme:a.scheme,netLoc:n.netLoc,path:null,params:n.params,query:n.query,fragment:n.fragment};if(!n.netLoc&&(s.netLoc=a.netLoc,n.path[0]!=="/"))if(!n.path)s.path=a.path,n.params||(s.params=a.params,n.query||(s.query=a.query));else{var r=a.path,i=r.substring(0,r.lastIndexOf("/")+1)+n.path;s.path=e.normalizePath(i)}return s.path===null&&(s.path=c.alwaysNormalize?e.normalizePath(n.path):n.path),e.buildURLFromParts(s)},parseURL:function(A){var g=L.exec(A);return g?{scheme:g[1]||"",netLoc:g[2]||"",path:g[3]||"",params:g[4]||"",query:g[5]||"",fragment:g[6]||""}:null},normalizePath:function(A){for(A=A.split("").reverse().join("").replace(B,"");A.length!==(A=A.replace(k,"")).length;);return A.split("").reverse().join("")},buildURLFromParts:function(A){return A.scheme+A.netLoc+A.path+A.params+A.query+A.fragment}};te.exports=e})(this)},"./node_modules/webworkify-webpack/index.js":function(te,H,C){function j(c){var l={};function n(o){if(l[o])return l[o].exports;var s=l[o]={i:o,l:!1,exports:{}};return c[o].call(s.exports,s,s.exports,n),s.l=!0,s.exports}n.m=c,n.c=l,n.i=function(o){return o},n.d=function(o,s,r){n.o(o,s)||Object.defineProperty(o,s,{configurable:!1,enumerable:!0,get:r})},n.r=function(o){Object.defineProperty(o,"__esModule",{value:!0})},n.n=function(o){var s=o&&o.__esModule?function(){return o.default}:function(){return o};return n.d(s,"a",s),s},n.o=function(o,s){return Object.prototype.hasOwnProperty.call(o,s)},n.p="/",n.oe=function(o){throw console.error(o),o};var a=n(n.s=ENTRY_MODULE);return a.default||a}var L="[\\.|\\-|\\+|\\w|/|@]+",R="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+L+").*?\\)";function B(c){return(c+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function k(c){return!isNaN(1*c)}function e(c,l,n){var a={};a[n]=[];var o=l.toString(),s=o.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!s)return a;for(var r=s[1],i=new RegExp("(\\\\n|\\W)"+B(r)+R,"g"),t;t=i.exec(o);){if(t[3]==="dll-reference")continue;a[n].push(t[3])}for(i=new RegExp("\\("+B(r)+'\\("(dll-reference\\s('+L+'))"\\)\\)'+R,"g");t=i.exec(o);)c[t[2]]||(a[n].push(t[1]),c[t[2]]=C(t[1]).m),a[t[2]]=a[t[2]]||[],a[t[2]].push(t[4]);for(var y=Object.keys(a),p=0;p<y.length;p++)for(var m=0;m<a[y[p]].length;m++)k(a[y[p]][m])&&(a[y[p]][m]=1*a[y[p]][m]);return a}function A(c){var l=Object.keys(c);return l.reduce(function(n,a){return n||c[a].length>0},!1)}function g(c,l){for(var n={main:[l]},a={main:[]},o={main:{}};A(n);)for(var s=Object.keys(n),r=0;r<s.length;r++){var i=s[r],t=n[i],y=t.pop();if(o[i]=o[i]||{},o[i][y]||!c[i][y])continue;o[i][y]=!0,a[i]=a[i]||[],a[i].push(y);for(var p=e(c,c[i][y],i),m=Object.keys(p),E=0;E<m.length;E++)n[m[E]]=n[m[E]]||[],n[m[E]]=n[m[E]].concat(p[m[E]])}return a}te.exports=function(c,l){l=l||{};var n={main:C.m},a=l.all?{main:Object.keys(n.main)}:g(n,c),o="";Object.keys(a).filter(function(y){return y!=="main"}).forEach(function(y){for(var p=0;a[y][p];)p++;a[y].push(p),n[y][p]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",o=o+"var "+y+" = ("+j.toString().replace("ENTRY_MODULE",JSON.stringify(p))+")({"+a[y].map(function(m){return""+JSON.stringify(m)+": "+n[y][m].toString()}).join(",")+`});
`}),o=o+"new (("+j.toString().replace("ENTRY_MODULE",JSON.stringify(c))+")({"+a.main.map(function(y){return""+JSON.stringify(y)+": "+n.main[y].toString()}).join(",")+"}))(self);";var s=new window.Blob([o],{type:"text/javascript"});if(l.bare)return s;var r=window.URL||window.webkitURL||window.mozURL||window.msURL,i=r.createObjectURL(s),t=new window.Worker(i);return t.objectURL=i,t}},"./src/config.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"hlsDefaultConfig",function(){return E}),C.d(H,"mergeConfig",function(){return h}),C.d(H,"enableStreamingMode",function(){return u});var j=C("./src/controller/abr-controller.ts"),L=C("./src/controller/audio-stream-controller.ts"),R=C("./src/controller/audio-track-controller.ts"),B=C("./src/controller/subtitle-stream-controller.ts"),k=C("./src/controller/subtitle-track-controller.ts"),e=C("./src/controller/buffer-controller.ts"),A=C("./src/controller/timeline-controller.ts"),g=C("./src/controller/cap-level-controller.ts"),c=C("./src/controller/fps-controller.ts"),l=C("./src/controller/eme-controller.ts"),n=C("./src/controller/cmcd-controller.ts"),a=C("./src/utils/xhr-loader.ts"),o=C("./src/utils/fetch-loader.ts"),s=C("./src/utils/cues.ts"),r=C("./src/utils/mediakeys-helper.ts"),i=C("./src/utils/logger.ts");function t(){return t=Object.assign||function(d){for(var f=1;f<arguments.length;f++){var T=arguments[f];for(var b in T)Object.prototype.hasOwnProperty.call(T,b)&&(d[b]=T[b])}return d},t.apply(this,arguments)}function y(d,f){var T=Object.keys(d);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(d);f&&(b=b.filter(function(S){return Object.getOwnPropertyDescriptor(d,S).enumerable})),T.push.apply(T,b)}return T}function p(d){for(var f=1;f<arguments.length;f++){var T=arguments[f]!=null?arguments[f]:{};f%2?y(Object(T),!0).forEach(function(b){m(d,b,T[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(T)):y(Object(T)).forEach(function(b){Object.defineProperty(d,b,Object.getOwnPropertyDescriptor(T,b))})}return d}function m(d,f,T){return f in d?Object.defineProperty(d,f,{value:T,enumerable:!0,configurable:!0,writable:!0}):d[f]=T,d}var E=p(p({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:a.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:j.default,bufferController:e.default,capLevelController:g.default,fpsController:c.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:r.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},_()),{},{subtitleStreamController:B.SubtitleStreamController,subtitleTrackController:k.default,timelineController:A.TimelineController,audioStreamController:L.default,audioTrackController:R.default,emeController:l.default,cmcdController:n.default});function _(){return{cueHandler:s.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 h(d,f){if((f.liveSyncDurationCount||f.liveMaxLatencyDurationCount)&&(f.liveSyncDuration||f.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(f.liveMaxLatencyDurationCount!==void 0&&(f.liveSyncDurationCount===void 0||f.liveMaxLatencyDurationCount<=f.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(f.liveMaxLatencyDuration!==void 0&&(f.liveSyncDuration===void 0||f.liveMaxLatencyDuration<=f.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return t({},d,f)}function u(d){var f=d.loader;if(f!==o.default&&f!==a.default)i.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),d.progressive=!1;else{var T=Object(o.fetchSupported)();T&&(d.loader=o.default,d.progressive=!0,d.enableSoftwareAES=!0,i.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(te,H,C){"use strict";C.r(H);var j=C("./src/polyfills/number.ts"),L=C("./src/utils/ewma-bandwidth-estimator.ts"),R=C("./src/events.ts"),B=C("./src/utils/buffer-helper.ts"),k=C("./src/errors.ts"),e=C("./src/types/loader.ts"),A=C("./src/utils/logger.ts");function g(n,a){for(var o=0;o<a.length;o++){var s=a[o];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(n,s.key,s)}}function c(n,a,o){return a&&g(n.prototype,a),o&&g(n,o),n}var l=function(){function n(o){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=o;var s=o.config;this.bwEstimator=new L.default(s.abrEwmaSlowVoD,s.abrEwmaFastVoD,s.abrEwmaDefaultEstimate),this.registerListeners()}var a=n.prototype;return a.registerListeners=function(){var s=this.hls;s.on(R.Events.FRAG_LOADING,this.onFragLoading,this),s.on(R.Events.FRAG_LOADED,this.onFragLoaded,this),s.on(R.Events.FRAG_BUFFERED,this.onFragBuffered,this),s.on(R.Events.LEVEL_LOADED,this.onLevelLoaded,this),s.on(R.Events.ERROR,this.onError,this)},a.unregisterListeners=function(){var s=this.hls;s.off(R.Events.FRAG_LOADING,this.onFragLoading,this),s.off(R.Events.FRAG_LOADED,this.onFragLoaded,this),s.off(R.Events.FRAG_BUFFERED,this.onFragBuffered,this),s.off(R.Events.LEVEL_LOADED,this.onLevelLoaded,this),s.off(R.Events.ERROR,this.onError,this)},a.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},a.onFragLoading=function(s,r){var i=r.frag;if(i.type===e.PlaylistLevelType.MAIN&&!this.timer){var t;this.fragCurrent=i,this.partCurrent=(t=r.part)!=null?t:null,this.timer=self.setInterval(this.onCheck,100)}},a.onLevelLoaded=function(s,r){var i=this.hls.config;r.details.live?this.bwEstimator.update(i.abrEwmaSlowLive,i.abrEwmaFastLive):this.bwEstimator.update(i.abrEwmaSlowVoD,i.abrEwmaFastVoD)},a._abandonRulesCheck=function(){var s=this.fragCurrent,r=this.partCurrent,i=this.hls,t=i.autoLevelEnabled,y=i.config,p=i.media;if(!s||!p)return;var m=r?r.stats:s.stats,E=r?r.duration:s.duration;if(m.aborted){A.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!t||p.paused||!p.playbackRate||!p.readyState)return;var _=performance.now()-m.loading.start,h=Math.abs(p.playbackRate);if(_<=500*E/h)return;var u=i.levels,d=i.minAutoLevel,f=u[s.level],T=m.total||Math.max(m.loaded,Math.round(E*f.maxBitrate/8)),b=Math.max(1,m.bwEstimate?m.bwEstimate/8:m.loaded*1e3/_),S=(T-m.loaded)/b,D=p.currentTime,I=(B.BufferHelper.bufferInfo(p,D,y.maxBufferHole).end-D)/h;if(I>=2*E/h||S<=I)return;var w=Number.POSITIVE_INFINITY,P;for(P=s.level-1;P>d;P--){var U=u[P].maxBitrate;if(w=E*U/(8*.8*b),w<I)break}if(w>=S)return;var O=this.bwEstimator.getEstimate();A.logger.warn("Fragment "+s.sn+(r?" part "+r.index:"")+" of level "+s.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+P+`
Current BW estimate: `+(Object(j.isFiniteNumber)(O)?(O/1024).toFixed(3):"Unknown")+` Kb/s
Estimated load time for current fragment: `+S.toFixed(3)+` s
Estimated load time for the next fragment: `+w.toFixed(3)+` s
Time to underbuffer: `+I.toFixed(3)+" s"),i.nextLoadLevel=P,this.bwEstimator.sample(_,m.loaded),this.clearTimer(),s.loader&&(this.fragCurrent=this.partCurrent=null,s.loader.abort()),i.trigger(R.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:s,part:r,stats:m})},a.onFragLoaded=function(s,r){var i=r.frag,t=r.part;if(i.type===e.PlaylistLevelType.MAIN&&Object(j.isFiniteNumber)(i.sn)){var y=t?t.stats:i.stats,p=t?t.duration:i.duration;if(this.clearTimer(),this.lastLoadedFragLevel=i.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var m=this.hls.levels[i.level],E=(m.loaded?m.loaded.bytes:0)+y.loaded,_=(m.loaded?m.loaded.duration:0)+p;m.loaded={bytes:E,duration:_},m.realBitrate=Math.round(8*E/_)}if(i.bitrateTest){var h={stats:y,frag:i,part:t,id:i.type};this.onFragBuffered(R.Events.FRAG_BUFFERED,h),i.bitrateTest=!1}}},a.onFragBuffered=function(s,r){var i=r.frag,t=r.part,y=t?t.stats:i.stats;if(y.aborted)return;if(i.type!==e.PlaylistLevelType.MAIN||i.sn==="initSegment")return;var p=y.parsing.end-y.loading.start;this.bwEstimator.sample(p,y.loaded),y.bwEstimate=this.bwEstimator.getEstimate(),i.bitrateTest?this.bitrateTestDelay=p/1e3:this.bitrateTestDelay=0},a.onError=function(s,r){switch(r.details){case k.ErrorDetails.FRAG_LOAD_ERROR:case k.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},a.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},a.getNextABRAutoLevel=function(){var s=this.fragCurrent,r=this.partCurrent,i=this.hls,t=i.maxAutoLevel,y=i.config,p=i.minAutoLevel,m=i.media,E=r?r.duration:s?s.duration:0,_=m?m.currentTime:0,h=m&&m.playbackRate!==0?Math.abs(m.playbackRate):1,u=this.bwEstimator?this.bwEstimator.getEstimate():y.abrEwmaDefaultEstimate,d=(B.BufferHelper.bufferInfo(m,_,y.maxBufferHole).end-_)/h,f=this.findBestLevel(u,p,t,d,y.abrBandWidthFactor,y.abrBandWidthUpFactor);if(f>=0)return f;A.logger.trace((d?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var T=E?Math.min(E,y.maxStarvationDelay):y.maxStarvationDelay,b=y.abrBandWidthFactor,S=y.abrBandWidthUpFactor;if(!d){var D=this.bitrateTestDelay;if(D){var I=E?Math.min(E,y.maxLoadingDelay):y.maxLoadingDelay;T=I-D,A.logger.trace("bitrate test took "+Math.round(1e3*D)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*T)+" ms"),b=S=1}}return f=this.findBestLevel(u,p,t,d+T,b,S),Math.max(f,0)},a.findBestLevel=function(s,r,i,t,y,p){for(var m,E=this.fragCurrent,_=this.partCurrent,h=this.lastLoadedFragLevel,u=this.hls.levels,d=u[h],f=!!(d!=null&&(m=d.details)!==null&&m!==void 0&&m.live),T=d==null?void 0:d.codecSet,b=_?_.duration:E?E.duration:0,S=i;S>=r;S--){var D=u[S];if(!D||T&&D.codecSet!==T)continue;var I=D.details,w=(_?I==null?void 0:I.partTarget:I==null?void 0:I.averagetargetduration)||b,P=void 0;S<=h?P=y*s:P=p*s;var U=u[S].maxBitrate,O=U*w/P;if(A.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+S+"/"+Math.round(P)+"/"+U+"/"+w+"/"+t+"/"+O),P>U&&(!O||f&&!this.bitrateTestDelay||O<t))return S}return-1},c(n,[{key:"nextAutoLevel",get:function(){var s=this._nextAutoLevel,r=this.bwEstimator;if(s!==-1&&(!r||!r.canEstimate()))return s;var i=this.getNextABRAutoLevel();return s!==-1&&(i=Math.min(s,i)),i},set:function(s){this._nextAutoLevel=s}}]),n}();H.default=l},"./src/controller/audio-stream-controller.ts":function(te,H,C){"use strict";C.r(H);var j=C("./src/polyfills/number.ts"),L=C("./src/controller/base-stream-controller.ts"),R=C("./src/events.ts"),B=C("./src/utils/buffer-helper.ts"),k=C("./src/controller/fragment-tracker.ts"),e=C("./src/types/level.ts"),A=C("./src/types/loader.ts"),g=C("./src/loader/fragment.ts"),c=C("./src/demux/chunk-cache.ts"),l=C("./src/demux/transmuxer-interface.ts"),n=C("./src/types/transmuxer.ts"),a=C("./src/controller/fragment-finders.ts"),o=C("./src/utils/discontinuities.ts"),s=C("./src/errors.ts"),r=C("./src/utils/logger.ts");function i(){return i=Object.assign||function(E){for(var _=1;_<arguments.length;_++){var h=arguments[_];for(var u in h)Object.prototype.hasOwnProperty.call(h,u)&&(E[u]=h[u])}return E},i.apply(this,arguments)}function t(E,_){E.prototype=Object.create(_.prototype),E.prototype.constructor=E,y(E,_)}function y(E,_){return y=Object.setPrototypeOf||function(u,d){return u.__proto__=d,u},y(E,_)}var p=100,m=function(E){t(_,E);function _(u,d){var f;return f=E.call(this,u,d,"[audio-stream-controller]")||this,f.videoBuffer=null,f.videoTrackCC=-1,f.waitingVideoCC=-1,f.audioSwitch=!1,f.trackId=-1,f.waitingData=null,f.mainDetails=null,f.bufferFlushed=!1,f._registerListeners(),f}var h=_.prototype;return h.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},h._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)},h._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)},h.onInitPtsFound=function(d,f){var T=f.frag,b=f.id,S=f.initPTS;if(b==="main"){var D=T.cc;this.initPTS[T.cc]=S,this.log("InitPTS for cc: "+D+" found from main: "+S),this.videoTrackCC=D,this.state===L.State.WAITING_INIT_PTS&&this.tick()}},h.startLoad=function(d){if(!this.levels){this.startPosition=d,this.state=L.State.STOPPED;return}var f=this.lastCurrentTime;this.stopLoad(),this.setInterval(p),this.fragLoadError=0,f>0&&d===-1?(this.log("Override startPosition with lastCurrentTime @"+f.toFixed(3)),this.state=L.State.IDLE):(this.loadedmetadata=!1,this.state=L.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=d,this.tick()},h.doTick=function(){switch(this.state){case L.State.IDLE:this.doTickIdle();break;case L.State.WAITING_TRACK:{var d,f=this.levels,T=this.trackId,b=f==null||((d=f[T])===null||d===void 0)?void 0:d.details;if(b){if(this.waitForCdnTuneIn(b))break;this.state=L.State.WAITING_INIT_PTS}break}case L.State.FRAG_LOADING_WAITING_RETRY:{var S,D=performance.now(),I=this.retryDate;(!I||D>=I||(S=this.media)!==null&&S!==void 0&&S.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=L.State.IDLE);break}case L.State.WAITING_INIT_PTS:{var w=this.waitingData;if(w){var P=w.frag,U=w.part,O=w.cache,G=w.complete;if(this.initPTS[P.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=L.State.FRAG_LOADING;var z=O.flush(),ae={frag:P,part:U,payload:z,networkDetails:null};this._handleFragmentLoadProgress(ae),G&&E.prototype._handleFragmentLoadComplete.call(this,ae)}else if(this.videoTrackCC!==this.waitingVideoCC)r.logger.log("Waiting fragment cc ("+P.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var ie=this.getLoadPosition(),fe=B.BufferHelper.bufferInfo(this.mediaBuffer,ie,this.config.maxBufferHole),ce=Object(a.fragmentWithinToleranceTest)(fe.end,this.config.maxFragLookUpTolerance,P);ce<0&&(r.logger.log("Waiting fragment cc ("+P.cc+") @ "+P.start+" cancelled because another fragment at "+fe.end+" is needed"),this.clearWaitingFragment())}}else this.state=L.State.IDLE}}this.onTickEnd()},h.clearWaitingFragment=function(){var d=this.waitingData;d&&(this.fragmentTracker.removeFragment(d.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=L.State.IDLE)},h.onTickEnd=function(){var d=this.media;if(!d||!d.readyState)return;var f=this.mediaBuffer?this.mediaBuffer:d,T=f.buffered;!this.loadedmetadata&&T.length&&(this.loadedmetadata=!0),this.lastCurrentTime=d.currentTime},h.doTickIdle=function(){var d,f,T=this.hls,b=this.levels,S=this.media,D=this.trackId,I=T.config;if(!b||!b[D])return;if(!S&&(this.startFragRequested||!I.startFragPrefetch))return;var w=b[D],P=w.details;if(!P||P.live&&this.levelLastLoaded!==D||this.waitForCdnTuneIn(P)){this.state=L.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,g.ElementaryStreamTypes.AUDIO,A.PlaylistLevelType.AUDIO));var U=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,A.PlaylistLevelType.AUDIO);if(U===null)return;var O=U.len,G=this.getMaxBufferLength(),z=this.audioSwitch;if(O>=G&&!z)return;if(!z&&this._streamEnded(U,P)){T.trigger(R.Events.BUFFER_EOS,{type:"audio"}),this.state=L.State.ENDED;return}var ae=P.fragments,ie=ae[0].start,fe=U.end;if(z){var ce=this.getLoadPosition();fe=ce,P.PTSKnown&&ce<ie&&((U.end>ie||U.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),S.currentTime=ie+.05))}var J=this.getNextFragment(fe,P);if(!J){this.bufferFlushed=!0;return}((d=J.decryptdata)===null||d===void 0?void 0:d.keyFormat)==="identity"&&!((f=J.decryptdata)!==null&&f!==void 0&&f.key)?this.loadKey(J,P):this.loadFragment(J,P,fe)},h.getMaxBufferLength=function(){var d=E.prototype.getMaxBufferLength.call(this),f=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,A.PlaylistLevelType.MAIN);return f===null?d:Math.max(d,f.len)},h.onMediaDetaching=function(){this.videoBuffer=null,E.prototype.onMediaDetaching.call(this)},h.onAudioTracksUpdated=function(d,f){var T=f.audioTracks;this.resetTransmuxer(),this.levels=T.map(function(b){return new e.Level(b)})},h.onAudioTrackSwitching=function(d,f){var T=!!f.url;this.trackId=f.id;var b=this.fragCurrent;b!=null&&b.loader&&b.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),T?this.setInterval(p):this.resetTransmuxer(),T?(this.audioSwitch=!0,this.state=L.State.IDLE):this.state=L.State.STOPPED,this.tick()},h.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},h.onLevelLoaded=function(d,f){this.mainDetails=f.details},h.onAudioTrackLoaded=function(d,f){var T,b=this.levels,S=f.details,D=f.id;if(!b){this.warn("Audio tracks were reset while loading level "+D);return}this.log("Track "+D+" loaded ["+S.startSN+","+S.endSN+"],duration:"+S.totalduration);var I=b[D],w=0;if(S.live||(T=I.details)!==null&&T!==void 0&&T.live){var P=this.mainDetails;if(S.fragments[0]||(S.deltaUpdateFailed=!0),S.deltaUpdateFailed||!P)return;!I.details&&S.hasProgramDateTime&&P.hasProgramDateTime?(Object(o.alignMediaPlaylistByPDT)(S,P),w=S.fragments[0].start):w=this.alignPlaylists(S,I.details)}I.details=S,this.levelLastLoaded=D,!this.startFragRequested&&(this.mainDetails||!S.live)&&this.setStartPosition(I.details,w),this.state===L.State.WAITING_TRACK&&!this.waitForCdnTuneIn(S)&&(this.state=L.State.IDLE),this.tick()},h._handleFragmentLoadProgress=function(d){var f,T=d.frag,b=d.part,S=d.payload,D=this.config,I=this.trackId,w=this.levels;if(!w){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+T.sn+" of level "+T.level+" will not be buffered");return}var P=w[I];console.assert(P,"Audio track is defined on fragment load progress");var U=P.details;console.assert(U,"Audio track details are defined on fragment load progress");var O=D.defaultAudioCodec||P.audioCodec||"mp4a.40.2",G=this.transmuxer;G||(G=this.transmuxer=new l.default(this.hls,A.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var z=this.initPTS[T.cc],ae=(f=T.initSegment)===null||f===void 0?void 0:f.data;if(z!==void 0){var ie=!1,fe=b?b.index:-1,ce=fe!==-1,J=new n.ChunkMetadata(T.level,T.sn,T.stats.chunkCount,S.byteLength,fe,ce);G.push(S,ae,O,"",T,b,U.totalduration,ie,J,z)}else{r.logger.log("Unknown video PTS for cc "+T.cc+", waiting for video PTS before demuxing audio frag "+T.sn+" of ["+U.startSN+" ,"+U.endSN+"],track "+I);var Z=this.waitingData=this.waitingData||{frag:T,part:b,cache:new c.default,complete:!1},ue=Z.cache;ue.push(new Uint8Array(S)),this.waitingVideoCC=this.videoTrackCC,this.state=L.State.WAITING_INIT_PTS}},h._handleFragmentLoadComplete=function(d){if(this.waitingData){this.waitingData.complete=!0;return}E.prototype._handleFragmentLoadComplete.call(this,d)},h.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},h.onBufferCreated=function(d,f){var T=f.tracks.audio;T&&(this.mediaBuffer=T.buffer),f.tracks.video&&(this.videoBuffer=f.tracks.video.buffer)},h.onFragBuffered=function(d,f){var T=f.frag,b=f.part;if(T.type!==A.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(T)){this.warn("Fragment "+T.sn+(b?" p: "+b.index:"")+" of level "+T.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}T.sn!=="initSegment"&&(this.fragPrevious=T,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(R.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(T,b)},h.onError=function(d,f){switch(f.details){case s.ErrorDetails.FRAG_LOAD_ERROR:case s.ErrorDetails.FRAG_LOAD_TIMEOUT:case s.ErrorDetails.KEY_LOAD_ERROR:case s.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(A.PlaylistLevelType.AUDIO,f);break;case s.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case s.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==L.State.ERROR&&this.state!==L.State.STOPPED&&(this.state=f.fatal?L.State.ERROR:L.State.IDLE,this.warn(f.details+" while loading frag, switching to "+this.state+" state"));break;case s.ErrorDetails.BUFFER_FULL_ERROR:if(f.parent==="audio"&&(this.state===L.State.PARSING||this.state===L.State.PARSED)){var T=!0,b=this.getFwdBufferInfo(this.mediaBuffer,A.PlaylistLevelType.AUDIO);b&&b.len>.5&&(T=!this.reduceMaxBufferLength(b.len)),T&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,E.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},h.onBufferFlushed=function(d,f){var T=f.type;T===g.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},h._handleTransmuxComplete=function(d){var f,T="audio",b=this.hls,S=d.remuxResult,D=d.chunkMeta,I=this.getCurrentContext(D);if(!I){this.warn("The loading context changed while buffering fragment "+D.sn+" of level "+D.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(D.level);return}var w=I.frag,P=I.part,U=S.audio,O=S.text,G=S.id3,z=S.initSegment;if(this.fragContextChanged(w))return;if(this.state=L.State.PARSING,this.audioSwitch&&U&&this.completeAudioSwitch(),z!=null&&z.tracks&&(this._bufferInitSegment(z.tracks,w,D),b.trigger(R.Events.FRAG_PARSING_INIT_SEGMENT,{frag:w,id:T,tracks:z.tracks})),U){var ae=U.startPTS,ie=U.endPTS,fe=U.startDTS,ce=U.endDTS;P&&(P.elementaryStreams[g.ElementaryStreamTypes.AUDIO]={startPTS:ae,endPTS:ie,startDTS:fe,endDTS:ce}),w.setElementaryStreamInfo(g.ElementaryStreamTypes.AUDIO,ae,ie,fe,ce),this.bufferFragmentData(U,w,P,D)}if(G!=null&&(f=G.samples)!==null&&f!==void 0&&f.length){var J=i({frag:w,id:T},G);b.trigger(R.Events.FRAG_PARSING_METADATA,J)}if(O){var Z=i({frag:w,id:T},O);b.trigger(R.Events.FRAG_PARSING_USERDATA,Z)}},h._bufferInitSegment=function(d,f,T){if(this.state!==L.State.PARSING)return;d.video&&delete d.video;var b=d.audio;if(!b)return;b.levelCodec=b.codec,b.id="audio",this.log("Init audio buffer, container:"+b.container+", codecs[parsed]=["+b.codec+"]"),this.hls.trigger(R.Events.BUFFER_CODECS,d);var S=b.initSegment;if(S!=null&&S.byteLength){var D={type:"audio",frag:f,part:null,chunkMeta:T,parent:f.type,data:S};this.hls.trigger(R.Events.BUFFER_APPENDING,D)}this.tick()},h.loadFragment=function(d,f,T){var b=this.fragmentTracker.getState(d);this.fragCurrent=d,(this.audioSwitch||b===k.FragmentState.NOT_LOADED||b===k.FragmentState.PARTIAL)&&(d.sn==="initSegment"?this._loadInitSegment(d):f.live&&!Object(j.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=L.State.WAITING_INIT_PTS):(this.startFragRequested=!0,E.prototype.loadFragment.call(this,d,f,T)))},h.completeAudioSwitch=function(){var d=this.hls,f=this.media,T=this.trackId;f&&(this.log("Switching audio track : flushing all audio"),E.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,d.trigger(R.Events.AUDIO_TRACK_SWITCHED,{id:T})},_}(L.default);H.default=m},"./src/controller/audio-track-controller.ts":function(te,H,C){"use strict";C.r(H);var j=C("./src/events.ts"),L=C("./src/errors.ts"),R=C("./src/controller/base-playlist-controller.ts"),B=C("./src/types/loader.ts");function k(l,n){for(var a=0;a<n.length;a++){var o=n[a];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(l,o.key,o)}}function e(l,n,a){return n&&k(l.prototype,n),a&&k(l,a),l}function A(l,n){l.prototype=Object.create(n.prototype),l.prototype.constructor=l,g(l,n)}function g(l,n){return g=Object.setPrototypeOf||function(o,s){return o.__proto__=s,o},g(l,n)}var c=function(l){A(n,l);function n(o){var s;return s=l.call(this,o,"[audio-track-controller]")||this,s.tracks=[],s.groupId=null,s.tracksInGroup=[],s.trackId=-1,s.trackName="",s.selectDefaultTrack=!0,s.registerListeners(),s}var a=n.prototype;return a.registerListeners=function(){var s=this.hls;s.on(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(j.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.on(j.Events.LEVEL_LOADING,this.onLevelLoading,this),s.on(j.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),s.on(j.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),s.on(j.Events.ERROR,this.onError,this)},a.unregisterListeners=function(){var s=this.hls;s.off(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.off(j.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.off(j.Events.LEVEL_LOADING,this.onLevelLoading,this),s.off(j.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),s.off(j.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),s.off(j.Events.ERROR,this.onError,this)},a.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,l.prototype.destroy.call(this)},a.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},a.onManifestParsed=function(s,r){this.tracks=r.audioTracks||[]},a.onAudioTrackLoaded=function(s,r){var i=r.id,t=r.details,y=this.tracksInGroup[i];if(!y){this.warn("Invalid audio track id "+i);return}var p=y.details;y.details=r.details,this.log("audioTrack "+i+" loaded ["+t.startSN+"-"+t.endSN+"]"),i===this.trackId&&(this.retryCount=0,this.playlistLoaded(i,r,p))},a.onLevelLoading=function(s,r){this.switchLevel(r.level)},a.onLevelSwitching=function(s,r){this.switchLevel(r.level)},a.switchLevel=function(s){var r=this.hls.levels[s];if(!(r!=null&&r.audioGroupIds))return;var i=r.audioGroupIds[r.urlId];if(this.groupId!==i){this.groupId=i;var t=this.tracks.filter(function(p){return!i||p.groupId===i});this.selectDefaultTrack&&!t.some(function(p){return p.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=t;var y={audioTracks:t};this.log("Updating audio tracks, "+t.length+' track(s) found in "'+i+'" group-id'),this.hls.trigger(j.Events.AUDIO_TRACKS_UPDATED,y),this.selectInitialTrack()}},a.onError=function(s,r){if(l.prototype.onError.call(this,s,r),r.fatal||!r.context)return;r.context.type===B.PlaylistContextType.AUDIO_TRACK&&r.context.id===this.trackId&&r.context.groupId===this.groupId&&this.retryLoadingOrFail(r)},a.setAudioTrack=function(s){var r=this.tracksInGroup;if(s<0||s>=r.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var i=r[this.trackId];this.log("Now switching to audio-track index "+s);var t=r[s],y=t.id,p=t.groupId,m=p===void 0?"":p,E=t.name,_=t.type,h=t.url;if(this.trackId=s,this.trackName=E,this.selectDefaultTrack=!1,this.hls.trigger(j.Events.AUDIO_TRACK_SWITCHING,{id:y,groupId:m,name:E,type:_,url:h}),t.details&&!t.details.live)return;var u=this.switchParams(t.url,i==null?void 0:i.details);this.loadPlaylist(u)},a.selectInitialTrack=function(){var s=this.tracksInGroup;console.assert(s.length,"Initial audio track should be selected when tracks are known");var r=this.trackName,i=this.findTrackId(r)||this.findTrackId();i!==-1?this.setAudioTrack(i):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(j.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},a.findTrackId=function(s){for(var r=this.tracksInGroup,i=0;i<r.length;i++){var t=r[i];if((!this.selectDefaultTrack||t.default)&&(!s||s===t.name))return t.id}return-1},a.loadPlaylist=function(s){var r=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(r)){var i=r.id,t=r.groupId,y=r.url;if(s)try{y=s.addDirectives(y)}catch(p){this.warn("Could not construct new URL with HLS Delivery Directives: "+p)}this.log("loading audio-track playlist for id: "+i),this.clearTimer(),this.hls.trigger(j.Events.AUDIO_TRACK_LOADING,{url:y,id:i,groupId:t,deliveryDirectives:s||null})}},e(n,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(s){this.selectDefaultTrack=!1,this.setAudioTrack(s)}}]),n}(R.default);H.default=c},"./src/controller/base-playlist-controller.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"default",function(){return e});var j=C("./src/polyfills/number.ts"),L=C("./src/types/level.ts"),R=C("./src/controller/level-helper.ts"),B=C("./src/utils/logger.ts"),k=C("./src/errors.ts"),e=function(){function A(c,l){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=B.logger.log.bind(B.logger,l+":"),this.warn=B.logger.warn.bind(B.logger,l+":"),this.hls=c}var g=A.prototype;return g.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},g.onError=function(l,n){n.fatal&&n.type===k.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},g.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},g.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},g.stopLoad=function(){this.canLoad=!1,this.clearTimer()},g.switchParams=function(l,n){var a=n==null?void 0:n.renditionReports;if(a)for(var o=0;o<a.length;o++){var s=a[o],r=""+s.URI;if(r===l.substr(-r.length)){var i=parseInt(s["LAST-MSN"]),t=parseInt(s["LAST-PART"]);if(n&&this.hls.config.lowLatencyMode){var y=Math.min(n.age-n.partTarget,n.targetduration);t!==void 0&&y>n.partTarget&&(t+=1)}if(Object(j.isFiniteNumber)(i))return new L.HlsUrlParameters(i,Object(j.isFiniteNumber)(t)?t:void 0,L.HlsSkip.No)}}},g.loadPlaylist=function(l){},g.shouldLoadTrack=function(l){return this.canLoad&&l&&!!l.url&&(!l.details||l.details.live)},g.playlistLoaded=function(l,n,a){var o=this,s=n.details,r=n.stats,i=r.loading.end?Math.max(0,self.performance.now()-r.loading.end):0;if(s.advancedDateTime=Date.now()-i,s.live||a!=null&&a.live){if(s.reloaded(a),a&&this.log("live playlist "+l+" "+(s.advanced?"REFRESHED "+s.lastPartSn+"-"+s.lastPartIndex:"MISSED")),a&&s.fragments.length>0&&Object(R.mergeDetails)(a,s),!this.canLoad||!s.live)return;var t,y=void 0,p=void 0;if(s.canBlockReload&&s.endSN&&s.advanced){var m=this.hls.config.lowLatencyMode,E=s.lastPartSn,_=s.endSN,h=s.lastPartIndex,u=h!==-1,d=E===_,f=m?0:h;u?(y=d?_+1:E,p=d?f:h+1):y=_+1;var T=s.age,b=T+s.ageHeader,S=Math.min(b-s.partTarget,s.targetduration*1.5);if(S>0){if(a&&S>a.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+a.tuneInGoal+" to: "+S+" with playlist age: "+s.age),S=0;else{var D=Math.floor(S/s.targetduration);if(y+=D,p!==void 0){var I=Math.round(S%s.targetduration/s.partTarget);p+=I}this.log("CDN Tune-in age: "+s.ageHeader+"s last advanced "+T.toFixed(2)+"s goal: "+S+" skip sn "+D+" to part "+p)}s.tuneInGoal=S}if(t=this.getDeliveryDirectives(s,n.deliveryDirectives,y,p),m||!d){this.loadPlaylist(t);return}}else t=this.getDeliveryDirectives(s,n.deliveryDirectives,y,p);var w=Object(R.computeReloadInterval)(s,r);y!==void 0&&s.canBlockReload&&(w-=s.partTarget||1),this.log("reload live playlist "+l+" in "+Math.round(w)+" ms"),this.timer=self.setTimeout(function(){return o.loadPlaylist(t)},w)}else this.clearTimer()},g.getDeliveryDirectives=function(l,n,a,o){var s=Object(L.getSkipValue)(l,a);return n!=null&&n.skip&&l.deltaUpdateFailed&&(a=n.msn,o=n.part,s=L.HlsSkip.No),new L.HlsUrlParameters(a,o,s)},g.retryLoadingOrFail=function(l){var n=this,a=this.hls.config,o=this.retryCount<a.levelLoadingMaxRetry;if(o){var s;if(this.retryCount++,l.details.indexOf("LoadTimeOut")>-1&&(s=l.context)!==null&&s!==void 0&&s.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+l.details+'"'),this.loadPlaylist();else{var r=Math.min(Math.pow(2,this.retryCount)*a.levelLoadingRetryDelay,a.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return n.loadPlaylist()},r),this.warn("retry playlist loading #"+this.retryCount+" in "+r+' ms after "'+l.details+'"')}}else this.warn('cannot recover from error "'+l.details+'"'),this.clearTimer(),l.fatal=!0;return o},A}()},"./src/controller/base-stream-controller.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"State",function(){return _}),C.d(H,"default",function(){return h});var j=C("./src/polyfills/number.ts"),L=C("./src/task-loop.ts"),R=C("./src/controller/fragment-tracker.ts"),B=C("./src/utils/buffer-helper.ts"),k=C("./src/utils/logger.ts"),e=C("./src/events.ts"),A=C("./src/errors.ts"),g=C("./src/types/transmuxer.ts"),c=C("./src/utils/mp4-tools.ts"),l=C("./src/utils/discontinuities.ts"),n=C("./src/controller/fragment-finders.ts"),a=C("./src/controller/level-helper.ts"),o=C("./src/loader/fragment-loader.ts"),s=C("./src/crypt/decrypter.ts"),r=C("./src/utils/time-ranges.ts"),i=C("./src/types/loader.ts");function t(u,d){for(var f=0;f<d.length;f++){var T=d[f];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(u,T.key,T)}}function y(u,d,f){return d&&t(u.prototype,d),f&&t(u,f),u}function p(u){if(u===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return u}function m(u,d){u.prototype=Object.create(d.prototype),u.prototype.constructor=u,E(u,d)}function E(u,d){return E=Object.setPrototypeOf||function(T,b){return T.__proto__=b,T},E(u,d)}var _={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"},h=function(u){m(d,u);function d(T,b,S){var D;return D=u.call(this)||this,D.hls=void 0,D.fragPrevious=null,D.fragCurrent=null,D.fragmentTracker=void 0,D.transmuxer=null,D._state=_.STOPPED,D.media=void 0,D.mediaBuffer=void 0,D.config=void 0,D.bitrateTest=!1,D.lastCurrentTime=0,D.nextLoadPosition=0,D.startPosition=0,D.loadedmetadata=!1,D.fragLoadError=0,D.retryDate=0,D.levels=null,D.fragmentLoader=void 0,D.levelLastLoaded=null,D.startFragRequested=!1,D.decrypter=void 0,D.initPTS=[],D.onvseeking=null,D.onvended=null,D.logPrefix="",D.log=void 0,D.warn=void 0,D.logPrefix=S,D.log=k.logger.log.bind(k.logger,S+":"),D.warn=k.logger.warn.bind(k.logger,S+":"),D.hls=T,D.fragmentLoader=new o.default(T.config),D.fragmentTracker=b,D.config=T.config,D.decrypter=new s.default(T,T.config),T.on(e.Events.KEY_LOADED,D.onKeyLoaded,p(D)),D}var f=d.prototype;return f.doTick=function(){this.onTickEnd()},f.onTickEnd=function(){},f.startLoad=function(b){},f.stopLoad=function(){this.fragmentLoader.abort();var b=this.fragCurrent;b&&this.fragmentTracker.removeFragment(b),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=_.STOPPED},f._streamEnded=function(b,S){var D=this.fragCurrent,I=this.fragmentTracker;if(!S.live&&D&&D.sn===S.endSN&&!b.nextStart){var w=I.getState(D);return w===R.FragmentState.PARTIAL||w===R.FragmentState.OK}return!1},f.onMediaAttached=function(b,S){var D=this.media=this.mediaBuffer=S.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),D.addEventListener("seeking",this.onvseeking),D.addEventListener("ended",this.onvended);var I=this.config;this.levels&&I.autoStartLoad&&this.state===_.STOPPED&&this.startLoad(I.startPosition)},f.onMediaDetaching=function(){var b=this.media;b!=null&&b.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),b&&(b.removeEventListener("seeking",this.onvseeking),b.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},f.onMediaSeeking=function(){var b=this.config,S=this.fragCurrent,D=this.media,I=this.mediaBuffer,w=this.state,P=D?D.currentTime:0,U=B.BufferHelper.bufferInfo(I||D,P,b.maxBufferHole);if(this.log("media seeking to "+(Object(j.isFiniteNumber)(P)?P.toFixed(3):P)+", state: "+w),w===_.ENDED)this.resetLoadingState();else if(S&&!U.len){var O=b.maxFragLookUpTolerance,G=S.start-O,z=S.start+S.duration+O,ae=P>z;(P<G||ae)&&(ae&&S.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),S.loader.abort()),this.resetLoadingState())}D&&(this.lastCurrentTime=P),!this.loadedmetadata&&!U.len&&(this.nextLoadPosition=this.startPosition=P),this.tickImmediate()},f.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},f.onKeyLoaded=function(b,S){if(this.state!==_.KEY_LOADING||S.frag!==this.fragCurrent||!this.levels)return;this.state=_.IDLE;var D=this.levels[S.frag.level].details;D&&this.loadFragment(S.frag,D,S.frag.start)},f.onHandlerDestroying=function(){this.stopLoad(),u.prototype.onHandlerDestroying.call(this)},f.onHandlerDestroyed=function(){this.state=_.STOPPED,this.hls.off(e.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)},f.loadKey=function(b,S){this.log("Loading key for "+b.sn+" of ["+S.startSN+"-"+S.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+b.level),this.state=_.KEY_LOADING,this.fragCurrent=b,this.hls.trigger(e.Events.KEY_LOADING,{frag:b})},f.loadFragment=function(b,S,D){this._loadFragForPlayback(b,S,D)},f._loadFragForPlayback=function(b,S,D){var I=this,w=function(U){if(I.fragContextChanged(b)){I.warn("Fragment "+b.sn+(U.part?" p: "+U.part.index:"")+" of level "+b.level+" was dropped during download."),I.fragmentTracker.removeFragment(b);return}b.stats.chunkCount++,I._handleFragmentLoadProgress(U)};this._doFragLoad(b,S,D,w).then(function(P){if(!P)return;I.fragLoadError=0;var U=I.state;if(I.fragContextChanged(b)){(U===_.FRAG_LOADING||U===_.BACKTRACKING||!I.fragCurrent&&U===_.PARSING)&&(I.fragmentTracker.removeFragment(b),I.state=_.IDLE);return}if("payload"in P&&(I.log("Loaded fragment "+b.sn+" of level "+b.level),I.hls.trigger(e.Events.FRAG_LOADED,P),I.state===_.BACKTRACKING)){I.fragmentTracker.backtrack(b,P),I.resetFragmentLoading(b);return}I._handleFragmentLoadComplete(P)}).catch(function(P){I.warn(P),I.resetFragmentLoading(b)})},f.flushMainBuffer=function(b,S,D){if(D===void 0&&(D=null),!(b-S))return;var I={startOffset:b,endOffset:S,type:D};this.fragLoadError=0,this.hls.trigger(e.Events.BUFFER_FLUSHING,I)},f._loadInitSegment=function(b){var S=this;this._doFragLoad(b).then(function(D){if(!D||S.fragContextChanged(b)||!S.levels)throw new Error("init load aborted");return D}).then(function(D){var I=S.hls,w=D.payload,P=b.decryptdata;if(w&&w.byteLength>0&&P&&P.key&&P.iv&&P.method==="AES-128"){var U=self.performance.now();return S.decrypter.webCryptoDecrypt(new Uint8Array(w),P.key.buffer,P.iv.buffer).then(function(O){var G=self.performance.now();return I.trigger(e.Events.FRAG_DECRYPTED,{frag:b,payload:O,stats:{tstart:U,tdecrypt:G}}),D.payload=O,D})}return D}).then(function(D){var I=S.fragCurrent,w=S.hls,P=S.levels;if(!P)throw new Error("init load aborted, missing levels");var U=P[b.level].details;console.assert(U,"Level details are defined when init segment is loaded");var O=b.stats;S.state=_.IDLE,S.fragLoadError=0,b.data=new Uint8Array(D.payload),O.parsing.start=O.buffering.start=self.performance.now(),O.parsing.end=O.buffering.end=self.performance.now(),D.frag===I&&w.trigger(e.Events.FRAG_BUFFERED,{stats:O,frag:I,part:null,id:b.type}),S.tick()}).catch(function(D){S.warn(D),S.resetFragmentLoading(b)})},f.fragContextChanged=function(b){var S=this.fragCurrent;return!b||!S||b.level!==S.level||b.sn!==S.sn||b.urlId!==S.urlId},f.fragBufferedComplete=function(b,S){var D=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+b.type+" sn: "+b.sn+(S?" part: "+S.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+b.level+" "+r.default.toString(B.BufferHelper.getBuffered(D))),this.state=_.IDLE,this.tick()},f._handleFragmentLoadComplete=function(b){var S=this.transmuxer;if(!S)return;var D=b.frag,I=b.part,w=b.partsLoaded,P=!w||w.length===0||w.some(function(O){return!O}),U=new g.ChunkMetadata(D.level,D.sn,D.stats.chunkCount+1,0,I?I.index:-1,!P);S.flush(U)},f._handleFragmentLoadProgress=function(b){},f._doFragLoad=function(b,S,D,I){var w=this;if(D===void 0&&(D=null),!this.levels)throw new Error("frag load aborted, missing levels");if(D=Math.max(b.start,D||0),this.config.lowLatencyMode&&S){var P=S.partList;if(P&&I){D>b.end&&S.fragmentHint&&(b=S.fragmentHint);var U=this.getNextPart(P,b,D);if(U>-1){var O=P[U];return this.log("Loading part sn: "+b.sn+" p: "+O.index+" cc: "+b.cc+" of playlist ["+S.startSN+"-"+S.endSN+"] parts [0-"+U+"-"+(P.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+b.level+", target: "+parseFloat(D.toFixed(3))),this.nextLoadPosition=O.start+O.duration,this.state=_.FRAG_LOADING,this.hls.trigger(e.Events.FRAG_LOADING,{frag:b,part:P[U],targetBufferTime:D}),this.doFragPartsLoad(b,P,U,I).catch(function(G){return w.handleFragLoadError(G)})}else if(!b.url||this.loadedEndOfParts(P,D))return Promise.resolve(null)}}return this.log("Loading fragment "+b.sn+" cc: "+b.cc+" "+(S?"of ["+S.startSN+"-"+S.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+b.level+", target: "+parseFloat(D.toFixed(3))),Object(j.isFiniteNumber)(b.sn)&&!this.bitrateTest&&(this.nextLoadPosition=b.start+b.duration),this.state=_.FRAG_LOADING,this.hls.trigger(e.Events.FRAG_LOADING,{frag:b,targetBufferTime:D}),this.fragmentLoader.load(b,I).catch(function(G){return w.handleFragLoadError(G)})},f.doFragPartsLoad=function(b,S,D,I){var w=this;return new Promise(function(P,U){var O=[],G=function z(ae){var ie=S[ae];w.fragmentLoader.loadPart(b,ie,I).then(function(fe){O[ie.index]=fe;var ce=fe.part;w.hls.trigger(e.Events.FRAG_LOADED,fe);var J=S[ae+1];if(J&&J.fragment===b)z(ae+1);else return P({frag:b,part:ce,partsLoaded:O})}).catch(U)};G(D)})},f.handleFragLoadError=function(b){var S=b.data;return S&&S.details===A.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(S.frag,S.part):this.hls.trigger(e.Events.ERROR,S),null},f._handleTransmuxerFlush=function(b){var S=this.getCurrentContext(b);if(!S||this.state!==_.PARSING){this.fragCurrent||(this.state=_.IDLE);return}var D=S.frag,I=S.part,w=S.level,P=self.performance.now();D.stats.parsing.end=P,I&&(I.stats.parsing.end=P),this.updateLevelTiming(D,I,w,b.partial)},f.getCurrentContext=function(b){var S=this.levels,D=b.level,I=b.sn,w=b.part;if(!S||!S[D])return this.warn("Levels object was unset while buffering fragment "+I+" of level "+D+". The current chunk will not be buffered."),null;var P=S[D],U=w>-1?Object(a.getPartWith)(P,I,w):null,O=U?U.fragment:Object(a.getFragmentWithSN)(P,I,this.fragCurrent);return O?{frag:O,part:U,level:P}:null},f.bufferFragmentData=function(b,S,D,I){if(!b||this.state!==_.PARSING)return;var w=b.data1,P=b.data2,U=w;if(w&&P&&(U=Object(c.appendUint8Array)(w,P)),!U||!U.length)return;var O={type:b.type,frag:S,part:D,chunkMeta:I,parent:S.type,data:U};this.hls.trigger(e.Events.BUFFER_APPENDING,O),b.dropped&&b.independent&&!D&&this.flushBufferGap(S)},f.flushBufferGap=function(b){var S=this.media;if(!S)return;if(!B.BufferHelper.isBuffered(S,S.currentTime)){this.flushMainBuffer(0,b.start);return}var D=S.currentTime,I=B.BufferHelper.bufferInfo(S,D,0),w=b.duration,P=Math.min(this.config.maxFragLookUpTolerance*2,w*.25),U=Math.max(Math.min(b.start-P,I.end-P),D+P);b.start-U>P&&this.flushMainBuffer(U,b.start)},f.getFwdBufferInfo=function(b,S){var D=this.config,I=this.getLoadPosition();if(!Object(j.isFiniteNumber)(I))return null;var w=B.BufferHelper.bufferInfo(b,I,D.maxBufferHole);if(w.len===0&&w.nextStart!==void 0){var P=this.fragmentTracker.getBufferedFrag(I,S);if(P&&w.nextStart<P.end)return B.BufferHelper.bufferInfo(b,I,Math.max(w.nextStart,D.maxBufferHole))}return w},f.getMaxBufferLength=function(b){var S=this.config,D;return b?D=Math.max(8*S.maxBufferSize/b,S.maxBufferLength):D=S.maxBufferLength,Math.min(D,S.maxMaxBufferLength)},f.reduceMaxBufferLength=function(b){var S=this.config,D=b||S.maxBufferLength;return S.maxMaxBufferLength>=D?(S.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+S.maxMaxBufferLength+"s"),!0):!1},f.getNextFragment=function(b,S){var D,I,w=S.fragments,P=w.length;if(!P)return null;var U=this.config,O=w[0].start,G;if(S.live){var z=U.initialLiveManifestSize;if(P<z)return this.warn("Not enough fragments to start playback (have: "+P+", need: "+z+")"),null;!S.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(G=this.getInitialLiveFragment(S,w),this.startPosition=G?this.hls.liveSyncPosition||G.start:b)}else b<=O&&(G=w[0]);if(!G){var ae=U.lowLatencyMode?S.partEnd:S.fragmentEnd;G=this.getFragmentAtPosition(b,ae,S)}return(D=G)!==null&&D!==void 0&&D.initSegment&&!((I=G)!==null&&I!==void 0&&I.initSegment.data)&&!this.bitrateTest&&(G=G.initSegment),G},f.getNextPart=function(b,S,D){for(var I=-1,w=!1,P=!0,U=0,O=b.length;U<O;U++){var G=b[U];if(P=P&&!G.independent,I>-1&&D<G.start)break;var z=G.loaded;!z&&(w||G.independent||P)&&G.fragment===S&&(I=U),w=z}return I},f.loadedEndOfParts=function(b,S){var D=b[b.length-1];return D&&S>D.start&&D.loaded},f.getInitialLiveFragment=function(b,S){var D=this.fragPrevious,I=null;if(D){if(b.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+D.programDateTime),I=Object(n.findFragmentByPDT)(S,D.endProgramDateTime,this.config.maxFragLookUpTolerance)),!I){var w=D.sn+1;if(w>=b.startSN&&w<=b.endSN){var P=S[w-b.startSN];D.cc===P.cc&&(I=P,this.log("Live playlist, switching playlist, load frag with next SN: "+I.sn))}I||(I=Object(n.findFragWithCC)(S,D.cc),I&&this.log("Live playlist, switching playlist, load frag with same CC: "+I.sn))}}else{var U=this.hls.liveSyncPosition;U!==null&&(I=this.getFragmentAtPosition(U,this.bitrateTest?b.fragmentEnd:b.edge,b))}return I},f.getFragmentAtPosition=function(b,S,D){var I=this.config,w=this.fragPrevious,P=D.fragments,U=D.endSN,O=D.fragmentHint,G=I.maxFragLookUpTolerance,z=!!(I.lowLatencyMode&&D.partList&&O);z&&O&&!this.bitrateTest&&(P=P.concat(O),U=O.sn);var ae;if(b<S){var ie=b>S-G?0:G;ae=Object(n.findFragmentByPTS)(w,P,b,ie)}else ae=P[P.length-1];if(ae){var fe=ae.sn-D.startSN,ce=w&&ae.level===w.level,J=P[fe+1],Z=this.fragmentTracker.getState(ae);if(Z===R.FragmentState.BACKTRACKED){ae=null;for(var ue=fe;P[ue]&&this.fragmentTracker.getState(P[ue])===R.FragmentState.BACKTRACKED;)w?ae=P[ue--]:ae=P[--ue];ae||(ae=J)}else w&&ae.sn===w.sn&&!z&&(ce&&(ae.sn<U&&this.fragmentTracker.getState(J)!==R.FragmentState.OK?(this.log("SN "+ae.sn+" just loaded, load next one: "+J.sn),ae=J):ae=null))}return ae},f.synchronizeToLiveEdge=function(b){var S=this.config,D=this.media;if(!D)return;var I=this.hls.liveSyncPosition,w=D.currentTime,P=b.fragments[0].start,U=b.edge,O=w>=P-S.maxFragLookUpTolerance&&w<=U;if(I!==null&&D.duration>I&&(w<I||!O)){var G=S.liveMaxLatencyDuration!==void 0?S.liveMaxLatencyDuration:S.liveMaxLatencyDurationCount*b.targetduration;(!O&&D.readyState<4||w<U-G)&&(this.loadedmetadata||(this.nextLoadPosition=I),D.readyState&&(this.warn("Playback: "+w.toFixed(3)+" is located too far from the end of live sliding playlist: "+U+", reset currentTime to : "+I.toFixed(3)),D.currentTime=I))}},f.alignPlaylists=function(b,S){var D=this.levels,I=this.levelLastLoaded,w=this.fragPrevious,P=I!==null?D[I]:null,U=b.fragments.length;if(!U)return this.warn("No fragments in live playlist"),0;var O=b.fragments[0].start,G=!S,z=b.alignedSliding&&Object(j.isFiniteNumber)(O);if(G||!z&&!O){Object(l.alignStream)(w,P,b);var ae=b.fragments[0].start;return this.log("Live playlist sliding: "+ae.toFixed(2)+" start-sn: "+(S?S.startSN:"na")+"->"+b.startSN+" prev-sn: "+(w?w.sn:"na")+" fragments: "+U),ae}return O},f.waitForCdnTuneIn=function(b){var S=3;return b.live&&b.canBlockReload&&b.tuneInGoal>Math.max(b.partHoldBack,b.partTarget*S)},f.setStartPosition=function(b,S){var D=this.startPosition;if(D<S&&(D=-1),D===-1||this.lastCurrentTime===-1){var I=b.startTimeOffset;Object(j.isFiniteNumber)(I)?(D=S+I,I<0&&(D+=b.totalduration),D=Math.min(Math.max(S,D),S+b.totalduration),this.log("Start time offset "+I+" found in playlist, adjust startPosition to "+D),this.startPosition=D):b.live?D=this.hls.liveSyncPosition||S:this.startPosition=D=0,this.lastCurrentTime=D}this.nextLoadPosition=D},f.getLoadPosition=function(){var b=this.media,S=0;return this.loadedmetadata&&b?S=b.currentTime:this.nextLoadPosition&&(S=this.nextLoadPosition),S},f.handleFragLoadAborted=function(b,S){this.transmuxer&&b.sn!=="initSegment"&&b.stats.aborted&&(this.warn("Fragment "+b.sn+(S?" part"+S.index:"")+" of level "+b.level+" was aborted"),this.resetFragmentLoading(b))},f.resetFragmentLoading=function(b){(!this.fragCurrent||!this.fragContextChanged(b))&&(this.state=_.IDLE)},f.onFragmentOrKeyLoadError=function(b,S){if(S.fatal)return;var D=S.frag;if(!D||D.type!==b)return;var I=this.fragCurrent;console.assert(I&&D.sn===I.sn&&D.level===I.level&&D.urlId===I.urlId,"Frag load error must match current frag to retry");var w=this.config;if(this.fragLoadError+1<=w.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(D.level))return;var P=Math.min(Math.pow(2,this.fragLoadError)*w.fragLoadingRetryDelay,w.fragLoadingMaxRetryTimeout);this.warn("Fragment "+D.sn+" of "+b+" "+D.level+" failed to load, retrying in "+P+"ms"),this.retryDate=self.performance.now()+P,this.fragLoadError++,this.state=_.FRAG_LOADING_WAITING_RETRY}else S.levelRetry?(b===i.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=_.IDLE):(k.logger.error(S.details+" reaches max retry, redispatch as fatal ..."),S.fatal=!0,this.hls.stopLoad(),this.state=_.ERROR)},f.afterBufferFlushed=function(b,S,D){if(!b)return;var I=B.BufferHelper.getBuffered(b);this.fragmentTracker.detectEvictedFragments(S,I,D),this.state===_.ENDED&&this.resetLoadingState()},f.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=_.IDLE},f.resetLiveStartWhenNotLoaded=function(b){if(!this.loadedmetadata){this.startFragRequested=!1;var S=this.levels?this.levels[b].details:null;if(S!=null&&S.live)return this.startPosition=-1,this.setStartPosition(S,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},f.updateLevelTiming=function(b,S,D,I){var w=this,P=D.details;console.assert(!!P,"level.details must be defined");var U=Object.keys(b.elementaryStreams).reduce(function(O,G){var z=b.elementaryStreams[G];if(z){var ae=z.endPTS-z.startPTS;if(ae<=0)return w.warn("Could not parse fragment "+b.sn+" "+G+" duration reliably ("+ae+") resetting transmuxer to fallback to playlist timing"),w.resetTransmuxer(),O||!1;var ie=I?0:Object(a.updateFragPTSDTS)(P,b,z.startPTS,z.endPTS,z.startDTS,z.endDTS);return w.hls.trigger(e.Events.LEVEL_PTS_UPDATED,{details:P,level:D,drift:ie,type:G,frag:b,start:z.startPTS,end:z.endPTS}),!0}return O},!1);U?(this.state=_.PARSED,this.hls.trigger(e.Events.FRAG_PARSED,{frag:b,part:S})):this.resetLoadingState()},f.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},y(d,[{key:"state",get:function(){return this._state},set:function(b){var S=this._state;S!==b&&(this._state=b,this.log(S+"->"+b))}}]),d}(L.default)},"./src/controller/buffer-controller.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"default",function(){return n});var j=C("./src/polyfills/number.ts"),L=C("./src/events.ts"),R=C("./src/utils/logger.ts"),B=C("./src/errors.ts"),k=C("./src/utils/buffer-helper.ts"),e=C("./src/utils/mediasource-helper.ts"),A=C("./src/loader/fragment.ts"),g=C("./src/controller/buffer-operation-queue.ts"),c=Object(e.getMediaSource)(),l=/([ha]vc.)(?:\.[^.,]+)+/,n=function(){function a(s){var r=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 i=r.hls,t=r.media,y=r.mediaSource;R.logger.log("[buffer-controller]: Media source opened"),t&&(r.updateMediaElementDuration(),i.trigger(L.Events.MEDIA_ATTACHED,{media:t})),y&&y.removeEventListener("sourceopen",r._onMediaSourceOpen),r.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=s,this._initSourceBuffer(),this.registerListeners()}var o=a.prototype;return o.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},o.destroy=function(){this.unregisterListeners(),this.details=null},o.registerListeners=function(){var r=this.hls;r.on(L.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),r.on(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.on(L.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.on(L.Events.BUFFER_RESET,this.onBufferReset,this),r.on(L.Events.BUFFER_APPENDING,this.onBufferAppending,this),r.on(L.Events.BUFFER_CODECS,this.onBufferCodecs,this),r.on(L.Events.BUFFER_EOS,this.onBufferEos,this),r.on(L.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),r.on(L.Events.LEVEL_UPDATED,this.onLevelUpdated,this),r.on(L.Events.FRAG_PARSED,this.onFragParsed,this),r.on(L.Events.FRAG_CHANGED,this.onFragChanged,this)},o.unregisterListeners=function(){var r=this.hls;r.off(L.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),r.off(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.off(L.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.off(L.Events.BUFFER_RESET,this.onBufferReset,this),r.off(L.Events.BUFFER_APPENDING,this.onBufferAppending,this),r.off(L.Events.BUFFER_CODECS,this.onBufferCodecs,this),r.off(L.Events.BUFFER_EOS,this.onBufferEos,this),r.off(L.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),r.off(L.Events.LEVEL_UPDATED,this.onLevelUpdated,this),r.off(L.Events.FRAG_PARSED,this.onFragParsed,this),r.off(L.Events.FRAG_CHANGED,this.onFragChanged,this)},o._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new g.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},o.onManifestParsed=function(r,i){var t=2;(i.audio&&!i.video||!i.altAudio)&&(t=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=t,this.details=null,R.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},o.onMediaAttaching=function(r,i){var t=this.media=i.media;if(t&&c){var y=this.mediaSource=new c;y.addEventListener("sourceopen",this._onMediaSourceOpen),y.addEventListener("sourceended",this._onMediaSourceEnded),y.addEventListener("sourceclose",this._onMediaSourceClose),t.src=self.URL.createObjectURL(y),this._objectUrl=t.src}},o.onMediaDetaching=function(){var r=this.media,i=this.mediaSource,t=this._objectUrl;if(i){if(R.logger.log("[buffer-controller]: media source detaching"),i.readyState==="open")try{i.endOfStream()}catch(y){R.logger.warn("[buffer-controller]: onMediaDetaching: "+y.message+" while calling endOfStream")}this.onBufferReset(),i.removeEventListener("sourceopen",this._onMediaSourceOpen),i.removeEventListener("sourceended",this._onMediaSourceEnded),i.removeEventListener("sourceclose",this._onMediaSourceClose),r&&(t&&self.URL.revokeObjectURL(t),r.src===t?(r.removeAttribute("src"),r.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(L.Events.MEDIA_DETACHED,void 0)},o.onBufferReset=function(){var r=this;this.getSourceBufferTypes().forEach(function(i){var t=r.sourceBuffer[i];try{t&&(r.removeBufferListeners(i),r.mediaSource&&r.mediaSource.removeSourceBuffer(t),r.sourceBuffer[i]=void 0)}catch(y){R.logger.warn("[buffer-controller]: Failed to reset the "+i+" buffer",y)}}),this._initSourceBuffer()},o.onBufferCodecs=function(r,i){var t=this,y=this.getSourceBufferTypes().length;if(Object.keys(i).forEach(function(p){if(y){var m=t.tracks[p];if(m&&typeof m.buffer.changeType=="function"){var E=i[p],_=E.codec,h=E.levelCodec,u=E.container,d=(m.levelCodec||m.codec).replace(l,"$1"),f=(h||_).replace(l,"$1");if(d!==f){var T=u+";codecs="+(h||_);t.appendChangeType(p,T)}}}else t.pendingTracks[p]=i[p]}),y)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},o.appendChangeType=function(r,i){var t=this,y=this.operationQueue,p={execute:function(){var E=t.sourceBuffer[r];E&&(R.logger.log("[buffer-controller]: changing "+r+" sourceBuffer type to "+i),E.changeType(i)),y.shiftAndExecuteNext(r)},onStart:function(){},onComplete:function(){},onError:function(E){R.logger.warn("[buffer-controller]: Failed to change "+r+" SourceBuffer type",E)}};y.append(p,r)},o.onBufferAppending=function(r,i){var t=this,y=this.hls,p=this.operationQueue,m=this.tracks,E=i.data,_=i.type,h=i.frag,u=i.part,d=i.chunkMeta,f=d.buffering[_],T=self.performance.now();f.start=T;var b=h.stats.buffering,S=u?u.stats.buffering:null;b.start===0&&(b.start=T),S&&S.start===0&&(S.start=T);var D=m.audio,I=_==="audio"&&d.id===1&&(D==null?void 0:D.container)==="audio/mpeg",w={execute:function(){if(f.executeStart=self.performance.now(),I){var U=t.sourceBuffer[_];if(U){var O=h.start-U.timestampOffset;Math.abs(O)>=.1&&(R.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+h.start+" (delta: "+O+") sn: "+h.sn+")"),U.timestampOffset=h.start)}}t.appendExecutor(E,_)},onStart:function(){},onComplete:function(){var U=self.performance.now();f.executeEnd=f.end=U,b.first===0&&(b.first=U),S&&S.first===0&&(S.first=U);var O=t.sourceBuffer,G={};for(var z in O)G[z]=k.BufferHelper.getBuffered(O[z]);t.appendError=0,t.hls.trigger(L.Events.BUFFER_APPENDED,{type:_,frag:h,part:u,chunkMeta:d,parent:h.type,timeRanges:G})},onError:function(U){R.logger.error("[buffer-controller]: Error encountered while trying to append to the "+_+" SourceBuffer",U);var O={type:B.ErrorTypes.MEDIA_ERROR,parent:h.type,details:B.ErrorDetails.BUFFER_APPEND_ERROR,err:U,fatal:!1};U.code===DOMException.QUOTA_EXCEEDED_ERR?O.details=B.ErrorDetails.BUFFER_FULL_ERROR:(t.appendError++,O.details=B.ErrorDetails.BUFFER_APPEND_ERROR,t.appendError>y.config.appendErrorMaxRetry&&(R.logger.error("[buffer-controller]: Failed "+y.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),O.fatal=!0)),y.trigger(L.Events.ERROR,O)}};p.append(w,_)},o.onBufferFlushing=function(r,i){var t=this,y=this.operationQueue,p=function(E){return{execute:t.removeExecutor.bind(t,E,i.startOffset,i.endOffset),onStart:function(){},onComplete:function(){t.hls.trigger(L.Events.BUFFER_FLUSHED,{type:E})},onError:function(h){R.logger.warn("[buffer-controller]: Failed to remove from "+E+" SourceBuffer",h)}}};i.type?y.append(p(i.type),i.type):this.getSourceBufferTypes().forEach(function(m){y.append(p(m),m)})},o.onFragParsed=function(r,i){var t=this,y=i.frag,p=i.part,m=[],E=p?p.elementaryStreams:y.elementaryStreams;E[A.ElementaryStreamTypes.AUDIOVIDEO]?m.push("audiovideo"):(E[A.ElementaryStreamTypes.AUDIO]&&m.push("audio"),E[A.ElementaryStreamTypes.VIDEO]&&m.push("video"));var _=function(){var u=self.performance.now();y.stats.buffering.end=u,p&&(p.stats.buffering.end=u);var d=p?p.stats:y.stats;t.hls.trigger(L.Events.FRAG_BUFFERED,{frag:y,part:p,stats:d,id:y.type})};m.length===0&&R.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+y.type+" level: "+y.level+" sn: "+y.sn),this.blockBuffers(_,m)},o.onFragChanged=function(r,i){this.flushBackBuffer()},o.onBufferEos=function(r,i){var t=this,y=this.getSourceBufferTypes().reduce(function(p,m){var E=t.sourceBuffer[m];return(!i.type||i.type===m)&&(E&&!E.ended&&(E.ended=!0,R.logger.log("[buffer-controller]: "+m+" sourceBuffer now EOS"))),p&&!!(!E||E.ended)},!0);y&&this.blockBuffers(function(){var p=t.mediaSource;if(!p||p.readyState!=="open")return;p.endOfStream()})},o.onLevelUpdated=function(r,i){var t=i.details;if(!t.fragments.length)return;this.details=t,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},o.flushBackBuffer=function(){var r=this.hls,i=this.details,t=this.media,y=this.sourceBuffer;if(!t||i===null)return;var p=this.getSourceBufferTypes();if(!p.length)return;var m=i.live&&r.config.liveBackBufferLength!==null?r.config.liveBackBufferLength:r.config.backBufferLength;if(!Object(j.isFiniteNumber)(m)||m<0)return;var E=t.currentTime,_=i.levelTargetDuration,h=Math.max(m,_),u=Math.floor(E/_)*_-h;p.forEach(function(d){var f=y[d];if(f){var T=k.BufferHelper.getBuffered(f);T.length>0&&u>T.start(0)&&(r.trigger(L.Events.BACK_BUFFER_REACHED,{bufferEnd:u}),i.live&&r.trigger(L.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:u}),r.trigger(L.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:u,type:d}))}})},o.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var r=this.details,i=this.hls,t=this.media,y=this.mediaSource,p=r.fragments[0].start+r.totalduration,m=t.duration,E=Object(j.isFiniteNumber)(y.duration)?y.duration:0;r.live&&i.config.liveDurationInfinity?(R.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),y.duration=Infinity,this.updateSeekableRange(r)):(p>E&&p>m||!Object(j.isFiniteNumber)(m))&&(R.logger.log("[buffer-controller]: Updating Media Source duration to "+p.toFixed(3)),y.duration=p)},o.updateSeekableRange=function(r){var i=this.mediaSource,t=r.fragments,y=t.length;if(y&&r.live&&i!==null&&i!==void 0&&i.setLiveSeekableRange){var p=Math.max(0,t[0].start),m=Math.max(p,p+r.totalduration);i.setLiveSeekableRange(p,m)}},o.checkPendingTracks=function(){var r=this.bufferCodecEventsExpected,i=this.operationQueue,t=this.pendingTracks,y=Object.keys(t).length;if(y&&!r||y===2){this.createSourceBuffers(t),this.pendingTracks={};var p=this.getSourceBufferTypes();if(p.length===0){this.hls.trigger(L.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}p.forEach(function(m){i.executeNext(m)})}},o.createSourceBuffers=function(r){var i=this.sourceBuffer,t=this.mediaSource;if(!t)throw Error("createSourceBuffers called when mediaSource was null");var y=0;for(var p in r)if(!i[p]){var m=r[p];if(!m)throw Error("source buffer exists for track "+p+", however track does not");var E=m.levelCodec||m.codec,_=m.container+";codecs="+E;R.logger.log("[buffer-controller]: creating sourceBuffer("+_+")");try{var h=i[p]=t.addSourceBuffer(_),u=p;this.addBufferListener(u,"updatestart",this._onSBUpdateStart),this.addBufferListener(u,"updateend",this._onSBUpdateEnd),this.addBufferListener(u,"error",this._onSBUpdateError),this.tracks[p]={buffer:h,codec:E,container:m.container,levelCodec:m.levelCodec,id:m.id},y++}catch(d){R.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+d.message),this.hls.trigger(L.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:d,mimeType:_})}}y&&this.hls.trigger(L.Events.BUFFER_CREATED,{tracks:this.tracks})},o._onSBUpdateStart=function(r){var i=this.operationQueue,t=i.current(r);t.onStart()},o._onSBUpdateEnd=function(r){var i=this.operationQueue,t=i.current(r);t.onComplete(),i.shiftAndExecuteNext(r)},o._onSBUpdateError=function(r,i){R.logger.error("[buffer-controller]: "+r+" SourceBuffer error",i),this.hls.trigger(L.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var t=this.operationQueue.current(r);t&&t.onError(i)},o.removeExecutor=function(r,i,t){var y=this.media,p=this.mediaSource,m=this.operationQueue,E=this.sourceBuffer,_=E[r];if(!y||!p||!_){R.logger.warn("[buffer-controller]: Attempting to remove from the "+r+" SourceBuffer, but it does not exist"),m.shiftAndExecuteNext(r);return}var h=Object(j.isFiniteNumber)(y.duration)?y.duration:Infinity,u=Object(j.isFiniteNumber)(p.duration)?p.duration:Infinity,d=Math.max(0,i),f=Math.min(t,h,u);f>d?(R.logger.log("[buffer-controller]: Removing ["+d+","+f+"] from the "+r+" SourceBuffer"),console.assert(!_.updating,r+" sourceBuffer must not be updating"),_.remove(d,f)):m.shiftAndExecuteNext(r)},o.appendExecutor=function(r,i){var t=this.operationQueue,y=this.sourceBuffer,p=y[i];if(!p){R.logger.warn("[buffer-controller]: Attempting to append to the "+i+" SourceBuffer, but it does not exist"),t.shiftAndExecuteNext(i);return}p.ended=!1,console.assert(!p.updating,i+" sourceBuffer must not be updating"),p.appendBuffer(r)},o.blockBuffers=function(r,i){var t=this;if(i===void 0&&(i=this.getSourceBufferTypes()),!i.length){R.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(r);return}var y=this.operationQueue,p=i.map(function(m){return y.appendBlocker(m)});Promise.all(p).then(function(){r(),i.forEach(function(m){var E=t.sourceBuffer[m];(!E||!E.updating)&&y.shiftAndExecuteNext(m)})})},o.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},o.addBufferListener=function(r,i,t){var y=this.sourceBuffer[r];if(!y)return;var p=t.bind(this,r);this.listeners[r].push({event:i,listener:p}),y.addEventListener(i,p)},o.removeBufferListeners=function(r){var i=this.sourceBuffer[r];if(!i)return;this.listeners[r].forEach(function(t){i.removeEventListener(t.event,t.listener)})},a}()},"./src/controller/buffer-operation-queue.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"default",function(){return L});var j=C("./src/utils/logger.ts"),L=function(){function R(k){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=k}var B=R.prototype;return B.append=function(e,A){var g=this.queues[A];g.push(e),g.length===1&&this.buffers[A]&&this.executeNext(A)},B.insertAbort=function(e,A){var g=this.queues[A];g.unshift(e),this.executeNext(A)},B.appendBlocker=function(e){var A,g=new Promise(function(l){A=l}),c={execute:A,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(c,e),g},B.executeNext=function(e){var A=this.buffers,g=this.queues,c=A[e],l=g[e];if(l.length){var n=l[0];try{n.execute()}catch(a){j.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),n.onError(a),(!c||!c.updating)&&(l.shift(),this.executeNext(e))}}},B.shiftAndExecuteNext=function(e){this.queues[e].shift(),this.executeNext(e)},B.current=function(e){return this.queues[e][0]},R}()},"./src/controller/cap-level-controller.ts":function(te,H,C){"use strict";C.r(H);var j=C("./src/events.ts");function L(k,e){for(var A=0;A<e.length;A++){var g=e[A];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(k,g.key,g)}}function R(k,e,A){return e&&L(k.prototype,e),A&&L(k,A),k}var B=function(){function k(A){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=A,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var e=k.prototype;return e.setStreamController=function(g){this.streamController=g},e.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},e.registerListeners=function(){var g=this.hls;g.on(j.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),g.on(j.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),g.on(j.Events.MANIFEST_PARSED,this.onManifestParsed,this),g.on(j.Events.BUFFER_CODECS,this.onBufferCodecs,this),g.on(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},e.unregisterListener=function(){var g=this.hls;g.off(j.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),g.off(j.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),g.off(j.Events.MANIFEST_PARSED,this.onManifestParsed,this),g.off(j.Events.BUFFER_CODECS,this.onBufferCodecs,this),g.off(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},e.onFpsDropLevelCapping=function(g,c){k.isLevelAllowed(c.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(c.droppedLevel)},e.onMediaAttaching=function(g,c){this.media=c.media instanceof HTMLVideoElement?c.media:null},e.onManifestParsed=function(g,c){var l=this.hls;this.restrictedLevels=[],this.firstLevel=c.firstLevel,l.config.capLevelToPlayerSize&&c.video&&this.startCapping()},e.onBufferCodecs=function(g,c){var l=this.hls;l.config.capLevelToPlayerSize&&c.video&&this.startCapping()},e.onMediaDetaching=function(){this.stopCapping()},e.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var g=this.hls.levels;if(g.length){var c=this.hls;c.autoLevelCapping=this.getMaxLevel(g.length-1),c.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=c.autoLevelCapping}}},e.getMaxLevel=function(g){var c=this,l=this.hls.levels;if(!l.length)return-1;var n=l.filter(function(a,o){return k.isLevelAllowed(o,c.restrictedLevels)&&o<=g});return this.clientRect=null,k.getMaxLevelByMediaSize(n,this.mediaWidth,this.mediaHeight)},e.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()},e.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},e.getDimensions=function(){if(this.clientRect)return this.clientRect;var g=this.media,c={width:0,height:0};if(g){var l=g.getBoundingClientRect();c.width=l.width,c.height=l.height,!c.width&&!c.height&&(c.width=l.right-l.left||g.width||0,c.height=l.bottom-l.top||g.height||0)}return this.clientRect=c,c},k.isLevelAllowed=function(g,c){return c===void 0&&(c=[]),c.indexOf(g)===-1},k.getMaxLevelByMediaSize=function(g,c,l){if(!g||!g.length)return-1;for(var n=function(i,t){return t?i.width!==t.width||i.height!==t.height:!0},a=g.length-1,o=0;o<g.length;o+=1){var s=g[o];if((s.width>=c||s.height>=l)&&n(s,g[o+1])){a=o;break}}return a},R(k,[{key:"mediaWidth",get:function(){return this.getDimensions().width*k.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*k.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var g=1;try{g=self.devicePixelRatio}catch(c){}return g}}]),k}();H.default=B},"./src/controller/cmcd-controller.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"default",function(){return n});var j=C("./src/events.ts"),L=C("./src/types/cmcd.ts"),R=C("./src/utils/buffer-helper.ts"),B=C("./src/utils/logger.ts");function k(a,o){for(var s=0;s<o.length;s++){var r=o[s];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(a,r.key,r)}}function e(a,o,s){return o&&k(a.prototype,o),s&&k(a,s),a}function A(a,o){var s=typeof Symbol!="undefined"&&a[Symbol.iterator]||a["@@iterator"];if(s)return(s=s.call(a)).next.bind(s);if(Array.isArray(a)||(s=g(a))||o&&a&&typeof a.length=="number"){s&&(a=s);var r=0;return function(){return r>=a.length?{done:!0}:{done:!1,value:a[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function g(a,o){if(!a)return;if(typeof a=="string")return c(a,o);var s=Object.prototype.toString.call(a).slice(8,-1);if(s==="Object"&&a.constructor&&(s=a.constructor.name),s==="Map"||s==="Set")return Array.from(a);if(s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return c(a,o)}function c(a,o){(o==null||o>a.length)&&(o=a.length);for(var s=0,r=new Array(o);s<o;s++)r[s]=a[s];return r}function l(){return l=Object.assign||function(a){for(var o=1;o<arguments.length;o++){var s=arguments[o];for(var r in s)Object.prototype.hasOwnProperty.call(s,r)&&(a[r]=s[r])}return a},l.apply(this,arguments)}var n=function(){function a(s){var r=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(){r.initialized&&(r.starved=!0),r.buffering=!0},this.onPlaying=function(){r.initialized||(r.initialized=!0),r.buffering=!1},this.applyPlaylistData=function(y){try{r.apply(y,{ot:L.CMCDObjectType.MANIFEST,su:!r.initialized})}catch(p){B.logger.warn("Could not generate manifest CMCD data.",p)}},this.applyFragmentData=function(y){try{var p=y.frag,m=r.hls.levels[p.level],E=r.getObjectType(p),_={d:p.duration*1e3,ot:E};(E===L.CMCDObjectType.VIDEO||E===L.CMCDObjectType.AUDIO||E==L.CMCDObjectType.MUXED)&&(_.br=m.bitrate/1e3,_.tb=r.getTopBandwidth(E),_.bl=r.getBufferLength(E)),r.apply(y,_)}catch(h){B.logger.warn("Could not generate segment CMCD data.",h)}},this.hls=s;var i=this.config=s.config,t=i.cmcd;t!=null&&(i.pLoader=this.createPlaylistLoader(),i.fLoader=this.createFragmentLoader(),this.sid=t.sessionId||a.uuid(),this.cid=t.contentId,this.useHeaders=t.useHeaders===!0,this.registerListeners())}var o=a.prototype;return o.registerListeners=function(){var r=this.hls;r.on(j.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.on(j.Events.MEDIA_DETACHED,this.onMediaDetached,this),r.on(j.Events.BUFFER_CREATED,this.onBufferCreated,this)},o.unregisterListeners=function(){var r=this.hls;r.off(j.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.off(j.Events.MEDIA_DETACHED,this.onMediaDetached,this),r.off(j.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},o.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},o.onMediaAttached=function(r,i){this.media=i.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},o.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},o.onBufferCreated=function(r,i){var t,y;this.audioBuffer=(t=i.tracks.audio)===null||t===void 0?void 0:t.buffer,this.videoBuffer=(y=i.tracks.video)===null||y===void 0?void 0:y.buffer},o.createData=function(){var r;return{v:L.CMCDVersion,sf:L.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(r=this.media)===null||r===void 0?void 0:r.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},o.apply=function(r,i){i===void 0&&(i={}),l(i,this.createData());var t=i.ot===L.CMCDObjectType.INIT||i.ot===L.CMCDObjectType.VIDEO||i.ot===L.CMCDObjectType.MUXED;if(this.starved&&t&&(i.bs=!0,i.su=!0,this.starved=!1),i.su==null&&(i.su=this.buffering),this.useHeaders){var y=a.toHeaders(i);if(!Object.keys(y).length)return;r.headers||(r.headers={}),l(r.headers,y)}else{var p=a.toQuery(i);if(!p)return;r.url=a.appendQueryToUri(r.url,p)}},o.getObjectType=function(r){var i=r.type;return i==="subtitle"?L.CMCDObjectType.TIMED_TEXT:r.sn==="initSegment"?L.CMCDObjectType.INIT:i==="audio"?L.CMCDObjectType.AUDIO:i==="main"?this.hls.audioTracks.length?L.CMCDObjectType.VIDEO:L.CMCDObjectType.MUXED:void 0},o.getTopBandwidth=function(r){for(var i=0,t=r===L.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,y=A(t),p;!(p=y()).done;){var m=p.value;m.bitrate>i&&(i=m.bitrate)}return i>0?i:NaN},o.getBufferLength=function(r){var i=this.hls.media,t=r===L.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!t||!i)return NaN;var y=R.BufferHelper.bufferInfo(t,i.currentTime,this.config.maxBufferHole);return y.len*1e3},o.createPlaylistLoader=function(){var r=this.config.pLoader,i=this.applyPlaylistData,t=r||this.config.loader;return function(){function y(m){this.loader=void 0,this.loader=new t(m)}var p=y.prototype;return p.destroy=function(){this.loader.destroy()},p.abort=function(){this.loader.abort()},p.load=function(E,_,h){i(E),this.loader.load(E,_,h)},e(y,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),y}()},o.createFragmentLoader=function(){var r=this.config.fLoader,i=this.applyFragmentData,t=r||this.config.loader;return function(){function y(m){this.loader=void 0,this.loader=new t(m)}var p=y.prototype;return p.destroy=function(){this.loader.destroy()},p.abort=function(){this.loader.abort()},p.load=function(E,_,h){i(E),this.loader.load(E,_,h)},e(y,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),y}()},a.uuid=function(){var r=URL.createObjectURL(new Blob),i=r.toString();return URL.revokeObjectURL(r),i.substr(i.lastIndexOf("/")+1)},a.serialize=function(r){for(var i=[],t=function(I){return!Number.isNaN(I)&&I!=null&&I!==""&&I!==!1},y=function(I){return Math.round(I)},p=function(I){return y(I/100)*100},m=function(I){return encodeURIComponent(I)},E={br:y,d:y,bl:p,dl:p,mtp:p,nor:m,rtp:p,tb:y},_=Object.keys(r||{}).sort(),h=A(_),u;!(u=h()).done;){var d=u.value,f=r[d];if(!t(f))continue;if(d==="v"&&f===1)continue;if(d=="pr"&&f===1)continue;var T=E[d];T&&(f=T(f));var b=typeof f,S=void 0;d==="ot"||d==="sf"||d==="st"?S=d+"="+f:b==="boolean"?S=d:b==="number"?S=d+"="+f:S=d+"="+JSON.stringify(f),i.push(S)}return i.join(",")},a.toHeaders=function(r){for(var i=Object.keys(r),t={},y=["Object","Request","Session","Status"],p=[{},{},{},{}],m={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},E=0,_=i;E<_.length;E++){var h=_[E],u=m[h]!=null?m[h]:1;p[u][h]=r[h]}for(var d=0;d<p.length;d++){var f=a.serialize(p[d]);f&&(t["CMCD-"+y[d]]=f)}return t},a.toQuery=function(r){return"CMCD="+encodeURIComponent(a.serialize(r))},a.appendQueryToUri=function(r,i){if(!i)return r;var t=r.includes("?")?"&":"?";return""+r+t+i},a}()},"./src/controller/eme-controller.ts":function(te,H,C){"use strict";C.r(H);var j=C("./src/events.ts"),L=C("./src/errors.ts"),R=C("./src/utils/logger.ts"),B=C("./src/utils/mediakeys-helper.ts");function k(n,a){for(var o=0;o<a.length;o++){var s=a[o];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(n,s.key,s)}}function e(n,a,o){return a&&k(n.prototype,a),o&&k(n,o),n}var A=3,g=function(a,o,s){var r={audioCapabilities:[],videoCapabilities:[]};return a.forEach(function(i){r.audioCapabilities.push({contentType:'audio/mp4; codecs="'+i+'"',robustness:s.audioRobustness||""})}),o.forEach(function(i){r.videoCapabilities.push({contentType:'video/mp4; codecs="'+i+'"',robustness:s.videoRobustness||""})}),[r]},c=function(a,o,s,r){switch(a){case B.KeySystems.WIDEVINE:return g(o,s,r);default:throw new Error("Unknown key-system: "+a)}},l=function(){function n(o){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=o,this._config=o.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 a=n.prototype;return a.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},a._registerListeners=function(){this.hls.on(j.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(j.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(j.Events.MANIFEST_PARSED,this.onManifestParsed,this)},a._unregisterListeners=function(){this.hls.off(j.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(j.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(j.Events.MANIFEST_PARSED,this.onManifestParsed,this)},a.getLicenseServerUrl=function(s){switch(s){case B.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+s+'"')},a._attemptKeySystemAccess=function(s,r,i){var t=this,y=c(s,r,i,this._drmSystemOptions);R.logger.log("Requesting encrypted media key-system access");var p=this.requestMediaKeySystemAccess(s,y);this.mediaKeysPromise=p.then(function(m){return t._onMediaKeySystemAccessObtained(s,m)}),p.catch(function(m){R.logger.error('Failed to obtain key-system "'+s+'" access:',m)})},a._onMediaKeySystemAccessObtained=function(s,r){var i=this;R.logger.log('Access for key-system "'+s+'" obtained');var t={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:r,mediaKeySystemDomain:s};this._mediaKeysList.push(t);var y=Promise.resolve().then(function(){return r.createMediaKeys()}).then(function(p){return t.mediaKeys=p,R.logger.log('Media-keys created for key-system "'+s+'"'),i._onMediaKeysCreated(),p});return y.catch(function(p){R.logger.error("Failed to create media-keys:",p)}),y},a._onMediaKeysCreated=function(){var s=this;this._mediaKeysList.forEach(function(r){r.mediaKeysSession||(r.mediaKeysSession=r.mediaKeys.createSession(),s._onNewMediaKeySession(r.mediaKeysSession))})},a._onNewMediaKeySession=function(s){var r=this;R.logger.log("New key-system session "+s.sessionId),s.addEventListener("message",function(i){r._onKeySessionMessage(s,i.message)},!1)},a._onKeySessionMessage=function(s,r){R.logger.log("Got EME message event, creating license request"),this._requestLicense(r,function(i){R.logger.log("Received license data (length: "+(i&&i.byteLength)+"), updating key-session"),s.update(i)})},a.onMediaEncrypted=function(s){var r=this;if(R.logger.log('Media is encrypted using "'+s.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(j.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var i=function(y){if(!r._media)return;r._attemptSetMediaKeys(y),r._generateRequestWithPreferredKeySession(s.initDataType,s.initData)};this.mediaKeysPromise.then(i).catch(i)},a._attemptSetMediaKeys=function(s){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var r=this._mediaKeysList[0];if(!r||!r.mediaKeys){R.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(j.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}R.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(r.mediaKeys),this._hasSetMediaKeys=!0}},a._generateRequestWithPreferredKeySession=function(s,r){var i=this,t=this._mediaKeysList[0];if(!t){R.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(j.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(t.mediaKeysSessionInitialized){R.logger.warn("Key-Session already initialized but requested again");return}var y=t.mediaKeysSession;if(!y){R.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(j.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!r){R.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(j.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}R.logger.log('Generating key-session request for "'+s+'" init data type'),t.mediaKeysSessionInitialized=!0,y.generateRequest(s,r).then(function(){R.logger.debug("Key-session generation succeeded")}).catch(function(p){R.logger.error("Error generating key-session request:",p),i.hls.trigger(j.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},a._createLicenseXhr=function(s,r,i){var t=new XMLHttpRequest;t.responseType="arraybuffer",t.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,t,s,r,i);var y=this._licenseXhrSetup;if(y)try{y.call(this.hls,t,s),y=void 0}catch(p){R.logger.error(p)}try{t.readyState||t.open("POST",s,!0),y&&y.call(this.hls,t,s)}catch(p){throw new Error("issue setting up KeySystem license XHR "+p)}return t},a._onLicenseRequestReadyStageChange=function(s,r,i,t){switch(s.readyState){case 4:if(s.status===200){this._requestLicenseFailureCount=0,R.logger.log("License request succeeded");var y=s.response,p=this._licenseResponseCallback;if(p)try{y=p.call(this.hls,s,r)}catch(E){R.logger.error(E)}t(y)}else{if(R.logger.error("License Request XHR failed ("+r+"). Status: "+s.status+" ("+s.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>A){this.hls.trigger(j.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var m=A-this._requestLicenseFailureCount+1;R.logger.warn("Retrying license request, "+m+" attempts left"),this._requestLicense(i,t)}break}},a._generateLicenseRequestChallenge=function(s,r){switch(s.mediaKeySystemDomain){case B.KeySystems.WIDEVINE:return r}throw new Error("unsupported key-system: "+s.mediaKeySystemDomain)},a._requestLicense=function(s,r){R.logger.log("Requesting content license for key-system");var i=this._mediaKeysList[0];if(!i){R.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(j.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var t=this.getLicenseServerUrl(i.mediaKeySystemDomain),y=this._createLicenseXhr(t,s,r);R.logger.log("Sending license request to URL: "+t);var p=this._generateLicenseRequestChallenge(i,s);y.send(p)}catch(m){R.logger.error("Failure requesting DRM license: "+m),this.hls.trigger(j.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},a.onMediaAttached=function(s,r){if(!this._emeEnabled)return;var i=r.media;this._media=i,i.addEventListener("encrypted",this._onMediaEncrypted)},a.onMediaDetached=function(){var s=this._media,r=this._mediaKeysList;if(!s)return;s.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(r.map(function(i){if(i.mediaKeysSession)return i.mediaKeysSession.close().catch(function(){})})).then(function(){return s.setMediaKeys(null)}).catch(function(){})},a.onManifestParsed=function(s,r){if(!this._emeEnabled)return;var i=r.levels.map(function(y){return y.audioCodec}).filter(function(y){return!!y}),t=r.levels.map(function(y){return y.videoCodec}).filter(function(y){return!!y});this._attemptKeySystemAccess(B.KeySystems.WIDEVINE,i,t)},e(n,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),n}();H.default=l},"./src/controller/fps-controller.ts":function(te,H,C){"use strict";C.r(H);var j=C("./src/events.ts"),L=C("./src/utils/logger.ts"),R=function(){function B(e){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=e,this.registerListeners()}var k=B.prototype;return k.setStreamController=function(A){this.streamController=A},k.registerListeners=function(){this.hls.on(j.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},k.unregisterListeners=function(){this.hls.off(j.Events.MEDIA_ATTACHING,this.onMediaAttaching)},k.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},k.onMediaAttaching=function(A,g){var c=this.hls.config;if(c.capLevelOnFPSDrop){var l=g.media instanceof self.HTMLVideoElement?g.media:null;this.media=l,l&&typeof l.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),c.fpsDroppedMonitoringPeriod)}},k.checkFPS=function(A,g,c){var l=performance.now();if(g){if(this.lastTime){var n=l-this.lastTime,a=c-this.lastDroppedFrames,o=g-this.lastDecodedFrames,s=1e3*a/n,r=this.hls;if(r.trigger(j.Events.FPS_DROP,{currentDropped:a,currentDecoded:o,totalDroppedFrames:c}),s>0&&a>r.config.fpsDroppedMonitoringThreshold*o){var i=r.currentLevel;L.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+i),i>0&&(r.autoLevelCapping===-1||r.autoLevelCapping>=i)&&(i=i-1,r.trigger(j.Events.FPS_DROP_LEVEL_CAPPING,{level:i,droppedLevel:r.currentLevel}),r.autoLevelCapping=i,this.streamController.nextLevelSwitch())}}this.lastTime=l,this.lastDroppedFrames=c,this.lastDecodedFrames=g}},k.checkFPSInterval=function(){var A=this.media;if(A)if(this.isVideoPlaybackQualityAvailable){var g=A.getVideoPlaybackQuality();this.checkFPS(A,g.totalVideoFrames,g.droppedVideoFrames)}else this.checkFPS(A,A.webkitDecodedFrameCount,A.webkitDroppedFrameCount)},B}();H.default=R},"./src/controller/fragment-finders.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"findFragmentByPDT",function(){return R}),C.d(H,"findFragmentByPTS",function(){return B}),C.d(H,"fragmentWithinToleranceTest",function(){return k}),C.d(H,"pdtWithinToleranceTest",function(){return e}),C.d(H,"findFragWithCC",function(){return A});var j=C("./src/polyfills/number.ts"),L=C("./src/utils/binary-search.ts");function R(g,c,l){if(c===null||!Array.isArray(g)||!g.length||!Object(j.isFiniteNumber)(c))return null;var n=g[0].programDateTime;if(c<(n||0))return null;var a=g[g.length-1].endProgramDateTime;if(c>=(a||0))return null;l=l||0;for(var o=0;o<g.length;++o){var s=g[o];if(e(c,l,s))return s}return null}function B(g,c,l,n){l===void 0&&(l=0),n===void 0&&(n=0);var a=null;if(g?a=c[g.sn-c[0].sn+1]||null:l===0&&c[0].start===0&&(a=c[0]),a&&k(l,n,a)===0)return a;var o=L.default.search(c,k.bind(null,l,n));return o||a}function k(g,c,l){g===void 0&&(g=0),c===void 0&&(c=0);var n=Math.min(c,l.duration+(l.deltaPTS?l.deltaPTS:0));return l.start+l.duration-n<=g?1:l.start-n>g&&l.start?-1:0}function e(g,c,l){var n=Math.min(c,l.duration+(l.deltaPTS?l.deltaPTS:0))*1e3,a=l.endProgramDateTime||0;return a-n>g}function A(g,c){return L.default.search(g,function(l){return l.cc<c?1:l.cc>c?-1:0})}},"./src/controller/fragment-tracker.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"FragmentState",function(){return R}),C.d(H,"FragmentTracker",function(){return B});var j=C("./src/events.ts"),L=C("./src/types/loader.ts"),R;(function(A){A.NOT_LOADED="NOT_LOADED",A.BACKTRACKED="BACKTRACKED",A.APPENDING="APPENDING",A.PARTIAL="PARTIAL",A.OK="OK"})(R||(R={}));var B=function(){function A(c){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=c,this._registerListeners()}var g=A.prototype;return g._registerListeners=function(){var l=this.hls;l.on(j.Events.BUFFER_APPENDED,this.onBufferAppended,this),l.on(j.Events.FRAG_BUFFERED,this.onFragBuffered,this),l.on(j.Events.FRAG_LOADED,this.onFragLoaded,this)},g._unregisterListeners=function(){var l=this.hls;l.off(j.Events.BUFFER_APPENDED,this.onBufferAppended,this),l.off(j.Events.FRAG_BUFFERED,this.onFragBuffered,this),l.off(j.Events.FRAG_LOADED,this.onFragLoaded,this)},g.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},g.getAppendedFrag=function(l,n){if(n===L.PlaylistLevelType.MAIN){var a=this.activeFragment,o=this.activeParts;if(!a)return null;if(o)for(var s=o.length;s--;){var r=o[s],i=r?r.end:a.appendedPTS;if(r.start<=l&&i!==void 0&&l<=i)return s>9&&(this.activeParts=o.slice(s-9)),r}else if(a.start<=l&&a.appendedPTS!==void 0&&l<=a.appendedPTS)return a}return this.getBufferedFrag(l,n)},g.getBufferedFrag=function(l,n){for(var a=this.fragments,o=Object.keys(a),s=o.length;s--;){var r=a[o[s]];if((r==null?void 0:r.body.type)===n&&r.buffered){var i=r.body;if(i.start<=l&&l<=i.end)return i}}return null},g.detectEvictedFragments=function(l,n,a){var o=this;Object.keys(this.fragments).forEach(function(s){var r=o.fragments[s];if(!r)return;if(!r.buffered){r.body.type===a&&o.removeFragment(r.body);return}var i=r.range[l];if(!i)return;i.time.some(function(t){var y=!o.isTimeBuffered(t.startPTS,t.endPTS,n);return y&&o.removeFragment(r.body),y})})},g.detectPartialFragments=function(l){var n=this,a=this.timeRanges,o=l.frag,s=l.part;if(!a||o.sn==="initSegment")return;var r=e(o),i=this.fragments[r];if(!i)return;Object.keys(a).forEach(function(t){var y=o.elementaryStreams[t];if(!y)return;var p=a[t],m=s!==null||y.partial===!0;i.range[t]=n.getBufferedTimes(o,s,m,p)}),i.backtrack=i.loaded=null,Object.keys(i.range).length?i.buffered=!0:this.removeFragment(i.body)},g.fragBuffered=function(l){var n=e(l),a=this.fragments[n];a&&(a.backtrack=a.loaded=null,a.buffered=!0)},g.getBufferedTimes=function(l,n,a,o){for(var s={time:[],partial:a},r=n?n.start:l.start,i=n?n.end:l.end,t=l.minEndPTS||i,y=l.maxStartPTS||r,p=0;p<o.length;p++){var m=o.start(p)-this.bufferPadding,E=o.end(p)+this.bufferPadding;if(y>=m&&t<=E){s.time.push({startPTS:Math.max(r,o.start(p)),endPTS:Math.min(i,o.end(p))});break}else if(r<E&&i>m)s.partial=!0,s.time.push({startPTS:Math.max(r,o.start(p)),endPTS:Math.min(i,o.end(p))});else if(i<=m)break}return s},g.getPartialFragment=function(l){var n=null,a,o,s,r=0,i=this.bufferPadding,t=this.fragments;return Object.keys(t).forEach(function(y){var p=t[y];if(!p)return;k(p)&&(o=p.body.start-i,s=p.body.end+i,l>=o&&l<=s&&(a=Math.min(l-o,s-l),r<=a&&(n=p.body,r=a)))}),n},g.getState=function(l){var n=e(l),a=this.fragments[n];return a?a.buffered?k(a)?R.PARTIAL:R.OK:a.backtrack?R.BACKTRACKED:R.APPENDING:R.NOT_LOADED},g.backtrack=function(l,n){var a=e(l),o=this.fragments[a];if(!o||o.backtrack)return null;var s=o.backtrack=n||o.loaded;return o.loaded=null,s},g.getBacktrackData=function(l){var n=e(l),a=this.fragments[n];if(a){var o,s=a.backtrack;if(s!=null&&(o=s.payload)!==null&&o!==void 0&&o.byteLength)return s;this.removeFragment(l)}return null},g.isTimeBuffered=function(l,n,a){for(var o,s,r=0;r<a.length;r++){if(o=a.start(r)-this.bufferPadding,s=a.end(r)+this.bufferPadding,l>=o&&n<=s)return!0;if(n<=o)return!1}return!1},g.onFragLoaded=function(l,n){var a=n.frag,o=n.part;if(a.sn==="initSegment"||a.bitrateTest||o)return;var s=e(a);this.fragments[s]={body:a,loaded:n,backtrack:null,buffered:!1,range:Object.create(null)}},g.onBufferAppended=function(l,n){var a=this,o=n.frag,s=n.part,r=n.timeRanges;if(o.type===L.PlaylistLevelType.MAIN)if(this.activeFragment=o,s){var i=this.activeParts;i||(this.activeParts=i=[]),i.push(s)}else this.activeParts=null;this.timeRanges=r,Object.keys(r).forEach(function(t){var y=r[t];if(a.detectEvictedFragments(t,y),!s)for(var p=0;p<y.length;p++)o.appendedPTS=Math.max(y.end(p),o.appendedPTS||0)})},g.onFragBuffered=function(l,n){this.detectPartialFragments(n)},g.hasFragment=function(l){var n=e(l);return!!this.fragments[n]},g.removeFragmentsInRange=function(l,n,a){var o=this;Object.keys(this.fragments).forEach(function(s){var r=o.fragments[s];if(!r)return;if(r.buffered){var i=r.body;i.type===a&&i.start<n&&i.end>l&&o.removeFragment(i)}})},g.removeFragment=function(l){var n=e(l);l.stats.loaded=0,l.clearElementaryStreamInfo(),delete this.fragments[n]},g.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},A}();function k(A){var g,c;return A.buffered&&(((g=A.range.video)===null||g===void 0?void 0:g.partial)||((c=A.range.audio)===null||c===void 0?void 0:c.partial))}function e(A){return A.type+"_"+A.level+"_"+A.urlId+"_"+A.sn}},"./src/controller/gap-controller.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"STALL_MINIMUM_DURATION_MS",function(){return k}),C.d(H,"MAX_START_GAP_JUMP",function(){return e}),C.d(H,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return A}),C.d(H,"SKIP_BUFFER_RANGE_START",function(){return g}),C.d(H,"default",function(){return c});var j=C("./src/utils/buffer-helper.ts"),L=C("./src/errors.ts"),R=C("./src/events.ts"),B=C("./src/utils/logger.ts"),k=250,e=2,A=.1,g=.05,c=function(){function l(a,o,s,r){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=a,this.media=o,this.fragmentTracker=s,this.hls=r}var n=l.prototype;return n.destroy=function(){this.hls=this.fragmentTracker=this.media=null},n.poll=function(o){var s=this.config,r=this.media,i=this.stalled,t=r.currentTime,y=r.seeking,p=this.seeking&&!y,m=!this.seeking&&y;if(this.seeking=y,t!==o){if(this.moved=!0,i!==null){if(this.stallReported){var E=self.performance.now()-i;B.logger.warn("playback not stuck anymore @"+t+", after "+Math.round(E)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((m||p)&&(this.stalled=null),r.paused||r.ended||r.playbackRate===0||!j.BufferHelper.getBuffered(r).length)return;var _=j.BufferHelper.bufferInfo(r,t,0),h=_.len>0,u=_.nextStart||0;if(!h&&!u)return;if(y){var d=_.len>e,f=!u||u-t>e&&!this.fragmentTracker.getPartialFragment(t);if(d||f)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var T,b=Math.max(u,_.start||0)-t,S=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,D=S==null||((T=S.details)===null||T===void 0)?void 0:T.live,I=D?S.details.targetduration*2:e;if(b>0&&b<=I){this._trySkipBufferHole(null);return}}var w=self.performance.now();if(i===null){this.stalled=w;return}var P=w-i;!y&&P>=k&&this._reportStall(_.len);var U=j.BufferHelper.bufferInfo(r,t,s.maxBufferHole);this._tryFixBufferStall(U,P)},n._tryFixBufferStall=function(o,s){var r=this.config,i=this.fragmentTracker,t=this.media,y=t.currentTime,p=i.getPartialFragment(y);if(p){var m=this._trySkipBufferHole(p);if(m)return}o.len>r.maxBufferHole&&s>r.highBufferWatchdogPeriod*1e3&&(B.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},n._reportStall=function(o){var s=this.hls,r=this.media,i=this.stallReported;i||(this.stallReported=!0,B.logger.warn("Playback stalling at @"+r.currentTime+" due to low buffer (buffer="+o+")"),s.trigger(R.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:o}))},n._trySkipBufferHole=function(o){for(var s=this.config,r=this.hls,i=this.media,t=i.currentTime,y=0,p=j.BufferHelper.getBuffered(i),m=0;m<p.length;m++){var E=p.start(m);if(t+s.maxBufferHole>=y&&t<E){var _=Math.max(E+g,i.currentTime+A);return B.logger.warn("skipping hole, adjusting currentTime from "+t+" to "+_),this.moved=!0,this.stalled=null,i.currentTime=_,o&&r.trigger(R.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+t+" to "+_,frag:o}),_}y=p.end(m)}return 0},n._tryNudgeBuffer=function(){var o=this.config,s=this.hls,r=this.media,i=r.currentTime,t=(this.nudgeRetry||0)+1;if(this.nudgeRetry=t,t<o.nudgeMaxRetry){var y=i+t*o.nudgeOffset;B.logger.warn("Nudging 'currentTime' from "+i+" to "+y),r.currentTime=y,s.trigger(R.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else B.logger.error("Playhead still not moving while enough data buffered @"+i+" after "+o.nudgeMaxRetry+" nudges"),s.trigger(R.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},l}()},"./src/controller/id3-track-controller.ts":function(te,H,C){"use strict";C.r(H);var j=C("./src/events.ts"),L=C("./src/utils/texttrack-utils.ts"),R=C("./src/demux/id3.ts"),B=.25,k=function(){function e(g){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=g,this._registerListeners()}var A=e.prototype;return A.destroy=function(){this._unregisterListeners()},A._registerListeners=function(){var c=this.hls;c.on(j.Events.MEDIA_ATTACHED,this.onMediaAttached,this),c.on(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),c.on(j.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),c.on(j.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},A._unregisterListeners=function(){var c=this.hls;c.off(j.Events.MEDIA_ATTACHED,this.onMediaAttached,this),c.off(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),c.off(j.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),c.off(j.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},A.onMediaAttached=function(c,l){this.media=l.media},A.onMediaDetaching=function(){if(!this.id3Track)return;Object(L.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},A.getID3Track=function(c){if(!this.media)return;for(var l=0;l<c.length;l++){var n=c[l];if(n.kind==="metadata"&&n.label==="id3")return Object(L.sendAddTrackEvent)(n,this.media),n}return this.media.addTextTrack("metadata","id3")},A.onFragParsingMetadata=function(c,l){if(!this.media)return;var n=l.frag,a=l.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var o=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,s=0;s<a.length;s++){var r=R.getID3Frames(a[s].data);if(r){var i=a[s].pts,t=s<a.length-1?a[s+1].pts:n.end,y=t-i;y<=0&&(t=i+B);for(var p=0;p<r.length;p++){var m=r[p];if(!R.isTimeStampFrame(m)){var E=new o(i,t,"");E.value=m,this.id3Track.addCue(E)}}}}},A.onBufferFlushing=function(c,l){var n=l.startOffset,a=l.endOffset,o=l.type;if(!o||o==="audio"){var s=this.id3Track;s&&Object(L.removeCuesInRange)(s,n,a)}},e}();H.default=k},"./src/controller/latency-controller.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"default",function(){return e});var j=C("./src/errors.ts"),L=C("./src/events.ts"),R=C("./src/utils/logger.ts");function B(A,g){for(var c=0;c<g.length;c++){var l=g[c];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(A,l.key,l)}}function k(A,g,c){return g&&B(A.prototype,g),c&&B(A,c),A}var e=function(){function A(c){var l=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 l.timeupdate()},this.hls=c,this.config=c.config,this.registerListeners()}var g=A.prototype;return g.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},g.registerListeners=function(){this.hls.on(L.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(L.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(L.Events.ERROR,this.onError,this)},g.unregisterListeners=function(){this.hls.off(L.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(L.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(L.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(L.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(L.Events.ERROR,this.onError)},g.onMediaAttached=function(l,n){this.media=n.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},g.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},g.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},g.onLevelUpdated=function(l,n){var a=n.details;this.levelDetails=a,a.advanced&&this.timeupdate(),!a.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},g.onError=function(l,n){if(n.details!==j.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,R.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},g.timeupdate=function(){var l=this.media,n=this.levelDetails;if(!l||!n)return;this.currentTime=l.currentTime;var a=this.computeLatency();if(a===null)return;this._latency=a;var o=this.config,s=o.lowLatencyMode,r=o.maxLiveSyncPlaybackRate;if(!s||r===1)return;var i=this.targetLatency;if(i===null)return;var t=a-i,y=Math.min(this.maxLatency,i+n.targetduration),p=t<y;if(n.live&&p&&t>.05&&this.forwardBufferLength>1){var m=Math.min(2,Math.max(1,r)),E=Math.round(2/(1+Math.exp(-.75*t-this.edgeStalled))*20)/20;l.playbackRate=Math.min(m,Math.max(1,E))}else l.playbackRate!==1&&l.playbackRate!==0&&(l.playbackRate=1)},g.estimateLiveEdge=function(){var l=this.levelDetails;return l===null?null:l.edge+l.age},g.computeLatency=function(){var l=this.estimateLiveEdge();return l===null?null:l-this.currentTime},k(A,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var l=this.config,n=this.levelDetails;return l.liveMaxLatencyDuration!==void 0?l.liveMaxLatencyDuration:n?l.liveMaxLatencyDurationCount*n.targetduration:0}},{key:"targetLatency",get:function(){var l=this.levelDetails;if(l===null)return null;var n=l.holdBack,a=l.partHoldBack,o=l.targetduration,s=this.config,r=s.liveSyncDuration,i=s.liveSyncDurationCount,t=s.lowLatencyMode,y=this.hls.userConfig,p=t&&a||n;(y.liveSyncDuration||y.liveSyncDurationCount||p===0)&&(p=r!==void 0?r:i*o);var m=o,E=1;return p+Math.min(this.stallCount*E,m)}},{key:"liveSyncPosition",get:function(){var l=this.estimateLiveEdge(),n=this.targetLatency,a=this.levelDetails;if(l===null||n===null||a===null)return null;var o=a.edge,s=l-n-this.edgeStalled,r=o-a.totalduration,i=o-(this.config.lowLatencyMode&&a.partTarget||a.targetduration);return Math.min(Math.max(r,s),i)}},{key:"drift",get:function(){var l=this.levelDetails;return l===null?1:l.drift}},{key:"edgeStalled",get:function(){var l=this.levelDetails;if(l===null)return 0;var n=(this.config.lowLatencyMode&&l.partTarget||l.targetduration)*3;return Math.max(l.age-n,0)}},{key:"forwardBufferLength",get:function(){var l=this.media,n=this.levelDetails;if(!l||!n)return 0;var a=l.buffered.length;return a?l.buffered.end(a-1):n.edge-this.currentTime}}]),A}()},"./src/controller/level-controller.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"default",function(){return s});var j=C("./src/types/level.ts"),L=C("./src/events.ts"),R=C("./src/errors.ts"),B=C("./src/utils/codecs.ts"),k=C("./src/controller/level-helper.ts"),e=C("./src/controller/base-playlist-controller.ts"),A=C("./src/types/loader.ts");function g(){return g=Object.assign||function(r){for(var i=1;i<arguments.length;i++){var t=arguments[i];for(var y in t)Object.prototype.hasOwnProperty.call(t,y)&&(r[y]=t[y])}return r},g.apply(this,arguments)}function c(r,i){for(var t=0;t<i.length;t++){var y=i[t];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(r,y.key,y)}}function l(r,i,t){return i&&c(r.prototype,i),t&&c(r,t),r}function n(r,i){r.prototype=Object.create(i.prototype),r.prototype.constructor=r,a(r,i)}function a(r,i){return a=Object.setPrototypeOf||function(y,p){return y.__proto__=p,y},a(r,i)}var o=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),s=function(r){n(i,r);function i(y){var p;return p=r.call(this,y,"[level-controller]")||this,p._levels=[],p._firstLevel=-1,p._startLevel=void 0,p.currentLevelIndex=-1,p.manualLevelIndex=-1,p.onParsedComplete=void 0,p._registerListeners(),p}var t=i.prototype;return t._registerListeners=function(){var p=this.hls;p.on(L.Events.MANIFEST_LOADED,this.onManifestLoaded,this),p.on(L.Events.LEVEL_LOADED,this.onLevelLoaded,this),p.on(L.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),p.on(L.Events.FRAG_LOADED,this.onFragLoaded,this),p.on(L.Events.ERROR,this.onError,this)},t._unregisterListeners=function(){var p=this.hls;p.off(L.Events.MANIFEST_LOADED,this.onManifestLoaded,this),p.off(L.Events.LEVEL_LOADED,this.onLevelLoaded,this),p.off(L.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),p.off(L.Events.FRAG_LOADED,this.onFragLoaded,this),p.off(L.Events.ERROR,this.onError,this)},t.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,r.prototype.destroy.call(this)},t.startLoad=function(){var p=this._levels;p.forEach(function(m){m.loadError=0}),r.prototype.startLoad.call(this)},t.onManifestLoaded=function(p,m){var E=[],_=[],h=[],u,d={},f,T=!1,b=!1,S=!1;if(m.levels.forEach(function(P){var U=P.attrs;T=T||!!(P.width&&P.height),b=b||!!P.videoCodec,S=S||!!P.audioCodec,o&&P.audioCodec&&P.audioCodec.indexOf("mp4a.40.34")!==-1&&(P.audioCodec=void 0);var O=P.bitrate+"-"+P.attrs.RESOLUTION+"-"+P.attrs.CODECS;f=d[O],f?f.url.push(P.url):(f=new j.Level(P),d[O]=f,E.push(f)),U&&(U.AUDIO&&Object(k.addGroupId)(f,"audio",U.AUDIO),U.SUBTITLES&&Object(k.addGroupId)(f,"text",U.SUBTITLES))}),(T||b)&&S&&(E=E.filter(function(P){var U=P.videoCodec,O=P.width,G=P.height;return!!U||!!(O&&G)})),E=E.filter(function(P){var U=P.audioCodec,O=P.videoCodec;return(!U||Object(B.isCodecSupportedInMp4)(U,"audio"))&&(!O||Object(B.isCodecSupportedInMp4)(O,"video"))}),m.audioTracks&&(_=m.audioTracks.filter(function(P){return!P.audioCodec||Object(B.isCodecSupportedInMp4)(P.audioCodec,"audio")}),Object(k.assignTrackIdsByGroup)(_)),m.subtitles&&(h=m.subtitles,Object(k.assignTrackIdsByGroup)(h)),E.length>0){u=E[0].bitrate,E.sort(function(P,U){return P.bitrate-U.bitrate}),this._levels=E;for(var D=0;D<E.length;D++)if(E[D].bitrate===u){this._firstLevel=D,this.log("manifest loaded, "+E.length+" level(s) found, first bitrate: "+u);break}var I=S&&!b,w={levels:E,audioTracks:_,subtitleTracks:h,firstLevel:this._firstLevel,stats:m.stats,audio:S,video:b,altAudio:!I&&_.some(function(P){return!!P.url})};this.hls.trigger(L.Events.MANIFEST_PARSED,w),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(L.Events.ERROR,{type:R.ErrorTypes.MEDIA_ERROR,details:R.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:m.url,reason:"no level with compatible codecs found in manifest"})},t.onError=function(p,m){if(r.prototype.onError.call(this,p,m),m.fatal)return;var E=m.context,_=this._levels[this.currentLevelIndex];if(E&&(E.type===A.PlaylistContextType.AUDIO_TRACK&&_.audioGroupIds&&E.groupId===_.audioGroupIds[_.urlId]||E.type===A.PlaylistContextType.SUBTITLE_TRACK&&_.textGroupIds&&E.groupId===_.textGroupIds[_.urlId])){this.redundantFailover(this.currentLevelIndex);return}var h=!1,u=!0,d;switch(m.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(m.frag){var f=this._levels[m.frag.level];f?(f.fragmentError++,f.fragmentError>this.hls.config.fragLoadingMaxRetry&&(d=m.frag.level)):d=m.frag.level}break;case R.ErrorDetails.LEVEL_LOAD_ERROR:case R.ErrorDetails.LEVEL_LOAD_TIMEOUT:E&&(E.deliveryDirectives&&(u=!1),d=E.level),h=!0;break;case R.ErrorDetails.REMUX_ALLOC_ERROR:d=m.level,h=!0;break}d!==void 0&&this.recoverLevel(m,d,h,u)},t.recoverLevel=function(p,m,E,_){var h=p.details,u=this._levels[m];if(u.loadError++,E){var d=this.retryLoadingOrFail(p);if(d)p.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(_){var f=u.url.length;if(f>1&&u.loadError<f)p.levelRetry=!0,this.redundantFailover(m);else if(this.manualLevelIndex===-1){var T=m===0?this._levels.length-1:m-1;this.currentLevelIndex!==T&&this._levels[T].loadError===0&&(this.warn(h+": switch to "+T),p.levelRetry=!0,this.hls.nextAutoLevel=T)}}},t.redundantFailover=function(p){var m=this._levels[p],E=m.url.length;if(E>1){var _=(m.urlId+1)%E;this.warn("Switching to redundant URL-id "+_),this._levels.forEach(function(h){h.urlId=_}),this.level=p}},t.onFragLoaded=function(p,m){var E=m.frag;if(E!==void 0&&E.type===A.PlaylistLevelType.MAIN){var _=this._levels[E.level];_!==void 0&&(_.fragmentError=0,_.loadError=0)}},t.onLevelLoaded=function(p,m){var E,_=m.level,h=m.details,u=this._levels[_];if(!u){var d;this.warn("Invalid level index "+_),(d=m.deliveryDirectives)!==null&&d!==void 0&&d.skip&&(h.deltaUpdateFailed=!0);return}_===this.currentLevelIndex?(u.fragmentError===0&&(u.loadError=0,this.retryCount=0),this.playlistLoaded(_,m,u.details)):(E=m.deliveryDirectives)!==null&&E!==void 0&&E.skip&&(h.deltaUpdateFailed=!0)},t.onAudioTrackSwitched=function(p,m){var E=this.hls.levels[this.currentLevelIndex];if(!E)return;if(E.audioGroupIds){for(var _=-1,h=this.hls.audioTracks[m.id].groupId,u=0;u<E.audioGroupIds.length;u++)if(E.audioGroupIds[u]===h){_=u;break}_!==E.urlId&&(E.urlId=_,this.startLoad())}},t.loadPlaylist=function(p){var m=this.currentLevelIndex,E=this._levels[m];if(this.canLoad&&E&&E.url.length>0){var _=E.urlId,h=E.url[_];if(p)try{h=p.addDirectives(h)}catch(u){this.warn("Could not construct new URL with HLS Delivery Directives: "+u)}this.log("Attempt loading level index "+m+(p?" at sn "+p.msn+" part "+p.part:"")+" with URL-id "+_+" "+h),this.clearTimer(),this.hls.trigger(L.Events.LEVEL_LOADING,{url:h,level:m,id:_,deliveryDirectives:p||null})}},t.removeLevel=function(p,m){var E=function(u,d){return d!==m},_=this._levels.filter(function(h,u){return u!==p?!0:h.url.length>1&&m!==void 0?(h.url=h.url.filter(E),h.audioGroupIds&&(h.audioGroupIds=h.audioGroupIds.filter(E)),h.textGroupIds&&(h.textGroupIds=h.textGroupIds.filter(E)),h.urlId=0,!0):!1}).map(function(h,u){var d=h.details;return d!=null&&d.fragments&&d.fragments.forEach(function(f){f.level=u}),h});this._levels=_,this.hls.trigger(L.Events.LEVELS_UPDATED,{levels:_})},l(i,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(p){var m,E=this._levels;if(E.length===0)return;if(this.currentLevelIndex===p&&(m=E[p])!==null&&m!==void 0&&m.details)return;if(p<0||p>=E.length){var _=p<0;if(this.hls.trigger(L.Events.ERROR,{type:R.ErrorTypes.OTHER_ERROR,details:R.ErrorDetails.LEVEL_SWITCH_ERROR,level:p,fatal:_,reason:"invalid level idx"}),_)return;p=Math.min(p,E.length-1)}this.clearTimer();var h=this.currentLevelIndex,u=E[h],d=E[p];this.log("switching to level "+p+" from "+h),this.currentLevelIndex=p;var f=g({},d,{level:p,maxBitrate:d.maxBitrate,uri:d.uri,urlId:d.urlId});delete f._urlId,this.hls.trigger(L.Events.LEVEL_SWITCHING,f);var T=d.details;if(!T||T.live){var b=this.switchParams(d.uri,u==null?void 0:u.details);this.loadPlaylist(b)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(p){this.manualLevelIndex=p,this._startLevel===void 0&&(this._startLevel=p),p!==-1&&(this.level=p)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(p){this._firstLevel=p}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var p=this.hls.config.startLevel;return p!==void 0?p:this._firstLevel}else return this._startLevel},set:function(p){this._startLevel=p}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(p){this.level=p,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=p)}}]),i}(e.default)},"./src/controller/level-helper.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"addGroupId",function(){return R}),C.d(H,"assignTrackIdsByGroup",function(){return B}),C.d(H,"updatePTS",function(){return k}),C.d(H,"updateFragPTSDTS",function(){return A}),C.d(H,"mergeDetails",function(){return g}),C.d(H,"mapPartIntersection",function(){return c}),C.d(H,"mapFragmentIntersection",function(){return l}),C.d(H,"adjustSliding",function(){return n}),C.d(H,"addSliding",function(){return a}),C.d(H,"computeReloadInterval",function(){return o}),C.d(H,"getFragmentWithSN",function(){return s}),C.d(H,"getPartWith",function(){return r});var j=C("./src/polyfills/number.ts"),L=C("./src/utils/logger.ts");function R(i,t,y){switch(t){case"audio":i.audioGroupIds||(i.audioGroupIds=[]),i.audioGroupIds.push(y);break;case"text":i.textGroupIds||(i.textGroupIds=[]),i.textGroupIds.push(y);break}}function B(i){var t={};i.forEach(function(y){var p=y.groupId||"";y.id=t[p]=t[p]||0,t[p]++})}function k(i,t,y){var p=i[t],m=i[y];e(p,m)}function e(i,t){var y=t.startPTS;if(Object(j.isFiniteNumber)(y)){var p=0,m;t.sn>i.sn?(p=y-i.start,m=i):(p=i.start-y,m=t),m.duration!==p&&(m.duration=p)}else if(t.sn>i.sn){var E=i.cc===t.cc;E&&i.minEndPTS?t.start=i.start+(i.minEndPTS-i.start):t.start=i.start+i.duration}else t.start=Math.max(i.start-t.duration,0)}function A(i,t,y,p,m,E){var _=p-y;_<=0&&(L.logger.warn("Fragment should have a positive duration",t),p=y+t.duration,E=m+t.duration);var h=y,u=p,d=t.startPTS,f=t.endPTS;if(Object(j.isFiniteNumber)(d)){var T=Math.abs(d-y);Object(j.isFiniteNumber)(t.deltaPTS)?t.deltaPTS=Math.max(T,t.deltaPTS):t.deltaPTS=T,h=Math.max(y,d),y=Math.min(y,d),m=Math.min(m,t.startDTS),u=Math.min(p,f),p=Math.max(p,f),E=Math.max(E,t.endDTS)}t.duration=p-y;var b=y-t.start;t.appendedPTS=p,t.start=t.startPTS=y,t.maxStartPTS=h,t.startDTS=m,t.endPTS=p,t.minEndPTS=u,t.endDTS=E;var S=t.sn;if(!i||S<i.startSN||S>i.endSN)return 0;var D,I=S-i.startSN,w=i.fragments;for(w[I]=t,D=I;D>0;D--)e(w[D],w[D-1]);for(D=I;D<w.length-1;D++)e(w[D],w[D+1]);return i.fragmentHint&&e(w[w.length-1],i.fragmentHint),i.PTSKnown=i.alignedSliding=!0,b}function g(i,t){for(var y=null,p=i.fragments,m=p.length-1;m>=0;m--){var E=p[m].initSegment;if(E){y=E;break}}i.fragmentHint&&delete i.fragmentHint.endPTS;var _=0,h;if(l(i,t,function(D,I){D.relurl&&(_=D.cc-I.cc),Object(j.isFiniteNumber)(D.startPTS)&&Object(j.isFiniteNumber)(D.endPTS)&&(I.start=I.startPTS=D.startPTS,I.startDTS=D.startDTS,I.appendedPTS=D.appendedPTS,I.maxStartPTS=D.maxStartPTS,I.endPTS=D.endPTS,I.endDTS=D.endDTS,I.minEndPTS=D.minEndPTS,I.duration=D.endPTS-D.startPTS,I.duration&&(h=I),t.PTSKnown=t.alignedSliding=!0),I.elementaryStreams=D.elementaryStreams,I.loader=D.loader,I.stats=D.stats,I.urlId=D.urlId,D.initSegment&&(I.initSegment=D.initSegment,y=D.initSegment)}),y){var u=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments;u.forEach(function(D){var I;(!D.initSegment||D.initSegment.relurl===((I=y)===null||I===void 0?void 0:I.relurl))&&(D.initSegment=y)})}if(t.skippedSegments&&(t.deltaUpdateFailed=t.fragments.some(function(D){return!D}),t.deltaUpdateFailed)){L.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var d=t.skippedSegments;d--;)t.fragments.shift();t.startSN=t.fragments[0].sn,t.startCC=t.fragments[0].cc}var f=t.fragments;if(_){L.logger.warn("discontinuity sliding from playlist, take drift into account");for(var T=0;T<f.length;T++)f[T].cc+=_}t.skippedSegments&&(t.startCC=t.fragments[0].cc),c(i.partList,t.partList,function(D,I){I.elementaryStreams=D.elementaryStreams,I.stats=D.stats}),h?A(t,h,h.startPTS,h.endPTS,h.startDTS,h.endDTS):n(i,t),f.length&&(t.totalduration=t.edge-f[0].start),t.driftStartTime=i.driftStartTime,t.driftStart=i.driftStart;var b=t.advancedDateTime;if(t.advanced&&b){var S=t.edge;t.driftStart||(t.driftStartTime=b,t.driftStart=S),t.driftEndTime=b,t.driftEnd=S}else t.driftEndTime=i.driftEndTime,t.driftEnd=i.driftEnd,t.advancedDateTime=i.advancedDateTime}function c(i,t,y){if(i&&t)for(var p=0,m=0,E=i.length;m<=E;m++){var _=i[m],h=t[m+p];_&&h&&_.index===h.index&&_.fragment.sn===h.fragment.sn?y(_,h):p--}}function l(i,t,y){for(var p=t.skippedSegments,m=Math.max(i.startSN,t.startSN)-t.startSN,E=(i.fragmentHint?1:0)+(p?t.endSN:Math.min(i.endSN,t.endSN))-t.startSN,_=t.startSN-i.startSN,h=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments,u=i.fragmentHint?i.fragments.concat(i.fragmentHint):i.fragments,d=m;d<=E;d++){var f=u[_+d],T=h[d];p&&!T&&d<p&&(T=t.fragments[d]=f),f&&T&&y(f,T)}}function n(i,t){var y=t.startSN+t.skippedSegments-i.startSN,p=i.fragments;if(y<0||y>=p.length)return;a(t,p[y].start)}function a(i,t){if(t){for(var y=i.fragments,p=i.skippedSegments;p<y.length;p++)y[p].start+=t;i.fragmentHint&&(i.fragmentHint.start+=t)}}function o(i,t){var y=1e3*i.levelTargetDuration,p=y/2,m=i.age,E=m>0&&m<y*3,_=t.loading.end-t.loading.start,h,u=i.availabilityDelay;if(i.updated===!1)if(E){var d=333*i.misses;h=Math.max(Math.min(p,_*2),d),i.availabilityDelay=(i.availabilityDelay||0)+h}else h=p;else E?(u=Math.min(u||y/2,m),i.availabilityDelay=u,h=u+y-m):h=y-_;return Math.round(h)}function s(i,t,y){if(!i||!i.details)return null;var p=i.details,m=p.fragments[t-p.startSN];return m||(m=p.fragmentHint,m&&m.sn===t?m:t<p.startSN&&y&&y.sn===t?y:null)}function r(i,t,y){if(!i||!i.details)return null;var p=i.details.partList;if(p)for(var m=p.length;m--;){var E=p[m];if(E.index===y&&E.fragment.sn===t)return E}return null}},"./src/controller/stream-controller.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"default",function(){return p});var j=C("./src/polyfills/number.ts"),L=C("./src/controller/base-stream-controller.ts"),R=C("./src/is-supported.ts"),B=C("./src/events.ts"),k=C("./src/utils/buffer-helper.ts"),e=C("./src/controller/fragment-tracker.ts"),A=C("./src/types/loader.ts"),g=C("./src/loader/fragment.ts"),c=C("./src/demux/transmuxer-interface.ts"),l=C("./src/types/transmuxer.ts"),n=C("./src/controller/gap-controller.ts"),a=C("./src/errors.ts"),o=C("./src/utils/logger.ts");function s(m,E){for(var _=0;_<E.length;_++){var h=E[_];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(m,h.key,h)}}function r(m,E,_){return E&&s(m.prototype,E),_&&s(m,_),m}function i(m,E){m.prototype=Object.create(E.prototype),m.prototype.constructor=m,t(m,E)}function t(m,E){return t=Object.setPrototypeOf||function(h,u){return h.__proto__=u,h},t(m,E)}var y=100,p=function(m){i(E,m);function E(h,u){var d;return d=m.call(this,h,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 _=E.prototype;return _._registerListeners=function(){var u=this.hls;u.on(B.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.on(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.on(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.on(B.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.on(B.Events.LEVEL_LOADING,this.onLevelLoading,this),u.on(B.Events.LEVEL_LOADED,this.onLevelLoaded,this),u.on(B.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),u.on(B.Events.ERROR,this.onError,this),u.on(B.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),u.on(B.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),u.on(B.Events.BUFFER_CREATED,this.onBufferCreated,this),u.on(B.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),u.on(B.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),u.on(B.Events.FRAG_BUFFERED,this.onFragBuffered,this)},_._unregisterListeners=function(){var u=this.hls;u.off(B.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.off(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.off(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.off(B.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.off(B.Events.LEVEL_LOADED,this.onLevelLoaded,this),u.off(B.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),u.off(B.Events.ERROR,this.onError,this),u.off(B.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),u.off(B.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),u.off(B.Events.BUFFER_CREATED,this.onBufferCreated,this),u.off(B.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),u.off(B.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),u.off(B.Events.FRAG_BUFFERED,this.onFragBuffered,this)},_.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},_.startLoad=function(u){if(this.levels){var d=this.lastCurrentTime,f=this.hls;if(this.stopLoad(),this.setInterval(y),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var T=f.startLevel;T===-1&&(f.config.testBandwidth?(T=0,this.bitrateTest=!0):T=f.nextAutoLevel),this.level=f.nextLoadLevel=T,this.loadedmetadata=!1}d>0&&u===-1&&(this.log("Override startPosition with lastCurrentTime @"+d.toFixed(3)),u=d),this.state=L.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=u,this.tick()}else this._forceStartLoad=!0,this.state=L.State.STOPPED},_.stopLoad=function(){this._forceStartLoad=!1,m.prototype.stopLoad.call(this)},_.doTick=function(){switch(this.state){case L.State.IDLE:this.doTickIdle();break;case L.State.WAITING_LEVEL:{var u,d=this.levels,f=this.level,T=d==null||((u=d[f])===null||u===void 0)?void 0:u.details;if(T&&(!T.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(T))break;this.state=L.State.IDLE;break}break}case L.State.FRAG_LOADING_WAITING_RETRY:{var b,S=self.performance.now(),D=this.retryDate;(!D||S>=D||(b=this.media)!==null&&b!==void 0&&b.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=L.State.IDLE)}break;default:break}this.onTickEnd()},_.onTickEnd=function(){m.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},_.doTickIdle=function(){var u,d,f=this.hls,T=this.levelLastLoaded,b=this.levels,S=this.media,D=f.config,I=f.nextLoadLevel;if(T===null||!S&&(this.startFragRequested||!D.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!b||!b[I])return;var w=b[I];this.level=f.nextLoadLevel=I;var P=w.details;if(!P||this.state===L.State.WAITING_LEVEL||P.live&&this.levelLastLoaded!==I){this.state=L.State.WAITING_LEVEL;return}var U=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:S,A.PlaylistLevelType.MAIN);if(U===null)return;var O=U.len,G=this.getMaxBufferLength(w.maxBitrate);if(O>=G)return;if(this._streamEnded(U,P)){var z={};this.altAudio&&(z.type="video"),this.hls.trigger(B.Events.BUFFER_EOS,z),this.state=L.State.ENDED;return}var ae=U.end,ie=this.getNextFragment(ae,P);if(this.couldBacktrack&&!this.fragPrevious&&ie&&ie.sn!=="initSegment"){var fe=ie.sn-P.startSN;fe>1&&(ie=P.fragments[fe-1],this.fragmentTracker.removeFragment(ie))}if(ie&&this.fragmentTracker.getState(ie)===e.FragmentState.OK&&this.nextLoadPosition>ae){var ce=this.audioOnly&&!this.altAudio?g.ElementaryStreamTypes.AUDIO:g.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(S,ce,A.PlaylistLevelType.MAIN),ie=this.getNextFragment(this.nextLoadPosition,P)}if(!ie)return;ie.initSegment&&!ie.initSegment.data&&!this.bitrateTest&&(ie=ie.initSegment),((u=ie.decryptdata)===null||u===void 0?void 0:u.keyFormat)==="identity"&&!((d=ie.decryptdata)!==null&&d!==void 0&&d.key)?this.loadKey(ie,P):this.loadFragment(ie,P,ae)},_.loadFragment=function(u,d,f){var T,b=this.fragmentTracker.getState(u);if(this.fragCurrent=u,b===e.FragmentState.BACKTRACKED){var S=this.fragmentTracker.getBacktrackData(u);if(S){this._handleFragmentLoadProgress(S),this._handleFragmentLoadComplete(S);return}else b=e.FragmentState.NOT_LOADED}b===e.FragmentState.NOT_LOADED||b===e.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,m.prototype.loadFragment.call(this,u,d,f)):b===e.FragmentState.APPENDING?this.reduceMaxBufferLength(u.duration)&&this.fragmentTracker.removeFragment(u):((T=this.media)===null||T===void 0?void 0:T.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},_.getAppendedFrag=function(u){var d=this.fragmentTracker.getAppendedFrag(u,A.PlaylistLevelType.MAIN);return d&&"fragment"in d?d.fragment:d},_.getBufferedFrag=function(u){return this.fragmentTracker.getBufferedFrag(u,A.PlaylistLevelType.MAIN)},_.followingBufferedFrag=function(u){return u?this.getBufferedFrag(u.end+.5):null},_.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},_.nextLevelSwitch=function(){var u=this.levels,d=this.media;if(d!=null&&d.readyState){var f,T=this.getAppendedFrag(d.currentTime);if(T&&T.start>1&&this.flushMainBuffer(0,T.start-1),!d.paused&&u){var b=this.hls.nextLoadLevel,S=u[b],D=this.fragLastKbps;D&&this.fragCurrent?f=this.fragCurrent.duration*S.maxBitrate/(1e3*D)+1:f=0}else f=0;var I=this.getBufferedFrag(d.currentTime+f);if(I){var w=this.followingBufferedFrag(I);if(w){this.abortCurrentFrag();var P=w.maxStartPTS?w.maxStartPTS:w.start,U=w.duration,O=Math.max(I.end,P+Math.min(Math.max(U-this.config.maxFragLookUpTolerance,U*.5),U*.75));this.flushMainBuffer(O,Number.POSITIVE_INFINITY)}}}},_.abortCurrentFrag=function(){var u=this.fragCurrent;this.fragCurrent=null,u!=null&&u.loader&&u.loader.abort(),this.state===L.State.KEY_LOADING&&(this.state=L.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},_.flushMainBuffer=function(u,d){m.prototype.flushMainBuffer.call(this,u,d,this.altAudio?"video":null)},_.onMediaAttached=function(u,d){m.prototype.onMediaAttached.call(this,u,d);var f=d.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),f.addEventListener("playing",this.onvplaying),f.addEventListener("seeked",this.onvseeked),this.gapController=new n.default(this.config,f,this.fragmentTracker,this.hls)},_.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),m.prototype.onMediaDetaching.call(this)},_.onMediaPlaying=function(){this.tick()},_.onMediaSeeked=function(){var u=this.media,d=u?u.currentTime:null;Object(j.isFiniteNumber)(d)&&this.log("Media seeked to "+d.toFixed(3)),this.tick()},_.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(B.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},_.onManifestParsed=function(u,d){var f=!1,T=!1,b;d.levels.forEach(function(S){b=S.audioCodec,b&&(b.indexOf("mp4a.40.2")!==-1&&(f=!0),b.indexOf("mp4a.40.5")!==-1&&(T=!0))}),this.audioCodecSwitch=f&&T&&!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},_.onLevelLoading=function(u,d){var f=this.levels;if(!f||this.state!==L.State.IDLE)return;var T=f[d.level];(!T.details||T.details.live&&this.levelLastLoaded!==d.level||this.waitForCdnTuneIn(T.details))&&(this.state=L.State.WAITING_LEVEL)},_.onLevelLoaded=function(u,d){var f,T=this.levels,b=d.level,S=d.details,D=S.totalduration;if(!T){this.warn("Levels were reset while loading level "+b);return}this.log("Level "+b+" loaded ["+S.startSN+","+S.endSN+"], cc ["+S.startCC+", "+S.endCC+"] duration:"+D);var I=this.fragCurrent;I&&(this.state===L.State.FRAG_LOADING||this.state===L.State.FRAG_LOADING_WAITING_RETRY)&&(I.level!==d.level&&I.loader&&(this.state=L.State.IDLE,I.loader.abort()));var w=T[b],P=0;if(S.live||(f=w.details)!==null&&f!==void 0&&f.live){if(S.fragments[0]||(S.deltaUpdateFailed=!0),S.deltaUpdateFailed)return;P=this.alignPlaylists(S,w.details)}if(w.details=S,this.levelLastLoaded=b,this.hls.trigger(B.Events.LEVEL_UPDATED,{details:S,level:b}),this.state===L.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(S))return;this.state=L.State.IDLE}this.startFragRequested?S.live&&this.synchronizeToLiveEdge(S):this.setStartPosition(S,P),this.tick()},_._handleFragmentLoadProgress=function(u){var d,f=u.frag,T=u.part,b=u.payload,S=this.levels;if(!S){this.warn("Levels were reset while fragment load was in progress. Fragment "+f.sn+" of level "+f.level+" will not be buffered");return}var D=S[f.level],I=D.details;if(!I){this.warn("Dropping fragment "+f.sn+" of level "+f.level+" after level details were reset");return}var w=D.videoCodec,P=I.PTSKnown||!I.live,U=(d=f.initSegment)===null||d===void 0?void 0:d.data,O=this._getAudioCodec(D),G=this.transmuxer=this.transmuxer||new c.default(this.hls,A.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),z=T?T.index:-1,ae=z!==-1,ie=new l.ChunkMetadata(f.level,f.sn,f.stats.chunkCount,b.byteLength,z,ae),fe=this.initPTS[f.cc];G.push(b,U,O,w,f,T,I.totalduration,P,ie,fe)},_.onAudioTrackSwitching=function(u,d){var f=this.altAudio,T=!!d.url,b=d.id;if(!T){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var S=this.fragCurrent;S!=null&&S.loader&&(this.log("Switching to main audio track, cancel main fragment load"),S.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var D=this.hls;f&&D.trigger(B.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),D.trigger(B.Events.AUDIO_TRACK_SWITCHED,{id:b})}},_.onAudioTrackSwitched=function(u,d){var f=d.id,T=!!this.hls.audioTracks[f].url;if(T){var b=this.videoBuffer;b&&this.mediaBuffer!==b&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=b)}this.altAudio=T,this.tick()},_.onBufferCreated=function(u,d){var f=d.tracks,T,b,S=!1;for(var D in f){var I=f[D];if(I.id==="main"){if(b=D,T=I,D==="video"){var w=f[D];w&&(this.videoBuffer=w.buffer)}}else S=!0}S&&T?(this.log("Alternate track found, use "+b+".buffered to schedule main fragment loading"),this.mediaBuffer=T.buffer):this.mediaBuffer=this.media},_.onFragBuffered=function(u,d){var f=d.frag,T=d.part;if(f&&f.type!==A.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(f)){this.warn("Fragment "+f.sn+(T?" p: "+T.index:"")+" of level "+f.level+" finished buffering, but was aborted. state: "+this.state),this.state===L.State.PARSED&&(this.state=L.State.IDLE);return}var b=T?T.stats:f.stats;this.fragLastKbps=Math.round(8*b.total/(b.buffering.end-b.loading.first)),f.sn!=="initSegment"&&(this.fragPrevious=f),this.fragBufferedComplete(f,T)},_.onError=function(u,d){switch(d.details){case a.ErrorDetails.FRAG_LOAD_ERROR:case a.ErrorDetails.FRAG_LOAD_TIMEOUT:case a.ErrorDetails.KEY_LOAD_ERROR:case a.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(A.PlaylistLevelType.MAIN,d);break;case a.ErrorDetails.LEVEL_LOAD_ERROR:case a.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==L.State.ERROR&&(d.fatal?(this.warn(""+d.details),this.state=L.State.ERROR):!d.levelRetry&&this.state===L.State.WAITING_LEVEL&&(this.state=L.State.IDLE));break;case a.ErrorDetails.BUFFER_FULL_ERROR:if(d.parent==="main"&&(this.state===L.State.PARSING||this.state===L.State.PARSED)){var f=!0,T=this.getFwdBufferInfo(this.media,A.PlaylistLevelType.MAIN);T&&T.len>.5&&(f=!this.reduceMaxBufferLength(T.len)),f&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},_.checkBuffer=function(){var u=this.media,d=this.gapController;if(!u||!d||!u.readyState)return;var f=k.BufferHelper.getBuffered(u);!this.loadedmetadata&&f.length?(this.loadedmetadata=!0,this.seekToStartPos()):d.poll(this.lastCurrentTime),this.lastCurrentTime=u.currentTime},_.onFragLoadEmergencyAborted=function(){this.state=L.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},_.onBufferFlushed=function(u,d){var f=d.type;if(f!==g.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var T=(f===g.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(T,f,A.PlaylistLevelType.MAIN)}},_.onLevelsUpdated=function(u,d){this.levels=d.levels},_.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},_.seekToStartPos=function(){var u=this.media,d=u.currentTime,f=this.startPosition;if(f>=0&&d<f){if(u.seeking){o.logger.log("could not seek to "+f+", already seeking at "+d);return}var T=k.BufferHelper.getBuffered(u),b=T.length?T.start(0):0,S=b-f;S>0&&(S<this.config.maxBufferHole||S<this.config.maxFragLookUpTolerance)&&(o.logger.log("adjusting start position by "+S+" to match buffer start"),f+=S,this.startPosition=f),this.log("seek to target start position "+f+" from current time "+d),u.currentTime=f}},_._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},_._loadBitrateTestFrag=function(u){var d=this;this._doFragLoad(u).then(function(f){var T=d.hls;if(!f||T.nextLoadLevel||d.fragContextChanged(u))return;d.fragLoadError=0,d.state=L.State.IDLE,d.startFragRequested=!1,d.bitrateTest=!1;var b=u.stats;b.parsing.start=b.parsing.end=b.buffering.start=b.buffering.end=self.performance.now(),T.trigger(B.Events.FRAG_LOADED,f)})},_._handleTransmuxComplete=function(u){var d,f="main",T=this.hls,b=u.remuxResult,S=u.chunkMeta,D=this.getCurrentContext(S);if(!D){this.warn("The loading context changed while buffering fragment "+S.sn+" of level "+S.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(S.level);return}var I=D.frag,w=D.part,P=D.level,U=b.video,O=b.text,G=b.id3,z=b.initSegment,ae=this.altAudio?void 0:b.audio;if(this.fragContextChanged(I))return;if(this.state=L.State.PARSING,z){z.tracks&&(this._bufferInitSegment(P,z.tracks,I,S),T.trigger(B.Events.FRAG_PARSING_INIT_SEGMENT,{frag:I,id:f,tracks:z.tracks}));var ie=z.initPTS,fe=z.timescale;Object(j.isFiniteNumber)(ie)&&(this.initPTS[I.cc]=ie,T.trigger(B.Events.INIT_PTS_FOUND,{frag:I,id:f,initPTS:ie,timescale:fe}))}if(U&&b.independent!==!1){if(P.details){var ce=U.startPTS,J=U.endPTS,Z=U.startDTS,ue=U.endDTS;if(w)w.elementaryStreams[U.type]={startPTS:ce,endPTS:J,startDTS:Z,endDTS:ue};else if(U.firstKeyFrame&&U.independent&&(this.couldBacktrack=!0),U.dropped&&U.independent){var X=this.getLoadPosition()+this.config.maxBufferHole;if(X<ce){this.backtrack(I);return}I.setElementaryStreamInfo(U.type,I.start,J,I.start,ue,!0)}I.setElementaryStreamInfo(U.type,ce,J,Z,ue),this.bufferFragmentData(U,I,w,S)}}else if(b.independent===!1){this.backtrack(I);return}if(ae){var $=ae.startPTS,be=ae.endPTS,Re=ae.startDTS,Ie=ae.endDTS;w&&(w.elementaryStreams[g.ElementaryStreamTypes.AUDIO]={startPTS:$,endPTS:be,startDTS:Re,endDTS:Ie}),I.setElementaryStreamInfo(g.ElementaryStreamTypes.AUDIO,$,be,Re,Ie),this.bufferFragmentData(ae,I,w,S)}if(G!=null&&(d=G.samples)!==null&&d!==void 0&&d.length){var Le={frag:I,id:f,samples:G.samples};T.trigger(B.Events.FRAG_PARSING_METADATA,Le)}if(O){var Fe={frag:I,id:f,samples:O.samples};T.trigger(B.Events.FRAG_PARSING_USERDATA,Fe)}},_._bufferInitSegment=function(u,d,f,T){var b=this;if(this.state!==L.State.PARSING)return;this.audioOnly=!!d.audio&&!d.video,this.altAudio&&!this.audioOnly&&delete d.audio;var S=d.audio,D=d.video,I=d.audiovideo;if(S){var w=u.audioCodec,P=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(w&&(w.indexOf("mp4a.40.5")!==-1?w="mp4a.40.2":w="mp4a.40.5"),S.metadata.channelCount!==1&&P.indexOf("firefox")===-1&&(w="mp4a.40.5")),P.indexOf("android")!==-1&&S.container!=="audio/mpeg"&&(w="mp4a.40.2",this.log("Android: force audio codec to "+w)),u.audioCodec&&u.audioCodec!==w&&this.log('Swapping manifest audio codec "'+u.audioCodec+'" for "'+w+'"'),S.levelCodec=w,S.id="main",this.log("Init audio buffer, container:"+S.container+", codecs[selected/level/parsed]=["+(w||"")+"/"+(u.audioCodec||"")+"/"+S.codec+"]")}D&&(D.levelCodec=u.videoCodec,D.id="main",this.log("Init video buffer, container:"+D.container+", codecs[level/parsed]=["+(u.videoCodec||"")+"/"+D.codec+"]")),I&&this.log("Init audiovideo buffer, container:"+I.container+", codecs[level/parsed]=["+(u.attrs.CODECS||"")+"/"+I.codec+"]"),this.hls.trigger(B.Events.BUFFER_CODECS,d),Object.keys(d).forEach(function(U){var O=d[U],G=O.initSegment;G!=null&&G.byteLength&&b.hls.trigger(B.Events.BUFFER_APPENDING,{type:U,data:G,frag:f,part:null,chunkMeta:T,parent:f.type})}),this.tick()},_.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=L.State.BACKTRACKING},_.checkFragmentChanged=function(){var u=this.media,d=null;if(u&&u.readyState>1&&u.seeking===!1){var f=u.currentTime;if(k.BufferHelper.isBuffered(u,f)?d=this.getAppendedFrag(f):k.BufferHelper.isBuffered(u,f+.1)&&(d=this.getAppendedFrag(f+.1)),d){var T=this.fragPlaying,b=d.level;(!T||d.sn!==T.sn||T.level!==b||d.urlId!==T.urlId)&&(this.hls.trigger(B.Events.FRAG_CHANGED,{frag:d}),(!T||T.level!==b)&&this.hls.trigger(B.Events.LEVEL_SWITCHED,{level:b}),this.fragPlaying=d)}}},r(E,[{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}}]),E}(L.default)},"./src/controller/subtitle-stream-controller.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"SubtitleStreamController",function(){return i});var j=C("./src/events.ts"),L=C("./src/utils/logger.ts"),R=C("./src/utils/buffer-helper.ts"),B=C("./src/controller/fragment-finders.ts"),k=C("./src/utils/discontinuities.ts"),e=C("./src/controller/level-helper.ts"),A=C("./src/controller/fragment-tracker.ts"),g=C("./src/controller/base-stream-controller.ts"),c=C("./src/types/loader.ts"),l=C("./src/types/level.ts");function n(t,y){for(var p=0;p<y.length;p++){var m=y[p];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(t,m.key,m)}}function a(t,y,p){return y&&n(t.prototype,y),p&&n(t,p),t}function o(t,y){t.prototype=Object.create(y.prototype),t.prototype.constructor=t,s(t,y)}function s(t,y){return s=Object.setPrototypeOf||function(m,E){return m.__proto__=E,m},s(t,y)}var r=500,i=function(t){o(y,t);function y(m,E){var _;return _=t.call(this,m,E,"[subtitle-stream-controller]")||this,_.levels=[],_.currentTrackId=-1,_.tracksBuffered=[],_.mainDetails=null,_._registerListeners(),_}var p=y.prototype;return p.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},p._registerListeners=function(){var E=this.hls;E.on(j.Events.MEDIA_ATTACHED,this.onMediaAttached,this),E.on(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),E.on(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),E.on(j.Events.LEVEL_LOADED,this.onLevelLoaded,this),E.on(j.Events.ERROR,this.onError,this),E.on(j.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),E.on(j.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),E.on(j.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),E.on(j.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),E.on(j.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},p._unregisterListeners=function(){var E=this.hls;E.off(j.Events.MEDIA_ATTACHED,this.onMediaAttached,this),E.off(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),E.off(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),E.off(j.Events.LEVEL_LOADED,this.onLevelLoaded,this),E.off(j.Events.ERROR,this.onError,this),E.off(j.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),E.off(j.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),E.off(j.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),E.off(j.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),E.off(j.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},p.startLoad=function(){this.stopLoad(),this.state=g.State.IDLE,this.setInterval(r),this.tick()},p.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},p.onLevelLoaded=function(E,_){this.mainDetails=_.details},p.onSubtitleFragProcessed=function(E,_){var h=_.frag,u=_.success;if(this.fragPrevious=h,this.state=g.State.IDLE,!u)return;var d=this.tracksBuffered[this.currentTrackId];if(!d)return;for(var f,T=h.start,b=0;b<d.length;b++)if(T>=d[b].start&&T<=d[b].end){f=d[b];break}var S=h.start+h.duration;f?f.end=S:(f={start:T,end:S},d.push(f)),this.fragmentTracker.fragBuffered(h)},p.onBufferFlushing=function(E,_){var h=_.startOffset,u=_.endOffset;if(h===0&&u!==Number.POSITIVE_INFINITY){var d=this.currentTrackId,f=this.levels;if(!f.length||!f[d]||!f[d].details)return;var T=f[d].details,b=T.targetduration,S=u-b;if(S<=0)return;_.endOffsetSubtitles=Math.max(0,S),this.tracksBuffered.forEach(function(D){for(var I=0;I<D.length;){if(D[I].end<=S){D.shift();continue}else if(D[I].start<S)D[I].start=S;else break;I++}}),this.fragmentTracker.removeFragmentsInRange(h,S,c.PlaylistLevelType.SUBTITLE)}},p.onError=function(E,_){var h,u=_.frag;if(!u||u.type!==c.PlaylistLevelType.SUBTITLE)return;(h=this.fragCurrent)!==null&&h!==void 0&&h.loader&&this.fragCurrent.loader.abort(),this.state=g.State.IDLE},p.onSubtitleTracksUpdated=function(E,_){var h=this,u=_.subtitleTracks;this.tracksBuffered=[],this.levels=u.map(function(d){return new l.Level(d)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(d){h.tracksBuffered[d.id]=[]}),this.mediaBuffer=null},p.onSubtitleTrackSwitch=function(E,_){if(this.currentTrackId=_.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var h=this.levels[this.currentTrackId];h!=null&&h.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,h&&this.setInterval(r)},p.onSubtitleTrackLoaded=function(E,_){var h,u=_.details,d=_.id,f=this.currentTrackId,T=this.levels;if(!T.length)return;var b=T[f];if(d>=T.length||d!==f||!b)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,u.live||(h=b.details)!==null&&h!==void 0&&h.live){var S=this.mainDetails;if(u.deltaUpdateFailed||!S)return;var D=S.fragments[0];if(!b.details)u.hasProgramDateTime&&S.hasProgramDateTime?Object(k.alignMediaPlaylistByPDT)(u,S):D&&Object(e.addSliding)(u,D.start);else{var I=this.alignPlaylists(u,b.details);I===0&&D&&Object(e.addSliding)(u,D.start)}}if(b.details=u,this.levelLastLoaded=d,this.tick(),u.live&&!this.fragCurrent&&this.media&&this.state===g.State.IDLE){var w=Object(B.findFragmentByPTS)(null,u.fragments,this.media.currentTime,0);w||(this.warn("Subtitle playlist not aligned with playback"),b.details=void 0)}},p._handleFragmentLoadComplete=function(E){var _=E.frag,h=E.payload,u=_.decryptdata,d=this.hls;if(this.fragContextChanged(_))return;if(h&&h.byteLength>0&&u&&u.key&&u.iv&&u.method==="AES-128"){var f=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(h),u.key.buffer,u.iv.buffer).then(function(T){var b=performance.now();d.trigger(j.Events.FRAG_DECRYPTED,{frag:_,payload:T,stats:{tstart:f,tdecrypt:b}})})}},p.doTick=function(){if(!this.media){this.state=g.State.IDLE;return}if(this.state===g.State.IDLE){var E,_=this.currentTrackId,h=this.levels;if(!h.length||!h[_]||!h[_].details)return;var u=h[_].details,d=u.targetduration,f=this.config,T=this.media,b=R.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,T.currentTime-d,f.maxBufferHole),S=b.end,D=b.len,I=this.getMaxBufferLength()+d;if(D>I)return;console.assert(u,"Subtitle track details are defined on idle subtitle stream controller tick");var w=u.fragments,P=w.length,U=u.edge,O,G=this.fragPrevious;if(S<U){var z=f.maxFragLookUpTolerance;G&&u.hasProgramDateTime&&(O=Object(B.findFragmentByPDT)(w,G.endProgramDateTime,z)),O||(O=Object(B.findFragmentByPTS)(G,w,S,z),!O&&G&&G.start<w[0].start&&(O=w[0]))}else O=w[P-1];(E=O)!==null&&E!==void 0&&E.encrypted?(L.logger.log("Loading key for "+O.sn),this.state=g.State.KEY_LOADING,this.hls.trigger(j.Events.KEY_LOADING,{frag:O})):O&&this.fragmentTracker.getState(O)===A.FragmentState.NOT_LOADED&&this.loadFragment(O,u,S)}},p.loadFragment=function(E,_,h){this.fragCurrent=E,t.prototype.loadFragment.call(this,E,_,h)},a(y,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),y}(g.default)},"./src/controller/subtitle-track-controller.ts":function(te,H,C){"use strict";C.r(H);var j=C("./src/events.ts"),L=C("./src/utils/texttrack-utils.ts"),R=C("./src/controller/base-playlist-controller.ts"),B=C("./src/types/loader.ts");function k(n,a){for(var o=0;o<a.length;o++){var s=a[o];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(n,s.key,s)}}function e(n,a,o){return a&&k(n.prototype,a),o&&k(n,o),n}function A(n,a){n.prototype=Object.create(a.prototype),n.prototype.constructor=n,g(n,a)}function g(n,a){return g=Object.setPrototypeOf||function(s,r){return s.__proto__=r,s},g(n,a)}var c=function(n){A(a,n);function a(s){var r;return r=n.call(this,s,"[subtitle-track-controller]")||this,r.media=null,r.tracks=[],r.groupId=null,r.tracksInGroup=[],r.trackId=-1,r.selectDefaultTrack=!0,r.queuedDefaultTrack=-1,r.trackChangeListener=function(){return r.onTextTracksChanged()},r.asyncPollTrackChange=function(){return r.pollTrackChange(0)},r.useTextTrackPolling=!1,r.subtitlePollingInterval=-1,r.subtitleDisplay=!0,r.registerListeners(),r}var o=a.prototype;return o.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,n.prototype.destroy.call(this)},o.registerListeners=function(){var r=this.hls;r.on(j.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.on(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.on(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.on(j.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.on(j.Events.LEVEL_LOADING,this.onLevelLoading,this),r.on(j.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),r.on(j.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),r.on(j.Events.ERROR,this.onError,this)},o.unregisterListeners=function(){var r=this.hls;r.off(j.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.off(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.off(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.off(j.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.off(j.Events.LEVEL_LOADING,this.onLevelLoading,this),r.off(j.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),r.off(j.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),r.off(j.Events.ERROR,this.onError,this)},o.onMediaAttached=function(r,i){if(this.media=i.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)},o.pollTrackChange=function(r){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,r)},o.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 r=l(this.media.textTracks);r.forEach(function(i){Object(L.clearCurrentCues)(i)}),this.subtitleTrack=-1,this.media=null},o.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},o.onManifestParsed=function(r,i){this.tracks=i.subtitleTracks},o.onSubtitleTrackLoaded=function(r,i){var t=i.id,y=i.details,p=this.trackId,m=this.tracksInGroup[p];if(!m){this.warn("Invalid subtitle track id "+t);return}var E=m.details;m.details=i.details,this.log("subtitle track "+t+" loaded ["+y.startSN+"-"+y.endSN+"]"),t===this.trackId&&(this.retryCount=0,this.playlistLoaded(t,i,E))},o.onLevelLoading=function(r,i){this.switchLevel(i.level)},o.onLevelSwitching=function(r,i){this.switchLevel(i.level)},o.switchLevel=function(r){var i=this.hls.levels[r];if(!(i!=null&&i.textGroupIds))return;var t=i.textGroupIds[i.urlId];if(this.groupId!==t){var y=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,p=this.tracks.filter(function(_){return!t||_.groupId===t});this.tracksInGroup=p;var m=this.findTrackId(y==null?void 0:y.name)||this.findTrackId();this.groupId=t;var E={subtitleTracks:p};this.log("Updating subtitle tracks, "+p.length+' track(s) found in "'+t+'" group-id'),this.hls.trigger(j.Events.SUBTITLE_TRACKS_UPDATED,E),m!==-1&&this.setSubtitleTrack(m,y)}},o.findTrackId=function(r){for(var i=this.tracksInGroup,t=0;t<i.length;t++){var y=i[t];if((!this.selectDefaultTrack||y.default)&&(!r||r===y.name))return y.id}return-1},o.onError=function(r,i){if(n.prototype.onError.call(this,r,i),i.fatal||!i.context)return;i.context.type===B.PlaylistContextType.SUBTITLE_TRACK&&i.context.id===this.trackId&&i.context.groupId===this.groupId&&this.retryLoadingOrFail(i)},o.loadPlaylist=function(r){var i=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(i)){var t=i.id,y=i.groupId,p=i.url;if(r)try{p=r.addDirectives(p)}catch(m){this.warn("Could not construct new URL with HLS Delivery Directives: "+m)}this.log("Loading subtitle playlist for id "+t),this.hls.trigger(j.Events.SUBTITLE_TRACK_LOADING,{url:p,id:t,groupId:y,deliveryDirectives:r||null})}},o.toggleTrackModes=function(r){var i=this,t=this.media,y=this.subtitleDisplay,p=this.trackId;if(!t)return;var m=l(t.textTracks),E=m.filter(function(u){return u.groupId===i.groupId});if(r===-1)[].slice.call(m).forEach(function(u){u.mode="disabled"});else{var _=E[p];_&&(_.mode="disabled")}var h=E[r];h&&(h.mode=y?"showing":"hidden")},o.setSubtitleTrack=function(r,i){var t,y=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=r;return}if(this.trackId!==r&&this.toggleTrackModes(r),this.trackId===r&&(r===-1||(t=y[r])!==null&&t!==void 0&&t.details)||r<-1||r>=y.length)return;this.clearTimer();var p=y[r];if(this.log("Switching to subtitle track "+r),this.trackId=r,p){var m=p.id,E=p.groupId,_=E===void 0?"":E,h=p.name,u=p.type,d=p.url;this.hls.trigger(j.Events.SUBTITLE_TRACK_SWITCH,{id:m,groupId:_,name:h,type:u,url:d});var f=this.switchParams(p.url,i==null?void 0:i.details);this.loadPlaylist(f)}else this.hls.trigger(j.Events.SUBTITLE_TRACK_SWITCH,{id:r})},o.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var r=-1,i=l(this.media.textTracks),t=0;t<i.length;t++)if(i[t].mode==="hidden")r=t;else if(i[t].mode==="showing"){r=t;break}this.subtitleTrack!==r&&(this.subtitleTrack=r)},e(a,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(r){this.selectDefaultTrack=!1;var i=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(r,i)}}]),a}(R.default);function l(n){for(var a=[],o=0;o<n.length;o++){var s=n[o];s.kind==="subtitles"&&s.label&&a.push(n[o])}return a}H.default=c},"./src/controller/timeline-controller.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"TimelineController",function(){return l});var j=C("./src/polyfills/number.ts"),L=C("./src/events.ts"),R=C("./src/utils/cea-608-parser.ts"),B=C("./src/utils/output-filter.ts"),k=C("./src/utils/webvtt-parser.ts"),e=C("./src/utils/texttrack-utils.ts"),A=C("./src/utils/imsc1-ttml-parser.ts"),g=C("./src/types/loader.ts"),c=C("./src/utils/logger.ts"),l=function(){function s(i){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=o(),this.captionsProperties=void 0,this.hls=i,this.config=i.config,this.Cues=i.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 t=new B.default(this,"textTrack1"),y=new B.default(this,"textTrack2"),p=new B.default(this,"textTrack3"),m=new B.default(this,"textTrack4");this.cea608Parser1=new R.default(1,t,y),this.cea608Parser2=new R.default(3,p,m)}i.on(L.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),i.on(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),i.on(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.on(L.Events.MANIFEST_LOADED,this.onManifestLoaded,this),i.on(L.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),i.on(L.Events.FRAG_LOADING,this.onFragLoading,this),i.on(L.Events.FRAG_LOADED,this.onFragLoaded,this),i.on(L.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),i.on(L.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),i.on(L.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),i.on(L.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),i.on(L.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var r=s.prototype;return r.destroy=function(){var t=this.hls;t.off(L.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.off(L.Events.MANIFEST_LOADED,this.onManifestLoaded,this),t.off(L.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.off(L.Events.FRAG_LOADING,this.onFragLoading,this),t.off(L.Events.FRAG_LOADED,this.onFragLoaded,this),t.off(L.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),t.off(L.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),t.off(L.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),t.off(L.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),t.off(L.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},r.addCues=function(t,y,p,m,E){for(var _=!1,h=E.length;h--;){var u=E[h],d=a(u[0],u[1],y,p);if(d>=0&&(u[0]=Math.min(u[0],y),u[1]=Math.max(u[1],p),_=!0,d/(p-y)>.5))return}if(_||E.push([y,p]),this.config.renderTextTracksNatively){var f=this.captionsTracks[t];this.Cues.newCue(f,y,p,m)}else{var T=this.Cues.newCue(null,y,p,m);this.hls.trigger(L.Events.CUES_PARSED,{type:"captions",cues:T,track:t})}},r.onInitPtsFound=function(t,y){var p=this,m=y.frag,E=y.id,_=y.initPTS,h=y.timescale,u=this.unparsedVttFrags;E==="main"&&(this.initPTS[m.cc]=_,this.timescale[m.cc]=h),u.length&&(this.unparsedVttFrags=[],u.forEach(function(d){p.onFragLoaded(L.Events.FRAG_LOADED,d)}))},r.getExistingTrack=function(t){var y=this.media;if(y)for(var p=0;p<y.textTracks.length;p++){var m=y.textTracks[p];if(m[t])return m}return null},r.createCaptionsTrack=function(t){this.config.renderTextTracksNatively?this.createNativeTrack(t):this.createNonNativeTrack(t)},r.createNativeTrack=function(t){if(this.captionsTracks[t])return;var y=this.captionsProperties,p=this.captionsTracks,m=this.media,E=y[t],_=E.label,h=E.languageCode,u=this.getExistingTrack(t);if(u)p[t]=u,Object(e.clearCurrentCues)(p[t]),Object(e.sendAddTrackEvent)(p[t],m);else{var d=this.createTextTrack("captions",_,h);d&&(d[t]=!0,p[t]=d)}},r.createNonNativeTrack=function(t){if(this.nonNativeCaptionsTracks[t])return;var y=this.captionsProperties[t];if(!y)return;var p=y.label,m={_id:t,label:p,kind:"captions",default:y.media?!!y.media.default:!1,closedCaptions:y.media};this.nonNativeCaptionsTracks[t]=m,this.hls.trigger(L.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[m]})},r.createTextTrack=function(t,y,p){var m=this.media;return m?m.addTextTrack(t,y,p):void 0},r.onMediaAttaching=function(t,y){this.media=y.media,this._cleanTracks()},r.onMediaDetaching=function(){var t=this.captionsTracks;Object.keys(t).forEach(function(y){Object(e.clearCurrentCues)(t[y]),delete t[y]}),this.nonNativeCaptionsTracks={}},r.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=o(),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())},r._cleanTracks=function(){var t=this.media;if(!t)return;var y=t.textTracks;if(y)for(var p=0;p<y.length;p++)Object(e.clearCurrentCues)(y[p])},r.onSubtitleTracksUpdated=function(t,y){var p=this;this.textTracks=[];var m=y.subtitleTracks||[],E=m.some(function(d){return d.textCodec===A.IMSC1_CODEC});if(this.config.enableWebVTT||E&&this.config.enableIMSC1){var _=this.tracks&&m&&this.tracks.length===m.length;if(this.tracks=m||[],this.config.renderTextTracksNatively){var h=this.media?this.media.textTracks:[];this.tracks.forEach(function(d,f){var T;if(f<h.length){for(var b=null,S=0;S<h.length;S++)if(n(h[S],d)){b=h[S];break}b&&(T=b)}T?Object(e.clearCurrentCues)(T):(T=p.createTextTrack("subtitles",d.name,d.lang),T&&(T.mode="disabled")),T&&(T.groupId=d.groupId,p.textTracks.push(T))})}else if(!_&&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(L.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:u})}}},r.onManifestLoaded=function(t,y){var p=this;this.config.enableCEA708Captions&&y.captions&&y.captions.forEach(function(m){var E=/(?:CC|SERVICE)([1-4])/.exec(m.instreamId);if(!E)return;var _="textTrack"+E[1],h=p.captionsProperties[_];if(!h)return;h.label=m.name,m.lang&&(h.languageCode=m.lang),h.media=m})},r.onFragLoading=function(t,y){var p=this.cea608Parser1,m=this.cea608Parser2,E=this.lastSn,_=this.lastPartIndex;if(!this.enabled||!(p&&m))return;if(y.frag.type===g.PlaylistLevelType.MAIN){var h,u,d=y.frag.sn,f=(h=y==null||((u=y.part)===null||u===void 0)?void 0:u.index)!=null?h:-1;d===E+1||d===E&&f===_+1||(p.reset(),m.reset()),this.lastSn=d,this.lastPartIndex=f}},r.onFragLoaded=function(t,y){var p=y.frag,m=y.payload,E=this.initPTS,_=this.unparsedVttFrags;if(p.type===g.PlaylistLevelType.SUBTITLE)if(m.byteLength){if(!Object(j.isFiniteNumber)(E[p.cc])){_.push(y),E.length&&this.hls.trigger(L.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:p,error:new Error("Missing initial subtitle PTS")});return}var h=p.decryptdata;if(h==null||h.key==null||h.method!=="AES-128"){var u=this.tracks[p.level],d=this.vttCCs;d[p.cc]||(d[p.cc]={start:p.start,prevCC:this.prevCC,new:!0},this.prevCC=p.cc),u&&u.textCodec===A.IMSC1_CODEC?this._parseIMSC1(p,m):this._parseVTTs(p,m,d)}}else this.hls.trigger(L.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:p,error:new Error("Empty subtitle payload")})},r._parseIMSC1=function(t,y){var p=this,m=this.hls;Object(A.parseIMSC1)(y,this.initPTS[t.cc],this.timescale[t.cc],function(E){p._appendCues(E,t.level),m.trigger(L.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:t})},function(E){c.logger.log("Failed to parse IMSC1: "+E),m.trigger(L.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:t,error:E})})},r._parseVTTs=function(t,y,p){var m=this,E=this.hls;Object(k.parseWebVTT)(y,this.initPTS[t.cc],this.timescale[t.cc],p,t.cc,t.start,function(_){m._appendCues(_,t.level),E.trigger(L.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:t})},function(_){m._fallbackToIMSC1(t,y),c.logger.log("Failed to parse VTT cue: "+_),E.trigger(L.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:t,error:_})})},r._fallbackToIMSC1=function(t,y){var p=this,m=this.tracks[t.level];m.textCodec||Object(A.parseIMSC1)(y,this.initPTS[t.cc],this.timescale[t.cc],function(){m.textCodec=A.IMSC1_CODEC,p._parseIMSC1(t,y)},function(){m.textCodec="wvtt"})},r._appendCues=function(t,y){var p=this.hls;if(this.config.renderTextTracksNatively){var m=this.textTracks[y];if(m.mode==="disabled")return;t.forEach(function(h){return Object(e.addCueToTrack)(m,h)})}else{var E=this.tracks[y],_=E.default?"default":"subtitles"+y;p.trigger(L.Events.CUES_PARSED,{type:"subtitles",cues:t,track:_})}},r.onFragDecrypted=function(t,y){var p=y.frag;if(p.type===g.PlaylistLevelType.SUBTITLE){if(!Object(j.isFiniteNumber)(this.initPTS[p.cc])){this.unparsedVttFrags.push(y);return}this.onFragLoaded(L.Events.FRAG_LOADED,y)}},r.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},r.onFragParsingUserdata=function(t,y){var p=this.cea608Parser1,m=this.cea608Parser2;if(!this.enabled||!(p&&m))return;for(var E=0;E<y.samples.length;E++){var _=y.samples[E].bytes;if(_){var h=this.extractCea608Data(_);p.addData(y.samples[E].pts,h[0]),m.addData(y.samples[E].pts,h[1])}}},r.onBufferFlushing=function(t,y){var p=y.startOffset,m=y.endOffset,E=y.endOffsetSubtitles,_=y.type,h=this.media;if(!h||h.currentTime<m)return;if(!_||_==="video"){var u=this.captionsTracks;Object.keys(u).forEach(function(f){return Object(e.removeCuesInRange)(u[f],p,m)})}if(this.config.renderTextTracksNatively&&(p===0&&E!==void 0)){var d=this.textTracks;Object.keys(d).forEach(function(f){return Object(e.removeCuesInRange)(d[f],p,E)})}},r.extractCea608Data=function(t){for(var y=t[0]&31,p=2,m=[[],[]],E=0;E<y;E++){var _=t[p++],h=127&t[p++],u=127&t[p++],d=(4&_)!==0,f=3&_;if(h===0&&u===0)continue;d&&((f===0||f===1)&&(m[f].push(h),m[f].push(u)))}return m},s}();function n(s,r){return s&&s.label===r.name&&!(s.textTrack1||s.textTrack2)}function a(s,r,i,t){return Math.min(r,t)-Math.max(s,i)}function o(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"default",function(){return j});var j=function(){function L(B,k){this.subtle=void 0,this.aesIV=void 0,this.subtle=B,this.aesIV=k}var R=L.prototype;return R.decrypt=function(k,e){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},e,k)},L}()},"./src/crypt/aes-decryptor.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"removePadding",function(){return L}),C.d(H,"default",function(){return R});var j=C("./src/utils/typed-array.ts");function L(B){var k=B.byteLength,e=k&&new DataView(B.buffer).getUint8(k-1);return e?Object(j.sliceUint8)(B,0,k-e):B}var R=function(){function B(){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 k=B.prototype;return k.uint8ArrayToUint32Array_=function(A){for(var g=new DataView(A),c=new Uint32Array(4),l=0;l<4;l++)c[l]=g.getUint32(l*4);return c},k.initTable=function(){var A=this.sBox,g=this.invSBox,c=this.subMix,l=c[0],n=c[1],a=c[2],o=c[3],s=this.invSubMix,r=s[0],i=s[1],t=s[2],y=s[3],p=new Uint32Array(256),m=0,E=0,_=0;for(_=0;_<256;_++)_<128?p[_]=_<<1:p[_]=_<<1^283;for(_=0;_<256;_++){var h=E^E<<1^E<<2^E<<3^E<<4;h=h>>>8^h&255^99,A[m]=h,g[h]=m;var u=p[m],d=p[u],f=p[d],T=p[h]*257^h*16843008;l[m]=T<<24|T>>>8,n[m]=T<<16|T>>>16,a[m]=T<<8|T>>>24,o[m]=T,T=f*16843009^d*65537^u*257^m*16843008,r[h]=T<<24|T>>>8,i[h]=T<<16|T>>>16,t[h]=T<<8|T>>>24,y[h]=T,m?(m=u^p[p[p[f^u]]],E^=p[p[E]]):m=E=1}},k.expandKey=function(A){for(var g=this.uint8ArrayToUint32Array_(A),c=!0,l=0;l<g.length&&c;)c=g[l]===this.key[l],l++;if(c)return;this.key=g;var n=this.keySize=g.length;if(n!==4&&n!==6&&n!==8)throw new Error("Invalid aes key size="+n);var a=this.ksRows=(n+6+1)*4,o,s,r=this.keySchedule=new Uint32Array(a),i=this.invKeySchedule=new Uint32Array(a),t=this.sBox,y=this.rcon,p=this.invSubMix,m=p[0],E=p[1],_=p[2],h=p[3],u,d;for(o=0;o<a;o++){if(o<n){u=r[o]=g[o];continue}d=u,o%n===0?(d=d<<8|d>>>24,d=t[d>>>24]<<24|t[d>>>16&255]<<16|t[d>>>8&255]<<8|t[d&255],d^=y[o/n|0]<<24):n>6&&o%n===4&&(d=t[d>>>24]<<24|t[d>>>16&255]<<16|t[d>>>8&255]<<8|t[d&255]),r[o]=u=(r[o-n]^d)>>>0}for(s=0;s<a;s++)o=a-s,s&3?d=r[o]:d=r[o-4],s<4||o<=4?i[s]=d:i[s]=m[t[d>>>24]]^E[t[d>>>16&255]]^_[t[d>>>8&255]]^h[t[d&255]],i[s]=i[s]>>>0},k.networkToHostOrderSwap=function(A){return A<<24|(A&65280)<<8|(A&16711680)>>8|A>>>24},k.decrypt=function(A,g,c){for(var l=this.keySize+6,n=this.invKeySchedule,a=this.invSBox,o=this.invSubMix,s=o[0],r=o[1],i=o[2],t=o[3],y=this.uint8ArrayToUint32Array_(c),p=y[0],m=y[1],E=y[2],_=y[3],h=new Int32Array(A),u=new Int32Array(h.length),d,f,T,b,S,D,I,w,P,U,O,G,z,ae,ie=this.networkToHostOrderSwap;g<h.length;){for(P=ie(h[g]),U=ie(h[g+1]),O=ie(h[g+2]),G=ie(h[g+3]),S=P^n[0],D=G^n[1],I=O^n[2],w=U^n[3],z=4,ae=1;ae<l;ae++)d=s[S>>>24]^r[D>>16&255]^i[I>>8&255]^t[w&255]^n[z],f=s[D>>>24]^r[I>>16&255]^i[w>>8&255]^t[S&255]^n[z+1],T=s[I>>>24]^r[w>>16&255]^i[S>>8&255]^t[D&255]^n[z+2],b=s[w>>>24]^r[S>>16&255]^i[D>>8&255]^t[I&255]^n[z+3],S=d,D=f,I=T,w=b,z=z+4;d=a[S>>>24]<<24^a[D>>16&255]<<16^a[I>>8&255]<<8^a[w&255]^n[z],f=a[D>>>24]<<24^a[I>>16&255]<<16^a[w>>8&255]<<8^a[S&255]^n[z+1],T=a[I>>>24]<<24^a[w>>16&255]<<16^a[S>>8&255]<<8^a[D&255]^n[z+2],b=a[w>>>24]<<24^a[S>>16&255]<<16^a[D>>8&255]<<8^a[I&255]^n[z+3],u[g]=ie(d^p),u[g+1]=ie(b^m),u[g+2]=ie(T^E),u[g+3]=ie(f^_),p=P,m=U,E=O,_=G,g=g+4}return u.buffer},B}()},"./src/crypt/decrypter.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"default",function(){return g});var j=C("./src/crypt/aes-crypto.ts"),L=C("./src/crypt/fast-aes-key.ts"),R=C("./src/crypt/aes-decryptor.ts"),B=C("./src/utils/logger.ts"),k=C("./src/utils/mp4-tools.ts"),e=C("./src/utils/typed-array.ts"),A=16,g=function(){function c(n,a,o){var s=o===void 0?{}:o,r=s.removePKCS7Padding,i=r===void 0?!0:r;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=n,this.config=a,this.removePKCS7Padding=i,i)try{var t=self.crypto;t&&(this.subtle=t.subtle||t.webkitSubtle)}catch(y){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var l=c.prototype;return l.destroy=function(){this.observer=null},l.isSync=function(){return this.config.enableSoftwareAES},l.flush=function(){var a=this.currentResult;if(!a){this.reset();return}var o=new Uint8Array(a);return this.reset(),this.removePKCS7Padding?Object(R.removePadding)(o):o},l.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},l.decrypt=function(a,o,s,r){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(a),o,s);var i=this.flush();i&&r(i.buffer)}else this.webCryptoDecrypt(new Uint8Array(a),o,s).then(r)},l.softwareDecrypt=function(a,o,s){var r=this.currentIV,i=this.currentResult,t=this.remainderData;this.logOnce("JS AES decrypt"),t&&(a=Object(k.appendUint8Array)(t,a),this.remainderData=null);var y=this.getValidChunk(a);if(!y.length)return null;r&&(s=r);var p=this.softwareDecrypter;p||(p=this.softwareDecrypter=new R.default),p.expandKey(o);var m=i;return this.currentResult=p.decrypt(y.buffer,0,s),this.currentIV=Object(e.sliceUint8)(y,-16).buffer,m||null},l.webCryptoDecrypt=function(a,o,s){var r=this,i=this.subtle;return(this.key!==o||!this.fastAesKey)&&(this.key=o,this.fastAesKey=new L.default(i,o)),this.fastAesKey.expandKey().then(function(t){if(!i)return Promise.reject(new Error("web crypto not initialized"));var y=new j.default(i,s);return y.decrypt(a.buffer,t)}).catch(function(t){return r.onWebCryptoError(t,a,o,s)})},l.onWebCryptoError=function(a,o,s,r){return B.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",a),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(o,s,r)},l.getValidChunk=function(a){var o=a,s=a.length-a.length%A;return s!==a.length&&(o=Object(e.sliceUint8)(a,0,s),this.remainderData=Object(e.sliceUint8)(a,s)),o},l.logOnce=function(a){if(!this.logEnabled)return;B.logger.log("[decrypter.ts]: "+a),this.logEnabled=!1},c}()},"./src/crypt/fast-aes-key.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"default",function(){return j});var j=function(){function L(B,k){this.subtle=void 0,this.key=void 0,this.subtle=B,this.key=k}var R=L.prototype;return R.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},L}()},"./src/demux/aacdemuxer.ts":function(te,H,C){"use strict";C.r(H);var j=C("./src/demux/base-audio-demuxer.ts"),L=C("./src/demux/adts.ts"),R=C("./src/utils/logger.ts"),B=C("./src/demux/id3.ts");function k(g,c){g.prototype=Object.create(c.prototype),g.prototype.constructor=g,e(g,c)}function e(g,c){return e=Object.setPrototypeOf||function(n,a){return n.__proto__=a,n},e(g,c)}var A=function(g){k(c,g);function c(n,a){var o;return o=g.call(this)||this,o.observer=void 0,o.config=void 0,o.observer=n,o.config=a,o}var l=c.prototype;return l.resetInitSegment=function(a,o,s){g.prototype.resetInitSegment.call(this,a,o,s),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:a,duration:s,inputTimeScale:9e4,dropped:0}},c.probe=function(a){if(!a)return!1;for(var o=B.getID3Data(a,0)||[],s=o.length,r=a.length;s<r;s++)if(L.probe(a,s))return R.logger.log("ADTS sync word found !"),!0;return!1},l.canParse=function(a,o){return L.canParse(a,o)},l.appendFrame=function(a,o,s){L.initTrackConfig(a,this.observer,o,s,a.manifestCodec);var r=L.appendFrame(a,o,s,this.initPTS,this.frameIndex);if(r&&r.missing===0)return r},c}(j.default);A.minProbeByteLength=9,H.default=A},"./src/demux/adts.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"getAudioConfig",function(){return B}),C.d(H,"isHeaderPattern",function(){return k}),C.d(H,"getHeaderLength",function(){return e}),C.d(H,"getFullFrameLength",function(){return A}),C.d(H,"canGetFrameLength",function(){return g}),C.d(H,"isHeader",function(){return c}),C.d(H,"canParse",function(){return l}),C.d(H,"probe",function(){return n}),C.d(H,"initTrackConfig",function(){return a}),C.d(H,"getFrameDuration",function(){return o}),C.d(H,"parseFrameHeader",function(){return s}),C.d(H,"appendFrame",function(){return r});var j=C("./src/utils/logger.ts"),L=C("./src/errors.ts"),R=C("./src/events.ts");function B(i,t,y,p){var m,E,_,h,u=navigator.userAgent.toLowerCase(),d=p,f=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];m=((t[y+2]&192)>>>6)+1;var T=(t[y+2]&60)>>>2;if(T>f.length-1){i.trigger(R.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+T});return}return _=(t[y+2]&1)<<2,_|=(t[y+3]&192)>>>6,j.logger.log("manifest codec:"+p+", ADTS type:"+m+", samplingIndex:"+T),/firefox/i.test(u)?T>=6?(m=5,h=new Array(4),E=T-3):(m=2,h=new Array(2),E=T):u.indexOf("android")!==-1?(m=2,h=new Array(2),E=T):(m=5,h=new Array(4),p&&(p.indexOf("mp4a.40.29")!==-1||p.indexOf("mp4a.40.5")!==-1)||!p&&T>=6?E=T-3:((p&&p.indexOf("mp4a.40.2")!==-1&&(T>=6&&_===1||/vivaldi/i.test(u))||!p&&_===1)&&(m=2,h=new Array(2)),E=T)),h[0]=m<<3,h[0]|=(T&14)>>1,h[1]|=(T&1)<<7,h[1]|=_<<3,m===5&&(h[1]|=(E&14)>>1,h[2]=(E&1)<<7,h[2]|=2<<2,h[3]=0),{config:h,samplerate:f[T],channelCount:_,codec:"mp4a.40."+m,manifestCodec:d}}function k(i,t){return i[t]===255&&(i[t+1]&246)===240}function e(i,t){return i[t+1]&1?7:9}function A(i,t){return(i[t+3]&3)<<11|i[t+4]<<3|(i[t+5]&224)>>>5}function g(i,t){return t+5<i.length}function c(i,t){return t+1<i.length&&k(i,t)}function l(i,t){return g(i,t)&&k(i,t)&&A(i,t)<=i.length-t}function n(i,t){if(c(i,t)){var y=e(i,t);if(t+y>=i.length)return!1;var p=A(i,t);if(p<=y)return!1;var m=t+p;return m===i.length||c(i,m)}return!1}function a(i,t,y,p,m){if(!i.samplerate){var E=B(t,y,p,m);if(!E)return;i.config=E.config,i.samplerate=E.samplerate,i.channelCount=E.channelCount,i.codec=E.codec,i.manifestCodec=E.manifestCodec,j.logger.log("parsed codec:"+i.codec+", rate:"+E.samplerate+", channels:"+E.channelCount)}}function o(i){return 1024*9e4/i}function s(i,t,y,p,m){var E=e(i,t),_=A(i,t);if(_-=E,_>0){var h=y+p*m;return{headerLength:E,frameLength:_,stamp:h}}}function r(i,t,y,p,m){var E=o(i.samplerate),_=s(t,y,p,m,E);if(_){var h=_.frameLength,u=_.headerLength,d=_.stamp,f=u+h,T=Math.max(0,y+f-t.length),b;T?(b=new Uint8Array(f-u),b.set(t.subarray(y+u,t.length),0)):b=t.subarray(y+u,y+f);var S={unit:b,pts:d};return T||i.samples.push(S),{sample:S,length:f,missing:T}}}},"./src/demux/base-audio-demuxer.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"initPTSFn",function(){return A});var j=C("./src/polyfills/number.ts"),L=C("./src/demux/id3.ts"),R=C("./src/demux/dummy-demuxed-track.ts"),B=C("./src/utils/mp4-tools.ts"),k=C("./src/utils/typed-array.ts"),e=function(){function g(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var c=g.prototype;return c.resetInitSegment=function(n,a,o){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},c.resetTimeStamp=function(){},c.resetContiguity=function(){},c.canParse=function(n,a){return!1},c.appendFrame=function(n,a,o){},c.demux=function(n,a){this.cachedData&&(n=Object(B.appendUint8Array)(this.cachedData,n),this.cachedData=null);var o=L.getID3Data(n,0),s=o?o.length:0,r,i,t=this._audioTrack,y=this._id3Track,p=o?L.getTimeStamp(o):void 0,m=n.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=A(p,a)),o&&o.length>0&&y.samples.push({pts:this.initPTS,dts:this.initPTS,data:o}),i=this.initPTS;s<m;){if(this.canParse(n,s)){var E=this.appendFrame(t,n,s);E?(this.frameIndex++,i=E.sample.pts,s+=E.length,r=s):s=m}else L.canParse(n,s)?(o=L.getID3Data(n,s),y.samples.push({pts:i,dts:i,data:o}),s+=o.length,r=s):s++;if(s===m&&r!==m){var _=Object(k.sliceUint8)(n,r);this.cachedData?this.cachedData=Object(B.appendUint8Array)(this.cachedData,_):this.cachedData=_}}return{audioTrack:t,avcTrack:Object(R.dummyTrack)(),id3Track:y,textTrack:Object(R.dummyTrack)()}},c.demuxSampleAes=function(n,a,o){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},c.flush=function(n){var a=this.cachedData;return a&&(this.cachedData=null,this.demux(a,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(R.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(R.dummyTrack)()}},c.destroy=function(){},g}(),A=function(c,l){return Object(j.isFiniteNumber)(c)?c*90:l*9e4};H.default=e},"./src/demux/chunk-cache.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"default",function(){return j});var j=function(){function R(){this.chunks=[],this.dataLength=0}var B=R.prototype;return B.push=function(e){this.chunks.push(e),this.dataLength+=e.length},B.flush=function(){var e=this.chunks,A=this.dataLength,g;if(e.length)e.length===1?g=e[0]:g=L(e,A);else return new Uint8Array(0);return this.reset(),g},B.reset=function(){this.chunks.length=0,this.dataLength=0},R}();function L(R,B){for(var k=new Uint8Array(B),e=0,A=0;A<R.length;A++){var g=R[A];k.set(g,e),e+=g.length}return k}},"./src/demux/dummy-demuxed-track.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"dummyTrack",function(){return j});function j(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(te,H,C){"use strict";C.r(H);var j=C("./src/utils/logger.ts"),L=function(){function R(k){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=k,this.bytesAvailable=k.byteLength,this.word=0,this.bitsAvailable=0}var B=R.prototype;return B.loadWord=function(){var e=this.data,A=this.bytesAvailable,g=e.byteLength-A,c=new Uint8Array(4),l=Math.min(4,A);if(l===0)throw new Error("no bytes available");c.set(e.subarray(g,g+l)),this.word=new DataView(c.buffer).getUint32(0),this.bitsAvailable=l*8,this.bytesAvailable-=l},B.skipBits=function(e){var A;this.bitsAvailable>e?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,A=e>>3,e-=A>>3,this.bytesAvailable-=A,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)},B.readBits=function(e){var A=Math.min(this.bitsAvailable,e),g=this.word>>>32-A;return e>32&&j.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=A,this.bitsAvailable>0?this.word<<=A:this.bytesAvailable>0&&this.loadWord(),A=e-A,A>0&&this.bitsAvailable?g<<A|this.readBits(A):g},B.skipLZ=function(){var e;for(e=0;e<this.bitsAvailable;++e)if((this.word&2147483648>>>e)!==0)return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()},B.skipUEG=function(){this.skipBits(1+this.skipLZ())},B.skipEG=function(){this.skipBits(1+this.skipLZ())},B.readUEG=function(){var e=this.skipLZ();return this.readBits(e+1)-1},B.readEG=function(){var e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)},B.readBoolean=function(){return this.readBits(1)===1},B.readUByte=function(){return this.readBits(8)},B.readUShort=function(){return this.readBits(16)},B.readUInt=function(){return this.readBits(32)},B.skipScalingList=function(e){for(var A=8,g=8,c,l=0;l<e;l++)g!==0&&(c=this.readEG(),g=(A+c+256)%256),A=g===0?A:g},B.readSPS=function(){var e=0,A=0,g=0,c=0,l,n,a,o=this.readUByte.bind(this),s=this.readBits.bind(this),r=this.readUEG.bind(this),i=this.readBoolean.bind(this),t=this.skipBits.bind(this),y=this.skipEG.bind(this),p=this.skipUEG.bind(this),m=this.skipScalingList.bind(this);o();var E=o();if(s(5),t(3),o(),p(),E===100||E===110||E===122||E===244||E===44||E===83||E===86||E===118||E===128){var _=r();if(_===3&&t(1),p(),p(),t(1),i())for(n=_!==3?8:12,a=0;a<n;a++)i()&&(a<6?m(16):m(64))}p();var h=r();if(h===0)r();else if(h===1)for(t(1),y(),y(),l=r(),a=0;a<l;a++)y();p(),t(1);var u=r(),d=r(),f=s(1);f===0&&t(1),t(1),i()&&(e=r(),A=r(),g=r(),c=r());var T=[1,1];if(i()&&i()){var b=o();switch(b){case 1:T=[1,1];break;case 2:T=[12,11];break;case 3:T=[10,11];break;case 4:T=[16,11];break;case 5:T=[40,33];break;case 6:T=[24,11];break;case 7:T=[20,11];break;case 8:T=[32,11];break;case 9:T=[80,33];break;case 10:T=[18,11];break;case 11:T=[15,11];break;case 12:T=[64,33];break;case 13:T=[160,99];break;case 14:T=[4,3];break;case 15:T=[3,2];break;case 16:T=[2,1];break;case 255:{T=[o()<<8|o(),o()<<8|o()];break}}}return{width:Math.ceil((u+1)*16-e*2-A*2),height:(2-f)*(d+1)*16-(f?2:4)*(g+c),pixelRatio:T}},B.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},R}();H.default=L},"./src/demux/id3.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"isHeader",function(){return j}),C.d(H,"isFooter",function(){return L}),C.d(H,"getID3Data",function(){return R}),C.d(H,"canParse",function(){return k}),C.d(H,"getTimeStamp",function(){return e}),C.d(H,"isTimeStampFrame",function(){return A}),C.d(H,"getID3Frames",function(){return c}),C.d(H,"decodeFrame",function(){return l}),C.d(H,"utf8ArrayToStr",function(){return r}),C.d(H,"testables",function(){return i});var j=function(m,E){return E+10<=m.length&&(m[E]===73&&m[E+1]===68&&m[E+2]===51&&(m[E+3]<255&&m[E+4]<255&&(m[E+6]<128&&m[E+7]<128&&m[E+8]<128&&m[E+9]<128)))},L=function(m,E){return E+10<=m.length&&(m[E]===51&&m[E+1]===68&&m[E+2]===73&&(m[E+3]<255&&m[E+4]<255&&(m[E+6]<128&&m[E+7]<128&&m[E+8]<128&&m[E+9]<128)))},R=function(m,E){for(var _=E,h=0;j(m,E);){h+=10;var u=B(m,E+6);h+=u,L(m,E+10)&&(h+=10),E+=h}return h>0?m.subarray(_,_+h):void 0},B=function(m,E){var _=0;return _=(m[E]&127)<<21,_|=(m[E+1]&127)<<14,_|=(m[E+2]&127)<<7,_|=m[E+3]&127,_},k=function(m,E){return j(m,E)&&B(m,E+6)+10<=m.length-E},e=function(m){for(var E=c(m),_=0;_<E.length;_++){var h=E[_];if(A(h))return s(h)}return},A=function(m){return m&&m.key==="PRIV"&&m.info==="com.apple.streaming.transportStreamTimestamp"},g=function(m){var E=String.fromCharCode(m[0],m[1],m[2],m[3]),_=B(m,4),h=10;return{type:E,size:_,data:m.subarray(h,h+_)}},c=function(m){for(var E=0,_=[];j(m,E);){var h=B(m,E+6);E+=10;for(var u=E+h;E+8<u;){var d=g(m.subarray(E)),f=l(d);f&&_.push(f),E+=d.size+10}L(m,E)&&(E+=10)}return _},l=function(m){return m.type==="PRIV"?n(m):m.type[0]==="W"?o(m):a(m)},n=function(m){if(m.size<2)return;var E=r(m.data,!0),_=new Uint8Array(m.data.subarray(E.length+1));return{key:m.type,info:E,data:_.buffer}},a=function(m){if(m.size<2)return;if(m.type==="TXXX"){var E=1,_=r(m.data.subarray(E),!0);E+=_.length+1;var h=r(m.data.subarray(E));return{key:m.type,info:_,data:h}}var u=r(m.data.subarray(1));return{key:m.type,data:u}},o=function(m){if(m.type==="WXXX"){if(m.size<2)return;var E=1,_=r(m.data.subarray(E),!0);E+=_.length+1;var h=r(m.data.subarray(E));return{key:m.type,info:_,data:h}}var u=r(m.data);return{key:m.type,data:u}},s=function(m){if(m.data.byteLength===8){var E=new Uint8Array(m.data),_=E[3]&1,h=(E[4]<<23)+(E[5]<<15)+(E[6]<<7)+E[7];return h/=45,_&&(h+=4772185884e-2),Math.round(h)}return},r=function(m,E){E===void 0&&(E=!1);var _=y();if(_){var h=_.decode(m);if(E){var u=h.indexOf("\0");return u!==-1?h.substring(0,u):h}return h.replace(/\0/g,"")}for(var d=m.length,f,T,b,S="",D=0;D<d;){if(f=m[D++],f===0&&E)return S;if(f===0||f===3)continue;switch(f>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:S+=String.fromCharCode(f);break;case 12:case 13:T=m[D++],S+=String.fromCharCode((f&31)<<6|T&63);break;case 14:T=m[D++],b=m[D++],S+=String.fromCharCode((f&15)<<12|(T&63)<<6|(b&63)<<0);break;default:}}return S},i={decodeTextFrame:a},t;function y(){return!t&&typeof self.TextDecoder!="undefined"&&(t=new self.TextDecoder("utf-8")),t}},"./src/demux/mp3demuxer.ts":function(te,H,C){"use strict";C.r(H);var j=C("./src/demux/base-audio-demuxer.ts"),L=C("./src/demux/id3.ts"),R=C("./src/utils/logger.ts"),B=C("./src/demux/mpegaudio.ts");function k(g,c){g.prototype=Object.create(c.prototype),g.prototype.constructor=g,e(g,c)}function e(g,c){return e=Object.setPrototypeOf||function(n,a){return n.__proto__=a,n},e(g,c)}var A=function(g){k(c,g);function c(){return g.apply(this,arguments)||this}var l=c.prototype;return l.resetInitSegment=function(a,o,s){g.prototype.resetInitSegment.call(this,a,o,s),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:a,duration:s,inputTimeScale:9e4,dropped:0}},c.probe=function(a){if(!a)return!1;for(var o=L.getID3Data(a,0)||[],s=o.length,r=a.length;s<r;s++)if(B.probe(a,s))return R.logger.log("MPEG Audio sync word found !"),!0;return!1},l.canParse=function(a,o){return B.canParse(a,o)},l.appendFrame=function(a,o,s){return this.initPTS===null?void 0:B.appendFrame(a,o,s,this.initPTS,this.frameIndex)},c}(j.default);A.minProbeByteLength=4,H.default=A},"./src/demux/mp4demuxer.ts":function(te,H,C){"use strict";C.r(H);var j=C("./src/utils/mp4-tools.ts"),L=C("./src/demux/dummy-demuxed-track.ts"),R=function(){function B(e,A){this.remainderData=null,this.config=void 0,this.config=A}var k=B.prototype;return k.resetTimeStamp=function(){},k.resetInitSegment=function(){},k.resetContiguity=function(){},B.probe=function(A){return Object(j.findBox)({data:A,start:0,end:Math.min(A.length,16384)},["moof"]).length>0},k.demux=function(A){var g=A,c=Object(L.dummyTrack)();if(this.config.progressive){this.remainderData&&(g=Object(j.appendUint8Array)(this.remainderData,A));var l=Object(j.segmentValidRange)(g);this.remainderData=l.remainder,c.samples=l.valid||new Uint8Array}else c.samples=g;return{audioTrack:Object(L.dummyTrack)(),avcTrack:c,id3Track:Object(L.dummyTrack)(),textTrack:Object(L.dummyTrack)()}},k.flush=function(){var A=Object(L.dummyTrack)();return A.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(L.dummyTrack)(),avcTrack:A,id3Track:Object(L.dummyTrack)(),textTrack:Object(L.dummyTrack)()}},k.demuxSampleAes=function(A,g,c){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},k.destroy=function(){},B}();R.minProbeByteLength=1024,H.default=R},"./src/demux/mpegaudio.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"appendFrame",function(){return e}),C.d(H,"parseHeader",function(){return A}),C.d(H,"isHeaderPattern",function(){return g}),C.d(H,"isHeader",function(){return c}),C.d(H,"canParse",function(){return l}),C.d(H,"probe",function(){return n});var j=null,L=[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],B=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],k=[0,1,1,4];function e(a,o,s,r,i){if(s+24>o.length)return;var t=A(o,s);if(t&&s+t.frameLength<=o.length){var y=t.samplesPerFrame*9e4/t.sampleRate,p=r+i*y,m={unit:o.subarray(s,s+t.frameLength),pts:p,dts:p};return a.config=[],a.channelCount=t.channelCount,a.samplerate=t.sampleRate,a.samples.push(m),{sample:m,length:t.frameLength,missing:0}}}function A(a,o){var s=a[o+1]>>3&3,r=a[o+1]>>1&3,i=a[o+2]>>4&15,t=a[o+2]>>2&3;if(s!==1&&i!==0&&i!==15&&t!==3){var y=a[o+2]>>1&1,p=a[o+3]>>6,m=s===3?3-r:r===3?3:4,E=L[m*14+i-1]*1e3,_=s===3?0:s===2?1:2,h=R[_*3+t],u=p===3?1:2,d=B[s][r],f=k[r],T=d*8*f,b=Math.floor(d*E/h+y)*f;if(j===null){var S=navigator.userAgent||"",D=S.match(/Chrome\/(\d+)/i);j=D?parseInt(D[1]):0}var I=!!j&&j<=87;return I&&r===2&&E>=224e3&&p===0&&(a[o+3]=a[o+3]|128),{sampleRate:h,channelCount:u,frameLength:b,samplesPerFrame:T}}}function g(a,o){return a[o]===255&&(a[o+1]&224)===224&&(a[o+1]&6)!==0}function c(a,o){return o+1<a.length&&g(a,o)}function l(a,o){var s=4;return g(a,o)&&s<=a.length-o}function n(a,o){if(o+1<a.length&&g(a,o)){var s=4,r=A(a,o),i=s;r!=null&&r.frameLength&&(i=r.frameLength);var t=o+i;return t===a.length||c(a,t)}return!1}},"./src/demux/sample-aes.ts":function(te,H,C){"use strict";C.r(H);var j=C("./src/crypt/decrypter.ts"),L=C("./src/demux/tsdemuxer.ts"),R=function(){function B(e,A,g){this.keyData=void 0,this.decrypter=void 0,this.keyData=g,this.decrypter=new j.default(e,A,{removePKCS7Padding:!1})}var k=B.prototype;return k.decryptBuffer=function(A,g){this.decrypter.decrypt(A,this.keyData.key.buffer,this.keyData.iv.buffer,g)},k.decryptAacSample=function(A,g,c,l){var n=A[g].unit,a=n.subarray(16,n.length-n.length%16),o=a.buffer.slice(a.byteOffset,a.byteOffset+a.length),s=this;this.decryptBuffer(o,function(r){var i=new Uint8Array(r);n.set(i,16),l||s.decryptAacSamples(A,g+1,c)})},k.decryptAacSamples=function(A,g,c){for(;;g++){if(g>=A.length){c();return}if(A[g].unit.length<32)continue;var l=this.decrypter.isSync();if(this.decryptAacSample(A,g,c,l),!l)return}},k.getAvcEncryptedData=function(A){for(var g=Math.floor((A.length-48)/160)*16+16,c=new Int8Array(g),l=0,n=32;n<=A.length-16;n+=160,l+=16)c.set(A.subarray(n,n+16),l);return c},k.getAvcDecryptedUnit=function(A,g){for(var c=new Uint8Array(g),l=0,n=32;n<=A.length-16;n+=160,l+=16)A.set(c.subarray(l,l+16),n);return A},k.decryptAvcSample=function(A,g,c,l,n,a){var o=Object(L.discardEPB)(n.data),s=this.getAvcEncryptedData(o),r=this;this.decryptBuffer(s.buffer,function(i){n.data=r.getAvcDecryptedUnit(o,i),a||r.decryptAvcSamples(A,g,c+1,l)})},k.decryptAvcSamples=function(A,g,c,l){if(A instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;g++,c=0){if(g>=A.length){l();return}for(var n=A[g].units;!(c>=n.length);c++){var a=n[c];if(a.data.length<=48||a.type!==1&&a.type!==5)continue;var o=this.decrypter.isSync();if(this.decryptAvcSample(A,g,c,l,a,o),!o)return}}},B}();H.default=R},"./src/demux/transmuxer-interface.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"default",function(){return n});var j=C("./node_modules/webworkify-webpack/index.js"),L=C.n(j),R=C("./src/events.ts"),B=C("./src/demux/transmuxer.ts"),k=C("./src/utils/logger.ts"),e=C("./src/errors.ts"),A=C("./src/utils/mediasource-helper.ts"),g=C("./node_modules/eventemitter3/index.js"),c=C.n(g),l=Object(A.getMediaSource)()||{isTypeSupported:function(){return!1}},n=function(){function a(s,r,i,t){var y=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.hls=s,this.id=r,this.onTransmuxComplete=i,this.onFlush=t;var p=s.config,m=function(d,f){f=f||{},f.frag=y.frag,f.id=y.id,s.trigger(d,f)};this.observer=new g.EventEmitter,this.observer.on(R.Events.FRAG_DECRYPTED,m),this.observer.on(R.Events.ERROR,m);var E={mp4:l.isTypeSupported("video/mp4"),mpeg:l.isTypeSupported("audio/mpeg"),mp3:l.isTypeSupported('audio/mp4; codecs="mp3"')},_=navigator.vendor;if(p.enableWorker&&typeof Worker!="undefined"){k.logger.log("demuxing in webworker");var h;try{h=this.worker=j("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),h.addEventListener("message",this.onwmsg),h.onerror=function(u){s.trigger(R.Events.ERROR,{type:e.ErrorTypes.OTHER_ERROR,details:e.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(u.message+" ("+u.filename+":"+u.lineno+")")})},h.postMessage({cmd:"init",typeSupported:E,vendor:_,id:r,config:JSON.stringify(p)})}catch(u){k.logger.warn("Error in worker:",u),k.logger.error("Error while initializing DemuxerWorker, fallback to inline"),h&&self.URL.revokeObjectURL(h.objectURL),this.transmuxer=new B.default(this.observer,E,p,_,r),this.worker=null}}else this.transmuxer=new B.default(this.observer,E,p,_,r)}var o=a.prototype;return o.destroy=function(){var r=this.worker;if(r)r.removeEventListener("message",this.onwmsg),r.terminate(),this.worker=null;else{var i=this.transmuxer;i&&(i.destroy(),this.transmuxer=null)}var t=this.observer;t&&t.removeAllListeners(),this.observer=null},o.push=function(r,i,t,y,p,m,E,_,h,u){var d=this;h.transmuxing.start=self.performance.now();var f=this.transmuxer,T=this.worker,b=m?m.start:p.start,S=p.decryptdata,D=this.frag,I=!(D&&p.cc===D.cc),w=!(D&&h.level===D.level),P=D?h.sn-D.sn:-1,U=this.part?h.part-this.part.index:1,O=!w&&(P===1||P===0&&U===1),G=self.performance.now();(w||P||p.stats.parsing.start===0)&&(p.stats.parsing.start=G),m&&(U||!O)&&(m.stats.parsing.start=G);var z=new B.TransmuxState(I,O,_,w,b);if(!O||I){k.logger.log("[transmuxer-interface, "+p.type+"]: Starting new transmux session for sn: "+h.sn+" p: "+h.part+" level: "+h.level+" id: "+h.id+`
discontinuity: `+I+`
trackSwitch: `+w+`
contiguous: `+O+`
accurateTimeOffset: `+_+`
timeOffset: `+b);var ae=new B.TransmuxConfig(t,y,i,E,u);this.configureTransmuxer(ae)}if(this.frag=p,this.part=m,T)T.postMessage({cmd:"demux",data:r,decryptdata:S,chunkMeta:h,state:z},r instanceof ArrayBuffer?[r]:[]);else if(f){var ie=f.push(r,S,h,z);Object(B.isPromise)(ie)?ie.then(function(fe){d.handleTransmuxComplete(fe)}):this.handleTransmuxComplete(ie)}},o.flush=function(r){var i=this;r.transmuxing.start=self.performance.now();var t=this.transmuxer,y=this.worker;if(y)y.postMessage({cmd:"flush",chunkMeta:r});else if(t){var p=t.flush(r);Object(B.isPromise)(p)?p.then(function(m){i.handleFlushResult(m,r)}):this.handleFlushResult(p,r)}},o.handleFlushResult=function(r,i){var t=this;r.forEach(function(y){t.handleTransmuxComplete(y)}),this.onFlush(i)},o.onWorkerMessage=function(r){var i=r.data,t=this.hls;switch(i.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(i.data);break}case"flush":{this.onFlush(i.data);break}default:{i.data=i.data||{},i.data.frag=this.frag,i.data.id=this.id,t.trigger(i.event,i.data);break}}},o.configureTransmuxer=function(r){var i=this.worker,t=this.transmuxer;i?i.postMessage({cmd:"configure",config:r}):t&&t.configure(r)},o.handleTransmuxComplete=function(r){r.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(r)},a}()},"./src/demux/transmuxer-worker.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"default",function(){return e});var j=C("./src/demux/transmuxer.ts"),L=C("./src/events.ts"),R=C("./src/utils/logger.ts"),B=C("./node_modules/eventemitter3/index.js"),k=C.n(B);function e(n){var a=new B.EventEmitter,o=function(r,i){n.postMessage({event:r,data:i})};a.on(L.Events.FRAG_DECRYPTED,o),a.on(L.Events.ERROR,o),n.addEventListener("message",function(s){var r=s.data;switch(r.cmd){case"init":{var i=JSON.parse(r.config);n.transmuxer=new j.default(a,r.typeSupported,i,r.vendor,r.id),Object(R.enableLogs)(i.debug),o("init",null);break}case"configure":{n.transmuxer.configure(r.config);break}case"demux":{var t=n.transmuxer.push(r.data,r.decryptdata,r.chunkMeta,r.state);Object(j.isPromise)(t)?t.then(function(m){A(n,m)}):A(n,t);break}case"flush":{var y=r.chunkMeta,p=n.transmuxer.flush(y);Object(j.isPromise)(p)?p.then(function(m){c(n,m,y)}):c(n,p,y);break}default:break}})}function A(n,a){if(l(a.remuxResult))return;var o=[],s=a.remuxResult,r=s.audio,i=s.video;r&&g(o,r),i&&g(o,i),n.postMessage({event:"transmuxComplete",data:a},o)}function g(n,a){a.data1&&n.push(a.data1.buffer),a.data2&&n.push(a.data2.buffer)}function c(n,a,o){a.forEach(function(s){A(n,s)}),n.postMessage({event:"flush",data:o})}function l(n){return!n.audio&&!n.video&&!n.text&&!n.id3&&!n.initSegment}},"./src/demux/transmuxer.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"default",function(){return i}),C.d(H,"isPromise",function(){return p}),C.d(H,"TransmuxConfig",function(){return m}),C.d(H,"TransmuxState",function(){return E});var j=C("./src/events.ts"),L=C("./src/errors.ts"),R=C("./src/crypt/decrypter.ts"),B=C("./src/demux/aacdemuxer.ts"),k=C("./src/demux/mp4demuxer.ts"),e=C("./src/demux/tsdemuxer.ts"),A=C("./src/demux/mp3demuxer.ts"),g=C("./src/remux/mp4-remuxer.ts"),c=C("./src/remux/passthrough-remuxer.ts"),l=C("./src/demux/chunk-cache.ts"),n=C("./src/utils/mp4-tools.ts"),a=C("./src/utils/logger.ts"),o;try{o=self.performance.now.bind(self.performance)}catch(_){a.logger.debug("Unable to use Performance API on this environment"),o=self.Date.now}var s=[{demux:e.default,remux:g.default},{demux:k.default,remux:c.default},{demux:B.default,remux:g.default},{demux:A.default,remux:g.default}],r=1024;s.forEach(function(_){var h=_.demux;r=Math.max(r,h.minProbeByteLength)});var i=function(){function _(u,d,f,T,b){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 l.default,this.observer=u,this.typeSupported=d,this.config=f,this.vendor=T,this.id=b}var h=_.prototype;return h.configure=function(d){this.transmuxConfig=d,this.decrypter&&this.decrypter.reset()},h.push=function(d,f,T,b){var S=this,D=T.transmuxing;D.executeStart=o();var I=new Uint8Array(d),w=this.cache,P=this.config,U=this.currentTransmuxState,O=this.transmuxConfig;b&&(this.currentTransmuxState=b);var G=t(I,f);if(G&&G.method==="AES-128"){var z=this.getDecrypter();if(P.enableSoftwareAES){var ae=z.softwareDecrypt(I,G.key.buffer,G.iv.buffer);if(!ae)return D.executeEnd=o(),y(T);I=new Uint8Array(ae)}else return this.decryptionPromise=z.webCryptoDecrypt(I,G.key.buffer,G.iv.buffer).then(function(Te){var Ae=S.push(Te,null,T);return S.decryptionPromise=null,Ae}),this.decryptionPromise}var ie=b||U,fe=ie.contiguous,ce=ie.discontinuity,J=ie.trackSwitch,Z=ie.accurateTimeOffset,ue=ie.timeOffset,X=O.audioCodec,$=O.videoCodec,be=O.defaultInitPts,Re=O.duration,Ie=O.initSegmentData;if((ce||J)&&this.resetInitSegment(Ie,X,$,Re),ce&&this.resetInitialTimestamp(be),fe||this.resetContiguity(),this.needsProbing(I,ce,J)){if(w.dataLength){var Le=w.flush();I=Object(n.appendUint8Array)(Le,I)}this.configureTransmuxer(I,O)}var Fe=this.transmux(I,G,ue,Z,T),ye=this.currentTransmuxState;return ye.contiguous=!0,ye.discontinuity=!1,ye.trackSwitch=!1,D.executeEnd=o(),Fe},h.flush=function(d){var f=this,T=d.transmuxing;T.executeStart=o();var b=this.decrypter,S=this.cache,D=this.currentTransmuxState,I=this.decryptionPromise;if(I)return I.then(function(){return f.flush(d)});var w=[],P=D.timeOffset;if(b){var U=b.flush();U&&w.push(this.push(U,null,d))}var O=S.dataLength;S.reset();var G=this.demuxer,z=this.remuxer;if(!G||!z)return O>=r&&this.observer.emit(j.Events.ERROR,j.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),T.executeEnd=o(),[y(d)];var ae=G.flush(P);return p(ae)?ae.then(function(ie){return f.flushRemux(w,ie,d),w}):(this.flushRemux(w,ae,d),w)},h.flushRemux=function(d,f,T){var b=f.audioTrack,S=f.avcTrack,D=f.id3Track,I=f.textTrack,w=this.currentTransmuxState,P=w.accurateTimeOffset,U=w.timeOffset;a.logger.log("[transmuxer.ts]: Flushed fragment "+T.sn+(T.part>-1?" p: "+T.part:"")+" of level "+T.level);var O=this.remuxer.remux(b,S,D,I,U,P,!0,this.id);d.push({remuxResult:O,chunkMeta:T}),T.transmuxing.executeEnd=o()},h.resetInitialTimestamp=function(d){var f=this.demuxer,T=this.remuxer;if(!f||!T)return;f.resetTimeStamp(d),T.resetTimeStamp(d)},h.resetContiguity=function(){var d=this.demuxer,f=this.remuxer;if(!d||!f)return;d.resetContiguity(),f.resetNextTimestamp()},h.resetInitSegment=function(d,f,T,b){var S=this.demuxer,D=this.remuxer;if(!S||!D)return;S.resetInitSegment(f,T,b),D.resetInitSegment(d,f,T)},h.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},h.transmux=function(d,f,T,b,S){var D;return f&&f.method==="SAMPLE-AES"?D=this.transmuxSampleAes(d,f,T,b,S):D=this.transmuxUnencrypted(d,T,b,S),D},h.transmuxUnencrypted=function(d,f,T,b){var S=this.demuxer.demux(d,f,!1,!this.config.progressive),D=S.audioTrack,I=S.avcTrack,w=S.id3Track,P=S.textTrack,U=this.remuxer.remux(D,I,w,P,f,T,!1,this.id);return{remuxResult:U,chunkMeta:b}},h.transmuxSampleAes=function(d,f,T,b,S){var D=this;return this.demuxer.demuxSampleAes(d,f,T).then(function(I){var w=D.remuxer.remux(I.audioTrack,I.avcTrack,I.id3Track,I.textTrack,T,b,!1,D.id);return{remuxResult:w,chunkMeta:S}})},h.configureTransmuxer=function(d,f){for(var T=this.config,b=this.observer,S=this.typeSupported,D=this.vendor,I=f.audioCodec,w=f.defaultInitPts,P=f.duration,U=f.initSegmentData,O=f.videoCodec,G,z=0,ae=s.length;z<ae;z++)if(s[z].demux.probe(d)){G=s[z];break}G||(a.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),G={demux:k.default,remux:c.default});var ie=this.demuxer,fe=this.remuxer,ce=G.remux,J=G.demux;(!fe||!(fe instanceof ce))&&(this.remuxer=new ce(b,T,S,D)),(!ie||!(ie instanceof J))&&(this.demuxer=new J(b,T,S),this.probe=J.probe),this.resetInitSegment(U,I,O,P),this.resetInitialTimestamp(w)},h.needsProbing=function(d,f,T){return!this.demuxer||!this.remuxer||f||T},h.getDecrypter=function(){var d=this.decrypter;return d||(d=this.decrypter=new R.default(this.observer,this.config)),d},_}();function t(_,h){var u=null;return _.byteLength>0&&h!=null&&h.key!=null&&h.iv!==null&&h.method!=null&&(u=h),u}var y=function(h){return{remuxResult:{},chunkMeta:h}};function p(_){return"then"in _&&_.then instanceof Function}var m=function(h,u,d,f,T){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=h,this.videoCodec=u,this.initSegmentData=d,this.duration=f,this.defaultInitPts=T},E=function(h,u,d,f,T){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=h,this.contiguous=u,this.accurateTimeOffset=d,this.trackSwitch=f,this.timeOffset=T}},"./src/demux/tsdemuxer.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"discardEPB",function(){return y});var j=C("./src/demux/adts.ts"),L=C("./src/demux/mpegaudio.ts"),R=C("./src/demux/exp-golomb.ts"),B=C("./src/demux/id3.ts"),k=C("./src/demux/sample-aes.ts"),e=C("./src/events.ts"),A=C("./src/utils/mp4-tools.ts"),g=C("./src/utils/logger.ts"),c=C("./src/errors.ts"),l={video:1,audio:2,id3:3,text:4},n=function(){function p(E,_,h){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=E,this.config=_,this.typeSupported=h}p.probe=function(_){var h=p.syncOffset(_);return h<0?!1:(h&&g.logger.warn("MPEG2-TS detected but first sync word found @ offset "+h+", junk ahead ?"),!0)},p.syncOffset=function(_){for(var h=Math.min(1e3,_.length-3*188),u=0;u<h;){if(_[u]===71&&_[u+188]===71&&_[u+2*188]===71)return u;u++}return-1},p.createTrack=function(_,h){return{container:_==="video"||_==="audio"?"video/mp2t":void 0,type:_,id:l[_],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:_==="audio"?h:void 0}};var m=p.prototype;return m.resetInitSegment=function(_,h,u){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=p.createTrack("video",u),this._audioTrack=p.createTrack("audio",u),this._id3Track=p.createTrack("id3",u),this._txtTrack=p.createTrack("text",u),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=_,this.videoCodec=h,this._duration=u},m.resetTimeStamp=function(){},m.resetContiguity=function(){var _=this._audioTrack,h=this._avcTrack,u=this._id3Track;_&&(_.pesData=null),h&&(h.pesData=null),u&&(u.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},m.demux=function(_,h,u,d){u===void 0&&(u=!1),d===void 0&&(d=!1),u||(this.sampleAes=null);var f,T=this._avcTrack,b=this._audioTrack,S=this._id3Track,D=T.pid,I=T.pesData,w=b.pid,P=S.pid,U=b.pesData,O=S.pesData,G=!1,z=this.pmtParsed,ae=this._pmtId,ie=_.length;if(this.remainderData&&(_=Object(A.appendUint8Array)(this.remainderData,_),ie=_.length,this.remainderData=null),ie<188&&!d)return this.remainderData=_,{audioTrack:b,avcTrack:T,id3Track:S,textTrack:this._txtTrack};var fe=Math.max(0,p.syncOffset(_));ie-=(ie+fe)%188,ie<_.byteLength&&!d&&(this.remainderData=new Uint8Array(_.buffer,ie,_.buffer.byteLength-ie));for(var ce=fe;ce<ie;ce+=188)if(_[ce]===71){var J=!!(_[ce+1]&64),Z=((_[ce+1]&31)<<8)+_[ce+2],ue=(_[ce+3]&48)>>4,X=void 0;if(ue>1){if(X=ce+5+_[ce+4],X===ce+188)continue}else X=ce+4;switch(Z){case D:J&&(I&&(f=r(I))&&this.parseAVCPES(f,!1),I={data:[],size:0}),I&&(I.data.push(_.subarray(X,ce+188)),I.size+=ce+188-X);break;case w:J&&(U&&(f=r(U))&&(b.isAAC?this.parseAACPES(f):this.parseMPEGPES(f)),U={data:[],size:0}),U&&(U.data.push(_.subarray(X,ce+188)),U.size+=ce+188-X);break;case P:J&&(O&&(f=r(O))&&this.parseID3PES(f),O={data:[],size:0}),O&&(O.data.push(_.subarray(X,ce+188)),O.size+=ce+188-X);break;case 0:J&&(X+=_[X]+1),ae=this._pmtId=o(_,X);break;case ae:{J&&(X+=_[X]+1);var $=s(_,X,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,u);D=$.avc,D>0&&(T.pid=D),w=$.audio,w>0&&(b.pid=w,b.isAAC=$.isAAC),P=$.id3,P>0&&(S.pid=P),G&&!z&&(g.logger.log("reparse from beginning"),G=!1,ce=fe-188),z=this.pmtParsed=!0;break}case 17:case 8191:break;default:G=!0;break}}else this.observer.emit(e.Events.ERROR,e.Events.ERROR,{type:c.ErrorTypes.MEDIA_ERROR,details:c.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});T.pesData=I,b.pesData=U,S.pesData=O;var be={audioTrack:b,avcTrack:T,id3Track:S,textTrack:this._txtTrack};return d&&this.extractRemainingSamples(be),be},m.flush=function(){var _=this.remainderData;this.remainderData=null;var h;return _?h=this.demux(_,-1,!1,!0):h={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(h),this.sampleAes?this.decrypt(h,this.sampleAes):h},m.extractRemainingSamples=function(_){var h=_.audioTrack,u=_.avcTrack,d=_.id3Track,f=u.pesData,T=h.pesData,b=d.pesData,S;f&&(S=r(f))?(this.parseAVCPES(S,!0),u.pesData=null):u.pesData=f,T&&(S=r(T))?(h.isAAC?this.parseAACPES(S):this.parseMPEGPES(S),h.pesData=null):(T!=null&&T.size&&g.logger.log("last AAC PES packet truncated,might overlap between fragments"),h.pesData=T),b&&(S=r(b))?(this.parseID3PES(S),d.pesData=null):d.pesData=b},m.demuxSampleAes=function(_,h,u){var d=this.demux(_,u,!0,!this.config.progressive),f=this.sampleAes=new k.default(this.observer,this.config,h);return this.decrypt(d,f)},m.decrypt=function(_,h){return new Promise(function(u){var d=_.audioTrack,f=_.avcTrack;d.samples&&d.isAAC?h.decryptAacSamples(d.samples,0,function(){f.samples?h.decryptAvcSamples(f.samples,0,0,function(){u(_)}):u(_)}):f.samples&&h.decryptAvcSamples(f.samples,0,0,function(){u(_)})})},m.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},m.parseAVCPES=function(_,h){var u=this,d=this._avcTrack,f=this.parseAVCNALu(_.data),T=!1,b=this.avcSample,S,D=!1;_.data=null,b&&f.length&&!d.audFound&&(i(b,d),b=this.avcSample=a(!1,_.pts,_.dts,"")),f.forEach(function(I){switch(I.type){case 1:{S=!0,b||(b=u.avcSample=a(!0,_.pts,_.dts,"")),T&&(b.debug+="NDR "),b.frame=!0;var w=I.data;if(D&&w.length>4){var P=new R.default(w).readSliceType();(P===2||P===4||P===7||P===9)&&(b.key=!0)}break}case 5:S=!0,b||(b=u.avcSample=a(!0,_.pts,_.dts,"")),T&&(b.debug+="IDR "),b.key=!0,b.frame=!0;break;case 6:{S=!0,T&&b&&(b.debug+="SEI ");var U=new R.default(y(I.data));U.readUByte();for(var O=0,G=0,z=!1,ae=0;!z&&U.bytesAvailable>1;){O=0;do ae=U.readUByte(),O+=ae;while(ae===255);G=0;do ae=U.readUByte(),G+=ae;while(ae===255);if(O===4&&U.bytesAvailable!==0){z=!0;var ie=U.readUByte();if(ie===181){var fe=U.readUShort();if(fe===49){var ce=U.readUInt();if(ce===1195456820){var J=U.readUByte();if(J===3){for(var Z=U.readUByte(),ue=U.readUByte(),X=31&Z,$=[Z,ue],be=0;be<X;be++)$.push(U.readUByte()),$.push(U.readUByte()),$.push(U.readUByte());t(u._txtTrack.samples,{type:3,pts:_.pts,bytes:$})}}}}}else if(O===5&&U.bytesAvailable!==0){if(z=!0,G>16){for(var Re=[],Ie=0;Ie<16;Ie++)Re.push(U.readUByte().toString(16)),(Ie===3||Ie===5||Ie===7||Ie===9)&&Re.push("-");for(var Le=G-16,Fe=new Uint8Array(Le),ye=0;ye<Le;ye++)Fe[ye]=U.readUByte();t(u._txtTrack.samples,{pts:_.pts,payloadType:O,uuid:Re.join(""),userData:Object(B.utf8ArrayToStr)(Fe),userDataBytes:Fe})}}else if(G<U.bytesAvailable)for(var Te=0;Te<G;Te++)U.readUByte()}break}case 7:if(S=!0,D=!0,T&&b&&(b.debug+="SPS "),!d.sps){var Ae=new R.default(I.data),Y=Ae.readSPS();d.width=Y.width,d.height=Y.height,d.pixelRatio=Y.pixelRatio,d.sps=[I.data],d.duration=u._duration;for(var se=I.data.subarray(1,4),pe="avc1.",ve=0;ve<3;ve++){var Me=se[ve].toString(16);Me.length<2&&(Me="0"+Me),pe+=Me}d.codec=pe}break;case 8:S=!0,T&&b&&(b.debug+="PPS "),d.pps||(d.pps=[I.data]);break;case 9:S=!1,d.audFound=!0,b&&i(b,d),b=u.avcSample=a(!1,_.pts,_.dts,T?"AUD ":"");break;case 12:S=!1;break;default:S=!1,b&&(b.debug+="unknown NAL "+I.type+" ");break}if(b&&S){var he=b.units;he.push(I)}}),h&&b&&(i(b,d),this.avcSample=null)},m.getLastNalUnit=function(){var _,h=this.avcSample,u;if(!h||h.units.length===0){var d=this._avcTrack.samples;h=d[d.length-1]}if((_=h)!==null&&_!==void 0&&_.units){var f=h.units;u=f[f.length-1]}return u},m.parseAVCNALu=function(_){var h=_.byteLength,u=this._avcTrack,d=u.naluState||0,f=d,T=[],b=0,S,D,I,w=-1,P=0;for(d===-1&&(w=0,P=_[0]&31,d=0,b=1);b<h;){if(S=_[b++],!d){d=S?0:1;continue}if(d===1){d=S?0:2;continue}if(!S)d=3;else if(S===1){if(w>=0){var U={data:_.subarray(w,b-d-1),type:P};T.push(U)}else{var O=this.getLastNalUnit();if(O&&(f&&b<=4-f&&(O.state&&(O.data=O.data.subarray(0,O.data.byteLength-f))),D=b-d-1,D>0)){var G=new Uint8Array(O.data.byteLength+D);G.set(O.data,0),G.set(_.subarray(0,D),O.data.byteLength),O.data=G,O.state=0}}b<h?(I=_[b]&31,w=b,P=I,d=0):d=-1}else d=0}if(w>=0&&d>=0){var z={data:_.subarray(w,h),type:P,state:d};T.push(z)}if(T.length===0){var ae=this.getLastNalUnit();if(ae){var ie=new Uint8Array(ae.data.byteLength+_.byteLength);ie.set(ae.data,0),ie.set(_,ae.data.byteLength),ae.data=ie}}return u.naluState=d,T},m.parseAACPES=function(_){var h=0,u=this._audioTrack,d=this.aacOverFlow,f=_.data;if(d){this.aacOverFlow=null;var T=d.sample.unit.byteLength,b=Math.min(d.missing,T),S=T-b;d.sample.unit.set(f.subarray(0,b),S),u.samples.push(d.sample),h=d.missing}var D,I;for(D=h,I=f.length;D<I-1&&!j.isHeader(f,D);D++);if(D!==h){var w,P;if(D<I-1?(w="AAC PES did not start with ADTS header,offset:"+D,P=!1):(w="no ADTS header found in AAC PES",P=!0),g.logger.warn("parsing error:"+w),this.observer.emit(e.Events.ERROR,e.Events.ERROR,{type:c.ErrorTypes.MEDIA_ERROR,details:c.ErrorDetails.FRAG_PARSING_ERROR,fatal:P,reason:w}),P)return}j.initTrackConfig(u,this.observer,f,D,this.audioCodec);var U;if(_.pts!==void 0)U=_.pts;else if(d){var O=j.getFrameDuration(u.samplerate);U=d.sample.pts+O}else{g.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var G=0;D<I;)if(j.isHeader(f,D)){if(D+5<I){var z=j.appendFrame(u,f,D,U,G);if(z)if(z.missing)this.aacOverFlow=z;else{D+=z.length,G++;continue}}break}else D++},m.parseMPEGPES=function(_){var h=_.data,u=h.length,d=0,f=0,T=_.pts;if(T===void 0){g.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;f<u;)if(L.isHeader(h,f)){var b=L.appendFrame(this._audioTrack,h,f,T,d);if(b)f+=b.length,d++;else break}else f++},m.parseID3PES=function(_){if(_.pts===void 0){g.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(_)},p}();n.minProbeByteLength=188;function a(p,m,E,_){return{key:p,frame:!1,pts:m,dts:E,units:[],debug:_,length:0}}function o(p,m){return(p[m+10]&31)<<8|p[m+11]}function s(p,m,E,_){var h={audio:-1,avc:-1,id3:-1,isAAC:!0},u=(p[m+1]&15)<<8|p[m+2],d=m+3+u-4,f=(p[m+10]&15)<<8|p[m+11];for(m+=12+f;m<d;){var T=(p[m+1]&31)<<8|p[m+2];switch(p[m]){case 207:if(!_){g.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:h.audio===-1&&(h.audio=T);break;case 21:h.id3===-1&&(h.id3=T);break;case 219:if(!_){g.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:h.avc===-1&&(h.avc=T);break;case 3:case 4:E?h.audio===-1&&(h.audio=T,h.isAAC=!1):g.logger.log("MPEG audio found, not supported in this browser");break;case 36:g.logger.warn("Unsupported HEVC stream type found");break;default:break}m+=((p[m+3]&15)<<8|p[m+4])+5}return h}function r(p){var m=0,E,_,h,u,d,f=p.data;if(!p||p.size===0)return null;for(;f[0].length<19&&f.length>1;){var T=new Uint8Array(f[0].length+f[1].length);T.set(f[0]),T.set(f[1],f[0].length),f[0]=T,f.splice(1,1)}E=f[0];var b=(E[0]<<16)+(E[1]<<8)+E[2];if(b===1){if(_=(E[4]<<8)+E[5],_&&_>p.size-6)return null;var S=E[7];S&192&&(u=(E[9]&14)*536870912+(E[10]&255)*4194304+(E[11]&254)*16384+(E[12]&255)*128+(E[13]&254)/2,S&64?(d=(E[14]&14)*536870912+(E[15]&255)*4194304+(E[16]&254)*16384+(E[17]&255)*128+(E[18]&254)/2,u-d>60*9e4&&(g.logger.warn(Math.round((u-d)/9e4)+"s delta between PTS and DTS, align them"),u=d)):d=u),h=E[8];var D=h+9;if(p.size<=D)return null;p.size-=D;for(var I=new Uint8Array(p.size),w=0,P=f.length;w<P;w++){E=f[w];var U=E.byteLength;if(D)if(D>U){D-=U;continue}else E=E.subarray(D),U-=D,D=0;I.set(E,m),m+=U}return _&&(_-=h+3),{data:I,pts:u,dts:d,len:_}}return null}function i(p,m){if(p.units.length&&p.frame){if(p.pts===void 0){var E=m.samples,_=E.length;if(_){var h=E[_-1];p.pts=h.pts,p.dts=h.dts}else{m.dropped++;return}}m.samples.push(p)}p.debug.length&&g.logger.log(p.pts+"/"+p.dts+":"+p.debug)}function t(p,m){var E=p.length;if(E>0){if(m.pts>=p[E-1].pts)p.push(m);else for(var _=E-1;_>=0;_--)if(m.pts<p[_].pts){p.splice(_,0,m);break}}else p.push(m)}function y(p){for(var m=p.byteLength,E=[],_=1;_<m-2;)p[_]===0&&p[_+1]===0&&p[_+2]===3?(E.push(_+2),_+=2):_++;if(E.length===0)return p;var h=m-E.length,u=new Uint8Array(h),d=0;for(_=0;_<h;d++,_++)d===E[0]&&(d++,E.shift()),u[_]=p[d];return u}H.default=n},"./src/errors.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"ErrorTypes",function(){return j}),C.d(H,"ErrorDetails",function(){return L});var j;(function(R){R.NETWORK_ERROR="networkError",R.MEDIA_ERROR="mediaError",R.KEY_SYSTEM_ERROR="keySystemError",R.MUX_ERROR="muxError",R.OTHER_ERROR="otherError"})(j||(j={}));var L;(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"})(L||(L={}))},"./src/events.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"Events",function(){return j});var j;(function(L){L.MEDIA_ATTACHING="hlsMediaAttaching",L.MEDIA_ATTACHED="hlsMediaAttached",L.MEDIA_DETACHING="hlsMediaDetaching",L.MEDIA_DETACHED="hlsMediaDetached",L.BUFFER_RESET="hlsBufferReset",L.BUFFER_CODECS="hlsBufferCodecs",L.BUFFER_CREATED="hlsBufferCreated",L.BUFFER_APPENDING="hlsBufferAppending",L.BUFFER_APPENDED="hlsBufferAppended",L.BUFFER_EOS="hlsBufferEos",L.BUFFER_FLUSHING="hlsBufferFlushing",L.BUFFER_FLUSHED="hlsBufferFlushed",L.MANIFEST_LOADING="hlsManifestLoading",L.MANIFEST_LOADED="hlsManifestLoaded",L.MANIFEST_PARSED="hlsManifestParsed",L.LEVEL_SWITCHING="hlsLevelSwitching",L.LEVEL_SWITCHED="hlsLevelSwitched",L.LEVEL_LOADING="hlsLevelLoading",L.LEVEL_LOADED="hlsLevelLoaded",L.LEVEL_UPDATED="hlsLevelUpdated",L.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",L.LEVELS_UPDATED="hlsLevelsUpdated",L.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",L.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",L.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",L.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",L.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",L.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",L.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",L.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",L.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",L.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",L.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",L.CUES_PARSED="hlsCuesParsed",L.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",L.INIT_PTS_FOUND="hlsInitPtsFound",L.FRAG_LOADING="hlsFragLoading",L.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",L.FRAG_LOADED="hlsFragLoaded",L.FRAG_DECRYPTED="hlsFragDecrypted",L.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",L.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",L.FRAG_PARSING_METADATA="hlsFragParsingMetadata",L.FRAG_PARSED="hlsFragParsed",L.FRAG_BUFFERED="hlsFragBuffered",L.FRAG_CHANGED="hlsFragChanged",L.FPS_DROP="hlsFpsDrop",L.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",L.ERROR="hlsError",L.DESTROYING="hlsDestroying",L.KEY_LOADING="hlsKeyLoading",L.KEY_LOADED="hlsKeyLoaded",L.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",L.BACK_BUFFER_REACHED="hlsBackBufferReached"})(j||(j={}))},"./src/hls.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"default",function(){return p});var j=C("./node_modules/url-toolkit/src/url-toolkit.js"),L=C.n(j),R=C("./src/loader/playlist-loader.ts"),B=C("./src/loader/key-loader.ts"),k=C("./src/controller/id3-track-controller.ts"),e=C("./src/controller/latency-controller.ts"),A=C("./src/controller/level-controller.ts"),g=C("./src/controller/fragment-tracker.ts"),c=C("./src/controller/stream-controller.ts"),l=C("./src/is-supported.ts"),n=C("./src/utils/logger.ts"),a=C("./src/config.ts"),o=C("./node_modules/eventemitter3/index.js"),s=C.n(o),r=C("./src/events.ts"),i=C("./src/errors.ts");function t(m,E){for(var _=0;_<E.length;_++){var h=E[_];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(m,h.key,h)}}function y(m,E,_){return E&&t(m.prototype,E),_&&t(m,_),m}var p=function(){m.isSupported=function(){return Object(l.isSupported)()};function m(_){_===void 0&&(_={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new o.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 h=this.config=Object(a.mergeConfig)(m.DefaultConfig,_);this.userConfig=_,Object(n.enableLogs)(h.debug),this._autoLevelCapping=-1,h.progressive&&Object(a.enableStreamingMode)(h);var u=h.abrController,d=h.bufferController,f=h.capLevelController,T=h.fpsController,b=this.abrController=new u(this),S=this.bufferController=new d(this),D=this.capLevelController=new f(this),I=new T(this),w=new R.default(this),P=new B.default(this),U=new k.default(this),O=this.levelController=new A.default(this),G=new g.FragmentTracker(this),z=this.streamController=new c.default(this,G);D.setStreamController(z),I.setStreamController(z);var ae=[O,z];this.networkControllers=ae;var ie=[w,P,b,S,D,I,U,G];this.audioTrackController=this.createController(h.audioTrackController,null,ae),this.createController(h.audioStreamController,G,ae),this.subtitleTrackController=this.createController(h.subtitleTrackController,null,ae),this.createController(h.subtitleStreamController,G,ae),this.createController(h.timelineController,null,ie),this.emeController=this.createController(h.emeController,null,ie),this.cmcdController=this.createController(h.cmcdController,null,ie),this.latencyController=this.createController(e.default,null,ie),this.coreComponents=ie}var E=m.prototype;return E.createController=function(h,u,d){if(h){var f=u?new h(this,u):new h(this);return d&&d.push(f),f}return null},E.on=function(h,u,d){d===void 0&&(d=this),this._emitter.on(h,u,d)},E.once=function(h,u,d){d===void 0&&(d=this),this._emitter.once(h,u,d)},E.removeAllListeners=function(h){this._emitter.removeAllListeners(h)},E.off=function(h,u,d,f){d===void 0&&(d=this),this._emitter.off(h,u,d,f)},E.listeners=function(h){return this._emitter.listeners(h)},E.emit=function(h,u,d){return this._emitter.emit(h,u,d)},E.trigger=function(h,u){if(this.config.debug)return this.emit(h,h,u);try{return this.emit(h,h,u)}catch(d){n.logger.error("An internal error happened while handling event "+h+'. Error message: "'+d.message+'". Here is a stacktrace:',d),this.trigger(r.Events.ERROR,{type:i.ErrorTypes.OTHER_ERROR,details:i.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:h,error:d})}return!1},E.listenerCount=function(h){return this._emitter.listenerCount(h)},E.destroy=function(){n.logger.log("destroy"),this.trigger(r.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(h){return h.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(h){return h.destroy()}),this.coreComponents.length=0},E.attachMedia=function(h){n.logger.log("attachMedia"),this._media=h,this.trigger(r.Events.MEDIA_ATTACHING,{media:h})},E.detachMedia=function(){n.logger.log("detachMedia"),this.trigger(r.Events.MEDIA_DETACHING,void 0),this._media=null},E.loadSource=function(h){this.stopLoad();var u=this.media,d=this.url,f=this.url=j.buildAbsoluteURL(self.location.href,h,{alwaysNormalize:!0});n.logger.log("loadSource:"+f),u&&d&&d!==f&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(u)),this.trigger(r.Events.MANIFEST_LOADING,{url:h})},E.startLoad=function(h){h===void 0&&(h=-1),n.logger.log("startLoad("+h+")"),this.networkControllers.forEach(function(u){u.startLoad(h)})},E.stopLoad=function(){n.logger.log("stopLoad"),this.networkControllers.forEach(function(h){h.stopLoad()})},E.swapAudioCodec=function(){n.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},E.recoverMediaError=function(){n.logger.log("recoverMediaError");var h=this._media;this.detachMedia(),h&&this.attachMedia(h)},E.removeLevel=function(h,u){u===void 0&&(u=0),this.levelController.removeLevel(h,u)},y(m,[{key:"levels",get:function(){var h=this.levelController.levels;return h||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(h){n.logger.log("set currentLevel:"+h),this.loadLevel=h,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(h){n.logger.log("set nextLevel:"+h),this.levelController.manualLevel=h,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(h){n.logger.log("set loadLevel:"+h),this.levelController.manualLevel=h}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(h){this.levelController.nextLoadLevel=h}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(h){n.logger.log("set firstLevel:"+h),this.levelController.firstLevel=h}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(h){n.logger.log("set startLevel:"+h),h!==-1&&(h=Math.max(h,this.minAutoLevel)),this.levelController.startLevel=h}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(h){var u=!!h;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(h){this._autoLevelCapping!==h&&(n.logger.log("set autoLevelCapping:"+h),this._autoLevelCapping=h)}},{key:"bandwidthEstimate",get:function(){var h=this.abrController.bwEstimator;return h?h.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var h=this.levels,u=this.config.minAutoBitrate;if(!h)return 0;for(var d=h.length,f=0;f<d;f++)if(h[f].maxBitrate>u)return f;return 0}},{key:"maxAutoLevel",get:function(){var h=this.levels,u=this.autoLevelCapping,d;return u===-1&&h&&h.length?d=h.length-1:d=u,d}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(h){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,h)}},{key:"audioTracks",get:function(){var h=this.audioTrackController;return h?h.audioTracks:[]}},{key:"audioTrack",get:function(){var h=this.audioTrackController;return h?h.audioTrack:-1},set:function(h){var u=this.audioTrackController;u&&(u.audioTrack=h)}},{key:"subtitleTracks",get:function(){var h=this.subtitleTrackController;return h?h.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var h=this.subtitleTrackController;return h?h.subtitleTrack:-1},set:function(h){var u=this.subtitleTrackController;u&&(u.subtitleTrack=h)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var h=this.subtitleTrackController;return h?h.subtitleDisplay:!1},set:function(h){var u=this.subtitleTrackController;u&&(u.subtitleDisplay=h)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(h){this.config.lowLatencyMode=h}},{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 r.Events}},{key:"ErrorTypes",get:function(){return i.ErrorTypes}},{key:"ErrorDetails",get:function(){return i.ErrorDetails}},{key:"DefaultConfig",get:function(){return m.defaultConfig?m.defaultConfig:a.hlsDefaultConfig},set:function(h){m.defaultConfig=h}}]),m}();p.defaultConfig=void 0},"./src/is-supported.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"isSupported",function(){return R}),C.d(H,"changeTypeSupported",function(){return B});var j=C("./src/utils/mediasource-helper.ts");function L(){return self.SourceBuffer||self.WebKitSourceBuffer}function R(){var k=Object(j.getMediaSource)();if(!k)return!1;var e=L(),A=k&&typeof k.isTypeSupported=="function"&&k.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),g=!e||e.prototype&&typeof e.prototype.appendBuffer=="function"&&typeof e.prototype.remove=="function";return!!A&&!!g}function B(){var k,e=L();return typeof(e==null||((k=e.prototype)===null||k===void 0)?void 0:k.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"default",function(){return n}),C.d(H,"LoadError",function(){return o});var j=C("./src/polyfills/number.ts"),L=C("./src/errors.ts");function R(s,r){s.prototype=Object.create(r.prototype),s.prototype.constructor=s,g(s,r)}function B(s){var r=typeof Map=="function"?new Map:void 0;return B=function(t){if(t===null||!A(t))return t;if(typeof t!="function")throw new TypeError("Super expression must either be null or a function");if(typeof r!="undefined"){if(r.has(t))return r.get(t);r.set(t,y)}function y(){return k(t,arguments,c(this).constructor)}return y.prototype=Object.create(t.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),g(y,t)},B(s)}function k(s,r,i){return e()?k=Reflect.construct:k=function(y,p,m){var E=[null];E.push.apply(E,p);var _=Function.bind.apply(y,E),h=new _;return m&&g(h,m.prototype),h},k.apply(null,arguments)}function e(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(s){return!1}}function A(s){return Function.toString.call(s).indexOf("[native code]")!==-1}function g(s,r){return g=Object.setPrototypeOf||function(t,y){return t.__proto__=y,t},g(s,r)}function c(s){return c=Object.setPrototypeOf?Object.getPrototypeOf:function(i){return i.__proto__||Object.getPrototypeOf(i)},c(s)}var l=Math.pow(2,17),n=function(){function s(i){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=i}var r=s.prototype;return r.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},r.abort=function(){this.loader&&this.loader.abort()},r.load=function(t,y){var p=this,m=t.url;if(!m)return Promise.reject(new o({type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:t,networkDetails:null},"Fragment does not have a "+(m?"part list":"url")));this.abort();var E=this.config,_=E.fLoader,h=E.loader;return new Promise(function(u,d){p.loader&&p.loader.destroy();var f=p.loader=t.loader=_?new _(E):new h(E),T=a(t),b={timeout:E.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:E.fragLoadingMaxRetryTimeout,highWaterMark:l};t.stats=f.stats,f.load(T,b,{onSuccess:function(D,I,w,P){p.resetLoader(t,f),u({frag:t,part:null,payload:D.data,networkDetails:P})},onError:function(D,I,w){p.resetLoader(t,f),d(new o({type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:t,response:D,networkDetails:w}))},onAbort:function(D,I,w){p.resetLoader(t,f),d(new o({type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:t,networkDetails:w}))},onTimeout:function(D,I,w){p.resetLoader(t,f),d(new o({type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,networkDetails:w}))},onProgress:function(D,I,w,P){y&&y({frag:t,part:null,payload:w,networkDetails:P})}})})},r.loadPart=function(t,y,p){var m=this;this.abort();var E=this.config,_=E.fLoader,h=E.loader;return new Promise(function(u,d){m.loader&&m.loader.destroy();var f=m.loader=t.loader=_?new _(E):new h(E),T=a(t,y),b={timeout:E.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:E.fragLoadingMaxRetryTimeout,highWaterMark:l};y.stats=f.stats,f.load(T,b,{onSuccess:function(D,I,w,P){m.resetLoader(t,f),m.updateStatsFromPart(t,y);var U={frag:t,part:y,payload:D.data,networkDetails:P};p(U),u(U)},onError:function(D,I,w){m.resetLoader(t,f),d(new o({type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:t,part:y,response:D,networkDetails:w}))},onAbort:function(D,I,w){t.stats.aborted=y.stats.aborted,m.resetLoader(t,f),d(new o({type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:t,part:y,networkDetails:w}))},onTimeout:function(D,I,w){m.resetLoader(t,f),d(new o({type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,part:y,networkDetails:w}))}})})},r.updateStatsFromPart=function(t,y){var p=t.stats,m=y.stats,E=m.total;if(p.loaded+=m.loaded,E){var _=Math.round(t.duration/y.duration),h=Math.min(Math.round(p.loaded/E),_),u=_-h,d=u*Math.round(p.loaded/h);p.total=p.loaded+d}else p.total=Math.max(p.loaded,p.total);var f=p.loading,T=m.loading;f.start?f.first+=T.first-T.start:(f.start=T.start,f.first=T.first),f.end=T.end},r.resetLoader=function(t,y){t.loader=null,this.loader===y&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),y.destroy()},s}();function a(s,r){r===void 0&&(r=null);var i=r||s,t={frag:s,part:r,responseType:"arraybuffer",url:i.url,headers:{},rangeStart:0,rangeEnd:0},y=i.byteRangeStartOffset,p=i.byteRangeEndOffset;return Object(j.isFiniteNumber)(y)&&Object(j.isFiniteNumber)(p)&&(t.rangeStart=y,t.rangeEnd=p),t}var o=function(s){R(r,s);function r(i){for(var t,y=arguments.length,p=new Array(y>1?y-1:0),m=1;m<y;m++)p[m-1]=arguments[m];return t=s.call.apply(s,[this].concat(p))||this,t.data=void 0,t.data=i,t}return r}(B(Error))},"./src/loader/fragment.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"ElementaryStreamTypes",function(){return n}),C.d(H,"BaseSegment",function(){return a}),C.d(H,"Fragment",function(){return o}),C.d(H,"Part",function(){return s});var j=C("./src/polyfills/number.ts"),L=C("./node_modules/url-toolkit/src/url-toolkit.js"),R=C.n(L),B=C("./src/utils/logger.ts"),k=C("./src/loader/level-key.ts"),e=C("./src/loader/load-stats.ts");function A(r,i){r.prototype=Object.create(i.prototype),r.prototype.constructor=r,g(r,i)}function g(r,i){return g=Object.setPrototypeOf||function(y,p){return y.__proto__=p,y},g(r,i)}function c(r,i){for(var t=0;t<i.length;t++){var y=i[t];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(r,y.key,y)}}function l(r,i,t){return i&&c(r.prototype,i),t&&c(r,t),r}var n;(function(r){r.AUDIO="audio",r.VIDEO="video",r.AUDIOVIDEO="audiovideo"})(n||(n={}));var a=function(){function r(t){var y;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(y={},y[n.AUDIO]=null,y[n.VIDEO]=null,y[n.AUDIOVIDEO]=null,y),this.baseurl=t}var i=r.prototype;return i.setByteRange=function(y,p){var m=y.split("@",2),E=[];m.length===1?E[0]=p?p.byteRangeEndOffset:0:E[0]=parseInt(m[1]),E[1]=parseInt(m[0])+E[0],this._byteRange=E},l(r,[{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(L.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(y){this._url=y}}]),r}(),o=function(r){A(i,r);function i(y,p){var m;return m=r.call(this,p)||this,m._decryptdata=null,m.rawProgramDateTime=null,m.programDateTime=null,m.tagList=[],m.duration=0,m.sn=0,m.levelkey=void 0,m.type=void 0,m.loader=null,m.level=-1,m.cc=0,m.startPTS=void 0,m.endPTS=void 0,m.appendedPTS=void 0,m.startDTS=void 0,m.endDTS=void 0,m.start=0,m.deltaPTS=void 0,m.maxStartPTS=void 0,m.minEndPTS=void 0,m.stats=new e.LoadStats,m.urlId=0,m.data=void 0,m.bitrateTest=!1,m.title=null,m.initSegment=null,m.type=y,m}var t=i.prototype;return t.createInitializationVector=function(p){for(var m=new Uint8Array(16),E=12;E<16;E++)m[E]=p>>8*(15-E)&255;return m},t.setDecryptDataFromLevelKey=function(p,m){var E=p;return(p==null?void 0:p.method)==="AES-128"&&p.uri&&!p.iv&&(E=k.LevelKey.fromURI(p.uri),E.method=p.method,E.iv=this.createInitializationVector(m),E.keyFormat="identity"),E},t.setElementaryStreamInfo=function(p,m,E,_,h,u){u===void 0&&(u=!1);var d=this.elementaryStreams,f=d[p];if(!f){d[p]={startPTS:m,endPTS:E,startDTS:_,endDTS:h,partial:u};return}f.startPTS=Math.min(f.startPTS,m),f.endPTS=Math.max(f.endPTS,E),f.startDTS=Math.min(f.startDTS,_),f.endDTS=Math.max(f.endDTS,h)},t.clearElementaryStreamInfo=function(){var p=this.elementaryStreams;p[n.AUDIO]=null,p[n.VIDEO]=null,p[n.AUDIOVIDEO]=null},l(i,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var p=this.sn;typeof p!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&B.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),p=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,p)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(j.isFiniteNumber)(this.programDateTime))return null;var p=Object(j.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+p*1e3}},{key:"encrypted",get:function(){var p;return!!((p=this.decryptdata)!==null&&p!==void 0&&p.keyFormat&&this.decryptdata.uri)}}]),i}(a),s=function(r){A(i,r);function i(t,y,p,m,E){var _;_=r.call(this,p)||this,_.fragOffset=0,_.duration=0,_.gap=!1,_.independent=!1,_.relurl=void 0,_.fragment=void 0,_.index=void 0,_.stats=new e.LoadStats,_.duration=t.decimalFloatingPoint("DURATION"),_.gap=t.bool("GAP"),_.independent=t.bool("INDEPENDENT"),_.relurl=t.enumeratedString("URI"),_.fragment=y,_.index=m;var h=t.enumeratedString("BYTERANGE");return h&&_.setByteRange(h,E),E&&(_.fragOffset=E.fragOffset+E.duration),_}return l(i,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var y=this.elementaryStreams;return!!(y.audio||y.video||y.audiovideo)}}]),i}(a)},"./src/loader/key-loader.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"default",function(){return B});var j=C("./src/events.ts"),L=C("./src/errors.ts"),R=C("./src/utils/logger.ts"),B=function(){function k(A){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=A,this._registerListeners()}var e=k.prototype;return e._registerListeners=function(){this.hls.on(j.Events.KEY_LOADING,this.onKeyLoading,this)},e._unregisterListeners=function(){this.hls.off(j.Events.KEY_LOADING,this.onKeyLoading)},e.destroy=function(){this._unregisterListeners();for(var g in this.loaders){var c=this.loaders[g];c&&c.destroy()}this.loaders={}},e.onKeyLoading=function(g,c){var l=c.frag,n=l.type,a=this.loaders[n];if(!l.decryptdata){R.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var o=l.decryptdata.uri;if(o!==this.decrypturl||this.decryptkey===null){var s=this.hls.config;if(a&&(R.logger.warn("abort previous key loader for type:"+n),a.abort()),!o){R.logger.warn("key uri is falsy");return}var r=s.loader,i=l.loader=this.loaders[n]=new r(s);this.decrypturl=o,this.decryptkey=null;var t={url:o,frag:l,responseType:"arraybuffer"},y={timeout:s.fragLoadingTimeOut,maxRetry:0,retryDelay:s.fragLoadingRetryDelay,maxRetryDelay:s.fragLoadingMaxRetryTimeout,highWaterMark:0},p={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};i.load(t,y,p)}else this.decryptkey&&(l.decryptdata.key=this.decryptkey,this.hls.trigger(j.Events.KEY_LOADED,{frag:l}))},e.loadsuccess=function(g,c,l){var n=l.frag;if(!n.decryptdata){R.logger.error("after key load, decryptdata unset");return}this.decryptkey=n.decryptdata.key=new Uint8Array(g.data),n.loader=null,delete this.loaders[n.type],this.hls.trigger(j.Events.KEY_LOADED,{frag:n})},e.loaderror=function(g,c){var l=c.frag,n=l.loader;n&&n.abort(),delete this.loaders[l.type],this.hls.trigger(j.Events.ERROR,{type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:l,response:g})},e.loadtimeout=function(g,c){var l=c.frag,n=l.loader;n&&n.abort(),delete this.loaders[l.type],this.hls.trigger(j.Events.ERROR,{type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:l})},k}()},"./src/loader/level-details.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"LevelDetails",function(){return k});var j=C("./src/polyfills/number.ts");function L(e,A){for(var g=0;g<A.length;g++){var c=A[g];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(e,c.key,c)}}function R(e,A,g){return A&&L(e.prototype,A),g&&L(e,g),e}var B=10,k=function(){function e(g){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.needSidxRanges=!1,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.fragments=[],this.url=g}var A=e.prototype;return A.reloaded=function(c){if(!c){this.advanced=!0,this.updated=!0;return}var l=this.lastPartSn-c.lastPartSn,n=this.lastPartIndex-c.lastPartIndex;this.updated=this.endSN!==c.endSN||!!n||!!l,this.advanced=this.endSN>c.endSN||l>0||l===0&&n>0,this.updated||this.advanced?this.misses=Math.floor(c.misses*.6):this.misses=c.misses+1,this.availabilityDelay=c.availabilityDelay},R(e,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(j.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||B}},{key:"drift",get:function(){var c=this.driftEndTime-this.driftStartTime;if(c>0){var l=this.driftEnd-this.driftStart;return l*1e3/c}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var c;return(c=this.partList)!==null&&c!==void 0&&c.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var c;return(c=this.fragments)!==null&&c!==void 0&&c.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 c;return(c=this.partList)!==null&&c!==void 0&&c.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var c;return(c=this.partList)!==null&&c!==void 0&&c.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),e}()},"./src/loader/level-key.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"LevelKey",function(){return k});var j=C("./node_modules/url-toolkit/src/url-toolkit.js"),L=C.n(j);function R(e,A){for(var g=0;g<A.length;g++){var c=A[g];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(e,c.key,c)}}function B(e,A,g){return A&&R(e.prototype,A),g&&R(e,g),e}var k=function(){e.fromURL=function(g,c){return new e(g,c)},e.fromURI=function(g){return new e(g)};function e(A,g){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,g?this._uri=Object(j.buildAbsoluteURL)(A,g,{alwaysNormalize:!0}):this._uri=A}return B(e,[{key:"uri",get:function(){return this._uri}}]),e}()},"./src/loader/load-stats.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"LoadStats",function(){return j});var j=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(te,H,C){"use strict";C.r(H),C.d(H,"default",function(){return i});var j=C("./src/polyfills/number.ts"),L=C("./node_modules/url-toolkit/src/url-toolkit.js"),R=C.n(L),B=C("./src/loader/fragment.ts"),k=C("./src/loader/level-details.ts"),e=C("./src/loader/level-key.ts"),A=C("./src/utils/attr-list.ts"),g=C("./src/utils/logger.ts"),c=C("./src/utils/codecs.ts"),l=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,n=/#EXT-X-MEDIA:(.*)/g,a=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),o=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("|")),s=/\.(mp4|m4s|m4v|m4a)$/i;function r(E){var _,h;return s.test((_=(h=L.parseURL(E))===null||h===void 0?void 0:h.path)!=null?_:"")}var i=function(){function E(){}return E.findGroup=function(h,u){for(var d=0;d<h.length;d++){var f=h[d];if(f.id===u)return f}},E.convertAVC1ToAVCOTI=function(h){var u=h.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 h},E.resolve=function(h,u){return L.buildAbsoluteURL(u,h,{alwaysNormalize:!0})},E.parseMasterPlaylist=function(h,u){var d=[],f={},T=!1;l.lastIndex=0;for(var b;(b=l.exec(h))!=null;)if(b[1]){var S=new A.AttrList(b[1]),D={attrs:S,bitrate:S.decimalInteger("AVERAGE-BANDWIDTH")||S.decimalInteger("BANDWIDTH"),name:S.NAME,url:E.resolve(b[2],u)},I=S.decimalResolution("RESOLUTION");I&&(D.width=I.width,D.height=I.height),t((S.CODECS||"").split(/[ ,]+/).filter(function(P){return P}),D),D.videoCodec&&D.videoCodec.indexOf("avc1")!==-1&&(D.videoCodec=E.convertAVC1ToAVCOTI(D.videoCodec)),d.push(D)}else if(b[3]){var w=new A.AttrList(b[3]);w["DATA-ID"]&&(T=!0,f[w["DATA-ID"]]=w)}return{levels:d,sessionData:T?f:null}},E.parseMasterPlaylistMedia=function(h,u,d,f){f===void 0&&(f=[]);var T,b=[],S=0;for(n.lastIndex=0;(T=n.exec(h))!==null;){var D=new A.AttrList(T[1]);if(D.TYPE===d){var I={attrs:D,bitrate:0,id:S++,groupId:D["GROUP-ID"],instreamId:D["INSTREAM-ID"],name:D.NAME||D.LANGUAGE||"",type:d,default:D.bool("DEFAULT"),autoselect:D.bool("AUTOSELECT"),forced:D.bool("FORCED"),lang:D.LANGUAGE,url:D.URI?E.resolve(D.URI,u):""};if(f.length){var w=E.findGroup(f,I.groupId)||f[0];y(I,w,"audioCodec"),y(I,w,"textCodec")}b.push(I)}}return b},E.parseLevelPlaylist=function(h,u,d,f,T){var b=new k.LevelDetails(u),S=b.fragments,D=null,I=0,w=0,P=0,U=0,O=null,G=new B.Fragment(f,u),z,ae,ie,fe=-1,ce=!1;for(a.lastIndex=0,b.m3u8=h;(z=a.exec(h))!==null;){ce&&(ce=!1,G=new B.Fragment(f,u),G.start=P,G.sn=I,G.cc=U,G.level=d,D&&(G.initSegment=D,G.rawProgramDateTime=D.rawProgramDateTime));var J=z[1];if(J){G.duration=parseFloat(J);var Z=(" "+z[2]).slice(1);G.title=Z||null,G.tagList.push(Z?["INF",J,Z]:["INF",J])}else if(z[3])Object(j.isFiniteNumber)(G.duration)&&(G.start=P,ie&&(G.levelkey=ie),G.sn=I,G.level=d,G.cc=U,G.urlId=T,S.push(G),G.relurl=(" "+z[3]).slice(1),m(G,O),O=G,P+=G.duration,I++,w=0,ce=!0);else if(z[4]){var ue=(" "+z[4]).slice(1);O?G.setByteRange(ue,O):G.setByteRange(ue)}else if(z[5])G.rawProgramDateTime=(" "+z[5]).slice(1),G.tagList.push(["PROGRAM-DATE-TIME",G.rawProgramDateTime]),fe===-1&&(fe=S.length);else{if(z=z[0].match(o),!z){g.logger.warn("No matches on slow regex match for level playlist!");continue}for(ae=1;ae<z.length&&!(typeof z[ae]!="undefined");ae++);var X=(" "+z[ae]).slice(1),$=(" "+z[ae+1]).slice(1),be=z[ae+2]?(" "+z[ae+2]).slice(1):"";switch(X){case"PLAYLIST-TYPE":b.type=$.toUpperCase();break;case"MEDIA-SEQUENCE":I=b.startSN=parseInt($);break;case"SKIP":{var Re=new A.AttrList($),Ie=Re.decimalInteger("SKIPPED-SEGMENTS");if(Object(j.isFiniteNumber)(Ie)){b.skippedSegments=Ie;for(var Le=Ie;Le--;)S.unshift(null);I+=Ie}var Fe=Re.enumeratedString("RECENTLY-REMOVED-DATERANGES");Fe&&(b.recentlyRemovedDateranges=Fe.split(" "));break}case"TARGETDURATION":b.targetduration=parseFloat($);break;case"VERSION":b.version=parseInt($);break;case"EXTM3U":break;case"ENDLIST":b.live=!1;break;case"#":($||be)&&G.tagList.push(be?[$,be]:[$]);break;case"DIS":U++;case"GAP":G.tagList.push([X]);break;case"BITRATE":G.tagList.push([X,$]);break;case"DISCONTINUITY-SEQ":U=parseInt($);break;case"KEY":{var ye,Te=new A.AttrList($),Ae=Te.enumeratedString("METHOD"),Y=Te.URI,se=Te.hexadecimalInteger("IV"),pe=Te.enumeratedString("KEYFORMATVERSIONS"),ve=Te.enumeratedString("KEYID"),Me=(ye=Te.enumeratedString("KEYFORMAT"))!=null?ye:"identity",he=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(he.indexOf(Me)>-1){g.logger.warn("Keyformat "+Me+" is not supported from the manifest");continue}else if(Me!=="identity")continue;Ae&&(ie=e.LevelKey.fromURL(u,Y),Y&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Ae)>=0&&(ie.method=Ae,ie.keyFormat=Me,ve&&(ie.keyID=ve),pe&&(ie.keyFormatVersions=pe),ie.iv=se));break}case"START":{var me=new A.AttrList($),_e=me.decimalFloatingPoint("TIME-OFFSET");Object(j.isFiniteNumber)(_e)&&(b.startTimeOffset=_e);break}case"MAP":{var Se=new A.AttrList($);G.relurl=Se.URI,Se.BYTERANGE&&G.setByteRange(Se.BYTERANGE),G.level=d,G.sn="initSegment",ie&&(G.levelkey=ie),G.initSegment=null,D=G,ce=!0;break}case"SERVER-CONTROL":{var Ce=new A.AttrList($);b.canBlockReload=Ce.bool("CAN-BLOCK-RELOAD"),b.canSkipUntil=Ce.optionalFloat("CAN-SKIP-UNTIL",0),b.canSkipDateRanges=b.canSkipUntil>0&&Ce.bool("CAN-SKIP-DATERANGES"),b.partHoldBack=Ce.optionalFloat("PART-HOLD-BACK",0),b.holdBack=Ce.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Oe=new A.AttrList($);b.partTarget=Oe.decimalFloatingPoint("PART-TARGET");break}case"PART":{var xe=b.partList;xe||(xe=b.partList=[]);var Ue=w>0?xe[xe.length-1]:void 0,Be=w++,Ee=new B.Part(new A.AttrList($),G,u,Be,Ue);xe.push(Ee),G.duration+=Ee.duration;break}case"PRELOAD-HINT":{var De=new A.AttrList($);b.preloadHint=De;break}case"RENDITION-REPORT":{var de=new A.AttrList($);b.renditionReports=b.renditionReports||[],b.renditionReports.push(de);break}default:g.logger.warn("line parsed but not handled: "+z);break}}}O&&!O.relurl?(S.pop(),P-=O.duration,b.partList&&(b.fragmentHint=O)):b.partList&&(m(G,O),G.cc=U,b.fragmentHint=G);var re=S.length,oe=S[0],V=S[re-1];if(P+=b.skippedSegments*b.targetduration,P>0&&re&&V){b.averagetargetduration=P/re;var Q=V.sn;b.endSN=Q!=="initSegment"?Q:0,oe&&(b.startCC=oe.cc,oe.initSegment||b.fragments.every(function(q){return q.relurl&&r(q.relurl)})&&(g.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),G=new B.Fragment(f,u),G.relurl=V.relurl,G.level=d,G.sn="initSegment",oe.initSegment=G,b.needSidxRanges=!0))}else b.endSN=0,b.startCC=0;return b.fragmentHint&&(P+=b.fragmentHint.duration),b.totalduration=P,b.endCC=U,fe>0&&p(S,fe),b},E}();function t(E,_){["video","audio","text"].forEach(function(h){var u=E.filter(function(f){return Object(c.isCodecType)(f,h)});if(u.length){var d=u.filter(function(f){return f.lastIndexOf("avc1",0)===0||f.lastIndexOf("mp4a",0)===0});_[h+"Codec"]=d.length>0?d[0]:u[0],E=E.filter(function(f){return u.indexOf(f)===-1})}}),_.unknownCodecs=E}function y(E,_,h){var u=_[h];u&&(E[h]=u)}function p(E,_){for(var h=E[_],u=_;u--;){var d=E[u];if(!d)return;d.programDateTime=h.programDateTime-d.duration*1e3,h=d}}function m(E,_){E.rawProgramDateTime?E.programDateTime=Date.parse(E.rawProgramDateTime):_!=null&&_.programDateTime&&(E.programDateTime=_.endProgramDateTime),Object(j.isFiniteNumber)(E.programDateTime)||(E.programDateTime=null,E.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(te,H,C){"use strict";C.r(H);var j=C("./src/polyfills/number.ts"),L=C("./src/events.ts"),R=C("./src/errors.ts"),B=C("./src/utils/logger.ts"),k=C("./src/utils/mp4-tools.ts"),e=C("./src/loader/m3u8-parser.ts"),A=C("./src/types/loader.ts"),g=C("./src/utils/attr-list.ts");function c(a){var o=a.type;switch(o){case A.PlaylistContextType.AUDIO_TRACK:return A.PlaylistLevelType.AUDIO;case A.PlaylistContextType.SUBTITLE_TRACK:return A.PlaylistLevelType.SUBTITLE;default:return A.PlaylistLevelType.MAIN}}function l(a,o){var s=a.url;return(s===void 0||s.indexOf("data:")===0)&&(s=o.url),s}var n=function(){function a(s){this.hls=void 0,this.loaders=Object.create(null),this.hls=s,this.registerListeners()}var o=a.prototype;return o.registerListeners=function(){var r=this.hls;r.on(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.on(L.Events.LEVEL_LOADING,this.onLevelLoading,this),r.on(L.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),r.on(L.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},o.unregisterListeners=function(){var r=this.hls;r.off(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.off(L.Events.LEVEL_LOADING,this.onLevelLoading,this),r.off(L.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),r.off(L.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},o.createInternalLoader=function(r){var i=this.hls.config,t=i.pLoader,y=i.loader,p=t||y,m=new p(i);return r.loader=m,this.loaders[r.type]=m,m},o.getInternalLoader=function(r){return this.loaders[r.type]},o.resetInternalLoader=function(r){this.loaders[r]&&delete this.loaders[r]},o.destroyInternalLoaders=function(){for(var r in this.loaders){var i=this.loaders[r];i&&i.destroy(),this.resetInternalLoader(r)}},o.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},o.onManifestLoading=function(r,i){var t=i.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:A.PlaylistContextType.MANIFEST,url:t,deliveryDirectives:null})},o.onLevelLoading=function(r,i){var t=i.id,y=i.level,p=i.url,m=i.deliveryDirectives;this.load({id:t,groupId:null,level:y,responseType:"text",type:A.PlaylistContextType.LEVEL,url:p,deliveryDirectives:m})},o.onAudioTrackLoading=function(r,i){var t=i.id,y=i.groupId,p=i.url,m=i.deliveryDirectives;this.load({id:t,groupId:y,level:null,responseType:"text",type:A.PlaylistContextType.AUDIO_TRACK,url:p,deliveryDirectives:m})},o.onSubtitleTrackLoading=function(r,i){var t=i.id,y=i.groupId,p=i.url,m=i.deliveryDirectives;this.load({id:t,groupId:y,level:null,responseType:"text",type:A.PlaylistContextType.SUBTITLE_TRACK,url:p,deliveryDirectives:m})},o.load=function(r){var i,t=this.hls.config,y=this.getInternalLoader(r);if(y){var p=y.context;if(p&&p.url===r.url){B.logger.trace("[playlist-loader]: playlist request ongoing");return}B.logger.log("[playlist-loader]: aborting previous loader for type: "+r.type),y.abort()}var m,E,_,h;switch(r.type){case A.PlaylistContextType.MANIFEST:m=t.manifestLoadingMaxRetry,E=t.manifestLoadingTimeOut,_=t.manifestLoadingRetryDelay,h=t.manifestLoadingMaxRetryTimeout;break;case A.PlaylistContextType.LEVEL:case A.PlaylistContextType.AUDIO_TRACK:case A.PlaylistContextType.SUBTITLE_TRACK:m=0,E=t.levelLoadingTimeOut;break;default:m=t.levelLoadingMaxRetry,E=t.levelLoadingTimeOut,_=t.levelLoadingRetryDelay,h=t.levelLoadingMaxRetryTimeout;break}if(y=this.createInternalLoader(r),(i=r.deliveryDirectives)!==null&&i!==void 0&&i.part){var u;if(r.type===A.PlaylistContextType.LEVEL&&r.level!==null?u=this.hls.levels[r.level].details:r.type===A.PlaylistContextType.AUDIO_TRACK&&r.id!==null?u=this.hls.audioTracks[r.id].details:r.type===A.PlaylistContextType.SUBTITLE_TRACK&&r.id!==null&&(u=this.hls.subtitleTracks[r.id].details),u){var d=u.partTarget,f=u.targetduration;d&&f&&(E=Math.min(Math.max(d*3,f*.8)*1e3,E))}}var T={timeout:E,maxRetry:m,retryDelay:_,maxRetryDelay:h,highWaterMark:0},b={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};y.load(r,T,b)},o.loadsuccess=function(r,i,t,y){if(y===void 0&&(y=null),t.isSidxRequest){this.handleSidxRequest(r,t),this.handlePlaylistLoaded(r,i,t,y);return}this.resetInternalLoader(t.type);var p=r.data;if(p.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(r,t,"no EXTM3U delimiter",y);return}i.parsing.start=performance.now(),p.indexOf("#EXTINF:")>0||p.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(r,i,t,y):this.handleMasterPlaylist(r,i,t,y)},o.loaderror=function(r,i,t){t===void 0&&(t=null),this.handleNetworkError(i,t,!1,r)},o.loadtimeout=function(r,i,t){t===void 0&&(t=null),this.handleNetworkError(i,t,!0)},o.handleMasterPlaylist=function(r,i,t,y){var p=this.hls,m=r.data,E=l(r,t),_=e.default.parseMasterPlaylist(m,E),h=_.levels,u=_.sessionData;if(!h.length){this.handleManifestParsingError(r,t,"no level found in manifest",y);return}var d=h.map(function(I){return{id:I.attrs.AUDIO,audioCodec:I.audioCodec}}),f=h.map(function(I){return{id:I.attrs.SUBTITLES,textCodec:I.textCodec}}),T=e.default.parseMasterPlaylistMedia(m,E,"AUDIO",d),b=e.default.parseMasterPlaylistMedia(m,E,"SUBTITLES",f),S=e.default.parseMasterPlaylistMedia(m,E,"CLOSED-CAPTIONS");if(T.length){var D=T.some(function(I){return!I.url});!D&&h[0].audioCodec&&!h[0].attrs.AUDIO&&(B.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),T.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new g.AttrList({}),bitrate:0,url:""}))}p.trigger(L.Events.MANIFEST_LOADED,{levels:h,audioTracks:T,subtitles:b,captions:S,url:E,stats:i,networkDetails:y,sessionData:u})},o.handleTrackOrLevelPlaylist=function(r,i,t,y){var p=this.hls,m=t.id,E=t.level,_=t.type,h=l(r,t),u=Object(j.isFiniteNumber)(m)?m:0,d=Object(j.isFiniteNumber)(E)?E:u,f=c(t),T=e.default.parseLevelPlaylist(r.data,h,d,f,u);if(!T.fragments.length){p.trigger(L.Events.ERROR,{type:R.ErrorTypes.NETWORK_ERROR,details:R.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:h,reason:"no fragments found in level",level:typeof t.level=="number"?t.level:void 0});return}if(_===A.PlaylistContextType.MANIFEST){var b={attrs:new g.AttrList({}),bitrate:0,details:T,name:"",url:h};p.trigger(L.Events.MANIFEST_LOADED,{levels:[b],audioTracks:[],url:h,stats:i,networkDetails:y,sessionData:null})}if(i.parsing.end=performance.now(),T.needSidxRanges){var S,D=(S=T.fragments[0].initSegment)===null||S===void 0?void 0:S.url;this.load({url:D,isSidxRequest:!0,type:_,level:E,levelDetails:T,id:m,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}t.levelDetails=T,this.handlePlaylistLoaded(r,i,t,y)},o.handleSidxRequest=function(r,i){var t=Object(k.parseSegmentIndex)(new Uint8Array(r.data));if(!t)return;var y=t.references,p=i.levelDetails;y.forEach(function(m,E){var _=m.info,h=p.fragments[E];h.byteRange.length===0&&h.setByteRange(String(1+_.end-_.start)+"@"+String(_.start)),h.initSegment&&h.initSegment.setByteRange(String(t.moovEndOffset)+"@0")})},o.handleManifestParsingError=function(r,i,t,y){this.hls.trigger(L.Events.ERROR,{type:R.ErrorTypes.NETWORK_ERROR,details:R.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:i.type===A.PlaylistContextType.MANIFEST,url:r.url,reason:t,response:r,context:i,networkDetails:y})},o.handleNetworkError=function(r,i,t,y){t===void 0&&(t=!1),B.logger.warn("[playlist-loader]: A network "+(t?"timeout":"error")+" occurred while loading "+r.type+" level: "+r.level+" id: "+r.id+' group-id: "'+r.groupId+'"');var p=R.ErrorDetails.UNKNOWN,m=!1,E=this.getInternalLoader(r);switch(r.type){case A.PlaylistContextType.MANIFEST:p=t?R.ErrorDetails.MANIFEST_LOAD_TIMEOUT:R.ErrorDetails.MANIFEST_LOAD_ERROR,m=!0;break;case A.PlaylistContextType.LEVEL:p=t?R.ErrorDetails.LEVEL_LOAD_TIMEOUT:R.ErrorDetails.LEVEL_LOAD_ERROR,m=!1;break;case A.PlaylistContextType.AUDIO_TRACK:p=t?R.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:R.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,m=!1;break;case A.PlaylistContextType.SUBTITLE_TRACK:p=t?R.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:R.ErrorDetails.SUBTITLE_LOAD_ERROR,m=!1;break}E&&this.resetInternalLoader(r.type);var _={type:R.ErrorTypes.NETWORK_ERROR,details:p,fatal:m,url:r.url,loader:E,context:r,networkDetails:i};y&&(_.response=y),this.hls.trigger(L.Events.ERROR,_)},o.handlePlaylistLoaded=function(r,i,t,y){var p=t.type,m=t.level,E=t.id,_=t.groupId,h=t.loader,u=t.levelDetails,d=t.deliveryDirectives;if(!(u!=null&&u.targetduration)){this.handleManifestParsingError(r,t,"invalid target duration",y);return}if(!h)return;u.live&&(h.getCacheAge&&(u.ageHeader=h.getCacheAge()||0),(!h.getCacheAge||isNaN(u.ageHeader))&&(u.ageHeader=0));switch(p){case A.PlaylistContextType.MANIFEST:case A.PlaylistContextType.LEVEL:this.hls.trigger(L.Events.LEVEL_LOADED,{details:u,level:m||0,id:E||0,stats:i,networkDetails:y,deliveryDirectives:d});break;case A.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(L.Events.AUDIO_TRACK_LOADED,{details:u,id:E||0,groupId:_||"",stats:i,networkDetails:y,deliveryDirectives:d});break;case A.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(L.Events.SUBTITLE_TRACK_LOADED,{details:u,id:E||0,groupId:_||"",stats:i,networkDetails:y,deliveryDirectives:d});break}},a}();H.default=n},"./src/polyfills/number.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"isFiniteNumber",function(){return j}),C.d(H,"MAX_SAFE_INTEGER",function(){return L});var j=Number.isFinite||function(R){return typeof R=="number"&&isFinite(R)},L=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(te,H,C){"use strict";C.r(H);var j=function(){function L(){}return L.getSilentFrame=function(B,k){switch(B){case"mp4a.40.2":if(k===1)return new Uint8Array([0,200,0,128,35,128]);if(k===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(k===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(k===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(k===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(k===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(k===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(k===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(k===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},L}();H.default=j},"./src/remux/mp4-generator.ts":function(te,H,C){"use strict";C.r(H);var j=Math.pow(2,32)-1,L=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 k;for(k in R.types)R.types.hasOwnProperty(k)&&(R.types[k]=[k.charCodeAt(0),k.charCodeAt(1),k.charCodeAt(2),k.charCodeAt(3)]);var e=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]),A=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:e,audio:A};var g=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),c=new Uint8Array([0,0,0,0,0,0,0,0]);R.STTS=R.STSC=R.STCO=c,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 l=new Uint8Array([105,115,111,109]),n=new Uint8Array([97,118,99,49]),a=new Uint8Array([0,0,0,1]);R.FTYP=R.box(R.types.ftyp,l,a,l,n),R.DINF=R.box(R.types.dinf,R.box(R.types.dref,g))},R.box=function(k){for(var e=8,A=arguments.length,g=new Array(A>1?A-1:0),c=1;c<A;c++)g[c-1]=arguments[c];for(var l=g.length,n=l;l--;)e+=g[l].byteLength;var a=new Uint8Array(e);for(a[0]=e>>24&255,a[1]=e>>16&255,a[2]=e>>8&255,a[3]=e&255,a.set(k,4),l=0,e=8;l<n;l++)a.set(g[l],e),e+=g[l].byteLength;return a},R.hdlr=function(k){return R.box(R.types.hdlr,R.HDLR_TYPES[k])},R.mdat=function(k){return R.box(R.types.mdat,k)},R.mdhd=function(k,e){e*=k;var A=Math.floor(e/(j+1)),g=Math.floor(e%(j+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,k>>24&255,k>>16&255,k>>8&255,k&255,A>>24,A>>16&255,A>>8&255,A&255,g>>24,g>>16&255,g>>8&255,g&255,85,196,0,0]))},R.mdia=function(k){return R.box(R.types.mdia,R.mdhd(k.timescale,k.duration),R.hdlr(k.type),R.minf(k))},R.mfhd=function(k){return R.box(R.types.mfhd,new Uint8Array([0,0,0,0,k>>24,k>>16&255,k>>8&255,k&255]))},R.minf=function(k){return k.type==="audio"?R.box(R.types.minf,R.box(R.types.smhd,R.SMHD),R.DINF,R.stbl(k)):R.box(R.types.minf,R.box(R.types.vmhd,R.VMHD),R.DINF,R.stbl(k))},R.moof=function(k,e,A){return R.box(R.types.moof,R.mfhd(k),R.traf(A,e))},R.moov=function(k){for(var e=k.length,A=[];e--;)A[e]=R.trak(k[e]);return R.box.apply(null,[R.types.moov,R.mvhd(k[0].timescale,k[0].duration)].concat(A).concat(R.mvex(k)))},R.mvex=function(k){for(var e=k.length,A=[];e--;)A[e]=R.trex(k[e]);return R.box.apply(null,[R.types.mvex].concat(A))},R.mvhd=function(k,e){e*=k;var A=Math.floor(e/(j+1)),g=Math.floor(e%(j+1)),c=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,k>>24&255,k>>16&255,k>>8&255,k&255,A>>24,A>>16&255,A>>8&255,A&255,g>>24,g>>16&255,g>>8&255,g&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return R.box(R.types.mvhd,c)},R.sdtp=function(k){var e=k.samples||[],A=new Uint8Array(4+e.length),g,c;for(g=0;g<e.length;g++)c=e[g].flags,A[g+4]=c.dependsOn<<4|c.isDependedOn<<2|c.hasRedundancy;return R.box(R.types.sdtp,A)},R.stbl=function(k){return R.box(R.types.stbl,R.stsd(k),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(k){var e=[],A=[],g,c,l;for(g=0;g<k.sps.length;g++)c=k.sps[g],l=c.byteLength,e.push(l>>>8&255),e.push(l&255),e=e.concat(Array.prototype.slice.call(c));for(g=0;g<k.pps.length;g++)c=k.pps[g],l=c.byteLength,A.push(l>>>8&255),A.push(l&255),A=A.concat(Array.prototype.slice.call(c));var n=R.box(R.types.avcC,new Uint8Array([1,e[3],e[4],e[5],252|3,224|k.sps.length].concat(e).concat([k.pps.length]).concat(A))),a=k.width,o=k.height,s=k.pixelRatio[0],r=k.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,a>>8&255,a&255,o>>8&255,o&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]),n,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([s>>24,s>>16&255,s>>8&255,s&255,r>>24,r>>16&255,r>>8&255,r&255])))},R.esds=function(k){var e=k.config.length;return new Uint8Array([0,0,0,0,3,23+e,0,1,0,4,15+e,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([e]).concat(k.config).concat([6,1,2]))},R.mp4a=function(k){var e=k.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,k.channelCount,0,16,0,0,0,0,e>>8&255,e&255,0,0]),R.box(R.types.esds,R.esds(k)))},R.mp3=function(k){var e=k.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,k.channelCount,0,16,0,0,0,0,e>>8&255,e&255,0,0]))},R.stsd=function(k){return k.type==="audio"?!k.isAAC&&k.codec==="mp3"?R.box(R.types.stsd,R.STSD,R.mp3(k)):R.box(R.types.stsd,R.STSD,R.mp4a(k)):R.box(R.types.stsd,R.STSD,R.avc1(k))},R.tkhd=function(k){var e=k.id,A=k.duration*k.timescale,g=k.width,c=k.height,l=Math.floor(A/(j+1)),n=Math.floor(A%(j+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,e>>24&255,e>>16&255,e>>8&255,e&255,0,0,0,0,l>>24,l>>16&255,l>>8&255,l&255,n>>24,n>>16&255,n>>8&255,n&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,g>>8&255,g&255,0,0,c>>8&255,c&255,0,0]))},R.traf=function(k,e){var A=R.sdtp(k),g=k.id,c=Math.floor(e/(j+1)),l=Math.floor(e%(j+1));return R.box(R.types.traf,R.box(R.types.tfhd,new Uint8Array([0,0,0,0,g>>24,g>>16&255,g>>8&255,g&255])),R.box(R.types.tfdt,new Uint8Array([1,0,0,0,c>>24,c>>16&255,c>>8&255,c&255,l>>24,l>>16&255,l>>8&255,l&255])),R.trun(k,A.length+16+20+8+16+8+8),A)},R.trak=function(k){return k.duration=k.duration||4294967295,R.box(R.types.trak,R.tkhd(k),R.mdia(k))},R.trex=function(k){var e=k.id;return R.box(R.types.trex,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,e&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},R.trun=function(k,e){var A=k.samples||[],g=A.length,c=12+16*g,l=new Uint8Array(c),n,a,o,s,r,i;for(e+=8+c,l.set([0,0,15,1,g>>>24&255,g>>>16&255,g>>>8&255,g&255,e>>>24&255,e>>>16&255,e>>>8&255,e&255],0),n=0;n<g;n++)a=A[n],o=a.duration,s=a.size,r=a.flags,i=a.cts,l.set([o>>>24&255,o>>>16&255,o>>>8&255,o&255,s>>>24&255,s>>>16&255,s>>>8&255,s&255,r.isLeading<<2|r.dependsOn,r.isDependedOn<<6|r.hasRedundancy<<4|r.paddingValue<<1|r.isNonSync,r.degradPrio&240<<8,r.degradPrio&15,i>>>24&255,i>>>16&255,i>>>8&255,i&255],12+16*n);return R.box(R.types.trun,l)},R.initSegment=function(k){R.types||R.init();var e=R.moov(k),A=new Uint8Array(R.FTYP.byteLength+e.byteLength);return A.set(R.FTYP),A.set(e,R.FTYP.byteLength),A},R}();L.types=void 0,L.HDLR_TYPES=void 0,L.STTS=void 0,L.STSC=void 0,L.STCO=void 0,L.STSZ=void 0,L.VMHD=void 0,L.SMHD=void 0,L.STSD=void 0,L.FTYP=void 0,L.DINF=void 0,H.default=L},"./src/remux/mp4-remuxer.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"default",function(){return i}),C.d(H,"normalizePts",function(){return t});var j=C("./src/polyfills/number.ts"),L=C("./src/remux/aac-helper.ts"),R=C("./src/remux/mp4-generator.ts"),B=C("./src/events.ts"),k=C("./src/errors.ts"),e=C("./src/utils/logger.ts"),A=C("./src/types/loader.ts"),g=C("./src/utils/timescale-conversion.ts");function c(){return c=Object.assign||function(E){for(var _=1;_<arguments.length;_++){var h=arguments[_];for(var u in h)Object.prototype.hasOwnProperty.call(h,u)&&(E[u]=h[u])}return E},c.apply(this,arguments)}var l=10*1e3,n=1024,a=1152,o=null,s=null,r=!1,i=function(){function E(h,u,d,f){if(f===void 0&&(f=""),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=void 0,this._initDTS=void 0,this.nextAvcDts=null,this.nextAudioPts=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=h,this.config=u,this.typeSupported=d,this.ISGenerated=!1,o===null){var T=navigator.userAgent||"",b=T.match(/Chrome\/(\d+)/i);o=b?parseInt(b[1]):0}if(s===null){var S=navigator.userAgent.match(/Safari\/(\d+)/i);s=S?parseInt(S[1]):0}r=!!o&&o<75||!!s&&s<600}var _=E.prototype;return _.destroy=function(){},_.resetTimeStamp=function(u){e.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=u},_.resetNextTimestamp=function(){e.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},_.resetInitSegment=function(){e.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},_.getVideoStartPts=function(u){var d=!1,f=u.reduce(function(T,b){var S=b.pts-T;return S<-4294967296?(d=!0,t(T,b.pts)):S>0?T:b.pts},u[0].pts);return d&&e.logger.debug("PTS rollover detected"),f},_.remux=function(u,d,f,T,b,S,D,I){var w,P,U,O,G,z,ae=b,ie=b,fe=u.pid>-1,ce=d.pid>-1,J=d.samples.length,Z=u.samples.length>0,ue=J>1,X=(!fe||Z)&&(!ce||ue)||this.ISGenerated||D;if(X){this.ISGenerated||(U=this.generateIS(u,d,b));var $=this.isVideoContiguous,be=-1;if(ue&&(be=y(d.samples),!$&&this.config.forceKeyFrameOnDiscontinuity))if(z=!0,be>0){e.logger.warn("[mp4-remuxer]: Dropped "+be+" out of "+J+" video samples due to a missing keyframe");var Re=this.getVideoStartPts(d.samples);d.samples=d.samples.slice(be),d.dropped+=be,ie+=(d.samples[0].pts-Re)/(d.timescale||9e4)}else be===-1&&(e.logger.warn("[mp4-remuxer]: No keyframe found out of "+J+" video samples"),z=!1);if(this.ISGenerated){if(Z&&ue){var Ie=this.getVideoStartPts(d.samples),Le=t(u.samples[0].pts,Ie)-Ie,Fe=Le/d.inputTimeScale;ae+=Math.max(0,Fe),ie+=Math.max(0,-Fe)}if(Z){if(u.samplerate||(e.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),U=this.generateIS(u,d,b)),P=this.remuxAudio(u,ae,this.isAudioContiguous,S,ce||ue||I===A.PlaylistLevelType.AUDIO?ie:void 0),ue){var ye=P?P.endPTS-P.startPTS:0;d.inputTimeScale||(e.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),U=this.generateIS(u,d,b)),w=this.remuxVideo(d,ie,$,ye)}}else ue&&(w=this.remuxVideo(d,ie,$,0));w&&(w.firstKeyFrame=be,w.independent=be!==-1)}}return this.ISGenerated&&(f.samples.length&&(G=this.remuxID3(f,b)),T.samples.length&&(O=this.remuxText(T,b))),{audio:P,video:w,initSegment:U,independent:z,text:O,id3:G}},_.generateIS=function(u,d,f){var T=u.samples,b=d.samples,S=this.typeSupported,D={},I=!Object(j.isFiniteNumber)(this._initPTS),w="audio/mp4",P,U,O;if(I&&(P=U=Infinity),u.config&&T.length&&(u.timescale=u.samplerate,u.isAAC||(S.mpeg?(w="audio/mpeg",u.codec=""):S.mp3&&(u.codec="mp3")),D.audio={id:"audio",container:w,codec:u.codec,initSegment:!u.isAAC&&S.mpeg?new Uint8Array(0):R.default.initSegment([u]),metadata:{channelCount:u.channelCount}},I&&(O=u.inputTimeScale,P=U=T[0].pts-Math.round(O*f))),d.sps&&d.pps&&b.length&&(d.timescale=d.inputTimeScale,D.video={id:"main",container:"video/mp4",codec:d.codec,initSegment:R.default.initSegment([d]),metadata:{width:d.width,height:d.height}},I)){O=d.inputTimeScale;var G=this.getVideoStartPts(b),z=Math.round(O*f);U=Math.min(U,t(b[0].dts,G)-z),P=Math.min(P,G-z)}if(Object.keys(D).length)return this.ISGenerated=!0,I&&(this._initPTS=P,this._initDTS=U),{tracks:D,initPTS:P,timescale:O}},_.remuxVideo=function(u,d,f,T){var b=u.inputTimeScale,S=u.samples,D=[],I=S.length,w=this._initPTS,P=this.nextAvcDts,U=8,O,G,z,ae=Number.POSITIVE_INFINITY,ie=Number.NEGATIVE_INFINITY,fe=0,ce=!1;if(!f||P===null){var J=d*b,Z=S[0].pts-t(S[0].dts,S[0].pts);P=J-Z}for(var ue=0;ue<I;ue++){var X=S[ue];if(X.pts=t(X.pts-w,P),X.dts=t(X.dts-w,P),X.dts>X.pts){var $=9e4*.2;fe=Math.max(Math.min(fe,X.pts-X.dts),-1*$)}X.dts<S[ue>0?ue-1:ue].dts&&(ce=!0)}ce&&S.sort(function(qe,nt){var $e=qe.dts-nt.dts,gt=qe.pts-nt.pts;return $e||gt}),G=S[0].dts,z=S[S.length-1].dts;var be=Math.round((z-G)/(I-1));if(fe<0){if(fe<be*-2){e.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(g.toMsFromMpegTsClock)(-be,!0)+" ms");for(var Re=fe,Ie=0;Ie<I;Ie++)S[Ie].dts=Re=Math.max(Re,S[Ie].pts-be),S[Ie].pts=Math.max(Re,S[Ie].pts)}else{e.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(g.toMsFromMpegTsClock)(fe,!0)+" ms to overcome this issue");for(var Le=0;Le<I;Le++)S[Le].dts=S[Le].dts+fe}G=S[0].dts}if(f){var Fe=G-P,ye=Fe>be,Te=Fe<-1;if(ye||Te){ye?e.logger.warn("AVC: "+Object(g.toMsFromMpegTsClock)(Fe,!0)+" ms ("+Fe+"dts) hole between fragments detected, filling it"):e.logger.warn("AVC: "+Object(g.toMsFromMpegTsClock)(-Fe,!0)+" ms ("+Fe+"dts) overlapping between fragments detected"),G=P;var Ae=S[0].pts-Fe;S[0].dts=G,S[0].pts=Ae,e.logger.log("Video: First PTS/DTS adjusted: "+Object(g.toMsFromMpegTsClock)(Ae,!0)+"/"+Object(g.toMsFromMpegTsClock)(G,!0)+", delta: "+Object(g.toMsFromMpegTsClock)(Fe,!0)+" ms")}}r&&(G=Math.max(0,G));for(var Y=0,se=0,pe=0;pe<I;pe++){for(var ve=S[pe],Me=ve.units,he=Me.length,me=0,_e=0;_e<he;_e++)me+=Me[_e].data.length;se+=me,Y+=he,ve.length=me,ve.dts=Math.max(ve.dts,G),ve.pts=Math.max(ve.pts,ve.dts,0),ae=Math.min(ve.pts,ae),ie=Math.max(ve.pts,ie)}z=S[I-1].dts;var Se=se+4*Y+8,Ce;try{Ce=new Uint8Array(Se)}catch(qe){this.observer.emit(B.Events.ERROR,B.Events.ERROR,{type:k.ErrorTypes.MUX_ERROR,details:k.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Se,reason:"fail allocating video mdat "+Se});return}var Oe=new DataView(Ce.buffer);Oe.setUint32(0,Se),Ce.set(R.default.types.mdat,4);for(var xe=0;xe<I;xe++){for(var Ue=S[xe],Be=Ue.units,Ee=0,De=0,de=Be.length;De<de;De++){var re=Be[De],oe=re.data,V=re.data.byteLength;Oe.setUint32(U,V),U+=4,Ce.set(oe,U),U+=V,Ee+=4+V}if(xe<I-1)O=S[xe+1].dts-Ue.dts;else{var Q=this.config,q=Ue.dts-S[xe>0?xe-1:xe].dts;if(Q.stretchShortVideoTrack&&this.nextAudioPts!==null){var ee=Math.floor(Q.maxBufferHole*b),ge=(T?ae+T*b:this.nextAudioPts)-Ue.pts;ge>ee?(O=ge-q,O<0&&(O=q),e.logger.log("[mp4-remuxer]: It is approximately "+ge/90+" ms to the next segment; using duration "+O/90+" ms for the last video frame.")):O=q}else O=q}var we=Math.round(Ue.pts-Ue.dts);D.push(new p(Ue.key,O,Ee,we))}if(D.length&&o&&o<70){var Ne=D[0].flags;Ne.dependsOn=2,Ne.isNonSync=0}console.assert(O!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=P=z+O,this.isVideoContiguous=!0;var Ge=R.default.moof(u.sequenceNumber++,G,c({},u,{samples:D})),Je="video",ze={data1:Ge,data2:Ce,startPTS:ae/b,endPTS:(ie+O)/b,startDTS:G/b,endDTS:P/b,type:Je,hasAudio:!1,hasVideo:!0,nb:D.length,dropped:u.dropped};return u.samples=[],u.dropped=0,console.assert(Ce.length,"MDAT length must not be zero"),ze},_.remuxAudio=function(u,d,f,T,b){var S=u.inputTimeScale,D=u.samplerate?u.samplerate:S,I=S/D,w=u.isAAC?n:a,P=w*I,U=this._initPTS,O=!u.isAAC&&this.typeSupported.mpeg,G=[],z=u.samples,ae=O?0:8,ie=this.nextAudioPts||-1,fe=d*S;if(this.isAudioContiguous=f=f||z.length&&ie>0&&(T&&Math.abs(fe-ie)<9e3||Math.abs(t(z[0].pts-U,fe)-ie)<20*P),z.forEach(function(oe){oe.pts=t(oe.pts-U,fe)}),!f||ie<0){if(z=z.filter(function(oe){return oe.pts>=0}),!z.length)return;b===0?ie=0:T?ie=Math.max(0,fe):ie=z[0].pts}if(u.isAAC)for(var ce=b!==void 0,J=this.config.maxAudioFramesDrift,Z=0,ue=ie;Z<z.length;Z++){var X=z[Z],$=X.pts,be=$-ue,Re=Math.abs(1e3*be/S);if(be<=-J*P&&ce)Z===0&&(e.logger.warn("Audio frame @ "+($/S).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*be/S)+" ms."),this.nextAudioPts=ie=ue=$);else if(be>=J*P&&Re<l&&ce){var Ie=Math.round(be/P);ue=$-Ie*P,ue<0&&(Ie--,ue+=P),Z===0&&(this.nextAudioPts=ie=ue),e.logger.warn("[mp4-remuxer]: Injecting "+Ie+" audio frame @ "+(ue/S).toFixed(3)+"s due to "+Math.round(1e3*be/S)+" ms gap.");for(var Le=0;Le<Ie;Le++){var Fe=Math.max(ue,0),ye=L.default.getSilentFrame(u.manifestCodec||u.codec,u.channelCount);ye||(e.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),ye=X.unit.subarray()),z.splice(Z,0,{unit:ye,pts:Fe}),ue+=P,Z++}}X.pts=ue,ue+=P}for(var Te=null,Ae=null,Y,se=0,pe=z.length;pe--;)se+=z[pe].unit.byteLength;for(var ve=0,Me=z.length;ve<Me;ve++){var he=z[ve],me=he.unit,_e=he.pts;if(Ae!==null){var Se=G[ve-1];Se.duration=Math.round((_e-Ae)/I)}else if(f&&u.isAAC&&(_e=ie),Te=_e,se>0){se+=ae;try{Y=new Uint8Array(se)}catch(oe){this.observer.emit(B.Events.ERROR,B.Events.ERROR,{type:k.ErrorTypes.MUX_ERROR,details:k.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:se,reason:"fail allocating audio mdat "+se});return}if(!O){var Ce=new DataView(Y.buffer);Ce.setUint32(0,se),Y.set(R.default.types.mdat,4)}}else return;Y.set(me,ae);var Oe=me.byteLength;ae+=Oe,G.push(new p(!0,w,Oe,0)),Ae=_e}var xe=G.length;if(!xe)return;var Ue=G[G.length-1];this.nextAudioPts=ie=Ae+I*Ue.duration;var Be=O?new Uint8Array(0):R.default.moof(u.sequenceNumber++,Te/I,c({},u,{samples:G}));u.samples=[];var Ee=Te/S,De=ie/S,de="audio",re={data1:Be,data2:Y,startPTS:Ee,endPTS:De,startDTS:Ee,endDTS:De,type:de,hasAudio:!0,hasVideo:!1,nb:xe};return this.isAudioContiguous=!0,console.assert(Y.length,"MDAT length must not be zero"),re},_.remuxEmptyAudio=function(u,d,f,T){var b=u.inputTimeScale,S=u.samplerate?u.samplerate:b,D=b/S,I=this.nextAudioPts,w=(I!==null?I:T.startDTS*b)+this._initDTS,P=T.endDTS*b+this._initDTS,U=D*n,O=Math.ceil((P-w)/U),G=L.default.getSilentFrame(u.manifestCodec||u.codec,u.channelCount);if(e.logger.warn("[mp4-remuxer]: remux empty Audio"),!G){e.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var z=[],ae=0;ae<O;ae++){var ie=w+ae*U;z.push({unit:G,pts:ie,dts:ie})}return u.samples=z,this.remuxAudio(u,d,f,!1)},_.remuxID3=function(u,d){var f=u.samples.length;if(!f)return;for(var T=u.inputTimeScale,b=this._initPTS,S=this._initDTS,D=0;D<f;D++){var I=u.samples[D];I.pts=t(I.pts-b,d*T)/T,I.dts=t(I.dts-S,d*T)/T}var w=u.samples;return u.samples=[],{samples:w}},_.remuxText=function(u,d){var f=u.samples.length;if(!f)return;for(var T=u.inputTimeScale,b=this._initPTS,S=0;S<f;S++){var D=u.samples[S];D.pts=t(D.pts-b,d*T)/T}u.samples.sort(function(w,P){return w.pts-P.pts});var I=u.samples;return u.samples=[],{samples:I}},E}();function t(E,_){var h;if(_===null)return E;for(_<E?h=-8589934592:h=8589934592;Math.abs(E-_)>4294967296;)E+=h;return E}function y(E){for(var _=0;_<E.length;_++)if(E[_].key)return _;return-1}var p=function(_,h,u,d){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=h,this.size=u,this.cts=d,this.flags=new m(_)},m=function(_){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=_?2:1,this.isNonSync=_?0:1}},"./src/remux/passthrough-remuxer.ts":function(te,H,C){"use strict";C.r(H);var j=C("./src/polyfills/number.ts"),L=C("./src/utils/mp4-tools.ts"),R=C("./src/loader/fragment.ts"),B=C("./src/utils/logger.ts"),k=function(){function g(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndDTS=null}var c=g.prototype;return c.destroy=function(){},c.resetTimeStamp=function(n){this.initPTS=n,this.lastEndDTS=null},c.resetNextTimestamp=function(){this.lastEndDTS=null},c.resetInitSegment=function(n,a,o){this.audioCodec=a,this.videoCodec=o,this.generateInitSegment(n),this.emitInitSegment=!0},c.generateInitSegment=function(n){var a=this.audioCodec,o=this.videoCodec;if(!n||!n.byteLength){this.initTracks=void 0,this.initData=void 0;return}var s=this.initData=Object(L.parseInitSegment)(n);a||(a=A(s.audio,R.ElementaryStreamTypes.AUDIO)),o||(o=A(s.video,R.ElementaryStreamTypes.VIDEO));var r={};s.audio&&s.video?r.audiovideo={container:"video/mp4",codec:a+","+o,initSegment:n,id:"main"}:s.audio?r.audio={container:"audio/mp4",codec:a,initSegment:n,id:"audio"}:s.video?r.video={container:"video/mp4",codec:o,initSegment:n,id:"main"}:B.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=r},c.remux=function(n,a,o,s,r){var i=this.initPTS,t=this.lastEndDTS,y={audio:void 0,video:void 0,text:s,id3:o,initSegment:void 0};Object(j.isFiniteNumber)(t)||(t=this.lastEndDTS=r||0);var p=a.samples;if(!p||!p.length)return y;var m={initPTS:void 0,timescale:1},E=this.initData;if((!E||!E.length)&&(this.generateInitSegment(p),E=this.initData),!E||!E.length)return B.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),y;this.emitInitSegment&&(m.tracks=this.initTracks,this.emitInitSegment=!1),Object(j.isFiniteNumber)(i)||(this.initPTS=m.initPTS=i=e(E,p,t));var _=Object(L.getDuration)(p,E),h=t,u=_+h;Object(L.offsetStartDTS)(E,p,i),_>0?this.lastEndDTS=u:(B.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var d=!!E.audio,f=!!E.video,T="";d&&(T+="audio"),f&&(T+="video");var b={data1:p,startPTS:h,startDTS:h,endPTS:u,endDTS:u,type:T,hasAudio:d,hasVideo:f,nb:1,dropped:0};return y.audio=b.type==="audio"?b:void 0,y.video=b.type!=="audio"?b:void 0,y.text=s,y.id3=o,y.initSegment=m,y},g}(),e=function(c,l,n){return Object(L.getStartDTS)(c,l)-n};function A(g,c){var l=g==null?void 0:g.codec;return l&&l.length>4?l:l==="hvc1"?"hvc1.1.c.L120.90":l==="av01"?"av01.0.04M.08":l==="avc1"||c===R.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}H.default=k},"./src/task-loop.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"default",function(){return j});var j=function(){function L(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var R=L.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(k){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,k),!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(){},L}()},"./src/types/cmcd.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"CMCDVersion",function(){return j}),C.d(H,"CMCDObjectType",function(){return L}),C.d(H,"CMCDStreamingFormat",function(){return R}),C.d(H,"CMCDStreamType",function(){return B});var j=1,L;(function(k){k.MANIFEST="m",k.AUDIO="a",k.VIDEO="v",k.MUXED="av",k.INIT="i",k.CAPTION="c",k.TIMED_TEXT="tt",k.KEY="k",k.OTHER="o"})(L||(L={}));var R;(function(k){k.DASH="d",k.HLS="h",k.SMOOTH="s",k.OTHER="o"})(R||(R={}));var B;(function(k){k.VOD="v",k.LIVE="l"})(B||(B={}))},"./src/types/level.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"HlsSkip",function(){return R}),C.d(H,"getSkipValue",function(){return B}),C.d(H,"HlsUrlParameters",function(){return k}),C.d(H,"Level",function(){return e});function j(A,g){for(var c=0;c<g.length;c++){var l=g[c];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(A,l.key,l)}}function L(A,g,c){return g&&j(A.prototype,g),c&&j(A,c),A}var R;(function(A){A.No="",A.Yes="YES",A.v2="v2"})(R||(R={}));function B(A,g){var c=A.canSkipUntil,l=A.canSkipDateRanges,n=A.endSN,a=g!==void 0?g-n:0;return c&&a<c?l?R.v2:R.Yes:R.No}var k=function(){function A(c,l,n){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=c,this.part=l,this.skip=n}var g=A.prototype;return g.addDirectives=function(l){var n=new self.URL(l);return this.msn!==void 0&&n.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&n.searchParams.set("_HLS_part",this.part.toString()),this.skip&&n.searchParams.set("_HLS_skip",this.skip),n.toString()},A}(),e=function(){function A(g){this.attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.unknownCodecs=void 0,this.audioGroupIds=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.textGroupIds=void 0,this.url=void 0,this._urlId=0,this.url=[g.url],this.attrs=g.attrs,this.bitrate=g.bitrate,g.details&&(this.details=g.details),this.id=g.id||0,this.name=g.name,this.width=g.width||0,this.height=g.height||0,this.audioCodec=g.audioCodec,this.videoCodec=g.videoCodec,this.unknownCodecs=g.unknownCodecs,this.codecSet=[g.videoCodec,g.audioCodec].filter(function(c){return c}).join(",").replace(/\.[^.,]+/g,"")}return L(A,[{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(c){var l=c%this.url.length;this._urlId!==l&&(this.details=void 0,this._urlId=l)}}]),A}()},"./src/types/loader.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"PlaylistContextType",function(){return j}),C.d(H,"PlaylistLevelType",function(){return L});var j;(function(R){R.MANIFEST="manifest",R.LEVEL="level",R.AUDIO_TRACK="audioTrack",R.SUBTITLE_TRACK="subtitleTrack"})(j||(j={}));var L;(function(R){R.MAIN="main",R.AUDIO="audio",R.SUBTITLE="subtitle"})(L||(L={}))},"./src/types/transmuxer.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"ChunkMetadata",function(){return j});var j=function(B,k,e,A,g,c){A===void 0&&(A=0),g===void 0&&(g=-1),c===void 0&&(c=!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=L(),this.buffering={audio:L(),video:L(),audiovideo:L()},this.level=B,this.sn=k,this.id=e,this.size=A,this.part=g,this.partial=c};function L(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"AttrList",function(){return R});var j=/^(\d+)x(\d+)$/,L=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,R=function(){function B(e){typeof e=="string"&&(e=B.parseAttrList(e));for(var A in e)e.hasOwnProperty(A)&&(this[A]=e[A])}var k=B.prototype;return k.decimalInteger=function(A){var g=parseInt(this[A],10);return g>Number.MAX_SAFE_INTEGER?Infinity:g},k.hexadecimalInteger=function(A){if(this[A]){var g=(this[A]||"0x").slice(2);g=(g.length&1?"0":"")+g;for(var c=new Uint8Array(g.length/2),l=0;l<g.length/2;l++)c[l]=parseInt(g.slice(l*2,l*2+2),16);return c}else return null},k.hexadecimalIntegerAsNumber=function(A){var g=parseInt(this[A],16);return g>Number.MAX_SAFE_INTEGER?Infinity:g},k.decimalFloatingPoint=function(A){return parseFloat(this[A])},k.optionalFloat=function(A,g){var c=this[A];return c?parseFloat(c):g},k.enumeratedString=function(A){return this[A]},k.bool=function(A){return this[A]==="YES"},k.decimalResolution=function(A){var g=j.exec(this[A]);return g===null?void 0:{width:parseInt(g[1],10),height:parseInt(g[2],10)}},B.parseAttrList=function(A){var g,c={},l='"';for(L.lastIndex=0;(g=L.exec(A))!==null;){var n=g[2];n.indexOf(l)===0&&n.lastIndexOf(l)===n.length-1&&(n=n.slice(1,-1)),c[g[1]]=n}return c},B}()},"./src/utils/binary-search.ts":function(te,H,C){"use strict";C.r(H);var j={search:function(R,B){for(var k=0,e=R.length-1,A=null,g=null;k<=e;){A=(k+e)/2|0,g=R[A];var c=B(g);if(c>0)k=A+1;else if(c<0)e=A-1;else return g}return null}};H.default=j},"./src/utils/buffer-helper.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"BufferHelper",function(){return R});var j=C("./src/utils/logger.ts"),L={length:0,start:function(){return 0},end:function(){return 0}},R=function(){function B(){}return B.isBuffered=function(e,A){try{if(e){for(var g=B.getBuffered(e),c=0;c<g.length;c++)if(A>=g.start(c)&&A<=g.end(c))return!0}}catch(l){}return!1},B.bufferInfo=function(e,A,g){try{if(e){var c=B.getBuffered(e),l=[],n;for(n=0;n<c.length;n++)l.push({start:c.start(n),end:c.end(n)});return this.bufferedInfo(l,A,g)}}catch(a){}return{len:0,start:A,end:A,nextStart:void 0}},B.bufferedInfo=function(e,A,g){A=Math.max(0,A),e.sort(function(m,E){var _=m.start-E.start;return _||E.end-m.end});var c=[];if(g)for(var l=0;l<e.length;l++){var n=c.length;if(n){var a=c[n-1].end;e[l].start-a<g?e[l].end>a&&(c[n-1].end=e[l].end):c.push(e[l])}else c.push(e[l])}else c=e;for(var o=0,s,r=A,i=A,t=0;t<c.length;t++){var y=c[t].start,p=c[t].end;if(A+g>=y&&A<p)r=y,i=p,o=i-A;else if(A+g<y){s=y;break}}return{len:o,start:r||0,end:i||0,nextStart:s}},B.getBuffered=function(e){try{return e.buffered}catch(A){return j.logger.log("failed to get media.buffered",A),L}},B}()},"./src/utils/cea-608-parser.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"Row",function(){return i}),C.d(H,"CaptionScreen",function(){return t});var j=C("./src/utils/logger.ts"),L={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 L.hasOwnProperty(u)&&(d=L[u]),String.fromCharCode(d)},B=15,k=100,e={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},A={17:2,18:4,21:6,22:8,23:10,19:13,20:15},g={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},c={25:2,26:4,29:6,30:8,31:10,27:13,28:15},l=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],n;(function(h){h[h.ERROR=0]="ERROR",h[h.TEXT=1]="TEXT",h[h.WARNING=2]="WARNING",h[h.INFO=2]="INFO",h[h.DEBUG=3]="DEBUG",h[h.DATA=3]="DATA"})(n||(n={}));var a=function(){function h(){this.time=null,this.verboseLevel=n.ERROR}var u=h.prototype;return u.log=function(f,T){this.verboseLevel>=f&&j.logger.log(this.time+" ["+f+"] "+T)},h}(),o=function(u){for(var d=[],f=0;f<u.length;f++)d.push(u[f].toString(16));return d},s=function(){function h(d,f,T,b,S){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=f||!1,this.italics=T||!1,this.background=b||"black",this.flash=S||!1}var u=h.prototype;return u.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},u.setStyles=function(f){for(var T=["foreground","underline","italics","background","flash"],b=0;b<T.length;b++){var S=T[b];f.hasOwnProperty(S)&&(this[S]=f[S])}},u.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},u.equals=function(f){return this.foreground===f.foreground&&this.underline===f.underline&&this.italics===f.italics&&this.background===f.background&&this.flash===f.flash},u.copy=function(f){this.foreground=f.foreground,this.underline=f.underline,this.italics=f.italics,this.background=f.background,this.flash=f.flash},u.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},h}(),r=function(){function h(d,f,T,b,S,D){this.uchar=void 0,this.penState=void 0,this.uchar=d||" ",this.penState=new s(f,T,b,S,D)}var u=h.prototype;return u.reset=function(){this.uchar=" ",this.penState.reset()},u.setChar=function(f,T){this.uchar=f,this.penState.copy(T)},u.setPenState=function(f){this.penState.copy(f)},u.equals=function(f){return this.uchar===f.uchar&&this.penState.equals(f.penState)},u.copy=function(f){this.uchar=f.uchar,this.penState.copy(f.penState)},u.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},h}(),i=function(){function h(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 f=0;f<k;f++)this.chars.push(new r);this.logger=d,this.pos=0,this.currPenState=new s}var u=h.prototype;return u.equals=function(f){for(var T=!0,b=0;b<k;b++)if(!this.chars[b].equals(f.chars[b])){T=!1;break}return T},u.copy=function(f){for(var T=0;T<k;T++)this.chars[T].copy(f.chars[T])},u.isEmpty=function(){for(var f=!0,T=0;T<k;T++)if(!this.chars[T].isEmpty()){f=!1;break}return f},u.setCursor=function(f){this.pos!==f&&(this.pos=f),this.pos<0?(this.logger.log(n.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>k&&(this.logger.log(n.DEBUG,"Too large cursor position "+this.pos),this.pos=k)},u.moveCursor=function(f){var T=this.pos+f;if(f>1)for(var b=this.pos+1;b<T+1;b++)this.chars[b].setPenState(this.currPenState);this.setCursor(T)},u.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},u.insertChar=function(f){f>=144&&this.backSpace();var T=R(f);if(this.pos>=k){this.logger.log(n.ERROR,"Cannot insert "+f.toString(16)+" ("+T+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(T,this.currPenState),this.moveCursor(1)},u.clearFromPos=function(f){var T;for(T=f;T<k;T++)this.chars[T].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 f=[],T=!0,b=0;b<k;b++){var S=this.chars[b].uchar;S!==" "&&(T=!1),f.push(S)}return T?"":f.join("")},u.setPenStyles=function(f){this.currPenState.setStyles(f);var T=this.chars[this.pos];T.setPenState(this.currPenState)},h}(),t=function(){function h(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 f=0;f<B;f++)this.rows.push(new i(d));this.logger=d,this.currRow=B-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var u=h.prototype;return u.reset=function(){for(var f=0;f<B;f++)this.rows[f].clear();this.currRow=B-1},u.equals=function(f){for(var T=!0,b=0;b<B;b++)if(!this.rows[b].equals(f.rows[b])){T=!1;break}return T},u.copy=function(f){for(var T=0;T<B;T++)this.rows[T].copy(f.rows[T])},u.isEmpty=function(){for(var f=!0,T=0;T<B;T++)if(!this.rows[T].isEmpty()){f=!1;break}return f},u.backSpace=function(){var f=this.rows[this.currRow];f.backSpace()},u.clearToEndOfRow=function(){var f=this.rows[this.currRow];f.clearToEndOfRow()},u.insertChar=function(f){var T=this.rows[this.currRow];T.insertChar(f)},u.setPen=function(f){var T=this.rows[this.currRow];T.setPenStyles(f)},u.moveCursor=function(f){var T=this.rows[this.currRow];T.moveCursor(f)},u.setCursor=function(f){this.logger.log(n.INFO,"setCursor: "+f);var T=this.rows[this.currRow];T.setCursor(f)},u.setPAC=function(f){this.logger.log(n.INFO,"pacData = "+JSON.stringify(f));var T=f.row-1;if(this.nrRollUpRows&&T<this.nrRollUpRows-1&&(T=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==T){for(var b=0;b<B;b++)this.rows[b].clear();var S=this.currRow+1-this.nrRollUpRows,D=this.lastOutputScreen;if(D){var I=D.rows[S].cueStartTime,w=this.logger.time;if(I&&w!==null&&I<w)for(var P=0;P<this.nrRollUpRows;P++)this.rows[T-this.nrRollUpRows+P+1].copy(D.rows[S+P])}}this.currRow=T;var U=this.rows[this.currRow];if(f.indent!==null){var O=f.indent,G=Math.max(O-1,0);U.setCursor(f.indent),f.color=U.chars[G].penState.foreground}var z={foreground:f.color,underline:f.underline,italics:f.italics,background:"black",flash:!1};this.setPen(z)},u.setBkgData=function(f){this.logger.log(n.INFO,"bkgData = "+JSON.stringify(f)),this.backSpace(),this.setPen(f),this.insertChar(32)},u.setRollUpRows=function(f){this.nrRollUpRows=f},u.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(n.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(n.TEXT,this.getDisplayText());var f=this.currRow+1-this.nrRollUpRows,T=this.rows.splice(f,1)[0];T.clear(),this.rows.splice(this.currRow,0,T),this.logger.log(n.INFO,"Rolling up")},u.getDisplayText=function(f){f=f||!1;for(var T=[],b="",S=-1,D=0;D<B;D++){var I=this.rows[D].getTextString();I&&(S=D+1,f?T.push("Row "+S+": '"+I+"'"):T.push(I.trim()))}return T.length>0&&(f?b="["+T.join(" | ")+"]":b=T.join(`
`)),b},u.getTextAndFormat=function(){return this.rows},h}(),y=function(){function h(d,f,T){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=f,this.mode=null,this.verbose=0,this.displayedMemory=new t(T),this.nonDisplayedMemory=new t(T),this.lastOutputScreen=new t(T),this.currRollUpRow=this.displayedMemory.rows[B-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=T}var u=h.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[B-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},u.getHandler=function(){return this.outputFilter},u.setHandler=function(f){this.outputFilter=f},u.setPAC=function(f){this.writeScreen.setPAC(f)},u.setBkgData=function(f){this.writeScreen.setBkgData(f)},u.setMode=function(f){if(f===this.mode)return;this.mode=f,this.logger.log(n.INFO,"MODE="+f),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=f},u.insertChars=function(f){for(var T=0;T<f.length;T++)this.writeScreen.insertChar(f[T]);var b=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(n.INFO,b+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(n.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},u.ccRCL=function(){this.logger.log(n.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},u.ccBS=function(){if(this.logger.log(n.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(n.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},u.ccRU=function(f){this.logger.log(n.INFO,"RU("+f+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(f)},u.ccFON=function(){this.logger.log(n.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},u.ccRDC=function(){this.logger.log(n.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},u.ccTR=function(){this.logger.log(n.INFO,"TR"),this.setMode("MODE_TEXT")},u.ccRTD=function(){this.logger.log(n.INFO,"RTD"),this.setMode("MODE_TEXT")},u.ccEDM=function(){this.logger.log(n.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},u.ccCR=function(){this.logger.log(n.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},u.ccENM=function(){this.logger.log(n.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},u.ccEOC=function(){if(this.logger.log(n.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var f=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=f,this.writeScreen=this.nonDisplayedMemory,this.logger.log(n.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},u.ccTO=function(f){this.logger.log(n.INFO,"TO("+f+") - Tab Offset"),this.writeScreen.moveCursor(f)},u.ccMIDROW=function(f){var T={flash:!1};if(T.underline=f%2===1,T.italics=f>=46,T.italics)T.foreground="white";else{var b=Math.floor(f/2)-16,S=["white","green","blue","cyan","red","yellow","magenta"];T.foreground=S[b]}this.logger.log(n.INFO,"MIDROW: "+JSON.stringify(T)),this.writeScreen.setPen(T)},u.outputDataUpdate=function(f){f===void 0&&(f=!1);var T=this.logger.time;if(T===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=T:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,T,this.lastOutputScreen),f&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:T),this.lastOutputScreen.copy(this.displayedMemory))},u.cueSplitAtTime=function(f){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,f,this.displayedMemory),this.cueStartTime=f))},h}(),p=function(){function h(d,f,T){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var b=new a;this.channels=[null,new y(d,f,b),new y(d+1,T,b)],this.cmdHistory=_(),this.logger=b}var u=h.prototype;return u.getHandler=function(f){return this.channels[f].getHandler()},u.setHandler=function(f,T){this.channels[f].setHandler(T)},u.addData=function(f,T){var b,S,D,I=!1;this.logger.time=f;for(var w=0;w<T.length;w+=2){if(S=T[w]&127,D=T[w+1]&127,S===0&&D===0)continue;if(this.logger.log(n.DATA,"["+o([T[w],T[w+1]])+"] -> ("+o([S,D])+")"),b=this.parseCmd(S,D),b||(b=this.parseMidrow(S,D)),b||(b=this.parsePAC(S,D)),b||(b=this.parseBackgroundAttributes(S,D)),!b&&(I=this.parseChars(S,D),I)){var P=this.currentChannel;if(P&&P>0){var U=this.channels[P];U.insertChars(I)}else this.logger.log(n.WARNING,"No channel found yet. TEXT-MODE?")}!b&&!I&&this.logger.log(n.WARNING,"Couldn't parse cleaned data "+o([S,D])+" orig: "+o([T[w],T[w+1]]))}},u.parseCmd=function(f,T){var b=this.cmdHistory,S=(f===20||f===28||f===21||f===29)&&T>=32&&T<=47,D=(f===23||f===31)&&T>=33&&T<=35;if(!(S||D))return!1;if(E(f,T,b))return m(null,null,b),this.logger.log(n.DEBUG,"Repeated command ("+o([f,T])+") is dropped"),!0;var I=f===20||f===21||f===23?1:2,w=this.channels[I];return f===20||f===21||f===28||f===29?T===32?w.ccRCL():T===33?w.ccBS():T===34?w.ccAOF():T===35?w.ccAON():T===36?w.ccDER():T===37?w.ccRU(2):T===38?w.ccRU(3):T===39?w.ccRU(4):T===40?w.ccFON():T===41?w.ccRDC():T===42?w.ccTR():T===43?w.ccRTD():T===44?w.ccEDM():T===45?w.ccCR():T===46?w.ccENM():T===47&&w.ccEOC():w.ccTO(T-32),m(f,T,b),this.currentChannel=I,!0},u.parseMidrow=function(f,T){var b=0;if((f===17||f===25)&&T>=32&&T<=47){if(f===17?b=1:b=2,b!==this.currentChannel)return this.logger.log(n.ERROR,"Mismatch channel in midrow parsing"),!1;var S=this.channels[b];return S?(S.ccMIDROW(T),this.logger.log(n.DEBUG,"MIDROW ("+o([f,T])+")"),!0):!1}return!1},u.parsePAC=function(f,T){var b,S=this.cmdHistory,D=(f>=17&&f<=23||f>=25&&f<=31)&&T>=64&&T<=127,I=(f===16||f===24)&&T>=64&&T<=95;if(!(D||I))return!1;if(E(f,T,S))return m(null,null,S),!0;var w=f<=23?1:2;T>=64&&T<=95?b=w===1?e[f]:g[f]:b=w===1?A[f]:c[f];var P=this.channels[w];return P?(P.setPAC(this.interpretPAC(b,T)),m(f,T,S),this.currentChannel=w,!0):!1},u.interpretPAC=function(f,T){var b,S={color:null,italics:!1,indent:null,underline:!1,row:f};return T>95?b=T-96:b=T-64,S.underline=(b&1)===1,b<=13?S.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(b/2)]:b<=15?(S.italics=!0,S.color="white"):S.indent=Math.floor((b-16)/2)*4,S},u.parseChars=function(f,T){var b,S=null,D=null;if(f>=25?(b=2,D=f-8):(b=1,D=f),D>=17&&D<=19){var I;D===17?I=T+80:D===18?I=T+112:I=T+144,this.logger.log(n.INFO,"Special char '"+R(I)+"' in channel "+b),S=[I]}else f>=32&&f<=127&&(S=T===0?[f]:[f,T]);if(S){var w=o(S);this.logger.log(n.DEBUG,"Char codes = "+w.join(",")),m(f,T,this.cmdHistory)}return S},u.parseBackgroundAttributes=function(f,T){var b=(f===16||f===24)&&T>=32&&T<=47,S=(f===23||f===31)&&T>=45&&T<=47;if(!(b||S))return!1;var D,I={};f===16||f===24?(D=Math.floor((T-32)/2),I.background=l[D],T%2===1&&(I.background=I.background+"_semi")):T===45?I.background="transparent":(I.foreground="black",T===47&&(I.underline=!0));var w=f<=23?1:2,P=this.channels[w];return P.setBkgData(I),m(f,T,this.cmdHistory),!0},u.reset=function(){for(var f=0;f<Object.keys(this.channels).length;f++){var T=this.channels[f];T&&T.reset()}this.cmdHistory=_()},u.cueSplitAtTime=function(f){for(var T=0;T<this.channels.length;T++){var b=this.channels[T];b&&b.cueSplitAtTime(f)}},h}();function m(h,u,d){d.a=h,d.b=u}function E(h,u,d){return d.a===h&&d.b===u}function _(){return{a:null,b:null}}H.default=p},"./src/utils/codecs.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"isCodecType",function(){return L}),C.d(H,"isCodecSupportedInMp4",function(){return R});var j={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 L(B,k){var e=j[k];return!!e&&e[B.slice(0,4)]===!0}function R(B,k){return MediaSource.isTypeSupported((k||"video")+'/mp4;codecs="'+B+'"')}},"./src/utils/cues.ts":function(te,H,C){"use strict";C.r(H);var j=C("./src/utils/vttparser.ts"),L=C("./src/utils/webvtt-parser.ts"),R=C("./src/utils/texttrack-utils.ts"),B=/\s/,k={newCue:function(A,g,c,l){for(var n=[],a,o,s,r,i,t=self.VTTCue||self.TextTrackCue,y=0;y<l.rows.length;y++)if(a=l.rows[y],s=!0,r=0,i="",!a.isEmpty()){for(var p=0;p<a.chars.length;p++)B.test(a.chars[p].uchar)&&s?r++:(i+=a.chars[p].uchar,s=!1);a.cueStartTime=g,g===c&&(c+=1e-4),r>=16?r--:r++;var m=Object(j.fixLineBreaks)(i.trim()),E=Object(L.generateCueId)(g,c,m);(!A||!A.cues||!A.cues.getCueById(E))&&(o=new t(g,c,m),o.id=E,o.line=y+1,o.align="left",o.position=10+Math.min(80,Math.floor(r*8/32)*10),n.push(o))}return A&&n.length&&(n.sort(function(_,h){return _.line==="auto"||h.line==="auto"?0:_.line>8&&h.line>8?h.line-_.line:_.line-h.line}),n.forEach(function(_){return Object(R.addCueToTrack)(A,_)})),n}};H.default=k},"./src/utils/discontinuities.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"findFirstFragWithCC",function(){return B}),C.d(H,"shouldAlignOnDiscontinuities",function(){return k}),C.d(H,"findDiscontinuousReferenceFrag",function(){return e}),C.d(H,"adjustSlidingStart",function(){return g}),C.d(H,"alignStream",function(){return c}),C.d(H,"alignPDT",function(){return n}),C.d(H,"alignFragmentByPDTDelta",function(){return a}),C.d(H,"alignMediaPlaylistByPDT",function(){return o});var j=C("./src/polyfills/number.ts"),L=C("./src/utils/logger.ts"),R=C("./src/controller/level-helper.ts");function B(s,r){for(var i=null,t=0,y=s.length;t<y;t++){var p=s[t];if(p&&p.cc===r){i=p;break}}return i}function k(s,r,i){return!!(r.details&&(i.endCC>i.startCC||s&&s.cc<i.startCC))}function e(s,r){var i=s.fragments,t=r.fragments;if(!t.length||!i.length){L.logger.log("No fragments to align");return}var y=B(i,t[0].cc);if(!y||y&&!y.startPTS){L.logger.log("No frag in previous level to align on");return}return y}function A(s,r){if(s){var i=s.start+r;s.start=s.startPTS=i,s.endPTS=i+s.duration}}function g(s,r){for(var i=r.fragments,t=0,y=i.length;t<y;t++)A(i[t],s);r.fragmentHint&&A(r.fragmentHint,s),r.alignedSliding=!0}function c(s,r,i){if(!r)return;l(s,i,r),!i.alignedSliding&&r.details&&n(i,r.details),!i.alignedSliding&&r.details&&!i.skippedSegments&&Object(R.adjustSliding)(r.details,i)}function l(s,r,i){if(k(s,i,r)){var t=e(i.details,r);t&&Object(j.isFiniteNumber)(t.start)&&(L.logger.log("Adjusting PTS using last level due to CC increase within current level "+r.url),g(t.start,r))}}function n(s,r){if(!r.fragments.length||!s.hasProgramDateTime||!r.hasProgramDateTime)return;var i=r.fragments[0].programDateTime,t=s.fragments[0].programDateTime,y=(t-i)/1e3+r.fragments[0].start;y&&Object(j.isFiniteNumber)(y)&&(L.logger.log("Adjusting PTS using programDateTime delta "+(t-i)+"ms, sliding:"+y.toFixed(3)+" "+s.url+" "),g(y,s))}function a(s,r){var i=s.programDateTime;if(!i)return;var t=(i-r)/1e3;s.start=s.startPTS=t,s.endPTS=t+s.duration}function o(s,r){if(!r.fragments.length||!s.hasProgramDateTime||!r.hasProgramDateTime)return;var i=r.fragments[0].programDateTime,t=r.fragments[0].start,y=i-t*1e3;s.fragments.forEach(function(p){a(p,y)}),s.fragmentHint&&a(s.fragmentHint,y),s.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(te,H,C){"use strict";C.r(H);var j=C("./src/utils/ewma.ts"),L=function(){function R(k,e,A){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=A,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new j.default(k),this.fast_=new j.default(e)}var B=R.prototype;return B.update=function(e,A){var g=this.slow_,c=this.fast_;this.slow_.halfLife!==e&&(this.slow_=new j.default(e,g.getEstimate(),g.getTotalWeight())),this.fast_.halfLife!==A&&(this.fast_=new j.default(A,c.getEstimate(),c.getTotalWeight()))},B.sample=function(e,A){e=Math.max(e,this.minDelayMs_);var g=8*A,c=e/1e3,l=g/c;this.fast_.sample(c,l),this.slow_.sample(c,l)},B.canEstimate=function(){var e=this.fast_;return e&&e.getTotalWeight()>=this.minWeight_},B.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},B.destroy=function(){},R}();H.default=L},"./src/utils/ewma.ts":function(te,H,C){"use strict";C.r(H);var j=function(){function L(B,k,e){k===void 0&&(k=0),e===void 0&&(e=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=B,this.alpha_=B?Math.exp(Math.log(.5)/B):0,this.estimate_=k,this.totalWeight_=e}var R=L.prototype;return R.sample=function(k,e){var A=Math.pow(this.alpha_,k);this.estimate_=e*(1-A)+A*this.estimate_,this.totalWeight_+=k},R.getTotalWeight=function(){return this.totalWeight_},R.getEstimate=function(){if(this.alpha_){var k=1-Math.pow(this.alpha_,this.totalWeight_);if(k)return this.estimate_/k}return this.estimate_},L}();H.default=j},"./src/utils/fetch-loader.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"fetchSupported",function(){return a});var j=C("./src/polyfills/number.ts"),L=C("./src/loader/load-stats.ts"),R=C("./src/demux/chunk-cache.ts");function B(t,y){t.prototype=Object.create(y.prototype),t.prototype.constructor=t,c(t,y)}function k(t){var y=typeof Map=="function"?new Map:void 0;return k=function(m){if(m===null||!g(m))return m;if(typeof m!="function")throw new TypeError("Super expression must either be null or a function");if(typeof y!="undefined"){if(y.has(m))return y.get(m);y.set(m,E)}function E(){return e(m,arguments,l(this).constructor)}return E.prototype=Object.create(m.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),c(E,m)},k(t)}function e(t,y,p){return A()?e=Reflect.construct:e=function(E,_,h){var u=[null];u.push.apply(u,_);var d=Function.bind.apply(E,u),f=new d;return h&&c(f,h.prototype),f},e.apply(null,arguments)}function A(){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(t){return!1}}function g(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function c(t,y){return c=Object.setPrototypeOf||function(m,E){return m.__proto__=E,m},c(t,y)}function l(t){return l=Object.setPrototypeOf?Object.getPrototypeOf:function(p){return p.__proto__||Object.getPrototypeOf(p)},l(t)}function n(){return n=Object.assign||function(t){for(var y=1;y<arguments.length;y++){var p=arguments[y];for(var m in p)Object.prototype.hasOwnProperty.call(p,m)&&(t[m]=p[m])}return t},n.apply(this,arguments)}function a(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(t){}return!1}var o=function(){function t(p){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=p.fetchSetup||r,this.controller=new self.AbortController,this.stats=new L.LoadStats}var y=t.prototype;return y.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},y.abortInternal=function(){var m=this.response;(!m||!m.ok)&&(this.stats.aborted=!0,this.controller.abort())},y.abort=function(){var m;this.abortInternal(),(m=this.callbacks)!==null&&m!==void 0&&m.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},y.load=function(m,E,_){var h=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=s(m,this.controller.signal),f=_.onProgress,T=m.responseType==="arraybuffer",b=T?"byteLength":"length";this.context=m,this.config=E,this.callbacks=_,this.request=this.fetchSetup(m,d),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){h.abortInternal(),_.onTimeout(u,m,h.response)},E.timeout),self.fetch(this.request).then(function(S){if(h.response=h.loader=S,!S.ok){var D=S.status,I=S.statusText;throw new i(I||"fetch, bad network response",D,S)}return u.loading.first=Math.max(self.performance.now(),u.loading.start),u.total=parseInt(S.headers.get("Content-Length")||"0"),f&&Object(j.isFiniteNumber)(E.highWaterMark)?h.loadProgressively(S,u,m,E.highWaterMark,f):T?S.arrayBuffer():S.text()}).then(function(S){var D=h.response;self.clearTimeout(h.requestTimeout),u.loading.end=Math.max(self.performance.now(),u.loading.first),u.loaded=u.total=S[b];var I={url:D.url,data:S};f&&!Object(j.isFiniteNumber)(E.highWaterMark)&&f(u,m,S,D),_.onSuccess(I,u,m,D)}).catch(function(S){if(self.clearTimeout(h.requestTimeout),u.aborted)return;var D=S.code||0;_.onError({code:D,text:S.message},m,S.details)})},y.getCacheAge=function(){var m=null;if(this.response){var E=this.response.headers.get("age");m=E?parseFloat(E):null}return m},y.loadProgressively=function(m,E,_,h,u){h===void 0&&(h=0);var d=new R.default,f=m.body.getReader(),T=function b(){return f.read().then(function(S){if(S.done)return d.dataLength&&u(E,_,d.flush(),m),Promise.resolve(new ArrayBuffer(0));var D=S.value,I=D.length;return E.loaded+=I,I<h||d.dataLength?(d.push(D),d.dataLength>=h&&u(E,_,d.flush(),m)):u(E,_,D,m),b()}).catch(function(){return Promise.reject()})};return T()},t}();function s(t,y){var p={method:"GET",mode:"cors",credentials:"same-origin",signal:y,headers:new self.Headers(n({},t.headers))};return t.rangeEnd&&p.headers.set("Range","bytes="+t.rangeStart+"-"+String(t.rangeEnd-1)),p}function r(t,y){return new self.Request(t.url,y)}var i=function(t){B(y,t);function y(p,m,E){var _;return _=t.call(this,p)||this,_.code=void 0,_.details=void 0,_.code=m,_.details=E,_}return y}(k(Error));H.default=o},"./src/utils/imsc1-ttml-parser.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"IMSC1_CODEC",function(){return g}),C.d(H,"parseIMSC1",function(){return a});var j=C("./src/utils/mp4-tools.ts"),L=C("./src/utils/vttparser.ts"),R=C("./src/utils/vttcue.ts"),B=C("./src/demux/id3.ts"),k=C("./src/utils/timescale-conversion.ts"),e=C("./src/utils/webvtt-parser.ts");function A(){return A=Object.assign||function(h){for(var u=1;u<arguments.length;u++){var d=arguments[u];for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(h[f]=d[f])}return h},A.apply(this,arguments)}var g="stpp.ttml.im1t",c=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,l=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,n={left:"start",center:"center",right:"end",start:"start",end:"end"};function a(h,u,d,f,T){var b=Object(j.findBox)(new Uint8Array(h),["mdat"]);if(b.length===0){T(new Error("Could not parse IMSC1 mdat"));return}var S=b[0],D=Object(B.utf8ArrayToStr)(new Uint8Array(h,S.start,S.end-S.start)),I=Object(k.toTimescaleFromScale)(u,1,d);try{f(o(D,I))}catch(w){T(w)}}function o(h,u){var d=new DOMParser,f=d.parseFromString(h,"text/xml"),T=f.getElementsByTagName("tt")[0];if(!T)throw new Error("Invalid ttml");var b={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},S=Object.keys(b).reduce(function(U,O){return U[O]=T.getAttribute("ttp:"+O)||b[O],U},{}),D=T.getAttribute("xml:space")!=="preserve",I=r(s(T,"styling","style")),w=r(s(T,"layout","region")),P=s(T,"body","[begin]");return[].map.call(P,function(U){var O=i(U,D);if(!O||!U.hasAttribute("begin"))return null;var G=m(U.getAttribute("begin"),S),z=m(U.getAttribute("dur"),S),ae=m(U.getAttribute("end"),S);if(G===null)throw p(U);if(ae===null){if(z===null)throw p(U);ae=G+z}var ie=new R.default(G-u,ae-u,O);ie.id=Object(e.generateCueId)(ie.startTime,ie.endTime,ie.text);var fe=w[U.getAttribute("region")],ce=I[U.getAttribute("style")];ie.position=10,ie.size=80;var J=t(fe,ce),Z=J.textAlign;if(Z){var ue=n[Z];ue&&(ie.lineAlign=ue),ie.align=Z}return A(ie,J),ie}).filter(function(U){return U!==null})}function s(h,u,d){var f=h.getElementsByTagName(u)[0];return f?[].slice.call(f.querySelectorAll(d)):[]}function r(h){return h.reduce(function(u,d){var f=d.getAttribute("xml:id");return f&&(u[f]=d),u},{})}function i(h,u){return[].slice.call(h.childNodes).reduce(function(d,f,T){var b;return f.nodeName==="br"&&T?d+`
`:(b=f.childNodes)!==null&&b!==void 0&&b.length?i(f,u):u?d+f.textContent.trim().replace(/\s+/g," "):d+f.textContent},"")}function t(h,u){var d="http://www.w3.org/ns/ttml#styling",f=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return f.reduce(function(T,b){var S=y(u,d,b)||y(h,d,b);return S&&(T[b]=S),T},{})}function y(h,u,d){return h.hasAttributeNS(u,d)?h.getAttributeNS(u,d):null}function p(h){return new Error("Could not parse ttml timestamp "+h)}function m(h,u){if(!h)return null;var d=Object(L.parseTimeStamp)(h);return d===null&&(c.test(h)?d=E(h,u):l.test(h)&&(d=_(h,u))),d}function E(h,u){var d=c.exec(h),f=(d[4]|0)+(d[5]|0)/u.subFrameRate;return(d[1]|0)*3600+(d[2]|0)*60+(d[3]|0)+f/u.frameRate}function _(h,u){var d=l.exec(h),f=Number(d[1]),T=d[2];switch(T){case"h":return f*3600;case"m":return f*60;case"ms":return f*1e3;case"f":return f/u.frameRate;case"t":return f/u.tickRate}return f}},"./src/utils/logger.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"enableLogs",function(){return e}),C.d(H,"logger",function(){return A});var j=function(){},L={trace:j,debug:j,log:j,warn:j,info:j,error:j},R=L;function B(g){var c=self.console[g];return c?c.bind(self.console,"["+g+"] >"):j}function k(g){for(var c=arguments.length,l=new Array(c>1?c-1:0),n=1;n<c;n++)l[n-1]=arguments[n];l.forEach(function(a){R[a]=g[a]?g[a].bind(g):B(a)})}function e(g){if(self.console&&g===!0||typeof g=="object"){k(g,"debug","log","info","warn","error");try{R.log()}catch(c){R=L}}else R=L}var A=R},"./src/utils/mediakeys-helper.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"KeySystems",function(){return j}),C.d(H,"requestMediaKeySystemAccess",function(){return L});var j;(function(R){R.WIDEVINE="com.widevine.alpha",R.PLAYREADY="com.microsoft.playready"})(j||(j={}));var L=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"getMediaSource",function(){return j});function j(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"bin2str",function(){return k}),C.d(H,"readUint16",function(){return e}),C.d(H,"readUint32",function(){return A}),C.d(H,"writeUint32",function(){return g}),C.d(H,"findBox",function(){return c}),C.d(H,"parseSegmentIndex",function(){return l}),C.d(H,"parseInitSegment",function(){return n}),C.d(H,"getStartDTS",function(){return a}),C.d(H,"getDuration",function(){return o}),C.d(H,"computeRawDurationFromSamples",function(){return s}),C.d(H,"offsetStartDTS",function(){return r}),C.d(H,"segmentValidRange",function(){return i}),C.d(H,"appendUint8Array",function(){return t});var j=C("./src/utils/typed-array.ts"),L=C("./src/loader/fragment.ts"),R=Math.pow(2,32)-1,B=[].push;function k(y){return String.fromCharCode.apply(null,y)}function e(y,p){"data"in y&&(p+=y.start,y=y.data);var m=y[p]<<8|y[p+1];return m<0?65536+m:m}function A(y,p){"data"in y&&(p+=y.start,y=y.data);var m=y[p]<<24|y[p+1]<<16|y[p+2]<<8|y[p+3];return m<0?4294967296+m:m}function g(y,p,m){"data"in y&&(p+=y.start,y=y.data),y[p]=m>>24,y[p+1]=m>>16&255,y[p+2]=m>>8&255,y[p+3]=m&255}function c(y,p){var m=[];if(!p.length)return m;var E,_,h;"data"in y?(E=y.data,_=y.start,h=y.end):(E=y,_=0,h=E.byteLength);for(var u=_;u<h;){var d=A(E,u),f=k(E.subarray(u+4,u+8)),T=d>1?u+d:h;if(f===p[0])if(p.length===1)m.push({data:E,start:u+8,end:T});else{var b=c({data:E,start:u+8,end:T},p.slice(1));b.length&&B.apply(m,b)}u=T}return m}function l(y){var p=c(y,["moov"]),m=p[0],E=m?m.end:null,_=c(y,["sidx"]);if(!_||!_[0])return null;var h=[],u=_[0],d=u.data[0],f=d===0?8:16,T=A(u,f);f+=4;var b=0,S=0;d===0?f+=8:f+=16,f+=2;var D=u.end+S,I=e(u,f);f+=2;for(var w=0;w<I;w++){var P=f,U=A(u,P);P+=4;var O=U&2147483647,G=(U&2147483648)>>>31;if(G===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var z=A(u,P);P+=4,h.push({referenceSize:O,subsegmentDuration:z,info:{duration:z/T,start:D,end:D+O-1}}),D+=O,P+=4,f=P}return{earliestPresentationTime:b,timescale:T,version:d,referencesCount:I,references:h,moovEndOffset:E}}function n(y){for(var p=[],m=c(y,["moov","trak"]),E=0;E<m.length;E++){var _=m[E],h=c(_,["tkhd"])[0];if(h){var u=h.data[h.start],d=u===0?12:20,f=A(h,d),T=c(_,["mdia","mdhd"])[0];if(T){u=T.data[T.start],d=u===0?12:20;var b=A(T,d),S=c(_,["mdia","hdlr"])[0];if(S){var D=k(S.data.subarray(S.start+8,S.start+12)),I={soun:L.ElementaryStreamTypes.AUDIO,vide:L.ElementaryStreamTypes.VIDEO}[D];if(I){var w=c(_,["mdia","minf","stbl","stsd"])[0],P=void 0;w&&(P=k(w.data.subarray(w.start+12,w.start+16))),p[f]={timescale:b,type:I},p[I]={timescale:b,id:f,codec:P}}}}}}var U=c(y,["moov","mvex","trex"]);return U.forEach(function(O){var G=A(O,4),z=p[G];z&&(z.default={duration:A(O,12),flags:A(O,20)})}),p}function a(y,p){return c(p,["moof","traf"]).reduce(function(m,E){var _=c(E,["tfdt"])[0],h=_.data[_.start],u=c(E,["tfhd"]).reduce(function(d,f){var T=A(f,4),b=y[T];if(b){var S=A(_,4);h===1&&(S*=Math.pow(2,32),S+=A(_,8));var D=b.timescale||9e4,I=S/D;if(isFinite(I)&&(d===null||I<d))return I}return d},null);return u!==null&&isFinite(u)&&(m===null||u<m)?u:m},null)||0}function o(y,p){for(var m=0,E=0,_=0,h=c(y,["moof","traf"]),u=0;u<h.length;u++){var d=h[u],f=c(d,["tfhd"])[0],T=A(f,4),b=p[T];if(!b)continue;var S=b.default,D=A(f,0)|(S==null?void 0:S.flags),I=S==null?void 0:S.duration;D&8&&(D&2?I=A(f,12):I=A(f,8));for(var w=b.timescale||9e4,P=c(d,["trun"]),U=0;U<P.length;U++){if(I){var O=A(P[U],4);m=I*O}else m=s(P[U]);b.type===L.ElementaryStreamTypes.VIDEO?E+=m/w:b.type===L.ElementaryStreamTypes.AUDIO&&(_+=m/w)}}if(E===0&&_===0){var G=l(y);if(G!=null&&G.references)return G.references.reduce(function(z,ae){return z+ae.info.duration||0},0)}return E||_}function s(y){var p=A(y,0),m=8;p&1&&(m+=4),p&4&&(m+=4);for(var E=0,_=A(y,4),h=0;h<_;h++){if(p&256){var u=A(y,m);E+=u,m+=4}p&512&&(m+=4),p&1024&&(m+=4),p&2048&&(m+=4)}return E}function r(y,p,m){c(p,["moof","traf"]).forEach(function(E){c(E,["tfhd"]).forEach(function(_){var h=A(_,4),u=y[h];if(!u)return;var d=u.timescale||9e4;c(E,["tfdt"]).forEach(function(f){var T=f.data[f.start],b=A(f,4);if(T===0)g(f,4,b-m*d);else{b*=Math.pow(2,32),b+=A(f,8),b-=m*d,b=Math.max(b,0);var S=Math.floor(b/(R+1)),D=Math.floor(b%(R+1));g(f,4,S),g(f,8,D)}})})})}function i(y){var p={valid:null,remainder:null},m=c(y,["moof"]);if(m){if(m.length<2)return p.remainder=y,p}else return p;var E=m[m.length-1];return p.valid=Object(j.sliceUint8)(y,0,E.start-8),p.remainder=Object(j.sliceUint8)(y,E.start-8),p}function t(y,p){var m=new Uint8Array(y.length+p.length);return m.set(y),m.set(p,y.length),m}},"./src/utils/output-filter.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"default",function(){return j});var j=function(){function L(B,k){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=B,this.trackName=k}var R=L.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(k,e,A){(this.startTime===null||this.startTime>k)&&(this.startTime=k),this.endTime=e,this.screen=A,this.timelineController.createCaptionsTrack(this.trackName)},R.reset=function(){this.cueRanges=[]},L}()},"./src/utils/texttrack-utils.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"sendAddTrackEvent",function(){return L}),C.d(H,"addCueToTrack",function(){return R}),C.d(H,"clearCurrentCues",function(){return B}),C.d(H,"removeCuesInRange",function(){return k}),C.d(H,"getCuesInRange",function(){return A});var j=C("./src/utils/logger.ts");function L(g,c){var l;try{l=new Event("addtrack")}catch(n){l=document.createEvent("Event"),l.initEvent("addtrack",!1,!1)}l.track=g,c.dispatchEvent(l)}function R(g,c){var l=g.mode;if(l==="disabled"&&(g.mode="hidden"),g.cues&&!g.cues.getCueById(c.id))try{if(g.addCue(c),!g.cues.getCueById(c.id))throw new Error("addCue is failed for: "+c)}catch(a){j.logger.debug("[texttrack-utils]: "+a);var n=new self.TextTrackCue(c.startTime,c.endTime,c.text);n.id=c.id,g.addCue(n)}l==="disabled"&&(g.mode=l)}function B(g){var c=g.mode;if(c==="disabled"&&(g.mode="hidden"),g.cues)for(var l=g.cues.length;l--;)g.removeCue(g.cues[l]);c==="disabled"&&(g.mode=c)}function k(g,c,l){var n=g.mode;if(n==="disabled"&&(g.mode="hidden"),g.cues&&g.cues.length>0)for(var a=A(g.cues,c,l),o=0;o<a.length;o++)g.removeCue(a[o]);n==="disabled"&&(g.mode=n)}function e(g,c){if(c<g[0].startTime)return 0;var l=g.length-1;if(c>g[l].endTime)return-1;for(var n=0,a=l;n<=a;){var o=Math.floor((a+n)/2);if(c<g[o].startTime)a=o-1;else if(c>g[o].startTime&&n<l)n=o+1;else return o}return g[n].startTime-c<c-g[a].startTime?n:a}function A(g,c,l){var n=[],a=e(g,c);if(a>-1)for(var o=a,s=g.length;o<s;o++){var r=g[o];if(r.startTime>=c&&r.endTime<=l)n.push(r);else if(r.startTime>l)return n}return n}},"./src/utils/time-ranges.ts":function(te,H,C){"use strict";C.r(H);var j={toString:function(R){for(var B="",k=R.length,e=0;e<k;e++)B+="["+R.start(e).toFixed(3)+","+R.end(e).toFixed(3)+"]";return B}};H.default=j},"./src/utils/timescale-conversion.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"toTimescaleFromBase",function(){return L}),C.d(H,"toTimescaleFromScale",function(){return R}),C.d(H,"toMsFromMpegTsClock",function(){return B}),C.d(H,"toMpegTsClockFromTimescale",function(){return k});var j=9e4;function L(e,A,g,c){g===void 0&&(g=1),c===void 0&&(c=!1);var l=e*A*g;return c?Math.round(l):l}function R(e,A,g,c){return g===void 0&&(g=1),c===void 0&&(c=!1),L(e,A,1/g,c)}function B(e,A){return A===void 0&&(A=!1),L(e,1e3,1/j,A)}function k(e,A){return A===void 0&&(A=1),L(e,j,1/A)}},"./src/utils/typed-array.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"sliceUint8",function(){return j});function j(L,R,B){return Uint8Array.prototype.slice?L.slice(R,B):new Uint8Array(Array.prototype.slice.call(L,R,B))}},"./src/utils/vttcue.ts":function(te,H,C){"use strict";C.r(H),H.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var j=["","lr","rl"],L=["start","middle","end","left","right"];function R(g,c){if(typeof c!="string")return!1;if(!Array.isArray(g))return!1;var l=c.toLowerCase();return~g.indexOf(l)?l:!1}function B(g){return R(j,g)}function k(g){return R(L,g)}function e(g){for(var c=arguments.length,l=new Array(c>1?c-1:0),n=1;n<c;n++)l[n-1]=arguments[n];for(var a=1;a<arguments.length;a++){var o=arguments[a];for(var s in o)g[s]=o[s]}return g}function A(g,c,l){var n=this,a={enumerable:!0};n.hasBeenReset=!1;var o="",s=!1,r=g,i=c,t=l,y=null,p="",m=!0,E="auto",_="start",h=50,u="middle",d=50,f="middle";Object.defineProperty(n,"id",e({},a,{get:function(){return o},set:function(b){o=""+b}})),Object.defineProperty(n,"pauseOnExit",e({},a,{get:function(){return s},set:function(b){s=!!b}})),Object.defineProperty(n,"startTime",e({},a,{get:function(){return r},set:function(b){if(typeof b!="number")throw new TypeError("Start time must be set to a number.");r=b,this.hasBeenReset=!0}})),Object.defineProperty(n,"endTime",e({},a,{get:function(){return i},set:function(b){if(typeof b!="number")throw new TypeError("End time must be set to a number.");i=b,this.hasBeenReset=!0}})),Object.defineProperty(n,"text",e({},a,{get:function(){return t},set:function(b){t=""+b,this.hasBeenReset=!0}})),Object.defineProperty(n,"region",e({},a,{get:function(){return y},set:function(b){y=b,this.hasBeenReset=!0}})),Object.defineProperty(n,"vertical",e({},a,{get:function(){return p},set:function(b){var S=B(b);if(S===!1)throw new SyntaxError("An invalid or illegal string was specified.");p=S,this.hasBeenReset=!0}})),Object.defineProperty(n,"snapToLines",e({},a,{get:function(){return m},set:function(b){m=!!b,this.hasBeenReset=!0}})),Object.defineProperty(n,"line",e({},a,{get:function(){return E},set:function(b){if(typeof b!="number"&&b!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");E=b,this.hasBeenReset=!0}})),Object.defineProperty(n,"lineAlign",e({},a,{get:function(){return _},set:function(b){var S=k(b);if(!S)throw new SyntaxError("An invalid or illegal string was specified.");_=S,this.hasBeenReset=!0}})),Object.defineProperty(n,"position",e({},a,{get:function(){return h},set:function(b){if(b<0||b>100)throw new Error("Position must be between 0 and 100.");h=b,this.hasBeenReset=!0}})),Object.defineProperty(n,"positionAlign",e({},a,{get:function(){return u},set:function(b){var S=k(b);if(!S)throw new SyntaxError("An invalid or illegal string was specified.");u=S,this.hasBeenReset=!0}})),Object.defineProperty(n,"size",e({},a,{get:function(){return d},set:function(b){if(b<0||b>100)throw new Error("Size must be between 0 and 100.");d=b,this.hasBeenReset=!0}})),Object.defineProperty(n,"align",e({},a,{get:function(){return f},set:function(b){var S=k(b);if(!S)throw new SyntaxError("An invalid or illegal string was specified.");f=S,this.hasBeenReset=!0}})),n.displayState=void 0}return A.prototype.getCueAsHTML=function(){var g=self.WebVTT;return g.convertCueToDOMTree(self,this.text)},A}()},"./src/utils/vttparser.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"parseTimeStamp",function(){return R}),C.d(H,"fixLineBreaks",function(){return c}),C.d(H,"VTTParser",function(){return l});var j=C("./src/utils/vttcue.ts"),L=function(){function n(){}var a=n.prototype;return a.decode=function(s,r){if(!s)return"";if(typeof s!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(s))},n}();function R(n){function a(s,r,i,t){return(s|0)*3600+(r|0)*60+(i|0)+parseFloat(t||0)}var o=n.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return o?parseFloat(o[2])>59?a(o[2],o[3],0,o[4]):a(o[1],o[2],o[3],o[4]):null}var B=function(){function n(){this.values=Object.create(null)}var a=n.prototype;return a.set=function(s,r){!this.get(s)&&r!==""&&(this.values[s]=r)},a.get=function(s,r,i){return i?this.has(s)?this.values[s]:r[i]:this.has(s)?this.values[s]:r},a.has=function(s){return s in this.values},a.alt=function(s,r,i){for(var t=0;t<i.length;++t)if(r===i[t]){this.set(s,r);break}},a.integer=function(s,r){/^-?\d+$/.test(r)&&this.set(s,parseInt(r,10))},a.percent=function(s,r){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(r)){var i=parseFloat(r);if(i>=0&&i<=100)return this.set(s,i),!0}return!1},n}();function k(n,a,o,s){var r=s?n.split(s):[n];for(var i in r){if(typeof r[i]!="string")continue;var t=r[i].split(o);if(t.length!==2)continue;var y=t[0],p=t[1];a(y,p)}}var e=new j.default(0,0,""),A=e.align==="middle"?"middle":"center";function g(n,a,o){var s=n;function r(){var y=R(n);if(y===null)throw new Error("Malformed timestamp: "+s);return n=n.replace(/^[^\sa-zA-Z-]+/,""),y}function i(y,p){var m=new B;k(y,function(h,u){var d;switch(h){case"region":for(var f=o.length-1;f>=0;f--)if(o[f].id===u){m.set(h,o[f].region);break}break;case"vertical":m.alt(h,u,["rl","lr"]);break;case"line":d=u.split(","),m.integer(h,d[0]),m.percent(h,d[0])&&m.set("snapToLines",!1),m.alt(h,d[0],["auto"]),d.length===2&&m.alt("lineAlign",d[1],["start",A,"end"]);break;case"position":d=u.split(","),m.percent(h,d[0]),d.length===2&&m.alt("positionAlign",d[1],["start",A,"end","line-left","line-right","auto"]);break;case"size":m.percent(h,u);break;case"align":m.alt(h,u,["start",A,"end","left","right"]);break}},/:/,/\s/),p.region=m.get("region",null),p.vertical=m.get("vertical","");var E=m.get("line","auto");E==="auto"&&e.line===-1&&(E=-1),p.line=E,p.lineAlign=m.get("lineAlign","start"),p.snapToLines=m.get("snapToLines",!0),p.size=m.get("size",100),p.align=m.get("align",A);var _=m.get("position","auto");_==="auto"&&e.position===50&&(_=p.align==="start"||p.align==="left"?0:p.align==="end"||p.align==="right"?100:50),p.position=_}function t(){n=n.replace(/^\s+/,"")}if(t(),a.startTime=r(),t(),n.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+s);n=n.substr(3),t(),a.endTime=r(),t(),i(n,a)}function c(n){return n.replace(/<br(?: \/)?>/gi,`
`)}var l=function(){function n(){this.state="INITIAL",this.buffer="",this.decoder=new L,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var a=n.prototype;return a.parse=function(s){var r=this;s&&(r.buffer+=r.decoder.decode(s,{stream:!0}));function i(){var _=r.buffer,h=0;for(_=c(_);h<_.length&&_[h]!=="\r"&&_[h]!==`
`;)++h;var u=_.substr(0,h);return _[h]==="\r"&&++h,_[h]===`
`&&++h,r.buffer=_.substr(h),u}function t(_){k(_,function(h,u){},/:/)}try{var y="";if(r.state==="INITIAL"){if(!/\r\n|\n/.test(r.buffer))return this;y=i();var p=y.match(/^()?WEBVTT([ \t].*)?$/);if(!p||!p[0])throw new Error("Malformed WebVTT signature.");r.state="HEADER"}for(var m=!1;r.buffer;){if(!/\r\n|\n/.test(r.buffer))return this;m?m=!1:y=i();switch(r.state){case"HEADER":/:/.test(y)?t(y):y||(r.state="ID");continue;case"NOTE":y||(r.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(y)){r.state="NOTE";break}if(!y)continue;if(r.cue=new j.default(0,0,""),r.state="CUE",y.indexOf("-->")===-1){r.cue.id=y;continue}case"CUE":if(!r.cue){r.state="BADCUE";continue}try{g(y,r.cue,r.regionList)}catch(_){r.cue=null,r.state="BADCUE";continue}r.state="CUETEXT";continue;case"CUETEXT":{var E=y.indexOf("-->")!==-1;if(!y||E&&(m=!0)){r.oncue&&r.cue&&r.oncue(r.cue),r.cue=null,r.state="ID";continue}if(r.cue===null)continue;r.cue.text&&(r.cue.text+=`
`),r.cue.text+=y}continue;case"BADCUE":y||(r.state="ID")}}}catch(_){r.state==="CUETEXT"&&r.cue&&r.oncue&&r.oncue(r.cue),r.cue=null,r.state=r.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},a.flush=function(){var s=this;try{if((s.cue||s.state==="HEADER")&&(s.buffer+=`
`,s.parse()),s.state==="INITIAL"||s.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(r){s.onparsingerror&&s.onparsingerror(r)}return s.onflush&&s.onflush(),this},n}()},"./src/utils/webvtt-parser.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"generateCueId",function(){return l}),C.d(H,"parseWebVTT",function(){return a});var j=C("./src/polyfills/number.ts"),L=C("./src/utils/vttparser.ts"),R=C("./src/demux/id3.ts"),B=C("./src/utils/timescale-conversion.ts"),k=C("./src/remux/mp4-remuxer.ts"),e=/\r\n|\n\r|\n|\r/g,A=function(s,r,i){return i===void 0&&(i=0),s.substr(i,r.length)===r},g=function(s){var r=parseInt(s.substr(-3)),i=parseInt(s.substr(-6,2)),t=parseInt(s.substr(-9,2)),y=s.length>9?parseInt(s.substr(0,s.indexOf(":"))):0;if(!Object(j.isFiniteNumber)(r)||!Object(j.isFiniteNumber)(i)||!Object(j.isFiniteNumber)(t)||!Object(j.isFiniteNumber)(y))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+s);return r+=1e3*i,r+=60*1e3*t,r+=60*60*1e3*y,r},c=function(s){for(var r=5381,i=s.length;i;)r=r*33^s.charCodeAt(--i);return(r>>>0).toString()};function l(o,s,r){return c(o.toString())+c(s.toString())+c(r)}var n=function(s,r,i){var t=s[r],y=s[t.prevCC];if(!y||!y.new&&t.new){s.ccOffset=s.presentationOffset=t.start,t.new=!1;return}for(;(p=y)!==null&&p!==void 0&&p.new;){var p;s.ccOffset+=t.start-y.start,t.new=!1,t=y,y=s[t.prevCC]}s.presentationOffset=i};function a(o,s,r,i,t,y,p,m){var E=new L.VTTParser,_=Object(R.utf8ArrayToStr)(new Uint8Array(o)).trim().replace(e,`
`).split(`
`),h=[],u=Object(B.toMpegTsClockFromTimescale)(s,r),d="00:00.000",f=0,T=0,b,S=!0,D=!1;E.oncue=function(I){var w=i[t],P=i.ccOffset,U=(f-u)/9e4;if(w!=null&&w.new&&(T!==void 0?P=i.ccOffset=w.start:n(i,t,U)),U&&(P=U-i.presentationOffset),D){var O=I.endTime-I.startTime,G=Object(k.normalizePts)((I.startTime+P-T)*9e4,y*9e4)/9e4;I.startTime=G,I.endTime=G+O}var z=I.text.trim();I.text=decodeURIComponent(encodeURIComponent(z)),I.id||(I.id=l(I.startTime,I.endTime,z)),I.endTime>0&&h.push(I)},E.onparsingerror=function(I){b=I},E.onflush=function(){if(b){m(b);return}p(h)},_.forEach(function(I){if(S)if(A(I,"X-TIMESTAMP-MAP=")){S=!1,D=!0,I.substr(16).split(",").forEach(function(w){A(w,"LOCAL:")?d=w.substr(6):A(w,"MPEGTS:")&&(f=parseInt(w.substr(7)))});try{T=g(d)/1e3}catch(w){D=!1,b=w}return}else I===""&&(S=!1);E.parse(I+`
`)}),E.flush()}},"./src/utils/xhr-loader.ts":function(te,H,C){"use strict";C.r(H);var j=C("./src/utils/logger.ts"),L=C("./src/loader/load-stats.ts"),R=/^age:\s*[\d.]+\s*$/m,B=function(){function k(A){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=A?A.xhrSetup:null,this.stats=new L.LoadStats,this.retryDelay=0}var e=k.prototype;return e.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},e.abortInternal=function(){var g=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),g&&(g.onreadystatechange=null,g.onprogress=null,g.readyState!==4&&(this.stats.aborted=!0,g.abort()))},e.abort=function(){var g;this.abortInternal(),(g=this.callbacks)!==null&&g!==void 0&&g.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},e.load=function(g,c,l){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=g,this.config=c,this.callbacks=l,this.retryDelay=c.retryDelay,this.loadInternal()},e.loadInternal=function(){var g=this.config,c=this.context;if(!g)return;var l=this.loader=new self.XMLHttpRequest,n=this.stats;n.loading.first=0,n.loaded=0;var a=this.xhrSetup;try{if(a)try{a(l,c.url)}catch(r){l.open("GET",c.url,!0),a(l,c.url)}l.readyState||l.open("GET",c.url,!0);var o=this.context.headers;if(o)for(var s in o)l.setRequestHeader(s,o[s])}catch(r){this.callbacks.onError({code:l.status,text:r.message},c,l);return}c.rangeEnd&&l.setRequestHeader("Range","bytes="+c.rangeStart+"-"+(c.rangeEnd-1)),l.onreadystatechange=this.readystatechange.bind(this),l.onprogress=this.loadprogress.bind(this),l.responseType=c.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),g.timeout),l.send()},e.readystatechange=function(){var g=this.context,c=this.loader,l=this.stats;if(!g||!c)return;var n=c.readyState,a=this.config;if(l.aborted)return;if(n>=2)if(self.clearTimeout(this.requestTimeout),l.loading.first===0&&(l.loading.first=Math.max(self.performance.now(),l.loading.start)),n===4){c.onreadystatechange=null,c.onprogress=null;var o=c.status;if(o>=200&&o<300){l.loading.end=Math.max(self.performance.now(),l.loading.first);var s,r;if(g.responseType==="arraybuffer"?(s=c.response,r=s.byteLength):(s=c.responseText,r=s.length),l.loaded=l.total=r,!this.callbacks)return;var i=this.callbacks.onProgress;if(i&&i(l,g,s,c),!this.callbacks)return;var t={url:c.responseURL,data:s};this.callbacks.onSuccess(t,l,g,c)}else l.retry>=a.maxRetry||o>=400&&o<499?(j.logger.error(o+" while loading "+g.url),this.callbacks.onError({code:o,text:c.statusText},g,c)):(j.logger.warn(o+" while loading "+g.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,a.maxRetryDelay),l.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),a.timeout)},e.loadtimeout=function(){j.logger.warn("timeout while loading "+this.context.url);var g=this.callbacks;g&&(this.abortInternal(),g.onTimeout(this.stats,this.context,this.loader))},e.loadprogress=function(g){var c=this.stats;c.loaded=g.loaded,g.lengthComputable&&(c.total=g.total)},e.getCacheAge=function(){var g=null;if(this.loader&&R.test(this.loader.getAllResponseHeaders())){var c=this.loader.getResponseHeader("age");g=c?parseFloat(c):null}return g},k}();H.default=B}}).default})},vHTk:function(Qe,le,W){Qe.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}}}]);